@appwrite.io/console 3.0.0 → 4.0.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 (69) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +470 -83
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +471 -84
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +470 -83
  8. package/docs/examples/databases/list-documents.md +2 -1
  9. package/docs/examples/domains/create-purchase.md +25 -0
  10. package/docs/examples/domains/create-transfer-in.md +18 -0
  11. package/docs/examples/domains/create-transfer-out.md +16 -0
  12. package/docs/examples/domains/get-transfer-status.md +15 -0
  13. package/docs/examples/health/get-console-pausing.md +16 -0
  14. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  15. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  16. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  17. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  18. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  19. package/docs/examples/migrations/get-firebase-report.md +2 -2
  20. package/docs/examples/migrations/get-n-host-report.md +2 -2
  21. package/docs/examples/migrations/get-supabase-report.md +2 -2
  22. package/docs/examples/organizations/get-scopes.md +2 -1
  23. package/docs/examples/projects/update-console-access.md +15 -0
  24. package/docs/examples/projects/update-status.md +16 -0
  25. package/docs/examples/sites/create-deployment.md +2 -2
  26. package/docs/examples/tablesdb/list-rows.md +2 -1
  27. package/package.json +1 -1
  28. package/src/channel.ts +19 -15
  29. package/src/client.ts +7 -2
  30. package/src/enums/appwrite-migration-resource.ts +21 -0
  31. package/src/enums/domain-transfer-status-status.ts +10 -0
  32. package/src/enums/firebase-migration-resource.ts +12 -0
  33. package/src/enums/{resources.ts → n-host-migration-resource.ts} +1 -1
  34. package/src/enums/status.ts +3 -0
  35. package/src/enums/supabase-migration-resource.ts +13 -0
  36. package/src/index.ts +6 -1
  37. package/src/models.ts +124 -3
  38. package/src/query.ts +26 -0
  39. package/src/services/account.ts +2 -2
  40. package/src/services/databases.ts +100 -93
  41. package/src/services/domains.ts +350 -0
  42. package/src/services/health.ts +61 -0
  43. package/src/services/messaging.ts +2 -2
  44. package/src/services/migrations.ts +68 -65
  45. package/src/services/organizations.ts +14 -6
  46. package/src/services/projects.ts +120 -0
  47. package/src/services/sites.ts +13 -16
  48. package/src/services/tables-db.ts +14 -7
  49. package/src/services/teams.ts +4 -4
  50. package/types/channel.d.ts +9 -9
  51. package/types/enums/appwrite-migration-resource.d.ts +21 -0
  52. package/types/enums/domain-transfer-status-status.d.ts +10 -0
  53. package/types/enums/firebase-migration-resource.d.ts +12 -0
  54. package/types/enums/{resources.d.ts → n-host-migration-resource.d.ts} +1 -1
  55. package/types/enums/status.d.ts +3 -0
  56. package/types/enums/supabase-migration-resource.d.ts +13 -0
  57. package/types/index.d.ts +6 -1
  58. package/types/models.d.ts +122 -3
  59. package/types/query.d.ts +22 -0
  60. package/types/services/databases.d.ts +40 -37
  61. package/types/services/domains.d.ts +118 -0
  62. package/types/services/health.d.ts +24 -0
  63. package/types/services/messaging.d.ts +2 -2
  64. package/types/services/migrations.d.ts +36 -33
  65. package/types/services/organizations.d.ts +4 -1
  66. package/types/services/projects.d.ts +46 -0
  67. package/types/services/sites.d.ts +4 -4
  68. package/types/services/tables-db.d.ts +4 -1
  69. package/types/services/teams.d.ts +4 -4
@@ -2,7 +2,10 @@ 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
+ import { AppwriteMigrationResource } from '../enums/appwrite-migration-resource';
6
+ import { FirebaseMigrationResource } from '../enums/firebase-migration-resource';
7
+ import { NHostMigrationResource } from '../enums/n-host-migration-resource';
8
+ import { SupabaseMigrationResource } from '../enums/supabase-migration-resource';
6
9
 
7
10
  export class Migrations {
8
11
  client: Client;
@@ -80,18 +83,18 @@ export class Migrations {
80
83
  /**
81
84
  * 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.
82
85
  *
83
- * @param {Resources[]} params.resources - List of resources to migrate
86
+ * @param {AppwriteMigrationResource[]} params.resources - List of resources to migrate
84
87
  * @param {string} params.endpoint - Source Appwrite endpoint
85
88
  * @param {string} params.projectId - Source Project ID
86
89
  * @param {string} params.apiKey - Source API Key
87
90
  * @throws {AppwriteException}
88
91
  * @returns {Promise<Models.Migration>}
89
92
  */
90
- createAppwriteMigration(params: { resources: Resources[], endpoint: string, projectId: string, apiKey: string }): Promise<Models.Migration>;
93
+ createAppwriteMigration(params: { resources: AppwriteMigrationResource[], endpoint: string, projectId: string, apiKey: string }): Promise<Models.Migration>;
91
94
  /**
92
95
  * 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.
93
96
  *
94
- * @param {Resources[]} resources - List of resources to migrate
97
+ * @param {AppwriteMigrationResource[]} resources - List of resources to migrate
95
98
  * @param {string} endpoint - Source Appwrite endpoint
96
99
  * @param {string} projectId - Source Project ID
97
100
  * @param {string} apiKey - Source API Key
@@ -99,18 +102,18 @@ export class Migrations {
99
102
  * @returns {Promise<Models.Migration>}
100
103
  * @deprecated Use the object parameter style method for a better developer experience.
101
104
  */
102
- createAppwriteMigration(resources: Resources[], endpoint: string, projectId: string, apiKey: string): Promise<Models.Migration>;
105
+ createAppwriteMigration(resources: AppwriteMigrationResource[], endpoint: string, projectId: string, apiKey: string): Promise<Models.Migration>;
103
106
  createAppwriteMigration(
104
- paramsOrFirst: { resources: Resources[], endpoint: string, projectId: string, apiKey: string } | Resources[],
107
+ paramsOrFirst: { resources: AppwriteMigrationResource[], endpoint: string, projectId: string, apiKey: string } | AppwriteMigrationResource[],
105
108
  ...rest: [(string)?, (string)?, (string)?]
106
109
  ): Promise<Models.Migration> {
107
- let params: { resources: Resources[], endpoint: string, projectId: string, apiKey: string };
110
+ let params: { resources: AppwriteMigrationResource[], endpoint: string, projectId: string, apiKey: string };
108
111
 
109
112
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectId' in paramsOrFirst || 'apiKey' in paramsOrFirst))) {
110
- params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, projectId: string, apiKey: string };
113
+ params = (paramsOrFirst || {}) as { resources: AppwriteMigrationResource[], endpoint: string, projectId: string, apiKey: string };
111
114
  } else {
112
115
  params = {
113
- resources: paramsOrFirst as Resources[],
116
+ resources: paramsOrFirst as AppwriteMigrationResource[],
114
117
  endpoint: rest[0] as string,
115
118
  projectId: rest[1] as string,
116
119
  apiKey: rest[2] as string
@@ -166,18 +169,18 @@ export class Migrations {
166
169
  /**
167
170
  * 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.
168
171
  *
169
- * @param {Resources[]} params.resources - List of resources to migrate
172
+ * @param {AppwriteMigrationResource[]} params.resources - List of resources to migrate
170
173
  * @param {string} params.endpoint - Source's Appwrite Endpoint
171
174
  * @param {string} params.projectID - Source's Project ID
172
175
  * @param {string} params.key - Source's API Key
173
176
  * @throws {AppwriteException}
174
177
  * @returns {Promise<Models.MigrationReport>}
175
178
  */
176
- getAppwriteReport(params: { resources: Resources[], endpoint: string, projectID: string, key: string }): Promise<Models.MigrationReport>;
179
+ getAppwriteReport(params: { resources: AppwriteMigrationResource[], endpoint: string, projectID: string, key: string }): Promise<Models.MigrationReport>;
177
180
  /**
178
181
  * 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.
179
182
  *
180
- * @param {Resources[]} resources - List of resources to migrate
183
+ * @param {AppwriteMigrationResource[]} resources - List of resources to migrate
181
184
  * @param {string} endpoint - Source's Appwrite Endpoint
182
185
  * @param {string} projectID - Source's Project ID
183
186
  * @param {string} key - Source's API Key
@@ -185,18 +188,18 @@ export class Migrations {
185
188
  * @returns {Promise<Models.MigrationReport>}
186
189
  * @deprecated Use the object parameter style method for a better developer experience.
187
190
  */
188
- getAppwriteReport(resources: Resources[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport>;
191
+ getAppwriteReport(resources: AppwriteMigrationResource[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport>;
189
192
  getAppwriteReport(
190
- paramsOrFirst: { resources: Resources[], endpoint: string, projectID: string, key: string } | Resources[],
193
+ paramsOrFirst: { resources: AppwriteMigrationResource[], endpoint: string, projectID: string, key: string } | AppwriteMigrationResource[],
191
194
  ...rest: [(string)?, (string)?, (string)?]
192
195
  ): Promise<Models.MigrationReport> {
193
- let params: { resources: Resources[], endpoint: string, projectID: string, key: string };
196
+ let params: { resources: AppwriteMigrationResource[], endpoint: string, projectID: string, key: string };
194
197
 
195
198
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectID' in paramsOrFirst || 'key' in paramsOrFirst))) {
196
- params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, projectID: string, key: string };
199
+ params = (paramsOrFirst || {}) as { resources: AppwriteMigrationResource[], endpoint: string, projectID: string, key: string };
197
200
  } else {
198
201
  params = {
199
- resources: paramsOrFirst as Resources[],
202
+ resources: paramsOrFirst as AppwriteMigrationResource[],
200
203
  endpoint: rest[0] as string,
201
204
  projectID: rest[1] as string,
202
205
  key: rest[2] as string
@@ -449,33 +452,33 @@ export class Migrations {
449
452
  /**
450
453
  * 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.
451
454
  *
452
- * @param {Resources[]} params.resources - List of resources to migrate
455
+ * @param {FirebaseMigrationResource[]} params.resources - List of resources to migrate
453
456
  * @param {string} params.serviceAccount - JSON of the Firebase service account credentials
454
457
  * @throws {AppwriteException}
455
458
  * @returns {Promise<Models.Migration>}
456
459
  */
457
- createFirebaseMigration(params: { resources: Resources[], serviceAccount: string }): Promise<Models.Migration>;
460
+ createFirebaseMigration(params: { resources: FirebaseMigrationResource[], serviceAccount: string }): Promise<Models.Migration>;
458
461
  /**
459
462
  * 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.
460
463
  *
461
- * @param {Resources[]} resources - List of resources to migrate
464
+ * @param {FirebaseMigrationResource[]} resources - List of resources to migrate
462
465
  * @param {string} serviceAccount - JSON of the Firebase service account credentials
463
466
  * @throws {AppwriteException}
464
467
  * @returns {Promise<Models.Migration>}
465
468
  * @deprecated Use the object parameter style method for a better developer experience.
466
469
  */
467
- createFirebaseMigration(resources: Resources[], serviceAccount: string): Promise<Models.Migration>;
470
+ createFirebaseMigration(resources: FirebaseMigrationResource[], serviceAccount: string): Promise<Models.Migration>;
468
471
  createFirebaseMigration(
469
- paramsOrFirst: { resources: Resources[], serviceAccount: string } | Resources[],
472
+ paramsOrFirst: { resources: FirebaseMigrationResource[], serviceAccount: string } | FirebaseMigrationResource[],
470
473
  ...rest: [(string)?]
471
474
  ): Promise<Models.Migration> {
472
- let params: { resources: Resources[], serviceAccount: string };
475
+ let params: { resources: FirebaseMigrationResource[], serviceAccount: string };
473
476
 
474
477
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
475
- params = (paramsOrFirst || {}) as { resources: Resources[], serviceAccount: string };
478
+ params = (paramsOrFirst || {}) as { resources: FirebaseMigrationResource[], serviceAccount: string };
476
479
  } else {
477
480
  params = {
478
- resources: paramsOrFirst as Resources[],
481
+ resources: paramsOrFirst as FirebaseMigrationResource[],
479
482
  serviceAccount: rest[0] as string
480
483
  };
481
484
  }
@@ -515,33 +518,33 @@ export class Migrations {
515
518
  /**
516
519
  * 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.
517
520
  *
518
- * @param {Resources[]} params.resources - List of resources to migrate
521
+ * @param {FirebaseMigrationResource[]} params.resources - List of resources to migrate
519
522
  * @param {string} params.serviceAccount - JSON of the Firebase service account credentials
520
523
  * @throws {AppwriteException}
521
524
  * @returns {Promise<Models.MigrationReport>}
522
525
  */
523
- getFirebaseReport(params: { resources: Resources[], serviceAccount: string }): Promise<Models.MigrationReport>;
526
+ getFirebaseReport(params: { resources: FirebaseMigrationResource[], serviceAccount: string }): Promise<Models.MigrationReport>;
524
527
  /**
525
528
  * 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.
526
529
  *
527
- * @param {Resources[]} resources - List of resources to migrate
530
+ * @param {FirebaseMigrationResource[]} resources - List of resources to migrate
528
531
  * @param {string} serviceAccount - JSON of the Firebase service account credentials
529
532
  * @throws {AppwriteException}
530
533
  * @returns {Promise<Models.MigrationReport>}
531
534
  * @deprecated Use the object parameter style method for a better developer experience.
532
535
  */
533
- getFirebaseReport(resources: Resources[], serviceAccount: string): Promise<Models.MigrationReport>;
536
+ getFirebaseReport(resources: FirebaseMigrationResource[], serviceAccount: string): Promise<Models.MigrationReport>;
534
537
  getFirebaseReport(
535
- paramsOrFirst: { resources: Resources[], serviceAccount: string } | Resources[],
538
+ paramsOrFirst: { resources: FirebaseMigrationResource[], serviceAccount: string } | FirebaseMigrationResource[],
536
539
  ...rest: [(string)?]
537
540
  ): Promise<Models.MigrationReport> {
538
- let params: { resources: Resources[], serviceAccount: string };
541
+ let params: { resources: FirebaseMigrationResource[], serviceAccount: string };
539
542
 
540
543
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
541
- params = (paramsOrFirst || {}) as { resources: Resources[], serviceAccount: string };
544
+ params = (paramsOrFirst || {}) as { resources: FirebaseMigrationResource[], serviceAccount: string };
542
545
  } else {
543
546
  params = {
544
- resources: paramsOrFirst as Resources[],
547
+ resources: paramsOrFirst as FirebaseMigrationResource[],
545
548
  serviceAccount: rest[0] as string
546
549
  };
547
550
  }
@@ -580,7 +583,7 @@ export class Migrations {
580
583
  /**
581
584
  * 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.
582
585
  *
583
- * @param {Resources[]} params.resources - List of resources to migrate
586
+ * @param {NHostMigrationResource[]} params.resources - List of resources to migrate
584
587
  * @param {string} params.subdomain - Source's Subdomain
585
588
  * @param {string} params.region - Source's Region
586
589
  * @param {string} params.adminSecret - Source's Admin Secret
@@ -591,11 +594,11 @@ export class Migrations {
591
594
  * @throws {AppwriteException}
592
595
  * @returns {Promise<Models.Migration>}
593
596
  */
594
- createNHostMigration(params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
597
+ createNHostMigration(params: { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
595
598
  /**
596
599
  * 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.
597
600
  *
598
- * @param {Resources[]} resources - List of resources to migrate
601
+ * @param {NHostMigrationResource[]} resources - List of resources to migrate
599
602
  * @param {string} subdomain - Source's Subdomain
600
603
  * @param {string} region - Source's Region
601
604
  * @param {string} adminSecret - Source's Admin Secret
@@ -607,18 +610,18 @@ export class Migrations {
607
610
  * @returns {Promise<Models.Migration>}
608
611
  * @deprecated Use the object parameter style method for a better developer experience.
609
612
  */
610
- createNHostMigration(resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.Migration>;
613
+ createNHostMigration(resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.Migration>;
611
614
  createNHostMigration(
612
- paramsOrFirst: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | Resources[],
615
+ paramsOrFirst: { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | NHostMigrationResource[],
613
616
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
614
617
  ): Promise<Models.Migration> {
615
- let params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
618
+ let params: { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
616
619
 
617
620
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'subdomain' in paramsOrFirst || 'region' in paramsOrFirst || 'adminSecret' in paramsOrFirst || 'database' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
618
- params = (paramsOrFirst || {}) as { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
621
+ params = (paramsOrFirst || {}) as { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
619
622
  } else {
620
623
  params = {
621
- resources: paramsOrFirst as Resources[],
624
+ resources: paramsOrFirst as NHostMigrationResource[],
622
625
  subdomain: rest[0] as string,
623
626
  region: rest[1] as string,
624
627
  adminSecret: rest[2] as string,
@@ -703,7 +706,7 @@ export class Migrations {
703
706
  /**
704
707
  * 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.
705
708
  *
706
- * @param {Resources[]} params.resources - List of resources to migrate.
709
+ * @param {NHostMigrationResource[]} params.resources - List of resources to migrate.
707
710
  * @param {string} params.subdomain - Source's Subdomain.
708
711
  * @param {string} params.region - Source's Region.
709
712
  * @param {string} params.adminSecret - Source's Admin Secret.
@@ -714,11 +717,11 @@ export class Migrations {
714
717
  * @throws {AppwriteException}
715
718
  * @returns {Promise<Models.MigrationReport>}
716
719
  */
717
- getNHostReport(params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
720
+ getNHostReport(params: { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
718
721
  /**
719
722
  * 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.
720
723
  *
721
- * @param {Resources[]} resources - List of resources to migrate.
724
+ * @param {NHostMigrationResource[]} resources - List of resources to migrate.
722
725
  * @param {string} subdomain - Source's Subdomain.
723
726
  * @param {string} region - Source's Region.
724
727
  * @param {string} adminSecret - Source's Admin Secret.
@@ -730,18 +733,18 @@ export class Migrations {
730
733
  * @returns {Promise<Models.MigrationReport>}
731
734
  * @deprecated Use the object parameter style method for a better developer experience.
732
735
  */
733
- getNHostReport(resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
736
+ getNHostReport(resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
734
737
  getNHostReport(
735
- paramsOrFirst: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | Resources[],
738
+ paramsOrFirst: { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number } | NHostMigrationResource[],
736
739
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
737
740
  ): Promise<Models.MigrationReport> {
738
- let params: { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
741
+ let params: { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
739
742
 
740
743
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'subdomain' in paramsOrFirst || 'region' in paramsOrFirst || 'adminSecret' in paramsOrFirst || 'database' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
741
- params = (paramsOrFirst || {}) as { resources: Resources[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
744
+ params = (paramsOrFirst || {}) as { resources: NHostMigrationResource[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number };
742
745
  } else {
743
746
  params = {
744
- resources: paramsOrFirst as Resources[],
747
+ resources: paramsOrFirst as NHostMigrationResource[],
745
748
  subdomain: rest[0] as string,
746
749
  region: rest[1] as string,
747
750
  adminSecret: rest[2] as string,
@@ -825,7 +828,7 @@ export class Migrations {
825
828
  /**
826
829
  * 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.
827
830
  *
828
- * @param {Resources[]} params.resources - List of resources to migrate
831
+ * @param {SupabaseMigrationResource[]} params.resources - List of resources to migrate
829
832
  * @param {string} params.endpoint - Source's Supabase Endpoint
830
833
  * @param {string} params.apiKey - Source's API Key
831
834
  * @param {string} params.databaseHost - Source's Database Host
@@ -835,11 +838,11 @@ export class Migrations {
835
838
  * @throws {AppwriteException}
836
839
  * @returns {Promise<Models.Migration>}
837
840
  */
838
- createSupabaseMigration(params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
841
+ createSupabaseMigration(params: { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.Migration>;
839
842
  /**
840
843
  * 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.
841
844
  *
842
- * @param {Resources[]} resources - List of resources to migrate
845
+ * @param {SupabaseMigrationResource[]} resources - List of resources to migrate
843
846
  * @param {string} endpoint - Source's Supabase Endpoint
844
847
  * @param {string} apiKey - Source's API Key
845
848
  * @param {string} databaseHost - Source's Database Host
@@ -850,18 +853,18 @@ export class Migrations {
850
853
  * @returns {Promise<Models.Migration>}
851
854
  * @deprecated Use the object parameter style method for a better developer experience.
852
855
  */
853
- createSupabaseMigration(resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.Migration>;
856
+ createSupabaseMigration(resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.Migration>;
854
857
  createSupabaseMigration(
855
- paramsOrFirst: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | Resources[],
858
+ paramsOrFirst: { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | SupabaseMigrationResource[],
856
859
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
857
860
  ): Promise<Models.Migration> {
858
- let params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
861
+ let params: { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
859
862
 
860
863
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'apiKey' in paramsOrFirst || 'databaseHost' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
861
- params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
864
+ params = (paramsOrFirst || {}) as { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
862
865
  } else {
863
866
  params = {
864
- resources: paramsOrFirst as Resources[],
867
+ resources: paramsOrFirst as SupabaseMigrationResource[],
865
868
  endpoint: rest[0] as string,
866
869
  apiKey: rest[1] as string,
867
870
  databaseHost: rest[2] as string,
@@ -938,7 +941,7 @@ export class Migrations {
938
941
  /**
939
942
  * 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.
940
943
  *
941
- * @param {Resources[]} params.resources - List of resources to migrate
944
+ * @param {SupabaseMigrationResource[]} params.resources - List of resources to migrate
942
945
  * @param {string} params.endpoint - Source's Supabase Endpoint.
943
946
  * @param {string} params.apiKey - Source's API Key.
944
947
  * @param {string} params.databaseHost - Source's Database Host.
@@ -948,11 +951,11 @@ export class Migrations {
948
951
  * @throws {AppwriteException}
949
952
  * @returns {Promise<Models.MigrationReport>}
950
953
  */
951
- getSupabaseReport(params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
954
+ getSupabaseReport(params: { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number }): Promise<Models.MigrationReport>;
952
955
  /**
953
956
  * 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.
954
957
  *
955
- * @param {Resources[]} resources - List of resources to migrate
958
+ * @param {SupabaseMigrationResource[]} resources - List of resources to migrate
956
959
  * @param {string} endpoint - Source's Supabase Endpoint.
957
960
  * @param {string} apiKey - Source's API Key.
958
961
  * @param {string} databaseHost - Source's Database Host.
@@ -963,18 +966,18 @@ export class Migrations {
963
966
  * @returns {Promise<Models.MigrationReport>}
964
967
  * @deprecated Use the object parameter style method for a better developer experience.
965
968
  */
966
- getSupabaseReport(resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
969
+ getSupabaseReport(resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.MigrationReport>;
967
970
  getSupabaseReport(
968
- paramsOrFirst: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | Resources[],
971
+ paramsOrFirst: { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number } | SupabaseMigrationResource[],
969
972
  ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (number)?]
970
973
  ): Promise<Models.MigrationReport> {
971
- let params: { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
974
+ let params: { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
972
975
 
973
976
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'apiKey' in paramsOrFirst || 'databaseHost' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
974
- params = (paramsOrFirst || {}) as { resources: Resources[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
977
+ params = (paramsOrFirst || {}) as { resources: SupabaseMigrationResource[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number };
975
978
  } else {
976
979
  params = {
977
- resources: paramsOrFirst as Resources[],
980
+ resources: paramsOrFirst as SupabaseMigrationResource[],
978
981
  endpoint: rest[0] as string,
979
982
  apiKey: rest[1] as string,
980
983
  databaseHost: rest[2] as string,
@@ -2496,33 +2496,38 @@ export class Organizations {
2496
2496
  * Get Scopes
2497
2497
  *
2498
2498
  * @param {string} params.organizationId - Organization id
2499
+ * @param {string} params.projectId - Project id
2499
2500
  * @throws {AppwriteException}
2500
2501
  * @returns {Promise<Models.Roles>}
2501
2502
  */
2502
- getScopes(params: { organizationId: string }): Promise<Models.Roles>;
2503
+ getScopes(params: { organizationId: string, projectId?: string }): Promise<Models.Roles>;
2503
2504
  /**
2504
2505
  * Get Scopes
2505
2506
  *
2506
2507
  * @param {string} organizationId - Organization id
2508
+ * @param {string} projectId - Project id
2507
2509
  * @throws {AppwriteException}
2508
2510
  * @returns {Promise<Models.Roles>}
2509
2511
  * @deprecated Use the object parameter style method for a better developer experience.
2510
2512
  */
2511
- getScopes(organizationId: string): Promise<Models.Roles>;
2513
+ getScopes(organizationId: string, projectId?: string): Promise<Models.Roles>;
2512
2514
  getScopes(
2513
- paramsOrFirst: { organizationId: string } | string
2515
+ paramsOrFirst: { organizationId: string, projectId?: string } | string,
2516
+ ...rest: [(string)?]
2514
2517
  ): Promise<Models.Roles> {
2515
- let params: { organizationId: string };
2518
+ let params: { organizationId: string, projectId?: string };
2516
2519
 
2517
2520
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2518
- params = (paramsOrFirst || {}) as { organizationId: string };
2521
+ params = (paramsOrFirst || {}) as { organizationId: string, projectId?: string };
2519
2522
  } else {
2520
2523
  params = {
2521
- organizationId: paramsOrFirst as string
2524
+ organizationId: paramsOrFirst as string,
2525
+ projectId: rest[0] as string
2522
2526
  };
2523
2527
  }
2524
2528
 
2525
2529
  const organizationId = params.organizationId;
2530
+ const projectId = params.projectId;
2526
2531
 
2527
2532
  if (typeof organizationId === 'undefined') {
2528
2533
  throw new AppwriteException('Missing required parameter: "organizationId"');
@@ -2530,6 +2535,9 @@ export class Organizations {
2530
2535
 
2531
2536
  const apiPath = '/organizations/{organizationId}/roles'.replace('{organizationId}', organizationId);
2532
2537
  const payload: Payload = {};
2538
+ if (typeof projectId !== 'undefined') {
2539
+ payload['projectId'] = projectId;
2540
+ }
2533
2541
  const uri = new URL(this.client.config.endpoint + apiPath);
2534
2542
 
2535
2543
  const apiHeaders: { [header: string]: string } = {
@@ -11,6 +11,7 @@ import { PlatformType } from '../enums/platform-type';
11
11
  import { ResourceType } from '../enums/resource-type';
12
12
  import { ApiService } from '../enums/api-service';
13
13
  import { SMTPSecure } from '../enums/smtp-secure';
14
+ import { Status } from '../enums/status';
14
15
  import { EmailTemplateType } from '../enums/email-template-type';
15
16
  import { EmailTemplateLocale } from '../enums/email-template-locale';
16
17
  import { SmsTemplateType } from '../enums/sms-template-type';
@@ -1458,6 +1459,60 @@ export class Projects {
1458
1459
  );
1459
1460
  }
1460
1461
 
1462
+ /**
1463
+ * Record console access to a project. This endpoint updates the last accessed timestamp for the project to track console activity.
1464
+ *
1465
+ *
1466
+ * @param {string} params.projectId - Project ID
1467
+ * @throws {AppwriteException}
1468
+ * @returns {Promise<{}>}
1469
+ */
1470
+ updateConsoleAccess(params: { projectId: string }): Promise<{}>;
1471
+ /**
1472
+ * Record console access to a project. This endpoint updates the last accessed timestamp for the project to track console activity.
1473
+ *
1474
+ *
1475
+ * @param {string} projectId - Project ID
1476
+ * @throws {AppwriteException}
1477
+ * @returns {Promise<{}>}
1478
+ * @deprecated Use the object parameter style method for a better developer experience.
1479
+ */
1480
+ updateConsoleAccess(projectId: string): Promise<{}>;
1481
+ updateConsoleAccess(
1482
+ paramsOrFirst: { projectId: string } | string
1483
+ ): Promise<{}> {
1484
+ let params: { projectId: string };
1485
+
1486
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1487
+ params = (paramsOrFirst || {}) as { projectId: string };
1488
+ } else {
1489
+ params = {
1490
+ projectId: paramsOrFirst as string
1491
+ };
1492
+ }
1493
+
1494
+ const projectId = params.projectId;
1495
+
1496
+ if (typeof projectId === 'undefined') {
1497
+ throw new AppwriteException('Missing required parameter: "projectId"');
1498
+ }
1499
+
1500
+ const apiPath = '/projects/{projectId}/console-access'.replace('{projectId}', projectId);
1501
+ const payload: Payload = {};
1502
+ const uri = new URL(this.client.config.endpoint + apiPath);
1503
+
1504
+ const apiHeaders: { [header: string]: string } = {
1505
+ 'content-type': 'application/json',
1506
+ }
1507
+
1508
+ return this.client.call(
1509
+ 'patch',
1510
+ uri,
1511
+ apiHeaders,
1512
+ payload
1513
+ );
1514
+ }
1515
+
1461
1516
  /**
1462
1517
  * List all the project\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'
1463
1518
  *
@@ -3582,6 +3637,71 @@ export class Projects {
3582
3637
  );
3583
3638
  }
3584
3639
 
3640
+ /**
3641
+ * Update the status of a project. Can be used to archive/restore projects, and to restore paused projects. When restoring a paused project, the console fingerprint header must be provided and the project must not be blocked for any reason other than inactivity.
3642
+ *
3643
+ *
3644
+ * @param {string} params.projectId - Project ID
3645
+ * @param {Status} params.status - New status for the project
3646
+ * @throws {AppwriteException}
3647
+ * @returns {Promise<{}>}
3648
+ */
3649
+ updateStatus(params: { projectId: string, status: Status }): Promise<{}>;
3650
+ /**
3651
+ * Update the status of a project. Can be used to archive/restore projects, and to restore paused projects. When restoring a paused project, the console fingerprint header must be provided and the project must not be blocked for any reason other than inactivity.
3652
+ *
3653
+ *
3654
+ * @param {string} projectId - Project ID
3655
+ * @param {Status} status - New status for the project
3656
+ * @throws {AppwriteException}
3657
+ * @returns {Promise<{}>}
3658
+ * @deprecated Use the object parameter style method for a better developer experience.
3659
+ */
3660
+ updateStatus(projectId: string, status: Status): Promise<{}>;
3661
+ updateStatus(
3662
+ paramsOrFirst: { projectId: string, status: Status } | string,
3663
+ ...rest: [(Status)?]
3664
+ ): Promise<{}> {
3665
+ let params: { projectId: string, status: Status };
3666
+
3667
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3668
+ params = (paramsOrFirst || {}) as { projectId: string, status: Status };
3669
+ } else {
3670
+ params = {
3671
+ projectId: paramsOrFirst as string,
3672
+ status: rest[0] as Status
3673
+ };
3674
+ }
3675
+
3676
+ const projectId = params.projectId;
3677
+ const status = params.status;
3678
+
3679
+ if (typeof projectId === 'undefined') {
3680
+ throw new AppwriteException('Missing required parameter: "projectId"');
3681
+ }
3682
+ if (typeof status === 'undefined') {
3683
+ throw new AppwriteException('Missing required parameter: "status"');
3684
+ }
3685
+
3686
+ const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
3687
+ const payload: Payload = {};
3688
+ if (typeof status !== 'undefined') {
3689
+ payload['status'] = status;
3690
+ }
3691
+ const uri = new URL(this.client.config.endpoint + apiPath);
3692
+
3693
+ const apiHeaders: { [header: string]: string } = {
3694
+ 'content-type': 'application/json',
3695
+ }
3696
+
3697
+ return this.client.call(
3698
+ 'patch',
3699
+ uri,
3700
+ apiHeaders,
3701
+ payload
3702
+ );
3703
+ }
3704
+
3585
3705
  /**
3586
3706
  * Update the team ID of a project allowing for it to be transferred to another team.
3587
3707
  *