@appwrite.io/console 15.6.0 → 15.7.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/README.md CHANGED
@@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
33
33
  To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
34
34
 
35
35
  ```html
36
- <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@15.6.0"></script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@15.7.0"></script>
37
37
  ```
38
38
 
39
39
 
package/dist/cjs/sdk.js CHANGED
@@ -647,7 +647,7 @@ class Client {
647
647
  'x-sdk-name': 'Console',
648
648
  'x-sdk-platform': 'console',
649
649
  'x-sdk-language': 'web',
650
- 'x-sdk-version': '15.6.0',
650
+ 'x-sdk-version': '15.7.0',
651
651
  'X-Appwrite-Response-Format': '1.9.5',
652
652
  };
653
653
  this.realtime = {
@@ -9732,12 +9732,14 @@ class DocumentsDB {
9732
9732
  databaseId: paramsOrFirst,
9733
9733
  name: rest[0],
9734
9734
  enabled: rest[1],
9735
- replicas: rest[2]
9735
+ specification: rest[2],
9736
+ replicas: rest[3]
9736
9737
  };
9737
9738
  }
9738
9739
  const databaseId = params.databaseId;
9739
9740
  const name = params.name;
9740
9741
  const enabled = params.enabled;
9742
+ const specification = params.specification;
9741
9743
  const replicas = params.replicas;
9742
9744
  if (typeof databaseId === 'undefined') {
9743
9745
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -9753,6 +9755,9 @@ class DocumentsDB {
9753
9755
  if (typeof enabled !== 'undefined') {
9754
9756
  payload['enabled'] = enabled;
9755
9757
  }
9758
+ if (typeof specification !== 'undefined') {
9759
+ payload['specification'] = specification;
9760
+ }
9756
9761
  if (typeof replicas !== 'undefined') {
9757
9762
  payload['replicas'] = replicas;
9758
9763
  }
@@ -31377,14 +31382,16 @@ class Storage {
31377
31382
  bucketId: paramsOrFirst,
31378
31383
  fileId: rest[0],
31379
31384
  file: rest[1],
31380
- permissions: rest[2]
31385
+ permissions: rest[2],
31386
+ folder: rest[3]
31381
31387
  };
31382
- onProgress = rest[3];
31388
+ onProgress = rest[4];
31383
31389
  }
31384
31390
  const bucketId = params.bucketId;
31385
31391
  const fileId = params.fileId;
31386
31392
  const file = params.file;
31387
31393
  const permissions = params.permissions;
31394
+ const folder = params.folder;
31388
31395
  if (typeof bucketId === 'undefined') {
31389
31396
  throw new AppwriteException('Missing required parameter: "bucketId"');
31390
31397
  }
@@ -31405,6 +31412,9 @@ class Storage {
31405
31412
  if (typeof permissions !== 'undefined') {
31406
31413
  payload['permissions'] = permissions;
31407
31414
  }
31415
+ if (typeof folder !== 'undefined') {
31416
+ payload['folder'] = folder;
31417
+ }
31408
31418
  const uri = new URL(this.client.config.endpoint + apiPath);
31409
31419
  const apiHeaders = {
31410
31420
  'X-Appwrite-Project': this.client.config.project,
@@ -31965,12 +31975,14 @@ class TablesDB {
31965
31975
  databaseId: paramsOrFirst,
31966
31976
  name: rest[0],
31967
31977
  enabled: rest[1],
31968
- replicas: rest[2]
31978
+ specification: rest[2],
31979
+ replicas: rest[3]
31969
31980
  };
31970
31981
  }
31971
31982
  const databaseId = params.databaseId;
31972
31983
  const name = params.name;
31973
31984
  const enabled = params.enabled;
31985
+ const specification = params.specification;
31974
31986
  const replicas = params.replicas;
31975
31987
  if (typeof databaseId === 'undefined') {
31976
31988
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -31983,6 +31995,9 @@ class TablesDB {
31983
31995
  if (typeof enabled !== 'undefined') {
31984
31996
  payload['enabled'] = enabled;
31985
31997
  }
31998
+ if (typeof specification !== 'undefined') {
31999
+ payload['specification'] = specification;
32000
+ }
31986
32001
  if (typeof replicas !== 'undefined') {
31987
32002
  payload['replicas'] = replicas;
31988
32003
  }
@@ -38716,12 +38731,14 @@ class VectorsDB {
38716
38731
  databaseId: paramsOrFirst,
38717
38732
  name: rest[0],
38718
38733
  enabled: rest[1],
38719
- replicas: rest[2]
38734
+ specification: rest[2],
38735
+ replicas: rest[3]
38720
38736
  };
38721
38737
  }
38722
38738
  const databaseId = params.databaseId;
38723
38739
  const name = params.name;
38724
38740
  const enabled = params.enabled;
38741
+ const specification = params.specification;
38725
38742
  const replicas = params.replicas;
38726
38743
  if (typeof databaseId === 'undefined') {
38727
38744
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -38737,6 +38754,9 @@ class VectorsDB {
38737
38754
  if (typeof enabled !== 'undefined') {
38738
38755
  payload['enabled'] = enabled;
38739
38756
  }
38757
+ if (typeof specification !== 'undefined') {
38758
+ payload['specification'] = specification;
38759
+ }
38740
38760
  if (typeof replicas !== 'undefined') {
38741
38761
  payload['replicas'] = replicas;
38742
38762
  }
@@ -39919,6 +39939,143 @@ class Waf {
39919
39939
  };
39920
39940
  return this.client.call('patch', uri, apiHeaders, payload);
39921
39941
  }
39942
+ createChallengeRule(paramsOrFirst, ...rest) {
39943
+ let params;
39944
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
39945
+ params = (paramsOrFirst || {});
39946
+ }
39947
+ else {
39948
+ params = {
39949
+ ruleId: paramsOrFirst,
39950
+ resourceType: rest[0],
39951
+ name: rest[1],
39952
+ resourceId: rest[2],
39953
+ description: rest[3],
39954
+ challengeType: rest[4],
39955
+ priority: rest[5],
39956
+ enabled: rest[6],
39957
+ conditions: rest[7]
39958
+ };
39959
+ }
39960
+ const ruleId = params.ruleId;
39961
+ const resourceType = params.resourceType;
39962
+ const name = params.name;
39963
+ const resourceId = params.resourceId;
39964
+ const description = params.description;
39965
+ const challengeType = params.challengeType;
39966
+ const priority = params.priority;
39967
+ const enabled = params.enabled;
39968
+ const conditions = params.conditions;
39969
+ if (typeof ruleId === 'undefined') {
39970
+ throw new AppwriteException('Missing required parameter: "ruleId"');
39971
+ }
39972
+ if (typeof resourceType === 'undefined') {
39973
+ throw new AppwriteException('Missing required parameter: "resourceType"');
39974
+ }
39975
+ if (typeof name === 'undefined') {
39976
+ throw new AppwriteException('Missing required parameter: "name"');
39977
+ }
39978
+ const apiPath = '/waf/rules/challenge';
39979
+ const payload = {};
39980
+ if (typeof ruleId !== 'undefined') {
39981
+ payload['ruleId'] = ruleId;
39982
+ }
39983
+ if (typeof resourceType !== 'undefined') {
39984
+ payload['resourceType'] = resourceType;
39985
+ }
39986
+ if (typeof resourceId !== 'undefined') {
39987
+ payload['resourceId'] = resourceId;
39988
+ }
39989
+ if (typeof name !== 'undefined') {
39990
+ payload['name'] = name;
39991
+ }
39992
+ if (typeof description !== 'undefined') {
39993
+ payload['description'] = description;
39994
+ }
39995
+ if (typeof challengeType !== 'undefined') {
39996
+ payload['challengeType'] = challengeType;
39997
+ }
39998
+ if (typeof priority !== 'undefined') {
39999
+ payload['priority'] = priority;
40000
+ }
40001
+ if (typeof enabled !== 'undefined') {
40002
+ payload['enabled'] = enabled;
40003
+ }
40004
+ if (typeof conditions !== 'undefined') {
40005
+ payload['conditions'] = conditions;
40006
+ }
40007
+ const uri = new URL(this.client.config.endpoint + apiPath);
40008
+ const apiHeaders = {
40009
+ 'X-Appwrite-Project': this.client.config.project,
40010
+ 'content-type': 'application/json',
40011
+ 'accept': 'application/json',
40012
+ };
40013
+ return this.client.call('post', uri, apiHeaders, payload);
40014
+ }
40015
+ updateChallengeRule(paramsOrFirst, ...rest) {
40016
+ let params;
40017
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
40018
+ params = (paramsOrFirst || {});
40019
+ }
40020
+ else {
40021
+ params = {
40022
+ ruleId: paramsOrFirst,
40023
+ resourceType: rest[0],
40024
+ resourceId: rest[1],
40025
+ name: rest[2],
40026
+ description: rest[3],
40027
+ challengeType: rest[4],
40028
+ priority: rest[5],
40029
+ enabled: rest[6],
40030
+ conditions: rest[7]
40031
+ };
40032
+ }
40033
+ const ruleId = params.ruleId;
40034
+ const resourceType = params.resourceType;
40035
+ const resourceId = params.resourceId;
40036
+ const name = params.name;
40037
+ const description = params.description;
40038
+ const challengeType = params.challengeType;
40039
+ const priority = params.priority;
40040
+ const enabled = params.enabled;
40041
+ const conditions = params.conditions;
40042
+ if (typeof ruleId === 'undefined') {
40043
+ throw new AppwriteException('Missing required parameter: "ruleId"');
40044
+ }
40045
+ const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
40046
+ const payload = {};
40047
+ if (typeof resourceType !== 'undefined') {
40048
+ payload['resourceType'] = resourceType;
40049
+ }
40050
+ if (typeof resourceId !== 'undefined') {
40051
+ payload['resourceId'] = resourceId;
40052
+ }
40053
+ if (typeof name !== 'undefined') {
40054
+ payload['name'] = name;
40055
+ }
40056
+ if (typeof description !== 'undefined') {
40057
+ payload['description'] = description;
40058
+ }
40059
+ if (typeof challengeType !== 'undefined') {
40060
+ payload['challengeType'] = challengeType;
40061
+ }
40062
+ if (typeof priority !== 'undefined') {
40063
+ payload['priority'] = priority;
40064
+ }
40065
+ if (typeof enabled !== 'undefined') {
40066
+ payload['enabled'] = enabled;
40067
+ }
40068
+ if (typeof conditions !== 'undefined') {
40069
+ payload['conditions'] = conditions;
40070
+ }
40071
+ const uri = new URL(this.client.config.endpoint + apiPath);
40072
+ const apiHeaders = {
40073
+ 'X-Appwrite-Project': this.client.config.project,
40074
+ 'content-type': 'application/json',
40075
+ 'accept': 'application/json',
40076
+ };
40077
+ return this.client.call('patch', uri, apiHeaders, payload);
40078
+ }
39922
40079
  createDenyRule(paramsOrFirst, ...rest) {
39923
40080
  let params;
39924
40081
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {