autotel-pact 3.0.0 → 5.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.
- package/dist/attrs-DbCs1ou0.cjs +61 -0
- package/dist/attrs-DbCs1ou0.cjs.map +1 -0
- package/dist/attrs-ElwK54Ym.js +43 -0
- package/dist/attrs-ElwK54Ym.js.map +1 -0
- package/dist/audit.cjs +155 -394
- package/dist/audit.cjs.map +1 -1
- package/dist/audit.d.cts +15 -13
- package/dist/audit.d.cts.map +1 -0
- package/dist/audit.d.ts +15 -13
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +153 -388
- package/dist/audit.js.map +1 -1
- package/dist/auto-wrap.cjs +206 -240
- package/dist/auto-wrap.cjs.map +1 -1
- package/dist/auto-wrap.d.cts +9 -7
- package/dist/auto-wrap.d.cts.map +1 -0
- package/dist/auto-wrap.d.ts +9 -7
- package/dist/auto-wrap.d.ts.map +1 -0
- package/dist/auto-wrap.js +205 -233
- package/dist/auto-wrap.js.map +1 -1
- package/dist/broker.cjs +65 -68
- package/dist/broker.cjs.map +1 -1
- package/dist/broker.d.cts +11 -9
- package/dist/broker.d.cts.map +1 -0
- package/dist/broker.d.ts +11 -9
- package/dist/broker.d.ts.map +1 -0
- package/dist/broker.js +64 -67
- package/dist/broker.js.map +1 -1
- package/dist/cli.cjs +166 -620
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +3 -2
- package/dist/cli.d.cts.map +1 -0
- package/dist/cli.d.ts +3 -2
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +165 -614
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +245 -952
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +90 -86
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +90 -86
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +216 -918
- package/dist/index.js.map +1 -1
- package/dist/labels-0Cwk5E-8.cjs +41 -0
- package/dist/labels-0Cwk5E-8.cjs.map +1 -0
- package/dist/labels-BQjT_Zrv.js +23 -0
- package/dist/labels-BQjT_Zrv.js.map +1 -0
- package/dist/{ledger-D88TzN1c.d.cts → ledger-BAFsRX6y.d.cts} +8 -6
- package/dist/ledger-BAFsRX6y.d.cts.map +1 -0
- package/dist/ledger-BayQwemz.cjs +267 -0
- package/dist/ledger-BayQwemz.cjs.map +1 -0
- package/dist/{ledger-BuBmfWNc.d.ts → ledger-Bzh_6tbV.d.ts} +8 -6
- package/dist/ledger-Bzh_6tbV.d.ts.map +1 -0
- package/dist/ledger-sII3Ig3Y.js +174 -0
- package/dist/ledger-sII3Ig3Y.js.map +1 -0
- package/dist/pact-file-B8QjVrC7.cjs +76 -0
- package/dist/pact-file-B8QjVrC7.cjs.map +1 -0
- package/dist/pact-file-CkE4NFZ1.js +57 -0
- package/dist/pact-file-CkE4NFZ1.js.map +1 -0
- package/dist/processor.cjs +112 -185
- package/dist/processor.cjs.map +1 -1
- package/dist/processor.d.cts +41 -40
- package/dist/processor.d.cts.map +1 -0
- package/dist/processor.d.ts +41 -40
- package/dist/processor.d.ts.map +1 -0
- package/dist/processor.js +111 -179
- package/dist/processor.js.map +1 -1
- package/dist/provider.cjs +90 -205
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.d.cts +26 -25
- package/dist/provider.d.cts.map +1 -0
- package/dist/provider.d.ts +26 -25
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +88 -199
- package/dist/provider.js.map +1 -1
- package/dist/tag.cjs +14 -44
- package/dist/tag.cjs.map +1 -1
- package/dist/tag.d.cts +4 -2
- package/dist/tag.d.cts.map +1 -0
- package/dist/tag.d.ts +4 -2
- package/dist/tag.d.ts.map +1 -0
- package/dist/tag.js +13 -42
- package/dist/tag.js.map +1 -1
- package/dist/types-D_0kgK2e.d.cts +154 -0
- package/dist/types-D_0kgK2e.d.cts.map +1 -0
- package/dist/types-D_0kgK2e.d.ts +154 -0
- package/dist/types-D_0kgK2e.d.ts.map +1 -0
- package/package.json +6 -6
- package/dist/types-BHGiwqcp.d.cts +0 -157
- package/dist/types-BHGiwqcp.d.ts +0 -157
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/attrs.ts
|
|
3
|
+
/**
|
|
4
|
+
* Attribute keys for Pact interactions. Centralised so the namespace is
|
|
5
|
+
* a single source of truth and is forward-compatible with eventual OTel
|
|
6
|
+
* semantic conventions.
|
|
7
|
+
*/
|
|
8
|
+
const PACT_ATTRS = {
|
|
9
|
+
CONSUMER: "pact.consumer",
|
|
10
|
+
PROVIDER: "pact.provider",
|
|
11
|
+
KIND: "pact.kind",
|
|
12
|
+
INTERACTION_DESCRIPTION: "pact.interaction.description",
|
|
13
|
+
INTERACTION_ID: "pact.interaction.id",
|
|
14
|
+
INTERACTION_STATES: "pact.interaction.states",
|
|
15
|
+
CONTRACT_FILE: "pact.contract.file",
|
|
16
|
+
OUTCOME: "pact.outcome"
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Build the set of attributes to stamp on a span when an interaction is
|
|
20
|
+
* about to be exercised. `outcome` is added later by the wrapper.
|
|
21
|
+
*/
|
|
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;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Helper that returns just the outcome attribute — stamped after the
|
|
36
|
+
* handler resolves or rejects.
|
|
37
|
+
*/
|
|
38
|
+
function outcomeAttribute(outcome) {
|
|
39
|
+
return { [PACT_ATTRS.OUTCOME]: outcome };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
Object.defineProperty(exports, 'PACT_ATTRS', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return PACT_ATTRS;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, 'buildPactAttributes', {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return buildPactAttributes;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, 'outcomeAttribute', {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return outcomeAttribute;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=attrs-DbCs1ou0.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attrs-DbCs1ou0.cjs","names":[],"sources":["../src/attrs.ts"],"sourcesContent":["import type { PactInteractionMeta, PactOutcome } from './types.js';\n\n/**\n * Attribute keys for Pact interactions. Centralised so the namespace is\n * a single source of truth and is forward-compatible with eventual OTel\n * semantic conventions.\n */\nexport const PACT_ATTRS = {\n CONSUMER: 'pact.consumer',\n PROVIDER: 'pact.provider',\n KIND: 'pact.kind',\n INTERACTION_DESCRIPTION: 'pact.interaction.description',\n INTERACTION_ID: 'pact.interaction.id',\n INTERACTION_STATES: 'pact.interaction.states',\n CONTRACT_FILE: 'pact.contract.file',\n OUTCOME: 'pact.outcome',\n} as const;\n\nexport type PactAttributeKey = (typeof PACT_ATTRS)[keyof typeof PACT_ATTRS];\n\n/**\n * Build the set of attributes to stamp on a span when an interaction is\n * about to be exercised. `outcome` is added later by the wrapper.\n */\nexport function buildPactAttributes(\n meta: PactInteractionMeta,\n opts: { contractFile?: string } = {},\n): Record<string, string | string[]> {\n const attrs: Record<string, string | string[]> = {\n [PACT_ATTRS.CONSUMER]: meta.consumer,\n [PACT_ATTRS.PROVIDER]: meta.provider,\n [PACT_ATTRS.KIND]: meta.kind,\n [PACT_ATTRS.INTERACTION_DESCRIPTION]: meta.description,\n [PACT_ATTRS.INTERACTION_STATES]: meta.states,\n };\n if (opts.contractFile) {\n attrs[PACT_ATTRS.CONTRACT_FILE] = opts.contractFile;\n }\n if (meta.interactionId) {\n attrs[PACT_ATTRS.INTERACTION_ID] = meta.interactionId;\n }\n return attrs;\n}\n\n/**\n * Helper that returns just the outcome attribute — stamped after the\n * handler resolves or rejects.\n */\nexport function outcomeAttribute(\n outcome: PactOutcome,\n): Record<string, string> {\n return { [PACT_ATTRS.OUTCOME]: outcome };\n}\n"],"mappings":";;;;;;;AAOA,MAAa,aAAa;CACxB,UAAU;CACV,UAAU;CACV,MAAM;CACN,yBAAyB;CACzB,gBAAgB;CAChB,oBAAoB;CACpB,eAAe;CACf,SAAS;AACX;;;;;AAQA,SAAgB,oBACd,MACA,OAAkC,CAAC,GACA;CACnC,MAAM,QAA2C;GAC9C,WAAW,WAAW,KAAK;GAC3B,WAAW,WAAW,KAAK;GAC3B,WAAW,OAAO,KAAK;GACvB,WAAW,0BAA0B,KAAK;GAC1C,WAAW,qBAAqB,KAAK;CACxC;CACA,IAAI,KAAK,cACP,MAAM,WAAW,iBAAiB,KAAK;CAEzC,IAAI,KAAK,eACP,MAAM,WAAW,kBAAkB,KAAK;CAE1C,OAAO;AACT;;;;;AAMA,SAAgB,iBACd,SACwB;CACxB,OAAO,GAAG,WAAW,UAAU,QAAQ;AACzC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/attrs.ts
|
|
2
|
+
/**
|
|
3
|
+
* Attribute keys for Pact interactions. Centralised so the namespace is
|
|
4
|
+
* a single source of truth and is forward-compatible with eventual OTel
|
|
5
|
+
* semantic conventions.
|
|
6
|
+
*/
|
|
7
|
+
const PACT_ATTRS = {
|
|
8
|
+
CONSUMER: "pact.consumer",
|
|
9
|
+
PROVIDER: "pact.provider",
|
|
10
|
+
KIND: "pact.kind",
|
|
11
|
+
INTERACTION_DESCRIPTION: "pact.interaction.description",
|
|
12
|
+
INTERACTION_ID: "pact.interaction.id",
|
|
13
|
+
INTERACTION_STATES: "pact.interaction.states",
|
|
14
|
+
CONTRACT_FILE: "pact.contract.file",
|
|
15
|
+
OUTCOME: "pact.outcome"
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Build the set of attributes to stamp on a span when an interaction is
|
|
19
|
+
* about to be exercised. `outcome` is added later by the wrapper.
|
|
20
|
+
*/
|
|
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;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Helper that returns just the outcome attribute — stamped after the
|
|
35
|
+
* handler resolves or rejects.
|
|
36
|
+
*/
|
|
37
|
+
function outcomeAttribute(outcome) {
|
|
38
|
+
return { [PACT_ATTRS.OUTCOME]: outcome };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { buildPactAttributes as n, outcomeAttribute as r, PACT_ATTRS as t };
|
|
43
|
+
//# sourceMappingURL=attrs-ElwK54Ym.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attrs-ElwK54Ym.js","names":[],"sources":["../src/attrs.ts"],"sourcesContent":["import type { PactInteractionMeta, PactOutcome } from './types.js';\n\n/**\n * Attribute keys for Pact interactions. Centralised so the namespace is\n * a single source of truth and is forward-compatible with eventual OTel\n * semantic conventions.\n */\nexport const PACT_ATTRS = {\n CONSUMER: 'pact.consumer',\n PROVIDER: 'pact.provider',\n KIND: 'pact.kind',\n INTERACTION_DESCRIPTION: 'pact.interaction.description',\n INTERACTION_ID: 'pact.interaction.id',\n INTERACTION_STATES: 'pact.interaction.states',\n CONTRACT_FILE: 'pact.contract.file',\n OUTCOME: 'pact.outcome',\n} as const;\n\nexport type PactAttributeKey = (typeof PACT_ATTRS)[keyof typeof PACT_ATTRS];\n\n/**\n * Build the set of attributes to stamp on a span when an interaction is\n * about to be exercised. `outcome` is added later by the wrapper.\n */\nexport function buildPactAttributes(\n meta: PactInteractionMeta,\n opts: { contractFile?: string } = {},\n): Record<string, string | string[]> {\n const attrs: Record<string, string | string[]> = {\n [PACT_ATTRS.CONSUMER]: meta.consumer,\n [PACT_ATTRS.PROVIDER]: meta.provider,\n [PACT_ATTRS.KIND]: meta.kind,\n [PACT_ATTRS.INTERACTION_DESCRIPTION]: meta.description,\n [PACT_ATTRS.INTERACTION_STATES]: meta.states,\n };\n if (opts.contractFile) {\n attrs[PACT_ATTRS.CONTRACT_FILE] = opts.contractFile;\n }\n if (meta.interactionId) {\n attrs[PACT_ATTRS.INTERACTION_ID] = meta.interactionId;\n }\n return attrs;\n}\n\n/**\n * Helper that returns just the outcome attribute — stamped after the\n * handler resolves or rejects.\n */\nexport function outcomeAttribute(\n outcome: PactOutcome,\n): Record<string, string> {\n return { [PACT_ATTRS.OUTCOME]: outcome };\n}\n"],"mappings":";;;;;;AAOA,MAAa,aAAa;CACxB,UAAU;CACV,UAAU;CACV,MAAM;CACN,yBAAyB;CACzB,gBAAgB;CAChB,oBAAoB;CACpB,eAAe;CACf,SAAS;AACX;;;;;AAQA,SAAgB,oBACd,MACA,OAAkC,CAAC,GACA;CACnC,MAAM,QAA2C;GAC9C,WAAW,WAAW,KAAK;GAC3B,WAAW,WAAW,KAAK;GAC3B,WAAW,OAAO,KAAK;GACvB,WAAW,0BAA0B,KAAK;GAC1C,WAAW,qBAAqB,KAAK;CACxC;CACA,IAAI,KAAK,cACP,MAAM,WAAW,iBAAiB,KAAK;CAEzC,IAAI,KAAK,eACP,MAAM,WAAW,kBAAkB,KAAK;CAE1C,OAAO;AACT;;;;;AAMA,SAAgB,iBACd,SACwB;CACxB,OAAO,GAAG,WAAW,UAAU,QAAQ;AACzC"}
|