@appwrite.io/console 2.1.2 → 2.2.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 (137) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +2099 -520
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +2098 -521
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +2003 -444
  8. package/docs/examples/account/create-key.md +15 -0
  9. package/docs/examples/account/delete-key.md +13 -0
  10. package/docs/examples/account/get-key.md +13 -0
  11. package/docs/examples/account/list-keys.md +13 -0
  12. package/docs/examples/account/update-key.md +16 -0
  13. package/docs/examples/avatars/get-screenshot.md +5 -5
  14. package/docs/examples/backups/create-archive.md +2 -2
  15. package/docs/examples/backups/create-policy.md +2 -2
  16. package/docs/examples/backups/create-restoration.md +2 -2
  17. package/docs/examples/console/{get-regions.md → list-regions.md} +1 -3
  18. package/docs/examples/databases/create-index.md +2 -2
  19. package/docs/examples/databases/create-longtext-attribute.md +18 -0
  20. package/docs/examples/databases/create-mediumtext-attribute.md +18 -0
  21. package/docs/examples/databases/create-text-attribute.md +18 -0
  22. package/docs/examples/databases/create-varchar-attribute.md +19 -0
  23. package/docs/examples/databases/update-collection.md +1 -1
  24. package/docs/examples/databases/update-longtext-attribute.md +18 -0
  25. package/docs/examples/databases/update-mediumtext-attribute.md +18 -0
  26. package/docs/examples/databases/update-text-attribute.md +18 -0
  27. package/docs/examples/databases/update-varchar-attribute.md +19 -0
  28. package/docs/examples/databases/update.md +1 -1
  29. package/docs/examples/functions/create.md +2 -2
  30. package/docs/examples/functions/list-templates.md +3 -3
  31. package/docs/examples/functions/update.md +2 -2
  32. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  33. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  34. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  35. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  36. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  37. package/docs/examples/migrations/get-firebase-report.md +2 -2
  38. package/docs/examples/migrations/get-n-host-report.md +2 -2
  39. package/docs/examples/migrations/get-supabase-report.md +2 -2
  40. package/docs/examples/organizations/create-key.md +16 -0
  41. package/docs/examples/organizations/create.md +2 -2
  42. package/docs/examples/organizations/delete-key.md +14 -0
  43. package/docs/examples/organizations/estimation-create-organization.md +2 -2
  44. package/docs/examples/organizations/estimation-update-plan.md +2 -2
  45. package/docs/examples/organizations/get-key.md +14 -0
  46. package/docs/examples/organizations/list-keys.md +14 -0
  47. package/docs/examples/organizations/list-regions.md +13 -0
  48. package/docs/examples/organizations/update-key.md +17 -0
  49. package/docs/examples/organizations/update-plan.md +2 -2
  50. package/docs/examples/projects/create-jwt.md +2 -2
  51. package/docs/examples/projects/create-key.md +2 -2
  52. package/docs/examples/projects/update-key.md +2 -2
  53. package/docs/examples/sites/list-templates.md +3 -3
  54. package/docs/examples/tablesdb/create-index.md +2 -2
  55. package/docs/examples/tablesdb/create-longtext-column.md +18 -0
  56. package/docs/examples/tablesdb/create-mediumtext-column.md +18 -0
  57. package/docs/examples/tablesdb/create-text-column.md +18 -0
  58. package/docs/examples/tablesdb/create-varchar-column.md +19 -0
  59. package/docs/examples/tablesdb/update-longtext-column.md +18 -0
  60. package/docs/examples/tablesdb/update-mediumtext-column.md +18 -0
  61. package/docs/examples/tablesdb/update-table.md +1 -1
  62. package/docs/examples/tablesdb/update-text-column.md +18 -0
  63. package/docs/examples/tablesdb/update-varchar-column.md +19 -0
  64. package/docs/examples/tablesdb/update.md +1 -1
  65. package/docs/examples/teams/create-membership.md +2 -2
  66. package/docs/examples/teams/update-membership.md +2 -2
  67. package/package.json +3 -2
  68. package/src/channel.ts +138 -0
  69. package/src/client.ts +54 -9
  70. package/src/enums/browser-permission.ts +22 -0
  71. package/src/enums/deployment-status.ts +1 -0
  72. package/src/enums/frameworks.ts +17 -0
  73. package/src/enums/order-by.ts +4 -0
  74. package/src/enums/resources.ts +13 -0
  75. package/src/enums/roles.ts +7 -0
  76. package/src/enums/runtimes.ts +66 -0
  77. package/src/enums/scopes.ts +65 -0
  78. package/src/enums/services.ts +5 -0
  79. package/src/enums/use-cases.ts +11 -0
  80. package/src/index.ts +10 -1
  81. package/src/models.ts +349 -1
  82. package/src/query.ts +42 -0
  83. package/src/services/account.ts +364 -56
  84. package/src/services/assistant.ts +1 -1
  85. package/src/services/avatars.ts +17 -16
  86. package/src/services/backups.ts +37 -36
  87. package/src/services/console.ts +11 -42
  88. package/src/services/databases.ts +1060 -280
  89. package/src/services/domains.ts +44 -44
  90. package/src/services/functions.ts +60 -57
  91. package/src/services/graphql.ts +2 -2
  92. package/src/services/health.ts +22 -20
  93. package/src/services/messaging.ts +56 -56
  94. package/src/services/migrations.ts +79 -78
  95. package/src/services/organizations.ts +466 -70
  96. package/src/services/project.ts +5 -5
  97. package/src/services/projects.ts +86 -85
  98. package/src/services/proxy.ts +8 -8
  99. package/src/services/realtime.ts +35 -12
  100. package/src/services/sites.ts +42 -40
  101. package/src/services/storage.ts +16 -16
  102. package/src/services/tables-db.ts +1050 -268
  103. package/src/services/teams.ts +31 -30
  104. package/src/services/tokens.ts +5 -5
  105. package/src/services/users.ts +49 -49
  106. package/src/services/vcs.ts +10 -10
  107. package/types/channel.d.ts +72 -0
  108. package/types/client.d.ts +11 -3
  109. package/types/enums/browser-permission.d.ts +22 -0
  110. package/types/enums/deployment-status.d.ts +1 -0
  111. package/types/enums/frameworks.d.ts +17 -0
  112. package/types/enums/order-by.d.ts +4 -0
  113. package/types/enums/resources.d.ts +13 -0
  114. package/types/enums/roles.d.ts +7 -0
  115. package/types/enums/runtimes.d.ts +66 -0
  116. package/types/enums/scopes.d.ts +65 -0
  117. package/types/enums/services.d.ts +5 -0
  118. package/types/enums/use-cases.d.ts +11 -0
  119. package/types/index.d.ts +10 -1
  120. package/types/models.d.ts +341 -1
  121. package/types/query.d.ts +30 -0
  122. package/types/services/account.d.ts +111 -0
  123. package/types/services/avatars.d.ts +5 -4
  124. package/types/services/backups.d.ts +13 -12
  125. package/types/services/console.d.ts +1 -13
  126. package/types/services/databases.d.ts +303 -8
  127. package/types/services/functions.d.ts +18 -15
  128. package/types/services/health.d.ts +2 -0
  129. package/types/services/migrations.d.ts +33 -32
  130. package/types/services/organizations.d.ts +161 -17
  131. package/types/services/projects.d.ts +13 -12
  132. package/types/services/realtime.d.ts +17 -8
  133. package/types/services/sites.d.ts +9 -7
  134. package/types/services/tables-db.d.ts +305 -8
  135. package/types/services/teams.d.ts +9 -8
  136. package/src/enums/billing-plan.ts +0 -17
  137. package/types/enums/billing-plan.d.ts +0 -17
@@ -2,6 +2,7 @@ import { Service } from '../service';
2
2
  import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
3
  import type { Models } from '../models';
4
4
 
5
+ import { Resources } from '../enums/resources';
5
6
 
6
7
  export class Migrations {
7
8
  client: Client;
@@ -19,7 +20,7 @@ export class Migrations {
19
20
  * @throws {AppwriteException}
20
21
  * @returns {Promise<Models.MigrationList>}
21
22
  */
22
- list(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.MigrationList>;
23
+ list(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.MigrationList>;
23
24
  /**
24
25
  * List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.
25
26
  *
@@ -79,18 +80,18 @@ export class Migrations {
79
80
  /**
80
81
  * Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project.
81
82
  *
82
- * @param {string[]} params.resources - List of resources to migrate
83
+ * @param {Resources[]} params.resources - List of resources to migrate
83
84
  * @param {string} params.endpoint - Source Appwrite endpoint
84
85
  * @param {string} params.projectId - Source Project ID
85
86
  * @param {string} params.apiKey - Source API Key
86
87
  * @throws {AppwriteException}
87
88
  * @returns {Promise<Models.Migration>}
88
89
  */
89
- createAppwriteMigration(params: { resources: string[], endpoint: string, projectId: string, apiKey: string }): Promise<Models.Migration>;
90
+ createAppwriteMigration(params: { resources: Resources[], endpoint: string, projectId: string, apiKey: string }): Promise<Models.Migration>;
90
91
  /**
91
92
  * Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project.
92
93
  *
93
- * @param {string[]} resources - List of resources to migrate
94
+ * @param {Resources[]} resources - List of resources to migrate
94
95
  * @param {string} endpoint - Source Appwrite endpoint
95
96
  * @param {string} projectId - Source Project ID
96
97
  * @param {string} apiKey - Source API Key
@@ -98,18 +99,18 @@ export class Migrations {
98
99
  * @returns {Promise<Models.Migration>}
99
100
  * @deprecated Use the object parameter style method for a better developer experience.
100
101
  */
101
- createAppwriteMigration(resources: string[], endpoint: string, projectId: string, apiKey: string): Promise<Models.Migration>;
102
+ createAppwriteMigration(resources: Resources[], endpoint: string, projectId: string, apiKey: string): Promise<Models.Migration>;
102
103
  createAppwriteMigration(
103
- paramsOrFirst: { resources: string[], endpoint: string, projectId: string, apiKey: string } | string[],
104
+ paramsOrFirst: { resources: Resources[], endpoint: string, projectId: string, apiKey: string } | Resources[],
104
105
  ...rest: [(string)?, (string)?, (string)?]
105
106
  ): Promise<Models.Migration> {
106
- let params: { resources: string[], endpoint: string, projectId: string, apiKey: string };
107
+ let params: { resources: Resources[], endpoint: string, projectId: string, apiKey: string };
107
108
 
108
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
109
- params = (paramsOrFirst || {}) as { resources: string[], endpoint: string, projectId: string, apiKey: string };
109
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
110
+ params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, projectId: string, apiKey: string };
110
111
  } else {
111
112
  params = {
112
- resources: paramsOrFirst as string[],
113
+ resources: paramsOrFirst as Resources[],
113
114
  endpoint: rest[0] as string,
114
115
  projectId: rest[1] as string,
115
116
  apiKey: rest[2] as string
@@ -165,18 +166,18 @@ export class Migrations {
165
166
  /**
166
167
  * Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
167
168
  *
168
- * @param {string[]} params.resources - List of resources to migrate
169
+ * @param {Resources[]} params.resources - List of resources to migrate
169
170
  * @param {string} params.endpoint - Source's Appwrite Endpoint
170
171
  * @param {string} params.projectID - Source's Project ID
171
172
  * @param {string} params.key - Source's API Key
172
173
  * @throws {AppwriteException}
173
174
  * @returns {Promise<Models.MigrationReport>}
174
175
  */
175
- getAppwriteReport(params: { resources: string[], endpoint: string, projectID: string, key: string }): Promise<Models.MigrationReport>;
176
+ getAppwriteReport(params: { resources: Resources[], endpoint: string, projectID: string, key: string }): Promise<Models.MigrationReport>;
176
177
  /**
177
178
  * Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
178
179
  *
179
- * @param {string[]} resources - List of resources to migrate
180
+ * @param {Resources[]} resources - List of resources to migrate
180
181
  * @param {string} endpoint - Source's Appwrite Endpoint
181
182
  * @param {string} projectID - Source's Project ID
182
183
  * @param {string} key - Source's API Key
@@ -184,18 +185,18 @@ export class Migrations {
184
185
  * @returns {Promise<Models.MigrationReport>}
185
186
  * @deprecated Use the object parameter style method for a better developer experience.
186
187
  */
187
- getAppwriteReport(resources: string[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport>;
188
+ getAppwriteReport(resources: Resources[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport>;
188
189
  getAppwriteReport(
189
- paramsOrFirst: { resources: string[], endpoint: string, projectID: string, key: string } | string[],
190
+ paramsOrFirst: { resources: Resources[], endpoint: string, projectID: string, key: string } | Resources[],
190
191
  ...rest: [(string)?, (string)?, (string)?]
191
192
  ): Promise<Models.MigrationReport> {
192
- let params: { resources: string[], endpoint: string, projectID: string, key: string };
193
+ let params: { resources: Resources[], endpoint: string, projectID: string, key: string };
193
194
 
194
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
195
- params = (paramsOrFirst || {}) as { resources: string[], endpoint: string, projectID: string, key: string };
195
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
196
+ params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, projectID: string, key: string };
196
197
  } else {
197
198
  params = {
198
- resources: paramsOrFirst as string[],
199
+ resources: paramsOrFirst as Resources[],
199
200
  endpoint: rest[0] as string,
200
201
  projectID: rest[1] as string,
201
202
  key: rest[2] as string
@@ -262,7 +263,7 @@ export class Migrations {
262
263
  * @throws {AppwriteException}
263
264
  * @returns {Promise<Models.Migration>}
264
265
  */
265
- createCSVExport(params: { resourceId: string, filename: string, columns?: string[], queries?: string[], delimiter?: string, enclosure?: string, escape?: string, header?: boolean, notify?: boolean }): Promise<Models.Migration>;
266
+ createCSVExport(params: { resourceId: string, filename: string, columns?: string[], queries?: string[], delimiter?: string, enclosure?: string, escape?: string, header?: boolean, notify?: boolean }): Promise<Models.Migration>;
266
267
  /**
267
268
  * Export documents to a CSV file from your Appwrite database. This endpoint allows you to export documents to a CSV file stored in a secure internal bucket. You'll receive an email with a download link when the export is complete.
268
269
  *
@@ -372,7 +373,7 @@ export class Migrations {
372
373
  * @throws {AppwriteException}
373
374
  * @returns {Promise<Models.Migration>}
374
375
  */
375
- createCSVImport(params: { bucketId: string, fileId: string, resourceId: string, internalFile?: boolean }): Promise<Models.Migration>;
376
+ createCSVImport(params: { bucketId: string, fileId: string, resourceId: string, internalFile?: boolean }): Promise<Models.Migration>;
376
377
  /**
377
378
  * Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.
378
379
  *
@@ -448,33 +449,33 @@ export class Migrations {
448
449
  /**
449
450
  * Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project.
450
451
  *
451
- * @param {string[]} params.resources - List of resources to migrate
452
+ * @param {Resources[]} params.resources - List of resources to migrate
452
453
  * @param {string} params.serviceAccount - JSON of the Firebase service account credentials
453
454
  * @throws {AppwriteException}
454
455
  * @returns {Promise<Models.Migration>}
455
456
  */
456
- createFirebaseMigration(params: { resources: string[], serviceAccount: string }): Promise<Models.Migration>;
457
+ createFirebaseMigration(params: { resources: Resources[], serviceAccount: string }): Promise<Models.Migration>;
457
458
  /**
458
459
  * Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project.
459
460
  *
460
- * @param {string[]} resources - List of resources to migrate
461
+ * @param {Resources[]} resources - List of resources to migrate
461
462
  * @param {string} serviceAccount - JSON of the Firebase service account credentials
462
463
  * @throws {AppwriteException}
463
464
  * @returns {Promise<Models.Migration>}
464
465
  * @deprecated Use the object parameter style method for a better developer experience.
465
466
  */
466
- createFirebaseMigration(resources: string[], serviceAccount: string): Promise<Models.Migration>;
467
+ createFirebaseMigration(resources: Resources[], serviceAccount: string): Promise<Models.Migration>;
467
468
  createFirebaseMigration(
468
- paramsOrFirst: { resources: string[], serviceAccount: string } | string[],
469
+ paramsOrFirst: { resources: Resources[], serviceAccount: string } | Resources[],
469
470
  ...rest: [(string)?]
470
471
  ): Promise<Models.Migration> {
471
- let params: { resources: string[], serviceAccount: string };
472
+ let params: { resources: Resources[], serviceAccount: string };
472
473
 
473
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
474
- params = (paramsOrFirst || {}) as { resources: string[], serviceAccount: string };
474
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
475
+ params = (paramsOrFirst || {}) as { resources: Resources[], serviceAccount: string };
475
476
  } else {
476
477
  params = {
477
- resources: paramsOrFirst as string[],
478
+ resources: paramsOrFirst as Resources[],
478
479
  serviceAccount: rest[0] as string
479
480
  };
480
481
  }
@@ -514,33 +515,33 @@ export class Migrations {
514
515
  /**
515
516
  * Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
516
517
  *
517
- * @param {string[]} params.resources - List of resources to migrate
518
+ * @param {Resources[]} params.resources - List of resources to migrate
518
519
  * @param {string} params.serviceAccount - JSON of the Firebase service account credentials
519
520
  * @throws {AppwriteException}
520
521
  * @returns {Promise<Models.MigrationReport>}
521
522
  */
522
- getFirebaseReport(params: { resources: string[], serviceAccount: string }): Promise<Models.MigrationReport>;
523
+ getFirebaseReport(params: { resources: Resources[], serviceAccount: string }): Promise<Models.MigrationReport>;
523
524
  /**
524
525
  * Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
525
526
  *
526
- * @param {string[]} resources - List of resources to migrate
527
+ * @param {Resources[]} resources - List of resources to migrate
527
528
  * @param {string} serviceAccount - JSON of the Firebase service account credentials
528
529
  * @throws {AppwriteException}
529
530
  * @returns {Promise<Models.MigrationReport>}
530
531
  * @deprecated Use the object parameter style method for a better developer experience.
531
532
  */
532
- getFirebaseReport(resources: string[], serviceAccount: string): Promise<Models.MigrationReport>;
533
+ getFirebaseReport(resources: Resources[], serviceAccount: string): Promise<Models.MigrationReport>;
533
534
  getFirebaseReport(
534
- paramsOrFirst: { resources: string[], serviceAccount: string } | string[],
535
+ paramsOrFirst: { resources: Resources[], serviceAccount: string } | Resources[],
535
536
  ...rest: [(string)?]
536
537
  ): Promise<Models.MigrationReport> {
537
- let params: { resources: string[], serviceAccount: string };
538
+ let params: { resources: Resources[], serviceAccount: string };
538
539
 
539
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
540
- params = (paramsOrFirst || {}) as { resources: string[], serviceAccount: string };
540
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
541
+ params = (paramsOrFirst || {}) as { resources: Resources[], serviceAccount: string };
541
542
  } else {
542
543
  params = {
543
- resources: paramsOrFirst as string[],
544
+ resources: paramsOrFirst as Resources[],
544
545
  serviceAccount: rest[0] as string
545
546
  };
546
547
  }
@@ -579,7 +580,7 @@ export class Migrations {
579
580
  /**
580
581
  * Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project.
581
582
  *
582
- * @param {string[]} params.resources - List of resources to migrate
583
+ * @param {Resources[]} params.resources - List of resources to migrate
583
584
  * @param {string} params.subdomain - Source's Subdomain
584
585
  * @param {string} params.region - Source's Region
585
586
  * @param {string} params.adminSecret - Source's Admin Secret
@@ -590,11 +591,11 @@ export class Migrations {
590
591
  * @throws {AppwriteException}
591
592
  * @returns {Promise<Models.Migration>}
592
593
  */
593
- createNHostMigration(params: { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
594
+ createNHostMigration(params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
594
595
  /**
595
596
  * Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project.
596
597
  *
597
- * @param {string[]} resources - List of resources to migrate
598
+ * @param {Resources[]} resources - List of resources to migrate
598
599
  * @param {string} subdomain - Source's Subdomain
599
600
  * @param {string} region - Source's Region
600
601
  * @param {string} adminSecret - Source's Admin Secret
@@ -606,18 +607,18 @@ export class Migrations {
606
607
  * @returns {Promise<Models.Migration>}
607
608
  * @deprecated Use the object parameter style method for a better developer experience.
608
609
  */
609
- createNHostMigration(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.Migration>;
610
+ createNHostMigration(resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.Migration>;
610
611
  createNHostMigration(
611
- paramsOrFirst: { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | string[],
612
+ paramsOrFirst: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | Resources[],
612
613
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
613
614
  ): Promise<Models.Migration> {
614
- let params: { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
615
+ let params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
615
616
 
616
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
617
- params = (paramsOrFirst || {}) as { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
617
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
618
+ params = (paramsOrFirst || {}) as { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
618
619
  } else {
619
620
  params = {
620
- resources: paramsOrFirst as string[],
621
+ resources: paramsOrFirst as Resources[],
621
622
  subdomain: rest[0] as string,
622
623
  region: rest[1] as string,
623
624
  adminSecret: rest[2] as string,
@@ -702,7 +703,7 @@ export class Migrations {
702
703
  /**
703
704
  * Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
704
705
  *
705
- * @param {string[]} params.resources - List of resources to migrate.
706
+ * @param {Resources[]} params.resources - List of resources to migrate.
706
707
  * @param {string} params.subdomain - Source's Subdomain.
707
708
  * @param {string} params.region - Source's Region.
708
709
  * @param {string} params.adminSecret - Source's Admin Secret.
@@ -713,11 +714,11 @@ export class Migrations {
713
714
  * @throws {AppwriteException}
714
715
  * @returns {Promise<Models.MigrationReport>}
715
716
  */
716
- getNHostReport(params: { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
717
+ getNHostReport(params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
717
718
  /**
718
719
  * Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
719
720
  *
720
- * @param {string[]} resources - List of resources to migrate.
721
+ * @param {Resources[]} resources - List of resources to migrate.
721
722
  * @param {string} subdomain - Source's Subdomain.
722
723
  * @param {string} region - Source's Region.
723
724
  * @param {string} adminSecret - Source's Admin Secret.
@@ -729,18 +730,18 @@ export class Migrations {
729
730
  * @returns {Promise<Models.MigrationReport>}
730
731
  * @deprecated Use the object parameter style method for a better developer experience.
731
732
  */
732
- getNHostReport(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
733
+ getNHostReport(resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
733
734
  getNHostReport(
734
- paramsOrFirst: { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | string[],
735
+ paramsOrFirst: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | Resources[],
735
736
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
736
737
  ): Promise<Models.MigrationReport> {
737
- let params: { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
738
+ let params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
738
739
 
739
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
740
- params = (paramsOrFirst || {}) as { resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
740
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
741
+ params = (paramsOrFirst || {}) as { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
741
742
  } else {
742
743
  params = {
743
- resources: paramsOrFirst as string[],
744
+ resources: paramsOrFirst as Resources[],
744
745
  subdomain: rest[0] as string,
745
746
  region: rest[1] as string,
746
747
  adminSecret: rest[2] as string,
@@ -824,7 +825,7 @@ export class Migrations {
824
825
  /**
825
826
  * Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project.
826
827
  *
827
- * @param {string[]} params.resources - List of resources to migrate
828
+ * @param {Resources[]} params.resources - List of resources to migrate
828
829
  * @param {string} params.endpoint - Source's Supabase Endpoint
829
830
  * @param {string} params.apiKey - Source's API Key
830
831
  * @param {string} params.databaseHost - Source's Database Host
@@ -834,11 +835,11 @@ export class Migrations {
834
835
  * @throws {AppwriteException}
835
836
  * @returns {Promise<Models.Migration>}
836
837
  */
837
- createSupabaseMigration(params: { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
838
+ createSupabaseMigration(params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
838
839
  /**
839
840
  * Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project.
840
841
  *
841
- * @param {string[]} resources - List of resources to migrate
842
+ * @param {Resources[]} resources - List of resources to migrate
842
843
  * @param {string} endpoint - Source's Supabase Endpoint
843
844
  * @param {string} apiKey - Source's API Key
844
845
  * @param {string} databaseHost - Source's Database Host
@@ -849,18 +850,18 @@ export class Migrations {
849
850
  * @returns {Promise<Models.Migration>}
850
851
  * @deprecated Use the object parameter style method for a better developer experience.
851
852
  */
852
- createSupabaseMigration(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.Migration>;
853
+ createSupabaseMigration(resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.Migration>;
853
854
  createSupabaseMigration(
854
- paramsOrFirst: { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | string[],
855
+ paramsOrFirst: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | Resources[],
855
856
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
856
857
  ): Promise<Models.Migration> {
857
- let params: { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
858
+ let params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
858
859
 
859
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
860
- params = (paramsOrFirst || {}) as { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
860
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
861
+ params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
861
862
  } else {
862
863
  params = {
863
- resources: paramsOrFirst as string[],
864
+ resources: paramsOrFirst as Resources[],
864
865
  endpoint: rest[0] as string,
865
866
  apiKey: rest[1] as string,
866
867
  databaseHost: rest[2] as string,
@@ -937,7 +938,7 @@ export class Migrations {
937
938
  /**
938
939
  * Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
939
940
  *
940
- * @param {string[]} params.resources - List of resources to migrate
941
+ * @param {Resources[]} params.resources - List of resources to migrate
941
942
  * @param {string} params.endpoint - Source's Supabase Endpoint.
942
943
  * @param {string} params.apiKey - Source's API Key.
943
944
  * @param {string} params.databaseHost - Source's Database Host.
@@ -947,11 +948,11 @@ export class Migrations {
947
948
  * @throws {AppwriteException}
948
949
  * @returns {Promise<Models.MigrationReport>}
949
950
  */
950
- getSupabaseReport(params: { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
951
+ getSupabaseReport(params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
951
952
  /**
952
953
  * Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.
953
954
  *
954
- * @param {string[]} resources - List of resources to migrate
955
+ * @param {Resources[]} resources - List of resources to migrate
955
956
  * @param {string} endpoint - Source's Supabase Endpoint.
956
957
  * @param {string} apiKey - Source's API Key.
957
958
  * @param {string} databaseHost - Source's Database Host.
@@ -962,18 +963,18 @@ export class Migrations {
962
963
  * @returns {Promise<Models.MigrationReport>}
963
964
  * @deprecated Use the object parameter style method for a better developer experience.
964
965
  */
965
- getSupabaseReport(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
966
+ getSupabaseReport(resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
966
967
  getSupabaseReport(
967
- paramsOrFirst: { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | string[],
968
+ paramsOrFirst: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | Resources[],
968
969
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
969
970
  ): Promise<Models.MigrationReport> {
970
- let params: { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
971
+ let params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
971
972
 
972
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
973
- params = (paramsOrFirst || {}) as { resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
973
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
974
+ params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
974
975
  } else {
975
976
  params = {
976
- resources: paramsOrFirst as string[],
977
+ resources: paramsOrFirst as Resources[],
977
978
  endpoint: rest[0] as string,
978
979
  apiKey: rest[1] as string,
979
980
  databaseHost: rest[2] as string,
@@ -1053,7 +1054,7 @@ export class Migrations {
1053
1054
  * @throws {AppwriteException}
1054
1055
  * @returns {Promise<Models.Migration>}
1055
1056
  */
1056
- get(params: { migrationId: string }): Promise<Models.Migration>;
1057
+ get(params: { migrationId: string }): Promise<Models.Migration>;
1057
1058
  /**
1058
1059
  * Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process.
1059
1060
  *
@@ -1104,7 +1105,7 @@ export class Migrations {
1104
1105
  * @throws {AppwriteException}
1105
1106
  * @returns {Promise<Models.Migration>}
1106
1107
  */
1107
- retry(params: { migrationId: string }): Promise<Models.Migration>;
1108
+ retry(params: { migrationId: string }): Promise<Models.Migration>;
1108
1109
  /**
1109
1110
  * Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.
1110
1111
  *
@@ -1156,7 +1157,7 @@ export class Migrations {
1156
1157
  * @throws {AppwriteException}
1157
1158
  * @returns {Promise<{}>}
1158
1159
  */
1159
- delete(params: { migrationId: string }): Promise<{}>;
1160
+ delete(params: { migrationId: string }): Promise<{}>;
1160
1161
  /**
1161
1162
  * Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history.
1162
1163
  *