@hyperscale0/adl 1.0.0-alpha.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.
- package/AUTHORS +8 -0
- package/CHANGELOG.md +47 -0
- package/LICENSE +661 -0
- package/LICENSING.md +51 -0
- package/README.md +165 -0
- package/SECURITY.md +29 -0
- package/TRADEMARKS.md +30 -0
- package/conformance/cases.json +835 -0
- package/dist/conformance.d.ts +41 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +486 -0
- package/dist/conformance.js.map +1 -0
- package/dist/index.d.ts +219 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +144 -0
- package/dist/index.js.map +1 -0
- package/dist/vocabulary.d.ts +94 -0
- package/dist/vocabulary.d.ts.map +1 -0
- package/dist/vocabulary.js +139 -0
- package/dist/vocabulary.js.map +1 -0
- package/docs/authoring-guide.md +431 -0
- package/examples/meridian-bank/README.md +65 -0
- package/examples/meridian-bank/example.spec.ts +162 -0
- package/examples/meridian-bank/fixtures/payout-status-replay.json +19 -0
- package/examples/meridian-bank/fixtures/payout-status-settled.json +19 -0
- package/examples/meridian-bank/fixtures/payout-submit-accepted.json +26 -0
- package/examples/meridian-bank/fixtures/payout-submit-declined.json +25 -0
- package/examples/meridian-bank/fixtures/statement-camt053.json +45 -0
- package/examples/meridian-bank/fixtures/webhook-payout-settled.json +11 -0
- package/examples/meridian-bank/index.ts +262 -0
- package/package.json +79 -0
- package/spec/manifest.schema.json +757 -0
package/LICENSING.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Licensing
|
|
2
|
+
|
|
3
|
+
The code in this repository is Copyright 2026 Hyperscale LLC and is licensed
|
|
4
|
+
under the GNU Affero General Public License version 3 only
|
|
5
|
+
(`AGPL-3.0-only`). The full text is in [`LICENSE`](./LICENSE).
|
|
6
|
+
|
|
7
|
+
## What the AGPL asks of you
|
|
8
|
+
|
|
9
|
+
Two obligations matter in practice.
|
|
10
|
+
|
|
11
|
+
**If you distribute a copy in object form**, modified or not, you make its
|
|
12
|
+
Corresponding Source available under the same license.
|
|
13
|
+
|
|
14
|
+
**If you run a modified copy as a network service**, section 13 applies: the
|
|
15
|
+
users interacting with it over the network get an offer of the source of the
|
|
16
|
+
version you are running. Validating adapters with an unmodified copy behind
|
|
17
|
+
your own service does not trigger this. Changing the vocabulary, the registry
|
|
18
|
+
loader, or the conformance runner and then serving that change does.
|
|
19
|
+
|
|
20
|
+
Using `@hyperscale0/adl` as a library inside your own program is a
|
|
21
|
+
combined work under the AGPL. If that does not fit how you ship, take the
|
|
22
|
+
commercial license instead.
|
|
23
|
+
|
|
24
|
+
## Commercial license
|
|
25
|
+
|
|
26
|
+
Hyperscale LLC sells a commercial license to organisations that cannot accept
|
|
27
|
+
the AGPL, for the usual reasons: a proprietary adapter that links ADL, a
|
|
28
|
+
hosted service you will not open, a procurement policy that refuses copyleft.
|
|
29
|
+
It grants the same code under ordinary commercial terms with no source
|
|
30
|
+
obligation.
|
|
31
|
+
|
|
32
|
+
Ask through <https://hyperscale0.ai>.
|
|
33
|
+
|
|
34
|
+
## The license covers code, not marks
|
|
35
|
+
|
|
36
|
+
"Hyperscale" is a trademark of Hyperscale LLC. A copyright license says nothing
|
|
37
|
+
about trademarks in either direction, so [TRADEMARKS.md](TRADEMARKS.md) draws
|
|
38
|
+
that boundary.
|
|
39
|
+
|
|
40
|
+
## The format is not this implementation of it
|
|
41
|
+
|
|
42
|
+
ADL the format is separate from this package, which implements it. The
|
|
43
|
+
JSON Schema in [`spec/`](spec) and the conformance cases in
|
|
44
|
+
[`conformance/`](conformance) are data describing a format, and anyone may
|
|
45
|
+
write their own validator or registry loader against them, in any language,
|
|
46
|
+
under any license, without touching this code.
|
|
47
|
+
|
|
48
|
+
What you may then say about it is a trademark question, not a copyright one.
|
|
49
|
+
[TRADEMARKS.md](TRADEMARKS.md) has the rule: claim that you pass a version of
|
|
50
|
+
the conformance suite only when you pass that version's published cases
|
|
51
|
+
unmodified.
|
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# ADL
|
|
2
|
+
|
|
3
|
+
ADL, the Adapter Declaration Language: the format for describing a bank or
|
|
4
|
+
provider to Hyperscale, the validator that refuses a declaration the runtime
|
|
5
|
+
could not operate, and the conformance suite that says when one is ready to
|
|
6
|
+
serve live money.
|
|
7
|
+
|
|
8
|
+
It is the third of three. UDL describes the product, HSX scripts the money
|
|
9
|
+
movement, ADL declares the provider the money moves through.
|
|
10
|
+
|
|
11
|
+
**Status: alpha.** `1.0.0-alpha.1`. The surface can still change on a minor
|
|
12
|
+
version until 1.0.0.
|
|
13
|
+
|
|
14
|
+
## Adapter symmetry
|
|
15
|
+
|
|
16
|
+
Hyperscale's own bank adapters are written against this package and nothing
|
|
17
|
+
more. There is no private adapter API and no second interface for first-party
|
|
18
|
+
code. When one of our adapters needs a seam ADL lacks, the seam is added here,
|
|
19
|
+
in public, or it is not added.
|
|
20
|
+
|
|
21
|
+
So the guide below is not a simplified account of how we do it. It is how we
|
|
22
|
+
do it.
|
|
23
|
+
|
|
24
|
+
## What an adapter is
|
|
25
|
+
|
|
26
|
+
A declaration, not a client. A plain object saying what the provider does:
|
|
27
|
+
which commands exist, how each response classifies, what the bank's status
|
|
28
|
+
tokens mean, when statements can be fetched, which reference comes back on a
|
|
29
|
+
debit. The runtime that executes it is generic and ships with the platform.
|
|
30
|
+
|
|
31
|
+
Your adapter opens no sockets, holds no credentials, and decides nothing about
|
|
32
|
+
what a payment means. It states facts, and the checks in this package prove
|
|
33
|
+
those facts are complete enough for a generic runtime to poll, classify,
|
|
34
|
+
reconcile, and dedupe without guessing.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install @hyperscale0/adl
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Every release before 1.0.0 is an alpha, and `latest` follows the newest one, so
|
|
43
|
+
a bare install gets it. `npm install @hyperscale0/adl@alpha` is the explicit
|
|
44
|
+
form and resolves to the same version. Pin an exact version if you need one:
|
|
45
|
+
until 1.0.0 a change to the surface ships as a minor bump, not a major.
|
|
46
|
+
|
|
47
|
+
No runtime dependencies, and no proprietary code imported.
|
|
48
|
+
|
|
49
|
+
## The thirty-second shape
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import {
|
|
53
|
+
certifyPartnerBankAdapter,
|
|
54
|
+
createProviderAdapterRegistry,
|
|
55
|
+
type ProviderAdapterVocabulary,
|
|
56
|
+
} from "@hyperscale0/adl";
|
|
57
|
+
|
|
58
|
+
interface MyVocabulary extends ProviderAdapterVocabulary {
|
|
59
|
+
capability: "payout_execution";
|
|
60
|
+
operation: "payout.submit";
|
|
61
|
+
resource: "payout";
|
|
62
|
+
// ...the rest of your closed unions
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const defineAdapters = createProviderAdapterRegistry<MyVocabulary>();
|
|
66
|
+
|
|
67
|
+
export const adapters = defineAdapters([
|
|
68
|
+
{
|
|
69
|
+
provider: "meridian_bank",
|
|
70
|
+
capability: "payout_execution",
|
|
71
|
+
egress: "rest",
|
|
72
|
+
operationMap: {
|
|
73
|
+
"payout.submit": {
|
|
74
|
+
operation: "payout.submit",
|
|
75
|
+
direction: "tenant_initiated",
|
|
76
|
+
envelope: "http_status_error_body",
|
|
77
|
+
statusEnquiry: {
|
|
78
|
+
keys: "provider_reference",
|
|
79
|
+
pathTemplate: "/v2/payments/{providerReference}",
|
|
80
|
+
},
|
|
81
|
+
obligationKind: "payout_submission",
|
|
82
|
+
resourceKind: "payout",
|
|
83
|
+
resourceIdPath: "payoutId",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
webhookMap: {},
|
|
87
|
+
bindings: { payout: "claim" },
|
|
88
|
+
config: {
|
|
89
|
+
credentialRef: { source: "environment", name: "MERIDIAN_CREDENTIALS" },
|
|
90
|
+
},
|
|
91
|
+
profile: myBankProfile,
|
|
92
|
+
},
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
for (const adapter of adapters) certifyPartnerBankAdapter(adapter);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`createProviderAdapterRegistry` validates at import and preserves your literal
|
|
99
|
+
types. `certifyPartnerBankAdapter` throws with every gap listed at once; an
|
|
100
|
+
empty finding list is the certification.
|
|
101
|
+
|
|
102
|
+
## Where to go next
|
|
103
|
+
|
|
104
|
+
- **[docs/authoring-guide.md](docs/authoring-guide.md)** -- the whole job, field
|
|
105
|
+
by field, with the rule that enforces each one.
|
|
106
|
+
- **[examples/meridian-bank](examples/meridian-bank)** -- a complete certified
|
|
107
|
+
adapter for a bank that does not exist, with fixtures and its own tests.
|
|
108
|
+
Copy it.
|
|
109
|
+
- **[conformance/cases.json](conformance/cases.json)** -- every rule as data:
|
|
110
|
+
one broken fact per case, and what each gate says about it.
|
|
111
|
+
- **[spec/manifest.schema.json](spec/manifest.schema.json)** -- JSON Schema
|
|
112
|
+
2020-12 for one declaration, for authors who are not writing TypeScript.
|
|
113
|
+
|
|
114
|
+
## Running conformance
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
bun run conformance -- ./examples/meridian-bank
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
ok meridian_bank:payout_execution
|
|
122
|
+
ok meridian_bank:bank_credit
|
|
123
|
+
2 adapter(s) checked, 0 finding(s) reported
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Exit 1 when anything reports, so it drops straight into CI.
|
|
127
|
+
|
|
128
|
+
## Development
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
bun install
|
|
132
|
+
bun run check # spec drift, tests, types
|
|
133
|
+
bun run build
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Versioning
|
|
137
|
+
|
|
138
|
+
Semantic versioning from 1.0.0. Until then, alpha releases may change the
|
|
139
|
+
surface on a minor version. Two promises hold now:
|
|
140
|
+
|
|
141
|
+
- conformance codes are append-only: a released code is never renamed or
|
|
142
|
+
removed, so `switch` statements stay exhaustive;
|
|
143
|
+
- removing a value from a vocabulary in `src/vocabulary.ts` is a breaking
|
|
144
|
+
change and appears in [CHANGELOG.md](CHANGELOG.md).
|
|
145
|
+
|
|
146
|
+
## Contributing
|
|
147
|
+
|
|
148
|
+
Issues only. Hyperscale makes the changes to the format and the package; you
|
|
149
|
+
propose them in an issue carrying the provider that needs the seam and the
|
|
150
|
+
conformance case it would add. [CONTRIBUTING.md](CONTRIBUTING.md) has that
|
|
151
|
+
model in full, plus the loop: what earns a new field, how to regenerate the
|
|
152
|
+
schema, and the CLA behind a rare accepted pull request. Participation is under
|
|
153
|
+
the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
154
|
+
|
|
155
|
+
Vulnerabilities go through GitHub private reporting, never a public issue. See
|
|
156
|
+
[SECURITY.md](SECURITY.md).
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
AGPL-3.0-only, with a commercial license available from Hyperscale LLC for
|
|
161
|
+
organisations that cannot accept the AGPL. See [LICENSE](LICENSE) for the text
|
|
162
|
+
and [LICENSING.md](LICENSING.md) for which one you want and how to ask for the
|
|
163
|
+
commercial one. Neither covers the Hyperscale marks;
|
|
164
|
+
[TRADEMARKS.md](TRADEMARKS.md) says what that means and carries the rule for
|
|
165
|
+
claiming conformance.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Report privately through GitHub: open the **Security** tab of this repository
|
|
6
|
+
and choose **Report a vulnerability**. That opens a private advisory only the
|
|
7
|
+
maintainers can read.
|
|
8
|
+
|
|
9
|
+
Do not open a public issue for a vulnerability, and do not include credentials
|
|
10
|
+
or production data in a report.
|
|
11
|
+
|
|
12
|
+
What helps: the version, what an attacker gains, and the smallest reproduction
|
|
13
|
+
you have. A declaration that triggers the bug is ideal, with every locator
|
|
14
|
+
value removed.
|
|
15
|
+
|
|
16
|
+
We acknowledge reports within three working days and tell you what we intend
|
|
17
|
+
to do. Fixes ship on the current alpha line; there are no backports before
|
|
18
|
+
1.0.0.
|
|
19
|
+
|
|
20
|
+
## Scope
|
|
21
|
+
|
|
22
|
+
This package validates declarations. It performs no network calls, reads no
|
|
23
|
+
credentials, and executes nothing an adapter author does not import
|
|
24
|
+
themselves. Reports about the runtime that executes adapters belong to the
|
|
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/TRADEMARKS.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Trademarks
|
|
2
|
+
|
|
3
|
+
"Hyperscale" and "ADL" are trademarks of Hyperscale LLC.
|
|
4
|
+
|
|
5
|
+
The AGPL covers the code in this repository and nothing else. It grants no
|
|
6
|
+
right to use the Hyperscale name, the Hyperscale logo, or any other Hyperscale
|
|
7
|
+
mark, and it never mentions them: a copyright license says nothing about
|
|
8
|
+
trademarks either way.
|
|
9
|
+
|
|
10
|
+
What that means in practice:
|
|
11
|
+
|
|
12
|
+
- **Yes**, you may say your adapter is written in ADL, or that it passes
|
|
13
|
+
Hyperscale conformance. Accurate, factual references to the project are fine.
|
|
14
|
+
- **No**, you may not name your package, product, service, or organization in a
|
|
15
|
+
way that suggests Hyperscale LLC published it or endorses it, and you may not
|
|
16
|
+
use the marks in a logo, domain, or app icon of your own.
|
|
17
|
+
|
|
18
|
+
## Claiming compatibility
|
|
19
|
+
|
|
20
|
+
An independent implementation of ADL or of its conformance
|
|
21
|
+
runner may say it "passes the Hyperscale ADL conformance suite version X"
|
|
22
|
+
only while it passes the published cases for that version, unmodified.
|
|
23
|
+
[`conformance/cases.json`](conformance/cases.json) is the whole test: no
|
|
24
|
+
skipped case, no edited expectation, no local fork of the fixtures.
|
|
25
|
+
|
|
26
|
+
That claim is a statement about your implementation, so keep the marks out of
|
|
27
|
+
its name and off its logo, and do not present it as endorsement or
|
|
28
|
+
certification by Hyperscale LLC. We certify nothing; the suite does.
|
|
29
|
+
|
|
30
|
+
Forks stay welcome. Rename the package and drop the marks.
|