@authhero/kysely-adapter 11.14.0 → 11.14.1

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.
@@ -575,6 +575,8 @@ function Fe(e) {
575
575
  email_verified: m.email_verified === 1,
576
576
  phone_verified: m.phone_verified === null ? void 0 : m.phone_verified === 1,
577
577
  is_social: m.is_social === 1,
578
+ app_metadata: r.app_metadata,
579
+ user_metadata: r.user_metadata,
578
580
  address: r.address
579
581
  };
580
582
  };
@@ -1972,7 +1974,7 @@ function sn(e) {
1972
1974
  let i = await e.selectFrom("clients").where("clients.tenant_id", "=", t).where("clients.client_id", "=", r).select("connections").executeTakeFirst();
1973
1975
  if (!i) return !1;
1974
1976
  let a = JSON.parse(i.connections || "[]"), o = a.filter((e) => e !== n);
1975
- return o.length === a.length ? !0 : (await e.updateTable("clients").set({
1977
+ return o.length === a.length || (await e.updateTable("clients").set({
1976
1978
  connections: JSON.stringify(o),
1977
1979
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
1978
1980
  }).where("clients.tenant_id", "=", t).where("clients.client_id", "=", r).executeTakeFirst()).numUpdatedRows > 0;
@@ -2028,8 +2030,8 @@ function un(e) {
2028
2030
  audience: r.audience,
2029
2031
  scope: r.scope ? JSON.parse(r.scope) : [],
2030
2032
  organization_usage: r.organization_usage,
2031
- allow_any_organization: r.allow_any_organization === void 0 ? !1 : !!r.allow_any_organization,
2032
- is_system: r.is_system === void 0 ? !1 : !!r.is_system,
2033
+ allow_any_organization: r.allow_any_organization !== void 0 && !!r.allow_any_organization,
2034
+ is_system: r.is_system !== void 0 && !!r.is_system,
2033
2035
  subject_type: r.subject_type,
2034
2036
  authorization_details_types: r.authorization_details_types ? JSON.parse(r.authorization_details_types) : [],
2035
2037
  created_at: r.created_at,
@@ -2064,8 +2066,8 @@ function dn(e) {
2064
2066
  audience: e.audience,
2065
2067
  scope: e.scope ? JSON.parse(e.scope) : [],
2066
2068
  organization_usage: e.organization_usage,
2067
- allow_any_organization: e.allow_any_organization === void 0 ? !1 : !!e.allow_any_organization,
2068
- is_system: e.is_system === void 0 ? !1 : !!e.is_system,
2069
+ allow_any_organization: e.allow_any_organization !== void 0 && !!e.allow_any_organization,
2070
+ is_system: e.is_system !== void 0 && !!e.is_system,
2069
2071
  subject_type: e.subject_type,
2070
2072
  authorization_details_types: e.authorization_details_types ? JSON.parse(e.authorization_details_types) : [],
2071
2073
  created_at: e.created_at,
@@ -4320,7 +4322,7 @@ function Gi(e) {
4320
4322
  function Ki(e) {
4321
4323
  return async (t, n, r) => {
4322
4324
  let i = {};
4323
- return r.inviter !== void 0 && (i.inviter = JSON.stringify(r.inviter)), r.invitee !== void 0 && (i.invitee = JSON.stringify(r.invitee)), r.client_id !== void 0 && (i.client_id = r.client_id), r.connection_id !== void 0 && (i.connection_id = r.connection_id), r.app_metadata !== void 0 && (i.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata !== void 0 && (i.user_metadata = JSON.stringify(r.user_metadata)), r.roles !== void 0 && (i.roles = JSON.stringify(r.roles)), r.ttl_sec !== void 0 && (i.ttl_sec = r.ttl_sec, i.expires_at = new Date(Date.now() + r.ttl_sec * 1e3).toISOString()), r.send_invitation_email !== void 0 && (i.send_invitation_email = +!!r.send_invitation_email), Object.keys(i).length === 0 ? !0 : (await e.updateTable("invites").set(i).where("tenant_id", "=", t).where("id", "=", n).executeTakeFirst()).numUpdatedRows > 0n;
4325
+ return r.inviter !== void 0 && (i.inviter = JSON.stringify(r.inviter)), r.invitee !== void 0 && (i.invitee = JSON.stringify(r.invitee)), r.client_id !== void 0 && (i.client_id = r.client_id), r.connection_id !== void 0 && (i.connection_id = r.connection_id), r.app_metadata !== void 0 && (i.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata !== void 0 && (i.user_metadata = JSON.stringify(r.user_metadata)), r.roles !== void 0 && (i.roles = JSON.stringify(r.roles)), r.ttl_sec !== void 0 && (i.ttl_sec = r.ttl_sec, i.expires_at = new Date(Date.now() + r.ttl_sec * 1e3).toISOString()), r.send_invitation_email !== void 0 && (i.send_invitation_email = +!!r.send_invitation_email), Object.keys(i).length === 0 || (await e.updateTable("invites").set(i).where("tenant_id", "=", t).where("id", "=", n).executeTakeFirst()).numUpdatedRows > 0n;
4324
4326
  };
4325
4327
  }
4326
4328
  //#endregion