@theholocron/holocron-plugin-doppler 5.0.0-alpha.23 → 5.0.0-alpha.230

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.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthError, EnsureResult, ResolveTokenInput, Vault } from "@theholocron/cli";
1
+ import { AuthError, EnsureResult, ResolveTokenInput, Vault, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
2
2
  import { DopplerClient, DopplerClientOptions, createDopplerClient } from "@theholocron/doppler-client";
3
3
  //#region src/auth.d.ts
4
4
  declare const resolveToken: (input?: ResolveTokenInput) => string;
@@ -27,30 +27,11 @@ declare class DopplerVault implements Vault {
27
27
  }
28
28
  //#endregion
29
29
  //#region src/verify-token.d.ts
30
- /**
31
- * `verifyToken` — plugin-level export used by `holocron auth set` +
32
- * `holocron auth check`. Hits `GET /v3/me` and translates the response
33
- * into the normalized `VerifyTokenResult` shape.
34
- *
35
- * Kept as a standalone function (not a capability method) so the auth
36
- * command can call it without initializing the full plugin — plugin
37
- * construction requires an already-resolved token, which is exactly
38
- * what we don't have yet at bootstrap time.
39
- */
40
- interface VerifyTokenSuccess {
41
- ok: true;
42
- subject: string;
43
- }
44
- interface VerifyTokenFailure {
45
- ok: false;
46
- message: string;
47
- }
48
- type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
49
30
  interface VerifyTokenOptions {
50
31
  baseUrl?: string;
51
32
  fetch?: typeof fetch;
52
33
  }
53
- declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult>;
34
+ declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
54
35
  //#endregion
55
36
  //#region src/index.d.ts
56
37
  interface DopplerPluginOptions extends ResolveTokenInput, DopplerVaultOptions {
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AuthError, ProviderApiError, createResolveToken } from "@theholocron/cli";
2
2
  import { createDopplerClient } from "@theholocron/doppler-client";
3
+ import { errorMessage } from "@theholocron/misc-utils";
3
4
  //#region src/auth.ts
4
5
  const resolveToken = createResolveToken({
5
6
  envName: "HOLOCRON_DOPPLER_TOKEN",
@@ -9,6 +10,21 @@ const resolveToken = createResolveToken({
9
10
  });
10
11
  //#endregion
11
12
  //#region src/capabilities/vault.ts
13
+ /**
14
+ * Doppler auto-injects these into every config's secrets download —
15
+ * bookkeeping about the config itself, not something any caller
16
+ * defined. `readEnvironment()` fans its result out to real destinations
17
+ * (`holocron secrets sync` → CI secrets, deploy env vars); shipping
18
+ * these alongside real secrets is pure noise there (theholocron/holocron#742
19
+ * — found via Sentinel's deploy picking them up as if they were its own
20
+ * env). Confirmed stable, documented Doppler behavior — not
21
+ * project/config-specific, so safe to filter by name unconditionally.
22
+ */
23
+ const DOPPLER_INJECTED_KEYS = /* @__PURE__ */ new Set([
24
+ "DOPPLER_PROJECT",
25
+ "DOPPLER_CONFIG",
26
+ "DOPPLER_ENVIRONMENT"
27
+ ]);
12
28
  var DopplerVault = class {
13
29
  client;
14
30
  key = "vault";
@@ -41,7 +57,7 @@ var DopplerVault = class {
41
57
  async readEnvironment(environmentId) {
42
58
  const res = await this.client().secrets.download(this.project, environmentId);
43
59
  const out = {};
44
- for (const [k, v] of Object.entries(res)) if (typeof v === "string") out[k] = v;
60
+ for (const [k, v] of Object.entries(res)) if (typeof v === "string" && !DOPPLER_INJECTED_KEYS.has(k)) out[k] = v;
45
61
  return out;
46
62
  }
47
63
  async ensureProject(name) {
@@ -103,16 +119,6 @@ function hasAlreadyExistsBody(details) {
103
119
  }
104
120
  //#endregion
105
121
  //#region src/verify-token.ts
106
- /**
107
- * `verifyToken` — plugin-level export used by `holocron auth set` +
108
- * `holocron auth check`. Hits `GET /v3/me` and translates the response
109
- * into the normalized `VerifyTokenResult` shape.
110
- *
111
- * Kept as a standalone function (not a capability method) so the auth
112
- * command can call it without initializing the full plugin — plugin
113
- * construction requires an already-resolved token, which is exactly
114
- * what we don't have yet at bootstrap time.
115
- */
116
122
  async function verifyToken(token, opts = {}) {
117
123
  const client = createDopplerClient({
118
124
  token,
@@ -129,7 +135,7 @@ async function verifyToken(token, opts = {}) {
129
135
  } catch (err) {
130
136
  return {
131
137
  ok: false,
132
- message: err instanceof Error ? err.message : String(err)
138
+ message: errorMessage(err)
133
139
  };
134
140
  }
135
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-doppler",
3
- "version": "5.0.0-alpha.23",
3
+ "version": "5.0.0-alpha.230",
4
4
  "description": "Holocron plugin for Doppler. Implements the vault capability against Doppler's REST API — projects, configs, secrets, plus verifyToken + AUTH_HINT for `holocron auth`.",
5
5
  "keywords": [
6
6
  "doppler",
@@ -8,12 +8,12 @@
8
8
  "plugin",
9
9
  "vault"
10
10
  ],
11
- "homepage": "https://github.com/theholocron/holocron/tree/main/packages/holocron-plugin-doppler#readme",
11
+ "homepage": "https://github.com/theholocron/holocron/tree/main/plugins/holocron-plugin-doppler#readme",
12
12
  "bugs": "https://github.com/theholocron/holocron/issues",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/theholocron/holocron.git",
16
- "directory": "packages/holocron-plugin-doppler"
16
+ "directory": "plugins/holocron-plugin-doppler"
17
17
  },
18
18
  "license": "MIT",
19
19
  "author": "Newton Koumantzelis",
@@ -30,12 +30,13 @@
30
30
  "dist"
31
31
  ],
32
32
  "devDependencies": {
33
- "@theholocron/doppler-client": "^1.22.0",
34
- "@theholocron/eslint-config": "^8.0.0",
35
- "@theholocron/http-client": "^1.22.0",
36
- "@theholocron/tsconfig": "^8.0.0",
37
- "@theholocron/tsdown-config": "^8.0.0",
38
- "@theholocron/vitest-config": "^8.0.0",
33
+ "@theholocron/doppler-client": "^1.43.1",
34
+ "@theholocron/eslint-config": "^8.8.2",
35
+ "@theholocron/http-client": "^1.54.2",
36
+ "@theholocron/misc-utils": "^1.16.0",
37
+ "@theholocron/tsconfig": "^8.8.2",
38
+ "@theholocron/tsdown-config": "^8.8.2",
39
+ "@theholocron/vitest-config": "^8.8.2",
39
40
  "@types/node": "^26",
40
41
  "@vitest/coverage-v8": "^4.1.11",
41
42
  "@vitest/eslint-plugin": "^1.6.27",
@@ -43,14 +44,15 @@
43
44
  "eslint-plugin-n": "^18.3.0",
44
45
  "globals": "^17.11.0",
45
46
  "tsdown": "^0.22.14",
46
- "tsx": "4.23.12",
47
+ "tsx": "4.23.15",
47
48
  "typescript": "^5.9.3",
48
49
  "vitest": "^4.1.11",
49
- "@theholocron/cli": "5.0.0-alpha.23"
50
+ "@theholocron/cli": "5.0.0-alpha.230"
50
51
  },
51
52
  "peerDependencies": {
52
- "@theholocron/doppler-client": "^1.22.0",
53
- "@theholocron/cli": "5.0.0-alpha.23"
53
+ "@theholocron/doppler-client": "^1.43.1",
54
+ "@theholocron/misc-utils": "^1.16.0",
55
+ "@theholocron/cli": "5.0.0-alpha.230"
54
56
  },
55
57
  "engines": {
56
58
  "node": ">=22"