@objectstack/plugin-webhooks 17.2.0 → 17.3.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/index.d.cts CHANGED
@@ -59,6 +59,21 @@ interface CachedSubscription {
59
59
  headers?: Record<string, string>;
60
60
  secret?: string;
61
61
  timeoutMs?: number;
62
+ /**
63
+ * [#13546] The subscription's own organization — `sys_webhook` is
64
+ * organization-scoped (#8554), so each row carries the tenant that authored
65
+ * it. Stamped onto every delivery row this subscription produces
66
+ * (`EnqueueHttpInput.organizationId`), which is what makes the
67
+ * cross-organization wall on `redeliver()` (#10740) actually exclude other
68
+ * tenants' rows: a row enqueued without it lands `organization_id = NULL`,
69
+ * the driver's global-row arm, visible to every organization. There is no
70
+ * request context to read here — the enqueuer runs fire-and-forget off the
71
+ * write path — so the subscription row is the one honest source. Absent
72
+ * when the row itself carries no organization (a `single`-posture install):
73
+ * the delivery then lands NULL, which is honest for a subscription that
74
+ * belongs to no organization. Threaded, never fabricated (#11303's rule).
75
+ */
76
+ organizationId?: string;
62
77
  /**
63
78
  * [#8069] Set when a credential this subscription needs could not be
64
79
  * recovered. The subscription stays CACHED — that is the change — but every
package/dist/index.d.ts CHANGED
@@ -59,6 +59,21 @@ interface CachedSubscription {
59
59
  headers?: Record<string, string>;
60
60
  secret?: string;
61
61
  timeoutMs?: number;
62
+ /**
63
+ * [#13546] The subscription's own organization — `sys_webhook` is
64
+ * organization-scoped (#8554), so each row carries the tenant that authored
65
+ * it. Stamped onto every delivery row this subscription produces
66
+ * (`EnqueueHttpInput.organizationId`), which is what makes the
67
+ * cross-organization wall on `redeliver()` (#10740) actually exclude other
68
+ * tenants' rows: a row enqueued without it lands `organization_id = NULL`,
69
+ * the driver's global-row arm, visible to every organization. There is no
70
+ * request context to read here — the enqueuer runs fire-and-forget off the
71
+ * write path — so the subscription row is the one honest source. Absent
72
+ * when the row itself carries no organization (a `single`-posture install):
73
+ * the delivery then lands NULL, which is honest for a subscription that
74
+ * belongs to no organization. Threaded, never fabricated (#11303's rule).
75
+ */
76
+ organizationId?: string;
62
77
  /**
63
78
  * [#8069] Set when a credential this subscription needs could not be
64
79
  * recovered. The subscription stays CACHED — that is the change — but every
package/dist/index.js CHANGED
@@ -596,7 +596,11 @@ var AutoEnqueuer = class {
596
596
  // `headers` and `secret` are both filled by attachCredentials()
597
597
  // from their encrypted columns, NOT read off the row — see #7799
598
598
  // (secret) and #7986 (headers).
599
- timeoutMs: defn.timeoutMs
599
+ timeoutMs: defn.timeoutMs,
600
+ // [#13546] The tenant column the kernel provisions on sys_webhook.
601
+ // This cache read is a dispatcher-side unscoped find, so the column
602
+ // comes back for every organization's rows.
603
+ organizationId: row.organization_id ? String(row.organization_id) : void 0
600
604
  };
601
605
  }
602
606
  /**
@@ -650,6 +654,12 @@ var AutoEnqueuer = class {
650
654
  // subscription, so the delivery path is byte-identical to before.
651
655
  undeliverableReason: sub.parkedReason,
652
656
  timeoutMs: sub.timeoutMs,
657
+ // [#13546] The delivery row belongs to the SUBSCRIPTION's
658
+ // organization — the one honest tenant in scope on this
659
+ // fire-and-forget path (no request context exists here).
660
+ // Absent for an org-less subscription; the row then lands
661
+ // NULL, the global-row shape.
662
+ organizationId: sub.organizationId,
653
663
  // [#3946] Envelope keys are written LAST so the event payload
654
664
  // cannot rewrite them. Behaviour-neutral for the engine's own
655
665
  // publishers — since #4626 a `data.record.*` payload is a
@@ -724,6 +734,9 @@ var AutoEnqueuer = class {
724
734
  // an undeliverable row instead of enqueuing a delivery.
725
735
  undeliverableReason: sub.parkedReason,
726
736
  timeoutMs: sub.timeoutMs,
737
+ // [#13546] See the per-record path — the subscription's own
738
+ // organization, absent for an org-less subscription.
739
+ organizationId: sub.organizationId,
727
740
  // [#3946] Envelope keys last so the payload cannot rewrite them.
728
741
  payload: {
729
742
  ...payload,
@@ -1207,7 +1220,7 @@ var WebhookOutboxPlugin = class {
1207
1220
  try {
1208
1221
  const i18n = ctx.getService("i18n");
1209
1222
  if (i18n && typeof i18n.loadTranslations === "function") {
1210
- const { WebhooksTranslations } = await import("./translations-IAKF6NAP.js");
1223
+ const { WebhooksTranslations } = await import("./translations-CPXQB2NM.js");
1211
1224
  for (const [locale, data] of Object.entries(WebhooksTranslations)) {
1212
1225
  i18n.loadTranslations(locale, data);
1213
1226
  }