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.
Files changed (91) hide show
  1. package/dist/attrs-DbCs1ou0.cjs +61 -0
  2. package/dist/attrs-DbCs1ou0.cjs.map +1 -0
  3. package/dist/attrs-ElwK54Ym.js +43 -0
  4. package/dist/attrs-ElwK54Ym.js.map +1 -0
  5. package/dist/audit.cjs +155 -394
  6. package/dist/audit.cjs.map +1 -1
  7. package/dist/audit.d.cts +15 -13
  8. package/dist/audit.d.cts.map +1 -0
  9. package/dist/audit.d.ts +15 -13
  10. package/dist/audit.d.ts.map +1 -0
  11. package/dist/audit.js +153 -388
  12. package/dist/audit.js.map +1 -1
  13. package/dist/auto-wrap.cjs +206 -240
  14. package/dist/auto-wrap.cjs.map +1 -1
  15. package/dist/auto-wrap.d.cts +9 -7
  16. package/dist/auto-wrap.d.cts.map +1 -0
  17. package/dist/auto-wrap.d.ts +9 -7
  18. package/dist/auto-wrap.d.ts.map +1 -0
  19. package/dist/auto-wrap.js +205 -233
  20. package/dist/auto-wrap.js.map +1 -1
  21. package/dist/broker.cjs +65 -68
  22. package/dist/broker.cjs.map +1 -1
  23. package/dist/broker.d.cts +11 -9
  24. package/dist/broker.d.cts.map +1 -0
  25. package/dist/broker.d.ts +11 -9
  26. package/dist/broker.d.ts.map +1 -0
  27. package/dist/broker.js +64 -67
  28. package/dist/broker.js.map +1 -1
  29. package/dist/cli.cjs +166 -620
  30. package/dist/cli.cjs.map +1 -1
  31. package/dist/cli.d.cts +3 -2
  32. package/dist/cli.d.cts.map +1 -0
  33. package/dist/cli.d.ts +3 -2
  34. package/dist/cli.d.ts.map +1 -0
  35. package/dist/cli.js +165 -614
  36. package/dist/cli.js.map +1 -1
  37. package/dist/index.cjs +245 -952
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +90 -86
  40. package/dist/index.d.cts.map +1 -0
  41. package/dist/index.d.ts +90 -86
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +216 -918
  44. package/dist/index.js.map +1 -1
  45. package/dist/labels-0Cwk5E-8.cjs +41 -0
  46. package/dist/labels-0Cwk5E-8.cjs.map +1 -0
  47. package/dist/labels-BQjT_Zrv.js +23 -0
  48. package/dist/labels-BQjT_Zrv.js.map +1 -0
  49. package/dist/{ledger-D88TzN1c.d.cts → ledger-BAFsRX6y.d.cts} +8 -6
  50. package/dist/ledger-BAFsRX6y.d.cts.map +1 -0
  51. package/dist/ledger-BayQwemz.cjs +267 -0
  52. package/dist/ledger-BayQwemz.cjs.map +1 -0
  53. package/dist/{ledger-BuBmfWNc.d.ts → ledger-Bzh_6tbV.d.ts} +8 -6
  54. package/dist/ledger-Bzh_6tbV.d.ts.map +1 -0
  55. package/dist/ledger-sII3Ig3Y.js +174 -0
  56. package/dist/ledger-sII3Ig3Y.js.map +1 -0
  57. package/dist/pact-file-B8QjVrC7.cjs +76 -0
  58. package/dist/pact-file-B8QjVrC7.cjs.map +1 -0
  59. package/dist/pact-file-CkE4NFZ1.js +57 -0
  60. package/dist/pact-file-CkE4NFZ1.js.map +1 -0
  61. package/dist/processor.cjs +112 -185
  62. package/dist/processor.cjs.map +1 -1
  63. package/dist/processor.d.cts +41 -40
  64. package/dist/processor.d.cts.map +1 -0
  65. package/dist/processor.d.ts +41 -40
  66. package/dist/processor.d.ts.map +1 -0
  67. package/dist/processor.js +111 -179
  68. package/dist/processor.js.map +1 -1
  69. package/dist/provider.cjs +90 -205
  70. package/dist/provider.cjs.map +1 -1
  71. package/dist/provider.d.cts +26 -25
  72. package/dist/provider.d.cts.map +1 -0
  73. package/dist/provider.d.ts +26 -25
  74. package/dist/provider.d.ts.map +1 -0
  75. package/dist/provider.js +88 -199
  76. package/dist/provider.js.map +1 -1
  77. package/dist/tag.cjs +14 -44
  78. package/dist/tag.cjs.map +1 -1
  79. package/dist/tag.d.cts +4 -2
  80. package/dist/tag.d.cts.map +1 -0
  81. package/dist/tag.d.ts +4 -2
  82. package/dist/tag.d.ts.map +1 -0
  83. package/dist/tag.js +13 -42
  84. package/dist/tag.js.map +1 -1
  85. package/dist/types-D_0kgK2e.d.cts +154 -0
  86. package/dist/types-D_0kgK2e.d.cts.map +1 -0
  87. package/dist/types-D_0kgK2e.d.ts +154 -0
  88. package/dist/types-D_0kgK2e.d.ts.map +1 -0
  89. package/package.json +6 -6
  90. package/dist/types-BHGiwqcp.d.cts +0 -157
  91. 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"}