erpnext-queue-client 2.4.2 → 2.4.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.
@@ -336,7 +336,7 @@ export declare const PurchaseOrder: z.ZodObject<{
336
336
  taxes: z.ZodArray<z.ZodAny, "many"> & {
337
337
  __optionalForInput: true;
338
338
  };
339
- payment_schedule: z.ZodOptional<z.ZodArray<z.ZodObject<{
339
+ payment_schedule: z.ZodArray<z.ZodObject<{
340
340
  payment_term: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
341
341
  description: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
342
342
  due_date: z.ZodString;
@@ -378,7 +378,9 @@ export declare const PurchaseOrder: z.ZodObject<{
378
378
  base_payment_amount?: number | null | undefined;
379
379
  discount_type?: any;
380
380
  discount_date?: any;
381
- }>, "many">>;
381
+ }>, "many"> & {
382
+ __optionalForInput: true;
383
+ };
382
384
  }, "strip", z.ZodTypeAny, {
383
385
  company: string;
384
386
  is_internal_supplier: number;
@@ -459,6 +461,21 @@ export declare const PurchaseOrder: z.ZodObject<{
459
461
  supplier: string;
460
462
  is_subcontracted: number;
461
463
  supplied_items: any[];
464
+ payment_schedule: {
465
+ due_date: string;
466
+ payment_amount: number;
467
+ description?: any;
468
+ payment_term?: any;
469
+ mode_of_payment?: any;
470
+ paid_amount?: number | null | undefined;
471
+ invoice_portion?: number | null | undefined;
472
+ discount?: number | null | undefined;
473
+ outstanding?: number | null | undefined;
474
+ discounted_amount?: number | null | undefined;
475
+ base_payment_amount?: number | null | undefined;
476
+ discount_type?: any;
477
+ discount_date?: any;
478
+ }[];
462
479
  transaction_date: string;
463
480
  status?: string | null | undefined;
464
481
  doctype?: string | null | undefined;
@@ -529,21 +546,6 @@ export declare const PurchaseOrder: z.ZodObject<{
529
546
  payment_terms_template?: string | null | undefined;
530
547
  party_account_currency?: string | null | undefined;
531
548
  per_received?: number | null | undefined;
532
- payment_schedule?: {
533
- due_date: string;
534
- payment_amount: number;
535
- description?: any;
536
- payment_term?: any;
537
- mode_of_payment?: any;
538
- paid_amount?: number | null | undefined;
539
- invoice_portion?: number | null | undefined;
540
- discount?: number | null | undefined;
541
- outstanding?: number | null | undefined;
542
- discounted_amount?: number | null | undefined;
543
- base_payment_amount?: number | null | undefined;
544
- discount_type?: any;
545
- discount_date?: any;
546
- }[] | undefined;
547
549
  schedule_date?: string | null | undefined;
548
550
  supplier_address?: string | null | undefined;
549
551
  supplier_warehouse?: any;
@@ -641,6 +643,21 @@ export declare const PurchaseOrder: z.ZodObject<{
641
643
  supplier: string;
642
644
  is_subcontracted: number;
643
645
  supplied_items: any[];
646
+ payment_schedule: {
647
+ due_date: string;
648
+ payment_amount: number;
649
+ description?: any;
650
+ payment_term?: any;
651
+ mode_of_payment?: any;
652
+ paid_amount?: number | null | undefined;
653
+ invoice_portion?: number | null | undefined;
654
+ discount?: number | null | undefined;
655
+ outstanding?: number | null | undefined;
656
+ discounted_amount?: number | null | undefined;
657
+ base_payment_amount?: number | null | undefined;
658
+ discount_type?: any;
659
+ discount_date?: any;
660
+ }[];
644
661
  transaction_date: string;
645
662
  status?: string | null | undefined;
646
663
  doctype?: string | null | undefined;
@@ -711,21 +728,6 @@ export declare const PurchaseOrder: z.ZodObject<{
711
728
  payment_terms_template?: string | null | undefined;
712
729
  party_account_currency?: string | null | undefined;
713
730
  per_received?: number | null | undefined;
714
- payment_schedule?: {
715
- due_date: string;
716
- payment_amount: number;
717
- description?: any;
718
- payment_term?: any;
719
- mode_of_payment?: any;
720
- paid_amount?: number | null | undefined;
721
- invoice_portion?: number | null | undefined;
722
- discount?: number | null | undefined;
723
- outstanding?: number | null | undefined;
724
- discounted_amount?: number | null | undefined;
725
- base_payment_amount?: number | null | undefined;
726
- discount_type?: any;
727
- discount_date?: any;
728
- }[] | undefined;
729
731
  schedule_date?: string | null | undefined;
730
732
  supplier_address?: string | null | undefined;
731
733
  supplier_warehouse?: any;
@@ -191,6 +191,6 @@ exports.PurchaseOrder = zod_1.z
191
191
  pricing_rules: (0, zodContextOptionals_1.optionalForInput)(zod_1.z.array(zod_1.z.any())),
192
192
  supplied_items: (0, zodContextOptionals_1.optionalForInput)(zod_1.z.array(zod_1.z.any())),
193
193
  taxes: (0, zodContextOptionals_1.optionalForInput)(zod_1.z.array(zod_1.z.any())),
194
- payment_schedule: zod_1.z.array(PaymentSchedule).optional(),
194
+ payment_schedule: (0, zodContextOptionals_1.optionalForInput)(zod_1.z.array(PaymentSchedule)),
195
195
  })
196
196
  .describe("PurchaseOrder");
@@ -20,7 +20,8 @@ function ResourceInput(schema) {
20
20
  function makeMarkedKeysOptional(shape) {
21
21
  const newShape = zod_1.z.object({}).shape;
22
22
  for (const [key, value] of Object.entries(shape)) {
23
- if (isMarkedOptionalForInput(value)) {
23
+ const markedAsOptionalForInput = isMarkedOptionalForInput(value);
24
+ if (markedAsOptionalForInput) {
24
25
  newShape[key] = value.optional();
25
26
  }
26
27
  else {
@@ -29,14 +30,20 @@ function ResourceInput(schema) {
29
30
  // Recurse one level into nested objects to apply the same optionalization
30
31
  if (value instanceof zod_1.z.ZodObject) {
31
32
  const innerShape = value.shape;
32
- newShape[key] = zod_1.z.object(makeMarkedKeysOptional(innerShape));
33
+ const result = zod_1.z.object(makeMarkedKeysOptional(innerShape));
34
+ newShape[key] = markedAsOptionalForInput
35
+ ? result.optional()
36
+ : result;
33
37
  }
34
38
  else if (value instanceof zod_1.ZodArray) {
35
39
  const arrayElement = value.element;
36
40
  // Only recurse if the array element is a ZodObject
37
41
  if (arrayElement instanceof zod_1.z.ZodObject) {
38
42
  const arrayElementShape = arrayElement.shape;
39
- newShape[key] = zod_1.z.array(zod_1.z.object(makeMarkedKeysOptional(arrayElementShape)));
43
+ const result = zod_1.z.array(zod_1.z.object(makeMarkedKeysOptional(arrayElementShape)));
44
+ newShape[key] = markedAsOptionalForInput
45
+ ? result.optional()
46
+ : result;
40
47
  }
41
48
  // else: keep the original array type (already assigned above)
42
49
  }
package/package.json CHANGED
@@ -30,7 +30,7 @@
30
30
  "winston": "^3.15.0",
31
31
  "zod": "3.25.76"
32
32
  },
33
- "version": "2.4.2",
33
+ "version": "2.4.3",
34
34
  "devDependencies": {
35
35
  "@types/crypto-js": "^4.2.2",
36
36
  "@types/lodash": "^4.17.13",