erpnext-queue-client 1.38.0 → 1.39.1

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.
@@ -11,6 +11,8 @@ export declare class ERPNextStock extends ERPNextReports {
11
11
  getBundleStockFromBin(topLevelWarehouse: string): Promise<any>;
12
12
  getStock(topLevelWarehouse: string, options?: {
13
13
  includeBundleStock: boolean;
14
+ respectOversellAmount?: boolean;
15
+ respectStockReserve?: boolean;
14
16
  }): Promise<any>;
15
17
  getCompletedOrderItemAmounts(orderNumbers: string[]): Promise<Record<string, number>>;
16
18
  getStockProjectedQuantityDict(warehouse?: string, sku?: string): Promise<Record<string, {
@@ -55,18 +55,34 @@ class ERPNextStock extends reports_1.ERPNextReports {
55
55
  });
56
56
  }
57
57
  getStock(topLevelWarehouse_1) {
58
- return __awaiter(this, arguments, void 0, function* (topLevelWarehouse, options = { includeBundleStock: false }) {
58
+ return __awaiter(this, arguments, void 0, function* (topLevelWarehouse, options = {
59
+ includeBundleStock: false,
60
+ respectOversellAmount: false,
61
+ respectStockReserve: false,
62
+ }) {
59
63
  const stock = yield this.methodRequest.request({
60
64
  methodName: `get_stock_from_bin`,
61
65
  requestMethod: "GET",
62
- params: { warehouse: topLevelWarehouse },
66
+ params: {
67
+ warehouse: topLevelWarehouse,
68
+ respect_oversell_amount: options.respectOversellAmount
69
+ ? "true"
70
+ : "false",
71
+ respect_stock_reserve: options.respectStockReserve ? "true" : "false",
72
+ },
63
73
  });
64
74
  if (!options.includeBundleStock)
65
75
  return stock;
66
76
  const bundleStock = yield this.methodRequest.request({
67
77
  methodName: `get_bundle_stock_from_bin`,
68
78
  requestMethod: "GET",
69
- params: { warehouse: topLevelWarehouse },
79
+ params: {
80
+ warehouse: topLevelWarehouse,
81
+ respect_oversell_amount: options.respectOversellAmount
82
+ ? "true"
83
+ : "false",
84
+ respect_stock_reserve: options.respectStockReserve ? "true" : "false",
85
+ },
70
86
  });
71
87
  return Object.assign(Object.assign({}, stock), bundleStock);
72
88
  });
@@ -1,9 +1,12 @@
1
1
  import { z } from "zod";
2
2
  export declare const FulfillmentStations: z.ZodArray<z.ZodObject<{
3
3
  fulfillment_station: z.ZodString;
4
+ require_scan_to_print: z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
4
5
  }, "strip", z.ZodTypeAny, {
5
6
  fulfillment_station: string;
7
+ require_scan_to_print?: number | null | undefined;
6
8
  }, {
7
9
  fulfillment_station: string;
10
+ require_scan_to_print?: number | null | undefined;
8
11
  }>, "many">;
9
12
  export type FulfillmentStationsType = z.infer<typeof FulfillmentStations>;
@@ -5,5 +5,6 @@ const zod_1 = require("zod");
5
5
  exports.FulfillmentStations = zod_1.z
6
6
  .array(zod_1.z.object({
7
7
  fulfillment_station: zod_1.z.string(),
8
+ require_scan_to_print: zod_1.z.number().default(0).optional().nullable(),
8
9
  }))
9
10
  .describe("Fulfillment Stations");
@@ -168,7 +168,6 @@ export declare const ServiceportalProductConfiguration: z.ZodObject<{
168
168
  }>, "many">;
169
169
  return_shipping_provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
170
170
  return_instructions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
171
- internal_reasons_section: z.ZodNullable<z.ZodOptional<z.ZodString>>;
172
171
  }, "strip", z.ZodTypeAny, {
173
172
  name: string;
174
173
  doctype: "Serviceportal Product Configuration";
@@ -224,7 +223,6 @@ export declare const ServiceportalProductConfiguration: z.ZodObject<{
224
223
  return_conditions?: string | null | undefined;
225
224
  return_shipping_provider?: string | null | undefined;
226
225
  return_instructions?: string | null | undefined;
227
- internal_reasons_section?: string | null | undefined;
228
226
  }, {
229
227
  name: string;
230
228
  doctype: "Serviceportal Product Configuration";
@@ -280,7 +278,6 @@ export declare const ServiceportalProductConfiguration: z.ZodObject<{
280
278
  return_conditions?: string | null | undefined;
281
279
  return_shipping_provider?: string | null | undefined;
282
280
  return_instructions?: string | null | undefined;
283
- internal_reasons_section?: string | null | undefined;
284
281
  }>;
285
282
  export type ServiceportalProductConfigurationType = z.infer<typeof ServiceportalProductConfiguration>;
286
283
  export declare const ServiceportalProductConfigurationInput: z.ZodObject<Omit<{
@@ -412,7 +409,6 @@ export declare const ServiceportalProductConfigurationInput: z.ZodObject<Omit<{
412
409
  }>, "many">;
413
410
  return_shipping_provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
414
411
  return_instructions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
415
- internal_reasons_section: z.ZodNullable<z.ZodOptional<z.ZodString>>;
416
412
  }, "name" | "owner" | "creation" | "modified" | "modified_by" | "internal_reasons" | "batch_numbers"> & {
417
413
  batch_numbers: z.ZodArray<z.ZodObject<Pick<{
418
414
  name: z.ZodString;
@@ -478,7 +474,6 @@ export declare const ServiceportalProductConfigurationInput: z.ZodObject<Omit<{
478
474
  return_conditions?: string | null | undefined;
479
475
  return_shipping_provider?: string | null | undefined;
480
476
  return_instructions?: string | null | undefined;
481
- internal_reasons_section?: string | null | undefined;
482
477
  }, {
483
478
  doctype: "Serviceportal Product Configuration";
484
479
  title: string;
@@ -507,25 +502,19 @@ export declare const ServiceportalProductConfigurationInput: z.ZodObject<Omit<{
507
502
  return_conditions?: string | null | undefined;
508
503
  return_shipping_provider?: string | null | undefined;
509
504
  return_instructions?: string | null | undefined;
510
- internal_reasons_section?: string | null | undefined;
511
505
  }>;
512
506
  export type ServiceportalProductConfigurationInputType = z.infer<typeof ServiceportalProductConfigurationInput>;
513
507
  export declare const ServiceportalProductConfigurationMethodResponse: z.ZodObject<{
514
508
  name: z.ZodString;
515
- owner: z.ZodString;
516
- creation: z.ZodString;
517
- modified: z.ZodString;
518
- modified_by: z.ZodString;
509
+ doctype: z.ZodLiteral<"Serviceportal Product Configuration">;
519
510
  title: z.ZodString;
520
511
  return_fee: z.ZodNumber;
521
512
  return_fee_explanation: z.ZodNullable<z.ZodOptional<z.ZodString>>;
522
513
  is_ask_for_batch_number: z.ZodNumber;
523
514
  batch_number_location_description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
524
515
  return_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
525
- doctype: z.ZodLiteral<"Serviceportal Product Configuration">;
526
516
  return_shipping_provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
527
517
  return_instructions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
528
- internal_reasons_section: z.ZodNullable<z.ZodOptional<z.ZodString>>;
529
518
  } & {
530
519
  return_fees: z.ZodArray<z.ZodObject<Pick<{
531
520
  name: z.ZodString;
@@ -560,40 +549,25 @@ export declare const ServiceportalProductConfigurationMethodResponse: z.ZodObjec
560
549
  parentfield: z.ZodString;
561
550
  parenttype: z.ZodString;
562
551
  doctype: z.ZodLiteral<"Batch Number List">;
563
- }, "batch_number">, "strip", z.ZodTypeAny, {
552
+ }, "doctype" | "parent" | "parentfield" | "parenttype" | "idx" | "batch_number">, "strip", z.ZodTypeAny, {
553
+ doctype: "Batch Number List";
554
+ parent: string;
555
+ parentfield: string;
556
+ parenttype: string;
557
+ idx: number;
564
558
  batch_number: string;
565
559
  }, {
560
+ doctype: "Batch Number List";
561
+ parent: string;
562
+ parentfield: string;
563
+ parenttype: string;
564
+ idx: number;
566
565
  batch_number: string;
567
566
  }>, "many">;
568
- internal_reasons: z.ZodArray<z.ZodObject<Pick<{
569
- name: z.ZodString;
570
- owner: z.ZodString;
571
- creation: z.ZodString;
572
- modified: z.ZodString;
573
- modified_by: z.ZodString;
574
- docstatus: z.ZodNumber;
575
- idx: z.ZodNumber;
576
- internal_reason: z.ZodString;
577
- parent: z.ZodString;
578
- parentfield: z.ZodString;
579
- parenttype: z.ZodString;
580
- doctype: z.ZodLiteral<"Internal Reasons List">;
581
- }, "internal_reason">, "strip", z.ZodTypeAny, {
582
- internal_reason: string;
583
- }, {
584
- internal_reason: string;
585
- }>, "many">;
586
567
  }, "strip", z.ZodTypeAny, {
587
568
  name: string;
588
569
  doctype: "Serviceportal Product Configuration";
589
- owner: string;
590
- creation: string;
591
- modified: string;
592
- modified_by: string;
593
570
  title: string;
594
- internal_reasons: {
595
- internal_reason: string;
596
- }[];
597
571
  return_fee: number;
598
572
  return_fees: {
599
573
  shipping_provider: string;
@@ -602,6 +576,11 @@ export declare const ServiceportalProductConfigurationMethodResponse: z.ZodObjec
602
576
  }[];
603
577
  is_ask_for_batch_number: number;
604
578
  batch_numbers: {
579
+ doctype: "Batch Number List";
580
+ parent: string;
581
+ parentfield: string;
582
+ parenttype: string;
583
+ idx: number;
605
584
  batch_number: string;
606
585
  }[];
607
586
  return_fee_explanation?: string | null | undefined;
@@ -609,18 +588,10 @@ export declare const ServiceportalProductConfigurationMethodResponse: z.ZodObjec
609
588
  return_conditions?: string | null | undefined;
610
589
  return_shipping_provider?: string | null | undefined;
611
590
  return_instructions?: string | null | undefined;
612
- internal_reasons_section?: string | null | undefined;
613
591
  }, {
614
592
  name: string;
615
593
  doctype: "Serviceportal Product Configuration";
616
- owner: string;
617
- creation: string;
618
- modified: string;
619
- modified_by: string;
620
594
  title: string;
621
- internal_reasons: {
622
- internal_reason: string;
623
- }[];
624
595
  return_fee: number;
625
596
  return_fees: {
626
597
  shipping_provider: string;
@@ -629,6 +600,11 @@ export declare const ServiceportalProductConfigurationMethodResponse: z.ZodObjec
629
600
  }[];
630
601
  is_ask_for_batch_number: number;
631
602
  batch_numbers: {
603
+ doctype: "Batch Number List";
604
+ parent: string;
605
+ parentfield: string;
606
+ parenttype: string;
607
+ idx: number;
632
608
  batch_number: string;
633
609
  }[];
634
610
  return_fee_explanation?: string | null | undefined;
@@ -636,6 +612,5 @@ export declare const ServiceportalProductConfigurationMethodResponse: z.ZodObjec
636
612
  return_conditions?: string | null | undefined;
637
613
  return_shipping_provider?: string | null | undefined;
638
614
  return_instructions?: string | null | undefined;
639
- internal_reasons_section?: string | null | undefined;
640
615
  }>;
641
616
  export type ServiceportalProductConfigurationMethodResponseType = z.infer<typeof ServiceportalProductConfigurationMethodResponse>;
@@ -52,7 +52,6 @@ exports.ServiceportalProductConfiguration = zod_1.z
52
52
  internal_reasons: zod_1.z.array(exports.InternalReasonList),
53
53
  return_shipping_provider: zod_1.z.string().optional().nullable(),
54
54
  return_instructions: zod_1.z.string().optional().nullable(),
55
- internal_reasons_section: zod_1.z.string().optional().nullable(),
56
55
  })
57
56
  .describe("ServiceportalProductConfiguration");
58
57
  exports.ServiceportalProductConfigurationInput = exports.ServiceportalProductConfiguration.omit({
@@ -67,8 +66,27 @@ exports.ServiceportalProductConfigurationInput = exports.ServiceportalProductCon
67
66
  batch_numbers: zod_1.z.array(BatchNumberList.pick({ batch_number: true })),
68
67
  internal_reasons: zod_1.z.array(exports.InternalReasonList.pick({ internal_reason: true })),
69
68
  });
70
- exports.ServiceportalProductConfigurationMethodResponse = exports.ServiceportalProductConfiguration.extend({
69
+ exports.ServiceportalProductConfigurationMethodResponse = exports.ServiceportalProductConfiguration.pick({
70
+ name: true,
71
+ title: true,
72
+ doctype: true,
73
+ return_fee: true,
74
+ return_fee_explanation: true,
75
+ return_fees: true,
76
+ is_ask_for_batch_number: true,
77
+ batch_number_location_description: true,
78
+ return_conditions: true,
79
+ batch_numbers: true,
80
+ return_shipping_provider: true,
81
+ return_instructions: true,
82
+ }).extend({
71
83
  return_fees: zod_1.z.array(ShippingFees_1.ShippingFee.pick({ shipping_provider: true, country: true, fee: true })),
72
- batch_numbers: zod_1.z.array(BatchNumberList.pick({ batch_number: true })),
73
- internal_reasons: zod_1.z.array(exports.InternalReasonList.pick({ internal_reason: true })),
84
+ batch_numbers: zod_1.z.array(BatchNumberList.pick({
85
+ idx: true,
86
+ batch_number: true,
87
+ parent: true,
88
+ parentfield: true,
89
+ parenttype: true,
90
+ doctype: true,
91
+ })),
74
92
  });
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.38.0",
28
+ "version": "1.39.1",
29
29
  "devDependencies": {
30
30
  "@types/crypto-js": "^4.2.2",
31
31
  "@types/lodash": "^4.17.13",