Skip to content

Commit 7a0e721

Browse files
authored
Merge pull request #156 from ndaidong/3.1.3
v3.1.3
2 parents a7004c9 + 2d3aa46 commit 7a0e721

9 files changed

+176
-30
lines changed

dist/cjs/index.d.ts

+50-9
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@
55
// Marc McIntosh <https://github.com/MarcMcIntosh>
66
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
77

8-
export function extract(url: string, params?: any): Promise<OembedData>;
9-
10-
export function hasProvider(url: string): boolean
11-
12-
export function findProvider(url: string): FindProviderResult
13-
14-
export function setProviderList(providers: Provider[]): void
15-
168
export interface Endpoint {
179
schemes?: string[];
1810
url: string;
1911
formats?: string[]; // "json" "xml"
2012
discovery?: boolean;
2113
}
22-
14+
2315
export interface Provider {
2416
"provider_name": string;
2517
"provider_url": string;
@@ -113,3 +105,52 @@ export interface RichTypeData extends OembedData {
113105
/** The height in pixels required to display the HTML. */
114106
height: number;
115107
}
108+
109+
export interface Params {
110+
/**
111+
* max width of embed size
112+
* Default: null
113+
*/
114+
maxwidth: number
115+
/**
116+
* max height of embed size
117+
* Default: null
118+
*/
119+
maxheight: number
120+
/**
121+
* theme for the embed, such as "dark" or "light"
122+
* Default: null
123+
*/
124+
theme: string
125+
/**
126+
* language for the embed, e.g. "en", "fr", "vi", etc
127+
* Default: null
128+
*/
129+
lang: string
130+
}
131+
132+
export interface ProxyConfig {
133+
target?: string;
134+
headers?: string[];
135+
}
136+
137+
export interface FetchOptions {
138+
/**
139+
* list of request headers
140+
* default: null
141+
*/
142+
headers?: string[];
143+
/**
144+
* the values to configure proxy
145+
* default: null
146+
*/
147+
proxy?: ProxyConfig;
148+
}
149+
150+
export function extract(url: string, params?: Params, fetchOptions?: FetchOptions): Promise<OembedData>;
151+
152+
export function hasProvider(url: string): boolean
153+
154+
export function findProvider(url: string): FindProviderResult
155+
156+
export function setProviderList(providers: Provider[]): void

dist/cjs/oembed-parser.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// [email protected].2, by @ndaidong - built with esbuild at 2022-10-13T02:16:48.560Z - published under MIT license
1+
// [email protected].3, by @ndaidong - built with esbuild at 2022-10-26T05:04:53.355Z - published under MIT license
22
var __create = Object.create;
33
var __defProp = Object.defineProperty;
44
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -3955,7 +3955,7 @@ var providers = [
39553955
"s": [
39563956
"pod\\.univ-lille\\.fr/video/*"
39573957
],
3958-
"e": "pod.univ-lille.fr/oembed"
3958+
"e": "pod.univ-lille.fr/video/oembed"
39593959
},
39603960
{
39613961
"s": [
@@ -4262,6 +4262,12 @@ var providers = [
42624262
],
42634263
"e": "api.picturelfy.com/service/oembed/"
42644264
},
4265+
{
4266+
"s": [
4267+
"*\\.builder\\.pikasso\\.xyz/embed/*"
4268+
],
4269+
"e": "builder.pikasso.xyz/api/oembed"
4270+
},
42654271
{
42664272
"s": [],
42674273
"e": "beta.pingvp.com.kpnis.nl/p/oembed.php"

dist/cjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "oembed-parser",
3-
"version": "3.1.2",
3+
"version": "3.1.3",
44
"main": "./oembed-parser.js"
55
}

dist/oembed-parser.esm.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// [email protected].2, by @ndaidong - built with esbuild at 2022-10-13T02:16:48.560Z - published under MIT license
1+
// [email protected].3, by @ndaidong - built with esbuild at 2022-10-26T05:04:53.355Z - published under MIT license
22

33
// src/utils/linker.js
44
var isValid = (url = "") => {
@@ -1052,7 +1052,7 @@ var providers = [
10521052
"s": [
10531053
"pod\\.univ-lille\\.fr/video/*"
10541054
],
1055-
"e": "pod.univ-lille.fr/oembed"
1055+
"e": "pod.univ-lille.fr/video/oembed"
10561056
},
10571057
{
10581058
"s": [
@@ -1359,6 +1359,12 @@ var providers = [
13591359
],
13601360
"e": "api.picturelfy.com/service/oembed/"
13611361
},
1362+
{
1363+
"s": [
1364+
"*\\.builder\\.pikasso\\.xyz/embed/*"
1365+
],
1366+
"e": "builder.pikasso.xyz/api/oembed"
1367+
},
13621368
{
13631369
"s": [],
13641370
"e": "beta.pingvp.com.kpnis.nl/p/oembed.php"

index.d.ts

+50-9
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,13 @@
55
// Marc McIntosh <https://github.com/MarcMcIntosh>
66
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
77

8-
export function extract(url: string, params?: any): Promise<OembedData>;
9-
10-
export function hasProvider(url: string): boolean
11-
12-
export function findProvider(url: string): FindProviderResult
13-
14-
export function setProviderList(providers: Provider[]): void
15-
168
export interface Endpoint {
179
schemes?: string[];
1810
url: string;
1911
formats?: string[]; // "json" "xml"
2012
discovery?: boolean;
2113
}
22-
14+
2315
export interface Provider {
2416
"provider_name": string;
2517
"provider_url": string;
@@ -113,3 +105,52 @@ export interface RichTypeData extends OembedData {
113105
/** The height in pixels required to display the HTML. */
114106
height: number;
115107
}
108+
109+
export interface Params {
110+
/**
111+
* max width of embed size
112+
* Default: null
113+
*/
114+
maxwidth: number
115+
/**
116+
* max height of embed size
117+
* Default: null
118+
*/
119+
maxheight: number
120+
/**
121+
* theme for the embed, such as "dark" or "light"
122+
* Default: null
123+
*/
124+
theme: string
125+
/**
126+
* language for the embed, e.g. "en", "fr", "vi", etc
127+
* Default: null
128+
*/
129+
lang: string
130+
}
131+
132+
export interface ProxyConfig {
133+
target?: string;
134+
headers?: string[];
135+
}
136+
137+
export interface FetchOptions {
138+
/**
139+
* list of request headers
140+
* default: null
141+
*/
142+
headers?: string[];
143+
/**
144+
* the values to configure proxy
145+
* default: null
146+
*/
147+
proxy?: ProxyConfig;
148+
}
149+
150+
export function extract(url: string, params?: Params, fetchOptions?: FetchOptions): Promise<OembedData>;
151+
152+
export function hasProvider(url: string): boolean
153+
154+
export function findProvider(url: string): FindProviderResult
155+
156+
export function setProviderList(providers: Provider[]): void

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "3.1.2",
2+
"version": "3.1.3",
33
"name": "oembed-parser",
44
"description": "Get oEmbed data from given URL.",
55
"homepage": "https://www.npmjs.com/package/oembed-parser",
@@ -39,8 +39,8 @@
3939
"cross-fetch": "^3.1.5"
4040
},
4141
"devDependencies": {
42-
"esbuild": "^0.15.10",
43-
"jest": "^29.1.2",
42+
"esbuild": "^0.15.12",
43+
"jest": "^29.2.2",
4444
"nock": "^13.2.9",
4545
"standard": "^17.0.0"
4646
},

src/utils/providers.latest.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// provider data, synchronized at 2022-10-13T02:14:43.201Z
1+
// provider data, synchronized at 2022-10-26T05:04:37.983Z
22

33
/* eslint-disable */
44

@@ -974,7 +974,7 @@ export const providers = [
974974
"s": [
975975
"pod\\.univ-lille\\.fr/video/*"
976976
],
977-
"e": "pod.univ-lille.fr/oembed"
977+
"e": "pod.univ-lille.fr/video/oembed"
978978
},
979979
{
980980
"s": [
@@ -1281,6 +1281,12 @@ export const providers = [
12811281
],
12821282
"e": "api.picturelfy.com/service/oembed/"
12831283
},
1284+
{
1285+
"s": [
1286+
"*\\.builder\\.pikasso\\.xyz/embed/*"
1287+
],
1288+
"e": "builder.pikasso.xyz/api/oembed"
1289+
},
12841290
{
12851291
"s": [],
12861292
"e": "beta.pingvp.com.kpnis.nl/p/oembed.php"

src/utils/providers.orginal.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,7 @@
20362036
"schemes": [
20372037
"https://pod.univ-lille.fr/video/*"
20382038
],
2039-
"url": "https://pod.univ-lille.fr/oembed",
2039+
"url": "https://pod.univ-lille.fr/video/oembed",
20402040
"discovery": true
20412041
}
20422042
]
@@ -2690,6 +2690,22 @@
26902690
}
26912691
]
26922692
},
2693+
{
2694+
"provider_name": "Pikasso",
2695+
"provider_url": "https://builder.pikasso.xyz",
2696+
"endpoints": [
2697+
{
2698+
"schemes": [
2699+
"https://*.builder.pikasso.xyz/embed/*"
2700+
],
2701+
"url": "https://builder.pikasso.xyz/api/oembed",
2702+
"discovery": true,
2703+
"formats": [
2704+
"json"
2705+
]
2706+
}
2707+
]
2708+
},
26932709
{
26942710
"provider_name": "PingVP",
26952711
"provider_url": "https://www.pingvp.com/",

src/utils/providers.prev.js

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// provider data, synchronized at 2022-09-19T09:58:06.421Z
1+
// provider data, synchronized at 2022-10-13T02:14:43.201Z
22

33
/* eslint-disable */
44

@@ -437,6 +437,13 @@ export const providers = [
437437
],
438438
"e": "www.docdroid.net/api/oembed"
439439
},
440+
{
441+
"s": [
442+
"docswell\\.com/*/*",
443+
"www\\.docswell\\.com/*/*"
444+
],
445+
"e": "www.docswell.com/service/oembed"
446+
},
440447
{
441448
"s": [
442449
"dotsub\\.com/view/*"
@@ -944,6 +951,13 @@ export const providers = [
944951
],
945952
"e": "embed.kooapp.com/services/oembed"
946953
},
954+
{
955+
"s": [
956+
"kurozora\\.app/episodes*",
957+
"kurozora\\.app/songs*"
958+
],
959+
"e": "kurozora.app/oembed"
960+
},
947961
{
948962
"s": [
949963
"learningapps\\.org/*"
@@ -1063,6 +1077,12 @@ export const providers = [
10631077
],
10641078
"e": "oembed.minervaknows.com"
10651079
},
1080+
{
1081+
"s": [
1082+
"miro\\.com/app/board/*"
1083+
],
1084+
"e": "miro.com/api/v1/oembed"
1085+
},
10661086
{
10671087
"s": [
10681088
"www\\.mixcloud\\.com/*/*/"
@@ -1586,6 +1606,15 @@ export const providers = [
15861606
],
15871607
"e": "open.spotify.com/oembed"
15881608
},
1609+
{
1610+
"s": [
1611+
"*\\.spotlightr\\.com/watch/*",
1612+
"*\\.spotlightr\\.com/publish/*",
1613+
"*\\.cdn\\.spotlightr\\.com/watch/*",
1614+
"*\\.cdn\\.spotlightr\\.com/publish/*"
1615+
],
1616+
"e": "api.spotlightr.com/getOEmbed"
1617+
},
15891618
{
15901619
"s": [
15911620
"*\\.spreaker\\.com/*"
@@ -1694,6 +1723,7 @@ export const providers = [
16941723
},
16951724
{
16961725
"s": [
1726+
"www\\.tiktok\\.com/*",
16971727
"www\\.tiktok\\.com/*/video/*"
16981728
],
16991729
"e": "www.tiktok.com/oembed"

0 commit comments

Comments
 (0)