@arbidocs/blocks 0.5.11 → 0.5.13
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/connect/index.cjs +103 -1
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +102 -4
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/projects/index.d.ts +1 -0
- package/dist/connection/projects/useProjectSummaries.d.ts +155 -0
- package/dist/databases/index.cjs +1 -1
- package/dist/databases/index.cjs.map +1 -1
- package/dist/databases/index.js +1 -1
- package/dist/databases/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { ConnectedProjectsPanel, PROJECTS_BASE_TAB_ID, type ConnectedProjectsPanelProps, type ProjectPanelTabs, } from './ConnectedProjectsPanel';
|
|
2
|
+
export { buildProjectSummaries, primaryProjectWorkspace, useProjectSummaries, useProjectSummary, type ProjectMemberSummary, type ProjectSummary, type ProjectWorkspaceSummary, } from './useProjectSummaries';
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects joined with their workspaces: what a project list or a project page shows of each
|
|
3
|
+
* project (its details, workspaces, documents, threads, people, storage and AI quota), from the
|
|
4
|
+
* shared `useProjects` and `useWorkspaces` lists (no request of its own). A project is created with
|
|
5
|
+
* `useCreateProject` (`@arbidocs/react`).
|
|
6
|
+
*
|
|
7
|
+
* Generic: a site's words for a project ("matter", "engagement"…) and for its fields live in its
|
|
8
|
+
* own config; these are the backend's project and its `client`, `client_ref`, `stage`,
|
|
9
|
+
* `lead_user`, `budget` and host `fields`.
|
|
10
|
+
*/
|
|
11
|
+
import type { components } from '@arbidocs/client';
|
|
12
|
+
import { type GroupedWorkspace } from '../../workspaces/workspace-groups';
|
|
13
|
+
type ProjectResponse = components['schemas']['ProjectResponse'];
|
|
14
|
+
type ProjectBudget = components['schemas']['ProjectBudget'];
|
|
15
|
+
/** A workspace of a project, with its counts. */
|
|
16
|
+
export interface ProjectWorkspaceSummary {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
isPublic: boolean;
|
|
21
|
+
documentCount: number;
|
|
22
|
+
conversationCount: number;
|
|
23
|
+
memberCount: number;
|
|
24
|
+
filesMb: number;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
/** A member of any of the project's workspaces; possibly an agent (`agt-…`). */
|
|
28
|
+
export interface ProjectMemberSummary {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
email: string;
|
|
32
|
+
role: string;
|
|
33
|
+
isAgent: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** A project and the work it groups. */
|
|
36
|
+
export interface ProjectSummary {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
subscription: string;
|
|
41
|
+
workspaces: ProjectWorkspaceSummary[];
|
|
42
|
+
workspaceCount: number;
|
|
43
|
+
documentCount: number;
|
|
44
|
+
conversationCount: number;
|
|
45
|
+
/** Everyone in the project's workspaces, agents included (`isAgent`). */
|
|
46
|
+
members: ProjectMemberSummary[];
|
|
47
|
+
/** The people (no agents). */
|
|
48
|
+
memberCount: number;
|
|
49
|
+
filesMb: number;
|
|
50
|
+
storageUsedGb: number;
|
|
51
|
+
storageLimitGb: number;
|
|
52
|
+
/** AI usage this period against the project's limit (the quota's units). */
|
|
53
|
+
aiUsageUsed: number;
|
|
54
|
+
aiUsageLimit: number;
|
|
55
|
+
client: string | null;
|
|
56
|
+
clientRef: string | null;
|
|
57
|
+
stage: string | null;
|
|
58
|
+
/** The project's lead (`usr-…`). */
|
|
59
|
+
leadUser: string | null;
|
|
60
|
+
budget: ProjectBudget | null;
|
|
61
|
+
/** The host's own fields on the project. */
|
|
62
|
+
fields: Record<string, unknown>;
|
|
63
|
+
}
|
|
64
|
+
/** Join projects with their workspaces; the projects with the most work first. */
|
|
65
|
+
export declare function buildProjectSummaries(projects: readonly ProjectResponse[] | undefined, workspaces: readonly GroupedWorkspace[] | undefined): ProjectSummary[];
|
|
66
|
+
/** Every project the caller has, joined with its workspaces. */
|
|
67
|
+
export declare function useProjectSummaries(): {
|
|
68
|
+
projects: ProjectSummary[];
|
|
69
|
+
isLoading: boolean;
|
|
70
|
+
isError: boolean;
|
|
71
|
+
error: Error | null;
|
|
72
|
+
};
|
|
73
|
+
/** One project's summary, with its AI usage this period. */
|
|
74
|
+
export declare function useProjectSummary(projectId: string | undefined): {
|
|
75
|
+
project: ProjectSummary | undefined;
|
|
76
|
+
usage: NoInfer<{
|
|
77
|
+
external_usage?: {
|
|
78
|
+
[key: string]: unknown;
|
|
79
|
+
} | null;
|
|
80
|
+
project_ext_id: string;
|
|
81
|
+
period_start: string;
|
|
82
|
+
period_end: string;
|
|
83
|
+
total_spend: number;
|
|
84
|
+
total_tokens: number;
|
|
85
|
+
total_requests: number;
|
|
86
|
+
daily: components["schemas"]["DailyUsage"][];
|
|
87
|
+
model_groups: {
|
|
88
|
+
[key: string]: components["schemas"]["ModelGroupUsage"];
|
|
89
|
+
};
|
|
90
|
+
by_workspace: {
|
|
91
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
92
|
+
};
|
|
93
|
+
by_user: {
|
|
94
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
95
|
+
};
|
|
96
|
+
by_feature: {
|
|
97
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
98
|
+
};
|
|
99
|
+
invoice_pdf?: string | null;
|
|
100
|
+
}> | NoInfer<{
|
|
101
|
+
external_usage?: {
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
} | null;
|
|
104
|
+
project_ext_id: string;
|
|
105
|
+
period_start: string;
|
|
106
|
+
period_end: string;
|
|
107
|
+
total_spend: number;
|
|
108
|
+
total_tokens: number;
|
|
109
|
+
total_requests: number;
|
|
110
|
+
daily: components["schemas"]["DailyUsage"][];
|
|
111
|
+
model_groups: {
|
|
112
|
+
[key: string]: components["schemas"]["ModelGroupUsage"];
|
|
113
|
+
};
|
|
114
|
+
by_workspace: {
|
|
115
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
116
|
+
};
|
|
117
|
+
by_user: {
|
|
118
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
119
|
+
};
|
|
120
|
+
by_feature: {
|
|
121
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
122
|
+
};
|
|
123
|
+
invoice_pdf?: string | null;
|
|
124
|
+
}> | NoInfer<{
|
|
125
|
+
external_usage?: {
|
|
126
|
+
[key: string]: unknown;
|
|
127
|
+
} | null;
|
|
128
|
+
project_ext_id: string;
|
|
129
|
+
period_start: string;
|
|
130
|
+
period_end: string;
|
|
131
|
+
total_spend: number;
|
|
132
|
+
total_tokens: number;
|
|
133
|
+
total_requests: number;
|
|
134
|
+
daily: components["schemas"]["DailyUsage"][];
|
|
135
|
+
model_groups: {
|
|
136
|
+
[key: string]: components["schemas"]["ModelGroupUsage"];
|
|
137
|
+
};
|
|
138
|
+
by_workspace: {
|
|
139
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
140
|
+
};
|
|
141
|
+
by_user: {
|
|
142
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
143
|
+
};
|
|
144
|
+
by_feature: {
|
|
145
|
+
[key: string]: components["schemas"]["TagBreakdown"];
|
|
146
|
+
};
|
|
147
|
+
invoice_pdf?: string | null;
|
|
148
|
+
}> | undefined;
|
|
149
|
+
usageLoading: boolean;
|
|
150
|
+
isLoading: boolean;
|
|
151
|
+
isError: boolean;
|
|
152
|
+
};
|
|
153
|
+
/** The workspace a project's work runs in: the one with the most work. */
|
|
154
|
+
export declare function primaryProjectWorkspace(project: Pick<ProjectSummary, 'workspaces'>): ProjectWorkspaceSummary | undefined;
|
|
155
|
+
export {};
|
package/dist/databases/index.cjs
CHANGED
|
@@ -1648,7 +1648,7 @@ var DEFAULT_DATABASE_COLUMN_DIALOG_LABELS = {
|
|
|
1648
1648
|
addDescription: "Pick what the column holds; every cell in it is checked against its type.",
|
|
1649
1649
|
editDescription: "Rename the column or change its options.",
|
|
1650
1650
|
name: "Name",
|
|
1651
|
-
namePlaceholder: "e.g. Client,
|
|
1651
|
+
namePlaceholder: "e.g. Client, Reference, Fee",
|
|
1652
1652
|
type: "Type",
|
|
1653
1653
|
typeFixed: "A column\u2019s type can\u2019t be changed once it has been added.",
|
|
1654
1654
|
options: "Options",
|