@appwrite.io/console 1.4.2 → 1.4.4
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 +46 -32
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +46 -32
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +46 -32
- package/docs/examples/projects/{update-teams-sensitive-attributes.md → update-memberships-privacy.md} +4 -2
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +13 -5
- package/src/services/projects.ts +49 -35
- package/src/services/teams.ts +2 -2
- package/types/models.d.ts +13 -5
- package/types/services/projects.d.ts +12 -10
- package/types/services/teams.d.ts +2 -2
- package/docs/examples/account/list-credits.md +0 -14
- package/docs/examples/console/get-copon.md +0 -13
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.
|
|
284
|
+
'x-sdk-version': '1.4.4',
|
|
285
285
|
'X-Appwrite-Response-Format': '1.6.0',
|
|
286
286
|
};
|
|
287
287
|
this.realtime = {
|
|
@@ -10922,6 +10922,49 @@
|
|
|
10922
10922
|
return yield this.client.call('patch', uri, apiHeaders, payload);
|
|
10923
10923
|
});
|
|
10924
10924
|
}
|
|
10925
|
+
/**
|
|
10926
|
+
* Update project memberships privacy attributes
|
|
10927
|
+
*
|
|
10928
|
+
*
|
|
10929
|
+
* @param {string} projectId
|
|
10930
|
+
* @param {boolean} userName
|
|
10931
|
+
* @param {boolean} userEmail
|
|
10932
|
+
* @param {boolean} mfa
|
|
10933
|
+
* @throws {AppwriteException}
|
|
10934
|
+
* @returns {Promise<Models.Project>}
|
|
10935
|
+
*/
|
|
10936
|
+
updateMembershipsPrivacy(projectId, userName, userEmail, mfa) {
|
|
10937
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10938
|
+
if (typeof projectId === 'undefined') {
|
|
10939
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
10940
|
+
}
|
|
10941
|
+
if (typeof userName === 'undefined') {
|
|
10942
|
+
throw new AppwriteException('Missing required parameter: "userName"');
|
|
10943
|
+
}
|
|
10944
|
+
if (typeof userEmail === 'undefined') {
|
|
10945
|
+
throw new AppwriteException('Missing required parameter: "userEmail"');
|
|
10946
|
+
}
|
|
10947
|
+
if (typeof mfa === 'undefined') {
|
|
10948
|
+
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
10949
|
+
}
|
|
10950
|
+
const apiPath = '/projects/{projectId}/auth/memberships-privacy'.replace('{projectId}', projectId);
|
|
10951
|
+
const payload = {};
|
|
10952
|
+
if (typeof userName !== 'undefined') {
|
|
10953
|
+
payload['userName'] = userName;
|
|
10954
|
+
}
|
|
10955
|
+
if (typeof userEmail !== 'undefined') {
|
|
10956
|
+
payload['userEmail'] = userEmail;
|
|
10957
|
+
}
|
|
10958
|
+
if (typeof mfa !== 'undefined') {
|
|
10959
|
+
payload['mfa'] = mfa;
|
|
10960
|
+
}
|
|
10961
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10962
|
+
const apiHeaders = {
|
|
10963
|
+
'content-type': 'application/json',
|
|
10964
|
+
};
|
|
10965
|
+
return yield this.client.call('patch', uri, apiHeaders, payload);
|
|
10966
|
+
});
|
|
10967
|
+
}
|
|
10925
10968
|
/**
|
|
10926
10969
|
* Update the mock numbers for the project
|
|
10927
10970
|
*
|
|
@@ -11067,35 +11110,6 @@
|
|
|
11067
11110
|
return yield this.client.call('patch', uri, apiHeaders, payload);
|
|
11068
11111
|
});
|
|
11069
11112
|
}
|
|
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
|
-
}
|
|
11099
11113
|
/**
|
|
11100
11114
|
* Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.
|
|
11101
11115
|
*
|
|
@@ -13064,7 +13078,7 @@
|
|
|
13064
13078
|
/**
|
|
13065
13079
|
* List team memberships
|
|
13066
13080
|
*
|
|
13067
|
-
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes
|
|
13081
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
13068
13082
|
*
|
|
13069
13083
|
* @param {string} teamId
|
|
13070
13084
|
* @param {string[]} queries
|
|
@@ -13152,7 +13166,7 @@
|
|
|
13152
13166
|
/**
|
|
13153
13167
|
* Get team membership
|
|
13154
13168
|
*
|
|
13155
|
-
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes
|
|
13169
|
+
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
13156
13170
|
*
|
|
13157
13171
|
* @param {string} teamId
|
|
13158
13172
|
* @param {string} membershipId
|
|
@@ -6,9 +6,11 @@ const client = new Client()
|
|
|
6
6
|
|
|
7
7
|
const projects = new Projects(client);
|
|
8
8
|
|
|
9
|
-
const result = await projects.
|
|
9
|
+
const result = await projects.updateMembershipsPrivacy(
|
|
10
10
|
'<PROJECT_ID>', // projectId
|
|
11
|
-
false //
|
|
11
|
+
false, // userName
|
|
12
|
+
false, // userEmail
|
|
13
|
+
false // mfa
|
|
12
14
|
);
|
|
13
15
|
|
|
14
16
|
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.
|
|
5
|
+
"version": "1.4.4",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
package/src/models.ts
CHANGED
|
@@ -1848,11 +1848,11 @@ export namespace Models {
|
|
|
1848
1848
|
*/
|
|
1849
1849
|
userId: string;
|
|
1850
1850
|
/**
|
|
1851
|
-
* User name. Hide this attribute by
|
|
1851
|
+
* User name. Hide this attribute by toggling membership privacy in the Console.
|
|
1852
1852
|
*/
|
|
1853
1853
|
userName: string;
|
|
1854
1854
|
/**
|
|
1855
|
-
* User email address. Hide this attribute by
|
|
1855
|
+
* User email address. Hide this attribute by toggling membership privacy 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. Hide this attribute by
|
|
1879
|
+
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
|
|
1880
1880
|
*/
|
|
1881
1881
|
mfa: boolean;
|
|
1882
1882
|
/**
|
|
@@ -2550,9 +2550,17 @@ export namespace Models {
|
|
|
2550
2550
|
*/
|
|
2551
2551
|
authSessionAlerts: boolean;
|
|
2552
2552
|
/**
|
|
2553
|
-
* Whether or not to show
|
|
2553
|
+
* Whether or not to show user names in the teams membership response.
|
|
2554
2554
|
*/
|
|
2555
|
-
|
|
2555
|
+
authMembershipsUserName: boolean;
|
|
2556
|
+
/**
|
|
2557
|
+
* Whether or not to show user emails in the teams membership response.
|
|
2558
|
+
*/
|
|
2559
|
+
authMembershipsUserEmail: boolean;
|
|
2560
|
+
/**
|
|
2561
|
+
* Whether or not to show user MFA status in the teams membership response.
|
|
2562
|
+
*/
|
|
2563
|
+
authMembershipsMfa: boolean;
|
|
2556
2564
|
/**
|
|
2557
2565
|
* List of Auth Providers.
|
|
2558
2566
|
*/
|
package/src/services/projects.ts
CHANGED
|
@@ -439,6 +439,55 @@ export class Projects {
|
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
|
|
442
|
+
return await this.client.call(
|
|
443
|
+
'patch',
|
|
444
|
+
uri,
|
|
445
|
+
apiHeaders,
|
|
446
|
+
payload
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Update project memberships privacy attributes
|
|
451
|
+
*
|
|
452
|
+
*
|
|
453
|
+
* @param {string} projectId
|
|
454
|
+
* @param {boolean} userName
|
|
455
|
+
* @param {boolean} userEmail
|
|
456
|
+
* @param {boolean} mfa
|
|
457
|
+
* @throws {AppwriteException}
|
|
458
|
+
* @returns {Promise<Models.Project>}
|
|
459
|
+
*/
|
|
460
|
+
async updateMembershipsPrivacy(projectId: string, userName: boolean, userEmail: boolean, mfa: boolean): Promise<Models.Project> {
|
|
461
|
+
if (typeof projectId === 'undefined') {
|
|
462
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
463
|
+
}
|
|
464
|
+
if (typeof userName === 'undefined') {
|
|
465
|
+
throw new AppwriteException('Missing required parameter: "userName"');
|
|
466
|
+
}
|
|
467
|
+
if (typeof userEmail === 'undefined') {
|
|
468
|
+
throw new AppwriteException('Missing required parameter: "userEmail"');
|
|
469
|
+
}
|
|
470
|
+
if (typeof mfa === 'undefined') {
|
|
471
|
+
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
472
|
+
}
|
|
473
|
+
const apiPath = '/projects/{projectId}/auth/memberships-privacy'.replace('{projectId}', projectId);
|
|
474
|
+
const payload: Payload = {};
|
|
475
|
+
if (typeof userName !== 'undefined') {
|
|
476
|
+
payload['userName'] = userName;
|
|
477
|
+
}
|
|
478
|
+
if (typeof userEmail !== 'undefined') {
|
|
479
|
+
payload['userEmail'] = userEmail;
|
|
480
|
+
}
|
|
481
|
+
if (typeof mfa !== 'undefined') {
|
|
482
|
+
payload['mfa'] = mfa;
|
|
483
|
+
}
|
|
484
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
485
|
+
|
|
486
|
+
const apiHeaders: { [header: string]: string } = {
|
|
487
|
+
'content-type': 'application/json',
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
|
|
442
491
|
return await this.client.call(
|
|
443
492
|
'patch',
|
|
444
493
|
uri,
|
|
@@ -614,41 +663,6 @@ export class Projects {
|
|
|
614
663
|
}
|
|
615
664
|
|
|
616
665
|
|
|
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
|
-
|
|
652
666
|
return await this.client.call(
|
|
653
667
|
'patch',
|
|
654
668
|
uri,
|
package/src/services/teams.ts
CHANGED
|
@@ -215,7 +215,7 @@ export class Teams {
|
|
|
215
215
|
/**
|
|
216
216
|
* List team memberships
|
|
217
217
|
*
|
|
218
|
-
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes
|
|
218
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy 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. Hide sensitive attributes
|
|
318
|
+
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
319
319
|
*
|
|
320
320
|
* @param {string} teamId
|
|
321
321
|
* @param {string} membershipId
|
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. Hide this attribute by
|
|
1851
|
+
* User name. Hide this attribute by toggling membership privacy in the Console.
|
|
1852
1852
|
*/
|
|
1853
1853
|
userName: string;
|
|
1854
1854
|
/**
|
|
1855
|
-
* User email address. Hide this attribute by
|
|
1855
|
+
* User email address. Hide this attribute by toggling membership privacy 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. Hide this attribute by
|
|
1879
|
+
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
|
|
1880
1880
|
*/
|
|
1881
1881
|
mfa: boolean;
|
|
1882
1882
|
/**
|
|
@@ -2550,9 +2550,17 @@ export declare namespace Models {
|
|
|
2550
2550
|
*/
|
|
2551
2551
|
authSessionAlerts: boolean;
|
|
2552
2552
|
/**
|
|
2553
|
-
* Whether or not to show
|
|
2553
|
+
* Whether or not to show user names in the teams membership response.
|
|
2554
2554
|
*/
|
|
2555
|
-
|
|
2555
|
+
authMembershipsUserName: boolean;
|
|
2556
|
+
/**
|
|
2557
|
+
* Whether or not to show user emails in the teams membership response.
|
|
2558
|
+
*/
|
|
2559
|
+
authMembershipsUserEmail: boolean;
|
|
2560
|
+
/**
|
|
2561
|
+
* Whether or not to show user MFA status in the teams membership response.
|
|
2562
|
+
*/
|
|
2563
|
+
authMembershipsMfa: boolean;
|
|
2556
2564
|
/**
|
|
2557
2565
|
* List of Auth Providers.
|
|
2558
2566
|
*/
|
|
@@ -133,6 +133,18 @@ export declare class Projects {
|
|
|
133
133
|
* @returns {Promise<Models.Project>}
|
|
134
134
|
*/
|
|
135
135
|
updateAuthSessionsLimit(projectId: string, limit: number): Promise<Models.Project>;
|
|
136
|
+
/**
|
|
137
|
+
* Update project memberships privacy attributes
|
|
138
|
+
*
|
|
139
|
+
*
|
|
140
|
+
* @param {string} projectId
|
|
141
|
+
* @param {boolean} userName
|
|
142
|
+
* @param {boolean} userEmail
|
|
143
|
+
* @param {boolean} mfa
|
|
144
|
+
* @throws {AppwriteException}
|
|
145
|
+
* @returns {Promise<Models.Project>}
|
|
146
|
+
*/
|
|
147
|
+
updateMembershipsPrivacy(projectId: string, userName: boolean, userEmail: boolean, mfa: boolean): Promise<Models.Project>;
|
|
136
148
|
/**
|
|
137
149
|
* Update the mock numbers for the project
|
|
138
150
|
*
|
|
@@ -183,16 +195,6 @@ export declare class Projects {
|
|
|
183
195
|
* @returns {Promise<Models.Project>}
|
|
184
196
|
*/
|
|
185
197
|
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>;
|
|
196
198
|
/**
|
|
197
199
|
* Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.
|
|
198
200
|
*
|
|
@@ -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's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes
|
|
74
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy 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. Hide sensitive attributes
|
|
109
|
+
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
110
110
|
*
|
|
111
111
|
* @param {string} teamId
|
|
112
112
|
* @param {string} membershipId
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Client, Account } 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 account = new Account(client);
|
|
8
|
-
|
|
9
|
-
const result = await account.listCredits(
|
|
10
|
-
'<ORGANIZATION_ID>', // organizationId
|
|
11
|
-
[] // queries (optional)
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
console.log(result);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Client, Console } 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 console = new Console(client);
|
|
8
|
-
|
|
9
|
-
const result = await console.getCopon(
|
|
10
|
-
'<COUPON_ID>' // couponId
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
console.log(result);
|