@sasjs/api 0.40.2 → 0.42.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 (39) hide show
  1. package/build/browser.js +1207 -996
  2. package/build/cjs/corpus/admin.js +40 -8
  3. package/build/cjs/corpus/drive.js +29 -0
  4. package/build/cjs/corpus/runner.js +9 -3
  5. package/build/cjs/corpus/runtime.js +24 -0
  6. package/build/cjs/drive/deploymentFile.js +110 -0
  7. package/build/cjs/host/dispatch.js +99 -15
  8. package/build/cjs/identity/records.js +70 -29
  9. package/build/cjs/index.js +8 -3
  10. package/build/cjs/routes/generated.js +12 -2
  11. package/build/cjs/routes/overlay.js +15 -7
  12. package/build/esm/corpus/admin.d.ts +4 -3
  13. package/build/esm/corpus/admin.d.ts.map +1 -1
  14. package/build/esm/corpus/admin.js +40 -8
  15. package/build/esm/corpus/drive.d.ts.map +1 -1
  16. package/build/esm/corpus/drive.js +29 -0
  17. package/build/esm/corpus/runner.d.ts.map +1 -1
  18. package/build/esm/corpus/runner.js +9 -3
  19. package/build/esm/corpus/runtime.d.ts.map +1 -1
  20. package/build/esm/corpus/runtime.js +24 -0
  21. package/build/esm/drive/deploymentFile.d.ts +43 -0
  22. package/build/esm/drive/deploymentFile.d.ts.map +1 -0
  23. package/build/esm/drive/deploymentFile.js +105 -0
  24. package/build/esm/host/dispatch.d.ts +16 -1
  25. package/build/esm/host/dispatch.d.ts.map +1 -1
  26. package/build/esm/host/dispatch.js +99 -15
  27. package/build/esm/identity/records.d.ts +35 -0
  28. package/build/esm/identity/records.d.ts.map +1 -1
  29. package/build/esm/identity/records.js +70 -29
  30. package/build/esm/index.d.ts +2 -0
  31. package/build/esm/index.d.ts.map +1 -1
  32. package/build/esm/index.js +1 -0
  33. package/build/esm/routes/generated.d.ts.map +1 -1
  34. package/build/esm/routes/generated.js +12 -2
  35. package/build/esm/routes/overlay.d.ts.map +1 -1
  36. package/build/esm/routes/overlay.js +15 -7
  37. package/build/esm/types.d.ts +1 -1
  38. package/build/esm/types.d.ts.map +1 -1
  39. package/package.json +3 -2
@@ -744,7 +744,13 @@ exports.GENERATED_ROUTES = [
744
744
  {
745
745
  name: '_filePath',
746
746
  in: 'query',
747
- required: true,
747
+ required: false,
748
+ type: 'string'
749
+ },
750
+ {
751
+ name: '_FILE',
752
+ in: 'query',
753
+ required: false,
748
754
  type: 'string'
749
755
  }
750
756
  ],
@@ -754,9 +760,13 @@ exports.GENERATED_ROUTES = [
754
760
  status: 200,
755
761
  description: 'The contents of the file'
756
762
  },
763
+ {
764
+ status: 202,
765
+ description: 'A streamed file is not there: Parameter Error / File error'
766
+ },
757
767
  {
758
768
  status: 400,
759
- description: "Can't get file outside drive"
769
+ description: 'A path outside the drive, a refused extension, or a request naming neither or both'
760
770
  },
761
771
  {
762
772
  status: 404,
@@ -66,12 +66,11 @@ exports.OVERLAY = {
66
66
  responses: { 200: 'OK!' }
67
67
  },
68
68
  // Admin - the host's own process and files, over the reports it supplies.
69
- // The administrator check is the host's mount point (sasjs/server puts
70
- // authenticateAccessToken and verifyAdmin in front of all three), so its 401
71
- // - and the 500 a genuine failure answers - are host-only statuses.
69
+ // The administrator check is the package's, so its 401 is a case like any
70
+ // other; the 500 a genuine failure answers stays the host's.
72
71
  'GET /SASjsApi/admin/diagnostics': {
73
72
  implemented: true,
74
- hostResponses: [401, 500],
73
+ hostResponses: [500],
75
74
  responses: {
76
75
  200: {
77
76
  build: { version: '', gitHash: '', buildDate: null },
@@ -111,14 +110,14 @@ exports.OVERLAY = {
111
110
  },
112
111
  'GET /SASjsApi/admin/logs': {
113
112
  implemented: true,
114
- hostResponses: [401, 500],
113
+ hostResponses: [500],
115
114
  responses: { 200: { files: [] } }
116
115
  },
117
116
  'GET /SASjsApi/admin/logs/{fileName}': {
118
117
  implemented: true,
119
118
  // 400 and 404 are the name rule's, and this package answers them before the
120
119
  // host is asked for anything
121
- hostResponses: [401, 500],
120
+ hostResponses: [500],
122
121
  responses: {
123
122
  200: {
124
123
  fileName: '',
@@ -197,7 +196,16 @@ exports.OVERLAY = {
197
196
  },
198
197
  // Drive - the file and folder rules, and the three deploy routes
199
198
  // The body is the file itself, so there is nothing to annotate
200
- 'GET /SASjsApi/drive/file': { implemented: true },
199
+ // The `_FILE=` read needs one capability the plain drive read does not: a
200
+ // host that serves a streamed deployment must supply the typed read, and one
201
+ // that does not answers 501 naming it - which is what a capability is for.
202
+ // (No route documents 501; the answer a host gives for a capability it lacks
203
+ // is outside the contract, and this field is where the package says it may
204
+ // happen.)
205
+ 'GET /SASjsApi/drive/file': {
206
+ implemented: true,
207
+ capabilities: ['storage', 'deploymentFile']
208
+ },
201
209
  'POST /SASjsApi/drive/file': {
202
210
  implemented: true,
203
211
  responses: { 200: success, 409: 'File already exists.' }
@@ -14,9 +14,10 @@ export declare const CORPUS_DIAGNOSTICS: DiagnosticsResponse;
14
14
  /**
15
15
  * The admin corpus: one case per documented status of each route.
16
16
  *
17
- * `401` and `500` are host-only (the administrator middleware and the host's own
18
- * failures), so they are not cases; what is pinned is the body, the traversal
19
- * refusal the package owns, and the `404` for a name the folder does not hold.
17
+ * The `401` is the package's now - the same `mayAdminister` the record routes
18
+ * refuse with - so both halves are cases here, with the administrator's `200`
19
+ * between them. The host's own `500` stays out, as it cannot be produced from a
20
+ * fixture.
20
21
  */
21
22
  export declare const ADMIN_CORPUS: CorpusCase[];
22
23
  //# sourceMappingURL=admin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../src/corpus/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,OAAO,EACR,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,WAIxB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAM7B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,mBAiChC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,EAqCpC,CAAA"}
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../src/corpus/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,OAAO,EACR,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,WAIxB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAM7B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,mBAiChC,CAAA;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,EAkEpC,CAAA"}
@@ -52,47 +52,79 @@ export const CORPUS_DIAGNOSTICS = {
52
52
  newestModified: CORPUS_LOG.modified
53
53
  }
54
54
  };
55
+ /** The fixture's administrator, and the account the rules do not admit. */
56
+ const ADMIN = { userId: 'user-admin', clientId: 'web_app' };
57
+ const RESTRICTED = { userId: 'user-restricted', clientId: 'web_app' };
55
58
  /**
56
59
  * The admin corpus: one case per documented status of each route.
57
60
  *
58
- * `401` and `500` are host-only (the administrator middleware and the host's own
59
- * failures), so they are not cases; what is pinned is the body, the traversal
60
- * refusal the package owns, and the `404` for a name the folder does not hold.
61
+ * The `401` is the package's now - the same `mayAdminister` the record routes
62
+ * refuse with - so both halves are cases here, with the administrator's `200`
63
+ * between them. The host's own `500` stays out, as it cannot be produced from a
64
+ * fixture.
61
65
  */
62
66
  export const ADMIN_CORPUS = [
63
67
  {
64
68
  id: 'admin-diagnostics-answers-the-report',
65
69
  route: 'GET /SASjsApi/admin/diagnostics',
66
70
  description: 'answers the host diagnostics report field for field',
67
- request: {},
71
+ request: { subject: ADMIN },
68
72
  expect: { status: 200, body: CORPUS_DIAGNOSTICS }
69
73
  },
70
74
  {
71
75
  id: 'admin-logs-lists-the-files',
72
76
  route: 'GET /SASjsApi/admin/logs',
73
77
  description: 'answers the log files the host holds, newest first',
74
- request: {},
78
+ request: { subject: ADMIN },
75
79
  expect: { status: 200, body: { files: [CORPUS_LOG] } }
76
80
  },
77
81
  {
78
82
  id: 'admin-log-tail-answers-the-tail',
79
83
  route: 'GET /SASjsApi/admin/logs/{fileName}',
80
84
  description: 'answers the tail of a log the folder holds',
81
- request: { params: { fileName: CORPUS_LOG.name } },
85
+ request: { subject: ADMIN, params: { fileName: CORPUS_LOG.name } },
82
86
  expect: { status: 200, body: CORPUS_LOG_TAIL }
83
87
  },
84
88
  {
85
89
  id: 'admin-log-tail-refuses-a-traversal',
86
90
  route: 'GET /SASjsApi/admin/logs/{fileName}',
87
91
  description: 'refuses a name that could resolve outside the log folder, before the host is asked',
88
- request: { params: { fileName: '../20260101000000.log' } },
92
+ request: { subject: ADMIN, params: { fileName: '../20260101000000.log' } },
89
93
  expect: { status: 400, error: 'Invalid log file name.' }
90
94
  },
91
95
  {
92
96
  id: 'admin-log-tail-answers-404',
93
97
  route: 'GET /SASjsApi/admin/logs/{fileName}',
94
98
  description: 'answers 404 for a name the folder does not hold',
95
- request: { params: { fileName: '20250101000000.log' } },
99
+ request: { subject: ADMIN, params: { fileName: '20250101000000.log' } },
96
100
  expect: { status: 404, error: 'Log file not found.' }
101
+ },
102
+ {
103
+ id: 'admin-diagnostics-refused-to-a-restricted-account',
104
+ route: 'GET /SASjsApi/admin/diagnostics',
105
+ description: 'refuses a signed-in account that is not an administrator, in the wording verifyAdmin uses',
106
+ request: { subject: RESTRICTED },
107
+ expect: { status: 401, error: 'Admin account required' }
108
+ },
109
+ {
110
+ id: 'admin-logs-refused-to-a-restricted-account',
111
+ route: 'GET /SASjsApi/admin/logs',
112
+ description: 'refuses the log inventory to a restricted account',
113
+ request: { subject: RESTRICTED },
114
+ expect: { status: 401, error: 'Admin account required' }
115
+ },
116
+ {
117
+ id: 'admin-log-tail-refused-to-a-restricted-account',
118
+ route: 'GET /SASjsApi/admin/logs/{fileName}',
119
+ description: 'refuses a log tail to a restricted account',
120
+ request: { subject: RESTRICTED, params: { fileName: CORPUS_LOG.name } },
121
+ expect: { status: 401, error: 'Admin account required' }
122
+ },
123
+ {
124
+ id: 'admin-logs-refused-with-no-caller',
125
+ route: 'GET /SASjsApi/admin/logs',
126
+ description: 'refuses a request that carries no caller at all',
127
+ request: {},
128
+ expect: { status: 401, error: 'Unauthorized' }
97
129
  }
98
130
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../src/corpus/drive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAA;IACV,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,CAAA;IAC1C,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAA;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACnE,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,WA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eAAO,MAAM,YAAY,EAAE,UAAU,EAqcpC,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { DEPLOYMENT_FILE_ERROR } from '../drive/deploymentFile.js';
1
2
  const success = { status: 'success' };
2
3
  /**
3
4
  * Bytes without an encoding API: the package builds with `lib: ES2020` and no
@@ -130,6 +131,34 @@ export const DRIVE_CORPUS = [
130
131
  request: { query: { _filePath: '/../escape.csv' } },
131
132
  expect: { status: 400, error: "Can't get file outside drive." }
132
133
  },
134
+ {
135
+ id: 'read-file-names-both',
136
+ route: 'GET /SASjsApi/drive/file',
137
+ description: 'refuses a request that names the file twice, in two readings',
138
+ seed: { '/data/keep.csv': 'a' },
139
+ request: {
140
+ query: { _filePath: '/data/keep.csv', _FILE: '/data/keep.csv' }
141
+ },
142
+ expect: {
143
+ status: 400,
144
+ error: 'Exactly one of "_filePath" and "_FILE" may be given.'
145
+ }
146
+ },
147
+ {
148
+ id: 'read-streamed-file',
149
+ route: 'GET /SASjsApi/drive/file',
150
+ description: 'reads a deployment file by the name a streamed page links to',
151
+ seed: { '/Public/app/services/web/main.js': 'console.log(1)' },
152
+ request: { query: { _FILE: '/Public/app/services/web/main.js' } },
153
+ expect: { status: 200, contents: 'console.log(1)' }
154
+ },
155
+ {
156
+ id: 'read-streamed-file-missing',
157
+ route: 'GET /SASjsApi/drive/file',
158
+ description: 'answers a missing deployment file the way the estate does, not as a 404',
159
+ request: { query: { _FILE: '/Public/app/services/web/gone.js' } },
160
+ expect: { status: 202, contents: DEPLOYMENT_FILE_ERROR }
161
+ },
133
162
  {
134
163
  id: 'delete-file',
135
164
  route: 'DELETE /SASjsApi/drive/file',
@@ -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;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,QA4ClD,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;AA0BnD;;;;;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,QAgDlD,CAAA;AA8DD;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,UAAU,UAAU,EACpB,WAAU,QAAgC,KACzC,OAAO,CAAC,UAAU,CAgBpB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { dispatch } from '../host/dispatch.js';
2
2
  import { createDriveService } from '../drive/service.js';
3
+ import { createDeploymentFileService } from '../drive/deploymentFile.js';
3
4
  import { MemoryDriveStore } from '../drive/memory-store.js';
4
5
  import { MemoryAppStreamStore, createAppStreamService } from '../appstream/service.js';
5
6
  import { createIdentityService } from '../identity/service.js';
@@ -52,10 +53,15 @@ export const servicesFor = (testCase) => {
52
53
  ? { [programOf(testCase)]: testCase.runOutput }
53
54
  : undefined
54
55
  });
56
+ // one store, shared by the drive and the streamed-file read: a file the drive
57
+ // writes has to be the file a streamed page can fetch, or the corpus would be
58
+ // asserting two different drives
59
+ const driveStore = testCase.unwritable
60
+ ? new RefusingDriveStore(testCase.seed || {})
61
+ : new MemoryDriveStore(testCase.seed || {});
55
62
  return {
56
- drive: createDriveService(testCase.unwritable
57
- ? new RefusingDriveStore(testCase.seed || {})
58
- : new MemoryDriveStore(testCase.seed || {})),
63
+ drive: createDriveService(driveStore),
64
+ deploymentFile: createDeploymentFileService(driveStore),
59
65
  info: createInfoService(BROWSER_INFO),
60
66
  home: createHomeService(async () => CORPUS_WEB_PAGE),
61
67
  authConfig: createAuthConfigService(CORPUS_AUTH_CONFIG),
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/corpus/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAa5C,eAAO,MAAM,cAAc,EAAE,UAAU,EAyOtC,CAAA"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/corpus/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAgB5C,eAAO,MAAM,cAAc,EAAE,UAAU,EAgQtC,CAAA"}
@@ -1,4 +1,6 @@
1
1
  const ADMIN = { userId: 'user-admin', clientId: 'web_app' };
2
+ /** The fixture's restricted account: granted `stp/execute`, denied `code/execute`. */
3
+ const RESTRICTED = { userId: 'user-restricted', clientId: 'web_app' };
2
4
  const PROGRAM = '/Public/apps/demo/run.sas';
3
5
  const CODE = 'data _null_;\n put "hello";\nrun;';
4
6
  const UNAUTHORIZED = 'Unauthorized';
@@ -192,6 +194,28 @@ export const RUNTIME_CORPUS = [
192
194
  request: { body: {} },
193
195
  expect: { status: 401, error: UNAUTHORIZED }
194
196
  },
197
+ {
198
+ // The fixture denies this account `/SASjsApi/code/execute` with a user rule,
199
+ // and a denied rule refuses the call rather than only the menu entry beside
200
+ // it. On a server that is `authorize`; here it is the decision
201
+ // `myAuthorizedRoutes` reports from, asked of the same store.
202
+ id: 'code-execute-denied-by-a-rule',
203
+ route: 'POST /SASjsApi/code/execute',
204
+ description: 'refuses a caller the rules do not grant, with the 401 a missing token earns',
205
+ request: { subject: RESTRICTED, body: { code: CODE, runTime: 'sas' } },
206
+ expect: { status: 401, error: UNAUTHORIZED }
207
+ },
208
+ {
209
+ // The positive control for the case above: the same account is granted
210
+ // `stp/execute` by a group rule, so the refusal there is the rule and not a
211
+ // blanket refusal of everything a restricted account asks for.
212
+ id: 'stp-execute-granted-by-a-group-rule',
213
+ route: 'POST /SASjsApi/stp/execute',
214
+ description: 'admits a restricted account the rules grant',
215
+ request: { subject: RESTRICTED, body: { _program: PROGRAM } },
216
+ runOutput: { contents: 'granted run' },
217
+ expect: { status: 200, contents: 'granted run' }
218
+ },
195
219
  // ----------------------------------------------- POST /code/trigger
196
220
  {
197
221
  id: 'code-trigger-answers-session',
@@ -0,0 +1,43 @@
1
+ import type { DriveStore } from '../types.js';
2
+ /** What SAS Viya's job execution route answers for a file it cannot read. */
3
+ export declare const DEPLOYMENT_FILE_ERROR = "Parameter Error\nFile error";
4
+ /** The words a request that names the file twice earns. */
5
+ export declare const ONE_NAME_ONLY = "Exactly one of \"_filePath\" and \"_FILE\" may be given.";
6
+ /**
7
+ * Refuses a request that names one file two ways.
8
+ *
9
+ * Both names exist because they answer differently - `_FILE=` is typed and
10
+ * answers a missing file the way the estate does, `_filePath=` is bytes - so a
11
+ * request carrying both is a caller disagreeing with itself. Resolving it would
12
+ * mean picking an answer nobody asked for, and picking the same way in every
13
+ * host. The rule lives here, with the message, so a host that answers the read
14
+ * through its own route (sasjs/server does) refuses it identically instead of
15
+ * re-deciding.
16
+ */
17
+ export declare const assertOneFileName: (query: {
18
+ _filePath?: unknown;
19
+ _FILE?: unknown;
20
+ }) => void;
21
+ /**
22
+ * One file, typed and ready to send.
23
+ *
24
+ * `body` is the file's bytes when there is a file, and the refusal's words when
25
+ * there is not - a host sends whichever it got, with the status and type stated
26
+ * here, so neither can quietly become the other.
27
+ */
28
+ export interface DeploymentFilePage {
29
+ status: number;
30
+ contentType: string;
31
+ /** Headers the host must set, chiefly the cache policy of an app's asset. */
32
+ headers?: Record<string, string>;
33
+ body?: string | Uint8Array;
34
+ }
35
+ export interface DeploymentFileService {
36
+ /**
37
+ * Reads one file for a streamed deployment. Refuses a path outside the drive
38
+ * or one carrying a blocked extension with the drive's own `400`.
39
+ */
40
+ read(filePath: unknown): Promise<DeploymentFilePage>;
41
+ }
42
+ export declare const createDeploymentFileService: (store: DriveStore) => DeploymentFileService;
43
+ //# sourceMappingURL=deploymentFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploymentFile.d.ts","sourceRoot":"","sources":["../../../src/drive/deploymentFile.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI7C,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,gCAAgC,CAAA;AAElE,2DAA2D;AAC3D,eAAO,MAAM,aAAa,6DAC8B,CAAA;AAExD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO;IACvC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,KAAG,IAGH,CAAA;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;CACrD;AAuBD,eAAO,MAAM,2BAA2B,GACtC,OAAO,UAAU,KAChB,qBAuCD,CAAA"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * The read a streamed deployment links to: one file out of the drive, by path.
3
+ *
4
+ * A build made with `streamWeb` rewrites every asset link in the entry page to
5
+ * name the file it fetches - `?path=/Public/app/services/web/main.4f3a9c1d.js`,
6
+ * the `_FILE=` spelling the estate answers - so the host has to read one file
7
+ * back and hand it to a browser as itself. Serve it as bytes and the page
8
+ * renders nothing: the difference between a working app and a blank one is the
9
+ * Content-Type.
10
+ *
11
+ * So the typing, the caching and the refusal live here rather than in each
12
+ * host, the same way the drive's own rules do. Every platform has one web tier
13
+ * a browser fetches a program or a file from - `/SASStoredProcess` on SAS 9,
14
+ * `/SASJobExecution` on Viya, `/StoredProgram` on SASjs server - and each of
15
+ * those spellings is meant to resolve to this read.
16
+ *
17
+ * Conditional, because the hosts are what adopt it: the browser build already
18
+ * answers two of them (a mock site holds the drive), while sasjs/server answers
19
+ * `/StoredProgram` and `/SASJobExecution` by handing the request to `GET
20
+ * /SASjsApi/drive/file?_FILE=` only once sasjs/server#736 merges. Until then a
21
+ * consumer's own default branch has no such route, and a sentence here that
22
+ * forgot it would send a reader looking for one.
23
+ *
24
+ * A file that is not there answers the way the estate answers - `202` with a
25
+ * two-line message, not a `404`. A streamed app whose asset is missing has to
26
+ * fail the same way in both places, or a fault reproduced locally is a
27
+ * different fault from the one being chased.
28
+ */
29
+ import { ApiError, isApiError } from '../types.js';
30
+ import { cacheControlFor, contentTypeFor } from '../appstream/web.js';
31
+ import { checkFilePath, isRoot } from './paths.js';
32
+ /** What SAS Viya's job execution route answers for a file it cannot read. */
33
+ export const DEPLOYMENT_FILE_ERROR = 'Parameter Error\nFile error';
34
+ /** The words a request that names the file twice earns. */
35
+ export const ONE_NAME_ONLY = 'Exactly one of "_filePath" and "_FILE" may be given.';
36
+ /**
37
+ * Refuses a request that names one file two ways.
38
+ *
39
+ * Both names exist because they answer differently - `_FILE=` is typed and
40
+ * answers a missing file the way the estate does, `_filePath=` is bytes - so a
41
+ * request carrying both is a caller disagreeing with itself. Resolving it would
42
+ * mean picking an answer nobody asked for, and picking the same way in every
43
+ * host. The rule lives here, with the message, so a host that answers the read
44
+ * through its own route (sasjs/server does) refuses it identically instead of
45
+ * re-deciding.
46
+ */
47
+ export const assertOneFileName = (query) => {
48
+ if (query._filePath !== undefined && query._FILE !== undefined)
49
+ throw new ApiError(400, ONE_NAME_ONLY);
50
+ };
51
+ /**
52
+ * Whether a store refused because there is nothing at the path.
53
+ *
54
+ * Two spellings reach this code and both mean the same thing: the package's
55
+ * stores throw `ApiError(404, "File doesn't exist.")`, and a host's store over a
56
+ * filesystem (sasjs/server's) lets `fs` throw `ENOENT`. Anything else - a
57
+ * permission failure, a broken link - is a real error and travels on.
58
+ */
59
+ const notFound = (error) => (isApiError(error) && error.status === 404) ||
60
+ // a structural read, not `NodeJS.ErrnoException`: this module is in the
61
+ // browser build, which has no node types at all
62
+ error?.code === 'ENOENT';
63
+ /** The answer for a file that is not there, in the estate's words. */
64
+ const notThere = () => ({
65
+ status: 202,
66
+ contentType: 'text/plain; charset=utf-8',
67
+ body: DEPLOYMENT_FILE_ERROR
68
+ });
69
+ export const createDeploymentFileService = (store) => ({
70
+ async read(input) {
71
+ // the drive's containment and extension rules decide first: a streamed page
72
+ // is caller-supplied content, and this read must not be a way round them
73
+ const checked = checkFilePath(input);
74
+ if ('reason' in checked)
75
+ throw checked.reason === 'extension'
76
+ ? new ApiError(400, 'Invalid file extension')
77
+ : new ApiError(400, `Can't get file outside drive.`);
78
+ if (isRoot(checked.path))
79
+ throw new ApiError(400, `Can't get file outside drive.`);
80
+ const path = checked.path;
81
+ // The stat and the read are one attempt, not a check followed by an action:
82
+ // a file can be removed or replaced between them, and the fault this route
83
+ // exists to reproduce is a missing asset - which has to answer `202` in the
84
+ // estate's words, not whatever the store threw at that instant. A folder is
85
+ // refused the same way: there is no file to send.
86
+ try {
87
+ if ((await store.stat(path)).directory)
88
+ return notThere();
89
+ return {
90
+ status: 200,
91
+ contentType: contentTypeFor(path),
92
+ // lower case, matching the app stream's own answer (src/appstream/web.ts):
93
+ // the names are case-insensitive in HTTP but not in a plain object, and a
94
+ // host copying one into the other would lose a policy that mattered
95
+ headers: { 'cache-control': cacheControlFor(path) },
96
+ body: await store.read(path)
97
+ };
98
+ }
99
+ catch (error) {
100
+ if (notFound(error))
101
+ return notThere();
102
+ throw error;
103
+ }
104
+ }
105
+ });
@@ -5,6 +5,7 @@ import type { SessionService } from '../session/service.js';
5
5
  import type { ViyaSeedSettings } from '../viya/seed.js';
6
6
  import type { RuntimeService } from '../runtime/service.js';
7
7
  import type { AppStreamService } from '../appstream/service.js';
8
+ import type { DeploymentFileService } from '../drive/deploymentFile.js';
8
9
  import type { CodeService } from '../code/service.js';
9
10
  import type { InfoService } from '../info/service.js';
10
11
  import type { AuthConfigService } from '../authconfig/service.js';
@@ -49,8 +50,16 @@ export interface ApiResponse {
49
50
  status: number;
50
51
  /** A JSON body. */
51
52
  body?: unknown;
52
- /** A raw body, for the one route that answers with the file itself. */
53
+ /** A raw body, for the routes that answer with a file rather than JSON. */
53
54
  contents?: string | Uint8Array;
55
+ /**
56
+ * The type of `contents`, for the reads that serve a browser: a streamed
57
+ * deployment's asset is a page, a script or a stylesheet, and a host that
58
+ * guesses the type sends the wrong one.
59
+ */
60
+ contentType?: string;
61
+ /** Headers the host must set with the answer - chiefly an asset's caching. */
62
+ headers?: Record<string, string>;
54
63
  }
55
64
  export interface Services {
56
65
  /** The editor routes, where the host supplies a linter. */
@@ -115,6 +124,12 @@ export interface Services {
115
124
  * an app is, but only a host can store one.
116
125
  */
117
126
  appStream?: AppStreamService;
127
+ /**
128
+ * One file out of the drive, typed for a browser - the read a streamed
129
+ * deployment links to. Absent, a `_FILE=` read answers 501: the rules are the
130
+ * package's, but the bytes are a store's, and only the host has one.
131
+ */
132
+ deploymentFile?: DeploymentFileService;
118
133
  }
119
134
  export declare const dispatch: (services: Services, routeId: string, request?: ApiRequest) => Promise<ApiResponse>;
120
135
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/host/dispatch.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAQ/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,E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