@splitin/verification-adapter-sdk 0.1.0-beta.0
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/LICENSE +21 -0
- package/NOTICE +32 -0
- package/README.md +15 -0
- package/dist/conformance.cjs +727 -0
- package/dist/conformance.cjs.map +1 -0
- package/dist/conformance.d.cts +20 -0
- package/dist/conformance.d.ts +20 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +720 -0
- package/dist/conformance.js.map +1 -0
- package/dist/contracts-5VqcOmjU.d.cts +388 -0
- package/dist/contracts-5VqcOmjU.d.ts +388 -0
- package/dist/contracts-5VqcOmjU.d.ts.map +1 -0
- package/dist/fakes.cjs +543 -0
- package/dist/fakes.cjs.map +1 -0
- package/dist/fakes.d.cts +37 -0
- package/dist/fakes.d.ts +37 -0
- package/dist/fakes.d.ts.map +1 -0
- package/dist/fakes.js +538 -0
- package/dist/fakes.js.map +1 -0
- package/dist/index.cjs +1187 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +302 -0
- package/dist/index.d.ts +302 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1124 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { P as ProviderConfigurationSchemaV1, J as JsonSchema2020, V as VerificationAdapterV1, a as ProviderManifestV1, b as ProviderRuntimeContext } from './contracts-5VqcOmjU.js';
|
|
2
|
+
export { A as ActorContext, C as CANONICAL_STATUSES, E as ENGINE_CONTRACT_VERSION, L as LAUNCH_PRESENTATIONS, N as NormalizedProviderEvent, c as NormalizedProviderSnapshot, O as OpenTelemetryHooks, d as PROVIDER_ENVIRONMENTS, e as PROVIDER_MANIFEST_SCHEMA_URN, f as PROVIDER_OPERATIONS, g as ProtectedActionDenial, h as ProviderAddressInput, i as ProviderAssociatedPersonInput, j as ProviderAttemptCommand, k as ProviderAttemptResult, l as ProviderCapabilities, m as ProviderError, n as ProviderErrorCode, o as ProviderErrorOptions, p as ProviderHealthObservation, q as ProviderHttpClient, r as ProviderLaunchEnvelope, s as ProviderOperation, t as ProviderOperationPendingError, u as ProviderOperationResult, v as ProviderOrganizationInput, w as ProviderRateBudget, x as ProviderRedactionCommand, y as ProviderRedactionResult, z as ProviderRelationshipInput, B as ProviderRequiredInformationError, D as ProviderResourceCommand, F as ProviderResourceType, G as ProviderResumeCommand, H as ProviderRetryCommand, I as ProviderSafeLogger, K as ProviderUnavailableError, S as STANDARD_PACKAGE_CODES, M as STANDARD_RELATIONSHIP_KINDS, Q as STANDARD_WEBHOOK_PROTOCOLS, R as SafeProviderFailure, T as SafeProviderFailureEnvelope, U as StandardPackageCode, W as StandardRelationshipKind, X as StandardWebhookProtocol, Y as TERMINAL_STATUSES, Z as TerminalVerificationStatus, _ as TraceSpan, $ as VERIFICATION_ADAPTER_CONTRACT_VERSION, a0 as VerificationAttemptLimitError, a1 as VerificationCanonicalStatus, a2 as VerificationLaunchPresentation, a3 as VerificationLauncherKey, a4 as VerificationPackageCode, a5 as VerificationProviderCode, a6 as VerificationProviderEnvironment, a7 as VerifiedWebhookEnvelope, a8 as WebhookProtocolId, a9 as assertPackageCode, aa as compareSemver, ab as isCanonicalStatus, ac as isCountryCode, ad as isCustomPackageCode, ae as isLauncherKey, af as isOpaqueSubjectReference, ag as isPackageCode, ah as isProviderCode, ai as isResourceType, aj as isSemver, ak as isStandardPackageCode, al as isTerminalStatus, am as isWebhookProtocol, an as majorsCompatible, ao as metadataContainsForbiddenIdentifier, ap as toSafeProviderFailure } from './contracts-5VqcOmjU.js';
|
|
3
|
+
export { AdapterConformanceOptions, AdapterConformanceScenarioFactory, ConformanceResult, ProviderConformanceScenario, assertProviderTypesDoNotEscape, canonicalStatusRank, providerConformanceScenarios, runAdapterConformance, runAdapterConformanceScenarios, validateManifestOnly } from './conformance.js';
|
|
4
|
+
export { FakeScenario, FakeVerificationAdapter, IncompleteVerificationAdapter, createFakeAdapterForScenario, fakeProviderManifest } from './fakes.js';
|
|
5
|
+
|
|
6
|
+
declare const providerManifestV1JsonSchema: {
|
|
7
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
8
|
+
readonly $id: "urn:splitin:verification:provider-manifest:v1";
|
|
9
|
+
readonly title: "Verification Provider Manifest V1";
|
|
10
|
+
readonly type: "object";
|
|
11
|
+
readonly additionalProperties: false;
|
|
12
|
+
readonly required: readonly ["contractVersion", "adapterVersion", "engineCompatibility", "provider", "displayName", "supportedPackages", "supportedCountries", "environments", "capabilities", "launcherKeys", "launchPresentations", "configurationSchemaVersion", "configurationSchema", "webhook", "dataPolicy", "retry", "cancellation", "redaction", "apiHosts", "testedApiVersions"];
|
|
13
|
+
readonly properties: {
|
|
14
|
+
readonly contractVersion: {
|
|
15
|
+
readonly const: "1.0.0";
|
|
16
|
+
};
|
|
17
|
+
readonly adapterVersion: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$";
|
|
20
|
+
};
|
|
21
|
+
readonly engineCompatibility: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$";
|
|
24
|
+
};
|
|
25
|
+
readonly provider: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly pattern: "^[a-z][a-z0-9_]{1,63}$";
|
|
28
|
+
};
|
|
29
|
+
readonly displayName: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly minLength: 1;
|
|
32
|
+
};
|
|
33
|
+
readonly description: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
};
|
|
36
|
+
readonly supportedPackages: {
|
|
37
|
+
readonly type: "array";
|
|
38
|
+
readonly minItems: 1;
|
|
39
|
+
readonly uniqueItems: true;
|
|
40
|
+
readonly items: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly anyOf: readonly [{
|
|
43
|
+
readonly enum: readonly ["human_idv", "business_kyb", "associated_person_idv", "ownership_review"];
|
|
44
|
+
}, {
|
|
45
|
+
readonly pattern: "^[a-z0-9][a-z0-9-]{0,32}(?:\\.[a-z0-9][a-z0-9_-]{0,63}){1,6}$";
|
|
46
|
+
}];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly supportedCountries: {
|
|
50
|
+
readonly type: "array";
|
|
51
|
+
readonly minItems: 1;
|
|
52
|
+
readonly uniqueItems: true;
|
|
53
|
+
readonly items: {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
readonly pattern: "^[A-Z]{2}$";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly environments: {
|
|
59
|
+
readonly type: "array";
|
|
60
|
+
readonly minItems: 1;
|
|
61
|
+
readonly uniqueItems: true;
|
|
62
|
+
readonly items: {
|
|
63
|
+
readonly enum: readonly ["sandbox", "production"];
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly capabilities: {
|
|
67
|
+
readonly type: "object";
|
|
68
|
+
readonly additionalProperties: false;
|
|
69
|
+
readonly required: readonly ["presentations", "canResume", "canRetry", "canCancel", "canRedact"];
|
|
70
|
+
readonly properties: {
|
|
71
|
+
readonly presentations: {
|
|
72
|
+
readonly type: "array";
|
|
73
|
+
readonly minItems: 1;
|
|
74
|
+
readonly uniqueItems: true;
|
|
75
|
+
readonly items: {
|
|
76
|
+
readonly enum: readonly ["embedded", "hosted", "qr", "none"];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
readonly canResume: {
|
|
80
|
+
readonly type: "boolean";
|
|
81
|
+
};
|
|
82
|
+
readonly canRetry: {
|
|
83
|
+
readonly type: "boolean";
|
|
84
|
+
};
|
|
85
|
+
readonly canCancel: {
|
|
86
|
+
readonly type: "boolean";
|
|
87
|
+
};
|
|
88
|
+
readonly canRedact: {
|
|
89
|
+
readonly type: "boolean";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
readonly launcherKeys: {
|
|
94
|
+
readonly type: "array";
|
|
95
|
+
readonly minItems: 1;
|
|
96
|
+
readonly uniqueItems: true;
|
|
97
|
+
readonly items: {
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly pattern: "^[a-z][a-z0-9_]{1,63}$";
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly launchPresentations: {
|
|
103
|
+
readonly type: "array";
|
|
104
|
+
readonly minItems: 1;
|
|
105
|
+
readonly uniqueItems: true;
|
|
106
|
+
readonly items: {
|
|
107
|
+
readonly enum: readonly ["embedded", "hosted", "qr", "none"];
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly configurationSchemaVersion: {
|
|
111
|
+
readonly type: "string";
|
|
112
|
+
readonly minLength: 1;
|
|
113
|
+
};
|
|
114
|
+
readonly configurationSchema: {
|
|
115
|
+
readonly $ref: "#/$defs/jsonSchema2020";
|
|
116
|
+
};
|
|
117
|
+
readonly webhook: {
|
|
118
|
+
readonly type: "object";
|
|
119
|
+
readonly additionalProperties: false;
|
|
120
|
+
readonly required: readonly ["protocol", "eventFamilies"];
|
|
121
|
+
readonly properties: {
|
|
122
|
+
readonly protocol: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly minLength: 1;
|
|
125
|
+
readonly maxLength: 128;
|
|
126
|
+
};
|
|
127
|
+
readonly eventFamilies: {
|
|
128
|
+
readonly type: "array";
|
|
129
|
+
readonly uniqueItems: true;
|
|
130
|
+
readonly items: {
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
readonly minLength: 1;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
readonly toleranceSeconds: {
|
|
136
|
+
readonly type: "integer";
|
|
137
|
+
readonly minimum: 1;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
readonly dataPolicy: {
|
|
142
|
+
readonly type: "object";
|
|
143
|
+
readonly additionalProperties: false;
|
|
144
|
+
readonly required: readonly ["classifications", "prohibitedPersistence", "rawPayloadPersistence", "browserSecretPersistence", "governmentIdentifierPersistence"];
|
|
145
|
+
readonly properties: {
|
|
146
|
+
readonly classifications: {
|
|
147
|
+
readonly type: "array";
|
|
148
|
+
readonly uniqueItems: true;
|
|
149
|
+
readonly items: {
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
readonly minLength: 1;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly prohibitedPersistence: {
|
|
155
|
+
readonly type: "array";
|
|
156
|
+
readonly uniqueItems: true;
|
|
157
|
+
readonly items: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
readonly minLength: 1;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly rawPayloadPersistence: {
|
|
163
|
+
readonly const: false;
|
|
164
|
+
};
|
|
165
|
+
readonly browserSecretPersistence: {
|
|
166
|
+
readonly const: false;
|
|
167
|
+
};
|
|
168
|
+
readonly governmentIdentifierPersistence: {
|
|
169
|
+
readonly const: false;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
readonly retry: {
|
|
174
|
+
readonly type: "object";
|
|
175
|
+
readonly additionalProperties: false;
|
|
176
|
+
readonly required: readonly ["sameResourceWhenResumable", "newAttemptAfterTerminal"];
|
|
177
|
+
readonly properties: {
|
|
178
|
+
readonly sameResourceWhenResumable: {
|
|
179
|
+
readonly type: "boolean";
|
|
180
|
+
};
|
|
181
|
+
readonly newAttemptAfterTerminal: {
|
|
182
|
+
readonly type: "boolean";
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
readonly cancellation: {
|
|
187
|
+
readonly type: "object";
|
|
188
|
+
readonly additionalProperties: false;
|
|
189
|
+
readonly required: readonly ["supported", "terminal"];
|
|
190
|
+
readonly properties: {
|
|
191
|
+
readonly supported: {
|
|
192
|
+
readonly type: "boolean";
|
|
193
|
+
};
|
|
194
|
+
readonly terminal: {
|
|
195
|
+
readonly type: "boolean";
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
readonly redaction: {
|
|
200
|
+
readonly type: "object";
|
|
201
|
+
readonly additionalProperties: false;
|
|
202
|
+
readonly required: readonly ["supported", "asynchronous"];
|
|
203
|
+
readonly properties: {
|
|
204
|
+
readonly supported: {
|
|
205
|
+
readonly type: "boolean";
|
|
206
|
+
};
|
|
207
|
+
readonly asynchronous: {
|
|
208
|
+
readonly type: "boolean";
|
|
209
|
+
};
|
|
210
|
+
readonly notApplicable: {
|
|
211
|
+
readonly type: "boolean";
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
readonly apiHosts: {
|
|
216
|
+
readonly type: "array";
|
|
217
|
+
readonly minItems: 1;
|
|
218
|
+
readonly uniqueItems: true;
|
|
219
|
+
readonly items: {
|
|
220
|
+
readonly type: "string";
|
|
221
|
+
readonly pattern: "^[a-z0-9.-]+$";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
readonly testedApiVersions: {
|
|
225
|
+
readonly type: "array";
|
|
226
|
+
readonly minItems: 1;
|
|
227
|
+
readonly uniqueItems: true;
|
|
228
|
+
readonly items: {
|
|
229
|
+
readonly type: "string";
|
|
230
|
+
readonly minLength: 1;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
readonly $defs: {
|
|
235
|
+
readonly jsonSchema2020: {
|
|
236
|
+
readonly type: "object";
|
|
237
|
+
readonly required: readonly ["$schema", "type", "additionalProperties", "required", "properties"];
|
|
238
|
+
readonly properties: {
|
|
239
|
+
readonly $schema: {
|
|
240
|
+
readonly const: "https://json-schema.org/draft/2020-12/schema";
|
|
241
|
+
};
|
|
242
|
+
readonly type: {
|
|
243
|
+
readonly const: "object";
|
|
244
|
+
};
|
|
245
|
+
readonly additionalProperties: {
|
|
246
|
+
readonly const: false;
|
|
247
|
+
};
|
|
248
|
+
readonly required: {
|
|
249
|
+
readonly type: "array";
|
|
250
|
+
readonly uniqueItems: true;
|
|
251
|
+
readonly items: {
|
|
252
|
+
readonly type: "string";
|
|
253
|
+
readonly minLength: 1;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
readonly properties: {
|
|
257
|
+
readonly type: "object";
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
declare const emptyConfigurationSchema: ProviderConfigurationSchemaV1;
|
|
264
|
+
declare function secretStringProperty(minLength?: number): JsonSchema2020;
|
|
265
|
+
declare function plainStringProperty(minLength?: number): JsonSchema2020;
|
|
266
|
+
|
|
267
|
+
declare const REQUIRED_ADAPTER_METHODS: readonly ["validateConfiguration", "createAttempt", "resumeAttempt", "retrieveAttempt", "retryAttempt", "cancelAttempt", "redactSubject", "verifyWebhook", "normalizeWebhook"];
|
|
268
|
+
declare function defineProviderManifest(input: ProviderManifestV1): Readonly<ProviderManifestV1>;
|
|
269
|
+
declare function assertProviderManifest(manifest: ProviderManifestV1): void;
|
|
270
|
+
declare function assertAdapterConformsToManifest(adapter: VerificationAdapterV1): void;
|
|
271
|
+
declare function createAllowlistedHttp(allowedHosts: readonly string[], fetchImpl: typeof fetch, timeoutMs?: number): {
|
|
272
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
273
|
+
};
|
|
274
|
+
declare function createDefaultRuntime<T extends object>(environment: ProviderRuntimeContext<T>['environment'], configuration: T, options?: Partial<ProviderRuntimeContext<T>> & {
|
|
275
|
+
allowedHosts?: string[];
|
|
276
|
+
}): ProviderRuntimeContext<T>;
|
|
277
|
+
declare const silentLogger: Readonly<{
|
|
278
|
+
info: () => undefined;
|
|
279
|
+
warn: () => undefined;
|
|
280
|
+
error: () => undefined;
|
|
281
|
+
}>;
|
|
282
|
+
|
|
283
|
+
declare class FakeClock {
|
|
284
|
+
private epochMs;
|
|
285
|
+
constructor(epochMs?: number);
|
|
286
|
+
now: () => Date;
|
|
287
|
+
advance(ms: number): void;
|
|
288
|
+
}
|
|
289
|
+
declare function deterministicId(prefix: string, seed: string): string;
|
|
290
|
+
declare function createControlledFetch(handler: (input: Request) => Promise<Response> | Response): typeof fetch;
|
|
291
|
+
declare function signHmacSha256Hex(secret: string, payload: Uint8Array): Promise<string>;
|
|
292
|
+
declare function sha256Hex(payload: Uint8Array): Promise<string>;
|
|
293
|
+
declare function bytesToHex(value: Uint8Array): string;
|
|
294
|
+
declare function createSignedWebhookFixture(input: {
|
|
295
|
+
protocol: 'stripe_v1_hmac' | 'persona_hmac_sha256' | 'none';
|
|
296
|
+
secret: string;
|
|
297
|
+
body: string;
|
|
298
|
+
now?: Date;
|
|
299
|
+
}): Promise<Request>;
|
|
300
|
+
declare function denySecretLogging(value: string): void;
|
|
301
|
+
|
|
302
|
+
export { FakeClock, JsonSchema2020, ProviderConfigurationSchemaV1, ProviderManifestV1, ProviderRuntimeContext, REQUIRED_ADAPTER_METHODS, VerificationAdapterV1, assertAdapterConformsToManifest, assertProviderManifest, bytesToHex, createAllowlistedHttp, createControlledFetch, createDefaultRuntime, createSignedWebhookFixture, defineProviderManifest, denySecretLogging, deterministicId, emptyConfigurationSchema, plainStringProperty, providerManifestV1JsonSchema, secretStringProperty, sha256Hex, signHmacSha256Hex, silentLogger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["index.d.ts"],"names":[],"mappings":"AAAA"}
|