@wix/himalaya-cli 0.1728.0 → 0.1730.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/entity-extraction/src/index.d.ts +34 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/catalog-pricing-contract.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/pricing-contract.d.ts +6 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +4 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/text-embedding/src/index.d.ts +37 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/translation/src/index.d.ts +51 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans.d.ts +20 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/index.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/entity-extraction.mjs +38 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +49 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +35 -9
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +57 -14
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/text-embedding.mjs +76 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/translation.mjs +66 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +12 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{ec5d778f3e7ecbc2351ab7a8f3509483b798094de9f889fe8b03447db1413cb6.bin → 9c4b4a8e0772f247f08e61b35d51b0bd2574408381cab23ec88cad1c7df68177.bin} +1 -1
- package/dist/browser-plane/sw.js +8 -8
- package/dist/cli.mjs +514 -315
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/app-config.md +1 -1
- package/guides/capabilities.md +3 -0
- package/guides/iap-pricing.md +2 -2
- package/guides/iap-screen-adoption.md +1 -1
- package/guides/importable-sdks.md +3 -0
- package/guides/release-notes.md +30 -0
- package/guides/sdk-reference.json +252 -7
- package/guides/web-page-sdk-reference.md +3 -0
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +16 -7
- package/templates/beauty-salon-owner/dev/index.ts +35 -0
- package/templates/branded-lite/dev/index.ts +16 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +16 -7
- package/templates/community-club/dev/index.ts +2 -0
- package/templates/community-club-owner/dev/index.ts +35 -0
- package/templates/conference/dev/index.ts +1 -0
- package/templates/events-meetups/dev/index.ts +2 -0
- package/templates/events-meetups-owner/dev/index.ts +31 -0
- package/templates/gym-fitness/dev/index.ts +1 -0
- package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +16 -7
- package/templates/gym-fitness-owner/dev/index.ts +37 -0
- package/templates/nonprofit-cause/dev/index.ts +2 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +16 -7
- package/templates/nonprofit-cause-owner/dev/index.ts +33 -0
- package/templates/owner-lite/dev/index.ts +37 -0
- package/templates/podcast-creator/dev/index.ts +2 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +16 -7
- package/templates/podcast-creator-owner/dev/index.ts +35 -0
- package/templates/portfolio-creative/dev/index.ts +2 -0
- package/templates/portfolio-creative-owner/dev/index.ts +35 -0
- package/templates/restaurant/dev/index.ts +2 -0
- package/templates/restaurant-owner/dev/index.ts +37 -0
- package/templates/retail-store-owner/dev/index.ts +33 -0
- package/templates/yoga-studio/dev/index.ts +2 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +16 -7
- package/templates/yoga-studio-owner/dev/index.ts +33 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type EntityType = "date_time" | "address" | "phone" | "email" | "url" | "money" | "flight_number" | "tracking_number" | "iban" | "payment_card" | "isbn" | "person" | "place" | "organization";
|
|
2
|
+
export interface EntityExtractionAvailability {
|
|
3
|
+
available: boolean;
|
|
4
|
+
/** "apple_natural_language" | "mlkit" when available. */
|
|
5
|
+
engine?: string;
|
|
6
|
+
reason?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtractOptions {
|
|
9
|
+
/** BCP-47 language of the text. Default "en". */
|
|
10
|
+
language?: string;
|
|
11
|
+
/** Only these types (default: all the engine supports). */
|
|
12
|
+
types?: EntityType[];
|
|
13
|
+
}
|
|
14
|
+
export interface Entity {
|
|
15
|
+
/** The entity as it appears in the text. */
|
|
16
|
+
text: string;
|
|
17
|
+
/** Start index into the input (inclusive). */
|
|
18
|
+
start: number;
|
|
19
|
+
/** End index into the input (exclusive). */
|
|
20
|
+
end: number;
|
|
21
|
+
type: EntityType;
|
|
22
|
+
/** A normalised form when the engine has one — ISO-8601 for date_time, the URL for url, … */
|
|
23
|
+
value?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ExtractResult {
|
|
26
|
+
/** In order of appearance. */
|
|
27
|
+
entities: Entity[];
|
|
28
|
+
engine: string;
|
|
29
|
+
}
|
|
30
|
+
/** Whether on-device entity extraction is available for a language (default "en"). Never rejects. */
|
|
31
|
+
export declare function availability(language?: string): Promise<EntityExtractionAvailability>;
|
|
32
|
+
/** Extract entities from text on device. Rejects when unavailable. */
|
|
33
|
+
export declare function extract(text: string, opts?: ExtractOptions): Promise<ExtractResult>;
|
|
34
|
+
export declare const version = 1;
|
|
@@ -33,6 +33,10 @@ export interface IapItemView {
|
|
|
33
33
|
retryable: boolean;
|
|
34
34
|
/** True only when the existing commerce checkout may run: disabled or an explicit regular route. */
|
|
35
35
|
canStartRegularCheckout: boolean;
|
|
36
|
+
/** Apple only: the price is an auto-renewing subscription's, so the screen shows its own billing period. */
|
|
37
|
+
renews?: true;
|
|
38
|
+
/** With `renews`: StoreKit's billing period, ISO 8601 (`P1M`). A screen sells only when its item's matches. */
|
|
39
|
+
subscriptionPeriod?: string;
|
|
36
40
|
/** Apple purchasing is not available until a backend verifies transactions. */
|
|
37
41
|
purchasable: false;
|
|
38
42
|
}
|
|
@@ -23,10 +23,13 @@ export interface PricingInput {
|
|
|
23
23
|
}
|
|
24
24
|
export type PricingMapping = {
|
|
25
25
|
reference: CatalogReference;
|
|
26
|
-
} & (
|
|
26
|
+
} & (
|
|
27
|
+
/** `renews`: mapped as an App Store auto-renewing subscription, so only a StoreKit subscription prices it. */
|
|
28
|
+
{
|
|
27
29
|
route: "appleIap";
|
|
28
30
|
productId: string;
|
|
29
31
|
mappingRevision: string;
|
|
32
|
+
renews?: true;
|
|
30
33
|
} | {
|
|
31
34
|
route: "regular";
|
|
32
35
|
} | {
|
|
@@ -50,6 +53,8 @@ export type ItemPriceState = {
|
|
|
50
53
|
displayPrice: string;
|
|
51
54
|
productId: string;
|
|
52
55
|
mappingRevision: string;
|
|
56
|
+
renews?: true;
|
|
57
|
+
subscriptionPeriod?: string;
|
|
53
58
|
} | {
|
|
54
59
|
status: "ready";
|
|
55
60
|
source: "regular";
|
|
@@ -36,10 +36,19 @@ export declare const HIMALAYA_SERVE_IAP_ROUTE: WixIapRoute;
|
|
|
36
36
|
export interface AppleSaleRule {
|
|
37
37
|
appProductId(entityId: string): string;
|
|
38
38
|
productType: "NON_CONSUMABLE" | "CONSUMABLE";
|
|
39
|
+
/** Also sold as an App Store auto-renewing subscription; wix-iap decides per item which one applies. */
|
|
40
|
+
renews?: boolean;
|
|
39
41
|
}
|
|
40
42
|
/** StartItemPayment's CatalogReference: the purchases catalog sells a Stores product under its product
|
|
41
43
|
* id (eCom's `catalogItemId`). One-time unlocks only, whatever the backend also accepts. */
|
|
42
44
|
export declare const STORES_PRODUCT_SALE_RULE: AppleSaleRule;
|
|
45
|
+
/**
|
|
46
|
+
* Whether recurring Pricing Plans sell as App Store auto-renewing subscriptions. OFF: they stay off until
|
|
47
|
+
* the subscription lifecycle (expiry, refunds, auto-renew off, grace) is proven; a separate change turns
|
|
48
|
+
* it on. Off, an
|
|
49
|
+
* `AUTO_RENEWING_SUBSCRIPTION` mapping is not for sale and a recurring plan cannot start Apple checkout.
|
|
50
|
+
*/
|
|
51
|
+
export declare const PLAN_SUBSCRIPTIONS_APPLE_SALES_ENABLED = false;
|
|
43
52
|
/**
|
|
44
53
|
* Whether Wix Video videos sell through the App Store. OFF until the Wix Video purchase is proven live
|
|
45
54
|
* (gates G1–G4). A video with a one-time Sale price above zero is mapped under
|
|
@@ -56,6 +65,7 @@ export declare const VIDEOS_APPLE_SALES_ENABLED = false;
|
|
|
56
65
|
*/
|
|
57
66
|
export interface AppleSaleOptions {
|
|
58
67
|
videosAppleSalesEnabled?: boolean;
|
|
68
|
+
planSubscriptionsAppleSalesEnabled?: boolean;
|
|
59
69
|
}
|
|
60
70
|
/** Resolves runtime sale eligibility independently from the catalog's provisioning support. */
|
|
61
71
|
export declare function appleSaleRules(options?: AppleSaleOptions): Readonly<Record<string, AppleSaleRule>>;
|
|
@@ -11,6 +11,7 @@ export declare const CAPABILITY_REGISTRY: {
|
|
|
11
11
|
readonly camera: readonly ["capture", "pickDocument", "prepareImage", "scanQR"];
|
|
12
12
|
readonly clipboard: readonly ["hasImage", "hasText", "readText", "writeImage", "writeText"];
|
|
13
13
|
readonly contacts: readonly ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"];
|
|
14
|
+
readonly entity_extraction: readonly ["availability", "extract"];
|
|
14
15
|
readonly file_picker: readonly ["pick", "pickDirectoryForExport"];
|
|
15
16
|
readonly files: readonly ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"];
|
|
16
17
|
readonly godot: readonly ["loadPack", "release", "send"];
|
|
@@ -40,15 +41,17 @@ export declare const CAPABILITY_REGISTRY: {
|
|
|
40
41
|
readonly speech: readonly ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"];
|
|
41
42
|
readonly system_intents: readonly ["donate", "refreshShortcuts"];
|
|
42
43
|
readonly tasks: readonly ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"];
|
|
44
|
+
readonly text_embedding: readonly ["availability", "embed"];
|
|
43
45
|
readonly text_recognition: readonly ["availability", "recognize"];
|
|
44
46
|
readonly theme: readonly ["applyOverlay", "clearOverlay", "surfaces"];
|
|
45
47
|
readonly torch: readonly ["off", "on", "status", "toggle"];
|
|
48
|
+
readonly translation: readonly ["availability", "identifyLanguage", "prepare", "translate"];
|
|
46
49
|
readonly ui: readonly ["alert", "snackbar"];
|
|
47
50
|
readonly wix_cashier: readonly ["isAvailable", "proceedToPayment"];
|
|
48
51
|
readonly wix_chat: readonly ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"];
|
|
49
52
|
};
|
|
50
53
|
/** A capability id backed by an @himalaya/* SDK binding. */
|
|
51
|
-
export type SdkCapability = "app_info" | "audio_record" | "barcode_detection" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "image_labeling" | "keyboard" | "legacy_import" | "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" | "text_recognition" | "theme" | "torch" | "ui" | "wix_cashier" | "wix_chat";
|
|
54
|
+
export type SdkCapability = "app_info" | "audio_record" | "barcode_detection" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "entity_extraction" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "image_labeling" | "keyboard" | "legacy_import" | "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" | "text_embedding" | "text_recognition" | "theme" | "torch" | "translation" | "ui" | "wix_cashier" | "wix_chat";
|
|
52
55
|
/** All `capability.<id>.<verb>` action ids, flattened (the worker-bridge wire vocabulary). */
|
|
53
56
|
export declare const CAPABILITY_ACTION_IDS: readonly string[];
|
|
54
57
|
/** Capability id → the @himalaya/* package(s) a worker imports to reach it — every dispatch
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** The most texts one `embed` call takes. */
|
|
2
|
+
export declare const MAX_TEXTS_PER_CALL = 64;
|
|
3
|
+
export interface TextEmbeddingAvailability {
|
|
4
|
+
available: boolean;
|
|
5
|
+
/** "apple_natural_language" | "mediapipe" when available. */
|
|
6
|
+
engine?: string;
|
|
7
|
+
/** Vector length, when known. */
|
|
8
|
+
dimensions?: number;
|
|
9
|
+
/** Why it is unavailable — on Android, also while the model is still downloading. */
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface EmbedResult {
|
|
13
|
+
/** One vector per input text, in the same order. */
|
|
14
|
+
vectors: number[][];
|
|
15
|
+
dimensions: number;
|
|
16
|
+
engine: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RankedText {
|
|
19
|
+
text: string;
|
|
20
|
+
/** Index of the text in the input array. */
|
|
21
|
+
index: number;
|
|
22
|
+
/** Cosine similarity to the query, -1..1. */
|
|
23
|
+
score: number;
|
|
24
|
+
}
|
|
25
|
+
/** Whether on-device embeddings are available for a language (default "en"). Never rejects. */
|
|
26
|
+
export declare function availability(language?: string): Promise<TextEmbeddingAvailability>;
|
|
27
|
+
/** Embed up to {@link MAX_TEXTS_PER_CALL} texts on device. Rejects when unavailable. */
|
|
28
|
+
export declare function embed(texts: string[], opts?: {
|
|
29
|
+
language?: string;
|
|
30
|
+
}): Promise<EmbedResult>;
|
|
31
|
+
/** Cosine similarity of two vectors (-1..1); 0 when either is empty or zero or their lengths differ. */
|
|
32
|
+
export declare function cosineSimilarity(a: readonly number[], b: readonly number[]): number;
|
|
33
|
+
/** Rank `candidates` by semantic similarity to `query`, most similar first. Embeds in batches. */
|
|
34
|
+
export declare function rank(query: string, candidates: string[], opts?: {
|
|
35
|
+
language?: string;
|
|
36
|
+
}): Promise<RankedText[]>;
|
|
37
|
+
export declare const version = 1;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type PairStatus = "installed" | "downloadable" | "unsupported";
|
|
2
|
+
export interface TranslationAvailability {
|
|
3
|
+
available: boolean;
|
|
4
|
+
/** "apple_translation" | "mlkit" | "chrome_built_in" when available. */
|
|
5
|
+
engine?: string;
|
|
6
|
+
reason?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PairAvailability extends TranslationAvailability {
|
|
9
|
+
status: PairStatus;
|
|
10
|
+
}
|
|
11
|
+
export interface LanguageCandidate {
|
|
12
|
+
language: string;
|
|
13
|
+
confidence: number;
|
|
14
|
+
}
|
|
15
|
+
export interface IdentifyResult {
|
|
16
|
+
/** The most likely language, or "und". */
|
|
17
|
+
language: string;
|
|
18
|
+
confidence: number;
|
|
19
|
+
/** Up to five candidates, most likely first. */
|
|
20
|
+
candidates: LanguageCandidate[];
|
|
21
|
+
engine: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PrepareResult {
|
|
24
|
+
status: PairStatus;
|
|
25
|
+
engine: string;
|
|
26
|
+
reason?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TranslateInput {
|
|
29
|
+
text: string;
|
|
30
|
+
/** The language to translate into. */
|
|
31
|
+
target: string;
|
|
32
|
+
/** The source language; identified from the text when omitted. */
|
|
33
|
+
source?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TranslateResult {
|
|
36
|
+
text: string;
|
|
37
|
+
source: string;
|
|
38
|
+
target: string;
|
|
39
|
+
engine: string;
|
|
40
|
+
}
|
|
41
|
+
/** Whether on-device translation is available at all on this device / host (spec R8). Never rejects. */
|
|
42
|
+
export declare function availability(): Promise<TranslationAvailability>;
|
|
43
|
+
/** Whether a language pair is installed, downloadable or unsupported. Never rejects. */
|
|
44
|
+
export declare function pairAvailability(source: string, target: string): Promise<PairAvailability>;
|
|
45
|
+
/** Identify the language of a piece of text. Rejects when unavailable. */
|
|
46
|
+
export declare function identifyLanguage(text: string): Promise<IdentifyResult>;
|
|
47
|
+
/** Download a pair's models where the platform allows it (Android, web), and answer its status. */
|
|
48
|
+
export declare function prepare(source: string, target: string): Promise<PrepareResult>;
|
|
49
|
+
/** Translate text on device. Rejects when the pair is unavailable or the source cannot be identified. */
|
|
50
|
+
export declare function translate(input: TranslateInput): Promise<TranslateResult>;
|
|
51
|
+
export declare const version = 1;
|
|
@@ -9,6 +9,7 @@ import type * as CallsSdk from "@wix/himalaya/calls";
|
|
|
9
9
|
import type * as CameraSdk from "@wix/himalaya/camera";
|
|
10
10
|
import type * as ClipboardSdk from "@wix/himalaya/clipboard";
|
|
11
11
|
import type * as ContactsSdk from "@wix/himalaya/contacts";
|
|
12
|
+
import type * as EntityExtractionSdk from "@wix/himalaya/entity-extraction";
|
|
12
13
|
import type * as FilePickerSdk from "@wix/himalaya/file-picker";
|
|
13
14
|
import type * as FilesSdk from "@wix/himalaya/files";
|
|
14
15
|
import type * as GodotSdk from "@wix/himalaya/godot";
|
|
@@ -38,9 +39,11 @@ import type * as SpeakerDiarizationSdk from "@wix/himalaya/speaker-diarization";
|
|
|
38
39
|
import type * as SpeechSdk from "@wix/himalaya/speech";
|
|
39
40
|
import type * as SystemIntentsSdk from "@wix/himalaya/system-intents";
|
|
40
41
|
import type * as TasksSdk from "@wix/himalaya/tasks";
|
|
42
|
+
import type * as TextEmbeddingSdk from "@wix/himalaya/text-embedding";
|
|
41
43
|
import type * as TextRecognitionSdk from "@wix/himalaya/text-recognition";
|
|
42
44
|
import type * as ThemeSdk from "@wix/himalaya/theme";
|
|
43
45
|
import type * as TorchSdk from "@wix/himalaya/torch";
|
|
46
|
+
import type * as TranslationSdk from "@wix/himalaya/translation";
|
|
44
47
|
import type * as UiSdk from "@wix/himalaya/ui";
|
|
45
48
|
import type * as WixCashierSdk from "@wix/himalaya/wix-cashier";
|
|
46
49
|
import type * as WixChatSdk from "@wix/himalaya/wix-chat";
|
|
@@ -67,6 +70,7 @@ export interface HimalayaPageCapabilities {
|
|
|
67
70
|
readonly "camera": PageModule<typeof CameraSdk> & PageEvents;
|
|
68
71
|
readonly "clipboard": PageModule<typeof ClipboardSdk> & PageEvents;
|
|
69
72
|
readonly "contacts": PageModule<typeof ContactsSdk> & PageEvents;
|
|
73
|
+
readonly "entity_extraction": PageModule<typeof EntityExtractionSdk> & PageEvents;
|
|
70
74
|
readonly "file_picker": PageModule<typeof FilePickerSdk> & PageEvents;
|
|
71
75
|
readonly "files": PageModule<typeof FilesSdk> & PageEvents;
|
|
72
76
|
readonly "godot": PageModule<typeof GodotSdk> & PageEvents;
|
|
@@ -96,9 +100,11 @@ export interface HimalayaPageCapabilities {
|
|
|
96
100
|
readonly "speech": PageModule<typeof SpeechSdk> & PageEvents;
|
|
97
101
|
readonly "system_intents": PageModule<typeof SystemIntentsSdk> & PageEvents;
|
|
98
102
|
readonly "tasks": PageModule<typeof TasksSdk> & PageEvents;
|
|
103
|
+
readonly "text_embedding": PageModule<typeof TextEmbeddingSdk> & PageEvents;
|
|
99
104
|
readonly "text_recognition": PageModule<typeof TextRecognitionSdk> & PageEvents;
|
|
100
105
|
readonly "theme": PageModule<typeof ThemeSdk> & PageEvents;
|
|
101
106
|
readonly "torch": PageModule<typeof TorchSdk> & PageEvents;
|
|
107
|
+
readonly "translation": PageModule<typeof TranslationSdk> & PageEvents;
|
|
102
108
|
readonly "ui": PageModule<typeof UiSdk> & PageEvents;
|
|
103
109
|
readonly "wix_cashier": PageModule<typeof WixCashierSdk> & PageEvents;
|
|
104
110
|
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
|
@@ -883,7 +883,7 @@ export interface OrientationEnvelope {
|
|
|
883
883
|
export declare const DEFAULT_ORIENTATION_ENVELOPE: Required<OrientationEnvelope>;
|
|
884
884
|
/** Fill in the absent families. Total, so callers never branch on `undefined`. */
|
|
885
885
|
export declare function resolveOrientationEnvelope(env?: OrientationEnvelope): Required<OrientationEnvelope>;
|
|
886
|
-
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" | "text_recognition" | "image_labeling" | "barcode_detection" | "app_info" | "release_control" | "legacy_import" | "godot" | "base44" | "animation" | "video_playback";
|
|
886
|
+
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" | "text_recognition" | "translation" | "image_labeling" | "barcode_detection" | "text_embedding" | "entity_extraction" | "app_info" | "release_control" | "legacy_import" | "godot" | "base44" | "animation" | "video_playback";
|
|
887
887
|
/** `defineApp({ wixIap })` — the purchases-service app a build binds this app to. */
|
|
888
888
|
export interface WixIapConfig {
|
|
889
889
|
/** The purchases service's app UUID, registered on the app's own auth site. Not a secret. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { isAppleSellablePlan, applePlanPeriod, type ApplePlanPricing } from "./pricing-plans.js";
|
|
1
2
|
export { storesProductOrders, classifyCart } from "./stores.js";
|
|
2
3
|
export { wixVideoOrders } from "./videos.js";
|
|
3
4
|
export declare const onlineProgramOrders: import("../apple-iap-contract.js").IapItemPaymentAdapter;
|
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import type { AccessRead, IapItemPaymentAdapter, SessionBoundBridge } from "../apple-iap-contract.js";
|
|
2
2
|
export declare const pricingPlanItemPayments: IapItemPaymentAdapter;
|
|
3
|
+
/** A plan's pricing as Pricing Plans v2 lists it. */
|
|
4
|
+
export interface ApplePlanPricing {
|
|
5
|
+
singlePaymentUnlimited?: boolean;
|
|
6
|
+
subscription?: {
|
|
7
|
+
cycleCount?: number;
|
|
8
|
+
cycleDuration?: {
|
|
9
|
+
count?: number;
|
|
10
|
+
unit?: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
freeTrialDays?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Whether a plans screen offers the plan through Apple: one-time unlimited, or recurring until canceled with
|
|
17
|
+
* no trial. wix-iap still checks the plan's v3 variant (fees, start type) and refuses what Apple cannot sell.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isAppleSellablePlan(pricing: ApplePlanPricing | undefined): boolean;
|
|
20
|
+
/** The App Store billing period (ISO 8601, `P1M`) Apple must renew the plan at; "" for a plan that does not
|
|
21
|
+
* renew. A screen offers the plan only when its App Store price renews at exactly this period. */
|
|
22
|
+
export declare function applePlanPeriod(pricing: ApplePlanPricing | undefined): string;
|
|
3
23
|
/** The member's live orders of the plan, paged: one ACTIVE order is access; none at all is no access. */
|
|
4
24
|
export declare function planAccess(planId: string, bridge: SessionBoundBridge): Promise<AccessRead>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createIapCommerce } from "./commerce.js";
|
|
2
2
|
export { iapPurchaseFields } from "./purchase-fields.js";
|
|
3
3
|
export { createAppleIapCheckout } from "./apple-iap.js";
|
|
4
|
-
export { onlineProgramOrders, pricingPlanOrders, storesProductOrders, bookingOrders, eventTicketOrders, wixVideoOrders, classifyCart } from "./iap-verticals/index.js";
|
|
4
|
+
export { onlineProgramOrders, pricingPlanOrders, storesProductOrders, bookingOrders, eventTicketOrders, wixVideoOrders, classifyCart, isAppleSellablePlan, applePlanPeriod, type ApplePlanPricing } from "./iap-verticals/index.js";
|
|
5
5
|
export { createWorkerOrderRefStore } from "./order-refs.js";
|
|
6
6
|
export { storesAppleSalesEnabled, videosAppleSalesEnabled } from "./checkout-source.js";
|
|
7
7
|
export type { AccessRead, AppleIapCheckout, AppleIapCheckoutDependencies, AppleIapCheckoutPhase, AppleIapCheckoutState, BridgeOutcome, BridgeRefusal, CashierRoute, IapAdapterBase, IapEligibility, IapItemPaymentAdapter, IapOrderAdapter, IapOrderItem, IapVerticalOrderAdapter, OrderAttempt, OrderFailureCode, OrderPartitionKey, OrderRef, OrderRefPartition, OrderRefStage, OrderRefStore, PaymentAccess, PaymentProgress, SessionBoundBridge, VerticalRef, WixBridge, } from "./apple-iap-contract.js";
|
|
@@ -177,6 +177,8 @@ export interface PlanRow {
|
|
|
177
177
|
/** Per-row CTA, so the template needs no conditional of its own. */
|
|
178
178
|
cta: string;
|
|
179
179
|
appleSupported: boolean;
|
|
180
|
+
/** The App Store period Apple must renew it at ("" for a one-time plan): offered only on a matching price. */
|
|
181
|
+
applePeriod: string;
|
|
180
182
|
joinDisabled: boolean;
|
|
181
183
|
joinNote: string;
|
|
182
184
|
}
|
|
@@ -26,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
26
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
27
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
28
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
29
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
30
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
31
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -55,9 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
55
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
56
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
57
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
58
60
|
"text_recognition": ["availability", "recognize"],
|
|
59
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
60
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
61
64
|
"ui": ["alert", "snackbar"],
|
|
62
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
63
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -26,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
26
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
27
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
28
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
29
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
30
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
31
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -55,9 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
55
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
56
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
57
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
58
60
|
"text_recognition": ["availability", "recognize"],
|
|
59
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
60
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
61
64
|
"ui": ["alert", "snackbar"],
|
|
62
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
63
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -26,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
26
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
27
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
28
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
29
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
30
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
31
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -55,9 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
55
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
56
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
57
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
58
60
|
"text_recognition": ["availability", "recognize"],
|
|
59
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
60
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
61
64
|
"ui": ["alert", "snackbar"],
|
|
62
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
63
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -26,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
26
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
27
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
28
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
29
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
30
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
31
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -55,9 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
55
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
56
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
57
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
58
60
|
"text_recognition": ["availability", "recognize"],
|
|
59
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
60
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
61
64
|
"ui": ["alert", "snackbar"],
|
|
62
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
63
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -15441,6 +15441,7 @@ var PAGE_CAPABILITY_DISPATCHES = {
|
|
|
15441
15441
|
"camera": [],
|
|
15442
15442
|
"clipboard": [],
|
|
15443
15443
|
"contacts": [],
|
|
15444
|
+
"entity_extraction": [],
|
|
15444
15445
|
"file_picker": [],
|
|
15445
15446
|
"files": [],
|
|
15446
15447
|
"godot": [],
|
|
@@ -15470,9 +15471,11 @@ var PAGE_CAPABILITY_DISPATCHES = {
|
|
|
15470
15471
|
"speech": [],
|
|
15471
15472
|
"system_intents": [],
|
|
15472
15473
|
"tasks": [],
|
|
15474
|
+
"text_embedding": [],
|
|
15473
15475
|
"text_recognition": [],
|
|
15474
15476
|
"theme": [],
|
|
15475
15477
|
"torch": [],
|
|
15478
|
+
"translation": [],
|
|
15476
15479
|
"ui": [],
|
|
15477
15480
|
"wix_cashier": [],
|
|
15478
15481
|
"wix_chat": [],
|
|
@@ -0,0 +1,38 @@
|
|
|
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/entity-extraction/src/index.ts
|
|
17
|
+
async function availability(language) {
|
|
18
|
+
const r = await dispatch("capability.entity_extraction.availability", language ? { language } : {});
|
|
19
|
+
return { available: r?.available === true, engine: r?.engine, reason: r?.reason };
|
|
20
|
+
}
|
|
21
|
+
async function extract(text, opts = {}) {
|
|
22
|
+
if (typeof text !== "string") throw new Error("entity-extraction.extract: text is required");
|
|
23
|
+
if (text.length === 0) return { entities: [], engine: "" };
|
|
24
|
+
const r = await dispatch("capability.entity_extraction.extract", {
|
|
25
|
+
text,
|
|
26
|
+
...opts.language ? { language: opts.language } : {},
|
|
27
|
+
...opts.types?.length ? { types: opts.types.join(",") } : {}
|
|
28
|
+
});
|
|
29
|
+
const entities = Array.isArray(r?.entities) ? [...r.entities].sort((a, b) => a.start - b.start) : [];
|
|
30
|
+
return { entities, engine: r?.engine ?? "" };
|
|
31
|
+
}
|
|
32
|
+
var version = 1;
|
|
33
|
+
export {
|
|
34
|
+
availability,
|
|
35
|
+
extract,
|
|
36
|
+
version
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=entity-extraction.mjs.map
|
|
@@ -684,7 +684,13 @@ function resolveRoute(item, mappings, platform) {
|
|
|
684
684
|
return unavailable(item.reference, "mappingUnresolved");
|
|
685
685
|
}
|
|
686
686
|
if (platform !== "ios") return unavailable(item.reference, "unsupportedPlatform");
|
|
687
|
-
return { status: "loading", mapping: {
|
|
687
|
+
return { status: "loading", mapping: {
|
|
688
|
+
reference: item.reference,
|
|
689
|
+
route: "appleIap",
|
|
690
|
+
productId: mapping.productId,
|
|
691
|
+
mappingRevision: mapping.mappingRevision,
|
|
692
|
+
...mapping.renews === true ? { renews: true } : {}
|
|
693
|
+
} };
|
|
688
694
|
}
|
|
689
695
|
function regularPrice(item) {
|
|
690
696
|
return nonempty(item.commerceDisplayPrice) ? { reference: item.reference, status: "ready", source: "regular", displayPrice: item.commerceDisplayPrice } : unavailable(item.reference, "commercePriceUnavailable");
|
|
@@ -693,17 +699,21 @@ function applePrice(mapping, products) {
|
|
|
693
699
|
const matches = products.filter((value) => isObject2(value) && value.id === mapping.productId);
|
|
694
700
|
const product = matches[0];
|
|
695
701
|
if (matches.length !== 1 || !nonempty(product?.displayPrice)) return unavailable(mapping.reference, "priceUnavailable");
|
|
696
|
-
|
|
697
|
-
if (product?.type !== (attendance ? "consumable" : "nonConsumable")) return unavailable(mapping.reference, "unsupportedProductType");
|
|
702
|
+
if (product?.type !== expectedType(mapping) || mapping.renews && !nonempty(product.subscriptionPeriod)) return unavailable(mapping.reference, "unsupportedProductType");
|
|
698
703
|
return {
|
|
699
704
|
reference: mapping.reference,
|
|
700
705
|
status: "ready",
|
|
701
706
|
source: "appleIap",
|
|
702
707
|
productId: mapping.productId,
|
|
703
708
|
mappingRevision: mapping.mappingRevision,
|
|
704
|
-
displayPrice: product.displayPrice
|
|
709
|
+
displayPrice: product.displayPrice,
|
|
710
|
+
...mapping.renews ? { renews: true, subscriptionPeriod: product.subscriptionPeriod } : {}
|
|
705
711
|
};
|
|
706
712
|
}
|
|
713
|
+
function expectedType(mapping) {
|
|
714
|
+
if (mapping.renews) return "subscription";
|
|
715
|
+
return mapping.reference.kind === "bookingsService" || mapping.reference.kind === "eventsTicket" ? "consumable" : "nonConsumable";
|
|
716
|
+
}
|
|
707
717
|
function unavailable(reference, reason) {
|
|
708
718
|
return { reference, status: "unavailable", reason, retryable: !["invalidInput", "unsupportedPlatform", "unsupportedProductType", "commercePriceUnavailable"].includes(reason) };
|
|
709
719
|
}
|
|
@@ -717,13 +727,14 @@ var ATTENDANCE_SALE_RULE = { appProductId: (id) => id, productType: "CONSUMABLE"
|
|
|
717
727
|
var STORES_PRODUCT_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
718
728
|
var ONLINE_PROGRAM_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
719
729
|
var PRICING_PLAN_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
730
|
+
var PLAN_SUBSCRIPTIONS_APPLE_SALES_ENABLED = false;
|
|
720
731
|
var VIDEOS_APPLE_SALES_ENABLED = false;
|
|
721
732
|
var VIDEO_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
|
|
722
733
|
function appleSaleRules(options = {}) {
|
|
723
734
|
return {
|
|
724
735
|
onlineProgram: ONLINE_PROGRAM_SALE_RULE,
|
|
725
736
|
storesProduct: STORES_PRODUCT_SALE_RULE,
|
|
726
|
-
pricingPlan: PRICING_PLAN_SALE_RULE,
|
|
737
|
+
pricingPlan: options.planSubscriptionsAppleSalesEnabled ?? PLAN_SUBSCRIPTIONS_APPLE_SALES_ENABLED ? { ...PRICING_PLAN_SALE_RULE, renews: true } : PRICING_PLAN_SALE_RULE,
|
|
727
738
|
bookingsService: ATTENDANCE_SALE_RULE,
|
|
728
739
|
eventsTicket: ATTENDANCE_SALE_RULE,
|
|
729
740
|
...options.videosAppleSalesEnabled ?? VIDEOS_APPLE_SALES_ENABLED ? { wixVideo: VIDEO_SALE_RULE } : {}
|
|
@@ -783,8 +794,18 @@ function decodeMappings(reply) {
|
|
|
783
794
|
}
|
|
784
795
|
function decide(reference, binding, mapping, rule) {
|
|
785
796
|
if (!mapping || !rule) return { reference, route: "regular" };
|
|
786
|
-
if (!mapping.active || mapping.type
|
|
787
|
-
return {
|
|
797
|
+
if (!mapping.active || !sellsAs(rule, mapping.type)) return { reference, route: "unavailable" };
|
|
798
|
+
return {
|
|
799
|
+
reference,
|
|
800
|
+
route: "appleIap",
|
|
801
|
+
productId: mapping.storeProductId,
|
|
802
|
+
mappingRevision: `${binding.purchasesAppId}:${mapping.storeProductId}`,
|
|
803
|
+
...mapping.type === RENEWING ? { renews: true } : {}
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
var RENEWING = "AUTO_RENEWING_SUBSCRIPTION";
|
|
807
|
+
function sellsAs(rule, type) {
|
|
808
|
+
return type === rule.productType || rule.renews === true && type === RENEWING;
|
|
788
809
|
}
|
|
789
810
|
function sameId(a, b) {
|
|
790
811
|
return a.toLowerCase() === b.toLowerCase();
|
|
@@ -948,7 +969,11 @@ function viewOf(reference, item) {
|
|
|
948
969
|
return unavailableView(reference, item);
|
|
949
970
|
}
|
|
950
971
|
function readyView(reference, item) {
|
|
951
|
-
return item.source === "appleIap" ? {
|
|
972
|
+
return item.source === "appleIap" ? {
|
|
973
|
+
...blockedView(reference, "appleIap"),
|
|
974
|
+
displayPrice: item.displayPrice,
|
|
975
|
+
...item.renews ? { renews: true, subscriptionPeriod: item.subscriptionPeriod } : {}
|
|
976
|
+
} : { ...regularView(reference), displayPrice: item.displayPrice };
|
|
952
977
|
}
|
|
953
978
|
function unavailableView(reference, item) {
|
|
954
979
|
if (item.reason === "commercePriceUnavailable") return regularView(reference);
|
|
@@ -3417,6 +3442,20 @@ var pricingPlanItemPayments = {
|
|
|
3417
3442
|
readAccess: (verticalRef, bridge) => isNonEmpty3(verticalRef.planId) ? planAccess(verticalRef.planId, bridge) : Promise.resolve("unavailable"),
|
|
3418
3443
|
currentAccess: (item, bridge) => planAccess(item.reference.id, bridge)
|
|
3419
3444
|
};
|
|
3445
|
+
function isAppleSellablePlan(pricing) {
|
|
3446
|
+
return pricing?.singlePaymentUnlimited === true || isOpenEndedRecurrence(pricing);
|
|
3447
|
+
}
|
|
3448
|
+
var ISO_UNIT = { DAY: "D", WEEK: "W", MONTH: "M", YEAR: "Y" };
|
|
3449
|
+
function applePlanPeriod(pricing) {
|
|
3450
|
+
return isOpenEndedRecurrence(pricing) ? `P${pricing?.subscription?.cycleDuration?.count}${isoUnit(pricing)}` : "";
|
|
3451
|
+
}
|
|
3452
|
+
function isOpenEndedRecurrence(pricing) {
|
|
3453
|
+
const cycle = pricing?.subscription;
|
|
3454
|
+
return (cycle?.cycleDuration?.count ?? 0) > 0 && isoUnit(pricing) !== void 0 && !cycle?.cycleCount && !pricing?.freeTrialDays;
|
|
3455
|
+
}
|
|
3456
|
+
function isoUnit(pricing) {
|
|
3457
|
+
return ISO_UNIT[String(pricing?.subscription?.cycleDuration?.unit ?? "").toUpperCase().replace(/S$/, "")];
|
|
3458
|
+
}
|
|
3420
3459
|
async function itemPayment2(item, bridge) {
|
|
3421
3460
|
const planId = item.reference.id;
|
|
3422
3461
|
const read2 = await bridge.call("GET", `/pricing-plans/v3/plans/${encodeURIComponent(planId)}`);
|
|
@@ -3711,6 +3750,7 @@ var pricingPlanOrders = pricingPlanItemPayments;
|
|
|
3711
3750
|
var bookingOrders = bookingItemPayments;
|
|
3712
3751
|
var eventTicketOrders = eventTicketItemPayments;
|
|
3713
3752
|
export {
|
|
3753
|
+
applePlanPeriod,
|
|
3714
3754
|
bookingOrders,
|
|
3715
3755
|
classifyCart,
|
|
3716
3756
|
createAppleIapCheckout,
|
|
@@ -3718,6 +3758,7 @@ export {
|
|
|
3718
3758
|
createWorkerOrderRefStore,
|
|
3719
3759
|
eventTicketOrders,
|
|
3720
3760
|
iapPurchaseFields,
|
|
3761
|
+
isAppleSellablePlan,
|
|
3721
3762
|
onlineProgramOrders,
|
|
3722
3763
|
pricingPlanOrders,
|
|
3723
3764
|
storesAppleSalesEnabled,
|