@wix/himalaya-cli 0.1406.0 → 0.1408.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/dev-server/src/builder.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/wix-cache-policy.d.ts +64 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/wix-platform/src/index.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/wix-platform/src/offline.d.ts +66 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-platform.mjs +58 -25
- package/dist/cli.mjs +310 -67
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +4 -0
- package/guides/sdk-reference.json +6 -0
- package/guides/wix-api-usage.md +49 -0
- package/package.json +2 -2
- package/templates/beauty-salon-owner/dev/index.ts +49 -30
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/community-club-owner/dev/index.ts +49 -30
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/community-club-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/community-club-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/events-meetups-owner/dev/index.ts +49 -30
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/events-meetups-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/events-meetups-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/gym-fitness-owner/dev/index.ts +49 -30
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/nonprofit-cause-owner/dev/index.ts +49 -30
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/owner-lite/dev/index.ts +49 -30
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/owner-lite/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/owner-lite/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/podcast-creator-owner/dev/index.ts +49 -30
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/portfolio-creative-owner/dev/index.ts +49 -30
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/restaurant-owner/dev/index.ts +49 -30
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/restaurant-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/restaurant-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/retail-store-owner/dev/index.ts +49 -30
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/retail-store-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/retail-store-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
- package/templates/yoga-studio-owner/dev/index.ts +49 -30
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +8 -6
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-widget-model.ts +84 -1
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-widget-view.ts +34 -13
|
@@ -6,11 +6,74 @@ export interface WixCacheRule {
|
|
|
6
6
|
ttl: number;
|
|
7
7
|
swr: number;
|
|
8
8
|
tag: string | null;
|
|
9
|
+
queueOffline?: true;
|
|
10
|
+
/** How a resend of this write is deduplicated (§2.1). The client applies what it receives. */
|
|
11
|
+
idempotency?: OfflineIdempotency;
|
|
12
|
+
/** Seconds a queued write may wait before it is dead-lettered as `expired` (§6), already clamped. */
|
|
13
|
+
queueMaxAge?: number;
|
|
9
14
|
}
|
|
15
|
+
/** RFC 0072 §2.1 — how an endpoint dedupes a resend after an ambiguous attempt. */
|
|
16
|
+
export type OfflineIdempotency = "header" | "clientId" | "conflictIsApplied" | "unsentOnly";
|
|
10
17
|
export interface WixCachePolicy {
|
|
11
18
|
rules: WixCacheRule[];
|
|
12
19
|
defaultCacheable: boolean;
|
|
13
20
|
}
|
|
21
|
+
/** One endpoint whose writes may queue offline (§2.1): a method, ONE exact path, and the dedupe
|
|
22
|
+
* mechanism Task 0 observed live, with the evidence. An app rule queues only when it names this
|
|
23
|
+
* endpoint exactly — a prefix would take in its siblings (`/wix-data/v2/items` covers
|
|
24
|
+
* `/wix-data/v2/items/bulk/remove`), whose dedupe nobody verified. */
|
|
25
|
+
export interface OfflineQueueableEndpoint {
|
|
26
|
+
method: string;
|
|
27
|
+
path: string;
|
|
28
|
+
idempotency: OfflineIdempotency;
|
|
29
|
+
/** The write carries personal data even where no personal read prefix says so (§6). */
|
|
30
|
+
personal: boolean;
|
|
31
|
+
/** Where the Task 0 probe that justifies `idempotency` is recorded. */
|
|
32
|
+
evidence: string;
|
|
33
|
+
}
|
|
34
|
+
/** RFC 0072 §2.1 — deny-by-default: a write queues only if its endpoint is here. No row exists
|
|
35
|
+
* until its Task 0 probe is recorded, and none assumes an endpoint honours `Idempotency-Key`. */
|
|
36
|
+
export declare const OFFLINE_QUEUEABLE: readonly OfflineQueueableEndpoint[];
|
|
37
|
+
/** RFC 0072 §2.1 — never queueable, whatever an app declares: money, identity, stored value and
|
|
38
|
+
* capacity holds. `/gift-cards` and `/loyalty` have no trailing slash on purpose
|
|
39
|
+
* (`/loyalty-accounts/v1/accounts/{id}/adjust-points`). Checked before the allow-table. */
|
|
40
|
+
export declare const NEVER_QUEUEABLE_PREFIXES: readonly string[];
|
|
41
|
+
/** RFC 0072 §2.1 — a path any of whose segments, split on `-`, is one of these is never queueable:
|
|
42
|
+
* every checkout, payment, order, refund and hold route, under whatever allow prefix it sits. */
|
|
43
|
+
export declare const NEVER_QUEUEABLE_TOKENS: readonly string[];
|
|
44
|
+
/** RFC 0072 §6 — personal WRITES the personal-read list misses: a form submission carries a name,
|
|
45
|
+
* an email and a phone. */
|
|
46
|
+
export declare const OFFLINE_PERSONAL_WRITE_PREFIXES: readonly string[];
|
|
47
|
+
/** RFC 0072 §6 (D2) — how long a queued write may wait: 7 days, or 24 hours for personal data. */
|
|
48
|
+
export declare const OFFLINE_MAX_AGE: number;
|
|
49
|
+
export declare const OFFLINE_PERSONAL_MAX_AGE = 86400;
|
|
50
|
+
/** RFC 0072 §2.1 — whether `path` is on the never-queueable floor. Every client runs the same
|
|
51
|
+
* check on the concrete call path (core/schema/fixtures/offline-writes/never-queueable.json). */
|
|
52
|
+
export declare function isNeverQueueable(path: string): boolean;
|
|
53
|
+
/** Why a declared `queueOffline` rule does not queue, as a stable code (§2.2). */
|
|
54
|
+
export type OfflineQueueRefusalCode = "never_queueable" | "not_queueable" | "missing_method" | "missing_tag" | "absolute_url";
|
|
55
|
+
export interface OfflineQueueRefusal {
|
|
56
|
+
code: OfflineQueueRefusalCode;
|
|
57
|
+
method: string | null;
|
|
58
|
+
pathPrefix: string;
|
|
59
|
+
}
|
|
60
|
+
/** Every rule of `declared` that asks to queue offline but will not, with the coded reason, so
|
|
61
|
+
* `himalaya-dev app validate` and the dev-server can say so instead of dropping it silently. */
|
|
62
|
+
export declare function offlineQueueRefusals(declared?: DeclaredWixCache, table?: readonly OfflineQueueableEndpoint[]): OfflineQueueRefusal[];
|
|
63
|
+
/** RFC 0072 §2.2 — the effective queueing of one app rule:
|
|
64
|
+
* `app_wants AND on OFFLINE_QUEUEABLE AND NOT never_queueable AND method AND tag`, with the
|
|
65
|
+
* mechanism and the clamped max age stamped on, so no client needs the table. */
|
|
66
|
+
export declare function stampOfflineQueue(rule: WixCacheRule, declared: {
|
|
67
|
+
queueOffline?: boolean;
|
|
68
|
+
queueMaxAge?: number;
|
|
69
|
+
}, table?: readonly OfflineQueueableEndpoint[]): WixCacheRule;
|
|
70
|
+
/** RFC 0072 §2.2 — re-vet every queue rule of a served `wixCachePolicy` against the allow-table.
|
|
71
|
+
* An operator overlay (or an admin override) is deep-merged OVER the stamped policy, and its
|
|
72
|
+
* `rules` array replaces the stamped one wholesale — so a rule it carries with `queueOffline`
|
|
73
|
+
* would otherwise reach every client unchecked, with any mechanism and any max age. Here such a
|
|
74
|
+
* rule is stamped exactly like an app's own (or stripped), so the served queueing is always the
|
|
75
|
+
* table's. Rules without a queue key pass through untouched. */
|
|
76
|
+
export declare function sanitizeServedOfflineQueue<T>(policy: T, table?: readonly OfflineQueueableEndpoint[]): T;
|
|
14
77
|
/** The path a rule's prefix names: itself, or the path of an absolute `https://host/path` prefix
|
|
15
78
|
* (an account-level read a worker makes to a full Wix URL) — so the platform denies apply to it. */
|
|
16
79
|
export declare function rulePath(pathPrefix: string): string;
|
|
@@ -34,4 +97,4 @@ export type DeclaredWixCache = AppCacheConfig;
|
|
|
34
97
|
* `defaultCacheable: true` can never make a PII path cacheable by matching nothing.
|
|
35
98
|
* Everything is clamped under the platform envelope (PII denies, TTL ceiling).
|
|
36
99
|
*/
|
|
37
|
-
export declare function resolveWixCachePolicy(appName: string, declared?: DeclaredWixCache): WixCachePolicy;
|
|
100
|
+
export declare function resolveWixCachePolicy(appName: string, declared?: DeclaredWixCache, queueable?: readonly OfflineQueueableEndpoint[]): WixCachePolicy;
|
|
@@ -198,3 +198,4 @@ export declare const monitoring: {
|
|
|
198
198
|
};
|
|
199
199
|
/** Capability version, for bundles that gate on min binary version. */
|
|
200
200
|
export declare const version = 2;
|
|
201
|
+
export { offline, isOfflineWriteBlocked, isOfflineWriteOutcomeUnknown, type Sent, type Queued, type OfflineResult, type OfflineEvent, type OfflineEventType, type PendingWrite, type RejectedWrite, } from "./offline.js";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** The endpoint answered: `value` is what the call would have returned without the option. */
|
|
2
|
+
export interface Sent<T> {
|
|
3
|
+
status: "sent";
|
|
4
|
+
value: T;
|
|
5
|
+
}
|
|
6
|
+
/** The write waits in the outbox; `writeId` identifies it in events, `pending()` and `rejected()`. */
|
|
7
|
+
export interface Queued {
|
|
8
|
+
status: "queued";
|
|
9
|
+
writeId: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
}
|
|
12
|
+
export type OfflineResult<T> = Sent<T> | Queued;
|
|
13
|
+
export type OfflineEventType = "queued" | "applied" | "rejected";
|
|
14
|
+
export interface OfflineEvent {
|
|
15
|
+
writeId: string;
|
|
16
|
+
tag: string;
|
|
17
|
+
status?: number;
|
|
18
|
+
code?: string;
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PendingWrite {
|
|
22
|
+
writeId: string;
|
|
23
|
+
tag: string;
|
|
24
|
+
createdAt: number;
|
|
25
|
+
attempts: number;
|
|
26
|
+
}
|
|
27
|
+
export interface RejectedWrite {
|
|
28
|
+
writeId: string;
|
|
29
|
+
tag: string;
|
|
30
|
+
/** `http` | `conflict` | `expired` | `outcome_unknown` | `unauthorized`. */
|
|
31
|
+
reason: string;
|
|
32
|
+
status?: number;
|
|
33
|
+
code?: string;
|
|
34
|
+
method: string;
|
|
35
|
+
pathTemplate: string;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
rejectedAt: number;
|
|
38
|
+
/** The request body, while the write has not expired: for "retry" or "copy your text". */
|
|
39
|
+
body?: string;
|
|
40
|
+
}
|
|
41
|
+
/** `wixApi.call` with `{ offline: "queue" }`. On a runtime without offline writes the call is a plain
|
|
42
|
+
* live call, reported as `sent`. */
|
|
43
|
+
declare function call<T>(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<OfflineResult<T>>;
|
|
44
|
+
/** The two offline errors a worker branches on (`err.code`). */
|
|
45
|
+
export declare function isOfflineWriteBlocked(e: unknown): e is Error & {
|
|
46
|
+
code: "offline_write_blocked";
|
|
47
|
+
reason: string;
|
|
48
|
+
};
|
|
49
|
+
/** An `unsentOnly` write whose outcome is unknown: say "we couldn't confirm this went through". */
|
|
50
|
+
export declare function isOfflineWriteOutcomeUnknown(e: unknown): e is Error & {
|
|
51
|
+
code: "offline_write_outcome_unknown";
|
|
52
|
+
};
|
|
53
|
+
export declare const offline: {
|
|
54
|
+
call: typeof call;
|
|
55
|
+
/** This scope's queued writes (no bodies). */
|
|
56
|
+
pending: (opts?: {
|
|
57
|
+
tag?: string;
|
|
58
|
+
}) => Promise<PendingWrite[]>;
|
|
59
|
+
/** This scope's rejected writes. */
|
|
60
|
+
rejected: () => Promise<RejectedWrite[]>;
|
|
61
|
+
/** Clear one rejected write. A retry is a new write with a new `writeId`. */
|
|
62
|
+
dismiss: (writeId: string) => Promise<boolean>;
|
|
63
|
+
/** `queued`, `applied` and `rejected`, delivered while this worker runs. Returns an unsubscribe. */
|
|
64
|
+
on: (type: OfflineEventType, cb: (e: OfflineEvent) => void) => (() => void);
|
|
65
|
+
};
|
|
66
|
+
export {};
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts
CHANGED
|
@@ -676,6 +676,16 @@ export interface AppCacheRule {
|
|
|
676
676
|
swr?: number;
|
|
677
677
|
/** Resource family for write-through purge, e.g. "stores/products". */
|
|
678
678
|
tag?: string;
|
|
679
|
+
/**
|
|
680
|
+
* RFC 0072 — let a worker queue this endpoint's writes while offline (`{ offline: "queue" }` at
|
|
681
|
+
* the call site). Default false. Takes effect only where the platform allow-table lists the
|
|
682
|
+
* endpoint (method + this exact path) and it is not a payment, identity, stored-value or hold
|
|
683
|
+
* route; `method` and `tag` are then required. The server stamps the dedupe mechanism.
|
|
684
|
+
*/
|
|
685
|
+
queueOffline?: boolean;
|
|
686
|
+
/** Seconds a queued write may wait before it is dropped as expired. Clamped to 7 days, and to
|
|
687
|
+
* 24 hours for personal data. Defaults to that ceiling. */
|
|
688
|
+
queueMaxAge?: number;
|
|
679
689
|
}
|
|
680
690
|
export interface AppCacheConfig {
|
|
681
691
|
/** Behavior for a request no rule matches. Defaults to false (deny). */
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -1255,6 +1255,10 @@ export interface ListItemProps {
|
|
|
1255
1255
|
subtitleStyle?: TokenName;
|
|
1256
1256
|
/** #1049 — title color token. Default `textPrimary`. */
|
|
1257
1257
|
titleColor?: TokenName;
|
|
1258
|
+
/** Parse `title`/`subtitle` as inline Markdown (the `Text.markdown` subset: bold,
|
|
1259
|
+
* italic, code, links) — a literal, `$t:` key or `$item.` value; a live `$service:`
|
|
1260
|
+
* value renders literally, as for Text. `overline` stays literal. */
|
|
1261
|
+
markdown?: boolean;
|
|
1258
1262
|
/** #1049 — subtitle color token. Default `textSecondary`. */
|
|
1259
1263
|
subtitleColor?: TokenName;
|
|
1260
1264
|
/** #1049 — overline color token. Default `textSecondary`. */
|
|
@@ -13,9 +13,39 @@ function dispatch(handlerId, params, _options) {
|
|
|
13
13
|
return himalaya.dispatch(handlerId, stringParams);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// ../../core/sdk/wix-platform/src/offline.ts
|
|
17
|
+
function bridge() {
|
|
18
|
+
const himalaya = globalThis.himalaya;
|
|
19
|
+
return himalaya ? himalaya.wixApi : void 0;
|
|
20
|
+
}
|
|
21
|
+
async function call(method, path, body, headers) {
|
|
22
|
+
const api = bridge();
|
|
23
|
+
if (!api) throw new Error("wixApi bridge unavailable");
|
|
24
|
+
if (!api.offline) return { status: "sent", value: await api.call(method, path, body, headers) };
|
|
25
|
+
return await api.call(method, path, body, headers, { offline: "queue" });
|
|
26
|
+
}
|
|
27
|
+
function isOfflineWriteBlocked(e) {
|
|
28
|
+
return e?.code === "offline_write_blocked";
|
|
29
|
+
}
|
|
30
|
+
function isOfflineWriteOutcomeUnknown(e) {
|
|
31
|
+
return e?.code === "offline_write_outcome_unknown";
|
|
32
|
+
}
|
|
33
|
+
var offline = {
|
|
34
|
+
call,
|
|
35
|
+
/** This scope's queued writes (no bodies). */
|
|
36
|
+
pending: (opts) => bridge()?.offline?.pending(opts) ?? Promise.resolve([]),
|
|
37
|
+
/** This scope's rejected writes. */
|
|
38
|
+
rejected: () => bridge()?.offline?.rejected() ?? Promise.resolve([]),
|
|
39
|
+
/** Clear one rejected write. A retry is a new write with a new `writeId`. */
|
|
40
|
+
dismiss: (writeId) => bridge()?.offline?.dismiss(writeId) ?? Promise.resolve(false),
|
|
41
|
+
/** `queued`, `applied` and `rejected`, delivered while this worker runs. Returns an unsubscribe. */
|
|
42
|
+
on: (type, cb) => bridge()?.offline?.on(type, cb) ?? (() => {
|
|
43
|
+
})
|
|
44
|
+
};
|
|
45
|
+
|
|
16
46
|
// ../../core/sdk/wix-platform/src/index.ts
|
|
17
47
|
var CAP = "capability.wix_platform";
|
|
18
|
-
async function
|
|
48
|
+
async function call2(method, params) {
|
|
19
49
|
return await dispatch(`${CAP}.${method}`, params);
|
|
20
50
|
}
|
|
21
51
|
function wpHost() {
|
|
@@ -33,7 +63,7 @@ async function realWix(method, path, body) {
|
|
|
33
63
|
var bi = {
|
|
34
64
|
/** Fire a BI beacon with an explicit Frog `evid` + params. */
|
|
35
65
|
async track(evid, params) {
|
|
36
|
-
const r = await
|
|
66
|
+
const r = await call2("biTrack", {
|
|
37
67
|
evid: String(evid),
|
|
38
68
|
params: params ? JSON.stringify(params) : ""
|
|
39
69
|
});
|
|
@@ -79,11 +109,11 @@ async function conductCached(ns, spec, fallback, resolve) {
|
|
|
79
109
|
return task;
|
|
80
110
|
}
|
|
81
111
|
async function resolveExperiment(spec, fallback) {
|
|
82
|
-
const r = await
|
|
112
|
+
const r = await call2("experimentsConduct", { spec, fallback });
|
|
83
113
|
return typeof r?.variant === "string" ? r.variant : null;
|
|
84
114
|
}
|
|
85
115
|
async function resolveFlag(spec, fallback) {
|
|
86
|
-
const r = await
|
|
116
|
+
const r = await call2("flagsIsEnabled", { spec, fallback });
|
|
87
117
|
return typeof r?.enabled === "boolean" ? String(r.enabled) : null;
|
|
88
118
|
}
|
|
89
119
|
var experiments = {
|
|
@@ -101,7 +131,7 @@ var experiments = {
|
|
|
101
131
|
* (Symphony relies on server-side conduction; this is the generalized app-side
|
|
102
132
|
* exposure hook.) */
|
|
103
133
|
async exposure(spec, variant) {
|
|
104
|
-
const r = await
|
|
134
|
+
const r = await call2("experimentsExposure", { spec, variant });
|
|
105
135
|
return { ok: r?.ok ?? false };
|
|
106
136
|
}
|
|
107
137
|
};
|
|
@@ -114,12 +144,12 @@ var flags = {
|
|
|
114
144
|
},
|
|
115
145
|
/** A toggle's raw value (variant string) for non-boolean specs. */
|
|
116
146
|
async value(spec, fallback = "") {
|
|
117
|
-
const r = await
|
|
147
|
+
const r = await call2("flagsValue", { spec, fallback });
|
|
118
148
|
return r?.value ?? fallback;
|
|
119
149
|
},
|
|
120
150
|
/** All known toggle states (dev/diagnostic). */
|
|
121
151
|
async all() {
|
|
122
|
-
const r = await
|
|
152
|
+
const r = await call2("flagsAll");
|
|
123
153
|
return r?.flags && typeof r.flags === "object" ? r.flags : {};
|
|
124
154
|
}
|
|
125
155
|
};
|
|
@@ -129,31 +159,31 @@ var i18n = {
|
|
|
129
159
|
* has no route on any Wix host a himi app reaches (the same 404 as a made-up path, with or
|
|
130
160
|
* without a token), so `real.i18n` no longer sends it anywhere — it only ever 404ed. */
|
|
131
161
|
async t(key, fallback) {
|
|
132
|
-
const r = await
|
|
162
|
+
const r = await call2("i18nTranslate", { key, fallback: fallback ?? key });
|
|
133
163
|
return r?.value ?? fallback ?? key;
|
|
134
164
|
},
|
|
135
165
|
/** Current resolved UI locale (2-letter). */
|
|
136
166
|
async locale() {
|
|
137
|
-
const r = await
|
|
167
|
+
const r = await call2("i18nLocale");
|
|
138
168
|
return r?.locale ?? "en";
|
|
139
169
|
}
|
|
140
170
|
};
|
|
141
171
|
var ping = {
|
|
142
172
|
/** Register the device's push token with Wix Ping. */
|
|
143
173
|
async register() {
|
|
144
|
-
const r = await
|
|
174
|
+
const r = await call2("pingRegister");
|
|
145
175
|
return { registered: r?.registered ?? false, token: r?.token ?? "" };
|
|
146
176
|
},
|
|
147
177
|
/** Current Ping registration status (no network). */
|
|
148
178
|
async status() {
|
|
149
|
-
const r = await
|
|
179
|
+
const r = await call2("pingStatus");
|
|
150
180
|
return { registered: r?.registered ?? false, token: r?.token ?? "" };
|
|
151
181
|
}
|
|
152
182
|
};
|
|
153
183
|
var deeplink = {
|
|
154
184
|
/** Resolve a deferred (post-install) deep link via Wix Jot. Null when none. */
|
|
155
185
|
async resolveDeferred() {
|
|
156
|
-
const r = await
|
|
186
|
+
const r = await call2("deeplinkResolveDeferred");
|
|
157
187
|
return { link: r?.link && r.link.length > 0 ? r.link : null };
|
|
158
188
|
}
|
|
159
189
|
};
|
|
@@ -161,24 +191,24 @@ var session = {
|
|
|
161
191
|
/** The Wix mobile aspect-headers the transport attaches to wix-host requests
|
|
162
192
|
* (BSI, x-wix-language, mobile-app-version, x-wix-rpc-caller-id, …). */
|
|
163
193
|
async headers() {
|
|
164
|
-
const r = await
|
|
194
|
+
const r = await call2("sessionHeaders");
|
|
165
195
|
return r?.headers && typeof r.headers === "object" ? r.headers : {};
|
|
166
196
|
},
|
|
167
197
|
/** Whether a per-business signed instance is minted, and for which metaSite. */
|
|
168
198
|
async signedInstanceStatus() {
|
|
169
|
-
const r = await
|
|
199
|
+
const r = await call2("sessionSignedInstance");
|
|
170
200
|
return { present: r?.present ?? false, msid: r?.msid ?? null };
|
|
171
201
|
}
|
|
172
202
|
};
|
|
173
203
|
async function authTransition(method) {
|
|
174
|
-
await
|
|
204
|
+
await call2(method);
|
|
175
205
|
dropConductFlights();
|
|
176
206
|
return auth.getIdentity();
|
|
177
207
|
}
|
|
178
208
|
var auth = {
|
|
179
209
|
/** Current identity (visitor vs member vs owner) + who. */
|
|
180
210
|
async getIdentity() {
|
|
181
|
-
const r = await
|
|
211
|
+
const r = await call2("authIdentity");
|
|
182
212
|
return {
|
|
183
213
|
authenticated: r?.authenticated ?? false,
|
|
184
214
|
type: r?.type ?? "anonymous",
|
|
@@ -192,7 +222,7 @@ var auth = {
|
|
|
192
222
|
},
|
|
193
223
|
/** The current access/member token (or null when anonymous). */
|
|
194
224
|
async getAccessToken() {
|
|
195
|
-
const r = await
|
|
225
|
+
const r = await call2("authAccessToken");
|
|
196
226
|
return r?.token && r.token.length > 0 ? r.token : null;
|
|
197
227
|
},
|
|
198
228
|
/** Sign in (hosted Wix login → member token). Resolves with the new identity. */
|
|
@@ -224,7 +254,7 @@ var auth = {
|
|
|
224
254
|
} catch {
|
|
225
255
|
}
|
|
226
256
|
}
|
|
227
|
-
const r = await
|
|
257
|
+
const r = await call2("authSignedInstance", { businessId, type });
|
|
228
258
|
return r?.signedInstance && r.signedInstance.length > 0 ? r.signedInstance : null;
|
|
229
259
|
}
|
|
230
260
|
};
|
|
@@ -258,7 +288,7 @@ function parseBusinessInfo(res) {
|
|
|
258
288
|
}
|
|
259
289
|
async function scopeToSite(msid) {
|
|
260
290
|
try {
|
|
261
|
-
const r = await
|
|
291
|
+
const r = await call2("siteSetActive", { msid });
|
|
262
292
|
return { ok: !!r?.ok, msid: r?.msid ?? "" };
|
|
263
293
|
} finally {
|
|
264
294
|
dropConductFlights();
|
|
@@ -271,7 +301,7 @@ var site = {
|
|
|
271
301
|
},
|
|
272
302
|
/** The metaSiteId currently scoped ("" if none). */
|
|
273
303
|
async activeSite() {
|
|
274
|
-
const r = await
|
|
304
|
+
const r = await call2("siteActive");
|
|
275
305
|
return r?.msid ?? "";
|
|
276
306
|
},
|
|
277
307
|
/** The customer's business/site info (identity + locale + contact) from Wix Site
|
|
@@ -328,7 +358,7 @@ var site = {
|
|
|
328
358
|
var monitoring = {
|
|
329
359
|
/** Capture a handled error message (routes to the Sentry telemetry sink). */
|
|
330
360
|
async captureError(message, extra) {
|
|
331
|
-
const r = await
|
|
361
|
+
const r = await call2("monitoringCapture", {
|
|
332
362
|
message,
|
|
333
363
|
extra: extra ? JSON.stringify(extra) : ""
|
|
334
364
|
});
|
|
@@ -336,7 +366,7 @@ var monitoring = {
|
|
|
336
366
|
},
|
|
337
367
|
/** Capture an exception with an error class + message (crash-style report). */
|
|
338
368
|
async captureException(errorClass, message, extra) {
|
|
339
|
-
const r = await
|
|
369
|
+
const r = await call2("monitoringCaptureException", {
|
|
340
370
|
errorClass,
|
|
341
371
|
message,
|
|
342
372
|
extra: extra ? JSON.stringify(extra) : ""
|
|
@@ -345,15 +375,15 @@ var monitoring = {
|
|
|
345
375
|
},
|
|
346
376
|
/** Associate the current user with subsequent crash reports. */
|
|
347
377
|
async setUser(userId, traits) {
|
|
348
|
-
await
|
|
378
|
+
await call2("monitoringSetUser", { userId, traits: traits ? JSON.stringify(traits) : "" });
|
|
349
379
|
},
|
|
350
380
|
/** Set a scope tag attached to subsequent crash reports. */
|
|
351
381
|
async setTag(key, value) {
|
|
352
|
-
await
|
|
382
|
+
await call2("monitoringSetTag", { key, value });
|
|
353
383
|
},
|
|
354
384
|
/** Drop a breadcrumb onto the crash trail. */
|
|
355
385
|
async addBreadcrumb(message) {
|
|
356
|
-
await
|
|
386
|
+
await call2("monitoringBreadcrumb", { message });
|
|
357
387
|
}
|
|
358
388
|
};
|
|
359
389
|
var version = 2;
|
|
@@ -365,7 +395,10 @@ export {
|
|
|
365
395
|
flags,
|
|
366
396
|
i18n,
|
|
367
397
|
isMemberReal,
|
|
398
|
+
isOfflineWriteBlocked,
|
|
399
|
+
isOfflineWriteOutcomeUnknown,
|
|
368
400
|
monitoring,
|
|
401
|
+
offline,
|
|
369
402
|
ping,
|
|
370
403
|
session,
|
|
371
404
|
site,
|