node-appwrite 20.3.0 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/client.js +2 -2
  2. package/dist/client.js.map +1 -1
  3. package/dist/client.mjs +2 -2
  4. package/dist/client.mjs.map +1 -1
  5. package/dist/enums/build-runtime.d.mts +3 -1
  6. package/dist/enums/build-runtime.d.ts +3 -1
  7. package/dist/enums/build-runtime.js +2 -0
  8. package/dist/enums/build-runtime.js.map +1 -1
  9. package/dist/enums/build-runtime.mjs +2 -0
  10. package/dist/enums/build-runtime.mjs.map +1 -1
  11. package/dist/enums/output.d.mts +11 -0
  12. package/dist/enums/output.d.ts +11 -0
  13. package/dist/enums/output.js +16 -0
  14. package/dist/enums/output.js.map +1 -0
  15. package/dist/enums/output.mjs +15 -0
  16. package/dist/enums/output.mjs.map +1 -0
  17. package/dist/enums/runtime.d.mts +3 -1
  18. package/dist/enums/runtime.d.ts +3 -1
  19. package/dist/enums/runtime.js +2 -0
  20. package/dist/enums/runtime.js.map +1 -1
  21. package/dist/enums/runtime.mjs +2 -0
  22. package/dist/enums/runtime.mjs.map +1 -1
  23. package/dist/enums/template-reference-type.d.mts +7 -0
  24. package/dist/enums/template-reference-type.d.ts +7 -0
  25. package/dist/enums/template-reference-type.js +12 -0
  26. package/dist/enums/template-reference-type.js.map +1 -0
  27. package/dist/enums/template-reference-type.mjs +11 -0
  28. package/dist/enums/template-reference-type.mjs.map +1 -0
  29. package/dist/enums/theme.d.mts +6 -0
  30. package/dist/enums/theme.d.ts +6 -0
  31. package/dist/enums/theme.js +11 -0
  32. package/dist/enums/theme.js.map +1 -0
  33. package/dist/enums/theme.mjs +10 -0
  34. package/dist/enums/theme.mjs.map +1 -0
  35. package/dist/enums/timezone.d.mts +423 -0
  36. package/dist/enums/timezone.d.ts +423 -0
  37. package/dist/enums/timezone.js +428 -0
  38. package/dist/enums/timezone.js.map +1 -0
  39. package/dist/enums/timezone.mjs +427 -0
  40. package/dist/enums/timezone.mjs.map +1 -0
  41. package/dist/enums/{vcs-deployment-type.d.mts → vcs-reference-type.d.mts} +2 -2
  42. package/dist/enums/{vcs-deployment-type.d.ts → vcs-reference-type.d.ts} +2 -2
  43. package/dist/enums/vcs-reference-type.js +12 -0
  44. package/dist/enums/vcs-reference-type.js.map +1 -0
  45. package/dist/enums/vcs-reference-type.mjs +11 -0
  46. package/dist/enums/vcs-reference-type.mjs.map +1 -0
  47. package/dist/index.d.mts +5 -1
  48. package/dist/index.d.ts +5 -1
  49. package/dist/index.js +23 -3
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +5 -1
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/models.d.mts +4 -0
  54. package/dist/models.d.ts +4 -0
  55. package/dist/services/account.js +4 -4
  56. package/dist/services/account.js.map +1 -1
  57. package/dist/services/account.mjs +4 -4
  58. package/dist/services/account.mjs.map +1 -1
  59. package/dist/services/avatars.d.mts +87 -0
  60. package/dist/services/avatars.d.ts +87 -0
  61. package/dist/services/avatars.js +123 -0
  62. package/dist/services/avatars.js.map +1 -1
  63. package/dist/services/avatars.mjs +123 -0
  64. package/dist/services/avatars.mjs.map +1 -1
  65. package/dist/services/databases.d.mts +7 -1
  66. package/dist/services/databases.d.ts +7 -1
  67. package/dist/services/databases.js +11 -1
  68. package/dist/services/databases.js.map +1 -1
  69. package/dist/services/databases.mjs +11 -1
  70. package/dist/services/databases.mjs.map +1 -1
  71. package/dist/services/functions.d.mts +13 -9
  72. package/dist/services/functions.d.ts +13 -9
  73. package/dist/services/functions.js +15 -7
  74. package/dist/services/functions.js.map +1 -1
  75. package/dist/services/functions.mjs +15 -7
  76. package/dist/services/functions.mjs.map +1 -1
  77. package/dist/services/sites.d.mts +15 -11
  78. package/dist/services/sites.d.ts +15 -11
  79. package/dist/services/sites.js +15 -7
  80. package/dist/services/sites.js.map +1 -1
  81. package/dist/services/sites.mjs +15 -7
  82. package/dist/services/sites.mjs.map +1 -1
  83. package/dist/services/storage.d.mts +10 -4
  84. package/dist/services/storage.d.ts +10 -4
  85. package/dist/services/storage.js +12 -2
  86. package/dist/services/storage.js.map +1 -1
  87. package/dist/services/storage.mjs +12 -2
  88. package/dist/services/storage.mjs.map +1 -1
  89. package/dist/services/tables-db.d.mts +9 -3
  90. package/dist/services/tables-db.d.ts +9 -3
  91. package/dist/services/tables-db.js +11 -1
  92. package/dist/services/tables-db.js.map +1 -1
  93. package/dist/services/tables-db.mjs +11 -1
  94. package/dist/services/tables-db.mjs.map +1 -1
  95. package/package.json +1 -1
  96. package/dist/enums/vcs-deployment-type.js +0 -12
  97. package/dist/enums/vcs-deployment-type.js.map +0 -1
  98. package/dist/enums/vcs-deployment-type.mjs +0 -11
  99. package/dist/enums/vcs-deployment-type.mjs.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { Client, UploadProgress } from '../client.mjs';
2
2
  import { Models } from '../models.mjs';
3
3
  import { Runtime } from '../enums/runtime.mjs';
4
- import { VCSDeploymentType } from '../enums/vcs-deployment-type.mjs';
4
+ import { TemplateReferenceType } from '../enums/template-reference-type.mjs';
5
+ import { VCSReferenceType } from '../enums/vcs-reference-type.mjs';
5
6
  import { DeploymentDownloadType } from '../enums/deployment-download-type.mjs';
6
7
  import { ExecutionMethod } from '../enums/execution-method.mjs';
7
8
  import '../query.mjs';
@@ -360,7 +361,8 @@ declare class Functions {
360
361
  * @param {string} params.repository - Repository name of the template.
361
362
  * @param {string} params.owner - The name of the owner of the template.
362
363
  * @param {string} params.rootDirectory - Path to function code in the template repo.
363
- * @param {string} params.version - Version (tag) for the repo linked to the function template.
364
+ * @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
365
+ * @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
364
366
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
365
367
  * @throws {AppwriteException}
366
368
  * @returns {Promise<Models.Deployment>}
@@ -370,7 +372,8 @@ declare class Functions {
370
372
  repository: string;
371
373
  owner: string;
372
374
  rootDirectory: string;
373
- version: string;
375
+ type: TemplateReferenceType;
376
+ reference: string;
374
377
  activate?: boolean;
375
378
  }): Promise<Models.Deployment>;
376
379
  /**
@@ -382,20 +385,21 @@ declare class Functions {
382
385
  * @param {string} repository - Repository name of the template.
383
386
  * @param {string} owner - The name of the owner of the template.
384
387
  * @param {string} rootDirectory - Path to function code in the template repo.
385
- * @param {string} version - Version (tag) for the repo linked to the function template.
388
+ * @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
389
+ * @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
386
390
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
387
391
  * @throws {AppwriteException}
388
392
  * @returns {Promise<Models.Deployment>}
389
393
  * @deprecated Use the object parameter style method for a better developer experience.
390
394
  */
391
- createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise<Models.Deployment>;
395
+ createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
392
396
  /**
393
397
  * Create a deployment when a function is connected to VCS.
394
398
  *
395
399
  * This endpoint lets you create deployment from a branch, commit, or a tag.
396
400
  *
397
401
  * @param {string} params.functionId - Function ID.
398
- * @param {VCSDeploymentType} params.type - Type of reference passed. Allowed values are: branch, commit
402
+ * @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
399
403
  * @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
400
404
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
401
405
  * @throws {AppwriteException}
@@ -403,7 +407,7 @@ declare class Functions {
403
407
  */
404
408
  createVcsDeployment(params: {
405
409
  functionId: string;
406
- type: VCSDeploymentType;
410
+ type: VCSReferenceType;
407
411
  reference: string;
408
412
  activate?: boolean;
409
413
  }): Promise<Models.Deployment>;
@@ -413,14 +417,14 @@ declare class Functions {
413
417
  * This endpoint lets you create deployment from a branch, commit, or a tag.
414
418
  *
415
419
  * @param {string} functionId - Function ID.
416
- * @param {VCSDeploymentType} type - Type of reference passed. Allowed values are: branch, commit
420
+ * @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
417
421
  * @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
418
422
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
419
423
  * @throws {AppwriteException}
420
424
  * @returns {Promise<Models.Deployment>}
421
425
  * @deprecated Use the object parameter style method for a better developer experience.
422
426
  */
423
- createVcsDeployment(functionId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise<Models.Deployment>;
427
+ createVcsDeployment(functionId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
424
428
  /**
425
429
  * Get a function deployment by its unique ID.
426
430
  *
@@ -1,7 +1,8 @@
1
1
  import { Client, UploadProgress } from '../client.js';
2
2
  import { Models } from '../models.js';
3
3
  import { Runtime } from '../enums/runtime.js';
4
- import { VCSDeploymentType } from '../enums/vcs-deployment-type.js';
4
+ import { TemplateReferenceType } from '../enums/template-reference-type.js';
5
+ import { VCSReferenceType } from '../enums/vcs-reference-type.js';
5
6
  import { DeploymentDownloadType } from '../enums/deployment-download-type.js';
6
7
  import { ExecutionMethod } from '../enums/execution-method.js';
7
8
  import '../query.js';
@@ -360,7 +361,8 @@ declare class Functions {
360
361
  * @param {string} params.repository - Repository name of the template.
361
362
  * @param {string} params.owner - The name of the owner of the template.
362
363
  * @param {string} params.rootDirectory - Path to function code in the template repo.
363
- * @param {string} params.version - Version (tag) for the repo linked to the function template.
364
+ * @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
365
+ * @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
364
366
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
365
367
  * @throws {AppwriteException}
366
368
  * @returns {Promise<Models.Deployment>}
@@ -370,7 +372,8 @@ declare class Functions {
370
372
  repository: string;
371
373
  owner: string;
372
374
  rootDirectory: string;
373
- version: string;
375
+ type: TemplateReferenceType;
376
+ reference: string;
374
377
  activate?: boolean;
375
378
  }): Promise<Models.Deployment>;
376
379
  /**
@@ -382,20 +385,21 @@ declare class Functions {
382
385
  * @param {string} repository - Repository name of the template.
383
386
  * @param {string} owner - The name of the owner of the template.
384
387
  * @param {string} rootDirectory - Path to function code in the template repo.
385
- * @param {string} version - Version (tag) for the repo linked to the function template.
388
+ * @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
389
+ * @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
386
390
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
387
391
  * @throws {AppwriteException}
388
392
  * @returns {Promise<Models.Deployment>}
389
393
  * @deprecated Use the object parameter style method for a better developer experience.
390
394
  */
391
- createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise<Models.Deployment>;
395
+ createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
392
396
  /**
393
397
  * Create a deployment when a function is connected to VCS.
394
398
  *
395
399
  * This endpoint lets you create deployment from a branch, commit, or a tag.
396
400
  *
397
401
  * @param {string} params.functionId - Function ID.
398
- * @param {VCSDeploymentType} params.type - Type of reference passed. Allowed values are: branch, commit
402
+ * @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
399
403
  * @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
400
404
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
401
405
  * @throws {AppwriteException}
@@ -403,7 +407,7 @@ declare class Functions {
403
407
  */
404
408
  createVcsDeployment(params: {
405
409
  functionId: string;
406
- type: VCSDeploymentType;
410
+ type: VCSReferenceType;
407
411
  reference: string;
408
412
  activate?: boolean;
409
413
  }): Promise<Models.Deployment>;
@@ -413,14 +417,14 @@ declare class Functions {
413
417
  * This endpoint lets you create deployment from a branch, commit, or a tag.
414
418
  *
415
419
  * @param {string} functionId - Function ID.
416
- * @param {VCSDeploymentType} type - Type of reference passed. Allowed values are: branch, commit
420
+ * @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
417
421
  * @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
418
422
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
419
423
  * @throws {AppwriteException}
420
424
  * @returns {Promise<Models.Deployment>}
421
425
  * @deprecated Use the object parameter style method for a better developer experience.
422
426
  */
423
- createVcsDeployment(functionId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise<Models.Deployment>;
427
+ createVcsDeployment(functionId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
424
428
  /**
425
429
  * Get a function deployment by its unique ID.
426
430
  *
@@ -538,15 +538,17 @@ class Functions {
538
538
  repository: rest[0],
539
539
  owner: rest[1],
540
540
  rootDirectory: rest[2],
541
- version: rest[3],
542
- activate: rest[4]
541
+ type: rest[3],
542
+ reference: rest[4],
543
+ activate: rest[5]
543
544
  };
544
545
  }
545
546
  const functionId = params.functionId;
546
547
  const repository = params.repository;
547
548
  const owner = params.owner;
548
549
  const rootDirectory = params.rootDirectory;
549
- const version = params.version;
550
+ const type = params.type;
551
+ const reference = params.reference;
550
552
  const activate = params.activate;
551
553
  if (typeof functionId === "undefined") {
552
554
  throw new client.AppwriteException('Missing required parameter: "functionId"');
@@ -560,8 +562,11 @@ class Functions {
560
562
  if (typeof rootDirectory === "undefined") {
561
563
  throw new client.AppwriteException('Missing required parameter: "rootDirectory"');
562
564
  }
563
- if (typeof version === "undefined") {
564
- throw new client.AppwriteException('Missing required parameter: "version"');
565
+ if (typeof type === "undefined") {
566
+ throw new client.AppwriteException('Missing required parameter: "type"');
567
+ }
568
+ if (typeof reference === "undefined") {
569
+ throw new client.AppwriteException('Missing required parameter: "reference"');
565
570
  }
566
571
  const apiPath = "/functions/{functionId}/deployments/template".replace("{functionId}", functionId);
567
572
  const payload = {};
@@ -574,8 +579,11 @@ class Functions {
574
579
  if (typeof rootDirectory !== "undefined") {
575
580
  payload["rootDirectory"] = rootDirectory;
576
581
  }
577
- if (typeof version !== "undefined") {
578
- payload["version"] = version;
582
+ if (typeof type !== "undefined") {
583
+ payload["type"] = type;
584
+ }
585
+ if (typeof reference !== "undefined") {
586
+ payload["reference"] = reference;
579
587
  }
580
588
  if (typeof activate !== "undefined") {
581
589
  payload["activate"] = activate;