@appwrite.io/console 1.5.1 → 1.6.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 +4 -4
- package/dist/cjs/sdk.js +7714 -9758
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +7714 -9758
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +7714 -9758
- package/docs/examples/databases/update-float-attribute.md +2 -2
- package/docs/examples/databases/update-integer-attribute.md +2 -2
- package/docs/examples/health/{get-queue-usage-count.md → get-queue-stats-resources.md} +1 -1
- package/docs/examples/health/{get-queue-usage-dump.md → get-queue-stats-usage-dump.md} +1 -1
- package/docs/examples/organizations/create.md +5 -1
- package/docs/examples/organizations/update-plan.md +5 -1
- package/docs/examples/organizations/validate-invoice.md +14 -0
- package/package.json +1 -1
- package/src/client.ts +21 -4
- package/src/enums/credit-card.ts +1 -0
- package/src/enums/name.ts +3 -2
- package/src/enums/o-auth-provider.ts +1 -0
- package/src/enums/runtime.ts +3 -0
- package/src/models.ts +202 -5
- package/src/services/account.ts +126 -430
- package/src/services/assistant.ts +2 -7
- package/src/services/avatars.ts +7 -21
- package/src/services/backups.ts +24 -84
- package/src/services/console.ts +14 -49
- package/src/services/databases.ts +99 -350
- package/src/services/functions.ts +55 -192
- package/src/services/graphql.ts +4 -14
- package/src/services/health.ts +55 -207
- package/src/services/locale.ts +16 -56
- package/src/services/messaging.ts +92 -322
- package/src/services/migrations.ts +24 -84
- package/src/services/organizations.ts +118 -196
- package/src/services/project.ts +12 -42
- package/src/services/projects.ts +92 -322
- package/src/services/proxy.ts +10 -35
- package/src/services/storage.ts +27 -93
- package/src/services/teams.ts +28 -98
- package/src/services/users.ts +86 -301
- package/src/services/vcs.ts +20 -70
- package/types/enums/credit-card.d.ts +2 -1
- package/types/enums/name.d.ts +3 -2
- package/types/enums/o-auth-provider.d.ts +1 -0
- package/types/enums/runtime.d.ts +3 -0
- package/types/models.d.ts +202 -5
- package/types/services/account.d.ts +4 -128
- package/types/services/assistant.d.ts +0 -2
- package/types/services/avatars.d.ts +0 -14
- package/types/services/backups.d.ts +0 -24
- package/types/services/console.d.ts +0 -14
- package/types/services/databases.d.ts +5 -100
- package/types/services/functions.d.ts +0 -56
- package/types/services/graphql.d.ts +0 -4
- package/types/services/health.d.ts +5 -64
- package/types/services/locale.d.ts +0 -16
- package/types/services/messaging.d.ts +0 -92
- package/types/services/migrations.d.ts +0 -24
- package/types/services/organizations.d.ts +21 -60
- package/types/services/project.d.ts +0 -12
- package/types/services/projects.d.ts +0 -92
- package/types/services/proxy.d.ts +0 -10
- package/types/services/storage.d.ts +0 -30
- package/types/services/teams.d.ts +0 -28
- package/types/services/users.d.ts +0 -86
- package/types/services/vcs.d.ts +0 -20
- package/docs/examples/health/get-queue.md +0 -11
package/src/services/project.ts
CHANGED
|
@@ -11,8 +11,6 @@ export class Project {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Get project usage stats
|
|
15
|
-
*
|
|
16
14
|
* Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.
|
|
17
15
|
*
|
|
18
16
|
* @param {string} startDate
|
|
@@ -21,7 +19,7 @@ export class Project {
|
|
|
21
19
|
* @throws {AppwriteException}
|
|
22
20
|
* @returns {Promise<Models.UsageProject>}
|
|
23
21
|
*/
|
|
24
|
-
|
|
22
|
+
getUsage(startDate: string, endDate: string, period?: ProjectUsageRange): Promise<Models.UsageProject> {
|
|
25
23
|
if (typeof startDate === 'undefined') {
|
|
26
24
|
throw new AppwriteException('Missing required parameter: "startDate"');
|
|
27
25
|
}
|
|
@@ -45,10 +43,7 @@ export class Project {
|
|
|
45
43
|
'content-type': 'application/json',
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return await this.client.call(
|
|
46
|
+
return this.client.call(
|
|
52
47
|
'get',
|
|
53
48
|
uri,
|
|
54
49
|
apiHeaders,
|
|
@@ -56,14 +51,12 @@ export class Project {
|
|
|
56
51
|
);
|
|
57
52
|
}
|
|
58
53
|
/**
|
|
59
|
-
* List variables
|
|
60
|
-
*
|
|
61
54
|
* Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.
|
|
62
55
|
*
|
|
63
56
|
* @throws {AppwriteException}
|
|
64
57
|
* @returns {Promise<Models.VariableList>}
|
|
65
58
|
*/
|
|
66
|
-
|
|
59
|
+
listVariables(): Promise<Models.VariableList> {
|
|
67
60
|
const apiPath = '/project/variables';
|
|
68
61
|
const payload: Payload = {};
|
|
69
62
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -72,10 +65,7 @@ export class Project {
|
|
|
72
65
|
'content-type': 'application/json',
|
|
73
66
|
}
|
|
74
67
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return await this.client.call(
|
|
68
|
+
return this.client.call(
|
|
79
69
|
'get',
|
|
80
70
|
uri,
|
|
81
71
|
apiHeaders,
|
|
@@ -83,8 +73,6 @@ export class Project {
|
|
|
83
73
|
);
|
|
84
74
|
}
|
|
85
75
|
/**
|
|
86
|
-
* Create variable
|
|
87
|
-
*
|
|
88
76
|
* Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.
|
|
89
77
|
*
|
|
90
78
|
* @param {string} key
|
|
@@ -92,7 +80,7 @@ export class Project {
|
|
|
92
80
|
* @throws {AppwriteException}
|
|
93
81
|
* @returns {Promise<Models.Variable>}
|
|
94
82
|
*/
|
|
95
|
-
|
|
83
|
+
createVariable(key: string, value: string): Promise<Models.Variable> {
|
|
96
84
|
if (typeof key === 'undefined') {
|
|
97
85
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
98
86
|
}
|
|
@@ -113,10 +101,7 @@ export class Project {
|
|
|
113
101
|
'content-type': 'application/json',
|
|
114
102
|
}
|
|
115
103
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return await this.client.call(
|
|
104
|
+
return this.client.call(
|
|
120
105
|
'post',
|
|
121
106
|
uri,
|
|
122
107
|
apiHeaders,
|
|
@@ -124,15 +109,13 @@ export class Project {
|
|
|
124
109
|
);
|
|
125
110
|
}
|
|
126
111
|
/**
|
|
127
|
-
* Get variable
|
|
128
|
-
*
|
|
129
112
|
* Get a project variable by its unique ID.
|
|
130
113
|
*
|
|
131
114
|
* @param {string} variableId
|
|
132
115
|
* @throws {AppwriteException}
|
|
133
116
|
* @returns {Promise<Models.Variable>}
|
|
134
117
|
*/
|
|
135
|
-
|
|
118
|
+
getVariable(variableId: string): Promise<Models.Variable> {
|
|
136
119
|
if (typeof variableId === 'undefined') {
|
|
137
120
|
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
138
121
|
}
|
|
@@ -144,10 +127,7 @@ export class Project {
|
|
|
144
127
|
'content-type': 'application/json',
|
|
145
128
|
}
|
|
146
129
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return await this.client.call(
|
|
130
|
+
return this.client.call(
|
|
151
131
|
'get',
|
|
152
132
|
uri,
|
|
153
133
|
apiHeaders,
|
|
@@ -155,8 +135,6 @@ export class Project {
|
|
|
155
135
|
);
|
|
156
136
|
}
|
|
157
137
|
/**
|
|
158
|
-
* Update variable
|
|
159
|
-
*
|
|
160
138
|
* Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.
|
|
161
139
|
*
|
|
162
140
|
* @param {string} variableId
|
|
@@ -165,7 +143,7 @@ export class Project {
|
|
|
165
143
|
* @throws {AppwriteException}
|
|
166
144
|
* @returns {Promise<Models.Variable>}
|
|
167
145
|
*/
|
|
168
|
-
|
|
146
|
+
updateVariable(variableId: string, key: string, value?: string): Promise<Models.Variable> {
|
|
169
147
|
if (typeof variableId === 'undefined') {
|
|
170
148
|
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
171
149
|
}
|
|
@@ -186,10 +164,7 @@ export class Project {
|
|
|
186
164
|
'content-type': 'application/json',
|
|
187
165
|
}
|
|
188
166
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return await this.client.call(
|
|
167
|
+
return this.client.call(
|
|
193
168
|
'put',
|
|
194
169
|
uri,
|
|
195
170
|
apiHeaders,
|
|
@@ -197,15 +172,13 @@ export class Project {
|
|
|
197
172
|
);
|
|
198
173
|
}
|
|
199
174
|
/**
|
|
200
|
-
* Delete variable
|
|
201
|
-
*
|
|
202
175
|
* Delete a project variable by its unique ID.
|
|
203
176
|
*
|
|
204
177
|
* @param {string} variableId
|
|
205
178
|
* @throws {AppwriteException}
|
|
206
179
|
* @returns {Promise<{}>}
|
|
207
180
|
*/
|
|
208
|
-
|
|
181
|
+
deleteVariable(variableId: string): Promise<{}> {
|
|
209
182
|
if (typeof variableId === 'undefined') {
|
|
210
183
|
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
211
184
|
}
|
|
@@ -217,10 +190,7 @@ export class Project {
|
|
|
217
190
|
'content-type': 'application/json',
|
|
218
191
|
}
|
|
219
192
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return await this.client.call(
|
|
193
|
+
return this.client.call(
|
|
224
194
|
'delete',
|
|
225
195
|
uri,
|
|
226
196
|
apiHeaders,
|