@pdfvector/util 0.0.23 → 0.0.25
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/api-source.d.ts +1 -0
- package/.tsc/lib/api-source.d.ts.map +1 -0
- package/.tsc/lib/capture-error.d.ts +2 -0
- package/.tsc/lib/capture-error.d.ts.map +1 -0
- package/.tsc/lib/capture-error.js +4 -0
- package/.tsc/lib/date.d.ts +1 -0
- package/.tsc/lib/date.d.ts.map +1 -0
- package/.tsc/lib/environment.d.ts +4 -0
- package/.tsc/lib/environment.d.ts.map +1 -0
- package/.tsc/lib/environment.js +21 -0
- package/.tsc/lib/error-service.d.ts +5 -0
- package/.tsc/lib/error-service.d.ts.map +1 -0
- package/.tsc/lib/error-service.js +5 -0
- package/.tsc/lib/format.d.ts +1 -0
- package/.tsc/lib/format.d.ts.map +1 -0
- package/.tsc/lib/free-tier.d.ts +1 -0
- package/.tsc/lib/free-tier.d.ts.map +1 -0
- package/.tsc/lib/get-error-message.d.ts +1 -0
- package/.tsc/lib/get-error-message.d.ts.map +1 -0
- package/.tsc/lib/index.d.ts +7 -17
- package/.tsc/lib/index.d.ts.map +1 -0
- package/.tsc/lib/index.js +6 -81
- package/.tsc/lib/plan.d.ts +1 -0
- package/.tsc/lib/plan.d.ts.map +1 -0
- package/.tsc/lib/ports.d.ts +5 -0
- package/.tsc/lib/ports.d.ts.map +1 -0
- package/.tsc/lib/ports.js +4 -0
- package/.tsc/lib/product-title.d.ts +2 -0
- package/.tsc/lib/product-title.d.ts.map +1 -0
- package/.tsc/lib/product-title.js +1 -0
- package/.tsc/lib/read-runtime-environment.d.ts +5 -0
- package/.tsc/lib/read-runtime-environment.d.ts.map +1 -0
- package/.tsc/lib/read-runtime-environment.js +21 -0
- package/.tsc/lib/resolve-environment.d.ts +9 -0
- package/.tsc/lib/resolve-environment.d.ts.map +1 -0
- package/.tsc/lib/resolve-environment.js +31 -0
- package/.tsc/lib/tier.d.ts +1 -0
- package/.tsc/lib/tier.d.ts.map +1 -0
- package/.tsc/lib/urls.d.ts +5 -0
- package/.tsc/lib/urls.d.ts.map +1 -0
- package/.tsc/lib/urls.js +14 -0
- package/.tsc/lib/usage-status.d.ts +1 -0
- package/.tsc/lib/usage-status.d.ts.map +1 -0
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
package/.tsc/lib/api-source.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-source.d.ts","sourceRoot":"","sources":["../../lib/api-source.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,YACtB,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,YAAY,EACZ,KAAK,EACL,SAAS,CACA,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/.tsc/lib/date.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare function getNextMonthDate(timestamp: number): Date;
|
|
|
2
2
|
export declare function getPreviousMonthDate(): Date;
|
|
3
3
|
export declare function formatShortDateTime(date: Date | number): string;
|
|
4
4
|
export declare function formatLongDateTime(date: Date | number): string;
|
|
5
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../lib/date.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAIxD;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAQ/D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAY9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../lib/environment.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,IAAI,SAAiB,CAAC;AACnC,eAAO,MAAM,OAAO,SAAoB,CAAC;AACzC,eAAO,MAAM,MAAM,SAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { readRuntimeEnvironment, safelyReadEnvironment, } from "./read-runtime-environment.js";
|
|
2
|
+
import { resolveEnvironment, runtimeFlags } from "./resolve-environment.js";
|
|
3
|
+
const bunEnvironment = readRuntimeEnvironment(Reflect.get(globalThis, "Bun"));
|
|
4
|
+
const nodeEnvironment = readRuntimeEnvironment(Reflect.get(globalThis, "process"));
|
|
5
|
+
const nextPublicEnvironment = safelyReadEnvironment(() => ({
|
|
6
|
+
NEXT_PUBLIC_CI: process.env["NEXT_PUBLIC_CI"],
|
|
7
|
+
NEXT_PUBLIC_PDFVECTOR_LOCAL: process.env["NEXT_PUBLIC_PDFVECTOR_LOCAL"],
|
|
8
|
+
}));
|
|
9
|
+
const viteEnvironment = safelyReadEnvironment(() => ({
|
|
10
|
+
VITE_CI: import.meta.env["VITE_CI"],
|
|
11
|
+
VITE_PDFVECTOR_LOCAL: import.meta.env["VITE_PDFVECTOR_LOCAL"],
|
|
12
|
+
}));
|
|
13
|
+
const environment = resolveEnvironment([
|
|
14
|
+
runtimeFlags(bunEnvironment),
|
|
15
|
+
runtimeFlags(nodeEnvironment),
|
|
16
|
+
nextPublicEnvironment,
|
|
17
|
+
viteEnvironment,
|
|
18
|
+
]);
|
|
19
|
+
export const isCI = environment.ci;
|
|
20
|
+
export const isLocal = environment.local;
|
|
21
|
+
export const isLive = !isLocal;
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/.tsc/lib/format.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../lib/format.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
package/.tsc/lib/free-tier.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-tier.d.ts","sourceRoot":"","sources":["../../lib/free-tier.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,cAAc;;iBAEzB,UAAU,EAAE,CAAC;iBACb,WAAW;iBACX,QAAQ,EAAE,CAAC;;;iBAGX,UAAU,EAAE,EAAE;;;iBAGd,UAAU,EAAE,EAAE;;CAE0C,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-error-message.d.ts","sourceRoot":"","sources":["../../lib/get-error-message.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAItD"}
|
package/.tsc/lib/index.d.ts
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
export * from "./api-source.js";
|
|
2
|
+
export * from "./capture-error.js";
|
|
2
3
|
export * from "./date.js";
|
|
4
|
+
export * from "./environment.js";
|
|
5
|
+
export * from "./error-service.js";
|
|
3
6
|
export * from "./format.js";
|
|
4
7
|
export * from "./free-tier.js";
|
|
5
8
|
export * from "./get-error-message.js";
|
|
6
9
|
export * from "./plan.js";
|
|
10
|
+
export * from "./ports.js";
|
|
11
|
+
export * from "./product-title.js";
|
|
7
12
|
export * from "./tier.js";
|
|
13
|
+
export * from "./urls.js";
|
|
8
14
|
export * from "./usage-status.js";
|
|
9
|
-
|
|
10
|
-
export declare const isLocal: boolean;
|
|
11
|
-
export declare const isLive: boolean;
|
|
12
|
-
export declare const instanceServerPort = 34000;
|
|
13
|
-
export declare const gatewayServerPort = 35000;
|
|
14
|
-
export declare const websitePort = 36000;
|
|
15
|
-
export declare const appPort = 37000;
|
|
16
|
-
export declare const websiteURL: string;
|
|
17
|
-
export declare const appURL: string;
|
|
18
|
-
export declare const gatewayServerURL: string;
|
|
19
|
-
export declare const generalInstanceServerURL: string;
|
|
20
|
-
export declare const productTitle = "PDF Vector";
|
|
21
|
-
export interface ErrorService {
|
|
22
|
-
captureError: (error: unknown) => void;
|
|
23
|
-
}
|
|
24
|
-
export declare const errorService: ErrorService;
|
|
25
|
-
export declare function captureError(error: unknown): void;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
package/.tsc/lib/index.js
CHANGED
|
@@ -1,89 +1,14 @@
|
|
|
1
1
|
export * from "./api-source.js";
|
|
2
|
+
export * from "./capture-error.js";
|
|
2
3
|
export * from "./date.js";
|
|
4
|
+
export * from "./environment.js";
|
|
5
|
+
export * from "./error-service.js";
|
|
3
6
|
export * from "./format.js";
|
|
4
7
|
export * from "./free-tier.js";
|
|
5
8
|
export * from "./get-error-message.js";
|
|
6
9
|
export * from "./plan.js";
|
|
10
|
+
export * from "./ports.js";
|
|
11
|
+
export * from "./product-title.js";
|
|
7
12
|
export * from "./tier.js";
|
|
13
|
+
export * from "./urls.js";
|
|
8
14
|
export * from "./usage-status.js";
|
|
9
|
-
function getCIWithBun() {
|
|
10
|
-
try {
|
|
11
|
-
return Bun.env.CI;
|
|
12
|
-
}
|
|
13
|
-
catch { }
|
|
14
|
-
}
|
|
15
|
-
function getCIWithNode() {
|
|
16
|
-
try {
|
|
17
|
-
return process.env.CI;
|
|
18
|
-
}
|
|
19
|
-
catch { }
|
|
20
|
-
}
|
|
21
|
-
function getCIWithNext() {
|
|
22
|
-
try {
|
|
23
|
-
return process.env.NEXT_PUBLIC_CI;
|
|
24
|
-
}
|
|
25
|
-
catch { }
|
|
26
|
-
}
|
|
27
|
-
function getCIWithVite() {
|
|
28
|
-
try {
|
|
29
|
-
return import.meta.env.VITE_CI;
|
|
30
|
-
}
|
|
31
|
-
catch { }
|
|
32
|
-
}
|
|
33
|
-
function getLocalWithBun() {
|
|
34
|
-
try {
|
|
35
|
-
return Bun.env.PDFVECTOR_LOCAL;
|
|
36
|
-
}
|
|
37
|
-
catch { }
|
|
38
|
-
}
|
|
39
|
-
function getLocalWithNode() {
|
|
40
|
-
try {
|
|
41
|
-
return process.env.PDFVECTOR_LOCAL;
|
|
42
|
-
}
|
|
43
|
-
catch { }
|
|
44
|
-
}
|
|
45
|
-
function getLocalWithNext() {
|
|
46
|
-
try {
|
|
47
|
-
return process.env.NEXT_PUBLIC_PDFVECTOR_LOCAL;
|
|
48
|
-
}
|
|
49
|
-
catch { }
|
|
50
|
-
}
|
|
51
|
-
function getLocalWithVite() {
|
|
52
|
-
try {
|
|
53
|
-
return import.meta.env.VITE_PDFVECTOR_LOCAL;
|
|
54
|
-
}
|
|
55
|
-
catch { }
|
|
56
|
-
}
|
|
57
|
-
const envCI = getCIWithBun() ?? getCIWithNode() ?? getCIWithNext() ?? getCIWithVite();
|
|
58
|
-
const envLocal = getLocalWithBun() ??
|
|
59
|
-
getLocalWithNode() ??
|
|
60
|
-
getLocalWithNext() ??
|
|
61
|
-
getLocalWithVite();
|
|
62
|
-
export const isCI = envCI === "1" || envCI === "true";
|
|
63
|
-
export const isLocal = envLocal === "1" || envLocal === "true";
|
|
64
|
-
export const isLive = !isLocal;
|
|
65
|
-
export const instanceServerPort = 34000;
|
|
66
|
-
export const gatewayServerPort = 35000;
|
|
67
|
-
export const websitePort = 36000;
|
|
68
|
-
export const appPort = 37000;
|
|
69
|
-
export const websiteURL = isLocal
|
|
70
|
-
? `http://localhost:${websitePort}`
|
|
71
|
-
: "https://www.pdfvector.com";
|
|
72
|
-
export const appURL = isLocal
|
|
73
|
-
? `http://localhost:${appPort}`
|
|
74
|
-
: "https://app.pdfvector.com";
|
|
75
|
-
export const gatewayServerURL = isLocal
|
|
76
|
-
? `http://localhost:${gatewayServerPort}`
|
|
77
|
-
: "https://gateway.pdfvector.com";
|
|
78
|
-
export const generalInstanceServerURL = isLocal
|
|
79
|
-
? `http://localhost:${instanceServerPort}`
|
|
80
|
-
: "https://global.pdfvector.com";
|
|
81
|
-
export const productTitle = "PDF Vector";
|
|
82
|
-
export const errorService = {
|
|
83
|
-
captureError: (error) => {
|
|
84
|
-
console.error(error);
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
export function captureError(error) {
|
|
88
|
-
errorService.captureError(error);
|
|
89
|
-
}
|
package/.tsc/lib/plan.d.ts
CHANGED
|
@@ -27,3 +27,4 @@ export declare function isPlanKey(value: string): value is PlanKey;
|
|
|
27
27
|
export declare function capitalizeKey(key: string): string;
|
|
28
28
|
export declare function getPlanLabel(key: string): string;
|
|
29
29
|
export declare function formatPlanLabel(plan: Plan): string;
|
|
30
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../lib/plan.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,MAAM,WAAW,IAAI;IACpB,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,WAAW;IAC3B,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,cAAc,CAsB3D,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAmC,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AAEhF,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,OAAO,CAEzD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../lib/ports.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,OAAO,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-title.d.ts","sourceRoot":"","sources":["../../lib/product-title.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const productTitle = "PDF Vector";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
2
|
+
export declare function safelyReadEnvironment(read: () => Environment): Environment | undefined;
|
|
3
|
+
export declare function readRuntimeEnvironment(value: unknown): Environment | undefined;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=read-runtime-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-runtime-environment.d.ts","sourceRoot":"","sources":["../../lib/read-runtime-environment.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAEhE,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,WAAW,GACrB,WAAW,GAAG,SAAS,CAMzB;AAaD,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,OAAO,GACZ,WAAW,GAAG,SAAS,CAOzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function safelyReadEnvironment(read) {
|
|
2
|
+
try {
|
|
3
|
+
return read();
|
|
4
|
+
}
|
|
5
|
+
catch {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function isEnvironment(value) {
|
|
10
|
+
return (typeof value === "object" &&
|
|
11
|
+
value !== null &&
|
|
12
|
+
!Array.isArray(value) &&
|
|
13
|
+
Object.values(value).every((entry) => typeof entry === "string" || entry === undefined));
|
|
14
|
+
}
|
|
15
|
+
export function readRuntimeEnvironment(value) {
|
|
16
|
+
if (typeof value !== "object" || value === null || !("env" in value)) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const environment = value.env;
|
|
20
|
+
return isEnvironment(environment) ? environment : undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Environment = Readonly<Record<string, string | undefined>> | undefined;
|
|
2
|
+
interface ResolvedEnvironment {
|
|
3
|
+
ci: boolean;
|
|
4
|
+
local: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function runtimeFlags(environment: Environment): Environment;
|
|
7
|
+
export declare function resolveEnvironment(environments: readonly Environment[]): ResolvedEnvironment;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=resolve-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-environment.d.ts","sourceRoot":"","sources":["../../lib/resolve-environment.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;AAE5E,UAAU,mBAAmB;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CACf;AAID,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAMlE;AAeD,wBAAgB,kBAAkB,CACjC,YAAY,EAAE,SAAS,WAAW,EAAE,GAClC,mBAAmB,CAYrB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const enabledValues = new Set(["1", "true"]);
|
|
2
|
+
export function runtimeFlags(environment) {
|
|
3
|
+
if (!environment)
|
|
4
|
+
return undefined;
|
|
5
|
+
return {
|
|
6
|
+
CI: environment["CI"],
|
|
7
|
+
PDFVECTOR_LOCAL: environment["PDFVECTOR_LOCAL"],
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function findValue(environments, keys) {
|
|
11
|
+
for (const environment of environments) {
|
|
12
|
+
for (const key of keys) {
|
|
13
|
+
const value = environment?.[key];
|
|
14
|
+
if (value !== undefined)
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
export function resolveEnvironment(environments) {
|
|
21
|
+
const ci = findValue(environments, ["CI", "NEXT_PUBLIC_CI", "VITE_CI"]);
|
|
22
|
+
const local = findValue(environments, [
|
|
23
|
+
"PDFVECTOR_LOCAL",
|
|
24
|
+
"NEXT_PUBLIC_PDFVECTOR_LOCAL",
|
|
25
|
+
"VITE_PDFVECTOR_LOCAL",
|
|
26
|
+
]);
|
|
27
|
+
return {
|
|
28
|
+
ci: ci !== undefined && enabledValues.has(ci),
|
|
29
|
+
local: local !== undefined && enabledValues.has(local),
|
|
30
|
+
};
|
|
31
|
+
}
|
package/.tsc/lib/tier.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../lib/tier.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAExD,eAAO,MAAM,UAAU,EAAE,SAAS,EAAmC,CAAC;AAItE,MAAM,WAAW,SAAS;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAMhD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAG9B,CAAC;AAIF,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAKxD,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAK7D,CAAC;AAEF;2DAC2D;AAC3D,eAAO,MAAM,qBAAqB,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CACxE,MAAM,EACN,MAAM,GAAG,SAAS,CAIlB,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAKhE,CAAC;AAIF,mEAAmE;AACnE,eAAO,MAAM,cAAc,YAC1B,KAAK,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,KAAK,EACL,8BAA8B,EAC9B,MAAM,EACN,KAAK,EACL,iCAAiC,EACjC,MAAM,EACN,wCAAwC,CAC/B,CAAC;AAEX,+CAA+C;AAC/C,eAAO,MAAM,wBAAwB,YACpC,mCAAmC,CAC1B,CAAC;AAEX,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,kIAC2F,CAAC;AAEjI,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,QAKe,CAAC;AAEpD;qFACqF;AACrF,eAAO,MAAM,oBAAoB;aAChC,SAAS,EAAE,EAAE;aACb,SAAS,EAAE,KAAK;CACP,CAAC;AAEX,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,QAIkJ,CAAC;AAIxL,oDAAoD;AACpD,eAAO,MAAM,mBAAmB;aAC/B,cAAc,EAAE,CAAC;aACjB,aAAa,EAAE,CAAC;aAChB,gCAAgC,EAAE,CAAC;aACnC,qBAAqB,EAAE,CAAC;aACxB,yBAAyB,EAAE,EAAE;aAC7B,qBAAqB,EAAE,CAAC;aACxB,WAAW,EAAE,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../lib/urls.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,QAEO,CAAC;AAE/B,eAAO,MAAM,MAAM,QAEW,CAAC;AAE/B,eAAO,MAAM,gBAAgB,QAEK,CAAC;AAEnC,eAAO,MAAM,wBAAwB,QAEJ,CAAC"}
|
package/.tsc/lib/urls.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isLocal } from "./environment.js";
|
|
2
|
+
import { appPort, gatewayServerPort, instanceServerPort, websitePort, } from "./ports.js";
|
|
3
|
+
export const websiteURL = isLocal
|
|
4
|
+
? `http://localhost:${websitePort}`
|
|
5
|
+
: "https://www.pdfvector.com";
|
|
6
|
+
export const appURL = isLocal
|
|
7
|
+
? `http://localhost:${appPort}`
|
|
8
|
+
: "https://app.pdfvector.com";
|
|
9
|
+
export const gatewayServerURL = isLocal
|
|
10
|
+
? `http://localhost:${gatewayServerPort}`
|
|
11
|
+
: "https://gateway.pdfvector.com";
|
|
12
|
+
export const generalInstanceServerURL = isLocal
|
|
13
|
+
? `http://localhost:${instanceServerPort}`
|
|
14
|
+
: "https://global.pdfvector.com";
|
|
@@ -2,3 +2,4 @@ export declare const usageStatuses: readonly ["success", "user_error", "system_e
|
|
|
2
2
|
export type UsageStatus = (typeof usageStatuses)[number];
|
|
3
3
|
export declare const errorStages: readonly ["auth", "validation", "preprocessing", "processing"];
|
|
4
4
|
export type ErrorStage = (typeof errorStages)[number];
|
|
5
|
+
//# sourceMappingURL=usage-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-status.d.ts","sourceRoot":"","sources":["../../lib/usage-status.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,YAAI,SAAS,EAAE,YAAY,EAAE,cAAc,CAAU,CAAC;AAEhF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,WAAW,YACvB,MAAM,EACN,YAAY,EACZ,eAAe,EACf,YAAY,CACH,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pdfvector/util
|
|
2
2
|
|
|
3
|
+
## 0.0.25
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- Add complete unit coverage, strengthen release automation, and remove the legacy E2E workspace.
|
|
9
|
+
|
|
10
|
+
## 0.0.24
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
- [#304](https://github.com/phuctm97/pdfvector/pull/304) [`3b6df52`](https://github.com/phuctm97/pdfvector/commit/3b6df52ce23f3cf3fe869c9aeeba907836ab1f9e) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Reorganize application, API, parsing, and release boundaries while preserving existing behavior and public contracts.
|
|
16
|
+
|
|
3
17
|
## 0.0.23
|
|
4
18
|
### Patch Changes
|
|
5
19
|
|