@vigilly/browser 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +52 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/package.json +22 -0
- package/src/index.ts +59 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@vigilly/browser` — the Vigilly exceptions client for browsers.
|
|
3
|
+
*
|
|
4
|
+
* A thin, branded wrapper around the MIT-licensed `@sentry/browser` SDK. It
|
|
5
|
+
* presets the transport to Vigilly's ingest (via the SDK's `tunnel` option,
|
|
6
|
+
* pointing at `https://<host>/api/observe/<projectId>/envelope/`) and exposes
|
|
7
|
+
* only the exception-reporting surface Vigilly supports today.
|
|
8
|
+
*
|
|
9
|
+
* import { Vigilly } from "@vigilly/browser";
|
|
10
|
+
* Vigilly.init({ dsn: "https://<publicKey>@vigilly.dev/<projectId>" });
|
|
11
|
+
* Vigilly.captureException(new Error("boom"));
|
|
12
|
+
*/
|
|
13
|
+
import * as Sentry from "@sentry/browser";
|
|
14
|
+
import { type VigillyOptions } from "@vigilly/core";
|
|
15
|
+
/**
|
|
16
|
+
* Initialise the Vigilly browser client. Wraps `Sentry.init`, routing all
|
|
17
|
+
* envelopes to `https://<host>/api/observe/<projectId>/envelope/`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function init(options: VigillyOptions): ReturnType<typeof Sentry.init>;
|
|
20
|
+
export declare const captureException: typeof Sentry.captureException;
|
|
21
|
+
export declare const captureMessage: typeof Sentry.captureMessage;
|
|
22
|
+
export declare const addBreadcrumb: typeof Sentry.addBreadcrumb;
|
|
23
|
+
export declare const setContext: typeof Sentry.setContext;
|
|
24
|
+
export declare const setTag: typeof Sentry.setTag;
|
|
25
|
+
export declare const setTags: typeof Sentry.setTags;
|
|
26
|
+
export declare const setExtra: typeof Sentry.setExtra;
|
|
27
|
+
export declare const setExtras: typeof Sentry.setExtras;
|
|
28
|
+
export declare const setUser: typeof Sentry.setUser;
|
|
29
|
+
export declare const withScope: typeof Sentry.withScope;
|
|
30
|
+
export declare const getCurrentScope: typeof Sentry.getCurrentScope;
|
|
31
|
+
export declare const flush: typeof Sentry.flush;
|
|
32
|
+
export declare const close: typeof Sentry.close;
|
|
33
|
+
/** Convenience namespace mirroring the named exports. */
|
|
34
|
+
export declare const Vigilly: {
|
|
35
|
+
init: typeof init;
|
|
36
|
+
captureException: typeof Sentry.captureException;
|
|
37
|
+
captureMessage: typeof Sentry.captureMessage;
|
|
38
|
+
addBreadcrumb: typeof Sentry.addBreadcrumb;
|
|
39
|
+
setContext: typeof Sentry.setContext;
|
|
40
|
+
setTag: typeof Sentry.setTag;
|
|
41
|
+
setTags: typeof Sentry.setTags;
|
|
42
|
+
setExtra: typeof Sentry.setExtra;
|
|
43
|
+
setExtras: typeof Sentry.setExtras;
|
|
44
|
+
setUser: typeof Sentry.setUser;
|
|
45
|
+
withScope: typeof Sentry.withScope;
|
|
46
|
+
getCurrentScope: typeof Sentry.getCurrentScope;
|
|
47
|
+
flush: typeof Sentry.flush;
|
|
48
|
+
close: typeof Sentry.close;
|
|
49
|
+
};
|
|
50
|
+
export default Vigilly;
|
|
51
|
+
export type { VigillyOptions, VigillyBreadcrumb } from "@vigilly/core";
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAE5E;AAGD,eAAO,MAAM,gBAAgB,gCAA0B,CAAC;AACxD,eAAO,MAAM,cAAc,8BAAwB,CAAC;AACpD,eAAO,MAAM,aAAa,6BAAuB,CAAC;AAClD,eAAO,MAAM,UAAU,0BAAoB,CAAC;AAC5C,eAAO,MAAM,MAAM,sBAAgB,CAAC;AACpC,eAAO,MAAM,OAAO,uBAAiB,CAAC;AACtC,eAAO,MAAM,QAAQ,wBAAkB,CAAC;AACxC,eAAO,MAAM,SAAS,yBAAmB,CAAC;AAC1C,eAAO,MAAM,OAAO,uBAAiB,CAAC;AACtC,eAAO,MAAM,SAAS,yBAAmB,CAAC;AAC1C,eAAO,MAAM,eAAe,+BAAyB,CAAC;AACtD,eAAO,MAAM,KAAK,qBAAe,CAAC;AAClC,eAAO,MAAM,KAAK,qBAAe,CAAC;AAElC,yDAAyD;AACzD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAenB,CAAC;AAEF,eAAe,OAAO,CAAC;AAEvB,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Vigilly = exports.close = exports.flush = exports.getCurrentScope = exports.withScope = exports.setUser = exports.setExtras = exports.setExtra = exports.setTags = exports.setTag = exports.setContext = exports.addBreadcrumb = exports.captureMessage = exports.captureException = void 0;
|
|
37
|
+
exports.init = init;
|
|
38
|
+
/**
|
|
39
|
+
* `@vigilly/browser` — the Vigilly exceptions client for browsers.
|
|
40
|
+
*
|
|
41
|
+
* A thin, branded wrapper around the MIT-licensed `@sentry/browser` SDK. It
|
|
42
|
+
* presets the transport to Vigilly's ingest (via the SDK's `tunnel` option,
|
|
43
|
+
* pointing at `https://<host>/api/observe/<projectId>/envelope/`) and exposes
|
|
44
|
+
* only the exception-reporting surface Vigilly supports today.
|
|
45
|
+
*
|
|
46
|
+
* import { Vigilly } from "@vigilly/browser";
|
|
47
|
+
* Vigilly.init({ dsn: "https://<publicKey>@vigilly.dev/<projectId>" });
|
|
48
|
+
* Vigilly.captureException(new Error("boom"));
|
|
49
|
+
*/
|
|
50
|
+
const Sentry = __importStar(require("@sentry/browser"));
|
|
51
|
+
const core_1 = require("@vigilly/core");
|
|
52
|
+
/**
|
|
53
|
+
* Initialise the Vigilly browser client. Wraps `Sentry.init`, routing all
|
|
54
|
+
* envelopes to `https://<host>/api/observe/<projectId>/envelope/`.
|
|
55
|
+
*/
|
|
56
|
+
function init(options) {
|
|
57
|
+
return Sentry.init((0, core_1.resolveVigillyOptions)(options));
|
|
58
|
+
}
|
|
59
|
+
// Re-exported, supported capture & context API (1:1 with the Sentry SDK).
|
|
60
|
+
exports.captureException = Sentry.captureException;
|
|
61
|
+
exports.captureMessage = Sentry.captureMessage;
|
|
62
|
+
exports.addBreadcrumb = Sentry.addBreadcrumb;
|
|
63
|
+
exports.setContext = Sentry.setContext;
|
|
64
|
+
exports.setTag = Sentry.setTag;
|
|
65
|
+
exports.setTags = Sentry.setTags;
|
|
66
|
+
exports.setExtra = Sentry.setExtra;
|
|
67
|
+
exports.setExtras = Sentry.setExtras;
|
|
68
|
+
exports.setUser = Sentry.setUser;
|
|
69
|
+
exports.withScope = Sentry.withScope;
|
|
70
|
+
exports.getCurrentScope = Sentry.getCurrentScope;
|
|
71
|
+
exports.flush = Sentry.flush;
|
|
72
|
+
exports.close = Sentry.close;
|
|
73
|
+
/** Convenience namespace mirroring the named exports. */
|
|
74
|
+
exports.Vigilly = {
|
|
75
|
+
init,
|
|
76
|
+
captureException: exports.captureException,
|
|
77
|
+
captureMessage: exports.captureMessage,
|
|
78
|
+
addBreadcrumb: exports.addBreadcrumb,
|
|
79
|
+
setContext: exports.setContext,
|
|
80
|
+
setTag: exports.setTag,
|
|
81
|
+
setTags: exports.setTags,
|
|
82
|
+
setExtra: exports.setExtra,
|
|
83
|
+
setExtras: exports.setExtras,
|
|
84
|
+
setUser: exports.setUser,
|
|
85
|
+
withScope: exports.withScope,
|
|
86
|
+
getCurrentScope: exports.getCurrentScope,
|
|
87
|
+
flush: exports.flush,
|
|
88
|
+
close: exports.close,
|
|
89
|
+
};
|
|
90
|
+
exports.default = exports.Vigilly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O;IACP,QAAQ,EAAR,gBAAQ;IACR,SAAS,EAAT,iBAAS;IACT,OAAO,EAAP,eAAO;IACP,SAAS,EAAT,iBAAS;IACT,eAAe,EAAf,uBAAe;IACf,KAAK,EAAL,aAAK;IACL,KAAK,EAAL,aAAK;CACN,CAAC;AAEF,kBAAe,eAAO,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vigilly/browser",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Vigilly exceptions client for browsers — a branded, Sentry-compatible wrapper around @sentry/browser.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": ["vigilly", "errors", "exceptions", "monitoring", "sentry", "browser"],
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/vigilly/exceptions-js.git",
|
|
10
|
+
"directory": "packages/browser"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"files": ["dist", "src", "!**/*.test.*"],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc -b"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@sentry/browser": "^10.0.0",
|
|
20
|
+
"@vigilly/core": "^0.1.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@vigilly/browser` — the Vigilly exceptions client for browsers.
|
|
3
|
+
*
|
|
4
|
+
* A thin, branded wrapper around the MIT-licensed `@sentry/browser` SDK. It
|
|
5
|
+
* presets the transport to Vigilly's ingest (via the SDK's `tunnel` option,
|
|
6
|
+
* pointing at `https://<host>/api/observe/<projectId>/envelope/`) and exposes
|
|
7
|
+
* only the exception-reporting surface Vigilly supports today.
|
|
8
|
+
*
|
|
9
|
+
* import { Vigilly } from "@vigilly/browser";
|
|
10
|
+
* Vigilly.init({ dsn: "https://<publicKey>@vigilly.dev/<projectId>" });
|
|
11
|
+
* Vigilly.captureException(new Error("boom"));
|
|
12
|
+
*/
|
|
13
|
+
import * as Sentry from "@sentry/browser";
|
|
14
|
+
import { resolveVigillyOptions, type VigillyOptions } from "@vigilly/core";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Initialise the Vigilly browser client. Wraps `Sentry.init`, routing all
|
|
18
|
+
* envelopes to `https://<host>/api/observe/<projectId>/envelope/`.
|
|
19
|
+
*/
|
|
20
|
+
export function init(options: VigillyOptions): ReturnType<typeof Sentry.init> {
|
|
21
|
+
return Sentry.init(resolveVigillyOptions(options) as Sentry.BrowserOptions);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Re-exported, supported capture & context API (1:1 with the Sentry SDK).
|
|
25
|
+
export const captureException = Sentry.captureException;
|
|
26
|
+
export const captureMessage = Sentry.captureMessage;
|
|
27
|
+
export const addBreadcrumb = Sentry.addBreadcrumb;
|
|
28
|
+
export const setContext = Sentry.setContext;
|
|
29
|
+
export const setTag = Sentry.setTag;
|
|
30
|
+
export const setTags = Sentry.setTags;
|
|
31
|
+
export const setExtra = Sentry.setExtra;
|
|
32
|
+
export const setExtras = Sentry.setExtras;
|
|
33
|
+
export const setUser = Sentry.setUser;
|
|
34
|
+
export const withScope = Sentry.withScope;
|
|
35
|
+
export const getCurrentScope = Sentry.getCurrentScope;
|
|
36
|
+
export const flush = Sentry.flush;
|
|
37
|
+
export const close = Sentry.close;
|
|
38
|
+
|
|
39
|
+
/** Convenience namespace mirroring the named exports. */
|
|
40
|
+
export const Vigilly = {
|
|
41
|
+
init,
|
|
42
|
+
captureException,
|
|
43
|
+
captureMessage,
|
|
44
|
+
addBreadcrumb,
|
|
45
|
+
setContext,
|
|
46
|
+
setTag,
|
|
47
|
+
setTags,
|
|
48
|
+
setExtra,
|
|
49
|
+
setExtras,
|
|
50
|
+
setUser,
|
|
51
|
+
withScope,
|
|
52
|
+
getCurrentScope,
|
|
53
|
+
flush,
|
|
54
|
+
close,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default Vigilly;
|
|
58
|
+
|
|
59
|
+
export type { VigillyOptions, VigillyBreadcrumb } from "@vigilly/core";
|