@naturali/sdk 0.208.2 → 0.208.3
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/dist/index.cjs +9 -7
- package/dist/index.d.cts +166 -25
- package/dist/index.d.mts +166 -25
- package/dist/index.mjs +9 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4556,7 +4556,7 @@ var Playbooks = class {
|
|
|
4556
4556
|
/**
|
|
4557
4557
|
* Delete a playbook
|
|
4558
4558
|
*
|
|
4559
|
-
* Deletes a playbook and its version archive. A playbook with cases is refused with `409 PLAYBOOK_HAS_CASES`.
|
|
4559
|
+
* Deletes a playbook and its version archive. A playbook with cases is refused with `409 PLAYBOOK_HAS_CASES`, and one another playbook's current definition declares as an upstream with `409 PLAYBOOK_HAS_DEPENDENTS`.
|
|
4560
4560
|
*/
|
|
4561
4561
|
static deletePlaybook(options) {
|
|
4562
4562
|
return (options.client ?? client).delete({
|
|
@@ -4632,7 +4632,7 @@ var Playbooks = class {
|
|
|
4632
4632
|
/**
|
|
4633
4633
|
* Create a case
|
|
4634
4634
|
*
|
|
4635
|
-
* Creates a case for one subject on the playbook's current version. The case stays on that version however the playbook changes later.
|
|
4635
|
+
* Creates a case for one subject on the playbook's current version. The case stays on that version however the playbook changes later. A playbook that declares `upstreams` needs each bound to a case of the declared playbook, in the same project, of the same `actor_id`, that the caller may read (`playbooks:GetPlaybookCase`); anything else is `400 PLAYBOOK_CASE_UPSTREAM_INVALID`. The binding is fixed for the life of the case.
|
|
4636
4636
|
*/
|
|
4637
4637
|
static createPlaybookCase(options) {
|
|
4638
4638
|
return (options.client ?? client).post({
|
|
@@ -4658,7 +4658,7 @@ var Playbooks = class {
|
|
|
4658
4658
|
/**
|
|
4659
4659
|
* Delete a case
|
|
4660
4660
|
*
|
|
4661
|
-
* Deletes a case and every entry written to it.
|
|
4661
|
+
* Deletes a case and every entry written to it. A case other cases are bound to as their upstream is refused with `409 PLAYBOOK_CASE_HAS_DEPENDENTS`.
|
|
4662
4662
|
*/
|
|
4663
4663
|
static deletePlaybookCase(options) {
|
|
4664
4664
|
return (options.client ?? client).delete({
|
|
@@ -4680,7 +4680,7 @@ var Playbooks = class {
|
|
|
4680
4680
|
/**
|
|
4681
4681
|
* Write a case's inputs
|
|
4682
4682
|
*
|
|
4683
|
-
* Writes a batch of manual inputs, all or none. Each write names the revision it read in `expected_revision`, `null` for a field still unset; when any field has moved on the whole batch is refused with `409 PLAYBOOK_INPUT_CONFLICT` and `meta.conflicts` names each field. An input the case's version does not declare, one that reads another node, or a value its schema refuses is `400 PLAYBOOK_INPUT_INVALID`. A value equal to the field's current one writes no revision. Once written, every node the write makes runnable is queued to run, unless the case is paused. With `wait: true` it answers once every execution queued, and every one those queue, has settled or parked. A write made with a credential the case's own work runs as — the case, one of its executions in flight, or the task or run one started — is `403 PLAYBOOK_SELF_WRITE`.
|
|
4683
|
+
* Writes a batch of manual inputs, all or none. Each write names the revision it read in `expected_revision`, `null` for a field still unset; when any field has moved on the whole batch is refused with `409 PLAYBOOK_INPUT_CONFLICT` and `meta.conflicts` names each field. An input the case's version does not declare, one that reads another node, or a value its schema refuses is `400 PLAYBOOK_INPUT_INVALID`. A value equal to the field's current one writes no revision. Once written, every node the write makes runnable is queued to run, unless the case is paused. With `wait: true` it answers once every execution queued, and every one those queue, has settled or parked. A write made with a credential the case's own work runs as — the case, one of its executions in flight, or the task or run one started — or the work of a case reading it as an upstream, at any depth, is `403 PLAYBOOK_SELF_WRITE`.
|
|
4684
4684
|
*/
|
|
4685
4685
|
static writePlaybookCaseInputs(options) {
|
|
4686
4686
|
return (options.client ?? client).post({
|
|
@@ -4695,7 +4695,7 @@ var Playbooks = class {
|
|
|
4695
4695
|
/**
|
|
4696
4696
|
* List what a node still needs
|
|
4697
4697
|
*
|
|
4698
|
-
* Returns the manual inputs still unset, or refused by their schema, upstream of `node_id`, grouped in waves: nothing in a later wave can run before the earlier ones' required inputs are filled. Optional inputs are listed with `required: false`; they never block a node.
|
|
4698
|
+
* Returns the manual inputs still unset, or refused by their schema, upstream of `node_id`, grouped in waves: nothing in a later wave can run before the earlier ones' required inputs are filled. Optional inputs are listed with `required: false`; they never block a node. An `upstream` node before `node_id` adds the missing inputs of the case it is bound to, each with that case's `case_id`, so one read lists everything to ask and each answer is written to its own case.
|
|
4699
4699
|
*/
|
|
4700
4700
|
static getPlaybookCaseMissing(options) {
|
|
4701
4701
|
return (options.client ?? client).get({
|
|
@@ -4719,6 +4719,8 @@ var Playbooks = class {
|
|
|
4719
4719
|
*
|
|
4720
4720
|
* Runs one node now. The cascade already runs every node whose inputs are set once a write, a settle or a resume makes it runnable, and never reruns a `failed` or `done` one: this is how a failed node is retried, and how a `done` node is recomputed after an upgrade changed its executor. A `collect` node takes its own input values as its output, any other node starts its executor with the node's input values mapped through the executor's `input`. The executor runs as the author of the case's playbook version, whose permission to start it is checked again here (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`); an author that no longer exists is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`. Only a `ready`, `stale`, `failed` or `done` node with every required input set runs; anything else is `409 PLAYBOOK_NODE_NOT_RUNNABLE`. A paused case is `409 PLAYBOOK_CASE_PAUSED`, and a case in a paused project `409 PROJECT_PAUSED`.
|
|
4721
4721
|
*
|
|
4722
|
+
* An `upstream` node has no executor: running it pulls the current output of the node it names in the bound case, which must be `done`. This is the only way to refresh one that an upstream change left `stale`.
|
|
4723
|
+
*
|
|
4722
4724
|
* The output is written as an entry when the execution settles. A value equal to the node's current output writes no revision. If the node's inputs change while it runs, the execution settles as `superseded` and writes nothing.
|
|
4723
4725
|
*
|
|
4724
4726
|
* Without `wait` the execution answers `running` and settles in the background. With `wait: true` it answers once the executor settles, or once it parks: a workflow task still open, or an orchestration run waiting on a person or a timer, settles the node when it closes or ends.
|
|
@@ -4801,7 +4803,7 @@ var Playbooks = class {
|
|
|
4801
4803
|
*
|
|
4802
4804
|
* Moves a case to another version of its playbook: the playbook's current version, or the `version` named, an earlier one included. Values carry over by node ID, and every node's state is read against the new version: a node added is open, a node removed leaves the structure while its entries stay, a node whose input reads another field is `stale`, and a value its input's new schema refuses is missing again. The cascade then runs what became runnable. With `wait: true` it answers once every execution queued, and every one those queue, has settled or parked. Each upgrade is recorded with what moved; the version the case is already on records nothing.
|
|
4803
4805
|
*
|
|
4804
|
-
* An execution running is `409 PLAYBOOK_CASE_BUSY`; one queued but not started settles `superseded`. An upgrade made with a credential the case's own work runs as is `403 PLAYBOOK_SELF_WRITE`.
|
|
4806
|
+
* An execution running is `409 PLAYBOOK_CASE_BUSY`; one queued but not started settles `superseded`. An upgrade made with a credential the case's own work, or that of a case reading it as an upstream, runs as is `403 PLAYBOOK_SELF_WRITE`.
|
|
4805
4807
|
*/
|
|
4806
4808
|
static upgradePlaybookCase(options) {
|
|
4807
4809
|
return (options.client ?? client).post({
|
|
@@ -4851,7 +4853,7 @@ var Playbooks = class {
|
|
|
4851
4853
|
*
|
|
4852
4854
|
* Approves or rejects a `confirm` node on the inputs the confirmer read. `expected_revisions` names the revision of each of the node's inputs as read (`nodes[].inputs[].revision` on the case); an input that moved since is `409 PLAYBOOK_INPUT_CONFLICT`, `meta.conflicts` naming each, and nothing is written.
|
|
4853
4855
|
*
|
|
4854
|
-
* An approval writes a `confirmation` entry whose value is the node's input values: it is the node's output, and the nodes reading it run next. With `wait: true` it answers once every execution queued, and every one those queue, has settled or parked. A rejection writes a `rejection` entry with the `reason`: the node is `rejected`, and every node reading it is blocked, until its inputs change or it is approved. Another node, or a `confirm` node with a required input unset or reading a node that is not `done`, is `409 PLAYBOOK_NODE_NOT_CONFIRMABLE`. A confirmation made with a credential the case's own work runs as is `403 PLAYBOOK_SELF_WRITE`.
|
|
4856
|
+
* An approval writes a `confirmation` entry whose value is the node's input values: it is the node's output, and the nodes reading it run next. With `wait: true` it answers once every execution queued, and every one those queue, has settled or parked. A rejection writes a `rejection` entry with the `reason`: the node is `rejected`, and every node reading it is blocked, until its inputs change or it is approved. Another node, or a `confirm` node with a required input unset or reading a node that is not `done`, is `409 PLAYBOOK_NODE_NOT_CONFIRMABLE`. A confirmation made with a credential the case's own work, or that of a case reading it as an upstream, runs as is `403 PLAYBOOK_SELF_WRITE`.
|
|
4855
4857
|
*/
|
|
4856
4858
|
static confirmPlaybookCaseNode(options) {
|
|
4857
4859
|
return (options.client ?? client).post({
|