n8n-nodes-render-cloud 1.0.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/COMMERCIAL_LICENSE.md +31 -0
- package/LICENSE +46 -0
- package/LICENSING_FAQ.md +18 -0
- package/README.md +439 -0
- package/dist/credentials/RenderCloudApi.credentials.d.ts +10 -0
- package/dist/credentials/RenderCloudApi.credentials.d.ts.map +1 -0
- package/dist/credentials/RenderCloudApi.credentials.js +46 -0
- package/dist/credentials/RenderCloudApi.credentials.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/RenderCloud/RenderCloud.node.d.ts +6 -0
- package/dist/nodes/RenderCloud/RenderCloud.node.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/RenderCloud.node.js +260 -0
- package/dist/nodes/RenderCloud/RenderCloud.node.js.map +1 -0
- package/dist/nodes/RenderCloud/RenderCloudTrigger.node.d.ts +13 -0
- package/dist/nodes/RenderCloud/RenderCloudTrigger.node.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/RenderCloudTrigger.node.js +314 -0
- package/dist/nodes/RenderCloud/RenderCloudTrigger.node.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/customDomain/customDomain.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/customDomain/customDomain.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/customDomain/customDomain.js +260 -0
- package/dist/nodes/RenderCloud/actions/customDomain/customDomain.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/deploy/deploy.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/deploy/deploy.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/deploy/deploy.js +255 -0
- package/dist/nodes/RenderCloud/actions/deploy/deploy.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/disk/disk.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/disk/disk.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/disk/disk.js +323 -0
- package/dist/nodes/RenderCloud/actions/disk/disk.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/environment/environment.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/environment/environment.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/environment/environment.js +300 -0
- package/dist/nodes/RenderCloud/actions/environment/environment.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/environmentGroup/environmentGroup.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/environmentGroup/environmentGroup.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/environmentGroup/environmentGroup.js +506 -0
- package/dist/nodes/RenderCloud/actions/environmentGroup/environmentGroup.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/environmentVariable/environmentVariable.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/environmentVariable/environmentVariable.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/environmentVariable/environmentVariable.js +237 -0
- package/dist/nodes/RenderCloud/actions/environmentVariable/environmentVariable.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/keyValue/keyValue.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/keyValue/keyValue.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/keyValue/keyValue.js +408 -0
- package/dist/nodes/RenderCloud/actions/keyValue/keyValue.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/postgres/postgres.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/postgres/postgres.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/postgres/postgres.js +630 -0
- package/dist/nodes/RenderCloud/actions/postgres/postgres.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/project/project.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/project/project.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/project/project.js +294 -0
- package/dist/nodes/RenderCloud/actions/project/project.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/secretFile/secretFile.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/secretFile/secretFile.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/secretFile/secretFile.js +216 -0
- package/dist/nodes/RenderCloud/actions/secretFile/secretFile.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/service/service.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/service/service.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/service/service.js +875 -0
- package/dist/nodes/RenderCloud/actions/service/service.js.map +1 -0
- package/dist/nodes/RenderCloud/actions/webhook/webhook.d.ts +5 -0
- package/dist/nodes/RenderCloud/actions/webhook/webhook.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/actions/webhook/webhook.js +399 -0
- package/dist/nodes/RenderCloud/actions/webhook/webhook.js.map +1 -0
- package/dist/nodes/RenderCloud/renderCloud.svg +6 -0
- package/dist/nodes/RenderCloud/transport/GenericFunctions.d.ts +13 -0
- package/dist/nodes/RenderCloud/transport/GenericFunctions.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/transport/GenericFunctions.js +140 -0
- package/dist/nodes/RenderCloud/transport/GenericFunctions.js.map +1 -0
- package/dist/nodes/RenderCloud/utils/types.d.ts +131 -0
- package/dist/nodes/RenderCloud/utils/types.d.ts.map +1 -0
- package/dist/nodes/RenderCloud/utils/types.js +25 -0
- package/dist/nodes/RenderCloud/utils/types.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.serviceFields = exports.serviceOperations = void 0;
|
|
10
|
+
exports.executeServiceOperation = executeServiceOperation;
|
|
11
|
+
const GenericFunctions_1 = require("../../transport/GenericFunctions");
|
|
12
|
+
exports.serviceOperations = [
|
|
13
|
+
{
|
|
14
|
+
displayName: 'Operation',
|
|
15
|
+
name: 'operation',
|
|
16
|
+
type: 'options',
|
|
17
|
+
noDataExpression: true,
|
|
18
|
+
displayOptions: {
|
|
19
|
+
show: {
|
|
20
|
+
resource: ['service'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
name: 'Create',
|
|
26
|
+
value: 'create',
|
|
27
|
+
description: 'Create a new service',
|
|
28
|
+
action: 'Create a service',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Delete',
|
|
32
|
+
value: 'delete',
|
|
33
|
+
description: 'Delete a service',
|
|
34
|
+
action: 'Delete a service',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Delete Autoscaling',
|
|
38
|
+
value: 'deleteAutoscaling',
|
|
39
|
+
description: 'Remove autoscaling configuration from a service',
|
|
40
|
+
action: 'Delete autoscaling from a service',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Get',
|
|
44
|
+
value: 'get',
|
|
45
|
+
description: 'Retrieve a service by ID',
|
|
46
|
+
action: 'Get a service',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'List',
|
|
50
|
+
value: 'list',
|
|
51
|
+
description: 'List all services',
|
|
52
|
+
action: 'List services',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'Purge Cache',
|
|
56
|
+
value: 'purgeCache',
|
|
57
|
+
description: 'Purge cache for a web service',
|
|
58
|
+
action: 'Purge cache for a service',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Restart',
|
|
62
|
+
value: 'restart',
|
|
63
|
+
description: 'Restart a service',
|
|
64
|
+
action: 'Restart a service',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'Resume',
|
|
68
|
+
value: 'resume',
|
|
69
|
+
description: 'Resume a suspended service',
|
|
70
|
+
action: 'Resume a service',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Scale',
|
|
74
|
+
value: 'scale',
|
|
75
|
+
description: 'Scale instance count for a service',
|
|
76
|
+
action: 'Scale a service',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Suspend',
|
|
80
|
+
value: 'suspend',
|
|
81
|
+
description: 'Suspend a running service',
|
|
82
|
+
action: 'Suspend a service',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Update',
|
|
86
|
+
value: 'update',
|
|
87
|
+
description: 'Update service configuration',
|
|
88
|
+
action: 'Update a service',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'Update Autoscaling',
|
|
92
|
+
value: 'updateAutoscaling',
|
|
93
|
+
description: 'Configure autoscaling settings for a service',
|
|
94
|
+
action: 'Update autoscaling for a service',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
default: 'list',
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
exports.serviceFields = [
|
|
101
|
+
// ----------------------------------
|
|
102
|
+
// service: list
|
|
103
|
+
// ----------------------------------
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Return All',
|
|
106
|
+
name: 'returnAll',
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
displayOptions: {
|
|
109
|
+
show: {
|
|
110
|
+
resource: ['service'],
|
|
111
|
+
operation: ['list'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
default: false,
|
|
115
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Limit',
|
|
119
|
+
name: 'limit',
|
|
120
|
+
type: 'number',
|
|
121
|
+
displayOptions: {
|
|
122
|
+
show: {
|
|
123
|
+
resource: ['service'],
|
|
124
|
+
operation: ['list'],
|
|
125
|
+
returnAll: [false],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
typeOptions: {
|
|
129
|
+
minValue: 1,
|
|
130
|
+
maxValue: 100,
|
|
131
|
+
},
|
|
132
|
+
default: 20,
|
|
133
|
+
description: 'Max number of results to return',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
displayName: 'Filters',
|
|
137
|
+
name: 'filters',
|
|
138
|
+
type: 'collection',
|
|
139
|
+
placeholder: 'Add Filter',
|
|
140
|
+
default: {},
|
|
141
|
+
displayOptions: {
|
|
142
|
+
show: {
|
|
143
|
+
resource: ['service'],
|
|
144
|
+
operation: ['list'],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
options: [
|
|
148
|
+
{
|
|
149
|
+
displayName: 'Name',
|
|
150
|
+
name: 'name',
|
|
151
|
+
type: 'string',
|
|
152
|
+
default: '',
|
|
153
|
+
description: 'Filter by service name',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
displayName: 'Owner ID',
|
|
157
|
+
name: 'ownerId',
|
|
158
|
+
type: 'string',
|
|
159
|
+
default: '',
|
|
160
|
+
description: 'Filter by workspace owner ID',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
displayName: 'Type',
|
|
164
|
+
name: 'type',
|
|
165
|
+
type: 'options',
|
|
166
|
+
options: [
|
|
167
|
+
{ name: 'Background Worker', value: 'background_worker' },
|
|
168
|
+
{ name: 'Cron Job', value: 'cron_job' },
|
|
169
|
+
{ name: 'Private Service', value: 'private_service' },
|
|
170
|
+
{ name: 'Static Site', value: 'static_site' },
|
|
171
|
+
{ name: 'Web Service', value: 'web_service' },
|
|
172
|
+
],
|
|
173
|
+
default: 'web_service',
|
|
174
|
+
description: 'Filter by service type',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
displayName: 'Environment',
|
|
178
|
+
name: 'env',
|
|
179
|
+
type: 'options',
|
|
180
|
+
options: [
|
|
181
|
+
{ name: 'Docker', value: 'docker' },
|
|
182
|
+
{ name: 'Elixir', value: 'elixir' },
|
|
183
|
+
{ name: 'Go', value: 'go' },
|
|
184
|
+
{ name: 'Node', value: 'node' },
|
|
185
|
+
{ name: 'Python', value: 'python' },
|
|
186
|
+
{ name: 'Ruby', value: 'ruby' },
|
|
187
|
+
{ name: 'Rust', value: 'rust' },
|
|
188
|
+
{ name: 'Static', value: 'static' },
|
|
189
|
+
],
|
|
190
|
+
default: 'node',
|
|
191
|
+
description: 'Filter by runtime environment',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
displayName: 'Region',
|
|
195
|
+
name: 'region',
|
|
196
|
+
type: 'options',
|
|
197
|
+
options: [
|
|
198
|
+
{ name: 'Frankfurt', value: 'frankfurt' },
|
|
199
|
+
{ name: 'Ohio', value: 'ohio' },
|
|
200
|
+
{ name: 'Oregon', value: 'oregon' },
|
|
201
|
+
{ name: 'Singapore', value: 'singapore' },
|
|
202
|
+
{ name: 'Virginia', value: 'virginia' },
|
|
203
|
+
],
|
|
204
|
+
default: 'oregon',
|
|
205
|
+
description: 'Filter by deployment region',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
displayName: 'Suspended Status',
|
|
209
|
+
name: 'suspended',
|
|
210
|
+
type: 'options',
|
|
211
|
+
options: [
|
|
212
|
+
{ name: 'All', value: 'all' },
|
|
213
|
+
{ name: 'Not Suspended', value: 'not_suspended' },
|
|
214
|
+
{ name: 'Suspended', value: 'suspended' },
|
|
215
|
+
],
|
|
216
|
+
default: 'all',
|
|
217
|
+
description: 'Filter by suspended status',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
displayName: 'Created Before',
|
|
221
|
+
name: 'createdBefore',
|
|
222
|
+
type: 'dateTime',
|
|
223
|
+
default: '',
|
|
224
|
+
description: 'Filter by creation date (before)',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
displayName: 'Created After',
|
|
228
|
+
name: 'createdAfter',
|
|
229
|
+
type: 'dateTime',
|
|
230
|
+
default: '',
|
|
231
|
+
description: 'Filter by creation date (after)',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
displayName: 'Updated Before',
|
|
235
|
+
name: 'updatedBefore',
|
|
236
|
+
type: 'dateTime',
|
|
237
|
+
default: '',
|
|
238
|
+
description: 'Filter by update date (before)',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
displayName: 'Updated After',
|
|
242
|
+
name: 'updatedAfter',
|
|
243
|
+
type: 'dateTime',
|
|
244
|
+
default: '',
|
|
245
|
+
description: 'Filter by update date (after)',
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
// ----------------------------------
|
|
250
|
+
// service: get, delete, suspend, resume, restart, purgeCache
|
|
251
|
+
// ----------------------------------
|
|
252
|
+
{
|
|
253
|
+
displayName: 'Service ID',
|
|
254
|
+
name: 'serviceId',
|
|
255
|
+
type: 'string',
|
|
256
|
+
required: true,
|
|
257
|
+
default: '',
|
|
258
|
+
displayOptions: {
|
|
259
|
+
show: {
|
|
260
|
+
resource: ['service'],
|
|
261
|
+
operation: ['get', 'delete', 'suspend', 'resume', 'restart', 'purgeCache', 'update', 'scale', 'updateAutoscaling', 'deleteAutoscaling'],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
description: 'The ID of the service (srv-xxxxx format)',
|
|
265
|
+
},
|
|
266
|
+
// ----------------------------------
|
|
267
|
+
// service: create
|
|
268
|
+
// ----------------------------------
|
|
269
|
+
{
|
|
270
|
+
displayName: 'Service Type',
|
|
271
|
+
name: 'type',
|
|
272
|
+
type: 'options',
|
|
273
|
+
required: true,
|
|
274
|
+
displayOptions: {
|
|
275
|
+
show: {
|
|
276
|
+
resource: ['service'],
|
|
277
|
+
operation: ['create'],
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
options: [
|
|
281
|
+
{ name: 'Background Worker', value: 'background_worker' },
|
|
282
|
+
{ name: 'Cron Job', value: 'cron_job' },
|
|
283
|
+
{ name: 'Private Service', value: 'private_service' },
|
|
284
|
+
{ name: 'Static Site', value: 'static_site' },
|
|
285
|
+
{ name: 'Web Service', value: 'web_service' },
|
|
286
|
+
],
|
|
287
|
+
default: 'web_service',
|
|
288
|
+
description: 'The type of service to create',
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
displayName: 'Name',
|
|
292
|
+
name: 'name',
|
|
293
|
+
type: 'string',
|
|
294
|
+
required: true,
|
|
295
|
+
default: '',
|
|
296
|
+
displayOptions: {
|
|
297
|
+
show: {
|
|
298
|
+
resource: ['service'],
|
|
299
|
+
operation: ['create'],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
description: 'The name of the service',
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
displayName: 'Owner ID',
|
|
306
|
+
name: 'ownerId',
|
|
307
|
+
type: 'string',
|
|
308
|
+
required: true,
|
|
309
|
+
default: '',
|
|
310
|
+
displayOptions: {
|
|
311
|
+
show: {
|
|
312
|
+
resource: ['service'],
|
|
313
|
+
operation: ['create'],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
description: 'The ID of the owner (user or team)',
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
displayName: 'Deployment Source',
|
|
320
|
+
name: 'deploymentSource',
|
|
321
|
+
type: 'options',
|
|
322
|
+
required: true,
|
|
323
|
+
displayOptions: {
|
|
324
|
+
show: {
|
|
325
|
+
resource: ['service'],
|
|
326
|
+
operation: ['create'],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
options: [
|
|
330
|
+
{ name: 'Git Repository', value: 'git' },
|
|
331
|
+
{ name: 'Docker Image', value: 'image' },
|
|
332
|
+
],
|
|
333
|
+
default: 'git',
|
|
334
|
+
description: 'Source for deploying the service',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
displayName: 'Repository URL',
|
|
338
|
+
name: 'repo',
|
|
339
|
+
type: 'string',
|
|
340
|
+
required: true,
|
|
341
|
+
displayOptions: {
|
|
342
|
+
show: {
|
|
343
|
+
resource: ['service'],
|
|
344
|
+
operation: ['create'],
|
|
345
|
+
deploymentSource: ['git'],
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
default: '',
|
|
349
|
+
placeholder: 'https://github.com/user/repo',
|
|
350
|
+
description: 'The Git repository URL',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
displayName: 'Branch',
|
|
354
|
+
name: 'branch',
|
|
355
|
+
type: 'string',
|
|
356
|
+
displayOptions: {
|
|
357
|
+
show: {
|
|
358
|
+
resource: ['service'],
|
|
359
|
+
operation: ['create'],
|
|
360
|
+
deploymentSource: ['git'],
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
default: 'main',
|
|
364
|
+
description: 'The branch to deploy from',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
displayName: 'Image URL',
|
|
368
|
+
name: 'image',
|
|
369
|
+
type: 'string',
|
|
370
|
+
required: true,
|
|
371
|
+
displayOptions: {
|
|
372
|
+
show: {
|
|
373
|
+
resource: ['service'],
|
|
374
|
+
operation: ['create'],
|
|
375
|
+
deploymentSource: ['image'],
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
default: '',
|
|
379
|
+
placeholder: 'docker.io/library/nginx:latest',
|
|
380
|
+
description: 'The Docker image URL',
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
displayName: 'Additional Options',
|
|
384
|
+
name: 'additionalOptions',
|
|
385
|
+
type: 'collection',
|
|
386
|
+
placeholder: 'Add Option',
|
|
387
|
+
default: {},
|
|
388
|
+
displayOptions: {
|
|
389
|
+
show: {
|
|
390
|
+
resource: ['service'],
|
|
391
|
+
operation: ['create'],
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
options: [
|
|
395
|
+
{
|
|
396
|
+
displayName: 'Auto Deploy',
|
|
397
|
+
name: 'autoDeploy',
|
|
398
|
+
type: 'options',
|
|
399
|
+
options: [
|
|
400
|
+
{ name: 'Yes', value: 'yes' },
|
|
401
|
+
{ name: 'No', value: 'no' },
|
|
402
|
+
],
|
|
403
|
+
default: 'yes',
|
|
404
|
+
description: 'Whether to automatically deploy on push',
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
displayName: 'Build Command',
|
|
408
|
+
name: 'buildCommand',
|
|
409
|
+
type: 'string',
|
|
410
|
+
default: '',
|
|
411
|
+
description: 'Command to build the service',
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
displayName: 'Docker Command',
|
|
415
|
+
name: 'dockerCommand',
|
|
416
|
+
type: 'string',
|
|
417
|
+
default: '',
|
|
418
|
+
description: 'Command to run in the Docker container',
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
displayName: 'Dockerfile Path',
|
|
422
|
+
name: 'dockerfilePath',
|
|
423
|
+
type: 'string',
|
|
424
|
+
default: './Dockerfile',
|
|
425
|
+
description: 'Path to the Dockerfile',
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
displayName: 'Health Check Path',
|
|
429
|
+
name: 'healthCheckPath',
|
|
430
|
+
type: 'string',
|
|
431
|
+
default: '',
|
|
432
|
+
description: 'Path for health check endpoint',
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
displayName: 'Instance Count',
|
|
436
|
+
name: 'numInstances',
|
|
437
|
+
type: 'number',
|
|
438
|
+
typeOptions: {
|
|
439
|
+
minValue: 1,
|
|
440
|
+
},
|
|
441
|
+
default: 1,
|
|
442
|
+
description: 'Number of instances to run',
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
displayName: 'Plan',
|
|
446
|
+
name: 'plan',
|
|
447
|
+
type: 'options',
|
|
448
|
+
options: [
|
|
449
|
+
{ name: 'Starter', value: 'starter' },
|
|
450
|
+
{ name: 'Standard', value: 'standard' },
|
|
451
|
+
{ name: 'Pro', value: 'pro' },
|
|
452
|
+
{ name: 'Pro Plus', value: 'pro_plus' },
|
|
453
|
+
{ name: 'Pro Max', value: 'pro_max' },
|
|
454
|
+
{ name: 'Pro Ultra', value: 'pro_ultra' },
|
|
455
|
+
],
|
|
456
|
+
default: 'starter',
|
|
457
|
+
description: 'Instance type/plan for the service',
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
displayName: 'Region',
|
|
461
|
+
name: 'region',
|
|
462
|
+
type: 'options',
|
|
463
|
+
options: [
|
|
464
|
+
{ name: 'Frankfurt', value: 'frankfurt' },
|
|
465
|
+
{ name: 'Ohio', value: 'ohio' },
|
|
466
|
+
{ name: 'Oregon', value: 'oregon' },
|
|
467
|
+
{ name: 'Singapore', value: 'singapore' },
|
|
468
|
+
{ name: 'Virginia', value: 'virginia' },
|
|
469
|
+
],
|
|
470
|
+
default: 'oregon',
|
|
471
|
+
description: 'Deployment region',
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
displayName: 'Root Directory',
|
|
475
|
+
name: 'rootDir',
|
|
476
|
+
type: 'string',
|
|
477
|
+
default: '',
|
|
478
|
+
description: 'Root directory of the service within the repository',
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
displayName: 'Runtime',
|
|
482
|
+
name: 'runtime',
|
|
483
|
+
type: 'options',
|
|
484
|
+
options: [
|
|
485
|
+
{ name: 'Docker', value: 'docker' },
|
|
486
|
+
{ name: 'Elixir', value: 'elixir' },
|
|
487
|
+
{ name: 'Go', value: 'go' },
|
|
488
|
+
{ name: 'Node', value: 'node' },
|
|
489
|
+
{ name: 'Python', value: 'python' },
|
|
490
|
+
{ name: 'Ruby', value: 'ruby' },
|
|
491
|
+
{ name: 'Rust', value: 'rust' },
|
|
492
|
+
],
|
|
493
|
+
default: 'node',
|
|
494
|
+
description: 'Runtime environment',
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
displayName: 'Start Command',
|
|
498
|
+
name: 'startCommand',
|
|
499
|
+
type: 'string',
|
|
500
|
+
default: '',
|
|
501
|
+
description: 'Command to start the service',
|
|
502
|
+
},
|
|
503
|
+
],
|
|
504
|
+
},
|
|
505
|
+
// ----------------------------------
|
|
506
|
+
// service: update
|
|
507
|
+
// ----------------------------------
|
|
508
|
+
{
|
|
509
|
+
displayName: 'Update Fields',
|
|
510
|
+
name: 'updateFields',
|
|
511
|
+
type: 'collection',
|
|
512
|
+
placeholder: 'Add Field',
|
|
513
|
+
default: {},
|
|
514
|
+
displayOptions: {
|
|
515
|
+
show: {
|
|
516
|
+
resource: ['service'],
|
|
517
|
+
operation: ['update'],
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
options: [
|
|
521
|
+
{
|
|
522
|
+
displayName: 'Auto Deploy',
|
|
523
|
+
name: 'autoDeploy',
|
|
524
|
+
type: 'options',
|
|
525
|
+
options: [
|
|
526
|
+
{ name: 'Yes', value: 'yes' },
|
|
527
|
+
{ name: 'No', value: 'no' },
|
|
528
|
+
],
|
|
529
|
+
default: 'yes',
|
|
530
|
+
description: 'Whether to automatically deploy on push',
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
displayName: 'Branch',
|
|
534
|
+
name: 'branch',
|
|
535
|
+
type: 'string',
|
|
536
|
+
default: '',
|
|
537
|
+
description: 'The branch to deploy from',
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
displayName: 'Build Command',
|
|
541
|
+
name: 'buildCommand',
|
|
542
|
+
type: 'string',
|
|
543
|
+
default: '',
|
|
544
|
+
description: 'Command to build the service',
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
displayName: 'Health Check Path',
|
|
548
|
+
name: 'healthCheckPath',
|
|
549
|
+
type: 'string',
|
|
550
|
+
default: '',
|
|
551
|
+
description: 'Path for health check endpoint',
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
displayName: 'Image URL',
|
|
555
|
+
name: 'image',
|
|
556
|
+
type: 'string',
|
|
557
|
+
default: '',
|
|
558
|
+
description: 'The Docker image URL (for image-backed services)',
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
displayName: 'Name',
|
|
562
|
+
name: 'name',
|
|
563
|
+
type: 'string',
|
|
564
|
+
default: '',
|
|
565
|
+
description: 'The name of the service',
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
displayName: 'Start Command',
|
|
569
|
+
name: 'startCommand',
|
|
570
|
+
type: 'string',
|
|
571
|
+
default: '',
|
|
572
|
+
description: 'Command to start the service',
|
|
573
|
+
},
|
|
574
|
+
],
|
|
575
|
+
},
|
|
576
|
+
// ----------------------------------
|
|
577
|
+
// service: scale
|
|
578
|
+
// ----------------------------------
|
|
579
|
+
{
|
|
580
|
+
displayName: 'Number of Instances',
|
|
581
|
+
name: 'numInstances',
|
|
582
|
+
type: 'number',
|
|
583
|
+
required: true,
|
|
584
|
+
typeOptions: {
|
|
585
|
+
minValue: 1,
|
|
586
|
+
},
|
|
587
|
+
default: 1,
|
|
588
|
+
displayOptions: {
|
|
589
|
+
show: {
|
|
590
|
+
resource: ['service'],
|
|
591
|
+
operation: ['scale'],
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
description: 'Number of instances to scale to',
|
|
595
|
+
},
|
|
596
|
+
// ----------------------------------
|
|
597
|
+
// service: updateAutoscaling
|
|
598
|
+
// ----------------------------------
|
|
599
|
+
{
|
|
600
|
+
displayName: 'Autoscaling Enabled',
|
|
601
|
+
name: 'autoscalingEnabled',
|
|
602
|
+
type: 'boolean',
|
|
603
|
+
required: true,
|
|
604
|
+
default: true,
|
|
605
|
+
displayOptions: {
|
|
606
|
+
show: {
|
|
607
|
+
resource: ['service'],
|
|
608
|
+
operation: ['updateAutoscaling'],
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
description: 'Whether autoscaling is enabled',
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
displayName: 'Minimum Instances',
|
|
615
|
+
name: 'minInstances',
|
|
616
|
+
type: 'number',
|
|
617
|
+
required: true,
|
|
618
|
+
typeOptions: {
|
|
619
|
+
minValue: 1,
|
|
620
|
+
},
|
|
621
|
+
default: 1,
|
|
622
|
+
displayOptions: {
|
|
623
|
+
show: {
|
|
624
|
+
resource: ['service'],
|
|
625
|
+
operation: ['updateAutoscaling'],
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
description: 'Minimum number of instances',
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
displayName: 'Maximum Instances',
|
|
632
|
+
name: 'maxInstances',
|
|
633
|
+
type: 'number',
|
|
634
|
+
required: true,
|
|
635
|
+
typeOptions: {
|
|
636
|
+
minValue: 1,
|
|
637
|
+
},
|
|
638
|
+
default: 3,
|
|
639
|
+
displayOptions: {
|
|
640
|
+
show: {
|
|
641
|
+
resource: ['service'],
|
|
642
|
+
operation: ['updateAutoscaling'],
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
description: 'Maximum number of instances',
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
displayName: 'Autoscaling Criteria',
|
|
649
|
+
name: 'autoscalingCriteria',
|
|
650
|
+
type: 'collection',
|
|
651
|
+
placeholder: 'Add Criteria',
|
|
652
|
+
default: {},
|
|
653
|
+
displayOptions: {
|
|
654
|
+
show: {
|
|
655
|
+
resource: ['service'],
|
|
656
|
+
operation: ['updateAutoscaling'],
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
options: [
|
|
660
|
+
{
|
|
661
|
+
displayName: 'CPU Percentage',
|
|
662
|
+
name: 'cpu',
|
|
663
|
+
type: 'number',
|
|
664
|
+
typeOptions: {
|
|
665
|
+
minValue: 1,
|
|
666
|
+
maxValue: 100,
|
|
667
|
+
},
|
|
668
|
+
default: 70,
|
|
669
|
+
description: 'CPU threshold percentage for scaling',
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
displayName: 'Memory Percentage',
|
|
673
|
+
name: 'memory',
|
|
674
|
+
type: 'number',
|
|
675
|
+
typeOptions: {
|
|
676
|
+
minValue: 1,
|
|
677
|
+
maxValue: 100,
|
|
678
|
+
},
|
|
679
|
+
default: 70,
|
|
680
|
+
description: 'Memory threshold percentage for scaling',
|
|
681
|
+
},
|
|
682
|
+
],
|
|
683
|
+
},
|
|
684
|
+
];
|
|
685
|
+
async function executeServiceOperation(operation, i) {
|
|
686
|
+
let responseData;
|
|
687
|
+
if (operation === 'list') {
|
|
688
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
689
|
+
const filters = this.getNodeParameter('filters', i);
|
|
690
|
+
const query = {};
|
|
691
|
+
if (filters.name) {
|
|
692
|
+
query.name = filters.name;
|
|
693
|
+
}
|
|
694
|
+
if (filters.ownerId) {
|
|
695
|
+
query.ownerId = filters.ownerId;
|
|
696
|
+
}
|
|
697
|
+
if (filters.type) {
|
|
698
|
+
query.type = filters.type;
|
|
699
|
+
}
|
|
700
|
+
if (filters.env) {
|
|
701
|
+
query.env = filters.env;
|
|
702
|
+
}
|
|
703
|
+
if (filters.region) {
|
|
704
|
+
query.region = filters.region;
|
|
705
|
+
}
|
|
706
|
+
if (filters.suspended) {
|
|
707
|
+
query.suspended = filters.suspended;
|
|
708
|
+
}
|
|
709
|
+
(0, GenericFunctions_1.handleDateFilters)(query, filters);
|
|
710
|
+
if (returnAll) {
|
|
711
|
+
responseData = await GenericFunctions_1.renderCloudApiRequestAllItems.call(this, 'GET', '/services', {}, query);
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
const limit = this.getNodeParameter('limit', i);
|
|
715
|
+
query.limit = limit;
|
|
716
|
+
const response = await GenericFunctions_1.renderCloudApiRequest.call(this, 'GET', '/services', {}, query);
|
|
717
|
+
responseData = Array.isArray(response)
|
|
718
|
+
? response.map((item) => (item.service || item)).slice(0, limit)
|
|
719
|
+
: [response];
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
else if (operation === 'get') {
|
|
723
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
724
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
725
|
+
responseData = (await GenericFunctions_1.renderCloudApiRequest.call(this, 'GET', `/services/${serviceId}`));
|
|
726
|
+
}
|
|
727
|
+
else if (operation === 'create') {
|
|
728
|
+
const type = this.getNodeParameter('type', i);
|
|
729
|
+
const name = this.getNodeParameter('name', i);
|
|
730
|
+
const ownerId = this.getNodeParameter('ownerId', i);
|
|
731
|
+
const deploymentSource = this.getNodeParameter('deploymentSource', i);
|
|
732
|
+
const additionalOptions = this.getNodeParameter('additionalOptions', i);
|
|
733
|
+
const body = {
|
|
734
|
+
type,
|
|
735
|
+
name,
|
|
736
|
+
ownerId,
|
|
737
|
+
};
|
|
738
|
+
if (deploymentSource === 'git') {
|
|
739
|
+
body.repo = this.getNodeParameter('repo', i);
|
|
740
|
+
body.branch = this.getNodeParameter('branch', i);
|
|
741
|
+
}
|
|
742
|
+
else {
|
|
743
|
+
body.image = { ownerId, imagePath: this.getNodeParameter('image', i) };
|
|
744
|
+
}
|
|
745
|
+
// Add additional options
|
|
746
|
+
if (additionalOptions.autoDeploy) {
|
|
747
|
+
body.autoDeploy = additionalOptions.autoDeploy;
|
|
748
|
+
}
|
|
749
|
+
if (additionalOptions.buildCommand) {
|
|
750
|
+
body.buildCommand = additionalOptions.buildCommand;
|
|
751
|
+
}
|
|
752
|
+
if (additionalOptions.dockerCommand) {
|
|
753
|
+
body.dockerCommand = additionalOptions.dockerCommand;
|
|
754
|
+
}
|
|
755
|
+
if (additionalOptions.dockerfilePath) {
|
|
756
|
+
body.dockerfilePath = additionalOptions.dockerfilePath;
|
|
757
|
+
}
|
|
758
|
+
if (additionalOptions.healthCheckPath) {
|
|
759
|
+
body.healthCheckPath = additionalOptions.healthCheckPath;
|
|
760
|
+
}
|
|
761
|
+
if (additionalOptions.numInstances) {
|
|
762
|
+
body.numInstances = additionalOptions.numInstances;
|
|
763
|
+
}
|
|
764
|
+
if (additionalOptions.plan) {
|
|
765
|
+
body.plan = additionalOptions.plan;
|
|
766
|
+
}
|
|
767
|
+
if (additionalOptions.region) {
|
|
768
|
+
body.region = additionalOptions.region;
|
|
769
|
+
}
|
|
770
|
+
if (additionalOptions.rootDir) {
|
|
771
|
+
body.rootDir = additionalOptions.rootDir;
|
|
772
|
+
}
|
|
773
|
+
if (additionalOptions.runtime) {
|
|
774
|
+
body.runtime = additionalOptions.runtime;
|
|
775
|
+
}
|
|
776
|
+
if (additionalOptions.startCommand) {
|
|
777
|
+
body.startCommand = additionalOptions.startCommand;
|
|
778
|
+
}
|
|
779
|
+
responseData = (await GenericFunctions_1.renderCloudApiRequest.call(this, 'POST', '/services', body));
|
|
780
|
+
}
|
|
781
|
+
else if (operation === 'update') {
|
|
782
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
783
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
784
|
+
const updateFields = this.getNodeParameter('updateFields', i);
|
|
785
|
+
const body = {};
|
|
786
|
+
if (updateFields.name) {
|
|
787
|
+
body.name = updateFields.name;
|
|
788
|
+
}
|
|
789
|
+
if (updateFields.autoDeploy) {
|
|
790
|
+
body.autoDeploy = updateFields.autoDeploy;
|
|
791
|
+
}
|
|
792
|
+
if (updateFields.branch) {
|
|
793
|
+
body.branch = updateFields.branch;
|
|
794
|
+
}
|
|
795
|
+
if (updateFields.buildCommand) {
|
|
796
|
+
body.buildCommand = updateFields.buildCommand;
|
|
797
|
+
}
|
|
798
|
+
if (updateFields.healthCheckPath) {
|
|
799
|
+
body.healthCheckPath = updateFields.healthCheckPath;
|
|
800
|
+
}
|
|
801
|
+
if (updateFields.startCommand) {
|
|
802
|
+
body.startCommand = updateFields.startCommand;
|
|
803
|
+
}
|
|
804
|
+
if (updateFields.image) {
|
|
805
|
+
body.image = { imagePath: updateFields.image };
|
|
806
|
+
}
|
|
807
|
+
responseData = (await GenericFunctions_1.renderCloudApiRequest.call(this, 'PATCH', `/services/${serviceId}`, body));
|
|
808
|
+
}
|
|
809
|
+
else if (operation === 'delete') {
|
|
810
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
811
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
812
|
+
await GenericFunctions_1.renderCloudApiRequest.call(this, 'DELETE', `/services/${serviceId}`);
|
|
813
|
+
responseData = { success: true, serviceId };
|
|
814
|
+
}
|
|
815
|
+
else if (operation === 'suspend') {
|
|
816
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
817
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
818
|
+
responseData = (await GenericFunctions_1.renderCloudApiRequest.call(this, 'POST', `/services/${serviceId}/suspend`));
|
|
819
|
+
}
|
|
820
|
+
else if (operation === 'resume') {
|
|
821
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
822
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
823
|
+
responseData = (await GenericFunctions_1.renderCloudApiRequest.call(this, 'POST', `/services/${serviceId}/resume`));
|
|
824
|
+
}
|
|
825
|
+
else if (operation === 'restart') {
|
|
826
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
827
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
828
|
+
await GenericFunctions_1.renderCloudApiRequest.call(this, 'POST', `/services/${serviceId}/restart`);
|
|
829
|
+
responseData = { success: true, serviceId };
|
|
830
|
+
}
|
|
831
|
+
else if (operation === 'scale') {
|
|
832
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
833
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
834
|
+
const numInstances = this.getNodeParameter('numInstances', i);
|
|
835
|
+
responseData = (await GenericFunctions_1.renderCloudApiRequest.call(this, 'POST', `/services/${serviceId}/scale`, { numInstances }));
|
|
836
|
+
}
|
|
837
|
+
else if (operation === 'updateAutoscaling') {
|
|
838
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
839
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
840
|
+
const enabled = this.getNodeParameter('autoscalingEnabled', i);
|
|
841
|
+
const min = this.getNodeParameter('minInstances', i);
|
|
842
|
+
const max = this.getNodeParameter('maxInstances', i);
|
|
843
|
+
const criteria = this.getNodeParameter('autoscalingCriteria', i);
|
|
844
|
+
const body = {
|
|
845
|
+
enabled,
|
|
846
|
+
min,
|
|
847
|
+
max,
|
|
848
|
+
criteria: {},
|
|
849
|
+
};
|
|
850
|
+
if (criteria.cpu) {
|
|
851
|
+
body.criteria.cpu = { enabled: true, percentage: criteria.cpu };
|
|
852
|
+
}
|
|
853
|
+
if (criteria.memory) {
|
|
854
|
+
body.criteria.memory = { enabled: true, percentage: criteria.memory };
|
|
855
|
+
}
|
|
856
|
+
responseData = (await GenericFunctions_1.renderCloudApiRequest.call(this, 'PUT', `/services/${serviceId}/autoscaling`, body));
|
|
857
|
+
}
|
|
858
|
+
else if (operation === 'deleteAutoscaling') {
|
|
859
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
860
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
861
|
+
await GenericFunctions_1.renderCloudApiRequest.call(this, 'DELETE', `/services/${serviceId}/autoscaling`);
|
|
862
|
+
responseData = { success: true, serviceId };
|
|
863
|
+
}
|
|
864
|
+
else if (operation === 'purgeCache') {
|
|
865
|
+
const serviceId = this.getNodeParameter('serviceId', i);
|
|
866
|
+
(0, GenericFunctions_1.validateServiceId)(serviceId);
|
|
867
|
+
await GenericFunctions_1.renderCloudApiRequest.call(this, 'POST', `/services/${serviceId}/cache/purge`);
|
|
868
|
+
responseData = { success: true, serviceId };
|
|
869
|
+
}
|
|
870
|
+
else {
|
|
871
|
+
throw new Error(`Unknown operation: ${operation}`);
|
|
872
|
+
}
|
|
873
|
+
return responseData;
|
|
874
|
+
}
|
|
875
|
+
//# sourceMappingURL=service.js.map
|