@appwrite.io/console 0.4.2 → 0.5.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/.github/workflows/publish.yml +2 -2
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/cjs/sdk.js +19 -1
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +19 -1
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +19 -1
- package/docs/examples/account/delete.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +65 -0
- package/src/services/account.ts +18 -0
- package/src/services/functions.ts +1 -1
- package/types/models.d.ts +65 -0
- package/types/services/account.d.ts +9 -0
- package/types/services/functions.d.ts +1 -1
package/dist/iife/sdk.js
CHANGED
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
'x-sdk-name': 'Console',
|
|
103
103
|
'x-sdk-platform': 'console',
|
|
104
104
|
'x-sdk-language': 'web',
|
|
105
|
-
'x-sdk-version': '0.
|
|
105
|
+
'x-sdk-version': '0.5.0',
|
|
106
106
|
'X-Appwrite-Response-Format': '1.4.0',
|
|
107
107
|
};
|
|
108
108
|
this.realtime = {
|
|
@@ -506,6 +506,24 @@
|
|
|
506
506
|
}, payload);
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
|
+
/**
|
|
510
|
+
* Delete account
|
|
511
|
+
*
|
|
512
|
+
* Delete the currently logged in user.
|
|
513
|
+
*
|
|
514
|
+
* @throws {AppwriteException}
|
|
515
|
+
* @returns {Promise}
|
|
516
|
+
*/
|
|
517
|
+
delete() {
|
|
518
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
519
|
+
const apiPath = '/account';
|
|
520
|
+
const payload = {};
|
|
521
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
522
|
+
return yield this.client.call('delete', uri, {
|
|
523
|
+
'content-type': 'application/json',
|
|
524
|
+
}, payload);
|
|
525
|
+
});
|
|
526
|
+
}
|
|
509
527
|
/**
|
|
510
528
|
* Update email
|
|
511
529
|
*
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client, Account } from "@appwrite.io/console";
|
|
2
|
+
|
|
3
|
+
const client = new Client();
|
|
4
|
+
|
|
5
|
+
const account = new Account(client);
|
|
6
|
+
|
|
7
|
+
client
|
|
8
|
+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
9
|
+
.setProject('5df5acd0d48c2') // Your project ID
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
const promise = account.delete();
|
|
13
|
+
|
|
14
|
+
promise.then(function (response) {
|
|
15
|
+
console.log(response); // Success
|
|
16
|
+
}, function (error) {
|
|
17
|
+
console.log(error); // Failure
|
|
18
|
+
});
|
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": "0.
|
|
5
|
+
"version": "0.5.0",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
package/src/models.ts
CHANGED
|
@@ -2821,6 +2821,71 @@ export namespace Models {
|
|
|
2821
2821
|
*/
|
|
2822
2822
|
executionsTime: Metric[];
|
|
2823
2823
|
}
|
|
2824
|
+
/**
|
|
2825
|
+
* UsageFunction
|
|
2826
|
+
*/
|
|
2827
|
+
export type UsageFunction = {
|
|
2828
|
+
/**
|
|
2829
|
+
* The time range of the usage stats.
|
|
2830
|
+
*/
|
|
2831
|
+
range: string;
|
|
2832
|
+
/**
|
|
2833
|
+
* Total aggregated number of function deployments.
|
|
2834
|
+
*/
|
|
2835
|
+
deploymentsTotal: number;
|
|
2836
|
+
/**
|
|
2837
|
+
* Total aggregated sum of function deployments storage.
|
|
2838
|
+
*/
|
|
2839
|
+
deploymentsStorageTotal: number;
|
|
2840
|
+
/**
|
|
2841
|
+
* Total aggregated number of function builds.
|
|
2842
|
+
*/
|
|
2843
|
+
buildsTotal: number;
|
|
2844
|
+
/**
|
|
2845
|
+
* total aggregated sum of function builds storage.
|
|
2846
|
+
*/
|
|
2847
|
+
buildsStorageTotal: number;
|
|
2848
|
+
/**
|
|
2849
|
+
* Total aggregated sum of function builds compute time.
|
|
2850
|
+
*/
|
|
2851
|
+
buildsTimeTotal: number;
|
|
2852
|
+
/**
|
|
2853
|
+
* Total aggregated number of function executions.
|
|
2854
|
+
*/
|
|
2855
|
+
executionsTotal: number;
|
|
2856
|
+
/**
|
|
2857
|
+
* Total aggregated sum of function executions compute time.
|
|
2858
|
+
*/
|
|
2859
|
+
executionsTimeTotal: number;
|
|
2860
|
+
/**
|
|
2861
|
+
* Aggregated number of function deployments per period.
|
|
2862
|
+
*/
|
|
2863
|
+
deployments: Metric[];
|
|
2864
|
+
/**
|
|
2865
|
+
* Aggregated number of function deployments storage per period.
|
|
2866
|
+
*/
|
|
2867
|
+
deploymentsStorage: Metric[];
|
|
2868
|
+
/**
|
|
2869
|
+
* Aggregated number of function builds per period.
|
|
2870
|
+
*/
|
|
2871
|
+
builds: Metric[];
|
|
2872
|
+
/**
|
|
2873
|
+
* Aggregated sum of function builds storage per period.
|
|
2874
|
+
*/
|
|
2875
|
+
buildsStorage: Metric[];
|
|
2876
|
+
/**
|
|
2877
|
+
* Aggregated sum of function builds compute time per period.
|
|
2878
|
+
*/
|
|
2879
|
+
buildsTime: Metric[];
|
|
2880
|
+
/**
|
|
2881
|
+
* Aggregated number of function executions per period.
|
|
2882
|
+
*/
|
|
2883
|
+
executions: Metric[];
|
|
2884
|
+
/**
|
|
2885
|
+
* Aggregated number of function executions compute time per period.
|
|
2886
|
+
*/
|
|
2887
|
+
executionsTime: Metric[];
|
|
2888
|
+
}
|
|
2824
2889
|
/**
|
|
2825
2890
|
* UsageProject
|
|
2826
2891
|
*/
|
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
|
*
|
|
@@ -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
|
}
|
package/types/models.d.ts
CHANGED
|
@@ -2821,6 +2821,71 @@ export declare namespace Models {
|
|
|
2821
2821
|
*/
|
|
2822
2822
|
executionsTime: Metric[];
|
|
2823
2823
|
};
|
|
2824
|
+
/**
|
|
2825
|
+
* UsageFunction
|
|
2826
|
+
*/
|
|
2827
|
+
type UsageFunction = {
|
|
2828
|
+
/**
|
|
2829
|
+
* The time range of the usage stats.
|
|
2830
|
+
*/
|
|
2831
|
+
range: string;
|
|
2832
|
+
/**
|
|
2833
|
+
* Total aggregated number of function deployments.
|
|
2834
|
+
*/
|
|
2835
|
+
deploymentsTotal: number;
|
|
2836
|
+
/**
|
|
2837
|
+
* Total aggregated sum of function deployments storage.
|
|
2838
|
+
*/
|
|
2839
|
+
deploymentsStorageTotal: number;
|
|
2840
|
+
/**
|
|
2841
|
+
* Total aggregated number of function builds.
|
|
2842
|
+
*/
|
|
2843
|
+
buildsTotal: number;
|
|
2844
|
+
/**
|
|
2845
|
+
* total aggregated sum of function builds storage.
|
|
2846
|
+
*/
|
|
2847
|
+
buildsStorageTotal: number;
|
|
2848
|
+
/**
|
|
2849
|
+
* Total aggregated sum of function builds compute time.
|
|
2850
|
+
*/
|
|
2851
|
+
buildsTimeTotal: number;
|
|
2852
|
+
/**
|
|
2853
|
+
* Total aggregated number of function executions.
|
|
2854
|
+
*/
|
|
2855
|
+
executionsTotal: number;
|
|
2856
|
+
/**
|
|
2857
|
+
* Total aggregated sum of function executions compute time.
|
|
2858
|
+
*/
|
|
2859
|
+
executionsTimeTotal: number;
|
|
2860
|
+
/**
|
|
2861
|
+
* Aggregated number of function deployments per period.
|
|
2862
|
+
*/
|
|
2863
|
+
deployments: Metric[];
|
|
2864
|
+
/**
|
|
2865
|
+
* Aggregated number of function deployments storage per period.
|
|
2866
|
+
*/
|
|
2867
|
+
deploymentsStorage: Metric[];
|
|
2868
|
+
/**
|
|
2869
|
+
* Aggregated number of function builds per period.
|
|
2870
|
+
*/
|
|
2871
|
+
builds: Metric[];
|
|
2872
|
+
/**
|
|
2873
|
+
* Aggregated sum of function builds storage per period.
|
|
2874
|
+
*/
|
|
2875
|
+
buildsStorage: Metric[];
|
|
2876
|
+
/**
|
|
2877
|
+
* Aggregated sum of function builds compute time per period.
|
|
2878
|
+
*/
|
|
2879
|
+
buildsTime: Metric[];
|
|
2880
|
+
/**
|
|
2881
|
+
* Aggregated number of function executions per period.
|
|
2882
|
+
*/
|
|
2883
|
+
executions: Metric[];
|
|
2884
|
+
/**
|
|
2885
|
+
* Aggregated number of function executions compute time per period.
|
|
2886
|
+
*/
|
|
2887
|
+
executionsTime: Metric[];
|
|
2888
|
+
};
|
|
2824
2889
|
/**
|
|
2825
2890
|
* UsageProject
|
|
2826
2891
|
*/
|
|
@@ -31,6 +31,15 @@ export declare class Account extends Service {
|
|
|
31
31
|
* @returns {Promise}
|
|
32
32
|
*/
|
|
33
33
|
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
34
|
+
/**
|
|
35
|
+
* Delete account
|
|
36
|
+
*
|
|
37
|
+
* Delete the currently logged in user.
|
|
38
|
+
*
|
|
39
|
+
* @throws {AppwriteException}
|
|
40
|
+
* @returns {Promise}
|
|
41
|
+
*/
|
|
42
|
+
delete(): Promise<{}>;
|
|
34
43
|
/**
|
|
35
44
|
* Update email
|
|
36
45
|
*
|
|
@@ -258,7 +258,7 @@ export declare class Functions extends Service {
|
|
|
258
258
|
* @throws {AppwriteException}
|
|
259
259
|
* @returns {Promise}
|
|
260
260
|
*/
|
|
261
|
-
getFunctionUsage(functionId: string, range?: string): Promise<Models.
|
|
261
|
+
getFunctionUsage(functionId: string, range?: string): Promise<Models.UsageFunction>;
|
|
262
262
|
/**
|
|
263
263
|
* List variables
|
|
264
264
|
*
|