@sentry/core
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -19,3 +19,3 @@ import * as Sentry from '../index'; | ||
public setOptions(options: IMockAdapterOptions) { | ||
public async setOptions(options: IMockAdapterOptions) { | ||
// We need nothing here | ||
@@ -47,17 +47,21 @@ return this; | ||
public setUserContext(user?: Sentry.IUser) { | ||
public async setUserContext(user?: Sentry.IUser) { | ||
return this; | ||
} | ||
public setTagsContext(tags?: { [key: string]: any }) { | ||
public async setTagsContext(tags?: { [key: string]: any }) { | ||
return this; | ||
} | ||
public setExtraContext(extra?: { [key: string]: any }) { | ||
public async setExtraContext(extra?: { [key: string]: any }) { | ||
return this; | ||
} | ||
public clearContext() { | ||
public async clearContext() { | ||
return this; | ||
} | ||
public async setRelease(release: string) { | ||
return this; | ||
} | ||
} |
@@ -33,2 +33,5 @@ /// <reference types="jest" /> | ||
expect(() => { | ||
new Sentry.Client('https://username:@domain'); | ||
}).toThrow(); | ||
expect(() => { | ||
new Sentry.Client('123'); | ||
@@ -62,2 +65,12 @@ }).toThrow(); | ||
test('multiple install calls on Adapter should only call once', async () => { | ||
expect.assertions(1); | ||
const sentry = new Sentry.Client(dsn); | ||
sentry.use(MockAdapter, { testOption: true }); | ||
const spy1 = jest.spyOn(sentry.getAdapter(), 'install'); | ||
await sentry.install(); | ||
await sentry.install(); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
}); | ||
test('no registered Adapter', async () => { | ||
@@ -152,2 +165,19 @@ expect.assertions(1); | ||
}); | ||
test('should throw error without calling install', async () => { | ||
expect.assertions(1); | ||
const sentry = new Sentry.Client(dsn).use(MockAdapter); | ||
return expect(sentry.captureException(new Error('oops'))).rejects.toEqual({ | ||
message: 'Please call install() before calling other methods on Sentry', | ||
name: 'SentryError', | ||
}); | ||
}); | ||
test('call setRelease on Adapter', async () => { | ||
expect.assertions(1); | ||
const sentry = await new Sentry.Client(dsn).use(MockAdapter).install(); | ||
const spy = jest.spyOn(sentry.getAdapter(), 'setRelease'); | ||
await sentry.setRelease('#oops'); | ||
expect(spy).toBeCalled(); | ||
}); | ||
}); |
/// <reference types="jest" /> | ||
import { MockAdapter } from '../__mocks__/MockAdapter'; | ||
import * as Sentry from '../index'; | ||
import {MockAdapter} from '../__mocks__/MockAdapter'; | ||
@@ -12,29 +12,32 @@ const dsn = 'https://username:password@domain/path'; | ||
describe('Sentry.Client context', () => { | ||
test('set tags', () => { | ||
let sentry = new Sentry.Client('https://username:password@domain/path'); | ||
let adapter = sentry.use(MockAdapter); | ||
let spy1 = jest.spyOn(adapter, 'setTagsContext'); | ||
sentry.setTagsContext({yo: 12}); | ||
expect(sentry.getContext()).toEqual({tags: {yo: 12}}); | ||
test('set tags', async () => { | ||
expect.assertions(2); | ||
const sentry = new Sentry.Client('https://username:password@domain/path'); | ||
const adapter = await sentry.use(MockAdapter).install(); | ||
const spy1 = jest.spyOn(adapter, 'setTagsContext'); | ||
await sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
}); | ||
test('set extra and tags', () => { | ||
let sentry = new Sentry.Client('https://username:password@domain/path'); | ||
let adapter = sentry.use(MockAdapter); | ||
let spy1 = jest.spyOn(adapter, 'setExtraContext'); | ||
sentry.setTagsContext({yo: 12}); | ||
expect(sentry.getContext()).toEqual({tags: {yo: 12}}); | ||
sentry.setExtraContext({foo: 13}); | ||
expect(sentry.getContext()).toEqual({tags: {yo: 12}, extra: {foo: 13}}); | ||
test('set extra and tags', async () => { | ||
expect.assertions(3); | ||
const sentry = new Sentry.Client('https://username:password@domain/path'); | ||
const adapter = await sentry.use(MockAdapter).install(); | ||
const spy1 = jest.spyOn(adapter, 'setExtraContext'); | ||
await sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
await sentry.setExtraContext({ foo: 13 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 }, extra: { foo: 13 } }); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
}); | ||
test('clear context', () => { | ||
let sentry = new Sentry.Client('https://username:password@domain/path'); | ||
let adapter = sentry.use(MockAdapter); | ||
let spy1 = jest.spyOn(adapter, 'clearContext'); | ||
sentry.setTagsContext({yo: 12}); | ||
expect(sentry.getContext()).toEqual({tags: {yo: 12}}); | ||
sentry.clearContext(); | ||
test('clear context', async () => { | ||
expect.assertions(3); | ||
const sentry = new Sentry.Client('https://username:password@domain/path'); | ||
const adapter = await sentry.use(MockAdapter).install(); | ||
const spy1 = jest.spyOn(adapter, 'clearContext'); | ||
await sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
await sentry.clearContext(); | ||
expect(sentry.getContext()).toEqual({}); | ||
@@ -44,27 +47,29 @@ expect(spy1).toHaveBeenCalledTimes(1); | ||
test('set undefined', () => { | ||
let sentry = new Sentry.Client('https://username:password@domain/path'); | ||
let adapter = sentry.use(MockAdapter); | ||
sentry.setTagsContext(undefined); | ||
test('set undefined', async () => { | ||
expect.assertions(5); | ||
const sentry = new Sentry.Client('https://username:password@domain/path'); | ||
const adapter = await sentry.use(MockAdapter).install(); | ||
await sentry.setTagsContext(undefined); | ||
expect(sentry.getContext()).toEqual({}); | ||
sentry.setTagsContext({yo: 12}); | ||
expect(sentry.getContext()).toEqual({tags: {yo: 12}}); | ||
sentry.setTagsContext(undefined); | ||
await sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
await sentry.setTagsContext(undefined); | ||
expect(sentry.getContext()).toEqual({}); | ||
sentry.setExtraContext(undefined); | ||
await sentry.setExtraContext(undefined); | ||
expect(sentry.getContext()).toEqual({}); | ||
sentry.clearContext(); | ||
await sentry.clearContext(); | ||
expect(sentry.getContext()).toEqual({}); | ||
}); | ||
test('set user', () => { | ||
let sentry = new Sentry.Client('https://username:password@domain/path'); | ||
let adapter = sentry.use(MockAdapter); | ||
sentry.setUserContext({ | ||
id: 'test' | ||
test('set user', async () => { | ||
expect.assertions(2); | ||
const sentry = new Sentry.Client('https://username:password@domain/path'); | ||
const adapter = await sentry.use(MockAdapter).install(); | ||
await sentry.setUserContext({ | ||
id: 'test', | ||
}); | ||
expect(sentry.getContext()).toEqual({user: {id: 'test'}}); | ||
sentry.clearContext(); | ||
expect(sentry.getContext()).toEqual({ user: { id: 'test' } }); | ||
await sentry.clearContext(); | ||
expect(sentry.getContext()).toEqual({}); | ||
}); | ||
}); |
@@ -1,13 +0,9 @@ | ||
{"/Users/haza/Projects/raven-js/packages/core/index.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/index.ts","statementMap":{"0":{"start":{"line":3,"column":4},"end":{"line":3,"column":71}},"1":{"start":{"line":3,"column":21},"end":{"line":3,"column":71}},"2":{"start":{"line":3,"column":53},"end":{"line":3,"column":71}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":62}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":34}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":38}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":35}},"7":{"start":{"line":9,"column":16},"end":{"line":9,"column":40}},"8":{"start":{"line":10,"column":0},"end":{"line":10,"column":38}},"9":{"start":{"line":11,"column":15},"end":{"line":11,"column":38}},"10":{"start":{"line":12,"column":0},"end":{"line":12,"column":33}}},"fnMap":{"0":{"name":"__export","decl":{"start":{"line":2,"column":9},"end":{"line":2,"column":17}},"loc":{"start":{"line":2,"column":21},"end":{"line":4,"column":1}},"line":2}},"branchMap":{"0":{"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":71}},"type":"if","locations":[{"start":{"line":3,"column":21},"end":{"line":3,"column":71}},{"start":{"line":3,"column":21},"end":{"line":3,"column":71}}],"line":3}},"s":{"0":6,"1":16,"2":16,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2},"f":{"0":6},"b":{"0":[16,0]},"inputSourceMap":{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;AAAA,kCAA6B;AAC7B,sCAAiC;AACjC,mCAA8B;AAC9B,yCAAyC;AAAhC,6BAAA,QAAQ,CAAA;AACjB,uCAAsC;AAA7B,0BAAA,MAAM,CAAA","sourcesContent":["export * from './lib/Sentry';\nexport * from './lib/Interfaces';\nexport * from './lib/Adapter';\nexport { IOptions } from './lib/Options';\nexport { Client } from './lib/Client';\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"22475180c4d14b35f8d9aa9c05a479f929a6c7e4"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Adapter.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Adapter.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}}},"fnMap":{},"branchMap":{},"s":{"0":2},"f":{},"b":{},"inputSourceMap":{"version":3,"file":"Adapter.js","sourceRoot":"","sources":["Adapter.ts"],"names":[],"mappings":"","sourcesContent":["import { Event, IBreadcrumb, IUser } from './Interfaces';\n\nexport interface IAdapter {\n readonly options: {};\n install(): Promise<boolean>;\n setOptions(options: {}): IAdapter;\n send(event: Event): Promise<Event>;\n captureException(exception: Error): Promise<Event>;\n captureMessage(message: string): Promise<Event>;\n captureBreadcrumb(crumb: IBreadcrumb): Promise<IBreadcrumb>;\n\n // These should be removed at some point in the future\n // only the client should handle global stuff\n setUserContext?(user?: IUser): IAdapter;\n setTagsContext?(tags?: { [key: string]: any }): IAdapter;\n setExtraContext?(extra?: { [key: string]: any }): IAdapter;\n clearContext?(): IAdapter;\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"ceb79fde0db88217e912f528322665540764aa1e"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Client.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Client.ts","statementMap":{"0":{"start":{"line":2,"column":16},"end":{"line":9,"column":1}},"1":{"start":{"line":3,"column":4},"end":{"line":8,"column":7}},"2":{"start":{"line":4,"column":36},"end":{"line":4,"column":97}},"3":{"start":{"line":4,"column":42},"end":{"line":4,"column":70}},"4":{"start":{"line":4,"column":85},"end":{"line":4,"column":95}},"5":{"start":{"line":5,"column":35},"end":{"line":5,"column":100}},"6":{"start":{"line":5,"column":41},"end":{"line":5,"column":73}},"7":{"start":{"line":5,"column":88},"end":{"line":5,"column":98}},"8":{"start":{"line":6,"column":32},"end":{"line":6,"column":149}},"9":{"start":{"line":6,"column":97},"end":{"line":6,"column":119}},"10":{"start":{"line":7,"column":8},"end":{"line":7,"column":78}},"11":{"start":{"line":10,"column":18},"end":{"line":36,"column":1}},"12":{"start":{"line":11,"column":12},"end":{"line":11,"column":104}},"13":{"start":{"line":11,"column":43},"end":{"line":11,"column":68}},"14":{"start":{"line":11,"column":57},"end":{"line":11,"column":68}},"15":{"start":{"line":11,"column":69},"end":{"line":11,"column":81}},"16":{"start":{"line":12,"column":4},"end":{"line":12,"column":157}},"17":{"start":{"line":12,"column":138},"end":{"line":12,"column":150}},"18":{"start":{"line":13,"column":23},"end":{"line":13,"column":68}},"19":{"start":{"line":13,"column":45},"end":{"line":13,"column":65}},"20":{"start":{"line":15,"column":8},"end":{"line":15,"column":70}},"21":{"start":{"line":15,"column":15},"end":{"line":15,"column":70}},"22":{"start":{"line":16,"column":8},"end":{"line":33,"column":66}},"23":{"start":{"line":16,"column":18},"end":{"line":33,"column":66}},"24":{"start":{"line":17,"column":12},"end":{"line":17,"column":127}},"25":{"start":{"line":17,"column":118},"end":{"line":17,"column":127}},"26":{"start":{"line":18,"column":12},"end":{"line":18,"column":44}},"27":{"start":{"line":18,"column":26},"end":{"line":18,"column":44}},"28":{"start":{"line":19,"column":12},"end":{"line":31,"column":13}},"29":{"start":{"line":20,"column":32},"end":{"line":20,"column":39}},"30":{"start":{"line":20,"column":40},"end":{"line":20,"column":46}},"31":{"start":{"line":21,"column":24},"end":{"line":21,"column":34}},"32":{"start":{"line":21,"column":35},"end":{"line":21,"column":72}},"33":{"start":{"line":22,"column":24},"end":{"line":22,"column":34}},"34":{"start":{"line":22,"column":35},"end":{"line":22,"column":45}},"35":{"start":{"line":22,"column":46},"end":{"line":22,"column":55}},"36":{"start":{"line":22,"column":56},"end":{"line":22,"column":65}},"37":{"start":{"line":23,"column":24},"end":{"line":23,"column":41}},"38":{"start":{"line":23,"column":42},"end":{"line":23,"column":55}},"39":{"start":{"line":23,"column":56},"end":{"line":23,"column":65}},"40":{"start":{"line":25,"column":20},"end":{"line":25,"column":128}},"41":{"start":{"line":25,"column":110},"end":{"line":25,"column":116}},"42":{"start":{"line":25,"column":117},"end":{"line":25,"column":126}},"43":{"start":{"line":26,"column":20},"end":{"line":26,"column":106}},"44":{"start":{"line":26,"column":81},"end":{"line":26,"column":97}},"45":{"start":{"line":26,"column":98},"end":{"line":26,"column":104}},"46":{"start":{"line":27,"column":20},"end":{"line":27,"column":89}},"47":{"start":{"line":27,"column":57},"end":{"line":27,"column":72}},"48":{"start":{"line":27,"column":73},"end":{"line":27,"column":80}},"49":{"start":{"line":27,"column":81},"end":{"line":27,"column":87}},"50":{"start":{"line":28,"column":20},"end":{"line":28,"column":87}},"51":{"start":{"line":28,"column":47},"end":{"line":28,"column":62}},"52":{"start":{"line":28,"column":63},"end":{"line":28,"column":78}},"53":{"start":{"line":28,"column":79},"end":{"line":28,"column":85}},"54":{"start":{"line":29,"column":20},"end":{"line":29,"column":42}},"55":{"start":{"line":29,"column":30},"end":{"line":29,"column":42}},"56":{"start":{"line":30,"column":20},"end":{"line":30,"column":33}},"57":{"start":{"line":30,"column":34},"end":{"line":30,"column":43}},"58":{"start":{"line":32,"column":12},"end":{"line":32,"column":39}},"59":{"start":{"line":33,"column":22},"end":{"line":33,"column":34}},"60":{"start":{"line":33,"column":35},"end":{"line":33,"column":41}},"61":{"start":{"line":33,"column":54},"end":{"line":33,"column":64}},"62":{"start":{"line":34,"column":8},"end":{"line":34,"column":35}},"63":{"start":{"line":34,"column":23},"end":{"line":34,"column":35}},"64":{"start":{"line":34,"column":36},"end":{"line":34,"column":89}},"65":{"start":{"line":37,"column":0},"end":{"line":37,"column":62}},"66":{"start":{"line":38,"column":19},"end":{"line":38,"column":42}},"67":{"start":{"line":39,"column":14},"end":{"line":39,"column":45}},"68":{"start":{"line":40,"column":12},"end":{"line":40,"column":39}},"69":{"start":{"line":41,"column":15},"end":{"line":41,"column":34}},"70":{"start":{"line":42,"column":28},"end":{"line":197,"column":3}},"71":{"start":{"line":44,"column":8},"end":{"line":47,"column":12}},"72":{"start":{"line":44,"column":34},"end":{"line":47,"column":10}},"73":{"start":{"line":48,"column":8},"end":{"line":48,"column":31}},"74":{"start":{"line":49,"column":8},"end":{"line":49,"column":38}},"75":{"start":{"line":50,"column":8},"end":{"line":50,"column":52}},"76":{"start":{"line":51,"column":8},"end":{"line":51,"column":20}},"77":{"start":{"line":53,"column":4},"end":{"line":56,"column":6}},"78":{"start":{"line":55,"column":8},"end":{"line":55,"column":57}},"79":{"start":{"line":57,"column":4},"end":{"line":62,"column":6}},"80":{"start":{"line":58,"column":8},"end":{"line":60,"column":9}},"81":{"start":{"line":59,"column":12},"end":{"line":59,"column":93}},"82":{"start":{"line":61,"column":8},"end":{"line":61,"column":29}},"83":{"start":{"line":63,"column":4},"end":{"line":70,"column":6}},"84":{"start":{"line":64,"column":8},"end":{"line":67,"column":9}},"85":{"start":{"line":66,"column":12},"end":{"line":66,"column":119}},"86":{"start":{"line":68,"column":8},"end":{"line":68,"column":51}},"87":{"start":{"line":69,"column":8},"end":{"line":69,"column":20}},"88":{"start":{"line":71,"column":4},"end":{"line":77,"column":6}},"89":{"start":{"line":72,"column":20},"end":{"line":72,"column":24}},"90":{"start":{"line":73,"column":8},"end":{"line":75,"column":9}},"91":{"start":{"line":74,"column":12},"end":{"line":74,"column":60}},"92":{"start":{"line":76,"column":8},"end":{"line":76,"column":69}},"93":{"start":{"line":76,"column":52},"end":{"line":76,"column":65}},"94":{"start":{"line":78,"column":4},"end":{"line":92,"column":6}},"95":{"start":{"line":79,"column":8},"end":{"line":91,"column":11}},"96":{"start":{"line":81,"column":12},"end":{"line":90,"column":15}},"97":{"start":{"line":82,"column":16},"end":{"line":89,"column":17}},"98":{"start":{"line":83,"column":28},"end":{"line":83,"column":70}},"99":{"start":{"line":85,"column":24},"end":{"line":85,"column":44}},"100":{"start":{"line":86,"column":24},"end":{"line":86,"column":39}},"101":{"start":{"line":87,"column":24},"end":{"line":87,"column":82}},"102":{"start":{"line":88,"column":28},"end":{"line":88,"column":79}},"103":{"start":{"line":93,"column":4},"end":{"line":107,"column":6}},"104":{"start":{"line":94,"column":8},"end":{"line":106,"column":11}},"105":{"start":{"line":96,"column":12},"end":{"line":105,"column":15}},"106":{"start":{"line":97,"column":16},"end":{"line":104,"column":17}},"107":{"start":{"line":98,"column":28},"end":{"line":98,"column":70}},"108":{"start":{"line":100,"column":24},"end":{"line":100,"column":44}},"109":{"start":{"line":101,"column":24},"end":{"line":101,"column":39}},"110":{"start":{"line":102,"column":24},"end":{"line":102,"column":78}},"111":{"start":{"line":103,"column":28},"end":{"line":103,"column":79}},"112":{"start":{"line":108,"column":4},"end":{"line":120,"column":6}},"113":{"start":{"line":109,"column":8},"end":{"line":119,"column":11}},"114":{"start":{"line":111,"column":12},"end":{"line":118,"column":15}},"115":{"start":{"line":112,"column":16},"end":{"line":117,"column":17}},"116":{"start":{"line":113,"column":28},"end":{"line":113,"column":70}},"117":{"start":{"line":115,"column":24},"end":{"line":115,"column":44}},"118":{"start":{"line":116,"column":24},"end":{"line":116,"column":80}},"119":{"start":{"line":121,"column":4},"end":{"line":133,"column":6}},"120":{"start":{"line":122,"column":8},"end":{"line":132,"column":11}},"121":{"start":{"line":124,"column":12},"end":{"line":131,"column":15}},"122":{"start":{"line":125,"column":16},"end":{"line":130,"column":17}},"123":{"start":{"line":126,"column":28},"end":{"line":126,"column":70}},"124":{"start":{"line":128,"column":24},"end":{"line":128,"column":44}},"125":{"start":{"line":129,"column":24},"end":{"line":129,"column":67}},"126":{"start":{"line":135,"column":4},"end":{"line":144,"column":6}},"127":{"start":{"line":136,"column":19},"end":{"line":136,"column":21}},"128":{"start":{"line":137,"column":8},"end":{"line":139,"column":9}},"129":{"start":{"line":138,"column":12},"end":{"line":138,"column":37}},"130":{"start":{"line":140,"column":8},"end":{"line":143,"column":9}},"131":{"start":{"line":142,"column":12},"end":{"line":142,"column":45}},"132":{"start":{"line":147,"column":4},"end":{"line":156,"column":6}},"133":{"start":{"line":148,"column":8},"end":{"line":148,"column":49}},"134":{"start":{"line":150,"column":22},"end":{"line":150,"column":39}},"135":{"start":{"line":151,"column":8},"end":{"line":153,"column":9}},"136":{"start":{"line":152,"column":12},"end":{"line":152,"column":41}},"137":{"start":{"line":155,"column":8},"end":{"line":155,"column":20}},"138":{"start":{"line":157,"column":4},"end":{"line":166,"column":6}},"139":{"start":{"line":158,"column":8},"end":{"line":158,"column":53}},"140":{"start":{"line":160,"column":22},"end":{"line":160,"column":39}},"141":{"start":{"line":161,"column":8},"end":{"line":163,"column":9}},"142":{"start":{"line":162,"column":12},"end":{"line":162,"column":41}},"143":{"start":{"line":165,"column":8},"end":{"line":165,"column":20}},"144":{"start":{"line":167,"column":4},"end":{"line":176,"column":6}},"145":{"start":{"line":168,"column":8},"end":{"line":168,"column":55}},"146":{"start":{"line":170,"column":22},"end":{"line":170,"column":39}},"147":{"start":{"line":171,"column":8},"end":{"line":173,"column":9}},"148":{"start":{"line":172,"column":12},"end":{"line":172,"column":43}},"149":{"start":{"line":175,"column":8},"end":{"line":175,"column":20}},"150":{"start":{"line":177,"column":4},"end":{"line":186,"column":6}},"151":{"start":{"line":178,"column":8},"end":{"line":178,"column":52}},"152":{"start":{"line":180,"column":22},"end":{"line":180,"column":39}},"153":{"start":{"line":181,"column":8},"end":{"line":183,"column":9}},"154":{"start":{"line":182,"column":12},"end":{"line":182,"column":35}},"155":{"start":{"line":185,"column":8},"end":{"line":185,"column":20}},"156":{"start":{"line":188,"column":4},"end":{"line":195,"column":6}},"157":{"start":{"line":189,"column":20},"end":{"line":189,"column":24}},"158":{"start":{"line":190,"column":22},"end":{"line":190,"column":39}},"159":{"start":{"line":191,"column":8},"end":{"line":193,"column":9}},"160":{"start":{"line":192,"column":12},"end":{"line":192,"column":107}},"161":{"start":{"line":194,"column":8},"end":{"line":194,"column":78}},"162":{"start":{"line":194,"column":52},"end":{"line":194,"column":74}},"163":{"start":{"line":196,"column":4},"end":{"line":196,"column":18}},"164":{"start":{"line":198,"column":0},"end":{"line":198,"column":24}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":2,"column":44},"end":{"line":2,"column":45}},"loc":{"start":{"line":2,"column":89},"end":{"line":9,"column":1}},"line":2},"1":{"name":"(anonymous_1)","decl":{"start":{"line":3,"column":36},"end":{"line":3,"column":37}},"loc":{"start":{"line":3,"column":63},"end":{"line":8,"column":5}},"line":3},"2":{"name":"fulfilled","decl":{"start":{"line":4,"column":17},"end":{"line":4,"column":26}},"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":99}},"line":4},"3":{"name":"rejected","decl":{"start":{"line":5,"column":17},"end":{"line":5,"column":25}},"loc":{"start":{"line":5,"column":33},"end":{"line":5,"column":102}},"line":5},"4":{"name":"step","decl":{"start":{"line":6,"column":17},"end":{"line":6,"column":21}},"loc":{"start":{"line":6,"column":30},"end":{"line":6,"column":151}},"line":6},"5":{"name":"(anonymous_5)","decl":{"start":{"line":6,"column":76},"end":{"line":6,"column":77}},"loc":{"start":{"line":6,"column":95},"end":{"line":6,"column":121}},"line":6},"6":{"name":"(anonymous_6)","decl":{"start":{"line":10,"column":48},"end":{"line":10,"column":49}},"loc":{"start":{"line":10,"column":73},"end":{"line":36,"column":1}},"line":10},"7":{"name":"(anonymous_7)","decl":{"start":{"line":11,"column":30},"end":{"line":11,"column":31}},"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":83}},"line":11},"8":{"name":"(anonymous_8)","decl":{"start":{"line":12,"column":125},"end":{"line":12,"column":126}},"loc":{"start":{"line":12,"column":136},"end":{"line":12,"column":152}},"line":12},"9":{"name":"verb","decl":{"start":{"line":13,"column":13},"end":{"line":13,"column":17}},"loc":{"start":{"line":13,"column":21},"end":{"line":13,"column":70}},"line":13},"10":{"name":"(anonymous_10)","decl":{"start":{"line":13,"column":30},"end":{"line":13,"column":31}},"loc":{"start":{"line":13,"column":43},"end":{"line":13,"column":67}},"line":13},"11":{"name":"step","decl":{"start":{"line":14,"column":13},"end":{"line":14,"column":17}},"loc":{"start":{"line":14,"column":22},"end":{"line":35,"column":5}},"line":14},"12":{"name":"(anonymous_12)","decl":{"start":{"line":42,"column":28},"end":{"line":42,"column":29}},"loc":{"start":{"line":42,"column":40},"end":{"line":197,"column":1}},"line":42},"13":{"name":"Client","decl":{"start":{"line":43,"column":13},"end":{"line":43,"column":19}},"loc":{"start":{"line":43,"column":34},"end":{"line":52,"column":5}},"line":43},"14":{"name":"(anonymous_14)","decl":{"start":{"line":53,"column":34},"end":{"line":53,"column":35}},"loc":{"start":{"line":53,"column":46},"end":{"line":56,"column":5}},"line":53},"15":{"name":"(anonymous_15)","decl":{"start":{"line":57,"column":34},"end":{"line":57,"column":35}},"loc":{"start":{"line":57,"column":46},"end":{"line":62,"column":5}},"line":57},"16":{"name":"(anonymous_16)","decl":{"start":{"line":63,"column":27},"end":{"line":63,"column":28}},"loc":{"start":{"line":63,"column":55},"end":{"line":70,"column":5}},"line":63},"17":{"name":"(anonymous_17)","decl":{"start":{"line":71,"column":31},"end":{"line":71,"column":32}},"loc":{"start":{"line":71,"column":43},"end":{"line":77,"column":5}},"line":71},"18":{"name":"(anonymous_18)","decl":{"start":{"line":76,"column":38},"end":{"line":76,"column":39}},"loc":{"start":{"line":76,"column":50},"end":{"line":76,"column":67}},"line":76},"19":{"name":"(anonymous_19)","decl":{"start":{"line":78,"column":40},"end":{"line":78,"column":41}},"loc":{"start":{"line":78,"column":61},"end":{"line":92,"column":5}},"line":78},"20":{"name":"(anonymous_20)","decl":{"start":{"line":79,"column":47},"end":{"line":79,"column":48}},"loc":{"start":{"line":79,"column":59},"end":{"line":91,"column":9}},"line":79},"21":{"name":"(anonymous_21)","decl":{"start":{"line":81,"column":37},"end":{"line":81,"column":38}},"loc":{"start":{"line":81,"column":51},"end":{"line":90,"column":13}},"line":81},"22":{"name":"(anonymous_22)","decl":{"start":{"line":93,"column":38},"end":{"line":93,"column":39}},"loc":{"start":{"line":93,"column":57},"end":{"line":107,"column":5}},"line":93},"23":{"name":"(anonymous_23)","decl":{"start":{"line":94,"column":47},"end":{"line":94,"column":48}},"loc":{"start":{"line":94,"column":59},"end":{"line":106,"column":9}},"line":94},"24":{"name":"(anonymous_24)","decl":{"start":{"line":96,"column":37},"end":{"line":96,"column":38}},"loc":{"start":{"line":96,"column":51},"end":{"line":105,"column":13}},"line":96},"25":{"name":"(anonymous_25)","decl":{"start":{"line":108,"column":41},"end":{"line":108,"column":42}},"loc":{"start":{"line":108,"column":58},"end":{"line":120,"column":5}},"line":108},"26":{"name":"(anonymous_26)","decl":{"start":{"line":109,"column":47},"end":{"line":109,"column":48}},"loc":{"start":{"line":109,"column":59},"end":{"line":119,"column":9}},"line":109},"27":{"name":"(anonymous_27)","decl":{"start":{"line":111,"column":37},"end":{"line":111,"column":38}},"loc":{"start":{"line":111,"column":51},"end":{"line":118,"column":13}},"line":111},"28":{"name":"(anonymous_28)","decl":{"start":{"line":121,"column":28},"end":{"line":121,"column":29}},"loc":{"start":{"line":121,"column":45},"end":{"line":133,"column":5}},"line":121},"29":{"name":"(anonymous_29)","decl":{"start":{"line":122,"column":47},"end":{"line":122,"column":48}},"loc":{"start":{"line":122,"column":59},"end":{"line":132,"column":9}},"line":122},"30":{"name":"(anonymous_30)","decl":{"start":{"line":124,"column":37},"end":{"line":124,"column":38}},"loc":{"start":{"line":124,"column":51},"end":{"line":131,"column":13}},"line":124},"31":{"name":"(anonymous_31)","decl":{"start":{"line":135,"column":27},"end":{"line":135,"column":28}},"loc":{"start":{"line":135,"column":39},"end":{"line":144,"column":5}},"line":135},"32":{"name":"(anonymous_32)","decl":{"start":{"line":147,"column":38},"end":{"line":147,"column":39}},"loc":{"start":{"line":147,"column":54},"end":{"line":156,"column":5}},"line":147},"33":{"name":"(anonymous_33)","decl":{"start":{"line":157,"column":38},"end":{"line":157,"column":39}},"loc":{"start":{"line":157,"column":54},"end":{"line":166,"column":5}},"line":157},"34":{"name":"(anonymous_34)","decl":{"start":{"line":167,"column":39},"end":{"line":167,"column":40}},"loc":{"start":{"line":167,"column":56},"end":{"line":176,"column":5}},"line":167},"35":{"name":"(anonymous_35)","decl":{"start":{"line":177,"column":36},"end":{"line":177,"column":37}},"loc":{"start":{"line":177,"column":48},"end":{"line":186,"column":5}},"line":177},"36":{"name":"(anonymous_36)","decl":{"start":{"line":188,"column":36},"end":{"line":188,"column":37}},"loc":{"start":{"line":188,"column":48},"end":{"line":195,"column":5}},"line":188},"37":{"name":"(anonymous_37)","decl":{"start":{"line":194,"column":38},"end":{"line":194,"column":39}},"loc":{"start":{"line":194,"column":50},"end":{"line":194,"column":76}},"line":194}},"branchMap":{"0":{"loc":{"start":{"line":2,"column":16},"end":{"line":9,"column":1}},"type":"binary-expr","locations":[{"start":{"line":2,"column":17},"end":{"line":2,"column":21}},{"start":{"line":2,"column":25},"end":{"line":2,"column":39}},{"start":{"line":2,"column":44},"end":{"line":9,"column":1}}],"line":2},"1":{"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":34}},"type":"binary-expr","locations":[{"start":{"line":3,"column":16},"end":{"line":3,"column":17}},{"start":{"line":3,"column":22},"end":{"line":3,"column":33}}],"line":3},"2":{"loc":{"start":{"line":6,"column":32},"end":{"line":6,"column":148}},"type":"cond-expr","locations":[{"start":{"line":6,"column":46},"end":{"line":6,"column":67}},{"start":{"line":6,"column":70},"end":{"line":6,"column":148}}],"line":6},"3":{"loc":{"start":{"line":7,"column":51},"end":{"line":7,"column":67}},"type":"binary-expr","locations":[{"start":{"line":7,"column":51},"end":{"line":7,"column":61}},{"start":{"line":7,"column":65},"end":{"line":7,"column":67}}],"line":7},"4":{"loc":{"start":{"line":10,"column":18},"end":{"line":36,"column":1}},"type":"binary-expr","locations":[{"start":{"line":10,"column":19},"end":{"line":10,"column":23}},{"start":{"line":10,"column":27},"end":{"line":10,"column":43}},{"start":{"line":10,"column":48},"end":{"line":36,"column":1}}],"line":10},"5":{"loc":{"start":{"line":11,"column":43},"end":{"line":11,"column":68}},"type":"if","locations":[{"start":{"line":11,"column":43},"end":{"line":11,"column":68}},{"start":{"line":11,"column":43},"end":{"line":11,"column":68}}],"line":11},"6":{"loc":{"start":{"line":12,"column":71},"end":{"line":12,"column":153}},"type":"binary-expr","locations":[{"start":{"line":12,"column":71},"end":{"line":12,"column":99}},{"start":{"line":12,"column":104},"end":{"line":12,"column":152}}],"line":12},"7":{"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":70}},"type":"if","locations":[{"start":{"line":15,"column":8},"end":{"line":15,"column":70}},{"start":{"line":15,"column":8},"end":{"line":15,"column":70}}],"line":15},"8":{"loc":{"start":{"line":17,"column":12},"end":{"line":17,"column":127}},"type":"if","locations":[{"start":{"line":17,"column":12},"end":{"line":17,"column":127}},{"start":{"line":17,"column":12},"end":{"line":17,"column":127}}],"line":17},"9":{"loc":{"start":{"line":17,"column":23},"end":{"line":17,"column":116}},"type":"binary-expr","locations":[{"start":{"line":17,"column":23},"end":{"line":17,"column":24}},{"start":{"line":17,"column":29},"end":{"line":17,"column":83}},{"start":{"line":17,"column":88},"end":{"line":17,"column":116}}],"line":17},"10":{"loc":{"start":{"line":17,"column":35},"end":{"line":17,"column":82}},"type":"cond-expr","locations":[{"start":{"line":17,"column":47},"end":{"line":17,"column":55}},{"start":{"line":17,"column":58},"end":{"line":17,"column":82}}],"line":17},"11":{"loc":{"start":{"line":17,"column":58},"end":{"line":17,"column":82}},"type":"cond-expr","locations":[{"start":{"line":17,"column":66},"end":{"line":17,"column":73}},{"start":{"line":17,"column":76},"end":{"line":17,"column":82}}],"line":17},"12":{"loc":{"start":{"line":18,"column":12},"end":{"line":18,"column":44}},"type":"if","locations":[{"start":{"line":18,"column":12},"end":{"line":18,"column":44}},{"start":{"line":18,"column":12},"end":{"line":18,"column":44}}],"line":18},"13":{"loc":{"start":{"line":19,"column":12},"end":{"line":31,"column":13}},"type":"switch","locations":[{"start":{"line":20,"column":16},"end":{"line":20,"column":23}},{"start":{"line":20,"column":24},"end":{"line":20,"column":46}},{"start":{"line":21,"column":16},"end":{"line":21,"column":72}},{"start":{"line":22,"column":16},"end":{"line":22,"column":65}},{"start":{"line":23,"column":16},"end":{"line":23,"column":65}},{"start":{"line":24,"column":16},"end":{"line":30,"column":43}}],"line":19},"14":{"loc":{"start":{"line":25,"column":20},"end":{"line":25,"column":128}},"type":"if","locations":[{"start":{"line":25,"column":20},"end":{"line":25,"column":128}},{"start":{"line":25,"column":20},"end":{"line":25,"column":128}}],"line":25},"15":{"loc":{"start":{"line":25,"column":24},"end":{"line":25,"column":106}},"type":"binary-expr","locations":[{"start":{"line":25,"column":24},"end":{"line":25,"column":74}},{"start":{"line":25,"column":79},"end":{"line":25,"column":90}},{"start":{"line":25,"column":94},"end":{"line":25,"column":105}}],"line":25},"16":{"loc":{"start":{"line":25,"column":42},"end":{"line":25,"column":73}},"type":"binary-expr","locations":[{"start":{"line":25,"column":42},"end":{"line":25,"column":54}},{"start":{"line":25,"column":58},"end":{"line":25,"column":73}}],"line":25},"17":{"loc":{"start":{"line":26,"column":20},"end":{"line":26,"column":106}},"type":"if","locations":[{"start":{"line":26,"column":20},"end":{"line":26,"column":106}},{"start":{"line":26,"column":20},"end":{"line":26,"column":106}}],"line":26},"18":{"loc":{"start":{"line":26,"column":24},"end":{"line":26,"column":77}},"type":"binary-expr","locations":[{"start":{"line":26,"column":24},"end":{"line":26,"column":35}},{"start":{"line":26,"column":40},"end":{"line":26,"column":42}},{"start":{"line":26,"column":47},"end":{"line":26,"column":59}},{"start":{"line":26,"column":63},"end":{"line":26,"column":75}}],"line":26},"19":{"loc":{"start":{"line":27,"column":20},"end":{"line":27,"column":89}},"type":"if","locations":[{"start":{"line":27,"column":20},"end":{"line":27,"column":89}},{"start":{"line":27,"column":20},"end":{"line":27,"column":89}}],"line":27},"20":{"loc":{"start":{"line":27,"column":24},"end":{"line":27,"column":53}},"type":"binary-expr","locations":[{"start":{"line":27,"column":24},"end":{"line":27,"column":35}},{"start":{"line":27,"column":39},"end":{"line":27,"column":53}}],"line":27},"21":{"loc":{"start":{"line":28,"column":20},"end":{"line":28,"column":87}},"type":"if","locations":[{"start":{"line":28,"column":20},"end":{"line":28,"column":87}},{"start":{"line":28,"column":20},"end":{"line":28,"column":87}}],"line":28},"22":{"loc":{"start":{"line":28,"column":24},"end":{"line":28,"column":43}},"type":"binary-expr","locations":[{"start":{"line":28,"column":24},"end":{"line":28,"column":25}},{"start":{"line":28,"column":29},"end":{"line":28,"column":43}}],"line":28},"23":{"loc":{"start":{"line":29,"column":20},"end":{"line":29,"column":42}},"type":"if","locations":[{"start":{"line":29,"column":20},"end":{"line":29,"column":42}},{"start":{"line":29,"column":20},"end":{"line":29,"column":42}}],"line":29},"24":{"loc":{"start":{"line":34,"column":8},"end":{"line":34,"column":35}},"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":35}},{"start":{"line":34,"column":8},"end":{"line":34,"column":35}}],"line":34},"25":{"loc":{"start":{"line":34,"column":52},"end":{"line":34,"column":74}},"type":"cond-expr","locations":[{"start":{"line":34,"column":60},"end":{"line":34,"column":65}},{"start":{"line":34,"column":68},"end":{"line":34,"column":74}}],"line":34},"26":{"loc":{"start":{"line":44,"column":8},"end":{"line":47,"column":12}},"type":"if","locations":[{"start":{"line":44,"column":8},"end":{"line":47,"column":12}},{"start":{"line":44,"column":8},"end":{"line":47,"column":12}}],"line":44},"27":{"loc":{"start":{"line":58,"column":8},"end":{"line":60,"column":9}},"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":60,"column":9}},{"start":{"line":58,"column":8},"end":{"line":60,"column":9}}],"line":58},"28":{"loc":{"start":{"line":64,"column":8},"end":{"line":67,"column":9}},"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":67,"column":9}},{"start":{"line":64,"column":8},"end":{"line":67,"column":9}}],"line":64},"29":{"loc":{"start":{"line":73,"column":8},"end":{"line":75,"column":9}},"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":75,"column":9}},{"start":{"line":73,"column":8},"end":{"line":75,"column":9}}],"line":73},"30":{"loc":{"start":{"line":82,"column":16},"end":{"line":89,"column":17}},"type":"switch","locations":[{"start":{"line":83,"column":20},"end":{"line":83,"column":70}},{"start":{"line":84,"column":20},"end":{"line":87,"column":82}},{"start":{"line":88,"column":20},"end":{"line":88,"column":79}}],"line":82},"31":{"loc":{"start":{"line":97,"column":16},"end":{"line":104,"column":17}},"type":"switch","locations":[{"start":{"line":98,"column":20},"end":{"line":98,"column":70}},{"start":{"line":99,"column":20},"end":{"line":102,"column":78}},{"start":{"line":103,"column":20},"end":{"line":103,"column":79}}],"line":97},"32":{"loc":{"start":{"line":112,"column":16},"end":{"line":117,"column":17}},"type":"switch","locations":[{"start":{"line":113,"column":20},"end":{"line":113,"column":70}},{"start":{"line":114,"column":20},"end":{"line":116,"column":80}}],"line":112},"33":{"loc":{"start":{"line":125,"column":16},"end":{"line":130,"column":17}},"type":"switch","locations":[{"start":{"line":126,"column":20},"end":{"line":126,"column":70}},{"start":{"line":127,"column":20},"end":{"line":129,"column":67}}],"line":125},"34":{"loc":{"start":{"line":140,"column":8},"end":{"line":143,"column":9}},"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":143,"column":9}},{"start":{"line":140,"column":8},"end":{"line":143,"column":9}}],"line":140},"35":{"loc":{"start":{"line":151,"column":8},"end":{"line":153,"column":9}},"type":"if","locations":[{"start":{"line":151,"column":8},"end":{"line":153,"column":9}},{"start":{"line":151,"column":8},"end":{"line":153,"column":9}}],"line":151},"36":{"loc":{"start":{"line":161,"column":8},"end":{"line":163,"column":9}},"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":163,"column":9}},{"start":{"line":161,"column":8},"end":{"line":163,"column":9}}],"line":161},"37":{"loc":{"start":{"line":171,"column":8},"end":{"line":173,"column":9}},"type":"if","locations":[{"start":{"line":171,"column":8},"end":{"line":173,"column":9}},{"start":{"line":171,"column":8},"end":{"line":173,"column":9}}],"line":171},"38":{"loc":{"start":{"line":181,"column":8},"end":{"line":183,"column":9}},"type":"if","locations":[{"start":{"line":181,"column":8},"end":{"line":183,"column":9}},{"start":{"line":181,"column":8},"end":{"line":183,"column":9}}],"line":181},"39":{"loc":{"start":{"line":191,"column":8},"end":{"line":193,"column":9}},"type":"if","locations":[{"start":{"line":191,"column":8},"end":{"line":193,"column":9}},{"start":{"line":191,"column":8},"end":{"line":193,"column":9}}],"line":191}},"s":{"0":2,"1":8,"2":11,"3":11,"4":0,"5":1,"6":1,"7":1,"8":19,"9":12,"10":8,"11":2,"12":8,"13":12,"14":1,"15":11,"16":8,"17":0,"18":24,"19":20,"20":20,"21":0,"22":20,"23":40,"24":40,"25":0,"26":40,"27":0,"28":40,"29":20,"30":20,"31":12,"32":12,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":8,"41":8,"42":8,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":20,"59":1,"60":1,"61":40,"62":8,"63":1,"64":7,"65":2,"66":2,"67":2,"68":2,"69":2,"70":2,"71":22,"72":22,"73":22,"74":22,"75":17,"76":17,"77":2,"78":12,"79":2,"80":34,"81":1,"82":33,"83":2,"84":15,"85":1,"86":14,"87":14,"88":2,"89":7,"90":7,"91":7,"92":6,"93":6,"94":2,"95":1,"96":1,"97":3,"98":1,"99":1,"100":1,"101":1,"102":1,"103":2,"104":3,"105":3,"106":9,"107":3,"108":3,"109":3,"110":3,"111":3,"112":2,"113":1,"114":1,"115":2,"116":1,"117":1,"118":1,"119":2,"120":3,"121":3,"122":6,"123":3,"124":3,"125":3,"126":2,"127":2,"128":2,"129":2,"130":2,"131":1,"132":2,"133":1,"134":1,"135":1,"136":1,"137":1,"138":2,"139":6,"140":6,"141":6,"142":6,"143":6,"144":2,"145":2,"146":2,"147":2,"148":2,"149":2,"150":2,"151":3,"152":3,"153":3,"154":3,"155":3,"156":2,"157":8,"158":8,"159":8,"160":0,"161":8,"162":8,"163":2,"164":2},"f":{"0":8,"1":8,"2":11,"3":1,"4":19,"5":12,"6":8,"7":12,"8":0,"9":24,"10":20,"11":20,"12":2,"13":22,"14":12,"15":34,"16":15,"17":7,"18":6,"19":1,"20":1,"21":3,"22":3,"23":3,"24":9,"25":1,"26":1,"27":2,"28":3,"29":3,"30":6,"31":2,"32":1,"33":6,"34":2,"35":3,"36":8,"37":8},"b":{"0":[2,2,2],"1":[8,8],"2":[7,12],"3":[8,8],"4":[2,2,2],"5":[1,11],"6":[8,8],"7":[0,20],"8":[0,40],"9":[40,0,0],"10":[0,0],"11":[0,0],"12":[0,40],"13":[19,20,12,0,0,8],"14":[8,0],"15":[8,8,7],"16":[8,0],"17":[0,0],"18":[0,0,0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[1,7],"25":[7,0],"26":[22,0],"27":[1,33],"28":[1,14],"29":[7,0],"30":[1,1,1],"31":[3,3,3],"32":[1,1],"33":[3,3],"34":[1,1],"35":[1,0],"36":[6,0],"37":[2,0],"38":[3,0],"39":[0,8]},"inputSourceMap":{"version":3,"file":"Client.js","sourceRoot":"","sources":["Client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAAmE;AACnE,8CAAgD;AAChD,wCAAuC;AAEvC,mCAAuC;AAEvC;IAME,gBACE,GAAW,EACJ,OAGN;QAHM,wBAAA,EAAA;YACL,QAAQ,EAAE,qBAAQ,CAAC,KAAK;YACxB,cAAc,EAAE,GAAG;SACpB;QAHM,YAAO,GAAP,OAAO,CAGb;QAED,IAAI,CAAC,GAAG,GAAG,IAAI,SAAG,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAEM,2BAAU,GAAjB;QACE,iCAAiC;QACjC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnD,CAAC;IAEM,2BAAU,GAAjB;QACE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnB,MAAM,IAAI,oBAAW,CAAC,gDAAgD,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,QAAa,CAAC;IAC5B,CAAC;IAEM,oBAAG,GAAV,UACE,OAAiD,EACjD,OAAW;QAEX,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAClB,6BAA6B;YAC7B,MAAM,IAAI,UAAU,CAClB,oFAAoF,CACrF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAEM,wBAAO,GAAd;QAAA,iBAKC;QAJC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAM,OAAA,KAAI,EAAJ,CAAI,CAAC,CAAC;IAC5C,CAAC;IAEY,iCAAgB,GAA7B,UAA8B,SAAgB;;;;;4BAC5B,qBAAM,IAAI,CAAC,YAAY,EAAE,EAAA;;wBAAnC,OAAO,GAAG,SAAyB;wBAClC,KAAA,IAAI,CAAC,IAAI,CAAA;wBAAC,qBAAM,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAA;4BAA1D,sBAAO,SAAA,IAAI,GAAM,SAAyC,EAAC,EAAC;;;;KAC7D;IAEY,+BAAc,GAA3B,UAA4B,OAAe;;;;;4BACzB,qBAAM,IAAI,CAAC,YAAY,EAAE,EAAA;;wBAAnC,OAAO,GAAG,SAAyB;wBAClC,KAAA,IAAI,CAAC,IAAI,CAAA;wBAAC,qBAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,EAAA;4BAAtD,sBAAO,SAAA,IAAI,GAAM,SAAqC,EAAC,EAAC;;;;KACzD;IAEY,kCAAiB,GAA9B,UAA+B,KAAkB;;;;;4BAC/B,qBAAM,IAAI,CAAC,YAAY,EAAE,EAAA;;wBAAnC,OAAO,GAAG,SAAyB;wBACzC,sBAAO,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAC;;;;KACzC;IAEY,qBAAI,GAAjB,UAAkB,KAAY;;;;;4BACZ,qBAAM,IAAI,CAAC,YAAY,EAAE,EAAA;;wBAAnC,OAAO,GAAG,SAAyB;wBACzC,sBAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAC;;;;KAC5B;IAED,0BAA0B;IAEnB,oBAAG,GAAV;QAAW,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACvB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,qBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAC5C,2BAA2B;YAC3B,OAAO,CAAC,GAAG,OAAX,OAAO,EAAQ,IAAI,EAAE;QACvB,CAAC;IACH,CAAC;IAED,0BAA0B;IAE1B,2BAA2B;IAEpB,+BAAc,GAArB,UAAsB,IAAY;QAChC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzC,0DAA0D;QAC1D,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;YAC3B,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,0DAA0D;QAC1D,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAEM,+BAAc,GAArB,UAAsB,IAA6B;QACjD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC7C,0DAA0D;QAC1D,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;YAC3B,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,0DAA0D;QAC1D,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAEM,gCAAe,GAAtB,UAAuB,KAA8B;QACnD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAC/C,0DAA0D;QAC1D,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;YAC5B,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,0DAA0D;QAC1D,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAEM,6BAAY,GAAnB;QACE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC5C,0DAA0D;QAC1D,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;YACzB,OAAO,CAAC,YAAY,EAAE,CAAC;QACzB,CAAC;QACD,0DAA0D;QAC1D,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAED,2BAA2B;IAEnB,6BAAY,GAApB;QAAA,iBAQC;QAPC,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,oBAAW,CACnB,8DAA8D,CAC/D,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAM,OAAA,KAAI,CAAC,QAAQ,EAAb,CAAa,CAAC,CAAC;IACrD,CAAC;IACH,aAAC;AAAD,CAAC,AA3ID,IA2IC;AA3IY,wBAAM","sourcesContent":["import * as Adapter from './Adapter';\nimport { Event, IBreadcrumb, IUser, LogLevel } from './Interfaces';\nimport * as Context from './Interfaces/Context';\nimport { DSN } from './Interfaces/DSN';\nimport { IOptions } from './Options';\nimport { SentryError } from './Sentry';\n\nexport class Client {\n public readonly dsn: DSN;\n private _adapter: Adapter.IAdapter;\n private _context: Context.IContext;\n private _isInstalled: Promise<boolean>;\n\n constructor(\n dsn: string,\n public options: IOptions = {\n logLevel: LogLevel.Error,\n maxBreadcrumbs: 100,\n }\n ) {\n this.dsn = new DSN(dsn);\n this._context = Context.getDefaultContext();\n return this;\n }\n\n public getContext() {\n // TODO: check for cyclic objects\n return JSON.parse(JSON.stringify(this._context));\n }\n\n public getAdapter<A extends Adapter.IAdapter>(): A {\n if (!this._adapter) {\n throw new SentryError('No adapter in use, please call .use(<Adapter>)');\n }\n return this._adapter as A;\n }\n\n public use<A extends Adapter.IAdapter, O extends {}>(\n adapter: { new (client: Client, options?: O): A },\n options?: O\n ): Client {\n if (this._adapter) {\n // TODO: implement unregister\n throw new RangeError(\n 'There is already a Adapter registered, call unregister() to remove current adapter'\n );\n }\n this._adapter = new adapter(this, options);\n return this;\n }\n\n public install(): Promise<this> {\n if (!this._isInstalled) {\n this._isInstalled = this.getAdapter().install();\n }\n return this._isInstalled.then(() => this);\n }\n\n public async captureException(exception: Error) {\n const adapter = await this.awaitAdapter();\n return this.send(await adapter.captureException(exception));\n }\n\n public async captureMessage(message: string) {\n const adapter = await this.awaitAdapter();\n return this.send(await adapter.captureMessage(message));\n }\n\n public async captureBreadcrumb(crumb: IBreadcrumb) {\n const adapter = await this.awaitAdapter();\n return adapter.captureBreadcrumb(crumb);\n }\n\n public async send(event: Event) {\n const adapter = await this.awaitAdapter();\n return adapter.send(event);\n }\n\n // ---------------- HELPER\n\n public log(...args: any[]) {\n if (this.options.logLevel >= LogLevel.Debug) {\n // tslint:disable-next-line\n console.log(...args);\n }\n }\n\n // -----------------------\n\n // ---------------- CONTEXT\n\n public setUserContext(user?: IUser) {\n Context.set(this._context, 'user', user);\n // TODO: Remove this once we moved code away from adapters\n const adapter = this.getAdapter();\n if (adapter.setUserContext) {\n adapter.setUserContext(user);\n }\n // -------------------------------------------------------\n return this;\n }\n\n public setTagsContext(tags?: { [key: string]: any }) {\n Context.mergeIn(this._context, 'tags', tags);\n // TODO: Remove this once we moved code away from adapters\n const adapter = this.getAdapter();\n if (adapter.setTagsContext) {\n adapter.setTagsContext(tags);\n }\n // -------------------------------------------------------\n return this;\n }\n\n public setExtraContext(extra?: { [key: string]: any }) {\n Context.mergeIn(this._context, 'extra', extra);\n // TODO: Remove this once we moved code away from adapters\n const adapter = this.getAdapter();\n if (adapter.setExtraContext) {\n adapter.setExtraContext(extra);\n }\n // -------------------------------------------------------\n return this;\n }\n\n public clearContext() {\n this._context = Context.getDefaultContext();\n // TODO: Remove this once we moved code away from adapters\n const adapter = this.getAdapter();\n if (adapter.clearContext) {\n adapter.clearContext();\n }\n // -------------------------------------------------------\n return this;\n }\n\n // ------------------------\n\n private awaitAdapter(): Promise<Adapter.IAdapter> {\n const adapter = this.getAdapter();\n if (!this._isInstalled) {\n throw new SentryError(\n 'Please call install() before calling other methods on Sentry'\n );\n }\n return this._isInstalled.then(() => this._adapter);\n }\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"b3aa6fcb9f15f306d33a86ee43c373337ee8579a"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Options.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Options.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}}},"fnMap":{},"branchMap":{},"s":{"0":2},"f":{},"b":{},"inputSourceMap":{"version":3,"file":"Options.js","sourceRoot":"","sources":["Options.ts"],"names":[],"mappings":"","sourcesContent":["import { LogLevel } from './Interfaces';\nexport interface IOptions {\n maxBreadcrumbs: number;\n logLevel: LogLevel;\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"70a1b2f43f3e519b7d979539cf32f9f9f64e066b"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Sentry.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Sentry.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}},"1":{"start":{"line":3,"column":15},"end":{"line":3,"column":34}},"2":{"start":{"line":6,"column":4},"end":{"line":6,"column":62}},"3":{"start":{"line":8,"column":0},"end":{"line":8,"column":24}},"4":{"start":{"line":10,"column":4},"end":{"line":10,"column":26}},"5":{"start":{"line":11,"column":4},"end":{"line":11,"column":18}},"6":{"start":{"line":13,"column":0},"end":{"line":13,"column":42}},"7":{"start":{"line":15,"column":4},"end":{"line":15,"column":24}},"8":{"start":{"line":17,"column":0},"end":{"line":17,"column":42}},"9":{"start":{"line":18,"column":33},"end":{"line":24,"column":3}},"10":{"start":{"line":20,"column":8},"end":{"line":20,"column":31}},"11":{"start":{"line":21,"column":8},"end":{"line":21,"column":34}},"12":{"start":{"line":23,"column":4},"end":{"line":23,"column":23}},"13":{"start":{"line":25,"column":0},"end":{"line":25,"column":34}}},"fnMap":{"0":{"name":"create","decl":{"start":{"line":5,"column":9},"end":{"line":5,"column":15}},"loc":{"start":{"line":5,"column":30},"end":{"line":7,"column":1}},"line":5},"1":{"name":"setSharedClient","decl":{"start":{"line":9,"column":9},"end":{"line":9,"column":24}},"loc":{"start":{"line":9,"column":33},"end":{"line":12,"column":1}},"line":9},"2":{"name":"getSharedClient","decl":{"start":{"line":14,"column":9},"end":{"line":14,"column":24}},"loc":{"start":{"line":14,"column":27},"end":{"line":16,"column":1}},"line":14},"3":{"name":"(anonymous_3)","decl":{"start":{"line":18,"column":33},"end":{"line":18,"column":34}},"loc":{"start":{"line":18,"column":45},"end":{"line":24,"column":1}},"line":18},"4":{"name":"SentryError","decl":{"start":{"line":19,"column":13},"end":{"line":19,"column":24}},"loc":{"start":{"line":19,"column":34},"end":{"line":22,"column":5}},"line":19}},"branchMap":{},"s":{"0":2,"1":2,"2":1,"3":2,"4":1,"5":1,"6":2,"7":1,"8":2,"9":2,"10":6,"11":6,"12":2,"13":2},"f":{"0":1,"1":1,"2":1,"3":2,"4":6},"b":{},"inputSourceMap":{"version":3,"file":"Sentry.js","sourceRoot":"","sources":["Sentry.ts"],"names":[],"mappings":";;AAAA,mCAAkC;AAGlC,IAAI,YAAoB,CAAC;AAEzB,gBAAuB,GAAW,EAAE,OAAkB;IACpD,MAAM,CAAC,eAAe,CAAC,IAAI,eAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACnD,CAAC;AAFD,wBAEC;AAED,yBAAgC,MAAc;IAC5C,YAAY,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAHD,0CAGC;AAED;IACE,MAAM,CAAC,YAAY,CAAC;AACtB,CAAC;AAFD,0CAEC;AAED;IAEE,qBAAmB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;QAD3B,SAAI,GAAG,aAAa,CAAC;IACS,CAAC;IACxC,kBAAC;AAAD,CAAC,AAHD,IAGC;AAHY,kCAAW","sourcesContent":["import { Client } from './Client';\nimport { IOptions } from './Options';\n\nlet sharedClient: Client;\n\nexport function create(dsn: string, options?: IOptions) {\n return setSharedClient(new Client(dsn, options));\n}\n\nexport function setSharedClient(client: Client) {\n sharedClient = client;\n return client;\n}\n\nexport function getSharedClient() {\n return sharedClient;\n}\n\nexport class SentryError implements Error {\n public name = 'SentryError';\n constructor(public message: string) {}\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"c98c9c62249271b45a00afbb982111b9cb3151f7"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Breadcrumb.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Breadcrumb.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}}},"fnMap":{},"branchMap":{},"s":{"0":2},"f":{},"b":{},"inputSourceMap":{"version":3,"file":"Breadcrumb.js","sourceRoot":"","sources":["Breadcrumb.ts"],"names":[],"mappings":"","sourcesContent":["export interface IBreadcrumb {\n type?: string;\n level?: string; // TODO check if same as LogLevel or Severity\n event_id?: string;\n category?: string;\n message?: string;\n data?: any;\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"78026e874b9dae43b6b45cdf77c3d4de53cae754"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Context.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Context.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}},"1":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}},"2":{"start":{"line":6,"column":0},"end":{"line":6,"column":46}},"3":{"start":{"line":8,"column":4},"end":{"line":8,"column":25}},"4":{"start":{"line":10,"column":0},"end":{"line":10,"column":18}},"5":{"start":{"line":12,"column":4},"end":{"line":14,"column":5}},"6":{"start":{"line":13,"column":8},"end":{"line":13,"column":30}},"7":{"start":{"line":15,"column":4},"end":{"line":20,"column":5}},"8":{"start":{"line":16,"column":8},"end":{"line":16,"column":28}},"9":{"start":{"line":19,"column":8},"end":{"line":19,"column":43}},"10":{"start":{"line":22,"column":0},"end":{"line":22,"column":26}}},"fnMap":{"0":{"name":"getDefaultContext","decl":{"start":{"line":3,"column":9},"end":{"line":3,"column":26}},"loc":{"start":{"line":3,"column":29},"end":{"line":5,"column":1}},"line":3},"1":{"name":"set","decl":{"start":{"line":7,"column":9},"end":{"line":7,"column":12}},"loc":{"start":{"line":7,"column":34},"end":{"line":9,"column":1}},"line":7},"2":{"name":"mergeIn","decl":{"start":{"line":11,"column":9},"end":{"line":11,"column":16}},"loc":{"start":{"line":11,"column":38},"end":{"line":21,"column":1}},"line":11}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":4},"end":{"line":14,"column":5}},"type":"if","locations":[{"start":{"line":12,"column":4},"end":{"line":14,"column":5}},{"start":{"line":12,"column":4},"end":{"line":14,"column":5}}],"line":12},"1":{"loc":{"start":{"line":15,"column":4},"end":{"line":20,"column":5}},"type":"if","locations":[{"start":{"line":15,"column":4},"end":{"line":20,"column":5}},{"start":{"line":15,"column":4},"end":{"line":20,"column":5}}],"line":15}},"s":{"0":2,"1":20,"2":2,"3":8,"4":2,"5":8,"6":7,"7":8,"8":3,"9":5,"10":2},"f":{"0":20,"1":8,"2":8},"b":{"0":[7,1],"1":[3,5]},"inputSourceMap":{"version":3,"file":"Context.js","sourceRoot":"","sources":["Context.ts"],"names":[],"mappings":";;AAQA;IACE,MAAM,CAAC,EAAE,CAAC;AACZ,CAAC;AAFD,8CAEC;AAED,aACE,OAAU,EACV,GAAM,EACN,KAAU;IAEV,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACvB,CAAC;AAND,kBAMC;AAED,iBACE,OAAU,EACV,GAAM,EACN,KAAU;IAEV,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAClB,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IACxB,CAAC;IACD,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;QACxB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAAC,IAAI,CAAC,CAAC;QACN,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;AACH,CAAC;AAbD,0BAaC","sourcesContent":["import { IUser } from './User';\n\nexport interface IContext {\n tags?: any;\n extra?: any;\n user?: IUser;\n}\n\nexport function getDefaultContext() {\n return {};\n}\n\nexport function set<T extends IContext, K extends keyof T>(\n context: T,\n key: K,\n value: any\n) {\n context[key] = value;\n}\n\nexport function mergeIn<T extends IContext, K extends keyof T>(\n context: T,\n key: K,\n value: any\n) {\n if (!context[key]) {\n set(context, key, {});\n }\n if (value === undefined) {\n delete context[key];\n } else {\n Object.assign(context[key], value);\n }\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"6768ca66e4548869c45aa6f2ed7972fde91ff40d"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/DSN.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/DSN.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}},"1":{"start":{"line":3,"column":15},"end":{"line":3,"column":35}},"2":{"start":{"line":4,"column":16},"end":{"line":4,"column":77}},"3":{"start":{"line":5,"column":25},"end":{"line":33,"column":3}},"4":{"start":{"line":7,"column":8},"end":{"line":7,"column":35}},"5":{"start":{"line":8,"column":8},"end":{"line":8,"column":24}},"6":{"start":{"line":9,"column":8},"end":{"line":9,"column":20}},"7":{"start":{"line":11,"column":4},"end":{"line":14,"column":6}},"8":{"start":{"line":12,"column":8},"end":{"line":13,"column":96}},"9":{"start":{"line":15,"column":4},"end":{"line":31,"column":6}},"10":{"start":{"line":16,"column":20},"end":{"line":16,"column":50}},"11":{"start":{"line":17,"column":8},"end":{"line":30,"column":9}},"12":{"start":{"line":18,"column":12},"end":{"line":26,"column":14}},"13":{"start":{"line":29,"column":12},"end":{"line":29,"column":58}},"14":{"start":{"line":32,"column":4},"end":{"line":32,"column":15}},"15":{"start":{"line":34,"column":0},"end":{"line":34,"column":18}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":25},"end":{"line":5,"column":26}},"loc":{"start":{"line":5,"column":37},"end":{"line":33,"column":1}},"line":5},"1":{"name":"DSN","decl":{"start":{"line":6,"column":13},"end":{"line":6,"column":16}},"loc":{"start":{"line":6,"column":28},"end":{"line":10,"column":5}},"line":6},"2":{"name":"(anonymous_2)","decl":{"start":{"line":11,"column":27},"end":{"line":11,"column":28}},"loc":{"start":{"line":11,"column":47},"end":{"line":14,"column":5}},"line":11},"3":{"name":"(anonymous_3)","decl":{"start":{"line":15,"column":29},"end":{"line":15,"column":30}},"loc":{"start":{"line":15,"column":41},"end":{"line":31,"column":5}},"line":15}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":61},"end":{"line":12,"column":90}},"type":"cond-expr","locations":[{"start":{"line":12,"column":72},"end":{"line":12,"column":85}},{"start":{"line":12,"column":88},"end":{"line":12,"column":90}}],"line":12},"1":{"loc":{"start":{"line":13,"column":36},"end":{"line":13,"column":76}},"type":"cond-expr","locations":[{"start":{"line":13,"column":52},"end":{"line":13,"column":71}},{"start":{"line":13,"column":74},"end":{"line":13,"column":76}}],"line":13},"2":{"loc":{"start":{"line":17,"column":8},"end":{"line":30,"column":9}},"type":"if","locations":[{"start":{"line":17,"column":8},"end":{"line":30,"column":9}},{"start":{"line":17,"column":8},"end":{"line":30,"column":9}}],"line":17},"3":{"loc":{"start":{"line":22,"column":22},"end":{"line":22,"column":36}},"type":"binary-expr","locations":[{"start":{"line":22,"column":22},"end":{"line":22,"column":30}},{"start":{"line":22,"column":34},"end":{"line":22,"column":36}}],"line":22},"4":{"loc":{"start":{"line":24,"column":22},"end":{"line":24,"column":36}},"type":"binary-expr","locations":[{"start":{"line":24,"column":22},"end":{"line":24,"column":30}},{"start":{"line":24,"column":34},"end":{"line":24,"column":36}}],"line":24}},"s":{"0":2,"1":2,"2":2,"3":2,"4":22,"5":22,"6":17,"7":2,"8":4,"9":2,"10":22,"11":22,"12":17,"13":5,"14":2,"15":2},"f":{"0":2,"1":22,"2":4,"3":22},"b":{"0":[2,2],"1":[2,2],"2":[17,5],"3":[17,0],"4":[17,16]},"inputSourceMap":{"version":3,"file":"DSN.js","sourceRoot":"","sources":["DSN.ts"],"names":[],"mappings":";;AAAA,oCAAwC;AAYxC,IAAM,SAAS,GAAG,6DAA6D,CAAC;AAEhF;IAIE,aAAY,SAAiB;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAEM,oBAAM,GAAb,UAAc,QAAiB;QAC7B,MAAM,CAAC,CACF,IAAI,CAAC,GAAG,CAAC,QAAQ,WAAM,IAAI,CAAC,GAAG,CAAC,IAAI,IAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAE;aACzE,MAAI,IAAI,CAAC,GAAG,CAAC,IAAI,IAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAG,IAAI,CAAC,GAAG,CAAC,IAAM,CAAA,CAC/E,CAAC;IACJ,CAAC;IAEO,sBAAQ,GAAhB;QACE,IAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7C,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACV,IAAI,CAAC,GAAG,GAAG;gBACT,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;gBAChB,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;gBAClB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;gBACpB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;gBACpB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;aACf,CAAC;QACJ,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,MAAM,IAAI,oBAAW,CAAC,aAAa,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IACH,UAAC;AAAD,CAAC,AAjCD,IAiCC;AAjCY,kBAAG","sourcesContent":["import { SentryError } from '../Sentry';\n\ninterface IDSNParts {\n source: string;\n protocol: string;\n user: string;\n pass: string;\n host: string;\n port: string;\n path: string;\n}\n\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(:\\w+)?@)([\\w\\.-]+)(?::(\\d+))?(\\/.*)/;\n\nexport class DSN {\n private dsnString: string;\n private dsn: IDSNParts;\n\n constructor(dsnString: string) {\n this.dsnString = dsnString;\n this.parseDsn();\n return this;\n }\n\n public getDsn(withPass: boolean) {\n return (\n `${this.dsn.protocol}://${this.dsn.user}${withPass ? this.dsn.pass : ''}` +\n `@${this.dsn.host}${this.dsn.port ? ':' + this.dsn.port : ''}${this.dsn.path}`\n );\n }\n\n private parseDsn() {\n const match = DSN_REGEX.exec(this.dsnString);\n if (match) {\n this.dsn = {\n source: match[0],\n protocol: match[1],\n user: match[2],\n pass: match[3] || '',\n host: match[4],\n port: match[5] || '',\n path: match[6],\n };\n } else {\n throw new SentryError('invalid dsn');\n }\n }\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"7226bb9e22bd404da59c419966ca0e23353a83e3"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Event.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Event.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}},"1":{"start":{"line":4,"column":27},"end":{"line":11,"column":3}},"2":{"start":{"line":7,"column":8},"end":{"line":7,"column":26}},"3":{"start":{"line":10,"column":4},"end":{"line":10,"column":17}},"4":{"start":{"line":12,"column":0},"end":{"line":12,"column":22}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":4,"column":27},"end":{"line":4,"column":28}},"loc":{"start":{"line":4,"column":39},"end":{"line":11,"column":1}},"line":4},"1":{"name":"Event","decl":{"start":{"line":5,"column":13},"end":{"line":5,"column":18}},"loc":{"start":{"line":5,"column":21},"end":{"line":9,"column":5}},"line":5}},"branchMap":{},"s":{"0":2,"1":2,"2":4,"3":2,"4":2},"f":{"0":2,"1":4},"b":{},"inputSourceMap":{"version":3,"file":"Event.js","sourceRoot":"","sources":["Event.ts"],"names":[],"mappings":";;AAEA,iCAAiC;AACjC;IAAA;QACE,cAAc;QACP,YAAO,GAAW,EAAE,CAAC;QAC5B,uCAAuC;IACzC,CAAC;IAAD,YAAC;AAAD,CAAC,AAJD,IAIC;AAJY,sBAAK","sourcesContent":["import { Severity } from './Severity';\n\n// TODO: Define real event object\nexport class Event {\n // id: string;\n public message: string = '';\n // severity?: Severity = Severity.Info;\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"a1838680e4a58ba4399a9e9028bec88ab75f9da0"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/LogLevel.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/LogLevel.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}},"1":{"start":{"line":4,"column":0},"end":{"line":9,"column":59}},"2":{"start":{"line":5,"column":4},"end":{"line":5,"column":44}},"3":{"start":{"line":6,"column":4},"end":{"line":6,"column":46}},"4":{"start":{"line":7,"column":4},"end":{"line":7,"column":46}},"5":{"start":{"line":8,"column":4},"end":{"line":8,"column":50}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":4,"column":1},"end":{"line":4,"column":2}},"loc":{"start":{"line":4,"column":21},"end":{"line":9,"column":1}},"line":4}},"branchMap":{"0":{"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":57}},"type":"binary-expr","locations":[{"start":{"line":9,"column":14},"end":{"line":9,"column":30}},{"start":{"line":9,"column":35},"end":{"line":9,"column":56}}],"line":9}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2},"f":{"0":2},"b":{"0":[2,2]},"inputSourceMap":{"version":3,"file":"LogLevel.js","sourceRoot":"","sources":["LogLevel.ts"],"names":[],"mappings":";;AAAA,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,yCAAS,CAAA;IACT,6CAAW,CAAA;AACb,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB","sourcesContent":["export enum LogLevel {\n None = 0,\n Error = 1,\n Debug = 2,\n Verbose = 3,\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"8580de5c1299286a9eaa68d132d5ca47498a2fe0"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/User.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/User.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}}},"fnMap":{},"branchMap":{},"s":{"0":2},"f":{},"b":{},"inputSourceMap":{"version":3,"file":"User.js","sourceRoot":"","sources":["User.ts"],"names":[],"mappings":"","sourcesContent":["export interface IUser {\n id?: string;\n email?: string;\n username?: string;\n extra?: any;\n}\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"359d7a0a0aa120dc38203685c8852e4e1fe606c4"} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/index.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/index.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":62}},"1":{"start":{"line":3,"column":14},"end":{"line":3,"column":32}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":30}},"3":{"start":{"line":5,"column":13},"end":{"line":5,"column":30}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":29}},"5":{"start":{"line":7,"column":19},"end":{"line":7,"column":42}},"6":{"start":{"line":8,"column":0},"end":{"line":8,"column":47}},"7":{"start":{"line":9,"column":17},"end":{"line":9,"column":38}},"8":{"start":{"line":10,"column":0},"end":{"line":10,"column":39}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2},"f":{},"b":{},"inputSourceMap":{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,iCAAgC;AAAvB,wBAAA,KAAK,CAAA;AACd,+BAA+B;AAAtB,uBAAA,KAAK,CAAA;AACd,2CAA2C;AAAlC,mCAAA,WAAW,CAAA;AACpB,uCAAsC;AAA7B,8BAAA,QAAQ,CAAA","sourcesContent":["export { Event } from './Event';\nexport { IUser } from './User';\nexport { IBreadcrumb } from './Breadcrumb';\nexport { LogLevel } from './LogLevel';\n"]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"b4b3f05e7bf6aea9abe62512ae9f0a54b5a6ba12"} | ||
{"/Users/haza/Projects/raven-js/packages/core/index.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/index.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":33}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":30}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":40}},"4":{"start":{"line":4,"column":9},"end":{"line":4,"column":17}},"5":{"start":{"line":5,"column":0},"end":{"line":5,"column":37}},"6":{"start":{"line":5,"column":9},"end":{"line":5,"column":15}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2},"f":{},"b":{}} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Client.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Client.ts","statementMap":{"0":{"start":{"line":2,"column":0},"end":{"line":2,"column":66}},"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":47}},"2":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}},"3":{"start":{"line":6,"column":0},"end":{"line":6,"column":38}},"4":{"start":{"line":8,"column":23},"end":{"line":8,"column":79}},"5":{"start":{"line":11,"column":0},"end":{"line":140,"column":0}},"6":{"start":{"line":19,"column":11},"end":{"line":22,"column":5}},"7":{"start":{"line":24,"column":4},"end":{"line":24,"column":28}},"8":{"start":{"line":25,"column":4},"end":{"line":25,"column":48}},"9":{"start":{"line":26,"column":4},"end":{"line":26,"column":16}},"10":{"start":{"line":29,"column":9},"end":{"line":34,"column":3}},"11":{"start":{"line":30,"column":4},"end":{"line":32,"column":5}},"12":{"start":{"line":31,"column":6},"end":{"line":31,"column":78}},"13":{"start":{"line":33,"column":4},"end":{"line":33,"column":30}},"14":{"start":{"line":36,"column":9},"end":{"line":48,"column":3}},"15":{"start":{"line":40,"column":4},"end":{"line":45,"column":5}},"16":{"start":{"line":42,"column":6},"end":{"line":44,"column":8}},"17":{"start":{"line":46,"column":4},"end":{"line":46,"column":47}},"18":{"start":{"line":47,"column":4},"end":{"line":47,"column":16}},"19":{"start":{"line":50,"column":9},"end":{"line":55,"column":3}},"20":{"start":{"line":50,"column":2},"end":{"line":55,"column":2}},"21":{"start":{"line":51,"column":4},"end":{"line":53,"column":5}},"22":{"start":{"line":52,"column":6},"end":{"line":52,"column":54}},"23":{"start":{"line":54,"column":4},"end":{"line":54,"column":46}},"24":{"start":{"line":54,"column":40},"end":{"line":54,"column":44}},"25":{"start":{"line":57,"column":15},"end":{"line":60,"column":3}},"26":{"start":{"line":58,"column":20},"end":{"line":58,"column":45}},"27":{"start":{"line":58,"column":10},"end":{"line":58,"column":45}},"28":{"start":{"line":59,"column":11},"end":{"line":59,"column":20}},"29":{"start":{"line":59,"column":21},"end":{"line":59,"column":62}},"30":{"start":{"line":59,"column":4},"end":{"line":59,"column":64}},"31":{"start":{"line":62,"column":15},"end":{"line":65,"column":3}},"32":{"start":{"line":63,"column":20},"end":{"line":63,"column":45}},"33":{"start":{"line":63,"column":10},"end":{"line":63,"column":45}},"34":{"start":{"line":64,"column":11},"end":{"line":64,"column":20}},"35":{"start":{"line":64,"column":21},"end":{"line":64,"column":58}},"36":{"start":{"line":64,"column":4},"end":{"line":64,"column":60}},"37":{"start":{"line":67,"column":15},"end":{"line":70,"column":3}},"38":{"start":{"line":68,"column":20},"end":{"line":68,"column":45}},"39":{"start":{"line":68,"column":10},"end":{"line":68,"column":45}},"40":{"start":{"line":69,"column":4},"end":{"line":69,"column":44}},"41":{"start":{"line":72,"column":15},"end":{"line":75,"column":3}},"42":{"start":{"line":73,"column":20},"end":{"line":73,"column":45}},"43":{"start":{"line":73,"column":10},"end":{"line":73,"column":45}},"44":{"start":{"line":74,"column":4},"end":{"line":74,"column":31}},"45":{"start":{"line":79,"column":9},"end":{"line":84,"column":3}},"46":{"start":{"line":79,"column":13},"end":{"line":79,"column":26}},"47":{"start":{"line":79,"column":13},"end":{"line":79,"column":27}},"48":{"start":{"line":80,"column":4},"end":{"line":83,"column":5}},"49":{"start":{"line":82,"column":6},"end":{"line":82,"column":27}},"50":{"start":{"line":88,"column":15},"end":{"line":92,"column":3}},"51":{"start":{"line":89,"column":20},"end":{"line":89,"column":45}},"52":{"start":{"line":89,"column":10},"end":{"line":89,"column":45}},"53":{"start":{"line":90,"column":4},"end":{"line":90,"column":37}},"54":{"start":{"line":90,"column":4},"end":{"line":90,"column":38}},"55":{"start":{"line":91,"column":4},"end":{"line":91,"column":16}},"56":{"start":{"line":96,"column":9},"end":{"line":99,"column":3}},"57":{"start":{"line":98,"column":4},"end":{"line":98,"column":48}},"58":{"start":{"line":101,"column":15},"end":{"line":106,"column":3}},"59":{"start":{"line":102,"column":4},"end":{"line":102,"column":45}},"60":{"start":{"line":103,"column":20},"end":{"line":103,"column":45}},"61":{"start":{"line":103,"column":10},"end":{"line":103,"column":45}},"62":{"start":{"line":104,"column":4},"end":{"line":104,"column":38}},"63":{"start":{"line":104,"column":4},"end":{"line":104,"column":39}},"64":{"start":{"line":105,"column":4},"end":{"line":105,"column":16}},"65":{"start":{"line":108,"column":15},"end":{"line":113,"column":3}},"66":{"start":{"line":109,"column":4},"end":{"line":109,"column":49}},"67":{"start":{"line":110,"column":20},"end":{"line":110,"column":45}},"68":{"start":{"line":110,"column":10},"end":{"line":110,"column":45}},"69":{"start":{"line":111,"column":4},"end":{"line":111,"column":38}},"70":{"start":{"line":111,"column":4},"end":{"line":111,"column":39}},"71":{"start":{"line":112,"column":4},"end":{"line":112,"column":16}},"72":{"start":{"line":115,"column":15},"end":{"line":120,"column":3}},"73":{"start":{"line":116,"column":4},"end":{"line":116,"column":51}},"74":{"start":{"line":117,"column":20},"end":{"line":117,"column":45}},"75":{"start":{"line":117,"column":10},"end":{"line":117,"column":45}},"76":{"start":{"line":118,"column":4},"end":{"line":118,"column":40}},"77":{"start":{"line":118,"column":4},"end":{"line":118,"column":41}},"78":{"start":{"line":119,"column":4},"end":{"line":119,"column":16}},"79":{"start":{"line":122,"column":15},"end":{"line":127,"column":3}},"80":{"start":{"line":123,"column":4},"end":{"line":123,"column":48}},"81":{"start":{"line":124,"column":20},"end":{"line":124,"column":45}},"82":{"start":{"line":124,"column":10},"end":{"line":124,"column":45}},"83":{"start":{"line":125,"column":4},"end":{"line":125,"column":32}},"84":{"start":{"line":125,"column":4},"end":{"line":125,"column":33}},"85":{"start":{"line":126,"column":4},"end":{"line":126,"column":16}},"86":{"start":{"line":131,"column":10},"end":{"line":139,"column":3}},"87":{"start":{"line":131,"column":2},"end":{"line":139,"column":2}},"88":{"start":{"line":132,"column":20},"end":{"line":132,"column":37}},"89":{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},"90":{"start":{"line":134,"column":6},"end":{"line":136,"column":8}},"91":{"start":{"line":138,"column":4},"end":{"line":138,"column":55}},"92":{"start":{"line":138,"column":40},"end":{"line":138,"column":53}},"93":{"start":{"line":140,"column":0},"end":{"line":140,"column":1}},"94":{"start":{"line":11,"column":13},"end":{"line":11,"column":19}}},"fnMap":{"0":{"name":"(anonymous_12)","decl":{"start":{"line":11,"column":0},"end":{"line":null,"column":-1}},"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":-1}}},"1":{"name":"Client","decl":{"start":{"line":17,"column":2},"end":{"line":18,"column":3}},"loc":{"start":{"line":22,"column":5},"end":{"line":27,"column":3}}},"2":{"name":"(anonymous_14)","decl":{"start":{"line":29,"column":2},"end":{"line":null,"column":-1}},"loc":{"start":{"line":29,"column":2},"end":{"line":34,"column":3}}},"3":{"name":"(anonymous_15)","decl":{"start":{"line":36,"column":2},"end":{"line":37,"column":3}},"loc":{"start":{"line":38,"column":15},"end":{"line":48,"column":3}}},"4":{"name":"(anonymous_16)","decl":{"start":{"line":50,"column":2},"end":{"line":null,"column":-1}},"loc":{"start":{"line":50,"column":2},"end":{"line":55,"column":3}}},"5":{"name":"(anonymous_17)","decl":{"start":{"line":54,"column":34},"end":{"line":54,"column":39}},"loc":{"start":{"line":54,"column":34},"end":{"line":54,"column":44}}},"6":{"name":"(anonymous_18)","decl":{"start":{"line":57,"column":2},"end":{"line":57,"column":31}},"loc":{"start":{"line":57,"column":48},"end":{"line":60,"column":3}}},"7":{"name":"(anonymous_21)","decl":{"start":{"line":62,"column":2},"end":{"line":62,"column":29}},"loc":{"start":{"line":62,"column":45},"end":{"line":65,"column":3}}},"8":{"name":"(anonymous_24)","decl":{"start":{"line":67,"column":2},"end":{"line":67,"column":32}},"loc":{"start":{"line":67,"column":51},"end":{"line":70,"column":3}}},"9":{"name":"(anonymous_27)","decl":{"start":{"line":72,"column":2},"end":{"line":72,"column":19}},"loc":{"start":{"line":72,"column":32},"end":{"line":75,"column":3}}},"10":{"name":"(anonymous_30)","decl":{"start":{"line":79,"column":2},"end":{"line":null,"column":-1}},"loc":{"start":{"line":79,"column":2},"end":{"line":84,"column":3}}},"11":{"name":"(anonymous_31)","decl":{"start":{"line":88,"column":2},"end":{"line":88,"column":25}},"loc":{"start":{"line":88,"column":41},"end":{"line":92,"column":3}}},"12":{"name":"(anonymous_34)","decl":{"start":{"line":96,"column":2},"end":{"line":null,"column":-1}},"loc":{"start":{"line":96,"column":2},"end":{"line":99,"column":3}}},"13":{"name":"(anonymous_35)","decl":{"start":{"line":101,"column":2},"end":{"line":101,"column":29}},"loc":{"start":{"line":101,"column":42},"end":{"line":106,"column":3}}},"14":{"name":"(anonymous_38)","decl":{"start":{"line":108,"column":2},"end":{"line":108,"column":29}},"loc":{"start":{"line":108,"column":59},"end":{"line":113,"column":3}}},"15":{"name":"(anonymous_41)","decl":{"start":{"line":115,"column":2},"end":{"line":115,"column":30}},"loc":{"start":{"line":115,"column":61},"end":{"line":120,"column":3}}},"16":{"name":"(anonymous_44)","decl":{"start":{"line":122,"column":2},"end":{"line":null,"column":-1}},"loc":{"start":{"line":122,"column":2},"end":{"line":127,"column":3}}},"17":{"name":"(anonymous_47)","decl":{"start":{"line":131,"column":2},"end":{"line":null,"column":-1}},"loc":{"start":{"line":131,"column":2},"end":{"line":139,"column":3}}},"18":{"name":"(anonymous_48)","decl":{"start":{"line":138,"column":34},"end":{"line":138,"column":39}},"loc":{"start":{"line":138,"column":34},"end":{"line":138,"column":53}}}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":11},"end":{"line":22,"column":5}},"type":"if","locations":[{"start":{"line":19,"column":11},"end":{"line":22,"column":5}},{"start":{"line":19,"column":11},"end":{"line":22,"column":5}}]},"1":{"loc":{"start":{"line":30,"column":4},"end":{"line":32,"column":5}},"type":"if","locations":[{"start":{"line":30,"column":4},"end":{"line":32,"column":5}},{"start":{"line":30,"column":4},"end":{"line":32,"column":5}}]},"2":{"loc":{"start":{"line":40,"column":4},"end":{"line":45,"column":5}},"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":45,"column":5}},{"start":{"line":40,"column":4},"end":{"line":45,"column":5}}]},"3":{"loc":{"start":{"line":51,"column":4},"end":{"line":53,"column":5}},"type":"if","locations":[{"start":{"line":51,"column":4},"end":{"line":53,"column":5}},{"start":{"line":51,"column":4},"end":{"line":53,"column":5}}]},"4":{"loc":{"start":{"line":80,"column":4},"end":{"line":83,"column":5}},"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":83,"column":5}},{"start":{"line":80,"column":4},"end":{"line":83,"column":5}}]},"5":{"loc":{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},"type":"if","locations":[{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},{"start":{"line":133,"column":4},"end":{"line":137,"column":5}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":78,"7":26,"8":20,"9":20,"10":2,"11":45,"12":1,"13":44,"14":2,"15":18,"16":1,"17":17,"18":17,"19":2,"20":15,"21":15,"22":14,"23":14,"24":14,"25":2,"26":2,"27":1,"28":1,"29":1,"30":1,"31":2,"32":3,"33":3,"34":3,"35":3,"36":3,"37":2,"38":1,"39":1,"40":1,"41":2,"42":3,"43":3,"44":3,"45":2,"46":2,"47":2,"48":2,"49":1,"50":2,"51":1,"52":1,"53":1,"54":1,"55":1,"56":2,"57":12,"58":2,"59":1,"60":1,"61":1,"62":1,"63":1,"64":1,"65":2,"66":6,"67":6,"68":6,"69":6,"70":6,"71":6,"72":2,"73":2,"74":2,"75":2,"76":2,"77":2,"78":2,"79":2,"80":3,"81":3,"82":3,"83":3,"84":3,"85":3,"86":2,"87":22,"88":22,"89":22,"90":1,"91":21,"92":21,"93":2,"94":2},"f":{"0":2,"1":26,"2":45,"3":18,"4":15,"5":14,"6":2,"7":3,"8":1,"9":3,"10":2,"11":1,"12":12,"13":1,"14":6,"15":2,"16":3,"17":22,"18":21},"b":{"0":[26,0],"1":[1,44],"2":[1,17],"3":[14,1],"4":[1,1],"5":[1,21]}} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Sentry.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Sentry.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},"1":{"start":{"line":7,"column":2},"end":{"line":7,"column":51}},"2":{"start":{"line":6,"column":0},"end":{"line":8,"column":1}},"3":{"start":{"line":11,"column":2},"end":{"line":11,"column":24}},"4":{"start":{"line":12,"column":2},"end":{"line":12,"column":16}},"5":{"start":{"line":10,"column":0},"end":{"line":13,"column":1}},"6":{"start":{"line":16,"column":2},"end":{"line":16,"column":22}},"7":{"start":{"line":15,"column":0},"end":{"line":17,"column":1}},"8":{"start":{"line":19,"column":0},"end":{"line":22,"column":0}},"9":{"start":{"line":21,"column":21},"end":{"line":21,"column":36}},"10":{"start":{"line":20,"column":9},"end":{"line":20,"column":30}},"11":{"start":{"line":22,"column":0},"end":{"line":22,"column":1}},"12":{"start":{"line":19,"column":13},"end":{"line":19,"column":24}}},"fnMap":{"0":{"name":"create","decl":{"start":{"line":6,"column":0},"end":{"line":6,"column":22}},"loc":{"start":{"line":6,"column":54},"end":{"line":8,"column":1}}},"1":{"name":"setSharedClient","decl":{"start":{"line":10,"column":0},"end":{"line":10,"column":31}},"loc":{"start":{"line":10,"column":46},"end":{"line":13,"column":1}}},"2":{"name":"getSharedClient","decl":{"start":{"line":15,"column":0},"end":{"line":null,"column":-1}},"loc":{"start":{"line":15,"column":0},"end":{"line":17,"column":1}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":19,"column":0},"end":{"line":null,"column":-1}},"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":-1}}},"4":{"name":"SentryError","decl":{"start":{"line":21,"column":2},"end":{"line":21,"column":20}},"loc":{"start":{"line":21,"column":36},"end":{"line":21,"column":40}}}},"branchMap":{},"s":{"0":2,"1":1,"2":2,"3":1,"4":1,"5":2,"6":1,"7":2,"8":2,"9":8,"10":8,"11":2,"12":2},"f":{"0":1,"1":1,"2":1,"3":2,"4":8},"b":{}} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Context.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Context.ts","statementMap":{"0":{"start":{"line":10,"column":2},"end":{"line":10,"column":12}},"1":{"start":{"line":9,"column":0},"end":{"line":11,"column":1}},"2":{"start":{"line":18,"column":2},"end":{"line":18,"column":23}},"3":{"start":{"line":13,"column":0},"end":{"line":19,"column":1}},"4":{"start":{"line":26,"column":2},"end":{"line":28,"column":3}},"5":{"start":{"line":27,"column":4},"end":{"line":27,"column":26}},"6":{"start":{"line":29,"column":2},"end":{"line":33,"column":3}},"7":{"start":{"line":30,"column":4},"end":{"line":30,"column":24}},"8":{"start":{"line":32,"column":4},"end":{"line":32,"column":39}},"9":{"start":{"line":21,"column":0},"end":{"line":34,"column":1}}},"fnMap":{"0":{"name":"getDefaultContext","decl":{"start":{"line":9,"column":0},"end":{"line":null,"column":-1}},"loc":{"start":{"line":9,"column":0},"end":{"line":11,"column":1}}},"1":{"name":"set","decl":{"start":{"line":13,"column":0},"end":{"line":14,"column":1}},"loc":{"start":{"line":16,"column":12},"end":{"line":19,"column":1}}},"2":{"name":"mergeIn","decl":{"start":{"line":21,"column":0},"end":{"line":22,"column":1}},"loc":{"start":{"line":24,"column":12},"end":{"line":34,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":26,"column":2},"end":{"line":28,"column":3}},"type":"if","locations":[{"start":{"line":26,"column":2},"end":{"line":28,"column":3}},{"start":{"line":26,"column":2},"end":{"line":28,"column":3}}]},"1":{"loc":{"start":{"line":29,"column":2},"end":{"line":33,"column":3}},"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":33,"column":3}},{"start":{"line":29,"column":2},"end":{"line":33,"column":3}}]}},"s":{"0":23,"1":2,"2":8,"3":2,"4":8,"5":7,"6":8,"7":3,"8":5,"9":2},"f":{"0":23,"1":8,"2":8},"b":{"0":[7,1],"1":[3,5]}} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/DSN.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/DSN.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}},"1":{"start":{"line":13,"column":18},"end":{"line":13,"column":79}},"2":{"start":{"line":15,"column":0},"end":{"line":48,"column":0}},"3":{"start":{"line":20,"column":4},"end":{"line":20,"column":31}},"4":{"start":{"line":21,"column":4},"end":{"line":21,"column":20}},"5":{"start":{"line":22,"column":4},"end":{"line":22,"column":16}},"6":{"start":{"line":25,"column":9},"end":{"line":30,"column":3}},"7":{"start":{"line":26,"column":4},"end":{"line":29,"column":6}},"8":{"start":{"line":32,"column":10},"end":{"line":47,"column":3}},"9":{"start":{"line":33,"column":18},"end":{"line":33,"column":48}},"10":{"start":{"line":34,"column":4},"end":{"line":46,"column":5}},"11":{"start":{"line":35,"column":6},"end":{"line":43,"column":8}},"12":{"start":{"line":45,"column":6},"end":{"line":45,"column":43}},"13":{"start":{"line":48,"column":0},"end":{"line":48,"column":1}},"14":{"start":{"line":15,"column":13},"end":{"line":15,"column":16}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":15,"column":0},"end":{"line":null,"column":-1}},"loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":-1}}},"1":{"name":"DSN","decl":{"start":{"line":19,"column":2},"end":{"line":19,"column":13}},"loc":{"start":{"line":19,"column":31},"end":{"line":23,"column":3}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":25,"column":2},"end":{"line":25,"column":15}},"loc":{"start":{"line":25,"column":33},"end":{"line":30,"column":3}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":32,"column":2},"end":{"line":null,"column":-1}},"loc":{"start":{"line":32,"column":2},"end":{"line":47,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":27,"column":59},"end":{"line":27,"column":72}},"type":"cond-expr","locations":[{"start":{"line":27,"column":59},"end":{"line":27,"column":72}},{"start":{"line":27,"column":75},"end":{"line":27,"column":77}}]},"1":{"loc":{"start":{"line":28,"column":42},"end":{"line":28,"column":61}},"type":"cond-expr","locations":[{"start":{"line":28,"column":42},"end":{"line":28,"column":61}},{"start":{"line":28,"column":64},"end":{"line":28,"column":66}}]},"2":{"loc":{"start":{"line":34,"column":4},"end":{"line":46,"column":5}},"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":46,"column":5}},{"start":{"line":34,"column":4},"end":{"line":46,"column":5}}]},"3":{"loc":{"start":{"line":39,"column":14},"end":{"line":39,"column":22}},"type":"binary-expr","locations":[{"start":{"line":39,"column":14},"end":{"line":39,"column":22}},{"start":{"line":39,"column":26},"end":{"line":39,"column":28}}]},"4":{"loc":{"start":{"line":41,"column":14},"end":{"line":41,"column":22}},"type":"binary-expr","locations":[{"start":{"line":41,"column":14},"end":{"line":41,"column":22}},{"start":{"line":41,"column":26},"end":{"line":41,"column":28}}]}},"s":{"0":2,"1":2,"2":2,"3":26,"4":26,"5":20,"6":2,"7":4,"8":2,"9":26,"10":26,"11":20,"12":6,"13":2,"14":2},"f":{"0":2,"1":26,"2":4,"3":26},"b":{"0":[2,2],"1":[2,2],"2":[20,6],"3":[20,0],"4":[20,19]}} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Event.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/Event.ts","statementMap":{"0":{"start":{"line":4,"column":0},"end":{"line":8,"column":0}},"1":{"start":{"line":6,"column":9},"end":{"line":6,"column":30}},"2":{"start":{"line":8,"column":0},"end":{"line":8,"column":1}},"3":{"start":{"line":4,"column":13},"end":{"line":4,"column":18}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":4,"column":0},"end":{"line":null,"column":-1}},"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":-1}}}},"branchMap":{},"s":{"0":2,"1":4,"2":2,"3":2},"f":{"0":6},"b":{}} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/LogLevel.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/LogLevel.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},"1":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}},"2":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}},"3":{"start":{"line":4,"column":2},"end":{"line":4,"column":11}},"4":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}},"loc":{"start":{"line":1,"column":20},"end":{"line":6,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}},"type":"binary-expr","locations":[{"start":{"line":1,"column":12},"end":{"line":1,"column":20}},{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}]}},"s":{"0":2,"1":2,"2":2,"3":2,"4":2},"f":{"0":2},"b":{"0":[2,2]}} | ||
,"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/index.ts": {"path":"/Users/haza/Projects/raven-js/packages/core/lib/Interfaces/index.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}},"1":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}},"3":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}},"4":{"start":{"line":3,"column":0},"end":{"line":3,"column":42}},"5":{"start":{"line":3,"column":9},"end":{"line":3,"column":20}},"6":{"start":{"line":4,"column":0},"end":{"line":4,"column":37}},"7":{"start":{"line":4,"column":9},"end":{"line":4,"column":17}}},"fnMap":{},"branchMap":{},"s":{"0":2,"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2},"f":{},"b":{}} | ||
} |
@@ -9,3 +9,3 @@ import * as Sentry from '../index'; | ||
install(): Promise<boolean>; | ||
setOptions(options: IMockAdapterOptions): this; | ||
setOptions(options: IMockAdapterOptions): Promise<this>; | ||
captureException(exception: Error): Promise<Sentry.Event>; | ||
@@ -15,10 +15,11 @@ captureMessage(message: string): Promise<Sentry.Event>; | ||
send(event: Sentry.Event): Promise<Sentry.Event>; | ||
setUserContext(user?: Sentry.IUser): this; | ||
setUserContext(user?: Sentry.IUser): Promise<this>; | ||
setTagsContext(tags?: { | ||
[key: string]: any; | ||
}): this; | ||
}): Promise<this>; | ||
setExtraContext(extra?: { | ||
[key: string]: any; | ||
}): this; | ||
clearContext(): this; | ||
}): Promise<this>; | ||
clearContext(): Promise<this>; | ||
setRelease(release: string): Promise<this>; | ||
} |
@@ -49,4 +49,8 @@ "use strict"; | ||
MockAdapter.prototype.setOptions = function (options) { | ||
// We need nothing here | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
// We need nothing here | ||
return [2 /*return*/, this]; | ||
}); | ||
}); | ||
}; | ||
@@ -77,13 +81,36 @@ MockAdapter.prototype.captureException = function (exception) { | ||
MockAdapter.prototype.setUserContext = function (user) { | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this]; | ||
}); | ||
}); | ||
}; | ||
MockAdapter.prototype.setTagsContext = function (tags) { | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this]; | ||
}); | ||
}); | ||
}; | ||
MockAdapter.prototype.setExtraContext = function (extra) { | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this]; | ||
}); | ||
}); | ||
}; | ||
MockAdapter.prototype.clearContext = function () { | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this]; | ||
}); | ||
}); | ||
}; | ||
MockAdapter.prototype.setRelease = function (release) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this]; | ||
}); | ||
}); | ||
}; | ||
return MockAdapter; | ||
@@ -90,0 +117,0 @@ }()); |
@@ -67,2 +67,5 @@ "use strict"; | ||
expect(function () { | ||
new Sentry.Client('https://username:@domain'); | ||
}).toThrow(); | ||
expect(function () { | ||
new Sentry.Client('123'); | ||
@@ -103,2 +106,22 @@ }).toThrow(); | ||
}); }); | ||
test('multiple install calls on Adapter should only call once', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry, spy1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(1); | ||
sentry = new Sentry.Client(dsn); | ||
sentry.use(MockAdapter_1.MockAdapter, { testOption: true }); | ||
spy1 = jest.spyOn(sentry.getAdapter(), 'install'); | ||
return [4 /*yield*/, sentry.install()]; | ||
case 1: | ||
_a.sent(); | ||
return [4 /*yield*/, sentry.install()]; | ||
case 2: | ||
_a.sent(); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
test('no registered Adapter', function () { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -256,3 +279,32 @@ var sentry, e_1; | ||
}); | ||
test('should throw error without calling install', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry; | ||
return __generator(this, function (_a) { | ||
expect.assertions(1); | ||
sentry = new Sentry.Client(dsn).use(MockAdapter_1.MockAdapter); | ||
return [2 /*return*/, expect(sentry.captureException(new Error('oops'))).rejects.toEqual({ | ||
message: 'Please call install() before calling other methods on Sentry', | ||
name: 'SentryError', | ||
})]; | ||
}); | ||
}); }); | ||
test('call setRelease on Adapter', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry, spy; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(1); | ||
return [4 /*yield*/, new Sentry.Client(dsn).use(MockAdapter_1.MockAdapter).install()]; | ||
case 1: | ||
sentry = _a.sent(); | ||
spy = jest.spyOn(sentry.getAdapter(), 'setRelease'); | ||
return [4 /*yield*/, sentry.setRelease('#oops')]; | ||
case 2: | ||
_a.sent(); | ||
expect(spy).toBeCalled(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
}); | ||
//# sourceMappingURL=client.js.map |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var _this = this; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/// <reference types="jest" /> | ||
var MockAdapter_1 = require("../__mocks__/MockAdapter"); | ||
var Sentry = require("../index"); | ||
var MockAdapter_1 = require("../__mocks__/MockAdapter"); | ||
var dsn = 'https://username:password@domain/path'; | ||
@@ -11,55 +47,129 @@ beforeEach(function () { | ||
describe('Sentry.Client context', function () { | ||
test('set tags', function () { | ||
var sentry = new Sentry.Client('https://username:password@domain/path'); | ||
var adapter = sentry.use(MockAdapter_1.MockAdapter); | ||
var spy1 = jest.spyOn(adapter, 'setTagsContext'); | ||
sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
}); | ||
test('set extra and tags', function () { | ||
var sentry = new Sentry.Client('https://username:password@domain/path'); | ||
var adapter = sentry.use(MockAdapter_1.MockAdapter); | ||
var spy1 = jest.spyOn(adapter, 'setExtraContext'); | ||
sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
sentry.setExtraContext({ foo: 13 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 }, extra: { foo: 13 } }); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
}); | ||
test('clear context', function () { | ||
var sentry = new Sentry.Client('https://username:password@domain/path'); | ||
var adapter = sentry.use(MockAdapter_1.MockAdapter); | ||
var spy1 = jest.spyOn(adapter, 'clearContext'); | ||
sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
sentry.clearContext(); | ||
expect(sentry.getContext()).toEqual({}); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
}); | ||
test('set undefined', function () { | ||
var sentry = new Sentry.Client('https://username:password@domain/path'); | ||
var adapter = sentry.use(MockAdapter_1.MockAdapter); | ||
sentry.setTagsContext(undefined); | ||
expect(sentry.getContext()).toEqual({}); | ||
sentry.setTagsContext({ yo: 12 }); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
sentry.setTagsContext(undefined); | ||
expect(sentry.getContext()).toEqual({}); | ||
sentry.setExtraContext(undefined); | ||
expect(sentry.getContext()).toEqual({}); | ||
sentry.clearContext(); | ||
expect(sentry.getContext()).toEqual({}); | ||
}); | ||
test('set user', function () { | ||
var sentry = new Sentry.Client('https://username:password@domain/path'); | ||
var adapter = sentry.use(MockAdapter_1.MockAdapter); | ||
sentry.setUserContext({ | ||
id: 'test' | ||
test('set tags', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry, adapter, spy1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(2); | ||
sentry = new Sentry.Client('https://username:password@domain/path'); | ||
return [4 /*yield*/, sentry.use(MockAdapter_1.MockAdapter).install()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
spy1 = jest.spyOn(adapter, 'setTagsContext'); | ||
return [4 /*yield*/, sentry.setTagsContext({ yo: 12 })]; | ||
case 2: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
expect(sentry.getContext()).toEqual({ user: { id: 'test' } }); | ||
sentry.clearContext(); | ||
expect(sentry.getContext()).toEqual({}); | ||
}); | ||
}); }); | ||
test('set extra and tags', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry, adapter, spy1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(3); | ||
sentry = new Sentry.Client('https://username:password@domain/path'); | ||
return [4 /*yield*/, sentry.use(MockAdapter_1.MockAdapter).install()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
spy1 = jest.spyOn(adapter, 'setExtraContext'); | ||
return [4 /*yield*/, sentry.setTagsContext({ yo: 12 })]; | ||
case 2: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
return [4 /*yield*/, sentry.setExtraContext({ foo: 13 })]; | ||
case 3: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 }, extra: { foo: 13 } }); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
test('clear context', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry, adapter, spy1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(3); | ||
sentry = new Sentry.Client('https://username:password@domain/path'); | ||
return [4 /*yield*/, sentry.use(MockAdapter_1.MockAdapter).install()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
spy1 = jest.spyOn(adapter, 'clearContext'); | ||
return [4 /*yield*/, sentry.setTagsContext({ yo: 12 })]; | ||
case 2: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
return [4 /*yield*/, sentry.clearContext()]; | ||
case 3: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({}); | ||
expect(spy1).toHaveBeenCalledTimes(1); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
test('set undefined', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry, adapter; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(5); | ||
sentry = new Sentry.Client('https://username:password@domain/path'); | ||
return [4 /*yield*/, sentry.use(MockAdapter_1.MockAdapter).install()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
return [4 /*yield*/, sentry.setTagsContext(undefined)]; | ||
case 2: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({}); | ||
return [4 /*yield*/, sentry.setTagsContext({ yo: 12 })]; | ||
case 3: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({ tags: { yo: 12 } }); | ||
return [4 /*yield*/, sentry.setTagsContext(undefined)]; | ||
case 4: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({}); | ||
return [4 /*yield*/, sentry.setExtraContext(undefined)]; | ||
case 5: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({}); | ||
return [4 /*yield*/, sentry.clearContext()]; | ||
case 6: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({}); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
test('set user', function () { return __awaiter(_this, void 0, void 0, function () { | ||
var sentry, adapter; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
expect.assertions(2); | ||
sentry = new Sentry.Client('https://username:password@domain/path'); | ||
return [4 /*yield*/, sentry.use(MockAdapter_1.MockAdapter).install()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
return [4 /*yield*/, sentry.setUserContext({ | ||
id: 'test', | ||
})]; | ||
case 2: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({ user: { id: 'test' } }); | ||
return [4 /*yield*/, sentry.clearContext()]; | ||
case 3: | ||
_a.sent(); | ||
expect(sentry.getContext()).toEqual({}); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
}); | ||
//# sourceMappingURL=context.js.map |
@@ -5,3 +5,3 @@ import { Event, IBreadcrumb, IUser } from './Interfaces'; | ||
install(): Promise<boolean>; | ||
setOptions(options: {}): IAdapter; | ||
setOptions(options: {}): Promise<IAdapter>; | ||
send(event: Event): Promise<Event>; | ||
@@ -11,10 +11,11 @@ captureException(exception: Error): Promise<Event>; | ||
captureBreadcrumb(crumb: IBreadcrumb): Promise<IBreadcrumb>; | ||
setUserContext?(user?: IUser): IAdapter; | ||
setTagsContext?(tags?: { | ||
setRelease(release: string): Promise<IAdapter>; | ||
setUserContext(user?: IUser): Promise<IAdapter>; | ||
setTagsContext(tags?: { | ||
[key: string]: any; | ||
}): IAdapter; | ||
setExtraContext?(extra?: { | ||
}): Promise<IAdapter>; | ||
setExtraContext(extra?: { | ||
[key: string]: any; | ||
}): IAdapter; | ||
clearContext?(): IAdapter; | ||
}): Promise<IAdapter>; | ||
clearContext(): Promise<IAdapter>; | ||
} |
@@ -12,3 +12,2 @@ import * as Adapter from './Adapter'; | ||
constructor(dsn: string, options?: IOptions); | ||
getContext(): any; | ||
getAdapter<A extends Adapter.IAdapter>(): A; | ||
@@ -24,11 +23,13 @@ use<A extends Adapter.IAdapter, O extends {}>(adapter: { | ||
log(...args: any[]): void; | ||
setUserContext(user?: IUser): this; | ||
setRelease(release: string): Promise<this>; | ||
getContext(): any; | ||
setUserContext(user?: IUser): Promise<this>; | ||
setTagsContext(tags?: { | ||
[key: string]: any; | ||
}): this; | ||
}): Promise<this>; | ||
setExtraContext(extra?: { | ||
[key: string]: any; | ||
}): this; | ||
clearContext(): this; | ||
}): Promise<this>; | ||
clearContext(): Promise<this>; | ||
private awaitAdapter(); | ||
} |
@@ -42,2 +42,3 @@ "use strict"; | ||
var Sentry_1 = require("./Sentry"); | ||
var stringify = require('../../../vendor/json-stringify-safe/stringify'); | ||
var Client = /** @class */ (function () { | ||
@@ -54,6 +55,2 @@ function Client(dsn, options) { | ||
} | ||
Client.prototype.getContext = function () { | ||
// TODO: check for cyclic objects | ||
return JSON.parse(JSON.stringify(this._context)); | ||
}; | ||
Client.prototype.getAdapter = function () { | ||
@@ -148,42 +145,94 @@ if (!this._adapter) { | ||
// ----------------------- | ||
Client.prototype.setRelease = function (release) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adapter; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.awaitAdapter()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
return [4 /*yield*/, adapter.setRelease(release)]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/, this]; | ||
} | ||
}); | ||
}); | ||
}; | ||
// ---------------- CONTEXT | ||
Client.prototype.getContext = function () { | ||
// TODO: check for cyclic objects | ||
return JSON.parse(stringify(this._context)); | ||
}; | ||
Client.prototype.setUserContext = function (user) { | ||
Context.set(this._context, 'user', user); | ||
// TODO: Remove this once we moved code away from adapters | ||
var adapter = this.getAdapter(); | ||
if (adapter.setUserContext) { | ||
adapter.setUserContext(user); | ||
} | ||
// ------------------------------------------------------- | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adapter; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
Context.set(this._context, 'user', user); | ||
return [4 /*yield*/, this.awaitAdapter()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
return [4 /*yield*/, adapter.setUserContext(user)]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/, this]; | ||
} | ||
}); | ||
}); | ||
}; | ||
Client.prototype.setTagsContext = function (tags) { | ||
Context.mergeIn(this._context, 'tags', tags); | ||
// TODO: Remove this once we moved code away from adapters | ||
var adapter = this.getAdapter(); | ||
if (adapter.setTagsContext) { | ||
adapter.setTagsContext(tags); | ||
} | ||
// ------------------------------------------------------- | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adapter; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
Context.mergeIn(this._context, 'tags', tags); | ||
return [4 /*yield*/, this.awaitAdapter()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
return [4 /*yield*/, adapter.setTagsContext(tags)]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/, this]; | ||
} | ||
}); | ||
}); | ||
}; | ||
Client.prototype.setExtraContext = function (extra) { | ||
Context.mergeIn(this._context, 'extra', extra); | ||
// TODO: Remove this once we moved code away from adapters | ||
var adapter = this.getAdapter(); | ||
if (adapter.setExtraContext) { | ||
adapter.setExtraContext(extra); | ||
} | ||
// ------------------------------------------------------- | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adapter; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
Context.mergeIn(this._context, 'extra', extra); | ||
return [4 /*yield*/, this.awaitAdapter()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
return [4 /*yield*/, adapter.setExtraContext(extra)]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/, this]; | ||
} | ||
}); | ||
}); | ||
}; | ||
Client.prototype.clearContext = function () { | ||
this._context = Context.getDefaultContext(); | ||
// TODO: Remove this once we moved code away from adapters | ||
var adapter = this.getAdapter(); | ||
if (adapter.clearContext) { | ||
adapter.clearContext(); | ||
} | ||
// ------------------------------------------------------- | ||
return this; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adapter; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
this._context = Context.getDefaultContext(); | ||
return [4 /*yield*/, this.awaitAdapter()]; | ||
case 1: | ||
adapter = _a.sent(); | ||
return [4 /*yield*/, adapter.clearContext()]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/, this]; | ||
} | ||
}); | ||
}); | ||
}; | ||
@@ -190,0 +239,0 @@ // ------------------------ |
@@ -6,3 +6,3 @@ import { Event, IBreadcrumb, IUser } from './Interfaces'; | ||
install(): Promise<boolean>; | ||
setOptions(options: {}): IAdapter; | ||
setOptions(options: {}): Promise<IAdapter>; | ||
send(event: Event): Promise<Event>; | ||
@@ -13,8 +13,8 @@ captureException(exception: Error): Promise<Event>; | ||
// These should be removed at some point in the future | ||
// only the client should handle global stuff | ||
setUserContext?(user?: IUser): IAdapter; | ||
setTagsContext?(tags?: { [key: string]: any }): IAdapter; | ||
setExtraContext?(extra?: { [key: string]: any }): IAdapter; | ||
clearContext?(): IAdapter; | ||
setRelease(release: string): Promise<IAdapter>; | ||
setUserContext(user?: IUser): Promise<IAdapter>; | ||
setTagsContext(tags?: { [key: string]: any }): Promise<IAdapter>; | ||
setExtraContext(extra?: { [key: string]: any }): Promise<IAdapter>; | ||
clearContext(): Promise<IAdapter>; | ||
} |
@@ -26,7 +26,2 @@ import * as Adapter from './Adapter'; | ||
public getContext() { | ||
// TODO: check for cyclic objects | ||
return JSON.parse(JSON.stringify(this._context)); | ||
} | ||
public getAdapter<A extends Adapter.IAdapter>(): A { | ||
@@ -91,45 +86,40 @@ if (!this._adapter) { | ||
public async setRelease(release: string) { | ||
const adapter = await this.awaitAdapter(); | ||
await adapter.setRelease(release); | ||
return this; | ||
} | ||
// ---------------- CONTEXT | ||
public setUserContext(user?: IUser) { | ||
public getContext() { | ||
// TODO: check for cyclic objects | ||
return JSON.parse(JSON.stringify(this._context)); | ||
} | ||
public async setUserContext(user?: IUser) { | ||
Context.set(this._context, 'user', user); | ||
// TODO: Remove this once we moved code away from adapters | ||
const adapter = this.getAdapter(); | ||
if (adapter.setUserContext) { | ||
adapter.setUserContext(user); | ||
} | ||
// ------------------------------------------------------- | ||
const adapter = await this.awaitAdapter(); | ||
await adapter.setUserContext(user); | ||
return this; | ||
} | ||
public setTagsContext(tags?: { [key: string]: any }) { | ||
public async setTagsContext(tags?: { [key: string]: any }) { | ||
Context.mergeIn(this._context, 'tags', tags); | ||
// TODO: Remove this once we moved code away from adapters | ||
const adapter = this.getAdapter(); | ||
if (adapter.setTagsContext) { | ||
adapter.setTagsContext(tags); | ||
} | ||
// ------------------------------------------------------- | ||
const adapter = await this.awaitAdapter(); | ||
await adapter.setTagsContext(tags); | ||
return this; | ||
} | ||
public setExtraContext(extra?: { [key: string]: any }) { | ||
public async setExtraContext(extra?: { [key: string]: any }) { | ||
Context.mergeIn(this._context, 'extra', extra); | ||
// TODO: Remove this once we moved code away from adapters | ||
const adapter = this.getAdapter(); | ||
if (adapter.setExtraContext) { | ||
adapter.setExtraContext(extra); | ||
} | ||
// ------------------------------------------------------- | ||
const adapter = await this.awaitAdapter(); | ||
await adapter.setExtraContext(extra); | ||
return this; | ||
} | ||
public clearContext() { | ||
public async clearContext() { | ||
this._context = Context.getDefaultContext(); | ||
// TODO: Remove this once we moved code away from adapters | ||
const adapter = this.getAdapter(); | ||
if (adapter.clearContext) { | ||
adapter.clearContext(); | ||
} | ||
// ------------------------------------------------------- | ||
const adapter = await this.awaitAdapter(); | ||
await adapter.clearContext(); | ||
return this; | ||
@@ -136,0 +126,0 @@ } |
{ | ||
"name": "@sentry/core", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Sentry core implementation for all JavaScript related SDKs", | ||
@@ -12,13 +12,13 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/jest": "^21.1.2", | ||
"@types/node": "^8.0.32", | ||
"@types/jest": "^21.1.8", | ||
"@types/node": "^8.5.1", | ||
"jest": "^21.2.1", | ||
"npm-run-all": "^4.1.2", | ||
"prettier": "^1.8.0", | ||
"ts-jest": "21.2.2", | ||
"ts-node": "^3.3.0", | ||
"prettier": "^1.9.2", | ||
"ts-jest": "^21.2.4", | ||
"ts-node": "^4.0.2", | ||
"tslint": "^5.8.0", | ||
"tslint-config-prettier": "^1.6.0", | ||
"tslint-eslint-rules": "^4.1.1", | ||
"typescript": "2.6.1", | ||
"typescript": "2.6.2", | ||
"vrsource-tslint-rules": "^5.8.0" | ||
@@ -40,2 +40,8 @@ }, | ||
"jest": { | ||
"globals": { | ||
"ts-jest": { | ||
"tsConfigFile": "./tsconfig.json" | ||
} | ||
}, | ||
"mapCoverage": true, | ||
"collectCoverage": true, | ||
@@ -46,3 +52,3 @@ "coveragePathIgnorePatterns": [ | ||
"transform": { | ||
"^.+\\.tsx?$": "<rootDir>/node_modules/ts-jest/preprocessor.js" | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
@@ -49,0 +55,0 @@ "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2236
346556