@theholocron/holocron-plugin-doppler 5.0.0-alpha.278 → 5.0.0-alpha.279
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 +12 -0
- package/dist/index.mjs +8 -0
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AuthError, EnsureResult, PluginToken, ResolveTokenInput, Vault, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
2
2
|
import { DopplerClient, DopplerClientOptions, createDopplerClient } from "@theholocron/doppler-client";
|
|
3
|
+
/** Resolves the Doppler token from `--token`, `HOLOCRON_DOPPLER_TOKEN`, `DOPPLER_TOKEN` or the keyring entry for `doppler`, and throws `AuthError` when none is set. */
|
|
3
4
|
export declare const resolveToken: import("@theholocron/cli").TokenResolver;
|
|
4
5
|
/** Every token this plugin takes, for `holocron doctor tokens`. */
|
|
5
6
|
export declare const tokens: PluginToken[];
|
|
@@ -9,9 +10,12 @@ interface DopplerVaultOptions {
|
|
|
9
10
|
/** Default config name — dev / stg / prd, etc. */
|
|
10
11
|
config: string;
|
|
11
12
|
}
|
|
13
|
+
/** `vault` capability for Doppler, with references shaped `doppler://<project>/<config>/<name>`. */
|
|
12
14
|
export declare class DopplerVault implements Vault {
|
|
13
15
|
private readonly client;
|
|
16
|
+
/** Capability key; always `"vault"`. */
|
|
14
17
|
readonly key: "vault";
|
|
18
|
+
/** Provider name; always `"doppler"`. */
|
|
15
19
|
readonly providerName = "doppler";
|
|
16
20
|
private readonly project;
|
|
17
21
|
private readonly config;
|
|
@@ -29,19 +33,27 @@ interface VerifyTokenOptions {
|
|
|
29
33
|
baseUrl?: string;
|
|
30
34
|
fetch?: typeof fetch;
|
|
31
35
|
}
|
|
36
|
+
/** Checks a Doppler token by fetching the caller and reports its kind and workplace, or why it was rejected. */
|
|
32
37
|
export declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
|
|
38
|
+
/** Options for the Doppler plugin: the token lookup inputs plus the default project and config. */
|
|
33
39
|
export interface DopplerPluginOptions extends ResolveTokenInput, DopplerVaultOptions {
|
|
34
40
|
/** Override base URL for tests. */
|
|
35
41
|
baseUrl?: string;
|
|
36
42
|
/** Override `fetch` for tests. */
|
|
37
43
|
fetch?: typeof fetch;
|
|
38
44
|
}
|
|
45
|
+
/** Shared state for one Doppler plugin instance: its options and a lazily created client. */
|
|
39
46
|
export interface PluginContext {
|
|
47
|
+
/** The options the plugin was created with. */
|
|
40
48
|
options: DopplerPluginOptions;
|
|
49
|
+
/** Returns the memoized Doppler client; the token is resolved on the first call, not at plugin load. */
|
|
41
50
|
client: () => DopplerClient;
|
|
42
51
|
}
|
|
52
|
+
/** Builds the plugin context from its options. */
|
|
43
53
|
export declare function createContext(options: DopplerPluginOptions): PluginContext;
|
|
54
|
+
/** Builds the `vault` capability for the context's default project and config. */
|
|
44
55
|
export declare function vault(ctx: PluginContext): Vault;
|
|
56
|
+
/** Creates the Doppler plugin: its `connection` probe and the `vault` capability. */
|
|
45
57
|
export declare function createPlugin(options: DopplerPluginOptions): {
|
|
46
58
|
name: string;
|
|
47
59
|
probes: {
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { AuthError, ProviderApiError, connectionProbe, createResolveToken } from
|
|
|
2
2
|
import { createDopplerClient } from "@theholocron/doppler-client";
|
|
3
3
|
import { errorMessage } from "@theholocron/misc-utils";
|
|
4
4
|
// src/auth.ts
|
|
5
|
+
/** Resolves the Doppler token from `--token`, `HOLOCRON_DOPPLER_TOKEN`, `DOPPLER_TOKEN` or the keyring entry for `doppler`, and throws `AuthError` when none is set. */
|
|
5
6
|
const resolveToken = createResolveToken({
|
|
6
7
|
envName: "HOLOCRON_DOPPLER_TOKEN",
|
|
7
8
|
vendorEnvName: "DOPPLER_TOKEN",
|
|
@@ -26,9 +27,12 @@ const DOPPLER_INJECTED_KEYS = /* @__PURE__ */ new Set([
|
|
|
26
27
|
"DOPPLER_CONFIG",
|
|
27
28
|
"DOPPLER_ENVIRONMENT"
|
|
28
29
|
]);
|
|
30
|
+
/** `vault` capability for Doppler, with references shaped `doppler://<project>/<config>/<name>`. */
|
|
29
31
|
var DopplerVault = class {
|
|
30
32
|
client;
|
|
33
|
+
/** Capability key; always `"vault"`. */
|
|
31
34
|
key = "vault";
|
|
35
|
+
/** Provider name; always `"doppler"`. */
|
|
32
36
|
providerName = "doppler";
|
|
33
37
|
project;
|
|
34
38
|
config;
|
|
@@ -123,6 +127,7 @@ function hasAlreadyExistsBody(details) {
|
|
|
123
127
|
return /already exists/i.test(details);
|
|
124
128
|
}
|
|
125
129
|
// src/verify-token.ts
|
|
130
|
+
/** Checks a Doppler token by fetching the caller and reports its kind and workplace, or why it was rejected. */
|
|
126
131
|
async function verifyToken(token, opts = {}) {
|
|
127
132
|
const client = createDopplerClient({
|
|
128
133
|
token,
|
|
@@ -144,6 +149,7 @@ async function verifyToken(token, opts = {}) {
|
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
// src/index.ts
|
|
152
|
+
/** Builds the plugin context from its options. */
|
|
147
153
|
function createContext(options) {
|
|
148
154
|
let client;
|
|
149
155
|
return {
|
|
@@ -155,12 +161,14 @@ function createContext(options) {
|
|
|
155
161
|
})
|
|
156
162
|
};
|
|
157
163
|
}
|
|
164
|
+
/** Builds the `vault` capability for the context's default project and config. */
|
|
158
165
|
function vault(ctx) {
|
|
159
166
|
return new DopplerVault(ctx.client, {
|
|
160
167
|
project: ctx.options.project,
|
|
161
168
|
config: ctx.options.config
|
|
162
169
|
});
|
|
163
170
|
}
|
|
171
|
+
/** Creates the Doppler plugin: its `connection` probe and the `vault` capability. */
|
|
164
172
|
function createPlugin(options) {
|
|
165
173
|
const ctx = createContext(options);
|
|
166
174
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-doppler",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.279",
|
|
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",
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
"tsx": "4.23.15",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
42
|
"vitest": "^5.0.5",
|
|
43
|
-
"@theholocron/
|
|
44
|
-
"@theholocron/http-client": "^1.58.0-alpha.3",
|
|
45
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.4",
|
|
46
|
-
"@theholocron/misc-utils": "^1.16.1-alpha.3",
|
|
43
|
+
"@theholocron/doppler-client": "^1.58.0-alpha.3",
|
|
47
44
|
"@theholocron/tsconfig": "^8.9.0-alpha.4",
|
|
48
45
|
"@theholocron/tsdown-config": "^8.9.0-alpha.4",
|
|
49
|
-
"@theholocron/
|
|
50
|
-
"@theholocron/
|
|
46
|
+
"@theholocron/cli": "5.0.0-alpha.279",
|
|
47
|
+
"@theholocron/http-client": "^1.58.0-alpha.3",
|
|
48
|
+
"@theholocron/misc-utils": "^1.16.1-alpha.3",
|
|
49
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.4",
|
|
50
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.4"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@theholocron/doppler-client": "^1.43.1",
|
|
54
54
|
"@theholocron/misc-utils": "^1.16.0",
|
|
55
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
55
|
+
"@theholocron/cli": "5.0.0-alpha.279"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=22"
|