@karmaniverous/jeeves-server-core 0.3.0 → 0.5.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/README.md +58 -13
- package/dist/openapi.json.js +4038 -0
- package/dist/scripts/openapiInfo.d.ts +15 -0
- package/dist/src/catalog/browserSafe.test.d.ts +4 -0
- package/dist/src/catalog/contentEntries.d.ts +468 -0
- package/dist/src/catalog/contentEntries.js +150 -0
- package/dist/src/catalog/contentSchemas.d.ts +179 -0
- package/dist/src/catalog/contentSchemas.js +195 -0
- package/dist/src/catalog/descriptions.d.ts +52 -0
- package/dist/src/catalog/descriptions.js +54 -0
- package/dist/src/catalog/eventEntries.d.ts +70 -0
- package/dist/src/catalog/eventEntries.js +59 -0
- package/dist/src/catalog/fileMutateSchema.d.ts +41 -0
- package/dist/src/catalog/fileMutateSchema.js +77 -0
- package/dist/src/catalog/index.d.ts +15 -0
- package/dist/src/catalog/index.js +10 -0
- package/dist/src/catalog/oauthEntries.d.ts +125 -0
- package/dist/src/catalog/oauthEntries.js +92 -0
- package/dist/src/catalog/route.d.ts +137 -0
- package/dist/src/catalog/route.js +92 -0
- package/dist/src/catalog/runnerEntries.d.ts +145 -0
- package/dist/src/catalog/runnerEntries.js +69 -0
- package/dist/src/catalog/schemas.test.d.ts +4 -0
- package/dist/src/catalog/serverCatalog.d.ts +1143 -0
- package/dist/src/catalog/serverCatalog.js +37 -0
- package/dist/src/catalog/serverCatalog.test.d.ts +4 -0
- package/dist/src/catalog/sharingEntries.d.ts +200 -0
- package/dist/src/catalog/sharingEntries.js +146 -0
- package/dist/src/catalog/statusSchemas.d.ts +87 -0
- package/dist/src/catalog/statusSchemas.js +119 -0
- package/dist/src/catalog/utilityEntries.d.ts +151 -0
- package/dist/src/catalog/utilityEntries.js +62 -0
- package/dist/src/catalog/utilitySchemas.d.ts +98 -0
- package/dist/src/catalog/utilitySchemas.js +131 -0
- package/dist/src/configAuthSchema.d.ts +100 -0
- package/dist/src/configAuthSchema.js +119 -0
- package/dist/src/configFeatureSchemas.d.ts +43 -0
- package/dist/src/configFeatureSchemas.js +53 -0
- package/dist/src/configPrintStyles.d.ts +63 -0
- package/dist/src/configPrintStyles.js +98 -0
- package/dist/src/configPrintStyles.test.d.ts +1 -0
- package/dist/src/crypto.d.ts +6 -13
- package/dist/src/crypto.js +7 -32
- package/dist/src/crypto.test.d.ts +7 -0
- package/dist/src/errors.d.ts +51 -0
- package/dist/src/errors.js +97 -0
- package/dist/src/errors.test.d.ts +4 -0
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.js +18 -3
- package/dist/src/openapi.d.ts +13 -0
- package/dist/src/openapi.js +17 -0
- package/dist/src/openapi.test.d.ts +4 -0
- package/dist/src/schema.d.ts +21 -122
- package/dist/src/schema.js +39 -153
- package/dist/src/schema.publicUrl.test.d.ts +1 -0
- package/dist/src/schema.test.d.ts +1 -0
- package/dist/src/types.d.ts +7 -0
- package/dist/src/urlKey.d.ts +24 -0
- package/dist/src/urlKey.js +43 -0
- package/dist/src/urlKey.test.d.ts +1 -0
- package/openapi.json +3934 -0
- package/package.json +31 -16
- package/dist/src/endpoints.d.ts +0 -34
- package/dist/src/endpoints.js +0 -235
- /package/dist/src/{endpoints.test.d.ts → configAuthSchema.test.d.ts} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runner proxy entries of the server catalog (Decision 28): the fixed set of jeeves-runner routes the server forwards (the 3.15.0 set, with enable and disable as `PATCH`), each with a fixed path and an opaque response so the runner's answers aren't re-described and strict response validation passes whatever the runner returns. Any other `/api/runner/*` path is no entry, so the server answers it 404 and never forwards it. Pure.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/** The runner proxy entries. */
|
|
8
|
+
export declare const RUNNER_ENTRIES: readonly [{
|
|
9
|
+
readonly kind: "read";
|
|
10
|
+
readonly response: z.ZodUnknown;
|
|
11
|
+
readonly auth: {
|
|
12
|
+
readonly schemes: readonly [{
|
|
13
|
+
readonly in: "query";
|
|
14
|
+
readonly name: "k";
|
|
15
|
+
}, {
|
|
16
|
+
readonly in: "cookie";
|
|
17
|
+
readonly name: "jeeves_session";
|
|
18
|
+
}];
|
|
19
|
+
readonly insiderOnly: true;
|
|
20
|
+
};
|
|
21
|
+
readonly name: "runnerListJobs";
|
|
22
|
+
readonly method: "GET";
|
|
23
|
+
readonly path: "/api/runner/jobs";
|
|
24
|
+
readonly description: "List the jeeves-runner jobs (runner GET /jobs).";
|
|
25
|
+
}, {
|
|
26
|
+
readonly kind: "read";
|
|
27
|
+
readonly response: z.ZodUnknown;
|
|
28
|
+
readonly auth: {
|
|
29
|
+
readonly schemes: readonly [{
|
|
30
|
+
readonly in: "query";
|
|
31
|
+
readonly name: "k";
|
|
32
|
+
}, {
|
|
33
|
+
readonly in: "cookie";
|
|
34
|
+
readonly name: "jeeves_session";
|
|
35
|
+
}];
|
|
36
|
+
readonly insiderOnly: true;
|
|
37
|
+
};
|
|
38
|
+
readonly params: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
readonly name: "runnerGetJob";
|
|
42
|
+
readonly method: "GET";
|
|
43
|
+
readonly path: "/api/runner/jobs/:id";
|
|
44
|
+
readonly description: "One jeeves-runner job (runner GET /jobs/:id).";
|
|
45
|
+
}, {
|
|
46
|
+
readonly kind: "read";
|
|
47
|
+
readonly response: z.ZodUnknown;
|
|
48
|
+
readonly auth: {
|
|
49
|
+
readonly schemes: readonly [{
|
|
50
|
+
readonly in: "query";
|
|
51
|
+
readonly name: "k";
|
|
52
|
+
}, {
|
|
53
|
+
readonly in: "cookie";
|
|
54
|
+
readonly name: "jeeves_session";
|
|
55
|
+
}];
|
|
56
|
+
readonly insiderOnly: true;
|
|
57
|
+
};
|
|
58
|
+
readonly params: z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
readonly query: z.ZodObject<{
|
|
62
|
+
limit: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
readonly name: "runnerListRuns";
|
|
65
|
+
readonly method: "GET";
|
|
66
|
+
readonly path: "/api/runner/jobs/:id/runs";
|
|
67
|
+
readonly description: "A jeeves-runner job's recent runs (runner GET /jobs/:id/runs).";
|
|
68
|
+
}, {
|
|
69
|
+
readonly kind: "write";
|
|
70
|
+
readonly response: z.ZodUnknown;
|
|
71
|
+
readonly auth: {
|
|
72
|
+
readonly schemes: readonly [{
|
|
73
|
+
readonly in: "query";
|
|
74
|
+
readonly name: "k";
|
|
75
|
+
}, {
|
|
76
|
+
readonly in: "cookie";
|
|
77
|
+
readonly name: "jeeves_session";
|
|
78
|
+
}];
|
|
79
|
+
readonly insiderOnly: true;
|
|
80
|
+
};
|
|
81
|
+
readonly params: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
readonly name: "runnerRunJob";
|
|
85
|
+
readonly method: "POST";
|
|
86
|
+
readonly path: "/api/runner/jobs/:id/run";
|
|
87
|
+
readonly description: "Run a jeeves-runner job now (runner POST /jobs/:id/run).";
|
|
88
|
+
}, {
|
|
89
|
+
readonly kind: "write";
|
|
90
|
+
readonly response: z.ZodUnknown;
|
|
91
|
+
readonly auth: {
|
|
92
|
+
readonly schemes: readonly [{
|
|
93
|
+
readonly in: "query";
|
|
94
|
+
readonly name: "k";
|
|
95
|
+
}, {
|
|
96
|
+
readonly in: "cookie";
|
|
97
|
+
readonly name: "jeeves_session";
|
|
98
|
+
}];
|
|
99
|
+
readonly insiderOnly: true;
|
|
100
|
+
};
|
|
101
|
+
readonly params: z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
readonly name: "runnerEnableJob";
|
|
105
|
+
readonly method: "PATCH";
|
|
106
|
+
readonly path: "/api/runner/jobs/:id/enable";
|
|
107
|
+
readonly description: "Enable a jeeves-runner job (runner PATCH /jobs/:id/enable).";
|
|
108
|
+
}, {
|
|
109
|
+
readonly kind: "write";
|
|
110
|
+
readonly response: z.ZodUnknown;
|
|
111
|
+
readonly auth: {
|
|
112
|
+
readonly schemes: readonly [{
|
|
113
|
+
readonly in: "query";
|
|
114
|
+
readonly name: "k";
|
|
115
|
+
}, {
|
|
116
|
+
readonly in: "cookie";
|
|
117
|
+
readonly name: "jeeves_session";
|
|
118
|
+
}];
|
|
119
|
+
readonly insiderOnly: true;
|
|
120
|
+
};
|
|
121
|
+
readonly params: z.ZodObject<{
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
readonly name: "runnerDisableJob";
|
|
125
|
+
readonly method: "PATCH";
|
|
126
|
+
readonly path: "/api/runner/jobs/:id/disable";
|
|
127
|
+
readonly description: "Disable a jeeves-runner job (runner PATCH /jobs/:id/disable).";
|
|
128
|
+
}, {
|
|
129
|
+
readonly kind: "read";
|
|
130
|
+
readonly response: z.ZodUnknown;
|
|
131
|
+
readonly auth: {
|
|
132
|
+
readonly schemes: readonly [{
|
|
133
|
+
readonly in: "query";
|
|
134
|
+
readonly name: "k";
|
|
135
|
+
}, {
|
|
136
|
+
readonly in: "cookie";
|
|
137
|
+
readonly name: "jeeves_session";
|
|
138
|
+
}];
|
|
139
|
+
readonly insiderOnly: true;
|
|
140
|
+
};
|
|
141
|
+
readonly name: "runnerStatus";
|
|
142
|
+
readonly method: "GET";
|
|
143
|
+
readonly path: "/api/runner/status";
|
|
144
|
+
readonly description: "jeeves-runner status (runner GET /status).";
|
|
145
|
+
}];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { INSIDER_ONLY, route } from './route.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The runner proxy entries of the server catalog (Decision 28): the fixed set of jeeves-runner routes the server forwards (the 3.15.0 set, with enable and disable as `PATCH`), each with a fixed path and an opaque response so the runner's answers aren't re-described and strict response validation passes whatever the runner returns. Any other `/api/runner/*` path is no entry, so the server answers it 404 and never forwards it. Pure.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/** `:id`: the runner job; never `.`, `..`, a slash or a control character, so its runner path stays `/jobs/<id>`. */
|
|
10
|
+
const jobParams = z.object({
|
|
11
|
+
id: z
|
|
12
|
+
.string()
|
|
13
|
+
.regex(/^(?!\.{1,2}$)[^/\\\p{Cc}]+$/u)
|
|
14
|
+
.describe('Runner job ID: not `.` or `..`, no `/` or `\\`, and no control characters.'),
|
|
15
|
+
});
|
|
16
|
+
/** Query of the job runs entry. */
|
|
17
|
+
const runsQuery = z.object({
|
|
18
|
+
limit: z.string().optional().describe('Maximum number of runs (default 20).'),
|
|
19
|
+
});
|
|
20
|
+
/** Whatever the runner answers. */
|
|
21
|
+
const runnerResponse = z.unknown();
|
|
22
|
+
/** Fields every runner entry shares. */
|
|
23
|
+
const RUNNER = { response: runnerResponse, auth: INSIDER_ONLY };
|
|
24
|
+
/** The runner proxy entries. */
|
|
25
|
+
const RUNNER_ENTRIES = [
|
|
26
|
+
{
|
|
27
|
+
...route('runnerListJobs', 'GET', '/api/runner/jobs'),
|
|
28
|
+
...RUNNER,
|
|
29
|
+
kind: 'read',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
...route('runnerGetJob', 'GET', '/api/runner/jobs/:id'),
|
|
33
|
+
params: jobParams,
|
|
34
|
+
...RUNNER,
|
|
35
|
+
kind: 'read',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
...route('runnerListRuns', 'GET', '/api/runner/jobs/:id/runs'),
|
|
39
|
+
params: jobParams,
|
|
40
|
+
query: runsQuery,
|
|
41
|
+
...RUNNER,
|
|
42
|
+
kind: 'read',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
...route('runnerRunJob', 'POST', '/api/runner/jobs/:id/run'),
|
|
46
|
+
params: jobParams,
|
|
47
|
+
...RUNNER,
|
|
48
|
+
kind: 'write',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
...route('runnerEnableJob', 'PATCH', '/api/runner/jobs/:id/enable'),
|
|
52
|
+
params: jobParams,
|
|
53
|
+
...RUNNER,
|
|
54
|
+
kind: 'write',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
...route('runnerDisableJob', 'PATCH', '/api/runner/jobs/:id/disable'),
|
|
58
|
+
params: jobParams,
|
|
59
|
+
...RUNNER,
|
|
60
|
+
kind: 'write',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
...route('runnerStatus', 'GET', '/api/runner/status'),
|
|
64
|
+
...RUNNER,
|
|
65
|
+
kind: 'read',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
export { RUNNER_ENTRIES };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request and response schemas of `SERVER_CATALOG` that carry rules of their own: the `fileMutate` per-action refinement, `receiveEvent` objects only (Decision 14), the opaque runner entries, the `status` health block (Decision 22 and the 3.16.0 additions), `browse` unions and the share query.
|
|
3
|
+
*/
|
|
4
|
+
export {};
|