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
@@ -3,7 +3,8 @@ import { Models } from '../models.mjs';
3
3
  import { Framework } from '../enums/framework.mjs';
4
4
  import { BuildRuntime } from '../enums/build-runtime.mjs';
5
5
  import { Adapter } from '../enums/adapter.mjs';
6
- import { VCSDeploymentType } from '../enums/vcs-deployment-type.mjs';
6
+ import { TemplateReferenceType } from '../enums/template-reference-type.mjs';
7
+ import { VCSReferenceType } from '../enums/vcs-reference-type.mjs';
7
8
  import { DeploymentDownloadType } from '../enums/deployment-download-type.mjs';
8
9
  import '../query.mjs';
9
10
  import '../enums/database-type.mjs';
@@ -288,7 +289,7 @@ declare class Sites {
288
289
  */
289
290
  listDeployments(siteId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
290
291
  /**
291
- * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.
292
+ * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
292
293
  *
293
294
  * @param {string} params.siteId - Site ID.
294
295
  * @param {File} params.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.
@@ -309,7 +310,7 @@ declare class Sites {
309
310
  onProgress?: (progress: UploadProgress) => void;
310
311
  }): Promise<Models.Deployment>;
311
312
  /**
312
- * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.
313
+ * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
313
314
  *
314
315
  * @param {string} siteId - Site ID.
315
316
  * @param {File} 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.
@@ -353,7 +354,8 @@ declare class Sites {
353
354
  * @param {string} params.repository - Repository name of the template.
354
355
  * @param {string} params.owner - The name of the owner of the template.
355
356
  * @param {string} params.rootDirectory - Path to site code in the template repo.
356
- * @param {string} params.version - Version (tag) for the repo linked to the site template.
357
+ * @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
358
+ * @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
357
359
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
358
360
  * @throws {AppwriteException}
359
361
  * @returns {Promise<Models.Deployment>}
@@ -363,7 +365,8 @@ declare class Sites {
363
365
  repository: string;
364
366
  owner: string;
365
367
  rootDirectory: string;
366
- version: string;
368
+ type: TemplateReferenceType;
369
+ reference: string;
367
370
  activate?: boolean;
368
371
  }): Promise<Models.Deployment>;
369
372
  /**
@@ -375,20 +378,21 @@ declare class Sites {
375
378
  * @param {string} repository - Repository name of the template.
376
379
  * @param {string} owner - The name of the owner of the template.
377
380
  * @param {string} rootDirectory - Path to site code in the template repo.
378
- * @param {string} version - Version (tag) for the repo linked to the site template.
381
+ * @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
382
+ * @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
379
383
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
380
384
  * @throws {AppwriteException}
381
385
  * @returns {Promise<Models.Deployment>}
382
386
  * @deprecated Use the object parameter style method for a better developer experience.
383
387
  */
384
- createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise<Models.Deployment>;
388
+ createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
385
389
  /**
386
390
  * Create a deployment when a site is connected to VCS.
387
391
  *
388
392
  * This endpoint lets you create deployment from a branch, commit, or a tag.
389
393
  *
390
394
  * @param {string} params.siteId - Site ID.
391
- * @param {VCSDeploymentType} params.type - Type of reference passed. Allowed values are: branch, commit
395
+ * @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
392
396
  * @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
393
397
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
394
398
  * @throws {AppwriteException}
@@ -396,7 +400,7 @@ declare class Sites {
396
400
  */
397
401
  createVcsDeployment(params: {
398
402
  siteId: string;
399
- type: VCSDeploymentType;
403
+ type: VCSReferenceType;
400
404
  reference: string;
401
405
  activate?: boolean;
402
406
  }): Promise<Models.Deployment>;
@@ -406,14 +410,14 @@ declare class Sites {
406
410
  * This endpoint lets you create deployment from a branch, commit, or a tag.
407
411
  *
408
412
  * @param {string} siteId - Site ID.
409
- * @param {VCSDeploymentType} type - Type of reference passed. Allowed values are: branch, commit
413
+ * @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
410
414
  * @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
411
415
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
412
416
  * @throws {AppwriteException}
413
417
  * @returns {Promise<Models.Deployment>}
414
418
  * @deprecated Use the object parameter style method for a better developer experience.
415
419
  */
416
- createVcsDeployment(siteId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise<Models.Deployment>;
420
+ createVcsDeployment(siteId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
417
421
  /**
418
422
  * Get a site deployment by its unique ID.
419
423
  *
@@ -3,7 +3,8 @@ import { Models } from '../models.js';
3
3
  import { Framework } from '../enums/framework.js';
4
4
  import { BuildRuntime } from '../enums/build-runtime.js';
5
5
  import { Adapter } from '../enums/adapter.js';
6
- import { VCSDeploymentType } from '../enums/vcs-deployment-type.js';
6
+ import { TemplateReferenceType } from '../enums/template-reference-type.js';
7
+ import { VCSReferenceType } from '../enums/vcs-reference-type.js';
7
8
  import { DeploymentDownloadType } from '../enums/deployment-download-type.js';
8
9
  import '../query.js';
9
10
  import '../enums/database-type.js';
@@ -288,7 +289,7 @@ declare class Sites {
288
289
  */
289
290
  listDeployments(siteId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
290
291
  /**
291
- * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.
292
+ * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
292
293
  *
293
294
  * @param {string} params.siteId - Site ID.
294
295
  * @param {File} params.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.
@@ -309,7 +310,7 @@ declare class Sites {
309
310
  onProgress?: (progress: UploadProgress) => void;
310
311
  }): Promise<Models.Deployment>;
311
312
  /**
312
- * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.
313
+ * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
313
314
  *
314
315
  * @param {string} siteId - Site ID.
315
316
  * @param {File} 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.
@@ -353,7 +354,8 @@ declare class Sites {
353
354
  * @param {string} params.repository - Repository name of the template.
354
355
  * @param {string} params.owner - The name of the owner of the template.
355
356
  * @param {string} params.rootDirectory - Path to site code in the template repo.
356
- * @param {string} params.version - Version (tag) for the repo linked to the site template.
357
+ * @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
358
+ * @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
357
359
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
358
360
  * @throws {AppwriteException}
359
361
  * @returns {Promise<Models.Deployment>}
@@ -363,7 +365,8 @@ declare class Sites {
363
365
  repository: string;
364
366
  owner: string;
365
367
  rootDirectory: string;
366
- version: string;
368
+ type: TemplateReferenceType;
369
+ reference: string;
367
370
  activate?: boolean;
368
371
  }): Promise<Models.Deployment>;
369
372
  /**
@@ -375,20 +378,21 @@ declare class Sites {
375
378
  * @param {string} repository - Repository name of the template.
376
379
  * @param {string} owner - The name of the owner of the template.
377
380
  * @param {string} rootDirectory - Path to site code in the template repo.
378
- * @param {string} version - Version (tag) for the repo linked to the site template.
381
+ * @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
382
+ * @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
379
383
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
380
384
  * @throws {AppwriteException}
381
385
  * @returns {Promise<Models.Deployment>}
382
386
  * @deprecated Use the object parameter style method for a better developer experience.
383
387
  */
384
- createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise<Models.Deployment>;
388
+ createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
385
389
  /**
386
390
  * Create a deployment when a site is connected to VCS.
387
391
  *
388
392
  * This endpoint lets you create deployment from a branch, commit, or a tag.
389
393
  *
390
394
  * @param {string} params.siteId - Site ID.
391
- * @param {VCSDeploymentType} params.type - Type of reference passed. Allowed values are: branch, commit
395
+ * @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
392
396
  * @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
393
397
  * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
394
398
  * @throws {AppwriteException}
@@ -396,7 +400,7 @@ declare class Sites {
396
400
  */
397
401
  createVcsDeployment(params: {
398
402
  siteId: string;
399
- type: VCSDeploymentType;
403
+ type: VCSReferenceType;
400
404
  reference: string;
401
405
  activate?: boolean;
402
406
  }): Promise<Models.Deployment>;
@@ -406,14 +410,14 @@ declare class Sites {
406
410
  * This endpoint lets you create deployment from a branch, commit, or a tag.
407
411
  *
408
412
  * @param {string} siteId - Site ID.
409
- * @param {VCSDeploymentType} type - Type of reference passed. Allowed values are: branch, commit
413
+ * @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
410
414
  * @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
411
415
  * @param {boolean} activate - Automatically activate the deployment when it is finished building.
412
416
  * @throws {AppwriteException}
413
417
  * @returns {Promise<Models.Deployment>}
414
418
  * @deprecated Use the object parameter style method for a better developer experience.
415
419
  */
416
- createVcsDeployment(siteId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise<Models.Deployment>;
420
+ createVcsDeployment(siteId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
417
421
  /**
418
422
  * Get a site deployment by its unique ID.
419
423
  *
@@ -544,15 +544,17 @@ class Sites {
544
544
  repository: rest[0],
545
545
  owner: rest[1],
546
546
  rootDirectory: rest[2],
547
- version: rest[3],
548
- activate: rest[4]
547
+ type: rest[3],
548
+ reference: rest[4],
549
+ activate: rest[5]
549
550
  };
550
551
  }
551
552
  const siteId = params.siteId;
552
553
  const repository = params.repository;
553
554
  const owner = params.owner;
554
555
  const rootDirectory = params.rootDirectory;
555
- const version = params.version;
556
+ const type = params.type;
557
+ const reference = params.reference;
556
558
  const activate = params.activate;
557
559
  if (typeof siteId === "undefined") {
558
560
  throw new client.AppwriteException('Missing required parameter: "siteId"');
@@ -566,8 +568,11 @@ class Sites {
566
568
  if (typeof rootDirectory === "undefined") {
567
569
  throw new client.AppwriteException('Missing required parameter: "rootDirectory"');
568
570
  }
569
- if (typeof version === "undefined") {
570
- throw new client.AppwriteException('Missing required parameter: "version"');
571
+ if (typeof type === "undefined") {
572
+ throw new client.AppwriteException('Missing required parameter: "type"');
573
+ }
574
+ if (typeof reference === "undefined") {
575
+ throw new client.AppwriteException('Missing required parameter: "reference"');
571
576
  }
572
577
  const apiPath = "/sites/{siteId}/deployments/template".replace("{siteId}", siteId);
573
578
  const payload = {};
@@ -580,8 +585,11 @@ class Sites {
580
585
  if (typeof rootDirectory !== "undefined") {
581
586
  payload["rootDirectory"] = rootDirectory;
582
587
  }
583
- if (typeof version !== "undefined") {
584
- payload["version"] = version;
588
+ if (typeof type !== "undefined") {
589
+ payload["type"] = type;
590
+ }
591
+ if (typeof reference !== "undefined") {
592
+ payload["reference"] = reference;
585
593
  }
586
594
  if (typeof activate !== "undefined") {
587
595
  payload["activate"] = activate;