@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/identifiers.ts","../src/schema.ts","../src/manifest.ts","../src/conformance.ts"],"names":[],"mappings":";;;AAoBO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM;AAAA,EAKvC,WAAA,CACW,IAAA,EACT,OAAA,EACA,OAAA,GAAgC,EAAC,EACjC;AACA,IAAA,KAAA,CAAM,OAAA,EAAS,QAAQ,KAAA,KAAU,MAAA,GAAY,SAAY,EAAE,KAAA,EAAO,OAAA,CAAQ,KAAA,EAAO,CAAA;AAJxE,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAKT,IAAA,IAAA,CAAK,IAAA,GAAO,eAAA;AACZ,IAAA,IAAA,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A;AACH;AAEA,SAAS,oBAAoB,KAAA,EAAwC;AACnE,EAAA,IAAI,KAAA,YAAiB,eAAe,OAAO,IAAA;AAC3C,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,UAAU,OAAO,KAAA;AAChD,EAAA,MAAM,SAAA,GAAY,KAAA;AAClB,EAAA,OAAO,SAAA,CAAU,IAAA,KAAS,eAAA,IACrB,OAAO,SAAA,CAAU,IAAA,KAAS,QAAA,IAC1B,OAAO,SAAA,CAAU,QAAA,KAAa,QAAA,IAC9B,OAAO,UAAU,SAAA,KAAc,SAAA;AACtC;AAEA,SAAS,cAAc,KAAA,EAAwB;AAC7C,EAAA,OAAO,KAAA,YAAiB,QAAQ,CAAA,EAAG,KAAA,CAAM,IAAI,CAAA,EAAA,EAAK,KAAA,CAAM,OAAO,CAAA,CAAA,GAAK,mBAAA;AACtE","file":"conformance.js","sourcesContent":["export type ProviderErrorCode =\n | 'INVALID_CONFIGURATION'\n | 'UNSUPPORTED_CAPABILITY'\n | 'AUTHENTICATION_FAILED'\n | 'SIGNATURE_INVALID'\n | 'RATE_LIMITED'\n | 'TIMEOUT'\n | 'RETRYABLE_PROVIDER_FAILURE'\n | 'TERMINAL_INPUT_FAILURE'\n | 'UNKNOWN_PROVIDER_STATE'\n | 'PROVIDER_UNAVAILABLE';\n\nexport interface ProviderErrorOptions {\n retryable?: boolean;\n safeCode?: string;\n retryAfterSeconds?: number;\n cause?: unknown;\n}\n\n/** Provider-safe error. Message and fields must never contain PII or secrets. */\nexport class ProviderError extends Error {\n readonly retryable: boolean;\n readonly safeCode: string;\n readonly retryAfterSeconds?: number;\n\n constructor(\n readonly code: ProviderErrorCode,\n message: string,\n options: ProviderErrorOptions = {},\n ) {\n super(message, options.cause === undefined ? undefined : { cause: options.cause });\n this.name = 'ProviderError';\n this.retryable = options.retryable ?? false;\n this.safeCode = options.safeCode ?? code.toLowerCase();\n this.retryAfterSeconds = options.retryAfterSeconds;\n }\n}\n\nexport class ProviderUnavailableError extends ProviderError {\n constructor(message = 'No eligible verification provider is available.', options: ProviderErrorOptions = {}) {\n super('PROVIDER_UNAVAILABLE', message, { retryable: true, ...options, safeCode: options.safeCode ?? 'provider_unavailable' });\n this.name = 'ProviderUnavailableError';\n }\n}\n\nexport class ProviderOperationPendingError extends ProviderError {\n constructor(message = 'The verification provider operation is already in progress.') {\n super('RETRYABLE_PROVIDER_FAILURE', message, { retryable: true, safeCode: 'operation_pending' });\n this.name = 'ProviderOperationPendingError';\n }\n}\n\nexport class VerificationAttemptLimitError extends ProviderError {\n constructor(retryAfterSeconds: number) {\n super('RATE_LIMITED', 'The verification session allowance has been reached.', {\n retryable: true,\n safeCode: 'attempt_limit',\n retryAfterSeconds,\n });\n this.name = 'VerificationAttemptLimitError';\n }\n}\n\nexport class ProviderRequiredInformationError extends ProviderError {\n constructor(message = 'Required verification information is missing.') {\n super('TERMINAL_INPUT_FAILURE', message, { retryable: false, safeCode: 'required_information_missing' });\n this.name = 'ProviderRequiredInformationError';\n }\n}\n\nexport interface SafeProviderFailure {\n code: ProviderErrorCode;\n safeCode: string;\n retryable: boolean;\n retryAfterSeconds?: number;\n}\n\nexport function toSafeProviderFailure(error: unknown): SafeProviderFailure {\n if (error instanceof ProviderError) {\n return {\n code: error.code,\n safeCode: error.safeCode,\n retryable: error.retryable,\n retryAfterSeconds: error.retryAfterSeconds,\n };\n }\n return {\n code: 'RETRYABLE_PROVIDER_FAILURE',\n safeCode: 'unexpected_provider_failure',\n retryable: true,\n };\n}\n","/** Public adapter contract version. Npm package versions remain 0.1.x-beta until sandbox certification. */\nexport const VERIFICATION_ADAPTER_CONTRACT_VERSION = '1.0.0' as const;\nexport const ENGINE_CONTRACT_VERSION = '1.0.0' as const;\nexport const PROVIDER_MANIFEST_SCHEMA_URN = 'urn:splitin:verification:provider-manifest:v1';\n\nexport const STANDARD_PACKAGE_CODES = [\n 'human_idv',\n 'business_kyb',\n 'associated_person_idv',\n 'ownership_review',\n] as const;\n\nexport type StandardPackageCode = (typeof STANDARD_PACKAGE_CODES)[number];\n\nexport const STANDARD_WEBHOOK_PROTOCOLS = [\n 'none',\n 'stripe_v1_hmac',\n 'persona_hmac_sha256',\n 'plaid_es256_jwk',\n] as const;\n\nexport type StandardWebhookProtocol = (typeof STANDARD_WEBHOOK_PROTOCOLS)[number];\n\nexport const CANONICAL_STATUSES = [\n 'created',\n 'pending_user_input',\n 'paused',\n 'processing',\n 'manual_review_required',\n 'verified',\n 'declined',\n 'failed',\n 'expired',\n 'canceled',\n 'provider_unavailable',\n 'redacted',\n] as const;\n\nexport type VerificationCanonicalStatus = (typeof CANONICAL_STATUSES)[number];\n\nexport const TERMINAL_STATUSES = [\n 'verified',\n 'declined',\n 'failed',\n 'expired',\n 'canceled',\n 'redacted',\n] as const;\n\nexport type TerminalVerificationStatus = (typeof TERMINAL_STATUSES)[number];\n\nexport const LAUNCH_PRESENTATIONS = ['embedded', 'hosted', 'qr', 'none'] as const;\nexport type VerificationLaunchPresentation = (typeof LAUNCH_PRESENTATIONS)[number];\n\nexport const PROVIDER_ENVIRONMENTS = ['sandbox', 'production'] as const;\nexport type VerificationProviderEnvironment = (typeof PROVIDER_ENVIRONMENTS)[number];\n\nexport const PROVIDER_OPERATIONS = [\n 'create',\n 'resume',\n 'retrieve',\n 'retry',\n 'cancel',\n 'redact',\n 'webhook_verify',\n 'webhook_normalize',\n 'health',\n] as const;\nexport type ProviderOperation = (typeof PROVIDER_OPERATIONS)[number];\n\nexport const STANDARD_RELATIONSHIP_KINDS = [\n 'ubo',\n 'director',\n 'officer',\n 'authorized_representative',\n 'associated_person',\n] as const;\nexport type StandardRelationshipKind = (typeof STANDARD_RELATIONSHIP_KINDS)[number];\n\n/** Standard codes or namespaced custom codes such as `com.example.employee_check`. */\nexport type VerificationPackageCode = StandardPackageCode | (string & {});\nexport type WebhookProtocolId = StandardWebhookProtocol | (string & {});\nexport type ProviderResourceType = string;\nexport type VerificationProviderCode = string;\nexport type VerificationLauncherKey = string;\n\nconst STANDARD_PACKAGE_SET = new Set<string>(STANDARD_PACKAGE_CODES);\nconst STANDARD_STATUS_SET = new Set<string>(CANONICAL_STATUSES);\nconst TERMINAL_STATUS_SET = new Set<string>(TERMINAL_STATUSES);\n\nconst PROVIDER_CODE = /^[a-z][a-z0-9_]{1,63}$/;\nconst LAUNCHER_KEY = /^[a-z][a-z0-9_]{1,63}$/;\nconst CUSTOM_PACKAGE = /^[a-z0-9][a-z0-9-]{0,32}(?:\\.[a-z0-9][a-z0-9_-]{0,63}){1,6}$/;\nconst WEBHOOK_PROTOCOL = /^(?:[a-z][a-z0-9_]{1,63}|[a-z0-9][a-z0-9-]{0,32}(?:\\.[a-z0-9][a-z0-9_-]{0,63}){1,6})$/;\nconst RESOURCE_TYPE = /^[a-z][a-z0-9_]{1,63}$/;\nconst COUNTRY = /^[A-Z]{2}$/;\nconst SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/;\nconst OPAQUE_SUBJECT = /^[A-Za-z0-9._:~-]{8,256}$/;\nconst GOVERNMENT_ID = /\\b(?:ssn|itin|nino|sin|aadhaar|passport|national[_-]?id|tax[_-]?id|ein|ssn_last4)\\b/i;\nconst SSN_LIKE = /\\b\\d{3}-\\d{2}-\\d{4}\\b/;\n\nexport function isProviderCode(value: string): boolean {\n return PROVIDER_CODE.test(value);\n}\n\nexport function isLauncherKey(value: string): boolean {\n return LAUNCHER_KEY.test(value);\n}\n\nexport function isStandardPackageCode(value: string): value is StandardPackageCode {\n return STANDARD_PACKAGE_SET.has(value);\n}\n\nexport function isCustomPackageCode(value: string): boolean {\n return CUSTOM_PACKAGE.test(value) && !STANDARD_PACKAGE_SET.has(value);\n}\n\nexport function isPackageCode(value: string): value is VerificationPackageCode {\n return isStandardPackageCode(value) || isCustomPackageCode(value);\n}\n\nexport function assertPackageCode(value: string): VerificationPackageCode {\n if (isStandardPackageCode(value) || isCustomPackageCode(value)) return value;\n throw new Error('Unsupported verification package identifier.');\n}\n\nexport function isWebhookProtocol(value: string): value is WebhookProtocolId {\n return WEBHOOK_PROTOCOL.test(value);\n}\n\nexport function isResourceType(value: string): value is ProviderResourceType {\n return RESOURCE_TYPE.test(value);\n}\n\nexport function isCountryCode(value: string): boolean {\n return COUNTRY.test(value);\n}\n\nexport function isSemver(value: string): boolean {\n return SEMVER.test(value);\n}\n\nexport function isCanonicalStatus(value: string): value is VerificationCanonicalStatus {\n return STANDARD_STATUS_SET.has(value);\n}\n\nexport function isTerminalStatus(value: string): value is TerminalVerificationStatus {\n return TERMINAL_STATUS_SET.has(value);\n}\n\nexport function isOpaqueSubjectReference(value: string): boolean {\n return OPAQUE_SUBJECT.test(value) && !GOVERNMENT_ID.test(value) && !SSN_LIKE.test(value);\n}\n\nexport function metadataContainsForbiddenIdentifier(value: unknown): boolean {\n if (value == null) return false;\n if (typeof value === 'string') return GOVERNMENT_ID.test(value);\n if (Array.isArray(value)) return value.some(metadataContainsForbiddenIdentifier);\n if (typeof value === 'object') {\n return Object.entries(value as Record<string, unknown>).some(([key, nested]) => (\n GOVERNMENT_ID.test(key) || metadataContainsForbiddenIdentifier(nested)\n ));\n }\n return false;\n}\n\nexport function compareSemver(left: string, right: string): number {\n const parse = (value: string) => value.split('-')[0]!.split('.').map((part) => Number.parseInt(part, 10));\n const a = parse(left);\n const b = parse(right);\n for (let index = 0; index < 3; index += 1) {\n const delta = (a[index] ?? 0) - (b[index] ?? 0);\n if (delta !== 0) return delta;\n }\n return 0;\n}\n\nexport function majorsCompatible(left: string, right: string): boolean {\n return left.split('.')[0] === right.split('.')[0];\n}\n","import type { ProviderConfigurationSchemaV1 } from './contracts.ts';\nimport { PROVIDER_MANIFEST_SCHEMA_URN } from './identifiers.ts';\n\nexport const providerManifestV1JsonSchema = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: PROVIDER_MANIFEST_SCHEMA_URN,\n title: 'Verification Provider Manifest V1',\n type: 'object',\n additionalProperties: false,\n required: [\n 'contractVersion', 'adapterVersion', 'engineCompatibility', 'provider', 'displayName',\n 'supportedPackages', 'supportedCountries', 'environments', 'capabilities', 'launcherKeys',\n 'launchPresentations', 'configurationSchemaVersion', 'configurationSchema', 'webhook',\n 'dataPolicy', 'retry', 'cancellation', 'redaction', 'apiHosts', 'testedApiVersions',\n ],\n properties: {\n contractVersion: { const: '1.0.0' },\n adapterVersion: { type: 'string', pattern: '^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?$' },\n engineCompatibility: { type: 'string', pattern: '^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?$' },\n provider: { type: 'string', pattern: '^[a-z][a-z0-9_]{1,63}$' },\n displayName: { type: 'string', minLength: 1 },\n description: { type: 'string' },\n supportedPackages: {\n type: 'array',\n minItems: 1,\n uniqueItems: true,\n items: {\n type: 'string',\n anyOf: [\n { enum: ['human_idv', 'business_kyb', 'associated_person_idv', 'ownership_review'] },\n { pattern: '^[a-z0-9][a-z0-9-]{0,32}(?:\\\\.[a-z0-9][a-z0-9_-]{0,63}){1,6}$' },\n ],\n },\n },\n supportedCountries: { type: 'array', minItems: 1, uniqueItems: true, items: { type: 'string', pattern: '^[A-Z]{2}$' } },\n environments: { type: 'array', minItems: 1, uniqueItems: true, items: { enum: ['sandbox', 'production'] } },\n capabilities: {\n type: 'object',\n additionalProperties: false,\n required: ['presentations', 'canResume', 'canRetry', 'canCancel', 'canRedact'],\n properties: {\n presentations: { type: 'array', minItems: 1, uniqueItems: true, items: { enum: ['embedded', 'hosted', 'qr', 'none'] } },\n canResume: { type: 'boolean' },\n canRetry: { type: 'boolean' },\n canCancel: { type: 'boolean' },\n canRedact: { type: 'boolean' },\n },\n },\n launcherKeys: { type: 'array', minItems: 1, uniqueItems: true, items: { type: 'string', pattern: '^[a-z][a-z0-9_]{1,63}$' } },\n launchPresentations: { type: 'array', minItems: 1, uniqueItems: true, items: { enum: ['embedded', 'hosted', 'qr', 'none'] } },\n configurationSchemaVersion: { type: 'string', minLength: 1 },\n configurationSchema: { $ref: '#/$defs/jsonSchema2020' },\n webhook: {\n type: 'object',\n additionalProperties: false,\n required: ['protocol', 'eventFamilies'],\n properties: {\n protocol: { type: 'string', minLength: 1, maxLength: 128 },\n eventFamilies: { type: 'array', uniqueItems: true, items: { type: 'string', minLength: 1 } },\n toleranceSeconds: { type: 'integer', minimum: 1 },\n },\n },\n dataPolicy: {\n type: 'object',\n additionalProperties: false,\n required: [\n 'classifications', 'prohibitedPersistence', 'rawPayloadPersistence',\n 'browserSecretPersistence', 'governmentIdentifierPersistence',\n ],\n properties: {\n classifications: { type: 'array', uniqueItems: true, items: { type: 'string', minLength: 1 } },\n prohibitedPersistence: { type: 'array', uniqueItems: true, items: { type: 'string', minLength: 1 } },\n rawPayloadPersistence: { const: false },\n browserSecretPersistence: { const: false },\n governmentIdentifierPersistence: { const: false },\n },\n },\n retry: {\n type: 'object',\n additionalProperties: false,\n required: ['sameResourceWhenResumable', 'newAttemptAfterTerminal'],\n properties: {\n sameResourceWhenResumable: { type: 'boolean' },\n newAttemptAfterTerminal: { type: 'boolean' },\n },\n },\n cancellation: {\n type: 'object',\n additionalProperties: false,\n required: ['supported', 'terminal'],\n properties: { supported: { type: 'boolean' }, terminal: { type: 'boolean' } },\n },\n redaction: {\n type: 'object',\n additionalProperties: false,\n required: ['supported', 'asynchronous'],\n properties: {\n supported: { type: 'boolean' },\n asynchronous: { type: 'boolean' },\n notApplicable: { type: 'boolean' },\n },\n },\n apiHosts: {\n type: 'array',\n minItems: 1,\n uniqueItems: true,\n items: { type: 'string', pattern: '^[a-z0-9.-]+$' },\n },\n testedApiVersions: { type: 'array', minItems: 1, uniqueItems: true, items: { type: 'string', minLength: 1 } },\n },\n $defs: {\n jsonSchema2020: {\n type: 'object',\n required: ['$schema', 'type', 'additionalProperties', 'required', 'properties'],\n properties: {\n $schema: { const: 'https://json-schema.org/draft/2020-12/schema' },\n type: { const: 'object' },\n additionalProperties: { const: false },\n required: { type: 'array', uniqueItems: true, items: { type: 'string', minLength: 1 } },\n properties: { type: 'object' },\n },\n },\n },\n} as const;\n\nexport const emptyConfigurationSchema: ProviderConfigurationSchemaV1 = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n type: 'object',\n additionalProperties: false,\n required: [],\n properties: {},\n};\n\nexport function secretStringProperty(minLength = 1): import('./contracts.ts').JsonSchema2020 {\n return { type: 'string', minLength, 'x-secret': true };\n}\n\nexport function plainStringProperty(minLength = 1): import('./contracts.ts').JsonSchema2020 {\n return { type: 'string', minLength, 'x-secret': false };\n}\n","import { Ajv2020 } from 'ajv/dist/2020.js';\n\nimport type {\n ProviderManifestV1,\n ProviderRuntimeContext,\n VerificationAdapterV1,\n} from './contracts.ts';\nimport { ProviderError } from './errors.ts';\nimport {\n ENGINE_CONTRACT_VERSION,\n VERIFICATION_ADAPTER_CONTRACT_VERSION,\n isCountryCode,\n isCustomPackageCode,\n isLauncherKey,\n isPackageCode,\n isProviderCode,\n isSemver,\n isStandardPackageCode,\n isWebhookProtocol,\n majorsCompatible,\n} from './identifiers.ts';\nimport { providerManifestV1JsonSchema } from './schema.ts';\n\nconst manifestValidator = new Ajv2020({ allErrors: true, strict: false }).compile(providerManifestV1JsonSchema);\n\nexport const REQUIRED_ADAPTER_METHODS = [\n 'validateConfiguration',\n 'createAttempt',\n 'resumeAttempt',\n 'retrieveAttempt',\n 'retryAttempt',\n 'cancelAttempt',\n 'redactSubject',\n 'verifyWebhook',\n 'normalizeWebhook',\n] as const;\n\nexport function defineProviderManifest(input: ProviderManifestV1): Readonly<ProviderManifestV1> {\n assertProviderManifest(input);\n return deepFreeze(JSON.parse(JSON.stringify(input)) as ProviderManifestV1);\n}\n\nexport function assertProviderManifest(manifest: ProviderManifestV1): void {\n if (!manifestValidator(manifest)) {\n const first = manifestValidator.errors?.[0];\n invalid(\n `json_schema_${toSafeCode(first?.keyword ?? 'invalid')}`,\n `The provider adapter manifest does not satisfy ProviderManifestV1 JSON Schema at ${first?.instancePath || '/'}.`,\n );\n }\n if (manifest.contractVersion !== VERIFICATION_ADAPTER_CONTRACT_VERSION) invalid('contract_version');\n if (!isProviderCode(manifest.provider)) invalid('provider_code');\n if (!manifest.displayName.trim() || !isSemver(manifest.adapterVersion) || !isSemver(manifest.engineCompatibility)) {\n invalid('identity');\n }\n if (!majorsCompatible(manifest.adapterVersion, VERIFICATION_ADAPTER_CONTRACT_VERSION)) {\n invalid('adapter_version_incompatible', 'Provider adapter major version must be compatible with contract V1.');\n }\n if (!majorsCompatible(manifest.engineCompatibility, ENGINE_CONTRACT_VERSION)) {\n invalid('engine_incompatible', 'Provider adapter is not compatible with this engine major version.');\n }\n if (!manifest.supportedPackages.length || manifest.supportedPackages.some((value) => !isPackageCode(value))) {\n invalid('supported_packages');\n }\n if (manifest.supportedPackages.some((value) => !isStandardPackageCode(value) && !isCustomPackageCode(value))) {\n invalid('supported_packages');\n }\n if (!manifest.supportedCountries.length || manifest.supportedCountries.some((value) => !isCountryCode(value))) {\n invalid('supported_countries');\n }\n if (!manifest.launcherKeys.length || manifest.launcherKeys.some((value) => !isLauncherKey(value))) {\n invalid('launcher_keys');\n }\n if (!isWebhookProtocol(manifest.webhook.protocol)) invalid('webhook_protocol');\n if (!manifest.apiHosts.length || manifest.apiHosts.some((host) => host.includes('/') || host.includes(':'))) {\n invalid('api_hosts', 'Provider API hosts must be code-owned hostnames, not URLs or caller-supplied origins.');\n }\n if (manifest.dataPolicy.rawPayloadPersistence !== false\n || manifest.dataPolicy.browserSecretPersistence !== false\n || manifest.dataPolicy.governmentIdentifierPersistence !== false) {\n invalid('data_policy');\n }\n if (manifest.capabilities.canCancel !== manifest.cancellation.supported) invalid('cancellation_capability');\n if (manifest.capabilities.canRedact !== manifest.redaction.supported) invalid('redaction_capability');\n assertConfigurationSecrets(manifest);\n}\n\nfunction assertConfigurationSecrets(manifest: ProviderManifestV1): void {\n const properties = manifest.configurationSchema.properties ?? {};\n for (const [name, schema] of Object.entries(properties)) {\n if (schema['x-secret'] === true && schema.type !== 'string') {\n invalid('secret_schema', `Configuration field \"${name}\" marked x-secret must be a string.`);\n }\n }\n}\n\nexport function assertAdapterConformsToManifest(adapter: VerificationAdapterV1): void {\n const candidate = adapter as unknown as Record<string, unknown>;\n const provider = typeof candidate.provider === 'string' && candidate.provider ? candidate.provider : 'unknown';\n for (const method of REQUIRED_ADAPTER_METHODS) {\n if (typeof candidate[method] !== 'function') {\n invalid(\n `missing_method_${toSafeCode(method)}`,\n `Provider adapter \"${provider}\" is missing required method \"${method}\".`,\n );\n }\n }\n if (!candidate.manifest || typeof candidate.manifest !== 'object') {\n invalid('missing_manifest', `Provider adapter \"${provider}\" is missing its manifest.`);\n }\n assertProviderManifest(adapter.manifest);\n if (adapter.contractVersion !== VERIFICATION_ADAPTER_CONTRACT_VERSION\n || adapter.provider !== adapter.manifest.provider\n || !adapter.manifest.environments.includes(adapter.environment)) {\n invalid('adapter_identity', `Provider adapter \"${provider}\" does not match its manifest identity or environment.`);\n }\n if (adapter.manifest.capabilities.canResume === false && typeof candidate.resumeAttempt !== 'function') {\n invalid('resume_capability');\n }\n adapter.validateConfiguration();\n}\n\nexport function createAllowlistedHttp(\n allowedHosts: readonly string[],\n fetchImpl: typeof fetch,\n timeoutMs = 10_000,\n): { fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> } {\n const hosts = new Set(allowedHosts.map((host) => host.toLowerCase()));\n return {\n async fetch(input, init) {\n const url = new URL(typeof input === 'string' || input instanceof URL ? String(input) : input.url);\n if (url.protocol !== 'https:' && url.hostname !== '127.0.0.1' && url.hostname !== 'localhost') {\n throw new ProviderError('INVALID_CONFIGURATION', 'Provider HTTP is limited to HTTPS or loopback.', {\n safeCode: 'http_origin_denied',\n });\n }\n if (!hosts.has(url.hostname.toLowerCase())) {\n throw new ProviderError('INVALID_CONFIGURATION', 'Provider HTTP origin is not allowlisted in the adapter manifest.', {\n safeCode: 'http_origin_denied',\n });\n }\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), timeoutMs);\n try {\n const parentSignal = init?.signal;\n if (parentSignal) {\n if (parentSignal.aborted) controller.abort();\n else parentSignal.addEventListener('abort', () => controller.abort(), { once: true });\n }\n return await fetchImpl(input, { ...init, signal: controller.signal });\n } catch (error) {\n if (controller.signal.aborted) {\n throw new ProviderError('TIMEOUT', 'The provider HTTP request timed out.', { retryable: true, safeCode: 'timeout' });\n }\n throw error;\n } finally {\n clearTimeout(timeout);\n }\n },\n };\n}\n\nexport function createDefaultRuntime<T extends object>(\n environment: ProviderRuntimeContext<T>['environment'],\n configuration: T,\n options: Partial<ProviderRuntimeContext<T>> & { allowedHosts?: string[] } = {},\n): ProviderRuntimeContext<T> {\n const fetchImpl = options.http?.fetch ?? fetch;\n return {\n environment,\n configuration: Object.freeze({ ...configuration }),\n http: options.http ?? createAllowlistedHttp(options.allowedHosts ?? ['127.0.0.1'], fetchImpl),\n now: options.now ?? (() => new Date()),\n crypto: options.crypto ?? globalThis.crypto,\n idempotency: options.idempotency ?? {\n keyFor: (operation, attemptId, suppliedKey) => suppliedKey ?? `${operation}:${attemptId}`,\n },\n logger: options.logger ?? silentLogger,\n telemetry: options.telemetry,\n recordHealth: options.recordHealth ?? (async () => undefined),\n rateBudget: options.rateBudget,\n };\n}\n\nexport const silentLogger = Object.freeze({\n info: () => undefined,\n warn: () => undefined,\n error: () => undefined,\n});\n\nfunction invalid(safeCode: string, message = 'The provider adapter manifest is invalid.'): never {\n throw new ProviderError('INVALID_CONFIGURATION', message, { safeCode });\n}\n\nfunction toSafeCode(value: string): string {\n return value.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (value && typeof value === 'object') {\n Object.freeze(value);\n for (const nested of Object.values(value as Record<string, unknown>)) deepFreeze(nested);\n }\n return value;\n}\n","import type {\n NormalizedProviderSnapshot,\n ProviderAttemptCommand,\n ProviderLaunchEnvelope,\n ProviderManifestV1,\n ProviderRedactionResult,\n VerificationAdapterV1,\n VerificationCanonicalStatus,\n} from './contracts.ts';\nimport { ProviderError } from './errors.ts';\nimport { isCanonicalStatus, isTerminalStatus, metadataContainsForbiddenIdentifier } from './identifiers.ts';\nimport { assertAdapterConformsToManifest, assertProviderManifest } from './manifest.ts';\n\nconst CANONICAL_STATUS_RANK: Record<VerificationCanonicalStatus, number> = {\n created: 10,\n pending_user_input: 20,\n paused: 20,\n provider_unavailable: 25,\n processing: 30,\n manual_review_required: 40,\n verified: 100,\n declined: 100,\n failed: 100,\n expired: 100,\n canceled: 100,\n redacted: 200,\n};\n\nexport function canonicalStatusRank(status: VerificationCanonicalStatus): number {\n return CANONICAL_STATUS_RANK[status];\n}\n\nexport interface ConformanceResult {\n name: string;\n passed: boolean;\n detail?: string;\n}\n\nexport const providerConformanceScenarios = Object.freeze([\n 'success',\n 'input_required',\n 'processing',\n 'verified',\n 'decline',\n 'failure',\n 'manual_review',\n 'timeout',\n 'rate_limit',\n 'malformed_response',\n 'unknown_state',\n 'cancellation',\n 'resume',\n 'asynchronous_redaction',\n 'retryable_provider_failure',\n] as const);\n\nexport type ProviderConformanceScenario = (typeof providerConformanceScenarios)[number];\n\nexport type AdapterConformanceScenarioFactory = (\n scenario: ProviderConformanceScenario,\n) => VerificationAdapterV1 | Promise<VerificationAdapterV1>;\n\nexport interface AdapterConformanceOptions {\n webhookRequest?: Request;\n}\n\nexport async function runAdapterConformance(\n adapter: VerificationAdapterV1,\n command: ProviderAttemptCommand,\n options: AdapterConformanceOptions = {},\n): Promise<ConformanceResult[]> {\n const results: ConformanceResult[] = [];\n const manifest = capture('manifest', () => assertAdapterConformsToManifest(adapter));\n results.push(manifest);\n if (!manifest.passed) return results;\n results.push(capture('package', () => {\n if (!adapter.manifest.supportedPackages.includes(command.packageCode)) {\n throw new Error('The fixture package is not declared by the adapter.');\n }\n if (metadataContainsForbiddenIdentifier(command.metadata) || !command.subjectReference) {\n throw new Error('Attempt command contains forbidden identifiers or a missing opaque subject.');\n }\n }));\n\n let created: Awaited<ReturnType<VerificationAdapterV1['createAttempt']>> | null = null;\n try {\n created = await adapter.createAttempt(command);\n assertAttemptResult(adapter, created);\n results.push({ name: 'create', passed: true });\n } catch (error) {\n results.push(failure('create', error));\n }\n\n if (created) {\n try {\n const duplicate = await adapter.createAttempt(command);\n if (duplicate.providerResourceId !== created.providerResourceId) {\n throw new Error('Duplicate create produced a second provider resource.');\n }\n results.push({ name: 'create_idempotency', passed: true });\n } catch (error) {\n results.push(failure('create_idempotency', error));\n }\n if (adapter.manifest.capabilities.canResume) {\n try {\n const resumed = await adapter.resumeAttempt(resourceCommand(command, created.providerResourceId));\n assertLaunchResult(adapter, resumed);\n results.push({ name: 'resume', passed: true });\n } catch (error) {\n results.push(failure('resume', error));\n }\n } else {\n results.push(skipped('resume', 'canResume'));\n }\n try {\n const snapshot = await adapter.retrieveAttempt(resourceCommand(command, created.providerResourceId));\n assertNormalizedSnapshot(snapshot);\n results.push({ name: 'retrieve', passed: true });\n try {\n if (isTerminalStatus(snapshot.canonicalStatus)) {\n const second = await adapter.retrieveAttempt(resourceCommand(command, created.providerResourceId));\n assertNormalizedSnapshot(second);\n const firstRank = canonicalStatusRank(snapshot.canonicalStatus);\n const secondRank = canonicalStatusRank(second.canonicalStatus);\n if (!isTerminalStatus(second.canonicalStatus) && secondRank < firstRank) {\n throw new Error('A terminal snapshot must not regress to a non-terminal status with lower rank.');\n }\n }\n results.push({ name: 'terminal_monotonicity', passed: true });\n } catch (error) {\n results.push(failure('terminal_monotonicity', error));\n }\n } catch (error) {\n results.push(failure('retrieve', error));\n }\n if (adapter.manifest.capabilities.canRetry) {\n try {\n const retried = await adapter.retryAttempt({ ...command, previousProviderResourceId: created.providerResourceId });\n assertAttemptResult(adapter, retried);\n results.push({ name: 'retry', passed: true });\n } catch (error) {\n results.push(failure('retry', error));\n }\n } else {\n results.push(skipped('retry', 'canRetry'));\n }\n if (adapter.manifest.capabilities.canCancel) {\n try {\n const canceled = await adapter.cancelAttempt(resourceCommand(command, created.providerResourceId));\n if (!canceled.accepted) throw new Error('Adapter did not acknowledge cancellation.');\n results.push({ name: 'cancel', passed: true });\n } catch (error) {\n results.push(failure('cancel', error));\n }\n } else {\n results.push(skipped('cancel', 'canCancel'));\n }\n if (adapter.manifest.capabilities.canRedact) {\n try {\n const redaction = await adapter.redactSubject(redactionCommand(command, created.providerResourceId));\n assertRedactionResult(redaction);\n results.push({ name: 'redact', passed: true });\n } catch (error) {\n results.push(failure('redact', error));\n }\n } else {\n results.push(skipped('redact', 'canRedact'));\n }\n }\n\n if (options.webhookRequest) {\n try {\n const verified = await adapter.verifyWebhook(options.webhookRequest);\n const normalized = await adapter.normalizeWebhook(verified);\n if (!verified.providerEventKey || !verified.receivedAt || !verified.bodySha256 || !(verified.opaquePayload instanceof Uint8Array)) {\n throw new Error('The verified webhook envelope is incomplete.');\n }\n if (!normalized.providerEventKey || !normalized.providerResourceId || !normalized.eventType\n || !normalized.providerEventType || !normalized.occurredAt) {\n throw new Error('The normalized webhook event is incomplete.');\n }\n if (normalized.canonicalStatus) assertCanonicalStatus(normalized.canonicalStatus);\n assertProviderTypesDoNotEscape(normalized);\n results.push({ name: 'webhook', passed: true });\n } catch (error) {\n results.push(failure('webhook', error));\n }\n }\n\n return results;\n}\n\nexport async function runAdapterConformanceScenarios(\n adapterForScenario: AdapterConformanceScenarioFactory,\n command: ProviderAttemptCommand,\n): Promise<ConformanceResult[]> {\n const results: ConformanceResult[] = [];\n for (const scenario of providerConformanceScenarios) {\n try {\n const adapter = await adapterForScenario(scenario);\n assertAdapterConformsToManifest(adapter);\n if (!adapter.manifest.supportedPackages.includes(command.packageCode)) {\n throw new Error(`Scenario \"${scenario}\" uses a package that the adapter does not declare.`);\n }\n await executeScenario(adapter, command, scenario);\n results.push({ name: scenario, passed: true });\n } catch (error) {\n results.push(failure(scenario, error));\n }\n }\n return results;\n}\n\nexport function validateManifestOnly(manifest: ProviderManifestV1): ConformanceResult {\n return capture('manifest', () => assertProviderManifest(manifest));\n}\n\nfunction capture(name: string, operation: () => void): ConformanceResult {\n try {\n operation();\n return { name, passed: true };\n } catch (error) {\n return failure(name, error);\n }\n}\n\nfunction failure(name: string, error: unknown): ConformanceResult {\n return { name, passed: false, detail: error instanceof Error ? error.message : 'Unknown conformance failure.' };\n}\n\nfunction skipped(name: string, capability: string): ConformanceResult {\n return { name, passed: true, detail: `Skipped because the manifest declares ${capability}=false.` };\n}\n\nasync function executeScenario(\n adapter: VerificationAdapterV1,\n command: ProviderAttemptCommand,\n scenario: ProviderConformanceScenario,\n): Promise<void> {\n const providerResourceId = `conformance_${command.attemptId.replace(/[^a-zA-Z0-9]/g, '')}`;\n const resource = resourceCommand(command, providerResourceId);\n switch (scenario) {\n case 'success':\n case 'verified': {\n const created = await adapter.createAttempt(command);\n assertAttemptResult(adapter, created);\n const snapshot = await adapter.retrieveAttempt(resourceCommand(command, created.providerResourceId));\n assertNormalizedSnapshot(snapshot);\n if (snapshot.canonicalStatus !== 'verified') {\n throw new Error('The success scenario must normalize to canonical status \"verified\".');\n }\n return;\n }\n case 'input_required':\n await expectCanonicalSnapshot(adapter, resource, 'pending_user_input');\n return;\n case 'processing':\n await expectCanonicalSnapshot(adapter, resource, 'processing');\n return;\n case 'decline':\n await expectCanonicalSnapshot(adapter, resource, 'declined');\n return;\n case 'failure':\n await expectCanonicalSnapshot(adapter, resource, 'failed');\n return;\n case 'manual_review':\n await expectCanonicalSnapshot(adapter, resource, 'manual_review_required');\n return;\n case 'timeout':\n await expectProviderError(() => adapter.retrieveAttempt(resource), 'TIMEOUT', { retryable: true });\n return;\n case 'rate_limit':\n await expectProviderError(() => adapter.retrieveAttempt(resource), 'RATE_LIMITED', { retryable: true, retryAfterRequired: true });\n return;\n case 'retryable_provider_failure':\n await expectProviderError(() => adapter.retrieveAttempt(resource), 'RETRYABLE_PROVIDER_FAILURE', { retryable: true });\n return;\n case 'malformed_response':\n await expectRejectedSnapshot(adapter, resource, 'malformed_provider_response');\n return;\n case 'unknown_state':\n await expectRejectedSnapshot(adapter, resource, 'unknown_provider_status');\n return;\n case 'cancellation': {\n const canceled = await adapter.cancelAttempt(resource);\n if (!canceled.accepted) throw new Error('Cancellation was not accepted.');\n return;\n }\n case 'resume': {\n const launched = await adapter.resumeAttempt(resource);\n assertLaunchResult(adapter, launched);\n return;\n }\n case 'asynchronous_redaction': {\n if (!adapter.manifest.capabilities.canRedact) {\n throw new Error('The redaction scenario requires manifest capability \"canRedact\".');\n }\n const redaction = await adapter.redactSubject(redactionCommand(command, providerResourceId));\n assertRedactionResult(redaction);\n if (adapter.manifest.redaction.asynchronous) {\n if (redaction.completed && redaction.disposition !== 'redacted') {\n throw new Error('Asynchronous redaction must not claim completion until the provider finishes.');\n }\n if (!['processing', 'scheduled', 'retryable'].includes(redaction.disposition ?? '')) {\n throw new Error('Asynchronous redaction must report processing, scheduled, or retryable.');\n }\n } else if (!redaction.completed || redaction.retryable) {\n throw new Error('Synchronous redaction must complete terminally without retry.');\n }\n }\n }\n}\n\nasync function expectCanonicalSnapshot(\n adapter: VerificationAdapterV1,\n command: ReturnType<typeof resourceCommand>,\n expected: VerificationCanonicalStatus,\n): Promise<void> {\n const snapshot = await adapter.retrieveAttempt(command);\n assertNormalizedSnapshot(snapshot);\n if (snapshot.canonicalStatus !== expected) {\n throw new Error(`The scenario must normalize to canonical status \"${expected}\".`);\n }\n}\n\nasync function expectRejectedSnapshot(\n adapter: VerificationAdapterV1,\n command: ReturnType<typeof resourceCommand>,\n expectedSafeCode: 'malformed_provider_response' | 'unknown_provider_status',\n): Promise<void> {\n try {\n const snapshot = await adapter.retrieveAttempt(command);\n assertNormalizedSnapshot(snapshot);\n } catch (error) {\n if (isProviderErrorLike(error) && error.safeCode === expectedSafeCode) return;\n throw new Error(`The scenario must be rejected with safe code \"${expectedSafeCode}\"; received ${describeError(error)}.`);\n }\n throw new Error(`The scenario was accepted instead of being rejected as \"${expectedSafeCode}\".`);\n}\n\nasync function expectProviderError(\n operation: () => Promise<unknown>,\n code: ProviderError['code'],\n expectations: { retryable: boolean; retryAfterRequired?: boolean },\n): Promise<void> {\n try {\n await operation();\n } catch (error) {\n if (!isProviderErrorLike(error)) {\n throw new Error(`Expected ProviderError ${code}; received ${describeError(error)}.`);\n }\n if (error.code !== code) throw new Error(`Expected ProviderError ${code}; received ${error.code}.`);\n if (error.retryable !== expectations.retryable) {\n throw new Error(`ProviderError ${code} must set retryable=${String(expectations.retryable)}.`);\n }\n if (!error.safeCode.trim()) throw new Error(`ProviderError ${code} must provide a safe code.`);\n if (expectations.retryAfterRequired\n && (!Number.isSafeInteger(error.retryAfterSeconds) || Number(error.retryAfterSeconds) <= 0)) {\n throw new Error(`ProviderError ${code} must provide a positive integer retryAfterSeconds.`);\n }\n return;\n }\n throw new Error(`Expected ProviderError ${code}, but the adapter operation succeeded.`);\n}\n\nfunction assertAttemptResult(\n adapter: VerificationAdapterV1,\n result: Awaited<ReturnType<VerificationAdapterV1['createAttempt']>>,\n): void {\n if (!result || typeof result !== 'object'\n || !isNonEmptyString(result.providerResourceId)\n || !isNonEmptyString(result.providerStatus)\n || result.attemptId == null) {\n malformed('The adapter returned an incomplete attempt result.');\n }\n assertLaunchResult(adapter, result.launch);\n assertProviderTypesDoNotEscape(result);\n}\n\nfunction assertLaunchResult(adapter: VerificationAdapterV1, launch: ProviderLaunchEnvelope): void {\n if (!launch || typeof launch !== 'object'\n || !isNonEmptyString(launch.launcherKey)\n || !adapter.manifest.launcherKeys.includes(launch.launcherKey)\n || !adapter.manifest.capabilities.presentations.includes(launch.presentation)\n || !isCanonicalStatus(launch.canonicalStatus)) {\n malformed('The adapter returned an invalid launch envelope.');\n }\n const forbidden = ['inquiryOrSessionId', 'environmentId', 'opaqueLaunchSecret', 'adapter', 'clientSecret'];\n if (forbidden.some((key) => key in (launch as unknown as Record<string, unknown>))) {\n throw new Error('Deprecated or secret launch fields escaped the adapter boundary.');\n }\n}\n\nfunction assertNormalizedSnapshot(snapshot: NormalizedProviderSnapshot): void {\n if (!snapshot || typeof snapshot !== 'object'\n || !isNonEmptyString(snapshot.providerResourceId)\n || !isNonEmptyString(snapshot.providerStatus)\n || !isIsoTimestamp(snapshot.occurredAt)\n || !Array.isArray(snapshot.normalizedReasonCodes)\n || snapshot.normalizedReasonCodes.some((code) => !isNonEmptyString(code))\n || !isSafeMetadata(snapshot.safeMetadata)) {\n malformed('The adapter returned a malformed normalized snapshot.');\n }\n assertCanonicalStatus(snapshot.canonicalStatus);\n assertProviderTypesDoNotEscape(snapshot);\n}\n\nfunction assertRedactionResult(result: ProviderRedactionResult): void {\n if (!result || typeof result !== 'object'\n || typeof result.completed !== 'boolean'\n || typeof result.retryable !== 'boolean') {\n malformed('Adapter returned an invalid redaction result.');\n }\n}\n\nfunction assertCanonicalStatus(value: string): void {\n if (!isCanonicalStatus(value)) {\n throw new ProviderError('UNKNOWN_PROVIDER_STATE', 'Adapter returned an unknown canonical status.', {\n safeCode: 'unknown_provider_status',\n });\n }\n}\n\nexport function assertProviderTypesDoNotEscape(value: unknown): void {\n const serialized = JSON.stringify(value, (_key, nested) => (nested instanceof Uint8Array ? undefined : nested));\n if (/\"(?:access_token|api_key|client_secret|document_number|raw_payload|ssn|template_id|verification_session|webhook_secret|inquiry_status|document_front|selfie)\"/i.test(serialized)) {\n throw new Error('Provider SDK or raw provider fields escaped the adapter boundary.');\n }\n if (metadataContainsForbiddenIdentifier(value)) {\n throw new Error('Government identifiers escaped the adapter boundary.');\n }\n}\n\nfunction resourceCommand(command: ProviderAttemptCommand, providerResourceId: string) {\n return {\n attemptId: command.attemptId,\n providerResourceId,\n configurationRevision: command.configurationRevision,\n requestOrigin: command.requestOrigin,\n };\n}\n\nfunction redactionCommand(command: ProviderAttemptCommand, providerResourceId: string) {\n return {\n subjectReference: command.subjectReference,\n providerResourceId,\n requestReference: command.idempotencyKey,\n };\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction isIsoTimestamp(value: unknown): value is string {\n return isNonEmptyString(value) && !Number.isNaN(Date.parse(value));\n}\n\nfunction isSafeMetadata(value: unknown): value is Record<string, string | boolean | number | null> {\n return Boolean(value)\n && typeof value === 'object'\n && !Array.isArray(value)\n && Object.values(value as Record<string, unknown>).every((entry) => (\n entry === null || ['string', 'boolean', 'number'].includes(typeof entry)\n ));\n}\n\nfunction malformed(message: string): never {\n throw new ProviderError('RETRYABLE_PROVIDER_FAILURE', message, {\n retryable: true,\n safeCode: 'malformed_provider_response',\n });\n}\n\nfunction isProviderErrorLike(error: unknown): error is ProviderError {\n if (error instanceof ProviderError) return true;\n if (!error || typeof error !== 'object') return false;\n const candidate = error as Partial<ProviderError> & { name?: string };\n return candidate.name === 'ProviderError'\n && typeof candidate.code === 'string'\n && typeof candidate.safeCode === 'string'\n && typeof candidate.retryable === 'boolean';\n}\n\nfunction describeError(error: unknown): string {\n return error instanceof Error ? `${error.name}: ${error.message}` : 'a non-Error value';\n}\n"]}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
/** Public adapter contract version. Npm package versions remain 0.1.x-beta until sandbox certification. */
|
|
2
|
+
declare const VERIFICATION_ADAPTER_CONTRACT_VERSION: "1.0.0";
|
|
3
|
+
declare const ENGINE_CONTRACT_VERSION: "1.0.0";
|
|
4
|
+
declare const PROVIDER_MANIFEST_SCHEMA_URN = "urn:splitin:verification:provider-manifest:v1";
|
|
5
|
+
declare const STANDARD_PACKAGE_CODES: readonly ["human_idv", "business_kyb", "associated_person_idv", "ownership_review"];
|
|
6
|
+
type StandardPackageCode = (typeof STANDARD_PACKAGE_CODES)[number];
|
|
7
|
+
declare const STANDARD_WEBHOOK_PROTOCOLS: readonly ["none", "stripe_v1_hmac", "persona_hmac_sha256", "plaid_es256_jwk"];
|
|
8
|
+
type StandardWebhookProtocol = (typeof STANDARD_WEBHOOK_PROTOCOLS)[number];
|
|
9
|
+
declare const CANONICAL_STATUSES: readonly ["created", "pending_user_input", "paused", "processing", "manual_review_required", "verified", "declined", "failed", "expired", "canceled", "provider_unavailable", "redacted"];
|
|
10
|
+
type VerificationCanonicalStatus = (typeof CANONICAL_STATUSES)[number];
|
|
11
|
+
declare const TERMINAL_STATUSES: readonly ["verified", "declined", "failed", "expired", "canceled", "redacted"];
|
|
12
|
+
type TerminalVerificationStatus = (typeof TERMINAL_STATUSES)[number];
|
|
13
|
+
declare const LAUNCH_PRESENTATIONS: readonly ["embedded", "hosted", "qr", "none"];
|
|
14
|
+
type VerificationLaunchPresentation = (typeof LAUNCH_PRESENTATIONS)[number];
|
|
15
|
+
declare const PROVIDER_ENVIRONMENTS: readonly ["sandbox", "production"];
|
|
16
|
+
type VerificationProviderEnvironment = (typeof PROVIDER_ENVIRONMENTS)[number];
|
|
17
|
+
declare const PROVIDER_OPERATIONS: readonly ["create", "resume", "retrieve", "retry", "cancel", "redact", "webhook_verify", "webhook_normalize", "health"];
|
|
18
|
+
type ProviderOperation = (typeof PROVIDER_OPERATIONS)[number];
|
|
19
|
+
declare const STANDARD_RELATIONSHIP_KINDS: readonly ["ubo", "director", "officer", "authorized_representative", "associated_person"];
|
|
20
|
+
type StandardRelationshipKind = (typeof STANDARD_RELATIONSHIP_KINDS)[number];
|
|
21
|
+
/** Standard codes or namespaced custom codes such as `com.example.employee_check`. */
|
|
22
|
+
type VerificationPackageCode = StandardPackageCode | (string & {});
|
|
23
|
+
type WebhookProtocolId = StandardWebhookProtocol | (string & {});
|
|
24
|
+
type ProviderResourceType = string;
|
|
25
|
+
type VerificationProviderCode = string;
|
|
26
|
+
type VerificationLauncherKey = string;
|
|
27
|
+
declare function isProviderCode(value: string): boolean;
|
|
28
|
+
declare function isLauncherKey(value: string): boolean;
|
|
29
|
+
declare function isStandardPackageCode(value: string): value is StandardPackageCode;
|
|
30
|
+
declare function isCustomPackageCode(value: string): boolean;
|
|
31
|
+
declare function isPackageCode(value: string): value is VerificationPackageCode;
|
|
32
|
+
declare function assertPackageCode(value: string): VerificationPackageCode;
|
|
33
|
+
declare function isWebhookProtocol(value: string): value is WebhookProtocolId;
|
|
34
|
+
declare function isResourceType(value: string): value is ProviderResourceType;
|
|
35
|
+
declare function isCountryCode(value: string): boolean;
|
|
36
|
+
declare function isSemver(value: string): boolean;
|
|
37
|
+
declare function isCanonicalStatus(value: string): value is VerificationCanonicalStatus;
|
|
38
|
+
declare function isTerminalStatus(value: string): value is TerminalVerificationStatus;
|
|
39
|
+
declare function isOpaqueSubjectReference(value: string): boolean;
|
|
40
|
+
declare function metadataContainsForbiddenIdentifier(value: unknown): boolean;
|
|
41
|
+
declare function compareSemver(left: string, right: string): number;
|
|
42
|
+
declare function majorsCompatible(left: string, right: string): boolean;
|
|
43
|
+
|
|
44
|
+
type ProviderErrorCode = 'INVALID_CONFIGURATION' | 'UNSUPPORTED_CAPABILITY' | 'AUTHENTICATION_FAILED' | 'SIGNATURE_INVALID' | 'RATE_LIMITED' | 'TIMEOUT' | 'RETRYABLE_PROVIDER_FAILURE' | 'TERMINAL_INPUT_FAILURE' | 'UNKNOWN_PROVIDER_STATE' | 'PROVIDER_UNAVAILABLE';
|
|
45
|
+
interface ProviderErrorOptions {
|
|
46
|
+
retryable?: boolean;
|
|
47
|
+
safeCode?: string;
|
|
48
|
+
retryAfterSeconds?: number;
|
|
49
|
+
cause?: unknown;
|
|
50
|
+
}
|
|
51
|
+
/** Provider-safe error. Message and fields must never contain PII or secrets. */
|
|
52
|
+
declare class ProviderError extends Error {
|
|
53
|
+
readonly code: ProviderErrorCode;
|
|
54
|
+
readonly retryable: boolean;
|
|
55
|
+
readonly safeCode: string;
|
|
56
|
+
readonly retryAfterSeconds?: number;
|
|
57
|
+
constructor(code: ProviderErrorCode, message: string, options?: ProviderErrorOptions);
|
|
58
|
+
}
|
|
59
|
+
declare class ProviderUnavailableError extends ProviderError {
|
|
60
|
+
constructor(message?: string, options?: ProviderErrorOptions);
|
|
61
|
+
}
|
|
62
|
+
declare class ProviderOperationPendingError extends ProviderError {
|
|
63
|
+
constructor(message?: string);
|
|
64
|
+
}
|
|
65
|
+
declare class VerificationAttemptLimitError extends ProviderError {
|
|
66
|
+
constructor(retryAfterSeconds: number);
|
|
67
|
+
}
|
|
68
|
+
declare class ProviderRequiredInformationError extends ProviderError {
|
|
69
|
+
constructor(message?: string);
|
|
70
|
+
}
|
|
71
|
+
interface SafeProviderFailure {
|
|
72
|
+
code: ProviderErrorCode;
|
|
73
|
+
safeCode: string;
|
|
74
|
+
retryable: boolean;
|
|
75
|
+
retryAfterSeconds?: number;
|
|
76
|
+
}
|
|
77
|
+
declare function toSafeProviderFailure(error: unknown): SafeProviderFailure;
|
|
78
|
+
|
|
79
|
+
interface ProviderCapabilities {
|
|
80
|
+
presentations: VerificationLaunchPresentation[];
|
|
81
|
+
canResume: boolean;
|
|
82
|
+
canRetry: boolean;
|
|
83
|
+
canCancel: boolean;
|
|
84
|
+
canRedact: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface JsonSchema2020 {
|
|
87
|
+
$schema?: string;
|
|
88
|
+
$id?: string;
|
|
89
|
+
type?: string | string[];
|
|
90
|
+
title?: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
const?: unknown;
|
|
93
|
+
enum?: unknown[];
|
|
94
|
+
required?: string[];
|
|
95
|
+
additionalProperties?: boolean | JsonSchema2020;
|
|
96
|
+
properties?: Record<string, JsonSchema2020>;
|
|
97
|
+
items?: JsonSchema2020 | JsonSchema2020[];
|
|
98
|
+
minLength?: number;
|
|
99
|
+
maxLength?: number;
|
|
100
|
+
minimum?: number;
|
|
101
|
+
maximum?: number;
|
|
102
|
+
minItems?: number;
|
|
103
|
+
uniqueItems?: boolean;
|
|
104
|
+
pattern?: string;
|
|
105
|
+
format?: string;
|
|
106
|
+
'x-secret'?: boolean;
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
}
|
|
109
|
+
interface ProviderConfigurationSchemaV1 extends JsonSchema2020 {
|
|
110
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
111
|
+
type: 'object';
|
|
112
|
+
additionalProperties: false;
|
|
113
|
+
required: string[];
|
|
114
|
+
properties: Record<string, JsonSchema2020>;
|
|
115
|
+
}
|
|
116
|
+
interface ProviderManifestV1 {
|
|
117
|
+
contractVersion: typeof VERIFICATION_ADAPTER_CONTRACT_VERSION;
|
|
118
|
+
adapterVersion: string;
|
|
119
|
+
engineCompatibility: string;
|
|
120
|
+
provider: VerificationProviderCode;
|
|
121
|
+
displayName: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
supportedPackages: VerificationPackageCode[];
|
|
124
|
+
supportedCountries: string[];
|
|
125
|
+
environments: VerificationProviderEnvironment[];
|
|
126
|
+
capabilities: ProviderCapabilities;
|
|
127
|
+
launcherKeys: string[];
|
|
128
|
+
launchPresentations: VerificationLaunchPresentation[];
|
|
129
|
+
configurationSchemaVersion: string;
|
|
130
|
+
configurationSchema: ProviderConfigurationSchemaV1;
|
|
131
|
+
webhook: {
|
|
132
|
+
protocol: WebhookProtocolId;
|
|
133
|
+
eventFamilies: string[];
|
|
134
|
+
toleranceSeconds?: number;
|
|
135
|
+
};
|
|
136
|
+
dataPolicy: {
|
|
137
|
+
classifications: string[];
|
|
138
|
+
prohibitedPersistence: string[];
|
|
139
|
+
rawPayloadPersistence: false;
|
|
140
|
+
browserSecretPersistence: false;
|
|
141
|
+
governmentIdentifierPersistence: false;
|
|
142
|
+
};
|
|
143
|
+
retry: {
|
|
144
|
+
sameResourceWhenResumable: boolean;
|
|
145
|
+
newAttemptAfterTerminal: boolean;
|
|
146
|
+
};
|
|
147
|
+
cancellation: {
|
|
148
|
+
supported: boolean;
|
|
149
|
+
terminal: boolean;
|
|
150
|
+
};
|
|
151
|
+
redaction: {
|
|
152
|
+
supported: boolean;
|
|
153
|
+
asynchronous: boolean;
|
|
154
|
+
notApplicable?: boolean;
|
|
155
|
+
};
|
|
156
|
+
apiHosts: string[];
|
|
157
|
+
testedApiVersions: string[];
|
|
158
|
+
}
|
|
159
|
+
interface ProviderSafeLogger {
|
|
160
|
+
info(event: string, metadata?: Record<string, string | number | boolean | null>): void;
|
|
161
|
+
warn(event: string, metadata?: Record<string, string | number | boolean | null>): void;
|
|
162
|
+
error(event: string, metadata?: Record<string, string | number | boolean | null>): void;
|
|
163
|
+
}
|
|
164
|
+
interface ProviderHealthObservation {
|
|
165
|
+
operation: ProviderOperation;
|
|
166
|
+
outcome: 'success' | 'retryable_failure' | 'terminal_failure' | 'unknown_status';
|
|
167
|
+
safeCode: string;
|
|
168
|
+
observedAt: string;
|
|
169
|
+
latencyMs?: number;
|
|
170
|
+
}
|
|
171
|
+
interface TraceSpan {
|
|
172
|
+
name: string;
|
|
173
|
+
attributes?: Record<string, string | number | boolean>;
|
|
174
|
+
}
|
|
175
|
+
interface OpenTelemetryHooks {
|
|
176
|
+
counter?(name: string, value: number, attributes?: Record<string, string>): void;
|
|
177
|
+
histogram?(name: string, value: number, attributes?: Record<string, string>): void;
|
|
178
|
+
startSpan?(span: TraceSpan): {
|
|
179
|
+
end(): void;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
interface ProviderRateBudget {
|
|
183
|
+
acquire(operation: ProviderOperation): Promise<{
|
|
184
|
+
allowed: boolean;
|
|
185
|
+
retryAfterSeconds?: number;
|
|
186
|
+
}>;
|
|
187
|
+
}
|
|
188
|
+
interface ProviderHttpClient {
|
|
189
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
190
|
+
}
|
|
191
|
+
interface ProviderRuntimeContext<TConfiguration extends object = Record<string, unknown>> {
|
|
192
|
+
environment: VerificationProviderEnvironment;
|
|
193
|
+
configuration: Readonly<TConfiguration>;
|
|
194
|
+
http: ProviderHttpClient;
|
|
195
|
+
now: () => Date;
|
|
196
|
+
crypto: Crypto;
|
|
197
|
+
idempotency: {
|
|
198
|
+
keyFor(operation: ProviderOperation, attemptId: string, suppliedKey?: string): string;
|
|
199
|
+
};
|
|
200
|
+
logger: ProviderSafeLogger;
|
|
201
|
+
telemetry?: OpenTelemetryHooks;
|
|
202
|
+
recordHealth: (observation: ProviderHealthObservation) => Promise<void>;
|
|
203
|
+
rateBudget?: ProviderRateBudget;
|
|
204
|
+
}
|
|
205
|
+
interface ProviderAddressInput {
|
|
206
|
+
street1: string;
|
|
207
|
+
street2?: string | null;
|
|
208
|
+
city: string;
|
|
209
|
+
subdivision?: string | null;
|
|
210
|
+
postalCode: string;
|
|
211
|
+
countryCode: string;
|
|
212
|
+
}
|
|
213
|
+
interface ProviderAssociatedPersonInput {
|
|
214
|
+
subjectReference: string;
|
|
215
|
+
legalFirstName: string;
|
|
216
|
+
legalLastName: string;
|
|
217
|
+
email?: string | null;
|
|
218
|
+
relationshipKind: string;
|
|
219
|
+
claimedOwnershipPercentage?: number | null;
|
|
220
|
+
}
|
|
221
|
+
interface ProviderOrganizationInput {
|
|
222
|
+
legalName: string;
|
|
223
|
+
jurisdictionCountryCode: string;
|
|
224
|
+
entityType?: string | null;
|
|
225
|
+
registeredAddress?: ProviderAddressInput | null;
|
|
226
|
+
physicalAddress?: ProviderAddressInput | null;
|
|
227
|
+
associatedPeople?: ProviderAssociatedPersonInput[];
|
|
228
|
+
evidenceReferences?: string[];
|
|
229
|
+
}
|
|
230
|
+
interface ProviderRelationshipInput {
|
|
231
|
+
relationshipReference: string;
|
|
232
|
+
kind: string;
|
|
233
|
+
claimedOwnershipPercentage?: number | null;
|
|
234
|
+
subjectReference?: string | null;
|
|
235
|
+
}
|
|
236
|
+
interface ProviderAttemptCommand {
|
|
237
|
+
attemptId: string;
|
|
238
|
+
subjectReference: string;
|
|
239
|
+
organizationReference?: string | null;
|
|
240
|
+
packageCode: VerificationPackageCode;
|
|
241
|
+
countryCode: string;
|
|
242
|
+
idempotencyKey: string;
|
|
243
|
+
configurationRevision: string;
|
|
244
|
+
legalFirstName?: string | null;
|
|
245
|
+
legalLastName?: string | null;
|
|
246
|
+
email?: string | null;
|
|
247
|
+
organization?: ProviderOrganizationInput | null;
|
|
248
|
+
relationship?: ProviderRelationshipInput | null;
|
|
249
|
+
associatedPerson?: ProviderAssociatedPersonInput | null;
|
|
250
|
+
evidenceReferences?: string[];
|
|
251
|
+
requestOrigin?: string | null;
|
|
252
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
253
|
+
}
|
|
254
|
+
interface ProviderResumeCommand {
|
|
255
|
+
attemptId: string;
|
|
256
|
+
providerResourceId: string;
|
|
257
|
+
configurationRevision: string;
|
|
258
|
+
requestOrigin?: string | null;
|
|
259
|
+
}
|
|
260
|
+
interface ProviderRetryCommand extends ProviderAttemptCommand {
|
|
261
|
+
previousProviderResourceId?: string | null;
|
|
262
|
+
}
|
|
263
|
+
interface ProviderResourceCommand {
|
|
264
|
+
attemptId: string;
|
|
265
|
+
providerResourceId: string;
|
|
266
|
+
configurationRevision: string;
|
|
267
|
+
requestOrigin?: string | null;
|
|
268
|
+
}
|
|
269
|
+
interface ProviderRedactionCommand {
|
|
270
|
+
subjectReference: string;
|
|
271
|
+
providerResourceId?: string | null;
|
|
272
|
+
providerResourceType?: string;
|
|
273
|
+
requestReference: string;
|
|
274
|
+
}
|
|
275
|
+
interface ProviderLaunchEnvelope {
|
|
276
|
+
attemptId: string;
|
|
277
|
+
canonicalStatus: VerificationCanonicalStatus;
|
|
278
|
+
launcherKey: string;
|
|
279
|
+
presentation: VerificationLaunchPresentation;
|
|
280
|
+
providerDisclosure?: string;
|
|
281
|
+
transientSecret?: string;
|
|
282
|
+
transientSecretExpiresAt?: string;
|
|
283
|
+
hostedUrl?: string;
|
|
284
|
+
hostedFallbackExpiresAt?: string;
|
|
285
|
+
safeErrorCode?: string | null;
|
|
286
|
+
retryAfter?: string | null;
|
|
287
|
+
supportPath?: string | null;
|
|
288
|
+
continuationReference?: string;
|
|
289
|
+
}
|
|
290
|
+
interface ProviderAttemptResult {
|
|
291
|
+
attemptId: string;
|
|
292
|
+
providerResourceId: string;
|
|
293
|
+
providerStatus: string;
|
|
294
|
+
canonicalStatus: VerificationCanonicalStatus;
|
|
295
|
+
launch: ProviderLaunchEnvelope;
|
|
296
|
+
linkedResources?: Array<{
|
|
297
|
+
resourceType: string;
|
|
298
|
+
resourceId: string;
|
|
299
|
+
relationshipCode: string;
|
|
300
|
+
providerStatus: string;
|
|
301
|
+
occurredAt: string;
|
|
302
|
+
}>;
|
|
303
|
+
}
|
|
304
|
+
interface NormalizedProviderSnapshot {
|
|
305
|
+
providerResourceId: string;
|
|
306
|
+
providerStatus: string;
|
|
307
|
+
canonicalStatus: VerificationCanonicalStatus;
|
|
308
|
+
occurredAt: string;
|
|
309
|
+
providerCreatedAt?: string;
|
|
310
|
+
normalizedReasonCodes: string[];
|
|
311
|
+
safeMetadata: Record<string, string | boolean | number | null>;
|
|
312
|
+
}
|
|
313
|
+
interface ProviderOperationResult {
|
|
314
|
+
accepted: boolean;
|
|
315
|
+
providerStatus?: string;
|
|
316
|
+
canonicalStatus?: VerificationCanonicalStatus;
|
|
317
|
+
}
|
|
318
|
+
interface ProviderRedactionResult {
|
|
319
|
+
completed: boolean;
|
|
320
|
+
retryable: boolean;
|
|
321
|
+
disposition?: 'scheduled' | 'processing' | 'retryable' | 'redacted' | 'not_applicable' | 'dead_letter' | 'failed';
|
|
322
|
+
}
|
|
323
|
+
interface VerifiedWebhookEnvelope {
|
|
324
|
+
providerEventKey: string;
|
|
325
|
+
receivedAt: string;
|
|
326
|
+
bodySha256: string;
|
|
327
|
+
signatureIssuedAt?: string;
|
|
328
|
+
opaquePayload: Uint8Array;
|
|
329
|
+
}
|
|
330
|
+
interface NormalizedProviderEvent {
|
|
331
|
+
providerEventKey: string;
|
|
332
|
+
providerResourceId: string;
|
|
333
|
+
eventType: string;
|
|
334
|
+
providerEventType: string;
|
|
335
|
+
canonicalStatus?: VerificationCanonicalStatus;
|
|
336
|
+
occurredAt: string;
|
|
337
|
+
normalizedReasonCodes: string[];
|
|
338
|
+
safeMetadata: Record<string, string | boolean | number | null>;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Provider-neutral verification adapter. The engine owns reconciliation,
|
|
342
|
+
* queues, routing, attempts, decisions and protected-action enforcement.
|
|
343
|
+
*/
|
|
344
|
+
interface VerificationAdapterV1<TConfig extends object = Record<string, unknown>> {
|
|
345
|
+
readonly contractVersion: typeof VERIFICATION_ADAPTER_CONTRACT_VERSION;
|
|
346
|
+
readonly manifest: ProviderManifestV1;
|
|
347
|
+
readonly provider: VerificationProviderCode;
|
|
348
|
+
readonly environment: VerificationProviderEnvironment;
|
|
349
|
+
readonly runtime: ProviderRuntimeContext<TConfig>;
|
|
350
|
+
validateConfiguration(): void;
|
|
351
|
+
createAttempt(command: ProviderAttemptCommand): Promise<ProviderAttemptResult>;
|
|
352
|
+
resumeAttempt(command: ProviderResumeCommand): Promise<ProviderLaunchEnvelope>;
|
|
353
|
+
retrieveAttempt(command: ProviderResourceCommand): Promise<NormalizedProviderSnapshot>;
|
|
354
|
+
retryAttempt(command: ProviderRetryCommand): Promise<ProviderAttemptResult>;
|
|
355
|
+
cancelAttempt(command: ProviderResourceCommand): Promise<ProviderOperationResult>;
|
|
356
|
+
redactSubject(command: ProviderRedactionCommand): Promise<ProviderRedactionResult>;
|
|
357
|
+
verifyWebhook(input: Request): Promise<VerifiedWebhookEnvelope>;
|
|
358
|
+
normalizeWebhook(input: VerifiedWebhookEnvelope): Promise<NormalizedProviderEvent>;
|
|
359
|
+
}
|
|
360
|
+
interface ActorContext {
|
|
361
|
+
tenantKey: string;
|
|
362
|
+
actorId: string;
|
|
363
|
+
actorType: 'user' | 'operator' | 'system';
|
|
364
|
+
roles: string[];
|
|
365
|
+
authorizedSubjectScope: string[];
|
|
366
|
+
}
|
|
367
|
+
interface ProtectedActionDenial {
|
|
368
|
+
code: 'VERIFICATION_REQUIRED';
|
|
369
|
+
action: string;
|
|
370
|
+
resourceHash: string;
|
|
371
|
+
requiredPackages: VerificationPackageCode[];
|
|
372
|
+
continuation: {
|
|
373
|
+
key: string;
|
|
374
|
+
token: string;
|
|
375
|
+
expiresAt: string;
|
|
376
|
+
};
|
|
377
|
+
retryAfter: string | null;
|
|
378
|
+
supportPath: string | null;
|
|
379
|
+
}
|
|
380
|
+
interface SafeProviderFailureEnvelope {
|
|
381
|
+
code: ProviderErrorCode;
|
|
382
|
+
safeCode: string;
|
|
383
|
+
retryable: boolean;
|
|
384
|
+
retryAfterSeconds?: number;
|
|
385
|
+
supportPath?: string | null;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export { VERIFICATION_ADAPTER_CONTRACT_VERSION as $, type ActorContext as A, ProviderRequiredInformationError as B, CANONICAL_STATUSES as C, type ProviderResourceCommand as D, ENGINE_CONTRACT_VERSION as E, type ProviderResourceType as F, type ProviderResumeCommand as G, type ProviderRetryCommand as H, type ProviderSafeLogger as I, type JsonSchema2020 as J, ProviderUnavailableError as K, LAUNCH_PRESENTATIONS as L, STANDARD_RELATIONSHIP_KINDS as M, type NormalizedProviderEvent as N, type OpenTelemetryHooks as O, type ProviderConfigurationSchemaV1 as P, STANDARD_WEBHOOK_PROTOCOLS as Q, type SafeProviderFailure as R, STANDARD_PACKAGE_CODES as S, type SafeProviderFailureEnvelope as T, type StandardPackageCode as U, type VerificationAdapterV1 as V, type StandardRelationshipKind as W, type StandardWebhookProtocol as X, TERMINAL_STATUSES as Y, type TerminalVerificationStatus as Z, type TraceSpan as _, type ProviderManifestV1 as a, VerificationAttemptLimitError as a0, type VerificationCanonicalStatus as a1, type VerificationLaunchPresentation as a2, type VerificationLauncherKey as a3, type VerificationPackageCode as a4, type VerificationProviderCode as a5, type VerificationProviderEnvironment as a6, type VerifiedWebhookEnvelope as a7, type WebhookProtocolId as a8, assertPackageCode as a9, compareSemver as aa, isCanonicalStatus as ab, isCountryCode as ac, isCustomPackageCode as ad, isLauncherKey as ae, isOpaqueSubjectReference as af, isPackageCode as ag, isProviderCode as ah, isResourceType as ai, isSemver as aj, isStandardPackageCode as ak, isTerminalStatus as al, isWebhookProtocol as am, majorsCompatible as an, metadataContainsForbiddenIdentifier as ao, toSafeProviderFailure as ap, type ProviderRuntimeContext as b, type NormalizedProviderSnapshot as c, PROVIDER_ENVIRONMENTS as d, PROVIDER_MANIFEST_SCHEMA_URN as e, PROVIDER_OPERATIONS as f, type ProtectedActionDenial as g, type ProviderAddressInput as h, type ProviderAssociatedPersonInput as i, type ProviderAttemptCommand as j, type ProviderAttemptResult as k, type ProviderCapabilities as l, ProviderError as m, type ProviderErrorCode as n, type ProviderErrorOptions as o, type ProviderHealthObservation as p, type ProviderHttpClient as q, type ProviderLaunchEnvelope as r, type ProviderOperation as s, ProviderOperationPendingError as t, type ProviderOperationResult as u, type ProviderOrganizationInput as v, type ProviderRateBudget as w, type ProviderRedactionCommand as x, type ProviderRedactionResult as y, type ProviderRelationshipInput as z };
|