@pipelex/sdk 0.59.0 → 0.61.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 +14 -2
- package/dist/cli/script.d.ts +1 -1
- package/dist/client.d.ts +132 -65
- package/dist/client.js +296 -82
- 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 +214 -56
- package/dist/product-models.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webhooks.d.ts +19 -1
- package/docs/architecture.md +6 -5
- package/docs/crate-routes.md +5 -5
- package/docs/errors.md +2 -0
- package/docs/files.md +1 -0
- package/docs/input-preparation.md +1 -1
- package/docs/method-copy.md +14 -19
- package/docs/method-trees.md +1 -1
- package/docs/public-methods.md +97 -0
- package/docs/webhooks.md +15 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,7 +177,18 @@ 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
|
-
|
|
180
|
+
|
|
181
|
+
// The template catalog: the public methods every organization reads, in the platform's order, with
|
|
182
|
+
// the categories that have a template and each card's thumbnails behind short-lived links.
|
|
183
|
+
const templates = await client.listMethodTemplates({ category: "human-resources", limit: 8 });
|
|
184
|
+
for (const tab of templates.categories) console.log(tab.slug, tab.label);
|
|
185
|
+
// Another organization's public method reads in a narrower shape, its latest published version
|
|
186
|
+
// and no draft: `updated_at` is what tells it from one of your own.
|
|
187
|
+
const first = templates.items[0];
|
|
188
|
+
const template = first === undefined ? undefined : await client.getMethod(first.method_id);
|
|
189
|
+
if (template !== undefined && !("updated_at" in template)) {
|
|
190
|
+
console.log(template.latest_published.categories);
|
|
191
|
+
}
|
|
181
192
|
|
|
182
193
|
// The organization's files, newest first: uploads, test files and the files runs made. Each row's
|
|
183
194
|
// `uri` goes into a run's inputs as any address does. A filtered page can be empty and still carry
|
|
@@ -285,7 +296,8 @@ These pages ship inside the published package, so a reader who has only installe
|
|
|
285
296
|
| [`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
297
|
| [`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
298
|
| [`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,
|
|
299
|
+
| [`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` |
|
|
300
|
+
| [`docs/public-methods.md`](./docs/public-methods.md) | Public methods and the template catalog: `listMethodTemplates` and its iterator, the ordering, the categories and the thumbnails' links, another organization's public method read in its narrower shape, the copy of a public method, `visibility` and `categories` on a method, and the refusals a public method's publish adds |
|
|
289
301
|
| [`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
302
|
| [`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
303
|
| [`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.61.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, ListMethodTemplatesQuery, ListMethodVersionsQuery, ListRunFilesQuery, MethodCopyInput, MethodCopyResult, MethodData, MethodDeletionAccepted, MethodDetail, MethodDraftInput, MethodExample, MethodExampleAssistantSaveInput, MethodExampleAssistantSaveResult, MethodExampleCreateInput, MethodExampleLatestRunInput, MethodExampleLatestRunResult, MethodExamplePage, MethodExampleUpdateInput, MethodPage, MethodPublishInput, MethodPublishResult, MethodRenameInput, MethodSummary, MethodTemplate, MethodTemplatePage, MethodVersion, MethodVersionPage, MethodWriteInput, OnboardingSubmission, PublicMethodDetail, 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,
|
|
@@ -986,7 +988,49 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
986
988
|
*/
|
|
987
989
|
iterateMethods(query?: Omit<ListMethodsQuery, "cursor">): AsyncGenerator<MethodSummary, void, undefined>;
|
|
988
990
|
/**
|
|
989
|
-
*
|
|
991
|
+
* One page of the template catalog — `GET /v1/method-templates`: the public methods of the
|
|
992
|
+
* organization the deployment names as its templates organization, the same for every caller.
|
|
993
|
+
*
|
|
994
|
+
* The templates the ordering lists lead, in its order, and every other template follows by name.
|
|
995
|
+
* `ordering` names the ordering to serve, such as `default` or an arm of a test; an absent,
|
|
996
|
+
* unknown or malformed name serves `default`, and the page's `ordering` names the one served,
|
|
997
|
+
* `null` when there is none. `category` keeps one category's templates, by slug, in the same
|
|
998
|
+
* order; an unknown slug keeps none. Whatever the filter, the page's `categories` names, with its
|
|
999
|
+
* label, every category at least one template shows, in the catalog's order, so no tab drawn
|
|
1000
|
+
* from it is ever empty.
|
|
1001
|
+
*
|
|
1002
|
+
* Each `MethodTemplate` carries the method's id and name, its latest published version's number,
|
|
1003
|
+
* description and categories, its organization's display name and each thumbnail with its size
|
|
1004
|
+
* and a link to its bytes valid for about fifteen minutes. A template reads, runs and copies by
|
|
1005
|
+
* its `method_id`, as another organization's public method does (`getMethod`, `copyMethod`).
|
|
1006
|
+
*
|
|
1007
|
+
* Pass the page's `nextCursor` back as `cursor` with the same `ordering` and `category`, which the
|
|
1008
|
+
* cursor does not hold; `null` is the last page. `iterateMethodTemplates` follows it for you.
|
|
1009
|
+
*
|
|
1010
|
+
* Throws `ApiResponseError`: `422` `request.invalid` for a `limit` outside 1 to 200 or a cursor of
|
|
1011
|
+
* another listing, `422` `request.malformed` for a cursor that does not decode, `500`
|
|
1012
|
+
* `runtime.misconfigured` when the templates organization the deployment names has no record or
|
|
1013
|
+
* a link cannot be signed, and `503` `runtime.unavailable`, safe to retry. A page whose `items`
|
|
1014
|
+
* or `categories` is not an array, whose `next_cursor` or `ordering` is neither a string nor
|
|
1015
|
+
* `null`, a template lacking a member a card is drawn from (a string `method_id`, `name` and
|
|
1016
|
+
* `organization_name`, a `description` that is a string or `null`, a positive integer
|
|
1017
|
+
* `latest_version`, an array of string `categories`, and `thumbnails` each with a string `path`,
|
|
1018
|
+
* `media_type`, `sha256`, `url` and `expires_at` and a positive integer `width` and `height`), and a
|
|
1019
|
+
* category without a string `slug` and `label` are an answer the SDK cannot read, thrown as an
|
|
1020
|
+
* `ApiResponseError` too, its links redacted.
|
|
1021
|
+
*/
|
|
1022
|
+
listMethodTemplates(query?: ListMethodTemplatesQuery): Promise<MethodTemplatePage>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Every template of the catalog, in the order served — follows `listMethodTemplates`'s cursor
|
|
1025
|
+
* for you, with the same `ordering` and `category` on every page. It stops on a `null` cursor or
|
|
1026
|
+
* on a cursor the server failed to advance, and throws `PagingNotTerminatingError` past a page
|
|
1027
|
+
* ceiling no real catalog reaches. The ordering served and the categories are on each page, so
|
|
1028
|
+
* read one page with `listMethodTemplates` when you need them.
|
|
1029
|
+
*/
|
|
1030
|
+
iterateMethodTemplates(query?: Omit<ListMethodTemplatesQuery, "cursor">): AsyncGenerator<MethodTemplate, void, undefined>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Read one method with its files — `GET /v1/methods/{id}`. One of the caller's organization's
|
|
1033
|
+
* methods answers a `MethodDetail`: its identity, its draft
|
|
990
1034
|
* (`files`, `input_data`) with the draft's token (`updated_at`) and digest (`draft_digest`),
|
|
991
1035
|
* and its latest published version's summary (`latest_version`, `latest_published`), whatever
|
|
992
1036
|
* the publish state. A method never published reads with both `null`, never as an error.
|
|
@@ -994,6 +1038,11 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
994
1038
|
* link to its bytes valid for about fifteen minutes, and is empty for an empty draft;
|
|
995
1039
|
* `writeMethodTree` brings the tree to disk.
|
|
996
1040
|
*
|
|
1041
|
+
* **Another organization's public method reads too, in a narrower shape**, a
|
|
1042
|
+
* `PublicMethodDetail`: its latest published version, that version's description, categories
|
|
1043
|
+
* and files, and nothing of its draft or of the owner's people, so no `updated_at` to write or
|
|
1044
|
+
* publish with. Narrow the answer with `"updated_at" in method` before reading the draft.
|
|
1045
|
+
*
|
|
997
1046
|
* Takes a bare catalog id: the method routes address the method itself, never a version of
|
|
998
1047
|
* it. A caller holding `mt_…@3` strips the suffix with `parseMethodSelector` and reads that
|
|
999
1048
|
* version with `getMethodVersion`. Every method route throws `RequestArgumentError` for a
|
|
@@ -1001,13 +1050,18 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1001
1050
|
* and for an id that is empty, `.` or `..`, which the URL would resolve into another route's
|
|
1002
1051
|
* path.
|
|
1003
1052
|
*
|
|
1004
|
-
* Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for an unknown
|
|
1005
|
-
*
|
|
1006
|
-
* `
|
|
1007
|
-
*
|
|
1008
|
-
* `
|
|
1053
|
+
* Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for an unknown method, for
|
|
1054
|
+
* another organization's internal one, and for a public one made internal again or being
|
|
1055
|
+
* erased; `409` `pipelex.catalog.being_deleted` while the erasure of the caller's own method
|
|
1056
|
+
* runs; and a `500` `runtime.unexpected` for a method whose tree the platform holds no record
|
|
1057
|
+
* of. An answer whose `files` is not a listing is an answer the SDK cannot read, thrown as an
|
|
1058
|
+
* `ApiResponseError` too, its links redacted, and so is one that lacks `updated_at` while it
|
|
1059
|
+
* carries a member only the owner's read has (`draft_digest`, `created_by_user_id`,
|
|
1060
|
+
* `input_data`, `pipe_output`, `copied_from`, `deletion_state`), which would otherwise pass for
|
|
1061
|
+
* another organization's public method, and a public read without an integer `latest_version`
|
|
1062
|
+
* and a `latest_published` object.
|
|
1009
1063
|
*/
|
|
1010
|
-
getMethod(methodId: string): Promise<MethodDetail>;
|
|
1064
|
+
getMethod(methodId: string): Promise<MethodDetail | PublicMethodDetail>;
|
|
1011
1065
|
/**
|
|
1012
1066
|
* Create a method — `POST /v1/methods`. The new method holds its tree as its draft and has no
|
|
1013
1067
|
* published version, so its bare id answers `409` `pipelex.catalog.not_published` on the run and
|
|
@@ -1237,9 +1291,12 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1237
1291
|
*
|
|
1238
1292
|
* The answer is a `MethodPublishResult` discriminated on `outcome` — branch on it:
|
|
1239
1293
|
* `published` with the new `version`; `unchanged` with the existing latest `version`;
|
|
1240
|
-
* `refused` with a `reason
|
|
1241
|
-
*
|
|
1242
|
-
*
|
|
1294
|
+
* `refused` with a `reason`, a `message` and the runner's `validation` verdict, whose problem
|
|
1295
|
+
* items are read member by member as `validate` reads them. The reason is `invalid`, or
|
|
1296
|
+
* `not_runnable` for a draft that validates with pending signatures, and for a public method
|
|
1297
|
+
* also `thumbnail_missing`, `thumbnail_invalid` or `storage_reference` (see
|
|
1298
|
+
* `MethodPublishRefusalReason`); a reason this SDK does not know is passed through as its raw
|
|
1299
|
+
* string, still a verdict, so show its `message`. Every arm carries the `method`. A publish
|
|
1243
1300
|
* moves no token.
|
|
1244
1301
|
*
|
|
1245
1302
|
* Takes a bare catalog id, as `getMethod` does. Throws `RequestArgumentError` when
|
|
@@ -1254,11 +1311,14 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1254
1311
|
* cannot be reached, answers unusably or does not finish within the platform's deadline is a
|
|
1255
1312
|
* `502` or a `503` with nothing written, so a retry is safe; a runner that refuses the request
|
|
1256
1313
|
* itself is relayed under its own status. A retry of a publish that landed while its answer was
|
|
1257
|
-
* lost, as on a client timeout, answers `unchanged` with the version it wrote.
|
|
1314
|
+
* lost, as on a client timeout, answers `unchanged` with the version it wrote. A method made
|
|
1315
|
+
* public while its publish ran is a `503` with nothing written, safe to retry, which a retry
|
|
1316
|
+
* judges as a public method's publish.
|
|
1258
1317
|
*
|
|
1259
1318
|
* An answer whose `outcome` is not one of the outcomes above, that carries no `method` object,
|
|
1260
|
-
* or a refusal whose `
|
|
1261
|
-
* the SDK cannot read, thrown as an
|
|
1319
|
+
* or a refusal whose `reason` or `message` is not a string or whose `validation` is not a verdict
|
|
1320
|
+
* object with a boolean `is_valid`, is an answer the SDK cannot read, thrown as an
|
|
1321
|
+
* `ApiResponseError` too.
|
|
1262
1322
|
*/
|
|
1263
1323
|
publishMethod(methodId: string, input: MethodPublishInput): Promise<MethodPublishResult>;
|
|
1264
1324
|
/**
|
|
@@ -1267,11 +1327,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1267
1327
|
*
|
|
1268
1328
|
* Pass the page's `nextCursor` back as `cursor` to continue; `null` is the last page. A page
|
|
1269
1329
|
* may be short while `nextCursor` is set, because the platform reads versions whole. A method
|
|
1270
|
-
* never published answers an empty page.
|
|
1330
|
+
* never published answers an empty page. Another organization's public method lists its
|
|
1331
|
+
* versions too, each without its `published_by`.
|
|
1271
1332
|
*
|
|
1272
1333
|
* Takes a bare catalog id, as `getMethod` does. Throws `ApiResponseError`: `404`
|
|
1273
|
-
* `pipelex.catalog.not_found` for an unknown method
|
|
1274
|
-
* `
|
|
1334
|
+
* `pipelex.catalog.not_found` for an unknown method and for another organization's internal
|
|
1335
|
+
* one, `409` `pipelex.catalog.being_deleted` while the erasure of the caller's own method runs,
|
|
1336
|
+
* and `422` `request.invalid` for a cursor the listing did not issue for this method or a `limit`
|
|
1275
1337
|
* outside 1 to 100. A page whose `items` is not an array or whose `next_cursor` is neither a
|
|
1276
1338
|
* string nor `null` is an answer the SDK cannot read, thrown as an `ApiResponseError` too.
|
|
1277
1339
|
*/
|
|
@@ -1279,12 +1341,15 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1279
1341
|
/**
|
|
1280
1342
|
* One published version of a method, with its files — `GET /v1/methods/{id}/versions/{n}`.
|
|
1281
1343
|
* `files` lists the version's tree as `getMethod` lists the draft's, each file with a link to
|
|
1282
|
-
* its bytes valid for about fifteen minutes, which `writeMethodTree` writes to disk.
|
|
1344
|
+
* its bytes valid for about fifteen minutes, which `writeMethodTree` writes to disk. Another
|
|
1345
|
+
* organization's public method reads its versions too, without their `published_by`, the files
|
|
1346
|
+
* linked in the organization that holds it.
|
|
1283
1347
|
*
|
|
1284
1348
|
* Takes a bare catalog id, as `getMethod` does, and the version number. Throws
|
|
1285
1349
|
* `RequestArgumentError` for a `version` that is not a positive integer, before any request.
|
|
1286
1350
|
* Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for a version the method never
|
|
1287
|
-
* published
|
|
1351
|
+
* published, for an unknown method and for another organization's internal one, `409`
|
|
1352
|
+
* `pipelex.catalog.being_deleted` while the erasure of the caller's own method runs, and `500`
|
|
1288
1353
|
* `runtime.unexpected` for a version stored before methods were trees and never rewritten as
|
|
1289
1354
|
* one, which names no tree to serve.
|
|
1290
1355
|
*/
|
|
@@ -1301,10 +1366,16 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1301
1366
|
* original stays as it was. The copy takes the draft, never the latest published version; with
|
|
1302
1367
|
* `expected_draft_updated_at`, it takes exactly the draft the caller last saw.
|
|
1303
1368
|
*
|
|
1369
|
+
* **Another organization's public method copies too**, a template of the catalog among them,
|
|
1370
|
+
* from its latest published version rather than its draft: that version's tree, description and
|
|
1371
|
+
* categories, and the method's examples, never the owner's form inputs, with `copied_from`
|
|
1372
|
+
* naming the `version`. Leave `expected_draft_updated_at` out then: sent with such a method, it
|
|
1373
|
+
* is refused with a `422` `request.invalid` naming it.
|
|
1374
|
+
*
|
|
1304
1375
|
* The answer is a `MethodCopyResult` discriminated on `outcome` — branch on it: `copied` with
|
|
1305
1376
|
* the copy as `method`, `examples_copied` and `stored_files_copied`; `refused` with the
|
|
1306
1377
|
* `reason` `bundle_names_other_storage`, a `message` and every `references` entry (`{ path, uri
|
|
1307
|
-
* }`) a `.mthds` file of the
|
|
1378
|
+
* }`) a `.mthds` file of the tree holds that the destination cannot read and, in a duplicate,
|
|
1308
1379
|
* that names a file under the original's run files, which erasing the original would remove,
|
|
1309
1380
|
* nothing written.
|
|
1310
1381
|
*
|
|
@@ -1323,7 +1394,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1323
1394
|
* that is not from a web session, or for a role that may not change methods, in the method's
|
|
1324
1395
|
* organization or in the destination; `404` `pipelex.org.not_found` for a destination the
|
|
1325
1396
|
* caller does not belong to, still being set up or unknown, alike; `404`
|
|
1326
|
-
* `pipelex.catalog.not_found` for an unknown method
|
|
1397
|
+
* `pipelex.catalog.not_found` for an unknown method and for another organization's internal
|
|
1398
|
+
* one; `409` `pipelex.catalog.being_deleted` while the erasure of the caller's own method runs;
|
|
1327
1399
|
* `409` `pipelex.catalog.update_conflict` for a draft that moved since
|
|
1328
1400
|
* `expected_draft_updated_at`; a `409` whose `domain` is `runtime` and `retry` `no`, for a
|
|
1329
1401
|
* draft whose tree the method's organization holds no record of or no longer holds every file
|
|
@@ -1346,26 +1418,6 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1346
1418
|
* an `ApiResponseError` too.
|
|
1347
1419
|
*/
|
|
1348
1420
|
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
1421
|
/**
|
|
1370
1422
|
* Erase a method and everything it produced — `DELETE /v1/methods/{id}`.
|
|
1371
1423
|
*
|
|
@@ -2127,9 +2179,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
2127
2179
|
*/
|
|
2128
2180
|
listRunWebhookDeliveries(runId: string): Promise<WebhookDeliveryList>;
|
|
2129
2181
|
/**
|
|
2130
|
-
* One delivery of a run's webhooks, with its event
|
|
2131
|
-
* `GET /v1/runs/{id}/webhook-deliveries/{delivery_id}`: the body
|
|
2132
|
-
*
|
|
2182
|
+
* One delivery of a run's webhooks, with its event —
|
|
2183
|
+
* `GET /v1/runs/{id}/webhook-deliveries/{delivery_id}`: the body its latest attempt sent, or,
|
|
2184
|
+
* before any attempt, the body its first attempt will send. Every attempt and replay of the
|
|
2185
|
+
* delivery sends that body, only its `attempt` changing, so the event matches what a receiver
|
|
2186
|
+
* logged only once an attempt was made: it then equals, as JSON, the body that attempt brought
|
|
2187
|
+
* the receiver. Compare the two as parsed JSON values, never as text: the read promises the same
|
|
2188
|
+
* value, not the same bytes.
|
|
2133
2189
|
* `deliveryId` is the delivery's `delivery_id`, the receiver's `webhook-id`.
|
|
2134
2190
|
*
|
|
2135
2191
|
* Throws `RequestArgumentError` for an id that is empty, `.` or `..`, or holds a lone surrogate,
|
|
@@ -2147,16 +2203,27 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
2147
2203
|
* can read the run asks for one, an API key included, under the organization's replay rate.
|
|
2148
2204
|
*
|
|
2149
2205
|
* 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
|
-
|
|
2206
|
+
* that same attempt.
|
|
2207
|
+
*
|
|
2208
|
+
* `options.idempotencyKey` is sent as the `Idempotency-Key` header, and nothing is sent when it
|
|
2209
|
+
* is absent or `null`. The platform stores the replay's answer under the key, so the same replay
|
|
2210
|
+
* sent again under the same key, as after an answer lost to a time limit, gets the stored answer,
|
|
2211
|
+
* naming the same attempt, and the delivery is not sent twice. A key reused for another request
|
|
2212
|
+
* is refused `409` `request.idempotency_conflict`, and one whose earlier request is still being
|
|
2213
|
+
* handled `409` `request.idempotency_key_in_use`, whose `retry` is `yes`: send it again under the
|
|
2214
|
+
* same key after its `retry_after`. See `WebhookReplayOptions`.
|
|
2215
|
+
*
|
|
2216
|
+
* Throws `RequestArgumentError` for an id that is empty, `.` or `..`, or holds a lone surrogate,
|
|
2217
|
+
* or for an idempotency key that is not 1 to 255 visible ASCII characters, before any request.
|
|
2218
|
+
* Throws `ApiResponseError`: `404` `run.not_found` for a run the caller cannot read; `422`
|
|
2219
|
+
* `request.invalid` naming `delivery_id` for a delivery the run does not have; `409`
|
|
2220
|
+
* `pipelex.org.not_manageable` with the reason `webhook_delivery_pending` for a delivery still on
|
|
2221
|
+
* its retry schedule, or `webhook_delivery_attempts_exhausted` for one holding the most attempts
|
|
2222
|
+
* a delivery holds; `429` `account.rate_limited`, with its `retry_after`, past the
|
|
2223
|
+
* organization's replay rate; and a `500` or `503` when the replay could not be queued, which
|
|
2224
|
+
* then counts nothing against the rate.
|
|
2225
|
+
*/
|
|
2226
|
+
replayRunWebhookDelivery(runId: string, deliveryId: string, options?: WebhookReplayOptions): Promise<WebhookReplayAccepted>;
|
|
2160
2227
|
/** Patch a run's status (admin/manual) — `PUT /v1/runs/{id}`. */
|
|
2161
2228
|
updateRun(runId: string, input: UpdateRunInput): Promise<void>;
|
|
2162
2229
|
/**
|