@engini/sdk 0.12.0 → 0.12.1
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/errors.d.ts +10 -0
- package/dist/errors.js +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/resources/toolsets.js +3 -3
- package/package.json +1 -1
package/dist/errors.d.ts
CHANGED
|
@@ -38,6 +38,16 @@ export declare class EnginiConnectionError extends EnginiError {
|
|
|
38
38
|
/** Unknown toolset id, or an ambiguous connection name during resolution or save. */
|
|
39
39
|
export declare class EnginiToolsetError extends EnginiError {
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Specifically an unknown toolset id (a 404 remapped for a friendlier message
|
|
43
|
+
* by `ToolsetsResource.get`/`update`) — narrower than the sibling "ambiguous
|
|
44
|
+
* connection name" case, which stays a plain `EnginiToolsetError` since it
|
|
45
|
+
* isn't a not-found. `instanceof EnginiToolsetError` still matches this
|
|
46
|
+
* subclass, so existing catchers of the wider type are unaffected; the CLI's
|
|
47
|
+
* exit-code mapping (`exitForError`) special-cases this one to `NOT_FOUND`.
|
|
48
|
+
*/
|
|
49
|
+
export declare class EnginiToolsetNotFoundError extends EnginiToolsetError {
|
|
50
|
+
}
|
|
41
51
|
/** A polled asynchronous job (e.g. a connection refresh) did not finish in time. */
|
|
42
52
|
export declare class EnginiTimeoutError extends EnginiError {
|
|
43
53
|
}
|
package/dist/errors.js
CHANGED
|
@@ -41,6 +41,16 @@ export class EnginiConnectionError extends EnginiError {
|
|
|
41
41
|
/** Unknown toolset id, or an ambiguous connection name during resolution or save. */
|
|
42
42
|
export class EnginiToolsetError extends EnginiError {
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Specifically an unknown toolset id (a 404 remapped for a friendlier message
|
|
46
|
+
* by `ToolsetsResource.get`/`update`) — narrower than the sibling "ambiguous
|
|
47
|
+
* connection name" case, which stays a plain `EnginiToolsetError` since it
|
|
48
|
+
* isn't a not-found. `instanceof EnginiToolsetError` still matches this
|
|
49
|
+
* subclass, so existing catchers of the wider type are unaffected; the CLI's
|
|
50
|
+
* exit-code mapping (`exitForError`) special-cases this one to `NOT_FOUND`.
|
|
51
|
+
*/
|
|
52
|
+
export class EnginiToolsetNotFoundError extends EnginiToolsetError {
|
|
53
|
+
}
|
|
44
54
|
/** A polled asynchronous job (e.g. a connection refresh) did not finish in time. */
|
|
45
55
|
export class EnginiTimeoutError extends EnginiError {
|
|
46
56
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { EnginiOptions } from "./client.js";
|
|
|
3
3
|
export { ApiKeyAuth, BearerAuth, ENV_API_KEY_VAR, ENV_TOKEN_VAR, ENV_COMPANY_TOKEN_VAR, } from "./auth.js";
|
|
4
4
|
export type { Auth } from "./auth.js";
|
|
5
5
|
export type { Verify } from "./http.js";
|
|
6
|
-
export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiTimeoutError, EnginiToolExecutionError, } from "./errors.js";
|
|
6
|
+
export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiToolsetNotFoundError, EnginiTimeoutError, EnginiToolExecutionError, } from "./errors.js";
|
|
7
7
|
export { ToolsResource, ConnectionsResource, ToolsetsResource, ApplicationsResource, refreshFailed, } from "./resources/index.js";
|
|
8
8
|
export type { ToolsGetOptions, ToolsExecuteOptions, ApplicationsListOptions } from "./resources/index.js";
|
|
9
9
|
export { Toolset } from "./toolset.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Engini, DEFAULT_BASE_URL } from "./client.js";
|
|
2
2
|
export { ApiKeyAuth, BearerAuth, ENV_API_KEY_VAR, ENV_TOKEN_VAR, ENV_COMPANY_TOKEN_VAR, } from "./auth.js";
|
|
3
|
-
export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiTimeoutError, EnginiToolExecutionError, } from "./errors.js";
|
|
3
|
+
export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiToolsetNotFoundError, EnginiTimeoutError, EnginiToolExecutionError, } from "./errors.js";
|
|
4
4
|
export { ToolsResource, ConnectionsResource, ToolsetsResource, ApplicationsResource, refreshFailed, } from "./resources/index.js";
|
|
5
5
|
export { Toolset } from "./toolset.js";
|
|
6
6
|
export { File } from "./files.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { toolsetsListToolsets, toolsetsGetToolset, toolsetsDeleteToolset, toolsetsCreateToolset, toolsetsUpdateToolset, } from "@engini/client";
|
|
3
3
|
import { call } from "../http.js";
|
|
4
4
|
import { paginate, collect } from "../pagination.js";
|
|
5
|
-
import { EnginiNotFoundError,
|
|
5
|
+
import { EnginiNotFoundError, EnginiToolsetNotFoundError } from "../errors.js";
|
|
6
6
|
export class ToolsetsResource {
|
|
7
7
|
client;
|
|
8
8
|
constructor(client) {
|
|
@@ -21,7 +21,7 @@ export class ToolsetsResource {
|
|
|
21
21
|
}
|
|
22
22
|
catch (err) {
|
|
23
23
|
if (err instanceof EnginiNotFoundError) {
|
|
24
|
-
throw new
|
|
24
|
+
throw new EnginiToolsetNotFoundError(`Unknown toolset id '${toolsetId}'.`);
|
|
25
25
|
}
|
|
26
26
|
throw err;
|
|
27
27
|
}
|
|
@@ -54,7 +54,7 @@ export class ToolsetsResource {
|
|
|
54
54
|
}
|
|
55
55
|
catch (err) {
|
|
56
56
|
if (err instanceof EnginiNotFoundError) {
|
|
57
|
-
throw new
|
|
57
|
+
throw new EnginiToolsetNotFoundError(`Unknown toolset id '${toolsetId}'.`);
|
|
58
58
|
}
|
|
59
59
|
throw err;
|
|
60
60
|
}
|