@bakers-build/addon-ports-cloudflare 0.8.0 → 0.8.1-next.10

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.
@@ -3,15 +3,15 @@ export type { CloudflareConfig, CloudflareDeps } from './cloudflare.js';
3
3
  export { reconcileCloudflare } from './reconcile.js';
4
4
  /** The `@bakers-build/addon-ports` entry's `with.transport.with` for this transport. */
5
5
  export interface CloudflareSettings {
6
- readonly accountId: string;
7
- readonly tunnelId: string;
8
- readonly zoneId: string;
6
+ readonly account_id: string;
7
+ readonly tunnel_id: string;
8
+ readonly zone_id: string;
9
9
  readonly zone: string;
10
- readonly apiToken: string;
10
+ readonly api_token: string;
11
11
  }
12
12
  /**
13
13
  * Default export factory consumed by `@bakers-build/addon-ports`'s
14
- * `loadPortsTransport`. `identity` deliberately excludes `apiToken` — a
14
+ * `loadPortsTransport`. `identity` deliberately excludes `api_token` — a
15
15
  * rotated token with the same account/tunnel/zone is NOT an identity change.
16
16
  */
17
17
  export default function createTransport(settings: unknown, _context: {
package/dist/src/index.js CHANGED
@@ -4,15 +4,15 @@
4
4
  import { reconcileCloudflare } from './reconcile.js';
5
5
  export { reconcileCloudflare } from './reconcile.js';
6
6
  const REQUIRED_FIELDS = [
7
- 'accountId',
8
- 'tunnelId',
9
- 'zoneId',
7
+ 'account_id',
8
+ 'tunnel_id',
9
+ 'zone_id',
10
10
  'zone',
11
- 'apiToken',
11
+ 'api_token',
12
12
  ];
13
13
  function validateSettings(settings) {
14
14
  if (typeof settings !== 'object' || settings === null) {
15
- throw new Error("the @bakers-build/addon-ports entry's with.transport.with for 'cloudflare' must be an object with accountId/tunnelId/zoneId/zone/apiToken");
15
+ throw new Error("the @bakers-build/addon-ports entry's with.transport.with for 'cloudflare' must be an object with account_id/tunnel_id/zone_id/zone/api_token");
16
16
  }
17
17
  const obj = settings;
18
18
  const missing = REQUIRED_FIELDS.filter((f) => typeof obj[f] !== 'string' || obj[f] === '');
@@ -20,11 +20,11 @@ function validateSettings(settings) {
20
20
  throw new Error(`the @bakers-build/addon-ports entry's with.transport.with for 'cloudflare' is missing: ${missing.join(', ')}`);
21
21
  }
22
22
  return {
23
- accountId: obj.accountId,
24
- tunnelId: obj.tunnelId,
25
- zoneId: obj.zoneId,
23
+ accountId: obj.account_id,
24
+ tunnelId: obj.tunnel_id,
25
+ zoneId: obj.zone_id,
26
26
  zone: obj.zone,
27
- apiToken: obj.apiToken,
27
+ apiToken: obj.api_token,
28
28
  };
29
29
  }
30
30
  /** Real `fetch` — the only seam into the actual network, injected into
@@ -53,7 +53,7 @@ function validateData(data) {
53
53
  }
54
54
  /**
55
55
  * Default export factory consumed by `@bakers-build/addon-ports`'s
56
- * `loadPortsTransport`. `identity` deliberately excludes `apiToken` — a
56
+ * `loadPortsTransport`. `identity` deliberately excludes `api_token` — a
57
57
  * rotated token with the same account/tunnel/zone is NOT an identity change.
58
58
  */
59
59
  export default async function createTransport(settings, _context) {
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://bakers.build/schema/addon-ports-cloudflare/options.schema.json",
4
+ "title": "@bakers-build/addon-ports-cloudflare options",
5
+ "description": "The ports entry's with.transport.with for the named Cloudflare tunnel.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "account_id",
10
+ "tunnel_id",
11
+ "zone_id",
12
+ "zone",
13
+ "api_token"
14
+ ],
15
+ "properties": {
16
+ "account_id": {
17
+ "type": "string",
18
+ "minLength": 1,
19
+ "description": "Cloudflare account."
20
+ },
21
+ "tunnel_id": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "description": "Named tunnel."
25
+ },
26
+ "zone_id": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "description": "Zone ID for DNS records."
30
+ },
31
+ "zone": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "description": "Zone the public names are created in."
35
+ },
36
+ "api_token": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "description": "API token. Rotating it alone is not an identity change."
40
+ }
41
+ }
42
+ }
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-ports-cloudflare",
3
- "version": "0.8.0",
3
+ "version": "0.8.1-next.10",
4
4
  "description": "bakers.build ports transport: a named Cloudflare Tunnel, reconciled via the Cloudflare API (DNS + ingress). Implements @bakers-build/addon-ports's PortsTransport contract.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "exports": {
8
- ".": "./dist/src/index.js"
8
+ ".": "./dist/src/index.js",
9
+ "./options.schema.json": "./options.schema.json"
9
10
  },
10
11
  "files": [
11
- "dist/src"
12
+ "dist/src",
13
+ "options.schema.json"
12
14
  ],
13
15
  "publishConfig": {
14
16
  "access": "public"
@@ -19,11 +21,11 @@
19
21
  "directory": "bakers-cli/addons/ports-cloudflare"
20
22
  },
21
23
  "peerDependencies": {
22
- "@bakers-build/addon-ports": "^0.8.0",
23
- "@bakers-build/core": "^0.8.0"
24
+ "@bakers-build/addon-ports": "^0.8.1-next.10",
25
+ "@bakers-build/core": "^0.8.1-next.10"
24
26
  },
25
27
  "bakersBuild": {
26
- "commit": "082d8c57436f78e751f5a9a26a4446cec42209ce",
27
- "channel": "latest"
28
+ "commit": "ceb44a12624feaa85cb2b0c9f84345399b38bf50",
29
+ "channel": "next"
28
30
  }
29
31
  }