n8n-nodes-preroll 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/dist/credentials/PreRollApi.credentials.d.ts +9 -0
- package/dist/credentials/PreRollApi.credentials.js +43 -0
- package/dist/nodes/PreRoll/PreRoll.node.d.ts +5 -0
- package/dist/nodes/PreRoll/PreRoll.node.js +340 -0
- package/dist/nodes/PreRoll/PreRollTrigger.node.d.ts +12 -0
- package/dist/nodes/PreRoll/PreRollTrigger.node.js +159 -0
- package/dist/nodes/PreRoll/preroll.svg +7 -0
- package/dist/nodes/PreRoll/resources/ActivityDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/ActivityDescription.js +36 -0
- package/dist/nodes/PreRoll/resources/AiDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/AiDescription.js +97 -0
- package/dist/nodes/PreRoll/resources/ClientDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/ClientDescription.js +72 -0
- package/dist/nodes/PreRoll/resources/DashboardDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/DashboardDescription.js +17 -0
- package/dist/nodes/PreRoll/resources/DeliverableDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/DeliverableDescription.js +123 -0
- package/dist/nodes/PreRoll/resources/EpisodeDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/EpisodeDescription.js +123 -0
- package/dist/nodes/PreRoll/resources/MeetingNoteDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/MeetingNoteDescription.js +50 -0
- package/dist/nodes/PreRoll/resources/PipelineStageDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/PipelineStageDescription.js +27 -0
- package/dist/nodes/PreRoll/resources/ShowDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/ShowDescription.js +134 -0
- package/dist/nodes/PreRoll/resources/TagDescription.d.ts +3 -0
- package/dist/nodes/PreRoll/resources/TagDescription.js +59 -0
- package/package.json +50 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreRollTrigger = void 0;
|
|
4
|
+
class PreRollTrigger {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'PreRoll Trigger',
|
|
8
|
+
name: 'preRollTrigger',
|
|
9
|
+
icon: 'file:preroll.svg',
|
|
10
|
+
group: ['trigger'],
|
|
11
|
+
version: 1,
|
|
12
|
+
subtitle: '={{$parameter["events"].join(", ")}}',
|
|
13
|
+
description: 'Triggers when events occur in PreRoll',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'PreRoll Trigger',
|
|
16
|
+
},
|
|
17
|
+
inputs: [],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
name: 'preRollApi',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
webhooks: [
|
|
26
|
+
{
|
|
27
|
+
name: 'default',
|
|
28
|
+
httpMethod: 'POST',
|
|
29
|
+
responseMode: 'onReceived',
|
|
30
|
+
path: 'webhook',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
properties: [
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Events',
|
|
36
|
+
name: 'events',
|
|
37
|
+
type: 'multiOptions',
|
|
38
|
+
required: true,
|
|
39
|
+
default: [],
|
|
40
|
+
options: [
|
|
41
|
+
{ name: 'Deliverable — Approved', value: 'deliverable.approved' },
|
|
42
|
+
{ name: 'Deliverable — Resubmitted', value: 'deliverable.resubmitted' },
|
|
43
|
+
{ name: 'Deliverable — Revision Requested', value: 'deliverable.revision_requested' },
|
|
44
|
+
{ name: 'Deliverable — Submitted', value: 'deliverable.submitted' },
|
|
45
|
+
{ name: 'Episode — Published', value: 'episode.published' },
|
|
46
|
+
{ name: 'Episode — Scheduled', value: 'episode.scheduled' },
|
|
47
|
+
{ name: 'Episode — Stage Changed', value: 'episode.stage_changed' },
|
|
48
|
+
{ name: 'Episode — Status Changed', value: 'episode.status_changed' },
|
|
49
|
+
],
|
|
50
|
+
description: 'Which events to listen for',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Description',
|
|
54
|
+
name: 'description',
|
|
55
|
+
type: 'string',
|
|
56
|
+
default: '',
|
|
57
|
+
description: 'Optional description for this webhook endpoint in PreRoll',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
this.webhookMethods = {
|
|
62
|
+
default: {
|
|
63
|
+
async checkExists() {
|
|
64
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
65
|
+
if (webhookData.webhookId) {
|
|
66
|
+
const credentials = await this.getCredentials('preRollApi');
|
|
67
|
+
const baseUrl = credentials.baseUrl.replace(/\/$/, '');
|
|
68
|
+
try {
|
|
69
|
+
await this.helpers.httpRequestWithAuthentication.call(this, 'preRollApi', {
|
|
70
|
+
method: 'GET',
|
|
71
|
+
url: `${baseUrl}/api/v1/webhook-endpoints/${webhookData.webhookId}`,
|
|
72
|
+
json: true,
|
|
73
|
+
});
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
},
|
|
82
|
+
async create() {
|
|
83
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
84
|
+
const events = this.getNodeParameter('events');
|
|
85
|
+
const description = this.getNodeParameter('description', '');
|
|
86
|
+
const credentials = await this.getCredentials('preRollApi');
|
|
87
|
+
const baseUrl = credentials.baseUrl.replace(/\/$/, '');
|
|
88
|
+
const body = {
|
|
89
|
+
url: webhookUrl,
|
|
90
|
+
events,
|
|
91
|
+
};
|
|
92
|
+
if (description) {
|
|
93
|
+
body.description = `n8n: ${description}`;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
body.description = 'n8n webhook trigger';
|
|
97
|
+
}
|
|
98
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'preRollApi', {
|
|
99
|
+
method: 'POST',
|
|
100
|
+
url: `${baseUrl}/api/v1/webhook-endpoints`,
|
|
101
|
+
body,
|
|
102
|
+
json: true,
|
|
103
|
+
});
|
|
104
|
+
const data = response.data ?? response;
|
|
105
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
106
|
+
webhookData.webhookId = data.id;
|
|
107
|
+
webhookData.webhookSecret = data.secret;
|
|
108
|
+
return true;
|
|
109
|
+
},
|
|
110
|
+
async delete() {
|
|
111
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
112
|
+
if (!webhookData.webhookId)
|
|
113
|
+
return true;
|
|
114
|
+
const credentials = await this.getCredentials('preRollApi');
|
|
115
|
+
const baseUrl = credentials.baseUrl.replace(/\/$/, '');
|
|
116
|
+
try {
|
|
117
|
+
await this.helpers.httpRequestWithAuthentication.call(this, 'preRollApi', {
|
|
118
|
+
method: 'DELETE',
|
|
119
|
+
url: `${baseUrl}/api/v1/webhook-endpoints/${webhookData.webhookId}`,
|
|
120
|
+
json: true,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
// Endpoint may already be deleted
|
|
125
|
+
}
|
|
126
|
+
delete webhookData.webhookId;
|
|
127
|
+
delete webhookData.webhookSecret;
|
|
128
|
+
return true;
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
async webhook() {
|
|
134
|
+
const req = this.getRequestObject();
|
|
135
|
+
const body = this.getBodyData();
|
|
136
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
137
|
+
const secret = webhookData.webhookSecret;
|
|
138
|
+
if (secret) {
|
|
139
|
+
const signature = req.headers['x-preroll-signature'];
|
|
140
|
+
if (signature) {
|
|
141
|
+
const crypto = require('crypto');
|
|
142
|
+
const rawBody = JSON.stringify(body);
|
|
143
|
+
const expected = crypto
|
|
144
|
+
.createHmac('sha256', secret)
|
|
145
|
+
.update(rawBody)
|
|
146
|
+
.digest('hex');
|
|
147
|
+
if (signature !== expected) {
|
|
148
|
+
return { workflowData: [] };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
workflowData: [
|
|
154
|
+
this.helpers.returnJsonArray(body),
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.PreRollTrigger = PreRollTrigger;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" fill="none">
|
|
2
|
+
<rect width="60" height="60" rx="12" fill="#6366f1"/>
|
|
3
|
+
<path d="M20 16h6c4.4 0 8 3.6 8 8s-3.6 8-8 8h-6V16zm4 12h2c2.2 0 4-1.8 4-4s-1.8-4-4-4h-2v8z" fill="white"/>
|
|
4
|
+
<path d="M20 36h4v8h-4z" fill="white"/>
|
|
5
|
+
<circle cx="40" cy="30" r="8" stroke="white" stroke-width="3" fill="none"/>
|
|
6
|
+
<path d="M37 27v6l5-3z" fill="white"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.activityFields = exports.activityOperations = void 0;
|
|
4
|
+
exports.activityOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: { show: { resource: ['activity'] } },
|
|
11
|
+
options: [
|
|
12
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get recent activity for a show', action: 'Get recent activity' },
|
|
13
|
+
],
|
|
14
|
+
default: 'getAll',
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
exports.activityFields = [
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Show ID',
|
|
20
|
+
name: 'showId',
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true,
|
|
23
|
+
default: '',
|
|
24
|
+
displayOptions: { show: { resource: ['activity'] } },
|
|
25
|
+
description: 'UUID of the show',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Limit',
|
|
29
|
+
name: 'limit',
|
|
30
|
+
type: 'number',
|
|
31
|
+
default: 50,
|
|
32
|
+
displayOptions: { show: { resource: ['activity'] } },
|
|
33
|
+
description: 'Max number of activity entries to return',
|
|
34
|
+
typeOptions: { minValue: 1, maxValue: 200 },
|
|
35
|
+
},
|
|
36
|
+
];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiFields = exports.aiOperations = void 0;
|
|
4
|
+
exports.aiOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: { show: { resource: ['ai'] } },
|
|
11
|
+
options: [
|
|
12
|
+
{ name: 'Generate Content', value: 'generate', description: 'Generate AI content from a transcript', action: 'Generate AI content' },
|
|
13
|
+
{ name: 'Get Credits', value: 'getCredits', description: 'Get AI credit balance', action: 'Get AI credits' },
|
|
14
|
+
{ name: 'Get Transcription', value: 'getTranscription', description: 'Get transcription for an episode', action: 'Get transcription' },
|
|
15
|
+
{ name: 'Run Pipeline', value: 'runPipeline', description: 'Run full AI pipeline (transcribe + generate)', action: 'Run AI pipeline' },
|
|
16
|
+
{ name: 'Transcribe Episode', value: 'transcribe', description: 'Submit episode audio for transcription', action: 'Transcribe episode' },
|
|
17
|
+
],
|
|
18
|
+
default: 'getCredits',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
exports.aiFields = [
|
|
22
|
+
// ------ Episode ID (transcribe, generate, getTranscription, runPipeline) ------
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Episode ID',
|
|
25
|
+
name: 'episodeId',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true,
|
|
28
|
+
default: '',
|
|
29
|
+
displayOptions: { show: { resource: ['ai'], operation: ['transcribe', 'generate', 'getTranscription', 'runPipeline'] } },
|
|
30
|
+
description: 'UUID of the episode',
|
|
31
|
+
},
|
|
32
|
+
// ------ Show ID (for generate and runPipeline which need the show context) ------
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Show ID',
|
|
35
|
+
name: 'showId',
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: true,
|
|
38
|
+
default: '',
|
|
39
|
+
displayOptions: { show: { resource: ['ai'], operation: ['runPipeline'] } },
|
|
40
|
+
description: 'UUID of the show (needed for batch pipeline)',
|
|
41
|
+
},
|
|
42
|
+
// ------ Transcribe fields ------
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Audio URL',
|
|
45
|
+
name: 'audioUrl',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true,
|
|
48
|
+
default: '',
|
|
49
|
+
displayOptions: { show: { resource: ['ai'], operation: ['transcribe'] } },
|
|
50
|
+
description: 'Public URL of the audio file to transcribe',
|
|
51
|
+
},
|
|
52
|
+
// ------ Generate fields ------
|
|
53
|
+
{
|
|
54
|
+
displayName: 'Generation Type',
|
|
55
|
+
name: 'generationType',
|
|
56
|
+
type: 'options',
|
|
57
|
+
required: true,
|
|
58
|
+
default: 'show_notes',
|
|
59
|
+
displayOptions: { show: { resource: ['ai'], operation: ['generate'] } },
|
|
60
|
+
options: [
|
|
61
|
+
{ name: 'Description', value: 'description' },
|
|
62
|
+
{ name: 'Show Notes', value: 'show_notes' },
|
|
63
|
+
{ name: 'Social — Instagram', value: 'social_instagram' },
|
|
64
|
+
{ name: 'Social — LinkedIn', value: 'social_linkedin' },
|
|
65
|
+
{ name: 'Social — Twitter', value: 'social_twitter' },
|
|
66
|
+
{ name: 'Titles', value: 'titles' },
|
|
67
|
+
],
|
|
68
|
+
description: 'Type of content to generate from the transcript',
|
|
69
|
+
},
|
|
70
|
+
// ------ Generate optional fields ------
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Options',
|
|
73
|
+
name: 'generateOptions',
|
|
74
|
+
type: 'collection',
|
|
75
|
+
placeholder: 'Add Option',
|
|
76
|
+
default: {},
|
|
77
|
+
displayOptions: { show: { resource: ['ai'], operation: ['generate'] } },
|
|
78
|
+
options: [
|
|
79
|
+
{
|
|
80
|
+
displayName: 'Length', name: 'length', type: 'options', default: 'standard',
|
|
81
|
+
options: [
|
|
82
|
+
{ name: 'Brief', value: 'brief' },
|
|
83
|
+
{ name: 'Detailed', value: 'detailed' },
|
|
84
|
+
{ name: 'Standard', value: 'standard' },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
displayName: 'Tone', name: 'tone', type: 'options', default: 'professional',
|
|
89
|
+
options: [
|
|
90
|
+
{ name: 'Casual', value: 'casual' },
|
|
91
|
+
{ name: 'Energetic', value: 'energetic' },
|
|
92
|
+
{ name: 'Professional', value: 'professional' },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clientFields = exports.clientOperations = void 0;
|
|
4
|
+
exports.clientOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: { show: { resource: ['client'] } },
|
|
11
|
+
options: [
|
|
12
|
+
{ name: 'Create', value: 'create', description: 'Create a client', action: 'Create a client' },
|
|
13
|
+
{ name: 'Delete', value: 'delete', description: 'Delete a client', action: 'Delete a client' },
|
|
14
|
+
{ name: 'Get', value: 'get', description: 'Get a client', action: 'Get a client' },
|
|
15
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get all clients', action: 'Get all clients' },
|
|
16
|
+
{ name: 'Update', value: 'update', description: 'Update a client', action: 'Update a client' },
|
|
17
|
+
],
|
|
18
|
+
default: 'getAll',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
exports.clientFields = [
|
|
22
|
+
// ------ Get / Update / Delete ------
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Client ID',
|
|
25
|
+
name: 'clientId',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true,
|
|
28
|
+
default: '',
|
|
29
|
+
displayOptions: { show: { resource: ['client'], operation: ['get', 'update', 'delete'] } },
|
|
30
|
+
description: 'UUID of the client',
|
|
31
|
+
},
|
|
32
|
+
// ------ Create ------
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Name',
|
|
35
|
+
name: 'name',
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: true,
|
|
38
|
+
default: '',
|
|
39
|
+
displayOptions: { show: { resource: ['client'], operation: ['create'] } },
|
|
40
|
+
description: 'Client name',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Additional Fields',
|
|
44
|
+
name: 'additionalFields',
|
|
45
|
+
type: 'collection',
|
|
46
|
+
placeholder: 'Add Field',
|
|
47
|
+
default: {},
|
|
48
|
+
displayOptions: { show: { resource: ['client'], operation: ['create'] } },
|
|
49
|
+
options: [
|
|
50
|
+
{ displayName: 'Company', name: 'company', type: 'string', default: '' },
|
|
51
|
+
{ displayName: 'Email', name: 'email', type: 'string', default: '', placeholder: 'name@example.com' },
|
|
52
|
+
{ displayName: 'Notes', name: 'notes', type: 'string', default: '' },
|
|
53
|
+
{ displayName: 'Phone', name: 'phone', type: 'string', default: '' },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
// ------ Update ------
|
|
57
|
+
{
|
|
58
|
+
displayName: 'Update Fields',
|
|
59
|
+
name: 'updateFields',
|
|
60
|
+
type: 'collection',
|
|
61
|
+
placeholder: 'Add Field',
|
|
62
|
+
default: {},
|
|
63
|
+
displayOptions: { show: { resource: ['client'], operation: ['update'] } },
|
|
64
|
+
options: [
|
|
65
|
+
{ displayName: 'Company', name: 'company', type: 'string', default: '' },
|
|
66
|
+
{ displayName: 'Email', name: 'email', type: 'string', default: '' },
|
|
67
|
+
{ displayName: 'Name', name: 'name', type: 'string', default: '' },
|
|
68
|
+
{ displayName: 'Notes', name: 'notes', type: 'string', default: '' },
|
|
69
|
+
{ displayName: 'Phone', name: 'phone', type: 'string', default: '' },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dashboardFields = exports.dashboardOperations = void 0;
|
|
4
|
+
exports.dashboardOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: { show: { resource: ['dashboard'] } },
|
|
11
|
+
options: [
|
|
12
|
+
{ name: 'Get Overview', value: 'getOverview', description: 'Get dashboard overview with stats, deadlines, and activity', action: 'Get dashboard overview' },
|
|
13
|
+
],
|
|
14
|
+
default: 'getOverview',
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
exports.dashboardFields = [];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deliverableFields = exports.deliverableOperations = void 0;
|
|
4
|
+
exports.deliverableOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: { show: { resource: ['deliverable'] } },
|
|
11
|
+
options: [
|
|
12
|
+
{ name: 'Create', value: 'create', description: 'Create a deliverable', action: 'Create a deliverable' },
|
|
13
|
+
{ name: 'Get', value: 'get', description: 'Get a deliverable', action: 'Get a deliverable' },
|
|
14
|
+
{ name: 'Get Many', value: 'getAll', description: 'Get all deliverables', action: 'Get all deliverables' },
|
|
15
|
+
{ name: 'Update', value: 'update', description: 'Update a deliverable', action: 'Update a deliverable' },
|
|
16
|
+
],
|
|
17
|
+
default: 'getAll',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
exports.deliverableFields = [
|
|
21
|
+
// ------ Get / Update ------
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Deliverable ID',
|
|
24
|
+
name: 'deliverableId',
|
|
25
|
+
type: 'string',
|
|
26
|
+
required: true,
|
|
27
|
+
default: '',
|
|
28
|
+
displayOptions: { show: { resource: ['deliverable'], operation: ['get', 'update'] } },
|
|
29
|
+
description: 'UUID of the deliverable',
|
|
30
|
+
},
|
|
31
|
+
// ------ Get Many filters ------
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Filters',
|
|
34
|
+
name: 'filters',
|
|
35
|
+
type: 'collection',
|
|
36
|
+
placeholder: 'Add Filter',
|
|
37
|
+
default: {},
|
|
38
|
+
displayOptions: { show: { resource: ['deliverable'], operation: ['getAll'] } },
|
|
39
|
+
options: [
|
|
40
|
+
{ displayName: 'Episode ID', name: 'episode_id', type: 'string', default: '' },
|
|
41
|
+
{ displayName: 'Show ID', name: 'show_id', type: 'string', default: '' },
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Status', name: 'status', type: 'options', default: '',
|
|
44
|
+
options: [
|
|
45
|
+
{ name: 'All', value: '' },
|
|
46
|
+
{ name: 'Approved', value: 'approved' },
|
|
47
|
+
{ name: 'Pending', value: 'pending' },
|
|
48
|
+
{ name: 'Revision Requested', value: 'revision_requested' },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
// ------ Create ------
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Show ID',
|
|
56
|
+
name: 'showId',
|
|
57
|
+
type: 'string',
|
|
58
|
+
required: true,
|
|
59
|
+
default: '',
|
|
60
|
+
displayOptions: { show: { resource: ['deliverable'], operation: ['create'] } },
|
|
61
|
+
description: 'UUID of the show',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Title',
|
|
65
|
+
name: 'title',
|
|
66
|
+
type: 'string',
|
|
67
|
+
required: true,
|
|
68
|
+
default: '',
|
|
69
|
+
displayOptions: { show: { resource: ['deliverable'], operation: ['create'] } },
|
|
70
|
+
description: 'Deliverable title',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Additional Fields',
|
|
74
|
+
name: 'additionalFields',
|
|
75
|
+
type: 'collection',
|
|
76
|
+
placeholder: 'Add Field',
|
|
77
|
+
default: {},
|
|
78
|
+
displayOptions: { show: { resource: ['deliverable'], operation: ['create'] } },
|
|
79
|
+
options: [
|
|
80
|
+
{ displayName: 'Description', name: 'description', type: 'string', default: '' },
|
|
81
|
+
{ displayName: 'Episode ID', name: 'episode_id', type: 'string', default: '' },
|
|
82
|
+
{ displayName: 'File URL', name: 'file_url', type: 'string', default: '' },
|
|
83
|
+
{ displayName: 'Producer Notes', name: 'producer_notes', type: 'string', default: '' },
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Type', name: 'type', type: 'options', default: 'other',
|
|
86
|
+
options: [
|
|
87
|
+
{ name: 'Cover Art', value: 'cover_art' },
|
|
88
|
+
{ name: 'Final Cut', value: 'final_cut' },
|
|
89
|
+
{ name: 'Intro', value: 'intro' },
|
|
90
|
+
{ name: 'Other', value: 'other' },
|
|
91
|
+
{ name: 'Outro', value: 'outro' },
|
|
92
|
+
{ name: 'Rough Cut', value: 'rough_cut' },
|
|
93
|
+
{ name: 'Show Notes', value: 'show_notes' },
|
|
94
|
+
{ name: 'Social Clip', value: 'social_clip' },
|
|
95
|
+
{ name: 'Thumbnail', value: 'thumbnail' },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
// ------ Update ------
|
|
101
|
+
{
|
|
102
|
+
displayName: 'Update Fields',
|
|
103
|
+
name: 'updateFields',
|
|
104
|
+
type: 'collection',
|
|
105
|
+
placeholder: 'Add Field',
|
|
106
|
+
default: {},
|
|
107
|
+
displayOptions: { show: { resource: ['deliverable'], operation: ['update'] } },
|
|
108
|
+
options: [
|
|
109
|
+
{ displayName: 'Description', name: 'description', type: 'string', default: '' },
|
|
110
|
+
{ displayName: 'File URL', name: 'file_url', type: 'string', default: '' },
|
|
111
|
+
{ displayName: 'Producer Notes', name: 'producer_notes', type: 'string', default: '' },
|
|
112
|
+
{
|
|
113
|
+
displayName: 'Status', name: 'status', type: 'options', default: 'pending',
|
|
114
|
+
options: [
|
|
115
|
+
{ name: 'Approved', value: 'approved' },
|
|
116
|
+
{ name: 'Pending', value: 'pending' },
|
|
117
|
+
{ name: 'Revision Requested', value: 'revision_requested' },
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{ displayName: 'Title', name: 'title', type: 'string', default: '' },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
];
|