@sasjs/adapter 4.19.4 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ContextManager.js +290 -0
- package/DISCLOSURE +45 -0
- package/README.md +1 -1
- package/SAS9ApiClient.d.ts +1 -1
- package/SAS9ApiClient.js +90 -0
- package/SASViyaApiClient.js +918 -0
- package/SASjs.js +794 -0
- package/SASjsApiClient.d.ts +1 -0
- package/SASjsApiClient.js +132 -0
- package/SessionManager.js +353 -0
- package/api/viya/executeOnComputeApi.js +198 -0
- package/api/viya/getFileStream.js +32 -0
- package/api/viya/pollJobState.js +247 -0
- package/api/viya/saveLog.js +45 -0
- package/api/viya/uploadTables.js +45 -0
- package/api/viya/writeStream.js +25 -0
- package/auth/AuthManager.js +305 -0
- package/auth/getAccessTokenForSasjs.js +43 -0
- package/auth/getAccessTokenForViya.js +54 -0
- package/auth/getTokenRequestErrorPrefix.js +70 -0
- package/auth/getTokens.js +110 -0
- package/auth/index.js +20 -0
- package/auth/isAuthorizeFormRequired.js +7 -0
- package/auth/isLoginRequired.js +9 -0
- package/auth/loginHeader.js +87 -0
- package/auth/openWebPage.js +31 -0
- package/auth/refreshTokensForSasjs.js +42 -0
- package/auth/refreshTokensForViya.js +53 -0
- package/auth/verifySas9Login.js +32 -0
- package/auth/verifySasViyaLogin.js +44 -0
- package/dist/minified_sas9.js +10892 -0
- package/dist/sasjs-adapter.js +19569 -0
- package/file/generateFileUploadForm.js +43 -0
- package/file/generateTableUploadForm.js +38 -0
- package/index.js +9 -80376
- package/job-execution/ComputeJobExecutor.js +55 -0
- package/job-execution/FileUploader.js +114 -0
- package/job-execution/JesJobExecutor.js +55 -0
- package/job-execution/JobExecutor.js +40 -0
- package/job-execution/Sas9JobExecutor.d.ts +1 -1
- package/job-execution/Sas9JobExecutor.js +115 -0
- package/job-execution/SasjsJobExecutor.js +100 -0
- package/job-execution/WebJobExecutor.js +254 -0
- package/job-execution/index.js +23 -0
- package/minified/sas9/SASjs.js +198 -0
- package/minified/sas9/WebJobExecutor.js +105 -0
- package/minified/sas9/index.js +22 -0
- package/node/index.d.ts +2 -9
- package/node/index.js +1 -30570
- package/package.json +40 -14
- package/request/RequestClient.d.ts +1 -1
- package/request/RequestClient.js +717 -0
- package/request/Sas9RequestClient.d.ts +1 -1
- package/request/Sas9RequestClient.js +121 -0
- package/request/SasjsRequestClient.js +77 -0
- package/types/Context.js +2 -0
- package/types/CsrfToken.js +2 -0
- package/types/ExecuteScript.js +2 -0
- package/types/File.js +2 -0
- package/types/FileResource.js +2 -0
- package/types/Folder.js +2 -0
- package/types/Job.js +2 -0
- package/types/JobDefinition.js +2 -0
- package/types/JobResult.js +2 -0
- package/types/Link.js +2 -0
- package/types/LogStatistics.js +2 -0
- package/types/Login.js +2 -0
- package/types/PollOptions.js +2 -0
- package/types/RequestClient.js +2 -0
- package/types/SASjsConfig.d.ts +1 -1
- package/types/SASjsConfig.js +91 -0
- package/types/Session.js +14 -0
- package/types/Tables.js +28 -0
- package/types/UploadFile.js +2 -0
- package/types/WriteStream.d.ts +1 -1
- package/types/WriteStream.js +2 -0
- package/types/errors/ArgumentError.js +12 -0
- package/types/errors/AuthorizeError.js +13 -0
- package/types/errors/CertificateError.js +12 -0
- package/types/errors/ComputeJobExecutionError.js +13 -0
- package/types/errors/ErrorResponse.js +23 -0
- package/types/errors/InternalServerError.js +11 -0
- package/types/errors/InvalidJsonError.js +11 -0
- package/types/errors/InvalidSASjsCsrfError.js +12 -0
- package/types/errors/JobExecutionError.js +14 -0
- package/types/errors/JobStatePollError.js +12 -0
- package/types/errors/JsonParseArrayError.js +11 -0
- package/types/errors/LoginRequiredError.js +14 -0
- package/types/errors/NoSessionStateError.js +14 -0
- package/types/errors/NotFoundError.js +12 -0
- package/types/errors/RootFolderNotFoundError.js +22 -0
- package/types/errors/SAS9AuthError.js +11 -0
- package/types/errors/WeboutResponseError.js +12 -0
- package/types/errors/index.js +31 -0
- package/types/index.js +34 -0
- package/utils/appendExtraResponseAttributes.js +25 -0
- package/utils/asyncForEach.js +20 -0
- package/utils/compareTimestamps.js +11 -0
- package/utils/convertToCsv.js +154 -0
- package/utils/createAxiosInstance.d.ts +1 -1
- package/utils/createAxiosInstance.js +9 -0
- package/utils/delay.js +5 -0
- package/{src/utils/extractWeboutBlob.ts → utils/extractWeboutBlob.js} +19 -20
- package/utils/fetchLogByChunks.js +56 -0
- package/utils/formatDataForRequest.js +39 -0
- package/utils/getFormData.js +10 -0
- package/{node/utils/getUserLanguage.d.ts → utils/getUserLanguage.js} +5 -1
- package/utils/getValidJson.js +27 -0
- package/utils/host.d.ts +24 -0
- package/utils/host.js +36 -0
- package/utils/index.js +41 -0
- package/utils/isIeOrEdge.js +30 -0
- package/utils/isNode.js +7 -0
- package/utils/isRelativePath.js +5 -0
- package/utils/isUri.js +9 -0
- package/utils/isUrl.js +20 -0
- package/utils/loginPrompt/index.js +180 -0
- package/utils/needsRetry.js +14 -0
- package/utils/parseGeneratedCode.js +10 -0
- package/utils/parseSasViyaLog.js +17 -0
- package/utils/parseSourceCode.js +9 -0
- package/utils/parseViyaDebugResponse.js +46 -0
- package/utils/parseViyaLogDebugResponse.js +32 -0
- package/utils/parseWeboutResponse.js +22 -0
- package/utils/sas9/extractUserLongNameSas9.js +30 -0
- package/utils/serialize.js +20 -0
- package/utils/splitChunks.js +13 -0
- package/utils/validateInput.js +83 -0
- package/.env.example +0 -2
- package/.git-hooks/commit-msg +0 -39
- package/.git-hooks/pre-commit +0 -12
- package/.gitattributes +0 -1
- package/.pre-commit-config.yaml +0 -25
- package/.vscode/settings.json +0 -3
- package/SASViyaApiClient.spec.d.ts +0 -1
- package/__mocks__/axios.d.ts +0 -3
- package/api/viya/spec/executeScript.spec.d.ts +0 -1
- package/api/viya/spec/getFileStream.spec.d.ts +0 -1
- package/api/viya/spec/mockResponses.d.ts +0 -10
- package/api/viya/spec/pollJobState.spec.d.ts +0 -1
- package/api/viya/spec/saveLog.spec.d.ts +0 -1
- package/api/viya/spec/uploadTables.spec.d.ts +0 -1
- package/api/viya/spec/writeStream.spec.d.ts +0 -1
- package/auth/spec/AuthManager.spec.d.ts +0 -4
- package/auth/spec/getAccessTokenForSasjs.spec.d.ts +0 -1
- package/auth/spec/getAccessTokenForViya.spec.d.ts +0 -1
- package/auth/spec/getTokenRequestErrorPrefix.spec.d.ts +0 -1
- package/auth/spec/getTokens.spec.d.ts +0 -1
- package/auth/spec/loginHeader.spec.d.ts +0 -4
- package/auth/spec/mockResponses.d.ts +0 -23
- package/auth/spec/openWebPage.spec.d.ts +0 -1
- package/auth/spec/refreshTokensForSasjs.spec.d.ts +0 -1
- package/auth/spec/refreshTokensForViya.spec.d.ts +0 -1
- package/auth/spec/verifySas9Login.spec.d.ts +0 -1
- package/auth/spec/verifySasViyaLogin.spec.d.ts +0 -1
- package/createTSDocs.js +0 -35
- package/cypress.config.js +0 -18
- package/example.html +0 -109
- package/file/spec/generateFileUploadForm.spec.d.ts +0 -1
- package/file/spec/generateTableUploadForm.spec.d.ts +0 -1
- package/index-dev.js +0 -80394
- package/job-execution/spec/ComputeJobExecutor.spec.d.ts +0 -1
- package/job-execution/spec/JesJobExecutor.spec.d.ts +0 -1
- package/job-execution/spec/Sas9JobExecutor.spec.d.ts +0 -1
- package/job-execution/spec/SasjsJobExecutor.spec.d.ts +0 -1
- package/job-execution/spec/WebJobExecutor.debug.spec.d.ts +0 -1
- package/job-execution/spec/WebJobExecutor.spec.d.ts +0 -1
- package/job-execution/spec/executionTasks.spec.d.ts +0 -1
- package/minified_sas9.js +0 -14039
- package/node/ContextManager.d.ts +0 -41
- package/node/SAS9ApiClient.d.ts +0 -30
- package/node/SASViyaApiClient.d.ts +0 -298
- package/node/SASjs.d.ts +0 -387
- package/node/SASjsApiClient.d.ts +0 -65
- package/node/SessionManager.d.ts +0 -115
- package/node/api/viya/executeOnComputeApi.d.ts +0 -21
- package/node/api/viya/getFileStream.d.ts +0 -2
- package/node/api/viya/pollJobState.d.ts +0 -57
- package/node/api/viya/saveLog.d.ts +0 -15
- package/node/api/viya/uploadTables.d.ts +0 -13
- package/node/api/viya/writeStream.d.ts +0 -2
- package/node/auth/AuthManager.d.ts +0 -49
- package/node/auth/getAccessTokenForSasjs.d.ts +0 -11
- package/node/auth/getAccessTokenForViya.d.ts +0 -10
- package/node/auth/getTokenRequestErrorPrefix.d.ts +0 -44
- package/node/auth/getTokens.d.ts +0 -22
- package/node/auth/index.d.ts +0 -4
- package/node/auth/isAuthorizeFormRequired.d.ts +0 -1
- package/node/auth/isLoginRequired.d.ts +0 -1
- package/node/auth/loginHeader.d.ts +0 -17
- package/node/auth/openWebPage.d.ts +0 -6
- package/node/auth/refreshTokensForSasjs.d.ts +0 -10
- package/node/auth/refreshTokensForViya.d.ts +0 -11
- package/node/auth/verifySas9Login.d.ts +0 -3
- package/node/auth/verifySasViyaLogin.d.ts +0 -4
- package/node/file/generateFileUploadForm.d.ts +0 -11
- package/node/file/generateTableUploadForm.d.ts +0 -5
- package/node/job-execution/ComputeJobExecutor.d.ts +0 -8
- package/node/job-execution/FileUploader.d.ts +0 -9
- package/node/job-execution/JesJobExecutor.d.ts +0 -9
- package/node/job-execution/JobExecutor.d.ts +0 -17
- package/node/job-execution/Sas9JobExecutor.d.ts +0 -19
- package/node/job-execution/SasjsJobExecutor.d.ts +0 -9
- package/node/job-execution/WebJobExecutor.d.ts +0 -18
- package/node/job-execution/index.d.ts +0 -7
- package/node/request/RequestClient.d.ts +0 -125
- package/node/request/Sas9RequestClient.d.ts +0 -25
- package/node/request/SasjsRequestClient.d.ts +0 -12
- package/node/types/Context.d.ts +0 -42
- package/node/types/CsrfToken.d.ts +0 -4
- package/node/types/ExecuteScript.d.ts +0 -4
- package/node/types/File.d.ts +0 -7
- package/node/types/FileResource.d.ts +0 -32
- package/node/types/Folder.d.ts +0 -7
- package/node/types/Job.d.ts +0 -14
- package/node/types/JobDefinition.d.ts +0 -3
- package/node/types/JobResult.d.ts +0 -3
- package/node/types/Link.d.ts +0 -7
- package/node/types/LogStatistics.d.ts +0 -4
- package/node/types/Login.d.ts +0 -14
- package/node/types/PollOptions.d.ts +0 -8
- package/node/types/RequestClient.d.ts +0 -46
- package/node/types/SASjsConfig.d.ts +0 -94
- package/node/types/Session.d.ts +0 -30
- package/node/types/Tables.d.ts +0 -7
- package/node/types/UploadFile.d.ts +0 -8
- package/node/types/WriteStream.d.ts +0 -7
- package/node/types/errors/ArgumentError.d.ts +0 -4
- package/node/types/errors/AuthorizeError.d.ts +0 -5
- package/node/types/errors/CertificateError.d.ts +0 -3
- package/node/types/errors/ComputeJobExecutionError.d.ts +0 -6
- package/node/types/errors/ErrorResponse.d.ts +0 -9
- package/node/types/errors/InternalServerError.d.ts +0 -3
- package/node/types/errors/InvalidJsonError.d.ts +0 -3
- package/node/types/errors/InvalidSASjsCsrfError.d.ts +0 -3
- package/node/types/errors/JobExecutionError.d.ts +0 -6
- package/node/types/errors/JobStatePollError.d.ts +0 -4
- package/node/types/errors/JsonParseArrayError.d.ts +0 -3
- package/node/types/errors/LoginRequiredError.d.ts +0 -3
- package/node/types/errors/NoSessionStateError.d.ts +0 -6
- package/node/types/errors/NotFoundError.d.ts +0 -4
- package/node/types/errors/RootFolderNotFoundError.d.ts +0 -3
- package/node/types/errors/SAS9AuthError.d.ts +0 -3
- package/node/types/errors/WeboutResponseError.d.ts +0 -4
- package/node/types/errors/index.d.ts +0 -15
- package/node/types/index.d.ts +0 -18
- package/node/utils/appendExtraResponseAttributes.d.ts +0 -2
- package/node/utils/asyncForEach.d.ts +0 -1
- package/node/utils/compareTimestamps.d.ts +0 -6
- package/node/utils/convertToCsv.d.ts +0 -12
- package/node/utils/createAxiosInstance.d.ts +0 -2
- package/node/utils/delay.d.ts +0 -1
- package/node/utils/extractWeboutBlob.d.ts +0 -13
- package/node/utils/fetchLogByChunks.d.ts +0 -20
- package/node/utils/formatDataForRequest.d.ts +0 -1
- package/node/utils/getFormData.d.ts +0 -2
- package/node/utils/getValidJson.d.ts +0 -5
- package/node/utils/index.d.ts +0 -25
- package/node/utils/isNode.d.ts +0 -1
- package/node/utils/isRelativePath.d.ts +0 -1
- package/node/utils/isUri.d.ts +0 -5
- package/node/utils/isUrl.d.ts +0 -5
- package/node/utils/loginPrompt/index.d.ts +0 -1
- package/node/utils/needsRetry.d.ts +0 -1
- package/node/utils/parseGeneratedCode.d.ts +0 -1
- package/node/utils/parseSasViyaLog.d.ts +0 -5
- package/node/utils/parseSourceCode.d.ts +0 -1
- package/node/utils/parseViyaDebugResponse.d.ts +0 -12
- package/node/utils/parseViyaLogDebugResponse.d.ts +0 -8
- package/node/utils/parseWeboutResponse.d.ts +0 -1
- package/node/utils/sas9/extractUserLongNameSas9.d.ts +0 -6
- package/node/utils/serialize.d.ts +0 -1
- package/node/utils/splitChunks.d.ts +0 -1
- package/node/utils/validateInput.d.ts +0 -14
- package/request/spec/SasjsRequestClient.spec.d.ts +0 -1
- package/screenshots/session-manager-first-request.png +0 -0
- package/screenshots/subsequent-session-request.png +0 -0
- package/spec/SAS9ApiClient.spec.d.ts +0 -1
- package/spec/SASjs.startComputeJob.spec.d.ts +0 -1
- package/spec/SASjsApiClient.spec.d.ts +0 -1
- package/src/ContextManager.ts +0 -454
- package/src/SAS9ApiClient.ts +0 -100
- package/src/SASViyaApiClient.ts +0 -1417
- package/src/SASjs.ts +0 -1268
- package/src/SASjsApiClient.ts +0 -177
- package/src/SessionManager.ts +0 -465
- package/src/__mocks__/axios.ts +0 -7
- package/src/api/viya/executeOnComputeApi.ts +0 -307
- package/src/api/viya/getFileStream.ts +0 -17
- package/src/api/viya/pollJobState.ts +0 -393
- package/src/api/viya/saveLog.ts +0 -55
- package/src/api/viya/spec/mockResponses.ts +0 -75
- package/src/api/viya/uploadTables.ts +0 -41
- package/src/api/viya/writeStream.ts +0 -16
- package/src/auth/AuthManager.ts +0 -387
- package/src/auth/getAccessTokenForSasjs.ts +0 -48
- package/src/auth/getAccessTokenForViya.ts +0 -61
- package/src/auth/getTokenRequestErrorPrefix.ts +0 -88
- package/src/auth/getTokens.ts +0 -127
- package/src/auth/index.ts +0 -4
- package/src/auth/isAuthorizeFormRequired.ts +0 -3
- package/src/auth/isLoginRequired.ts +0 -5
- package/src/auth/loginHeader.ts +0 -97
- package/src/auth/openWebPage.ts +0 -40
- package/src/auth/refreshTokensForSasjs.ts +0 -45
- package/src/auth/refreshTokensForViya.ts +0 -66
- package/src/auth/spec/mockResponses.ts +0 -53
- package/src/auth/verifySas9Login.ts +0 -25
- package/src/auth/verifySasViyaLogin.ts +0 -43
- package/src/file/generateFileUploadForm.ts +0 -48
- package/src/file/generateTableUploadForm.ts +0 -50
- package/src/index.ts +0 -9
- package/src/job-execution/ComputeJobExecutor.ts +0 -76
- package/src/job-execution/FileUploader.ts +0 -152
- package/src/job-execution/JesJobExecutor.ts +0 -78
- package/src/job-execution/JobExecutor.ts +0 -63
- package/src/job-execution/Sas9JobExecutor.ts +0 -137
- package/src/job-execution/SasjsJobExecutor.ts +0 -152
- package/src/job-execution/WebJobExecutor.ts +0 -341
- package/src/job-execution/index.ts +0 -7
- package/src/minified/sas9/SASjs.ts +0 -274
- package/src/minified/sas9/WebJobExecutor.ts +0 -156
- package/src/minified/sas9/index.ts +0 -3
- package/src/request/RequestClient.ts +0 -941
- package/src/request/Sas9RequestClient.ts +0 -132
- package/src/request/SasjsRequestClient.ts +0 -82
- package/src/test/SAS_server_app.ts +0 -47
- package/src/types/Context.ts +0 -39
- package/src/types/CsrfToken.ts +0 -4
- package/src/types/ExecuteScript.ts +0 -4
- package/src/types/File.ts +0 -8
- package/src/types/FileResource.ts +0 -33
- package/src/types/Folder.ts +0 -8
- package/src/types/Job.ts +0 -15
- package/src/types/JobDefinition.ts +0 -3
- package/src/types/JobResult.ts +0 -3
- package/src/types/Link.ts +0 -7
- package/src/types/LogStatistics.ts +0 -4
- package/src/types/Login.ts +0 -15
- package/src/types/PollOptions.ts +0 -9
- package/src/types/Process.d.ts +0 -5
- package/src/types/RequestClient.ts +0 -55
- package/src/types/SASjsConfig.ts +0 -95
- package/src/types/Session.ts +0 -34
- package/src/types/Tables.ts +0 -29
- package/src/types/UploadFile.ts +0 -8
- package/src/types/WriteStream.ts +0 -10
- package/src/types/errors/ArgumentError.ts +0 -7
- package/src/types/errors/AuthorizeError.ts +0 -10
- package/src/types/errors/CertificateError.ts +0 -12
- package/src/types/errors/ComputeJobExecutionError.ts +0 -12
- package/src/types/errors/ErrorResponse.ts +0 -28
- package/src/types/errors/InternalServerError.ts +0 -9
- package/src/types/errors/InvalidJsonError.ts +0 -7
- package/src/types/errors/InvalidSASjsCsrfError.ts +0 -9
- package/src/types/errors/JobExecutionError.ts +0 -11
- package/src/types/errors/JobStatePollError.ts +0 -14
- package/src/types/errors/JsonParseArrayError.ts +0 -7
- package/src/types/errors/LoginRequiredError.ts +0 -11
- package/src/types/errors/NoSessionStateError.ts +0 -15
- package/src/types/errors/NotFoundError.ts +0 -7
- package/src/types/errors/RootFolderNotFoundError.ts +0 -24
- package/src/types/errors/SAS9AuthError.ts +0 -9
- package/src/types/errors/WeboutResponseError.ts +0 -7
- package/src/types/errors/index.ts +0 -15
- package/src/types/index.ts +0 -18
- package/src/types/system/global.d.ts +0 -1
- package/src/utils/appendExtraResponseAttributes.ts +0 -22
- package/src/utils/asyncForEach.ts +0 -5
- package/src/utils/compareTimestamps.ts +0 -9
- package/src/utils/convertToCsv.ts +0 -198
- package/src/utils/createAxiosInstance.ts +0 -7
- package/src/utils/delay.ts +0 -2
- package/src/utils/fetchLogByChunks.ts +0 -63
- package/src/utils/formatDataForRequest.ts +0 -48
- package/src/utils/getFormData.ts +0 -5
- package/src/utils/getUserLanguage.ts +0 -10
- package/src/utils/getValidJson.ts +0 -23
- package/src/utils/index.ts +0 -25
- package/src/utils/isIeOrEdge.ts +0 -34
- package/src/utils/isNode.ts +0 -4
- package/src/utils/isRelativePath.ts +0 -2
- package/src/utils/isUri.ts +0 -5
- package/src/utils/isUrl.ts +0 -17
- package/src/utils/loginPrompt/index.ts +0 -177
- package/src/utils/needsRetry.ts +0 -14
- package/src/utils/parseGeneratedCode.ts +0 -7
- package/src/utils/parseSasViyaLog.ts +0 -12
- package/src/utils/parseSourceCode.ts +0 -6
- package/src/utils/parseViyaDebugResponse.ts +0 -46
- package/src/utils/parseViyaLogDebugResponse.ts +0 -22
- package/src/utils/parseWeboutResponse.ts +0 -20
- package/src/utils/sas9/extractUserLongNameSas9.ts +0 -31
- package/src/utils/serialize.ts +0 -15
- package/src/utils/splitChunks.ts +0 -12
- package/src/utils/validateInput.ts +0 -93
- package/test/ContextManager.spec.d.ts +0 -1
- package/test/FileUploader.spec.d.ts +0 -4
- package/test/FolderOperations.spec.d.ts +0 -1
- package/test/RequestClient.spec.d.ts +0 -1
- package/test/SAS_server_app.d.ts +0 -10
- package/test/SessionManager.spec.d.ts +0 -1
- package/test/getJobsInFolder.spec.d.ts +0 -1
- package/test/utils/formatDataForRequest.spec.d.ts +0 -1
- package/test/utils/getValidJson.spec.d.ts +0 -1
- package/test/utils/isUrl.spec.d.ts +0 -1
- package/test/utils/parseGeneratedCode.spec.d.ts +0 -1
- package/test/utils/parseSourceCode.spec.d.ts +0 -1
- package/types/Tables.spec.d.ts +0 -1
- package/types/errors/RootFolderNotFoundError.spec.d.ts +0 -1
- package/types/errors/spec/SAS9AuthError.spec.d.ts +0 -1
- package/utils/spec/convertToCsv.spec.d.ts +0 -1
- package/utils/spec/extractUserLongNameSas9.spec.d.ts +0 -1
- package/utils/spec/getFormData.spec.d.ts +0 -1
- package/utils/spec/parseSasViyaLog.spec.d.ts +0 -1
- package/utils/spec/parseViyaDebugResponse.spec.d.ts +0 -1
- package/utils/spec/parseViyaLogDebugResponse.spec.d.ts +0 -1
- package/utils/spec/validateInput.spec.d.ts +0 -1
package/src/utils/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export * from './appendExtraResponseAttributes'
|
|
2
|
-
export * from './asyncForEach'
|
|
3
|
-
export * from './compareTimestamps'
|
|
4
|
-
export * from './convertToCsv'
|
|
5
|
-
export * from './createAxiosInstance'
|
|
6
|
-
export * from './delay'
|
|
7
|
-
export * from './extractWeboutBlob'
|
|
8
|
-
export * from './fetchLogByChunks'
|
|
9
|
-
export * from './getValidJson'
|
|
10
|
-
export * from './isNode'
|
|
11
|
-
export * from './isRelativePath'
|
|
12
|
-
export * from './isUri'
|
|
13
|
-
export * from './isUrl'
|
|
14
|
-
export * from './needsRetry'
|
|
15
|
-
export * from './parseGeneratedCode'
|
|
16
|
-
export * from './parseSasViyaLog'
|
|
17
|
-
export * from './parseSourceCode'
|
|
18
|
-
export * from './parseViyaDebugResponse'
|
|
19
|
-
export * from './parseViyaLogDebugResponse'
|
|
20
|
-
export * from './parseWeboutResponse'
|
|
21
|
-
export * from './serialize'
|
|
22
|
-
export * from './splitChunks'
|
|
23
|
-
export * from './validateInput'
|
|
24
|
-
export * from './getFormData'
|
|
25
|
-
export * from './getUserLanguage'
|
package/src/utils/isIeOrEdge.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export function isIEorEdgeOrOldFirefox() {
|
|
2
|
-
if (typeof window === 'undefined') {
|
|
3
|
-
return false
|
|
4
|
-
}
|
|
5
|
-
const ua = window.navigator.userAgent
|
|
6
|
-
|
|
7
|
-
if (ua.indexOf('Firefox') > 0) {
|
|
8
|
-
const version = parseInt(
|
|
9
|
-
ua.substring(ua.lastIndexOf('Firefox/') + 8, ua.length),
|
|
10
|
-
10
|
|
11
|
-
)
|
|
12
|
-
return version <= 60
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const msie = ua.indexOf('MSIE ')
|
|
16
|
-
if (msie > 0) {
|
|
17
|
-
// IE 10 or older => return version number
|
|
18
|
-
return true
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const trident = ua.indexOf('Trident/')
|
|
22
|
-
if (trident > 0) {
|
|
23
|
-
return true
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const edge = ua.indexOf('Edge/')
|
|
27
|
-
if (edge > 0) {
|
|
28
|
-
// Edge (IE 12+) => return version number
|
|
29
|
-
return true
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// other browser
|
|
33
|
-
return false
|
|
34
|
-
}
|
package/src/utils/isNode.ts
DELETED
package/src/utils/isUri.ts
DELETED
package/src/utils/isUrl.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if string is in URL format.
|
|
3
|
-
* @param str - string to check.
|
|
4
|
-
*/
|
|
5
|
-
export const isUrl = (str: string): boolean => {
|
|
6
|
-
const supportedProtocols = ['http:', 'https:']
|
|
7
|
-
|
|
8
|
-
try {
|
|
9
|
-
const url = new URL(str)
|
|
10
|
-
|
|
11
|
-
if (!supportedProtocols.includes(url.protocol)) return false
|
|
12
|
-
} catch (_) {
|
|
13
|
-
return false
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return true
|
|
17
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
enum domIDs {
|
|
2
|
-
styles = 'sasjsAdapterStyles',
|
|
3
|
-
overlay = 'sasjsAdapterLoginPromptBG',
|
|
4
|
-
dialog = 'sasjsAdapterLoginPrompt'
|
|
5
|
-
}
|
|
6
|
-
const cssPrefix = 'sasjs-adapter'
|
|
7
|
-
|
|
8
|
-
const classes = {
|
|
9
|
-
popUp: `${cssPrefix}popUp`,
|
|
10
|
-
popUpBG: `${cssPrefix}popUpBG`
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const openLoginPrompt = (): Promise<boolean> => {
|
|
14
|
-
return new Promise(async (resolve) => {
|
|
15
|
-
const style = document.createElement('style')
|
|
16
|
-
style.id = domIDs.styles
|
|
17
|
-
style.innerText = cssContent
|
|
18
|
-
|
|
19
|
-
const loginPromptBG = document.createElement('div')
|
|
20
|
-
loginPromptBG.id = domIDs.overlay
|
|
21
|
-
loginPromptBG.classList.add(classes.popUpBG)
|
|
22
|
-
|
|
23
|
-
const loginPrompt = document.createElement('div')
|
|
24
|
-
loginPrompt.id = domIDs.dialog
|
|
25
|
-
loginPrompt.classList.add(classes.popUp)
|
|
26
|
-
|
|
27
|
-
const title = document.createElement('h1')
|
|
28
|
-
title.innerText = 'Session Expired!'
|
|
29
|
-
loginPrompt.appendChild(title)
|
|
30
|
-
|
|
31
|
-
const descHolder = document.createElement('div')
|
|
32
|
-
const desc = document.createElement('span')
|
|
33
|
-
desc.innerText = 'You need to relogin, click OK to login.'
|
|
34
|
-
descHolder.appendChild(desc)
|
|
35
|
-
loginPrompt.appendChild(descHolder)
|
|
36
|
-
|
|
37
|
-
const buttonCancel = document.createElement('button')
|
|
38
|
-
buttonCancel.classList.add('cancel')
|
|
39
|
-
buttonCancel.innerText = 'Cancel'
|
|
40
|
-
buttonCancel.onclick = () => {
|
|
41
|
-
closeLoginPrompt()
|
|
42
|
-
resolve(false)
|
|
43
|
-
}
|
|
44
|
-
loginPrompt.appendChild(buttonCancel)
|
|
45
|
-
|
|
46
|
-
const buttonOk = document.createElement('button')
|
|
47
|
-
buttonOk.classList.add('confirm')
|
|
48
|
-
buttonOk.innerText = 'Ok'
|
|
49
|
-
buttonOk.onclick = () => {
|
|
50
|
-
closeLoginPrompt()
|
|
51
|
-
resolve(true)
|
|
52
|
-
}
|
|
53
|
-
loginPrompt.appendChild(buttonOk)
|
|
54
|
-
|
|
55
|
-
document.body.style.overflow = 'hidden'
|
|
56
|
-
|
|
57
|
-
document.body.appendChild(style)
|
|
58
|
-
document.body.appendChild(loginPromptBG)
|
|
59
|
-
document.body.appendChild(loginPrompt)
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
const closeLoginPrompt = () => {
|
|
63
|
-
Object.values(domIDs).forEach((id) => {
|
|
64
|
-
const elem = document.getElementById(id)
|
|
65
|
-
elem?.parentNode?.removeChild(elem)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
document.body.style.overflow = 'auto'
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const cssContent = `
|
|
72
|
-
.${classes.popUpBG} ,
|
|
73
|
-
.${classes.popUp} {
|
|
74
|
-
z-index: 10000;
|
|
75
|
-
}
|
|
76
|
-
.${classes.popUp} {
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
-webkit-box-sizing: border-box;
|
|
79
|
-
-moz-box-sizing: border-box;
|
|
80
|
-
display: block;
|
|
81
|
-
position: fixed;
|
|
82
|
-
top: 40%;
|
|
83
|
-
left: 50%;
|
|
84
|
-
padding: 0;
|
|
85
|
-
font-size: 14px;
|
|
86
|
-
font-family: 'PT Sans', sans-serif;
|
|
87
|
-
color: #fff;
|
|
88
|
-
border-style: none;
|
|
89
|
-
z-index: 999;
|
|
90
|
-
overflow: hidden;
|
|
91
|
-
background: rgba(0, 0, 0, 0.2);
|
|
92
|
-
margin: 0;
|
|
93
|
-
width: 100%;
|
|
94
|
-
max-width: 300px;
|
|
95
|
-
height: auto;
|
|
96
|
-
max-height: 300px;
|
|
97
|
-
transform: translate(-50%, -50%);
|
|
98
|
-
}
|
|
99
|
-
.${classes.popUp} > h1 {
|
|
100
|
-
box-sizing: border-box;
|
|
101
|
-
-webkit-box-sizing: border-box;
|
|
102
|
-
-moz-box-sizing: border-box;
|
|
103
|
-
padding: 5px;
|
|
104
|
-
min-height: 40px;
|
|
105
|
-
font-size: 1.2em;
|
|
106
|
-
font-weight: bold;
|
|
107
|
-
text-align: center;
|
|
108
|
-
color: #fff;
|
|
109
|
-
background-color: transparent;
|
|
110
|
-
border-style: none;
|
|
111
|
-
border-width: 5px;
|
|
112
|
-
border-color: black;
|
|
113
|
-
}
|
|
114
|
-
.${classes.popUp} > div {
|
|
115
|
-
width: 100%;
|
|
116
|
-
height: calc(100% -108px);
|
|
117
|
-
margin: 0;
|
|
118
|
-
display: block;
|
|
119
|
-
box-sizing: border-box;
|
|
120
|
-
-webkit-box-sizing: border-box;
|
|
121
|
-
-moz-box-sizing: border-box;
|
|
122
|
-
padding: 5%;
|
|
123
|
-
text-align: center;
|
|
124
|
-
border-width: 1px;
|
|
125
|
-
border-color: #ccc;
|
|
126
|
-
border-style: none none solid none;
|
|
127
|
-
overflow: auto;
|
|
128
|
-
}
|
|
129
|
-
.${classes.popUp} > div > span {
|
|
130
|
-
display: table-cell;
|
|
131
|
-
box-sizing: border-box;
|
|
132
|
-
-webkit-box-sizing: border-box;
|
|
133
|
-
-moz-box-sizing: border-box;
|
|
134
|
-
margin: 0;
|
|
135
|
-
padding: 0;
|
|
136
|
-
width: 300px;
|
|
137
|
-
height: 108px;
|
|
138
|
-
vertical-align: middle;
|
|
139
|
-
border-style: none;
|
|
140
|
-
}
|
|
141
|
-
.${classes.popUp} .cancel {
|
|
142
|
-
float: left;
|
|
143
|
-
}
|
|
144
|
-
.${classes.popUp} .confirm {
|
|
145
|
-
float: right;
|
|
146
|
-
}
|
|
147
|
-
.${classes.popUp} > button {
|
|
148
|
-
box-sizing: border-box;
|
|
149
|
-
-webkit-box-sizing: border-box;
|
|
150
|
-
-moz-box-sizing: border-box;
|
|
151
|
-
margin: 0;
|
|
152
|
-
padding: 10px;
|
|
153
|
-
width: 50%;
|
|
154
|
-
border: 1px none #ccc;
|
|
155
|
-
color: #fff;
|
|
156
|
-
font-family: inherit;
|
|
157
|
-
cursor: pointer;
|
|
158
|
-
height: 50px;
|
|
159
|
-
background: rgba(1, 1, 1, 0.2);
|
|
160
|
-
}
|
|
161
|
-
.${classes.popUp} > button:hover {
|
|
162
|
-
background: rgba(0, 0, 0, 0.2);
|
|
163
|
-
}
|
|
164
|
-
.${classes.popUpBG} {
|
|
165
|
-
display: block;
|
|
166
|
-
position: fixed;
|
|
167
|
-
top: 0;
|
|
168
|
-
left: 0;
|
|
169
|
-
width: 100%;
|
|
170
|
-
height: 100%;
|
|
171
|
-
margin: 0;
|
|
172
|
-
padding: 0;
|
|
173
|
-
opacity: 0.95;
|
|
174
|
-
z-index: 50;
|
|
175
|
-
background-image: radial-gradient(#0378cd, #012036);
|
|
176
|
-
}
|
|
177
|
-
`
|
package/src/utils/needsRetry.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const needsRetry = (responseText: string): boolean => {
|
|
2
|
-
return (
|
|
3
|
-
!!responseText &&
|
|
4
|
-
((responseText.includes('"errorCode":403') &&
|
|
5
|
-
responseText.includes('_csrf') &&
|
|
6
|
-
responseText.includes('X-CSRF-TOKEN')) ||
|
|
7
|
-
(responseText.includes('"status":403') &&
|
|
8
|
-
responseText.includes('"error":"Forbidden"')) ||
|
|
9
|
-
(responseText.includes('"status":449') &&
|
|
10
|
-
responseText.includes(
|
|
11
|
-
'Authentication success, retry original request'
|
|
12
|
-
)))
|
|
13
|
-
)
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const parseSasViyaLog = (logResponse: { items: any[] }) => {
|
|
2
|
-
let log
|
|
3
|
-
try {
|
|
4
|
-
log = logResponse.items
|
|
5
|
-
? logResponse.items.map((i) => i.line).join('\n')
|
|
6
|
-
: JSON.stringify(logResponse)
|
|
7
|
-
} catch (e: any) {
|
|
8
|
-
console.error('An error has occurred while parsing the log response', e)
|
|
9
|
-
log = logResponse
|
|
10
|
-
}
|
|
11
|
-
return log
|
|
12
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { RequestClient } from '../request/RequestClient'
|
|
2
|
-
import { getValidJson } from '../utils'
|
|
3
|
-
import { extractWeboutBlob } from './extractWeboutBlob'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* When querying a Viya job using the Web approach (as opposed to using the APIs) with _DEBUG enabled,
|
|
7
|
-
* the first response contains the log with the content in an iframe. Therefore when debug is enabled,
|
|
8
|
-
* and the serverType is VIYA, and useComputeApi is null (WEB), we call this function to extract the
|
|
9
|
-
* (_webout) content from the iframe.
|
|
10
|
-
* @param response - first response from viya job
|
|
11
|
-
* @param requestClient
|
|
12
|
-
* @param serverUrl
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export const parseSasViyaDebugResponse = async (
|
|
16
|
-
response: string,
|
|
17
|
-
requestClient: RequestClient,
|
|
18
|
-
serverUrl: string
|
|
19
|
-
) => {
|
|
20
|
-
// On viya 3.5, iframe is like <iframe style="width: 99%; height: 500px" src="..."></iframe>
|
|
21
|
-
// On viya 4, iframe is like <iframe style="width: 99%; height: 500px; background-color:Canvas;" src=...></iframe>
|
|
22
|
-
|
|
23
|
-
const iframeStart = response.split(
|
|
24
|
-
/<iframe style="width: 99%; height: 500px" src="|<iframe style="width: 99%; height: 500px; background-color:Canvas;" src=/
|
|
25
|
-
)[1]
|
|
26
|
-
const jsonUrl = iframeStart
|
|
27
|
-
? iframeStart.split(/"><\/iframe>|><\/iframe>/)[0]
|
|
28
|
-
: null
|
|
29
|
-
|
|
30
|
-
if (jsonUrl) {
|
|
31
|
-
return requestClient
|
|
32
|
-
.get(serverUrl + jsonUrl, undefined, 'text/plain')
|
|
33
|
-
.then((res: any) => getValidJson(res.result))
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Fallback: some Viya configurations inline the webout via a
|
|
37
|
-
// script-constructed Blob instead of an iframe src URL, e.g. when the
|
|
38
|
-
// _debug=128 format is served on a path expecting the older _debug=131
|
|
39
|
-
// iframe-URL format.
|
|
40
|
-
const blobResult = extractWeboutBlob(response)
|
|
41
|
-
if (blobResult !== null) return blobResult
|
|
42
|
-
|
|
43
|
-
throw new Error(
|
|
44
|
-
'Unable to find webout content - no iframe URL and no inline blob.'
|
|
45
|
-
)
|
|
46
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { extractWeboutBlob } from './extractWeboutBlob'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* When querying a Viya job using the Web approach with _DEBUG=128 (used when
|
|
5
|
-
* runAsTask is true), the webout JSON is inlined into the response via a
|
|
6
|
-
* script-constructed Blob - see extractWeboutBlob for the exact shapes
|
|
7
|
-
* handled. No follow-up request is needed — extract and parse the JSON
|
|
8
|
-
* directly.
|
|
9
|
-
*/
|
|
10
|
-
export const parseSasViyaLogDebugResponse = async (response: any) => {
|
|
11
|
-
// If upstream already parsed the response as JSON (object), pass through.
|
|
12
|
-
if (typeof response !== 'string') {
|
|
13
|
-
return response
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const result = extractWeboutBlob(response)
|
|
17
|
-
if (result === null) {
|
|
18
|
-
throw new Error('Unable to find webout blob in debug log response.')
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return result
|
|
22
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { WeboutResponseError } from '../types/errors'
|
|
2
|
-
|
|
3
|
-
export const parseWeboutResponse = (response: string, url?: string): string => {
|
|
4
|
-
let sasResponse = ''
|
|
5
|
-
|
|
6
|
-
if (response.includes('>>weboutBEGIN<<')) {
|
|
7
|
-
try {
|
|
8
|
-
sasResponse = response
|
|
9
|
-
.split('>>weboutBEGIN<<')[1]
|
|
10
|
-
.split('>>weboutEND<<')[0]
|
|
11
|
-
} catch (e: any) {
|
|
12
|
-
if (url) throw new WeboutResponseError(url)
|
|
13
|
-
|
|
14
|
-
sasResponse = ''
|
|
15
|
-
console.error(e)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return sasResponse
|
|
20
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dictionary should contain only languages in SAS where `logout` text
|
|
3
|
-
* is represented with more then one word
|
|
4
|
-
*/
|
|
5
|
-
const dictionary = ['Log Off']
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Extracts user full name assuming the first word after "title" means log off if not found otherwise in the dictionary
|
|
9
|
-
* @param response SAS response content
|
|
10
|
-
* @returns user full name
|
|
11
|
-
*/
|
|
12
|
-
export const extractUserLongNameSas9 = (response: string) => {
|
|
13
|
-
const regex = /"title":\s?".*?"/
|
|
14
|
-
|
|
15
|
-
const matched = response?.match(regex)
|
|
16
|
-
let fullName = matched?.[0].split(':')[1].trim()
|
|
17
|
-
let breakIndex = fullName?.indexOf(' ')
|
|
18
|
-
|
|
19
|
-
if (!fullName) return 'unknown'
|
|
20
|
-
|
|
21
|
-
dictionary.map((logoutWord) => {
|
|
22
|
-
const index = fullName?.indexOf(logoutWord) || -1
|
|
23
|
-
|
|
24
|
-
if (index > -1) {
|
|
25
|
-
breakIndex = index + logoutWord.length
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
//Cut only name
|
|
30
|
-
return fullName.slice(breakIndex, -1).trim()
|
|
31
|
-
}
|
package/src/utils/serialize.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const serialize = (obj: any) => {
|
|
2
|
-
const str: any[] = []
|
|
3
|
-
for (const p in obj) {
|
|
4
|
-
if (obj.hasOwnProperty(p)) {
|
|
5
|
-
if (obj[p] instanceof Array) {
|
|
6
|
-
for (let i = 0, n = obj[p].length; i < n; i++) {
|
|
7
|
-
str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p][i]))
|
|
8
|
-
}
|
|
9
|
-
} else {
|
|
10
|
-
str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p]))
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return str.join('&')
|
|
15
|
-
}
|
package/src/utils/splitChunks.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const splitChunks = (content: string) => {
|
|
2
|
-
const size = 16000
|
|
3
|
-
|
|
4
|
-
const numChunks = Math.ceil(content.length / size)
|
|
5
|
-
const chunks = new Array(numChunks)
|
|
6
|
-
|
|
7
|
-
for (let i = 0, o = 0; i < numChunks; ++i, o += size) {
|
|
8
|
-
chunks[i] = content.substr(o, size)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return chunks
|
|
12
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
export const MORE_INFO =
|
|
2
|
-
'For more info see https://sasjs.io/sasjs-adapter/#request-response'
|
|
3
|
-
export const INVALID_TABLE_STRUCTURE = `Parameter data contains invalid table structure. ${MORE_INFO}`
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This function validates the input data structure and table naming convention
|
|
7
|
-
*
|
|
8
|
-
* @param data A json object that contains one or more tables, it can also be null
|
|
9
|
-
* @returns An object which contains two attributes: 1) status: boolean, 2) msg: string
|
|
10
|
-
*/
|
|
11
|
-
export const validateInput = (
|
|
12
|
-
data: { [key: string]: any } | null
|
|
13
|
-
): {
|
|
14
|
-
status: boolean
|
|
15
|
-
msg: string
|
|
16
|
-
} => {
|
|
17
|
-
if (data === null) return { status: true, msg: '' }
|
|
18
|
-
|
|
19
|
-
if (getType(data) !== 'object') {
|
|
20
|
-
return {
|
|
21
|
-
status: false,
|
|
22
|
-
msg: INVALID_TABLE_STRUCTURE
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const isSasFormatsTable = (key: string) =>
|
|
27
|
-
key.match(/^\$.*/) && Object.keys(data).includes(key.replace(/^\$/, ''))
|
|
28
|
-
|
|
29
|
-
for (const key in data) {
|
|
30
|
-
if (!key.match(/^[a-zA-Z_]/) && !isSasFormatsTable(key)) {
|
|
31
|
-
return {
|
|
32
|
-
status: false,
|
|
33
|
-
msg: 'First letter of table should be alphabet or underscore.'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (!key.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/) && !isSasFormatsTable(key)) {
|
|
38
|
-
return { status: false, msg: 'Table name should be alphanumeric.' }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (key.length > 32) {
|
|
42
|
-
return {
|
|
43
|
-
status: false,
|
|
44
|
-
msg: 'Maximum length for table name could be 32 characters.'
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (getType(data[key]) !== 'Array' && !isSasFormatsTable(key)) {
|
|
49
|
-
return {
|
|
50
|
-
status: false,
|
|
51
|
-
msg: INVALID_TABLE_STRUCTURE
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ES6 is stricter so we had to include the check for the array
|
|
56
|
-
if (Array.isArray(data[key])) {
|
|
57
|
-
for (const item of data[key]) {
|
|
58
|
-
if (getType(item) !== 'object') {
|
|
59
|
-
return {
|
|
60
|
-
status: false,
|
|
61
|
-
msg: `Table ${key} contains invalid structure. ${MORE_INFO}`
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
const attributes = Object.keys(item)
|
|
65
|
-
for (const attribute of attributes) {
|
|
66
|
-
if (item[attribute] === undefined) {
|
|
67
|
-
return {
|
|
68
|
-
status: false,
|
|
69
|
-
msg: `A row in table ${key} contains invalid value. Can't assign undefined to ${attribute}.`
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return { status: true, msg: '' }
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* this function returns the type of variable
|
|
83
|
-
*
|
|
84
|
-
* @param data it could be anything, like string, array, object etc.
|
|
85
|
-
* @returns a string which tells the type of input parameter
|
|
86
|
-
*/
|
|
87
|
-
const getType = (data: any): string => {
|
|
88
|
-
if (Array.isArray(data)) {
|
|
89
|
-
return 'Array'
|
|
90
|
-
} else {
|
|
91
|
-
return typeof data
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/test/SAS_server_app.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const app: import("express-serve-static-core").Express;
|
|
2
|
-
export declare const mockedAuthResponse: {
|
|
3
|
-
access_token: string;
|
|
4
|
-
token_type: string;
|
|
5
|
-
id_token: string;
|
|
6
|
-
refresh_token: string;
|
|
7
|
-
expires_in: number;
|
|
8
|
-
scope: string;
|
|
9
|
-
jti: string;
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/Tables.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|