@longvansoftware/service-js-client 2.8.6 → 2.8.8

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 (49) hide show
  1. package/dist/src/graphql/campaign/queries.d.ts +13 -11
  2. package/dist/src/graphql/campaign/queries.js +39 -111
  3. package/dist/src/graphql/cloudCloud/mutations.d.ts +2 -0
  4. package/dist/src/graphql/cloudCloud/mutations.js +101 -27
  5. package/dist/src/graphql/cloudCloud/queries.js +4 -0
  6. package/dist/src/graphql/computing/mutations.js +4 -0
  7. package/dist/src/graphql/computing/queries.d.ts +1 -0
  8. package/dist/src/graphql/computing/queries.js +6 -1
  9. package/dist/src/graphql/orderCloud/mutations.d.ts +3 -1
  10. package/dist/src/graphql/orderCloud/mutations.js +21 -5
  11. package/dist/src/graphql/paymentV2/mutations.d.ts +1 -0
  12. package/dist/src/graphql/paymentV2/mutations.js +23 -37
  13. package/dist/src/graphql/paymentV2/queries.d.ts +2 -0
  14. package/dist/src/graphql/paymentV2/queries.js +58 -1
  15. package/dist/src/graphql/storefont/mutation.d.ts +4 -0
  16. package/dist/src/graphql/storefont/mutation.js +56 -0
  17. package/dist/src/graphql/storefont/queries.d.ts +5 -0
  18. package/dist/src/graphql/storefont/queries.js +106 -0
  19. package/dist/src/graphql/storefront/query.d.ts +3 -0
  20. package/dist/src/graphql/storefront/query.js +41 -0
  21. package/dist/src/graphql/tag/mutations.d.ts +2 -0
  22. package/dist/src/graphql/tag/mutations.js +44 -0
  23. package/dist/src/graphql/tag/queries.d.ts +1 -0
  24. package/dist/src/graphql/tag/queries.js +20 -0
  25. package/dist/src/lib/campaign/index.d.ts +1 -0
  26. package/dist/src/lib/campaign/index.js +69 -12
  27. package/dist/src/lib/cloudCloud/index.d.ts +1 -0
  28. package/dist/src/lib/cloudCloud/index.js +16 -0
  29. package/dist/src/lib/computing/index.d.ts +2 -1
  30. package/dist/src/lib/computing/index.js +19 -1
  31. package/dist/src/lib/imageGateway/index.d.ts +6 -0
  32. package/dist/src/lib/imageGateway/index.js +18 -0
  33. package/dist/src/lib/orderCloud/index.d.ts +2 -0
  34. package/dist/src/lib/orderCloud/index.js +47 -1
  35. package/dist/src/lib/paymentV2/index.d.ts +11 -1
  36. package/dist/src/lib/paymentV2/index.js +55 -14
  37. package/dist/src/lib/portal/index.d.ts +10 -2
  38. package/dist/src/lib/portal/index.js +171 -11
  39. package/dist/src/lib/storefont/index.d.ts +23 -0
  40. package/dist/src/lib/storefont/index.js +160 -0
  41. package/dist/src/lib/storefront/index.d.ts +2 -0
  42. package/dist/src/lib/storefront/index.js +39 -0
  43. package/dist/src/lib/tag/index.d.ts +7 -0
  44. package/dist/src/lib/tag/index.js +61 -0
  45. package/package.json +1 -1
  46. package/dist/src/lib/service.d.ts +0 -14
  47. package/dist/src/lib/service.js +0 -101
  48. package/dist/src/utils/build-field-string.d.ts +0 -1
  49. package/dist/src/utils/build-field-string.js +0 -16
@@ -0,0 +1,4 @@
1
+ import { DocumentNode } from "graphql";
2
+ export declare const QUICK_ADD_ORDER_ITEM: DocumentNode;
3
+ export declare const MERGE_ORDER_CART: (fields?: string[]) => DocumentNode;
4
+ export declare const UPDATE_ORDER_LINE_ITEM_RESOURCE: DocumentNode;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UPDATE_ORDER_LINE_ITEM_RESOURCE = exports.MERGE_ORDER_CART = exports.QUICK_ADD_ORDER_ITEM = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ const helpers_1 = require("../../utils/helpers");
6
+ exports.QUICK_ADD_ORDER_ITEM = (0, graphql_tag_1.gql) `
7
+ mutation QuickAddOrderItem(
8
+ $partnerId: String!
9
+ $storeId: String!
10
+ $input: QuickAddOrderItemInput!
11
+ ) {
12
+ quickAddOrderItem(partnerId: $partnerId, storeId: $storeId, input: $input) {
13
+ status
14
+ message
15
+ }
16
+ }
17
+ `;
18
+ const MERGE_ORDER_CART = (fields = []) => {
19
+ return (0, graphql_tag_1.gql) `
20
+ mutation MergeOrderCart(
21
+ $oldCartId: String!
22
+ $newCartId: String!
23
+ $actorId: String!
24
+ $isAllowedToMergeItem: Boolean!
25
+ ) {
26
+ mergeOrderCart(
27
+ input: {
28
+ oldCartId: $oldCartId
29
+ newCartId: $newCartId
30
+ actorId: $actorId
31
+ isAllowedToMergeItem: $isAllowedToMergeItem
32
+ }
33
+ ) ${(0, helpers_1.hasFields)(fields) ? `{ ${(0, helpers_1.joinField)(fields)} }` : ""}
34
+ }
35
+ `;
36
+ };
37
+ exports.MERGE_ORDER_CART = MERGE_ORDER_CART;
38
+ exports.UPDATE_ORDER_LINE_ITEM_RESOURCE = (0, graphql_tag_1.gql) `
39
+ mutation updateOrderLineItemResource(
40
+ $partnerId: String!
41
+ $orderId: String!
42
+ $lineItemId: String!
43
+ $input: ProductConfigurationInput!
44
+ ) {
45
+ updateOrderLineItemResource(
46
+ partnerId: $partnerId
47
+ orderId: $orderId
48
+ lineItemId: $lineItemId
49
+ input: $input
50
+ ) {
51
+ status
52
+ message
53
+ lineItem
54
+ }
55
+ }
56
+ `;
@@ -0,0 +1,5 @@
1
+ export declare const GET_REVENUE_STATISTIC_BY_PRODUCT: import("graphql").DocumentNode;
2
+ export declare const GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY: import("graphql").DocumentNode;
3
+ export declare const GET_FIRST_TRIAL_TREATMENT_MONTHLY_REPORT: import("graphql").DocumentNode;
4
+ export declare const GET_FIRST_TRIAL_TREATMENT_MONTHLY_DETAIL: import("graphql").DocumentNode;
5
+ export declare const GET_FIRST_TRIAL_TREATMENT_REMAINING_USES_REPORT: import("graphql").DocumentNode;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_FIRST_TRIAL_TREATMENT_REMAINING_USES_REPORT = exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_DETAIL = exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_REPORT = exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = exports.GET_REVENUE_STATISTIC_BY_PRODUCT = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.GET_REVENUE_STATISTIC_BY_PRODUCT = (0, graphql_tag_1.gql) `
6
+ query GetRevenueStatisticByProduct($input: ProductStatisticPagedInput!) {
7
+ getRevenueStatisticByProduct(input: $input) {
8
+ totalElements
9
+ totalPages
10
+ page
11
+ size
12
+ content {
13
+ id
14
+ name
15
+ sku
16
+ image
17
+ productParentId
18
+ totalQuantity
19
+ inventory
20
+ }
21
+ }
22
+ }
23
+ `;
24
+ exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = (0, graphql_tag_1.gql) `
25
+ query GetRevenueStatisticByGroupOrCategory(
26
+ $input: ProductStatisticInput!
27
+ $groupBy: StatisticGroupBy!
28
+ ) {
29
+ getRevenueStatisticByGroupOrCategory(input: $input, groupBy: $groupBy) {
30
+ totalElements
31
+ totalPages
32
+ page
33
+ size
34
+ content {
35
+ id
36
+ name
37
+ totalOrders
38
+ totalPriceOfSales
39
+ totalPriceOfService
40
+ totalPriceOfRenewals
41
+ totalPrice
42
+ totalNotPayYet
43
+ }
44
+ }
45
+ }
46
+ `;
47
+ exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_REPORT = (0, graphql_tag_1.gql) `
48
+ query GetFirstTrialTreatmentMonthlyReport(
49
+ $storeIds: [String!]
50
+ $monthCount: Int
51
+ ) {
52
+ getFirstTrialTreatmentMonthlyReport(
53
+ storeIds: $storeIds
54
+ monthCount: $monthCount
55
+ ) {
56
+ totalFirstTrialCount
57
+ totalNewTreatmentCount
58
+ items {
59
+ month
60
+ firstTrialCount
61
+ newTreatmentCount
62
+ }
63
+ }
64
+ }
65
+ `;
66
+ exports.GET_FIRST_TRIAL_TREATMENT_MONTHLY_DETAIL = (0, graphql_tag_1.gql) `
67
+ query GetFirstTrialTreatmentMonthlyDetail(
68
+ $month: String!
69
+ $storeIds: [String!]
70
+ ) {
71
+ getFirstTrialTreatmentMonthlyDetail(month: $month, storeIds: $storeIds) {
72
+ month
73
+ totalFirstTrialCount
74
+ totalNewTreatmentCount
75
+ items {
76
+ salePartyId
77
+ saleName
78
+ firstTrialCount
79
+ newTreatmentCount
80
+ }
81
+ }
82
+ }
83
+ `;
84
+ exports.GET_FIRST_TRIAL_TREATMENT_REMAINING_USES_REPORT = (0, graphql_tag_1.gql) `
85
+ query GetFirstTrialTreatmentRemainingUsesReport($storeIds: [String!]) {
86
+ getFirstTrialTreatmentRemainingUsesReport(storeIds: $storeIds) {
87
+ totalOutOfUsesCount
88
+ totalUnderThreeUsesCount
89
+ totalUnderFiveUsesCount
90
+ items {
91
+ productId
92
+ productName
93
+ totalUses
94
+ outOfUsesCount
95
+ underThreeUsesCount
96
+ underFiveUsesCount
97
+ }
98
+ remainingUsesRanges {
99
+ key
100
+ displayThreshold
101
+ from
102
+ to
103
+ }
104
+ }
105
+ }
106
+ `;
@@ -0,0 +1,3 @@
1
+ import { DocumentNode } from "graphql";
2
+ export declare const GET_REFERRAL_CODES: (fields?: string[]) => DocumentNode;
3
+ export declare const GET_REFERRAL_CODE_DETAIL: (fields?: string[]) => DocumentNode;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_REFERRAL_CODE_DETAIL = exports.GET_REFERRAL_CODES = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ const helpers_1 = require("../../utils/helpers");
6
+ const GET_REFERRAL_CODES = (fields = []) => {
7
+ return (0, graphql_tag_1.gql) `
8
+ query ReferralCodes(
9
+ $partnerId: String!
10
+ $ownerReferralId: String!
11
+ $size: Int
12
+ $page: Int
13
+ $onlyWithBalance: Boolean
14
+ $status: String
15
+ ) {
16
+ referralCodes(
17
+ partnerId: $partnerId
18
+ ownerReferralId: $ownerReferralId
19
+ size: $size
20
+ page: $page
21
+ onlyWithBalance: $onlyWithBalance
22
+ status: $status
23
+ ) ${(0, helpers_1.hasFields)(fields) ? `{ ${(0, helpers_1.joinField)(fields)} }` : ""}
24
+ }
25
+ `;
26
+ };
27
+ exports.GET_REFERRAL_CODES = GET_REFERRAL_CODES;
28
+ const GET_REFERRAL_CODE_DETAIL = (fields = []) => {
29
+ return (0, graphql_tag_1.gql) `
30
+ query ReferralCodeDetail(
31
+ $partnerId: String!
32
+ $voucherCode: String!
33
+ ) {
34
+ referralCodeDetail(
35
+ partnerId: $partnerId
36
+ voucherCode: $voucherCode
37
+ ) ${(0, helpers_1.hasFields)(fields) ? `{ ${(0, helpers_1.joinField)(fields)} }` : ""}
38
+ }
39
+ `;
40
+ };
41
+ exports.GET_REFERRAL_CODE_DETAIL = GET_REFERRAL_CODE_DETAIL;
@@ -0,0 +1,2 @@
1
+ export declare const ADD_TAG_TO_TAG_GROUP: import("graphql").DocumentNode;
2
+ export declare const REMOVE_TAG_TO_TAG_GROUP: import("graphql").DocumentNode;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REMOVE_TAG_TO_TAG_GROUP = exports.ADD_TAG_TO_TAG_GROUP = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.ADD_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
6
+ mutation AddTagToTagGroup(
7
+ $resourceId: String!
8
+ $resourceType: String!
9
+ $tagId: String!
10
+ $tagGroupId: String
11
+ $addedBy: String!
12
+ ) {
13
+ addTagToTagGroup(
14
+ resourceId: $resourceId
15
+ resourceType: $resourceType
16
+ tagId: $tagId
17
+ tagGroupId: $tagGroupId
18
+ addedBy: $addedBy
19
+ ) {
20
+ code
21
+ message
22
+ }
23
+ }
24
+ `;
25
+ exports.REMOVE_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
26
+ mutation RemoveTagToTagGroup(
27
+ $resourceId: String!
28
+ $resourceType: String!
29
+ $tagId: String!
30
+ $tagGroupId: String
31
+ $updateBy: String!
32
+ ) {
33
+ removeTagToTagGroup(
34
+ resourceId: $resourceId
35
+ resourceType: $resourceType
36
+ tagId: $tagId
37
+ tagGroupId: $tagGroupId
38
+ updateBy: $updateBy
39
+ ) {
40
+ code
41
+ message
42
+ }
43
+ }
44
+ `;
@@ -0,0 +1 @@
1
+ export declare const GET_RESULT_TAG: import("graphql").DocumentNode;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_RESULT_TAG = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.GET_RESULT_TAG = (0, graphql_tag_1.gql) `
6
+ query GetResultTag($resourceId: String!, $resourceType: String!) {
7
+ getResultTag(resourceId: $resourceId, resourceType: $resourceType) {
8
+ id
9
+ title
10
+ items {
11
+ id
12
+ title
13
+ items {
14
+ id
15
+ title
16
+ }
17
+ }
18
+ }
19
+ }
20
+ `;
@@ -19,4 +19,5 @@ export declare class CampaignService extends Service {
19
19
  searchProductGiftPromotionResponse(productIds: string[], campaignActionId: string): Promise<any>;
20
20
  getCampaign(id: string): Promise<any>;
21
21
  searchProductPricePromotionResponse(campaignId: string, campaignActionId: string, statusActive: string): Promise<any>;
22
+ voucherForUserRequest(orderId: string, customerId?: string, paymentMethodId?: string, shippingCompanyId?: string, pageNumber?: number, pageSize?: number, fields?: string[]): Promise<any>;
22
23
  }
@@ -30,7 +30,7 @@ class CampaignService extends serviceSDK_1.Service {
30
30
  partyId: this.orgId,
31
31
  productStoreId: this.storeId,
32
32
  customerId,
33
- campaignActionType,
33
+ campaignActionType
34
34
  };
35
35
  try {
36
36
  const response = yield this.graphqlQuery(query, variables);
@@ -54,7 +54,7 @@ class CampaignService extends serviceSDK_1.Service {
54
54
  customerId,
55
55
  excludeExpired,
56
56
  pageNumber,
57
- pageSize,
57
+ pageSize
58
58
  };
59
59
  try {
60
60
  const response = yield this.graphqlQuery(query, variables);
@@ -73,7 +73,7 @@ class CampaignService extends serviceSDK_1.Service {
73
73
  partyId: this.orgId,
74
74
  productStoreId: this.storeId,
75
75
  customerId,
76
- voucherCode,
76
+ voucherCode
77
77
  };
78
78
  try {
79
79
  const response = yield this.graphqlQuery(query, variables);
@@ -92,7 +92,7 @@ class CampaignService extends serviceSDK_1.Service {
92
92
  partyId: this.orgId,
93
93
  productStoreId: this.storeId,
94
94
  campaignActionType,
95
- customerId,
95
+ customerId
96
96
  };
97
97
  try {
98
98
  const response = yield this.graphqlQuery(query, variables);
@@ -110,7 +110,7 @@ class CampaignService extends serviceSDK_1.Service {
110
110
  partyId: this.orgId,
111
111
  productStoreId: this.storeId,
112
112
  productId,
113
- productPrice,
113
+ productPrice
114
114
  };
115
115
  try {
116
116
  const response = yield this.graphqlQuery(query, variables);
@@ -131,7 +131,7 @@ class CampaignService extends serviceSDK_1.Service {
131
131
  campaignActionId,
132
132
  customerId,
133
133
  excludeExpired,
134
- isPageAble,
134
+ isPageAble
135
135
  };
136
136
  try {
137
137
  const response = yield this.graphqlQuery(query, variables);
@@ -149,7 +149,7 @@ class CampaignService extends serviceSDK_1.Service {
149
149
  partyId: this.orgId,
150
150
  voucherCode,
151
151
  userId,
152
- affiliateId,
152
+ affiliateId
153
153
  };
154
154
  try {
155
155
  const response = yield this.graphqlMutation(query, variables);
@@ -169,7 +169,7 @@ class CampaignService extends serviceSDK_1.Service {
169
169
  campaignId: campaignId,
170
170
  campaignActionId: campaignActionId,
171
171
  excludeExpired: true,
172
- isBirthday: isBirthday,
172
+ isBirthday: isBirthday
173
173
  };
174
174
  try {
175
175
  const response = yield this.graphqlQuery(query, variables);
@@ -184,7 +184,7 @@ class CampaignService extends serviceSDK_1.Service {
184
184
  return __awaiter(this, void 0, void 0, function* () {
185
185
  const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
186
186
  const variables = {
187
- id,
187
+ id
188
188
  };
189
189
  try {
190
190
  const response = yield this.graphqlQuery(query, variables);
@@ -203,7 +203,7 @@ class CampaignService extends serviceSDK_1.Service {
203
203
  storeId: this.storeId,
204
204
  productIds: productIds,
205
205
  campaignActionId: campaignActionId,
206
- sort: { asc: true, key: "createdStamp" },
206
+ sort: { asc: true, key: "createdStamp" }
207
207
  };
208
208
  try {
209
209
  const response = yield this.graphqlQuery(query, variables);
@@ -218,7 +218,7 @@ class CampaignService extends serviceSDK_1.Service {
218
218
  return __awaiter(this, void 0, void 0, function* () {
219
219
  const query = queries_1.GET_CAMPAIGN;
220
220
  const variables = {
221
- id,
221
+ id
222
222
  };
223
223
  try {
224
224
  const response = yield this.graphqlQuery(query, variables);
@@ -237,7 +237,7 @@ class CampaignService extends serviceSDK_1.Service {
237
237
  campaignId,
238
238
  campaignActionId,
239
239
  statusActive,
240
- sort: { asc: true, key: "productId" },
240
+ sort: { asc: true, key: "productId" }
241
241
  };
242
242
  try {
243
243
  const response = yield this.graphqlQuery(query, variables);
@@ -248,5 +248,62 @@ class CampaignService extends serviceSDK_1.Service {
248
248
  }
249
249
  });
250
250
  }
251
+ voucherForUserRequest(orderId_1) {
252
+ return __awaiter(this, arguments, void 0, function* (orderId, customerId = "", paymentMethodId, shippingCompanyId, pageNumber = 0, pageSize = 20, fields = [
253
+ `content {
254
+ id
255
+ voucherCode
256
+ isBirthday
257
+ discountAmount
258
+ discountPercent
259
+ usageLimitPerVoucher
260
+ numberOfTimeUsed
261
+ maximumDiscount
262
+ maximumDiscountType
263
+ memberLevel
264
+ affiliateId
265
+ description
266
+ usageLimitType
267
+ minimumSpend
268
+ maximumSpend
269
+ expiryDate
270
+ isUsable
271
+ unusableReasons
272
+ remainingAmount
273
+ discountType
274
+ discountValue
275
+ ownerPartyId
276
+ rewardType
277
+ voucherType
278
+ }`,
279
+ "total",
280
+ "pageNumber",
281
+ "pageSize",
282
+ "totalPages",
283
+ "numberOfElements",
284
+ "first",
285
+ "last"
286
+ ]) {
287
+ const query = (0, queries_1.GET_VOUCHER_FOR_USER)(fields);
288
+ const variables = {
289
+ voucherForUserRequest: {
290
+ orderId,
291
+ customerId,
292
+ storeId: this.storeId,
293
+ paymentMethodId,
294
+ shippingCompanyId,
295
+ pageNumber,
296
+ pageSize
297
+ }
298
+ };
299
+ try {
300
+ const res = yield this.graphqlQuery(query, variables);
301
+ return res.getVouchersForUser;
302
+ }
303
+ catch (error) {
304
+ throw error;
305
+ }
306
+ });
307
+ }
251
308
  }
252
309
  exports.CampaignService = CampaignService;
@@ -9,4 +9,5 @@ export declare class CloudCloudService extends Service {
9
9
  updateServiceResource(data: Record<string, any>): Promise<any>;
10
10
  countAvailableBookings(serviceId: string): Promise<any>;
11
11
  recountUsedBookings(serviceId: string, actorId: string): Promise<any>;
12
+ linkUserAccount(ownerId: string, serviceId: string): Promise<any>;
12
13
  }
@@ -138,5 +138,21 @@ class CloudCloudService extends serviceSDK_1.Service {
138
138
  }
139
139
  });
140
140
  }
141
+ linkUserAccount(ownerId, serviceId) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ const mutation = mutations_1.LINK_USER_ACCOUNT;
144
+ const variables = {
145
+ ownerId,
146
+ serviceId
147
+ };
148
+ try {
149
+ const response = yield this.graphqlMutationV2(mutation, variables);
150
+ return response.linkUserAccount;
151
+ }
152
+ catch (error) {
153
+ throw error;
154
+ }
155
+ });
156
+ }
141
157
  }
142
158
  exports.CloudCloudService = CloudCloudService;
@@ -66,7 +66,8 @@ export declare class ComputingService extends Service {
66
66
  computingDetailDynamic(computingId: string, serviceId: string, fields: string[]): Promise<any>;
67
67
  shutdown(computingId: string, isForceShutdown: boolean, actor: string, serviceId: string): Promise<any>;
68
68
  addDisk(computingId: string, size: number, unit: string, datastoreId: string): Promise<any>;
69
- extendDisk(computingId: string): Promise<any>;
69
+ extendDisk(computingId: string, username: string, password: string): Promise<any>;
70
70
  resizeDisk(computingId: string, diskIndex: number, size: number, unit: string): Promise<any>;
71
71
  isTemplateSupportExtendDiskAuto(computingId: string, diskIndex: number): Promise<any>;
72
+ getScriptExtendDisk(templateId: string): Promise<any>;
72
73
  }
@@ -1013,11 +1013,13 @@ class ComputingService extends serviceSDK_1.Service {
1013
1013
  }
1014
1014
  });
1015
1015
  }
1016
- extendDisk(computingId) {
1016
+ extendDisk(computingId, username, password) {
1017
1017
  return __awaiter(this, void 0, void 0, function* () {
1018
1018
  const mutation = mutations_1.EXTEND_DISK;
1019
1019
  const variables = {
1020
1020
  computingId,
1021
+ username,
1022
+ password
1021
1023
  };
1022
1024
  try {
1023
1025
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -1065,5 +1067,21 @@ class ComputingService extends serviceSDK_1.Service {
1065
1067
  }
1066
1068
  });
1067
1069
  }
1070
+ getScriptExtendDisk(templateId) {
1071
+ return __awaiter(this, void 0, void 0, function* () {
1072
+ const query = queries_1.GET_SCRIPT_EXTEND_DISK;
1073
+ const variables = {
1074
+ templateId
1075
+ };
1076
+ try {
1077
+ const response = yield this.graphqlQueryV2(query, variables);
1078
+ return response.getScriptExtendDisk;
1079
+ }
1080
+ catch (error) {
1081
+ console.log(`Error in getScriptExtendDisk: ${error}`);
1082
+ throw error;
1083
+ }
1084
+ });
1085
+ }
1068
1086
  }
1069
1087
  exports.ComputingService = ComputingService;
@@ -0,0 +1,6 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class ImageGateService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ imageProduct(parentId: string, parentType: string, width?: number, height?: number): string;
5
+ imagesProduct(parentId: string, parentType: string, width?: number, height?: number): string;
6
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImageGateService = void 0;
4
+ const serviceSDK_1 = require("../serviceSDK");
5
+ class ImageGateService extends serviceSDK_1.Service {
6
+ constructor(endpoint, orgId, storeId) {
7
+ super(endpoint, orgId, storeId);
8
+ }
9
+ imageProduct(parentId, parentType, width, height) {
10
+ const url = `${this.endpoint}/image-gateway/public/image/${parentType}/${parentId}${width ? `?w=${width}` : ``}${`${height ? `&h=${height}` : ``}`} `;
11
+ return url;
12
+ }
13
+ imagesProduct(parentId, parentType, width, height) {
14
+ const url = `${this.endpoint}/image-gateway/public/images/${parentType}/${parentId}?w=${width}&h=${height}`;
15
+ return url;
16
+ }
17
+ }
18
+ exports.ImageGateService = ImageGateService;
@@ -2,4 +2,6 @@ import { Service } from "../serviceSDK";
2
2
  export declare class OrderCloudService extends Service {
3
3
  constructor(endpoint: string, orgId: string, storeId: string);
4
4
  findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
5
+ mergeOrderCart(oldCartId: string, newCartId: string, actorId: string, fields?: string[]): Promise<any>;
6
+ updateQuantityV2(orderId: string, updateItem: any, updateBy: string): Promise<any>;
5
7
  }
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OrderCloudService = void 0;
13
13
  const serviceSDK_1 = require("../serviceSDK");
14
14
  const queries_1 = require("../../graphql/orderCloud/queries");
15
+ const mutations_1 = require("../../graphql/orderCloud/mutations");
16
+ const mutations_2 = require("../../graphql/cloudCloud/mutations");
15
17
  class OrderCloudService extends serviceSDK_1.Service {
16
18
  constructor(endpoint, orgId, storeId) {
17
19
  super(endpoint, orgId, storeId);
@@ -22,7 +24,7 @@ class OrderCloudService extends serviceSDK_1.Service {
22
24
  const query = queries_1.FIND_ORDER_BY_OWNER_PARTYID;
23
25
  const variables = {
24
26
  partnerId: this.orgId,
25
- ownerPartyId,
27
+ ownerPartyId
26
28
  };
27
29
  try {
28
30
  const response = yield this.graphqlQuery(query, variables);
@@ -33,5 +35,49 @@ class OrderCloudService extends serviceSDK_1.Service {
33
35
  }
34
36
  });
35
37
  }
38
+ mergeOrderCart(oldCartId_1, newCartId_1, actorId_1) {
39
+ return __awaiter(this, arguments, void 0, function* (oldCartId, newCartId, actorId, fields = ["success", "movedItemCount", "skippedItemCount", "oldCartCanceled", "message"]) {
40
+ const mutation = (0, mutations_1.MERGE_ORDER_CART)(fields);
41
+ const variables = {
42
+ oldCartId,
43
+ newCartId,
44
+ actorId
45
+ };
46
+ try {
47
+ const response = yield this.graphqlMutation(mutation, variables);
48
+ return response.mergeOrderCart;
49
+ }
50
+ catch (error) {
51
+ throw error;
52
+ }
53
+ });
54
+ }
55
+ updateQuantityV2(orderId, updateItem, updateBy) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ var _a, _b;
58
+ const mutation = mutations_2.UPDATE_QUANTITY_V2;
59
+ const variables = {
60
+ orderId,
61
+ partnerId: this.orgId,
62
+ updateItemInputs: {
63
+ orderItemId: updateItem.orderItemId,
64
+ price: updateItem.price,
65
+ quantity: updateItem.quantity,
66
+ unitPrice: updateItem.unitPrice,
67
+ unitType: updateItem.unitType,
68
+ campaignId: (_a = updateItem.campaignId) !== null && _a !== void 0 ? _a : null,
69
+ campaignActionId: (_b = updateItem.campaignActionId) !== null && _b !== void 0 ? _b : null
70
+ },
71
+ updateBy
72
+ };
73
+ try {
74
+ const response = yield this.graphqlQuery(mutation, variables);
75
+ return response;
76
+ }
77
+ catch (error) {
78
+ throw error;
79
+ }
80
+ });
81
+ }
36
82
  }
37
83
  exports.OrderCloudService = OrderCloudService;
@@ -2,7 +2,7 @@ import { Service } from "../serviceSDK";
2
2
  export declare class PaymentServiceV2 extends Service {
3
3
  constructor(endpoint: string, orgId: string, storeId: string);
4
4
  paymentsByOrders(orderIds: [string]): Promise<any>;
5
- cancelPayment(paymentId: string, reason: string): Promise<any>;
5
+ cancelPayment(paymentId: string, reason: string, safeMode?: boolean, createBy?: string): Promise<any>;
6
6
  paymentMethods(): Promise<any>;
7
7
  getPaymentMethodTypes(): Promise<any>;
8
8
  paymentInfo(paymentId: string): Promise<any>;
@@ -16,4 +16,14 @@ export declare class PaymentServiceV2 extends Service {
16
16
  getPaymentGatewaysByMethodCode(methodCode: string): Promise<any>;
17
17
  getPaymentMethodTypesV2(storeActive: any, allMethodTypes: boolean): Promise<any>;
18
18
  getTransferInfo(storeId: string, paymentId: string): Promise<any>;
19
+ createPayment(paymentData: {
20
+ totalAmount: number;
21
+ storeID: string;
22
+ partnerCode: string;
23
+ methodCode: string;
24
+ phone?: string;
25
+ email?: string;
26
+ }): Promise<any>;
27
+ paymentMethodsByPartner(partnerCode?: string): Promise<any>;
28
+ getPaymentMethodTypesWithGatewayConfig(partnerId?: string, storeId?: string): Promise<any>;
19
29
  }