@appwrite.io/console 1.4.0 → 1.4.2

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
@@ -281,7 +281,7 @@
281
281
  'x-sdk-name': 'Console',
282
282
  'x-sdk-platform': 'console',
283
283
  'x-sdk-language': 'web',
284
- 'x-sdk-version': '1.4.0',
284
+ 'x-sdk-version': '1.4.2',
285
285
  'X-Appwrite-Response-Format': '1.6.0',
286
286
  };
287
287
  this.realtime = {
@@ -821,7 +821,7 @@
821
821
  * @param {string} postalCode
822
822
  * @param {string} addressLine2
823
823
  * @throws {AppwriteException}
824
- * @returns {Promise<{}>}
824
+ * @returns {Promise<Models.BillingAddress>}
825
825
  */
826
826
  createBillingAddress(country, streetAddress, city, state, postalCode, addressLine2) {
827
827
  return __awaiter(this, void 0, void 0, function* () {
@@ -898,7 +898,7 @@
898
898
  * @param {string} postalCode
899
899
  * @param {string} addressLine2
900
900
  * @throws {AppwriteException}
901
- * @returns {Promise<{}>}
901
+ * @returns {Promise<Models.BillingAddress>}
902
902
  */
903
903
  updateBillingAddress(billingAddressId, country, streetAddress, city, state, postalCode, addressLine2) {
904
904
  return __awaiter(this, void 0, void 0, function* () {
@@ -11067,6 +11067,35 @@
11067
11067
  return yield this.client.call('patch', uri, apiHeaders, payload);
11068
11068
  });
11069
11069
  }
11070
+ /**
11071
+ * Update project team sensitive attributes
11072
+ *
11073
+ *
11074
+ * @param {string} projectId
11075
+ * @param {boolean} enabled
11076
+ * @throws {AppwriteException}
11077
+ * @returns {Promise<Models.Project>}
11078
+ */
11079
+ updateTeamsSensitiveAttributes(projectId, enabled) {
11080
+ return __awaiter(this, void 0, void 0, function* () {
11081
+ if (typeof projectId === 'undefined') {
11082
+ throw new AppwriteException('Missing required parameter: "projectId"');
11083
+ }
11084
+ if (typeof enabled === 'undefined') {
11085
+ throw new AppwriteException('Missing required parameter: "enabled"');
11086
+ }
11087
+ const apiPath = '/projects/{projectId}/auth/teams-sensitive-attributes'.replace('{projectId}', projectId);
11088
+ const payload = {};
11089
+ if (typeof enabled !== 'undefined') {
11090
+ payload['enabled'] = enabled;
11091
+ }
11092
+ const uri = new URL(this.client.config.endpoint + apiPath);
11093
+ const apiHeaders = {
11094
+ 'content-type': 'application/json',
11095
+ };
11096
+ return yield this.client.call('patch', uri, apiHeaders, payload);
11097
+ });
11098
+ }
11070
11099
  /**
11071
11100
  * Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.
11072
11101
  *
@@ -13035,7 +13064,7 @@
13035
13064
  /**
13036
13065
  * List team memberships
13037
13066
  *
13038
- * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
13067
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console.
13039
13068
  *
13040
13069
  * @param {string} teamId
13041
13070
  * @param {string[]} queries
@@ -13123,7 +13152,7 @@
13123
13152
  /**
13124
13153
  * Get team membership
13125
13154
  *
13126
- * Get a team member by the membership unique id. All team members have read access for this resource.
13155
+ * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console.
13127
13156
  *
13128
13157
  * @param {string} teamId
13129
13158
  * @param {string} membershipId
@@ -15545,6 +15574,7 @@
15545
15574
  Runtime["Bun10"] = "bun-1.0";
15546
15575
  Runtime["Bun11"] = "bun-1.1";
15547
15576
  Runtime["Go123"] = "go-1.23";
15577
+ Runtime["Static1"] = "static-1";
15548
15578
  })(exports.Runtime || (exports.Runtime = {}));
15549
15579
 
15550
15580
  exports.FunctionUsageRange = void 0;
@@ -12,7 +12,7 @@ const result = await databases.updateStringAttribute(
12
12
  '', // key
13
13
  false, // required
14
14
  '<DEFAULT>', // default
15
- null, // size (optional)
15
+ 1, // size (optional)
16
16
  '' // newKey (optional)
17
17
  );
18
18
 
@@ -0,0 +1,14 @@
1
+ import { Client, Projects } from "@appwrite.io/console";
2
+
3
+ const client = new Client()
4
+ .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5
+ .setProject('<YOUR_PROJECT_ID>'); // Your project ID
6
+
7
+ const projects = new Projects(client);
8
+
9
+ const result = await projects.updateTeamsSensitiveAttributes(
10
+ '<PROJECT_ID>', // projectId
11
+ false // enabled
12
+ );
13
+
14
+ console.log(result);
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 abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "1.4.0",
5
+ "version": "1.4.2",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
package/src/client.ts CHANGED
@@ -304,7 +304,7 @@ class Client {
304
304
  'x-sdk-name': 'Console',
305
305
  'x-sdk-platform': 'console',
306
306
  'x-sdk-language': 'web',
307
- 'x-sdk-version': '1.4.0',
307
+ 'x-sdk-version': '1.4.2',
308
308
  'X-Appwrite-Response-Format': '1.6.0',
309
309
  };
310
310
 
@@ -53,4 +53,5 @@ export enum Runtime {
53
53
  Bun10 = 'bun-1.0',
54
54
  Bun11 = 'bun-1.1',
55
55
  Go123 = 'go-1.23',
56
+ Static1 = 'static-1',
56
57
  }
package/src/models.ts CHANGED
@@ -1848,11 +1848,11 @@ export namespace Models {
1848
1848
  */
1849
1849
  userId: string;
1850
1850
  /**
1851
- * User name.
1851
+ * User name. Hide this attribute by disabling teams sensitive data in the Console.
1852
1852
  */
1853
1853
  userName: string;
1854
1854
  /**
1855
- * User email address.
1855
+ * User email address. Hide this attribute by disabling teams sensitive data in the Console.
1856
1856
  */
1857
1857
  userEmail: string;
1858
1858
  /**
@@ -1876,7 +1876,7 @@ export namespace Models {
1876
1876
  */
1877
1877
  confirm: boolean;
1878
1878
  /**
1879
- * Multi factor authentication status, true if the user has MFA enabled or false otherwise.
1879
+ * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by disabling teams sensitive data in the Console.
1880
1880
  */
1881
1881
  mfa: boolean;
1882
1882
  /**
@@ -2549,6 +2549,10 @@ export namespace Models {
2549
2549
  * Whether or not to send session alert emails to users.
2550
2550
  */
2551
2551
  authSessionAlerts: boolean;
2552
+ /**
2553
+ * Whether or not to show sensitive attributes in the teams API.
2554
+ */
2555
+ teamsSensitiveAttributes: boolean;
2552
2556
  /**
2553
2557
  * List of Auth Providers.
2554
2558
  */
@@ -3979,6 +3983,10 @@ export namespace Models {
3979
3983
  * The target identifier.
3980
3984
  */
3981
3985
  identifier: string;
3986
+ /**
3987
+ * Is the target expired.
3988
+ */
3989
+ expired: boolean;
3982
3990
  }
3983
3991
  /**
3984
3992
  * Migration
@@ -4009,7 +4017,11 @@ export namespace Models {
4009
4017
  */
4010
4018
  source: string;
4011
4019
  /**
4012
- * Resources to migration.
4020
+ * A string containing the type of destination of the migration.
4021
+ */
4022
+ destination: string;
4023
+ /**
4024
+ * Resources to migrate.
4013
4025
  */
4014
4026
  resources: string[];
4015
4027
  /**
@@ -151,9 +151,9 @@ export class Account {
151
151
  * @param {string} postalCode
152
152
  * @param {string} addressLine2
153
153
  * @throws {AppwriteException}
154
- * @returns {Promise<{}>}
154
+ * @returns {Promise<Models.BillingAddress>}
155
155
  */
156
- async createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<{}> {
156
+ async createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress> {
157
157
  if (typeof country === 'undefined') {
158
158
  throw new AppwriteException('Missing required parameter: "country"');
159
159
  }
@@ -240,9 +240,9 @@ export class Account {
240
240
  * @param {string} postalCode
241
241
  * @param {string} addressLine2
242
242
  * @throws {AppwriteException}
243
- * @returns {Promise<{}>}
243
+ * @returns {Promise<Models.BillingAddress>}
244
244
  */
245
- async updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<{}> {
245
+ async updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress> {
246
246
  if (typeof billingAddressId === 'undefined') {
247
247
  throw new AppwriteException('Missing required parameter: "billingAddressId"');
248
248
  }
@@ -614,6 +614,41 @@ export class Projects {
614
614
  }
615
615
 
616
616
 
617
+ return await this.client.call(
618
+ 'patch',
619
+ uri,
620
+ apiHeaders,
621
+ payload
622
+ );
623
+ }
624
+ /**
625
+ * Update project team sensitive attributes
626
+ *
627
+ *
628
+ * @param {string} projectId
629
+ * @param {boolean} enabled
630
+ * @throws {AppwriteException}
631
+ * @returns {Promise<Models.Project>}
632
+ */
633
+ async updateTeamsSensitiveAttributes(projectId: string, enabled: boolean): Promise<Models.Project> {
634
+ if (typeof projectId === 'undefined') {
635
+ throw new AppwriteException('Missing required parameter: "projectId"');
636
+ }
637
+ if (typeof enabled === 'undefined') {
638
+ throw new AppwriteException('Missing required parameter: "enabled"');
639
+ }
640
+ const apiPath = '/projects/{projectId}/auth/teams-sensitive-attributes'.replace('{projectId}', projectId);
641
+ const payload: Payload = {};
642
+ if (typeof enabled !== 'undefined') {
643
+ payload['enabled'] = enabled;
644
+ }
645
+ const uri = new URL(this.client.config.endpoint + apiPath);
646
+
647
+ const apiHeaders: { [header: string]: string } = {
648
+ 'content-type': 'application/json',
649
+ }
650
+
651
+
617
652
  return await this.client.call(
618
653
  'patch',
619
654
  uri,
@@ -215,7 +215,7 @@ export class Teams {
215
215
  /**
216
216
  * List team memberships
217
217
  *
218
- * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
218
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console.
219
219
  *
220
220
  * @param {string} teamId
221
221
  * @param {string[]} queries
@@ -315,7 +315,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
315
315
  /**
316
316
  * Get team membership
317
317
  *
318
- * Get a team member by the membership unique id. All team members have read access for this resource.
318
+ * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console.
319
319
  *
320
320
  * @param {string} teamId
321
321
  * @param {string} membershipId
@@ -52,5 +52,6 @@ export declare enum Runtime {
52
52
  Cpp20 = "cpp-20",
53
53
  Bun10 = "bun-1.0",
54
54
  Bun11 = "bun-1.1",
55
- Go123 = "go-1.23"
55
+ Go123 = "go-1.23",
56
+ Static1 = "static-1"
56
57
  }
package/types/models.d.ts CHANGED
@@ -1848,11 +1848,11 @@ export declare namespace Models {
1848
1848
  */
1849
1849
  userId: string;
1850
1850
  /**
1851
- * User name.
1851
+ * User name. Hide this attribute by disabling teams sensitive data in the Console.
1852
1852
  */
1853
1853
  userName: string;
1854
1854
  /**
1855
- * User email address.
1855
+ * User email address. Hide this attribute by disabling teams sensitive data in the Console.
1856
1856
  */
1857
1857
  userEmail: string;
1858
1858
  /**
@@ -1876,7 +1876,7 @@ export declare namespace Models {
1876
1876
  */
1877
1877
  confirm: boolean;
1878
1878
  /**
1879
- * Multi factor authentication status, true if the user has MFA enabled or false otherwise.
1879
+ * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by disabling teams sensitive data in the Console.
1880
1880
  */
1881
1881
  mfa: boolean;
1882
1882
  /**
@@ -2549,6 +2549,10 @@ export declare namespace Models {
2549
2549
  * Whether or not to send session alert emails to users.
2550
2550
  */
2551
2551
  authSessionAlerts: boolean;
2552
+ /**
2553
+ * Whether or not to show sensitive attributes in the teams API.
2554
+ */
2555
+ teamsSensitiveAttributes: boolean;
2552
2556
  /**
2553
2557
  * List of Auth Providers.
2554
2558
  */
@@ -3979,6 +3983,10 @@ export declare namespace Models {
3979
3983
  * The target identifier.
3980
3984
  */
3981
3985
  identifier: string;
3986
+ /**
3987
+ * Is the target expired.
3988
+ */
3989
+ expired: boolean;
3982
3990
  };
3983
3991
  /**
3984
3992
  * Migration
@@ -4009,7 +4017,11 @@ export declare namespace Models {
4009
4017
  */
4010
4018
  source: string;
4011
4019
  /**
4012
- * Resources to migration.
4020
+ * A string containing the type of destination of the migration.
4021
+ */
4022
+ destination: string;
4023
+ /**
4024
+ * Resources to migrate.
4013
4025
  */
4014
4026
  resources: string[];
4015
4027
  /**
@@ -57,9 +57,9 @@ export declare class Account {
57
57
  * @param {string} postalCode
58
58
  * @param {string} addressLine2
59
59
  * @throws {AppwriteException}
60
- * @returns {Promise<{}>}
60
+ * @returns {Promise<Models.BillingAddress>}
61
61
  */
62
- createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<{}>;
62
+ createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress>;
63
63
  /**
64
64
  * Get billing address
65
65
  *
@@ -81,9 +81,9 @@ export declare class Account {
81
81
  * @param {string} postalCode
82
82
  * @param {string} addressLine2
83
83
  * @throws {AppwriteException}
84
- * @returns {Promise<{}>}
84
+ * @returns {Promise<Models.BillingAddress>}
85
85
  */
86
- updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<{}>;
86
+ updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress>;
87
87
  /**
88
88
  * Delete billing address
89
89
  *
@@ -183,6 +183,16 @@ export declare class Projects {
183
183
  * @returns {Promise<Models.Project>}
184
184
  */
185
185
  updateSessionAlerts(projectId: string, alerts: boolean): Promise<Models.Project>;
186
+ /**
187
+ * Update project team sensitive attributes
188
+ *
189
+ *
190
+ * @param {string} projectId
191
+ * @param {boolean} enabled
192
+ * @throws {AppwriteException}
193
+ * @returns {Promise<Models.Project>}
194
+ */
195
+ updateTeamsSensitiveAttributes(projectId: string, enabled: boolean): Promise<Models.Project>;
186
196
  /**
187
197
  * Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.
188
198
  *
@@ -71,7 +71,7 @@ export declare class Teams {
71
71
  /**
72
72
  * List team memberships
73
73
  *
74
- * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
74
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console.
75
75
  *
76
76
  * @param {string} teamId
77
77
  * @param {string[]} queries
@@ -106,7 +106,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
106
106
  /**
107
107
  * Get team membership
108
108
  *
109
- * Get a team member by the membership unique id. All team members have read access for this resource.
109
+ * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes (userName, userEmail and mfa) from the response by disabling teams sensitive data in the Console.
110
110
  *
111
111
  * @param {string} teamId
112
112
  * @param {string} membershipId