@mitre/hdf-openapi 0.0.0-stage → 3.8.0-next.42532249979.1

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.
@@ -0,0 +1,114 @@
1
+ {
2
+ "ambiguous-format": {
3
+ "code": "AMBIGUOUS_FORMAT",
4
+ "title": "Ambiguous source format",
5
+ "status": 422,
6
+ "owner": "taxonomy",
7
+ "cause": "The submitted document matched more than one source format, so no converter could be chosen for it.",
8
+ "remedy": "Re-submit with `from` set to the source format you intend. `GET /catalog/converters` lists the accepted values."
9
+ },
10
+ "delete-restricted": {
11
+ "title": "Delete restricted by a citing document",
12
+ "status": 409,
13
+ "owner": "service",
14
+ "cause": "Another stored document cites this one, and deleting it would leave that citation unresolvable.",
15
+ "remedy": "Remove or amend the citing documents first. The response details name them."
16
+ },
17
+ "document-not-found": {
18
+ "code": "DOCUMENT_NOT_FOUND",
19
+ "title": "Document not found",
20
+ "status": 404,
21
+ "owner": "taxonomy",
22
+ "cause": "No document is stored under the id the request addresses.",
23
+ "remedy": "Check the id. A deleted document stays absent, so re-create it with `POST /documents` if it should exist."
24
+ },
25
+ "handle-stale": {
26
+ "code": "HANDLE_STALE",
27
+ "title": "Stale document validator",
28
+ "status": 412,
29
+ "owner": "taxonomy",
30
+ "cause": "The document changed after the ETag given in `If-Match` was issued, so the write was refused rather than applied over content the caller has not seen.",
31
+ "remedy": "Re-read the document, take the ETag from that response, and retry the write with it."
32
+ },
33
+ "held": {
34
+ "title": "Document under legal hold",
35
+ "status": 409,
36
+ "owner": "service",
37
+ "cause": "The document is under a legal hold, which forbids deletion while the hold stands.",
38
+ "remedy": "None is available to the caller. The hold is released by whoever placed it."
39
+ },
40
+ "insufficient-scope": {
41
+ "title": "Insufficient scope",
42
+ "status": 403,
43
+ "owner": "convention",
44
+ "cause": "The access token is valid, but carries none of the scopes the operation requires.",
45
+ "remedy": "Obtain a token with the scope named in the response and retry. Each operation's required scopes are declared in its `security` block."
46
+ },
47
+ "internal-error": {
48
+ "title": "Internal error",
49
+ "status": 500,
50
+ "owner": "taxonomy",
51
+ "cause": "The service failed in a way it does not attribute to the request.",
52
+ "remedy": "Retry once. If it persists, report it with the `instance` value from the response body, which identifies the failed request."
53
+ },
54
+ "no-active-organization": {
55
+ "title": "No active organization",
56
+ "status": 403,
57
+ "owner": "convention",
58
+ "cause": "The token authenticates a caller who has no organization selected, so the request cannot be scoped to one. This type carries no `WWW-Authenticate` header.",
59
+ "remedy": "Select an organization for the session and retry."
60
+ },
61
+ "no-converter": {
62
+ "code": "NO_CONVERTER",
63
+ "title": "No converter for that format",
64
+ "status": 422,
65
+ "owner": "taxonomy",
66
+ "cause": "No converter is registered for the `from` format the request named.",
67
+ "remedy": "Choose a format listed by `GET /catalog/converters`."
68
+ },
69
+ "payload-too-large": {
70
+ "code": "TOO_LARGE",
71
+ "title": "Payload too large",
72
+ "status": 413,
73
+ "owner": "taxonomy",
74
+ "cause": "The request body is larger than the service accepts.",
75
+ "remedy": "Submit a smaller document, or ask the deployer to raise the configured limit."
76
+ },
77
+ "quota-exceeded": {
78
+ "title": "Quota exceeded",
79
+ "status": 429,
80
+ "owner": "taxonomy",
81
+ "cause": "The caller has exhausted a rate-limit or storage budget.",
82
+ "remedy": "Wait the interval given in `Retry-After`. The `RateLimit` headers on every response report the remaining budget."
83
+ },
84
+ "schema-invalid": {
85
+ "code": "SCHEMA_INVALID",
86
+ "title": "Document fails its schema",
87
+ "status": 422,
88
+ "owner": "taxonomy",
89
+ "cause": "The body is well-formed JSON but does not satisfy the HDF schema for its document type.",
90
+ "remedy": "Read `errors[]` in the response, which gives a JSON Pointer, a line number and a message for each failing location, and correct the document."
91
+ },
92
+ "store-unavailable": {
93
+ "title": "Document store unavailable",
94
+ "status": 503,
95
+ "owner": "taxonomy",
96
+ "cause": "The document store is unreachable, so the request cannot be answered either way.",
97
+ "remedy": "Retry after the interval in `Retry-After`. Nothing was written."
98
+ },
99
+ "unsupported-media-type": {
100
+ "title": "Unsupported media type",
101
+ "status": 415,
102
+ "owner": "taxonomy",
103
+ "cause": "The request's `Content-Type` is not one the operation accepts.",
104
+ "remedy": "Send the media type the operation's `requestBody` declares."
105
+ },
106
+ "wrong-doc-type": {
107
+ "code": "WRONG_DOC_TYPE",
108
+ "title": "Wrong document type",
109
+ "status": 422,
110
+ "owner": "taxonomy",
111
+ "cause": "The body is a valid HDF document, but of a type this operation does not accept.",
112
+ "remedy": "Use the operation that accepts that document type. The document's `$schema` names its type."
113
+ }
114
+ }
@@ -0,0 +1,125 @@
1
+ # Documentation for every RFC 9457 problem type the reference API declares, plus the
2
+ # convention-owned types ADR-0008 §3 names. RFC 9457 §3.1.1 says a type URI SHOULD
3
+ # dereference to human-readable documentation, and ADR-0008 §3 chose site-hosted URIs over
4
+ # about:blank for that reason, so these pages are part of the contract rather than a nicety.
5
+ #
6
+ # `code` is the mcperr code this type maps, where one does — ADR-0010 §6's mapping, which
7
+ # that section says exists exactly once, so it lives here and nowhere else. A type with no
8
+ # code is raised by a convention or by the service rather than by the document taxonomy.
9
+ # `title` is RFC 9457 §3.1.2's short human-readable summary — prose, not the machine code,
10
+ # which `type` already carries. `status` is cross-checked against the emitted document and
11
+ # ADR-0010 §6 by a test.
12
+ # `remedy` is HTTP-facing on purpose: mcperr's own nextCall strings name MCP tools and
13
+ # HDF_MCP_ROOT, which §2's rewrite map keeps off this surface entirely.
14
+
15
+ ambiguous-format:
16
+ code: AMBIGUOUS_FORMAT
17
+ title: Ambiguous source format
18
+ status: 422
19
+ owner: taxonomy
20
+ cause: The submitted document matched more than one source format, so no converter could be chosen for it.
21
+ remedy: Re-submit with `from` set to the source format you intend. `GET /catalog/converters` lists the accepted values.
22
+
23
+ delete-restricted:
24
+ title: Delete restricted by a citing document
25
+ status: 409
26
+ owner: service
27
+ cause: Another stored document cites this one, and deleting it would leave that citation unresolvable.
28
+ remedy: Remove or amend the citing documents first. The response details name them.
29
+
30
+ document-not-found:
31
+ code: DOCUMENT_NOT_FOUND
32
+ title: Document not found
33
+ status: 404
34
+ owner: taxonomy
35
+ cause: No document is stored under the id the request addresses.
36
+ remedy: Check the id. A deleted document stays absent, so re-create it with `POST /documents` if it should exist.
37
+
38
+ handle-stale:
39
+ code: HANDLE_STALE
40
+ title: Stale document validator
41
+ status: 412
42
+ owner: taxonomy
43
+ cause: The document changed after the ETag given in `If-Match` was issued, so the write was refused rather than applied over content the caller has not seen.
44
+ remedy: Re-read the document, take the ETag from that response, and retry the write with it.
45
+
46
+ held:
47
+ title: Document under legal hold
48
+ status: 409
49
+ owner: service
50
+ cause: The document is under a legal hold, which forbids deletion while the hold stands.
51
+ remedy: None is available to the caller. The hold is released by whoever placed it.
52
+
53
+ insufficient-scope:
54
+ title: Insufficient scope
55
+ status: 403
56
+ owner: convention
57
+ cause: The access token is valid, but carries none of the scopes the operation requires.
58
+ remedy: Obtain a token with the scope named in the response and retry. Each operation's required scopes are declared in its `security` block.
59
+
60
+ internal-error:
61
+ title: Internal error
62
+ status: 500
63
+ owner: taxonomy
64
+ cause: The service failed in a way it does not attribute to the request.
65
+ remedy: Retry once. If it persists, report it with the `instance` value from the response body, which identifies the failed request.
66
+
67
+ no-active-organization:
68
+ title: No active organization
69
+ status: 403
70
+ owner: convention
71
+ cause: The token authenticates a caller who has no organization selected, so the request cannot be scoped to one. This type carries no `WWW-Authenticate` header.
72
+ remedy: Select an organization for the session and retry.
73
+
74
+ no-converter:
75
+ code: NO_CONVERTER
76
+ title: No converter for that format
77
+ status: 422
78
+ owner: taxonomy
79
+ cause: No converter is registered for the `from` format the request named.
80
+ remedy: Choose a format listed by `GET /catalog/converters`.
81
+
82
+ payload-too-large:
83
+ code: TOO_LARGE
84
+ title: Payload too large
85
+ status: 413
86
+ owner: taxonomy
87
+ cause: The request body is larger than the service accepts.
88
+ remedy: Submit a smaller document, or ask the deployer to raise the configured limit.
89
+
90
+ quota-exceeded:
91
+ title: Quota exceeded
92
+ status: 429
93
+ owner: taxonomy
94
+ cause: The caller has exhausted a rate-limit or storage budget.
95
+ remedy: Wait the interval given in `Retry-After`. The `RateLimit` headers on every response report the remaining budget.
96
+
97
+ schema-invalid:
98
+ code: SCHEMA_INVALID
99
+ title: Document fails its schema
100
+ status: 422
101
+ owner: taxonomy
102
+ cause: The body is well-formed JSON but does not satisfy the HDF schema for its document type.
103
+ remedy: Read `errors[]` in the response, which gives a JSON Pointer, a line number and a message for each failing location, and correct the document.
104
+
105
+ store-unavailable:
106
+ title: Document store unavailable
107
+ status: 503
108
+ owner: taxonomy
109
+ cause: The document store is unreachable, so the request cannot be answered either way.
110
+ remedy: Retry after the interval in `Retry-After`. Nothing was written.
111
+
112
+ unsupported-media-type:
113
+ title: Unsupported media type
114
+ status: 415
115
+ owner: taxonomy
116
+ cause: The request's `Content-Type` is not one the operation accepts.
117
+ remedy: Send the media type the operation's `requestBody` declares.
118
+
119
+ wrong-doc-type:
120
+ code: WRONG_DOC_TYPE
121
+ title: Wrong document type
122
+ status: 422
123
+ owner: taxonomy
124
+ cause: The body is a valid HDF document, but of a type this operation does not accept.
125
+ remedy: Use the operation that accepts that document type. The document's `$schema` names its type.
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "@mitre/hdf-openapi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "3.8.0-next.42532249979.1",
4
+ "description": "OpenAPI 3.1 components for HDF, generated from the HDF JSON Schema 2020-12 bundles",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "type": "module",
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./hdf-components.oas.json": "./dist/hdf-components.oas.json",
17
+ "./hdf-components.oas.yaml": "./dist/hdf-components.oas.yaml",
18
+ "./problems.json": "./dist/problems.json"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/mitre/hdf-libs.git",
26
+ "directory": "hdf-openapi"
27
+ },
28
+ "author": "MITRE Corporation",
29
+ "license": "Apache-2.0",
30
+ "dependencies": {
31
+ "ajv": "^8.17.1",
32
+ "ajv-formats": "^3.0.1"
33
+ },
34
+ "devDependencies": {
35
+ "@redocly/cli": "^2.54.3",
36
+ "openapi-typescript": "^7.13.0",
37
+ "tsx": "^4.20.6",
38
+ "yaml": "^2.8.1",
39
+ "@mitre/hdf-fixtures": "^3.8.0-next.42532249979.1"
40
+ },
41
+ "engines": {
42
+ "node": ">=24.0.0"
43
+ },
44
+ "keywords": [
45
+ "hdf",
46
+ "heimdall",
47
+ "openapi",
48
+ "json-schema",
49
+ "contract",
50
+ "security",
51
+ "compliance"
52
+ ],
53
+ "scripts": {
54
+ "build": "pnpm run clean && pnpm run build:components && tsdown",
55
+ "build:components": "node --import tsx src/generate-components.ts",
56
+ "clean": "rimraf dist",
57
+ "lint": "eslint src test scripts",
58
+ "test": "pnpm run test:ts",
59
+ "test:ts": "vitest run",
60
+ "test:watch": "vitest",
61
+ "test:coverage": "vitest run --coverage",
62
+ "type-check": "tsc --noEmit",
63
+ "lint:openapi": "REDOCLY_TELEMETRY=off redocly lint dist/hdf-components.oas.json",
64
+ "matrix": "node scripts/openapi-matrix.mjs",
65
+ "matrix:update": "node scripts/openapi-matrix.mjs --update"
66
+ }
6
67
  }