@longvansoftware/service-js-client 1.10.8 → 1.10.10
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 +4 -0
- package/dist/config/config.js +6 -2
- package/dist/src/graphql/accounting_service/mutations.d.ts +2 -0
- package/dist/src/graphql/accounting_service/mutations.js +100 -0
- package/dist/src/graphql/accounting_service/queries.d.ts +1 -0
- package/dist/src/graphql/accounting_service/queries.js +62 -0
- package/dist/src/graphql/computing/queries.js +38 -3
- package/dist/src/graphql/product/queries.d.ts +20 -17
- package/dist/src/graphql/product/queries.js +113 -1
- package/dist/src/lib/SDK.d.ts +6 -0
- package/dist/src/lib/SDK.js +8 -0
- package/dist/src/lib/accounting_service/index.d.ts +9 -0
- package/dist/src/lib/accounting_service/index.js +69 -0
- package/dist/src/lib/auth/index.js +1 -1
- package/dist/src/lib/product/index.d.ts +2 -0
- package/dist/src/lib/product/index.js +32 -0
- package/package.json +1 -1
package/dist/config/config.d.ts
CHANGED
@@ -13,9 +13,11 @@ export declare const environmentEndpoints: {
|
|
13
13
|
dns: string;
|
14
14
|
crm_camping: string;
|
15
15
|
order_graphQL: string;
|
16
|
+
order_cloud_rest: string;
|
16
17
|
paymentLV: string;
|
17
18
|
resource_permission: string;
|
18
19
|
cloud_rest: string;
|
20
|
+
accounting_service: string;
|
19
21
|
};
|
20
22
|
live: {
|
21
23
|
product: string;
|
@@ -31,8 +33,10 @@ export declare const environmentEndpoints: {
|
|
31
33
|
dns: string;
|
32
34
|
crm_camping: string;
|
33
35
|
order_graphQL: string;
|
36
|
+
order_cloud_rest: string;
|
34
37
|
paymentLV: string;
|
35
38
|
resource_permission: string;
|
36
39
|
cloud_rest: string;
|
40
|
+
accounting_service: string;
|
37
41
|
};
|
38
42
|
};
|
package/dist/config/config.js
CHANGED
@@ -16,9 +16,11 @@ exports.environmentEndpoints = {
|
|
16
16
|
dns: "https://admin-dev.longvan.net/powerdns/dns",
|
17
17
|
crm_camping: "https://crm.dev.longvan.vn/campaign-gateway/graphql",
|
18
18
|
order_graphQL: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql",
|
19
|
+
order_cloud_rest: "https://api-gateway.dev.longvan.vn/order-cloud-service",
|
19
20
|
paymentLV: "https://payment.dev.longvan.vn/graphql",
|
20
21
|
resource_permission: "https://api-gateway.dev.longvan.vn/resource-permission-api/graphql",
|
21
|
-
cloud_rest: "https://api-gateway.dev.longvan.vn/cloud-service-api/v1"
|
22
|
+
cloud_rest: "https://api-gateway.dev.longvan.vn/cloud-service-api/v1",
|
23
|
+
accounting_service: "https://api-gateway.dev.longvan.vn/accounting-service/graphql/",
|
22
24
|
},
|
23
25
|
live: {
|
24
26
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
@@ -34,8 +36,10 @@ exports.environmentEndpoints = {
|
|
34
36
|
dns: "https://admin.longvan.net/powerdns/dns",
|
35
37
|
crm_camping: "https://crm.longvan.vn/campaign-gateway/graphql",
|
36
38
|
order_graphQL: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
|
39
|
+
order_cloud_rest: "https://api-gateway.longvan.vn/order-cloud-service",
|
37
40
|
paymentLV: "https://payment.longvan.vn/graphql",
|
38
41
|
resource_permission: "https://api-gateway.longvan.vn/resource-permission-api/graphql",
|
39
|
-
cloud_rest: "https://api-gateway.longvan.vn/cloud-service-api/v1"
|
42
|
+
cloud_rest: "https://api-gateway.longvan.vn/cloud-service-api/v1",
|
43
|
+
accounting_service: "https://api-gateway.longvan.vn/accounting-service/graphql/",
|
40
44
|
},
|
41
45
|
};
|
@@ -0,0 +1,100 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CONFIRM_DEPOSIT_WALLET = exports.DEPOSIT_WALLET = void 0;
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
5
|
+
exports.DEPOSIT_WALLET = (0, graphql_tag_1.gql) `
|
6
|
+
mutation DepositWallet(
|
7
|
+
$partnerId: String!
|
8
|
+
$storeId: String!
|
9
|
+
$partyId: String!
|
10
|
+
$storeName: String
|
11
|
+
$amountDeposit: BigDecimal!
|
12
|
+
$amountPromotion: BigDecimal
|
13
|
+
$orderNote: String
|
14
|
+
$paymentMethodCode: String
|
15
|
+
$sourcePayment: String
|
16
|
+
$paymentType: String
|
17
|
+
$createBy: String
|
18
|
+
) {
|
19
|
+
depositWallet(
|
20
|
+
partnerId: $partnerId
|
21
|
+
partyId: $partyId
|
22
|
+
storeId: $storeId
|
23
|
+
storeName: $storeName
|
24
|
+
amountDeposit: $amountDeposit
|
25
|
+
amountPromotion: $amountPromotion
|
26
|
+
orderNote: $orderNote
|
27
|
+
paymentMethodCode: $paymentMethodCode
|
28
|
+
sourcePayment: $sourcePayment
|
29
|
+
paymentType: $paymentType
|
30
|
+
createBy: $createBy
|
31
|
+
) {
|
32
|
+
order {
|
33
|
+
orderId
|
34
|
+
}
|
35
|
+
payment {
|
36
|
+
code
|
37
|
+
message
|
38
|
+
data
|
39
|
+
qrCodeUrl
|
40
|
+
deeplink
|
41
|
+
deeplinkMiniApp
|
42
|
+
invoiceId
|
43
|
+
orderId
|
44
|
+
paymentId
|
45
|
+
}
|
46
|
+
financialOrder {
|
47
|
+
partnerId
|
48
|
+
name
|
49
|
+
userId
|
50
|
+
totalAmount
|
51
|
+
type
|
52
|
+
transactionId
|
53
|
+
status
|
54
|
+
accountNumber
|
55
|
+
method
|
56
|
+
gateway
|
57
|
+
extOrderId
|
58
|
+
extTransactionId
|
59
|
+
transactionTime
|
60
|
+
description
|
61
|
+
source
|
62
|
+
level
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
exports.CONFIRM_DEPOSIT_WALLET = (0, graphql_tag_1.gql) `
|
68
|
+
mutation ConfirmDepositWallet(
|
69
|
+
$partnerId: String!
|
70
|
+
$orderId: String!
|
71
|
+
$transactionId: String
|
72
|
+
$transactionTime: Long!
|
73
|
+
$createBy: String
|
74
|
+
) {
|
75
|
+
confirmDepositWallet(
|
76
|
+
partnerId: $partnerId
|
77
|
+
orderId: $orderId
|
78
|
+
transactionId: $transactionId
|
79
|
+
transactionTime: $transactionTime
|
80
|
+
createBy: $createBy
|
81
|
+
) {
|
82
|
+
partnerId
|
83
|
+
name
|
84
|
+
userId
|
85
|
+
totalAmount
|
86
|
+
type
|
87
|
+
transactionId
|
88
|
+
status
|
89
|
+
accountNumber
|
90
|
+
method
|
91
|
+
gateway
|
92
|
+
extOrderId
|
93
|
+
extTransactionId
|
94
|
+
transactionTime
|
95
|
+
description
|
96
|
+
source
|
97
|
+
level
|
98
|
+
}
|
99
|
+
}
|
100
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const FINANCIAL_ACCOUNT_WALLET_INFO: import("graphql").DocumentNode;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FINANCIAL_ACCOUNT_WALLET_INFO = void 0;
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
5
|
+
exports.FINANCIAL_ACCOUNT_WALLET_INFO = (0, graphql_tag_1.gql) `
|
6
|
+
query FinancialAccountWalletInfo(
|
7
|
+
$partnerId: String!
|
8
|
+
$partyId: String
|
9
|
+
$showTransaction: Boolean!
|
10
|
+
) {
|
11
|
+
financialAccountWalletInfo(
|
12
|
+
partnerId: $partnerId
|
13
|
+
partyId: $partyId
|
14
|
+
showTransaction: $showTransaction
|
15
|
+
) {
|
16
|
+
financialAccount {
|
17
|
+
id
|
18
|
+
partyId
|
19
|
+
partnerId
|
20
|
+
type
|
21
|
+
description
|
22
|
+
glAccountNumber
|
23
|
+
created
|
24
|
+
updated
|
25
|
+
}
|
26
|
+
glAccount {
|
27
|
+
partnerId
|
28
|
+
accountNumber
|
29
|
+
owner
|
30
|
+
debit
|
31
|
+
credit
|
32
|
+
balance
|
33
|
+
type
|
34
|
+
parent
|
35
|
+
level
|
36
|
+
description
|
37
|
+
created
|
38
|
+
updated
|
39
|
+
deleteAble
|
40
|
+
}
|
41
|
+
transactions {
|
42
|
+
partnerId
|
43
|
+
name
|
44
|
+
userId
|
45
|
+
totalAmount
|
46
|
+
type
|
47
|
+
transactionId
|
48
|
+
status
|
49
|
+
accountNumber
|
50
|
+
method
|
51
|
+
gateway
|
52
|
+
extOrderId
|
53
|
+
extTransactionId
|
54
|
+
transactionTime
|
55
|
+
description
|
56
|
+
source
|
57
|
+
level
|
58
|
+
createdStamp
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
`;
|
@@ -439,11 +439,46 @@ exports.GET_TEMPLATE = (0, graphql_tag_1.gql) `
|
|
439
439
|
getTemplates {
|
440
440
|
id
|
441
441
|
name
|
442
|
-
status
|
443
442
|
osType
|
444
443
|
username
|
445
|
-
|
446
|
-
|
444
|
+
resourceRecommend {
|
445
|
+
cpu {
|
446
|
+
size
|
447
|
+
used
|
448
|
+
unit
|
449
|
+
}
|
450
|
+
ram {
|
451
|
+
size
|
452
|
+
used
|
453
|
+
unit
|
454
|
+
}
|
455
|
+
disk {
|
456
|
+
index
|
457
|
+
storageId
|
458
|
+
size
|
459
|
+
used
|
460
|
+
unit
|
461
|
+
}
|
462
|
+
}
|
463
|
+
resourceMinimum {
|
464
|
+
cpu {
|
465
|
+
size
|
466
|
+
used
|
467
|
+
unit
|
468
|
+
}
|
469
|
+
ram {
|
470
|
+
size
|
471
|
+
used
|
472
|
+
unit
|
473
|
+
}
|
474
|
+
disk {
|
475
|
+
index
|
476
|
+
storageId
|
477
|
+
size
|
478
|
+
used
|
479
|
+
unit
|
480
|
+
}
|
481
|
+
}
|
447
482
|
}
|
448
483
|
}
|
449
484
|
`;
|
@@ -1,20 +1,23 @@
|
|
1
|
-
|
2
|
-
export declare const
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
export declare const
|
6
|
-
export declare const
|
1
|
+
import { DocumentNode } from "graphql";
|
2
|
+
export declare const GET_PRODUCT_BY_ID_QUERY: DocumentNode;
|
3
|
+
export declare const GET_PRODUCT_BY_ID_QUERY_DYNAMIC: (fields: string[]) => DocumentNode;
|
4
|
+
export declare const GET_PRODUCT_BY_SLUG_QUERY: DocumentNode;
|
5
|
+
export declare const GET_SIMPLE_PRODUCTS_QUERY: DocumentNode;
|
6
|
+
export declare const GET_CATEGORIES_QUERY: DocumentNode;
|
7
|
+
export declare const GET_CATEGORY_BY_HANDLE_QUERY: DocumentNode;
|
8
|
+
export declare const GET_CATEGORY_BY_ID_QUERY: DocumentNode;
|
7
9
|
export declare const GET_BRANDS_QUERY = "\nquery GetBrands($partnerId: String!, $storeChannel: String!, $enable: Boolean) {\n\tgetBrands(partnerId: $partnerId, storeChannel: $storeChannel, enable: $enable) {\n\t\tid\n\t\tname\n\t\timage\n\t\timageIcon\n\t}\n}\n";
|
8
10
|
export declare const GET_BRANDS_BY_CATEGORY_QUERY = "\nquery GetBrandsByCategory($partnerId: String!, $storeChannel: String!, $categoryId: String!) {\n\tgetBrandsByCategory(partnerId: $partnerId, storeChannel: $storeChannel, categoryId: $categoryId) {\n\t\tid\n\t\tname\n\t\timage\n\t\timageIcon\n\t}\n}\n";
|
9
11
|
export declare const GET_BRAND_DETAIL_QUERY = "\n query GetBrandDetail($partnerId: String!, $brandId: String!, $storeChannel: String!) {\n getDetail(partnerId: $partnerId, brandId: $brandId, storeChannel: $storeChannel) {\n id\n name\n image\n imageIcon\n }\n }\n";
|
10
|
-
export declare const GET_PRODUCT_OPTION:
|
11
|
-
export declare const GET_POLICY:
|
12
|
-
export declare const GET_PRODUCTS:
|
13
|
-
export declare const
|
14
|
-
export declare const
|
15
|
-
export declare const
|
16
|
-
export declare const
|
17
|
-
export declare const
|
18
|
-
export declare const
|
19
|
-
export declare const
|
20
|
-
export declare const
|
12
|
+
export declare const GET_PRODUCT_OPTION: DocumentNode;
|
13
|
+
export declare const GET_POLICY: DocumentNode;
|
14
|
+
export declare const GET_PRODUCTS: DocumentNode;
|
15
|
+
export declare const GET_PRODUCTS_DYNAMIC: (fields: string[]) => DocumentNode;
|
16
|
+
export declare const GET_HANDLE_BY_SERVICETYPE: DocumentNode;
|
17
|
+
export declare const GET_RESOURCE_BY_PRODUCT: DocumentNode;
|
18
|
+
export declare const GET_PRODUCT_VARIANT_BY_ID: DocumentNode;
|
19
|
+
export declare const GET_RELATED_INFOR: DocumentNode;
|
20
|
+
export declare const GET_DETAIL_STORES: DocumentNode;
|
21
|
+
export declare const GET_LIST_PRICE: DocumentNode;
|
22
|
+
export declare const GET_TAGS: DocumentNode;
|
23
|
+
export declare const GET_TAGS_BY_CATEGORY: DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
3
|
+
exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS_DYNAMIC = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
// export const GET_PRODUCT_BY_ID_QUERY = gql`
|
6
6
|
// query GetProductById(
|
@@ -192,6 +192,25 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
|
|
192
192
|
}
|
193
193
|
}
|
194
194
|
`;
|
195
|
+
const GET_PRODUCT_BY_ID_QUERY_DYNAMIC = (fields) => {
|
196
|
+
const fieldStr = fields.join("\n ");
|
197
|
+
return (0, graphql_tag_1.gql) `
|
198
|
+
query GetProductById(
|
199
|
+
$partnerId: String!
|
200
|
+
$storeChannel: String!
|
201
|
+
$productId: String!
|
202
|
+
) {
|
203
|
+
getProductById(
|
204
|
+
partnerId: $partnerId
|
205
|
+
storeChannel: $storeChannel
|
206
|
+
productId: $productId
|
207
|
+
) {
|
208
|
+
${fieldStr}
|
209
|
+
}
|
210
|
+
}
|
211
|
+
`;
|
212
|
+
};
|
213
|
+
exports.GET_PRODUCT_BY_ID_QUERY_DYNAMIC = GET_PRODUCT_BY_ID_QUERY_DYNAMIC;
|
195
214
|
exports.GET_PRODUCT_BY_SLUG_QUERY = (0, graphql_tag_1.gql) `
|
196
215
|
query GetProductByHandle(
|
197
216
|
$partnerId: String!
|
@@ -668,6 +687,99 @@ exports.GET_PRODUCTS = (0, graphql_tag_1.gql) `
|
|
668
687
|
}
|
669
688
|
}
|
670
689
|
`;
|
690
|
+
const GET_PRODUCTS_DYNAMIC = (fields) => {
|
691
|
+
const fieldStr = fields.join("\n ");
|
692
|
+
return (0, graphql_tag_1.gql) `
|
693
|
+
query GetProducts(
|
694
|
+
$partnerId: String!
|
695
|
+
$storeChannel: String!
|
696
|
+
$hash: String
|
697
|
+
$publicOnStore: Boolean
|
698
|
+
$category: String
|
699
|
+
$product: String
|
700
|
+
$group: String
|
701
|
+
$sku: String
|
702
|
+
$priceFrom: BigDecimal
|
703
|
+
$priceTo: BigDecimal
|
704
|
+
$tag: String
|
705
|
+
$status: String
|
706
|
+
$ecommerceId: String
|
707
|
+
$productIgnoresIds: String
|
708
|
+
$toDate: Long
|
709
|
+
$fromDate: Long
|
710
|
+
$productType: String
|
711
|
+
$sortOrder: String
|
712
|
+
$sortBy: String
|
713
|
+
$option: String
|
714
|
+
$brandId: String
|
715
|
+
$feature: String
|
716
|
+
$keyword: String
|
717
|
+
$external: String
|
718
|
+
$userId: String
|
719
|
+
$onlyFavorite: Boolean
|
720
|
+
$buildPriceStore: Boolean
|
721
|
+
$buildType: String
|
722
|
+
$buildPromotion: Boolean
|
723
|
+
$variant: Boolean
|
724
|
+
$deleteChild: Boolean
|
725
|
+
$display: String
|
726
|
+
$subType: String
|
727
|
+
$currentPage: Int
|
728
|
+
$maxResult: Int
|
729
|
+
$isSync: Boolean
|
730
|
+
$isMapped: Boolean
|
731
|
+
) {
|
732
|
+
getProducts(
|
733
|
+
partnerId: $partnerId
|
734
|
+
storeChannel: $storeChannel
|
735
|
+
hash: $hash
|
736
|
+
publicOnStore: $publicOnStore
|
737
|
+
category: $category
|
738
|
+
product: $product
|
739
|
+
group: $group
|
740
|
+
sku: $sku
|
741
|
+
priceFrom: $priceFrom
|
742
|
+
priceTo: $priceTo
|
743
|
+
tag: $tag
|
744
|
+
status: $status
|
745
|
+
ecommerceId: $ecommerceId
|
746
|
+
productIgnoresIds: $productIgnoresIds
|
747
|
+
toDate: $toDate
|
748
|
+
fromDate: $fromDate
|
749
|
+
productType: $productType
|
750
|
+
sortOrder: $sortOrder
|
751
|
+
sortBy: $sortBy
|
752
|
+
option: $option
|
753
|
+
brandId: $brandId
|
754
|
+
feature: $feature
|
755
|
+
keyword: $keyword
|
756
|
+
external: $external
|
757
|
+
userId: $userId
|
758
|
+
onlyFavorite: $onlyFavorite
|
759
|
+
buildPriceStore: $buildPriceStore
|
760
|
+
buildType: $buildType
|
761
|
+
buildPromotion: $buildPromotion
|
762
|
+
variant: $variant
|
763
|
+
deleteChild: $deleteChild
|
764
|
+
display: $display
|
765
|
+
subType: $subType
|
766
|
+
currentPage: $currentPage
|
767
|
+
maxResult: $maxResult
|
768
|
+
isSync: $isSync
|
769
|
+
isMapped: $isMapped
|
770
|
+
) {
|
771
|
+
total
|
772
|
+
currentPage
|
773
|
+
maxResult
|
774
|
+
totalPage
|
775
|
+
data {
|
776
|
+
${fieldStr}
|
777
|
+
}
|
778
|
+
}
|
779
|
+
}
|
780
|
+
`;
|
781
|
+
};
|
782
|
+
exports.GET_PRODUCTS_DYNAMIC = GET_PRODUCTS_DYNAMIC;
|
671
783
|
exports.GET_HANDLE_BY_SERVICETYPE = (0, graphql_tag_1.gql) `
|
672
784
|
query GetHandleByServiceTypes(
|
673
785
|
$partnerId: String!
|
package/dist/src/lib/SDK.d.ts
CHANGED
@@ -14,6 +14,8 @@ import { OrderGraphQLService } from "./orderGraphQL";
|
|
14
14
|
import { PaymentLVService } from "./paymentLV";
|
15
15
|
import { ResourcePermissionService } from "./resource_permission";
|
16
16
|
import { CloudRestService } from "./cloud_rest";
|
17
|
+
import { OrderCloudRestService } from "./order_cloud_rest";
|
18
|
+
import { AccountingService } from "./accounting_service";
|
17
19
|
export interface Endpoints {
|
18
20
|
product: string;
|
19
21
|
crm: string;
|
@@ -31,6 +33,8 @@ export interface Endpoints {
|
|
31
33
|
paymentLV: string;
|
32
34
|
resource_permission: string;
|
33
35
|
cloud_rest: string;
|
36
|
+
order_cloud_rest: string;
|
37
|
+
accounting_service: string;
|
34
38
|
}
|
35
39
|
export declare class SDK {
|
36
40
|
orgId: string;
|
@@ -53,6 +57,8 @@ export declare class SDK {
|
|
53
57
|
paymentLV: PaymentLVService;
|
54
58
|
resource_permission: ResourcePermissionService;
|
55
59
|
cloud_rest: CloudRestService;
|
60
|
+
order_cloud_rest: OrderCloudRestService;
|
61
|
+
accounting_service: AccountingService;
|
56
62
|
token: string | null;
|
57
63
|
private endpoints;
|
58
64
|
constructor(orgId: string, storeId: string, storefrontAccessToken: string, environment: string);
|
package/dist/src/lib/SDK.js
CHANGED
@@ -20,6 +20,8 @@ const orderGraphQL_1 = require("./orderGraphQL");
|
|
20
20
|
const paymentLV_1 = require("./paymentLV");
|
21
21
|
const resource_permission_1 = require("./resource_permission");
|
22
22
|
const cloud_rest_1 = require("./cloud_rest");
|
23
|
+
const order_cloud_rest_1 = require("./order_cloud_rest");
|
24
|
+
const accounting_service_1 = require("./accounting_service");
|
23
25
|
class SDK {
|
24
26
|
constructor(orgId, storeId, storefrontAccessToken, environment) {
|
25
27
|
this.orgId = orgId;
|
@@ -50,6 +52,8 @@ class SDK {
|
|
50
52
|
this.paymentLV = new paymentLV_1.PaymentLVService(this.endpoints.paymentLV, orgId, storeId);
|
51
53
|
this.resource_permission = new resource_permission_1.ResourcePermissionService(this.endpoints.resource_permission, orgId, storeId);
|
52
54
|
this.cloud_rest = new cloud_rest_1.CloudRestService(this.endpoints.cloud_rest, orgId, storeId);
|
55
|
+
this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, orgId, storeId);
|
56
|
+
this.accounting_service = new accounting_service_1.AccountingService(this.endpoints.accounting_service, orgId, storeId);
|
53
57
|
// Initialize other services here
|
54
58
|
}
|
55
59
|
setToken(token) {
|
@@ -71,6 +75,8 @@ class SDK {
|
|
71
75
|
this.paymentLV.setToken(token);
|
72
76
|
this.resource_permission.setToken(token);
|
73
77
|
this.cloud_rest.setToken(token);
|
78
|
+
this.order_cloud_rest.setToken(token);
|
79
|
+
this.accounting_service.setToken(token);
|
74
80
|
// Set token for other services here
|
75
81
|
}
|
76
82
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
@@ -94,6 +100,8 @@ class SDK {
|
|
94
100
|
this.paymentLV = new paymentLV_1.PaymentLVService(this.endpoints.paymentLV, this.orgId, storeId);
|
95
101
|
this.resource_permission = new resource_permission_1.ResourcePermissionService(this.endpoints.resource_permission, this.orgId, storeId);
|
96
102
|
this.cloud_rest = new cloud_rest_1.CloudRestService(this.endpoints.cloud_rest, this.orgId, storeId);
|
103
|
+
this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, this.orgId, storeId);
|
104
|
+
this.accounting_service = new accounting_service_1.AccountingService(this.endpoints.accounting_service, this.orgId, storeId);
|
97
105
|
}
|
98
106
|
}
|
99
107
|
exports.SDK = SDK;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Service } from "../serviceSDK";
|
2
|
+
export declare class AccountingService extends Service {
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
4
|
+
setToken(token: string): void;
|
5
|
+
setStoreId(storeId: string): void;
|
6
|
+
depositWallet(data: any): Promise<any>;
|
7
|
+
confirmDepositWallet(data: any): Promise<any>;
|
8
|
+
financialAccountWalletInfo(data: any): Promise<any>;
|
9
|
+
}
|
@@ -0,0 +1,69 @@
|
|
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.AccountingService = void 0;
|
13
|
+
const mutations_1 = require("../../graphql/accounting_service/mutations");
|
14
|
+
const queries_1 = require("../../graphql/accounting_service/queries");
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
16
|
+
class AccountingService extends serviceSDK_1.Service {
|
17
|
+
constructor(endpoint, orgId, storeId) {
|
18
|
+
super(endpoint, orgId, storeId);
|
19
|
+
}
|
20
|
+
setToken(token) {
|
21
|
+
this.token = token;
|
22
|
+
}
|
23
|
+
setStoreId(storeId) {
|
24
|
+
this.storeId = storeId;
|
25
|
+
}
|
26
|
+
depositWallet(data) {
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
28
|
+
const mutation = mutations_1.DEPOSIT_WALLET;
|
29
|
+
const variables = Object.assign({ partnerId: this.orgId, storeId: this.storeId }, data);
|
30
|
+
try {
|
31
|
+
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
32
|
+
return response.depositWallet;
|
33
|
+
}
|
34
|
+
catch (error) {
|
35
|
+
console.log(`Error in depositWallet: ${error}`);
|
36
|
+
throw error;
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
confirmDepositWallet(data) {
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
42
|
+
const mutation = mutations_1.CONFIRM_DEPOSIT_WALLET;
|
43
|
+
const variables = Object.assign({ partnerId: this.orgId }, data);
|
44
|
+
try {
|
45
|
+
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
46
|
+
return response.confirmDepositWallet;
|
47
|
+
}
|
48
|
+
catch (error) {
|
49
|
+
console.log(`Error in confirmDepositWallet: ${error}`);
|
50
|
+
throw error;
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
54
|
+
financialAccountWalletInfo(data) {
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
56
|
+
const query = queries_1.FINANCIAL_ACCOUNT_WALLET_INFO;
|
57
|
+
const variables = Object.assign({ partnerId: this.orgId }, data);
|
58
|
+
try {
|
59
|
+
const response = yield this.graphqlQueryCustomHeader(query, variables);
|
60
|
+
return response.financialAccountWalletInfo;
|
61
|
+
}
|
62
|
+
catch (error) {
|
63
|
+
console.log(`Error in financialAccountWalletInfo: ${error}`);
|
64
|
+
throw error;
|
65
|
+
}
|
66
|
+
});
|
67
|
+
}
|
68
|
+
}
|
69
|
+
exports.AccountingService = AccountingService;
|
@@ -231,7 +231,7 @@ class AuthService extends serviceSDK_1.Service {
|
|
231
231
|
partyId,
|
232
232
|
};
|
233
233
|
try {
|
234
|
-
const response = yield this.
|
234
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
235
235
|
return response.getUserLoginsByPartyId;
|
236
236
|
}
|
237
237
|
catch (error) {
|
@@ -21,6 +21,7 @@ export declare class ProductService extends Service {
|
|
21
21
|
* @throws If an error occurs while fetching the product.
|
22
22
|
*/
|
23
23
|
getProductById(productId: string, store: string): Promise<any>;
|
24
|
+
getProductByIdDynamic(productId: string, store: string, fields: string[]): Promise<any>;
|
24
25
|
/**
|
25
26
|
* Retrieves a product by its slug.
|
26
27
|
* @param slug - The slug of the product.
|
@@ -38,6 +39,7 @@ export declare class ProductService extends Service {
|
|
38
39
|
getProductOption(productId: string, store: string): Promise<any>;
|
39
40
|
getPolicy(groupId: string): Promise<any>;
|
40
41
|
getProducts(param: getProduct, store: string): Promise<any>;
|
42
|
+
getProductsDynamic(param: getProduct, store: string, fields: string[]): Promise<any>;
|
41
43
|
getHandleByServiceTypes(serviceTypes: [string]): Promise<any>;
|
42
44
|
getResourceByProduct(productId: string): Promise<any>;
|
43
45
|
getProductVariantById(variantId: string): Promise<any>;
|
@@ -52,6 +52,24 @@ class ProductService extends serviceSDK_1.Service {
|
|
52
52
|
}
|
53
53
|
});
|
54
54
|
}
|
55
|
+
getProductByIdDynamic(productId, store, fields) {
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
57
|
+
const query = (0, queries_1.GET_PRODUCT_BY_ID_QUERY_DYNAMIC)(fields);
|
58
|
+
const variables = {
|
59
|
+
partnerId: this.orgId,
|
60
|
+
storeChannel: store ? store : this.storeId,
|
61
|
+
productId,
|
62
|
+
};
|
63
|
+
try {
|
64
|
+
const response = yield this.graphqlQuery(query, variables);
|
65
|
+
return response.getProductById;
|
66
|
+
}
|
67
|
+
catch (error) {
|
68
|
+
console.log(`Error fetching product by ID: ${error}`);
|
69
|
+
throw error;
|
70
|
+
}
|
71
|
+
});
|
72
|
+
}
|
55
73
|
/**
|
56
74
|
* Retrieves a product by its slug.
|
57
75
|
* @param slug - The slug of the product.
|
@@ -145,6 +163,20 @@ class ProductService extends serviceSDK_1.Service {
|
|
145
163
|
}
|
146
164
|
});
|
147
165
|
}
|
166
|
+
getProductsDynamic(param, store, fields) {
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
168
|
+
const query = (0, queries_1.GET_PRODUCTS_DYNAMIC)(fields);
|
169
|
+
const variablesHandle = Object.assign({ partnerId: this.orgId, storeChannel: store ? store : this.storeId }, param);
|
170
|
+
try {
|
171
|
+
const response = yield this.graphqlQueryV2(query, variablesHandle);
|
172
|
+
return response.getProducts;
|
173
|
+
}
|
174
|
+
catch (error) {
|
175
|
+
console.log(`Error fetching getProducts : ${error}`);
|
176
|
+
throw error;
|
177
|
+
}
|
178
|
+
});
|
179
|
+
}
|
148
180
|
getHandleByServiceTypes(serviceTypes) {
|
149
181
|
return __awaiter(this, void 0, void 0, function* () {
|
150
182
|
const query = queries_1.GET_HANDLE_BY_SERVICETYPE;
|