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