@appwrite.io/console 2.0.0 → 2.1.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
@@ -464,11 +464,13 @@
464
464
  this.config = {
465
465
  endpoint: 'https://cloud.appwrite.io/v1',
466
466
  endpointRealtime: '',
467
+ selfSigned: false,
467
468
  project: '',
468
469
  key: '',
469
470
  jwt: '',
470
471
  locale: '',
471
472
  mode: '',
473
+ cookie: '',
472
474
  platform: '',
473
475
  };
474
476
  /**
@@ -478,7 +480,7 @@
478
480
  'x-sdk-name': 'Console',
479
481
  'x-sdk-platform': 'console',
480
482
  'x-sdk-language': 'web',
481
- 'x-sdk-version': '2.0.0',
483
+ 'x-sdk-version': '2.1.0',
482
484
  'X-Appwrite-Response-Format': '1.8.0',
483
485
  };
484
486
  this.realtime = {
@@ -669,6 +671,17 @@
669
671
  this.config.endpointRealtime = endpointRealtime;
670
672
  return this;
671
673
  }
674
+ /**
675
+ * Set self-signed
676
+ *
677
+ * @param {boolean} selfSigned
678
+ *
679
+ * @returns {this}
680
+ */
681
+ setSelfSigned(selfSigned) {
682
+ this.config.selfSigned = selfSigned;
683
+ return this;
684
+ }
672
685
  /**
673
686
  * Set Project
674
687
  *
@@ -735,6 +748,20 @@
735
748
  this.config.mode = value;
736
749
  return this;
737
750
  }
751
+ /**
752
+ * Set Cookie
753
+ *
754
+ * The user cookie to authenticate with
755
+ *
756
+ * @param value string
757
+ *
758
+ * @return {this}
759
+ */
760
+ setCookie(value) {
761
+ this.headers['Cookie'] = value;
762
+ this.config.cookie = value;
763
+ return this;
764
+ }
738
765
  /**
739
766
  * Set Platform
740
767
  *
@@ -9,7 +9,7 @@ const account = new Account(client);
9
9
  const result = await account.updatePaymentMethod({
10
10
  paymentMethodId: '<PAYMENT_METHOD_ID>',
11
11
  expiryMonth: 1,
12
- expiryYear: 2025,
12
+ expiryYear: 2026,
13
13
  state: '<STATE>' // optional
14
14
  });
15
15
 
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": "2.0.0",
5
+ "version": "2.1.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -303,15 +303,18 @@ class Client {
303
303
  config: {
304
304
  endpoint: string;
305
305
  endpointRealtime: string;
306
- [key: string]: string | undefined;
306
+ selfSigned: boolean;
307
+ [key: string]: string | boolean | undefined;
307
308
  } = {
308
309
  endpoint: 'https://cloud.appwrite.io/v1',
309
310
  endpointRealtime: '',
311
+ selfSigned: false,
310
312
  project: '',
311
313
  key: '',
312
314
  jwt: '',
313
315
  locale: '',
314
316
  mode: '',
317
+ cookie: '',
315
318
  platform: '',
316
319
  };
317
320
  /**
@@ -321,7 +324,7 @@ class Client {
321
324
  'x-sdk-name': 'Console',
322
325
  'x-sdk-platform': 'console',
323
326
  'x-sdk-language': 'web',
324
- 'x-sdk-version': '2.0.0',
327
+ 'x-sdk-version': '2.1.0',
325
328
  'X-Appwrite-Response-Format': '1.8.0',
326
329
  };
327
330
 
@@ -369,6 +372,18 @@ class Client {
369
372
  return this;
370
373
  }
371
374
 
375
+ /**
376
+ * Set self-signed
377
+ *
378
+ * @param {boolean} selfSigned
379
+ *
380
+ * @returns {this}
381
+ */
382
+ setSelfSigned(selfSigned: boolean): this {
383
+ this.config.selfSigned = selfSigned;
384
+ return this;
385
+ }
386
+
372
387
  /**
373
388
  * Set Project
374
389
  *
@@ -435,6 +450,20 @@ class Client {
435
450
  this.config.mode = value;
436
451
  return this;
437
452
  }
453
+ /**
454
+ * Set Cookie
455
+ *
456
+ * The user cookie to authenticate with
457
+ *
458
+ * @param value string
459
+ *
460
+ * @return {this}
461
+ */
462
+ setCookie(value: string): this {
463
+ this.headers['Cookie'] = value;
464
+ this.config.cookie = value;
465
+ return this;
466
+ }
438
467
  /**
439
468
  * Set Platform
440
469
  *
@@ -499,7 +528,7 @@ class Client {
499
528
 
500
529
  const channels = new URLSearchParams();
501
530
  if (this.config.project) {
502
- channels.set('project', this.config.project);
531
+ channels.set('project', this.config.project as string);
503
532
  }
504
533
  this.realtime.channels.forEach(channel => {
505
534
  channels.append('channels[]', channel);
package/types/client.d.ts CHANGED
@@ -95,7 +95,8 @@ declare class Client {
95
95
  config: {
96
96
  endpoint: string;
97
97
  endpointRealtime: string;
98
- [key: string]: string | undefined;
98
+ selfSigned: boolean;
99
+ [key: string]: string | boolean | undefined;
99
100
  };
100
101
  /**
101
102
  * Custom headers for API requests.
@@ -119,6 +120,14 @@ declare class Client {
119
120
  * @returns {this}
120
121
  */
121
122
  setEndpointRealtime(endpointRealtime: string): this;
123
+ /**
124
+ * Set self-signed
125
+ *
126
+ * @param {boolean} selfSigned
127
+ *
128
+ * @returns {this}
129
+ */
130
+ setSelfSigned(selfSigned: boolean): this;
122
131
  /**
123
132
  * Set Project
124
133
  *
@@ -165,6 +174,16 @@ declare class Client {
165
174
  * @return {this}
166
175
  */
167
176
  setMode(value: string): this;
177
+ /**
178
+ * Set Cookie
179
+ *
180
+ * The user cookie to authenticate with
181
+ *
182
+ * @param value string
183
+ *
184
+ * @return {this}
185
+ */
186
+ setCookie(value: string): this;
168
187
  /**
169
188
  * Set Platform
170
189
  *