@longvansoftware/service-js-client 1.15.3 → 1.15.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/orderGraphQL/queries.d.ts +7 -5
- package/dist/src/graphql/orderGraphQL/queries.js +11 -1
- package/dist/src/lib/auth/index.d.ts +1 -1
- package/dist/src/lib/auth/index.js +3 -4
- package/dist/src/lib/orderGraphQL/index.d.ts +1 -0
- package/dist/src/lib/orderGraphQL/index.js +16 -0
- package/package.json +1 -1
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
export declare const
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
export declare const
|
1
|
+
import { DocumentNode } from "graphql";
|
2
|
+
export declare const GET_ORDER_DETAIL: DocumentNode;
|
3
|
+
export declare const GET_ORDER_DETAIL_DYNAMIC: (fields?: string[]) => DocumentNode;
|
4
|
+
export declare const GET_QUANTITY_ORDER_LINEITEMS: DocumentNode;
|
5
|
+
export declare const GET_ORDER_LINE_ITEM_BY_SERVICE_ID: DocumentNode;
|
6
|
+
export declare const GET_ORDER_BY_SERVICE_ID: DocumentNode;
|
7
|
+
export declare const FIND_ORDER_BY_OWNER_PARTYID: DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL = void 0;
|
3
|
+
exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL_DYNAMIC = exports.GET_ORDER_DETAIL = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
|
6
6
|
query getOrderDetail($orderId: String!) {
|
@@ -154,6 +154,16 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
|
|
154
154
|
}
|
155
155
|
}
|
156
156
|
`;
|
157
|
+
const GET_ORDER_DETAIL_DYNAMIC = (fields = []) => {
|
158
|
+
const fieldStr = fields.join("\n ");
|
159
|
+
const hasFields = fields.length > 0;
|
160
|
+
return (0, graphql_tag_1.gql) `
|
161
|
+
query getOrderDetail($orderId: String!) {
|
162
|
+
orderDetail(orderId: $orderId) ${hasFields ? `{ ${fieldStr} }` : ""}
|
163
|
+
}
|
164
|
+
`;
|
165
|
+
};
|
166
|
+
exports.GET_ORDER_DETAIL_DYNAMIC = GET_ORDER_DETAIL_DYNAMIC;
|
157
167
|
exports.GET_QUANTITY_ORDER_LINEITEMS = (0, graphql_tag_1.gql) `
|
158
168
|
query getOrderDetail($orderId: String!) {
|
159
169
|
orderDetail(orderId: $orderId) {
|
@@ -32,7 +32,7 @@ export declare class AuthService extends Service {
|
|
32
32
|
getUserLoginByToken(accessToken: string): Promise<any>;
|
33
33
|
updateProfile(userLoginId: string, name: string, phone: string, email: string): Promise<any>;
|
34
34
|
createUserDetail(userLoginId: string): Promise<any>;
|
35
|
-
updateInfo(
|
35
|
+
updateInfo(accessToken: string, updateUserRequest: UpdateInfoRequest['updateUserRequest'], type: string, password: string | null): Promise<any>;
|
36
36
|
linkingUserLoginAndUserDetail(userLoginId: string, partyId: string): Promise<any>;
|
37
37
|
getUserLoginByUserLoginId(userLoginId: string): Promise<any>;
|
38
38
|
checkUsernameExisted(username: string): Promise<any>;
|
@@ -174,11 +174,11 @@ class AuthService extends serviceSDK_1.Service {
|
|
174
174
|
}
|
175
175
|
});
|
176
176
|
}
|
177
|
-
updateInfo(
|
177
|
+
updateInfo(accessToken, updateUserRequest, type, password) {
|
178
178
|
return __awaiter(this, void 0, void 0, function* () {
|
179
179
|
const mutation = mutations_1.UPDATE_INFO_MUTATION;
|
180
180
|
const variables = {
|
181
|
-
orgId,
|
181
|
+
orgId: this.orgId,
|
182
182
|
accessToken,
|
183
183
|
updateUserRequest: {
|
184
184
|
fullName: updateUserRequest.fullName,
|
@@ -189,14 +189,13 @@ class AuthService extends serviceSDK_1.Service {
|
|
189
189
|
gender: updateUserRequest.gender || null,
|
190
190
|
imageUrl: updateUserRequest.imageUrl || null,
|
191
191
|
personalTitle: updateUserRequest.personalTitle || null,
|
192
|
+
birthDate: updateUserRequest.birthDate || null,
|
192
193
|
},
|
193
194
|
type,
|
194
195
|
password,
|
195
196
|
};
|
196
|
-
console.log("variables", variables);
|
197
197
|
try {
|
198
198
|
const response = yield this.graphqlMutation(mutation, variables);
|
199
|
-
console.log("res update", response);
|
200
199
|
return response.updateInfo;
|
201
200
|
}
|
202
201
|
catch (error) {
|
@@ -5,6 +5,7 @@ export declare class OrderGraphQLService extends Service {
|
|
5
5
|
setStoreId(storeId: string): void;
|
6
6
|
createOrder(input: any): Promise<any>;
|
7
7
|
getOrderDetail(orderId: string): Promise<any>;
|
8
|
+
getOrderDetailDynamic(orderId: string, fields: string[]): Promise<any>;
|
8
9
|
getQuantityOrderLineItems(orderId: string): Promise<any>;
|
9
10
|
updateQuantityV2(payload: any): Promise<any>;
|
10
11
|
getOrderLineItemByServiceId(serviceId: string): Promise<any>;
|
@@ -55,6 +55,22 @@ class OrderGraphQLService extends serviceSDK_1.Service {
|
|
55
55
|
}
|
56
56
|
});
|
57
57
|
}
|
58
|
+
getOrderDetailDynamic(orderId, fields) {
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
60
|
+
const query = (0, queries_1.GET_ORDER_DETAIL_DYNAMIC)(fields);
|
61
|
+
const variables = {
|
62
|
+
orderId,
|
63
|
+
};
|
64
|
+
try {
|
65
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
66
|
+
return response.orderDetail;
|
67
|
+
}
|
68
|
+
catch (error) {
|
69
|
+
console.log(`Error in orderDetailDynamic: ${error}`);
|
70
|
+
throw error;
|
71
|
+
}
|
72
|
+
});
|
73
|
+
}
|
58
74
|
getQuantityOrderLineItems(orderId) {
|
59
75
|
return __awaiter(this, void 0, void 0, function* () {
|
60
76
|
const query = queries_1.GET_QUANTITY_ORDER_LINEITEMS;
|