Skip to content

Commit 999f3cc

Browse files
authored
Bobbyg603/issue19 (#40)
* Adds Crashes client support * Fixes TODO in e2e test Fixes #19 * Removes unused import from table data client * Removes TODO that had already been addressed * Addresses todo in crashes api row * Removes non-existent event property from crashes api row * Cleans up imports Adds tsconfig paths. Adds index files to export public types. * Lint fixes
1 parent 599040c commit 999f3cc

File tree

58 files changed

+1127
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1127
-131
lines changed

β€Žpackage-lock.jsonβ€Ž

Lines changed: 80 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.jsonβ€Ž

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
],
1010
"scripts": {
1111
"pretest": "npm run lint:fix",
12-
"test": "ts-node node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.spec.json",
13-
"test:teamcity": "ts-node node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.teamcity.spec.json",
12+
"test": "ts-node -r tsconfig-paths/register node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.spec.json",
13+
"test:teamcity": "ts-node -r tsconfig-paths/register node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.teamcity.spec.json",
1414
"lint": "eslint . --ext .js,.ts",
1515
"lint:fix": "npm run lint -- --fix",
16-
"e2e": "ts-node node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.e2e.json",
17-
"e2e:teamcity": "ts-node node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.teamcity.e2e.json",
16+
"e2e": "ts-node -r tsconfig-paths/register node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.e2e.json",
17+
"e2e:teamcity": "ts-node -r tsconfig-paths/register node_modules/jasmine/bin/jasmine --config=spec/support/jasmine.teamcity.e2e.json",
1818
"release": "npm run build && npm publish --access public",
1919
"build": "npm run build:cjs && npm run build:esm",
2020
"build:cjs": "tsc -p tsconfig.cjs.json",
@@ -48,6 +48,7 @@
4848
"jasmine": "^3.7.0",
4949
"jasmine-reporters": "^2.4.0",
5050
"ts-node": "^10.0.0",
51-
"typescript": "^4.2.4"
51+
"tsconfig-paths": "^3.11.0",
52+
"typescript": "^4.4.3"
5253
}
5354
}

β€Žspec/fakes/crash/crash-api-response.tsβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { GroupableThreadCollection, ProcessingStatus } from '../../../src/crash';
2-
import { EventType } from '../../../src/events/events-api-client/events-api-client';
3-
import { createFakeEvents } from '../events/events';
1+
import { GroupableThreadCollection, ProcessingStatus } from '@crash';
2+
import { EventType } from '@events';
3+
import { createFakeEvents } from '@spec/fakes/events/events';
44

55
export const createFakeCrashApiResponse = () => ({
66
processed: ProcessingStatus.Complete,
File renamed without changes.

β€Žsrc/common/bugsplat-api-client.e2e.tsβ€Ž renamed to β€Žsrc/common/client/bugsplat-api-client.e2e.tsβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { BugSplatApiClient } from '.';
2-
import { config } from '../../spec/config';
1+
import { BugSplatApiClient } from '@common';
2+
import { config } from '@spec/config';
33

44
describe('BugSplatApiClient', () => {
55
let client: BugSplatApiClient;
@@ -22,7 +22,7 @@ describe('BugSplatApiClient', () => {
2222
try {
2323
await client.login(email, 'password');
2424
fail('login was supposed to throw!');
25-
} catch (error) {
25+
} catch (error: any) {
2626
expect(error.message).toMatch(/Invalid email or password/);
2727
}
2828
});

β€Žsrc/common/bugsplat-api-client.spec.tsβ€Ž renamed to β€Žsrc/common/client/bugsplat-api-client.spec.tsβ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { BugSplatApiClient } from '.';
2-
import { config } from '../../spec/config';
3-
import { createFakeResponseBody } from '../../spec/fakes/common/response';
4-
import { Environment } from './environment';
1+
import { BugSplatApiClient, Environment } from '@common';
2+
import { config } from '@spec/config';
3+
import { createFakeResponseBody } from '@spec/fakes/common/response';
54

65
describe('BugSplatApiClient', () => {
76
const email = 'bobby@bugsplat.com';

β€Žsrc/common/bugsplat-api-client.tsβ€Ž renamed to β€Žsrc/common/client/bugsplat-api-client.tsβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
import { ApiClient, BugSplatResponse, Environment } from '@common';
12
import fetchPonyfill from 'fetch-ponyfill';
23
import FormData from 'form-data';
3-
import { ApiClient, Environment } from '.';
4-
import { BugSplatResponse } from './api-client';
54

65
export class BugSplatApiClient implements ApiClient {
76
private _createFormData = () => new FormData();
@@ -12,7 +11,7 @@ export class BugSplatApiClient implements ApiClient {
1211
private _host: string = 'https://app.bugsplat.com',
1312
private _environment: Environment = Environment.Node
1413
) { }
15-
14+
1615
static async createAuthenticatedClientForNode(
1716
host: string,
1817
email: string,

β€Žsrc/common/client/index.tsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { ApiClient, BugSplatResponse } from './api-client';
2+
export { BugSplatApiClient } from './bugsplat-api-client';

β€Žsrc/common/data/index.tsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './search';
2+
export * from './table-data';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const EQUAL = 'EQUAL';
2+
export const NOT_EQUAL = 'NOT_EQUAL';
3+
export const CONTAINS = 'CONTAINS';
4+
export const DOES_NOT_CONTAIN = 'DOES_NOT_CONTAIN';
5+
export const EMPTY = 'EMPTY';
6+
export const NOT_EMPTY = 'NOT_EMPTY';
7+
export const STARTS_WITH = 'STARTS_WITH';
8+
export const ENDS_WITH = 'ENDS_WITH';
9+
export const LESS_THAN = 'LESS_THAN';
10+
export const GREATER_THAN = 'GREATER_THAN';

0 commit comments

Comments
Β (0)