@8wave/ai-elements 0.114.0-beta.25 → 0.114.0-beta.28

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 (29) hide show
  1. package/dist/ai-elements.es.js +754 -335
  2. package/dist/ai-elements.es.js.map +1 -1
  3. package/dist-vue/PkChatbotAuth.js +1 -1
  4. package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js +421 -0
  5. package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js.map +1 -0
  6. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
  7. package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +53 -5
  8. package/dist-vue/apps/web-component/src/composables/useChatbotAuthForm.d.ts +14 -0
  9. package/dist-vue/composables.js +297 -16
  10. package/dist-vue/composables.js.map +1 -1
  11. package/dist-vue/index.js +354 -328
  12. package/dist-vue/index.js.map +1 -1
  13. package/dist-vue/locales.js +24 -0
  14. package/dist-vue/packages/auth/src/additional-fields.d.ts +48 -0
  15. package/dist-vue/packages/auth/src/passkey-policy-client-plugin.d.ts +31 -0
  16. package/dist-vue/packages/auth/src/passkey-policy-plugin.d.ts +22 -0
  17. package/dist-vue/packages/auth/src/two-factor-policy-client-plugin.d.ts +60 -0
  18. package/dist-vue/packages/auth/src/two-factor-policy-plugin.d.ts +65 -0
  19. package/dist-vue/packages/components/src/PkQrCode.d.ts +14 -0
  20. package/dist-vue/packages/components/src/chat/PkChatbotAuth.d.ts +19 -0
  21. package/dist-vue/packages/components/src/index.d.ts +2 -1
  22. package/dist-vue/packages/models/src/schema/Member.d.ts +3 -0
  23. package/dist-vue/packages/models/src/schema/Notification.d.ts +2 -0
  24. package/dist-vue/packages/models/src/schema/Organization.d.ts +1 -0
  25. package/dist-vue/packages/models/src/schema/User.d.ts +1 -0
  26. package/dist-vue/style.css +1 -1
  27. package/package.json +1 -1
  28. package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js +0 -349
  29. package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { MaybeRefOrGetter } from 'vue';
2
- import { auth } from '../../../../packages/auth/src';
2
+ import { AdditionalFieldsOptions } from '../../../../packages/auth/src/additional-fields';
3
3
  import { createAuthClient, VueAuthClient } from 'better-auth/vue';
4
4
  import { inferAdditionalFields, anonymousClient } from 'better-auth/client/plugins';
5
5
  import { BetterFetch, BetterFetchError, BetterFetchResponse } from 'better-auth/client';
@@ -64,7 +64,7 @@ type AuthClientOptions = {
64
64
  baseURL?: string;
65
65
  basePath?: string;
66
66
  plugins: [
67
- ReturnType<typeof inferAdditionalFields<typeof auth>>,
67
+ ReturnType<typeof inferAdditionalFields<AdditionalFieldsOptions>>,
68
68
  ReturnType<typeof anonymousClient>,
69
69
  ReturnType<typeof anonymousReauthClient>,
70
70
  ReturnType<typeof externalAuthClient>
@@ -131,6 +131,7 @@ export declare function useChatbotAuth(options?: {
131
131
  readonly activeOrganizationId: string;
132
132
  readonly impersonatedBy: string;
133
133
  readonly organizationRole: string;
134
+ readonly signedInWithPasskey: boolean | null | undefined;
134
135
  readonly hardExpiresAt?: Date | null | undefined;
135
136
  };
136
137
  } | null;
@@ -168,6 +169,7 @@ export declare function useChatbotAuth(options?: {
168
169
  readonly activeOrganizationId: string;
169
170
  readonly impersonatedBy: string;
170
171
  readonly organizationRole: string;
172
+ readonly signedInWithPasskey: boolean | null | undefined;
171
173
  readonly hardExpiresAt?: Date | null | undefined;
172
174
  };
173
175
  } | null;
@@ -230,6 +232,52 @@ export declare function useChatbotAuth(options?: {
230
232
  statusText: string;
231
233
  };
232
234
  }>;
235
+ twoFactorChallenge: globalThis.Ref<{
236
+ token: string;
237
+ methods: string[];
238
+ } | undefined, {
239
+ token: string;
240
+ methods: string[];
241
+ } | undefined>;
242
+ verifyTwoFactor: (kind: "totp" | "otp" | "backup", code: string) => Promise<{
243
+ data: null;
244
+ error: {
245
+ message?: string | undefined;
246
+ status: number;
247
+ statusText: string;
248
+ };
249
+ } | {
250
+ data: null;
251
+ error: {
252
+ code: string;
253
+ message: undefined;
254
+ };
255
+ } | {
256
+ data: {
257
+ token?: string;
258
+ };
259
+ error: null;
260
+ }>;
261
+ sendTwoFactorCode: () => Promise<{
262
+ data: null;
263
+ error: {
264
+ message?: string | undefined;
265
+ status: number;
266
+ statusText: string;
267
+ };
268
+ } | {
269
+ data: null;
270
+ error: {
271
+ code: string;
272
+ message: undefined;
273
+ };
274
+ } | {
275
+ data: {
276
+ status: boolean;
277
+ };
278
+ error: null;
279
+ }>;
280
+ cancelTwoFactor: () => void;
233
281
  signUpWithEmail: (params: {
234
282
  email: string;
235
283
  password: string;
@@ -314,7 +362,7 @@ export declare function useChatbotAuth(options?: {
314
362
  };
315
363
  }>;
316
364
  signInSocial: <FetchOptions extends ClientFetchOption<Partial<{
317
- provider: "google" | "microsoft" | "slack" | "discord" | "github" | "linear" | "salesforce" | "line" | "apple" | "atlassian" | "cloudflare" | "cognito" | "facebook" | "figma" | "huggingface" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat" | (string & {});
365
+ provider: "google" | "microsoft" | "slack" | "discord" | "github" | "linear" | "salesforce" | "line" | (string & {}) | "apple" | "atlassian" | "cloudflare" | "cognito" | "facebook" | "figma" | "huggingface" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
318
366
  callbackURL?: string | undefined;
319
367
  newUserCallbackURL?: string | undefined;
320
368
  errorCallbackURL?: string | undefined;
@@ -339,7 +387,7 @@ export declare function useChatbotAuth(options?: {
339
387
  additionalParams?: Record<string, string> | undefined;
340
388
  additionalData?: Record<string, any> | undefined;
341
389
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0: Prettify<Omit<{
342
- provider: "google" | "microsoft" | "slack" | "discord" | "github" | "linear" | "salesforce" | "line" | "apple" | "atlassian" | "cloudflare" | "cognito" | "facebook" | "figma" | "huggingface" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat" | (string & {});
390
+ provider: "google" | "microsoft" | "slack" | "discord" | "github" | "linear" | "salesforce" | "line" | (string & {}) | "apple" | "atlassian" | "cloudflare" | "cognito" | "facebook" | "figma" | "huggingface" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
343
391
  callbackURL?: string | undefined;
344
392
  newUserCallbackURL?: string | undefined;
345
393
  errorCallbackURL?: string | undefined;
@@ -366,7 +414,7 @@ export declare function useChatbotAuth(options?: {
366
414
  } & {
367
415
  fetchOptions?: FetchOptions | undefined;
368
416
  }, "provider"> & {
369
- provider: "google" | "microsoft" | "slack" | "discord" | "github" | "linear" | "salesforce" | "line" | "apple" | "atlassian" | "cloudflare" | "cognito" | "facebook" | "figma" | "huggingface" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat" | (string & {});
417
+ provider: "google" | "microsoft" | "slack" | "discord" | "github" | "linear" | "salesforce" | "line" | (string & {}) | "apple" | "atlassian" | "cloudflare" | "cognito" | "facebook" | "figma" | "huggingface" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
370
418
  fetchOptions?: FetchOptions | undefined;
371
419
  }>, data_1?: FetchOptions | undefined) => Promise< BetterFetchResponse<{
372
420
  redirect: boolean;
@@ -2,7 +2,10 @@ type SocialProvider = 'google' | 'microsoft';
2
2
  /** Subset of a better-auth client error we care about for messaging. */
3
3
  type AuthError = {
4
4
  message?: string;
5
+ code?: string;
5
6
  };
7
+ /** How a two-step verification code is checked. */
8
+ export type TwoFactorKind = 'totp' | 'otp' | 'backup';
6
9
  /** Shape returned by the better-auth email/reset client methods. */
7
10
  type AuthResult = {
8
11
  error?: AuthError | null;
@@ -18,6 +21,11 @@ type UseChatbotAuthFormDeps = {
18
21
  signInWithSocialPopup: (provider: SocialProvider, onAuthSuccess?: () => void | Promise<void>) => Promise<{
19
22
  popupBlocked: boolean;
20
23
  }>;
24
+ /** True while an email sign-in waits for its second factor. */
25
+ isTwoFactorPending: () => boolean;
26
+ verifyTwoFactor: (kind: TwoFactorKind, code: string) => Promise<AuthResult>;
27
+ sendTwoFactorCode: () => Promise<AuthResult>;
28
+ cancelTwoFactor: () => void;
21
29
  /** Refetches the current session (after a successful credential sign-in). */
22
30
  refetchSession: () => Promise<unknown>;
23
31
  /** Reloads the agent access state once the user is authenticated. */
@@ -52,5 +60,11 @@ export declare function useChatbotAuthForm(deps: UseChatbotAuthFormDeps): {
52
60
  email: string;
53
61
  }) => Promise<void>;
54
62
  handleSocial: (provider: SocialProvider) => Promise<void>;
63
+ handleVerifyTwoFactor: (payload: {
64
+ kind: TwoFactorKind;
65
+ code: string;
66
+ }) => Promise<void>;
67
+ handleSendTwoFactorCode: () => Promise<void>;
68
+ handleCancelTwoFactor: () => void;
55
69
  };
56
70
  export {};