@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.cjs CHANGED
@@ -3701,6 +3701,37 @@ var CrossdeckClient = class {
3701
3701
  * trip happens in the background. To flush before the page unloads,
3702
3702
  * call flush().
3703
3703
  */
3704
+ /**
3705
+ * Emit `crossdeck.contract_failed` with the canonical property
3706
+ * shape (`contract_id`, `sdk_version`, `sdk_platform`,
3707
+ * `failure_reason`, `run_context`, `run_id`). Goes through the
3708
+ * standard track() pipeline — same consent gate, same queue,
3709
+ * same ingest, no new endpoint.
3710
+ *
3711
+ * Wire the call from a test hook, dogfood failure path, or
3712
+ * customer contract-verification harness; see
3713
+ * `contracts/README.md` for the per-test-framework hook recipes.
3714
+ */
3715
+ reportContractFailure(input) {
3716
+ const props = {
3717
+ contract_id: input.contractId,
3718
+ sdk_version: SDK_VERSION,
3719
+ sdk_platform: "web",
3720
+ failure_reason: input.failureReason,
3721
+ run_context: input.runContext,
3722
+ run_id: input.runId
3723
+ };
3724
+ if (input.testRef) {
3725
+ props.test_file = input.testRef.file;
3726
+ props.test_name = input.testRef.name;
3727
+ }
3728
+ if (input.extra) {
3729
+ for (const [k, v] of Object.entries(input.extra)) {
3730
+ if (props[k] === void 0) props[k] = v;
3731
+ }
3732
+ }
3733
+ this.track("crossdeck.contract_failed", props);
3734
+ }
3704
3735
  track(name, properties) {
3705
3736
  const s = this.requireStarted();
3706
3737
  if (!name) {