@longvansoftware/service-js-client 2.8.8 → 2.9.0
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/config/config.d.ts +2 -0
- package/dist/config/config.js +4 -2
- package/dist/src/graphql/campaign/queries.d.ts +11 -13
- package/dist/src/graphql/campaign/queries.js +111 -39
- package/dist/src/graphql/cashbook/mutation.d.ts +5 -0
- package/dist/src/graphql/cashbook/mutation.js +94 -0
- package/dist/src/graphql/cashbook/query.d.ts +3 -0
- package/dist/src/graphql/cashbook/query.js +27 -0
- package/dist/src/graphql/cloudCloud/mutations.d.ts +0 -2
- package/dist/src/graphql/cloudCloud/mutations.js +27 -101
- package/dist/src/graphql/cloudCloud/queries.js +0 -4
- package/dist/src/graphql/computing/queries.d.ts +1 -0
- package/dist/src/graphql/computing/queries.js +6 -1
- package/dist/src/graphql/crm/queries.d.ts +1 -0
- package/dist/src/graphql/crm/queries.js +20 -1
- package/dist/src/graphql/orderCloud/mutations.d.ts +1 -3
- package/dist/src/graphql/orderCloud/mutations.js +5 -21
- package/dist/src/graphql/paymentV2/mutations.d.ts +0 -1
- package/dist/src/graphql/paymentV2/mutations.js +37 -23
- package/dist/src/graphql/paymentV2/queries.d.ts +0 -2
- package/dist/src/graphql/paymentV2/queries.js +1 -58
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +4 -0
- package/dist/src/lib/campaign/index.d.ts +0 -1
- package/dist/src/lib/campaign/index.js +12 -69
- package/dist/src/lib/cashbook/index.d.ts +23 -3
- package/dist/src/lib/cashbook/index.js +90 -20
- package/dist/src/lib/cloudCloud/index.d.ts +0 -1
- package/dist/src/lib/cloudCloud/index.js +0 -16
- package/dist/src/lib/computing/index.d.ts +1 -0
- package/dist/src/lib/computing/index.js +16 -0
- package/dist/src/lib/crm/index.d.ts +1 -0
- package/dist/src/lib/crm/index.js +17 -0
- package/dist/src/lib/orderCloud/index.d.ts +0 -2
- package/dist/src/lib/orderCloud/index.js +1 -47
- package/dist/src/lib/paymentV2/index.d.ts +1 -11
- package/dist/src/lib/paymentV2/index.js +14 -55
- package/dist/src/lib/portal/index.d.ts +2 -10
- package/dist/src/lib/portal/index.js +11 -171
- package/dist/src/lib/service.d.ts +14 -0
- package/dist/src/lib/service.js +101 -0
- package/dist/src/utils/build-field-string.d.ts +1 -0
- package/dist/src/utils/build-field-string.js +16 -0
- package/package.json +1 -1
- package/dist/src/graphql/storefont/mutation.d.ts +0 -4
- package/dist/src/graphql/storefont/mutation.js +0 -56
- package/dist/src/graphql/storefont/queries.d.ts +0 -5
- package/dist/src/graphql/storefont/queries.js +0 -106
- package/dist/src/graphql/tag/mutations.d.ts +0 -2
- package/dist/src/graphql/tag/mutations.js +0 -44
- package/dist/src/graphql/tag/queries.d.ts +0 -1
- package/dist/src/graphql/tag/queries.js +0 -20
- package/dist/src/lib/imageGateway/index.d.ts +0 -6
- package/dist/src/lib/imageGateway/index.js +0 -18
- package/dist/src/lib/storefont/index.d.ts +0 -23
- package/dist/src/lib/storefont/index.js +0 -160
- package/dist/src/lib/tag/index.d.ts +0 -7
- package/dist/src/lib/tag/index.js +0 -61
package/package.json
CHANGED
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1,5 +0,0 @@
|
|
|
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;
|
|
@@ -1,106 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const GET_RESULT_TAG: import("graphql").DocumentNode;
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export interface QuickAddOrderItemInput {
|
|
3
|
-
orderId: string;
|
|
4
|
-
itemName: string;
|
|
5
|
-
unitPrice: string;
|
|
6
|
-
quantity?: string;
|
|
7
|
-
unit?: string | null;
|
|
8
|
-
itemType?: string | null;
|
|
9
|
-
vatRate?: string | null;
|
|
10
|
-
customAttributes?: any;
|
|
11
|
-
}
|
|
12
|
-
export declare class StorefontService extends Service {
|
|
13
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
14
|
-
setToken(token: string): void;
|
|
15
|
-
getRevenueStatisticByGroupOrCategory(dataQuery: any, groupBy: any): Promise<any>;
|
|
16
|
-
getRevenueStatisticByProduct(dataQuery: any): Promise<any>;
|
|
17
|
-
quickAddOrderItem(input: QuickAddOrderItemInput): Promise<any>;
|
|
18
|
-
getFirstTrialTreatmentMonthlyReport(monthCount: number, storeIds: [string]): Promise<any>;
|
|
19
|
-
getFirstTrialTreatmentMonthlyDetail(month: string, storeIds: [string]): Promise<any>;
|
|
20
|
-
mergeOrderCart(oldCartId: string, newCartId: string, actorId: string, isAllowedToMergeItem: boolean, fields?: string[]): Promise<any>;
|
|
21
|
-
getFirstTrialTreatmentRemainingUsesReport(storeIds: [string]): Promise<any>;
|
|
22
|
-
updateOrderLineItemResource(orderId: string, lineItemId: string, input: any): Promise<any>;
|
|
23
|
-
}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.StorefontService = void 0;
|
|
13
|
-
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
-
const queries_1 = require("../../graphql/storefont/queries");
|
|
15
|
-
const mutation_1 = require("../../graphql/storefont/mutation");
|
|
16
|
-
class StorefontService extends serviceSDK_1.Service {
|
|
17
|
-
constructor(endpoint, orgId, storeId) {
|
|
18
|
-
super(endpoint, orgId, storeId);
|
|
19
|
-
}
|
|
20
|
-
setToken(token) {
|
|
21
|
-
this.token = token;
|
|
22
|
-
}
|
|
23
|
-
getRevenueStatisticByGroupOrCategory(dataQuery, groupBy) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const query = queries_1.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY;
|
|
26
|
-
const variables = {
|
|
27
|
-
input: dataQuery,
|
|
28
|
-
groupBy,
|
|
29
|
-
};
|
|
30
|
-
try {
|
|
31
|
-
const response = yield this.graphqlQueryV4(query, variables);
|
|
32
|
-
return response.getRevenueStatisticByGroupOrCategory;
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
throw error;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
getRevenueStatisticByProduct(dataQuery) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const query = queries_1.GET_REVENUE_STATISTIC_BY_PRODUCT;
|
|
42
|
-
const variables = {
|
|
43
|
-
input: dataQuery,
|
|
44
|
-
};
|
|
45
|
-
try {
|
|
46
|
-
const response = yield this.graphqlQueryV4(query, variables);
|
|
47
|
-
return response.getRevenueStatisticByProduct;
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
throw error;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
quickAddOrderItem(input) {
|
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const variables = {
|
|
57
|
-
partnerId: this.orgId,
|
|
58
|
-
storeId: this.storeId,
|
|
59
|
-
input,
|
|
60
|
-
};
|
|
61
|
-
try {
|
|
62
|
-
const response = yield this.graphqlMutationV2(mutation_1.QUICK_ADD_ORDER_ITEM, variables);
|
|
63
|
-
return response.quickAddOrderItem;
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
throw error;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
getFirstTrialTreatmentMonthlyReport(monthCount, storeIds) {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
const query = queries_1.GET_FIRST_TRIAL_TREATMENT_MONTHLY_REPORT;
|
|
73
|
-
const variables = {
|
|
74
|
-
monthCount,
|
|
75
|
-
storeIds,
|
|
76
|
-
};
|
|
77
|
-
try {
|
|
78
|
-
const response = yield this.graphqlQueryV4(query, variables);
|
|
79
|
-
return response.getFirstTrialTreatmentMonthlyReport;
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
throw error;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
getFirstTrialTreatmentMonthlyDetail(month, storeIds) {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
const query = queries_1.GET_FIRST_TRIAL_TREATMENT_MONTHLY_DETAIL;
|
|
89
|
-
const variables = {
|
|
90
|
-
month,
|
|
91
|
-
storeIds,
|
|
92
|
-
};
|
|
93
|
-
try {
|
|
94
|
-
const response = yield this.graphqlQueryV4(query, variables);
|
|
95
|
-
return response.getFirstTrialTreatmentMonthlyDetail;
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
throw error;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
mergeOrderCart(oldCartId_1, newCartId_1, actorId_1, isAllowedToMergeItem_1) {
|
|
103
|
-
return __awaiter(this, arguments, void 0, function* (oldCartId, newCartId, actorId, isAllowedToMergeItem, fields = [
|
|
104
|
-
"success",
|
|
105
|
-
"movedItemCount",
|
|
106
|
-
"skippedItemCount",
|
|
107
|
-
"oldCartCanceled",
|
|
108
|
-
"message",
|
|
109
|
-
]) {
|
|
110
|
-
const mutation = (0, mutation_1.MERGE_ORDER_CART)(fields);
|
|
111
|
-
const variables = {
|
|
112
|
-
oldCartId,
|
|
113
|
-
newCartId,
|
|
114
|
-
actorId,
|
|
115
|
-
isAllowedToMergeItem,
|
|
116
|
-
};
|
|
117
|
-
try {
|
|
118
|
-
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
119
|
-
return response.mergeOrderCart;
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
throw error;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
getFirstTrialTreatmentRemainingUsesReport(storeIds) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
const query = queries_1.GET_FIRST_TRIAL_TREATMENT_REMAINING_USES_REPORT;
|
|
129
|
-
const variables = {
|
|
130
|
-
storeIds,
|
|
131
|
-
};
|
|
132
|
-
try {
|
|
133
|
-
const response = yield this.graphqlQueryV4(query, variables);
|
|
134
|
-
return response.getFirstTrialTreatmentRemainingUsesReport;
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
throw error;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
updateOrderLineItemResource(orderId, lineItemId, input) {
|
|
142
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
-
const mutation = mutation_1.UPDATE_ORDER_LINE_ITEM_RESOURCE;
|
|
144
|
-
const variables = {
|
|
145
|
-
partnerId: this.orgId,
|
|
146
|
-
orderId,
|
|
147
|
-
lineItemId,
|
|
148
|
-
input,
|
|
149
|
-
};
|
|
150
|
-
try {
|
|
151
|
-
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
152
|
-
return response.updateOrderLineItemResource;
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
throw error;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
exports.StorefontService = StorefontService;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Service } from "../serviceSDK";
|
|
2
|
-
export declare class TagService extends Service {
|
|
3
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
addTagToTagGroup(data: any): Promise<any>;
|
|
5
|
-
removeTagToTagGroup(data: any): Promise<any>;
|
|
6
|
-
getResultTag(resourceId: string, resourceType: string): Promise<any>;
|
|
7
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TagService = void 0;
|
|
13
|
-
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
-
const mutations_1 = require("../../graphql/tag/mutations");
|
|
15
|
-
const queries_1 = require("../../graphql/tag/queries");
|
|
16
|
-
class TagService extends serviceSDK_1.Service {
|
|
17
|
-
constructor(endpoint, orgId, storeId) {
|
|
18
|
-
super(endpoint, orgId, storeId);
|
|
19
|
-
}
|
|
20
|
-
addTagToTagGroup(data) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const mutation = mutations_1.ADD_TAG_TO_TAG_GROUP;
|
|
23
|
-
try {
|
|
24
|
-
const response = yield this.graphqlMutation(mutation, data);
|
|
25
|
-
return response.addTagToTagGroup;
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
throw error;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
removeTagToTagGroup(data) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const mutation = mutations_1.REMOVE_TAG_TO_TAG_GROUP;
|
|
35
|
-
try {
|
|
36
|
-
const response = yield this.graphqlMutation(mutation, data);
|
|
37
|
-
return response.removeTagToTagGroup;
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
throw error;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
getResultTag(resourceId, resourceType) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const queries = queries_1.GET_RESULT_TAG;
|
|
47
|
-
const variables = {
|
|
48
|
-
resourceId,
|
|
49
|
-
resourceType,
|
|
50
|
-
};
|
|
51
|
-
try {
|
|
52
|
-
const response = yield this.graphqlMutationV3(queries, variables);
|
|
53
|
-
return response.getResultTag;
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.TagService = TagService;
|