@longvansoftware/service-js-client 1.20.0 → 1.20.2
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/dist/src/graphql/cloud/queries.d.ts +21 -19
- package/dist/src/graphql/cloud/queries.js +13 -1
- package/dist/src/graphql/crm_camping/queries.d.ts +1 -0
- package/dist/src/graphql/crm_camping/queries.js +25 -1
- package/dist/src/graphql/resource_permission/mutations.js +2 -0
- package/dist/src/graphql/storage_s3/mutations.d.ts +12 -0
- package/dist/src/graphql/storage_s3/mutations.js +287 -5
- package/dist/src/graphql/storage_s3/queries.d.ts +5 -0
- package/dist/src/graphql/storage_s3/queries.js +61 -1
- package/dist/src/lib/cloud/index.d.ts +1 -0
- package/dist/src/lib/cloud/index.js +16 -0
- package/dist/src/lib/crm_camping/index.d.ts +1 -0
- package/dist/src/lib/crm_camping/index.js +17 -0
- package/dist/src/lib/resource_permission/index.d.ts +1 -1
- package/dist/src/lib/resource_permission/index.js +2 -1
- package/dist/src/lib/storage_s3/index.d.ts +20 -1
- package/dist/src/lib/storage_s3/index.js +362 -4
- package/dist/src/types/storage_s3.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
|
+
export declare const CHECK_DOMAIN_NAME_AVAILABLE: DocumentNode;
|
|
3
|
+
export declare const CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC: DocumentNode;
|
|
4
|
+
export declare const GET_WHOIS_DOMAIN_INFO: DocumentNode;
|
|
5
|
+
export declare const SERVICE_DETAIL: DocumentNode;
|
|
6
|
+
export declare const SERVICE_DETAIL_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
7
|
+
export declare const GET_MAIL_RESOURCE: DocumentNode;
|
|
8
|
+
export declare const GET_USER_MAIL_HOSTING: DocumentNode;
|
|
9
|
+
export declare const SERVICE_TYPE: DocumentNode;
|
|
10
|
+
export declare const SEARCH_SERVICE: DocumentNode;
|
|
11
|
+
export declare const GET_PRODUCTS_OF_SERVICE: DocumentNode;
|
|
12
|
+
export declare const GET_IPS_OF_SERVICE: DocumentNode;
|
|
13
|
+
export declare const GET_SERVICES_BY_ORDER_ID: DocumentNode;
|
|
14
|
+
export declare const GET_SERVICE_TYPE_LIST: DocumentNode;
|
|
15
|
+
export declare const GET_DOMAIN_CONTACTS: DocumentNode;
|
|
16
|
+
export declare const GET_OWNERS_BY_CUSTOMER_ID: DocumentNode;
|
|
17
|
+
export declare const GET_CONTACTS_BY_OWNER_ID: DocumentNode;
|
|
18
|
+
export declare const GET_DOMAIN_SUPPLIER: DocumentNode;
|
|
19
|
+
export declare const CHECK_DOMAIN_EXIST: DocumentNode;
|
|
20
|
+
export declare const SEARCH_ACTIONS: DocumentNode;
|
|
21
|
+
export declare const GET_ELASTIC_CLOUD_RESOURCE: DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_ELASTIC_CLOUD_RESOURCE = exports.SEARCH_ACTIONS = exports.CHECK_DOMAIN_EXIST = exports.GET_DOMAIN_SUPPLIER = exports.GET_CONTACTS_BY_OWNER_ID = exports.GET_OWNERS_BY_CUSTOMER_ID = exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.GET_SERVICES_BY_ORDER_ID = exports.GET_IPS_OF_SERVICE = exports.GET_PRODUCTS_OF_SERVICE = exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL = exports.GET_WHOIS_DOMAIN_INFO = exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = exports.CHECK_DOMAIN_NAME_AVAILABLE = void 0;
|
|
3
|
+
exports.GET_ELASTIC_CLOUD_RESOURCE = exports.SEARCH_ACTIONS = exports.CHECK_DOMAIN_EXIST = exports.GET_DOMAIN_SUPPLIER = exports.GET_CONTACTS_BY_OWNER_ID = exports.GET_OWNERS_BY_CUSTOMER_ID = exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.GET_SERVICES_BY_ORDER_ID = exports.GET_IPS_OF_SERVICE = exports.GET_PRODUCTS_OF_SERVICE = exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL_DYNAMIC = exports.SERVICE_DETAIL = exports.GET_WHOIS_DOMAIN_INFO = exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = exports.CHECK_DOMAIN_NAME_AVAILABLE = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.CHECK_DOMAIN_NAME_AVAILABLE = (0, graphql_tag_1.gql) `
|
|
6
6
|
query CheckDomainNameAvailable($domainName: String!) {
|
|
@@ -94,6 +94,18 @@ exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
|
+
const SERVICE_DETAIL_DYNAMIC = (fields = []) => {
|
|
98
|
+
const fieldStr = fields.join('\n ');
|
|
99
|
+
const hasFields = fields.length > 0;
|
|
100
|
+
return (0, graphql_tag_1.gql) `
|
|
101
|
+
query ServiceDetail($serviceId: String) {
|
|
102
|
+
serviceDetail(serviceId: $serviceId) {
|
|
103
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
};
|
|
108
|
+
exports.SERVICE_DETAIL_DYNAMIC = SERVICE_DETAIL_DYNAMIC;
|
|
97
109
|
exports.GET_MAIL_RESOURCE = (0, graphql_tag_1.gql) `
|
|
98
110
|
query GetMailResource($serviceId: String!) {
|
|
99
111
|
getMailResource(serviceId: $serviceId) {
|
|
@@ -8,3 +8,4 @@ export declare const GET_NUMBER_OF_TICKET_EVALUATION: import("graphql").Document
|
|
|
8
8
|
export declare const SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE: import("graphql").DocumentNode;
|
|
9
9
|
export declare const GET_VOUCHERS_V2: import("graphql").DocumentNode;
|
|
10
10
|
export declare const SEARCH_CAMPAIGN: import("graphql").DocumentNode;
|
|
11
|
+
export declare const GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SEARCH_CAMPAIGN = exports.GET_VOUCHERS_V2 = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
|
|
3
|
+
exports.GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS = exports.SEARCH_CAMPAIGN = exports.GET_VOUCHERS_V2 = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = (0, graphql_tag_1.gql) `
|
|
6
6
|
query SearchProductQuantityPromotionAction(
|
|
@@ -361,3 +361,27 @@ exports.SEARCH_CAMPAIGN = (0, graphql_tag_1.gql) `
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
`;
|
|
364
|
+
exports.GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS = (0, graphql_tag_1.gql) `
|
|
365
|
+
query GetConditionByOrgIdCampaignActionIds(
|
|
366
|
+
$orgId: String!
|
|
367
|
+
$campaignActionIds: [String]!
|
|
368
|
+
) {
|
|
369
|
+
getConditionByOrgIdCampaignActionIds(
|
|
370
|
+
orgId: $orgId
|
|
371
|
+
campaignActionIds: $campaignActionIds
|
|
372
|
+
) {
|
|
373
|
+
partyId
|
|
374
|
+
campaignActionId
|
|
375
|
+
type
|
|
376
|
+
minimumSpend
|
|
377
|
+
maximumSpend
|
|
378
|
+
description
|
|
379
|
+
newCustomer
|
|
380
|
+
id
|
|
381
|
+
createdStamp
|
|
382
|
+
updatedStamp
|
|
383
|
+
updatedBy
|
|
384
|
+
createdBy
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
`;
|
|
@@ -34,9 +34,11 @@ exports.REMOVE_SHARE_PARTY = (0, graphql_tag_1.gql) `
|
|
|
34
34
|
$resourceType: String!
|
|
35
35
|
$resourceId: String!
|
|
36
36
|
$sharePartyId: String!
|
|
37
|
+
$ownerId: String!
|
|
37
38
|
) {
|
|
38
39
|
removeShareParty(
|
|
39
40
|
partnerId: $partnerId
|
|
41
|
+
ownerId: $ownerId
|
|
40
42
|
orgId: $orgId
|
|
41
43
|
resourceType: $resourceType
|
|
42
44
|
resourceId: $resourceId
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DocumentNode } from 'graphql';
|
|
2
2
|
export declare const CREATE_BUCKET: (fields?: string[]) => DocumentNode;
|
|
3
|
+
export declare const RENAME_BUCKET: (fields?: string[]) => DocumentNode;
|
|
3
4
|
export declare const DELETE_BUCKET: (fields?: string[]) => DocumentNode;
|
|
4
5
|
export declare const CREATE_FOLDER: (fields?: string[]) => DocumentNode;
|
|
5
6
|
export declare const REMOVE_FOLDER: (fields?: string[]) => DocumentNode;
|
|
@@ -11,3 +12,14 @@ export declare const SHARE_LINK_FILE_BY_TIME: DocumentNode;
|
|
|
11
12
|
export declare const COPY_FILE: (fields?: string[]) => DocumentNode;
|
|
12
13
|
export declare const MOVE_FILE: (fields?: string[]) => DocumentNode;
|
|
13
14
|
export declare const REMOVE_FILE: (fields?: string[]) => DocumentNode;
|
|
15
|
+
export declare const UPDATE_ACL_PERMISSION_BUCKET: (fields?: string[]) => DocumentNode;
|
|
16
|
+
export declare const UPDATE_BUCKET_VERSIONING: (fields?: string[]) => DocumentNode;
|
|
17
|
+
export declare const RESTORE_FILE_TRASH: (fields?: string[]) => DocumentNode;
|
|
18
|
+
export declare const REMOVE_FILE_TRASH: (fields?: string[]) => DocumentNode;
|
|
19
|
+
export declare const RESTORE_FILE_OTHER_VERSION: (fields?: string[]) => DocumentNode;
|
|
20
|
+
export declare const REMOVE_FILE_OTHER_VERSION: (fields?: string[]) => DocumentNode;
|
|
21
|
+
export declare const ADD_S3_DOMAIN: (fields?: string[]) => DocumentNode;
|
|
22
|
+
export declare const REMOVE_S3_DOMAIN: (fields?: string[]) => DocumentNode;
|
|
23
|
+
export declare const ADD_CORS_BUCKET: (fields?: string[]) => DocumentNode;
|
|
24
|
+
export declare const UPDATE_CORS_BUCKET: (fields?: string[]) => DocumentNode;
|
|
25
|
+
export declare const REMOVE_CORS_BUCKET: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOVE_FILE = exports.MOVE_FILE = exports.COPY_FILE = exports.SHARE_LINK_FILE_BY_TIME = exports.SHARE_LINK_FILE_BY_TIME_DYNAMIC = exports.RENAME_FILE = exports.UPDATE_ACL_PERMISSION_FILE = exports.UPLOAD_FOLDER = exports.REMOVE_FOLDER = exports.CREATE_FOLDER = exports.DELETE_BUCKET = exports.CREATE_BUCKET = void 0;
|
|
3
|
+
exports.REMOVE_CORS_BUCKET = exports.UPDATE_CORS_BUCKET = exports.ADD_CORS_BUCKET = exports.REMOVE_S3_DOMAIN = exports.ADD_S3_DOMAIN = exports.REMOVE_FILE_OTHER_VERSION = exports.RESTORE_FILE_OTHER_VERSION = exports.REMOVE_FILE_TRASH = exports.RESTORE_FILE_TRASH = exports.UPDATE_BUCKET_VERSIONING = exports.UPDATE_ACL_PERMISSION_BUCKET = exports.REMOVE_FILE = exports.MOVE_FILE = exports.COPY_FILE = exports.SHARE_LINK_FILE_BY_TIME = exports.SHARE_LINK_FILE_BY_TIME_DYNAMIC = exports.RENAME_FILE = exports.UPDATE_ACL_PERMISSION_FILE = exports.UPLOAD_FOLDER = exports.REMOVE_FOLDER = exports.CREATE_FOLDER = exports.DELETE_BUCKET = exports.RENAME_BUCKET = exports.CREATE_BUCKET = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
const CREATE_BUCKET = (fields = []) => {
|
|
6
6
|
const fieldStr = fields.join('\n ');
|
|
@@ -9,14 +9,20 @@ const CREATE_BUCKET = (fields = []) => {
|
|
|
9
9
|
mutation CreateBucket(
|
|
10
10
|
$s3UserId: String!,
|
|
11
11
|
$bucketName: String!,
|
|
12
|
+
$internalId: String,
|
|
13
|
+
$randomInternalId: Boolean!,
|
|
12
14
|
$enableObjectLock: Boolean!,
|
|
13
|
-
$enableBucketVersioning: Boolean
|
|
15
|
+
$enableBucketVersioning: Boolean!,
|
|
16
|
+
$byUser: String!
|
|
14
17
|
) {
|
|
15
18
|
createBucket(
|
|
16
19
|
s3UserId: $s3UserId,
|
|
17
20
|
bucketName: $bucketName,
|
|
21
|
+
internalId: $internalId,
|
|
22
|
+
randomInternalId: $randomInternalId,
|
|
18
23
|
enableObjectLock: $enableObjectLock,
|
|
19
|
-
enableBucketVersioning: $enableBucketVersioning
|
|
24
|
+
enableBucketVersioning: $enableBucketVersioning,
|
|
25
|
+
byUser: $byUser
|
|
20
26
|
) {
|
|
21
27
|
${hasFields ? `${fieldStr}` : ''}
|
|
22
28
|
}
|
|
@@ -24,6 +30,26 @@ const CREATE_BUCKET = (fields = []) => {
|
|
|
24
30
|
`;
|
|
25
31
|
};
|
|
26
32
|
exports.CREATE_BUCKET = CREATE_BUCKET;
|
|
33
|
+
const RENAME_BUCKET = (fields = []) => {
|
|
34
|
+
const fieldStr = fields.join('\n ');
|
|
35
|
+
const hasFields = fields.length > 0;
|
|
36
|
+
return (0, graphql_tag_1.gql) `
|
|
37
|
+
mutation RenameBucket(
|
|
38
|
+
$bucketId: String!,
|
|
39
|
+
$bucketName: String!,
|
|
40
|
+
$updateBy: String!
|
|
41
|
+
) {
|
|
42
|
+
renameBucket(
|
|
43
|
+
bucketId: $bucketId,
|
|
44
|
+
bucketName: $bucketName,
|
|
45
|
+
updateBy: $updateBy
|
|
46
|
+
) {
|
|
47
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
};
|
|
52
|
+
exports.RENAME_BUCKET = RENAME_BUCKET;
|
|
27
53
|
const DELETE_BUCKET = (fields = []) => {
|
|
28
54
|
const fieldStr = fields.join('\n ');
|
|
29
55
|
const hasFields = fields.length > 0;
|
|
@@ -49,12 +75,14 @@ const CREATE_FOLDER = (fields = []) => {
|
|
|
49
75
|
mutation CreateFolder(
|
|
50
76
|
$s3UserId: String!,
|
|
51
77
|
$bucketId: String!,
|
|
52
|
-
$folderName: String
|
|
78
|
+
$folderName: String!,
|
|
79
|
+
$key: String
|
|
53
80
|
) {
|
|
54
81
|
createFolder(
|
|
55
82
|
s3UserId: $s3UserId,
|
|
56
83
|
bucketId: $bucketId,
|
|
57
|
-
folderName: $folderName
|
|
84
|
+
folderName: $folderName,
|
|
85
|
+
key: $key
|
|
58
86
|
) {
|
|
59
87
|
${hasFields ? `${fieldStr}` : ''}
|
|
60
88
|
}
|
|
@@ -239,3 +267,257 @@ const REMOVE_FILE = (fields = []) => {
|
|
|
239
267
|
`;
|
|
240
268
|
};
|
|
241
269
|
exports.REMOVE_FILE = REMOVE_FILE;
|
|
270
|
+
const UPDATE_ACL_PERMISSION_BUCKET = (fields = []) => {
|
|
271
|
+
const fieldStr = fields.join('\n ');
|
|
272
|
+
const hasFields = fields.length > 0;
|
|
273
|
+
return (0, graphql_tag_1.gql) `
|
|
274
|
+
mutation UpdateAclPermissionBucket(
|
|
275
|
+
$s3UserId: String!,
|
|
276
|
+
$bucketId: String!,
|
|
277
|
+
$isPublic: Boolean!
|
|
278
|
+
$updateBy: String!,
|
|
279
|
+
) {
|
|
280
|
+
updateAclPermissionBucket(
|
|
281
|
+
s3UserId: $s3UserId,
|
|
282
|
+
bucketId: $bucketId,
|
|
283
|
+
isPublic: $isPublic
|
|
284
|
+
updateBy: $updateBy,
|
|
285
|
+
) {
|
|
286
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
`;
|
|
290
|
+
};
|
|
291
|
+
exports.UPDATE_ACL_PERMISSION_BUCKET = UPDATE_ACL_PERMISSION_BUCKET;
|
|
292
|
+
const UPDATE_BUCKET_VERSIONING = (fields = []) => {
|
|
293
|
+
const fieldStr = fields.join('\n ');
|
|
294
|
+
const hasFields = fields.length > 0;
|
|
295
|
+
return (0, graphql_tag_1.gql) `
|
|
296
|
+
mutation UpdateBucketVersioning(
|
|
297
|
+
$s3UserId: String!,
|
|
298
|
+
$bucketId: String!,
|
|
299
|
+
$isOn: Boolean!
|
|
300
|
+
$updateBy: String!,
|
|
301
|
+
) {
|
|
302
|
+
updateBucketVersioning(
|
|
303
|
+
s3UserId: $s3UserId,
|
|
304
|
+
bucketId: $bucketId,
|
|
305
|
+
isOn: $isOn
|
|
306
|
+
updateBy: $updateBy,
|
|
307
|
+
) {
|
|
308
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
`;
|
|
312
|
+
};
|
|
313
|
+
exports.UPDATE_BUCKET_VERSIONING = UPDATE_BUCKET_VERSIONING;
|
|
314
|
+
const RESTORE_FILE_TRASH = (fields = []) => {
|
|
315
|
+
const fieldStr = fields.join('\n ');
|
|
316
|
+
const hasFields = fields.length > 0;
|
|
317
|
+
return (0, graphql_tag_1.gql) `
|
|
318
|
+
mutation RestoreFileTrash(
|
|
319
|
+
$s3UserId: String!,
|
|
320
|
+
$bucketId: String!,
|
|
321
|
+
$key: String!,
|
|
322
|
+
$versionId: String!
|
|
323
|
+
) {
|
|
324
|
+
restoreFileTrash(
|
|
325
|
+
s3UserId: $s3UserId,
|
|
326
|
+
bucketId: $bucketId,
|
|
327
|
+
key: $key,
|
|
328
|
+
versionId: $versionId
|
|
329
|
+
) {
|
|
330
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
`;
|
|
334
|
+
};
|
|
335
|
+
exports.RESTORE_FILE_TRASH = RESTORE_FILE_TRASH;
|
|
336
|
+
const REMOVE_FILE_TRASH = (fields = []) => {
|
|
337
|
+
const fieldStr = fields.join('\n ');
|
|
338
|
+
const hasFields = fields.length > 0;
|
|
339
|
+
return (0, graphql_tag_1.gql) `
|
|
340
|
+
mutation RemoveFileTrash(
|
|
341
|
+
$s3UserId: String!,
|
|
342
|
+
$bucketId: String!,
|
|
343
|
+
$files: [FileTrashInput!]!
|
|
344
|
+
) {
|
|
345
|
+
removeFileTrash(
|
|
346
|
+
s3UserId: $s3UserId,
|
|
347
|
+
bucketId: $bucketId,
|
|
348
|
+
files: $files
|
|
349
|
+
) {
|
|
350
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
`;
|
|
354
|
+
};
|
|
355
|
+
exports.REMOVE_FILE_TRASH = REMOVE_FILE_TRASH;
|
|
356
|
+
const RESTORE_FILE_OTHER_VERSION = (fields = []) => {
|
|
357
|
+
const fieldStr = fields.join('\n ');
|
|
358
|
+
const hasFields = fields.length > 0;
|
|
359
|
+
return (0, graphql_tag_1.gql) `
|
|
360
|
+
mutation RestoreFileOtherVersion(
|
|
361
|
+
$s3UserId: String!,
|
|
362
|
+
$bucketId: String!,
|
|
363
|
+
$key: String!,
|
|
364
|
+
$versionId: String!
|
|
365
|
+
) {
|
|
366
|
+
restoreFileOtherVersion(
|
|
367
|
+
s3UserId: $s3UserId,
|
|
368
|
+
bucketId: $bucketId,
|
|
369
|
+
key: $key,
|
|
370
|
+
versionId: $versionId
|
|
371
|
+
) {
|
|
372
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
`;
|
|
376
|
+
};
|
|
377
|
+
exports.RESTORE_FILE_OTHER_VERSION = RESTORE_FILE_OTHER_VERSION;
|
|
378
|
+
const REMOVE_FILE_OTHER_VERSION = (fields = []) => {
|
|
379
|
+
const fieldStr = fields.join('\n ');
|
|
380
|
+
const hasFields = fields.length > 0;
|
|
381
|
+
return (0, graphql_tag_1.gql) `
|
|
382
|
+
mutation RemoveFileOtherVersion(
|
|
383
|
+
$s3UserId: String!,
|
|
384
|
+
$bucketId: String!,
|
|
385
|
+
$key: String!,
|
|
386
|
+
$versionId: String!
|
|
387
|
+
) {
|
|
388
|
+
removeFileOtherVersion(
|
|
389
|
+
s3UserId: $s3UserId,
|
|
390
|
+
bucketId: $bucketId,
|
|
391
|
+
key: $key,
|
|
392
|
+
versionId: $versionId
|
|
393
|
+
) {
|
|
394
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
`;
|
|
398
|
+
};
|
|
399
|
+
exports.REMOVE_FILE_OTHER_VERSION = REMOVE_FILE_OTHER_VERSION;
|
|
400
|
+
const ADD_S3_DOMAIN = (fields = []) => {
|
|
401
|
+
const fieldStr = fields.join('\n ');
|
|
402
|
+
const hasFields = fields.length > 0;
|
|
403
|
+
return (0, graphql_tag_1.gql) `
|
|
404
|
+
mutation AddS3Domain(
|
|
405
|
+
$s3UserId: String!,
|
|
406
|
+
$domain: String!,
|
|
407
|
+
$byUser: String!
|
|
408
|
+
) {
|
|
409
|
+
addS3Domain(
|
|
410
|
+
s3UserId: $s3UserId,
|
|
411
|
+
domain: $domain,
|
|
412
|
+
byUser: $byUser
|
|
413
|
+
) {
|
|
414
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
`;
|
|
418
|
+
};
|
|
419
|
+
exports.ADD_S3_DOMAIN = ADD_S3_DOMAIN;
|
|
420
|
+
const REMOVE_S3_DOMAIN = (fields = []) => {
|
|
421
|
+
const fieldStr = fields.join('\n ');
|
|
422
|
+
const hasFields = fields.length > 0;
|
|
423
|
+
return (0, graphql_tag_1.gql) `
|
|
424
|
+
mutation RemoveS3Domain(
|
|
425
|
+
$s3UserId: String!,
|
|
426
|
+
$domainId: String!,
|
|
427
|
+
$byUser: String!
|
|
428
|
+
) {
|
|
429
|
+
removeS3Domain(
|
|
430
|
+
s3UserId: $s3UserId,
|
|
431
|
+
domainId: $domainId,
|
|
432
|
+
byUser: $byUser,
|
|
433
|
+
) {
|
|
434
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
`;
|
|
438
|
+
};
|
|
439
|
+
exports.REMOVE_S3_DOMAIN = REMOVE_S3_DOMAIN;
|
|
440
|
+
const ADD_CORS_BUCKET = (fields = []) => {
|
|
441
|
+
const fieldStr = fields.join('\n ');
|
|
442
|
+
const hasFields = fields.length > 0;
|
|
443
|
+
return (0, graphql_tag_1.gql) `
|
|
444
|
+
mutation AddCorsBucket(
|
|
445
|
+
$s3UserId: String!,
|
|
446
|
+
$bucketId: String!,
|
|
447
|
+
$allowedMethods: [String],
|
|
448
|
+
$allowedOrigins: [String],
|
|
449
|
+
$allowedHeaders: [String],
|
|
450
|
+
$exposeHeaders: [String],
|
|
451
|
+
$maxAgeSeconds: Int,
|
|
452
|
+
$updateBy: String!
|
|
453
|
+
) {
|
|
454
|
+
addCorsBucket(
|
|
455
|
+
s3UserId: $s3UserId,
|
|
456
|
+
bucketId: $bucketId,
|
|
457
|
+
allowedMethods: $allowedMethods,
|
|
458
|
+
allowedOrigins: $allowedOrigins,
|
|
459
|
+
allowedHeaders: $allowedHeaders,
|
|
460
|
+
exposeHeaders: $exposeHeaders,
|
|
461
|
+
maxAgeSeconds: $maxAgeSeconds,
|
|
462
|
+
updateBy: $updateBy
|
|
463
|
+
) {
|
|
464
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
`;
|
|
468
|
+
};
|
|
469
|
+
exports.ADD_CORS_BUCKET = ADD_CORS_BUCKET;
|
|
470
|
+
const UPDATE_CORS_BUCKET = (fields = []) => {
|
|
471
|
+
const fieldStr = fields.join('\n ');
|
|
472
|
+
const hasFields = fields.length > 0;
|
|
473
|
+
return (0, graphql_tag_1.gql) `
|
|
474
|
+
mutation UpdateCorsBucket(
|
|
475
|
+
$s3UserId: String!,
|
|
476
|
+
$bucketId: String!,
|
|
477
|
+
$allowedMethods: [String],
|
|
478
|
+
$allowedOrigins: [String],
|
|
479
|
+
$allowedHeaders: [String],
|
|
480
|
+
$exposeHeaders: [String],
|
|
481
|
+
$maxAgeSeconds: Int,
|
|
482
|
+
$corsId: String!,
|
|
483
|
+
$updateBy: String!
|
|
484
|
+
) {
|
|
485
|
+
updateCorsBucket(
|
|
486
|
+
s3UserId: $s3UserId,
|
|
487
|
+
bucketId: $bucketId,
|
|
488
|
+
allowedMethods: $allowedMethods,
|
|
489
|
+
allowedOrigins: $allowedOrigins,
|
|
490
|
+
allowedHeaders: $allowedHeaders,
|
|
491
|
+
exposeHeaders: $exposeHeaders,
|
|
492
|
+
maxAgeSeconds: $maxAgeSeconds,
|
|
493
|
+
corsId: $corsId,
|
|
494
|
+
updateBy: $updateBy
|
|
495
|
+
) {
|
|
496
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
`;
|
|
500
|
+
};
|
|
501
|
+
exports.UPDATE_CORS_BUCKET = UPDATE_CORS_BUCKET;
|
|
502
|
+
const REMOVE_CORS_BUCKET = (fields = []) => {
|
|
503
|
+
const fieldStr = fields.join('\n ');
|
|
504
|
+
const hasFields = fields.length > 0;
|
|
505
|
+
return (0, graphql_tag_1.gql) `
|
|
506
|
+
mutation RemoveCorsBucket(
|
|
507
|
+
$s3UserId: String!,
|
|
508
|
+
$bucketId: String!,
|
|
509
|
+
$corsId: String!,
|
|
510
|
+
$updateBy: String!
|
|
511
|
+
) {
|
|
512
|
+
removeCorsBucket(
|
|
513
|
+
s3UserId: $s3UserId,
|
|
514
|
+
bucketId: $bucketId,
|
|
515
|
+
corsId: $corsId,
|
|
516
|
+
updateBy: $updateBy,
|
|
517
|
+
) {
|
|
518
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
`;
|
|
522
|
+
};
|
|
523
|
+
exports.REMOVE_CORS_BUCKET = REMOVE_CORS_BUCKET;
|
|
@@ -2,3 +2,8 @@ import { DocumentNode } from 'graphql';
|
|
|
2
2
|
export declare const GET_LIST_S3_USER_BY_SERVICE_ID: (fields?: string[]) => DocumentNode;
|
|
3
3
|
export declare const GET_LIST_BUCKET_BY_S3_USER_ID: (fields?: string[]) => DocumentNode;
|
|
4
4
|
export declare const GET_LIST_OBJECT: (fields?: string[]) => DocumentNode;
|
|
5
|
+
export declare const GET_LIST_FILE_TRASH: (fields?: string[]) => DocumentNode;
|
|
6
|
+
export declare const GET_LIST_S3_DOMAIN_BY_S3_USER_ID: (fields?: string[]) => DocumentNode;
|
|
7
|
+
export declare const GET_LIST_CORS_BY_S3_USER_ID: (fields?: string[]) => DocumentNode;
|
|
8
|
+
export declare const GET_LIST_FILE_OTHER_VERSION: (fields?: string[]) => DocumentNode;
|
|
9
|
+
export declare const CHART_IN_YEAR: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_LIST_OBJECT = exports.GET_LIST_BUCKET_BY_S3_USER_ID = exports.GET_LIST_S3_USER_BY_SERVICE_ID = void 0;
|
|
3
|
+
exports.CHART_IN_YEAR = exports.GET_LIST_FILE_OTHER_VERSION = exports.GET_LIST_CORS_BY_S3_USER_ID = exports.GET_LIST_S3_DOMAIN_BY_S3_USER_ID = exports.GET_LIST_FILE_TRASH = exports.GET_LIST_OBJECT = exports.GET_LIST_BUCKET_BY_S3_USER_ID = exports.GET_LIST_S3_USER_BY_SERVICE_ID = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
const GET_LIST_S3_USER_BY_SERVICE_ID = (fields = []) => {
|
|
6
6
|
const fieldStr = fields.join('\n ');
|
|
@@ -38,3 +38,63 @@ const GET_LIST_OBJECT = (fields = []) => {
|
|
|
38
38
|
`;
|
|
39
39
|
};
|
|
40
40
|
exports.GET_LIST_OBJECT = GET_LIST_OBJECT;
|
|
41
|
+
const GET_LIST_FILE_TRASH = (fields = []) => {
|
|
42
|
+
const fieldStr = fields.join('\n ');
|
|
43
|
+
const hasFields = fields.length > 0;
|
|
44
|
+
return (0, graphql_tag_1.gql) `
|
|
45
|
+
query GetListFileTrash($s3UserId: String!, $bucketId: String!) {
|
|
46
|
+
getListFileTrash(s3UserId: $s3UserId, bucketId: $bucketId) {
|
|
47
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
};
|
|
52
|
+
exports.GET_LIST_FILE_TRASH = GET_LIST_FILE_TRASH;
|
|
53
|
+
const GET_LIST_S3_DOMAIN_BY_S3_USER_ID = (fields = []) => {
|
|
54
|
+
const fieldStr = fields.join('\n ');
|
|
55
|
+
const hasFields = fields.length > 0;
|
|
56
|
+
return (0, graphql_tag_1.gql) `
|
|
57
|
+
query GetListS3DomainByS3UserId($s3UserId: String!) {
|
|
58
|
+
getListS3DomainByS3UserId(s3UserId: $s3UserId) {
|
|
59
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
};
|
|
64
|
+
exports.GET_LIST_S3_DOMAIN_BY_S3_USER_ID = GET_LIST_S3_DOMAIN_BY_S3_USER_ID;
|
|
65
|
+
const GET_LIST_CORS_BY_S3_USER_ID = (fields = []) => {
|
|
66
|
+
const fieldStr = fields.join('\n ');
|
|
67
|
+
const hasFields = fields.length > 0;
|
|
68
|
+
return (0, graphql_tag_1.gql) `
|
|
69
|
+
query GetListCorsByS3UserId($s3UserId: String!, $bucketId: String!) {
|
|
70
|
+
getListCorsByS3UserId(s3UserId: $s3UserId, bucketId: $bucketId) {
|
|
71
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
};
|
|
76
|
+
exports.GET_LIST_CORS_BY_S3_USER_ID = GET_LIST_CORS_BY_S3_USER_ID;
|
|
77
|
+
const GET_LIST_FILE_OTHER_VERSION = (fields = []) => {
|
|
78
|
+
const fieldStr = fields.join('\n ');
|
|
79
|
+
const hasFields = fields.length > 0;
|
|
80
|
+
return (0, graphql_tag_1.gql) `
|
|
81
|
+
query GetListFileOtherVersion($s3UserId: String!, $bucketId: String!, $key: String) {
|
|
82
|
+
getListFileOtherVersion(s3UserId: $s3UserId, bucketId: $bucketId, key: $key) {
|
|
83
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
};
|
|
88
|
+
exports.GET_LIST_FILE_OTHER_VERSION = GET_LIST_FILE_OTHER_VERSION;
|
|
89
|
+
const CHART_IN_YEAR = (fields = []) => {
|
|
90
|
+
const fieldStr = fields.join('\n ');
|
|
91
|
+
const hasFields = fields.length > 0;
|
|
92
|
+
return (0, graphql_tag_1.gql) `
|
|
93
|
+
query ChartInYear($s3UserId: String!, $year: Int!, $month: Int!) {
|
|
94
|
+
chartInYear(s3UserId: $s3UserId, year: $year, month: $month) {
|
|
95
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
};
|
|
100
|
+
exports.CHART_IN_YEAR = CHART_IN_YEAR;
|
|
@@ -11,6 +11,7 @@ export declare class CloudService extends Service {
|
|
|
11
11
|
setToken(token: string): void;
|
|
12
12
|
setStoreId(storeId: string): void;
|
|
13
13
|
serviceDetail(serviceId: string): Promise<any>;
|
|
14
|
+
serviceDetailDynamic(serviceId: string, fields: string[]): Promise<any>;
|
|
14
15
|
updateServiceCompleted(serviceId: string, handleBy: string): Promise<any>;
|
|
15
16
|
updateServiceNew(serviceId: string, handleBy: string): Promise<any>;
|
|
16
17
|
updateServiceReadyDeploy(serviceId: string, handleBy: string): Promise<any>;
|
|
@@ -45,6 +45,22 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
+
serviceDetailDynamic(serviceId, fields) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const query = (0, queries_1.SERVICE_DETAIL_DYNAMIC)(fields);
|
|
51
|
+
const variables = {
|
|
52
|
+
serviceId,
|
|
53
|
+
};
|
|
54
|
+
try {
|
|
55
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
56
|
+
return response.serviceDetail;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.log(`Error in serviceDetailDynamic: ${error}`);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
48
64
|
updateServiceCompleted(serviceId, handleBy) {
|
|
49
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
66
|
const mutation = mutations_1.UPDATE_SERVICE_COMPLETED;
|
|
@@ -15,4 +15,5 @@ export declare class CrmCampingService extends Service {
|
|
|
15
15
|
addProductGiftPromotion(orderId: string, updatedBy: string, addData: any): Promise<any>;
|
|
16
16
|
searchVouchersV2(searchVoucherRequest: any): Promise<any>;
|
|
17
17
|
searchCampaign(searchCampaignRequest: any): Promise<any>;
|
|
18
|
+
getConditionByOrgIdCampaignActionIds(campaignActionIds: [string]): Promise<any>;
|
|
18
19
|
}
|
|
@@ -258,5 +258,22 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
|
+
getConditionByOrgIdCampaignActionIds(campaignActionIds) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
const query = queries_1.GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS;
|
|
264
|
+
const variables = {
|
|
265
|
+
orgId: this.orgId,
|
|
266
|
+
campaignActionIds,
|
|
267
|
+
};
|
|
268
|
+
try {
|
|
269
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
270
|
+
return response.getConditionByOrgIdCampaignActionIds;
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
console.log(`Error fetching getConditionByOrgIdCampaignActionIds: ${error}`);
|
|
274
|
+
throw error;
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
261
278
|
}
|
|
262
279
|
exports.CrmCampingService = CrmCampingService;
|
|
@@ -4,6 +4,6 @@ export declare class ResourcePermissionService extends Service {
|
|
|
4
4
|
setToken(token: string): void;
|
|
5
5
|
setStoreId(storeId: string): void;
|
|
6
6
|
shareResource(createModel: any): Promise<any>;
|
|
7
|
-
removeShareParty(resourceId: string, sharePartyId: string, resourceType: string): Promise<any>;
|
|
7
|
+
removeShareParty(resourceId: string, sharePartyId: string, resourceType: string, userLoginId: string): Promise<any>;
|
|
8
8
|
getSharedUserByService(resourceType: string, resourceId: string): Promise<any>;
|
|
9
9
|
}
|
|
@@ -40,7 +40,7 @@ class ResourcePermissionService extends serviceSDK_1.Service {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
removeShareParty(resourceId, sharePartyId, resourceType) {
|
|
43
|
+
removeShareParty(resourceId, sharePartyId, resourceType, userLoginId) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
const mutation = mutations_1.REMOVE_SHARE_PARTY;
|
|
46
46
|
const variables = {
|
|
@@ -49,6 +49,7 @@ class ResourcePermissionService extends serviceSDK_1.Service {
|
|
|
49
49
|
resourceType,
|
|
50
50
|
resourceId,
|
|
51
51
|
sharePartyId,
|
|
52
|
+
ownerId: userLoginId
|
|
52
53
|
};
|
|
53
54
|
try {
|
|
54
55
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileInfoInput } from '../../types/storage_s3';
|
|
1
|
+
import { FileInfoInput, FileTrashInput } from '../../types/storage_s3';
|
|
2
2
|
import { Service } from '../serviceSDK';
|
|
3
3
|
export declare class StorageS3Service extends Service {
|
|
4
4
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
@@ -15,4 +15,23 @@ export declare class StorageS3Service extends Service {
|
|
|
15
15
|
removeFile(s3UserId: string, bucketId: string, keys: string[], fields: string[]): Promise<any>;
|
|
16
16
|
createFolder(s3UserId: string, bucketId: string, folderName: string, key: string, fields: string[]): Promise<any>;
|
|
17
17
|
removeFolder(s3UserId: string, bucketId: string, key: string, fields: string[]): Promise<any>;
|
|
18
|
+
createBucket(s3UserId: string, bucketName: string, internalId: string, randomInternalId: boolean, enableObjectLock: boolean, enableBucketVersioning: boolean, byUser: string, fields: string[]): Promise<any>;
|
|
19
|
+
renameBucket(bucketId: string, bucketName: string, updateBy: string, fields: string[]): Promise<any>;
|
|
20
|
+
deleteBucket(bucketId: string, updateBy: string, fields: string[]): Promise<any>;
|
|
21
|
+
updateAclPermissionBucket(s3UserId: string, bucketId: string, isPublic: boolean, updateBy: string, fields: string[]): Promise<any>;
|
|
22
|
+
updateBucketVersioning(s3UserId: string, bucketId: string, isOn: boolean, updateBy: string, fields: string[]): Promise<any>;
|
|
23
|
+
getListFileTrash(s3UserId: string, bucketId: string, fields: string[]): Promise<any>;
|
|
24
|
+
restoreFileTrash(s3UserId: string, bucketId: string, key: string, versionId: string, fields: string[]): Promise<any>;
|
|
25
|
+
removeFileTrash(s3UserId: string, bucketId: string, files: [FileTrashInput], fields: string[]): Promise<any>;
|
|
26
|
+
getListS3DomainByS3UserId(s3UserId: string, fields: string[]): Promise<any>;
|
|
27
|
+
addS3Domain(s3UserId: string, domain: string, byUser: string, fields: string[]): Promise<any>;
|
|
28
|
+
removeS3Domain(s3UserId: string, domainId: string, byUser: string, fields: string[]): Promise<any>;
|
|
29
|
+
getListCorsByS3UserId(s3UserId: string, bucketId: string, fields: string[]): Promise<any>;
|
|
30
|
+
addCorsBucket(s3UserId: string, bucketId: string, allowedMethods: string[], allowedOrigins: string[], allowedHeaders: string[], exposeHeaders: string[], maxAgeSeconds: number, updateBy: string, fields: string[]): Promise<any>;
|
|
31
|
+
updateCorsBucket(s3UserId: string, bucketId: string, corsId: string, allowedMethods: string[], allowedOrigins: string[], allowedHeaders: string[], exposeHeaders: string[], maxAgeSeconds: number, updateBy: string, fields: string[]): Promise<any>;
|
|
32
|
+
removeCorsBucket(s3UserId: string, bucketId: string, corsId: string, updateBy: string, fields: string[]): Promise<any>;
|
|
33
|
+
getListFileOtherVersion(s3UserId: string, bucketId: string, key: string, fields: string[]): Promise<any>;
|
|
34
|
+
restoreFileOtherVersion(s3UserId: string, bucketId: string, key: string, versionId: string, fields: string[]): Promise<any>;
|
|
35
|
+
removeFileOtherVersion(s3UserId: string, bucketId: string, key: string, versionId: string, fields: string[]): Promise<any>;
|
|
36
|
+
chartInYear(s3UserId: string, year: number, month: number, fields: string[]): Promise<any>;
|
|
18
37
|
}
|
|
@@ -76,7 +76,7 @@ class StorageS3Service extends serviceSDK_1.Service {
|
|
|
76
76
|
fileInfo,
|
|
77
77
|
basePrefix,
|
|
78
78
|
};
|
|
79
|
-
console.log(
|
|
79
|
+
console.log('variables', variables);
|
|
80
80
|
try {
|
|
81
81
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
82
82
|
return response.uploadFolder;
|
|
@@ -107,7 +107,7 @@ class StorageS3Service extends serviceSDK_1.Service {
|
|
|
107
107
|
}
|
|
108
108
|
updateAclPermissionFile(s3UserId, bucketId, key, isPublic, fields) {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const
|
|
110
|
+
const mutation = (0, mutations_1.UPDATE_ACL_PERMISSION_FILE)(fields);
|
|
111
111
|
const variables = {
|
|
112
112
|
s3UserId,
|
|
113
113
|
bucketId,
|
|
@@ -115,7 +115,7 @@ class StorageS3Service extends serviceSDK_1.Service {
|
|
|
115
115
|
isPublic,
|
|
116
116
|
};
|
|
117
117
|
try {
|
|
118
|
-
const response = yield this.
|
|
118
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
119
119
|
return response.updateAclPermissionFile;
|
|
120
120
|
}
|
|
121
121
|
catch (error) {
|
|
@@ -225,7 +225,7 @@ class StorageS3Service extends serviceSDK_1.Service {
|
|
|
225
225
|
s3UserId,
|
|
226
226
|
bucketId,
|
|
227
227
|
folderName,
|
|
228
|
-
key
|
|
228
|
+
key,
|
|
229
229
|
};
|
|
230
230
|
try {
|
|
231
231
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -255,5 +255,363 @@ class StorageS3Service extends serviceSDK_1.Service {
|
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
+
createBucket(s3UserId, bucketName, internalId, randomInternalId, enableObjectLock, enableBucketVersioning, byUser, fields) {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
+
const mutation = (0, mutations_1.CREATE_BUCKET)(fields);
|
|
261
|
+
const variables = {
|
|
262
|
+
s3UserId,
|
|
263
|
+
bucketName,
|
|
264
|
+
internalId,
|
|
265
|
+
randomInternalId,
|
|
266
|
+
enableObjectLock,
|
|
267
|
+
enableBucketVersioning,
|
|
268
|
+
byUser,
|
|
269
|
+
};
|
|
270
|
+
try {
|
|
271
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
272
|
+
return response.createBucket;
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
console.log(`Error in createBucket: ${error}`);
|
|
276
|
+
throw error;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
renameBucket(bucketId, bucketName, updateBy, fields) {
|
|
281
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
+
const mutation = (0, mutations_1.RENAME_BUCKET)(fields);
|
|
283
|
+
const variables = {
|
|
284
|
+
bucketId,
|
|
285
|
+
bucketName,
|
|
286
|
+
updateBy
|
|
287
|
+
};
|
|
288
|
+
try {
|
|
289
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
290
|
+
return response.renameBucket;
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
console.log(`Error in renameBucket: ${error}`);
|
|
294
|
+
throw error;
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
deleteBucket(bucketId, updateBy, fields) {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
300
|
+
const mutation = (0, mutations_1.DELETE_BUCKET)(fields);
|
|
301
|
+
const variables = {
|
|
302
|
+
bucketId,
|
|
303
|
+
updateBy,
|
|
304
|
+
};
|
|
305
|
+
try {
|
|
306
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
307
|
+
return response.deleteBucket;
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
console.log(`Error in deleteBucket: ${error}`);
|
|
311
|
+
throw error;
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
updateAclPermissionBucket(s3UserId, bucketId, isPublic, updateBy, fields) {
|
|
316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
const mutation = (0, mutations_1.UPDATE_ACL_PERMISSION_BUCKET)(fields);
|
|
318
|
+
const variables = {
|
|
319
|
+
s3UserId,
|
|
320
|
+
bucketId,
|
|
321
|
+
isPublic,
|
|
322
|
+
updateBy,
|
|
323
|
+
};
|
|
324
|
+
try {
|
|
325
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
326
|
+
return response.updateAclPermissionBucket;
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
console.log(`Error in updateAclPermissionBucket: ${error}`);
|
|
330
|
+
throw error;
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
updateBucketVersioning(s3UserId, bucketId, isOn, updateBy, fields) {
|
|
335
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
336
|
+
const mutation = (0, mutations_1.UPDATE_BUCKET_VERSIONING)(fields);
|
|
337
|
+
const variables = {
|
|
338
|
+
s3UserId,
|
|
339
|
+
bucketId,
|
|
340
|
+
isOn,
|
|
341
|
+
updateBy,
|
|
342
|
+
};
|
|
343
|
+
try {
|
|
344
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
345
|
+
return response.updateBucketVersioning;
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
console.log(`Error in updateBucketVersioning: ${error}`);
|
|
349
|
+
throw error;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
getListFileTrash(s3UserId, bucketId, fields) {
|
|
354
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
355
|
+
const query = (0, queries_1.GET_LIST_FILE_TRASH)(fields);
|
|
356
|
+
const variables = {
|
|
357
|
+
s3UserId,
|
|
358
|
+
bucketId,
|
|
359
|
+
};
|
|
360
|
+
try {
|
|
361
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
362
|
+
return response.getListFileTrash;
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
console.log(`Error in getListFileTrash: ${error}`);
|
|
366
|
+
throw error;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
restoreFileTrash(s3UserId, bucketId, key, versionId, fields) {
|
|
371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
+
const mutation = (0, mutations_1.RESTORE_FILE_TRASH)(fields);
|
|
373
|
+
const variables = {
|
|
374
|
+
s3UserId,
|
|
375
|
+
bucketId,
|
|
376
|
+
key,
|
|
377
|
+
versionId
|
|
378
|
+
};
|
|
379
|
+
try {
|
|
380
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
381
|
+
return response.restoreFileTrash;
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
console.log(`Error in restoreFileTrash: ${error}`);
|
|
385
|
+
throw error;
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
removeFileTrash(s3UserId, bucketId, files, fields) {
|
|
390
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
391
|
+
const mutation = (0, mutations_1.REMOVE_FILE_TRASH)(fields);
|
|
392
|
+
const variables = {
|
|
393
|
+
s3UserId,
|
|
394
|
+
bucketId,
|
|
395
|
+
files
|
|
396
|
+
};
|
|
397
|
+
try {
|
|
398
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
399
|
+
return response.removeFileTrash;
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
console.log(`Error in removeFileTrash: ${error}`);
|
|
403
|
+
throw error;
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
getListS3DomainByS3UserId(s3UserId, fields) {
|
|
408
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
409
|
+
const query = (0, queries_1.GET_LIST_S3_DOMAIN_BY_S3_USER_ID)(fields);
|
|
410
|
+
const variables = {
|
|
411
|
+
s3UserId,
|
|
412
|
+
};
|
|
413
|
+
try {
|
|
414
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
415
|
+
return response.getListS3DomainByS3UserId;
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
console.log(`Error in getListS3DomainByS3UserId: ${error}`);
|
|
419
|
+
throw error;
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
addS3Domain(s3UserId, domain, byUser, fields) {
|
|
424
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
425
|
+
const query = (0, mutations_1.ADD_S3_DOMAIN)(fields);
|
|
426
|
+
const variables = {
|
|
427
|
+
s3UserId,
|
|
428
|
+
domain,
|
|
429
|
+
byUser,
|
|
430
|
+
};
|
|
431
|
+
try {
|
|
432
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
433
|
+
return response.addS3Domain;
|
|
434
|
+
}
|
|
435
|
+
catch (error) {
|
|
436
|
+
console.log(`Error in addS3Domain: ${error}`);
|
|
437
|
+
throw error;
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
removeS3Domain(s3UserId, domainId, byUser, fields) {
|
|
442
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
443
|
+
const query = (0, mutations_1.REMOVE_S3_DOMAIN)(fields);
|
|
444
|
+
const variables = {
|
|
445
|
+
s3UserId,
|
|
446
|
+
domainId,
|
|
447
|
+
byUser,
|
|
448
|
+
};
|
|
449
|
+
try {
|
|
450
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
451
|
+
return response.removeS3Domain;
|
|
452
|
+
}
|
|
453
|
+
catch (error) {
|
|
454
|
+
console.log(`Error in removeS3Domain: ${error}`);
|
|
455
|
+
throw error;
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
getListCorsByS3UserId(s3UserId, bucketId, fields) {
|
|
460
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
461
|
+
const query = (0, queries_1.GET_LIST_CORS_BY_S3_USER_ID)(fields);
|
|
462
|
+
const variables = {
|
|
463
|
+
s3UserId,
|
|
464
|
+
bucketId,
|
|
465
|
+
};
|
|
466
|
+
try {
|
|
467
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
468
|
+
return response.getListCorsByS3UserId;
|
|
469
|
+
}
|
|
470
|
+
catch (error) {
|
|
471
|
+
console.log(`Error in getListCorsByS3UserId: ${error}`);
|
|
472
|
+
throw error;
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
addCorsBucket(s3UserId, bucketId, allowedMethods, allowedOrigins, allowedHeaders, exposeHeaders, maxAgeSeconds, updateBy, fields) {
|
|
477
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
478
|
+
const query = (0, mutations_1.ADD_CORS_BUCKET)(fields);
|
|
479
|
+
const variables = {
|
|
480
|
+
s3UserId,
|
|
481
|
+
bucketId,
|
|
482
|
+
allowedMethods,
|
|
483
|
+
allowedOrigins,
|
|
484
|
+
allowedHeaders,
|
|
485
|
+
exposeHeaders,
|
|
486
|
+
maxAgeSeconds,
|
|
487
|
+
updateBy,
|
|
488
|
+
};
|
|
489
|
+
try {
|
|
490
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
491
|
+
return response.addCorsBucket;
|
|
492
|
+
}
|
|
493
|
+
catch (error) {
|
|
494
|
+
console.log(`Error in addCorsBucket: ${error}`);
|
|
495
|
+
throw error;
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
updateCorsBucket(s3UserId, bucketId, corsId, allowedMethods, allowedOrigins, allowedHeaders, exposeHeaders, maxAgeSeconds, updateBy, fields) {
|
|
500
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
501
|
+
const query = (0, mutations_1.UPDATE_CORS_BUCKET)(fields);
|
|
502
|
+
const variables = {
|
|
503
|
+
s3UserId,
|
|
504
|
+
bucketId,
|
|
505
|
+
corsId,
|
|
506
|
+
allowedMethods,
|
|
507
|
+
allowedOrigins,
|
|
508
|
+
allowedHeaders,
|
|
509
|
+
exposeHeaders,
|
|
510
|
+
maxAgeSeconds,
|
|
511
|
+
updateBy,
|
|
512
|
+
};
|
|
513
|
+
try {
|
|
514
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
515
|
+
return response.updateCorsBucket;
|
|
516
|
+
}
|
|
517
|
+
catch (error) {
|
|
518
|
+
console.log(`Error in updateCorsBucket: ${error}`);
|
|
519
|
+
throw error;
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
removeCorsBucket(s3UserId, bucketId, corsId, updateBy, fields) {
|
|
524
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
525
|
+
const query = (0, mutations_1.REMOVE_CORS_BUCKET)(fields);
|
|
526
|
+
const variables = {
|
|
527
|
+
s3UserId,
|
|
528
|
+
bucketId,
|
|
529
|
+
corsId,
|
|
530
|
+
updateBy,
|
|
531
|
+
};
|
|
532
|
+
try {
|
|
533
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
534
|
+
return response.removeCorsBucket;
|
|
535
|
+
}
|
|
536
|
+
catch (error) {
|
|
537
|
+
console.log(`Error in removeCorsBucket: ${error}`);
|
|
538
|
+
throw error;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
getListFileOtherVersion(s3UserId, bucketId, key, fields) {
|
|
543
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
544
|
+
const query = (0, queries_1.GET_LIST_FILE_OTHER_VERSION)(fields);
|
|
545
|
+
const variables = {
|
|
546
|
+
s3UserId,
|
|
547
|
+
bucketId,
|
|
548
|
+
key,
|
|
549
|
+
};
|
|
550
|
+
try {
|
|
551
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
552
|
+
return response.getListFileOtherVersion;
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
console.log(`Error in getListFileOtherVersion: ${error}`);
|
|
556
|
+
throw error;
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
restoreFileOtherVersion(s3UserId, bucketId, key, versionId, fields) {
|
|
561
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
+
const mutation = (0, mutations_1.RESTORE_FILE_OTHER_VERSION)(fields);
|
|
563
|
+
const variables = {
|
|
564
|
+
s3UserId,
|
|
565
|
+
bucketId,
|
|
566
|
+
key,
|
|
567
|
+
versionId
|
|
568
|
+
};
|
|
569
|
+
try {
|
|
570
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
571
|
+
return response.restoreFileOtherVersion;
|
|
572
|
+
}
|
|
573
|
+
catch (error) {
|
|
574
|
+
console.log(`Error in restoreFileOtherVersion: ${error}`);
|
|
575
|
+
throw error;
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
removeFileOtherVersion(s3UserId, bucketId, key, versionId, fields) {
|
|
580
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
581
|
+
const mutation = (0, mutations_1.REMOVE_FILE_OTHER_VERSION)(fields);
|
|
582
|
+
const variables = {
|
|
583
|
+
s3UserId,
|
|
584
|
+
bucketId,
|
|
585
|
+
key,
|
|
586
|
+
versionId
|
|
587
|
+
};
|
|
588
|
+
try {
|
|
589
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
590
|
+
return response.removeFileOtherVersion;
|
|
591
|
+
}
|
|
592
|
+
catch (error) {
|
|
593
|
+
console.log(`Error in removeFileOtherVersion: ${error}`);
|
|
594
|
+
throw error;
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
chartInYear(s3UserId, year, month, fields) {
|
|
599
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
600
|
+
const query = (0, queries_1.CHART_IN_YEAR)(fields);
|
|
601
|
+
const variables = {
|
|
602
|
+
s3UserId,
|
|
603
|
+
year,
|
|
604
|
+
month
|
|
605
|
+
};
|
|
606
|
+
try {
|
|
607
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
608
|
+
return response.chartInYear;
|
|
609
|
+
}
|
|
610
|
+
catch (error) {
|
|
611
|
+
console.log(`Error in chartInYear: ${error}`);
|
|
612
|
+
throw error;
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
}
|
|
258
616
|
}
|
|
259
617
|
exports.StorageS3Service = StorageS3Service;
|