erpnext-queue-client 1.29.2 → 1.29.3

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.
@@ -1,3 +1,4 @@
1
+ import z from "zod";
1
2
  import { TemporalClient } from "../../client";
2
3
  import { ERPNextDoctypeSubmittableResourceRequest } from "../doctypeSubmittableResourceRequest";
3
4
  import { ERPNextMethodRequest } from "../methodRequest";
@@ -304,7 +305,7 @@ export declare class ERPNextShipment {
304
305
  custom_return_shipping_provider?: string | null | undefined;
305
306
  tracking_status_info?: string | null | undefined;
306
307
  tracking_url?: string | null | undefined;
307
- }> : TInputModel extends import("zod").ZodTypeAny ? Partial<import("zod").TypeOf<TInputModel>> : any, TInputModel extends import("zod").ZodTypeAny | undefined = undefined>({ resourceId, inputValidationModel, body, priority, }: {
308
+ }> : TInputModel extends z.ZodTypeAny ? Partial<z.TypeOf<TInputModel>> : any, TInputModel extends z.ZodTypeAny | undefined = undefined>({ resourceId, inputValidationModel, body, priority, }: {
308
309
  resourceId: string;
309
310
  inputValidationModel?: TInputModel;
310
311
  priority?: number;
@@ -408,7 +409,7 @@ export declare class ERPNextShipment {
408
409
  deleteById: ({ resourceId, priority, }: {
409
410
  resourceId: string;
410
411
  priority?: number;
411
- }) => Promise<import("zod").TypeOf<typeof import("../model/ERPNextResponse").DeleteResponseModel>>;
412
+ }) => Promise<z.TypeOf<typeof import("../model/ERPNextResponse").DeleteResponseModel>>;
412
413
  create: <TInput extends TInputModel extends undefined ? Partial<{
413
414
  status: string;
414
415
  name: string;
@@ -504,7 +505,7 @@ export declare class ERPNextShipment {
504
505
  custom_return_shipping_provider?: string | null | undefined;
505
506
  tracking_status_info?: string | null | undefined;
506
507
  tracking_url?: string | null | undefined;
507
- }> : TInputModel extends import("zod").ZodTypeAny ? import("zod").TypeOf<TInputModel> : any, TInputModel extends import("zod").ZodTypeAny | undefined = undefined>({ inputValidationModel, body, params, priority, }: {
508
+ }> : TInputModel extends z.ZodTypeAny ? z.TypeOf<TInputModel> : any, TInputModel extends z.ZodTypeAny | undefined = undefined>({ inputValidationModel, body, params, priority, }: {
508
509
  inputValidationModel?: TInputModel;
509
510
  body: TInput;
510
511
  params?: Record<string, string>;
@@ -848,6 +849,21 @@ export declare class ERPNextShipment {
848
849
  delivery_contact?: string | undefined;
849
850
  incoterm?: string | null | undefined;
850
851
  }>;
852
+ getShipmentInfoByOrderNumber(orderNumber: string): Promise<{
853
+ name: string;
854
+ address_title: string;
855
+ creation: string;
856
+ item_code: string;
857
+ qty: number;
858
+ item_name: string;
859
+ address_line1?: string | null | undefined;
860
+ address_line2?: string | null | undefined;
861
+ city?: string | null | undefined;
862
+ pincode?: string | null | undefined;
863
+ country?: string | null | undefined;
864
+ image?: string | null | undefined;
865
+ shipping_label?: string | null | undefined;
866
+ }[]>;
851
867
  addShippingLabelAndSubmit(shipmentErpNextName: string, body: ShipmentAddShippingLabelAndSubmitBodyType): Promise<{
852
868
  status: string;
853
869
  name: string;
@@ -8,8 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.ERPNextShipment = void 0;
16
+ const zod_1 = __importDefault(require("zod"));
13
17
  const doctypeSubmittableResourceRequest_1 = require("../doctypeSubmittableResourceRequest");
14
18
  const methodRequest_1 = require("../methodRequest");
15
19
  const Shipment_1 = require("../model/Shipment");
@@ -37,6 +41,33 @@ class ERPNextShipment {
37
41
  return draft;
38
42
  });
39
43
  }
44
+ getShipmentInfoByOrderNumber(orderNumber) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const shipmentInfo = yield this.methodRequest.request({
47
+ methodName: "shipment-by-order-number",
48
+ requestMethod: "GET",
49
+ params: { order_number: orderNumber },
50
+ responseValidationModel: zod_1.default
51
+ .array(zod_1.default.object({
52
+ name: zod_1.default.string(),
53
+ creation: zod_1.default.string(),
54
+ item_code: zod_1.default.string(),
55
+ item_name: zod_1.default.string(),
56
+ qty: zod_1.default.number(),
57
+ address_title: zod_1.default.string(),
58
+ shipping_label: zod_1.default.string().optional().nullable(),
59
+ address_line1: zod_1.default.string().optional().nullable(),
60
+ address_line2: zod_1.default.string().optional().nullable(),
61
+ city: zod_1.default.string().optional().nullable(),
62
+ country: zod_1.default.string().optional().nullable(),
63
+ pincode: zod_1.default.string().optional().nullable(),
64
+ image: zod_1.default.string().optional().nullable(),
65
+ }))
66
+ .describe("Array of shipment info objects"),
67
+ });
68
+ return shipmentInfo;
69
+ });
70
+ }
40
71
  addShippingLabelAndSubmit(shipmentErpNextName, body) {
41
72
  return __awaiter(this, void 0, void 0, function* () {
42
73
  const shipment = yield this.baseRequest.updateById({
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "winston": "^3.15.0",
26
26
  "zod": "3.25.76"
27
27
  },
28
- "version": "1.29.2",
28
+ "version": "1.29.3",
29
29
  "devDependencies": {
30
30
  "@types/crypto-js": "^4.2.2",
31
31
  "@types/lodash": "^4.17.13",