@pipelex/sdk 0.64.0 → 0.66.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 +17 -1
- package/dist/cli/script.d.ts +1 -1
- package/dist/client.d.ts +233 -9
- package/dist/client.js +325 -24
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js.map +1 -1
- package/dist/method-layouts.d.ts +51 -20
- package/dist/method-layouts.js +23 -17
- package/dist/method-layouts.js.map +1 -1
- package/dist/method-showcases.d.ts +169 -0
- package/dist/method-showcases.js +139 -0
- package/dist/method-showcases.js.map +1 -0
- package/dist/product-models.d.ts +37 -5
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/architecture.md +4 -2
- package/docs/errors.md +1 -1
- package/docs/method-copy.md +1 -1
- package/docs/method-examples.md +1 -0
- package/docs/method-layouts.md +52 -9
- package/docs/method-showcases.md +100 -0
- package/docs/public-methods.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -197,6 +197,21 @@ const laidOut = await client.validate({ method_id: `${created.method_id}@1` }, f
|
|
|
197
197
|
});
|
|
198
198
|
if (laidOut.is_valid) console.log(laidOut.layouts?.map((layout) => layout.catalog) ?? "plain form");
|
|
199
199
|
|
|
200
|
+
// A host opening the page reads the same layouts with no dry run, and a builder can switch a
|
|
201
|
+
// page's design off, per catalog, without losing it; the list is written whole.
|
|
202
|
+
const { items: laidOutPages } = await client.listMethodLayouts(created.method_id, 1);
|
|
203
|
+
console.log(laidOutPages.length);
|
|
204
|
+
await client.setMethodLayoutsOff(created.method_id, ["composer"]);
|
|
205
|
+
|
|
206
|
+
// A completed run frozen as a showcase, which readers of a published version look at for free.
|
|
207
|
+
const verdict = await client.freezeMethodShowcase(created.method_id, {
|
|
208
|
+
run_id: "run_123",
|
|
209
|
+
name: "A first example",
|
|
210
|
+
});
|
|
211
|
+
if (verdict.outcome === "refused") console.log(verdict.reason, verdict.message);
|
|
212
|
+
const { items: showcases } = await client.listMethodVersionShowcases(created.method_id, 1);
|
|
213
|
+
console.log(showcases.length);
|
|
214
|
+
|
|
200
215
|
// The template catalog: the public methods every organization reads, in the platform's order, with
|
|
201
216
|
// the categories that have a template and each card's thumbnails behind short-lived links. A
|
|
202
217
|
// category's `labels` name it by language tag and may lack a language, in which case a client
|
|
@@ -321,7 +336,8 @@ These pages ship inside the published package, so a reader who has only installe
|
|
|
321
336
|
| [`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 |
|
|
322
337
|
| [`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 |
|
|
323
338
|
| [`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` |
|
|
324
|
-
| [`docs/method-layouts.md`](./docs/method-layouts.md) | A method's stored layouts: `storeMethodLayout`, which stores a layout designed for one pipe of a published version, its closed body and its refusals, the layout and its
|
|
339
|
+
| [`docs/method-layouts.md`](./docs/method-layouts.md) | A method's stored layouts: `storeMethodLayout`, which stores a layout designed for one pipe of a published version, its closed body and its refusals, the layout, its provenance and its written sample, `listMethodLayouts`, which reads a version's layouts with no dry run, `setMethodLayoutsOff`, which switches a page's design off, and the `layouts` a validate by `method_id` carries when `views` names `layouts`, absent when there are none |
|
|
340
|
+
| [`docs/method-showcases.md`](./docs/method-showcases.md) | A method's showcases, completed runs frozen with a private copy of their files: `freezeMethodShowcase` and its verdict, `withdrawMethodShowcase`, the holder's reads (`listMethodShowcases`, `getMethodShowcase`) and every reader's reads of a published version (`listMethodVersionShowcases`, `getMethodVersionShowcase`) |
|
|
325
341
|
| [`docs/public-methods.md`](./docs/public-methods.md) | Public methods and the template catalog: `listMethodTemplates` and its iterator, the ordering, the categories with their labels by language and `listMethodCategories`, 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 |
|
|
326
342
|
| [`docs/organization-branding.md`](./docs/organization-branding.md) | An organization's logos, colours, app style and typeface, and its white-label entitlement: `getBranding`, which every member and API key reads, `updateOrganizationBranding`, a write by the `admin` or the `member` role that sets, clears or keeps each key, and how a refused logo, colour, style or typeface names its field so a settings screen shows the sentence under it |
|
|
327
343
|
| [`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 |
|
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.66.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,6 +1,7 @@
|
|
|
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, ValidateView } from "./models.js";
|
|
3
|
-
import type { MethodLayout, MethodLayoutInput } from "./method-layouts.js";
|
|
3
|
+
import type { MethodLayout, MethodLayoutInput, MethodLayoutList } from "./method-layouts.js";
|
|
4
|
+
import type { MethodShowcaseDetail, MethodShowcaseFreezeResult, MethodShowcaseInput, MethodShowcaseList } from "./method-showcases.js";
|
|
4
5
|
import { type GetRunResultOptions, type RunProgress, type RunRead, type RunResults, type RunResultState, type StartAndWaitForResultOptions, type WaitForResultOptions } from "./runs.js";
|
|
5
6
|
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, MethodCategoryList, 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";
|
|
6
7
|
import type { MethodTreeForms, MethodTreeLimits } from "./method-trees.js";
|
|
@@ -174,6 +175,52 @@ export interface MethodCopyRequestOptions {
|
|
|
174
175
|
*/
|
|
175
176
|
idempotencyKey?: string | null;
|
|
176
177
|
}
|
|
178
|
+
/** Options for `listMethodLayouts`. */
|
|
179
|
+
export interface MethodLayoutListOptions {
|
|
180
|
+
/**
|
|
181
|
+
* Caller-driven cancellation, such as an `AbortSignal.timeout(…)` for a page that can do without
|
|
182
|
+
* the layouts; the abort reason propagates untouched.
|
|
183
|
+
*/
|
|
184
|
+
signal?: AbortSignal;
|
|
185
|
+
}
|
|
186
|
+
/** Options for the reads of a method's showcases. */
|
|
187
|
+
export interface MethodShowcaseReadOptions {
|
|
188
|
+
/**
|
|
189
|
+
* Caller-driven cancellation, such as an `AbortSignal.timeout(…)` for a page that can do without
|
|
190
|
+
* the showcases; the abort reason propagates untouched.
|
|
191
|
+
*/
|
|
192
|
+
signal?: AbortSignal;
|
|
193
|
+
}
|
|
194
|
+
/** Options for `freezeMethodShowcase` and `withdrawMethodShowcase`. */
|
|
195
|
+
export interface MethodShowcaseWriteOptions {
|
|
196
|
+
/**
|
|
197
|
+
* The write's idempotency key, sent as the `Idempotency-Key` header, and not sent at all when
|
|
198
|
+
* absent or `null`. Generate one per write the caller means to make (a `crypto.randomUUID()` is a
|
|
199
|
+
* good key), and keep it, with the arguments unchanged, across that write's retries.
|
|
200
|
+
*
|
|
201
|
+
* A freeze sent again without a key is safe in itself, since freezing a run already frozen
|
|
202
|
+
* answers `unchanged`. A withdrawal sent again without one answers a `404`, so a withdrawal whose
|
|
203
|
+
* answer was lost, as on a client timeout, reads as a failure: under the same key the hosted API
|
|
204
|
+
* answers the retry with the first write's stored answer and runs nothing. The rest of the rule,
|
|
205
|
+
* a key's form and its `409`s included, is `MethodLayoutWriteOptions.idempotencyKey`'s.
|
|
206
|
+
*/
|
|
207
|
+
idempotencyKey?: string | null;
|
|
208
|
+
}
|
|
209
|
+
/** Options for `setMethodLayoutsOff`. */
|
|
210
|
+
export interface MethodLayoutsOffOptions {
|
|
211
|
+
/**
|
|
212
|
+
* The write's idempotency key, sent as the `Idempotency-Key` header of
|
|
213
|
+
* `PUT /v1/methods/{id}/layouts-off`, and not sent at all when absent or `null`. Generate one per
|
|
214
|
+
* switch the caller means to make (a `crypto.randomUUID()` is a good key), and keep it, with the
|
|
215
|
+
* arguments unchanged, across that write's retries.
|
|
216
|
+
*
|
|
217
|
+
* The write is the whole list, so a write sent again without a key writes that list again, and
|
|
218
|
+
* undoes a switch that landed in between. Under the same key the hosted API answers the retry
|
|
219
|
+
* with the first write's stored answer and runs nothing. The rest of the rule, a key's form and
|
|
220
|
+
* its `409`s included, is `MethodLayoutWriteOptions.idempotencyKey`'s.
|
|
221
|
+
*/
|
|
222
|
+
idempotencyKey?: string | null;
|
|
223
|
+
}
|
|
177
224
|
/** Options for `storeMethodLayout`. */
|
|
178
225
|
export interface MethodLayoutWriteOptions {
|
|
179
226
|
/**
|
|
@@ -317,7 +364,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
317
364
|
* whose errors then say whether it may have (see `RunCreation`).
|
|
318
365
|
* `idempotencyKey`, already checked by `idempotencyKeyOf`, is sent as the
|
|
319
366
|
* `Idempotency-Key` header; only `start`, `copyMethod`, `storeMethodLayout`,
|
|
320
|
-
* `
|
|
367
|
+
* `setMethodLayoutsOff`, `freezeMethodShowcase`, `withdrawMethodShowcase`, `rotateWebhookSecret`
|
|
368
|
+
* and `replayRunWebhookDelivery` pass one.
|
|
321
369
|
*/
|
|
322
370
|
private requestRaw;
|
|
323
371
|
/**
|
|
@@ -347,7 +395,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
347
395
|
private requestProductObject;
|
|
348
396
|
/**
|
|
349
397
|
* A methods-catalog route answering one stored method (`createMethod`, `writeDraft`,
|
|
350
|
-
* `renameMethod`), read as `readObjectAnswer` reads it.
|
|
398
|
+
* `renameMethod`, `setMethodLayoutsOff`), read as `readObjectAnswer` reads it.
|
|
351
399
|
*/
|
|
352
400
|
private requestMethodData;
|
|
353
401
|
/**
|
|
@@ -1347,7 +1395,7 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1347
1395
|
* `refused` with a `reason`, a `message` and the runner's `validation` verdict, whose problem
|
|
1348
1396
|
* items are read member by member as `validate` reads them. The reason is `invalid`, or
|
|
1349
1397
|
* `not_runnable` for a draft that validates with pending signatures, and for a public method
|
|
1350
|
-
* also `thumbnail_missing`, `thumbnail_invalid` or `
|
|
1398
|
+
* also `thumbnail_missing`, `thumbnail_invalid`, `storage_reference` or `showcase_missing` (see
|
|
1351
1399
|
* `MethodPublishRefusalReason`); a reason this SDK does not know is passed through as its raw
|
|
1352
1400
|
* string, still a verdict, so show its `message`. Every arm carries the `method`. A publish
|
|
1353
1401
|
* moves no token.
|
|
@@ -1414,8 +1462,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1414
1462
|
*
|
|
1415
1463
|
* A layout is a data file a producer designed over the version's input-form descriptor, in the
|
|
1416
1464
|
* vocabulary of a catalog of components. The platform stores it beside the method, keyed by the
|
|
1417
|
-
* content it was designed for, and hands it back on every validate
|
|
1418
|
-
* that names `layouts` among its `views` and resolves the same tree
|
|
1465
|
+
* content it was designed for, and hands it back through `listMethodLayouts` and on every validate
|
|
1466
|
+
* of the method by `method_id` that names `layouts` among its `views` and resolves the same tree
|
|
1419
1467
|
* (`PipelexValidationReport.layouts`). It never produces, parses or judges one.
|
|
1420
1468
|
*
|
|
1421
1469
|
* `layout.tree_digest` must be the digest of the tree `version` holds, its
|
|
@@ -1428,12 +1476,13 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1428
1476
|
* (`MethodLayoutWriteOptions`). A content keeps at most 16
|
|
1429
1477
|
* layouts, every pipe, catalog and prompt hash together; past the bound a write removes first what
|
|
1430
1478
|
* newer prompts of the same pipe and catalog superseded (see `docs/method-layouts.md`).
|
|
1479
|
+
* `layout.sample_json` keeps a written sample with the layout, never a run's output.
|
|
1431
1480
|
*
|
|
1432
1481
|
* The write changes the method, so it takes an `admin` or a `member` of the method's
|
|
1433
1482
|
* organization. Takes a bare catalog id, as `getMethod` does, and the version number. Sends the
|
|
1434
1483
|
* members of `MethodLayoutInput` and nothing else, the route's body being closed at both levels,
|
|
1435
|
-
* and leaves out each optional provenance member that is `null` or omitted, for
|
|
1436
|
-
* default. Throws `RequestArgumentError` before any request for a `version` that is not a positive
|
|
1484
|
+
* and leaves out `sample_json` and each optional provenance member that is `null` or omitted, for
|
|
1485
|
+
* the platform's default. Throws `RequestArgumentError` before any request for a `version` that is not a positive
|
|
1437
1486
|
* integer and for a `layout` or a `provenance` that is not an object; every other member is sent
|
|
1438
1487
|
* as given. Throws `ApiResponseError` when the platform refuses the write, which stores nothing:
|
|
1439
1488
|
* `422` `request.invalid` for a member breaking its shape or bound, naming it in `params.field`
|
|
@@ -1452,6 +1501,180 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1452
1501
|
* an `ApiResponseError` too.
|
|
1453
1502
|
*/
|
|
1454
1503
|
storeMethodLayout(methodId: string, version: number, layout: MethodLayoutInput, options?: MethodLayoutWriteOptions): Promise<MethodLayout>;
|
|
1504
|
+
/**
|
|
1505
|
+
* The layouts stored for the content of a published version of a method —
|
|
1506
|
+
* `GET /v1/methods/{id}/versions/{n}/layouts` — newest first, at most 16, `items` empty when none
|
|
1507
|
+
* is stored. It touches only the platform's database and calls no runner, so it costs a host far
|
|
1508
|
+
* less than the `layouts` view of `validate`, which dry-runs every pipe of the method.
|
|
1509
|
+
*
|
|
1510
|
+
* It answers what is stored whatever `layouts_off` says: the switch is the host's to honour.
|
|
1511
|
+
* Another organization's public method reads too, with the layouts its builders stored, and a
|
|
1512
|
+
* `runner` reads what it is shown. Takes a bare catalog id, as `getMethod` does, and the version
|
|
1513
|
+
* number. `options.signal` cancels the read. Throws `RequestArgumentError` for a `version` that is
|
|
1514
|
+
* not a positive integer, before any request.
|
|
1515
|
+
*
|
|
1516
|
+
* Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for an unknown method or another
|
|
1517
|
+
* organization's internal one, its `params.resource` `method`, and for a version the method never
|
|
1518
|
+
* published, its `params.resource` `version`; `409` `pipelex.catalog.being_deleted` while the
|
|
1519
|
+
* erasure of the caller's own method is pending, under way or stopped; `500` `runtime.unexpected`
|
|
1520
|
+
* for a version stored before methods were trees, which names no tree. An answer whose `items` is
|
|
1521
|
+
* not an array is an answer the SDK cannot read, thrown as an `ApiResponseError` too; an entry
|
|
1522
|
+
* that does not read as a layout is left out (`readMethodLayouts`), so one layout it cannot read
|
|
1523
|
+
* never costs the caller the others.
|
|
1524
|
+
*/
|
|
1525
|
+
listMethodLayouts(methodId: string, version: number, options?: MethodLayoutListOptions): Promise<MethodLayoutList>;
|
|
1526
|
+
/**
|
|
1527
|
+
* The layouts stored for the content of a method's draft — `GET /v1/methods/{id}/draft/layouts` —
|
|
1528
|
+
* newest first, `items` empty for an empty draft or a draft none was designed for. A layout is
|
|
1529
|
+
* keyed by its content, so a draft holding a published tree finds that tree's layouts here, and a
|
|
1530
|
+
* builder sees the designs of what it is editing.
|
|
1531
|
+
*
|
|
1532
|
+
* It reads for the organization that holds the method alone, since a draft is its holder's. Takes
|
|
1533
|
+
* a bare catalog id, as `getMethod` does. `options.signal` cancels the read. Throws
|
|
1534
|
+
* `ApiResponseError`: `404` `pipelex.catalog.not_found` for a method the organization does not
|
|
1535
|
+
* hold, another organization's public one included, and `409` `pipelex.catalog.being_deleted`
|
|
1536
|
+
* while its erasure is pending, under way or stopped. An answer whose `items` is not an array is
|
|
1537
|
+
* an answer the SDK cannot read, thrown as an `ApiResponseError` too; an entry that does not read
|
|
1538
|
+
* as a layout is left out (`readMethodLayouts`).
|
|
1539
|
+
*/
|
|
1540
|
+
listMethodDraftLayouts(methodId: string, options?: MethodLayoutListOptions): Promise<MethodLayoutList>;
|
|
1541
|
+
/** The `{items}` of a route answering layouts, each entry read as `readMethodLayouts` reads it. */
|
|
1542
|
+
private requestMethodLayoutList;
|
|
1543
|
+
/**
|
|
1544
|
+
* Freeze a completed run of a method into a showcase — `POST /v1/methods/{id}/showcases` — and
|
|
1545
|
+
* answer what the freeze did.
|
|
1546
|
+
*
|
|
1547
|
+
* A showcase is real output, frozen: the run's inputs, its main output, the forms and contracts
|
|
1548
|
+
* that describe them, and a private copy of every stored file they name. It is keyed by the
|
|
1549
|
+
* digest of the run's tree, so a builder freezes a run of the draft before publishing it, and
|
|
1550
|
+
* another organization reads it only through a published version holding that tree. The run must
|
|
1551
|
+
* be this method's, completed and with stored results, and its tree must be the draft's or the
|
|
1552
|
+
* latest published version's.
|
|
1553
|
+
*
|
|
1554
|
+
* The answer is a `MethodShowcaseFreezeResult`, a `200` discriminated on `outcome` — branch on it:
|
|
1555
|
+
* `frozen` with the new `showcase`; `unchanged` with the one that stands, when this run is already
|
|
1556
|
+
* a showcase, whatever has happened to its tree since, the name in the request being ignored; or
|
|
1557
|
+
* `refused` with a `reason` and a `message`, nothing written (`MethodShowcaseRefusalReason`, read
|
|
1558
|
+
* open, so a later reason arrives as its raw string).
|
|
1559
|
+
*
|
|
1560
|
+
* The write changes the method, so it takes an `admin` or a `member` of the method's organization.
|
|
1561
|
+
* Takes a bare catalog id, as `getMethod` does. Sends `run_id` and `name` and nothing else, the
|
|
1562
|
+
* body being closed. `options.idempotencyKey` is sent as the `Idempotency-Key` header
|
|
1563
|
+
* (`MethodShowcaseWriteOptions`). Throws `RequestArgumentError` before any request for a `run_id`
|
|
1564
|
+
* or a `name` that is not a non-empty string, and for a malformed idempotency key. Throws
|
|
1565
|
+
* `ApiResponseError` when no verdict was produced: `403` `auth.forbidden` for a `runner`; `404`
|
|
1566
|
+
* `pipelex.catalog.not_found` for a method the organization does not hold; `409`
|
|
1567
|
+
* `pipelex.catalog.being_deleted` while its erasure is pending, under way or stopped; `422`
|
|
1568
|
+
* `request.invalid` for a body that does not validate; and `503` `runtime.unavailable`, with
|
|
1569
|
+
* `retry` `yes`, past the freeze's deadline. An answer that is none of the verdict's arms is an
|
|
1570
|
+
* answer the SDK cannot read, thrown as an `ApiResponseError` too.
|
|
1571
|
+
*/
|
|
1572
|
+
freezeMethodShowcase(methodId: string, input: MethodShowcaseInput, options?: MethodShowcaseWriteOptions): Promise<MethodShowcaseFreezeResult>;
|
|
1573
|
+
/**
|
|
1574
|
+
* Withdraw a showcase — `DELETE /v1/methods/{id}/showcases/{showcase_id}`. The platform answers
|
|
1575
|
+
* `204`, the row going first, so every read closes at once, and then its stored document and
|
|
1576
|
+
* files. It runs no check, even on a public method's last showcase, because taking down something
|
|
1577
|
+
* published by mistake is never refused; the method then stays public and its next publish needs
|
|
1578
|
+
* a showcase. What another organization already copied stays theirs.
|
|
1579
|
+
*
|
|
1580
|
+
* `options.idempotencyKey` is sent as the `Idempotency-Key` header, so a withdrawal whose answer
|
|
1581
|
+
* was lost is sent again under the same key and answered as the first was
|
|
1582
|
+
* (`MethodShowcaseWriteOptions`). Throws `RequestArgumentError` before any request for a showcase
|
|
1583
|
+
* id that is empty, `.` or `..`, or holds a lone surrogate, and for a malformed idempotency key.
|
|
1584
|
+
* Throws `ApiResponseError`: `404` `pipelex.catalog.not_found`, its `params.resource` `example`,
|
|
1585
|
+
* when there is no such showcase, one already withdrawn included; `403` `auth.forbidden` for a
|
|
1586
|
+
* `runner`; and `422` `request.invalid` for an id that is not one a showcase can have.
|
|
1587
|
+
*/
|
|
1588
|
+
withdrawMethodShowcase(methodId: string, showcaseId: string, options?: MethodShowcaseWriteOptions): Promise<void>;
|
|
1589
|
+
/**
|
|
1590
|
+
* Every showcase of a method the caller's organization holds, across every tree, each naming its
|
|
1591
|
+
* digest, oldest first — `GET /v1/methods/{id}/showcases`.
|
|
1592
|
+
*
|
|
1593
|
+
* It reads for the holding organization's members alone: another organization reads a `404`,
|
|
1594
|
+
* public method or not, and reads a public method's showcases through
|
|
1595
|
+
* `listMethodVersionShowcases`. Takes a bare catalog id, as `getMethod` does. `options.signal`
|
|
1596
|
+
* cancels the read. Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for a method the
|
|
1597
|
+
* organization does not hold and `409` `pipelex.catalog.being_deleted` while its erasure is
|
|
1598
|
+
* pending, under way or stopped. An answer whose `items` is not an array is an answer the SDK
|
|
1599
|
+
* cannot read, thrown as an `ApiResponseError` too; an entry that does not read as a summary is
|
|
1600
|
+
* left out (`readMethodShowcaseSummaries`).
|
|
1601
|
+
*/
|
|
1602
|
+
listMethodShowcases(methodId: string, options?: MethodShowcaseReadOptions): Promise<MethodShowcaseList>;
|
|
1603
|
+
/**
|
|
1604
|
+
* One showcase of a method the caller's organization holds, in full, with a short-lived link to
|
|
1605
|
+
* each of its files — `GET /v1/methods/{id}/showcases/{showcase_id}`. Read with `parseExactJson`,
|
|
1606
|
+
* so an integer past `Number.MAX_SAFE_INTEGER` in its document is a `bigint`.
|
|
1607
|
+
*
|
|
1608
|
+
* It reads for the holding organization's members alone. Takes a bare catalog id, as `getMethod`
|
|
1609
|
+
* does, and refuses a showcase id as `withdrawMethodShowcase` does, before any request. Throws
|
|
1610
|
+
* `ApiResponseError`: `404` `pipelex.catalog.not_found` for a method the organization does not
|
|
1611
|
+
* hold and for a showcase it does not have, the latter's `params.resource` being `example`, and
|
|
1612
|
+
* `409` `pipelex.catalog.being_deleted` while its erasure is pending, under way or stopped. An
|
|
1613
|
+
* answer that does not read as a detail (`methodShowcaseDetailFault`) is an answer the SDK cannot
|
|
1614
|
+
* read, thrown as an `ApiResponseError` too, its signed links redacted.
|
|
1615
|
+
*/
|
|
1616
|
+
getMethodShowcase(methodId: string, showcaseId: string, options?: MethodShowcaseReadOptions): Promise<MethodShowcaseDetail>;
|
|
1617
|
+
/**
|
|
1618
|
+
* The showcases of the tree a published version holds, oldest first —
|
|
1619
|
+
* `GET /v1/methods/{id}/versions/{n}/showcases` — for every reader of that version, another
|
|
1620
|
+
* organization's on a public method included. `items` is empty when none is frozen. A showcase of
|
|
1621
|
+
* a tree no published version holds is never read through this route.
|
|
1622
|
+
*
|
|
1623
|
+
* Takes a bare catalog id, as `getMethod` does, and the version number. `options.signal` cancels
|
|
1624
|
+
* the read. Throws `RequestArgumentError` for a `version` that is not a positive integer, before
|
|
1625
|
+
* any request. Throws `ApiResponseError`: `404` `pipelex.catalog.not_found` for an unknown method
|
|
1626
|
+
* or another organization's internal one, its `params.resource` `method`, and for a version the
|
|
1627
|
+
* method never published, its `params.resource` `version`; and `409`
|
|
1628
|
+
* `pipelex.catalog.being_deleted` while the erasure of the caller's own method is pending, under
|
|
1629
|
+
* way or stopped. An answer whose `items` is not an array is an answer the SDK cannot read, thrown
|
|
1630
|
+
* as an `ApiResponseError` too; an entry that does not read as a summary is left out.
|
|
1631
|
+
*/
|
|
1632
|
+
listMethodVersionShowcases(methodId: string, version: number, options?: MethodShowcaseReadOptions): Promise<MethodShowcaseList>;
|
|
1633
|
+
/**
|
|
1634
|
+
* One showcase of the tree a published version holds, in full, with a short-lived link to each of
|
|
1635
|
+
* its files — `GET /v1/methods/{id}/versions/{n}/showcases/{showcase_id}`. Read with
|
|
1636
|
+
* `parseExactJson`, so an integer past `Number.MAX_SAFE_INTEGER` in its document is a `bigint`. A
|
|
1637
|
+
* showcase of another tree reads as not found.
|
|
1638
|
+
*
|
|
1639
|
+
* The refusals are `listMethodVersionShowcases`'s, and a showcase that tree does not hold is a
|
|
1640
|
+
* `404` `pipelex.catalog.not_found` whose `params.resource` is `example`. The showcase id is
|
|
1641
|
+
* refused as `withdrawMethodShowcase` refuses it. An answer that does not read as a detail is an
|
|
1642
|
+
* answer the SDK cannot read, thrown as an `ApiResponseError` too, its signed links redacted.
|
|
1643
|
+
*/
|
|
1644
|
+
getMethodVersionShowcase(methodId: string, version: number, showcaseId: string, options?: MethodShowcaseReadOptions): Promise<MethodShowcaseDetail>;
|
|
1645
|
+
/** The `{items}` of a route answering showcase summaries, each read as `readMethodShowcaseSummaries` reads it. */
|
|
1646
|
+
private requestMethodShowcaseList;
|
|
1647
|
+
/** A route answering one showcase in full, its answer read exactly and any error's links redacted. */
|
|
1648
|
+
private requestMethodShowcaseDetail;
|
|
1649
|
+
/**
|
|
1650
|
+
* Set which catalogs of a method have their layouts switched off —
|
|
1651
|
+
* `PUT /v1/methods/{id}/layouts-off` — and return the method, its `layouts_off` the list as held.
|
|
1652
|
+
*
|
|
1653
|
+
* `catalogs` is the whole list and replaces the one held, each catalog id once, at most 8, empty
|
|
1654
|
+
* when every design is on: to change one, read `layouts_off` and write the new list. The switch
|
|
1655
|
+
* acts at once, with no publish, and holds across every publish. A layout switched off is kept,
|
|
1656
|
+
* and `listMethodLayouts` still answers it; a host draws the plain page instead. Like a rename, it
|
|
1657
|
+
* never moves the draft token, so the `updated_at` a caller holds stays valid.
|
|
1658
|
+
*
|
|
1659
|
+
* The last write to land is the one held. `options.idempotencyKey` is sent as the
|
|
1660
|
+
* `Idempotency-Key` header, so a write whose answer was lost is sent again under the same key and
|
|
1661
|
+
* answered as the first was (`MethodLayoutsOffOptions`).
|
|
1662
|
+
*
|
|
1663
|
+
* The write changes the method, so it takes an `admin` or a `member` of the method's
|
|
1664
|
+
* organization. Takes a bare catalog id, as `getMethod` does. Throws `RequestArgumentError` before
|
|
1665
|
+
* any request for `catalogs` that is not an array; its entries are sent as given. Throws
|
|
1666
|
+
* `ApiResponseError`: `404` `pipelex.catalog.not_found` for an unknown method or another
|
|
1667
|
+
* organization's, a public one included; `403` `auth.forbidden` naming the `member` requirement
|
|
1668
|
+
* for a `runner` or a caller with no recognised role; `409` `pipelex.catalog.being_deleted` while
|
|
1669
|
+
* the method's erasure is pending, under way or stopped; `413` `request.too_large` for a list that
|
|
1670
|
+
* would leave the method too large to publish, which a list that does not grow never is; and
|
|
1671
|
+
* `422` `request.invalid` for more than 8 catalogs, a catalog named twice or one that is not a
|
|
1672
|
+
* slug. Under an idempotency key, `409` `request.idempotency_conflict` for the key sent with a
|
|
1673
|
+
* different list and `409` `request.idempotency_key_in_use` while its earlier request is still
|
|
1674
|
+
* being handled; a key that is not 1 to 255 visible ASCII characters is a `RequestArgumentError`
|
|
1675
|
+
* before any request.
|
|
1676
|
+
*/
|
|
1677
|
+
setMethodLayoutsOff(methodId: string, catalogs: readonly string[], options?: MethodLayoutsOffOptions): Promise<MethodData>;
|
|
1455
1678
|
/**
|
|
1456
1679
|
* Copy a method into an organization the caller may change methods in —
|
|
1457
1680
|
* `POST /v1/methods/{id}/copy`: the method's own organization for a duplicate, another team, or
|
|
@@ -1471,7 +1694,8 @@ export declare class PipelexApiClient implements HostedProtocolSurface {
|
|
|
1471
1694
|
* is refused with a `422` `request.invalid` naming it.
|
|
1472
1695
|
*
|
|
1473
1696
|
* The answer is a `MethodCopyResult` discriminated on `outcome` — branch on it: `copied` with
|
|
1474
|
-
* the copy as `method`, `examples_copied` and
|
|
1697
|
+
* the copy as `method`, `examples_copied`, `stored_files_copied` and the counts reserved for
|
|
1698
|
+
* showcases, `showcases_copied` and `layouts_copied`; `refused` with the
|
|
1475
1699
|
* `reason` `bundle_names_other_storage`, a `message` and every `references` entry (`{ path, uri
|
|
1476
1700
|
* }`) a `.mthds` file of the tree holds that the destination cannot read and, in a duplicate,
|
|
1477
1701
|
* that names a file under the original's run files, which erasing the original would remove,
|