@longvansoftware/service-js-client 1.10.8 → 1.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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
|
`;
|
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) {
|