1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-13 02:04:36 +00:00

Compare commits

...

39 Commits

Author SHA1 Message Date
sabir_hassan
591e1ebc09 fix: callback type checking fixes #304 2021-05-27 21:59:40 +05:00
Allan Bowe
bd19457c2a Merge branch 'master' of github.com:sasjs/adapter 2021-05-26 11:23:13 +03:00
Allan Bowe
b0570e1cd9 chore: automated commit 2021-05-26 11:23:08 +03:00
Allan Bowe
a5f1b59f7b Merge pull request #374 from sasjs/git-hooks
feat(git): enabled git hook enforcing conventional commits
2021-05-20 09:23:25 +03:00
Yury Shkoda
01ca29fc01 feat(git): enabled git hook enforcing conventional commits 2021-05-20 08:22:40 +03:00
Allan Bowe
ed9648fdf9 chore: automated commit 2021-05-16 22:02:23 +03:00
Allan Bowe
7e17aa6eb3 chore: automated commit 2021-05-16 22:00:10 +03:00
Allan Bowe
9caee9941a Merge pull request #371 from sasjs/qualityfixes
fix: readme badges
2021-05-16 21:59:15 +03:00
Allan Bowe
e309e7a4f4 fix: readme badges 2021-05-16 21:56:26 +03:00
Allan Bowe
c47441d6d4 Merge pull request #370 from sasjs/qualityfixes
fix: metadata in package.json
2021-05-16 21:41:11 +03:00
Allan Bowe
1844bc48ac Merge branch 'master' into qualityfixes 2021-05-16 21:40:40 +03:00
Allan Bowe
7a5adebdb5 fix: metadata in package.json 2021-05-16 21:40:14 +03:00
Allan Bowe
b39f0c577b Merge pull request #369 from sasjs/qualityfixes
Qualityfixes
2021-05-16 21:34:55 +03:00
Allan Bowe
15f4065cd8 fix: metadata updates (readme, changelog, url in package.json) 2021-05-16 20:25:56 +03:00
Allan Bowe
4c67665b4d fix: adding npmignore (should reduce the bundle size from 8.88mb) 2021-05-16 13:52:13 +03:00
Allan Bowe
76d0b82b4c Merge pull request #363 from sasjs/allanbowe-patch-1
Create CODE_OF_CONDUCT.md
2021-05-15 15:15:04 +03:00
Allan Bowe
95d65d270d Merge branch 'master' into allanbowe-patch-1 2021-05-15 15:10:33 +03:00
Allan Bowe
4e5c9c1ccd Merge pull request #354 from sasjs/dependabot/npm_and_yarn/hosted-git-info-2.8.9
chore(deps): [security] bump hosted-git-info from 2.8.8 to 2.8.9
2021-05-15 15:10:18 +03:00
Allan Bowe
3267af0724 Merge branch 'master' into dependabot/npm_and_yarn/hosted-git-info-2.8.9 2021-05-15 15:07:06 +03:00
Allan Bowe
75120424d0 Create CODE_OF_CONDUCT.md 2021-05-15 15:05:49 +03:00
Yury Shkoda
f13c7e5cf1 Merge pull request #362 from sasjs/request-fix
fix(request): returned response with log
2021-05-13 18:40:50 +03:00
Yury Shkoda
53a7b1c9e6 fix(request): returned response with log 2021-05-13 17:29:48 +03:00
Allan Bowe
8c30cbff13 Merge pull request #359 from sasjs/retry-state-error
fix(job-state-poll): Continue poll regardless of errors
2021-05-11 12:26:16 +03:00
Krishna Acondy
8f3a7f33f8 chore(*): reduce max error count 2021-05-11 10:23:47 +01:00
Krishna Acondy
67ec27bab7 chore(*): increment error count 2021-05-11 10:20:28 +01:00
Krishna Acondy
c1b200b0d8 fix(job-state-poll): error out after max consecutive errors 2021-05-11 10:12:11 +01:00
Krishna Acondy
e03ec996d6 chore(*): fix formatting 2021-05-11 09:25:17 +01:00
Krishna Acondy
ad8dbfd4ec chore(*): add URL to logs 2021-05-11 08:57:35 +01:00
Krishna Acondy
15a774ff81 chore(*): print URL when polling job state 2021-05-11 08:29:15 +01:00
Krishna Acondy
98114c5591 fix(job-state-poll): Continue polling for job state despite errored requests 2021-05-11 08:23:40 +01:00
Muhammad Saad
dffcb66d54 Merge pull request #356 from sasjs/issue657
fix: increasing timeout, closes #657
2021-05-10 16:17:14 +05:00
Allan Bowe
67c7147e62 fix: lint updates 2021-05-10 11:13:39 +00:00
Allan Bowe
50d1b4d824 fix: increasing timeout, closes #657 2021-05-10 11:05:53 +00:00
dependabot-preview[bot]
dc98ce3b0b chore(deps): [security] bump hosted-git-info from 2.8.8 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. **This update includes a security fix.**
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-05-07 19:37:13 +00:00
Krishna Acondy
cf1e3f3835 Merge pull request #350 from sasjs/dependabot/npm_and_yarn/ts-loader-9.1.2
chore(deps-dev): bump ts-loader from 8.1.0 to 9.1.2
2021-05-07 08:54:25 +01:00
Krishna Acondy
2f913e9363 Merge branch 'master' into dependabot/npm_and_yarn/ts-loader-9.1.2 2021-05-07 08:52:16 +01:00
Krishna Acondy
05a9864df8 Merge pull request #353 from sasjs/dependabot/npm_and_yarn/webpack-cli-4.7.0
chore(deps-dev): bump webpack-cli from 4.5.0 to 4.7.0
2021-05-07 08:51:53 +01:00
dependabot-preview[bot]
3a0d764dfa chore(deps-dev): bump webpack-cli from 4.5.0 to 4.7.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.5.0 to 4.7.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.5.0...webpack-cli@4.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-05-07 07:41:45 +00:00
dependabot-preview[bot]
310087b895 chore(deps-dev): bump ts-loader from 8.1.0 to 9.1.2
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.1.0 to 9.1.2.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v8.1.0...v9.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-05-07 07:41:36 +00:00
17 changed files with 284 additions and 224 deletions

18
.git-hooks/commit-msg Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
RED="\033[1;31m"
GREEN="\033[1;32m"
# Get the commit message (the parameter we're given is just the path to the
# temporary file which holds the message).
commit_message=$(cat "$1")
if (echo "$commit_message" | grep -Eq "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z \-]+\))?!?: .+$") then
echo "${GREEN} ✔ Commit message meets Conventional Commit standards"
exit 0
fi
echo "${RED}❌ Commit message does not meet the Conventional Commit standard!"
echo "An example of a valid message is:"
echo " feat(login): add the 'remember me' button"
echo " More details at: https://www.conventionalcommits.org/en/v1.0.0/#summary"
exit 1

4
.npmignore Normal file
View File

@@ -0,0 +1,4 @@
sasjs-tests/
docs/
.github/
CONTRIBUTING.md

View File

@@ -1,5 +1,9 @@
# Change Log # Change Log
Since March 2020 the changelog is managed by github releases - see [https://github.com/sasjs/adapter/releases](https://github.com/sasjs/adapter/releases).
## Changes up to 5th March 2020
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="1.9.0"></a> <a name="1.9.0"></a>

View File

@@ -2,75 +2,127 @@
## Our Pledge ## Our Pledge
In the interest of fostering an open and welcoming environment, we as We as members, contributors, and leaders pledge to make participation in our
contributors and maintainers pledge to making participation in our project and community a harassment-free experience for everyone, regardless of age, body
our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender
size, disability, ethnicity, sex characteristics, gender identity and expression, identity and expression, level of experience, education, socio-economic status,
level of experience, education, socio-economic status, nationality, personal nationality, personal appearance, race, religion, or sexual identity
appearance, race, religion, or sexual identity and orientation. and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards ## Our Standards
Examples of behavior that contributes to creating a positive environment Examples of behavior that contributes to a positive environment for our
include: community include:
* Using welcoming and inclusive language * Demonstrating empathy and kindness toward other people
* Being respectful of differing viewpoints and experiences * Being respectful of differing opinions, viewpoints, and experiences
* Gracefully accepting constructive criticism * Giving and gracefully accepting constructive feedback
* Focusing on what is best for the community * Accepting responsibility and apologizing to those affected by our mistakes,
* Showing empathy towards other community members and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior by participants include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery and unwelcome sexual attention or * The use of sexualized language or imagery, and sexual attention or
advances advances of any kind
* Trolling, insulting/derogatory comments, and personal or political attacks * Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment * Public or private harassment
* Publishing others' private information, such as a physical or electronic * Publishing others' private information, such as a physical or email
address, without explicit permission address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a * Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Our Responsibilities ## Enforcement Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable Community leaders are responsible for clarifying and enforcing our standards of
behavior and are expected to take appropriate and fair corrective action in acceptable behavior and will take appropriate and fair corrective action in
response to any instances of unacceptable behavior. response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Project maintainers have the right and responsibility to remove, edit, or Community leaders have the right and responsibility to remove, edit, or reject
reject comments, commits, code, wiki edits, issues, and other contributions comments, commits, code, wiki edits, issues, and other contributions that are
that are not aligned to this Code of Conduct, or to ban temporarily or not aligned to this Code of Conduct, and will communicate reasons for moderation
permanently any contributor for other behaviors that they deem inappropriate, decisions when appropriate.
threatening, offensive, or harmful.
## Scope ## Scope
This Code of Conduct applies both within project spaces and in public spaces This Code of Conduct applies within all community spaces, and also applies when
when an individual is representing the project or its community. Examples of an individual is officially representing the community in public spaces.
representing a project or community include using an official project e-mail Examples of representing our community include using an official e-mail address,
address, posting via an official social media account, or acting as an appointed posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be representative at an online or offline event.
further defined and clarified by project maintainers.
## Enforcement ## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at support@macropeople.com. All reported to the community leaders responsible for enforcement at
complaints will be reviewed and investigated and will result in a response that https://sasapps.io/contact-us.
is deemed necessary and appropriate to the circumstances. The project team is All complaints will be reviewed and investigated promptly and fairly.
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good All community leaders are obligated to respect the privacy and security of the
faith may face temporary or permanent repercussions as determined by other reporter of any incident.
members of the project's leadership.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, This Code of Conduct is adapted from the [Contributor Covenant][homepage],
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org [homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2020 Macro People Copyright (c) 2021 Macro People
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,7 +1,23 @@
[![](https://data.jsdelivr.com/v1/package/npm/@sasjs/adapter/badge)](https://www.jsdelivr.com/package/npm/@sasjs/adapter)
# @sasjs/adapter # @sasjs/adapter
[![npm package][npm-image]][npm-url]
[![Github Workflow][githubworkflow-image]][githubworkflow-url]
[![Dependency Status][dependency-image]][dependency-url]
[![npm](https://img.shields.io/npm/dt/@sasjs/adapter)]()
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/@sasjs/adapter)
[![License](https://img.shields.io/apm/l/atomic-design-ui.svg)](/LICENSE)
![GitHub top language](https://img.shields.io/github/languages/top/sasjs/adapter)
![GitHub issues](https://img.shields.io/github/issues/sasjs/adapter)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/sasjs/adapter)
[npm-image]:https://img.shields.io/npm/v/@sasjs/adapter.svg
[npm-url]:http://npmjs.org/package/@sasjs/adapter
[githubworkflow-image]:https://github.com/sasjs/adapter/actions/workflows/build.yml/badge.svg
[githubworkflow-url]:https://github.com/sasjs/adapter/blob/main/.github/workflows/build.yml
[dependency-image]:https://david-dm.org/sasjs/adapter.svg
[dependency-url]:https://github.com/sasjs/adapter/blob/main/package.json
SASjs is a open-source framework for building Web Apps on SAS® platforms. You can use as much or as little of it as you like. This repository contains the JS adapter, the part that handles the to/from SAS communication on the client side. There are 3 ways to install it: SASjs is a open-source framework for building Web Apps on SAS® platforms. You can use as much or as little of it as you like. This repository contains the JS adapter, the part that handles the to/from SAS communication on the client side. There are 3 ways to install it:
1 - `npm install @sasjs/adapter` - for use in a node project 1 - `npm install @sasjs/adapter` - for use in a node project
@@ -203,3 +219,10 @@ For more information and examples specific to this adapter you can check out the
For more information on building web apps in general, check out these [resources](https://sasjs.io/training/resources/) or contact the [author](https://www.linkedin.com/in/allanbowe/) directly. For more information on building web apps in general, check out these [resources](https://sasjs.io/training/resources/) or contact the [author](https://www.linkedin.com/in/allanbowe/) directly.
If you are a SAS 9 or SAS Viya customer you can also request a copy of [Data Controller](https://datacontroller.io) - free for up to 5 users, this tool makes use of all parts of the SASjs framework. If you are a SAS 9 or SAS Viya customer you can also request a copy of [Data Controller](https://datacontroller.io) - free for up to 5 users, this tool makes use of all parts of the SASjs framework.
## Star Gazing
If you find this library useful, help us grow our star graph!
![](https://starchart.cc/sasjs/adapter.svg)

159
package-lock.json generated
View File

@@ -1363,24 +1363,24 @@
} }
}, },
"@webpack-cli/configtest": { "@webpack-cli/configtest": {
"version": "1.0.1", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz",
"integrity": "sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ==", "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==",
"dev": true "dev": true
}, },
"@webpack-cli/info": { "@webpack-cli/info": {
"version": "1.2.2", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.2.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz",
"integrity": "sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ==", "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==",
"dev": true, "dev": true,
"requires": { "requires": {
"envinfo": "^7.7.3" "envinfo": "^7.7.3"
} }
}, },
"@webpack-cli/serve": { "@webpack-cli/serve": {
"version": "1.3.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.3.0.tgz", "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz",
"integrity": "sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw==", "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==",
"dev": true "dev": true
}, },
"@xtuc/ieee754": { "@xtuc/ieee754": {
@@ -1470,12 +1470,6 @@
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true "dev": true
}, },
"ansi-colors": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
"dev": true
},
"ansi-escapes": { "ansi-escapes": {
"version": "4.3.1", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz",
@@ -1786,12 +1780,6 @@
"integrity": "sha512-/6FKxSTWoJdbsLDF8tdIjaRiFXiE6UHsEHE3OPI/cwPURCVi1ukP0gmLn7XWEiFk5TcwQjjY5PWsU+j+tgXgmw==", "integrity": "sha512-/6FKxSTWoJdbsLDF8tdIjaRiFXiE6UHsEHE3OPI/cwPURCVi1ukP0gmLn7XWEiFk5TcwQjjY5PWsU+j+tgXgmw==",
"dev": true "dev": true
}, },
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true
},
"bottleneck": { "bottleneck": {
"version": "2.19.5", "version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
@@ -2136,9 +2124,9 @@
"dev": true "dev": true
}, },
"colorette": { "colorette": {
"version": "1.2.1", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
"integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
"dev": true "dev": true
}, },
"colors": { "colors": {
@@ -2610,12 +2598,6 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true "dev": true
}, },
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true
},
"end-of-stream": { "end-of-stream": {
"version": "1.4.4", "version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
@@ -2626,23 +2608,13 @@
} }
}, },
"enhanced-resolve": { "enhanced-resolve": {
"version": "4.5.0", "version": "5.8.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz",
"integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"graceful-fs": "^4.1.2", "graceful-fs": "^4.2.4",
"memory-fs": "^0.5.0", "tapable": "^2.2.0"
"tapable": "^1.0.0"
}
},
"enquirer": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
"integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==",
"dev": true,
"requires": {
"ansi-colors": "^4.1.1"
} }
}, },
"env-ci": { "env-ci": {
@@ -2731,20 +2703,11 @@
} }
}, },
"envinfo": { "envinfo": {
"version": "7.7.4", "version": "7.8.1",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.4.tgz", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz",
"integrity": "sha512-TQXTYFVVwwluWSFis6K2XKxgrD22jEv0FTuLCQI+OjH7rn93+iY0fSSFM5lrSxFY+H1+B0/cvvlamr3UsBivdQ==", "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==",
"dev": true "dev": true
}, },
"errno": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
"integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==",
"dev": true,
"requires": {
"prr": "~1.0.1"
}
},
"error-ex": { "error-ex": {
"version": "1.3.2", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@@ -3463,9 +3426,9 @@
"dev": true "dev": true
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "2.8.8", "version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
"dev": true "dev": true
}, },
"html-encoding-sniffer": { "html-encoding-sniffer": {
@@ -5053,17 +5016,6 @@
"integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==",
"dev": true "dev": true
}, },
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"locate-path": { "locate-path": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -5213,16 +5165,6 @@
"supports-hyperlinks": "^2.1.0" "supports-hyperlinks": "^2.1.0"
} }
}, },
"memory-fs": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz",
"integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==",
"dev": true,
"requires": {
"errno": "^0.1.3",
"readable-stream": "^2.0.1"
}
},
"meow": { "meow": {
"version": "8.1.2", "version": "8.1.2",
"resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz",
@@ -6415,7 +6357,8 @@
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "4.0.2", "version": "4.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz",
"integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -8040,12 +7983,6 @@
"sisteransi": "^1.0.5" "sisteransi": "^1.0.5"
} }
}, },
"prr": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
"integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=",
"dev": true
},
"psl": { "psl": {
"version": "1.8.0", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
@@ -9389,9 +9326,9 @@
"dev": true "dev": true
}, },
"tapable": { "tapable": {
"version": "1.1.3", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz",
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==",
"dev": true "dev": true
}, },
"tar": { "tar": {
@@ -9681,14 +9618,13 @@
} }
}, },
"ts-loader": { "ts-loader": {
"version": "8.1.0", "version": "9.1.2",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.1.0.tgz", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.1.2.tgz",
"integrity": "sha512-YiQipGGAFj2zBfqLhp28yUvPP9jUGqHxRzrGYuc82Z2wM27YIHbElXiaZDc93c3x0mz4zvBmS6q/DgExpdj37A==", "integrity": "sha512-ryMgATvLLl+z8zQvdlm6Pep0slmwxFWIEnq/5VdiLVjqQXnFJgO+qNLGIIP+d2N2jsFZ9MibZCVDb2bSp7OmEA==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^4.1.0", "chalk": "^4.1.0",
"enhanced-resolve": "^4.0.0", "enhanced-resolve": "^5.0.0",
"loader-utils": "^2.0.0",
"micromatch": "^4.0.0", "micromatch": "^4.0.0",
"semver": "^7.3.4" "semver": "^7.3.4"
}, },
@@ -10076,9 +10012,9 @@
"optional": true "optional": true
}, },
"v8-compile-cache": { "v8-compile-cache": {
"version": "2.2.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
"integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
"dev": true "dev": true
}, },
"v8-to-istanbul": { "v8-to-istanbul": {
@@ -10264,18 +10200,17 @@
} }
}, },
"webpack-cli": { "webpack-cli": {
"version": "4.5.0", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.5.0.tgz", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.0.tgz",
"integrity": "sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q==", "integrity": "sha512-7bKr9182/sGfjFm+xdZSwgQuFjgEcy0iCTIBxRUeteJ2Kr8/Wz0qNJX+jw60LU36jApt4nmMkep6+W5AKhok6g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@discoveryjs/json-ext": "^0.5.0", "@discoveryjs/json-ext": "^0.5.0",
"@webpack-cli/configtest": "^1.0.1", "@webpack-cli/configtest": "^1.0.3",
"@webpack-cli/info": "^1.2.2", "@webpack-cli/info": "^1.2.4",
"@webpack-cli/serve": "^1.3.0", "@webpack-cli/serve": "^1.4.0",
"colorette": "^1.2.1", "colorette": "^1.2.1",
"commander": "^7.0.0", "commander": "^7.0.0",
"enquirer": "^2.3.6",
"execa": "^5.0.0", "execa": "^5.0.0",
"fastest-levenshtein": "^1.0.12", "fastest-levenshtein": "^1.0.12",
"import-local": "^3.0.2", "import-local": "^3.0.2",
@@ -10286,9 +10221,9 @@
}, },
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "7.1.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==", "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true "dev": true
}, },
"cross-spawn": { "cross-spawn": {
@@ -10320,9 +10255,9 @@
} }
}, },
"get-stream": { "get-stream": {
"version": "6.0.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
"integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
"dev": true "dev": true
}, },
"human-signals": { "human-signals": {

View File

@@ -1,6 +1,7 @@
{ {
"name": "@sasjs/adapter", "name": "@sasjs/adapter",
"description": "JavaScript adapter for SAS", "description": "JavaScript adapter for SAS",
"homepage": "https://adapter.sasjs.io",
"scripts": { "scripts": {
"build": "rimraf build && rimraf node && mkdir node && cp -r src/* node && webpack && rimraf build/src && rimraf node", "build": "rimraf build && rimraf node && mkdir node && cp -r src/* node && webpack && rimraf build/src && rimraf node",
"package:lib": "npm run build && cp ./package.json build && cd build && npm version \"5.0.0\" && npm pack", "package:lib": "npm run build && cp ./package.json build && cd build && npm version \"5.0.0\" && npm pack",
@@ -11,7 +12,8 @@
"prepublishOnly": "cp -r ./build/* . && rm -rf ./build", "prepublishOnly": "cp -r ./build/* . && rm -rf ./build",
"postpublish": "git clean -fd", "postpublish": "git clean -fd",
"semantic-release": "semantic-release", "semantic-release": "semantic-release",
"typedoc": "typedoc" "typedoc": "typedoc",
"postinstall": "[ -d .git ] && git config core.hooksPath ./.git-hooks || true"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
@@ -46,7 +48,7 @@
"semantic-release": "^17.4.2", "semantic-release": "^17.4.2",
"terser-webpack-plugin": "^4.2.3", "terser-webpack-plugin": "^4.2.3",
"ts-jest": "^25.5.1", "ts-jest": "^25.5.1",
"ts-loader": "^8.1.0", "ts-loader": "^9.1.2",
"tslint": "^6.1.3", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0", "tslint-config-prettier": "^1.18.0",
"typedoc": "^0.20.35", "typedoc": "^0.20.35",
@@ -54,7 +56,7 @@
"typedoc-plugin-external-module-name": "^4.0.6", "typedoc-plugin-external-module-name": "^4.0.6",
"typescript": "^3.9.9", "typescript": "^3.9.9",
"webpack": "^5.33.2", "webpack": "^5.33.2",
"webpack-cli": "^4.5.0" "webpack-cli": "^4.7.0"
}, },
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {

View File

@@ -55,6 +55,7 @@ filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc; %inc mc;
filename ft15f001 temp; filename ft15f001 temp;
parmcards4; parmcards4;
%webout(FETCH)
%webout(OPEN) %webout(OPEN)
%macro x(); %macro x();
%do i=1 %to &_webin_file_count; %webout(OBJ,&&_webin_name&i) %end; %do i=1 %to &_webin_file_count; %webout(OBJ,&&_webin_name&i) %end;
@@ -63,6 +64,7 @@ parmcards4;
;;;; ;;;;
%mm_createwebservice(path=/Public/app/common,name=sendObj) %mm_createwebservice(path=/Public/app/common,name=sendObj)
parmcards4; parmcards4;
%webout(FETCH)
%webout(OPEN) %webout(OPEN)
%macro x(); %macro x();
%do i=1 %to &_webin_file_count; %webout(ARR,&&_webin_name&i) %end; %do i=1 %to &_webin_file_count; %webout(ARR,&&_webin_name&i) %end;

View File

@@ -314,9 +314,7 @@ export class ContextManager {
contextId: string, contextId: string,
accessToken?: string accessToken?: string
): Promise<ContextAllAttributes> { ): Promise<ContextAllAttributes> {
const { const { result: context } = await this.requestClient
result: context
} = await this.requestClient
.get<ContextAllAttributes>( .get<ContextAllAttributes>(
`${this.serverUrl}/compute/contexts/${contextId}`, `${this.serverUrl}/compute/contexts/${contextId}`,
accessToken accessToken

View File

@@ -594,16 +594,15 @@ export class SASViyaApiClient {
} }
} }
const { const { result: createFolderResponse } =
result: createFolderResponse await this.requestClient.post<Folder>(
} = await this.requestClient.post<Folder>( `/folders/folders?parentFolderUri=${parentFolderUri}`,
`/folders/folders?parentFolderUri=${parentFolderUri}`, {
{ name: folderName,
name: folderName, type: 'folder'
type: 'folder' },
}, accessToken
accessToken )
)
// update folder map with newly created folder. // update folder map with newly created folder.
await this.populateFolderMap( await this.populateFolderMap(
@@ -875,9 +874,7 @@ export class SASViyaApiClient {
throw new Error(`URI of job definition was not found.`) throw new Error(`URI of job definition was not found.`)
} }
const { const { result: jobDefinition } = await this.requestClient
result: jobDefinition
} = await this.requestClient
.get<JobDefinition>( .get<JobDefinition>(
`${this.serverUrl}${jobDefinitionLink.href}`, `${this.serverUrl}${jobDefinitionLink.href}`,
accessToken accessToken
@@ -1081,6 +1078,7 @@ export class SASViyaApiClient {
) { ) {
let POLL_INTERVAL = 300 let POLL_INTERVAL = 300
let MAX_POLL_COUNT = 1000 let MAX_POLL_COUNT = 1000
let MAX_ERROR_COUNT = 5
if (pollOptions) { if (pollOptions) {
POLL_INTERVAL = pollOptions.POLL_INTERVAL || POLL_INTERVAL POLL_INTERVAL = pollOptions.POLL_INTERVAL || POLL_INTERVAL
@@ -1089,6 +1087,7 @@ export class SASViyaApiClient {
let postedJobState = '' let postedJobState = ''
let pollCount = 0 let pollCount = 0
let errorCount = 0
const headers: any = { const headers: any = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'If-None-Match': etag 'If-None-Match': etag
@@ -1103,14 +1102,18 @@ export class SASViyaApiClient {
const { result: state } = await this.requestClient const { result: state } = await this.requestClient
.get<string>( .get<string>(
`${this.serverUrl}${stateLink.href}?_action=wait&wait=30`, `${this.serverUrl}${stateLink.href}?_action=wait&wait=300`,
accessToken, accessToken,
'text/plain', 'text/plain',
{}, {},
this.debug this.debug
) )
.catch((err) => { .catch((err) => {
throw prefixMessage(err, 'Error while getting job state. ') console.error(
`Error fetching job state from ${this.serverUrl}${stateLink.href}. Starting poll, assuming job to be running.`,
err
)
return { result: 'unavailable' }
}) })
const currentState = state.trim() const currentState = state.trim()
@@ -1125,25 +1128,40 @@ export class SASViyaApiClient {
if ( if (
postedJobState === 'running' || postedJobState === 'running' ||
postedJobState === '' || postedJobState === '' ||
postedJobState === 'pending' postedJobState === 'pending' ||
postedJobState === 'unavailable'
) { ) {
if (stateLink) { if (stateLink) {
const { result: jobState } = await this.requestClient const { result: jobState } = await this.requestClient
.get<string>( .get<string>(
`${this.serverUrl}${stateLink.href}?_action=wait&wait=30`, `${this.serverUrl}${stateLink.href}?_action=wait&wait=300`,
accessToken, accessToken,
'text/plain', 'text/plain',
{}, {},
this.debug this.debug
) )
.catch((err) => { .catch((err) => {
throw prefixMessage( errorCount++
err, if (
'Error while getting job state after interval. ' pollCount >= MAX_POLL_COUNT ||
errorCount >= MAX_ERROR_COUNT
) {
throw prefixMessage(
err,
'Error while getting job state after interval. '
)
}
console.error(
`Error fetching job state from ${this.serverUrl}${stateLink.href}. Resuming poll, assuming job to be running.`,
err
) )
return { result: 'unavailable' }
}) })
postedJobState = jobState.trim() postedJobState = jobState.trim()
if (postedJobState != 'unavailable' && errorCount > 0) {
errorCount = 0
}
if (this.debug && printedState !== postedJobState) { if (this.debug && printedState !== postedJobState) {
console.log('Polling job status...') console.log('Polling job status...')

View File

@@ -550,31 +550,41 @@ export default class SASjs {
...this.sasjsConfig, ...this.sasjsConfig,
...config ...config
} }
if (
if (config.serverType === ServerType.SasViya && config.contextName) { typeof loginRequiredCallback === 'function' ||
if (config.useComputeApi) { typeof loginRequiredCallback === 'undefined'
return await this.computeJobExecutor!.execute( ) {
sasJob, if (config.serverType === ServerType.SasViya && config.contextName) {
data, if (config.useComputeApi) {
config, return await this.computeJobExecutor!.execute(
loginRequiredCallback, sasJob,
accessToken data,
) config,
loginRequiredCallback,
accessToken
)
} else {
return await this.jesJobExecutor!.execute(
sasJob,
data,
config,
loginRequiredCallback,
accessToken
)
}
} else { } else {
return await this.jesJobExecutor!.execute( return await this.webJobExecutor!.execute(
sasJob, sasJob,
data, data,
config, config,
loginRequiredCallback, loginRequiredCallback
accessToken
) )
} }
} else { } else {
return await this.webJobExecutor!.execute( return Promise.reject(
sasJob, new ErrorResponse(
data, `Invalid loginRequiredCallback parameter was provided. Expected Callback function but found ${typeof loginRequiredCallback}`
config, )
loginRequiredCallback
) )
} }
} }

View File

@@ -91,10 +91,7 @@ export class SessionManager {
} }
private async createAndWaitForSession(accessToken?: string) { private async createAndWaitForSession(accessToken?: string) {
const { const { result: createdSession, etag } = await this.requestClient
result: createdSession,
etag
} = await this.requestClient
.post<Session>( .post<Session>(
`${this.serverUrl}/compute/contexts/${ `${this.serverUrl}/compute/contexts/${
this.currentContext!.id this.currentContext!.id

View File

@@ -33,7 +33,7 @@ export class JesJobExecutor extends BaseJobExecutor {
.then((response) => { .then((response) => {
this.appendRequest(response, sasJob, config.debug) this.appendRequest(response, sasJob, config.debug)
resolve(response.result) resolve(response)
}) })
.catch(async (e: Error) => { .catch(async (e: Error) => {
if (e instanceof JobExecutionError) { if (e instanceof JobExecutionError) {

View File

@@ -71,10 +71,8 @@ export class WebJobExecutor extends BaseJobExecutor {
} else { } else {
// param based approach // param based approach
try { try {
const { const { formData: newFormData, requestParams: params } =
formData: newFormData, generateTableUploadForm(formData, data)
requestParams: params
} = generateTableUploadForm(formData, data)
formData = newFormData formData = newFormData
requestParams = { ...requestParams, ...params } requestParams = { ...requestParams, ...params }
} catch (e) { } catch (e) {

View File

@@ -214,9 +214,8 @@ export class RequestClient implements HttpClient {
const headers = this.getHeaders(accessToken, 'application/json') const headers = this.getHeaders(accessToken, 'application/json')
if (this.fileUploadCsrfToken?.value) { if (this.fileUploadCsrfToken?.value) {
headers[ headers[this.fileUploadCsrfToken.headerName] =
this.fileUploadCsrfToken.headerName this.fileUploadCsrfToken.value
] = this.fileUploadCsrfToken.value
} }
try { try {
@@ -333,9 +332,9 @@ export class RequestClient implements HttpClient {
} }
private parseCsrfToken = (response: AxiosResponse): CsrfToken | undefined => { private parseCsrfToken = (response: AxiosResponse): CsrfToken | undefined => {
const tokenHeader = (response.headers[ const tokenHeader = (
'x-csrf-header' response.headers['x-csrf-header'] as string
] as string)?.toLowerCase() )?.toLowerCase()
if (tokenHeader) { if (tokenHeader) {
const token = response.headers[tokenHeader] const token = response.headers[tokenHeader]

View File

@@ -28,12 +28,12 @@ describe('urlValidator', () => {
it('should return false when the URL is null', () => { it('should return false when the URL is null', () => {
const url = null const url = null
expect(isUrl((url as unknown) as string)).toEqual(false) expect(isUrl(url as unknown as string)).toEqual(false)
}) })
it('should return false when the URL is undefined', () => { it('should return false when the URL is undefined', () => {
const url = undefined const url = undefined
expect(isUrl((url as unknown) as string)).toEqual(false) expect(isUrl(url as unknown as string)).toEqual(false)
}) })
}) })