@longvansoftware/storefront-js-client 4.3.2 → 4.3.4
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/src/graphql/auth/queries.d.ts +1 -0
- package/dist/src/graphql/auth/queries.js +11 -1
- package/dist/src/graphql/user/mutations.d.ts +2 -0
- package/dist/src/graphql/user/mutations.js +62 -3
- package/dist/src/graphql/user/queries.d.ts +1 -0
- package/dist/src/graphql/user/queries.js +24 -1
- package/dist/src/lib/auth/index.d.ts +1 -0
- package/dist/src/lib/auth/index.js +15 -0
- package/dist/src/lib/user/index.d.ts +3 -0
- package/dist/src/lib/user/index.js +49 -1
- package/dist/src/types/user.d.ts +1 -0
- package/package.json +1 -1
|
@@ -12,3 +12,4 @@ export declare const GET_MENUS: import("graphql").DocumentNode;
|
|
|
12
12
|
export declare const GET_WORK_SPACES: import("graphql").DocumentNode;
|
|
13
13
|
export declare const GET_ORGANIZATION_BY_ID: import("graphql").DocumentNode;
|
|
14
14
|
export declare const SHOW_LOGIN_SOCIAL: import("graphql").DocumentNode;
|
|
15
|
+
export declare const GET_PARTY_DETAILS_BY_PHONE: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SHOW_LOGIN_SOCIAL = exports.GET_ORGANIZATION_BY_ID = exports.GET_WORK_SPACES = exports.GET_MENUS = exports.GET_ORGANIZATIONS_BY_PARTY_ID = exports.GET_ACCESS_TOKEN_BY_OTP_QUERY = exports.CHECK_USER_LOGIN = exports.LOGIN_ZALO = exports.LOGIN_FACEBOOK = exports.LOGIN_GOOGLE = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
|
3
|
+
exports.GET_PARTY_DETAILS_BY_PHONE = exports.SHOW_LOGIN_SOCIAL = exports.GET_ORGANIZATION_BY_ID = exports.GET_WORK_SPACES = exports.GET_MENUS = exports.GET_ORGANIZATIONS_BY_PARTY_ID = exports.GET_ACCESS_TOKEN_BY_OTP_QUERY = exports.CHECK_USER_LOGIN = exports.LOGIN_ZALO = exports.LOGIN_FACEBOOK = exports.LOGIN_GOOGLE = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetUserDetail($orgId: String!, $accessToken: String!) {
|
|
@@ -225,3 +225,13 @@ exports.SHOW_LOGIN_SOCIAL = (0, graphql_tag_1.gql) `
|
|
|
225
225
|
showLoginSocial(orgId: $orgId, serviceOperator: $serviceOperator)
|
|
226
226
|
}
|
|
227
227
|
`;
|
|
228
|
+
exports.GET_PARTY_DETAILS_BY_PHONE = (0, graphql_tag_1.gql) `
|
|
229
|
+
query GetPartyDetailsByPhone($phone: String!) {
|
|
230
|
+
getPartyDetailsByPhone(phone: $phone) {
|
|
231
|
+
id
|
|
232
|
+
name
|
|
233
|
+
phone
|
|
234
|
+
email
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
`;
|
|
@@ -3,3 +3,5 @@ export declare const UPDATE_COMPANY_INFOR: import("graphql").DocumentNode;
|
|
|
3
3
|
export declare const UPDATE_CUSTOMER_V2: import("graphql").DocumentNode;
|
|
4
4
|
export declare const CREATE_CUSTOMER_V2: import("graphql").DocumentNode;
|
|
5
5
|
export declare const CREATE_VAT_INFO: import("graphql").DocumentNode;
|
|
6
|
+
export declare const CREATE_RELATED_PARTY: import("graphql").DocumentNode;
|
|
7
|
+
export declare const UPDATE_RELATED_PARTY: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CREATE_VAT_INFO = exports.CREATE_CUSTOMER_V2 = exports.UPDATE_CUSTOMER_V2 = exports.UPDATE_COMPANY_INFOR = exports.CREATE_COMPANY = void 0;
|
|
3
|
+
exports.UPDATE_RELATED_PARTY = exports.CREATE_RELATED_PARTY = exports.CREATE_VAT_INFO = exports.CREATE_CUSTOMER_V2 = exports.UPDATE_CUSTOMER_V2 = exports.UPDATE_COMPANY_INFOR = exports.CREATE_COMPANY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.CREATE_COMPANY = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation CreateCompany(
|
|
@@ -82,6 +82,7 @@ exports.UPDATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
|
|
|
82
82
|
createdStamp
|
|
83
83
|
createdBy
|
|
84
84
|
memberLevel
|
|
85
|
+
sourceCustomer
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
`;
|
|
@@ -93,7 +94,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
|
|
|
93
94
|
$birthDate: DateCustom
|
|
94
95
|
$tenantId: String!
|
|
95
96
|
$createdBy: String
|
|
96
|
-
$
|
|
97
|
+
$sourceCustomer: String
|
|
97
98
|
) {
|
|
98
99
|
createCustomerV2(
|
|
99
100
|
name: $name
|
|
@@ -102,7 +103,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
|
|
|
102
103
|
birthDate: $birthDate
|
|
103
104
|
tenantId: $tenantId
|
|
104
105
|
createdBy: $createdBy
|
|
105
|
-
|
|
106
|
+
sourceCustomer: $sourceCustomer
|
|
106
107
|
) {
|
|
107
108
|
id
|
|
108
109
|
name
|
|
@@ -115,6 +116,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
|
|
|
115
116
|
createdStamp
|
|
116
117
|
createdBy
|
|
117
118
|
memberLevel
|
|
119
|
+
sourceCustomer
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
`;
|
|
@@ -151,3 +153,60 @@ exports.CREATE_VAT_INFO = (0, graphql_tag_1.gql) `
|
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
`;
|
|
156
|
+
exports.CREATE_RELATED_PARTY = (0, graphql_tag_1.gql) `
|
|
157
|
+
mutation CreateRelatedParty(
|
|
158
|
+
$orgId: String!
|
|
159
|
+
$name: String
|
|
160
|
+
$phone: String
|
|
161
|
+
$relationshipName: String
|
|
162
|
+
$email: String
|
|
163
|
+
$birthDate: DateCustom
|
|
164
|
+
$createdBy: String!
|
|
165
|
+
$partyId: String
|
|
166
|
+
) {
|
|
167
|
+
createRelatedParty(
|
|
168
|
+
orgId: $orgId
|
|
169
|
+
name: $name
|
|
170
|
+
phone: $phone
|
|
171
|
+
relationshipName: $relationshipName
|
|
172
|
+
email: $email
|
|
173
|
+
birthDate: $birthDate
|
|
174
|
+
createdBy: $createdBy
|
|
175
|
+
partyId: $partyId
|
|
176
|
+
) {
|
|
177
|
+
id
|
|
178
|
+
name
|
|
179
|
+
address
|
|
180
|
+
gender
|
|
181
|
+
identityNumber
|
|
182
|
+
birthDate
|
|
183
|
+
email
|
|
184
|
+
phone
|
|
185
|
+
createdStamp
|
|
186
|
+
createdBy
|
|
187
|
+
memberLevel
|
|
188
|
+
imageUrl
|
|
189
|
+
customAttribute
|
|
190
|
+
relationshipName
|
|
191
|
+
source
|
|
192
|
+
sourceCustomer
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
`;
|
|
196
|
+
exports.UPDATE_RELATED_PARTY = (0, graphql_tag_1.gql) `
|
|
197
|
+
mutation UpdateRelatedParty(
|
|
198
|
+
$relatedPartyId: String!
|
|
199
|
+
$partyId: String!
|
|
200
|
+
$updateRelatedPartyRequest: UpdateRelatedPartyRequest!
|
|
201
|
+
$orgId: String!
|
|
202
|
+
$updatedBy: String!
|
|
203
|
+
) {
|
|
204
|
+
updateRelatedParty(
|
|
205
|
+
relatedPartyId: $relatedPartyId
|
|
206
|
+
partyId: $partyId
|
|
207
|
+
updateRelatedPartyRequest: $updateRelatedPartyRequest
|
|
208
|
+
orgId: $orgId
|
|
209
|
+
updatedBy: $updatedBy
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
`;
|
|
@@ -14,3 +14,4 @@ export declare const GET_DISTRICTS: import("graphql").DocumentNode;
|
|
|
14
14
|
export declare const GET_WARDS: import("graphql").DocumentNode;
|
|
15
15
|
export declare const GET_PERSON_BY_PARTY_ID: import("graphql").DocumentNode;
|
|
16
16
|
export declare const GET_VAT_INFO_BY_OWNER_PARTYID: import("graphql").DocumentNode;
|
|
17
|
+
export declare const GET_RELATED_PARTIES: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_VAT_INFO_BY_OWNER_PARTYID = exports.GET_PERSON_BY_PARTY_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_WARDS_BY_PROVINCEID = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
3
|
+
exports.GET_RELATED_PARTIES = exports.GET_VAT_INFO_BY_OWNER_PARTYID = exports.GET_PERSON_BY_PARTY_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_WARDS_BY_PROVINCEID = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetPersonByIds($partyIds: [String!]!) {
|
|
@@ -62,6 +62,7 @@ exports.GET_CUSTOMER_BY_ID = (0, graphql_tag_1.gql) `
|
|
|
62
62
|
createdStamp
|
|
63
63
|
createdBy
|
|
64
64
|
memberLevel
|
|
65
|
+
sourceCustomer
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
`;
|
|
@@ -335,3 +336,25 @@ exports.GET_VAT_INFO_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
|
|
|
335
336
|
}
|
|
336
337
|
}
|
|
337
338
|
`;
|
|
339
|
+
exports.GET_RELATED_PARTIES = (0, graphql_tag_1.gql) `
|
|
340
|
+
query GetRelatedParties($partyId: String, $orgId: String) {
|
|
341
|
+
getRelatedParties(partyId: $partyId, orgId: $orgId) {
|
|
342
|
+
id
|
|
343
|
+
name
|
|
344
|
+
address
|
|
345
|
+
gender
|
|
346
|
+
identityNumber
|
|
347
|
+
birthDate
|
|
348
|
+
email
|
|
349
|
+
phone
|
|
350
|
+
createdStamp
|
|
351
|
+
createdBy
|
|
352
|
+
memberLevel
|
|
353
|
+
imageUrl
|
|
354
|
+
customAttribute
|
|
355
|
+
relationshipName
|
|
356
|
+
source
|
|
357
|
+
sourceCustomer
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
`;
|
|
@@ -728,5 +728,20 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
728
728
|
}
|
|
729
729
|
});
|
|
730
730
|
}
|
|
731
|
+
getPartyDetailsByPhone(phone) {
|
|
732
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
733
|
+
const query = queries_1.GET_PARTY_DETAILS_BY_PHONE;
|
|
734
|
+
const variables = {
|
|
735
|
+
phone,
|
|
736
|
+
};
|
|
737
|
+
try {
|
|
738
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
739
|
+
return response.getPartyDetailsByPhone;
|
|
740
|
+
}
|
|
741
|
+
catch (error) {
|
|
742
|
+
throw error;
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
}
|
|
731
746
|
}
|
|
732
747
|
exports.AuthService = AuthService;
|
|
@@ -24,4 +24,7 @@ export declare class UserService extends Service {
|
|
|
24
24
|
getPersonByPartyId(partyId: string): Promise<any>;
|
|
25
25
|
getVatInfoByOwnerPartyId(ownerPartyId: string): Promise<any>;
|
|
26
26
|
createVatInfo(company: string, taxCode: string, invoiceReceiveEmail1: string, ownerPartyId: string, address: string, createdBy: string): Promise<any>;
|
|
27
|
+
getRelatedParties(partyId: string): Promise<any>;
|
|
28
|
+
createRelatedParty(user: Record<string, any>): Promise<any>;
|
|
29
|
+
updateRelatedParty(relatedPartyId: string, partyId: string, updateRelatedPartyRequest: any, updatedBy: string): Promise<any>;
|
|
27
30
|
}
|
|
@@ -131,7 +131,7 @@ class UserService extends serviceSDK_1.Service {
|
|
|
131
131
|
phone: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.phone) || "",
|
|
132
132
|
email: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.email) || "",
|
|
133
133
|
birthDate: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.birthDate) || null,
|
|
134
|
-
|
|
134
|
+
sourceCustomer: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.sourceCustomer) || "",
|
|
135
135
|
tenantId: this.orgId,
|
|
136
136
|
createdBy: createdBy,
|
|
137
137
|
};
|
|
@@ -410,5 +410,53 @@ class UserService extends serviceSDK_1.Service {
|
|
|
410
410
|
}
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
+
getRelatedParties(partyId) {
|
|
414
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
415
|
+
const query = queries_1.GET_RELATED_PARTIES;
|
|
416
|
+
const variables = {
|
|
417
|
+
orgId: this.orgId,
|
|
418
|
+
partyId,
|
|
419
|
+
};
|
|
420
|
+
try {
|
|
421
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
422
|
+
return response.getRelatedParties;
|
|
423
|
+
}
|
|
424
|
+
catch (error) {
|
|
425
|
+
throw error;
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
createRelatedParty(user) {
|
|
430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
431
|
+
const mutation = mutations_1.CREATE_RELATED_PARTY;
|
|
432
|
+
const data = Object.assign({ orgId: this.orgId }, user);
|
|
433
|
+
try {
|
|
434
|
+
const response = yield this.graphqlMutationV2(mutation, data);
|
|
435
|
+
return response.createRelatedParty;
|
|
436
|
+
}
|
|
437
|
+
catch (error) {
|
|
438
|
+
throw error;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
updateRelatedParty(relatedPartyId, partyId, updateRelatedPartyRequest, updatedBy) {
|
|
443
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
444
|
+
const mutation = mutations_1.UPDATE_RELATED_PARTY;
|
|
445
|
+
const data = {
|
|
446
|
+
relatedPartyId,
|
|
447
|
+
partyId,
|
|
448
|
+
updateRelatedPartyRequest,
|
|
449
|
+
orgId: this.orgId,
|
|
450
|
+
updatedBy,
|
|
451
|
+
};
|
|
452
|
+
try {
|
|
453
|
+
const response = yield this.graphqlMutationV2(mutation, data);
|
|
454
|
+
return response.updateRelatedParty;
|
|
455
|
+
}
|
|
456
|
+
catch (error) {
|
|
457
|
+
throw error;
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
}
|
|
413
461
|
}
|
|
414
462
|
exports.UserService = UserService;
|
package/dist/src/types/user.d.ts
CHANGED