@sasjs/api 0.24.0 → 0.25.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 (47) hide show
  1. package/README.md +10 -0
  2. package/build/browser.js +655 -93
  3. package/build/cjs/appstream/bundle.js +124 -0
  4. package/build/cjs/appstream/identity.js +69 -0
  5. package/build/cjs/appstream/service.js +226 -0
  6. package/build/cjs/appstream/store.js +69 -0
  7. package/build/cjs/appstream/web.js +248 -0
  8. package/build/cjs/corpus/deploy.js +83 -28
  9. package/build/cjs/corpus/runner.js +30 -18
  10. package/build/cjs/host/dispatch.js +38 -9
  11. package/build/cjs/index.js +25 -4
  12. package/build/cjs/routes/generated.js +2 -8
  13. package/build/cjs/routes/overlay.js +2 -2
  14. package/build/esm/appstream/bundle.d.ts +46 -0
  15. package/build/esm/appstream/bundle.d.ts.map +1 -0
  16. package/build/esm/appstream/bundle.js +118 -0
  17. package/build/esm/appstream/identity.d.ts +27 -0
  18. package/build/esm/appstream/identity.d.ts.map +1 -0
  19. package/build/esm/appstream/identity.js +63 -0
  20. package/build/esm/appstream/service.d.ts +96 -0
  21. package/build/esm/appstream/service.d.ts.map +1 -0
  22. package/build/esm/appstream/service.js +218 -0
  23. package/build/esm/appstream/store.d.ts +6 -0
  24. package/build/esm/appstream/store.d.ts.map +1 -0
  25. package/build/esm/appstream/store.js +65 -0
  26. package/build/esm/appstream/web.d.ts +74 -0
  27. package/build/esm/appstream/web.d.ts.map +1 -0
  28. package/build/esm/appstream/web.js +241 -0
  29. package/build/esm/corpus/deploy.d.ts +5 -5
  30. package/build/esm/corpus/deploy.d.ts.map +1 -1
  31. package/build/esm/corpus/deploy.js +83 -28
  32. package/build/esm/corpus/runner.d.ts.map +1 -1
  33. package/build/esm/corpus/runner.js +14 -2
  34. package/build/esm/host/dispatch.d.ts +5 -4
  35. package/build/esm/host/dispatch.d.ts.map +1 -1
  36. package/build/esm/host/dispatch.js +38 -9
  37. package/build/esm/index.d.ts +8 -2
  38. package/build/esm/index.d.ts.map +1 -1
  39. package/build/esm/index.js +5 -1
  40. package/build/esm/routes/generated.d.ts.map +1 -1
  41. package/build/esm/routes/generated.js +2 -8
  42. package/build/esm/routes/overlay.js +2 -2
  43. package/package.json +5 -4
  44. package/build/cjs/drive/registry.js +0 -38
  45. package/build/esm/drive/registry.d.ts +0 -52
  46. package/build/esm/drive/registry.d.ts.map +0 -1
  47. package/build/esm/drive/registry.js +0 -33
package/README.md CHANGED
@@ -26,6 +26,16 @@ Where the document is wrong, it is corrected in `sasjs/server` and re-vendored h
26
26
  `createAdminService` carries the three Admin reports over the host's `AdminReports`, owning the diagnostics shape, the log-name rule and the `lines` bounds; `createDirectoryService` imports a directory over a five-method `DirectoryStore`, creating what is missing and leaving what exists; `createHomeService` stamps the interface's shell with a token derived from its bundle, so a cached page cannot pin an old build.
27
27
  They are `async`, take a `DriveStore`, and import nothing - so the same code runs under Express and inside a service worker.
28
28
 
29
+ **The app stream** (`createAppStreamService`, `createAppStreamWebService`, `splitAppBundle`) is what a deployed folder becomes when it is an app.
30
+ An app is one folder, the web assets inside it (`<appLoc>/services/<streamWebFolder>`) and a UUID assigned the first time it is published; the readable name is a label with no uniqueness rule, because nothing is looked up by name - the URL is `/app/<id>/`, so two apps may be called the same thing without colliding.
31
+ Publishing a folder that is already published is the same app published again: it keeps its id, which is what makes a redeploy keep its URL.
32
+ `createAppStreamService` is the index over an `AppStreamStore` a host supplies (`MemoryAppStreamStore` ships for a browser, `createDriveAppStreamStore` keeps it in a drive), and `createAppStreamWebService` answers `/app`, `/app/apps.json`, `/app/<id>/...` and `DELETE /app/<id>` over the host's `DriveStore`, so a host mounts one surface rather than reimplementing the listing, the asset lookup and the cache headers.
33
+ An app is removed by its id and nothing else - `DELETE /SASjsApi/drive/deploy` takes `{ "id": "<uuid>" }` - because a label is shared by design and a folder is where the app was published rather than what it is.
34
+
35
+ A deployment and the statement that it is an app travel as one bundle: a zip whose root carries `sasjs.app.json` (`{ "name", "streamWebFolder", "logo", "frameAncestors" }`) beside the folders the app is made of.
36
+ `splitAppBundle` reads that manifest out of the tree and the deploy indexes the app in the same request, so a publish cannot succeed while the files it describes failed to land - or the other way round.
37
+ A deploy that names `streamWebFolder` in its payload publishes without a manifest, and a folder with no manifest and no `streamWebFolder` is a plain deployment that indexes nothing.
38
+
29
39
  **The corpus** (`DRIVE_CORPUS`, `DEPLOY_CORPUS`, `CODE_CORPUS`, `IDENTITY_CORPUS`, `RECORD_CORPUS`, `SESSION_CORPUS`, `RUNTIME_CORPUS`, `INFO_CORPUS`, `ADMIN_CORPUS`, `AUTH_CONFIG_CORPUS`, `DIRECTORY_CORPUS`, `HOME_CORPUS`, `runCase`) is what "the same API" means when a test has to check it: each case is a request, the answer a client expects, and the files it starts from.
30
40
  The same cases are meant to run against a live server and against the browser build, so a difference fails a test rather than waiting for a reviewer to notice.
31
41