erpnext-queue-client 1.34.1 → 1.34.2

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.
@@ -381,7 +381,7 @@ export declare class ERPNextServicecase {
381
381
  agreed_terms?: string | null | undefined;
382
382
  }>;
383
383
  getServicecasesExtended({ email, id, priority, }: {
384
- email: string;
384
+ email?: string;
385
385
  id?: string;
386
386
  priority?: number;
387
387
  }): Promise<{
@@ -72,22 +72,44 @@ class ERPNextServicecase {
72
72
  }
73
73
  getServicecasesExtended(_a) {
74
74
  return __awaiter(this, arguments, void 0, function* ({ email, id, priority = 5, }) {
75
- const servicecases = yield this.methodRequest.request({
76
- requestMethod: "GET",
77
- methodName: "servicecases-extended",
78
- params: {
79
- email: email !== null && email !== void 0 ? email : "",
80
- id: id !== null && id !== void 0 ? id : "",
81
- },
82
- inputValidationModel: zod_1.z
83
- .object({
84
- email: zod_1.z.string().email(),
85
- id: zod_1.z.string().optional(),
86
- })
87
- .describe("ServicecaseExtendedInput"),
88
- responseValidationModel: Servicecase_1.ServicecaseMethodResponse,
89
- priority,
90
- });
75
+ let servicecases = [];
76
+ if (email) {
77
+ servicecases = yield this.methodRequest.request({
78
+ requestMethod: "GET",
79
+ methodName: "servicecases-extended",
80
+ params: {
81
+ email: email !== null && email !== void 0 ? email : "",
82
+ id: id !== null && id !== void 0 ? id : "",
83
+ },
84
+ inputValidationModel: zod_1.z
85
+ .object({
86
+ email: zod_1.z.string().email(),
87
+ id: zod_1.z.string().optional(),
88
+ })
89
+ .describe("ServicecaseExtendedInput"),
90
+ responseValidationModel: Servicecase_1.ServicecaseMethodResponse,
91
+ priority,
92
+ });
93
+ }
94
+ else if (id) {
95
+ servicecases = yield this.methodRequest.request({
96
+ requestMethod: "GET",
97
+ methodName: "servicecases-extended-name",
98
+ params: {
99
+ id: id,
100
+ },
101
+ inputValidationModel: zod_1.z
102
+ .object({
103
+ id: zod_1.z.string(),
104
+ })
105
+ .describe("ServicecaseExtendedInput"),
106
+ responseValidationModel: Servicecase_1.ServicecaseMethodResponse,
107
+ priority,
108
+ });
109
+ }
110
+ else {
111
+ throw new Error("Either email or id must be provided");
112
+ }
91
113
  return servicecases;
92
114
  });
93
115
  }
@@ -81,7 +81,7 @@ exports.ReturnItemBase = zod_1.z
81
81
  bundle_parent_item: zod_1.z.string().optional().nullable(),
82
82
  return_quantity: zod_1.z.number(),
83
83
  total_price: zod_1.z.number().optional().nullable(),
84
- return_fee: zod_1.z.number().optional().nullable(),
84
+ return_fee: zod_1.z.number().optional().nullable(), // TODO: Remove when return shipping items is implemented
85
85
  is_complaint: zod_1.z.number(),
86
86
  intent: zod_1.z.enum(["return", "solve"]).optional().nullable(),
87
87
  servicecase_reason: zod_1.z.string().optional().nullable(),
@@ -90,7 +90,7 @@ exports.ReturnItemBase = zod_1.z
90
90
  complaint_description: zod_1.z.string().optional().nullable(),
91
91
  internal_reasons: zod_1.z.string().optional().nullable(),
92
92
  attachments: zod_1.z.string().optional().nullable(),
93
- return_label: zod_1.z.string().optional().nullable(),
93
+ return_label: zod_1.z.string().optional().nullable(), // TODO: Remove when return shipping items is implemented
94
94
  })
95
95
  .describe("ReturnItemBase");
96
96
  exports.ReturnItemInput = exports.ReturnItemBase.extend({
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.34.1",
28
+ "version": "1.34.2",
29
29
  "devDependencies": {
30
30
  "@types/crypto-js": "^4.2.2",
31
31
  "@types/lodash": "^4.17.13",