@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,71 @@
1
+ import { AppcondaException } from "../client";
2
+ export class Roles {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ async get(roleId) {
7
+ if (typeof roleId === 'undefined') {
8
+ throw new AppcondaException('Missing required parameter: "tenantId"');
9
+ }
10
+ const apiPath = '/roles/{roleId}'.replace('{roleId}', roleId);
11
+ const payload = {};
12
+ const uri = new URL(this.client.config.endpoint + apiPath);
13
+ const apiHeaders = {
14
+ 'content-type': 'application/json',
15
+ };
16
+ return await this.client.call('get', uri, apiHeaders, payload);
17
+ }
18
+ /**
19
+ * Create account
20
+ *
21
+ * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appconda.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appconda.io/docs/references/cloud/client-web/account#createEmailSession).
22
+ *
23
+ * @param {string} tenantId
24
+ * @param {string} name
25
+ * @param {string} slug
26
+ * @throws {AppcondaException}
27
+ * @returns {Promise<Models.User<Preferences>>}
28
+ */
29
+ async create({ $id, name, description }) {
30
+ if (typeof $id === 'undefined') {
31
+ throw new AppcondaException('Missing required parameter: "roleId"');
32
+ }
33
+ if (typeof name === 'undefined') {
34
+ throw new AppcondaException('Missing required parameter: "name"');
35
+ }
36
+ if (typeof description === 'undefined') {
37
+ throw new AppcondaException('Missing required parameter: "description"');
38
+ }
39
+ const apiPath = '/roles';
40
+ const payload = {};
41
+ if (typeof $id !== 'undefined') {
42
+ payload['roleId'] = $id;
43
+ }
44
+ if (typeof name !== 'undefined') {
45
+ payload['name'] = name;
46
+ }
47
+ if (typeof description !== 'undefined') {
48
+ payload['description'] = description;
49
+ }
50
+ const uri = new URL(this.client.config.endpoint + apiPath);
51
+ const apiHeaders = {
52
+ 'content-type': 'application/json',
53
+ };
54
+ return await this.client.call('post', uri, apiHeaders, payload);
55
+ }
56
+ async list(queries, search) {
57
+ const apiPath = '/roles';
58
+ const payload = {};
59
+ if (typeof queries !== 'undefined') {
60
+ payload['queries'] = queries;
61
+ }
62
+ if (typeof search !== 'undefined') {
63
+ payload['search'] = search;
64
+ }
65
+ const uri = new URL(this.client.config.endpoint + apiPath);
66
+ const apiHeaders = {
67
+ 'content-type': 'application/json',
68
+ };
69
+ return await this.client.call('get', uri, apiHeaders, payload);
70
+ }
71
+ }
@@ -0,0 +1,47 @@
1
+ import { AppcondaException } from "../client";
2
+ export class Schemas {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ /**
7
+ * Create account
8
+ *
9
+ * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appconda.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appconda.io/docs/references/cloud/client-web/account#createEmailSession).
10
+ *
11
+ * @param {string} tenantId
12
+ * @param {string} name
13
+ * @param {string} slug
14
+ * @throws {AppcondaException}
15
+ * @returns {Promise<Models.User<Preferences>>}
16
+ */
17
+ async import(projectId, databaseId, databaseName, schema) {
18
+ if (typeof projectId === 'undefined') {
19
+ throw new AppcondaException('Missing required parameter: "projectId"');
20
+ }
21
+ if (typeof databaseId === 'undefined') {
22
+ throw new AppcondaException('Missing required parameter: "databaseId"');
23
+ }
24
+ if (typeof schema === 'undefined') {
25
+ throw new AppcondaException('Missing required parameter: "schema"');
26
+ }
27
+ const apiPath = `/schema/${projectId}/${databaseId}`;
28
+ const payload = {};
29
+ if (typeof projectId !== 'undefined') {
30
+ payload['projectId'] = projectId;
31
+ }
32
+ if (typeof databaseId !== 'undefined') {
33
+ payload['databaseId'] = databaseId;
34
+ }
35
+ if (typeof databaseName !== 'undefined') {
36
+ payload['databaseName'] = databaseName;
37
+ }
38
+ if (typeof schema !== 'undefined') {
39
+ payload['schema'] = schema;
40
+ }
41
+ const uri = new URL(this.client.config.endpoint + apiPath);
42
+ const apiHeaders = {
43
+ 'content-type': 'application/json',
44
+ };
45
+ return await this.client.call('post', uri, apiHeaders, payload);
46
+ }
47
+ }
@@ -0,0 +1,473 @@
1
+ import { AppcondaException } from '../client';
2
+ export class Storage {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ /**
7
+ * List buckets
8
+ *
9
+ * Get a list of all the storage buckets. You can use the query params to filter your results.
10
+ *
11
+ * @param {string[]} queries
12
+ * @param {string} search
13
+ * @throws {AppcondaException}
14
+ * @returns {Promise<Models.BucketList>}
15
+ */
16
+ async listBuckets(queries, search) {
17
+ const apiPath = '/storage/buckets';
18
+ const payload = {};
19
+ if (typeof queries !== 'undefined') {
20
+ payload['queries'] = queries;
21
+ }
22
+ if (typeof search !== 'undefined') {
23
+ payload['search'] = search;
24
+ }
25
+ const uri = new URL(this.client.config.endpoint + apiPath);
26
+ const apiHeaders = {
27
+ 'content-type': 'application/json',
28
+ };
29
+ return await this.client.call('get', uri, apiHeaders, payload);
30
+ }
31
+ /**
32
+ * Create bucket
33
+ *
34
+ * Create a new storage bucket.
35
+ *
36
+ * @param {string} bucketId
37
+ * @param {string} name
38
+ * @param {string[]} permissions
39
+ * @param {boolean} fileSecurity
40
+ * @param {boolean} enabled
41
+ * @param {number} maximumFileSize
42
+ * @param {string[]} allowedFileExtensions
43
+ * @param {Compression} compression
44
+ * @param {boolean} encryption
45
+ * @param {boolean} antivirus
46
+ * @throws {AppcondaException}
47
+ * @returns {Promise<Models.Bucket>}
48
+ */
49
+ async createBucket(bucketId, name, permissions, fileSecurity, enabled, maximumFileSize, allowedFileExtensions, compression, encryption, antivirus) {
50
+ if (typeof bucketId === 'undefined') {
51
+ throw new AppcondaException('Missing required parameter: "bucketId"');
52
+ }
53
+ if (typeof name === 'undefined') {
54
+ throw new AppcondaException('Missing required parameter: "name"');
55
+ }
56
+ const apiPath = '/storage/buckets';
57
+ const payload = {};
58
+ if (typeof bucketId !== 'undefined') {
59
+ payload['bucketId'] = bucketId;
60
+ }
61
+ if (typeof name !== 'undefined') {
62
+ payload['name'] = name;
63
+ }
64
+ if (typeof permissions !== 'undefined') {
65
+ payload['permissions'] = permissions;
66
+ }
67
+ if (typeof fileSecurity !== 'undefined') {
68
+ payload['fileSecurity'] = fileSecurity;
69
+ }
70
+ if (typeof enabled !== 'undefined') {
71
+ payload['enabled'] = enabled;
72
+ }
73
+ if (typeof maximumFileSize !== 'undefined') {
74
+ payload['maximumFileSize'] = maximumFileSize;
75
+ }
76
+ if (typeof allowedFileExtensions !== 'undefined') {
77
+ payload['allowedFileExtensions'] = allowedFileExtensions;
78
+ }
79
+ if (typeof compression !== 'undefined') {
80
+ payload['compression'] = compression;
81
+ }
82
+ if (typeof encryption !== 'undefined') {
83
+ payload['encryption'] = encryption;
84
+ }
85
+ if (typeof antivirus !== 'undefined') {
86
+ payload['antivirus'] = antivirus;
87
+ }
88
+ const uri = new URL(this.client.config.endpoint + apiPath);
89
+ const apiHeaders = {
90
+ 'content-type': 'application/json',
91
+ };
92
+ return await this.client.call('post', uri, apiHeaders, payload);
93
+ }
94
+ /**
95
+ * Get bucket
96
+ *
97
+ * Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.
98
+ *
99
+ * @param {string} bucketId
100
+ * @throws {AppcondaException}
101
+ * @returns {Promise<Models.Bucket>}
102
+ */
103
+ async getBucket(bucketId) {
104
+ if (typeof bucketId === 'undefined') {
105
+ throw new AppcondaException('Missing required parameter: "bucketId"');
106
+ }
107
+ const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);
108
+ const payload = {};
109
+ const uri = new URL(this.client.config.endpoint + apiPath);
110
+ const apiHeaders = {
111
+ 'content-type': 'application/json',
112
+ };
113
+ return await this.client.call('get', uri, apiHeaders, payload);
114
+ }
115
+ /**
116
+ * Update bucket
117
+ *
118
+ * Update a storage bucket by its unique ID.
119
+ *
120
+ * @param {string} bucketId
121
+ * @param {string} name
122
+ * @param {string[]} permissions
123
+ * @param {boolean} fileSecurity
124
+ * @param {boolean} enabled
125
+ * @param {number} maximumFileSize
126
+ * @param {string[]} allowedFileExtensions
127
+ * @param {Compression} compression
128
+ * @param {boolean} encryption
129
+ * @param {boolean} antivirus
130
+ * @throws {AppcondaException}
131
+ * @returns {Promise<Models.Bucket>}
132
+ */
133
+ async updateBucket(bucketId, name, permissions, fileSecurity, enabled, maximumFileSize, allowedFileExtensions, compression, encryption, antivirus) {
134
+ if (typeof bucketId === 'undefined') {
135
+ throw new AppcondaException('Missing required parameter: "bucketId"');
136
+ }
137
+ if (typeof name === 'undefined') {
138
+ throw new AppcondaException('Missing required parameter: "name"');
139
+ }
140
+ const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);
141
+ const payload = {};
142
+ if (typeof name !== 'undefined') {
143
+ payload['name'] = name;
144
+ }
145
+ if (typeof permissions !== 'undefined') {
146
+ payload['permissions'] = permissions;
147
+ }
148
+ if (typeof fileSecurity !== 'undefined') {
149
+ payload['fileSecurity'] = fileSecurity;
150
+ }
151
+ if (typeof enabled !== 'undefined') {
152
+ payload['enabled'] = enabled;
153
+ }
154
+ if (typeof maximumFileSize !== 'undefined') {
155
+ payload['maximumFileSize'] = maximumFileSize;
156
+ }
157
+ if (typeof allowedFileExtensions !== 'undefined') {
158
+ payload['allowedFileExtensions'] = allowedFileExtensions;
159
+ }
160
+ if (typeof compression !== 'undefined') {
161
+ payload['compression'] = compression;
162
+ }
163
+ if (typeof encryption !== 'undefined') {
164
+ payload['encryption'] = encryption;
165
+ }
166
+ if (typeof antivirus !== 'undefined') {
167
+ payload['antivirus'] = antivirus;
168
+ }
169
+ const uri = new URL(this.client.config.endpoint + apiPath);
170
+ const apiHeaders = {
171
+ 'content-type': 'application/json',
172
+ };
173
+ return await this.client.call('put', uri, apiHeaders, payload);
174
+ }
175
+ /**
176
+ * Delete bucket
177
+ *
178
+ * Delete a storage bucket by its unique ID.
179
+ *
180
+ * @param {string} bucketId
181
+ * @throws {AppcondaException}
182
+ * @returns {Promise<{}>}
183
+ */
184
+ async deleteBucket(bucketId) {
185
+ if (typeof bucketId === 'undefined') {
186
+ throw new AppcondaException('Missing required parameter: "bucketId"');
187
+ }
188
+ const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);
189
+ const payload = {};
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('delete', uri, apiHeaders, payload);
195
+ }
196
+ /**
197
+ * List files
198
+ *
199
+ * Get a list of all the user files. You can use the query params to filter your results.
200
+ *
201
+ * @param {string} bucketId
202
+ * @param {string[]} queries
203
+ * @param {string} search
204
+ * @throws {AppcondaException}
205
+ * @returns {Promise<Models.FileList>}
206
+ */
207
+ async listFiles(bucketId, queries, search) {
208
+ if (typeof bucketId === 'undefined') {
209
+ throw new AppcondaException('Missing required parameter: "bucketId"');
210
+ }
211
+ const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);
212
+ const payload = {};
213
+ if (typeof queries !== 'undefined') {
214
+ payload['queries'] = queries;
215
+ }
216
+ if (typeof search !== 'undefined') {
217
+ payload['search'] = search;
218
+ }
219
+ const uri = new URL(this.client.config.endpoint + apiPath);
220
+ const apiHeaders = {
221
+ 'content-type': 'application/json',
222
+ };
223
+ return await this.client.call('get', uri, apiHeaders, payload);
224
+ }
225
+ /**
226
+ * Create file
227
+ *
228
+ * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appconda.io/docs/server/storage#storageCreateBucket) API or directly from your Appconda console.
229
+
230
+ Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
231
+
232
+ When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;s **id** in `x-appconda-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
233
+
234
+ If you&#039;re creating a new file using one of the Appconda SDKs, all the chunking logic will be managed by the SDK internally.
235
+
236
+ *
237
+ * @param {string} bucketId
238
+ * @param {string} fileId
239
+ * @param {File} file
240
+ * @param {string[]} permissions
241
+ * @throws {AppcondaException}
242
+ * @returns {Promise<Models.File>}
243
+ */
244
+ async createFile(bucketId, fileId, file, permissions, onProgress = (progress) => { }) {
245
+ if (typeof bucketId === 'undefined') {
246
+ throw new AppcondaException('Missing required parameter: "bucketId"');
247
+ }
248
+ if (typeof fileId === 'undefined') {
249
+ throw new AppcondaException('Missing required parameter: "fileId"');
250
+ }
251
+ if (typeof file === 'undefined') {
252
+ throw new AppcondaException('Missing required parameter: "file"');
253
+ }
254
+ const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);
255
+ const payload = {};
256
+ if (typeof fileId !== 'undefined') {
257
+ payload['fileId'] = fileId;
258
+ }
259
+ if (typeof file !== 'undefined') {
260
+ payload['file'] = file;
261
+ }
262
+ if (typeof permissions !== 'undefined') {
263
+ payload['permissions'] = permissions;
264
+ }
265
+ const uri = new URL(this.client.config.endpoint + apiPath);
266
+ const apiHeaders = {
267
+ 'content-type': 'multipart/form-data',
268
+ };
269
+ return await this.client.chunkedUpload('post', uri, apiHeaders, payload, onProgress);
270
+ }
271
+ /**
272
+ * Get file
273
+ *
274
+ * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.
275
+ *
276
+ * @param {string} bucketId
277
+ * @param {string} fileId
278
+ * @throws {AppcondaException}
279
+ * @returns {Promise<Models.File>}
280
+ */
281
+ async getFile(bucketId, fileId) {
282
+ if (typeof bucketId === 'undefined') {
283
+ throw new AppcondaException('Missing required parameter: "bucketId"');
284
+ }
285
+ if (typeof fileId === 'undefined') {
286
+ throw new AppcondaException('Missing required parameter: "fileId"');
287
+ }
288
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
289
+ const payload = {};
290
+ const uri = new URL(this.client.config.endpoint + apiPath);
291
+ const apiHeaders = {
292
+ 'content-type': 'application/json',
293
+ };
294
+ return await this.client.call('get', uri, apiHeaders, payload);
295
+ }
296
+ /**
297
+ * Update file
298
+ *
299
+ * Update a file by its unique ID. Only users with write permissions have access to update this resource.
300
+ *
301
+ * @param {string} bucketId
302
+ * @param {string} fileId
303
+ * @param {string} name
304
+ * @param {string[]} permissions
305
+ * @throws {AppcondaException}
306
+ * @returns {Promise<Models.File>}
307
+ */
308
+ async updateFile(bucketId, fileId, name, permissions) {
309
+ if (typeof bucketId === 'undefined') {
310
+ throw new AppcondaException('Missing required parameter: "bucketId"');
311
+ }
312
+ if (typeof fileId === 'undefined') {
313
+ throw new AppcondaException('Missing required parameter: "fileId"');
314
+ }
315
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
316
+ const payload = {};
317
+ if (typeof name !== 'undefined') {
318
+ payload['name'] = name;
319
+ }
320
+ if (typeof permissions !== 'undefined') {
321
+ payload['permissions'] = permissions;
322
+ }
323
+ const uri = new URL(this.client.config.endpoint + apiPath);
324
+ const apiHeaders = {
325
+ 'content-type': 'application/json',
326
+ };
327
+ return await this.client.call('put', uri, apiHeaders, payload);
328
+ }
329
+ /**
330
+ * Delete File
331
+ *
332
+ * Delete a file by its unique ID. Only users with write permissions have access to delete this resource.
333
+ *
334
+ * @param {string} bucketId
335
+ * @param {string} fileId
336
+ * @throws {AppcondaException}
337
+ * @returns {Promise<{}>}
338
+ */
339
+ async deleteFile(bucketId, fileId) {
340
+ if (typeof bucketId === 'undefined') {
341
+ throw new AppcondaException('Missing required parameter: "bucketId"');
342
+ }
343
+ if (typeof fileId === 'undefined') {
344
+ throw new AppcondaException('Missing required parameter: "fileId"');
345
+ }
346
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
347
+ const payload = {};
348
+ const uri = new URL(this.client.config.endpoint + apiPath);
349
+ const apiHeaders = {
350
+ 'content-type': 'application/json',
351
+ };
352
+ return await this.client.call('delete', uri, apiHeaders, payload);
353
+ }
354
+ /**
355
+ * Get file for download
356
+ *
357
+ * Get a file content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.
358
+ *
359
+ * @param {string} bucketId
360
+ * @param {string} fileId
361
+ * @throws {AppcondaException}
362
+ * @returns {Promise<ArrayBuffer>}
363
+ */
364
+ async getFileDownload(bucketId, fileId) {
365
+ if (typeof bucketId === 'undefined') {
366
+ throw new AppcondaException('Missing required parameter: "bucketId"');
367
+ }
368
+ if (typeof fileId === 'undefined') {
369
+ throw new AppcondaException('Missing required parameter: "fileId"');
370
+ }
371
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
372
+ const payload = {};
373
+ const uri = new URL(this.client.config.endpoint + apiPath);
374
+ const apiHeaders = {
375
+ 'content-type': 'application/json',
376
+ };
377
+ return await this.client.call('get', uri, apiHeaders, payload, 'arrayBuffer');
378
+ }
379
+ /**
380
+ * Get file preview
381
+ *
382
+ * Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
383
+ *
384
+ * @param {string} bucketId
385
+ * @param {string} fileId
386
+ * @param {number} width
387
+ * @param {number} height
388
+ * @param {ImageGravity} gravity
389
+ * @param {number} quality
390
+ * @param {number} borderWidth
391
+ * @param {string} borderColor
392
+ * @param {number} borderRadius
393
+ * @param {number} opacity
394
+ * @param {number} rotation
395
+ * @param {string} background
396
+ * @param {ImageFormat} output
397
+ * @throws {AppcondaException}
398
+ * @returns {Promise<ArrayBuffer>}
399
+ */
400
+ async getFilePreview(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output) {
401
+ if (typeof bucketId === 'undefined') {
402
+ throw new AppcondaException('Missing required parameter: "bucketId"');
403
+ }
404
+ if (typeof fileId === 'undefined') {
405
+ throw new AppcondaException('Missing required parameter: "fileId"');
406
+ }
407
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
408
+ const payload = {};
409
+ if (typeof width !== 'undefined') {
410
+ payload['width'] = width;
411
+ }
412
+ if (typeof height !== 'undefined') {
413
+ payload['height'] = height;
414
+ }
415
+ if (typeof gravity !== 'undefined') {
416
+ payload['gravity'] = gravity;
417
+ }
418
+ if (typeof quality !== 'undefined') {
419
+ payload['quality'] = quality;
420
+ }
421
+ if (typeof borderWidth !== 'undefined') {
422
+ payload['borderWidth'] = borderWidth;
423
+ }
424
+ if (typeof borderColor !== 'undefined') {
425
+ payload['borderColor'] = borderColor;
426
+ }
427
+ if (typeof borderRadius !== 'undefined') {
428
+ payload['borderRadius'] = borderRadius;
429
+ }
430
+ if (typeof opacity !== 'undefined') {
431
+ payload['opacity'] = opacity;
432
+ }
433
+ if (typeof rotation !== 'undefined') {
434
+ payload['rotation'] = rotation;
435
+ }
436
+ if (typeof background !== 'undefined') {
437
+ payload['background'] = background;
438
+ }
439
+ if (typeof output !== 'undefined') {
440
+ payload['output'] = output;
441
+ }
442
+ const uri = new URL(this.client.config.endpoint + apiPath);
443
+ const apiHeaders = {
444
+ 'content-type': 'application/json',
445
+ };
446
+ return await this.client.call('get', uri, apiHeaders, payload, 'arrayBuffer');
447
+ }
448
+ /**
449
+ * Get file for view
450
+ *
451
+ * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no &#039;Content-Disposition: attachment&#039; header.
452
+ *
453
+ * @param {string} bucketId
454
+ * @param {string} fileId
455
+ * @throws {AppcondaException}
456
+ * @returns {Promise<ArrayBuffer>}
457
+ */
458
+ async getFileView(bucketId, fileId) {
459
+ if (typeof bucketId === 'undefined') {
460
+ throw new AppcondaException('Missing required parameter: "bucketId"');
461
+ }
462
+ if (typeof fileId === 'undefined') {
463
+ throw new AppcondaException('Missing required parameter: "fileId"');
464
+ }
465
+ const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
466
+ const payload = {};
467
+ const uri = new URL(this.client.config.endpoint + apiPath);
468
+ const apiHeaders = {
469
+ 'content-type': 'application/json',
470
+ };
471
+ return await this.client.call('get', uri, apiHeaders, payload, 'arrayBuffer');
472
+ }
473
+ }
@@ -0,0 +1,45 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { ServiceClient } from "../service-client";
11
+ import { Cache } from '../decorators/Cache';
12
+ export class Subscription extends ServiceClient {
13
+ getServiceName() {
14
+ return 'com.appconda.service.subscription';
15
+ }
16
+ async getAllSubscriptionProducts(isPublic) {
17
+ const payload = {};
18
+ return await this.actionCall('ListSubscriptionProducts', payload);
19
+ }
20
+ async getActiveTenantsSubscriptions(isPublic) {
21
+ const payload = {};
22
+ return await this.actionCall('GetActiveTenantsSubscriptions', payload);
23
+ }
24
+ async getAllSubscriptionProductsWithTenants() {
25
+ const payload = {};
26
+ return await this.actionCall('GetAllSubscriptionProductsWithTenants', payload);
27
+ }
28
+ async getSubscriptionProduct(productId) {
29
+ const payload = {};
30
+ payload['productId'] = productId;
31
+ return await this.actionCall('GetSubscriptionProduct', payload);
32
+ }
33
+ async getAllTenantSubscriptionProducts(filters, pagination) {
34
+ const payload = {};
35
+ payload['filters'] = filters;
36
+ payload['pagination'] = pagination;
37
+ return await this.actionCall('GetAllTenantSubscriptionProducts', payload);
38
+ }
39
+ }
40
+ __decorate([
41
+ Cache(),
42
+ __metadata("design:type", Function),
43
+ __metadata("design:paramtypes", [Object, Object]),
44
+ __metadata("design:returntype", Promise)
45
+ ], Subscription.prototype, "getAllTenantSubscriptionProducts", null);