@arbidocs/sdk 0.3.115 → 0.3.116
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/{browser-B5b3SDW6.d.cts → browser-BS_k043E.d.cts} +257 -3
- package/dist/{browser-B5b3SDW6.d.ts → browser-BS_k043E.d.ts} +257 -3
- package/dist/browser.cjs +77 -2
- 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 +77 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +70 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -108
- package/dist/index.d.ts +3 -108
- package/dist/index.js +70 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5187,6 +5187,7 @@ __export(workspaces_exports, {
|
|
|
5187
5187
|
copyDocuments: () => copyDocuments,
|
|
5188
5188
|
createWorkspace: () => createWorkspace,
|
|
5189
5189
|
deleteWorkspaces: () => deleteWorkspaces,
|
|
5190
|
+
getWorkspaceChronology: () => getWorkspaceChronology,
|
|
5190
5191
|
listWorkspaceUsers: () => listWorkspaceUsers,
|
|
5191
5192
|
listWorkspaces: () => listWorkspaces,
|
|
5192
5193
|
removeWorkspaceUsers: () => removeWorkspaceUsers,
|
|
@@ -5251,6 +5252,14 @@ async function setUserRole(arbi, userIds, role) {
|
|
|
5251
5252
|
"Failed to update roles"
|
|
5252
5253
|
);
|
|
5253
5254
|
}
|
|
5255
|
+
async function getWorkspaceChronology(arbi, workspaceId) {
|
|
5256
|
+
return requireData(
|
|
5257
|
+
await arbi.fetch.GET("/v1/workspace/{workspace_ext_id}/chronology", {
|
|
5258
|
+
params: { path: { workspace_ext_id: workspaceId } }
|
|
5259
|
+
}),
|
|
5260
|
+
"Failed to fetch workspace chronology"
|
|
5261
|
+
);
|
|
5262
|
+
}
|
|
5254
5263
|
async function copyDocuments(arbi, targetWorkspaceId, docIds, targetWorkspaceKey) {
|
|
5255
5264
|
return requireData(
|
|
5256
5265
|
await arbi.fetch.POST("/v1/workspace/copy", {
|
|
@@ -5615,6 +5624,7 @@ __export(dm_exports, {
|
|
|
5615
5624
|
decryptDmContent: () => decryptDmContent,
|
|
5616
5625
|
deleteDMs: () => deleteDMs,
|
|
5617
5626
|
encryptDmContent: () => encryptDmContent,
|
|
5627
|
+
listActivity: () => listActivity,
|
|
5618
5628
|
listDMs: () => listDMs,
|
|
5619
5629
|
listDecryptedDMs: () => listDecryptedDMs,
|
|
5620
5630
|
markRead: () => markRead,
|
|
@@ -5670,6 +5680,20 @@ async function listDecryptedDMs(arbi, crypto) {
|
|
|
5670
5680
|
const raw = await listDMs(arbi);
|
|
5671
5681
|
return decryptDmBatch(arbi, raw, crypto);
|
|
5672
5682
|
}
|
|
5683
|
+
async function listActivity(arbi, options) {
|
|
5684
|
+
return requireData(
|
|
5685
|
+
await arbi.fetch.GET("/v1/notifications/", {
|
|
5686
|
+
params: {
|
|
5687
|
+
query: {
|
|
5688
|
+
type: "activity",
|
|
5689
|
+
...options?.limit != null ? { limit: options.limit } : {},
|
|
5690
|
+
...options?.offset != null ? { offset: options.offset } : {}
|
|
5691
|
+
}
|
|
5692
|
+
}
|
|
5693
|
+
}),
|
|
5694
|
+
"Failed to fetch activity"
|
|
5695
|
+
);
|
|
5696
|
+
}
|
|
5673
5697
|
async function sendEncryptedDM(arbi, messages, crypto) {
|
|
5674
5698
|
const encrypted = await Promise.all(
|
|
5675
5699
|
messages.map(async (msg) => ({
|
|
@@ -5920,6 +5944,9 @@ async function listSessions(arbi) {
|
|
|
5920
5944
|
var projects_exports = {};
|
|
5921
5945
|
__export(projects_exports, {
|
|
5922
5946
|
createProject: () => createProject,
|
|
5947
|
+
getProjectInvoices: () => getProjectInvoices,
|
|
5948
|
+
getProjectUsage: () => getProjectUsage,
|
|
5949
|
+
getUserUsageToday: () => getUserUsageToday,
|
|
5923
5950
|
listProjects: () => listProjects,
|
|
5924
5951
|
refreshProject: () => refreshProject
|
|
5925
5952
|
});
|
|
@@ -5942,6 +5969,28 @@ async function refreshProject(arbi, projectExtId) {
|
|
|
5942
5969
|
"Failed to refresh project"
|
|
5943
5970
|
);
|
|
5944
5971
|
}
|
|
5972
|
+
async function getProjectUsage(arbi, projectExtId, monthsBack) {
|
|
5973
|
+
return requireData(
|
|
5974
|
+
await arbi.fetch.GET("/v1/user/projects/{project_ext_id}/usage", {
|
|
5975
|
+
params: {
|
|
5976
|
+
path: { project_ext_id: projectExtId },
|
|
5977
|
+
query: monthsBack === void 0 ? void 0 : { months_back: monthsBack }
|
|
5978
|
+
}
|
|
5979
|
+
}),
|
|
5980
|
+
"Failed to fetch project usage"
|
|
5981
|
+
);
|
|
5982
|
+
}
|
|
5983
|
+
async function getProjectInvoices(arbi, projectExtId) {
|
|
5984
|
+
return requireData(
|
|
5985
|
+
await arbi.fetch.GET("/v1/user/projects/{project_ext_id}/invoices", {
|
|
5986
|
+
params: { path: { project_ext_id: projectExtId } }
|
|
5987
|
+
}),
|
|
5988
|
+
"Failed to fetch project invoices"
|
|
5989
|
+
);
|
|
5990
|
+
}
|
|
5991
|
+
async function getUserUsageToday(arbi) {
|
|
5992
|
+
return requireData(await arbi.fetch.GET("/v1/user/me/usage/today"), "Failed to fetch today usage");
|
|
5993
|
+
}
|
|
5945
5994
|
|
|
5946
5995
|
// src/operations/tasks.ts
|
|
5947
5996
|
async function listTasks(arbi) {
|
|
@@ -6150,7 +6199,16 @@ var Arbi = class {
|
|
|
6150
6199
|
projects = {
|
|
6151
6200
|
list: () => listProjects(this.requireClient()),
|
|
6152
6201
|
create: (name) => createProject(this.requireClient(), name),
|
|
6153
|
-
refresh: (projectExtId) => refreshProject(this.requireClient(), projectExtId)
|
|
6202
|
+
refresh: (projectExtId) => refreshProject(this.requireClient(), projectExtId),
|
|
6203
|
+
/** AI usage + spend breakdown for a project's billing period. */
|
|
6204
|
+
usage: (projectExtId, monthsBack) => getProjectUsage(this.requireClient(), projectExtId, monthsBack),
|
|
6205
|
+
/** Stripe invoices for a project's subscription. */
|
|
6206
|
+
invoices: (projectExtId) => getProjectInvoices(this.requireClient(), projectExtId)
|
|
6207
|
+
};
|
|
6208
|
+
// ── User (account-scoped usage) ───────────────────────────────────────
|
|
6209
|
+
user = {
|
|
6210
|
+
/** Today's deployment-wide credit spend for the current user. */
|
|
6211
|
+
usageToday: () => getUserUsageToday(this.requireClient())
|
|
6154
6212
|
};
|
|
6155
6213
|
// ── Workspaces ────────────────────────────────────────────────────────
|
|
6156
6214
|
workspaces = {
|
|
@@ -6198,6 +6256,14 @@ var Arbi = class {
|
|
|
6198
6256
|
targetWorkspaceId,
|
|
6199
6257
|
docIds,
|
|
6200
6258
|
targetWorkspaceKey
|
|
6259
|
+
),
|
|
6260
|
+
/**
|
|
6261
|
+
* The last-generated document-derived chronology (key case events / dates).
|
|
6262
|
+
* Defaults to the currently open workspace when no id is passed.
|
|
6263
|
+
*/
|
|
6264
|
+
chronology: (workspaceId) => getWorkspaceChronology(
|
|
6265
|
+
this.requireClient(),
|
|
6266
|
+
workspaceId ?? this.requireWorkspace()
|
|
6201
6267
|
)
|
|
6202
6268
|
};
|
|
6203
6269
|
// ── Documents ─────────────────────────────────────────────────────────
|
|
@@ -6328,7 +6394,9 @@ var Arbi = class {
|
|
|
6328
6394
|
list: () => listDMs(this.requireClient()),
|
|
6329
6395
|
send: (messages) => sendDM(this.requireClient(), messages),
|
|
6330
6396
|
markRead: (messageIds) => markRead(this.requireClient(), messageIds),
|
|
6331
|
-
delete: (messageIds) => deleteDMs(this.requireClient(), messageIds)
|
|
6397
|
+
delete: (messageIds) => deleteDMs(this.requireClient(), messageIds),
|
|
6398
|
+
/** List the current user's durable activity feed (never unread; excluded from DMs). */
|
|
6399
|
+
listActivity: (options) => listActivity(this.requireClient(), options)
|
|
6332
6400
|
};
|
|
6333
6401
|
// ── Settings ──────────────────────────────────────────────────────────
|
|
6334
6402
|
settings = {
|