@pdfvector/util 0.0.25 → 0.0.27

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.
@@ -1,14 +1,15 @@
1
1
  export * from "./api-source.js";
2
- export * from "./capture-error.js";
3
2
  export * from "./date.js";
4
3
  export * from "./environment.js";
5
- export * from "./error-service.js";
6
4
  export * from "./format.js";
7
5
  export * from "./free-tier.js";
8
6
  export * from "./get-error-message.js";
9
7
  export * from "./plan.js";
10
8
  export * from "./ports.js";
11
9
  export * from "./product-title.js";
10
+ export * from "./sentry-distribution.js";
11
+ export * from "./sentry-release.js";
12
+ export * from "./service-logger.js";
12
13
  export * from "./tier.js";
13
14
  export * from "./urls.js";
14
15
  export * from "./usage-status.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,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,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,QAAQ,CAAC;AACvB,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"}
package/.tsc/lib/index.js CHANGED
@@ -1,14 +1,15 @@
1
1
  export * from "./api-source.js";
2
- export * from "./capture-error.js";
3
2
  export * from "./date.js";
4
3
  export * from "./environment.js";
5
- export * from "./error-service.js";
6
4
  export * from "./format.js";
7
5
  export * from "./free-tier.js";
8
6
  export * from "./get-error-message.js";
9
7
  export * from "./plan.js";
10
8
  export * from "./ports.js";
11
9
  export * from "./product-title.js";
10
+ export * from "./sentry-distribution.js";
11
+ export * from "./sentry-release.js";
12
+ export * from "./service-logger.js";
12
13
  export * from "./tier.js";
13
14
  export * from "./urls.js";
14
15
  export * from "./usage-status.js";
@@ -0,0 +1,4 @@
1
+ type Environment = Record<string, string | undefined>;
2
+ export declare function sentryDistribution(service: string, environment: Environment): string | undefined;
3
+ export {};
4
+ //# sourceMappingURL=sentry-distribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-distribution.d.ts","sourceRoot":"","sources":["../../lib/sentry-distribution.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEtD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,WAAW,GACtB,MAAM,GAAG,SAAS,CAOpB"}
@@ -0,0 +1,6 @@
1
+ export function sentryDistribution(service, environment) {
2
+ const artifact = environment["VERCEL_DEPLOYMENT_ID"]?.trim() ||
3
+ environment["VERCEL_GIT_COMMIT_SHA"]?.trim() ||
4
+ environment["GITHUB_SHA"]?.trim();
5
+ return artifact ? `${service}:${artifact}` : undefined;
6
+ }
@@ -0,0 +1,4 @@
1
+ type Environment = Record<string, string | undefined>;
2
+ export declare function sentryRelease(environment: Environment): string | undefined;
3
+ export {};
4
+ //# sourceMappingURL=sentry-release.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-release.d.ts","sourceRoot":"","sources":["../../lib/sentry-release.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEtD,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAM1E"}
@@ -0,0 +1,5 @@
1
+ export function sentryRelease(environment) {
2
+ const commit = environment["VERCEL_GIT_COMMIT_SHA"]?.trim() ||
3
+ environment["GITHUB_SHA"]?.trim();
4
+ return commit ? `pdfvector@${commit}` : undefined;
5
+ }
@@ -0,0 +1,6 @@
1
+ type ErrorContext = Record<string, unknown>;
2
+ export declare const serviceLogger: {
3
+ error(error: unknown, context?: ErrorContext): void;
4
+ };
5
+ export {};
6
+ //# sourceMappingURL=service-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-logger.d.ts","sourceRoot":"","sources":["../../lib/service-logger.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5C,eAAO,MAAM,aAAa;IACzB,KAAK,QAAQ,OAAO,YAAY,YAAY,GAAG,IAAI;CAOnD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { captureException, getClient } from "@sentry/core";
2
+ export const serviceLogger = {
3
+ error(error, context) {
4
+ console.error(error, context);
5
+ if (getClient()) {
6
+ captureException(error, context ? { extra: context } : undefined);
7
+ }
8
+ },
9
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @pdfvector/util
2
2
 
3
+ ## 0.0.27
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#317](https://github.com/phuctm97/pdfvector/pull/317) [`cb1f2ec`](https://github.com/phuctm97/pdfvector/commit/cb1f2ec3296c6428f5d12fa69789a269b3418182) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Upgrade dependencies across every app and package to their latest compatible releases.
9
+
10
+ ## 0.0.26
11
+ ### Patch Changes
12
+
13
+
14
+
15
+ - [#315](https://github.com/phuctm97/pdfvector/pull/315) [`f57dec5`](https://github.com/phuctm97/pdfvector/commit/f57dec52443fa66b91bf747b4373c0f8ed026ef4) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Use commit-wide Sentry releases, artifact-specific distributions, and a shared
16
+ service logger for handled errors.
17
+
3
18
  ## 0.0.25
4
19
  ### Patch Changes
5
20
 
package/package.json CHANGED
@@ -1,8 +1,17 @@
1
1
  {
2
2
  "name": "@pdfvector/util",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "type": "module",
5
5
  "main": ".tsc/lib/index.js",
6
+ "exports": {
7
+ ".": "./lib/index.ts",
8
+ "./sentry-distribution": "./lib/sentry-distribution.ts",
9
+ "./sentry-release": "./lib/sentry-release.ts",
10
+ "./service-logger": "./lib/service-logger.ts"
11
+ },
12
+ "dependencies": {
13
+ "@sentry/core": "^10.68.0"
14
+ },
6
15
  "files": [
7
16
  ".tsc",
8
17
  "CHANGELOG.md"
@@ -1,2 +0,0 @@
1
- export declare function captureError(error: unknown): void;
2
- //# sourceMappingURL=capture-error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capture-error.d.ts","sourceRoot":"","sources":["../../lib/capture-error.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEjD"}
@@ -1,4 +0,0 @@
1
- import { errorService } from "./error-service.js";
2
- export function captureError(error) {
3
- errorService.captureError(error);
4
- }
@@ -1,5 +0,0 @@
1
- export interface ErrorService {
2
- captureError: (error: unknown) => void;
3
- }
4
- export declare const errorService: ErrorService;
5
- //# sourceMappingURL=error-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-service.d.ts","sourceRoot":"","sources":["../../lib/error-service.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC5B,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,YAAY,EAAE,YAI1B,CAAC"}
@@ -1,5 +0,0 @@
1
- export const errorService = {
2
- captureError: (error) => {
3
- console.error(error);
4
- },
5
- };