@apify/actors-mcp-server 0.9.19-beta.0 → 0.9.19-beta.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.
- package/dist/tools/utils.d.ts +7 -0
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +7 -0
- package/dist/tools/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/ajv.d.ts +10 -6
- package/dist/utils/ajv.d.ts.map +1 -1
- package/dist/utils/ajv.js +14 -9
- package/dist/utils/ajv.js.map +1 -1
- package/package.json +1 -1
package/dist/utils/ajv.d.ts
CHANGED
|
@@ -2,13 +2,17 @@ import type { ValidateFunction } from 'ajv';
|
|
|
2
2
|
import Ajv from 'ajv';
|
|
3
3
|
export declare const ajv: Ajv;
|
|
4
4
|
/**
|
|
5
|
-
* Removes the
|
|
6
|
-
* The z.toJSONSchema() function in Zod 4.x has two issues:
|
|
7
|
-
* 1. Includes a $schema reference that can cause issues when compiling with AJV
|
|
8
|
-
* 2. Incorrectly marks fields with default values as required
|
|
5
|
+
* Removes the `$schema` property and drops fields with real `default` values from `required`.
|
|
9
6
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Per Apify's input-schema spec, "Default + Required doesn't make sense" — a field with a
|
|
8
|
+
* default is effectively optional because the platform fills it in. Zod 4.x `toJSONSchema()`
|
|
9
|
+
* has the same issue: it lists `.default()` fields as required and emits `$schema` that
|
|
10
|
+
* breaks AJV compilation.
|
|
11
|
+
*
|
|
12
|
+
* Uses a value-check (`field.default !== undefined`) instead of key-presence (`'default' in field`)
|
|
13
|
+
* because `filterSchemaProperties()` assigns phantom `default: undefined` on every property (#675).
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/apify/apify-mcp-server/issues/637
|
|
12
16
|
*/
|
|
13
17
|
export declare function fixZodSchemaRequired(schema: Record<string, unknown>): Record<string, unknown>;
|
|
14
18
|
/**
|
package/dist/utils/ajv.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ajv.d.ts","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,GAAG,KAA2E,CAAC;AAE5F
|
|
1
|
+
{"version":3,"file":"ajv.d.ts","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,GAAG,KAA2E,CAAC;AAE5F;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiB7F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAE/E"}
|
package/dist/utils/ajv.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import Ajv from 'ajv';
|
|
2
2
|
export const ajv = new Ajv({ coerceTypes: 'array', strict: false, removeAdditional: true });
|
|
3
3
|
/**
|
|
4
|
-
* Removes the
|
|
5
|
-
* The z.toJSONSchema() function in Zod 4.x has two issues:
|
|
6
|
-
* 1. Includes a $schema reference that can cause issues when compiling with AJV
|
|
7
|
-
* 2. Incorrectly marks fields with default values as required
|
|
4
|
+
* Removes the `$schema` property and drops fields with real `default` values from `required`.
|
|
8
5
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* Per Apify's input-schema spec, "Default + Required doesn't make sense" — a field with a
|
|
7
|
+
* default is effectively optional because the platform fills it in. Zod 4.x `toJSONSchema()`
|
|
8
|
+
* has the same issue: it lists `.default()` fields as required and emits `$schema` that
|
|
9
|
+
* breaks AJV compilation.
|
|
10
|
+
*
|
|
11
|
+
* Uses a value-check (`field.default !== undefined`) instead of key-presence (`'default' in field`)
|
|
12
|
+
* because `filterSchemaProperties()` assigns phantom `default: undefined` on every property (#675).
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/apify/apify-mcp-server/issues/637
|
|
11
15
|
*/
|
|
12
16
|
export function fixZodSchemaRequired(schema) {
|
|
13
17
|
const cleaned = { ...schema };
|
|
14
18
|
delete cleaned.$schema;
|
|
15
|
-
// Fix the required array: remove fields that have default values
|
|
16
19
|
if (Array.isArray(cleaned.required) && typeof cleaned.properties === 'object' && cleaned.properties !== null) {
|
|
17
20
|
const properties = cleaned.properties;
|
|
18
21
|
cleaned.required = cleaned.required.filter((fieldName) => {
|
|
19
22
|
const fieldSchema = properties[fieldName];
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
if (typeof fieldSchema !== 'object' || fieldSchema === null)
|
|
24
|
+
return true;
|
|
25
|
+
// Value-check (NOT `'default' in fieldSchema`) — see docstring for why.
|
|
26
|
+
return fieldSchema.default === undefined;
|
|
22
27
|
});
|
|
23
28
|
}
|
|
24
29
|
return cleaned;
|
package/dist/utils/ajv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;AAE5F
|
|
1
|
+
{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MA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