@palbase/web 6.0.0 → 7.0.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 (37) hide show
  1. package/dist/{analytics-facade-Cp3d4QI-.d.ts → analytics-facade-CdTK9Y0s.d.ts} +42 -1
  2. package/dist/{analytics-facade-CaluA4bW.d.cts → analytics-facade-TB-D4ww8.d.cts} +42 -1
  3. package/dist/{chunk-KOJ4OAAR.js → chunk-7SNSLY5M.js} +20 -3
  4. package/dist/chunk-7SNSLY5M.js.map +1 -0
  5. package/dist/{chunk-BNAGRUIQ.js → chunk-ACCJV6FV.js} +32 -2
  6. package/dist/chunk-ACCJV6FV.js.map +1 -0
  7. package/dist/{chunk-OWLTZG2V.js → chunk-ZC6Q3GPX.js} +2 -2
  8. package/dist/index.cjs +18 -1
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +3 -3
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +2 -2
  13. package/dist/internal.cjs +49 -2
  14. package/dist/internal.cjs.map +1 -1
  15. package/dist/internal.d.cts +3 -3
  16. package/dist/internal.d.ts +3 -3
  17. package/dist/internal.js +2 -2
  18. package/dist/next/client.cjs +49 -2
  19. package/dist/next/client.cjs.map +1 -1
  20. package/dist/next/client.js +2 -2
  21. package/dist/next/index.cjs +49 -2
  22. package/dist/next/index.cjs.map +1 -1
  23. package/dist/next/index.d.cts +2 -2
  24. package/dist/next/index.d.ts +2 -2
  25. package/dist/next/index.js +3 -3
  26. package/dist/next/proxy.js +2 -2
  27. package/dist/{pb-DUK5qy81.d.ts → pb-B6ZcZy8v.d.ts} +1 -1
  28. package/dist/{pb-DvV6ftmf.d.cts → pb-CiSj4lM3.d.cts} +1 -1
  29. package/dist/react/index.cjs +1 -1
  30. package/dist/react/index.cjs.map +1 -1
  31. package/dist/react/index.d.cts +1 -1
  32. package/dist/react/index.d.ts +1 -1
  33. package/dist/react/index.js +2 -2
  34. package/package.json +2 -2
  35. package/dist/chunk-BNAGRUIQ.js.map +0 -1
  36. package/dist/chunk-KOJ4OAAR.js.map +0 -1
  37. /package/dist/{chunk-OWLTZG2V.js.map → chunk-ZC6Q3GPX.js.map} +0 -0
@@ -15,6 +15,15 @@ interface PalbaseResponse$1<T> {
15
15
  status: number;
16
16
  }
17
17
  interface HttpClientOptions$1 {
18
+ /**
19
+ * The host application's own version, sent as `X-Palbase-Client-Version` and
20
+ * readable in flag targeting as `client.app_version`.
21
+ *
22
+ * Opt-in because the SDK cannot discover it on the web — there is no bundle
23
+ * to read a version out of. iOS fills the same header automatically from
24
+ * CFBundleShortVersionString.
25
+ */
26
+ appVersion?: string;
18
27
  url?: string;
19
28
  headers?: Record<string, string>;
20
29
  }
@@ -104,6 +113,15 @@ interface PalbaseResponse<T> {
104
113
  status: number;
105
114
  }
106
115
  interface HttpClientOptions {
116
+ /**
117
+ * The host application's own version, sent as `X-Palbase-Client-Version` and
118
+ * readable in flag targeting as `client.app_version`.
119
+ *
120
+ * Opt-in because the SDK cannot discover it on the web — there is no bundle
121
+ * to read a version out of. iOS fills the same header automatically from
122
+ * CFBundleShortVersionString.
123
+ */
124
+ appVersion?: string;
107
125
  url?: string;
108
126
  headers?: Record<string, string>;
109
127
  }
@@ -1648,6 +1666,19 @@ interface AuthUser {
1648
1666
  emailVerified: boolean;
1649
1667
  createdAt: string;
1650
1668
  }
1669
+ /** What `pb.auth.getSignInMethods()` reports about an account's credentials. */
1670
+ interface SignInMethods {
1671
+ /** A local password exists — offer "change password", not "set password". */
1672
+ password: boolean;
1673
+ /** An MFA factor is enrolled. */
1674
+ mfa: boolean;
1675
+ /**
1676
+ * Linked OAuth providers, e.g. `['google']`. `[]` means none are linked;
1677
+ * `null` means the server could not determine it (social login is not
1678
+ * configured, or the lookup failed) — treat null as unknown, not as none.
1679
+ */
1680
+ providers: string[] | null;
1681
+ }
1651
1682
  interface AuthSuccess {
1652
1683
  user: AuthUser;
1653
1684
  session: Session$1;
@@ -1716,6 +1747,16 @@ declare class PalbeAuth {
1716
1747
  erasureId: string;
1717
1748
  }>;
1718
1749
  getUser(): Promise<AuthUser>;
1750
+ /**
1751
+ * Which credentials this account actually has.
1752
+ *
1753
+ * An account reached through Google has no password, so showing it a
1754
+ * "current password" field gives the user something they can never fill —
1755
+ * and `getUser()` cannot tell you, because GET /auth/user carries no
1756
+ * credential information. Read this before rendering any re-auth or
1757
+ * change-password form.
1758
+ */
1759
+ getSignInMethods(): Promise<SignInMethods>;
1719
1760
  refreshUser(): Promise<AuthUser>;
1720
1761
  /**
1721
1762
  * Restore the user after a session was rehydrated from storage (page reload).
@@ -1906,4 +1947,4 @@ declare class PalbeAnalytics {
1906
1947
  private post;
1907
1948
  }
1908
1949
 
1909
- export { type AuthUser as A, PalbeMessaging as B, Chat as C, type PalbeOAuthConfig as D, PalbeRealtime as E, type FlagsView as F, type PresenceState as G, RealtimeChannel as H, type RealtimeHandler as I, type RealtimeStatus as J, type RealtimeStatusSnapshot as K, type RealtimeSubscription as L, type MagicLinkResult as M, type NotifyScope as N, type OAuthExchangeResult as O, type PalbeConfig as P, type ResolvedMention as Q, type RealtimeConnectionState as R, type ResolvedReply as S, type SentReceipt as T, type UnreadView as U, type Unsubscribe as V, PalbePerf as W, type RealtimePayload as a, type ChatMember as b, type ChatMessage as c, type PalbeRuntime as d, buildRuntime as e, type AnalyticsProperties as f, type AuthChangeEvent as g, type AuthState as h, type AuthSuccess as i, Call as j, type CallChangeCallback as k, type CallParticipant as l, type CallState as m, type ChatBackend as n, type ChatDraft as o, type ChatKind as p, type ChatMessageKind as q, type ChatRole as r, type ChatState as s, type CommsPrefs as t, type MentionRange as u, type MessageDirection as v, PalbeAnalytics as w, PalbeAuth as x, PalbeCalls as y, PalbeFlags as z };
1950
+ export { type AuthUser as A, PalbeMessaging as B, Chat as C, type PalbeOAuthConfig as D, PalbeRealtime as E, type FlagsView as F, type PresenceState as G, RealtimeChannel as H, type RealtimeHandler as I, type RealtimeStatus as J, type RealtimeStatusSnapshot as K, type RealtimeSubscription as L, type MagicLinkResult as M, type NotifyScope as N, type OAuthExchangeResult as O, type PalbeConfig as P, type ResolvedMention as Q, type RealtimeConnectionState as R, type ResolvedReply as S, type SentReceipt as T, type SignInMethods as U, type UnreadView as V, type Unsubscribe as W, PalbePerf as X, type RealtimePayload as a, type ChatMember as b, type ChatMessage as c, type PalbeRuntime as d, buildRuntime as e, type AnalyticsProperties as f, type AuthChangeEvent as g, type AuthState as h, type AuthSuccess as i, Call as j, type CallChangeCallback as k, type CallParticipant as l, type CallState as m, type ChatBackend as n, type ChatDraft as o, type ChatKind as p, type ChatMessageKind as q, type ChatRole as r, type ChatState as s, type CommsPrefs as t, type MentionRange as u, type MessageDirection as v, PalbeAnalytics as w, PalbeAuth as x, PalbeCalls as y, PalbeFlags as z };
@@ -15,6 +15,15 @@ interface PalbaseResponse$1<T> {
15
15
  status: number;
16
16
  }
17
17
  interface HttpClientOptions$1 {
18
+ /**
19
+ * The host application's own version, sent as `X-Palbase-Client-Version` and
20
+ * readable in flag targeting as `client.app_version`.
21
+ *
22
+ * Opt-in because the SDK cannot discover it on the web — there is no bundle
23
+ * to read a version out of. iOS fills the same header automatically from
24
+ * CFBundleShortVersionString.
25
+ */
26
+ appVersion?: string;
18
27
  url?: string;
19
28
  headers?: Record<string, string>;
20
29
  }
@@ -104,6 +113,15 @@ interface PalbaseResponse<T> {
104
113
  status: number;
105
114
  }
106
115
  interface HttpClientOptions {
116
+ /**
117
+ * The host application's own version, sent as `X-Palbase-Client-Version` and
118
+ * readable in flag targeting as `client.app_version`.
119
+ *
120
+ * Opt-in because the SDK cannot discover it on the web — there is no bundle
121
+ * to read a version out of. iOS fills the same header automatically from
122
+ * CFBundleShortVersionString.
123
+ */
124
+ appVersion?: string;
107
125
  url?: string;
108
126
  headers?: Record<string, string>;
109
127
  }
@@ -1648,6 +1666,19 @@ interface AuthUser {
1648
1666
  emailVerified: boolean;
1649
1667
  createdAt: string;
1650
1668
  }
1669
+ /** What `pb.auth.getSignInMethods()` reports about an account's credentials. */
1670
+ interface SignInMethods {
1671
+ /** A local password exists — offer "change password", not "set password". */
1672
+ password: boolean;
1673
+ /** An MFA factor is enrolled. */
1674
+ mfa: boolean;
1675
+ /**
1676
+ * Linked OAuth providers, e.g. `['google']`. `[]` means none are linked;
1677
+ * `null` means the server could not determine it (social login is not
1678
+ * configured, or the lookup failed) — treat null as unknown, not as none.
1679
+ */
1680
+ providers: string[] | null;
1681
+ }
1651
1682
  interface AuthSuccess {
1652
1683
  user: AuthUser;
1653
1684
  session: Session$1;
@@ -1716,6 +1747,16 @@ declare class PalbeAuth {
1716
1747
  erasureId: string;
1717
1748
  }>;
1718
1749
  getUser(): Promise<AuthUser>;
1750
+ /**
1751
+ * Which credentials this account actually has.
1752
+ *
1753
+ * An account reached through Google has no password, so showing it a
1754
+ * "current password" field gives the user something they can never fill —
1755
+ * and `getUser()` cannot tell you, because GET /auth/user carries no
1756
+ * credential information. Read this before rendering any re-auth or
1757
+ * change-password form.
1758
+ */
1759
+ getSignInMethods(): Promise<SignInMethods>;
1719
1760
  refreshUser(): Promise<AuthUser>;
1720
1761
  /**
1721
1762
  * Restore the user after a session was rehydrated from storage (page reload).
@@ -1906,4 +1947,4 @@ declare class PalbeAnalytics {
1906
1947
  private post;
1907
1948
  }
1908
1949
 
1909
- export { type AuthUser as A, PalbeMessaging as B, Chat as C, type PalbeOAuthConfig as D, PalbeRealtime as E, type FlagsView as F, type PresenceState as G, RealtimeChannel as H, type RealtimeHandler as I, type RealtimeStatus as J, type RealtimeStatusSnapshot as K, type RealtimeSubscription as L, type MagicLinkResult as M, type NotifyScope as N, type OAuthExchangeResult as O, type PalbeConfig as P, type ResolvedMention as Q, type RealtimeConnectionState as R, type ResolvedReply as S, type SentReceipt as T, type UnreadView as U, type Unsubscribe as V, PalbePerf as W, type RealtimePayload as a, type ChatMember as b, type ChatMessage as c, type PalbeRuntime as d, buildRuntime as e, type AnalyticsProperties as f, type AuthChangeEvent as g, type AuthState as h, type AuthSuccess as i, Call as j, type CallChangeCallback as k, type CallParticipant as l, type CallState as m, type ChatBackend as n, type ChatDraft as o, type ChatKind as p, type ChatMessageKind as q, type ChatRole as r, type ChatState as s, type CommsPrefs as t, type MentionRange as u, type MessageDirection as v, PalbeAnalytics as w, PalbeAuth as x, PalbeCalls as y, PalbeFlags as z };
1950
+ export { type AuthUser as A, PalbeMessaging as B, Chat as C, type PalbeOAuthConfig as D, PalbeRealtime as E, type FlagsView as F, type PresenceState as G, RealtimeChannel as H, type RealtimeHandler as I, type RealtimeStatus as J, type RealtimeStatusSnapshot as K, type RealtimeSubscription as L, type MagicLinkResult as M, type NotifyScope as N, type OAuthExchangeResult as O, type PalbeConfig as P, type ResolvedMention as Q, type RealtimeConnectionState as R, type ResolvedReply as S, type SentReceipt as T, type SignInMethods as U, type UnreadView as V, type Unsubscribe as W, PalbePerf as X, type RealtimePayload as a, type ChatMember as b, type ChatMessage as c, type PalbeRuntime as d, buildRuntime as e, type AnalyticsProperties as f, type AuthChangeEvent as g, type AuthState as h, type AuthSuccess as i, Call as j, type CallChangeCallback as k, type CallParticipant as l, type CallState as m, type ChatBackend as n, type ChatDraft as o, type ChatKind as p, type ChatMessageKind as q, type ChatRole as r, type ChatState as s, type CommsPrefs as t, type MentionRange as u, type MessageDirection as v, PalbeAnalytics as w, PalbeAuth as x, PalbeCalls as y, PalbeFlags as z };
@@ -8,7 +8,7 @@ import {
8
8
  fromPalbaseError,
9
9
  isBackendError,
10
10
  unwrap
11
- } from "./chunk-BNAGRUIQ.js";
11
+ } from "./chunk-ACCJV6FV.js";
12
12
  import {
13
13
  environmentRefFromPublishableApiKey
14
14
  } from "./chunk-CFDU23TB.js";
@@ -1184,6 +1184,23 @@ var PalbeAuth = class {
1184
1184
  const raw = await palbeRequest(this.rt, "GET", "/auth/user");
1185
1185
  return mapWireUser(raw);
1186
1186
  }
1187
+ /**
1188
+ * Which credentials this account actually has.
1189
+ *
1190
+ * An account reached through Google has no password, so showing it a
1191
+ * "current password" field gives the user something they can never fill —
1192
+ * and `getUser()` cannot tell you, because GET /auth/user carries no
1193
+ * credential information. Read this before rendering any re-auth or
1194
+ * change-password form.
1195
+ */
1196
+ async getSignInMethods() {
1197
+ const raw = await palbeRequest(this.rt, "GET", "/auth/me");
1198
+ return {
1199
+ password: raw.has_password,
1200
+ mfa: raw.has_mfa,
1201
+ providers: raw.providers ?? null
1202
+ };
1203
+ }
1187
1204
  async refreshUser() {
1188
1205
  const user = await this.getUser();
1189
1206
  const changed = !usersEqual(user, this.cachedUser);
@@ -8633,7 +8650,7 @@ function defaultSessionStorage(key) {
8633
8650
  }
8634
8651
 
8635
8652
  // src/version.ts
8636
- var VERSION = "6.0.0";
8653
+ var VERSION = "7.0.0";
8637
8654
 
8638
8655
  // src/runtime.ts
8639
8656
  function buildRuntime(config) {
@@ -9058,4 +9075,4 @@ export {
9058
9075
  pb,
9059
9076
  createBoundClient
9060
9077
  };
9061
- //# sourceMappingURL=chunk-KOJ4OAAR.js.map
9078
+ //# sourceMappingURL=chunk-7SNSLY5M.js.map