@sasjs/api 0.30.0 → 0.31.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 (35) hide show
  1. package/build/browser.js +534 -333
  2. package/build/cjs/corpus/app.js +55 -0
  3. package/build/cjs/corpus/runner.js +7 -6
  4. package/build/cjs/host/dispatch.js +71 -0
  5. package/build/cjs/index.js +9 -2
  6. package/build/cjs/routes/generated.js +34 -0
  7. package/build/cjs/routes/overlay.js +34 -1
  8. package/build/cjs/runtime/program.js +85 -0
  9. package/build/cjs/runtime/runTimes.js +13 -0
  10. package/build/cjs/runtime/service.js +11 -13
  11. package/build/esm/corpus/app.d.ts +17 -0
  12. package/build/esm/corpus/app.d.ts.map +1 -0
  13. package/build/esm/corpus/app.js +52 -0
  14. package/build/esm/corpus/runner.d.ts +13 -0
  15. package/build/esm/corpus/runner.d.ts.map +1 -1
  16. package/build/esm/corpus/runner.js +5 -4
  17. package/build/esm/host/dispatch.d.ts.map +1 -1
  18. package/build/esm/host/dispatch.js +72 -1
  19. package/build/esm/index.d.ts +5 -1
  20. package/build/esm/index.d.ts.map +1 -1
  21. package/build/esm/index.js +4 -1
  22. package/build/esm/routes/generated.d.ts.map +1 -1
  23. package/build/esm/routes/generated.js +34 -0
  24. package/build/esm/routes/overlay.d.ts.map +1 -1
  25. package/build/esm/routes/overlay.js +34 -1
  26. package/build/esm/runtime/program.d.ts +56 -0
  27. package/build/esm/runtime/program.d.ts.map +1 -0
  28. package/build/esm/runtime/program.js +79 -0
  29. package/build/esm/runtime/runTimes.d.ts +11 -0
  30. package/build/esm/runtime/runTimes.d.ts.map +1 -0
  31. package/build/esm/runtime/runTimes.js +10 -0
  32. package/build/esm/runtime/service.d.ts +0 -2
  33. package/build/esm/runtime/service.d.ts.map +1 -1
  34. package/build/esm/runtime/service.js +9 -11
  35. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APP_CORPUS = void 0;
4
+ const runner_js_1 = require("./runner.js");
5
+ const SUBJECT = { userId: 'user-admin', clientId: 'web_app' };
6
+ /** Where the app's streamed entry file sits inside its folder. */
7
+ const ENTRY_FILE_PATH = `${runner_js_1.CORPUS_APP.appLoc}/services/${runner_js_1.CORPUS_APP.streamWebFolder}/index.html`;
8
+ exports.APP_CORPUS = [
9
+ {
10
+ id: 'app-detail-published',
11
+ route: 'GET /SASjsApi/app/{id}',
12
+ description: 'describes the app the id names, and the entry file it is served from',
13
+ // the deployment the index entry points at: the entry file is on the drive, so
14
+ // `entryFileExists` is the answer this case is really about
15
+ seed: { [ENTRY_FILE_PATH]: '<!doctype html><title>app</title>' },
16
+ request: { subject: SUBJECT, params: { id: runner_js_1.CORPUS_APP.id } },
17
+ expect: {
18
+ status: 200,
19
+ // the entry as registered, and the file it is served from. `lastModified` is
20
+ // the host's clock and not pinned: a drive with no clock answers `null`, one
21
+ // with a filesystem answers the time the seed was written.
22
+ partial: {
23
+ id: runner_js_1.CORPUS_APP.id,
24
+ name: runner_js_1.CORPUS_APP.name,
25
+ appLoc: runner_js_1.CORPUS_APP.appLoc,
26
+ streamWebFolder: runner_js_1.CORPUS_APP.streamWebFolder,
27
+ publishedAt: runner_js_1.CORPUS_APP.publishedAt,
28
+ entryFile: 'index.html',
29
+ entryFileExists: true,
30
+ url: `/app/${runner_js_1.CORPUS_APP.id}/`
31
+ }
32
+ }
33
+ },
34
+ {
35
+ id: 'app-detail-entry-file-missing',
36
+ route: 'GET /SASjsApi/app/{id}',
37
+ description: 'answers the entry as registered with no file and no date, for a deployment that is gone',
38
+ // the index entry outlived its folder: no seed, so nothing is deployed
39
+ request: { subject: SUBJECT, params: { id: runner_js_1.CORPUS_APP.id } },
40
+ expect: {
41
+ status: 200,
42
+ partial: { entryFileExists: false, lastModified: null }
43
+ }
44
+ },
45
+ {
46
+ id: 'app-detail-unknown-id',
47
+ route: 'GET /SASjsApi/app/{id}',
48
+ description: 'refuses an id the index does not hold, in the route’s own wording',
49
+ request: {
50
+ subject: SUBJECT,
51
+ params: { id: '9a9a9a9a-9a9a-4a9a-8a9a-9a9a9a9a9a9a' }
52
+ },
53
+ expect: { status: 404, error: 'No App Stream is registered with that id.' }
54
+ }
55
+ ];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runCase = exports.servicesFor = void 0;
3
+ exports.runCase = exports.servicesFor = exports.CORPUS_APP = void 0;
4
4
  const dispatch_js_1 = require("../host/dispatch.js");
5
5
  const service_js_1 = require("../drive/service.js");
6
6
  const memory_store_js_1 = require("../drive/memory-store.js");
@@ -23,11 +23,12 @@ const memory_store_js_2 = require("../identity/memory-store.js");
23
23
  const fixture_js_1 = require("../identity/fixture.js");
24
24
  const types_js_1 = require("../types.js");
25
25
  /**
26
- * The app every case starts from: one published app, at the folder the unpublish
27
- * cases name, so a removal has something to remove. Its id is stated rather than
28
- * minted, because a case that pins "the id that is there" cannot invent one.
26
+ * The app every app-stream case starts from: one published app, at the folder the
27
+ * unpublish cases name, so a removal has something to remove. Its id is stated
28
+ * rather than minted, because a case that pins "the id that is there" cannot
29
+ * invent one.
29
30
  */
30
- const CORPUS_APP = {
31
+ exports.CORPUS_APP = {
31
32
  id: '6f1c1c1e-6a1e-4c4a-9d1a-1b2c3d4e5f60',
32
33
  name: 'myApp',
33
34
  appLoc: '/Public/myApp',
@@ -69,7 +70,7 @@ const servicesFor = (testCase) => {
69
70
  directory: (0, service_js_9.createDirectoryService)(identity, directory_js_1.CORPUS_DIRECTORY),
70
71
  identity: (0, service_js_3.createIdentityService)(identity),
71
72
  records: (0, records_js_1.createRecordService)(identity),
72
- appStream: (0, service_js_2.createAppStreamService)(new service_js_2.MemoryAppStreamStore([CORPUS_APP])),
73
+ appStream: (0, service_js_2.createAppStreamService)(new service_js_2.MemoryAppStreamStore([exports.CORPUS_APP])),
73
74
  session: (0, service_js_4.createSessionService)(identity, runner),
74
75
  // no `runTimes` option: the default is the five the document names, so a
75
76
  // case is never refused for a reason that belongs to one host's install
@@ -71,6 +71,20 @@ const validate = (route, request) => {
71
71
  throw new types_js_1.ApiError(400, `"${param.name}" is not allowed to be empty`);
72
72
  }
73
73
  };
74
+ /** The file an app is served from for a directory request, as the surface serves it. */
75
+ const APP_ENTRY_FILE = 'index.html';
76
+ /**
77
+ * An app the index does not hold, in the wording the route answers with.
78
+ *
79
+ * The package's own message names the id ("No app is published with that id"); the
80
+ * route names the App Stream, and the corpus is what both hosts answer, so the
81
+ * wording is stated here rather than left to the service's.
82
+ */
83
+ const APP_NOT_REGISTERED = 'No App Stream is registered with that id.';
84
+ const appNotRegistered = () => new types_js_1.ApiError(404, APP_NOT_REGISTERED, {
85
+ status: 'failure',
86
+ message: APP_NOT_REGISTERED
87
+ });
74
88
  /** The drive path a write names: the query parameter wins over the form field. */
75
89
  const targetPath = (request) => {
76
90
  const fromQuery = request.query?._filePath;
@@ -357,6 +371,62 @@ const dispatch = async (services, routeId, request = {}) => {
357
371
  body: { status: 'success', app: (0, service_js_1.appSummary)(removed) }
358
372
  };
359
373
  }
374
+ // --------------------------------------------------- what an app *is*
375
+ //
376
+ // The surface serves an app's files; this describes the app itself - the entry
377
+ // as registered, and whether the file it is served from is there. Addressed by id,
378
+ // which is what a publish answers with and what the app's URL carries: a label is
379
+ // shared by design, so "the app with this name" is not one app.
380
+ case 'GET /SASjsApi/app/{id}': {
381
+ if (!services.appStream)
382
+ throw new types_js_1.ApiError(501, `This host has no app stream, so it cannot answer ${routeId}.`);
383
+ const entry = await services.appStream
384
+ .get(String(params.id ?? ''))
385
+ .catch((err) => {
386
+ if ((0, types_js_1.isApiError)(err) && err.status === 404)
387
+ throw appNotRegistered();
388
+ throw err;
389
+ });
390
+ const folder = `${entry.appLoc}/services/${entry.streamWebFolder}`;
391
+ // An index entry can outlive its deployment - the folder deleted from under
392
+ // the host - and reporting a file and a date that are not there would be worse
393
+ // than reporting none, so the listing decides both.
394
+ let entryFileExists = false;
395
+ let lastModified = null;
396
+ try {
397
+ const { tree } = await drive.tree(folder);
398
+ const file = tree.children.find((child) => child.name === APP_ENTRY_FILE && !child.isFolder);
399
+ entryFileExists = file !== undefined;
400
+ lastModified = file?.modified ?? null;
401
+ }
402
+ catch (err) {
403
+ // A folder that is gone is the ordinary case - an index entry that outlived
404
+ // its deployment - and the answer is "no entry file". Anything else is not
405
+ // that answer: a `streamWebFolder` that names a file, or a store that failed,
406
+ // would read as a deleted deployment, so it reaches the host's 500.
407
+ if (!(0, types_js_1.isApiError)(err) || err.status !== 404)
408
+ throw err;
409
+ entryFileExists = false;
410
+ }
411
+ const body = {
412
+ id: entry.id,
413
+ name: entry.name,
414
+ appLoc: entry.appLoc,
415
+ streamWebFolder: entry.streamWebFolder,
416
+ publishedAt: entry.publishedAt ?? null,
417
+ entryFile: APP_ENTRY_FILE,
418
+ entryFileExists,
419
+ lastModified,
420
+ url: `/app/${entry.id}/`
421
+ };
422
+ // the two the index may not carry are absent rather than undefined, which is
423
+ // how they reach a JSON client
424
+ if (entry.logo !== undefined)
425
+ body.logo = entry.logo;
426
+ if (entry.frameAncestors !== undefined)
427
+ body.frameAncestors = entry.frameAncestors;
428
+ return { status: 200, body };
429
+ }
360
430
  case 'GET /SASjsApi/drive/filetree':
361
431
  return { status: 200, body: await drive.tree(query._folderPath) };
362
432
  // ------------------------------------------------------------- run times
@@ -668,6 +738,7 @@ exports.HANDLED_ROUTES = [
668
738
  'DELETE /SASjsApi/drive/folder',
669
739
  'POST /SASjsApi/drive/rename',
670
740
  'GET /SASjsApi/drive/filetree',
741
+ 'GET /SASjsApi/app/{id}',
671
742
  'POST /SASjsApi/drive/deploy',
672
743
  'POST /SASjsApi/auth/token',
673
744
  'POST /SASjsApi/auth/refresh',
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.DEFAULT_IDENTITY = exports.MemoryIdentityStore = exports.createDirectoryService = exports.normaliseLogFiles = exports.normaliseDiagnostics = exports.logLines = exports.createAdminService = exports.checkLogFileName = exports.MAX_LOG_LINES = exports.DEFAULT_LOG_LINES = exports.normaliseAuthConfig = exports.createAuthConfigService = exports.normaliseInfo = exports.createInfoService = exports.BROWSER_INFO = exports.withBundleVersion = exports.createHomeService = exports.NO_WEB_BUILD = exports.BUNDLE_NAME = exports.HOME_CORPUS = exports.DIRECTORY_CORPUS = exports.AUTH_CONFIG_CORPUS = exports.ADMIN_CORPUS = exports.INFO_CORPUS = exports.CODE_CORPUS = exports.sanitiseDisplayName = exports.createRecordService = exports.createIdentityService = exports.HANDLED_ROUTES = exports.dispatch = exports.TAG_CAPABILITIES = exports.OVERLAY = exports.findRoute = exports.routeById = exports.ROUTES = exports.MemoryDriveStore = exports.measureDeployTree = exports.isDeployTree = exports.deployTree = exports.decodeBase64 = exports.checkDeployTree = exports.DEPLOY_SUCCESS = exports.DEPLOY_PAYLOAD_BYTES = exports.DEPLOY_LIMITS = exports.createDriveService = exports.isRoot = exports.basename = exports.dirname = exports.hasBlockedExtension = exports.normaliseDrivePath = void 0;
18
- exports.normaliseAppLoc = exports.newAppId = exports.isAppId = exports.escapeHtml = exports.createAppStreamWebService = exports.contentTypeFor = exports.cacheControlFor = exports.NO_SUCH_APP = exports.DEFAULT_APP_PATH = exports.createDriveAppStreamStore = exports.APP_STREAM_INDEX = exports.splitAppBundle = exports.publishRequestFor = exports.parseAppManifest = exports.APP_MANIFEST = exports.MemoryAppStreamStore = exports.defaultAppName = exports.createAppStreamService = exports.checkPublishRequest = exports.appSummary = exports.servicesFor = exports.runCase = exports.PROVIDER_MANAGED = exports.ADMIN_SIGNED_IN = exports.RECORD_CORPUS = exports.RUNTIME_CORPUS = exports.MemorySessionRunner = exports.createRuntimeService = exports.DOCUMENTED_RUN_TIMES = exports.CODE_DEBUG = exports.MemorySessionHost = exports.DEFAULT_SESSIONS = exports.createSessionService = exports.SESSION_CORPUS = exports.DEPLOY_CORPUS = exports.IDENTITY_CORPUS = exports.DRIVE_CORPUS = exports.parseIdentity = exports.IDENTITY_FORMAT = void 0;
18
+ exports.normaliseAppLoc = exports.newAppId = exports.isAppId = exports.escapeHtml = exports.createAppStreamWebService = exports.contentTypeFor = exports.cacheControlFor = exports.NO_SUCH_APP = exports.DEFAULT_APP_PATH = exports.createDriveAppStreamStore = exports.APP_STREAM_INDEX = exports.splitAppBundle = exports.publishRequestFor = exports.parseAppManifest = exports.APP_MANIFEST = exports.MemoryAppStreamStore = exports.defaultAppName = exports.createAppStreamService = exports.checkPublishRequest = exports.appSummary = exports.servicesFor = exports.runCase = exports.PROVIDER_MANAGED = exports.ADMIN_SIGNED_IN = exports.RECORD_CORPUS = exports.RUNTIME_CORPUS = exports.MemorySessionRunner = exports.runTimeOfPath = exports.resolveProgram = exports.programNotFound = exports.DOCUMENTED_RUN_TIMES = exports.createRuntimeService = exports.CODE_DEBUG = exports.MemorySessionHost = exports.DEFAULT_SESSIONS = exports.createSessionService = exports.SESSION_CORPUS = exports.APP_CORPUS = exports.DEPLOY_CORPUS = exports.IDENTITY_CORPUS = exports.DRIVE_CORPUS = exports.parseIdentity = exports.IDENTITY_FORMAT = void 0;
19
19
  /**
20
20
  * `@sasjs/api` - the SASjs Server API described once.
21
21
  *
@@ -114,6 +114,8 @@ var identity_js_1 = require("./corpus/identity.js");
114
114
  Object.defineProperty(exports, "IDENTITY_CORPUS", { enumerable: true, get: function () { return identity_js_1.IDENTITY_CORPUS; } });
115
115
  var deploy_js_2 = require("./corpus/deploy.js");
116
116
  Object.defineProperty(exports, "DEPLOY_CORPUS", { enumerable: true, get: function () { return deploy_js_2.DEPLOY_CORPUS; } });
117
+ var app_js_1 = require("./corpus/app.js");
118
+ Object.defineProperty(exports, "APP_CORPUS", { enumerable: true, get: function () { return app_js_1.APP_CORPUS; } });
117
119
  var session_js_1 = require("./corpus/session.js");
118
120
  Object.defineProperty(exports, "SESSION_CORPUS", { enumerable: true, get: function () { return session_js_1.SESSION_CORPUS; } });
119
121
  var service_js_8 = require("./session/service.js");
@@ -123,8 +125,13 @@ Object.defineProperty(exports, "DEFAULT_SESSIONS", { enumerable: true, get: func
123
125
  Object.defineProperty(exports, "MemorySessionHost", { enumerable: true, get: function () { return memory_host_js_1.MemorySessionHost; } });
124
126
  var service_js_9 = require("./runtime/service.js");
125
127
  Object.defineProperty(exports, "CODE_DEBUG", { enumerable: true, get: function () { return service_js_9.CODE_DEBUG; } });
126
- Object.defineProperty(exports, "DOCUMENTED_RUN_TIMES", { enumerable: true, get: function () { return service_js_9.DOCUMENTED_RUN_TIMES; } });
127
128
  Object.defineProperty(exports, "createRuntimeService", { enumerable: true, get: function () { return service_js_9.createRuntimeService; } });
129
+ var runTimes_js_1 = require("./runtime/runTimes.js");
130
+ Object.defineProperty(exports, "DOCUMENTED_RUN_TIMES", { enumerable: true, get: function () { return runTimes_js_1.DOCUMENTED_RUN_TIMES; } });
131
+ var program_js_1 = require("./runtime/program.js");
132
+ Object.defineProperty(exports, "programNotFound", { enumerable: true, get: function () { return program_js_1.programNotFound; } });
133
+ Object.defineProperty(exports, "resolveProgram", { enumerable: true, get: function () { return program_js_1.resolveProgram; } });
134
+ Object.defineProperty(exports, "runTimeOfPath", { enumerable: true, get: function () { return program_js_1.runTimeOfPath; } });
128
135
  var memory_runner_js_1 = require("./runtime/memory-runner.js");
129
136
  Object.defineProperty(exports, "MemorySessionRunner", { enumerable: true, get: function () { return memory_runner_js_1.MemorySessionRunner; } });
130
137
  var runtime_js_1 = require("./corpus/runtime.js");
@@ -107,6 +107,40 @@ exports.GENERATED_ROUTES = [
107
107
  }
108
108
  ]
109
109
  },
110
+ {
111
+ id: 'GET /SASjsApi/app/{id}',
112
+ method: 'GET',
113
+ path: '/SASjsApi/app/{id}',
114
+ tag: 'App Stream',
115
+ summary: 'Get a published app by id',
116
+ params: [
117
+ {
118
+ name: 'id',
119
+ in: 'path',
120
+ required: true,
121
+ type: 'string'
122
+ }
123
+ ],
124
+ requestBodies: [],
125
+ responses: [
126
+ {
127
+ status: 200,
128
+ description: 'Ok'
129
+ },
130
+ {
131
+ status: 401,
132
+ description: 'Unauthorized'
133
+ },
134
+ {
135
+ status: 404,
136
+ description: 'No App Stream is registered with that id.'
137
+ },
138
+ {
139
+ status: 500,
140
+ description: 'Internal Server Error'
141
+ }
142
+ ]
143
+ },
110
144
  {
111
145
  id: 'POST /SASjsApi/auth/logout',
112
146
  method: 'POST',
@@ -16,7 +16,9 @@ exports.TAG_CAPABILITIES = {
16
16
  Group: ['identity'],
17
17
  Permission: ['identity'],
18
18
  Client: ['identity'],
19
- Web: ['identity']
19
+ Web: ['identity'],
20
+ // an app's entry is indexed, and the file it is served from is read off the drive
21
+ 'App Stream': ['storage']
20
22
  };
21
23
  /**
22
24
  * Why a block of operations is not implemented here.
@@ -254,6 +256,37 @@ exports.OVERLAY = {
254
256
  // `404` is an id the index does not hold - the id is the app, and its label and
255
257
  // folder are not handles - and the drive's content is deliberately left alone.
256
258
  'DELETE /SASjsApi/drive/deploy': { implemented: true },
259
+ // App Stream - what is published under one app's id.
260
+ //
261
+ // Carried here: the answer is the app index plus the drive, and `APP_CORPUS` pins
262
+ // its shape. The mock build (`sasjs/cli`) still answers the App Stream surface by
263
+ // hand; consuming this operation from the table is its next step on
264
+ // sasjs/cli#1550, not this package's.
265
+ 'GET /SASjsApi/app/{id}': {
266
+ implemented: true,
267
+ // the caller's token is the host's middleware, and a failure that is not the
268
+ // index refusing the id - a drive read that broke - is the host's to answer
269
+ hostResponses: [401, 500],
270
+ // the shape a client reads: the entry as registered, the file it is served from,
271
+ // and whether that file is there
272
+ responses: {
273
+ 404: {
274
+ status: 'failure',
275
+ message: 'No App Stream is registered with that id.'
276
+ },
277
+ 200: {
278
+ id: '',
279
+ name: '',
280
+ appLoc: '',
281
+ streamWebFolder: '',
282
+ publishedAt: null,
283
+ entryFile: 'index.html',
284
+ entryFileExists: false,
285
+ lastModified: null,
286
+ url: ''
287
+ }
288
+ }
289
+ },
257
290
  // Group - members and the groups themselves
258
291
  'GET /SASjsApi/group': { implemented: true },
259
292
  'GET /SASjsApi/group/{uid}': { implemented: true },
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveProgram = exports.runTimeOfPath = exports.programNotFound = void 0;
4
+ /**
5
+ * Finding the program a request names, once, for every host.
6
+ *
7
+ * `_program` is a path the caller chose, so two things have to be decided the same
8
+ * way in every host that runs one: that the path stays inside the drive, and which
9
+ * file and run time it actually names. The first is the host's - only it knows where
10
+ * its drive starts - and the second is this module's, because "try the extension the
11
+ * name states, otherwise `<path>.<runTime>` for each runtime in turn, otherwise the
12
+ * program does not exist" is the API's rule and not a host's preference.
13
+ *
14
+ * The host supplies three things: how to resolve a caller's path against its drive
15
+ * (answering `null` for a path that leaves it), whether a resolved path exists, and
16
+ * the run times it can offer. The extension vocabulary is not one of them - that is
17
+ * the document's, and `runTimeOfPath` reads it here. Nothing here touches a filesystem, a drive or a clock,
18
+ * so the browser host can answer with the same function over its own store.
19
+ */
20
+ const types_js_1 = require("../types.js");
21
+ const runTimes_js_1 = require("./runTimes.js");
22
+ /**
23
+ * The detail a refusal carries, naming the path the caller gave.
24
+ *
25
+ * Exported because the runtime service renders the same condition the same way, and
26
+ * two copies of the sentence is how the two drift: the service's envelope states it as
27
+ * `error`, and this module states it as the message a host sends when it does not
28
+ * render an envelope at all.
29
+ */
30
+ const programNotFound = (given) => `The Program at (${given}) does not exist.`;
31
+ exports.programNotFound = programNotFound;
32
+ /** The refusal, as this module decides it: the status and that detail. */
33
+ const notThere = (given) => new types_js_1.ApiError(400, (0, exports.programNotFound)(given));
34
+ /**
35
+ * The run time a path's own name states, if it states one.
36
+ *
37
+ * The vocabulary is the document's (`DOCUMENTED_RUN_TIMES`), not a host's: a host
38
+ * that cannot run Python still reads `run.py` as Python and answers separately that
39
+ * it has no such run time. `run.sas7bdat` and `run.backup` name none, and are then
40
+ * probed like a path with no extension at all - which is what the server has always
41
+ * done.
42
+ *
43
+ * The extension is read below either separator, because the server runs on Windows
44
+ * too and resolves its paths with backslashes.
45
+ */
46
+ const runTimeOfPath = (path) => {
47
+ const file = path.split(/[\\/]/).pop() || '';
48
+ const dot = file.lastIndexOf('.');
49
+ // a leading dot names no extension: `.sas` is a file, not a suffix
50
+ const extension = dot > 0 ? file.slice(dot + 1).toLowerCase() : '';
51
+ return runTimes_js_1.DOCUMENTED_RUN_TIMES.includes(extension) ? extension : undefined;
52
+ };
53
+ exports.runTimeOfPath = runTimeOfPath;
54
+ /**
55
+ * The program and run time a request's `_program` names.
56
+ *
57
+ * The refusal is decided here - `400`, and the detail that names the path the caller
58
+ * gave - and *rendered* by whoever called this, because that is where the two hosts
59
+ * already differ: this package's runtime routes wrap it in the failed-run envelope
60
+ * (`{ status, message, error }`, pinned in `spec/runtime.spec.ts`), and a host that
61
+ * sends the message as text keeps sending it as text. Deciding the rendering here
62
+ * would change one host's answer on the way to unifying the rule, which is not what
63
+ * the seam is for.
64
+ */
65
+ const resolveProgram = async (given, deps) => {
66
+ const resolved = deps.resolve(given);
67
+ if (resolved === null)
68
+ throw notThere(given);
69
+ const extension = (0, exports.runTimeOfPath)(resolved);
70
+ if (extension !== undefined) {
71
+ // the name states its run time: no probing, and a file that is not there is
72
+ // refused even if `<path>.sas` happens to exist
73
+ if (await deps.exists(resolved))
74
+ return { path: resolved, runTime: extension };
75
+ }
76
+ else {
77
+ for (const runTime of deps.runTimes) {
78
+ const candidate = `${resolved}.${runTime}`;
79
+ if (await deps.exists(candidate))
80
+ return { path: candidate, runTime };
81
+ }
82
+ }
83
+ throw notThere(given);
84
+ };
85
+ exports.resolveProgram = resolveProgram;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOCUMENTED_RUN_TIMES = void 0;
4
+ /**
5
+ * The run times the published document states.
6
+ *
7
+ * The vocabulary is the document's, not a host's: `_program=/app/run.py` names
8
+ * Python wherever it is read, and a host that cannot run Python says so when it is
9
+ * asked to - it does not get to say the name means something else. Kept in its own
10
+ * module so the runtime service and `resolveProgram` read one list rather than two
11
+ * copies of it.
12
+ */
13
+ exports.DOCUMENTED_RUN_TIMES = ['sas', 'js', 'py', 'r', 'sasviya'];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createRuntimeService = exports.parseDebugValue = exports.DOCUMENTED_RUN_TIMES = exports.CODE_DEBUG = void 0;
3
+ exports.createRuntimeService = exports.parseDebugValue = exports.CODE_DEBUG = void 0;
4
4
  /**
5
5
  * The runtime routes: running a program, and starting one.
6
6
  *
@@ -19,6 +19,8 @@ exports.createRuntimeService = exports.parseDebugValue = exports.DOCUMENTED_RUN_
19
19
  * that would carry one carries it as optional.
20
20
  */
21
21
  const types_js_1 = require("../types.js");
22
+ const runTimes_js_1 = require("./runTimes.js");
23
+ const program_js_1 = require("./program.js");
22
24
  const paths_js_1 = require("../drive/paths.js");
23
25
  /**
24
26
  * The value that asks for the session log.
@@ -36,8 +38,6 @@ const paths_js_1 = require("../drive/paths.js");
36
38
  * else.
37
39
  */
38
40
  exports.CODE_DEBUG = 131;
39
- /** The run times the published document states, and a host may hold fewer. */
40
- exports.DOCUMENTED_RUN_TIMES = ['sas', 'js', 'py', 'r', 'sasviya'];
41
41
  /**
42
42
  * `_debug`, normalised the way sasjs/server's `parseDebugValue` normalises it.
43
43
  *
@@ -89,7 +89,9 @@ const timestamp = (now) => [
89
89
  */
90
90
  const newSessionId = (now) => `${timestamp(now)}-${Math.round(Math.random() * 100000)}-${now.getTime()}`;
91
91
  /** The refusal a program that cannot be found answers, as the server words it. */
92
- const notThere = (programPath) => `The Program at (${programPath}) does not exist.`;
92
+ // the wording is `resolveProgram`'s, so the module that decides the rule and the
93
+ // route that renders it cannot drift apart
94
+ const notThere = (programPath) => (0, program_js_1.programNotFound)(programPath);
93
95
  /**
94
96
  * The failure a run that could not be performed answers.
95
97
  *
@@ -117,7 +119,7 @@ const failedRun = (error) => {
117
119
  * the same directory the session routes read. A host never states a role.
118
120
  */
119
121
  const createRuntimeService = (directory, runner, options = {}) => {
120
- const runTimes = options.runTimes || exports.DOCUMENTED_RUN_TIMES;
122
+ const runTimes = options.runTimes || runTimes_js_1.DOCUMENTED_RUN_TIMES;
121
123
  /** The caller, refused the way the middleware refuses one. */
122
124
  const callerOf = async (caller) => {
123
125
  if (!caller)
@@ -173,14 +175,10 @@ const createRuntimeService = (directory, runner, options = {}) => {
173
175
  * Only the extension vocabulary the document states is read, so `run.sas7bdat`
174
176
  * or `run.backup` name no run time and are left to the host.
175
177
  */
176
- const runTimeForPath = (path, request) => {
177
- const file = path.split('/').pop() || '';
178
- const dot = file.lastIndexOf('.');
179
- const extension = dot > 0 ? file.slice(dot + 1).toLowerCase() : '';
180
- if (exports.DOCUMENTED_RUN_TIMES.includes(extension))
181
- return extension;
182
- return runTimeOf(request);
183
- };
178
+ const runTimeForPath = (path, request) =>
179
+ // the extension rule is `resolveProgram`'s; this asks it and falls back to what
180
+ // the request stated, which is the part that is this route's
181
+ (0, program_js_1.runTimeOfPath)(path) ?? runTimeOf(request);
184
182
  /** The run time, refused when it is absent where the document requires it, or unheld. */
185
183
  const runTimeOf = (request) => {
186
184
  if (request.runTime === undefined) {
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The App Stream detail route's conformance corpus.
3
+ *
4
+ * `GET /SASjsApi/app/{id}` describes an app by its id: the entry as registered, the
5
+ * file it is served from, and whether that file is there. Two answers are the
6
+ * package's - the `200` and the `404` - and both have a case here, which is what
7
+ * `spec/corpus-parity.spec.ts` enforces in both directions. The `401` is the host's
8
+ * (the route is mounted behind its authenticator) and is marked as such in the
9
+ * overlay.
10
+ *
11
+ * The cases name the same app the rest of the corpus starts from (`CORPUS_APP`), so
12
+ * a host running this corpus against a live server sees the same id the package
13
+ * answers for.
14
+ */
15
+ import type { CorpusCase } from './drive.js';
16
+ export declare const APP_CORPUS: CorpusCase[];
17
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/corpus/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAQ5C,eAAO,MAAM,UAAU,EAAE,UAAU,EAkDlC,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { CORPUS_APP } from './runner.js';
2
+ const SUBJECT = { userId: 'user-admin', clientId: 'web_app' };
3
+ /** Where the app's streamed entry file sits inside its folder. */
4
+ const ENTRY_FILE_PATH = `${CORPUS_APP.appLoc}/services/${CORPUS_APP.streamWebFolder}/index.html`;
5
+ export const APP_CORPUS = [
6
+ {
7
+ id: 'app-detail-published',
8
+ route: 'GET /SASjsApi/app/{id}',
9
+ description: 'describes the app the id names, and the entry file it is served from',
10
+ // the deployment the index entry points at: the entry file is on the drive, so
11
+ // `entryFileExists` is the answer this case is really about
12
+ seed: { [ENTRY_FILE_PATH]: '<!doctype html><title>app</title>' },
13
+ request: { subject: SUBJECT, params: { id: CORPUS_APP.id } },
14
+ expect: {
15
+ status: 200,
16
+ // the entry as registered, and the file it is served from. `lastModified` is
17
+ // the host's clock and not pinned: a drive with no clock answers `null`, one
18
+ // with a filesystem answers the time the seed was written.
19
+ partial: {
20
+ id: CORPUS_APP.id,
21
+ name: CORPUS_APP.name,
22
+ appLoc: CORPUS_APP.appLoc,
23
+ streamWebFolder: CORPUS_APP.streamWebFolder,
24
+ publishedAt: CORPUS_APP.publishedAt,
25
+ entryFile: 'index.html',
26
+ entryFileExists: true,
27
+ url: `/app/${CORPUS_APP.id}/`
28
+ }
29
+ }
30
+ },
31
+ {
32
+ id: 'app-detail-entry-file-missing',
33
+ route: 'GET /SASjsApi/app/{id}',
34
+ description: 'answers the entry as registered with no file and no date, for a deployment that is gone',
35
+ // the index entry outlived its folder: no seed, so nothing is deployed
36
+ request: { subject: SUBJECT, params: { id: CORPUS_APP.id } },
37
+ expect: {
38
+ status: 200,
39
+ partial: { entryFileExists: false, lastModified: null }
40
+ }
41
+ },
42
+ {
43
+ id: 'app-detail-unknown-id',
44
+ route: 'GET /SASjsApi/app/{id}',
45
+ description: 'refuses an id the index does not hold, in the route’s own wording',
46
+ request: {
47
+ subject: SUBJECT,
48
+ params: { id: '9a9a9a9a-9a9a-4a9a-8a9a-9a9a9a9a9a9a' }
49
+ },
50
+ expect: { status: 404, error: 'No App Stream is registered with that id.' }
51
+ }
52
+ ];
@@ -9,6 +9,19 @@
9
9
  */
10
10
  import type { CorpusCase } from './drive.js';
11
11
  import type { Services } from '../host/dispatch.js';
12
+ /**
13
+ * The app every app-stream case starts from: one published app, at the folder the
14
+ * unpublish cases name, so a removal has something to remove. Its id is stated
15
+ * rather than minted, because a case that pins "the id that is there" cannot
16
+ * invent one.
17
+ */
18
+ export declare const CORPUS_APP: {
19
+ id: string;
20
+ name: string;
21
+ appLoc: string;
22
+ streamWebFolder: string;
23
+ publishedAt: string;
24
+ };
12
25
  export interface CaseResult {
13
26
  status: number;
14
27
  body?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/corpus/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAsCnD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC9B,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,UAAU,KAAG,QA0ClD,CAAA;AA8DD;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,UAAU,UAAU,EACpB,WAAU,QAAgC,KACzC,OAAO,CAAC,UAAU,CAgBpB,CAAA"}
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/corpus/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAyBnD;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC9B,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,UAAU,KAAG,QA0ClD,CAAA;AA8DD;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,UAAU,UAAU,EACpB,WAAU,QAAgC,KACzC,OAAO,CAAC,UAAU,CAgBpB,CAAA"}
@@ -20,11 +20,12 @@ import { MemoryIdentityStore } from '../identity/memory-store.js';
20
20
  import { DEFAULT_IDENTITY } from '../identity/fixture.js';
21
21
  import { isApiError } from '../types.js';
22
22
  /**
23
- * The app every case starts from: one published app, at the folder the unpublish
24
- * cases name, so a removal has something to remove. Its id is stated rather than
25
- * minted, because a case that pins "the id that is there" cannot invent one.
23
+ * The app every app-stream case starts from: one published app, at the folder the
24
+ * unpublish cases name, so a removal has something to remove. Its id is stated
25
+ * rather than minted, because a case that pins "the id that is there" cannot
26
+ * invent one.
26
27
  */
27
- const CORPUS_APP = {
28
+ export const CORPUS_APP = {
28
29
  id: '6f1c1c1e-6a1e-4c4a-9d1a-1b2c3d4e5f60',
29
30
  name: 'myApp',
30
31
  appLoc: '/Public/myApp',
@@ -1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