@crossworks/client-types 0.702.1 → 0.703.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/package.json +1 -1
- package/src/app-viewer.ts +4 -4
- package/src/dto/access.ts +0 -11
- package/src/dto/agent-graph.ts +4 -4
- package/src/dto/box-status.ts +1 -1
- package/src/dto/comms.ts +0 -67
- package/src/dto/grants.ts +0 -16
- package/src/dto/rows.ts +1 -50
- package/src/dto/services.ts +3 -2
- package/src/dto/shell.ts +4 -0
- package/src/index.ts +0 -2
- package/src/kinds.test.ts +1 -2
- package/src/kinds.ts +2 -28
- package/src/dto/contact-shares.ts +0 -98
package/package.json
CHANGED
package/src/app-viewer.ts
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
import type { LoginRole } from './role-names';
|
|
13
13
|
|
|
14
14
|
/** The kind of viewer: a login (its role: the owner or an admin login, a
|
|
15
|
-
* member login)
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `:host_me_kind` for
|
|
15
|
+
* member login) or an open /s link (no person). `client` and `contact`
|
|
16
|
+
* stay for the wire contract (additive only): a client login and a contact
|
|
17
|
+
* share's contact (gone since migration 0378) were viewer kinds, and an
|
|
18
|
+
* app may still test `:host_me_kind` for them. No brain answers them now. */
|
|
19
19
|
export type AppViewerKind = LoginRole | 'client' | 'contact' | 'public';
|
|
20
20
|
|
|
21
21
|
export type AppViewer = {
|
package/src/dto/access.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* docs/access-levels.md.
|
|
8
8
|
*/
|
|
9
9
|
import type { ShareMode } from './rows';
|
|
10
|
-
import type { AccessContactShare } from './contact-shares';
|
|
11
10
|
|
|
12
11
|
/** Highest first: the order the control shows them in. */
|
|
13
12
|
export const ACCESS_LEVELS = ['admin', 'team', 'client', 'public'] as const;
|
|
@@ -85,10 +84,6 @@ export type AccessNodeView = {
|
|
|
85
84
|
/** What it is read through by embeds (migration 0208); null when nothing
|
|
86
85
|
* reaches it. Absent from brains before 0208. */
|
|
87
86
|
readThrough?: AccessReadThrough | null;
|
|
88
|
-
/** The contacts it is shared with (contact shares, migration 0214): each
|
|
89
|
-
* has its own link, opened with that contact's code. They change no
|
|
90
|
-
* level. Absent from brains before 0214. */
|
|
91
|
-
contactShares?: AccessContactShare[];
|
|
92
87
|
};
|
|
93
88
|
|
|
94
89
|
/** An item is read through the items that embed it (migration 0208): a
|
|
@@ -258,12 +253,6 @@ export type SharedLinkRow = {
|
|
|
258
253
|
/** The item's level (client logins C1): `client` marks an old link, from
|
|
259
254
|
* when client meant an open link. Absent from brains before C1. */
|
|
260
255
|
level?: AccessLevel;
|
|
261
|
-
/** A contact share (migration 0214): the contact it is for, by id and
|
|
262
|
-
* name. Null or absent on an open link and on brains before 0214. */
|
|
263
|
-
contactId?: string | null;
|
|
264
|
-
contactName?: string | null;
|
|
265
|
-
/** A contact share of an app whose contact may write its data. */
|
|
266
|
-
canWrite?: boolean;
|
|
267
256
|
};
|
|
268
257
|
|
|
269
258
|
/** An old client link the brain retired (migration 0192): it answers a
|
package/src/dto/agent-graph.ts
CHANGED
|
@@ -159,10 +159,10 @@ export interface ToolGroupIntegrationDTO {
|
|
|
159
159
|
connectedAt?: string;
|
|
160
160
|
lastError?: string;
|
|
161
161
|
/** Pre-registered OAuth app, for servers without dynamic registration
|
|
162
|
-
* (Microsoft Entra ID)
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
client?: { source: '
|
|
162
|
+
* (Microsoft Entra ID): an app registered by hand (its id is
|
|
163
|
+
* `clientId`, its secret stays vault-sealed). Absent = the connector
|
|
164
|
+
* registers itself. */
|
|
165
|
+
client?: { source: 'manual'; authorizationServer?: string };
|
|
166
166
|
/** Scope asked for at authorization; absent = the server's own choice. */
|
|
167
167
|
scope?: string;
|
|
168
168
|
};
|
package/src/dto/box-status.ts
CHANGED
|
@@ -93,7 +93,7 @@ export type BoxContainerState = {
|
|
|
93
93
|
/**
|
|
94
94
|
* GET /api/box-status (settings area, read-only): the box status, and every
|
|
95
95
|
* long-running container of the stack by its compose service name
|
|
96
|
-
* (`postgres`, `objectstore`, `gotenberg`, `
|
|
96
|
+
* (`postgres`, `objectstore`, `gotenberg`, `worker_telegram`, `client_web`,
|
|
97
97
|
* ...: @mantle/config BOX_CONTAINERS). `containers` is null where the brain
|
|
98
98
|
* cannot read the updater's services.json (no updater, an updater before the
|
|
99
99
|
* field, a dev process).
|
package/src/dto/comms.ts
CHANGED
|
@@ -8,73 +8,6 @@
|
|
|
8
8
|
* public surface is byte-identical — only the file a symbol lives in moved.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
// ── Calendar ────────────────────────────────────────────────────────────────────
|
|
12
|
-
|
|
13
|
-
/** A subscribed calendar feed as returned by `GET /api/calendar` — the wire
|
|
14
|
-
* projection of @mantle/db's `CalendarAccount` row. The sealed `feedUrlEnc`
|
|
15
|
-
* credential, `ownerId`, and `syncState` are server-only and intentionally
|
|
16
|
-
* omitted; dates are ISO strings. The route maps its rows to this so the wire
|
|
17
|
-
* shape and the consuming client can't drift. */
|
|
18
|
-
export interface CalendarAccountDTO {
|
|
19
|
-
id: string;
|
|
20
|
-
/** 'ics' (future: 'google' | 'microsoft'). */
|
|
21
|
-
provider: string;
|
|
22
|
-
displayName: string;
|
|
23
|
-
/** Optional UI accent (hex) so multiple calendars are distinguishable. */
|
|
24
|
-
color: string | null;
|
|
25
|
-
enabled: boolean;
|
|
26
|
-
lastEventCount: number | null;
|
|
27
|
-
lastSyncAt: string | null;
|
|
28
|
-
lastSyncError: string | null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ── Microsoft (SharePoint / OneDrive) ───────────────────────────────────────────
|
|
32
|
-
|
|
33
|
-
/** A discovered drive as returned by `GET/POST /api/microsoft/accounts/[id]/drives`
|
|
34
|
-
* — the wire projection of @mantle/db's `MsDrive` row. The Graph `deltaLink`
|
|
35
|
-
* cursor and `accountId` are server-only and omitted; `lastSyncAt` is an ISO
|
|
36
|
-
* string. The route maps its rows to this so the shapes can't drift. */
|
|
37
|
-
export interface MsDriveDTO {
|
|
38
|
-
id: string;
|
|
39
|
-
/** Graph drive id. */
|
|
40
|
-
driveId: string;
|
|
41
|
-
/** `personal` (OneDrive) | `documentLibrary` (SharePoint) | other. */
|
|
42
|
-
driveType: string;
|
|
43
|
-
name: string;
|
|
44
|
-
/** SharePoint site display name; null for OneDrive. */
|
|
45
|
-
siteName: string | null;
|
|
46
|
-
webUrl: string | null;
|
|
47
|
-
enabled: boolean;
|
|
48
|
-
lastSyncAt: string | null;
|
|
49
|
-
lastError: string | null;
|
|
50
|
-
/** How many scope selections the drive has; 0 = syncing everything. */
|
|
51
|
-
scopeCount: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** One scope selection on a drive, as stored/returned by
|
|
55
|
-
* `GET/PUT /api/microsoft/drives/[id]/scopes`. Folder scopes include the
|
|
56
|
-
* whole subtree (path prefix); file scopes match that one item. */
|
|
57
|
-
export interface MsDriveScopeDTO {
|
|
58
|
-
itemId: string;
|
|
59
|
-
/** After-`root:` path, always starting with `/` (e.g. `/Reports/2026`). */
|
|
60
|
-
path: string;
|
|
61
|
-
isFolder: boolean;
|
|
62
|
-
name: string | null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** One row of a drive-folder listing from
|
|
66
|
-
* `GET /api/microsoft/drives/[id]/browse` — the scope picker's navigation
|
|
67
|
-
* unit. Selection state is client-derived by matching against the scope set. */
|
|
68
|
-
export interface MsDriveChildDTO {
|
|
69
|
-
itemId: string;
|
|
70
|
-
name: string;
|
|
71
|
-
isFolder: boolean;
|
|
72
|
-
childCount: number | null;
|
|
73
|
-
size: number | null;
|
|
74
|
-
path: string | null;
|
|
75
|
-
webUrl: string | null;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
11
|
// ── Email (inbox reading pane) ──────────────────────────────────────────────────
|
|
79
12
|
|
|
80
13
|
/** One message as returned by `GET /api/email/messages/[id]` — the wire
|
package/src/dto/grants.ts
CHANGED
|
@@ -42,19 +42,6 @@ export type GrantEmbed = { nodeId: string; title: string; kind: string };
|
|
|
42
42
|
* when the caller cannot read that item (or it is gone). */
|
|
43
43
|
export type GrantServedRef = { nodeId: string; title: string | null };
|
|
44
44
|
|
|
45
|
-
/** A contact the item is shared with (the same shape as the Access
|
|
46
|
-
* control's AccessContactShare). */
|
|
47
|
-
export type GrantContactShare = {
|
|
48
|
-
shareId: string;
|
|
49
|
-
contactId: string;
|
|
50
|
-
name: string;
|
|
51
|
-
canWrite: boolean;
|
|
52
|
-
sharingOn: boolean;
|
|
53
|
-
lastOpenedAt: string | null;
|
|
54
|
-
/** Server-relative: `/s/<token>`. */
|
|
55
|
-
path: string;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
45
|
/** GET /api/grants/:nodeId (an item or a folder). */
|
|
59
46
|
export type GrantsResponse = {
|
|
60
47
|
item: { id: string; title: string; type: string };
|
|
@@ -86,9 +73,6 @@ export type GrantsResponse = {
|
|
|
86
73
|
* served among them. Empty unless `mayLink`. The same rule POST
|
|
87
74
|
* /api/shares and PATCH /api/shares/:id { serve } check. */
|
|
88
75
|
serveCandidates: GrantEmbed[];
|
|
89
|
-
/** The contacts it is shared with: only for an Admin user who `mayLink`,
|
|
90
|
-
* on a kind that takes contact shares; else null. */
|
|
91
|
-
contactShares: GrantContactShare[] | null;
|
|
92
76
|
/** Pages, drawings and notes: what they embed that is not granted to
|
|
93
77
|
* every workspace the item is (only embeds the caller may open). */
|
|
94
78
|
embedsNotGranted: GrantEmbed[];
|
package/src/dto/rows.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { StoredFleetDefaultModel } from './fleet-default-model';
|
|
|
18
18
|
import type { TaskSubmission } from '../task-submissions';
|
|
19
19
|
|
|
20
20
|
// ── Row/DTO shapes moved from the server packages (jackdaw split P0) ─────────
|
|
21
|
-
// Sources: @mantle/content, @mantle/email, @mantle/
|
|
21
|
+
// Sources: @mantle/content, @mantle/email, @mantle/runtime/agent
|
|
22
22
|
// re-export these names, so server code keeps its original import paths.
|
|
23
23
|
|
|
24
24
|
export type TaskRow = {
|
|
@@ -807,21 +807,6 @@ export type ProviderAlertsAnswer = {
|
|
|
807
807
|
otherAlerts: ProviderAlert[];
|
|
808
808
|
};
|
|
809
809
|
|
|
810
|
-
export type AccountFoldersResult =
|
|
811
|
-
| {
|
|
812
|
-
ok: true;
|
|
813
|
-
address: string;
|
|
814
|
-
/** Every folder the server reports right now (the pick list). */
|
|
815
|
-
allFolders: string[];
|
|
816
|
-
/** The current explicit allow-list, or null = "scan all non-excluded". */
|
|
817
|
-
included: string[] | null;
|
|
818
|
-
/** Folders the operator opted OUT of (rendered disabled). */
|
|
819
|
-
excluded: string[];
|
|
820
|
-
/** Folders the sync has actually touched (per the cursor). */
|
|
821
|
-
scanned: string[];
|
|
822
|
-
}
|
|
823
|
-
| { ok: false; error: string };
|
|
824
|
-
|
|
825
810
|
export interface FolderFacet {
|
|
826
811
|
folder: string;
|
|
827
812
|
count: number;
|
|
@@ -838,18 +823,6 @@ export interface MessageListItem {
|
|
|
838
823
|
isRead: boolean;
|
|
839
824
|
}
|
|
840
825
|
|
|
841
|
-
export interface MsConfigStatus {
|
|
842
|
-
configured: boolean;
|
|
843
|
-
/** Where the active config comes from — drives the UI ("set here" vs "from
|
|
844
|
-
* environment, read-only"). */
|
|
845
|
-
source: 'db' | 'env' | null;
|
|
846
|
-
clientId: string | null;
|
|
847
|
-
tenant: string;
|
|
848
|
-
redirectUri: string | null;
|
|
849
|
-
/** Masked secret for display; never the plaintext. */
|
|
850
|
-
secretMasked: string | null;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
826
|
/** One retrieved (or near-miss) item: capped text + its ranking distance. */
|
|
854
827
|
export type SnapshotItem = {
|
|
855
828
|
text: string;
|
|
@@ -1263,25 +1236,3 @@ export interface SyncRun {
|
|
|
1263
1236
|
ingested: number;
|
|
1264
1237
|
error: string | null;
|
|
1265
1238
|
}
|
|
1266
|
-
|
|
1267
|
-
/** Mirrors @mantle/microsoft `PublicMsAccount` (an `ms_accounts` row with the
|
|
1268
|
-
* sealed OAuth tokens replaced by presence flags). */
|
|
1269
|
-
export interface PublicMsAccount {
|
|
1270
|
-
id: string;
|
|
1271
|
-
userId: string;
|
|
1272
|
-
upn: string;
|
|
1273
|
-
displayName: string | null;
|
|
1274
|
-
tenantId: string | null;
|
|
1275
|
-
tokenExpiresAt: string | null;
|
|
1276
|
-
scopes: string[];
|
|
1277
|
-
branchPath: string;
|
|
1278
|
-
surfaces: Record<string, boolean>;
|
|
1279
|
-
syncState: Record<string, unknown>;
|
|
1280
|
-
lastSyncAt: string | null;
|
|
1281
|
-
lastSyncError: string | null;
|
|
1282
|
-
enabled: boolean;
|
|
1283
|
-
createdAt: string;
|
|
1284
|
-
updatedAt: string;
|
|
1285
|
-
hasAccessToken: boolean;
|
|
1286
|
-
hasRefreshToken: boolean;
|
|
1287
|
-
}
|
package/src/dto/services.ts
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
/** Each name is also the service's compose profile. `calls` is LiveKit
|
|
11
11
|
* (calls between people in the messenger); `documents` is the documents
|
|
12
|
-
* engine (Gotenberg)
|
|
12
|
+
* engine (Gotenberg); `sync` is the Sync sidecar (outside accounts: mail,
|
|
13
|
+
* contacts, calendar feeds, Microsoft). */
|
|
13
14
|
export type OptionalServiceName =
|
|
14
|
-
'sandboxes' | 'local-embedder' | 'helpers' | 'calls' | 'documents';
|
|
15
|
+
'sandboxes' | 'local-embedder' | 'helpers' | 'calls' | 'documents' | 'sync';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* - `off`: the compose profile is not active (the resting state).
|
package/src/dto/shell.ts
CHANGED
|
@@ -19,6 +19,10 @@ export type ShellFeatures = {
|
|
|
19
19
|
/** The tree's custom order: the `custom` sort, `ordered` and `mayOrder` on
|
|
20
20
|
* a folder page, POST /api/tree/:kind/place. Absent from a brain before it. */
|
|
21
21
|
treeCustomOrder?: boolean;
|
|
22
|
+
/** The Sync service is on. False: hide Email, Contacts and the account
|
|
23
|
+
* screens (Settings > Accounts, Microsoft, Calendars). Absent from a brain
|
|
24
|
+
* before it: hide nothing. */
|
|
25
|
+
sync?: boolean;
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
export type Shell = {
|
package/src/index.ts
CHANGED
|
@@ -33,7 +33,6 @@ export * from './dto/turns';
|
|
|
33
33
|
export * from './dto/rows';
|
|
34
34
|
export * from './dto/views';
|
|
35
35
|
export * from './dto/recall';
|
|
36
|
-
export * from './dto/contact-shares';
|
|
37
36
|
export * from './dto/services';
|
|
38
37
|
export * from './dto/box-status';
|
|
39
38
|
export * from './dto/update-notice';
|
|
@@ -303,7 +302,6 @@ export type { NavFavoriteItem, Shell, ShellFeatures, ShellRole } from './dto/she
|
|
|
303
302
|
export type { HomeDesk, HomeDeskItem, HomeDeskPutBody, HomeDeskState } from './dto/home-desk';
|
|
304
303
|
export type {
|
|
305
304
|
GrantAddBody,
|
|
306
|
-
GrantContactShare,
|
|
307
305
|
GrantEmbed,
|
|
308
306
|
GrantEmbedSkip,
|
|
309
307
|
GrantEmbedsBody,
|
package/src/kinds.test.ts
CHANGED
|
@@ -73,12 +73,11 @@ describe('the kind registry', () => {
|
|
|
73
73
|
expect(kindSpecOf('toString')).toBeNull();
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
it('an Admin-only kind is never linked
|
|
76
|
+
it('an Admin-only kind is never linked or a folder share', () => {
|
|
77
77
|
for (const t of ITEM_KIND_NAMES) {
|
|
78
78
|
const s = ITEM_KINDS[t];
|
|
79
79
|
if (s.class !== 'admin_only') continue;
|
|
80
80
|
expect(s.publicLink, t).toBe(false);
|
|
81
|
-
expect(s.contactShare, t).toBe(false);
|
|
82
81
|
expect(s.tree?.shareable ?? false, t).toBe(false);
|
|
83
82
|
expect(s.library, t).toBe(false);
|
|
84
83
|
}
|
package/src/kinds.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* - TREE_KINDS and TREE_KIND_SPECS (./tree), TREE_LIVE_KINDS and
|
|
8
8
|
* READER_TREE_KINDS (@mantle/content/tree), TREE_TOOL_KINDS
|
|
9
9
|
* (@mantle/tools), the tree entry;
|
|
10
|
-
* - SHAREABLE_TYPES
|
|
11
|
-
*
|
|
10
|
+
* - SHAREABLE_TYPES, canShareNode and PEER_SHAREABLE_TYPES
|
|
11
|
+
* (@mantle/content), the share fields;
|
|
12
12
|
* - SEARCH_NODE_TYPES (./search-query), searchable;
|
|
13
13
|
* - TEAM_PRIVATE_CORPUS_TYPES and TEAM_NEVER_TYPES
|
|
14
14
|
* (@mantle/content-core/profile-projections), teamHidden;
|
|
@@ -68,8 +68,6 @@ export type KindSpec = {
|
|
|
68
68
|
* Moderator of its home opens, changes or closes it (linkNeedsModerator);
|
|
69
69
|
* `true`: whoever may edit the item. */
|
|
70
70
|
readonly publicLink: boolean | 'files-folder' | 'moderator';
|
|
71
|
-
/** May be shared with one contact (CONTACT_SHAREABLE_TYPES). */
|
|
72
|
-
readonly contactShare: boolean;
|
|
73
71
|
/** May be granted to a linked brain by category (PEER_SHAREABLE_TYPES). */
|
|
74
72
|
readonly peerShare: boolean;
|
|
75
73
|
/** A `type` filter of GET /api/search (SEARCH_NODE_TYPES). */
|
|
@@ -155,7 +153,6 @@ export const ITEM_KINDS = {
|
|
|
155
153
|
class: 'workspace',
|
|
156
154
|
tree: null,
|
|
157
155
|
publicLink: 'files-folder',
|
|
158
|
-
contactShare: false,
|
|
159
156
|
peerShare: false,
|
|
160
157
|
searchable: true,
|
|
161
158
|
route: { content: '/api/files/folders', v1: null },
|
|
@@ -178,7 +175,6 @@ export const ITEM_KINDS = {
|
|
|
178
175
|
class: 'admin_only',
|
|
179
176
|
tree: null,
|
|
180
177
|
publicLink: false,
|
|
181
|
-
contactShare: false,
|
|
182
178
|
peerShare: false,
|
|
183
179
|
searchable: true,
|
|
184
180
|
route: { content: '/api/email/messages', v1: null },
|
|
@@ -201,7 +197,6 @@ export const ITEM_KINDS = {
|
|
|
201
197
|
class: 'admin_only',
|
|
202
198
|
tree: null,
|
|
203
199
|
publicLink: false,
|
|
204
|
-
contactShare: false,
|
|
205
200
|
peerShare: false,
|
|
206
201
|
searchable: true,
|
|
207
202
|
route: none,
|
|
@@ -231,7 +226,6 @@ export const ITEM_KINDS = {
|
|
|
231
226
|
shareable: true,
|
|
232
227
|
},
|
|
233
228
|
publicLink: true,
|
|
234
|
-
contactShare: true,
|
|
235
229
|
peerShare: true,
|
|
236
230
|
searchable: true,
|
|
237
231
|
route: { content: '/api/files/files', v1: '/api/v1/files' },
|
|
@@ -261,7 +255,6 @@ export const ITEM_KINDS = {
|
|
|
261
255
|
shareable: true,
|
|
262
256
|
},
|
|
263
257
|
publicLink: true,
|
|
264
|
-
contactShare: true,
|
|
265
258
|
peerShare: true,
|
|
266
259
|
searchable: true,
|
|
267
260
|
route: { content: '/api/notes', v1: '/api/v1/notes' },
|
|
@@ -284,7 +277,6 @@ export const ITEM_KINDS = {
|
|
|
284
277
|
class: 'admin_only',
|
|
285
278
|
tree: null,
|
|
286
279
|
publicLink: false,
|
|
287
|
-
contactShare: false,
|
|
288
280
|
peerShare: false,
|
|
289
281
|
searchable: true,
|
|
290
282
|
route: none,
|
|
@@ -314,7 +306,6 @@ export const ITEM_KINDS = {
|
|
|
314
306
|
shareable: false,
|
|
315
307
|
},
|
|
316
308
|
publicLink: false,
|
|
317
|
-
contactShare: false,
|
|
318
309
|
peerShare: true,
|
|
319
310
|
searchable: true,
|
|
320
311
|
route: { content: '/api/contacts', v1: '/api/v1/contacts' },
|
|
@@ -353,7 +344,6 @@ export const ITEM_KINDS = {
|
|
|
353
344
|
shareable: false,
|
|
354
345
|
},
|
|
355
346
|
publicLink: false,
|
|
356
|
-
contactShare: false,
|
|
357
347
|
peerShare: false,
|
|
358
348
|
searchable: false,
|
|
359
349
|
route: { content: '/api/secrets', v1: null },
|
|
@@ -389,7 +379,6 @@ export const ITEM_KINDS = {
|
|
|
389
379
|
shareable: false,
|
|
390
380
|
},
|
|
391
381
|
publicLink: true,
|
|
392
|
-
contactShare: false,
|
|
393
382
|
peerShare: true,
|
|
394
383
|
searchable: true,
|
|
395
384
|
route: { content: '/api/tasks', v1: '/api/v1/tasks' },
|
|
@@ -430,7 +419,6 @@ export const ITEM_KINDS = {
|
|
|
430
419
|
shareable: false,
|
|
431
420
|
},
|
|
432
421
|
publicLink: true,
|
|
433
|
-
contactShare: false,
|
|
434
422
|
peerShare: true,
|
|
435
423
|
searchable: true,
|
|
436
424
|
route: { content: '/api/events', v1: '/api/v1/events' },
|
|
@@ -463,7 +451,6 @@ export const ITEM_KINDS = {
|
|
|
463
451
|
class: 'admin_only',
|
|
464
452
|
tree: null,
|
|
465
453
|
publicLink: false,
|
|
466
|
-
contactShare: false,
|
|
467
454
|
peerShare: false,
|
|
468
455
|
searchable: true,
|
|
469
456
|
route: none,
|
|
@@ -486,7 +473,6 @@ export const ITEM_KINDS = {
|
|
|
486
473
|
class: 'conversation',
|
|
487
474
|
tree: null,
|
|
488
475
|
publicLink: false,
|
|
489
|
-
contactShare: false,
|
|
490
476
|
peerShare: false,
|
|
491
477
|
searchable: true,
|
|
492
478
|
route: none,
|
|
@@ -516,7 +502,6 @@ export const ITEM_KINDS = {
|
|
|
516
502
|
shareable: true,
|
|
517
503
|
},
|
|
518
504
|
publicLink: true,
|
|
519
|
-
contactShare: true,
|
|
520
505
|
peerShare: true,
|
|
521
506
|
searchable: true,
|
|
522
507
|
route: { content: '/api/pages', v1: '/api/v1/pages' },
|
|
@@ -546,7 +531,6 @@ export const ITEM_KINDS = {
|
|
|
546
531
|
shareable: true,
|
|
547
532
|
},
|
|
548
533
|
publicLink: true,
|
|
549
|
-
contactShare: true,
|
|
550
534
|
peerShare: true,
|
|
551
535
|
searchable: false,
|
|
552
536
|
route: { content: '/api/tables', v1: '/api/v1/tables' },
|
|
@@ -569,7 +553,6 @@ export const ITEM_KINDS = {
|
|
|
569
553
|
class: 'admin_only',
|
|
570
554
|
tree: null,
|
|
571
555
|
publicLink: false,
|
|
572
|
-
contactShare: false,
|
|
573
556
|
peerShare: false,
|
|
574
557
|
searchable: false,
|
|
575
558
|
route: none,
|
|
@@ -592,7 +575,6 @@ export const ITEM_KINDS = {
|
|
|
592
575
|
class: 'admin_only',
|
|
593
576
|
tree: null,
|
|
594
577
|
publicLink: false,
|
|
595
|
-
contactShare: false,
|
|
596
578
|
peerShare: false,
|
|
597
579
|
searchable: true,
|
|
598
580
|
route: { content: '/api/docs/reader', v1: null },
|
|
@@ -615,7 +597,6 @@ export const ITEM_KINDS = {
|
|
|
615
597
|
class: 'admin_only',
|
|
616
598
|
tree: null,
|
|
617
599
|
publicLink: false,
|
|
618
|
-
contactShare: false,
|
|
619
600
|
peerShare: false,
|
|
620
601
|
searchable: true,
|
|
621
602
|
route: { content: '/api/journal', v1: '/api/v1/journal' },
|
|
@@ -638,7 +619,6 @@ export const ITEM_KINDS = {
|
|
|
638
619
|
class: 'admin_only',
|
|
639
620
|
tree: null,
|
|
640
621
|
publicLink: false,
|
|
641
|
-
contactShare: false,
|
|
642
622
|
peerShare: false,
|
|
643
623
|
searchable: false,
|
|
644
624
|
route: none,
|
|
@@ -675,7 +655,6 @@ export const ITEM_KINDS = {
|
|
|
675
655
|
shareable: true,
|
|
676
656
|
},
|
|
677
657
|
publicLink: 'moderator',
|
|
678
|
-
contactShare: true,
|
|
679
658
|
peerShare: false,
|
|
680
659
|
searchable: false,
|
|
681
660
|
route: { content: '/api/apps', v1: null },
|
|
@@ -705,7 +684,6 @@ export const ITEM_KINDS = {
|
|
|
705
684
|
shareable: true,
|
|
706
685
|
},
|
|
707
686
|
publicLink: true,
|
|
708
|
-
contactShare: true,
|
|
709
687
|
peerShare: false,
|
|
710
688
|
searchable: true,
|
|
711
689
|
route: { content: '/api/formulas', v1: null },
|
|
@@ -735,7 +713,6 @@ export const ITEM_KINDS = {
|
|
|
735
713
|
shareable: true,
|
|
736
714
|
},
|
|
737
715
|
publicLink: true,
|
|
738
|
-
contactShare: true,
|
|
739
716
|
peerShare: true,
|
|
740
717
|
searchable: true,
|
|
741
718
|
route: { content: '/api/draws', v1: null },
|
|
@@ -767,7 +744,6 @@ export const ITEM_KINDS = {
|
|
|
767
744
|
shareable: false,
|
|
768
745
|
},
|
|
769
746
|
publicLink: false,
|
|
770
|
-
contactShare: false,
|
|
771
747
|
peerShare: false,
|
|
772
748
|
searchable: false,
|
|
773
749
|
// A native map's id is its node's id (createRecallMap).
|
|
@@ -805,7 +781,6 @@ export const ITEM_KINDS = {
|
|
|
805
781
|
shareable: true,
|
|
806
782
|
},
|
|
807
783
|
publicLink: 'moderator',
|
|
808
|
-
contactShare: false,
|
|
809
784
|
peerShare: false,
|
|
810
785
|
searchable: true,
|
|
811
786
|
route: { content: '/api/presents', v1: null },
|
|
@@ -876,7 +851,6 @@ export function kindClassOf(type: string): KindClass {
|
|
|
876
851
|
|
|
877
852
|
export type WorkspaceKind = KindsWhere<{ class: 'workspace' }>;
|
|
878
853
|
export type PublicLinkKind = KindsWhere<{ publicLink: true | 'files-folder' | 'moderator' }>;
|
|
879
|
-
export type ContactShareKind = KindsWhere<{ contactShare: true }>;
|
|
880
854
|
export type PeerShareKind = KindsWhere<{ peerShare: true }>;
|
|
881
855
|
export type SearchableKind = KindsWhere<{ searchable: true }>;
|
|
882
856
|
export type MemberLibraryKind = KindsWhere<{ library: { order: number } }>;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Contact shares (migration 0214; docs/sharing.md, "Contact shares"): one
|
|
3
|
-
* workspace item shared with one contact. The contact opens the item's own
|
|
4
|
-
* link (`/s/<token>`) with their personal code. The item's level never
|
|
5
|
-
* changes, so the team never sees it. Read only, except an app with
|
|
6
|
-
* "Can write". Never brain tools.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/** A contact's sharing (the contact DTO's `sharing`); null: sharing off. */
|
|
10
|
-
export type ContactSharing = {
|
|
11
|
-
/** When the current code was made (Enable or Regenerate). */
|
|
12
|
-
enabledAt: string;
|
|
13
|
-
lastUsedAt: string | null;
|
|
14
|
-
/** 30 wrong codes in a day lock the contact for 24 hours. Regenerate
|
|
15
|
-
* clears the lock. */
|
|
16
|
-
locked: boolean;
|
|
17
|
-
/** Live contact shares of this contact. */
|
|
18
|
-
shareCount: number;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/** POST /api/contacts/:id/sharing body. */
|
|
22
|
-
export type ContactSharingAction = 'enable' | 'regenerate' | 'disable';
|
|
23
|
-
|
|
24
|
-
/** POST /api/contacts/:id/sharing answer. `code` comes ONCE (enable and
|
|
25
|
-
* regenerate); `revoked` is how many shares a disable ended. */
|
|
26
|
-
export type ContactSharingResponse = {
|
|
27
|
-
sharing: ContactSharing | null;
|
|
28
|
-
code?: string;
|
|
29
|
-
revoked?: number;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/** One row of a contact's "Shared" tab (GET /api/contacts/:id/shares). */
|
|
33
|
-
export type ContactShareRow = {
|
|
34
|
-
shareId: string;
|
|
35
|
-
nodeId: string;
|
|
36
|
-
/** The item's node type ('page', 'app', ...). */
|
|
37
|
-
kind: string;
|
|
38
|
-
icon: string | null;
|
|
39
|
-
title: string;
|
|
40
|
-
canWrite: boolean;
|
|
41
|
-
/** When the item was shared with the contact. */
|
|
42
|
-
sharedAt: string;
|
|
43
|
-
/** When the contact last opened it (null: never). */
|
|
44
|
-
lastOpenedAt: string | null;
|
|
45
|
-
/** Server-relative: `/s/<token>`. */
|
|
46
|
-
path: string;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/** GET /api/contacts/:id/shares?cursor= : live shares, newest first, 100 a
|
|
50
|
-
* page. `nextCursor` null: the last page. */
|
|
51
|
-
export type ContactSharesPage = {
|
|
52
|
-
shares: ContactShareRow[];
|
|
53
|
-
nextCursor: string | null;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
/** DELETE /api/contacts/:id/shares (Revoke all): no level changes, sharing
|
|
57
|
-
* stays on. */
|
|
58
|
-
export type ContactSharesRevokedAll = { revoked: number };
|
|
59
|
-
|
|
60
|
-
/** POST /api/shares/contacts body. `canWrite` only for an app. */
|
|
61
|
-
export type CreateContactSharesBody = {
|
|
62
|
-
nodeId: string;
|
|
63
|
-
contactIds: string[];
|
|
64
|
-
canWrite?: boolean;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/** One share POST /api/shares/contacts made (or found: the call is
|
|
68
|
-
* idempotent per item and contact). */
|
|
69
|
-
export type CreatedContactShare = {
|
|
70
|
-
shareId: string;
|
|
71
|
-
contactId: string;
|
|
72
|
-
/** Server-relative: `/s/<token>`. */
|
|
73
|
-
path: string;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/** POST /api/shares/contacts answer. */
|
|
77
|
-
export type CreateContactSharesResponse = { shares: CreatedContactShare[] };
|
|
78
|
-
|
|
79
|
-
/** Why POST /api/shares/contacts refused (400 `{ error, reason }`). */
|
|
80
|
-
export type ContactShareRefusedReason =
|
|
81
|
-
'sharing-off' | 'not-a-contact' | 'not-shareable' | 'folder' | 'write-not-app';
|
|
82
|
-
|
|
83
|
-
/** PATCH /api/shares/:id body for a contact share of an app. */
|
|
84
|
-
export type ContactShareUpdate = { canWrite: boolean };
|
|
85
|
-
|
|
86
|
-
/** One contact an item is shared with (`AccessNodeView.contactShares`). */
|
|
87
|
-
export type AccessContactShare = {
|
|
88
|
-
shareId: string;
|
|
89
|
-
contactId: string;
|
|
90
|
-
name: string;
|
|
91
|
-
canWrite: boolean;
|
|
92
|
-
/** The contact's sharing is on: off means the link opens nothing (a
|
|
93
|
-
* switch off revokes the shares, so this is rarely false). */
|
|
94
|
-
sharingOn: boolean;
|
|
95
|
-
lastOpenedAt: string | null;
|
|
96
|
-
/** Server-relative: `/s/<token>`. */
|
|
97
|
-
path: string;
|
|
98
|
-
};
|