mulink 1.1.3 → 1.1.4
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/lib/{chunk-6SOQENFC.js → chunk-ANAYISGK.js} +22 -7
- package/dist/lib/chunk-ANAYISGK.js.map +1 -0
- package/dist/lib/{chunk-4DCGRNLY.cjs → chunk-FH22JEFH.cjs} +22 -7
- package/dist/lib/chunk-FH22JEFH.cjs.map +1 -0
- package/dist/lib/cli.cjs +16 -16
- package/dist/lib/cli.js +1 -1
- package/dist/lib/client.cjs +18 -18
- package/dist/lib/client.js +2 -2
- package/dist/lib/index.cjs +15 -15
- package/dist/lib/index.js +1 -1
- package/package.json +1 -1
- package/dist/lib/chunk-4DCGRNLY.cjs.map +0 -1
- package/dist/lib/chunk-6SOQENFC.js.map +0 -1
|
@@ -3239,10 +3239,14 @@ ${this.commentsEnabled ? " // In production, send to your logging service\n //
|
|
|
3239
3239
|
}
|
|
3240
3240
|
return parts.join("\n\n");
|
|
3241
3241
|
}
|
|
3242
|
-
buildCombinedValidationSnippet(operationName, schemaName) {
|
|
3242
|
+
buildCombinedValidationSnippet(operationName, schemaName, isMultiLine = false) {
|
|
3243
3243
|
if (this.validationEnabled) {
|
|
3244
|
+
const schemaCode = isMultiLine ? `z.object({
|
|
3245
|
+
body: ${operationName}RequestSchema,
|
|
3246
|
+
params: ${operationName}ParamsSchema
|
|
3247
|
+
})` : schemaName;
|
|
3244
3248
|
return `
|
|
3245
|
-
${this.commentLine("Validate and sanitize input payload", 6)} const { body, params } = await validateAndSanitizeInput(${
|
|
3249
|
+
${this.commentLine("Validate and sanitize input payload", 6)} const { body, params } = await validateAndSanitizeInput(${schemaCode}, parsedInput)
|
|
3246
3250
|
const validatedBody = body
|
|
3247
3251
|
const validatedParams = params as z.infer<typeof ${operationName}ParamsSchema>`;
|
|
3248
3252
|
}
|
|
@@ -3450,7 +3454,8 @@ ${actions}`;
|
|
|
3450
3454
|
body: ${operationName}RequestSchema,
|
|
3451
3455
|
params: ${operationName}ParamsSchema
|
|
3452
3456
|
})`;
|
|
3453
|
-
|
|
3457
|
+
const isMultiLineSchema = schemaName.includes("\n");
|
|
3458
|
+
parameterProcessing = this.buildCombinedValidationSnippet(operationName, schemaName, isMultiLineSchema);
|
|
3454
3459
|
requestOptionsParams = this.buildRequestOptions(pathParameters, queryParameters, true, true);
|
|
3455
3460
|
} else if (hasRequestBody) {
|
|
3456
3461
|
schemaName = `${operationName}RequestSchema`;
|
|
@@ -3933,8 +3938,18 @@ export function ${hookName.replace("use", "useInfinite")}(${parameterTypes.lengt
|
|
|
3933
3938
|
initialPageParam: 1,
|
|
3934
3939
|
queryFn: async ({ pageParam = 1, signal }: { pageParam?: number; signal?: AbortSignal }) => {
|
|
3935
3940
|
try {
|
|
3936
|
-
|
|
3937
|
-
const
|
|
3941
|
+
// Build query params object with only the parameters the endpoint expects
|
|
3942
|
+
const queryParams: Record<string, any> = {}
|
|
3943
|
+
${queryParameters.map((param) => {
|
|
3944
|
+
if (param.name === "page" && hasPageParam) {
|
|
3945
|
+
return `queryParams.${param.name} = pageParam`;
|
|
3946
|
+
} else if (param.name === "limit") {
|
|
3947
|
+
return `queryParams.${param.name} = searchParams.limit`;
|
|
3948
|
+
} else {
|
|
3949
|
+
return `if ('${param.name}' in searchParams) queryParams.${param.name} = searchParams.${param.name}`;
|
|
3950
|
+
}
|
|
3951
|
+
}).join("\n ")}
|
|
3952
|
+
const result = await resolveActionResult<${returnType}>(${actionName}(${actionCallParams.replace(queryParamObject, "{ query: queryParams }")}))
|
|
3938
3953
|
return result
|
|
3939
3954
|
} catch (error) {
|
|
3940
3955
|
handleActionError(error)
|
|
@@ -9759,5 +9774,5 @@ exports.VersionChecker = VersionChecker;
|
|
|
9759
9774
|
exports.__name = __name;
|
|
9760
9775
|
exports.checkAndNotifyUpdates = checkAndNotifyUpdates;
|
|
9761
9776
|
exports.createBridgeVersionChecker = createBridgeVersionChecker;
|
|
9762
|
-
//# sourceMappingURL=chunk-
|
|
9763
|
-
//# sourceMappingURL=chunk-
|
|
9777
|
+
//# sourceMappingURL=chunk-FH22JEFH.cjs.map
|
|
9778
|
+
//# sourceMappingURL=chunk-FH22JEFH.cjs.map
|