@sasjs/api 0.33.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 (37) hide show
  1. package/build/browser.js +1962 -50
  2. package/build/cjs/corpus/viya/operations.js +647 -0
  3. package/build/cjs/index.js +60 -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 +1 -49
  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 +12 -0
  15. package/build/esm/index.d.ts.map +1 -1
  16. package/build/esm/index.js +7 -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.map +1 -1
  27. package/build/esm/viya/surface.js +1 -49
  28. package/build/esm/viya/table.d.ts +39 -0
  29. package/build/esm/viya/table.d.ts.map +1 -0
  30. package/build/esm/viya/table.js +802 -0
  31. package/build/esm/viya/unrecorded.d.ts +24 -0
  32. package/build/esm/viya/unrecorded.d.ts.map +1 -0
  33. package/build/esm/viya/unrecorded.js +55 -0
  34. package/build/esm/viya/version.d.ts +37 -0
  35. package/build/esm/viya/version.d.ts.map +1 -0
  36. package/build/esm/viya/version.js +39 -0
  37. package/package.json +3 -1
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The in-scope operations the captures do not describe, and why.
3
+ *
4
+ * Phase 0's exit criterion is "every operation carries a captured case or a
5
+ * stated reason". This is the stated reason, in a form a check can read: an
6
+ * operation that leaves this file joins `src/viya/table.ts` instead, and one
7
+ * that joins the table must leave this file - the two are a partition of the
8
+ * in-scope surface, and `spec/viyaTable.spec.ts` holds that.
9
+ *
10
+ * A reason is a claim about what is missing, not a promise of when it arrives:
11
+ * "needs a deployed job definition" tells the next reader which pass to run,
12
+ * where "TODO" tells them nothing.
13
+ */
14
+ export interface UnrecordedOperation {
15
+ /**
16
+ * The path, with `{}` for a segment that is an identifier. No verb: the verb
17
+ * lives at the call site and nothing has observed one, so stating a method
18
+ * here would be a guess wearing the same clothes as a measurement.
19
+ */
20
+ path: string;
21
+ reason: string;
22
+ }
23
+ export declare const UNRECORDED: UnrecordedOperation[];
24
+ //# sourceMappingURL=unrecorded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unrecorded.d.ts","sourceRoot":"","sources":["../../../src/viya/unrecorded.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,UAAU,EAAE,mBAAmB,EAoE3C,CAAA"}
@@ -0,0 +1,55 @@
1
+ export const UNRECORDED = [
2
+ // The recorder hands the adapter a token it obtained itself, so the calls that
3
+ // obtain one never pass through the proxy. The capture tool records them as a
4
+ // separate pass, which needs a client id and secret.
5
+ {
6
+ path: '/SASLogon',
7
+ reason: 'no capture: the pass authenticates outside the adapter, so the login root is never requested through the client'
8
+ },
9
+ {
10
+ path: '/SASLogon/login',
11
+ reason: 'no capture: an interactive login; the pass presents a token instead of a form'
12
+ },
13
+ {
14
+ path: '/SASLogon/login.do',
15
+ reason: 'no capture: an interactive login; the pass presents a token instead of a form'
16
+ },
17
+ {
18
+ path: '/SASLogon/logout',
19
+ reason: 'no capture: the pass never signs out, because a capture run must leave the estate as it found it'
20
+ },
21
+ {
22
+ path: '/SASLogon/logout.do',
23
+ reason: 'no capture: the pass never signs out, because a capture run must leave the estate as it found it'
24
+ },
25
+ {
26
+ path: '/SASLogon/oauth/authorize',
27
+ reason: 'no capture: the authorisation-code step needs a browser; the pass uses the password grant'
28
+ },
29
+ // Compute operations the scripted passes do not reach.
30
+ {
31
+ path: '/compute/sessions/{}/filerefs/_webout/content',
32
+ reason: 'no capture: the adapter reads the webout fileref only when a run expects one (`expectWebout`); the execute pass submits a `%put` and reads the log'
33
+ },
34
+ {
35
+ path: '/compute/sessions/{}/variables/{}',
36
+ reason: "no capture: the adapter reads a session variable only to report a submitted job's pid (`printPid`), which the pass does not set"
37
+ },
38
+ {
39
+ path: '/launcher/contexts',
40
+ reason: 'no capture: the fallback list, asked for only when the compute context list fails; a healthy estate never reaches it'
41
+ },
42
+ // The job path needs something deployed to run.
43
+ {
44
+ path: '/jobDefinitions/definitions',
45
+ reason: 'no capture: needs a job definition on the estate. The next pass deploys a service pack under its own app folder and reads the definition back'
46
+ },
47
+ {
48
+ path: '/jobExecution/jobs',
49
+ reason: 'no capture: needs a deployed service to submit. The next pass deploys a service pack under its own app folder'
50
+ },
51
+ {
52
+ path: '/jobExecution/jobs/{}',
53
+ reason: 'no capture: follows a submission, so it arrives with the same pass as POST /jobExecution/jobs'
54
+ }
55
+ ];
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The one Viya version this emulator emulates, and the header that says so.
3
+ *
4
+ * Decision 6 of sasjs/server#665: the contract is pinned to one version, and
5
+ * every answer names it. The pin is not a preference - it is the version the
6
+ * capture was taken against, recorded with the date of that capture, so a reader
7
+ * can see how old the contract is. Raising it moves the table, the corpus, the
8
+ * drift baseline and this header in one commit, justified by a fresh capture.
9
+ *
10
+ * The value is `sysvlong` as SAS reported it in a compute session on the estate:
11
+ *
12
+ * %put &=sysvlong; -> V.04.00M0P100526
13
+ */
14
+ export declare const VIYA_TARGET_VERSION = "V.04.00M0P100526";
15
+ /** The day the capture that pins this version was taken. */
16
+ export declare const VIYA_CAPTURED_AT = "2026-11-12";
17
+ /** The header every emulated answer carries, including refusals and 404s. */
18
+ export declare const EMULATED_HEADER = "x-sasjs-emulated";
19
+ /**
20
+ * `viya@<version>`: one header, one fact.
21
+ *
22
+ * Decision 12 asked whether a second header should separate the version from the
23
+ * mode. It should not - a reader who sees this header knows both what answered
24
+ * and which contract it answered against, and a machine that keys on the value
25
+ * cannot mistake an emulated answer for a real one.
26
+ */
27
+ export declare const EMULATED_HEADER_VALUE = "viya@V.04.00M0P100526";
28
+ /**
29
+ * The headers an emulated answer carries.
30
+ *
31
+ * `Access-Control-Expose-Headers` is not decoration: the browser reads a
32
+ * response's headers across an origin only when the server names them, so
33
+ * without it the one header that makes emulation unmistakable is the one a
34
+ * cross-origin client cannot see.
35
+ */
36
+ export declare const emulatedHeaders: () => Record<string, string>;
37
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/viya/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,qBAAqB,CAAA;AAErD,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAE5C,6EAA6E;AAC7E,eAAO,MAAM,eAAe,qBAAqB,CAAA;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,0BAAgC,CAAA;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,QAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAGtD,CAAA"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The one Viya version this emulator emulates, and the header that says so.
3
+ *
4
+ * Decision 6 of sasjs/server#665: the contract is pinned to one version, and
5
+ * every answer names it. The pin is not a preference - it is the version the
6
+ * capture was taken against, recorded with the date of that capture, so a reader
7
+ * can see how old the contract is. Raising it moves the table, the corpus, the
8
+ * drift baseline and this header in one commit, justified by a fresh capture.
9
+ *
10
+ * The value is `sysvlong` as SAS reported it in a compute session on the estate:
11
+ *
12
+ * %put &=sysvlong; -> V.04.00M0P100526
13
+ */
14
+ export const VIYA_TARGET_VERSION = 'V.04.00M0P100526';
15
+ /** The day the capture that pins this version was taken. */
16
+ export const VIYA_CAPTURED_AT = '2026-11-12';
17
+ /** The header every emulated answer carries, including refusals and 404s. */
18
+ export const EMULATED_HEADER = 'x-sasjs-emulated';
19
+ /**
20
+ * `viya@<version>`: one header, one fact.
21
+ *
22
+ * Decision 12 asked whether a second header should separate the version from the
23
+ * mode. It should not - a reader who sees this header knows both what answered
24
+ * and which contract it answered against, and a machine that keys on the value
25
+ * cannot mistake an emulated answer for a real one.
26
+ */
27
+ export const EMULATED_HEADER_VALUE = `viya@${VIYA_TARGET_VERSION}`;
28
+ /**
29
+ * The headers an emulated answer carries.
30
+ *
31
+ * `Access-Control-Expose-Headers` is not decoration: the browser reads a
32
+ * response's headers across an origin only when the server names them, so
33
+ * without it the one header that makes emulation unmistakable is the one a
34
+ * cross-origin client cannot see.
35
+ */
36
+ export const emulatedHeaders = () => ({
37
+ [EMULATED_HEADER]: EMULATED_HEADER_VALUE,
38
+ 'Access-Control-Expose-Headers': EMULATED_HEADER
39
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sasjs/api",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "The SASjs Server API, described once - a generated route table, the services behind it, and the conformance corpus both hosts run",
5
5
  "license": "MIT",
6
6
  "author": "SASjs",
@@ -44,6 +44,8 @@
44
44
  "check:routes": "node scripts/sync-routes.mjs --check",
45
45
  "sync:scope": "node scripts/viya-scope.mjs",
46
46
  "check:scope": "node scripts/viya-scope.mjs --check",
47
+ "sync:viya": "node scripts/viya-generate.mjs",
48
+ "check:viya": "node scripts/viya-generate.mjs --check",
47
49
  "check:builds": "node scripts/check-builds.mjs",
48
50
  "audit:gate": "node scripts/audit.mjs",
49
51
  "check:appstream": "node scripts/appstream-browser-check.cjs"