@pipelex/sdk 0.59.0 → 0.60.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/README.md +1 -2
- package/dist/cli/script.d.ts +1 -1
- package/dist/client.d.ts +42 -45
- package/dist/client.js +55 -59
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +7 -3
- package/dist/product-models.d.ts +0 -36
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webhooks.d.ts +19 -1
- package/docs/architecture.md +4 -4
- package/docs/crate-routes.md +5 -5
- package/docs/errors.md +2 -0
- package/docs/input-preparation.md +1 -1
- package/docs/method-copy.md +5 -14
- package/docs/webhooks.md +15 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,7 +177,6 @@ const copy = await client.copyMethod(
|
|
|
177
177
|
{ idempotencyKey: crypto.randomUUID() },
|
|
178
178
|
);
|
|
179
179
|
if (copy.outcome === "copied") console.log(copy.method.copied_from); // the original it names
|
|
180
|
-
const copies = await client.listMethodCopies(created.method_id); // where the copies went
|
|
181
180
|
|
|
182
181
|
// The organization's files, newest first: uploads, test files and the files runs made. Each row's
|
|
183
182
|
// `uri` goes into a run's inputs as any address does. A filtered page can be empty and still carry
|
|
@@ -285,7 +284,7 @@ These pages ship inside the published package, so a reader who has only installe
|
|
|
285
284
|
| [`docs/method-trees.md`](./docs/method-trees.md) | A method's tree: the four forms a run, a validation, a save and the crate routes take it in (a directory on disk among them), how it travels inline or by hash and what is uploaded, the files a step reads, the template check's warnings and which step reads which file of the tree, the deployment's limits, the read's listing with its links, `writeMethodTree`, and `MethodFileTransferError` |
|
|
286
285
|
| [`docs/files.md`](./docs/files.md) | An organization's files: `listFiles` and `iterateFiles`, the row, the whole record and its provenance, the query and its repeated filters, paging through filtered pages, one file and its uses, the records of an address, the rename rule, links that name the file, a zip of files and its caps, a run's files, the copy into a method's draft, and an upload recorded as a method's test file with the refusals that come with it |
|
|
287
286
|
| [`docs/method-examples.md`](./docs/method-examples.md) | A method's saved examples: the create, the paged list and its iterator, the edit that raises the input revision, the latest-run write and its `recorded` or `stale` verdict, the build assistant's save and its `kept` or `created` verdict, how an integer past `Number.MAX_SAFE_INTEGER` in the inputs stays exact, and what is refused before sending |
|
|
288
|
-
| [`docs/method-copy.md`](./docs/method-copy.md) | Copying a method into another organization or duplicating it: what a copy holds and the stored files it copies, the `copied` or `refused` verdict, every refusal, the copy's idempotency key,
|
|
287
|
+
| [`docs/method-copy.md`](./docs/method-copy.md) | Copying a method into another organization or duplicating it: what a copy holds and the stored files it copies, the `copied` or `refused` verdict, every refusal, the copy's idempotency key, and `copied_from` |
|
|
289
288
|
| [`docs/organization-branding.md`](./docs/organization-branding.md) | An organization's logos and colours: `getBranding`, which every member and API key reads, `updateOrganizationBranding`, an admin's write that sets, clears or keeps each key, and how a refused logo or colour names its slot in `errors` so a settings screen shows the sentence under it |
|
|
290
289
|
| [`docs/exact-integers.md`](./docs/exact-integers.md) | Which reads keep an integer past `Number.MAX_SAFE_INTEGER` exact, as a `bigint` (a run's inputs and outputs, an example's inputs), how a request body writes it back with its digits, and `parseExactJson` and `stringifyExactJson` for code showing such data as JSON text |
|
|
291
290
|
| [`docs/crate-routes.md`](./docs/crate-routes.md) | `resolve`, `codegen` and `pipeIo` — the method's tree as the protocol's `files` map, with its dependencies, the normalized crate, the stamped types, and a method's I/O artifacts without a validation — and the offline `runCodegenCheck` that guards a committed tree |
|
package/dist/cli/script.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { CommandIO } from "./io.js";
|
|
|
15
15
|
* update notice and npm 12's run notices off the script's stderr, which carries the command's
|
|
16
16
|
* own lines, while npm's warnings and errors still print.
|
|
17
17
|
*/
|
|
18
|
-
export declare const SCRIPT_RUNNER = "npx --yes --no-update-notifier --loglevel=warn @pipelex/sdk@0.
|
|
18
|
+
export declare const SCRIPT_RUNNER = "npx --yes --no-update-notifier --loglevel=warn @pipelex/sdk@0.60.0";
|
|
19
19
|
export declare const SCRIPT_WRITER = "@pipelex/sdk";
|
|
20
20
|
export declare const SCRIPT_NEEDS = "Node 22.12 or later";
|
|
21
21
|
/** Run `pipelex-sdk script` and return its exit code. */
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MTHDSProtocol, ModelCategory, ModelDeck, RunOptions, StartOptions, VersionInfo } from "mthds/protocol";
|
|
2
2
|
import type { CodegenRequest, CodegenResponse, CrateRouteOptions, DictPipeOutput, FormatResponse, LintResponse, ModelCheckCategory, ModelReferenceVerdict, PipeIORequest, PipeIOResponse, PipelexRunResultStart, PipelexValidateSource, PipelexValidationResult, ResolveRequest, ResolveResponse, ValidateMethodSelector } from "./models.js";
|
|
3
3
|
import { type GetRunResultOptions, type RunProgress, type RunRead, type RunResults, type RunResultState, type StartAndWaitForResultOptions, type WaitForResultOptions } from "./runs.js";
|
|
4
|
-
import type { BillingPortalResponse, ChangePlanResponse, CheckoutResponse, DraftFileFromFileInput, DraftFileFromFileResult, FileArchive, FileArchiveRequest, FileDetail, FileLinkTarget, FileLinksResult, FilePage, FileRecord, FileRecordList, FileRenameInput, FileSummary, GetFileQuery, GetFilesByUriOptions, InvoiceView, Membership, MembershipsResponse, OrganizationBranding, OrganizationBrandingUpdate, ListFilesQuery,
|
|
4
|
+
import type { BillingPortalResponse, ChangePlanResponse, CheckoutResponse, DraftFileFromFileInput, DraftFileFromFileResult, FileArchive, FileArchiveRequest, FileDetail, FileLinkTarget, FileLinksResult, FilePage, FileRecord, FileRecordList, FileRenameInput, FileSummary, GetFileQuery, GetFilesByUriOptions, InvoiceView, Membership, MembershipsResponse, OrganizationBranding, OrganizationBrandingUpdate, ListFilesQuery, ListMethodExamplesQuery, ListMethodsQuery, ListMethodVersionsQuery, ListRunFilesQuery, MethodCopyInput, MethodCopyResult, MethodData, MethodDeletionAccepted, MethodDetail, MethodDraftInput, MethodExample, MethodExampleAssistantSaveInput, MethodExampleAssistantSaveResult, MethodExampleCreateInput, MethodExampleLatestRunInput, MethodExampleLatestRunResult, MethodExamplePage, MethodExampleUpdateInput, MethodPage, MethodPublishInput, MethodPublishResult, MethodRenameInput, MethodSummary, MethodVersion, MethodVersionPage, MethodWriteInput, OnboardingSubmission, PipelexApiKeyCreated, PipelexApiKeyList, ListRunsQuery, RunHistoryItem, RunDetail, RunFilesPage, RunPage, PlanView, ResolvedStorageUrl, SavedMethodFile, SubscriptionResponse, UpdateRunInput, UploadGrant, UploadGrantInput, UploadInput, UploadedFile, UserProfile } from "./product-models.js";
|
|
5
5
|
import type { MethodTreeForms, MethodTreeLimits } from "./method-trees.js";
|
|
6
6
|
import type { AppInfo } from "./user-agent.js";
|
|
7
|
-
import type { WebhookDeliveryDetail, WebhookDeliveryList, WebhookReplayAccepted, WebhookSecret, WebhookSecretRotateOptions } from "./webhooks.js";
|
|
7
|
+
import type { WebhookDeliveryDetail, WebhookDeliveryList, WebhookReplayAccepted, WebhookReplayOptions, WebhookSecret, WebhookSecretRotateOptions } from "./webhooks.js";
|
|
8
8
|
import type { UploadableAsset, UploadFileOptions, UploadRecord } from "./upload.js";
|
|
9
9
|
import type { PrepareInputsRequest, PreparedInputs } from "./prepare-inputs.js";
|
|
10
10
|
import type { BulkResolveStorageUrlsInput, BulkResolvedStorageUrls, DownloadArtifactsRequest, DownloadArtifactsResult, FetchArtifactOptions, ResolvedArtifact } from "./artifacts.js";
|
|
@@ -284,7 +284,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
284
284
|
* `url` is a fully resolved absolute URL. `mayStartRun` marks a request that may create a run,
|
|
285
285
|
* whose errors then say whether it may have (see `RunCreation`).
|
|
286
286
|
* `idempotencyKey`, already checked by `idempotencyKeyOf`, is sent as the
|
|
287
|
-
* `Idempotency-Key` header; only `start
|
|
287
|
+
* `Idempotency-Key` header; only `start`, `copyMethod`, `rotateWebhookSecret` and
|
|
288
|
+
* `replayRunWebhookDelivery` pass one.
|
|
288
289
|
*/
|
|
289
290
|
private requestRaw;
|
|
290
291
|
/**
|
|
@@ -614,10 +615,10 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
614
615
|
*
|
|
615
616
|
* The mapping is what makes their no-verdict arms usable: a crate route answers `422`
|
|
616
617
|
* for a request it cannot act on (a pipe selection `pipe-io` refuses; an unknown
|
|
617
|
-
* `kind`/`target`, or a `pipe_ref` on the concept-set-wide `types` kind, on `codegen
|
|
618
|
-
*
|
|
619
|
-
* server-side as of pipelex-api 0.21.0). A caller branches on
|
|
620
|
-
* never on a message.
|
|
618
|
+
* `kind`/`target`, or a `pipe_ref` on the concept-set-wide `types` kind, on `codegen`;
|
|
619
|
+
* the reserved registry-form `method_ref`, coded `request.unsupported`, on all three, the
|
|
620
|
+
* address form being resolved server-side as of pipelex-api 0.21.0). A caller branches on
|
|
621
|
+
* the problem's `code`, never on a message.
|
|
621
622
|
*
|
|
622
623
|
* All of these are static and inference-free, so they default to the management-call
|
|
623
624
|
* timeout. The internal raise is `crateRequestTimeoutMs`'s: the fetch-sized budget a
|
|
@@ -704,7 +705,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
704
705
|
* protocol's `files` map or as a `directory`, `tree` or `contents` the client sends
|
|
705
706
|
* inline when small and by hash otherwise (see {@link CrateRequestBase}); an
|
|
706
707
|
* address-form `method_ref` (server-resolved, pipelex-api >= 0.21.0; the registry form
|
|
707
|
-
*
|
|
708
|
+
* is a `422` `request.unsupported`); or a hosted `method_id` (platform-resolved — see
|
|
708
709
|
* {@link PipelexHostedToolingExtensions}). An empty map or string is absent.
|
|
709
710
|
*
|
|
710
711
|
* `options.signal` stops the call between the steps a `directory`, `tree` or `contents`
|
|
@@ -729,7 +730,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
729
730
|
* Same 200-verdict discipline and same three-form closure selector as
|
|
730
731
|
* {@link resolve}. Only a no-verdict condition throws `ApiResponseError`: an
|
|
731
732
|
* unknown `kind`/`target`, a `pipe_ref` on the concept-set-wide `types` kind, or
|
|
732
|
-
* a malformed selector is a 422
|
|
733
|
+
* a malformed selector is a 422, and so is a registry-form `method_ref`, coded
|
|
734
|
+
* `request.unsupported`.
|
|
733
735
|
*/
|
|
734
736
|
codegen(request: CodegenRequest, options?: CrateRouteOptions): Promise<CodegenResponse>;
|
|
735
737
|
/**
|
|
@@ -760,9 +762,9 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
760
762
|
* Only a no-verdict condition throws `ApiResponseError`: a malformed selector and an
|
|
761
763
|
* over-limit file are `422` problems; a selection the route refuses is a `422` whose
|
|
762
764
|
* `code` is `request.pipe_not_found` (an unknown `pipe_ref`), `request.pipe_unspecified`
|
|
763
|
-
* (no entry pipe) or `request.pipe_ambiguous`
|
|
764
|
-
* candidates in its `params`; a registry-form `method_ref` is a
|
|
765
|
-
* artifacts cannot be derived is a `500`.
|
|
765
|
+
* (no entry pipe, or several bundles' `main_pipe` declarations) or `request.pipe_ambiguous`
|
|
766
|
+
* (an ambiguous bare code), the candidates in its `params`; a registry-form `method_ref` is a
|
|
767
|
+
* `422` `request.unsupported`; a pipe whose artifacts cannot be derived is a `500`.
|
|
766
768
|
*
|
|
767
769
|
* A `method_ref` gets the fetch-sized budget, as on the other crate routes. On the
|
|
768
770
|
* hosted API the gateway caps a request at about 30 seconds whatever the client allows,
|
|
@@ -1346,26 +1348,6 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1346
1348
|
* an `ApiResponseError` too.
|
|
1347
1349
|
*/
|
|
1348
1350
|
copyMethod(methodId: string, input: MethodCopyInput, options?: MethodCopyRequestOptions): Promise<MethodCopyResult>;
|
|
1349
|
-
/**
|
|
1350
|
-
* One page of the copies made of a method, in the order of the copies' ids, which says nothing
|
|
1351
|
-
* of when each was made — `GET /v1/methods/{id}/copies`.
|
|
1352
|
-
*
|
|
1353
|
-
* Each row is the `MethodCopyMarker` the original keeps of a copy: the copy's id, the
|
|
1354
|
-
* destination's id, the member who made it and when. The destination is named by its id alone,
|
|
1355
|
-
* never its name, so a surface shows a destination's name only from the reader's own
|
|
1356
|
-
* memberships, and a copy in an organization the reader does not belong to stays a bare id. A
|
|
1357
|
-
* marker stays when its copy is erased, and the copy then reads as not found. Pass the page's
|
|
1358
|
-
* `nextCursor` back as `cursor` to continue; `null` is the last page. A method never copied,
|
|
1359
|
-
* and a copy itself, answer an empty page. The listing is open to every member of the method's
|
|
1360
|
-
* organization, a runner included, as every read of a method is.
|
|
1361
|
-
*
|
|
1362
|
-
* Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404`
|
|
1363
|
-
* `pipelex.catalog.not_found` for an unknown method, `409` `pipelex.catalog.being_deleted`, and
|
|
1364
|
-
* `422` `request.invalid` for a cursor the listing did not issue for this method or a `limit`
|
|
1365
|
-
* outside 1 to 100. A page whose `items` is not an array or whose `next_cursor` is neither a
|
|
1366
|
-
* string nor `null` is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
|
|
1367
|
-
*/
|
|
1368
|
-
listMethodCopies(methodId: string, query?: ListMethodCopiesQuery): Promise<MethodCopyPage>;
|
|
1369
1351
|
/**
|
|
1370
1352
|
* Erase a method and everything it produced — `DELETE /v1/methods/{id}`.
|
|
1371
1353
|
*
|
|
@@ -2127,9 +2109,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
2127
2109
|
*/
|
|
2128
2110
|
listRunWebhookDeliveries(runId: string): Promise<WebhookDeliveryList>;
|
|
2129
2111
|
/**
|
|
2130
|
-
* One delivery of a run's webhooks, with its event
|
|
2131
|
-
* `GET /v1/runs/{id}/webhook-deliveries/{delivery_id}`: the body
|
|
2132
|
-
*
|
|
2112
|
+
* One delivery of a run's webhooks, with its event —
|
|
2113
|
+
* `GET /v1/runs/{id}/webhook-deliveries/{delivery_id}`: the body its latest attempt sent, or,
|
|
2114
|
+
* before any attempt, the body its first attempt will send. Every attempt and replay of the
|
|
2115
|
+
* delivery sends that body, only its `attempt` changing, so the event matches what a receiver
|
|
2116
|
+
* logged only once an attempt was made: it then equals, as JSON, the body that attempt brought
|
|
2117
|
+
* the receiver. Compare the two as parsed JSON values, never as text: the read promises the same
|
|
2118
|
+
* value, not the same bytes.
|
|
2133
2119
|
* `deliveryId` is the delivery's `delivery_id`, the receiver's `webhook-id`.
|
|
2134
2120
|
*
|
|
2135
2121
|
* Throws `RequestArgumentError` for an id that is empty, `.` or `..`, or holds a lone surrogate,
|
|
@@ -2147,16 +2133,27 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
2147
2133
|
* can read the run asks for one, an API key included, under the organization's replay rate.
|
|
2148
2134
|
*
|
|
2149
2135
|
* Answers the attempt number the replay is sent under; a replay asked again before it is sent is
|
|
2150
|
-
* that same attempt.
|
|
2151
|
-
*
|
|
2152
|
-
*
|
|
2153
|
-
*
|
|
2154
|
-
*
|
|
2155
|
-
*
|
|
2156
|
-
*
|
|
2157
|
-
*
|
|
2158
|
-
|
|
2159
|
-
|
|
2136
|
+
* that same attempt.
|
|
2137
|
+
*
|
|
2138
|
+
* `options.idempotencyKey` is sent as the `Idempotency-Key` header, and nothing is sent when it
|
|
2139
|
+
* is absent or `null`. The platform stores the replay's answer under the key, so the same replay
|
|
2140
|
+
* sent again under the same key, as after an answer lost to a time limit, gets the stored answer,
|
|
2141
|
+
* naming the same attempt, and the delivery is not sent twice. A key reused for another request
|
|
2142
|
+
* is refused `409` `request.idempotency_conflict`, and one whose earlier request is still being
|
|
2143
|
+
* handled `409` `request.idempotency_key_in_use`, whose `retry` is `yes`: send it again under the
|
|
2144
|
+
* same key after its `retry_after`. See `WebhookReplayOptions`.
|
|
2145
|
+
*
|
|
2146
|
+
* Throws `RequestArgumentError` for an id that is empty, `.` or `..`, or holds a lone surrogate,
|
|
2147
|
+
* or for an idempotency key that is not 1 to 255 visible ASCII characters, before any request.
|
|
2148
|
+
* Throws `ApiResponseError`: `404` `run.not_found` for a run the caller cannot read; `422`
|
|
2149
|
+
* `request.invalid` naming `delivery_id` for a delivery the run does not have; `409`
|
|
2150
|
+
* `pipelex.org.not_manageable` with the reason `webhook_delivery_pending` for a delivery still on
|
|
2151
|
+
* its retry schedule, or `webhook_delivery_attempts_exhausted` for one holding the most attempts
|
|
2152
|
+
* a delivery holds; `429` `account.rate_limited`, with its `retry_after`, past the
|
|
2153
|
+
* organization's replay rate; and a `500` or `503` when the replay could not be queued, which
|
|
2154
|
+
* then counts nothing against the rate.
|
|
2155
|
+
*/
|
|
2156
|
+
replayRunWebhookDelivery(runId: string, deliveryId: string, options?: WebhookReplayOptions): Promise<WebhookReplayAccepted>;
|
|
2160
2157
|
/** Patch a run's status (admin/manual) — `PUT /v1/runs/{id}`. */
|
|
2161
2158
|
updateRun(runId: string, input: UpdateRunInput): Promise<void>;
|
|
2162
2159
|
/**
|
package/dist/client.js
CHANGED
|
@@ -582,7 +582,8 @@ export class PipelexApiClient {
|
|
|
582
582
|
* `url` is a fully resolved absolute URL. `mayStartRun` marks a request that may create a run,
|
|
583
583
|
* whose errors then say whether it may have (see `RunCreation`).
|
|
584
584
|
* `idempotencyKey`, already checked by `idempotencyKeyOf`, is sent as the
|
|
585
|
-
* `Idempotency-Key` header; only `start
|
|
585
|
+
* `Idempotency-Key` header; only `start`, `copyMethod`, `rotateWebhookSecret` and
|
|
586
|
+
* `replayRunWebhookDelivery` pass one.
|
|
586
587
|
*/
|
|
587
588
|
async requestRaw(method, url, options = {}) {
|
|
588
589
|
const hasBody = options.body !== undefined;
|
|
@@ -1304,10 +1305,10 @@ export class PipelexApiClient {
|
|
|
1304
1305
|
*
|
|
1305
1306
|
* The mapping is what makes their no-verdict arms usable: a crate route answers `422`
|
|
1306
1307
|
* for a request it cannot act on (a pipe selection `pipe-io` refuses; an unknown
|
|
1307
|
-
* `kind`/`target`, or a `pipe_ref` on the concept-set-wide `types` kind, on `codegen
|
|
1308
|
-
*
|
|
1309
|
-
* server-side as of pipelex-api 0.21.0). A caller branches on
|
|
1310
|
-
* never on a message.
|
|
1308
|
+
* `kind`/`target`, or a `pipe_ref` on the concept-set-wide `types` kind, on `codegen`;
|
|
1309
|
+
* the reserved registry-form `method_ref`, coded `request.unsupported`, on all three, the
|
|
1310
|
+
* address form being resolved server-side as of pipelex-api 0.21.0). A caller branches on
|
|
1311
|
+
* the problem's `code`, never on a message.
|
|
1311
1312
|
*
|
|
1312
1313
|
* All of these are static and inference-free, so they default to the management-call
|
|
1313
1314
|
* timeout. The internal raise is `crateRequestTimeoutMs`'s: the fetch-sized budget a
|
|
@@ -1429,9 +1430,8 @@ export class PipelexApiClient {
|
|
|
1429
1430
|
// unexposed — see their section above for why that blocks nothing. `pipe-io` is
|
|
1430
1431
|
// newer: a runner serves it from `pipelex-api` v0.33.0, and codes its selection
|
|
1431
1432
|
// refusals `request.pipe_not_found`, `request.pipe_unspecified` and
|
|
1432
|
-
// `request.pipe_ambiguous
|
|
1433
|
-
//
|
|
1434
|
-
// `docs/crate-routes.md`).
|
|
1433
|
+
// `request.pipe_ambiguous` from v0.90.0; the dev plane serves it too, measured on
|
|
1434
|
+
// api-dev.pipelex.com on 2026-10-31 (see `docs/crate-routes.md`).
|
|
1435
1435
|
//
|
|
1436
1436
|
// All three are STATIC routes (no dry-run sweep), so like every static sibling they
|
|
1437
1437
|
// take no `timeoutMs` — see the policy note on `requestExtension` before adding one
|
|
@@ -1460,7 +1460,7 @@ export class PipelexApiClient {
|
|
|
1460
1460
|
* protocol's `files` map or as a `directory`, `tree` or `contents` the client sends
|
|
1461
1461
|
* inline when small and by hash otherwise (see {@link CrateRequestBase}); an
|
|
1462
1462
|
* address-form `method_ref` (server-resolved, pipelex-api >= 0.21.0; the registry form
|
|
1463
|
-
*
|
|
1463
|
+
* is a `422` `request.unsupported`); or a hosted `method_id` (platform-resolved — see
|
|
1464
1464
|
* {@link PipelexHostedToolingExtensions}). An empty map or string is absent.
|
|
1465
1465
|
*
|
|
1466
1466
|
* `options.signal` stops the call between the steps a `directory`, `tree` or `contents`
|
|
@@ -1487,7 +1487,8 @@ export class PipelexApiClient {
|
|
|
1487
1487
|
* Same 200-verdict discipline and same three-form closure selector as
|
|
1488
1488
|
* {@link resolve}. Only a no-verdict condition throws `ApiResponseError`: an
|
|
1489
1489
|
* unknown `kind`/`target`, a `pipe_ref` on the concept-set-wide `types` kind, or
|
|
1490
|
-
* a malformed selector is a 422
|
|
1490
|
+
* a malformed selector is a 422, and so is a registry-form `method_ref`, coded
|
|
1491
|
+
* `request.unsupported`.
|
|
1491
1492
|
*/
|
|
1492
1493
|
async codegen(request, options = {}) {
|
|
1493
1494
|
return this.crateRequest("codegen", "codegen", request, options);
|
|
@@ -1520,9 +1521,9 @@ export class PipelexApiClient {
|
|
|
1520
1521
|
* Only a no-verdict condition throws `ApiResponseError`: a malformed selector and an
|
|
1521
1522
|
* over-limit file are `422` problems; a selection the route refuses is a `422` whose
|
|
1522
1523
|
* `code` is `request.pipe_not_found` (an unknown `pipe_ref`), `request.pipe_unspecified`
|
|
1523
|
-
* (no entry pipe) or `request.pipe_ambiguous`
|
|
1524
|
-
* candidates in its `params`; a registry-form `method_ref` is a
|
|
1525
|
-
* artifacts cannot be derived is a `500`.
|
|
1524
|
+
* (no entry pipe, or several bundles' `main_pipe` declarations) or `request.pipe_ambiguous`
|
|
1525
|
+
* (an ambiguous bare code), the candidates in its `params`; a registry-form `method_ref` is a
|
|
1526
|
+
* `422` `request.unsupported`; a pipe whose artifacts cannot be derived is a `500`.
|
|
1526
1527
|
*
|
|
1527
1528
|
* A `method_ref` gets the fetch-sized budget, as on the other crate routes. On the
|
|
1528
1529
|
* hosted API the gateway caps a request at about 30 seconds whatever the client allows,
|
|
@@ -2591,30 +2592,6 @@ export class PipelexApiClient {
|
|
|
2591
2592
|
}
|
|
2592
2593
|
return answer;
|
|
2593
2594
|
}
|
|
2594
|
-
/**
|
|
2595
|
-
* One page of the copies made of a method, in the order of the copies' ids, which says nothing
|
|
2596
|
-
* of when each was made — `GET /v1/methods/{id}/copies`.
|
|
2597
|
-
*
|
|
2598
|
-
* Each row is the `MethodCopyMarker` the original keeps of a copy: the copy's id, the
|
|
2599
|
-
* destination's id, the member who made it and when. The destination is named by its id alone,
|
|
2600
|
-
* never its name, so a surface shows a destination's name only from the reader's own
|
|
2601
|
-
* memberships, and a copy in an organization the reader does not belong to stays a bare id. A
|
|
2602
|
-
* marker stays when its copy is erased, and the copy then reads as not found. Pass the page's
|
|
2603
|
-
* `nextCursor` back as `cursor` to continue; `null` is the last page. A method never copied,
|
|
2604
|
-
* and a copy itself, answer an empty page. The listing is open to every member of the method's
|
|
2605
|
-
* organization, a runner included, as every read of a method is.
|
|
2606
|
-
*
|
|
2607
|
-
* Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404`
|
|
2608
|
-
* `pipelex.catalog.not_found` for an unknown method, `409` `pipelex.catalog.being_deleted`, and
|
|
2609
|
-
* `422` `request.invalid` for a cursor the listing did not issue for this method or a `limit`
|
|
2610
|
-
* outside 1 to 100. A page whose `items` is not an array or whose `next_cursor` is neither a
|
|
2611
|
-
* string nor `null` is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
|
|
2612
|
-
*/
|
|
2613
|
-
async listMethodCopies(methodId, query = {}) {
|
|
2614
|
-
const search = productQuery({ limit: query.limit, cursor: query.cursor });
|
|
2615
|
-
const endpoint = `${methodPath(methodId, "listMethodCopies")}/copies`;
|
|
2616
|
-
return this.requestPage(`${endpoint}${search}`);
|
|
2617
|
-
}
|
|
2618
2595
|
/**
|
|
2619
2596
|
* Erase a method and everything it produced — `DELETE /v1/methods/{id}`.
|
|
2620
2597
|
*
|
|
@@ -3729,9 +3706,13 @@ export class PipelexApiClient {
|
|
|
3729
3706
|
return list;
|
|
3730
3707
|
}
|
|
3731
3708
|
/**
|
|
3732
|
-
* One delivery of a run's webhooks, with its event
|
|
3733
|
-
* `GET /v1/runs/{id}/webhook-deliveries/{delivery_id}`: the body
|
|
3734
|
-
*
|
|
3709
|
+
* One delivery of a run's webhooks, with its event —
|
|
3710
|
+
* `GET /v1/runs/{id}/webhook-deliveries/{delivery_id}`: the body its latest attempt sent, or,
|
|
3711
|
+
* before any attempt, the body its first attempt will send. Every attempt and replay of the
|
|
3712
|
+
* delivery sends that body, only its `attempt` changing, so the event matches what a receiver
|
|
3713
|
+
* logged only once an attempt was made: it then equals, as JSON, the body that attempt brought
|
|
3714
|
+
* the receiver. Compare the two as parsed JSON values, never as text: the read promises the same
|
|
3715
|
+
* value, not the same bytes.
|
|
3735
3716
|
* `deliveryId` is the delivery's `delivery_id`, the receiver's `webhook-id`.
|
|
3736
3717
|
*
|
|
3737
3718
|
* Throws `RequestArgumentError` for an id that is empty, `.` or `..`, or holds a lone surrogate,
|
|
@@ -3754,20 +3735,34 @@ export class PipelexApiClient {
|
|
|
3754
3735
|
* can read the run asks for one, an API key included, under the organization's replay rate.
|
|
3755
3736
|
*
|
|
3756
3737
|
* Answers the attempt number the replay is sent under; a replay asked again before it is sent is
|
|
3757
|
-
* that same attempt.
|
|
3758
|
-
*
|
|
3759
|
-
*
|
|
3760
|
-
*
|
|
3761
|
-
*
|
|
3762
|
-
*
|
|
3763
|
-
*
|
|
3764
|
-
*
|
|
3738
|
+
* that same attempt.
|
|
3739
|
+
*
|
|
3740
|
+
* `options.idempotencyKey` is sent as the `Idempotency-Key` header, and nothing is sent when it
|
|
3741
|
+
* is absent or `null`. The platform stores the replay's answer under the key, so the same replay
|
|
3742
|
+
* sent again under the same key, as after an answer lost to a time limit, gets the stored answer,
|
|
3743
|
+
* naming the same attempt, and the delivery is not sent twice. A key reused for another request
|
|
3744
|
+
* is refused `409` `request.idempotency_conflict`, and one whose earlier request is still being
|
|
3745
|
+
* handled `409` `request.idempotency_key_in_use`, whose `retry` is `yes`: send it again under the
|
|
3746
|
+
* same key after its `retry_after`. See `WebhookReplayOptions`.
|
|
3747
|
+
*
|
|
3748
|
+
* Throws `RequestArgumentError` for an id that is empty, `.` or `..`, or holds a lone surrogate,
|
|
3749
|
+
* or for an idempotency key that is not 1 to 255 visible ASCII characters, before any request.
|
|
3750
|
+
* Throws `ApiResponseError`: `404` `run.not_found` for a run the caller cannot read; `422`
|
|
3751
|
+
* `request.invalid` naming `delivery_id` for a delivery the run does not have; `409`
|
|
3752
|
+
* `pipelex.org.not_manageable` with the reason `webhook_delivery_pending` for a delivery still on
|
|
3753
|
+
* its retry schedule, or `webhook_delivery_attempts_exhausted` for one holding the most attempts
|
|
3754
|
+
* a delivery holds; `429` `account.rate_limited`, with its `retry_after`, past the
|
|
3755
|
+
* organization's replay rate; and a `500` or `503` when the replay could not be queued, which
|
|
3756
|
+
* then counts nothing against the rate.
|
|
3765
3757
|
*/
|
|
3766
|
-
async replayRunWebhookDelivery(runId, deliveryId) {
|
|
3758
|
+
async replayRunWebhookDelivery(runId, deliveryId, options = {}) {
|
|
3767
3759
|
const call = "replayRunWebhookDelivery";
|
|
3768
3760
|
const run = idPathSegment(runId, call, RUN_ID_ARGUMENT);
|
|
3769
3761
|
const delivery = idPathSegment(deliveryId, call, DELIVERY_ID_ARGUMENT);
|
|
3770
|
-
|
|
3762
|
+
const endpoint = `runs/${run}/webhook-deliveries/${delivery}/replay`;
|
|
3763
|
+
const idempotencyKey = idempotencyKeyOf(options, "replay the delivery");
|
|
3764
|
+
const res = await this.requestProductAnswer("POST", endpoint, undefined, { idempotencyKey });
|
|
3765
|
+
return this.readObjectAnswer("POST", endpoint, res);
|
|
3771
3766
|
}
|
|
3772
3767
|
/** Patch a run's status (admin/manual) — `PUT /v1/runs/{id}`. */
|
|
3773
3768
|
async updateRun(runId, input) {
|
|
@@ -4236,9 +4231,9 @@ function nonEmptyString(value) {
|
|
|
4236
4231
|
/** The request header the hosted API reads a request's idempotency key from. */
|
|
4237
4232
|
const IDEMPOTENCY_KEY_HEADER = "Idempotency-Key";
|
|
4238
4233
|
/**
|
|
4239
|
-
* The longest idempotency key a
|
|
4234
|
+
* The longest idempotency key a request sends. It is room for any generated key, and keeps the
|
|
4240
4235
|
* hosted API's stored record of the key far inside its store's limit, which a longer key could
|
|
4241
|
-
* exceed, so that the
|
|
4236
|
+
* exceed, so that the request would run without the protection the key was sent for.
|
|
4242
4237
|
*/
|
|
4243
4238
|
const MAX_IDEMPOTENCY_KEY_LENGTH = 255;
|
|
4244
4239
|
/**
|
|
@@ -4248,13 +4243,14 @@ const MAX_IDEMPOTENCY_KEY_LENGTH = 255;
|
|
|
4248
4243
|
*/
|
|
4249
4244
|
const VISIBLE_ASCII = /^[\x21-\x7E]+$/;
|
|
4250
4245
|
/**
|
|
4251
|
-
* The idempotency key a start
|
|
4252
|
-
* (absent or `null`). A key that is not a string of 1 to
|
|
4253
|
-
* with a `RequestArgumentError` rather than dropped, an
|
|
4254
|
-
* without the key its caller gave would lose the
|
|
4255
|
-
* `request` says what the request does, as the
|
|
4256
|
-
*
|
|
4257
|
-
*
|
|
4246
|
+
* The idempotency key a start, a method copy, a secret rotation or a delivery replay sends, or
|
|
4247
|
+
* `undefined` when the options carry none (absent or `null`). A key that is not a string of 1 to
|
|
4248
|
+
* 255 visible ASCII characters is refused with a `RequestArgumentError` rather than dropped, an
|
|
4249
|
+
* empty one included, since a request sent without the key its caller gave would lose the
|
|
4250
|
+
* protection the caller asked for without a word. `request` says what the request does, as the
|
|
4251
|
+
* refusal's last sentence names it ("start the run", "copy the method", "rotate the secret",
|
|
4252
|
+
* "replay the delivery"). The message never quotes the key, which a caller may derive from
|
|
4253
|
+
* something private. The Python SDK holds a key to the same rule, in the same words.
|
|
4258
4254
|
*/
|
|
4259
4255
|
function idempotencyKeyOf(options, request = "start the run") {
|
|
4260
4256
|
const key = options.idempotencyKey;
|