@pdfvector/util 0.6.0 → 0.6.1
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/.tsc/lib/index.d.ts +2 -0
- package/.tsc/lib/index.d.ts.map +1 -1
- package/.tsc/lib/index.js +2 -0
- package/.tsc/lib/is-abort-error.d.ts +2 -0
- package/.tsc/lib/is-abort-error.d.ts.map +1 -0
- package/.tsc/lib/is-abort-error.js +6 -0
- package/.tsc/lib/sentry-event-limiter.d.ts +19 -0
- package/.tsc/lib/sentry-event-limiter.d.ts.map +1 -0
- package/.tsc/lib/sentry-event-limiter.js +25 -0
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
package/.tsc/lib/index.d.ts
CHANGED
|
@@ -6,10 +6,12 @@ export * from "./environment.js";
|
|
|
6
6
|
export * from "./format.js";
|
|
7
7
|
export * from "./free-tier.js";
|
|
8
8
|
export * from "./get-error-message.js";
|
|
9
|
+
export * from "./is-abort-error.js";
|
|
9
10
|
export * from "./plan.js";
|
|
10
11
|
export * from "./ports.js";
|
|
11
12
|
export * from "./product-title.js";
|
|
12
13
|
export * from "./sentry-distribution.js";
|
|
14
|
+
export * from "./sentry-event-limiter.js";
|
|
13
15
|
export * from "./sentry-release.js";
|
|
14
16
|
export * from "./service-logger.js";
|
|
15
17
|
export * from "./tier.js";
|
package/.tsc/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,QAAQ,CAAC;AACvB,cAAc,sCAAsC,CAAC;AACrD,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,QAAQ,CAAC;AACvB,cAAc,sCAAsC,CAAC;AACrD,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
|
package/.tsc/lib/index.js
CHANGED
|
@@ -6,10 +6,12 @@ export * from "./environment.js";
|
|
|
6
6
|
export * from "./format.js";
|
|
7
7
|
export * from "./free-tier.js";
|
|
8
8
|
export * from "./get-error-message.js";
|
|
9
|
+
export * from "./is-abort-error.js";
|
|
9
10
|
export * from "./plan.js";
|
|
10
11
|
export * from "./ports.js";
|
|
11
12
|
export * from "./product-title.js";
|
|
12
13
|
export * from "./sentry-distribution.js";
|
|
14
|
+
export * from "./sentry-event-limiter.js";
|
|
13
15
|
export * from "./sentry-release.js";
|
|
14
16
|
export * from "./service-logger.js";
|
|
15
17
|
export * from "./tier.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-abort-error.d.ts","sourceRoot":"","sources":["../../lib/is-abort-error.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type LimitedEvent = {
|
|
2
|
+
fingerprint?: string[] | undefined;
|
|
3
|
+
message?: string | undefined;
|
|
4
|
+
exception?: {
|
|
5
|
+
values?: {
|
|
6
|
+
type?: string | undefined;
|
|
7
|
+
value?: string | undefined;
|
|
8
|
+
}[] | undefined;
|
|
9
|
+
} | undefined;
|
|
10
|
+
};
|
|
11
|
+
type SentryEventLimiterOptions = {
|
|
12
|
+
maxPerWindow?: number;
|
|
13
|
+
windowMs?: number;
|
|
14
|
+
maxKeys?: number;
|
|
15
|
+
now?: () => number;
|
|
16
|
+
};
|
|
17
|
+
export declare function createSentryEventLimiter({ maxPerWindow, windowMs, maxKeys, now, }?: SentryEventLimiterOptions): (event: LimitedEvent) => boolean;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=sentry-event-limiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry-event-limiter.d.ts","sourceRoot":"","sources":["../../lib/sentry-event-limiter.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EACP;QACA,MAAM,CAAC,EACJ;YAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;SAAE,EAAE,GAC3D,SAAS,CAAC;KACZ,GACD,SAAS,CAAC;CACb,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACnB,CAAC;AAWF,wBAAgB,wBAAwB,CAAC,EACxC,YAAiB,EACjB,QAAyB,EACzB,OAAa,EACb,GAAc,GACd,GAAE,yBAA8B,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAcnE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function eventKey(event) {
|
|
2
|
+
if (event.fingerprint?.length)
|
|
3
|
+
return event.fingerprint.join("|");
|
|
4
|
+
const exception = event.exception?.values?.at(-1);
|
|
5
|
+
const text = exception
|
|
6
|
+
? `${exception.type ?? ""}:${exception.value ?? ""}`
|
|
7
|
+
: (event.message ?? "");
|
|
8
|
+
return text.replace(/\d+/g, "N").slice(0, 300);
|
|
9
|
+
}
|
|
10
|
+
export function createSentryEventLimiter({ maxPerWindow = 10, windowMs = 60 * 60 * 1000, maxKeys = 500, now = Date.now, } = {}) {
|
|
11
|
+
const windows = new Map();
|
|
12
|
+
return (event) => {
|
|
13
|
+
const key = eventKey(event);
|
|
14
|
+
const time = now();
|
|
15
|
+
const current = windows.get(key);
|
|
16
|
+
if (!current || time - current.start >= windowMs) {
|
|
17
|
+
if (!current && windows.size >= maxKeys)
|
|
18
|
+
windows.clear();
|
|
19
|
+
windows.set(key, { start: time, count: 1 });
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
current.count++;
|
|
23
|
+
return current.count <= maxPerWindow;
|
|
24
|
+
};
|
|
25
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @pdfvector/util
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#525](https://github.com/phuctm97/pdfvector/pull/525) [`cce2fc7`](https://github.com/phuctm97/pdfvector/commit/cce2fc71b04f02ad0fc5efb52124b1de3cec9342) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Stop swallowing errors and filter Sentry noise explicitly:
|
|
8
|
+
|
|
9
|
+
- Gateway: report unexpected oRPC procedure errors (with RPC path and organization) and Better Auth internal errors, which were turned into 500 responses without reaching Sentry. Report managed instance reconcile jobs that keep failing (3+ attempts) or fail for good, image upgrade failures, Stripe errors hidden behind the add-on purchase recovery state, and admin user Stripe lookups. A failed Stripe webhook now answers 500 instead of 400.
|
|
10
|
+
- Gateway noise policy: request cancellations and our own 4xx answers (validation, bad keys, payment required, rate limits, conflicts) are never reported; third-party 4xx errors (Stripe, Fly) still are.
|
|
11
|
+
- App: report failed queries and mutations and MCP connection failures that only showed a toast or a "failed" state, unless they are cancellations, the user's network, or HTTP errors (the gateway reports those). Chunk-load errors after a deploy now show a reload prompt instead of "Something Went Wrong". Ignore ResizeObserver loop notices and extension URLs.
|
|
12
|
+
- Website: report free-tool connection failures and Make template fetch failures; the Worker drops disconnects, 4xx route answers and CSRF rejections and now tags events with the dist.
|
|
13
|
+
- Every Sentry client rate limits repeated events (10 per hour per error) so a loop can't flood Sentry.
|
|
14
|
+
|
|
3
15
|
## 0.6.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|