@absolutejs/auth 0.75.6 → 0.75.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.
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  }
20
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
22
+ if (mod && typeof mod === "object" || typeof mod === "function") {
23
+ for (let key of __getOwnPropNames(mod))
24
+ if (!__hasOwnProp.call(to, key))
25
+ __defProp(to, key, {
26
+ get: __accessProp.bind(mod, key),
27
+ enumerable: true
28
+ });
29
+ }
28
30
  if (canCache)
29
31
  cache.set(mod, to);
30
32
  return to;
@@ -58,20 +60,20 @@ var init_constants = __esm(() => {
58
60
  // src/crypto.ts
59
61
  var exports_crypto = {};
60
62
  __export(exports_crypto, {
61
- verifyTotp: () => verifyTotp,
62
- verifyPassword: () => verifyPassword,
63
- hashToken: () => hashToken,
64
- hashPassword: () => hashPassword,
65
- generateTotpSecret: () => generateTotpSecret,
66
- generateTotp: () => generateTotp,
67
- generateSecureToken: () => generateSecureToken,
68
- generateEncryptionKey: () => generateEncryptionKey,
69
- encryptSecret: () => encryptSecret,
70
- decryptSecret: () => decryptSecret,
71
- createTotpKeyUri: () => createTotpKeyUri,
72
- constantTimeEqual: () => constantTimeEqual,
63
+ base32Decode: () => base32Decode,
73
64
  base32Encode: () => base32Encode,
74
- base32Decode: () => base32Decode
65
+ constantTimeEqual: () => constantTimeEqual,
66
+ createTotpKeyUri: () => createTotpKeyUri,
67
+ decryptSecret: () => decryptSecret,
68
+ encryptSecret: () => encryptSecret,
69
+ generateEncryptionKey: () => generateEncryptionKey,
70
+ generateSecureToken: () => generateSecureToken,
71
+ generateTotp: () => generateTotp,
72
+ generateTotpSecret: () => generateTotpSecret,
73
+ hashPassword: () => hashPassword,
74
+ hashToken: () => hashToken,
75
+ verifyPassword: () => verifyPassword,
76
+ verifyTotp: () => verifyTotp
75
77
  });
76
78
  var DEFAULT_TOKEN_BYTES = 32, AES_KEY_BYTES = 32, AES_IV_BYTES = 12, HOTP_COUNTER_BYTES = 8, TOTP_SECRET_BYTES = 20, TOTP_DIGITS = 6, TOTP_PERIOD_SECONDS = 30, DEFAULT_TOTP_WINDOW = 1, DECIMAL_RADIX = 10, LAST_NIBBLE_MASK = 15, SIGN_BIT_MASK = 2147483647, BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", BASE32_GROUP_BITS = 5, BASE32_MASK = 31, BYTE_BITS = 8, textEncoder, textDecoder, base64UrlEncode = (bytes) => Buffer.from(bytes).toString("base64url"), base64UrlDecode = (encoded) => new Uint8Array(Buffer.from(encoded, "base64url")), sha256 = async (input) => {
77
79
  const digest = await crypto.subtle.digest("SHA-256", textEncoder.encode(input));
@@ -2101,6 +2103,9 @@ var tracer = { startActiveSpan(name, fn) {
2101
2103
  var ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
2102
2104
 
2103
2105
  // node_modules/drizzle-orm/sql/sql.js
2106
+ var FakePrimitiveParam = class {
2107
+ static [entityKind] = "FakePrimitiveParam";
2108
+ };
2104
2109
  function isSQLWrapper(value) {
2105
2110
  return value !== null && value !== undefined && typeof value.getSQL === "function";
2106
2111
  }
@@ -5778,6 +5783,16 @@ var UniqueConstraintBuilder = class {
5778
5783
  return new UniqueConstraint(table, this.columns, this.nullsNotDistinctConfig, this.name);
5779
5784
  }
5780
5785
  };
5786
+ var UniqueOnConstraintBuilder = class {
5787
+ static [entityKind] = "PgUniqueOnConstraintBuilder";
5788
+ name;
5789
+ constructor(name2) {
5790
+ this.name = name2;
5791
+ }
5792
+ on(...columns) {
5793
+ return new UniqueConstraintBuilder(columns, this.name);
5794
+ }
5795
+ };
5781
5796
  var UniqueConstraint = class {
5782
5797
  static [entityKind] = "PgUniqueConstraint";
5783
5798
  columns;
@@ -11053,6 +11068,17 @@ var ColumnAliasProxyHandler2 = class {
11053
11068
  return target[prop];
11054
11069
  }
11055
11070
  };
11071
+ var RelationTableAliasProxyHandler2 = class {
11072
+ static [entityKind] = "RelationTableAliasProxyHandler";
11073
+ constructor(alias2) {
11074
+ this.alias = alias2;
11075
+ }
11076
+ get(target, prop) {
11077
+ if (prop === "sourceTable")
11078
+ return aliasedTable2(target.sourceTable, this.alias);
11079
+ return target[prop];
11080
+ }
11081
+ };
11056
11082
  function aliasedTable2(table, tableAlias) {
11057
11083
  return new Proxy(table, new TableAliasProxyHandler2(tableAlias, false, false));
11058
11084
  }
@@ -11536,6 +11562,13 @@ params: ${params}`);
11536
11562
  this.cause = cause;
11537
11563
  }
11538
11564
  };
11565
+ var TransactionRollbackError2 = class extends DrizzleError2 {
11566
+ static [entityKind] = "TransactionRollbackError";
11567
+ constructor() {
11568
+ super({ message: "Rollback" });
11569
+ this.name = "TransactionRollbackError";
11570
+ }
11571
+ };
11539
11572
  // node_modules/drizzle-orm/relations.js
11540
11573
  var Relation2 = class {
11541
11574
  static [entityKind] = "RelationV2";
@@ -11584,6 +11617,53 @@ var One2 = class extends Relation2 {
11584
11617
  this.optional = config?.optional ?? true;
11585
11618
  }
11586
11619
  };
11620
+ var Many2 = class extends Relation2 {
11621
+ static [entityKind] = "ManyV2";
11622
+ relationType = "many";
11623
+ constructor(tables, targetTable, targetTableName, config) {
11624
+ super(targetTable, targetTableName);
11625
+ this.config = config;
11626
+ this.alias = config?.alias;
11627
+ this.where = config?.where;
11628
+ if (config?.from)
11629
+ this.sourceColumns = (Array.isArray(config.from) ? config.from : [config.from]).map((it2) => {
11630
+ this.throughTable ??= it2._.through ? tables[it2._.through._.tableName] : undefined;
11631
+ this.sourceColumnTableNames.push(it2._.tableName);
11632
+ return it2._.column;
11633
+ });
11634
+ if (config?.to)
11635
+ this.targetColumns = (Array.isArray(config.to) ? config.to : [config.to]).map((it2) => {
11636
+ this.throughTable ??= it2._.through ? tables[it2._.through._.tableName] : undefined;
11637
+ this.targetColumnTableNames.push(it2._.tableName);
11638
+ return it2._.column;
11639
+ });
11640
+ if (this.throughTable)
11641
+ this.through = {
11642
+ source: (Array.isArray(config?.from) ? config.from : (config?.from) ? [config.from] : []).map((c) => c._.through),
11643
+ target: (Array.isArray(config?.to) ? config.to : (config?.to) ? [config.to] : []).map((c) => c._.through)
11644
+ };
11645
+ }
11646
+ };
11647
+ var AggregatedField2 = class {
11648
+ static [entityKind] = "AggregatedField";
11649
+ table;
11650
+ onTable(table) {
11651
+ this.table = table;
11652
+ return this;
11653
+ }
11654
+ };
11655
+ var Count2 = class extends AggregatedField2 {
11656
+ static [entityKind] = "AggregatedFieldCount";
11657
+ query;
11658
+ getSQL() {
11659
+ if (!this.query) {
11660
+ if (!this.table)
11661
+ throw new Error("Table must be set before building aggregate field");
11662
+ this.query = sql`select count(*) as ${sql.identifier("r")} from ${getTableAsAliasSQL2(this.table)}`.mapWith(Number);
11663
+ }
11664
+ return this.query;
11665
+ }
11666
+ };
11587
11667
  var operators2 = {
11588
11668
  and,
11589
11669
  between,
@@ -11904,6 +11984,66 @@ function makeJitRqbMapper2({ selection, isFirst, parseJson, parseJsonIfString, r
11904
11984
  ${compiled}
11905
11985
  }` });
11906
11986
  }
11987
+ var RelationsBuilderTable2 = class {
11988
+ static [entityKind] = "RelationsBuilderTable";
11989
+ _;
11990
+ constructor(table, name2) {
11991
+ this._ = {
11992
+ name: name2,
11993
+ table
11994
+ };
11995
+ }
11996
+ };
11997
+ var RelationsBuilderColumn2 = class {
11998
+ static [entityKind] = "RelationsBuilderColumn";
11999
+ _;
12000
+ constructor(column, tableName, key) {
12001
+ this._ = {
12002
+ tableName,
12003
+ column,
12004
+ key
12005
+ };
12006
+ }
12007
+ through(column) {
12008
+ return new RelationsBuilderJunctionColumn2(this._.column, this._.tableName, this._.key, column);
12009
+ }
12010
+ };
12011
+ var RelationsBuilderJunctionColumn2 = class {
12012
+ static [entityKind] = "RelationsBuilderColumn";
12013
+ _;
12014
+ constructor(column, tableName, key, through) {
12015
+ this._ = {
12016
+ tableName,
12017
+ column,
12018
+ through,
12019
+ key
12020
+ };
12021
+ }
12022
+ };
12023
+ var RelationsHelperStatic2 = class {
12024
+ static [entityKind] = "RelationsHelperStatic";
12025
+ _;
12026
+ constructor(tables) {
12027
+ this._ = { tables };
12028
+ const one = {};
12029
+ const many = {};
12030
+ for (const [tableName, table] of Object.entries(tables)) {
12031
+ one[tableName] = (config) => {
12032
+ return new One2(tables, table, tableName, config);
12033
+ };
12034
+ many[tableName] = (config) => {
12035
+ return new Many2(tables, table, tableName, config);
12036
+ };
12037
+ }
12038
+ this.one = one;
12039
+ this.many = many;
12040
+ }
12041
+ one;
12042
+ many;
12043
+ aggs = { count() {
12044
+ return new Count2;
12045
+ } };
12046
+ };
11907
12047
  function fieldSelectionToSQL2(table, target) {
11908
12048
  const field = table[TableColumns][target];
11909
12049
  return field ? is(field, Column) ? field : is(field, SQL.Aliased) ? sql`${table}.${sql.identifier(field.fieldAlias)}` : sql`${table}.${sql.identifier(target)}` : sql`${table}.${sql.identifier(target)}`;
@@ -13362,6 +13502,29 @@ var PgAsyncSession2 = class extends PgSession2 {
13362
13502
  });
13363
13503
  }
13364
13504
  };
13505
+ var PgAsyncTransaction2 = class extends PgAsyncDatabase2 {
13506
+ static [entityKind] = "PgAsyncTransaction";
13507
+ constructor(dialect, session, relations, nestedIndex = 0, parseRqbJson) {
13508
+ super(dialect, session, relations, parseRqbJson);
13509
+ this.nestedIndex = nestedIndex;
13510
+ }
13511
+ rollback() {
13512
+ throw new TransactionRollbackError2;
13513
+ }
13514
+ getTransactionConfigSQL(config) {
13515
+ const chunks = [];
13516
+ if (config.isolationLevel)
13517
+ chunks.push(`isolation level ${config.isolationLevel}`);
13518
+ if (config.accessMode)
13519
+ chunks.push(config.accessMode);
13520
+ if (typeof config.deferrable === "boolean")
13521
+ chunks.push(config.deferrable ? "deferrable" : "not deferrable");
13522
+ return sql.raw(chunks.join(" "));
13523
+ }
13524
+ setTransaction(config) {
13525
+ return this.session.execute(sql`set transaction ${this.getTransactionConfigSQL(config)}`);
13526
+ }
13527
+ };
13365
13528
 
13366
13529
  // node_modules/drizzle-orm/neon-http/session.js
13367
13530
  var NeonHttpSession = class extends PgAsyncSession2 {
@@ -13747,58 +13910,58 @@ var createPostgresAgentRegistrationStoreFor = (db, table) => ({
13747
13910
  var createBunSqlDrizzleAgentRegistrationStore = (db) => createPostgresAgentRegistrationStoreFor(db, agentRegistrationsBunSqlTable);
13748
13911
  var createPostgresAgentRegistrationStore = (db) => createPostgresAgentRegistrationStoreFor(db, agentRegistrationsTable);
13749
13912
  export {
13750
- validateClientIdMetadataDocument,
13751
- startAgentRegistration,
13752
- revokeAgentIdentityRegistration,
13753
- resolveAgentPrincipal,
13754
- issueAgentServiceAssertion,
13755
- issueAgentIdentityAssertion,
13756
- handleAgentTokenGrant,
13757
- generateAgentRegistrationGuide,
13758
- generateAgentOAuthGuide,
13759
- discoverAgentRegistration,
13760
- createPostgresAgentRegistrationStore,
13761
- createPostgresAgentIdentityRegistrationStore,
13762
- createPostgresAgentDelegationStore,
13763
- createOidcAgentCredentialVerifier,
13764
- createNeonAgentRegistrationStore,
13765
- createNeonAgentIdentityRegistrationStore,
13766
- createNeonAgentDelegationStore,
13767
- createInMemoryAgentRegistrationStore,
13768
- createInMemoryAgentIdentityRegistrationStore,
13769
- createInMemoryAgentIdentityAssertionJtiStore,
13770
- createInMemoryAgentDelegationStore,
13771
- createDrizzleAgentDelegationStore,
13772
- createClientIdMetadataResolver,
13773
- createBunSqlDrizzleAgentRegistrationStore,
13774
- createBunSqlDrizzleAgentIdentityRegistrationStore,
13775
- createBunSqlDrizzleAgentDelegationStore,
13776
- createAgentRegistrationCredentialVerifier,
13777
- createAgentRegistrationClient,
13778
- createAgentIdentityAssertionVerifier,
13779
- completeAgentClaim,
13780
- clientIdMetadataToOAuthClient,
13781
- beginAgentClaim,
13782
- agentRegistrationsTable,
13783
- agentRegistrationsBunSqlTable,
13784
- agentRegistrationEndpoints,
13785
- agentRegistrationDiscoveryMetadata,
13786
- agentProtectedResourceMetadata,
13787
- agentOAuthGuideUrl,
13788
- agentOAuthGuideRoute,
13789
- agentIdentityRegistrationsTable,
13790
- agentIdentityRegistrationsBunSqlTable,
13791
- agentHasScopes,
13792
- agentDelegationsTable,
13793
- agentDelegationsBunSqlTable,
13794
- agentAuthPlugin,
13795
- agentAuthContextPlugin,
13796
- agentAuthChallenge,
13797
- DEFAULT_AGENT_RESOURCE_METADATA_ROUTE,
13798
- AGENT_IDENTITY_ASSERTION_TYPE,
13913
+ AGENT_CLAIM_GRANT_TYPE,
13799
13914
  AGENT_IDENTITY_ASSERTION_GRANT_TYPE,
13800
- AGENT_CLAIM_GRANT_TYPE
13915
+ AGENT_IDENTITY_ASSERTION_TYPE,
13916
+ DEFAULT_AGENT_RESOURCE_METADATA_ROUTE,
13917
+ agentAuthChallenge,
13918
+ agentAuthContextPlugin,
13919
+ agentAuthPlugin,
13920
+ agentDelegationsBunSqlTable,
13921
+ agentDelegationsTable,
13922
+ agentHasScopes,
13923
+ agentIdentityRegistrationsBunSqlTable,
13924
+ agentIdentityRegistrationsTable,
13925
+ agentOAuthGuideRoute,
13926
+ agentOAuthGuideUrl,
13927
+ agentProtectedResourceMetadata,
13928
+ agentRegistrationDiscoveryMetadata,
13929
+ agentRegistrationEndpoints,
13930
+ agentRegistrationsBunSqlTable,
13931
+ agentRegistrationsTable,
13932
+ beginAgentClaim,
13933
+ clientIdMetadataToOAuthClient,
13934
+ completeAgentClaim,
13935
+ createAgentIdentityAssertionVerifier,
13936
+ createAgentRegistrationClient,
13937
+ createAgentRegistrationCredentialVerifier,
13938
+ createBunSqlDrizzleAgentDelegationStore,
13939
+ createBunSqlDrizzleAgentIdentityRegistrationStore,
13940
+ createBunSqlDrizzleAgentRegistrationStore,
13941
+ createClientIdMetadataResolver,
13942
+ createDrizzleAgentDelegationStore,
13943
+ createInMemoryAgentDelegationStore,
13944
+ createInMemoryAgentIdentityAssertionJtiStore,
13945
+ createInMemoryAgentIdentityRegistrationStore,
13946
+ createInMemoryAgentRegistrationStore,
13947
+ createNeonAgentDelegationStore,
13948
+ createNeonAgentIdentityRegistrationStore,
13949
+ createNeonAgentRegistrationStore,
13950
+ createOidcAgentCredentialVerifier,
13951
+ createPostgresAgentDelegationStore,
13952
+ createPostgresAgentIdentityRegistrationStore,
13953
+ createPostgresAgentRegistrationStore,
13954
+ discoverAgentRegistration,
13955
+ generateAgentOAuthGuide,
13956
+ generateAgentRegistrationGuide,
13957
+ handleAgentTokenGrant,
13958
+ issueAgentIdentityAssertion,
13959
+ issueAgentServiceAssertion,
13960
+ resolveAgentPrincipal,
13961
+ revokeAgentIdentityRegistration,
13962
+ startAgentRegistration,
13963
+ validateClientIdMetadataDocument
13801
13964
  };
13802
13965
 
13803
- //# debugId=4B045EFCE2BE01EE64756E2164756E21
13966
+ //# debugId=E67FAC64C26F65BF64756E2164756E21
13804
13967
  //# sourceMappingURL=index.js.map