@wix/himalaya-cli 0.1797.0 → 0.1798.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/base44/src/index.d.ts +14 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/base44.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{04eac2ea24e0edfcc5aaa757dc5d06c6bf35c3c5ce9ccbb448b305db05715492.bin → 7838236432e18e6d8b08481d145add5e31d7bfe9573403d3365e141f749e13ff.bin} +1 -1
- package/dist/browser-plane/sw.js +6 -6
- package/dist/cli.mjs +43 -43
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/sdk-reference.json +9 -2
- package/guides/web-page-sdk-reference.md +1 -1
- package/package.json +2 -2
- package/templates/brandy/dev/index.ts +109 -19
- package/templates/brandy/tier5-src/himi-brandy-base44-account/index.ts +70 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1798.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": [
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"artifactId": "himalaya-cli"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"falconPackageHash": "
|
|
85
|
+
"falconPackageHash": "ee96a4e66af18835d2727dec98b62fd9900b6cc66be874d7587556d2"
|
|
86
86
|
}
|
|
@@ -343,7 +343,7 @@ const NOTIFICATIONS_SEED = {
|
|
|
343
343
|
}
|
|
344
344
|
};
|
|
345
345
|
// The native Account screen of a BASE44 site (a `base44` binding in ../provisioning.json): sign in,
|
|
346
|
-
// register
|
|
346
|
+
// register (verified by an emailed code), the sign-in providers the app turned on, sign out — and Delete account when the binding names the backend
|
|
347
347
|
// function that deletes it (`base44.deleteAccountFunction`; App Store 5.1.1(v)). Signing in here
|
|
348
348
|
// signs the website's pages in too. It runs on the himi-brandy-base44-account worker in tier5-src/.
|
|
349
349
|
const BASE44_ACCOUNT = {
|
|
@@ -434,6 +434,111 @@ const BASE44_ACCOUNT = {
|
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
},
|
|
437
|
+
{
|
|
438
|
+
"id": "himi_base44_account.provider_google",
|
|
439
|
+
"body": {
|
|
440
|
+
"package": "himalaya",
|
|
441
|
+
"type": "Button",
|
|
442
|
+
"props": {
|
|
443
|
+
"title": "Continue with Google",
|
|
444
|
+
"style": "secondary",
|
|
445
|
+
"fullWidth": true,
|
|
446
|
+
"action": {
|
|
447
|
+
"actionId": "tier5.himiBase44Account.signInWith",
|
|
448
|
+
"params": {
|
|
449
|
+
"provider": "google"
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"modifiers": {
|
|
455
|
+
"hiddenPath": "$service:himiBase44Account.hideGoogle"
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"id": "himi_base44_account.provider_apple",
|
|
460
|
+
"body": {
|
|
461
|
+
"package": "himalaya",
|
|
462
|
+
"type": "Button",
|
|
463
|
+
"props": {
|
|
464
|
+
"title": "Continue with Apple",
|
|
465
|
+
"style": "secondary",
|
|
466
|
+
"fullWidth": true,
|
|
467
|
+
"action": {
|
|
468
|
+
"actionId": "tier5.himiBase44Account.signInWith",
|
|
469
|
+
"params": {
|
|
470
|
+
"provider": "apple"
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"modifiers": {
|
|
476
|
+
"hiddenPath": "$service:himiBase44Account.hideApple"
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"id": "himi_base44_account.provider_microsoft",
|
|
481
|
+
"body": {
|
|
482
|
+
"package": "himalaya",
|
|
483
|
+
"type": "Button",
|
|
484
|
+
"props": {
|
|
485
|
+
"title": "Continue with Microsoft",
|
|
486
|
+
"style": "secondary",
|
|
487
|
+
"fullWidth": true,
|
|
488
|
+
"action": {
|
|
489
|
+
"actionId": "tier5.himiBase44Account.signInWith",
|
|
490
|
+
"params": {
|
|
491
|
+
"provider": "microsoft"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"modifiers": {
|
|
497
|
+
"hiddenPath": "$service:himiBase44Account.hideMicrosoft"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"id": "himi_base44_account.provider_facebook",
|
|
502
|
+
"body": {
|
|
503
|
+
"package": "himalaya",
|
|
504
|
+
"type": "Button",
|
|
505
|
+
"props": {
|
|
506
|
+
"title": "Continue with Facebook",
|
|
507
|
+
"style": "secondary",
|
|
508
|
+
"fullWidth": true,
|
|
509
|
+
"action": {
|
|
510
|
+
"actionId": "tier5.himiBase44Account.signInWith",
|
|
511
|
+
"params": {
|
|
512
|
+
"provider": "facebook"
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"modifiers": {
|
|
518
|
+
"hiddenPath": "$service:himiBase44Account.hideFacebook"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"id": "himi_base44_account.provider_sso",
|
|
523
|
+
"body": {
|
|
524
|
+
"package": "himalaya",
|
|
525
|
+
"type": "Button",
|
|
526
|
+
"props": {
|
|
527
|
+
"title": "Continue with single sign-on",
|
|
528
|
+
"style": "secondary",
|
|
529
|
+
"fullWidth": true,
|
|
530
|
+
"action": {
|
|
531
|
+
"actionId": "tier5.himiBase44Account.signInWith",
|
|
532
|
+
"params": {
|
|
533
|
+
"provider": "sso"
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
"modifiers": {
|
|
539
|
+
"hiddenPath": "$service:himiBase44Account.hideSso"
|
|
540
|
+
}
|
|
541
|
+
},
|
|
437
542
|
{
|
|
438
543
|
"id": "himi_base44_account.email",
|
|
439
544
|
"body": {
|
|
@@ -447,6 +552,9 @@ const BASE44_ACCOUNT = {
|
|
|
447
552
|
"actionId": "tier5.himiBase44Account.setEmail"
|
|
448
553
|
}
|
|
449
554
|
}
|
|
555
|
+
},
|
|
556
|
+
"modifiers": {
|
|
557
|
+
"hiddenPath": "$service:himiBase44Account.hideEmailField"
|
|
450
558
|
}
|
|
451
559
|
},
|
|
452
560
|
{
|
|
@@ -521,24 +629,6 @@ const BASE44_ACCOUNT = {
|
|
|
521
629
|
"hiddenPath": "$service:himiBase44Account.hidePasswordField"
|
|
522
630
|
}
|
|
523
631
|
},
|
|
524
|
-
{
|
|
525
|
-
"id": "himi_base44_account.send_code",
|
|
526
|
-
"body": {
|
|
527
|
-
"package": "himalaya",
|
|
528
|
-
"type": "Button",
|
|
529
|
-
"props": {
|
|
530
|
-
"title": "Email me a code instead",
|
|
531
|
-
"style": "secondary",
|
|
532
|
-
"fullWidth": true,
|
|
533
|
-
"action": {
|
|
534
|
-
"actionId": "tier5.himiBase44Account.sendCode"
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
"modifiers": {
|
|
539
|
-
"hiddenPath": "$service:himiBase44Account.hidePasswordField"
|
|
540
|
-
}
|
|
541
|
-
},
|
|
542
632
|
{
|
|
543
633
|
"id": "himi_base44_account.verify_code",
|
|
544
634
|
"body": {
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
// himi-brandy-base44-account — the native Account screen of an app whose website is a Base44 site.
|
|
2
|
-
// Sign in
|
|
3
|
-
//
|
|
2
|
+
// Sign in with the methods the Base44 app turned on (email + password, and Google / Microsoft /
|
|
3
|
+
// Facebook / Apple / SSO through the system browser), register (verified by the emailed code),
|
|
4
|
+
// reset a password, sign out, and — when the app provides the backend function — delete the account.
|
|
5
|
+
//
|
|
6
|
+
// Base44 has no passwordless email login: its `resend-otp` only re-sends the code that verifies a
|
|
7
|
+
// NEW account. So the code form appears only after Create account, never as a sign-in method.
|
|
8
|
+
//
|
|
9
|
+
// Provider buttons follow the app's public sign-in settings (`auth.providers()`), and only show
|
|
10
|
+
// where this build can finish a provider sign-in (`providerSignIn`): the provider returns to the
|
|
11
|
+
// app's own `https://<slug>.base44.app`, which opens the app only when Base44's app-link files
|
|
12
|
+
// there name this build.
|
|
4
13
|
//
|
|
5
14
|
// Signing in here is what signs the WEBSITE tabs in: the native session bridge carries the
|
|
6
15
|
// token into every Base44 WebView (the token itself never reaches this worker — login answers
|
|
@@ -20,8 +29,12 @@ interface AccountState {
|
|
|
20
29
|
email: string;
|
|
21
30
|
password: string;
|
|
22
31
|
code: string;
|
|
23
|
-
/** "signIn" | "
|
|
32
|
+
/** "signIn" | "code" — which form the card shows. "code" only follows Create account. */
|
|
24
33
|
mode: string;
|
|
34
|
+
/** The hosted providers this app turned on AND this build can complete, in Base44's order. */
|
|
35
|
+
providers: string[];
|
|
36
|
+
/** Email + password is on for this app (Base44's default). */
|
|
37
|
+
passwordEnabled: boolean;
|
|
25
38
|
/** The app's delete-account function, "" when it has none (no Delete row). */
|
|
26
39
|
deleteFunction: string;
|
|
27
40
|
confirmingDelete: boolean;
|
|
@@ -36,6 +49,13 @@ interface AccountState {
|
|
|
36
49
|
hideSignedOut: boolean;
|
|
37
50
|
hideCodeField: boolean;
|
|
38
51
|
hidePasswordField: boolean;
|
|
52
|
+
/** The email field: the password form and the verify-code step need it; a provider-only app does not. */
|
|
53
|
+
hideEmailField: boolean;
|
|
54
|
+
hideGoogle: boolean;
|
|
55
|
+
hideMicrosoft: boolean;
|
|
56
|
+
hideFacebook: boolean;
|
|
57
|
+
hideApple: boolean;
|
|
58
|
+
hideSso: boolean;
|
|
39
59
|
hideDelete: boolean;
|
|
40
60
|
hideConfirmDelete: boolean;
|
|
41
61
|
}
|
|
@@ -43,6 +63,13 @@ interface AccountState {
|
|
|
43
63
|
const describe = (e: unknown): string =>
|
|
44
64
|
isBase44Error(e) ? (e.message || e.code) : e instanceof Error ? e.message : String(e);
|
|
45
65
|
|
|
66
|
+
const hideProvider = (s: AccountState, provider: string): boolean =>
|
|
67
|
+
s.signedIn || s.mode === "code" || !s.providers.includes(provider);
|
|
68
|
+
|
|
69
|
+
const PROVIDER_LABEL: Record<string, string> = {
|
|
70
|
+
google: "Google", microsoft: "Microsoft", facebook: "Facebook", apple: "Apple", sso: "SSO",
|
|
71
|
+
};
|
|
72
|
+
|
|
46
73
|
/** Recompute the hiddenWhen flags from the state that drives them. */
|
|
47
74
|
function derive(s: AccountState): AccountState {
|
|
48
75
|
return {
|
|
@@ -50,7 +77,13 @@ function derive(s: AccountState): AccountState {
|
|
|
50
77
|
hideSignedIn: !s.signedIn,
|
|
51
78
|
hideSignedOut: s.signedIn,
|
|
52
79
|
hideCodeField: s.signedIn || s.mode !== "code",
|
|
53
|
-
hidePasswordField: s.signedIn || s.mode === "code",
|
|
80
|
+
hidePasswordField: s.signedIn || s.mode === "code" || !s.passwordEnabled,
|
|
81
|
+
hideEmailField: s.signedIn || (s.mode !== "code" && !s.passwordEnabled),
|
|
82
|
+
hideGoogle: hideProvider(s, "google"),
|
|
83
|
+
hideMicrosoft: hideProvider(s, "microsoft"),
|
|
84
|
+
hideFacebook: hideProvider(s, "facebook"),
|
|
85
|
+
hideApple: hideProvider(s, "apple"),
|
|
86
|
+
hideSso: hideProvider(s, "sso"),
|
|
54
87
|
hideDelete: !s.signedIn || !s.deleteFunction || s.confirmingDelete,
|
|
55
88
|
hideConfirmDelete: !s.signedIn || !s.deleteFunction || !s.confirmingDelete,
|
|
56
89
|
};
|
|
@@ -61,11 +94,10 @@ const acct = defineService<AccountState, {
|
|
|
61
94
|
setEmail: (s: AccountState, p?: { value?: string }) => AccountState;
|
|
62
95
|
setPassword: (s: AccountState, p?: { value?: string }) => AccountState;
|
|
63
96
|
setCode: (s: AccountState, p?: { value?: string }) => AccountState;
|
|
64
|
-
useCode: (s: AccountState) => AccountState;
|
|
65
97
|
usePassword: (s: AccountState) => AccountState;
|
|
66
98
|
signIn: (s: AccountState) => AccountState;
|
|
99
|
+
signInWith: (s: AccountState, p?: { provider?: string }) => AccountState;
|
|
67
100
|
register: (s: AccountState) => AccountState;
|
|
68
|
-
sendCode: (s: AccountState) => AccountState;
|
|
69
101
|
verifyCode: (s: AccountState) => AccountState;
|
|
70
102
|
resetPassword: (s: AccountState) => AccountState;
|
|
71
103
|
signOut: (s: AccountState) => AccountState;
|
|
@@ -77,6 +109,7 @@ const acct = defineService<AccountState, {
|
|
|
77
109
|
_done: (s: AccountState, message?: string) => AccountState;
|
|
78
110
|
_failed: (s: AccountState, error?: string) => AccountState;
|
|
79
111
|
_failedRegister: (s: AccountState, message?: string) => AccountState;
|
|
112
|
+
_methods: (s: AccountState, password?: boolean, providers?: string[]) => AccountState;
|
|
80
113
|
}>("himiBase44Account", {
|
|
81
114
|
state: derive({
|
|
82
115
|
signedIn: false,
|
|
@@ -85,6 +118,8 @@ const acct = defineService<AccountState, {
|
|
|
85
118
|
password: "",
|
|
86
119
|
code: "",
|
|
87
120
|
mode: "signIn",
|
|
121
|
+
providers: [],
|
|
122
|
+
passwordEnabled: true,
|
|
88
123
|
deleteFunction: "",
|
|
89
124
|
confirmingDelete: false,
|
|
90
125
|
busy: false,
|
|
@@ -94,6 +129,12 @@ const acct = defineService<AccountState, {
|
|
|
94
129
|
hideSignedOut: false,
|
|
95
130
|
hideCodeField: true,
|
|
96
131
|
hidePasswordField: false,
|
|
132
|
+
hideEmailField: false,
|
|
133
|
+
hideGoogle: true,
|
|
134
|
+
hideMicrosoft: true,
|
|
135
|
+
hideFacebook: true,
|
|
136
|
+
hideApple: true,
|
|
137
|
+
hideSso: true,
|
|
97
138
|
hideDelete: true,
|
|
98
139
|
hideConfirmDelete: true,
|
|
99
140
|
}),
|
|
@@ -102,13 +143,17 @@ const acct = defineService<AccountState, {
|
|
|
102
143
|
auth.status()
|
|
103
144
|
.then((st) => (st.signedIn ? acct._signedIn(String(st.user?.email ?? ""), "") : acct._signedOut("")))
|
|
104
145
|
.catch((e) => acct._failed(describe(e)));
|
|
146
|
+
// The app's sign-in settings. Unreadable (offline, an older host without the verb) keeps
|
|
147
|
+
// email + password, which every Base44 app has — never an empty card.
|
|
148
|
+
auth.providers()
|
|
149
|
+
.then((m) => acct._methods(m.password, m.providerSignIn ? m.providers : []))
|
|
150
|
+
.catch(() => undefined);
|
|
105
151
|
return derive({ ...s, deleteFunction: String(p?.deleteFunction ?? "") });
|
|
106
152
|
},
|
|
107
153
|
|
|
108
154
|
setEmail: (s, p) => ({ ...s, email: String(p?.value ?? "") }),
|
|
109
155
|
setPassword: (s, p) => ({ ...s, password: String(p?.value ?? "") }),
|
|
110
156
|
setCode: (s, p) => ({ ...s, code: String(p?.value ?? "") }),
|
|
111
|
-
useCode: (s) => derive({ ...s, mode: "code", message: "" }),
|
|
112
157
|
usePassword: (s) => derive({ ...s, mode: "signIn", message: "" }),
|
|
113
158
|
|
|
114
159
|
signIn: (s) => {
|
|
@@ -119,6 +164,18 @@ const acct = defineService<AccountState, {
|
|
|
119
164
|
return { ...s, password: "", busy: true, error: "", message: "Signing in…" };
|
|
120
165
|
},
|
|
121
166
|
|
|
167
|
+
signInWith: (s, p) => {
|
|
168
|
+
const provider = String(p?.provider ?? "");
|
|
169
|
+
if (s.busy || !s.providers.includes(provider)) return s;
|
|
170
|
+
const label = PROVIDER_LABEL[provider] ?? provider;
|
|
171
|
+
auth.loginWithProvider(provider as Parameters<typeof auth.loginWithProvider>[0])
|
|
172
|
+
.then(({ user }) => acct._signedIn(String(user?.email ?? ""), `Signed in with ${label}.`))
|
|
173
|
+
.catch((e) => (isBase44Error(e) && e.code === "cancelled"
|
|
174
|
+
? acct._done("")
|
|
175
|
+
: acct._failed(`${label} sign-in failed: ${describe(e)}`)));
|
|
176
|
+
return { ...s, busy: true, error: "", message: `Opening ${label} sign-in…` };
|
|
177
|
+
},
|
|
178
|
+
|
|
122
179
|
register: (s) => {
|
|
123
180
|
if (!s.email || !s.password) return { ...s, error: "", message: "Enter an email and a password to create an account." };
|
|
124
181
|
auth.register(s.email, s.password)
|
|
@@ -128,14 +185,6 @@ const acct = defineService<AccountState, {
|
|
|
128
185
|
return derive({ ...s, password: "", mode: "code", busy: true, error: "", message: "Creating your account…" });
|
|
129
186
|
},
|
|
130
187
|
|
|
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
188
|
verifyCode: (s) => {
|
|
140
189
|
if (!s.email || !s.code) return { ...s, error: "", message: "Enter your email and the code." };
|
|
141
190
|
auth.verifyOtp(s.email, s.code)
|
|
@@ -180,6 +229,12 @@ const acct = defineService<AccountState, {
|
|
|
180
229
|
derive({ ...s, error: "", signedIn: false, user: "", busy: false, confirmingDelete: false, mode: "signIn", message: String(message ?? "") }),
|
|
181
230
|
_done: (s, message) => ({ ...s, busy: false, error: "", message: String(message ?? "") }),
|
|
182
231
|
_failed: (s, error) => ({ ...s, busy: false, message: "", error: String(error ?? "") }),
|
|
232
|
+
_methods: (s, password, providers) => {
|
|
233
|
+
const list = Array.isArray(providers) ? providers.map(String) : [];
|
|
234
|
+
// A provider-only app on a build that cannot finish a provider sign-in keeps email + password
|
|
235
|
+
// (Base44 still accepts it for users who set one) rather than an empty card.
|
|
236
|
+
return derive({ ...s, passwordEnabled: password !== false || list.length === 0, providers: list });
|
|
237
|
+
},
|
|
183
238
|
_failedRegister: (s, error) => derive({ ...s, busy: false, mode: "signIn", message: "", error: String(error ?? "") }),
|
|
184
239
|
},
|
|
185
240
|
});
|