@naturali/sdk 0.34.2 → 0.36.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/dist/index.cjs +176 -0
- package/dist/index.d.cts +985 -42
- package/dist/index.d.mts +985 -42
- package/dist/index.mjs +175 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -824,6 +824,76 @@ var Auth = class {
|
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
826
|
};
|
|
827
|
+
var Boards = class {
|
|
828
|
+
/**
|
|
829
|
+
* List boards
|
|
830
|
+
*
|
|
831
|
+
* Lists the boards defined in the project, newest first.
|
|
832
|
+
*/
|
|
833
|
+
static listBoards(options) {
|
|
834
|
+
return (options.client ?? client).get({
|
|
835
|
+
url: "/v1/projects/{project_id}/boards",
|
|
836
|
+
...options
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Create a board
|
|
841
|
+
*
|
|
842
|
+
* Define a board's columns and moves. Exactly one column must be `initial: true`; any number may be `terminal: true` (a card closes when it enters one). Every agent or tool a column dispatches must belong to this project, and every move a column routes to must be declared in `transitions`.
|
|
843
|
+
*
|
|
844
|
+
*/
|
|
845
|
+
static createBoard(options) {
|
|
846
|
+
return (options.client ?? client).post({
|
|
847
|
+
url: "/v1/projects/{project_id}/boards",
|
|
848
|
+
...options,
|
|
849
|
+
headers: {
|
|
850
|
+
"Content-Type": "application/json",
|
|
851
|
+
...options.headers
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Delete a board
|
|
857
|
+
*
|
|
858
|
+
* Refused while the board still has open cards (409 `board_has_open_tasks`) — close or delete them first. Deleting a board whose cards are all closed removes those cards and their transition history along with it.
|
|
859
|
+
*
|
|
860
|
+
*/
|
|
861
|
+
static deleteBoard(options) {
|
|
862
|
+
return (options.client ?? client).delete({
|
|
863
|
+
url: "/v1/projects/{project_id}/boards/{board_id}",
|
|
864
|
+
...options
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Get a board
|
|
869
|
+
*
|
|
870
|
+
* The board's current definition — the source of truth for which columns exist and which moves are legal from each, so a UI renders its columns and its buttons from this response.
|
|
871
|
+
*
|
|
872
|
+
*/
|
|
873
|
+
static getBoard(options) {
|
|
874
|
+
return (options.client ?? client).get({
|
|
875
|
+
url: "/v1/projects/{project_id}/boards/{board_id}",
|
|
876
|
+
...options
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Update a board
|
|
881
|
+
*
|
|
882
|
+
* Change the name, description, `payload_schema`, or the definition itself. `states` and `transitions` are edited together or not at all — a column routes to a move and a move names columns, so validating one against a stale copy of the other would accept a definition that cannot route. At least one field is required.
|
|
883
|
+
* Cards already on the board are not moved. A card sitting in a column the new definition drops stays where it is and can only leave through a move the new definition declares: the definition is the sole authority at the moment a move is fired.
|
|
884
|
+
*
|
|
885
|
+
*/
|
|
886
|
+
static updateBoard(options) {
|
|
887
|
+
return (options.client ?? client).patch({
|
|
888
|
+
url: "/v1/projects/{project_id}/boards/{board_id}",
|
|
889
|
+
...options,
|
|
890
|
+
headers: {
|
|
891
|
+
"Content-Type": "application/json",
|
|
892
|
+
...options.headers
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
};
|
|
827
897
|
var Channels = class {
|
|
828
898
|
/**
|
|
829
899
|
* List channels
|
|
@@ -1531,6 +1601,106 @@ var Sessions = class {
|
|
|
1531
1601
|
});
|
|
1532
1602
|
}
|
|
1533
1603
|
};
|
|
1604
|
+
var Tasks = class {
|
|
1605
|
+
/**
|
|
1606
|
+
* List tasks
|
|
1607
|
+
*
|
|
1608
|
+
* The board query. Filter by `board_id` for one board, add `state` for one column, or use `status` / `assignee` across boards.
|
|
1609
|
+
*
|
|
1610
|
+
*/
|
|
1611
|
+
static listTasks(options) {
|
|
1612
|
+
return (options.client ?? client).get({
|
|
1613
|
+
url: "/v1/projects/{project_id}/tasks",
|
|
1614
|
+
...options
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Create a task
|
|
1619
|
+
*
|
|
1620
|
+
* Put a card on a board. It lands in the board's initial column and that column's automation fires — so a board whose first column dispatches an agent starts working on this call and keeps going, unattended, until a column needs a person.
|
|
1621
|
+
*
|
|
1622
|
+
*/
|
|
1623
|
+
static createTask(options) {
|
|
1624
|
+
return (options.client ?? client).post({
|
|
1625
|
+
url: "/v1/projects/{project_id}/tasks",
|
|
1626
|
+
...options,
|
|
1627
|
+
headers: {
|
|
1628
|
+
"Content-Type": "application/json",
|
|
1629
|
+
...options.headers
|
|
1630
|
+
}
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1633
|
+
/**
|
|
1634
|
+
* Delete a task
|
|
1635
|
+
*
|
|
1636
|
+
* Removes the card and its transition history. Distinct from closing it: a card that reaches a terminal column closes and keeps its audit trail.
|
|
1637
|
+
*
|
|
1638
|
+
*/
|
|
1639
|
+
static deleteTask(options) {
|
|
1640
|
+
return (options.client ?? client).delete({
|
|
1641
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}",
|
|
1642
|
+
...options
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Get a task
|
|
1647
|
+
*
|
|
1648
|
+
* One card, including its automation status and in-flight dispatch.
|
|
1649
|
+
*/
|
|
1650
|
+
static getTask(options) {
|
|
1651
|
+
return (options.client ?? client).get({
|
|
1652
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}",
|
|
1653
|
+
...options
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* Update a task
|
|
1658
|
+
*
|
|
1659
|
+
* Edit the card's `title`, `assignee` or `payload`. At least one is required.
|
|
1660
|
+
* `payload` is **shallow-merged** over what is there: keys the request omits are preserved, so setting one field never discards what a column's automation wrote (`payload.last_result`). The merged result is validated against the board's `payload_schema`.
|
|
1661
|
+
* `state` and `board_id` are rejected — a card moves only through `:transition`, and it never changes boards.
|
|
1662
|
+
*
|
|
1663
|
+
*/
|
|
1664
|
+
static updateTask(options) {
|
|
1665
|
+
return (options.client ?? client).patch({
|
|
1666
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}",
|
|
1667
|
+
...options,
|
|
1668
|
+
headers: {
|
|
1669
|
+
"Content-Type": "application/json",
|
|
1670
|
+
...options.headers
|
|
1671
|
+
}
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* Move a task
|
|
1676
|
+
*
|
|
1677
|
+
* Fire a named move on the card — the single path every state change takes. The move must be declared on the board and valid from the card's current column; the board's definition is what a UI renders its buttons from.
|
|
1678
|
+
* Naming a move that does not exist, one that is not legal from this column, or any move at all on a closed card all answer 409 `task_transition_conflict`: it is a conflict with the card's state rather than a malformed request — the same body succeeds one column earlier.
|
|
1679
|
+
*
|
|
1680
|
+
*/
|
|
1681
|
+
static transitionTask(options) {
|
|
1682
|
+
return (options.client ?? client).post({
|
|
1683
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}:transition",
|
|
1684
|
+
...options,
|
|
1685
|
+
headers: {
|
|
1686
|
+
"Content-Type": "application/json",
|
|
1687
|
+
...options.headers
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* List the task's moves
|
|
1693
|
+
*
|
|
1694
|
+
* The card's append-only history, oldest first: every move it made, what kind of actor made it, and what caused it. Returned whole — `next_cursor` is always null.
|
|
1695
|
+
*
|
|
1696
|
+
*/
|
|
1697
|
+
static listTaskTransitions(options) {
|
|
1698
|
+
return (options.client ?? client).get({
|
|
1699
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/transitions",
|
|
1700
|
+
...options
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1534
1704
|
var Tools = class {
|
|
1535
1705
|
/**
|
|
1536
1706
|
* List tools
|
|
@@ -1697,6 +1867,7 @@ var NaturaliClient = class {
|
|
|
1697
1867
|
agents;
|
|
1698
1868
|
apiKeys;
|
|
1699
1869
|
auth;
|
|
1870
|
+
boards;
|
|
1700
1871
|
channels;
|
|
1701
1872
|
contacts;
|
|
1702
1873
|
generations;
|
|
@@ -1705,6 +1876,7 @@ var NaturaliClient = class {
|
|
|
1705
1876
|
projects;
|
|
1706
1877
|
providers;
|
|
1707
1878
|
sessions;
|
|
1879
|
+
tasks;
|
|
1708
1880
|
tools;
|
|
1709
1881
|
traces;
|
|
1710
1882
|
/** The underlying HTTP client, for interceptors or one-off requests. */
|
|
@@ -1720,6 +1892,7 @@ var NaturaliClient = class {
|
|
|
1720
1892
|
this.agents = bindResource(Agents, this.http);
|
|
1721
1893
|
this.apiKeys = bindResource(ApiKeys, this.http);
|
|
1722
1894
|
this.auth = bindResource(Auth, this.http);
|
|
1895
|
+
this.boards = bindResource(Boards, this.http);
|
|
1723
1896
|
this.channels = bindResource(Channels, this.http);
|
|
1724
1897
|
this.contacts = bindResource(Contacts, this.http);
|
|
1725
1898
|
this.generations = bindResource(Generations, this.http);
|
|
@@ -1728,9 +1901,10 @@ var NaturaliClient = class {
|
|
|
1728
1901
|
this.projects = bindResource(Projects, this.http);
|
|
1729
1902
|
this.providers = bindResource(Providers, this.http);
|
|
1730
1903
|
this.sessions = bindResource(Sessions, this.http);
|
|
1904
|
+
this.tasks = bindResource(Tasks, this.http);
|
|
1731
1905
|
this.tools = bindResource(Tools, this.http);
|
|
1732
1906
|
this.traces = bindResource(Traces, this.http);
|
|
1733
1907
|
}
|
|
1734
1908
|
};
|
|
1735
1909
|
//#endregion
|
|
1736
|
-
export { Agents, ApiKeys, Auth, Channels, Contacts, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tools, Traces, createClient, createConfig };
|
|
1910
|
+
export { Agents, ApiKeys, Auth, Boards, Channels, Contacts, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tasks, Tools, Traces, createClient, createConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"tsx": "^4.23.1",
|
|
38
38
|
"typescript": "~6.0.3",
|
|
39
39
|
"vitest": "^4.1.10",
|
|
40
|
-
"@naturali/api": "0.
|
|
40
|
+
"@naturali/api": "0.36.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|