@sasjs/adapter 4.19.4 → 5.1.1

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 (418) hide show
  1. package/ContextManager.js +290 -0
  2. package/DISCLOSURE +45 -0
  3. package/README.md +1 -1
  4. package/SAS9ApiClient.d.ts +1 -1
  5. package/SAS9ApiClient.js +90 -0
  6. package/SASViyaApiClient.js +918 -0
  7. package/SASjs.js +794 -0
  8. package/SASjsApiClient.d.ts +1 -0
  9. package/SASjsApiClient.js +132 -0
  10. package/SessionManager.js +353 -0
  11. package/api/viya/executeOnComputeApi.js +198 -0
  12. package/api/viya/getFileStream.js +32 -0
  13. package/api/viya/pollJobState.js +247 -0
  14. package/api/viya/saveLog.js +45 -0
  15. package/api/viya/uploadTables.js +45 -0
  16. package/api/viya/writeStream.js +25 -0
  17. package/auth/AuthManager.js +305 -0
  18. package/auth/getAccessTokenForSasjs.js +43 -0
  19. package/auth/getAccessTokenForViya.js +54 -0
  20. package/auth/getTokenRequestErrorPrefix.js +70 -0
  21. package/auth/getTokens.js +110 -0
  22. package/auth/index.js +20 -0
  23. package/auth/isAuthorizeFormRequired.js +7 -0
  24. package/auth/isLoginRequired.js +9 -0
  25. package/auth/loginHeader.js +87 -0
  26. package/auth/openWebPage.js +31 -0
  27. package/auth/refreshTokensForSasjs.js +42 -0
  28. package/auth/refreshTokensForViya.js +53 -0
  29. package/auth/verifySas9Login.js +32 -0
  30. package/auth/verifySasViyaLogin.js +44 -0
  31. package/dist/minified_sas9.js +10892 -0
  32. package/dist/sasjs-adapter.js +19569 -0
  33. package/file/generateFileUploadForm.js +43 -0
  34. package/file/generateTableUploadForm.js +38 -0
  35. package/index.js +9 -80376
  36. package/job-execution/ComputeJobExecutor.js +55 -0
  37. package/job-execution/FileUploader.js +114 -0
  38. package/job-execution/JesJobExecutor.js +55 -0
  39. package/job-execution/JobExecutor.js +40 -0
  40. package/job-execution/Sas9JobExecutor.d.ts +1 -1
  41. package/job-execution/Sas9JobExecutor.js +115 -0
  42. package/job-execution/SasjsJobExecutor.js +100 -0
  43. package/job-execution/WebJobExecutor.js +254 -0
  44. package/job-execution/index.js +23 -0
  45. package/minified/sas9/SASjs.js +198 -0
  46. package/minified/sas9/WebJobExecutor.js +105 -0
  47. package/minified/sas9/index.js +22 -0
  48. package/node/index.d.ts +2 -9
  49. package/node/index.js +1 -30570
  50. package/package.json +41 -15
  51. package/request/RequestClient.d.ts +1 -1
  52. package/request/RequestClient.js +717 -0
  53. package/request/Sas9RequestClient.d.ts +1 -1
  54. package/request/Sas9RequestClient.js +121 -0
  55. package/request/SasjsRequestClient.js +77 -0
  56. package/types/Context.js +2 -0
  57. package/types/CsrfToken.js +2 -0
  58. package/types/ExecuteScript.js +2 -0
  59. package/types/File.js +2 -0
  60. package/types/FileResource.js +2 -0
  61. package/types/Folder.js +2 -0
  62. package/types/Job.js +2 -0
  63. package/types/JobDefinition.js +2 -0
  64. package/types/JobResult.js +2 -0
  65. package/types/Link.js +2 -0
  66. package/types/LogStatistics.js +2 -0
  67. package/types/Login.js +2 -0
  68. package/types/PollOptions.js +2 -0
  69. package/types/RequestClient.js +2 -0
  70. package/types/SASjsConfig.d.ts +1 -1
  71. package/types/SASjsConfig.js +91 -0
  72. package/types/Session.js +14 -0
  73. package/types/Tables.js +28 -0
  74. package/types/UploadFile.js +2 -0
  75. package/types/WriteStream.d.ts +1 -1
  76. package/types/WriteStream.js +2 -0
  77. package/types/errors/ArgumentError.js +12 -0
  78. package/types/errors/AuthorizeError.js +13 -0
  79. package/types/errors/CertificateError.js +12 -0
  80. package/types/errors/ComputeJobExecutionError.js +13 -0
  81. package/types/errors/ErrorResponse.js +23 -0
  82. package/types/errors/InternalServerError.js +11 -0
  83. package/types/errors/InvalidJsonError.js +11 -0
  84. package/types/errors/InvalidSASjsCsrfError.js +12 -0
  85. package/types/errors/JobExecutionError.js +14 -0
  86. package/types/errors/JobStatePollError.js +12 -0
  87. package/types/errors/JsonParseArrayError.js +11 -0
  88. package/types/errors/LoginRequiredError.js +14 -0
  89. package/types/errors/NoSessionStateError.js +14 -0
  90. package/types/errors/NotFoundError.js +12 -0
  91. package/types/errors/RootFolderNotFoundError.js +22 -0
  92. package/types/errors/SAS9AuthError.js +11 -0
  93. package/types/errors/WeboutResponseError.js +12 -0
  94. package/types/errors/index.js +31 -0
  95. package/types/index.js +34 -0
  96. package/utils/appendExtraResponseAttributes.js +25 -0
  97. package/utils/asyncForEach.js +20 -0
  98. package/utils/compareTimestamps.js +11 -0
  99. package/utils/convertToCsv.js +154 -0
  100. package/utils/createAxiosInstance.d.ts +1 -1
  101. package/utils/createAxiosInstance.js +9 -0
  102. package/utils/delay.js +5 -0
  103. package/{src/utils/extractWeboutBlob.ts → utils/extractWeboutBlob.js} +19 -20
  104. package/utils/fetchLogByChunks.js +56 -0
  105. package/utils/formatDataForRequest.js +39 -0
  106. package/utils/getFormData.js +10 -0
  107. package/{node/utils/getUserLanguage.d.ts → utils/getUserLanguage.js} +5 -1
  108. package/utils/getValidJson.js +27 -0
  109. package/utils/host.d.ts +24 -0
  110. package/utils/host.js +36 -0
  111. package/utils/index.js +41 -0
  112. package/utils/isIeOrEdge.js +30 -0
  113. package/utils/isNode.js +7 -0
  114. package/utils/isRelativePath.js +5 -0
  115. package/utils/isUri.js +9 -0
  116. package/utils/isUrl.js +20 -0
  117. package/utils/loginPrompt/index.js +180 -0
  118. package/utils/needsRetry.js +14 -0
  119. package/utils/parseGeneratedCode.js +10 -0
  120. package/utils/parseSasViyaLog.js +17 -0
  121. package/utils/parseSourceCode.js +9 -0
  122. package/utils/parseViyaDebugResponse.js +46 -0
  123. package/utils/parseViyaLogDebugResponse.js +32 -0
  124. package/utils/parseWeboutResponse.js +22 -0
  125. package/utils/sas9/extractUserLongNameSas9.js +30 -0
  126. package/utils/serialize.js +20 -0
  127. package/utils/splitChunks.js +13 -0
  128. package/utils/validateInput.js +83 -0
  129. package/.env.example +0 -2
  130. package/.git-hooks/commit-msg +0 -39
  131. package/.git-hooks/pre-commit +0 -12
  132. package/.gitattributes +0 -1
  133. package/.pre-commit-config.yaml +0 -25
  134. package/.vscode/settings.json +0 -3
  135. package/SASViyaApiClient.spec.d.ts +0 -1
  136. package/__mocks__/axios.d.ts +0 -3
  137. package/api/viya/spec/executeScript.spec.d.ts +0 -1
  138. package/api/viya/spec/getFileStream.spec.d.ts +0 -1
  139. package/api/viya/spec/mockResponses.d.ts +0 -10
  140. package/api/viya/spec/pollJobState.spec.d.ts +0 -1
  141. package/api/viya/spec/saveLog.spec.d.ts +0 -1
  142. package/api/viya/spec/uploadTables.spec.d.ts +0 -1
  143. package/api/viya/spec/writeStream.spec.d.ts +0 -1
  144. package/auth/spec/AuthManager.spec.d.ts +0 -4
  145. package/auth/spec/getAccessTokenForSasjs.spec.d.ts +0 -1
  146. package/auth/spec/getAccessTokenForViya.spec.d.ts +0 -1
  147. package/auth/spec/getTokenRequestErrorPrefix.spec.d.ts +0 -1
  148. package/auth/spec/getTokens.spec.d.ts +0 -1
  149. package/auth/spec/loginHeader.spec.d.ts +0 -4
  150. package/auth/spec/mockResponses.d.ts +0 -23
  151. package/auth/spec/openWebPage.spec.d.ts +0 -1
  152. package/auth/spec/refreshTokensForSasjs.spec.d.ts +0 -1
  153. package/auth/spec/refreshTokensForViya.spec.d.ts +0 -1
  154. package/auth/spec/verifySas9Login.spec.d.ts +0 -1
  155. package/auth/spec/verifySasViyaLogin.spec.d.ts +0 -1
  156. package/createTSDocs.js +0 -35
  157. package/cypress.config.js +0 -18
  158. package/example.html +0 -109
  159. package/file/spec/generateFileUploadForm.spec.d.ts +0 -1
  160. package/file/spec/generateTableUploadForm.spec.d.ts +0 -1
  161. package/index-dev.js +0 -80394
  162. package/job-execution/spec/ComputeJobExecutor.spec.d.ts +0 -1
  163. package/job-execution/spec/JesJobExecutor.spec.d.ts +0 -1
  164. package/job-execution/spec/Sas9JobExecutor.spec.d.ts +0 -1
  165. package/job-execution/spec/SasjsJobExecutor.spec.d.ts +0 -1
  166. package/job-execution/spec/WebJobExecutor.debug.spec.d.ts +0 -1
  167. package/job-execution/spec/WebJobExecutor.spec.d.ts +0 -1
  168. package/job-execution/spec/executionTasks.spec.d.ts +0 -1
  169. package/minified_sas9.js +0 -14039
  170. package/node/ContextManager.d.ts +0 -41
  171. package/node/SAS9ApiClient.d.ts +0 -30
  172. package/node/SASViyaApiClient.d.ts +0 -298
  173. package/node/SASjs.d.ts +0 -387
  174. package/node/SASjsApiClient.d.ts +0 -65
  175. package/node/SessionManager.d.ts +0 -115
  176. package/node/api/viya/executeOnComputeApi.d.ts +0 -21
  177. package/node/api/viya/getFileStream.d.ts +0 -2
  178. package/node/api/viya/pollJobState.d.ts +0 -57
  179. package/node/api/viya/saveLog.d.ts +0 -15
  180. package/node/api/viya/uploadTables.d.ts +0 -13
  181. package/node/api/viya/writeStream.d.ts +0 -2
  182. package/node/auth/AuthManager.d.ts +0 -49
  183. package/node/auth/getAccessTokenForSasjs.d.ts +0 -11
  184. package/node/auth/getAccessTokenForViya.d.ts +0 -10
  185. package/node/auth/getTokenRequestErrorPrefix.d.ts +0 -44
  186. package/node/auth/getTokens.d.ts +0 -22
  187. package/node/auth/index.d.ts +0 -4
  188. package/node/auth/isAuthorizeFormRequired.d.ts +0 -1
  189. package/node/auth/isLoginRequired.d.ts +0 -1
  190. package/node/auth/loginHeader.d.ts +0 -17
  191. package/node/auth/openWebPage.d.ts +0 -6
  192. package/node/auth/refreshTokensForSasjs.d.ts +0 -10
  193. package/node/auth/refreshTokensForViya.d.ts +0 -11
  194. package/node/auth/verifySas9Login.d.ts +0 -3
  195. package/node/auth/verifySasViyaLogin.d.ts +0 -4
  196. package/node/file/generateFileUploadForm.d.ts +0 -11
  197. package/node/file/generateTableUploadForm.d.ts +0 -5
  198. package/node/job-execution/ComputeJobExecutor.d.ts +0 -8
  199. package/node/job-execution/FileUploader.d.ts +0 -9
  200. package/node/job-execution/JesJobExecutor.d.ts +0 -9
  201. package/node/job-execution/JobExecutor.d.ts +0 -17
  202. package/node/job-execution/Sas9JobExecutor.d.ts +0 -19
  203. package/node/job-execution/SasjsJobExecutor.d.ts +0 -9
  204. package/node/job-execution/WebJobExecutor.d.ts +0 -18
  205. package/node/job-execution/index.d.ts +0 -7
  206. package/node/request/RequestClient.d.ts +0 -125
  207. package/node/request/Sas9RequestClient.d.ts +0 -25
  208. package/node/request/SasjsRequestClient.d.ts +0 -12
  209. package/node/types/Context.d.ts +0 -42
  210. package/node/types/CsrfToken.d.ts +0 -4
  211. package/node/types/ExecuteScript.d.ts +0 -4
  212. package/node/types/File.d.ts +0 -7
  213. package/node/types/FileResource.d.ts +0 -32
  214. package/node/types/Folder.d.ts +0 -7
  215. package/node/types/Job.d.ts +0 -14
  216. package/node/types/JobDefinition.d.ts +0 -3
  217. package/node/types/JobResult.d.ts +0 -3
  218. package/node/types/Link.d.ts +0 -7
  219. package/node/types/LogStatistics.d.ts +0 -4
  220. package/node/types/Login.d.ts +0 -14
  221. package/node/types/PollOptions.d.ts +0 -8
  222. package/node/types/RequestClient.d.ts +0 -46
  223. package/node/types/SASjsConfig.d.ts +0 -94
  224. package/node/types/Session.d.ts +0 -30
  225. package/node/types/Tables.d.ts +0 -7
  226. package/node/types/UploadFile.d.ts +0 -8
  227. package/node/types/WriteStream.d.ts +0 -7
  228. package/node/types/errors/ArgumentError.d.ts +0 -4
  229. package/node/types/errors/AuthorizeError.d.ts +0 -5
  230. package/node/types/errors/CertificateError.d.ts +0 -3
  231. package/node/types/errors/ComputeJobExecutionError.d.ts +0 -6
  232. package/node/types/errors/ErrorResponse.d.ts +0 -9
  233. package/node/types/errors/InternalServerError.d.ts +0 -3
  234. package/node/types/errors/InvalidJsonError.d.ts +0 -3
  235. package/node/types/errors/InvalidSASjsCsrfError.d.ts +0 -3
  236. package/node/types/errors/JobExecutionError.d.ts +0 -6
  237. package/node/types/errors/JobStatePollError.d.ts +0 -4
  238. package/node/types/errors/JsonParseArrayError.d.ts +0 -3
  239. package/node/types/errors/LoginRequiredError.d.ts +0 -3
  240. package/node/types/errors/NoSessionStateError.d.ts +0 -6
  241. package/node/types/errors/NotFoundError.d.ts +0 -4
  242. package/node/types/errors/RootFolderNotFoundError.d.ts +0 -3
  243. package/node/types/errors/SAS9AuthError.d.ts +0 -3
  244. package/node/types/errors/WeboutResponseError.d.ts +0 -4
  245. package/node/types/errors/index.d.ts +0 -15
  246. package/node/types/index.d.ts +0 -18
  247. package/node/utils/appendExtraResponseAttributes.d.ts +0 -2
  248. package/node/utils/asyncForEach.d.ts +0 -1
  249. package/node/utils/compareTimestamps.d.ts +0 -6
  250. package/node/utils/convertToCsv.d.ts +0 -12
  251. package/node/utils/createAxiosInstance.d.ts +0 -2
  252. package/node/utils/delay.d.ts +0 -1
  253. package/node/utils/extractWeboutBlob.d.ts +0 -13
  254. package/node/utils/fetchLogByChunks.d.ts +0 -20
  255. package/node/utils/formatDataForRequest.d.ts +0 -1
  256. package/node/utils/getFormData.d.ts +0 -2
  257. package/node/utils/getValidJson.d.ts +0 -5
  258. package/node/utils/index.d.ts +0 -25
  259. package/node/utils/isNode.d.ts +0 -1
  260. package/node/utils/isRelativePath.d.ts +0 -1
  261. package/node/utils/isUri.d.ts +0 -5
  262. package/node/utils/isUrl.d.ts +0 -5
  263. package/node/utils/loginPrompt/index.d.ts +0 -1
  264. package/node/utils/needsRetry.d.ts +0 -1
  265. package/node/utils/parseGeneratedCode.d.ts +0 -1
  266. package/node/utils/parseSasViyaLog.d.ts +0 -5
  267. package/node/utils/parseSourceCode.d.ts +0 -1
  268. package/node/utils/parseViyaDebugResponse.d.ts +0 -12
  269. package/node/utils/parseViyaLogDebugResponse.d.ts +0 -8
  270. package/node/utils/parseWeboutResponse.d.ts +0 -1
  271. package/node/utils/sas9/extractUserLongNameSas9.d.ts +0 -6
  272. package/node/utils/serialize.d.ts +0 -1
  273. package/node/utils/splitChunks.d.ts +0 -1
  274. package/node/utils/validateInput.d.ts +0 -14
  275. package/request/spec/SasjsRequestClient.spec.d.ts +0 -1
  276. package/screenshots/session-manager-first-request.png +0 -0
  277. package/screenshots/subsequent-session-request.png +0 -0
  278. package/spec/SAS9ApiClient.spec.d.ts +0 -1
  279. package/spec/SASjs.startComputeJob.spec.d.ts +0 -1
  280. package/spec/SASjsApiClient.spec.d.ts +0 -1
  281. package/src/ContextManager.ts +0 -454
  282. package/src/SAS9ApiClient.ts +0 -100
  283. package/src/SASViyaApiClient.ts +0 -1417
  284. package/src/SASjs.ts +0 -1268
  285. package/src/SASjsApiClient.ts +0 -177
  286. package/src/SessionManager.ts +0 -465
  287. package/src/__mocks__/axios.ts +0 -7
  288. package/src/api/viya/executeOnComputeApi.ts +0 -307
  289. package/src/api/viya/getFileStream.ts +0 -17
  290. package/src/api/viya/pollJobState.ts +0 -393
  291. package/src/api/viya/saveLog.ts +0 -55
  292. package/src/api/viya/spec/mockResponses.ts +0 -75
  293. package/src/api/viya/uploadTables.ts +0 -41
  294. package/src/api/viya/writeStream.ts +0 -16
  295. package/src/auth/AuthManager.ts +0 -387
  296. package/src/auth/getAccessTokenForSasjs.ts +0 -48
  297. package/src/auth/getAccessTokenForViya.ts +0 -61
  298. package/src/auth/getTokenRequestErrorPrefix.ts +0 -88
  299. package/src/auth/getTokens.ts +0 -127
  300. package/src/auth/index.ts +0 -4
  301. package/src/auth/isAuthorizeFormRequired.ts +0 -3
  302. package/src/auth/isLoginRequired.ts +0 -5
  303. package/src/auth/loginHeader.ts +0 -97
  304. package/src/auth/openWebPage.ts +0 -40
  305. package/src/auth/refreshTokensForSasjs.ts +0 -45
  306. package/src/auth/refreshTokensForViya.ts +0 -66
  307. package/src/auth/spec/mockResponses.ts +0 -53
  308. package/src/auth/verifySas9Login.ts +0 -25
  309. package/src/auth/verifySasViyaLogin.ts +0 -43
  310. package/src/file/generateFileUploadForm.ts +0 -48
  311. package/src/file/generateTableUploadForm.ts +0 -50
  312. package/src/index.ts +0 -9
  313. package/src/job-execution/ComputeJobExecutor.ts +0 -76
  314. package/src/job-execution/FileUploader.ts +0 -152
  315. package/src/job-execution/JesJobExecutor.ts +0 -78
  316. package/src/job-execution/JobExecutor.ts +0 -63
  317. package/src/job-execution/Sas9JobExecutor.ts +0 -137
  318. package/src/job-execution/SasjsJobExecutor.ts +0 -152
  319. package/src/job-execution/WebJobExecutor.ts +0 -341
  320. package/src/job-execution/index.ts +0 -7
  321. package/src/minified/sas9/SASjs.ts +0 -274
  322. package/src/minified/sas9/WebJobExecutor.ts +0 -156
  323. package/src/minified/sas9/index.ts +0 -3
  324. package/src/request/RequestClient.ts +0 -941
  325. package/src/request/Sas9RequestClient.ts +0 -132
  326. package/src/request/SasjsRequestClient.ts +0 -82
  327. package/src/test/SAS_server_app.ts +0 -47
  328. package/src/types/Context.ts +0 -39
  329. package/src/types/CsrfToken.ts +0 -4
  330. package/src/types/ExecuteScript.ts +0 -4
  331. package/src/types/File.ts +0 -8
  332. package/src/types/FileResource.ts +0 -33
  333. package/src/types/Folder.ts +0 -8
  334. package/src/types/Job.ts +0 -15
  335. package/src/types/JobDefinition.ts +0 -3
  336. package/src/types/JobResult.ts +0 -3
  337. package/src/types/Link.ts +0 -7
  338. package/src/types/LogStatistics.ts +0 -4
  339. package/src/types/Login.ts +0 -15
  340. package/src/types/PollOptions.ts +0 -9
  341. package/src/types/Process.d.ts +0 -5
  342. package/src/types/RequestClient.ts +0 -55
  343. package/src/types/SASjsConfig.ts +0 -95
  344. package/src/types/Session.ts +0 -34
  345. package/src/types/Tables.ts +0 -29
  346. package/src/types/UploadFile.ts +0 -8
  347. package/src/types/WriteStream.ts +0 -10
  348. package/src/types/errors/ArgumentError.ts +0 -7
  349. package/src/types/errors/AuthorizeError.ts +0 -10
  350. package/src/types/errors/CertificateError.ts +0 -12
  351. package/src/types/errors/ComputeJobExecutionError.ts +0 -12
  352. package/src/types/errors/ErrorResponse.ts +0 -28
  353. package/src/types/errors/InternalServerError.ts +0 -9
  354. package/src/types/errors/InvalidJsonError.ts +0 -7
  355. package/src/types/errors/InvalidSASjsCsrfError.ts +0 -9
  356. package/src/types/errors/JobExecutionError.ts +0 -11
  357. package/src/types/errors/JobStatePollError.ts +0 -14
  358. package/src/types/errors/JsonParseArrayError.ts +0 -7
  359. package/src/types/errors/LoginRequiredError.ts +0 -11
  360. package/src/types/errors/NoSessionStateError.ts +0 -15
  361. package/src/types/errors/NotFoundError.ts +0 -7
  362. package/src/types/errors/RootFolderNotFoundError.ts +0 -24
  363. package/src/types/errors/SAS9AuthError.ts +0 -9
  364. package/src/types/errors/WeboutResponseError.ts +0 -7
  365. package/src/types/errors/index.ts +0 -15
  366. package/src/types/index.ts +0 -18
  367. package/src/types/system/global.d.ts +0 -1
  368. package/src/utils/appendExtraResponseAttributes.ts +0 -22
  369. package/src/utils/asyncForEach.ts +0 -5
  370. package/src/utils/compareTimestamps.ts +0 -9
  371. package/src/utils/convertToCsv.ts +0 -198
  372. package/src/utils/createAxiosInstance.ts +0 -7
  373. package/src/utils/delay.ts +0 -2
  374. package/src/utils/fetchLogByChunks.ts +0 -63
  375. package/src/utils/formatDataForRequest.ts +0 -48
  376. package/src/utils/getFormData.ts +0 -5
  377. package/src/utils/getUserLanguage.ts +0 -10
  378. package/src/utils/getValidJson.ts +0 -23
  379. package/src/utils/index.ts +0 -25
  380. package/src/utils/isIeOrEdge.ts +0 -34
  381. package/src/utils/isNode.ts +0 -4
  382. package/src/utils/isRelativePath.ts +0 -2
  383. package/src/utils/isUri.ts +0 -5
  384. package/src/utils/isUrl.ts +0 -17
  385. package/src/utils/loginPrompt/index.ts +0 -177
  386. package/src/utils/needsRetry.ts +0 -14
  387. package/src/utils/parseGeneratedCode.ts +0 -7
  388. package/src/utils/parseSasViyaLog.ts +0 -12
  389. package/src/utils/parseSourceCode.ts +0 -6
  390. package/src/utils/parseViyaDebugResponse.ts +0 -46
  391. package/src/utils/parseViyaLogDebugResponse.ts +0 -22
  392. package/src/utils/parseWeboutResponse.ts +0 -20
  393. package/src/utils/sas9/extractUserLongNameSas9.ts +0 -31
  394. package/src/utils/serialize.ts +0 -15
  395. package/src/utils/splitChunks.ts +0 -12
  396. package/src/utils/validateInput.ts +0 -93
  397. package/test/ContextManager.spec.d.ts +0 -1
  398. package/test/FileUploader.spec.d.ts +0 -4
  399. package/test/FolderOperations.spec.d.ts +0 -1
  400. package/test/RequestClient.spec.d.ts +0 -1
  401. package/test/SAS_server_app.d.ts +0 -10
  402. package/test/SessionManager.spec.d.ts +0 -1
  403. package/test/getJobsInFolder.spec.d.ts +0 -1
  404. package/test/utils/formatDataForRequest.spec.d.ts +0 -1
  405. package/test/utils/getValidJson.spec.d.ts +0 -1
  406. package/test/utils/isUrl.spec.d.ts +0 -1
  407. package/test/utils/parseGeneratedCode.spec.d.ts +0 -1
  408. package/test/utils/parseSourceCode.spec.d.ts +0 -1
  409. package/types/Tables.spec.d.ts +0 -1
  410. package/types/errors/RootFolderNotFoundError.spec.d.ts +0 -1
  411. package/types/errors/spec/SAS9AuthError.spec.d.ts +0 -1
  412. package/utils/spec/convertToCsv.spec.d.ts +0 -1
  413. package/utils/spec/extractUserLongNameSas9.spec.d.ts +0 -1
  414. package/utils/spec/getFormData.spec.d.ts +0 -1
  415. package/utils/spec/parseSasViyaLog.spec.d.ts +0 -1
  416. package/utils/spec/parseViyaDebugResponse.spec.d.ts +0 -1
  417. package/utils/spec/parseViyaLogDebugResponse.spec.d.ts +0 -1
  418. package/utils/spec/validateInput.spec.d.ts +0 -1
@@ -1,15 +0,0 @@
1
- import { Job } from '../..';
2
- import { RequestClient } from '../../request/RequestClient';
3
- import { WriteStream } from '../../types';
4
- /**
5
- * Appends logs to a supplied write stream.
6
- * This is useful for getting quick feedback on longer running jobs.
7
- * @param job - the job to fetch logs for
8
- * @param requestClient - the pre-configured HTTP request client
9
- * @param startLine - the line at which to start fetching the log
10
- * @param endLine - the line at which to stop fetching the log
11
- * @param logFileStream - the write stream to which the log is appended
12
- * @accessToken - an optional access token for authentication/authorization
13
- * The access token is not required when fetching logs from the browser.
14
- */
15
- export declare function saveLog(job: Job, requestClient: RequestClient, startLine: number, endLine: number, logFileStream?: WriteStream, accessToken?: string): Promise<void>;
@@ -1,13 +0,0 @@
1
- import { RequestClient } from '../../request/RequestClient';
2
- /**
3
- * Uploads tables to SAS as specially formatted CSVs.
4
- * This is more compact than JSON, and easier to read within SAS.
5
- * @param requestClient - the pre-configured HTTP request client
6
- * @param data - the JSON representation of the data to be uploaded
7
- * @param accessToken - an optional access token for authentication/authorization
8
- * The access token is not required when uploading tables from the browser.
9
- */
10
- export declare function uploadTables(requestClient: RequestClient, data: any, accessToken?: string): Promise<{
11
- tableName: string;
12
- file: any;
13
- }[]>;
@@ -1,2 +0,0 @@
1
- import { WriteStream } from '../../types';
2
- export declare const writeStream: (stream: WriteStream, content: string) => Promise<boolean>;
@@ -1,49 +0,0 @@
1
- import { ServerType } from '@sasjs/utils/types';
2
- import { RequestClient } from '../request/RequestClient';
3
- import { LoginOptions, LoginResult, LoginResultInternal } from '../types/Login';
4
- export declare class AuthManager {
5
- private serverUrl;
6
- private serverType;
7
- private requestClient;
8
- private loginCallback;
9
- userName: string;
10
- userLongName: string;
11
- private loginUrl;
12
- private logoutUrl;
13
- private redirectedLoginUrl;
14
- constructor(serverUrl: string, serverType: ServerType, requestClient: RequestClient, loginCallback: () => Promise<void>);
15
- /**
16
- * Opens Pop up window to SAS Login screen.
17
- * And checks if user has finished login process.
18
- */
19
- redirectedLogIn({ onLoggedOut }: LoginOptions): Promise<LoginResult>;
20
- /**
21
- * Logs into the SAS server with the supplied credentials.
22
- * @param username - a string representing the username.
23
- * @param password - a string representing the password.
24
- * @returns - a boolean `isLoggedin` and a string `username`
25
- */
26
- logIn(username: string, password: string): Promise<LoginResult>;
27
- private performCASSecurityCheck;
28
- private sendLoginRequest;
29
- /**
30
- * Checks whether a session is active, or login is required.
31
- * @returns - a promise which resolves with an object containing three values
32
- * - a boolean `isLoggedIn`
33
- * - a string `userName`,
34
- * - a string `userFullName` and
35
- * - a form `loginForm` if not loggedIn.
36
- */
37
- checkSession(): Promise<LoginResultInternal>;
38
- private getNewLoginForm;
39
- private fetchUserName;
40
- private extractUserName;
41
- private extractUserLongName;
42
- private getLoginForm;
43
- private setLoginUrl;
44
- /**
45
- * Logs out of the configured SAS server.
46
- *
47
- */
48
- logOut(): Promise<boolean>;
49
- }
@@ -1,11 +0,0 @@
1
- import { RequestClient } from '../request/RequestClient';
2
- /**
3
- * Exchanges the auth code for an access token for the given client.
4
- * @param requestClient - the pre-configured HTTP request client
5
- * @param clientId - the client ID to authenticate with.
6
- * @param authCode - the auth code received from the server.
7
- */
8
- export declare function getAccessTokenForSasjs(requestClient: RequestClient, clientId: string, authCode: string): Promise<{
9
- access_token: string;
10
- refresh_token: string;
11
- }>;
@@ -1,10 +0,0 @@
1
- import { SasAuthResponse } from '@sasjs/utils/types';
2
- import { RequestClient } from '../request/RequestClient';
3
- /**
4
- * Exchange the auth code for access / refresh tokens for the given client / secret pair.
5
- * @param requestClient - the pre-configured HTTP request client.
6
- * @param clientId - the client ID to authenticate with.
7
- * @param clientSecret - the client secret to authenticate with.
8
- * @param authCode - the auth code received from the server.
9
- */
10
- export declare function getAccessTokenForViya(requestClient: RequestClient, clientId: string, clientSecret: string, authCode: string): Promise<SasAuthResponse>;
@@ -1,44 +0,0 @@
1
- import { ServerType } from '@sasjs/utils/types';
2
- type Server = ServerType.SasViya | ServerType.Sasjs;
3
- type Operation = 'fetching access token' | 'refreshing tokens';
4
- /**
5
- * Forms error prefix for requests related to token operations.
6
- * @param operation - string describing operation ('fetching access token' or 'refreshing tokens').
7
- * @param funcName - name of the function sent the request.
8
- * @param server - server type (SASVIYA or SASJS).
9
- * @param url - endpoint used to send the request.
10
- * @param data - request payload.
11
- * @param headers - request headers.
12
- * @param clientId - client ID to authenticate with.
13
- * @param clientSecret - client secret to authenticate with.
14
- * @returns - string containing request information. Example:
15
- * Error while fetching access token from /SASLogon/oauth/token
16
- * Thrown by the @sasjs/adapter getAccessTokenForViya function.
17
- * Payload:
18
- * {
19
- * "grant_type": "authorization_code",
20
- * "code": "example_code"
21
- * }
22
- * Headers:
23
- * {
24
- * "Authorization": "Basic NEdMQXBwOjRHTEFwcDE=",
25
- * "Accept": "application/json"
26
- * }
27
- * ClientId: exampleClientId
28
- * ClientSecret: exampleClientSecret
29
- *
30
- * Response from Viya is below.
31
- * Auth error: {
32
- * "error": "invalid_token",
33
- * "error_description": "No scopes were granted"
34
- * }
35
- */
36
- export declare const getTokenRequestErrorPrefix: (operation: Operation, funcName: string, server: Server, url: string, data?: {}, headers?: {}, clientId?: string, clientSecret?: string) => string;
37
- /**
38
- * Parse error prefix to get response payload.
39
- * @param prefix - error prefix generated by getTokenRequestErrorPrefix function.
40
- * @param server - server type (SASVIYA or SASJS).
41
- * @returns - response payload.
42
- */
43
- export declare const getTokenRequestErrorPrefixResponse: (prefix: string, server: ServerType.SasViya | ServerType.Sasjs) => string;
44
- export {};
@@ -1,22 +0,0 @@
1
- import { AuthConfig, ServerType } from '@sasjs/utils/types';
2
- import { RequestClient } from '../request/RequestClient';
3
- /**
4
- * Callback invoked with the rotated token pair after a successful internal
5
- * refresh. Viya refresh tokens are single-use/rotating, so consumers that
6
- * persist tokens (e.g. the CLI writing `.env.{target}`) should pass a handler
7
- * wherever this is accepted to avoid the persisted pair going stale.
8
- */
9
- export type OnTokensRefreshed = (tokens: {
10
- access_token: string;
11
- refresh_token: string;
12
- }) => void | Promise<void>;
13
- /**
14
- * Returns the auth configuration, refreshing the tokens if necessary.
15
- * This function can only be used by Node, if a server type is SASVIYA.
16
- * @param requestClient - the pre-configured HTTP request client
17
- * @param authConfig - an object containing a client ID, secret, access token and refresh token
18
- * @param serverType - server type for which refreshing the tokens, defaults to SASVIYA
19
- * @param onTokensRefreshed - optional callback invoked with the rotated token
20
- * pair after a successful internal refresh.
21
- */
22
- export declare function getTokens(requestClient: RequestClient, authConfig: AuthConfig, serverType?: ServerType, onTokensRefreshed?: OnTokensRefreshed): Promise<AuthConfig>;
@@ -1,4 +0,0 @@
1
- export * from './AuthManager';
2
- export * from './isAuthorizeFormRequired';
3
- export * from './isLoginRequired';
4
- export * from './loginHeader';
@@ -1 +0,0 @@
1
- export declare const isAuthorizeFormRequired: (response: string) => boolean;
@@ -1 +0,0 @@
1
- export declare const isLogInRequired: (response: string) => boolean;
@@ -1,17 +0,0 @@
1
- import { ServerType } from '@sasjs/utils/types';
2
- export declare const defaultSuccessHeaderKey = "default";
3
- export declare const loginSuccessHeaders: {
4
- [key: string]: string;
5
- };
6
- /**
7
- * Provides expected login header based on language settings of the browser.
8
- * @returns - expected header as a string.
9
- */
10
- export declare const getExpectedLogInSuccessHeader: () => string;
11
- /**
12
- * Checks if Login success header is present in the response based on language settings of the browser.
13
- * @param serverType - server type.
14
- * @param response - response object.
15
- * @returns - boolean indicating if Login success header is present.
16
- */
17
- export declare const isLogInSuccessHeaderPresent: (serverType: ServerType, response: any) => boolean;
@@ -1,6 +0,0 @@
1
- interface WindowFeatures {
2
- width: number;
3
- height: number;
4
- }
5
- export declare function openWebPage(url: string, windowName?: string, WindowFeatures?: WindowFeatures, onLoggedOut?: () => Promise<Boolean>): Promise<Window | null>;
6
- export {};
@@ -1,10 +0,0 @@
1
- import { RequestClient } from '../request/RequestClient';
2
- /**
3
- * Exchanges the refresh token for an access token for the given client.
4
- * @param requestClient - the pre-configured HTTP request client
5
- * @param refreshToken - the refresh token received from the server.
6
- */
7
- export declare function refreshTokensForSasjs(requestClient: RequestClient, refreshToken: string): Promise<{
8
- access_token: string;
9
- refresh_token: string;
10
- }>;
@@ -1,11 +0,0 @@
1
- import { SasAuthResponse } from '@sasjs/utils/types';
2
- import { RequestClient } from '../request/RequestClient';
3
- /**
4
- * Exchanges the refresh token for an access token for the given client.
5
- * This function can only be used by Node.
6
- * @param requestClient - the pre-configured HTTP request client
7
- * @param clientId - the client ID to authenticate with.
8
- * @param clientSecret - the client secret to authenticate with.
9
- * @param refreshToken - the refresh token received from the server.
10
- */
11
- export declare function refreshTokensForViya(requestClient: RequestClient, clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse>;
@@ -1,3 +0,0 @@
1
- export declare function verifySas9Login(loginPopup: Window): Promise<{
2
- isLoggedIn: boolean;
3
- }>;
@@ -1,4 +0,0 @@
1
- export declare function verifySasViyaLogin(loginPopup: Window): Promise<{
2
- isLoggedIn: boolean;
3
- }>;
4
- export declare const isLoggedInSASVIYA: () => boolean;
@@ -1,11 +0,0 @@
1
- import NodeFormData from 'form-data';
2
- /**
3
- * One of the approaches SASjs takes to send tables-formatted JSON (see README)
4
- * to SAS is as multipart form data, where each table is provided as a specially
5
- * formatted CSV file.
6
- * @param formData Different objects are used depending on whether the adapter is
7
- * running in the browser, or in the CLI
8
- * @param data Special, tables-formatted JSON (see README)
9
- * @returns Populated formData
10
- */
11
- export declare const generateFileUploadForm: (formData: FormData | NodeFormData, data: any) => FormData | NodeFormData;
@@ -1,5 +0,0 @@
1
- import NodeFormData from 'form-data';
2
- export declare const generateTableUploadForm: (formData: FormData | NodeFormData, data: any) => {
3
- formData: NodeFormData | FormData;
4
- requestParams: any;
5
- };
@@ -1,8 +0,0 @@
1
- import { AuthConfig } from '@sasjs/utils/types';
2
- import { SASViyaApiClient } from '../SASViyaApiClient';
3
- import { BaseJobExecutor } from './JobExecutor';
4
- export declare class ComputeJobExecutor extends BaseJobExecutor {
5
- private sasViyaApiClient;
6
- constructor(serverUrl: string, sasViyaApiClient: SASViyaApiClient);
7
- execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig): Promise<unknown>;
8
- }
@@ -1,9 +0,0 @@
1
- import { RequestClient } from '../request/RequestClient';
2
- import { ServerType } from '@sasjs/utils/types';
3
- import { BaseJobExecutor } from './JobExecutor';
4
- export declare class FileUploader extends BaseJobExecutor {
5
- private jobsPath;
6
- private requestClient;
7
- constructor(serverUrl: string, serverType: ServerType, jobsPath: string, requestClient: RequestClient);
8
- execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any): Promise<unknown>;
9
- }
@@ -1,9 +0,0 @@
1
- import { AuthConfig } from '@sasjs/utils/types';
2
- import { SASViyaApiClient } from '../SASViyaApiClient';
3
- import { ExtraResponseAttributes } from '@sasjs/utils/types';
4
- import { BaseJobExecutor } from './JobExecutor';
5
- export declare class JesJobExecutor extends BaseJobExecutor {
6
- private sasViyaApiClient;
7
- constructor(serverUrl: string, sasViyaApiClient: SASViyaApiClient);
8
- execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig, extraResponseAttributes?: ExtraResponseAttributes[]): Promise<unknown>;
9
- }
@@ -1,17 +0,0 @@
1
- import { AuthConfig, ServerType } from '@sasjs/utils/types';
2
- import { ExtraResponseAttributes } from '@sasjs/utils/types';
3
- export type ExecuteFunction = () => Promise<any>;
4
- export interface JobExecutor {
5
- execute: (sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig, extraResponseAttributes?: ExtraResponseAttributes[]) => Promise<any>;
6
- resendWaitingRequests: () => Promise<void>;
7
- }
8
- export declare abstract class BaseJobExecutor implements JobExecutor {
9
- protected serverUrl: string;
10
- protected serverType: ServerType;
11
- constructor(serverUrl: string, serverType: ServerType);
12
- private waitingRequests;
13
- abstract execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig | undefined, extraResponseAttributes?: ExtraResponseAttributes[]): Promise<any>;
14
- resendWaitingRequests: () => Promise<void>;
15
- protected appendWaitingRequest(request: ExecuteFunction): void;
16
- protected getRequestParams(config: any): any;
17
- }
@@ -1,19 +0,0 @@
1
- /// <reference types="node" />
2
- import * as https from 'https';
3
- import { ServerType } from '@sasjs/utils/types';
4
- import { BaseJobExecutor } from './JobExecutor';
5
- import { RequestClient } from '../request/RequestClient';
6
- /**
7
- * Job executor for SAS9 servers for use in Node.js environments.
8
- * Initiates login with the provided username and password from the config
9
- * The cookies are stored in the request client and used in subsequent
10
- * job execution requests.
11
- */
12
- export declare class Sas9JobExecutor extends BaseJobExecutor {
13
- private jobsPath;
14
- private requestClient;
15
- private sas9RequestClient;
16
- constructor(serverUrl: string, serverType: ServerType, jobsPath: string, requestClient: RequestClient, httpsAgentOptions?: https.AgentOptions);
17
- execute(sasJob: string, data: any, config: any): Promise<unknown>;
18
- protected getRequestParams(config: any): any;
19
- }
@@ -1,9 +0,0 @@
1
- import { AuthConfig, ExtraResponseAttributes } from '@sasjs/utils/types';
2
- import { RequestClient } from '../request/RequestClient';
3
- import { BaseJobExecutor } from './JobExecutor';
4
- export declare class SasjsJobExecutor extends BaseJobExecutor {
5
- private jobsPath;
6
- private requestClient;
7
- constructor(serverUrl: string, jobsPath: string, requestClient: RequestClient);
8
- execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig, extraResponseAttributes?: ExtraResponseAttributes[]): Promise<unknown>;
9
- }
@@ -1,18 +0,0 @@
1
- import { AuthConfig, ExtraResponseAttributes, ServerType } from '@sasjs/utils/types';
2
- import { RequestClient } from '../request/RequestClient';
3
- import { SASViyaApiClient } from '../SASViyaApiClient';
4
- import { BaseJobExecutor } from './JobExecutor';
5
- export interface WaitingRequstPromise {
6
- promise: Promise<any> | null;
7
- resolve: any;
8
- reject: any;
9
- }
10
- export declare class WebJobExecutor extends BaseJobExecutor {
11
- private jobsPath;
12
- private requestClient;
13
- private sasViyaApiClient;
14
- constructor(serverUrl: string, serverType: ServerType, jobsPath: string, requestClient: RequestClient, sasViyaApiClient: SASViyaApiClient);
15
- execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig, extraResponseAttributes?: ExtraResponseAttributes[]): Promise<unknown>;
16
- protected getRequestParams(config: any): any;
17
- private getJobUri;
18
- }
@@ -1,7 +0,0 @@
1
- export * from './ComputeJobExecutor';
2
- export * from './FileUploader';
3
- export * from './JesJobExecutor';
4
- export * from './JobExecutor';
5
- export * from './Sas9JobExecutor';
6
- export * from './WebJobExecutor';
7
- export * from './SasjsJobExecutor';
@@ -1,125 +0,0 @@
1
- /// <reference types="node" />
2
- import { AxiosError, AxiosInstance, AxiosResponse } from 'axios';
3
- import * as https from 'https';
4
- import { CsrfToken } from '..';
5
- import { SASjsRequest, HttpClient, VerboseMode } from '../types';
6
- export declare class RequestClient implements HttpClient {
7
- protected baseUrl: string;
8
- private requests;
9
- private requestsLimit;
10
- private httpInterceptor?;
11
- private verboseMode;
12
- protected csrfToken: CsrfToken;
13
- protected fileUploadCsrfToken: CsrfToken | undefined;
14
- protected httpClient: AxiosInstance;
15
- private isRecoveringFromNetworkError;
16
- constructor(baseUrl: string, httpsAgentOptions?: https.AgentOptions, requestsLimit?: number, verboseMode?: VerboseMode);
17
- setConfig(baseUrl: string, httpsAgentOptions?: https.AgentOptions): void;
18
- saveLocalStorageToken(accessToken: string, refreshToken: string): void;
19
- getCsrfToken(type?: 'general' | 'file'): CsrfToken | undefined;
20
- clearCsrfTokens(): void;
21
- clearLocalStorageTokens(): void;
22
- resetInMemoryAuthState(): void;
23
- private clearAllCookies;
24
- getBaseUrl(): string;
25
- /**
26
- * this method returns all requests, an array of SASjsRequest type
27
- * @returns SASjsRequest[]
28
- */
29
- getRequests: () => SASjsRequest[];
30
- /**
31
- * this method clears the requests array, i.e set to empty
32
- */
33
- clearRequests: () => void;
34
- /**
35
- * this method appends the response from sasjs request to requests array
36
- * @param response - response from sasjs request
37
- * @param program - name of program
38
- * @param debug - a boolean that indicates whether debug was enabled or not
39
- */
40
- appendRequest(response: any, program: string, debug: boolean): void;
41
- get<T>(url: string, accessToken: string | undefined, contentType?: string, overrideHeaders?: {
42
- [key: string]: string | number;
43
- }, debug?: boolean): Promise<{
44
- result: T;
45
- etag: string;
46
- status: number;
47
- }>;
48
- /**
49
- * @param contentType Newer version of Axios is more strict so if you don't
50
- * set the contentType to `form data` while sending a FormData object
51
- * application/json will be used by default, axios won’t treat it as FormData.
52
- * Instead, it serializes data as JSON—resulting in a payload like
53
- * {"sometable":{}} and we lose the multipart/form-data formatting.
54
- */
55
- post<T>(url: string, data: any, accessToken: string | undefined, contentType?: string, overrideHeaders?: {
56
- [key: string]: string | number;
57
- }, additionalSettings?: {
58
- [key: string]: string | number;
59
- }): Promise<{
60
- result: T;
61
- etag: string;
62
- }>;
63
- put<T>(url: string, data: any, accessToken: string | undefined, overrideHeaders?: {
64
- [key: string]: string | number;
65
- }): Promise<{
66
- result: T;
67
- etag: string;
68
- }>;
69
- delete<T>(url: string, accessToken?: string): Promise<{
70
- result: T;
71
- etag: string;
72
- }>;
73
- patch<T>(url: string, data?: any, accessToken?: string, overrideHeaders?: {
74
- [key: string]: string | number;
75
- }): Promise<{
76
- result: T;
77
- etag: string;
78
- }>;
79
- uploadFile(url: string, content: string, accessToken?: string): Promise<any>;
80
- authorize: (response: string) => Promise<any>;
81
- /**
82
- * Adds colors to the string.
83
- * If verboseMode is set to 'bleached', colors should be disabled
84
- * @param str - string to be prettified.
85
- * @returns - prettified string
86
- */
87
- private prettifyString;
88
- /**
89
- * Formats HTTP request/response body.
90
- * @param body - HTTP request/response body.
91
- * @returns - formatted string.
92
- */
93
- private parseInterceptedBody;
94
- private handleAxiosResponse;
95
- private handleAxiosError;
96
- private formatHeaders;
97
- /**
98
- * Sets verbose mode.
99
- * @param verboseMode - value of the verbose mode, can be true, false or bleached(without extra colors).
100
- */
101
- setVerboseMode: (verboseMode: VerboseMode) => void;
102
- /**
103
- * Turns on verbose mode to log every HTTP response.
104
- * @param successCallBack - function that should be triggered on every HTTP response with the status 2**.
105
- * @param errorCallBack - function that should be triggered on every HTTP response with the status different from 2**.
106
- */
107
- enableVerboseMode: (successCallBack?: (response: AxiosResponse) => AxiosResponse<any, any, {}, any>, errorCallBack?: (error: AxiosError) => AxiosError<unknown, any, any>) => void;
108
- /**
109
- * Turns off verbose mode to log every HTTP response.
110
- */
111
- disableVerboseMode: () => void;
112
- protected getHeaders: (accessToken: string | undefined, contentType: string) => any;
113
- protected parseAndSetFileUploadCsrfToken: (response: AxiosResponse) => void;
114
- protected parseAndSetCsrfToken: (response: AxiosResponse) => void;
115
- private parseCsrfToken;
116
- protected handleError: (e: any, callback: any, debug?: boolean) => Promise<any>;
117
- protected parseResponse<T>(response: AxiosResponse<any>): {
118
- result: T;
119
- etag: any;
120
- log?: string | undefined;
121
- status: number;
122
- };
123
- private createHttpClient;
124
- }
125
- export declare const throwIfError: (response: AxiosResponse) => void;
@@ -1,25 +0,0 @@
1
- /// <reference types="node" />
2
- import * as https from 'https';
3
- import { RequestClient } from './RequestClient';
4
- /**
5
- * Specific request client for SAS9 in Node.js environments.
6
- * Handles redirects and cookie management.
7
- */
8
- export declare class Sas9RequestClient extends RequestClient {
9
- constructor(baseUrl: string, httpsAgentOptions?: https.AgentOptions);
10
- resetInMemoryAuthState(): void;
11
- login(username: string, password: string, jobsPath: string): Promise<void>;
12
- get<T>(url: string, accessToken: string | undefined, contentType?: string, overrideHeaders?: {
13
- [key: string]: string | number;
14
- }, debug?: boolean): Promise<{
15
- result: T;
16
- etag: string;
17
- status: number;
18
- }>;
19
- post<T>(url: string, data: any, accessToken: string | undefined, contentType?: string, overrideHeaders?: {
20
- [key: string]: string | number;
21
- }): Promise<{
22
- result: T;
23
- etag: string;
24
- }>;
25
- }
@@ -1,12 +0,0 @@
1
- import { RequestClient } from './RequestClient';
2
- import { AxiosResponse } from 'axios';
3
- import { SasjsParsedResponse } from '../types';
4
- /**
5
- * Specific request client for SASJS.
6
- * Append tokens in headers.
7
- */
8
- export declare class SasjsRequestClient extends RequestClient {
9
- getHeaders: (accessToken: string | undefined, contentType: string) => any;
10
- protected parseResponse<T>(response: AxiosResponse<any>): SasjsParsedResponse<T>;
11
- }
12
- export declare const SASJS_LOGS_SEPARATOR = "SASJS_LOGS_SEPARATOR_163ee17b6ff24f028928972d80a26784";
@@ -1,42 +0,0 @@
1
- export interface Context {
2
- name: string;
3
- id: string;
4
- createdBy: string;
5
- version: number;
6
- attributes?: any;
7
- }
8
- export interface EditContextInput {
9
- name?: string;
10
- description?: string;
11
- launchContext?: {
12
- name: string;
13
- };
14
- environment?: {
15
- options?: string[];
16
- autoExecLines?: string[];
17
- };
18
- attributes?: any;
19
- authorizedUsers?: string[];
20
- authorizeAllAuthenticatedUsers?: boolean;
21
- id?: string;
22
- }
23
- export interface ContextAllAttributes {
24
- attributes: {
25
- reuseServerProcesses: boolean;
26
- runServerAs: string;
27
- };
28
- modifiedTimeStamp: string;
29
- createdBy: string;
30
- creationTimeStamp: string;
31
- launchType: string;
32
- environment: {
33
- autoExecLines: [string];
34
- };
35
- launchContext: {
36
- contextName: string;
37
- };
38
- modifiedBy: string;
39
- id: string;
40
- version: number;
41
- name: string;
42
- }
@@ -1,4 +0,0 @@
1
- export interface CsrfToken {
2
- headerName: string;
3
- value: string;
4
- }
@@ -1,4 +0,0 @@
1
- export interface ExecutionQuery {
2
- _program: string;
3
- _debug?: number;
4
- }
@@ -1,7 +0,0 @@
1
- import { Link } from './Link';
2
- export interface File {
3
- id: string;
4
- name: string;
5
- parentUri: string;
6
- links: Link[];
7
- }
@@ -1,32 +0,0 @@
1
- export interface FileResource {
2
- creationTimeStamp: string;
3
- modifiedTimeStamp: string;
4
- createdBy: string;
5
- modifiedBy: string;
6
- id: string;
7
- properties: Properties;
8
- contentDisposition: string;
9
- contentType: string;
10
- encoding: string;
11
- links: Link[];
12
- name: string;
13
- size: number;
14
- searchable: boolean;
15
- fileStatus: string;
16
- fileVersion: number;
17
- typeDefName: string;
18
- version: number;
19
- virusDetected: boolean;
20
- urlDetected: boolean;
21
- quarantine: boolean;
22
- }
23
- export interface Link {
24
- method: string;
25
- rel: string;
26
- href: string;
27
- uri: string;
28
- type?: string;
29
- responseType?: string;
30
- }
31
- export interface Properties {
32
- }
@@ -1,7 +0,0 @@
1
- import { Link } from './Link';
2
- export interface Folder {
3
- id: string;
4
- uri: string;
5
- links: Link[];
6
- memberCount: number;
7
- }