-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from codex-team/impr-event-type
chore(types): improve event type
- Loading branch information
Showing
11 changed files
with
68 additions
and
31 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 |
---|---|---|
|
@@ -8,13 +8,13 @@ jobs: | |
CI_JOB_NUMBER: 1 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js 12.x | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
node-version: 16.x | ||
- run: yarn install | ||
- run: yarn lint-test | ||
# - uses: andresz1/[email protected] | ||
# with: | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# skip_step: build | ||
# skip_step: build |
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 |
---|---|---|
@@ -1,12 +1,6 @@ | ||
import 'regenerator-runtime/runtime'; | ||
import Catcher from './catcher'; | ||
import { HawkInitialSettings, AffectedUser } from './types/hawk-initial-settings'; | ||
import { HawkJavaScriptEvent } from './types/event'; | ||
export { AffectedUser } from '@hawk.so/types'; | ||
export * from './types'; | ||
|
||
export default Catcher; | ||
|
||
export { | ||
HawkInitialSettings, | ||
AffectedUser, | ||
HawkJavaScriptEvent | ||
}; |
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,6 +1,50 @@ | ||
import type { EventData, JavaScriptAddons } from '@hawk.so/types'; | ||
|
||
/** | ||
* Event data with JS specific addons | ||
*/ | ||
type JSEventData = EventData<JavaScriptAddons>; | ||
|
||
/** | ||
* Event will be sent to Hawk by Hawk JavaScript SDK | ||
* | ||
* The listed EventData properties will always be sent, so we define them as required in the type | ||
*/ | ||
export type HawkJavaScriptEvent = EventData<JavaScriptAddons>; | ||
export type HawkJavaScriptEvent = Omit<JSEventData, 'type' | 'release' | 'user' | 'context' | 'addons' | 'backtrace' | 'catcherVersion'> & { | ||
/** | ||
* Event type: TypeError, ReferenceError etc | ||
*/ | ||
type: JSEventData['type']; | ||
|
||
/** | ||
* Current release (aka version, revision) of an application | ||
*/ | ||
release: JSEventData['release'] | null; | ||
|
||
/** | ||
* Current authenticated user | ||
*/ | ||
user: JSEventData['user'] | null; | ||
|
||
/** | ||
* Any other information collected and passed by user | ||
*/ | ||
context: JSEventData['context']; | ||
|
||
/** | ||
* | ||
* Catcher-specific information | ||
*/ | ||
addons: JSEventData['addons']; | ||
|
||
/** | ||
* Stack | ||
* From the latest call to the earliest | ||
*/ | ||
backtrace: JSEventData['backtrace'] | null; | ||
|
||
/** | ||
* Catcher version | ||
*/ | ||
catcherVersion: JSEventData['catcherVersion']; | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
Size: 7.3 KB with all dependencies, minified and gzipped | ||
Size: 7.37 KB with all dependencies, minified and gzipped | ||
|