@insureco/bio 0.4.0 → 0.6.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.
@@ -298,5 +298,99 @@ interface AdminResponse<T> {
298
298
  limit: number;
299
299
  };
300
300
  }
301
+ /** Configuration for EmbedClient (headless embed auth) */
302
+ interface EmbedClientConfig {
303
+ /** OAuth client ID (env: BIO_CLIENT_ID) */
304
+ clientId: string;
305
+ /** OAuth client secret (env: BIO_CLIENT_SECRET) */
306
+ clientSecret: string;
307
+ /** Bio-ID base URL (env: BIO_ID_URL, default: https://bio.tawa.pro) */
308
+ bioIdUrl?: string;
309
+ /** Number of retry attempts on transient failures (default: 2) */
310
+ retries?: number;
311
+ /** Request timeout in milliseconds (default: 10000) */
312
+ timeoutMs?: number;
313
+ }
314
+ /** Parameters for embed login */
315
+ interface EmbedLoginParams {
316
+ /** User email address */
317
+ email: string;
318
+ /** User password */
319
+ password: string;
320
+ }
321
+ /** Parameters for embed signup */
322
+ interface EmbedSignupParams {
323
+ /** User email address */
324
+ email: string;
325
+ /** User password */
326
+ password: string;
327
+ /** Display name */
328
+ name: string;
329
+ /** Optional invite token for org-scoped signups */
330
+ inviteToken?: string;
331
+ }
332
+ /** Parameters for sending a magic link */
333
+ interface EmbedMagicLinkParams {
334
+ /** Email address to send the magic link to */
335
+ email: string;
336
+ }
337
+ /** Parameters for verifying a magic link token */
338
+ interface EmbedVerifyParams {
339
+ /** Magic link token from the email */
340
+ token: string;
341
+ }
342
+ /** Parameters for refreshing an access token */
343
+ interface EmbedRefreshParams {
344
+ /** Refresh token from a previous login/signup/verify/refresh */
345
+ refreshToken: string;
346
+ }
347
+ /** Parameters for logout (token revocation) */
348
+ interface EmbedLogoutParams {
349
+ /** Refresh token to revoke */
350
+ refreshToken: string;
351
+ }
352
+ /** User profile returned by embed endpoints */
353
+ interface EmbedUser {
354
+ /** Unique Bio-ID identifier */
355
+ bioId: string;
356
+ /** User email address */
357
+ email: string;
358
+ /** Display name */
359
+ name: string;
360
+ /** Organization slug (if the user belongs to an org) */
361
+ orgSlug?: string;
362
+ }
363
+ /** Branding data returned by embed endpoints */
364
+ interface EmbedBranding {
365
+ /** Organization display name */
366
+ displayName?: string;
367
+ /** Full logo URL */
368
+ logoUrl?: string;
369
+ /** Logo mark (icon) URL */
370
+ logoMarkUrl?: string;
371
+ /** Primary brand color (hex) */
372
+ primaryColor?: string;
373
+ /** Secondary brand color (hex) */
374
+ secondaryColor?: string;
375
+ /** Whether the org is verified */
376
+ verified?: boolean;
377
+ /** Whether white-label is approved for this org */
378
+ whiteLabelApproved?: boolean;
379
+ }
380
+ /** Auth result from embed login, signup, verify, or refresh */
381
+ interface EmbedAuthResult {
382
+ /** JWT access token */
383
+ accessToken: string;
384
+ /** Refresh token (use with refresh() or logout()) */
385
+ refreshToken: string;
386
+ /** Token type (always 'Bearer') */
387
+ tokenType: 'Bearer';
388
+ /** Access token lifetime in seconds */
389
+ expiresIn: number;
390
+ /** Authenticated user profile */
391
+ user: EmbedUser;
392
+ /** Optional org branding (present when the user belongs to a branded org) */
393
+ branding?: EmbedBranding;
394
+ }
301
395
 
302
- export type { AuthorizeOptions as A, BioAuthConfig as B, CreateDepartmentData as C, IntrospectResult as I, JWKSVerifyOptions as J, OrgMember as O, TokenResponse as T, UserFilters as U, VerifyOptions as V, AuthorizeResult as a, BioUser as b, BioAdminConfig as c, UpdateUserData as d, BioDepartment as e, BioRole as f, CreateRoleData as g, BioOAuthClient as h, CreateClientData as i, BioTokenPayload as j, AdminResponse as k, BioAddress as l, BioClientTokenPayload as m, BioMessaging as n, BioUsersConfig as o, OrgMemberFilters as p, OrgMembersResult as q };
396
+ export type { AuthorizeOptions as A, BioAuthConfig as B, CreateDepartmentData as C, EmbedClientConfig as E, IntrospectResult as I, JWKSVerifyOptions as J, OrgMember as O, TokenResponse as T, UserFilters as U, VerifyOptions as V, AuthorizeResult as a, BioUser as b, BioAdminConfig as c, UpdateUserData as d, BioDepartment as e, BioRole as f, CreateRoleData as g, BioOAuthClient as h, CreateClientData as i, EmbedLoginParams as j, EmbedAuthResult as k, EmbedSignupParams as l, EmbedMagicLinkParams as m, EmbedVerifyParams as n, EmbedRefreshParams as o, EmbedLogoutParams as p, BioTokenPayload as q, AdminResponse as r, BioAddress as s, BioClientTokenPayload as t, BioMessaging as u, BioUsersConfig as v, EmbedBranding as w, EmbedUser as x, OrgMemberFilters as y, OrgMembersResult as z };
@@ -298,5 +298,99 @@ interface AdminResponse<T> {
298
298
  limit: number;
299
299
  };
300
300
  }
301
+ /** Configuration for EmbedClient (headless embed auth) */
302
+ interface EmbedClientConfig {
303
+ /** OAuth client ID (env: BIO_CLIENT_ID) */
304
+ clientId: string;
305
+ /** OAuth client secret (env: BIO_CLIENT_SECRET) */
306
+ clientSecret: string;
307
+ /** Bio-ID base URL (env: BIO_ID_URL, default: https://bio.tawa.pro) */
308
+ bioIdUrl?: string;
309
+ /** Number of retry attempts on transient failures (default: 2) */
310
+ retries?: number;
311
+ /** Request timeout in milliseconds (default: 10000) */
312
+ timeoutMs?: number;
313
+ }
314
+ /** Parameters for embed login */
315
+ interface EmbedLoginParams {
316
+ /** User email address */
317
+ email: string;
318
+ /** User password */
319
+ password: string;
320
+ }
321
+ /** Parameters for embed signup */
322
+ interface EmbedSignupParams {
323
+ /** User email address */
324
+ email: string;
325
+ /** User password */
326
+ password: string;
327
+ /** Display name */
328
+ name: string;
329
+ /** Optional invite token for org-scoped signups */
330
+ inviteToken?: string;
331
+ }
332
+ /** Parameters for sending a magic link */
333
+ interface EmbedMagicLinkParams {
334
+ /** Email address to send the magic link to */
335
+ email: string;
336
+ }
337
+ /** Parameters for verifying a magic link token */
338
+ interface EmbedVerifyParams {
339
+ /** Magic link token from the email */
340
+ token: string;
341
+ }
342
+ /** Parameters for refreshing an access token */
343
+ interface EmbedRefreshParams {
344
+ /** Refresh token from a previous login/signup/verify/refresh */
345
+ refreshToken: string;
346
+ }
347
+ /** Parameters for logout (token revocation) */
348
+ interface EmbedLogoutParams {
349
+ /** Refresh token to revoke */
350
+ refreshToken: string;
351
+ }
352
+ /** User profile returned by embed endpoints */
353
+ interface EmbedUser {
354
+ /** Unique Bio-ID identifier */
355
+ bioId: string;
356
+ /** User email address */
357
+ email: string;
358
+ /** Display name */
359
+ name: string;
360
+ /** Organization slug (if the user belongs to an org) */
361
+ orgSlug?: string;
362
+ }
363
+ /** Branding data returned by embed endpoints */
364
+ interface EmbedBranding {
365
+ /** Organization display name */
366
+ displayName?: string;
367
+ /** Full logo URL */
368
+ logoUrl?: string;
369
+ /** Logo mark (icon) URL */
370
+ logoMarkUrl?: string;
371
+ /** Primary brand color (hex) */
372
+ primaryColor?: string;
373
+ /** Secondary brand color (hex) */
374
+ secondaryColor?: string;
375
+ /** Whether the org is verified */
376
+ verified?: boolean;
377
+ /** Whether white-label is approved for this org */
378
+ whiteLabelApproved?: boolean;
379
+ }
380
+ /** Auth result from embed login, signup, verify, or refresh */
381
+ interface EmbedAuthResult {
382
+ /** JWT access token */
383
+ accessToken: string;
384
+ /** Refresh token (use with refresh() or logout()) */
385
+ refreshToken: string;
386
+ /** Token type (always 'Bearer') */
387
+ tokenType: 'Bearer';
388
+ /** Access token lifetime in seconds */
389
+ expiresIn: number;
390
+ /** Authenticated user profile */
391
+ user: EmbedUser;
392
+ /** Optional org branding (present when the user belongs to a branded org) */
393
+ branding?: EmbedBranding;
394
+ }
301
395
 
302
- export type { AuthorizeOptions as A, BioAuthConfig as B, CreateDepartmentData as C, IntrospectResult as I, JWKSVerifyOptions as J, OrgMember as O, TokenResponse as T, UserFilters as U, VerifyOptions as V, AuthorizeResult as a, BioUser as b, BioAdminConfig as c, UpdateUserData as d, BioDepartment as e, BioRole as f, CreateRoleData as g, BioOAuthClient as h, CreateClientData as i, BioTokenPayload as j, AdminResponse as k, BioAddress as l, BioClientTokenPayload as m, BioMessaging as n, BioUsersConfig as o, OrgMemberFilters as p, OrgMembersResult as q };
396
+ export type { AuthorizeOptions as A, BioAuthConfig as B, CreateDepartmentData as C, EmbedClientConfig as E, IntrospectResult as I, JWKSVerifyOptions as J, OrgMember as O, TokenResponse as T, UserFilters as U, VerifyOptions as V, AuthorizeResult as a, BioUser as b, BioAdminConfig as c, UpdateUserData as d, BioDepartment as e, BioRole as f, CreateRoleData as g, BioOAuthClient as h, CreateClientData as i, EmbedLoginParams as j, EmbedAuthResult as k, EmbedSignupParams as l, EmbedMagicLinkParams as m, EmbedVerifyParams as n, EmbedRefreshParams as o, EmbedLogoutParams as p, BioTokenPayload as q, AdminResponse as r, BioAddress as s, BioClientTokenPayload as t, BioMessaging as u, BioUsersConfig as v, EmbedBranding as w, EmbedUser as x, OrgMemberFilters as y, OrgMembersResult as z };
package/dist/users.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as BioUsersConfig, p as OrgMemberFilters, q as OrgMembersResult } from './types-Dkb-drHZ.mjs';
1
+ import { v as BioUsersConfig, y as OrgMemberFilters, z as OrgMembersResult } from './types-CJe1FP61.mjs';
2
2
 
3
3
  /**
4
4
  * Client for Bio-ID user access endpoints.
package/dist/users.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as BioUsersConfig, p as OrgMemberFilters, q as OrgMembersResult } from './types-Dkb-drHZ.js';
1
+ import { v as BioUsersConfig, y as OrgMemberFilters, z as OrgMembersResult } from './types-CJe1FP61.js';
2
2
 
3
3
  /**
4
4
  * Client for Bio-ID user access endpoints.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insureco/bio",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "SDK for Bio-ID SSO integration on the Tawa platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -15,11 +15,23 @@
15
15
  "types": "./dist/users.d.ts",
16
16
  "import": "./dist/users.mjs",
17
17
  "require": "./dist/users.js"
18
+ },
19
+ "./graph": {
20
+ "types": "./dist/graph.d.ts",
21
+ "import": "./dist/graph.mjs",
22
+ "require": "./dist/graph.js"
18
23
  }
19
24
  },
20
25
  "files": [
21
26
  "dist"
22
27
  ],
28
+ "scripts": {
29
+ "build": "tsup src/index.ts src/users.ts src/graph.ts --format cjs,esm --dts --clean",
30
+ "test": "vitest run",
31
+ "test:watch": "vitest",
32
+ "lint": "tsc --noEmit",
33
+ "prepublishOnly": "npm run build"
34
+ },
23
35
  "keywords": [
24
36
  "insureco",
25
37
  "tawa",
@@ -42,11 +54,5 @@
42
54
  },
43
55
  "engines": {
44
56
  "node": ">=18.0.0"
45
- },
46
- "scripts": {
47
- "build": "tsup src/index.ts src/users.ts --format cjs,esm --dts --clean",
48
- "test": "vitest run",
49
- "test:watch": "vitest",
50
- "lint": "tsc --noEmit"
51
57
  }
52
- }
58
+ }