@appconda/nextjs 1.0.18 → 1.0.19

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.
Files changed (118) hide show
  1. package/dist/Cache/Adapter.js +1 -0
  2. package/dist/Cache/Adapters/Filesystem.js +102 -0
  3. package/dist/Cache/Adapters/Memory.js +46 -0
  4. package/dist/Cache/Adapters/None.js +27 -0
  5. package/dist/Cache/Adapters/Redis.js +79 -0
  6. package/dist/Cache/Adapters/Sharding.js +72 -0
  7. package/dist/Cache/Cache.js +51 -0
  8. package/dist/Cache/index.js +5 -0
  9. package/dist/Cache/test.js +0 -0
  10. package/dist/Services.js +28 -0
  11. package/dist/actions/actionClient.js +35 -0
  12. package/dist/actions/index.js +1 -0
  13. package/dist/actions/nodes.js +9 -0
  14. package/dist/client.js +334 -0
  15. package/dist/decorators/Cache.js +78 -0
  16. package/dist/decorators/CacheKey.js +8 -0
  17. package/dist/decorators/Invalidate.js +46 -0
  18. package/dist/enums/api-service.js +14 -0
  19. package/dist/enums/api.js +6 -0
  20. package/dist/enums/auth-method.js +10 -0
  21. package/dist/enums/authentication-factor.js +7 -0
  22. package/dist/enums/authenticator-type.js +4 -0
  23. package/dist/enums/browser.js +17 -0
  24. package/dist/enums/compression.js +6 -0
  25. package/dist/enums/credit-card.js +19 -0
  26. package/dist/enums/database-usage-range.js +6 -0
  27. package/dist/enums/email-template-locale.js +134 -0
  28. package/dist/enums/email-template-type.js +10 -0
  29. package/dist/enums/entities/EntityLimitType.js +5 -0
  30. package/dist/enums/entities/PropertyAttributeName.js +28 -0
  31. package/dist/enums/entities/PropertyCondition.js +9 -0
  32. package/dist/enums/entities/PropertyType.js +17 -0
  33. package/dist/enums/entities/PropertyValueType.js +7 -0
  34. package/dist/enums/entities/RowAccess.js +1 -0
  35. package/dist/enums/entities/ViewFilterCondition.js +13 -0
  36. package/dist/enums/execution-method.js +9 -0
  37. package/dist/enums/flag.js +198 -0
  38. package/dist/enums/function-usage-range.js +6 -0
  39. package/dist/enums/image-format.js +8 -0
  40. package/dist/enums/image-gravity.js +12 -0
  41. package/dist/enums/index-type.js +6 -0
  42. package/dist/enums/messaging-provider-type.js +6 -0
  43. package/dist/enums/name.js +15 -0
  44. package/dist/enums/o-auth-provider copy.js +42 -0
  45. package/dist/enums/o-auth-provider.js +42 -0
  46. package/dist/enums/password-hash.js +14 -0
  47. package/dist/enums/platform-type.js +18 -0
  48. package/dist/enums/project-usage-range.js +5 -0
  49. package/dist/enums/region.js +5 -0
  50. package/dist/enums/relation-mutate.js +6 -0
  51. package/dist/enums/relationship-type.js +7 -0
  52. package/dist/enums/resource-type.js +5 -0
  53. package/dist/enums/runtime.js +49 -0
  54. package/dist/enums/s-m-t-p-secure.js +4 -0
  55. package/dist/enums/shared/ApplicationLayout.js +5 -0
  56. package/dist/enums/shared/Colors.js +25 -0
  57. package/dist/enums/shared/InputType.js +7 -0
  58. package/dist/enums/shared/Periodicity.js +8 -0
  59. package/dist/enums/shared/SvgIcon.js +38 -0
  60. package/dist/enums/shared/Theme.js +5 -0
  61. package/dist/enums/sms-template-locale.js +134 -0
  62. package/dist/enums/sms-template-type.js +7 -0
  63. package/dist/enums/smtp-encryption.js +6 -0
  64. package/dist/enums/storage-usage-range.js +6 -0
  65. package/dist/enums/subscriptions/PricingModel.js +11 -0
  66. package/dist/enums/subscriptions/SubscriptionBillingPeriod.js +10 -0
  67. package/dist/enums/subscriptions/SubscriptionFeatureLimitType.js +12 -0
  68. package/dist/enums/subscriptions/SubscriptionPriceType.js +7 -0
  69. package/dist/enums/tenants/LinkedAccountStatus.js +6 -0
  70. package/dist/enums/tenants/TenantUserJoined.js +7 -0
  71. package/dist/enums/tenants/TenantUserStatus.js +7 -0
  72. package/dist/enums/tenants/TenantUserType.js +6 -0
  73. package/dist/enums/user-usage-range.js +6 -0
  74. package/dist/getAppcondaClient.js +42 -0
  75. package/dist/getSDKForCurrentUser.js +62 -0
  76. package/dist/id.js +44 -0
  77. package/dist/iife/sdk.js +7063 -7805
  78. package/dist/index.js +12558 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/inputFile.js +16 -0
  81. package/dist/lib/Registry/Registry.js +55 -0
  82. package/dist/lib/Registry/index.js +1 -0
  83. package/dist/models.js +1 -0
  84. package/dist/permission.js +53 -0
  85. package/dist/query.js +203 -0
  86. package/dist/role.js +93 -0
  87. package/dist/service-client.js +13 -0
  88. package/dist/service.js +22 -0
  89. package/dist/services/account.js +1259 -0
  90. package/dist/services/applets.js +39 -0
  91. package/dist/services/avatars.js +250 -0
  92. package/dist/services/community.js +68 -0
  93. package/dist/services/configuration.js +10 -0
  94. package/dist/services/databases.js +1735 -0
  95. package/dist/services/functions.js +809 -0
  96. package/dist/services/graphql.js +56 -0
  97. package/dist/services/health.js +462 -0
  98. package/dist/services/locale.js +143 -0
  99. package/dist/services/messaging.js +1919 -0
  100. package/dist/services/node.js +10 -0
  101. package/dist/services/permissions.js +89 -0
  102. package/dist/services/pricing.js +20 -0
  103. package/dist/services/projects.js +1525 -0
  104. package/dist/services/roles.js +71 -0
  105. package/dist/services/schema.js +47 -0
  106. package/dist/services/storage.js +473 -0
  107. package/dist/services/subscription.js +45 -0
  108. package/dist/services/teams.js +394 -0
  109. package/dist/services/tenant-subscription.js +51 -0
  110. package/dist/services/tenant.js +124 -0
  111. package/dist/services/users.js +1282 -0
  112. package/dist/services/waitlist.js +11 -0
  113. package/package.json +5 -12
  114. package/tsconfig.json +2 -1
  115. package/dist/cjs/sdk.js +0 -13300
  116. package/dist/cjs/sdk.js.map +0 -1
  117. package/dist/esm/sdk.js +0 -13278
  118. package/dist/esm/sdk.js.map +0 -1
@@ -0,0 +1,56 @@
1
+ import { AppcondaException } from '../client';
2
+ export class Graphql {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ /**
7
+ * GraphQL endpoint
8
+ *
9
+ * Execute a GraphQL mutation.
10
+ *
11
+ * @param {object} query
12
+ * @throws {AppcondaException}
13
+ * @returns {Promise<{}>}
14
+ */
15
+ async query(query) {
16
+ if (typeof query === 'undefined') {
17
+ throw new AppcondaException('Missing required parameter: "query"');
18
+ }
19
+ const apiPath = '/graphql';
20
+ const payload = {};
21
+ if (typeof query !== 'undefined') {
22
+ payload['query'] = query;
23
+ }
24
+ const uri = new URL(this.client.config.endpoint + apiPath);
25
+ const apiHeaders = {
26
+ 'x-sdk-graphql': 'true',
27
+ 'content-type': 'application/json',
28
+ };
29
+ return await this.client.call('post', uri, apiHeaders, payload);
30
+ }
31
+ /**
32
+ * GraphQL endpoint
33
+ *
34
+ * Execute a GraphQL mutation.
35
+ *
36
+ * @param {object} query
37
+ * @throws {AppcondaException}
38
+ * @returns {Promise<{}>}
39
+ */
40
+ async mutation(query) {
41
+ if (typeof query === 'undefined') {
42
+ throw new AppcondaException('Missing required parameter: "query"');
43
+ }
44
+ const apiPath = '/graphql/mutation';
45
+ const payload = {};
46
+ if (typeof query !== 'undefined') {
47
+ payload['query'] = query;
48
+ }
49
+ const uri = new URL(this.client.config.endpoint + apiPath);
50
+ const apiHeaders = {
51
+ 'x-sdk-graphql': 'true',
52
+ 'content-type': 'application/json',
53
+ };
54
+ return await this.client.call('post', uri, apiHeaders, payload);
55
+ }
56
+ }
@@ -0,0 +1,462 @@
1
+ import { AppcondaException } from '../client';
2
+ export class Health {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ /**
7
+ * Get HTTP
8
+ *
9
+ * Check the Appconda HTTP server is up and responsive.
10
+ *
11
+ * @throws {AppcondaException}
12
+ * @returns {Promise<Models.HealthStatus>}
13
+ */
14
+ async get() {
15
+ const apiPath = '/health';
16
+ const payload = {};
17
+ const uri = new URL(this.client.config.endpoint + apiPath);
18
+ const apiHeaders = {
19
+ 'content-type': 'application/json',
20
+ };
21
+ return await this.client.call('get', uri, apiHeaders, payload);
22
+ }
23
+ /**
24
+ * Get antivirus
25
+ *
26
+ * Check the Appconda Antivirus server is up and connection is successful.
27
+ *
28
+ * @throws {AppcondaException}
29
+ * @returns {Promise<Models.HealthAntivirus>}
30
+ */
31
+ async getAntivirus() {
32
+ const apiPath = '/health/anti-virus';
33
+ const payload = {};
34
+ const uri = new URL(this.client.config.endpoint + apiPath);
35
+ const apiHeaders = {
36
+ 'content-type': 'application/json',
37
+ };
38
+ return await this.client.call('get', uri, apiHeaders, payload);
39
+ }
40
+ /**
41
+ * Get cache
42
+ *
43
+ * Check the Appconda in-memory cache servers are up and connection is successful.
44
+ *
45
+ * @throws {AppcondaException}
46
+ * @returns {Promise<Models.HealthStatus>}
47
+ */
48
+ async getCache() {
49
+ const apiPath = '/health/cache';
50
+ const payload = {};
51
+ const uri = new URL(this.client.config.endpoint + apiPath);
52
+ const apiHeaders = {
53
+ 'content-type': 'application/json',
54
+ };
55
+ return await this.client.call('get', uri, apiHeaders, payload);
56
+ }
57
+ /**
58
+ * Get the SSL certificate for a domain
59
+ *
60
+ * Get the SSL certificate for a domain
61
+ *
62
+ * @param {string} domain
63
+ * @throws {AppcondaException}
64
+ * @returns {Promise<Models.HealthCertificate>}
65
+ */
66
+ async getCertificate(domain) {
67
+ const apiPath = '/health/certificate';
68
+ const payload = {};
69
+ if (typeof domain !== 'undefined') {
70
+ payload['domain'] = domain;
71
+ }
72
+ const uri = new URL(this.client.config.endpoint + apiPath);
73
+ const apiHeaders = {
74
+ 'content-type': 'application/json',
75
+ };
76
+ return await this.client.call('get', uri, apiHeaders, payload);
77
+ }
78
+ /**
79
+ * Get DB
80
+ *
81
+ * Check the Appconda database servers are up and connection is successful.
82
+ *
83
+ * @throws {AppcondaException}
84
+ * @returns {Promise<Models.HealthStatus>}
85
+ */
86
+ async getDB() {
87
+ const apiPath = '/health/db';
88
+ const payload = {};
89
+ const uri = new URL(this.client.config.endpoint + apiPath);
90
+ const apiHeaders = {
91
+ 'content-type': 'application/json',
92
+ };
93
+ return await this.client.call('get', uri, apiHeaders, payload);
94
+ }
95
+ /**
96
+ * Get pubsub
97
+ *
98
+ * Check the Appconda pub-sub servers are up and connection is successful.
99
+ *
100
+ * @throws {AppcondaException}
101
+ * @returns {Promise<Models.HealthStatus>}
102
+ */
103
+ async getPubSub() {
104
+ const apiPath = '/health/pubsub';
105
+ const payload = {};
106
+ const uri = new URL(this.client.config.endpoint + apiPath);
107
+ const apiHeaders = {
108
+ 'content-type': 'application/json',
109
+ };
110
+ return await this.client.call('get', uri, apiHeaders, payload);
111
+ }
112
+ /**
113
+ * Get queue
114
+ *
115
+ * Check the Appconda queue messaging servers are up and connection is successful.
116
+ *
117
+ * @throws {AppcondaException}
118
+ * @returns {Promise<Models.HealthStatus>}
119
+ */
120
+ async getQueue() {
121
+ const apiPath = '/health/queue';
122
+ const payload = {};
123
+ const uri = new URL(this.client.config.endpoint + apiPath);
124
+ const apiHeaders = {
125
+ 'content-type': 'application/json',
126
+ };
127
+ return await this.client.call('get', uri, apiHeaders, payload);
128
+ }
129
+ /**
130
+ * Get builds queue
131
+ *
132
+ * Get the number of builds that are waiting to be processed in the Appconda internal queue server.
133
+ *
134
+ * @param {number} threshold
135
+ * @throws {AppcondaException}
136
+ * @returns {Promise<Models.HealthQueue>}
137
+ */
138
+ async getQueueBuilds(threshold) {
139
+ const apiPath = '/health/queue/builds';
140
+ const payload = {};
141
+ if (typeof threshold !== 'undefined') {
142
+ payload['threshold'] = threshold;
143
+ }
144
+ const uri = new URL(this.client.config.endpoint + apiPath);
145
+ const apiHeaders = {
146
+ 'content-type': 'application/json',
147
+ };
148
+ return await this.client.call('get', uri, apiHeaders, payload);
149
+ }
150
+ /**
151
+ * Get certificates queue
152
+ *
153
+ * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appconda internal queue server.
154
+ *
155
+ * @param {number} threshold
156
+ * @throws {AppcondaException}
157
+ * @returns {Promise<Models.HealthQueue>}
158
+ */
159
+ async getQueueCertificates(threshold) {
160
+ const apiPath = '/health/queue/certificates';
161
+ const payload = {};
162
+ if (typeof threshold !== 'undefined') {
163
+ payload['threshold'] = threshold;
164
+ }
165
+ const uri = new URL(this.client.config.endpoint + apiPath);
166
+ const apiHeaders = {
167
+ 'content-type': 'application/json',
168
+ };
169
+ return await this.client.call('get', uri, apiHeaders, payload);
170
+ }
171
+ /**
172
+ * Get databases queue
173
+ *
174
+ * Get the number of database changes that are waiting to be processed in the Appconda internal queue server.
175
+ *
176
+ * @param {string} name
177
+ * @param {number} threshold
178
+ * @throws {AppcondaException}
179
+ * @returns {Promise<Models.HealthQueue>}
180
+ */
181
+ async getQueueDatabases(name, threshold) {
182
+ const apiPath = '/health/queue/databases';
183
+ const payload = {};
184
+ if (typeof name !== 'undefined') {
185
+ payload['name'] = name;
186
+ }
187
+ if (typeof threshold !== 'undefined') {
188
+ payload['threshold'] = threshold;
189
+ }
190
+ const uri = new URL(this.client.config.endpoint + apiPath);
191
+ const apiHeaders = {
192
+ 'content-type': 'application/json',
193
+ };
194
+ return await this.client.call('get', uri, apiHeaders, payload);
195
+ }
196
+ /**
197
+ * Get deletes queue
198
+ *
199
+ * Get the number of background destructive changes that are waiting to be processed in the Appconda internal queue server.
200
+ *
201
+ * @param {number} threshold
202
+ * @throws {AppcondaException}
203
+ * @returns {Promise<Models.HealthQueue>}
204
+ */
205
+ async getQueueDeletes(threshold) {
206
+ const apiPath = '/health/queue/deletes';
207
+ const payload = {};
208
+ if (typeof threshold !== 'undefined') {
209
+ payload['threshold'] = threshold;
210
+ }
211
+ const uri = new URL(this.client.config.endpoint + apiPath);
212
+ const apiHeaders = {
213
+ 'content-type': 'application/json',
214
+ };
215
+ return await this.client.call('get', uri, apiHeaders, payload);
216
+ }
217
+ /**
218
+ * Get number of failed queue jobs
219
+ *
220
+ * Returns the amount of failed jobs in a given queue.
221
+
222
+ *
223
+ * @param {Name} name
224
+ * @param {number} threshold
225
+ * @throws {AppcondaException}
226
+ * @returns {Promise<Models.HealthQueue>}
227
+ */
228
+ async getFailedJobs(name, threshold) {
229
+ if (typeof name === 'undefined') {
230
+ throw new AppcondaException('Missing required parameter: "name"');
231
+ }
232
+ const apiPath = '/health/queue/failed/{name}'.replace('{name}', name);
233
+ const payload = {};
234
+ if (typeof threshold !== 'undefined') {
235
+ payload['threshold'] = threshold;
236
+ }
237
+ const uri = new URL(this.client.config.endpoint + apiPath);
238
+ const apiHeaders = {
239
+ 'content-type': 'application/json',
240
+ };
241
+ return await this.client.call('get', uri, apiHeaders, payload);
242
+ }
243
+ /**
244
+ * Get functions queue
245
+ *
246
+ * Get the number of function executions that are waiting to be processed in the Appconda internal queue server.
247
+ *
248
+ * @param {number} threshold
249
+ * @throws {AppcondaException}
250
+ * @returns {Promise<Models.HealthQueue>}
251
+ */
252
+ async getQueueFunctions(threshold) {
253
+ const apiPath = '/health/queue/functions';
254
+ const payload = {};
255
+ if (typeof threshold !== 'undefined') {
256
+ payload['threshold'] = threshold;
257
+ }
258
+ const uri = new URL(this.client.config.endpoint + apiPath);
259
+ const apiHeaders = {
260
+ 'content-type': 'application/json',
261
+ };
262
+ return await this.client.call('get', uri, apiHeaders, payload);
263
+ }
264
+ /**
265
+ * Get logs queue
266
+ *
267
+ * Get the number of logs that are waiting to be processed in the Appconda internal queue server.
268
+ *
269
+ * @param {number} threshold
270
+ * @throws {AppcondaException}
271
+ * @returns {Promise<Models.HealthQueue>}
272
+ */
273
+ async getQueueLogs(threshold) {
274
+ const apiPath = '/health/queue/logs';
275
+ const payload = {};
276
+ if (typeof threshold !== 'undefined') {
277
+ payload['threshold'] = threshold;
278
+ }
279
+ const uri = new URL(this.client.config.endpoint + apiPath);
280
+ const apiHeaders = {
281
+ 'content-type': 'application/json',
282
+ };
283
+ return await this.client.call('get', uri, apiHeaders, payload);
284
+ }
285
+ /**
286
+ * Get mails queue
287
+ *
288
+ * Get the number of mails that are waiting to be processed in the Appconda internal queue server.
289
+ *
290
+ * @param {number} threshold
291
+ * @throws {AppcondaException}
292
+ * @returns {Promise<Models.HealthQueue>}
293
+ */
294
+ async getQueueMails(threshold) {
295
+ const apiPath = '/health/queue/mails';
296
+ const payload = {};
297
+ if (typeof threshold !== 'undefined') {
298
+ payload['threshold'] = threshold;
299
+ }
300
+ const uri = new URL(this.client.config.endpoint + apiPath);
301
+ const apiHeaders = {
302
+ 'content-type': 'application/json',
303
+ };
304
+ return await this.client.call('get', uri, apiHeaders, payload);
305
+ }
306
+ /**
307
+ * Get messaging queue
308
+ *
309
+ * Get the number of messages that are waiting to be processed in the Appconda internal queue server.
310
+ *
311
+ * @param {number} threshold
312
+ * @throws {AppcondaException}
313
+ * @returns {Promise<Models.HealthQueue>}
314
+ */
315
+ async getQueueMessaging(threshold) {
316
+ const apiPath = '/health/queue/messaging';
317
+ const payload = {};
318
+ if (typeof threshold !== 'undefined') {
319
+ payload['threshold'] = threshold;
320
+ }
321
+ const uri = new URL(this.client.config.endpoint + apiPath);
322
+ const apiHeaders = {
323
+ 'content-type': 'application/json',
324
+ };
325
+ return await this.client.call('get', uri, apiHeaders, payload);
326
+ }
327
+ /**
328
+ * Get migrations queue
329
+ *
330
+ * Get the number of migrations that are waiting to be processed in the Appconda internal queue server.
331
+ *
332
+ * @param {number} threshold
333
+ * @throws {AppcondaException}
334
+ * @returns {Promise<Models.HealthQueue>}
335
+ */
336
+ async getQueueMigrations(threshold) {
337
+ const apiPath = '/health/queue/migrations';
338
+ const payload = {};
339
+ if (typeof threshold !== 'undefined') {
340
+ payload['threshold'] = threshold;
341
+ }
342
+ const uri = new URL(this.client.config.endpoint + apiPath);
343
+ const apiHeaders = {
344
+ 'content-type': 'application/json',
345
+ };
346
+ return await this.client.call('get', uri, apiHeaders, payload);
347
+ }
348
+ /**
349
+ * Get usage queue
350
+ *
351
+ * Get the number of metrics that are waiting to be processed in the Appconda internal queue server.
352
+ *
353
+ * @param {number} threshold
354
+ * @throws {AppcondaException}
355
+ * @returns {Promise<Models.HealthQueue>}
356
+ */
357
+ async getQueueUsage(threshold) {
358
+ const apiPath = '/health/queue/usage';
359
+ const payload = {};
360
+ if (typeof threshold !== 'undefined') {
361
+ payload['threshold'] = threshold;
362
+ }
363
+ const uri = new URL(this.client.config.endpoint + apiPath);
364
+ const apiHeaders = {
365
+ 'content-type': 'application/json',
366
+ };
367
+ return await this.client.call('get', uri, apiHeaders, payload);
368
+ }
369
+ /**
370
+ * Get usage dump queue
371
+ *
372
+ * Get the number of projects containing metrics that are waiting to be processed in the Appconda internal queue server.
373
+ *
374
+ * @param {number} threshold
375
+ * @throws {AppcondaException}
376
+ * @returns {Promise<Models.HealthQueue>}
377
+ */
378
+ async getQueueUsageDump(threshold) {
379
+ const apiPath = '/health/queue/usage-dump';
380
+ const payload = {};
381
+ if (typeof threshold !== 'undefined') {
382
+ payload['threshold'] = threshold;
383
+ }
384
+ const uri = new URL(this.client.config.endpoint + apiPath);
385
+ const apiHeaders = {
386
+ 'content-type': 'application/json',
387
+ };
388
+ return await this.client.call('get', uri, apiHeaders, payload);
389
+ }
390
+ /**
391
+ * Get webhooks queue
392
+ *
393
+ * Get the number of webhooks that are waiting to be processed in the Appconda internal queue server.
394
+ *
395
+ * @param {number} threshold
396
+ * @throws {AppcondaException}
397
+ * @returns {Promise<Models.HealthQueue>}
398
+ */
399
+ async getQueueWebhooks(threshold) {
400
+ const apiPath = '/health/queue/webhooks';
401
+ const payload = {};
402
+ if (typeof threshold !== 'undefined') {
403
+ payload['threshold'] = threshold;
404
+ }
405
+ const uri = new URL(this.client.config.endpoint + apiPath);
406
+ const apiHeaders = {
407
+ 'content-type': 'application/json',
408
+ };
409
+ return await this.client.call('get', uri, apiHeaders, payload);
410
+ }
411
+ /**
412
+ * Get storage
413
+ *
414
+ * Check the Appconda storage device is up and connection is successful.
415
+ *
416
+ * @throws {AppcondaException}
417
+ * @returns {Promise<Models.HealthStatus>}
418
+ */
419
+ async getStorage() {
420
+ const apiPath = '/health/storage';
421
+ const payload = {};
422
+ const uri = new URL(this.client.config.endpoint + apiPath);
423
+ const apiHeaders = {
424
+ 'content-type': 'application/json',
425
+ };
426
+ return await this.client.call('get', uri, apiHeaders, payload);
427
+ }
428
+ /**
429
+ * Get local storage
430
+ *
431
+ * Check the Appconda local storage device is up and connection is successful.
432
+ *
433
+ * @throws {AppcondaException}
434
+ * @returns {Promise<Models.HealthStatus>}
435
+ */
436
+ async getStorageLocal() {
437
+ const apiPath = '/health/storage/local';
438
+ const payload = {};
439
+ const uri = new URL(this.client.config.endpoint + apiPath);
440
+ const apiHeaders = {
441
+ 'content-type': 'application/json',
442
+ };
443
+ return await this.client.call('get', uri, apiHeaders, payload);
444
+ }
445
+ /**
446
+ * Get time
447
+ *
448
+ * Check the Appconda server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.
449
+ *
450
+ * @throws {AppcondaException}
451
+ * @returns {Promise<Models.HealthTime>}
452
+ */
453
+ async getTime() {
454
+ const apiPath = '/health/time';
455
+ const payload = {};
456
+ const uri = new URL(this.client.config.endpoint + apiPath);
457
+ const apiHeaders = {
458
+ 'content-type': 'application/json',
459
+ };
460
+ return await this.client.call('get', uri, apiHeaders, payload);
461
+ }
462
+ }
@@ -0,0 +1,143 @@
1
+ export class Locale {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ /**
6
+ * Get user locale
7
+ *
8
+ * 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.
9
+
10
+ ([IP Geolocation by DB-IP](https://db-ip.com))
11
+ *
12
+ * @throws {AppcondaException}
13
+ * @returns {Promise<Models.Locale>}
14
+ */
15
+ async get() {
16
+ const apiPath = '/locale';
17
+ const payload = {};
18
+ const uri = new URL(this.client.config.endpoint + apiPath);
19
+ const apiHeaders = {
20
+ 'content-type': 'application/json',
21
+ };
22
+ return await this.client.call('get', uri, apiHeaders, payload);
23
+ }
24
+ /**
25
+ * List Locale Codes
26
+ *
27
+ * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
28
+ *
29
+ * @throws {AppcondaException}
30
+ * @returns {Promise<Models.LocaleCodeList>}
31
+ */
32
+ async listCodes() {
33
+ const apiPath = '/locale/codes';
34
+ const payload = {};
35
+ const uri = new URL(this.client.config.endpoint + apiPath);
36
+ const apiHeaders = {
37
+ 'content-type': 'application/json',
38
+ };
39
+ return await this.client.call('get', uri, apiHeaders, payload);
40
+ }
41
+ /**
42
+ * List continents
43
+ *
44
+ * List of all continents. You can use the locale header to get the data in a supported language.
45
+ *
46
+ * @throws {AppcondaException}
47
+ * @returns {Promise<Models.ContinentList>}
48
+ */
49
+ async listContinents() {
50
+ const apiPath = '/locale/continents';
51
+ const payload = {};
52
+ const uri = new URL(this.client.config.endpoint + apiPath);
53
+ const apiHeaders = {
54
+ 'content-type': 'application/json',
55
+ };
56
+ return await this.client.call('get', uri, apiHeaders, payload);
57
+ }
58
+ /**
59
+ * List countries
60
+ *
61
+ * List of all countries. You can use the locale header to get the data in a supported language.
62
+ *
63
+ * @throws {AppcondaException}
64
+ * @returns {Promise<Models.CountryList>}
65
+ */
66
+ async listCountries() {
67
+ const apiPath = '/locale/countries';
68
+ const payload = {};
69
+ const uri = new URL(this.client.config.endpoint + apiPath);
70
+ const apiHeaders = {
71
+ 'content-type': 'application/json',
72
+ };
73
+ return await this.client.call('get', uri, apiHeaders, payload);
74
+ }
75
+ /**
76
+ * List EU countries
77
+ *
78
+ * 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.
79
+ *
80
+ * @throws {AppcondaException}
81
+ * @returns {Promise<Models.CountryList>}
82
+ */
83
+ async listCountriesEU() {
84
+ const apiPath = '/locale/countries/eu';
85
+ const payload = {};
86
+ const uri = new URL(this.client.config.endpoint + apiPath);
87
+ const apiHeaders = {
88
+ 'content-type': 'application/json',
89
+ };
90
+ return await this.client.call('get', uri, apiHeaders, payload);
91
+ }
92
+ /**
93
+ * List countries phone codes
94
+ *
95
+ * List of all countries phone codes. You can use the locale header to get the data in a supported language.
96
+ *
97
+ * @throws {AppcondaException}
98
+ * @returns {Promise<Models.PhoneList>}
99
+ */
100
+ async listCountriesPhones() {
101
+ const apiPath = '/locale/countries/phones';
102
+ const payload = {};
103
+ const uri = new URL(this.client.config.endpoint + apiPath);
104
+ const apiHeaders = {
105
+ 'content-type': 'application/json',
106
+ };
107
+ return await this.client.call('get', uri, apiHeaders, payload);
108
+ }
109
+ /**
110
+ * List currencies
111
+ *
112
+ * 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.
113
+ *
114
+ * @throws {AppcondaException}
115
+ * @returns {Promise<Models.CurrencyList>}
116
+ */
117
+ async listCurrencies() {
118
+ const apiPath = '/locale/currencies';
119
+ const payload = {};
120
+ const uri = new URL(this.client.config.endpoint + apiPath);
121
+ const apiHeaders = {
122
+ 'content-type': 'application/json',
123
+ };
124
+ return await this.client.call('get', uri, apiHeaders, payload);
125
+ }
126
+ /**
127
+ * List languages
128
+ *
129
+ * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
130
+ *
131
+ * @throws {AppcondaException}
132
+ * @returns {Promise<Models.LanguageList>}
133
+ */
134
+ async listLanguages() {
135
+ const apiPath = '/locale/languages';
136
+ const payload = {};
137
+ const uri = new URL(this.client.config.endpoint + apiPath);
138
+ const apiHeaders = {
139
+ 'content-type': 'application/json',
140
+ };
141
+ return await this.client.call('get', uri, apiHeaders, payload);
142
+ }
143
+ }