Last active
November 27, 2019 11:08
-
-
Save darrenmothersele/fbd4599a3f79e64c83021366283be480 to your computer and use it in GitHub Desktop.
YouTube Adapter for Kendraio App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"adapterName": "youtube", | |
"label": "YouTube", | |
"description": null, | |
"infoUrl": null, | |
"supportUrl": null, | |
"maintainer": null, | |
"version": "0.0.0", | |
"tags": [], | |
"name": "youtube", | |
"modified": false, | |
"workflow": [ | |
{ | |
"workflowId": "login", | |
"title": "YouTube Login", | |
"adapterName": "youtube", | |
"modified": true, | |
"config": "configs/login.json" | |
}, | |
{ | |
"workflowId": "connect", | |
"title": "YouTube Connect", | |
"adapterName": "youtube", | |
"modified": true, | |
"config": "configs/connect.json" | |
}, | |
{ | |
"workflowId": "callback", | |
"title": "YouTube Auth Callback", | |
"adapterName": "youtube", | |
"modified": true, | |
"config": "configs/callback.json" | |
}, | |
{ | |
"workflowId": "dashboard", | |
"title": "YouTube Dashboard", | |
"adapterName": "youtube", | |
"modified": true, | |
"config": "configs/dashboard.json" | |
} | |
], | |
"database": [], | |
"forms": [], | |
"attachments": { | |
"configs/login.json": { | |
"workflowId": "login", | |
"title": "YouTube Login", | |
"adapterName": "youtube", | |
"blocks": [ | |
{ | |
"type": "init" | |
}, | |
{ | |
"type": "variable-get", | |
"name": "connectionParams" | |
}, | |
{ | |
"type": "debug", | |
"open": 0, | |
"showContext": false | |
}, | |
{ | |
"type": "message", | |
"message": "Generating YouTube authorisation link..." | |
}, | |
{ | |
"type": "mapping", | |
"mapping": "join('', ['https://accounts.google.com/o/oauth2/v2/auth?', qs(merge(data, { state: uuid(), include_granted_scopes: 'true' }))])" | |
}, | |
{ | |
"type": "debug", | |
"open": 1, | |
"showContext": false | |
} | |
], | |
"modified": false | |
}, | |
"configs/connect.json": { | |
"workflowId": "connect", | |
"title": "YouTube Connect", | |
"adapterName": "youtube", | |
"blocks": [ | |
{ | |
"type": "init" | |
}, | |
{ | |
"type": "variable-get", | |
"name": "connectionParams" | |
}, | |
{ | |
"type": "form", | |
"jsonSchema": { | |
"type": "object", | |
"properties": { | |
"client_id": { | |
"type": "string", | |
"title": "client_id", | |
"default": "" | |
}, | |
"redirect_uri": { | |
"type": "string", | |
"title": "redirect_uri", | |
"default": "http://localhost:4200/youtube/callback" | |
}, | |
"response_type": { | |
"type": "string", | |
"title": "response_type", | |
"default": "token" | |
}, | |
"scope": { | |
"type": "string", | |
"title": "scope", | |
"default": "https://www.googleapis.com/auth/youtube" | |
} | |
} | |
}, | |
"uiSchema": {} | |
}, | |
{ | |
"type": "variable-set", | |
"name": "connectionParams" | |
} | |
], | |
"modified": false | |
}, | |
"configs/callback.json": { | |
"workflowId": "callback", | |
"title": "YouTube Auth Callback", | |
"adapterName": "youtube", | |
"blocks": [ | |
{ | |
"type": "debug", | |
"open": 2, | |
"showContext": true | |
}, | |
{ | |
"type": "mapping", | |
"mapping": "parseQs(context.fragment)" | |
}, | |
{ | |
"type": "debug", | |
"open": 1, | |
"showContext": false | |
}, | |
{ | |
"type": "variable-set", | |
"name": "token" | |
} | |
], | |
"modified": false | |
}, | |
"configs/dashboard.json": { | |
"workflowId": "dashboard", | |
"title": "YouTube Dashboard", | |
"adapterName": "youtube", | |
"blocks": [ | |
{ | |
"type": "message", | |
"title": "Dashboard", | |
"message": "Manage your YouTube videos" | |
}, | |
{ | |
"type": "form", | |
"label": "Fetch", | |
"jsonSchema": {}, | |
"uiSchema": {} | |
}, | |
{ | |
"type": "variable-get", | |
"name": "token" | |
}, | |
{ | |
"type": "http", | |
"method": "get", | |
"endpoint": { | |
"protocol": "https:", | |
"host": "www.googleapis.com", | |
"pathname": "/youtube/v3/search", | |
"query": { | |
"type": "video", | |
"part": "snippet", | |
"forMine": "true" | |
} | |
}, | |
"authentication": { | |
"type": "bearer", | |
"valueGetters": { | |
"jwt": "data.access_token" | |
} | |
} | |
}, | |
{ | |
"type": "debug", | |
"open": 0, | |
"showContext": false | |
}, | |
{ | |
"type": "mapping", | |
"mapping": "data.items[].snippet" | |
}, | |
{ | |
"type": "grid", | |
"gridOptions": {} | |
} | |
], | |
"modified": false | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment