@envctrl/types 1.0.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/command.d.ts +25 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +1 -0
- package/dist/dotenvx.d.ts +11 -0
- package/dist/dotenvx.d.ts.map +1 -0
- package/dist/dotenvx.js +1 -0
- package/dist/environment.d.ts +30 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/keystore.d.ts +14 -0
- package/dist/keystore.d.ts.map +1 -0
- package/dist/keystore.js +1 -0
- package/package.json +24 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime context injected into every subcommand execution.
|
|
3
|
+
* Contains the resolved working directory and global flags.
|
|
4
|
+
*/
|
|
5
|
+
export interface CommandContext {
|
|
6
|
+
readonly cwd: string;
|
|
7
|
+
readonly quiet: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Uniform result envelope returned from every subcommand execution. */
|
|
10
|
+
export interface CommandResult<T = unknown> {
|
|
11
|
+
readonly success: boolean;
|
|
12
|
+
readonly data?: T;
|
|
13
|
+
readonly error?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Contract every concrete command must satisfy.
|
|
17
|
+
* Separates what to execute from how the CLI routes to it.
|
|
18
|
+
*
|
|
19
|
+
* @template TOptions - Parsed options object passed from Commander
|
|
20
|
+
* @template TResult - Shape of the `data` field in the returned {@link CommandResult}
|
|
21
|
+
*/
|
|
22
|
+
export interface ISubCommand<TOptions = Record<string, unknown>, TResult = unknown> {
|
|
23
|
+
execute(options: TOptions, context: CommandContext): Promise<CommandResult<TResult>>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,wEAAwE;AACxE,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO;IAChF,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;CACtF"}
|
package/dist/command.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Result of a dotenvx set operation mirrored from SetOutput. */
|
|
2
|
+
export interface DotenvxSetResult {
|
|
3
|
+
readonly changedFilepaths: string[];
|
|
4
|
+
readonly unchangedFilepaths: string[];
|
|
5
|
+
}
|
|
6
|
+
/** Result of a dotenvx encrypt operation. */
|
|
7
|
+
export interface DotenvxEncryptResult {
|
|
8
|
+
readonly changedFilepaths: string[];
|
|
9
|
+
readonly unchangedFilepaths: string[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=dotenvx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotenvx.d.ts","sourceRoot":"","sources":["../src/dotenvx.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;CACvC;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;CACvC"}
|
package/dist/dotenvx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** A validated environment name token, e.g. "development", "production". */
|
|
2
|
+
export type EnvironmentName = string;
|
|
3
|
+
/**
|
|
4
|
+
* Represents the pair of files that back one named environment.
|
|
5
|
+
* - `unencrypted`: `.env.[env].unencrypted` — the human-editable plaintext source
|
|
6
|
+
* - `encrypted`: `.env.[env]` — the dotenvx-encrypted file committed to VCS
|
|
7
|
+
*/
|
|
8
|
+
export interface EnvFilePair {
|
|
9
|
+
readonly environment: EnvironmentName;
|
|
10
|
+
readonly unencrypted: string;
|
|
11
|
+
readonly encrypted: string;
|
|
12
|
+
}
|
|
13
|
+
/** Outcome of a switch operation. */
|
|
14
|
+
export interface SwitchResult {
|
|
15
|
+
readonly environment: EnvironmentName;
|
|
16
|
+
readonly created: string[];
|
|
17
|
+
readonly activePath: string;
|
|
18
|
+
}
|
|
19
|
+
/** Result of a set operation on a single key. */
|
|
20
|
+
export interface SetResult {
|
|
21
|
+
readonly environment: EnvironmentName;
|
|
22
|
+
readonly key: string;
|
|
23
|
+
readonly changed: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Result of a bulk encrypt operation. */
|
|
26
|
+
export interface EncryptResult {
|
|
27
|
+
readonly changedFiles: string[];
|
|
28
|
+
readonly unchangedFiles: string[];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,iDAAiD;AACjD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Absolute path to a keystore directory. */
|
|
2
|
+
export type KeystorePath = string;
|
|
3
|
+
/** A named keystore entry as returned by list. */
|
|
4
|
+
export interface KeystoreEntry {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly path: KeystorePath;
|
|
7
|
+
}
|
|
8
|
+
/** Configuration for a keystore instance. */
|
|
9
|
+
export interface KeystoreConfig {
|
|
10
|
+
readonly path: KeystorePath;
|
|
11
|
+
}
|
|
12
|
+
/** The three actions the keystore command dispatches. */
|
|
13
|
+
export type KeystoreAction = 'create' | 'list' | 'delete';
|
|
14
|
+
//# sourceMappingURL=keystore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keystore.d.ts","sourceRoot":"","sources":["../src/keystore.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CAC7B;AAED,6CAA6C;AAC7C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CAC7B;AAED,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC"}
|
package/dist/keystore.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@envctrl/types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"import": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.8.0"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.build.json",
|
|
22
|
+
"typecheck": "tsc --noEmit"
|
|
23
|
+
}
|
|
24
|
+
}
|