@wix/himalaya-cli 0.1412.0 → 0.1414.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.
@@ -3,6 +3,32 @@
3
3
  export interface WixCallOptions {
4
4
  site?: string;
5
5
  }
6
+ /** The endpoint answered: `value` is what the call returns without `{ offline: "queue" }`. */
7
+ export interface WixSent<T> {
8
+ status: "sent";
9
+ value: T;
10
+ }
11
+ /** The write waits in the device's offline outbox (RFC 0072); `writeId` names it in
12
+ * `wixApi.offline` events. Show it as pending until `applied` or `rejected`. */
13
+ export interface WixQueued {
14
+ status: "queued";
15
+ writeId: string;
16
+ tag: string;
17
+ }
18
+ export type WixOfflineResult<T> = WixSent<T> | WixQueued;
19
+ /** Per-call options of a write the runtime may queue offline. `offline: "queue"` opts this ONE
20
+ * call into the outbox, and the answer becomes a `WixOfflineResult<T>`. It queues only if
21
+ * the app also declares a `queueOffline` cache rule for the endpoint (and, on web, the
22
+ * endpoint's dedupe allows it); otherwise it is sent live as usual, and refused offline
23
+ * (`err.code === "offline_write_blocked"`). */
24
+ export interface WixQueueCallOptions extends WixCallOptions {
25
+ offline?: "queue";
26
+ }
27
+ /** What a queueable write answers for options `O`: the envelope when `O` opts in, the plain
28
+ * response when it cannot, either when that is only known at runtime. */
29
+ export type WixQueueAnswer<O, T> = O extends {
30
+ offline: "queue";
31
+ } ? WixOfflineResult<T> : "offline" extends keyof O ? (O[keyof O & "offline"] extends undefined ? T : T | WixOfflineResult<T>) : T;
6
32
  /** How a request reaches the wire: the request field behind each `{…}` in the path, in
7
33
  * order, and whether the request travels in the query string (GET/DELETE) or the body. */
8
34
  export interface WixRoute {
@@ -25,3 +51,8 @@ export interface WixRoute {
25
51
  * Exported so the hand-written ./extensions sidecar can build the same URLs. */
26
52
  export declare function wixQueryPath(path: string, req: unknown): string;
27
53
  export declare function wixCall<T>(verb: string, template: string, req: unknown, opts?: WixCallOptions, route?: WixRoute): Promise<T>;
54
+ /** `wixCall` for a write on the runtime's offline allow-table (RFC 0072). With
55
+ * `opts.offline === "queue"` the opt-in rides as the bridge's 5th argument and the answer is
56
+ * the runtime's envelope; a runtime without offline writes (no `wixApi.offline`) sends the
57
+ * call live, reported as `sent`. Without it, exactly `wixCall`. */
58
+ export declare function wixQueueCall<T, O extends WixQueueCallOptions>(verb: string, template: string, req: unknown, opts?: O, route?: WixRoute): Promise<WixQueueAnswer<O, T>>;
@@ -466,6 +466,9 @@ function withoutFields(req, fields) {
466
466
  return out;
467
467
  }
468
468
  function wixCall2(verb, template, req, opts, route = {}) {
469
+ return send(verb, template, req, opts, route, false);
470
+ }
471
+ function send(verb, template, req, opts, route, queue) {
469
472
  const api = globalThis.himalaya?.wixApi;
470
473
  if (!api) return Promise.reject(new Error("@himalaya/wix-*: host did not install the wixApi bridge"));
471
474
  const fields = route.pathFields ?? [];
@@ -485,8 +488,11 @@ function wixCall2(verb, template, req, opts, route = {}) {
485
488
  }
486
489
  const site = opts?.site?.trim();
487
490
  const headers = site ? { "wix-site-id": site } : void 0;
488
- if (route.query) return api.call(verb, wixQueryPath2(path, withoutFields(req, fields)), void 0, headers);
489
- return api.call(verb, path, req, headers);
491
+ const target = route.query ? wixQueryPath2(path, withoutFields(req, fields)) : path;
492
+ const body = route.query ? void 0 : req;
493
+ if (!queue) return api.call(verb, target, body, headers);
494
+ if (!api.offline) return api.call(verb, target, body, headers).then((value) => ({ status: "sent", value }));
495
+ return api.call(verb, target, body, headers, { offline: "queue" });
490
496
  }
491
497
 
492
498
  // ../../stdlib/wix-sdk-auto/comments/categories.generated.ts
package/dist/cli.mjs CHANGED
@@ -7659,7 +7659,6 @@ function buttonVariant(style) {
7659
7659
  var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty, own, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
7660
7660
  var init_tokens = __esm({
7661
7661
  "../../core/ts/src/tokens.ts"() {
7662
- "use strict";
7663
7662
  SYSTEM_FONT_FAMILY = "$system";
7664
7663
  TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
7665
7664
  BUTTON_MIN_HIT_TARGET = 44;
@@ -159247,30 +159246,31 @@ var init_preview_assets_generated = __esm({
159247
159246
  "../../packages/serve/src/preview-assets.generated.ts"() {
159248
159247
  init_preview_assets_format();
159249
159248
  PREVIEW_ASSET_MANIFEST = [
159250
- { key: "assets/DashboardHost-BokjJwmj.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2916, sha256: "9828f2e618b27653e66059089b7e74689d030dfef8a2851434652fc0785a9fe9" },
159251
- { key: "assets/DevDrawer-B1SnthmI.js", contentType: "application/javascript; charset=utf-8", offset: 2924, length: 16744, sha256: "7fd48992effe2717e9c8ed4694a3193558f902dc9e003bfe7227cc2fe268b82f" },
159252
- { key: "assets/IdiomCompare-BLDpoPAX.js", contentType: "application/javascript; charset=utf-8", offset: 19668, length: 1892, sha256: "613ab96d758fdfe15a4a9b5469347d24850aecd88404d2d22834d6ec012e0db1" },
159253
- { key: "assets/SchemeCompare-B0JGR-R0.js", contentType: "application/javascript; charset=utf-8", offset: 21560, length: 1819, sha256: "4330fe18be3b48c4f817b0f04c54818c69d8758610cb9fbb5c22bd0cb7a0dd55" },
159254
- { key: "assets/index-r5Qs_hJy.js", contentType: "application/javascript; charset=utf-8", offset: 23379, length: 1391632, sha256: "4f7f9b7f1afc7f4c0e8c6eef9ee9837b709e0c3708c9b0e4447f648f7dea0b43" },
159255
- { key: "assets/pdf-g-P4V7RK.js", contentType: "application/javascript; charset=utf-8", offset: 1415011, length: 488199, sha256: "1a0a83df3dc0497e7422a97a57ef79aa9e2da26caeb2111071c3777ce5d1a2e0" },
159256
- { key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset: 1903210, length: 73, sha256: "41bcfda4f3c8c0a81c785ea87c69afc8e7d0ed8c333324aee94c273d881bb6aa" },
159257
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 1903283, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
159258
- { key: "assets/pdfDocument-BRVlpvxW.js", contentType: "application/javascript; charset=utf-8", offset: 3220317, length: 2868, sha256: "8b5d2ab93107a5ef5e3a27f3a23f0d32dca4c35820f005efcdd0805518d005f0" },
159259
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3223185, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
159260
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3227795, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
159261
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3716379, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
159262
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3807303, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
159263
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3898287, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
159264
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3989267, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
159265
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4080139, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
159266
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4171119, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
159267
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4279755, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
159268
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4388839, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
159269
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4497887, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
159270
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4605587, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
159271
- { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4693695, length: 6748, sha256: "4a92459977d7cefa1a6a7e020c3a63509737f083b3f2773557c1a5771665811a" },
159272
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4700443, length: 4947, sha256: "e503f41644df3484d66454be9c974c95105ccb83bcf6fc54e2b0e6a7b859f473" },
159273
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4705390, length: 17768, sha256: "a47dec8623a0f58def7d8785ee74d08483626e75d07c9328bfc9ecb2172c2e0d" }
159249
+ { key: "assets/DashboardHost-iN2OMPK-.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2916, sha256: "9f410fbec569fca5202efe5e88b091a77bf2b6210a189b5abb07b3ff018d0405" },
159250
+ { key: "assets/DevDrawer-Bg4qyJSz.js", contentType: "application/javascript; charset=utf-8", offset: 2924, length: 16744, sha256: "ff4f8836f6b742322051bfec3e5ac4c55975725e35e25aeabc1f307f80344381" },
159251
+ { key: "assets/IdiomCompare-CuryXS4K.js", contentType: "application/javascript; charset=utf-8", offset: 19668, length: 1892, sha256: "a530efee8b490a231196424f4510feba6ce7846fcddf45a3e99548506c74e975" },
159252
+ { key: "assets/PhonePreviewControl-DJ7qgMEw.js", contentType: "application/javascript; charset=utf-8", offset: 21560, length: 37724, sha256: "889a49c0272530a764e0fd0bb9080da33f416cc16414b5d943a2577dce0cee95" },
159253
+ { key: "assets/SchemeCompare-KExL-2GM.js", contentType: "application/javascript; charset=utf-8", offset: 59284, length: 1819, sha256: "97c2b1cf1e5772c64a97485968997183e96ff8e6389656d20a7b6cf6e5da7f03" },
159254
+ { key: "assets/index-Cui2w3yr.js", contentType: "application/javascript; charset=utf-8", offset: 61103, length: 1248923, sha256: "676ca9cfb0763a91d7270f7783fc9770d35533688afdf79fe81155d124bdff43" },
159255
+ { key: "assets/pdf-Bt7JFhVa.js", contentType: "application/javascript; charset=utf-8", offset: 1310026, length: 488199, sha256: "5a28e359c418fe56cfa4f5f96efe870b08dace00b82b450f4b53965bbf2aba04" },
159256
+ { key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset: 1798225, length: 73, sha256: "41bcfda4f3c8c0a81c785ea87c69afc8e7d0ed8c333324aee94c273d881bb6aa" },
159257
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 1798298, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
159258
+ { key: "assets/pdfDocument-DkkFoMzZ.js", contentType: "application/javascript; charset=utf-8", offset: 3115332, length: 2868, sha256: "7fbade61bd13782e00a6f709b8360b652be55949e189b502c81e6b5cb66b6099" },
159259
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3118200, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
159260
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3122810, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
159261
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3611394, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
159262
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3702318, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
159263
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3793302, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
159264
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3884282, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
159265
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 3975154, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
159266
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4066134, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
159267
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4174770, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
159268
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4283854, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
159269
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4392902, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
159270
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4500602, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
159271
+ { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4588710, length: 6748, sha256: "4a92459977d7cefa1a6a7e020c3a63509737f083b3f2773557c1a5771665811a" },
159272
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4595458, length: 4947, sha256: "ec57d4eaaf6a4f5cce271b2c21543882ed7a3806046920b15aa0a4f08cbc9644" },
159273
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4600405, length: 17768, sha256: "a47dec8623a0f58def7d8785ee74d08483626e75d07c9328bfc9ecb2172c2e0d" }
159274
159274
  ];
159275
159275
  }
159276
159276
  });
Binary file
@@ -255,6 +255,15 @@ when BOTH keys turn:
255
255
 
256
256
  (`himalaya.wixApi.call(method, path, body, headers, { offline: "queue" })` is the raw form.)
257
257
 
258
+ A generated `@himalaya/wix-*` method takes the same option where the endpoint can queue:
259
+ `createRsvp(req, { offline: "queue" })` answers `WixOfflineResult<WixCreateRsvpResponse>`
260
+ (`sent` / `queued`, as above), and `createRsvp(req)` still answers the plain response. The
261
+ option (`WixQueueCallOptions`, alongside `site`) is typed only on a write whose verb and path
262
+ the platform lists as safe to resend, so a read or any other write rejects it at compile time.
263
+ Today that is `events-v2`'s `createRsvp`; the Wix Data save/insert and the cart add are
264
+ hand-written and take `offline.call` above. An RSVP has no server-side dedupe, so on web it
265
+ never queues: offline it is refused with `offline_write_blocked`.
266
+
258
267
  What a worker gets back:
259
268
 
260
269
  - `sent` — online and nothing of the same `tag` waiting: the endpoint's own answer.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1412.0",
3
+ "version": "0.1414.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "e113faa2bb34e92c35fd4140a123dfa4b19f2e2998628db50f4e16d7"
74
+ "falconPackageHash": "0df87efd35bb34b85f0047752987adf8ed094fe80f5593e2e11b2ce9"
75
75
  }