@activepieces/piece-descript 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +14 -44
  3. package/src/index.d.ts +0 -4
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/agent-edit.d.ts +0 -11
  7. package/src/lib/actions/agent-edit.d.ts.map +0 -1
  8. package/src/lib/actions/agent-edit.js +0 -132
  9. package/src/lib/actions/agent-edit.js.map +0 -1
  10. package/src/lib/actions/get-job-status.d.ts +0 -4
  11. package/src/lib/actions/get-job-status.d.ts.map +0 -1
  12. package/src/lib/actions/get-job-status.js +0 -34
  13. package/src/lib/actions/get-job-status.js.map +0 -1
  14. package/src/lib/actions/get-project.d.ts +0 -4
  15. package/src/lib/actions/get-project.d.ts.map +0 -1
  16. package/src/lib/actions/get-project.js +0 -30
  17. package/src/lib/actions/get-project.js.map +0 -1
  18. package/src/lib/actions/import-media.d.ts +0 -15
  19. package/src/lib/actions/import-media.d.ts.map +0 -1
  20. package/src/lib/actions/import-media.js +0 -159
  21. package/src/lib/actions/import-media.js.map +0 -1
  22. package/src/lib/actions/list-projects.d.ts +0 -11
  23. package/src/lib/actions/list-projects.d.ts.map +0 -1
  24. package/src/lib/actions/list-projects.js +0 -123
  25. package/src/lib/actions/list-projects.js.map +0 -1
  26. package/src/lib/actions/publish-project.d.ts +0 -9
  27. package/src/lib/actions/publish-project.d.ts.map +0 -1
  28. package/src/lib/actions/publish-project.js +0 -89
  29. package/src/lib/actions/publish-project.js.map +0 -1
  30. package/src/lib/auth.d.ts +0 -4
  31. package/src/lib/auth.d.ts.map +0 -1
  32. package/src/lib/auth.js +0 -41
  33. package/src/lib/auth.js.map +0 -1
  34. package/src/lib/common/index.d.ts +0 -26
  35. package/src/lib/common/index.d.ts.map +0 -1
  36. package/src/lib/common/index.js +0 -121
  37. package/src/lib/common/index.js.map +0 -1
  38. package/src/lib/triggers/job-completed.d.ts +0 -11
  39. package/src/lib/triggers/job-completed.d.ts.map +0 -1
  40. package/src/lib/triggers/job-completed.js +0 -112
  41. package/src/lib/triggers/job-completed.js.map +0 -1
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.descriptGetJobStatusAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- exports.descriptGetJobStatusAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.descriptAuth,
11
- name: 'get_job_status',
12
- displayName: 'Get Job Status',
13
- description: 'Retrieves the current status of a Descript background job (import, agent edit, or publish). Use the job_id returned by any job-creation action.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Looks up the current state and result of a single Descript background job (import, agent edit, or publish) by its job_id. Use to poll for completion after starting an asynchronous job and to read outputs such as share/download URLs or error messages. Read-only and idempotent.', idempotent: true },
16
- props: {
17
- job_id: pieces_framework_1.Property.ShortText({
18
- displayName: 'Job ID',
19
- description: 'The job ID returned when you created the job (e.g. from "Import Media", "Agent Edit", or "Publish Project" actions).',
20
- required: true,
21
- }),
22
- },
23
- run(context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- const response = yield common_1.descriptCommon.descriptApiCall({
26
- apiKey: common_1.descriptCommon.getAuthToken(context.auth),
27
- method: pieces_common_1.HttpMethod.GET,
28
- path: `/jobs/${context.propsValue.job_id}`,
29
- });
30
- return response.body;
31
- });
32
- },
33
- });
34
- //# sourceMappingURL=get-job-status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-job-status.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-job-status.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAuC;AACvC,sCAA2C;AA2B9B,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,iJAAiJ;IACnJ,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sRAAsR,EAAE,UAAU,EAAE,IAAI,EAAE;IACrU,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,sHAAsH;YACxH,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,eAAe,CAAoB;gBACvE,MAAM,EAAE,uBAAc,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,SAAS,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE;aAC3C,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const descriptGetProjectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- project_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- }>;
4
- //# sourceMappingURL=get-project.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-project.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-project.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,wBAAwB;;EAqBnC,CAAC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.descriptGetProjectAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- exports.descriptGetProjectAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.descriptAuth,
11
- name: 'get_project',
12
- displayName: 'Get Project',
13
- description: 'Retrieves details for a Descript project including its compositions and media files.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Fetches full details for a single Descript project by ID, including its compositions and media files. Use to resolve composition IDs or inspect project contents before editing or publishing. Read-only and idempotent.', idempotent: true },
16
- props: {
17
- project_id: common_1.descriptCommon.projectIdProp,
18
- },
19
- run(context) {
20
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
- const response = yield common_1.descriptCommon.descriptApiCall({
22
- apiKey: common_1.descriptCommon.getAuthToken(context.auth),
23
- method: pieces_common_1.HttpMethod.GET,
24
- path: `/projects/${context.propsValue.project_id}`,
25
- });
26
- return response.body;
27
- });
28
- },
29
- });
30
- //# sourceMappingURL=get-project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-project.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-project.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAuC;AACvC,sCAA2C;AAwB9B,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EACT,sFAAsF;IACxF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,0NAA0N,EAAE,UAAU,EAAE,IAAI,EAAE;IACzQ,KAAK,EAAE;QACL,UAAU,EAAE,uBAAc,CAAC,aAAa;KACzC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GACZ,MAAM,uBAAc,CAAC,eAAe,CAAwB;gBAC1D,MAAM,EAAE,uBAAc,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,aAAa,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE;aACnD,CAAC,CAAC;YAEL,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const descriptImportMediaAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- mode: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
3
- project_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- project_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- folder_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- team_access: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
7
- media_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- media_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- language: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- composition_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- composition_width: import("@activepieces/pieces-framework").NumberProperty<false>;
12
- composition_height: import("@activepieces/pieces-framework").NumberProperty<false>;
13
- callback_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- }>;
15
- //# sourceMappingURL=import-media.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import-media.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/import-media.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;EA2KpC,CAAC"}
@@ -1,159 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.descriptImportMediaAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- exports.descriptImportMediaAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.descriptAuth,
11
- name: 'import_media',
12
- displayName: 'Import Media',
13
- description: 'Imports a media file from a URL into a new or existing Descript project and optionally creates a composition.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Starts an asynchronous Descript job that imports a media file from a public URL into either a newly created project or an existing one (selected via the project mode), optionally building a composition/timeline from it. Use to bring audio/video into Descript before editing or publishing; the URL must be reachable by Descript servers and support HTTP Range requests. Not idempotent: each call queues a new import job and returns a job_id to poll for completion.', idempotent: false },
16
- props: {
17
- mode: pieces_framework_1.Property.StaticDropdown({
18
- displayName: 'Project',
19
- description: 'Create a new project or import into an existing one.',
20
- required: true,
21
- defaultValue: 'new',
22
- options: {
23
- options: [
24
- { label: 'Create new project', value: 'new' },
25
- { label: 'Import into existing project', value: 'existing' },
26
- ],
27
- },
28
- }),
29
- project_id: pieces_framework_1.Property.Dropdown({
30
- auth: auth_1.descriptAuth,
31
- displayName: 'Existing Project',
32
- description: 'Select the project to import media into.',
33
- refreshers: ['mode'],
34
- required: false,
35
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, mode }) {
36
- if (mode !== 'existing')
37
- return { disabled: true, options: [], placeholder: 'Not needed for new projects' };
38
- if (!auth)
39
- return { disabled: true, options: [], placeholder: 'Please connect your account first' };
40
- try {
41
- const projects = yield common_1.descriptCommon.fetchAllProjects(common_1.descriptCommon.getAuthToken(auth));
42
- return {
43
- disabled: false,
44
- options: projects.map((p) => ({ label: p.name, value: p.id })),
45
- };
46
- }
47
- catch (_b) {
48
- return { disabled: true, options: [], placeholder: 'Failed to load projects. Check your connection.' };
49
- }
50
- }),
51
- }),
52
- project_name: pieces_framework_1.Property.ShortText({
53
- displayName: 'New Project Name',
54
- description: 'Name for the new project. Only used when creating a new project.',
55
- required: false,
56
- }),
57
- folder_name: pieces_framework_1.Property.ShortText({
58
- displayName: 'Project Folder',
59
- description: 'Folder path for the new project (e.g. "Clients/Acme"). Supports nested paths using "/". Missing folders are created automatically. Only applies when creating a new project.',
60
- required: false,
61
- }),
62
- team_access: pieces_framework_1.Property.StaticDropdown({
63
- displayName: 'Team Access',
64
- description: 'Access level for Drive members on the new project. Only applies when creating a new project.',
65
- required: false,
66
- defaultValue: 'none',
67
- options: {
68
- options: [
69
- { label: 'None (private to owner)', value: 'none' },
70
- { label: 'View', value: 'view' },
71
- { label: 'Comment', value: 'comment' },
72
- { label: 'Edit', value: 'edit' },
73
- ],
74
- },
75
- }),
76
- media_name: pieces_framework_1.Property.ShortText({
77
- displayName: 'Media File Name',
78
- description: 'Display name for the media file (e.g. "intro.mp4" or "Recordings/interview.mp4"). Use "/" to organize into sub-folders. Must not conflict with existing file names when importing into an existing project.',
79
- required: true,
80
- }),
81
- media_url: pieces_framework_1.Property.ShortText({
82
- displayName: 'Media URL',
83
- description: 'Public URL of the media file. Must be accessible by Descript servers and support HTTP Range requests. Sign URLs for 12–48 hours if they expire.',
84
- required: true,
85
- }),
86
- language: pieces_framework_1.Property.ShortText({
87
- displayName: 'Transcription Language',
88
- description: 'ISO 639-1 language code for transcription (e.g. "en", "es", "fr"). Leave blank to auto-detect from the audio.',
89
- required: false,
90
- }),
91
- composition_name: pieces_framework_1.Property.ShortText({
92
- displayName: 'Composition Name',
93
- description: 'Name for the composition (timeline) to create from the imported media. Leave blank to skip composition creation.',
94
- required: false,
95
- }),
96
- composition_width: pieces_framework_1.Property.Number({
97
- displayName: 'Composition Width (px)',
98
- description: 'Width of the composition in pixels. Defaults to 1920. Only used when a Composition Name is provided.',
99
- required: false,
100
- defaultValue: 1920,
101
- }),
102
- composition_height: pieces_framework_1.Property.Number({
103
- displayName: 'Composition Height (px)',
104
- description: 'Height of the composition in pixels. Defaults to 1080. Only used when a Composition Name is provided.',
105
- required: false,
106
- defaultValue: 1080,
107
- }),
108
- callback_url: pieces_framework_1.Property.ShortText({
109
- displayName: 'Callback URL',
110
- description: 'Optional webhook URL. When the import finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).',
111
- required: false,
112
- }),
113
- },
114
- run(context) {
115
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
116
- const { mode, project_id, project_name, folder_name, team_access, media_name, media_url, language, composition_name, composition_width, composition_height, callback_url, } = context.propsValue;
117
- const mediaItem = { url: media_url };
118
- if (language)
119
- mediaItem['language'] = language;
120
- const body = {
121
- add_media: { [media_name]: mediaItem },
122
- };
123
- if (mode === 'existing') {
124
- if (!project_id)
125
- throw new Error('Please select a project to import into.');
126
- body['project_id'] = project_id;
127
- }
128
- else {
129
- if (!project_name)
130
- throw new Error('Please enter a name for the new project.');
131
- body['project_name'] = project_name;
132
- if (folder_name)
133
- body['folder_name'] = folder_name;
134
- if (team_access)
135
- body['team_access'] = team_access;
136
- }
137
- if (composition_name) {
138
- body['add_compositions'] = [
139
- {
140
- name: composition_name,
141
- width: composition_width !== null && composition_width !== void 0 ? composition_width : 1920,
142
- height: composition_height !== null && composition_height !== void 0 ? composition_height : 1080,
143
- clips: [{ media: media_name }],
144
- },
145
- ];
146
- }
147
- if (callback_url)
148
- body['callback_url'] = callback_url;
149
- const response = yield common_1.descriptCommon.descriptApiCall({
150
- apiKey: common_1.descriptCommon.getAuthToken(context.auth),
151
- method: pieces_common_1.HttpMethod.POST,
152
- path: '/jobs/import/project_media',
153
- body,
154
- });
155
- return response.body;
156
- });
157
- },
158
- });
159
- //# sourceMappingURL=import-media.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import-media.js","sourceRoot":"","sources":["../../../../src/lib/actions/import-media.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAuC;AACvC,sCAA2C;AAE9B,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACP,+GAA+G;IACnH,QAAQ,EAAE,MA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,UAAU;oBAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;gBAC5E,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YACpC,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,YAAY;oBAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;gBAC/E,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;gBACpC,IAAI,WAAW;oBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;gBACnD,IAAI,WAAW;oBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YACvD,CAAC;YAED,IAAI,gBAAgB,EAAE,CAAC;gBACnB,IAAI,CAAC,kBAAkB,CAAC,GAAG;oBACvB;wBACI,IAAI,EAAE,gBAAgB;wBACtB,KAAK,EAAE,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,IAAI;wBAChC,MAAM,EAAE,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,IAAI;wBAClC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;qBACjC;iBACJ,CAAC;YACN,CAAC;YAED,IAAI,YAAY;gBAAE,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YAEtD,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,eAAe,CAKlD;gBACC,MAAM,EAAE,uBAAc,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,4BAA4B;gBAClC,IAAI;aACP,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- export declare const descriptListProjectsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
3
- created_by: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
4
- sort: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
5
- direction: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
- created_after: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- created_before: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- updated_after: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- updated_before: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- }>;
11
- //# sourceMappingURL=list-projects.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-projects.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-projects.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,0BAA0B;;;;;;;;;EAmIrC,CAAC"}
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.descriptListProjectsAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- exports.descriptListProjectsAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.descriptAuth,
11
- name: 'list_projects',
12
- displayName: 'List Projects',
13
- description: 'Returns projects in your Descript Drive. Supports filtering by name, date, and creator.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Lists projects in the connected Descript Drive, auto-paginating through all matches. Optional filters narrow by name substring, creator (me vs anyone), and created/updated date ranges, with configurable sort field and direction; leaving filters blank returns all projects. Use to discover project IDs for other actions. Read-only and idempotent.', idempotent: true },
16
- props: {
17
- name: pieces_framework_1.Property.ShortText({
18
- displayName: 'Name Filter',
19
- description: 'Return only projects whose name contains this string (case-insensitive).',
20
- required: false,
21
- }),
22
- created_by: pieces_framework_1.Property.StaticDropdown({
23
- displayName: 'Created By',
24
- description: 'Filter projects by creator.',
25
- required: false,
26
- options: {
27
- options: [
28
- { label: 'Anyone', value: '' },
29
- { label: 'Me', value: 'me' },
30
- ],
31
- },
32
- }),
33
- sort: pieces_framework_1.Property.StaticDropdown({
34
- displayName: 'Sort By',
35
- description: 'Field to sort results by.',
36
- required: false,
37
- defaultValue: 'created_at',
38
- options: {
39
- options: [
40
- { label: 'Date created', value: 'created_at' },
41
- { label: 'Date updated', value: 'updated_at' },
42
- { label: 'Name', value: 'name' },
43
- { label: 'Last viewed', value: 'last_viewed_at' },
44
- ],
45
- },
46
- }),
47
- direction: pieces_framework_1.Property.StaticDropdown({
48
- displayName: 'Sort Direction',
49
- description: 'Sort order for results.',
50
- required: false,
51
- defaultValue: 'desc',
52
- options: {
53
- options: [
54
- { label: 'Newest first (desc)', value: 'desc' },
55
- { label: 'Oldest first (asc)', value: 'asc' },
56
- ],
57
- },
58
- }),
59
- created_after: pieces_framework_1.Property.ShortText({
60
- displayName: 'Created After',
61
- description: 'Return only projects created after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).',
62
- required: false,
63
- }),
64
- created_before: pieces_framework_1.Property.ShortText({
65
- displayName: 'Created Before',
66
- description: 'Return only projects created before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).',
67
- required: false,
68
- }),
69
- updated_after: pieces_framework_1.Property.ShortText({
70
- displayName: 'Updated After',
71
- description: 'Return only projects updated after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).',
72
- required: false,
73
- }),
74
- updated_before: pieces_framework_1.Property.ShortText({
75
- displayName: 'Updated Before',
76
- description: 'Return only projects updated before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).',
77
- required: false,
78
- }),
79
- },
80
- run(context) {
81
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
- const { name, created_by, sort, direction, created_after, created_before, updated_after, updated_before, } = context.propsValue;
83
- const apiKey = common_1.descriptCommon.getAuthToken(context.auth);
84
- const baseParams = { limit: '100' };
85
- if (sort)
86
- baseParams['sort'] = sort;
87
- if (direction)
88
- baseParams['direction'] = direction;
89
- if (name)
90
- baseParams['name'] = name;
91
- if (created_by)
92
- baseParams['created_by'] = created_by;
93
- if (created_after)
94
- baseParams['created_after'] = created_after;
95
- if (created_before)
96
- baseParams['created_before'] = created_before;
97
- if (updated_after)
98
- baseParams['updated_after'] = updated_after;
99
- if (updated_before)
100
- baseParams['updated_before'] = updated_before;
101
- const projects = [];
102
- let cursor = undefined;
103
- do {
104
- const queryParams = Object.assign(Object.assign({}, baseParams), (cursor ? { cursor } : {}));
105
- const response = yield common_1.descriptCommon.descriptApiCall({
106
- apiKey,
107
- method: pieces_common_1.HttpMethod.GET,
108
- path: '/projects',
109
- queryParams,
110
- });
111
- projects.push(...response.body.data);
112
- cursor = response.body.pagination.next_cursor;
113
- } while (cursor);
114
- return projects.map((p) => ({
115
- project_id: p.id,
116
- project_name: p.name,
117
- created_at: p.created_at,
118
- updated_at: p.updated_at,
119
- }));
120
- });
121
- },
122
- });
123
- //# sourceMappingURL=list-projects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-projects.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-projects.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAuC;AACvC,sCAA2C;AAS9B,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,yFAAyF;IAC3F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,2VAA2V,EAAE,UAAU,EAAE,IAAI,EAAE;IAC1Y,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,0EAA0E;YAC5E,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;YA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;YAC/B,IAAI,MAAM,GAAuB,SAAS,CAAC;YAE3C,GAAG,CAAC;gBACF,MAAM,WAAW,mCACZ,UAAU,GACV,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC9B,CAAC;gBAEF,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,eAAe,CAGlD;oBACD,MAAM;oBACN,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,IAAI,EAAE,WAAW;oBACjB,WAAW;iBACZ,CAAC,CAAC;gBAEH,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YAChD,CAAC,QAAQ,MAAM,EAAE;YAEjB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC1B,UAAU,EAAE,CAAC,CAAC,EAAE;gBAChB,YAAY,EAAE,CAAC,CAAC,IAAI;gBACpB,UAAU,EAAE,CAAC,CAAC,UAAU;gBACxB,UAAU,EAAE,CAAC,CAAC,UAAU;aACzB,CAAC,CAAC,CAAC;QACN,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const descriptPublishProjectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- project_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- composition_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- media_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
5
- resolution: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
- access_level: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
7
- callback_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- }>;
9
- //# sourceMappingURL=publish-project.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish-project.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/publish-project.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;;;;;EA4FvC,CAAC"}
@@ -1,89 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.descriptPublishProjectAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const auth_1 = require("../auth");
8
- const common_1 = require("../common");
9
- exports.descriptPublishProjectAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.descriptAuth,
11
- name: 'publish_project',
12
- displayName: 'Publish Project',
13
- description: 'Publishes a composition from a project to create a shareable link and a downloadable export file.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Starts an asynchronous Descript publish/export job for a project composition, producing a shareable link and a downloadable file as video or audio at a chosen resolution and share access level. Use to render and distribute a finished project. Requesting a share access level the Drive disallows returns an error. Not idempotent: each call queues a new export job and returns a job_id to poll for the share_url and download_url.', idempotent: false },
16
- props: {
17
- project_id: common_1.descriptCommon.projectIdProp,
18
- composition_id: common_1.descriptCommon.compositionIdProp(false),
19
- media_type: pieces_framework_1.Property.StaticDropdown({
20
- displayName: 'Output Type',
21
- description: 'Choose whether to export the project as a video or audio file.',
22
- required: false,
23
- defaultValue: 'Video',
24
- options: {
25
- options: [
26
- { label: 'Video', value: 'Video' },
27
- { label: 'Audio only', value: 'Audio' },
28
- ],
29
- },
30
- }),
31
- resolution: pieces_framework_1.Property.StaticDropdown({
32
- displayName: 'Video Resolution',
33
- description: 'Resolution for the exported video. Only applies when Output Type is Video.',
34
- required: false,
35
- defaultValue: '1080p',
36
- options: {
37
- options: [
38
- { label: '480p', value: '480p' },
39
- { label: '720p', value: '720p' },
40
- { label: '1080p (Full HD)', value: '1080p' },
41
- { label: '1440p (2K)', value: '1440p' },
42
- { label: '4K', value: '4K' },
43
- ],
44
- },
45
- }),
46
- access_level: pieces_framework_1.Property.StaticDropdown({
47
- displayName: 'Share Access Level',
48
- description: "Who can view the published share page. Leave blank to use your Drive's default. Note: requesting a level your Drive disallows (e.g. Public when search-engine indexing is off) will return an error.",
49
- required: false,
50
- options: {
51
- options: [
52
- { label: 'Public (anyone)', value: 'public' },
53
- { label: 'Unlisted (link only)', value: 'unlisted' },
54
- { label: 'Drive members only', value: 'drive' },
55
- { label: 'Private (owner only)', value: 'private' },
56
- ],
57
- },
58
- }),
59
- callback_url: pieces_framework_1.Property.ShortText({
60
- displayName: 'Callback URL',
61
- description: 'Optional webhook URL. When the publish job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status). The result includes share_url and download_url once complete.',
62
- required: false,
63
- }),
64
- },
65
- run(context) {
66
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
67
- const { project_id, composition_id, media_type, resolution, access_level, callback_url, } = context.propsValue;
68
- const body = { project_id };
69
- if (composition_id)
70
- body['composition_id'] = composition_id;
71
- if (media_type)
72
- body['media_type'] = media_type;
73
- if (media_type === 'Video' && resolution)
74
- body['resolution'] = resolution;
75
- if (access_level)
76
- body['access_level'] = access_level;
77
- if (callback_url)
78
- body['callback_url'] = callback_url;
79
- const response = yield common_1.descriptCommon.descriptApiCall({
80
- apiKey: common_1.descriptCommon.getAuthToken(context.auth),
81
- method: pieces_common_1.HttpMethod.POST,
82
- path: '/jobs/publish',
83
- body,
84
- });
85
- return response.body;
86
- });
87
- },
88
- });
89
- //# sourceMappingURL=publish-project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish-project.js","sourceRoot":"","sources":["../../../../src/lib/actions/publish-project.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,k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C,IAAI,CAAC;gBACjD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,eAAe;gBACrB,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
package/src/lib/auth.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
2
- export declare const descriptAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- export declare function getAuthToken(auth: string | AppConnectionValueForAuthProperty<typeof descriptAuth>): string;
4
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,EAElC,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,YAAY,mEA2BvB,CAAC;AAEH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,GAAG,iCAAiC,CAAC,OAAO,YAAY,CAAC,GACpE,MAAM,CAGR"}
package/src/lib/auth.js DELETED
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.descriptAuth = void 0;
4
- exports.getAuthToken = getAuthToken;
5
- const tslib_1 = require("tslib");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const pieces_framework_1 = require("@activepieces/pieces-framework");
8
- exports.descriptAuth = pieces_framework_1.PieceAuth.SecretText({
9
- displayName: 'API Token',
10
- description: [
11
- 'To create an API token:',
12
- '1. Open **Settings** in Descript.',
13
- '2. Select **API tokens** from the sidebar.',
14
- '3. Click **Create token**, give it a name, select a Drive, and click **Create token**.',
15
- '4. Copy the token and paste it here — you can only view it once.',
16
- ].join('\n'),
17
- required: true,
18
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
19
- try {
20
- yield pieces_common_1.httpClient.sendRequest({
21
- method: pieces_common_1.HttpMethod.GET,
22
- url: 'https://descriptapi.com/v1/status',
23
- headers: {
24
- Authorization: `Bearer ${getAuthToken(auth)}`,
25
- },
26
- });
27
- return { valid: true };
28
- }
29
- catch (_b) {
30
- return {
31
- valid: false,
32
- error: 'Invalid API token. Please check and try again.',
33
- };
34
- }
35
- }),
36
- });
37
- function getAuthToken(auth) {
38
- const raw = typeof auth === 'string' ? auth : auth.secret_text;
39
- return raw.trim();
40
- }
41
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAmCA,oCAKC;;AAxCD,+DAAqE;AACrE,qEAGwC;AAE3B,QAAA,YAAY,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC/C,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE;QACX,yBAAyB;QACzB,mCAAmC;QACnC,4CAA4C;QAC5C,wFAAwF;QACxF,kEAAkE;KACnE,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,mCAAmC;gBACxC,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,YAAY,CAAC,IAAI,CAAC,EAAE;iBAC9C;aACF,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,gDAAgD;aACxD,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEH,SAAgB,YAAY,CAC1B,IAAqE;IAErE,MAAM,GAAG,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC/D,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC"}
@@ -1,26 +0,0 @@
1
- import { HttpMethod, HttpMessageBody, HttpResponse } from '@activepieces/pieces-common';
2
- import { getAuthToken } from '../auth';
3
- type ProjectSummary = {
4
- id: string;
5
- name: string;
6
- created_at: string;
7
- updated_at: string;
8
- };
9
- declare function descriptApiCall<T extends HttpMessageBody>({ apiKey, method, path, body, queryParams, }: {
10
- apiKey: string;
11
- method: HttpMethod;
12
- path: string;
13
- body?: unknown;
14
- queryParams?: Record<string, string>;
15
- }): Promise<HttpResponse<T>>;
16
- declare function fetchAllProjects(apiKey: string): Promise<ProjectSummary[]>;
17
- export declare const descriptCommon: {
18
- BASE_URL: string;
19
- descriptApiCall: typeof descriptApiCall;
20
- fetchAllProjects: typeof fetchAllProjects;
21
- getAuthToken: typeof getAuthToken;
22
- projectIdProp: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
23
- compositionIdProp: (required: boolean) => import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
24
- };
25
- export {};
26
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,eAAe,EACf,YAAY,EACb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAgB,YAAY,EAAE,MAAM,SAAS,CAAC;AAIrD,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,iBAAe,eAAe,CAAC,CAAC,SAAS,eAAe,EAAE,EACxD,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAU3B;AAED,iBAAe,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA2BzE;AA2ED,eAAO,MAAM,cAAc;;;;;;kCA3CU,OAAO;CAkD3C,CAAC"}