@wix/himalaya-cli 0.1308.0 → 0.1310.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +7 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/delivery-contract.d.ts +3 -3
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/delivery.d.ts +3 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/host-session.d.ts +31 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts +1 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +19 -14
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +2 -4
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments.d.ts +11 -12
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +32 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +60 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +17 -9
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +6 -1
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +31 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +119 -65
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +117 -35
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +31 -0
  17. package/dist/cli.mjs +1305 -863
  18. package/dist/preview-assets.generated.bin +0 -0
  19. package/guides/app-config.md +2 -2
  20. package/guides/component-reference.json +2 -2
  21. package/guides/component-reference.md +10 -0
  22. package/guides/getting-started.md +40 -0
  23. package/guides/himi-skill.md +40 -0
  24. package/guides/qa-builds.md +16 -12
  25. package/guides/sdk-reference.json +61 -25
  26. package/package.json +3 -2
  27. package/templates/beauty-salon/himalaya.content.json +86 -0
  28. package/templates/beauty-salon-owner/dev/index.ts +574 -181
  29. package/templates/beauty-salon-owner/himalaya.content.json +179 -0
  30. package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +136 -12
  31. package/templates/beauty-salon-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  32. package/templates/beauty-salon-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  33. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  34. package/templates/branded-lite/himalaya.content.json +254 -0
  35. package/templates/brandy/himalaya.content.json +18 -1
  36. package/templates/community-club/himalaya.content.json +68 -0
  37. package/templates/community-club-owner/dev/index.ts +574 -181
  38. package/templates/community-club-owner/himalaya.content.json +173 -0
  39. package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +136 -12
  40. package/templates/community-club-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  41. package/templates/community-club-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  42. package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  43. package/templates/events-meetups/himalaya.content.json +62 -0
  44. package/templates/events-meetups-owner/dev/index.ts +574 -181
  45. package/templates/events-meetups-owner/himalaya.content.json +155 -0
  46. package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +136 -12
  47. package/templates/events-meetups-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  48. package/templates/events-meetups-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  49. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  50. package/templates/gym-fitness/himalaya.content.json +101 -0
  51. package/templates/gym-fitness-owner/dev/index.ts +574 -181
  52. package/templates/gym-fitness-owner/himalaya.content.json +188 -0
  53. package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +136 -12
  54. package/templates/gym-fitness-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  55. package/templates/gym-fitness-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  56. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  57. package/templates/himi-chat/himalaya.content.json +8 -0
  58. package/templates/nonprofit-cause/himalaya.content.json +74 -0
  59. package/templates/nonprofit-cause-owner/dev/index.ts +574 -181
  60. package/templates/nonprofit-cause-owner/himalaya.content.json +170 -0
  61. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +136 -12
  62. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  63. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  64. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  65. package/templates/owner-lite/dev/index.ts +574 -181
  66. package/templates/owner-lite/himalaya.content.json +203 -0
  67. package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +136 -12
  68. package/templates/owner-lite/tier5-src/_shared/aria-client-tools.ts +57 -9
  69. package/templates/owner-lite/tier5-src/_shared/aria-row-id.ts +14 -0
  70. package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  71. package/templates/podcast-creator/himalaya.content.json +71 -0
  72. package/templates/podcast-creator-owner/dev/index.ts +574 -181
  73. package/templates/podcast-creator-owner/himalaya.content.json +173 -0
  74. package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +136 -12
  75. package/templates/podcast-creator-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  76. package/templates/podcast-creator-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  77. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  78. package/templates/portfolio-creative/himalaya.content.json +80 -0
  79. package/templates/portfolio-creative-owner/dev/index.ts +574 -181
  80. package/templates/portfolio-creative-owner/himalaya.content.json +179 -0
  81. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +136 -12
  82. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  83. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  84. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  85. package/templates/restaurant/himalaya.content.json +65 -0
  86. package/templates/restaurant-owner/dev/index.ts +574 -181
  87. package/templates/restaurant-owner/himalaya.content.json +188 -0
  88. package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +136 -12
  89. package/templates/restaurant-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  90. package/templates/restaurant-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  91. package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  92. package/templates/retail-store/himalaya.content.json +62 -0
  93. package/templates/retail-store-owner/dev/index.ts +574 -181
  94. package/templates/retail-store-owner/himalaya.content.json +164 -0
  95. package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +136 -12
  96. package/templates/retail-store-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  97. package/templates/retail-store-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  98. package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
  99. package/templates/surface-showcase/himalaya.content.json +11 -0
  100. package/templates/yoga-studio/himalaya.content.json +80 -0
  101. package/templates/yoga-studio-owner/dev/index.ts +574 -181
  102. package/templates/yoga-studio-owner/himalaya.content.json +170 -0
  103. package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +136 -12
  104. package/templates/yoga-studio-owner/tier5-src/_shared/aria-client-tools.ts +57 -9
  105. package/templates/yoga-studio-owner/tier5-src/_shared/aria-row-id.ts +14 -0
  106. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +3 -0
@@ -50,6 +50,9 @@ export interface ScreenDescriptor {
50
50
  * ScreenDescriptor.sticky_header / sticky_footer in core.proto. */
51
51
  stickyHeader?: Component;
52
52
  stickyFooter?: Component;
53
+ /** RFC 0069 — the chat transcript scroll policy. Mirror of
54
+ * ScreenDescriptor.transcript_scroll in core.proto. */
55
+ transcriptScroll?: import("@wix/himalaya/core").TranscriptScroll;
53
56
  }
54
57
  /** Tier 3/4 + embeddable WebView behavior. Mirror of WebViewConfig in core.proto
55
58
  * (RFC 0038). All fields optional; zero values reproduce legacy behavior. */
@@ -148,8 +151,12 @@ export declare function vstack(props: {
148
151
  }, opts?: {
149
152
  id?: string;
150
153
  }): Component;
154
+ /** `alignment` is the HStack's CROSS axis — vertical — and is worth setting whenever the
155
+ * children differ in height: unset is centre on iOS but TOP on Android
156
+ * (`toComposeVertical`), which put the Aria header's History label above its pencil. */
151
157
  export declare function hstack(props: {
152
158
  spacing?: number;
159
+ alignment?: "leading" | "center" | "trailing";
153
160
  children: Component[];
154
161
  }, opts?: {
155
162
  id?: string;
@@ -15,14 +15,14 @@ export interface SessionProvider {
15
15
  /** A catalog item resolved by the backend for the captured member. */
16
16
  export interface PurchaseContext {
17
17
  productId: string;
18
- /** Canonical UUID the backend associates with this site/member. */
18
+ /** Canonical UUID for this one sale (D61: a per-payment purchase intent, not the member). */
19
19
  appAccountToken: string;
20
20
  /** Opaque site/member scope the acknowledgement must echo. */
21
21
  scopeKey: string;
22
22
  }
23
- /** The current member's association, used to recover purchases without a catalog item. */
23
+ /** The current member's scope, used to recover purchases without a catalog item. It names no
24
+ * token: each payment has its own, and the backend decides whose a transaction is. */
24
25
  export interface MemberContext {
25
- appAccountToken: string;
26
26
  scopeKey: string;
27
27
  }
28
28
  export type ContextResult<T> = {
@@ -8,6 +8,9 @@ export interface PurchaseCoordinatorDependencies {
8
8
  jitter?: (baseDelayMs: number) => number;
9
9
  /** Receives a fresh safe snapshot after every change. */
10
10
  onState?: (state: DeliveryState) => void;
11
+ /** Called inside the purchase job when StoreKit defers for Ask to Buy, after the unfinished
12
+ * queue has been listed and before the job returns. The next queued purchase has not started. */
13
+ onAwaitingApproval?: (productId: string) => void;
11
14
  }
12
15
  export interface PurchaseCoordinator {
13
16
  /** Reconciles unfinished purchases now and again after every later session change. */
@@ -0,0 +1,31 @@
1
+ import type { SessionProvider, SessionSnapshot } from "./delivery-contract.js";
2
+ import type { HostCallExpectation, MemberIdentitySource } from "./wix-payments-contract.js";
3
+ export interface HostSessionView extends SessionSnapshot {
4
+ memberId: string | null;
5
+ siteId: string | null;
6
+ appId: string | null;
7
+ ready: boolean;
8
+ epoch: number;
9
+ }
10
+ /** A session provider that can also name the principal captured for one generation. */
11
+ export interface HostIdentitySource {
12
+ readonly identityBound: boolean;
13
+ identity(session: SessionSnapshot): HostCallExpectation | null;
14
+ }
15
+ export interface HostSessionProvider extends SessionProvider, HostIdentitySource {
16
+ }
17
+ /** Wraps a host session clock as the session provider the delivery coordinator and the wix-iap
18
+ * client share. Ignores a generation older than the last one read, and keeps the first member
19
+ * expectation captured for each generation for `identity()`. */
20
+ export declare function createHostSession(source: {
21
+ identityBound: boolean;
22
+ current(): unknown;
23
+ subscribe(listener: () => void): () => void;
24
+ }): HostSessionProvider;
25
+ /** The session on `globalThis.himalaya`. Web publishes `identityBound: false`. */
26
+ export declare function hostSessionFromGlobal(): HostSessionProvider;
27
+ /** The member a host session names for a captured generation, as the identity port the Apple-IAP
28
+ * checkout and the wix-iap client take: null when that generation has no signed-in member. */
29
+ export declare function memberIdentityOf(source: HostIdentitySource): MemberIdentitySource;
30
+ /** Whether the host fences protected calls to the captured member (`identityBound`). Web does not. */
31
+ export declare function readIdentityBound(): boolean;
@@ -9,6 +9,7 @@ export * from "./catalog-price-fields.js";
9
9
  export * from "./catalog-adapters/online-programs.js";
10
10
  export * from "./wix-payments-contract.js";
11
11
  export * from "./wix-payments.js";
12
+ export * from "./host-session.js";
12
13
  /** The three store product categories. */
13
14
  export type ProductType = "subscription" | "nonConsumable" | "consumable";
14
15
  export interface Product {
@@ -25,11 +25,20 @@ export interface WixIapRoute {
25
25
  * was in the generated gateway metadata on 2026-10-08, so there is deliberately no default. */
26
26
  prefix: string;
27
27
  }
28
+ /** Captured when a protected call starts. The native bridge checks it and never puts it on
29
+ * the HTTP request. */
30
+ export interface HostCallExpectation {
31
+ generation: number;
32
+ kind: "member";
33
+ memberId: string;
34
+ siteId: string;
35
+ appId: string;
36
+ }
28
37
  /** The host's Wix REST bridge (`himalaya.wixApi`). Resolves the parsed body of a 2xx and
29
38
  * rejects with `HTTP <status> [<code>]: <message>` otherwise. Credentials are attached
30
- * natively, never in TypeScript. */
39
+ * natively, never in TypeScript. `expectation` is bridge metadata, not a header. */
31
40
  export interface WixTransport {
32
- call(method: "GET" | "POST", path: string, body?: unknown, headers?: Record<string, string>): Promise<unknown>;
41
+ call(method: "GET" | "POST", path: string, body?: unknown, headers?: Record<string, string>, expectation?: HostCallExpectation): Promise<unknown>;
33
42
  }
34
43
  /** Optional, from a trusted host only: the Wix member id signed in for a captured session. Used to
35
44
  * refuse an answer about someone else, never sent: the server derives the member itself. */
@@ -55,10 +64,9 @@ export interface WixIapPayment {
55
64
  canceledDate?: string;
56
65
  refundedDate?: string;
57
66
  }
58
- export type WixIapOperation = "startPayment" | "completePayment" | "getCustomerId" | "getPayment";
67
+ export type WixIapOperation = "startPayment" | "completePayment" | "getPayment";
59
68
  export type StartPaymentErrorCode = "NOT_PENDING" | "WRONG_PAYMENT_METHOD" | "NOT_ORDER_BUYER" | "UNSUPPORTED_ORDER" | "PRODUCT_NOT_AVAILABLE" | "ALREADY_OWNED";
60
- export type CompletePaymentErrorCode = "INVALID_PURCHASE" | "OWNED_BY_ANOTHER_CUSTOMER" | "PURCHASE_REVOKED" | "NOT_PURCHASED" | "ZERO_PRICE" | "NO_MATCHING_PAYMENT" | "APP_NOT_CONFIGURED";
61
- export type GetCustomerIdErrorCode = "APP_NOT_CONFIGURED";
69
+ export type CompletePaymentErrorCode = "INVALID_PURCHASE" | "OWNED_BY_ANOTHER_CUSTOMER" | "PURCHASE_REVOKED" | "NOT_PURCHASED" | "ZERO_PRICE" | "NO_MATCHING_PAYMENT" | "PAYMENT_NOT_PENDING" | "APP_NOT_CONFIGURED";
62
70
  export type GetPaymentErrorCode = "NOT_FOUND";
63
71
  /** Why a call gave no usable answer, other than a named application error.
64
72
  * `unavailable` and `sessionChanged` say nothing about whether the request took effect.
@@ -80,24 +88,21 @@ export type WixIapFailure<Code extends string> = {
80
88
  kind: WixIapFailureKind;
81
89
  httpStatus?: number;
82
90
  };
83
- /** `customerId` goes to StoreKit as `appAccountToken` (the customer id is the token, D59). Keep it
84
- * out of screen state. */
91
+ /** `appAccountToken` goes to StoreKit with the purchase. It is minted for this one payment (a
92
+ * purchase intent, D61), not the member: StartPayment for the same Wix transaction again returns
93
+ * the same payment and the same token. Keep it out of screen state. */
85
94
  export type StartPaymentResult = {
86
95
  status: "started";
87
96
  payment: WixIapPayment;
88
97
  storeProductId: string;
89
- customerId: string;
98
+ appAccountToken: string;
90
99
  } | WixIapFailure<StartPaymentErrorCode>;
91
- /** `matched`: the server verified the proof and matched it to `payment`, which may not be the one
92
- * this device started. Its status may still be `approving`. */
100
+ /** `matched`: the server verified the proof and paid the payment whose token the Apple transaction
101
+ * carries. Its status may still be `approving`. */
93
102
  export type CompletePaymentResult = {
94
103
  status: "matched";
95
104
  payment: WixIapPayment;
96
105
  } | WixIapFailure<CompletePaymentErrorCode>;
97
- export type CustomerIdResult = {
98
- status: "found";
99
- customerId: string;
100
- } | WixIapFailure<GetCustomerIdErrorCode>;
101
106
  export type GetPaymentResult = {
102
107
  status: "found";
103
108
  payment: WixIapPayment;
@@ -12,7 +12,6 @@ export interface CallScope {
12
12
  export declare function startPaymentCall(scope: CallScope, wixTransactionId: string): WixIapCall;
13
13
  /** The JWS goes byte-for-byte: the server derives the member, and the proof names the product. */
14
14
  export declare function completePaymentCall(scope: CallScope, signedTransaction: string): WixIapCall;
15
- export declare function customerIdCall(scope: CallScope): WixIapCall;
16
15
  export declare function paymentCall(scope: CallScope, paymentId: string): WixIapCall;
17
16
  /** A gateway path such as `/_api/<service>/v1`: absolute, no trailing slash, query or scheme. */
18
17
  export declare function isRoutePrefix(prefix: string): boolean;
@@ -26,13 +25,12 @@ export interface PaymentExpectation {
26
25
  export interface StartedPayment {
27
26
  payment: WixIapPayment;
28
27
  storeProductId: string;
29
- customerId: string;
28
+ appAccountToken: string;
30
29
  }
30
+ /** D61: the token is this payment's purchase intent; no other field may stand in for it. */
31
31
  export declare function decodeStarted(raw: unknown, expected: PaymentExpectation): StartedPayment | null;
32
32
  /** CompletePayment's and GetPayment's answer: `{payment}`. */
33
33
  export declare function decodePaymentAnswer(raw: unknown, expected: PaymentExpectation): WixIapPayment | null;
34
- /** D59: the customer's id is the StoreKit `appAccountToken`; no other field may stand in for it. */
35
- export declare function decodeCustomerId(raw: unknown): string | null;
36
34
  /** Maps a bridge rejection to a failure. The message itself is never kept: the bridge copies up
37
35
  * to 300 characters of the response, which can echo the request. */
38
36
  export declare function classifyFailure<Code extends string>(error: unknown, operation: WixIapOperation, codes: readonly Code[]): WixIapFailure<Code>;
@@ -1,6 +1,6 @@
1
1
  import type { AppleTransaction } from "./index.js";
2
2
  import type { SessionProvider } from "./delivery-contract.js";
3
- import type { AppBindingSource, CompletePaymentResult, CustomerIdResult, GetPaymentResult, IapAppHost, MemberIdentitySource, StartPaymentResult, WixIapRoute, WixTransport } from "./wix-payments-contract.js";
3
+ import type { AppBindingSource, CompletePaymentResult, GetPaymentResult, IapAppHost, MemberIdentitySource, StartPaymentResult, WixIapRoute, WixTransport } from "./wix-payments-contract.js";
4
4
  export interface WixIapClientDependencies {
5
5
  /** The trusted host session; each call is bound to the generation current when it starts. */
6
6
  session: SessionProvider;
@@ -14,15 +14,13 @@ export interface WixIapClientDependencies {
14
14
  }
15
15
  export interface WixIapClient {
16
16
  /** StartPayment for a pending `appleIAP` Wix Payments transaction the member placed. Returns the
17
- * store product to sell and the customer id to pass to StoreKit as `appAccountToken`. */
17
+ * store product to sell and this payment's `appAccountToken` to pass to StoreKit. */
18
18
  startPayment(input: {
19
19
  wixTransactionId: string;
20
20
  }): Promise<StartPaymentResult>;
21
- /** CompletePayment with held Apple proof, sent unchanged. Success can still be `approving`. */
21
+ /** CompletePayment with held Apple proof, sent unchanged: the service pays the payment whose
22
+ * token the transaction carries. Success can still be `approving`. */
22
23
  completePayment(transaction: AppleTransaction): Promise<CompletePaymentResult>;
23
- /** GetCustomerId: the member's customer id, for recovering held purchases. Creates the customer
24
- * when there is none. */
25
- getCustomerId(): Promise<CustomerIdResult>;
26
24
  /** GetPayment: one of the member's own Payments. */
27
25
  getPayment(input: {
28
26
  paymentId: string;
@@ -34,14 +32,15 @@ export interface WixIapClient {
34
32
  *
35
33
  * NOT ENABLED and not production-ready. No app wires it, and no call reaches the service: it has
36
34
  * no public gateway route yet, so `route` must be supplied and there is no default. It calls
37
- * StartPayment (`POST …/payments/start`), CompletePayment (`POST …/payments/complete`),
38
- * GetCustomerId (`GET …/customer-id`) and GetPayment (`GET …/payments/{id}`) through the
35
+ * StartPayment (`POST …/payments/start`), CompletePayment (`POST …/payments/complete`)
36
+ * and GetPayment (`GET …/payments/{id}`) through the
39
37
  * `wix_api` bridge. A matched or approved Payment is not durable access and never finishes the
40
38
  * store transaction.
41
39
  *
42
- * Production use is blocked on pending prerequisites: a public route and member authorization on
43
- * the service, the service's own app identity and permissions, a trusted provisioning flow for the
44
- * app binding, and a native bridge that binds each request to the session generation across
45
- * authorization, send and retry. Its checks here protect only this client's own flow.
40
+ * Production use stays blocked: there is no public route or member authorization on the service,
41
+ * no trusted app-binding source, and checkout stays disabled. When this client uses the host
42
+ * bridge, it also requires the host's identity clock and passes that captured expectation
43
+ * through the bridge. An injected transport keeps the previous call shape unless the session
44
+ * itself exposes an identity.
46
45
  */
47
46
  export declare function createWixIapClient(deps: WixIapClientDependencies): WixIapClient;
@@ -364,6 +364,21 @@ export interface Modifiers {
364
364
  * The generalization of `FragmentSlotCase.accessibilityAnnouncement`, which only ever
365
365
  * fired on a fragment-slot case swap. */
366
366
  announce?: LiveRegion;
367
+ /** RFC 0069 — a recurring, finite, transform-only motion on a decorative node: a
368
+ * living character's idle `hop`, a `blink`, a working `breathe`. Never changes the
369
+ * node's layout footprint. Stopped by reduced motion unless `respectReducedMotion`
370
+ * is false. */
371
+ ambientMotion?: AmbientMotion;
372
+ }
373
+ /** RFC 0069 — `Modifiers.ambientMotion`. */
374
+ export interface AmbientMotion {
375
+ /** `"hop"` | `"blink"` | `"breathe"`; anything else renders no motion. */
376
+ kind?: string;
377
+ /** hop/blink: the shortest rest between two reactions (defaults 3000 / 2200);
378
+ * breathe: the half-period (default 550). */
379
+ minGapMs?: number;
380
+ /** hop/blink: the longest rest (defaults 7000 / 5500). Ignored by breathe. */
381
+ maxGapMs?: number;
367
382
  }
368
383
  /** RFC 0058 §4 — a screen-change / state-change announcement. `text` EMPTY means
369
384
  * "announce this node's own resolved name + value", which is what makes a status line
@@ -3176,6 +3191,18 @@ export interface WebViewProps {
3176
3191
  config?: WebViewConfig;
3177
3192
  capabilitiesRequired?: string[];
3178
3193
  }
3194
+ /** RFC 0069 — `ScreenDescriptor.transcriptScroll`. */
3195
+ export interface TranscriptScroll {
3196
+ /** `$service:` path to a SEND TOKEN. Each new non-empty value is a send; an
3197
+ * empty one resets the policy (a new conversation rests at the top). */
3198
+ sendPath: string;
3199
+ /** `$service:` path to the id of the component to pin. It may change while
3200
+ * the pin is held (an optimistic row replaced by the server's copy) without
3201
+ * starting a new pin. Empty = follow the tail with nothing pinned. */
3202
+ anchorPath?: string;
3203
+ /** Accessible name of the jump-to-latest control. Default "Jump to latest". */
3204
+ jumpLabel?: string;
3205
+ }
3179
3206
  export interface ScreenDescriptor {
3180
3207
  screenId: string;
3181
3208
  renderer: RendererKind;
@@ -3194,6 +3221,11 @@ export interface ScreenDescriptor {
3194
3221
  * up (a chat transcript). Tapping it animates back to the bottom. Absent/false =
3195
3222
  * a normal top-anchored scroll. Honored by the app host (Router). */
3196
3223
  scrollToBottom?: boolean;
3224
+ /** RFC 0069 — the chat transcript scroll policy. On a send the host pins the
3225
+ * named component near the top and reserves the space the reply grows into;
3226
+ * when the reply outgrows it the host follows the tail. A drag pauses
3227
+ * following, and only then is a jump-to-latest control shown. */
3228
+ transcriptScroll?: TranscriptScroll;
3197
3229
  /** Present when `renderer` is `webview_native_bridge` or `webview_ds`. */
3198
3230
  url?: string;
3199
3231
  capabilitiesRequired?: string[];
@@ -6,6 +6,14 @@ export declare const screenDescriptorSchema: {
6
6
  readonly type: "object";
7
7
  readonly additionalProperties: false;
8
8
  readonly required: readonly ["screenId", "renderer", "schemaVersion"];
9
+ readonly not: {
10
+ readonly required: readonly ["transcriptScroll", "scrollToBottom"];
11
+ readonly properties: {
12
+ readonly scrollToBottom: {
13
+ readonly const: true;
14
+ };
15
+ };
16
+ };
9
17
  readonly properties: {
10
18
  readonly screenId: {
11
19
  readonly type: "string";
@@ -30,6 +38,24 @@ export declare const screenDescriptorSchema: {
30
38
  readonly scrollToBottom: {
31
39
  readonly type: "boolean";
32
40
  };
41
+ readonly transcriptScroll: {
42
+ readonly type: "object";
43
+ readonly additionalProperties: false;
44
+ readonly required: readonly ["sendPath"];
45
+ readonly properties: {
46
+ readonly sendPath: {
47
+ readonly type: "string";
48
+ readonly pattern: "^\\$service:";
49
+ };
50
+ readonly anchorPath: {
51
+ readonly type: "string";
52
+ readonly pattern: "^$|^\\$service:";
53
+ };
54
+ readonly jumpLabel: {
55
+ readonly type: "string";
56
+ };
57
+ };
58
+ };
33
59
  readonly url: {
34
60
  readonly type: "string";
35
61
  readonly format: "uri";
@@ -650,6 +676,23 @@ export declare const screenDescriptorSchema: {
650
676
  };
651
677
  };
652
678
  };
679
+ readonly ambientMotion: {
680
+ readonly type: "object";
681
+ readonly additionalProperties: false;
682
+ readonly properties: {
683
+ readonly kind: {
684
+ readonly type: "string";
685
+ };
686
+ readonly minGapMs: {
687
+ readonly type: "integer";
688
+ readonly minimum: 0;
689
+ };
690
+ readonly maxGapMs: {
691
+ readonly type: "integer";
692
+ readonly minimum: 0;
693
+ };
694
+ };
695
+ };
653
696
  readonly boxShadow: {
654
697
  readonly type: "object";
655
698
  readonly additionalProperties: false;
@@ -1621,6 +1664,23 @@ export declare const widgetSnapshotSchema: {
1621
1664
  };
1622
1665
  };
1623
1666
  };
1667
+ readonly ambientMotion: {
1668
+ readonly type: "object";
1669
+ readonly additionalProperties: false;
1670
+ readonly properties: {
1671
+ readonly kind: {
1672
+ readonly type: "string";
1673
+ };
1674
+ readonly minGapMs: {
1675
+ readonly type: "integer";
1676
+ readonly minimum: 0;
1677
+ };
1678
+ readonly maxGapMs: {
1679
+ readonly type: "integer";
1680
+ readonly minimum: 0;
1681
+ };
1682
+ };
1683
+ };
1624
1684
  readonly boxShadow: {
1625
1685
  readonly type: "object";
1626
1686
  readonly additionalProperties: false;
@@ -1,8 +1,10 @@
1
- import type { AppBindingSource, CatalogReference, Clock, DeliveryState, IapCatalogPricing, SessionProvider, TransactionStore, WixIapClient } from "@wix/himalaya/iap";
1
+ import type { AppBindingSource, CatalogReference, Clock, DeliveryState, HostCallExpectation, IapCatalogPricing, MemberIdentitySource, SessionProvider, TransactionStore, WixIapClient } from "@wix/himalaya/iap";
2
2
  /** The host's Wix REST bridge (`himalaya.wixApi`). Resolves a 2xx body; rejects with
3
- * `HTTP <status> [<code>]: <message>` otherwise. Credentials are attached natively. */
3
+ * `HTTP <status> [<code>]: <message>` otherwise. Credentials are attached natively.
4
+ * Same positional shape as the runtime's `wixApiCall`: `expectation` is bridge metadata for a
5
+ * protected call, after `headers`, and never an HTTP header. */
4
6
  export interface WixBridge {
5
- call(method: "GET" | "POST", path: string, body?: unknown): Promise<unknown>;
7
+ call(method: "GET" | "POST", path: string, body?: unknown, headers?: Record<string, string>, expectation?: HostCallExpectation): Promise<unknown>;
6
8
  }
7
9
  /** Why a bridge call gave no body. `sessionChanged`: the captured session is no longer current,
8
10
  * before the send or after the answer; nothing from it may be used or stored. */
@@ -86,13 +88,13 @@ export interface IapOrderAdapter {
86
88
  /** The vertical's authoritative answer for the order's item and the signed-in member. */
87
89
  readAccess(verticalRef: VerticalRef, bridge: SessionBoundBridge): Promise<AccessRead>;
88
90
  }
89
- /** Durable, member-partitioned purchase references. Ids only: never a proof, an account token
90
- * (the customer id is stored only as a one-way hash in the key), or a credential. */
91
+ /** Durable, member-partitioned purchase references. Ids only: never a proof or a credential, and
92
+ * the member id is stored only as a one-way hash in the key. */
91
93
  export interface OrderPartitionKey {
92
94
  purchasesAppId: string;
93
95
  siteId: string;
94
- /** The member's wix-iap customer id: server-derived per member per app. */
95
- customerId: string;
96
+ /** The signed-in member's Wix id, from the host session (wix-iap records purchases against it). */
97
+ memberId: string;
96
98
  }
97
99
  /** `held`: Apple charged, and CompletePayment refused the proof without recording it, so the
98
100
  * transaction stays unfinished and is retried. `needsSupport`: recorded and refused for good. */
@@ -109,6 +111,8 @@ export interface OrderRef {
109
111
  storeProductId?: string;
110
112
  appProductId?: string;
111
113
  appleTransactionId?: string;
114
+ /** The StoreKit token StartPayment minted for this payment (D61): recovery finds the order by it. */
115
+ appAccountToken?: string;
112
116
  updatedAt: number;
113
117
  }
114
118
  export interface OrderRefPartition {
@@ -122,13 +126,13 @@ export interface OrderRefStore {
122
126
  * unknown-version data. Never an empty stand-in. */
123
127
  open(key: OrderPartitionKey): OrderRefPartition | null;
124
128
  /** Whether any member holds references for this app and site; null when unreadable. Lets a
125
- * start-up skip GetCustomerId (which creates a customer) when nothing was ever handed over. */
129
+ * start-up skip reading the member and tracking when nothing was ever handed over. */
126
130
  hasRefs(app: {
127
131
  purchasesAppId: string;
128
132
  siteId: string;
129
133
  }): boolean | null;
130
134
  }
131
- export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "matchedOtherOrder" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged";
135
+ export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged";
132
136
  /** Progress of a payment this device handed to wix-iap, tracked from its durable reference. */
133
137
  export type PaymentAccess = "processing" | "granted" | "accessUnknown" | "needsSupport";
134
138
  export interface PaymentProgress {
@@ -151,6 +155,10 @@ export interface AppleIapCheckoutState {
151
155
  }
152
156
  export interface AppleIapCheckoutDependencies {
153
157
  wixIap: WixIapClient;
158
+ /** The member signed in for a captured session, from the trusted host (`memberIdentityOf` over the
159
+ * host session). It partitions the references and scopes acknowledgements: wix-iap has no
160
+ * customer ids any more (D61). */
161
+ identity: MemberIdentitySource;
154
162
  /** The same trusted binding the wix-iap client uses; it partitions the stored references. */
155
163
  binding: AppBindingSource;
156
164
  /** The same host provider the wix-iap client was given: every step compares generations. */
@@ -1,4 +1,4 @@
1
- import type { AppBindingSource, Clock, DeliveryBackend, IapAppleProduct, SessionProvider, WixIapClient } from "@wix/himalaya/iap";
1
+ import type { AppBindingSource, Clock, DeliveryBackend, IapAppleProduct, MemberIdentitySource, SessionProvider, WixIapClient } from "@wix/himalaya/iap";
2
2
  import type { CashierRoute, IapOrderAdapter, IapOrderItem, OrderFailureCode, OrderRefStore, PaymentAccess, WixBridge } from "./apple-iap-contract.js";
3
3
  /** What the backend tells the checkout about an item: why it stopped, or how its payment is. */
4
4
  export interface OrderEvent {
@@ -15,6 +15,8 @@ export interface SaleItem {
15
15
  }
16
16
  export interface WixOrderBackendDependencies {
17
17
  wixIap: WixIapClient;
18
+ /** The member signed in for a captured session; it partitions references and scopes acks. */
19
+ identity: MemberIdentitySource;
18
20
  binding: AppBindingSource;
19
21
  session: SessionProvider;
20
22
  clock: Clock;
@@ -24,6 +26,9 @@ export interface WixOrderBackendDependencies {
24
26
  bridge: WixBridge;
25
27
  /** The item a `buy` asked for, by the catalog ref the coordinator carries. */
26
28
  itemFor(catalogRef: string): SaleItem | undefined;
29
+ /** Whether Apple may already be charging for this product: an unfinished transaction, or an Ask
30
+ * to Buy request awaiting approval. Asked inside the purchase job, after any reconcile. */
31
+ productBusy?(productId: string): boolean;
27
32
  report(event: OrderEvent): void;
28
33
  }
29
34
  export declare function createWixOrderBackend(deps: WixOrderBackendDependencies): DeliveryBackend;
@@ -8082,6 +8082,12 @@ var screenDescriptorSchema = {
8082
8082
  type: "object",
8083
8083
  additionalProperties: false,
8084
8084
  required: ["screenId", "renderer", "schemaVersion"],
8085
+ // RFC 0069 replaces the legacy policy; combining both selects different
8086
+ // host implementations, so reject that ambiguous descriptor.
8087
+ not: {
8088
+ required: ["transcriptScroll", "scrollToBottom"],
8089
+ properties: { scrollToBottom: { const: true } }
8090
+ },
8085
8091
  properties: {
8086
8092
  screenId: { type: "string", minLength: 1 },
8087
8093
  renderer: {
@@ -8097,6 +8103,19 @@ var screenDescriptorSchema = {
8097
8103
  // Chat-transcript scroll: host pins the scroll to the bottom with a
8098
8104
  // floating "jump to latest" affordance. Absent/false = top-anchored.
8099
8105
  scrollToBottom: { type: "boolean" },
8106
+ // RFC 0069 — the chat transcript scroll policy (pin the sent turn, follow the
8107
+ // reply). Both paths are `$service:` sentinels: a literal token could never
8108
+ // change, so the policy would never fire.
8109
+ transcriptScroll: {
8110
+ type: "object",
8111
+ additionalProperties: false,
8112
+ required: ["sendPath"],
8113
+ properties: {
8114
+ sendPath: { type: "string", pattern: "^\\$service:" },
8115
+ anchorPath: { type: "string", pattern: "^$|^\\$service:" },
8116
+ jumpLabel: { type: "string" }
8117
+ }
8118
+ },
8100
8119
  url: { type: "string", format: "uri" },
8101
8120
  capabilitiesRequired: {
8102
8121
  type: "array",
@@ -8511,6 +8530,18 @@ var screenDescriptorSchema = {
8511
8530
  trigger: { type: "string", enum: ["on_change", "on_appear", "both", "none"] }
8512
8531
  }
8513
8532
  },
8533
+ // RFC 0069 — recurring, finite, transform-only motion on a decorative node. `kind`
8534
+ // is an open string: an unknown kind renders no motion, so an older validator must
8535
+ // not reject a newer one.
8536
+ ambientMotion: {
8537
+ type: "object",
8538
+ additionalProperties: false,
8539
+ properties: {
8540
+ kind: { type: "string" },
8541
+ minGapMs: { type: "integer", minimum: 0 },
8542
+ maxGapMs: { type: "integer", minimum: 0 }
8543
+ }
8544
+ },
8514
8545
  // #1052 — explicit drop shadow (colour token + radius + offset), alongside the `shadow` token form.
8515
8546
  boxShadow: {
8516
8547
  type: "object",