Skip to content

Commit

Permalink
Merge pull request #156 from ndaidong/3.1.3
Browse files Browse the repository at this point in the history
v3.1.3
  • Loading branch information
ndaidong authored Oct 26, 2022
2 parents a7004c9 + 2d3aa46 commit 7a0e721
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 30 deletions.
59 changes: 50 additions & 9 deletions dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,13 @@
// Marc McIntosh <https://github.com/MarcMcIntosh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export function extract(url: string, params?: any): Promise<OembedData>;

export function hasProvider(url: string): boolean

export function findProvider(url: string): FindProviderResult

export function setProviderList(providers: Provider[]): void

export interface Endpoint {
schemes?: string[];
url: string;
formats?: string[]; // "json" "xml"
discovery?: boolean;
}

export interface Provider {
"provider_name": string;
"provider_url": string;
Expand Down Expand Up @@ -113,3 +105,52 @@ export interface RichTypeData extends OembedData {
/** The height in pixels required to display the HTML. */
height: number;
}

export interface Params {
/**
* max width of embed size
* Default: null
*/
maxwidth: number
/**
* max height of embed size
* Default: null
*/
maxheight: number
/**
* theme for the embed, such as "dark" or "light"
* Default: null
*/
theme: string
/**
* language for the embed, e.g. "en", "fr", "vi", etc
* Default: null
*/
lang: string
}

export interface ProxyConfig {
target?: string;
headers?: string[];
}

export interface FetchOptions {
/**
* list of request headers
* default: null
*/
headers?: string[];
/**
* the values to configure proxy
* default: null
*/
proxy?: ProxyConfig;
}

export function extract(url: string, params?: Params, fetchOptions?: FetchOptions): Promise<OembedData>;

export function hasProvider(url: string): boolean

export function findProvider(url: string): FindProviderResult

export function setProviderList(providers: Provider[]): void
10 changes: 8 additions & 2 deletions dist/cjs/oembed-parser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// [email protected].2, by @ndaidong - built with esbuild at 2022-10-13T02:16:48.560Z - published under MIT license
// [email protected].3, by @ndaidong - built with esbuild at 2022-10-26T05:04:53.355Z - published under MIT license
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
Expand Down Expand Up @@ -3955,7 +3955,7 @@ var providers = [
"s": [
"pod\\.univ-lille\\.fr/video/*"
],
"e": "pod.univ-lille.fr/oembed"
"e": "pod.univ-lille.fr/video/oembed"
},
{
"s": [
Expand Down Expand Up @@ -4262,6 +4262,12 @@ var providers = [
],
"e": "api.picturelfy.com/service/oembed/"
},
{
"s": [
"*\\.builder\\.pikasso\\.xyz/embed/*"
],
"e": "builder.pikasso.xyz/api/oembed"
},
{
"s": [],
"e": "beta.pingvp.com.kpnis.nl/p/oembed.php"
Expand Down
2 changes: 1 addition & 1 deletion dist/cjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "oembed-parser",
"version": "3.1.2",
"version": "3.1.3",
"main": "./oembed-parser.js"
}
10 changes: 8 additions & 2 deletions dist/oembed-parser.esm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// [email protected].2, by @ndaidong - built with esbuild at 2022-10-13T02:16:48.560Z - published under MIT license
// [email protected].3, by @ndaidong - built with esbuild at 2022-10-26T05:04:53.355Z - published under MIT license

// src/utils/linker.js
var isValid = (url = "") => {
Expand Down Expand Up @@ -1052,7 +1052,7 @@ var providers = [
"s": [
"pod\\.univ-lille\\.fr/video/*"
],
"e": "pod.univ-lille.fr/oembed"
"e": "pod.univ-lille.fr/video/oembed"
},
{
"s": [
Expand Down Expand Up @@ -1359,6 +1359,12 @@ var providers = [
],
"e": "api.picturelfy.com/service/oembed/"
},
{
"s": [
"*\\.builder\\.pikasso\\.xyz/embed/*"
],
"e": "builder.pikasso.xyz/api/oembed"
},
{
"s": [],
"e": "beta.pingvp.com.kpnis.nl/p/oembed.php"
Expand Down
59 changes: 50 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,13 @@
// Marc McIntosh <https://github.com/MarcMcIntosh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export function extract(url: string, params?: any): Promise<OembedData>;

export function hasProvider(url: string): boolean

export function findProvider(url: string): FindProviderResult

export function setProviderList(providers: Provider[]): void

export interface Endpoint {
schemes?: string[];
url: string;
formats?: string[]; // "json" "xml"
discovery?: boolean;
}

export interface Provider {
"provider_name": string;
"provider_url": string;
Expand Down Expand Up @@ -113,3 +105,52 @@ export interface RichTypeData extends OembedData {
/** The height in pixels required to display the HTML. */
height: number;
}

export interface Params {
/**
* max width of embed size
* Default: null
*/
maxwidth: number
/**
* max height of embed size
* Default: null
*/
maxheight: number
/**
* theme for the embed, such as "dark" or "light"
* Default: null
*/
theme: string
/**
* language for the embed, e.g. "en", "fr", "vi", etc
* Default: null
*/
lang: string
}

export interface ProxyConfig {
target?: string;
headers?: string[];
}

export interface FetchOptions {
/**
* list of request headers
* default: null
*/
headers?: string[];
/**
* the values to configure proxy
* default: null
*/
proxy?: ProxyConfig;
}

export function extract(url: string, params?: Params, fetchOptions?: FetchOptions): Promise<OembedData>;

export function hasProvider(url: string): boolean

export function findProvider(url: string): FindProviderResult

export function setProviderList(providers: Provider[]): void
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.1.2",
"version": "3.1.3",
"name": "oembed-parser",
"description": "Get oEmbed data from given URL.",
"homepage": "https://www.npmjs.com/package/oembed-parser",
Expand Down Expand Up @@ -39,8 +39,8 @@
"cross-fetch": "^3.1.5"
},
"devDependencies": {
"esbuild": "^0.15.10",
"jest": "^29.1.2",
"esbuild": "^0.15.12",
"jest": "^29.2.2",
"nock": "^13.2.9",
"standard": "^17.0.0"
},
Expand Down
10 changes: 8 additions & 2 deletions src/utils/providers.latest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// provider data, synchronized at 2022-10-13T02:14:43.201Z
// provider data, synchronized at 2022-10-26T05:04:37.983Z

/* eslint-disable */

Expand Down Expand Up @@ -974,7 +974,7 @@ export const providers = [
"s": [
"pod\\.univ-lille\\.fr/video/*"
],
"e": "pod.univ-lille.fr/oembed"
"e": "pod.univ-lille.fr/video/oembed"
},
{
"s": [
Expand Down Expand Up @@ -1281,6 +1281,12 @@ export const providers = [
],
"e": "api.picturelfy.com/service/oembed/"
},
{
"s": [
"*\\.builder\\.pikasso\\.xyz/embed/*"
],
"e": "builder.pikasso.xyz/api/oembed"
},
{
"s": [],
"e": "beta.pingvp.com.kpnis.nl/p/oembed.php"
Expand Down
18 changes: 17 additions & 1 deletion src/utils/providers.orginal.json
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@
"schemes": [
"https://pod.univ-lille.fr/video/*"
],
"url": "https://pod.univ-lille.fr/oembed",
"url": "https://pod.univ-lille.fr/video/oembed",
"discovery": true
}
]
Expand Down Expand Up @@ -2690,6 +2690,22 @@
}
]
},
{
"provider_name": "Pikasso",
"provider_url": "https://builder.pikasso.xyz",
"endpoints": [
{
"schemes": [
"https://*.builder.pikasso.xyz/embed/*"
],
"url": "https://builder.pikasso.xyz/api/oembed",
"discovery": true,
"formats": [
"json"
]
}
]
},
{
"provider_name": "PingVP",
"provider_url": "https://www.pingvp.com/",
Expand Down
32 changes: 31 additions & 1 deletion src/utils/providers.prev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// provider data, synchronized at 2022-09-19T09:58:06.421Z
// provider data, synchronized at 2022-10-13T02:14:43.201Z

/* eslint-disable */

Expand Down Expand Up @@ -437,6 +437,13 @@ export const providers = [
],
"e": "www.docdroid.net/api/oembed"
},
{
"s": [
"docswell\\.com/*/*",
"www\\.docswell\\.com/*/*"
],
"e": "www.docswell.com/service/oembed"
},
{
"s": [
"dotsub\\.com/view/*"
Expand Down Expand Up @@ -944,6 +951,13 @@ export const providers = [
],
"e": "embed.kooapp.com/services/oembed"
},
{
"s": [
"kurozora\\.app/episodes*",
"kurozora\\.app/songs*"
],
"e": "kurozora.app/oembed"
},
{
"s": [
"learningapps\\.org/*"
Expand Down Expand Up @@ -1063,6 +1077,12 @@ export const providers = [
],
"e": "oembed.minervaknows.com"
},
{
"s": [
"miro\\.com/app/board/*"
],
"e": "miro.com/api/v1/oembed"
},
{
"s": [
"www\\.mixcloud\\.com/*/*/"
Expand Down Expand Up @@ -1586,6 +1606,15 @@ export const providers = [
],
"e": "open.spotify.com/oembed"
},
{
"s": [
"*\\.spotlightr\\.com/watch/*",
"*\\.spotlightr\\.com/publish/*",
"*\\.cdn\\.spotlightr\\.com/watch/*",
"*\\.cdn\\.spotlightr\\.com/publish/*"
],
"e": "api.spotlightr.com/getOEmbed"
},
{
"s": [
"*\\.spreaker\\.com/*"
Expand Down Expand Up @@ -1694,6 +1723,7 @@ export const providers = [
},
{
"s": [
"www\\.tiktok\\.com/*",
"www\\.tiktok\\.com/*/video/*"
],
"e": "www.tiktok.com/oembed"
Expand Down

0 comments on commit 7a0e721

Please sign in to comment.