@appwrite.io/console 1.0.1 → 1.1.0-rc.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/README.md +3 -3
- package/dist/cjs/sdk.js +3565 -2411
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +3564 -2412
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +3565 -2411
- package/docs/examples/{functions/list-specifications.md → account/create-payment-method.md} +3 -3
- package/docs/examples/account/delete-mfa-authenticator.md +2 -1
- package/docs/examples/account/delete-payment-method.md +13 -0
- package/docs/examples/account/get-billing-address.md +13 -0
- package/docs/examples/account/get-payment-method.md +13 -0
- package/docs/examples/{functions/get-template.md → account/list-billing-addresses.md} +4 -4
- package/docs/examples/account/list-credits.md +14 -0
- package/docs/examples/account/list-invoices.md +13 -0
- package/docs/examples/account/list-payment-methods.md +13 -0
- package/docs/examples/account/update-payment-method-mandate-options.md +13 -0
- package/docs/examples/account/update-payment-method-provider.md +15 -0
- package/docs/examples/account/update-payment-method.md +15 -0
- package/docs/examples/backups/create-archive.md +14 -0
- package/docs/examples/backups/create-policy.md +19 -0
- package/docs/examples/backups/create-restoration.md +16 -0
- package/docs/examples/backups/delete-archive.md +13 -0
- package/docs/examples/backups/delete-policy.md +13 -0
- package/docs/examples/backups/get-archive.md +13 -0
- package/docs/examples/backups/get-policy.md +13 -0
- package/docs/examples/backups/get-restoration.md +13 -0
- package/docs/examples/backups/list-archives.md +13 -0
- package/docs/examples/backups/list-policies.md +13 -0
- package/docs/examples/backups/list-restorations.md +13 -0
- package/docs/examples/backups/update-policy.md +17 -0
- package/docs/examples/console/create-source.md +17 -0
- package/docs/examples/console/get-copon.md +13 -0
- package/docs/examples/console/plans.md +11 -0
- package/docs/examples/console/regions.md +11 -0
- package/docs/examples/functions/create-build.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -2
- package/docs/examples/functions/create.md +1 -3
- package/docs/examples/functions/{get-deployment-download.md → download-deployment.md} +1 -1
- package/docs/examples/functions/update.md +1 -3
- package/docs/examples/organizations/add-credit.md +14 -0
- package/docs/examples/organizations/create-invoice-payment.md +15 -0
- package/docs/examples/organizations/create.md +17 -0
- package/docs/examples/organizations/delete-backup-payment-method.md +13 -0
- package/docs/examples/organizations/delete-billing-address.md +13 -0
- package/docs/examples/organizations/delete-default-payment-method.md +13 -0
- package/docs/examples/organizations/delete.md +13 -0
- package/docs/examples/organizations/get-aggregation.md +14 -0
- package/docs/examples/organizations/get-billing-address.md +14 -0
- package/docs/examples/organizations/get-credit.md +14 -0
- package/docs/examples/organizations/get-invoice-download.md +14 -0
- package/docs/examples/organizations/get-invoice-view.md +14 -0
- package/docs/examples/organizations/get-invoice.md +14 -0
- package/docs/examples/organizations/get-payment-method.md +14 -0
- package/docs/examples/organizations/get-plan.md +13 -0
- package/docs/examples/organizations/get-usage.md +15 -0
- package/docs/examples/organizations/list-aggregations.md +14 -0
- package/docs/examples/organizations/list-invoices.md +14 -0
- package/docs/examples/organizations/list.md +14 -0
- package/docs/examples/organizations/set-backup-payment-method.md +14 -0
- package/docs/examples/organizations/set-billing-address.md +14 -0
- package/docs/examples/organizations/set-billing-email.md +14 -0
- package/docs/examples/organizations/set-billing-tax-id.md +14 -0
- package/docs/examples/organizations/set-default-payment-method.md +14 -0
- package/docs/examples/organizations/update-budget.md +15 -0
- package/docs/examples/organizations/update-plan.md +16 -0
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/enums/billing-plan.ts +5 -0
- package/src/enums/email-template-type.ts +0 -2
- package/src/enums/platform-type.ts +0 -2
- package/src/enums/runtime.ts +0 -1
- package/src/index.ts +4 -1
- package/src/models.ts +956 -282
- package/src/services/account.ts +345 -2
- package/src/services/backups.ts +425 -0
- package/src/services/console.ts +120 -0
- package/src/services/functions.ts +14 -195
- package/src/services/organizations.ts +896 -0
- package/src/services/projects.ts +1 -110
- package/src/services/users.ts +0 -37
- package/src/services/vcs.ts +0 -36
- package/types/enums/billing-plan.d.ts +5 -0
- package/types/enums/email-template-type.d.ts +1 -3
- package/types/enums/platform-type.d.ts +1 -3
- package/types/enums/runtime.d.ts +1 -2
- package/types/index.d.ts +4 -1
- package/types/models.d.ts +956 -282
- package/types/services/account.d.ts +105 -1
- package/types/services/backups.d.ts +128 -0
- package/types/services/console.d.ts +38 -0
- package/types/services/functions.d.ts +8 -67
- package/types/services/organizations.d.ts +273 -0
- package/types/services/projects.d.ts +1 -32
- package/types/services/users.d.ts +0 -12
- package/types/services/vcs.d.ts +0 -11
- package/docs/examples/functions/delete-execution.md +0 -14
- package/docs/examples/functions/list-templates.md +0 -16
- package/docs/examples/functions/update-deployment-build.md +0 -14
- package/docs/examples/projects/create-j-w-t.md +0 -15
- package/docs/examples/projects/update-mock-numbers.md +0 -14
- package/docs/examples/projects/update-session-alerts.md +0 -14
- package/docs/examples/users/create-j-w-t.md +0 -15
- package/docs/examples/vcs/get-repository-contents.md +0 -15
package/src/services/projects.ts
CHANGED
|
@@ -439,41 +439,6 @@ 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 the mock numbers for the project
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
* @param {string} projectId
|
|
454
|
-
* @param {object[]} numbers
|
|
455
|
-
* @throws {AppwriteException}
|
|
456
|
-
* @returns {Promise<Models.Project>}
|
|
457
|
-
*/
|
|
458
|
-
async updateMockNumbers(projectId: string, numbers: object[]): Promise<Models.Project> {
|
|
459
|
-
if (typeof projectId === 'undefined') {
|
|
460
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
461
|
-
}
|
|
462
|
-
if (typeof numbers === 'undefined') {
|
|
463
|
-
throw new AppwriteException('Missing required parameter: "numbers"');
|
|
464
|
-
}
|
|
465
|
-
const apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId);
|
|
466
|
-
const payload: Payload = {};
|
|
467
|
-
if (typeof numbers !== 'undefined') {
|
|
468
|
-
payload['numbers'] = numbers;
|
|
469
|
-
}
|
|
470
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
471
|
-
|
|
472
|
-
const apiHeaders: { [header: string]: string } = {
|
|
473
|
-
'content-type': 'application/json',
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
|
|
477
442
|
return await this.client.call(
|
|
478
443
|
'patch',
|
|
479
444
|
uri,
|
|
@@ -579,41 +544,6 @@ export class Projects {
|
|
|
579
544
|
}
|
|
580
545
|
|
|
581
546
|
|
|
582
|
-
return await this.client.call(
|
|
583
|
-
'patch',
|
|
584
|
-
uri,
|
|
585
|
-
apiHeaders,
|
|
586
|
-
payload
|
|
587
|
-
);
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Update project sessions emails
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
* @param {string} projectId
|
|
594
|
-
* @param {boolean} alerts
|
|
595
|
-
* @throws {AppwriteException}
|
|
596
|
-
* @returns {Promise<Models.Project>}
|
|
597
|
-
*/
|
|
598
|
-
async updateSessionAlerts(projectId: string, alerts: boolean): Promise<Models.Project> {
|
|
599
|
-
if (typeof projectId === 'undefined') {
|
|
600
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
601
|
-
}
|
|
602
|
-
if (typeof alerts === 'undefined') {
|
|
603
|
-
throw new AppwriteException('Missing required parameter: "alerts"');
|
|
604
|
-
}
|
|
605
|
-
const apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId);
|
|
606
|
-
const payload: Payload = {};
|
|
607
|
-
if (typeof alerts !== 'undefined') {
|
|
608
|
-
payload['alerts'] = alerts;
|
|
609
|
-
}
|
|
610
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
611
|
-
|
|
612
|
-
const apiHeaders: { [header: string]: string } = {
|
|
613
|
-
'content-type': 'application/json',
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
|
|
617
547
|
return await this.client.call(
|
|
618
548
|
'patch',
|
|
619
549
|
uri,
|
|
@@ -660,45 +590,6 @@ export class Projects {
|
|
|
660
590
|
payload
|
|
661
591
|
);
|
|
662
592
|
}
|
|
663
|
-
/**
|
|
664
|
-
* Create JWT
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
* @param {string} projectId
|
|
668
|
-
* @param {string[]} scopes
|
|
669
|
-
* @param {number} duration
|
|
670
|
-
* @throws {AppwriteException}
|
|
671
|
-
* @returns {Promise<Models.Jwt>}
|
|
672
|
-
*/
|
|
673
|
-
async createJWT(projectId: string, scopes: string[], duration?: number): Promise<Models.Jwt> {
|
|
674
|
-
if (typeof projectId === 'undefined') {
|
|
675
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
676
|
-
}
|
|
677
|
-
if (typeof scopes === 'undefined') {
|
|
678
|
-
throw new AppwriteException('Missing required parameter: "scopes"');
|
|
679
|
-
}
|
|
680
|
-
const apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId);
|
|
681
|
-
const payload: Payload = {};
|
|
682
|
-
if (typeof scopes !== 'undefined') {
|
|
683
|
-
payload['scopes'] = scopes;
|
|
684
|
-
}
|
|
685
|
-
if (typeof duration !== 'undefined') {
|
|
686
|
-
payload['duration'] = duration;
|
|
687
|
-
}
|
|
688
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
689
|
-
|
|
690
|
-
const apiHeaders: { [header: string]: string } = {
|
|
691
|
-
'content-type': 'application/json',
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
return await this.client.call(
|
|
696
|
-
'post',
|
|
697
|
-
uri,
|
|
698
|
-
apiHeaders,
|
|
699
|
-
payload
|
|
700
|
-
);
|
|
701
|
-
}
|
|
702
593
|
/**
|
|
703
594
|
* List keys
|
|
704
595
|
*
|
|
@@ -1352,7 +1243,7 @@ export class Projects {
|
|
|
1352
1243
|
);
|
|
1353
1244
|
}
|
|
1354
1245
|
/**
|
|
1355
|
-
* Update
|
|
1246
|
+
* Update Project Team
|
|
1356
1247
|
*
|
|
1357
1248
|
*
|
|
1358
1249
|
* @param {string} projectId
|
package/src/services/users.ts
CHANGED
|
@@ -688,43 +688,6 @@ export class Users {
|
|
|
688
688
|
payload
|
|
689
689
|
);
|
|
690
690
|
}
|
|
691
|
-
/**
|
|
692
|
-
* Create user JWT
|
|
693
|
-
*
|
|
694
|
-
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
695
|
-
*
|
|
696
|
-
* @param {string} userId
|
|
697
|
-
* @param {string} sessionId
|
|
698
|
-
* @param {number} duration
|
|
699
|
-
* @throws {AppwriteException}
|
|
700
|
-
* @returns {Promise<Models.Jwt>}
|
|
701
|
-
*/
|
|
702
|
-
async createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt> {
|
|
703
|
-
if (typeof userId === 'undefined') {
|
|
704
|
-
throw new AppwriteException('Missing required parameter: "userId"');
|
|
705
|
-
}
|
|
706
|
-
const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
|
|
707
|
-
const payload: Payload = {};
|
|
708
|
-
if (typeof sessionId !== 'undefined') {
|
|
709
|
-
payload['sessionId'] = sessionId;
|
|
710
|
-
}
|
|
711
|
-
if (typeof duration !== 'undefined') {
|
|
712
|
-
payload['duration'] = duration;
|
|
713
|
-
}
|
|
714
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
715
|
-
|
|
716
|
-
const apiHeaders: { [header: string]: string } = {
|
|
717
|
-
'content-type': 'application/json',
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
return await this.client.call(
|
|
722
|
-
'post',
|
|
723
|
-
uri,
|
|
724
|
-
apiHeaders,
|
|
725
|
-
payload
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
691
|
/**
|
|
729
692
|
* Update user labels
|
|
730
693
|
*
|
package/src/services/vcs.ts
CHANGED
|
@@ -140,42 +140,6 @@ export class Vcs {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
|
|
143
|
-
return await this.client.call(
|
|
144
|
-
'get',
|
|
145
|
-
uri,
|
|
146
|
-
apiHeaders,
|
|
147
|
-
payload
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Get files and directories of a VCS repository
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* @param {string} installationId
|
|
155
|
-
* @param {string} providerRepositoryId
|
|
156
|
-
* @param {string} providerRootDirectory
|
|
157
|
-
* @throws {AppwriteException}
|
|
158
|
-
* @returns {Promise<Models.VcsContentList>}
|
|
159
|
-
*/
|
|
160
|
-
async getRepositoryContents(installationId: string, providerRepositoryId: string, providerRootDirectory?: string): Promise<Models.VcsContentList> {
|
|
161
|
-
if (typeof installationId === 'undefined') {
|
|
162
|
-
throw new AppwriteException('Missing required parameter: "installationId"');
|
|
163
|
-
}
|
|
164
|
-
if (typeof providerRepositoryId === 'undefined') {
|
|
165
|
-
throw new AppwriteException('Missing required parameter: "providerRepositoryId"');
|
|
166
|
-
}
|
|
167
|
-
const apiPath = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/contents'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId);
|
|
168
|
-
const payload: Payload = {};
|
|
169
|
-
if (typeof providerRootDirectory !== 'undefined') {
|
|
170
|
-
payload['providerRootDirectory'] = providerRootDirectory;
|
|
171
|
-
}
|
|
172
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
173
|
-
|
|
174
|
-
const apiHeaders: { [header: string]: string } = {
|
|
175
|
-
'content-type': 'application/json',
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
143
|
return await this.client.call(
|
|
180
144
|
'get',
|
|
181
145
|
uri,
|
package/types/enums/runtime.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Appwrite Console SDK
|
|
3
3
|
*
|
|
4
|
-
* This SDK is compatible with Appwrite server version 1.
|
|
4
|
+
* This SDK is compatible with Appwrite server version 1.5.x.
|
|
5
5
|
* For older versions, please check
|
|
6
6
|
* [previous releases](https://github.com/appwrite/sdk-for-console/releases).
|
|
7
7
|
*/
|
|
8
8
|
export { Client, Query, AppwriteException } from './client';
|
|
9
9
|
export { Account } from './services/account';
|
|
10
10
|
export { Avatars } from './services/avatars';
|
|
11
|
+
export { Backups } from './services/backups';
|
|
11
12
|
export { Assistant } from './services/assistant';
|
|
12
13
|
export { Console } from './services/console';
|
|
13
14
|
export { Databases } from './services/databases';
|
|
@@ -17,6 +18,7 @@ export { Health } from './services/health';
|
|
|
17
18
|
export { Locale } from './services/locale';
|
|
18
19
|
export { Messaging } from './services/messaging';
|
|
19
20
|
export { Migrations } from './services/migrations';
|
|
21
|
+
export { Organizations } from './services/organizations';
|
|
20
22
|
export { Project } from './services/project';
|
|
21
23
|
export { Projects } from './services/projects';
|
|
22
24
|
export { Proxy } from './services/proxy';
|
|
@@ -44,6 +46,7 @@ export { FunctionUsageRange } from './enums/function-usage-range';
|
|
|
44
46
|
export { ExecutionMethod } from './enums/execution-method';
|
|
45
47
|
export { Name } from './enums/name';
|
|
46
48
|
export { SmtpEncryption } from './enums/smtp-encryption';
|
|
49
|
+
export { BillingPlan } from './enums/billing-plan';
|
|
47
50
|
export { ProjectUsageRange } from './enums/project-usage-range';
|
|
48
51
|
export { Region } from './enums/region';
|
|
49
52
|
export { Api } from './enums/api';
|