autotel-schema 18.0.1 → 20.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/cli.cjs CHANGED
@@ -21,13 +21,13 @@ var __copyProps = (to, from, except, desc) => {
21
21
  }
22
22
  return to;
23
23
  };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
25
25
  value: mod,
26
26
  enumerable: true
27
27
  }) : target, mod));
28
28
 
29
29
  //#endregion
30
- const require_snapshot = require('./snapshot-BJmrOlMK.cjs');
30
+ const require_snapshot = require('./snapshot-CG3MM2sd.cjs');
31
31
  const require_diff = require('./diff.cjs');
32
32
  let node_fs = require("node:fs");
33
33
  let node_path = require("node:path");
@@ -68,7 +68,9 @@ Commands:
68
68
 
69
69
  Snapshots are produced with serializeSnapshot(contractToSnapshot(contract)).`;
70
70
  function loadDiff(baseline, current) {
71
- return require_diff.diffSnapshots(require_snapshot.parseSnapshot((0, node_fs.readFileSync)(baseline, "utf8")), require_snapshot.parseSnapshot((0, node_fs.readFileSync)(current, "utf8")));
71
+ const prev = require_snapshot.parseSnapshot((0, node_fs.readFileSync)(baseline, "utf8"));
72
+ const next = require_snapshot.parseSnapshot((0, node_fs.readFileSync)(current, "utf8"));
73
+ return require_diff.diffSnapshots(prev, next);
72
74
  }
73
75
  function emit(diff, json) {
74
76
  if (json) console.log(JSON.stringify(diff, null, 2));
package/dist/cli.js CHANGED
@@ -39,7 +39,9 @@ Commands:
39
39
 
40
40
  Snapshots are produced with serializeSnapshot(contractToSnapshot(contract)).`;
41
41
  function loadDiff(baseline, current) {
42
- return diffSnapshots(parseSnapshot(readFileSync(baseline, "utf8")), parseSnapshot(readFileSync(current, "utf8")));
42
+ const prev = parseSnapshot(readFileSync(baseline, "utf8"));
43
+ const next = parseSnapshot(readFileSync(current, "utf8"));
44
+ return diffSnapshots(prev, next);
43
45
  }
44
46
  function emit(diff, json) {
45
47
  if (json) console.log(JSON.stringify(diff, null, 2));
package/dist/diff.cjs CHANGED
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
2
  //#region src/diff.ts
4
3
  /**
5
4
  * How every cross-stability transition is classified. Keyed `prev->next` so all
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_snapshot = require('./snapshot-BJmrOlMK.cjs');
3
- const require_processor = require('./processor-DQvVwsvP.cjs');
2
+ const require_snapshot = require('./snapshot-CG3MM2sd.cjs');
3
+ const require_processor = require('./processor-35CBa8U1.cjs');
4
4
  const require_diff = require('./diff.cjs');
5
5
 
6
6
  //#region src/completeness.ts
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as SNAPSHOT_SPEC, i as SCHEMA_ATTRS, n as parseSnapshot, r as serializeSnapshot, t as contractToSnapshot } from "./snapshot-BFIxChH0.js";
2
- import { _ as proposeScenario, a as hasErrors, c as STABILITIES, d as resolveAttributeSpec, f as checkScenario, g as parseCardinality, h as isScenarioClosed, i as formatViolation, l as allowsAdditionalAttributes, m as formatScenarioResult, n as SchemaValidationSpanProcessor, o as validateSpan, p as evaluateScenario, r as createSchemaValidationProcessor, s as ATTRIBUTE_TYPES, t as SCHEMA_VIOLATION_ATTRS, u as defineContract, v as validateScenarioSpec } from "./processor-PQss56h3.js";
2
+ import { _ as proposeScenario, a as hasErrors, c as STABILITIES, d as resolveAttributeSpec, f as checkScenario, g as parseCardinality, h as isScenarioClosed, i as formatViolation, l as allowsAdditionalAttributes, m as formatScenarioResult, n as SchemaValidationSpanProcessor, o as validateSpan, p as evaluateScenario, r as createSchemaValidationProcessor, s as ATTRIBUTE_TYPES, t as SCHEMA_VIOLATION_ATTRS, u as defineContract, v as validateScenarioSpec } from "./processor-DJA9y_Y8.js";
3
3
  import { diffSnapshots, formatDiff, hasBreakingChanges } from "./diff.js";
4
4
 
5
5
  //#region src/completeness.ts
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/scenario.ts
3
2
  /**
4
3
  * Parse a cardinality shorthand: `'exactly 1'`, `'at least 1'`, `'at most 3'`,
@@ -53,9 +52,7 @@ function validateScenarioSpec(name, spec) {
53
52
  const budget = spec.completion.mode === "externally-reconciled" ? spec.completion.reconciliationDeadlineMs : spec.completion.observationBudgetMs;
54
53
  assert$1(typeof budget === "number" && Number.isFinite(budget) && budget > 0, `${scope} completion budget must be a positive number of milliseconds`);
55
54
  switch (spec.completion.mode) {
56
- case "terminal-event":
57
- assert$1(typeof spec.completion.event === "string" && spec.completion.event.length > 0, `${scope} terminal-event completion must declare a non-empty event`);
58
- break;
55
+ case "terminal-event": assert$1(typeof spec.completion.event === "string" && spec.completion.event.length > 0, `${scope} terminal-event completion must declare a non-empty event`);
59
56
  }
60
57
  assert$1(spec.events && typeof spec.events === "object" && Object.keys(spec.events).length > 0, `${scope} must declare at least one event`);
61
58
  for (const [event, eventSpec] of Object.entries(spec.events)) {
@@ -52,9 +52,7 @@ function validateScenarioSpec(name, spec) {
52
52
  const budget = spec.completion.mode === "externally-reconciled" ? spec.completion.reconciliationDeadlineMs : spec.completion.observationBudgetMs;
53
53
  assert$1(typeof budget === "number" && Number.isFinite(budget) && budget > 0, `${scope} completion budget must be a positive number of milliseconds`);
54
54
  switch (spec.completion.mode) {
55
- case "terminal-event":
56
- assert$1(typeof spec.completion.event === "string" && spec.completion.event.length > 0, `${scope} terminal-event completion must declare a non-empty event`);
57
- break;
55
+ case "terminal-event": assert$1(typeof spec.completion.event === "string" && spec.completion.event.length > 0, `${scope} terminal-event completion must declare a non-empty event`);
58
56
  }
59
57
  assert$1(spec.events && typeof spec.events === "object" && Object.keys(spec.events).length > 0, `${scope} must declare at least one event`);
60
58
  for (const [event, eventSpec] of Object.entries(spec.events)) {
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_processor = require('./processor-DQvVwsvP.cjs');
2
+ const require_processor = require('./processor-35CBa8U1.cjs');
3
3
 
4
4
  exports.SCHEMA_VIOLATION_ATTRS = require_processor.SCHEMA_VIOLATION_ATTRS;
5
5
  exports.SchemaValidationSpanProcessor = require_processor.SchemaValidationSpanProcessor;
package/dist/processor.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as SchemaValidationSpanProcessor, r as createSchemaValidationProcessor, t as SCHEMA_VIOLATION_ATTRS } from "./processor-PQss56h3.js";
1
+ import { n as SchemaValidationSpanProcessor, r as createSchemaValidationProcessor, t as SCHEMA_VIOLATION_ATTRS } from "./processor-DJA9y_Y8.js";
2
2
 
3
3
  export { SCHEMA_VIOLATION_ATTRS, SchemaValidationSpanProcessor, createSchemaValidationProcessor };
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/attrs.ts
3
2
  /**
4
3
  * Wire constants for the schema contract — the keys autotel-schema reads from
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel-schema",
3
- "version": "18.0.1",
3
+ "version": "20.0.0",
4
4
  "description": "Your telemetry surface as a typed, versioned contract — declare the spans and attributes your service emits, validate live spans against them, and diff the surface across commits to catch breaking trace changes before they ship.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -46,7 +46,7 @@
46
46
  "author": "Jag Reehal <jag@jagreehal.com> (https://jagreehal.com)",
47
47
  "license": "Apache-2.0",
48
48
  "peerDependencies": {
49
- "autotel": "7.7.1"
49
+ "autotel": "7.9.0"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "autotel": {