appwrite-cli 2.0.1 → 3.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/README.md +11 -6
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/assistant/chat.md +2 -0
- package/docs/examples/databases/create-collection.md +1 -0
- package/docs/examples/databases/create-string-attribute.md +1 -0
- package/docs/examples/databases/create.md +2 -1
- package/docs/examples/databases/list-attributes.md +2 -1
- package/docs/examples/databases/list-indexes.md +2 -1
- package/docs/examples/databases/update.md +2 -1
- package/docs/examples/functions/create-deployment.md +3 -2
- package/docs/examples/functions/create-execution.md +3 -0
- package/docs/examples/functions/create.md +12 -0
- package/docs/examples/functions/download-deployment.md +3 -0
- package/docs/examples/functions/update.md +9 -0
- package/docs/examples/health/get-pub-sub.md +1 -0
- package/docs/examples/health/get-queue.md +1 -0
- package/docs/examples/locale/list-codes.md +1 -0
- package/docs/examples/migrations/create-appwrite-migration.md +5 -0
- package/docs/examples/migrations/create-firebase-migration.md +3 -0
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +3 -0
- package/docs/examples/migrations/create-n-host-migration.md +9 -0
- package/docs/examples/migrations/create-supabase-migration.md +8 -0
- package/docs/examples/migrations/delete-firebase-auth.md +1 -0
- package/docs/examples/migrations/delete.md +2 -0
- package/docs/examples/migrations/get-appwrite-report.md +5 -0
- package/docs/examples/migrations/get-firebase-report-o-auth.md +3 -0
- package/docs/examples/migrations/get-firebase-report.md +3 -0
- package/docs/examples/migrations/get-n-host-report.md +9 -0
- package/docs/examples/migrations/get-supabase-report.md +8 -0
- package/docs/examples/migrations/get.md +2 -0
- package/docs/examples/migrations/list-firebase-projects.md +1 -0
- package/docs/examples/migrations/list.md +3 -0
- package/docs/examples/migrations/retry.md +2 -0
- package/docs/examples/project/create-variable.md +3 -0
- package/docs/examples/project/delete-variable.md +2 -0
- package/docs/examples/project/get-usage.md +2 -0
- package/docs/examples/project/get-variable.md +2 -0
- package/docs/examples/project/list-variables.md +1 -0
- package/docs/examples/project/update-variable.md +4 -0
- package/docs/examples/projects/create.md +1 -1
- package/docs/examples/projects/delete-email-template.md +4 -0
- package/docs/examples/projects/delete-sms-template.md +4 -0
- package/docs/examples/projects/delete.md +1 -2
- package/docs/examples/projects/get-email-template.md +4 -0
- package/docs/examples/projects/get-sms-template.md +4 -0
- package/docs/examples/projects/update-email-template.md +9 -0
- package/docs/examples/projects/update-personal-data-check.md +3 -0
- package/docs/examples/projects/update-service-status-all.md +3 -0
- package/docs/examples/projects/update-sms-template.md +5 -0
- package/docs/examples/projects/update-smtp-configuration.md +11 -0
- package/docs/examples/projects/update-team.md +3 -0
- package/docs/examples/proxy/create-rule.md +4 -0
- package/docs/examples/proxy/delete-rule.md +2 -0
- package/docs/examples/proxy/get-rule.md +2 -0
- package/docs/examples/proxy/list-rules.md +3 -0
- package/docs/examples/proxy/update-rule-verification.md +2 -0
- package/docs/examples/storage/update-file.md +1 -0
- package/docs/examples/teams/{update-membership-roles.md → update-membership.md} +1 -1
- package/docs/examples/users/delete-identity.md +2 -0
- package/docs/examples/users/list-identities.md +3 -0
- package/docs/examples/users/update-labels.md +3 -0
- package/docs/examples/vcs/create-repository-detection.md +4 -0
- package/docs/examples/vcs/create-repository.md +4 -0
- package/docs/examples/vcs/delete-installation.md +2 -0
- package/docs/examples/vcs/get-installation.md +2 -0
- package/docs/examples/vcs/get-repository.md +3 -0
- package/docs/examples/vcs/list-installations.md +3 -0
- package/docs/examples/vcs/list-repositories.md +3 -0
- package/docs/examples/vcs/list-repository-branches.md +3 -0
- package/docs/examples/vcs/update-external-deployments.md +4 -0
- package/index.js +10 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +3 -3
- package/lib/commands/account.js +122 -67
- package/lib/commands/assistant.js +53 -0
- package/lib/commands/avatars.js +21 -21
- package/lib/commands/console.js +2 -2
- package/lib/commands/databases.js +146 -104
- package/lib/commands/functions.js +277 -70
- package/lib/commands/generic.js +1 -0
- package/lib/commands/graphql.js +4 -4
- package/lib/commands/health.js +68 -22
- package/lib/commands/locale.js +37 -14
- package/lib/commands/migrations.js +708 -0
- package/lib/commands/project.js +204 -0
- package/lib/commands/projects.js +459 -196
- package/lib/commands/proxy.js +177 -0
- package/lib/commands/storage.js +47 -40
- package/lib/commands/teams.js +33 -33
- package/lib/commands/users.js +147 -52
- package/lib/commands/vcs.js +305 -0
- package/lib/config.js +1 -2
- package/lib/parser.js +2 -2
- package/package.json +1 -1
- package/scoop/appwrite.json +30 -0
- package/docs/examples/projects/create-domain.md +0 -3
- package/docs/examples/projects/delete-domain.md +0 -3
- package/docs/examples/projects/get-domain.md +0 -3
- package/docs/examples/projects/list-domains.md +0 -2
- package/docs/examples/projects/update-domain-verification.md +0 -3
|
@@ -19,7 +19,7 @@ const functionsList = async ({ queries, search, parseOutput = true, sdk = undefi
|
|
|
19
19
|
/* @param {string} search */
|
|
20
20
|
|
|
21
21
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
22
|
-
let
|
|
22
|
+
let apiPath = '/functions';
|
|
23
23
|
let payload = {};
|
|
24
24
|
|
|
25
25
|
/** Query Params */
|
|
@@ -30,7 +30,7 @@ const functionsList = async ({ queries, search, parseOutput = true, sdk = undefi
|
|
|
30
30
|
payload['search'] = search;
|
|
31
31
|
}
|
|
32
32
|
let response = undefined;
|
|
33
|
-
response = await client.call('get',
|
|
33
|
+
response = await client.call('get', apiPath, {
|
|
34
34
|
'content-type': 'application/json',
|
|
35
35
|
}, payload);
|
|
36
36
|
|
|
@@ -41,7 +41,7 @@ const functionsList = async ({ queries, search, parseOutput = true, sdk = undefi
|
|
|
41
41
|
return response;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const functionsCreate = async ({ functionId, name, runtime, execute, events, schedule, timeout, enabled, parseOutput = true, sdk = undefined}) => {
|
|
44
|
+
const functionsCreate = async ({ functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateBranch, parseOutput = true, sdk = undefined}) => {
|
|
45
45
|
/* @param {string} functionId */
|
|
46
46
|
/* @param {string} name */
|
|
47
47
|
/* @param {string} runtime */
|
|
@@ -50,9 +50,21 @@ const functionsCreate = async ({ functionId, name, runtime, execute, events, sch
|
|
|
50
50
|
/* @param {string} schedule */
|
|
51
51
|
/* @param {number} timeout */
|
|
52
52
|
/* @param {boolean} enabled */
|
|
53
|
+
/* @param {boolean} logging */
|
|
54
|
+
/* @param {string} entrypoint */
|
|
55
|
+
/* @param {string} commands */
|
|
56
|
+
/* @param {string} installationId */
|
|
57
|
+
/* @param {string} providerRepositoryId */
|
|
58
|
+
/* @param {string} providerBranch */
|
|
59
|
+
/* @param {boolean} providerSilentMode */
|
|
60
|
+
/* @param {string} providerRootDirectory */
|
|
61
|
+
/* @param {string} templateRepository */
|
|
62
|
+
/* @param {string} templateOwner */
|
|
63
|
+
/* @param {string} templateRootDirectory */
|
|
64
|
+
/* @param {string} templateBranch */
|
|
53
65
|
|
|
54
66
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
55
|
-
let
|
|
67
|
+
let apiPath = '/functions';
|
|
56
68
|
let payload = {};
|
|
57
69
|
|
|
58
70
|
/** Body Params */
|
|
@@ -66,15 +78,15 @@ const functionsCreate = async ({ functionId, name, runtime, execute, events, sch
|
|
|
66
78
|
payload['name'] = name;
|
|
67
79
|
}
|
|
68
80
|
|
|
69
|
-
execute = execute === true ? [] : execute;
|
|
70
81
|
|
|
71
|
-
if (typeof
|
|
72
|
-
payload['
|
|
82
|
+
if (typeof runtime !== 'undefined') {
|
|
83
|
+
payload['runtime'] = runtime;
|
|
73
84
|
}
|
|
74
85
|
|
|
86
|
+
execute = execute === true ? [] : execute;
|
|
75
87
|
|
|
76
|
-
if (typeof
|
|
77
|
-
payload['
|
|
88
|
+
if (typeof execute !== 'undefined') {
|
|
89
|
+
payload['execute'] = execute;
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
events = events === true ? [] : events;
|
|
@@ -98,8 +110,68 @@ const functionsCreate = async ({ functionId, name, runtime, execute, events, sch
|
|
|
98
110
|
payload['enabled'] = enabled;
|
|
99
111
|
}
|
|
100
112
|
|
|
113
|
+
|
|
114
|
+
if (typeof logging !== 'undefined') {
|
|
115
|
+
payload['logging'] = logging;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
if (typeof entrypoint !== 'undefined') {
|
|
120
|
+
payload['entrypoint'] = entrypoint;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
if (typeof commands !== 'undefined') {
|
|
125
|
+
payload['commands'] = commands;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if (typeof installationId !== 'undefined') {
|
|
130
|
+
payload['installationId'] = installationId;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
|
135
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
if (typeof providerBranch !== 'undefined') {
|
|
140
|
+
payload['providerBranch'] = providerBranch;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
if (typeof providerSilentMode !== 'undefined') {
|
|
145
|
+
payload['providerSilentMode'] = providerSilentMode;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
|
150
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
if (typeof templateRepository !== 'undefined') {
|
|
155
|
+
payload['templateRepository'] = templateRepository;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
if (typeof templateOwner !== 'undefined') {
|
|
160
|
+
payload['templateOwner'] = templateOwner;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
if (typeof templateRootDirectory !== 'undefined') {
|
|
165
|
+
payload['templateRootDirectory'] = templateRootDirectory;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
if (typeof templateBranch !== 'undefined') {
|
|
170
|
+
payload['templateBranch'] = templateBranch;
|
|
171
|
+
}
|
|
172
|
+
|
|
101
173
|
let response = undefined;
|
|
102
|
-
response = await client.call('post',
|
|
174
|
+
response = await client.call('post', apiPath, {
|
|
103
175
|
'content-type': 'application/json',
|
|
104
176
|
}, payload);
|
|
105
177
|
|
|
@@ -113,10 +185,10 @@ const functionsCreate = async ({ functionId, name, runtime, execute, events, sch
|
|
|
113
185
|
const functionsListRuntimes = async ({ parseOutput = true, sdk = undefined}) => {
|
|
114
186
|
|
|
115
187
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
116
|
-
let
|
|
188
|
+
let apiPath = '/functions/runtimes';
|
|
117
189
|
let payload = {};
|
|
118
190
|
let response = undefined;
|
|
119
|
-
response = await client.call('get',
|
|
191
|
+
response = await client.call('get', apiPath, {
|
|
120
192
|
'content-type': 'application/json',
|
|
121
193
|
}, payload);
|
|
122
194
|
|
|
@@ -131,7 +203,7 @@ const functionsGetUsage = async ({ range, parseOutput = true, sdk = undefined})
|
|
|
131
203
|
/* @param {string} range */
|
|
132
204
|
|
|
133
205
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
134
|
-
let
|
|
206
|
+
let apiPath = '/functions/usage';
|
|
135
207
|
let payload = {};
|
|
136
208
|
|
|
137
209
|
/** Query Params */
|
|
@@ -139,7 +211,7 @@ const functionsGetUsage = async ({ range, parseOutput = true, sdk = undefined})
|
|
|
139
211
|
payload['range'] = range;
|
|
140
212
|
}
|
|
141
213
|
let response = undefined;
|
|
142
|
-
response = await client.call('get',
|
|
214
|
+
response = await client.call('get', apiPath, {
|
|
143
215
|
'content-type': 'application/json',
|
|
144
216
|
}, payload);
|
|
145
217
|
|
|
@@ -154,10 +226,10 @@ const functionsGet = async ({ functionId, parseOutput = true, sdk = undefined})
|
|
|
154
226
|
/* @param {string} functionId */
|
|
155
227
|
|
|
156
228
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
157
|
-
let
|
|
229
|
+
let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
|
158
230
|
let payload = {};
|
|
159
231
|
let response = undefined;
|
|
160
|
-
response = await client.call('get',
|
|
232
|
+
response = await client.call('get', apiPath, {
|
|
161
233
|
'content-type': 'application/json',
|
|
162
234
|
}, payload);
|
|
163
235
|
|
|
@@ -168,17 +240,26 @@ const functionsGet = async ({ functionId, parseOutput = true, sdk = undefined})
|
|
|
168
240
|
return response;
|
|
169
241
|
}
|
|
170
242
|
|
|
171
|
-
const functionsUpdate = async ({ functionId, name, execute, events, schedule, timeout, enabled, parseOutput = true, sdk = undefined}) => {
|
|
243
|
+
const functionsUpdate = async ({ functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, parseOutput = true, sdk = undefined}) => {
|
|
172
244
|
/* @param {string} functionId */
|
|
173
245
|
/* @param {string} name */
|
|
246
|
+
/* @param {string} runtime */
|
|
174
247
|
/* @param {string[]} execute */
|
|
175
248
|
/* @param {string[]} events */
|
|
176
249
|
/* @param {string} schedule */
|
|
177
250
|
/* @param {number} timeout */
|
|
178
251
|
/* @param {boolean} enabled */
|
|
252
|
+
/* @param {boolean} logging */
|
|
253
|
+
/* @param {string} entrypoint */
|
|
254
|
+
/* @param {string} commands */
|
|
255
|
+
/* @param {string} installationId */
|
|
256
|
+
/* @param {string} providerRepositoryId */
|
|
257
|
+
/* @param {string} providerBranch */
|
|
258
|
+
/* @param {boolean} providerSilentMode */
|
|
259
|
+
/* @param {string} providerRootDirectory */
|
|
179
260
|
|
|
180
261
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
181
|
-
let
|
|
262
|
+
let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
|
182
263
|
let payload = {};
|
|
183
264
|
|
|
184
265
|
/** Body Params */
|
|
@@ -187,6 +268,11 @@ const functionsUpdate = async ({ functionId, name, execute, events, schedule, ti
|
|
|
187
268
|
payload['name'] = name;
|
|
188
269
|
}
|
|
189
270
|
|
|
271
|
+
|
|
272
|
+
if (typeof runtime !== 'undefined') {
|
|
273
|
+
payload['runtime'] = runtime;
|
|
274
|
+
}
|
|
275
|
+
|
|
190
276
|
execute = execute === true ? [] : execute;
|
|
191
277
|
|
|
192
278
|
if (typeof execute !== 'undefined') {
|
|
@@ -214,8 +300,48 @@ const functionsUpdate = async ({ functionId, name, execute, events, schedule, ti
|
|
|
214
300
|
payload['enabled'] = enabled;
|
|
215
301
|
}
|
|
216
302
|
|
|
303
|
+
|
|
304
|
+
if (typeof logging !== 'undefined') {
|
|
305
|
+
payload['logging'] = logging;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
if (typeof entrypoint !== 'undefined') {
|
|
310
|
+
payload['entrypoint'] = entrypoint;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
if (typeof commands !== 'undefined') {
|
|
315
|
+
payload['commands'] = commands;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
if (typeof installationId !== 'undefined') {
|
|
320
|
+
payload['installationId'] = installationId;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
|
325
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
if (typeof providerBranch !== 'undefined') {
|
|
330
|
+
payload['providerBranch'] = providerBranch;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
if (typeof providerSilentMode !== 'undefined') {
|
|
335
|
+
payload['providerSilentMode'] = providerSilentMode;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
|
340
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
|
341
|
+
}
|
|
342
|
+
|
|
217
343
|
let response = undefined;
|
|
218
|
-
response = await client.call('put',
|
|
344
|
+
response = await client.call('put', apiPath, {
|
|
219
345
|
'content-type': 'application/json',
|
|
220
346
|
}, payload);
|
|
221
347
|
|
|
@@ -230,10 +356,10 @@ const functionsDelete = async ({ functionId, parseOutput = true, sdk = undefined
|
|
|
230
356
|
/* @param {string} functionId */
|
|
231
357
|
|
|
232
358
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
233
|
-
let
|
|
359
|
+
let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
|
234
360
|
let payload = {};
|
|
235
361
|
let response = undefined;
|
|
236
|
-
response = await client.call('delete',
|
|
362
|
+
response = await client.call('delete', apiPath, {
|
|
237
363
|
'content-type': 'application/json',
|
|
238
364
|
}, payload);
|
|
239
365
|
|
|
@@ -250,7 +376,7 @@ const functionsListDeployments = async ({ functionId, queries, search, parseOutp
|
|
|
250
376
|
/* @param {string} search */
|
|
251
377
|
|
|
252
378
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
253
|
-
let
|
|
379
|
+
let apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
|
|
254
380
|
let payload = {};
|
|
255
381
|
|
|
256
382
|
/** Query Params */
|
|
@@ -261,7 +387,7 @@ const functionsListDeployments = async ({ functionId, queries, search, parseOutp
|
|
|
261
387
|
payload['search'] = search;
|
|
262
388
|
}
|
|
263
389
|
let response = undefined;
|
|
264
|
-
response = await client.call('get',
|
|
390
|
+
response = await client.call('get', apiPath, {
|
|
265
391
|
'content-type': 'application/json',
|
|
266
392
|
}, payload);
|
|
267
393
|
|
|
@@ -272,14 +398,15 @@ const functionsListDeployments = async ({ functionId, queries, search, parseOutp
|
|
|
272
398
|
return response;
|
|
273
399
|
}
|
|
274
400
|
|
|
275
|
-
const functionsCreateDeployment = async ({ functionId,
|
|
401
|
+
const functionsCreateDeployment = async ({ functionId, code, activate, entrypoint, commands, parseOutput = true, sdk = undefined, onProgress = () => {}}) => {
|
|
276
402
|
/* @param {string} functionId */
|
|
277
|
-
/* @param {string} entrypoint */
|
|
278
403
|
/* @param {InputFile} code */
|
|
279
404
|
/* @param {boolean} activate */
|
|
405
|
+
/* @param {string} entrypoint */
|
|
406
|
+
/* @param {string} commands */
|
|
280
407
|
|
|
281
408
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
282
|
-
let
|
|
409
|
+
let apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
|
|
283
410
|
let payload = {};
|
|
284
411
|
|
|
285
412
|
/** Body Params */
|
|
@@ -288,6 +415,11 @@ const functionsCreateDeployment = async ({ functionId, entrypoint, code, activat
|
|
|
288
415
|
payload['entrypoint'] = entrypoint;
|
|
289
416
|
}
|
|
290
417
|
|
|
418
|
+
|
|
419
|
+
if (typeof commands !== 'undefined') {
|
|
420
|
+
payload['commands'] = commands;
|
|
421
|
+
}
|
|
422
|
+
|
|
291
423
|
let folderPath = fs.realpathSync(code);
|
|
292
424
|
if (!fs.lstatSync(folderPath).isDirectory())
|
|
293
425
|
throw new Error('The path is not a directory.');
|
|
@@ -330,7 +462,7 @@ const functionsCreateDeployment = async ({ functionId, entrypoint, code, activat
|
|
|
330
462
|
if (size <= libClient.CHUNK_SIZE) {
|
|
331
463
|
payload['code'] = fs.createReadStream(payload['code']);
|
|
332
464
|
|
|
333
|
-
response = await client.call('post',
|
|
465
|
+
response = await client.call('post', apiPath, {
|
|
334
466
|
'content-type': 'multipart/form-data',
|
|
335
467
|
}, payload).catch(err => {
|
|
336
468
|
fs.unlinkSync(archivePath);
|
|
@@ -364,7 +496,7 @@ const functionsCreateDeployment = async ({ functionId, entrypoint, code, activat
|
|
|
364
496
|
});
|
|
365
497
|
payload['code'] = stream;
|
|
366
498
|
|
|
367
|
-
response = await client.call('post',
|
|
499
|
+
response = await client.call('post', apiPath, headers, payload);
|
|
368
500
|
|
|
369
501
|
if (!id) {
|
|
370
502
|
id = response['$id'];
|
|
@@ -396,10 +528,10 @@ const functionsGetDeployment = async ({ functionId, deploymentId, parseOutput =
|
|
|
396
528
|
/* @param {string} deploymentId */
|
|
397
529
|
|
|
398
530
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
399
|
-
let
|
|
531
|
+
let apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
400
532
|
let payload = {};
|
|
401
533
|
let response = undefined;
|
|
402
|
-
response = await client.call('get',
|
|
534
|
+
response = await client.call('get', apiPath, {
|
|
403
535
|
'content-type': 'application/json',
|
|
404
536
|
}, payload);
|
|
405
537
|
|
|
@@ -415,10 +547,10 @@ const functionsUpdateDeployment = async ({ functionId, deploymentId, parseOutput
|
|
|
415
547
|
/* @param {string} deploymentId */
|
|
416
548
|
|
|
417
549
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
418
|
-
let
|
|
550
|
+
let apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
419
551
|
let payload = {};
|
|
420
552
|
let response = undefined;
|
|
421
|
-
response = await client.call('patch',
|
|
553
|
+
response = await client.call('patch', apiPath, {
|
|
422
554
|
'content-type': 'application/json',
|
|
423
555
|
}, payload);
|
|
424
556
|
|
|
@@ -434,10 +566,10 @@ const functionsDeleteDeployment = async ({ functionId, deploymentId, parseOutput
|
|
|
434
566
|
/* @param {string} deploymentId */
|
|
435
567
|
|
|
436
568
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
437
|
-
let
|
|
569
|
+
let apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
438
570
|
let payload = {};
|
|
439
571
|
let response = undefined;
|
|
440
|
-
response = await client.call('delete',
|
|
572
|
+
response = await client.call('delete', apiPath, {
|
|
441
573
|
'content-type': 'application/json',
|
|
442
574
|
}, payload);
|
|
443
575
|
|
|
@@ -454,10 +586,10 @@ const functionsCreateBuild = async ({ functionId, deploymentId, buildId, parseOu
|
|
|
454
586
|
/* @param {string} buildId */
|
|
455
587
|
|
|
456
588
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
457
|
-
let
|
|
589
|
+
let apiPath = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId).replace('{buildId}', buildId);
|
|
458
590
|
let payload = {};
|
|
459
591
|
let response = undefined;
|
|
460
|
-
response = await client.call('post',
|
|
592
|
+
response = await client.call('post', apiPath, {
|
|
461
593
|
'content-type': 'application/json',
|
|
462
594
|
}, payload);
|
|
463
595
|
|
|
@@ -468,13 +600,37 @@ const functionsCreateBuild = async ({ functionId, deploymentId, buildId, parseOu
|
|
|
468
600
|
return response;
|
|
469
601
|
}
|
|
470
602
|
|
|
603
|
+
const functionsDownloadDeployment = async ({ functionId, deploymentId, parseOutput = true, sdk = undefined, destination}) => {
|
|
604
|
+
/* @param {string} functionId */
|
|
605
|
+
/* @param {string} deploymentId */
|
|
606
|
+
|
|
607
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
608
|
+
let apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
609
|
+
let payload = {};
|
|
610
|
+
payload['project'] = localConfig.getProject().projectId
|
|
611
|
+
payload['key'] = globalConfig.getKey();
|
|
612
|
+
const queryParams = new URLSearchParams(payload);
|
|
613
|
+
apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
|
|
614
|
+
|
|
615
|
+
const response = await client.call('get', apiPath, {
|
|
616
|
+
'content-type': 'application/json',
|
|
617
|
+
}, payload, 'arraybuffer');
|
|
618
|
+
|
|
619
|
+
fs.writeFileSync(destination, response);
|
|
620
|
+
|
|
621
|
+
if (parseOutput) {
|
|
622
|
+
log(`File stored in ${destination}`)
|
|
623
|
+
success()
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
471
627
|
const functionsListExecutions = async ({ functionId, queries, search, parseOutput = true, sdk = undefined}) => {
|
|
472
628
|
/* @param {string} functionId */
|
|
473
629
|
/* @param {string[]} queries */
|
|
474
630
|
/* @param {string} search */
|
|
475
631
|
|
|
476
632
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
477
|
-
let
|
|
633
|
+
let apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
|
|
478
634
|
let payload = {};
|
|
479
635
|
|
|
480
636
|
/** Query Params */
|
|
@@ -485,7 +641,7 @@ const functionsListExecutions = async ({ functionId, queries, search, parseOutpu
|
|
|
485
641
|
payload['search'] = search;
|
|
486
642
|
}
|
|
487
643
|
let response = undefined;
|
|
488
|
-
response = await client.call('get',
|
|
644
|
+
response = await client.call('get', apiPath, {
|
|
489
645
|
'content-type': 'application/json',
|
|
490
646
|
}, payload);
|
|
491
647
|
|
|
@@ -496,19 +652,22 @@ const functionsListExecutions = async ({ functionId, queries, search, parseOutpu
|
|
|
496
652
|
return response;
|
|
497
653
|
}
|
|
498
654
|
|
|
499
|
-
const functionsCreateExecution = async ({ functionId,
|
|
655
|
+
const functionsCreateExecution = async ({ functionId, body, async, xpath, method, headers, parseOutput = true, sdk = undefined}) => {
|
|
500
656
|
/* @param {string} functionId */
|
|
501
|
-
/* @param {string}
|
|
657
|
+
/* @param {string} body */
|
|
502
658
|
/* @param {boolean} async */
|
|
659
|
+
/* @param {string} xpath */
|
|
660
|
+
/* @param {string} method */
|
|
661
|
+
/* @param {object} headers */
|
|
503
662
|
|
|
504
663
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
505
|
-
let
|
|
664
|
+
let apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
|
|
506
665
|
let payload = {};
|
|
507
666
|
|
|
508
667
|
/** Body Params */
|
|
509
668
|
|
|
510
|
-
if (typeof
|
|
511
|
-
payload['
|
|
669
|
+
if (typeof body !== 'undefined') {
|
|
670
|
+
payload['body'] = body;
|
|
512
671
|
}
|
|
513
672
|
|
|
514
673
|
|
|
@@ -516,8 +675,22 @@ const functionsCreateExecution = async ({ functionId, data, async, parseOutput =
|
|
|
516
675
|
payload['async'] = async;
|
|
517
676
|
}
|
|
518
677
|
|
|
678
|
+
|
|
679
|
+
if (typeof xpath !== 'undefined') {
|
|
680
|
+
payload['path'] = xpath;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
if (typeof method !== 'undefined') {
|
|
685
|
+
payload['method'] = method;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if (typeof headers !== 'undefined') {
|
|
689
|
+
payload['headers'] = JSON.parse(headers);
|
|
690
|
+
}
|
|
691
|
+
|
|
519
692
|
let response = undefined;
|
|
520
|
-
response = await client.call('post',
|
|
693
|
+
response = await client.call('post', apiPath, {
|
|
521
694
|
'content-type': 'application/json',
|
|
522
695
|
}, payload);
|
|
523
696
|
|
|
@@ -533,10 +706,10 @@ const functionsGetExecution = async ({ functionId, executionId, parseOutput = tr
|
|
|
533
706
|
/* @param {string} executionId */
|
|
534
707
|
|
|
535
708
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
536
|
-
let
|
|
709
|
+
let apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
|
537
710
|
let payload = {};
|
|
538
711
|
let response = undefined;
|
|
539
|
-
response = await client.call('get',
|
|
712
|
+
response = await client.call('get', apiPath, {
|
|
540
713
|
'content-type': 'application/json',
|
|
541
714
|
}, payload);
|
|
542
715
|
|
|
@@ -552,7 +725,7 @@ const functionsGetFunctionUsage = async ({ functionId, range, parseOutput = true
|
|
|
552
725
|
/* @param {string} range */
|
|
553
726
|
|
|
554
727
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
555
|
-
let
|
|
728
|
+
let apiPath = '/functions/{functionId}/usage'.replace('{functionId}', functionId);
|
|
556
729
|
let payload = {};
|
|
557
730
|
|
|
558
731
|
/** Query Params */
|
|
@@ -560,7 +733,7 @@ const functionsGetFunctionUsage = async ({ functionId, range, parseOutput = true
|
|
|
560
733
|
payload['range'] = range;
|
|
561
734
|
}
|
|
562
735
|
let response = undefined;
|
|
563
|
-
response = await client.call('get',
|
|
736
|
+
response = await client.call('get', apiPath, {
|
|
564
737
|
'content-type': 'application/json',
|
|
565
738
|
}, payload);
|
|
566
739
|
|
|
@@ -575,10 +748,10 @@ const functionsListVariables = async ({ functionId, parseOutput = true, sdk = un
|
|
|
575
748
|
/* @param {string} functionId */
|
|
576
749
|
|
|
577
750
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
578
|
-
let
|
|
751
|
+
let apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
|
|
579
752
|
let payload = {};
|
|
580
753
|
let response = undefined;
|
|
581
|
-
response = await client.call('get',
|
|
754
|
+
response = await client.call('get', apiPath, {
|
|
582
755
|
'content-type': 'application/json',
|
|
583
756
|
}, payload);
|
|
584
757
|
|
|
@@ -595,7 +768,7 @@ const functionsCreateVariable = async ({ functionId, key, value, parseOutput = t
|
|
|
595
768
|
/* @param {string} value */
|
|
596
769
|
|
|
597
770
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
598
|
-
let
|
|
771
|
+
let apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
|
|
599
772
|
let payload = {};
|
|
600
773
|
|
|
601
774
|
/** Body Params */
|
|
@@ -610,7 +783,7 @@ const functionsCreateVariable = async ({ functionId, key, value, parseOutput = t
|
|
|
610
783
|
}
|
|
611
784
|
|
|
612
785
|
let response = undefined;
|
|
613
|
-
response = await client.call('post',
|
|
786
|
+
response = await client.call('post', apiPath, {
|
|
614
787
|
'content-type': 'application/json',
|
|
615
788
|
}, payload);
|
|
616
789
|
|
|
@@ -626,10 +799,10 @@ const functionsGetVariable = async ({ functionId, variableId, parseOutput = true
|
|
|
626
799
|
/* @param {string} variableId */
|
|
627
800
|
|
|
628
801
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
629
|
-
let
|
|
802
|
+
let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
630
803
|
let payload = {};
|
|
631
804
|
let response = undefined;
|
|
632
|
-
response = await client.call('get',
|
|
805
|
+
response = await client.call('get', apiPath, {
|
|
633
806
|
'content-type': 'application/json',
|
|
634
807
|
}, payload);
|
|
635
808
|
|
|
@@ -647,7 +820,7 @@ const functionsUpdateVariable = async ({ functionId, variableId, key, value, par
|
|
|
647
820
|
/* @param {string} value */
|
|
648
821
|
|
|
649
822
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
650
|
-
let
|
|
823
|
+
let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
651
824
|
let payload = {};
|
|
652
825
|
|
|
653
826
|
/** Body Params */
|
|
@@ -662,7 +835,7 @@ const functionsUpdateVariable = async ({ functionId, variableId, key, value, par
|
|
|
662
835
|
}
|
|
663
836
|
|
|
664
837
|
let response = undefined;
|
|
665
|
-
response = await client.call('put',
|
|
838
|
+
response = await client.call('put', apiPath, {
|
|
666
839
|
'content-type': 'application/json',
|
|
667
840
|
}, payload);
|
|
668
841
|
|
|
@@ -678,10 +851,10 @@ const functionsDeleteVariable = async ({ functionId, variableId, parseOutput = t
|
|
|
678
851
|
/* @param {string} variableId */
|
|
679
852
|
|
|
680
853
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
681
|
-
let
|
|
854
|
+
let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
682
855
|
let payload = {};
|
|
683
856
|
let response = undefined;
|
|
684
|
-
response = await client.call('delete',
|
|
857
|
+
response = await client.call('delete', apiPath, {
|
|
685
858
|
'content-type': 'application/json',
|
|
686
859
|
}, payload);
|
|
687
860
|
|
|
@@ -696,7 +869,7 @@ const functionsDeleteVariable = async ({ functionId, variableId, parseOutput = t
|
|
|
696
869
|
functions
|
|
697
870
|
.command(`list`)
|
|
698
871
|
.description(`Get a list of all the project's functions. You can use the query params to filter your results.`)
|
|
699
|
-
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout`)
|
|
872
|
+
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId`)
|
|
700
873
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
701
874
|
.action(actionRunner(functionsList))
|
|
702
875
|
|
|
@@ -706,11 +879,23 @@ functions
|
|
|
706
879
|
.requiredOption(`--functionId <functionId>`, `Function ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
707
880
|
.requiredOption(`--name <name>`, `Function name. Max length: 128 chars.`)
|
|
708
881
|
.requiredOption(`--runtime <runtime>`, `Execution runtime.`)
|
|
709
|
-
.option(`--execute [execute...]`, `An array of strings with execution
|
|
882
|
+
.option(`--execute [execute...]`, `An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.`)
|
|
710
883
|
.option(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
|
|
711
884
|
.option(`--schedule <schedule>`, `Schedule CRON syntax.`)
|
|
712
885
|
.option(`--timeout <timeout>`, `Function maximum execution time in seconds.`, parseInteger)
|
|
713
|
-
.option(`--enabled <enabled>`, `Is function enabled
|
|
886
|
+
.option(`--enabled <enabled>`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, parseBool)
|
|
887
|
+
.option(`--logging <logging>`, `Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.`, parseBool)
|
|
888
|
+
.option(`--entrypoint <entrypoint>`, `Entrypoint File. This path is relative to the "providerRootDirectory".`)
|
|
889
|
+
.option(`--commands <commands>`, `Build Commands.`)
|
|
890
|
+
.option(`--installationId <installationId>`, `Appwrite Installation ID for VCS (Version Control System) deployment.`)
|
|
891
|
+
.option(`--providerRepositoryId <providerRepositoryId>`, `Repository ID of the repo linked to the function.`)
|
|
892
|
+
.option(`--providerBranch <providerBranch>`, `Production branch for the repo linked to the function.`)
|
|
893
|
+
.option(`--providerSilentMode <providerSilentMode>`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, parseBool)
|
|
894
|
+
.option(`--providerRootDirectory <providerRootDirectory>`, `Path to function code in the linked repo.`)
|
|
895
|
+
.option(`--templateRepository <templateRepository>`, `Repository name of the template.`)
|
|
896
|
+
.option(`--templateOwner <templateOwner>`, `The name of the owner of the template.`)
|
|
897
|
+
.option(`--templateRootDirectory <templateRootDirectory>`, `Path to function code in the template repo.`)
|
|
898
|
+
.option(`--templateBranch <templateBranch>`, `Production branch for the repo linked to the function template.`)
|
|
714
899
|
.action(actionRunner(functionsCreate))
|
|
715
900
|
|
|
716
901
|
functions
|
|
@@ -735,11 +920,20 @@ functions
|
|
|
735
920
|
.description(`Update function by its unique ID.`)
|
|
736
921
|
.requiredOption(`--functionId <functionId>`, `Function ID.`)
|
|
737
922
|
.requiredOption(`--name <name>`, `Function name. Max length: 128 chars.`)
|
|
738
|
-
.
|
|
923
|
+
.requiredOption(`--runtime <runtime>`, `Execution runtime.`)
|
|
924
|
+
.option(`--execute [execute...]`, `An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.`)
|
|
739
925
|
.option(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
|
|
740
926
|
.option(`--schedule <schedule>`, `Schedule CRON syntax.`)
|
|
741
927
|
.option(`--timeout <timeout>`, `Maximum execution time in seconds.`, parseInteger)
|
|
742
|
-
.option(`--enabled <enabled>`, `Is function enabled
|
|
928
|
+
.option(`--enabled <enabled>`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, parseBool)
|
|
929
|
+
.option(`--logging <logging>`, `Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.`, parseBool)
|
|
930
|
+
.option(`--entrypoint <entrypoint>`, `Entrypoint File. This path is relative to the "providerRootDirectory".`)
|
|
931
|
+
.option(`--commands <commands>`, `Build Commands.`)
|
|
932
|
+
.option(`--installationId <installationId>`, `Appwrite Installation ID for VCS (Version Controle System) deployment.`)
|
|
933
|
+
.option(`--providerRepositoryId <providerRepositoryId>`, `Repository ID of the repo linked to the function`)
|
|
934
|
+
.option(`--providerBranch <providerBranch>`, `Production branch for the repo linked to the function`)
|
|
935
|
+
.option(`--providerSilentMode <providerSilentMode>`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, parseBool)
|
|
936
|
+
.option(`--providerRootDirectory <providerRootDirectory>`, `Path to function code in the linked repo.`)
|
|
743
937
|
.action(actionRunner(functionsUpdate))
|
|
744
938
|
|
|
745
939
|
functions
|
|
@@ -752,17 +946,18 @@ functions
|
|
|
752
946
|
.command(`listDeployments`)
|
|
753
947
|
.description(`Get a list of all the project's code deployments. You can use the query params to filter your results.`)
|
|
754
948
|
.requiredOption(`--functionId <functionId>`, `Function ID.`)
|
|
755
|
-
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes:
|
|
949
|
+
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: size, buildId, activate, entrypoint, commands`)
|
|
756
950
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
757
951
|
.action(actionRunner(functionsListDeployments))
|
|
758
952
|
|
|
759
953
|
functions
|
|
760
954
|
.command(`createDeployment`)
|
|
761
|
-
.description(`Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](/docs/functions). Use the "command" param to set the
|
|
955
|
+
.description(`Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](/docs/functions). Use the "command" param to set the entrypoint used to execute your code.`)
|
|
762
956
|
.requiredOption(`--functionId <functionId>`, `Function ID.`)
|
|
763
|
-
.requiredOption(`--entrypoint <entrypoint>`, `Entrypoint File.`)
|
|
764
957
|
.requiredOption(`--code <code>`, `Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.`)
|
|
765
958
|
.requiredOption(`--activate <activate>`, `Automatically activate the deployment when it is finished building.`, parseBool)
|
|
959
|
+
.option(`--entrypoint <entrypoint>`, `Entrypoint File.`)
|
|
960
|
+
.option(`--commands <commands>`, `Build Commands.`)
|
|
766
961
|
.action(actionRunner(functionsCreateDeployment))
|
|
767
962
|
|
|
768
963
|
functions
|
|
@@ -788,17 +983,25 @@ functions
|
|
|
788
983
|
|
|
789
984
|
functions
|
|
790
985
|
.command(`createBuild`)
|
|
791
|
-
.description(
|
|
986
|
+
.description(`Create a new build for an Appwrite Function deployment. This endpoint can be used to retry a failed build.`)
|
|
792
987
|
.requiredOption(`--functionId <functionId>`, `Function ID.`)
|
|
793
988
|
.requiredOption(`--deploymentId <deploymentId>`, `Deployment ID.`)
|
|
794
989
|
.requiredOption(`--buildId <buildId>`, `Build unique ID.`)
|
|
795
990
|
.action(actionRunner(functionsCreateBuild))
|
|
796
991
|
|
|
992
|
+
functions
|
|
993
|
+
.command(`downloadDeployment`)
|
|
994
|
+
.description(``)
|
|
995
|
+
.requiredOption(`--functionId <functionId>`, `Function ID.`)
|
|
996
|
+
.requiredOption(`--deploymentId <deploymentId>`, `Deployment ID.`)
|
|
997
|
+
.requiredOption(`--destination <path>`, `output file path.`)
|
|
998
|
+
.action(actionRunner(functionsDownloadDeployment))
|
|
999
|
+
|
|
797
1000
|
functions
|
|
798
1001
|
.command(`listExecutions`)
|
|
799
1002
|
.description(`Get a list of all the current user function execution logs. You can use the query params to filter your results.`)
|
|
800
1003
|
.requiredOption(`--functionId <functionId>`, `Function ID.`)
|
|
801
|
-
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status,
|
|
1004
|
+
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration`)
|
|
802
1005
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
803
1006
|
.action(actionRunner(functionsListExecutions))
|
|
804
1007
|
|
|
@@ -806,8 +1009,11 @@ functions
|
|
|
806
1009
|
.command(`createExecution`)
|
|
807
1010
|
.description(`Trigger a function execution. The returned object will return you the current execution status. You can ping the 'Get Execution' endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.`)
|
|
808
1011
|
.requiredOption(`--functionId <functionId>`, `Function ID.`)
|
|
809
|
-
.option(`--
|
|
1012
|
+
.option(`--body <body>`, `HTTP body of execution. Default value is empty string.`)
|
|
810
1013
|
.option(`--async <async>`, `Execute code in the background. Default value is false.`, parseBool)
|
|
1014
|
+
.option(`--xpath <xpath>`, `HTTP path of execution. Path can include query params. Default value is /`)
|
|
1015
|
+
.option(`--method <method>`, `HTTP method of execution. Default value is GET.`)
|
|
1016
|
+
.option(`--headers <headers>`, `HTTP headers of execution. Defaults to empty.`)
|
|
811
1017
|
.action(actionRunner(functionsCreateExecution))
|
|
812
1018
|
|
|
813
1019
|
functions
|
|
@@ -832,7 +1038,7 @@ functions
|
|
|
832
1038
|
|
|
833
1039
|
functions
|
|
834
1040
|
.command(`createVariable`)
|
|
835
|
-
.description(`Create a new function variable. These variables can be accessed
|
|
1041
|
+
.description(`Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.`)
|
|
836
1042
|
.requiredOption(`--functionId <functionId>`, `Function unique ID.`)
|
|
837
1043
|
.requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
|
|
838
1044
|
.requiredOption(`--value <value>`, `Variable value. Max length: 8192 chars.`)
|
|
@@ -877,6 +1083,7 @@ module.exports = {
|
|
|
877
1083
|
functionsUpdateDeployment,
|
|
878
1084
|
functionsDeleteDeployment,
|
|
879
1085
|
functionsCreateBuild,
|
|
1086
|
+
functionsDownloadDeployment,
|
|
880
1087
|
functionsListExecutions,
|
|
881
1088
|
functionsCreateExecution,
|
|
882
1089
|
functionsGetExecution,
|