@appwrite.io/console 1.4.1 → 1.4.3
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 +47 -3
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +47 -3
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +47 -3
- package/docs/examples/databases/update-string-attribute.md +1 -1
- package/docs/examples/projects/update-memberships-privacy.md +16 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/runtime.ts +1 -0
- package/src/models.ts +24 -4
- package/src/services/projects.ts +49 -0
- package/src/services/teams.ts +2 -2
- package/types/enums/runtime.d.ts +2 -1
- package/types/models.d.ts +24 -4
- package/types/services/projects.d.ts +12 -0
- 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.3',
|
|
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 team 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
|
*
|
|
@@ -13035,7 +13078,7 @@
|
|
|
13035
13078
|
/**
|
|
13036
13079
|
* List team memberships
|
|
13037
13080
|
*
|
|
13038
|
-
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.
|
|
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.
|
|
13039
13082
|
*
|
|
13040
13083
|
* @param {string} teamId
|
|
13041
13084
|
* @param {string[]} queries
|
|
@@ -13123,7 +13166,7 @@
|
|
|
13123
13166
|
/**
|
|
13124
13167
|
* Get team membership
|
|
13125
13168
|
*
|
|
13126
|
-
* Get a team member by the membership unique id. All team members have read access for this resource.
|
|
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.
|
|
13127
13170
|
*
|
|
13128
13171
|
* @param {string} teamId
|
|
13129
13172
|
* @param {string} membershipId
|
|
@@ -15545,6 +15588,7 @@
|
|
|
15545
15588
|
Runtime["Bun10"] = "bun-1.0";
|
|
15546
15589
|
Runtime["Bun11"] = "bun-1.1";
|
|
15547
15590
|
Runtime["Go123"] = "go-1.23";
|
|
15591
|
+
Runtime["Static1"] = "static-1";
|
|
15548
15592
|
})(exports.Runtime || (exports.Runtime = {}));
|
|
15549
15593
|
|
|
15550
15594
|
exports.FunctionUsageRange = void 0;
|
|
@@ -0,0 +1,16 @@
|
|
|
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.updateMembershipsPrivacy(
|
|
10
|
+
'<PROJECT_ID>', // projectId
|
|
11
|
+
false, // userName
|
|
12
|
+
false, // userEmail
|
|
13
|
+
false // mfa
|
|
14
|
+
);
|
|
15
|
+
|
|
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.3",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
package/src/enums/runtime.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.
|
|
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.
|
|
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.
|
|
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
|
/**
|
|
@@ -2549,6 +2549,18 @@ 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 user names in the teams membership response.
|
|
2554
|
+
*/
|
|
2555
|
+
membershipsUserName: boolean;
|
|
2556
|
+
/**
|
|
2557
|
+
* Whether or not to show user emails in the teams membership response.
|
|
2558
|
+
*/
|
|
2559
|
+
membershipsUserEmail: boolean;
|
|
2560
|
+
/**
|
|
2561
|
+
* Whether or not to show user MFA status in the teams membership response.
|
|
2562
|
+
*/
|
|
2563
|
+
membershipsMfa: boolean;
|
|
2552
2564
|
/**
|
|
2553
2565
|
* List of Auth Providers.
|
|
2554
2566
|
*/
|
|
@@ -3979,6 +3991,10 @@ export namespace Models {
|
|
|
3979
3991
|
* The target identifier.
|
|
3980
3992
|
*/
|
|
3981
3993
|
identifier: string;
|
|
3994
|
+
/**
|
|
3995
|
+
* Is the target expired.
|
|
3996
|
+
*/
|
|
3997
|
+
expired: boolean;
|
|
3982
3998
|
}
|
|
3983
3999
|
/**
|
|
3984
4000
|
* Migration
|
|
@@ -4009,7 +4025,11 @@ export namespace Models {
|
|
|
4009
4025
|
*/
|
|
4010
4026
|
source: string;
|
|
4011
4027
|
/**
|
|
4012
|
-
*
|
|
4028
|
+
* A string containing the type of destination of the migration.
|
|
4029
|
+
*/
|
|
4030
|
+
destination: string;
|
|
4031
|
+
/**
|
|
4032
|
+
* Resources to migrate.
|
|
4013
4033
|
*/
|
|
4014
4034
|
resources: string[];
|
|
4015
4035
|
/**
|
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 team 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,
|
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.
|
|
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.
|
|
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/enums/runtime.d.ts
CHANGED
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 toggling membership privacy in the Console.
|
|
1852
1852
|
*/
|
|
1853
1853
|
userName: string;
|
|
1854
1854
|
/**
|
|
1855
|
-
* User email address.
|
|
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.
|
|
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
|
/**
|
|
@@ -2549,6 +2549,18 @@ 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 user names in the teams membership response.
|
|
2554
|
+
*/
|
|
2555
|
+
membershipsUserName: boolean;
|
|
2556
|
+
/**
|
|
2557
|
+
* Whether or not to show user emails in the teams membership response.
|
|
2558
|
+
*/
|
|
2559
|
+
membershipsUserEmail: boolean;
|
|
2560
|
+
/**
|
|
2561
|
+
* Whether or not to show user MFA status in the teams membership response.
|
|
2562
|
+
*/
|
|
2563
|
+
membershipsMfa: boolean;
|
|
2552
2564
|
/**
|
|
2553
2565
|
* List of Auth Providers.
|
|
2554
2566
|
*/
|
|
@@ -3979,6 +3991,10 @@ export declare namespace Models {
|
|
|
3979
3991
|
* The target identifier.
|
|
3980
3992
|
*/
|
|
3981
3993
|
identifier: string;
|
|
3994
|
+
/**
|
|
3995
|
+
* Is the target expired.
|
|
3996
|
+
*/
|
|
3997
|
+
expired: boolean;
|
|
3982
3998
|
};
|
|
3983
3999
|
/**
|
|
3984
4000
|
* Migration
|
|
@@ -4009,7 +4025,11 @@ export declare namespace Models {
|
|
|
4009
4025
|
*/
|
|
4010
4026
|
source: string;
|
|
4011
4027
|
/**
|
|
4012
|
-
*
|
|
4028
|
+
* A string containing the type of destination of the migration.
|
|
4029
|
+
*/
|
|
4030
|
+
destination: string;
|
|
4031
|
+
/**
|
|
4032
|
+
* Resources to migrate.
|
|
4013
4033
|
*/
|
|
4014
4034
|
resources: string[];
|
|
4015
4035
|
/**
|
|
@@ -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 team 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
|
*
|
|
@@ -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.
|
|
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.
|
|
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);
|