apify-schema-tools 3.2.1 → 3.2.3
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/CHANGELOG.md +12 -0
- package/biome.json +2 -2
- package/dist/apify.js +1 -1
- package/dist/apify.js.map +1 -1
- package/dist/main.js +0 -0
- package/package.json +12 -12
- package/samples/all-defaults/.actor/input_schema.json +1 -0
- package/samples/all-defaults/src-schemas/input.json +1 -0
- package/samples/deep-merged-schemas/.actor/input_schema.json +1 -0
- package/samples/deep-merged-schemas/src-schemas/input.json +1 -0
- package/samples/merged-schemas/.actor/input_schema.json +1 -0
- package/samples/merged-schemas/src-schemas/input.json +1 -0
- package/src/apify.ts +1 -1
- package/test/apify.test.ts +2 -0
- package/test/middle-schema/compare-schemas.test.ts +1 -1
- package/test/middle-schema/generate-typescript.test.ts +1 -1
package/CHANGELOG.md
CHANGED
package/biome.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.4.11/schema.json",
|
|
3
3
|
"vcs": {
|
|
4
4
|
"enabled": true,
|
|
5
5
|
"clientKind": "git",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"nursery": {
|
|
54
|
-
"noImportCycles": "on",
|
|
55
54
|
"noShadow": "on"
|
|
56
55
|
},
|
|
57
56
|
"performance": {
|
|
@@ -112,6 +111,7 @@
|
|
|
112
111
|
"noEvolvingTypes": "on",
|
|
113
112
|
"noExportsInTest": "on",
|
|
114
113
|
"noFocusedTests": "on",
|
|
114
|
+
"noImportCycles": "on",
|
|
115
115
|
"noMisplacedAssertion": "on",
|
|
116
116
|
"noUnassignedVariables": "on",
|
|
117
117
|
"noUselessRegexBackrefs": "on",
|
package/dist/apify.js
CHANGED
|
@@ -6,7 +6,7 @@ export const ACTOR_CONFIG_PATH = ".actor/actor.json";
|
|
|
6
6
|
export function getPathRelativeToActorConfig(path) {
|
|
7
7
|
return `./${relative(dirname(ACTOR_CONFIG_PATH), path)}`;
|
|
8
8
|
}
|
|
9
|
-
const VALID_INPUT_ROOT_KEYS = ["title", "description", "type", "schemaVersion", "properties", "required"];
|
|
9
|
+
const VALID_INPUT_ROOT_KEYS = ["$schema", "title", "description", "type", "schemaVersion", "properties", "required"];
|
|
10
10
|
const VALID_INPUT_PROPERTY_KEYS = [
|
|
11
11
|
"type",
|
|
12
12
|
"title",
|
package/dist/apify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apify.js","sourceRoot":"","sources":["../src/apify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,2BAA2B,EAA0C,MAAM,yBAAyB,CAAC;AAE9G,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,MAAM,UAAU,4BAA4B,CAAC,IAAY;IACxD,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;AAC1D,CAAC;AAED,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"apify.js","sourceRoot":"","sources":["../src/apify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,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C;IAE7E,OAAO;;;;EAKP,gBAAgB;QACf,CAAC,CAAC;0BACsB,iCAAiC,CAAC,gBAAgB,CAAC;;;;qDAIxB,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG;QAC/F,CAAC,CAAC;;;iEAIJ;;uDAEuD,IAAI,CAAC,SAAS,CAAC,6BAA6B,EAAE,IAAI,EAAE,IAAI,CAAC;;;;;;IAO9G,6BAA6B,CAAC,MAAM,GAAG,CAAC;QACvC,CAAC,CAAC;;;;;GAKF;QACA,CAAC,CAAC,EACJ;EAEA,gBAAgB;QACf,CAAC,CAAC;;;;IAIA;QACF,CAAC,CAAC;8BAEJ;;CAEC,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAqB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC"}
|
package/dist/main.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apify-schema-tools",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Apify schema managing tools.",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"types": "dist/
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"types": "dist/main.d.ts",
|
|
7
7
|
"bin": {
|
|
8
|
-
"apify-schema-tools": "dist/
|
|
8
|
+
"apify-schema-tools": "dist/main.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
12
|
"test": "vitest run",
|
|
13
|
-
"
|
|
13
|
+
"postinstall": "husky",
|
|
14
14
|
"check": "biome check . --error-on-warnings",
|
|
15
15
|
"check:write": "biome check . --write"
|
|
16
16
|
},
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
"type": "module",
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@apify/tsconfig": "^0.1.1",
|
|
37
|
-
"@biomejs/biome": "^2.
|
|
37
|
+
"@biomejs/biome": "^2.4.10",
|
|
38
38
|
"@types/argparse": "^2.0.17",
|
|
39
39
|
"@types/json-schema": "^7.0.15",
|
|
40
40
|
"@types/minimist": "^1.2.5",
|
|
41
|
-
"@types/node": "^24.
|
|
41
|
+
"@types/node": "^24.12.2",
|
|
42
42
|
"@types/ramda": "^0.31.1",
|
|
43
|
-
"apify": "^3.
|
|
44
|
-
"cspell": "^9.
|
|
43
|
+
"apify": "^3.7.0",
|
|
44
|
+
"cspell": "^9.7.0",
|
|
45
45
|
"husky": "^9.1.7",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
|
-
"vitest": "^4.
|
|
47
|
+
"vitest": "^4.1.2"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@inquirer/prompts": "^7.10.
|
|
50
|
+
"@inquirer/prompts": "^7.10.1",
|
|
51
51
|
"argparse": "^2.0.1",
|
|
52
52
|
"ramda": "^0.32.0",
|
|
53
|
-
"zod": "^4.
|
|
53
|
+
"zod": "^4.3.6"
|
|
54
54
|
},
|
|
55
55
|
"cspell": {
|
|
56
56
|
"version": "0.2",
|
package/src/apify.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function getPathRelativeToActorConfig(path: string): string {
|
|
|
10
10
|
return `./${relative(dirname(ACTOR_CONFIG_PATH), path)}`;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const VALID_INPUT_ROOT_KEYS = ["title", "description", "type", "schemaVersion", "properties", "required"];
|
|
13
|
+
const VALID_INPUT_ROOT_KEYS = ["$schema", "title", "description", "type", "schemaVersion", "properties", "required"];
|
|
14
14
|
|
|
15
15
|
const VALID_INPUT_PROPERTY_KEYS = [
|
|
16
16
|
"type",
|
package/test/apify.test.ts
CHANGED
|
@@ -7,6 +7,7 @@ describe("Apify utilities", () => {
|
|
|
7
7
|
describe("filterValidInputSchemaProperties", () => {
|
|
8
8
|
it("should filter out invalid root-level keys", () => {
|
|
9
9
|
const inputSchema: ObjectSchema = {
|
|
10
|
+
$schema: "https://apify-projects.github.io/actor-json-schemas/input.ide.json?v=0.7",
|
|
10
11
|
type: "object",
|
|
11
12
|
title: "Test Schema",
|
|
12
13
|
description: "A test schema",
|
|
@@ -22,6 +23,7 @@ describe("Apify utilities", () => {
|
|
|
22
23
|
const result = filterValidInputSchemaProperties(inputSchema);
|
|
23
24
|
|
|
24
25
|
expect(result).toEqual({
|
|
26
|
+
$schema: "https://apify-projects.github.io/actor-json-schemas/input.ide.json?v=0.7",
|
|
25
27
|
type: "object",
|
|
26
28
|
title: "Test Schema",
|
|
27
29
|
description: "A test schema",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { compareMiddleObjects } from "../../src/middle-schema/compare-schemas.js";
|
|
3
|
-
import type { MiddleObject } from "../../src/middle-schema/schema.js";
|
|
3
|
+
import type { MiddleObject } from "../../src/middle-schema/schema-types.js";
|
|
4
4
|
|
|
5
5
|
describe("Compare-schemas utilities", () => {
|
|
6
6
|
describe("compareMiddleObjects", () => {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
serializeMiddleObjectToTypeScript,
|
|
6
6
|
writeTypeScriptFile,
|
|
7
7
|
} from "../../src/middle-schema/generate-typescript.js";
|
|
8
|
-
import type { AllowedType
|
|
8
|
+
import type { AllowedType } from "../../src/middle-schema/schema-types.js";
|
|
9
9
|
import { readFile } from "../../src/utils/filesystem.js";
|
|
10
10
|
import { cleanupTestDirectory, getTestDir, setupTestDirectory } from "../common.js";
|
|
11
11
|
|