@cross-deck/web 1.4.2 → 1.5.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/vue.mjs CHANGED
@@ -3676,6 +3676,37 @@ var CrossdeckClient = class {
3676
3676
  * trip happens in the background. To flush before the page unloads,
3677
3677
  * call flush().
3678
3678
  */
3679
+ /**
3680
+ * Emit `crossdeck.contract_failed` with the canonical property
3681
+ * shape (`contract_id`, `sdk_version`, `sdk_platform`,
3682
+ * `failure_reason`, `run_context`, `run_id`). Goes through the
3683
+ * standard track() pipeline — same consent gate, same queue,
3684
+ * same ingest, no new endpoint.
3685
+ *
3686
+ * Wire the call from a test hook, dogfood failure path, or
3687
+ * customer contract-verification harness; see
3688
+ * `contracts/README.md` for the per-test-framework hook recipes.
3689
+ */
3690
+ reportContractFailure(input) {
3691
+ const props = {
3692
+ contract_id: input.contractId,
3693
+ sdk_version: SDK_VERSION,
3694
+ sdk_platform: "web",
3695
+ failure_reason: input.failureReason,
3696
+ run_context: input.runContext,
3697
+ run_id: input.runId
3698
+ };
3699
+ if (input.testRef) {
3700
+ props.test_file = input.testRef.file;
3701
+ props.test_name = input.testRef.name;
3702
+ }
3703
+ if (input.extra) {
3704
+ for (const [k, v] of Object.entries(input.extra)) {
3705
+ if (props[k] === void 0) props[k] = v;
3706
+ }
3707
+ }
3708
+ this.track("crossdeck.contract_failed", props);
3709
+ }
3679
3710
  track(name, properties) {
3680
3711
  const s = this.requireStarted();
3681
3712
  if (!name) {