@longvansoftware/service-js-client 1.19.8 → 1.19.9

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.
@@ -19,6 +19,8 @@ export declare const environmentEndpoints: {
19
19
  cloud_rest: string;
20
20
  accounting_service: string;
21
21
  quicklab_service: string;
22
+ remote_access_service: string;
23
+ storage_s3: string;
22
24
  };
23
25
  live: {
24
26
  product: string;
@@ -40,5 +42,7 @@ export declare const environmentEndpoints: {
40
42
  cloud_rest: string;
41
43
  accounting_service: string;
42
44
  quicklab_service: string;
45
+ remote_access_service: string;
46
+ storage_s3: string;
43
47
  };
44
48
  };
@@ -22,6 +22,9 @@ exports.environmentEndpoints = {
22
22
  cloud_rest: "https://api-gateway.dev.longvan.vn/cloud-service-api/v1",
23
23
  accounting_service: "https://api-gateway.dev.longvan.vn/accounting-service/graphql/",
24
24
  quicklab_service: "https://portal.dev.longvan.vn/quicklab-api/graphql",
25
+ remote_access_service: "https://api-gateway.dev.longvan.vn/remote-access-service/graphql",
26
+ // storage_s3: "https://portal.dev.longvan.vn/storage-s3-api/graphql",
27
+ storage_s3: "https://storage-s3-api.dev.longvan.vn/storage-s3-api/graphql",
25
28
  },
26
29
  live: {
27
30
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -43,5 +46,8 @@ exports.environmentEndpoints = {
43
46
  cloud_rest: "https://api-gateway.longvan.vn/cloud-service-api/v1",
44
47
  accounting_service: "https://api-gateway.longvan.vn/accounting-service/graphql/",
45
48
  quicklab_service: "https://portal.longvan.vn/quicklab-api/graphql",
49
+ remote_access_service: "https://api-gateway.longvan.vn/remote-access-service/graphql",
50
+ // storage_s3: "https://portal.longvan.vn/storage-s3-api/graphql",
51
+ storage_s3: "https://storage-s3-api.longvan.vn/storage-s3-api/graphql",
46
52
  },
47
53
  };
@@ -13,7 +13,6 @@ exports.DEPOSIT_WALLET = (0, graphql_tag_1.gql) `
13
13
  $orderNote: String
14
14
  $paymentMethodCode: String
15
15
  $sourcePayment: String
16
- $paymentType: String
17
16
  $returnUrl: String
18
17
  $createBy: String
19
18
  ) {
@@ -27,7 +26,6 @@ exports.DEPOSIT_WALLET = (0, graphql_tag_1.gql) `
27
26
  orderNote: $orderNote
28
27
  paymentMethodCode: $paymentMethodCode
29
28
  sourcePayment: $sourcePayment
30
- paymentType: $paymentType
31
29
  returnUrl: $returnUrl
32
30
  createBy: $createBy
33
31
  ) {
@@ -1,19 +1,21 @@
1
- export declare const CHECK_DOMAIN_NAME_AVAILABLE: import("graphql").DocumentNode;
2
- export declare const CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC: import("graphql").DocumentNode;
3
- export declare const GET_WHOIS_DOMAIN_INFO: import("graphql").DocumentNode;
4
- export declare const SERVICE_DETAIL: import("graphql").DocumentNode;
5
- export declare const GET_MAIL_RESOURCE: import("graphql").DocumentNode;
6
- export declare const GET_USER_MAIL_HOSTING: import("graphql").DocumentNode;
7
- export declare const SERVICE_TYPE: import("graphql").DocumentNode;
8
- export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
9
- export declare const GET_PRODUCTS_OF_SERVICE: import("graphql").DocumentNode;
10
- export declare const GET_IPS_OF_SERVICE: import("graphql").DocumentNode;
11
- export declare const GET_SERVICES_BY_ORDER_ID: import("graphql").DocumentNode;
12
- export declare const GET_SERVICE_TYPE_LIST: import("graphql").DocumentNode;
13
- export declare const GET_DOMAIN_CONTACTS: import("graphql").DocumentNode;
14
- export declare const GET_OWNERS_BY_CUSTOMER_ID: import("graphql").DocumentNode;
15
- export declare const GET_CONTACTS_BY_OWNER_ID: import("graphql").DocumentNode;
16
- export declare const GET_DOMAIN_SUPPLIER: import("graphql").DocumentNode;
17
- export declare const CHECK_DOMAIN_EXIST: import("graphql").DocumentNode;
18
- export declare const SEARCH_ACTIONS: import("graphql").DocumentNode;
19
- export declare const GET_ELASTIC_CLOUD_RESOURCE: import("graphql").DocumentNode;
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
+ `;
@@ -15,6 +15,9 @@ export declare const REMOVE_FILE: (fields?: string[]) => DocumentNode;
15
15
  export declare const UPDATE_ACL_PERMISSION_BUCKET: (fields?: string[]) => DocumentNode;
16
16
  export declare const UPDATE_BUCKET_VERSIONING: (fields?: string[]) => DocumentNode;
17
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;
18
21
  export declare const ADD_S3_DOMAIN: (fields?: string[]) => DocumentNode;
19
22
  export declare const REMOVE_S3_DOMAIN: (fields?: string[]) => DocumentNode;
20
23
  export declare const ADD_CORS_BUCKET: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REMOVE_CORS_BUCKET = exports.UPDATE_CORS_BUCKET = exports.ADD_CORS_BUCKET = exports.REMOVE_S3_DOMAIN = exports.ADD_S3_DOMAIN = 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;
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 ');
@@ -333,6 +333,70 @@ const RESTORE_FILE_TRASH = (fields = []) => {
333
333
  `;
334
334
  };
335
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;
336
400
  const ADD_S3_DOMAIN = (fields = []) => {
337
401
  const fieldStr = fields.join('\n ');
338
402
  const hasFields = fields.length > 0;
@@ -5,4 +5,5 @@ export declare const GET_LIST_OBJECT: (fields?: string[]) => DocumentNode;
5
5
  export declare const GET_LIST_FILE_TRASH: (fields?: string[]) => DocumentNode;
6
6
  export declare const GET_LIST_S3_DOMAIN_BY_S3_USER_ID: (fields?: string[]) => DocumentNode;
7
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;
8
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.CHART_IN_YEAR = 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;
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 ');
@@ -74,6 +74,18 @@ const GET_LIST_CORS_BY_S3_USER_ID = (fields = []) => {
74
74
  `;
75
75
  };
76
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;
77
89
  const CHART_IN_YEAR = (fields = []) => {
78
90
  const fieldStr = fields.join('\n ');
79
91
  const hasFields = fields.length > 0;
@@ -17,6 +17,8 @@ import { CloudRestService } from "./cloud_rest";
17
17
  import { OrderCloudRestService } from "./order_cloud_rest";
18
18
  import { AccountingService } from "./accounting_service";
19
19
  import { QuicklabService } from "./quicklab_service";
20
+ import { RemoteAccessService } from "./remote_access_service";
21
+ import { StorageS3Service } from "./storage_s3";
20
22
  export interface Endpoints {
21
23
  product: string;
22
24
  crm: string;
@@ -37,6 +39,8 @@ export interface Endpoints {
37
39
  order_cloud_rest: string;
38
40
  accounting_service: string;
39
41
  quicklab_service: string;
42
+ remote_access_service: string;
43
+ storage_s3: string;
40
44
  }
41
45
  export declare class SDK {
42
46
  orgId: string;
@@ -62,6 +66,8 @@ export declare class SDK {
62
66
  order_cloud_rest: OrderCloudRestService;
63
67
  accounting_service: AccountingService;
64
68
  quicklab_service: QuicklabService;
69
+ remote_access_service: RemoteAccessService;
70
+ storage_s3: StorageS3Service;
65
71
  token: string | null;
66
72
  private endpoints;
67
73
  constructor(orgId: string, storeId: string, storefrontAccessToken: string, environment: string);
@@ -23,6 +23,8 @@ const cloud_rest_1 = require("./cloud_rest");
23
23
  const order_cloud_rest_1 = require("./order_cloud_rest");
24
24
  const accounting_service_1 = require("./accounting_service");
25
25
  const quicklab_service_1 = require("./quicklab_service");
26
+ const remote_access_service_1 = require("./remote_access_service");
27
+ const storage_s3_1 = require("./storage_s3");
26
28
  class SDK {
27
29
  constructor(orgId, storeId, storefrontAccessToken, environment) {
28
30
  this.orgId = orgId;
@@ -56,6 +58,8 @@ class SDK {
56
58
  this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, orgId, storeId);
57
59
  this.accounting_service = new accounting_service_1.AccountingService(this.endpoints.accounting_service, orgId, storeId);
58
60
  this.quicklab_service = new quicklab_service_1.QuicklabService(this.endpoints.quicklab_service, orgId, storeId);
61
+ this.remote_access_service = new remote_access_service_1.RemoteAccessService(this.endpoints.remote_access_service, orgId, storeId);
62
+ this.storage_s3 = new storage_s3_1.StorageS3Service(this.endpoints.storage_s3, orgId, storeId);
59
63
  // Initialize other services here
60
64
  }
61
65
  setToken(token) {
@@ -80,6 +84,8 @@ class SDK {
80
84
  this.order_cloud_rest.setToken(token);
81
85
  this.accounting_service.setToken(token);
82
86
  this.quicklab_service.setToken(token);
87
+ this.remote_access_service.setToken(token);
88
+ this.storage_s3.setToken(token);
83
89
  // Set token for other services here
84
90
  }
85
91
  // các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
@@ -106,6 +112,8 @@ class SDK {
106
112
  this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, this.orgId, storeId);
107
113
  this.accounting_service = new accounting_service_1.AccountingService(this.endpoints.accounting_service, this.orgId, storeId);
108
114
  this.quicklab_service = new quicklab_service_1.QuicklabService(this.endpoints.quicklab_service, this.orgId, storeId);
115
+ this.remote_access_service = new remote_access_service_1.RemoteAccessService(this.endpoints.remote_access_service, this.orgId, storeId);
116
+ this.storage_s3 = new storage_s3_1.StorageS3Service(this.endpoints.storage_s3, this.orgId, storeId);
109
117
  }
110
118
  }
111
119
  exports.SDK = SDK;
@@ -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;
@@ -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);
@@ -21,6 +21,8 @@ export declare class StorageS3Service extends Service {
21
21
  updateAclPermissionBucket(s3UserId: string, bucketId: string, isPublic: boolean, updateBy: string, fields: string[]): Promise<any>;
22
22
  updateBucketVersioning(s3UserId: string, bucketId: string, isOn: boolean, updateBy: string, fields: string[]): Promise<any>;
23
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>;
24
26
  getListS3DomainByS3UserId(s3UserId: string, fields: string[]): Promise<any>;
25
27
  addS3Domain(s3UserId: string, domain: string, byUser: string, fields: string[]): Promise<any>;
26
28
  removeS3Domain(s3UserId: string, domainId: string, byUser: string, fields: string[]): Promise<any>;
@@ -28,5 +30,8 @@ export declare class StorageS3Service extends Service {
28
30
  addCorsBucket(s3UserId: string, bucketId: string, allowedMethods: string[], allowedOrigins: string[], allowedHeaders: string[], exposeHeaders: string[], maxAgeSeconds: number, updateBy: string, fields: string[]): Promise<any>;
29
31
  updateCorsBucket(s3UserId: string, bucketId: string, corsId: string, allowedMethods: string[], allowedOrigins: string[], allowedHeaders: string[], exposeHeaders: string[], maxAgeSeconds: number, updateBy: string, fields: string[]): Promise<any>;
30
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>;
31
36
  chartInYear(s3UserId: string, year: number, fields: string[]): Promise<any>;
32
37
  }
@@ -367,6 +367,43 @@ class StorageS3Service extends serviceSDK_1.Service {
367
367
  }
368
368
  });
369
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
+ }
370
407
  getListS3DomainByS3UserId(s3UserId, fields) {
371
408
  return __awaiter(this, void 0, void 0, function* () {
372
409
  const query = (0, queries_1.GET_LIST_S3_DOMAIN_BY_S3_USER_ID)(fields);
@@ -502,6 +539,62 @@ class StorageS3Service extends serviceSDK_1.Service {
502
539
  }
503
540
  });
504
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
+ }
505
598
  chartInYear(s3UserId, year, fields) {
506
599
  return __awaiter(this, void 0, void 0, function* () {
507
600
  const query = (0, queries_1.CHART_IN_YEAR)(fields);
@@ -4,3 +4,7 @@ export interface FileInfoInput {
4
4
  size: number;
5
5
  contentType: string;
6
6
  }
7
+ export interface FileTrashInput {
8
+ key: string;
9
+ versionId: string;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.19.8",
3
+ "version": "1.19.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [
@@ -1,14 +0,0 @@
1
- import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
2
- import { DocumentNode } from "graphql";
3
- export declare class Service {
4
- protected token: string | null;
5
- protected client: ApolloClient<NormalizedCacheObject>;
6
- protected orgId: string;
7
- protected storeId: string;
8
- protected endpoint: string;
9
- constructor(endpoint: string, orgId: string, storeId: string);
10
- setToken(token: string): void;
11
- protected graphqlQuery(query: DocumentNode, variables: any): Promise<any>;
12
- protected graphqlMutation(mutation: DocumentNode, variables: any): Promise<any>;
13
- protected restApiCallWithToken(path: string, method: "GET" | "POST" | "PUT" | "DELETE", data?: any, headers?: any): Promise<any>;
14
- }
@@ -1,101 +0,0 @@
1
- "use strict";
2
- // src/service.ts
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.Service = void 0;
17
- const client_1 = require("@apollo/client");
18
- const axios_1 = __importDefault(require("axios"));
19
- class Service {
20
- constructor(endpoint, orgId, storeId) {
21
- this.token = null;
22
- this.client = new client_1.ApolloClient({
23
- uri: endpoint,
24
- cache: new client_1.InMemoryCache(),
25
- defaultOptions: {
26
- query: {
27
- fetchPolicy: "network-only",
28
- },
29
- },
30
- });
31
- this.orgId = orgId;
32
- this.storeId = storeId;
33
- this.endpoint = endpoint;
34
- }
35
- setToken(token) {
36
- this.token = token;
37
- }
38
- // setOrgId(orgId: string) {
39
- // this.orgId = orgId;
40
- // }
41
- graphqlQuery(query, variables) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- try {
44
- const { data, errors } = yield this.client.query({
45
- query: (0, client_1.gql) `
46
- ${query}
47
- `,
48
- variables,
49
- });
50
- if (errors) {
51
- throw new Error(`GraphQL error! errors: ${errors}`);
52
- }
53
- return data;
54
- }
55
- catch (error) {
56
- console.log(`Error in graphqlQuery: ${error}`);
57
- throw error;
58
- }
59
- });
60
- }
61
- graphqlMutation(mutation, variables) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- try {
64
- const { data, errors } = yield this.client.mutate({
65
- mutation: (0, client_1.gql) `
66
- ${mutation}
67
- `,
68
- variables,
69
- });
70
- if (errors) {
71
- throw new Error(`GraphQL error! errors: ${errors}`);
72
- }
73
- return data;
74
- }
75
- catch (error) {
76
- console.log(`Error in graphqlMutation: ${error}`);
77
- throw error;
78
- }
79
- });
80
- }
81
- restApiCallWithToken(path, method, data, headers) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- try {
84
- const modifiedHeaders = Object.assign(Object.assign({}, headers), { "Partner-Id": this.orgId, "X-Ecomos-Access-Token": this.token });
85
- console.log("🚀 ~ Service ~ modifiedHeaders:", modifiedHeaders);
86
- const response = yield (0, axios_1.default)({
87
- url: this.endpoint + path,
88
- method,
89
- data,
90
- headers: modifiedHeaders,
91
- });
92
- return response.data;
93
- }
94
- catch (error) {
95
- console.log(`Error in restApiCallWithToken: ${error}`);
96
- throw error;
97
- }
98
- });
99
- }
100
- }
101
- exports.Service = Service;
@@ -1 +0,0 @@
1
- export declare function buildFieldString(fields: (string | Record<string, any>)[], indent?: number): string;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildFieldString = void 0;
4
- function buildFieldString(fields, indent = 6) {
5
- const space = " ".repeat(indent);
6
- return fields
7
- .map((field) => {
8
- if (typeof field === "string")
9
- return `${space}${field}`;
10
- const [key, value] = Object.entries(field)[0];
11
- const nested = buildFieldString(value, indent + 2);
12
- return `${space}${key} {\n${nested}\n${space}}`;
13
- })
14
- .join("\n");
15
- }
16
- exports.buildFieldString = buildFieldString;