@squiz/dx-json-schema-lib 1.85.1 → 1.85.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +11 -0
  3. package/jest.integration.config.ts +26 -0
  4. package/jsonCompiler.ts +35 -2
  5. package/lib/JsonSchemaService.js +8 -7
  6. package/lib/JsonSchemaService.js.map +1 -1
  7. package/lib/JsonValidationService.d.ts +3 -2
  8. package/lib/JsonValidationService.js +21 -91
  9. package/lib/JsonValidationService.js.map +1 -1
  10. package/lib/defaultDraftConfig.d.ts +2 -0
  11. package/lib/defaultDraftConfig.js +81 -0
  12. package/lib/defaultDraftConfig.js.map +1 -0
  13. package/lib/formatted-text/v1/formattedTextConstants.d.ts +2 -0
  14. package/lib/formatted-text/v1/formattedTextConstants.js +6 -0
  15. package/lib/formatted-text/v1/formattedTextConstants.js.map +1 -0
  16. package/lib/formatted-text/v1/resolveFormattedTextNodes.d.ts +2 -2
  17. package/lib/formatted-text/v1/resolveFormattedTextNodes.js +3 -2
  18. package/lib/formatted-text/v1/resolveFormattedTextNodes.js.map +1 -1
  19. package/lib/index.d.ts +1 -0
  20. package/lib/index.js +1 -0
  21. package/lib/index.js.map +1 -1
  22. package/lib/manifest/userApi/v1/UserApiManifestV1.d.ts +48 -0
  23. package/lib/manifest/userApi/v1/UserApiManifestV1.js +9 -0
  24. package/lib/manifest/userApi/v1/UserApiManifestV1.js.map +1 -0
  25. package/lib/manifest/userApi/v1/UserApiManifestV1.json +77 -0
  26. package/lib/manifest/userApi/v1/index.d.ts +2 -0
  27. package/lib/manifest/userApi/v1/index.js +8 -0
  28. package/lib/manifest/userApi/v1/index.js.map +1 -0
  29. package/lib/manifest/userApi/v1/integration-fixtures/invalid-endpoint-extra-public.manifest.json +10 -0
  30. package/lib/manifest/userApi/v1/integration-fixtures/invalid-endpoint-handler-hyphen.manifest.json +9 -0
  31. package/lib/manifest/userApi/v1/integration-fixtures/invalid-endpoint-handler-leading-digit.manifest.json +9 -0
  32. package/lib/manifest/userApi/v1/integration-fixtures/invalid-endpoint-method-invalid.manifest.json +9 -0
  33. package/lib/manifest/userApi/v1/integration-fixtures/invalid-endpoint-missing-method.manifest.json +8 -0
  34. package/lib/manifest/userApi/v1/integration-fixtures/invalid-endpoint-missing-path.manifest.json +8 -0
  35. package/lib/manifest/userApi/v1/integration-fixtures/invalid-full-displayName-empty.manifest.json +16 -0
  36. package/lib/manifest/userApi/v1/integration-fixtures/invalid-full-manifest-not-object.manifest.json +8 -0
  37. package/lib/manifest/userApi/v1/integration-fixtures/invalid-full-missing-manifest.manifest.json +7 -0
  38. package/lib/manifest/userApi/v1/integration-fixtures/invalid-full-missing-schema.manifest.json +15 -0
  39. package/lib/manifest/userApi/v1/integration-fixtures/invalid-full-name-empty.manifest.json +16 -0
  40. package/lib/manifest/userApi/v1/integration-fixtures/invalid-full-root-extra-property.manifest.json +17 -0
  41. package/lib/manifest/userApi/v1/integration-fixtures/invalid-nested-manifest-handlerMap.manifest.json +12 -0
  42. package/lib/manifest/userApi/v1/integration-fixtures/invalid-nested-manifest-name.manifest.json +10 -0
  43. package/lib/manifest/userApi/v1/integration-fixtures/invalid-resolved-empty-endpoints.manifest.json +4 -0
  44. package/lib/manifest/userApi/v1/integration-fixtures/invalid-resolved-no-leading-slash.manifest.json +11 -0
  45. package/lib/manifest/userApi/v1/integration-fixtures/valid-full-each-http-method.manifest.json +18 -0
  46. package/lib/manifest/userApi/v1/integration-fixtures/valid-full-no-description.manifest.json +16 -0
  47. package/lib/manifest/userApi/v1/integration-fixtures/valid-full.manifest.json +22 -0
  48. package/lib/manifest/userApi/v1/integration-fixtures/valid-resolved-slash-path.manifest.json +14 -0
  49. package/lib/manifest/userApi/v1/integration-fixtures/valid-resolved.manifest.json +14 -0
  50. package/lib/manifest/userApi/v1/userApiManifest.integration.spec.d.ts +1 -0
  51. package/lib/manifest/userApi/v1/userApiManifest.integration.spec.js +201 -0
  52. package/lib/manifest/userApi/v1/userApiManifest.integration.spec.js.map +1 -0
  53. package/lib/manifest/userApi/v1/userApiManifestValidation.d.ts +16 -0
  54. package/lib/manifest/userApi/v1/userApiManifestValidation.js +88 -0
  55. package/lib/manifest/userApi/v1/userApiManifestValidation.js.map +1 -0
  56. package/lib/manifest/userApi/v1/userApiManifestValidation.spec.d.ts +1 -0
  57. package/lib/manifest/userApi/v1/userApiManifestValidation.spec.js +246 -0
  58. package/lib/manifest/userApi/v1/userApiManifestValidation.spec.js.map +1 -0
  59. package/package.json +11 -1
  60. package/src/JsonSchemaService.ts +2 -1
  61. package/src/JsonValidationService.ts +9 -96
  62. package/src/defaultDraftConfig.ts +89 -0
  63. package/src/formatted-text/v1/formattedTextConstants.ts +2 -0
  64. package/src/formatted-text/v1/resolveFormattedTextNodes.ts +3 -2
  65. package/src/index.ts +2 -0
  66. package/src/manifest/userApi/v1/UserApiManifestV1.json +77 -0
  67. package/src/manifest/userApi/v1/UserApiManifestV1.ts +50 -0
  68. package/src/manifest/userApi/v1/index.ts +6 -0
  69. package/src/manifest/userApi/v1/integration-fixtures/invalid-endpoint-extra-public.manifest.json +10 -0
  70. package/src/manifest/userApi/v1/integration-fixtures/invalid-endpoint-handler-hyphen.manifest.json +9 -0
  71. package/src/manifest/userApi/v1/integration-fixtures/invalid-endpoint-handler-leading-digit.manifest.json +9 -0
  72. package/src/manifest/userApi/v1/integration-fixtures/invalid-endpoint-method-invalid.manifest.json +9 -0
  73. package/src/manifest/userApi/v1/integration-fixtures/invalid-endpoint-missing-method.manifest.json +8 -0
  74. package/src/manifest/userApi/v1/integration-fixtures/invalid-endpoint-missing-path.manifest.json +8 -0
  75. package/src/manifest/userApi/v1/integration-fixtures/invalid-full-displayName-empty.manifest.json +16 -0
  76. package/src/manifest/userApi/v1/integration-fixtures/invalid-full-manifest-not-object.manifest.json +8 -0
  77. package/src/manifest/userApi/v1/integration-fixtures/invalid-full-missing-manifest.manifest.json +7 -0
  78. package/src/manifest/userApi/v1/integration-fixtures/invalid-full-missing-schema.manifest.json +15 -0
  79. package/src/manifest/userApi/v1/integration-fixtures/invalid-full-name-empty.manifest.json +16 -0
  80. package/src/manifest/userApi/v1/integration-fixtures/invalid-full-root-extra-property.manifest.json +17 -0
  81. package/src/manifest/userApi/v1/integration-fixtures/invalid-nested-manifest-handlerMap.manifest.json +12 -0
  82. package/src/manifest/userApi/v1/integration-fixtures/invalid-nested-manifest-name.manifest.json +10 -0
  83. package/src/manifest/userApi/v1/integration-fixtures/invalid-resolved-empty-endpoints.manifest.json +4 -0
  84. package/src/manifest/userApi/v1/integration-fixtures/invalid-resolved-no-leading-slash.manifest.json +11 -0
  85. package/src/manifest/userApi/v1/integration-fixtures/valid-full-each-http-method.manifest.json +18 -0
  86. package/src/manifest/userApi/v1/integration-fixtures/valid-full-no-description.manifest.json +16 -0
  87. package/src/manifest/userApi/v1/integration-fixtures/valid-full.manifest.json +22 -0
  88. package/src/manifest/userApi/v1/integration-fixtures/valid-resolved-slash-path.manifest.json +14 -0
  89. package/src/manifest/userApi/v1/integration-fixtures/valid-resolved.manifest.json +14 -0
  90. package/src/manifest/userApi/v1/userApiManifest.integration.spec.ts +265 -0
  91. package/src/manifest/userApi/v1/userApiManifestValidation.spec.ts +321 -0
  92. package/src/manifest/userApi/v1/userApiManifestValidation.ts +54 -0
  93. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserApiManifestV1.js","sourceRoot":"","sources":["../../../../src/manifest/userApi/v1/UserApiManifestV1.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB;;;;GAIG"}
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
4
+ "title": "UserApiManifestV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "definitions": {
8
+ "resolvedApiManifest": {
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "required": ["endpoints"],
12
+ "properties": {
13
+ "endpoints": {
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "items": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["path", "method", "handler"],
20
+ "properties": {
21
+ "path": {
22
+ "type": "string",
23
+ "pattern": "^/.*",
24
+ "description": "URL path routed to this endpoint; must start with /. May include `*` wildcards or `:param` segments (api-builder style)."
25
+ },
26
+ "method": {
27
+ "type": "string",
28
+ "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"],
29
+ "description": "HTTP method for this route."
30
+ },
31
+ "handler": {
32
+ "type": "string",
33
+ "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$.]*$",
34
+ "description": "Exported handler reference (module.export form)."
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ },
42
+ "required": ["$schema", "name", "displayName", "filesDir", "entry", "manifest"],
43
+ "properties": {
44
+ "$schema": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "description": "JSON Schema reference for IDE support."
48
+ },
49
+ "name": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "pattern": "^[a-z](?:[a-z0-9-]|_(?!_))*[a-z0-9]$",
53
+ "description": "Slug for this deployment. Lowercase letters, digits, hyphens, or underscores only; must start with a letter, end with a letter or digit, and cannot contain consecutive underscores."
54
+ },
55
+ "displayName": {
56
+ "type": "string",
57
+ "minLength": 1
58
+ },
59
+ "description": {
60
+ "type": "string",
61
+ "description": "Human-readable summary of what the API provides."
62
+ },
63
+ "filesDir": {
64
+ "type": "string",
65
+ "minLength": 1,
66
+ "description": "Directory (relative to the manifest) containing sources."
67
+ },
68
+ "entry": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "description": "Entry module path under filesDir (e.g. index.ts)."
72
+ },
73
+ "manifest": {
74
+ "$ref": "#/definitions/resolvedApiManifest"
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,2 @@
1
+ export { USER_API_FULL_MANIFEST_SCHEMA, USER_API_MANIFEST_SCHEMA_URL, validateUserApiFullManifest, } from './userApiManifestValidation';
2
+ export type { UserApiManifestV1 as UserApiManifest } from './UserApiManifestV1';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateUserApiFullManifest = exports.USER_API_MANIFEST_SCHEMA_URL = exports.USER_API_FULL_MANIFEST_SCHEMA = void 0;
4
+ var userApiManifestValidation_1 = require("./userApiManifestValidation");
5
+ Object.defineProperty(exports, "USER_API_FULL_MANIFEST_SCHEMA", { enumerable: true, get: function () { return userApiManifestValidation_1.USER_API_FULL_MANIFEST_SCHEMA; } });
6
+ Object.defineProperty(exports, "USER_API_MANIFEST_SCHEMA_URL", { enumerable: true, get: function () { return userApiManifestValidation_1.USER_API_MANIFEST_SCHEMA_URL; } });
7
+ Object.defineProperty(exports, "validateUserApiFullManifest", { enumerable: true, get: function () { return userApiManifestValidation_1.validateUserApiFullManifest; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/manifest/userApi/v1/index.ts"],"names":[],"mappings":";;;AAAA,yEAIqC;AAHnC,0IAAA,6BAA6B,OAAA;AAC7B,yIAAA,4BAA4B,OAAA;AAC5B,wIAAA,2BAA2B,OAAA"}
@@ -0,0 +1,10 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/ok",
5
+ "method": "GET",
6
+ "handler": "noop",
7
+ "public": true
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/ok",
5
+ "method": "GET",
6
+ "handler": "bad-name"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/ok",
5
+ "method": "GET",
6
+ "handler": "0badIdentifier"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/ok",
5
+ "method": "TRACE",
6
+ "handler": "noop"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/ok",
5
+ "handler": "noop"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "method": "GET",
5
+ "handler": "noop"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "needs-display-name",
4
+ "displayName": "",
5
+ "filesDir": "src",
6
+ "entry": "index.ts",
7
+ "manifest": {
8
+ "endpoints": [
9
+ {
10
+ "path": "/only",
11
+ "method": "GET",
12
+ "handler": "h"
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "bad-manifest-shape",
4
+ "displayName": "Manifest not an object",
5
+ "filesDir": "src",
6
+ "entry": "index.ts",
7
+ "manifest": "not-an-object"
8
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "missing-nested-manifest",
4
+ "displayName": "Manifest object absent",
5
+ "filesDir": "src",
6
+ "entry": "index.ts"
7
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "missing-dollar-schema",
3
+ "displayName": "Missing dollar schema field",
4
+ "filesDir": "src",
5
+ "entry": "index.ts",
6
+ "manifest": {
7
+ "endpoints": [
8
+ {
9
+ "path": "/only",
10
+ "method": "GET",
11
+ "handler": "h"
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "",
4
+ "displayName": "Empty slug",
5
+ "filesDir": "src",
6
+ "entry": "index.ts",
7
+ "manifest": {
8
+ "endpoints": [
9
+ {
10
+ "path": "/only",
11
+ "method": "GET",
12
+ "handler": "h"
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "extra-root-prop",
4
+ "displayName": "Extra root prop",
5
+ "filesDir": "src",
6
+ "entry": "index.ts",
7
+ "manifest": {
8
+ "endpoints": [
9
+ {
10
+ "path": "/only",
11
+ "method": "GET",
12
+ "handler": "h"
13
+ }
14
+ ]
15
+ },
16
+ "telemetryChannel": "forbidden-root-key-example"
17
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/ok",
5
+ "method": "GET",
6
+ "handler": "noop"
7
+ }
8
+ ],
9
+ "handlerMap": {
10
+ "noop": "./noop.ts"
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "must-not-live-under-manifest",
3
+ "endpoints": [
4
+ {
5
+ "path": "/ok",
6
+ "method": "GET",
7
+ "handler": "noop"
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "integration-sample-api",
3
+ "endpoints": []
4
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "integration-sample-api",
3
+ "endpoints": [
4
+ {
5
+ "path": "needs-leading-slash",
6
+ "method": "GET",
7
+ "handler": "index.x",
8
+ "public": true
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "all-methods-api",
4
+ "displayName": "Covers enum methods",
5
+ "filesDir": "src",
6
+ "entry": "index.ts",
7
+ "manifest": {
8
+ "endpoints": [
9
+ { "path": "/g", "method": "GET", "handler": "handlers.g" },
10
+ { "path": "/po", "method": "POST", "handler": "handlers.po" },
11
+ { "path": "/pu", "method": "PUT", "handler": "handlers.pu" },
12
+ { "path": "/pa", "method": "PATCH", "handler": "handlers.pa" },
13
+ { "path": "/d", "method": "DELETE", "handler": "handlers.d" },
14
+ { "path": "/o", "method": "OPTIONS", "handler": "handlers.o" },
15
+ { "path": "/h", "method": "HEAD", "handler": "handlers.h" }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "no-description-api",
4
+ "displayName": "No optional description field",
5
+ "filesDir": "src",
6
+ "entry": "index.ts",
7
+ "manifest": {
8
+ "endpoints": [
9
+ {
10
+ "path": "/health",
11
+ "method": "GET",
12
+ "handler": "health"
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json",
3
+ "name": "integration-sample-api",
4
+ "displayName": "Integration sample API",
5
+ "description": "Fixture used only by filesystem-backed integration tests",
6
+ "filesDir": "src",
7
+ "entry": "index.ts",
8
+ "manifest": {
9
+ "endpoints": [
10
+ {
11
+ "path": "/integration/hello",
12
+ "method": "GET",
13
+ "handler": "index.helloWorld"
14
+ },
15
+ {
16
+ "path": "/integration/items",
17
+ "method": "POST",
18
+ "handler": "handlers.createItem"
19
+ }
20
+ ]
21
+ }
22
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/",
5
+ "method": "GET",
6
+ "handler": "root"
7
+ },
8
+ {
9
+ "path": "/integration/items",
10
+ "method": "POST",
11
+ "handler": "handlers.createItem"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "path": "/integration/hello",
5
+ "method": "GET",
6
+ "handler": "index.helloWorld"
7
+ },
8
+ {
9
+ "path": "/integration/items",
10
+ "method": "POST",
11
+ "handler": "handlers.createItem"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const Draft_07_json_1 = __importDefault(require("../../v1/Draft-07.json"));
9
+ const __1 = require("../../..");
10
+ /** Must align with `integration-fixtures/valid-full.manifest.json` `$schema`. */
11
+ const FULL_MANIFEST_FIXTURE_SCHEMA = 'https://unpkg.com/@squiz/dx-json-schema-lib@latest/lib/manifest/userApiManifest/UserApiManifestV1.json';
12
+ /** Directory containing `UserApiManifestV1.json` (this spec sits alongside those files). */
13
+ const USER_API_SCHEMA_DIR = __dirname;
14
+ /** `src/manifest/userApi/v1` → package root (four levels up). */
15
+ const PACKAGE_ROOT = path_1.default.join(USER_API_SCHEMA_DIR, '..', '..', '..', '..');
16
+ const draft07Remotes = {
17
+ 'http://json-schema.org/draft-07/schema': Draft_07_json_1.default,
18
+ 'http://json-schema.org/draft-07/schema#': Draft_07_json_1.default,
19
+ };
20
+ function loadJson(relPathUnderSrcDir) {
21
+ const abs = path_1.default.isAbsolute(relPathUnderSrcDir)
22
+ ? relPathUnderSrcDir
23
+ : path_1.default.join(USER_API_SCHEMA_DIR, relPathUnderSrcDir);
24
+ return JSON.parse(fs_1.default.readFileSync(abs, 'utf8'));
25
+ }
26
+ function fixture(name) {
27
+ return loadJson(path_1.default.join('integration-fixtures', name));
28
+ }
29
+ function fixtureRecord(name) {
30
+ return fixture(name);
31
+ }
32
+ /** Standalone resolved manifests: validated only after {@link wrapResolvedFixtureAsFull}. */
33
+ const INVALID_WRAPPED_FIXTURES = [
34
+ 'invalid-nested-manifest-name.manifest.json',
35
+ 'invalid-nested-manifest-handlerMap.manifest.json',
36
+ 'invalid-endpoint-extra-public.manifest.json',
37
+ 'invalid-endpoint-handler-leading-digit.manifest.json',
38
+ 'invalid-endpoint-handler-hyphen.manifest.json',
39
+ 'invalid-endpoint-method-invalid.manifest.json',
40
+ 'invalid-endpoint-missing-method.manifest.json',
41
+ 'invalid-endpoint-missing-path.manifest.json',
42
+ 'invalid-resolved-empty-endpoints.manifest.json',
43
+ 'invalid-resolved-no-leading-slash.manifest.json',
44
+ ];
45
+ /** Full top-level documents consumed directly by {@link JSONSchemaService.validateInput}. */
46
+ const INVALID_FULL_MANIFEST_FIXTURES = [
47
+ 'invalid-full-root-extra-property.manifest.json',
48
+ 'invalid-full-name-empty.manifest.json',
49
+ 'invalid-full-displayName-empty.manifest.json',
50
+ 'invalid-full-missing-schema.manifest.json',
51
+ 'invalid-full-missing-manifest.manifest.json',
52
+ 'invalid-full-manifest-not-object.manifest.json',
53
+ ];
54
+ /** Non-schema regression check: validators must not omit or reorder fixture endpoint fields. */
55
+ function expectFixtureEndpointsUnchanged(validated) {
56
+ var _a, _b;
57
+ const data = validated;
58
+ const endpoints = (_b = (_a = data.manifest) === null || _a === void 0 ? void 0 : _a.endpoints) !== null && _b !== void 0 ? _b : data.endpoints;
59
+ expect(endpoints).toHaveLength(2);
60
+ expect(endpoints).toContainEqual({
61
+ path: '/integration/hello',
62
+ method: 'GET',
63
+ handler: 'index.helloWorld',
64
+ });
65
+ expect(endpoints).toContainEqual({
66
+ path: '/integration/items',
67
+ method: 'POST',
68
+ handler: 'handlers.createItem',
69
+ });
70
+ }
71
+ /** Wrap standalone resolved fixture JSON under a minimal UserApiManifestV1 root (only full manifest is validated publicly). */
72
+ function wrapResolvedFixtureAsFull(resolved) {
73
+ return {
74
+ $schema: FULL_MANIFEST_FIXTURE_SCHEMA,
75
+ name: typeof resolved.name === 'string' ? resolved.name : 'wrapped-api',
76
+ displayName: 'Integration fixture envelope',
77
+ description: '',
78
+ filesDir: 'src',
79
+ entry: 'index.ts',
80
+ manifest: resolved,
81
+ };
82
+ }
83
+ function createFullManifestValidator(schemaFromDisk) {
84
+ const resolver = __1.TypeResolverBuilder.new().build();
85
+ return new __1.JSONSchemaService(resolver, {
86
+ root: schemaFromDisk,
87
+ remotes: draft07Remotes,
88
+ });
89
+ }
90
+ describe('user-api JSON schemas (integration, filesystem-backed)', () => {
91
+ describe('published schema documents on disk', () => {
92
+ it('parses UserApiManifestV1.json and exposes nested resolved manifest definition', () => {
93
+ var _a;
94
+ const schema = loadJson('UserApiManifestV1.json');
95
+ expect(schema.$schema).toBe('http://json-schema.org/draft-07/schema#');
96
+ expect(schema.title).toBe('UserApiManifestV1');
97
+ expect(schema.additionalProperties).toBe(false);
98
+ expect(schema.required).toEqual(expect.arrayContaining(['$schema', 'name', 'displayName', 'filesDir', 'entry', 'manifest']));
99
+ const { resolvedApiManifest } = schema.definitions;
100
+ expect(resolvedApiManifest.required).toEqual(expect.arrayContaining(['endpoints']));
101
+ const rootProps = schema.properties;
102
+ expect(rootProps.manifest.$ref).toBe('#/definitions/resolvedApiManifest');
103
+ expect(resolvedApiManifest.properties).toHaveProperty('endpoints');
104
+ expect(Object.keys((_a = resolvedApiManifest.properties) !== null && _a !== void 0 ? _a : {})).toEqual(['endpoints']);
105
+ expect(resolvedApiManifest.required).toEqual(['endpoints']);
106
+ });
107
+ it('UserApiManifestV1 endpoint items require path, method, handler only and forbid extra endpoint keys', () => {
108
+ var _a;
109
+ const schema = loadJson('UserApiManifestV1.json');
110
+ const items = schema.definitions.resolvedApiManifest.properties.endpoints.items;
111
+ expect(items.required).toEqual(['path', 'method', 'handler']);
112
+ expect(items.additionalProperties).toBe(false);
113
+ expect(items.properties).toMatchObject({
114
+ path: expect.objectContaining({ type: 'string' }),
115
+ method: expect.objectContaining({ type: 'string' }),
116
+ handler: expect.objectContaining({ type: 'string' }),
117
+ });
118
+ expect(Object.keys((_a = items.properties) !== null && _a !== void 0 ? _a : {})).toHaveLength(3);
119
+ });
120
+ it('UserApiManifestV1 nested resolved manifest forbids arbitrary root keys (endpoints only)', () => {
121
+ const schema = loadJson('UserApiManifestV1.json');
122
+ expect(schema.definitions.resolvedApiManifest.additionalProperties).toBe(false);
123
+ });
124
+ });
125
+ describe('validation pipeline using schemas read from filesystem (not TS imports)', () => {
126
+ const fullManifestSchemaRoot = loadJson('UserApiManifestV1.json');
127
+ const fullValidator = createFullManifestValidator(fullManifestSchemaRoot);
128
+ const validResolved = fixtureRecord('valid-resolved.manifest.json');
129
+ function expectRejectWhenWrapped(filename) {
130
+ expect(() => fullValidator.validateInput(wrapResolvedFixtureAsFull(fixtureRecord(filename)))).toThrow(__1.SchemaValidationError);
131
+ }
132
+ function expectRejectFullDocument(blob) {
133
+ expect(() => fullValidator.validateInput(blob)).toThrow(__1.SchemaValidationError);
134
+ }
135
+ it.each(INVALID_WRAPPED_FIXTURES)('rejects wrapped nested manifest from %s', (filename) => {
136
+ expectRejectWhenWrapped(filename);
137
+ });
138
+ it.each(INVALID_FULL_MANIFEST_FIXTURES)('rejects full manifest document %s', (filename) => {
139
+ expectRejectFullDocument(fixture(filename));
140
+ });
141
+ it('accepts realistic full manifest fixture aligned with nested endpoint schema', () => {
142
+ const blob = fixture('valid-full.manifest.json');
143
+ expect(fullValidator.validateInput(blob)).toBe(true);
144
+ expectFixtureEndpointsUnchanged(blob);
145
+ });
146
+ it('accepts valid-resolved fixture when wrapped under a minimal full manifest envelope', () => {
147
+ const wrapped = wrapResolvedFixtureAsFull(validResolved);
148
+ expect(fullValidator.validateInput(wrapped)).toBe(true);
149
+ expectFixtureEndpointsUnchanged(wrapped);
150
+ });
151
+ it('valid-resolved fixture is endpoints-only at nested root (no manifest.name)', () => {
152
+ expect(Array.isArray(validResolved.endpoints)).toBe(true);
153
+ });
154
+ it('accepts api-builder-style paths (wildcard and :param) using disk-backed schema', () => {
155
+ const wrapped = wrapResolvedFixtureAsFull({
156
+ endpoints: [
157
+ { path: '/hello/*', method: 'GET', handler: 'hello' },
158
+ { path: '/user/:id/:type', method: 'GET', handler: 'user' },
159
+ ],
160
+ });
161
+ expect(fullValidator.validateInput(wrapped)).toBe(true);
162
+ });
163
+ it('accepts alternate $schema URL on envelope (filesystem validation path)', () => {
164
+ const blob = {
165
+ $schema: 'https://raw.githubusercontent.com/user/api-builder-prototype/main/schemas/api-builder.schema.json',
166
+ name: 'integration-proto',
167
+ displayName: 'Proto',
168
+ filesDir: 'src',
169
+ entry: 'index.ts',
170
+ manifest: {
171
+ endpoints: [{ path: '/health', method: 'GET', handler: 'health' }],
172
+ },
173
+ };
174
+ expect(fullValidator.validateInput(blob)).toBe(true);
175
+ });
176
+ it('accepts full manifest when optional description is omitted', () => {
177
+ expect(fullValidator.validateInput(fixture('valid-full-no-description.manifest.json'))).toBe(true);
178
+ });
179
+ it('accepts one endpoint per allowed HTTP method value', () => {
180
+ const blob = fixture('valid-full-each-http-method.manifest.json');
181
+ expect(fullValidator.validateInput(blob)).toBe(true);
182
+ expect(blob.manifest.endpoints.map((e) => e.method).sort()).toEqual(['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT'].sort());
183
+ });
184
+ it('accepts minimal path "/" in wrapped resolved fixture alongside another endpoint', () => {
185
+ const wrapped = wrapResolvedFixtureAsFull(fixtureRecord('valid-resolved-slash-path.manifest.json'));
186
+ expect(fullValidator.validateInput(wrapped)).toBe(true);
187
+ const endpoints = wrapped.manifest.endpoints;
188
+ expect(endpoints.some((e) => e.path === '/')).toBe(true);
189
+ });
190
+ });
191
+ describe('artifacts under lib/ after compile (when present)', () => {
192
+ const srcFull = path_1.default.join(USER_API_SCHEMA_DIR, 'UserApiManifestV1.json');
193
+ const libFull = path_1.default.join(PACKAGE_ROOT, 'lib', 'manifest', 'userApi', 'v1', 'UserApiManifestV1.json');
194
+ const libExists = fs_1.default.existsSync(libFull);
195
+ const itOrSkip = libExists ? it : it.skip;
196
+ itOrSkip('copied lib UserApiManifestV1.json payload matches src', () => {
197
+ expect(loadJson(libFull)).toEqual(loadJson(srcFull));
198
+ });
199
+ });
200
+ });
201
+ //# sourceMappingURL=userApiManifest.integration.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userApiManifest.integration.spec.js","sourceRoot":"","sources":["../../../../src/manifest/userApi/v1/userApiManifest.integration.spec.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,2EAAmD;AACnD,gCAAyF;AAEzF,iFAAiF;AACjF,MAAM,4BAA4B,GAChC,wGAAwG,CAAC;AAE3G,4FAA4F;AAC5F,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAEtC,iEAAiE;AACjE,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE5E,MAAM,cAAc,GAAG;IACrB,wCAAwC,EAAE,uBAAa;IACvD,yCAAyC,EAAE,uBAAa;CAChD,CAAC;AAEX,SAAS,QAAQ,CAAC,kBAA0B;IAC1C,MAAM,GAAG,GAAG,cAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC;QAC7C,CAAC,CAAC,kBAAkB;QACpB,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAY,CAAC;AAC7D,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,aAAa,CAAC,IA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C;YACxD,MAAM,SAAS,GAAI,OAAO,CAAC,QAA8C,CAAC,SAAS,CAAC;YACpF,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACjE,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,wBAAwB,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAAC;QAEtG,MAAM,SAAS,GAAG,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC;QAE1C,QAAQ,CAAC,uDAAuD,EAAE,GAAG,EAAE;YACrE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Recommended `$schema` URL for the top-level DXP User API `manifest.json`.
3
+ *
4
+ * Published at {@link USER_API_FULL_MANIFEST_SCHEMA} under `lib/manifest/userApiManifest/UserApiManifestV1.json`.
5
+ */
6
+ export declare const USER_API_MANIFEST_SCHEMA_URL: string;
7
+ /**
8
+ * JSON Schema bundle validating the full on-disk manifest (CLI / zip upload).
9
+ */
10
+ export { default as USER_API_FULL_MANIFEST_SCHEMA } from './UserApiManifestV1.json';
11
+ /**
12
+ * Validate the User API manifest before upload.
13
+ *
14
+ * @throws {SchemaValidationError} when validation fails.
15
+ */
16
+ export declare function validateUserApiFullManifest(input: unknown): true;