@longvansoftware/storefront-js-client 1.0.12 → 1.0.13
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/README.md +93 -93
- package/dist/src/graphql/auth/mutations.js +88 -88
- package/dist/src/graphql/crm/mutations.js +248 -248
- package/dist/src/graphql/crm/queries.js +148 -148
- package/dist/src/graphql/payment/mutations.js +30 -30
- package/dist/src/graphql/payment/queries.js +7 -7
- package/dist/src/graphql/product/queries.js +314 -314
- package/dist/src/graphql/user/mutations.js +80 -80
- package/dist/src/graphql/user/queries.js +28 -28
- package/dist/src/lib/SDK.d.ts +2 -0
- package/dist/src/lib/SDK.js +3 -2
- package/dist/src/lib/crm/index.d.ts +1 -1
- package/dist/src/lib/crm/index.js +3 -3
- package/dist/src/lib/service.js +4 -4
- package/package.json +42 -42
|
@@ -2,86 +2,86 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UPDATE_CUSTOMER_V2 = exports.UPDATE_COMPANY_INFOR = exports.CREATE_COMPANY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.CREATE_COMPANY = (0, graphql_tag_1.gql) `
|
|
6
|
-
mutation CreateCompany(
|
|
7
|
-
$createCompanyRequest: CreateCompanyRequest!,
|
|
8
|
-
$createTaxCodeRequest: CreateTaxCodeRequest,
|
|
9
|
-
$orgId: String!,
|
|
10
|
-
$createdBy: String!
|
|
11
|
-
) {
|
|
12
|
-
createCompany(
|
|
13
|
-
createCompanyRequest: $createCompanyRequest,
|
|
14
|
-
createTaxCodeRequest: $createTaxCodeRequest,
|
|
15
|
-
orgId: $orgId,
|
|
16
|
-
createdBy: $createdBy
|
|
17
|
-
) {
|
|
18
|
-
id
|
|
19
|
-
name
|
|
20
|
-
address
|
|
21
|
-
gender
|
|
22
|
-
identityNumber
|
|
23
|
-
birthDate
|
|
24
|
-
email
|
|
25
|
-
phone
|
|
26
|
-
createdStamp
|
|
27
|
-
createdBy
|
|
28
|
-
memberLevel
|
|
29
|
-
}
|
|
30
|
-
}
|
|
5
|
+
exports.CREATE_COMPANY = (0, graphql_tag_1.gql) `
|
|
6
|
+
mutation CreateCompany(
|
|
7
|
+
$createCompanyRequest: CreateCompanyRequest!,
|
|
8
|
+
$createTaxCodeRequest: CreateTaxCodeRequest,
|
|
9
|
+
$orgId: String!,
|
|
10
|
+
$createdBy: String!
|
|
11
|
+
) {
|
|
12
|
+
createCompany(
|
|
13
|
+
createCompanyRequest: $createCompanyRequest,
|
|
14
|
+
createTaxCodeRequest: $createTaxCodeRequest,
|
|
15
|
+
orgId: $orgId,
|
|
16
|
+
createdBy: $createdBy
|
|
17
|
+
) {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
address
|
|
21
|
+
gender
|
|
22
|
+
identityNumber
|
|
23
|
+
birthDate
|
|
24
|
+
email
|
|
25
|
+
phone
|
|
26
|
+
createdStamp
|
|
27
|
+
createdBy
|
|
28
|
+
memberLevel
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
31
|
`;
|
|
32
|
-
exports.UPDATE_COMPANY_INFOR = (0, graphql_tag_1.gql) `
|
|
33
|
-
mutation UpdateCompanyInfo(
|
|
34
|
-
$id: String!,
|
|
35
|
-
$fieldName: String!,
|
|
36
|
-
$valueUpdate: String!,
|
|
37
|
-
$orgId: String!,
|
|
38
|
-
$updatedBy: String!
|
|
39
|
-
) {
|
|
40
|
-
updateCompanyInfo(
|
|
41
|
-
id: $id,
|
|
42
|
-
fieldName: $fieldName,
|
|
43
|
-
valueUpdate: $valueUpdate,
|
|
44
|
-
orgId: $orgId,
|
|
45
|
-
updatedBy: $updatedBy
|
|
46
|
-
) {
|
|
47
|
-
id
|
|
48
|
-
name
|
|
49
|
-
address
|
|
50
|
-
gender
|
|
51
|
-
identityNumber
|
|
52
|
-
birthDate
|
|
53
|
-
email
|
|
54
|
-
phone
|
|
55
|
-
createdStamp
|
|
56
|
-
createdBy
|
|
57
|
-
memberLevel
|
|
58
|
-
}
|
|
59
|
-
}
|
|
32
|
+
exports.UPDATE_COMPANY_INFOR = (0, graphql_tag_1.gql) `
|
|
33
|
+
mutation UpdateCompanyInfo(
|
|
34
|
+
$id: String!,
|
|
35
|
+
$fieldName: String!,
|
|
36
|
+
$valueUpdate: String!,
|
|
37
|
+
$orgId: String!,
|
|
38
|
+
$updatedBy: String!
|
|
39
|
+
) {
|
|
40
|
+
updateCompanyInfo(
|
|
41
|
+
id: $id,
|
|
42
|
+
fieldName: $fieldName,
|
|
43
|
+
valueUpdate: $valueUpdate,
|
|
44
|
+
orgId: $orgId,
|
|
45
|
+
updatedBy: $updatedBy
|
|
46
|
+
) {
|
|
47
|
+
id
|
|
48
|
+
name
|
|
49
|
+
address
|
|
50
|
+
gender
|
|
51
|
+
identityNumber
|
|
52
|
+
birthDate
|
|
53
|
+
email
|
|
54
|
+
phone
|
|
55
|
+
createdStamp
|
|
56
|
+
createdBy
|
|
57
|
+
memberLevel
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
60
|
`;
|
|
61
|
-
exports.UPDATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
|
|
62
|
-
mutation UpdateCustomerV2(
|
|
63
|
-
$id: String!,
|
|
64
|
-
$updateCustomerRequest: UpdateCustomerRequest!,
|
|
65
|
-
$tenantId: String!,
|
|
66
|
-
$updatedBy: String!
|
|
67
|
-
) {
|
|
68
|
-
updateCustomerV2(
|
|
69
|
-
id: $id,
|
|
70
|
-
updateCustomerRequest: $updateCustomerRequest,
|
|
71
|
-
tenantId: $tenantId,
|
|
72
|
-
updatedBy: $updatedBy
|
|
73
|
-
) {
|
|
74
|
-
id
|
|
75
|
-
name
|
|
76
|
-
address
|
|
77
|
-
gender
|
|
78
|
-
identityNumber
|
|
79
|
-
birthDate
|
|
80
|
-
email
|
|
81
|
-
phone
|
|
82
|
-
createdStamp
|
|
83
|
-
createdBy
|
|
84
|
-
memberLevel
|
|
85
|
-
}
|
|
86
|
-
}
|
|
61
|
+
exports.UPDATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
|
|
62
|
+
mutation UpdateCustomerV2(
|
|
63
|
+
$id: String!,
|
|
64
|
+
$updateCustomerRequest: UpdateCustomerRequest!,
|
|
65
|
+
$tenantId: String!,
|
|
66
|
+
$updatedBy: String!
|
|
67
|
+
) {
|
|
68
|
+
updateCustomerV2(
|
|
69
|
+
id: $id,
|
|
70
|
+
updateCustomerRequest: $updateCustomerRequest,
|
|
71
|
+
tenantId: $tenantId,
|
|
72
|
+
updatedBy: $updatedBy
|
|
73
|
+
) {
|
|
74
|
+
id
|
|
75
|
+
name
|
|
76
|
+
address
|
|
77
|
+
gender
|
|
78
|
+
identityNumber
|
|
79
|
+
birthDate
|
|
80
|
+
email
|
|
81
|
+
phone
|
|
82
|
+
createdStamp
|
|
83
|
+
createdBy
|
|
84
|
+
memberLevel
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
87
|
`;
|
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
|
|
6
|
-
query GetPersonByIds($partyIds: [String!]!) {
|
|
7
|
-
getPersonByPartyIds(partyIds: $partyIds) {
|
|
8
|
-
status
|
|
9
|
-
partyId
|
|
10
|
-
fullName
|
|
11
|
-
phone
|
|
12
|
-
address
|
|
13
|
-
gender
|
|
14
|
-
birthDate
|
|
15
|
-
email
|
|
16
|
-
personalTitle
|
|
17
|
-
imageUrl
|
|
18
|
-
identityNumber
|
|
19
|
-
id
|
|
20
|
-
addressModel {
|
|
21
|
-
id
|
|
22
|
-
addressInfo
|
|
23
|
-
provinceGeoId
|
|
24
|
-
districtGeoId
|
|
25
|
-
wardGeoId
|
|
26
|
-
provinceName
|
|
27
|
-
districtName
|
|
28
|
-
wardName
|
|
29
|
-
isDefault
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
5
|
+
exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
|
|
6
|
+
query GetPersonByIds($partyIds: [String!]!) {
|
|
7
|
+
getPersonByPartyIds(partyIds: $partyIds) {
|
|
8
|
+
status
|
|
9
|
+
partyId
|
|
10
|
+
fullName
|
|
11
|
+
phone
|
|
12
|
+
address
|
|
13
|
+
gender
|
|
14
|
+
birthDate
|
|
15
|
+
email
|
|
16
|
+
personalTitle
|
|
17
|
+
imageUrl
|
|
18
|
+
identityNumber
|
|
19
|
+
id
|
|
20
|
+
addressModel {
|
|
21
|
+
id
|
|
22
|
+
addressInfo
|
|
23
|
+
provinceGeoId
|
|
24
|
+
districtGeoId
|
|
25
|
+
wardGeoId
|
|
26
|
+
provinceName
|
|
27
|
+
districtName
|
|
28
|
+
wardName
|
|
29
|
+
isDefault
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
33
|
`;
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AuthService } from "../lib/auth/index";
|
|
|
3
3
|
import { OrderService } from "../lib/order/index";
|
|
4
4
|
import { UserService } from "../lib/user/index";
|
|
5
5
|
import { PaymentService } from "../lib/payment/index";
|
|
6
|
+
import { CrmService } from "../lib/crm/index";
|
|
6
7
|
export interface Endpoints {
|
|
7
8
|
product: string;
|
|
8
9
|
crm: string;
|
|
@@ -20,6 +21,7 @@ export declare class SDK {
|
|
|
20
21
|
order: OrderService;
|
|
21
22
|
user: UserService;
|
|
22
23
|
payment: PaymentService;
|
|
24
|
+
crm: CrmService;
|
|
23
25
|
token: string | null;
|
|
24
26
|
constructor(orgId: string, storeId: string, storefrontAccessToken: string);
|
|
25
27
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -9,6 +9,7 @@ const index_4 = require("../lib/user/index");
|
|
|
9
9
|
const config_1 = require("../../config/config");
|
|
10
10
|
const helpers_1 = require("../utils/helpers");
|
|
11
11
|
const index_5 = require("../lib/payment/index");
|
|
12
|
+
const index_6 = require("../lib/crm/index");
|
|
12
13
|
class SDK {
|
|
13
14
|
constructor(orgId, storeId, storefrontAccessToken) {
|
|
14
15
|
this.orgId = orgId;
|
|
@@ -24,7 +25,7 @@ class SDK {
|
|
|
24
25
|
this.order = new index_3.OrderService(endpoints.order, orgId, storeId);
|
|
25
26
|
this.user = new index_4.UserService(endpoints.user, orgId, storeId);
|
|
26
27
|
this.payment = new index_5.PaymentService(endpoints.payment, orgId, storeId);
|
|
27
|
-
|
|
28
|
+
this.crm = new index_6.CrmService(endpoints.crm, orgId, storeId);
|
|
28
29
|
// Initialize other services here
|
|
29
30
|
}
|
|
30
31
|
setToken(token) {
|
|
@@ -35,7 +36,7 @@ class SDK {
|
|
|
35
36
|
this.order.setToken(token);
|
|
36
37
|
this.user.setToken(token);
|
|
37
38
|
this.payment.setToken(token);
|
|
38
|
-
|
|
39
|
+
this.crm.setToken(token);
|
|
39
40
|
// Set token for other services here
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AddOpportunityRequest, GetOpportunityRequest } from '../../types/crm';
|
|
2
2
|
import { Service } from '../service';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class CrmService extends Service {
|
|
4
4
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
5
5
|
addOpportunity(addOpportunityRequest: AddOpportunityRequest, performerId: string): Promise<any>;
|
|
6
6
|
getListOpportunity(performerId: string, getOpportunityRequest: GetOpportunityRequest): Promise<any>;
|
|
@@ -9,11 +9,11 @@ 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.CrmService = void 0;
|
|
13
13
|
const mutations_1 = require("../../graphql/crm/mutations");
|
|
14
14
|
const queries_1 = require("../../graphql/crm/queries");
|
|
15
15
|
const service_1 = require("../service");
|
|
16
|
-
class
|
|
16
|
+
class CrmService extends service_1.Service {
|
|
17
17
|
constructor(endpoint, orgId, storeId) {
|
|
18
18
|
super(endpoint, orgId, storeId);
|
|
19
19
|
}
|
|
@@ -182,4 +182,4 @@ class UserService extends service_1.Service {
|
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
exports.
|
|
185
|
+
exports.CrmService = CrmService;
|
package/dist/src/lib/service.js
CHANGED
|
@@ -39,8 +39,8 @@ class Service {
|
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
try {
|
|
41
41
|
const { data, errors } = yield this.client.query({
|
|
42
|
-
query: (0, client_1.gql) `
|
|
43
|
-
${query}
|
|
42
|
+
query: (0, client_1.gql) `
|
|
43
|
+
${query}
|
|
44
44
|
`,
|
|
45
45
|
variables,
|
|
46
46
|
});
|
|
@@ -59,8 +59,8 @@ class Service {
|
|
|
59
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
60
|
try {
|
|
61
61
|
const { data, errors } = yield this.client.mutate({
|
|
62
|
-
mutation: (0, client_1.gql) `
|
|
63
|
-
${mutation}
|
|
62
|
+
mutation: (0, client_1.gql) `
|
|
63
|
+
${mutation}
|
|
64
64
|
`,
|
|
65
65
|
variables,
|
|
66
66
|
});
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@longvansoftware/storefront-js-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "dist/src/index.js",
|
|
5
|
-
"types": "dist/src/index.d.ts",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*.d.ts",
|
|
8
|
-
"dist/**/*.js"
|
|
9
|
-
],
|
|
10
|
-
"directories": {
|
|
11
|
-
"test": "jest"
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"test": "jest",
|
|
15
|
-
"build": "tsc",
|
|
16
|
-
"publish": "npm run build && npm publish"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [],
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@apollo/client": "^3.9.11",
|
|
23
|
-
"apollo-boost": "^0.4.9",
|
|
24
|
-
"axios": "^1.6.8",
|
|
25
|
-
"crypto-js": "^4.2.0",
|
|
26
|
-
"graphql": "^15.8.0",
|
|
27
|
-
"graphql-request": "^6.1.0",
|
|
28
|
-
"graphql-tag": "^2.12.6",
|
|
29
|
-
"react": "^18.2.0",
|
|
30
|
-
"ts-node": "^10.9.2"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@types/axios": "^0.14.0",
|
|
34
|
-
"@types/crypto-js": "^4.2.2",
|
|
35
|
-
"@types/jest": "^29.5.12",
|
|
36
|
-
"@types/node": "^20.12.7",
|
|
37
|
-
"jest": "^29.7.0",
|
|
38
|
-
"ts-jest": "^29.1.2",
|
|
39
|
-
"typescript": "^5.4.5"
|
|
40
|
-
},
|
|
41
|
-
"description": ""
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@longvansoftware/storefront-js-client",
|
|
3
|
+
"version": "1.0.13",
|
|
4
|
+
"main": "dist/src/index.js",
|
|
5
|
+
"types": "dist/src/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*.d.ts",
|
|
8
|
+
"dist/**/*.js"
|
|
9
|
+
],
|
|
10
|
+
"directories": {
|
|
11
|
+
"test": "jest"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"publish": "npm run build && npm publish"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [],
|
|
19
|
+
"author": "",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@apollo/client": "^3.9.11",
|
|
23
|
+
"apollo-boost": "^0.4.9",
|
|
24
|
+
"axios": "^1.6.8",
|
|
25
|
+
"crypto-js": "^4.2.0",
|
|
26
|
+
"graphql": "^15.8.0",
|
|
27
|
+
"graphql-request": "^6.1.0",
|
|
28
|
+
"graphql-tag": "^2.12.6",
|
|
29
|
+
"react": "^18.2.0",
|
|
30
|
+
"ts-node": "^10.9.2"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/axios": "^0.14.0",
|
|
34
|
+
"@types/crypto-js": "^4.2.2",
|
|
35
|
+
"@types/jest": "^29.5.12",
|
|
36
|
+
"@types/node": "^20.12.7",
|
|
37
|
+
"jest": "^29.7.0",
|
|
38
|
+
"ts-jest": "^29.1.2",
|
|
39
|
+
"typescript": "^5.4.5"
|
|
40
|
+
},
|
|
41
|
+
"description": ""
|
|
42
|
+
}
|