@appwrite.io/console 14.0.0 → 15.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.
@@ -35,7 +35,7 @@ export declare class Compute {
35
35
  * @param {number} params.cpu - CPU in millicores (125-16000).
36
36
  * @param {number} params.memory - Memory in MB to allocate (128-65536).
37
37
  * @param {number} params.storage - Storage in GB to allocate (1-16384).
38
- * @param {string} params.storageClass - Storage class: ssd, nvme, or hdd.
38
+ * @param {string} params.storageClass - Storage class. Allowed values: ssd. DigitalOcean exposes a single block-storage class, so only 'ssd' is offered today.
39
39
  * @param {number} params.storageMaxGb - Maximum storage limit in GB. 0 uses system default.
40
40
  * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
41
41
  * @param {string} params.highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
@@ -51,7 +51,7 @@ export declare class Compute {
51
51
  * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold.
52
52
  * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion.
53
53
  * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit.
54
- * @param {boolean} params.metricsEnabled - Enable metrics collection.
54
+ * @param {boolean} params.metricsEnabled - Enable metrics collection. Enabled by default; pass false to opt out.
55
55
  * @param {boolean} params.poolerEnabled - Enable connection pooler on provision.
56
56
  * @param {string} params.api - Product API that owns this database: compute (raw, direct-access), tablesdb, documentsdb, or vectorsdb. tablesdb/documentsdb/vectorsdb computes are reached only through their product APIs.
57
57
  * @throws {AppwriteException}
@@ -101,7 +101,7 @@ export declare class Compute {
101
101
  * @param {number} cpu - CPU in millicores (125-16000).
102
102
  * @param {number} memory - Memory in MB to allocate (128-65536).
103
103
  * @param {number} storage - Storage in GB to allocate (1-16384).
104
- * @param {string} storageClass - Storage class: ssd, nvme, or hdd.
104
+ * @param {string} storageClass - Storage class. Allowed values: ssd. DigitalOcean exposes a single block-storage class, so only 'ssd' is offered today.
105
105
  * @param {number} storageMaxGb - Maximum storage limit in GB. 0 uses system default.
106
106
  * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
107
107
  * @param {string} highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
@@ -117,7 +117,7 @@ export declare class Compute {
117
117
  * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold.
118
118
  * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion.
119
119
  * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit.
120
- * @param {boolean} metricsEnabled - Enable metrics collection.
120
+ * @param {boolean} metricsEnabled - Enable metrics collection. Enabled by default; pass false to opt out.
121
121
  * @param {boolean} poolerEnabled - Enable connection pooler on provision.
122
122
  * @param {string} api - Product API that owns this database: compute (raw, direct-access), tablesdb, documentsdb, or vectorsdb. tablesdb/documentsdb/vectorsdb computes are reached only through their product APIs.
123
123
  * @throws {AppwriteException}
@@ -156,12 +156,12 @@ export declare class Compute {
156
156
  *
157
157
  * @param {string} params.databaseId - Database ID.
158
158
  * @param {string} params.name - Database display name.
159
- * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume, or "inactive" to spin down a shared-pool database.
159
+ * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database.
160
160
  * @param {string} params.specification - Specification. Changes cpu, memory, and node pool based on specification config.
161
161
  * @param {number} params.cpu - CPU cores to allocate (125-16000).
162
162
  * @param {number} params.memory - Memory in MB to allocate (128-65536).
163
163
  * @param {number} params.storage - Storage in GB to allocate (1-16384).
164
- * @param {string} params.storageClass - Storage class. Allowed values: ssd, nvme, hdd.
164
+ * @param {string} params.storageClass - Storage class. Allowed values: ssd.
165
165
  * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
166
166
  * @param {string} params.highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
167
167
  * @param {number} params.networkMaxConnections - Maximum concurrent connections.
@@ -226,12 +226,12 @@ export declare class Compute {
226
226
  *
227
227
  * @param {string} databaseId - Database ID.
228
228
  * @param {string} name - Database display name.
229
- * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume, or "inactive" to spin down a shared-pool database.
229
+ * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database.
230
230
  * @param {string} specification - Specification. Changes cpu, memory, and node pool based on specification config.
231
231
  * @param {number} cpu - CPU cores to allocate (125-16000).
232
232
  * @param {number} memory - Memory in MB to allocate (128-65536).
233
233
  * @param {number} storage - Storage in GB to allocate (1-16384).
234
- * @param {string} storageClass - Storage class. Allowed values: ssd, nvme, hdd.
234
+ * @param {string} storageClass - Storage class. Allowed values: ssd.
235
235
  * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0.
236
236
  * @param {string} highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum.
237
237
  * @param {number} networkMaxConnections - Maximum concurrent connections.
@@ -0,0 +1,261 @@
1
+ import { Client } from '../client';
2
+ import type { Models } from '../models';
3
+ export declare class Oauth2 {
4
+ client: Client;
5
+ constructor(client: Client);
6
+ /**
7
+ * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
8
+ *
9
+ * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params.
10
+ * @param {string} params.authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details.
11
+ * @throws {AppwriteException}
12
+ * @returns {Promise<Models.Oauth2Approve>}
13
+ */
14
+ approve(params: {
15
+ grantId: string;
16
+ authorizationDetails?: string;
17
+ }): Promise<Models.Oauth2Approve>;
18
+ /**
19
+ * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
20
+ *
21
+ * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params.
22
+ * @param {string} authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details.
23
+ * @throws {AppwriteException}
24
+ * @returns {Promise<Models.Oauth2Approve>}
25
+ * @deprecated Use the object parameter style method for a better developer experience.
26
+ */
27
+ approve(grantId: string, authorizationDetails?: string): Promise<Models.Oauth2Approve>;
28
+ /**
29
+ * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
30
+ *
31
+ * @param {string} params.clientId - OAuth2 client ID.
32
+ * @param {string} params.redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not.
33
+ * @param {string} params.responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow).
34
+ * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`.
35
+ * @param {string} params.state - OAuth2 state. You receive this back in the redirect URI.
36
+ * @param {string} params.nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`.
37
+ * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public.
38
+ * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public.
39
+ * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.
40
+ * @param {number} params.maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required.
41
+ * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
42
+ * @throws {AppwriteException}
43
+ * @returns {Promise<Models.Oauth2Authorize>}
44
+ */
45
+ authorize(params: {
46
+ clientId: string;
47
+ redirectUri: string;
48
+ responseType: string;
49
+ scope: string;
50
+ state?: string;
51
+ nonce?: string;
52
+ codeChallenge?: string;
53
+ codeChallengeMethod?: string;
54
+ prompt?: string;
55
+ maxAge?: number;
56
+ authorizationDetails?: string;
57
+ }): Promise<Models.Oauth2Authorize>;
58
+ /**
59
+ * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
60
+ *
61
+ * @param {string} clientId - OAuth2 client ID.
62
+ * @param {string} redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not.
63
+ * @param {string} responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow).
64
+ * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`.
65
+ * @param {string} state - OAuth2 state. You receive this back in the redirect URI.
66
+ * @param {string} nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`.
67
+ * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public.
68
+ * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public.
69
+ * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.
70
+ * @param {number} maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required.
71
+ * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
72
+ * @throws {AppwriteException}
73
+ * @returns {Promise<Models.Oauth2Authorize>}
74
+ * @deprecated Use the object parameter style method for a better developer experience.
75
+ */
76
+ authorize(clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string): Promise<Models.Oauth2Authorize>;
77
+ /**
78
+ * Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval.
79
+ *
80
+ * @param {string} params.clientId - OAuth2 client ID.
81
+ * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`.
82
+ * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
83
+ * @throws {AppwriteException}
84
+ * @returns {Promise<Models.Oauth2DeviceAuthorization>}
85
+ */
86
+ createDeviceAuthorization(params?: {
87
+ clientId?: string;
88
+ scope?: string;
89
+ authorizationDetails?: string;
90
+ }): Promise<Models.Oauth2DeviceAuthorization>;
91
+ /**
92
+ * Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval.
93
+ *
94
+ * @param {string} clientId - OAuth2 client ID.
95
+ * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`.
96
+ * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
97
+ * @throws {AppwriteException}
98
+ * @returns {Promise<Models.Oauth2DeviceAuthorization>}
99
+ * @deprecated Use the object parameter style method for a better developer experience.
100
+ */
101
+ createDeviceAuthorization(clientId?: string, scope?: string, authorizationDetails?: string): Promise<Models.Oauth2DeviceAuthorization>;
102
+ /**
103
+ * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow.
104
+ *
105
+ * @param {string} params.userCode - User code displayed on the device.
106
+ * @throws {AppwriteException}
107
+ * @returns {Promise<Models.Oauth2Grant>}
108
+ */
109
+ createGrant(params: {
110
+ userCode: string;
111
+ }): Promise<Models.Oauth2Grant>;
112
+ /**
113
+ * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow.
114
+ *
115
+ * @param {string} userCode - User code displayed on the device.
116
+ * @throws {AppwriteException}
117
+ * @returns {Promise<Models.Oauth2Grant>}
118
+ * @deprecated Use the object parameter style method for a better developer experience.
119
+ */
120
+ createGrant(userCode: string): Promise<Models.Oauth2Grant>;
121
+ /**
122
+ * Get an OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK.
123
+ *
124
+ * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params.
125
+ * @throws {AppwriteException}
126
+ * @returns {Promise<Models.Oauth2Grant>}
127
+ */
128
+ getGrant(params: {
129
+ grantId: string;
130
+ }): Promise<Models.Oauth2Grant>;
131
+ /**
132
+ * Get an OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK.
133
+ *
134
+ * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params.
135
+ * @throws {AppwriteException}
136
+ * @returns {Promise<Models.Oauth2Grant>}
137
+ * @deprecated Use the object parameter style method for a better developer experience.
138
+ */
139
+ getGrant(grantId: string): Promise<Models.Oauth2Grant>;
140
+ /**
141
+ * OpenID Connect RP-Initiated Logout. Ends the user session and revokes the tokens issued to the app identified by the `id_token_hint`, then redirects the user to `post_logout_redirect_uri` when it matches a URI registered on the app.
142
+ *
143
+ * @param {string} params.idTokenHint - ID Token previously issued to the app, used as proof of the logout request. Required to end the session; signature and issuer are validated while expiry is ignored.
144
+ * @param {string} params.logoutHint - Hint about the user that is logging out. Accepted for OIDC compatibility.
145
+ * @param {string} params.clientId - OAuth2 client ID. When both `client_id` and `id_token_hint` are provided, they must identify the same app.
146
+ * @param {string} params.postLogoutRedirectUri - URI to redirect the user to after logout. Must exactly match a URI registered in the app's `postLogoutRedirectUris`.
147
+ * @param {string} params.state - Opaque value passed back unchanged in the `state` query param of the post-logout redirect.
148
+ * @param {string} params.uiLocales - Preferred languages for any logout UI, as space-separated BCP47 tags. Accepted for OIDC compatibility.
149
+ * @throws {AppwriteException}
150
+ * @returns {Promise<{}>}
151
+ */
152
+ logout(params?: {
153
+ idTokenHint?: string;
154
+ logoutHint?: string;
155
+ clientId?: string;
156
+ postLogoutRedirectUri?: string;
157
+ state?: string;
158
+ uiLocales?: string;
159
+ }): Promise<{}>;
160
+ /**
161
+ * OpenID Connect RP-Initiated Logout. Ends the user session and revokes the tokens issued to the app identified by the `id_token_hint`, then redirects the user to `post_logout_redirect_uri` when it matches a URI registered on the app.
162
+ *
163
+ * @param {string} idTokenHint - ID Token previously issued to the app, used as proof of the logout request. Required to end the session; signature and issuer are validated while expiry is ignored.
164
+ * @param {string} logoutHint - Hint about the user that is logging out. Accepted for OIDC compatibility.
165
+ * @param {string} clientId - OAuth2 client ID. When both `client_id` and `id_token_hint` are provided, they must identify the same app.
166
+ * @param {string} postLogoutRedirectUri - URI to redirect the user to after logout. Must exactly match a URI registered in the app's `postLogoutRedirectUris`.
167
+ * @param {string} state - Opaque value passed back unchanged in the `state` query param of the post-logout redirect.
168
+ * @param {string} uiLocales - Preferred languages for any logout UI, as space-separated BCP47 tags. Accepted for OIDC compatibility.
169
+ * @throws {AppwriteException}
170
+ * @returns {Promise<{}>}
171
+ * @deprecated Use the object parameter style method for a better developer experience.
172
+ */
173
+ logout(idTokenHint?: string, logoutHint?: string, clientId?: string, postLogoutRedirectUri?: string, state?: string, uiLocales?: string): Promise<{}>;
174
+ /**
175
+ * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
176
+ *
177
+ * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params.
178
+ * @throws {AppwriteException}
179
+ * @returns {Promise<Models.Oauth2Reject>}
180
+ */
181
+ reject(params: {
182
+ grantId: string;
183
+ }): Promise<Models.Oauth2Reject>;
184
+ /**
185
+ * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect.
186
+ *
187
+ * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params.
188
+ * @throws {AppwriteException}
189
+ * @returns {Promise<Models.Oauth2Reject>}
190
+ * @deprecated Use the object parameter style method for a better developer experience.
191
+ */
192
+ reject(grantId: string): Promise<Models.Oauth2Reject>;
193
+ /**
194
+ * Revoke an OAuth2 access token or refresh token.
195
+ *
196
+ * @param {string} params.token - The access or refresh token to revoke.
197
+ * @param {string} params.tokenTypeHint - Type of token to revoke (access_token or refresh_token).
198
+ * @param {string} params.clientId - OAuth2 client ID.
199
+ * @param {string} params.clientSecret - OAuth2 client secret. Required for confidential apps; omitted for public apps.
200
+ * @throws {AppwriteException}
201
+ * @returns {Promise<{}>}
202
+ */
203
+ revoke(params: {
204
+ token: string;
205
+ tokenTypeHint?: string;
206
+ clientId?: string;
207
+ clientSecret?: string;
208
+ }): Promise<{}>;
209
+ /**
210
+ * Revoke an OAuth2 access token or refresh token.
211
+ *
212
+ * @param {string} token - The access or refresh token to revoke.
213
+ * @param {string} tokenTypeHint - Type of token to revoke (access_token or refresh_token).
214
+ * @param {string} clientId - OAuth2 client ID.
215
+ * @param {string} clientSecret - OAuth2 client secret. Required for confidential apps; omitted for public apps.
216
+ * @throws {AppwriteException}
217
+ * @returns {Promise<{}>}
218
+ * @deprecated Use the object parameter style method for a better developer experience.
219
+ */
220
+ revoke(token: string, tokenTypeHint?: string, clientId?: string, clientSecret?: string): Promise<{}>;
221
+ /**
222
+ * Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens.
223
+ *
224
+ * @param {string} params.grantType - OAuth2 grant type. Can be one of: `authorization_code`, `refresh_token`, `urn:ietf:params:oauth:grant-type:device_code`.
225
+ * @param {string} params.code - Authorization code to be exchanged for access and refresh tokens. Required for `authorization_code` grant type.
226
+ * @param {string} params.refreshToken - Refresh token to be exchanged for a new access and refresh tokens. Required for `refresh_token` grant type.
227
+ * @param {string} params.deviceCode - Device code obtained from the device authorization endpoint. Required for `urn:ietf:params:oauth:grant-type:device_code` grant type.
228
+ * @param {string} params.clientId - OAuth2 client ID.
229
+ * @param {string} params.clientSecret - OAuth2 client secret. Required for confidential apps.
230
+ * @param {string} params.codeVerifier - PKCE code verifier. Required for public apps.
231
+ * @param {string} params.redirectUri - Redirect URI. Required for `authorization_code` grant type.
232
+ * @throws {AppwriteException}
233
+ * @returns {Promise<Models.Oauth2Token>}
234
+ */
235
+ createToken(params: {
236
+ grantType: string;
237
+ code?: string;
238
+ refreshToken?: string;
239
+ deviceCode?: string;
240
+ clientId?: string;
241
+ clientSecret?: string;
242
+ codeVerifier?: string;
243
+ redirectUri?: string;
244
+ }): Promise<Models.Oauth2Token>;
245
+ /**
246
+ * Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens.
247
+ *
248
+ * @param {string} grantType - OAuth2 grant type. Can be one of: `authorization_code`, `refresh_token`, `urn:ietf:params:oauth:grant-type:device_code`.
249
+ * @param {string} code - Authorization code to be exchanged for access and refresh tokens. Required for `authorization_code` grant type.
250
+ * @param {string} refreshToken - Refresh token to be exchanged for a new access and refresh tokens. Required for `refresh_token` grant type.
251
+ * @param {string} deviceCode - Device code obtained from the device authorization endpoint. Required for `urn:ietf:params:oauth:grant-type:device_code` grant type.
252
+ * @param {string} clientId - OAuth2 client ID.
253
+ * @param {string} clientSecret - OAuth2 client secret. Required for confidential apps.
254
+ * @param {string} codeVerifier - PKCE code verifier. Required for public apps.
255
+ * @param {string} redirectUri - Redirect URI. Required for `authorization_code` grant type.
256
+ * @throws {AppwriteException}
257
+ * @returns {Promise<Models.Oauth2Token>}
258
+ * @deprecated Use the object parameter style method for a better developer experience.
259
+ */
260
+ createToken(grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string): Promise<Models.Oauth2Token>;
261
+ }
@@ -1864,6 +1864,25 @@ export declare class Project {
1864
1864
  * @deprecated Use the object parameter style method for a better developer experience.
1865
1865
  */
1866
1866
  updateDenyAliasedEmailPolicy(enabled: boolean): Promise<Models.Project>;
1867
+ /**
1868
+ * Configures if only corporate email addresses (non-free and non-disposable domains) are allowed during new user sign-ups and email updates.
1869
+ *
1870
+ * @param {boolean} params.enabled - Set whether or not to restrict sign-ups and email updates to corporate email addresses only.
1871
+ * @throws {AppwriteException}
1872
+ * @returns {Promise<Models.Project>}
1873
+ */
1874
+ updateDenyCorporateEmailPolicy(params: {
1875
+ enabled: boolean;
1876
+ }): Promise<Models.Project>;
1877
+ /**
1878
+ * Configures if only corporate email addresses (non-free and non-disposable domains) are allowed during new user sign-ups and email updates.
1879
+ *
1880
+ * @param {boolean} enabled - Set whether or not to restrict sign-ups and email updates to corporate email addresses only.
1881
+ * @throws {AppwriteException}
1882
+ * @returns {Promise<Models.Project>}
1883
+ * @deprecated Use the object parameter style method for a better developer experience.
1884
+ */
1885
+ updateDenyCorporateEmailPolicy(enabled: boolean): Promise<Models.Project>;
1867
1886
  /**
1868
1887
  * Configures if disposable emails from known temporary domains are denied during new users sign-ups and email updates.
1869
1888
  *
@@ -2126,22 +2145,22 @@ export declare class Project {
2126
2145
  /**
2127
2146
  * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy.
2128
2147
  *
2129
- * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email.
2148
+ * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email.
2130
2149
  * @throws {AppwriteException}
2131
- * @returns {Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail>}
2150
+ * @returns {Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail | Models.PolicyDenyCorporateEmail>}
2132
2151
  */
2133
2152
  getPolicy(params: {
2134
2153
  policyId: ProjectPolicyId;
2135
- }): Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail>;
2154
+ }): Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail | Models.PolicyDenyCorporateEmail>;
2136
2155
  /**
2137
2156
  * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy.
2138
2157
  *
2139
- * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email.
2158
+ * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email.
2140
2159
  * @throws {AppwriteException}
2141
- * @returns {Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail>}
2160
+ * @returns {Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail | Models.PolicyDenyCorporateEmail>}
2142
2161
  * @deprecated Use the object parameter style method for a better developer experience.
2143
2162
  */
2144
- getPolicy(policyId: ProjectPolicyId): Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail>;
2163
+ getPolicy(policyId: ProjectPolicyId): Promise<Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail | Models.PolicyDenyCorporateEmail>;
2145
2164
  /**
2146
2165
  * Update properties of a specific protocol. Use this endpoint to enable or disable a protocol in your project.
2147
2166
  *
@@ -2167,7 +2186,7 @@ export declare class Project {
2167
2186
  /**
2168
2187
  * Update properties of a specific service. Use this endpoint to enable or disable a service in your project.
2169
2188
  *
2170
- * @param {ProjectServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor
2189
+ * @param {ProjectServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor, oauth2
2171
2190
  * @param {boolean} params.enabled - Service status.
2172
2191
  * @throws {AppwriteException}
2173
2192
  * @returns {Promise<Models.Project>}
@@ -2179,7 +2198,7 @@ export declare class Project {
2179
2198
  /**
2180
2199
  * Update properties of a specific service. Use this endpoint to enable or disable a service in your project.
2181
2200
  *
2182
- * @param {ProjectServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor
2201
+ * @param {ProjectServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor, oauth2
2183
2202
  * @param {boolean} enabled - Service status.
2184
2203
  * @throws {AppwriteException}
2185
2204
  * @returns {Promise<Models.Project>}
@@ -4,47 +4,125 @@ export declare class Usage {
4
4
  client: Client;
5
5
  constructor(client: Client);
6
6
  /**
7
- * Query usage event metrics from the usage database. Returns individual event rows with full metadata. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, path, method, status, resource, resourceId, country, userAgent, time (these match the underlying column names — note that the response surfaces `resource` as `resourceType` and `country` as `countryCode`). When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
7
+ * Aggregate usage event metrics. `metric` is required.
8
8
  *
9
- * @param {string[]} params.queries - Array of query strings as JSON. Supported: equal("metric", [...]), equal("path", [...]), equal("method", [...]), equal("status", [...]), equal("resource", [...]), equal("resourceId", [...]), equal("country", [...]), equal("userAgent", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
10
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
9
+ * **Two response shapes**:
10
+ * - Omit `interval` for a flat top-N table — one row per dimension combination, no time axis. Useful for "top 10 paths by bandwidth in the last 7 days".
11
+ * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one row per (time bucket × dimension combination).
12
+ *
13
+ * `dimensions[]` breaks each row down by one or more attributes (service, path, status, country, …). `resource` and `resourceId` filter the underlying events. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N by aggregated value. When `startAt` is omitted, the default window adapts to `interval` (or 7d when interval is omitted).
14
+ *
15
+ * @param {string} params.metric - Metric name (required). Example: executions, network.requests.
16
+ * @param {string} params.resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
17
+ * @param {string} params.resourceId - Resource id filter.
18
+ * @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
19
+ * @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
20
+ * @param {string} params.startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
21
+ * @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
22
+ * @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
23
+ * @param {string} params.orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first.
24
+ * @param {number} params.limit - Maximum rows to return (1-5000).
25
+ * @param {number} params.offset - Pagination offset (0-100000).
11
26
  * @throws {AppwriteException}
12
27
  * @returns {Promise<Models.UsageEventList>}
13
28
  */
14
- listEvents(params?: {
15
- queries?: string[];
16
- total?: boolean;
29
+ listEvents(params: {
30
+ metric: string;
31
+ resource?: string;
32
+ resourceId?: string;
33
+ interval?: string;
34
+ dimensions?: string[];
35
+ startAt?: string;
36
+ endAt?: string;
37
+ orderBy?: string;
38
+ orderDir?: string;
39
+ limit?: number;
40
+ offset?: number;
17
41
  }): Promise<Models.UsageEventList>;
18
42
  /**
19
- * Query usage event metrics from the usage database. Returns individual event rows with full metadata. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, path, method, status, resource, resourceId, country, userAgent, time (these match the underlying column names — note that the response surfaces `resource` as `resourceType` and `country` as `countryCode`). When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
43
+ * Aggregate usage event metrics. `metric` is required.
44
+ *
45
+ * **Two response shapes**:
46
+ * - Omit `interval` for a flat top-N table — one row per dimension combination, no time axis. Useful for "top 10 paths by bandwidth in the last 7 days".
47
+ * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one row per (time bucket × dimension combination).
48
+ *
49
+ * `dimensions[]` breaks each row down by one or more attributes (service, path, status, country, …). `resource` and `resourceId` filter the underlying events. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N by aggregated value. When `startAt` is omitted, the default window adapts to `interval` (or 7d when interval is omitted).
20
50
  *
21
- * @param {string[]} queries - Array of query strings as JSON. Supported: equal("metric", [...]), equal("path", [...]), equal("method", [...]), equal("status", [...]), equal("resource", [...]), equal("resourceId", [...]), equal("country", [...]), equal("userAgent", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
22
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
51
+ * @param {string} metric - Metric name (required). Example: executions, network.requests.
52
+ * @param {string} resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
53
+ * @param {string} resourceId - Resource id filter.
54
+ * @param {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
55
+ * @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
56
+ * @param {string} startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
57
+ * @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
58
+ * @param {string} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
59
+ * @param {string} orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, returns the most recent / highest-value groups first.
60
+ * @param {number} limit - Maximum rows to return (1-5000).
61
+ * @param {number} offset - Pagination offset (0-100000).
23
62
  * @throws {AppwriteException}
24
63
  * @returns {Promise<Models.UsageEventList>}
25
64
  * @deprecated Use the object parameter style method for a better developer experience.
26
65
  */
27
- listEvents(queries?: string[], total?: boolean): Promise<Models.UsageEventList>;
66
+ listEvents(metric: string, resource?: string, resourceId?: string, interval?: string, dimensions?: string[], startAt?: string, endAt?: string, orderBy?: string, orderDir?: string, limit?: number, offset?: number): Promise<Models.UsageEventList>;
28
67
  /**
29
- * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
68
+ * Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each group carries the latest snapshot in its interval via `argMax(value, time)`. `metric` is required.
30
69
  *
31
- * @param {string[]} params.queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
32
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
70
+ * **Two response shapes**:
71
+ * - Omit `interval` for a flat top-N table — `argMax(value, time)` per dimension combination over the whole window, no time axis. Useful for "top 10 resources by current storage".
72
+ * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
73
+ *
74
+ * `dimensions[]` breaks each row down further — only `resourceId` and `teamId` are supported on gauges. `resourceId` and `teamId` parameters filter the underlying rows. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N. When `startAt` is omitted, the default window adapts to interval (or 7d when interval is omitted).
75
+ *
76
+ * @param {string} params.metric - Metric name (required). Example: files.storage, deployments.storage.
77
+ * @param {string} params.resourceId - Resource id filter.
78
+ * @param {string} params.teamId - Team id filter.
79
+ * @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
80
+ * @param {string[]} params.dimensions - Break-down dimensions. Allowed: resourceId, teamId.
81
+ * @param {string} params.startAt - Range start in ISO 8601. Defaults to endAt - 7d.
82
+ * @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
83
+ * @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time.
84
+ * @param {string} params.orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, this returns the most recent groups first. Pass asc for chronological charting.
85
+ * @param {number} params.limit - Maximum rows to return (1-5000).
86
+ * @param {number} params.offset - Pagination offset (0-100000).
33
87
  * @throws {AppwriteException}
34
88
  * @returns {Promise<Models.UsageGaugeList>}
35
89
  */
36
- listGauges(params?: {
37
- queries?: string[];
38
- total?: boolean;
90
+ listGauges(params: {
91
+ metric: string;
92
+ resourceId?: string;
93
+ teamId?: string;
94
+ interval?: string;
95
+ dimensions?: string[];
96
+ startAt?: string;
97
+ endAt?: string;
98
+ orderBy?: string;
99
+ orderDir?: string;
100
+ limit?: number;
101
+ offset?: number;
39
102
  }): Promise<Models.UsageGaugeList>;
40
103
  /**
41
- * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
104
+ * Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each group carries the latest snapshot in its interval via `argMax(value, time)`. `metric` is required.
105
+ *
106
+ * **Two response shapes**:
107
+ * - Omit `interval` for a flat top-N table — `argMax(value, time)` per dimension combination over the whole window, no time axis. Useful for "top 10 resources by current storage".
108
+ * - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
109
+ *
110
+ * `dimensions[]` breaks each row down further — only `resourceId` and `teamId` are supported on gauges. `resourceId` and `teamId` parameters filter the underlying rows. `orderBy=value`+`orderDir=desc`+`limit=N` returns the top-N. When `startAt` is omitted, the default window adapts to interval (or 7d when interval is omitted).
42
111
  *
43
- * @param {string[]} queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
44
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
112
+ * @param {string} metric - Metric name (required). Example: files.storage, deployments.storage.
113
+ * @param {string} resourceId - Resource id filter.
114
+ * @param {string} teamId - Team id filter.
115
+ * @param {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
116
+ * @param {string[]} dimensions - Break-down dimensions. Allowed: resourceId, teamId.
117
+ * @param {string} startAt - Range start in ISO 8601. Defaults to endAt - 7d.
118
+ * @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
119
+ * @param {string} orderBy - Column to order by. Allowed: time, value. Default time.
120
+ * @param {string} orderDir - Sort direction: asc or desc. Default desc — paired with the default limit, this returns the most recent groups first. Pass asc for chronological charting.
121
+ * @param {number} limit - Maximum rows to return (1-5000).
122
+ * @param {number} offset - Pagination offset (0-100000).
45
123
  * @throws {AppwriteException}
46
124
  * @returns {Promise<Models.UsageGaugeList>}
47
125
  * @deprecated Use the object parameter style method for a better developer experience.
48
126
  */
49
- listGauges(queries?: string[], total?: boolean): Promise<Models.UsageGaugeList>;
127
+ listGauges(metric: string, resourceId?: string, teamId?: string, interval?: string, dimensions?: string[], startAt?: string, endAt?: string, orderBy?: string, orderDir?: string, limit?: number, offset?: number): Promise<Models.UsageGaugeList>;
50
128
  }