@appwrite.io/console 15.0.0 → 15.1.1
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.
- package/README.md +1 -1
- package/dist/cjs/sdk.js +60 -54
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +60 -54
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +60 -54
- package/package.json +1 -1
- package/types/models.d.ts +44 -31
- package/types/services/compute.d.ts +2 -2
- package/types/services/databases.d.ts +14 -0
- package/types/services/functions.d.ts +13 -1
- package/types/services/health.d.ts +0 -19
- package/types/services/oauth-2.d.ts +12 -3
- package/types/services/sites.d.ts +13 -1
- package/types/services/usage.d.ts +22 -22
|
@@ -39,6 +39,7 @@ export declare class Oauth2 {
|
|
|
39
39
|
* @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.
|
|
40
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
41
|
* @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
42
|
+
* @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
42
43
|
* @throws {AppwriteException}
|
|
43
44
|
* @returns {Promise<Models.Oauth2Authorize>}
|
|
44
45
|
*/
|
|
@@ -54,6 +55,7 @@ export declare class Oauth2 {
|
|
|
54
55
|
prompt?: string;
|
|
55
56
|
maxAge?: number;
|
|
56
57
|
authorizationDetails?: string;
|
|
58
|
+
resource?: string;
|
|
57
59
|
}): Promise<Models.Oauth2Authorize>;
|
|
58
60
|
/**
|
|
59
61
|
* 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.
|
|
@@ -69,17 +71,19 @@ export declare class Oauth2 {
|
|
|
69
71
|
* @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.
|
|
70
72
|
* @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
73
|
* @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
74
|
+
* @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
72
75
|
* @throws {AppwriteException}
|
|
73
76
|
* @returns {Promise<Models.Oauth2Authorize>}
|
|
74
77
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
75
78
|
*/
|
|
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>;
|
|
79
|
+
authorize(clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string): Promise<Models.Oauth2Authorize>;
|
|
77
80
|
/**
|
|
78
81
|
* Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval.
|
|
79
82
|
*
|
|
80
83
|
* @param {string} params.clientId - OAuth2 client ID.
|
|
81
84
|
* @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`.
|
|
82
85
|
* @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
86
|
+
* @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
83
87
|
* @throws {AppwriteException}
|
|
84
88
|
* @returns {Promise<Models.Oauth2DeviceAuthorization>}
|
|
85
89
|
*/
|
|
@@ -87,6 +91,7 @@ export declare class Oauth2 {
|
|
|
87
91
|
clientId?: string;
|
|
88
92
|
scope?: string;
|
|
89
93
|
authorizationDetails?: string;
|
|
94
|
+
resource?: string;
|
|
90
95
|
}): Promise<Models.Oauth2DeviceAuthorization>;
|
|
91
96
|
/**
|
|
92
97
|
* Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval.
|
|
@@ -94,11 +99,12 @@ export declare class Oauth2 {
|
|
|
94
99
|
* @param {string} clientId - OAuth2 client ID.
|
|
95
100
|
* @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`.
|
|
96
101
|
* @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields
|
|
102
|
+
* @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
97
103
|
* @throws {AppwriteException}
|
|
98
104
|
* @returns {Promise<Models.Oauth2DeviceAuthorization>}
|
|
99
105
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
100
106
|
*/
|
|
101
|
-
createDeviceAuthorization(clientId?: string, scope?: string, authorizationDetails?: string): Promise<Models.Oauth2DeviceAuthorization>;
|
|
107
|
+
createDeviceAuthorization(clientId?: string, scope?: string, authorizationDetails?: string, resource?: string): Promise<Models.Oauth2DeviceAuthorization>;
|
|
102
108
|
/**
|
|
103
109
|
* 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
110
|
*
|
|
@@ -229,6 +235,7 @@ export declare class Oauth2 {
|
|
|
229
235
|
* @param {string} params.clientSecret - OAuth2 client secret. Required for confidential apps.
|
|
230
236
|
* @param {string} params.codeVerifier - PKCE code verifier. Required for public apps.
|
|
231
237
|
* @param {string} params.redirectUri - Redirect URI. Required for `authorization_code` grant type.
|
|
238
|
+
* @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
232
239
|
* @throws {AppwriteException}
|
|
233
240
|
* @returns {Promise<Models.Oauth2Token>}
|
|
234
241
|
*/
|
|
@@ -241,6 +248,7 @@ export declare class Oauth2 {
|
|
|
241
248
|
clientSecret?: string;
|
|
242
249
|
codeVerifier?: string;
|
|
243
250
|
redirectUri?: string;
|
|
251
|
+
resource?: string;
|
|
244
252
|
}): Promise<Models.Oauth2Token>;
|
|
245
253
|
/**
|
|
246
254
|
* Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens.
|
|
@@ -253,9 +261,10 @@ export declare class Oauth2 {
|
|
|
253
261
|
* @param {string} clientSecret - OAuth2 client secret. Required for confidential apps.
|
|
254
262
|
* @param {string} codeVerifier - PKCE code verifier. Required for public apps.
|
|
255
263
|
* @param {string} redirectUri - Redirect URI. Required for `authorization_code` grant type.
|
|
264
|
+
* @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.
|
|
256
265
|
* @throws {AppwriteException}
|
|
257
266
|
* @returns {Promise<Models.Oauth2Token>}
|
|
258
267
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
259
268
|
*/
|
|
260
|
-
createToken(grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string): Promise<Models.Oauth2Token>;
|
|
269
|
+
createToken(grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string, resource?: string): Promise<Models.Oauth2Token>;
|
|
261
270
|
}
|
|
@@ -131,10 +131,22 @@ export declare class Sites {
|
|
|
131
131
|
/**
|
|
132
132
|
* List allowed site specifications for this instance.
|
|
133
133
|
*
|
|
134
|
+
* @param {string} params.type - Specification type to list. Can be one of: runtimes, builds.
|
|
134
135
|
* @throws {AppwriteException}
|
|
135
136
|
* @returns {Promise<Models.SpecificationList>}
|
|
136
137
|
*/
|
|
137
|
-
listSpecifications(
|
|
138
|
+
listSpecifications(params?: {
|
|
139
|
+
type?: string;
|
|
140
|
+
}): Promise<Models.SpecificationList>;
|
|
141
|
+
/**
|
|
142
|
+
* List allowed site specifications for this instance.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} type - Specification type to list. Can be one of: runtimes, builds.
|
|
145
|
+
* @throws {AppwriteException}
|
|
146
|
+
* @returns {Promise<Models.SpecificationList>}
|
|
147
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
148
|
+
*/
|
|
149
|
+
listSpecifications(type?: string): Promise<Models.SpecificationList>;
|
|
138
150
|
/**
|
|
139
151
|
* List available site templates. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
|
|
140
152
|
*
|
|
@@ -4,15 +4,15 @@ export declare class Usage {
|
|
|
4
4
|
client: Client;
|
|
5
5
|
constructor(client: Client);
|
|
6
6
|
/**
|
|
7
|
-
* Aggregate usage event metrics. `
|
|
7
|
+
* Aggregate usage event metrics. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.
|
|
8
8
|
*
|
|
9
9
|
* **Two response shapes**:
|
|
10
|
-
* - Omit `interval` for a flat top-N table — one
|
|
11
|
-
* - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one
|
|
10
|
+
* - Omit `interval` for a flat top-N table — one point 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 point per (time bucket × dimension combination).
|
|
12
12
|
*
|
|
13
|
-
* `dimensions[]` breaks each
|
|
13
|
+
* `dimensions[]` breaks each point down by one or more attributes (service, path, status, country, …). Pass multiple metrics to render stacked charts in one round-trip. `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
14
|
*
|
|
15
|
-
* @param {string} params.metric -
|
|
15
|
+
* @param {string[]} params.metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=executions` or `metrics[]=executions&metrics[]=executions.compute` for stacked charts.
|
|
16
16
|
* @param {string} params.resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
|
|
17
17
|
* @param {string} params.resourceId - Resource id filter.
|
|
18
18
|
* @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
|
|
@@ -27,7 +27,7 @@ export declare class Usage {
|
|
|
27
27
|
* @returns {Promise<Models.UsageEventList>}
|
|
28
28
|
*/
|
|
29
29
|
listEvents(params: {
|
|
30
|
-
|
|
30
|
+
metrics: string[];
|
|
31
31
|
resource?: string;
|
|
32
32
|
resourceId?: string;
|
|
33
33
|
interval?: string;
|
|
@@ -40,15 +40,15 @@ export declare class Usage {
|
|
|
40
40
|
offset?: number;
|
|
41
41
|
}): Promise<Models.UsageEventList>;
|
|
42
42
|
/**
|
|
43
|
-
* Aggregate usage event metrics. `
|
|
43
|
+
* Aggregate usage event metrics. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.
|
|
44
44
|
*
|
|
45
45
|
* **Two response shapes**:
|
|
46
|
-
* - Omit `interval` for a flat top-N table — one
|
|
47
|
-
* - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one
|
|
46
|
+
* - Omit `interval` for a flat top-N table — one point 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 point per (time bucket × dimension combination).
|
|
48
48
|
*
|
|
49
|
-
* `dimensions[]` breaks each
|
|
49
|
+
* `dimensions[]` breaks each point down by one or more attributes (service, path, status, country, …). Pass multiple metrics to render stacked charts in one round-trip. `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).
|
|
50
50
|
*
|
|
51
|
-
* @param {string} metric -
|
|
51
|
+
* @param {string[]} metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=executions` or `metrics[]=executions&metrics[]=executions.compute` for stacked charts.
|
|
52
52
|
* @param {string} resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
|
|
53
53
|
* @param {string} resourceId - Resource id filter.
|
|
54
54
|
* @param {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
|
|
@@ -63,21 +63,21 @@ export declare class Usage {
|
|
|
63
63
|
* @returns {Promise<Models.UsageEventList>}
|
|
64
64
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
65
65
|
*/
|
|
66
|
-
listEvents(
|
|
66
|
+
listEvents(metrics: string[], resource?: string, resourceId?: string, interval?: string, dimensions?: string[], startAt?: string, endAt?: string, orderBy?: string, orderDir?: string, limit?: number, offset?: number): Promise<Models.UsageEventList>;
|
|
67
67
|
/**
|
|
68
|
-
* Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each
|
|
68
|
+
* Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each point carries the latest snapshot in its interval via `argMax(value, time)`. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.
|
|
69
69
|
*
|
|
70
70
|
* **Two response shapes**:
|
|
71
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
72
|
* - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
|
|
73
73
|
*
|
|
74
|
-
* `dimensions[]` breaks each
|
|
74
|
+
* `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resource`. `service` and `resource` enable per-service / per-resource-type panels (e.g. storage-by-service: group `files.storage`, `deployments.storage`, `builds.storage`, `databases.storage` by `service`). Pass multiple metrics to render stacked charts in one round-trip. `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
75
|
*
|
|
76
|
-
* @param {string} params.metric -
|
|
76
|
+
* @param {string[]} params.metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=files.storage` or `metrics[]=files.storage&metrics[]=deployments.storage` for stacked charts.
|
|
77
77
|
* @param {string} params.resourceId - Resource id filter.
|
|
78
78
|
* @param {string} params.teamId - Team id filter.
|
|
79
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.
|
|
80
|
+
* @param {string[]} params.dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resource.
|
|
81
81
|
* @param {string} params.startAt - Range start in ISO 8601. Defaults to endAt - 7d.
|
|
82
82
|
* @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
|
|
83
83
|
* @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time.
|
|
@@ -88,7 +88,7 @@ export declare class Usage {
|
|
|
88
88
|
* @returns {Promise<Models.UsageGaugeList>}
|
|
89
89
|
*/
|
|
90
90
|
listGauges(params: {
|
|
91
|
-
|
|
91
|
+
metrics: string[];
|
|
92
92
|
resourceId?: string;
|
|
93
93
|
teamId?: string;
|
|
94
94
|
interval?: string;
|
|
@@ -101,19 +101,19 @@ export declare class Usage {
|
|
|
101
101
|
offset?: number;
|
|
102
102
|
}): Promise<Models.UsageGaugeList>;
|
|
103
103
|
/**
|
|
104
|
-
* Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each
|
|
104
|
+
* Aggregate usage gauge snapshots. Gauges are point-in-time values (storage totals, resource counts, …); each point carries the latest snapshot in its interval via `argMax(value, time)`. `metrics[]` (1-10) is required; the response always contains one entry per requested metric, each with its own `points[]` time series.
|
|
105
105
|
*
|
|
106
106
|
* **Two response shapes**:
|
|
107
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
108
|
* - Pass `interval` (`1m`, `15m`, `30m`, `1h`, `1d`) for a time series — one snapshot per (time bucket × dimension combination).
|
|
109
109
|
*
|
|
110
|
-
* `dimensions[]` breaks each
|
|
110
|
+
* `dimensions[]` breaks each point down further. Supported on gauges: `resourceId`, `teamId`, `service`, `resource`. `service` and `resource` enable per-service / per-resource-type panels (e.g. storage-by-service: group `files.storage`, `deployments.storage`, `builds.storage`, `databases.storage` by `service`). Pass multiple metrics to render stacked charts in one round-trip. `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).
|
|
111
111
|
*
|
|
112
|
-
* @param {string} metric -
|
|
112
|
+
* @param {string[]} metrics - One to ten metric names. Single-metric callers pass a one-element array. Example: `metrics[]=files.storage` or `metrics[]=files.storage&metrics[]=deployments.storage` for stacked charts.
|
|
113
113
|
* @param {string} resourceId - Resource id filter.
|
|
114
114
|
* @param {string} teamId - Team id filter.
|
|
115
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.
|
|
116
|
+
* @param {string[]} dimensions - Break-down dimensions. Allowed: resourceId, teamId, service, resource.
|
|
117
117
|
* @param {string} startAt - Range start in ISO 8601. Defaults to endAt - 7d.
|
|
118
118
|
* @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
|
|
119
119
|
* @param {string} orderBy - Column to order by. Allowed: time, value. Default time.
|
|
@@ -124,5 +124,5 @@ export declare class Usage {
|
|
|
124
124
|
* @returns {Promise<Models.UsageGaugeList>}
|
|
125
125
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
126
126
|
*/
|
|
127
|
-
listGauges(
|
|
127
|
+
listGauges(metrics: string[], resourceId?: string, teamId?: string, interval?: string, dimensions?: string[], startAt?: string, endAt?: string, orderBy?: string, orderDir?: string, limit?: number, offset?: number): Promise<Models.UsageGaugeList>;
|
|
128
128
|
}
|