@appwrite.io/console 16.0.0 → 17.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 (59) hide show
  1. package/README.md +5 -6
  2. package/dist/cjs/package.json +1 -1
  3. package/dist/cjs/sdk.js +8558 -4805
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/package.json +1 -1
  6. package/dist/esm/sdk.js +8559 -4806
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +8558 -4805
  9. package/package.json +59 -50
  10. package/types/client.d.ts +2 -13
  11. package/types/enums/{addon.d.ts → addon-key.d.ts} +1 -1
  12. package/types/enums/authentication-factor.d.ts +2 -1
  13. package/types/enums/billing-plan-group.d.ts +2 -1
  14. package/types/enums/build-runtime.d.ts +4 -1
  15. package/types/enums/cache-database.d.ts +1 -2
  16. package/types/enums/embedding-model.d.ts +1 -3
  17. package/types/enums/execution-resource-type.d.ts +4 -0
  18. package/types/enums/framework.d.ts +1 -0
  19. package/types/enums/id-token-provider.d.ts +4 -0
  20. package/types/enums/image-gravity.d.ts +1 -0
  21. package/types/enums/o-auth-provider.d.ts +5 -0
  22. package/types/enums/organization-key-scopes.d.ts +2 -4
  23. package/types/enums/project-email-template-id.d.ts +2 -1
  24. package/types/enums/project-key-scopes.d.ts +20 -3
  25. package/types/enums/project-o-auth-provider-id.d.ts +5 -0
  26. package/types/enums/project-policy-id.d.ts +2 -0
  27. package/types/enums/query-suggestion-resource.d.ts +2 -3
  28. package/types/enums/runtime.d.ts +4 -1
  29. package/types/enums/usage-event-dimension.d.ts +7 -1
  30. package/types/enums/usage-event-metric.d.ts +55 -0
  31. package/types/enums/usage-gauge-metric.d.ts +50 -0
  32. package/types/index.d.ts +11 -6
  33. package/types/models.d.ts +696 -776
  34. package/types/services/account.d.ts +124 -36
  35. package/types/services/apps.d.ts +6 -6
  36. package/types/services/avatars.d.ts +44 -0
  37. package/types/services/console.d.ts +2 -2
  38. package/types/services/databases.d.ts +8 -8
  39. package/types/services/documents-db.d.ts +13 -7
  40. package/types/services/domains.d.ts +82 -54
  41. package/types/services/functions.d.ts +6 -6
  42. package/types/services/manager.d.ts +14 -14
  43. package/types/services/messaging.d.ts +80 -6
  44. package/types/services/mongo.d.ts +17 -23
  45. package/types/services/mysql.d.ts +17 -23
  46. package/types/services/organization.d.ts +165 -0
  47. package/types/services/organizations.d.ts +24 -24
  48. package/types/services/postgresql.d.ts +17 -23
  49. package/types/services/project.d.ts +218 -51
  50. package/types/services/projects.d.ts +0 -94
  51. package/types/services/sites.d.ts +15 -8
  52. package/types/services/storage.d.ts +2 -2
  53. package/types/services/tables-db.d.ts +37 -12
  54. package/types/services/teams.d.ts +0 -25
  55. package/types/services/usage.d.ts +23 -14
  56. package/types/services/users.d.ts +26 -29
  57. package/types/services/vectors-db.d.ts +15 -9
  58. package/types/services/waf.d.ts +11 -2
  59. package/types/enums/project-usage-range.d.ts +0 -4
@@ -2,6 +2,7 @@ import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
3
  import { OrganizationKeyScopes } from '../enums/organization-key-scopes';
4
4
  import { Region } from '../enums/region';
5
+ import { ProjectKeyScopes } from '../enums/project-key-scopes';
5
6
  export declare class Organization {
6
7
  client: Client;
7
8
  constructor(client: Client);
@@ -487,4 +488,168 @@ export declare class Organization {
487
488
  * @deprecated Use the object parameter style method for a better developer experience.
488
489
  */
489
490
  deleteProject(projectId: string): Promise<{}>;
491
+ /**
492
+ * Get a list of all API keys of a project in your organization.
493
+ *
494
+ * @param {string} params.projectId - Project unique ID.
495
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes
496
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
497
+ * @throws {AppwriteException}
498
+ * @returns {Promise<Models.KeyList>}
499
+ */
500
+ listProjectKeys(params: {
501
+ projectId: string;
502
+ queries?: string[];
503
+ total?: boolean;
504
+ }): Promise<Models.KeyList>;
505
+ /**
506
+ * Get a list of all API keys of a project in your organization.
507
+ *
508
+ * @param {string} projectId - Project unique ID.
509
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes
510
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
511
+ * @throws {AppwriteException}
512
+ * @returns {Promise<Models.KeyList>}
513
+ * @deprecated Use the object parameter style method for a better developer experience.
514
+ */
515
+ listProjectKeys(projectId: string, queries?: string[], total?: boolean): Promise<Models.KeyList>;
516
+ /**
517
+ * Create a new API key for a project in your organization. It's recommended to have multiple API keys with strict scopes for separate functions within your project.
518
+ *
519
+ * You can also create an ephemeral API key if you need a short-lived key instead.
520
+ *
521
+ * @param {string} params.projectId - Project unique ID.
522
+ * @param {string} params.keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
523
+ * @param {string} params.name - Key name. Max length: 128 chars.
524
+ * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed.
525
+ * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
526
+ * @throws {AppwriteException}
527
+ * @returns {Promise<Models.Key>}
528
+ */
529
+ createProjectKey(params: {
530
+ projectId: string;
531
+ keyId: string;
532
+ name: string;
533
+ scopes: ProjectKeyScopes[];
534
+ expire?: string;
535
+ }): Promise<Models.Key>;
536
+ /**
537
+ * Create a new API key for a project in your organization. It's recommended to have multiple API keys with strict scopes for separate functions within your project.
538
+ *
539
+ * You can also create an ephemeral API key if you need a short-lived key instead.
540
+ *
541
+ * @param {string} projectId - Project unique ID.
542
+ * @param {string} keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
543
+ * @param {string} name - Key name. Max length: 128 chars.
544
+ * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed.
545
+ * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
546
+ * @throws {AppwriteException}
547
+ * @returns {Promise<Models.Key>}
548
+ * @deprecated Use the object parameter style method for a better developer experience.
549
+ */
550
+ createProjectKey(projectId: string, keyId: string, name: string, scopes: ProjectKeyScopes[], expire?: string): Promise<Models.Key>;
551
+ /**
552
+ * Create a new ephemeral API key for a project in your organization. It's recommended to have multiple API keys with strict scopes for separate functions within your project.
553
+ *
554
+ * You can also create a standard API key if you need a longer-lived key instead.
555
+ *
556
+ * @param {string} params.projectId - Project unique ID.
557
+ * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed.
558
+ * @param {number} params.duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.
559
+ * @throws {AppwriteException}
560
+ * @returns {Promise<Models.EphemeralKey>}
561
+ */
562
+ createEphemeralProjectKey(params: {
563
+ projectId: string;
564
+ scopes: ProjectKeyScopes[];
565
+ duration: number;
566
+ }): Promise<Models.EphemeralKey>;
567
+ /**
568
+ * Create a new ephemeral API key for a project in your organization. It's recommended to have multiple API keys with strict scopes for separate functions within your project.
569
+ *
570
+ * You can also create a standard API key if you need a longer-lived key instead.
571
+ *
572
+ * @param {string} projectId - Project unique ID.
573
+ * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed.
574
+ * @param {number} duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.
575
+ * @throws {AppwriteException}
576
+ * @returns {Promise<Models.EphemeralKey>}
577
+ * @deprecated Use the object parameter style method for a better developer experience.
578
+ */
579
+ createEphemeralProjectKey(projectId: string, scopes: ProjectKeyScopes[], duration: number): Promise<Models.EphemeralKey>;
580
+ /**
581
+ * Get a project key by its unique ID.
582
+ *
583
+ * @param {string} params.projectId - Project unique ID.
584
+ * @param {string} params.keyId - Key ID.
585
+ * @throws {AppwriteException}
586
+ * @returns {Promise<Models.Key>}
587
+ */
588
+ getProjectKey(params: {
589
+ projectId: string;
590
+ keyId: string;
591
+ }): Promise<Models.Key>;
592
+ /**
593
+ * Get a project key by its unique ID.
594
+ *
595
+ * @param {string} projectId - Project unique ID.
596
+ * @param {string} keyId - Key ID.
597
+ * @throws {AppwriteException}
598
+ * @returns {Promise<Models.Key>}
599
+ * @deprecated Use the object parameter style method for a better developer experience.
600
+ */
601
+ getProjectKey(projectId: string, keyId: string): Promise<Models.Key>;
602
+ /**
603
+ * Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
604
+ *
605
+ * @param {string} params.projectId - Project unique ID.
606
+ * @param {string} params.keyId - Key ID.
607
+ * @param {string} params.name - Key name. Max length: 128 chars.
608
+ * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed.
609
+ * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
610
+ * @throws {AppwriteException}
611
+ * @returns {Promise<Models.Key>}
612
+ */
613
+ updateProjectKey(params: {
614
+ projectId: string;
615
+ keyId: string;
616
+ name: string;
617
+ scopes: ProjectKeyScopes[];
618
+ expire?: string;
619
+ }): Promise<Models.Key>;
620
+ /**
621
+ * Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
622
+ *
623
+ * @param {string} projectId - Project unique ID.
624
+ * @param {string} keyId - Key ID.
625
+ * @param {string} name - Key name. Max length: 128 chars.
626
+ * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed.
627
+ * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
628
+ * @throws {AppwriteException}
629
+ * @returns {Promise<Models.Key>}
630
+ * @deprecated Use the object parameter style method for a better developer experience.
631
+ */
632
+ updateProjectKey(projectId: string, keyId: string, name: string, scopes: ProjectKeyScopes[], expire?: string): Promise<Models.Key>;
633
+ /**
634
+ * Delete a project key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.
635
+ *
636
+ * @param {string} params.projectId - Project unique ID.
637
+ * @param {string} params.keyId - Key ID.
638
+ * @throws {AppwriteException}
639
+ * @returns {Promise<{}>}
640
+ */
641
+ deleteProjectKey(params: {
642
+ projectId: string;
643
+ keyId: string;
644
+ }): Promise<{}>;
645
+ /**
646
+ * Delete a project key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.
647
+ *
648
+ * @param {string} projectId - Project unique ID.
649
+ * @param {string} keyId - Key ID.
650
+ * @throws {AppwriteException}
651
+ * @returns {Promise<{}>}
652
+ * @deprecated Use the object parameter style method for a better developer experience.
653
+ */
654
+ deleteProjectKey(projectId: string, keyId: string): Promise<{}>;
490
655
  }
@@ -1,7 +1,7 @@
1
1
  import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
3
  import { Platform } from '../enums/platform';
4
- import { Addon } from '../enums/addon';
4
+ import { AddonKey } from '../enums/addon-key';
5
5
  export declare class Organizations {
6
6
  client: Client;
7
7
  constructor(client: Client);
@@ -265,25 +265,25 @@ export declare class Organizations {
265
265
  *
266
266
  *
267
267
  * @param {string} params.organizationId - Organization ID
268
- * @param {Addon} params.addon - Addon key identifier (e.g. baa).
268
+ * @param {AddonKey} params.addon - Addon key identifier (e.g. baa).
269
269
  * @throws {AppwriteException}
270
270
  * @returns {Promise<Models.AddonPrice>}
271
271
  */
272
272
  getAddonPrice(params: {
273
273
  organizationId: string;
274
- addon: Addon;
274
+ addon: AddonKey;
275
275
  }): Promise<Models.AddonPrice>;
276
276
  /**
277
277
  * Get the price details for a billing addon for an organization.
278
278
  *
279
279
  *
280
280
  * @param {string} organizationId - Organization ID
281
- * @param {Addon} addon - Addon key identifier (e.g. baa).
281
+ * @param {AddonKey} addon - Addon key identifier (e.g. baa).
282
282
  * @throws {AppwriteException}
283
283
  * @returns {Promise<Models.AddonPrice>}
284
284
  * @deprecated Use the object parameter style method for a better developer experience.
285
285
  */
286
- getAddonPrice(organizationId: string, addon: Addon): Promise<Models.AddonPrice>;
286
+ getAddonPrice(organizationId: string, addon: AddonKey): Promise<Models.AddonPrice>;
287
287
  /**
288
288
  * Get a list of all aggregations for an organization.
289
289
  *
@@ -531,6 +531,25 @@ export declare class Organizations {
531
531
  * @deprecated Use the object parameter style method for a better developer experience.
532
532
  */
533
533
  getCredit(organizationId: string, creditId: string): Promise<Models.Credit>;
534
+ /**
535
+ * Get an estimate of the charge for the organization current billing cycle.
536
+ *
537
+ * @param {string} params.organizationId - Organization ID
538
+ * @throws {AppwriteException}
539
+ * @returns {Promise<Models.Estimation>}
540
+ */
541
+ getEstimation(params: {
542
+ organizationId: string;
543
+ }): Promise<Models.Estimation>;
544
+ /**
545
+ * Get an estimate of the charge for the organization current billing cycle.
546
+ *
547
+ * @param {string} organizationId - Organization ID
548
+ * @throws {AppwriteException}
549
+ * @returns {Promise<Models.Estimation>}
550
+ * @deprecated Use the object parameter style method for a better developer experience.
551
+ */
552
+ getEstimation(organizationId: string): Promise<Models.Estimation>;
534
553
  /**
535
554
  * Get estimation for deleting an organization.
536
555
  *
@@ -911,25 +930,6 @@ export declare class Organizations {
911
930
  * @deprecated Use the object parameter style method for a better developer experience.
912
931
  */
913
932
  updatePlan<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string, billingPlan: string, paymentMethodId?: string, billingAddressId?: string, invites?: string[], couponId?: string, taxId?: string, budget?: number): Promise<Models.Organization<Preferences>>;
914
- /**
915
- * Cancel the downgrade initiated for an organization.
916
- *
917
- * @param {string} params.organizationId - Organization Unique ID
918
- * @throws {AppwriteException}
919
- * @returns {Promise<Models.Organization<Preferences>>}
920
- */
921
- cancelDowngrade<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
922
- organizationId: string;
923
- }): Promise<Models.Organization<Preferences>>;
924
- /**
925
- * Cancel the downgrade initiated for an organization.
926
- *
927
- * @param {string} organizationId - Organization Unique ID
928
- * @throws {AppwriteException}
929
- * @returns {Promise<Models.Organization<Preferences>>}
930
- * @deprecated Use the object parameter style method for a better developer experience.
931
- */
932
- cancelDowngrade<Preferences extends Models.Preferences = Models.DefaultPreferences>(organizationId: string): Promise<Models.Organization<Preferences>>;
933
933
  /**
934
934
  * Create a billing plan estimation for upgrading or downgrading an organization plan.
935
935
  *
@@ -31,7 +31,6 @@ export declare class Postgresql {
31
31
  * @param {string} params.specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling.
32
32
  * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
33
33
  * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
34
- * @param {string} params.standbyRegion - Standby region for a cross-region replica. When set, a replica is provisioned in this region for cross-region high availability. Must differ from the database region.
35
34
  * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds.
36
35
  * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect.
37
36
  * @param {number} params.idleTimeoutMinutes - Minutes of inactivity before container scales to zero.
@@ -39,7 +38,7 @@ export declare class Postgresql {
39
38
  * @param {number} params.pitrRetentionDays - Number of days to retain PITR data.
40
39
  * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold.
41
40
  * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion.
42
- * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit.
41
+ * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit.
43
42
  * @throws {AppwriteException}
44
43
  * @returns {Promise<Models.DedicatedDatabase>}
45
44
  */
@@ -50,7 +49,6 @@ export declare class Postgresql {
50
49
  specification?: string;
51
50
  replicas?: number;
52
51
  syncMode?: string;
53
- standbyRegion?: string;
54
52
  networkIdleTimeoutSeconds?: number;
55
53
  networkIPAllowlist?: string[];
56
54
  idleTimeoutMinutes?: number;
@@ -69,7 +67,6 @@ export declare class Postgresql {
69
67
  * @param {string} specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling.
70
68
  * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
71
69
  * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
72
- * @param {string} standbyRegion - Standby region for a cross-region replica. When set, a replica is provisioned in this region for cross-region high availability. Must differ from the database region.
73
70
  * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds.
74
71
  * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect.
75
72
  * @param {number} idleTimeoutMinutes - Minutes of inactivity before container scales to zero.
@@ -77,14 +74,14 @@ export declare class Postgresql {
77
74
  * @param {number} pitrRetentionDays - Number of days to retain PITR data.
78
75
  * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold.
79
76
  * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion.
80
- * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit.
77
+ * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit.
81
78
  * @throws {AppwriteException}
82
79
  * @returns {Promise<Models.DedicatedDatabase>}
83
80
  * @deprecated Use the object parameter style method for a better developer experience.
84
81
  */
85
- create(databaseId: string, name: string, version?: string, specification?: string, replicas?: number, syncMode?: string, standbyRegion?: string, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number): Promise<Models.DedicatedDatabase>;
82
+ create(databaseId: string, name: string, version?: string, specification?: string, replicas?: number, syncMode?: string, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number): Promise<Models.DedicatedDatabase>;
86
83
  /**
87
- * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization.
84
+ * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization.
88
85
  *
89
86
  * @throws {AppwriteException}
90
87
  * @returns {Promise<Models.DedicatedDatabaseSpecificationList>}
@@ -118,8 +115,6 @@ export declare class Postgresql {
118
115
  * @param {string} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime.
119
116
  * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
120
117
  * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
121
- * @param {number} params.crossRegionReplicas - Number of cross-region standby replicas (0-1). Cross-region replication is enabled when greater than 0.
122
- * @param {string} params.standbyRegion - Standby region for the cross-region replica. Required when enabling cross-region replication and no standby region is already configured. Must differ from the database region.
123
118
  * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400).
124
119
  * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect.
125
120
  * @param {number} params.idleTimeoutMinutes - Minutes before container scales to zero.
@@ -145,8 +140,6 @@ export declare class Postgresql {
145
140
  specification?: string;
146
141
  replicas?: number;
147
142
  syncMode?: string;
148
- crossRegionReplicas?: number;
149
- standbyRegion?: string;
150
143
  networkIdleTimeoutSeconds?: number;
151
144
  networkIPAllowlist?: string[];
152
145
  idleTimeoutMinutes?: number;
@@ -172,8 +165,6 @@ export declare class Postgresql {
172
165
  * @param {string} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime.
173
166
  * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
174
167
  * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
175
- * @param {number} crossRegionReplicas - Number of cross-region standby replicas (0-1). Cross-region replication is enabled when greater than 0.
176
- * @param {string} standbyRegion - Standby region for the cross-region replica. Required when enabling cross-region replication and no standby region is already configured. Must differ from the database region.
177
168
  * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400).
178
169
  * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect.
179
170
  * @param {number} idleTimeoutMinutes - Minutes before container scales to zero.
@@ -193,7 +184,7 @@ export declare class Postgresql {
193
184
  * @returns {Promise<Models.DedicatedDatabase>}
194
185
  * @deprecated Use the object parameter style method for a better developer experience.
195
186
  */
196
- update(databaseId: string, name?: string, status?: string, specification?: string, replicas?: number, syncMode?: string, crossRegionReplicas?: number, standbyRegion?: string, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number): Promise<Models.DedicatedDatabase>;
187
+ update(databaseId: string, name?: string, status?: string, specification?: string, replicas?: number, syncMode?: string, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number): Promise<Models.DedicatedDatabase>;
197
188
  /**
198
189
  * Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. Deletion is allowed from any state, and repeating the call re-dispatches the cleanup.
199
190
  *
@@ -545,24 +536,24 @@ export declare class Postgresql {
545
536
  */
546
537
  deleteBranch(databaseId: string, branchId: string): Promise<Models.DedicatedDatabase>;
547
538
  /**
548
- * Rotate the primary connection credentials for a dedicated database. Generates a new password and updates the database atomically. Previous credentials stop working immediately. Returns the database with a refreshed connection string carrying the new password.
539
+ * Queue a rotation of the primary connection credentials for a dedicated database. A hibernated database is woken by the worker before rotation. List database operations until the returned operation reaches a terminal status, then fetch the database again for the refreshed connection string.
549
540
  *
550
541
  * @param {string} params.databaseId - Database ID.
551
542
  * @throws {AppwriteException}
552
- * @returns {Promise<Models.DedicatedDatabase>}
543
+ * @returns {Promise<Models.DedicatedDatabaseOperation>}
553
544
  */
554
545
  updateCredentials(params: {
555
546
  databaseId: string;
556
- }): Promise<Models.DedicatedDatabase>;
547
+ }): Promise<Models.DedicatedDatabaseOperation>;
557
548
  /**
558
- * Rotate the primary connection credentials for a dedicated database. Generates a new password and updates the database atomically. Previous credentials stop working immediately. Returns the database with a refreshed connection string carrying the new password.
549
+ * Queue a rotation of the primary connection credentials for a dedicated database. A hibernated database is woken by the worker before rotation. List database operations until the returned operation reaches a terminal status, then fetch the database again for the refreshed connection string.
559
550
  *
560
551
  * @param {string} databaseId - Database ID.
561
552
  * @throws {AppwriteException}
562
- * @returns {Promise<Models.DedicatedDatabase>}
553
+ * @returns {Promise<Models.DedicatedDatabaseOperation>}
563
554
  * @deprecated Use the object parameter style method for a better developer experience.
564
555
  */
565
- updateCredentials(databaseId: string): Promise<Models.DedicatedDatabase>;
556
+ updateCredentials(databaseId: string): Promise<Models.DedicatedDatabaseOperation>;
566
557
  /**
567
558
  * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings.
568
559
  *
@@ -655,7 +646,7 @@ export declare class Postgresql {
655
646
  */
656
647
  deleteExtension(databaseId: string, extensionName: string): Promise<Models.DedicatedDatabase>;
657
648
  /**
658
- * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
649
+ * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
659
650
  *
660
651
  * @param {string} params.databaseId - Database ID.
661
652
  * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -667,7 +658,7 @@ export declare class Postgresql {
667
658
  targetReplicaId?: string;
668
659
  }): Promise<Models.DedicatedDatabase>;
669
660
  /**
670
- * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
661
+ * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
671
662
  *
672
663
  * @param {string} databaseId - Database ID.
673
664
  * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -891,6 +882,7 @@ export declare class Postgresql {
891
882
  * @param {string} params.databaseId - Database ID.
892
883
  * @param {string} params.type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery.
893
884
  * @param {string} params.backupId - Backup ID to restore from (required for backup type).
885
+ * @param {string} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version.
894
886
  * @param {string} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime.
895
887
  * @throws {AppwriteException}
896
888
  * @returns {Promise<Models.DedicatedDatabaseRestoration>}
@@ -899,6 +891,7 @@ export declare class Postgresql {
899
891
  databaseId: string;
900
892
  type?: string;
901
893
  backupId?: string;
894
+ targetDatabaseId?: string;
902
895
  targetTime?: string;
903
896
  }): Promise<Models.DedicatedDatabaseRestoration>;
904
897
  /**
@@ -907,12 +900,13 @@ export declare class Postgresql {
907
900
  * @param {string} databaseId - Database ID.
908
901
  * @param {string} type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery.
909
902
  * @param {string} backupId - Backup ID to restore from (required for backup type).
903
+ * @param {string} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version.
910
904
  * @param {string} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime.
911
905
  * @throws {AppwriteException}
912
906
  * @returns {Promise<Models.DedicatedDatabaseRestoration>}
913
907
  * @deprecated Use the object parameter style method for a better developer experience.
914
908
  */
915
- createRestoration(databaseId: string, type?: string, backupId?: string, targetTime?: string): Promise<Models.DedicatedDatabaseRestoration>;
909
+ createRestoration(databaseId: string, type?: string, backupId?: string, targetDatabaseId?: string, targetTime?: string): Promise<Models.DedicatedDatabaseRestoration>;
916
910
  /**
917
911
  * Get details of a specific database restoration including its status, type, and timestamps.
918
912
  *