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