@theholocron/holocron-plugin-cloudflare 5.0.0-alpha.560 → 5.0.0-alpha.562

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.
Files changed (2) hide show
  1. package/dist/index.mjs +14 -9
  2. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -992,15 +992,20 @@ function createPlugin(options = {}) {
992
992
  }),
993
993
  tokens,
994
994
  lifetime: async (token) => {
995
- const verified = await createCloudflareClient({
996
- token,
997
- baseUrl: options.baseUrl,
998
- fetch: options.fetch
999
- }).tokens.verify();
1000
- return {
1001
- ...verified.not_before ? { createdAt: verified.not_before } : {},
1002
- ...verified.expires_on ? { expiresAt: verified.expires_on } : {}
1003
- };
995
+ try {
996
+ const verified = await createCloudflareClient({
997
+ token,
998
+ baseUrl: options.baseUrl,
999
+ fetch: options.fetch
1000
+ }).tokens.verify();
1001
+ return {
1002
+ ...verified.not_before ? { createdAt: verified.not_before } : {},
1003
+ ...verified.expires_on ? { expiresAt: verified.expires_on } : {}
1004
+ };
1005
+ } catch (err) {
1006
+ if (err instanceof ProviderApiError && (err.status === 401 || err.status === 403)) return void 0;
1007
+ throw err;
1008
+ }
1004
1009
  }
1005
1010
  }),
1006
1011
  mintToken: (input) => mintCloudflareToken(ctx, input),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-cloudflare",
3
- "version": "5.0.0-alpha.560",
3
+ "version": "5.0.0-alpha.562",
4
4
  "description": "Holocron plugin for Cloudflare. Implements the dns capability against Cloudflare's REST API — zone resolution, DNS record management.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -44,11 +44,11 @@
44
44
  "tsx": "4.23.15",
45
45
  "typescript": "^6.0.3",
46
46
  "vitest": "^5.1.1",
47
- "@theholocron/cli": "5.0.0-alpha.560",
48
- "@theholocron/cloudflare-client": "^1.58.0-alpha.61",
47
+ "@theholocron/cli": "5.0.0-alpha.562",
48
+ "@theholocron/cloudflare-client": "^1.58.0-alpha.62",
49
49
  "@theholocron/eslint-config": "^8.9.0-alpha.24",
50
- "@theholocron/http-client": "^1.58.0-alpha.61",
51
- "@theholocron/kyber": "5.0.0-alpha.560",
50
+ "@theholocron/http-client": "^1.58.0-alpha.62",
51
+ "@theholocron/kyber": "5.0.0-alpha.562",
52
52
  "@theholocron/misc-utils": "^1.17.0-alpha.8",
53
53
  "@theholocron/tsconfig": "^8.9.0-alpha.24",
54
54
  "@theholocron/tsdown-config": "^8.9.0-alpha.24",
@@ -57,7 +57,7 @@
57
57
  "peerDependencies": {
58
58
  "@theholocron/cloudflare-client": "^1.53.1",
59
59
  "@theholocron/misc-utils": "^1.16.0",
60
- "@theholocron/cli": "5.0.0-alpha.560"
60
+ "@theholocron/cli": "5.0.0-alpha.562"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "@theholocron/cloudflare-client": {}