@longvansoftware/storefront-js-client 4.6.3 → 4.6.5
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 +2 -0
- package/dist/src/graphql/cloudService/queries.d.ts +1 -0
- package/dist/src/graphql/cloudService/queries.js +71 -0
- package/dist/src/graphql/marketplace/mutations.d.ts +3 -0
- package/dist/src/graphql/marketplace/mutations.js +54 -0
- package/dist/src/graphql/marketplace/queries.d.ts +2 -0
- package/dist/src/graphql/marketplace/queries.js +45 -0
- package/dist/src/graphql/product/mutations.js +0 -3
- package/dist/src/graphql/product/queries.js +0 -81
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +5 -0
- package/dist/src/lib/cloudService/index.d.ts +5 -0
- package/dist/src/lib/{dns → cloudService}/index.js +11 -16
- package/dist/src/lib/marketplace/index.d.ts +9 -0
- package/dist/src/lib/marketplace/index.js +106 -0
- package/package.json +1 -1
- package/dist/src/graphql/accounting_service/mutations.d.ts +0 -2
- package/dist/src/graphql/accounting_service/mutations.js +0 -100
- package/dist/src/graphql/accounting_service/queries.d.ts +0 -1
- package/dist/src/graphql/accounting_service/queries.js +0 -62
- package/dist/src/graphql/content_api/queries.d.ts +0 -2
- package/dist/src/graphql/content_api/queries.js +0 -23
- package/dist/src/graphql/crm_camping/mutations.d.ts +0 -1
- package/dist/src/graphql/crm_camping/mutations.js +0 -37
- package/dist/src/graphql/crm_camping/queries.d.ts +0 -14
- package/dist/src/graphql/crm_camping/queries.js +0 -420
- package/dist/src/graphql/orderGraphQL/mutations.d.ts +0 -10
- package/dist/src/graphql/orderGraphQL/mutations.js +0 -410
- package/dist/src/graphql/orderGraphQL/queries.d.ts +0 -10
- package/dist/src/graphql/orderGraphQL/queries.js +0 -480
- package/dist/src/graphql/paymentLV/mutations.d.ts +0 -2
- package/dist/src/graphql/paymentLV/mutations.js +0 -31
- package/dist/src/graphql/paymentLV/queries.d.ts +0 -5
- package/dist/src/graphql/paymentLV/queries.js +0 -135
- package/dist/src/graphql/quicklab_service/mutations.d.ts +0 -8
- package/dist/src/graphql/quicklab_service/mutations.js +0 -171
- package/dist/src/graphql/quicklab_service/queries.d.ts +0 -7
- package/dist/src/graphql/quicklab_service/queries.js +0 -131
- package/dist/src/graphql/remote_access_service/mutations.d.ts +0 -7
- package/dist/src/graphql/remote_access_service/mutations.js +0 -89
- package/dist/src/graphql/remote_access_service/queries.d.ts +0 -2
- package/dist/src/graphql/remote_access_service/queries.js +0 -34
- package/dist/src/graphql/resource_permission/mutations.d.ts +0 -2
- package/dist/src/graphql/resource_permission/mutations.js +0 -65
- package/dist/src/graphql/resource_permission/queries.d.ts +0 -1
- package/dist/src/graphql/resource_permission/queries.js +0 -18
- package/dist/src/graphql/storage_s3/mutations.d.ts +0 -27
- package/dist/src/graphql/storage_s3/mutations.js +0 -603
- package/dist/src/graphql/storage_s3/queries.d.ts +0 -12
- package/dist/src/graphql/storage_s3/queries.js +0 -129
- package/dist/src/lib/accounting_service/index.d.ts +0 -9
- package/dist/src/lib/accounting_service/index.js +0 -69
- package/dist/src/lib/cloud_rest/index.d.ts +0 -17
- package/dist/src/lib/cloud_rest/index.js +0 -101
- package/dist/src/lib/content_api/index.d.ts +0 -7
- package/dist/src/lib/content_api/index.js +0 -43
- package/dist/src/lib/crm_camping/index.d.ts +0 -21
- package/dist/src/lib/crm_camping/index.js +0 -302
- package/dist/src/lib/dns/index.d.ts +0 -7
- package/dist/src/lib/orderGraphQL/index.d.ts +0 -24
- package/dist/src/lib/orderGraphQL/index.js +0 -342
- package/dist/src/lib/order_cloud_rest/index.d.ts +0 -7
- package/dist/src/lib/order_cloud_rest/index.js +0 -39
- package/dist/src/lib/paymentLV/index.d.ts +0 -13
- package/dist/src/lib/paymentLV/index.js +0 -149
- package/dist/src/lib/quicklab_service/index.d.ts +0 -19
- package/dist/src/lib/quicklab_service/index.js +0 -211
- package/dist/src/lib/remote_access_service/index.d.ts +0 -16
- package/dist/src/lib/remote_access_service/index.js +0 -181
- package/dist/src/lib/resource_permission/index.d.ts +0 -9
- package/dist/src/lib/resource_permission/index.js +0 -82
- package/dist/src/lib/service.d.ts +0 -14
- package/dist/src/lib/service.js +0 -101
- package/dist/src/lib/storage_s3/index.d.ts +0 -42
- package/dist/src/lib/storage_s3/index.js +0 -736
- package/dist/src/types/remote_access_service.d.ts +0 -12
- package/dist/src/types/remote_access_service.js +0 -2
- package/dist/src/types/storage_s3.d.ts +0 -10
- package/dist/src/types/storage_s3.js +0 -2
- package/dist/src/utils/build-field-string.d.ts +0 -1
- package/dist/src/utils/build-field-string.js +0 -16
package/dist/config/config.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare const environmentEndpoints: {
|
|
|
32
32
|
orderCloud: string;
|
|
33
33
|
cloudCloud: string;
|
|
34
34
|
truedoc: string;
|
|
35
|
+
marketplace: string;
|
|
35
36
|
};
|
|
36
37
|
live: {
|
|
37
38
|
product: string;
|
|
@@ -62,5 +63,6 @@ export declare const environmentEndpoints: {
|
|
|
62
63
|
orderCloud: string;
|
|
63
64
|
cloudCloud: string;
|
|
64
65
|
truedoc: string;
|
|
66
|
+
marketplace: string;
|
|
65
67
|
};
|
|
66
68
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -35,6 +35,7 @@ exports.environmentEndpoints = {
|
|
|
35
35
|
orderCloud: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql",
|
|
36
36
|
cloudCloud: "https://api-gateway.dev.longvan.vn/cloud-service-api/graphql",
|
|
37
37
|
truedoc: "https://api-gateway.dev.truedoc.vn/bmlconnector/graphql",
|
|
38
|
+
marketplace: "https://api-gateway.dev.longvan.vn/marketplace/graphql",
|
|
38
39
|
},
|
|
39
40
|
live: {
|
|
40
41
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -65,5 +66,6 @@ exports.environmentEndpoints = {
|
|
|
65
66
|
orderCloud: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
|
|
66
67
|
cloudCloud: "https://api-gateway.longvan.vn/cloud-service-api/graphql",
|
|
67
68
|
truedoc: "https://api-gateway.truedoc.vn/bmlconnector/graphql",
|
|
69
|
+
marketplace: "https://api-gateway.longvan.vn/marketplace/graphql",
|
|
68
70
|
},
|
|
69
71
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEARCH_SERVICE = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
|
|
6
|
+
query SearchService($filter: CloudServiceFilterInput) {
|
|
7
|
+
searchService(filter: $filter) {
|
|
8
|
+
total
|
|
9
|
+
offset
|
|
10
|
+
maxResult
|
|
11
|
+
resultList {
|
|
12
|
+
supplierId
|
|
13
|
+
serviceId
|
|
14
|
+
partnerId
|
|
15
|
+
serviceName
|
|
16
|
+
type
|
|
17
|
+
typeName
|
|
18
|
+
status
|
|
19
|
+
statusFulfillment
|
|
20
|
+
ownerId
|
|
21
|
+
startDate
|
|
22
|
+
endDate
|
|
23
|
+
serviceType
|
|
24
|
+
urlPrivate
|
|
25
|
+
urlPublic
|
|
26
|
+
username
|
|
27
|
+
password
|
|
28
|
+
attrs
|
|
29
|
+
description
|
|
30
|
+
productGroupId
|
|
31
|
+
orderId
|
|
32
|
+
actionRequest {
|
|
33
|
+
id
|
|
34
|
+
name
|
|
35
|
+
uri
|
|
36
|
+
type
|
|
37
|
+
}
|
|
38
|
+
billingCycle {
|
|
39
|
+
quantity
|
|
40
|
+
unit
|
|
41
|
+
}
|
|
42
|
+
productConfiguration {
|
|
43
|
+
productId
|
|
44
|
+
productTitle
|
|
45
|
+
productResources {
|
|
46
|
+
name
|
|
47
|
+
quantity
|
|
48
|
+
unit
|
|
49
|
+
productId
|
|
50
|
+
giftProductId
|
|
51
|
+
gift
|
|
52
|
+
giftQuantity
|
|
53
|
+
campaignId
|
|
54
|
+
campaignActionId
|
|
55
|
+
qualify
|
|
56
|
+
idParent
|
|
57
|
+
addQuantity
|
|
58
|
+
defaultQuantity
|
|
59
|
+
title
|
|
60
|
+
price
|
|
61
|
+
unitPrice
|
|
62
|
+
totalResource
|
|
63
|
+
unitGift
|
|
64
|
+
giftDuration
|
|
65
|
+
giftDurationUnit
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REMOVE_PRODUCT_TAG = exports.ADD_PRODUCT_TAG = exports.CREATE_TAG = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.CREATE_TAG = (0, graphql_tag_1.gql) `
|
|
6
|
+
mutation CreateTag($name: String!, $slug: String!, $createdBy: String!) {
|
|
7
|
+
createTag(name: $name, slug: $slug, createdBy: $createdBy) {
|
|
8
|
+
id
|
|
9
|
+
name
|
|
10
|
+
slug
|
|
11
|
+
type
|
|
12
|
+
scope
|
|
13
|
+
storeIds
|
|
14
|
+
selected
|
|
15
|
+
title
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
exports.ADD_PRODUCT_TAG = (0, graphql_tag_1.gql) `
|
|
20
|
+
mutation AddProductTag(
|
|
21
|
+
$productId: String!
|
|
22
|
+
$tagId: String!
|
|
23
|
+
$tagGroupId: String
|
|
24
|
+
$createBy: String!
|
|
25
|
+
) {
|
|
26
|
+
addProductTag(
|
|
27
|
+
productId: $productId
|
|
28
|
+
tagId: $tagId
|
|
29
|
+
tagGroupId: $tagGroupId
|
|
30
|
+
createBy: $createBy
|
|
31
|
+
) {
|
|
32
|
+
status
|
|
33
|
+
message
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
exports.REMOVE_PRODUCT_TAG = (0, graphql_tag_1.gql) `
|
|
38
|
+
mutation RemoveProductTag(
|
|
39
|
+
$productId: String!
|
|
40
|
+
$tagId: String!
|
|
41
|
+
$tagGroupId: String
|
|
42
|
+
$updatedBy: String!
|
|
43
|
+
) {
|
|
44
|
+
removeProductTag(
|
|
45
|
+
productId: $productId
|
|
46
|
+
tagId: $tagId
|
|
47
|
+
tagGroupId: $tagGroupId
|
|
48
|
+
updatedBy: $updatedBy
|
|
49
|
+
) {
|
|
50
|
+
status
|
|
51
|
+
message
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEARCH_TAG = exports.GET_TAGS_BY_PRODUCT_ID = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.GET_TAGS_BY_PRODUCT_ID = (0, graphql_tag_1.gql) `
|
|
6
|
+
query GetTagsByProductId($productId: String!) {
|
|
7
|
+
getTagsByProductId(productId: $productId) {
|
|
8
|
+
id
|
|
9
|
+
title
|
|
10
|
+
items {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
slug
|
|
14
|
+
type
|
|
15
|
+
scope
|
|
16
|
+
storeIds
|
|
17
|
+
selected
|
|
18
|
+
title
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
exports.SEARCH_TAG = (0, graphql_tag_1.gql) `
|
|
24
|
+
query SearchTag($keyword: String, $currentPage: Int, $maxResult: Int) {
|
|
25
|
+
searchTag(
|
|
26
|
+
keyword: $keyword
|
|
27
|
+
currentPage: $currentPage
|
|
28
|
+
maxResult: $maxResult
|
|
29
|
+
) {
|
|
30
|
+
total
|
|
31
|
+
maxResult
|
|
32
|
+
index
|
|
33
|
+
resultList {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
slug
|
|
37
|
+
type
|
|
38
|
+
scope
|
|
39
|
+
storeIds
|
|
40
|
+
selected
|
|
41
|
+
title
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
@@ -131,7 +131,6 @@ exports.CREATE_PRODUCT_TEMPLATES_BY_PARTNER = (0, graphql_tag_1.gql) `
|
|
|
131
131
|
priceTypeName
|
|
132
132
|
priceVaries
|
|
133
133
|
available
|
|
134
|
-
tags
|
|
135
134
|
options
|
|
136
135
|
optionsRelationship
|
|
137
136
|
compareAtPrice
|
|
@@ -206,7 +205,6 @@ exports.CREATE_PRODUCT_FROM_TEMPLATE = (0, graphql_tag_1.gql) `
|
|
|
206
205
|
priceTypeName
|
|
207
206
|
priceVaries
|
|
208
207
|
available
|
|
209
|
-
tags
|
|
210
208
|
options
|
|
211
209
|
optionsRelationship
|
|
212
210
|
compareAtPrice
|
|
@@ -645,7 +643,6 @@ exports.CREATE_PRODUCT = (0, graphql_tag_1.gql) `
|
|
|
645
643
|
priceTypeName
|
|
646
644
|
priceVaries
|
|
647
645
|
available
|
|
648
|
-
tags
|
|
649
646
|
options
|
|
650
647
|
optionsRelationship
|
|
651
648
|
compareAtPrice
|
|
@@ -120,15 +120,6 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
|
|
|
120
120
|
compareAtPrice
|
|
121
121
|
featuredImage
|
|
122
122
|
images
|
|
123
|
-
tags {
|
|
124
|
-
id
|
|
125
|
-
name
|
|
126
|
-
slug
|
|
127
|
-
type
|
|
128
|
-
scope
|
|
129
|
-
storeIds
|
|
130
|
-
selected
|
|
131
|
-
}
|
|
132
123
|
brand {
|
|
133
124
|
id
|
|
134
125
|
createStamp
|
|
@@ -249,15 +240,6 @@ exports.GET_SIMPLE_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
|
|
|
249
240
|
compareAtPrice
|
|
250
241
|
featuredImage
|
|
251
242
|
images
|
|
252
|
-
tags {
|
|
253
|
-
id
|
|
254
|
-
name
|
|
255
|
-
slug
|
|
256
|
-
type
|
|
257
|
-
scope
|
|
258
|
-
storeIds
|
|
259
|
-
selected
|
|
260
|
-
}
|
|
261
243
|
version
|
|
262
244
|
brand {
|
|
263
245
|
id
|
|
@@ -392,15 +374,6 @@ exports.GET_PRODUCT_BY_SLUG_QUERY = (0, graphql_tag_1.gql) `
|
|
|
392
374
|
priceTypeName
|
|
393
375
|
priceVaries
|
|
394
376
|
available
|
|
395
|
-
tags {
|
|
396
|
-
id
|
|
397
|
-
name
|
|
398
|
-
slug
|
|
399
|
-
type
|
|
400
|
-
scope
|
|
401
|
-
storeIds
|
|
402
|
-
selected
|
|
403
|
-
}
|
|
404
377
|
options
|
|
405
378
|
optionsRelationship
|
|
406
379
|
compareAtPrice
|
|
@@ -812,15 +785,6 @@ exports.GET_PRODUCT = (0, graphql_tag_1.gql) `
|
|
|
812
785
|
priceTypeName
|
|
813
786
|
priceVaries
|
|
814
787
|
available
|
|
815
|
-
tags {
|
|
816
|
-
id
|
|
817
|
-
name
|
|
818
|
-
slug
|
|
819
|
-
type
|
|
820
|
-
scope
|
|
821
|
-
storeIds
|
|
822
|
-
selected
|
|
823
|
-
}
|
|
824
788
|
options
|
|
825
789
|
optionsRelationship
|
|
826
790
|
compareAtPrice
|
|
@@ -1014,15 +978,6 @@ exports.GET_PRODUCT_BY_GROUPID = (0, graphql_tag_1.gql) `
|
|
|
1014
978
|
priceTypeName
|
|
1015
979
|
priceVaries
|
|
1016
980
|
available
|
|
1017
|
-
tags {
|
|
1018
|
-
id
|
|
1019
|
-
name
|
|
1020
|
-
slug
|
|
1021
|
-
type
|
|
1022
|
-
scope
|
|
1023
|
-
storeIds
|
|
1024
|
-
selected
|
|
1025
|
-
}
|
|
1026
981
|
options
|
|
1027
982
|
optionsRelationship
|
|
1028
983
|
compareAtPrice
|
|
@@ -1275,15 +1230,6 @@ exports.GET_PRODUCT_MARKET_PLACE = (0, graphql_tag_1.gql) `
|
|
|
1275
1230
|
featuredImage
|
|
1276
1231
|
version
|
|
1277
1232
|
images
|
|
1278
|
-
tags {
|
|
1279
|
-
id
|
|
1280
|
-
name
|
|
1281
|
-
slug
|
|
1282
|
-
type
|
|
1283
|
-
scope
|
|
1284
|
-
storeIds
|
|
1285
|
-
selected
|
|
1286
|
-
}
|
|
1287
1233
|
featureTypes {
|
|
1288
1234
|
id
|
|
1289
1235
|
keyId
|
|
@@ -1433,15 +1379,6 @@ exports.GET_PRODUCT_MARKET_PLACE_DETAIL_BY_SLUG = (0, graphql_tag_1.gql) `
|
|
|
1433
1379
|
usedCreatedChild
|
|
1434
1380
|
}
|
|
1435
1381
|
}
|
|
1436
|
-
tags {
|
|
1437
|
-
id
|
|
1438
|
-
name
|
|
1439
|
-
slug
|
|
1440
|
-
type
|
|
1441
|
-
scope
|
|
1442
|
-
storeIds
|
|
1443
|
-
selected
|
|
1444
|
-
}
|
|
1445
1382
|
variants {
|
|
1446
1383
|
id
|
|
1447
1384
|
handle
|
|
@@ -1562,15 +1499,6 @@ exports.GET_PRODUCT_MARKET_PLACE_BY_ID = (0, graphql_tag_1.gql) `
|
|
|
1562
1499
|
usedCreatedChild
|
|
1563
1500
|
}
|
|
1564
1501
|
}
|
|
1565
|
-
tags {
|
|
1566
|
-
id
|
|
1567
|
-
name
|
|
1568
|
-
slug
|
|
1569
|
-
type
|
|
1570
|
-
scope
|
|
1571
|
-
storeIds
|
|
1572
|
-
selected
|
|
1573
|
-
}
|
|
1574
1502
|
variants {
|
|
1575
1503
|
id
|
|
1576
1504
|
handle
|
|
@@ -1740,15 +1668,6 @@ exports.GET_PRODUCT_MARKET_PLACE_BY_SUPPLIER = (0, graphql_tag_1.gql) `
|
|
|
1740
1668
|
resourceType
|
|
1741
1669
|
scope
|
|
1742
1670
|
}
|
|
1743
|
-
tags {
|
|
1744
|
-
id
|
|
1745
|
-
name
|
|
1746
|
-
slug
|
|
1747
|
-
type
|
|
1748
|
-
scope
|
|
1749
|
-
storeIds
|
|
1750
|
-
selected
|
|
1751
|
-
}
|
|
1752
1671
|
}
|
|
1753
1672
|
}
|
|
1754
1673
|
}
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { FileServiceSerVice } from "./fileService";
|
|
|
26
26
|
import { OrderCloudService } from "./orderCloud";
|
|
27
27
|
import { CloudCloudService } from "./cloudCloud";
|
|
28
28
|
import { TruedocService } from "./truedoc";
|
|
29
|
+
import { MarketPlaceService } from "./marketplace";
|
|
29
30
|
export interface Endpoints {
|
|
30
31
|
product: string;
|
|
31
32
|
crm: string;
|
|
@@ -55,6 +56,7 @@ export interface Endpoints {
|
|
|
55
56
|
orderCloud: string;
|
|
56
57
|
cloudCloud: string;
|
|
57
58
|
truedoc: string;
|
|
59
|
+
marketplace: string;
|
|
58
60
|
}
|
|
59
61
|
export declare class SDK {
|
|
60
62
|
orgId: string;
|
|
@@ -88,6 +90,7 @@ export declare class SDK {
|
|
|
88
90
|
orderCloud: OrderCloudService;
|
|
89
91
|
cloudCloud: CloudCloudService;
|
|
90
92
|
truedoc: TruedocService;
|
|
93
|
+
marketplace: MarketPlaceService;
|
|
91
94
|
token: string | null;
|
|
92
95
|
constructor(orgId: string, storeId: string, environment: "dev" | "live");
|
|
93
96
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -31,6 +31,7 @@ const fileService_1 = require("./fileService");
|
|
|
31
31
|
const orderCloud_1 = require("./orderCloud");
|
|
32
32
|
const cloudCloud_1 = require("./cloudCloud");
|
|
33
33
|
const truedoc_1 = require("./truedoc");
|
|
34
|
+
const marketplace_1 = require("./marketplace");
|
|
34
35
|
class SDK {
|
|
35
36
|
constructor(orgId, storeId, environment) {
|
|
36
37
|
this.orgId = orgId;
|
|
@@ -66,6 +67,7 @@ class SDK {
|
|
|
66
67
|
this.orderCloud = new orderCloud_1.OrderCloudService(endpoints.orderCloud, orgId, storeId);
|
|
67
68
|
this.cloudCloud = new cloudCloud_1.CloudCloudService(endpoints.cloudCloud, orgId, storeId);
|
|
68
69
|
this.truedoc = new truedoc_1.TruedocService(endpoints.truedoc, orgId, storeId);
|
|
70
|
+
this.marketplace = new marketplace_1.MarketPlaceService(endpoints.marketplace, orgId, storeId);
|
|
69
71
|
// Initialize other services here
|
|
70
72
|
}
|
|
71
73
|
setToken(token) {
|
|
@@ -100,6 +102,7 @@ class SDK {
|
|
|
100
102
|
this.orderCloud.setToken(token);
|
|
101
103
|
this.cloudCloud.setToken(token);
|
|
102
104
|
this.truedoc.setToken(token);
|
|
105
|
+
this.marketplace.setToken(token);
|
|
103
106
|
}
|
|
104
107
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
105
108
|
// src/service.ts
|
|
@@ -131,6 +134,7 @@ class SDK {
|
|
|
131
134
|
this.orderCloud.setStoreId(storeId);
|
|
132
135
|
this.cloudCloud.setStoreId(storeId);
|
|
133
136
|
this.truedoc.setStoreId(storeId);
|
|
137
|
+
this.marketplace.setStoreId(storeId);
|
|
134
138
|
// Set storeId for other services here
|
|
135
139
|
}
|
|
136
140
|
setOrgId(orgId) {
|
|
@@ -161,6 +165,7 @@ class SDK {
|
|
|
161
165
|
this.orderCloud.setOrgId(orgId);
|
|
162
166
|
this.cloudCloud.setOrgId(orgId);
|
|
163
167
|
this.truedoc.setOrgId(orgId);
|
|
168
|
+
this.marketplace.setOrgId(orgId);
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
exports.SDK = SDK;
|
|
@@ -9,32 +9,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.CloudServiceService = void 0;
|
|
13
13
|
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
-
|
|
14
|
+
const queries_1 = require("../../graphql/cloudService/queries");
|
|
15
|
+
class CloudServiceService extends serviceSDK_1.Service {
|
|
15
16
|
constructor(endpoint, orgId, storeId) {
|
|
16
17
|
super(endpoint, orgId, storeId);
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
this.token = token;
|
|
20
|
-
}
|
|
21
|
-
setStoreId(storeId) {
|
|
22
|
-
this.storeId = storeId;
|
|
23
|
-
}
|
|
24
|
-
getDomain(params) {
|
|
19
|
+
searchService(data) {
|
|
25
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
21
|
+
const query = queries_1.SEARCH_SERVICE;
|
|
22
|
+
const variables = {
|
|
23
|
+
filter: data,
|
|
24
|
+
};
|
|
29
25
|
try {
|
|
30
|
-
const response = yield this.
|
|
31
|
-
return response;
|
|
26
|
+
const response = yield this.graphqlQueryV4(query, variables);
|
|
27
|
+
return response.searchService;
|
|
32
28
|
}
|
|
33
29
|
catch (error) {
|
|
34
|
-
console.log(`Error in addVoucher: ${error}`);
|
|
35
30
|
throw error;
|
|
36
31
|
}
|
|
37
32
|
});
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
|
-
exports.
|
|
35
|
+
exports.CloudServiceService = CloudServiceService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class MarketPlaceService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
createTag(name: string, slug: string, createdBy: string): Promise<any>;
|
|
5
|
+
searchTag(keyword: string, currentPage: number, maxResult: number): Promise<any>;
|
|
6
|
+
getTagsByProductId(productId: string): Promise<any>;
|
|
7
|
+
removeProductTag(productId: string, tagId: string, updatedBy: string, tagGroupId?: string): Promise<any>;
|
|
8
|
+
addProductTag(productId: string, tagId: string, createBy: string, tagGroupId?: string): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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.MarketPlaceService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
const queries_1 = require("../../graphql/marketplace/queries");
|
|
15
|
+
const mutations_1 = require("../../graphql/marketplace/mutations");
|
|
16
|
+
class MarketPlaceService extends serviceSDK_1.Service {
|
|
17
|
+
constructor(endpoint, orgId, storeId) {
|
|
18
|
+
super(endpoint, orgId, storeId);
|
|
19
|
+
}
|
|
20
|
+
createTag(name, slug, createdBy) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const mutation = mutations_1.CREATE_TAG;
|
|
23
|
+
const variables = {
|
|
24
|
+
name,
|
|
25
|
+
slug,
|
|
26
|
+
createdBy,
|
|
27
|
+
};
|
|
28
|
+
try {
|
|
29
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
30
|
+
return response.createTag;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
searchTag(keyword, currentPage, maxResult) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const queries = queries_1.SEARCH_TAG;
|
|
40
|
+
const variables = {
|
|
41
|
+
keyword,
|
|
42
|
+
currentPage,
|
|
43
|
+
maxResult,
|
|
44
|
+
};
|
|
45
|
+
try {
|
|
46
|
+
const response = yield this.graphqlQuery(queries, variables);
|
|
47
|
+
return response.searchTag;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
getTagsByProductId(productId) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const queries = queries_1.GET_TAGS_BY_PRODUCT_ID;
|
|
57
|
+
const variables = {
|
|
58
|
+
productId,
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
const response = yield this.graphqlQuery(queries, variables);
|
|
62
|
+
return response.getTagsByProductId;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
removeProductTag(productId, tagId, updatedBy, tagGroupId) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const mutation = mutations_1.REMOVE_PRODUCT_TAG;
|
|
72
|
+
const variables = {
|
|
73
|
+
productId,
|
|
74
|
+
tagId,
|
|
75
|
+
updatedBy,
|
|
76
|
+
tagGroupId,
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
80
|
+
return response.removeProductTag;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
addProductTag(productId, tagId, createBy, tagGroupId) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const mutation = mutations_1.ADD_PRODUCT_TAG;
|
|
90
|
+
const variables = {
|
|
91
|
+
productId,
|
|
92
|
+
tagId,
|
|
93
|
+
createBy,
|
|
94
|
+
tagGroupId,
|
|
95
|
+
};
|
|
96
|
+
try {
|
|
97
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
98
|
+
return response.addProductTag;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.MarketPlaceService = MarketPlaceService;
|
package/package.json
CHANGED