@effect-app/cli 1.29.1 → 2.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/CHANGELOG.md +12 -0
- package/dist/extract.d.ts +1 -2
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +3 -4
- package/dist/gist.d.ts +180 -103
- package/dist/gist.d.ts.map +1 -1
- package/dist/gist.js +43 -57
- package/dist/index.js +21 -28
- package/dist/os-command.d.ts +12 -9
- package/dist/os-command.d.ts.map +1 -1
- package/dist/os-command.js +13 -17
- package/package.json +9 -8
- package/src/extract.ts +2 -3
- package/src/gist.ts +88 -99
- package/src/index.ts +636 -650
- package/src/os-command.ts +14 -25
- package/tsconfig.json +1 -27
package/CHANGELOG.md
CHANGED
package/dist/extract.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Effect, FileSystem, Path, type PlatformError } from "effect";
|
|
3
2
|
/**
|
|
4
3
|
* Generates package.json exports mappings for TypeScript modules
|
|
5
4
|
* This function finds all .ts files in src/ (excluding test files) and generates
|
package/dist/extract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAE,UAAU,EAAS,IAAI,EAAQ,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAA;AAExG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,qIAuDrC,CAAA"}
|
package/dist/extract.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { FileSystem, Path } from "
|
|
2
|
-
import { Array as EffectArray, Effect, Order, pipe } from "effect";
|
|
1
|
+
import { Array as EffectArray, Effect, FileSystem, Order, Path, pipe } from "effect";
|
|
3
2
|
/**
|
|
4
3
|
* Generates package.json exports mappings for TypeScript modules
|
|
5
4
|
* This function finds all .ts files in src/ (excluding test files) and generates
|
|
@@ -46,8 +45,8 @@ export const ExtractExportMappingsService = Effect.fn("effa-cli.extractExportMap
|
|
|
46
45
|
const typesPath = `./dist/${relativePath.replace(/\.ts$/, ".d.ts")}`;
|
|
47
46
|
return `"${exportKey}": { "types": "${typesPath}", "default": "${distPath}" }`;
|
|
48
47
|
});
|
|
49
|
-
const sortedMappings = pipe(exportMappings, EffectArray.sort(Order.
|
|
48
|
+
const sortedMappings = pipe(exportMappings, EffectArray.sort(Order.String), EffectArray.join(",\n"));
|
|
50
49
|
return sortedMappings;
|
|
51
50
|
});
|
|
52
51
|
})();
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmFjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9leHRyYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLElBQUksV0FBVyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQXNCLE1BQU0sUUFBUSxDQUFBO0FBRXhHOzs7Ozs7Ozs7O0dBVUc7QUFDSCxNQUFNLENBQUMsTUFBTSw0QkFBNEIsR0FBRyxNQUFNLENBQUMsRUFBRSxDQUFDLGdDQUFnQyxDQUFDLENBQUMsUUFBUSxDQUFDO0lBQy9GLE1BQU0sRUFBRSxHQUFHLEtBQUssQ0FBQyxDQUFDLFVBQVUsQ0FBQyxVQUFVLENBQUE7SUFDdkMsTUFBTSxJQUFJLEdBQUcsS0FBSyxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQTtJQUU3Qix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QTtRQUVGLE1BQU0sY0FBYyxHQUFHLElBQUksQ0FDekIsY0FBYyxFQUNkLFdBQVcsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxFQUM5QixXQUFXLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUN4QixDQUFBO1FBRUQsT0FBTyxjQUFjLENBQUE7SUFDdkIsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUMsRUFBRSxDQUFBIn0=
|
package/dist/gist.d.ts
CHANGED
|
@@ -1,63 +1,39 @@
|
|
|
1
|
-
import { FileSystem, Path } from "
|
|
2
|
-
import { Effect, ParseResult, Schema } from "effect";
|
|
1
|
+
import { Config, Effect, FileSystem, Layer, Path, Schema, ServiceMap } from "effect";
|
|
3
2
|
import { RunCommandService } from "./os-command.js";
|
|
4
|
-
declare const GistError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").
|
|
3
|
+
declare const GistError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").MatchRecord<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }, void, { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
5
4
|
readonly _tag: "GistError";
|
|
6
5
|
} & Readonly<A>;
|
|
7
6
|
export declare class GistError extends GistError_base<{
|
|
8
7
|
message: string;
|
|
9
8
|
}> {
|
|
10
9
|
}
|
|
11
|
-
declare const GistEntry_base: Schema.
|
|
12
|
-
description:
|
|
13
|
-
public:
|
|
14
|
-
company:
|
|
15
|
-
files: Schema
|
|
16
|
-
}
|
|
17
|
-
description: typeof Schema.String;
|
|
18
|
-
public: typeof Schema.Boolean;
|
|
19
|
-
company: typeof Schema.String;
|
|
20
|
-
files: Schema.Array$<typeof Schema.String>;
|
|
21
|
-
}>, never, {
|
|
22
|
-
readonly description: string;
|
|
23
|
-
} & {
|
|
24
|
-
readonly public: boolean;
|
|
25
|
-
} & {
|
|
26
|
-
readonly company: string;
|
|
27
|
-
} & {
|
|
28
|
-
readonly files: readonly string[];
|
|
29
|
-
}, {}, {}>;
|
|
10
|
+
declare const GistEntry_base: Schema.ExtendableClass<GistEntry, Schema.Struct<{
|
|
11
|
+
readonly description: Schema.String;
|
|
12
|
+
readonly public: Schema.Boolean;
|
|
13
|
+
readonly company: Schema.String;
|
|
14
|
+
readonly files: Schema.$Array<Schema.String>;
|
|
15
|
+
}>, {}>;
|
|
30
16
|
export declare class GistEntry extends GistEntry_base {
|
|
31
17
|
}
|
|
32
|
-
declare const GistEntryDecoded_base: Schema.
|
|
33
|
-
description:
|
|
34
|
-
public:
|
|
35
|
-
company:
|
|
36
|
-
files: Schema
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
name: typeof Schema.String;
|
|
18
|
+
declare const GistEntryDecoded_base: Schema.Opaque<GistEntryDecoded, Schema.decodeTo<Schema.Struct<{
|
|
19
|
+
readonly description: Schema.String;
|
|
20
|
+
readonly public: Schema.Boolean;
|
|
21
|
+
readonly company: Schema.String;
|
|
22
|
+
readonly files: Schema.$Array<Schema.String>;
|
|
23
|
+
readonly files_with_name: Schema.$Array<Schema.Struct<{
|
|
24
|
+
readonly path: Schema.String;
|
|
25
|
+
readonly name: Schema.String;
|
|
41
26
|
}>>;
|
|
42
|
-
}, Schema.Struct
|
|
43
|
-
description:
|
|
44
|
-
public:
|
|
45
|
-
company:
|
|
46
|
-
files: Schema
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
readonly company: string;
|
|
53
|
-
} & {
|
|
54
|
-
readonly files: readonly string[];
|
|
55
|
-
} & {
|
|
56
|
-
readonly files_with_name: readonly {
|
|
57
|
-
readonly name: string;
|
|
58
|
-
readonly path: string;
|
|
59
|
-
}[];
|
|
60
|
-
}, GistEntry, {}>;
|
|
27
|
+
}>, typeof GistEntry, never, never>, {}> & Omit<Schema.decodeTo<Schema.Struct<{
|
|
28
|
+
readonly description: Schema.String;
|
|
29
|
+
readonly public: Schema.Boolean;
|
|
30
|
+
readonly company: Schema.String;
|
|
31
|
+
readonly files: Schema.$Array<Schema.String>;
|
|
32
|
+
readonly files_with_name: Schema.$Array<Schema.Struct<{
|
|
33
|
+
readonly path: Schema.String;
|
|
34
|
+
readonly name: Schema.String;
|
|
35
|
+
}>>;
|
|
36
|
+
}>, typeof GistEntry, never, never>, "Type">;
|
|
61
37
|
/**
|
|
62
38
|
* Extended gist entry that validates file_name uniqueness and extracts base filenames.
|
|
63
39
|
*
|
|
@@ -81,56 +57,26 @@ declare const GistEntryDecoded_base: Schema.Class<GistEntryDecoded, {
|
|
|
81
57
|
*/
|
|
82
58
|
export declare class GistEntryDecoded extends GistEntryDecoded_base {
|
|
83
59
|
}
|
|
84
|
-
declare const GistYAML_base: Schema.
|
|
85
|
-
gists: Schema.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}>;
|
|
90
|
-
settings: Schema.Struct<{
|
|
91
|
-
token_env: typeof Schema.String;
|
|
92
|
-
base_directory: typeof Schema.String;
|
|
93
|
-
}>;
|
|
94
|
-
}, Schema.Struct.Encoded<{
|
|
95
|
-
gists: Schema.optionalWith<Schema.Record$<typeof Schema.String, typeof GistEntryDecoded>, {
|
|
96
|
-
default: () => {};
|
|
97
|
-
nullable: true;
|
|
98
|
-
exact: true;
|
|
60
|
+
declare const GistYAML_base: Schema.ExtendableClass<GistYAML, Schema.Struct<{
|
|
61
|
+
readonly gists: Schema.optional<Schema.NullOr<Schema.$Record<Schema.String, typeof GistEntryDecoded>>>;
|
|
62
|
+
readonly settings: Schema.Struct<{
|
|
63
|
+
readonly token_env: Schema.String;
|
|
64
|
+
readonly base_directory: Schema.String;
|
|
99
65
|
}>;
|
|
100
|
-
|
|
101
|
-
token_env: typeof Schema.String;
|
|
102
|
-
base_directory: typeof Schema.String;
|
|
103
|
-
}>;
|
|
104
|
-
}>, never, {
|
|
105
|
-
readonly gists?: {
|
|
106
|
-
readonly [x: string]: GistEntryDecoded;
|
|
107
|
-
};
|
|
108
|
-
} & {
|
|
109
|
-
readonly settings: {
|
|
110
|
-
readonly token_env: string;
|
|
111
|
-
readonly base_directory: string;
|
|
112
|
-
};
|
|
113
|
-
}, {}, {}>;
|
|
66
|
+
}>, {}>;
|
|
114
67
|
export declare class GistYAML extends GistYAML_base {
|
|
115
68
|
}
|
|
116
|
-
declare const GistCacheEntry_base: Schema.
|
|
117
|
-
name:
|
|
118
|
-
id:
|
|
119
|
-
}
|
|
120
|
-
name: typeof Schema.String;
|
|
121
|
-
id: typeof Schema.String;
|
|
122
|
-
}>, never, {
|
|
123
|
-
readonly name: string;
|
|
124
|
-
} & {
|
|
125
|
-
readonly id: string;
|
|
126
|
-
}, {}, {}>;
|
|
69
|
+
declare const GistCacheEntry_base: Schema.ExtendableClass<GistCacheEntry, Schema.Struct<{
|
|
70
|
+
readonly name: Schema.String;
|
|
71
|
+
readonly id: Schema.String;
|
|
72
|
+
}>, {}>;
|
|
127
73
|
/**
|
|
128
74
|
* Cache entry representing a gist mapping.
|
|
129
75
|
* Each entry contains the gist's human-readable name and GitHub ID.
|
|
130
76
|
*/
|
|
131
77
|
export declare class GistCacheEntry extends GistCacheEntry_base {
|
|
132
78
|
}
|
|
133
|
-
export declare const GistCacheEntries: Schema
|
|
79
|
+
export declare const GistCacheEntries: Schema.$Array<typeof GistCacheEntry>;
|
|
134
80
|
export interface GistCacheEntries extends Schema.Schema.Type<typeof GistCacheEntries> {
|
|
135
81
|
}
|
|
136
82
|
/**
|
|
@@ -157,7 +103,7 @@ export declare class GistCache {
|
|
|
157
103
|
company: string;
|
|
158
104
|
});
|
|
159
105
|
}
|
|
160
|
-
declare const GistCacheOfCompanyNotFound_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").
|
|
106
|
+
declare const GistCacheOfCompanyNotFound_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").MatchRecord<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }, void, { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
161
107
|
readonly _tag: "GistCacheOfCompanyNotFound";
|
|
162
108
|
} & Readonly<A>;
|
|
163
109
|
declare class GistCacheOfCompanyNotFound extends GistCacheOfCompanyNotFound_base<{
|
|
@@ -165,16 +111,141 @@ declare class GistCacheOfCompanyNotFound extends GistCacheOfCompanyNotFound_base
|
|
|
165
111
|
readonly cache_gist_id: string;
|
|
166
112
|
}> {
|
|
167
113
|
}
|
|
168
|
-
declare const GistYAMLError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").
|
|
114
|
+
declare const GistYAMLError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").MatchRecord<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }, void, { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
169
115
|
readonly _tag: "GistYAMLError";
|
|
170
116
|
} & Readonly<A>;
|
|
171
117
|
declare class GistYAMLError extends GistYAMLError_base<{
|
|
172
118
|
readonly message: string;
|
|
173
119
|
}> {
|
|
174
120
|
}
|
|
175
|
-
declare const GHGistService_base:
|
|
176
|
-
|
|
177
|
-
|
|
121
|
+
declare const GHGistService_base: ServiceMap.ServiceClass<GHGistService, "GHGistService", {
|
|
122
|
+
/** Logs into GitHub using the GitHub CLI.
|
|
123
|
+
* This is a prerequisite for other gist operations.
|
|
124
|
+
* @param token - The GitHub personal access token with gist permissions
|
|
125
|
+
*
|
|
126
|
+
* @returns An Effect that succeeds when login is successful
|
|
127
|
+
*/
|
|
128
|
+
login: (token: string) => Effect.Effect<undefined, GistError, never>;
|
|
129
|
+
/**
|
|
130
|
+
* Loads the gist cache from GitHub, containing mappings of YAML configuration names to gist IDs.
|
|
131
|
+
* If no cache exists, creates a new empty cache gist.
|
|
132
|
+
*
|
|
133
|
+
* @returns An Effect that yields a GistCache containing the loaded cache entries and cache gist ID
|
|
134
|
+
*/
|
|
135
|
+
loadGistCache: (company: string, rec?: {
|
|
136
|
+
recCache?: boolean;
|
|
137
|
+
recCacheCompany?: boolean;
|
|
138
|
+
}) => Effect.Effect<GistCache, GistCacheOfCompanyNotFound, never>;
|
|
139
|
+
/**
|
|
140
|
+
* Saves the current gist cache state to the GitHub cache gist.
|
|
141
|
+
* Updates the existing cache gist with the current mappings of names to gist IDs.
|
|
142
|
+
*
|
|
143
|
+
* @param cache - The GistCache instance to save
|
|
144
|
+
* @returns An Effect that succeeds when the cache is successfully saved
|
|
145
|
+
*/
|
|
146
|
+
saveGistCache: (cache: GistCache) => Effect.Effect<void, never, never>;
|
|
147
|
+
/**
|
|
148
|
+
* Creates a new GitHub gist with the specified files and renames them with environment prefixes.
|
|
149
|
+
* Generates a GitHub CLI command to create the gist, extracts the resulting gist ID,
|
|
150
|
+
* and renames all files with environment prefixes for multi-environment support.
|
|
151
|
+
*
|
|
152
|
+
* @param gist_name - The human-readable name for this gist (used in cache mapping)
|
|
153
|
+
* @param description - The description for the GitHub gist
|
|
154
|
+
* @param files - Array of file objects with path and name properties to include in the gist
|
|
155
|
+
* @param is_public - Whether the gist should be public or private
|
|
156
|
+
* @param env - Environment prefix to prepend to file names (e.g., "local-dev", "prod")
|
|
157
|
+
* @returns An Effect that yields a gist entry object with name and id properties
|
|
158
|
+
*/
|
|
159
|
+
createGistWithFiles: (args_0: {
|
|
160
|
+
gist_name: string;
|
|
161
|
+
description: string;
|
|
162
|
+
files: {
|
|
163
|
+
path: string;
|
|
164
|
+
name: string;
|
|
165
|
+
}[];
|
|
166
|
+
is_public: boolean;
|
|
167
|
+
env: string;
|
|
168
|
+
}) => Effect.Effect<{
|
|
169
|
+
name: string;
|
|
170
|
+
id: string;
|
|
171
|
+
}, never, never>;
|
|
172
|
+
/**
|
|
173
|
+
* Retrieves file names from a GitHub gist, filtered by environment prefix.
|
|
174
|
+
* Fetches the list of files contained in the specified gist and returns only
|
|
175
|
+
* those that match the current environment, with the environment prefix removed.
|
|
176
|
+
*
|
|
177
|
+
* @param gist_id - The GitHub gist ID to retrieve file names from
|
|
178
|
+
* @param gist_name - The human-readable name of the gist (for logging purposes)
|
|
179
|
+
* @param env - Environment prefix to filter files by (e.g., "local-dev", "prod")
|
|
180
|
+
* @returns An Effect that yields an array of file names with environment prefix removed
|
|
181
|
+
*/
|
|
182
|
+
getGistFileNames: (args_0: {
|
|
183
|
+
gist_id: string;
|
|
184
|
+
gist_name: string;
|
|
185
|
+
env: string;
|
|
186
|
+
}) => Effect.Effect<string[], never, never>;
|
|
187
|
+
/**
|
|
188
|
+
* Removes a file from a specified GitHub gist.
|
|
189
|
+
* The file name is automatically prefixed with the environment when removing.
|
|
190
|
+
* @param gist_id - The ID of the gist to modify
|
|
191
|
+
* @param gist_name - The human-readable name of the gist (for logging purposes)
|
|
192
|
+
* @param file_name - The base name of the file to remove (without environment prefix)
|
|
193
|
+
* @param env - Environment prefix that was used when the file was added
|
|
194
|
+
* @returns An Effect that succeeds when the file is removed
|
|
195
|
+
*/
|
|
196
|
+
removeFileFromGist: (args_0: {
|
|
197
|
+
gist_id: string;
|
|
198
|
+
gist_name: string;
|
|
199
|
+
file_name: string;
|
|
200
|
+
env: string;
|
|
201
|
+
}) => Effect.Effect<void, never, never>;
|
|
202
|
+
/**
|
|
203
|
+
* Updates a file in a specified GitHub gist.
|
|
204
|
+
* The file name is automatically prefixed with the environment when updating.
|
|
205
|
+
* @param gist_id - The ID of the gist to modify
|
|
206
|
+
* @param gist_name - The human-readable name of the gist (for logging purposes)
|
|
207
|
+
* @param file_name - The base name of the file to update (without environment prefix)
|
|
208
|
+
* @param file_path - The local path of the file to update in the gist
|
|
209
|
+
* @param env - Environment prefix that was used when the file was added
|
|
210
|
+
* @returns An Effect that succeeds when the file is updated
|
|
211
|
+
*/
|
|
212
|
+
updateFileOfGist: (args_0: {
|
|
213
|
+
gist_id: string;
|
|
214
|
+
gist_name: string;
|
|
215
|
+
file_name: string;
|
|
216
|
+
file_path: string;
|
|
217
|
+
env: string;
|
|
218
|
+
}) => Effect.Effect<void, never, never>;
|
|
219
|
+
/**
|
|
220
|
+
* Adds a new file to a specified GitHub gist.
|
|
221
|
+
* The file is automatically renamed with an environment prefix for multi-environment support.
|
|
222
|
+
* @param gist_id - The ID of the gist to modify
|
|
223
|
+
* @param gist_name - The human-readable name of the gist (for logging purposes)
|
|
224
|
+
* @param file - The file object containing path and name properties
|
|
225
|
+
* @param env - Environment prefix to prepend to the file name
|
|
226
|
+
* @returns An Effect that succeeds when the file is added and renamed
|
|
227
|
+
*/
|
|
228
|
+
addFileToGist: (args_0: {
|
|
229
|
+
gist_id: string;
|
|
230
|
+
gist_name: string;
|
|
231
|
+
file: {
|
|
232
|
+
path: string;
|
|
233
|
+
name: string;
|
|
234
|
+
};
|
|
235
|
+
env: string;
|
|
236
|
+
}) => Effect.Effect<void, never, never>;
|
|
237
|
+
/**
|
|
238
|
+
* Deletes a specified GitHub gist by its ID.
|
|
239
|
+
* @param gist_id - The ID of the gist to delete
|
|
240
|
+
* @param gist_name - The human-readable name of the gist (for logging purposes)
|
|
241
|
+
* @returns An Effect that succeeds when the gist is deleted
|
|
242
|
+
*/
|
|
243
|
+
deleteGist: (args_0: {
|
|
244
|
+
gist_id: string;
|
|
245
|
+
gist_name: string;
|
|
246
|
+
}) => Effect.Effect<void, never, never>;
|
|
247
|
+
}> & {
|
|
248
|
+
readonly make: Effect.Effect<{
|
|
178
249
|
/** Logs into GitHub using the GitHub CLI.
|
|
179
250
|
* This is a prerequisite for other gist operations.
|
|
180
251
|
* @param token - The GitHub personal access token with gist permissions
|
|
@@ -301,19 +372,25 @@ declare const GHGistService_base: Effect.Service.Class<GHGistService, "GHGistSer
|
|
|
301
372
|
gist_name: string;
|
|
302
373
|
}) => Effect.Effect<void, never, never>;
|
|
303
374
|
}, never, RunCommandService>;
|
|
304
|
-
}
|
|
375
|
+
};
|
|
305
376
|
declare class GHGistService extends GHGistService_base {
|
|
377
|
+
static DefaultWithoutDependencies: Layer.Layer<GHGistService, never, RunCommandService>;
|
|
378
|
+
static Default: Layer.Layer<GHGistService, never, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner>;
|
|
306
379
|
}
|
|
307
|
-
declare const GistHandler_base:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
380
|
+
declare const GistHandler_base: ServiceMap.ServiceClass<GistHandler, "GistHandler", {
|
|
381
|
+
handler: (args_0: {
|
|
382
|
+
YAMLPath: string;
|
|
383
|
+
}) => Effect.Effect<undefined, import("effect/PlatformError").PlatformError | GistError | GistCacheOfCompanyNotFound | GistYAMLError | Schema.SchemaError | Config.ConfigError, never>;
|
|
384
|
+
}> & {
|
|
385
|
+
readonly make: Effect.Effect<{
|
|
311
386
|
handler: (args_0: {
|
|
312
387
|
YAMLPath: string;
|
|
313
|
-
}) => Effect.Effect<undefined, import("
|
|
388
|
+
}) => Effect.Effect<undefined, import("effect/PlatformError").PlatformError | GistError | GistCacheOfCompanyNotFound | GistYAMLError | Schema.SchemaError | Config.ConfigError, never>;
|
|
314
389
|
}, never, Path.Path | FileSystem.FileSystem | GHGistService>;
|
|
315
|
-
}
|
|
390
|
+
};
|
|
316
391
|
export declare class GistHandler extends GistHandler_base {
|
|
392
|
+
static DefaultWithoutDependencies: Layer.Layer<GistHandler, never, Path.Path | FileSystem.FileSystem | GHGistService>;
|
|
393
|
+
static Default: Layer.Layer<GistHandler, never, Path.Path | FileSystem.FileSystem | import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner>;
|
|
317
394
|
}
|
|
318
395
|
export {};
|
|
319
396
|
//# sourceMappingURL=gist.d.ts.map
|
package/dist/gist.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gist.d.ts","sourceRoot":"","sources":["../src/gist.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"gist.d.ts","sourceRoot":"","sources":["../src/gist.ts"],"names":[],"mappings":"AAGA,OAAO,EA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