@sasjs/api 0.32.0 → 0.35.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.
Files changed (38) hide show
  1. package/build/browser.js +2274 -1
  2. package/build/cjs/corpus/viya/operations.js +647 -0
  3. package/build/cjs/index.js +65 -40
  4. package/build/cjs/viya/dispatch.js +141 -0
  5. package/build/cjs/viya/overlay.js +104 -0
  6. package/build/cjs/viya/service.js +317 -0
  7. package/build/cjs/viya/surface.js +326 -0
  8. package/build/cjs/viya/table.js +805 -0
  9. package/build/cjs/viya/unrecorded.js +58 -0
  10. package/build/cjs/viya/version.js +43 -0
  11. package/build/esm/corpus/viya/operations.d.ts +28 -0
  12. package/build/esm/corpus/viya/operations.d.ts.map +1 -0
  13. package/build/esm/corpus/viya/operations.js +644 -0
  14. package/build/esm/index.d.ts +14 -0
  15. package/build/esm/index.d.ts.map +1 -1
  16. package/build/esm/index.js +10 -0
  17. package/build/esm/viya/dispatch.d.ts +35 -0
  18. package/build/esm/viya/dispatch.d.ts.map +1 -0
  19. package/build/esm/viya/dispatch.js +136 -0
  20. package/build/esm/viya/overlay.d.ts +25 -0
  21. package/build/esm/viya/overlay.d.ts.map +1 -0
  22. package/build/esm/viya/overlay.js +100 -0
  23. package/build/esm/viya/service.d.ts +44 -0
  24. package/build/esm/viya/service.d.ts.map +1 -0
  25. package/build/esm/viya/service.js +313 -0
  26. package/build/esm/viya/surface.d.ts +26 -0
  27. package/build/esm/viya/surface.d.ts.map +1 -0
  28. package/build/esm/viya/surface.js +323 -0
  29. package/build/esm/viya/table.d.ts +39 -0
  30. package/build/esm/viya/table.d.ts.map +1 -0
  31. package/build/esm/viya/table.js +802 -0
  32. package/build/esm/viya/unrecorded.d.ts +24 -0
  33. package/build/esm/viya/unrecorded.d.ts.map +1 -0
  34. package/build/esm/viya/unrecorded.js +55 -0
  35. package/build/esm/viya/version.d.ts +37 -0
  36. package/build/esm/viya/version.d.ts.map +1 -0
  37. package/build/esm/viya/version.js +39 -0
  38. package/package.json +5 -1
@@ -0,0 +1,313 @@
1
+ import { ApiError } from '../types.js';
2
+ /** The emulated clock: a fixed instant, so a body is reproducible. */
3
+ export const EMULATED_NOW = '2026-01-01T00:00:00.000Z';
4
+ /** The caller the emulated estate reports when a host does not name one. */
5
+ export const EMULATED_USER = { id: 'emulated-user', name: 'Emulated User' };
6
+ /**
7
+ * A uuid shape from a string, deterministically.
8
+ *
9
+ * Two 32-bit FNV-1a passes give enough of a hash to fill a uuid's fields, and the
10
+ * version/variant nibbles are set so the result is a well-formed v4-shaped id.
11
+ * Collisions are possible in principle and irrelevant here: the id is a handle
12
+ * the emulator hands back, not a uniqueness guarantee.
13
+ */
14
+ export const idFor = (path, kind = 'folder') => {
15
+ const hash = (input, seed) => {
16
+ let value = seed;
17
+ for (let index = 0; index < input.length; index++) {
18
+ value ^= input.charCodeAt(index);
19
+ value = Math.imul(value, 16777619) >>> 0;
20
+ }
21
+ return value.toString(16).padStart(8, '0');
22
+ };
23
+ const raw = hash(`${kind}:${path}`, 2166136261) +
24
+ hash(`${kind}:${path}`, 2246822519) +
25
+ hash(`${kind}:${path}`, 3266489917) +
26
+ hash(`${kind}:${path}`, 668265263);
27
+ const hex = raw.slice(0, 32);
28
+ return [
29
+ hex.slice(0, 8),
30
+ hex.slice(8, 12),
31
+ `4${hex.slice(13, 16)}`,
32
+ `a${hex.slice(17, 20)}`,
33
+ hex.slice(20, 32)
34
+ ].join('-');
35
+ };
36
+ const linksFor = (uri, collection = false) => {
37
+ const self = {
38
+ href: uri,
39
+ uri,
40
+ rel: 'self',
41
+ method: 'GET',
42
+ type: 'application/vnd.sas.folder'
43
+ };
44
+ const members = {
45
+ href: `${uri}/members`,
46
+ uri: `${uri}/members`,
47
+ rel: 'members',
48
+ method: 'GET',
49
+ type: 'application/vnd.sas.collection',
50
+ itemType: 'folder'
51
+ };
52
+ // a collection answer leads with the collection link, which carries the
53
+ // itemType its capture recorded
54
+ return collection ? [members, self] : [self, members];
55
+ };
56
+ const folderBody = async (drive, path) => {
57
+ const listing = await drive.list(path);
58
+ const id = idFor(path);
59
+ const name = path.split('/').filter(Boolean).pop() ?? '';
60
+ const parent = path.split('/').slice(0, -1).join('/') || '/';
61
+ return {
62
+ id,
63
+ name,
64
+ description: '',
65
+ type: 'folder',
66
+ version: 1,
67
+ createdBy: EMULATED_USER.id,
68
+ modifiedBy: EMULATED_USER.id,
69
+ creationTimeStamp: EMULATED_NOW,
70
+ modifiedTimeStamp: EMULATED_NOW,
71
+ memberCount: listing.files.length + listing.folders.length,
72
+ parentFolderUri: `/folders/folders/${idFor(parent)}`,
73
+ links: linksFor(`/folders/folders/${id}`)
74
+ };
75
+ };
76
+ const recycleBin = () => {
77
+ const path = '@myRecycleBin';
78
+ const id = idFor(path);
79
+ return {
80
+ id,
81
+ name: 'Recycle Bin',
82
+ description: 'Recycle Bin',
83
+ type: 'trashFolder',
84
+ version: 1,
85
+ createdBy: EMULATED_USER.id,
86
+ modifiedBy: EMULATED_USER.id,
87
+ creationTimeStamp: EMULATED_NOW,
88
+ modifiedTimeStamp: EMULATED_NOW,
89
+ memberCount: 0,
90
+ parentFolderUri: '',
91
+ properties: { allowMove: 'false' },
92
+ links: linksFor(`/folders/folders/${id}`)
93
+ };
94
+ };
95
+ const requireDrive = (services) => {
96
+ if (!services.drive)
97
+ throw new ApiError(501, 'This host has no drive, so it cannot answer a folder operation.');
98
+ return services.drive;
99
+ };
100
+ const pathFromQuery = (request) => {
101
+ const path = request.query?.path;
102
+ if (!path)
103
+ throw new ApiError(400, 'The path parameter is required.');
104
+ return path;
105
+ };
106
+ /** The recycle-bin alias the emulator answers, which is also a valid parent. */
107
+ const RECYCLE_BIN_ALIAS = '/folders/folders/@myRecycleBin';
108
+ const isRecycleBin = (uri) => !!uri &&
109
+ (uri === RECYCLE_BIN_ALIAS || uri.endsWith(`/${idFor('@myRecycleBin')}`));
110
+ /**
111
+ * The path a folder id stands for, found by walking the drive.
112
+ *
113
+ * An id is derived from a path, so the drive is the index: a map would be a
114
+ * second source of truth that goes stale the moment a folder is renamed or
115
+ * moved - and would answer 404 for every id after a restart, which is the
116
+ * opposite of "a client stores an id and asks for it later".
117
+ */
118
+ const pathForId = async (drive, id) => {
119
+ const walk = (node) => {
120
+ if (node.isFolder && idFor(node.relativePath) === id)
121
+ return node.relativePath;
122
+ for (const child of node.children) {
123
+ const hit = walk(child);
124
+ if (hit)
125
+ return hit;
126
+ }
127
+ return undefined;
128
+ };
129
+ const { tree } = await drive.tree('/');
130
+ const path = walk(tree);
131
+ if (!path)
132
+ throw new ApiError(404, `No folder matches the id ${id}. Ids are derived from paths, so an id that names no folder is one no folder ever had.`);
133
+ return path;
134
+ };
135
+ /** The handlers, keyed by the operation id the table states. */
136
+ export const VIYA_HANDLERS = {
137
+ 'GET /identities/users/@currentUser': async ({ services, request }) => {
138
+ const subject = request.subject ??
139
+ (await services.identity?.authenticate(request.token));
140
+ const id = subject?.userId ?? EMULATED_USER.id;
141
+ return {
142
+ status: 200,
143
+ body: {
144
+ id,
145
+ name: subject?.userId ?? EMULATED_USER.name,
146
+ providerId: 'sas',
147
+ state: 'active',
148
+ version: 1,
149
+ addresses: [],
150
+ emailAddresses: [],
151
+ links: [
152
+ {
153
+ href: `/identities/users/${id}`,
154
+ uri: `/identities/users/${id}`,
155
+ rel: 'self',
156
+ method: 'GET',
157
+ type: 'application/vnd.sas.identity.user'
158
+ }
159
+ ]
160
+ }
161
+ };
162
+ },
163
+ 'GET /types/types': async () => ({
164
+ status: 200,
165
+ body: {
166
+ count: 1,
167
+ items: [
168
+ {
169
+ name: 'file',
170
+ type: 'typeDef',
171
+ version: 1,
172
+ links: [{ href: '/types/types/file', rel: 'self', method: 'GET' }]
173
+ }
174
+ ]
175
+ }
176
+ }),
177
+ 'GET /folders/folders/@item': async ({ services, request }) => ({
178
+ status: 200,
179
+ body: await folderBody(requireDrive(services), pathFromQuery(request))
180
+ }),
181
+ 'GET /folders/folders/@myRecycleBin': async () => ({
182
+ status: 200,
183
+ body: recycleBin()
184
+ }),
185
+ 'GET /folders/folders/{}': async ({ services, params }) => {
186
+ // the bin is addressed by id too, and it is not in the drive's tree
187
+ if (params.id === idFor('@myRecycleBin'))
188
+ return { status: 200, body: recycleBin() };
189
+ const drive = requireDrive(services);
190
+ return {
191
+ status: 200,
192
+ body: await folderBody(drive, await pathForId(drive, params.id))
193
+ };
194
+ },
195
+ 'GET /folders/folders/{}/members': async ({ services, params, request }) => {
196
+ const drive = requireDrive(services);
197
+ const limit = Number(request.query?.limit ?? 0) || 0;
198
+ // the bin is not a folder in the drive, and its own body advertises this
199
+ // link - so a client following the answer it just received must not 404
200
+ if (params.id === idFor('@myRecycleBin'))
201
+ return {
202
+ status: 200,
203
+ body: {
204
+ accept: 'application/json',
205
+ name: 'members',
206
+ start: 0,
207
+ // the query value is echoed as the sibling branch echoes it: a caller
208
+ // that asked for five and is told zero cannot tell what happened
209
+ limit,
210
+ count: 0,
211
+ version: 2,
212
+ items: [],
213
+ links: linksFor(`/folders/folders/${idFor('@myRecycleBin')}`, true)
214
+ }
215
+ };
216
+ const path = await pathForId(drive, params.id);
217
+ const listing = await drive.list(path);
218
+ const items = [
219
+ ...listing.folders.map((name) => ({
220
+ id: idFor(`${path}/${name}`.replace(/\/{2,}/g, '/')),
221
+ name,
222
+ type: 'folder',
223
+ version: 1,
224
+ createdBy: EMULATED_USER.id,
225
+ modifiedBy: EMULATED_USER.id,
226
+ creationTimeStamp: EMULATED_NOW,
227
+ modifiedTimeStamp: EMULATED_NOW,
228
+ parentFolderUri: `/folders/folders/${idFor(path)}`,
229
+ uri: `${path}/${name}`.replace(/\/{2,}/g, '/'),
230
+ links: linksFor(`/folders/folders/${idFor(`${path}/${name}`.replace(/\/{2,}/g, '/'))}`)
231
+ })),
232
+ ...listing.files.map((name) => ({
233
+ id: idFor(`${path}/${name}`.replace(/\/{2,}/g, '/'), 'file'),
234
+ name,
235
+ type: 'file',
236
+ version: 1,
237
+ contentType: 'text/plain',
238
+ createdBy: EMULATED_USER.id,
239
+ modifiedBy: EMULATED_USER.id,
240
+ creationTimeStamp: EMULATED_NOW,
241
+ modifiedTimeStamp: EMULATED_NOW,
242
+ parentFolderUri: `/folders/folders/${idFor(path)}`,
243
+ added: EMULATED_NOW,
244
+ uri: `${path}/${name}`.replace(/\/{2,}/g, '/'),
245
+ links: linksFor(`/files/files/${idFor(`${path}/${name}`.replace(/\/{2,}/g, '/'), 'file')}`)
246
+ }))
247
+ ];
248
+ const page = limit > 0 ? items.slice(0, limit) : items;
249
+ // the envelope is what the capture recorded, including the paging fields a
250
+ // client reads to decide whether to ask for more
251
+ return {
252
+ status: 200,
253
+ body: {
254
+ accept: 'application/json',
255
+ name: 'members',
256
+ start: 0,
257
+ limit: limit || page.length,
258
+ count: page.length,
259
+ version: 2,
260
+ items: page,
261
+ links: linksFor(`/folders/folders/${idFor(path)}`, true)
262
+ }
263
+ };
264
+ },
265
+ 'POST /folders/folders': async ({ services, request }) => {
266
+ const drive = requireDrive(services);
267
+ const body = (request.body ?? {});
268
+ if (!body.name)
269
+ throw new ApiError(400, 'A folder name is required.');
270
+ // the capture records the parent as a QUERY parameter, with the name in the
271
+ // body: a handler that read the body alone put every folder at the root
272
+ const parentUri = request.query?.parentFolderUri ?? body.parentFolderUri;
273
+ const parent = parentUri
274
+ ? await pathForId(drive, String(parentUri).split('/').pop())
275
+ : '/';
276
+ const path = `${parent}/${body.name}`.replace(/\/{2,}/g, '/');
277
+ await drive.mkdir(path);
278
+ return { status: 201, body: await folderBody(drive, path) };
279
+ },
280
+ 'PATCH /folders/folders/{}': async ({ services, request, params }) => {
281
+ const drive = requireDrive(services);
282
+ if (params.id === idFor('@myRecycleBin'))
283
+ throw new ApiError(400, 'The recycle bin cannot be moved or renamed.');
284
+ const path = await pathForId(drive, params.id);
285
+ const body = (request.body ?? {});
286
+ // the adapter removes a folder by moving it to the recycle bin, which is the
287
+ // shape the capture recorded for this verb. Both spellings arrive: the bin's
288
+ // id, and the alias the emulator itself answers with
289
+ if (isRecycleBin(body.parentFolderUri)) {
290
+ const removed = await folderBody(drive, path);
291
+ await drive.rmdir(path);
292
+ // the answer describes the folder that was moved, not the drive root -
293
+ // a client reads the id and parent from it
294
+ return {
295
+ status: 200,
296
+ body: { ...removed, parentFolderUri: String(body.parentFolderUri) }
297
+ };
298
+ }
299
+ // a move and a rename can arrive together, and an empty parent means the
300
+ // root - the same value means the root on create, so reading it as "no
301
+ // change" here was a second meaning for one string
302
+ const name = body.name ?? path.split('/').pop();
303
+ const parent = body.parentFolderUri === undefined
304
+ ? path.split('/').slice(0, -1).join('/') || '/'
305
+ : body.parentFolderUri === ''
306
+ ? '/'
307
+ : await pathForId(drive, body.parentFolderUri.split('/').pop());
308
+ const target = `${parent}/${name}`.replace(/\/{2,}/g, '/');
309
+ if (target !== path)
310
+ await drive.rename(path, target);
311
+ return { status: 200, body: await folderBody(drive, target) };
312
+ }
313
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The adapter's call surface, and what this package decides about each entry.
3
+ *
4
+ * Scope decision 3 of sasjs/server#665: the emulator answers the client's calls
5
+ * and nothing else. This file is that statement in a form a check can read,
6
+ * extracted from `@sasjs/adapter` 6.0.2 rather than from memory, and compared
7
+ * with the adapter again by `npm run check:scope` (extraction) and by
8
+ * `spec/viyaScope.spec.ts` (this file against the committed inventory).
9
+ *
10
+ * `decision: 'in'` means a host must answer it, and the table that lands next
11
+ * has to cover it. `declined` means it is out of scope, with the reason that
12
+ * goes into the 501 body if a client ever calls it here.
13
+ */
14
+ export type SurfaceFamily = 'sas9' | 'sasjs-api' | 'viya-auth' | 'viya-compute' | 'viya-files' | 'viya-folders' | 'viya-identity' | 'viya-jobs';
15
+ export interface SurfaceEntry {
16
+ /** Where the client sends it; `{}` is one path segment. */
17
+ path: string;
18
+ family: SurfaceFamily;
19
+ decision: 'in' | 'declined';
20
+ /** What the emulator answers, or why it does not answer this at all. */
21
+ reason: string;
22
+ }
23
+ /** Pinned to the adapter the inventory was extracted from. */
24
+ export declare const SURFACE_ADAPTER_VERSION = "6.0.2";
25
+ export declare const SURFACE: SurfaceEntry[];
26
+ //# sourceMappingURL=surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../src/viya/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,WAAW,GACX,WAAW,GACX,cAAc,GACd,YAAY,GACZ,cAAc,GACd,eAAe,GACf,WAAW,CAAA;AAEf,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,aAAa,CAAA;IACrB,QAAQ,EAAE,IAAI,GAAG,UAAU,CAAA;IAC3B,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAA;CACf;AAED,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,UAAU,CAAA;AAE9C,eAAO,MAAM,OAAO,EAAE,YAAY,EA0WjC,CAAA"}
@@ -0,0 +1,323 @@
1
+ /**
2
+ * The adapter's call surface, and what this package decides about each entry.
3
+ *
4
+ * Scope decision 3 of sasjs/server#665: the emulator answers the client's calls
5
+ * and nothing else. This file is that statement in a form a check can read,
6
+ * extracted from `@sasjs/adapter` 6.0.2 rather than from memory, and compared
7
+ * with the adapter again by `npm run check:scope` (extraction) and by
8
+ * `spec/viyaScope.spec.ts` (this file against the committed inventory).
9
+ *
10
+ * `decision: 'in'` means a host must answer it, and the table that lands next
11
+ * has to cover it. `declined` means it is out of scope, with the reason that
12
+ * goes into the 501 body if a client ever calls it here.
13
+ */
14
+ /** Pinned to the adapter the inventory was extracted from. */
15
+ export const SURFACE_ADAPTER_VERSION = '6.0.2';
16
+ export const SURFACE = [
17
+ // sas9
18
+ {
19
+ path: '/Public/seedapp',
20
+ family: 'sas9',
21
+ decision: 'declined',
22
+ reason: 'a default config value the client falls back to, not a call'
23
+ },
24
+ {
25
+ path: '/SASJobExecution',
26
+ family: 'sas9',
27
+ decision: 'declined',
28
+ reason: 'SAS 9 and SASjs surfaces: the emulator answers Viya, and the same client reaches these on an EBI deployment'
29
+ },
30
+ // viya-auth
31
+ {
32
+ path: '/SASLogon',
33
+ family: 'viya-auth',
34
+ decision: 'in',
35
+ reason: 'the auth flow the client speaks, and the reason the emulated paths cannot be renamed'
36
+ },
37
+ {
38
+ path: '/SASLogon/login',
39
+ family: 'viya-auth',
40
+ decision: 'in',
41
+ reason: 'the auth flow the client speaks, and the reason the emulated paths cannot be renamed'
42
+ },
43
+ {
44
+ path: '/SASLogon/login.do',
45
+ family: 'viya-auth',
46
+ decision: 'in',
47
+ reason: 'the auth flow the client speaks, and the reason the emulated paths cannot be renamed'
48
+ },
49
+ {
50
+ path: '/SASLogon/logout',
51
+ family: 'viya-auth',
52
+ decision: 'in',
53
+ reason: 'the auth flow the client speaks, and the reason the emulated paths cannot be renamed'
54
+ },
55
+ {
56
+ path: '/SASLogon/logout.do',
57
+ family: 'viya-auth',
58
+ decision: 'in',
59
+ reason: 'the auth flow the client speaks, and the reason the emulated paths cannot be renamed'
60
+ },
61
+ {
62
+ path: '/SASLogon/oauth/authorize',
63
+ family: 'viya-auth',
64
+ decision: 'in',
65
+ reason: 'the auth flow the client speaks, and the reason the emulated paths cannot be renamed'
66
+ },
67
+ {
68
+ path: '/SASLogon/oauth/token',
69
+ family: 'viya-auth',
70
+ decision: 'in',
71
+ reason: 'the auth flow the client speaks, and the reason the emulated paths cannot be renamed'
72
+ },
73
+ // sas9
74
+ {
75
+ path: '/SASStoredProcess',
76
+ family: 'sas9',
77
+ decision: 'declined',
78
+ reason: 'SAS 9 and SASjs surfaces: the emulator answers Viya, and the same client reaches these on an EBI deployment'
79
+ },
80
+ {
81
+ path: '/SASStoredProcess/do',
82
+ family: 'sas9',
83
+ decision: 'declined',
84
+ reason: 'SAS 9 and SASjs surfaces: the emulator answers Viya, and the same client reaches these on an EBI deployment'
85
+ },
86
+ {
87
+ path: '/SASStoredProcess/j_spring_cas_security_check',
88
+ family: 'sas9',
89
+ decision: 'declined',
90
+ reason: 'SAS 9 and SASjs surfaces: the emulator answers Viya, and the same client reaches these on an EBI deployment'
91
+ },
92
+ // sasjs-api
93
+ {
94
+ path: '/SASjsApi',
95
+ family: 'sasjs-api',
96
+ decision: 'declined',
97
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
98
+ },
99
+ // sas9
100
+ {
101
+ path: '/User Folders/{}/My Folder/sasjs/runner',
102
+ family: 'sas9',
103
+ decision: 'declined',
104
+ reason: 'SAS 9 and SASjs surfaces: the emulator answers Viya, and the same client reaches these on an EBI deployment'
105
+ },
106
+ // sasjs-api
107
+ {
108
+ path: '/auth/refresh',
109
+ family: 'sasjs-api',
110
+ decision: 'declined',
111
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
112
+ },
113
+ {
114
+ path: '/auth/token',
115
+ family: 'sasjs-api',
116
+ decision: 'declined',
117
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
118
+ },
119
+ {
120
+ path: '/code/execute',
121
+ family: 'sasjs-api',
122
+ decision: 'declined',
123
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
124
+ },
125
+ // viya-compute
126
+ {
127
+ path: '/compute/contexts',
128
+ family: 'viya-compute',
129
+ decision: 'in',
130
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
131
+ },
132
+ {
133
+ path: '/compute/contexts/{}',
134
+ family: 'viya-compute',
135
+ decision: 'in',
136
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
137
+ },
138
+ {
139
+ path: '/compute/contexts/{}/sessions',
140
+ family: 'viya-compute',
141
+ decision: 'in',
142
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
143
+ },
144
+ {
145
+ path: '/compute/sessions/{}',
146
+ family: 'viya-compute',
147
+ decision: 'in',
148
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
149
+ },
150
+ {
151
+ path: '/compute/sessions/{}/filerefs/_webout/content',
152
+ family: 'viya-compute',
153
+ decision: 'in',
154
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
155
+ },
156
+ {
157
+ path: '/compute/sessions/{}/jobs',
158
+ family: 'viya-compute',
159
+ decision: 'in',
160
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
161
+ },
162
+ {
163
+ path: '/compute/sessions/{}/jobs/{}',
164
+ family: 'viya-compute',
165
+ decision: 'in',
166
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
167
+ },
168
+ {
169
+ path: '/compute/sessions/{}/variables/{}',
170
+ family: 'viya-compute',
171
+ decision: 'in',
172
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
173
+ },
174
+ // viya-files
175
+ {
176
+ path: '/content',
177
+ family: 'viya-files',
178
+ decision: 'declined',
179
+ reason: 'not a route: a suffix the client appends to a file or log URI, which is why the file-content and job-log entries above carry it'
180
+ },
181
+ // sasjs-api
182
+ {
183
+ path: '/drive/deploy',
184
+ family: 'sasjs-api',
185
+ decision: 'declined',
186
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
187
+ },
188
+ {
189
+ path: '/drive/deploy/upload',
190
+ family: 'sasjs-api',
191
+ decision: 'declined',
192
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
193
+ },
194
+ // viya-files
195
+ {
196
+ path: '/files/files',
197
+ family: 'viya-files',
198
+ decision: 'in',
199
+ reason: 'file create, read and replace, which the emulator backs with DriveService'
200
+ },
201
+ {
202
+ path: '/files/files/{}',
203
+ family: 'viya-files',
204
+ decision: 'in',
205
+ reason: 'file create, read and replace, which the emulator backs with DriveService'
206
+ },
207
+ // viya-folders
208
+ {
209
+ path: '/folders/folders',
210
+ family: 'viya-folders',
211
+ decision: 'in',
212
+ reason: 'content structure, which the emulator backs with DriveService'
213
+ },
214
+ {
215
+ path: '/folders/folders/@item',
216
+ family: 'viya-folders',
217
+ decision: 'in',
218
+ reason: 'content structure, which the emulator backs with DriveService'
219
+ },
220
+ {
221
+ path: '/folders/folders/@myRecycleBin',
222
+ family: 'viya-folders',
223
+ decision: 'in',
224
+ reason: 'content structure, which the emulator backs with DriveService'
225
+ },
226
+ {
227
+ path: '/folders/folders/{}',
228
+ family: 'viya-folders',
229
+ decision: 'in',
230
+ reason: 'content structure, which the emulator backs with DriveService'
231
+ },
232
+ {
233
+ path: '/folders/folders/{}/members',
234
+ family: 'viya-folders',
235
+ decision: 'in',
236
+ reason: 'content structure, which the emulator backs with DriveService'
237
+ },
238
+ // viya-identity
239
+ {
240
+ path: '/identities/users/@currentUser',
241
+ family: 'viya-identity',
242
+ decision: 'in',
243
+ reason: 'who the caller is; every session and folder answer is scoped to it'
244
+ },
245
+ // viya-jobs
246
+ {
247
+ path: '/jobDefinitions/definitions',
248
+ family: 'viya-jobs',
249
+ decision: 'in',
250
+ reason: 'the job path a deployed service runs through'
251
+ },
252
+ {
253
+ path: '/jobExecution/jobs',
254
+ family: 'viya-jobs',
255
+ decision: 'in',
256
+ reason: 'the job path a deployed service runs through'
257
+ },
258
+ {
259
+ path: '/jobExecution/jobs/{}',
260
+ family: 'viya-jobs',
261
+ decision: 'in',
262
+ reason: 'the job path a deployed service runs through'
263
+ },
264
+ // viya-compute
265
+ {
266
+ path: '/launcher/contexts',
267
+ family: 'viya-compute',
268
+ decision: 'in',
269
+ reason: 'contexts, sessions, jobs and the webout fileref, which the emulator backs with SessionService and RuntimeService'
270
+ },
271
+ // viya-files
272
+ {
273
+ path: '/log',
274
+ family: 'viya-files',
275
+ decision: 'declined',
276
+ reason: 'not a route: a suffix the client appends to a file or log URI, which is why the file-content and job-log entries above carry it'
277
+ },
278
+ // viya-auth
279
+ {
280
+ path: '/oauth/clients/{}',
281
+ family: 'viya-auth',
282
+ decision: 'declined',
283
+ reason: 'client registration is an identity-provider admin action; the emulated estate accepts the public `sas.cli` client and mints its own tokens'
284
+ },
285
+ // sasjs-api
286
+ {
287
+ path: '/session/{}',
288
+ family: 'sasjs-api',
289
+ decision: 'declined',
290
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
291
+ },
292
+ {
293
+ path: '/session/{}/log',
294
+ family: 'sasjs-api',
295
+ decision: 'declined',
296
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
297
+ },
298
+ {
299
+ path: '/session/{}/state',
300
+ family: 'sasjs-api',
301
+ decision: 'declined',
302
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
303
+ },
304
+ {
305
+ path: '/stp/execute',
306
+ family: 'sasjs-api',
307
+ decision: 'declined',
308
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
309
+ },
310
+ {
311
+ path: '/stp/trigger',
312
+ family: 'sasjs-api',
313
+ decision: 'declined',
314
+ reason: "the SASjs API surface, answered by the server's own registered routes, not by a Viya-shaped one"
315
+ },
316
+ // viya-files
317
+ {
318
+ path: '/types/types',
319
+ family: 'viya-files',
320
+ decision: 'in',
321
+ reason: 'read before every file create, to find the type definition for the extension'
322
+ }
323
+ ];