autotel-pact 14.0.1 → 16.0.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.
@@ -19,16 +19,17 @@ const PACT_ATTRS = {
19
19
  * about to be exercised. `outcome` is added later by the wrapper.
20
20
  */
21
21
  function buildPactAttributes(meta, opts = {}) {
22
- const attrs = {
23
- [PACT_ATTRS.CONSUMER]: meta.consumer,
24
- [PACT_ATTRS.PROVIDER]: meta.provider,
25
- [PACT_ATTRS.KIND]: meta.kind,
26
- [PACT_ATTRS.INTERACTION_DESCRIPTION]: meta.description,
27
- [PACT_ATTRS.INTERACTION_STATES]: meta.states
28
- };
29
- if (opts.contractFile) attrs[PACT_ATTRS.CONTRACT_FILE] = opts.contractFile;
30
- if (meta.interactionId) attrs[PACT_ATTRS.INTERACTION_ID] = meta.interactionId;
31
- return attrs;
22
+ const optional = [];
23
+ if (opts.contractFile) optional.push([PACT_ATTRS.CONTRACT_FILE, opts.contractFile]);
24
+ if (meta.interactionId) optional.push([PACT_ATTRS.INTERACTION_ID, meta.interactionId]);
25
+ return Object.fromEntries([
26
+ [PACT_ATTRS.CONSUMER, meta.consumer],
27
+ [PACT_ATTRS.PROVIDER, meta.provider],
28
+ [PACT_ATTRS.KIND, meta.kind],
29
+ [PACT_ATTRS.INTERACTION_DESCRIPTION, meta.description],
30
+ [PACT_ATTRS.INTERACTION_STATES, meta.states],
31
+ ...optional
32
+ ]);
32
33
  }
33
34
  /**
34
35
  * Helper that returns just the outcome attribute — stamped after the
@@ -20,16 +20,17 @@ const PACT_ATTRS = {
20
20
  * about to be exercised. `outcome` is added later by the wrapper.
21
21
  */
22
22
  function buildPactAttributes(meta, opts = {}) {
23
- const attrs = {
24
- [PACT_ATTRS.CONSUMER]: meta.consumer,
25
- [PACT_ATTRS.PROVIDER]: meta.provider,
26
- [PACT_ATTRS.KIND]: meta.kind,
27
- [PACT_ATTRS.INTERACTION_DESCRIPTION]: meta.description,
28
- [PACT_ATTRS.INTERACTION_STATES]: meta.states
29
- };
30
- if (opts.contractFile) attrs[PACT_ATTRS.CONTRACT_FILE] = opts.contractFile;
31
- if (meta.interactionId) attrs[PACT_ATTRS.INTERACTION_ID] = meta.interactionId;
32
- return attrs;
23
+ const optional = [];
24
+ if (opts.contractFile) optional.push([PACT_ATTRS.CONTRACT_FILE, opts.contractFile]);
25
+ if (meta.interactionId) optional.push([PACT_ATTRS.INTERACTION_ID, meta.interactionId]);
26
+ return Object.fromEntries([
27
+ [PACT_ATTRS.CONSUMER, meta.consumer],
28
+ [PACT_ATTRS.PROVIDER, meta.provider],
29
+ [PACT_ATTRS.KIND, meta.kind],
30
+ [PACT_ATTRS.INTERACTION_DESCRIPTION, meta.description],
31
+ [PACT_ATTRS.INTERACTION_STATES, meta.states],
32
+ ...optional
33
+ ]);
33
34
  }
34
35
  /**
35
36
  * Helper that returns just the outcome attribute — stamped after the
package/dist/audit.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { d as PactInteractionKey, i as BrokerVerification, n as AuditMatrix, s as LedgerRecord } from "./types-DpHqSzxb.cjs";
1
+ import { d as PactInteractionKey, i as BrokerVerification, n as AuditMatrix, s as LedgerRecord } from "./types-ylkoxFXB.cjs";
2
2
  import { BrokerConfig } from "./broker.cjs";
3
- import { t as LedgerOptions } from "./ledger-yzVOA9iE.cjs";
3
+ import { t as LedgerOptions } from "./ledger-BBxcf9SV.cjs";
4
4
  //#region src/audit.d.ts
5
5
  interface AuditOptions extends LedgerOptions {
6
6
  pactsDir?: string;
package/dist/audit.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { d as PactInteractionKey, i as BrokerVerification, n as AuditMatrix, s as LedgerRecord } from "./types-DpHqSzxb.js";
1
+ import { d as PactInteractionKey, i as BrokerVerification, n as AuditMatrix, s as LedgerRecord } from "./types-ylkoxFXB.js";
2
2
  import { BrokerConfig } from "./broker.js";
3
- import { t as LedgerOptions } from "./ledger-CBUbpQr-.js";
3
+ import { t as LedgerOptions } from "./ledger-iDI3Mq4i.js";
4
4
  //#region src/audit.d.ts
5
5
  interface AuditOptions extends LedgerOptions {
6
6
  pactsDir?: string;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_ledger = require('./ledger-BayQwemz.cjs');
3
- const require_attrs = require('./attrs-DbCs1ou0.cjs');
3
+ const require_attrs = require('./attrs-DkYI6Fhz.cjs');
4
4
  let autotel = require("autotel");
5
5
  let node_module = require("node:module");
6
6
 
@@ -36,12 +36,22 @@
36
36
  * cleanly. The same setup file can stay in place for a repo whose
37
37
  * non-contract test packages don't have Pact as a dependency.
38
38
  */
39
+ /**
40
+ * A Pact-JS prototype as this file patches it. Pact-JS is an optional peer, so
41
+ * its classes are reached through the module object rather than imported, and
42
+ * each method is captured and replaced by name.
43
+ */
44
+ type PactPrototype = Record<string | symbol, PactPrototypeMember>;
45
+ /** A member of a patched prototype: the method being wrapped, or our marker. */
46
+ type PactPrototypeMember = ((...args: never[]) => PactCallResult) | boolean | undefined;
47
+ /** What a patched Pact-JS method returns: a builder, a promise, or nothing. */
48
+ type PactCallResult = object | Promise<unknown> | void;
39
49
  interface PactJsModule {
40
50
  MessageConsumerPact?: {
41
- prototype: Record<string | symbol, unknown>;
51
+ prototype: PactPrototype;
42
52
  };
43
53
  PactV3?: {
44
- prototype: Record<string | symbol, unknown>;
54
+ prototype: PactPrototype;
45
55
  };
46
56
  }
47
57
  /**
@@ -55,4 +65,4 @@ interface PactJsModule {
55
65
  */
56
66
  declare function installAutoWrap(pactModule?: PactJsModule): boolean;
57
67
  //#endregion
58
- export { installAutoWrap };
68
+ export { PactCallResult, PactPrototype, PactPrototypeMember, installAutoWrap };
@@ -36,12 +36,22 @@
36
36
  * cleanly. The same setup file can stay in place for a repo whose
37
37
  * non-contract test packages don't have Pact as a dependency.
38
38
  */
39
+ /**
40
+ * A Pact-JS prototype as this file patches it. Pact-JS is an optional peer, so
41
+ * its classes are reached through the module object rather than imported, and
42
+ * each method is captured and replaced by name.
43
+ */
44
+ type PactPrototype = Record<string | symbol, PactPrototypeMember>;
45
+ /** A member of a patched prototype: the method being wrapped, or our marker. */
46
+ type PactPrototypeMember = ((...args: never[]) => PactCallResult) | boolean | undefined;
47
+ /** What a patched Pact-JS method returns: a builder, a promise, or nothing. */
48
+ type PactCallResult = object | Promise<unknown> | void;
39
49
  interface PactJsModule {
40
50
  MessageConsumerPact?: {
41
- prototype: Record<string | symbol, unknown>;
51
+ prototype: PactPrototype;
42
52
  };
43
53
  PactV3?: {
44
- prototype: Record<string | symbol, unknown>;
54
+ prototype: PactPrototype;
45
55
  };
46
56
  }
47
57
  /**
@@ -55,4 +65,4 @@ interface PactJsModule {
55
65
  */
56
66
  declare function installAutoWrap(pactModule?: PactJsModule): boolean;
57
67
  //#endregion
58
- export { installAutoWrap };
68
+ export { PactCallResult, PactPrototype, PactPrototypeMember, installAutoWrap };
package/dist/auto-wrap.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as buildPactAttributes, r as outcomeAttribute } from "./attrs-ElwK54Ym.js";
1
+ import { n as buildPactAttributes, r as outcomeAttribute } from "./attrs-BxJCnQsN.js";
2
2
  import { c as LEDGER_ENTRY_SPEC, t as appendLedgerEntry } from "./ledger-sII3Ig3Y.js";
3
3
  import { createRequire } from "node:module";
4
4
  import { getActiveSpan, span } from "autotel";
package/dist/broker.cjs CHANGED
@@ -2,10 +2,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  //#region src/broker.ts
4
4
  function authHeaders(config) {
5
- const headers = { Accept: "application/json" };
6
- if (config.token) headers.Authorization = `Bearer ${config.token}`;
7
- else if (config.username && config.password) headers.Authorization = `Basic ${Buffer.from(`${config.username}:${config.password}`).toString("base64")}`;
8
- return headers;
5
+ const auth = [];
6
+ if (config.token) auth.push(["Authorization", `Bearer ${config.token}`]);
7
+ else if (config.username && config.password) {
8
+ const encoded = Buffer.from(`${config.username}:${config.password}`).toString("base64");
9
+ auth.push(["Authorization", `Basic ${encoded}`]);
10
+ }
11
+ return {
12
+ Accept: "application/json",
13
+ ...Object.fromEntries(auth)
14
+ };
9
15
  }
10
16
  function trimBaseUrl(url) {
11
17
  return url.replace(/\/$/, "");
package/dist/broker.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as BrokerVerification } from "./types-DpHqSzxb.cjs";
1
+ import { i as BrokerVerification } from "./types-ylkoxFXB.cjs";
2
2
  //#region src/broker.d.ts
3
3
  interface BrokerConfig {
4
4
  baseUrl: string;
package/dist/broker.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as BrokerVerification } from "./types-DpHqSzxb.js";
1
+ import { i as BrokerVerification } from "./types-ylkoxFXB.js";
2
2
  //#region src/broker.d.ts
3
3
  interface BrokerConfig {
4
4
  baseUrl: string;
package/dist/broker.js CHANGED
@@ -1,9 +1,15 @@
1
1
  //#region src/broker.ts
2
2
  function authHeaders(config) {
3
- const headers = { Accept: "application/json" };
4
- if (config.token) headers.Authorization = `Bearer ${config.token}`;
5
- else if (config.username && config.password) headers.Authorization = `Basic ${Buffer.from(`${config.username}:${config.password}`).toString("base64")}`;
6
- return headers;
3
+ const auth = [];
4
+ if (config.token) auth.push(["Authorization", `Bearer ${config.token}`]);
5
+ else if (config.username && config.password) {
6
+ const encoded = Buffer.from(`${config.username}:${config.password}`).toString("base64");
7
+ auth.push(["Authorization", `Basic ${encoded}`]);
8
+ }
9
+ return {
10
+ Accept: "application/json",
11
+ ...Object.fromEntries(auth)
12
+ };
7
13
  }
8
14
  function trimBaseUrl(url) {
9
15
  return url.replace(/\/$/, "");
package/dist/cli.cjs CHANGED
@@ -174,7 +174,7 @@ async function main(argv) {
174
174
  try {
175
175
  args = parseArgs(argv);
176
176
  } catch (error) {
177
- process.stderr.write(`${error.message}\n\n${HELP_TEXT}`);
177
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n\n${HELP_TEXT}`);
178
178
  return 2;
179
179
  }
180
180
  if (args.help) {
package/dist/cli.js CHANGED
@@ -173,7 +173,7 @@ async function main(argv) {
173
173
  try {
174
174
  args = parseArgs(argv);
175
175
  } catch (error) {
176
- process.stderr.write(`${error.message}\n\n${HELP_TEXT}`);
176
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n\n${HELP_TEXT}`);
177
177
  return 2;
178
178
  }
179
179
  if (args.help) {
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_ledger = require('./ledger-BayQwemz.cjs');
3
- const require_attrs = require('./attrs-DbCs1ou0.cjs');
3
+ const require_attrs = require('./attrs-DkYI6Fhz.cjs');
4
4
  const require_pact_file = require('./pact-file-B8QjVrC7.cjs');
5
5
  const require_provider = require('./provider.cjs');
6
6
  const require_tag = require('./tag.cjs');
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as isProviderVerificationRun, a as InteractionLedgerEntry, c as LedgerRole, d as PactInteractionKey, f as PactInteractionMeta, g as isInteractionLedgerEntry, h as ProviderVerificationRunEntry, i as BrokerVerification, l as LedgerSource, m as PactOutcome, n as AuditMatrix, o as LEDGER_ENTRY_SPEC, p as PactKind, r as AuditRow, s as LedgerRecord, t as AUDIT_MATRIX_SPEC, u as PactFile } from "./types-DpHqSzxb.cjs";
1
+ import { _ as isProviderVerificationRun, a as InteractionLedgerEntry, c as LedgerRole, d as PactInteractionKey, f as PactInteractionMeta, g as isInteractionLedgerEntry, h as ProviderVerificationRunEntry, i as BrokerVerification, l as LedgerSource, m as PactOutcome, n as AuditMatrix, o as LEDGER_ENTRY_SPEC, p as PactKind, r as AuditRow, s as LedgerRecord, t as AUDIT_MATRIX_SPEC, u as PactFile } from "./types-ylkoxFXB.cjs";
2
2
  import { BrokerConfig, ConsumerProviderPair, brokerConfigFromEnv, fetchBrokerVerifications, parseBrokerVerificationResult } from "./broker.cjs";
3
- import { a as flushLedgerWrites, i as appendProviderVerificationFailure, n as appendLedgerEntry, o as ledgerPath, r as appendLedgerEntryAsync, s as readLedger, t as LedgerOptions } from "./ledger-yzVOA9iE.cjs";
3
+ import { a as flushLedgerWrites, i as appendProviderVerificationFailure, n as appendLedgerEntry, o as ledgerPath, r as appendLedgerEntryAsync, s as readLedger, t as LedgerOptions } from "./ledger-BBxcf9SV.cjs";
4
4
  import { AuditOptions, computeAuditMatrix, keyOf, runAudit, runAuditSync } from "./audit.cjs";
5
5
  import { VerifierConstructor, VerifierLike, VerifierOptionsLike, WithProviderVerificationOptions, withProviderVerification } from "./provider.cjs";
6
6
  import { tagPactInteraction } from "./tag.cjs";
@@ -14,7 +14,8 @@ import { PactLedgerProcessorOptions, PactLedgerSpanProcessor, ReadableSpanLike,
14
14
  * at runtime, with `opts.consumer` / `opts.provider` as override fallbacks.
15
15
  */
16
16
  interface MessageConsumerPactLike {
17
- verify: (handler: (message: ReifiedMessage) => Promise<unknown>) => Promise<unknown>;
17
+ /** Runs the handler against the reified message and forwards what it returned. */
18
+ verify: <R>(handler: (message: ReifiedMessage) => Promise<R>) => Promise<R>;
18
19
  /**
19
20
  * Optional fluent metadata appender. Pact-JS's `MessageConsumerPact`
20
21
  * provides this; we use it (when present) to write `interactionId`
@@ -30,7 +31,7 @@ interface MessageConsumerPactLike {
30
31
  interface ReifiedMessage {
31
32
  contents: unknown;
32
33
  description?: string;
33
- metadata?: Record<string, unknown>;
34
+ metadata?: Record<string, string | number | boolean>;
34
35
  providerStates?: Array<{
35
36
  name: string;
36
37
  }>;
@@ -178,12 +179,16 @@ type PactAttributeKey = (typeof PACT_ATTRS)[keyof typeof PACT_ATTRS];
178
179
  */
179
180
  declare function buildPactAttributes(meta: PactInteractionMeta, opts?: {
180
181
  contractFile?: string;
181
- }): Record<string, string | string[]>;
182
+ }): {
183
+ [k: string]: string | string[];
184
+ };
182
185
  /**
183
186
  * Helper that returns just the outcome attribute — stamped after the
184
187
  * handler resolves or rejects.
185
188
  */
186
- declare function outcomeAttribute(outcome: PactOutcome): Record<string, string>;
189
+ declare function outcomeAttribute(outcome: PactOutcome): {
190
+ "pact.outcome": PactOutcome;
191
+ };
187
192
  //#endregion
188
193
  //#region src/pact-file.d.ts
189
194
  /**
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as isProviderVerificationRun, a as InteractionLedgerEntry, c as LedgerRole, d as PactInteractionKey, f as PactInteractionMeta, g as isInteractionLedgerEntry, h as ProviderVerificationRunEntry, i as BrokerVerification, l as LedgerSource, m as PactOutcome, n as AuditMatrix, o as LEDGER_ENTRY_SPEC, p as PactKind, r as AuditRow, s as LedgerRecord, t as AUDIT_MATRIX_SPEC, u as PactFile } from "./types-DpHqSzxb.js";
1
+ import { _ as isProviderVerificationRun, a as InteractionLedgerEntry, c as LedgerRole, d as PactInteractionKey, f as PactInteractionMeta, g as isInteractionLedgerEntry, h as ProviderVerificationRunEntry, i as BrokerVerification, l as LedgerSource, m as PactOutcome, n as AuditMatrix, o as LEDGER_ENTRY_SPEC, p as PactKind, r as AuditRow, s as LedgerRecord, t as AUDIT_MATRIX_SPEC, u as PactFile } from "./types-ylkoxFXB.js";
2
2
  import { BrokerConfig, ConsumerProviderPair, brokerConfigFromEnv, fetchBrokerVerifications, parseBrokerVerificationResult } from "./broker.js";
3
- import { a as flushLedgerWrites, i as appendProviderVerificationFailure, n as appendLedgerEntry, o as ledgerPath, r as appendLedgerEntryAsync, s as readLedger, t as LedgerOptions } from "./ledger-CBUbpQr-.js";
3
+ import { a as flushLedgerWrites, i as appendProviderVerificationFailure, n as appendLedgerEntry, o as ledgerPath, r as appendLedgerEntryAsync, s as readLedger, t as LedgerOptions } from "./ledger-iDI3Mq4i.js";
4
4
  import { AuditOptions, computeAuditMatrix, keyOf, runAudit, runAuditSync } from "./audit.js";
5
5
  import { VerifierConstructor, VerifierLike, VerifierOptionsLike, WithProviderVerificationOptions, withProviderVerification } from "./provider.js";
6
6
  import { tagPactInteraction } from "./tag.js";
@@ -14,7 +14,8 @@ import { PactLedgerProcessorOptions, PactLedgerSpanProcessor, ReadableSpanLike,
14
14
  * at runtime, with `opts.consumer` / `opts.provider` as override fallbacks.
15
15
  */
16
16
  interface MessageConsumerPactLike {
17
- verify: (handler: (message: ReifiedMessage) => Promise<unknown>) => Promise<unknown>;
17
+ /** Runs the handler against the reified message and forwards what it returned. */
18
+ verify: <R>(handler: (message: ReifiedMessage) => Promise<R>) => Promise<R>;
18
19
  /**
19
20
  * Optional fluent metadata appender. Pact-JS's `MessageConsumerPact`
20
21
  * provides this; we use it (when present) to write `interactionId`
@@ -30,7 +31,7 @@ interface MessageConsumerPactLike {
30
31
  interface ReifiedMessage {
31
32
  contents: unknown;
32
33
  description?: string;
33
- metadata?: Record<string, unknown>;
34
+ metadata?: Record<string, string | number | boolean>;
34
35
  providerStates?: Array<{
35
36
  name: string;
36
37
  }>;
@@ -178,12 +179,16 @@ type PactAttributeKey = (typeof PACT_ATTRS)[keyof typeof PACT_ATTRS];
178
179
  */
179
180
  declare function buildPactAttributes(meta: PactInteractionMeta, opts?: {
180
181
  contractFile?: string;
181
- }): Record<string, string | string[]>;
182
+ }): {
183
+ [k: string]: string | string[];
184
+ };
182
185
  /**
183
186
  * Helper that returns just the outcome attribute — stamped after the
184
187
  * handler resolves or rejects.
185
188
  */
186
- declare function outcomeAttribute(outcome: PactOutcome): Record<string, string>;
189
+ declare function outcomeAttribute(outcome: PactOutcome): {
190
+ "pact.outcome": PactOutcome;
191
+ };
187
192
  //#endregion
188
193
  //#region src/pact-file.d.ts
189
194
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as buildPactAttributes, r as outcomeAttribute, t as PACT_ATTRS } from "./attrs-ElwK54Ym.js";
1
+ import { n as buildPactAttributes, r as outcomeAttribute, t as PACT_ATTRS } from "./attrs-BxJCnQsN.js";
2
2
  import { a as ledgerPath, c as LEDGER_ENTRY_SPEC, i as flushLedgerWrites, l as isInteractionLedgerEntry, n as appendLedgerEntryAsync, o as readLedger, r as appendProviderVerificationFailure, s as AUDIT_MATRIX_SPEC, t as appendLedgerEntry, u as isProviderVerificationRun } from "./ledger-sII3Ig3Y.js";
3
3
  import { n as listPactFiles, r as parsePactFile, t as interactionsFromPactFile } from "./pact-file-CkE4NFZ1.js";
4
4
  import { withProviderVerification } from "./provider.js";
@@ -1,4 +1,4 @@
1
- import { h as ProviderVerificationRunEntry, s as LedgerRecord } from "./types-DpHqSzxb.cjs";
1
+ import { h as ProviderVerificationRunEntry, s as LedgerRecord } from "./types-ylkoxFXB.cjs";
2
2
  //#region src/ledger.d.ts
3
3
  interface LedgerOptions {
4
4
  dir?: string;
@@ -1,4 +1,4 @@
1
- import { h as ProviderVerificationRunEntry, s as LedgerRecord } from "./types-DpHqSzxb.js";
1
+ import { h as ProviderVerificationRunEntry, s as LedgerRecord } from "./types-ylkoxFXB.js";
2
2
  //#region src/ledger.d.ts
3
3
  interface LedgerOptions {
4
4
  dir?: string;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_ledger = require('./ledger-BayQwemz.cjs');
3
- const require_attrs = require('./attrs-DbCs1ou0.cjs');
3
+ const require_attrs = require('./attrs-DkYI6Fhz.cjs');
4
4
 
5
5
  //#region src/processor.ts
6
6
  const DEFAULT_MAX_QUEUE = 1024;
@@ -1,8 +1,10 @@
1
- import { t as LedgerOptions } from "./ledger-yzVOA9iE.cjs";
1
+ import { t as LedgerOptions } from "./ledger-BBxcf9SV.cjs";
2
2
  //#region src/processor.d.ts
3
- /** Minimal ReadableSpan shape avoids hard dependency on sdk-trace-base. */
3
+ /** What a span attribute can hold once it has been recorded. */
4
+ type SpanAttributeValue = string | number | boolean | Array<string | number | boolean | null> | undefined;
5
+ /** A ReadableSpan as this processor reads one, without a hard SDK dependency. */
4
6
  interface ReadableSpanLike {
5
- attributes: Record<string, unknown>;
7
+ attributes: Record<string, SpanAttributeValue>;
6
8
  spanContext(): {
7
9
  traceId: string;
8
10
  spanId: string;
@@ -19,8 +21,13 @@ interface SpanLike {
19
21
  spanId: string;
20
22
  };
21
23
  }
22
- /** Opaque parent context — matches OTel SpanProcessor without a hard dependency. */
23
- type OtelContext = unknown;
24
+ /**
25
+ * The parent context OTel hands a span processor. This package never reads it;
26
+ * naming it keeps the SpanProcessor signature matchable without the SDK.
27
+ */
28
+ interface OtelContext {
29
+ getValue?: (key: symbol) => object | string | number | boolean | undefined;
30
+ }
24
31
  interface SpanProcessorLike {
25
32
  onStart(span: SpanLike, parentContext: OtelContext): void;
26
33
  onEnd(span: ReadableSpanLike): void;
@@ -31,7 +38,7 @@ interface PactLedgerProcessorOptions extends LedgerOptions {
31
38
  /** Max queued ledger writes before dropping (default 1024). */
32
39
  maxQueueSize?: number;
33
40
  onDrop?: (reason: 'queue_full') => void;
34
- onWriteError?: (error: unknown) => void;
41
+ onWriteError?: (cause: unknown) => void;
35
42
  onWarn?: (message: string) => void;
36
43
  }
37
44
  /**
@@ -54,4 +61,4 @@ declare class PactLedgerSpanProcessor implements SpanProcessorLike {
54
61
  }
55
62
  declare function createPactLedgerProcessor(opts?: PactLedgerProcessorOptions): PactLedgerSpanProcessor;
56
63
  //#endregion
57
- export { OtelContext, PactLedgerProcessorOptions, PactLedgerSpanProcessor, ReadableSpanLike, SpanLike, SpanProcessorLike, createPactLedgerProcessor };
64
+ export { OtelContext, PactLedgerProcessorOptions, PactLedgerSpanProcessor, ReadableSpanLike, SpanAttributeValue, SpanLike, SpanProcessorLike, createPactLedgerProcessor };
@@ -1,8 +1,10 @@
1
- import { t as LedgerOptions } from "./ledger-CBUbpQr-.js";
1
+ import { t as LedgerOptions } from "./ledger-iDI3Mq4i.js";
2
2
  //#region src/processor.d.ts
3
- /** Minimal ReadableSpan shape avoids hard dependency on sdk-trace-base. */
3
+ /** What a span attribute can hold once it has been recorded. */
4
+ type SpanAttributeValue = string | number | boolean | Array<string | number | boolean | null> | undefined;
5
+ /** A ReadableSpan as this processor reads one, without a hard SDK dependency. */
4
6
  interface ReadableSpanLike {
5
- attributes: Record<string, unknown>;
7
+ attributes: Record<string, SpanAttributeValue>;
6
8
  spanContext(): {
7
9
  traceId: string;
8
10
  spanId: string;
@@ -19,8 +21,13 @@ interface SpanLike {
19
21
  spanId: string;
20
22
  };
21
23
  }
22
- /** Opaque parent context — matches OTel SpanProcessor without a hard dependency. */
23
- type OtelContext = unknown;
24
+ /**
25
+ * The parent context OTel hands a span processor. This package never reads it;
26
+ * naming it keeps the SpanProcessor signature matchable without the SDK.
27
+ */
28
+ interface OtelContext {
29
+ getValue?: (key: symbol) => object | string | number | boolean | undefined;
30
+ }
24
31
  interface SpanProcessorLike {
25
32
  onStart(span: SpanLike, parentContext: OtelContext): void;
26
33
  onEnd(span: ReadableSpanLike): void;
@@ -31,7 +38,7 @@ interface PactLedgerProcessorOptions extends LedgerOptions {
31
38
  /** Max queued ledger writes before dropping (default 1024). */
32
39
  maxQueueSize?: number;
33
40
  onDrop?: (reason: 'queue_full') => void;
34
- onWriteError?: (error: unknown) => void;
41
+ onWriteError?: (cause: unknown) => void;
35
42
  onWarn?: (message: string) => void;
36
43
  }
37
44
  /**
@@ -54,4 +61,4 @@ declare class PactLedgerSpanProcessor implements SpanProcessorLike {
54
61
  }
55
62
  declare function createPactLedgerProcessor(opts?: PactLedgerProcessorOptions): PactLedgerSpanProcessor;
56
63
  //#endregion
57
- export { OtelContext, PactLedgerProcessorOptions, PactLedgerSpanProcessor, ReadableSpanLike, SpanLike, SpanProcessorLike, createPactLedgerProcessor };
64
+ export { OtelContext, PactLedgerProcessorOptions, PactLedgerSpanProcessor, ReadableSpanLike, SpanAttributeValue, SpanLike, SpanProcessorLike, createPactLedgerProcessor };
package/dist/processor.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACT_ATTRS } from "./attrs-ElwK54Ym.js";
1
+ import { t as PACT_ATTRS } from "./attrs-BxJCnQsN.js";
2
2
  import { c as LEDGER_ENTRY_SPEC, i as flushLedgerWrites, n as appendLedgerEntryAsync } from "./ledger-sII3Ig3Y.js";
3
3
 
4
4
  //#region src/processor.ts
package/dist/provider.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_ledger = require('./ledger-BayQwemz.cjs');
3
- const require_attrs = require('./attrs-DbCs1ou0.cjs');
3
+ const require_attrs = require('./attrs-DkYI6Fhz.cjs');
4
4
  const require_pact_file = require('./pact-file-B8QjVrC7.cjs');
5
5
  let autotel = require("autotel");
6
6
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { t as LedgerOptions } from "./ledger-yzVOA9iE.cjs";
1
+ import { t as LedgerOptions } from "./ledger-BBxcf9SV.cjs";
2
2
  //#region src/wrapper-provider.d.ts
3
3
  /**
4
4
  * Minimal Verifier options — structural match for @pact-foundation/pact Verifier.
@@ -8,11 +8,17 @@ interface VerifierOptionsLike {
8
8
  providerBaseUrl: string;
9
9
  pactUrls?: string[];
10
10
  logLevel?: string;
11
- [key: string]: unknown;
11
+ /** Pact-JS accepts more options than this package names; they pass through. */
12
+ [key: string]: VerifierOptionValue;
12
13
  }
14
+ /** What a Pact-JS verifier option can hold. */
15
+ type VerifierOptionValue = string | number | boolean | Array<string> | Record<string, string> | undefined;
13
16
  interface VerifierLike {
14
- verifyProvider: () => Promise<unknown>;
17
+ /** Resolves with Pact-JS's own verification output, which we do not read. */
18
+ verifyProvider: () => Promise<VerificationOutput>;
15
19
  }
20
+ /** Whatever Pact-JS reports from a verification run. */
21
+ type VerificationOutput = string | object;
16
22
  interface VerifierConstructor {
17
23
  new (options: VerifierOptionsLike): VerifierLike;
18
24
  }
@@ -37,4 +43,4 @@ interface WithProviderVerificationOptions extends LedgerOptions {
37
43
  */
38
44
  declare function withProviderVerification(verifierOpts: VerifierOptionsLike, wrapOpts?: WithProviderVerificationOptions): Promise<void>;
39
45
  //#endregion
40
- export { VerifierConstructor, VerifierLike, VerifierOptionsLike, WithProviderVerificationOptions, withProviderVerification };
46
+ export { VerificationOutput, VerifierConstructor, VerifierLike, VerifierOptionValue, VerifierOptionsLike, WithProviderVerificationOptions, withProviderVerification };
@@ -1,4 +1,4 @@
1
- import { t as LedgerOptions } from "./ledger-CBUbpQr-.js";
1
+ import { t as LedgerOptions } from "./ledger-iDI3Mq4i.js";
2
2
  //#region src/wrapper-provider.d.ts
3
3
  /**
4
4
  * Minimal Verifier options — structural match for @pact-foundation/pact Verifier.
@@ -8,11 +8,17 @@ interface VerifierOptionsLike {
8
8
  providerBaseUrl: string;
9
9
  pactUrls?: string[];
10
10
  logLevel?: string;
11
- [key: string]: unknown;
11
+ /** Pact-JS accepts more options than this package names; they pass through. */
12
+ [key: string]: VerifierOptionValue;
12
13
  }
14
+ /** What a Pact-JS verifier option can hold. */
15
+ type VerifierOptionValue = string | number | boolean | Array<string> | Record<string, string> | undefined;
13
16
  interface VerifierLike {
14
- verifyProvider: () => Promise<unknown>;
17
+ /** Resolves with Pact-JS's own verification output, which we do not read. */
18
+ verifyProvider: () => Promise<VerificationOutput>;
15
19
  }
20
+ /** Whatever Pact-JS reports from a verification run. */
21
+ type VerificationOutput = string | object;
16
22
  interface VerifierConstructor {
17
23
  new (options: VerifierOptionsLike): VerifierLike;
18
24
  }
@@ -37,4 +43,4 @@ interface WithProviderVerificationOptions extends LedgerOptions {
37
43
  */
38
44
  declare function withProviderVerification(verifierOpts: VerifierOptionsLike, wrapOpts?: WithProviderVerificationOptions): Promise<void>;
39
45
  //#endregion
40
- export { VerifierConstructor, VerifierLike, VerifierOptionsLike, WithProviderVerificationOptions, withProviderVerification };
46
+ export { VerificationOutput, VerifierConstructor, VerifierLike, VerifierOptionValue, VerifierOptionsLike, WithProviderVerificationOptions, withProviderVerification };
package/dist/provider.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACT_ATTRS } from "./attrs-ElwK54Ym.js";
1
+ import { t as PACT_ATTRS } from "./attrs-BxJCnQsN.js";
2
2
  import { c as LEDGER_ENTRY_SPEC, r as appendProviderVerificationFailure, t as appendLedgerEntry } from "./ledger-sII3Ig3Y.js";
3
3
  import { r as parsePactFile, t as interactionsFromPactFile } from "./pact-file-CkE4NFZ1.js";
4
4
  import { getActiveSpan, span } from "autotel";
package/dist/tag.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_attrs = require('./attrs-DbCs1ou0.cjs');
2
+ const require_attrs = require('./attrs-DkYI6Fhz.cjs');
3
3
  let autotel = require("autotel");
4
4
 
5
5
  //#region src/tag.ts
package/dist/tag.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { f as PactInteractionMeta } from "./types-DpHqSzxb.cjs";
1
+ import { f as PactInteractionMeta } from "./types-ylkoxFXB.cjs";
2
2
  //#region src/tag.d.ts
3
3
  /**
4
4
  * Stamp `pact.*` attributes on the active span for production observation.
package/dist/tag.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { f as PactInteractionMeta } from "./types-DpHqSzxb.js";
1
+ import { f as PactInteractionMeta } from "./types-ylkoxFXB.js";
2
2
  //#region src/tag.d.ts
3
3
  /**
4
4
  * Stamp `pact.*` attributes on the active span for production observation.
package/dist/tag.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as buildPactAttributes, t as PACT_ATTRS } from "./attrs-ElwK54Ym.js";
1
+ import { n as buildPactAttributes, t as PACT_ATTRS } from "./attrs-BxJCnQsN.js";
2
2
  import { getActiveSpan } from "autotel";
3
3
 
4
4
  //#region src/tag.ts
@@ -79,14 +79,14 @@ interface PactFile {
79
79
  providerStates?: Array<{
80
80
  name: string;
81
81
  }>;
82
- metadata?: Record<string, unknown>;
82
+ metadata?: Record<string, string | number | boolean>;
83
83
  }>;
84
84
  interactions?: Array<{
85
85
  description: string;
86
86
  providerStates?: Array<{
87
87
  name: string;
88
88
  }>;
89
- metadata?: Record<string, unknown>;
89
+ metadata?: Record<string, string | number | boolean>;
90
90
  }>;
91
91
  }
92
92
  interface BrokerVerification {
@@ -79,14 +79,14 @@ interface PactFile {
79
79
  providerStates?: Array<{
80
80
  name: string;
81
81
  }>;
82
- metadata?: Record<string, unknown>;
82
+ metadata?: Record<string, string | number | boolean>;
83
83
  }>;
84
84
  interactions?: Array<{
85
85
  description: string;
86
86
  providerStates?: Array<{
87
87
  name: string;
88
88
  }>;
89
- metadata?: Record<string, unknown>;
89
+ metadata?: Record<string, string | number | boolean>;
90
90
  }>;
91
91
  }
92
92
  interface BrokerVerification {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel-pact",
3
- "version": "14.0.1",
3
+ "version": "16.0.0",
4
4
  "description": "Runtime evidence for Pact contracts — autotel bridge that records which contract interactions were actually exercised, and audits 'contracted but never observed'.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -69,7 +69,7 @@
69
69
  "license": "Apache-2.0",
70
70
  "peerDependencies": {
71
71
  "@pact-foundation/pact": ">=17",
72
- "autotel": "6.4.1"
72
+ "autotel": "7.0.0"
73
73
  },
74
74
  "peerDependenciesMeta": {
75
75
  "@pact-foundation/pact": {
@@ -83,7 +83,7 @@
83
83
  "tsdown": "^0.22.14",
84
84
  "typescript": "^6.0.3",
85
85
  "vitest": "^4.1.10",
86
- "autotel": "6.4.1"
86
+ "autotel": "7.0.0"
87
87
  },
88
88
  "repository": {
89
89
  "type": "git",