-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactory pipeline configurations / remove ip-filter dependency
- Loading branch information
1 parent
f4e7a5d
commit 2702762
Showing
70 changed files
with
1,775 additions
and
926 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
export class SdkError extends Error { | ||
private statusCode: number; | ||
constructor(message: string, code: number) { | ||
super(message); | ||
this.statusCode = code; | ||
Object.setPrototypeOf(this, SdkError.prototype); | ||
} | ||
|
||
get code(): number { | ||
return this.statusCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
|
||
import * as Joi from 'joi'; | ||
import { ValidationError } from './errors'; | ||
|
||
/** | ||
* A [jsonata](https://www.npmjs.com/package/jsonata) expression, used by core interceptors | ||
* to transform responses. | ||
*/ | ||
export interface JSONAtaExpression { | ||
/** | ||
* The jsonata expressio | ||
*/ | ||
expression: string; | ||
} | ||
|
||
const jsonataExpressionSchema = Joi.object().keys({ | ||
expression: Joi.string().required() | ||
}); | ||
|
||
export function validateJsonAtaExpression(config: JSONAtaExpression) { | ||
const result = Joi.validate(config, jsonataExpressionSchema); | ||
if (result.error) { | ||
throw new ValidationError(result.error); | ||
} else { | ||
return result.value; | ||
} | ||
} |
Oops, something went wrong.