@artblocks/abx-sdk 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +2203 -0
- package/README.md +131 -0
- package/dist/abi/generated.d.ts +8502 -129
- package/dist/abi/generated.d.ts.map +1 -1
- package/dist/abi/generated.js +40 -22
- package/dist/abi/generated.js.map +1 -1
- package/dist/abi/index.d.ts +2645 -168
- package/dist/abi/index.d.ts.map +1 -1
- package/dist/abi/index.js +34 -7
- package/dist/abi/index.js.map +1 -1
- package/dist/anchors.d.ts +319 -0
- package/dist/anchors.d.ts.map +1 -0
- package/dist/anchors.js +703 -0
- package/dist/anchors.js.map +1 -0
- package/dist/chains.d.ts +15 -9
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +19 -15
- package/dist/chains.js.map +1 -1
- package/dist/chunks.d.ts +53 -23
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +68 -6
- package/dist/chunks.js.map +1 -1
- package/dist/clients.d.ts +23 -11
- package/dist/clients.d.ts.map +1 -1
- package/dist/clients.js +17 -18
- package/dist/clients.js.map +1 -1
- package/dist/create2.d.ts +85 -1
- package/dist/create2.d.ts.map +1 -1
- package/dist/create2.js +159 -2
- package/dist/create2.js.map +1 -1
- package/dist/creator-token.d.ts +132 -0
- package/dist/creator-token.d.ts.map +1 -0
- package/dist/creator-token.js +183 -0
- package/dist/creator-token.js.map +1 -0
- package/dist/deploy.d.ts +234 -14
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +289 -111
- package/dist/deploy.js.map +1 -1
- package/dist/deployments.d.ts +63 -0
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +202 -28
- package/dist/deployments.js.map +1 -1
- package/dist/deps.d.ts +122 -5
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +248 -6
- package/dist/deps.js.map +1 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +8 -0
- package/dist/env.js.map +1 -1
- package/dist/errors.d.ts +94 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +126 -0
- package/dist/errors.js.map +1 -0
- package/dist/execute.d.ts +115 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +142 -0
- package/dist/execute.js.map +1 -0
- package/dist/gateways.d.ts +79 -0
- package/dist/gateways.d.ts.map +1 -0
- package/dist/gateways.js +156 -0
- package/dist/gateways.js.map +1 -0
- package/dist/generator-document.d.ts +58 -0
- package/dist/generator-document.d.ts.map +1 -0
- package/dist/generator-document.js +124 -0
- package/dist/generator-document.js.map +1 -0
- package/dist/generator.d.ts +43 -1
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +29 -0
- package/dist/generator.js.map +1 -1
- package/dist/index.d.ts +18 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +48 -0
- package/dist/inspect.d.ts.map +1 -0
- package/dist/inspect.js +295 -0
- package/dist/inspect.js.map +1 -0
- package/dist/migrate.d.ts +41 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +142 -0
- package/dist/migrate.js.map +1 -0
- package/dist/mime.d.ts +11 -0
- package/dist/mime.d.ts.map +1 -0
- package/dist/mime.js +40 -0
- package/dist/mime.js.map +1 -0
- package/dist/node.d.ts +10 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +24 -0
- package/dist/node.js.map +1 -0
- package/dist/onchain-uri.d.ts +110 -0
- package/dist/onchain-uri.d.ts.map +1 -0
- package/dist/onchain-uri.js +277 -0
- package/dist/onchain-uri.js.map +1 -0
- package/dist/ops.d.ts +507 -14
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +848 -32
- package/dist/ops.js.map +1 -1
- package/dist/policy.d.ts +58 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +36 -0
- package/dist/policy.js.map +1 -0
- package/dist/probe.d.ts +29 -0
- package/dist/probe.d.ts.map +1 -1
- package/dist/probe.js +104 -9
- package/dist/probe.js.map +1 -1
- package/dist/reconstruct.d.ts +94 -2
- package/dist/reconstruct.d.ts.map +1 -1
- package/dist/reconstruct.js +432 -97
- package/dist/reconstruct.js.map +1 -1
- package/dist/resume.d.ts +96 -0
- package/dist/resume.d.ts.map +1 -0
- package/dist/resume.js +95 -0
- package/dist/resume.js.map +1 -0
- package/dist/script-chunks.d.ts +24 -0
- package/dist/script-chunks.d.ts.map +1 -0
- package/dist/script-chunks.js +63 -0
- package/dist/script-chunks.js.map +1 -0
- package/dist/service.d.ts +206 -9
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +228 -18
- package/dist/service.js.map +1 -1
- package/dist/spine.d.ts +47 -4
- package/dist/spine.d.ts.map +1 -1
- package/dist/spine.js +0 -0
- package/dist/spine.js.map +1 -1
- package/dist/staging.d.ts +124 -0
- package/dist/staging.d.ts.map +1 -0
- package/dist/staging.js +134 -0
- package/dist/staging.js.map +1 -0
- package/dist/tokendata.d.ts +62 -2
- package/dist/tokendata.d.ts.map +1 -1
- package/dist/tokendata.js +79 -17
- package/dist/tokendata.js.map +1 -1
- package/dist/tokens.d.ts +120 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +317 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +108 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/util.d.ts +74 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +106 -0
- package/dist/util.js.map +1 -0
- package/package.json +11 -2
package/dist/service.d.ts
CHANGED
|
@@ -11,13 +11,105 @@
|
|
|
11
11
|
import type { Hex } from 'viem';
|
|
12
12
|
import type { OpenSeaAttribute } from './traits.js';
|
|
13
13
|
export declare const WELL_KNOWN_SERVICE_PATH = "/.well-known/abx-service";
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
14
|
+
/**
|
|
15
|
+
* Versioned interface ids a service declares in its descriptor. Versions ride these ids
|
|
16
|
+
* (they track the `/v1` path prefix); the descriptor has no separate format version.
|
|
17
|
+
*
|
|
18
|
+
* There are exactly two, and they are **all-or-nothing**: declaring one asserts every route it names
|
|
19
|
+
* answers per the spec. The artifact-registry routes ride {@link CONTROL_PLANE_INTERFACE} rather
|
|
20
|
+
* than an id of their own — once referenced output is locator-only, accepting a registration is a
|
|
21
|
+
* database insert, so a separate capability flag would describe a distinction that doesn't exist.
|
|
22
|
+
* A service that won't take a given caller's artifacts refuses on the credential (`403`), which is
|
|
23
|
+
* the honest axis: interfaces describe wire grammar, tokens describe permission.
|
|
24
|
+
*/
|
|
16
25
|
export declare const TOKEN_API_INTERFACE = "abx-token-api/v1";
|
|
17
26
|
export declare const CONTROL_PLANE_INTERFACE = "abx-control-plane/v1";
|
|
18
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Why this locator can't be accepted for a referenced artifact, or `null` if it passes.
|
|
29
|
+
*
|
|
30
|
+
* A locator is a **reachability** claim, not a durability one: it must resolve for a third party
|
|
31
|
+
* with no producer credentials and no private-network assumption. The protocol deliberately has
|
|
32
|
+
* **no preference among schemes** — `https://` (S3/R2, a producer's own public base, a chosen
|
|
33
|
+
* IPFS/Arweave gateway), `ipfs://` and `ar://` are peers, because derived output is re-creatable and
|
|
34
|
+
* a producer with an opinion about which gateway serves its content is making an operational call the
|
|
35
|
+
* protocol has no standing to override.
|
|
36
|
+
*
|
|
37
|
+
* Reachability can't be *proved* without fetching, and fetching a third-party URL while handling an
|
|
38
|
+
* authed write is byte custody through the back door plus an SSRF surface. So this checks the two
|
|
39
|
+
* things that are decidable from the string alone and are always wrong:
|
|
40
|
+
* - a private / loopback host — resolvable only from the producer's own network;
|
|
41
|
+
* - a presigned, expiring URL — resolvable now, dead later, which is the worst failure shape
|
|
42
|
+
* (it passes every check at publish time and rots silently).
|
|
43
|
+
*/
|
|
44
|
+
export declare function locatorRejectionReason(locator: string): string | null;
|
|
45
|
+
/**
|
|
46
|
+
* The indexing lifecycle a registration moves through, closed and provider-neutral
|
|
47
|
+
* (specs/self-host-toolkit/remote-services.md → The indexing lifecycle). One vocabulary for a
|
|
48
|
+
* managed provider and for your own node — the reference resolver stamps these too.
|
|
49
|
+
*
|
|
50
|
+
* queued registered + accepted; catch-up hasn't started
|
|
51
|
+
* backfilling actively catching up (initial sync or a forced replay); may already serve partial state
|
|
52
|
+
* live caught up to head; tracking head incrementally
|
|
53
|
+
* stale was live, now lagging (watcher behind, or transient RPC trouble) — still serving
|
|
54
|
+
* failed catch-up errored; carries `error`; will be retried
|
|
55
|
+
*
|
|
56
|
+
* Observability, never a source of truth: token resolution never consults it, and a project
|
|
57
|
+
* reconstructs from chain regardless.
|
|
58
|
+
*/
|
|
59
|
+
export type IndexStatus = 'queued' | 'backfilling' | 'live' | 'stale' | 'failed';
|
|
60
|
+
/** Statuses a caller can stop waiting on — see {@link AbxServiceClient.awaitIndexed}. */
|
|
61
|
+
export declare const TERMINAL_INDEX_STATUSES: readonly IndexStatus[];
|
|
62
|
+
/**
|
|
63
|
+
* Why catch-up failed, as a closed machine class — never free-form prose the client must parse.
|
|
64
|
+
* Deliberately NOT extended with a reorg class: the protocol defines no reorg detection (the repair
|
|
65
|
+
* is the deterministic full replay), so no implementation could emit one honestly.
|
|
66
|
+
*/
|
|
67
|
+
export type IndexErrorClass =
|
|
68
|
+
/** The RPC didn't answer (down, timing out, network). Retryable — nothing is wrong with the add. */
|
|
69
|
+
'rpc_unavailable'
|
|
70
|
+
/** The RPC answered "too many requests". Retryable, slower — the usual cause of a long backfill. */
|
|
71
|
+
| 'rpc_rate_limited'
|
|
72
|
+
/** The address doesn't look like an ABX contract on this chain. NOT emitted by the reference
|
|
73
|
+
* (it indexes what its operator tells it); a provider that validates clone-ness SHOULD refuse
|
|
74
|
+
* synchronously at register instead of accepting and failing here. */
|
|
75
|
+
| 'not_abx_contract'
|
|
76
|
+
/** Anything else. Carries no detail — the service logs the cause. */
|
|
77
|
+
| 'internal';
|
|
78
|
+
/** A catch-up failure as it crosses the wire: a machine class plus a short, CREDENTIAL-FREE hint.
|
|
79
|
+
* Messages come from a closed set (see {@link classifyIndexError}) rather than from a scrubber, so
|
|
80
|
+
* "no RPC URL can leak through here" is checkable by reading the code. */
|
|
81
|
+
export interface IndexError {
|
|
82
|
+
class: IndexErrorClass;
|
|
83
|
+
message?: string;
|
|
84
|
+
}
|
|
85
|
+
/** Map a catch-up failure to its wire form. Sniffs the underlying error's shape only to CHOOSE a
|
|
86
|
+
* class — nothing from it reaches the returned message. */
|
|
87
|
+
export declare function classifyIndexError(err: unknown): IndexError;
|
|
19
88
|
/** Machine error codes every conforming service uses — clients key off these, never off prose. */
|
|
20
89
|
export type ServiceErrorCode = 'invalid_request' | 'unsupported_chain' | 'unauthorized' | 'forbidden' | 'not_registered' | 'disabled'
|
|
90
|
+
/** 404 — this node serves no route at that path AT ALL (as opposed to a known route whose shape
|
|
91
|
+
* was wrong, which is a 400 `invalid_request` carrying the correct template). The pair exists so
|
|
92
|
+
* a client can tell "I built the wrong URL" from "this project isn't indexed here" from "this
|
|
93
|
+
* node is older than the route I want" — a bare 404 conflates all three and reads as an outage. */
|
|
94
|
+
| 'unknown_route'
|
|
95
|
+
/**
|
|
96
|
+
* **410** — this token id existed and is permanently gone (an ERC-721 burn). A statement about the
|
|
97
|
+
* TOKEN, which is why `not_registered` could not carry it: that one is a statement about the
|
|
98
|
+
* *contract* ("this node doesn't index it"), and a host answering a destroyed id with it was
|
|
99
|
+
* saying something false under protest (abx-services, 2026-08-20).
|
|
100
|
+
*
|
|
101
|
+
* `410`, not `404`, and the rule generalizes: **a resolver answers what the contract's own URI
|
|
102
|
+
* getter answers.** A burned 721's `tokenURI` reverts `NonexistentToken`, so composing metadata
|
|
103
|
+
* for it would put a node in direct contradiction with the contract it speaks for — while `404`
|
|
104
|
+
* reads as "wrong URL / not indexed yet" and invites a retry that can never succeed. It is worse
|
|
105
|
+
* than cosmetic on the image route, which answers an unknown-but-in-cap id with a warming
|
|
106
|
+
* placeholder: for a destroyed id that says "still loading" forever.
|
|
107
|
+
*
|
|
108
|
+
* **ERC-1155 editions never answer this.** `uri(id)` has no existence gate there, a zero-supply id
|
|
109
|
+
* still resolves, and it can mint again — nothing is permanently gone, so `410` would be a lie.
|
|
110
|
+
* Serve the document with `supply: 0`.
|
|
111
|
+
*/
|
|
112
|
+
| 'burned'
|
|
21
113
|
/** 500 — an unexpected server-side failure. Never carries internal detail (it could embed the
|
|
22
114
|
* operator's own credentials); the node logs the cause. Retryable. */
|
|
23
115
|
| 'internal_error';
|
|
@@ -75,8 +167,11 @@ export interface RegisterProjectBody {
|
|
|
75
167
|
/** Force a full replay even on a re-POST. */
|
|
76
168
|
full?: boolean;
|
|
77
169
|
}
|
|
78
|
-
|
|
170
|
+
/** `200` — catch-up finished inside the request; the counts are facts. */
|
|
171
|
+
export interface RegisterProjectSummary {
|
|
79
172
|
ok: boolean;
|
|
173
|
+
/** Discriminator. Normalized from the HTTP status by {@link AbxServiceClient.registerProject}. */
|
|
174
|
+
accepted: false;
|
|
80
175
|
mode: 'full' | 'incremental';
|
|
81
176
|
elapsedMs: number;
|
|
82
177
|
project: {
|
|
@@ -85,8 +180,30 @@ export interface RegisterProjectResult {
|
|
|
85
180
|
eventCount: number;
|
|
86
181
|
tokenCount: number;
|
|
87
182
|
mintedCount: number;
|
|
183
|
+
/** Sum of every token's current supply — ERC-1155 editions only; absent for a 721 project. */
|
|
184
|
+
copies?: string;
|
|
185
|
+
status?: IndexStatus;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/** `202` — the registration is durable and catch-up is deferred; there are no counts yet. Poll
|
|
189
|
+
* {@link AbxServiceClient.projectStatus} (or {@link AbxServiceClient.awaitIndexed}) for progress. */
|
|
190
|
+
export interface RegisterProjectAccepted {
|
|
191
|
+
ok: boolean;
|
|
192
|
+
accepted: true;
|
|
193
|
+
project: {
|
|
194
|
+
address: string;
|
|
195
|
+
name?: string | null;
|
|
196
|
+
status: IndexStatus;
|
|
88
197
|
};
|
|
89
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* `POST /v1/projects` answers in one of two shapes and **the HTTP status code is the discriminator**
|
|
201
|
+
* (200 = done, 202 = accepted). Both are conformant; a client MUST handle both, which is why this is
|
|
202
|
+
* a union rather than a shape with everything optional. Narrow with {@link isAccepted}.
|
|
203
|
+
*/
|
|
204
|
+
export type RegisterProjectResult = RegisterProjectSummary | RegisterProjectAccepted;
|
|
205
|
+
/** Narrow a register response to the deferred-catch-up branch. */
|
|
206
|
+
export declare function isAccepted(r: RegisterProjectResult): r is RegisterProjectAccepted;
|
|
90
207
|
/** One row of `GET /v1/projects` — the projects visible to this token. */
|
|
91
208
|
export interface RemoteProjectSummary {
|
|
92
209
|
chainId: number;
|
|
@@ -96,18 +213,38 @@ export interface RemoteProjectSummary {
|
|
|
96
213
|
eventCount?: number;
|
|
97
214
|
tokenCount?: number;
|
|
98
215
|
mintedCount?: number;
|
|
216
|
+
/** Sum of every token's current supply — ERC-1155 editions only; absent for a 721 project. */
|
|
217
|
+
copies?: string;
|
|
99
218
|
reconstructedAt?: string | null;
|
|
219
|
+
/** Where this project is in the indexing lifecycle — so a list renders "3 live, 1 backfilling,
|
|
220
|
+
* 1 failed" with no per-project round trip. */
|
|
221
|
+
status?: IndexStatus;
|
|
222
|
+
/** Present on `stale`/`failed` — the class only; the full hint lives on the status route. */
|
|
223
|
+
error?: {
|
|
224
|
+
class: IndexErrorClass;
|
|
225
|
+
};
|
|
100
226
|
}
|
|
101
|
-
/** `GET /v1/projects/{chainId}/{address}/status` — indexing freshness. */
|
|
227
|
+
/** `GET /v1/projects/{chainId}/{address}/status` — indexing freshness + lifecycle. */
|
|
102
228
|
export interface RemoteProjectStatus {
|
|
103
229
|
chainId: number;
|
|
104
230
|
address: string;
|
|
231
|
+
/** Where this project is in the lifecycle. */
|
|
232
|
+
status: IndexStatus;
|
|
105
233
|
fromBlock: string;
|
|
106
234
|
toBlock: string | null;
|
|
235
|
+
/** Chain head as the service last saw it — so a client computes lag / % complete without knowing
|
|
236
|
+
* anything about the service's watcher. `null` when the service can't say. */
|
|
237
|
+
headBlock?: string | null;
|
|
107
238
|
eventCount: number;
|
|
108
239
|
tokenCount: number;
|
|
109
240
|
mintedCount: number;
|
|
241
|
+
/** Sum of every token's current supply — ERC-1155 editions only; absent for a 721 project. */
|
|
242
|
+
copies?: string;
|
|
110
243
|
reconstructedAt: string | null;
|
|
244
|
+
/** Present on `stale`/`failed`. Credential-free by contract. */
|
|
245
|
+
error?: IndexError;
|
|
246
|
+
/** Catch-up attempts since the last success. */
|
|
247
|
+
attempts?: number;
|
|
111
248
|
watcher?: {
|
|
112
249
|
watching: boolean;
|
|
113
250
|
pollAt: string | null;
|
|
@@ -115,6 +252,21 @@ export interface RemoteProjectStatus {
|
|
|
115
252
|
intervalMs?: number;
|
|
116
253
|
};
|
|
117
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* How far along a BACKFILL is, from a status read — `null` when there is no meaningful ratio.
|
|
257
|
+
*
|
|
258
|
+
* Deliberately `null` for anything but `backfilling`, because `toBlock` measures two different things
|
|
259
|
+
* depending on the state. During an initial sync it advances monotonically, so `toBlock` vs head IS
|
|
260
|
+
* progress. Once a project is `live` it only moves when that project has *events* — so a perfectly
|
|
261
|
+
* current project on a busy chain sits at a tiny fraction of head, and rendering that as "3%" reads
|
|
262
|
+
* as broken when nothing is wrong. Same reason the reference measures staleness against its watcher's
|
|
263
|
+
* watermark rather than a project's `toBlock`.
|
|
264
|
+
*/
|
|
265
|
+
export declare function indexProgress(s: RemoteProjectStatus): {
|
|
266
|
+
done: bigint;
|
|
267
|
+
total: bigint;
|
|
268
|
+
percent: number;
|
|
269
|
+
} | null;
|
|
118
270
|
/** `POST /v1/effect-artifacts` — a render producer publishes one output (locator or bytes). */
|
|
119
271
|
export interface PublishEffectArtifactBody {
|
|
120
272
|
chainId: number;
|
|
@@ -125,9 +277,19 @@ export interface PublishEffectArtifactBody {
|
|
|
125
277
|
output?: string;
|
|
126
278
|
effectKey?: string;
|
|
127
279
|
contentType?: string;
|
|
128
|
-
/**
|
|
280
|
+
/**
|
|
281
|
+
* REFERENCED outputs (`render/image`, a video, a model — anything the service doesn't stitch):
|
|
282
|
+
* an `https://` / `ipfs://` / `ar://` pointer, reachable without the producer's credentials. The
|
|
283
|
+
* service records it and 302-redirects; it never fetches or proxies the bytes. Required for this
|
|
284
|
+
* class — sending {@link bytes_base64} instead is a `400`.
|
|
285
|
+
*/
|
|
129
286
|
locator?: string;
|
|
130
|
-
/**
|
|
287
|
+
/**
|
|
288
|
+
* BOUND outputs only (`render/traits` — content that stitches into the metadata JSON): the raw
|
|
289
|
+
* output, ≤{@link BOUND_ARTIFACT_MAX_BYTES}, held by the service beside the artifact row. Sending
|
|
290
|
+
* a {@link locator} for a bound output is a `400` — the content is assembled into `tokenURI`, so a
|
|
291
|
+
* pointer there would be recorded and then never stitch.
|
|
292
|
+
*/
|
|
131
293
|
bytes_base64?: string;
|
|
132
294
|
}
|
|
133
295
|
/** `POST /v1/effect-status` — a producer reports one run's transient state. */
|
|
@@ -147,12 +309,30 @@ export declare class AbxServiceError extends Error {
|
|
|
147
309
|
readonly status: number;
|
|
148
310
|
readonly code?: ServiceErrorCode;
|
|
149
311
|
readonly url: string;
|
|
312
|
+
/** The failure CLASS when the service volunteered one (a credential-free hint about *why* — an
|
|
313
|
+
* exhausted RPC reads very differently from a broken service). Optional on the wire. */
|
|
314
|
+
readonly class?: IndexErrorClass;
|
|
150
315
|
constructor(message: string, opts: {
|
|
151
316
|
status: number;
|
|
152
317
|
code?: ServiceErrorCode;
|
|
153
318
|
url: string;
|
|
319
|
+
class?: IndexErrorClass;
|
|
154
320
|
});
|
|
155
321
|
}
|
|
322
|
+
/** Waiting for a project to reach a terminal status ran out of time. The registration is durable —
|
|
323
|
+
* this is "still working", never "the add failed". */
|
|
324
|
+
export declare class AbxIndexTimeoutError extends Error {
|
|
325
|
+
readonly last?: RemoteProjectStatus;
|
|
326
|
+
constructor(message: string, last?: RemoteProjectStatus);
|
|
327
|
+
}
|
|
328
|
+
export interface AwaitIndexedOptions {
|
|
329
|
+
/** Give up after this long (default 5 min). The registration stays durable regardless. */
|
|
330
|
+
timeoutMs?: number;
|
|
331
|
+
/** Poll cadence (default 3s). */
|
|
332
|
+
intervalMs?: number;
|
|
333
|
+
/** Called on every poll — drive a progress line from it. */
|
|
334
|
+
onProgress?: (status: RemoteProjectStatus) => void;
|
|
335
|
+
}
|
|
156
336
|
export interface ServiceClientOptions {
|
|
157
337
|
baseUrl: string;
|
|
158
338
|
/** Bearer token for the control plane. Omit for descriptor-only use. */
|
|
@@ -170,8 +350,23 @@ export declare class AbxServiceClient {
|
|
|
170
350
|
constructor(opts: ServiceClientOptions);
|
|
171
351
|
/** The public service descriptor — no auth, safe to fetch before trusting a provider. */
|
|
172
352
|
descriptor(): Promise<ServiceDescriptor>;
|
|
173
|
-
/**
|
|
353
|
+
/**
|
|
354
|
+
* Register + index a project (the HTTP form of `abx add`; a re-POST is the nudge). Returns the
|
|
355
|
+
* completed summary (HTTP 200) or the accepted-and-still-working shape (HTTP 202) — narrow with
|
|
356
|
+
* {@link isAccepted}, and follow a 202 with {@link awaitIndexed}.
|
|
357
|
+
*
|
|
358
|
+
* A timed-out register is NOT retried blind. A conforming service persists the registration before
|
|
359
|
+
* it starts catching up, so a timeout usually means "it's in there, still working" — and re-POSTing
|
|
360
|
+
* would kick off a *second* full reconstruct against the RPC that was already too slow to answer.
|
|
361
|
+
* So we ask the status route whether it landed, and if it did we return the async shape instead.
|
|
362
|
+
*/
|
|
174
363
|
registerProject(body: RegisterProjectBody): Promise<RegisterProjectResult>;
|
|
364
|
+
/**
|
|
365
|
+
* Poll a project's status until it reaches a terminal lifecycle state (`live` or `failed`) — the
|
|
366
|
+
* one implementation of the wait loop, so the CLI, the effects runner, and any hosted agent all
|
|
367
|
+
* behave identically against any provider. `stale` keeps polling: it means lagging, not caught up.
|
|
368
|
+
*/
|
|
369
|
+
awaitIndexed(chainId: number, address: string, opts?: AwaitIndexedOptions): Promise<RemoteProjectStatus>;
|
|
175
370
|
/** The projects this token may see. */
|
|
176
371
|
listProjects(): Promise<RemoteProjectSummary[]>;
|
|
177
372
|
/** Deregister (remote `abx forget`). `not_registered` means "already gone" — reported, not
|
|
@@ -179,7 +374,8 @@ export declare class AbxServiceClient {
|
|
|
179
374
|
removeProject(chainId: number, address: string): Promise<{
|
|
180
375
|
removed: boolean;
|
|
181
376
|
}>;
|
|
182
|
-
/** Nudge a re-index.
|
|
377
|
+
/** Nudge a re-index. Answers in the same two shapes as {@link registerProject} — a full replay is
|
|
378
|
+
* the *most* likely call to outlive one HTTP request. */
|
|
183
379
|
reindexProject(chainId: number, address: string): Promise<RegisterProjectResult>;
|
|
184
380
|
/** Indexing freshness for one project. */
|
|
185
381
|
projectStatus(chainId: number, address: string): Promise<RemoteProjectStatus>;
|
|
@@ -192,5 +388,6 @@ export declare class AbxServiceClient {
|
|
|
192
388
|
/** Report a run's transient state for the artifact key it is producing. */
|
|
193
389
|
reportEffectStatus(body: ReportEffectStatusBody): Promise<void>;
|
|
194
390
|
private request;
|
|
391
|
+
private requestWithStatus;
|
|
195
392
|
}
|
|
196
393
|
//# sourceMappingURL=service.d.ts.map
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAGlD,eAA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