@mks2508/coolify-mks-cli-mcp 0.5.0 → 0.6.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/cli/coolify-state.d.ts +51 -0
- package/dist/cli/coolify-state.d.ts.map +1 -0
- package/dist/cli/index.js +2862 -631
- package/dist/coolify/config.d.ts +1 -1
- package/dist/coolify/config.d.ts.map +1 -1
- package/dist/coolify/index.d.ts +626 -12
- package/dist/coolify/index.d.ts.map +1 -1
- package/dist/coolify/types.d.ts +87 -3
- package/dist/coolify/types.d.ts.map +1 -1
- package/dist/dist-C4hIkHif.js +66 -0
- package/dist/dist-C4hIkHif.js.map +1 -0
- package/dist/dist-DEPvJhbP.js +3 -0
- package/dist/index.cjs +8511 -28542
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +32 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8470 -28506
- package/dist/index.js.map +1 -1
- package/dist/network.d.ts +75 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/sdk.d.ts +356 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/sse.js +3 -1
- package/dist/server/stdio.d.ts +0 -2
- package/dist/server/stdio.d.ts.map +1 -1
- package/dist/server/stdio.js +3307 -1618
- package/dist/tools/definitions.d.ts +1 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/handlers.d.ts +6 -7
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/trace.d.ts +71 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/utils/format.d.ts +1 -1
- package/dist/utils/format.d.ts.map +1 -1
- package/package.json +13 -7
- package/src/cli/actions.ts +162 -0
- package/src/cli/commands/active-deployments.ts +24 -0
- package/src/cli/commands/build-logs.ts +25 -22
- package/src/cli/commands/cancel-deploy.ts +35 -0
- package/src/cli/commands/config.ts +53 -47
- package/src/cli/commands/create.ts +74 -53
- package/src/cli/commands/databases.ts +63 -0
- package/src/cli/commands/db.ts +68 -0
- package/src/cli/commands/delete.ts +41 -29
- package/src/cli/commands/deploy.ts +42 -21
- package/src/cli/commands/deployments.ts +41 -31
- package/src/cli/commands/destinations.ts +19 -27
- package/src/cli/commands/diagnose.ts +139 -0
- package/src/cli/commands/env.ts +66 -41
- package/src/cli/commands/environments.ts +36 -32
- package/src/cli/commands/exec.ts +39 -0
- package/src/cli/commands/keys.ts +46 -0
- package/src/cli/commands/list.ts +29 -27
- package/src/cli/commands/logs.ts +33 -18
- package/src/cli/commands/network.ts +145 -0
- package/src/cli/commands/projects.ts +51 -39
- package/src/cli/commands/restart.ts +34 -18
- package/src/cli/commands/server-resources.ts +71 -0
- package/src/cli/commands/servers.ts +23 -23
- package/src/cli/commands/service-logs.ts +24 -16
- package/src/cli/commands/services.ts +63 -0
- package/src/cli/commands/show.ts +72 -41
- package/src/cli/commands/start.ts +34 -18
- package/src/cli/commands/stop.ts +34 -18
- package/src/cli/commands/svc.ts +68 -0
- package/src/cli/commands/teams.ts +60 -0
- package/src/cli/commands/update.ts +73 -49
- package/src/cli/commands/version.ts +37 -0
- package/src/cli/coolify-state.ts +88 -0
- package/src/cli/index.ts +383 -151
- package/src/coolify/config.ts +29 -27
- package/src/coolify/index.ts +1829 -123
- package/src/coolify/types.ts +217 -124
- package/src/index.ts +82 -868
- package/src/network.ts +298 -0
- package/src/sdk.ts +597 -0
- package/src/server/index.ts +13 -0
- package/src/server/sse.ts +33 -25
- package/src/server/stdio.ts +24 -27
- package/src/tools/definitions.ts +893 -264
- package/src/tools/handlers.ts +556 -748
- package/src/tools/index.ts +8 -0
- package/src/trace.ts +116 -0
- package/src/utils/format.ts +36 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/coolify/index.ts"],"names":[],"mappings":"AAAA;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AAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC,EACF,KAAK,CACN,CACF;CAaF;AAID;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAKlD;AAGD,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,IAAI,mBAAmB,EACtC,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
package/dist/coolify/types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface ICoolifyDeployOptions {
|
|
|
22
22
|
/**
|
|
23
23
|
* Application types supported by Coolify.
|
|
24
24
|
*/
|
|
25
|
-
export type TCoolifyApplicationType =
|
|
25
|
+
export type TCoolifyApplicationType = "public" | "private-github-app" | "private-deploy-key" | "dockerfile" | "docker-image" | "docker-compose";
|
|
26
26
|
/**
|
|
27
27
|
* Options for creating a Coolify application.
|
|
28
28
|
*/
|
|
@@ -48,7 +48,7 @@ export interface ICoolifyAppOptions {
|
|
|
48
48
|
/** Git branch */
|
|
49
49
|
branch?: string;
|
|
50
50
|
/** Build pack type */
|
|
51
|
-
buildPack?:
|
|
51
|
+
buildPack?: "dockerfile" | "nixpacks" | "static" | "dockercompose";
|
|
52
52
|
/** Ports to expose */
|
|
53
53
|
portsExposes?: string;
|
|
54
54
|
/** Docker image (for docker-image type) */
|
|
@@ -73,7 +73,7 @@ export interface ICoolifyUpdateOptions {
|
|
|
73
73
|
/** Application description */
|
|
74
74
|
description?: string;
|
|
75
75
|
/** Build pack type */
|
|
76
|
-
buildPack?:
|
|
76
|
+
buildPack?: "dockerfile" | "nixpacks" | "static" | "dockercompose";
|
|
77
77
|
/** Git branch */
|
|
78
78
|
gitBranch?: string;
|
|
79
79
|
/** Ports to expose */
|
|
@@ -105,6 +105,8 @@ export interface ICoolifyLogsOptions {
|
|
|
105
105
|
follow?: boolean;
|
|
106
106
|
/** Number of lines to retrieve */
|
|
107
107
|
tail?: number;
|
|
108
|
+
/** Service name for docker-compose apps */
|
|
109
|
+
serviceName?: string;
|
|
108
110
|
}
|
|
109
111
|
/**
|
|
110
112
|
* Result of a Coolify deployment.
|
|
@@ -321,4 +323,86 @@ export interface ICoolifyTeam {
|
|
|
321
323
|
* @param step - Current step identifier
|
|
322
324
|
*/
|
|
323
325
|
export type IProgressCallback = (percent: number, message: string, step?: string) => void;
|
|
326
|
+
/**
|
|
327
|
+
* Database details from API (snake_case).
|
|
328
|
+
*/
|
|
329
|
+
export interface ICoolifyDatabase {
|
|
330
|
+
uuid: string;
|
|
331
|
+
name: string;
|
|
332
|
+
type: string;
|
|
333
|
+
status: string;
|
|
334
|
+
version?: string;
|
|
335
|
+
description?: string | null;
|
|
336
|
+
destination?: {
|
|
337
|
+
uuid: string;
|
|
338
|
+
name: string;
|
|
339
|
+
server?: {
|
|
340
|
+
uuid: string;
|
|
341
|
+
name: string;
|
|
342
|
+
ip: string;
|
|
343
|
+
};
|
|
344
|
+
} | null;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Service details from API (snake_case).
|
|
348
|
+
*/
|
|
349
|
+
export interface ICoolifyService {
|
|
350
|
+
uuid: string;
|
|
351
|
+
name: string;
|
|
352
|
+
type: string;
|
|
353
|
+
status: string;
|
|
354
|
+
version?: string;
|
|
355
|
+
description?: string | null;
|
|
356
|
+
project_uuid?: string;
|
|
357
|
+
environment_uuid?: string;
|
|
358
|
+
server_uuid?: string;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Private key details from API (snake_case).
|
|
362
|
+
*/
|
|
363
|
+
export interface ICoolifyPrivateKey {
|
|
364
|
+
uuid: string;
|
|
365
|
+
name: string;
|
|
366
|
+
private_key?: string;
|
|
367
|
+
is_git_related?: boolean;
|
|
368
|
+
created_at?: string;
|
|
369
|
+
updated_at?: string;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Database backup details from API (snake_case).
|
|
373
|
+
*/
|
|
374
|
+
export interface ICoolifyDatabaseBackup {
|
|
375
|
+
uuid: string;
|
|
376
|
+
name: string;
|
|
377
|
+
status: string;
|
|
378
|
+
created_at: string;
|
|
379
|
+
finished_at?: string;
|
|
380
|
+
size?: number;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Server resource details from API.
|
|
384
|
+
*/
|
|
385
|
+
export interface ICoolifyServerResource {
|
|
386
|
+
uuid: string;
|
|
387
|
+
name: string;
|
|
388
|
+
type: string;
|
|
389
|
+
status: string;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Server domain details from API.
|
|
393
|
+
*/
|
|
394
|
+
export interface ICoolifyServerDomain {
|
|
395
|
+
uuid: string;
|
|
396
|
+
domain: string;
|
|
397
|
+
status: string;
|
|
398
|
+
force_https: boolean;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Coolify version info.
|
|
402
|
+
*/
|
|
403
|
+
export interface ICoolifyVersion {
|
|
404
|
+
version: string;
|
|
405
|
+
latest_version?: string;
|
|
406
|
+
is_latest?: boolean;
|
|
407
|
+
}
|
|
324
408
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/coolify/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/coolify/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WA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CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region ../../../node_modules/.bun/@mks2508+no-throw@0.1.0/node_modules/@mks2508/no-throw/dist/index.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Creates a successful Result containing the given value.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of the success value
|
|
6
|
+
* @param value - The value to wrap in an Ok
|
|
7
|
+
* @returns An Ok containing the value
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const result = ok(42)
|
|
12
|
+
* // result.ok === true
|
|
13
|
+
* // result.value === 42
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
function ok(value) {
|
|
17
|
+
return {
|
|
18
|
+
ok: true,
|
|
19
|
+
value
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a failed Result containing the given error.
|
|
24
|
+
*
|
|
25
|
+
* @template E - The type of the error value
|
|
26
|
+
* @param error - The error to wrap in an Err
|
|
27
|
+
* @returns An Err containing the error
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const result = err('Something went wrong')
|
|
32
|
+
* // result.ok === false
|
|
33
|
+
* // result.error === 'Something went wrong'
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
function err(error) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
error
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Type guard that narrows a Result to Err.
|
|
44
|
+
*
|
|
45
|
+
* @template T - The type of the success value
|
|
46
|
+
* @template E - The type of the error value
|
|
47
|
+
* @param result - The Result to check
|
|
48
|
+
* @returns `true` if the Result is Err, enabling type narrowing
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const result: Result<number, string> = err('failed')
|
|
53
|
+
*
|
|
54
|
+
* if (isErr(result)) {
|
|
55
|
+
* // TypeScript knows result.error exists here
|
|
56
|
+
* console.error(result.error)
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
function isErr(result) {
|
|
61
|
+
return !result.ok;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { err, isErr, ok };
|
|
66
|
+
//# sourceMappingURL=dist-C4hIkHif.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-C4hIkHif.js","names":[],"sources":["../../../../node_modules/.bun/@mks2508+no-throw@0.1.0/node_modules/@mks2508/no-throw/dist/index.mjs"],"sourcesContent":["//#region src/result.ts\n/**\n* Creates a successful Result containing the given value.\n*\n* @template T - The type of the success value\n* @param value - The value to wrap in an Ok\n* @returns An Ok containing the value\n*\n* @example\n* ```typescript\n* const result = ok(42)\n* // result.ok === true\n* // result.value === 42\n* ```\n*/\nfunction ok(value) {\n\treturn {\n\t\tok: true,\n\t\tvalue\n\t};\n}\n/**\n* Creates a failed Result containing the given error.\n*\n* @template E - The type of the error value\n* @param error - The error to wrap in an Err\n* @returns An Err containing the error\n*\n* @example\n* ```typescript\n* const result = err('Something went wrong')\n* // result.ok === false\n* // result.error === 'Something went wrong'\n* ```\n*/\nfunction err(error) {\n\treturn {\n\t\tok: false,\n\t\terror\n\t};\n}\n/**\n* Type guard that narrows a Result to Ok.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @param result - The Result to check\n* @returns `true` if the Result is Ok, enabling type narrowing\n*\n* @example\n* ```typescript\n* const result: Result<number, string> = ok(42)\n*\n* if (isOk(result)) {\n* // TypeScript knows result.value exists here\n* console.log(result.value)\n* }\n* ```\n*/\nfunction isOk(result) {\n\treturn result.ok;\n}\n/**\n* Type guard that narrows a Result to Err.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @param result - The Result to check\n* @returns `true` if the Result is Err, enabling type narrowing\n*\n* @example\n* ```typescript\n* const result: Result<number, string> = err('failed')\n*\n* if (isErr(result)) {\n* // TypeScript knows result.error exists here\n* console.error(result.error)\n* }\n* ```\n*/\nfunction isErr(result) {\n\treturn !result.ok;\n}\n/**\n* Extracts the value from an Ok Result or throws an error if Err.\n*\n* **Warning**: This function throws. Prefer `unwrapOr`, `unwrapOrElse`, or `match`\n* for safer error handling.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @param result - The Result to unwrap\n* @returns The contained value if Ok\n* @throws Error with message from ResultError or stringified error if Err\n*\n* @example\n* ```typescript\n* const success = ok(42)\n* unwrap(success) // Returns 42\n*\n* const failure = err('oops')\n* unwrap(failure) // Throws Error: 'Unwrap called on Err: oops'\n* ```\n*/\nfunction unwrap(result) {\n\tif (isOk(result)) return result.value;\n\tconst errMsg = result.error instanceof Object && \"message\" in result.error ? result.error.message : String(result.error);\n\tthrow new Error(`Unwrap called on Err: ${errMsg}`);\n}\n/**\n* Extracts the value from an Ok Result or returns a default value if Err.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @param result - The Result to unwrap\n* @param defaultValue - The value to return if the Result is Err\n* @returns The contained value if Ok, otherwise the default value\n*\n* @example\n* ```typescript\n* unwrapOr(ok(42), 0) // Returns 42\n* unwrapOr(err('oops'), 0) // Returns 0\n* ```\n*/\nfunction unwrapOr(result, defaultValue) {\n\treturn isOk(result) ? result.value : defaultValue;\n}\n/**\n* Extracts the value from an Ok Result or computes a value from the error if Err.\n*\n* Unlike `unwrapOr`, the default value is lazily computed only when needed.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @param result - The Result to unwrap\n* @param fn - Function to compute the default value from the error\n* @returns The contained value if Ok, otherwise the computed value\n*\n* @example\n* ```typescript\n* unwrapOrElse(ok(42), () => 0) // Returns 42\n* unwrapOrElse(err('error'), (e) => e.length) // Returns 5\n* unwrapOrElse(err('not found'), () => fetchDefault()) // Only fetches on error\n* ```\n*/\nfunction unwrapOrElse(result, fn) {\n\treturn isOk(result) ? result.value : fn(result.error);\n}\n/**\n* Transforms the Ok value using the provided function, leaving Err unchanged.\n*\n* This is the functor map operation for Result, allowing you to transform\n* success values while automatically propagating errors.\n*\n* @template T - The type of the input success value\n* @template U - The type of the output success value\n* @template E - The type of the error value\n* @param result - The Result to transform\n* @param fn - Function to apply to the Ok value\n* @returns A new Result with the transformed value, or the original Err\n*\n* @example\n* ```typescript\n* map(ok(2), x => x * 2) // ok(4)\n* map(err('oops'), x => x * 2) // err('oops')\n*\n* // Chaining transformations\n* const result = ok('hello')\n* const upper = map(result, s => s.toUpperCase())\n* const length = map(upper, s => s.length)\n* // length = ok(5)\n* ```\n*/\nfunction map(result, fn) {\n\treturn isOk(result) ? ok(fn(result.value)) : result;\n}\n/**\n* Transforms the Err value using the provided function, leaving Ok unchanged.\n*\n* Useful for converting error types or adding context to errors.\n*\n* @template T - The type of the success value\n* @template E - The type of the input error value\n* @template F - The type of the output error value\n* @param result - The Result to transform\n* @param fn - Function to apply to the Err value\n* @returns A new Result with the transformed error, or the original Ok\n*\n* @example\n* ```typescript\n* mapErr(err('oops'), e => e.toUpperCase()) // err('OOPS')\n* mapErr(ok(42), e => e.toUpperCase()) // ok(42)\n*\n* // Converting error types\n* const result = err('not found')\n* const typed = mapErr(result, msg => ({ code: 'NOT_FOUND', message: msg }))\n* ```\n*/\nfunction mapErr(result, fn) {\n\treturn isErr(result) ? err(fn(result.error)) : result;\n}\n/**\n* Chains a function that returns a Result over the Ok value (monadic bind).\n*\n* Unlike `map`, the function returns a Result, which is then flattened.\n* This enables composing operations that may fail.\n*\n* @template T - The type of the input success value\n* @template U - The type of the output success value\n* @template E - The type of the error value\n* @param result - The Result to chain\n* @param fn - Function that takes the Ok value and returns a new Result\n* @returns The Result from fn if input is Ok, otherwise the original Err\n*\n* @example\n* ```typescript\n* const parseNumber = (s: string): Result<number, string> => {\n* const n = parseInt(s, 10)\n* return isNaN(n) ? err('not a number') : ok(n)\n* }\n*\n* const divide = (a: number, b: number): Result<number, string> =>\n* b === 0 ? err('division by zero') : ok(a / b)\n*\n* // Chain operations that may fail\n* const result = flatMap(parseNumber('10'), n => divide(n, 2))\n* // result = ok(5)\n*\n* const failed = flatMap(parseNumber('abc'), n => divide(n, 2))\n* // failed = err('not a number')\n* ```\n*/\nfunction flatMap(result, fn) {\n\treturn isOk(result) ? fn(result.value) : result;\n}\n/**\n* Executes a side effect on the Ok value without changing the Result.\n*\n* Useful for logging, debugging, or other side effects in a pipeline.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @param result - The Result to tap\n* @param fn - Side effect function to execute on Ok value\n* @returns The original Result unchanged\n*\n* @example\n* ```typescript\n* const result = ok(42)\n* const same = tap(result, v => console.log('Got:', v))\n* // Logs: 'Got: 42'\n* // same === result\n*\n* tap(err('oops'), v => console.log('Got:', v))\n* // Does not log anything\n* ```\n*/\nfunction tap(result, fn) {\n\tif (isOk(result)) fn(result.value);\n\treturn result;\n}\n/**\n* Executes a side effect on the Err value without changing the Result.\n*\n* Useful for logging errors or triggering error reporting.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @param result - The Result to tap\n* @param fn - Side effect function to execute on Err value\n* @returns The original Result unchanged\n*\n* @example\n* ```typescript\n* const result = err('oops')\n* const same = tapErr(result, e => console.error('Error:', e))\n* // Logs: 'Error: oops'\n* // same === result\n*\n* tapErr(ok(42), e => console.error('Error:', e))\n* // Does not log anything\n* ```\n*/\nfunction tapErr(result, fn) {\n\tif (isErr(result)) fn(result.error);\n\treturn result;\n}\n/**\n* Pattern matches on a Result, applying the appropriate handler function.\n*\n* Provides exhaustive handling of both Ok and Err cases, ensuring you\n* handle all possibilities.\n*\n* @template T - The type of the success value\n* @template E - The type of the error value\n* @template U - The type of the return value from both handlers\n* @param result - The Result to match on\n* @param handlers - Object containing `onOk` and `onErr` handler functions\n* @returns The return value from whichever handler was called\n*\n* @example\n* ```typescript\n* const result: Result<number, string> = ok(42)\n*\n* const message = match(result, {\n* onOk: (value) => `Success: ${value}`,\n* onErr: (error) => `Failed: ${error}`\n* })\n* // message = 'Success: 42'\n*\n* // Transforming to different types\n* const status = match(fetchResult, {\n* onOk: (data) => ({ status: 'loaded', data }),\n* onErr: (err) => ({ status: 'error', message: err.message })\n* })\n* ```\n*/\nfunction match(result, handlers) {\n\treturn isOk(result) ? handlers.onOk(result.value) : handlers.onErr(result.error);\n}\n/**\n* Collects an array of Results into a Result containing an array.\n*\n* If all Results are Ok, returns Ok with an array of all values.\n* If any Result is Err, returns the first Err encountered.\n*\n* @template T - The type of the success values\n* @template E - The type of the error value\n* @param results - Array of Results to collect\n* @returns Ok with array of values if all succeed, or first Err\n*\n* @example\n* ```typescript\n* collect([ok(1), ok(2), ok(3)])\n* // ok([1, 2, 3])\n*\n* collect([ok(1), err('first'), err('second')])\n* // err('first')\n*\n* collect([])\n* // ok([])\n*\n* // Useful for validating multiple fields\n* const validations = [\n* validateName(name),\n* validateEmail(email),\n* validateAge(age)\n* ]\n* const allValid = collect(validations)\n* ```\n*/\nfunction collect(results) {\n\tconst values = [];\n\tfor (const result of results) {\n\t\tif (isErr(result)) return result;\n\t\tvalues.push(result.value);\n\t}\n\treturn ok(values);\n}\nfunction all(...results) {\n\treturn collect(results);\n}\n\n//#endregion\n//#region src/error.ts\n/**\n* Creates a ResultError with the given code, message, and optional cause.\n*\n* @template C - The type of error code (inferred from the code parameter)\n* @param code - Unique error code identifying the type of error\n* @param message - Human-readable error message\n* @param cause - Optional original error that caused this error\n* @returns A new ResultError object\n*\n* @example\n* ```typescript\n* // Basic error\n* const error = resultError('NOT_FOUND', 'User not found')\n* // { code: 'NOT_FOUND', message: 'User not found' }\n*\n* // With cause\n* try {\n* await fetchUser(id)\n* } catch (e) {\n* const error = resultError('FETCH_FAILED', 'Could not fetch user', e as Error)\n* return err(error)\n* }\n*\n* // With typed error codes\n* const ApiError = {\n* NotFound: 'NOT_FOUND',\n* Timeout: 'TIMEOUT'\n* } as const\n*\n* const typedError = resultError(ApiError.NotFound, 'Resource not found')\n* // typedError.code is typed as 'NOT_FOUND'\n* ```\n*/\nfunction resultError(code, message, cause) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\tcause\n\t};\n}\n/**\n* Default error code for unknown or unspecified errors.\n*\n* Use this when catching exceptions that don't map to a specific error code\n* in your domain.\n*\n* @example\n* ```typescript\n* import { tryCatch, UNKNOWN_ERROR } from '@mks2508/no-throw'\n*\n* const result = tryCatch(() => {\n* throw new Error('Unexpected!')\n* })\n*\n* if (isErr(result)) {\n* console.log(result.error.code) // 'UNKNOWN'\n* }\n*\n* // Or provide a specific code\n* const result2 = tryCatch(() => {\n* throw new Error('Unexpected!')\n* }, 'PARSING_ERROR')\n*\n* if (isErr(result2)) {\n* console.log(result2.error.code) // 'PARSING_ERROR'\n* }\n* ```\n*/\nconst UNKNOWN_ERROR = \"UNKNOWN\";\n\n//#endregion\n//#region src/utils.ts\n/**\n* @fileoverview Utility functions for exception wrapping and Result creation.\n* @module @mks2508/no-throw/utils\n*/\n/**\n* Creates a failure Result with a structured ResultError.\n*\n* This is a convenience function that combines `err()` and `resultError()`\n* for creating typed error Results in a single call.\n*\n* @template C - The type of error code (inferred from the code parameter)\n* @param code - Unique error code identifying the type of error\n* @param message - Human-readable error message\n* @param cause - Optional original error that caused this error\n* @returns An Err Result containing the ResultError\n*\n* @example\n* ```typescript\n* // Basic usage\n* function findUser(id: string): Result<User, ResultError<'NOT_FOUND'>> {\n* const user = db.get(id)\n* if (!user) {\n* return fail('NOT_FOUND', `User ${id} not found`)\n* }\n* return ok(user)\n* }\n*\n* // With error chaining\n* async function fetchData(url: string): Promise<Result<Data, ResultError>> {\n* try {\n* const response = await fetch(url)\n* if (!response.ok) {\n* return fail('HTTP_ERROR', `Request failed: ${response.status}`)\n* }\n* return ok(await response.json())\n* } catch (e) {\n* return fail('NETWORK_ERROR', 'Network request failed', e as Error)\n* }\n* }\n*\n* // With typed error codes\n* const UserError = {\n* NotFound: 'USER_NOT_FOUND',\n* InvalidEmail: 'INVALID_EMAIL',\n* Suspended: 'USER_SUSPENDED'\n* } as const\n*\n* type UserError = ResultError<ErrorCode<typeof UserError>>\n*\n* function validateUser(email: string): Result<void, UserError> {\n* if (!email.includes('@')) {\n* return fail(UserError.InvalidEmail, 'Email must contain @')\n* }\n* return ok(undefined)\n* }\n* ```\n*/\nfunction fail(code, message, cause) {\n\treturn err(resultError(code, message, cause));\n}\n/**\n* Converts a Promise that may reject into a Promise that resolves to a Result.\n*\n* This is useful for integrating with APIs that use exceptions for error handling,\n* wrapping them in the Result pattern.\n*\n* @template T - The type of the resolved value\n* @template C - The type of error code (defaults to 'UNKNOWN')\n* @param promise - The Promise to wrap\n* @param errorCode - Optional error code to use instead of UNKNOWN_ERROR\n* @returns A Promise that always resolves to a Result\n*\n* @example\n* ```typescript\n* // Basic usage with fetch\n* const result = await fromPromise(fetch('/api/users'))\n* if (isOk(result)) {\n* const response = result.value\n* }\n*\n* // With custom error code\n* const result = await fromPromise(\n* fetch('/api/users'),\n* 'NETWORK_ERROR'\n* )\n*\n* // Chaining with other Result operations\n* const users = await fromPromise(fetch('/api/users'))\n* .then(r => flatMap(r, async response => {\n* if (!response.ok) return fail('HTTP_ERROR', `Status: ${response.status}`)\n* return fromPromise(response.json(), 'PARSE_ERROR')\n* }))\n*\n* // Comparing approaches\n* // Before (exceptions)\n* try {\n* const response = await fetch('/api/users')\n* const data = await response.json()\n* return data\n* } catch (e) {\n* console.error(e)\n* return null\n* }\n*\n* // After (Result)\n* const result = await fromPromise(fetch('/api/users'), 'FETCH_ERROR')\n* if (isErr(result)) {\n* console.error(result.error.message)\n* return null\n* }\n* const data = await fromPromise(result.value.json(), 'PARSE_ERROR')\n* ```\n*/\nasync function fromPromise(promise, errorCode) {\n\ttry {\n\t\treturn ok(await promise);\n\t} catch (error) {\n\t\tconst cause = error instanceof Error ? error : new Error(String(error));\n\t\treturn err(resultError(errorCode ?? UNKNOWN_ERROR, cause.message, cause));\n\t}\n}\n/**\n* Wraps a synchronous function that may throw into a function returning Result.\n*\n* Use this to safely call code that might throw exceptions, converting them\n* into Results instead.\n*\n* @template T - The return type of the function\n* @template C - The type of error code (defaults to 'UNKNOWN')\n* @param fn - The function to wrap\n* @param errorCode - Optional error code to use instead of UNKNOWN_ERROR\n* @returns A Result containing either the return value or a ResultError\n*\n* @example\n* ```typescript\n* // Wrapping JSON.parse\n* const result = tryCatch(() => JSON.parse(jsonString))\n* if (isOk(result)) {\n* console.log(result.value)\n* } else {\n* console.error('Invalid JSON:', result.error.message)\n* }\n*\n* // With custom error code\n* const result = tryCatch(\n* () => JSON.parse(jsonString),\n* 'JSON_PARSE_ERROR'\n* )\n*\n* // Wrapping any throwing function\n* const result = tryCatch(() => {\n* const value = riskyOperation()\n* return transform(value)\n* }, 'OPERATION_FAILED')\n*\n* // Practical example: safe regex\n* function safeRegex(pattern: string): Result<RegExp, ResultError<'INVALID_REGEX'>> {\n* return tryCatch(() => new RegExp(pattern), 'INVALID_REGEX')\n* }\n*\n* const regex = safeRegex('[invalid')\n* // regex = err({ code: 'INVALID_REGEX', message: '...', cause: SyntaxError })\n* ```\n*/\nfunction tryCatch(fn, errorCode) {\n\ttry {\n\t\treturn ok(fn());\n\t} catch (error) {\n\t\tconst cause = error instanceof Error ? error : new Error(String(error));\n\t\treturn err(resultError(errorCode ?? UNKNOWN_ERROR, cause.message, cause));\n\t}\n}\n/**\n* Wraps an async function that may throw into a function returning Promise<Result>.\n*\n* Similar to `tryCatch` but for async functions. The function is immediately\n* invoked and its result is wrapped.\n*\n* @template T - The resolved type of the async function\n* @template C - The type of error code (defaults to 'UNKNOWN')\n* @param fn - The async function to wrap\n* @param errorCode - Optional error code to use instead of UNKNOWN_ERROR\n* @returns A Promise that resolves to a Result\n*\n* @example\n* ```typescript\n* // Basic usage\n* const result = await tryCatchAsync(async () => {\n* const response = await fetch('/api/data')\n* return response.json()\n* })\n*\n* // With custom error code\n* const result = await tryCatchAsync(\n* async () => {\n* const data = await fetchData()\n* return processData(data)\n* },\n* 'DATA_PROCESSING_ERROR'\n* )\n*\n* // Combining multiple async operations\n* const result = await tryCatchAsync(async () => {\n* const user = await db.users.findOne(id)\n* if (!user) throw new Error('User not found')\n*\n* const posts = await db.posts.find({ userId: user.id })\n* return { user, posts }\n* }, 'FETCH_USER_DATA')\n*\n* // Difference from fromPromise:\n* // - fromPromise: wraps an existing Promise\n* // - tryCatchAsync: creates and wraps a new Promise from an async function\n*\n* // Use fromPromise when you have a Promise:\n* const p = someAsyncOperation()\n* const r1 = await fromPromise(p, 'ERROR')\n*\n* // Use tryCatchAsync when you want to define the async logic:\n* const r2 = await tryCatchAsync(async () => {\n* // your async logic here\n* }, 'ERROR')\n* ```\n*/\nasync function tryCatchAsync(fn, errorCode) {\n\ttry {\n\t\treturn ok(await fn());\n\t} catch (error) {\n\t\tconst cause = error instanceof Error ? error : new Error(String(error));\n\t\treturn err(resultError(errorCode ?? UNKNOWN_ERROR, cause.message, cause));\n\t}\n}\n\n//#endregion\nexport { UNKNOWN_ERROR, all, collect, err, fail, flatMap, fromPromise, isErr, isOk, map, mapErr, match, ok, resultError, tap, tapErr, tryCatch, tryCatchAsync, unwrap, unwrapOr, unwrapOrElse };\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,GAAG,OAAO;AAClB,QAAO;EACN,IAAI;EACJ;CACA;AACD;;;;;;;;;;;;;;;AAeD,SAAS,IAAI,OAAO;AACnB,QAAO;EACN,IAAI;EACJ;CACA;AACD;;;;;;;;;;;;;;;;;;;AAwCD,SAAS,MAAM,QAAQ;AACtB,SAAQ,OAAO;AACf"}
|