@appwrite.io/console 1.4.4 → 1.4.5
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/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/cjs/sdk.js +63 -105
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +63 -105
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +63 -105
- package/docs/examples/{migrations/delete-firebase-auth.md → account/get-coupon.md} +5 -3
- package/docs/examples/account/update-payment-method.md +1 -1
- package/docs/examples/console/create-program-membership.md +13 -0
- package/package.json +1 -1
- package/src/client.ts +30 -5
- package/src/enums/runtime.ts +1 -0
- package/src/models.ts +34 -28
- package/src/services/account.ts +29 -1
- package/src/services/console.ts +28 -0
- package/src/services/migrations.ts +1 -125
- package/src/services/organizations.ts +3 -3
- package/types/enums/runtime.d.ts +2 -1
- package/types/models.d.ts +34 -28
- package/types/services/account.d.ts +10 -1
- package/types/services/console.d.ts +9 -0
- package/types/services/migrations.d.ts +1 -37
- package/types/services/organizations.d.ts +3 -3
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +0 -14
- package/docs/examples/migrations/get-firebase-report-o-auth.md +0 -14
- package/docs/examples/migrations/list-firebase-projects.md +0 -11
|
@@ -146,7 +146,7 @@ export class Migrations {
|
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Migrate Firebase data
|
|
149
|
+
* Migrate Firebase data
|
|
150
150
|
*
|
|
151
151
|
*
|
|
152
152
|
* @param {string[]} resources
|
|
@@ -183,92 +183,6 @@ export class Migrations {
|
|
|
183
183
|
payload
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
|
-
/**
|
|
187
|
-
* Revoke Appwrite's authorization to access Firebase projects
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* @throws {AppwriteException}
|
|
191
|
-
* @returns {Promise<{}>}
|
|
192
|
-
*/
|
|
193
|
-
async deleteFirebaseAuth(): Promise<{}> {
|
|
194
|
-
const apiPath = '/migrations/firebase/deauthorize';
|
|
195
|
-
const payload: Payload = {};
|
|
196
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
197
|
-
|
|
198
|
-
const apiHeaders: { [header: string]: string } = {
|
|
199
|
-
'content-type': 'application/json',
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return await this.client.call(
|
|
204
|
-
'get',
|
|
205
|
-
uri,
|
|
206
|
-
apiHeaders,
|
|
207
|
-
payload
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Migrate Firebase data (OAuth)
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* @param {string[]} resources
|
|
215
|
-
* @param {string} projectId
|
|
216
|
-
* @throws {AppwriteException}
|
|
217
|
-
* @returns {Promise<Models.Migration>}
|
|
218
|
-
*/
|
|
219
|
-
async createFirebaseOAuthMigration(resources: string[], projectId: string): Promise<Models.Migration> {
|
|
220
|
-
if (typeof resources === 'undefined') {
|
|
221
|
-
throw new AppwriteException('Missing required parameter: "resources"');
|
|
222
|
-
}
|
|
223
|
-
if (typeof projectId === 'undefined') {
|
|
224
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
225
|
-
}
|
|
226
|
-
const apiPath = '/migrations/firebase/oauth';
|
|
227
|
-
const payload: Payload = {};
|
|
228
|
-
if (typeof resources !== 'undefined') {
|
|
229
|
-
payload['resources'] = resources;
|
|
230
|
-
}
|
|
231
|
-
if (typeof projectId !== 'undefined') {
|
|
232
|
-
payload['projectId'] = projectId;
|
|
233
|
-
}
|
|
234
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
235
|
-
|
|
236
|
-
const apiHeaders: { [header: string]: string } = {
|
|
237
|
-
'content-type': 'application/json',
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
return await this.client.call(
|
|
242
|
-
'post',
|
|
243
|
-
uri,
|
|
244
|
-
apiHeaders,
|
|
245
|
-
payload
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* List Firebase projects
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* @throws {AppwriteException}
|
|
253
|
-
* @returns {Promise<Models.FirebaseProjectList>}
|
|
254
|
-
*/
|
|
255
|
-
async listFirebaseProjects(): Promise<Models.FirebaseProjectList> {
|
|
256
|
-
const apiPath = '/migrations/firebase/projects';
|
|
257
|
-
const payload: Payload = {};
|
|
258
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
259
|
-
|
|
260
|
-
const apiHeaders: { [header: string]: string } = {
|
|
261
|
-
'content-type': 'application/json',
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return await this.client.call(
|
|
266
|
-
'get',
|
|
267
|
-
uri,
|
|
268
|
-
apiHeaders,
|
|
269
|
-
payload
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
186
|
/**
|
|
273
187
|
* Generate a report on Firebase data
|
|
274
188
|
*
|
|
@@ -300,44 +214,6 @@ export class Migrations {
|
|
|
300
214
|
}
|
|
301
215
|
|
|
302
216
|
|
|
303
|
-
return await this.client.call(
|
|
304
|
-
'get',
|
|
305
|
-
uri,
|
|
306
|
-
apiHeaders,
|
|
307
|
-
payload
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Generate a report on Firebase data using OAuth
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
* @param {string[]} resources
|
|
315
|
-
* @param {string} projectId
|
|
316
|
-
* @throws {AppwriteException}
|
|
317
|
-
* @returns {Promise<Models.MigrationReport>}
|
|
318
|
-
*/
|
|
319
|
-
async getFirebaseReportOAuth(resources: string[], projectId: string): Promise<Models.MigrationReport> {
|
|
320
|
-
if (typeof resources === 'undefined') {
|
|
321
|
-
throw new AppwriteException('Missing required parameter: "resources"');
|
|
322
|
-
}
|
|
323
|
-
if (typeof projectId === 'undefined') {
|
|
324
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
325
|
-
}
|
|
326
|
-
const apiPath = '/migrations/firebase/report/oauth';
|
|
327
|
-
const payload: Payload = {};
|
|
328
|
-
if (typeof resources !== 'undefined') {
|
|
329
|
-
payload['resources'] = resources;
|
|
330
|
-
}
|
|
331
|
-
if (typeof projectId !== 'undefined') {
|
|
332
|
-
payload['projectId'] = projectId;
|
|
333
|
-
}
|
|
334
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
335
|
-
|
|
336
|
-
const apiHeaders: { [header: string]: string } = {
|
|
337
|
-
'content-type': 'application/json',
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
217
|
return await this.client.call(
|
|
342
218
|
'get',
|
|
343
219
|
uri,
|
|
@@ -165,9 +165,9 @@ export class Organizations {
|
|
|
165
165
|
* @param {string} organizationId
|
|
166
166
|
* @param {string} aggregationId
|
|
167
167
|
* @throws {AppwriteException}
|
|
168
|
-
* @returns {Promise<Models.
|
|
168
|
+
* @returns {Promise<Models.Invoice>}
|
|
169
169
|
*/
|
|
170
|
-
async getAggregation(organizationId: string, aggregationId: string): Promise<Models.
|
|
170
|
+
async getAggregation(organizationId: string, aggregationId: string): Promise<Models.Invoice> {
|
|
171
171
|
if (typeof organizationId === 'undefined') {
|
|
172
172
|
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
173
173
|
}
|
|
@@ -523,7 +523,7 @@ export class Organizations {
|
|
|
523
523
|
);
|
|
524
524
|
}
|
|
525
525
|
/**
|
|
526
|
-
*
|
|
526
|
+
* Download invoice in PDF
|
|
527
527
|
*
|
|
528
528
|
*
|
|
529
529
|
* @param {string} organizationId
|
package/types/enums/runtime.d.ts
CHANGED
package/types/models.d.ts
CHANGED
|
@@ -496,19 +496,6 @@ export declare namespace Models {
|
|
|
496
496
|
*/
|
|
497
497
|
migrations: Migration[];
|
|
498
498
|
};
|
|
499
|
-
/**
|
|
500
|
-
* Migrations Firebase Projects List
|
|
501
|
-
*/
|
|
502
|
-
type FirebaseProjectList = {
|
|
503
|
-
/**
|
|
504
|
-
* Total number of projects documents that matched your query.
|
|
505
|
-
*/
|
|
506
|
-
total: number;
|
|
507
|
-
/**
|
|
508
|
-
* List of projects.
|
|
509
|
-
*/
|
|
510
|
-
projects: FirebaseProject[];
|
|
511
|
-
};
|
|
512
499
|
/**
|
|
513
500
|
* Specifications List
|
|
514
501
|
*/
|
|
@@ -1941,7 +1928,7 @@ export declare namespace Models {
|
|
|
1941
1928
|
*/
|
|
1942
1929
|
events: string[];
|
|
1943
1930
|
/**
|
|
1944
|
-
* Function execution
|
|
1931
|
+
* Function execution schedule in CRON format.
|
|
1945
1932
|
*/
|
|
1946
1933
|
schedule: string;
|
|
1947
1934
|
/**
|
|
@@ -4086,19 +4073,6 @@ export declare namespace Models {
|
|
|
4086
4073
|
*/
|
|
4087
4074
|
version: string;
|
|
4088
4075
|
};
|
|
4089
|
-
/**
|
|
4090
|
-
* MigrationFirebaseProject
|
|
4091
|
-
*/
|
|
4092
|
-
type FirebaseProject = {
|
|
4093
|
-
/**
|
|
4094
|
-
* Project ID.
|
|
4095
|
-
*/
|
|
4096
|
-
projectId: string;
|
|
4097
|
-
/**
|
|
4098
|
-
* Project display name.
|
|
4099
|
-
*/
|
|
4100
|
-
displayName: string;
|
|
4101
|
-
};
|
|
4102
4076
|
/**
|
|
4103
4077
|
* AdditionalResource
|
|
4104
4078
|
*/
|
|
@@ -4319,6 +4293,10 @@ export declare namespace Models {
|
|
|
4319
4293
|
* Plan name
|
|
4320
4294
|
*/
|
|
4321
4295
|
name: string;
|
|
4296
|
+
/**
|
|
4297
|
+
* Plan order
|
|
4298
|
+
*/
|
|
4299
|
+
order: number;
|
|
4322
4300
|
/**
|
|
4323
4301
|
* Price
|
|
4324
4302
|
*/
|
|
@@ -4411,6 +4389,26 @@ export declare namespace Models {
|
|
|
4411
4389
|
* Can user change the plan themselves
|
|
4412
4390
|
*/
|
|
4413
4391
|
selfService: boolean;
|
|
4392
|
+
/**
|
|
4393
|
+
* Does plan enable premium support
|
|
4394
|
+
*/
|
|
4395
|
+
premiumSupport: boolean;
|
|
4396
|
+
/**
|
|
4397
|
+
* Does plan support budget cap
|
|
4398
|
+
*/
|
|
4399
|
+
budgeting: boolean;
|
|
4400
|
+
/**
|
|
4401
|
+
* Does plan support mock numbers
|
|
4402
|
+
*/
|
|
4403
|
+
supportsMockNumbers: boolean;
|
|
4404
|
+
/**
|
|
4405
|
+
* Does plan support backup policies.
|
|
4406
|
+
*/
|
|
4407
|
+
backupsEnabled: boolean;
|
|
4408
|
+
/**
|
|
4409
|
+
* How many policies does plan support
|
|
4410
|
+
*/
|
|
4411
|
+
backupPolicies: number;
|
|
4414
4412
|
};
|
|
4415
4413
|
/**
|
|
4416
4414
|
* Campaign
|
|
@@ -4692,7 +4690,7 @@ export declare namespace Models {
|
|
|
4692
4690
|
/**
|
|
4693
4691
|
* Project budget limit
|
|
4694
4692
|
*/
|
|
4695
|
-
budgetAlerts:
|
|
4693
|
+
budgetAlerts: number[];
|
|
4696
4694
|
/**
|
|
4697
4695
|
* Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`.
|
|
4698
4696
|
*/
|
|
@@ -5028,6 +5026,10 @@ export declare namespace Models {
|
|
|
5028
5026
|
* Aggregated stats for function executions.
|
|
5029
5027
|
*/
|
|
5030
5028
|
executions: Metric[];
|
|
5029
|
+
/**
|
|
5030
|
+
* Aggregated stats for phone authentication.
|
|
5031
|
+
*/
|
|
5032
|
+
authPhone: Metric;
|
|
5031
5033
|
/**
|
|
5032
5034
|
* Aggregated stats for total users.
|
|
5033
5035
|
*/
|
|
@@ -5068,6 +5070,10 @@ export declare namespace Models {
|
|
|
5068
5070
|
* Aggregated stats for total storage.
|
|
5069
5071
|
*/
|
|
5070
5072
|
storageTotal: number;
|
|
5073
|
+
/**
|
|
5074
|
+
* Breakdown of phone authentication stats by country code.
|
|
5075
|
+
*/
|
|
5076
|
+
authPhoneBreakdown: MetricBreakdown;
|
|
5071
5077
|
/**
|
|
5072
5078
|
* Aggregated stats for each projects.
|
|
5073
5079
|
*/
|
|
@@ -93,6 +93,15 @@ export declare class Account {
|
|
|
93
93
|
* @returns {Promise<{}>}
|
|
94
94
|
*/
|
|
95
95
|
deleteBillingAddress(billingAddressId: string): Promise<{}>;
|
|
96
|
+
/**
|
|
97
|
+
* Get coupon details
|
|
98
|
+
*
|
|
99
|
+
*
|
|
100
|
+
* @param {string} couponId
|
|
101
|
+
* @throws {AppwriteException}
|
|
102
|
+
* @returns {Promise<Models.Coupon>}
|
|
103
|
+
*/
|
|
104
|
+
getCoupon(couponId: string): Promise<Models.Coupon>;
|
|
96
105
|
/**
|
|
97
106
|
* Update email
|
|
98
107
|
*
|
|
@@ -571,7 +580,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
571
580
|
/**
|
|
572
581
|
* Create magic URL token
|
|
573
582
|
*
|
|
574
|
-
* Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
|
|
583
|
+
* Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
|
|
575
584
|
|
|
576
585
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
577
586
|
|
|
@@ -29,6 +29,15 @@ export declare class Console {
|
|
|
29
29
|
* @returns {Promise<Models.BillingPlanList>}
|
|
30
30
|
*/
|
|
31
31
|
plans(): Promise<Models.BillingPlanList>;
|
|
32
|
+
/**
|
|
33
|
+
* Create program membership
|
|
34
|
+
*
|
|
35
|
+
*
|
|
36
|
+
* @param {string} programId
|
|
37
|
+
* @throws {AppwriteException}
|
|
38
|
+
* @returns {Promise<{}>}
|
|
39
|
+
*/
|
|
40
|
+
createProgramMembership(programId: string): Promise<{}>;
|
|
32
41
|
/**
|
|
33
42
|
* Get Regions
|
|
34
43
|
*
|
|
@@ -38,7 +38,7 @@ export declare class Migrations {
|
|
|
38
38
|
*/
|
|
39
39
|
getAppwriteReport(resources: string[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport>;
|
|
40
40
|
/**
|
|
41
|
-
* Migrate Firebase data
|
|
41
|
+
* Migrate Firebase data
|
|
42
42
|
*
|
|
43
43
|
*
|
|
44
44
|
* @param {string[]} resources
|
|
@@ -47,32 +47,6 @@ export declare class Migrations {
|
|
|
47
47
|
* @returns {Promise<Models.Migration>}
|
|
48
48
|
*/
|
|
49
49
|
createFirebaseMigration(resources: string[], serviceAccount: string): Promise<Models.Migration>;
|
|
50
|
-
/**
|
|
51
|
-
* Revoke Appwrite's authorization to access Firebase projects
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @throws {AppwriteException}
|
|
55
|
-
* @returns {Promise<{}>}
|
|
56
|
-
*/
|
|
57
|
-
deleteFirebaseAuth(): Promise<{}>;
|
|
58
|
-
/**
|
|
59
|
-
* Migrate Firebase data (OAuth)
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* @param {string[]} resources
|
|
63
|
-
* @param {string} projectId
|
|
64
|
-
* @throws {AppwriteException}
|
|
65
|
-
* @returns {Promise<Models.Migration>}
|
|
66
|
-
*/
|
|
67
|
-
createFirebaseOAuthMigration(resources: string[], projectId: string): Promise<Models.Migration>;
|
|
68
|
-
/**
|
|
69
|
-
* List Firebase projects
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @throws {AppwriteException}
|
|
73
|
-
* @returns {Promise<Models.FirebaseProjectList>}
|
|
74
|
-
*/
|
|
75
|
-
listFirebaseProjects(): Promise<Models.FirebaseProjectList>;
|
|
76
50
|
/**
|
|
77
51
|
* Generate a report on Firebase data
|
|
78
52
|
*
|
|
@@ -83,16 +57,6 @@ export declare class Migrations {
|
|
|
83
57
|
* @returns {Promise<Models.MigrationReport>}
|
|
84
58
|
*/
|
|
85
59
|
getFirebaseReport(resources: string[], serviceAccount: string): Promise<Models.MigrationReport>;
|
|
86
|
-
/**
|
|
87
|
-
* Generate a report on Firebase data using OAuth
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @param {string[]} resources
|
|
91
|
-
* @param {string} projectId
|
|
92
|
-
* @throws {AppwriteException}
|
|
93
|
-
* @returns {Promise<Models.MigrationReport>}
|
|
94
|
-
*/
|
|
95
|
-
getFirebaseReportOAuth(resources: string[], projectId: string): Promise<Models.MigrationReport>;
|
|
96
60
|
/**
|
|
97
61
|
* Migrate NHost data
|
|
98
62
|
*
|
|
@@ -56,9 +56,9 @@ export declare class Organizations {
|
|
|
56
56
|
* @param {string} organizationId
|
|
57
57
|
* @param {string} aggregationId
|
|
58
58
|
* @throws {AppwriteException}
|
|
59
|
-
* @returns {Promise<Models.
|
|
59
|
+
* @returns {Promise<Models.Invoice>}
|
|
60
60
|
*/
|
|
61
|
-
getAggregation(organizationId: string, aggregationId: string): Promise<Models.
|
|
61
|
+
getAggregation(organizationId: string, aggregationId: string): Promise<Models.Invoice>;
|
|
62
62
|
/**
|
|
63
63
|
* Set team's billing address
|
|
64
64
|
*
|
|
@@ -160,7 +160,7 @@ export declare class Organizations {
|
|
|
160
160
|
*/
|
|
161
161
|
getInvoice(organizationId: string, invoiceId: string): Promise<Models.Invoice>;
|
|
162
162
|
/**
|
|
163
|
-
*
|
|
163
|
+
* Download invoice in PDF
|
|
164
164
|
*
|
|
165
165
|
*
|
|
166
166
|
* @param {string} organizationId
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Client, Migrations } 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 migrations = new Migrations(client);
|
|
8
|
-
|
|
9
|
-
const result = await migrations.createFirebaseOAuthMigration(
|
|
10
|
-
[], // resources
|
|
11
|
-
'<PROJECT_ID>' // projectId
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
console.log(result);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Client, Migrations } 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 migrations = new Migrations(client);
|
|
8
|
-
|
|
9
|
-
const result = await migrations.getFirebaseReportOAuth(
|
|
10
|
-
[], // resources
|
|
11
|
-
'<PROJECT_ID>' // projectId
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
console.log(result);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Client, Migrations } 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 migrations = new Migrations(client);
|
|
8
|
-
|
|
9
|
-
const result = await migrations.listFirebaseProjects();
|
|
10
|
-
|
|
11
|
-
console.log(result);
|