@appwrite.io/console 15.1.0 → 15.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/iife/sdk.js CHANGED
@@ -4420,7 +4420,7 @@
4420
4420
  'x-sdk-name': 'Console',
4421
4421
  'x-sdk-platform': 'console',
4422
4422
  'x-sdk-language': 'web',
4423
- 'x-sdk-version': '15.1.0',
4423
+ 'x-sdk-version': '15.2.0',
4424
4424
  'X-Appwrite-Response-Format': '1.9.5',
4425
4425
  };
4426
4426
  this.realtime = {
@@ -4472,7 +4472,10 @@
4472
4472
  }
4473
4473
  const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : '');
4474
4474
  // URL carries only the project; channels/queries are sent via subscribe message.
4475
- const queryParams = 'project=' + encodedProject;
4475
+ let queryParams = 'project=' + encodedProject;
4476
+ if (this.config.jwt) {
4477
+ queryParams += '&jwt=' + encodeURIComponent(this.config.jwt);
4478
+ }
4476
4479
  const url = this.config.endpointRealtime + '/realtime?' + queryParams;
4477
4480
  if (url !== this.realtime.url || // Check if URL is present
4478
4481
  !this.realtime.socket || // Check if WebSocket has not been created
@@ -18087,15 +18090,22 @@
18087
18090
  };
18088
18091
  return this.client.call('get', uri, apiHeaders, payload);
18089
18092
  }
18090
- /**
18091
- * List allowed function specifications for this instance.
18092
- *
18093
- * @throws {AppwriteException}
18094
- * @returns {Promise<Models.SpecificationList>}
18095
- */
18096
- listSpecifications() {
18093
+ listSpecifications(paramsOrFirst) {
18094
+ let params;
18095
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
18096
+ params = (paramsOrFirst || {});
18097
+ }
18098
+ else {
18099
+ params = {
18100
+ type: paramsOrFirst
18101
+ };
18102
+ }
18103
+ const type = params.type;
18097
18104
  const apiPath = '/functions/specifications';
18098
18105
  const payload = {};
18106
+ if (typeof type !== 'undefined') {
18107
+ payload['type'] = type;
18108
+ }
18099
18109
  const uri = new URL(this.client.config.endpoint + apiPath);
18100
18110
  const apiHeaders = {
18101
18111
  'X-Appwrite-Project': this.client.config.project,
@@ -19430,29 +19440,6 @@
19430
19440
  };
19431
19441
  return this.client.call('get', uri, apiHeaders, payload);
19432
19442
  }
19433
- getQueuePriorityBuilds(paramsOrFirst) {
19434
- let params;
19435
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
19436
- params = (paramsOrFirst || {});
19437
- }
19438
- else {
19439
- params = {
19440
- threshold: paramsOrFirst
19441
- };
19442
- }
19443
- const threshold = params.threshold;
19444
- const apiPath = '/health/queue/builds-priority';
19445
- const payload = {};
19446
- if (typeof threshold !== 'undefined') {
19447
- payload['threshold'] = threshold;
19448
- }
19449
- const uri = new URL(this.client.config.endpoint + apiPath);
19450
- const apiHeaders = {
19451
- 'X-Appwrite-Project': this.client.config.project,
19452
- 'accept': 'application/json',
19453
- };
19454
- return this.client.call('get', uri, apiHeaders, payload);
19455
- }
19456
19443
  getQueueCertificates(paramsOrFirst) {
19457
19444
  let params;
19458
19445
  if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -30930,15 +30917,22 @@
30930
30917
  };
30931
30918
  return this.client.call('get', uri, apiHeaders, payload);
30932
30919
  }
30933
- /**
30934
- * List allowed site specifications for this instance.
30935
- *
30936
- * @throws {AppwriteException}
30937
- * @returns {Promise<Models.SpecificationList>}
30938
- */
30939
- listSpecifications() {
30920
+ listSpecifications(paramsOrFirst) {
30921
+ let params;
30922
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
30923
+ params = (paramsOrFirst || {});
30924
+ }
30925
+ else {
30926
+ params = {
30927
+ type: paramsOrFirst
30928
+ };
30929
+ }
30930
+ const type = params.type;
30940
30931
  const apiPath = '/sites/specifications';
30941
30932
  const payload = {};
30933
+ if (typeof type !== 'undefined') {
30934
+ payload['type'] = type;
30935
+ }
30942
30936
  const uri = new URL(this.client.config.endpoint + apiPath);
30943
30937
  const apiHeaders = {
30944
30938
  'X-Appwrite-Project': this.client.config.project,
@@ -40602,7 +40596,11 @@
40602
40596
  throw new AppwriteException('Missing project ID');
40603
40597
  }
40604
40598
  // URL carries only the project; channels/queries are sent via the subscribe message.
40605
- const queryParams = `project=${projectId}`;
40599
+ let queryParams = `project=${projectId}`;
40600
+ const jwt = this.client.config.jwt;
40601
+ if (jwt) {
40602
+ queryParams += `&jwt=${encodeURIComponent(jwt)}`;
40603
+ }
40606
40604
  const endpoint = this.client.config.endpointRealtime !== ''
40607
40605
  ? this.client.config.endpointRealtime
40608
40606
  : this.client.config.endpoint || '';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appwrite.io/console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
5
- "version": "15.1.0",
5
+ "version": "15.2.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
@@ -128,10 +128,22 @@ export declare class Functions {
128
128
  /**
129
129
  * List allowed function specifications for this instance.
130
130
  *
131
+ * @param {string} params.type - Specification type to list. Can be one of: runtimes, builds.
131
132
  * @throws {AppwriteException}
132
133
  * @returns {Promise<Models.SpecificationList>}
133
134
  */
134
- listSpecifications(): Promise<Models.SpecificationList>;
135
+ listSpecifications(params?: {
136
+ type?: string;
137
+ }): Promise<Models.SpecificationList>;
138
+ /**
139
+ * List allowed function specifications for this instance.
140
+ *
141
+ * @param {string} type - Specification type to list. Can be one of: runtimes, builds.
142
+ * @throws {AppwriteException}
143
+ * @returns {Promise<Models.SpecificationList>}
144
+ * @deprecated Use the object parameter style method for a better developer experience.
145
+ */
146
+ listSpecifications(type?: string): Promise<Models.SpecificationList>;
135
147
  /**
136
148
  * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
137
149
  *
@@ -168,25 +168,6 @@ export declare class Health {
168
168
  * @deprecated Use the object parameter style method for a better developer experience.
169
169
  */
170
170
  getQueueBuilds(threshold?: number): Promise<Models.HealthQueue>;
171
- /**
172
- * Get the priority builds queue size.
173
- *
174
- * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500.
175
- * @throws {AppwriteException}
176
- * @returns {Promise<Models.HealthQueue>}
177
- */
178
- getQueuePriorityBuilds(params?: {
179
- threshold?: number;
180
- }): Promise<Models.HealthQueue>;
181
- /**
182
- * Get the priority builds queue size.
183
- *
184
- * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500.
185
- * @throws {AppwriteException}
186
- * @returns {Promise<Models.HealthQueue>}
187
- * @deprecated Use the object parameter style method for a better developer experience.
188
- */
189
- getQueuePriorityBuilds(threshold?: number): Promise<Models.HealthQueue>;
190
171
  /**
191
172
  * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
192
173
  *
@@ -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(): Promise<Models.SpecificationList>;
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
  *
@@ -16,7 +16,7 @@ export declare class Usage {
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.
19
- * @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
19
+ * @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resource, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
20
20
  * @param {string} params.startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
21
21
  * @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
22
22
  * @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
@@ -52,7 +52,7 @@ export declare class Usage {
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.
55
- * @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
55
+ * @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resource, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
56
56
  * @param {string} startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
57
57
  * @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
58
58
  * @param {string} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.