@appwrite.io/console 1.1.0-rc.2 → 1.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/README.md +3 -3
- package/dist/cjs/sdk.js +2196 -3306
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +2197 -3305
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +2196 -3306
- package/docs/examples/account/delete-mfa-authenticator.md +1 -2
- package/docs/examples/databases/update-boolean-attribute.md +2 -1
- package/docs/examples/databases/update-datetime-attribute.md +2 -1
- package/docs/examples/databases/update-email-attribute.md +2 -1
- package/docs/examples/databases/update-enum-attribute.md +2 -1
- package/docs/examples/databases/update-float-attribute.md +2 -1
- package/docs/examples/databases/update-integer-attribute.md +2 -1
- package/docs/examples/databases/update-ip-attribute.md +2 -1
- package/docs/examples/databases/update-relationship-attribute.md +2 -1
- package/docs/examples/databases/update-string-attribute.md +3 -1
- package/docs/examples/databases/update-url-attribute.md +2 -1
- package/docs/examples/functions/create-build.md +1 -1
- package/docs/examples/functions/create-execution.md +2 -1
- package/docs/examples/functions/create.md +3 -1
- package/docs/examples/functions/delete-execution.md +14 -0
- package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
- package/docs/examples/{account/list-billing-addresses.md → functions/get-template.md} +4 -4
- package/docs/examples/{account/create-payment-method.md → functions/list-specifications.md} +3 -3
- package/docs/examples/functions/list-templates.md +16 -0
- package/docs/examples/functions/update-deployment-build.md +14 -0
- package/docs/examples/functions/update.md +3 -1
- package/docs/examples/projects/create-j-w-t.md +15 -0
- package/docs/examples/projects/update-mock-numbers.md +14 -0
- package/docs/examples/projects/update-session-alerts.md +14 -0
- package/docs/examples/users/create-j-w-t.md +15 -0
- package/docs/examples/vcs/get-repository-contents.md +15 -0
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/enums/email-template-type.ts +2 -0
- package/src/enums/platform-type.ts +2 -0
- package/src/enums/runtime.ts +1 -0
- package/src/index.ts +1 -4
- package/src/models.ts +286 -960
- package/src/services/account.ts +2 -345
- package/src/services/console.ts +0 -120
- package/src/services/databases.ts +54 -10
- package/src/services/functions.ts +195 -14
- package/src/services/projects.ts +110 -1
- package/src/services/users.ts +37 -0
- package/src/services/vcs.ts +36 -0
- package/types/enums/email-template-type.d.ts +3 -1
- package/types/enums/platform-type.d.ts +3 -1
- package/types/enums/runtime.d.ts +2 -1
- package/types/index.d.ts +1 -4
- package/types/models.d.ts +286 -960
- package/types/services/account.d.ts +1 -105
- package/types/services/console.d.ts +0 -38
- package/types/services/databases.d.ts +21 -10
- package/types/services/functions.d.ts +67 -8
- package/types/services/projects.d.ts +32 -1
- package/types/services/users.d.ts +12 -0
- package/types/services/vcs.d.ts +11 -0
- package/docs/examples/account/delete-payment-method.md +0 -13
- package/docs/examples/account/get-billing-address.md +0 -13
- package/docs/examples/account/get-payment-method.md +0 -13
- package/docs/examples/account/list-credits.md +0 -14
- package/docs/examples/account/list-invoices.md +0 -13
- package/docs/examples/account/list-payment-methods.md +0 -13
- package/docs/examples/account/update-payment-method-mandate-options.md +0 -13
- package/docs/examples/account/update-payment-method-provider.md +0 -15
- package/docs/examples/account/update-payment-method.md +0 -15
- package/docs/examples/backups/create-archive.md +0 -14
- package/docs/examples/backups/create-policy.md +0 -19
- package/docs/examples/backups/create-restoration.md +0 -16
- package/docs/examples/backups/delete-archive.md +0 -13
- package/docs/examples/backups/delete-policy.md +0 -13
- package/docs/examples/backups/get-archive.md +0 -13
- package/docs/examples/backups/get-policy.md +0 -13
- package/docs/examples/backups/get-restoration.md +0 -13
- package/docs/examples/backups/list-archives.md +0 -13
- package/docs/examples/backups/list-policies.md +0 -13
- package/docs/examples/backups/list-restorations.md +0 -13
- package/docs/examples/backups/update-policy.md +0 -17
- package/docs/examples/console/create-source.md +0 -17
- package/docs/examples/console/get-copon.md +0 -13
- package/docs/examples/console/plans.md +0 -11
- package/docs/examples/console/regions.md +0 -11
- package/docs/examples/organizations/add-credit.md +0 -14
- package/docs/examples/organizations/create-invoice-payment.md +0 -15
- package/docs/examples/organizations/create.md +0 -17
- package/docs/examples/organizations/delete-backup-payment-method.md +0 -13
- package/docs/examples/organizations/delete-billing-address.md +0 -13
- package/docs/examples/organizations/delete-default-payment-method.md +0 -13
- package/docs/examples/organizations/delete.md +0 -13
- package/docs/examples/organizations/get-aggregation.md +0 -14
- package/docs/examples/organizations/get-billing-address.md +0 -14
- package/docs/examples/organizations/get-credit.md +0 -14
- package/docs/examples/organizations/get-invoice-download.md +0 -14
- package/docs/examples/organizations/get-invoice-view.md +0 -14
- package/docs/examples/organizations/get-invoice.md +0 -14
- package/docs/examples/organizations/get-payment-method.md +0 -14
- package/docs/examples/organizations/get-plan.md +0 -13
- package/docs/examples/organizations/get-usage.md +0 -15
- package/docs/examples/organizations/list-aggregations.md +0 -14
- package/docs/examples/organizations/list-invoices.md +0 -14
- package/docs/examples/organizations/list.md +0 -14
- package/docs/examples/organizations/set-backup-payment-method.md +0 -14
- package/docs/examples/organizations/set-billing-address.md +0 -14
- package/docs/examples/organizations/set-billing-email.md +0 -14
- package/docs/examples/organizations/set-billing-tax-id.md +0 -14
- package/docs/examples/organizations/set-default-payment-method.md +0 -14
- package/docs/examples/organizations/update-budget.md +0 -15
- package/docs/examples/organizations/update-plan.md +0 -16
- package/src/enums/billing-plan.ts +0 -5
- package/src/services/backups.ts +0 -425
- package/src/services/organizations.ts +0 -896
- package/types/enums/billing-plan.d.ts +0 -5
- package/types/services/backups.d.ts +0 -128
- package/types/services/organizations.d.ts +0 -273
package/src/services/account.ts
CHANGED
|
@@ -112,62 +112,6 @@ export class Account {
|
|
|
112
112
|
payload
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
/**
|
|
116
|
-
* List billing addresses
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* @param {string[]} queries
|
|
120
|
-
* @throws {AppwriteException}
|
|
121
|
-
* @returns {Promise<Models.BillingAddress>}
|
|
122
|
-
*/
|
|
123
|
-
async listBillingAddresses(queries?: string[]): Promise<Models.BillingAddress> {
|
|
124
|
-
const apiPath = '/account/billing-addresses';
|
|
125
|
-
const payload: Payload = {};
|
|
126
|
-
if (typeof queries !== 'undefined') {
|
|
127
|
-
payload['queries'] = queries;
|
|
128
|
-
}
|
|
129
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
130
|
-
|
|
131
|
-
const apiHeaders: { [header: string]: string } = {
|
|
132
|
-
'content-type': 'application/json',
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return await this.client.call(
|
|
137
|
-
'get',
|
|
138
|
-
uri,
|
|
139
|
-
apiHeaders,
|
|
140
|
-
payload
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get billing address
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* @param {string} billingAddressId
|
|
148
|
-
* @throws {AppwriteException}
|
|
149
|
-
* @returns {Promise<Models.BillingAddress>}
|
|
150
|
-
*/
|
|
151
|
-
async getBillingAddress(billingAddressId: string): Promise<Models.BillingAddress> {
|
|
152
|
-
if (typeof billingAddressId === 'undefined') {
|
|
153
|
-
throw new AppwriteException('Missing required parameter: "billingAddressId"');
|
|
154
|
-
}
|
|
155
|
-
const apiPath = '/account/billing-addresses/{billingAddressId}'.replace('{billingAddressId}', billingAddressId);
|
|
156
|
-
const payload: Payload = {};
|
|
157
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
158
|
-
|
|
159
|
-
const apiHeaders: { [header: string]: string } = {
|
|
160
|
-
'content-type': 'application/json',
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return await this.client.call(
|
|
165
|
-
'get',
|
|
166
|
-
uri,
|
|
167
|
-
apiHeaders,
|
|
168
|
-
payload
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
115
|
/**
|
|
172
116
|
* Update email
|
|
173
117
|
*
|
|
@@ -267,34 +211,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
267
211
|
payload
|
|
268
212
|
);
|
|
269
213
|
}
|
|
270
|
-
/**
|
|
271
|
-
* List invoices
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* @param {string[]} queries
|
|
275
|
-
* @throws {AppwriteException}
|
|
276
|
-
* @returns {Promise<Models.InvoiceList>}
|
|
277
|
-
*/
|
|
278
|
-
async listInvoices(queries?: string[]): Promise<Models.InvoiceList> {
|
|
279
|
-
const apiPath = '/account/invoices';
|
|
280
|
-
const payload: Payload = {};
|
|
281
|
-
if (typeof queries !== 'undefined') {
|
|
282
|
-
payload['queries'] = queries;
|
|
283
|
-
}
|
|
284
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
285
|
-
|
|
286
|
-
const apiHeaders: { [header: string]: string } = {
|
|
287
|
-
'content-type': 'application/json',
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return await this.client.call(
|
|
292
|
-
'get',
|
|
293
|
-
uri,
|
|
294
|
-
apiHeaders,
|
|
295
|
-
payload
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
214
|
/**
|
|
299
215
|
* Create JWT
|
|
300
216
|
*
|
|
@@ -304,7 +220,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
304
220
|
* @returns {Promise<Models.Jwt>}
|
|
305
221
|
*/
|
|
306
222
|
async createJWT(): Promise<Models.Jwt> {
|
|
307
|
-
const apiPath = '/account/
|
|
223
|
+
const apiPath = '/account/jwts';
|
|
308
224
|
const payload: Payload = {};
|
|
309
225
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
310
226
|
|
|
@@ -452,22 +368,15 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
452
368
|
* Delete an authenticator for a user by ID.
|
|
453
369
|
*
|
|
454
370
|
* @param {AuthenticatorType} type
|
|
455
|
-
* @param {string} otp
|
|
456
371
|
* @throws {AppwriteException}
|
|
457
372
|
* @returns {Promise<{}>}
|
|
458
373
|
*/
|
|
459
|
-
async deleteMfaAuthenticator(type: AuthenticatorType
|
|
374
|
+
async deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> {
|
|
460
375
|
if (typeof type === 'undefined') {
|
|
461
376
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
462
377
|
}
|
|
463
|
-
if (typeof otp === 'undefined') {
|
|
464
|
-
throw new AppwriteException('Missing required parameter: "otp"');
|
|
465
|
-
}
|
|
466
378
|
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
467
379
|
const payload: Payload = {};
|
|
468
|
-
if (typeof otp !== 'undefined') {
|
|
469
|
-
payload['otp'] = otp;
|
|
470
|
-
}
|
|
471
380
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
472
381
|
|
|
473
382
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -714,226 +623,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
714
623
|
}
|
|
715
624
|
|
|
716
625
|
|
|
717
|
-
return await this.client.call(
|
|
718
|
-
'patch',
|
|
719
|
-
uri,
|
|
720
|
-
apiHeaders,
|
|
721
|
-
payload
|
|
722
|
-
);
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* List payment methods
|
|
726
|
-
*
|
|
727
|
-
*
|
|
728
|
-
* @param {string[]} queries
|
|
729
|
-
* @throws {AppwriteException}
|
|
730
|
-
* @returns {Promise<Models.PaymentMethodList>}
|
|
731
|
-
*/
|
|
732
|
-
async listPaymentMethods(queries?: string[]): Promise<Models.PaymentMethodList> {
|
|
733
|
-
const apiPath = '/account/payment-methods';
|
|
734
|
-
const payload: Payload = {};
|
|
735
|
-
if (typeof queries !== 'undefined') {
|
|
736
|
-
payload['queries'] = queries;
|
|
737
|
-
}
|
|
738
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
739
|
-
|
|
740
|
-
const apiHeaders: { [header: string]: string } = {
|
|
741
|
-
'content-type': 'application/json',
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
return await this.client.call(
|
|
746
|
-
'get',
|
|
747
|
-
uri,
|
|
748
|
-
apiHeaders,
|
|
749
|
-
payload
|
|
750
|
-
);
|
|
751
|
-
}
|
|
752
|
-
/**
|
|
753
|
-
* Create new payment method
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
* @throws {AppwriteException}
|
|
757
|
-
* @returns {Promise<Models.PaymentMethod>}
|
|
758
|
-
*/
|
|
759
|
-
async createPaymentMethod(): Promise<Models.PaymentMethod> {
|
|
760
|
-
const apiPath = '/account/payment-methods';
|
|
761
|
-
const payload: Payload = {};
|
|
762
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
763
|
-
|
|
764
|
-
const apiHeaders: { [header: string]: string } = {
|
|
765
|
-
'content-type': 'application/json',
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
return await this.client.call(
|
|
770
|
-
'post',
|
|
771
|
-
uri,
|
|
772
|
-
apiHeaders,
|
|
773
|
-
payload
|
|
774
|
-
);
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* Get payment method
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
* @param {string} paymentMethodId
|
|
781
|
-
* @throws {AppwriteException}
|
|
782
|
-
* @returns {Promise<Models.PaymentMethod>}
|
|
783
|
-
*/
|
|
784
|
-
async getPaymentMethod(paymentMethodId: string): Promise<Models.PaymentMethod> {
|
|
785
|
-
if (typeof paymentMethodId === 'undefined') {
|
|
786
|
-
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
787
|
-
}
|
|
788
|
-
const apiPath = '/account/payment-methods/{paymentMethodId}'.replace('{paymentMethodId}', paymentMethodId);
|
|
789
|
-
const payload: Payload = {};
|
|
790
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
791
|
-
|
|
792
|
-
const apiHeaders: { [header: string]: string } = {
|
|
793
|
-
'content-type': 'application/json',
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
return await this.client.call(
|
|
798
|
-
'get',
|
|
799
|
-
uri,
|
|
800
|
-
apiHeaders,
|
|
801
|
-
payload
|
|
802
|
-
);
|
|
803
|
-
}
|
|
804
|
-
/**
|
|
805
|
-
* Update payment method
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
* @param {string} paymentMethodId
|
|
809
|
-
* @param {number} expiryMonth
|
|
810
|
-
* @param {number} expiryYear
|
|
811
|
-
* @throws {AppwriteException}
|
|
812
|
-
* @returns {Promise<Models.PaymentMethod>}
|
|
813
|
-
*/
|
|
814
|
-
async updatePaymentMethod(paymentMethodId: string, expiryMonth: number, expiryYear: number): Promise<Models.PaymentMethod> {
|
|
815
|
-
if (typeof paymentMethodId === 'undefined') {
|
|
816
|
-
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
817
|
-
}
|
|
818
|
-
if (typeof expiryMonth === 'undefined') {
|
|
819
|
-
throw new AppwriteException('Missing required parameter: "expiryMonth"');
|
|
820
|
-
}
|
|
821
|
-
if (typeof expiryYear === 'undefined') {
|
|
822
|
-
throw new AppwriteException('Missing required parameter: "expiryYear"');
|
|
823
|
-
}
|
|
824
|
-
const apiPath = '/account/payment-methods/{paymentMethodId}'.replace('{paymentMethodId}', paymentMethodId);
|
|
825
|
-
const payload: Payload = {};
|
|
826
|
-
if (typeof expiryMonth !== 'undefined') {
|
|
827
|
-
payload['expiryMonth'] = expiryMonth;
|
|
828
|
-
}
|
|
829
|
-
if (typeof expiryYear !== 'undefined') {
|
|
830
|
-
payload['expiryYear'] = expiryYear;
|
|
831
|
-
}
|
|
832
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
833
|
-
|
|
834
|
-
const apiHeaders: { [header: string]: string } = {
|
|
835
|
-
'content-type': 'application/json',
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
return await this.client.call(
|
|
840
|
-
'patch',
|
|
841
|
-
uri,
|
|
842
|
-
apiHeaders,
|
|
843
|
-
payload
|
|
844
|
-
);
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
* Delete payment method
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
* @param {string} paymentMethodId
|
|
851
|
-
* @throws {AppwriteException}
|
|
852
|
-
* @returns {Promise<{}>}
|
|
853
|
-
*/
|
|
854
|
-
async deletePaymentMethod(paymentMethodId: string): Promise<{}> {
|
|
855
|
-
if (typeof paymentMethodId === 'undefined') {
|
|
856
|
-
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
857
|
-
}
|
|
858
|
-
const apiPath = '/account/payment-methods/{paymentMethodId}'.replace('{paymentMethodId}', paymentMethodId);
|
|
859
|
-
const payload: Payload = {};
|
|
860
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
861
|
-
|
|
862
|
-
const apiHeaders: { [header: string]: string } = {
|
|
863
|
-
'content-type': 'application/json',
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
return await this.client.call(
|
|
868
|
-
'delete',
|
|
869
|
-
uri,
|
|
870
|
-
apiHeaders,
|
|
871
|
-
payload
|
|
872
|
-
);
|
|
873
|
-
}
|
|
874
|
-
/**
|
|
875
|
-
* Update payment method provider id
|
|
876
|
-
*
|
|
877
|
-
*
|
|
878
|
-
* @param {string} paymentMethodId
|
|
879
|
-
* @param {string} providerMethodId
|
|
880
|
-
* @param {string} name
|
|
881
|
-
* @throws {AppwriteException}
|
|
882
|
-
* @returns {Promise<Models.PaymentMethod>}
|
|
883
|
-
*/
|
|
884
|
-
async updatePaymentMethodProvider(paymentMethodId: string, providerMethodId: string, name: string): Promise<Models.PaymentMethod> {
|
|
885
|
-
if (typeof paymentMethodId === 'undefined') {
|
|
886
|
-
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
887
|
-
}
|
|
888
|
-
if (typeof providerMethodId === 'undefined') {
|
|
889
|
-
throw new AppwriteException('Missing required parameter: "providerMethodId"');
|
|
890
|
-
}
|
|
891
|
-
if (typeof name === 'undefined') {
|
|
892
|
-
throw new AppwriteException('Missing required parameter: "name"');
|
|
893
|
-
}
|
|
894
|
-
const apiPath = '/account/payment-methods/{paymentMethodId}/provider'.replace('{paymentMethodId}', paymentMethodId);
|
|
895
|
-
const payload: Payload = {};
|
|
896
|
-
if (typeof providerMethodId !== 'undefined') {
|
|
897
|
-
payload['providerMethodId'] = providerMethodId;
|
|
898
|
-
}
|
|
899
|
-
if (typeof name !== 'undefined') {
|
|
900
|
-
payload['name'] = name;
|
|
901
|
-
}
|
|
902
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
903
|
-
|
|
904
|
-
const apiHeaders: { [header: string]: string } = {
|
|
905
|
-
'content-type': 'application/json',
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
return await this.client.call(
|
|
910
|
-
'patch',
|
|
911
|
-
uri,
|
|
912
|
-
apiHeaders,
|
|
913
|
-
payload
|
|
914
|
-
);
|
|
915
|
-
}
|
|
916
|
-
/**
|
|
917
|
-
* Update payment method with new setup with mandates for indian cards
|
|
918
|
-
*
|
|
919
|
-
*
|
|
920
|
-
* @param {string} paymentMethodId
|
|
921
|
-
* @throws {AppwriteException}
|
|
922
|
-
* @returns {Promise<Models.PaymentMethod>}
|
|
923
|
-
*/
|
|
924
|
-
async updatePaymentMethodMandateOptions(paymentMethodId: string): Promise<Models.PaymentMethod> {
|
|
925
|
-
if (typeof paymentMethodId === 'undefined') {
|
|
926
|
-
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
927
|
-
}
|
|
928
|
-
const apiPath = '/account/payment-methods/{paymentMethodId}/setup'.replace('{paymentMethodId}', paymentMethodId);
|
|
929
|
-
const payload: Payload = {};
|
|
930
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
931
|
-
|
|
932
|
-
const apiHeaders: { [header: string]: string } = {
|
|
933
|
-
'content-type': 'application/json',
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
|
|
937
626
|
return await this.client.call(
|
|
938
627
|
'patch',
|
|
939
628
|
uri,
|
|
@@ -1947,36 +1636,4 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1947
1636
|
payload
|
|
1948
1637
|
);
|
|
1949
1638
|
}
|
|
1950
|
-
/**
|
|
1951
|
-
* List credits
|
|
1952
|
-
*
|
|
1953
|
-
*
|
|
1954
|
-
* @param {string} organizationId
|
|
1955
|
-
* @param {string[]} queries
|
|
1956
|
-
* @throws {AppwriteException}
|
|
1957
|
-
* @returns {Promise<Models.CreditList>}
|
|
1958
|
-
*/
|
|
1959
|
-
async listCredits(organizationId: string, queries?: string[]): Promise<Models.CreditList> {
|
|
1960
|
-
if (typeof organizationId === 'undefined') {
|
|
1961
|
-
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
1962
|
-
}
|
|
1963
|
-
const apiPath = '/organizations/{organizationId}/credits'.replace('{organizationId}', organizationId);
|
|
1964
|
-
const payload: Payload = {};
|
|
1965
|
-
if (typeof queries !== 'undefined') {
|
|
1966
|
-
payload['queries'] = queries;
|
|
1967
|
-
}
|
|
1968
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1969
|
-
|
|
1970
|
-
const apiHeaders: { [header: string]: string } = {
|
|
1971
|
-
'content-type': 'application/json',
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
return await this.client.call(
|
|
1976
|
-
'get',
|
|
1977
|
-
uri,
|
|
1978
|
-
apiHeaders,
|
|
1979
|
-
payload
|
|
1980
|
-
);
|
|
1981
|
-
}
|
|
1982
1639
|
}
|
package/src/services/console.ts
CHANGED
|
@@ -9,126 +9,6 @@ export class Console {
|
|
|
9
9
|
this.client = client;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Get coupon details
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param {string} couponId
|
|
17
|
-
* @throws {AppwriteException}
|
|
18
|
-
* @returns {Promise<Models.Coupon>}
|
|
19
|
-
*/
|
|
20
|
-
async getCopon(couponId: string): Promise<Models.Coupon> {
|
|
21
|
-
if (typeof couponId === 'undefined') {
|
|
22
|
-
throw new AppwriteException('Missing required parameter: "couponId"');
|
|
23
|
-
}
|
|
24
|
-
const apiPath = '/console/coupons/{couponId}'.replace('{couponId}', couponId);
|
|
25
|
-
const payload: Payload = {};
|
|
26
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
27
|
-
|
|
28
|
-
const apiHeaders: { [header: string]: string } = {
|
|
29
|
-
'content-type': 'application/json',
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return await this.client.call(
|
|
34
|
-
'get',
|
|
35
|
-
uri,
|
|
36
|
-
apiHeaders,
|
|
37
|
-
payload
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get plans
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @throws {AppwriteException}
|
|
45
|
-
* @returns {Promise<Models.BillingPlanList>}
|
|
46
|
-
*/
|
|
47
|
-
async plans(): Promise<Models.BillingPlanList> {
|
|
48
|
-
const apiPath = '/console/plans';
|
|
49
|
-
const payload: Payload = {};
|
|
50
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
51
|
-
|
|
52
|
-
const apiHeaders: { [header: string]: string } = {
|
|
53
|
-
'content-type': 'application/json',
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return await this.client.call(
|
|
58
|
-
'get',
|
|
59
|
-
uri,
|
|
60
|
-
apiHeaders,
|
|
61
|
-
payload
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Get Regions
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @throws {AppwriteException}
|
|
69
|
-
* @returns {Promise<Models.ConsoleRegionList>}
|
|
70
|
-
*/
|
|
71
|
-
async regions(): Promise<Models.ConsoleRegionList> {
|
|
72
|
-
const apiPath = '/console/regions';
|
|
73
|
-
const payload: Payload = {};
|
|
74
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
75
|
-
|
|
76
|
-
const apiHeaders: { [header: string]: string } = {
|
|
77
|
-
'content-type': 'application/json',
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return await this.client.call(
|
|
82
|
-
'get',
|
|
83
|
-
uri,
|
|
84
|
-
apiHeaders,
|
|
85
|
-
payload
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Create source
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* @param {string} ref
|
|
93
|
-
* @param {string} referrer
|
|
94
|
-
* @param {string} utmSource
|
|
95
|
-
* @param {string} utmCampaign
|
|
96
|
-
* @param {string} utmMedium
|
|
97
|
-
* @throws {AppwriteException}
|
|
98
|
-
* @returns {Promise<{}>}
|
|
99
|
-
*/
|
|
100
|
-
async createSource(ref?: string, referrer?: string, utmSource?: string, utmCampaign?: string, utmMedium?: string): Promise<{}> {
|
|
101
|
-
const apiPath = '/console/sources';
|
|
102
|
-
const payload: Payload = {};
|
|
103
|
-
if (typeof ref !== 'undefined') {
|
|
104
|
-
payload['ref'] = ref;
|
|
105
|
-
}
|
|
106
|
-
if (typeof referrer !== 'undefined') {
|
|
107
|
-
payload['referrer'] = referrer;
|
|
108
|
-
}
|
|
109
|
-
if (typeof utmSource !== 'undefined') {
|
|
110
|
-
payload['utmSource'] = utmSource;
|
|
111
|
-
}
|
|
112
|
-
if (typeof utmCampaign !== 'undefined') {
|
|
113
|
-
payload['utmCampaign'] = utmCampaign;
|
|
114
|
-
}
|
|
115
|
-
if (typeof utmMedium !== 'undefined') {
|
|
116
|
-
payload['utmMedium'] = utmMedium;
|
|
117
|
-
}
|
|
118
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
119
|
-
|
|
120
|
-
const apiHeaders: { [header: string]: string } = {
|
|
121
|
-
'content-type': 'application/json',
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return await this.client.call(
|
|
126
|
-
'post',
|
|
127
|
-
uri,
|
|
128
|
-
apiHeaders,
|
|
129
|
-
payload
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
12
|
/**
|
|
133
13
|
* Get variables
|
|
134
14
|
*
|