erpnext-queue-client 2.4.1 → 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.
@@ -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.1",
33
+ "version": "2.4.3",
34
34
  "devDependencies": {
35
35
  "@types/crypto-js": "^4.2.2",
36
36
  "@types/lodash": "^4.17.13",