@appwrite.io/console 0.6.0-rc.6 → 0.6.0-rc.8
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 +241 -55
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +241 -55
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +241 -55
- package/docs/examples/account/create-email-token.md +18 -0
- package/docs/examples/account/create-push-target.md +18 -0
- package/docs/examples/account/delete.md +18 -0
- package/docs/examples/account/update-push-target.md +1 -0
- package/docs/examples/messaging/{create-apns-provider.md → create-a-p-n-s-provider.md} +1 -1
- package/docs/examples/messaging/create-email.md +18 -0
- package/docs/examples/messaging/{create-fcm-provider.md → create-f-c-m-provider.md} +1 -1
- package/docs/examples/messaging/create-push.md +18 -0
- package/docs/examples/messaging/{create-s-m-s-message.md → create-s-m-s.md} +1 -1
- package/docs/examples/messaging/{update-fcm-provider.md → list-targets.md} +1 -1
- package/docs/examples/messaging/{update-apns-provider.md → update-a-p-n-s-provider.md} +1 -1
- package/docs/examples/messaging/update-f-c-m-provider.md +18 -0
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/projects/{update-smtp-configuration.md → create-smtp-test.md} +1 -1
- package/docs/examples/projects/create-webhook.md +1 -1
- package/docs/examples/projects/{get-usage.md → update-smtp.md} +1 -1
- package/docs/examples/projects/update-webhook.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +212 -182
- package/src/services/account.ts +115 -8
- package/src/services/functions.ts +1 -1
- package/src/services/messaging.ts +36 -7
- package/src/services/project.ts +22 -4
- package/src/services/projects.ts +97 -31
- package/src/services/storage.ts +1 -1
- package/src/services/users.ts +1 -6
- package/types/models.d.ts +212 -182
- package/types/services/account.d.ts +48 -8
- package/types/services/functions.d.ts +1 -1
- package/types/services/messaging.d.ts +19 -7
- package/types/services/project.d.ts +4 -2
- package/types/services/projects.d.ts +24 -14
- package/types/services/storage.d.ts +1 -1
- package/types/services/users.d.ts +1 -2
- package/docs/examples/messaging/create-email-message.md +0 -18
- package/docs/examples/messaging/create-push-message.md +0 -18
package/src/services/account.ts
CHANGED
|
@@ -84,6 +84,24 @@ export class Account extends Service {
|
|
|
84
84
|
}, payload);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Delete account
|
|
89
|
+
*
|
|
90
|
+
* Delete the currently logged in user.
|
|
91
|
+
*
|
|
92
|
+
* @throws {AppwriteException}
|
|
93
|
+
* @returns {Promise}
|
|
94
|
+
*/
|
|
95
|
+
async delete(): Promise<{}> {
|
|
96
|
+
const apiPath = '/account';
|
|
97
|
+
const payload: Payload = {};
|
|
98
|
+
|
|
99
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
100
|
+
return await this.client.call('delete', uri, {
|
|
101
|
+
'content-type': 'application/json',
|
|
102
|
+
}, payload);
|
|
103
|
+
}
|
|
104
|
+
|
|
87
105
|
/**
|
|
88
106
|
* Update email
|
|
89
107
|
*
|
|
@@ -923,11 +941,10 @@ export class Account extends Service {
|
|
|
923
941
|
}
|
|
924
942
|
|
|
925
943
|
/**
|
|
926
|
-
* Update
|
|
944
|
+
* Update (or renew) a session
|
|
927
945
|
*
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
* "refresh" the access token.
|
|
946
|
+
* Extend session's expiry to increase it's lifespan. Extending a session is
|
|
947
|
+
* useful when session length is short such as 5 minutes.
|
|
931
948
|
*
|
|
932
949
|
* @param {string} sessionId
|
|
933
950
|
* @throws {AppwriteException}
|
|
@@ -994,6 +1011,46 @@ export class Account extends Service {
|
|
|
994
1011
|
}, payload);
|
|
995
1012
|
}
|
|
996
1013
|
|
|
1014
|
+
/**
|
|
1015
|
+
* Create Account's push target
|
|
1016
|
+
*
|
|
1017
|
+
*
|
|
1018
|
+
* @param {string} targetId
|
|
1019
|
+
* @param {string} identifier
|
|
1020
|
+
* @param {string} providerId
|
|
1021
|
+
* @throws {AppwriteException}
|
|
1022
|
+
* @returns {Promise}
|
|
1023
|
+
*/
|
|
1024
|
+
async createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target> {
|
|
1025
|
+
if (typeof targetId === 'undefined') {
|
|
1026
|
+
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
if (typeof identifier === 'undefined') {
|
|
1030
|
+
throw new AppwriteException('Missing required parameter: "identifier"');
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
const apiPath = '/account/targets/push';
|
|
1034
|
+
const payload: Payload = {};
|
|
1035
|
+
|
|
1036
|
+
if (typeof targetId !== 'undefined') {
|
|
1037
|
+
payload['targetId'] = targetId;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
if (typeof identifier !== 'undefined') {
|
|
1041
|
+
payload['identifier'] = identifier;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
if (typeof providerId !== 'undefined') {
|
|
1045
|
+
payload['providerId'] = providerId;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1049
|
+
return await this.client.call('post', uri, {
|
|
1050
|
+
'content-type': 'application/json',
|
|
1051
|
+
}, payload);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
997
1054
|
/**
|
|
998
1055
|
* Update Account's push target
|
|
999
1056
|
*
|
|
@@ -1025,6 +1082,56 @@ export class Account extends Service {
|
|
|
1025
1082
|
}, payload);
|
|
1026
1083
|
}
|
|
1027
1084
|
|
|
1085
|
+
/**
|
|
1086
|
+
* Create email token (OTP)
|
|
1087
|
+
*
|
|
1088
|
+
* Sends the user an email with a secret key for creating a session. If the
|
|
1089
|
+
* provided user ID has not be registered, a new user will be created. Use the
|
|
1090
|
+
* returned user ID and secret and submit a request to the [POST
|
|
1091
|
+
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1092
|
+
* endpoint to complete the login process. The secret sent to the user's email
|
|
1093
|
+
* is valid for 15 minutes.
|
|
1094
|
+
*
|
|
1095
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1096
|
+
* about session
|
|
1097
|
+
* limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1098
|
+
*
|
|
1099
|
+
* @param {string} userId
|
|
1100
|
+
* @param {string} email
|
|
1101
|
+
* @param {boolean} securityPhrase
|
|
1102
|
+
* @throws {AppwriteException}
|
|
1103
|
+
* @returns {Promise}
|
|
1104
|
+
*/
|
|
1105
|
+
async createEmailToken(userId: string, email: string, securityPhrase?: boolean): Promise<Models.Token> {
|
|
1106
|
+
if (typeof userId === 'undefined') {
|
|
1107
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
if (typeof email === 'undefined') {
|
|
1111
|
+
throw new AppwriteException('Missing required parameter: "email"');
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
const apiPath = '/account/tokens/email';
|
|
1115
|
+
const payload: Payload = {};
|
|
1116
|
+
|
|
1117
|
+
if (typeof userId !== 'undefined') {
|
|
1118
|
+
payload['userId'] = userId;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
if (typeof email !== 'undefined') {
|
|
1122
|
+
payload['email'] = email;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
if (typeof securityPhrase !== 'undefined') {
|
|
1126
|
+
payload['securityPhrase'] = securityPhrase;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1130
|
+
return await this.client.call('post', uri, {
|
|
1131
|
+
'content-type': 'application/json',
|
|
1132
|
+
}, payload);
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1028
1135
|
/**
|
|
1029
1136
|
* Create magic URL token
|
|
1030
1137
|
*
|
|
@@ -1033,8 +1140,8 @@ export class Account extends Service {
|
|
|
1033
1140
|
* the user clicks the link in the email, the user is redirected back to the
|
|
1034
1141
|
* URL you provided with the secret key and userId values attached to the URL
|
|
1035
1142
|
* query string. Use the query string parameters to submit a request to the
|
|
1036
|
-
* [
|
|
1037
|
-
* /account/sessions/
|
|
1143
|
+
* [POST
|
|
1144
|
+
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1038
1145
|
* endpoint to complete the login process. The link sent to the user's email
|
|
1039
1146
|
* address is valid for 1 hour. If you are on a mobile device you can leave
|
|
1040
1147
|
* the URL parameter empty, so that the login completion will be handled by
|
|
@@ -1091,8 +1198,8 @@ export class Account extends Service {
|
|
|
1091
1198
|
*
|
|
1092
1199
|
* Sends the user an SMS with a secret key for creating a session. If the
|
|
1093
1200
|
* provided user ID has not be registered, a new user will be created. Use the
|
|
1094
|
-
* returned user ID and secret and submit a request to the [
|
|
1095
|
-
* /account/sessions/
|
|
1201
|
+
* returned user ID and secret and submit a request to the [POST
|
|
1202
|
+
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1096
1203
|
* endpoint to complete the login process. The secret sent to the user's phone
|
|
1097
1204
|
* is valid for 15 minutes.
|
|
1098
1205
|
*
|
|
@@ -770,7 +770,7 @@ export class Functions extends Service {
|
|
|
770
770
|
* @throws {AppwriteException}
|
|
771
771
|
* @returns {Promise}
|
|
772
772
|
*/
|
|
773
|
-
async getFunctionUsage(functionId: string, range?: string): Promise<Models.
|
|
773
|
+
async getFunctionUsage(functionId: string, range?: string): Promise<Models.UsageFunction> {
|
|
774
774
|
if (typeof functionId === 'undefined') {
|
|
775
775
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
776
776
|
}
|
|
@@ -56,7 +56,7 @@ export class Messaging extends Service {
|
|
|
56
56
|
* @throws {AppwriteException}
|
|
57
57
|
* @returns {Promise}
|
|
58
58
|
*/
|
|
59
|
-
async
|
|
59
|
+
async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], description?: string, status?: string, html?: boolean, scheduledAt?: string): Promise<Models.Message> {
|
|
60
60
|
if (typeof messageId === 'undefined') {
|
|
61
61
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
62
62
|
}
|
|
@@ -226,7 +226,7 @@ export class Messaging extends Service {
|
|
|
226
226
|
* @throws {AppwriteException}
|
|
227
227
|
* @returns {Promise}
|
|
228
228
|
*/
|
|
229
|
-
async
|
|
229
|
+
async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], description?: string, data?: object, action?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, status?: string, scheduledAt?: string): Promise<Models.Message> {
|
|
230
230
|
if (typeof messageId === 'undefined') {
|
|
231
231
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
232
232
|
}
|
|
@@ -424,7 +424,7 @@ export class Messaging extends Service {
|
|
|
424
424
|
* @throws {AppwriteException}
|
|
425
425
|
* @returns {Promise}
|
|
426
426
|
*/
|
|
427
|
-
async
|
|
427
|
+
async createSMS(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], description?: string, status?: string, scheduledAt?: string): Promise<Models.Message> {
|
|
428
428
|
if (typeof messageId === 'undefined') {
|
|
429
429
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
430
430
|
}
|
|
@@ -580,6 +580,35 @@ export class Messaging extends Service {
|
|
|
580
580
|
}, payload);
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
+
/**
|
|
584
|
+
* List message targets
|
|
585
|
+
*
|
|
586
|
+
* List the targets associated with a message as set via the targets
|
|
587
|
+
* attribute.
|
|
588
|
+
*
|
|
589
|
+
* @param {string} messageId
|
|
590
|
+
* @param {string} queries
|
|
591
|
+
* @throws {AppwriteException}
|
|
592
|
+
* @returns {Promise}
|
|
593
|
+
*/
|
|
594
|
+
async listTargets(messageId: string, queries?: string): Promise<Models.TargetList> {
|
|
595
|
+
if (typeof messageId === 'undefined') {
|
|
596
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
|
|
600
|
+
const payload: Payload = {};
|
|
601
|
+
|
|
602
|
+
if (typeof queries !== 'undefined') {
|
|
603
|
+
payload['queries'] = queries;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
607
|
+
return await this.client.call('get', uri, {
|
|
608
|
+
'content-type': 'application/json',
|
|
609
|
+
}, payload);
|
|
610
|
+
}
|
|
611
|
+
|
|
583
612
|
/**
|
|
584
613
|
* List providers
|
|
585
614
|
*
|
|
@@ -621,7 +650,7 @@ export class Messaging extends Service {
|
|
|
621
650
|
* @throws {AppwriteException}
|
|
622
651
|
* @returns {Promise}
|
|
623
652
|
*/
|
|
624
|
-
async
|
|
653
|
+
async createAPNSProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
625
654
|
if (typeof providerId === 'undefined') {
|
|
626
655
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
627
656
|
}
|
|
@@ -681,7 +710,7 @@ export class Messaging extends Service {
|
|
|
681
710
|
* @throws {AppwriteException}
|
|
682
711
|
* @returns {Promise}
|
|
683
712
|
*/
|
|
684
|
-
async
|
|
713
|
+
async updateAPNSProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string): Promise<Models.Provider> {
|
|
685
714
|
if (typeof providerId === 'undefined') {
|
|
686
715
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
687
716
|
}
|
|
@@ -730,7 +759,7 @@ export class Messaging extends Service {
|
|
|
730
759
|
* @throws {AppwriteException}
|
|
731
760
|
* @returns {Promise}
|
|
732
761
|
*/
|
|
733
|
-
async
|
|
762
|
+
async createFCMProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider> {
|
|
734
763
|
if (typeof providerId === 'undefined') {
|
|
735
764
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
736
765
|
}
|
|
@@ -775,7 +804,7 @@ export class Messaging extends Service {
|
|
|
775
804
|
* @throws {AppwriteException}
|
|
776
805
|
* @returns {Promise}
|
|
777
806
|
*/
|
|
778
|
-
async
|
|
807
|
+
async updateFCMProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider> {
|
|
779
808
|
if (typeof providerId === 'undefined') {
|
|
780
809
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
781
810
|
}
|
package/src/services/project.ts
CHANGED
|
@@ -14,16 +14,34 @@ export class Project extends Service {
|
|
|
14
14
|
* Get usage stats for a project
|
|
15
15
|
*
|
|
16
16
|
*
|
|
17
|
-
* @param {string}
|
|
17
|
+
* @param {string} startDate
|
|
18
|
+
* @param {string} endDate
|
|
19
|
+
* @param {string} period
|
|
18
20
|
* @throws {AppwriteException}
|
|
19
21
|
* @returns {Promise}
|
|
20
22
|
*/
|
|
21
|
-
async getUsage(
|
|
23
|
+
async getUsage(startDate: string, endDate: string, period?: string): Promise<Models.UsageProject> {
|
|
24
|
+
if (typeof startDate === 'undefined') {
|
|
25
|
+
throw new AppwriteException('Missing required parameter: "startDate"');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (typeof endDate === 'undefined') {
|
|
29
|
+
throw new AppwriteException('Missing required parameter: "endDate"');
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
const apiPath = '/project/usage';
|
|
23
33
|
const payload: Payload = {};
|
|
24
34
|
|
|
25
|
-
if (typeof
|
|
26
|
-
payload['
|
|
35
|
+
if (typeof startDate !== 'undefined') {
|
|
36
|
+
payload['startDate'] = startDate;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (typeof endDate !== 'undefined') {
|
|
40
|
+
payload['endDate'] = endDate;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (typeof period !== 'undefined') {
|
|
44
|
+
payload['period'] = period;
|
|
27
45
|
}
|
|
28
46
|
|
|
29
47
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
package/src/services/projects.ts
CHANGED
|
@@ -975,7 +975,7 @@ export class Projects extends Service {
|
|
|
975
975
|
}
|
|
976
976
|
|
|
977
977
|
/**
|
|
978
|
-
* Update SMTP
|
|
978
|
+
* Update SMTP
|
|
979
979
|
*
|
|
980
980
|
*
|
|
981
981
|
* @param {string} projectId
|
|
@@ -991,7 +991,7 @@ export class Projects extends Service {
|
|
|
991
991
|
* @throws {AppwriteException}
|
|
992
992
|
* @returns {Promise}
|
|
993
993
|
*/
|
|
994
|
-
async
|
|
994
|
+
async updateSmtp(projectId: string, enabled: boolean, senderName?: string, senderEmail?: string, replyTo?: string, host?: string, port?: number, username?: string, password?: string, secure?: string): Promise<Models.Project> {
|
|
995
995
|
if (typeof projectId === 'undefined') {
|
|
996
996
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
997
997
|
}
|
|
@@ -1045,6 +1045,89 @@ export class Projects extends Service {
|
|
|
1045
1045
|
}, payload);
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
|
+
/**
|
|
1049
|
+
* Create SMTP test
|
|
1050
|
+
*
|
|
1051
|
+
*
|
|
1052
|
+
* @param {string} projectId
|
|
1053
|
+
* @param {string[]} emails
|
|
1054
|
+
* @param {string} senderName
|
|
1055
|
+
* @param {string} senderEmail
|
|
1056
|
+
* @param {string} host
|
|
1057
|
+
* @param {string} replyTo
|
|
1058
|
+
* @param {number} port
|
|
1059
|
+
* @param {string} username
|
|
1060
|
+
* @param {string} password
|
|
1061
|
+
* @param {string} secure
|
|
1062
|
+
* @throws {AppwriteException}
|
|
1063
|
+
* @returns {Promise}
|
|
1064
|
+
*/
|
|
1065
|
+
async createSmtpTest(projectId: string, emails: string[], senderName: string, senderEmail: string, host: string, replyTo?: string, port?: number, username?: string, password?: string, secure?: string): Promise<{}> {
|
|
1066
|
+
if (typeof projectId === 'undefined') {
|
|
1067
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
if (typeof emails === 'undefined') {
|
|
1071
|
+
throw new AppwriteException('Missing required parameter: "emails"');
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
if (typeof senderName === 'undefined') {
|
|
1075
|
+
throw new AppwriteException('Missing required parameter: "senderName"');
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
if (typeof senderEmail === 'undefined') {
|
|
1079
|
+
throw new AppwriteException('Missing required parameter: "senderEmail"');
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
if (typeof host === 'undefined') {
|
|
1083
|
+
throw new AppwriteException('Missing required parameter: "host"');
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
|
|
1087
|
+
const payload: Payload = {};
|
|
1088
|
+
|
|
1089
|
+
if (typeof emails !== 'undefined') {
|
|
1090
|
+
payload['emails'] = emails;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
if (typeof senderName !== 'undefined') {
|
|
1094
|
+
payload['senderName'] = senderName;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
if (typeof senderEmail !== 'undefined') {
|
|
1098
|
+
payload['senderEmail'] = senderEmail;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
if (typeof replyTo !== 'undefined') {
|
|
1102
|
+
payload['replyTo'] = replyTo;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
if (typeof host !== 'undefined') {
|
|
1106
|
+
payload['host'] = host;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
if (typeof port !== 'undefined') {
|
|
1110
|
+
payload['port'] = port;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
if (typeof username !== 'undefined') {
|
|
1114
|
+
payload['username'] = username;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
if (typeof password !== 'undefined') {
|
|
1118
|
+
payload['password'] = password;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
if (typeof secure !== 'undefined') {
|
|
1122
|
+
payload['secure'] = secure;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1126
|
+
return await this.client.call('post', uri, {
|
|
1127
|
+
'content-type': 'application/json',
|
|
1128
|
+
}, payload);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1048
1131
|
/**
|
|
1049
1132
|
* Update Project Team
|
|
1050
1133
|
*
|
|
@@ -1310,33 +1393,6 @@ export class Projects extends Service {
|
|
|
1310
1393
|
}, payload);
|
|
1311
1394
|
}
|
|
1312
1395
|
|
|
1313
|
-
/**
|
|
1314
|
-
* Get usage stats for a project
|
|
1315
|
-
*
|
|
1316
|
-
*
|
|
1317
|
-
* @param {string} projectId
|
|
1318
|
-
* @param {string} range
|
|
1319
|
-
* @throws {AppwriteException}
|
|
1320
|
-
* @returns {Promise}
|
|
1321
|
-
*/
|
|
1322
|
-
async getUsage(projectId: string, range?: string): Promise<Models.UsageProject> {
|
|
1323
|
-
if (typeof projectId === 'undefined') {
|
|
1324
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
const apiPath = '/projects/{projectId}/usage'.replace('{projectId}', projectId);
|
|
1328
|
-
const payload: Payload = {};
|
|
1329
|
-
|
|
1330
|
-
if (typeof range !== 'undefined') {
|
|
1331
|
-
payload['range'] = range;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1335
|
-
return await this.client.call('get', uri, {
|
|
1336
|
-
'content-type': 'application/json',
|
|
1337
|
-
}, payload);
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
1396
|
/**
|
|
1341
1397
|
* List webhooks
|
|
1342
1398
|
*
|
|
@@ -1368,12 +1424,13 @@ export class Projects extends Service {
|
|
|
1368
1424
|
* @param {string[]} events
|
|
1369
1425
|
* @param {string} url
|
|
1370
1426
|
* @param {boolean} security
|
|
1427
|
+
* @param {boolean} enabled
|
|
1371
1428
|
* @param {string} httpUser
|
|
1372
1429
|
* @param {string} httpPass
|
|
1373
1430
|
* @throws {AppwriteException}
|
|
1374
1431
|
* @returns {Promise}
|
|
1375
1432
|
*/
|
|
1376
|
-
async createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
|
|
1433
|
+
async createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
|
|
1377
1434
|
if (typeof projectId === 'undefined') {
|
|
1378
1435
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
1379
1436
|
}
|
|
@@ -1401,6 +1458,10 @@ export class Projects extends Service {
|
|
|
1401
1458
|
payload['name'] = name;
|
|
1402
1459
|
}
|
|
1403
1460
|
|
|
1461
|
+
if (typeof enabled !== 'undefined') {
|
|
1462
|
+
payload['enabled'] = enabled;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1404
1465
|
if (typeof events !== 'undefined') {
|
|
1405
1466
|
payload['events'] = events;
|
|
1406
1467
|
}
|
|
@@ -1464,12 +1525,13 @@ export class Projects extends Service {
|
|
|
1464
1525
|
* @param {string[]} events
|
|
1465
1526
|
* @param {string} url
|
|
1466
1527
|
* @param {boolean} security
|
|
1528
|
+
* @param {boolean} enabled
|
|
1467
1529
|
* @param {string} httpUser
|
|
1468
1530
|
* @param {string} httpPass
|
|
1469
1531
|
* @throws {AppwriteException}
|
|
1470
1532
|
* @returns {Promise}
|
|
1471
1533
|
*/
|
|
1472
|
-
async updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
|
|
1534
|
+
async updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
|
|
1473
1535
|
if (typeof projectId === 'undefined') {
|
|
1474
1536
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
1475
1537
|
}
|
|
@@ -1501,6 +1563,10 @@ export class Projects extends Service {
|
|
|
1501
1563
|
payload['name'] = name;
|
|
1502
1564
|
}
|
|
1503
1565
|
|
|
1566
|
+
if (typeof enabled !== 'undefined') {
|
|
1567
|
+
payload['enabled'] = enabled;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1504
1570
|
if (typeof events !== 'undefined') {
|
|
1505
1571
|
payload['events'] = events;
|
|
1506
1572
|
}
|
package/src/services/storage.ts
CHANGED
package/src/services/users.ts
CHANGED
|
@@ -591,11 +591,10 @@ export class Users extends Service {
|
|
|
591
591
|
*
|
|
592
592
|
*
|
|
593
593
|
* @param {string} range
|
|
594
|
-
* @param {string} provider
|
|
595
594
|
* @throws {AppwriteException}
|
|
596
595
|
* @returns {Promise}
|
|
597
596
|
*/
|
|
598
|
-
async getUsage(range?: string
|
|
597
|
+
async getUsage(range?: string): Promise<Models.UsageUsers> {
|
|
599
598
|
const apiPath = '/users/usage';
|
|
600
599
|
const payload: Payload = {};
|
|
601
600
|
|
|
@@ -603,10 +602,6 @@ export class Users extends Service {
|
|
|
603
602
|
payload['range'] = range;
|
|
604
603
|
}
|
|
605
604
|
|
|
606
|
-
if (typeof provider !== 'undefined') {
|
|
607
|
-
payload['provider'] = provider;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
605
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
611
606
|
return await this.client.call('get', uri, {
|
|
612
607
|
'content-type': 'application/json',
|