@hyperscale0/adl 1.0.0-beta.8 → 1.0.123
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 +5 -92
- package/README.md +2 -3
- package/SECURITY.md +0 -4
- package/conformance/cases.json +6 -12
- package/conformance/subject-adapter.ts +0 -5
- package/dist/boundary-fixture.d.ts +1 -4
- package/dist/boundary-fixture.d.ts.map +1 -1
- package/dist/boundary-fixture.js +1 -4
- package/dist/boundary-fixture.js.map +1 -1
- package/dist/index.d.ts +2 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -31
- package/dist/index.js.map +1 -1
- package/dist/vocabulary.d.ts +3 -34
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +1 -52
- package/dist/vocabulary.js.map +1 -1
- package/docs/authoring-guide.md +4 -8
- package/package.json +5 -9
- package/spec/manifest.schema.json +0 -914
package/CHANGELOG.md
CHANGED
|
@@ -1,95 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project
|
|
5
|
-
follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html) from 1.0.0.
|
|
3
|
+
## 1.0.123
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## [1.0.0-beta.7] - 2026-09-21
|
|
12
|
-
|
|
13
|
-
- Added optional `subjectRequirements` on operation bindings: subject fields an action collects before dispatch.
|
|
14
|
-
- Added `BoundaryInstruction`, `BoundaryObservation`, `BoundaryOutcome` and `BoundaryAdapter`.
|
|
15
|
-
- Replaced bank profiles and certification with generic binding conformance.
|
|
16
|
-
- Removed the fictional bank example and its status, rail and calendar vocabulary.
|
|
17
|
-
|
|
18
|
-
## [1.0.0-beta.6] - 2026-09-20
|
|
19
|
-
|
|
20
|
-
- Republished so the package cites a platform commit that survives the 2026-09-19 history rewrite. No vocabulary or conformance change.
|
|
21
|
-
|
|
22
|
-
## [1.0.0-beta.5] - 2026-09-18
|
|
23
|
-
|
|
24
|
-
- Licensed under the Hyperscale Intellectual Property and Copyright License 1.0 (`LicenseRef-Hyperscale-IPCL-1.0`), Tier 2 (Source Available). The AGPL-3.0-only grant ends with this release; earlier versions keep it. `LICENSE.md` and `NOTICE.md` replace the previous license, licensing and trademark files; trademark and conformance rules now live in the license. No vocabulary or conformance change.
|
|
25
|
-
|
|
26
|
-
## [1.0.0-beta.4] - 2026-09-14
|
|
27
|
-
|
|
28
|
-
- Republished with the design-language brand assets in the README. No package behavior changes from 1.0.0-beta.3.
|
|
29
|
-
|
|
30
|
-
## [1.0.0-beta.3] - 2026-09-10
|
|
31
|
-
|
|
32
|
-
- Republished without the GitHub Actions publish workflow. No package behavior changes from 1.0.0-beta.2.
|
|
33
|
-
|
|
34
|
-
## [1.0.0-beta.2] - 2026-09-10
|
|
35
|
-
|
|
36
|
-
- Republished against UDL 2.0.0. No package behavior changes from
|
|
37
|
-
1.0.0-beta.1.
|
|
38
|
-
|
|
39
|
-
## [1.0.0-beta.1] - 2026-08-29
|
|
40
|
-
|
|
41
|
-
- This is the first beta and has no package behavior changes from
|
|
42
|
-
1.0.0-alpha.2.
|
|
43
|
-
|
|
44
|
-
## [1.0.0-alpha.2] - 2026-08-26
|
|
45
|
-
|
|
46
|
-
### Removed
|
|
47
|
-
|
|
48
|
-
- `providerCredentialSources` and `ProviderCredentialSource` from
|
|
49
|
-
`src/vocabulary.ts`. Nothing read either one. A credential source is spelled
|
|
50
|
-
as a literal union on `ProviderCredentialReference` and as a `const` in
|
|
51
|
-
`spec/manifest.schema.json`, so the vocabulary entry was a third copy that no
|
|
52
|
-
type checker and no schema consulted. Neither name was reachable through the
|
|
53
|
-
package entry point, so no installed consumer can be affected.
|
|
54
|
-
|
|
55
|
-
## [1.0.0-alpha.1] - 2026-08-23
|
|
56
|
-
|
|
57
|
-
First retained release, as `@hyperscale0/adl`, from the repository
|
|
58
|
-
`hyperscale0/hyperscale-adl`. Licensed AGPL-3.0-only with a commercial license
|
|
59
|
-
from Hyperscale LLC, which holds the copyright.
|
|
60
|
-
|
|
61
|
-
The package was named `@hyperscale0/provider-adapter` while this format was
|
|
62
|
-
still called the provider adapter kit. That name was unpublished from npm
|
|
63
|
-
before anyone depended on it, so nothing installs from it and there is no
|
|
64
|
-
migration to make: `1.0.0-alpha.1` of `@hyperscale0/adl` is the first version
|
|
65
|
-
that stays. The exported API is unchanged. `ProviderAdapter`,
|
|
66
|
-
`createProviderAdapterRegistry`, `certifyPartnerBankAdapter`, the vocabulary,
|
|
67
|
-
and the conformance codes all keep their names. ADL names the language you
|
|
68
|
-
write an adapter in; an adapter is still what you write.
|
|
69
|
-
|
|
70
|
-
### Added
|
|
71
|
-
|
|
72
|
-
- `docs/authoring-guide.md`: how to write an adapter, field by field, with the
|
|
73
|
-
rule that enforces each one.
|
|
74
|
-
- `examples/meridian-bank`: a complete certified adapter for a fictional bank,
|
|
75
|
-
with provider fixtures and its own tests.
|
|
76
|
-
- `conformance/cases.json`: every conformance and registry-load rule as data,
|
|
77
|
-
one broken fact per case, recording what each gate says about it.
|
|
78
|
-
- `spec/manifest.schema.json`: JSON Schema 2020-12 for one adapter
|
|
79
|
-
declaration, generated from `src/vocabulary.ts` by `scripts/emit-spec.ts`
|
|
80
|
-
and drift-checked by `bun run spec:check`.
|
|
81
|
-
- `bun run conformance -- <module>`: certify every adapter a module exports,
|
|
82
|
-
exit 1 on any finding.
|
|
83
|
-
- `partnerBankConformanceCodes`, the runtime list behind
|
|
84
|
-
`PartnerBankConformanceCode`.
|
|
85
|
-
|
|
86
|
-
### Changed
|
|
87
|
-
|
|
88
|
-
- The closed value sets moved to `src/vocabulary.ts` as runtime arrays with
|
|
89
|
-
the exported types derived from them, so the published schema cannot drift
|
|
90
|
-
from the type checker. No exported type changed shape.
|
|
91
|
-
|
|
92
|
-
[Unreleased]: https://github.com/hyperscale0/hyperscale-adl/compare/v1.0.0-beta.1...HEAD
|
|
93
|
-
[1.0.0-beta.1]: https://github.com/hyperscale0/hyperscale-adl/compare/v1.0.0-alpha.2...v1.0.0-beta.1
|
|
94
|
-
[1.0.0-alpha.2]: https://github.com/hyperscale0/hyperscale-adl/compare/v1.0.0-alpha.1...v1.0.0-alpha.2
|
|
95
|
-
[1.0.0-alpha.1]: https://github.com/hyperscale0/hyperscale-adl/releases/tag/v1.0.0-alpha.1
|
|
5
|
+
First unified release. Every public Hyperscale package now ships under one
|
|
6
|
+
version that follows the platform release number, so release 123 is 1.0.123.
|
|
7
|
+
The compiled contract format is UDL 1 and the HSX header-manifest edition is
|
|
8
|
+
HSX 1.
|
package/README.md
CHANGED
|
@@ -18,13 +18,13 @@ ADL declares provider bindings and the instruction and observation contract for
|
|
|
18
18
|
npm install @hyperscale0/adl
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Pin an exact version before 1.0.0 (see [versioning](#versioning)). ADL depends on `@hyperscale0/udl` for object field schema validation.
|
|
22
22
|
|
|
23
23
|
## Adapter declaration
|
|
24
24
|
|
|
25
25
|
Use `createProviderAdapterRegistry` to validate `ProviderAdapter` declarations and `adapterConformanceFindings` to report incomplete bindings. `BoundaryAdapter` dispatches immutable `BoundaryInstruction` values and returns explicit `BoundaryObservation` values. HTTP success never confirms settlement.
|
|
26
26
|
|
|
27
|
-
The [
|
|
27
|
+
The [boundary adapter](src/boundary-fixture.ts) is the sandbox adapter the platform registers. It has no network, clock or account policy. Check it from this package:
|
|
28
28
|
|
|
29
29
|
```sh
|
|
30
30
|
bun run conformance -- ./src/boundary-fixture.ts
|
|
@@ -35,7 +35,6 @@ bun run conformance -- ./src/boundary-fixture.ts
|
|
|
35
35
|
- [Authoring guide](docs/authoring-guide.md)
|
|
36
36
|
- [Conformance test cases](conformance/cases.json)
|
|
37
37
|
- [Subject adapter fixture](conformance/subject-adapter.ts)
|
|
38
|
-
- [Manifest JSON schema](spec/manifest.schema.json)
|
|
39
38
|
- [Contributing](CONTRIBUTING.md)
|
|
40
39
|
|
|
41
40
|
## Versioning
|
package/SECURITY.md
CHANGED
|
@@ -23,7 +23,3 @@ This package validates declarations. It performs no network calls, reads no
|
|
|
23
23
|
credentials, and executes nothing an adapter author does not import
|
|
24
24
|
themselves. Reports about the runtime that executes adapters belong to the
|
|
25
25
|
platform, not here.
|
|
26
|
-
|
|
27
|
-
`ProviderCredentialReference` stores locators only, never secret values. A
|
|
28
|
-
declaration carrying a real credential is a mistake in that repository, not a
|
|
29
|
-
vulnerability in this one, but tell us if ADL made it easy.
|
package/conformance/cases.json
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"load": "accepts",
|
|
18
|
-
"conformance": ["operation_map_empty"]
|
|
19
|
-
"schema": "accepts"
|
|
18
|
+
"conformance": ["operation_map_empty"]
|
|
20
19
|
},
|
|
21
20
|
{
|
|
22
21
|
"id": "resource-binding-missing",
|
|
@@ -31,8 +30,7 @@
|
|
|
31
30
|
]
|
|
32
31
|
},
|
|
33
32
|
"load": "accepts",
|
|
34
|
-
"conformance": ["resource_binding_missing"]
|
|
35
|
-
"schema": "accepts"
|
|
33
|
+
"conformance": ["resource_binding_missing"]
|
|
36
34
|
},
|
|
37
35
|
{
|
|
38
36
|
"id": "operation-key-mismatch",
|
|
@@ -49,8 +47,7 @@
|
|
|
49
47
|
"load": {
|
|
50
48
|
"throws": "must match operation"
|
|
51
49
|
},
|
|
52
|
-
"conformance": ["declaration_invalid"]
|
|
53
|
-
"schema": "accepts"
|
|
50
|
+
"conformance": ["declaration_invalid"]
|
|
54
51
|
},
|
|
55
52
|
{
|
|
56
53
|
"id": "invalid-provider",
|
|
@@ -67,8 +64,7 @@
|
|
|
67
64
|
"load": {
|
|
68
65
|
"throws": "invalid provider key"
|
|
69
66
|
},
|
|
70
|
-
"conformance": ["declaration_invalid"]
|
|
71
|
-
"schema": "rejects"
|
|
67
|
+
"conformance": ["declaration_invalid"]
|
|
72
68
|
},
|
|
73
69
|
{
|
|
74
70
|
"id": "optional-subject-requirement",
|
|
@@ -91,8 +87,7 @@
|
|
|
91
87
|
"load": {
|
|
92
88
|
"throws": "action requirements cannot be optional"
|
|
93
89
|
},
|
|
94
|
-
"conformance": ["declaration_invalid"]
|
|
95
|
-
"schema": "rejects"
|
|
90
|
+
"conformance": ["declaration_invalid"]
|
|
96
91
|
},
|
|
97
92
|
{
|
|
98
93
|
"id": "invalid-subject-field",
|
|
@@ -114,8 +109,7 @@
|
|
|
114
109
|
"load": {
|
|
115
110
|
"throws": "does not match UDL"
|
|
116
111
|
},
|
|
117
|
-
"conformance": ["declaration_invalid"]
|
|
118
|
-
"schema": "rejects"
|
|
112
|
+
"conformance": ["declaration_invalid"]
|
|
119
113
|
}
|
|
120
114
|
]
|
|
121
115
|
}
|
|
@@ -4,17 +4,13 @@ import type { ProviderAdapter } from "../src/index.js";
|
|
|
4
4
|
export const subjectAdapter: ProviderAdapter = {
|
|
5
5
|
provider: "conformance_subject",
|
|
6
6
|
capability: "subject",
|
|
7
|
-
domain: "conformance",
|
|
8
|
-
egress: "sync_clearance",
|
|
9
7
|
bindings: {
|
|
10
8
|
subject: "strict",
|
|
11
9
|
},
|
|
12
|
-
config: {},
|
|
13
10
|
operationMap: {
|
|
14
11
|
"subject.check": {
|
|
15
12
|
operation: "subject.check",
|
|
16
13
|
direction: "tenant_initiated",
|
|
17
|
-
envelope: "http_200_body_status",
|
|
18
14
|
obligationKind: "subject_check",
|
|
19
15
|
resourceKind: "subject",
|
|
20
16
|
resourceIdPath: "subjectId",
|
|
@@ -27,5 +23,4 @@ export const subjectAdapter: ProviderAdapter = {
|
|
|
27
23
|
],
|
|
28
24
|
},
|
|
29
25
|
},
|
|
30
|
-
webhookMap: {},
|
|
31
26
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { type BoundaryInstruction, type BoundaryObservation, type BoundaryOutcome } from "./index.js";
|
|
2
|
-
/**
|
|
2
|
+
/** The sandbox boundary adapter the platform registers. No transport, clock, accounts or inferred outcome. */
|
|
3
3
|
export declare const genericAdapter: {
|
|
4
4
|
readonly provider: "conformance_boundary";
|
|
5
5
|
readonly capability: "boundary";
|
|
6
|
-
readonly egress: "none";
|
|
7
|
-
readonly config: {};
|
|
8
6
|
readonly bindings: {
|
|
9
7
|
readonly instruction: "strict";
|
|
10
8
|
};
|
|
@@ -18,7 +16,6 @@ export declare const genericAdapter: {
|
|
|
18
16
|
readonly subjectRequirements: readonly [];
|
|
19
17
|
};
|
|
20
18
|
};
|
|
21
|
-
readonly webhookMap: {};
|
|
22
19
|
};
|
|
23
20
|
export declare function observeBoundary(instruction: BoundaryInstruction, outcome: BoundaryOutcome, externalReference: string, observedAt: string): BoundaryObservation;
|
|
24
21
|
//# sourceMappingURL=boundary-fixture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundary-fixture.d.ts","sourceRoot":"","sources":["../src/boundary-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB,
|
|
1
|
+
{"version":3,"file":"boundary-fixture.d.ts","sourceRoot":"","sources":["../src/boundary-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAEpB,8GAA8G;AAC9G,eAAO,MAAM,cAAc;uBAEb,sBAAsB;yBACpB,UAAU;;iBACV,WAAW,EAAE,QAAQ;;;iBAE/B,kBAAkB;qBAChB,SAAS,EAAE,kBAAkB;qBAC7B,SAAS,EAAE,mBAAmB;qBAC9B,cAAc,EAAE,sBAAsB;qBACtC,YAAY,EAAE,aAAa;qBAC3B,cAAc,EAAE,eAAe;qBAC/B,mBAAmB;;;CAIb,CAAC;AAEf,wBAAgB,eAAe,CAC7B,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,EACzB,UAAU,EAAE,MAAM,GACjB,mBAAmB,CAUrB"}
|
package/dist/boundary-fixture.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { createProviderAdapterRegistry, boundaryObservationSchema, } from "./index.js";
|
|
2
|
-
/**
|
|
2
|
+
/** The sandbox boundary adapter the platform registers. No transport, clock, accounts or inferred outcome. */
|
|
3
3
|
export const genericAdapter = createProviderAdapterRegistry()([
|
|
4
4
|
{
|
|
5
5
|
provider: "conformance_boundary",
|
|
6
6
|
capability: "boundary",
|
|
7
|
-
egress: "none",
|
|
8
|
-
config: {},
|
|
9
7
|
bindings: { instruction: "strict" },
|
|
10
8
|
operationMap: {
|
|
11
9
|
"boundary.observe": {
|
|
@@ -17,7 +15,6 @@ export const genericAdapter = createProviderAdapterRegistry()([
|
|
|
17
15
|
subjectRequirements: [],
|
|
18
16
|
},
|
|
19
17
|
},
|
|
20
|
-
webhookMap: {},
|
|
21
18
|
},
|
|
22
19
|
])[0];
|
|
23
20
|
export function observeBoundary(instruction, outcome, externalReference, observedAt) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundary-fixture.js","sourceRoot":"","sources":["../src/boundary-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,GAI1B,MAAM,YAAY,CAAC;AAEpB,
|
|
1
|
+
{"version":3,"file":"boundary-fixture.js","sourceRoot":"","sources":["../src/boundary-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,GAI1B,MAAM,YAAY,CAAC;AAEpB,8GAA8G;AAC9G,MAAM,CAAC,MAAM,cAAc,GAAG,6BAA6B,EAAE,CAAC;IAC5D;QACE,QAAQ,EAAE,sBAAsB;QAChC,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE;QACnC,YAAY,EAAE;YACZ,kBAAkB,EAAE;gBAClB,SAAS,EAAE,kBAAkB;gBAC7B,SAAS,EAAE,mBAAmB;gBAC9B,cAAc,EAAE,sBAAsB;gBACtC,YAAY,EAAE,aAAa;gBAC3B,cAAc,EAAE,eAAe;gBAC/B,mBAAmB,EAAE,EAAE;aACxB;SACF;KACF;CACO,CAAC,CAAC,CAAC,CAAC,CAAC;AAEf,MAAM,UAAU,eAAe,CAC7B,WAAgC,EAChC,OAAwB,EACxB,iBAAyB,EACzB,UAAkB;IAElB,IAAI,WAAW,CAAC,OAAO,KAAK,cAAc,CAAC,QAAQ;QACjD,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,OAAO,yBAAyB,CAAC,KAAK,CAAC;QACrC,OAAO,EAAE,cAAc,CAAC,QAAQ;QAChC,aAAa,EAAE,WAAW,CAAC,EAAE;QAC7B,OAAO;QACP,iBAAiB;QACjB,UAAU;KACX,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { type UdlObjectField } from "@hyperscale0/udl";
|
|
3
|
-
import { subjectFieldTypes, type
|
|
3
|
+
import { subjectFieldTypes, type ProviderOperationDirection, type ProviderResourceBinding, type SubjectFieldType } from "./vocabulary.js";
|
|
4
4
|
export { subjectFieldTypes };
|
|
5
|
-
export type {
|
|
5
|
+
export type { ProviderOperationDirection, ProviderResourceBinding, SubjectFieldType, };
|
|
6
6
|
export declare const boundaryOutcomeSchema: z.ZodEnum<{
|
|
7
7
|
acknowledged: "acknowledged";
|
|
8
8
|
confirmed: "confirmed";
|
|
@@ -53,38 +53,19 @@ export interface BoundaryAdapter {
|
|
|
53
53
|
}
|
|
54
54
|
export interface ProviderAdapterVocabulary {
|
|
55
55
|
readonly capability: string;
|
|
56
|
-
readonly domain: string;
|
|
57
|
-
readonly meter: string;
|
|
58
56
|
readonly obligation: string;
|
|
59
57
|
readonly operation: string;
|
|
60
58
|
readonly resource: string;
|
|
61
|
-
readonly webhookOperation: string;
|
|
62
|
-
readonly webhookResource: string;
|
|
63
|
-
readonly webhookResourceId: string;
|
|
64
59
|
}
|
|
65
60
|
export interface ProviderAdapter<Vocabulary extends ProviderAdapterVocabulary = ProviderAdapterVocabulary> {
|
|
66
61
|
readonly bindings: Partial<Record<Vocabulary["resource"], ProviderResourceBinding>>;
|
|
67
62
|
readonly capability: Vocabulary["capability"];
|
|
68
|
-
readonly config: ProviderConfig;
|
|
69
|
-
readonly domain?: Vocabulary["domain"];
|
|
70
|
-
readonly egress: ProviderEgressMode;
|
|
71
63
|
readonly operationMap: Partial<Record<Vocabulary["operation"], ProviderOperationBinding<Vocabulary>>>;
|
|
72
64
|
readonly provider: string;
|
|
73
|
-
readonly webhookMap: Readonly<Record<string, ProviderWebhookTransitionPlan<Vocabulary>>>;
|
|
74
65
|
}
|
|
75
66
|
export interface ProviderOperationBinding<Vocabulary extends ProviderAdapterVocabulary = ProviderAdapterVocabulary> {
|
|
76
|
-
/**
|
|
77
|
-
* How THIS operation's response carries its outcome. Per operation, never
|
|
78
|
-
* per provider and never inherited from another provider's class: one real
|
|
79
|
-
* provider answers two ways, wrapping six of seven endpoints in
|
|
80
|
-
* `{status, message, data}` while the seventh returns a bare object. Absent
|
|
81
|
-
* means the class is not established yet -- an unclassified operation, not
|
|
82
|
-
* a silent `http_200_body_status`.
|
|
83
|
-
*/
|
|
84
|
-
readonly envelope?: ProviderResponseEnvelope;
|
|
85
67
|
readonly operation: Vocabulary["operation"];
|
|
86
68
|
readonly direction: ProviderOperationDirection;
|
|
87
|
-
readonly meter?: Vocabulary["meter"];
|
|
88
69
|
readonly obligationKind: Vocabulary["obligation"];
|
|
89
70
|
readonly resourceIdPath: string;
|
|
90
71
|
readonly resourceKind: Vocabulary["resource"];
|
|
@@ -97,28 +78,6 @@ export interface ProviderOperationBinding<Vocabulary extends ProviderAdapterVoca
|
|
|
97
78
|
*/
|
|
98
79
|
readonly subjectRequirements?: readonly UdlObjectField[];
|
|
99
80
|
}
|
|
100
|
-
export interface ProviderWebhookTransitionPlan<Vocabulary extends ProviderAdapterVocabulary = ProviderAdapterVocabulary> {
|
|
101
|
-
readonly eventKind: string;
|
|
102
|
-
readonly operationName: Vocabulary["webhookOperation"];
|
|
103
|
-
readonly optionalPayloadFields: readonly string[];
|
|
104
|
-
readonly requiredFieldGroups: readonly (readonly string[])[];
|
|
105
|
-
readonly requiredPayloadFields: readonly string[];
|
|
106
|
-
readonly resourceIdField: Vocabulary["webhookResourceId"];
|
|
107
|
-
readonly resourceKind: Vocabulary["webhookResource"];
|
|
108
|
-
readonly timestampField: ProviderTimestampField;
|
|
109
|
-
}
|
|
110
|
-
export type ProviderCredentialReference = {
|
|
111
|
-
readonly name: string;
|
|
112
|
-
readonly source: "environment";
|
|
113
|
-
} | {
|
|
114
|
-
readonly account: string;
|
|
115
|
-
readonly service: string;
|
|
116
|
-
readonly source: "keychain";
|
|
117
|
-
};
|
|
118
|
-
export interface ProviderConfig {
|
|
119
|
-
readonly baseUrl?: string;
|
|
120
|
-
readonly credentialRef?: ProviderCredentialReference;
|
|
121
|
-
}
|
|
122
81
|
/** Bind a product vocabulary once, then retain literal adapter registry types. */
|
|
123
82
|
export declare function createProviderAdapterRegistry<Vocabulary extends ProviderAdapterVocabulary>(): <const Adapters extends readonly ProviderAdapter<Vocabulary>[]>(adapters: Adapters) => Adapters;
|
|
124
83
|
export type AdapterConformanceCode = "operation_map_empty" | "resource_binding_missing" | "declaration_invalid";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAEL,iBAAiB,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,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,0BAA0B,CACxC,UAAU,SAAS,yBAAyB,EAC5C,OAAO,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,yBAAyB,EAAE,CAkB5E"}
|
package/dist/index.js
CHANGED
|
@@ -52,9 +52,7 @@ function defineProviderAdapters(adapters) {
|
|
|
52
52
|
throw new Error(`duplicate provider adapter ${identity}`);
|
|
53
53
|
}
|
|
54
54
|
identities.add(identity);
|
|
55
|
-
validateConfig(adapter.provider, adapter.config);
|
|
56
55
|
validateOperations(adapter);
|
|
57
|
-
validateWebhooks(adapter);
|
|
58
56
|
}
|
|
59
57
|
return adapters;
|
|
60
58
|
}
|
|
@@ -62,25 +60,6 @@ function defineProviderAdapters(adapters) {
|
|
|
62
60
|
export function createProviderAdapterRegistry() {
|
|
63
61
|
return (adapters) => defineProviderAdapters(adapters);
|
|
64
62
|
}
|
|
65
|
-
function validateConfig(provider, config) {
|
|
66
|
-
if (config.baseUrl) {
|
|
67
|
-
try {
|
|
68
|
-
new URL(config.baseUrl);
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
throw new Error(`${provider} config.baseUrl must be an absolute URL`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const credential = config.credentialRef;
|
|
75
|
-
if (!credential)
|
|
76
|
-
return;
|
|
77
|
-
if (credential.source === "environment") {
|
|
78
|
-
assertNonblank(provider, "config.credentialRef.name", credential.name);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
assertNonblank(provider, "config.credentialRef.account", credential.account);
|
|
82
|
-
assertNonblank(provider, "config.credentialRef.service", credential.service);
|
|
83
|
-
}
|
|
84
63
|
function validateOperations(adapter) {
|
|
85
64
|
for (const [operation, binding] of Object.entries(adapter.operationMap)) {
|
|
86
65
|
if (operation !== binding.operation) {
|
|
@@ -104,13 +83,6 @@ function validateOperations(adapter) {
|
|
|
104
83
|
}
|
|
105
84
|
}
|
|
106
85
|
}
|
|
107
|
-
function validateWebhooks(adapter) {
|
|
108
|
-
for (const [event, plan] of Object.entries(adapter.webhookMap)) {
|
|
109
|
-
if (event !== plan.eventKind) {
|
|
110
|
-
throw new Error(`${adapter.provider} webhookMap key ${event} must match eventKind ${plan.eventKind}`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
86
|
function assertNonblank(provider, field, value) {
|
|
115
87
|
if (value.trim().length === 0) {
|
|
116
88
|
throw new Error(`${provider} ${field} must not be blank`);
|
|
@@ -159,9 +131,6 @@ function bindingFindings(adapter) {
|
|
|
159
131
|
continue;
|
|
160
132
|
require(binding.resourceKind, `bindings.${binding.resourceKind}`);
|
|
161
133
|
}
|
|
162
|
-
for (const plan of Object.values(adapter.webhookMap)) {
|
|
163
|
-
require(plan.resourceKind, `bindings.${plan.resourceKind}`);
|
|
164
|
-
}
|
|
165
134
|
return findings;
|
|
166
135
|
}
|
|
167
136
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAuB,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAuB,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAIlB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAO7B,MAA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O,EACL,iBAAiB,IAAI,8CAA8C;gBACnE,8DAA8D;YAChE,IAAI;SACL,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAGrD,EAAE,CAAC;QACJ,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/vocabulary.d.ts
CHANGED
|
@@ -1,38 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every closed value set an adapter declaration may use, as runtime arrays
|
|
3
|
-
* with the types derived from them.
|
|
4
|
-
*
|
|
5
|
-
* One source of truth: the exported types below are `(typeof array)[number]`,
|
|
6
|
-
* and `scripts/emit-spec.ts` builds `spec/manifest.schema.json` from the same
|
|
7
|
-
* arrays. A value added here reaches the type checker and the published JSON
|
|
8
|
-
* Schema in the same commit, so the two cannot drift.
|
|
9
|
-
*
|
|
10
|
-
* This module imports nothing, so both `index.ts` and `conformance.ts` can
|
|
11
|
-
* read it without a load-order cycle.
|
|
12
|
-
*/
|
|
1
|
+
/** Closed value sets an adapter declaration may use. This module imports nothing. */
|
|
13
2
|
export declare const providerKeyPattern: RegExp;
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export declare const providerEgressModes: readonly ["none", "rest", "sync_clearance"];
|
|
17
|
-
/**
|
|
18
|
-
* How one provider operation carries its outcome:
|
|
19
|
-
*
|
|
20
|
-
* - `http_200_body_status` -- every response is HTTP 200 and the outcome
|
|
21
|
-
* classifies on a body status field, so a rejection can arrive as a
|
|
22
|
-
* status token inside a 200;
|
|
23
|
-
* - `http_status_error_body` -- the outcome rides the HTTP status and a
|
|
24
|
-
* failure carries a thin prose body (`{status, message}`);
|
|
25
|
-
* - `unconfirmed_until_live` -- the provider publishes no error sample at
|
|
26
|
-
* all, so the class is honestly unknown until first live traffic. An
|
|
27
|
-
* adapter must never borrow another provider's class to fill this in.
|
|
28
|
-
*/
|
|
29
|
-
export declare const providerResponseEnvelopes: readonly ["http_200_body_status", "http_status_error_body", "unconfirmed_until_live"];
|
|
30
|
-
export declare const providerTimestampFields: readonly ["activeAt", "completedAt", "failedAt", "returnedAt", "receivedAt", "clearedAt", "expiredAt", "voidedAt", "postedAt", "refundedAt"];
|
|
31
|
-
export type ProviderOperationDirection = (typeof providerOperationDirections)[number];
|
|
32
|
-
export type ProviderResourceBinding = (typeof providerResourceBindings)[number];
|
|
33
|
-
export type ProviderEgressMode = (typeof providerEgressModes)[number];
|
|
34
|
-
export type ProviderResponseEnvelope = (typeof providerResponseEnvelopes)[number];
|
|
35
|
-
export type ProviderTimestampField = (typeof providerTimestampFields)[number];
|
|
3
|
+
export type ProviderOperationDirection = "tenant_initiated" | "system_settlement";
|
|
4
|
+
export type ProviderResourceBinding = "strict" | "claim" | "confirmation_only" | "evidence_only";
|
|
36
5
|
export declare const subjectFieldTypes: readonly ["money", "ref", "date", "duration", "text", "integer", "percent", "boolean", "enum", "list"];
|
|
37
6
|
export type SubjectFieldType = (typeof subjectFieldTypes)[number];
|
|
38
7
|
//# sourceMappingURL=vocabulary.d.ts.map
|
package/dist/vocabulary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,eAAO,MAAM,kBAAkB,QAA6B,CAAC;AAE7D,MAAM,MAAM,0BAA0B,GAClC,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,OAAO,GACP,mBAAmB,GACnB,eAAe,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAC5B,OAAO,EACP,KAAK,EACL,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,MAAM,CACE,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/vocabulary.js
CHANGED
|
@@ -1,56 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every closed value set an adapter declaration may use, as runtime arrays
|
|
3
|
-
* with the types derived from them.
|
|
4
|
-
*
|
|
5
|
-
* One source of truth: the exported types below are `(typeof array)[number]`,
|
|
6
|
-
* and `scripts/emit-spec.ts` builds `spec/manifest.schema.json` from the same
|
|
7
|
-
* arrays. A value added here reaches the type checker and the published JSON
|
|
8
|
-
* Schema in the same commit, so the two cannot drift.
|
|
9
|
-
*
|
|
10
|
-
* This module imports nothing, so both `index.ts` and `conformance.ts` can
|
|
11
|
-
* read it without a load-order cycle.
|
|
12
|
-
*/
|
|
1
|
+
/** Closed value sets an adapter declaration may use. This module imports nothing. */
|
|
13
2
|
export const providerKeyPattern = /^[a-z][a-z0-9_.-]{0,79}$/;
|
|
14
|
-
export const providerOperationDirections = [
|
|
15
|
-
"tenant_initiated",
|
|
16
|
-
"system_settlement",
|
|
17
|
-
];
|
|
18
|
-
export const providerResourceBindings = [
|
|
19
|
-
"strict",
|
|
20
|
-
"claim",
|
|
21
|
-
"confirmation_only",
|
|
22
|
-
"evidence_only",
|
|
23
|
-
];
|
|
24
|
-
export const providerEgressModes = ["none", "rest", "sync_clearance"];
|
|
25
|
-
/**
|
|
26
|
-
* How one provider operation carries its outcome:
|
|
27
|
-
*
|
|
28
|
-
* - `http_200_body_status` -- every response is HTTP 200 and the outcome
|
|
29
|
-
* classifies on a body status field, so a rejection can arrive as a
|
|
30
|
-
* status token inside a 200;
|
|
31
|
-
* - `http_status_error_body` -- the outcome rides the HTTP status and a
|
|
32
|
-
* failure carries a thin prose body (`{status, message}`);
|
|
33
|
-
* - `unconfirmed_until_live` -- the provider publishes no error sample at
|
|
34
|
-
* all, so the class is honestly unknown until first live traffic. An
|
|
35
|
-
* adapter must never borrow another provider's class to fill this in.
|
|
36
|
-
*/
|
|
37
|
-
export const providerResponseEnvelopes = [
|
|
38
|
-
"http_200_body_status",
|
|
39
|
-
"http_status_error_body",
|
|
40
|
-
"unconfirmed_until_live",
|
|
41
|
-
];
|
|
42
|
-
export const providerTimestampFields = [
|
|
43
|
-
"activeAt",
|
|
44
|
-
"completedAt",
|
|
45
|
-
"failedAt",
|
|
46
|
-
"returnedAt",
|
|
47
|
-
"receivedAt",
|
|
48
|
-
"clearedAt",
|
|
49
|
-
"expiredAt",
|
|
50
|
-
"voidedAt",
|
|
51
|
-
"postedAt",
|
|
52
|
-
"refundedAt",
|
|
53
|
-
];
|
|
54
3
|
export const subjectFieldTypes = [
|
|
55
4
|
"money",
|
|
56
5
|
"ref",
|
package/dist/vocabulary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAY7D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO;IACP,KAAK;IACL,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;CACE,CAAC"}
|
package/docs/authoring-guide.md
CHANGED
|
@@ -11,13 +11,12 @@ key must equal its binding's `operation`. Its `resourceKind` must appear in
|
|
|
11
11
|
`bindings`. Subject requirements describe required authored fields or attachments;
|
|
12
12
|
they never supply an account or choose a party.
|
|
13
13
|
|
|
14
|
-
The [
|
|
14
|
+
The [boundary adapter](../src/boundary-fixture.ts) declares one boundary
|
|
15
15
|
observation operation with no subject requirements. The
|
|
16
16
|
[subject fixture](../conformance/subject-adapter.ts) shows required subject fields.
|
|
17
17
|
|
|
18
|
-
`adapterConformanceFindings` checks the declaration
|
|
19
|
-
|
|
20
|
-
for non-TypeScript authors. Neither check contacts a provider.
|
|
18
|
+
`adapterConformanceFindings` checks the declaration without contacting a
|
|
19
|
+
provider.
|
|
21
20
|
|
|
22
21
|
## Dispatch an instruction
|
|
23
22
|
|
|
@@ -43,10 +42,7 @@ From this package:
|
|
|
43
42
|
|
|
44
43
|
```sh
|
|
45
44
|
bun run conformance -- ./src/boundary-fixture.ts
|
|
46
|
-
bun run spec:emit
|
|
47
45
|
```
|
|
48
46
|
|
|
49
|
-
The conformance command exits 1 when it reports a finding.
|
|
50
|
-
writes the declaration schema and the `BoundaryInstruction` and
|
|
51
|
-
`BoundaryObservation` definitions. Add a case in `conformance/cases.json` when a
|
|
47
|
+
The conformance command exits 1 when it reports a finding. Add a case in `conformance/cases.json` when a
|
|
52
48
|
new declaration rule prevents a concrete failure.
|