@arbidocs/sdk 0.5.81 → 0.5.83
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 +12 -0
- package/dist/{browser-CP0e4GnL.d.cts → browser-4oIgAqs1.d.cts} +96 -40
- package/dist/{browser-xgwYmWyv.d.ts → browser-CL-6Y6E1.d.ts} +96 -40
- package/dist/browser.cjs +181 -62
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +181 -62
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +181 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +181 -62
- package/dist/index.js.map +1 -1
- package/examples/human-review/package.json +1 -1
- package/examples/react-chat/package.json +2 -2
- package/package.json +2 -2
package/dist/browser.cjs
CHANGED
|
@@ -3640,6 +3640,21 @@ function requireData(result, message) {
|
|
|
3640
3640
|
}
|
|
3641
3641
|
return result.data;
|
|
3642
3642
|
}
|
|
3643
|
+
var WORKSPACE_REQUEST_CONFLICT_MESSAGES = {
|
|
3644
|
+
workspace_mismatch: "This belongs to another workspace, so nothing was saved.",
|
|
3645
|
+
workspace_key_required: "This workspace isn't unlocked in this session, so nothing was saved or read. Open the workspace and try again."
|
|
3646
|
+
};
|
|
3647
|
+
function requireWorkspaceData(result, message, conflicts = WORKSPACE_REQUEST_CONFLICT_MESSAGES) {
|
|
3648
|
+
const status = result.response?.status;
|
|
3649
|
+
const conflict = result.error && status === 409 ? workspaceConflictOf(result.error) : null;
|
|
3650
|
+
if (conflict) {
|
|
3651
|
+
throw new ArbiApiError(conflicts[conflict.code], result.error, status, {
|
|
3652
|
+
code: conflict.code,
|
|
3653
|
+
requestId: result.response?.headers?.get("x-request-id") ?? void 0
|
|
3654
|
+
});
|
|
3655
|
+
}
|
|
3656
|
+
return requireData(result, message);
|
|
3657
|
+
}
|
|
3643
3658
|
function requireOk(result, message) {
|
|
3644
3659
|
if (result.error) {
|
|
3645
3660
|
throw new ArbiApiError(message, result.error, result.response?.status, {
|
|
@@ -5711,19 +5726,7 @@ var UPLOAD_WORKSPACE_CONFLICT_MESSAGES = {
|
|
|
5711
5726
|
workspace_key_required: "The workspace couldn't be unlocked for this upload, so the files were not saved."
|
|
5712
5727
|
};
|
|
5713
5728
|
function requireUploadData(result, message) {
|
|
5714
|
-
|
|
5715
|
-
const conflict = result.error && status === 409 ? workspaceConflictOf(result.error) : null;
|
|
5716
|
-
if (conflict) {
|
|
5717
|
-
throw new ArbiApiError(
|
|
5718
|
-
UPLOAD_WORKSPACE_CONFLICT_MESSAGES[conflict.code],
|
|
5719
|
-
result.error,
|
|
5720
|
-
status,
|
|
5721
|
-
{
|
|
5722
|
-
code: conflict.code
|
|
5723
|
-
}
|
|
5724
|
-
);
|
|
5725
|
-
}
|
|
5726
|
-
return requireData(result, message);
|
|
5729
|
+
return requireWorkspaceData(result, message, UPLOAD_WORKSPACE_CONFLICT_MESSAGES);
|
|
5727
5730
|
}
|
|
5728
5731
|
async function uploadDocuments(arbi, files, options = {}) {
|
|
5729
5732
|
const query2 = {};
|
|
@@ -6618,15 +6621,27 @@ __export(conversations_exports, {
|
|
|
6618
6621
|
searchConversations: () => searchConversations,
|
|
6619
6622
|
updateConversationAssistantMode: () => updateConversationAssistantMode
|
|
6620
6623
|
});
|
|
6621
|
-
|
|
6622
|
-
|
|
6624
|
+
|
|
6625
|
+
// src/operations/workspace-query.ts
|
|
6626
|
+
var workspaceQuery = (workspaceExtId) => workspaceExtId ? { workspace_ext_id: workspaceExtId } : {};
|
|
6627
|
+
|
|
6628
|
+
// src/operations/conversations.ts
|
|
6629
|
+
async function listConversations(arbi, workspaceExtId) {
|
|
6630
|
+
return requireWorkspaceData(
|
|
6631
|
+
await arbi.fetch.GET("/v1/conversation/list", {
|
|
6632
|
+
params: { query: workspaceQuery(workspaceExtId) }
|
|
6633
|
+
}),
|
|
6634
|
+
"Failed to fetch conversations"
|
|
6635
|
+
);
|
|
6623
6636
|
}
|
|
6624
|
-
async function importConversations(auth, fileData, fileName, source = "auto") {
|
|
6637
|
+
async function importConversations(auth, fileData, fileName, source = "auto", workspaceExtId) {
|
|
6625
6638
|
const formData = new FormData();
|
|
6626
6639
|
formData.append("file", fileData, fileName);
|
|
6640
|
+
const query2 = new URLSearchParams({ source });
|
|
6641
|
+
if (workspaceExtId) query2.set("workspace_ext_id", workspaceExtId);
|
|
6627
6642
|
const res = await authenticatedFetch({
|
|
6628
6643
|
...auth,
|
|
6629
|
-
path: `/v1/conversation/import
|
|
6644
|
+
path: `/v1/conversation/import?${query2}`,
|
|
6630
6645
|
method: "POST",
|
|
6631
6646
|
body: formData
|
|
6632
6647
|
});
|
|
@@ -6648,9 +6663,12 @@ async function deleteConversation(arbi, conversationId) {
|
|
|
6648
6663
|
"Failed to delete conversation"
|
|
6649
6664
|
);
|
|
6650
6665
|
}
|
|
6651
|
-
async function searchConversations(arbi, body) {
|
|
6652
|
-
return
|
|
6653
|
-
await arbi.fetch.POST("/v1/conversation/search", {
|
|
6666
|
+
async function searchConversations(arbi, body, workspaceExtId) {
|
|
6667
|
+
return requireWorkspaceData(
|
|
6668
|
+
await arbi.fetch.POST("/v1/conversation/search", {
|
|
6669
|
+
params: { query: workspaceQuery(workspaceExtId) },
|
|
6670
|
+
body
|
|
6671
|
+
}),
|
|
6654
6672
|
"Failed to search conversations"
|
|
6655
6673
|
);
|
|
6656
6674
|
}
|
|
@@ -7013,9 +7031,14 @@ async function interject(arbi, assistantMessageExtId, answer) {
|
|
|
7013
7031
|
);
|
|
7014
7032
|
}
|
|
7015
7033
|
async function listSkills(arbi, options) {
|
|
7016
|
-
const result =
|
|
7034
|
+
const result = requireWorkspaceData(
|
|
7017
7035
|
await arbi.fetch.GET("/v1/assistant/skills", {
|
|
7018
|
-
params: {
|
|
7036
|
+
params: {
|
|
7037
|
+
query: {
|
|
7038
|
+
include_hidden: options?.includeHidden ?? false,
|
|
7039
|
+
...workspaceQuery(options?.workspaceExtId)
|
|
7040
|
+
}
|
|
7041
|
+
}
|
|
7019
7042
|
}),
|
|
7020
7043
|
"Failed to list skills"
|
|
7021
7044
|
);
|
|
@@ -8491,9 +8514,10 @@ __export(files_exports, {
|
|
|
8491
8514
|
uploadFile: () => uploadFile2
|
|
8492
8515
|
});
|
|
8493
8516
|
async function listFiles(arbi, options) {
|
|
8494
|
-
|
|
8517
|
+
const { workspaceExtId, ...query2 } = options ?? {};
|
|
8518
|
+
return requireWorkspaceData(
|
|
8495
8519
|
await arbi.fetch.GET("/v1/files", {
|
|
8496
|
-
params: { query:
|
|
8520
|
+
params: { query: { ...query2, ...workspaceQuery(workspaceExtId) } }
|
|
8497
8521
|
}),
|
|
8498
8522
|
"Failed to list files"
|
|
8499
8523
|
);
|
|
@@ -8514,13 +8538,13 @@ async function deleteFile(arbi, fileId) {
|
|
|
8514
8538
|
"Failed to delete file"
|
|
8515
8539
|
);
|
|
8516
8540
|
}
|
|
8517
|
-
async function uploadFile2(auth, fileData, fileName, purpose = "assistants") {
|
|
8541
|
+
async function uploadFile2(auth, fileData, fileName, purpose = "assistants", workspaceExtId) {
|
|
8518
8542
|
const formData = new FormData();
|
|
8519
8543
|
formData.append("file", fileData, fileName);
|
|
8520
8544
|
formData.append("purpose", purpose);
|
|
8521
8545
|
const res = await authenticatedFetch({
|
|
8522
8546
|
...auth,
|
|
8523
|
-
path: "/v1/files",
|
|
8547
|
+
path: workspaceExtId ? `/v1/files?workspace_ext_id=${encodeURIComponent(workspaceExtId)}` : "/v1/files",
|
|
8524
8548
|
method: "POST",
|
|
8525
8549
|
body: formData
|
|
8526
8550
|
});
|
|
@@ -9597,22 +9621,31 @@ function stepsPlan(steps) {
|
|
|
9597
9621
|
}
|
|
9598
9622
|
|
|
9599
9623
|
// src/operations/work.ts
|
|
9624
|
+
var TASK_WORKSPACE_CONFLICT_MESSAGES = {
|
|
9625
|
+
...WORKSPACE_REQUEST_CONFLICT_MESSAGES,
|
|
9626
|
+
workspace_mismatch: "The parent task is in another workspace, so the task was not saved. Choose a parent in the same workspace."
|
|
9627
|
+
};
|
|
9600
9628
|
var byId = (conversationId) => ({
|
|
9601
9629
|
params: { path: { conversation_ext_id: conversationId } }
|
|
9602
9630
|
});
|
|
9603
9631
|
async function updateConversation(arbi, conversationId, body) {
|
|
9604
|
-
return
|
|
9632
|
+
return requireWorkspaceData(
|
|
9605
9633
|
await arbi.fetch.PATCH("/v1/conversation/{conversation_ext_id}", {
|
|
9606
9634
|
...byId(conversationId),
|
|
9607
9635
|
body
|
|
9608
9636
|
}),
|
|
9609
|
-
"Failed to update conversation"
|
|
9637
|
+
"Failed to update conversation",
|
|
9638
|
+
TASK_WORKSPACE_CONFLICT_MESSAGES
|
|
9610
9639
|
);
|
|
9611
9640
|
}
|
|
9612
|
-
async function createWork(arbi, body) {
|
|
9613
|
-
return
|
|
9614
|
-
await arbi.fetch.POST("/v1/conversation/work", {
|
|
9615
|
-
|
|
9641
|
+
async function createWork(arbi, body, workspaceExtId) {
|
|
9642
|
+
return requireWorkspaceData(
|
|
9643
|
+
await arbi.fetch.POST("/v1/conversation/work", {
|
|
9644
|
+
params: { query: workspaceQuery(workspaceExtId) },
|
|
9645
|
+
body
|
|
9646
|
+
}),
|
|
9647
|
+
"Failed to create task",
|
|
9648
|
+
TASK_WORKSPACE_CONFLICT_MESSAGES
|
|
9616
9649
|
);
|
|
9617
9650
|
}
|
|
9618
9651
|
async function runConversation(arbi, conversationId) {
|
|
@@ -9678,9 +9711,12 @@ async function getActivity(arbi, conversationId) {
|
|
|
9678
9711
|
"Failed to read the task activity"
|
|
9679
9712
|
);
|
|
9680
9713
|
}
|
|
9681
|
-
async function planWork(arbi, body) {
|
|
9682
|
-
return
|
|
9683
|
-
await arbi.fetch.POST("/v1/conversation/work/plan", {
|
|
9714
|
+
async function planWork(arbi, body, workspaceExtId) {
|
|
9715
|
+
return requireWorkspaceData(
|
|
9716
|
+
await arbi.fetch.POST("/v1/conversation/work/plan", {
|
|
9717
|
+
params: { query: workspaceQuery(workspaceExtId) },
|
|
9718
|
+
body
|
|
9719
|
+
}),
|
|
9684
9720
|
"Failed to draft a plan"
|
|
9685
9721
|
);
|
|
9686
9722
|
}
|
|
@@ -9800,14 +9836,26 @@ __export(facts_exports, {
|
|
|
9800
9836
|
searchFacts: () => searchFacts,
|
|
9801
9837
|
updateFact: () => updateFact
|
|
9802
9838
|
});
|
|
9803
|
-
async function createFact(arbi, body) {
|
|
9804
|
-
return
|
|
9839
|
+
async function createFact(arbi, body, workspaceExtId) {
|
|
9840
|
+
return requireWorkspaceData(
|
|
9841
|
+
await arbi.fetch.POST("/v1/facts/", {
|
|
9842
|
+
params: { query: workspaceQuery(workspaceExtId) },
|
|
9843
|
+
body
|
|
9844
|
+
}),
|
|
9845
|
+
"Failed to create note"
|
|
9846
|
+
);
|
|
9805
9847
|
}
|
|
9806
|
-
async function createFactsBatch(arbi, body) {
|
|
9807
|
-
return
|
|
9848
|
+
async function createFactsBatch(arbi, body, workspaceExtId) {
|
|
9849
|
+
return requireWorkspaceData(
|
|
9850
|
+
await arbi.fetch.POST("/v1/facts/batch", {
|
|
9851
|
+
params: { query: workspaceQuery(workspaceExtId) },
|
|
9852
|
+
body
|
|
9853
|
+
}),
|
|
9854
|
+
"Failed to create notes"
|
|
9855
|
+
);
|
|
9808
9856
|
}
|
|
9809
9857
|
async function listFacts(arbi, options) {
|
|
9810
|
-
return
|
|
9858
|
+
return requireWorkspaceData(
|
|
9811
9859
|
await arbi.fetch.GET("/v1/facts/list", {
|
|
9812
9860
|
params: {
|
|
9813
9861
|
query: {
|
|
@@ -9817,18 +9865,25 @@ async function listFacts(arbi, options) {
|
|
|
9817
9865
|
tag_ext_id: options?.tagExtIds,
|
|
9818
9866
|
doc_ext_id: options?.docExtId,
|
|
9819
9867
|
limit: options?.limit,
|
|
9820
|
-
offset: options?.offset
|
|
9868
|
+
offset: options?.offset,
|
|
9869
|
+
...workspaceQuery(options?.workspaceExtId)
|
|
9821
9870
|
}
|
|
9822
9871
|
}
|
|
9823
9872
|
}),
|
|
9824
9873
|
"Failed to list notes"
|
|
9825
9874
|
);
|
|
9826
9875
|
}
|
|
9827
|
-
async function searchFacts(arbi, body) {
|
|
9828
|
-
return
|
|
9876
|
+
async function searchFacts(arbi, body, workspaceExtId) {
|
|
9877
|
+
return requireWorkspaceData(
|
|
9878
|
+
await arbi.fetch.POST("/v1/facts/search", {
|
|
9879
|
+
params: { query: workspaceQuery(workspaceExtId) },
|
|
9880
|
+
body
|
|
9881
|
+
}),
|
|
9882
|
+
"Failed to search notes"
|
|
9883
|
+
);
|
|
9829
9884
|
}
|
|
9830
9885
|
async function updateFact(arbi, factId, body) {
|
|
9831
|
-
return
|
|
9886
|
+
return requireWorkspaceData(
|
|
9832
9887
|
await arbi.fetch.PATCH("/v1/facts/{fact_ext_id}", {
|
|
9833
9888
|
params: { path: { fact_ext_id: factId } },
|
|
9834
9889
|
body
|
|
@@ -9843,7 +9898,7 @@ async function deleteFact(arbi, factId) {
|
|
|
9843
9898
|
if (error) throw new Error("Failed to delete note");
|
|
9844
9899
|
}
|
|
9845
9900
|
async function remindFact(arbi, factId, options = {}) {
|
|
9846
|
-
return
|
|
9901
|
+
return requireWorkspaceData(
|
|
9847
9902
|
await arbi.fetch.POST("/v1/facts/{fact_ext_id}/remind", {
|
|
9848
9903
|
params: { path: { fact_ext_id: factId } },
|
|
9849
9904
|
body: {
|
|
@@ -12282,11 +12337,22 @@ var Arbi = class {
|
|
|
12282
12337
|
};
|
|
12283
12338
|
// ── Conversations ─────────────────────────────────────────────────────
|
|
12284
12339
|
conversations = {
|
|
12285
|
-
|
|
12340
|
+
/** The current workspace's conversations, or `options.workspaceId`'s (opened, not switched to). */
|
|
12341
|
+
list: async (options) => listConversations(
|
|
12342
|
+
this.requireClient(),
|
|
12343
|
+
await this.requireTargetWorkspace(options?.workspaceId)
|
|
12344
|
+
),
|
|
12286
12345
|
getThreads: (conversationId) => getConversationThreads(this.requireClient(), conversationId),
|
|
12287
12346
|
delete: (conversationId) => deleteConversation(this.requireClient(), conversationId),
|
|
12288
|
-
/**
|
|
12289
|
-
|
|
12347
|
+
/**
|
|
12348
|
+
* Search the past conversation messages (keyword + semantic, grouped) of the current
|
|
12349
|
+
* workspace, or `options.workspaceId` (opened for this session, not switched to).
|
|
12350
|
+
*/
|
|
12351
|
+
search: async (body, options) => searchConversations(
|
|
12352
|
+
this.requireClient(),
|
|
12353
|
+
body,
|
|
12354
|
+
await this.requireTargetWorkspace(options?.workspaceId)
|
|
12355
|
+
),
|
|
12290
12356
|
/**
|
|
12291
12357
|
* Patch a conversation: `title`, `shared` (owner only), its bound document
|
|
12292
12358
|
* (`bound_document_ext_id`, `null` unbinds), and the work fields (`description`, `due_at`,
|
|
@@ -12294,8 +12360,16 @@ var Arbi = class {
|
|
|
12294
12360
|
* and attaching a thread to a document.
|
|
12295
12361
|
*/
|
|
12296
12362
|
update: (conversationId, body) => updateConversation(this.requireClient(), conversationId, body),
|
|
12297
|
-
/**
|
|
12298
|
-
|
|
12363
|
+
/**
|
|
12364
|
+
* Create a work item: a plain to-do, or (with a prompt / skill) agent work that starts now. It
|
|
12365
|
+
* is made in the current workspace, or `options.workspaceId` (opened, not switched to), which
|
|
12366
|
+
* the request names: a switch while it is sent cannot move it.
|
|
12367
|
+
*/
|
|
12368
|
+
createWork: async (body, options) => createWork(
|
|
12369
|
+
this.requireClient(),
|
|
12370
|
+
body,
|
|
12371
|
+
await this.requireTargetWorkspace(options?.workspaceId)
|
|
12372
|
+
),
|
|
12299
12373
|
/** Run a work item now, or retry it. */
|
|
12300
12374
|
run: (conversationId) => runConversation(this.requireClient(), conversationId),
|
|
12301
12375
|
/** The session key an unattended run waits for the owner to allow; 404 when nothing waits. */
|
|
@@ -12316,8 +12390,12 @@ var Arbi = class {
|
|
|
12316
12390
|
usage: (conversationId) => getConversationUsage(this.requireClient(), conversationId),
|
|
12317
12391
|
/** Notify people about a conversation (each gets a notification); resolves with who was. */
|
|
12318
12392
|
notify: (conversationId, userIds) => notifyConversation(this.requireClient(), conversationId, userIds),
|
|
12319
|
-
/** Draft an editable plan from an objective. */
|
|
12320
|
-
plan: (body) => planWork(
|
|
12393
|
+
/** Draft an editable plan from an objective, in the current workspace or `options.workspaceId`. */
|
|
12394
|
+
plan: async (body, options) => planWork(
|
|
12395
|
+
this.requireClient(),
|
|
12396
|
+
body,
|
|
12397
|
+
await this.requireTargetWorkspace(options?.workspaceId)
|
|
12398
|
+
),
|
|
12321
12399
|
/**
|
|
12322
12400
|
* Run a work item and, when the run is parked waiting for workspace access, grant the agent's
|
|
12323
12401
|
* run session a temporary key and run it again. Work that needs no access grant returns from the
|
|
@@ -12791,8 +12869,15 @@ var Arbi = class {
|
|
|
12791
12869
|
},
|
|
12792
12870
|
/** Read the status of a background turn. */
|
|
12793
12871
|
getResponse: (id) => this.recovering(() => getResponse(this.getAuthHeaders(), id)),
|
|
12794
|
-
/**
|
|
12795
|
-
|
|
12872
|
+
/**
|
|
12873
|
+
* The skills the caller can run (own + shared marketplace), metadata only. Without a
|
|
12874
|
+
* marketplace they are the current workspace's, or `options.workspaceId`'s (opened, not
|
|
12875
|
+
* switched to).
|
|
12876
|
+
*/
|
|
12877
|
+
listSkills: async (options) => listSkills(this.requireClient(), {
|
|
12878
|
+
includeHidden: options?.includeHidden,
|
|
12879
|
+
workspaceExtId: await this.targetWorkspace(options?.workspaceId)
|
|
12880
|
+
}),
|
|
12796
12881
|
/**
|
|
12797
12882
|
* Save a SKILL.md as the caller's skill ``slug``: private unless ``shared`` (pass
|
|
12798
12883
|
* ``shared: isSharedSkill(skill)`` when changing an existing skill, so a shared one stays shared).
|
|
@@ -13428,12 +13513,23 @@ var Arbi = class {
|
|
|
13428
13513
|
};
|
|
13429
13514
|
// ── Files (OpenAI-compatible) ────────────────────────────────────────
|
|
13430
13515
|
files = {
|
|
13431
|
-
|
|
13516
|
+
/** The current workspace's files, or `options.workspaceId`'s (opened, not switched to). */
|
|
13517
|
+
list: async (options) => {
|
|
13518
|
+
const { workspaceId, ...rest } = options ?? {};
|
|
13519
|
+
return listFiles(this.requireClient(), {
|
|
13520
|
+
...rest,
|
|
13521
|
+
workspaceExtId: await this.targetWorkspace(workspaceId)
|
|
13522
|
+
});
|
|
13523
|
+
},
|
|
13432
13524
|
get: (fileId) => getFile(this.requireClient(), fileId),
|
|
13433
13525
|
delete: (fileId) => deleteFile(this.requireClient(), fileId),
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13526
|
+
/** Upload a file into the current workspace, or `options.workspaceId` (opened, not switched to). */
|
|
13527
|
+
upload: async (fileData, fileName, purpose, options) => {
|
|
13528
|
+
const workspaceExtId = await this.targetWorkspace(options?.workspaceId);
|
|
13529
|
+
return this.recovering(
|
|
13530
|
+
() => uploadFile2(this.getAuthHeaders(), fileData, fileName, purpose, workspaceExtId)
|
|
13531
|
+
);
|
|
13532
|
+
},
|
|
13437
13533
|
getContent: (fileId) => this.recovering(() => getFileContent(this.getAuthHeaders(), fileId))
|
|
13438
13534
|
};
|
|
13439
13535
|
// ── Agents ──────────────────────────────────────────────────────────
|
|
@@ -13569,15 +13665,38 @@ var Arbi = class {
|
|
|
13569
13665
|
export: (databaseId, format) => exportDatabase(this.requireClient(), databaseId, format)
|
|
13570
13666
|
};
|
|
13571
13667
|
// ── Workspace facts ─────────────────────────────────────────────────
|
|
13668
|
+
/**
|
|
13669
|
+
* Notes. Create, list and search act in the current workspace, or `workspaceId` (opened for this
|
|
13670
|
+
* session, not switched to), which the request names; update, delete and remind act in the
|
|
13671
|
+
* note's own workspace, which the server derives from it.
|
|
13672
|
+
*/
|
|
13572
13673
|
facts = {
|
|
13573
|
-
create: (body) => createFact(
|
|
13674
|
+
create: async (body, options) => createFact(
|
|
13675
|
+
this.requireClient(),
|
|
13676
|
+
body,
|
|
13677
|
+
await this.requireTargetWorkspace(options?.workspaceId)
|
|
13678
|
+
),
|
|
13574
13679
|
/** Create up to 200 notes in one all-or-nothing request. */
|
|
13575
|
-
createBatch: (body) => createFactsBatch(
|
|
13680
|
+
createBatch: async (body, options) => createFactsBatch(
|
|
13681
|
+
this.requireClient(),
|
|
13682
|
+
body,
|
|
13683
|
+
await this.requireTargetWorkspace(options?.workspaceId)
|
|
13684
|
+
),
|
|
13576
13685
|
/** Pass `from`/`to`/`datedOnly` for the timeline view — dated notes only,
|
|
13577
13686
|
* ordered by when they happened. `tagExtIds` / `docExtId` narrow the list;
|
|
13578
13687
|
* `limit` / `offset` page it. */
|
|
13579
|
-
list: (options) =>
|
|
13580
|
-
|
|
13688
|
+
list: async (options) => {
|
|
13689
|
+
const { workspaceId, ...filter } = options ?? {};
|
|
13690
|
+
return listFacts(this.requireClient(), {
|
|
13691
|
+
...filter,
|
|
13692
|
+
workspaceExtId: await this.requireTargetWorkspace(workspaceId)
|
|
13693
|
+
});
|
|
13694
|
+
},
|
|
13695
|
+
search: async (body, options) => searchFacts(
|
|
13696
|
+
this.requireClient(),
|
|
13697
|
+
body,
|
|
13698
|
+
await this.requireTargetWorkspace(options?.workspaceId)
|
|
13699
|
+
),
|
|
13581
13700
|
update: (factId, body) => updateFact(this.requireClient(), factId, body),
|
|
13582
13701
|
delete: (factId) => deleteFact(this.requireClient(), factId),
|
|
13583
13702
|
/** One-off reminder on a dated note: an explicit `remindAt`, or
|