@penvhq/provider-github 0.14.0 → 0.16.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.
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -43
- package/dist/index.d.ts +24 -43
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/penv.d.ts +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -20,8 +20,8 @@ interface ParameterRef {
|
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* — so the compile-time union is exactly the set of providers the project has
|
|
23
|
-
* installed, and {@link defineConfig} can hold a known `
|
|
24
|
-
* provider's own declaration while leaving an unknown
|
|
23
|
+
* installed, and {@link defineConfig} can hold a known `provider`'s fields to the
|
|
24
|
+
* provider's own declaration while leaving an unknown one the open base shape.
|
|
25
25
|
*/
|
|
26
26
|
interface ProviderConfigMap {
|
|
27
27
|
}
|
|
@@ -30,20 +30,18 @@ type KnownProviderType = keyof ProviderConfigMap & string;
|
|
|
30
30
|
interface ProviderConfig {
|
|
31
31
|
/**
|
|
32
32
|
* The provider package's fully-qualified name — `"@penvhq/provider-vault"`.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
33
|
+
* Always a plain package specifier, never a factory import: provider packages
|
|
34
|
+
* are integrity-pinned CLI extensions recorded in the manifest, not necessarily
|
|
35
|
+
* installed dependencies, so the config stays data-only and importable in a
|
|
36
|
+
* repo where no adapter code exists.
|
|
37
37
|
*/
|
|
38
|
-
readonly
|
|
38
|
+
readonly provider: KnownProviderType | (string & {});
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* Everything else an entry carries is the provider's own vocabulary — vercel's
|
|
41
|
+
* `project`, ssm's `path` — declared by its package's config type. Core owns no
|
|
42
|
+
* generic address field: a name the developer has to translate is a name that
|
|
43
|
+
* belongs to penv rather than to the store.
|
|
44
44
|
*/
|
|
45
|
-
readonly location?: string;
|
|
46
|
-
/** Fields beyond `location` belong to the provider's own config type. */
|
|
47
45
|
readonly [key: string]: unknown;
|
|
48
46
|
}
|
|
49
47
|
/**
|
|
@@ -66,9 +64,9 @@ interface ProviderFactoryContext {
|
|
|
66
64
|
*/
|
|
67
65
|
readonly config: PenvConfig;
|
|
68
66
|
/**
|
|
69
|
-
* The one environment's own `
|
|
70
|
-
* source of truth. Carries
|
|
71
|
-
* that the config authored, never inferred.
|
|
67
|
+
* The one environment's own `environments.*` entry, when building its declared
|
|
68
|
+
* source of truth. Carries the fields the provider itself declared — vercel's
|
|
69
|
+
* `project`, ssm's `path` — that the config authored, never inferred.
|
|
72
70
|
*/
|
|
73
71
|
readonly providerConfig?: ProviderConfig;
|
|
74
72
|
/**
|
|
@@ -140,27 +138,16 @@ interface ProviderCapabilities {
|
|
|
140
138
|
*/
|
|
141
139
|
readonly readsValues: boolean;
|
|
142
140
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Where one environment's encryption key comes from. Declared, never guessed: a
|
|
145
|
-
* key source penv picked for you is a key you did not choose.
|
|
146
|
-
*/
|
|
147
|
-
interface KeyConfig {
|
|
148
|
-
readonly source: "env" | "keychain";
|
|
149
|
-
/**
|
|
150
|
-
* Names the key. Written into every value file sealed under it, so it must
|
|
151
|
-
* outlive any one machine — and cannot contain `:`, which separates the
|
|
152
|
-
* envelope's fields.
|
|
153
|
-
*/
|
|
154
|
-
readonly id: string;
|
|
155
|
-
}
|
|
156
141
|
interface PenvConfig {
|
|
157
142
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
143
|
+
* Every environment this project has, each mapped to its complete declaration.
|
|
144
|
+
*
|
|
145
|
+
* The record's keys *are* the whitelist (invariant 10) — a key is a
|
|
146
|
+
* declaration, not an inference, so segments are matched against these names
|
|
147
|
+
* and never read out of a folder or a filename. Read them through
|
|
148
|
+
* {@link environmentNames} and {@link environmentEntry} rather than by hand.
|
|
161
149
|
*/
|
|
162
|
-
readonly environments:
|
|
163
|
-
readonly providers: Readonly<Record<string, ProviderConfig>>;
|
|
150
|
+
readonly environments: Readonly<Record<string, string | ProviderConfig>>;
|
|
164
151
|
/**
|
|
165
152
|
* The environment a command acts on when `--env` is absent and nothing in the
|
|
166
153
|
* environment says otherwise. It must be one of {@link environments}.
|
|
@@ -207,11 +194,6 @@ interface PenvConfig {
|
|
|
207
194
|
* error instead of an override that silently never applies.
|
|
208
195
|
*/
|
|
209
196
|
readonly override?: OverrideBlock;
|
|
210
|
-
/**
|
|
211
|
-
* Where each environment's encryption key lives. An environment with no entry
|
|
212
|
-
* has no key source, which is not the same as having no key — see `keys.ts`.
|
|
213
|
-
*/
|
|
214
|
-
readonly keys?: Readonly<Record<string, KeyConfig>>;
|
|
215
197
|
}
|
|
216
198
|
/**
|
|
217
199
|
* Which destination store a value lands in. The two members are penv's own
|
|
@@ -376,10 +358,9 @@ declare class GithubUnavailableError extends PenvError {
|
|
|
376
358
|
}
|
|
377
359
|
|
|
378
360
|
/**
|
|
379
|
-
* The plugin seam: what the penv CLI calls when
|
|
380
|
-
* package. The factory
|
|
381
|
-
*
|
|
382
|
-
* learns GitHub vocabulary and the provider never parses config.
|
|
361
|
+
* The plugin seam: what the penv CLI calls when an `environments.*.provider`
|
|
362
|
+
* names this package. The factory reads the entry's `repository` and hands the
|
|
363
|
+
* provider its options, so the provider never parses config.
|
|
383
364
|
*/
|
|
384
365
|
|
|
385
366
|
/** Builds the GitHub provider for one environment's declared destination. */
|
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,8 @@ interface ParameterRef {
|
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* — so the compile-time union is exactly the set of providers the project has
|
|
23
|
-
* installed, and {@link defineConfig} can hold a known `
|
|
24
|
-
* provider's own declaration while leaving an unknown
|
|
23
|
+
* installed, and {@link defineConfig} can hold a known `provider`'s fields to the
|
|
24
|
+
* provider's own declaration while leaving an unknown one the open base shape.
|
|
25
25
|
*/
|
|
26
26
|
interface ProviderConfigMap {
|
|
27
27
|
}
|
|
@@ -30,20 +30,18 @@ type KnownProviderType = keyof ProviderConfigMap & string;
|
|
|
30
30
|
interface ProviderConfig {
|
|
31
31
|
/**
|
|
32
32
|
* The provider package's fully-qualified name — `"@penvhq/provider-vault"`.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
33
|
+
* Always a plain package specifier, never a factory import: provider packages
|
|
34
|
+
* are integrity-pinned CLI extensions recorded in the manifest, not necessarily
|
|
35
|
+
* installed dependencies, so the config stays data-only and importable in a
|
|
36
|
+
* repo where no adapter code exists.
|
|
37
37
|
*/
|
|
38
|
-
readonly
|
|
38
|
+
readonly provider: KnownProviderType | (string & {});
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* Everything else an entry carries is the provider's own vocabulary — vercel's
|
|
41
|
+
* `project`, ssm's `path` — declared by its package's config type. Core owns no
|
|
42
|
+
* generic address field: a name the developer has to translate is a name that
|
|
43
|
+
* belongs to penv rather than to the store.
|
|
44
44
|
*/
|
|
45
|
-
readonly location?: string;
|
|
46
|
-
/** Fields beyond `location` belong to the provider's own config type. */
|
|
47
45
|
readonly [key: string]: unknown;
|
|
48
46
|
}
|
|
49
47
|
/**
|
|
@@ -66,9 +64,9 @@ interface ProviderFactoryContext {
|
|
|
66
64
|
*/
|
|
67
65
|
readonly config: PenvConfig;
|
|
68
66
|
/**
|
|
69
|
-
* The one environment's own `
|
|
70
|
-
* source of truth. Carries
|
|
71
|
-
* that the config authored, never inferred.
|
|
67
|
+
* The one environment's own `environments.*` entry, when building its declared
|
|
68
|
+
* source of truth. Carries the fields the provider itself declared — vercel's
|
|
69
|
+
* `project`, ssm's `path` — that the config authored, never inferred.
|
|
72
70
|
*/
|
|
73
71
|
readonly providerConfig?: ProviderConfig;
|
|
74
72
|
/**
|
|
@@ -140,27 +138,16 @@ interface ProviderCapabilities {
|
|
|
140
138
|
*/
|
|
141
139
|
readonly readsValues: boolean;
|
|
142
140
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Where one environment's encryption key comes from. Declared, never guessed: a
|
|
145
|
-
* key source penv picked for you is a key you did not choose.
|
|
146
|
-
*/
|
|
147
|
-
interface KeyConfig {
|
|
148
|
-
readonly source: "env" | "keychain";
|
|
149
|
-
/**
|
|
150
|
-
* Names the key. Written into every value file sealed under it, so it must
|
|
151
|
-
* outlive any one machine — and cannot contain `:`, which separates the
|
|
152
|
-
* envelope's fields.
|
|
153
|
-
*/
|
|
154
|
-
readonly id: string;
|
|
155
|
-
}
|
|
156
141
|
interface PenvConfig {
|
|
157
142
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
143
|
+
* Every environment this project has, each mapped to its complete declaration.
|
|
144
|
+
*
|
|
145
|
+
* The record's keys *are* the whitelist (invariant 10) — a key is a
|
|
146
|
+
* declaration, not an inference, so segments are matched against these names
|
|
147
|
+
* and never read out of a folder or a filename. Read them through
|
|
148
|
+
* {@link environmentNames} and {@link environmentEntry} rather than by hand.
|
|
161
149
|
*/
|
|
162
|
-
readonly environments:
|
|
163
|
-
readonly providers: Readonly<Record<string, ProviderConfig>>;
|
|
150
|
+
readonly environments: Readonly<Record<string, string | ProviderConfig>>;
|
|
164
151
|
/**
|
|
165
152
|
* The environment a command acts on when `--env` is absent and nothing in the
|
|
166
153
|
* environment says otherwise. It must be one of {@link environments}.
|
|
@@ -207,11 +194,6 @@ interface PenvConfig {
|
|
|
207
194
|
* error instead of an override that silently never applies.
|
|
208
195
|
*/
|
|
209
196
|
readonly override?: OverrideBlock;
|
|
210
|
-
/**
|
|
211
|
-
* Where each environment's encryption key lives. An environment with no entry
|
|
212
|
-
* has no key source, which is not the same as having no key — see `keys.ts`.
|
|
213
|
-
*/
|
|
214
|
-
readonly keys?: Readonly<Record<string, KeyConfig>>;
|
|
215
197
|
}
|
|
216
198
|
/**
|
|
217
199
|
* Which destination store a value lands in. The two members are penv's own
|
|
@@ -376,10 +358,9 @@ declare class GithubUnavailableError extends PenvError {
|
|
|
376
358
|
}
|
|
377
359
|
|
|
378
360
|
/**
|
|
379
|
-
* The plugin seam: what the penv CLI calls when
|
|
380
|
-
* package. The factory
|
|
381
|
-
*
|
|
382
|
-
* learns GitHub vocabulary and the provider never parses config.
|
|
361
|
+
* The plugin seam: what the penv CLI calls when an `environments.*.provider`
|
|
362
|
+
* names this package. The factory reads the entry's `repository` and hands the
|
|
363
|
+
* provider its options, so the provider never parses config.
|
|
383
364
|
*/
|
|
384
365
|
|
|
385
366
|
/** Builds the GitHub provider for one environment's declared destination. */
|
package/dist/index.js
CHANGED
|
@@ -15030,7 +15030,7 @@ var GithubProvider = class {
|
|
|
15030
15030
|
/**
|
|
15031
15031
|
* The `owner/repo` the API paths below need. `gh secret` resolves the repo
|
|
15032
15032
|
* from the working directory on its own, but `gh api` takes a literal path —
|
|
15033
|
-
* so when no `
|
|
15033
|
+
* so when no `repository` named one, ask `gh` once and keep the answer.
|
|
15034
15034
|
*/
|
|
15035
15035
|
#targetRepo() {
|
|
15036
15036
|
if (this.#repo !== void 0) {
|
|
@@ -15047,7 +15047,7 @@ var GithubProvider = class {
|
|
|
15047
15047
|
if (repo === "") {
|
|
15048
15048
|
throw commandFailed(
|
|
15049
15049
|
"resolve the repository this directory belongs to",
|
|
15050
|
-
"gh reported no repository. Set `
|
|
15050
|
+
"gh reported no repository. Set `repository` to `owner/repo` in the environment's entry."
|
|
15051
15051
|
);
|
|
15052
15052
|
}
|
|
15053
15053
|
this.#resolvedRepo = repo;
|
|
@@ -15093,8 +15093,8 @@ function createGithubProvider(options = {}) {
|
|
|
15093
15093
|
|
|
15094
15094
|
// src/factory.ts
|
|
15095
15095
|
function penvProviderFactory(context) {
|
|
15096
|
-
const
|
|
15097
|
-
return createGithubProvider(
|
|
15096
|
+
const repository = context.providerConfig?.["repository"];
|
|
15097
|
+
return createGithubProvider(typeof repository === "string" ? { repo: repository } : {});
|
|
15098
15098
|
}
|
|
15099
15099
|
export {
|
|
15100
15100
|
GhInvocationError,
|