-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api/test improvements, package updates
- Loading branch information
1 parent
36cb239
commit 6258f6f
Showing
20 changed files
with
1,054 additions
and
876 deletions.
There are no files selected for viewing
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,35 @@ | ||
name: Publish | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Cache pnpm modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 6.0.2 | ||
run_install: true | ||
- run: npm run build | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- run: npx conventional-github-releaser -p angular | ||
env: | ||
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"arrowParens": "always", | ||
"printWidth": 90 | ||
} |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"editor.tabSize": 2 | ||
} | ||
"editor.tabSize": 2, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
} |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
preset: 'ts-jest/presets/js-with-ts-esm', | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: './tsconfig.spec.json', | ||
}, | ||
}, | ||
transformIgnorePatterns: [], | ||
testEnvironment: 'node', | ||
}; |
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 |
---|---|---|
@@ -1,81 +1,93 @@ | ||
|
||
|
||
export type RequestInterceptor = (config: Object) => Promise<Object>; | ||
export type ResponseInterceptor = (response: Response) => Promise<Response>; | ||
export type ResponseInterceptor<T> = (response: T) => Promise<T>; | ||
|
||
export type RequestParams = | ||
| string | ||
| URLSearchParams | ||
| string[][] | ||
| Record<string, string | number | undefined | null> | ||
| undefined; | ||
|
||
export type RequestParams = string | URLSearchParams | string[][] | Record<string, string> | undefined; | ||
export type ResolvedRequestParams = | ||
| string | ||
| URLSearchParams | ||
| string[][] | ||
| Record<string, string> | ||
| undefined; | ||
|
||
export interface FetchApiOptions { | ||
export interface FetchApiOptions<ResponseType = Response> { | ||
/** | ||
* API base URL prepended to requests | ||
* @default '' | ||
*/ | ||
baseUrl?: string | ||
baseUrl?: string; | ||
|
||
/** | ||
* Default request timeout | ||
* @default 10000 | ||
*/ | ||
timeout?: number | ||
timeout?: number; | ||
|
||
/** | ||
* Request interceptors | ||
*/ | ||
requestInterceptors?: RequestInterceptor | RequestInterceptor[] | ||
requestInterceptors?: RequestInterceptor | RequestInterceptor[]; | ||
|
||
/** | ||
* Response interceptors | ||
*/ | ||
responseInterceptors?: ResponseInterceptor | ResponseInterceptor[] | ||
responseInterceptors?: | ||
| ResponseInterceptor<ResponseType> | ||
| ResponseInterceptor<ResponseType>[]; | ||
} | ||
|
||
export interface BasicAuth { | ||
/** | ||
* Basic Auth username | ||
*/ | ||
username: string | ||
username: string; | ||
|
||
/** | ||
* Basic Auth password | ||
*/ | ||
password: string | ||
password: string; | ||
} | ||
|
||
export interface FetchApiConfig { | ||
/** | ||
* The URL passed to `fetch` | ||
* @default '' | ||
*/ | ||
url?: string | ||
url?: string; | ||
|
||
/** | ||
* If present, `data` is stringified and used as `body` | ||
* Headers for JSON data are automatically included: | ||
* { Accept: 'application/json', 'Content-Type': 'application/json' } | ||
* | ||
* | ||
* WARNING - if preset, `body`, `headers['Accept']`, and `headers['Content-Type']` are overridden | ||
*/ | ||
data?: Object | ||
data?: Object; | ||
|
||
/** | ||
* URL parameters appended to `url` using URLSearchParams | ||
*/ | ||
params?: RequestParams, | ||
params?: RequestParams; | ||
|
||
/** | ||
* Convenience option for providing Basic Auth headers | ||
* Overrides headers: | ||
* `headers['Authorization'] = \`Basic ${btoa(\`${auth.username}:${auth.password}\`)}\`` | ||
* ` | ||
*/ | ||
auth?: BasicAuth | ||
auth?: BasicAuth; | ||
|
||
/** | ||
* Timeout in milliseconds. Falls back to global config timeout | ||
* Overrides `signal` | ||
* @default 10000 | ||
*/ | ||
timeout?: number | ||
timeout?: number; | ||
} | ||
|
||
export type FetchRequestConfig = FetchApiConfig & RequestInit; |
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
Oops, something went wrong.