@absolutejs/auth 0.54.5 → 0.54.7

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;
@@ -2452,472 +2483,472 @@ var revocableProviderOptions = Object.keys(providers).filter(isRevocableProvider
2452
2483
  var scopeRequiredProviderOptions = Object.keys(providers).filter(isScopeRequiredProviderOption);
2453
2484
 
2454
2485
  // src/linkedProviders/neonStores.ts
2455
- var linkedProviderBindingsTable = pgTable6("linked_provider_bindings", {
2456
- available_scopes: jsonb2("available_scopes").$type().notNull().default([]),
2457
- capabilities: jsonb2("capabilities").$type().default([]),
2458
- 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(),
2459
2490
  created_at: timestamp("created_at").notNull().defaultNow(),
2460
- email: varchar6("email", { length: 320 }),
2461
- external_account_id: varchar6("external_account_id", {
2491
+ email: varchar7("email", { length: 320 }),
2492
+ external_account_id: varchar7("external_account_id", {
2462
2493
  length: 255
2463
2494
  }).notNull(),
2464
- external_account_type: varchar6("external_account_type", {
2495
+ external_account_type: varchar7("external_account_type", {
2465
2496
  length: 64
2466
2497
  }).notNull(),
2467
- grant_id: varchar6("grant_id", { length: 255 }).notNull(),
2468
- id: varchar6("id", { length: 255 }).primaryKey(),
2469
- label: varchar6("label", { length: 255 }),
2470
- metadata: jsonb2("metadata").$type().default({}),
2471
- 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(),
2472
2503
  updated_at: timestamp("updated_at").notNull().defaultNow(),
2473
- username: varchar6("username", { length: 255 })
2504
+ username: varchar7("username", { length: 255 })
2474
2505
  });
2475
- var linkedProviderGrantsTable = pgTable6("linked_provider_grants", {
2506
+ var linkedProviderGrantsTable = pgTable7("linked_provider_grants", {
2476
2507
  access_token_ciphertext: text3("access_token_ciphertext"),
2477
- auth_provider_key: varchar6("auth_provider_key", { length: 64 }).notNull(),
2508
+ auth_provider_key: varchar7("auth_provider_key", { length: 64 }).notNull(),
2478
2509
  created_at: timestamp("created_at").notNull().defaultNow(),
2479
2510
  expires_at: timestamp("expires_at"),
2480
- granted_scopes: jsonb2("granted_scopes").$type().notNull().default([]),
2481
- id: varchar6("id", { length: 255 }).primaryKey(),
2511
+ granted_scopes: jsonb3("granted_scopes").$type().notNull().default([]),
2512
+ id: varchar7("id", { length: 255 }).primaryKey(),
2482
2513
  last_refresh_error: text3("last_refresh_error"),
2483
2514
  last_refreshed_at: timestamp("last_refreshed_at"),
2484
- metadata: jsonb2("metadata").$type().default({}),
2485
- owner_ref: varchar6("owner_ref", { length: 255 }).notNull(),
2486
- provider_family: varchar6("provider_family", { length: 64 }).notNull(),
2487
- 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(),
2488
2519
  refresh_token_ciphertext: text3("refresh_token_ciphertext"),
2489
- status: varchar6("status", { length: 64 }).$type().notNull(),
2490
- token_type: varchar6("token_type", { length: 64 }),
2520
+ status: varchar7("status", { length: 64 }).$type().notNull(),
2521
+ token_type: varchar7("token_type", { length: 64 }),
2491
2522
  updated_at: timestamp("updated_at").notNull().defaultNow()
2492
2523
  });
2493
2524
 
2494
2525
  // src/lockout/postgresLockoutStore.ts
2495
- import { eq as eq7 } from "drizzle-orm";
2496
- 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";
2497
2528
  var KEY_LENGTH = 320;
2498
- var lockoutsTable = pgTable7("auth_lockouts", {
2529
+ var lockoutsTable = pgTable8("auth_lockouts", {
2499
2530
  failed_attempts: integer("failed_attempts").notNull().default(0),
2500
- key: varchar7("key", { length: KEY_LENGTH }).primaryKey(),
2501
- locked_until_ms: bigint5("locked_until_ms", { mode: "number" }),
2502
- 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", {
2503
2534
  mode: "number"
2504
2535
  }).notNull()
2505
2536
  });
2506
2537
 
2507
2538
  // src/mfa/postgresMfaStore.ts
2508
- import { eq as eq8 } from "drizzle-orm";
2539
+ import { eq as eq9 } from "drizzle-orm";
2509
2540
  import {
2510
- bigint as bigint6,
2541
+ bigint as bigint7,
2511
2542
  boolean as boolean3,
2512
- jsonb as jsonb3,
2513
- pgTable as pgTable8,
2543
+ jsonb as jsonb4,
2544
+ pgTable as pgTable9,
2514
2545
  smallint,
2515
2546
  text as text4,
2516
- varchar as varchar8
2547
+ varchar as varchar9
2517
2548
  } from "drizzle-orm/pg-core";
2518
- var ID_LENGTH6 = 255;
2549
+ var ID_LENGTH7 = 255;
2519
2550
  var PHONE_LENGTH = 20;
2520
- var mfaEnrollmentsTable = pgTable8("auth_mfa_enrollments", {
2521
- backup_code_hashes: jsonb3("backup_code_hashes").$type().notNull().default([]),
2522
- created_at_ms: bigint6("created_at_ms", { mode: "number" }).notNull(),
2523
- 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" }),
2524
2555
  sms_failed_attempts: smallint("sms_failed_attempts").notNull().default(0),
2525
- 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", {
2526
2557
  mode: "number"
2527
2558
  }),
2528
2559
  sms_pending_code_hash: text4("sms_pending_code_hash"),
2529
- sms_phone: varchar8("sms_phone", { length: PHONE_LENGTH }),
2560
+ sms_phone: varchar9("sms_phone", { length: PHONE_LENGTH }),
2530
2561
  sms_verified: boolean3("sms_verified").notNull().default(false),
2531
2562
  totp_failed_attempts: smallint("totp_failed_attempts").notNull().default(0),
2532
2563
  totp_secret_ciphertext: text4("totp_secret_ciphertext"),
2533
2564
  totp_verified: boolean3("totp_verified").notNull().default(false),
2534
- updated_at_ms: bigint6("updated_at_ms", { mode: "number" }).notNull(),
2535
- 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()
2536
2567
  });
2537
2568
 
2538
2569
  // src/oidc/postgresStores.ts
2539
- 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";
2540
2571
  import {
2541
- bigint as bigint7,
2572
+ bigint as bigint8,
2542
2573
  boolean as boolean4,
2543
- jsonb as jsonb4,
2544
- pgTable as pgTable9,
2574
+ jsonb as jsonb5,
2575
+ pgTable as pgTable10,
2545
2576
  text as text5,
2546
- varchar as varchar9
2577
+ varchar as varchar10
2547
2578
  } from "drizzle-orm/pg-core";
2548
2579
  var URL_LENGTH = 2048;
2549
- var ID_LENGTH7 = 255;
2550
- var oauthBackchannelAuthRequestsTable = pgTable9("auth_oauth_backchannel_auth_requests", {
2551
- 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(),
2552
2583
  binding_message: text5("binding_message"),
2553
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2554
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2555
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2556
- 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", {
2557
2588
  mode: "number"
2558
2589
  }).notNull(),
2559
- last_polled_at_ms: bigint7("last_polled_at_ms", { mode: "number" }),
2590
+ last_polled_at_ms: bigint8("last_polled_at_ms", { mode: "number" }),
2560
2591
  scopes: text5("scopes").array().notNull(),
2561
- status: varchar9("status", { length: 16 }).notNull(),
2562
- user_sub: varchar9("user_sub", { length: ID_LENGTH7 })
2592
+ status: varchar10("status", { length: 16 }).notNull(),
2593
+ user_sub: varchar10("user_sub", { length: ID_LENGTH8 })
2563
2594
  });
2564
- var oauthClientAssertionJtisTable = pgTable9("auth_oauth_client_assertion_jtis", {
2565
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2566
- composite_key: varchar9("composite_key", {
2567
- 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
2568
2599
  }).primaryKey(),
2569
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2570
- 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()
2571
2602
  });
2572
- var oauthClientRegistrationTokensTable = pgTable9("auth_oauth_client_registration_tokens", {
2573
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2574
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2575
- 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()
2576
2607
  });
2577
- var oauthClientsTable = pgTable9("auth_oauth_clients", {
2578
- backchannel_logout_uri: varchar9("backchannel_logout_uri", {
2608
+ var oauthClientsTable = pgTable10("auth_oauth_clients", {
2609
+ backchannel_logout_uri: varchar10("backchannel_logout_uri", {
2579
2610
  length: URL_LENGTH
2580
2611
  }),
2581
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).primaryKey(),
2582
- hashed_secret: varchar9("hashed_secret", { length: ID_LENGTH7 }),
2583
- jwks_json: jsonb4("jwks_json").$type(),
2584
- jwks_uri: varchar9("jwks_uri", { length: URL_LENGTH }),
2585
- 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(),
2586
2617
  post_logout_redirect_uris: text5("post_logout_redirect_uris").array(),
2587
2618
  redirect_uris: text5("redirect_uris").array().notNull(),
2588
2619
  require_pushed_authorization_requests: boolean4("require_pushed_authorization_requests"),
2589
2620
  require_signed_request_object: boolean4("require_signed_request_object"),
2590
2621
  scopes: text5("scopes").array().notNull()
2591
2622
  });
2592
- var oauthCodesTable = pgTable9("auth_oauth_codes", {
2593
- acr: varchar9("acr", { length: ID_LENGTH7 }),
2594
- claims_json: jsonb4("claims_json").$type(),
2595
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2596
- code_challenge: varchar9("code_challenge", { length: ID_LENGTH7 }).notNull(),
2597
- code_hash: varchar9("code_hash", { length: ID_LENGTH7 }).primaryKey(),
2598
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2599
- dpop_jkt: varchar9("dpop_jkt", { length: ID_LENGTH7 }),
2600
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2601
- nonce: varchar9("nonce", { length: ID_LENGTH7 }),
2602
- 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(),
2603
2634
  scopes: text5("scopes").array().notNull(),
2604
- user_id: varchar9("user_id", { length: ID_LENGTH7 }).notNull()
2635
+ user_id: varchar10("user_id", { length: ID_LENGTH8 }).notNull()
2605
2636
  });
2606
- var oauthDeviceAuthorizationsTable = pgTable9("auth_oauth_device_authorizations", {
2607
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2608
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2609
- device_code_hash: varchar9("device_code_hash", {
2610
- 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
2611
2642
  }).primaryKey(),
2612
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2613
- interval_seconds: bigint7("interval_seconds", {
2643
+ expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2644
+ interval_seconds: bigint8("interval_seconds", {
2614
2645
  mode: "number"
2615
2646
  }).notNull(),
2616
2647
  scopes: text5("scopes").array().notNull(),
2617
- status: varchar9("status", { length: 16 }).notNull(),
2618
- user_code: varchar9("user_code", { length: 16 }).notNull().unique(),
2619
- 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 })
2620
2651
  });
2621
- var oauthInitialAccessTokensTable = pgTable9("auth_oauth_initial_access_tokens", {
2622
- 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()
2623
2654
  });
2624
- var oauthLogoutDeliveriesTable = pgTable9("auth_oauth_logout_deliveries", {
2625
- attempts: bigint7("attempts", { mode: "number" }).notNull(),
2626
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2627
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2628
- endpoint_url: varchar9("endpoint_url", { length: URL_LENGTH }).notNull(),
2629
- 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(),
2630
2661
  last_error: text5("last_error"),
2631
- last_status: bigint7("last_status", { mode: "number" }),
2662
+ last_status: bigint8("last_status", { mode: "number" }),
2632
2663
  logout_token: text5("logout_token").notNull(),
2633
- user_id: varchar9("user_id", { length: ID_LENGTH7 }).notNull()
2664
+ user_id: varchar10("user_id", { length: ID_LENGTH8 }).notNull()
2634
2665
  });
2635
- var oauthPushedAuthorizationRequestsTable = pgTable9("auth_oauth_pushed_authorization_requests", {
2636
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2637
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2638
- expires_at_ms: bigint7("expires_at_ms", { mode: "number" }).notNull(),
2639
- params_json: jsonb4("params_json").$type().notNull(),
2640
- request_uri_hash: varchar9("request_uri_hash", {
2641
- 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
2642
2673
  }).primaryKey()
2643
2674
  });
2644
- var oauthRefreshTokensTable = pgTable9("auth_oauth_refresh_tokens", {
2645
- acr: varchar9("acr", { length: ID_LENGTH7 }),
2646
- claims_json: jsonb4("claims_json").$type(),
2647
- client_id: varchar9("client_id", { length: ID_LENGTH7 }).notNull(),
2648
- created_at_ms: bigint7("created_at_ms", { mode: "number" }).notNull(),
2649
- dpop_jkt: varchar9("dpop_jkt", { length: ID_LENGTH7 }),
2650
- 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(),
2651
2682
  scopes: text5("scopes").array().notNull(),
2652
- token_hash: varchar9("token_hash", { length: ID_LENGTH7 }).primaryKey(),
2653
- 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()
2654
2685
  });
2655
2686
 
2656
2687
  // src/organizations/postgresOrganizationStore.ts
2657
- 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";
2658
2689
  import {
2659
- bigint as bigint8,
2660
- jsonb as jsonb5,
2661
- pgTable as pgTable10,
2690
+ bigint as bigint9,
2691
+ jsonb as jsonb6,
2692
+ pgTable as pgTable11,
2662
2693
  primaryKey as primaryKey2,
2663
- varchar as varchar10
2694
+ varchar as varchar11
2664
2695
  } from "drizzle-orm/pg-core";
2665
- var ID_LENGTH8 = 255;
2666
- var NAME_LENGTH = 255;
2696
+ var ID_LENGTH9 = 255;
2697
+ var NAME_LENGTH2 = 255;
2667
2698
  var STATE_LENGTH = 16;
2668
- var organizationInvitationsTable = pgTable10("auth_organization_invitations", {
2669
- accepted_at_ms: bigint8("accepted_at_ms", { mode: "number" }),
2670
- created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2671
- email: varchar10("email", { length: ID_LENGTH8 }).notNull(),
2672
- expires_at_ms: bigint8("expires_at_ms", { mode: "number" }).notNull(),
2673
- invitation_id: varchar10("invitation_id", {
2674
- 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
2675
2706
  }).primaryKey(),
2676
- inviter_user_id: varchar10("inviter_user_id", { length: ID_LENGTH8 }),
2677
- organization_id: varchar10("organization_id", {
2678
- length: ID_LENGTH8
2707
+ inviter_user_id: varchar11("inviter_user_id", { length: ID_LENGTH9 }),
2708
+ organization_id: varchar11("organization_id", {
2709
+ length: ID_LENGTH9
2679
2710
  }).notNull(),
2680
- roles: jsonb5("roles").$type().notNull().default([]),
2681
- state: varchar10("state", { length: STATE_LENGTH }).$type().notNull().default("pending"),
2682
- 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()
2683
2714
  });
2684
- var organizationMembershipsTable = pgTable10("auth_organization_memberships", {
2685
- created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2686
- organization_id: varchar10("organization_id", {
2687
- 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
2688
2719
  }).notNull(),
2689
- roles: jsonb5("roles").$type().notNull().default([]),
2690
- status: varchar10("status", { length: STATE_LENGTH }).$type().notNull().default("active"),
2691
- updated_at_ms: bigint8("updated_at_ms", { mode: "number" }).notNull(),
2692
- 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()
2693
2724
  }, (table) => [primaryKey2({ columns: [table.organization_id, table.user_id] })]);
2694
- var organizationsTable = pgTable10("auth_organizations", {
2695
- created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
2696
- metadata: jsonb5("metadata").$type(),
2697
- name: varchar10("name", { length: NAME_LENGTH }).notNull(),
2698
- organization_id: varchar10("organization_id", {
2699
- 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
2700
2731
  }).primaryKey(),
2701
- updated_at_ms: bigint8("updated_at_ms", { mode: "number" }).notNull()
2732
+ updated_at_ms: bigint9("updated_at_ms", { mode: "number" }).notNull()
2702
2733
  });
2703
2734
 
2704
2735
  // src/passwordless/postgresPasswordlessTokenStore.ts
2705
- import { eq as eq11 } from "drizzle-orm";
2706
- import { bigint as bigint9, pgTable as pgTable11, varchar as varchar11 } from "drizzle-orm/pg-core";
2707
- var ID_LENGTH9 = 255;
2708
- var passwordlessTokensTable = pgTable11("auth_passwordless_tokens", {
2709
- email: varchar11("email", { length: ID_LENGTH9 }).notNull(),
2710
- expires_at_ms: bigint9("expires_at_ms", { mode: "number" }).notNull(),
2711
- token_hash: varchar11("token_hash", { length: ID_LENGTH9 }).primaryKey()
2712
- });
2713
-
2714
- // src/portal/postgresSetupSessionStore.ts
2715
2736
  import { eq as eq12 } from "drizzle-orm";
2716
- 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";
2717
2738
  var ID_LENGTH10 = 255;
2718
- var setupSessionsTable = pgTable12("auth_setup_sessions", {
2719
- capabilities: jsonb6("capabilities").$type().notNull().default([]),
2720
- created_at_ms: bigint10("created_at_ms", { mode: "number" }).notNull(),
2721
- created_by: varchar12("created_by", { length: ID_LENGTH10 }),
2739
+ var passwordlessTokensTable = pgTable12("auth_passwordless_tokens", {
2740
+ email: varchar12("email", { length: ID_LENGTH10 }).notNull(),
2722
2741
  expires_at_ms: bigint10("expires_at_ms", { mode: "number" }).notNull(),
2723
- organization_id: varchar12("organization_id", {
2724
- 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
2725
2756
  }).notNull(),
2726
- setup_session_id: varchar12("setup_session_id", {
2727
- length: ID_LENGTH10
2757
+ setup_session_id: varchar13("setup_session_id", {
2758
+ length: ID_LENGTH11
2728
2759
  }).primaryKey(),
2729
- token_hash: varchar12("token_hash", { length: ID_LENGTH10 }).notNull().unique()
2760
+ token_hash: varchar13("token_hash", { length: ID_LENGTH11 }).notNull().unique()
2730
2761
  });
2731
2762
 
2732
2763
  // src/roles/postgresRoleStore.ts
2733
- import { and as and5, eq as eq13 } from "drizzle-orm";
2764
+ import { and as and6, eq as eq14 } from "drizzle-orm";
2734
2765
  import {
2735
- bigint as bigint11,
2736
- jsonb as jsonb7,
2737
- pgTable as pgTable13,
2766
+ bigint as bigint12,
2767
+ jsonb as jsonb8,
2768
+ pgTable as pgTable14,
2738
2769
  primaryKey as primaryKey3,
2739
- varchar as varchar13
2770
+ varchar as varchar14
2740
2771
  } from "drizzle-orm/pg-core";
2741
- var ID_LENGTH11 = 255;
2772
+ var ID_LENGTH12 = 255;
2742
2773
  var SLUG_LENGTH = 128;
2743
2774
  var GLOBAL_SCOPE = "";
2744
- var rolesTable = pgTable13("auth_roles", {
2745
- created_at_ms: bigint11("created_at_ms", { mode: "number" }).notNull(),
2746
- organization_id: varchar13("organization_id", { length: ID_LENGTH11 }).notNull().default(GLOBAL_SCOPE),
2747
- permissions: jsonb7("permissions").$type().notNull().default([]),
2748
- slug: varchar13("slug", { length: SLUG_LENGTH }).notNull(),
2749
- 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()
2750
2781
  }, (table) => [primaryKey3({ columns: [table.organization_id, table.slug] })]);
2751
2782
 
2752
2783
  // src/scim/postgresScimTokenStore.ts
2753
- import { desc as desc7, eq as eq14 } from "drizzle-orm";
2754
- import { bigint as bigint12, pgTable as pgTable14, varchar as varchar14 } from "drizzle-orm/pg-core";
2755
- var ID_LENGTH12 = 255;
2756
- var scimTokensTable = pgTable14("auth_scim_tokens", {
2757
- created_at_ms: bigint12("created_at_ms", { mode: "number" }).notNull(),
2758
- hashed_token: varchar14("hashed_token", { length: ID_LENGTH12 }).notNull(),
2759
- last_used_at_ms: bigint12("last_used_at_ms", { mode: "number" }),
2760
- organization_id: varchar14("organization_id", {
2761
- 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
2762
2793
  }).notNull(),
2763
- token_id: varchar14("token_id", { length: ID_LENGTH12 }).primaryKey()
2794
+ token_id: varchar15("token_id", { length: ID_LENGTH13 }).primaryKey()
2764
2795
  });
2765
2796
 
2766
2797
  // src/session/neonStore.ts
2767
2798
  import { neon as neon4 } from "@neondatabase/serverless";
2768
- import { eq as eq15, lt as lt4 } from "drizzle-orm";
2799
+ import { eq as eq16, lt as lt4 } from "drizzle-orm";
2769
2800
  import { drizzle as drizzle3 } from "drizzle-orm/neon-http";
2770
2801
  import {
2771
- bigint as bigint13,
2802
+ bigint as bigint14,
2772
2803
  index,
2773
- jsonb as jsonb8,
2774
- pgTable as pgTable15,
2804
+ jsonb as jsonb9,
2805
+ pgTable as pgTable16,
2775
2806
  text as text6,
2776
2807
  timestamp as timestamp2,
2777
- varchar as varchar15
2808
+ varchar as varchar16
2778
2809
  } from "drizzle-orm/pg-core";
2779
- var authSessionsTable = pgTable15("auth_sessions", {
2810
+ var authSessionsTable = pgTable16("auth_sessions", {
2780
2811
  access_token: text6("access_token"),
2781
- authenticated_at_ms: bigint13("authenticated_at_ms", { mode: "number" }),
2812
+ authenticated_at_ms: bigint14("authenticated_at_ms", { mode: "number" }),
2782
2813
  created_at: timestamp2("created_at").notNull().defaultNow(),
2783
- expires_at_ms: bigint13("expires_at_ms", { mode: "number" }).notNull(),
2784
- id: varchar15("id", { length: 255 }).primaryKey(),
2814
+ expires_at_ms: bigint14("expires_at_ms", { mode: "number" }).notNull(),
2815
+ id: varchar16("id", { length: 255 }).primaryKey(),
2785
2816
  refresh_token: text6("refresh_token"),
2786
2817
  updated_at: timestamp2("updated_at").notNull().defaultNow(),
2787
- user_json: jsonb8("user_json").$type().notNull()
2818
+ user_json: jsonb9("user_json").$type().notNull()
2788
2819
  }, (table) => [index("auth_sessions_expires_at_idx").on(table.expires_at_ms)]);
2789
- var authUnregisteredSessionsTable = pgTable15("auth_unregistered_sessions", {
2820
+ var authUnregisteredSessionsTable = pgTable16("auth_unregistered_sessions", {
2790
2821
  access_token: text6("access_token"),
2791
2822
  created_at: timestamp2("created_at").notNull().defaultNow(),
2792
- expires_at_ms: bigint13("expires_at_ms", { mode: "number" }).notNull(),
2793
- id: varchar15("id", { length: 255 }).primaryKey(),
2823
+ expires_at_ms: bigint14("expires_at_ms", { mode: "number" }).notNull(),
2824
+ id: varchar16("id", { length: 255 }).primaryKey(),
2794
2825
  refresh_token: text6("refresh_token"),
2795
- session_information_json: jsonb8("session_information_json").$type(),
2826
+ session_information_json: jsonb9("session_information_json").$type(),
2796
2827
  updated_at: timestamp2("updated_at").notNull().defaultNow(),
2797
- user_identity_json: jsonb8("user_identity_json").$type()
2828
+ user_identity_json: jsonb9("user_identity_json").$type()
2798
2829
  }, (table) => [
2799
2830
  index("auth_unregistered_sessions_expires_at_idx").on(table.expires_at_ms)
2800
2831
  ]);
2801
2832
 
2802
2833
  // src/sso/postgresSamlServiceProviderStore.ts
2803
- import { eq as eq16 } from "drizzle-orm";
2804
- import { bigint as bigint14, pgTable as pgTable16, text as text7, varchar as varchar16 } from "drizzle-orm/pg-core";
2805
- 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;
2806
2837
  var URL_LENGTH2 = 2048;
2807
- var samlServiceProvidersTable = pgTable16("auth_saml_service_providers", {
2808
- acs_url: varchar16("acs_url", { length: URL_LENGTH2 }).notNull(),
2809
- created_at_ms: bigint14("created_at_ms", { mode: "number" }).notNull(),
2810
- entity_id: varchar16("entity_id", { length: URL_LENGTH2 }).primaryKey(),
2811
- 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 }),
2812
2843
  signing_cert: text7("signing_cert"),
2813
- updated_at_ms: bigint14("updated_at_ms", { mode: "number" }).notNull()
2844
+ updated_at_ms: bigint15("updated_at_ms", { mode: "number" }).notNull()
2814
2845
  });
2815
2846
 
2816
2847
  // src/sso/postgresSsoConnectionStore.ts
2817
- import { and as and6, desc as desc8, eq as eq17 } from "drizzle-orm";
2818
- import { bigint as bigint15, boolean as boolean5, jsonb as jsonb9, pgTable as pgTable17, varchar as varchar17 } from "drizzle-orm/pg-core";
2819
- 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;
2820
2851
  var TYPE_LENGTH2 = 16;
2821
- var ssoConnectionsTable = pgTable17("auth_sso_connections", {
2822
- config: jsonb9("config").$type().notNull(),
2823
- connection_id: varchar17("connection_id", { length: ID_LENGTH14 }).primaryKey(),
2824
- 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(),
2825
2856
  enabled: boolean5("enabled").notNull().default(true),
2826
- organization_id: varchar17("organization_id", {
2827
- length: ID_LENGTH14
2857
+ organization_id: varchar18("organization_id", {
2858
+ length: ID_LENGTH15
2828
2859
  }).notNull(),
2829
- type: varchar17("type", { length: TYPE_LENGTH2 }).$type().notNull(),
2830
- 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()
2831
2862
  });
2832
2863
 
2833
2864
  // src/vc/postgresVcStores.ts
2834
- import { eq as eq18 } from "drizzle-orm";
2835
- import { bigint as bigint16, boolean as boolean6, jsonb as jsonb10, pgTable as pgTable18, varchar as varchar18 } from "drizzle-orm/pg-core";
2836
- var ID_LENGTH15 = 255;
2837
- var vcCredentialNoncesTable = pgTable18("auth_vc_credential_nonces", {
2838
- expires_at_ms: bigint16("expires_at_ms", { mode: "number" }).notNull(),
2839
- 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()
2840
2871
  });
2841
- var vcCredentialOffersTable = pgTable18("auth_vc_credential_offers", {
2842
- client_id: varchar18("client_id", { length: ID_LENGTH15 }).notNull(),
2843
- configuration_id: varchar18("configuration_id", {
2844
- 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
2845
2876
  }).notNull(),
2846
- created_at_ms: bigint16("created_at_ms", { mode: "number" }).notNull(),
2847
- expires_at_ms: bigint16("expires_at_ms", { mode: "number" }).notNull(),
2848
- pre_authorized_code_hash: varchar18("pre_authorized_code_hash", {
2849
- 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
2850
2881
  }).primaryKey(),
2851
2882
  redeemed: boolean6("redeemed").notNull(),
2852
- user_id: varchar18("user_id", { length: ID_LENGTH15 }).notNull()
2883
+ user_id: varchar19("user_id", { length: ID_LENGTH16 }).notNull()
2853
2884
  });
2854
- var vcPresentationRequestsTable = pgTable18("auth_vc_presentation_requests", {
2855
- client_id: varchar18("client_id", { length: ID_LENGTH15 }).notNull(),
2856
- created_at_ms: bigint16("created_at_ms", { mode: "number" }).notNull(),
2857
- expected_issuer_jwk_json: jsonb10("expected_issuer_jwk_json").$type().notNull(),
2858
- expires_at_ms: bigint16("expires_at_ms", { mode: "number" }).notNull(),
2859
- nonce: varchar18("nonce", { length: ID_LENGTH15 }).notNull(),
2860
- request_id: varchar18("request_id", { length: ID_LENGTH15 }).primaryKey(),
2861
- requested_claims: jsonb10("requested_claims").$type().notNull(),
2862
- response_uri: varchar18("response_uri", { length: ID_LENGTH15 }).notNull(),
2863
- 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 })
2864
2895
  });
2865
2896
 
2866
2897
  // src/vault/postgresVaultStore.ts
2867
- import { and as and7, eq as eq19 } from "drizzle-orm";
2898
+ import { and as and8, eq as eq20 } from "drizzle-orm";
2868
2899
  import {
2869
- bigint as bigint17,
2870
- pgTable as pgTable19,
2900
+ bigint as bigint18,
2901
+ pgTable as pgTable20,
2871
2902
  primaryKey as primaryKey4,
2872
2903
  text as text8,
2873
- varchar as varchar19
2904
+ varchar as varchar20
2874
2905
  } from "drizzle-orm/pg-core";
2875
- var ID_LENGTH16 = 255;
2876
- var vaultEntriesTable = pgTable19("auth_vault_entries", {
2877
- 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(),
2878
2909
  encrypted_value: text8("encrypted_value").notNull(),
2879
- name: varchar19("name", { length: ID_LENGTH16 }).notNull(),
2880
- owner_id: varchar19("owner_id", { length: ID_LENGTH16 }).notNull(),
2881
- 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()
2882
2913
  }, (table) => ({ pk: primaryKey4({ columns: [table.owner_id, table.name] }) }));
2883
2914
 
2884
2915
  // src/webauthn/postgresWebAuthnCredentialStore.ts
2885
- import { eq as eq20 } from "drizzle-orm";
2916
+ import { eq as eq21 } from "drizzle-orm";
2886
2917
  import {
2887
- bigint as bigint18,
2918
+ bigint as bigint19,
2888
2919
  boolean as boolean7,
2889
- jsonb as jsonb11,
2890
- pgTable as pgTable20,
2920
+ jsonb as jsonb12,
2921
+ pgTable as pgTable21,
2891
2922
  text as text9,
2892
- varchar as varchar20
2923
+ varchar as varchar21
2893
2924
  } from "drizzle-orm/pg-core";
2894
- var ID_LENGTH17 = 255;
2925
+ var ID_LENGTH18 = 255;
2895
2926
  var DEVICE_TYPE_LENGTH = 32;
2896
- var webauthnCredentialsTable = pgTable20("auth_webauthn_credentials", {
2927
+ var webauthnCredentialsTable = pgTable21("auth_webauthn_credentials", {
2897
2928
  backed_up: boolean7("backed_up"),
2898
- counter: bigint18("counter", { mode: "number" }).notNull().default(0),
2899
- created_at_ms: bigint18("created_at_ms", { mode: "number" }).notNull(),
2900
- credential_id: varchar20("credential_id", { length: ID_LENGTH17 }).primaryKey(),
2901
- device_type: varchar20("device_type", { length: DEVICE_TYPE_LENGTH }),
2902
- 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" }),
2903
2934
  public_key: text9("public_key").notNull(),
2904
- transports: jsonb11("transports").$type(),
2905
- user_id: varchar20("user_id", { length: ID_LENGTH17 }).notNull()
2935
+ transports: jsonb12("transports").$type(),
2936
+ user_id: varchar21("user_id", { length: ID_LENGTH18 }).notNull()
2906
2937
  });
2907
2938
 
2908
2939
  // src/webhooks/postgresStore.ts
2909
- import { desc as desc9, eq as eq21 } from "drizzle-orm";
2910
- import { bigint as bigint19, jsonb as jsonb12, pgTable as pgTable21, text as text10, varchar as varchar21 } from "drizzle-orm/pg-core";
2911
- 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;
2912
2943
  var URL_LENGTH3 = 2048;
2913
- var webhookDeliveriesTable = pgTable21("auth_webhook_deliveries", {
2914
- attempts: bigint19("attempts", { mode: "number" }).notNull(),
2915
- created_at_ms: bigint19("created_at_ms", { mode: "number" }).notNull(),
2916
- endpoint_url: varchar21("endpoint_url", { length: URL_LENGTH3 }).notNull(),
2917
- envelope_id: varchar21("envelope_id", { length: ID_LENGTH18 }).primaryKey(),
2918
- 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(),
2919
2950
  last_error: text10("last_error"),
2920
- last_status: bigint19("last_status", { mode: "number" })
2951
+ last_status: bigint20("last_status", { mode: "number" })
2921
2952
  });
2922
2953
 
2923
2954
  // src/migrations/generate.ts
@@ -3050,6 +3081,10 @@ var mfaTotpLockoutMigration = {
3050
3081
  };
3051
3082
  var blockMigrations = {
3052
3083
  adaptive: initMigration("adaptive", [knownDevicesTable, loginHistoryTable]),
3084
+ agents: initMigration("agents", [
3085
+ agentRegistrationsTable,
3086
+ agentDelegationsTable
3087
+ ]),
3053
3088
  apikeys: initMigration("apikeys", [
3054
3089
  accessTokensTable,
3055
3090
  apiClientsTable,
@@ -3278,5 +3313,5 @@ var main = async () => {
3278
3313
  };
3279
3314
  await main();
3280
3315
 
3281
- //# debugId=5C399F0B338A96F864756E2164756E21
3316
+ //# debugId=0F50F54AA9959FD164756E2164756E21
3282
3317
  //# sourceMappingURL=migrate.js.map