@wix/himalaya-cli 0.1587.0 → 0.1589.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/torch/src/index.d.ts +39 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +13 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/extensions.d.ts +28 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +15 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/torch.mjs +78 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +14 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
- package/dist/cli.mjs +92 -46
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +16 -0
- package/guides/app-config.md +1 -1
- package/guides/designing-himi-screens.md +18 -0
- package/guides/importable-sdks.md +1 -0
- package/guides/qa-builds.md +12 -0
- package/guides/sdk-reference.json +99 -0
- package/guides/web-page-sdk-reference.md +1 -0
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/branded-lite/config.ts +7 -0
- package/templates/branded-lite/dev/index.ts +469 -0
- package/templates/branded-lite/himalaya.content.json +3 -0
- package/templates/branded-lite/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-my-groups/index.ts +236 -0
- package/templates/community-club/config.ts +7 -0
- package/templates/community-club/dev/index.ts +469 -0
- package/templates/community-club/himalaya.content.json +3 -0
- package/templates/community-club/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/community-club/tier5-src/himi-branded-lite-my-groups/index.ts +236 -0
- package/templates/events-meetups/config.ts +7 -0
- package/templates/events-meetups/dev/index.ts +469 -0
- package/templates/events-meetups/himalaya.content.json +3 -0
- package/templates/events-meetups/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/events-meetups/tier5-src/himi-branded-lite-my-groups/index.ts +236 -0
- package/templates/gym-fitness/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/nonprofit-cause/config.ts +7 -0
- package/templates/nonprofit-cause/dev/index.ts +469 -0
- package/templates/nonprofit-cause/himalaya.content.json +3 -0
- package/templates/nonprofit-cause/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-my-groups/index.ts +236 -0
- package/templates/podcast-creator/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/portfolio-creative/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/restaurant/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/retail-store/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/yoga-studio/tier5-src/_shared/branded-lite-hosted.ts +1 -0
|
@@ -38,12 +38,13 @@ export declare const CAPABILITY_REGISTRY: {
|
|
|
38
38
|
readonly system_intents: readonly ["donate", "refreshShortcuts"];
|
|
39
39
|
readonly tasks: readonly ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"];
|
|
40
40
|
readonly theme: readonly ["applyOverlay", "clearOverlay", "surfaces"];
|
|
41
|
+
readonly torch: readonly ["off", "on", "status", "toggle"];
|
|
41
42
|
readonly ui: readonly ["alert", "snackbar"];
|
|
42
43
|
readonly wix_cashier: readonly ["isAvailable", "proceedToPayment"];
|
|
43
44
|
readonly wix_chat: readonly ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"];
|
|
44
45
|
};
|
|
45
46
|
/** A capability id backed by an @himalaya/* SDK binding. */
|
|
46
|
-
export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "network" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "ui" | "wix_cashier" | "wix_chat";
|
|
47
|
+
export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "network" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "torch" | "ui" | "wix_cashier" | "wix_chat";
|
|
47
48
|
/** All `capability.<id>.<verb>` action ids, flattened (the worker-bridge wire vocabulary). */
|
|
48
49
|
export declare const CAPABILITY_ACTION_IDS: readonly string[];
|
|
49
50
|
/** Capability id → the @himalaya/* package(s) a worker imports to reach it — every dispatch
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/torch/src/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** The torch right now. `level` is 0..1 while lit, `null` while off or when unknown. */
|
|
2
|
+
export interface TorchStatus {
|
|
3
|
+
/** Does this device have a torch the app can drive? */
|
|
4
|
+
available: boolean;
|
|
5
|
+
/** Is the torch lit? */
|
|
6
|
+
on: boolean;
|
|
7
|
+
/** Brightness 0..1 while lit (1 = the brightest the device allows), else `null`. */
|
|
8
|
+
level: number | null;
|
|
9
|
+
/** Why the torch is unavailable, when it is. */
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TorchOnOptions {
|
|
13
|
+
/** Brightness in 0..1 (default 1). Values outside the range are clamped; 0 turns the torch off.
|
|
14
|
+
* A device without adjustable strength (Android below API 33, or a single-level flash) lights at
|
|
15
|
+
* full brightness and reports `level: 1`. */
|
|
16
|
+
level?: number;
|
|
17
|
+
}
|
|
18
|
+
export type TorchErrorCode = "unavailable" | "invalid_argument" | "failed";
|
|
19
|
+
/** What every torch verb throws when the native/web arm reports a typed error. */
|
|
20
|
+
export interface TorchError extends Error {
|
|
21
|
+
code: TorchErrorCode;
|
|
22
|
+
}
|
|
23
|
+
/** Build a [TorchError]. */
|
|
24
|
+
export declare function torchError(code: TorchErrorCode, message: string): TorchError;
|
|
25
|
+
/** Narrow a caught value: `catch (e) { if (isTorchError(e) && e.code === "unavailable") … }`. */
|
|
26
|
+
export declare function isTorchError(e: unknown): e is TorchError;
|
|
27
|
+
/**
|
|
28
|
+
* Turn the torch on, at `level` (0..1, default 1). Resolves with the resulting status.
|
|
29
|
+
* Rejects `unavailable` on a device with no torch, `invalid_argument` for a non-numeric level.
|
|
30
|
+
*/
|
|
31
|
+
export declare function on(opts?: TorchOnOptions): Promise<TorchStatus>;
|
|
32
|
+
/** Turn the torch off. Idempotent — resolves (never rejects `unavailable`) when there is no torch. */
|
|
33
|
+
export declare function off(): Promise<TorchStatus>;
|
|
34
|
+
/** Flip the torch: off → on at full brightness, on → off. Rejects `unavailable` with no torch. */
|
|
35
|
+
export declare function toggle(): Promise<TorchStatus>;
|
|
36
|
+
/** Read the torch's availability and state. Never rejects for a missing torch. */
|
|
37
|
+
export declare function status(): Promise<TorchStatus>;
|
|
38
|
+
/** Capability version, for bundles that gate on a min binary version. */
|
|
39
|
+
export declare const version = 1;
|
|
@@ -36,6 +36,7 @@ import type * as SpeechSdk from "@wix/himalaya/speech";
|
|
|
36
36
|
import type * as SystemIntentsSdk from "@wix/himalaya/system-intents";
|
|
37
37
|
import type * as TasksSdk from "@wix/himalaya/tasks";
|
|
38
38
|
import type * as ThemeSdk from "@wix/himalaya/theme";
|
|
39
|
+
import type * as TorchSdk from "@wix/himalaya/torch";
|
|
39
40
|
import type * as UiSdk from "@wix/himalaya/ui";
|
|
40
41
|
import type * as WixCashierSdk from "@wix/himalaya/wix-cashier";
|
|
41
42
|
import type * as WixChatSdk from "@wix/himalaya/wix-chat";
|
|
@@ -89,6 +90,7 @@ export interface HimalayaPageCapabilities {
|
|
|
89
90
|
readonly "system_intents": PageModule<typeof SystemIntentsSdk> & PageEvents;
|
|
90
91
|
readonly "tasks": PageModule<typeof TasksSdk> & PageEvents;
|
|
91
92
|
readonly "theme": PageModule<typeof ThemeSdk> & PageEvents;
|
|
93
|
+
readonly "torch": PageModule<typeof TorchSdk> & PageEvents;
|
|
92
94
|
readonly "ui": PageModule<typeof UiSdk> & PageEvents;
|
|
93
95
|
readonly "wix_cashier": PageModule<typeof WixCashierSdk> & PageEvents;
|
|
94
96
|
readonly "wix_chat": PageModule<typeof WixChatSdk> & PageEvents;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts
CHANGED
|
@@ -638,8 +638,19 @@ export interface PushConfig {
|
|
|
638
638
|
/** A `tier5.<service>.<action>` dispatched on EVERY notification — receipt or tap
|
|
639
639
|
* — so a worker can keep a badge count or refresh a feed without navigating. It
|
|
640
640
|
* receives `templateId`, `topic`, `metaSiteId`, `notificationId`, `link`,
|
|
641
|
-
* `resolvedLink` and `tapped
|
|
641
|
+
* `resolvedLink` and `tapped`, plus (#4710) `title` and `body` — the strings the
|
|
642
|
+
* notification DISPLAYS, after rich-template interpolation — and `payloadJson`, the
|
|
643
|
+
* raw payload as a JSON object string (APNs `aps` removed, a nested Ping `data`
|
|
644
|
+
* merged in, every value a string). Over 16 KB, `payloadJson` keeps the entries that
|
|
645
|
+
* fit and `payloadTruncated` is `"true"`. All values are strings, per the dispatch
|
|
646
|
+
* bridge's contract. A notification-button press carries the same params. */
|
|
642
647
|
observerAction?: string;
|
|
648
|
+
/** Foreground presentation of a remote push (#4710). "banner" (default) shows the
|
|
649
|
+
* system notification; "silent" shows none while the app is in the foreground, for
|
|
650
|
+
* an app that already surfaces the event in-app. iOS presents with the badge only;
|
|
651
|
+
* Android posts nothing but applies the badge. The observer still receives the
|
|
652
|
+
* receipt. Background delivery is unchanged. */
|
|
653
|
+
foreground?: "banner" | "silent";
|
|
643
654
|
}
|
|
644
655
|
export type IapProductType = "subscription" | "nonConsumable" | "consumable";
|
|
645
656
|
export interface IapProduct {
|
|
@@ -837,7 +848,7 @@ export interface OrientationEnvelope {
|
|
|
837
848
|
export declare const DEFAULT_ORIENTATION_ENVELOPE: Required<OrientationEnvelope>;
|
|
838
849
|
/** Fill in the absent families. Total, so callers never branch on `undefined`. */
|
|
839
850
|
export declare function resolveOrientationEnvelope(env?: OrientationEnvelope): Required<OrientationEnvelope>;
|
|
840
|
-
export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "l10n" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "network" | "wix_cashier" | "wix_chat" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
|
|
851
|
+
export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "l10n" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "torch" | "network" | "wix_cashier" | "wix_chat" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
|
|
841
852
|
/** `defineApp({ wixIap })` — the purchases-service app a build binds this app to. */
|
|
842
853
|
export interface WixIapConfig {
|
|
843
854
|
/** The purchases service's app UUID, registered on the app's own auth site. Not a secret. */
|
|
@@ -31,6 +31,34 @@ export interface WixListGroupRulesResponse {
|
|
|
31
31
|
* is unconfirmed — needsLiveProbe. A group with no rules answers an empty `rules`.
|
|
32
32
|
*/
|
|
33
33
|
export declare function listRules(groupId: string, opts?: WixCallOptions): Promise<WixListGroupRulesResponse>;
|
|
34
|
+
export type WixGroupMembershipStatus = "UNKNOWN_STATUS" | "JOINED" | "PENDING";
|
|
35
|
+
export interface WixGroupMembership {
|
|
36
|
+
groupId?: string;
|
|
37
|
+
status?: WixGroupMembershipStatus | string;
|
|
38
|
+
/** Empty unless the membership is JOINED. */
|
|
39
|
+
role?: {
|
|
40
|
+
value?: "MEMBER" | "ADMIN" | string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface WixListMembershipsResponse {
|
|
44
|
+
memberships?: WixGroupMembership[];
|
|
45
|
+
metadata?: {
|
|
46
|
+
count?: number;
|
|
47
|
+
offset?: number;
|
|
48
|
+
total?: number;
|
|
49
|
+
tooManyToCount?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* List a member's group memberships — GET /social-groups-proxy/members/v2/members/{memberId}/memberships.
|
|
54
|
+
*
|
|
55
|
+
* @scope member — a signed-in member lists their own memberships only; an owner-scoped token lists
|
|
56
|
+
* anyone's. Sorted by `groupId` descending by default. `limit` is at most 100.
|
|
57
|
+
*/
|
|
58
|
+
export declare function listMemberships(memberId: string, paging?: {
|
|
59
|
+
limit?: number;
|
|
60
|
+
offset?: number;
|
|
61
|
+
}, opts?: WixCallOptions): Promise<WixListMembershipsResponse>;
|
|
34
62
|
export interface WixGroupCoverImage {
|
|
35
63
|
/** A previously-uploaded Wix Media file id (from site-media generate-upload-url + PUT). */
|
|
36
64
|
mediaId?: string;
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -65,11 +65,18 @@ function parseBranchEntries(spec) {
|
|
|
65
65
|
return entries;
|
|
66
66
|
}
|
|
67
67
|
function parseBranches(spec) {
|
|
68
|
-
const branches =
|
|
68
|
+
const branches = /* @__PURE__ */ Object.create(null);
|
|
69
69
|
for (const { key, body } of parseBranchEntries(spec)) branches[key] = body;
|
|
70
70
|
return branches;
|
|
71
71
|
}
|
|
72
72
|
function formatMessage(pattern, args = {}, locale2 = "en") {
|
|
73
|
+
return formatAt(pattern, args, locale2, 0);
|
|
74
|
+
}
|
|
75
|
+
var MAX_NESTING = 16;
|
|
76
|
+
function ownArg(args, name) {
|
|
77
|
+
return Object.prototype.hasOwnProperty.call(args, name) ? args[name] : void 0;
|
|
78
|
+
}
|
|
79
|
+
function formatAt(pattern, args, locale2, nesting) {
|
|
73
80
|
if (!pattern.includes("{") && !pattern.includes("''")) return pattern;
|
|
74
81
|
let out = "";
|
|
75
82
|
let i = 0;
|
|
@@ -111,11 +118,15 @@ function formatMessage(pattern, args = {}, locale2 = "en") {
|
|
|
111
118
|
const body = pattern.slice(start, i);
|
|
112
119
|
i++;
|
|
113
120
|
const [name, kind, spec] = splitArg(body);
|
|
114
|
-
const value = args
|
|
121
|
+
const value = ownArg(args, name);
|
|
115
122
|
if (!kind) {
|
|
116
123
|
out += value === void 0 || value === null ? `{${name}}` : String(value);
|
|
117
124
|
continue;
|
|
118
125
|
}
|
|
126
|
+
if ((kind === "plural" || kind === "select") && spec !== void 0 && nesting >= MAX_NESTING) {
|
|
127
|
+
out += "{" + body + "}";
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
119
130
|
if (kind === "plural" && spec !== void 0) {
|
|
120
131
|
const n = typeof value === "number" ? value : Number(value);
|
|
121
132
|
const branches = parseBranches(spec);
|
|
@@ -125,7 +136,7 @@ function formatMessage(pattern, args = {}, locale2 = "en") {
|
|
|
125
136
|
out += "{" + body + "}";
|
|
126
137
|
continue;
|
|
127
138
|
}
|
|
128
|
-
out +=
|
|
139
|
+
out += formatAt(chosen.replace(/#/g, Number.isFinite(n) ? String(n) : ""), args, locale2, nesting + 1);
|
|
129
140
|
continue;
|
|
130
141
|
}
|
|
131
142
|
if (kind === "select" && spec !== void 0) {
|
|
@@ -135,7 +146,7 @@ function formatMessage(pattern, args = {}, locale2 = "en") {
|
|
|
135
146
|
out += "{" + body + "}";
|
|
136
147
|
continue;
|
|
137
148
|
}
|
|
138
|
-
out +=
|
|
149
|
+
out += formatAt(chosen, args, locale2, nesting + 1);
|
|
139
150
|
continue;
|
|
140
151
|
}
|
|
141
152
|
out += value === void 0 || value === null ? `{${name}}` : String(value);
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
38
38
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
39
39
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
40
40
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
41
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
41
42
|
"ui": ["alert", "snackbar"],
|
|
42
43
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
43
44
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -53,6 +53,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
53
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
54
54
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
55
55
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
56
|
+
"torch": ["off", "on", "status", "toggle"],
|
|
56
57
|
"ui": ["alert", "snackbar"],
|
|
57
58
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
58
59
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// ../../core/sdk/dispatch/src/index.ts
|
|
2
|
+
function dispatch(handlerId, params, _options) {
|
|
3
|
+
const himalaya = globalThis.himalaya;
|
|
4
|
+
if (!himalaya) {
|
|
5
|
+
return Promise.reject(
|
|
6
|
+
new Error("@himalaya/dispatch: called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5).")
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
const stringParams = {};
|
|
10
|
+
if (params) {
|
|
11
|
+
for (const [k, v] of Object.entries(params)) stringParams[k] = String(v);
|
|
12
|
+
}
|
|
13
|
+
return himalaya.dispatch(handlerId, stringParams);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// ../../core/sdk/torch/src/index.ts
|
|
17
|
+
var ERROR_CODES = ["unavailable", "invalid_argument", "failed"];
|
|
18
|
+
function torchError(code, message) {
|
|
19
|
+
const e = new Error(message);
|
|
20
|
+
e.name = "TorchError";
|
|
21
|
+
e.code = code;
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
function isTorchError(e) {
|
|
25
|
+
if (!(e instanceof Error)) return false;
|
|
26
|
+
const code = e.code;
|
|
27
|
+
return typeof code === "string" && ERROR_CODES.includes(code);
|
|
28
|
+
}
|
|
29
|
+
function unwrap(r) {
|
|
30
|
+
const err = r?.error;
|
|
31
|
+
if (err && typeof err === "object") {
|
|
32
|
+
const code = ERROR_CODES.includes(err.code ?? "") ? err.code : "failed";
|
|
33
|
+
throw torchError(code, err.message ?? code);
|
|
34
|
+
}
|
|
35
|
+
return r;
|
|
36
|
+
}
|
|
37
|
+
function toStatus(r) {
|
|
38
|
+
const o = r ?? {};
|
|
39
|
+
const on2 = o.on === true || o.on === "true";
|
|
40
|
+
const lvl = typeof o.level === "number" ? o.level : typeof o.level === "string" && o.level !== "" ? Number(o.level) : null;
|
|
41
|
+
const status2 = {
|
|
42
|
+
available: o.available === true || o.available === "true",
|
|
43
|
+
on: on2,
|
|
44
|
+
level: on2 && lvl !== null && Number.isFinite(lvl) ? lvl : null
|
|
45
|
+
};
|
|
46
|
+
if (typeof o.reason === "string" && o.reason) status2.reason = o.reason;
|
|
47
|
+
return status2;
|
|
48
|
+
}
|
|
49
|
+
async function on(opts = {}) {
|
|
50
|
+
const params = {};
|
|
51
|
+
if (opts.level !== void 0) {
|
|
52
|
+
if (typeof opts.level !== "number" || !Number.isFinite(opts.level)) {
|
|
53
|
+
throw torchError("invalid_argument", `level must be a number in 0..1, got ${String(opts.level)}`);
|
|
54
|
+
}
|
|
55
|
+
params.level = String(Math.min(1, Math.max(0, opts.level)));
|
|
56
|
+
}
|
|
57
|
+
return toStatus(unwrap(await dispatch("capability.torch.on", params)));
|
|
58
|
+
}
|
|
59
|
+
async function off() {
|
|
60
|
+
return toStatus(unwrap(await dispatch("capability.torch.off", {})));
|
|
61
|
+
}
|
|
62
|
+
async function toggle() {
|
|
63
|
+
return toStatus(unwrap(await dispatch("capability.torch.toggle", {})));
|
|
64
|
+
}
|
|
65
|
+
async function status() {
|
|
66
|
+
return toStatus(unwrap(await dispatch("capability.torch.status", {})));
|
|
67
|
+
}
|
|
68
|
+
var version = 1;
|
|
69
|
+
export {
|
|
70
|
+
isTorchError,
|
|
71
|
+
off,
|
|
72
|
+
on,
|
|
73
|
+
status,
|
|
74
|
+
toggle,
|
|
75
|
+
torchError,
|
|
76
|
+
version
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=torch.mjs.map
|
|
@@ -10,6 +10,19 @@ function listRules(groupId, opts) {
|
|
|
10
10
|
if (!groupId) throw new Error("listRules: groupId is required");
|
|
11
11
|
return wixCall("GET", `/social-groups/v2/rules/${encodeURIComponent(groupId)}`, void 0, opts);
|
|
12
12
|
}
|
|
13
|
+
function listMemberships(memberId, paging = {}, opts) {
|
|
14
|
+
if (!memberId) throw new Error("listMemberships: memberId is required");
|
|
15
|
+
const params = [
|
|
16
|
+
paging.limit !== void 0 ? `limit=${Math.max(0, Math.min(100, Math.trunc(paging.limit)))}` : "",
|
|
17
|
+
paging.offset !== void 0 ? `offset=${Math.max(0, Math.trunc(paging.offset))}` : ""
|
|
18
|
+
].filter(Boolean).join("&");
|
|
19
|
+
return wixCall(
|
|
20
|
+
"GET",
|
|
21
|
+
`/social-groups-proxy/members/v2/members/${encodeURIComponent(memberId)}/memberships${params ? `?${params}` : ""}`,
|
|
22
|
+
void 0,
|
|
23
|
+
opts
|
|
24
|
+
);
|
|
25
|
+
}
|
|
13
26
|
function createGroup(group) {
|
|
14
27
|
return wixCall("POST", "/social-groups-proxy/groups/v2/groups", { group });
|
|
15
28
|
}
|
|
@@ -106,6 +119,7 @@ export {
|
|
|
106
119
|
joinGroup,
|
|
107
120
|
leaveGroup,
|
|
108
121
|
listJoinGroupRequests,
|
|
122
|
+
listMemberships,
|
|
109
123
|
listRules,
|
|
110
124
|
queryGroups,
|
|
111
125
|
queryMembers,
|
|
@@ -254,6 +254,10 @@
|
|
|
254
254
|
"types": "./dist/_types/core/sdk/time/src/index.d.ts",
|
|
255
255
|
"import": "./dist/time.mjs"
|
|
256
256
|
},
|
|
257
|
+
"./torch": {
|
|
258
|
+
"types": "./dist/_types/core/sdk/torch/src/index.d.ts",
|
|
259
|
+
"import": "./dist/torch.mjs"
|
|
260
|
+
},
|
|
257
261
|
"./ui": {
|
|
258
262
|
"types": "./dist/_types/core/sdk/ui/src/index.d.ts",
|
|
259
263
|
"import": "./dist/ui.mjs"
|