@absolutejs/auth 0.56.15 → 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.
@@ -13449,6 +13449,7 @@ var portableJsonb = customType({
13449
13449
  fromDriver: (value) => typeof value === "string" ? JSON.parse(value) : value,
13450
13450
  toDriver: (value) => JSON.stringify(value)
13451
13451
  });
13452
+ var encodedJsonb = (value) => sql`${JSON.stringify(value)}::text::jsonb`;
13452
13453
  var agentDelegationsTable = pgTable("auth_agent_delegations", {
13453
13454
  agent_id: varchar("agent_id", { length: ID_LENGTH }).notNull(),
13454
13455
  authorization_details: portableJsonb("authorization_details").$type(),
@@ -13550,7 +13551,7 @@ var toIdentityRegistration = (row) => ({
13550
13551
  });
13551
13552
  var identityRegistrationValues = (registration) => ({
13552
13553
  agent_id: registration.agentId,
13553
- claim_attempt: registration.claimAttempt ?? null,
13554
+ claim_attempt: registration.claimAttempt === undefined ? null : encodedJsonb(registration.claimAttempt),
13554
13555
  claim_attempt_token_hash: registration.claimAttempt?.tokenHash ?? null,
13555
13556
  claim_expires_at_ms: registration.claimExpiresAt,
13556
13557
  claim_token_hash: registration.claimTokenHash,
@@ -13594,12 +13595,12 @@ var createDrizzleAgentDelegationStore = (db) => ({
13594
13595
  saveDelegation: async (delegation) => {
13595
13596
  const values = {
13596
13597
  agent_id: delegation.agentId,
13597
- authorization_details: delegation.authorizationDetails ?? null,
13598
+ authorization_details: delegation.authorizationDetails === undefined ? null : encodedJsonb(delegation.authorizationDetails),
13598
13599
  created_at_ms: delegation.createdAt,
13599
13600
  delegation_id: delegation.delegationId,
13600
13601
  expires_at_ms: delegation.expiresAt ?? null,
13601
13602
  organization_id: delegation.organizationId ?? null,
13602
- scopes: delegation.scopes,
13603
+ scopes: encodedJsonb(delegation.scopes),
13603
13604
  status: delegation.status,
13604
13605
  updated_at_ms: delegation.updatedAt,
13605
13606
  user_id: delegation.userId
@@ -13662,10 +13663,10 @@ var createPostgresAgentRegistrationStore = (db) => ({
13662
13663
  saveRegistration: async (registration) => {
13663
13664
  const values = {
13664
13665
  agent_id: registration.agentId,
13665
- allowed_scopes: registration.allowedScopes,
13666
+ allowed_scopes: encodedJsonb(registration.allowedScopes),
13666
13667
  client_id: registration.clientId ?? null,
13667
13668
  created_at_ms: registration.createdAt,
13668
- metadata: registration.metadata ?? null,
13669
+ metadata: registration.metadata === undefined ? null : encodedJsonb(registration.metadata),
13669
13670
  name: registration.name,
13670
13671
  status: registration.status,
13671
13672
  updated_at_ms: registration.updatedAt
@@ -13724,5 +13725,5 @@ export {
13724
13725
  AGENT_CLAIM_GRANT_TYPE
13725
13726
  };
13726
13727
 
13727
- //# debugId=44573BF0288F41C864756E2164756E21
13728
+ //# debugId=E730925598B6D00864756E2164756E21
13728
13729
  //# sourceMappingURL=index.js.map