@appwrite.io/console 1.5.2 → 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 +3 -3
- package/dist/cjs/sdk.js +7673 -9723
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +7673 -9723
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +7673 -9723
- package/docs/examples/organizations/validate-invoice.md +14 -0
- package/package.json +1 -1
- package/src/client.ts +21 -4
- package/src/enums/o-auth-provider.ts +1 -0
- package/src/models.ts +118 -6
- 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 +96 -336
- package/src/services/functions.ts +55 -192
- package/src/services/graphql.ts +4 -14
- package/src/services/health.ts +50 -175
- 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 +86 -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/o-auth-provider.d.ts +1 -0
- package/types/models.d.ts +118 -6
- 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 +0 -96
- package/types/services/functions.d.ts +0 -56
- package/types/services/graphql.d.ts +0 -4
- package/types/services/health.d.ts +0 -50
- 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 +11 -58
- 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/src/services/locale.ts
CHANGED
|
@@ -10,8 +10,6 @@ export class Locale {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Get user locale
|
|
14
|
-
*
|
|
15
13
|
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
|
16
14
|
|
|
17
15
|
([IP Geolocation by DB-IP](https://db-ip.com))
|
|
@@ -19,7 +17,7 @@ export class Locale {
|
|
|
19
17
|
* @throws {AppwriteException}
|
|
20
18
|
* @returns {Promise<Models.Locale>}
|
|
21
19
|
*/
|
|
22
|
-
|
|
20
|
+
get(): Promise<Models.Locale> {
|
|
23
21
|
const apiPath = '/locale';
|
|
24
22
|
const payload: Payload = {};
|
|
25
23
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -28,10 +26,7 @@ export class Locale {
|
|
|
28
26
|
'content-type': 'application/json',
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return await this.client.call(
|
|
29
|
+
return this.client.call(
|
|
35
30
|
'get',
|
|
36
31
|
uri,
|
|
37
32
|
apiHeaders,
|
|
@@ -39,14 +34,12 @@ export class Locale {
|
|
|
39
34
|
);
|
|
40
35
|
}
|
|
41
36
|
/**
|
|
42
|
-
* List locale codes
|
|
43
|
-
*
|
|
44
37
|
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
45
38
|
*
|
|
46
39
|
* @throws {AppwriteException}
|
|
47
40
|
* @returns {Promise<Models.LocaleCodeList>}
|
|
48
41
|
*/
|
|
49
|
-
|
|
42
|
+
listCodes(): Promise<Models.LocaleCodeList> {
|
|
50
43
|
const apiPath = '/locale/codes';
|
|
51
44
|
const payload: Payload = {};
|
|
52
45
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -55,10 +48,7 @@ export class Locale {
|
|
|
55
48
|
'content-type': 'application/json',
|
|
56
49
|
}
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return await this.client.call(
|
|
51
|
+
return this.client.call(
|
|
62
52
|
'get',
|
|
63
53
|
uri,
|
|
64
54
|
apiHeaders,
|
|
@@ -66,14 +56,12 @@ export class Locale {
|
|
|
66
56
|
);
|
|
67
57
|
}
|
|
68
58
|
/**
|
|
69
|
-
* List continents
|
|
70
|
-
*
|
|
71
59
|
* List of all continents. You can use the locale header to get the data in a supported language.
|
|
72
60
|
*
|
|
73
61
|
* @throws {AppwriteException}
|
|
74
62
|
* @returns {Promise<Models.ContinentList>}
|
|
75
63
|
*/
|
|
76
|
-
|
|
64
|
+
listContinents(): Promise<Models.ContinentList> {
|
|
77
65
|
const apiPath = '/locale/continents';
|
|
78
66
|
const payload: Payload = {};
|
|
79
67
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -82,10 +70,7 @@ export class Locale {
|
|
|
82
70
|
'content-type': 'application/json',
|
|
83
71
|
}
|
|
84
72
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return await this.client.call(
|
|
73
|
+
return this.client.call(
|
|
89
74
|
'get',
|
|
90
75
|
uri,
|
|
91
76
|
apiHeaders,
|
|
@@ -93,14 +78,12 @@ export class Locale {
|
|
|
93
78
|
);
|
|
94
79
|
}
|
|
95
80
|
/**
|
|
96
|
-
* List countries
|
|
97
|
-
*
|
|
98
81
|
* List of all countries. You can use the locale header to get the data in a supported language.
|
|
99
82
|
*
|
|
100
83
|
* @throws {AppwriteException}
|
|
101
84
|
* @returns {Promise<Models.CountryList>}
|
|
102
85
|
*/
|
|
103
|
-
|
|
86
|
+
listCountries(): Promise<Models.CountryList> {
|
|
104
87
|
const apiPath = '/locale/countries';
|
|
105
88
|
const payload: Payload = {};
|
|
106
89
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -109,10 +92,7 @@ export class Locale {
|
|
|
109
92
|
'content-type': 'application/json',
|
|
110
93
|
}
|
|
111
94
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return await this.client.call(
|
|
95
|
+
return this.client.call(
|
|
116
96
|
'get',
|
|
117
97
|
uri,
|
|
118
98
|
apiHeaders,
|
|
@@ -120,14 +100,12 @@ export class Locale {
|
|
|
120
100
|
);
|
|
121
101
|
}
|
|
122
102
|
/**
|
|
123
|
-
* List EU countries
|
|
124
|
-
*
|
|
125
103
|
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
|
126
104
|
*
|
|
127
105
|
* @throws {AppwriteException}
|
|
128
106
|
* @returns {Promise<Models.CountryList>}
|
|
129
107
|
*/
|
|
130
|
-
|
|
108
|
+
listCountriesEU(): Promise<Models.CountryList> {
|
|
131
109
|
const apiPath = '/locale/countries/eu';
|
|
132
110
|
const payload: Payload = {};
|
|
133
111
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -136,10 +114,7 @@ export class Locale {
|
|
|
136
114
|
'content-type': 'application/json',
|
|
137
115
|
}
|
|
138
116
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return await this.client.call(
|
|
117
|
+
return this.client.call(
|
|
143
118
|
'get',
|
|
144
119
|
uri,
|
|
145
120
|
apiHeaders,
|
|
@@ -147,14 +122,12 @@ export class Locale {
|
|
|
147
122
|
);
|
|
148
123
|
}
|
|
149
124
|
/**
|
|
150
|
-
* List countries phone codes
|
|
151
|
-
*
|
|
152
125
|
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
|
153
126
|
*
|
|
154
127
|
* @throws {AppwriteException}
|
|
155
128
|
* @returns {Promise<Models.PhoneList>}
|
|
156
129
|
*/
|
|
157
|
-
|
|
130
|
+
listCountriesPhones(): Promise<Models.PhoneList> {
|
|
158
131
|
const apiPath = '/locale/countries/phones';
|
|
159
132
|
const payload: Payload = {};
|
|
160
133
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -163,10 +136,7 @@ export class Locale {
|
|
|
163
136
|
'content-type': 'application/json',
|
|
164
137
|
}
|
|
165
138
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return await this.client.call(
|
|
139
|
+
return this.client.call(
|
|
170
140
|
'get',
|
|
171
141
|
uri,
|
|
172
142
|
apiHeaders,
|
|
@@ -174,14 +144,12 @@ export class Locale {
|
|
|
174
144
|
);
|
|
175
145
|
}
|
|
176
146
|
/**
|
|
177
|
-
* List currencies
|
|
178
|
-
*
|
|
179
147
|
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
|
180
148
|
*
|
|
181
149
|
* @throws {AppwriteException}
|
|
182
150
|
* @returns {Promise<Models.CurrencyList>}
|
|
183
151
|
*/
|
|
184
|
-
|
|
152
|
+
listCurrencies(): Promise<Models.CurrencyList> {
|
|
185
153
|
const apiPath = '/locale/currencies';
|
|
186
154
|
const payload: Payload = {};
|
|
187
155
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -190,10 +158,7 @@ export class Locale {
|
|
|
190
158
|
'content-type': 'application/json',
|
|
191
159
|
}
|
|
192
160
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
return await this.client.call(
|
|
161
|
+
return this.client.call(
|
|
197
162
|
'get',
|
|
198
163
|
uri,
|
|
199
164
|
apiHeaders,
|
|
@@ -201,14 +166,12 @@ export class Locale {
|
|
|
201
166
|
);
|
|
202
167
|
}
|
|
203
168
|
/**
|
|
204
|
-
* List languages
|
|
205
|
-
*
|
|
206
169
|
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
|
207
170
|
*
|
|
208
171
|
* @throws {AppwriteException}
|
|
209
172
|
* @returns {Promise<Models.LanguageList>}
|
|
210
173
|
*/
|
|
211
|
-
|
|
174
|
+
listLanguages(): Promise<Models.LanguageList> {
|
|
212
175
|
const apiPath = '/locale/languages';
|
|
213
176
|
const payload: Payload = {};
|
|
214
177
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -217,10 +180,7 @@ export class Locale {
|
|
|
217
180
|
'content-type': 'application/json',
|
|
218
181
|
}
|
|
219
182
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return await this.client.call(
|
|
183
|
+
return this.client.call(
|
|
224
184
|
'get',
|
|
225
185
|
uri,
|
|
226
186
|
apiHeaders,
|