@absolutejs/auth 0.54.4 → 0.54.6

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.
@@ -339,43 +339,74 @@ var apiKeysTable = pgTable2("auth_api_keys", {
339
339
  scopes: text("scopes").array().notNull()
340
340
  });
341
341
 
342
- // src/audit/postgresAuditStore.ts
343
- import { desc as desc3, eq as eq3, lt as lt2 } from "drizzle-orm";
342
+ // src/agents/postgresStores.ts
343
+ import { and as and2, desc as desc3, eq as eq3, gt, isNull, or } from "drizzle-orm";
344
344
  import { bigint as bigint3, jsonb, pgTable as pgTable3, varchar as varchar3 } from "drizzle-orm/pg-core";
345
345
  var ID_LENGTH3 = 255;
346
+ var NAME_LENGTH = 255;
347
+ var STATUS_LENGTH = 16;
348
+ var agentDelegationsTable = pgTable3("auth_agent_delegations", {
349
+ agent_id: varchar3("agent_id", { length: ID_LENGTH3 }).notNull(),
350
+ authorization_details: jsonb("authorization_details").$type(),
351
+ created_at_ms: bigint3("created_at_ms", { mode: "number" }).notNull(),
352
+ delegation_id: varchar3("delegation_id", {
353
+ length: ID_LENGTH3
354
+ }).primaryKey(),
355
+ expires_at_ms: bigint3("expires_at_ms", { mode: "number" }),
356
+ organization_id: varchar3("organization_id", { length: ID_LENGTH3 }),
357
+ scopes: jsonb("scopes").$type().notNull().default([]),
358
+ status: varchar3("status", { length: STATUS_LENGTH }).$type().notNull(),
359
+ updated_at_ms: bigint3("updated_at_ms", { mode: "number" }).notNull(),
360
+ user_id: varchar3("user_id", { length: ID_LENGTH3 }).notNull()
361
+ });
362
+ var agentRegistrationsTable = pgTable3("auth_agent_registrations", {
363
+ agent_id: varchar3("agent_id", { length: ID_LENGTH3 }).primaryKey(),
364
+ allowed_scopes: jsonb("allowed_scopes").$type().notNull().default([]),
365
+ client_id: varchar3("client_id", { length: ID_LENGTH3 }).unique(),
366
+ created_at_ms: bigint3("created_at_ms", { mode: "number" }).notNull(),
367
+ metadata: jsonb("metadata").$type(),
368
+ name: varchar3("name", { length: NAME_LENGTH }).notNull(),
369
+ status: varchar3("status", { length: STATUS_LENGTH }).$type().notNull(),
370
+ updated_at_ms: bigint3("updated_at_ms", { mode: "number" }).notNull()
371
+ });
372
+
373
+ // src/audit/postgresAuditStore.ts
374
+ import { desc as desc4, eq as eq4, lt as lt2 } from "drizzle-orm";
375
+ import { bigint as bigint4, jsonb as jsonb2, pgTable as pgTable4, varchar as varchar4 } from "drizzle-orm/pg-core";
376
+ var ID_LENGTH4 = 255;
346
377
  var IP_LENGTH = 64;
347
378
  var TYPE_LENGTH = 64;
348
- var auditEventsTable = pgTable3("auth_audit_events", {
349
- at_ms: bigint3("at_ms", { mode: "number" }).notNull(),
350
- id: varchar3("id", { length: ID_LENGTH3 }).primaryKey(),
351
- ip: varchar3("ip", { length: IP_LENGTH }),
352
- metadata_json: jsonb("metadata_json").$type(),
353
- organization_id: varchar3("organization_id", { length: ID_LENGTH3 }),
354
- type: varchar3("type", { length: TYPE_LENGTH }).notNull(),
355
- user_id: varchar3("user_id", { length: ID_LENGTH3 })
379
+ var auditEventsTable = pgTable4("auth_audit_events", {
380
+ at_ms: bigint4("at_ms", { mode: "number" }).notNull(),
381
+ id: varchar4("id", { length: ID_LENGTH4 }).primaryKey(),
382
+ ip: varchar4("ip", { length: IP_LENGTH }),
383
+ metadata_json: jsonb2("metadata_json").$type(),
384
+ organization_id: varchar4("organization_id", { length: ID_LENGTH4 }),
385
+ type: varchar4("type", { length: TYPE_LENGTH }).notNull(),
386
+ user_id: varchar4("user_id", { length: ID_LENGTH4 })
356
387
  });
357
388
 
358
389
  // src/credentials/postgresCredentialStore.ts
359
- import { eq as eq4 } from "drizzle-orm";
360
- import { bigint as bigint4, boolean as boolean2, pgTable as pgTable4, text as text2, varchar as varchar4 } from "drizzle-orm/pg-core";
390
+ import { eq as eq5 } from "drizzle-orm";
391
+ import { bigint as bigint5, boolean as boolean2, pgTable as pgTable5, text as text2, varchar as varchar5 } from "drizzle-orm/pg-core";
361
392
  var EMAIL_LENGTH = 320;
362
- var ID_LENGTH4 = 255;
363
- var STATUS_LENGTH = 32;
393
+ var ID_LENGTH5 = 255;
394
+ var STATUS_LENGTH2 = 32;
364
395
  var TOKEN_HASH_LENGTH = 255;
365
- var credentialsTable = pgTable4("auth_credentials", {
366
- created_at_ms: bigint4("created_at_ms", { mode: "number" }).notNull(),
367
- email: varchar4("email", { length: EMAIL_LENGTH }).primaryKey(),
396
+ var credentialsTable = pgTable5("auth_credentials", {
397
+ created_at_ms: bigint5("created_at_ms", { mode: "number" }).notNull(),
398
+ email: varchar5("email", { length: EMAIL_LENGTH }).primaryKey(),
368
399
  email_verified: boolean2("email_verified").notNull().default(false),
369
- organization_id: varchar4("organization_id", { length: ID_LENGTH4 }),
400
+ organization_id: varchar5("organization_id", { length: ID_LENGTH5 }),
370
401
  password_hash: text2("password_hash").notNull(),
371
- status: varchar4("status", { length: STATUS_LENGTH }).notNull().default("active"),
372
- updated_at_ms: bigint4("updated_at_ms", { mode: "number" }).notNull(),
373
- user_id: varchar4("user_id", { length: ID_LENGTH4 })
402
+ status: varchar5("status", { length: STATUS_LENGTH2 }).notNull().default("active"),
403
+ updated_at_ms: bigint5("updated_at_ms", { mode: "number" }).notNull(),
404
+ user_id: varchar5("user_id", { length: ID_LENGTH5 })
374
405
  });
375
- var createTokenTable = (name) => pgTable4(name, {
376
- email: varchar4("email", { length: EMAIL_LENGTH }).notNull(),
377
- expires_at_ms: bigint4("expires_at_ms", { mode: "number" }).notNull(),
378
- token_hash: varchar4("token_hash", {
406
+ var createTokenTable = (name) => pgTable5(name, {
407
+ email: varchar5("email", { length: EMAIL_LENGTH }).notNull(),
408
+ expires_at_ms: bigint5("expires_at_ms", { mode: "number" }).notNull(),
409
+ token_hash: varchar5("token_hash", {
379
410
  length: TOKEN_HASH_LENGTH
380
411
  }).primaryKey()
381
412
  });
@@ -383,24 +414,24 @@ var credentialResetTokensTable = createTokenTable("auth_credential_reset_tokens"
383
414
  var credentialVerificationTokensTable = createTokenTable("auth_credential_verification_tokens");
384
415
 
385
416
  // src/fga/postgresStores.ts
386
- import { and as and2, eq as eq5 } from "drizzle-orm";
387
- import { pgTable as pgTable5, varchar as varchar5 } from "drizzle-orm/pg-core";
388
- var ID_LENGTH5 = 255;
389
- var warrantsTable = pgTable5("auth_fga_warrants", {
390
- id: varchar5("id", { length: ID_LENGTH5 }).primaryKey(),
391
- relation: varchar5("relation", { length: ID_LENGTH5 }).notNull(),
392
- resource_id: varchar5("resource_id", { length: ID_LENGTH5 }).notNull(),
393
- resource_type: varchar5("resource_type", { length: ID_LENGTH5 }).notNull(),
394
- subject_id: varchar5("subject_id", { length: ID_LENGTH5 }).notNull(),
395
- subject_relation: varchar5("subject_relation", { length: ID_LENGTH5 }),
396
- subject_type: varchar5("subject_type", { length: ID_LENGTH5 }).notNull()
417
+ import { and as and3, eq as eq6 } from "drizzle-orm";
418
+ import { pgTable as pgTable6, varchar as varchar6 } from "drizzle-orm/pg-core";
419
+ var ID_LENGTH6 = 255;
420
+ var warrantsTable = pgTable6("auth_fga_warrants", {
421
+ id: varchar6("id", { length: ID_LENGTH6 }).primaryKey(),
422
+ relation: varchar6("relation", { length: ID_LENGTH6 }).notNull(),
423
+ resource_id: varchar6("resource_id", { length: ID_LENGTH6 }).notNull(),
424
+ resource_type: varchar6("resource_type", { length: ID_LENGTH6 }).notNull(),
425
+ subject_id: varchar6("subject_id", { length: ID_LENGTH6 }).notNull(),
426
+ subject_relation: varchar6("subject_relation", { length: ID_LENGTH6 }),
427
+ subject_type: varchar6("subject_type", { length: ID_LENGTH6 }).notNull()
397
428
  });
398
429
 
399
430
  // src/linkedProviders/neonStores.ts
400
431
  import { neon as neon3 } from "@neondatabase/serverless";
401
- import { desc as desc4, eq as eq6 } from "drizzle-orm";
432
+ import { desc as desc5, eq as eq7 } from "drizzle-orm";
402
433
  import { drizzle as drizzle2 } from "drizzle-orm/neon-http";
403
- import { jsonb as jsonb2, pgTable as pgTable6, text as text3, timestamp, varchar as varchar6 } from "drizzle-orm/pg-core";
434
+ import { jsonb as jsonb3, pgTable as pgTable7, text as text3, timestamp, varchar as varchar7 } from "drizzle-orm/pg-core";
404
435
 
405
436
  // node_modules/citra/dist/index.js
406
437
  var NUM_GENERATOR_BYTES = 32;
@@ -2165,6 +2196,7 @@ var providers = defineProviders({
2165
2196
  }
2166
2197
  },
2167
2198
  withings: {
2199
+ accessTokenPath: ["body", "access_token"],
2168
2200
  authorizationUrl: "https://account.withings.com/oauth2_user/authorize2",
2169
2201
  isOIDC: false,
2170
2202
  isRefreshable: true,
@@ -2451,472 +2483,472 @@ var revocableProviderOptions = Object.keys(providers).filter(isRevocableProvider
2451
2483
  var scopeRequiredProviderOptions = Object.keys(providers).filter(isScopeRequiredProviderOption);
2452
2484
 
2453
2485
  // src/linkedProviders/neonStores.ts
2454
- var linkedProviderBindingsTable = pgTable6("linked_provider_bindings", {
2455
- available_scopes: jsonb2("available_scopes").$type().notNull().default([]),
2456
- capabilities: jsonb2("capabilities").$type().default([]),
2457
- connector_provider: varchar6("connector_provider", { length: 64 }).notNull(),
2486
+ var linkedProviderBindingsTable = pgTable7("linked_provider_bindings", {
2487
+ available_scopes: jsonb3("available_scopes").$type().notNull().default([]),
2488
+ capabilities: jsonb3("capabilities").$type().default([]),
2489
+ connector_provider: varchar7("connector_provider", { length: 64 }).notNull(),
2458
2490
  created_at: timestamp("created_at").notNull().defaultNow(),
2459
- email: varchar6("email", { length: 320 }),
2460
- external_account_id: varchar6("external_account_id", {
2491
+ email: varchar7("email", { length: 320 }),
2492
+ external_account_id: varchar7("external_account_id", {
2461
2493
  length: 255
2462
2494
  }).notNull(),
2463
- external_account_type: varchar6("external_account_type", {
2495
+ external_account_type: varchar7("external_account_type", {
2464
2496
  length: 64
2465
2497
  }).notNull(),
2466
- grant_id: varchar6("grant_id", { length: 255 }).notNull(),
2467
- id: varchar6("id", { length: 255 }).primaryKey(),
2468
- label: varchar6("label", { length: 255 }),
2469
- metadata: jsonb2("metadata").$type().default({}),
2470
- status: varchar6("status", { length: 64 }).$type().notNull(),
2498
+ grant_id: varchar7("grant_id", { length: 255 }).notNull(),
2499
+ id: varchar7("id", { length: 255 }).primaryKey(),
2500
+ label: varchar7("label", { length: 255 }),
2501
+ metadata: jsonb3("metadata").$type().default({}),
2502
+ status: varchar7("status", { length: 64 }).$type().notNull(),
2471
2503
  updated_at: timestamp("updated_at").notNull().defaultNow(),
2472
- username: varchar6("username", { length: 255 })
2504
+ username: varchar7("username", { length: 255 })
2473
2505
  });
2474
- var linkedProviderGrantsTable = pgTable6("linked_provider_grants", {
2506
+ var linkedProviderGrantsTable = pgTable7("linked_provider_grants", {
2475
2507
  access_token_ciphertext: text3("access_token_ciphertext"),
2476
- auth_provider_key: varchar6("auth_provider_key", { length: 64 }).notNull(),
2508
+ auth_provider_key: varchar7("auth_provider_key", { length: 64 }).notNull(),
2477
2509
  created_at: timestamp("created_at").notNull().defaultNow(),
2478
2510
  expires_at: timestamp("expires_at"),
2479
- granted_scopes: jsonb2("granted_scopes").$type().notNull().default([]),
2480
- id: varchar6("id", { length: 255 }).primaryKey(),
2511
+ granted_scopes: jsonb3("granted_scopes").$type().notNull().default([]),
2512
+ id: varchar7("id", { length: 255 }).primaryKey(),
2481
2513
  last_refresh_error: text3("last_refresh_error"),
2482
2514
  last_refreshed_at: timestamp("last_refreshed_at"),
2483
- metadata: jsonb2("metadata").$type().default({}),
2484
- owner_ref: varchar6("owner_ref", { length: 255 }).notNull(),
2485
- provider_family: varchar6("provider_family", { length: 64 }).notNull(),
2486
- provider_subject: varchar6("provider_subject", { length: 255 }).notNull(),
2515
+ metadata: jsonb3("metadata").$type().default({}),
2516
+ owner_ref: varchar7("owner_ref", { length: 255 }).notNull(),
2517
+ provider_family: varchar7("provider_family", { length: 64 }).notNull(),
2518
+ provider_subject: varchar7("provider_subject", { length: 255 }).notNull(),
2487
2519
  refresh_token_ciphertext: text3("refresh_token_ciphertext"),
2488
- status: varchar6("status", { length: 64 }).$type().notNull(),
2489
- token_type: varchar6("token_type", { length: 64 }),
2520
+ status: varchar7("status", { length: 64 }).$type().notNull(),
2521
+ token_type: varchar7("token_type", { length: 64 }),
2490
2522
  updated_at: timestamp("updated_at").notNull().defaultNow()
2491
2523
  });
2492
2524
 
2493
2525
  // src/lockout/postgresLockoutStore.ts
2494
- import { eq as eq7 } from "drizzle-orm";
2495
- import { bigint as bigint5, integer, pgTable as pgTable7, varchar as varchar7 } from "drizzle-orm/pg-core";
2526
+ import { eq as eq8 } from "drizzle-orm";
2527
+ import { bigint as bigint6, integer, pgTable as pgTable8, varchar as varchar8 } from "drizzle-orm/pg-core";
2496
2528
  var KEY_LENGTH = 320;
2497
- var lockoutsTable = pgTable7("auth_lockouts", {
2529
+ var lockoutsTable = pgTable8("auth_lockouts", {
2498
2530
  failed_attempts: integer("failed_attempts").notNull().default(0),
2499
- key: varchar7("key", { length: KEY_LENGTH }).primaryKey(),
2500
- locked_until_ms: bigint5("locked_until_ms", { mode: "number" }),
2501
- window_started_at_ms: bigint5("window_started_at_ms", {
2531
+ key: varchar8("key", { length: KEY_LENGTH }).primaryKey(),
2532
+ locked_until_ms: bigint6("locked_until_ms", { mode: "number" }),
2533
+ window_started_at_ms: bigint6("window_started_at_ms", {
2502
2534
  mode: "number"
2503
2535
  }).notNull()
2504
2536
  });
2505
2537
 
2506
2538
  // src/mfa/postgresMfaStore.ts
2507
- import { eq as eq8 } from "drizzle-orm";
2539
+ import { eq as eq9 } from "drizzle-orm";
2508
2540
  import {
2509
- bigint as bigint6,
2541
+ bigint as bigint7,
2510
2542
  boolean as boolean3,
2511
- jsonb as jsonb3,
2512
- pgTable as pgTable8,
2543
+ jsonb as jsonb4,
2544
+ pgTable as pgTable9,
2513
2545
  smallint,
2514
2546
  text as text4,
2515
- varchar as varchar8
2547
+ varchar as varchar9
2516
2548
  } from "drizzle-orm/pg-core";
2517
- var ID_LENGTH6 = 255;
2549
+ var ID_LENGTH7 = 255;
2518
2550
  var PHONE_LENGTH = 20;
2519
- var mfaEnrollmentsTable = pgTable8("auth_mfa_enrollments", {
2520
- backup_code_hashes: jsonb3("backup_code_hashes").$type().notNull().default([]),
2521
- created_at_ms: bigint6("created_at_ms", { mode: "number" }).notNull(),
2522
- last_used_at_ms: bigint6("last_used_at_ms", { mode: "number" }),
2551
+ var mfaEnrollmentsTable = pgTable9("auth_mfa_enrollments", {
2552
+ backup_code_hashes: jsonb4("backup_code_hashes").$type().notNull().default([]),
2553
+ created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2554
+ last_used_at_ms: bigint7("last_used_at_ms", { mode: "number" }),
2523
2555
  sms_failed_attempts: smallint("sms_failed_attempts").notNull().default(0),
2524
- sms_pending_code_expires_at_ms: bigint6("sms_pending_code_expires_at_ms", {
2556
+ sms_pending_code_expires_at_ms: bigint7("sms_pending_code_expires_at_ms", {
2525
2557
  mode: "number"
2526
2558
  }),
2527
2559
  sms_pending_code_hash: text4("sms_pending_code_hash"),
2528
- sms_phone: varchar8("sms_phone", { length: PHONE_LENGTH }),
2560
+ sms_phone: varchar9("sms_phone", { length: PHONE_LENGTH }),
2529
2561
  sms_verified: boolean3("sms_verified").notNull().default(false),
2530
2562
  totp_failed_attempts: smallint("totp_failed_attempts").notNull().default(0),
2531
2563
  totp_secret_ciphertext: text4("totp_secret_ciphertext"),
2532
2564
  totp_verified: boolean3("totp_verified").notNull().default(false),
2533
- updated_at_ms: bigint6("updated_at_ms", { mode: "number" }).notNull(),
2534
- user_id: varchar8("user_id", { length: ID_LENGTH6 }).primaryKey()
2565
+ updated_at_ms: bigint7("updated_at_ms", { mode: "number" }).notNull(),
2566
+ user_id: varchar9("user_id", { length: ID_LENGTH7 }).primaryKey()
2535
2567
  });
2536
2568
 
2537
2569
  // src/oidc/postgresStores.ts
2538
- import { and as and3, desc as desc5, eq as eq9, gt, lt as lt3 } from "drizzle-orm";
2570
+ import { and as and4, desc as desc6, eq as eq10, gt as gt2, lt as lt3 } from "drizzle-orm";
2539
2571
  import {
2540
- bigint as bigint7,
2572
+ bigint as bigint8,
2541
2573
  boolean as boolean4,
2542
- jsonb as jsonb4,
2543
- pgTable as pgTable9,
2574
+ jsonb as jsonb5,
2575
+ pgTable as pgTable10,
2544
2576
  text as text5,
2545
- varchar as varchar9
2577
+ varchar as varchar10
2546
2578
  } from "drizzle-orm/pg-core";
2547
2579
  var URL_LENGTH = 2048;
2548
- var ID_LENGTH7 = 255;
2549
- var oauthBackchannelAuthRequestsTable = pgTable9("auth_oauth_backchannel_auth_requests", {
2550
- auth_req_id: varchar9("auth_req_id", { length: ID_LENGTH7 }).primaryKey(),
2580
+ var ID_LENGTH8 = 255;
2581
+ var oauthBackchannelAuthRequestsTable = pgTable10("auth_oauth_backchannel_auth_requests", {
2582
+ auth_req_id: varchar10("auth_req_id", { length: ID_LENGTH8 }).primaryKey(),
2551
2583
  binding_message: text5("binding_message"),
2552
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2553
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2554
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2555
- interval_seconds: bigint7("interval_seconds", {
2584
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2585
+ created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2586
+ expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2587
+ interval_seconds: bigint8("interval_seconds", {
2556
2588
  mode: "number"
2557
2589
  }).notNull(),
2558
- last_polled_at_ms: bigint7("last_polled_at_ms", { mode: "number" }),
2590
+ last_polled_at_ms: bigint8("last_polled_at_ms", { mode: "number" }),
2559
2591
  scopes: text5("scopes").array().notNull(),
2560
- status: varchar9("status", { length: 16 }).notNull(),
2561
- user_sub: varchar9("user_sub", { length: ID_LENGTH7 })
2592
+ status: varchar10("status", { length: 16 }).notNull(),
2593
+ user_sub: varchar10("user_sub", { length: ID_LENGTH8 })
2562
2594
  });
2563
- var oauthClientAssertionJtisTable = pgTable9("auth_oauth_client_assertion_jtis", {
2564
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2565
- composite_key: varchar9("composite_key", {
2566
- length: ID_LENGTH7
2595
+ var oauthClientAssertionJtisTable = pgTable10("auth_oauth_client_assertion_jtis", {
2596
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2597
+ composite_key: varchar10("composite_key", {
2598
+ length: ID_LENGTH8
2567
2599
  }).primaryKey(),
2568
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2569
- jti: varchar9("jti", { length: ID_LENGTH7 }).notNull()
2600
+ expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2601
+ jti: varchar10("jti", { length: ID_LENGTH8 }).notNull()
2570
2602
  });
2571
- var oauthClientRegistrationTokensTable = pgTable9("auth_oauth_client_registration_tokens", {
2572
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2573
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2574
- token_hash: varchar9("token_hash", { length: ID_LENGTH7 }).primaryKey()
2603
+ var oauthClientRegistrationTokensTable = pgTable10("auth_oauth_client_registration_tokens", {
2604
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2605
+ created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2606
+ token_hash: varchar10("token_hash", { length: ID_LENGTH8 }).primaryKey()
2575
2607
  });
2576
- var oauthClientsTable = pgTable9("auth_oauth_clients", {
2577
- backchannel_logout_uri: varchar9("backchannel_logout_uri", {
2608
+ var oauthClientsTable = pgTable10("auth_oauth_clients", {
2609
+ backchannel_logout_uri: varchar10("backchannel_logout_uri", {
2578
2610
  length: URL_LENGTH
2579
2611
  }),
2580
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).primaryKey(),
2581
- hashed_secret: varchar9("hashed_secret", { length: ID_LENGTH7 }),
2582
- jwks_json: jsonb4("jwks_json").$type(),
2583
- jwks_uri: varchar9("jwks_uri", { length: URL_LENGTH }),
2584
- name: varchar9("name", { length: ID_LENGTH7 }).notNull(),
2612
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).primaryKey(),
2613
+ hashed_secret: varchar10("hashed_secret", { length: ID_LENGTH8 }),
2614
+ jwks_json: jsonb5("jwks_json").$type(),
2615
+ jwks_uri: varchar10("jwks_uri", { length: URL_LENGTH }),
2616
+ name: varchar10("name", { length: ID_LENGTH8 }).notNull(),
2585
2617
  post_logout_redirect_uris: text5("post_logout_redirect_uris").array(),
2586
2618
  redirect_uris: text5("redirect_uris").array().notNull(),
2587
2619
  require_pushed_authorization_requests: boolean4("require_pushed_authorization_requests"),
2588
2620
  require_signed_request_object: boolean4("require_signed_request_object"),
2589
2621
  scopes: text5("scopes").array().notNull()
2590
2622
  });
2591
- var oauthCodesTable = pgTable9("auth_oauth_codes", {
2592
- acr: varchar9("acr", { length: ID_LENGTH7 }),
2593
- claims_json: jsonb4("claims_json").$type(),
2594
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2595
- code_challenge: varchar9("code_challenge", { length: ID_LENGTH7 }).notNull(),
2596
- code_hash: varchar9("code_hash", { length: ID_LENGTH7 }).primaryKey(),
2597
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2598
- dpop_jkt: varchar9("dpop_jkt", { length: ID_LENGTH7 }),
2599
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2600
- nonce: varchar9("nonce", { length: ID_LENGTH7 }),
2601
- redirect_uri: varchar9("redirect_uri", { length: ID_LENGTH7 }).notNull(),
2623
+ var oauthCodesTable = pgTable10("auth_oauth_codes", {
2624
+ acr: varchar10("acr", { length: ID_LENGTH8 }),
2625
+ claims_json: jsonb5("claims_json").$type(),
2626
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2627
+ code_challenge: varchar10("code_challenge", { length: ID_LENGTH8 }).notNull(),
2628
+ code_hash: varchar10("code_hash", { length: ID_LENGTH8 }).primaryKey(),
2629
+ created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2630
+ dpop_jkt: varchar10("dpop_jkt", { length: ID_LENGTH8 }),
2631
+ expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2632
+ nonce: varchar10("nonce", { length: ID_LENGTH8 }),
2633
+ redirect_uri: varchar10("redirect_uri", { length: ID_LENGTH8 }).notNull(),
2602
2634
  scopes: text5("scopes").array().notNull(),
2603
- user_id: varchar9("user_id", { length: ID_LENGTH7 }).notNull()
2635
+ user_id: varchar10("user_id", { length: ID_LENGTH8 }).notNull()
2604
2636
  });
2605
- var oauthDeviceAuthorizationsTable = pgTable9("auth_oauth_device_authorizations", {
2606
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2607
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2608
- device_code_hash: varchar9("device_code_hash", {
2609
- length: ID_LENGTH7
2637
+ var oauthDeviceAuthorizationsTable = pgTable10("auth_oauth_device_authorizations", {
2638
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2639
+ created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2640
+ device_code_hash: varchar10("device_code_hash", {
2641
+ length: ID_LENGTH8
2610
2642
  }).primaryKey(),
2611
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2612
- interval_seconds: bigint7("interval_seconds", {
2643
+ expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2644
+ interval_seconds: bigint8("interval_seconds", {
2613
2645
  mode: "number"
2614
2646
  }).notNull(),
2615
2647
  scopes: text5("scopes").array().notNull(),
2616
- status: varchar9("status", { length: 16 }).notNull(),
2617
- user_code: varchar9("user_code", { length: 16 }).notNull().unique(),
2618
- user_sub: varchar9("user_sub", { length: ID_LENGTH7 })
2648
+ status: varchar10("status", { length: 16 }).notNull(),
2649
+ user_code: varchar10("user_code", { length: 16 }).notNull().unique(),
2650
+ user_sub: varchar10("user_sub", { length: ID_LENGTH8 })
2619
2651
  });
2620
- var oauthInitialAccessTokensTable = pgTable9("auth_oauth_initial_access_tokens", {
2621
- token_hash: varchar9("token_hash", { length: ID_LENGTH7 }).primaryKey()
2652
+ var oauthInitialAccessTokensTable = pgTable10("auth_oauth_initial_access_tokens", {
2653
+ token_hash: varchar10("token_hash", { length: ID_LENGTH8 }).primaryKey()
2622
2654
  });
2623
- var oauthLogoutDeliveriesTable = pgTable9("auth_oauth_logout_deliveries", {
2624
- attempts: bigint7("attempts", { mode: "number" }).notNull(),
2625
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2626
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2627
- endpoint_url: varchar9("endpoint_url", { length: URL_LENGTH }).notNull(),
2628
- id: varchar9("id", { length: ID_LENGTH7 }).primaryKey(),
2655
+ var oauthLogoutDeliveriesTable = pgTable10("auth_oauth_logout_deliveries", {
2656
+ attempts: bigint8("attempts", { mode: "number" }).notNull(),
2657
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2658
+ created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2659
+ endpoint_url: varchar10("endpoint_url", { length: URL_LENGTH }).notNull(),
2660
+ id: varchar10("id", { length: ID_LENGTH8 }).primaryKey(),
2629
2661
  last_error: text5("last_error"),
2630
- last_status: bigint7("last_status", { mode: "number" }),
2662
+ last_status: bigint8("last_status", { mode: "number" }),
2631
2663
  logout_token: text5("logout_token").notNull(),
2632
- user_id: varchar9("user_id", { length: ID_LENGTH7 }).notNull()
2664
+ user_id: varchar10("user_id", { length: ID_LENGTH8 }).notNull()
2633
2665
  });
2634
- var oauthPushedAuthorizationRequestsTable = pgTable9("auth_oauth_pushed_authorization_requests", {
2635
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2636
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2637
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2638
- params_json: jsonb4("params_json").$type().notNull(),
2639
- request_uri_hash: varchar9("request_uri_hash", {
2640
- length: ID_LENGTH7
2666
+ var oauthPushedAuthorizationRequestsTable = pgTable10("auth_oauth_pushed_authorization_requests", {
2667
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2668
+ created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2669
+ expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2670
+ params_json: jsonb5("params_json").$type().notNull(),
2671
+ request_uri_hash: varchar10("request_uri_hash", {
2672
+ length: ID_LENGTH8
2641
2673
  }).primaryKey()
2642
2674
  });
2643
- var oauthRefreshTokensTable = pgTable9("auth_oauth_refresh_tokens", {
2644
- acr: varchar9("acr", { length: ID_LENGTH7 }),
2645
- claims_json: jsonb4("claims_json").$type(),
2646
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2647
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2648
- dpop_jkt: varchar9("dpop_jkt", { length: ID_LENGTH7 }),
2649
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2675
+ var oauthRefreshTokensTable = pgTable10("auth_oauth_refresh_tokens", {
2676
+ acr: varchar10("acr", { length: ID_LENGTH8 }),
2677
+ claims_json: jsonb5("claims_json").$type(),
2678
+ client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
2679
+ created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2680
+ dpop_jkt: varchar10("dpop_jkt", { length: ID_LENGTH8 }),
2681
+ expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2650
2682
  scopes: text5("scopes").array().notNull(),
2651
- token_hash: varchar9("token_hash", { length: ID_LENGTH7 }).primaryKey(),
2652
- user_id: varchar9("user_id", { length: ID_LENGTH7 }).notNull()
2683
+ token_hash: varchar10("token_hash", { length: ID_LENGTH8 }).primaryKey(),
2684
+ user_id: varchar10("user_id", { length: ID_LENGTH8 }).notNull()
2653
2685
  });
2654
2686
 
2655
2687
  // src/organizations/postgresOrganizationStore.ts
2656
- import { and as and4, desc as desc6, eq as eq10 } from "drizzle-orm";
2688
+ import { and as and5, desc as desc7, eq as eq11 } from "drizzle-orm";
2657
2689
  import {
2658
- bigint as bigint8,
2659
- jsonb as jsonb5,
2660
- pgTable as pgTable10,
2690
+ bigint as bigint9,
2691
+ jsonb as jsonb6,
2692
+ pgTable as pgTable11,
2661
2693
  primaryKey as primaryKey2,
2662
- varchar as varchar10
2694
+ varchar as varchar11
2663
2695
  } from "drizzle-orm/pg-core";
2664
- var ID_LENGTH8 = 255;
2665
- var NAME_LENGTH = 255;
2696
+ var ID_LENGTH9 = 255;
2697
+ var NAME_LENGTH2 = 255;
2666
2698
  var STATE_LENGTH = 16;
2667
- var organizationInvitationsTable = pgTable10("auth_organization_invitations", {
2668
- accepted_at_ms: bigint8("accepted_at_ms", { mode: "number" }),
2669
- created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2670
- email: varchar10("email", { length: ID_LENGTH8 }).notNull(),
2671
- expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2672
- invitation_id: varchar10("invitation_id", {
2673
- length: ID_LENGTH8
2699
+ var organizationInvitationsTable = pgTable11("auth_organization_invitations", {
2700
+ accepted_at_ms: bigint9("accepted_at_ms", { mode: "number" }),
2701
+ created_at_ms: bigint9("created_at_ms", { mode: "number" }).notNull(),
2702
+ email: varchar11("email", { length: ID_LENGTH9 }).notNull(),
2703
+ expires_at_ms: bigint9("expires_at_ms", { mode: "number" }).notNull(),
2704
+ invitation_id: varchar11("invitation_id", {
2705
+ length: ID_LENGTH9
2674
2706
  }).primaryKey(),
2675
- inviter_user_id: varchar10("inviter_user_id", { length: ID_LENGTH8 }),
2676
- organization_id: varchar10("organization_id", {
2677
- length: ID_LENGTH8
2707
+ inviter_user_id: varchar11("inviter_user_id", { length: ID_LENGTH9 }),
2708
+ organization_id: varchar11("organization_id", {
2709
+ length: ID_LENGTH9
2678
2710
  }).notNull(),
2679
- roles: jsonb5("roles").$type().notNull().default([]),
2680
- state: varchar10("state", { length: STATE_LENGTH }).$type().notNull().default("pending"),
2681
- token_hash: varchar10("token_hash", { length: ID_LENGTH8 }).notNull().unique()
2711
+ roles: jsonb6("roles").$type().notNull().default([]),
2712
+ state: varchar11("state", { length: STATE_LENGTH }).$type().notNull().default("pending"),
2713
+ token_hash: varchar11("token_hash", { length: ID_LENGTH9 }).notNull().unique()
2682
2714
  });
2683
- var organizationMembershipsTable = pgTable10("auth_organization_memberships", {
2684
- created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2685
- organization_id: varchar10("organization_id", {
2686
- length: ID_LENGTH8
2715
+ var organizationMembershipsTable = pgTable11("auth_organization_memberships", {
2716
+ created_at_ms: bigint9("created_at_ms", { mode: "number" }).notNull(),
2717
+ organization_id: varchar11("organization_id", {
2718
+ length: ID_LENGTH9
2687
2719
  }).notNull(),
2688
- roles: jsonb5("roles").$type().notNull().default([]),
2689
- status: varchar10("status", { length: STATE_LENGTH }).$type().notNull().default("active"),
2690
- updated_at_ms: bigint8("updated_at_ms", { mode: "number" }).notNull(),
2691
- user_id: varchar10("user_id", { length: ID_LENGTH8 }).notNull()
2720
+ roles: jsonb6("roles").$type().notNull().default([]),
2721
+ status: varchar11("status", { length: STATE_LENGTH }).$type().notNull().default("active"),
2722
+ updated_at_ms: bigint9("updated_at_ms", { mode: "number" }).notNull(),
2723
+ user_id: varchar11("user_id", { length: ID_LENGTH9 }).notNull()
2692
2724
  }, (table) => [primaryKey2({ columns: [table.organization_id, table.user_id] })]);
2693
- var organizationsTable = pgTable10("auth_organizations", {
2694
- created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2695
- metadata: jsonb5("metadata").$type(),
2696
- name: varchar10("name", { length: NAME_LENGTH }).notNull(),
2697
- organization_id: varchar10("organization_id", {
2698
- length: ID_LENGTH8
2725
+ var organizationsTable = pgTable11("auth_organizations", {
2726
+ created_at_ms: bigint9("created_at_ms", { mode: "number" }).notNull(),
2727
+ metadata: jsonb6("metadata").$type(),
2728
+ name: varchar11("name", { length: NAME_LENGTH2 }).notNull(),
2729
+ organization_id: varchar11("organization_id", {
2730
+ length: ID_LENGTH9
2699
2731
  }).primaryKey(),
2700
- updated_at_ms: bigint8("updated_at_ms", { mode: "number" }).notNull()
2732
+ updated_at_ms: bigint9("updated_at_ms", { mode: "number" }).notNull()
2701
2733
  });
2702
2734
 
2703
2735
  // src/passwordless/postgresPasswordlessTokenStore.ts
2704
- import { eq as eq11 } from "drizzle-orm";
2705
- import { bigint as bigint9, pgTable as pgTable11, varchar as varchar11 } from "drizzle-orm/pg-core";
2706
- var ID_LENGTH9 = 255;
2707
- var passwordlessTokensTable = pgTable11("auth_passwordless_tokens", {
2708
- email: varchar11("email", { length: ID_LENGTH9 }).notNull(),
2709
- expires_at_ms: bigint9("expires_at_ms", { mode: "number" }).notNull(),
2710
- token_hash: varchar11("token_hash", { length: ID_LENGTH9 }).primaryKey()
2711
- });
2712
-
2713
- // src/portal/postgresSetupSessionStore.ts
2714
2736
  import { eq as eq12 } from "drizzle-orm";
2715
- import { bigint as bigint10, jsonb as jsonb6, pgTable as pgTable12, varchar as varchar12 } from "drizzle-orm/pg-core";
2737
+ import { bigint as bigint10, pgTable as pgTable12, varchar as varchar12 } from "drizzle-orm/pg-core";
2716
2738
  var ID_LENGTH10 = 255;
2717
- var setupSessionsTable = pgTable12("auth_setup_sessions", {
2718
- capabilities: jsonb6("capabilities").$type().notNull().default([]),
2719
- created_at_ms: bigint10("created_at_ms", { mode: "number" }).notNull(),
2720
- created_by: varchar12("created_by", { length: ID_LENGTH10 }),
2739
+ var passwordlessTokensTable = pgTable12("auth_passwordless_tokens", {
2740
+ email: varchar12("email", { length: ID_LENGTH10 }).notNull(),
2721
2741
  expires_at_ms: bigint10("expires_at_ms", { mode: "number" }).notNull(),
2722
- organization_id: varchar12("organization_id", {
2723
- length: ID_LENGTH10
2742
+ token_hash: varchar12("token_hash", { length: ID_LENGTH10 }).primaryKey()
2743
+ });
2744
+
2745
+ // src/portal/postgresSetupSessionStore.ts
2746
+ import { eq as eq13 } from "drizzle-orm";
2747
+ import { bigint as bigint11, jsonb as jsonb7, pgTable as pgTable13, varchar as varchar13 } from "drizzle-orm/pg-core";
2748
+ var ID_LENGTH11 = 255;
2749
+ var setupSessionsTable = pgTable13("auth_setup_sessions", {
2750
+ capabilities: jsonb7("capabilities").$type().notNull().default([]),
2751
+ created_at_ms: bigint11("created_at_ms", { mode: "number" }).notNull(),
2752
+ created_by: varchar13("created_by", { length: ID_LENGTH11 }),
2753
+ expires_at_ms: bigint11("expires_at_ms", { mode: "number" }).notNull(),
2754
+ organization_id: varchar13("organization_id", {
2755
+ length: ID_LENGTH11
2724
2756
  }).notNull(),
2725
- setup_session_id: varchar12("setup_session_id", {
2726
- length: ID_LENGTH10
2757
+ setup_session_id: varchar13("setup_session_id", {
2758
+ length: ID_LENGTH11
2727
2759
  }).primaryKey(),
2728
- token_hash: varchar12("token_hash", { length: ID_LENGTH10 }).notNull().unique()
2760
+ token_hash: varchar13("token_hash", { length: ID_LENGTH11 }).notNull().unique()
2729
2761
  });
2730
2762
 
2731
2763
  // src/roles/postgresRoleStore.ts
2732
- import { and as and5, eq as eq13 } from "drizzle-orm";
2764
+ import { and as and6, eq as eq14 } from "drizzle-orm";
2733
2765
  import {
2734
- bigint as bigint11,
2735
- jsonb as jsonb7,
2736
- pgTable as pgTable13,
2766
+ bigint as bigint12,
2767
+ jsonb as jsonb8,
2768
+ pgTable as pgTable14,
2737
2769
  primaryKey as primaryKey3,
2738
- varchar as varchar13
2770
+ varchar as varchar14
2739
2771
  } from "drizzle-orm/pg-core";
2740
- var ID_LENGTH11 = 255;
2772
+ var ID_LENGTH12 = 255;
2741
2773
  var SLUG_LENGTH = 128;
2742
2774
  var GLOBAL_SCOPE = "";
2743
- var rolesTable = pgTable13("auth_roles", {
2744
- created_at_ms: bigint11("created_at_ms", { mode: "number" }).notNull(),
2745
- organization_id: varchar13("organization_id", { length: ID_LENGTH11 }).notNull().default(GLOBAL_SCOPE),
2746
- permissions: jsonb7("permissions").$type().notNull().default([]),
2747
- slug: varchar13("slug", { length: SLUG_LENGTH }).notNull(),
2748
- updated_at_ms: bigint11("updated_at_ms", { mode: "number" }).notNull()
2775
+ var rolesTable = pgTable14("auth_roles", {
2776
+ created_at_ms: bigint12("created_at_ms", { mode: "number" }).notNull(),
2777
+ organization_id: varchar14("organization_id", { length: ID_LENGTH12 }).notNull().default(GLOBAL_SCOPE),
2778
+ permissions: jsonb8("permissions").$type().notNull().default([]),
2779
+ slug: varchar14("slug", { length: SLUG_LENGTH }).notNull(),
2780
+ updated_at_ms: bigint12("updated_at_ms", { mode: "number" }).notNull()
2749
2781
  }, (table) => [primaryKey3({ columns: [table.organization_id, table.slug] })]);
2750
2782
 
2751
2783
  // src/scim/postgresScimTokenStore.ts
2752
- import { desc as desc7, eq as eq14 } from "drizzle-orm";
2753
- import { bigint as bigint12, pgTable as pgTable14, varchar as varchar14 } from "drizzle-orm/pg-core";
2754
- var ID_LENGTH12 = 255;
2755
- var scimTokensTable = pgTable14("auth_scim_tokens", {
2756
- created_at_ms: bigint12("created_at_ms", { mode: "number" }).notNull(),
2757
- hashed_token: varchar14("hashed_token", { length: ID_LENGTH12 }).notNull(),
2758
- last_used_at_ms: bigint12("last_used_at_ms", { mode: "number" }),
2759
- organization_id: varchar14("organization_id", {
2760
- length: ID_LENGTH12
2784
+ import { desc as desc8, eq as eq15 } from "drizzle-orm";
2785
+ import { bigint as bigint13, pgTable as pgTable15, varchar as varchar15 } from "drizzle-orm/pg-core";
2786
+ var ID_LENGTH13 = 255;
2787
+ var scimTokensTable = pgTable15("auth_scim_tokens", {
2788
+ created_at_ms: bigint13("created_at_ms", { mode: "number" }).notNull(),
2789
+ hashed_token: varchar15("hashed_token", { length: ID_LENGTH13 }).notNull(),
2790
+ last_used_at_ms: bigint13("last_used_at_ms", { mode: "number" }),
2791
+ organization_id: varchar15("organization_id", {
2792
+ length: ID_LENGTH13
2761
2793
  }).notNull(),
2762
- token_id: varchar14("token_id", { length: ID_LENGTH12 }).primaryKey()
2794
+ token_id: varchar15("token_id", { length: ID_LENGTH13 }).primaryKey()
2763
2795
  });
2764
2796
 
2765
2797
  // src/session/neonStore.ts
2766
2798
  import { neon as neon4 } from "@neondatabase/serverless";
2767
- import { eq as eq15, lt as lt4 } from "drizzle-orm";
2799
+ import { eq as eq16, lt as lt4 } from "drizzle-orm";
2768
2800
  import { drizzle as drizzle3 } from "drizzle-orm/neon-http";
2769
2801
  import {
2770
- bigint as bigint13,
2802
+ bigint as bigint14,
2771
2803
  index,
2772
- jsonb as jsonb8,
2773
- pgTable as pgTable15,
2804
+ jsonb as jsonb9,
2805
+ pgTable as pgTable16,
2774
2806
  text as text6,
2775
2807
  timestamp as timestamp2,
2776
- varchar as varchar15
2808
+ varchar as varchar16
2777
2809
  } from "drizzle-orm/pg-core";
2778
- var authSessionsTable = pgTable15("auth_sessions", {
2810
+ var authSessionsTable = pgTable16("auth_sessions", {
2779
2811
  access_token: text6("access_token"),
2780
- authenticated_at_ms: bigint13("authenticated_at_ms", { mode: "number" }),
2812
+ authenticated_at_ms: bigint14("authenticated_at_ms", { mode: "number" }),
2781
2813
  created_at: timestamp2("created_at").notNull().defaultNow(),
2782
- expires_at_ms: bigint13("expires_at_ms", { mode: "number" }).notNull(),
2783
- id: varchar15("id", { length: 255 }).primaryKey(),
2814
+ expires_at_ms: bigint14("expires_at_ms", { mode: "number" }).notNull(),
2815
+ id: varchar16("id", { length: 255 }).primaryKey(),
2784
2816
  refresh_token: text6("refresh_token"),
2785
2817
  updated_at: timestamp2("updated_at").notNull().defaultNow(),
2786
- user_json: jsonb8("user_json").$type().notNull()
2818
+ user_json: jsonb9("user_json").$type().notNull()
2787
2819
  }, (table) => [index("auth_sessions_expires_at_idx").on(table.expires_at_ms)]);
2788
- var authUnregisteredSessionsTable = pgTable15("auth_unregistered_sessions", {
2820
+ var authUnregisteredSessionsTable = pgTable16("auth_unregistered_sessions", {
2789
2821
  access_token: text6("access_token"),
2790
2822
  created_at: timestamp2("created_at").notNull().defaultNow(),
2791
- expires_at_ms: bigint13("expires_at_ms", { mode: "number" }).notNull(),
2792
- id: varchar15("id", { length: 255 }).primaryKey(),
2823
+ expires_at_ms: bigint14("expires_at_ms", { mode: "number" }).notNull(),
2824
+ id: varchar16("id", { length: 255 }).primaryKey(),
2793
2825
  refresh_token: text6("refresh_token"),
2794
- session_information_json: jsonb8("session_information_json").$type(),
2826
+ session_information_json: jsonb9("session_information_json").$type(),
2795
2827
  updated_at: timestamp2("updated_at").notNull().defaultNow(),
2796
- user_identity_json: jsonb8("user_identity_json").$type()
2828
+ user_identity_json: jsonb9("user_identity_json").$type()
2797
2829
  }, (table) => [
2798
2830
  index("auth_unregistered_sessions_expires_at_idx").on(table.expires_at_ms)
2799
2831
  ]);
2800
2832
 
2801
2833
  // src/sso/postgresSamlServiceProviderStore.ts
2802
- import { eq as eq16 } from "drizzle-orm";
2803
- import { bigint as bigint14, pgTable as pgTable16, text as text7, varchar as varchar16 } from "drizzle-orm/pg-core";
2804
- var ID_LENGTH13 = 255;
2834
+ import { eq as eq17 } from "drizzle-orm";
2835
+ import { bigint as bigint15, pgTable as pgTable17, text as text7, varchar as varchar17 } from "drizzle-orm/pg-core";
2836
+ var ID_LENGTH14 = 255;
2805
2837
  var URL_LENGTH2 = 2048;
2806
- var samlServiceProvidersTable = pgTable16("auth_saml_service_providers", {
2807
- acs_url: varchar16("acs_url", { length: URL_LENGTH2 }).notNull(),
2808
- created_at_ms: bigint14("created_at_ms", { mode: "number" }).notNull(),
2809
- entity_id: varchar16("entity_id", { length: URL_LENGTH2 }).primaryKey(),
2810
- name_id_format: varchar16("name_id_format", { length: ID_LENGTH13 }),
2838
+ var samlServiceProvidersTable = pgTable17("auth_saml_service_providers", {
2839
+ acs_url: varchar17("acs_url", { length: URL_LENGTH2 }).notNull(),
2840
+ created_at_ms: bigint15("created_at_ms", { mode: "number" }).notNull(),
2841
+ entity_id: varchar17("entity_id", { length: URL_LENGTH2 }).primaryKey(),
2842
+ name_id_format: varchar17("name_id_format", { length: ID_LENGTH14 }),
2811
2843
  signing_cert: text7("signing_cert"),
2812
- updated_at_ms: bigint14("updated_at_ms", { mode: "number" }).notNull()
2844
+ updated_at_ms: bigint15("updated_at_ms", { mode: "number" }).notNull()
2813
2845
  });
2814
2846
 
2815
2847
  // src/sso/postgresSsoConnectionStore.ts
2816
- import { and as and6, desc as desc8, eq as eq17 } from "drizzle-orm";
2817
- import { bigint as bigint15, boolean as boolean5, jsonb as jsonb9, pgTable as pgTable17, varchar as varchar17 } from "drizzle-orm/pg-core";
2818
- var ID_LENGTH14 = 255;
2848
+ import { and as and7, desc as desc9, eq as eq18 } from "drizzle-orm";
2849
+ import { bigint as bigint16, boolean as boolean5, jsonb as jsonb10, pgTable as pgTable18, varchar as varchar18 } from "drizzle-orm/pg-core";
2850
+ var ID_LENGTH15 = 255;
2819
2851
  var TYPE_LENGTH2 = 16;
2820
- var ssoConnectionsTable = pgTable17("auth_sso_connections", {
2821
- config: jsonb9("config").$type().notNull(),
2822
- connection_id: varchar17("connection_id", { length: ID_LENGTH14 }).primaryKey(),
2823
- created_at_ms: bigint15("created_at_ms", { mode: "number" }).notNull(),
2852
+ var ssoConnectionsTable = pgTable18("auth_sso_connections", {
2853
+ config: jsonb10("config").$type().notNull(),
2854
+ connection_id: varchar18("connection_id", { length: ID_LENGTH15 }).primaryKey(),
2855
+ created_at_ms: bigint16("created_at_ms", { mode: "number" }).notNull(),
2824
2856
  enabled: boolean5("enabled").notNull().default(true),
2825
- organization_id: varchar17("organization_id", {
2826
- length: ID_LENGTH14
2857
+ organization_id: varchar18("organization_id", {
2858
+ length: ID_LENGTH15
2827
2859
  }).notNull(),
2828
- type: varchar17("type", { length: TYPE_LENGTH2 }).$type().notNull(),
2829
- updated_at_ms: bigint15("updated_at_ms", { mode: "number" }).notNull()
2860
+ type: varchar18("type", { length: TYPE_LENGTH2 }).$type().notNull(),
2861
+ updated_at_ms: bigint16("updated_at_ms", { mode: "number" }).notNull()
2830
2862
  });
2831
2863
 
2832
2864
  // src/vc/postgresVcStores.ts
2833
- import { eq as eq18 } from "drizzle-orm";
2834
- import { bigint as bigint16, boolean as boolean6, jsonb as jsonb10, pgTable as pgTable18, varchar as varchar18 } from "drizzle-orm/pg-core";
2835
- var ID_LENGTH15 = 255;
2836
- var vcCredentialNoncesTable = pgTable18("auth_vc_credential_nonces", {
2837
- expires_at_ms: bigint16("expires_at_ms", { mode: "number" }).notNull(),
2838
- nonce_hash: varchar18("nonce_hash", { length: ID_LENGTH15 }).primaryKey()
2865
+ import { eq as eq19 } from "drizzle-orm";
2866
+ import { bigint as bigint17, boolean as boolean6, jsonb as jsonb11, pgTable as pgTable19, varchar as varchar19 } from "drizzle-orm/pg-core";
2867
+ var ID_LENGTH16 = 255;
2868
+ var vcCredentialNoncesTable = pgTable19("auth_vc_credential_nonces", {
2869
+ expires_at_ms: bigint17("expires_at_ms", { mode: "number" }).notNull(),
2870
+ nonce_hash: varchar19("nonce_hash", { length: ID_LENGTH16 }).primaryKey()
2839
2871
  });
2840
- var vcCredentialOffersTable = pgTable18("auth_vc_credential_offers", {
2841
- client_id: varchar18("client_id", { length: ID_LENGTH15 }).notNull(),
2842
- configuration_id: varchar18("configuration_id", {
2843
- length: ID_LENGTH15
2872
+ var vcCredentialOffersTable = pgTable19("auth_vc_credential_offers", {
2873
+ client_id: varchar19("client_id", { length: ID_LENGTH16 }).notNull(),
2874
+ configuration_id: varchar19("configuration_id", {
2875
+ length: ID_LENGTH16
2844
2876
  }).notNull(),
2845
- created_at_ms: bigint16("created_at_ms", { mode: "number" }).notNull(),
2846
- expires_at_ms: bigint16("expires_at_ms", { mode: "number" }).notNull(),
2847
- pre_authorized_code_hash: varchar18("pre_authorized_code_hash", {
2848
- length: ID_LENGTH15
2877
+ created_at_ms: bigint17("created_at_ms", { mode: "number" }).notNull(),
2878
+ expires_at_ms: bigint17("expires_at_ms", { mode: "number" }).notNull(),
2879
+ pre_authorized_code_hash: varchar19("pre_authorized_code_hash", {
2880
+ length: ID_LENGTH16
2849
2881
  }).primaryKey(),
2850
2882
  redeemed: boolean6("redeemed").notNull(),
2851
- user_id: varchar18("user_id", { length: ID_LENGTH15 }).notNull()
2883
+ user_id: varchar19("user_id", { length: ID_LENGTH16 }).notNull()
2852
2884
  });
2853
- var vcPresentationRequestsTable = pgTable18("auth_vc_presentation_requests", {
2854
- client_id: varchar18("client_id", { length: ID_LENGTH15 }).notNull(),
2855
- created_at_ms: bigint16("created_at_ms", { mode: "number" }).notNull(),
2856
- expected_issuer_jwk_json: jsonb10("expected_issuer_jwk_json").$type().notNull(),
2857
- expires_at_ms: bigint16("expires_at_ms", { mode: "number" }).notNull(),
2858
- nonce: varchar18("nonce", { length: ID_LENGTH15 }).notNull(),
2859
- request_id: varchar18("request_id", { length: ID_LENGTH15 }).primaryKey(),
2860
- requested_claims: jsonb10("requested_claims").$type().notNull(),
2861
- response_uri: varchar18("response_uri", { length: ID_LENGTH15 }).notNull(),
2862
- state: varchar18("state", { length: ID_LENGTH15 })
2885
+ var vcPresentationRequestsTable = pgTable19("auth_vc_presentation_requests", {
2886
+ client_id: varchar19("client_id", { length: ID_LENGTH16 }).notNull(),
2887
+ created_at_ms: bigint17("created_at_ms", { mode: "number" }).notNull(),
2888
+ expected_issuer_jwk_json: jsonb11("expected_issuer_jwk_json").$type().notNull(),
2889
+ expires_at_ms: bigint17("expires_at_ms", { mode: "number" }).notNull(),
2890
+ nonce: varchar19("nonce", { length: ID_LENGTH16 }).notNull(),
2891
+ request_id: varchar19("request_id", { length: ID_LENGTH16 }).primaryKey(),
2892
+ requested_claims: jsonb11("requested_claims").$type().notNull(),
2893
+ response_uri: varchar19("response_uri", { length: ID_LENGTH16 }).notNull(),
2894
+ state: varchar19("state", { length: ID_LENGTH16 })
2863
2895
  });
2864
2896
 
2865
2897
  // src/vault/postgresVaultStore.ts
2866
- import { and as and7, eq as eq19 } from "drizzle-orm";
2898
+ import { and as and8, eq as eq20 } from "drizzle-orm";
2867
2899
  import {
2868
- bigint as bigint17,
2869
- pgTable as pgTable19,
2900
+ bigint as bigint18,
2901
+ pgTable as pgTable20,
2870
2902
  primaryKey as primaryKey4,
2871
2903
  text as text8,
2872
- varchar as varchar19
2904
+ varchar as varchar20
2873
2905
  } from "drizzle-orm/pg-core";
2874
- var ID_LENGTH16 = 255;
2875
- var vaultEntriesTable = pgTable19("auth_vault_entries", {
2876
- created_at_ms: bigint17("created_at_ms", { mode: "number" }).notNull(),
2906
+ var ID_LENGTH17 = 255;
2907
+ var vaultEntriesTable = pgTable20("auth_vault_entries", {
2908
+ created_at_ms: bigint18("created_at_ms", { mode: "number" }).notNull(),
2877
2909
  encrypted_value: text8("encrypted_value").notNull(),
2878
- name: varchar19("name", { length: ID_LENGTH16 }).notNull(),
2879
- owner_id: varchar19("owner_id", { length: ID_LENGTH16 }).notNull(),
2880
- updated_at_ms: bigint17("updated_at_ms", { mode: "number" }).notNull()
2910
+ name: varchar20("name", { length: ID_LENGTH17 }).notNull(),
2911
+ owner_id: varchar20("owner_id", { length: ID_LENGTH17 }).notNull(),
2912
+ updated_at_ms: bigint18("updated_at_ms", { mode: "number" }).notNull()
2881
2913
  }, (table) => ({ pk: primaryKey4({ columns: [table.owner_id, table.name] }) }));
2882
2914
 
2883
2915
  // src/webauthn/postgresWebAuthnCredentialStore.ts
2884
- import { eq as eq20 } from "drizzle-orm";
2916
+ import { eq as eq21 } from "drizzle-orm";
2885
2917
  import {
2886
- bigint as bigint18,
2918
+ bigint as bigint19,
2887
2919
  boolean as boolean7,
2888
- jsonb as jsonb11,
2889
- pgTable as pgTable20,
2920
+ jsonb as jsonb12,
2921
+ pgTable as pgTable21,
2890
2922
  text as text9,
2891
- varchar as varchar20
2923
+ varchar as varchar21
2892
2924
  } from "drizzle-orm/pg-core";
2893
- var ID_LENGTH17 = 255;
2925
+ var ID_LENGTH18 = 255;
2894
2926
  var DEVICE_TYPE_LENGTH = 32;
2895
- var webauthnCredentialsTable = pgTable20("auth_webauthn_credentials", {
2927
+ var webauthnCredentialsTable = pgTable21("auth_webauthn_credentials", {
2896
2928
  backed_up: boolean7("backed_up"),
2897
- counter: bigint18("counter", { mode: "number" }).notNull().default(0),
2898
- created_at_ms: bigint18("created_at_ms", { mode: "number" }).notNull(),
2899
- credential_id: varchar20("credential_id", { length: ID_LENGTH17 }).primaryKey(),
2900
- device_type: varchar20("device_type", { length: DEVICE_TYPE_LENGTH }),
2901
- last_used_at_ms: bigint18("last_used_at_ms", { mode: "number" }),
2929
+ counter: bigint19("counter", { mode: "number" }).notNull().default(0),
2930
+ created_at_ms: bigint19("created_at_ms", { mode: "number" }).notNull(),
2931
+ credential_id: varchar21("credential_id", { length: ID_LENGTH18 }).primaryKey(),
2932
+ device_type: varchar21("device_type", { length: DEVICE_TYPE_LENGTH }),
2933
+ last_used_at_ms: bigint19("last_used_at_ms", { mode: "number" }),
2902
2934
  public_key: text9("public_key").notNull(),
2903
- transports: jsonb11("transports").$type(),
2904
- user_id: varchar20("user_id", { length: ID_LENGTH17 }).notNull()
2935
+ transports: jsonb12("transports").$type(),
2936
+ user_id: varchar21("user_id", { length: ID_LENGTH18 }).notNull()
2905
2937
  });
2906
2938
 
2907
2939
  // src/webhooks/postgresStore.ts
2908
- import { desc as desc9, eq as eq21 } from "drizzle-orm";
2909
- import { bigint as bigint19, jsonb as jsonb12, pgTable as pgTable21, text as text10, varchar as varchar21 } from "drizzle-orm/pg-core";
2910
- var ID_LENGTH18 = 255;
2940
+ import { desc as desc10, eq as eq22 } from "drizzle-orm";
2941
+ import { bigint as bigint20, jsonb as jsonb13, pgTable as pgTable22, text as text10, varchar as varchar22 } from "drizzle-orm/pg-core";
2942
+ var ID_LENGTH19 = 255;
2911
2943
  var URL_LENGTH3 = 2048;
2912
- var webhookDeliveriesTable = pgTable21("auth_webhook_deliveries", {
2913
- attempts: bigint19("attempts", { mode: "number" }).notNull(),
2914
- created_at_ms: bigint19("created_at_ms", { mode: "number" }).notNull(),
2915
- endpoint_url: varchar21("endpoint_url", { length: URL_LENGTH3 }).notNull(),
2916
- envelope_id: varchar21("envelope_id", { length: ID_LENGTH18 }).primaryKey(),
2917
- envelope_json: jsonb12("envelope_json").$type().notNull(),
2944
+ var webhookDeliveriesTable = pgTable22("auth_webhook_deliveries", {
2945
+ attempts: bigint20("attempts", { mode: "number" }).notNull(),
2946
+ created_at_ms: bigint20("created_at_ms", { mode: "number" }).notNull(),
2947
+ endpoint_url: varchar22("endpoint_url", { length: URL_LENGTH3 }).notNull(),
2948
+ envelope_id: varchar22("envelope_id", { length: ID_LENGTH19 }).primaryKey(),
2949
+ envelope_json: jsonb13("envelope_json").$type().notNull(),
2918
2950
  last_error: text10("last_error"),
2919
- last_status: bigint19("last_status", { mode: "number" })
2951
+ last_status: bigint20("last_status", { mode: "number" })
2920
2952
  });
2921
2953
 
2922
2954
  // src/migrations/generate.ts
@@ -3049,6 +3081,10 @@ var mfaTotpLockoutMigration = {
3049
3081
  };
3050
3082
  var blockMigrations = {
3051
3083
  adaptive: initMigration("adaptive", [knownDevicesTable, loginHistoryTable]),
3084
+ agents: initMigration("agents", [
3085
+ agentRegistrationsTable,
3086
+ agentDelegationsTable
3087
+ ]),
3052
3088
  apikeys: initMigration("apikeys", [
3053
3089
  accessTokensTable,
3054
3090
  apiClientsTable,
@@ -3277,5 +3313,5 @@ var main = async () => {
3277
3313
  };
3278
3314
  await main();
3279
3315
 
3280
- //# debugId=C531C2A7A3FFA37664756E2164756E21
3316
+ //# debugId=0F50F54AA9959FD164756E2164756E21
3281
3317
  //# sourceMappingURL=migrate.js.map