@keri-ts/verifier 0.0.0-stage → 2.0.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,58 @@
1
+ import { call } from "effection";
2
+ import { TransportError } from "keri-ts/runtime";
3
+ import { credentialSchema } from "./policy.js";
4
+ /** Project an accepted credential and selected revocation state without changing protocol evidence. */
5
+ export function webhookBody(creder, action, state) {
6
+ const actor = creder.issuer ?? "";
7
+ const data = action === "iss" ? presentationPayload(creder) : revocationPayload(creder, state);
8
+ return { action, actor, data };
9
+ }
10
+ /** Preserve the supported legacy attribute projection; this adds no authentication. */
11
+ function presentationPayload(creder) {
12
+ const attrs = isRecord(creder.attrib) ? creder.attrib : {};
13
+ return {
14
+ schema: credentialSchema(creder),
15
+ issuer: creder.issuer,
16
+ issueTimestamp: typeof attrs.dt === "string" ? attrs.dt : undefined,
17
+ credential: creder.said,
18
+ recipient: typeof attrs.i === "string" ? attrs.i : undefined,
19
+ attributes: attrs,
20
+ edge: creder.edge ?? undefined,
21
+ };
22
+ }
23
+ /** Report the accepted TEL timestamp rather than the local delivery-attempt clock. */
24
+ function revocationPayload(creder, state) {
25
+ return {
26
+ schema: credentialSchema(creder),
27
+ credential: creder.said,
28
+ revocationTimestamp: state?.dt,
29
+ };
30
+ }
31
+ /** Return HTTP success only after response cleanup; no receipt or exactly-once delivery is inferred. */
32
+ export function* postWebhook(http, now, hook, body) {
33
+ const raw = JSON.stringify(body);
34
+ try {
35
+ return yield* call(function* () {
36
+ const response = yield* http.open(hook, {
37
+ method: "POST",
38
+ headers: {
39
+ "content-type": "application/json",
40
+ "sally-resource": String(body.data.schema ?? ""),
41
+ "sally-timestamp": new Date(now()).toISOString(),
42
+ },
43
+ body: raw,
44
+ });
45
+ // Returning from this call scope closes the unread response before publishing success.
46
+ return response.ok;
47
+ });
48
+ }
49
+ catch (error) {
50
+ if (error instanceof TransportError)
51
+ return false;
52
+ throw error;
53
+ }
54
+ }
55
+ /** ACDC attributes are protocol/schema data; narrow the mapping before projecting webhook fields. */
56
+ function isRecord(value) {
57
+ return typeof value === "object" && value !== null && !Array.isArray(value);
58
+ }
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "@keri-ts/verifier",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.1",
4
+ "description": "Credential verifier application policy, workflow storage and webhooks",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/kentbull/keri-ts.git",
8
+ "directory": "packages/verifier"
9
+ },
10
+ "license": "Apache-2.0",
11
+ "main": "./esm/verifier/npm/src/mod.js",
12
+ "module": "./esm/verifier/npm/src/mod.js",
13
+ "types": "./types/mod.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./types/mod.d.ts",
17
+ "import": "./esm/verifier/npm/src/mod.js"
18
+ }
19
+ },
20
+ "scripts": {
21
+ "test": "node --version"
22
+ },
23
+ "type": "module",
24
+ "sideEffects": false,
25
+ "files": [
26
+ "esm",
27
+ "types",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ "engines": {
32
+ "node": ">=20.3"
33
+ },
34
+ "dependencies": {
35
+ "@keri-ts/registrar": "2.0.1",
36
+ "cesr-ts": "2.0.0",
37
+ "effection": "^3.6.0",
38
+ "keri-ts": "2.0.1",
39
+ "@deno/shim-deno": "~0.18.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^20.9.0"
43
+ },
44
+ "_generatedBy": "dnt@dev"
45
+ }
package/types/mod.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /** Verifier application package entrypoint. */
2
+ export { type AcdcV2Observation, type AcdcV2Verification, AcdcV2Verifier, type AcdcV2VerifierOptions, type HistoricalInspection, } from "./src/acdc-v2.js";
3
+ export { VerifierAgent, type VerifierAgentOptions, type VerifierAgentProcessResult } from "./src/agent.js";
4
+ export { createVerifierCueBaser, VerifierCueBaser, type VerifierCueBaserOptions, type VerifierCueCounts, } from "./src/cue-store.js";
5
+ export { validatorsFromVerifierConfig, type VerifierBusinessValidator, type VerifierBusinessValidatorContext, } from "./src/policy.js";
6
+ export type { VerifierWebhookBody } from "./src/webhook.js";
7
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC3G,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,4BAA4B,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,gCAAgC,GACtC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,58 @@
1
+ /** Exact retained IPEX views and current configured-source policy; no credential-view enrichment. */
2
+ import type { Registrar } from "@keri-ts/registrar";
3
+ import { type SerderACDC } from "cesr-ts";
4
+ import { type Operation } from "effection";
5
+ import { type ExchangeRegistryStateShape } from "keri-ts/db";
6
+ import { type Exchanger, type Hab, type Habery, type HttpClient } from "keri-ts/runtime";
7
+ /** Recent observation of an exact locally authenticated head from one configured TLS endpoint. */
8
+ export interface AcdcV2Observation {
9
+ registry: string;
10
+ source: string;
11
+ head: string;
12
+ observedAt: string;
13
+ }
14
+ /** Historical proof validity carries no current-standing, business-policy or delivery claim. */
15
+ export interface HistoricalInspection {
16
+ purpose: "historical-evidence";
17
+ proofValidity: "valid";
18
+ currentStanding: "not-evaluated";
19
+ grant: string;
20
+ credential: SerderACDC | null;
21
+ views: {
22
+ credential: string;
23
+ view: string;
24
+ }[];
25
+ /** Last authenticated per-node observation; optional omissions can retain earlier facts. Never current authority. */
26
+ recordedRegistryStates: (ExchangeRegistryStateShape & {
27
+ node: string;
28
+ })[];
29
+ }
30
+ /** Unavailable evidence remains separate from a known policy refusal or public revocation. */
31
+ export interface AcdcV2Verification {
32
+ kind: "issued" | "revoked" | "missing" | "refused";
33
+ credential: SerderACDC | null;
34
+ observations: AcdcV2Observation[];
35
+ }
36
+ export interface AcdcV2VerifierOptions {
37
+ source: string;
38
+ maximumAgeMs: number;
39
+ requestTimeoutMs: number;
40
+ now: () => number;
41
+ }
42
+ /** Borrow accepted exchange/public evidence owners; acquire no stores, parser or background worker. */
43
+ export declare class AcdcV2Verifier {
44
+ readonly hby: Habery;
45
+ readonly hab: Hab;
46
+ readonly exc: Exchanger;
47
+ readonly evidence: Registrar;
48
+ readonly http: HttpClient;
49
+ readonly options: AcdcV2VerifierOptions;
50
+ constructor(hby: Habery, hab: Hab, exc: Exchanger, evidence: Registrar, http: HttpClient, options: AcdcV2VerifierOptions);
51
+ /** Inspect the immutable retained nested material without querying, reporting or applying graph policy. */
52
+ inspectHistorical(grant: string): HistoricalInspection;
53
+ /** Authenticate one complete source response and its exact accepted head, never infer global latest state. */
54
+ private observe;
55
+ /** Require shared graph approval and full current standing over the exact retained credential views. */
56
+ verifyCurrent(grant: string): Operation<AcdcV2Verification>;
57
+ }
58
+ //# sourceMappingURL=acdc-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acdc-v2.d.ts","sourceRoot":"","sources":["../../src/src/acdc-v2.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAmE,KAAK,UAAU,EAAY,MAAM,SAAS,CAAC;AACrH,OAAO,EAAQ,KAAK,SAAS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,GAAG;IACjB,QAAQ,CAAC,GAAG,EAAE,SAAS;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,qBAAqB;gBAL9B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,qBAAqB;IAczC,2GAA2G;IAC3G,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB;IA4BtD,8GAA8G;IAC9G,OAAO,CAAE,OAAO;IAqChB,wGAAwG;IACvG,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC;CA4G7D"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Sally-like verifier agent pipeline.
3
+ *
4
+ * Source of truth:
5
+ * - accepted `/ipex/grant` EXNs in `Baser.exns`
6
+ * - embedded credential/TEL/KEL artifacts in `Baser.epath`
7
+ * - saved credentials and TEL state in `Reger`
8
+ * - TEL revocation cues from the shared runtime cue deck
9
+ *
10
+ * `Notifier` rows are intentionally not consumed here; they remain operator
11
+ * visibility, matching the roadmap contract.
12
+ */
13
+ import { type Versionage } from "cesr-ts";
14
+ import type { Reger } from "keri-ts/db";
15
+ import { type AgentCue, Deck, type Habery, type HttpClient, type ProtocolProcessor } from "keri-ts/runtime";
16
+ import { type Operation } from "effection";
17
+ import type { AcdcV2Verifier } from "./acdc-v2.js";
18
+ import type { VerifierCueBaser } from "./cue-store.js";
19
+ import { type VerifierBusinessValidator } from "./policy.js";
20
+ export interface VerifierAgentProcessResult {
21
+ grantsQueued: number;
22
+ revocationsQueued: number;
23
+ presentationsReady: number;
24
+ revocationsReady: number;
25
+ webhooksSent: number;
26
+ webhooksFailed: number;
27
+ /** Business-policy refusals in this pass; accepted protocol evidence remains valid and saved. */
28
+ rejected: number;
29
+ }
30
+ /**
31
+ * Verifier business/webhook settings; stores, intake, HTTP, time and validators are explicit dependencies.
32
+ */
33
+ export interface VerifierAgentOptions {
34
+ /** Webhook destination selected by the verifier operator. */
35
+ hook: string;
36
+ /** Attachment genus of grant children, independent of legacy EXN framing. */
37
+ gvrsn?: Versionage;
38
+ /** Local workflow expiry window in milliseconds. */
39
+ timeoutMs?: number;
40
+ /** Require a schema-specific validator before admitting a credential. */
41
+ requireKnownSchemas?: boolean;
42
+ /** Concrete ACDC v2 evidence/current-source owner; omitted keeps the legacy workflow. */
43
+ acdcV2?: AcdcV2Verifier;
44
+ }
45
+ /** Sally-like verifier processor for one `Habery`/`Reger` runtime. */
46
+ export declare class VerifierAgent {
47
+ /** Borrowed identities and accepted exchange/KEL state. */
48
+ readonly hby: Habery;
49
+ /** Borrowed credential and TEL evidence store used to establish current credential state. */
50
+ readonly reger: Reger;
51
+ /** Verifier workflow store for pending, ready and acknowledged webhook records. */
52
+ readonly cdb: VerifierCueBaser;
53
+ /** Borrowed protocol dispatch and escrow owner; artifact intake owns its own parser and Kevery. */
54
+ readonly protocol: ProtocolProcessor;
55
+ /** Application cue flow; this owner consumes revocation cues and preserves unrelated records. */
56
+ readonly cues: Deck<AgentCue>;
57
+ /** Borrowed scoped HTTP client used for webhook attempts. */
58
+ readonly http: HttpClient;
59
+ /** Borrowed epoch-millisecond source used for webhook timestamps and expiry. */
60
+ readonly now: () => number;
61
+ /** Configured webhook destination, independent of protocol peer routing. */
62
+ readonly hook: string;
63
+ /** Attachment genus used when settling accepted grant artifacts. */
64
+ readonly gvrsn: Versionage;
65
+ /** Existing workflow expiry window; elapsed time is measured by the injected clock. */
66
+ readonly timeoutMs: number;
67
+ /** Schema-specific business checks copied from configuration at construction. */
68
+ readonly validators: Record<string, VerifierBusinessValidator>;
69
+ /** Reject credentials without a configured schema validator when explicitly enabled. */
70
+ readonly requireKnownSchemas: boolean;
71
+ readonly acdcV2?: AcdcV2Verifier;
72
+ /**
73
+ * Borrow the configured stores, protocol owner and webhook policy; open no runtime or background worker.
74
+ *
75
+ * @param hby Borrowed local identities and accepted-state stores.
76
+ * @param reger Borrowed credential/TEL evidence store.
77
+ * @param cdb Borrowed durable pending/ready/acknowledged webhook store.
78
+ * @param protocol Borrowed shared processor for grant prerequisites and scheduled escrow advancement.
79
+ * @param cues Application cue Deck; only matching revocation cues are consumed.
80
+ * @param http Borrowed HTTP implementation selected by composition.
81
+ * @param now Required epoch-millisecond function, bound to its clock; used for local admission, webhook headers and expiry.
82
+ * @param validators Schema-SAID-to-business-validator table, shallow-copied at construction.
83
+ * @param options Webhook URL, child genus, expiry window (default ten minutes), and known-schema policy.
84
+ */
85
+ constructor(hby: Habery, reger: Reger, cdb: VerifierCueBaser, protocol: ProtocolProcessor, cues: Deck<AgentCue>, http: HttpClient, now: () => number, validators: Record<string, VerifierBusinessValidator>, options: VerifierAgentOptions);
86
+ /**
87
+ * Settle verified artifacts and deliver queued webhooks within the caller's operation.
88
+ *
89
+ * @returns Per-pass admission, readiness, webhook and rejection counts; no worker is started.
90
+ */
91
+ processOnce(): Operation<VerifierAgentProcessResult>;
92
+ /**
93
+ * Settle grant artifacts before queuing their verified credentials for webhook delivery.
94
+ *
95
+ * @returns Number of newly queued presentations after artifact intake and verification.
96
+ */
97
+ private scanAcceptedGrants;
98
+ /** ACDC v2 work is keyed by exact Grant, preserving distinct retained partial/full views in the existing tables. */
99
+ private processAcdcV2Grants;
100
+ /** Consume a finite revocation-cue pass, restoring unrelated and failed records in their original order. */
101
+ private processRevokedCues;
102
+ /**
103
+ * Publish existing durable revocation work synchronously; caller retains source ownership through failure.
104
+ *
105
+ * @param cue Accepted credential revocation observation; uses injected local time for workflow admission.
106
+ * @returns One for newly queued work, otherwise zero.
107
+ */
108
+ private queueRevocation;
109
+ /**
110
+ * Recover revocation work from saved credentials backed by an accepted IPEX grant.
111
+ *
112
+ * @returns Number of revocations recovered from accepted persisted evidence.
113
+ */
114
+ private scanPersistedRevocations;
115
+ /** Move accepted, unexpired and business-valid credentials into the ready presentation store. */
116
+ private processPresentations;
117
+ /** Move confirmed revocations into the ready revocation store, retaining unresolved evidence. */
118
+ private processRevocations;
119
+ /** Deliver each ready webhook before recording success or applying its expiry policy. */
120
+ private processReady;
121
+ /** Avoid duplicate presentation work already pending, ready or acknowledged. */
122
+ private hasQueuedOrSent;
123
+ /** Avoid duplicate revocation work already pending, ready or acknowledged. */
124
+ private hasRevocationQueuedOrSent;
125
+ /** Require an accepted grant for this credential before recovering its revocation notification. */
126
+ private hasAcceptedGrantForCredential;
127
+ /** Look up existing ready work by credential without consuming another delivery record. */
128
+ private hasReady;
129
+ /**
130
+ * Compare workflow age against the injected epoch clock.
131
+ * Ready work is attempted before expiry is checked after refusal. Expiry removes
132
+ * that ready row; it is not a permanent tombstone preventing later rediscovery.
133
+ *
134
+ * @param dater Persisted local workflow admission time encoded as a CESR Dater.
135
+ * @returns True only when elapsed injected wall time is strictly greater than timeoutMs.
136
+ */
137
+ private expired;
138
+ }
139
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/src/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAqC,KAAK,UAAU,EAAY,MAAM,SAAS,CAAC;AACvF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EACL,KAAK,QAAQ,EAGb,IAAI,EACJ,KAAK,MAAM,EACX,KAAK,UAAU,EAIf,KAAK,iBAAiB,EAIvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAsB,KAAK,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAIjF,MAA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,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IAC/D,wFAAwF;IACxF,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;IAEjC;;;;;;;;;;;;OAYG;gBAED,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,EACpB,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,MAAM,EACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,EACrD,OAAO,EAAE,oBAAoB;IAiB/B;;;;OAIG;IACF,WAAW,IAAI,SAAS,CAAC,0BAA0B,CAAC;IA2BrD;;;;OAIG;IACH,OAAO,CAAE,kBAAkB;IAyB3B,oHAAoH;IACpH,OAAO,CAAE,mBAAmB;IA4D5B,4GAA4G;IAC5G,OAAO,CAAC,kBAAkB;IAwB1B;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IASvB;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAwBhC,iGAAiG;IACjG,OAAO,CAAC,oBAAoB;IA6C5B,iGAAiG;IACjG,OAAO,CAAC,kBAAkB;IA+B1B,yFAAyF;IACzF,OAAO,CAAE,YAAY;IAqCrB,gFAAgF;IAChF,OAAO,CAAC,eAAe;IAMvB,8EAA8E;IAC9E,OAAO,CAAC,yBAAyB;IAMjC,mGAAmG;IACnG,OAAO,CAAC,6BAA6B;IASrC,2FAA2F;IAC3F,OAAO,CAAC,QAAQ;IAYhB;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO;CAGhB"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Sally-like verifier communication cue database.
3
+ *
4
+ * These application records remain outside protocol Baser/Reger evidence.
5
+ * ack/rack mark local HTTP success, not business receipts or KERI acknowledgements.
6
+ * This is Sally-inspired workflow state, not a claim of exact Sally storage parity.
7
+ */
8
+ import { Dater, Prefixer, SerderACDC } from "cesr-ts";
9
+ import { CesrSuber, LMDBer, type LMDBerOptions, SerderSuber } from "keri-ts/db";
10
+ import { type Operation } from "effection";
11
+ /** Options for opening the verifier cue sidecar. */
12
+ export interface VerifierCueBaserOptions extends LMDBerOptions {
13
+ compat?: boolean;
14
+ }
15
+ /** Counts of queued verifier communication work. */
16
+ export interface VerifierCueCounts {
17
+ senders: number;
18
+ iss: number;
19
+ rev: number;
20
+ recv: number;
21
+ revk: number;
22
+ ack: number;
23
+ rack: number;
24
+ }
25
+ /** Durable local workflow records for pending, ready and delivered webhook work. */
26
+ export declare class VerifierCueBaser extends LMDBer {
27
+ snd: CesrSuber<Prefixer>;
28
+ iss: CesrSuber<Dater>;
29
+ rev: CesrSuber<Dater>;
30
+ recv: SerderSuber<SerderACDC>;
31
+ revk: SerderSuber<SerderACDC>;
32
+ ack: SerderSuber<SerderACDC>;
33
+ rack: SerderSuber<SerderACDC>;
34
+ static readonly TailDirPath = "keri/verifier";
35
+ static readonly AltTailDirPath = ".tufa/verifier";
36
+ static readonly CompatAltTailDirPath = ".keri/verifier";
37
+ static readonly TempPrefix = "keri_verifier_";
38
+ constructor(options?: VerifierCueBaserOptions);
39
+ /** Open ordinary LMDB storage and bind this application's typed tables. */
40
+ reopen(options?: VerifierCueBaserOptions): Operation<boolean>;
41
+ /** Clear workflow records, including the existing local delivered markers. */
42
+ clearEscrows(): void;
43
+ /** Snapshot application row counts for command output, never protocol acceptance. */
44
+ getCounts(): VerifierCueCounts;
45
+ }
46
+ /** Open a verifier cue sidecar and return the ready-to-use databaser. */
47
+ export declare function createVerifierCueBaser(options?: VerifierCueBaserOptions): Operation<VerifierCueBaser>;
48
+ //# sourceMappingURL=cue-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cue-store.d.ts","sourceRoot":"","sources":["../../src/src/cue-store.ts"],"names":[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CAAC;IAgB3E,8EAA8E;IAC9E,YAAY,IAAI,IAAI;IASpB,qFAAqF;IACrF,SAAS,IAAI,iBAAiB;CAW/B;AAED,yEAAyE;AACzE,wBAAiB,sBAAsB,CACrC,OAAO,GAAE,uBAA4B,GACpC,SAAS,CAAC,gBAAgB,CAAC,CAO7B"}
@@ -0,0 +1,16 @@
1
+ /** Operator business acceptance, independent of protocol validity and evidence persistence. */
2
+ import type { SerderACDC } from "cesr-ts";
3
+ import type { Reger } from "keri-ts/db";
4
+ import type { Habery } from "keri-ts/runtime";
5
+ export interface VerifierBusinessValidatorContext {
6
+ hby: Habery;
7
+ reger: Reger;
8
+ }
9
+ export type VerifierBusinessValidator = (creder: SerderACDC, context: VerifierBusinessValidatorContext) => boolean | string | void;
10
+ /** Return a business refusal reason without modifying accepted protocol evidence. */
11
+ export declare function validateCredential(creder: SerderACDC, validators: Record<string, VerifierBusinessValidator>, context: VerifierBusinessValidatorContext, requireKnownSchemas: boolean): string | null;
12
+ /** Build validators from a local JSON config object. */
13
+ export declare function validatorsFromVerifierConfig(config: unknown): Record<string, VerifierBusinessValidator>;
14
+ /** Match the application's supported schema-SAID projection for policy and webhook consumers. */
15
+ export declare function credentialSchema(creder: SerderACDC): string;
16
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/src/policy.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,gCAAgC;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,MAAM,yBAAyB,GAAG,CACtC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,gCAAgC,KACtC,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;AAE7B,qFAAqF;AACrF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,EACrD,OAAO,EAAE,gCAAgC,EACzC,mBAAmB,EAAE,OAAO,GAC3B,MAAM,GAAG,IAAI,CAcf;AAED,wDAAwD;AACxD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,GACd,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAkB3C;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAG3D"}
@@ -0,0 +1,14 @@
1
+ /** Business notification JSON and one scoped status-only HTTP attempt. */
2
+ import type { SerderACDC } from "cesr-ts";
3
+ import { type Operation } from "effection";
4
+ import { type HttpClient, type VcStateRecordShape } from "keri-ts/runtime";
5
+ export interface VerifierWebhookBody {
6
+ action: "iss" | "rev";
7
+ actor: string;
8
+ data: Record<string, unknown>;
9
+ }
10
+ /** Project an accepted credential and selected revocation state without changing protocol evidence. */
11
+ export declare function webhookBody(creder: SerderACDC, action: "iss" | "rev", state: VcStateRecordShape | null): VerifierWebhookBody;
12
+ /** Return HTTP success only after response cleanup; no receipt or exactly-once delivery is inferred. */
13
+ export declare function postWebhook(http: HttpClient, now: () => number, hook: string, body: VerifierWebhookBody): Operation<boolean>;
14
+ //# sourceMappingURL=webhook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/src/webhook.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,KAAK,UAAU,EAAkB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG3F,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,uGAAuG;AACvG,wBAAgB,WAAW,CACzB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,KAAK,GAAG,KAAK,EACrB,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAC/B,mBAAmB,CAIrB;AAyBD,wGAAwG;AACxG,wBAAiB,WAAW,CAC1B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,mBAAmB,GACxB,SAAS,CAAC,OAAO,CAAC,CAoBpB"}