@authhero/cloudflare-adapter 2.32.6 → 2.33.0

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.
@@ -237,7 +237,7 @@ function te(e, t, n) {
237
237
  };
238
238
  }
239
239
  //#endregion
240
- //#region ../../node_modules/.pnpm/hono@4.12.24/node_modules/hono/dist/http-exception.js
240
+ //#region ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/http-exception.js
241
241
  var _ = class extends Error {
242
242
  res;
243
243
  status;
@@ -11288,7 +11288,7 @@ var tm = /* @__PURE__ */ i({
11288
11288
  xor: () => wf
11289
11289
  });
11290
11290
  //#endregion
11291
- //#region ../../node_modules/.pnpm/@hono+zod-openapi@1.4.0_hono@4.12.24_zod@4.4.3/node_modules/@hono/zod-openapi/dist/index.js
11291
+ //#region ../../node_modules/.pnpm/@hono+zod-openapi@1.4.0_hono@4.12.25_zod@4.4.3/node_modules/@hono/zod-openapi/dist/index.js
11292
11292
  y(Aa()), ee(tm);
11293
11293
  //#endregion
11294
11294
  //#region ../../node_modules/.pnpm/wretch@3.0.8/node_modules/wretch/dist/middlewares/dedupe.js
@@ -11479,6 +11479,10 @@ function xm(e) {
11479
11479
  domain: c.domain,
11480
11480
  type: c.type,
11481
11481
  domain_metadata: n.domain_metadata
11482
+ }), await e.customDomainAdapter.update(t, c.custom_domain_id, {
11483
+ status: c.status,
11484
+ primary: c.primary,
11485
+ verification: c.verification
11482
11486
  }), c;
11483
11487
  },
11484
11488
  get: async (t, n) => {
@@ -11487,11 +11491,11 @@ function xm(e) {
11487
11491
  let i;
11488
11492
  try {
11489
11493
  i = await vm(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json();
11490
- } catch (e) {
11491
- throw new _(503, { message: `Failed to fetch custom hostname from Cloudflare: ${e instanceof Error ? e.message : String(e)}` });
11494
+ } catch {
11495
+ return r;
11492
11496
  }
11493
11497
  let a = _m.safeParse(i);
11494
- if (!a.success || !a.data.success) throw new _(503, { message: `Failed to parse custom hostname response: ${JSON.stringify(a.success ? a.data.errors : a.error.issues)}` });
11498
+ if (!a.success || !a.data.success) return r;
11495
11499
  let { result: o } = a.data;
11496
11500
  if (e.enterprise && o.custom_metadata?.tenant_id !== t) throw new _(404);
11497
11501
  return bm({
@@ -11500,20 +11504,7 @@ function xm(e) {
11500
11504
  });
11501
11505
  },
11502
11506
  getByDomain: async (t) => e.customDomainAdapter.getByDomain(t),
11503
- list: async (t) => {
11504
- let n = await e.customDomainAdapter.list(t);
11505
- return (await Promise.all(n.map(async (n) => {
11506
- try {
11507
- let r = await vm(e).get(`/custom_hostnames/${encodeURIComponent(n.custom_domain_id)}`).json(), { result: i, success: a } = _m.parse(r);
11508
- return !a || e.enterprise && i.custom_metadata?.tenant_id !== t ? null : bm({
11509
- ...n,
11510
- ...i
11511
- });
11512
- } catch {
11513
- return null;
11514
- }
11515
- }))).filter((e) => e !== null);
11516
- },
11507
+ list: async (t) => e.customDomainAdapter.list(t),
11517
11508
  remove: async (t, n) => {
11518
11509
  if (e.enterprise) {
11519
11510
  let { result: r, success: i } = _m.parse(await vm(e).get(`/custom_hostnames/${encodeURIComponent(n)}`).json());
@@ -11556,10 +11547,14 @@ function xm(e) {
11556
11547
  custom_key: r.private_key
11557
11548
  } }, `/custom_hostnames/${encodeURIComponent(n)}`).json(), { result: o, errors: s, success: c } = _m.parse(a);
11558
11549
  if (!c) throw new _(503, { message: JSON.stringify(s) });
11559
- return bm({
11550
+ let l = bm({
11560
11551
  ...i,
11561
11552
  ...o
11562
11553
  });
11554
+ return await e.customDomainAdapter.update(t, n, {
11555
+ status: l.status,
11556
+ verification: l.verification
11557
+ }), l;
11563
11558
  }
11564
11559
  };
11565
11560
  }