@appwrite.io/console 1.1.0-rc.2 → 1.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 (115) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +2196 -3306
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +2197 -3305
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +2196 -3306
  7. package/docs/examples/account/delete-mfa-authenticator.md +1 -2
  8. package/docs/examples/databases/update-boolean-attribute.md +2 -1
  9. package/docs/examples/databases/update-datetime-attribute.md +2 -1
  10. package/docs/examples/databases/update-email-attribute.md +2 -1
  11. package/docs/examples/databases/update-enum-attribute.md +2 -1
  12. package/docs/examples/databases/update-float-attribute.md +2 -1
  13. package/docs/examples/databases/update-integer-attribute.md +2 -1
  14. package/docs/examples/databases/update-ip-attribute.md +2 -1
  15. package/docs/examples/databases/update-relationship-attribute.md +2 -1
  16. package/docs/examples/databases/update-string-attribute.md +3 -1
  17. package/docs/examples/databases/update-url-attribute.md +2 -1
  18. package/docs/examples/functions/create-build.md +1 -1
  19. package/docs/examples/functions/create-execution.md +2 -1
  20. package/docs/examples/functions/create.md +3 -1
  21. package/docs/examples/functions/delete-execution.md +14 -0
  22. package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
  23. package/docs/examples/{account/list-billing-addresses.md → functions/get-template.md} +4 -4
  24. package/docs/examples/{account/create-payment-method.md → functions/list-specifications.md} +3 -3
  25. package/docs/examples/functions/list-templates.md +16 -0
  26. package/docs/examples/functions/update-deployment-build.md +14 -0
  27. package/docs/examples/functions/update.md +3 -1
  28. package/docs/examples/projects/create-j-w-t.md +15 -0
  29. package/docs/examples/projects/update-mock-numbers.md +14 -0
  30. package/docs/examples/projects/update-session-alerts.md +14 -0
  31. package/docs/examples/users/create-j-w-t.md +15 -0
  32. package/docs/examples/vcs/get-repository-contents.md +15 -0
  33. package/package.json +1 -1
  34. package/src/client.ts +2 -2
  35. package/src/enums/email-template-type.ts +2 -0
  36. package/src/enums/platform-type.ts +2 -0
  37. package/src/enums/runtime.ts +1 -0
  38. package/src/index.ts +1 -4
  39. package/src/models.ts +286 -960
  40. package/src/services/account.ts +2 -345
  41. package/src/services/console.ts +0 -120
  42. package/src/services/databases.ts +54 -10
  43. package/src/services/functions.ts +195 -14
  44. package/src/services/projects.ts +110 -1
  45. package/src/services/users.ts +37 -0
  46. package/src/services/vcs.ts +36 -0
  47. package/types/enums/email-template-type.d.ts +3 -1
  48. package/types/enums/platform-type.d.ts +3 -1
  49. package/types/enums/runtime.d.ts +2 -1
  50. package/types/index.d.ts +1 -4
  51. package/types/models.d.ts +286 -960
  52. package/types/services/account.d.ts +1 -105
  53. package/types/services/console.d.ts +0 -38
  54. package/types/services/databases.d.ts +21 -10
  55. package/types/services/functions.d.ts +67 -8
  56. package/types/services/projects.d.ts +32 -1
  57. package/types/services/users.d.ts +12 -0
  58. package/types/services/vcs.d.ts +11 -0
  59. package/docs/examples/account/delete-payment-method.md +0 -13
  60. package/docs/examples/account/get-billing-address.md +0 -13
  61. package/docs/examples/account/get-payment-method.md +0 -13
  62. package/docs/examples/account/list-credits.md +0 -14
  63. package/docs/examples/account/list-invoices.md +0 -13
  64. package/docs/examples/account/list-payment-methods.md +0 -13
  65. package/docs/examples/account/update-payment-method-mandate-options.md +0 -13
  66. package/docs/examples/account/update-payment-method-provider.md +0 -15
  67. package/docs/examples/account/update-payment-method.md +0 -15
  68. package/docs/examples/backups/create-archive.md +0 -14
  69. package/docs/examples/backups/create-policy.md +0 -19
  70. package/docs/examples/backups/create-restoration.md +0 -16
  71. package/docs/examples/backups/delete-archive.md +0 -13
  72. package/docs/examples/backups/delete-policy.md +0 -13
  73. package/docs/examples/backups/get-archive.md +0 -13
  74. package/docs/examples/backups/get-policy.md +0 -13
  75. package/docs/examples/backups/get-restoration.md +0 -13
  76. package/docs/examples/backups/list-archives.md +0 -13
  77. package/docs/examples/backups/list-policies.md +0 -13
  78. package/docs/examples/backups/list-restorations.md +0 -13
  79. package/docs/examples/backups/update-policy.md +0 -17
  80. package/docs/examples/console/create-source.md +0 -17
  81. package/docs/examples/console/get-copon.md +0 -13
  82. package/docs/examples/console/plans.md +0 -11
  83. package/docs/examples/console/regions.md +0 -11
  84. package/docs/examples/organizations/add-credit.md +0 -14
  85. package/docs/examples/organizations/create-invoice-payment.md +0 -15
  86. package/docs/examples/organizations/create.md +0 -17
  87. package/docs/examples/organizations/delete-backup-payment-method.md +0 -13
  88. package/docs/examples/organizations/delete-billing-address.md +0 -13
  89. package/docs/examples/organizations/delete-default-payment-method.md +0 -13
  90. package/docs/examples/organizations/delete.md +0 -13
  91. package/docs/examples/organizations/get-aggregation.md +0 -14
  92. package/docs/examples/organizations/get-billing-address.md +0 -14
  93. package/docs/examples/organizations/get-credit.md +0 -14
  94. package/docs/examples/organizations/get-invoice-download.md +0 -14
  95. package/docs/examples/organizations/get-invoice-view.md +0 -14
  96. package/docs/examples/organizations/get-invoice.md +0 -14
  97. package/docs/examples/organizations/get-payment-method.md +0 -14
  98. package/docs/examples/organizations/get-plan.md +0 -13
  99. package/docs/examples/organizations/get-usage.md +0 -15
  100. package/docs/examples/organizations/list-aggregations.md +0 -14
  101. package/docs/examples/organizations/list-invoices.md +0 -14
  102. package/docs/examples/organizations/list.md +0 -14
  103. package/docs/examples/organizations/set-backup-payment-method.md +0 -14
  104. package/docs/examples/organizations/set-billing-address.md +0 -14
  105. package/docs/examples/organizations/set-billing-email.md +0 -14
  106. package/docs/examples/organizations/set-billing-tax-id.md +0 -14
  107. package/docs/examples/organizations/set-default-payment-method.md +0 -14
  108. package/docs/examples/organizations/update-budget.md +0 -15
  109. package/docs/examples/organizations/update-plan.md +0 -16
  110. package/src/enums/billing-plan.ts +0 -5
  111. package/src/services/backups.ts +0 -425
  112. package/src/services/organizations.ts +0 -896
  113. package/types/enums/billing-plan.d.ts +0 -5
  114. package/types/services/backups.d.ts +0 -128
  115. package/types/services/organizations.d.ts +0 -273
@@ -439,6 +439,41 @@ export class Projects {
439
439
  }
440
440
 
441
441
 
442
+ return await this.client.call(
443
+ 'patch',
444
+ uri,
445
+ apiHeaders,
446
+ payload
447
+ );
448
+ }
449
+ /**
450
+ * Update the mock numbers for the project
451
+ *
452
+ *
453
+ * @param {string} projectId
454
+ * @param {object[]} numbers
455
+ * @throws {AppwriteException}
456
+ * @returns {Promise<Models.Project>}
457
+ */
458
+ async updateMockNumbers(projectId: string, numbers: object[]): Promise<Models.Project> {
459
+ if (typeof projectId === 'undefined') {
460
+ throw new AppwriteException('Missing required parameter: "projectId"');
461
+ }
462
+ if (typeof numbers === 'undefined') {
463
+ throw new AppwriteException('Missing required parameter: "numbers"');
464
+ }
465
+ const apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId);
466
+ const payload: Payload = {};
467
+ if (typeof numbers !== 'undefined') {
468
+ payload['numbers'] = numbers;
469
+ }
470
+ const uri = new URL(this.client.config.endpoint + apiPath);
471
+
472
+ const apiHeaders: { [header: string]: string } = {
473
+ 'content-type': 'application/json',
474
+ }
475
+
476
+
442
477
  return await this.client.call(
443
478
  'patch',
444
479
  uri,
@@ -544,6 +579,41 @@ export class Projects {
544
579
  }
545
580
 
546
581
 
582
+ return await this.client.call(
583
+ 'patch',
584
+ uri,
585
+ apiHeaders,
586
+ payload
587
+ );
588
+ }
589
+ /**
590
+ * Update project sessions emails
591
+ *
592
+ *
593
+ * @param {string} projectId
594
+ * @param {boolean} alerts
595
+ * @throws {AppwriteException}
596
+ * @returns {Promise<Models.Project>}
597
+ */
598
+ async updateSessionAlerts(projectId: string, alerts: boolean): Promise<Models.Project> {
599
+ if (typeof projectId === 'undefined') {
600
+ throw new AppwriteException('Missing required parameter: "projectId"');
601
+ }
602
+ if (typeof alerts === 'undefined') {
603
+ throw new AppwriteException('Missing required parameter: "alerts"');
604
+ }
605
+ const apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId);
606
+ const payload: Payload = {};
607
+ if (typeof alerts !== 'undefined') {
608
+ payload['alerts'] = alerts;
609
+ }
610
+ const uri = new URL(this.client.config.endpoint + apiPath);
611
+
612
+ const apiHeaders: { [header: string]: string } = {
613
+ 'content-type': 'application/json',
614
+ }
615
+
616
+
547
617
  return await this.client.call(
548
618
  'patch',
549
619
  uri,
@@ -590,6 +660,45 @@ export class Projects {
590
660
  payload
591
661
  );
592
662
  }
663
+ /**
664
+ * Create JWT
665
+ *
666
+ *
667
+ * @param {string} projectId
668
+ * @param {string[]} scopes
669
+ * @param {number} duration
670
+ * @throws {AppwriteException}
671
+ * @returns {Promise<Models.Jwt>}
672
+ */
673
+ async createJWT(projectId: string, scopes: string[], duration?: number): Promise<Models.Jwt> {
674
+ if (typeof projectId === 'undefined') {
675
+ throw new AppwriteException('Missing required parameter: "projectId"');
676
+ }
677
+ if (typeof scopes === 'undefined') {
678
+ throw new AppwriteException('Missing required parameter: "scopes"');
679
+ }
680
+ const apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId);
681
+ const payload: Payload = {};
682
+ if (typeof scopes !== 'undefined') {
683
+ payload['scopes'] = scopes;
684
+ }
685
+ if (typeof duration !== 'undefined') {
686
+ payload['duration'] = duration;
687
+ }
688
+ const uri = new URL(this.client.config.endpoint + apiPath);
689
+
690
+ const apiHeaders: { [header: string]: string } = {
691
+ 'content-type': 'application/json',
692
+ }
693
+
694
+
695
+ return await this.client.call(
696
+ 'post',
697
+ uri,
698
+ apiHeaders,
699
+ payload
700
+ );
701
+ }
593
702
  /**
594
703
  * List keys
595
704
  *
@@ -1243,7 +1352,7 @@ export class Projects {
1243
1352
  );
1244
1353
  }
1245
1354
  /**
1246
- * Update Project Team
1355
+ * Update project team
1247
1356
  *
1248
1357
  *
1249
1358
  * @param {string} projectId
@@ -688,6 +688,43 @@ export class Users {
688
688
  payload
689
689
  );
690
690
  }
691
+ /**
692
+ * Create user JWT
693
+ *
694
+ * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
695
+ *
696
+ * @param {string} userId
697
+ * @param {string} sessionId
698
+ * @param {number} duration
699
+ * @throws {AppwriteException}
700
+ * @returns {Promise<Models.Jwt>}
701
+ */
702
+ async createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt> {
703
+ if (typeof userId === 'undefined') {
704
+ throw new AppwriteException('Missing required parameter: "userId"');
705
+ }
706
+ const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
707
+ const payload: Payload = {};
708
+ if (typeof sessionId !== 'undefined') {
709
+ payload['sessionId'] = sessionId;
710
+ }
711
+ if (typeof duration !== 'undefined') {
712
+ payload['duration'] = duration;
713
+ }
714
+ const uri = new URL(this.client.config.endpoint + apiPath);
715
+
716
+ const apiHeaders: { [header: string]: string } = {
717
+ 'content-type': 'application/json',
718
+ }
719
+
720
+
721
+ return await this.client.call(
722
+ 'post',
723
+ uri,
724
+ apiHeaders,
725
+ payload
726
+ );
727
+ }
691
728
  /**
692
729
  * Update user labels
693
730
  *
@@ -140,6 +140,42 @@ export class Vcs {
140
140
  }
141
141
 
142
142
 
143
+ return await this.client.call(
144
+ 'get',
145
+ uri,
146
+ apiHeaders,
147
+ payload
148
+ );
149
+ }
150
+ /**
151
+ * Get files and directories of a VCS repository
152
+ *
153
+ *
154
+ * @param {string} installationId
155
+ * @param {string} providerRepositoryId
156
+ * @param {string} providerRootDirectory
157
+ * @throws {AppwriteException}
158
+ * @returns {Promise<Models.VcsContentList>}
159
+ */
160
+ async getRepositoryContents(installationId: string, providerRepositoryId: string, providerRootDirectory?: string): Promise<Models.VcsContentList> {
161
+ if (typeof installationId === 'undefined') {
162
+ throw new AppwriteException('Missing required parameter: "installationId"');
163
+ }
164
+ if (typeof providerRepositoryId === 'undefined') {
165
+ throw new AppwriteException('Missing required parameter: "providerRepositoryId"');
166
+ }
167
+ const apiPath = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/contents'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId);
168
+ const payload: Payload = {};
169
+ if (typeof providerRootDirectory !== 'undefined') {
170
+ payload['providerRootDirectory'] = providerRootDirectory;
171
+ }
172
+ const uri = new URL(this.client.config.endpoint + apiPath);
173
+
174
+ const apiHeaders: { [header: string]: string } = {
175
+ 'content-type': 'application/json',
176
+ }
177
+
178
+
143
179
  return await this.client.call(
144
180
  'get',
145
181
  uri,
@@ -3,5 +3,7 @@ export declare enum EmailTemplateType {
3
3
  Magicsession = "magicsession",
4
4
  Recovery = "recovery",
5
5
  Invitation = "invitation",
6
- Mfachallenge = "mfachallenge"
6
+ Mfachallenge = "mfachallenge",
7
+ Sessionalert = "sessionalert",
8
+ Otpsession = "otpsession"
7
9
  }
@@ -11,5 +11,7 @@ export declare enum PlatformType {
11
11
  Applewatchos = "apple-watchos",
12
12
  Appletvos = "apple-tvos",
13
13
  Android = "android",
14
- Unity = "unity"
14
+ Unity = "unity",
15
+ Reactnativeios = "react-native-ios",
16
+ Reactnativeandroid = "react-native-android"
15
17
  }
@@ -43,5 +43,6 @@ export declare enum Runtime {
43
43
  Kotlin19 = "kotlin-1.9",
44
44
  Cpp17 = "cpp-17",
45
45
  Cpp20 = "cpp-20",
46
- Bun10 = "bun-1.0"
46
+ Bun10 = "bun-1.0",
47
+ Go123 = "go-1.23"
47
48
  }
package/types/index.d.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  /**
2
2
  * Appwrite Console SDK
3
3
  *
4
- * This SDK is compatible with Appwrite server version 1.5.x.
4
+ * This SDK is compatible with Appwrite server version 1.6.x.
5
5
  * For older versions, please check
6
6
  * [previous releases](https://github.com/appwrite/sdk-for-console/releases).
7
7
  */
8
8
  export { Client, Query, AppwriteException } from './client';
9
9
  export { Account } from './services/account';
10
10
  export { Avatars } from './services/avatars';
11
- export { Backups } from './services/backups';
12
11
  export { Assistant } from './services/assistant';
13
12
  export { Console } from './services/console';
14
13
  export { Databases } from './services/databases';
@@ -18,7 +17,6 @@ export { Health } from './services/health';
18
17
  export { Locale } from './services/locale';
19
18
  export { Messaging } from './services/messaging';
20
19
  export { Migrations } from './services/migrations';
21
- export { Organizations } from './services/organizations';
22
20
  export { Project } from './services/project';
23
21
  export { Projects } from './services/projects';
24
22
  export { Proxy } from './services/proxy';
@@ -46,7 +44,6 @@ export { FunctionUsageRange } from './enums/function-usage-range';
46
44
  export { ExecutionMethod } from './enums/execution-method';
47
45
  export { Name } from './enums/name';
48
46
  export { SmtpEncryption } from './enums/smtp-encryption';
49
- export { BillingPlan } from './enums/billing-plan';
50
47
  export { ProjectUsageRange } from './enums/project-usage-range';
51
48
  export { Region } from './enums/region';
52
49
  export { Api } from './enums/api';