@wix/himalaya-cli 0.1399.0 → 0.1401.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.
Files changed (36) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +2 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/wix-chat/src/index.d.ts +33 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +8 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/auth-modalities.d.ts +13 -2
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +11 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/native-engine.d.ts +7 -1
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/copy.generated.d.ts +5 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +66 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/site-media/src/index.d.ts +8 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +2 -1
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +5 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +2 -1
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +2 -1
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +2 -1
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +2 -1
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +2 -1
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +2 -1
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +5 -0
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +2 -1
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +2 -1
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth/worker.mjs +62 -12
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +69 -12
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-chat.mjs +56 -0
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +45 -1
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-site-media.mjs +17 -0
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
  28. package/dist/cli.mjs +58 -34
  29. package/dist/preview-assets.generated.bin +0 -0
  30. package/guides/app-config.md +1 -1
  31. package/guides/capabilities.md +5 -0
  32. package/guides/importable-sdks.md +1 -0
  33. package/guides/sdk-reference.json +163 -0
  34. package/guides/web-page-sdk-reference.md +1 -0
  35. package/guides/wix-login-integration.md +42 -0
  36. package/package.json +2 -2
@@ -39,9 +39,10 @@ export declare const CAPABILITY_REGISTRY: {
39
39
  readonly theme: readonly ["applyOverlay", "clearOverlay", "surfaces"];
40
40
  readonly ui: readonly ["alert", "snackbar"];
41
41
  readonly wix_cashier: readonly ["isAvailable", "proceedToPayment"];
42
+ readonly wix_chat: readonly ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"];
42
43
  };
43
44
  /** A capability id backed by an @himalaya/* SDK binding. */
44
- export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "ui" | "wix_cashier";
45
+ export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "ui" | "wix_cashier" | "wix_chat";
45
46
  /** All `capability.<id>.<verb>` action ids, flattened (the worker-bridge wire vocabulary). */
46
47
  export declare const CAPABILITY_ACTION_IDS: readonly string[];
47
48
  /** Capability id → the @himalaya/* package(s) a worker imports to reach it — every dispatch
@@ -37,6 +37,7 @@ import type * as TasksSdk from "@wix/himalaya/tasks";
37
37
  import type * as ThemeSdk from "@wix/himalaya/theme";
38
38
  import type * as UiSdk from "@wix/himalaya/ui";
39
39
  import type * as WixCashierSdk from "@wix/himalaya/wix-cashier";
40
+ import type * as WixChatSdk from "@wix/himalaya/wix-chat";
40
41
  type PageModule<T> = {
41
42
  readonly [P in keyof T as T[P] extends (...args: any[]) => any ? P : T[P] extends readonly unknown[] ? never : T[P] extends object ? keyof PageModule<T[P]> extends never ? never : P : never]: T[P] extends (...args: infer A) => infer R ? (...args: A) => R : T[P] extends readonly unknown[] ? never : T[P] extends object ? PageModule<T[P]> : never;
42
43
  };
@@ -83,6 +84,7 @@ export interface HimalayaPageCapabilities {
83
84
  readonly "theme": PageModule<typeof ThemeSdk>;
84
85
  readonly "ui": PageModule<typeof UiSdk>;
85
86
  readonly "wix_cashier": PageModule<typeof WixCashierSdk>;
87
+ readonly "wix_chat": PageModule<typeof WixChatSdk>;
86
88
  }
87
89
  export type HimalayaPageSdk = HimalayaPageCapabilities & {
88
90
  readonly version: 1;
@@ -0,0 +1,33 @@
1
+ export type RealtimeState = "connected" | "connecting" | "reconnecting" | "disconnected" | "error" | "unavailable";
2
+ export type RealtimeReason = "chat_setup_scope_unavailable" | "runtime_unavailable" | "invalid_setup_response" | "firebase_auth_failed" | "firebase_connection_failed" | "invalid_event" | "event_overflow";
3
+ export interface RealtimeStatus {
4
+ state: RealtimeState;
5
+ reason?: RealtimeReason;
6
+ }
7
+ export interface RealtimeSubscription extends RealtimeStatus {
8
+ subscriptionId: string;
9
+ }
10
+ export interface RealtimeEventEnvelope {
11
+ /** A normalized Wix Chat server event from Firebase. */
12
+ event: Record<string, unknown>;
13
+ /** Firebase server timestamp sampled when the subscription was established. */
14
+ connectionEstablishedTimestamp: number;
15
+ }
16
+ /** Subscribe this worker to Wix Chat realtime events. Reducers receive one
17
+ * {@link RealtimeEventEnvelope}; status reducers receive {@link RealtimeStatus}.
18
+ * A new subscription replaces the worker's prior subscription, and worker disposal
19
+ * always closes the host stream. The returned identifier is opaque and worker-local. */
20
+ export declare function subscribeRealtime(opts: {
21
+ onEvent: string;
22
+ onStatus?: string;
23
+ }): Promise<RealtimeSubscription>;
24
+ /** Stop this worker's subscription. Returns `ok: false` for an unknown or stale ID. */
25
+ export declare function unsubscribeRealtime(opts: {
26
+ subscriptionId: string;
27
+ }): Promise<{
28
+ ok: boolean;
29
+ }>;
30
+ /** Read the latest host connection status for a worker-local subscription ID. */
31
+ export declare function getRealtimeStatus(opts: {
32
+ subscriptionId: string;
33
+ }): Promise<RealtimeStatus>;
@@ -515,6 +515,13 @@ export interface NotificationCategoryAction {
515
515
  /** When true the action opens a text input (reply-style). */
516
516
  input?: boolean;
517
517
  inputPlaceholder?: string;
518
+ /** When true a press on a LOCKED device asks for unlock (Face ID / passcode / PIN)
519
+ * before it reaches `observerAction` — set it on any action that writes (accept,
520
+ * decline, delete). iOS `UNNotificationActionOptions.authenticationRequired`;
521
+ * Android `setAuthenticationRequired` (API 31+). Android 8–11 (API 26–30) has no
522
+ * per-action gate, so it fails CLOSED there: the flagged button is omitted, while the
523
+ * notification and its tap-to-open stay. */
524
+ authenticationRequired?: boolean;
518
525
  }
519
526
  /** A notification category — a named set of action buttons. */
520
527
  export interface NotificationCategory {
@@ -747,7 +754,7 @@ export interface OrientationEnvelope {
747
754
  export declare const DEFAULT_ORIENTATION_ENVELOPE: Required<OrientationEnvelope>;
748
755
  /** Fill in the absent families. Total, so callers never branch on `undefined`. */
749
756
  export declare function resolveOrientationEnvelope(env?: OrientationEnvelope): Required<OrientationEnvelope>;
750
- export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "wix_cashier" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
757
+ export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "wix_cashier" | "wix_chat" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
751
758
  /** `defineApp({ wixIap })` — the purchases-service app a build binds this app to. */
752
759
  export interface WixIapConfig {
753
760
  /** The purchases service's app UUID, registered on the app's own auth site. Not a secret. */
@@ -7,6 +7,8 @@ export declare function classifyAuthErrorCode(code: number): {
7
7
  export type PushApprovalState = "approved" | "pending" | "denied" | "expired";
8
8
  export interface AuthModalitiesConfig {
9
9
  baseURL?: string;
10
+ /** Host of the Verification v1 API the push-approval poll reads (#4309). */
11
+ verificationBaseURL?: string;
10
12
  fetchImpl?: typeof fetch;
11
13
  now?: () => number;
12
14
  sleep?: (ms: number) => Promise<void>;
@@ -14,6 +16,7 @@ export interface AuthModalitiesConfig {
14
16
  }
15
17
  export declare class WixAuthModalities {
16
18
  private readonly baseURL;
19
+ private readonly verificationBaseURL;
17
20
  private readonly fetchImpl;
18
21
  private readonly sleep;
19
22
  private readonly devMode;
@@ -26,8 +29,16 @@ export declare class WixAuthModalities {
26
29
  /** Complete a magic-link login from the token in the opened link. */
27
30
  verifyMagicLink(token: string): Promise<WixAccountSession>;
28
31
  /** Push-based 2FA: poll for the user's approval on their trusted device. Loops
29
- * until approved/denied/expired or `maxPolls` is hit. */
30
- pollPushApproval(twoFAToken: string, opts?: {
32
+ * until approved/denied/expired or `maxPolls` is hit (default 60 × 5s = 5 minutes).
33
+ *
34
+ * #4309 — the wire Wix's own native client uses (mobile-native-core LegacyTwoFactor), and
35
+ * the one the native WixNativeAuthEngine polls: Verification v1 GetChallenge,
36
+ * `GET manage.wix.com/_api/verification-web/v1/challenges/get-challenge?verificationId=…`,
37
+ * keyed by the 2FA payload's `verificationId` (digits; `NativeAuthError.verificationId` on the
38
+ * needsTwoFactor challenge — not its `twoFAToken`). After "approved" the caller completes
39
+ * the login with ONE `/auth/m/verifycodeandlogin` carrying an empty code. The old
40
+ * `/auth/m/push2fa/status` route was never Wix's. */
41
+ pollPushApproval(verificationId: string, opts?: {
31
42
  intervalMs?: number;
32
43
  maxPolls?: number;
33
44
  }): Promise<PushApprovalState>;
@@ -91,8 +91,18 @@ export interface WixNativeAuthConfig {
91
91
  /** App URL scheme registered in the client's allowed redirect URIs — used by
92
92
  * the (no-UI) sessionToken → member-token PKCE exchange. */
93
93
  redirectUri?: string;
94
- /** Federated providers to surface on the form. */
94
+ /** Federated providers to surface on the form. The app shows only the ones that can run on
95
+ * the platform (#4309): Apple on iOS, Google once its module is linked and `google` names a
96
+ * client id. */
95
97
  social?: SocialAuthProvider[];
98
+ /** Google OAuth client ids for "Continue with Google" (#4309). iOS registers `iosClientId`
99
+ * (with its reversed-id URL scheme in Info.plist); Android asks Credential Manager for a token
100
+ * for `serverClientId`, the WEB client Wix's `/oneapp/social/sign-in/google` accepts. Absent →
101
+ * the Google button is hidden on that platform. Baked into auth.json. */
102
+ google?: {
103
+ iosClientId?: string;
104
+ serverClientId?: string;
105
+ };
96
106
  /** Override the Wix API host (staging). Default: https://www.wixapis.com. */
97
107
  apiBase?: string;
98
108
  /** PerimeterX automation token — one-app `x-px-access-token` captcha bypass for
@@ -27,9 +27,15 @@ export declare class NativeAuthError extends Error {
27
27
  readonly twoFAMethod?: string;
28
28
  /** Every enabled 2FA method (drives the picker when >1). */
29
29
  readonly twoFAMethods?: string[];
30
+ /** #4309 — the push challenge's id (digits), when the payload carried one: what
31
+ * `WixAuthModalities.pollPushApproval` polls. */
32
+ readonly verificationId?: string;
30
33
  constructor(kind: NativeAuthErrorKind, message: string, twoFAToken?: string, twoFAMethod?: string,
31
34
  /** Every enabled 2FA method (drives the picker when >1). */
32
- twoFAMethods?: string[]);
35
+ twoFAMethods?: string[],
36
+ /** #4309 — the push challenge's id (digits), when the payload carried one: what
37
+ * `WixAuthModalities.pollPushApproval` polls. */
38
+ verificationId?: string);
33
39
  }
34
40
  export interface WixNativeAuthEngineConfig {
35
41
  baseURL?: string;
@@ -14,6 +14,8 @@ declare const _default: {
14
14
  readonly "auth.gate.sendCodeVia": "Send code via";
15
15
  readonly "auth.gate.resendCode": "Didn't get it? Resend code";
16
16
  readonly "auth.gate.field.code": "Verification code";
17
+ readonly "auth.gate.pushWaiting": "Approve the sign-in on your other device.";
18
+ readonly "auth.gate.pushResend": "Send a new request";
17
19
  readonly "auth.gate.field.email": "Email";
18
20
  readonly "auth.gate.field.name": "Name";
19
21
  readonly "auth.gate.field.password": "Password";
@@ -58,6 +60,9 @@ declare const _default: {
58
60
  readonly "auth.error.registrationFailed": "Registration failed ({code}).";
59
61
  readonly "auth.error.twoFactorRequired": "Two-factor verification required.";
60
62
  readonly "auth.error.noPendingVerification": "No pending verification.";
63
+ readonly "auth.error.pushDeclined": "The sign-in was declined on your other device.";
64
+ readonly "auth.error.pushExpired": "The approval request expired. Send a new one or choose another method.";
65
+ readonly "auth.error.pushUnavailable": "Push approval isn't available. Choose another method.";
61
66
  readonly "auth.error.verificationCancelled": "Verification cancelled.";
62
67
  readonly "auth.error.biometricSignInFirst": "Sign in before enabling biometric unlock.";
63
68
  readonly "auth.error.noSessionToProtect": "No session to protect.";
@@ -67,11 +67,77 @@ export interface WixQueryMembersResponse {
67
67
  export interface WixGetMemberResponse {
68
68
  member: WixMember;
69
69
  }
70
+ export interface WixGetMyMemberResponse {
71
+ member: WixMember;
72
+ }
73
+ export interface WixUpdateMemberRequest {
74
+ member: Partial<WixMember>;
75
+ }
76
+ export interface WixUpdateMemberResponse {
77
+ member: WixMember;
78
+ }
79
+ export interface WixDeleteMemberPhonesResponse {
80
+ member?: WixMember;
81
+ }
82
+ export interface WixListCurrentMemberBlockingRequest {
83
+ cursorPaging?: {
84
+ limit?: number;
85
+ cursor?: string;
86
+ };
87
+ }
88
+ export interface WixListCurrentMemberBlockingResponse {
89
+ blockedMemberIds?: string[];
90
+ pagingMetadata?: {
91
+ cursors?: {
92
+ next?: string;
93
+ prev?: string;
94
+ };
95
+ count?: number;
96
+ total?: number;
97
+ tooManyToCount?: boolean;
98
+ };
99
+ }
70
100
  /** List site members — POST /members/v1/members/query. Pass `{ query: { paging: { limit, offset? } } }`
71
101
  * (offset paging). Do not pass `cursorPaging` — that is a different Wix envelope and is not on this type. */
72
102
  export declare function queryMembers(req?: WixQueryMembersRequest): Promise<WixQueryMembersResponse>;
73
103
  /** Fetch a single member by id — GET /members/v1/members/{id}?fieldsets=FULL. */
74
104
  export declare function getMember(id: string): Promise<WixGetMemberResponse>;
105
+ /** Fetch the currently authenticated member — member-scoped, unlike the owner roster query.
106
+ * @scope member — requires the signed-in site-member identity; an anonymous visitor cannot read this record.
107
+ */
108
+ export declare function getMyMember(req?: {
109
+ fieldsets?: string[];
110
+ }): Promise<WixGetMyMemberResponse>;
111
+ /** Update a member record. Callers that serve members must pass the authenticated member's id.
112
+ * @scope member — the id must identify the signed-in member; mismatches are rejected by Wix authorization.
113
+ */
114
+ export declare function updateMember(id: string, req: WixUpdateMemberRequest): Promise<WixUpdateMemberResponse>;
115
+ /** Change the signed-in member's own public profile slug.
116
+ * @scope member — requires a signed-in site member; the operation applies only to that member's slug.
117
+ */
118
+ export declare function updateMySlug(req: {
119
+ slug: string;
120
+ }): Promise<WixUpdateMemberResponse>;
121
+ /** List IDs blocked by the authenticated member — member-owned social blocks, not site moderation.
122
+ * @scope member — requires a signed-in site member; an empty list means the member has no blocked members.
123
+ */
124
+ export declare function listCurrentMemberBlocking(req?: WixListCurrentMemberBlockingRequest): Promise<WixListCurrentMemberBlockingResponse>;
125
+ /** Remove one member from the authenticated member's own block list.
126
+ * @scope member — requires a signed-in site member; Wix applies the change to that member's block list.
127
+ */
128
+ export declare function unblockCurrentMember(memberId: string): Promise<Record<string, never>>;
129
+ /** Delete every stored contact phone from a member's own profile. The API has no per-phone delete.
130
+ * @scope member — id must be the signed-in member; this endpoint clears all phone numbers on that profile.
131
+ */
132
+ export declare function deleteMemberPhones(id: string): Promise<WixDeleteMemberPhonesResponse>;
133
+ /** Leave the Wix Members Area community. Wix changes the member to PRIVATE.
134
+ * @scope member — requires a signed-in member; this removes that member from the public Members Area community.
135
+ */
136
+ export declare function leaveCommunity(): Promise<WixUpdateMemberResponse>;
137
+ /** Join the Wix Members Area community. Wix changes the member to PUBLIC.
138
+ * @scope member — requires a signed-in member; this makes that member's Members Area profile public.
139
+ */
140
+ export declare function joinCommunity(): Promise<WixUpdateMemberResponse>;
75
141
  /** Approve a member — POST /members/v1/members/{id}/approve. Reactivates BOTH a
76
142
  * PENDING member and a BLOCKED one (verified live: approve on a blocked member →
77
143
  * 200, status APPROVED). There is NO separate `/unblock` endpoint — it 404s; the
@@ -25,4 +25,12 @@ export interface GenerateUploadUrlResponse {
25
25
  * POST /site-media/v1/files/generate-upload-url → { uploadUrl, … }.
26
26
  * Caller PUTs the bytes to `uploadUrl`, then uses the returned file id. */
27
27
  export declare function generateUploadUrl(mimeType: string, fileName: string, parentFolderId?: string): Promise<GenerateUploadUrlResponse>;
28
+ /** Ask a site-owned Velo HTTP function for a member-authorized photo upload URL.
29
+ * The backend function must independently bind the request to its authenticated
30
+ * member and return `{ uploadUrl }`; this helper does not add credentials or
31
+ * bypass the host's current Wix identity.
32
+ * @scope member — requires a signed-in member and a configured site function that verifies the current member;
33
+ * the returned URL is for upload only and does not itself update the member profile.
34
+ */
35
+ export declare function generateMemberPhotoUploadUrl(functionName: string, mimeType: string, fileName: string): Promise<GenerateUploadUrlResponse>;
28
36
  export { wixCall };
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -129,6 +129,8 @@ var copy_generated_default = {
129
129
  "auth.gate.sendCodeVia": "Send code via",
130
130
  "auth.gate.resendCode": "Didn't get it? Resend code",
131
131
  "auth.gate.field.code": "Verification code",
132
+ "auth.gate.pushWaiting": "Approve the sign-in on your other device.",
133
+ "auth.gate.pushResend": "Send a new request",
132
134
  "auth.gate.field.email": "Email",
133
135
  "auth.gate.field.name": "Name",
134
136
  "auth.gate.field.password": "Password",
@@ -173,6 +175,9 @@ var copy_generated_default = {
173
175
  "auth.error.registrationFailed": "Registration failed ({code}).",
174
176
  "auth.error.twoFactorRequired": "Two-factor verification required.",
175
177
  "auth.error.noPendingVerification": "No pending verification.",
178
+ "auth.error.pushDeclined": "The sign-in was declined on your other device.",
179
+ "auth.error.pushExpired": "The approval request expired. Send a new one or choose another method.",
180
+ "auth.error.pushUnavailable": "Push approval isn't available. Choose another method.",
176
181
  "auth.error.verificationCancelled": "Verification cancelled.",
177
182
  "auth.error.biometricSignInFirst": "Sign in before enabling biometric unlock.",
178
183
  "auth.error.noSessionToProtect": "No session to protect.",
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -140,6 +140,8 @@ var copy_generated_default = {
140
140
  "auth.gate.sendCodeVia": "Send code via",
141
141
  "auth.gate.resendCode": "Didn't get it? Resend code",
142
142
  "auth.gate.field.code": "Verification code",
143
+ "auth.gate.pushWaiting": "Approve the sign-in on your other device.",
144
+ "auth.gate.pushResend": "Send a new request",
143
145
  "auth.gate.field.email": "Email",
144
146
  "auth.gate.field.name": "Name",
145
147
  "auth.gate.field.password": "Password",
@@ -184,6 +186,9 @@ var copy_generated_default = {
184
186
  "auth.error.registrationFailed": "Registration failed ({code}).",
185
187
  "auth.error.twoFactorRequired": "Two-factor verification required.",
186
188
  "auth.error.noPendingVerification": "No pending verification.",
189
+ "auth.error.pushDeclined": "The sign-in was declined on your other device.",
190
+ "auth.error.pushExpired": "The approval request expired. Send a new one or choose another method.",
191
+ "auth.error.pushUnavailable": "Push approval isn't available. Choose another method.",
187
192
  "auth.error.verificationCancelled": "Verification cancelled.",
188
193
  "auth.error.biometricSignInFirst": "Sign in before enabling biometric unlock.",
189
194
  "auth.error.noSessionToProtect": "No session to protect.",
@@ -38,7 +38,8 @@ var CAPABILITY_REGISTRY = {
38
38
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
39
39
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
40
40
  "ui": ["alert", "snackbar"],
41
- "wix_cashier": ["isAvailable", "proceedToPayment"]
41
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
42
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
42
43
  };
43
44
  var CAPABILITY_ACTION_IDS = Object.freeze(
44
45
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -53,7 +53,8 @@ var CAPABILITY_REGISTRY = {
53
53
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
54
54
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
55
55
  "ui": ["alert", "snackbar"],
56
- "wix_cashier": ["isAvailable", "proceedToPayment"]
56
+ "wix_cashier": ["isAvailable", "proceedToPayment"],
57
+ "wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
57
58
  };
58
59
  var CAPABILITY_ACTION_IDS = Object.freeze(
59
60
  Object.entries(CAPABILITY_REGISTRY).flatMap(([id, verbs]) => verbs.map((v) => `capability.${id}.${v}`))
@@ -167,12 +167,13 @@ 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) {
170
+ constructor(kind, message, twoFAToken, twoFAMethod, twoFAMethods, verificationId) {
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
+ this.verificationId = verificationId;
176
177
  this.name = "NativeAuthError";
177
178
  }
178
179
  };
@@ -270,12 +271,15 @@ var WixNativeAuthEngine = class {
270
271
  if (payload.twoFAToken && json.success !== true) {
271
272
  const current = payload.currentTwoFAMethod ?? "sms";
272
273
  const methods = payload.enabledTwoFAMethods ?? [current];
274
+ const id = payload.verificationId;
275
+ const verificationId = (typeof id === "string" || typeof id === "number") && /^\d+$/.test(String(id)) ? String(id) : void 0;
273
276
  throw new NativeAuthError(
274
277
  "needsTwoFactor",
275
278
  "Two-factor verification required.",
276
279
  payload.twoFAToken,
277
280
  current,
278
- methods
281
+ methods,
282
+ verificationId
279
283
  );
280
284
  }
281
285
  if (json.success !== true || !payload.guid) {
@@ -472,10 +476,12 @@ function classifyAuthErrorCode(code) {
472
476
  var WixAuthModalities = class {
473
477
  constructor(config = {}) {
474
478
  __publicField(this, "baseURL");
479
+ __publicField(this, "verificationBaseURL");
475
480
  __publicField(this, "fetchImpl");
476
481
  __publicField(this, "sleep");
477
482
  __publicField(this, "devMode");
478
483
  this.baseURL = config.baseURL ?? "https://users.wix.com";
484
+ this.verificationBaseURL = config.verificationBaseURL ?? "https://manage.wix.com";
479
485
  this.fetchImpl = config.fetchImpl ?? globalThis.fetch;
480
486
  this.sleep = config.sleep ?? engineSleep("WixAuthModalities");
481
487
  this.devMode = config.devMode ?? false;
@@ -500,25 +506,60 @@ var WixAuthModalities = class {
500
506
  return { userId: p.guid ?? "", email: p.email ?? "", accessToken: access, refreshToken: p.wixSession2 ?? "" };
501
507
  }
502
508
  /** Push-based 2FA: poll for the user's approval on their trusted device. Loops
503
- * until approved/denied/expired or `maxPolls` is hit. */
504
- async pollPushApproval(twoFAToken, opts = {}) {
505
- const interval = opts.intervalMs ?? 3e3;
506
- const maxPolls = opts.maxPolls ?? 20;
509
+ * until approved/denied/expired or `maxPolls` is hit (default 60 × 5s = 5 minutes).
510
+ *
511
+ * #4309 — the wire Wix's own native client uses (mobile-native-core LegacyTwoFactor), and
512
+ * the one the native WixNativeAuthEngine polls: Verification v1 GetChallenge,
513
+ * `GET manage.wix.com/_api/verification-web/v1/challenges/get-challenge?verificationId=…`,
514
+ * keyed by the 2FA payload's `verificationId` (digits; `NativeAuthError.verificationId` on the
515
+ * needsTwoFactor challenge — not its `twoFAToken`). After "approved" the caller completes
516
+ * the login with ONE `/auth/m/verifycodeandlogin` carrying an empty code. The old
517
+ * `/auth/m/push2fa/status` route was never Wix's. */
518
+ async pollPushApproval(verificationId, opts = {}) {
519
+ const interval = opts.intervalMs ?? 5e3;
520
+ const maxPolls = opts.maxPolls ?? 60;
521
+ if (!this.devMode && !/^\d+$/.test(verificationId)) {
522
+ throw new NativeAuthError("unknown", "Push approval isn't available. Choose another method.");
523
+ }
507
524
  for (let i = 0; i < maxPolls; i++) {
508
- const state = await this.pushStatusOnce(twoFAToken, i);
525
+ const state = await this.pushStatusOnce(verificationId, i);
509
526
  if (state !== "pending") return state;
510
527
  await this.sleep(interval);
511
528
  }
512
529
  return "expired";
513
530
  }
514
- async pushStatusOnce(twoFAToken, poll) {
531
+ async pushStatusOnce(verificationId, poll) {
515
532
  if (this.devMode) {
516
- if (twoFAToken === "deny") return "denied";
533
+ if (verificationId === "deny") return "denied";
517
534
  return poll >= 1 ? "approved" : "pending";
518
535
  }
519
- const j = await this.post("/auth/m/push2fa/status", { twoFAToken });
520
- const s = j.status ?? "pending";
521
- return ["approved", "pending", "denied", "expired"].includes(s) ? s : "pending";
536
+ let res;
537
+ try {
538
+ res = await this.fetchImpl(
539
+ `${this.verificationBaseURL}/_api/verification-web/v1/challenges/get-challenge?verificationId=${verificationId}`,
540
+ { method: "GET", headers: { Accept: "application/json" } }
541
+ );
542
+ } catch {
543
+ return "pending";
544
+ }
545
+ if (res.status === 404) return "expired";
546
+ if (!res.ok) return "pending";
547
+ let j = {};
548
+ try {
549
+ j = JSON.parse(await res.text());
550
+ } catch {
551
+ return "pending";
552
+ }
553
+ switch (j.challenge?.approvalChallenge?.status) {
554
+ case "APPROVED":
555
+ return "approved";
556
+ case "DECLINED":
557
+ return "denied";
558
+ case "EXPIRED":
559
+ return "expired";
560
+ default:
561
+ return "pending";
562
+ }
522
563
  }
523
564
  /** Device-login: approve a login started on another device (confirm-on-device). */
524
565
  async confirmDeviceLogin(userCode, authToken) {
@@ -718,6 +759,15 @@ var WIX_SENSITIVE_KEYS = [
718
759
  "setcookie",
719
760
  // captcha / passwords
720
761
  "password",
762
+ "currentpassword",
763
+ "newpassword",
764
+ "confirmpassword",
765
+ "oldpassword",
766
+ // T5 account-settings state uses passwordCurrent/passwordNew/passwordConfirm;
767
+ // redact those camel-case state keys too if state snapshots reach the gateway.
768
+ "passwordcurrent",
769
+ "passwordnew",
770
+ "passwordconfirm",
721
771
  "recaptcha",
722
772
  "recaptcharesponsefield",
723
773
  "pxaccesstoken"