@longvansoftware/storefront-js-client 4.6.3 → 4.6.4

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 (80) hide show
  1. package/dist/config/config.d.ts +2 -0
  2. package/dist/config/config.js +2 -0
  3. package/dist/src/graphql/cloudService/queries.d.ts +1 -0
  4. package/dist/src/graphql/cloudService/queries.js +71 -0
  5. package/dist/src/graphql/marketplace/mutations.d.ts +3 -0
  6. package/dist/src/graphql/marketplace/mutations.js +54 -0
  7. package/dist/src/graphql/marketplace/queries.d.ts +2 -0
  8. package/dist/src/graphql/marketplace/queries.js +45 -0
  9. package/dist/src/lib/SDK.d.ts +3 -0
  10. package/dist/src/lib/SDK.js +5 -0
  11. package/dist/src/lib/cloudService/index.d.ts +5 -0
  12. package/dist/src/lib/{dns → cloudService}/index.js +11 -16
  13. package/dist/src/lib/marketplace/index.d.ts +9 -0
  14. package/dist/src/lib/marketplace/index.js +106 -0
  15. package/package.json +1 -1
  16. package/dist/src/graphql/accounting_service/mutations.d.ts +0 -2
  17. package/dist/src/graphql/accounting_service/mutations.js +0 -100
  18. package/dist/src/graphql/accounting_service/queries.d.ts +0 -1
  19. package/dist/src/graphql/accounting_service/queries.js +0 -62
  20. package/dist/src/graphql/content_api/queries.d.ts +0 -2
  21. package/dist/src/graphql/content_api/queries.js +0 -23
  22. package/dist/src/graphql/crm_camping/mutations.d.ts +0 -1
  23. package/dist/src/graphql/crm_camping/mutations.js +0 -37
  24. package/dist/src/graphql/crm_camping/queries.d.ts +0 -14
  25. package/dist/src/graphql/crm_camping/queries.js +0 -420
  26. package/dist/src/graphql/orderGraphQL/mutations.d.ts +0 -10
  27. package/dist/src/graphql/orderGraphQL/mutations.js +0 -410
  28. package/dist/src/graphql/orderGraphQL/queries.d.ts +0 -10
  29. package/dist/src/graphql/orderGraphQL/queries.js +0 -480
  30. package/dist/src/graphql/paymentLV/mutations.d.ts +0 -2
  31. package/dist/src/graphql/paymentLV/mutations.js +0 -31
  32. package/dist/src/graphql/paymentLV/queries.d.ts +0 -5
  33. package/dist/src/graphql/paymentLV/queries.js +0 -135
  34. package/dist/src/graphql/quicklab_service/mutations.d.ts +0 -8
  35. package/dist/src/graphql/quicklab_service/mutations.js +0 -171
  36. package/dist/src/graphql/quicklab_service/queries.d.ts +0 -7
  37. package/dist/src/graphql/quicklab_service/queries.js +0 -131
  38. package/dist/src/graphql/remote_access_service/mutations.d.ts +0 -7
  39. package/dist/src/graphql/remote_access_service/mutations.js +0 -89
  40. package/dist/src/graphql/remote_access_service/queries.d.ts +0 -2
  41. package/dist/src/graphql/remote_access_service/queries.js +0 -34
  42. package/dist/src/graphql/resource_permission/mutations.d.ts +0 -2
  43. package/dist/src/graphql/resource_permission/mutations.js +0 -65
  44. package/dist/src/graphql/resource_permission/queries.d.ts +0 -1
  45. package/dist/src/graphql/resource_permission/queries.js +0 -18
  46. package/dist/src/graphql/storage_s3/mutations.d.ts +0 -27
  47. package/dist/src/graphql/storage_s3/mutations.js +0 -603
  48. package/dist/src/graphql/storage_s3/queries.d.ts +0 -12
  49. package/dist/src/graphql/storage_s3/queries.js +0 -129
  50. package/dist/src/lib/accounting_service/index.d.ts +0 -9
  51. package/dist/src/lib/accounting_service/index.js +0 -69
  52. package/dist/src/lib/cloud_rest/index.d.ts +0 -17
  53. package/dist/src/lib/cloud_rest/index.js +0 -101
  54. package/dist/src/lib/content_api/index.d.ts +0 -7
  55. package/dist/src/lib/content_api/index.js +0 -43
  56. package/dist/src/lib/crm_camping/index.d.ts +0 -21
  57. package/dist/src/lib/crm_camping/index.js +0 -302
  58. package/dist/src/lib/dns/index.d.ts +0 -7
  59. package/dist/src/lib/orderGraphQL/index.d.ts +0 -24
  60. package/dist/src/lib/orderGraphQL/index.js +0 -342
  61. package/dist/src/lib/order_cloud_rest/index.d.ts +0 -7
  62. package/dist/src/lib/order_cloud_rest/index.js +0 -39
  63. package/dist/src/lib/paymentLV/index.d.ts +0 -13
  64. package/dist/src/lib/paymentLV/index.js +0 -149
  65. package/dist/src/lib/quicklab_service/index.d.ts +0 -19
  66. package/dist/src/lib/quicklab_service/index.js +0 -211
  67. package/dist/src/lib/remote_access_service/index.d.ts +0 -16
  68. package/dist/src/lib/remote_access_service/index.js +0 -181
  69. package/dist/src/lib/resource_permission/index.d.ts +0 -9
  70. package/dist/src/lib/resource_permission/index.js +0 -82
  71. package/dist/src/lib/service.d.ts +0 -14
  72. package/dist/src/lib/service.js +0 -101
  73. package/dist/src/lib/storage_s3/index.d.ts +0 -42
  74. package/dist/src/lib/storage_s3/index.js +0 -736
  75. package/dist/src/types/remote_access_service.d.ts +0 -12
  76. package/dist/src/types/remote_access_service.js +0 -2
  77. package/dist/src/types/storage_s3.d.ts +0 -10
  78. package/dist/src/types/storage_s3.js +0 -2
  79. package/dist/src/utils/build-field-string.d.ts +0 -1
  80. package/dist/src/utils/build-field-string.js +0 -16
@@ -1,736 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StorageS3Service = void 0;
13
- const mutations_1 = require("../../graphql/storage_s3/mutations");
14
- const queries_1 = require("../../graphql/storage_s3/queries");
15
- const serviceSDK_1 = require("../serviceSDK");
16
- class StorageS3Service extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- getListS3UserByServiceId(serviceId, fields) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- const query = (0, queries_1.GET_LIST_S3_USER_BY_SERVICE_ID)(fields);
23
- const variables = {
24
- serviceId,
25
- };
26
- try {
27
- const response = yield this.graphqlQueryV2(query, variables);
28
- return response.getListS3UserByServiceId;
29
- }
30
- catch (error) {
31
- console.log(`Error in getListS3UserByServiceId: ${error}`);
32
- throw error;
33
- }
34
- });
35
- }
36
- getListS3UserActiveByServiceId(serviceId, fields) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- const query = (0, queries_1.GET_LIST_S3_USER_ACTIVE_BY_SERVICE_ID)(fields);
39
- const variables = {
40
- serviceId,
41
- };
42
- try {
43
- const response = yield this.graphqlQueryV2(query, variables);
44
- return response.getListS3UserActiveByServiceId;
45
- }
46
- catch (error) {
47
- console.log(`Error in getListS3UserActiveByServiceId: ${error}`);
48
- throw error;
49
- }
50
- });
51
- }
52
- getListBucketByS3UserId(s3UserId, serviceId, fields) {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- const query = (0, queries_1.GET_LIST_BUCKET_BY_S3_USER_ID)(fields);
55
- const variables = {
56
- s3UserId,
57
- serviceId
58
- };
59
- try {
60
- const response = yield this.graphqlQueryV2(query, variables);
61
- return response.getListBucketByS3UserId;
62
- }
63
- catch (error) {
64
- console.log(`Error in getListBucketByS3UserId: ${error}`);
65
- throw error;
66
- }
67
- });
68
- }
69
- getListObject(s3UserId, bucketId, key, serviceId, fields) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- const query = (0, queries_1.GET_LIST_OBJECT)(fields);
72
- const variables = {
73
- s3UserId,
74
- bucketId,
75
- key,
76
- serviceId
77
- };
78
- try {
79
- const response = yield this.graphqlQueryV2(query, variables);
80
- return response.getListObject;
81
- }
82
- catch (error) {
83
- console.log(`Error in getListObject: ${error}`);
84
- throw error;
85
- }
86
- });
87
- }
88
- uploadFolder(userId, bucketId, fileInfo, basePrefix, serviceId, fields) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- const mutation = (0, mutations_1.UPLOAD_FOLDER)(fields);
91
- const variables = {
92
- userId,
93
- bucketId,
94
- fileInfo,
95
- basePrefix,
96
- serviceId
97
- };
98
- console.log('variables', variables);
99
- try {
100
- const response = yield this.graphqlMutationV2(mutation, variables);
101
- return response.uploadFolder;
102
- }
103
- catch (error) {
104
- console.log(`Error in uploadFolder: ${error}`);
105
- throw error;
106
- }
107
- });
108
- }
109
- uploadFile(s3UserId, bucketId, key, fields) {
110
- return __awaiter(this, void 0, void 0, function* () {
111
- const query = (0, queries_1.GET_LIST_OBJECT)(fields);
112
- const variables = {
113
- s3UserId,
114
- bucketId,
115
- key,
116
- };
117
- try {
118
- const response = yield this.graphqlQueryV2(query, variables);
119
- return response.getListObject;
120
- }
121
- catch (error) {
122
- console.log(`Error in getListObject: ${error}`);
123
- throw error;
124
- }
125
- });
126
- }
127
- updateAclPermissionFile(s3UserId, bucketId, key, isPublic, serviceId, fields) {
128
- return __awaiter(this, void 0, void 0, function* () {
129
- const mutation = (0, mutations_1.UPDATE_ACL_PERMISSION_FILE)(fields);
130
- const variables = {
131
- s3UserId,
132
- bucketId,
133
- key,
134
- isPublic,
135
- serviceId
136
- };
137
- try {
138
- const response = yield this.graphqlMutationV2(mutation, variables);
139
- return response.updateAclPermissionFile;
140
- }
141
- catch (error) {
142
- console.log(`Error in updateAclPermissionFile: ${error}`);
143
- throw error;
144
- }
145
- });
146
- }
147
- renameFile(s3UserId, bucketId, key, fileNewName, serviceId, fields) {
148
- return __awaiter(this, void 0, void 0, function* () {
149
- const mutation = (0, mutations_1.RENAME_FILE)(fields);
150
- const variables = {
151
- s3UserId,
152
- bucketId,
153
- key,
154
- fileNewName,
155
- serviceId
156
- };
157
- try {
158
- const response = yield this.graphqlMutationV2(mutation, variables);
159
- return response.renameFile;
160
- }
161
- catch (error) {
162
- console.log(`Error in renameFile: ${error}`);
163
- throw error;
164
- }
165
- });
166
- }
167
- shareLinkFileByTime(s3UserId, bucketId, key, quantityHour, serviceId) {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- const mutation = mutations_1.SHARE_LINK_FILE_BY_TIME;
170
- const variables = {
171
- s3UserId,
172
- bucketId,
173
- key,
174
- quantityHour,
175
- serviceId
176
- };
177
- try {
178
- const response = yield this.graphqlMutationV2(mutation, variables);
179
- return response.shareLinkFileByTime;
180
- }
181
- catch (error) {
182
- console.log(`Error in shareLinkFileByTime: ${error}`);
183
- throw error;
184
- }
185
- });
186
- }
187
- copyFile(s3UserId, bucketId, srcFileKey, dstFileKey, serviceId, fields) {
188
- return __awaiter(this, void 0, void 0, function* () {
189
- const mutation = (0, mutations_1.COPY_FILE)(fields);
190
- const variables = {
191
- s3UserId,
192
- bucketId,
193
- srcFileKey,
194
- dstFileKey,
195
- serviceId
196
- };
197
- try {
198
- const response = yield this.graphqlMutationV2(mutation, variables);
199
- return response.copyFile;
200
- }
201
- catch (error) {
202
- console.log(`Error in copyFile: ${error}`);
203
- throw error;
204
- }
205
- });
206
- }
207
- moveFile(s3UserId, bucketId, srcFileKey, dstFileKey, serviceId, fields) {
208
- return __awaiter(this, void 0, void 0, function* () {
209
- const mutation = (0, mutations_1.MOVE_FILE)(fields);
210
- const variables = {
211
- s3UserId,
212
- bucketId,
213
- srcFileKey,
214
- dstFileKey,
215
- serviceId
216
- };
217
- try {
218
- const response = yield this.graphqlMutationV2(mutation, variables);
219
- return response.moveFile;
220
- }
221
- catch (error) {
222
- console.log(`Error in moveFile: ${error}`);
223
- throw error;
224
- }
225
- });
226
- }
227
- removeFile(s3UserId, bucketId, keys, serviceId, fields) {
228
- return __awaiter(this, void 0, void 0, function* () {
229
- const mutation = (0, mutations_1.REMOVE_FILE)(fields);
230
- const variables = {
231
- s3UserId,
232
- bucketId,
233
- keys,
234
- serviceId
235
- };
236
- try {
237
- const response = yield this.graphqlMutationV2(mutation, variables);
238
- return response.removeFile;
239
- }
240
- catch (error) {
241
- console.log(`Error in removeFile: ${error}`);
242
- throw error;
243
- }
244
- });
245
- }
246
- createFolder(s3UserId, bucketId, folderName, key, serviceId, fields) {
247
- return __awaiter(this, void 0, void 0, function* () {
248
- const mutation = (0, mutations_1.CREATE_FOLDER)(fields);
249
- const variables = {
250
- s3UserId,
251
- bucketId,
252
- folderName,
253
- key,
254
- serviceId
255
- };
256
- try {
257
- const response = yield this.graphqlMutationV2(mutation, variables);
258
- return response.createFolder;
259
- }
260
- catch (error) {
261
- console.log(`Error in createFolder: ${error}`);
262
- throw error;
263
- }
264
- });
265
- }
266
- removeFolder(s3UserId, bucketId, key, serviceId, fields) {
267
- return __awaiter(this, void 0, void 0, function* () {
268
- const mutation = (0, mutations_1.REMOVE_FOLDER)(fields);
269
- const variables = {
270
- s3UserId,
271
- bucketId,
272
- key,
273
- serviceId
274
- };
275
- try {
276
- const response = yield this.graphqlMutationV2(mutation, variables);
277
- return response.removeFolder;
278
- }
279
- catch (error) {
280
- console.log(`Error in removeFolder: ${error}`);
281
- throw error;
282
- }
283
- });
284
- }
285
- createBucket(s3UserId, bucketName, internalId, randomInternalId, enableObjectLock, enableBucketVersioning, byUser, serviceId, fields) {
286
- return __awaiter(this, void 0, void 0, function* () {
287
- const mutation = (0, mutations_1.CREATE_BUCKET)(fields);
288
- const variables = {
289
- s3UserId,
290
- bucketName,
291
- internalId,
292
- randomInternalId,
293
- enableObjectLock,
294
- enableBucketVersioning,
295
- byUser,
296
- serviceId
297
- };
298
- try {
299
- const response = yield this.graphqlMutationV2(mutation, variables);
300
- return response.createBucket;
301
- }
302
- catch (error) {
303
- console.log(`Error in createBucket: ${error}`);
304
- throw error;
305
- }
306
- });
307
- }
308
- renameBucket(bucketId, bucketName, updateBy, serviceId, fields) {
309
- return __awaiter(this, void 0, void 0, function* () {
310
- const mutation = (0, mutations_1.RENAME_BUCKET)(fields);
311
- const variables = {
312
- bucketId,
313
- bucketName,
314
- updateBy,
315
- serviceId
316
- };
317
- try {
318
- const response = yield this.graphqlMutationV2(mutation, variables);
319
- return response.renameBucket;
320
- }
321
- catch (error) {
322
- console.log(`Error in renameBucket: ${error}`);
323
- throw error;
324
- }
325
- });
326
- }
327
- deleteBucket(bucketId, updateBy, serviceId, fields) {
328
- return __awaiter(this, void 0, void 0, function* () {
329
- const mutation = (0, mutations_1.DELETE_BUCKET)(fields);
330
- const variables = {
331
- bucketId,
332
- updateBy,
333
- serviceId
334
- };
335
- try {
336
- const response = yield this.graphqlMutationV2(mutation, variables);
337
- return response.deleteBucket;
338
- }
339
- catch (error) {
340
- console.log(`Error in deleteBucket: ${error}`);
341
- throw error;
342
- }
343
- });
344
- }
345
- updateAclPermissionBucket(s3UserId, bucketId, isPublic, updateBy, serviceId, fields) {
346
- return __awaiter(this, void 0, void 0, function* () {
347
- const mutation = (0, mutations_1.UPDATE_ACL_PERMISSION_BUCKET)(fields);
348
- const variables = {
349
- s3UserId,
350
- bucketId,
351
- isPublic,
352
- updateBy,
353
- serviceId
354
- };
355
- try {
356
- const response = yield this.graphqlMutationV2(mutation, variables);
357
- return response.updateAclPermissionBucket;
358
- }
359
- catch (error) {
360
- console.log(`Error in updateAclPermissionBucket: ${error}`);
361
- throw error;
362
- }
363
- });
364
- }
365
- updateBucketVersioning(s3UserId, bucketId, isOn, updateBy, serviceId, fields) {
366
- return __awaiter(this, void 0, void 0, function* () {
367
- const mutation = (0, mutations_1.UPDATE_BUCKET_VERSIONING)(fields);
368
- const variables = {
369
- s3UserId,
370
- bucketId,
371
- isOn,
372
- updateBy,
373
- serviceId
374
- };
375
- try {
376
- const response = yield this.graphqlMutationV2(mutation, variables);
377
- return response.updateBucketVersioning;
378
- }
379
- catch (error) {
380
- console.log(`Error in updateBucketVersioning: ${error}`);
381
- throw error;
382
- }
383
- });
384
- }
385
- getListFileTrash(s3UserId, bucketId, serviceId, fields) {
386
- return __awaiter(this, void 0, void 0, function* () {
387
- const query = (0, queries_1.GET_LIST_FILE_TRASH)(fields);
388
- const variables = {
389
- s3UserId,
390
- bucketId,
391
- serviceId
392
- };
393
- try {
394
- const response = yield this.graphqlQueryV2(query, variables);
395
- return response.getListFileTrash;
396
- }
397
- catch (error) {
398
- console.log(`Error in getListFileTrash: ${error}`);
399
- throw error;
400
- }
401
- });
402
- }
403
- restoreFileTrash(s3UserId, bucketId, key, versionId, serviceId, fields) {
404
- return __awaiter(this, void 0, void 0, function* () {
405
- const mutation = (0, mutations_1.RESTORE_FILE_TRASH)(fields);
406
- const variables = {
407
- s3UserId,
408
- bucketId,
409
- key,
410
- versionId,
411
- serviceId
412
- };
413
- try {
414
- const response = yield this.graphqlMutationV2(mutation, variables);
415
- return response.restoreFileTrash;
416
- }
417
- catch (error) {
418
- console.log(`Error in restoreFileTrash: ${error}`);
419
- throw error;
420
- }
421
- });
422
- }
423
- removeFileTrash(s3UserId, bucketId, files, serviceId, fields) {
424
- return __awaiter(this, void 0, void 0, function* () {
425
- const mutation = (0, mutations_1.REMOVE_FILE_TRASH)(fields);
426
- const variables = {
427
- s3UserId,
428
- bucketId,
429
- files,
430
- serviceId
431
- };
432
- try {
433
- const response = yield this.graphqlMutationV2(mutation, variables);
434
- return response.removeFileTrash;
435
- }
436
- catch (error) {
437
- console.log(`Error in removeFileTrash: ${error}`);
438
- throw error;
439
- }
440
- });
441
- }
442
- getListS3DomainByS3UserId(s3UserId, serviceId, fields) {
443
- return __awaiter(this, void 0, void 0, function* () {
444
- const query = (0, queries_1.GET_LIST_S3_DOMAIN_BY_S3_USER_ID)(fields);
445
- const variables = {
446
- s3UserId,
447
- serviceId
448
- };
449
- try {
450
- const response = yield this.graphqlQueryV2(query, variables);
451
- return response.getListS3DomainByS3UserId;
452
- }
453
- catch (error) {
454
- console.log(`Error in getListS3DomainByS3UserId: ${error}`);
455
- throw error;
456
- }
457
- });
458
- }
459
- addS3Domain(s3UserId, domain, byUser, serviceId, fields) {
460
- return __awaiter(this, void 0, void 0, function* () {
461
- const mutation = (0, mutations_1.ADD_S3_DOMAIN)(fields);
462
- const variables = {
463
- s3UserId,
464
- domain,
465
- byUser,
466
- serviceId
467
- };
468
- try {
469
- const response = yield this.graphqlMutationV2(mutation, variables);
470
- return response.addS3Domain;
471
- }
472
- catch (error) {
473
- console.log(`Error in addS3Domain: ${error}`);
474
- throw error;
475
- }
476
- });
477
- }
478
- removeS3Domain(s3UserId, domainId, byUser, serviceId, fields) {
479
- return __awaiter(this, void 0, void 0, function* () {
480
- const mutation = (0, mutations_1.REMOVE_S3_DOMAIN)(fields);
481
- const variables = {
482
- s3UserId,
483
- domainId,
484
- byUser,
485
- serviceId
486
- };
487
- try {
488
- const response = yield this.graphqlMutationV2(mutation, variables);
489
- return response.removeS3Domain;
490
- }
491
- catch (error) {
492
- console.log(`Error in removeS3Domain: ${error}`);
493
- throw error;
494
- }
495
- });
496
- }
497
- getListCorsByS3UserId(s3UserId, bucketId, serviceId, fields) {
498
- return __awaiter(this, void 0, void 0, function* () {
499
- const query = (0, queries_1.GET_LIST_CORS_BY_S3_USER_ID)(fields);
500
- const variables = {
501
- s3UserId,
502
- bucketId,
503
- serviceId
504
- };
505
- try {
506
- const response = yield this.graphqlQueryV2(query, variables);
507
- return response.getListCorsByS3UserId;
508
- }
509
- catch (error) {
510
- console.log(`Error in getListCorsByS3UserId: ${error}`);
511
- throw error;
512
- }
513
- });
514
- }
515
- addCorsBucket(s3UserId, bucketId, allowedMethods, allowedOrigins, allowedHeaders, exposeHeaders, maxAgeSeconds, updateBy, serviceId, fields) {
516
- return __awaiter(this, void 0, void 0, function* () {
517
- const mutation = (0, mutations_1.ADD_CORS_BUCKET)(fields);
518
- const variables = {
519
- s3UserId,
520
- bucketId,
521
- allowedMethods,
522
- allowedOrigins,
523
- allowedHeaders,
524
- exposeHeaders,
525
- maxAgeSeconds,
526
- updateBy,
527
- serviceId
528
- };
529
- try {
530
- const response = yield this.graphqlMutationV2(mutation, variables);
531
- return response.addCorsBucket;
532
- }
533
- catch (error) {
534
- console.log(`Error in addCorsBucket: ${error}`);
535
- throw error;
536
- }
537
- });
538
- }
539
- updateCorsBucket(bucketId, corsId, allowedMethods, allowedOrigins, allowedHeaders, exposeHeaders, maxAgeSeconds, updateBy, serviceId, fields) {
540
- return __awaiter(this, void 0, void 0, function* () {
541
- const mutation = (0, mutations_1.UPDATE_CORS_BUCKET)(fields);
542
- const variables = {
543
- bucketId,
544
- corsId,
545
- allowedMethods,
546
- allowedOrigins,
547
- allowedHeaders,
548
- exposeHeaders,
549
- maxAgeSeconds,
550
- updateBy,
551
- serviceId
552
- };
553
- try {
554
- const response = yield this.graphqlMutationV2(mutation, variables);
555
- return response.updateCorsBucket;
556
- }
557
- catch (error) {
558
- console.log(`Error in updateCorsBucket: ${error}`);
559
- throw error;
560
- }
561
- });
562
- }
563
- removeCorsBucket(bucketId, corsId, updateBy, serviceId, fields) {
564
- return __awaiter(this, void 0, void 0, function* () {
565
- const mutation = (0, mutations_1.REMOVE_CORS_BUCKET)(fields);
566
- const variables = {
567
- bucketId,
568
- corsId,
569
- updateBy,
570
- serviceId
571
- };
572
- try {
573
- const response = yield this.graphqlMutationV2(mutation, variables);
574
- return response.removeCorsBucket;
575
- }
576
- catch (error) {
577
- console.log(`Error in removeCorsBucket: ${error}`);
578
- throw error;
579
- }
580
- });
581
- }
582
- getListFileOtherVersion(s3UserId, bucketId, key, serviceId, fields) {
583
- return __awaiter(this, void 0, void 0, function* () {
584
- const query = (0, queries_1.GET_LIST_FILE_OTHER_VERSION)(fields);
585
- const variables = {
586
- s3UserId,
587
- bucketId,
588
- key,
589
- serviceId
590
- };
591
- try {
592
- const response = yield this.graphqlQueryV2(query, variables);
593
- return response.getListFileOtherVersion;
594
- }
595
- catch (error) {
596
- console.log(`Error in getListFileOtherVersion: ${error}`);
597
- throw error;
598
- }
599
- });
600
- }
601
- restoreFileOtherVersion(s3UserId, bucketId, key, versionId, serviceId, fields) {
602
- return __awaiter(this, void 0, void 0, function* () {
603
- const mutation = (0, mutations_1.RESTORE_FILE_OTHER_VERSION)(fields);
604
- const variables = {
605
- s3UserId,
606
- bucketId,
607
- key,
608
- versionId,
609
- serviceId
610
- };
611
- try {
612
- const response = yield this.graphqlMutationV2(mutation, variables);
613
- return response.restoreFileOtherVersion;
614
- }
615
- catch (error) {
616
- console.log(`Error in restoreFileOtherVersion: ${error}`);
617
- throw error;
618
- }
619
- });
620
- }
621
- removeFileOtherVersion(s3UserId, bucketId, key, versionId, serviceId, fields) {
622
- return __awaiter(this, void 0, void 0, function* () {
623
- const mutation = (0, mutations_1.REMOVE_FILE_OTHER_VERSION)(fields);
624
- const variables = {
625
- s3UserId,
626
- bucketId,
627
- key,
628
- versionId,
629
- serviceId
630
- };
631
- try {
632
- const response = yield this.graphqlMutationV2(mutation, variables);
633
- return response.removeFileOtherVersion;
634
- }
635
- catch (error) {
636
- console.log(`Error in removeFileOtherVersion: ${error}`);
637
- throw error;
638
- }
639
- });
640
- }
641
- resetKey(s3UserId, updateBy, serviceId, fields) {
642
- return __awaiter(this, void 0, void 0, function* () {
643
- const mutation = (0, mutations_1.RESET_KEY)(fields);
644
- const variables = {
645
- s3UserId,
646
- updateBy,
647
- serviceId
648
- };
649
- try {
650
- const response = yield this.graphqlMutationV2(mutation, variables);
651
- return response.resetKey;
652
- }
653
- catch (error) {
654
- console.log(`Error in resetKey: ${error}`);
655
- throw error;
656
- }
657
- });
658
- }
659
- actionSyncUserFromS3(s3UserId, updateBy, serviceId, fields) {
660
- return __awaiter(this, void 0, void 0, function* () {
661
- const mutation = (0, mutations_1.ACTION_SYNC_USER_FROM_S3)(fields);
662
- const variables = {
663
- s3UserId,
664
- updateBy,
665
- serviceId
666
- };
667
- try {
668
- const response = yield this.graphqlMutationV2(mutation, variables);
669
- return response.resetKey;
670
- }
671
- catch (error) {
672
- console.log(`Error in resetKey: ${error}`);
673
- throw error;
674
- }
675
- });
676
- }
677
- chartInYear(s3UserId, year, month, serviceId, fields) {
678
- return __awaiter(this, void 0, void 0, function* () {
679
- const query = (0, queries_1.CHART_IN_YEAR)(fields);
680
- const variables = {
681
- s3UserId,
682
- year,
683
- month,
684
- serviceId
685
- };
686
- try {
687
- const response = yield this.graphqlQueryV2(query, variables);
688
- return response.chartInYear;
689
- }
690
- catch (error) {
691
- console.log(`Error in chartInYear: ${error}`);
692
- throw error;
693
- }
694
- });
695
- }
696
- getIPConsul(userId, serviceId) {
697
- return __awaiter(this, void 0, void 0, function* () {
698
- const query = queries_1.GET_IP_CONSUL;
699
- const variables = {
700
- userId,
701
- serviceId
702
- };
703
- try {
704
- const response = yield this.graphqlQueryV2(query, variables);
705
- return response.getIPConsul;
706
- }
707
- catch (error) {
708
- console.log(`Error in getIPConsul: ${error}`);
709
- throw error;
710
- }
711
- });
712
- }
713
- filterListObject(s3UserId, bucketId, maxKeys, key, prefixSearch, continuationToken, serviceId, fields) {
714
- return __awaiter(this, void 0, void 0, function* () {
715
- const query = (0, queries_1.FILTER_LIST_OBJECT)(fields);
716
- const variables = {
717
- s3UserId,
718
- bucketId,
719
- maxKeys,
720
- key,
721
- prefixSearch,
722
- continuationToken,
723
- serviceId
724
- };
725
- try {
726
- const response = yield this.graphqlQueryV2(query, variables);
727
- return response.filterListObject;
728
- }
729
- catch (error) {
730
- console.log(`Error in filterListObject: ${error}`);
731
- throw error;
732
- }
733
- });
734
- }
735
- }
736
- exports.StorageS3Service = StorageS3Service;