linkque-cli-v2 1.0.2-beta.3 → 1.0.2-beta.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/package.json +1 -1
- package/worker.js +0 -19
package/package.json
CHANGED
package/worker.js
CHANGED
|
@@ -12027,21 +12027,6 @@ function getJsonSchemaIssues(value, path6 = "schema") {
|
|
|
12027
12027
|
function isObjectJsonSchema(value) {
|
|
12028
12028
|
return isPlainRecord(value) && value.type === "object" && getJsonSchemaIssues(value).length === 0;
|
|
12029
12029
|
}
|
|
12030
|
-
function validateJsonSchemaValue(schema, value, path6 = "$") {
|
|
12031
|
-
let validate;
|
|
12032
|
-
try {
|
|
12033
|
-
validate = ajv.compile(schema);
|
|
12034
|
-
} catch (error40) {
|
|
12035
|
-
return [
|
|
12036
|
-
issue(path6, "INVALID_JSON_SCHEMA", error40 instanceof Error ? error40.message : "schema is invalid")
|
|
12037
|
-
];
|
|
12038
|
-
}
|
|
12039
|
-
return validate(value) ? [] : (validate.errors ?? []).map(errorToIssue.bind(null, path6));
|
|
12040
|
-
}
|
|
12041
|
-
function errorToIssue(root, error40) {
|
|
12042
|
-
const suffix = error40.instancePath.split("/").filter(Boolean).map((segment) => segment.replace(/~1/gu, "/").replace(/~0/gu, "~")).map((segment) => `[${JSON.stringify(segment)}]`).join("");
|
|
12043
|
-
return issue(`${root}${suffix}`, "JSON_SCHEMA_VALUE_INVALID", error40.message ?? "value does not match schema");
|
|
12044
|
-
}
|
|
12045
12030
|
var import_ajv, AjvConstructor, ajv;
|
|
12046
12031
|
var init_schema = __esm({
|
|
12047
12032
|
"../linkque-agent-data-binding-contract/dist/esm/schema.js"() {
|
|
@@ -15873,10 +15858,6 @@ async function executeHomeData(input) {
|
|
|
15873
15858
|
if (!cardDataObject) {
|
|
15874
15859
|
return failure("INVALID_CARD_DATA", "\u9996\u9875\u5361\u7247\u6570\u636E\u5FC5\u987B\u662F JSON object", false);
|
|
15875
15860
|
}
|
|
15876
|
-
const cardIssues = validateJsonSchemaValue(request.dataSchema, cardDataObject);
|
|
15877
|
-
if (cardIssues.length > 0) {
|
|
15878
|
-
return failure("INVALID_CARD_DATA", cardIssues[0].message, false);
|
|
15879
|
-
}
|
|
15880
15861
|
return { ok: true, data: cardDataObject };
|
|
15881
15862
|
} finally {
|
|
15882
15863
|
await registry2.closeAll();
|