diff --git a/sasjs-tests/package-lock.json b/sasjs-tests/package-lock.json index d198432..7b45515 100644 --- a/sasjs-tests/package-lock.json +++ b/sasjs-tests/package-lock.json @@ -2005,12 +2005,15 @@ }, "@sasjs/adapter": { "version": "file:../build/sasjs-adapter-5.0.0.tgz", - "integrity": "sha512-DxoQbdJqzqOTIuT7qwSfAbmNTWdpOx5zGkiMuZBSwoi9lSsRNoARiWnJq5Vl6h4RXJlc/FVdBFt35RZm4Mc0ZQ==", + "integrity": "sha512-1GSSoHt6MumQQ0Y080PA4PCHJ1vRpkx+Syi3Io6poQzOGrYM6Z4lQFilXsdoogPdcfgO5po9OX1dr7AM0hKugQ==", "requires": { - "@sasjs/utils": "^2.10.2", + "@sasjs/utils": "^2.17.1", "axios": "^0.21.1", + "axios-cookiejar-support": "^1.0.1", "form-data": "^4.0.0", - "https": "^1.0.0" + "https": "^1.0.0", + "tough-cookie": "^4.0.0", + "url": "^0.11.0" }, "dependencies": { "form-data": { @@ -2022,6 +2025,21 @@ "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } + }, + "tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" } } }, @@ -2046,14 +2064,15 @@ } }, "@sasjs/utils": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-2.12.1.tgz", - "integrity": "sha512-6gZS5zW0J70P7XaVuEczyfHVaVa8Ks/aWr4PIlpJcxWD0enJtCEmos2DdnezdSoNvODkPq/8rzMPqko5jaXK1Q==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-2.18.0.tgz", + "integrity": "sha512-6VTbRP1KU0gGi1mSIHl+XyL9Vqk8rBW7a7VQOF6vzD+AVgfgYd0t76djAUCcA7Dos8NJXAoDUuah+iNvXJY+cw==", "requires": { "@types/prompts": "^2.0.11", "chalk": "^4.1.1", "cli-table": "^0.3.6", "consola": "^2.15.0", + "fs-extra": "^10.0.0", "prompts": "^2.4.1", "valid-url": "^1.0.9" }, @@ -2088,6 +2107,16 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2422,9 +2451,9 @@ "integrity": "sha512-6gOkRe7OIioWAXfnO/2lFiv+SJichKVSys1mSsgyrYHSEjk8Ctv4tSR/Odvnu+HWlH2C8j53dahU03XmQdd5fA==" }, "@types/prompts": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.0.11.tgz", - "integrity": "sha512-dcF5L3rU9VfpLEJIV++FEyhGhuIpJllNEwllVuJ5g8eoVqjf048tW9+spivIwjzgPbtaGAl7mIZW3cmhDAq2UQ==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.0.12.tgz", + "integrity": "sha512-Hr6osqfNg3IcQT3pJDXCsSnb0KnldY/hXeJCKJriwbZLnedN9n1e8kcZwLc25GIWULDb6h5aEyOBbf33XpZBXQ==", "requires": { "@types/node": "*" } @@ -3467,6 +3496,22 @@ "follow-redirects": "^1.10.0" } }, + "axios-cookiejar-support": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/axios-cookiejar-support/-/axios-cookiejar-support-1.0.1.tgz", + "integrity": "sha512-IZJxnAJ99XxiLqNeMOqrPbfR7fRyIfaoSLdPUf4AMQEGkH8URs0ghJK/xtqBsD+KsSr3pKl4DEQjCn834pHMig==", + "requires": { + "is-redirect": "^1.0.0", + "pify": "^5.0.0" + }, + "dependencies": { + "pify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz", + "integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==" + } + } + }, "axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -8557,6 +8602,11 @@ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=" }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" + }, "is-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", diff --git a/sasjs-tests/src/testSuites/Basic.ts b/sasjs-tests/src/testSuites/Basic.ts index e1b5887..a352fdb 100644 --- a/sasjs-tests/src/testSuites/Basic.ts +++ b/sasjs-tests/src/testSuites/Basic.ts @@ -145,6 +145,22 @@ export const basicTests = ( sasjsConfig.debug === false ) } + }, + { + title: 'Request with extra attributes on JES approach', + description: + 'Should complete successful request with extra attributes present in response', + test: async () => { + const config = { + useComputeApi: false + } + + return await adapter.request('common/sendArr', stringData, config, undefined, undefined, ['output', 'file', 'data']) + }, + assertion: (response: any) => { + const responseKeys: any = Object.keys(response) + return responseKeys.includes('file') && responseKeys.includes('output') && responseKeys.includes('data') + } } ] })