erpnext-queue-client 1.26.4 → 1.26.5
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.
|
@@ -110,11 +110,15 @@ class ERPNextResourceRequest {
|
|
|
110
110
|
return __awaiter(this, arguments, void 0, function* ({ resourceName, resourceId, inputValidationModel, resourceModel, body, priority = 5, }) {
|
|
111
111
|
if (resourceModel && !resourceModel.description)
|
|
112
112
|
throw new Error("Resource model must have a description");
|
|
113
|
+
// accept partial input while enforcing allowed keys
|
|
114
|
+
const partialInputValidationModel = inputValidationModel && inputValidationModel instanceof zod_1.ZodObject
|
|
115
|
+
? inputValidationModel.partial().strict()
|
|
116
|
+
: inputValidationModel;
|
|
113
117
|
const result = yield this.temporalClient.executeERPNextRequestWorkflow(`PUT-${resourceName}-${resourceId}`, {
|
|
114
118
|
requestMethod: "PUT",
|
|
115
119
|
resourceId,
|
|
116
120
|
resourceName,
|
|
117
|
-
inputValidationModel,
|
|
121
|
+
inputValidationModel: partialInputValidationModel,
|
|
118
122
|
responseValidationModel: resourceModel
|
|
119
123
|
? zod_1.z
|
|
120
124
|
.object({ data: resourceModel })
|