@colixsystems/widget-sdk 0.181.0 → 0.182.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/README.md CHANGED
@@ -74,7 +74,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
74
74
 
75
75
  ## Status
76
76
 
77
- `v0.181.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
77
+ `v0.182.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
78
+
79
+ ### What's new in 0.182.0 (contract 1.143.0)
80
+
81
+ **A `datastoreTemplate` relation decides what happens when the row it points at is deleted.** A `ONE_TO_ONE` / `ONE_TO_MANY` RELATION column may declare `onDelete`. With `"SET_NULL"`, the default, the row is kept and its reference is emptied. With `"CASCADE"`, the row is deleted along with the row it points at, and anything that cascades from it is deleted in turn. A `MANY_TO_MANY` column takes no `onDelete`: deleting a row on either side only removes its links. The platform applies the rule on every delete, so a widget that deletes a parent row never has to delete or clear its children itself. Use `CASCADE` for rows that mean nothing without their parent (order lines, a post's comments). Additive: a template without it gets `SET_NULL`.
78
82
 
79
83
  ### What's new in 0.181.0 (contract 1.142.0)
80
84
 
package/dist/contract.cjs CHANGED
@@ -4780,7 +4780,9 @@ const CONTRACT = deepFreeze({
4780
4780
  // `app_user_id` and `status: "open"`, and each invite row carries
4781
4781
  // `app_user_id`: the id the invitee's user account will have once they
4782
4782
  // accept.
4783
- version: "1.142.0",
4783
+ // 1.143.0: additive (sc-9756) — a datastoreTemplate RELATION column may
4784
+ // declare `onDelete` ("CASCADE" | "SET_NULL") for ONE_TO_ONE/ONE_TO_MANY.
4785
+ version: "1.143.0",
4784
4786
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4785
4787
  hooks: HOOKS,
4786
4788
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -4776,7 +4776,9 @@ const CONTRACT = deepFreeze({
4776
4776
  // `app_user_id` and `status: "open"`, and each invite row carries
4777
4777
  // `app_user_id`: the id the invitee's user account will have once they
4778
4778
  // accept.
4779
- version: "1.142.0",
4779
+ // 1.143.0: additive (sc-9756) — a datastoreTemplate RELATION column may
4780
+ // declare `onDelete` ("CASCADE" | "SET_NULL") for ONE_TO_ONE/ONE_TO_MANY.
4781
+ version: "1.143.0",
4780
4782
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4781
4783
  hooks: HOOKS,
4782
4784
  primitives: PRIMITIVES,
package/dist/index.d.ts CHANGED
@@ -187,6 +187,12 @@ export interface WidgetDatastoreTemplateColumn {
187
187
  relationType?: "ONE_TO_ONE" | "ONE_TO_MANY" | "MANY_TO_MANY";
188
188
  /** REQ-ACL-RELINHERIT: opt this RELATION column into row-level ACL inheritance. */
189
189
  inheritAcl?: boolean;
190
+ /**
191
+ * ONE_TO_ONE / ONE_TO_MANY only: what deleting the referenced row does to
192
+ * this table's rows. `CASCADE` deletes them too; `SET_NULL` (the default)
193
+ * empties the reference. A MANY_TO_MANY link is always removed.
194
+ */
195
+ onDelete?: "CASCADE" | "SET_NULL";
190
196
  /**
191
197
  * REQ-DDL-ENCRYPT: store this column's values encrypted at rest (AES-256-GCM
192
198
  * under a per-workspace subkey). The widget still reads and writes plaintext
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.181.0",
3
+ "version": "0.182.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "homepage": "https://github.com/Colix-AB/AppStudio",
6
6
  "type": "module",