@colixsystems/widget-sdk 0.296.0 → 0.297.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
@@ -90,7 +90,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
90
90
 
91
91
  ## Status
92
92
 
93
- `v0.296.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**.
93
+ `v0.297.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**.
94
+
95
+ ### What's new in 0.297.0 (contract 1.244.0)
96
+
97
+ **Widgets that call `useConnector` can be published.** The publish check rejected `connectors.call:*`, the scope the linter requires for the hook, as invalid grammar. `CONTRACT.fixedScopes` now lists every `requestedScopes` entry whose target the scope itself fixes (`ai.invoke:*`, `actions.run:*`, `connectors.call:*`, `users.read:*`, …), and the publish check accepts each of those, so the scope a hook requires and the scopes the check accepts come from one list. Additive.
94
98
 
95
99
  ### What's new in 0.296.0 (contract 1.243.0)
96
100
 
package/dist/contract.cjs CHANGED
@@ -5212,6 +5212,26 @@ const TRANSLATION_API_HOSTS = [
5212
5212
  // case-insensitively against code (comments are blanked before matching).
5213
5213
  const SCOPE_MINT_PATTERNS = ["/widgets/scope-token", "x-widget-scopes"];
5214
5214
 
5215
+ // sc-15915: a hook's required fixed scope must be listed, or it can't publish.
5216
+ const FIXED_SCOPES = Object.freeze([
5217
+ "directory.read:users",
5218
+ "acl.write:records",
5219
+ "payments.charge:appUser",
5220
+ "payments.charge:guest",
5221
+ "notifications.send:appUser",
5222
+ "ai.invoke:*",
5223
+ "actions.run:*",
5224
+ "connectors.call:*",
5225
+ "users.read:*",
5226
+ "users.write:*",
5227
+ "users.delete:*",
5228
+ "users.activity:*",
5229
+ "groups.read:*",
5230
+ "groups.write:*",
5231
+ "invites.read:*",
5232
+ "invites.write:*",
5233
+ ]);
5234
+
5215
5235
  // sc-4686 — the currency a price renders in when the HOST does not supply the
5216
5236
  // workspace's own (a host predating the workspace.currency slice, or a caller
5217
5237
  // that forgot to wire it). A rendering fallback so a price is never blank or
@@ -6870,7 +6890,9 @@ const CONTRACT = deepFreeze({
6870
6890
  // 1.243.0: additive (sc-15908) — `useKeyboard({ keys, onKeyDown, onKeyUp,
6871
6891
  // active })` + the optional `device.keyboard` slice (window key listeners
6872
6892
  // on web, expo-key-event on native).
6873
- version: "1.243.0",
6893
+ // 1.244.0: additive (sc-15915) — `fixedScopes`, the requestedScopes entries
6894
+ // whose target the scope fixes; the publish gate accepts exactly these.
6895
+ version: "1.244.0",
6874
6896
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6875
6897
  hooks: HOOKS,
6876
6898
  primitives: PRIMITIVES,
@@ -6917,6 +6939,7 @@ const CONTRACT = deepFreeze({
6917
6939
  currencyFormatFallback: CURRENCY_FORMAT_FALLBACK,
6918
6940
  translationApiHosts: TRANSLATION_API_HOSTS,
6919
6941
  scopeMintPatterns: SCOPE_MINT_PATTERNS,
6942
+ fixedScopes: FIXED_SCOPES,
6920
6943
  });
6921
6944
 
6922
6945
  function isHookAllowed(name) {
package/dist/contract.js CHANGED
@@ -5208,6 +5208,26 @@ const TRANSLATION_API_HOSTS = [
5208
5208
  // case-insensitively against code (comments are blanked before matching).
5209
5209
  const SCOPE_MINT_PATTERNS = ["/widgets/scope-token", "x-widget-scopes"];
5210
5210
 
5211
+ // sc-15915: a hook's required fixed scope must be listed, or it can't publish.
5212
+ const FIXED_SCOPES = Object.freeze([
5213
+ "directory.read:users",
5214
+ "acl.write:records",
5215
+ "payments.charge:appUser",
5216
+ "payments.charge:guest",
5217
+ "notifications.send:appUser",
5218
+ "ai.invoke:*",
5219
+ "actions.run:*",
5220
+ "connectors.call:*",
5221
+ "users.read:*",
5222
+ "users.write:*",
5223
+ "users.delete:*",
5224
+ "users.activity:*",
5225
+ "groups.read:*",
5226
+ "groups.write:*",
5227
+ "invites.read:*",
5228
+ "invites.write:*",
5229
+ ]);
5230
+
5211
5231
  // sc-4686 — the currency a price renders in when the HOST does not supply the
5212
5232
  // workspace's own (a host predating the workspace.currency slice, or a caller
5213
5233
  // that forgot to wire it). A rendering fallback so a price is never blank or
@@ -6866,7 +6886,9 @@ const CONTRACT = deepFreeze({
6866
6886
  // 1.243.0: additive (sc-15908) — `useKeyboard({ keys, onKeyDown, onKeyUp,
6867
6887
  // active })` + the optional `device.keyboard` slice (window key listeners
6868
6888
  // on web, expo-key-event on native).
6869
- version: "1.243.0",
6889
+ // 1.244.0: additive (sc-15915) — `fixedScopes`, the requestedScopes entries
6890
+ // whose target the scope fixes; the publish gate accepts exactly these.
6891
+ version: "1.244.0",
6870
6892
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6871
6893
  hooks: HOOKS,
6872
6894
  primitives: PRIMITIVES,
@@ -6913,6 +6935,7 @@ const CONTRACT = deepFreeze({
6913
6935
  currencyFormatFallback: CURRENCY_FORMAT_FALLBACK,
6914
6936
  translationApiHosts: TRANSLATION_API_HOSTS,
6915
6937
  scopeMintPatterns: SCOPE_MINT_PATTERNS,
6938
+ fixedScopes: FIXED_SCOPES,
6916
6939
  });
6917
6940
 
6918
6941
  function isHookAllowed(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.296.0",
3
+ "version": "0.297.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",
package/src/contract.js CHANGED
@@ -5208,6 +5208,26 @@ const TRANSLATION_API_HOSTS = [
5208
5208
  // case-insensitively against code (comments are blanked before matching).
5209
5209
  const SCOPE_MINT_PATTERNS = ["/widgets/scope-token", "x-widget-scopes"];
5210
5210
 
5211
+ // sc-15915: a hook's required fixed scope must be listed, or it can't publish.
5212
+ const FIXED_SCOPES = Object.freeze([
5213
+ "directory.read:users",
5214
+ "acl.write:records",
5215
+ "payments.charge:appUser",
5216
+ "payments.charge:guest",
5217
+ "notifications.send:appUser",
5218
+ "ai.invoke:*",
5219
+ "actions.run:*",
5220
+ "connectors.call:*",
5221
+ "users.read:*",
5222
+ "users.write:*",
5223
+ "users.delete:*",
5224
+ "users.activity:*",
5225
+ "groups.read:*",
5226
+ "groups.write:*",
5227
+ "invites.read:*",
5228
+ "invites.write:*",
5229
+ ]);
5230
+
5211
5231
  // sc-4686 — the currency a price renders in when the HOST does not supply the
5212
5232
  // workspace's own (a host predating the workspace.currency slice, or a caller
5213
5233
  // that forgot to wire it). A rendering fallback so a price is never blank or
@@ -6866,7 +6886,9 @@ const CONTRACT = deepFreeze({
6866
6886
  // 1.243.0: additive (sc-15908) — `useKeyboard({ keys, onKeyDown, onKeyUp,
6867
6887
  // active })` + the optional `device.keyboard` slice (window key listeners
6868
6888
  // on web, expo-key-event on native).
6869
- version: "1.243.0",
6889
+ // 1.244.0: additive (sc-15915) — `fixedScopes`, the requestedScopes entries
6890
+ // whose target the scope fixes; the publish gate accepts exactly these.
6891
+ version: "1.244.0",
6870
6892
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6871
6893
  hooks: HOOKS,
6872
6894
  primitives: PRIMITIVES,
@@ -6913,6 +6935,7 @@ const CONTRACT = deepFreeze({
6913
6935
  currencyFormatFallback: CURRENCY_FORMAT_FALLBACK,
6914
6936
  translationApiHosts: TRANSLATION_API_HOSTS,
6915
6937
  scopeMintPatterns: SCOPE_MINT_PATTERNS,
6938
+ fixedScopes: FIXED_SCOPES,
6916
6939
  });
6917
6940
 
6918
6941
  function isHookAllowed(name) {