@wix/himalaya-cli 0.1309.0 → 0.1311.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/iap/src/delivery-contract.d.ts +3 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/delivery.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/host-session.d.ts +31 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +39 -15
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +2 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments.d.ts +11 -12
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +13 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +17 -9
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +6 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +119 -65
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +125 -35
- package/dist/cli.mjs +1286 -677
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/himi-json-output.md +29 -1
- package/guides/iap-products.md +51 -2
- package/guides/qa-builds.md +16 -12
- package/guides/sdk-reference.json +80 -26
- package/package.json +2 -2
|
Binary file
|
|
@@ -6,7 +6,7 @@ repurposed when human wording changes. New codes may be added; consumers must
|
|
|
6
6
|
handle an unknown code as a failure, without parsing prose.
|
|
7
7
|
|
|
8
8
|
**Rollout:** this contract is enforced for **`himi push`**, including `--only`,
|
|
9
|
-
first
|
|
9
|
+
first, and for **`himi store iap connect`**. Other subcommands still have legacy failures without codes and are a
|
|
10
10
|
follow-up migration. This is an additive change: existing `error`, `errors`,
|
|
11
11
|
`message`, `hint`, status, body, and gate-specific fields stay as they were.
|
|
12
12
|
Some legacy envelopes have no singular `error` or `hint`; consumers must not
|
|
@@ -78,6 +78,34 @@ The `ux_evidence_*` codes map to the existing typed `uxEvidence.state`; a succes
|
|
|
78
78
|
`recorded` state has no refusal code. Successful pushes and warnings do not gain
|
|
79
79
|
failure codes. A forced push still follows the existing override rules.
|
|
80
80
|
|
|
81
|
+
## `himi store iap connect` codes
|
|
82
|
+
|
|
83
|
+
`connect` prints one envelope with the whole report. When the setup is not complete it is
|
|
84
|
+
`ok: false` with the first step's code; each step also carries its own `code`.
|
|
85
|
+
|
|
86
|
+
| Code | Meaning |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `bundle_registered_elsewhere` | The bundle id is registered to another purchases app (another site's). Nothing was changed; only that registration's owner can remove it. |
|
|
89
|
+
| `apple_key_missing` | No In-App Purchase key was given and the app has none stored. |
|
|
90
|
+
| `invalid_usage` | The flags are incomplete or malformed (for example `--iap-key` without `--iap-key-id`). Nothing was read or written. |
|
|
91
|
+
| `iap_key_unreadable` | `--iap-key` is missing, unreadable, inside the repository, or not a PEM private key. Nothing was written. |
|
|
92
|
+
| `provider_route_unavailable` | The Serve target has no IAP routes, so the appleIAP provider was not connected. |
|
|
93
|
+
| `manifest_invalid` | `--manifest` is not a valid IAP manifest; `problems` lists why. Nothing was read or written. |
|
|
94
|
+
| `credentials_unavailable` | The `--profile` App Store Connect credentials could not be resolved. Nothing was read or written. |
|
|
95
|
+
| `provider_not_connected` | wix-iap answered, but reported the provider account as not connected. |
|
|
96
|
+
| `mapping_conflict` | The Wix item is already mapped to a different Apple product; left as it is. |
|
|
97
|
+
| `mapping_inactive` | The mapping exists but is inactive; left as it is. |
|
|
98
|
+
| `mapping_type_mismatch` | The mapping exists as a product type the purchase flow cannot sell (programs sell only as `NON_CONSUMABLE`); left as it is. |
|
|
99
|
+
| `sku_in_use` | The Apple product is already mapped to another Wix item; left as it is. |
|
|
100
|
+
| `mapping_unsupported` | The purchase flow cannot map this item yet (a vertical other than Online Programs, a price tier, or a program declared as a consumable). |
|
|
101
|
+
| `no_purchases_app` | A step did not run because the site has no purchases app for the bundle. |
|
|
102
|
+
| `request_failed` | A purchases-service call failed for another reason; the original message is preserved. |
|
|
103
|
+
| `setup_incomplete` | Steps are only planned (a dry run) or otherwise not yet in place. |
|
|
104
|
+
| `confirmation_required` | Writes were planned, but there was no terminal to ask and no `--yes`. Nothing was written. |
|
|
105
|
+
| `config_conflict` | The backend setup is complete, but the app's config names a different purchases app, site or bundle. |
|
|
106
|
+
| `config_not_applied` | `--content` was given, but the binding is not in its `config.ts` (no config file, a dynamic or symlinked config, an edit `himi validate` rolled back, or no validator); the `config` report or `note` says what to add by hand. |
|
|
107
|
+
| `connect_failed` | An otherwise unclassified error stopped connect (for example an unreadable manifest, or a failed `--out` write). The original message is preserved. |
|
|
108
|
+
|
|
81
109
|
## Follow-ups
|
|
82
110
|
|
|
83
111
|
- Migrate failure envelopes in subcommands other than `push`, keeping this contract.
|
package/guides/iap-products.md
CHANGED
|
@@ -149,6 +149,8 @@ himi store iap draft --site <msid> --profile fit-club-owner --apple-app 6450000
|
|
|
149
149
|
himi store iap plan --manifest ./iap-products.json --profile fit-club-owner --out ./iap-plan.json
|
|
150
150
|
himi store iap apply --plan ./iap-plan.json --profile fit-club-owner --out ./iap-result.json
|
|
151
151
|
himi store iap status --manifest ./iap-products.json --profile fit-club-owner --json
|
|
152
|
+
himi store iap connect --manifest ./iap-products.json --profile fit-club-owner \
|
|
153
|
+
--iap-key ~/keys/SubscriptionKey_ABCD123456.p8 --iap-key-id ABCD123456 --content . --dry-run
|
|
152
154
|
```
|
|
153
155
|
|
|
154
156
|
**`plan` is read-only.** It:
|
|
@@ -222,6 +224,53 @@ schedule, even without the local journal. Nothing is ever deleted or rolled back
|
|
|
222
224
|
**`status` is read-only.** It reports what Apple has for each product. Add `--out <file>`
|
|
223
225
|
to save it in the same shape as the result file.
|
|
224
226
|
|
|
227
|
+
## Connecting the Wix site: `connect`
|
|
228
|
+
|
|
229
|
+
`connect` makes the manifest's Wix site ready to sell those products, from the same manifest,
|
|
230
|
+
as the site owner (your Wix login, like `draft`). To run it against a Serve deploy preview, pass
|
|
231
|
+
`--preview-tag dp-<tag>` (or set `HIMI_SERVE_PREVIEW_TAG`). Only the Serve calls (the appleIAP
|
|
232
|
+
provider connection) are routed to the preview; the purchases service and App Store Connect are
|
|
233
|
+
called as usual. In order:
|
|
234
|
+
|
|
235
|
+
1. **The purchases app.** It reads the site's apps and reuses the one for the manifest's bundle
|
|
236
|
+
id. Only when the site has none does it register one. A bundle id belongs to one purchases
|
|
237
|
+
app platform-wide: if another app holds it (another site's, or another account's), that is a
|
|
238
|
+
`bundle_registered_elsewhere` conflict. Only that registration's owner can remove it; `connect`
|
|
239
|
+
never does.
|
|
240
|
+
2. **The In-App Purchase key.** It stores `--iap-key` / `--iap-key-id` once, server-side. This is
|
|
241
|
+
an App Store Connect **In-App Purchase** key (Users and Access → Integrations → In-App
|
|
242
|
+
Purchase), not the App Store Connect API key `--profile` names; the service rejects that kind.
|
|
243
|
+
The issuer comes from the profile. Skipped when a key is already stored.
|
|
244
|
+
3. **The appleIAP payment provider** on the site, through Serve's IAP route to wix-iap
|
|
245
|
+
(`ConnectProviderAccount`). Reported as `provider_route_unavailable` only when the Serve target
|
|
246
|
+
has no IAP routes; a refusal from the service behind it is `request_failed`. There is no read
|
|
247
|
+
of the provider's state, so a rerun connects it again (the call is safe to repeat).
|
|
248
|
+
4. **One mapping per Wix item → Apple product.** Online Programs map by program id (the id the
|
|
249
|
+
purchase flow looks up), and only as non-consumables. Other verticals, price tiers and
|
|
250
|
+
consumable programs are skipped with `mapping_unsupported`. An item already mapped to another
|
|
251
|
+
product (`mapping_conflict`), a mapping of another product type (`mapping_type_mismatch`), an
|
|
252
|
+
inactive mapping (`mapping_inactive`), or an Apple product mapped to another item
|
|
253
|
+
(`sku_in_use`) is reported and left exactly as it is.
|
|
254
|
+
5. **The app's config.** With `--content <dir>`, it records `wixIap: { purchasesAppId }` (and the
|
|
255
|
+
`iap` capability) in the package's `config.ts`, keeping everything else byte for byte. The edit
|
|
256
|
+
is backed up under `.himi/store-iap-backup/`, checked with `himi validate`, and rolled back if it
|
|
257
|
+
introduces an error. A different purchases app already there, a member login on another
|
|
258
|
+
site, or another app's bundle is a conflict and the file is not touched. The bundle that must match
|
|
259
|
+
the manifest is the package's `store/store.config.yaml` `ios.bundleId` when it sets one;
|
|
260
|
+
otherwise `bundleId` itself or, for a dev bundle, the same without `.dev`. Whenever `--content` was given and the binding
|
|
261
|
+
did not land, the run is `ok: false` (`config_not_applied`) with what to add by hand.
|
|
262
|
+
|
|
263
|
+
**Review first.** `--dry-run` reads everything and writes nothing. Without `--dry-run` it prints
|
|
264
|
+
the plan and asks; a shell with no terminal (or `--json`) needs `--yes`. A rerun reuses every
|
|
265
|
+
record and writes nothing new. Adding products later means adding them to the manifest and
|
|
266
|
+
rerunning: only their mappings are added, and the purchases-app id (the one thing a build bakes)
|
|
267
|
+
does not change, so no new build is needed.
|
|
268
|
+
|
|
269
|
+
**What it does not do.** It never removes, replaces or reactivates a record. The app reads the
|
|
270
|
+
mappings it writes through Serve's member and visitor route (`POST /himalaya-serve/v1/iap/mappings`;
|
|
271
|
+
see [the backend integration](iap-backend-integration.md)); a build still needs the binding baked
|
|
272
|
+
for its screens to use them.
|
|
273
|
+
|
|
225
274
|
## Local state
|
|
226
275
|
|
|
227
276
|
Local state lives in `~/.himalaya/store-iap/<appleAppId>/`:
|
|
@@ -261,7 +310,7 @@ future importer must authenticate ownership and re-read Apple before activating
|
|
|
261
310
|
|
|
262
311
|
| Code | Meaning |
|
|
263
312
|
|---|---|
|
|
264
|
-
| `0` | everything requested is in place (`apply`, `status`), or the plan has no conflicts (`plan`) |
|
|
313
|
+
| `0` | everything requested is in place (`apply`, `status`, `connect`), or the plan has no conflicts (`plan`) |
|
|
265
314
|
| `1` | partial, conflict, drift, or a declined prompt |
|
|
266
315
|
| `2` | usage, manifest, credential, target or access error; nothing was written |
|
|
267
316
|
|
|
@@ -284,4 +333,4 @@ Not in this version:
|
|
|
284
333
|
- review screenshot upload and submission
|
|
285
334
|
- changing a live price
|
|
286
335
|
- Google Play
|
|
287
|
-
-
|
|
336
|
+
- the build-time binding bake and the screens' checkout (the companion PR)
|
package/guides/qa-builds.md
CHANGED
|
@@ -348,7 +348,7 @@ one never blocks a rollout — the dist routes just `501` with the reason.
|
|
|
348
348
|
| `HIMI_DIST_CALLBACK_BASE` | defaults to this artifact's bo origin, so usually unset |
|
|
349
349
|
| `HIMI_DIST_CONTRACT_URL_TEMPLATE` | where the pool fetches an app's brand contract; unset ⇒ the shell's committed provisioning |
|
|
350
350
|
| `HIMI_DIST_NOTIFY_TAGS` | Job Service notify-on-done, independent of our callback (covers a job that dies before reporting) |
|
|
351
|
-
| `HIMI_DIST_MAX_IN_FLIGHT` | simultaneous
|
|
351
|
+
| `HIMI_DIST_MAX_IN_FLIGHT` | simultaneous platform jobs per APP (default 3; the live config field has ceiling 40). An explicit override outranks `HimiDistCapacity.perAppInFlight`; changing or clearing it applies on the next deploy. |
|
|
352
352
|
| `HIMI_DIST_MAX_IN_FLIGHT_PER_IDENTITY` | simultaneous builds per CREDENTIAL, across every app it can reach (default 6 for an issued token, **18 for a shared one** — see below). The per-app cap is not a bound on a caller: apps are free to claim, so N slugs buy N×3 concurrent jobs on the pool `native-ci` shares. This is the one that bounds a person — or an agent of ours in a retry loop, which floods the pool exactly as well as a stranger would. Setting it applies to shared and issued credentials alike, and — unlike the per-tier form below — it OUTRANKS a `HimiDistCapacity` value, so leaving one set here shadows the lever for that bound until the next deploy clears it. The 429 names the jobs holding the slots, because `himi dist cancel` takes a job id and the listing route is per-app. |
|
|
353
353
|
| `HIMI_DIST_MAX_PER_IDENTITY_PER_DAY` | builds one credential may START in a rolling 24h (default 20 issued / 100 shared — see below). Concurrency alone does not bound spend — three at a time, restarted the instant each finishes, is unbounded Mac-pool time at a concurrency no in-flight cap objects to. Rolling, not calendar: the refusal carries a `resetAt` saying when the oldest build ages out. |
|
|
354
354
|
| `HIMI_DIST_CAPACITY` | set to `0` to stop reading the bounds from the `HimiDistCapacity` dynamic config and fall back to the three `HIMI_DIST_MAX_*` numbers and then the compiled defaults. Inverted from a dark switch, same as `HIMI_DIST_SELFSERVE`: the config's `Default` target group holds exactly the numbers the code already enforced, so this ships **on** as a no-op and config exists to withdraw it in an incident. Only the literal `0` closes it. |
|
|
@@ -395,15 +395,17 @@ and into their own, where the tighter number is the one that applies.
|
|
|
395
395
|
|
|
396
396
|
### Retuning the caps without a deploy
|
|
397
397
|
|
|
398
|
-
The six tiered numbers are **defaults**. What applies is resolved once per
|
|
399
|
-
|
|
398
|
+
The per-app number and six tiered numbers are **defaults**. What applies is resolved once per
|
|
399
|
+
dispatch, **per bound** — each walks the ladder on its own:
|
|
400
400
|
|
|
401
401
|
HIMI_DIST_MAX_* (global, if set) → the HimiDistCapacity field for that bound → the compiled default
|
|
402
402
|
|
|
403
403
|
`HimiDistCapacity` is a [Wix Dynamic Config](https://wix-bo.com/dev/dynamic-config) owned by
|
|
404
|
-
`himalaya`, with
|
|
404
|
+
`himalaya`, with seven `INT` fields — `perAppInFlight`, `selfServeInFlight`, `selfServePerDay`, `employeeInFlight`,
|
|
405
405
|
`employeePerDay`, `sharedInFlight`, `sharedPerDay` — and one filterless `Default` target group
|
|
406
|
-
holding the
|
|
406
|
+
holding the existing limits. `perAppInFlight` defaults to **3** and applies independently to every
|
|
407
|
+
app; the other fields apply to their credential tier across apps. iOS and Android each count as
|
|
408
|
+
one job, so a paired request needs two free slots. Editing a tier field retunes only that tier; the
|
|
407
409
|
write takes about **90 seconds** to reach runtime. The effective number appears in the 429 body, so
|
|
408
410
|
a caller can quote what actually applied. `HIMI_DIST_CAPACITY=0` removes the layer.
|
|
409
411
|
|
|
@@ -413,9 +415,9 @@ failure modes are not symmetric: if the field won, deploying this where someone
|
|
|
413
415
|
refusing builds that worked yesterday — active harm, from a change that is otherwise a no-op.
|
|
414
416
|
Losing to a set override costs only a lever that does not move. So if a field edit appears to do
|
|
415
417
|
nothing, check whether that key is set — and note that clearing it is not the fast path back: those
|
|
416
|
-
|
|
418
|
+
three keys are read once, when a pod builds its handlers, so a cleared key applies on the next deploy
|
|
417
419
|
rather than in 90 seconds. That staleness is what made these numbers un-editable in practice, and
|
|
418
|
-
the right state for
|
|
420
|
+
the right state for all three keys is now unset.
|
|
419
421
|
|
|
420
422
|
**A bad answer can never widen a bound.** The read conducts the scope `himi-dist-capacity` with the
|
|
421
423
|
artifact's own identity (`CONDUCTOR.READ`), and every way it can fail — no conduction clients on the
|
|
@@ -443,11 +445,13 @@ budget, so a call that never settles gives its slot back anyway and a hung condu
|
|
|
443
445
|
retire the lever for the life of the pod. At capacity the conduction is skipped, the layers below
|
|
444
446
|
answer, and that is logged once too.
|
|
445
447
|
|
|
446
|
-
**
|
|
447
|
-
`
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
**Both concurrency limits apply.** Raising a credential tier above `perAppInFlight` does not raise
|
|
449
|
+
the app's own cap. Change `perAppInFlight` to retune that cap through the same config. A per-app
|
|
450
|
+
refusal uses `dist_too_many_in_flight`; a credential refusal uses
|
|
451
|
+
`dist_identity_too_many_in_flight`. Both report the effective cap. Missing or invalid
|
|
452
|
+
`perAppInFlight`, or a config read failure, keeps the service override or default of 3.
|
|
453
|
+
Add the field with value 3 before deployment; older serve versions ignore it, and newer ones
|
|
454
|
+
keep the default when talking to an older config.
|
|
451
455
|
|
|
452
456
|
### Why the job's parameters ride in `command`, not `envVars`
|
|
453
457
|
|
|
@@ -1638,13 +1638,13 @@
|
|
|
1638
1638
|
"name": "PurchaseContext",
|
|
1639
1639
|
"kind": "interface",
|
|
1640
1640
|
"jsdoc": "/** A catalog item resolved by the backend for the captured member. */",
|
|
1641
|
-
"decl": "export interface PurchaseContext {\n productId: string;\n /** Canonical UUID
|
|
1641
|
+
"decl": "export interface PurchaseContext {\n productId: string;\n /** Canonical UUID for this one sale (D61: a per-payment purchase intent, not the member). */\n appAccountToken: string;\n /** Opaque site/member scope the acknowledgement must echo. */\n scopeKey: string;\n}"
|
|
1642
1642
|
},
|
|
1643
1643
|
{
|
|
1644
1644
|
"name": "MemberContext",
|
|
1645
1645
|
"kind": "interface",
|
|
1646
|
-
"jsdoc": "/** The current member's
|
|
1647
|
-
"decl": "export interface MemberContext {\n
|
|
1646
|
+
"jsdoc": "/** The current member's scope, used to recover purchases without a catalog item. It names no\n * token: each payment has its own, and the backend decides whose a transaction is. */",
|
|
1647
|
+
"decl": "export interface MemberContext {\n scopeKey: string;\n}"
|
|
1648
1648
|
},
|
|
1649
1649
|
{
|
|
1650
1650
|
"name": "ContextResult",
|
|
@@ -1722,7 +1722,7 @@
|
|
|
1722
1722
|
"name": "PurchaseCoordinatorDependencies",
|
|
1723
1723
|
"kind": "interface",
|
|
1724
1724
|
"jsdoc": "",
|
|
1725
|
-
"decl": "export interface PurchaseCoordinatorDependencies {\n store: TransactionStore;\n backend: DeliveryBackend;\n session: SessionProvider;\n clock: Clock;\n /** Extra milliseconds added to a backoff step; inject for deterministic tests. */\n jitter?: (baseDelayMs: number) => number;\n /** Receives a fresh safe snapshot after every change. */\n onState?: (state: DeliveryState) => void;\n}"
|
|
1725
|
+
"decl": "export interface PurchaseCoordinatorDependencies {\n store: TransactionStore;\n backend: DeliveryBackend;\n session: SessionProvider;\n clock: Clock;\n /** Extra milliseconds added to a backoff step; inject for deterministic tests. */\n jitter?: (baseDelayMs: number) => number;\n /** Receives a fresh safe snapshot after every change. */\n onState?: (state: DeliveryState) => void;\n /** Called inside the purchase job when StoreKit defers for Ask to Buy, after the unfinished\n * queue has been listed and before the job returns. The next queued purchase has not started. */\n onAwaitingApproval?: (productId: string) => void;\n}"
|
|
1726
1726
|
},
|
|
1727
1727
|
{
|
|
1728
1728
|
"name": "PurchaseCoordinator",
|
|
@@ -1932,7 +1932,7 @@
|
|
|
1932
1932
|
"name": "AppBindingSource",
|
|
1933
1933
|
"kind": "interface",
|
|
1934
1934
|
"jsdoc": "",
|
|
1935
|
-
"decl": "export interface AppBindingSource {\n /** Null when the app was never registered. */\n current(): Promise<PurchasesAppBinding | null>;\n}"
|
|
1935
|
+
"decl": "export interface AppBindingSource {\n /** Null when the app was never registered; rejects when the host could not say. */\n current(): Promise<PurchasesAppBinding | null>;\n}"
|
|
1936
1936
|
},
|
|
1937
1937
|
{
|
|
1938
1938
|
"name": "IapAppHost",
|
|
@@ -1946,11 +1946,35 @@
|
|
|
1946
1946
|
"jsdoc": "/** Where the Payments service is reachable through the Wix gateway. */",
|
|
1947
1947
|
"decl": "export interface WixIapRoute {\n /** The gateway path that maps to the service's `/v1`, without a trailing slash. No public route\n * was in the generated gateway metadata on 2026-10-08, so there is deliberately no default. */\n prefix: string;\n}"
|
|
1948
1948
|
},
|
|
1949
|
+
{
|
|
1950
|
+
"name": "HIMALAYA_SERVE_IAP_ROUTE",
|
|
1951
|
+
"kind": "const",
|
|
1952
|
+
"jsdoc": "/**\n * Serve's Apple-IAP routes on the public gateway (`www.wixapis.com/himalaya-serve/v1/iap`), where the\n * native bridge sends the member's or visitor's own token. One prefix for the wix-iap payment calls, the\n * cashier charge and the mapping read; Serve forwards each to the internal service that owns it.\n */",
|
|
1953
|
+
"decl": "export const HIMALAYA_SERVE_IAP_ROUTE: WixIapRoute = { prefix: \"/himalaya-serve/v1/iap\" };"
|
|
1954
|
+
},
|
|
1955
|
+
{
|
|
1956
|
+
"name": "AppleSaleRule",
|
|
1957
|
+
"kind": "interface",
|
|
1958
|
+
"jsdoc": "/** How the App Store sells one vertical's Wix item: the purchases catalog's `appProductId` for it, and\n * the only product type the purchase flow sells it as. */",
|
|
1959
|
+
"decl": "export interface AppleSaleRule {\n appProductId(entityId: string): string;\n productType: \"NON_CONSUMABLE\";\n}"
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
"name": "APPLE_SALE_RULES",
|
|
1963
|
+
"kind": "const",
|
|
1964
|
+
"jsdoc": "/**\n * The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,\n * keyed by catalog kind. wix-iap StartPayment maps the cashier order's single item id, and Online\n * Programs builds that order with the program id as the item id; programs are one-time unlocks.\n * Other verticals' order item ids are not established yet, so their items keep their own commerce.\n */",
|
|
1965
|
+
"decl": "export const APPLE_SALE_RULES: Readonly<Record<string, AppleSaleRule>> = {\n onlineProgram: { appProductId: (id) => id, productType: \"NON_CONSUMABLE\" },\n};"
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
"name": "HostCallExpectation",
|
|
1969
|
+
"kind": "interface",
|
|
1970
|
+
"jsdoc": "/** Captured when a protected call starts. The native bridge checks it and never puts it on\n * the HTTP request. */",
|
|
1971
|
+
"decl": "export interface HostCallExpectation {\n generation: number;\n kind: \"member\";\n memberId: string;\n siteId: string;\n appId: string;\n}"
|
|
1972
|
+
},
|
|
1949
1973
|
{
|
|
1950
1974
|
"name": "WixTransport",
|
|
1951
1975
|
"kind": "interface",
|
|
1952
|
-
"jsdoc": "/** The host's Wix REST bridge (`himalaya.wixApi`). Resolves the parsed body of a 2xx and\n * rejects with `HTTP <status> [<code>]: <message>` otherwise. Credentials are attached\n * natively, never in TypeScript. */",
|
|
1953
|
-
"decl": "export interface WixTransport {\n call(method: \"GET\" | \"POST\"
|
|
1976
|
+
"jsdoc": "/** The host's Wix REST bridge (`himalaya.wixApi`). Resolves the parsed body of a 2xx and\n * rejects with `HTTP <status> [<code>]: <message>` otherwise. Credentials are attached\n * natively, never in TypeScript. `expectation` is bridge metadata, not a header. */",
|
|
1977
|
+
"decl": "export interface WixTransport {\n call(\n method: \"GET\" | \"POST\",\n path: string,\n body?: unknown,\n headers?: Record<string, string>,\n expectation?: HostCallExpectation,\n ): Promise<unknown>;\n}"
|
|
1954
1978
|
},
|
|
1955
1979
|
{
|
|
1956
1980
|
"name": "MemberIdentitySource",
|
|
@@ -1974,7 +1998,7 @@
|
|
|
1974
1998
|
"name": "WixIapOperation",
|
|
1975
1999
|
"kind": "type",
|
|
1976
2000
|
"jsdoc": "",
|
|
1977
|
-
"decl": "export type WixIapOperation = \"startPayment\" | \"completePayment\" | \"
|
|
2001
|
+
"decl": "export type WixIapOperation = \"startPayment\" | \"completePayment\" | \"getPayment\";"
|
|
1978
2002
|
},
|
|
1979
2003
|
{
|
|
1980
2004
|
"name": "StartPaymentErrorCode",
|
|
@@ -1986,13 +2010,7 @@
|
|
|
1986
2010
|
"name": "CompletePaymentErrorCode",
|
|
1987
2011
|
"kind": "type",
|
|
1988
2012
|
"jsdoc": "",
|
|
1989
|
-
"decl": "export type CompletePaymentErrorCode = \"INVALID_PURCHASE\" | \"OWNED_BY_ANOTHER_CUSTOMER\" | \"PURCHASE_REVOKED\"\n | \"NOT_PURCHASED\" | \"ZERO_PRICE\" | \"NO_MATCHING_PAYMENT\" | \"APP_NOT_CONFIGURED\";"
|
|
1990
|
-
},
|
|
1991
|
-
{
|
|
1992
|
-
"name": "GetCustomerIdErrorCode",
|
|
1993
|
-
"kind": "type",
|
|
1994
|
-
"jsdoc": "",
|
|
1995
|
-
"decl": "export type GetCustomerIdErrorCode = \"APP_NOT_CONFIGURED\";"
|
|
2013
|
+
"decl": "export type CompletePaymentErrorCode = \"INVALID_PURCHASE\" | \"OWNED_BY_ANOTHER_CUSTOMER\" | \"PURCHASE_REVOKED\"\n | \"NOT_PURCHASED\" | \"ZERO_PRICE\" | \"NO_MATCHING_PAYMENT\" | \"PAYMENT_NOT_PENDING\" | \"APP_NOT_CONFIGURED\";"
|
|
1996
2014
|
},
|
|
1997
2015
|
{
|
|
1998
2016
|
"name": "GetPaymentErrorCode",
|
|
@@ -2015,21 +2033,15 @@
|
|
|
2015
2033
|
{
|
|
2016
2034
|
"name": "StartPaymentResult",
|
|
2017
2035
|
"kind": "type",
|
|
2018
|
-
"jsdoc": "/** `
|
|
2019
|
-
"decl": "export type StartPaymentResult =\n | { status: \"started\"; payment: WixIapPayment; storeProductId: string;
|
|
2036
|
+
"jsdoc": "/** `appAccountToken` goes to StoreKit with the purchase. It is minted for this one payment (a\n * purchase intent, D61), not the member: StartPayment for the same Wix transaction again returns\n * the same payment and the same token. Keep it out of screen state. */",
|
|
2037
|
+
"decl": "export type StartPaymentResult =\n | { status: \"started\"; payment: WixIapPayment; storeProductId: string; appAccountToken: string }\n | WixIapFailure<StartPaymentErrorCode>;"
|
|
2020
2038
|
},
|
|
2021
2039
|
{
|
|
2022
2040
|
"name": "CompletePaymentResult",
|
|
2023
2041
|
"kind": "type",
|
|
2024
|
-
"jsdoc": "/** `matched`: the server verified the proof and
|
|
2042
|
+
"jsdoc": "/** `matched`: the server verified the proof and paid the payment whose token the Apple transaction\n * carries. Its status may still be `approving`. */",
|
|
2025
2043
|
"decl": "export type CompletePaymentResult = { status: \"matched\"; payment: WixIapPayment } | WixIapFailure<CompletePaymentErrorCode>;"
|
|
2026
2044
|
},
|
|
2027
|
-
{
|
|
2028
|
-
"name": "CustomerIdResult",
|
|
2029
|
-
"kind": "type",
|
|
2030
|
-
"jsdoc": "",
|
|
2031
|
-
"decl": "export type CustomerIdResult = { status: \"found\"; customerId: string } | WixIapFailure<GetCustomerIdErrorCode>;"
|
|
2032
|
-
},
|
|
2033
2045
|
{
|
|
2034
2046
|
"name": "GetPaymentResult",
|
|
2035
2047
|
"kind": "type",
|
|
@@ -2047,16 +2059,58 @@
|
|
|
2047
2059
|
"name": "WixIapClient",
|
|
2048
2060
|
"kind": "interface",
|
|
2049
2061
|
"jsdoc": "",
|
|
2050
|
-
"decl": "export interface WixIapClient {\n /** StartPayment for a pending `appleIAP` Wix Payments transaction the member placed. Returns the\n * store product to sell and
|
|
2062
|
+
"decl": "export interface WixIapClient {\n /** StartPayment for a pending `appleIAP` Wix Payments transaction the member placed. Returns the\n * store product to sell and this payment's `appAccountToken` to pass to StoreKit. */\n startPayment(input: { wixTransactionId: string }): Promise<StartPaymentResult>;\n /** CompletePayment with held Apple proof, sent unchanged: the service pays the payment whose\n * token the transaction carries. Success can still be `approving`. */\n completePayment(transaction: AppleTransaction): Promise<CompletePaymentResult>;\n /** GetPayment: one of the member's own Payments. */\n getPayment(input: { paymentId: string }): Promise<GetPaymentResult>;\n}",
|
|
2051
2063
|
"verified": false
|
|
2052
2064
|
},
|
|
2053
2065
|
{
|
|
2054
2066
|
"name": "createWixIapClient",
|
|
2055
2067
|
"kind": "function",
|
|
2056
|
-
"jsdoc": "/**\n * Creates a client for Wix's in-app-purchase payments service (`mobile-apps-wix-iap`), which pays\n * a Wix order with a store purchase the member makes in the app.\n *\n * NOT ENABLED and not production-ready. No app wires it, and no call reaches the service: it has\n * no public gateway route yet, so `route` must be supplied and there is no default. It calls\n * StartPayment (`POST …/payments/start`), CompletePayment (`POST …/payments/complete`)
|
|
2068
|
+
"jsdoc": "/**\n * Creates a client for Wix's in-app-purchase payments service (`mobile-apps-wix-iap`), which pays\n * a Wix order with a store purchase the member makes in the app.\n *\n * NOT ENABLED and not production-ready. No app wires it, and no call reaches the service: it has\n * no public gateway route yet, so `route` must be supplied and there is no default. It calls\n * StartPayment (`POST …/payments/start`), CompletePayment (`POST …/payments/complete`)\n * and GetPayment (`GET …/payments/{id}`) through the\n * `wix_api` bridge. A matched or approved Payment is not durable access and never finishes the\n * store transaction.\n *\n * Production use stays blocked: there is no public route or member authorization on the service,\n * no trusted app-binding source, and checkout stays disabled. When this client uses the host\n * bridge, it also requires the host's identity clock and passes that captured expectation\n * through the bridge. An injected transport keeps the previous call shape unless the session\n * itself exposes an identity.\n */",
|
|
2057
2069
|
"decl": "export function createWixIapClient(deps: WixIapClientDependencies): WixIapClient;",
|
|
2058
2070
|
"verified": false
|
|
2059
2071
|
},
|
|
2072
|
+
{
|
|
2073
|
+
"name": "HostSessionView",
|
|
2074
|
+
"kind": "interface",
|
|
2075
|
+
"jsdoc": "",
|
|
2076
|
+
"decl": "export interface HostSessionView extends SessionSnapshot {\n memberId: string | null;\n siteId: string | null;\n appId: string | null;\n ready: boolean;\n epoch: number;\n}"
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
"name": "HostIdentitySource",
|
|
2080
|
+
"kind": "interface",
|
|
2081
|
+
"jsdoc": "/** A session provider that can also name the principal captured for one generation. */",
|
|
2082
|
+
"decl": "export interface HostIdentitySource {\n readonly identityBound: boolean;\n identity(session: SessionSnapshot): HostCallExpectation | null;\n}"
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
"name": "HostSessionProvider",
|
|
2086
|
+
"kind": "interface",
|
|
2087
|
+
"jsdoc": "",
|
|
2088
|
+
"decl": "export interface HostSessionProvider extends SessionProvider, HostIdentitySource {}"
|
|
2089
|
+
},
|
|
2090
|
+
{
|
|
2091
|
+
"name": "createHostSession",
|
|
2092
|
+
"kind": "function",
|
|
2093
|
+
"jsdoc": "/** Wraps a host session clock as the session provider the delivery coordinator and the wix-iap\n * client share. Ignores a generation older than the last one read, and keeps the first member\n * expectation captured for each generation for `identity()`. */",
|
|
2094
|
+
"decl": "export function createHostSession(source: {\n identityBound: boolean;\n current(): unknown;\n subscribe(listener: () => void): () => void;\n}): HostSessionProvider;"
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
"name": "hostSessionFromGlobal",
|
|
2098
|
+
"kind": "function",
|
|
2099
|
+
"jsdoc": "/** The session on `globalThis.himalaya`. Web publishes `identityBound: false`. */",
|
|
2100
|
+
"decl": "export function hostSessionFromGlobal(): HostSessionProvider;"
|
|
2101
|
+
},
|
|
2102
|
+
{
|
|
2103
|
+
"name": "memberIdentityOf",
|
|
2104
|
+
"kind": "function",
|
|
2105
|
+
"jsdoc": "/** The member a host session names for a captured generation, as the identity port the Apple-IAP\n * checkout and the wix-iap client take: null when that generation has no signed-in member. */",
|
|
2106
|
+
"decl": "export function memberIdentityOf(source: HostIdentitySource): MemberIdentitySource;"
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
"name": "readIdentityBound",
|
|
2110
|
+
"kind": "function",
|
|
2111
|
+
"jsdoc": "/** Whether the host fences protected calls to the captured member (`identityBound`). Web does not. */",
|
|
2112
|
+
"decl": "export function readIdentityBound(): boolean;"
|
|
2113
|
+
},
|
|
2060
2114
|
{
|
|
2061
2115
|
"name": "ProductType",
|
|
2062
2116
|
"kind": "type",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1311.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"artifactId": "himalaya-cli"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"falconPackageHash": "
|
|
74
|
+
"falconPackageHash": "105e0572efcdcccbc0bea292e6e88354813e2abb6f818908beff3f79"
|
|
75
75
|
}
|