@sasjs/api 0.29.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 (41) hide show
  1. package/build/browser.js +559 -325
  2. package/build/cjs/appstream/service.js +48 -5
  3. package/build/cjs/appstream/web.js +7 -3
  4. package/build/cjs/corpus/app.js +55 -0
  5. package/build/cjs/corpus/runner.js +7 -6
  6. package/build/cjs/host/dispatch.js +71 -0
  7. package/build/cjs/index.js +9 -2
  8. package/build/cjs/routes/generated.js +34 -0
  9. package/build/cjs/routes/overlay.js +34 -1
  10. package/build/cjs/runtime/program.js +85 -0
  11. package/build/cjs/runtime/runTimes.js +13 -0
  12. package/build/cjs/runtime/service.js +11 -13
  13. package/build/esm/appstream/service.d.ts.map +1 -1
  14. package/build/esm/appstream/service.js +48 -5
  15. package/build/esm/appstream/web.d.ts.map +1 -1
  16. package/build/esm/appstream/web.js +7 -3
  17. package/build/esm/corpus/app.d.ts +17 -0
  18. package/build/esm/corpus/app.d.ts.map +1 -0
  19. package/build/esm/corpus/app.js +52 -0
  20. package/build/esm/corpus/runner.d.ts +13 -0
  21. package/build/esm/corpus/runner.d.ts.map +1 -1
  22. package/build/esm/corpus/runner.js +5 -4
  23. package/build/esm/host/dispatch.d.ts.map +1 -1
  24. package/build/esm/host/dispatch.js +72 -1
  25. package/build/esm/index.d.ts +5 -1
  26. package/build/esm/index.d.ts.map +1 -1
  27. package/build/esm/index.js +4 -1
  28. package/build/esm/routes/generated.d.ts.map +1 -1
  29. package/build/esm/routes/generated.js +34 -0
  30. package/build/esm/routes/overlay.d.ts.map +1 -1
  31. package/build/esm/routes/overlay.js +34 -1
  32. package/build/esm/runtime/program.d.ts +56 -0
  33. package/build/esm/runtime/program.d.ts.map +1 -0
  34. package/build/esm/runtime/program.js +79 -0
  35. package/build/esm/runtime/runTimes.d.ts +11 -0
  36. package/build/esm/runtime/runTimes.d.ts.map +1 -0
  37. package/build/esm/runtime/runTimes.js +10 -0
  38. package/build/esm/runtime/service.d.ts +0 -2
  39. package/build/esm/runtime/service.d.ts.map +1 -1
  40. package/build/esm/runtime/service.js +9 -11
  41. package/package.json +1 -1
@@ -4,9 +4,11 @@
4
4
  * An app is one deployed folder (`appLoc`), the web assets inside it
5
5
  * (`appLoc/services/<streamWebFolder>`) and a UUID assigned when it is first
6
6
  * published. The id is the key the routes, the listing and the permission rules
7
- * point at; the name is a label a person reads, and carries no uniqueness rule at
8
- * all - two apps may be called the same thing without colliding, because nothing
9
- * is looked up by name.
7
+ * point at, and it is what a redeploy keeps. The name is a label a person reads
8
+ * AND - when exactly one app holds it - an address: `/app/<name>` opens the app,
9
+ * so a name the caller states is validated as a URL segment and has to be free.
10
+ * A label derived from the folder carries no such rule, because it was not
11
+ * chosen: two folders may share a leaf name and both stay openable by id.
10
12
  *
11
13
  * The service is the decisions, and a host supplies the storage. That split is
12
14
  * the point of this package: sasjs/server keeps the index in a JSON file beside
@@ -133,7 +135,34 @@ const nameOf = (value, appLoc) => {
133
135
  return defaultAppName(appLoc);
134
136
  if (typeof value !== 'string' || value.trim() === '')
135
137
  throw new ApiError(400, '"name" must be a non-empty string');
136
- return value.trim();
138
+ return urlSafeName(value.trim());
139
+ };
140
+ /**
141
+ * A stated name is a URL segment, so it has to be spellable in one.
142
+ *
143
+ * `/app/<name>` resolves an app by its name when exactly one holds it, which
144
+ * makes the name an address and not only a label. A name carrying a space, a
145
+ * `#`, a `?` or a `/` is either unopenable or forced through percent-encoding -
146
+ * `/app/Macro%20Dash/` - and a name that collides with the surface's own paths
147
+ * (`apps.json`, the landing page's `index.html`) can never be opened by name at
148
+ * all, because those are answered before any app is looked up.
149
+ *
150
+ * Only a STATED name is held to this. A label derived from the folder stays as
151
+ * the folder spelled it, because a deployment that never chose a name did not
152
+ * choose an address either, and two folders sharing a leaf name are a fact of
153
+ * the drive rather than a naming decision.
154
+ */
155
+ const NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._~-]*$/;
156
+ const NAME_MAX_LENGTH = 64;
157
+ const RESERVED_NAMES = ['apps.json', 'index.html'];
158
+ const urlSafeName = (name) => {
159
+ if (name.length > NAME_MAX_LENGTH)
160
+ throw new ApiError(400, `"name" must be at most ${NAME_MAX_LENGTH} characters, and "${name}" is ${name.length}.`);
161
+ if (!NAME_PATTERN.test(name))
162
+ throw new ApiError(400, `"name" must be usable as a URL segment - letters, digits, dot, dash, underscore or tilde, starting with a letter or digit - so "/app/${name}" can be opened. "${name}" is not, because it carries a character that has to be percent-encoded, or a space.`);
163
+ if (RESERVED_NAMES.includes(name.toLowerCase()))
164
+ throw new ApiError(400, `"name" cannot be "${name}": the App Stream answers /app/${name} itself, so an app with that name could never be opened by name.`);
165
+ return name;
137
166
  };
138
167
  const logoOf = (value) => {
139
168
  if (value === undefined)
@@ -204,11 +233,25 @@ export const createAppStreamService = (store) => {
204
233
  const existing = entries.find((entry) => sameAppLoc(entry.appLoc, appLoc));
205
234
  const logo = checked.logo;
206
235
  const frameAncestors = checked.frameAncestors;
236
+ // A name this publish STATES is an address, so it is validated as a URL
237
+ // segment and has to be free. A name it inherits from the last publish,
238
+ // or one derived from the folder, is a label only: it was not chosen
239
+ // here, it may predate this rule, and two folders may share a leaf name.
240
+ const statedName = checked.name;
241
+ const name = statedName !== undefined
242
+ ? nameOf(statedName, appLoc)
243
+ : (existing?.name ?? nameOf(undefined, appLoc));
244
+ if (statedName !== undefined) {
245
+ const clash = entries.find((candidate) => !sameAppLoc(candidate.appLoc, appLoc) &&
246
+ candidate.name.toLowerCase() === name.toLowerCase());
247
+ if (clash)
248
+ throw new ApiError(409, `The name "${name}" is already the address of the app published at ${clash.appLoc}. A stated name is how the app opens (/app/${name}), and two apps holding one name would answer an ambiguous lookup with nothing, so publish this one under a different name.`);
249
+ }
207
250
  const entry = {
208
251
  id: existing ? existing.id : newAppId(),
209
252
  // the label is the one field a redeploy inherits: everything else is
210
253
  // what this publish states
211
- name: nameOf(checked.name ?? existing?.name, appLoc),
254
+ name,
212
255
  appLoc,
213
256
  streamWebFolder,
214
257
  ...(logo === undefined ? {} : { logo }),
@@ -1 +1 @@
1
- {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../../src/appstream/web.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpE,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,SAAS,CAAA;AAEtC,iFAAiF;AACjF,eAAO,MAAM,WAAW,0CAA0C,CAAA;AAElE,uEAAuE;AACvE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,uEAAuE;AACvE,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAA;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,IAAI,CAAC,KAAK,CA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AG,MAIjD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,KAAG,MAGT,CAAA;AAmC1C,eAAO,MAAM,yBAAyB,GACpC,WAAW,gBAAgB,EAC3B,OAAO,YAAY,EACnB,UAAS,mBAAwB,KAChC,mBAoLF,CAAA"}
@@ -150,9 +150,13 @@ export const createAppStreamWebService = (appStream, drive, options = {}) => {
150
150
  ].join(''));
151
151
  };
152
152
  /**
153
- * The app a URL segment names: its id, or - as a courtesy - its label when one
154
- * app alone holds that label. An ambiguous label resolves to nothing, because
155
- * guessing which of two same-named apps a URL meant is worse than a 404.
153
+ * The app a URL segment names: its id, or its label when one app alone holds
154
+ * that label. The label is a real address, not a convenience - `/app/<name>`
155
+ * is the readable form of an app's URL - and the publish side keeps it usable
156
+ * by validating a stated name as a URL segment and refusing one another app
157
+ * holds. An ambiguous label still resolves to nothing, because a label derived
158
+ * from a folder has no uniqueness rule of its own, and guessing which of two
159
+ * same-named apps a URL meant is worse than a 404.
156
160
  */
157
161
  const resolve = async (segment, allow) => {
158
162
  const entries = await appStream.list(allow);
@@ -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 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/host/dispatch.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAA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KAAG,QAO3C,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,cAAc,EAAE,MAAM,EA+DlC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { routeById } from '../routes/index.js';
2
2
  import { appSummary, checkPublishRequest } from '../appstream/service.js';
3
3
  import { publishRequestFor, splitAppBundle } from '../appstream/bundle.js';
4
- import { ApiError } from '../types.js';
4
+ import { ApiError, isApiError } from '../types.js';
5
5
  import { DEPLOY_SUCCESS } from '../drive/deploy.js';
6
6
  /** The defaults sasjs/server's Client schema applies to an omitted lifetime. */
7
7
  const SECONDS_IN_A_DAY = 86400;
@@ -68,6 +68,20 @@ const validate = (route, request) => {
68
68
  throw new ApiError(400, `"${param.name}" is not allowed to be empty`);
69
69
  }
70
70
  };
71
+ /** The file an app is served from for a directory request, as the surface serves it. */
72
+ const APP_ENTRY_FILE = 'index.html';
73
+ /**
74
+ * An app the index does not hold, in the wording the route answers with.
75
+ *
76
+ * The package's own message names the id ("No app is published with that id"); the
77
+ * route names the App Stream, and the corpus is what both hosts answer, so the
78
+ * wording is stated here rather than left to the service's.
79
+ */
80
+ const APP_NOT_REGISTERED = 'No App Stream is registered with that id.';
81
+ const appNotRegistered = () => new ApiError(404, APP_NOT_REGISTERED, {
82
+ status: 'failure',
83
+ message: APP_NOT_REGISTERED
84
+ });
71
85
  /** The drive path a write names: the query parameter wins over the form field. */
72
86
  const targetPath = (request) => {
73
87
  const fromQuery = request.query?._filePath;
@@ -354,6 +368,62 @@ export const dispatch = async (services, routeId, request = {}) => {
354
368
  body: { status: 'success', app: appSummary(removed) }
355
369
  };
356
370
  }
371
+ // --------------------------------------------------- what an app *is*
372
+ //
373
+ // The surface serves an app's files; this describes the app itself - the entry
374
+ // as registered, and whether the file it is served from is there. Addressed by id,
375
+ // which is what a publish answers with and what the app's URL carries: a label is
376
+ // shared by design, so "the app with this name" is not one app.
377
+ case 'GET /SASjsApi/app/{id}': {
378
+ if (!services.appStream)
379
+ throw new ApiError(501, `This host has no app stream, so it cannot answer ${routeId}.`);
380
+ const entry = await services.appStream
381
+ .get(String(params.id ?? ''))
382
+ .catch((err) => {
383
+ if (isApiError(err) && err.status === 404)
384
+ throw appNotRegistered();
385
+ throw err;
386
+ });
387
+ const folder = `${entry.appLoc}/services/${entry.streamWebFolder}`;
388
+ // An index entry can outlive its deployment - the folder deleted from under
389
+ // the host - and reporting a file and a date that are not there would be worse
390
+ // than reporting none, so the listing decides both.
391
+ let entryFileExists = false;
392
+ let lastModified = null;
393
+ try {
394
+ const { tree } = await drive.tree(folder);
395
+ const file = tree.children.find((child) => child.name === APP_ENTRY_FILE && !child.isFolder);
396
+ entryFileExists = file !== undefined;
397
+ lastModified = file?.modified ?? null;
398
+ }
399
+ catch (err) {
400
+ // A folder that is gone is the ordinary case - an index entry that outlived
401
+ // its deployment - and the answer is "no entry file". Anything else is not
402
+ // that answer: a `streamWebFolder` that names a file, or a store that failed,
403
+ // would read as a deleted deployment, so it reaches the host's 500.
404
+ if (!isApiError(err) || err.status !== 404)
405
+ throw err;
406
+ entryFileExists = false;
407
+ }
408
+ const body = {
409
+ id: entry.id,
410
+ name: entry.name,
411
+ appLoc: entry.appLoc,
412
+ streamWebFolder: entry.streamWebFolder,
413
+ publishedAt: entry.publishedAt ?? null,
414
+ entryFile: APP_ENTRY_FILE,
415
+ entryFileExists,
416
+ lastModified,
417
+ url: `/app/${entry.id}/`
418
+ };
419
+ // the two the index may not carry are absent rather than undefined, which is
420
+ // how they reach a JSON client
421
+ if (entry.logo !== undefined)
422
+ body.logo = entry.logo;
423
+ if (entry.frameAncestors !== undefined)
424
+ body.frameAncestors = entry.frameAncestors;
425
+ return { status: 200, body };
426
+ }
357
427
  case 'GET /SASjsApi/drive/filetree':
358
428
  return { status: 200, body: await drive.tree(query._folderPath) };
359
429
  // ------------------------------------------------------------- run times
@@ -663,6 +733,7 @@ export const HANDLED_ROUTES = [
663
733
  'DELETE /SASjsApi/drive/folder',
664
734
  'POST /SASjsApi/drive/rename',
665
735
  'GET /SASjsApi/drive/filetree',
736
+ 'GET /SASjsApi/app/{id}',
666
737
  'POST /SASjsApi/drive/deploy',
667
738
  'POST /SASjsApi/auth/token',
668
739
  'POST /SASjsApi/auth/refresh',
@@ -54,12 +54,16 @@ export type { IdentityClient, IdentityClientRecord, IdentityGroupRecord, Identit
54
54
  export { DRIVE_CORPUS } from './corpus/drive.js';
55
55
  export { IDENTITY_CORPUS } from './corpus/identity.js';
56
56
  export { DEPLOY_CORPUS } from './corpus/deploy.js';
57
+ export { APP_CORPUS } from './corpus/app.js';
57
58
  export { SESSION_CORPUS } from './corpus/session.js';
58
59
  export { createSessionService } from './session/service.js';
59
60
  export type { CallerDirectory, HostSession, SessionArtifact, SessionHost, SessionService, SessionStateResponse, SessionStateValue, SessionSummary } from './session/service.js';
60
61
  export { DEFAULT_SESSIONS, MemorySessionHost } from './session/memory-host.js';
61
- export { CODE_DEBUG, DOCUMENTED_RUN_TIMES, createRuntimeService } from './runtime/service.js';
62
+ export { CODE_DEBUG, createRuntimeService } from './runtime/service.js';
63
+ export { DOCUMENTED_RUN_TIMES } from './runtime/runTimes.js';
62
64
  export type { ProgramSource, RunOutcome, RunRequest, RunnerSession, RuntimeRequest, RuntimeService, RuntimeServiceOptions, SessionRunner, TriggerResponse } from './runtime/service.js';
65
+ export { programNotFound, resolveProgram, runTimeOfPath } from './runtime/program.js';
66
+ export type { ProgramDeps, ProgramResolution } from './runtime/program.js';
63
67
  export { MemorySessionRunner } from './runtime/memory-runner.js';
64
68
  export type { MemoryRunnerOptions } from './runtime/memory-runner.js';
65
69
  export { RUNTIME_CORPUS } from './corpus/runtime.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,YAAY,CAAA;AAC1B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,OAAO,EACP,QAAQ,EACR,MAAM,EACP,MAAM,kBAAk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EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA"}
@@ -41,10 +41,13 @@ export { DEFAULT_IDENTITY, IDENTITY_FORMAT, parseIdentity } from './identity/fix
41
41
  export { DRIVE_CORPUS } from './corpus/drive.js';
42
42
  export { IDENTITY_CORPUS } from './corpus/identity.js';
43
43
  export { DEPLOY_CORPUS } from './corpus/deploy.js';
44
+ export { APP_CORPUS } from './corpus/app.js';
44
45
  export { SESSION_CORPUS } from './corpus/session.js';
45
46
  export { createSessionService } from './session/service.js';
46
47
  export { DEFAULT_SESSIONS, MemorySessionHost } from './session/memory-host.js';
47
- export { CODE_DEBUG, DOCUMENTED_RUN_TIMES, createRuntimeService } from './runtime/service.js';
48
+ export { CODE_DEBUG, createRuntimeService } from './runtime/service.js';
49
+ export { DOCUMENTED_RUN_TIMES } from './runtime/runTimes.js';
50
+ export { programNotFound, resolveProgram, runTimeOfPath } from './runtime/program.js';
48
51
  export { MemorySessionRunner } from './runtime/memory-runner.js';
49
52
  export { RUNTIME_CORPUS } from './corpus/runtime.js';
50
53
  export { RECORD_CORPUS, ADMIN_SIGNED_IN, PROVIDER_MANAGED } from './corpus/records.js';
@@ -1 +1 @@
1
- {"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../../src/routes/generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAgkE5C,CAAA"}
1
+ {"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../../src/routes/generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAkmE5C,CAAA"}
@@ -104,6 +104,40 @@ export const GENERATED_ROUTES = [
104
104
  }
105
105
  ]
106
106
  },
107
+ {
108
+ id: 'GET /SASjsApi/app/{id}',
109
+ method: 'GET',
110
+ path: '/SASjsApi/app/{id}',
111
+ tag: 'App Stream',
112
+ summary: 'Get a published app by id',
113
+ params: [
114
+ {
115
+ name: 'id',
116
+ in: 'path',
117
+ required: true,
118
+ type: 'string'
119
+ }
120
+ ],
121
+ requestBodies: [],
122
+ responses: [
123
+ {
124
+ status: 200,
125
+ description: 'Ok'
126
+ },
127
+ {
128
+ status: 401,
129
+ description: 'Unauthorized'
130
+ },
131
+ {
132
+ status: 404,
133
+ description: 'No App Stream is registered with that id.'
134
+ },
135
+ {
136
+ status: 500,
137
+ description: 'Internal Server Error'
138
+ }
139
+ ]
140
+ },
107
141
  {
108
142
  id: 'POST /SASjsApi/auth/logout',
109
143
  method: 'POST',
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/routes/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGzD,yDAAyD;AACzD,UAAU,aAAa;IACrB,YAAY,CAAC,EAAE,UAAU,EAAE,CAAA;IAC3B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,CAAC;IAAE,WAAW,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAElE,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAczD,CAAA;AAmBD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAiUhD,CAAA;AAED,wEAAwE;AACxE,eAAO,MAAM,OAAO,EAAE,UAAU,EAA8C,CAAA"}
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/routes/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGzD,yDAAyD;AACzD,UAAU,aAAa;IACrB,YAAY,CAAC,EAAE,UAAU,EAAE,CAAA;IAC3B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,CAAC;IAAE,WAAW,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAElE,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAgBzD,CAAA;AAmBD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAiWhD,CAAA;AAED,wEAAwE;AACxE,eAAO,MAAM,OAAO,EAAE,UAAU,EAA8C,CAAA"}
@@ -13,7 +13,9 @@ export const TAG_CAPABILITIES = {
13
13
  Group: ['identity'],
14
14
  Permission: ['identity'],
15
15
  Client: ['identity'],
16
- Web: ['identity']
16
+ Web: ['identity'],
17
+ // an app's entry is indexed, and the file it is served from is read off the drive
18
+ 'App Stream': ['storage']
17
19
  };
18
20
  /**
19
21
  * Why a block of operations is not implemented here.
@@ -251,6 +253,37 @@ export const OVERLAY = {
251
253
  // `404` is an id the index does not hold - the id is the app, and its label and
252
254
  // folder are not handles - and the drive's content is deliberately left alone.
253
255
  'DELETE /SASjsApi/drive/deploy': { implemented: true },
256
+ // App Stream - what is published under one app's id.
257
+ //
258
+ // Carried here: the answer is the app index plus the drive, and `APP_CORPUS` pins
259
+ // its shape. The mock build (`sasjs/cli`) still answers the App Stream surface by
260
+ // hand; consuming this operation from the table is its next step on
261
+ // sasjs/cli#1550, not this package's.
262
+ 'GET /SASjsApi/app/{id}': {
263
+ implemented: true,
264
+ // the caller's token is the host's middleware, and a failure that is not the
265
+ // index refusing the id - a drive read that broke - is the host's to answer
266
+ hostResponses: [401, 500],
267
+ // the shape a client reads: the entry as registered, the file it is served from,
268
+ // and whether that file is there
269
+ responses: {
270
+ 404: {
271
+ status: 'failure',
272
+ message: 'No App Stream is registered with that id.'
273
+ },
274
+ 200: {
275
+ id: '',
276
+ name: '',
277
+ appLoc: '',
278
+ streamWebFolder: '',
279
+ publishedAt: null,
280
+ entryFile: 'index.html',
281
+ entryFileExists: false,
282
+ lastModified: null,
283
+ url: ''
284
+ }
285
+ }
286
+ },
254
287
  // Group - members and the groups themselves
255
288
  'GET /SASjsApi/group': { implemented: true },
256
289
  'GET /SASjsApi/group/{uid}': { implemented: true },
@@ -0,0 +1,56 @@
1
+ /** The program the request named, and the run time its own name states. */
2
+ export interface ProgramResolution {
3
+ /** Where the program is, in the host's own addressing. */
4
+ path: string;
5
+ /** The run time the extension names, when it names one. */
6
+ runTime?: string;
7
+ }
8
+ export interface ProgramDeps {
9
+ /**
10
+ * The caller's path resolved against the host's drive, or `null` when it leaves it.
11
+ *
12
+ * A path that leaves the drive is refused the way a program that is not there is
13
+ * refused: saying "your path was rejected but existed" would say something about
14
+ * the host's filesystem.
15
+ */
16
+ resolve: (given: string) => string | null;
17
+ /** Whether the host holds a file at that path. */
18
+ exists: (path: string) => Promise<boolean>;
19
+ /** The run times this host can offer, in the order it probes for one. */
20
+ runTimes: string[];
21
+ }
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
+ export declare const programNotFound: (given: string) => string;
31
+ /**
32
+ * The run time a path's own name states, if it states one.
33
+ *
34
+ * The vocabulary is the document's (`DOCUMENTED_RUN_TIMES`), not a host's: a host
35
+ * that cannot run Python still reads `run.py` as Python and answers separately that
36
+ * it has no such run time. `run.sas7bdat` and `run.backup` name none, and are then
37
+ * probed like a path with no extension at all - which is what the server has always
38
+ * done.
39
+ *
40
+ * The extension is read below either separator, because the server runs on Windows
41
+ * too and resolves its paths with backslashes.
42
+ */
43
+ export declare const runTimeOfPath: (path: string) => string | undefined;
44
+ /**
45
+ * The program and run time a request's `_program` names.
46
+ *
47
+ * The refusal is decided here - `400`, and the detail that names the path the caller
48
+ * gave - and *rendered* by whoever called this, because that is where the two hosts
49
+ * already differ: this package's runtime routes wrap it in the failed-run envelope
50
+ * (`{ status, message, error }`, pinned in `spec/runtime.spec.ts`), and a host that
51
+ * sends the message as text keeps sending it as text. Deciding the rendering here
52
+ * would change one host's answer on the way to unifying the rule, which is not what
53
+ * the seam is for.
54
+ */
55
+ export declare const resolveProgram: (given: string, deps: ProgramDeps) => Promise<ProgramResolution>;
56
+ //# sourceMappingURL=program.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../../src/runtime/program.ts"],"names":[],"mappings":"AAmBA,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IAEZ,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IAEzC,kDAAkD;IAClD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAE1C,yEAAyE;IACzE,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,KAAG,MACH,CAAA;AAK7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,SAQrD,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,EACb,MAAM,WAAW,KAChB,OAAO,CAAC,iBAAiB,CAqB3B,CAAA"}