@longvansoftware/service-js-client 1.6.5 → 1.6.7
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.
@@ -13,3 +13,5 @@ export declare const CREATE_USER_DETAIL: import("graphql").DocumentNode;
|
|
13
13
|
export declare const LINKING_USER_LOGIN_AND_USER_DETAIL: import("graphql").DocumentNode;
|
14
14
|
export declare const SEND_OTP: import("graphql").DocumentNode;
|
15
15
|
export declare const VALIDATE_OTP: import("graphql").DocumentNode;
|
16
|
+
export declare const CREATE_USER_LOGIN: import("graphql").DocumentNode;
|
17
|
+
export declare const CREATE_USER_DETAIL_WITHOUT_USER_LOGIN: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.VALIDATE_OTP = exports.SEND_OTP = exports.LINKING_USER_LOGIN_AND_USER_DETAIL = exports.CREATE_USER_DETAIL = exports.UPDATE_PROFILE = exports.CHECK_RESET_KEY = exports.CREATE_RESET_KEY = exports.LOGIN_v2 = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
|
3
|
+
exports.CREATE_USER_DETAIL_WITHOUT_USER_LOGIN = exports.CREATE_USER_LOGIN = exports.VALIDATE_OTP = exports.SEND_OTP = exports.LINKING_USER_LOGIN_AND_USER_DETAIL = exports.CREATE_USER_DETAIL = exports.UPDATE_PROFILE = exports.CHECK_RESET_KEY = exports.CREATE_RESET_KEY = exports.LOGIN_v2 = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.LOGIN_MUTATION = (0, graphql_tag_1.gql) `
|
6
6
|
mutation Login($loginRequest: LoginRequest!) {
|
@@ -204,3 +204,37 @@ exports.VALIDATE_OTP = (0, graphql_tag_1.gql) `
|
|
204
204
|
validateOTP(otpCode: $otpCode, phone: $phone)
|
205
205
|
}
|
206
206
|
`;
|
207
|
+
exports.CREATE_USER_LOGIN = (0, graphql_tag_1.gql) `
|
208
|
+
mutation CreateUserLogin($userLoginId: String!) {
|
209
|
+
createUserLogin(userLoginId: $userLoginId) {
|
210
|
+
id
|
211
|
+
partyId
|
212
|
+
type
|
213
|
+
username
|
214
|
+
status
|
215
|
+
accessToken
|
216
|
+
}
|
217
|
+
}
|
218
|
+
`;
|
219
|
+
exports.CREATE_USER_DETAIL_WITHOUT_USER_LOGIN = (0, graphql_tag_1.gql) `
|
220
|
+
mutation CreateUserDetailWithoutUserLogin(
|
221
|
+
$name: String!
|
222
|
+
$phone: String!
|
223
|
+
$email: String
|
224
|
+
$partnerId: String!
|
225
|
+
) {
|
226
|
+
createUserDetailWithoutUserLogin(
|
227
|
+
name: $name
|
228
|
+
phone: $phone
|
229
|
+
email: $email
|
230
|
+
partnerId: $partnerId
|
231
|
+
) {
|
232
|
+
id
|
233
|
+
partyId
|
234
|
+
type
|
235
|
+
username
|
236
|
+
status
|
237
|
+
accessToken
|
238
|
+
}
|
239
|
+
}
|
240
|
+
`;
|
@@ -18,7 +18,7 @@ export declare class AuthService extends Service {
|
|
18
18
|
* @param loginRequest - The login request object.
|
19
19
|
* @returns A promise that resolves to the login response.
|
20
20
|
*/
|
21
|
-
login(loginRequest:
|
21
|
+
login(loginRequest: any): Promise<LoginResponse>;
|
22
22
|
/**
|
23
23
|
* Registers a new user with the provided register request.
|
24
24
|
* @param registerRequest - The register request object.
|
@@ -38,4 +38,6 @@ export declare class AuthService extends Service {
|
|
38
38
|
getUserLoginsByPartyId(partyId: string): Promise<any>;
|
39
39
|
sendOTP(phone: string): Promise<any>;
|
40
40
|
validateOTP(otpCode: string, phone: string): Promise<any>;
|
41
|
+
createUserLogin(userLoginId: string): Promise<any>;
|
42
|
+
createUserDetailWithoutUserLogin(name: string, phone: string, email: string): Promise<any>;
|
41
43
|
}
|
@@ -242,13 +242,13 @@ class AuthService extends serviceSDK_1.Service {
|
|
242
242
|
}
|
243
243
|
sendOTP(phone) {
|
244
244
|
return __awaiter(this, void 0, void 0, function* () {
|
245
|
-
const
|
245
|
+
const mutation = mutations_1.SEND_OTP;
|
246
246
|
const variables = {
|
247
247
|
orgId: this.orgId,
|
248
248
|
phone,
|
249
249
|
};
|
250
250
|
try {
|
251
|
-
const response = yield this.graphqlMutation(
|
251
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
252
252
|
return response.sendOTP;
|
253
253
|
}
|
254
254
|
catch (error) {
|
@@ -259,13 +259,13 @@ class AuthService extends serviceSDK_1.Service {
|
|
259
259
|
}
|
260
260
|
validateOTP(otpCode, phone) {
|
261
261
|
return __awaiter(this, void 0, void 0, function* () {
|
262
|
-
const
|
262
|
+
const mutation = mutations_1.VALIDATE_OTP;
|
263
263
|
const variables = {
|
264
264
|
otpCode,
|
265
265
|
phone,
|
266
266
|
};
|
267
267
|
try {
|
268
|
-
const response = yield this.graphqlMutation(
|
268
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
269
269
|
return response.validateOTP;
|
270
270
|
}
|
271
271
|
catch (error) {
|
@@ -274,5 +274,40 @@ class AuthService extends serviceSDK_1.Service {
|
|
274
274
|
}
|
275
275
|
});
|
276
276
|
}
|
277
|
+
createUserLogin(userLoginId) {
|
278
|
+
return __awaiter(this, void 0, void 0, function* () {
|
279
|
+
const mutation = mutations_1.CREATE_USER_LOGIN;
|
280
|
+
const variables = {
|
281
|
+
userLoginId,
|
282
|
+
};
|
283
|
+
try {
|
284
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
285
|
+
return response.createUserLogin;
|
286
|
+
}
|
287
|
+
catch (error) {
|
288
|
+
console.log(`Error in createUserLogin: ${error}`);
|
289
|
+
throw error;
|
290
|
+
}
|
291
|
+
});
|
292
|
+
}
|
293
|
+
createUserDetailWithoutUserLogin(name, phone, email) {
|
294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
295
|
+
const mutation = mutations_1.CREATE_USER_DETAIL_WITHOUT_USER_LOGIN;
|
296
|
+
const variables = {
|
297
|
+
name,
|
298
|
+
phone,
|
299
|
+
email,
|
300
|
+
partnerId: this.orgId,
|
301
|
+
};
|
302
|
+
try {
|
303
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
304
|
+
return response.createUserDetailWithoutUserLogin;
|
305
|
+
}
|
306
|
+
catch (error) {
|
307
|
+
console.log(`Error in createUserDetailWithoutUserLogin: ${error}`);
|
308
|
+
throw error;
|
309
|
+
}
|
310
|
+
});
|
311
|
+
}
|
277
312
|
}
|
278
313
|
exports.AuthService = AuthService;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { LineItem,
|
1
|
+
import { LineItem, CancelOrder, MemberDiscount, CampaignPromotion, OrderQuery } from "../../types/order";
|
2
2
|
import { Service } from "../serviceSDK";
|
3
3
|
/**
|
4
4
|
* Represents a service for managing orders.
|
@@ -130,7 +130,7 @@ export declare class OrderService extends Service {
|
|
130
130
|
* @returns A promise that resolves when the customer and shipping address are updated.
|
131
131
|
* @throws If an error occurs while updating the customer and shipping address.
|
132
132
|
*/
|
133
|
-
updateDiscountPriceInOrder(orderId: string, orderItemId: string, requestData:
|
133
|
+
updateDiscountPriceInOrder(orderId: string, orderItemId: string, requestData: any): Promise<any>;
|
134
134
|
/**
|
135
135
|
* Update cancel order
|
136
136
|
* @param orderId - The ID of the order.
|
@@ -307,7 +307,9 @@ class OrderService extends serviceSDK_1.Service {
|
|
307
307
|
* @returns A promise that resolves when the customer and shipping address are updated.
|
308
308
|
* @throws If an error occurs while updating the customer and shipping address.
|
309
309
|
*/
|
310
|
-
updateDiscountPriceInOrder(orderId, orderItemId, requestData
|
310
|
+
updateDiscountPriceInOrder(orderId, orderItemId, requestData
|
311
|
+
//DiscountCampaign
|
312
|
+
) {
|
311
313
|
return __awaiter(this, void 0, void 0, function* () {
|
312
314
|
const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/${orderItemId}/discount`;
|
313
315
|
const method = "PUT";
|