-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sources - New Highlight (Instant) - New Story (Instant) - New Recording (Instant) - Updated Highlight (Instant) - Updated Story (Instant) - Updated Recording (Instant) - Deleted Highlight (Instant) - Deleted Story (Instant) - Deleted Recording (Instant) Actions - Get Recording
- Loading branch information
1 parent
7643f8a
commit f5ce1b2
Showing
24 changed files
with
518 additions
and
677 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export const TRANSCRIPT_FORMAT_OPTIONS = [ | ||
{ | ||
label: "JSON", | ||
value: "json", | ||
}, | ||
{ | ||
label: "VTT", | ||
value: "vtt", | ||
}, | ||
]; | ||
|
||
export const INTELLIGENCE_NOTES_FORMAT_OPTIONS = [ | ||
{ | ||
label: "JSON", | ||
value: "json", | ||
}, | ||
{ | ||
label: "Markdown", | ||
value: "md", | ||
}, | ||
{ | ||
label: "Text", | ||
value: "text", | ||
}, | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const parseObject = (obj) => { | ||
if (!obj) return undefined; | ||
|
||
if (Array.isArray(obj)) { | ||
return obj.map((item) => { | ||
if (typeof item === "string") { | ||
try { | ||
return JSON.parse(item); | ||
} catch (e) { | ||
return item; | ||
} | ||
} | ||
return item; | ||
}); | ||
} | ||
if (typeof obj === "string") { | ||
try { | ||
return JSON.parse(obj); | ||
} catch (e) { | ||
return obj; | ||
} | ||
} | ||
return obj; | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@pipedream/grain", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Pipedream Grain Components", | ||
"main": "grain.app.mjs", | ||
"keywords": [ | ||
|
@@ -11,5 +11,8 @@ | |
"author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pipedream/platform": "^3.0.3" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import grain from "../../grain.app.mjs"; | ||
|
||
export default { | ||
props: { | ||
grain, | ||
http: "$.interface.http", | ||
db: "$.service.db", | ||
}, | ||
methods: { | ||
_getHookId() { | ||
return this.db.get("hookId"); | ||
}, | ||
_setHookId(hookId) { | ||
this.db.set("hookId", hookId); | ||
}, | ||
getExtraData() { | ||
return {}; | ||
}, | ||
}, | ||
hooks: { | ||
async activate() { | ||
const response = await this.grain.createWebhook({ | ||
data: { | ||
version: 2, | ||
hook_url: this.http.endpoint, | ||
view_id: this.viewId, | ||
actions: this.getAction(), | ||
}, | ||
}); | ||
this._setHookId(response.id); | ||
}, | ||
async deactivate() { | ||
const webhookId = this._getHookId(); | ||
await this.grain.deleteWebhook(webhookId); | ||
}, | ||
}, | ||
async run({ body }) { | ||
if (!body.data) return; | ||
|
||
const ts = Date.parse(new Date()); | ||
this.$emit(body, { | ||
id: `${body.data.id}-${ts}`, | ||
summary: this.getSummary(body), | ||
ts: ts, | ||
}); | ||
}, | ||
}; |
Oops, something went wrong.