@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.
@@ -0,0 +1,219 @@
1
+ import { statementAvailabilities, type ChargePosting, type ChargeVatMode, type FinancialAddressMechanism, type FinancialAddressPricing, type FinancialAddressQuota, type FxRateReadBack, type LimitAccessMode, type LimitDimension, type PartnerBankDedupeKey, type PartnerBankLifecycleState, type PartnerBankSigning, type PartnerBankStatementFormat, type PartnerBankWireCodec, type ProviderAuthEnvelope, type ProviderEgressMode, type ProviderNotificationMechanism, type ProviderOperationDirection, type ProviderResourceBinding, type ProviderResponseEnvelope, type ProviderTimestampField, type RailSubstitution, type StatementAvailability, type StatementDebitReference, type StatusEnquiryKey, type ValueDateOffset } from "./vocabulary.js";
2
+ export { certifyPartnerBankAdapter, partnerBankConformanceCodes, partnerBankConformanceFindings, type PartnerBankConformanceCode, type PartnerBankConformanceFinding, } from "./conformance.js";
3
+ export { statementAvailabilities };
4
+ export type { ProviderEgressMode, ProviderOperationDirection, ProviderResourceBinding, ProviderResponseEnvelope, };
5
+ export interface ProviderAdapterVocabulary {
6
+ readonly capability: string;
7
+ readonly domain: string;
8
+ readonly meter: string;
9
+ readonly obligation: string;
10
+ readonly operation: string;
11
+ readonly resource: string;
12
+ readonly webhookOperation: string;
13
+ readonly webhookResource: string;
14
+ readonly webhookResourceId: string;
15
+ }
16
+ export interface ProviderAdapter<Vocabulary extends ProviderAdapterVocabulary = ProviderAdapterVocabulary> {
17
+ readonly bindings: Partial<Record<Vocabulary["resource"], ProviderResourceBinding>>;
18
+ readonly capability: Vocabulary["capability"];
19
+ readonly config: ProviderConfig;
20
+ readonly domain?: Vocabulary["domain"];
21
+ readonly egress: ProviderEgressMode;
22
+ readonly operationMap: Partial<Record<Vocabulary["operation"], ProviderOperationBinding<Vocabulary>>>;
23
+ readonly profile?: PartnerBankAdapterProfile;
24
+ readonly provider: string;
25
+ readonly webhookMap: Readonly<Record<string, ProviderWebhookTransitionPlan<Vocabulary>>>;
26
+ }
27
+ export interface ProviderOperationBinding<Vocabulary extends ProviderAdapterVocabulary = ProviderAdapterVocabulary> {
28
+ /**
29
+ * Authoritative read-after-write status enquiry for a command whose response
30
+ * may have been lost. Presence is an explicit provider-readiness commitment;
31
+ * runtimes must never infer enquiry support from the command URL.
32
+ */
33
+ readonly statusEnquiry?: {
34
+ readonly keys: StatusEnquiryKey;
35
+ readonly pathTemplate: string;
36
+ };
37
+ /**
38
+ * How THIS operation's response carries its outcome. Per operation, never
39
+ * per provider and never inherited from another provider's class: one real
40
+ * provider answers two ways, wrapping six of seven endpoints in
41
+ * `{status, message, data}` while the seventh returns a bare object. Absent
42
+ * means the class is not established yet -- an unclassified operation, not
43
+ * a silent `http_200_body_status`.
44
+ */
45
+ readonly envelope?: ProviderResponseEnvelope;
46
+ readonly operation: Vocabulary["operation"];
47
+ readonly direction: ProviderOperationDirection;
48
+ readonly meter?: Vocabulary["meter"];
49
+ readonly obligationKind: Vocabulary["obligation"];
50
+ readonly resourceIdPath: string;
51
+ readonly resourceKind: Vocabulary["resource"];
52
+ }
53
+ export interface ProviderWebhookTransitionPlan<Vocabulary extends ProviderAdapterVocabulary = ProviderAdapterVocabulary> {
54
+ readonly eventKind: string;
55
+ readonly operationName: Vocabulary["webhookOperation"];
56
+ readonly optionalPayloadFields: readonly string[];
57
+ readonly requiredFieldGroups: readonly (readonly string[])[];
58
+ readonly requiredPayloadFields: readonly string[];
59
+ readonly resourceIdField: Vocabulary["webhookResourceId"];
60
+ readonly resourceKind: Vocabulary["webhookResource"];
61
+ readonly timestampField: ProviderTimestampField;
62
+ }
63
+ export type ProviderCredentialReference = {
64
+ readonly name: string;
65
+ readonly source: "environment";
66
+ } | {
67
+ readonly account: string;
68
+ readonly service: string;
69
+ readonly source: "keychain";
70
+ };
71
+ export interface ProviderConfig {
72
+ readonly baseUrl?: string;
73
+ readonly credentialRef?: ProviderCredentialReference;
74
+ }
75
+ /**
76
+ * The fetch window facts for one declared statement format. The paging fields
77
+ * are required for an end-of-day format (`availability: "T-1"` pages over
78
+ * history) and absent for an intraday one; conformance enforces that split.
79
+ */
80
+ export interface PartnerBankStatementWindow {
81
+ readonly availability: StatementAvailability;
82
+ readonly lookbackDays?: number;
83
+ readonly statementDaysPerRequest?: number;
84
+ }
85
+ export interface PartnerBankAdapterProfile {
86
+ readonly auth: {
87
+ readonly envelope: ProviderAuthEnvelope;
88
+ readonly signing: PartnerBankSigning;
89
+ };
90
+ /**
91
+ * How the bank bills its own charges. `posting` says when the charge lands
92
+ * (debited separately after the payment, or netted out of the instructed
93
+ * amount); `vat` says whether the tax arrives as its own ledger line or
94
+ * folded into the charge. Absent when a bank's charge behavior is not
95
+ * established -- an unmodeled dimension, not a claim of post-hoc billing.
96
+ */
97
+ readonly charges?: {
98
+ /**
99
+ * The text this bank prints on its own charge lines, as prefixes: the
100
+ * trailing part names the charged thing. Recognizing a charge is Executor
101
+ * knowledge, so it is declared per bank and never inferred downstream, and
102
+ * a bank whose charge wording is not established leaves this absent rather
103
+ * than borrowing another bank's words.
104
+ */
105
+ readonly narratives?: {
106
+ readonly charge: readonly string[];
107
+ readonly vat: readonly string[];
108
+ };
109
+ readonly posting: ChargePosting;
110
+ readonly vat: ChargeVatMode;
111
+ };
112
+ readonly executedReadBack: {
113
+ readonly fxRate: FxRateReadBack;
114
+ readonly railSubstitution: RailSubstitution;
115
+ };
116
+ readonly idempotencySpine: {
117
+ readonly dedupeKeys: readonly PartnerBankDedupeKey[];
118
+ readonly endToEndId: {
119
+ readonly maxLength: number;
120
+ };
121
+ readonly instructionId: {
122
+ readonly maxLength: number;
123
+ };
124
+ readonly paymentReference: {
125
+ readonly maxLength: number;
126
+ };
127
+ };
128
+ readonly kind: "partner_bank";
129
+ readonly lifecycleVocabulary: Readonly<Record<string, PartnerBankLifecycleState>>;
130
+ readonly limitFacts: {
131
+ readonly access: LimitAccessMode;
132
+ readonly dimensions: readonly LimitDimension[];
133
+ };
134
+ readonly notificationMechanisms: readonly ProviderNotificationMechanism[];
135
+ /**
136
+ * Which reference on a statement debit line names the instruction behind it.
137
+ * A statement entry carries two: the bank's own entry reference and the
138
+ * client reference the instruction was sent with. Banks disagree about which
139
+ * one comes back on the statement, and picking the wrong one makes every
140
+ * payout the platform instructed look like an unexplained debit. Absent when
141
+ * a bank's statement reference identity is not established.
142
+ */
143
+ readonly statementDebitReference?: StatementDebitReference;
144
+ readonly statementFormats: readonly PartnerBankStatementFormat[];
145
+ readonly financialAddressProvisioning: {
146
+ readonly mechanism: FinancialAddressMechanism;
147
+ readonly pricing: FinancialAddressPricing;
148
+ readonly quota: FinancialAddressQuota;
149
+ };
150
+ readonly windows: {
151
+ readonly paymentCutoff: {
152
+ readonly afterCutoffValueDate: ValueDateOffset;
153
+ readonly beforeCutoffValueDate: ValueDateOffset;
154
+ /** Bank-local wall-clock time, HH:MM. */
155
+ readonly time: string;
156
+ /** The IANA time zone the cutoff time is read in (e.g. Europe/Dublin). */
157
+ readonly timeZone: string;
158
+ };
159
+ /** One window per declared statement format, keyed by that format. */
160
+ readonly statements: Partial<Readonly<Record<PartnerBankStatementFormat, PartnerBankStatementWindow>>>;
161
+ readonly valueDateMaxDaysAhead: number;
162
+ };
163
+ readonly wireCodec: PartnerBankWireCodec;
164
+ }
165
+ /**
166
+ * The insurance-distribution marketplace class, the partner bank's opposite
167
+ * number: an aggregator API whose whole truth arrives in the command
168
+ * response. Every field below is a recorded observation of one such surface,
169
+ * not a reading of a standard.
170
+ *
171
+ * What makes the class distinct from `partner_bank`, and why each field exists:
172
+ *
173
+ * - **Nothing to poll.** No status enquiry, no list, no read-back, no
174
+ * webhook, on any line. `notificationMechanisms` is empty by evidence, and
175
+ * the issuance response is the ONLY carrier of the policy identity -- so
176
+ * the transport must capture it durably BEFORE acknowledging the caller.
177
+ * - **No idempotency header exists anywhere in the corpus.** Dedupe runs on
178
+ * caller-minted business reference numbers replayed verbatim at each step,
179
+ * which is why the spine is a reference chain rather than a key.
180
+ * - **Auth is a bespoke credential exchange**, not OAuth2 client
181
+ * credentials: username/password against the provider's own login route
182
+ * yields a bearer with no documented lifetime, refresh, or scope.
183
+ * - **Errors are prose.** No machine error code appears anywhere, so an
184
+ * adapter cannot build a decline taxonomy from the docs alone.
185
+ */
186
+ export interface InsuranceDistributorAdapterProfile {
187
+ readonly kind: "insurance_distributor";
188
+ readonly wireCodec: "rest_json";
189
+ readonly auth: {
190
+ readonly envelope: ProviderAuthEnvelope;
191
+ /** How the bearer is obtained, when the provider documents it at all. */
192
+ readonly acquisition: "password_login" | "out_of_band";
193
+ readonly signing: "none";
194
+ };
195
+ /**
196
+ * Envelope class per DOCUMENTED operation name, because one provider answers
197
+ * in more than one shape. Keys are the provider's own operation names, not
198
+ * platform operations -- this profile describes a surface no adapter has
199
+ * integrated yet.
200
+ */
201
+ readonly envelopes: Readonly<Record<string, ProviderResponseEnvelope>>;
202
+ /**
203
+ * The correlation chain that stands in for an idempotency key: which
204
+ * references the CALLER mints and which the provider mints, in the order the
205
+ * exchange replays them.
206
+ */
207
+ readonly referenceChain: {
208
+ readonly clientMinted: readonly string[];
209
+ readonly providerMinted: readonly string[];
210
+ };
211
+ readonly notificationMechanisms: readonly ProviderNotificationMechanism[];
212
+ /** Whether the provider publishes machine-readable failure codes. */
213
+ readonly errorModel: "prose_only" | "coded";
214
+ /** True when the command response is the only carrier of the created fact. */
215
+ readonly captureBeforeAcknowledge: boolean;
216
+ }
217
+ /** Bind a product vocabulary once, then retain literal adapter registry types. */
218
+ export declare function createProviderAdapterRegistry<Vocabulary extends ProviderAdapterVocabulary>(): <const Adapters extends readonly ProviderAdapter<Vocabulary>[]>(adapters: Adapters) => Adapters;
219
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EACl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,EAAE,gBAAgB,GAAG,aAAa,CAAC;QACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC;IACvE;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE;QACvB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;QACzC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;KAC5C,CAAC;IACF,QAAQ,CAAC,sBAAsB,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAC1E,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;CAC5C;AA2BD,kFAAkF;AAClF,wBAAgB,6BAA6B,CAC3C,UAAU,SAAS,yBAAyB,KACzC,CAAC,KAAK,CAAC,QAAQ,SAAS,SAAS,eAAe,CAAC,UAAU,CAAC,EAAE,EACjE,QAAQ,EAAE,QAAQ,KACf,QAAQ,CAGZ"}
package/dist/index.js ADDED
@@ -0,0 +1,144 @@
1
+ import { providerKeyPattern, statementAvailabilities, } from "./vocabulary.js";
2
+ export { certifyPartnerBankAdapter, partnerBankConformanceCodes, partnerBankConformanceFindings, } from "./conformance.js";
3
+ export { statementAvailabilities };
4
+ /** Validate an adapter registry once at load, then preserve its exact type. */
5
+ function defineProviderAdapters(adapters) {
6
+ const identities = new Set();
7
+ for (const adapter of adapters) {
8
+ if (!providerKeyPattern.test(adapter.provider)) {
9
+ throw new Error(`invalid provider key ${adapter.provider}`);
10
+ }
11
+ const identity = `${adapter.provider}:${adapter.capability}`;
12
+ if (identities.has(identity)) {
13
+ throw new Error(`duplicate provider adapter ${identity}`);
14
+ }
15
+ identities.add(identity);
16
+ validateConfig(adapter.provider, adapter.config);
17
+ validateOperations(adapter);
18
+ validateWebhooks(adapter);
19
+ if (adapter.profile) {
20
+ validatePartnerBankProfile(adapter.provider, adapter.profile);
21
+ }
22
+ }
23
+ return adapters;
24
+ }
25
+ /** Bind a product vocabulary once, then retain literal adapter registry types. */
26
+ export function createProviderAdapterRegistry() {
27
+ return (adapters) => defineProviderAdapters(adapters);
28
+ }
29
+ function validateConfig(provider, config) {
30
+ if (config.baseUrl) {
31
+ try {
32
+ new URL(config.baseUrl);
33
+ }
34
+ catch {
35
+ throw new Error(`${provider} config.baseUrl must be an absolute URL`);
36
+ }
37
+ }
38
+ const credential = config.credentialRef;
39
+ if (!credential)
40
+ return;
41
+ if (credential.source === "environment") {
42
+ assertNonblank(provider, "config.credentialRef.name", credential.name);
43
+ return;
44
+ }
45
+ assertNonblank(provider, "config.credentialRef.account", credential.account);
46
+ assertNonblank(provider, "config.credentialRef.service", credential.service);
47
+ }
48
+ function validateOperations(adapter) {
49
+ for (const [operation, binding] of Object.entries(adapter.operationMap)) {
50
+ if (operation !== binding.operation) {
51
+ throw new Error(`${adapter.provider} operationMap key ${operation} must match operation ${binding.operation}`);
52
+ }
53
+ assertNonblank(adapter.provider, `${operation}.resourceIdPath`, binding.resourceIdPath);
54
+ if (binding.statusEnquiry) {
55
+ assertNonblank(adapter.provider, `${operation}.statusEnquiry.pathTemplate`, binding.statusEnquiry.pathTemplate);
56
+ const placeholder = binding.statusEnquiry.keys === "instruction_id"
57
+ ? "{instructionId}"
58
+ : "{providerReference}";
59
+ if (!binding.statusEnquiry.pathTemplate.includes(placeholder)) {
60
+ throw new Error(`${adapter.provider} ${operation}.statusEnquiry.pathTemplate must include ${placeholder}`);
61
+ }
62
+ }
63
+ }
64
+ }
65
+ function validateWebhooks(adapter) {
66
+ for (const [event, plan] of Object.entries(adapter.webhookMap)) {
67
+ if (event !== plan.eventKind) {
68
+ throw new Error(`${adapter.provider} webhookMap key ${event} must match eventKind ${plan.eventKind}`);
69
+ }
70
+ }
71
+ }
72
+ function validatePartnerBankProfile(provider, profile) {
73
+ if (!profile.notificationMechanisms.includes("poll")) {
74
+ throw new Error(`${provider} partner-bank profile must support polling`);
75
+ }
76
+ if (Object.keys(profile.lifecycleVocabulary).length === 0) {
77
+ throw new Error(`${provider} partner-bank profile has no lifecycle vocabulary`);
78
+ }
79
+ assertUnique(provider, "statementFormats", profile.statementFormats);
80
+ assertUnique(provider, "notificationMechanisms", profile.notificationMechanisms);
81
+ assertUnique(provider, "limitFacts.dimensions", profile.limitFacts.dimensions);
82
+ const spine = profile.idempotencySpine;
83
+ // The dedupe keys widened from a fixed triple to a list, so the list now
84
+ // carries the guarantees the tuple used to give for free.
85
+ if (spine.dedupeKeys.length === 0) {
86
+ throw new Error(`${provider} idempotencySpine.dedupeKeys is empty`);
87
+ }
88
+ assertUnique(provider, "idempotencySpine.dedupeKeys", spine.dedupeKeys);
89
+ const spineLimits = {
90
+ endToEndId: spine.endToEndId,
91
+ instructionId: spine.instructionId,
92
+ paymentReference: spine.paymentReference,
93
+ };
94
+ for (const [field, limit] of Object.entries(spineLimits)) {
95
+ assertPositiveInteger(provider, `idempotencySpine.${field}.maxLength`, limit.maxLength);
96
+ }
97
+ const windows = profile.windows;
98
+ if (!/^\d{2}:\d{2}$/.test(windows.paymentCutoff.time)) {
99
+ throw new Error(`${provider} windows.paymentCutoff.time must be HH:MM`);
100
+ }
101
+ // Intl.DateTimeFormat treats an undefined timeZone as the runtime default,
102
+ // so presence must be checked before validity.
103
+ const timeZone = windows.paymentCutoff.timeZone;
104
+ if (typeof timeZone !== "string") {
105
+ throw new Error(`${provider} windows.paymentCutoff.timeZone must be a valid IANA time zone`);
106
+ }
107
+ try {
108
+ new Intl.DateTimeFormat("en", { timeZone });
109
+ }
110
+ catch {
111
+ throw new Error(`${provider} windows.paymentCutoff.timeZone must be a valid IANA time zone`);
112
+ }
113
+ assertPositiveInteger(provider, "windows.valueDateMaxDaysAhead", windows.valueDateMaxDaysAhead);
114
+ for (const [format, window] of Object.entries(windows.statements)) {
115
+ // TS requires availability, but a plain-JS consumer can send a window
116
+ // without one, and an availability-less window is unschedulable.
117
+ if (!statementAvailabilities.includes(window.availability)) {
118
+ throw new Error(`${provider} windows.statements.${format}.availability must be one ` +
119
+ `of ${statementAvailabilities.join(", ")}`);
120
+ }
121
+ if (window.lookbackDays !== undefined) {
122
+ assertPositiveInteger(provider, `windows.statements.${format}.lookbackDays`, window.lookbackDays);
123
+ }
124
+ if (window.statementDaysPerRequest !== undefined) {
125
+ assertPositiveInteger(provider, `windows.statements.${format}.statementDaysPerRequest`, window.statementDaysPerRequest);
126
+ }
127
+ }
128
+ }
129
+ function assertPositiveInteger(provider, field, value) {
130
+ if (!Number.isInteger(value) || value <= 0) {
131
+ throw new Error(`${provider} ${field} must be a positive integer`);
132
+ }
133
+ }
134
+ function assertUnique(provider, field, values) {
135
+ if (new Set(values).size !== values.length) {
136
+ throw new Error(`${provider} ${field} contains duplicates`);
137
+ }
138
+ }
139
+ function assertNonblank(provider, field, value) {
140
+ if (value.trim().length === 0) {
141
+ throw new Error(`${provider} ${field} must not be blank`);
142
+ }
143
+ }
144
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GA0BxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,GAG/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAiPnC,+EAA+E;AAC/E,SAAS,sBAAsB,CAG7B,QAAkB;IAClB,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/C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K,oBAAoB,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -0,0 +1,94 @@
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
+ */
13
+ export declare const providerKeyPattern: RegExp;
14
+ export declare const providerOperationDirections: readonly ["tenant_initiated", "system_settlement"];
15
+ export declare const providerResourceBindings: readonly ["strict", "claim", "confirmation_only", "evidence_only"];
16
+ export declare const providerEgressModes: readonly ["none", "rest", "batch_reconcile", "sync_clearance"];
17
+ export declare const providerCredentialSources: readonly ["environment", "keychain"];
18
+ /** Which reference a read-after-write status enquiry is keyed by. */
19
+ export declare const statusEnquiryKeys: readonly ["instruction_id", "provider_reference"];
20
+ /**
21
+ * How one provider operation carries its outcome:
22
+ *
23
+ * - `http_200_body_status` -- every response is HTTP 200 and the outcome
24
+ * classifies on a body status field, so a rejection can arrive as a
25
+ * status token inside a 200;
26
+ * - `http_status_error_body` -- the outcome rides the HTTP status and a
27
+ * failure carries a thin prose body (`{status, message}`);
28
+ * - `unconfirmed_until_live` -- the provider publishes no error sample at
29
+ * all, so the class is honestly unknown until first live traffic. An
30
+ * adapter must never borrow another provider's class to fill this in.
31
+ */
32
+ export declare const providerResponseEnvelopes: readonly ["http_200_body_status", "http_status_error_body", "unconfirmed_until_live"];
33
+ /**
34
+ * How a provider expects to be authenticated. `oauth2_password` is the
35
+ * resource-owner password grant (username/password against the provider's own
36
+ * token service) and `bearer_out_of_band` is a static bearer whose issuance
37
+ * the provider does not document. Both are observed in the wild, neither is
38
+ * pretty.
39
+ */
40
+ export declare const providerAuthEnvelopes: readonly ["oauth2_client_credentials", "oauth2_password", "bearer_out_of_band", "mutual_tls", "signed_file"];
41
+ export declare const providerNotificationMechanisms: readonly ["poll", "webhook"];
42
+ export declare const providerTimestampFields: readonly ["activeAt", "completedAt", "failedAt", "returnedAt", "receivedAt", "clearedAt", "expiredAt", "voidedAt", "postedAt", "refundedAt"];
43
+ export declare const partnerBankWireCodecs: readonly ["rest_json", "iso20022_xml", "swift_mt"];
44
+ export declare const partnerBankSignings: readonly ["jws", "detached_signature", "signed_file"];
45
+ /** The canonical states a bank's own status spellings must map onto. */
46
+ export declare const partnerBankLifecycleStates: readonly ["received", "accepted", "processed", "failed", "returned", "duplicate_original_succeeded", "duplicate_original_rejected", "duplicate_suspected_rejected"];
47
+ export declare const partnerBankStatementFormats: readonly ["mt940", "mt942", "camt_052", "camt_053", "obie_json"];
48
+ /** Which reference the bank grades a duplicate instruction against. */
49
+ export declare const partnerBankDedupeKeys: readonly ["client", "instructionId", "endToEndId", "paymentReference"];
50
+ /** When a statement covering a period becomes fetchable. */
51
+ export declare const statementAvailabilities: readonly ["T-1", "today_only"];
52
+ /** Which reference on a statement debit line names the instruction behind it. */
53
+ export declare const statementDebitReferences: readonly ["bank_reference", "customer_reference"];
54
+ export declare const chargePostings: readonly ["post_hoc", "at_instruction"];
55
+ export declare const chargeVatModes: readonly ["separate_line", "included_in_charge"];
56
+ export declare const fxRateReadBacks: readonly ["final_status_only"];
57
+ /**
58
+ * Whether the executed read-back may name a different rail than the one
59
+ * instructed. `none` is a real inhabitant: a bank that never substitutes.
60
+ */
61
+ export declare const railSubstitutions: readonly ["ips_to_sarie", "none"];
62
+ export declare const limitAccessModes: readonly ["read_only"];
63
+ export declare const limitDimensions: readonly ["daily", "per_transaction", "foreign_exchange"];
64
+ export declare const financialAddressMechanisms: readonly ["api", "scheme_file"];
65
+ export declare const financialAddressPricing: readonly ["none", "per_address"];
66
+ export declare const financialAddressQuotas: readonly ["none", "provider_enforced"];
67
+ export type ProviderOperationDirection = (typeof providerOperationDirections)[number];
68
+ export type ProviderResourceBinding = (typeof providerResourceBindings)[number];
69
+ export type ProviderEgressMode = (typeof providerEgressModes)[number];
70
+ export type ProviderCredentialSource = (typeof providerCredentialSources)[number];
71
+ export type StatusEnquiryKey = (typeof statusEnquiryKeys)[number];
72
+ export type ProviderResponseEnvelope = (typeof providerResponseEnvelopes)[number];
73
+ export type ProviderAuthEnvelope = (typeof providerAuthEnvelopes)[number];
74
+ export type ProviderNotificationMechanism = (typeof providerNotificationMechanisms)[number];
75
+ export type ProviderTimestampField = (typeof providerTimestampFields)[number];
76
+ export type PartnerBankWireCodec = (typeof partnerBankWireCodecs)[number];
77
+ export type PartnerBankSigning = (typeof partnerBankSignings)[number];
78
+ export type PartnerBankLifecycleState = (typeof partnerBankLifecycleStates)[number];
79
+ export type PartnerBankStatementFormat = (typeof partnerBankStatementFormats)[number];
80
+ export type PartnerBankDedupeKey = (typeof partnerBankDedupeKeys)[number];
81
+ export type StatementAvailability = (typeof statementAvailabilities)[number];
82
+ export type StatementDebitReference = (typeof statementDebitReferences)[number];
83
+ export type ChargePosting = (typeof chargePostings)[number];
84
+ export type ChargeVatMode = (typeof chargeVatModes)[number];
85
+ export type FxRateReadBack = (typeof fxRateReadBacks)[number];
86
+ export type RailSubstitution = (typeof railSubstitutions)[number];
87
+ export type LimitAccessMode = (typeof limitAccessModes)[number];
88
+ export type LimitDimension = (typeof limitDimensions)[number];
89
+ export type FinancialAddressMechanism = (typeof financialAddressMechanisms)[number];
90
+ export type FinancialAddressPricing = (typeof financialAddressPricing)[number];
91
+ export type FinancialAddressQuota = (typeof financialAddressQuotas)[number];
92
+ /** A value date expressed as banking days after the instruction date. */
93
+ export type ValueDateOffset = `D+${number}`;
94
+ //# sourceMappingURL=vocabulary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,kBAAkB,QAA6B,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wB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9C,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG,KAAK,MAAM,EAAE,CAAC"}
@@ -0,0 +1,139 @@
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
+ */
13
+ 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 = [
25
+ "none",
26
+ "rest",
27
+ "batch_reconcile",
28
+ "sync_clearance",
29
+ ];
30
+ export const providerCredentialSources = ["environment", "keychain"];
31
+ /** Which reference a read-after-write status enquiry is keyed by. */
32
+ export const statusEnquiryKeys = [
33
+ "instruction_id",
34
+ "provider_reference",
35
+ ];
36
+ /**
37
+ * How one provider operation carries its outcome:
38
+ *
39
+ * - `http_200_body_status` -- every response is HTTP 200 and the outcome
40
+ * classifies on a body status field, so a rejection can arrive as a
41
+ * status token inside a 200;
42
+ * - `http_status_error_body` -- the outcome rides the HTTP status and a
43
+ * failure carries a thin prose body (`{status, message}`);
44
+ * - `unconfirmed_until_live` -- the provider publishes no error sample at
45
+ * all, so the class is honestly unknown until first live traffic. An
46
+ * adapter must never borrow another provider's class to fill this in.
47
+ */
48
+ export const providerResponseEnvelopes = [
49
+ "http_200_body_status",
50
+ "http_status_error_body",
51
+ "unconfirmed_until_live",
52
+ ];
53
+ /**
54
+ * How a provider expects to be authenticated. `oauth2_password` is the
55
+ * resource-owner password grant (username/password against the provider's own
56
+ * token service) and `bearer_out_of_band` is a static bearer whose issuance
57
+ * the provider does not document. Both are observed in the wild, neither is
58
+ * pretty.
59
+ */
60
+ export const providerAuthEnvelopes = [
61
+ "oauth2_client_credentials",
62
+ "oauth2_password",
63
+ "bearer_out_of_band",
64
+ "mutual_tls",
65
+ "signed_file",
66
+ ];
67
+ export const providerNotificationMechanisms = ["poll", "webhook"];
68
+ export const providerTimestampFields = [
69
+ "activeAt",
70
+ "completedAt",
71
+ "failedAt",
72
+ "returnedAt",
73
+ "receivedAt",
74
+ "clearedAt",
75
+ "expiredAt",
76
+ "voidedAt",
77
+ "postedAt",
78
+ "refundedAt",
79
+ ];
80
+ export const partnerBankWireCodecs = [
81
+ "rest_json",
82
+ "iso20022_xml",
83
+ "swift_mt",
84
+ ];
85
+ export const partnerBankSignings = [
86
+ "jws",
87
+ "detached_signature",
88
+ "signed_file",
89
+ ];
90
+ /** The canonical states a bank's own status spellings must map onto. */
91
+ export const partnerBankLifecycleStates = [
92
+ "received",
93
+ "accepted",
94
+ "processed",
95
+ "failed",
96
+ "returned",
97
+ "duplicate_original_succeeded",
98
+ "duplicate_original_rejected",
99
+ "duplicate_suspected_rejected",
100
+ ];
101
+ export const partnerBankStatementFormats = [
102
+ "mt940",
103
+ "mt942",
104
+ "camt_052",
105
+ "camt_053",
106
+ "obie_json",
107
+ ];
108
+ /** Which reference the bank grades a duplicate instruction against. */
109
+ export const partnerBankDedupeKeys = [
110
+ "client",
111
+ "instructionId",
112
+ "endToEndId",
113
+ "paymentReference",
114
+ ];
115
+ /** When a statement covering a period becomes fetchable. */
116
+ export const statementAvailabilities = ["T-1", "today_only"];
117
+ /** Which reference on a statement debit line names the instruction behind it. */
118
+ export const statementDebitReferences = [
119
+ "bank_reference",
120
+ "customer_reference",
121
+ ];
122
+ export const chargePostings = ["post_hoc", "at_instruction"];
123
+ export const chargeVatModes = ["separate_line", "included_in_charge"];
124
+ export const fxRateReadBacks = ["final_status_only"];
125
+ /**
126
+ * Whether the executed read-back may name a different rail than the one
127
+ * instructed. `none` is a real inhabitant: a bank that never substitutes.
128
+ */
129
+ export const railSubstitutions = ["ips_to_sarie", "none"];
130
+ export const limitAccessModes = ["read_only"];
131
+ export const limitDimensions = [
132
+ "daily",
133
+ "per_transaction",
134
+ "foreign_exchange",
135
+ ];
136
+ export const financialAddressMechanisms = ["api", "scheme_file"];
137
+ export const financialAddressPricing = ["none", "per_address"];
138
+ export const financialAddressQuotas = ["none", "provider_enforced"];
139
+ //# sourceMappingURL=vocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../src/vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM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