-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd-actions.ts
More file actions
50 lines (47 loc) · 1.33 KB
/
cmd-actions.ts
File metadata and controls
50 lines (47 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
export const ActionTypes = ["OK", "ERROR", "RESULT", "SINGLE_RESULT", "SELF"] as const;
export type ActionType = (typeof ActionTypes)[number];
const CmdActions = {
OK: "OK",
END: "SELF",
DELETED: "OK",
TOUCHED: "OK",
STORED: "OK",
//
VALUE: "SELF",
STAT: "RESULT",
VERSION: "SINGLE_RESULT",
//
NOT_STORED: "ERROR",
EXISTS: "ERROR",
NOT_FOUND: "ERROR",
//
ERROR: "ERROR",
CLIENT_ERROR: "ERROR",
SERVER_ERROR: "ERROR",
// Slabs Reassign error responses
// - "BUSY [message]" to indicate a page is already being processed, try again
// later.
// - "BUSY [message]" to indicate the crawler is already processing a request.
BUSY: "ERROR",
// - "BADCLASS [message]" a bad class id was specified
BADCLASS: "ERROR",
// - "NOSPARE [message]" source class has no spare pages
NOSPARE: "ERROR",
// - "NOTFULL [message]" dest class must be full to move new pages to it
NOTFULL: "ERROR",
// - "UNSAFE [message]" source class cannot move a page right now
UNSAFE: "ERROR",
// - "SAME [message]" must specify different source/dest ids.
SAME: "ERROR",
// Meta Protocol commands uses two letter codes
HD: "OK",
VA: "SELF",
EN: "SELF",
ME: "SELF",
NS: "ERROR",
EX: "ERROR",
NF: "ERROR",
MN: "SELF",
} as const;
export type CommandAction = keyof typeof CmdActions;
export default CmdActions;