@deveye/types 0.15.1 → 0.16.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 +9 -6
- package/src/domain/device.ts +4 -29
- package/src/domain/featureRegistry.ts +40 -108
- package/src/domain/home.ts +40 -101
- package/src/domain/live.ts +36 -87
- package/src/domain/metrics.ts +10 -14
- package/src/domain/notifications.ts +39 -110
- package/src/domain/project.ts +3 -162
- package/src/domain/report.ts +46 -95
- package/src/domain/secrecy.ts +3 -5
- package/src/domain/sharing.ts +33 -70
- package/src/domain/syncProtocol.ts +5 -12
- package/src/domain/user.ts +8 -14
- package/src/domain/workspace.ts +0 -3
- package/src/domain/workspaceRole.ts +34 -82
- package/src/features/agent.ts +306 -0
- package/src/features/live.ts +17 -37
- package/src/features/notify.ts +19 -57
- package/src/features/registry.ts +7 -44
- package/src/features/secrecy.ts +4 -9
- package/src/features/sharing.ts +12 -26
- package/src/features/user.ts +6 -11
- package/src/features/workspace.ts +6 -11
- package/src/http/auth.ts +6 -13
- package/src/http/device.ts +13 -17
- package/src/http/status.ts +6 -10
- package/src/index.ts +29 -932
- package/src/protocol/agent.ts +40 -70
- package/src/protocol/envelope.ts +3 -10
- package/src/sdk/client-ambient.d.ts +244 -22
- package/src/sdk/client.ts +277 -17
- package/src/sdk/devb.ts +120 -0
- package/src/sdk/manifest.test.ts +96 -0
- package/src/sdk/manifest.ts +160 -25
- package/src/sdk/providers.ts +310 -5
- package/src/sdk/server.ts +483 -19
- package/src/sdk/testing.test.ts +62 -0
- package/src/sdk/testing.ts +416 -40
- package/src/utils/version.ts +5 -8
- package/src/domain/audience.ts +0 -549
- package/src/domain/backup.ts +0 -355
- package/src/domain/credential.ts +0 -55
- package/src/domain/database.ts +0 -467
- package/src/domain/deploy.ts +0 -231
- package/src/domain/finance.ts +0 -477
- package/src/domain/git.ts +0 -419
- package/src/domain/mail.ts +0 -394
- package/src/domain/note.ts +0 -202
- package/src/domain/password.ts +0 -36
- package/src/domain/projectBoard.ts +0 -130
- package/src/domain/projectChat.ts +0 -46
- package/src/domain/projectHistory.ts +0 -82
- package/src/domain/projectLink.ts +0 -87
- package/src/domain/projectPlan.ts +0 -68
- package/src/domain/sentinel.ts +0 -623
- package/src/domain/uptime.ts +0 -216
- package/src/features/audience.ts +0 -275
- package/src/features/backup.ts +0 -230
- package/src/features/database.ts +0 -461
- package/src/features/deploy.ts +0 -245
- package/src/features/device.ts +0 -292
- package/src/features/deviceFiles.ts +0 -83
- package/src/features/deviceLogs.ts +0 -36
- package/src/features/deviceTerminal.ts +0 -57
- package/src/features/finance.ts +0 -360
- package/src/features/git.ts +0 -368
- package/src/features/mail.ts +0 -374
- package/src/features/metrics.ts +0 -185
- package/src/features/note.ts +0 -189
- package/src/features/password.ts +0 -67
- package/src/features/project.ts +0 -709
- package/src/features/sentinel.ts +0 -233
- package/src/features/uptime.ts +0 -186
package/src/features/note.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
NOTE_FOLDER_MAX_LENGTH,
|
|
4
|
-
NOTE_MAX_BLOCKS,
|
|
5
|
-
NOTE_TITLE_MAX_LENGTH,
|
|
6
|
-
noteBlockSchema,
|
|
7
|
-
noteFolderSchema,
|
|
8
|
-
noteSchema,
|
|
9
|
-
noteSummarySchema
|
|
10
|
-
} from '../domain/note';
|
|
11
|
-
|
|
12
|
-
const folderId = z.number().int().positive();
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Commandes des notes et de leurs dossiers.
|
|
16
|
-
*
|
|
17
|
-
* L'espace visé n'apparaît dans aucune entrée : il voyage sur l'enveloppe WS
|
|
18
|
-
* (voir `protocol/envelope`) et le dispatcheur le résout avant le handler.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/** The editable shape of a note — everything the client may set. */
|
|
22
|
-
const noteDraftSchema = z.object({
|
|
23
|
-
title: z.string().max(NOTE_TITLE_MAX_LENGTH),
|
|
24
|
-
folderId: folderId.nullable(),
|
|
25
|
-
blocks: z.array(noteBlockSchema).max(NOTE_MAX_BLOCKS),
|
|
26
|
-
/** Encrypt the body with the password-protected key rather than the open one. */
|
|
27
|
-
private: z.boolean()
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* List the notes of the active workspace. Never gated: regular notes are decrypted with the
|
|
32
|
-
* open key, and private notes come back **masked** (metadata only,
|
|
33
|
-
* `masked: true`) while the session is locked. Unlocking and re-listing reveals
|
|
34
|
-
* them — no per-command password is involved.
|
|
35
|
-
*
|
|
36
|
-
* `archived` swaps the two disjoint sets: the active notes (default) or the
|
|
37
|
-
* archive, most recently archived first.
|
|
38
|
-
*/
|
|
39
|
-
export const noteList = {
|
|
40
|
-
command: 'note.list' as const,
|
|
41
|
-
input: z.object({ archived: z.boolean().optional() }),
|
|
42
|
-
output: z.object({ notes: z.array(noteSummarySchema) })
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Count the **active** notes of the active workspace. Pure clear metadata: every
|
|
47
|
-
* row is counted the same way — private notes included, no special case —
|
|
48
|
-
* without decrypting anything, so the dashboard widget always shows a number
|
|
49
|
-
* even when the session is locked. Archived notes are excluded.
|
|
50
|
-
*/
|
|
51
|
-
export const noteCount = {
|
|
52
|
-
command: 'note.count' as const,
|
|
53
|
-
input: z.object({}),
|
|
54
|
-
output: z.object({ count: z.number().int().nonnegative() })
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Fetch one note in full. A private note requires the session to be unlocked;
|
|
59
|
-
* otherwise the server replies `locked` and the client opens the usual unlock
|
|
60
|
-
* prompt before retrying.
|
|
61
|
-
*/
|
|
62
|
-
export const noteGet = {
|
|
63
|
-
command: 'note.get' as const,
|
|
64
|
-
input: z.object({ noteId: z.number().int().positive() }),
|
|
65
|
-
output: z.object({ note: noteSchema })
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const noteAdd = {
|
|
69
|
-
command: 'note.add' as const,
|
|
70
|
-
input: z.object({ note: noteDraftSchema }),
|
|
71
|
-
output: z.object({ note: noteSchema })
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Edit a note. Touching a note that is (or becomes) private requires the session
|
|
76
|
-
* to be unlocked; the draft's `private` flag decides which key the new body is
|
|
77
|
-
* written with, so flipping it re-encrypts the note into the other tier.
|
|
78
|
-
*/
|
|
79
|
-
export const noteEdit = {
|
|
80
|
-
command: 'note.edit' as const,
|
|
81
|
-
input: z.object({
|
|
82
|
-
noteId: z.number().int().positive(),
|
|
83
|
-
note: noteDraftSchema
|
|
84
|
-
}),
|
|
85
|
-
output: z.object({ note: noteSchema })
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Archive a note: it leaves the main list but nothing is destroyed. This is what
|
|
90
|
-
* "supprimer" does in the UI — {@link noteDelete} is the deliberate second step.
|
|
91
|
-
*/
|
|
92
|
-
export const noteArchive = {
|
|
93
|
-
command: 'note.archive' as const,
|
|
94
|
-
input: z.object({ noteId: z.number().int().positive() }),
|
|
95
|
-
output: z.object({ noteId: z.number().int().positive() })
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/** Bring an archived note back into the active list. */
|
|
99
|
-
export const noteRestore = {
|
|
100
|
-
command: 'note.restore' as const,
|
|
101
|
-
input: z.object({ noteId: z.number().int().positive() }),
|
|
102
|
-
output: z.object({ noteId: z.number().int().positive() })
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Destroy a note for good. Only ever accepted on an **archived** note (`conflict`
|
|
107
|
-
* otherwise), so nothing can be lost in one click. Like archiving, it requires
|
|
108
|
-
* the session to be unlocked when the note is private.
|
|
109
|
-
*/
|
|
110
|
-
export const noteDelete = {
|
|
111
|
-
command: 'note.delete' as const,
|
|
112
|
-
input: z.object({ noteId: z.number().int().positive() }),
|
|
113
|
-
output: z.object({ noteId: z.number().int().positive() })
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Lay out one folder: `noteIds` is its **complete** content in its final order
|
|
118
|
-
* (lower index first), and every listed note is filed into `folderId` on the way.
|
|
119
|
-
* One command covers both reordering inside a folder and moving a note across
|
|
120
|
-
* folders — the destination's new order is all the server needs.
|
|
121
|
-
*
|
|
122
|
-
* Notes carry no automatic ordering: this, plus appending new notes at the end,
|
|
123
|
-
* is the only thing that positions them. Never touches the encrypted body, so it
|
|
124
|
-
* works on masked private notes too.
|
|
125
|
-
*/
|
|
126
|
-
export const noteReorder = {
|
|
127
|
-
command: 'note.reorder' as const,
|
|
128
|
-
input: z.object({
|
|
129
|
-
folderId: folderId.nullable(),
|
|
130
|
-
noteIds: z.array(z.number().int().positive()).min(1)
|
|
131
|
-
}),
|
|
132
|
-
output: z.object({
|
|
133
|
-
folderId: folderId.nullable(),
|
|
134
|
-
noteIds: z.array(z.number().int().positive())
|
|
135
|
-
})
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/** List the active workspace's folders (names decrypted server-side). */
|
|
139
|
-
export const folderList = {
|
|
140
|
-
command: 'folder.list' as const,
|
|
141
|
-
input: z.object({}),
|
|
142
|
-
output: z.object({ folders: z.array(noteFolderSchema) })
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export const folderAdd = {
|
|
146
|
-
command: 'folder.add' as const,
|
|
147
|
-
input: z.object({ name: z.string().min(1).max(NOTE_FOLDER_MAX_LENGTH) }),
|
|
148
|
-
output: z.object({ folder: noteFolderSchema })
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export const folderRename = {
|
|
152
|
-
command: 'folder.rename' as const,
|
|
153
|
-
input: z.object({ folderId, name: z.string().min(1).max(NOTE_FOLDER_MAX_LENGTH) }),
|
|
154
|
-
output: z.object({ folder: noteFolderSchema })
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Reorder all of the active workspace's folders; `folderIds` is the new
|
|
159
|
-
* full order (lower index = listed first). Used by the move up/down controls.
|
|
160
|
-
*/
|
|
161
|
-
export const folderReorder = {
|
|
162
|
-
command: 'folder.reorder' as const,
|
|
163
|
-
input: z.object({ folderIds: z.array(folderId).min(1) }),
|
|
164
|
-
output: z.object({ folders: z.array(noteFolderSchema) })
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
/** Delete a folder; its notes are un-filed (folderId → null), not destroyed. */
|
|
168
|
-
export const folderDelete = {
|
|
169
|
-
command: 'folder.delete' as const,
|
|
170
|
-
input: z.object({ folderId }),
|
|
171
|
-
output: z.object({ folderId })
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export const noteCommands = [
|
|
175
|
-
noteList,
|
|
176
|
-
noteCount,
|
|
177
|
-
noteGet,
|
|
178
|
-
noteAdd,
|
|
179
|
-
noteEdit,
|
|
180
|
-
noteArchive,
|
|
181
|
-
noteRestore,
|
|
182
|
-
noteDelete,
|
|
183
|
-
noteReorder,
|
|
184
|
-
folderList,
|
|
185
|
-
folderAdd,
|
|
186
|
-
folderRename,
|
|
187
|
-
folderReorder,
|
|
188
|
-
folderDelete
|
|
189
|
-
] as const;
|
package/src/features/password.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { passwordEntryMaskedSchema, passwordEntrySchema } from '../domain/password';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Commandes du coffre de mots de passe.
|
|
6
|
-
*
|
|
7
|
-
* L'espace visé n'apparaît dans aucune entrée : il voyage sur l'enveloppe WS
|
|
8
|
-
* (voir `protocol/envelope`) et le dispatcheur le résout avant le handler.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export const passwordList = {
|
|
12
|
-
command: 'password.list' as const,
|
|
13
|
-
input: z.object({}),
|
|
14
|
-
output: z.object({ entries: z.array(passwordEntryMaskedSchema) })
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Compte les entrées de l'espace. Métadonnées claires uniquement (un nombre de
|
|
19
|
-
* lignes, aucun déchiffrement) : contrairement à `password.list`, la commande
|
|
20
|
-
* n'exige jamais que le chiffrement par mot de passe soit déverrouillé, donc le
|
|
21
|
-
* widget d'accueil affiche toujours un nombre, même session verrouillée.
|
|
22
|
-
*/
|
|
23
|
-
export const passwordCount = {
|
|
24
|
-
command: 'password.count' as const,
|
|
25
|
-
input: z.object({}),
|
|
26
|
-
output: z.object({ count: z.number().int().nonnegative() })
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const passwordGet = {
|
|
30
|
-
command: 'password.get' as const,
|
|
31
|
-
input: z.object({ passwordId: z.number().int().positive() }),
|
|
32
|
-
output: z.object({ entry: passwordEntrySchema })
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const passwordAdd = {
|
|
36
|
-
command: 'password.add' as const,
|
|
37
|
-
input: z.object({ entry: passwordEntrySchema.omit({ id: true }) }),
|
|
38
|
-
output: z.object({ entry: passwordEntrySchema })
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const passwordEdit = {
|
|
42
|
-
command: 'password.edit' as const,
|
|
43
|
-
input: z.object({ entry: passwordEntrySchema }),
|
|
44
|
-
output: z.object({ entry: passwordEntrySchema })
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const passwordDelete = {
|
|
48
|
-
command: 'password.delete' as const,
|
|
49
|
-
input: z.object({ passwordId: z.number().int().positive() }),
|
|
50
|
-
output: z.object({ passwordId: z.number().int().positive() })
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const passwordUnlock = {
|
|
54
|
-
command: 'password.unlock' as const,
|
|
55
|
-
input: z.object({ password: z.string().min(1) }),
|
|
56
|
-
output: z.object({ unlocked: z.literal(true) })
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const passwordCommands = [
|
|
60
|
-
passwordList,
|
|
61
|
-
passwordCount,
|
|
62
|
-
passwordGet,
|
|
63
|
-
passwordAdd,
|
|
64
|
-
passwordEdit,
|
|
65
|
-
passwordDelete,
|
|
66
|
-
passwordUnlock
|
|
67
|
-
] as const;
|