@wix/himalaya-cli 0.1640.0 → 0.1642.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/cli.mjs +327 -155
- package/guides/himi-json-output.md +20 -1
- package/guides/qa-builds.md +33 -0
- package/package.json +2 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-cms-collection/index.ts +11 -5
- package/templates/community-club/tier5-src/himi-branded-lite-cms-collection/index.ts +11 -5
|
@@ -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, for **`himi publish-size`**, for **`himi store iap connect`**, for **`himi site member-app`**, for **`himi fidelity`**, for the **`himi base44`** entity and function verbs, for **`himi l10n import`**, and for **`himi login --device`**. Other subcommands still have legacy failures without codes and are a
|
|
9
|
+
first, for **`himi publish-size`**, for **`himi store iap connect`**, for **`himi site member-app`**, for **`himi store app`**, for **`himi fidelity`**, for the **`himi base44`** entity and function verbs, for **`himi l10n import`**, and for **`himi login --device`**. 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
|
|
@@ -800,3 +800,22 @@ values on failures: `unauthorized`, `token_revoked`, `revocation_check_unavailab
|
|
|
800
800
|
`apple_keys_unavailable`. `build_secrets_busy` is HTTP 409: another ASC upload or
|
|
801
801
|
push setup holds the site; retry after it finishes. Responses have `Cache-Control:
|
|
802
802
|
no-store`; both methods require app authority and current Wix site ownership.
|
|
803
|
+
|
|
804
|
+
## `himi store app` codes
|
|
805
|
+
|
|
806
|
+
`himi store app set|show --app <id> --site <msid>` prints one envelope. A refusal from the publishing
|
|
807
|
+
service keeps the service's own code in `serverError` (for example `forbidden_app`,
|
|
808
|
+
`store_app_linked_to_other_site`, `store_app_site_taken`, `premium_plan_required`) and its HTTP
|
|
809
|
+
`status`; the CLI `code` is one of:
|
|
810
|
+
|
|
811
|
+
| Code | Meaning |
|
|
812
|
+
|---|---|
|
|
813
|
+
| `invalid_usage` | Missing or malformed op, `--app`, `--site` or (for `set`) `--android-package`, which is checked with the plane's own rule (`reason`: `package_name_prefix_required`, `invalid_package_name` or `package_name_reserved`). No Wix token was minted and nothing was sent. |
|
|
814
|
+
| `insecure_target` | The target's control URL is not an https `wix.com` host (or loopback), so the Wix credential was neither minted nor sent. Nothing was sent. |
|
|
815
|
+
| `control_token_required` | No control token for the target — run `himi login`. Nothing was sent. |
|
|
816
|
+
| `wix_token_unavailable` | The account Wix token (`wix token`) could not be minted; the publishing service needs it to verify you own the app and the site. Nothing was sent. |
|
|
817
|
+
| `unauthorized` | The control token was refused or revoked (401). |
|
|
818
|
+
| `forbidden` | Not your app, not your site, or the token may not act for the app (403); `serverError` says which. |
|
|
819
|
+
| `refused` | A rule refused it (another 4xx): the package name, another app holding the site's store app, the app linked to another site, no saved package name, the site's plan; `serverError` says which. |
|
|
820
|
+
| `control_unreachable` | The publishing service could not be reached. |
|
|
821
|
+
| `request_failed` | Any other failure (5xx); `status` and `serverError` say which. |
|
package/guides/qa-builds.md
CHANGED
|
@@ -1259,6 +1259,39 @@ himi dist --app <app> --platform android --aab --wait --target bo
|
|
|
1259
1259
|
`409 release_predates_store_builds`; a draft the editor just built is on a current commit. It is
|
|
1260
1260
|
not sent the App name and icon either, so it cannot give their refusals (below). It never
|
|
1261
1261
|
falls back to the locking call.
|
|
1262
|
+
- **An app you own, linked to a site you own, gets the same store build.** An app made with the
|
|
1263
|
+
CLI (`himi init`) is owned by your Wix account and bound to no site, so its `--aab` was
|
|
1264
|
+
`403 android_format_not_allowed`. Binding it to a site is the wrong tool: that converts it into a
|
|
1265
|
+
site app, after which your own `himi login` token can no longer push it. Instead, LINK it — the
|
|
1266
|
+
first save of its package name does it:
|
|
1267
|
+
|
|
1268
|
+
```bash
|
|
1269
|
+
himi store app set --app <app> --site <msid> --android-package himi.<name> # link + save the package name
|
|
1270
|
+
himi store app show --app <app> --site <msid> # the store build's checks, no build
|
|
1271
|
+
himi dist --app <app> --platform android --shell branded-lite --aab \
|
|
1272
|
+
--app-name "My App" --app-icon-url https://…/icon.png
|
|
1273
|
+
```
|
|
1274
|
+
|
|
1275
|
+
`set` is `PUT /v1/admin/site/store-app` and `show` is the store-build-check above, both with your
|
|
1276
|
+
`himi login` control token AND your account's Wix credential (`wix token`, sent as
|
|
1277
|
+
`Authorization`). The plane accepts the app only when the token's account is the app's OWNER (a
|
|
1278
|
+
collaborator is `403 forbidden_app`), that same account controls the Wix credential and owns the
|
|
1279
|
+
site (`403 forbidden_site`, or `store_build_site_forbidden` on the check), and the app is not
|
|
1280
|
+
already linked to another site (`409 store_app_linked_to_other_site`; moving needs Wix support,
|
|
1281
|
+
because a build may have locked the package name). It records a link (app → site, one site per
|
|
1282
|
+
app), holds the site's store app (`409 store_app_site_taken` if another app holds it), and saves
|
|
1283
|
+
the package name; the response says `linked: true` the first time. Only the Google Play package
|
|
1284
|
+
name is saved this way (`400 store_app_link_android_only` for iOS ids): App Store builds stay
|
|
1285
|
+
Containers-only. Before a link exists, the check and `GET /v1/admin/site/store-app` answer
|
|
1286
|
+
`409 store_app_requires_site_binding`, the code an unbound app always got.
|
|
1287
|
+
|
|
1288
|
+
`himi dist --aab` then finds the site from the link and runs every store-build check above against
|
|
1289
|
+
it, including the strict site-owner check, the store-app hold, the plan (`premium_plan_required`)
|
|
1290
|
+
and the package lock, with the app name and icon required, `branded-lite` only, WixOne signing.
|
|
1291
|
+
The link is re-checked on every build: if the app changed owner, was deactivated, or was since
|
|
1292
|
+
bound to a site, it no longer counts and the bundle is `403 android_format_not_allowed` again. The
|
|
1293
|
+
app is never site-bound anywhere else: push, CAPTCHA and every other route treat it as the
|
|
1294
|
+
account app it is. An `--android-signing owner` bundle keeps its own path.
|
|
1262
1295
|
- **A Containers app's TestFlight build is an App Store build.** For an app bound to a Wix site,
|
|
1263
1296
|
`--platform ios --destination testflight --version <x.y.z>` with no `--signing` builds the app for
|
|
1264
1297
|
the owner's own App Store account: signed with the owner's certificate, under the bundle id saved
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1642.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": [
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"artifactId": "himalaya-cli"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"falconPackageHash": "
|
|
75
|
+
"falconPackageHash": "26b70f3c91e83f2a063539fb44536594804d3af047f6b39d8f60ff24"
|
|
76
76
|
}
|
|
@@ -229,7 +229,11 @@ function resolveCollection(arg: unknown): CmsCollectionDefinition | undefined {
|
|
|
229
229
|
return id ? list.find((candidate) => candidate.id === id) : undefined;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
// The in-flight load, keyed by collection. A second load() for the same collection JOINS it and
|
|
233
|
+
// resolves to its result — it must not return the stale `loading` state it was handed, because the
|
|
234
|
+
// module-scope boot load starts first and the host's onAppear load (what `himi render --live`
|
|
235
|
+
// awaits before reading state) arrives while it is still running.
|
|
236
|
+
let inflight: { id: string; promise: Promise<State> } | null = null;
|
|
233
237
|
|
|
234
238
|
const svc = defineService<State, {
|
|
235
239
|
load: (state: State, arg?: unknown) => Promise<State>;
|
|
@@ -245,8 +249,8 @@ const svc = defineService<State, {
|
|
|
245
249
|
if (!collection) return { ...state, status: "error", isLoading: false, notLoading: true, isErrored: true, notErrored: false, errorText: copyParam("cmsCollection.notConfiguredError", "This collection is not configured for the app.") };
|
|
246
250
|
const force = argValue(arg, "force") === "1";
|
|
247
251
|
if (!force && state.collectionId === collection.id && state.status === "ready") return state;
|
|
248
|
-
if (!force &&
|
|
249
|
-
|
|
252
|
+
if (!force && inflight && inflight.id === collection.id) return inflight.promise;
|
|
253
|
+
const run = (async (): Promise<State> => {
|
|
250
254
|
// Last-synced items for THIS collection (offline-safe; empty on first-ever run).
|
|
251
255
|
const cached = await readCached(collection.id);
|
|
252
256
|
try {
|
|
@@ -278,9 +282,11 @@ const svc = defineService<State, {
|
|
|
278
282
|
? copyParam("cmsCollection.memberSignInError", "Sign in from Profile to view this member collection.")
|
|
279
283
|
: copyParam("cmsCollection.unavailableError", "This collection is temporarily unavailable."),
|
|
280
284
|
};
|
|
281
|
-
} finally {
|
|
282
|
-
loadingCollectionId = "";
|
|
283
285
|
}
|
|
286
|
+
})();
|
|
287
|
+
const entry = { id: collection.id, promise: run };
|
|
288
|
+
inflight = entry;
|
|
289
|
+
try { return await run; } finally { if (inflight === entry) inflight = null; }
|
|
284
290
|
},
|
|
285
291
|
search: (state, arg) => {
|
|
286
292
|
const query = argValue(arg, "value").trim().toLowerCase();
|
|
@@ -229,7 +229,11 @@ function resolveCollection(arg: unknown): CmsCollectionDefinition | undefined {
|
|
|
229
229
|
return id ? list.find((candidate) => candidate.id === id) : undefined;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
// The in-flight load, keyed by collection. A second load() for the same collection JOINS it and
|
|
233
|
+
// resolves to its result — it must not return the stale `loading` state it was handed, because the
|
|
234
|
+
// module-scope boot load starts first and the host's onAppear load (what `himi render --live`
|
|
235
|
+
// awaits before reading state) arrives while it is still running.
|
|
236
|
+
let inflight: { id: string; promise: Promise<State> } | null = null;
|
|
233
237
|
|
|
234
238
|
const svc = defineService<State, {
|
|
235
239
|
load: (state: State, arg?: unknown) => Promise<State>;
|
|
@@ -245,8 +249,8 @@ const svc = defineService<State, {
|
|
|
245
249
|
if (!collection) return { ...state, status: "error", isLoading: false, notLoading: true, isErrored: true, notErrored: false, errorText: copyParam("cmsCollection.notConfiguredError", "This collection is not configured for the app.") };
|
|
246
250
|
const force = argValue(arg, "force") === "1";
|
|
247
251
|
if (!force && state.collectionId === collection.id && state.status === "ready") return state;
|
|
248
|
-
if (!force &&
|
|
249
|
-
|
|
252
|
+
if (!force && inflight && inflight.id === collection.id) return inflight.promise;
|
|
253
|
+
const run = (async (): Promise<State> => {
|
|
250
254
|
// Last-synced items for THIS collection (offline-safe; empty on first-ever run).
|
|
251
255
|
const cached = await readCached(collection.id);
|
|
252
256
|
try {
|
|
@@ -278,9 +282,11 @@ const svc = defineService<State, {
|
|
|
278
282
|
? copyParam("cmsCollection.memberSignInError", "Sign in from Profile to view this member collection.")
|
|
279
283
|
: copyParam("cmsCollection.unavailableError", "This collection is temporarily unavailable."),
|
|
280
284
|
};
|
|
281
|
-
} finally {
|
|
282
|
-
loadingCollectionId = "";
|
|
283
285
|
}
|
|
286
|
+
})();
|
|
287
|
+
const entry = { id: collection.id, promise: run };
|
|
288
|
+
inflight = entry;
|
|
289
|
+
try { return await run; } finally { if (inflight === entry) inflight = null; }
|
|
284
290
|
},
|
|
285
291
|
search: (state, arg) => {
|
|
286
292
|
const query = argValue(arg, "value").trim().toLowerCase();
|