@cat-factory/sdk 0.5.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/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/client.d.ts +26 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +37 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +127 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +143 -0
- package/dist/errors.js.map +1 -0
- package/dist/http.d.ts +70 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +214 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/models.generated.d.ts +795 -0
- package/dist/models.generated.d.ts.map +1 -0
- package/dist/models.generated.js +79 -0
- package/dist/models.generated.js.map +1 -0
- package/dist/operations.generated.d.ts +399 -0
- package/dist/operations.generated.d.ts.map +1 -0
- package/dist/operations.generated.js +698 -0
- package/dist/operations.generated.js.map +1 -0
- package/dist/sse.d.ts +24 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +124 -0
- package/dist/sse.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Igor Savin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# `@cat-factory/sdk`
|
|
2
|
+
|
|
3
|
+
TypeScript / JavaScript client for the cat-factory **public API** (`/api/v1`).
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install @cat-factory/sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Node 20+. No dependencies: the transport is `fetch`.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { CatFactoryClient, CatFactoryNotFoundError } from '@cat-factory/sdk'
|
|
13
|
+
|
|
14
|
+
const client = new CatFactoryClient({
|
|
15
|
+
baseUrl: 'https://cat-factory.example.com',
|
|
16
|
+
apiKey: process.env.CAT_FACTORY_API_KEY!,
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const { services } = await client.services.list()
|
|
20
|
+
const task = await client.tasks.create(services[0].serviceId, {
|
|
21
|
+
title: 'Add a health check endpoint',
|
|
22
|
+
taskType: 'feature',
|
|
23
|
+
})
|
|
24
|
+
await client.tasks.start(task.taskId, {})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Resource clients
|
|
28
|
+
|
|
29
|
+
`jobs`, `services`, `tasks`, `pipelines`, `notifications`, `usage`, `decisions`, `debug`:
|
|
30
|
+
one per tag of the published OpenAPI surface. Every call is scoped to the key's workspace.
|
|
31
|
+
|
|
32
|
+
## Watching a run
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const stream = await client.tasks.stream(task.taskId)
|
|
36
|
+
try {
|
|
37
|
+
for await (const event of stream) {
|
|
38
|
+
if (event.event === 'decision') {
|
|
39
|
+
// The run PARKED on a human decision and waits indefinitely. Answer it through
|
|
40
|
+
// `client.decisions` (needs a `decide`-scope key) or free it with `tasks.stop`.
|
|
41
|
+
const { decisions } = await client.decisions.list(runId)
|
|
42
|
+
}
|
|
43
|
+
if (event.event === 'done' || event.event === 'error') break
|
|
44
|
+
// `timeout` means the deployment's connection cap was reached, NOT that the run finished.
|
|
45
|
+
}
|
|
46
|
+
} finally {
|
|
47
|
+
await stream.close()
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Paging
|
|
52
|
+
|
|
53
|
+
Every bounded list has an auto-paging companion that follows `nextCursor` for you:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
for await (const task of client.tasks.listByServiceAll(serviceId)) {
|
|
57
|
+
console.log(task.taskId)
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Errors
|
|
62
|
+
|
|
63
|
+
The exception CLASS comes from the HTTP status; `code` carries the specific cause and is a plain
|
|
64
|
+
string, because this surface adds new codes without a major version.
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
try {
|
|
68
|
+
await client.tasks.get(taskId)
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (error instanceof CatFactoryNotFoundError) return null
|
|
71
|
+
if (error instanceof CatFactoryForbiddenError && error.code === 'insufficient_scope') {
|
|
72
|
+
throw new Error('this key needs a higher scope')
|
|
73
|
+
}
|
|
74
|
+
throw error
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Classes: `CatFactoryValidationError` (400/422), `…Unauthorized` (401), `…Forbidden` (403),
|
|
79
|
+
`…NotFound` (404), `…Conflict` (409), `…CredentialRequired` (428), `…RateLimited` (429),
|
|
80
|
+
`…ServerError` (5xx), plus `…ConnectionError`, `…TimeoutError` and `…DecodeError`. All extend
|
|
81
|
+
`CatFactoryError`. Every API error carries `status`, `code`, `details`, `issues` and the
|
|
82
|
+
`requestId` to quote when reporting a fault.
|
|
83
|
+
|
|
84
|
+
## Options
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
new CatFactoryClient({
|
|
88
|
+
baseUrl,
|
|
89
|
+
apiKey,
|
|
90
|
+
timeoutMs: 30_000, // 0 disables
|
|
91
|
+
maxRetries: 2, // idempotent requests only - a POST is never auto-retried
|
|
92
|
+
headers: {},
|
|
93
|
+
userAgent: 'my-integration/1.2.3',
|
|
94
|
+
fetch: myFetch, // a proxy agent, or a test double
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Local development and mocks
|
|
99
|
+
|
|
100
|
+
The base URL takes any origin (`http://localhost:8787`, a fixture server, a mock) and no scheme
|
|
101
|
+
validation is applied. Each client also accepts a custom transport, so you can intercept in-process
|
|
102
|
+
instead. See [the SDK guide](../README.md#pointing-an-sdk-at-localhost-or-a-mock).
|
|
103
|
+
|
|
104
|
+
## Notes
|
|
105
|
+
|
|
106
|
+
- `src/*.generated.ts` are generated from `docs/openapi.json`; see [`../README.md`](../README.md).
|
|
107
|
+
- The sources are **erasable-only** TypeScript (no enums, namespaces or parameter properties), so
|
|
108
|
+
they run under Node's type stripping and `erasableSyntaxOnly` builds.
|
|
109
|
+
- API reference: [`backend/docs/public-api.md`](../../backend/docs/public-api.md).
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ClientOptions } from './http.ts';
|
|
2
|
+
import { CatFactoryResources } from './operations.generated.ts';
|
|
3
|
+
/**
|
|
4
|
+
* A cat-factory public-API client.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const client = new CatFactoryClient({
|
|
8
|
+
* baseUrl: 'https://cat-factory.example.com',
|
|
9
|
+
* apiKey: process.env.CAT_FACTORY_API_KEY!,
|
|
10
|
+
* })
|
|
11
|
+
* const { services } = await client.services.list()
|
|
12
|
+
* const task = await client.tasks.create(services[0].serviceId, { title: 'Add a health check' })
|
|
13
|
+
* await client.tasks.start(task.taskId, {})
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Every call is scoped to the key's workspace, and each resource client mirrors one tag of the
|
|
17
|
+
* published OpenAPI surface: `jobs`, `services`, `tasks`, `pipelines`, `notifications`,
|
|
18
|
+
* `usage`, `decisions`, `debug`.
|
|
19
|
+
*
|
|
20
|
+
* The client is stateless beyond its configuration, so one instance is safe to share across
|
|
21
|
+
* concurrent work.
|
|
22
|
+
*/
|
|
23
|
+
export declare class CatFactoryClient extends CatFactoryResources {
|
|
24
|
+
constructor(options: ClientOptions);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AASH,qBAAa,gBAAiB,SAAQ,mBAAmB;IACvD,YAAY,OAAO,EAAE,aAAa,EAEjC;CACF"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// The client a caller constructs: a transport plus the generated resource clients mounted on it.
|
|
2
|
+
import { Transport } from './http.js';
|
|
3
|
+
import { CatFactoryResources } from './operations.generated.js';
|
|
4
|
+
/**
|
|
5
|
+
* A cat-factory public-API client.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const client = new CatFactoryClient({
|
|
9
|
+
* baseUrl: 'https://cat-factory.example.com',
|
|
10
|
+
* apiKey: process.env.CAT_FACTORY_API_KEY!,
|
|
11
|
+
* })
|
|
12
|
+
* const { services } = await client.services.list()
|
|
13
|
+
* const task = await client.tasks.create(services[0].serviceId, { title: 'Add a health check' })
|
|
14
|
+
* await client.tasks.start(task.taskId, {})
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Every call is scoped to the key's workspace, and each resource client mirrors one tag of the
|
|
18
|
+
* published OpenAPI surface: `jobs`, `services`, `tasks`, `pipelines`, `notifications`,
|
|
19
|
+
* `usage`, `decisions`, `debug`.
|
|
20
|
+
*
|
|
21
|
+
* The client is stateless beyond its configuration, so one instance is safe to share across
|
|
22
|
+
* concurrent work.
|
|
23
|
+
*/
|
|
24
|
+
// The resource properties are INHERITED from the generated `CatFactoryResources` rather than
|
|
25
|
+
// re-declared here. Listing them by hand would be a second copy of the surface table that nothing
|
|
26
|
+
// keeps in sync — a resource group added to `scripts/sdk/surface.mjs` would generate, compile, and
|
|
27
|
+
// simply not be reachable from the client anyone actually constructs.
|
|
28
|
+
//
|
|
29
|
+
// A base class rather than a declaration-merged `interface CatFactoryClient extends Resources {}`:
|
|
30
|
+
// the merge reads more cleanly, but TypeScript cannot see that such properties are ever
|
|
31
|
+
// initialised, so it silently gives up checking them (`no-unsafe-declaration-merging`).
|
|
32
|
+
export class CatFactoryClient extends CatFactoryResources {
|
|
33
|
+
constructor(options) {
|
|
34
|
+
super(new Transport(options));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAEjG,OAAO,EAAsB,SAAS,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,6FAA6F;AAC7F,kGAAkG;AAClG,mGAAmG;AACnG,sEAAsE;AACtE,EAAE;AACF,mGAAmG;AACnG,wFAAwF;AACxF,wFAAwF;AACxF,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IACvD,YAAY,OAAsB;QAChC,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/B,CAAC;CACF"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/** The wire error envelope every `/api/v1` failure carries. */
|
|
2
|
+
export interface ApiErrorBody {
|
|
3
|
+
error: {
|
|
4
|
+
/**
|
|
5
|
+
* Machine-readable. Either a status-class code (`validation`, `not_found`, `conflict`,
|
|
6
|
+
* `unauthorized`, `forbidden`, `credential_required`, `rate_limited`, `unavailable`,
|
|
7
|
+
* `internal`) or one specific to this surface (`insufficient_scope`, `invalid_cursor`,
|
|
8
|
+
* `pipeline_not_public`, …). Branch on this, never on `message`.
|
|
9
|
+
*/
|
|
10
|
+
code: string;
|
|
11
|
+
/** Operator prose. Not localized, and not a stable identifier — do not branch on it. */
|
|
12
|
+
message: string;
|
|
13
|
+
/** Cause detail, shape depending on `code`. */
|
|
14
|
+
details?: unknown;
|
|
15
|
+
/** Per-field validation failures, on a 400 whose body or query did not parse. */
|
|
16
|
+
issues?: {
|
|
17
|
+
path?: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Base class for everything this SDK throws, so one `catch` can bound the whole client. */
|
|
23
|
+
export declare class CatFactoryError extends Error {
|
|
24
|
+
constructor(message: string, options?: {
|
|
25
|
+
cause?: unknown;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** The request never produced an HTTP response: DNS, TCP, TLS, or an aborted socket. */
|
|
29
|
+
export declare class CatFactoryConnectionError extends CatFactoryError {
|
|
30
|
+
}
|
|
31
|
+
/** The request exceeded the client-side deadline (`timeoutMs`), so no verdict was reached. */
|
|
32
|
+
export declare class CatFactoryTimeoutError extends CatFactoryError {
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* An auto-pager was answered with the SAME `nextCursor` it had just sent.
|
|
36
|
+
*
|
|
37
|
+
* That is a server fault, and the pagers stop rather than follow it — the walk would otherwise
|
|
38
|
+
* never terminate, re-fetching one page forever against the caller's rate limit. It throws rather
|
|
39
|
+
* than returning quietly because a silent stop is indistinguishable from a completed walk, and a
|
|
40
|
+
* caller acting on "these are all the tasks" when they have seen one page is the worse failure.
|
|
41
|
+
*/
|
|
42
|
+
export declare class CatFactoryPaginationError extends CatFactoryError {
|
|
43
|
+
}
|
|
44
|
+
/** Build the pagination fault above. Called from the generated pagers. */
|
|
45
|
+
export declare function repeatedCursorError(): CatFactoryPaginationError;
|
|
46
|
+
/**
|
|
47
|
+
* A 2xx response whose body was not the JSON the contract promises — in practice a proxy or
|
|
48
|
+
* gateway answering in the deployment's place. Carries the raw text, because "invalid JSON" on
|
|
49
|
+
* its own does not tell you that something in front of the backend returned an HTML error page.
|
|
50
|
+
*/
|
|
51
|
+
export declare class CatFactoryDecodeError extends CatFactoryError {
|
|
52
|
+
readonly rawBody: string;
|
|
53
|
+
constructor(message: string, rawBody: string, options?: {
|
|
54
|
+
cause?: unknown;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The server answered, and the answer was a refusal. Subclasses below name the status CLASS;
|
|
59
|
+
* `code` names the specific cause.
|
|
60
|
+
*/
|
|
61
|
+
export declare class CatFactoryApiError extends CatFactoryError {
|
|
62
|
+
/** The HTTP status. */
|
|
63
|
+
readonly status: number;
|
|
64
|
+
/** The machine-readable `error.code` — see the note at the top of this file. */
|
|
65
|
+
readonly code: string;
|
|
66
|
+
/** `error.details`, whose shape depends on `code`. */
|
|
67
|
+
readonly details: unknown;
|
|
68
|
+
/** Per-field validation failures, when the server reported any. */
|
|
69
|
+
readonly issues: {
|
|
70
|
+
path?: string;
|
|
71
|
+
message: string;
|
|
72
|
+
}[];
|
|
73
|
+
/**
|
|
74
|
+
* The `X-Request-Id` of the failing call. Every response carries one (the backend mints or
|
|
75
|
+
* adopts it in `mountRequestLogging`), and it is the id to quote when reporting a fault —
|
|
76
|
+
* it is what correlates this call with the deployment's own logs.
|
|
77
|
+
*/
|
|
78
|
+
readonly requestId: string | null;
|
|
79
|
+
/** The raw body, for a failure whose `details` this SDK does not model. */
|
|
80
|
+
readonly body: unknown;
|
|
81
|
+
constructor(args: {
|
|
82
|
+
status: number;
|
|
83
|
+
code: string;
|
|
84
|
+
message: string;
|
|
85
|
+
details?: unknown;
|
|
86
|
+
issues?: {
|
|
87
|
+
path?: string;
|
|
88
|
+
message: string;
|
|
89
|
+
}[];
|
|
90
|
+
requestId: string | null;
|
|
91
|
+
body: unknown;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/** 400 / 422 — the request was malformed, or a domain rule refused it. */
|
|
95
|
+
export declare class CatFactoryValidationError extends CatFactoryApiError {
|
|
96
|
+
}
|
|
97
|
+
/** 401 — no key, or a key that has been revoked. */
|
|
98
|
+
export declare class CatFactoryUnauthorizedError extends CatFactoryApiError {
|
|
99
|
+
}
|
|
100
|
+
/** 403 — a valid key whose scope is too low (`insufficient_scope`), or a forbidden action. */
|
|
101
|
+
export declare class CatFactoryForbiddenError extends CatFactoryApiError {
|
|
102
|
+
}
|
|
103
|
+
/** 404 — no such resource, or one outside this key's workspace (the two are indistinguishable). */
|
|
104
|
+
export declare class CatFactoryNotFoundError extends CatFactoryApiError {
|
|
105
|
+
}
|
|
106
|
+
/** 409 — the resource is not in a state that admits this action. */
|
|
107
|
+
export declare class CatFactoryConflictError extends CatFactoryApiError {
|
|
108
|
+
}
|
|
109
|
+
/** 428 — a credential the action needs has not been supplied. */
|
|
110
|
+
export declare class CatFactoryCredentialRequiredError extends CatFactoryApiError {
|
|
111
|
+
}
|
|
112
|
+
/** 429 — rate limited, or a counted cap is already full (`too_many_active_runs`). */
|
|
113
|
+
export declare class CatFactoryRateLimitedError extends CatFactoryApiError {
|
|
114
|
+
}
|
|
115
|
+
/** 5xx — the deployment faulted or a dependency it needs is unavailable. */
|
|
116
|
+
export declare class CatFactoryServerError extends CatFactoryApiError {
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Build the typed error for a failed response.
|
|
120
|
+
*
|
|
121
|
+
* A body that is not the documented envelope (a proxy's HTML error page, a truncated stream)
|
|
122
|
+
* still yields a usable error: the status is always known, and the unparsed body is retained on
|
|
123
|
+
* `body` rather than discarded, so a caller diagnosing an unexpected failure is not left with
|
|
124
|
+
* "something went wrong".
|
|
125
|
+
*/
|
|
126
|
+
export declare function toApiError(status: number, body: unknown, requestId: string | null): CatFactoryApiError;
|
|
127
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAgBA,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QACL;;;;;WAKG;QACH,IAAI,EAAE,MAAM,CAAA;QACZ,wFAAwF;QACxF,OAAO,EAAE,MAAM,CAAA;QACf,+CAA+C;QAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,iFAAiF;QACjF,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAC9C,CAAA;CACF;AAED,4FAA4F;AAC5F,qBAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGzD;CACF;AAED,wFAAwF;AACxF,qBAAa,yBAA0B,SAAQ,eAAe;CAAG;AAEjE,8FAA8F;AAC9F,qBAAa,sBAAuB,SAAQ,eAAe;CAAG;AAE9D;;;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;AACpD,qBAAa,2BAA4B,SAAQ,kBAAkB;CAAG;AACtE,8FAA8F;AAC9F,qBAAa,wBAAyB,SAAQ,kBAAkB;CAAG;AACnE,mGAAmG;AACnG,qBAAa,uBAAwB,SAAQ,kBAAkB;CAAG;AAClE,oEAAoE;AACpE,qBAAa,uBAAwB,SAAQ,kBAAkB;CAAG;AAClE,iEAAiE;AACjE,qBAAa,iCAAkC,SAAQ,kBAAkB;CAAG;AAC5E,qFAAqF;AACrF,qBAAa,0BAA2B,SAAQ,kBAAkB;CAAG;AACrE,4EAA4E;AAC5E,qBAAa,qBAAsB,SAAQ,kBAAkB;CAAG;AAahE;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,kBAAkB,CAepB"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// The SDK's error hierarchy.
|
|
2
|
+
//
|
|
3
|
+
// Every failure the API reports arrives as one envelope — `{ error: { code, message, details?,
|
|
4
|
+
// issues? } }` — and the SDK turns it into a typed exception. Which class you get is decided by
|
|
5
|
+
// the HTTP STATUS, never by `code`.
|
|
6
|
+
//
|
|
7
|
+
// That split is deliberate. `/api/v1` puts two families of value in `error.code`: the status-class
|
|
8
|
+
// codes (`validation`, `not_found`, `conflict`, …) and codes specific to this surface
|
|
9
|
+
// (`insufficient_scope`, `invalid_cursor`, `pipeline_not_public`, `too_many_active_runs`, …), and
|
|
10
|
+
// the surface is additive forever — new codes appear without a major version. So the status is the
|
|
11
|
+
// part that is safe to branch a CLASS on, and `code` is exposed verbatim as a plain string for the
|
|
12
|
+
// caller to branch on precisely. Narrowing `code` to a closed union in the SDK would mean an
|
|
13
|
+
// SDK release is required before a caller can even NAME a refusal the server already sends, and
|
|
14
|
+
// a copy of the vocabulary here would be a second place for it to go stale. The authoritative
|
|
15
|
+
// list is `backend/docs/public-api.md`.
|
|
16
|
+
/** Base class for everything this SDK throws, so one `catch` can bound the whole client. */
|
|
17
|
+
export class CatFactoryError extends Error {
|
|
18
|
+
constructor(message, options) {
|
|
19
|
+
super(message, options);
|
|
20
|
+
this.name = new.target.name;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** The request never produced an HTTP response: DNS, TCP, TLS, or an aborted socket. */
|
|
24
|
+
export class CatFactoryConnectionError extends CatFactoryError {
|
|
25
|
+
}
|
|
26
|
+
/** The request exceeded the client-side deadline (`timeoutMs`), so no verdict was reached. */
|
|
27
|
+
export class CatFactoryTimeoutError extends CatFactoryError {
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An auto-pager was answered with the SAME `nextCursor` it had just sent.
|
|
31
|
+
*
|
|
32
|
+
* That is a server fault, and the pagers stop rather than follow it — the walk would otherwise
|
|
33
|
+
* never terminate, re-fetching one page forever against the caller's rate limit. It throws rather
|
|
34
|
+
* than returning quietly because a silent stop is indistinguishable from a completed walk, and a
|
|
35
|
+
* caller acting on "these are all the tasks" when they have seen one page is the worse failure.
|
|
36
|
+
*/
|
|
37
|
+
export class CatFactoryPaginationError extends CatFactoryError {
|
|
38
|
+
}
|
|
39
|
+
/** Build the pagination fault above. Called from the generated pagers. */
|
|
40
|
+
export function repeatedCursorError() {
|
|
41
|
+
return new CatFactoryPaginationError('cat-factory SDK: the server repeated a pagination cursor; stopping rather than looping forever.');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A 2xx response whose body was not the JSON the contract promises — in practice a proxy or
|
|
45
|
+
* gateway answering in the deployment's place. Carries the raw text, because "invalid JSON" on
|
|
46
|
+
* its own does not tell you that something in front of the backend returned an HTML error page.
|
|
47
|
+
*/
|
|
48
|
+
export class CatFactoryDecodeError extends CatFactoryError {
|
|
49
|
+
rawBody;
|
|
50
|
+
constructor(message, rawBody, options) {
|
|
51
|
+
super(message, options);
|
|
52
|
+
this.rawBody = rawBody;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The server answered, and the answer was a refusal. Subclasses below name the status CLASS;
|
|
57
|
+
* `code` names the specific cause.
|
|
58
|
+
*/
|
|
59
|
+
export class CatFactoryApiError extends CatFactoryError {
|
|
60
|
+
/** The HTTP status. */
|
|
61
|
+
status;
|
|
62
|
+
/** The machine-readable `error.code` — see the note at the top of this file. */
|
|
63
|
+
code;
|
|
64
|
+
/** `error.details`, whose shape depends on `code`. */
|
|
65
|
+
details;
|
|
66
|
+
/** Per-field validation failures, when the server reported any. */
|
|
67
|
+
issues;
|
|
68
|
+
/**
|
|
69
|
+
* The `X-Request-Id` of the failing call. Every response carries one (the backend mints or
|
|
70
|
+
* adopts it in `mountRequestLogging`), and it is the id to quote when reporting a fault —
|
|
71
|
+
* it is what correlates this call with the deployment's own logs.
|
|
72
|
+
*/
|
|
73
|
+
requestId;
|
|
74
|
+
/** The raw body, for a failure whose `details` this SDK does not model. */
|
|
75
|
+
body;
|
|
76
|
+
constructor(args) {
|
|
77
|
+
super(`${args.status} ${args.code}: ${args.message}`);
|
|
78
|
+
this.status = args.status;
|
|
79
|
+
this.code = args.code;
|
|
80
|
+
this.details = args.details;
|
|
81
|
+
this.issues = args.issues ?? [];
|
|
82
|
+
this.requestId = args.requestId;
|
|
83
|
+
this.body = args.body;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** 400 / 422 — the request was malformed, or a domain rule refused it. */
|
|
87
|
+
export class CatFactoryValidationError extends CatFactoryApiError {
|
|
88
|
+
}
|
|
89
|
+
/** 401 — no key, or a key that has been revoked. */
|
|
90
|
+
export class CatFactoryUnauthorizedError extends CatFactoryApiError {
|
|
91
|
+
}
|
|
92
|
+
/** 403 — a valid key whose scope is too low (`insufficient_scope`), or a forbidden action. */
|
|
93
|
+
export class CatFactoryForbiddenError extends CatFactoryApiError {
|
|
94
|
+
}
|
|
95
|
+
/** 404 — no such resource, or one outside this key's workspace (the two are indistinguishable). */
|
|
96
|
+
export class CatFactoryNotFoundError extends CatFactoryApiError {
|
|
97
|
+
}
|
|
98
|
+
/** 409 — the resource is not in a state that admits this action. */
|
|
99
|
+
export class CatFactoryConflictError extends CatFactoryApiError {
|
|
100
|
+
}
|
|
101
|
+
/** 428 — a credential the action needs has not been supplied. */
|
|
102
|
+
export class CatFactoryCredentialRequiredError extends CatFactoryApiError {
|
|
103
|
+
}
|
|
104
|
+
/** 429 — rate limited, or a counted cap is already full (`too_many_active_runs`). */
|
|
105
|
+
export class CatFactoryRateLimitedError extends CatFactoryApiError {
|
|
106
|
+
}
|
|
107
|
+
/** 5xx — the deployment faulted or a dependency it needs is unavailable. */
|
|
108
|
+
export class CatFactoryServerError extends CatFactoryApiError {
|
|
109
|
+
}
|
|
110
|
+
const BY_STATUS = {
|
|
111
|
+
400: CatFactoryValidationError,
|
|
112
|
+
401: CatFactoryUnauthorizedError,
|
|
113
|
+
403: CatFactoryForbiddenError,
|
|
114
|
+
404: CatFactoryNotFoundError,
|
|
115
|
+
409: CatFactoryConflictError,
|
|
116
|
+
422: CatFactoryValidationError,
|
|
117
|
+
428: CatFactoryCredentialRequiredError,
|
|
118
|
+
429: CatFactoryRateLimitedError,
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Build the typed error for a failed response.
|
|
122
|
+
*
|
|
123
|
+
* A body that is not the documented envelope (a proxy's HTML error page, a truncated stream)
|
|
124
|
+
* still yields a usable error: the status is always known, and the unparsed body is retained on
|
|
125
|
+
* `body` rather than discarded, so a caller diagnosing an unexpected failure is not left with
|
|
126
|
+
* "something went wrong".
|
|
127
|
+
*/
|
|
128
|
+
export function toApiError(status, body, requestId) {
|
|
129
|
+
const envelope = typeof body === 'object' && body !== null && 'error' in body
|
|
130
|
+
? body.error
|
|
131
|
+
: null;
|
|
132
|
+
const Ctor = BY_STATUS[status] ?? (status >= 500 ? CatFactoryServerError : CatFactoryApiError);
|
|
133
|
+
return new Ctor({
|
|
134
|
+
status,
|
|
135
|
+
code: envelope?.code ?? (status >= 500 ? 'internal' : 'unknown'),
|
|
136
|
+
message: envelope?.message ?? `HTTP ${status}`,
|
|
137
|
+
details: envelope?.details,
|
|
138
|
+
issues: envelope?.issues,
|
|
139
|
+
requestId,
|
|
140
|
+
body,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,EAAE;AACF,+FAA+F;AAC/F,gGAAgG;AAChG,oCAAoC;AACpC,EAAE;AACF,mGAAmG;AACnG,sFAAsF;AACtF,kGAAkG;AAClG,mGAAmG;AACnG,mGAAmG;AACnG,6FAA6F;AAC7F,gGAAgG;AAChG,8FAA8F;AAC9F,wCAAwC;AAqBxC,4FAA4F;AAC5F,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAA;IAC7B,CAAC;CACF;AAED,wFAAwF;AACxF,MAAM,OAAO,yBAA0B,SAAQ,eAAe;CAAG;AAEjE,8FAA8F;AAC9F,MAAM,OAAO,sBAAuB,SAAQ,eAAe;CAAG;AAE9D;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,eAAe;CAAG;AAEjE,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,yBAAyB,CAClC,iGAAiG,CAClG,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,eAAe;IAC/C,OAAO,CAAQ;IACxB,YAAY,OAAe,EAAE,OAAe,EAAE,OAA6B;QACzE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,OAA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O,qBAAsB,SAAQ,kBAAkB;CAAG;AAEhE,MAAM,SAAS,GAA8C;IAC3D,GAAG,EAAE,yBAAyB;IAC9B,GAAG,EAAE,2BAA2B;IAChC,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,yBAAyB;IAC9B,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,0BAA0B;CAChC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,MAAc,EACd,IAAa,EACb,SAAwB;IAExB,MAAM,QAAQ,GACZ,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,IAAI;QAC1D,CAAC,CAAE,IAAqB,CAAC,KAAK;QAC9B,CAAC,CAAC,IAAI,CAAA;IACV,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAA;IAC9F,OAAO,IAAI,IAAI,CAAC;QACd,MAAM;QACN,IAAI,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QAChE,OAAO,EAAE,QAAQ,EAAE,OAAO,IAAI,QAAQ,MAAM,EAAE;QAC9C,OAAO,EAAE,QAAQ,EAAE,OAAO;QAC1B,MAAM,EAAE,QAAQ,EAAE,MAAM;QACxB,SAAS;QACT,IAAI;KACL,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type EventStream } from './sse.ts';
|
|
2
|
+
/** Per-call overrides. Every operation method takes one as its last argument. */
|
|
3
|
+
export interface RequestOptions {
|
|
4
|
+
/** Abort the call from the outside (composed with the client's own timeout). */
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
/** Override the client's `timeoutMs` for this call. `0` disables the deadline. */
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
/** Extra headers, merged over the client's. */
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Override the retry budget for this call. Note the default policy below: a non-idempotent
|
|
12
|
+
* request is never retried automatically, so raising this does not make `POST /jobs`
|
|
13
|
+
* retry-safe.
|
|
14
|
+
*/
|
|
15
|
+
maxRetries?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ClientOptions {
|
|
18
|
+
/** The deployment's origin, e.g. `https://cat-factory.example.com`. */
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
/** A public-API key: `cf_live_<keyId>.<secret>`. */
|
|
21
|
+
apiKey: string;
|
|
22
|
+
/** Per-request deadline in ms; `0` disables it. Default 30_000. */
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
/** Retries for a RETRIABLE failure (see `isRetriable`). Default 2. */
|
|
25
|
+
maxRetries?: number;
|
|
26
|
+
/** Headers sent on every request. */
|
|
27
|
+
headers?: Record<string, string>;
|
|
28
|
+
/** Swap the HTTP implementation (a proxy agent, a test double). Defaults to global `fetch`. */
|
|
29
|
+
fetch?: typeof globalThis.fetch;
|
|
30
|
+
/** Prefixed to `User-Agent`, so a deployment's logs can attribute calls to your integration. */
|
|
31
|
+
userAgent?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RequestSpec {
|
|
34
|
+
method: string;
|
|
35
|
+
path: string;
|
|
36
|
+
body?: unknown;
|
|
37
|
+
query?: Record<string, unknown>;
|
|
38
|
+
options: RequestOptions;
|
|
39
|
+
}
|
|
40
|
+
/** SDK version, stamped into `User-Agent`. Kept in step with package.json by `check:sdk`. */
|
|
41
|
+
export declare const SDK_VERSION = "0.5.0";
|
|
42
|
+
/**
|
|
43
|
+
* Percent-encode a path parameter.
|
|
44
|
+
*
|
|
45
|
+
* `encodeURIComponent` and not a raw interpolation: an id is server-supplied but travels through
|
|
46
|
+
* a caller's own storage, and one carrying a `/` or a `?` would otherwise silently re-target the
|
|
47
|
+
* request at a different route rather than 404 on the id it names.
|
|
48
|
+
*/
|
|
49
|
+
export declare function encodePathSegment(value: string): string;
|
|
50
|
+
export declare class Transport {
|
|
51
|
+
private readonly baseUrl;
|
|
52
|
+
private readonly apiKey;
|
|
53
|
+
private readonly timeoutMs;
|
|
54
|
+
private readonly maxRetries;
|
|
55
|
+
private readonly headers;
|
|
56
|
+
private readonly doFetch;
|
|
57
|
+
constructor(options: ClientOptions);
|
|
58
|
+
/** Perform a request, returning the decoded JSON body. */
|
|
59
|
+
request<T>(spec: RequestSpec): Promise<T>;
|
|
60
|
+
/** Perform a request whose success carries no body (a 204). */
|
|
61
|
+
requestNoContent(spec: RequestSpec): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Open a server-sent event stream. Deliberately NOT retried: a reconnect would replay the
|
|
64
|
+
* stream from its start, and the caller — who knows which events it has already acted on —
|
|
65
|
+
* is the only party that can decide whether that is safe.
|
|
66
|
+
*/
|
|
67
|
+
stream(spec: RequestSpec): Promise<EventStream>;
|
|
68
|
+
private send;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,WAAW,EAAmB,MAAM,UAAU,CAAA;AAE5D,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,aAAa;IAC5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