@wix/himalaya-cli 0.1722.0 → 0.1723.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 +52 -16
- package/package.json +2 -2
- package/templates/beauty-salon-owner/config.ts +1 -1
- package/templates/brandy/README.md +1 -1
- package/templates/brandy/config.ts +57 -5
- package/templates/brandy/dev/index.ts +513 -2
- package/templates/brandy/himalaya.content.json +1 -1
- package/templates/brandy/himalaya.template.json +1 -1
- package/templates/brandy/tier5-src/himi-brandy-base44-account/index.ts +187 -0
- package/templates/community-club-owner/config.ts +1 -1
- package/templates/events-meetups-owner/config.ts +1 -1
- package/templates/gym-fitness-owner/config.ts +1 -1
- package/templates/nonprofit-cause-owner/config.ts +1 -1
- package/templates/owner-lite/config.ts +1 -1
- package/templates/podcast-creator-owner/config.ts +1 -1
- package/templates/portfolio-creative-owner/config.ts +1 -1
- package/templates/restaurant-owner/config.ts +1 -1
- package/templates/retail-store-owner/config.ts +1 -1
- package/templates/yoga-studio-owner/config.ts +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -3720,15 +3720,35 @@ var init_dist_jobs = __esm({
|
|
|
3720
3720
|
embeddedSuffixes: ["liveactivity", "watchkitapp"],
|
|
3721
3721
|
extensibleCapabilities: true
|
|
3722
3722
|
},
|
|
3723
|
-
// RFC 0062 — the site shell: the customer's own website as native-framed
|
|
3724
|
-
//
|
|
3725
|
-
//
|
|
3723
|
+
// RFC 0062 — the site shell: the customer's own website as native-framed tabs. Since RFC 0079 §10
|
|
3724
|
+
// (phase 6, the cut-over) `brandy` is an ALIAS of branded-lite: it builds branded-lite's tree, which
|
|
3725
|
+
// hosts site pages through the shared shell glue, and bakes the release's own site block. What it
|
|
3726
|
+
// keeps is Brandy's identity, so an installed Brandy build updates in place:
|
|
3727
|
+
// - its bundle ids (`DIST_BUNDLE_ID`, which the pool's bundle-id policy ships under), and the
|
|
3728
|
+
// per-app ids recorded for its apps (`recordedBundleIdOf` is per app, never per shell);
|
|
3729
|
+
// - its Android key: no shell has a key of its own — the job's `androidSigning` policy picks it
|
|
3730
|
+
// (the committed QA keystore by default), for the alias exactly as for Brandy;
|
|
3731
|
+
// - its entitlements: Brandy's profiles carry push + associated domains only, so the alias never
|
|
3732
|
+
// adds App Attest (`appAttest: false`) and starts every release from the site profile, which
|
|
3733
|
+
// drops `live_activity` and with it the App Group (still added when a release declares it, as
|
|
3734
|
+
// Brandy's own Live Activity target did).
|
|
3735
|
+
// `contentAppDir` keeps `site analyze --apply --shell brandy` on the in-repo Brandy app until its
|
|
3736
|
+
// native folders are retired (6F-b).
|
|
3726
3737
|
brandy: {
|
|
3727
|
-
appDir: "apps/himi-
|
|
3738
|
+
appDir: "apps/himi-branded-lite",
|
|
3739
|
+
aliasOf: "branded-lite",
|
|
3740
|
+
contentAppDir: "apps/himi-brandy",
|
|
3728
3741
|
bundleId: { ios: "ent.wix.brandy.dev", android: "com.wix.himi.brandy.dev" },
|
|
3729
|
-
|
|
3742
|
+
// The tree's gradle seam: branded-lite's build.gradle.kts reads THIS name, never Brandy's.
|
|
3743
|
+
provisioningEnv: "HIMI_BRANDED_LITE_PROVISIONING_JSON",
|
|
3730
3744
|
embeddedSuffixes: ["liveactivity"],
|
|
3731
|
-
extensibleCapabilities: true
|
|
3745
|
+
extensibleCapabilities: true,
|
|
3746
|
+
// Brandy never accepted author native code; the alias does not start to.
|
|
3747
|
+
projectsMemberBinding: true,
|
|
3748
|
+
projectsSite: true,
|
|
3749
|
+
siteCapabilityProfile: true,
|
|
3750
|
+
siteReleasesOnly: true,
|
|
3751
|
+
appAttest: false
|
|
3732
3752
|
},
|
|
3733
3753
|
// The Base44 shell (#3674): a Base44 app as a native binary. Brandable — dist bakes the fetched
|
|
3734
3754
|
// contract's identity, icon, brand colour and `base44` binding (which Base44 app it talks to).
|
|
@@ -4700,6 +4720,7 @@ function assertSiteShellConfig(site, opts) {
|
|
|
4700
4720
|
var SITE_LAYOUTS, SITE_SHELL_MAX_TABS, SITE_SCREEN_PREFIX, SITE_PAGE_SCREEN_ID, BASE44_ORIGINS, PAGE_ID, SITE_PAGE_NODE_ID, SITE_SCREEN_FORMS, SITE_NODE_SCREEN_RENDERER;
|
|
4701
4721
|
var init_site_shell = __esm({
|
|
4702
4722
|
"../../core/ts/src/site-shell.ts"() {
|
|
4723
|
+
"use strict";
|
|
4703
4724
|
init_define_HHP_CATALOG();
|
|
4704
4725
|
init_site_screen_form();
|
|
4705
4726
|
init_webview_embedded();
|
|
@@ -4764,7 +4785,7 @@ function assertKnownShell(name) {
|
|
|
4764
4785
|
}
|
|
4765
4786
|
function shellAppDir(name) {
|
|
4766
4787
|
assertKnownShell(name);
|
|
4767
|
-
return DIST_SHELLS[name].appDir;
|
|
4788
|
+
return DIST_SHELLS[name].contentAppDir ?? DIST_SHELLS[name].appDir;
|
|
4768
4789
|
}
|
|
4769
4790
|
function homeRefreshActionId(name) {
|
|
4770
4791
|
assertKnownShell(name);
|
|
@@ -28276,6 +28297,7 @@ var init_page_worker = __esm({
|
|
|
28276
28297
|
var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
|
|
28277
28298
|
var init_icon_catalog_generated = __esm({
|
|
28278
28299
|
"../../core/ts/src/icon-catalog.generated.ts"() {
|
|
28300
|
+
"use strict";
|
|
28279
28301
|
init_define_HHP_CATALOG();
|
|
28280
28302
|
ICON_VIEW_BOX = 24;
|
|
28281
28303
|
ICON_STROKE_WIDTH = 2;
|
|
@@ -32384,6 +32406,9 @@ function boundedString(value2, field, maxLength = 120) {
|
|
|
32384
32406
|
}
|
|
32385
32407
|
return result;
|
|
32386
32408
|
}
|
|
32409
|
+
function contractHostOwnsTabs(installedVerticals) {
|
|
32410
|
+
return installedVerticals != null;
|
|
32411
|
+
}
|
|
32387
32412
|
function parseWebSdkBinding(value2, hasBase44Binding) {
|
|
32388
32413
|
if (value2 == null) return void 0;
|
|
32389
32414
|
const input = record(value2, "provisioning.webSdk");
|
|
@@ -33149,6 +33174,15 @@ function updateSiteViewMetadata(existing, before, after) {
|
|
|
33149
33174
|
validateScreenMetadata(updated);
|
|
33150
33175
|
return updated;
|
|
33151
33176
|
}
|
|
33177
|
+
function isSiteShellProvisioning(manifest2) {
|
|
33178
|
+
if (!manifest2 || typeof manifest2 !== "object" || Array.isArray(manifest2)) return false;
|
|
33179
|
+
const { site, installedVerticals } = manifest2;
|
|
33180
|
+
if (!site || typeof site !== "object" || Array.isArray(site)) return false;
|
|
33181
|
+
const block = site;
|
|
33182
|
+
if (typeof block.origin !== "string" || !Array.isArray(block.pages)) return false;
|
|
33183
|
+
if (contractHostOwnsTabs(installedVerticals)) return false;
|
|
33184
|
+
return isSiteShellBlock(block);
|
|
33185
|
+
}
|
|
33152
33186
|
function siteViewMetadataForBuild(existing, site) {
|
|
33153
33187
|
const screens = parseScreenMetadata(existing);
|
|
33154
33188
|
if (!screens) return void 0;
|
|
@@ -33158,6 +33192,8 @@ function siteViewMetadataForBuild(existing, site) {
|
|
|
33158
33192
|
var init_site_view_metadata = __esm({
|
|
33159
33193
|
"src/site-analyze/site-view-metadata.ts"() {
|
|
33160
33194
|
init_define_HHP_CATALOG();
|
|
33195
|
+
init_site_contract();
|
|
33196
|
+
init_brandable_shells();
|
|
33161
33197
|
init_screen_views();
|
|
33162
33198
|
}
|
|
33163
33199
|
});
|
|
@@ -37634,7 +37670,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
37634
37670
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
37635
37671
|
var init_idiom = __esm({
|
|
37636
37672
|
"../../core/ts/src/idiom.ts"() {
|
|
37637
|
-
"use strict";
|
|
37638
37673
|
init_define_HHP_CATALOG();
|
|
37639
37674
|
IDIOM_CONTEXTS = {
|
|
37640
37675
|
ios: { native: ["ios"] },
|
|
@@ -153240,9 +153275,10 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
|
|
|
153240
153275
|
const contentManifestPath2 = join37(preloaded.dir, "himalaya.content.json");
|
|
153241
153276
|
const contentManifest = existsSync43(contentManifestPath2) ? JSON.parse(readFileSync46(contentManifestPath2, "utf8")) : void 0;
|
|
153242
153277
|
let screenMetadata = parseScreenMetadata(contentManifest?.screens);
|
|
153243
|
-
if (
|
|
153278
|
+
if (screenMetadata) {
|
|
153244
153279
|
const provisioningPath2 = join37(preloaded.dir, "provisioning.json");
|
|
153245
|
-
|
|
153280
|
+
const manifest3 = existsSync43(provisioningPath2) ? JSON.parse(readFileSync46(provisioningPath2, "utf8")) : void 0;
|
|
153281
|
+
if (isSiteShellProvisioning(manifest3)) screenMetadata = siteViewMetadataForBuild(screenMetadata, manifest3.site);
|
|
153246
153282
|
}
|
|
153247
153283
|
await store.reset(app2);
|
|
153248
153284
|
const bundles = {};
|
|
@@ -172880,11 +172916,11 @@ var init_shell_capabilities_generated = __esm({
|
|
|
172880
172916
|
serves: ["app_info", "clipboard", "live_activity", "local_database", "open_url", "push", "release_control", "secure_storage", "share", "theme", "ui", "wix_api", "wix_platform"]
|
|
172881
172917
|
},
|
|
172882
172918
|
"brandy": {
|
|
172883
|
-
appDir: "apps/himi-
|
|
172919
|
+
appDir: "apps/himi-branded-lite",
|
|
172884
172920
|
shared: false,
|
|
172885
172921
|
extensible: true,
|
|
172886
|
-
built: ["
|
|
172887
|
-
serves: ["
|
|
172922
|
+
built: ["app_info", "clipboard", "live_activity", "local_database", "open_url", "push", "release_control", "secure_storage", "share", "theme", "ui", "wix_api", "wix_platform"],
|
|
172923
|
+
serves: ["app_info", "clipboard", "live_activity", "local_database", "open_url", "push", "release_control", "secure_storage", "share", "theme", "ui", "wix_api", "wix_platform"]
|
|
172888
172924
|
},
|
|
172889
172925
|
"demo-app": {
|
|
172890
172926
|
appDir: "apps/demo-app",
|
|
@@ -172904,8 +172940,8 @@ var init_shell_capabilities_generated = __esm({
|
|
|
172904
172940
|
appDir: "apps/himi-owner-lite",
|
|
172905
172941
|
shared: false,
|
|
172906
172942
|
extensible: true,
|
|
172907
|
-
built: ["animation", "app_info", "biometrics", "camera", "clipboard", "file_picker", "files", "live_activity", "local_database", "open_url", "photos", "presigned_upload", "push", "secure_storage", "share", "speech", "ui", "wix_platform"],
|
|
172908
|
-
serves: ["animation", "app_info", "biometrics", "camera", "clipboard", "file_picker", "files", "live_activity", "local_database", "open_url", "photos", "presigned_upload", "push", "secure_storage", "share", "speech", "ui", "wix_platform"]
|
|
172943
|
+
built: ["animation", "app_info", "biometrics", "camera", "clipboard", "file_picker", "files", "live_activity", "local_database", "open_url", "photos", "presigned_upload", "push", "secure_storage", "share", "speech", "ui", "wix_api", "wix_platform"],
|
|
172944
|
+
serves: ["animation", "app_info", "biometrics", "camera", "clipboard", "file_picker", "files", "live_activity", "local_database", "open_url", "photos", "presigned_upload", "push", "secure_storage", "share", "speech", "ui", "wix_api", "wix_platform"]
|
|
172909
172945
|
},
|
|
172910
172946
|
"player": {
|
|
172911
172947
|
appDir: "apps/himi-player",
|
|
@@ -266399,7 +266435,7 @@ var COMMANDS = [
|
|
|
266399
266435
|
{ name: "patch", summary: 'change ONE item of a published app \u2014 a screen descriptor, a Tier-5 bundle, tokens, or the app-config baseline \u2014 from a RAW FILE, with no content package and no build. The low-level door: it does not lint your package, because there is no package here; `himi push --only <selector>` is the same edit with the full build + lint gate and is what to reach for when the package is in hand. Derives a new release from the app\'s current LIVE release, or from `--from-release <id>`. An explicit `--draft` or `--live` is REQUIRED \u2014 a patch has no default blast radius \u2014 and `--notes` is required with `--live` on a screen or app-config patch, because off-repo `gitSha` is "dev" and the ledger notes are then the only durable record of bytes that correspond to no commit. A branch does not merge: activating one derived from an older release reverts every item the patch does not move, so that case is refused until `--accept-regressions`. A bundle patch must repoint a screen (`--for-screen`) or the bytes land under a manifest key nothing reads. It cannot ADD a screen (screens are git-only, RFC 0012), never claims a slug \u2014 the app must already be published \u2014 and carries no attestation, source archive, assets, icon or minBinaryVersion, each named in the output.', required: "screen <id> --file <descriptor.json> [--bundle <sha256|none>] | bundle --file <bundle.js> (--for-screen <id>[,<id>] | --no-rebind) | tokens --file <tokens.json> | app-config --file <app-config.json> ; (--draft|--live) --app <a> [--from-release <id>] [--accept-regressions] [--label <n>] [--notes <t>] [--force] [--allow-binary-gap] [--target <t>] (--control-token)" },
|
|
266400
266436
|
{ name: "flags", summary: "read and change the app's OPERATIONAL flags (RFC 0013) \u2014 `list` prints what the DEVICE door serves, `set <key> --definition` creates or replaces one, `ramp <key>` moves its rollout share or kills it, `rm <key>` deletes it and echoes the definition back so the removal is reversible. Every write is followed by a read of the same door the device uses, and the answer is reported as `servedNow`: flags are stored in the app's git-committed flags.json, so a control plane with no checkout accepts a write it will never serve.", required: "list|set|ramp|rm [<key>] [--definition <json|@file>] [--percent 0-100] [--enabled true|false] [--app <a>] (--control-token)" },
|
|
266401
266437
|
{ name: "visibility", summary: "read (no value) or set whether the public registry (/v1/apps + the Himi Player picker) LISTS the app. `public` lists it for everyone; `unlisted` hides it from listings while direct reads by app id \u2014 deep links, previews \u2014 keep working. App from --app or the content dir. Setting it needs no republish.", required: "[public|unlisted] [--app <a>] [--content <dir>] (--control-token)" },
|
|
266402
|
-
{ name: "dist", summary: "build an INSTALLABLE QA binary (signed IPA / APK) on the Wix Job Service Mac pool and return an install link \u2014 the serve plane brokers the job, the pool builds it. WAITS for the build by default (~4 min) and prints the install link; `--no-wait` returns a jobId immediately instead. Omitting `--release` builds whatever is LIVE for the app. A named draft is refused unless `--allow-draft` makes that exceptional build explicit. `status <jobId>` / `watch <jobId>` / `list --app <a>` / `cancel <jobId>` inspect and stop builds (`watch` reports up front whether the job mints its own signing identity or borrows one, so a doomed iOS build is cancellable in seconds rather than after the archive). Off-repo, name a target \u2014 `--target wix` for a self-serve Wix login or `--target bo` for the internal employee path (the in-repo default is a local dev plane that isn't reachable off-repo); self-serve callers may build their OWN apps under a tighter budget (2 in flight / 5 per 24h), while a manage-only owner-role credential is refused. `--shell` picks the native host to sign into (branded-lite | owner-lite | brandy | base44 | game | player | demo-app) and defaults to the content package's himalaya.content.json `shell` (templates carry the one they were written for), else branded-lite. The per-app shells ADD the release's declared capabilities to the binary, while Himi Player and demo-app refuse a release declaring one they lack; `--plan` previews it without building; `brandy`
|
|
266438
|
+
{ name: "dist", summary: "build an INSTALLABLE QA binary (signed IPA / APK) on the Wix Job Service Mac pool and return an install link \u2014 the serve plane brokers the job, the pool builds it. WAITS for the build by default (~4 min) and prints the install link; `--no-wait` returns a jobId immediately instead. Omitting `--release` builds whatever is LIVE for the app. A named draft is refused unless `--allow-draft` makes that exceptional build explicit. `status <jobId>` / `watch <jobId>` / `list --app <a>` / `cancel <jobId>` inspect and stop builds (`watch` reports up front whether the job mints its own signing identity or borrows one, so a doomed iOS build is cancellable in seconds rather than after the archive). Off-repo, name a target \u2014 `--target wix` for a self-serve Wix login or `--target bo` for the internal employee path (the in-repo default is a local dev plane that isn't reachable off-repo); self-serve callers may build their OWN apps under a tighter budget (2 in flight / 5 per 24h), while a manage-only owner-role credential is refused. `--shell` picks the native host to sign into (branded-lite | owner-lite | brandy | base44 | game | player | demo-app) and defaults to the content package's himalaya.content.json `shell` (templates carry the one they were written for), else branded-lite. The per-app shells ADD the release's declared capabilities to the binary, while Himi Player and demo-app refuse a release declaring one they lack; `--plan` previews it without building; `brandy` builds a site-shell app (the customer's own website as native-framed tabs) on the branded-lite binary under Brandy's bundle ids, so an installed Brandy app updates in place \u2014 it needs a release that serves its own site block (`release_site_missing` otherwise); `game` is the Godot game shell, the only one that serves `godot`. `--signing` defaults to `wix-managed` \u2014 the Wix Apple account mints a per-app signing identity for the build, so the caller provisions no Apple credentials of their own; `--signing byo --site <id>` reuses an existing customer ad-hoc profile and certificate for iOS; requires an owned site and a completed personal signing binding. `--android-signing` is the Android counterpart and a SEPARATE axis (a keystore, not an Apple account): `qa-keystore` (default \u2014 the repo's committed QA key, identical on every pool machine, so a build installs over the previous one), `wix-keystore` (the Wix key the pool machine carries; the build FAILS naming the paths searched if it carries none, rather than quietly signing with something else), or `debug` (the old per-machine key \u2014 QA must uninstall any previous build first). `--aab` builds an Android App Bundle (.aab) for the owner to upload to Google Play AND an APK from the same build \u2014 a download link for the .aab, an install link and QR for the APK; Android only; the bundle is signed with the Wix production key (`wix-keystore`, the upload key Branded apps use) \u2014 any other `--android-signing` is refused \u2014 and the APK with the committed QA key; a self-serve caller gets one only as the store build of its own Containers app (it must own the app's site, and `--aab` sends your Wix login); any other self-serve `--aab` gets 403 android_format_not_allowed. `--app-name <name> --app-icon-url <url>` (together; the icon a `https://static.wixstatic.com/media/<file>` URL) give the binary a name and icon in place of the release's, and a Containers app's store build (`--aab`, or its TestFlight build) needs both. NOT the normal way to ship: screens, Tier-5 bundles, tokens and app-config all go over the air with `himi push` in seconds \u2014 a binary trip is only needed for a NATIVE delta (a new SDUI component, a new declared capability/entitlement, a new bundle id, or a minBinaryVersion floor bump). Refuses to build an app whose launcher icon is missing, a placeholder, or one a store would reject \u2014 the one thing a binary carries that no later OTA push can fix; `--force` builds anyway. Also refuses a release whose member login (WixConsumerAuthProvider) names no siteId, or not in lower case, when Wix says its site requires a member CAPTCHA \u2014 such a binary ships without the CAPTCHA key and every member sign-in fails; whatever it cannot read (the release, the site's setting) only warns and builds; `--skip-captcha-check` builds anyway", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|base44|game|player|demo-app] [--signing wix-managed|byo] [--site <id>] [--android-signing qa-keystore|wix-keystore|debug] [--aab] [--min-version-code <n>] [--app-name <name> --app-icon-url <url>] [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--skip-captcha-check] [--plan] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
|
|
266403
266439
|
{ name: "testflight", summary: 'build, sign and upload an app to TestFlight (internal testers \u2014 no Beta App Review), then WAIT until App Store Connect finishes processing it. Sugar for `store upload --track testflight`. Prompts first: a build number is consumed permanently on a real Apple account and cannot be reused \u2014 `--yes` for CI, `--dry-run` to see the plan without touching anything. The wait is the real check, not a nicety: fastlane prints "Successfully uploaded" for a binary App Store Connect then rejects in processing, and a rejected binary leaves NO build record at all (the reason is emailed). Public App Store review is deliberately NOT automatable here \u2014 `--track appstore` is refused; use /submit-ios-app when you mean to go public', required: "<app> [--track testflight|internal] [--profile <name>] [--yes] [--dry-run] [--skip-build] [--no-wait] [--json]" },
|
|
266404
266440
|
{ name: "store", summary: "`app set --app <id> --site <msid> --android-package himi.<name>` gives an app YOUR account owns (one made with `himi init`) the Google Play store app of a Wix site your account also owns, so `himi dist --aab` makes its Wix-signed (WixOne) Play bundle: the app is LINKED to the site, never converted into a site app, so your `himi login` token keeps working for push and the rest. One site per app and one app per site; the package name is permanent once a build locks it. `app show --app <id> --site <msid>` runs the store build's checks without building (saved package name, the site's Premium plan). Both send your `himi login` control token plus the account `wix token`, which the plane uses to verify your account owns the app and the site (`himi docs qa-builds`). `apple-keys setup|status` onboards the owner\u2019s ASC and In-App Purchase keys independently of push and signing profiles. `connect` and `submission status|plan|apply|rejection|reply` submit an app to the App Store from YOUR computer under YOUR Apple account, off-repo (Node 24+): `connect` opens a sign-in page on 127.0.0.1 where you type your Apple ID password and 2FA code (no flag takes them) and creates an Admin API key saved in this computer's keychain, shared with Wix for App Store builds when the app's store/app-store.json names its site; `submission plan` plans the next ordered batch and `apply` applies it only after you type the plan hash's first 8 characters (or click Approve on a local page). The same steps are the store_* tools of `himi mcp` (`himi docs store-submission`). `--platform android` takes `connect` and `submission status|plan|apply|rejection|reply` to Google Play instead: `connect` signs you in to Google in your browser (the OAuth client file from GPLAY_OAUTH_CLIENT_FILE or gplay-node's state dir, else a gcloud sign-in), the facts come from the app's store/google-play.json (category, contactEmail, privacyPolicyUrl, targetAudience, contentRatingCategory, packageName), a site-linked himi.<name> app is Wix-signed (`himi dist --aab`) and any other owner-signed (`--android-signing owner --google-services <file>`, then `google keygen <package>` makes the upload key once and `google resign <in.aab> --keystore <file.p12> --storepass-file <file>` signs the bundle, both on this computer), `apply` takes one `--job`, and `submission approve-reply --platform android --issue <id> --kind appeal|resubmit --text <reply>` records your typed yes on one exact policy reply (no --yes), the only way `reply` or store_reply can plan it. `handoff` uploads the app's asc-node records (allowlisted ids, statuses and outcomes; never keys, cookies or passwords) so Wix RelOps can take the submission over, `--out`/`--dry-run` keep it local; `relops request` records your consent that RelOps may act for the app (`--scope read` by default, or `read,submit`; `--platform android` adds the Google Play scopes `android-build` and `play-console`; you type the app id, or pass --yes). Both are site-owner only. `relops request --platform android --seat-email <name@wix.com>` also brings that RelOps person into YOUR Google Play account after one typed yes at a terminal (no --yes): it saves the `himi.<name>` package, signs you in to Google if needed and invites the seat with the RelOps app permissions for 90 days (plus create-apps while the app has no Play app id); `relops end` removes the seat; `google create-app --name <n>` creates the app in your own Play Console after you read Google's Create app declarations and type yes. The App Store Connect group behind `testflight`. `preflight <app>` checks readiness offline (icon, entitlements, encryption flag, version, store.config ids, listing + review record); `upload <app>` is what `testflight` runs; `status <app>` reads live build + processing state. `--profile` selects WHICH App Store Connect account: an app built for a Wix customer ships under the CUSTOMER's Apple team (Apple guideline 4.2.6 forbids an app-generation service submitting on a client's behalf), declared per-app as ios.credentialProfile in store.config.yaml and resolved from ~/.himalaya/store-credentials/<name>.json \u2014 the .p8 itself never enters the repo. `iap draft|plan|apply|status|connect|screenshots|check|mappings` registers an app owner's digital products as in-app purchases (non-consumables, or consumable price tiers): draft reads the Wix catalog and writes the manifest, plan and status only read, apply is the one App Store mutation boundary, connect readies the Wix site to sell them (purchases app, In-App Purchase key, appleIAP provider, product mappings; --preview-tag routes only its Serve calls to a deploy preview), legacy screenshots --profile renders each product's purchase screen from the app (--content) as a bound iPhone shows it to a signed-in member and names the 1290\xD72796 PNG as the item's App Review screenshot, and none of them builds, signs or needs a checkout (`himi docs iap-products`) IAP provisioning defaults to Catalog; managed apply generates screenshots on the server with no local .p8 or profile fallback; --managed is optional and --profile selects legacy mode; --catalog-route or HIMI_IAP_CATALOG_ROUTE has no default.", required: "app set --app <id> --site <msid> --android-package himi.<name> | app show --app <id> --site <msid> | connect [--dir <app>] [--app <id> --site <msid>] [--no-key] [--profile <name>] | submission status|plan|rejection [--dir <app>] [--apple-id <id>] [--profile <name>] | submission apply (--batch <id> | --job <id>) --plan-hash <hash> | submission reply --text <reply> [--attach <file>]\u2026 [--thread <id>] [--dir <app>] | connect --platform android | submission status|plan|rejection --platform android [--dir <app>] [--issue <id>] | submission apply --platform android --job <id> --plan-hash <hash> | submission reply|approve-reply --platform android --issue <id> --kind appeal|resubmit --text <reply> [--dir <app>] | handoff [--dir <app>] [--app <id> --site <msid>] [--apple-app-id <id>] [--out <file> | --dry-run] | relops request [--dir <app>] [--app <id> --site <msid>] [--platform ios|android] [--scope read|read,submit] [--yes] | relops request --platform android --seat-email <name@wix.com> [--app <id> --site <msid>] [--developer <id>] [--app-id <n>] [--android-package himi.<name>] | relops end --platform android --seat-email <name@wix.com> [--app <id> --site <msid>] [--developer <id>] | google create-app --name <app name> [--app <id> --site <msid>] [--developer <id>] [--android-package himi.<name>] | google keygen <package> [--out <file.p12>] [--alias <name>] [--name <certificate name>] | google resign <in.aab> --keystore <file.p12> (--storepass-file <file> | --storepass-env <NAME>) [--alias <name>] [--out <file.aab>] | apple-keys setup|status --app <slug> --site <metaSiteId> --bundle-id <id> [--asc-key-file <p8> --asc-key-id <id> --asc-issuer-id <issuer>] [--iap-key <p8> --iap-key-id <id> --iap-issuer-id <issuer>] [--yes|--dry-run] [--json] | preflight <app> [--profile <n>] | upload <app> [--track <t>] [--profile <n>] [--yes] [--dry-run] | status <app> [--profile <n>] | iap draft --site <msid> " + IAP_CREDENTIAL_OPTIONS + " --apple-app <id> --bundle <id> --base-territory <t> --out <f> [--territories <a,b>] [--locale <l>] [--mode per-item|tiers] [--merge <f>] [--report <f>] [--json] | iap plan --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--json] | iap apply --plan <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--yes] [--limit <n>] [--no-submit] [--json] | iap status --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " [--out <f>] [--json] | iap connect --manifest <f> [--profile <n>] [--catalog-route <prefix>] [--iap-key <AuthKey.p8> --iap-key-id <id>] [--content <dir>] [--preview-tag dp-<tag>] [--dry-run] [--yes] [--out <f>] [--json] | iap screenshots --manifest <f> --content <dir> --profile <n> [--out-dir <d>] [--only <id,\u2026>] [--force] [--dry-run] [--json] | iap check --manifest <f> --catalog-route <prefix> [--purchases-app <id>] [--content <dir>] [--plist <file>] [--visitor-client <id>] [--json] | iap mappings --site <msid> --purchases-app <id> --catalog-route <prefix> [--product <id> --active true|false --yes] [--json]" },
|
|
266405
266441
|
{ name: "guide", summary: "print the Himalaya overview + headless dev loop + available topics (offline)", required: "[--json]" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1723.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": [
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"artifactId": "himalaya-cli"
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
"falconPackageHash": "
|
|
84
|
+
"falconPackageHash": "49b19924fc8375a1f3d5afcc15d5b54963a3ff1666156b4889342b56"
|
|
85
85
|
}
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -30,7 +30,7 @@ The placeholder origin above is not a real site. Replace it by deriving the bloc
|
|
|
30
30
|
own menu, from inside this folder:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
himi site analyze --url https://your-account.wixsite.com/your-site --
|
|
33
|
+
himi site analyze --url https://your-account.wixsite.com/your-site --apply
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
That writes the derived `site` block into this `provisioning.json` and your site's colours into
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Nothing here names a page. The pages come from the `site` block of ./provisioning.json, so you
|
|
5
5
|
// change the app by changing that block — by hand, or with
|
|
6
|
-
// himi site analyze --url https://<your-site>
|
|
6
|
+
// himi site analyze --url https://<your-site>
|
|
7
7
|
// which derives it from your site's own menu. Inspect the live values any time with
|
|
8
8
|
// `himi context`; see `himi docs app-config`.
|
|
9
9
|
import {
|
|
@@ -31,6 +31,54 @@ if (nav.tabs[0]?.screenId !== "site_home") {
|
|
|
31
31
|
throw new Error('provisioning.json: the "home" page must be the first tab — list it first in site.pages');
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/** A Base44 site's app (`base44` in provisioning.json, or `bindings.base44`): members sign in on the
|
|
35
|
+
* native Account screen, and the app carries the session into the website's pages. Absent for a
|
|
36
|
+
* Wix site, which stays visitor-only. */
|
|
37
|
+
export interface Base44Binding { appId: string; serverUrl?: string; deleteAccountFunction?: string }
|
|
38
|
+
/** `https://host[:port]` with no path, query or fragment (a trailing `/` is dropped): the form the
|
|
39
|
+
* app's `base44.serverUrl` takes. */
|
|
40
|
+
function bareHttpsOrigin(raw: string): string {
|
|
41
|
+
let url: URL;
|
|
42
|
+
try { url = new URL(raw); } catch { throw new Error(`provisioning.json: base44.serverUrl must be an https origin, got: ${raw}`); }
|
|
43
|
+
if (url.protocol !== "https:" || url.username || url.password || url.search || url.hash || !/^\/*$/.test(url.pathname)) {
|
|
44
|
+
throw new Error(`provisioning.json: base44.serverUrl must be a bare https origin (no path), got: ${raw}`);
|
|
45
|
+
}
|
|
46
|
+
return url.origin;
|
|
47
|
+
}
|
|
48
|
+
const rawBase44 = ((provisioning as { base44?: unknown }).base44
|
|
49
|
+
?? (provisioning as { bindings?: { base44?: unknown } }).bindings?.base44) as Partial<Base44Binding> | undefined;
|
|
50
|
+
export const base44: Base44Binding | undefined = rawBase44 == null ? undefined : (() => {
|
|
51
|
+
if (typeof rawBase44.appId !== "string" || !/^[A-Za-z0-9]{8,64}$/.test(rawBase44.appId.trim())) {
|
|
52
|
+
throw new Error("provisioning.json: base44.appId must be your Base44 app id (8-64 letters and digits)");
|
|
53
|
+
}
|
|
54
|
+
if (site.kind !== "base44") throw new Error('provisioning.json: a base44 binding needs a site of kind "base44"');
|
|
55
|
+
const serverUrl = typeof rawBase44.serverUrl === "string" && rawBase44.serverUrl.trim() ? bareHttpsOrigin(rawBase44.serverUrl.trim()) : undefined;
|
|
56
|
+
return {
|
|
57
|
+
appId: rawBase44.appId.trim(),
|
|
58
|
+
...(serverUrl ? { serverUrl } : {}),
|
|
59
|
+
...(typeof rawBase44.deleteAccountFunction === "string" && rawBase44.deleteAccountFunction.trim()
|
|
60
|
+
? { deleteAccountFunction: rawBase44.deleteAccountFunction.trim() } : {}),
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
/** What the app's `base44` setting carries: the app id, and its server when the binding names one. */
|
|
64
|
+
const base44Config = base44 === undefined ? undefined
|
|
65
|
+
: base44.serverUrl ? { appId: base44.appId, serverUrl: base44.serverUrl } : { appId: base44.appId };
|
|
66
|
+
/** The native Base44 Account screen's id (shared by every site shell; never `himi_account`). */
|
|
67
|
+
export const BASE44_ACCOUNT_SCREEN_ID = "himi_base44_account";
|
|
68
|
+
const notificationsRow = { id: "drawer_notifications", screenId: "himi_notification_settings", label: "Notifications", icon: "bell" as const };
|
|
69
|
+
const nativeRows = base44
|
|
70
|
+
? [{ id: "drawer_account", screenId: BASE44_ACCOUNT_SCREEN_ID, label: "Account", icon: "person" as const }, notificationsRow]
|
|
71
|
+
: [notificationsRow];
|
|
72
|
+
// The native rows' ids are reserved — the same rule as the Brandy shell's contract parser: a site page
|
|
73
|
+
// that is not `overflow` gets a row, and one called `notifications` (or `account`, beside the Account
|
|
74
|
+
// row) would share its row id with the app's own, while navigation finds a destination by row id.
|
|
75
|
+
const reservedPageIds = base44 ? ["notifications", "account"] : ["notifications"];
|
|
76
|
+
for (const page of site.pages) {
|
|
77
|
+
if ((page.placement ?? "tab") !== "overflow" && reservedPageIds.includes(page.id)) {
|
|
78
|
+
throw new Error(`provisioning.json: site page id "${page.id}" is reserved for the app's native ${page.id} screen — rename the page or make it an overflow page`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
34
82
|
export default defineApp({
|
|
35
83
|
id: "__HIMI_APP_DOTID__",
|
|
36
84
|
name: "__HIMI_APP_NAME__",
|
|
@@ -50,7 +98,10 @@ export default defineApp({
|
|
|
50
98
|
sync: "http://localhost:8190/v1/sync",
|
|
51
99
|
},
|
|
52
100
|
// `push` lets the app ask for notification permission and show the Notifications screen.
|
|
53
|
-
|
|
101
|
+
// `base44` (a Base44 site only) lets the Account screen sign members in to your Base44 app.
|
|
102
|
+
capabilities: ["push", ...(base44 ? ["base44"] : [])],
|
|
103
|
+
// The Base44 app the native sign-in and the website pages' session talk to (none for a Wix site).
|
|
104
|
+
base44: base44Config,
|
|
54
105
|
// Ask for notification permission on the first launch. Tapped notifications that carry one of
|
|
55
106
|
// your site's URLs open the page's tab (`navigation.site` below).
|
|
56
107
|
push: {
|
|
@@ -79,14 +130,15 @@ export default defineApp({
|
|
|
79
130
|
linkableScreens: [
|
|
80
131
|
...siteLinkableScreens(site),
|
|
81
132
|
{ screenId: "himi_notification_settings", isPublic: true, paramKeys: [], parentScreenId: "" },
|
|
133
|
+
...(base44 ? [{ screenId: BASE44_ACCOUNT_SCREEN_ID, isPublic: true, paramKeys: [], parentScreenId: "" }] : []),
|
|
82
134
|
],
|
|
83
135
|
// A notification or app link carrying one of your site's URLs opens that page's tab.
|
|
84
136
|
site: siteNavConfig(site),
|
|
85
137
|
tabBar: { items: nav.tabs },
|
|
86
|
-
// Your site's drawer pages, then the native Notifications
|
|
87
|
-
drawer: { items: [...nav.drawer,
|
|
138
|
+
// Your site's drawer pages, then the native screens: Account (a Base44 site) and Notifications.
|
|
139
|
+
drawer: { items: [...nav.drawer, ...nativeRows] },
|
|
88
140
|
// The rail (tablet, or `layout: "sidebar"`) replaces the drawer, so it lists the same rows.
|
|
89
|
-
sidebar: { items: [...siteSidebar(site),
|
|
141
|
+
sidebar: { items: [...siteSidebar(site), ...nativeRows] },
|
|
90
142
|
},
|
|
91
143
|
entities: {},
|
|
92
144
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// `site` block of ../provisioning.json — so this file holds no screen of its own. Change the
|
|
3
3
|
// pages by changing that block, never this file.
|
|
4
4
|
import { siteScreens } from "@himalaya/core";
|
|
5
|
-
import config, { site } from "../config.js";
|
|
5
|
+
import config, { base44, BASE44_ACCOUNT_SCREEN_ID, site } from "../config.js";
|
|
6
6
|
|
|
7
7
|
const SCREENS = siteScreens(site);
|
|
8
8
|
|
|
@@ -339,6 +339,516 @@ const NOTIFICATIONS_SEED = {
|
|
|
339
339
|
"bundleVersion": "0.0.1"
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
+
// The native Account screen of a BASE44 site (a `base44` binding in ../provisioning.json): sign in,
|
|
343
|
+
// register, an emailed code, sign out — and Delete account when the binding names the backend
|
|
344
|
+
// function that deletes it (`base44.deleteAccountFunction`; App Store 5.1.1(v)). Signing in here
|
|
345
|
+
// signs the website's pages in too. It runs on the himi-brandy-base44-account worker in tier5-src/.
|
|
346
|
+
const BASE44_ACCOUNT = {
|
|
347
|
+
"screenId": "himi_base44_account",
|
|
348
|
+
"renderer": "sdui_intent",
|
|
349
|
+
"title": "",
|
|
350
|
+
"schemaVersion": 1,
|
|
351
|
+
"cacheControl": {
|
|
352
|
+
"maxAge": 0,
|
|
353
|
+
"staleWhileRevalidate": 0
|
|
354
|
+
},
|
|
355
|
+
"payload": {
|
|
356
|
+
"id": "himi_base44_account.root",
|
|
357
|
+
"body": {
|
|
358
|
+
"package": "himalaya",
|
|
359
|
+
"type": "VStack",
|
|
360
|
+
"props": {
|
|
361
|
+
"spacing": 16,
|
|
362
|
+
"alignment": "leading",
|
|
363
|
+
"children": [
|
|
364
|
+
{
|
|
365
|
+
"id": "himi_base44_account.title",
|
|
366
|
+
"body": {
|
|
367
|
+
"package": "himalaya",
|
|
368
|
+
"type": "Text",
|
|
369
|
+
"props": {
|
|
370
|
+
"text": "Account",
|
|
371
|
+
"style": "title1"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"id": "himi_base44_account.message",
|
|
377
|
+
"body": {
|
|
378
|
+
"package": "himalaya",
|
|
379
|
+
"type": "Text",
|
|
380
|
+
"props": {
|
|
381
|
+
"text": "$service:himiBase44Account.message",
|
|
382
|
+
"style": "footnote",
|
|
383
|
+
"color": "textPrimary",
|
|
384
|
+
"collapseWhenEmpty": true
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"id": "himi_base44_account.error",
|
|
390
|
+
"body": {
|
|
391
|
+
"package": "himalaya",
|
|
392
|
+
"type": "Text",
|
|
393
|
+
"props": {
|
|
394
|
+
"text": "$service:himiBase44Account.error",
|
|
395
|
+
"style": "footnote",
|
|
396
|
+
"color": "danger",
|
|
397
|
+
"maxLines": 4,
|
|
398
|
+
"collapseWhenEmpty": true
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"id": "himi_base44_account.login",
|
|
404
|
+
"body": {
|
|
405
|
+
"package": "himalaya",
|
|
406
|
+
"type": "VStack",
|
|
407
|
+
"props": {
|
|
408
|
+
"spacing": 8,
|
|
409
|
+
"alignment": "leading",
|
|
410
|
+
"children": [
|
|
411
|
+
{
|
|
412
|
+
"id": "",
|
|
413
|
+
"body": {
|
|
414
|
+
"package": "himalaya",
|
|
415
|
+
"type": "Text",
|
|
416
|
+
"props": {
|
|
417
|
+
"text": "Sign in",
|
|
418
|
+
"style": "title2"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"id": "",
|
|
424
|
+
"body": {
|
|
425
|
+
"package": "himalaya",
|
|
426
|
+
"type": "Text",
|
|
427
|
+
"props": {
|
|
428
|
+
"text": "Sign in with your account on this app. The website tabs sign in with you.",
|
|
429
|
+
"style": "body",
|
|
430
|
+
"color": "textSecondary"
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"id": "himi_base44_account.email",
|
|
436
|
+
"body": {
|
|
437
|
+
"package": "himalaya",
|
|
438
|
+
"type": "TextField",
|
|
439
|
+
"props": {
|
|
440
|
+
"placeholder": "Email",
|
|
441
|
+
"keyboard": "email",
|
|
442
|
+
"autoCapitalization": "none",
|
|
443
|
+
"onChange": {
|
|
444
|
+
"actionId": "tier5.himiBase44Account.setEmail"
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"id": "himi_base44_account.password",
|
|
451
|
+
"body": {
|
|
452
|
+
"package": "himalaya",
|
|
453
|
+
"type": "TextField",
|
|
454
|
+
"props": {
|
|
455
|
+
"placeholder": "Password",
|
|
456
|
+
"secure": true,
|
|
457
|
+
"autoCapitalization": "none",
|
|
458
|
+
"onChange": {
|
|
459
|
+
"actionId": "tier5.himiBase44Account.setPassword"
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
"modifiers": {
|
|
464
|
+
"hiddenPath": "$service:himiBase44Account.hidePasswordField"
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"id": "himi_base44_account.code",
|
|
469
|
+
"body": {
|
|
470
|
+
"package": "himalaya",
|
|
471
|
+
"type": "TextField",
|
|
472
|
+
"props": {
|
|
473
|
+
"placeholder": "Code from your email",
|
|
474
|
+
"keyboard": "number",
|
|
475
|
+
"autoCapitalization": "none",
|
|
476
|
+
"onChange": {
|
|
477
|
+
"actionId": "tier5.himiBase44Account.setCode"
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"modifiers": {
|
|
482
|
+
"hiddenPath": "$service:himiBase44Account.hideCodeField"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"id": "himi_base44_account.signin",
|
|
487
|
+
"body": {
|
|
488
|
+
"package": "himalaya",
|
|
489
|
+
"type": "Button",
|
|
490
|
+
"props": {
|
|
491
|
+
"title": "Sign in",
|
|
492
|
+
"style": "primary",
|
|
493
|
+
"fullWidth": true,
|
|
494
|
+
"action": {
|
|
495
|
+
"actionId": "tier5.himiBase44Account.signIn"
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"modifiers": {
|
|
500
|
+
"hiddenPath": "$service:himiBase44Account.hidePasswordField"
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"id": "himi_base44_account.register",
|
|
505
|
+
"body": {
|
|
506
|
+
"package": "himalaya",
|
|
507
|
+
"type": "Button",
|
|
508
|
+
"props": {
|
|
509
|
+
"title": "Create account",
|
|
510
|
+
"style": "secondary",
|
|
511
|
+
"fullWidth": true,
|
|
512
|
+
"action": {
|
|
513
|
+
"actionId": "tier5.himiBase44Account.register"
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"modifiers": {
|
|
518
|
+
"hiddenPath": "$service:himiBase44Account.hidePasswordField"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"id": "himi_base44_account.send_code",
|
|
523
|
+
"body": {
|
|
524
|
+
"package": "himalaya",
|
|
525
|
+
"type": "Button",
|
|
526
|
+
"props": {
|
|
527
|
+
"title": "Email me a code instead",
|
|
528
|
+
"style": "secondary",
|
|
529
|
+
"fullWidth": true,
|
|
530
|
+
"action": {
|
|
531
|
+
"actionId": "tier5.himiBase44Account.sendCode"
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
"modifiers": {
|
|
536
|
+
"hiddenPath": "$service:himiBase44Account.hidePasswordField"
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"id": "himi_base44_account.verify_code",
|
|
541
|
+
"body": {
|
|
542
|
+
"package": "himalaya",
|
|
543
|
+
"type": "Button",
|
|
544
|
+
"props": {
|
|
545
|
+
"title": "Verify code",
|
|
546
|
+
"style": "primary",
|
|
547
|
+
"fullWidth": true,
|
|
548
|
+
"action": {
|
|
549
|
+
"actionId": "tier5.himiBase44Account.verifyCode"
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
"modifiers": {
|
|
554
|
+
"hiddenPath": "$service:himiBase44Account.hideCodeField"
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"id": "himi_base44_account.use_password",
|
|
559
|
+
"body": {
|
|
560
|
+
"package": "himalaya",
|
|
561
|
+
"type": "Button",
|
|
562
|
+
"props": {
|
|
563
|
+
"title": "Use a password",
|
|
564
|
+
"style": "secondary",
|
|
565
|
+
"fullWidth": true,
|
|
566
|
+
"action": {
|
|
567
|
+
"actionId": "tier5.himiBase44Account.usePassword"
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
"modifiers": {
|
|
572
|
+
"hiddenPath": "$service:himiBase44Account.hideCodeField"
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"id": "himi_base44_account.reset_password",
|
|
577
|
+
"body": {
|
|
578
|
+
"package": "himalaya",
|
|
579
|
+
"type": "Button",
|
|
580
|
+
"props": {
|
|
581
|
+
"title": "Forgot password?",
|
|
582
|
+
"style": "secondary",
|
|
583
|
+
"fullWidth": true,
|
|
584
|
+
"action": {
|
|
585
|
+
"actionId": "tier5.himiBase44Account.resetPassword"
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
"modifiers": {
|
|
590
|
+
"hiddenPath": "$service:himiBase44Account.hidePasswordField"
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
"modifiers": {
|
|
597
|
+
"background": {
|
|
598
|
+
"token": "surfaceElevated"
|
|
599
|
+
},
|
|
600
|
+
"border": {
|
|
601
|
+
"width": 1,
|
|
602
|
+
"color": {
|
|
603
|
+
"token": "border"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
"cornerRadius": 16,
|
|
607
|
+
"padding": {
|
|
608
|
+
"leading": 16,
|
|
609
|
+
"trailing": 16,
|
|
610
|
+
"top": 16,
|
|
611
|
+
"bottom": 16
|
|
612
|
+
},
|
|
613
|
+
"hiddenPath": "$service:himiBase44Account.hideSignedOut"
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"id": "",
|
|
618
|
+
"body": {
|
|
619
|
+
"package": "himalaya",
|
|
620
|
+
"type": "VStack",
|
|
621
|
+
"props": {
|
|
622
|
+
"spacing": 12,
|
|
623
|
+
"children": [
|
|
624
|
+
{
|
|
625
|
+
"id": "himi_base44_account.member",
|
|
626
|
+
"body": {
|
|
627
|
+
"package": "himalaya",
|
|
628
|
+
"type": "VStack",
|
|
629
|
+
"props": {
|
|
630
|
+
"spacing": 8,
|
|
631
|
+
"alignment": "leading",
|
|
632
|
+
"children": [
|
|
633
|
+
{
|
|
634
|
+
"id": "",
|
|
635
|
+
"body": {
|
|
636
|
+
"package": "himalaya",
|
|
637
|
+
"type": "Text",
|
|
638
|
+
"props": {
|
|
639
|
+
"text": "Signed in",
|
|
640
|
+
"style": "title2"
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"id": "himi_base44_account.user",
|
|
646
|
+
"body": {
|
|
647
|
+
"package": "himalaya",
|
|
648
|
+
"type": "Text",
|
|
649
|
+
"props": {
|
|
650
|
+
"text": "$service:himiBase44Account.user",
|
|
651
|
+
"style": "body",
|
|
652
|
+
"color": "textSecondary"
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
]
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
"modifiers": {
|
|
660
|
+
"background": {
|
|
661
|
+
"token": "surfaceElevated"
|
|
662
|
+
},
|
|
663
|
+
"border": {
|
|
664
|
+
"width": 1,
|
|
665
|
+
"color": {
|
|
666
|
+
"token": "border"
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
"cornerRadius": 16,
|
|
670
|
+
"padding": {
|
|
671
|
+
"leading": 16,
|
|
672
|
+
"trailing": 16,
|
|
673
|
+
"top": 16,
|
|
674
|
+
"bottom": 16
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"id": "himi_base44_account.signout",
|
|
680
|
+
"body": {
|
|
681
|
+
"package": "himalaya",
|
|
682
|
+
"type": "Button",
|
|
683
|
+
"props": {
|
|
684
|
+
"title": "Sign out",
|
|
685
|
+
"style": "secondary",
|
|
686
|
+
"fullWidth": true,
|
|
687
|
+
"action": {
|
|
688
|
+
"actionId": "tier5.himiBase44Account.signOut"
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"id": "himi_base44_account.delete_account",
|
|
695
|
+
"body": {
|
|
696
|
+
"package": "himalaya",
|
|
697
|
+
"type": "Button",
|
|
698
|
+
"props": {
|
|
699
|
+
"title": "Delete account",
|
|
700
|
+
"style": "destructive",
|
|
701
|
+
"fullWidth": true,
|
|
702
|
+
"action": {
|
|
703
|
+
"actionId": "tier5.himiBase44Account.askDelete"
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
"modifiers": {
|
|
708
|
+
"hiddenPath": "$service:himiBase44Account.hideDelete"
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
"id": "himi_base44_account.delete_confirm",
|
|
713
|
+
"body": {
|
|
714
|
+
"package": "himalaya",
|
|
715
|
+
"type": "VStack",
|
|
716
|
+
"props": {
|
|
717
|
+
"spacing": 8,
|
|
718
|
+
"alignment": "leading",
|
|
719
|
+
"children": [
|
|
720
|
+
{
|
|
721
|
+
"id": "",
|
|
722
|
+
"body": {
|
|
723
|
+
"package": "himalaya",
|
|
724
|
+
"type": "Text",
|
|
725
|
+
"props": {
|
|
726
|
+
"text": "Delete your account?",
|
|
727
|
+
"style": "title2"
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"id": "",
|
|
733
|
+
"body": {
|
|
734
|
+
"package": "himalaya",
|
|
735
|
+
"type": "Text",
|
|
736
|
+
"props": {
|
|
737
|
+
"text": "This permanently deletes your account on this app. It cannot be undone.",
|
|
738
|
+
"style": "body",
|
|
739
|
+
"color": "textSecondary"
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"id": "himi_base44_account.confirm_delete",
|
|
745
|
+
"body": {
|
|
746
|
+
"package": "himalaya",
|
|
747
|
+
"type": "Button",
|
|
748
|
+
"props": {
|
|
749
|
+
"title": "Delete permanently",
|
|
750
|
+
"style": "destructive",
|
|
751
|
+
"fullWidth": true,
|
|
752
|
+
"action": {
|
|
753
|
+
"actionId": "tier5.himiBase44Account.confirmDelete"
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
"id": "himi_base44_account.cancel_delete",
|
|
760
|
+
"body": {
|
|
761
|
+
"package": "himalaya",
|
|
762
|
+
"type": "Button",
|
|
763
|
+
"props": {
|
|
764
|
+
"title": "Keep my account",
|
|
765
|
+
"style": "secondary",
|
|
766
|
+
"fullWidth": true,
|
|
767
|
+
"action": {
|
|
768
|
+
"actionId": "tier5.himiBase44Account.cancelDelete"
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
"modifiers": {
|
|
777
|
+
"background": {
|
|
778
|
+
"token": "surfaceElevated"
|
|
779
|
+
},
|
|
780
|
+
"border": {
|
|
781
|
+
"width": 1,
|
|
782
|
+
"color": {
|
|
783
|
+
"token": "border"
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
"cornerRadius": 16,
|
|
787
|
+
"padding": {
|
|
788
|
+
"leading": 16,
|
|
789
|
+
"trailing": 16,
|
|
790
|
+
"top": 16,
|
|
791
|
+
"bottom": 16
|
|
792
|
+
},
|
|
793
|
+
"hiddenPath": "$service:himiBase44Account.hideConfirmDelete"
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
]
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
"modifiers": {
|
|
800
|
+
"hiddenPath": "$service:himiBase44Account.hideSignedIn"
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
]
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
"modifiers": {
|
|
807
|
+
"background": {
|
|
808
|
+
"token": "surfacePrimary"
|
|
809
|
+
},
|
|
810
|
+
"padding": {
|
|
811
|
+
"leading": 16,
|
|
812
|
+
"trailing": 16,
|
|
813
|
+
"top": 18,
|
|
814
|
+
"bottom": 28
|
|
815
|
+
},
|
|
816
|
+
"onAppear": {
|
|
817
|
+
"actionId": "tier5.himiBase44Account.open",
|
|
818
|
+
"params": {
|
|
819
|
+
"deleteFunction": ""
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
"logicBundle": {
|
|
825
|
+
"url": "http://localhost:8190/v1/bundles/himi-brandy-base44-account?integrity=",
|
|
826
|
+
"integrity": "",
|
|
827
|
+
"contentType": "application/javascript+ts-bundle",
|
|
828
|
+
"declaredCapabilities": [
|
|
829
|
+
"base44"
|
|
830
|
+
],
|
|
831
|
+
"minBinaryVersion": "0.2.0",
|
|
832
|
+
"bundleVersion": "0.0.1"
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
/** The Account screen for this binding: the Delete rows only when it names a delete function. */
|
|
836
|
+
function base44Account(deleteFunction: string | undefined): unknown {
|
|
837
|
+
const screen = JSON.parse(JSON.stringify(BASE44_ACCOUNT));
|
|
838
|
+
screen.payload.modifiers.onAppear.params.deleteFunction = deleteFunction ?? "";
|
|
839
|
+
if (!deleteFunction) {
|
|
840
|
+
const strip = (node: { body?: { props?: { children?: Array<{ id?: string }> } } }): void => {
|
|
841
|
+
const children = node.body?.props?.children;
|
|
842
|
+
if (!Array.isArray(children)) return;
|
|
843
|
+
node.body!.props!.children = children.filter((c) => c.id !== "himi_base44_account.delete_account" && c.id !== "himi_base44_account.delete_confirm");
|
|
844
|
+
for (const child of node.body!.props!.children!) strip(child as never);
|
|
845
|
+
};
|
|
846
|
+
strip(screen.payload);
|
|
847
|
+
}
|
|
848
|
+
return screen;
|
|
849
|
+
}
|
|
850
|
+
const ACCOUNT = base44 ? { [BASE44_ACCOUNT_SCREEN_ID]: base44Account(base44.deleteAccountFunction) } : {};
|
|
851
|
+
|
|
342
852
|
// The home screen is always the `home` page's: `site_home`. A literal on purpose — `himi init`
|
|
343
853
|
// and the agent tooling read `homeScreenId` from this file as written; config.ts refuses a map
|
|
344
854
|
// whose first tab is anything else, so the literal and the tab bar cannot disagree.
|
|
@@ -352,6 +862,7 @@ export default {
|
|
|
352
862
|
exact: {
|
|
353
863
|
...Object.fromEntries(Object.keys(SCREENS).map((id) => [id, () => JSON.parse(JSON.stringify(SCREENS[id]))])),
|
|
354
864
|
himi_notification_settings: () => JSON.parse(JSON.stringify(NOTIFICATIONS)),
|
|
865
|
+
...Object.fromEntries(Object.entries(ACCOUNT).map(([id, screen]) => [id, () => JSON.parse(JSON.stringify(screen))])),
|
|
355
866
|
},
|
|
356
867
|
templated: [],
|
|
357
868
|
},
|
|
@@ -359,5 +870,5 @@ export default {
|
|
|
359
870
|
createStore: () => ({}),
|
|
360
871
|
// Every page is seeded, so the whole tab bar and drawer work on a cold offline start (each
|
|
361
872
|
// WebView then shows its own offline state until the network returns).
|
|
362
|
-
seed: { screens: { ...SCREENS, himi_notification_settings: NOTIFICATIONS_SEED }, data: {} },
|
|
873
|
+
seed: { screens: { ...SCREENS, himi_notification_settings: NOTIFICATIONS_SEED, ...ACCOUNT }, data: {} },
|
|
363
874
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "Brandy — your website as an app",
|
|
3
|
-
"description": "A site shell: the customer's live Wix website as a native app. Every tab and drawer row is one of the site's own pages in a native-framed WebView, with a native tab bar, drawer, splash and brand colours; the site's header, footer and Wix ads are hidden. The page map lives in provisioning.json (`site`), and `himi site analyze --url <site
|
|
3
|
+
"description": "A site shell: the customer's live Wix website as a native app. Every tab and drawer row is one of the site's own pages in a native-framed WebView, with a native tab bar, drawer, splash and brand colours; the site's header, footer and Wix ads are hidden. The page map lives in provisioning.json (`site`), and `himi site analyze --url <site>` derives it from the site's own menu. It runs on the Branded Lite shell (`himi dist` builds that shell; an existing Brandy app keeps its identity with `--shell brandy`). Start here to ship an existing website as an app today and move tabs to native screens later.",
|
|
4
4
|
"tags": ["wix", "website", "site-shell", "webview", "tabs", "drawer", "no-code", "day-zero", "consumer"],
|
|
5
5
|
"category": "consumer"
|
|
6
6
|
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// himi-brandy-base44-account — the native Account screen of an app whose website is a Base44 site.
|
|
2
|
+
// Sign in (email + password, or an emailed code), register, reset a password, sign out,
|
|
3
|
+
// and — when the app provides the backend function — delete the account.
|
|
4
|
+
//
|
|
5
|
+
// Signing in here is what signs the WEBSITE tabs in: the native session bridge carries the
|
|
6
|
+
// token into every Base44 WebView (the token itself never reaches this worker — login answers
|
|
7
|
+
// `{ user }`). Signing out here signs every tab out and clears the site's storage.
|
|
8
|
+
//
|
|
9
|
+
// Account deletion (App Store 5.1.1(v)): a regular Base44 user cannot delete their own record —
|
|
10
|
+
// only the service role can — so it must run server-side. The contract names the app's backend
|
|
11
|
+
// function (`base44.deleteAccountFunction`), passed in as the onAppear `deleteFunction` param;
|
|
12
|
+
// without one the screen shows no Delete row rather than a button that cannot work.
|
|
13
|
+
|
|
14
|
+
import { defineService } from "@himalaya/state";
|
|
15
|
+
import { auth, functions, isBase44Error } from "@himalaya/base44";
|
|
16
|
+
|
|
17
|
+
interface AccountState {
|
|
18
|
+
signedIn: boolean;
|
|
19
|
+
user: string;
|
|
20
|
+
email: string;
|
|
21
|
+
password: string;
|
|
22
|
+
code: string;
|
|
23
|
+
/** "signIn" | "register" | "code" — which form the card shows. */
|
|
24
|
+
mode: string;
|
|
25
|
+
/** The app's delete-account function, "" when it has none (no Delete row). */
|
|
26
|
+
deleteFunction: string;
|
|
27
|
+
confirmingDelete: boolean;
|
|
28
|
+
busy: boolean;
|
|
29
|
+
/** Last thing that happened, painted on screen so a device drive can read it. */
|
|
30
|
+
message: string;
|
|
31
|
+
/** The last failure, painted in the error colour — "" when the last call succeeded. Kept apart
|
|
32
|
+
* from `message` so a failed sign-in never reads like progress. */
|
|
33
|
+
error: string;
|
|
34
|
+
// Derived visibility flags (hiddenWhen needs a boolean path).
|
|
35
|
+
hideSignedIn: boolean;
|
|
36
|
+
hideSignedOut: boolean;
|
|
37
|
+
hideCodeField: boolean;
|
|
38
|
+
hidePasswordField: boolean;
|
|
39
|
+
hideDelete: boolean;
|
|
40
|
+
hideConfirmDelete: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const describe = (e: unknown): string =>
|
|
44
|
+
isBase44Error(e) ? (e.message || e.code) : e instanceof Error ? e.message : String(e);
|
|
45
|
+
|
|
46
|
+
/** Recompute the hiddenWhen flags from the state that drives them. */
|
|
47
|
+
function derive(s: AccountState): AccountState {
|
|
48
|
+
return {
|
|
49
|
+
...s,
|
|
50
|
+
hideSignedIn: !s.signedIn,
|
|
51
|
+
hideSignedOut: s.signedIn,
|
|
52
|
+
hideCodeField: s.signedIn || s.mode !== "code",
|
|
53
|
+
hidePasswordField: s.signedIn || s.mode === "code",
|
|
54
|
+
hideDelete: !s.signedIn || !s.deleteFunction || s.confirmingDelete,
|
|
55
|
+
hideConfirmDelete: !s.signedIn || !s.deleteFunction || !s.confirmingDelete,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const acct = defineService<AccountState, {
|
|
60
|
+
open: (s: AccountState, p?: { deleteFunction?: string }) => AccountState;
|
|
61
|
+
setEmail: (s: AccountState, p?: { value?: string }) => AccountState;
|
|
62
|
+
setPassword: (s: AccountState, p?: { value?: string }) => AccountState;
|
|
63
|
+
setCode: (s: AccountState, p?: { value?: string }) => AccountState;
|
|
64
|
+
useCode: (s: AccountState) => AccountState;
|
|
65
|
+
usePassword: (s: AccountState) => AccountState;
|
|
66
|
+
signIn: (s: AccountState) => AccountState;
|
|
67
|
+
register: (s: AccountState) => AccountState;
|
|
68
|
+
sendCode: (s: AccountState) => AccountState;
|
|
69
|
+
verifyCode: (s: AccountState) => AccountState;
|
|
70
|
+
resetPassword: (s: AccountState) => AccountState;
|
|
71
|
+
signOut: (s: AccountState) => AccountState;
|
|
72
|
+
askDelete: (s: AccountState) => AccountState;
|
|
73
|
+
cancelDelete: (s: AccountState) => AccountState;
|
|
74
|
+
confirmDelete: (s: AccountState) => AccountState;
|
|
75
|
+
_signedIn: (s: AccountState, user?: string, message?: string) => AccountState;
|
|
76
|
+
_signedOut: (s: AccountState, message?: string) => AccountState;
|
|
77
|
+
_done: (s: AccountState, message?: string) => AccountState;
|
|
78
|
+
_failed: (s: AccountState, error?: string) => AccountState;
|
|
79
|
+
_failedRegister: (s: AccountState, message?: string) => AccountState;
|
|
80
|
+
}>("himiBase44Account", {
|
|
81
|
+
state: derive({
|
|
82
|
+
signedIn: false,
|
|
83
|
+
user: "",
|
|
84
|
+
email: "",
|
|
85
|
+
password: "",
|
|
86
|
+
code: "",
|
|
87
|
+
mode: "signIn",
|
|
88
|
+
deleteFunction: "",
|
|
89
|
+
confirmingDelete: false,
|
|
90
|
+
busy: false,
|
|
91
|
+
message: "",
|
|
92
|
+
error: "",
|
|
93
|
+
hideSignedIn: true,
|
|
94
|
+
hideSignedOut: false,
|
|
95
|
+
hideCodeField: true,
|
|
96
|
+
hidePasswordField: false,
|
|
97
|
+
hideDelete: true,
|
|
98
|
+
hideConfirmDelete: true,
|
|
99
|
+
}),
|
|
100
|
+
actions: {
|
|
101
|
+
open: (s, p) => {
|
|
102
|
+
auth.status()
|
|
103
|
+
.then((st) => (st.signedIn ? acct._signedIn(String(st.user?.email ?? ""), "") : acct._signedOut("")))
|
|
104
|
+
.catch((e) => acct._failed(describe(e)));
|
|
105
|
+
return derive({ ...s, deleteFunction: String(p?.deleteFunction ?? "") });
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
setEmail: (s, p) => ({ ...s, email: String(p?.value ?? "") }),
|
|
109
|
+
setPassword: (s, p) => ({ ...s, password: String(p?.value ?? "") }),
|
|
110
|
+
setCode: (s, p) => ({ ...s, code: String(p?.value ?? "") }),
|
|
111
|
+
useCode: (s) => derive({ ...s, mode: "code", message: "" }),
|
|
112
|
+
usePassword: (s) => derive({ ...s, mode: "signIn", message: "" }),
|
|
113
|
+
|
|
114
|
+
signIn: (s) => {
|
|
115
|
+
if (!s.email || !s.password) return { ...s, error: "", message: "Enter your email and password." };
|
|
116
|
+
auth.loginViaEmailPassword(s.email, s.password)
|
|
117
|
+
.then(({ user }) => acct._signedIn(String(user?.email ?? s.email), "Signed in."))
|
|
118
|
+
.catch((e) => acct._failed(describe(e)));
|
|
119
|
+
return { ...s, password: "", busy: true, error: "", message: "Signing in…" };
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
register: (s) => {
|
|
123
|
+
if (!s.email || !s.password) return { ...s, error: "", message: "Enter an email and a password to create an account." };
|
|
124
|
+
auth.register(s.email, s.password)
|
|
125
|
+
.then(() => acct._done("Check your email for a code to finish creating your account."))
|
|
126
|
+
// Back to the password form: the code form hides the fields a retry needs.
|
|
127
|
+
.catch((e) => acct._failedRegister(describe(e)));
|
|
128
|
+
return derive({ ...s, password: "", mode: "code", busy: true, error: "", message: "Creating your account…" });
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
sendCode: (s) => {
|
|
132
|
+
if (!s.email) return { ...s, error: "", message: "Enter your email first." };
|
|
133
|
+
auth.loginViaOtp(s.email)
|
|
134
|
+
.then(() => acct._done("We emailed you a code."))
|
|
135
|
+
.catch((e) => acct._failed(describe(e)));
|
|
136
|
+
return derive({ ...s, mode: "code", busy: true, error: "", message: "Sending a code…" });
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
verifyCode: (s) => {
|
|
140
|
+
if (!s.email || !s.code) return { ...s, error: "", message: "Enter your email and the code." };
|
|
141
|
+
auth.verifyOtp(s.email, s.code)
|
|
142
|
+
.then(({ user }) => acct._signedIn(String(user?.email ?? s.email), "Signed in."))
|
|
143
|
+
.catch((e) => acct._failed(describe(e)));
|
|
144
|
+
return { ...s, code: "", busy: true, error: "", message: "Checking the code…" };
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
resetPassword: (s) => {
|
|
148
|
+
if (!s.email) return { ...s, error: "", message: "Enter your email first." };
|
|
149
|
+
auth.resetPassword(s.email)
|
|
150
|
+
.then(() => acct._done("If that email has an account, a reset link is on its way."))
|
|
151
|
+
.catch((e) => acct._failed(describe(e)));
|
|
152
|
+
return { ...s, busy: true, error: "", message: "Sending a reset link…" };
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
signOut: (s) => {
|
|
156
|
+
auth.logout()
|
|
157
|
+
.then(() => acct._signedOut("Signed out."))
|
|
158
|
+
.catch((e) => acct._failed(describe(e)));
|
|
159
|
+
return { ...s, busy: true, error: "", message: "Signing out…" };
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
askDelete: (s) => derive({ ...s, confirmingDelete: true, message: "" }),
|
|
163
|
+
cancelDelete: (s) => derive({ ...s, confirmingDelete: false }),
|
|
164
|
+
|
|
165
|
+
confirmDelete: (s) => {
|
|
166
|
+
if (!s.deleteFunction) return s;
|
|
167
|
+
functions.invoke(s.deleteFunction)
|
|
168
|
+
.then(
|
|
169
|
+
// Deleted. The sign-out that follows can fail on its own (network) — the account is gone
|
|
170
|
+
// either way, so never report it as "could not delete" and invite a retry that fails.
|
|
171
|
+
() => auth.logout().catch(() => undefined).then(() => acct._signedOut("Your account was deleted.")),
|
|
172
|
+
(e) => acct._failed(`Could not delete the account: ${describe(e)}`),
|
|
173
|
+
);
|
|
174
|
+
return { ...s, busy: true, error: "", message: "Deleting your account…" };
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
_signedIn: (s, user, message) =>
|
|
178
|
+
derive({ ...s, error: "", signedIn: true, user: String(user ?? ""), busy: false, confirmingDelete: false, message: String(message ?? "") }),
|
|
179
|
+
_signedOut: (s, message) =>
|
|
180
|
+
derive({ ...s, error: "", signedIn: false, user: "", busy: false, confirmingDelete: false, mode: "signIn", message: String(message ?? "") }),
|
|
181
|
+
_done: (s, message) => ({ ...s, busy: false, error: "", message: String(message ?? "") }),
|
|
182
|
+
_failed: (s, error) => ({ ...s, busy: false, message: "", error: String(error ?? "") }),
|
|
183
|
+
_failedRegister: (s, error) => derive({ ...s, busy: false, mode: "signIn", message: "", error: String(error ?? "") }),
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
export default acct;
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","
|
|
40
|
+
capabilities: ["push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
// Native fallback; the T5 splash descriptor owns the editable launch appearance.
|
|
43
43
|
splash: {
|