@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,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNRECORDED = void 0;
4
+ exports.UNRECORDED = [
5
+ // The recorder hands the adapter a token it obtained itself, so the calls that
6
+ // obtain one never pass through the proxy. The capture tool records them as a
7
+ // separate pass, which needs a client id and secret.
8
+ {
9
+ path: '/SASLogon',
10
+ reason: 'no capture: the pass authenticates outside the adapter, so the login root is never requested through the client'
11
+ },
12
+ {
13
+ path: '/SASLogon/login',
14
+ reason: 'no capture: an interactive login; the pass presents a token instead of a form'
15
+ },
16
+ {
17
+ path: '/SASLogon/login.do',
18
+ reason: 'no capture: an interactive login; the pass presents a token instead of a form'
19
+ },
20
+ {
21
+ path: '/SASLogon/logout',
22
+ reason: 'no capture: the pass never signs out, because a capture run must leave the estate as it found it'
23
+ },
24
+ {
25
+ path: '/SASLogon/logout.do',
26
+ reason: 'no capture: the pass never signs out, because a capture run must leave the estate as it found it'
27
+ },
28
+ {
29
+ path: '/SASLogon/oauth/authorize',
30
+ reason: 'no capture: the authorisation-code step needs a browser; the pass uses the password grant'
31
+ },
32
+ // Compute operations the scripted passes do not reach.
33
+ {
34
+ path: '/compute/sessions/{}/filerefs/_webout/content',
35
+ 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'
36
+ },
37
+ {
38
+ path: '/compute/sessions/{}/variables/{}',
39
+ reason: "no capture: the adapter reads a session variable only to report a submitted job's pid (`printPid`), which the pass does not set"
40
+ },
41
+ {
42
+ path: '/launcher/contexts',
43
+ reason: 'no capture: the fallback list, asked for only when the compute context list fails; a healthy estate never reaches it'
44
+ },
45
+ // The job path needs something deployed to run.
46
+ {
47
+ path: '/jobDefinitions/definitions',
48
+ 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'
49
+ },
50
+ {
51
+ path: '/jobExecution/jobs',
52
+ reason: 'no capture: needs a deployed service to submit. The next pass deploys a service pack under its own app folder'
53
+ },
54
+ {
55
+ path: '/jobExecution/jobs/{}',
56
+ reason: 'no capture: follows a submission, so it arrives with the same pass as POST /jobExecution/jobs'
57
+ }
58
+ ];
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emulatedHeaders = exports.EMULATED_HEADER_VALUE = exports.EMULATED_HEADER = exports.VIYA_CAPTURED_AT = exports.VIYA_TARGET_VERSION = void 0;
4
+ /**
5
+ * The one Viya version this emulator emulates, and the header that says so.
6
+ *
7
+ * Decision 6 of sasjs/server#665: the contract is pinned to one version, and
8
+ * every answer names it. The pin is not a preference - it is the version the
9
+ * capture was taken against, recorded with the date of that capture, so a reader
10
+ * can see how old the contract is. Raising it moves the table, the corpus, the
11
+ * drift baseline and this header in one commit, justified by a fresh capture.
12
+ *
13
+ * The value is `sysvlong` as SAS reported it in a compute session on the estate:
14
+ *
15
+ * %put &=sysvlong; -> V.04.00M0P100526
16
+ */
17
+ exports.VIYA_TARGET_VERSION = 'V.04.00M0P100526';
18
+ /** The day the capture that pins this version was taken. */
19
+ exports.VIYA_CAPTURED_AT = '2026-11-12';
20
+ /** The header every emulated answer carries, including refusals and 404s. */
21
+ exports.EMULATED_HEADER = 'x-sasjs-emulated';
22
+ /**
23
+ * `viya@<version>`: one header, one fact.
24
+ *
25
+ * Decision 12 asked whether a second header should separate the version from the
26
+ * mode. It should not - a reader who sees this header knows both what answered
27
+ * and which contract it answered against, and a machine that keys on the value
28
+ * cannot mistake an emulated answer for a real one.
29
+ */
30
+ exports.EMULATED_HEADER_VALUE = `viya@${exports.VIYA_TARGET_VERSION}`;
31
+ /**
32
+ * The headers an emulated answer carries.
33
+ *
34
+ * `Access-Control-Expose-Headers` is not decoration: the browser reads a
35
+ * response's headers across an origin only when the server names them, so
36
+ * without it the one header that makes emulation unmistakable is the one a
37
+ * cross-origin client cannot see.
38
+ */
39
+ const emulatedHeaders = () => ({
40
+ [exports.EMULATED_HEADER]: exports.EMULATED_HEADER_VALUE,
41
+ 'Access-Control-Expose-Headers': exports.EMULATED_HEADER
42
+ });
43
+ exports.emulatedHeaders = emulatedHeaders;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The Viya conformance corpus: what the estate answered, as data.
3
+ *
4
+ * Generated by `npm run sync:viya` from a capture taken against Viya
5
+ * V.04.00M0P100526. Do not edit by hand: the capture is the evidence, and a change
6
+ * here that the capture does not support is a claim nobody can check.
7
+ *
8
+ * Values never reach this file. A path keeps its shape with `{}` for a segment
9
+ * that was an identifier, a query keeps its parameter names, and a body is a
10
+ * type sketch - the emulator generates its data from a seed, so the shape is all
11
+ * the table needs.
12
+ */
13
+ export interface ViyaCase {
14
+ /** The operation, `METHOD /path`. */
15
+ route: string;
16
+ /** The scripted pass that produced it. */
17
+ step: string;
18
+ /** Parameter names the client sent, so a replay can build the request. */
19
+ queries: string[];
20
+ /** Statuses the operation may answer with. */
21
+ statuses: number[];
22
+ /** The status the captured answer carried. */
23
+ expected: number;
24
+ /** The shape of the captured body, where it carried one. */
25
+ shape?: unknown;
26
+ }
27
+ export declare const VIYA_CORPUS: ViyaCase[];
28
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/corpus/viya/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,QAAQ;IACvB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,QAAQ,EAunBjC,CAAA"}