@absolutejs/auth 0.56.14 → 0.56.16
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.
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.js +11 -8
- package/dist/agents/index.js.map +3 -3
- package/dist/agents/postgresStores.d.ts +2 -0
- package/dist/cli/migrate.js +6 -6
- package/dist/cli/migrate.js.map +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +4 -4
- package/dist/server.js +10 -8
- package/dist/server.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27309,6 +27309,7 @@ var portableJsonb = customType({
|
|
|
27309
27309
|
fromDriver: (value) => typeof value === "string" ? JSON.parse(value) : value,
|
|
27310
27310
|
toDriver: (value) => JSON.stringify(value)
|
|
27311
27311
|
});
|
|
27312
|
+
var encodedJsonb = (value) => sql`${JSON.stringify(value)}::text::jsonb`;
|
|
27312
27313
|
var agentDelegationsTable = pgTable("auth_agent_delegations", {
|
|
27313
27314
|
agent_id: varchar("agent_id", { length: ID_LENGTH7 }).notNull(),
|
|
27314
27315
|
authorization_details: portableJsonb("authorization_details").$type(),
|
|
@@ -27410,7 +27411,7 @@ var toIdentityRegistration = (row) => ({
|
|
|
27410
27411
|
});
|
|
27411
27412
|
var identityRegistrationValues = (registration) => ({
|
|
27412
27413
|
agent_id: registration.agentId,
|
|
27413
|
-
claim_attempt: registration.claimAttempt
|
|
27414
|
+
claim_attempt: registration.claimAttempt === undefined ? null : encodedJsonb(registration.claimAttempt),
|
|
27414
27415
|
claim_attempt_token_hash: registration.claimAttempt?.tokenHash ?? null,
|
|
27415
27416
|
claim_expires_at_ms: registration.claimExpiresAt,
|
|
27416
27417
|
claim_token_hash: registration.claimTokenHash,
|
|
@@ -27428,10 +27429,10 @@ var identityRegistrationValues = (registration) => ({
|
|
|
27428
27429
|
user_id: registration.userId ?? null,
|
|
27429
27430
|
version: registration.version
|
|
27430
27431
|
});
|
|
27431
|
-
var createNeonAgentDelegationStore = (databaseUrl) =>
|
|
27432
|
+
var createNeonAgentDelegationStore = (databaseUrl) => createDrizzleAgentDelegationStore(createNeonDatabase(databaseUrl));
|
|
27432
27433
|
var createNeonAgentIdentityRegistrationStore = (databaseUrl) => createPostgresAgentIdentityRegistrationStore(createNeonDatabase(databaseUrl));
|
|
27433
27434
|
var createNeonAgentRegistrationStore = (databaseUrl) => createPostgresAgentRegistrationStore(createNeonDatabase(databaseUrl));
|
|
27434
|
-
var
|
|
27435
|
+
var createDrizzleAgentDelegationStore = (db) => ({
|
|
27435
27436
|
findActiveDelegation: async ({
|
|
27436
27437
|
agentId,
|
|
27437
27438
|
now = Date.now(),
|
|
@@ -27454,12 +27455,12 @@ var createPostgresAgentDelegationStore = (db) => ({
|
|
|
27454
27455
|
saveDelegation: async (delegation) => {
|
|
27455
27456
|
const values = {
|
|
27456
27457
|
agent_id: delegation.agentId,
|
|
27457
|
-
authorization_details: delegation.authorizationDetails
|
|
27458
|
+
authorization_details: delegation.authorizationDetails === undefined ? null : encodedJsonb(delegation.authorizationDetails),
|
|
27458
27459
|
created_at_ms: delegation.createdAt,
|
|
27459
27460
|
delegation_id: delegation.delegationId,
|
|
27460
27461
|
expires_at_ms: delegation.expiresAt ?? null,
|
|
27461
27462
|
organization_id: delegation.organizationId ?? null,
|
|
27462
|
-
scopes: delegation.scopes,
|
|
27463
|
+
scopes: encodedJsonb(delegation.scopes),
|
|
27463
27464
|
status: delegation.status,
|
|
27464
27465
|
updated_at_ms: delegation.updatedAt,
|
|
27465
27466
|
user_id: delegation.userId
|
|
@@ -27470,6 +27471,7 @@ var createPostgresAgentDelegationStore = (db) => ({
|
|
|
27470
27471
|
});
|
|
27471
27472
|
}
|
|
27472
27473
|
});
|
|
27474
|
+
var createPostgresAgentDelegationStore = createDrizzleAgentDelegationStore;
|
|
27473
27475
|
var createPostgresAgentIdentityRegistrationStore = (db) => ({
|
|
27474
27476
|
create: async (registration) => {
|
|
27475
27477
|
const rows = await db.insert(agentIdentityRegistrationsTable).values(identityRegistrationValues(registration)).onConflictDoNothing().returning({ id: agentIdentityRegistrationsTable.registration_id });
|
|
@@ -27521,10 +27523,10 @@ var createPostgresAgentRegistrationStore = (db) => ({
|
|
|
27521
27523
|
saveRegistration: async (registration) => {
|
|
27522
27524
|
const values = {
|
|
27523
27525
|
agent_id: registration.agentId,
|
|
27524
|
-
allowed_scopes: registration.allowedScopes,
|
|
27526
|
+
allowed_scopes: encodedJsonb(registration.allowedScopes),
|
|
27525
27527
|
client_id: registration.clientId ?? null,
|
|
27526
27528
|
created_at_ms: registration.createdAt,
|
|
27527
|
-
metadata: registration.metadata
|
|
27529
|
+
metadata: registration.metadata === undefined ? null : encodedJsonb(registration.metadata),
|
|
27528
27530
|
name: registration.name,
|
|
27529
27531
|
status: registration.status,
|
|
27530
27532
|
updated_at_ms: registration.updatedAt
|
|
@@ -31098,6 +31100,7 @@ export {
|
|
|
31098
31100
|
createInMemoryAccessTokenStore,
|
|
31099
31101
|
createFgaEngine,
|
|
31100
31102
|
createFederatedTokenStore,
|
|
31103
|
+
createDrizzleAgentDelegationStore,
|
|
31101
31104
|
createCustomOAuth2Client,
|
|
31102
31105
|
createCredentialOffer,
|
|
31103
31106
|
createClientIdMetadataResolver,
|
|
@@ -31205,5 +31208,5 @@ export {
|
|
|
31205
31208
|
AGENT_CLAIM_GRANT_TYPE
|
|
31206
31209
|
};
|
|
31207
31210
|
|
|
31208
|
-
//# debugId=
|
|
31211
|
+
//# debugId=6F88AB30CA1EE99C64756E2164756E21
|
|
31209
31212
|
//# sourceMappingURL=index.js.map
|