@wix/himalaya-cli 0.1948.0 → 0.1950.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 (176) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/files/src/index.d.ts +23 -2
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/network/src/index.d.ts +22 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/message-format.d.ts +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +13 -4
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/video/src/display.d.ts +3 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/files.mjs +4 -1
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +1 -8
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/network.mjs +19 -3
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +4 -9
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-video.mjs +4 -0
  21. package/dist/browser-plane/assets.json +5 -5
  22. package/dist/browser-plane/preview-deferred/{1425fc7ef3149df8ba41fdbcca629cefd430a2cae524822c21985f0aade6430a.bin → bb3ece9e6e814275817059f029f1b2db624dceb90d9e1a53ebae2b45fe6d36e5.bin} +1 -1
  23. package/dist/browser-plane/sw.js +9 -9
  24. package/dist/cli.mjs +185 -95
  25. package/dist/preview-assets.generated.bin +0 -0
  26. package/guides/app-icon.md +7 -3
  27. package/guides/one-app-to-himi-app.md +2 -2
  28. package/guides/release-notes.md +11 -0
  29. package/guides/sdk-reference.json +55 -6
  30. package/guides/web-page-sdk-reference.md +1 -1
  31. package/package.json +2 -2
  32. package/templates/beauty-salon-owner/config.ts +7 -0
  33. package/templates/beauty-salon-owner/dev/index.ts +567 -0
  34. package/templates/beauty-salon-owner/himalaya.content.json +3 -0
  35. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  36. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  37. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  38. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  39. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  40. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  41. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  42. package/templates/branded-lite/l10n/ar.json +21 -0
  43. package/templates/branded-lite/l10n/cs.json +21 -0
  44. package/templates/branded-lite/l10n/da.json +21 -0
  45. package/templates/branded-lite/l10n/de.json +21 -0
  46. package/templates/branded-lite/l10n/el.json +21 -0
  47. package/templates/branded-lite/l10n/en.json +5 -0
  48. package/templates/branded-lite/l10n/es.json +21 -0
  49. package/templates/branded-lite/l10n/fi.json +21 -0
  50. package/templates/branded-lite/l10n/fr.json +21 -0
  51. package/templates/branded-lite/l10n/he.json +21 -0
  52. package/templates/branded-lite/l10n/hu.json +21 -0
  53. package/templates/branded-lite/l10n/id.json +21 -0
  54. package/templates/branded-lite/l10n/it.json +21 -0
  55. package/templates/branded-lite/l10n/ja.json +21 -0
  56. package/templates/branded-lite/l10n/ko.json +21 -0
  57. package/templates/branded-lite/l10n/lt.json +21 -0
  58. package/templates/branded-lite/l10n/nl.json +21 -0
  59. package/templates/branded-lite/l10n/no.json +21 -0
  60. package/templates/branded-lite/l10n/pl.json +21 -0
  61. package/templates/branded-lite/l10n/pt.json +21 -0
  62. package/templates/branded-lite/l10n/ru.json +21 -0
  63. package/templates/branded-lite/l10n/sv.json +21 -0
  64. package/templates/branded-lite/l10n/th.json +21 -0
  65. package/templates/branded-lite/l10n/tr.json +21 -0
  66. package/templates/branded-lite/l10n/uk.json +21 -0
  67. package/templates/branded-lite/l10n/vi.json +21 -0
  68. package/templates/branded-lite/l10n/zh.json +21 -0
  69. package/templates/branded-lite/recipes/group-feed.json +221 -3
  70. package/templates/branded-lite/recipes/groups-newsfeed.json +160 -2
  71. package/templates/branded-lite/recipes/video-library.json +475 -0
  72. package/templates/branded-lite/tier5-src/_shared/group-feed-section.ts +119 -7
  73. package/templates/branded-lite/tier5-src/_shared/groups-newsfeed-section.ts +17 -9
  74. package/templates/branded-lite/tier5-src/_shared/videos-section.ts +134 -2
  75. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +4 -2
  76. package/templates/community-club-owner/config.ts +7 -0
  77. package/templates/community-club-owner/dev/index.ts +567 -0
  78. package/templates/community-club-owner/himalaya.content.json +3 -0
  79. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  80. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  81. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  82. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  83. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  84. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  85. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  86. package/templates/events-meetups-owner/config.ts +7 -0
  87. package/templates/events-meetups-owner/dev/index.ts +567 -0
  88. package/templates/events-meetups-owner/himalaya.content.json +3 -0
  89. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  90. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  91. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  92. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  93. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  94. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  95. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  96. package/templates/gym-fitness-owner/config.ts +7 -0
  97. package/templates/gym-fitness-owner/dev/index.ts +567 -0
  98. package/templates/gym-fitness-owner/himalaya.content.json +3 -0
  99. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  100. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  101. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  102. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  103. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  104. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  105. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  106. package/templates/nonprofit-cause-owner/config.ts +7 -0
  107. package/templates/nonprofit-cause-owner/dev/index.ts +567 -0
  108. package/templates/nonprofit-cause-owner/himalaya.content.json +3 -0
  109. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  110. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  111. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  112. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  113. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  114. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  115. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  116. package/templates/owner-lite/config.ts +7 -0
  117. package/templates/owner-lite/dev/index.ts +567 -0
  118. package/templates/owner-lite/himalaya.content.json +3 -0
  119. package/templates/owner-lite/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  120. package/templates/owner-lite/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  121. package/templates/owner-lite/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  122. package/templates/owner-lite/tier5-src/_shared/owner-maestro-when.ts +13 -0
  123. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  124. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  125. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  126. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +4 -2
  127. package/templates/podcast-creator-owner/config.ts +7 -0
  128. package/templates/podcast-creator-owner/dev/index.ts +567 -0
  129. package/templates/podcast-creator-owner/himalaya.content.json +3 -0
  130. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  131. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  132. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  133. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  134. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  135. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  136. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  137. package/templates/portfolio-creative-owner/config.ts +7 -0
  138. package/templates/portfolio-creative-owner/dev/index.ts +567 -0
  139. package/templates/portfolio-creative-owner/himalaya.content.json +3 -0
  140. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  141. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  142. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  143. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  144. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  145. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  146. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  147. package/templates/restaurant-owner/config.ts +7 -0
  148. package/templates/restaurant-owner/dev/index.ts +567 -0
  149. package/templates/restaurant-owner/himalaya.content.json +3 -0
  150. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  151. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  152. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  153. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  154. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  155. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  156. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  157. package/templates/retail-store-owner/config.ts +7 -0
  158. package/templates/retail-store-owner/dev/index.ts +567 -0
  159. package/templates/retail-store-owner/himalaya.content.json +3 -0
  160. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  161. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  162. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  163. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  164. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  165. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  166. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
  167. package/templates/yoga-studio-owner/config.ts +7 -0
  168. package/templates/yoga-studio-owner/dev/index.ts +567 -0
  169. package/templates/yoga-studio-owner/himalaya.content.json +3 -0
  170. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-activity.ts +151 -0
  171. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-availability.ts +15 -2
  172. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-chat.ts +20 -7
  173. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-when.ts +13 -0
  174. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro/index.ts +60 -11
  175. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro-activity/index.ts +228 -0
  176. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +1 -11
@@ -41,13 +41,19 @@ export declare function stat(path: string): Promise<FileStat | null>;
41
41
  * - `invalid_url` — not an absolute `https:` URL, carries userinfo, or names a
42
42
  * loopback / private-network / link-local host (checked on every
43
43
  * redirect hop; natively also on the resolved DNS records).
44
+ * - `invalid_quota_scope` — `quotaScope` normalizes to an empty path (the offending value is in `quotaScope`).
45
+ * - `outside_quota_scope` — the file `name` is not inside `quotaScope` (`path`, `quotaScope` are set).
44
46
  * - `too_large` — the response is (or announces it will be) over `maxBytes`.
47
+ * - `quota_exceeded` — the download quota (2 GiB per app, or per `quotaScope`) leaves no room
48
+ * for a download of that cap.
49
+ * - `insufficient_storage` — the 1 GiB free-space floor would be breached by a download of that cap.
45
50
  * - `http_error` — the server answered a non-2xx status (`status` is set).
46
51
  * - `network` — the transfer failed (DNS, TLS, reset, CORS on web, …).
47
52
  * - `unavailable` — this host cannot do it: no implementation for the verb, no save
48
- * picker or volume reading to hand, or (`download`) the account signed
53
+ * picker or volume reading to hand, a file store that cannot report its
54
+ * size (so the quota cannot be enforced), or (`download`) the account signed
49
55
  * out mid-transfer, so the file was not kept. */
50
- export type FilesErrorCode = "invalid_url" | "too_large" | "http_error" | "network" | "unavailable";
56
+ export type FilesErrorCode = "invalid_url" | "invalid_quota_scope" | "outside_quota_scope" | "too_large" | "quota_exceeded" | "insufficient_storage" | "http_error" | "network" | "unavailable";
51
57
  /** A v3 verb failure: an `Error` whose `code` is stable and `message` is for humans.
52
58
  * (A plain Error with fields, not a subclass — worker bundles target a syntax level
53
59
  * without `class`.) Narrow with {@link isFilesError}. */
@@ -64,6 +70,8 @@ export declare function isFilesError(e: unknown): e is FilesError;
64
70
  export declare const DEFAULT_DOWNLOAD_MAX_BYTES: number;
65
71
  /** The hard ceiling every arm clamps `maxBytes` to: 1 GiB. */
66
72
  export declare const MAX_DOWNLOAD_BYTES: number;
73
+ /** The stored bytes one app (or one `quotaScope`) may hold once downloads count: 2 GiB. */
74
+ export declare const DOWNLOAD_QUOTA_BYTES: number;
67
75
  /**
68
76
  * Stream an `https:` URL straight into the sandbox and resolve with its FileHandle —
69
77
  * the same shape `write` returns. The bytes never cross the worker bridge.
@@ -77,10 +85,23 @@ export declare const MAX_DOWNLOAD_BYTES: number;
77
85
  * `path`); default `downloads/<last URL path segment>`. An existing file is replaced.
78
86
  * - `maxBytes` defaults to 100 MiB (clamped to 1 GiB); over it the transfer is aborted (`too_large`) and
79
87
  * nothing is left behind.
88
+ * - Quota: the transfer reserves its `maxBytes` up front and releases it when it ends. It is refused
89
+ * (`too_large`) when the bytes already stored, the bytes other in-flight downloads have reserved,
90
+ * and its own cap would exceed {@link DOWNLOAD_QUOTA_BYTES} (2 GiB) — so a smaller `maxBytes`
91
+ * fits where the 100 MiB default does not. It is also refused when the volume's free space
92
+ * after the download would fall below 1 GiB (web: judged from the browser's storage estimate,
93
+ * when it gives one).
94
+ * - `quotaScope` is a path prefix (e.g. `widgets/<folder>`) whose stored and reserved bytes are
95
+ * counted on their own, so each caller gets its own 2 GiB. `name` must lie inside it.
96
+ * - The file does not appear at `name` until the transfer completes.
97
+ * - `mimeType` of the stored handle comes from the response's `Content-Type` (else the file
98
+ * extension). `files.export`'s `mimeType` option is ignored on Apple (iOS/macOS): the type is
99
+ * taken from the file itself, as the share and save panels use it.
80
100
  */
81
101
  export declare function download(url: string, opts?: {
82
102
  name?: string;
83
103
  maxBytes?: number;
104
+ quotaScope?: string;
84
105
  }): Promise<FileHandle>;
85
106
  /**
86
107
  * Let the user save a sandbox file OUTSIDE the app through the OS save picker: the
@@ -37,3 +37,25 @@ export declare function status(): Promise<NetworkStatus>;
37
37
  * ```
38
38
  */
39
39
  export declare function subscribe(handler: string): Promise<NetworkStatus>;
40
+ /** One answer from {@link watchNext}: a settled change, a quiet window, or the end of the watch. */
41
+ export type NetworkWatchEvent = {
42
+ event: "change" | "timeout";
43
+ status: NetworkStatus;
44
+ } | {
45
+ event: "ended";
46
+ };
47
+ /**
48
+ * Start a change watch — the pull twin of {@link subscribe}, for a WebView page, which has no
49
+ * worker to push into. Resolves with the watch id and the status at the moment of starting;
50
+ * loop on {@link watchNext} and call {@link watchStop} when done. Changes are debounced and
51
+ * deduped exactly as `subscribe` does. Returns `null` where the host has no network source.
52
+ */
53
+ export declare function watchStart(): Promise<{
54
+ watchId: string;
55
+ status: NetworkStatus;
56
+ } | null>;
57
+ /** Park until the next settled change (`change`), the window elapses (`timeout`, with the
58
+ * current status), or the watch is stopped (`ended`). */
59
+ export declare function watchNext(watchId: string, timeoutMs?: number): Promise<NetworkWatchEvent>;
60
+ /** Stop a watch; a parked {@link watchNext} resolves `ended`. */
61
+ export declare function watchStop(watchId: string): Promise<void>;
@@ -27,7 +27,7 @@ export declare const CAPABILITY_REGISTRY: {
27
27
  readonly location: readonly ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"];
28
28
  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"];
29
29
  readonly motion: readonly ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"];
30
- readonly network: readonly ["status", "subscribe"];
30
+ readonly network: readonly ["status", "subscribe", "watchNext", "watchStart", "watchStop"];
31
31
  readonly on_device_ai: readonly ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"];
32
32
  readonly open_url: readonly ["canOpen", "open"];
33
33
  readonly pdf: readonly ["isAvailable", "open"];
@@ -10,7 +10,7 @@ export type PluralCategory = "zero" | "one" | "two" | "few" | "many" | "other";
10
10
  */
11
11
  export declare function pluralCategory(n: number, locale: string): PluralCategory;
12
12
  /**
13
- * The explicit CLDR table used where ECMA-402 does not exist (QuickJS: watchOS, Wear).
13
+ * The explicit CLDR table every renderer uses (web, Swift and Kotlin ports alike).
14
14
  *
15
15
  * EXPORTED so a test can compare it against `Intl.PluralRules` directly. Asserting
16
16
  * through `pluralCategory` cannot check it: on any engine that has `Intl` the branch
@@ -66,10 +66,7 @@ export interface WixFeedItem {
66
66
  imageUrl?: string;
67
67
  } | string;
68
68
  createdAt?: string;
69
- permissions?: {
70
- canReact?: boolean;
71
- canAddComment?: boolean;
72
- };
69
+ permissions?: WixFeedItemPermissions;
73
70
  }
74
71
  /** Author directory returned alongside the v4 feed — resolves author.id → name/photo. */
75
72
  export interface WixFeedProfile {
@@ -79,10 +76,22 @@ export interface WixFeedProfile {
79
76
  url?: string;
80
77
  } | string;
81
78
  }
79
+ /** What the viewer may do to a post of the feed (verified live: a visitor reading a public group gets canReact and
80
+ * canAddComment false, canShare true). */
81
+ export interface WixFeedItemPermissions {
82
+ canReact?: boolean;
83
+ canAddComment?: boolean;
84
+ canShare?: boolean;
85
+ }
82
86
  export interface WixListFeedItemsResponse {
83
87
  feedItems: WixFeedItem[];
84
88
  profiles?: WixFeedProfile[];
85
89
  nextPageCursor?: string;
90
+ /** The viewer's permissions for this feed: `allFeedItemPermissions` for anyone's post, `ownFeedItemPermissions` for their own. */
91
+ permissions?: {
92
+ allFeedItemPermissions?: WixFeedItemPermissions;
93
+ ownFeedItemPermissions?: WixFeedItemPermissions;
94
+ };
86
95
  }
87
96
  /** Read controls shared by the source's single-group and central feeds. */
88
97
  export interface WixFeedPageOptions extends WixCallOptions {
@@ -9,6 +9,9 @@ export declare function isVideoProcessing(video: WixVideo): boolean;
9
9
  /** The 11-character YouTube id of a linked YouTube video, or "". The embed URL is
10
10
  * treated as data: only the id is taken, never the URL itself. */
11
11
  export declare function youtubeVideoId(video: WixVideo): string;
12
+ /** True when a Himi player can play the video: a hosted file (through `getVideoStreamUrl`) or a
13
+ * YouTube video with an id. Any other host (Vimeo, Facebook, live) has no player here. */
14
+ export declare function isPlayableVideo(video: WixVideo): boolean;
12
15
  /**
13
16
  * The video's card image, sized for display: the owner's cover, then the poster, then
14
17
  * the media thumbnail, then (for a YouTube video) YouTube's own thumbnail. "" when there
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -71,7 +71,7 @@ function filesError(code, message, status) {
71
71
  function isFilesError(e) {
72
72
  return e instanceof Error && e.name === "FilesError" && typeof e.code === "string";
73
73
  }
74
- var ERROR_CODES = ["invalid_url", "too_large", "http_error", "network", "unavailable"];
74
+ var ERROR_CODES = ["invalid_url", "invalid_quota_scope", "outside_quota_scope", "too_large", "quota_exceeded", "insufficient_storage", "http_error", "network", "unavailable"];
75
75
  function throwIfError(verb, r) {
76
76
  const e = r?.error;
77
77
  if (e == null) return;
@@ -82,10 +82,12 @@ function throwIfError(verb, r) {
82
82
  }
83
83
  var DEFAULT_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
84
84
  var MAX_DOWNLOAD_BYTES = 1024 * 1024 * 1024;
85
+ var DOWNLOAD_QUOTA_BYTES = 2 * 1024 * 1024 * 1024;
85
86
  async function download(url, opts) {
86
87
  const params = { url };
87
88
  if (opts?.name) params.name = opts.name;
88
89
  if (typeof opts?.maxBytes === "number" && opts.maxBytes > 0) params.maxBytes = String(Math.floor(opts.maxBytes));
90
+ if (opts?.quotaScope) params.quotaScope = opts.quotaScope;
89
91
  const r = await dispatch("capability.files.download", params);
90
92
  throwIfError("download", r);
91
93
  return toHandle(r, opts?.name ?? "download");
@@ -114,6 +116,7 @@ async function storageInfo() {
114
116
  var version = 3;
115
117
  export {
116
118
  DEFAULT_DOWNLOAD_MAX_BYTES,
119
+ DOWNLOAD_QUOTA_BYTES,
117
120
  MAX_DOWNLOAD_BYTES,
118
121
  download,
119
122
  exportFile as export,
@@ -1,13 +1,6 @@
1
1
  // ../../core/ts/src/message-format.ts
2
2
  function pluralCategory(n, locale2) {
3
- const lang = (locale2 || "en").split(/[-_]/)[0].toLowerCase();
4
- if (typeof Intl !== "undefined" && typeof Intl.PluralRules === "function") {
5
- try {
6
- return new Intl.PluralRules(lang).select(n);
7
- } catch {
8
- }
9
- }
10
- return pluralCategoryFallback(n, lang);
3
+ return pluralCategoryFallback(n, (locale2 || "en").split(/[-_]/)[0].toLowerCase());
11
4
  }
12
5
  function pluralCategoryFallback(n, locale2) {
13
6
  const lang = (locale2 || "en").split(/[-_]/)[0].toLowerCase();
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -21,8 +21,9 @@ function normalizeNetworkStatus(raw) {
21
21
  const type = TYPES.includes(r.type) ? r.type : "unknown";
22
22
  return {
23
23
  online,
24
- // An offline device has no link, whatever a stale `type` said.
25
- type: online ? type === "none" ? "unknown" : type : "none",
24
+ // An offline device has no link, whatever a stale `type` said — except `unknown`, which is
25
+ // what a host says before its first reading (nothing is known, not "no link").
26
+ type: online ? type === "none" ? "unknown" : type : r.type === "unknown" ? "unknown" : "none",
26
27
  expensive: online && (r.expensive === true || r.expensive === "true"),
27
28
  constrained: online && (r.constrained === true || r.constrained === "true")
28
29
  };
@@ -37,9 +38,24 @@ async function subscribe(handler) {
37
38
  }
38
39
  return normalizeNetworkStatus(await dispatch("capability.network.subscribe", { onChange: handler }));
39
40
  }
41
+ async function watchStart() {
42
+ const r = await dispatch("capability.network.watchStart", {});
43
+ return typeof r?.watchId === "string" ? { watchId: r.watchId, status: normalizeNetworkStatus(r.status) } : null;
44
+ }
45
+ async function watchNext(watchId, timeoutMs = 3e4) {
46
+ const r = await dispatch("capability.network.watchNext", { watchId, timeoutMs });
47
+ if (r?.event === "change" || r?.event === "timeout") return { event: r.event, status: normalizeNetworkStatus(r.status) };
48
+ return { event: "ended" };
49
+ }
50
+ async function watchStop(watchId) {
51
+ await dispatch("capability.network.watchStop", { watchId });
52
+ }
40
53
  export {
41
54
  normalizeNetworkStatus,
42
55
  status,
43
- subscribe
56
+ subscribe,
57
+ watchNext,
58
+ watchStart,
59
+ watchStop
44
60
  };
45
61
  //# sourceMappingURL=network.mjs.map
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -369,7 +369,7 @@ function filesError(code, message, status2) {
369
369
  function isFilesError(e) {
370
370
  return e instanceof Error && e.name === "FilesError" && typeof e.code === "string";
371
371
  }
372
- var ERROR_CODES = ["invalid_url", "too_large", "http_error", "network", "unavailable"];
372
+ var ERROR_CODES = ["invalid_url", "invalid_quota_scope", "outside_quota_scope", "too_large", "quota_exceeded", "insufficient_storage", "http_error", "network", "unavailable"];
373
373
  function throwIfError(verb, r) {
374
374
  const e = r?.error;
375
375
  if (e == null) return;
@@ -380,10 +380,12 @@ function throwIfError(verb, r) {
380
380
  }
381
381
  var DEFAULT_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
382
382
  var MAX_DOWNLOAD_BYTES = 1024 * 1024 * 1024;
383
+ var DOWNLOAD_QUOTA_BYTES = 2 * 1024 * 1024 * 1024;
383
384
  async function download(url, opts) {
384
385
  const params = { url };
385
386
  if (opts?.name) params.name = opts.name;
386
387
  if (typeof opts?.maxBytes === "number" && opts.maxBytes > 0) params.maxBytes = String(Math.floor(opts.maxBytes));
388
+ if (opts?.quotaScope) params.quotaScope = opts.quotaScope;
387
389
  const r = await dispatch("capability.files.download", params);
388
390
  throwIfError("download", r);
389
391
  return toHandle(r, opts?.name ?? "download");
@@ -7205,14 +7207,7 @@ function createRedirectSession(req = {}, opts) {
7205
7207
 
7206
7208
  // ../../core/ts/src/message-format.ts
7207
7209
  function pluralCategory(n, locale) {
7208
- const lang = (locale || "en").split(/[-_]/)[0].toLowerCase();
7209
- if (typeof Intl !== "undefined" && typeof Intl.PluralRules === "function") {
7210
- try {
7211
- return new Intl.PluralRules(lang).select(n);
7212
- } catch {
7213
- }
7214
- }
7215
- return pluralCategoryFallback(n, lang);
7210
+ return pluralCategoryFallback(n, (locale || "en").split(/[-_]/)[0].toLowerCase());
7216
7211
  }
7217
7212
  function pluralCategoryFallback(n, locale) {
7218
7213
  const lang = (locale || "en").split(/[-_]/)[0].toLowerCase();
@@ -27,7 +27,7 @@ var CAPABILITY_REGISTRY = {
27
27
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
28
28
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
29
29
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
30
- "network": ["status", "subscribe"],
30
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
31
31
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
32
32
  "open_url": ["canOpen", "open"],
33
33
  "pdf": ["isAvailable", "open"],
@@ -42,7 +42,7 @@ var CAPABILITY_REGISTRY = {
42
42
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
43
43
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
44
44
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
45
- "network": ["status", "subscribe"],
45
+ "network": ["status", "subscribe", "watchNext", "watchStart", "watchStop"],
46
46
  "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
47
47
  "open_url": ["canOpen", "open"],
48
48
  "pdf": ["isAvailable", "open"],
@@ -100,6 +100,9 @@ function youtubeVideoId(video) {
100
100
  const id = video.content?.externalId ?? "";
101
101
  return /^[A-Za-z0-9_-]{11}$/.test(id) ? id : "";
102
102
  }
103
+ function isPlayableVideo(video) {
104
+ return isHostedVideo(video) || video.source === "YOUTUBE" && youtubeVideoId(video) !== "";
105
+ }
103
106
  function videoCoverUrl(video, size = WIX_LIST_IMAGE) {
104
107
  for (const candidate of [video.cover?.selected, video.poster?.selected, video.content?.thumbnailUrl]) {
105
108
  const url = wixMediaUrl(candidate, size);
@@ -319,6 +322,7 @@ export {
319
322
  getVideoStreamUrl,
320
323
  isHostedVideo,
321
324
  isPaidVideo,
325
+ isPlayableVideo,
322
326
  isVideoProcessing,
323
327
  isVideoReady,
324
328
  isWixVideoWebRefusal,
@@ -2,7 +2,7 @@
2
2
  "files": [
3
3
  {
4
4
  "name": "sw.js",
5
- "bytes": 2827189
5
+ "bytes": 2834124
6
6
  },
7
7
  {
8
8
  "name": "host.html",
@@ -21,7 +21,7 @@
21
21
  "bytes": 24320
22
22
  },
23
23
  {
24
- "name": "preview-deferred/1425fc7ef3149df8ba41fdbcca629cefd430a2cae524822c21985f0aade6430a.bin",
24
+ "name": "preview-deferred/bb3ece9e6e814275817059f029f1b2db624dceb90d9e1a53ebae2b45fe6d36e5.bin",
25
25
  "bytes": 488215
26
26
  },
27
27
  {
@@ -79,10 +79,10 @@
79
79
  ],
80
80
  "deferred": [
81
81
  {
82
- "key": "assets/pdf-CMax5VgU.js",
82
+ "key": "assets/pdf-BwjYkmJt.js",
83
83
  "contentType": "application/javascript; charset=utf-8",
84
- "sha256": "1425fc7ef3149df8ba41fdbcca629cefd430a2cae524822c21985f0aade6430a",
85
- "file": "preview-deferred/1425fc7ef3149df8ba41fdbcca629cefd430a2cae524822c21985f0aade6430a.bin"
84
+ "sha256": "bb3ece9e6e814275817059f029f1b2db624dceb90d9e1a53ebae2b45fe6d36e5",
85
+ "file": "preview-deferred/bb3ece9e6e814275817059f029f1b2db624dceb90d9e1a53ebae2b45fe6d36e5.bin"
86
86
  },
87
87
  {
88
88
  "key": "assets/pdf.worker.min-BGnVRhRG.js",