From dc98ce3b0bea36bdb59e15d9bfe053a8bc68533f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 7 May 2021 19:37:13 +0000 Subject: [PATCH 01/21] 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] --- package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 221a360..659c723 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3426,9 +3426,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "html-encoding-sniffer": { @@ -6357,7 +6357,8 @@ }, "hosted-git-info": { "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, "requires": { "lru-cache": "^6.0.0" From 50d1b4d8241444773b2cddb1e4bc2f08838dc7d5 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Mon, 10 May 2021 11:05:53 +0000 Subject: [PATCH 02/21] fix: increasing timeout, closes #657 --- src/SASViyaApiClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 5150524..d2dea33 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1103,7 +1103,7 @@ export class SASViyaApiClient { const { result: state } = await this.requestClient .get( - `${this.serverUrl}${stateLink.href}?_action=wait&wait=30`, + `${this.serverUrl}${stateLink.href}?_action=wait&wait=300`, accessToken, 'text/plain', {}, @@ -1130,7 +1130,7 @@ export class SASViyaApiClient { if (stateLink) { const { result: jobState } = await this.requestClient .get( - `${this.serverUrl}${stateLink.href}?_action=wait&wait=30`, + `${this.serverUrl}${stateLink.href}?_action=wait&wait=300`, accessToken, 'text/plain', {}, From 67c7147e62d1fb111648dbdcafea4435fe443b71 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Mon, 10 May 2021 11:13:39 +0000 Subject: [PATCH 03/21] fix: lint updates --- src/ContextManager.ts | 4 +--- src/SASViyaApiClient.ts | 23 ++++++++++------------- src/SessionManager.ts | 5 +---- src/job-execution/WebJobExecutor.ts | 6 ++---- src/request/RequestClient.ts | 11 +++++------ src/test/utils/isUrl.spec.ts | 4 ++-- 6 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/ContextManager.ts b/src/ContextManager.ts index 3c15ff5..eec0dff 100644 --- a/src/ContextManager.ts +++ b/src/ContextManager.ts @@ -314,9 +314,7 @@ export class ContextManager { contextId: string, accessToken?: string ): Promise { - const { - result: context - } = await this.requestClient + const { result: context } = await this.requestClient .get( `${this.serverUrl}/compute/contexts/${contextId}`, accessToken diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index d2dea33..8b526c2 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -594,16 +594,15 @@ export class SASViyaApiClient { } } - const { - result: createFolderResponse - } = await this.requestClient.post( - `/folders/folders?parentFolderUri=${parentFolderUri}`, - { - name: folderName, - type: 'folder' - }, - accessToken - ) + const { result: createFolderResponse } = + await this.requestClient.post( + `/folders/folders?parentFolderUri=${parentFolderUri}`, + { + name: folderName, + type: 'folder' + }, + accessToken + ) // update folder map with newly created folder. await this.populateFolderMap( @@ -875,9 +874,7 @@ export class SASViyaApiClient { throw new Error(`URI of job definition was not found.`) } - const { - result: jobDefinition - } = await this.requestClient + const { result: jobDefinition } = await this.requestClient .get( `${this.serverUrl}${jobDefinitionLink.href}`, accessToken diff --git a/src/SessionManager.ts b/src/SessionManager.ts index 3c780dd..2120471 100644 --- a/src/SessionManager.ts +++ b/src/SessionManager.ts @@ -91,10 +91,7 @@ export class SessionManager { } private async createAndWaitForSession(accessToken?: string) { - const { - result: createdSession, - etag - } = await this.requestClient + const { result: createdSession, etag } = await this.requestClient .post( `${this.serverUrl}/compute/contexts/${ this.currentContext!.id diff --git a/src/job-execution/WebJobExecutor.ts b/src/job-execution/WebJobExecutor.ts index 816c6d7..61f215c 100644 --- a/src/job-execution/WebJobExecutor.ts +++ b/src/job-execution/WebJobExecutor.ts @@ -71,10 +71,8 @@ export class WebJobExecutor extends BaseJobExecutor { } else { // param based approach try { - const { - formData: newFormData, - requestParams: params - } = generateTableUploadForm(formData, data) + const { formData: newFormData, requestParams: params } = + generateTableUploadForm(formData, data) formData = newFormData requestParams = { ...requestParams, ...params } } catch (e) { diff --git a/src/request/RequestClient.ts b/src/request/RequestClient.ts index c55060b..c38d506 100644 --- a/src/request/RequestClient.ts +++ b/src/request/RequestClient.ts @@ -214,9 +214,8 @@ export class RequestClient implements HttpClient { const headers = this.getHeaders(accessToken, 'application/json') if (this.fileUploadCsrfToken?.value) { - headers[ - this.fileUploadCsrfToken.headerName - ] = this.fileUploadCsrfToken.value + headers[this.fileUploadCsrfToken.headerName] = + this.fileUploadCsrfToken.value } try { @@ -333,9 +332,9 @@ export class RequestClient implements HttpClient { } private parseCsrfToken = (response: AxiosResponse): CsrfToken | undefined => { - const tokenHeader = (response.headers[ - 'x-csrf-header' - ] as string)?.toLowerCase() + const tokenHeader = ( + response.headers['x-csrf-header'] as string + )?.toLowerCase() if (tokenHeader) { const token = response.headers[tokenHeader] diff --git a/src/test/utils/isUrl.spec.ts b/src/test/utils/isUrl.spec.ts index 4ff92a9..928048c 100644 --- a/src/test/utils/isUrl.spec.ts +++ b/src/test/utils/isUrl.spec.ts @@ -28,12 +28,12 @@ describe('urlValidator', () => { it('should return false when the URL is 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', () => { const url = undefined - expect(isUrl((url as unknown) as string)).toEqual(false) + expect(isUrl(url as unknown as string)).toEqual(false) }) }) From 98114c5591b329750a03147b2dd2427a957d2066 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 11 May 2021 08:23:40 +0100 Subject: [PATCH 04/21] fix(job-state-poll): Continue polling for job state despite errored requests --- src/SASViyaApiClient.ts | 42 +++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 8b526c2..87aded9 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -594,15 +594,16 @@ export class SASViyaApiClient { } } - const { result: createFolderResponse } = - await this.requestClient.post( - `/folders/folders?parentFolderUri=${parentFolderUri}`, - { - name: folderName, - type: 'folder' - }, - accessToken - ) + const { + result: createFolderResponse + } = await this.requestClient.post( + `/folders/folders?parentFolderUri=${parentFolderUri}`, + { + name: folderName, + type: 'folder' + }, + accessToken + ) // update folder map with newly created folder. await this.populateFolderMap( @@ -874,7 +875,9 @@ export class SASViyaApiClient { throw new Error(`URI of job definition was not found.`) } - const { result: jobDefinition } = await this.requestClient + const { + result: jobDefinition + } = await this.requestClient .get( `${this.serverUrl}${jobDefinitionLink.href}`, accessToken @@ -1107,7 +1110,11 @@ export class SASViyaApiClient { this.debug ) .catch((err) => { - throw prefixMessage(err, 'Error while getting job state. ') + console.error( + 'Error fetching job state. Starting poll, assuming job to be running.', + err + ) + return { result: 'running' } }) const currentState = state.trim() @@ -1134,10 +1141,17 @@ export class SASViyaApiClient { this.debug ) .catch((err) => { - throw prefixMessage( - err, - 'Error while getting job state after interval. ' + if (pollCount >= MAX_POLL_COUNT) { + throw prefixMessage( + err, + 'Error while getting job state after interval. ' + ) + } + console.error( + 'Error fetching job state. Resuming poll, assuming job to be running.', + err ) + return { result: 'running' } }) postedJobState = jobState.trim() From 15a774ff81109244be1eb209b0b1619b53d0f4fb Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 11 May 2021 08:29:15 +0100 Subject: [PATCH 05/21] chore(*): print URL when polling job state --- src/SASViyaApiClient.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 87aded9..95e5ef8 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1101,6 +1101,9 @@ export class SASViyaApiClient { Promise.reject(`Job state link was not found.`) } + console.log( + `Attempting to poll job state from ${this.serverUrl}${stateLink.href}` + ) const { result: state } = await this.requestClient .get( `${this.serverUrl}${stateLink.href}?_action=wait&wait=300`, From ad8dbfd4ec92f73c64e24a71478742f82c18071e Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 11 May 2021 08:57:35 +0100 Subject: [PATCH 06/21] chore(*): add URL to logs --- src/SASViyaApiClient.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 95e5ef8..4e3b5ba 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1101,9 +1101,6 @@ export class SASViyaApiClient { Promise.reject(`Job state link was not found.`) } - console.log( - `Attempting to poll job state from ${this.serverUrl}${stateLink.href}` - ) const { result: state } = await this.requestClient .get( `${this.serverUrl}${stateLink.href}?_action=wait&wait=300`, @@ -1114,7 +1111,7 @@ export class SASViyaApiClient { ) .catch((err) => { console.error( - 'Error fetching job state. Starting poll, assuming job to be running.', + `Error fetching job state from ${this.serverUrl}${stateLink.href}. Starting poll, assuming job to be running.`, err ) return { result: 'running' } @@ -1151,7 +1148,7 @@ export class SASViyaApiClient { ) } console.error( - 'Error fetching job state. Resuming poll, assuming job to be running.', + `Error fetching job state from ${this.serverUrl}${stateLink.href}. Resuming poll, assuming job to be running.`, err ) return { result: 'running' } From e03ec996d618860e98c65cd60bf5052677bf54f2 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 11 May 2021 09:25:17 +0100 Subject: [PATCH 07/21] chore(*): fix formatting --- src/SASViyaApiClient.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 4e3b5ba..4f64e0d 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -594,16 +594,15 @@ export class SASViyaApiClient { } } - const { - result: createFolderResponse - } = await this.requestClient.post( - `/folders/folders?parentFolderUri=${parentFolderUri}`, - { - name: folderName, - type: 'folder' - }, - accessToken - ) + const { result: createFolderResponse } = + await this.requestClient.post( + `/folders/folders?parentFolderUri=${parentFolderUri}`, + { + name: folderName, + type: 'folder' + }, + accessToken + ) // update folder map with newly created folder. await this.populateFolderMap( @@ -875,9 +874,7 @@ export class SASViyaApiClient { throw new Error(`URI of job definition was not found.`) } - const { - result: jobDefinition - } = await this.requestClient + const { result: jobDefinition } = await this.requestClient .get( `${this.serverUrl}${jobDefinitionLink.href}`, accessToken From c1b200b0d8e74b820582ec0755251dbd08103622 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 11 May 2021 10:12:11 +0100 Subject: [PATCH 08/21] fix(job-state-poll): error out after max consecutive errors --- src/SASViyaApiClient.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 4f64e0d..6bcdf5b 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1078,6 +1078,7 @@ export class SASViyaApiClient { ) { let POLL_INTERVAL = 300 let MAX_POLL_COUNT = 1000 + let MAX_ERROR_COUNT = 10 if (pollOptions) { POLL_INTERVAL = pollOptions.POLL_INTERVAL || POLL_INTERVAL @@ -1086,6 +1087,7 @@ export class SASViyaApiClient { let postedJobState = '' let pollCount = 0 + let errorCount = 0 const headers: any = { 'Content-Type': 'application/json', 'If-None-Match': etag @@ -1111,7 +1113,7 @@ export class SASViyaApiClient { `Error fetching job state from ${this.serverUrl}${stateLink.href}. Starting poll, assuming job to be running.`, err ) - return { result: 'running' } + return { result: 'unavailable' } }) const currentState = state.trim() @@ -1126,7 +1128,8 @@ export class SASViyaApiClient { if ( postedJobState === 'running' || postedJobState === '' || - postedJobState === 'pending' + postedJobState === 'pending' || + postedJobState === 'unavailable' ) { if (stateLink) { const { result: jobState } = await this.requestClient @@ -1138,7 +1141,10 @@ export class SASViyaApiClient { this.debug ) .catch((err) => { - if (pollCount >= MAX_POLL_COUNT) { + if ( + pollCount >= MAX_POLL_COUNT || + errorCount >= MAX_ERROR_COUNT + ) { throw prefixMessage( err, 'Error while getting job state after interval. ' @@ -1148,10 +1154,13 @@ export class SASViyaApiClient { `Error fetching job state from ${this.serverUrl}${stateLink.href}. Resuming poll, assuming job to be running.`, err ) - return { result: 'running' } + return { result: 'unavailable' } }) postedJobState = jobState.trim() + if (postedJobState != 'unavailable' && errorCount > 0) { + errorCount = 0 + } if (this.debug && printedState !== postedJobState) { console.log('Polling job status...') From 67ec27bab7734db5b1007bfb80c26bdeed3306d1 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 11 May 2021 10:20:28 +0100 Subject: [PATCH 09/21] chore(*): increment error count --- src/SASViyaApiClient.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 6bcdf5b..9e85702 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1141,6 +1141,7 @@ export class SASViyaApiClient { this.debug ) .catch((err) => { + errorCount++ if ( pollCount >= MAX_POLL_COUNT || errorCount >= MAX_ERROR_COUNT From 8f3a7f33f82a85251bef02717de486f66848bbad Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Tue, 11 May 2021 10:23:47 +0100 Subject: [PATCH 10/21] chore(*): reduce max error count --- src/SASViyaApiClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 9e85702..72e9fa6 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1078,7 +1078,7 @@ export class SASViyaApiClient { ) { let POLL_INTERVAL = 300 let MAX_POLL_COUNT = 1000 - let MAX_ERROR_COUNT = 10 + let MAX_ERROR_COUNT = 5 if (pollOptions) { POLL_INTERVAL = pollOptions.POLL_INTERVAL || POLL_INTERVAL From 53a7b1c9e60df68a2ad77554d540e37c28d99df2 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Thu, 13 May 2021 17:29:48 +0300 Subject: [PATCH 11/21] fix(request): returned response with log --- src/job-execution/JesJobExecutor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/job-execution/JesJobExecutor.ts b/src/job-execution/JesJobExecutor.ts index 60cf52f..42d22a4 100644 --- a/src/job-execution/JesJobExecutor.ts +++ b/src/job-execution/JesJobExecutor.ts @@ -33,7 +33,7 @@ export class JesJobExecutor extends BaseJobExecutor { .then((response) => { this.appendRequest(response, sasJob, config.debug) - resolve(response.result) + resolve(response) }) .catch(async (e: Error) => { if (e instanceof JobExecutionError) { From 75120424d03f54190e58dddf9908b5694a784993 Mon Sep 17 00:00:00 2001 From: Allan Bowe <4420615+allanbowe@users.noreply.github.com> Date: Sat, 15 May 2021 15:05:49 +0300 Subject: [PATCH 12/21] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 146 ++++++++++++++++++++++++++++++--------------- 1 file changed, 99 insertions(+), 47 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c93e457..83067b1 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,75 +2,127 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. ## Our Standards -Examples of behavior that contributes to creating a positive environment -include: +Examples of behavior that contributes to a positive environment for our +community include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + 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 - advances -* Trolling, insulting/derogatory comments, and personal or political attacks +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission +* Publishing others' private information, such as a physical or email + address, without their explicit permission * 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 -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. ## Scope -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, 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 -further defined and clarified by project maintainers. +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at support@macropeople.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +reported to the community leaders responsible for enforcement at +https://sasapps.io/contact-us. +All complaints will be reviewed and investigated promptly and fairly. -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## 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 -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +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 -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. From 4c67665b4d69a6a3873d3c31e58e509ad61d2afd Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 16 May 2021 13:52:13 +0300 Subject: [PATCH 13/21] fix: adding npmignore (should reduce the bundle size from 8.88mb) --- .npmignore | 4 ++++ LICENSE | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..ddbab98 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +sasjs-tests/ +docs/ +.github/ +CONTRIBUTING.md diff --git a/LICENSE b/LICENSE index 6765f8e..0f743d6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ 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 of this software and associated documentation files (the "Software"), to deal From 15f4065cd82c1875e6239f3dc1f9053a09bfb20c Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 16 May 2021 20:25:56 +0300 Subject: [PATCH 14/21] fix: metadata updates (readme, changelog, url in package.json) --- CHANGELOG.md | 4 ++++ README.md | 9 ++++++++- package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd6756..7680af8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # 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. diff --git a/README.md b/README.md index 9833c9c..98a8aa2 100644 --- a/README.md +++ b/README.md @@ -198,8 +198,15 @@ This approach is by far the fastest, as a result of the optimisations we have bu # More resources -For more information and examples specific to this adapter you can check out the [user guide](https://sasjs.io/sasjs-adapter/) or the [technical](http://adapter.sasjs.io/) documentation. +For more information and examples specific to this adapter you can check out the [user guide](https://sasjs.io/sasjs-adapter/) or the [technical](http://adapter.sasjs.io/) documentation. 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. + + +## Star Gazing + +If you find this library useful, help us grow our star graph! + +![](https://starchart.cc/sasjs/core.svg) \ No newline at end of file diff --git a/package.json b/package.json index 5d8e0f2..bac1142 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "author": "Allan Bowe ", "repository": { "type": "git", - "url": "https://github.com/sasjs/adapter" + "url": "https://adapter.sasjs.io" }, "license": "ISC", "devDependencies": { From 7a5adebdb58573f5c6e89dcd2abc8a96977cfc1e Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 16 May 2021 21:40:14 +0300 Subject: [PATCH 15/21] fix: metadata in package.json --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bac1142..eb0f0f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@sasjs/adapter", "description": "JavaScript adapter for SAS", + "homepage": "https://adapter.sasjs.io", "scripts": { "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", @@ -32,7 +33,7 @@ "author": "Allan Bowe ", "repository": { "type": "git", - "url": "https://adapter.sasjs.io" + "url": "https://github.com/sasjs/adapter" }, "license": "ISC", "devDependencies": { From e309e7a4f4d7b7b85309fa1d42da7f20b60a97c4 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 16 May 2021 21:56:26 +0300 Subject: [PATCH 16/21] fix: readme badges --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 98a8aa2..87dbcf7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,24 @@ # @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) +![total lines](https://tokei.rs/b1/github/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: 1 - `npm install @sasjs/adapter` - for use in a node project @@ -209,4 +227,4 @@ If you are a SAS 9 or SAS Viya customer you can also request a copy of [Data Con If you find this library useful, help us grow our star graph! -![](https://starchart.cc/sasjs/core.svg) \ No newline at end of file +![](https://starchart.cc/sasjs/adapter.svg) \ No newline at end of file From 7e17aa6eb3a0650a86887fc6175a39819fe4c01d Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 16 May 2021 22:00:10 +0300 Subject: [PATCH 17/21] chore: automated commit --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 87dbcf7..eacfda5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![](https://data.jsdelivr.com/v1/package/npm/@sasjs/adapter/badge)](https://www.jsdelivr.com/package/npm/@sasjs/adapter) - # @sasjs/adapter [![npm package][npm-image]][npm-url] From ed9648fdf91784e3380c516c79d8677da63e8656 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 16 May 2021 22:02:23 +0300 Subject: [PATCH 18/21] chore: automated commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eacfda5..9d267fd 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ![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) -![total lines](https://tokei.rs/b1/github/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) From 01ca29fc0117df7c39542ee5a5198a0ebc20a854 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Thu, 20 May 2021 08:22:40 +0300 Subject: [PATCH 19/21] feat(git): enabled git hook enforcing conventional commits --- .git-hooks/commit-msg | 18 ++++++++++++++++++ package.json | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 .git-hooks/commit-msg diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg new file mode 100755 index 0000000..e0297de --- /dev/null +++ b/.git-hooks/commit-msg @@ -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 \ No newline at end of file diff --git a/package.json b/package.json index eb0f0f5..cf3515c 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "prepublishOnly": "cp -r ./build/* . && rm -rf ./build", "postpublish": "git clean -fd", "semantic-release": "semantic-release", - "typedoc": "typedoc" + "typedoc": "typedoc", + "postinstall": "[ -d .git ] && git config core.hooksPath ./.git-hooks || true" }, "publishConfig": { "access": "public" From b0570e1cd915f1aa9fc5d23735d5371345951ad7 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Wed, 26 May 2021 11:23:08 +0300 Subject: [PATCH 20/21] chore: automated commit --- sasjs-tests/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sasjs-tests/README.md b/sasjs-tests/README.md index b2698ba..4a7f87b 100644 --- a/sasjs-tests/README.md +++ b/sasjs-tests/README.md @@ -55,6 +55,7 @@ filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas"; %inc mc; filename ft15f001 temp; parmcards4; + %webout(FETCH) %webout(OPEN) %macro x(); %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) parmcards4; + %webout(FETCH) %webout(OPEN) %macro x(); %do i=1 %to &_webin_file_count; %webout(ARR,&&_webin_name&i) %end; From ba91c29ba8e488a3a1ac421cfe3c3e06619928e6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 26 May 2021 08:24:56 +0000 Subject: [PATCH 21/21] chore(deps): [security] bump browserslist from 4.16.4 to 4.16.6 Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.4 to 4.16.6. **This update includes a security fix.** - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](https://github.com/browserslist/browserslist/compare/4.16.4...4.16.6) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 659c723..07967d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1812,22 +1812,28 @@ "dev": true }, "browserslist": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.4.tgz", - "integrity": "sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001208", + "caniuse-lite": "^1.0.30001219", "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.712", + "electron-to-chromium": "^1.3.723", "escalade": "^3.1.1", "node-releases": "^1.1.71" }, "dependencies": { - "colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "caniuse-lite": { + "version": "1.0.30001230", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz", + "integrity": "sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.739", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz", + "integrity": "sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A==", "dev": true } } @@ -1947,12 +1953,6 @@ "quick-lru": "^4.0.1" } }, - "caniuse-lite": { - "version": "1.0.30001208", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", - "integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==", - "dev": true - }, "capture-exit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", @@ -2580,12 +2580,6 @@ "safer-buffer": "^2.1.0" } }, - "electron-to-chromium": { - "version": "1.3.717", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.717.tgz", - "integrity": "sha512-OfzVPIqD1MkJ7fX+yTl2nKyOE4FReeVfMCzzxQS+Kp43hZYwHwThlGP+EGIZRXJsxCM7dqo8Y65NOX/HP12iXQ==", - "dev": true - }, "emittery": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz",