@wix/himalaya-cli 0.850.0 → 0.852.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.
Files changed (25) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/local-db/src/index.d.ts +23 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -2
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/secure-storage/src/index.d.ts +23 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +5 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -4
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +2 -2
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +2 -2
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +2 -2
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +2 -2
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +15 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/local-db.mjs +10 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +2 -2
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +2 -2
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +2 -2
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +2 -2
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/secure-storage.mjs +10 -0
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +2 -2
  18. package/dist/cli.mjs +3630 -3286
  19. package/guides/app-config.md +23 -1
  20. package/guides/component-reference.json +1 -1
  21. package/guides/component-reference.md +4 -4
  22. package/guides/mobile-ux.md +45 -32
  23. package/guides/sdk-reference.json +12 -0
  24. package/package.json +2 -2
  25. package/templates/surface-showcase/config.ts +1 -1
@@ -1,3 +1,26 @@
1
+ import type { Availability } from "@wix/himalaya/sdk-types";
2
+ /**
3
+ * Whether this host actually backs the local database — the probe #2502 asked for.
4
+ *
5
+ * Without it, every read on a host that does not serve the capability is
6
+ * INDISTINGUISHABLE from a successful read of an empty collection: `getAll` coalesces a
7
+ * missing answer to `[]` and `get` to `null` just below, so an author sees "0 rows" and
8
+ * cannot tell whether the store is empty or absent. That ambiguity cost three QA slots on
9
+ * one run; one of them shipped a whole in-memory fallback that turned out to be dead code.
10
+ *
11
+ * `full` on iOS / Android / web and in the headless `himi render` host; `degraded` where the
12
+ * store works but does not survive a reload (web without IndexedDB); `unavailable` when the
13
+ * host does not back it. Branch on this rather than inferring absence from an empty result.
14
+ *
15
+ * NEVER THROWS, like `@himalaya/pdf`'s `isAvailable`, and that is load-bearing rather than
16
+ * politeness: the hosts this probe exists to detect are exactly the ones that REJECT it.
17
+ * Both native dispatchers throw on an unregistered id (`ActionError.unknown`), so on any app
18
+ * binary shipped before this verb existed — or a shell that never calls
19
+ * `LocalDatabaseCapability.register` — a rejecting probe would put an unhandled rejection in
20
+ * the worker's `load()` of every author who wrote the documented
21
+ * `if (await availability() === "full")`. A refusal to answer IS the answer here.
22
+ */
23
+ export declare function availability(): Promise<Availability>;
1
24
  /** An entity row — a JSON object identified by a string `id`. */
2
25
  export interface DbEntity {
3
26
  id: string;
@@ -17,7 +17,7 @@ export declare const CAPABILITY_REGISTRY: {
17
17
  readonly iap: readonly ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"];
18
18
  readonly keyboard: readonly ["dismiss"];
19
19
  readonly live_activity: readonly ["end", "start", "update"];
20
- readonly local_database: readonly ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"];
20
+ readonly local_database: readonly ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"];
21
21
  readonly location: readonly ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"];
22
22
  readonly media_playback: readonly ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"];
23
23
  readonly motion: readonly ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"];
@@ -28,7 +28,7 @@ export declare const CAPABILITY_REGISTRY: {
28
28
  readonly presigned_upload: readonly ["put", "putFile"];
29
29
  readonly push: readonly ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"];
30
30
  readonly release_control: readonly ["active", "available", "list", "select"];
31
- readonly secure_storage: readonly ["read", "remove", "write"];
31
+ readonly secure_storage: readonly ["availability", "read", "remove", "write"];
32
32
  readonly share: readonly ["availability", "share"];
33
33
  readonly speaker_diarization: readonly ["analyzeFile", "availability"];
34
34
  readonly speech: readonly ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"];
@@ -1,3 +1,26 @@
1
+ import type { Availability } from "@wix/himalaya/sdk-types";
2
+ /**
3
+ * Whether this host actually backs secure storage — the probe #2502 asked for.
4
+ *
5
+ * Without it, `read` on a host that does not serve the capability is INDISTINGUISHABLE
6
+ * from a key that was never written: both answer `null` (see `read` below, which coalesces
7
+ * a missing answer). An author cannot tell "unsupported here" from "genuinely empty", which
8
+ * is exactly what made a silent no-op look like a working-but-empty keychain.
9
+ *
10
+ * `full` on iOS (Keychain) / Android (Keystore-AES) / web and in the headless
11
+ * `himi render` host; `unavailable` when the host does not back it — which on web includes
12
+ * a context with no IndexedDB (a sandboxed iframe, a storage-blocked third-party frame),
13
+ * where every `read`/`write` would reject.
14
+ *
15
+ * NEVER THROWS, like `@himalaya/pdf`'s `isAvailable`, and that is load-bearing rather than
16
+ * politeness: the hosts this probe exists to detect are exactly the ones that REJECT it.
17
+ * Both native dispatchers throw on an unregistered id (`ActionError.unknown`), so on any app
18
+ * binary shipped before this verb existed — or a shell that never calls
19
+ * `SecureStorageCapability.register` — a rejecting probe would put an unhandled rejection in
20
+ * the worker's `load()` of every author who wrote the documented
21
+ * `if (await availability() === "full")`. A refusal to answer IS the answer here.
22
+ */
23
+ export declare function availability(): Promise<Availability>;
1
24
  export type AccessControl =
2
25
  /** Reads only on a device that's been unlocked at least once. */
3
26
  "after_first_unlock"
@@ -261,7 +261,11 @@ export interface AppConfig {
261
261
  telemetry: TelemetrySink;
262
262
  /** Local-agent configuration. */
263
263
  agent: AgentConfig;
264
- /** Domain entities and their cache materialization shape. */
264
+ /** Domain entities and their cache materialization shape. REQUIRED — an app with no
265
+ * domain entities writes `entities: {}` (what the scaffold emits), and omitting the key
266
+ * is a `defineApp` error. NOT the place to declare data the app PERSISTS at runtime,
267
+ * despite `dataSchema` below describing itself in terms of "entities": on-device storage
268
+ * is `dataSchema`, and Wix-backed collections are `cms`. */
265
269
  entities: Record<string, EntityConfig>;
266
270
  /**
267
271
  * Local-DB schema descriptor (local-DB roadmap Phase 3). Declares the app's
@@ -145,10 +145,10 @@ export interface Modifiers {
145
145
  * HStack a `Button` and a `Toggle` are implicitly weighted, so they DIVIDE the
146
146
  * row with your weighted child instead of taking a width ahead of it —
147
147
  * `[VStack(weight:1), Button, Button]` is a three-way split, not "the VStack gets
148
- * the remainder". The RELIABLE opt-outs are `iconOnly` and `tertiary`/`link` with
149
- * `fullWidth` unset. `fullWidth: false` is NOT reliable here: only Android honors
150
- * it in a weighted row (`wantsRowStretch`); iOS (`WeightedStack`) and web still
151
- * hand the button a share. Otherwise give the actions their own row.
148
+ * the remainder". To opt a Button out on EVERY renderer set `fullWidth: false`
149
+ * (an explicit flag wins in both directions; absent falls back to the style
150
+ * default, which is "share" for every style but `tertiary`/`link`), or use
151
+ * `iconOnly`. Otherwise give the actions their own row.
152
152
  * See `himi docs designing-himi-screens` §4. */
153
153
  weight?: number;
154
154
  /** RTL — pin the subtree's writing direction: `"ltr"` | `"rtl"` | `"locale"`
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -7476,7 +7476,22 @@ function validateConfigShape(config) {
7476
7476
  seen.add(screenId);
7477
7477
  }
7478
7478
  }
7479
+ if (config.entities === void 0 || config.entities === null) {
7480
+ throw new Error(
7481
+ 'defineApp: "entities" is required \u2014 add `entities: {},` to config.ts (an app with no domain entities declares the empty object).'
7482
+ );
7483
+ }
7484
+ if (typeof config.entities !== "object" || Array.isArray(config.entities)) {
7485
+ throw new Error(
7486
+ `defineApp: "entities" must be an object of { "<name>": { file | directory } } (got ${Array.isArray(config.entities) ? "an array" : typeof config.entities}).`
7487
+ );
7488
+ }
7479
7489
  for (const [name, entity] of Object.entries(config.entities)) {
7490
+ if (entity === null || typeof entity !== "object") {
7491
+ throw new Error(
7492
+ `defineApp: entity "${name}" must be an object declaring "file" or "directory" (got ${entity === null ? "null" : typeof entity}).`
7493
+ );
7494
+ }
7480
7495
  if (!entity.file && !entity.directory) {
7481
7496
  throw new Error(
7482
7497
  `defineApp: entity "${name}" must declare either "file" or "directory".`
@@ -14,6 +14,15 @@ function dispatch(handlerId, params, _options) {
14
14
  }
15
15
 
16
16
  // ../../core/sdk/local-db/src/index.ts
17
+ async function availability() {
18
+ try {
19
+ const r = await dispatch("capability.local_database.availability");
20
+ const a = r?.availability;
21
+ return a === "full" || a === "degraded" ? a : "unavailable";
22
+ } catch {
23
+ return "unavailable";
24
+ }
25
+ }
17
26
  async function getAll(entity) {
18
27
  if (!entity) throw new Error("local-db.getAll: entity is required");
19
28
  const r = await dispatch("capability.local_database.getAll", { entity });
@@ -61,6 +70,7 @@ async function drainQueue() {
61
70
  }
62
71
  var version = 2;
63
72
  export {
73
+ availability,
64
74
  count,
65
75
  drainQueue,
66
76
  enqueue,
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -17,7 +17,7 @@ var CAPABILITY_REGISTRY = {
17
17
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
18
18
  "keyboard": ["dismiss"],
19
19
  "live_activity": ["end", "start", "update"],
20
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
20
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
21
21
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
22
22
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
23
23
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -28,7 +28,7 @@ var CAPABILITY_REGISTRY = {
28
28
  "presigned_upload": ["put", "putFile"],
29
29
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
30
30
  "release_control": ["active", "available", "list", "select"],
31
- "secure_storage": ["read", "remove", "write"],
31
+ "secure_storage": ["availability", "read", "remove", "write"],
32
32
  "share": ["availability", "share"],
33
33
  "speaker_diarization": ["analyzeFile", "availability"],
34
34
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -14,6 +14,15 @@ function dispatch(handlerId, params, _options) {
14
14
  }
15
15
 
16
16
  // ../../core/sdk/secure-storage/src/index.ts
17
+ async function availability() {
18
+ try {
19
+ const r = await dispatch("capability.secure_storage.availability");
20
+ const a = r?.availability;
21
+ return a === "full" || a === "degraded" ? a : "unavailable";
22
+ } catch {
23
+ return "unavailable";
24
+ }
25
+ }
17
26
  async function read(key) {
18
27
  if (!key) throw new Error("secure-storage.read: key is required");
19
28
  const result = await dispatch("capability.secure_storage.read", { key });
@@ -33,6 +42,7 @@ async function remove(key) {
33
42
  }
34
43
  var version = 1;
35
44
  export {
45
+ availability,
36
46
  read,
37
47
  remove,
38
48
  version,
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],