abysshub 0.1.0 → 0.1.1-dev.2
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/README.md +2 -0
- package/dist/client.js +2 -0
- package/dist/error.d.ts +8 -0
- package/dist/error.js +6 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,6 +109,8 @@ A refusal, a failed run, a timeout and a lost connection all raise one class, `A
|
|
|
109
109
|
| `param` | the Field, body key, query key or header at fault, else `null` |
|
|
110
110
|
| `doc_url` | the code on the API access page, else `null` |
|
|
111
111
|
| `request_id` | quote it to support, else `null` |
|
|
112
|
+
| `shortfall` | with `insufficient_funds`: how much Byssium the wallet is short, else `null` |
|
|
113
|
+
| `price` | with `price_above_max`: what the run costs now, else `null` |
|
|
112
114
|
| `run` | the run, for a failed run or a timeout, else `null` |
|
|
113
115
|
|
|
114
116
|
- **Refusals:** `invalid_api_key` (401), `not_found` (404), `invalid_request`, `invalid_input`, `held_input_*`, `input_unreachable` and `idempotency_key_reused` (422), `insufficient_funds` (402), `spend_cap_reached` and `price_above_max` (400), `idempotency_key_in_use` (409), `rate_limited` (429), `server_error` (500).
|
package/dist/client.js
CHANGED
|
@@ -283,6 +283,8 @@ function refusal(status, body, requestId) {
|
|
|
283
283
|
status,
|
|
284
284
|
param: typeof error.param === "string" ? error.param : null,
|
|
285
285
|
doc_url: typeof error.doc_url === "string" ? error.doc_url : null,
|
|
286
|
+
shortfall: typeof error.shortfall === "number" ? error.shortfall : null,
|
|
287
|
+
price: typeof error.price === "number" ? error.price : null,
|
|
286
288
|
request_id: isObject(body) && typeof body.request_id === "string" ? body.request_id : requestId,
|
|
287
289
|
});
|
|
288
290
|
}
|
package/dist/error.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export interface AbyssErrorFields {
|
|
|
6
6
|
param?: string | null;
|
|
7
7
|
doc_url?: string | null;
|
|
8
8
|
request_id?: string | null;
|
|
9
|
+
/** With `insufficient_funds`: how much Byssium the wallet is short. */
|
|
10
|
+
shortfall?: number | null;
|
|
11
|
+
/** With `price_above_max`: what the run costs now. */
|
|
12
|
+
price?: number | null;
|
|
9
13
|
run?: Run | null;
|
|
10
14
|
/** What a `connection_error` was caused by. */
|
|
11
15
|
cause?: unknown;
|
|
@@ -21,6 +25,10 @@ export declare class AbyssError extends Error {
|
|
|
21
25
|
readonly param: string | null;
|
|
22
26
|
readonly doc_url: string | null;
|
|
23
27
|
readonly request_id: string | null;
|
|
28
|
+
/** With `insufficient_funds`: how much Byssium the wallet is short; else null. */
|
|
29
|
+
readonly shortfall: number | null;
|
|
30
|
+
/** With `price_above_max`: what the run costs now; else null. */
|
|
31
|
+
readonly price: number | null;
|
|
24
32
|
readonly run: Run | null;
|
|
25
33
|
constructor(fields: AbyssErrorFields);
|
|
26
34
|
}
|
package/dist/error.js
CHANGED
|
@@ -9,6 +9,10 @@ export class AbyssError extends Error {
|
|
|
9
9
|
param;
|
|
10
10
|
doc_url;
|
|
11
11
|
request_id;
|
|
12
|
+
/** With `insufficient_funds`: how much Byssium the wallet is short; else null. */
|
|
13
|
+
shortfall;
|
|
14
|
+
/** With `price_above_max`: what the run costs now; else null. */
|
|
15
|
+
price;
|
|
12
16
|
run;
|
|
13
17
|
constructor(fields) {
|
|
14
18
|
super(fields.message, fields.cause === undefined ? undefined : { cause: fields.cause });
|
|
@@ -18,6 +22,8 @@ export class AbyssError extends Error {
|
|
|
18
22
|
this.param = fields.param ?? null;
|
|
19
23
|
this.doc_url = fields.doc_url ?? null;
|
|
20
24
|
this.request_id = fields.request_id ?? null;
|
|
25
|
+
this.shortfall = fields.shortfall ?? null;
|
|
26
|
+
this.price = fields.price ?? null;
|
|
21
27
|
this.run = fields.run ?? null;
|
|
22
28
|
}
|
|
23
29
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, written from package.json by scripts/version.js at build. */
|
|
2
|
-
export declare const VERSION = "0.1.
|
|
2
|
+
export declare const VERSION = "0.1.1-dev.2";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, written from package.json by scripts/version.js at build. */
|
|
2
|
-
export const VERSION = "0.1.
|
|
2
|
+
export const VERSION = "0.1.1-dev.2";
|
package/package.json
CHANGED