@longvansoftware/service-js-client 1.3.9 → 1.4.0

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.
@@ -449,4 +449,22 @@ export declare class OrderService extends Service {
449
449
  deleteNoteWithoutLogin(orderId: string, noteId: string, deletedBy: string): Promise<any>;
450
450
  updateOrderDescription(orderId: string, description: string): Promise<any>;
451
451
  getOrderDetail(orderId: string): Promise<any>;
452
+ /**
453
+ * get list order realation
454
+ * @param orderId - The id of order
455
+ * @param orderItemId - The id of note
456
+ * @param reason - The id of person delete
457
+ * @param updated_by
458
+ * @returns A prom that resolves when the customer and shipping address are updated.
459
+ * @throws If an error occurs while updating the customer and shipping address.
460
+ */
461
+ deleteProductInOrderWithoutLogin(orderId: string, orderItemId: string, reason: string, updated_by: string): Promise<any>;
462
+ /**
463
+ * get list order realation
464
+ * @param orderId - The id of order
465
+ * @param updated_by
466
+ * @returns A prom that resolves when the customer and shipping address are updated.
467
+ * @throws If an error occurs while updating the customer and shipping address.
468
+ */
469
+ addProductInOrderWithoutLogin(orderId: string, updated_by: string, data: any): Promise<any>;
452
470
  }
@@ -1185,7 +1185,7 @@ class OrderService extends serviceSDK_1.Service {
1185
1185
  const method = "PUT";
1186
1186
  try {
1187
1187
  const response = yield this.restApiCallWithToken(endpoint, method, description, {
1188
- 'Content-Type': 'text/plain'
1188
+ "Content-Type": "text/plain",
1189
1189
  });
1190
1190
  return response;
1191
1191
  }
@@ -1197,7 +1197,51 @@ class OrderService extends serviceSDK_1.Service {
1197
1197
  }
1198
1198
  getOrderDetail(orderId) {
1199
1199
  return __awaiter(this, void 0, void 0, function* () {
1200
- return this.restApiCallWithToken(`/orders/${this.orgId}/${this.storeId}/${orderId}/sale_order`, 'GET');
1200
+ return this.restApiCallWithToken(`/orders/${this.orgId}/${this.storeId}/${orderId}/sale_order`, "GET");
1201
+ });
1202
+ }
1203
+ /**
1204
+ * get list order realation
1205
+ * @param orderId - The id of order
1206
+ * @param orderItemId - The id of note
1207
+ * @param reason - The id of person delete
1208
+ * @param updated_by
1209
+ * @returns A prom that resolves when the customer and shipping address are updated.
1210
+ * @throws If an error occurs while updating the customer and shipping address.
1211
+ */
1212
+ deleteProductInOrderWithoutLogin(orderId, orderItemId, reason, updated_by) {
1213
+ return __awaiter(this, void 0, void 0, function* () {
1214
+ const endpoint = `/front/orders/${this.orgId}/${this.storeId}/${orderId}/${orderItemId}/remove?updated_by=${updated_by}&reason=${reason}`;
1215
+ const method = "DELETE";
1216
+ try {
1217
+ const response = yield this.restApiCallWithToken(endpoint, method);
1218
+ return response;
1219
+ }
1220
+ catch (error) {
1221
+ console.log(`Error in deleteNoteWithoutLogin: ${error}`);
1222
+ throw error;
1223
+ }
1224
+ });
1225
+ }
1226
+ /**
1227
+ * get list order realation
1228
+ * @param orderId - The id of order
1229
+ * @param updated_by
1230
+ * @returns A prom that resolves when the customer and shipping address are updated.
1231
+ * @throws If an error occurs while updating the customer and shipping address.
1232
+ */
1233
+ addProductInOrderWithoutLogin(orderId, updated_by, data) {
1234
+ return __awaiter(this, void 0, void 0, function* () {
1235
+ const endpoint = `/front/orders/${this.orgId}/${this.storeId}/${orderId}/orderLineItem?updated_by=${updated_by}`;
1236
+ const method = "POST";
1237
+ try {
1238
+ const response = yield this.restApiCallWithToken(endpoint, method, data);
1239
+ return response;
1240
+ }
1241
+ catch (error) {
1242
+ console.log(`Error in deleteNoteWithoutLogin: ${error}`);
1243
+ throw error;
1244
+ }
1201
1245
  });
1202
1246
  }
1203
1247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.3.9",
3
+ "version": "1.4.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [