@appwrite.io/console 1.0.0 → 1.1.0-rc.1
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 +3 -3
- package/dist/cjs/sdk.js +4844 -3627
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +4843 -3628
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +4844 -3627
- package/docs/examples/{functions/list-specifications.md → account/create-payment-method.md} +3 -3
- package/docs/examples/account/delete-mfa-authenticator.md +2 -1
- package/docs/examples/account/delete-payment-method.md +13 -0
- package/docs/examples/account/get-billing-address.md +13 -0
- package/docs/examples/account/get-payment-method.md +13 -0
- package/docs/examples/{functions/get-template.md → account/list-billing-addresses.md} +4 -4
- package/docs/examples/account/list-credits.md +14 -0
- package/docs/examples/account/list-invoices.md +13 -0
- package/docs/examples/account/list-payment-methods.md +13 -0
- package/docs/examples/account/update-payment-method-mandate-options.md +13 -0
- package/docs/examples/account/update-payment-method-provider.md +15 -0
- package/docs/examples/account/update-payment-method.md +15 -0
- package/docs/examples/backups/create-archive.md +14 -0
- package/docs/examples/backups/create-policy.md +19 -0
- package/docs/examples/backups/create-restoration.md +16 -0
- package/docs/examples/backups/delete-archive.md +13 -0
- package/docs/examples/backups/delete-policy.md +13 -0
- package/docs/examples/backups/get-archive.md +13 -0
- package/docs/examples/backups/get-policy.md +13 -0
- package/docs/examples/backups/get-restoration.md +13 -0
- package/docs/examples/backups/list-archives.md +13 -0
- package/docs/examples/backups/list-policies.md +13 -0
- package/docs/examples/backups/list-restorations.md +13 -0
- package/docs/examples/backups/update-policy.md +17 -0
- package/docs/examples/console/create-source.md +17 -0
- package/docs/examples/console/get-copon.md +13 -0
- package/docs/examples/console/plans.md +11 -0
- package/docs/examples/console/regions.md +11 -0
- package/docs/examples/functions/create-build.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -2
- package/docs/examples/functions/create.md +1 -3
- package/docs/examples/functions/{get-deployment-download.md → download-deployment.md} +1 -1
- package/docs/examples/functions/update.md +1 -3
- package/docs/examples/organizations/add-credit.md +14 -0
- package/docs/examples/organizations/create-invoice-payment.md +15 -0
- package/docs/examples/organizations/create.md +17 -0
- package/docs/examples/organizations/delete-backup-payment-method.md +13 -0
- package/docs/examples/organizations/delete-billing-address.md +13 -0
- package/docs/examples/organizations/delete-default-payment-method.md +13 -0
- package/docs/examples/organizations/delete.md +13 -0
- package/docs/examples/organizations/get-aggregation.md +14 -0
- package/docs/examples/organizations/get-billing-address.md +14 -0
- package/docs/examples/organizations/get-credit.md +14 -0
- package/docs/examples/organizations/get-invoice-download.md +14 -0
- package/docs/examples/organizations/get-invoice-view.md +14 -0
- package/docs/examples/organizations/get-invoice.md +14 -0
- package/docs/examples/organizations/get-payment-method.md +14 -0
- package/docs/examples/organizations/get-plan.md +13 -0
- package/docs/examples/organizations/get-usage.md +15 -0
- package/docs/examples/organizations/list-aggregations.md +14 -0
- package/docs/examples/organizations/list-invoices.md +14 -0
- package/docs/examples/organizations/list.md +14 -0
- package/docs/examples/organizations/set-backup-payment-method.md +14 -0
- package/docs/examples/organizations/set-billing-address.md +14 -0
- package/docs/examples/organizations/set-billing-email.md +14 -0
- package/docs/examples/organizations/set-billing-tax-id.md +14 -0
- package/docs/examples/organizations/set-default-payment-method.md +14 -0
- package/docs/examples/organizations/update-budget.md +15 -0
- package/docs/examples/organizations/update-plan.md +16 -0
- package/package.json +1 -1
- package/src/client.ts +5 -20
- package/src/enums/billing-plan.ts +5 -0
- package/src/enums/email-template-type.ts +0 -2
- package/src/enums/platform-type.ts +0 -2
- package/src/enums/runtime.ts +0 -1
- package/src/index.ts +4 -1
- package/src/models.ts +956 -282
- package/src/services/account.ts +412 -20
- package/src/services/assistant.ts +2 -0
- package/src/services/avatars.ts +36 -0
- package/src/services/backups.ts +425 -0
- package/src/services/console.ts +122 -0
- package/src/services/databases.ts +49 -0
- package/src/services/functions.ts +41 -189
- package/src/services/graphql.ts +3 -0
- package/src/services/health.ts +24 -0
- package/src/services/locale.ts +9 -0
- package/src/services/messaging.ts +47 -0
- package/src/services/migrations.ts +17 -0
- package/src/services/organizations.ts +896 -0
- package/src/services/project.ts +7 -0
- package/src/services/projects.ts +42 -105
- package/src/services/proxy.ts +6 -0
- package/src/services/storage.ts +28 -0
- package/src/services/teams.ts +15 -0
- package/src/services/users.ts +43 -36
- package/src/services/vcs.ts +9 -34
- package/types/client.d.ts +0 -1
- package/types/enums/billing-plan.d.ts +5 -0
- package/types/enums/email-template-type.d.ts +1 -3
- package/types/enums/platform-type.d.ts +1 -3
- package/types/enums/runtime.d.ts +1 -2
- package/types/index.d.ts +4 -1
- package/types/models.d.ts +956 -282
- package/types/services/account.d.ts +105 -1
- package/types/services/backups.d.ts +128 -0
- package/types/services/console.d.ts +38 -0
- package/types/services/functions.d.ts +8 -67
- package/types/services/organizations.d.ts +273 -0
- package/types/services/projects.d.ts +1 -32
- package/types/services/users.d.ts +0 -12
- package/types/services/vcs.d.ts +0 -11
- package/docs/examples/functions/delete-execution.md +0 -14
- package/docs/examples/functions/list-templates.md +0 -16
- package/docs/examples/functions/update-deployment-build.md +0 -14
- package/docs/examples/projects/create-j-w-t.md +0 -15
- package/docs/examples/projects/update-mock-numbers.md +0 -14
- package/docs/examples/projects/update-session-alerts.md +0 -14
- package/docs/examples/users/create-j-w-t.md +0 -15
- package/docs/examples/vcs/get-repository-contents.md +0 -15
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
1
2
|
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
2
3
|
import type { Models } from '../models';
|
|
3
4
|
import { Runtime } from '../enums/runtime';
|
|
@@ -36,6 +37,7 @@ export class Functions {
|
|
|
36
37
|
'content-type': 'application/json',
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
|
|
39
41
|
return await this.client.call(
|
|
40
42
|
'get',
|
|
41
43
|
uri,
|
|
@@ -59,7 +61,6 @@ export class Functions {
|
|
|
59
61
|
* @param {boolean} logging
|
|
60
62
|
* @param {string} entrypoint
|
|
61
63
|
* @param {string} commands
|
|
62
|
-
* @param {string[]} scopes
|
|
63
64
|
* @param {string} installationId
|
|
64
65
|
* @param {string} providerRepositoryId
|
|
65
66
|
* @param {string} providerBranch
|
|
@@ -68,12 +69,11 @@ export class Functions {
|
|
|
68
69
|
* @param {string} templateRepository
|
|
69
70
|
* @param {string} templateOwner
|
|
70
71
|
* @param {string} templateRootDirectory
|
|
71
|
-
* @param {string}
|
|
72
|
-
* @param {string} specification
|
|
72
|
+
* @param {string} templateBranch
|
|
73
73
|
* @throws {AppwriteException}
|
|
74
74
|
* @returns {Promise<Models.Function>}
|
|
75
75
|
*/
|
|
76
|
-
async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string,
|
|
76
|
+
async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateBranch?: string): Promise<Models.Function> {
|
|
77
77
|
if (typeof functionId === 'undefined') {
|
|
78
78
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
79
79
|
}
|
|
@@ -118,9 +118,6 @@ export class Functions {
|
|
|
118
118
|
if (typeof commands !== 'undefined') {
|
|
119
119
|
payload['commands'] = commands;
|
|
120
120
|
}
|
|
121
|
-
if (typeof scopes !== 'undefined') {
|
|
122
|
-
payload['scopes'] = scopes;
|
|
123
|
-
}
|
|
124
121
|
if (typeof installationId !== 'undefined') {
|
|
125
122
|
payload['installationId'] = installationId;
|
|
126
123
|
}
|
|
@@ -145,11 +142,8 @@ export class Functions {
|
|
|
145
142
|
if (typeof templateRootDirectory !== 'undefined') {
|
|
146
143
|
payload['templateRootDirectory'] = templateRootDirectory;
|
|
147
144
|
}
|
|
148
|
-
if (typeof
|
|
149
|
-
payload['
|
|
150
|
-
}
|
|
151
|
-
if (typeof specification !== 'undefined') {
|
|
152
|
-
payload['specification'] = specification;
|
|
145
|
+
if (typeof templateBranch !== 'undefined') {
|
|
146
|
+
payload['templateBranch'] = templateBranch;
|
|
153
147
|
}
|
|
154
148
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
155
149
|
|
|
@@ -157,6 +151,7 @@ export class Functions {
|
|
|
157
151
|
'content-type': 'application/json',
|
|
158
152
|
}
|
|
159
153
|
|
|
154
|
+
|
|
160
155
|
return await this.client.call(
|
|
161
156
|
'post',
|
|
162
157
|
uri,
|
|
@@ -181,98 +176,6 @@ export class Functions {
|
|
|
181
176
|
'content-type': 'application/json',
|
|
182
177
|
}
|
|
183
178
|
|
|
184
|
-
return await this.client.call(
|
|
185
|
-
'get',
|
|
186
|
-
uri,
|
|
187
|
-
apiHeaders,
|
|
188
|
-
payload
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* List available function runtime specifications
|
|
193
|
-
*
|
|
194
|
-
* List allowed function specifications for this instance.
|
|
195
|
-
|
|
196
|
-
*
|
|
197
|
-
* @throws {AppwriteException}
|
|
198
|
-
* @returns {Promise<Models.SpecificationList>}
|
|
199
|
-
*/
|
|
200
|
-
async listSpecifications(): Promise<Models.SpecificationList> {
|
|
201
|
-
const apiPath = '/functions/specifications';
|
|
202
|
-
const payload: Payload = {};
|
|
203
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
204
|
-
|
|
205
|
-
const apiHeaders: { [header: string]: string } = {
|
|
206
|
-
'content-type': 'application/json',
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return await this.client.call(
|
|
210
|
-
'get',
|
|
211
|
-
uri,
|
|
212
|
-
apiHeaders,
|
|
213
|
-
payload
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* List function templates
|
|
218
|
-
*
|
|
219
|
-
* List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
|
|
220
|
-
*
|
|
221
|
-
* @param {string[]} runtimes
|
|
222
|
-
* @param {string[]} useCases
|
|
223
|
-
* @param {number} limit
|
|
224
|
-
* @param {number} offset
|
|
225
|
-
* @throws {AppwriteException}
|
|
226
|
-
* @returns {Promise<Models.TemplateFunctionList>}
|
|
227
|
-
*/
|
|
228
|
-
async listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number): Promise<Models.TemplateFunctionList> {
|
|
229
|
-
const apiPath = '/functions/templates';
|
|
230
|
-
const payload: Payload = {};
|
|
231
|
-
if (typeof runtimes !== 'undefined') {
|
|
232
|
-
payload['runtimes'] = runtimes;
|
|
233
|
-
}
|
|
234
|
-
if (typeof useCases !== 'undefined') {
|
|
235
|
-
payload['useCases'] = useCases;
|
|
236
|
-
}
|
|
237
|
-
if (typeof limit !== 'undefined') {
|
|
238
|
-
payload['limit'] = limit;
|
|
239
|
-
}
|
|
240
|
-
if (typeof offset !== 'undefined') {
|
|
241
|
-
payload['offset'] = offset;
|
|
242
|
-
}
|
|
243
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
244
|
-
|
|
245
|
-
const apiHeaders: { [header: string]: string } = {
|
|
246
|
-
'content-type': 'application/json',
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return await this.client.call(
|
|
250
|
-
'get',
|
|
251
|
-
uri,
|
|
252
|
-
apiHeaders,
|
|
253
|
-
payload
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Get function template
|
|
258
|
-
*
|
|
259
|
-
* Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
|
|
260
|
-
*
|
|
261
|
-
* @param {string} templateId
|
|
262
|
-
* @throws {AppwriteException}
|
|
263
|
-
* @returns {Promise<Models.TemplateFunction>}
|
|
264
|
-
*/
|
|
265
|
-
async getTemplate(templateId: string): Promise<Models.TemplateFunction> {
|
|
266
|
-
if (typeof templateId === 'undefined') {
|
|
267
|
-
throw new AppwriteException('Missing required parameter: "templateId"');
|
|
268
|
-
}
|
|
269
|
-
const apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId);
|
|
270
|
-
const payload: Payload = {};
|
|
271
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
272
|
-
|
|
273
|
-
const apiHeaders: { [header: string]: string } = {
|
|
274
|
-
'content-type': 'application/json',
|
|
275
|
-
}
|
|
276
179
|
|
|
277
180
|
return await this.client.call(
|
|
278
181
|
'get',
|
|
@@ -301,6 +204,7 @@ export class Functions {
|
|
|
301
204
|
'content-type': 'application/json',
|
|
302
205
|
}
|
|
303
206
|
|
|
207
|
+
|
|
304
208
|
return await this.client.call(
|
|
305
209
|
'get',
|
|
306
210
|
uri,
|
|
@@ -329,6 +233,7 @@ export class Functions {
|
|
|
329
233
|
'content-type': 'application/json',
|
|
330
234
|
}
|
|
331
235
|
|
|
236
|
+
|
|
332
237
|
return await this.client.call(
|
|
333
238
|
'get',
|
|
334
239
|
uri,
|
|
@@ -352,17 +257,15 @@ export class Functions {
|
|
|
352
257
|
* @param {boolean} logging
|
|
353
258
|
* @param {string} entrypoint
|
|
354
259
|
* @param {string} commands
|
|
355
|
-
* @param {string[]} scopes
|
|
356
260
|
* @param {string} installationId
|
|
357
261
|
* @param {string} providerRepositoryId
|
|
358
262
|
* @param {string} providerBranch
|
|
359
263
|
* @param {boolean} providerSilentMode
|
|
360
264
|
* @param {string} providerRootDirectory
|
|
361
|
-
* @param {string} specification
|
|
362
265
|
* @throws {AppwriteException}
|
|
363
266
|
* @returns {Promise<Models.Function>}
|
|
364
267
|
*/
|
|
365
|
-
async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string,
|
|
268
|
+
async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise<Models.Function> {
|
|
366
269
|
if (typeof functionId === 'undefined') {
|
|
367
270
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
368
271
|
}
|
|
@@ -401,9 +304,6 @@ export class Functions {
|
|
|
401
304
|
if (typeof commands !== 'undefined') {
|
|
402
305
|
payload['commands'] = commands;
|
|
403
306
|
}
|
|
404
|
-
if (typeof scopes !== 'undefined') {
|
|
405
|
-
payload['scopes'] = scopes;
|
|
406
|
-
}
|
|
407
307
|
if (typeof installationId !== 'undefined') {
|
|
408
308
|
payload['installationId'] = installationId;
|
|
409
309
|
}
|
|
@@ -419,15 +319,13 @@ export class Functions {
|
|
|
419
319
|
if (typeof providerRootDirectory !== 'undefined') {
|
|
420
320
|
payload['providerRootDirectory'] = providerRootDirectory;
|
|
421
321
|
}
|
|
422
|
-
if (typeof specification !== 'undefined') {
|
|
423
|
-
payload['specification'] = specification;
|
|
424
|
-
}
|
|
425
322
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
426
323
|
|
|
427
324
|
const apiHeaders: { [header: string]: string } = {
|
|
428
325
|
'content-type': 'application/json',
|
|
429
326
|
}
|
|
430
327
|
|
|
328
|
+
|
|
431
329
|
return await this.client.call(
|
|
432
330
|
'put',
|
|
433
331
|
uri,
|
|
@@ -456,6 +354,7 @@ export class Functions {
|
|
|
456
354
|
'content-type': 'application/json',
|
|
457
355
|
}
|
|
458
356
|
|
|
357
|
+
|
|
459
358
|
return await this.client.call(
|
|
460
359
|
'delete',
|
|
461
360
|
uri,
|
|
@@ -492,6 +391,7 @@ export class Functions {
|
|
|
492
391
|
'content-type': 'application/json',
|
|
493
392
|
}
|
|
494
393
|
|
|
394
|
+
|
|
495
395
|
return await this.client.call(
|
|
496
396
|
'get',
|
|
497
397
|
uri,
|
|
@@ -546,6 +446,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
546
446
|
'content-type': 'multipart/form-data',
|
|
547
447
|
}
|
|
548
448
|
|
|
449
|
+
|
|
549
450
|
return await this.client.chunkedUpload(
|
|
550
451
|
'post',
|
|
551
452
|
uri,
|
|
@@ -579,6 +480,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
579
480
|
'content-type': 'application/json',
|
|
580
481
|
}
|
|
581
482
|
|
|
483
|
+
|
|
582
484
|
return await this.client.call(
|
|
583
485
|
'get',
|
|
584
486
|
uri,
|
|
@@ -611,6 +513,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
611
513
|
'content-type': 'application/json',
|
|
612
514
|
}
|
|
613
515
|
|
|
516
|
+
|
|
614
517
|
return await this.client.call(
|
|
615
518
|
'patch',
|
|
616
519
|
uri,
|
|
@@ -643,6 +546,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
643
546
|
'content-type': 'application/json',
|
|
644
547
|
}
|
|
645
548
|
|
|
549
|
+
|
|
646
550
|
return await this.client.call(
|
|
647
551
|
'delete',
|
|
648
552
|
uri,
|
|
@@ -651,8 +555,9 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
651
555
|
);
|
|
652
556
|
}
|
|
653
557
|
/**
|
|
654
|
-
*
|
|
558
|
+
* Create build
|
|
655
559
|
*
|
|
560
|
+
* Create a new build for an Appwrite Function deployment. This endpoint can be used to retry a failed build.
|
|
656
561
|
*
|
|
657
562
|
* @param {string} functionId
|
|
658
563
|
* @param {string} deploymentId
|
|
@@ -660,48 +565,17 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
660
565
|
* @throws {AppwriteException}
|
|
661
566
|
* @returns {Promise<{}>}
|
|
662
567
|
*/
|
|
663
|
-
async createBuild(functionId: string, deploymentId: string, buildId
|
|
568
|
+
async createBuild(functionId: string, deploymentId: string, buildId: string): Promise<{}> {
|
|
664
569
|
if (typeof functionId === 'undefined') {
|
|
665
570
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
666
571
|
}
|
|
667
572
|
if (typeof deploymentId === 'undefined') {
|
|
668
573
|
throw new AppwriteException('Missing required parameter: "deploymentId"');
|
|
669
574
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
if (typeof buildId !== 'undefined') {
|
|
673
|
-
payload['buildId'] = buildId;
|
|
674
|
-
}
|
|
675
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
676
|
-
|
|
677
|
-
const apiHeaders: { [header: string]: string } = {
|
|
678
|
-
'content-type': 'application/json',
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
return await this.client.call(
|
|
682
|
-
'post',
|
|
683
|
-
uri,
|
|
684
|
-
apiHeaders,
|
|
685
|
-
payload
|
|
686
|
-
);
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
* Cancel deployment
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
* @param {string} functionId
|
|
693
|
-
* @param {string} deploymentId
|
|
694
|
-
* @throws {AppwriteException}
|
|
695
|
-
* @returns {Promise<Models.Build>}
|
|
696
|
-
*/
|
|
697
|
-
async updateDeploymentBuild(functionId: string, deploymentId: string): Promise<Models.Build> {
|
|
698
|
-
if (typeof functionId === 'undefined') {
|
|
699
|
-
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
700
|
-
}
|
|
701
|
-
if (typeof deploymentId === 'undefined') {
|
|
702
|
-
throw new AppwriteException('Missing required parameter: "deploymentId"');
|
|
575
|
+
if (typeof buildId === 'undefined') {
|
|
576
|
+
throw new AppwriteException('Missing required parameter: "buildId"');
|
|
703
577
|
}
|
|
704
|
-
const apiPath = '/functions/{functionId}/deployments/{deploymentId}/
|
|
578
|
+
const apiPath = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId).replace('{buildId}', buildId);
|
|
705
579
|
const payload: Payload = {};
|
|
706
580
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
707
581
|
|
|
@@ -709,8 +583,9 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
709
583
|
'content-type': 'application/json',
|
|
710
584
|
}
|
|
711
585
|
|
|
586
|
+
|
|
712
587
|
return await this.client.call(
|
|
713
|
-
'
|
|
588
|
+
'post',
|
|
714
589
|
uri,
|
|
715
590
|
apiHeaders,
|
|
716
591
|
payload
|
|
@@ -726,7 +601,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
726
601
|
* @throws {AppwriteException}
|
|
727
602
|
* @returns {string}
|
|
728
603
|
*/
|
|
729
|
-
|
|
604
|
+
downloadDeployment(functionId: string, deploymentId: string): string {
|
|
730
605
|
if (typeof functionId === 'undefined') {
|
|
731
606
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
732
607
|
}
|
|
@@ -741,6 +616,11 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
741
616
|
'content-type': 'application/json',
|
|
742
617
|
}
|
|
743
618
|
|
|
619
|
+
payload['project'] = this.client.config.project;
|
|
620
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
621
|
+
uri.searchParams.append(key, value);
|
|
622
|
+
}
|
|
623
|
+
|
|
744
624
|
payload['project'] = this.client.config.project;
|
|
745
625
|
|
|
746
626
|
for (const [key, value] of Object.entries(Client.flatten(payload))) {
|
|
@@ -778,6 +658,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
778
658
|
'content-type': 'application/json',
|
|
779
659
|
}
|
|
780
660
|
|
|
661
|
+
|
|
781
662
|
return await this.client.call(
|
|
782
663
|
'get',
|
|
783
664
|
uri,
|
|
@@ -796,11 +677,10 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
796
677
|
* @param {string} xpath
|
|
797
678
|
* @param {ExecutionMethod} method
|
|
798
679
|
* @param {object} headers
|
|
799
|
-
* @param {string} scheduledAt
|
|
800
680
|
* @throws {AppwriteException}
|
|
801
681
|
* @returns {Promise<Models.Execution>}
|
|
802
682
|
*/
|
|
803
|
-
async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object
|
|
683
|
+
async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object): Promise<Models.Execution> {
|
|
804
684
|
if (typeof functionId === 'undefined') {
|
|
805
685
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
806
686
|
}
|
|
@@ -821,15 +701,13 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
821
701
|
if (typeof headers !== 'undefined') {
|
|
822
702
|
payload['headers'] = headers;
|
|
823
703
|
}
|
|
824
|
-
if (typeof scheduledAt !== 'undefined') {
|
|
825
|
-
payload['scheduledAt'] = scheduledAt;
|
|
826
|
-
}
|
|
827
704
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
828
705
|
|
|
829
706
|
const apiHeaders: { [header: string]: string } = {
|
|
830
707
|
'content-type': 'application/json',
|
|
831
708
|
}
|
|
832
709
|
|
|
710
|
+
|
|
833
711
|
return await this.client.call(
|
|
834
712
|
'post',
|
|
835
713
|
uri,
|
|
@@ -862,41 +740,9 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
862
740
|
'content-type': 'application/json',
|
|
863
741
|
}
|
|
864
742
|
|
|
865
|
-
return await this.client.call(
|
|
866
|
-
'get',
|
|
867
|
-
uri,
|
|
868
|
-
apiHeaders,
|
|
869
|
-
payload
|
|
870
|
-
);
|
|
871
|
-
}
|
|
872
|
-
/**
|
|
873
|
-
* Delete execution
|
|
874
|
-
*
|
|
875
|
-
* Delete a function execution by its unique ID.
|
|
876
|
-
|
|
877
|
-
*
|
|
878
|
-
* @param {string} functionId
|
|
879
|
-
* @param {string} executionId
|
|
880
|
-
* @throws {AppwriteException}
|
|
881
|
-
* @returns {Promise<{}>}
|
|
882
|
-
*/
|
|
883
|
-
async deleteExecution(functionId: string, executionId: string): Promise<{}> {
|
|
884
|
-
if (typeof functionId === 'undefined') {
|
|
885
|
-
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
886
|
-
}
|
|
887
|
-
if (typeof executionId === 'undefined') {
|
|
888
|
-
throw new AppwriteException('Missing required parameter: "executionId"');
|
|
889
|
-
}
|
|
890
|
-
const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
|
891
|
-
const payload: Payload = {};
|
|
892
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
893
|
-
|
|
894
|
-
const apiHeaders: { [header: string]: string } = {
|
|
895
|
-
'content-type': 'application/json',
|
|
896
|
-
}
|
|
897
743
|
|
|
898
744
|
return await this.client.call(
|
|
899
|
-
'
|
|
745
|
+
'get',
|
|
900
746
|
uri,
|
|
901
747
|
apiHeaders,
|
|
902
748
|
payload
|
|
@@ -926,6 +772,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
926
772
|
'content-type': 'application/json',
|
|
927
773
|
}
|
|
928
774
|
|
|
775
|
+
|
|
929
776
|
return await this.client.call(
|
|
930
777
|
'get',
|
|
931
778
|
uri,
|
|
@@ -954,6 +801,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
954
801
|
'content-type': 'application/json',
|
|
955
802
|
}
|
|
956
803
|
|
|
804
|
+
|
|
957
805
|
return await this.client.call(
|
|
958
806
|
'get',
|
|
959
807
|
uri,
|
|
@@ -996,6 +844,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
996
844
|
'content-type': 'application/json',
|
|
997
845
|
}
|
|
998
846
|
|
|
847
|
+
|
|
999
848
|
return await this.client.call(
|
|
1000
849
|
'post',
|
|
1001
850
|
uri,
|
|
@@ -1028,6 +877,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
1028
877
|
'content-type': 'application/json',
|
|
1029
878
|
}
|
|
1030
879
|
|
|
880
|
+
|
|
1031
881
|
return await this.client.call(
|
|
1032
882
|
'get',
|
|
1033
883
|
uri,
|
|
@@ -1071,6 +921,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
1071
921
|
'content-type': 'application/json',
|
|
1072
922
|
}
|
|
1073
923
|
|
|
924
|
+
|
|
1074
925
|
return await this.client.call(
|
|
1075
926
|
'put',
|
|
1076
927
|
uri,
|
|
@@ -1103,6 +954,7 @@ Use the "command" param to set the entrypoint used to execute your cod
|
|
|
1103
954
|
'content-type': 'application/json',
|
|
1104
955
|
}
|
|
1105
956
|
|
|
957
|
+
|
|
1106
958
|
return await this.client.call(
|
|
1107
959
|
'delete',
|
|
1108
960
|
uri,
|
package/src/services/graphql.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
1
2
|
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
2
3
|
import type { Models } from '../models';
|
|
3
4
|
|
|
@@ -33,6 +34,7 @@ export class Graphql {
|
|
|
33
34
|
'content-type': 'application/json',
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
|
|
36
38
|
return await this.client.call(
|
|
37
39
|
'post',
|
|
38
40
|
uri,
|
|
@@ -65,6 +67,7 @@ export class Graphql {
|
|
|
65
67
|
'content-type': 'application/json',
|
|
66
68
|
}
|
|
67
69
|
|
|
70
|
+
|
|
68
71
|
return await this.client.call(
|
|
69
72
|
'post',
|
|
70
73
|
uri,
|
package/src/services/health.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
1
2
|
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
2
3
|
import type { Models } from '../models';
|
|
3
4
|
import { Name } from '../enums/name';
|
|
@@ -26,6 +27,7 @@ export class Health {
|
|
|
26
27
|
'content-type': 'application/json',
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
|
|
29
31
|
return await this.client.call(
|
|
30
32
|
'get',
|
|
31
33
|
uri,
|
|
@@ -50,6 +52,7 @@ export class Health {
|
|
|
50
52
|
'content-type': 'application/json',
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
|
|
53
56
|
return await this.client.call(
|
|
54
57
|
'get',
|
|
55
58
|
uri,
|
|
@@ -74,6 +77,7 @@ export class Health {
|
|
|
74
77
|
'content-type': 'application/json',
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
|
|
77
81
|
return await this.client.call(
|
|
78
82
|
'get',
|
|
79
83
|
uri,
|
|
@@ -102,6 +106,7 @@ export class Health {
|
|
|
102
106
|
'content-type': 'application/json',
|
|
103
107
|
}
|
|
104
108
|
|
|
109
|
+
|
|
105
110
|
return await this.client.call(
|
|
106
111
|
'get',
|
|
107
112
|
uri,
|
|
@@ -126,6 +131,7 @@ export class Health {
|
|
|
126
131
|
'content-type': 'application/json',
|
|
127
132
|
}
|
|
128
133
|
|
|
134
|
+
|
|
129
135
|
return await this.client.call(
|
|
130
136
|
'get',
|
|
131
137
|
uri,
|
|
@@ -150,6 +156,7 @@ export class Health {
|
|
|
150
156
|
'content-type': 'application/json',
|
|
151
157
|
}
|
|
152
158
|
|
|
159
|
+
|
|
153
160
|
return await this.client.call(
|
|
154
161
|
'get',
|
|
155
162
|
uri,
|
|
@@ -174,6 +181,7 @@ export class Health {
|
|
|
174
181
|
'content-type': 'application/json',
|
|
175
182
|
}
|
|
176
183
|
|
|
184
|
+
|
|
177
185
|
return await this.client.call(
|
|
178
186
|
'get',
|
|
179
187
|
uri,
|
|
@@ -202,6 +210,7 @@ export class Health {
|
|
|
202
210
|
'content-type': 'application/json',
|
|
203
211
|
}
|
|
204
212
|
|
|
213
|
+
|
|
205
214
|
return await this.client.call(
|
|
206
215
|
'get',
|
|
207
216
|
uri,
|
|
@@ -230,6 +239,7 @@ export class Health {
|
|
|
230
239
|
'content-type': 'application/json',
|
|
231
240
|
}
|
|
232
241
|
|
|
242
|
+
|
|
233
243
|
return await this.client.call(
|
|
234
244
|
'get',
|
|
235
245
|
uri,
|
|
@@ -262,6 +272,7 @@ export class Health {
|
|
|
262
272
|
'content-type': 'application/json',
|
|
263
273
|
}
|
|
264
274
|
|
|
275
|
+
|
|
265
276
|
return await this.client.call(
|
|
266
277
|
'get',
|
|
267
278
|
uri,
|
|
@@ -290,6 +301,7 @@ export class Health {
|
|
|
290
301
|
'content-type': 'application/json',
|
|
291
302
|
}
|
|
292
303
|
|
|
304
|
+
|
|
293
305
|
return await this.client.call(
|
|
294
306
|
'get',
|
|
295
307
|
uri,
|
|
@@ -323,6 +335,7 @@ export class Health {
|
|
|
323
335
|
'content-type': 'application/json',
|
|
324
336
|
}
|
|
325
337
|
|
|
338
|
+
|
|
326
339
|
return await this.client.call(
|
|
327
340
|
'get',
|
|
328
341
|
uri,
|
|
@@ -351,6 +364,7 @@ export class Health {
|
|
|
351
364
|
'content-type': 'application/json',
|
|
352
365
|
}
|
|
353
366
|
|
|
367
|
+
|
|
354
368
|
return await this.client.call(
|
|
355
369
|
'get',
|
|
356
370
|
uri,
|
|
@@ -379,6 +393,7 @@ export class Health {
|
|
|
379
393
|
'content-type': 'application/json',
|
|
380
394
|
}
|
|
381
395
|
|
|
396
|
+
|
|
382
397
|
return await this.client.call(
|
|
383
398
|
'get',
|
|
384
399
|
uri,
|
|
@@ -407,6 +422,7 @@ export class Health {
|
|
|
407
422
|
'content-type': 'application/json',
|
|
408
423
|
}
|
|
409
424
|
|
|
425
|
+
|
|
410
426
|
return await this.client.call(
|
|
411
427
|
'get',
|
|
412
428
|
uri,
|
|
@@ -435,6 +451,7 @@ export class Health {
|
|
|
435
451
|
'content-type': 'application/json',
|
|
436
452
|
}
|
|
437
453
|
|
|
454
|
+
|
|
438
455
|
return await this.client.call(
|
|
439
456
|
'get',
|
|
440
457
|
uri,
|
|
@@ -463,6 +480,7 @@ export class Health {
|
|
|
463
480
|
'content-type': 'application/json',
|
|
464
481
|
}
|
|
465
482
|
|
|
483
|
+
|
|
466
484
|
return await this.client.call(
|
|
467
485
|
'get',
|
|
468
486
|
uri,
|
|
@@ -491,6 +509,7 @@ export class Health {
|
|
|
491
509
|
'content-type': 'application/json',
|
|
492
510
|
}
|
|
493
511
|
|
|
512
|
+
|
|
494
513
|
return await this.client.call(
|
|
495
514
|
'get',
|
|
496
515
|
uri,
|
|
@@ -519,6 +538,7 @@ export class Health {
|
|
|
519
538
|
'content-type': 'application/json',
|
|
520
539
|
}
|
|
521
540
|
|
|
541
|
+
|
|
522
542
|
return await this.client.call(
|
|
523
543
|
'get',
|
|
524
544
|
uri,
|
|
@@ -547,6 +567,7 @@ export class Health {
|
|
|
547
567
|
'content-type': 'application/json',
|
|
548
568
|
}
|
|
549
569
|
|
|
570
|
+
|
|
550
571
|
return await this.client.call(
|
|
551
572
|
'get',
|
|
552
573
|
uri,
|
|
@@ -571,6 +592,7 @@ export class Health {
|
|
|
571
592
|
'content-type': 'application/json',
|
|
572
593
|
}
|
|
573
594
|
|
|
595
|
+
|
|
574
596
|
return await this.client.call(
|
|
575
597
|
'get',
|
|
576
598
|
uri,
|
|
@@ -595,6 +617,7 @@ export class Health {
|
|
|
595
617
|
'content-type': 'application/json',
|
|
596
618
|
}
|
|
597
619
|
|
|
620
|
+
|
|
598
621
|
return await this.client.call(
|
|
599
622
|
'get',
|
|
600
623
|
uri,
|
|
@@ -619,6 +642,7 @@ export class Health {
|
|
|
619
642
|
'content-type': 'application/json',
|
|
620
643
|
}
|
|
621
644
|
|
|
645
|
+
|
|
622
646
|
return await this.client.call(
|
|
623
647
|
'get',
|
|
624
648
|
uri,
|