@wix/himalaya-cli 0.1404.0 → 0.1405.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 (102) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +6 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ai-site-chat/src/extensions.d.ts +10 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ai-site-chat/src/index.d.ts +102 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ai-site-chat.mjs +70 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
  7. package/dist/cli.mjs +95 -37
  8. package/dist/preview-assets.generated.bin +0 -0
  9. package/fixtures/wix-canned.json +3 -0
  10. package/guides/component-reference.json +3 -2
  11. package/guides/component-reference.md +7 -1
  12. package/guides/importable-sdks.md +1 -0
  13. package/guides/sdk-reference.json +107 -0
  14. package/package.json +2 -2
  15. package/templates/beauty-salon/config.ts +7 -0
  16. package/templates/beauty-salon/dev/index.ts +1750 -0
  17. package/templates/beauty-salon/himalaya.content.json +3 -0
  18. package/templates/beauty-salon/site-functions/README.md +37 -0
  19. package/templates/beauty-salon/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  20. package/templates/beauty-salon/tier5-src/_shared/member-account-routes.ts +11 -3
  21. package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  22. package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  23. package/templates/branded-lite/config.ts +7 -0
  24. package/templates/branded-lite/dev/index.ts +1750 -0
  25. package/templates/branded-lite/himalaya.content.json +3 -0
  26. package/templates/branded-lite/site-functions/README.md +37 -0
  27. package/templates/branded-lite/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  28. package/templates/branded-lite/tier5-src/_shared/member-account-routes.ts +11 -3
  29. package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  30. package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  31. package/templates/community-club/config.ts +7 -0
  32. package/templates/community-club/dev/index.ts +1750 -0
  33. package/templates/community-club/himalaya.content.json +3 -0
  34. package/templates/community-club/site-functions/README.md +37 -0
  35. package/templates/community-club/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  36. package/templates/community-club/tier5-src/_shared/member-account-routes.ts +11 -3
  37. package/templates/community-club/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  38. package/templates/community-club/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  39. package/templates/events-meetups/config.ts +7 -0
  40. package/templates/events-meetups/dev/index.ts +1750 -0
  41. package/templates/events-meetups/himalaya.content.json +3 -0
  42. package/templates/events-meetups/site-functions/README.md +37 -0
  43. package/templates/events-meetups/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  44. package/templates/events-meetups/tier5-src/_shared/member-account-routes.ts +11 -3
  45. package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  46. package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  47. package/templates/gym-fitness/config.ts +7 -0
  48. package/templates/gym-fitness/dev/index.ts +1750 -0
  49. package/templates/gym-fitness/himalaya.content.json +3 -0
  50. package/templates/gym-fitness/site-functions/README.md +37 -0
  51. package/templates/gym-fitness/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  52. package/templates/gym-fitness/tier5-src/_shared/member-account-routes.ts +11 -3
  53. package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  54. package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  55. package/templates/nonprofit-cause/config.ts +7 -0
  56. package/templates/nonprofit-cause/dev/index.ts +1750 -0
  57. package/templates/nonprofit-cause/himalaya.content.json +3 -0
  58. package/templates/nonprofit-cause/site-functions/README.md +37 -0
  59. package/templates/nonprofit-cause/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  60. package/templates/nonprofit-cause/tier5-src/_shared/member-account-routes.ts +11 -3
  61. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  62. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  63. package/templates/podcast-creator/config.ts +7 -0
  64. package/templates/podcast-creator/dev/index.ts +1750 -0
  65. package/templates/podcast-creator/himalaya.content.json +3 -0
  66. package/templates/podcast-creator/site-functions/README.md +37 -0
  67. package/templates/podcast-creator/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  68. package/templates/podcast-creator/tier5-src/_shared/member-account-routes.ts +11 -3
  69. package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  70. package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  71. package/templates/portfolio-creative/config.ts +7 -0
  72. package/templates/portfolio-creative/dev/index.ts +1750 -0
  73. package/templates/portfolio-creative/himalaya.content.json +3 -0
  74. package/templates/portfolio-creative/site-functions/README.md +37 -0
  75. package/templates/portfolio-creative/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  76. package/templates/portfolio-creative/tier5-src/_shared/member-account-routes.ts +11 -3
  77. package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  78. package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  79. package/templates/restaurant/config.ts +7 -0
  80. package/templates/restaurant/dev/index.ts +1750 -0
  81. package/templates/restaurant/himalaya.content.json +3 -0
  82. package/templates/restaurant/site-functions/README.md +37 -0
  83. package/templates/restaurant/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  84. package/templates/restaurant/tier5-src/_shared/member-account-routes.ts +11 -3
  85. package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  86. package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  87. package/templates/retail-store/config.ts +7 -0
  88. package/templates/retail-store/dev/index.ts +1750 -0
  89. package/templates/retail-store/himalaya.content.json +3 -0
  90. package/templates/retail-store/site-functions/README.md +37 -0
  91. package/templates/retail-store/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  92. package/templates/retail-store/tier5-src/_shared/member-account-routes.ts +11 -3
  93. package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  94. package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
  95. package/templates/yoga-studio/config.ts +7 -0
  96. package/templates/yoga-studio/dev/index.ts +1750 -0
  97. package/templates/yoga-studio/himalaya.content.json +3 -0
  98. package/templates/yoga-studio/site-functions/README.md +37 -0
  99. package/templates/yoga-studio/site-functions/himiMemberPhotoUploadUrl.js +90 -0
  100. package/templates/yoga-studio/tier5-src/_shared/member-account-routes.ts +11 -3
  101. package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  102. package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/index.ts +1091 -0
@@ -640,6 +640,9 @@ export declare function mediaField(props: {
640
640
  valuePath: string;
641
641
  uploadService: string;
642
642
  label?: string;
643
+ presentation?: string;
644
+ fallbackTextPath?: string;
645
+ heading?: string;
643
646
  }, opts?: {
644
647
  id?: string;
645
648
  }): Component;
@@ -1656,6 +1656,12 @@ export interface MediaFieldProps {
1656
1656
  uploadService: string;
1657
1657
  /** Empty-well copy (a message key or literal). Default "Add a photo". */
1658
1658
  label?: string;
1659
+ /** Set to "avatar" for a circular picker row; omitted preserves the 160pt image well. */
1660
+ presentation?: string;
1661
+ /** `$service:<svc>.<path>` → initials shown in avatar mode when no photo is set. */
1662
+ fallbackTextPath?: string;
1663
+ /** Optional visible heading in avatar mode; label remains the action caption. */
1664
+ heading?: string;
1659
1665
  }
1660
1666
  /**
1661
1667
  * A formatted, multiline editor that writes HTML into an enclosing Form under `id`.
@@ -0,0 +1,10 @@
1
+ import type { WixCallOptions, WixStreamMessagesRequest } from "./index.js";
2
+ /** Submits a visitor message (for example a visitor-option selection) to the widget's
3
+ * `messages/stream` endpoint. This is a BUFFERED call, not a stream: the endpoint
4
+ * answers with an SSE body, but the Wix bridge reads the whole body before it resolves,
5
+ * so the promise settles only once the response has ended and the events are not
6
+ * delivered as they arrive. The payload is returned opaque, as the bridge hands it
7
+ * over. Native clients expose the same buffered call as `streamMessages`. The request
8
+ * is sent as the visitor or member session the host supplies; a gateway error rejects.
9
+ * @scope visitor — an anonymous visitor session is enough. */
10
+ export declare function streamMessages(req: WixStreamMessagesRequest, opts?: WixCallOptions): Promise<unknown>;
@@ -0,0 +1,102 @@
1
+ declare global {
2
+ var himalaya: {
3
+ wixApi?: {
4
+ call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ };
6
+ };
7
+ }
8
+ /** Per-call options. `site` addresses ONE call at a business other than the app's
9
+ * active one, so a cross-site rollup can read several businesses concurrently without
10
+ * `setActiveSite` moving the whole process between them. Omitted ⇒ the active business,
11
+ * byte-identical to a call that never passed options.
12
+ *
13
+ * `site.forSite(msid)` from `@himalaya/wix-platform` returns a value of this shape, so
14
+ * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
+ export interface WixCallOptions {
16
+ site?: string;
17
+ }
18
+ export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
+ /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
20
+ * DELETE request from. A nested object flattens to dotted field paths
21
+ * (`{ sort: { order: "ASC" } }` → `sort.order=ASC`), an array repeats its key
22
+ * (`{ id: ["a", "b"] }` → `id=a&id=b`), and an absent field contributes nothing —
23
+ * so an empty request yields the bare path. A field whose value is an array of
24
+ * objects has no query-string spelling and is omitted, exactly as Wix's own client
25
+ * omits it; such a field has to be sent through a POST sibling endpoint instead.
26
+ *
27
+ * Built from template literals and `encodeURIComponent`, never `URLSearchParams`:
28
+ * that is a host global the bare Tier-5 worker runtimes (JSCore / Hermes /
29
+ * QuickJS-ng) do not provide, so reaching for it would throw a ReferenceError
30
+ * before the request went out rather than degrade.
31
+ *
32
+ * Exported so the hand-written ./extensions sidecar can build the same URLs. */
33
+ export declare function wixQueryPath(path: string, req: unknown): string;
34
+ export interface WixMessage {
35
+ id?: string;
36
+ createdDate?: string;
37
+ sender?: string;
38
+ conversationId?: string;
39
+ answerTo?: string;
40
+ messageType?: string;
41
+ body?: WixBody;
42
+ inboxId?: string;
43
+ visitorOptions?: string[];
44
+ assistantActions?: string[];
45
+ visitorOptionsFields?: Record<string, unknown>[];
46
+ engineStatus?: string;
47
+ }
48
+ export interface WixBody {
49
+ mainText?: string;
50
+ footerText?: string;
51
+ additionalData?: Record<string, unknown>[];
52
+ }
53
+ export interface WixListMessagesRequest {
54
+ cursorPaging?: WixCursorPaging;
55
+ }
56
+ export interface WixCursorPaging {
57
+ limit?: number;
58
+ cursor?: string;
59
+ }
60
+ export interface WixListMessagesResponse {
61
+ messages?: WixMessage[];
62
+ pagingMetadata?: WixPagingMetadataV2;
63
+ }
64
+ export interface WixPagingMetadataV2 {
65
+ count?: number;
66
+ offset?: number;
67
+ total?: number;
68
+ tooManyToCount?: boolean;
69
+ cursors?: WixCursors;
70
+ hasNext?: boolean;
71
+ }
72
+ export interface WixCursors {
73
+ next?: string;
74
+ prev?: string;
75
+ }
76
+ export interface WixStreamMessagesRequest {
77
+ message: WixStreamMessage;
78
+ }
79
+ export interface WixStreamMessage {
80
+ sender: "SITE_VISITOR";
81
+ messageType: "VISITOR_OPTION_SELECTED";
82
+ answerTo: string;
83
+ body: WixStreamMessageBody;
84
+ }
85
+ export interface WixStreamMessageBody {
86
+ mainText: string;
87
+ additionalData: WixStreamMessageAdditionalData[];
88
+ }
89
+ export interface WixStreamMessageAdditionalData {
90
+ id: string;
91
+ type: "select_option";
92
+ action: string;
93
+ }
94
+ /**
95
+ * Lists the messages of the AI Site Chat (Wix Smart Chat) conversation for the active site, paged by cursor via `cursorPaging`. Runs as the site visitor or member session the host supplies; an empty `messages` array means the conversation has no messages yet, and a 4xx/5xx rejects with the gateway error.
96
+ *
97
+ * @scope visitor — an anonymous visitor session is enough.
98
+ *
99
+ * GET /wix-assistant-widget/v1/messages/list
100
+ */
101
+ export declare function listMessages(req?: WixListMessagesRequest, opts?: WixCallOptions): Promise<WixListMessagesResponse>;
102
+ export * from "./extensions.js";
@@ -0,0 +1,70 @@
1
+ // ../../stdlib/wix-sdk/ai-site-chat/src/extensions.ts
2
+ function streamMessages(req, opts) {
3
+ return wixCall("POST", "/wix-assistant-widget/v1/messages/stream", req, opts);
4
+ }
5
+
6
+ // ../../stdlib/wix-sdk/ai-site-chat/src/index.ts
7
+ function wixCallHeaders(opts) {
8
+ const site = opts?.site?.trim();
9
+ return site ? { "wix-site-id": site } : void 0;
10
+ }
11
+ function wixCall(method, path, body, opts) {
12
+ if (!globalThis.himalaya?.wixApi) {
13
+ return Promise.reject(
14
+ new Error(
15
+ "@himalaya/wix-ai-site-chat: host did not install the wixApi bridge"
16
+ )
17
+ );
18
+ }
19
+ return globalThis.himalaya.wixApi.call(
20
+ method,
21
+ path,
22
+ body,
23
+ wixCallHeaders(opts)
24
+ );
25
+ }
26
+ function wixQueryPath(path, req) {
27
+ const parts = [];
28
+ const pair = (key, value) => {
29
+ parts.push(
30
+ `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
31
+ );
32
+ };
33
+ const add = (key, value) => {
34
+ if (value === void 0 || value === null) return;
35
+ if (Array.isArray(value)) {
36
+ for (const item of value) {
37
+ if (item === void 0 || item === null || typeof item === "object")
38
+ continue;
39
+ pair(key, item);
40
+ }
41
+ return;
42
+ }
43
+ if (typeof value === "object") {
44
+ for (const [k, v] of Object.entries(value))
45
+ add(`${key}.${k}`, v);
46
+ return;
47
+ }
48
+ pair(key, value);
49
+ };
50
+ for (const [key, value] of Object.entries(
51
+ req ?? {}
52
+ ))
53
+ add(key, value);
54
+ return parts.length > 0 ? `${path}?${parts.join("&")}` : path;
55
+ }
56
+ function listMessages(req = {}, opts) {
57
+ return wixCall(
58
+ "GET",
59
+ wixQueryPath("/wix-assistant-widget/v1/messages/list", req),
60
+ void 0,
61
+ opts
62
+ );
63
+ }
64
+ export {
65
+ listMessages,
66
+ streamMessages,
67
+ wixCall,
68
+ wixQueryPath
69
+ };
70
+ //# sourceMappingURL=wix-ai-site-chat.mjs.map
@@ -266,6 +266,10 @@
266
266
  "types": "./dist/_types/stdlib/wix-sdk/activity-counters-v1/src/index.d.ts",
267
267
  "import": "./dist/wix-activity-counters.mjs"
268
268
  },
269
+ "./wix-ai-site-chat": {
270
+ "types": "./dist/_types/stdlib/wix-sdk/ai-site-chat/src/index.d.ts",
271
+ "import": "./dist/wix-ai-site-chat.mjs"
272
+ },
269
273
  "./wix-analytics": {
270
274
  "types": "./dist/_types/stdlib/wix-sdk/analytics/src/index.d.ts",
271
275
  "import": "./dist/wix-analytics.mjs"