@wix/himalaya-cli 0.1750.0 → 0.1752.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/dev-server/src/app-config.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +16 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/himi-package.d.ts +478 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/host-compatibility.d.ts +56 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/icon-catalog.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +154 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/native-engine.d.ts +49 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/copy.generated.d.ts +16 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/feedback.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast-service.d.ts +105 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast.d.ts +116 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +27 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +326 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +757 -83
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +156 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth/worker.mjs +133 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +139 -13
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin → 2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d.bin} +1 -1
- package/dist/browser-plane/sw.js +7 -7
- package/dist/cli.mjs +37219 -33014
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/app-config.md +1 -1
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +4 -0
- package/guides/designing-himi-screens.md +7 -0
- package/guides/getting-started.md +2 -0
- package/guides/headless-loop.md +1 -1
- package/guides/himi-json-output.md +25 -3
- package/guides/himi-skill.md +2 -0
- package/guides/index.json +6 -0
- package/guides/push-cli-onboarding.md +13 -0
- package/guides/qa-builds.md +15 -2
- package/guides/recipe-podcast.md +149 -0
- package/guides/releasing-with-himi-serve.md +51 -0
- package/guides/store-submission.md +46 -1
- package/guides/tier-5-add-a-screen.md +16 -2
- package/guides/wix-business-context.md +29 -0
- package/guides/wix-platform-usage.md +7 -2
- package/package.json +10 -10
- package/template-icons/fitness-gym.png +0 -0
- package/templates/beauty-salon/dev/index.ts +1 -1
- package/templates/beauty-salon/l10n/en.json +1 -1
- package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/branded-lite/dev/index.ts +101 -1
- package/templates/branded-lite/l10n/en.json +22 -1
- package/templates/branded-lite/l10n/es.json +22 -0
- package/templates/branded-lite/l10n/fr.json +18 -0
- package/templates/branded-lite/l10n/he.json +15 -0
- package/templates/branded-lite/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
- package/templates/brandy/README.md +33 -0
- package/templates/brandy/config.ts +51 -7
- package/templates/brandy/dev/index.ts +23 -9
- package/templates/community-club/l10n/en.json +1 -1
- package/templates/community-club/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/community-club/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/events-meetups/l10n/en.json +1 -1
- package/templates/events-meetups/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/events-meetups/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/fitness-gym/README.md +53 -0
- package/templates/fitness-gym/config.ts +560 -0
- package/templates/fitness-gym/dev/index.ts +25787 -0
- package/templates/fitness-gym/himalaya.content.json +64 -0
- package/templates/fitness-gym/himalaya.template.json +15 -0
- package/templates/fitness-gym/icon.png +0 -0
- package/templates/fitness-gym/platforms.json +1 -0
- package/templates/fitness-gym/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/fitness-gym/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/fitness-gym/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/fitness-gym/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/fitness-gym/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/fitness-gym/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-copy.ts +116 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-media.ts +29 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/fitness-gym/tier5-src/_shared/host-events.ts +66 -0
- package/templates/fitness-gym/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/fitness-gym/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/fitness-gym/tier5-src/_shared/member-access.ts +63 -0
- package/templates/fitness-gym/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/fitness-gym/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/fitness-gym/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/fitness-gym/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/fitness-gym/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/fitness-gym/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/fitness-gym/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/fitness-gym/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/fitness-gym/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/fitness-gym/tier5-src/_shared/program-description.ts +11 -0
- package/templates/fitness-gym/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/fitness-gym/tier5-src/_shared/program-standing.ts +46 -0
- package/templates/fitness-gym/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/fitness-gym/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/fitness-gym/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/fitness-gym/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/fitness-gym/tier5-src/business-chat/index.ts +732 -0
- package/templates/fitness-gym/tier5-src/business-contact/index.ts +6 -0
- package/templates/fitness-gym/tier5-src/himi-booking-account/index.ts +267 -0
- package/templates/fitness-gym/tier5-src/himi-booking-bookings/index.ts +468 -0
- package/templates/fitness-gym/tier5-src/himi-booking-service/index.ts +1190 -0
- package/templates/fitness-gym/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1729 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +656 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +495 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/facts.ts +52 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +845 -0
- package/templates/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +190 -0
- package/templates/fitness-gym/tier5-src/himi-fitcoach-home/index.ts +619 -0
- package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +1007 -0
- package/templates/fitness-gym/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
- package/templates/fitness-gym/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/fitness-gym/tokens.json +414 -0
- package/templates/gym-fitness/dev/index.ts +1 -1
- package/templates/gym-fitness/l10n/en.json +1 -1
- package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/medical-services/dev/index.ts +2 -1
- package/templates/medical-services/tier5-src/himi-booking-account/index.ts +16 -1
- package/templates/nonprofit-cause/l10n/en.json +1 -1
- package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/personal-fitness-trainer/dev/index.ts +2 -2
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/podcast-creator/dev/index.ts +100 -0
- package/templates/podcast-creator/l10n/en.json +22 -1
- package/templates/podcast-creator/l10n/es.json +22 -0
- package/templates/podcast-creator/l10n/fr.json +18 -0
- package/templates/podcast-creator/l10n/he.json +15 -0
- package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
- package/templates/portfolio-creative/l10n/en.json +1 -1
- package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/restaurant/l10n/en.json +1 -1
- package/templates/restaurant/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/restaurant/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/retail-store/l10n/en.json +1 -1
- package/templates/retail-store/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/retail-store/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/salon-spa/dev/index.ts +1 -1
- package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +16 -1
- package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/yoga-studio/dev/index.ts +1 -1
- package/templates/yoga-studio/l10n/en.json +1 -1
- package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
|
@@ -7057,6 +7057,9 @@ var screenDescriptorSchema = {
|
|
|
7057
7057
|
// RFC 0066 amendment — "" / "visible" (default) | "hidden". A free string like every
|
|
7058
7058
|
// chrome discriminator: an unknown value coalesces to "visible" (invariant 6).
|
|
7059
7059
|
tabBarVisibility: { type: "string" },
|
|
7060
|
+
// "" / "pinned" (default) | "floating" — how the host draws `stickyFooter`. A free string
|
|
7061
|
+
// like every chrome discriminator: an unknown value coalesces to "pinned" (invariant 6).
|
|
7062
|
+
stickyFooterPlacement: { type: "string" },
|
|
7060
7063
|
// RFC 0002 — Tier-5 worker bundle reference (LogicBundleRef). Without this in
|
|
7061
7064
|
// the schema, `additionalProperties:false` rejected EVERY T5 descriptor, so the
|
|
7062
7065
|
// admin's pre-push validation 400'd any edit of a T5 screen.
|
|
@@ -8353,6 +8356,157 @@ function workerSubtreePolicyErrors(policy) {
|
|
|
8353
8356
|
return out;
|
|
8354
8357
|
}
|
|
8355
8358
|
|
|
8359
|
+
// ../../core/ts/src/icon-catalog.generated.ts
|
|
8360
|
+
var ICON_NAMES = [
|
|
8361
|
+
"ai",
|
|
8362
|
+
"arrow_down",
|
|
8363
|
+
"arrow_left",
|
|
8364
|
+
"arrow_right",
|
|
8365
|
+
"arrow_up",
|
|
8366
|
+
"back",
|
|
8367
|
+
"bag",
|
|
8368
|
+
"bag_fill",
|
|
8369
|
+
"barcode",
|
|
8370
|
+
"bell",
|
|
8371
|
+
"bell_fill",
|
|
8372
|
+
"bell_off",
|
|
8373
|
+
"bell_slash",
|
|
8374
|
+
"book",
|
|
8375
|
+
"bookmark",
|
|
8376
|
+
"bookmark_fill",
|
|
8377
|
+
"boxes",
|
|
8378
|
+
"branch",
|
|
8379
|
+
"calendar",
|
|
8380
|
+
"camera",
|
|
8381
|
+
"cart",
|
|
8382
|
+
"cart_fill",
|
|
8383
|
+
"chart",
|
|
8384
|
+
"chat",
|
|
8385
|
+
"check",
|
|
8386
|
+
"checklist",
|
|
8387
|
+
"checkmark",
|
|
8388
|
+
"chevron_down",
|
|
8389
|
+
"chevron_left",
|
|
8390
|
+
"chevron_right",
|
|
8391
|
+
"chevron_up",
|
|
8392
|
+
"circle",
|
|
8393
|
+
"circle_fill",
|
|
8394
|
+
"clock",
|
|
8395
|
+
"close",
|
|
8396
|
+
"concealed",
|
|
8397
|
+
"cookie",
|
|
8398
|
+
"copy",
|
|
8399
|
+
"dashboard",
|
|
8400
|
+
"doc",
|
|
8401
|
+
"document",
|
|
8402
|
+
"download",
|
|
8403
|
+
"edit",
|
|
8404
|
+
"ellipsis",
|
|
8405
|
+
"error",
|
|
8406
|
+
"expand",
|
|
8407
|
+
"external_link",
|
|
8408
|
+
"eye",
|
|
8409
|
+
"eye_slash",
|
|
8410
|
+
"filter",
|
|
8411
|
+
"folder",
|
|
8412
|
+
"forward",
|
|
8413
|
+
"fullscreen",
|
|
8414
|
+
"gear",
|
|
8415
|
+
"gift",
|
|
8416
|
+
"globe",
|
|
8417
|
+
"grid",
|
|
8418
|
+
"grid_fill",
|
|
8419
|
+
"grip",
|
|
8420
|
+
"heart",
|
|
8421
|
+
"heart_fill",
|
|
8422
|
+
"help",
|
|
8423
|
+
"home",
|
|
8424
|
+
"home_fill",
|
|
8425
|
+
"house",
|
|
8426
|
+
"image",
|
|
8427
|
+
"inbox",
|
|
8428
|
+
"info",
|
|
8429
|
+
"layers",
|
|
8430
|
+
"link",
|
|
8431
|
+
"list",
|
|
8432
|
+
"location",
|
|
8433
|
+
"lock",
|
|
8434
|
+
"logout",
|
|
8435
|
+
"mail",
|
|
8436
|
+
"map",
|
|
8437
|
+
"menu",
|
|
8438
|
+
"message",
|
|
8439
|
+
"mic",
|
|
8440
|
+
"mic_fill",
|
|
8441
|
+
"microphone",
|
|
8442
|
+
"microphone_fill",
|
|
8443
|
+
"minus",
|
|
8444
|
+
"moon",
|
|
8445
|
+
"more",
|
|
8446
|
+
"more_vertical",
|
|
8447
|
+
"music",
|
|
8448
|
+
"newspaper",
|
|
8449
|
+
"newspaper_fill",
|
|
8450
|
+
"next",
|
|
8451
|
+
"paper_plane",
|
|
8452
|
+
"pause",
|
|
8453
|
+
"pencil",
|
|
8454
|
+
"people",
|
|
8455
|
+
"person",
|
|
8456
|
+
"person_fill",
|
|
8457
|
+
"phone",
|
|
8458
|
+
"photo",
|
|
8459
|
+
"pin",
|
|
8460
|
+
"play",
|
|
8461
|
+
"play_circle",
|
|
8462
|
+
"play_circle_fill",
|
|
8463
|
+
"plus",
|
|
8464
|
+
"plus_circle",
|
|
8465
|
+
"plus_circle_fill",
|
|
8466
|
+
"prev",
|
|
8467
|
+
"question",
|
|
8468
|
+
"redo",
|
|
8469
|
+
"refresh",
|
|
8470
|
+
"repeat",
|
|
8471
|
+
"rss",
|
|
8472
|
+
"search",
|
|
8473
|
+
"send",
|
|
8474
|
+
"send_arrow",
|
|
8475
|
+
"settings",
|
|
8476
|
+
"settings_fill",
|
|
8477
|
+
"share",
|
|
8478
|
+
"shuffle",
|
|
8479
|
+
"skip_back",
|
|
8480
|
+
"skip_forward",
|
|
8481
|
+
"skip_next",
|
|
8482
|
+
"skip_previous",
|
|
8483
|
+
"star",
|
|
8484
|
+
"star_fill",
|
|
8485
|
+
"stop",
|
|
8486
|
+
"success",
|
|
8487
|
+
"tag",
|
|
8488
|
+
"ticket",
|
|
8489
|
+
"ticket_fill",
|
|
8490
|
+
"trash",
|
|
8491
|
+
"tray",
|
|
8492
|
+
"undo",
|
|
8493
|
+
"user",
|
|
8494
|
+
"visible",
|
|
8495
|
+
"volume",
|
|
8496
|
+
"warning",
|
|
8497
|
+
"whatsapp",
|
|
8498
|
+
"wifi",
|
|
8499
|
+
"xmark"
|
|
8500
|
+
];
|
|
8501
|
+
|
|
8502
|
+
// ../../core/ts/src/himi-package.ts
|
|
8503
|
+
var DEFAULT_HIMI_PACKAGE_ARCHIVE_LIMITS = {
|
|
8504
|
+
maxCompressedBytes: 64 * 1024 * 1024,
|
|
8505
|
+
maxExpandedBytes: 256 * 1024 * 1024,
|
|
8506
|
+
maxEntries: 1e4,
|
|
8507
|
+
maxDecompressionRatio: 1e3
|
|
8508
|
+
};
|
|
8509
|
+
|
|
8356
8510
|
// ../../core/ts/src/site-shell.ts
|
|
8357
8511
|
var WIX_FREE_SITE_HOST_SUFFIXES = ["wixsite.com", "wixstudio.com", "wixstudio.io", "editorx.io"];
|
|
8358
8512
|
function isWixFreeSiteHost(host) {
|
|
@@ -8516,6 +8670,7 @@ function sitePageNode(site, page, opts) {
|
|
|
8516
8670
|
const adapter = page.bridge === "worker" && site.kind === "wix" ? { hostedSiteAdapter: "wix" } : {};
|
|
8517
8671
|
return primarySiteWebView(url, enforceSiteKind(site, { ...siteWebViewPreset(site), ...adapter, ...page.webView ?? {} }), opts?.id ?? SITE_PAGE_NODE_ID, page.title, [], page.bridge);
|
|
8518
8672
|
}
|
|
8673
|
+
var ICONS = new Set(ICON_NAMES);
|
|
8519
8674
|
|
|
8520
8675
|
// ../../core/ts/src/rich-content-limits.generated.ts
|
|
8521
8676
|
var RICH_CONTENT_LIMITS = Object.freeze({ maxBytes: 262144, maxNodes: 5e3, maxDepth: 16 });
|
|
@@ -9652,6 +9807,7 @@ function deriveAppMeta(name, m, platforms = {}, provisioning = {}) {
|
|
|
9652
9807
|
iap: config.iap,
|
|
9653
9808
|
base44: config.base44,
|
|
9654
9809
|
wixIap: config.wixIap,
|
|
9810
|
+
socialSignIn: config.socialSignIn,
|
|
9655
9811
|
// RFC 0042 Phase 2 — optional per-app Wix Platform productionization block.
|
|
9656
9812
|
// Read loosely (AppConfig in @himalaya/core doesn't type it yet) so apps can
|
|
9657
9813
|
// opt in without a core-types bump; absent ⇒ all members keep the dev seam.
|
|
@@ -167,17 +167,74 @@ var DeviceAuthClient = class {
|
|
|
167
167
|
|
|
168
168
|
// ../../stdlib/auth-providers/wix/src/native-engine.ts
|
|
169
169
|
var NativeAuthError = class extends Error {
|
|
170
|
-
constructor(kind, message, twoFAToken, twoFAMethod, twoFAMethods, verificationId) {
|
|
170
|
+
constructor(kind, message, twoFAToken, twoFAMethod, twoFAMethods, verificationId, twoFAHint) {
|
|
171
171
|
super(message);
|
|
172
172
|
this.kind = kind;
|
|
173
173
|
this.twoFAToken = twoFAToken;
|
|
174
174
|
this.twoFAMethod = twoFAMethod;
|
|
175
175
|
this.twoFAMethods = twoFAMethods;
|
|
176
176
|
this.verificationId = verificationId;
|
|
177
|
+
this.twoFAHint = twoFAHint;
|
|
177
178
|
this.name = "NativeAuthError";
|
|
178
179
|
}
|
|
179
180
|
};
|
|
180
181
|
var DEV_PASSWORD = "Passw0rd!";
|
|
182
|
+
var VOICE_CALL_METHOD = "VoiceCall";
|
|
183
|
+
var isPhoneMethod = (m) => ["phone", "sms"].includes(m.toLowerCase());
|
|
184
|
+
var isVoiceCallMethod = (m) => m.toLowerCase() === VOICE_CALL_METHOD.toLowerCase();
|
|
185
|
+
var twoFactorWireMethod = (m) => isVoiceCallMethod(m) ? "Phone" : m;
|
|
186
|
+
var nonBlank = (v) => typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
187
|
+
function twoFactorGateMethods(current, enabled) {
|
|
188
|
+
const out = [];
|
|
189
|
+
for (const m of [...enabled, current]) {
|
|
190
|
+
if (out.includes(m)) continue;
|
|
191
|
+
out.push(m);
|
|
192
|
+
if (isPhoneMethod(m) && !out.some(isVoiceCallMethod)) out.push(VOICE_CALL_METHOD);
|
|
193
|
+
}
|
|
194
|
+
return out;
|
|
195
|
+
}
|
|
196
|
+
function shapeTwoFactorChallenge(payload, requested, previous) {
|
|
197
|
+
const server = nonBlank(payload.currentTwoFAMethod) ?? twoFactorWireMethod(requested);
|
|
198
|
+
const method = isVoiceCallMethod(requested) && isPhoneMethod(server) ? VOICE_CALL_METHOD : server;
|
|
199
|
+
const enabled = Array.isArray(payload.enabledTwoFAMethods) ? payload.enabledTwoFAMethods.filter((m) => typeof m === "string" && m !== "") : void 0;
|
|
200
|
+
const inherited = previous && previous.emailUnlisted && server !== "Email" ? previous.methods.filter((m) => m.toLowerCase() !== "email") : previous?.methods;
|
|
201
|
+
const methods = enabled ? twoFactorGateMethods(server, enabled) : inherited ?? twoFactorGateMethods(server, []);
|
|
202
|
+
const raw = isPhoneMethod(server) ? nonBlank(payload.phoneHint) ?? nonBlank(payload.twoFAHint) : nonBlank(payload.twoFAHint);
|
|
203
|
+
const id = payload.verificationId;
|
|
204
|
+
const verificationId = (typeof id === "string" || typeof id === "number") && /^\d+$/.test(String(id)) ? String(id) : void 0;
|
|
205
|
+
return {
|
|
206
|
+
verificationId,
|
|
207
|
+
token: String(payload.twoFAToken ?? previous?.token ?? ""),
|
|
208
|
+
method,
|
|
209
|
+
methods: methods.includes(method) ? methods : [...methods, method],
|
|
210
|
+
hint: raw && !raw.startsWith("{") ? raw : void 0,
|
|
211
|
+
// With no list in the reply, Email is unlisted unless the previous challenge listed it — a send
|
|
212
|
+
// that fell back to Email (e.g. from SMS) is still a channel the server never offered.
|
|
213
|
+
emailUnlisted: server === "Email" && (enabled ? !enabled.includes("Email") : previous ? previous.emailUnlisted || !previous.methods.some((m) => m.toLowerCase() === "email") : true)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function twoFactorResendForm(token, method, challenge) {
|
|
217
|
+
const form = { twoFAToken: token };
|
|
218
|
+
const wire = twoFactorWireMethod(method);
|
|
219
|
+
if (!(challenge?.emailUnlisted && wire.toLowerCase() === "email")) form.twoFAMethod = wire;
|
|
220
|
+
if (isVoiceCallMethod(method)) form.phoneDeliveryMethod = "VOICE_CALL";
|
|
221
|
+
else if (isPhoneMethod(method)) form.phoneDeliveryMethod = "SMS";
|
|
222
|
+
return form;
|
|
223
|
+
}
|
|
224
|
+
function legacyTwoFactorFailure(errorCode) {
|
|
225
|
+
switch (Number(errorCode)) {
|
|
226
|
+
case 8002:
|
|
227
|
+
return new NativeAuthError("verificationExpired", "This verification has expired. Go back and sign in again.");
|
|
228
|
+
case 8004:
|
|
229
|
+
return new NativeAuthError("rateLimited", "Too many attempts. Wait a few minutes and try again.");
|
|
230
|
+
case 8034:
|
|
231
|
+
return new NativeAuthError("deliveryFailed", "We couldn't send the code. Try again, or try another way.");
|
|
232
|
+
case 8056:
|
|
233
|
+
return new NativeAuthError("smsRegionUnsupported", "SMS codes aren't available in your region. Try another way.");
|
|
234
|
+
default:
|
|
235
|
+
return void 0;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
181
238
|
var WixNativeAuthEngine = class {
|
|
182
239
|
constructor(config = {}) {
|
|
183
240
|
__publicField(this, "baseURL");
|
|
@@ -185,6 +242,7 @@ var WixNativeAuthEngine = class {
|
|
|
185
242
|
__publicField(this, "pxToken");
|
|
186
243
|
__publicField(this, "petriOverrides");
|
|
187
244
|
__publicField(this, "fetchImpl");
|
|
245
|
+
__publicField(this, "challenges", /* @__PURE__ */ new Map());
|
|
188
246
|
this.baseURL = config.baseURL ?? "https://users.wix.com";
|
|
189
247
|
this.devMode = config.devMode ?? false;
|
|
190
248
|
this.pxToken = config.pxToken;
|
|
@@ -234,13 +292,44 @@ var WixNativeAuthEngine = class {
|
|
|
234
292
|
return this.postSignIn("/auth/m/verifycodeandlogin", {
|
|
235
293
|
twoFAToken: token,
|
|
236
294
|
code,
|
|
237
|
-
twoFAMethod: method,
|
|
295
|
+
twoFAMethod: twoFactorWireMethod(method),
|
|
238
296
|
rememberMe: "true"
|
|
239
297
|
});
|
|
240
298
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
299
|
+
/** The challenge `token` stands for, as the gate shows it. */
|
|
300
|
+
twoFactorChallenge(token) {
|
|
301
|
+
return this.challenges.get(token);
|
|
302
|
+
}
|
|
303
|
+
/** Re-sends the 2FA code via `method` (default: the challenge's current one) — the same call
|
|
304
|
+
* switches to another method; `VoiceCall` asks for the Phone code by a call. Resolves to the
|
|
305
|
+
* new challenge (every send issues a new token), or undefined when the server named none.
|
|
306
|
+
* Rejects when the server refused to send: a failed resend must not read as "a new code was sent". */
|
|
307
|
+
async resendTwoFactor(token, method) {
|
|
308
|
+
const previous = this.challenges.get(token);
|
|
309
|
+
const requested = method ?? previous?.method ?? "";
|
|
310
|
+
if (this.devMode) {
|
|
311
|
+
const requested2 = method ?? previous?.method ?? "sms";
|
|
312
|
+
const phone = isPhoneMethod(twoFactorWireMethod(requested2));
|
|
313
|
+
const next2 = shapeTwoFactorChallenge({
|
|
314
|
+
twoFAToken: token,
|
|
315
|
+
currentTwoFAMethod: twoFactorWireMethod(requested2),
|
|
316
|
+
...phone ? { phoneHint: "\u2022\u2022\u2022-\u2022\u2022\u2022-\u2022\u202234" } : requested2.toLowerCase() === "email" ? { twoFAHint: "2f\u2022\u2022\u2022@himalaya.dev" } : {}
|
|
317
|
+
}, requested2, previous);
|
|
318
|
+
this.challenges.set(token, next2);
|
|
319
|
+
return next2;
|
|
320
|
+
}
|
|
321
|
+
const json = await this.rawPost(
|
|
322
|
+
"/auth/m/resend2facode",
|
|
323
|
+
requested ? twoFactorResendForm(token, requested, previous) : { twoFAToken: token }
|
|
324
|
+
);
|
|
325
|
+
if (json.success !== true) {
|
|
326
|
+
throw legacyTwoFactorFailure(json.errorCode) ?? new NativeAuthError("unknown", "Something went wrong. Please try again.");
|
|
327
|
+
}
|
|
328
|
+
const payload = json.payload ?? json;
|
|
329
|
+
if (typeof payload.twoFAToken !== "string" || !payload.twoFAToken) return void 0;
|
|
330
|
+
const next = shapeTwoFactorChallenge(payload, requested, previous);
|
|
331
|
+
this.challenges.set(next.token, next);
|
|
332
|
+
return next;
|
|
244
333
|
}
|
|
245
334
|
async sendPasswordReset(email) {
|
|
246
335
|
if (this.devMode) return;
|
|
@@ -259,7 +348,21 @@ var WixNativeAuthEngine = class {
|
|
|
259
348
|
* the account session (uaToken) + sets wixSession2/XSRF cookies. 2FA via the
|
|
260
349
|
* payload.twoFAToken handshake. Register is captcha-gated (errorCode 9981). */
|
|
261
350
|
async ownerSignIn(email, password) {
|
|
262
|
-
if (this.devMode)
|
|
351
|
+
if (this.devMode) {
|
|
352
|
+
try {
|
|
353
|
+
return devSignIn(email, password);
|
|
354
|
+
} catch (e) {
|
|
355
|
+
if (!(e instanceof NativeAuthError) || e.kind !== "needsTwoFactor" || !e.twoFAToken) throw e;
|
|
356
|
+
const c = shapeTwoFactorChallenge({
|
|
357
|
+
twoFAToken: e.twoFAToken,
|
|
358
|
+
currentTwoFAMethod: e.twoFAMethod,
|
|
359
|
+
enabledTwoFAMethods: e.twoFAMethods,
|
|
360
|
+
phoneHint: "\u2022\u2022\u2022-\u2022\u2022\u2022-\u2022\u202234"
|
|
361
|
+
}, e.twoFAMethod ?? "sms");
|
|
362
|
+
this.challenges.set(c.token, c);
|
|
363
|
+
throw new NativeAuthError("needsTwoFactor", e.message, c.token, c.method, c.methods, void 0, c.hint);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
263
366
|
const form = `email=${encodeURIComponent(email)}&password=${encodeURIComponent(password)}&accept=json` + (this.petriOverrides ? `&petri_ovr=${encodeURIComponent(this.petriOverrides)}` : "");
|
|
264
367
|
const res = await this.fetchImpl("https://users.wix.com/wix-users/auth/m/login", {
|
|
265
368
|
method: "POST",
|
|
@@ -269,21 +372,25 @@ var WixNativeAuthEngine = class {
|
|
|
269
372
|
const json = await res.json();
|
|
270
373
|
const payload = json.payload ?? {};
|
|
271
374
|
if (payload.twoFAToken && json.success !== true) {
|
|
272
|
-
const current = payload.currentTwoFAMethod ?? "sms";
|
|
273
|
-
const
|
|
375
|
+
const current = nonBlank(payload.currentTwoFAMethod) ?? "sms";
|
|
376
|
+
const c = shapeTwoFactorChallenge(payload, current);
|
|
377
|
+
this.challenges.set(c.token, c);
|
|
274
378
|
const id = payload.verificationId;
|
|
275
379
|
const verificationId = (typeof id === "string" || typeof id === "number") && /^\d+$/.test(String(id)) ? String(id) : void 0;
|
|
276
380
|
throw new NativeAuthError(
|
|
277
381
|
"needsTwoFactor",
|
|
278
382
|
"Two-factor verification required.",
|
|
279
383
|
payload.twoFAToken,
|
|
280
|
-
|
|
281
|
-
methods,
|
|
282
|
-
verificationId
|
|
384
|
+
c.method,
|
|
385
|
+
c.methods,
|
|
386
|
+
verificationId,
|
|
387
|
+
c.hint
|
|
283
388
|
);
|
|
284
389
|
}
|
|
285
390
|
if (json.success !== true || !payload.guid) {
|
|
286
391
|
if (json.errorCode === 9981) throw new NativeAuthError("recaptchaRequired", "Additional verification is required.");
|
|
392
|
+
const twoFactor = legacyTwoFactorFailure(json.errorCode);
|
|
393
|
+
if (twoFactor) throw twoFactor;
|
|
287
394
|
throw new NativeAuthError("invalidCredentials", "Wrong email or password.");
|
|
288
395
|
}
|
|
289
396
|
return {
|
|
@@ -354,15 +461,21 @@ var WixNativeAuthEngine = class {
|
|
|
354
461
|
async postSignIn(path, body) {
|
|
355
462
|
const json = await this.rawPost(path, body);
|
|
356
463
|
if (typeof json.twoFAToken === "string" && json.twoFAToken) {
|
|
464
|
+
const method = json.twoFAMethod ?? "sms";
|
|
465
|
+
const c = shapeTwoFactorChallenge({ ...json, currentTwoFAMethod: json.currentTwoFAMethod ?? method }, method);
|
|
466
|
+
this.challenges.set(c.token, c);
|
|
357
467
|
throw new NativeAuthError(
|
|
358
468
|
"needsTwoFactor",
|
|
359
469
|
"Two-factor verification required.",
|
|
360
470
|
json.twoFAToken,
|
|
361
|
-
|
|
471
|
+
c.method,
|
|
472
|
+
c.methods,
|
|
473
|
+
c.verificationId,
|
|
474
|
+
c.hint
|
|
362
475
|
);
|
|
363
476
|
}
|
|
364
477
|
if (typeof json.errorCode === "number" && json.errorCode !== 0) {
|
|
365
|
-
throw mapErrorCode(json.errorCode, json.errorDescription);
|
|
478
|
+
throw legacyTwoFactorFailure(json.errorCode) ?? mapErrorCode(json.errorCode, json.errorDescription);
|
|
366
479
|
}
|
|
367
480
|
const payload = json.payload ?? json;
|
|
368
481
|
const access = payload.accessToken ?? payload.wixAT;
|
|
@@ -407,6 +520,13 @@ function mapErrorCode(code, description) {
|
|
|
407
520
|
case -15007:
|
|
408
521
|
case 1:
|
|
409
522
|
return new NativeAuthError("invalidCredentials", description || "Wrong email or password.");
|
|
523
|
+
// A wrong 2FA code (legacyTwoFactorFailure leaves these to the credential path): the gate
|
|
524
|
+
// words invalidCredentials on a verify as a bad code. Mirrors the Swift/Kotlin engines.
|
|
525
|
+
case 8001:
|
|
526
|
+
case 8005:
|
|
527
|
+
case 8006:
|
|
528
|
+
case 8008:
|
|
529
|
+
return new NativeAuthError("invalidCredentials", description || "That code isn't right.");
|
|
410
530
|
case 8051:
|
|
411
531
|
return new NativeAuthError("unknown", description || "This domain is blocked.");
|
|
412
532
|
default:
|
|
@@ -35,17 +35,74 @@ function dualDomainAuthorizeUrls(clientIds, redirectUri, opts = {}, endpoint = O
|
|
|
35
35
|
|
|
36
36
|
// ../../stdlib/auth-providers/wix/src/native-engine.ts
|
|
37
37
|
var NativeAuthError = class extends Error {
|
|
38
|
-
constructor(kind, message, twoFAToken, twoFAMethod, twoFAMethods, verificationId) {
|
|
38
|
+
constructor(kind, message, twoFAToken, twoFAMethod, twoFAMethods, verificationId, twoFAHint) {
|
|
39
39
|
super(message);
|
|
40
40
|
this.kind = kind;
|
|
41
41
|
this.twoFAToken = twoFAToken;
|
|
42
42
|
this.twoFAMethod = twoFAMethod;
|
|
43
43
|
this.twoFAMethods = twoFAMethods;
|
|
44
44
|
this.verificationId = verificationId;
|
|
45
|
+
this.twoFAHint = twoFAHint;
|
|
45
46
|
this.name = "NativeAuthError";
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
49
|
var DEV_PASSWORD = "Passw0rd!";
|
|
50
|
+
var VOICE_CALL_METHOD = "VoiceCall";
|
|
51
|
+
var isPhoneMethod = (m) => ["phone", "sms"].includes(m.toLowerCase());
|
|
52
|
+
var isVoiceCallMethod = (m) => m.toLowerCase() === VOICE_CALL_METHOD.toLowerCase();
|
|
53
|
+
var twoFactorWireMethod = (m) => isVoiceCallMethod(m) ? "Phone" : m;
|
|
54
|
+
var nonBlank = (v) => typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
55
|
+
function twoFactorGateMethods(current, enabled) {
|
|
56
|
+
const out = [];
|
|
57
|
+
for (const m of [...enabled, current]) {
|
|
58
|
+
if (out.includes(m)) continue;
|
|
59
|
+
out.push(m);
|
|
60
|
+
if (isPhoneMethod(m) && !out.some(isVoiceCallMethod)) out.push(VOICE_CALL_METHOD);
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
function shapeTwoFactorChallenge(payload, requested, previous) {
|
|
65
|
+
const server = nonBlank(payload.currentTwoFAMethod) ?? twoFactorWireMethod(requested);
|
|
66
|
+
const method = isVoiceCallMethod(requested) && isPhoneMethod(server) ? VOICE_CALL_METHOD : server;
|
|
67
|
+
const enabled = Array.isArray(payload.enabledTwoFAMethods) ? payload.enabledTwoFAMethods.filter((m) => typeof m === "string" && m !== "") : void 0;
|
|
68
|
+
const inherited = previous && previous.emailUnlisted && server !== "Email" ? previous.methods.filter((m) => m.toLowerCase() !== "email") : previous?.methods;
|
|
69
|
+
const methods = enabled ? twoFactorGateMethods(server, enabled) : inherited ?? twoFactorGateMethods(server, []);
|
|
70
|
+
const raw = isPhoneMethod(server) ? nonBlank(payload.phoneHint) ?? nonBlank(payload.twoFAHint) : nonBlank(payload.twoFAHint);
|
|
71
|
+
const id = payload.verificationId;
|
|
72
|
+
const verificationId = (typeof id === "string" || typeof id === "number") && /^\d+$/.test(String(id)) ? String(id) : void 0;
|
|
73
|
+
return {
|
|
74
|
+
verificationId,
|
|
75
|
+
token: String(payload.twoFAToken ?? previous?.token ?? ""),
|
|
76
|
+
method,
|
|
77
|
+
methods: methods.includes(method) ? methods : [...methods, method],
|
|
78
|
+
hint: raw && !raw.startsWith("{") ? raw : void 0,
|
|
79
|
+
// With no list in the reply, Email is unlisted unless the previous challenge listed it — a send
|
|
80
|
+
// that fell back to Email (e.g. from SMS) is still a channel the server never offered.
|
|
81
|
+
emailUnlisted: server === "Email" && (enabled ? !enabled.includes("Email") : previous ? previous.emailUnlisted || !previous.methods.some((m) => m.toLowerCase() === "email") : true)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function twoFactorResendForm(token, method, challenge) {
|
|
85
|
+
const form = { twoFAToken: token };
|
|
86
|
+
const wire = twoFactorWireMethod(method);
|
|
87
|
+
if (!(challenge?.emailUnlisted && wire.toLowerCase() === "email")) form.twoFAMethod = wire;
|
|
88
|
+
if (isVoiceCallMethod(method)) form.phoneDeliveryMethod = "VOICE_CALL";
|
|
89
|
+
else if (isPhoneMethod(method)) form.phoneDeliveryMethod = "SMS";
|
|
90
|
+
return form;
|
|
91
|
+
}
|
|
92
|
+
function legacyTwoFactorFailure(errorCode) {
|
|
93
|
+
switch (Number(errorCode)) {
|
|
94
|
+
case 8002:
|
|
95
|
+
return new NativeAuthError("verificationExpired", "This verification has expired. Go back and sign in again.");
|
|
96
|
+
case 8004:
|
|
97
|
+
return new NativeAuthError("rateLimited", "Too many attempts. Wait a few minutes and try again.");
|
|
98
|
+
case 8034:
|
|
99
|
+
return new NativeAuthError("deliveryFailed", "We couldn't send the code. Try again, or try another way.");
|
|
100
|
+
case 8056:
|
|
101
|
+
return new NativeAuthError("smsRegionUnsupported", "SMS codes aren't available in your region. Try another way.");
|
|
102
|
+
default:
|
|
103
|
+
return void 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
49
106
|
var WixNativeAuthEngine = class {
|
|
50
107
|
constructor(config = {}) {
|
|
51
108
|
__publicField(this, "baseURL");
|
|
@@ -53,6 +110,7 @@ var WixNativeAuthEngine = class {
|
|
|
53
110
|
__publicField(this, "pxToken");
|
|
54
111
|
__publicField(this, "petriOverrides");
|
|
55
112
|
__publicField(this, "fetchImpl");
|
|
113
|
+
__publicField(this, "challenges", /* @__PURE__ */ new Map());
|
|
56
114
|
this.baseURL = config.baseURL ?? "https://users.wix.com";
|
|
57
115
|
this.devMode = config.devMode ?? false;
|
|
58
116
|
this.pxToken = config.pxToken;
|
|
@@ -102,13 +160,44 @@ var WixNativeAuthEngine = class {
|
|
|
102
160
|
return this.postSignIn("/auth/m/verifycodeandlogin", {
|
|
103
161
|
twoFAToken: token,
|
|
104
162
|
code,
|
|
105
|
-
twoFAMethod: method,
|
|
163
|
+
twoFAMethod: twoFactorWireMethod(method),
|
|
106
164
|
rememberMe: "true"
|
|
107
165
|
});
|
|
108
166
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
167
|
+
/** The challenge `token` stands for, as the gate shows it. */
|
|
168
|
+
twoFactorChallenge(token) {
|
|
169
|
+
return this.challenges.get(token);
|
|
170
|
+
}
|
|
171
|
+
/** Re-sends the 2FA code via `method` (default: the challenge's current one) — the same call
|
|
172
|
+
* switches to another method; `VoiceCall` asks for the Phone code by a call. Resolves to the
|
|
173
|
+
* new challenge (every send issues a new token), or undefined when the server named none.
|
|
174
|
+
* Rejects when the server refused to send: a failed resend must not read as "a new code was sent". */
|
|
175
|
+
async resendTwoFactor(token, method) {
|
|
176
|
+
const previous = this.challenges.get(token);
|
|
177
|
+
const requested = method ?? previous?.method ?? "";
|
|
178
|
+
if (this.devMode) {
|
|
179
|
+
const requested2 = method ?? previous?.method ?? "sms";
|
|
180
|
+
const phone = isPhoneMethod(twoFactorWireMethod(requested2));
|
|
181
|
+
const next2 = shapeTwoFactorChallenge({
|
|
182
|
+
twoFAToken: token,
|
|
183
|
+
currentTwoFAMethod: twoFactorWireMethod(requested2),
|
|
184
|
+
...phone ? { phoneHint: "\u2022\u2022\u2022-\u2022\u2022\u2022-\u2022\u202234" } : requested2.toLowerCase() === "email" ? { twoFAHint: "2f\u2022\u2022\u2022@himalaya.dev" } : {}
|
|
185
|
+
}, requested2, previous);
|
|
186
|
+
this.challenges.set(token, next2);
|
|
187
|
+
return next2;
|
|
188
|
+
}
|
|
189
|
+
const json = await this.rawPost(
|
|
190
|
+
"/auth/m/resend2facode",
|
|
191
|
+
requested ? twoFactorResendForm(token, requested, previous) : { twoFAToken: token }
|
|
192
|
+
);
|
|
193
|
+
if (json.success !== true) {
|
|
194
|
+
throw legacyTwoFactorFailure(json.errorCode) ?? new NativeAuthError("unknown", "Something went wrong. Please try again.");
|
|
195
|
+
}
|
|
196
|
+
const payload = json.payload ?? json;
|
|
197
|
+
if (typeof payload.twoFAToken !== "string" || !payload.twoFAToken) return void 0;
|
|
198
|
+
const next = shapeTwoFactorChallenge(payload, requested, previous);
|
|
199
|
+
this.challenges.set(next.token, next);
|
|
200
|
+
return next;
|
|
112
201
|
}
|
|
113
202
|
async sendPasswordReset(email) {
|
|
114
203
|
if (this.devMode) return;
|
|
@@ -127,7 +216,21 @@ var WixNativeAuthEngine = class {
|
|
|
127
216
|
* the account session (uaToken) + sets wixSession2/XSRF cookies. 2FA via the
|
|
128
217
|
* payload.twoFAToken handshake. Register is captcha-gated (errorCode 9981). */
|
|
129
218
|
async ownerSignIn(email, password) {
|
|
130
|
-
if (this.devMode)
|
|
219
|
+
if (this.devMode) {
|
|
220
|
+
try {
|
|
221
|
+
return devSignIn(email, password);
|
|
222
|
+
} catch (e) {
|
|
223
|
+
if (!(e instanceof NativeAuthError) || e.kind !== "needsTwoFactor" || !e.twoFAToken) throw e;
|
|
224
|
+
const c = shapeTwoFactorChallenge({
|
|
225
|
+
twoFAToken: e.twoFAToken,
|
|
226
|
+
currentTwoFAMethod: e.twoFAMethod,
|
|
227
|
+
enabledTwoFAMethods: e.twoFAMethods,
|
|
228
|
+
phoneHint: "\u2022\u2022\u2022-\u2022\u2022\u2022-\u2022\u202234"
|
|
229
|
+
}, e.twoFAMethod ?? "sms");
|
|
230
|
+
this.challenges.set(c.token, c);
|
|
231
|
+
throw new NativeAuthError("needsTwoFactor", e.message, c.token, c.method, c.methods, void 0, c.hint);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
131
234
|
const form = `email=${encodeURIComponent(email)}&password=${encodeURIComponent(password)}&accept=json` + (this.petriOverrides ? `&petri_ovr=${encodeURIComponent(this.petriOverrides)}` : "");
|
|
132
235
|
const res = await this.fetchImpl("https://users.wix.com/wix-users/auth/m/login", {
|
|
133
236
|
method: "POST",
|
|
@@ -137,21 +240,25 @@ var WixNativeAuthEngine = class {
|
|
|
137
240
|
const json = await res.json();
|
|
138
241
|
const payload = json.payload ?? {};
|
|
139
242
|
if (payload.twoFAToken && json.success !== true) {
|
|
140
|
-
const current = payload.currentTwoFAMethod ?? "sms";
|
|
141
|
-
const
|
|
243
|
+
const current = nonBlank(payload.currentTwoFAMethod) ?? "sms";
|
|
244
|
+
const c = shapeTwoFactorChallenge(payload, current);
|
|
245
|
+
this.challenges.set(c.token, c);
|
|
142
246
|
const id = payload.verificationId;
|
|
143
247
|
const verificationId = (typeof id === "string" || typeof id === "number") && /^\d+$/.test(String(id)) ? String(id) : void 0;
|
|
144
248
|
throw new NativeAuthError(
|
|
145
249
|
"needsTwoFactor",
|
|
146
250
|
"Two-factor verification required.",
|
|
147
251
|
payload.twoFAToken,
|
|
148
|
-
|
|
149
|
-
methods,
|
|
150
|
-
verificationId
|
|
252
|
+
c.method,
|
|
253
|
+
c.methods,
|
|
254
|
+
verificationId,
|
|
255
|
+
c.hint
|
|
151
256
|
);
|
|
152
257
|
}
|
|
153
258
|
if (json.success !== true || !payload.guid) {
|
|
154
259
|
if (json.errorCode === 9981) throw new NativeAuthError("recaptchaRequired", "Additional verification is required.");
|
|
260
|
+
const twoFactor = legacyTwoFactorFailure(json.errorCode);
|
|
261
|
+
if (twoFactor) throw twoFactor;
|
|
155
262
|
throw new NativeAuthError("invalidCredentials", "Wrong email or password.");
|
|
156
263
|
}
|
|
157
264
|
return {
|
|
@@ -222,15 +329,21 @@ var WixNativeAuthEngine = class {
|
|
|
222
329
|
async postSignIn(path, body) {
|
|
223
330
|
const json = await this.rawPost(path, body);
|
|
224
331
|
if (typeof json.twoFAToken === "string" && json.twoFAToken) {
|
|
332
|
+
const method = json.twoFAMethod ?? "sms";
|
|
333
|
+
const c = shapeTwoFactorChallenge({ ...json, currentTwoFAMethod: json.currentTwoFAMethod ?? method }, method);
|
|
334
|
+
this.challenges.set(c.token, c);
|
|
225
335
|
throw new NativeAuthError(
|
|
226
336
|
"needsTwoFactor",
|
|
227
337
|
"Two-factor verification required.",
|
|
228
338
|
json.twoFAToken,
|
|
229
|
-
|
|
339
|
+
c.method,
|
|
340
|
+
c.methods,
|
|
341
|
+
c.verificationId,
|
|
342
|
+
c.hint
|
|
230
343
|
);
|
|
231
344
|
}
|
|
232
345
|
if (typeof json.errorCode === "number" && json.errorCode !== 0) {
|
|
233
|
-
throw mapErrorCode(json.errorCode, json.errorDescription);
|
|
346
|
+
throw legacyTwoFactorFailure(json.errorCode) ?? mapErrorCode(json.errorCode, json.errorDescription);
|
|
234
347
|
}
|
|
235
348
|
const payload = json.payload ?? json;
|
|
236
349
|
const access = payload.accessToken ?? payload.wixAT;
|
|
@@ -275,6 +388,13 @@ function mapErrorCode(code, description) {
|
|
|
275
388
|
case -15007:
|
|
276
389
|
case 1:
|
|
277
390
|
return new NativeAuthError("invalidCredentials", description || "Wrong email or password.");
|
|
391
|
+
// A wrong 2FA code (legacyTwoFactorFailure leaves these to the credential path): the gate
|
|
392
|
+
// words invalidCredentials on a verify as a bad code. Mirrors the Swift/Kotlin engines.
|
|
393
|
+
case 8001:
|
|
394
|
+
case 8005:
|
|
395
|
+
case 8006:
|
|
396
|
+
case 8008:
|
|
397
|
+
return new NativeAuthError("invalidCredentials", description || "That code isn't right.");
|
|
278
398
|
case 8051:
|
|
279
399
|
return new NativeAuthError("unknown", description || "This domain is blocked.");
|
|
280
400
|
default:
|
|
@@ -1299,6 +1419,7 @@ export {
|
|
|
1299
1419
|
SessionIDService,
|
|
1300
1420
|
SignedInstanceError,
|
|
1301
1421
|
SignedInstanceResolver,
|
|
1422
|
+
VOICE_CALL_METHOD,
|
|
1302
1423
|
WIX_SENSITIVE_KEYS,
|
|
1303
1424
|
WIX_SESSION3_SOFT_INIT_SPEC,
|
|
1304
1425
|
WixAuthModalities,
|
|
@@ -1329,6 +1450,7 @@ export {
|
|
|
1329
1450
|
isSensitiveKey,
|
|
1330
1451
|
isSignedInstanceExpired,
|
|
1331
1452
|
isSignedUploadTarget,
|
|
1453
|
+
legacyTwoFactorFailure,
|
|
1332
1454
|
localDayIndex,
|
|
1333
1455
|
normalizeKey,
|
|
1334
1456
|
parseDeviceQr,
|
|
@@ -1338,7 +1460,11 @@ export {
|
|
|
1338
1460
|
redactCookieString,
|
|
1339
1461
|
redactJson,
|
|
1340
1462
|
redactHeaders as redactWixHeaders,
|
|
1463
|
+
shapeTwoFactorChallenge,
|
|
1341
1464
|
shouldEscalateCaptcha,
|
|
1465
|
+
twoFactorGateMethods,
|
|
1466
|
+
twoFactorResendForm,
|
|
1467
|
+
twoFactorWireMethod,
|
|
1342
1468
|
policyFor as wixRequestPolicy
|
|
1343
1469
|
};
|
|
1344
1470
|
//# sourceMappingURL=wix-auth.mjs.map
|