Skip to content

Commit

Permalink
Merge pull request #142 from ndaidong/v3.0.4
Browse files Browse the repository at this point in the history
v3.0.4
  • Loading branch information
ndaidong committed May 23, 2022
2 parents a19a18d + 14ed04f commit 0c0b5b4
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 188 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node_version: [14.x, 15.x, 16.x, 17.x]
node_version: [14.x, 15.x, 16.x, 17.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -23,6 +23,9 @@ jobs:
node-version: ${{ matrix.node_version }}

- name: run npm scripts
env:
FACEBOOK_APP_ID: ${{ secrets.FACEBOOK_APP_ID }}
FACEBOOK_CLIENT_TOKEN: ${{ secrets.FACEBOOK_CLIENT_TOKEN }}
run: |
npm i -g standard
npm install
Expand Down
375 changes: 216 additions & 159 deletions dist/cjs/oembed-parser.js

Large diffs are not rendered by default.

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-cjs",
"version": "3.0.3",
"version": "3.0.4",
"main": "./oembed-parser.js"
}
30 changes: 28 additions & 2 deletions dist/cjs/providers.latest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// provider data, synchronized at 2022-05-01T01:53:50.390Z
// provider data, synchronized at 2022-05-23T15:07:41.370Z

/* eslint-disable */

Expand Down Expand Up @@ -905,6 +905,19 @@ export const providers = [
}
]
},
{
"provider_name": "Dream Broker",
"provider_url": "https://dreambroker.com",
"endpoints": [
{
"schemes": [
"https://www.dreambroker.com/channel/*/*"
],
"url": "https://dreambroker.com/channel/oembed",
"discovery": true
}
]
},
{
"provider_name": "DTube",
"provider_url": "https://d.tube/",
Expand Down Expand Up @@ -1888,7 +1901,7 @@ export const providers = [
"https://*.kooapp.com/koo/*",
"http://*.kooapp.com/koo/*"
],
"url": "https://embed-stage.kooapp.com/services/oembed",
"url": "https://embed.kooapp.com/services/oembed",
"discovery": true
}
]
Expand Down Expand Up @@ -3077,6 +3090,19 @@ export const providers = [
}
]
},
{
"provider_name": "Smeme",
"provider_url": "https://smeme.com",
"endpoints": [
{
"schemes": [
"https://open.smeme.com/*"
],
"url": "https://open.smeme.com/api/oembed",
"discovery": true
}
]
},
{
"provider_name": "Smrthi",
"provider_url": "https://www.smrthi.com",
Expand Down
27 changes: 9 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.0.3",
{
"version": "3.0.4",
"name": "oembed-parser",
"description": "Get oEmbed data from given URL.",
"homepage": "https://www.npmjs.com/package/oembed-parser",
Expand All @@ -18,9 +18,9 @@
"scripts": {
"lint": "standard .",
"pretest": "npm run lint",
"test": "jest --verbose --coverage=true --unhandled-rejections=strict --detectOpenHandles",
"eval": "node eval",
"eval:cjs": "node cjs-eval",
"test": " NODE_OPTIONS=--experimental-vm-modules jest --verbose --coverage=true --unhandled-rejections=strict --detectOpenHandles",
"eval": "DEBUG=oembed-parser:* node eval",
"eval:cjs": "DEBUG=oembed-parser:* node cjs-eval",
"sync": "node sync",
"tsc": "tsc --init",
"build-ts": "tsc",
Expand All @@ -29,26 +29,17 @@
},
"dependencies": {
"axios": "^0.27.2",
"bellajs": "^11.0.2"
},
"babel": {
"env": {
"test": {
"plugins": [
"@babel/plugin-transform-modules-commonjs"
]
}
}
"bellajs": "^11.0.2",
"debug": "^4.3.4"
},
"standard": {
"ignore": [
"/dist"
]
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.17.9",
"esbuild": "^0.14.38",
"jest": "^28.0.3",
"esbuild": "^0.14.39",
"jest": "^28.1.0",
"nock": "^13.2.4"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { clone, copies } from 'bellajs'

const requestOptions = {
headers: {
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0',
'user-agent': 'Mozilla/5.0 (X11; Linux i686; rv:100.0) Gecko/20100101 Firefox/100.0',
accept: 'application/json; charset=utf-8'
},
responseType: 'json',
Expand Down
2 changes: 1 addition & 1 deletion src/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ test('Testing setRequestOptions()', () => {
const actual = getRequestOptions()
const expectedHeader = {
authorization: 'bearer <token>',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0',
'user-agent': 'Mozilla/5.0 (X11; Linux i686; rv:100.0) Gecko/20100101 Firefox/100.0',
accept: 'application/json; charset=utf-8'
}

Expand Down
5 changes: 4 additions & 1 deletion src/utils/fetchEmbed.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// utils -> fetchEmbed

import retrieve from './retrieve.js'
import { warning } from './logger.js'

const isFacebookGraphDependent = (url) => {
return url.includes('facebook.com') || url.includes('instagram.com')
Expand All @@ -10,7 +11,9 @@ const getFacebookGraphToken = () => {
const env = process.env || {}
const appId = env.FACEBOOK_APP_ID
const clientToken = env.FACEBOOK_CLIENT_TOKEN

if (!appId || !clientToken) {
warning('Working with Facebook Graph requires `FACEBOOK_APP_ID` and `FACEBOOK_CLIENT_TOKEN`')
}
return `${appId}|${clientToken}`
}

Expand Down
15 changes: 15 additions & 0 deletions src/utils/logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// utils / logger

import debug from 'debug'

const name = 'oembed-parser'

export const info = debug(`${name}:info`)
export const error = debug(`${name}:error`)
export const warning = debug(`${name}:warning`)

export default {
info: debug(`${name}:info`),
error: debug(`${name}:error`),
warning: debug(`${name}:warning`)
}
30 changes: 28 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-05-01T01:53:50.390Z
// provider data, synchronized at 2022-05-23T15:07:41.370Z

/* eslint-disable */

Expand Down Expand Up @@ -905,6 +905,19 @@ export const providers = [
}
]
},
{
"provider_name": "Dream Broker",
"provider_url": "https://dreambroker.com",
"endpoints": [
{
"schemes": [
"https://www.dreambroker.com/channel/*/*"
],
"url": "https://dreambroker.com/channel/oembed",
"discovery": true
}
]
},
{
"provider_name": "DTube",
"provider_url": "https://d.tube/",
Expand Down Expand Up @@ -1888,7 +1901,7 @@ export const providers = [
"https://*.kooapp.com/koo/*",
"http://*.kooapp.com/koo/*"
],
"url": "https://embed-stage.kooapp.com/services/oembed",
"url": "https://embed.kooapp.com/services/oembed",
"discovery": true
}
]
Expand Down Expand Up @@ -3077,6 +3090,19 @@ export const providers = [
}
]
},
{
"provider_name": "Smeme",
"provider_url": "https://smeme.com",
"endpoints": [
{
"schemes": [
"https://open.smeme.com/*"
],
"url": "https://open.smeme.com/api/oembed",
"discovery": true
}
]
},
{
"provider_name": "Smrthi",
"provider_url": "https://www.smrthi.com",
Expand Down
69 changes: 67 additions & 2 deletions src/utils/providers.prev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// provider data, synchronized at 2022-04-29T01:12:40.920Z
// provider data, synchronized at 2022-05-23T08:52:22.296Z

/* eslint-disable */

Expand Down Expand Up @@ -905,6 +905,19 @@ export const providers = [
}
]
},
{
"provider_name": "Dream Broker",
"provider_url": "https://dreambroker.com",
"endpoints": [
{
"schemes": [
"https://www.dreambroker.com/channel/*/*"
],
"url": "https://dreambroker.com/channel/oembed",
"discovery": true
}
]
},
{
"provider_name": "DTube",
"provider_url": "https://d.tube/",
Expand Down Expand Up @@ -1424,6 +1437,19 @@ export const providers = [
}
]
},
{
"provider_name": "HASH",
"provider_url": "https://hash.ai",
"endpoints": [
{
"schemes": [
"https://core.hash.ai/@*"
],
"url": "https://api.hash.ai/oembed",
"discovery": false
}
]
},
{
"provider_name": "hearthis.at",
"provider_url": "https://hearthis.at/",
Expand Down Expand Up @@ -1875,7 +1901,7 @@ export const providers = [
"https://*.kooapp.com/koo/*",
"http://*.kooapp.com/koo/*"
],
"url": "https://embed-stage.kooapp.com/services/oembed",
"url": "https://embed.kooapp.com/services/oembed",
"discovery": true
}
]
Expand Down Expand Up @@ -3064,6 +3090,19 @@ export const providers = [
}
]
},
{
"provider_name": "Smeme",
"provider_url": "https://smeme.com",
"endpoints": [
{
"schemes": [
"https://open.smeme.com/*"
],
"url": "https://open.smeme.com/api/oembed",
"discovery": true
}
]
},
{
"provider_name": "Smrthi",
"provider_url": "https://www.smrthi.com",
Expand Down Expand Up @@ -3286,6 +3325,19 @@ export const providers = [
}
]
},
{
"provider_name": "Sway Office",
"provider_url": "https://sway.office.com",
"endpoints": [
{
"schemes": [
"https://sway.office.com/*"
],
"url": "https://sway.office.com/api/v1.0/oembed",
"discovery": true
}
]
},
{
"provider_name": "Synthesia",
"provider_url": "https://www.synthesia.io/",
Expand Down Expand Up @@ -3653,6 +3705,19 @@ export const providers = [
}
]
},
{
"provider_name": "VidMount",
"provider_url": "https://vidmount.com/",
"endpoints": [
{
"schemes": [
"https://vidmount.com/*"
],
"url": "https://vidmount.com/oembed",
"discovery": true
}
]
},
{
"provider_name": "Vidyard",
"provider_url": "https://vidyard.com",
Expand Down

0 comments on commit 0c0b5b4

Please sign in to comment.