@appwrite.io/console 0.3.0 → 0.4.1
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/README.md +3 -3
- package/dist/cjs/sdk.js +1354 -1197
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1354 -1197
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +1354 -1197
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/{projects/get-usage.md → health/get-queue-builds.md} +3 -3
- package/docs/examples/{account/create-with-invite-code.md → health/get-queue-databases.md} +3 -3
- package/docs/examples/health/get-queue-deletes.md +18 -0
- package/docs/examples/health/get-queue-mails.md +18 -0
- package/docs/examples/health/get-queue-messaging.md +18 -0
- package/docs/examples/health/get-queue-migrations.md +18 -0
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/package.json +3 -2
- package/src/client.ts +1 -1
- package/src/models.ts +147 -279
- package/src/query.ts +1 -1
- package/src/role.ts +72 -6
- package/src/services/account.ts +154 -204
- package/src/services/assistant.ts +3 -3
- package/src/services/avatars.ts +32 -31
- package/src/services/console.ts +4 -4
- package/src/services/databases.ts +195 -195
- package/src/services/functions.ts +117 -126
- package/src/services/graphql.ts +8 -8
- package/src/services/health.ts +219 -50
- package/src/services/locale.ts +31 -31
- package/src/services/migrations.ts +48 -48
- package/src/services/project.ts +40 -22
- package/src/services/projects.ts +143 -170
- package/src/services/proxy.ts +15 -15
- package/src/services/storage.ts +74 -84
- package/src/services/teams.ts +62 -66
- package/src/services/users.ts +132 -135
- package/src/services/vcs.ts +27 -27
- package/types/models.d.ts +147 -279
- package/types/role.d.ts +62 -0
- package/types/services/account.d.ts +61 -70
- package/types/services/avatars.d.ts +11 -10
- package/types/services/console.d.ts +1 -1
- package/types/services/databases.d.ts +51 -51
- package/types/services/functions.d.ts +32 -27
- package/types/services/graphql.d.ts +2 -2
- package/types/services/health.d.ts +85 -14
- package/types/services/locale.d.ts +7 -7
- package/types/services/project.d.ts +4 -2
- package/types/services/projects.d.ts +26 -36
- package/types/services/storage.d.ts +13 -13
- package/types/services/teams.d.ts +20 -20
- package/types/services/users.d.ts +45 -44
|
@@ -23,14 +23,14 @@ export class Assistant extends Service {
|
|
|
23
23
|
throw new AppwriteException('Missing required parameter: "prompt"');
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const apiPath = '/console/assistant';
|
|
27
|
+
const payload: Payload = {};
|
|
28
28
|
|
|
29
29
|
if (typeof prompt !== 'undefined') {
|
|
30
30
|
payload['prompt'] = prompt;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const uri = new URL(this.client.config.endpoint +
|
|
33
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
34
34
|
return await this.client.call('post', uri, {
|
|
35
35
|
'content-type': 'application/json',
|
|
36
36
|
}, payload);
|
package/src/services/avatars.ts
CHANGED
|
@@ -11,12 +11,13 @@ export class Avatars extends Service {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Get
|
|
14
|
+
* Get browser icon
|
|
15
15
|
*
|
|
16
16
|
* You can use this endpoint to show different browser icons to your users.
|
|
17
17
|
* The code argument receives the browser code as it appears in your user [GET
|
|
18
|
-
* /account/sessions](/docs/client/account#
|
|
19
|
-
* width, height and quality arguments to change the output
|
|
18
|
+
* /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
|
|
19
|
+
* endpoint. Use width, height and quality arguments to change the output
|
|
20
|
+
* settings.
|
|
20
21
|
*
|
|
21
22
|
* When one dimension is specified and the other is 0, the image is scaled
|
|
22
23
|
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
@@ -35,8 +36,8 @@ export class Avatars extends Service {
|
|
|
35
36
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);
|
|
40
|
+
const payload: Payload = {};
|
|
40
41
|
|
|
41
42
|
if (typeof width !== 'undefined') {
|
|
42
43
|
payload['width'] = width;
|
|
@@ -50,7 +51,7 @@ export class Avatars extends Service {
|
|
|
50
51
|
payload['quality'] = quality;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
const uri = new URL(this.client.config.endpoint +
|
|
54
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
54
55
|
payload['project'] = this.client.config.project;
|
|
55
56
|
|
|
56
57
|
|
|
@@ -61,7 +62,7 @@ export class Avatars extends Service {
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
|
-
* Get
|
|
65
|
+
* Get credit card icon
|
|
65
66
|
*
|
|
66
67
|
* The credit card endpoint will return you the icon of the credit card
|
|
67
68
|
* provider you need. Use width, height and quality arguments to change the
|
|
@@ -85,8 +86,8 @@ export class Avatars extends Service {
|
|
|
85
86
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);
|
|
90
|
+
const payload: Payload = {};
|
|
90
91
|
|
|
91
92
|
if (typeof width !== 'undefined') {
|
|
92
93
|
payload['width'] = width;
|
|
@@ -100,7 +101,7 @@ export class Avatars extends Service {
|
|
|
100
101
|
payload['quality'] = quality;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
const uri = new URL(this.client.config.endpoint +
|
|
104
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
104
105
|
payload['project'] = this.client.config.project;
|
|
105
106
|
|
|
106
107
|
|
|
@@ -111,7 +112,7 @@ export class Avatars extends Service {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
/**
|
|
114
|
-
* Get
|
|
115
|
+
* Get favicon
|
|
115
116
|
*
|
|
116
117
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
117
118
|
* website URL.
|
|
@@ -126,14 +127,14 @@ export class Avatars extends Service {
|
|
|
126
127
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
127
128
|
}
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
const apiPath = '/avatars/favicon';
|
|
131
|
+
const payload: Payload = {};
|
|
131
132
|
|
|
132
133
|
if (typeof url !== 'undefined') {
|
|
133
134
|
payload['url'] = url;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
const uri = new URL(this.client.config.endpoint +
|
|
137
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
137
138
|
payload['project'] = this.client.config.project;
|
|
138
139
|
|
|
139
140
|
|
|
@@ -144,12 +145,12 @@ export class Avatars extends Service {
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
/**
|
|
147
|
-
* Get
|
|
148
|
+
* Get country flag
|
|
148
149
|
*
|
|
149
150
|
* You can use this endpoint to show different country flags icons to your
|
|
150
151
|
* users. The code argument receives the 2 letter country code. Use width,
|
|
151
152
|
* height and quality arguments to change the output settings. Country codes
|
|
152
|
-
* follow the [ISO 3166-1](
|
|
153
|
+
* follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
153
154
|
*
|
|
154
155
|
* When one dimension is specified and the other is 0, the image is scaled
|
|
155
156
|
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
@@ -169,8 +170,8 @@ export class Avatars extends Service {
|
|
|
169
170
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
const apiPath = '/avatars/flags/{code}'.replace('{code}', code);
|
|
174
|
+
const payload: Payload = {};
|
|
174
175
|
|
|
175
176
|
if (typeof width !== 'undefined') {
|
|
176
177
|
payload['width'] = width;
|
|
@@ -184,7 +185,7 @@ export class Avatars extends Service {
|
|
|
184
185
|
payload['quality'] = quality;
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
const uri = new URL(this.client.config.endpoint +
|
|
188
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
188
189
|
payload['project'] = this.client.config.project;
|
|
189
190
|
|
|
190
191
|
|
|
@@ -195,7 +196,7 @@ export class Avatars extends Service {
|
|
|
195
196
|
}
|
|
196
197
|
|
|
197
198
|
/**
|
|
198
|
-
* Get
|
|
199
|
+
* Get image from URL
|
|
199
200
|
*
|
|
200
201
|
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
|
201
202
|
* you want. This endpoint is very useful if you need to crop and display
|
|
@@ -219,8 +220,8 @@ export class Avatars extends Service {
|
|
|
219
220
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
220
221
|
}
|
|
221
222
|
|
|
222
|
-
|
|
223
|
-
|
|
223
|
+
const apiPath = '/avatars/image';
|
|
224
|
+
const payload: Payload = {};
|
|
224
225
|
|
|
225
226
|
if (typeof url !== 'undefined') {
|
|
226
227
|
payload['url'] = url;
|
|
@@ -234,7 +235,7 @@ export class Avatars extends Service {
|
|
|
234
235
|
payload['height'] = height;
|
|
235
236
|
}
|
|
236
237
|
|
|
237
|
-
const uri = new URL(this.client.config.endpoint +
|
|
238
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
238
239
|
payload['project'] = this.client.config.project;
|
|
239
240
|
|
|
240
241
|
|
|
@@ -245,7 +246,7 @@ export class Avatars extends Service {
|
|
|
245
246
|
}
|
|
246
247
|
|
|
247
248
|
/**
|
|
248
|
-
* Get
|
|
249
|
+
* Get user initials
|
|
249
250
|
*
|
|
250
251
|
* Use this endpoint to show your user initials avatar icon on your website or
|
|
251
252
|
* app. By default, this route will try to print your logged-in user name or
|
|
@@ -272,8 +273,8 @@ export class Avatars extends Service {
|
|
|
272
273
|
* @returns {URL}
|
|
273
274
|
*/
|
|
274
275
|
getInitials(name?: string, width?: number, height?: number, background?: string): URL {
|
|
275
|
-
|
|
276
|
-
|
|
276
|
+
const apiPath = '/avatars/initials';
|
|
277
|
+
const payload: Payload = {};
|
|
277
278
|
|
|
278
279
|
if (typeof name !== 'undefined') {
|
|
279
280
|
payload['name'] = name;
|
|
@@ -291,7 +292,7 @@ export class Avatars extends Service {
|
|
|
291
292
|
payload['background'] = background;
|
|
292
293
|
}
|
|
293
294
|
|
|
294
|
-
const uri = new URL(this.client.config.endpoint +
|
|
295
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
295
296
|
payload['project'] = this.client.config.project;
|
|
296
297
|
|
|
297
298
|
|
|
@@ -302,7 +303,7 @@ export class Avatars extends Service {
|
|
|
302
303
|
}
|
|
303
304
|
|
|
304
305
|
/**
|
|
305
|
-
* Get QR
|
|
306
|
+
* Get QR code
|
|
306
307
|
*
|
|
307
308
|
* Converts a given plain text to a QR code image. You can use the query
|
|
308
309
|
* parameters to change the size and style of the resulting image.
|
|
@@ -320,8 +321,8 @@ export class Avatars extends Service {
|
|
|
320
321
|
throw new AppwriteException('Missing required parameter: "text"');
|
|
321
322
|
}
|
|
322
323
|
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
const apiPath = '/avatars/qr';
|
|
325
|
+
const payload: Payload = {};
|
|
325
326
|
|
|
326
327
|
if (typeof text !== 'undefined') {
|
|
327
328
|
payload['text'] = text;
|
|
@@ -339,7 +340,7 @@ export class Avatars extends Service {
|
|
|
339
340
|
payload['download'] = download;
|
|
340
341
|
}
|
|
341
342
|
|
|
342
|
-
const uri = new URL(this.client.config.endpoint +
|
|
343
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
343
344
|
payload['project'] = this.client.config.project;
|
|
344
345
|
|
|
345
346
|
|
package/src/services/console.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class Console extends Service {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Get
|
|
14
|
+
* Get variables
|
|
15
15
|
*
|
|
16
16
|
* Get all Environment Variables that are relevant for the console.
|
|
17
17
|
*
|
|
@@ -19,10 +19,10 @@ export class Console extends Service {
|
|
|
19
19
|
* @returns {Promise}
|
|
20
20
|
*/
|
|
21
21
|
async variables(): Promise<Models.ConsoleVariables> {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const apiPath = '/console/variables';
|
|
23
|
+
const payload: Payload = {};
|
|
24
24
|
|
|
25
|
-
const uri = new URL(this.client.config.endpoint +
|
|
25
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
26
26
|
return await this.client.call('get', uri, {
|
|
27
27
|
'content-type': 'application/json',
|
|
28
28
|
}, payload);
|