@sasjs/api 0.20.1 → 0.22.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.
package/README.md CHANGED
@@ -19,12 +19,14 @@ Where the document is wrong, it is corrected in `sasjs/server` and re-vendored h
19
19
 
20
20
  `spec/swagger.yaml` is generated from the controllers in `sasjs/server`. In a checkout of that repository run `npm run swagger` (tsoa), copy `api/public/swagger.yaml` over `spec/swagger.yaml` keeping the header at the top of the file, then run `npm run sync:routes` here. `npm run check:routes` fails if `src/routes/generated.ts` no longer matches the document.
21
21
 
22
- **The services** (`createDriveService`, `createIdentityService`, `createRecordService`, `createSessionService`, `createRuntimeService`) are the API's decisions over storage the host supplies: the statuses, the messages, the order of the checks, and the path rules (including `resolveWithinDrive`'s containment).
22
+ **The services** (`createDriveService`, `createIdentityService`, `createRecordService`, `createSessionService`, `createRuntimeService`, `createInfoService`, `createAuthConfigService`, `createAdminService`, `createDirectoryService`, `createHomeService`) are the API's decisions over storage the host supplies: the statuses, the messages, the order of the checks, and the path rules (including `resolveWithinDrive`'s containment).
23
23
  `createRecordService` is the administration surface - users, groups, permission rules and clients - over the same `IdentityStore`, including the admin gate (`401 Admin account required`) and the self-or-admin rule the server applies in middleware.
24
24
  `createSessionService` reads a triggered session's record, log, output and state, and `createRuntimeService` runs a program or starts one: the package decides the request, the session id, the record, its owner and its retention, and a host's `SessionRunner` performs the work - which is why a mock can answer these routes, and can even finish a session.
25
+ `createInfoService` answers `GET /info` from the host's own configuration (`BROWSER_INFO` is the browser host's answer), and `createAuthConfigService` renders the enabled providers with the secrets reduced to the two `*_SET` booleans - a host that passes a secret-shaped field is refused by name rather than served.
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.
25
27
  They are `async`, take a `DriveStore`, and import nothing - so the same code runs under Express and inside a service worker.
26
28
 
27
- **The corpus** (`DRIVE_CORPUS`, `IDENTITY_CORPUS`, `RECORD_CORPUS`, `SESSION_CORPUS`, `RUNTIME_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.
29
+ **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.
28
30
  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.
29
31
 
30
32
  ## Using it