@absolutejs/auth 0.56.15 → 0.56.17

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/server.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 ?? null,
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,
@@ -27454,12 +27455,12 @@ var createDrizzleAgentDelegationStore = (db) => ({
27454
27455
  saveDelegation: async (delegation) => {
27455
27456
  const values = {
27456
27457
  agent_id: delegation.agentId,
27457
- authorization_details: delegation.authorizationDetails ?? null,
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
@@ -27522,10 +27523,10 @@ var createPostgresAgentRegistrationStore = (db) => ({
27522
27523
  saveRegistration: async (registration) => {
27523
27524
  const values = {
27524
27525
  agent_id: registration.agentId,
27525
- allowed_scopes: registration.allowedScopes,
27526
+ allowed_scopes: encodedJsonb(registration.allowedScopes),
27526
27527
  client_id: registration.clientId ?? null,
27527
27528
  created_at_ms: registration.createdAt,
27528
- metadata: registration.metadata ?? null,
27529
+ metadata: registration.metadata === undefined ? null : encodedJsonb(registration.metadata),
27529
27530
  name: registration.name,
27530
27531
  status: registration.status,
27531
27532
  updated_at_ms: registration.updatedAt
@@ -30731,5 +30732,5 @@ export {
30731
30732
  auth2 as auth
30732
30733
  };
30733
30734
 
30734
- //# debugId=5695CEA18CB89B4A64756E2164756E21
30735
+ //# debugId=37BA56E8C792D9B264756E2164756E21
30735
30736
  //# sourceMappingURL=server.js.map