@pdfvector/util 0.1.1 → 0.2.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.
Files changed (28) hide show
  1. package/.tsc/lib/contract/gateway/router/admin/usage/records.d.ts +1 -1
  2. package/.tsc/lib/contract/gateway/router/admin/usage/records.js +1 -1
  3. package/.tsc/lib/contract/gateway/router/billing.d.ts +1 -0
  4. package/.tsc/lib/contract/gateway/router/billing.d.ts.map +1 -1
  5. package/.tsc/lib/contract/gateway/router/billing.js +1 -1
  6. package/.tsc/lib/contract/gateway/router/instance/api-keys.d.ts +2 -1
  7. package/.tsc/lib/contract/gateway/router/instance/api-keys.d.ts.map +1 -1
  8. package/.tsc/lib/contract/gateway/router/instance/api-keys.js +1 -1
  9. package/.tsc/lib/contract/gateway/router/instance/billing.d.ts +77 -0
  10. package/.tsc/lib/contract/gateway/router/instance/billing.d.ts.map +1 -0
  11. package/.tsc/lib/contract/gateway/router/instance/billing.js +43 -0
  12. package/.tsc/lib/contract/gateway/router/instance/instances.d.ts +95 -0
  13. package/.tsc/lib/contract/gateway/router/instance/instances.d.ts.map +1 -1
  14. package/.tsc/lib/contract/gateway/router/instance/instances.js +22 -0
  15. package/.tsc/lib/contract/gateway/router/instance/usage.d.ts +25 -3
  16. package/.tsc/lib/contract/gateway/router/instance/usage.d.ts.map +1 -1
  17. package/.tsc/lib/contract/gateway/router/instance/usage.js +18 -1
  18. package/.tsc/lib/contract/gateway/router/instance.d.ts +1 -0
  19. package/.tsc/lib/contract/gateway/router/instance.d.ts.map +1 -1
  20. package/.tsc/lib/contract/gateway/router/instance.js +1 -0
  21. package/.tsc/lib/fly-regions.d.ts +53 -0
  22. package/.tsc/lib/fly-regions.d.ts.map +1 -0
  23. package/.tsc/lib/fly-regions.js +19 -0
  24. package/.tsc/lib/plan.d.ts +1 -1
  25. package/.tsc/lib/plan.d.ts.map +1 -1
  26. package/.tsc/lib/plan.js +7 -0
  27. package/CHANGELOG.md +12 -0
  28. package/package.json +1 -1
@@ -25,7 +25,7 @@ export declare const listUsage: import("@orpc/contract").ContractProcedureBuilde
25
25
  items: z.ZodArray<z.ZodObject<{
26
26
  id: z.ZodNumber;
27
27
  instanceId: z.ZodNullable<z.ZodNumber>;
28
- remoteId: z.ZodNumber;
28
+ remoteId: z.ZodNullable<z.ZodNumber>;
29
29
  credits: z.ZodNumber;
30
30
  model: z.ZodNullable<z.ZodString>;
31
31
  inputSource: z.ZodString;
@@ -25,7 +25,7 @@ export const listUsage = oc
25
25
  items: z.array(z.object({
26
26
  id: z.number(),
27
27
  instanceId: z.number().nullable(),
28
- remoteId: z.number(),
28
+ remoteId: z.number().nullable(),
29
29
  credits: z.number(),
30
30
  model: z.string().nullable(),
31
31
  inputSource: z.string(),
@@ -6,6 +6,7 @@ export declare const update: import("@orpc/contract").ContractProcedureBuilderWi
6
6
  plan: z.ZodObject<{
7
7
  key: z.ZodEnum<{
8
8
  basic: "basic";
9
+ enterprise: "enterprise";
9
10
  free: "free";
10
11
  pro: "pro";
11
12
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/billing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,MAAM;;2EAEC,CAAC;AAErB,eAAO,MAAM,MAAM;;;;;;;;;;;0FAgBY,CAAC"}
1
+ {"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/billing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,MAAM;;2EAEC,CAAC;AAErB,eAAO,MAAM,MAAM;;;;;;;;;;;;0FAgBY,CAAC"}
@@ -7,7 +7,7 @@ export const update = oc
7
7
  .input(z
8
8
  .object({
9
9
  plan: z.object({
10
- key: z.enum(["free", "basic", "pro"]),
10
+ key: z.enum(["free", "basic", "pro", "enterprise"]),
11
11
  annual: z.boolean(),
12
12
  }),
13
13
  succeedURL: z.string(),
@@ -25,6 +25,7 @@ export declare const deleteApiKey: import("@orpc/contract").ContractProcedureBui
25
25
  export declare const rotateApiKey: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
26
26
  id: z.ZodNumber;
27
27
  }, z.core.$strip>, z.ZodObject<{
28
- key: z.ZodString;
28
+ key: z.ZodNullable<z.ZodString>;
29
+ pending: z.ZodOptional<z.ZodBoolean>;
29
30
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
30
31
  //# sourceMappingURL=api-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/api-keys.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AASzB,eAAO,MAAM,WAAW;;;;;;;+DAEO,CAAC;AAEhC,eAAO,MAAM,YAAY;;;;;;;;8DAEH,CAAC;AAEvB,eAAO,MAAM,YAAY;;;;;8DAEmB,CAAC;AAE7C,eAAO,MAAM,YAAY;;;;8DAEc,CAAC"}
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/api-keys.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AASzB,eAAO,MAAM,WAAW;;;;;;;+DAEO,CAAC;AAEhC,eAAO,MAAM,YAAY;;;;;;;;8DAEH,CAAC;AAEvB,eAAO,MAAM,YAAY;;;;;8DAEmB,CAAC;AAE7C,eAAO,MAAM,YAAY;;;;;8DAIvB,CAAC"}
@@ -17,4 +17,4 @@ export const deleteApiKey = oc
17
17
  .output(z.object({ success: z.boolean() }));
18
18
  export const rotateApiKey = oc
19
19
  .input(z.object({ id: z.number() }))
20
- .output(z.object({ key: z.string() }));
20
+ .output(z.object({ key: z.string().nullable(), pending: z.boolean().optional() }));
@@ -0,0 +1,77 @@
1
+ import { z } from "zod";
2
+ export declare const billingOptions: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
3
+ includedAvailable: z.ZodBoolean;
4
+ plans: z.ZodArray<z.ZodObject<{
5
+ key: z.ZodString;
6
+ label: z.ZodString;
7
+ monthlyAmount: z.ZodNumber;
8
+ annualAmount: z.ZodNumber;
9
+ currency: z.ZodLiteral<"usd">;
10
+ }, z.core.$strip>>;
11
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
12
+ export declare const billingQuote: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
13
+ planKey: z.ZodString;
14
+ cadence: z.ZodEnum<{
15
+ annual: "annual";
16
+ monthly: "monthly";
17
+ }>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ planKey: z.ZodString;
20
+ cadence: z.ZodEnum<{
21
+ annual: "annual";
22
+ monthly: "monthly";
23
+ }>;
24
+ id: z.ZodString;
25
+ expiresAt: z.ZodDate;
26
+ included: z.ZodBoolean;
27
+ currency: z.ZodLiteral<"usd">;
28
+ recurringAmount: z.ZodNumber;
29
+ amountDue: z.ZodNumber;
30
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
31
+ export declare const createWithBilling: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
32
+ name: z.ZodString;
33
+ description: z.ZodOptional<z.ZodString>;
34
+ region: z.ZodOptional<z.ZodEnum<{
35
+ ams: "ams";
36
+ arn: "arn";
37
+ cdg: "cdg";
38
+ dfw: "dfw";
39
+ ewr: "ewr";
40
+ fra: "fra";
41
+ gru: "gru";
42
+ iad: "iad";
43
+ jnb: "jnb";
44
+ lax: "lax";
45
+ lhr: "lhr";
46
+ nrt: "nrt";
47
+ ord: "ord";
48
+ sin: "sin";
49
+ sjc: "sjc";
50
+ syd: "syd";
51
+ yyz: "yyz";
52
+ }>>;
53
+ requestKey: z.ZodString;
54
+ quoteId: z.ZodString;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ operationId: z.ZodString;
57
+ status: z.ZodEnum<{
58
+ payment_required: "payment_required";
59
+ provisioning: "provisioning";
60
+ recovery_required: "recovery_required";
61
+ }>;
62
+ instanceId: z.ZodNullable<z.ZodNumber>;
63
+ hostedInvoiceUrl: z.ZodNullable<z.ZodString>;
64
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
65
+ export declare const billingOperation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
66
+ operationId: z.ZodString;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ operationId: z.ZodString;
69
+ status: z.ZodEnum<{
70
+ payment_required: "payment_required";
71
+ provisioning: "provisioning";
72
+ recovery_required: "recovery_required";
73
+ }>;
74
+ instanceId: z.ZodNullable<z.ZodNumber>;
75
+ hostedInvoiceUrl: z.ZodNullable<z.ZodString>;
76
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
77
+ //# sourceMappingURL=billing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/billing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,cAAc;;;;;;;;;8DAa1B,CAAC;AACF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;8DASxB,CAAC;AACF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAUd,CAAC;AACjB,eAAO,MAAM,gBAAgB;;;;;;;;;;;8DAEb,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { z } from "zod";
3
+ import { flyRegions } from "../../../../fly-regions.js";
4
+ const selection = z.object({
5
+ planKey: z.string().min(1).max(64),
6
+ cadence: z.enum(["monthly", "annual"]),
7
+ });
8
+ const result = z.object({
9
+ operationId: z.string().uuid(),
10
+ status: z.enum(["payment_required", "provisioning", "recovery_required"]),
11
+ instanceId: z.number().int().positive().nullable(),
12
+ hostedInvoiceUrl: z.string().url().nullable(),
13
+ });
14
+ export const billingOptions = oc.output(z.object({
15
+ includedAvailable: z.boolean(),
16
+ plans: z.array(z.object({
17
+ key: z.string(),
18
+ label: z.string(),
19
+ monthlyAmount: z.number().int().nonnegative(),
20
+ annualAmount: z.number().int().nonnegative(),
21
+ currency: z.literal("usd"),
22
+ })),
23
+ }));
24
+ export const billingQuote = oc.input(selection).output(selection.extend({
25
+ id: z.string().uuid(),
26
+ expiresAt: z.date(),
27
+ included: z.boolean(),
28
+ currency: z.literal("usd"),
29
+ recurringAmount: z.number().int().nonnegative(),
30
+ amountDue: z.number().int().nonnegative(),
31
+ }));
32
+ export const createWithBilling = oc
33
+ .input(z.object({
34
+ name: z.string().min(1).max(255),
35
+ description: z.string().max(1000).optional(),
36
+ region: z.enum(flyRegions.map((region) => region.code)).optional(),
37
+ requestKey: z.string().uuid(),
38
+ quoteId: z.string().uuid(),
39
+ }))
40
+ .output(result);
41
+ export const billingOperation = oc
42
+ .input(z.object({ operationId: z.string().uuid() }))
43
+ .output(result);
@@ -1,5 +1,21 @@
1
1
  import * as z from "zod";
2
2
  export declare const list: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodArray<z.ZodObject<{
3
+ domainSetup: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4
+ status: z.ZodString;
5
+ records: z.ZodArray<z.ZodObject<{
6
+ type: z.ZodEnum<{
7
+ CNAME: "CNAME";
8
+ TXT: "TXT";
9
+ }>;
10
+ name: z.ZodString;
11
+ value: z.ZodString;
12
+ }, z.core.$strip>>;
13
+ }, z.core.$strip>>>;
14
+ region: z.ZodDefault<z.ZodNullable<z.ZodString>>;
15
+ provider: z.ZodDefault<z.ZodString>;
16
+ kind: z.ZodDefault<z.ZodString>;
17
+ managedStatus: z.ZodDefault<z.ZodString>;
18
+ lastError: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3
19
  id: z.ZodNumber;
4
20
  name: z.ZodString;
5
21
  description: z.ZodNullable<z.ZodString>;
@@ -11,6 +27,22 @@ export declare const list: import("@orpc/contract").ContractProcedureBuilderWith
11
27
  export declare const get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
12
28
  id: z.ZodNumber;
13
29
  }, z.core.$strip>, z.ZodObject<{
30
+ domainSetup: z.ZodDefault<z.ZodNullable<z.ZodObject<{
31
+ status: z.ZodString;
32
+ records: z.ZodArray<z.ZodObject<{
33
+ type: z.ZodEnum<{
34
+ CNAME: "CNAME";
35
+ TXT: "TXT";
36
+ }>;
37
+ name: z.ZodString;
38
+ value: z.ZodString;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$strip>>>;
41
+ region: z.ZodDefault<z.ZodNullable<z.ZodString>>;
42
+ provider: z.ZodDefault<z.ZodString>;
43
+ kind: z.ZodDefault<z.ZodString>;
44
+ managedStatus: z.ZodDefault<z.ZodString>;
45
+ lastError: z.ZodDefault<z.ZodNullable<z.ZodString>>;
14
46
  id: z.ZodNumber;
15
47
  name: z.ZodString;
16
48
  description: z.ZodNullable<z.ZodString>;
@@ -21,9 +53,72 @@ export declare const get: import("@orpc/contract").ContractProcedureBuilderWithI
21
53
  lastSyncedAt: z.ZodNullable<z.ZodDate>;
22
54
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
23
55
  export declare const create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
56
+ region: z.ZodOptional<z.ZodEnum<{
57
+ ams: "ams";
58
+ arn: "arn";
59
+ cdg: "cdg";
60
+ dfw: "dfw";
61
+ ewr: "ewr";
62
+ fra: "fra";
63
+ gru: "gru";
64
+ iad: "iad";
65
+ jnb: "jnb";
66
+ lax: "lax";
67
+ lhr: "lhr";
68
+ nrt: "nrt";
69
+ ord: "ord";
70
+ sin: "sin";
71
+ sjc: "sjc";
72
+ syd: "syd";
73
+ yyz: "yyz";
74
+ }>>;
75
+ requestKey: z.ZodOptional<z.ZodString>;
24
76
  name: z.ZodString;
25
77
  description: z.ZodOptional<z.ZodString>;
26
78
  }, z.core.$strip>, z.ZodObject<{
79
+ domainSetup: z.ZodDefault<z.ZodNullable<z.ZodObject<{
80
+ status: z.ZodString;
81
+ records: z.ZodArray<z.ZodObject<{
82
+ type: z.ZodEnum<{
83
+ CNAME: "CNAME";
84
+ TXT: "TXT";
85
+ }>;
86
+ name: z.ZodString;
87
+ value: z.ZodString;
88
+ }, z.core.$strip>>;
89
+ }, z.core.$strip>>>;
90
+ region: z.ZodDefault<z.ZodNullable<z.ZodString>>;
91
+ provider: z.ZodDefault<z.ZodString>;
92
+ kind: z.ZodDefault<z.ZodString>;
93
+ managedStatus: z.ZodDefault<z.ZodString>;
94
+ lastError: z.ZodDefault<z.ZodNullable<z.ZodString>>;
95
+ id: z.ZodNumber;
96
+ name: z.ZodString;
97
+ description: z.ZodNullable<z.ZodString>;
98
+ domain: z.ZodString;
99
+ isGeneral: z.ZodBoolean;
100
+ createdAt: z.ZodDate;
101
+ updatedAt: z.ZodDate;
102
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
103
+ export declare const retry: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
104
+ id: z.ZodNumber;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ domainSetup: z.ZodDefault<z.ZodNullable<z.ZodObject<{
107
+ status: z.ZodString;
108
+ records: z.ZodArray<z.ZodObject<{
109
+ type: z.ZodEnum<{
110
+ CNAME: "CNAME";
111
+ TXT: "TXT";
112
+ }>;
113
+ name: z.ZodString;
114
+ value: z.ZodString;
115
+ }, z.core.$strip>>;
116
+ }, z.core.$strip>>>;
117
+ region: z.ZodDefault<z.ZodNullable<z.ZodString>>;
118
+ provider: z.ZodDefault<z.ZodString>;
119
+ kind: z.ZodDefault<z.ZodString>;
120
+ managedStatus: z.ZodDefault<z.ZodString>;
121
+ lastError: z.ZodDefault<z.ZodNullable<z.ZodString>>;
27
122
  id: z.ZodNumber;
28
123
  name: z.ZodString;
29
124
  description: z.ZodNullable<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/instances.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAYzB,eAAO,MAAM,IAAI;;;;;;;;+DAAqC,CAAC;AAEvD,eAAO,MAAM,GAAG;;;;;;;;;;;8DAEsD,CAAC;AAEvE,eAAO,MAAM,MAAM;;;;;;;;;;;8DAOK,CAAC;AAEzB,eAAO,MAAM,MAAM;;;;8DAEyB,CAAC"}
1
+ {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/instances.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA+BzB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;+DAAqC,CAAC;AAEvD,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAEsD,CAAC;AAEvE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DASK,CAAC;AAEzB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;8DAEM,CAAC;AAEzB,eAAO,MAAM,MAAM;;;;8DAEyB,CAAC"}
@@ -1,6 +1,23 @@
1
1
  import { oc } from "@orpc/contract";
2
2
  import * as z from "zod";
3
+ import { flyRegions } from "../../../../fly-regions.js";
3
4
  const instanceSchema = z.object({
5
+ domainSetup: z
6
+ .object({
7
+ status: z.string(),
8
+ records: z.array(z.object({
9
+ type: z.enum(["CNAME", "TXT"]),
10
+ name: z.string(),
11
+ value: z.string(),
12
+ })),
13
+ })
14
+ .nullable()
15
+ .default(null),
16
+ region: z.string().nullable().default(null),
17
+ provider: z.string().default("external"),
18
+ kind: z.string().default("full"),
19
+ managedStatus: z.string().default("ready"),
20
+ lastError: z.string().nullable().default(null),
4
21
  id: z.number(),
5
22
  name: z.string(),
6
23
  description: z.string().nullable(),
@@ -15,10 +32,15 @@ export const get = oc
15
32
  .output(instanceSchema.extend({ lastSyncedAt: z.date().nullable() }));
16
33
  export const create = oc
17
34
  .input(z.object({
35
+ region: z.enum(flyRegions.map((region) => region.code)).optional(),
36
+ requestKey: z.string().uuid().optional(),
18
37
  name: z.string().min(1).max(255),
19
38
  description: z.string().max(1000).optional(),
20
39
  }))
21
40
  .output(instanceSchema);
41
+ export const retry = oc
42
+ .input(z.object({ id: z.number().int().positive() }))
43
+ .output(instanceSchema);
22
44
  export const remove = oc
23
45
  .input(z.object({ id: z.number() }))
24
46
  .output(z.object({ success: z.boolean() }));
@@ -11,7 +11,7 @@ export declare const getUsage: import("@orpc/contract").ContractProcedureBuilder
11
11
  }, z.core.$strip>, z.ZodArray<z.ZodObject<{
12
12
  id: z.ZodNumber;
13
13
  instanceId: z.ZodNullable<z.ZodNumber>;
14
- remoteId: z.ZodNumber;
14
+ remoteId: z.ZodNullable<z.ZodNumber>;
15
15
  credits: z.ZodNumber;
16
16
  model: z.ZodNullable<z.ZodString>;
17
17
  inputSource: z.ZodString;
@@ -105,7 +105,7 @@ export declare const listUsageRecords: import("@orpc/contract").ContractProcedur
105
105
  items: z.ZodArray<z.ZodObject<{
106
106
  id: z.ZodNumber;
107
107
  instanceId: z.ZodNullable<z.ZodNumber>;
108
- remoteId: z.ZodNumber;
108
+ remoteId: z.ZodNullable<z.ZodNumber>;
109
109
  credits: z.ZodNumber;
110
110
  model: z.ZodNullable<z.ZodString>;
111
111
  inputSource: z.ZodString;
@@ -155,6 +155,28 @@ export declare const getOverviewStats: import("@orpc/contract").ContractProcedur
155
155
  totalSystemErrors: z.ZodNumber;
156
156
  totalCredits: z.ZodNumber;
157
157
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
158
+ export declare const getUsageSummary: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
159
+ period: z.ZodEnum<{
160
+ "30d": "30d";
161
+ "7d": "7d";
162
+ "90d": "90d";
163
+ all: "all";
164
+ }>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ instances: z.ZodArray<z.ZodObject<{
167
+ id: z.ZodNumber;
168
+ name: z.ZodString;
169
+ region: z.ZodNullable<z.ZodString>;
170
+ provider: z.ZodString;
171
+ managedStatus: z.ZodString;
172
+ totalRequests: z.ZodNumber;
173
+ totalPages: z.ZodNumber;
174
+ totalCredits: z.ZodNumber;
175
+ totalUserErrors: z.ZodNumber;
176
+ totalSystemErrors: z.ZodNumber;
177
+ lastUsedAt: z.ZodNullable<z.ZodDate>;
178
+ }, z.core.$strip>>;
179
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
158
180
  export declare const getUsageRecord: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
159
181
  instanceId: z.ZodNumber;
160
182
  usageRecordId: z.ZodNumber;
@@ -162,7 +184,7 @@ export declare const getUsageRecord: import("@orpc/contract").ContractProcedureB
162
184
  record: z.ZodObject<{
163
185
  id: z.ZodNumber;
164
186
  instanceId: z.ZodNullable<z.ZodNumber>;
165
- remoteId: z.ZodNumber;
187
+ remoteId: z.ZodNullable<z.ZodNumber>;
166
188
  credits: z.ZodNumber;
167
189
  model: z.ZodNullable<z.ZodString>;
168
190
  inputSource: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/usage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA6BzB,eAAO,MAAM,SAAS;;;;8DAEoB,CAAC;AAE3C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAQe,CAAC;AAErC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DA6C3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;8DAO5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAMzB,CAAC"}
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/instance/usage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA6BzB,eAAO,MAAM,SAAS;;;;8DAEoB,CAAC;AAE3C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAQe,CAAC;AAErC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DA6C3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;8DAO5B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;8DAoB1B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAMzB,CAAC"}
@@ -4,7 +4,7 @@ import * as z from "zod";
4
4
  const usageRecordSchema = z.object({
5
5
  id: z.number(),
6
6
  instanceId: z.number().nullable(),
7
- remoteId: z.number(),
7
+ remoteId: z.number().nullable(),
8
8
  credits: z.number(),
9
9
  model: z.string().nullable(),
10
10
  inputSource: z.string(),
@@ -85,6 +85,23 @@ export const getOverviewStats = oc.output(z.object({
85
85
  totalSystemErrors: z.number(),
86
86
  totalCredits: z.number(),
87
87
  }));
88
+ export const getUsageSummary = oc
89
+ .input(z.object({ period: z.enum(["7d", "30d", "90d", "all"]) }))
90
+ .output(z.object({
91
+ instances: z.array(z.object({
92
+ id: z.number(),
93
+ name: z.string(),
94
+ region: z.string().nullable(),
95
+ provider: z.string(),
96
+ managedStatus: z.string(),
97
+ totalRequests: z.number(),
98
+ totalPages: z.number(),
99
+ totalCredits: z.number(),
100
+ totalUserErrors: z.number(),
101
+ totalSystemErrors: z.number(),
102
+ lastUsedAt: z.date().nullable(),
103
+ })),
104
+ }));
88
105
  export const getUsageRecord = oc
89
106
  .input(z.object({ instanceId: z.number(), usageRecordId: z.number() }))
90
107
  .output(z.object({
@@ -1,4 +1,5 @@
1
1
  export * from "./instance/api-keys.js";
2
+ export * from "./instance/billing.js";
2
3
  export * from "./instance/instances.js";
3
4
  export * from "./instance/proxy.js";
4
5
  export * from "./instance/usage.js";
@@ -1 +1 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/instance.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/instance.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./instance/api-keys.js";
2
+ export * from "./instance/billing.js";
2
3
  export * from "./instance/instances.js";
3
4
  export * from "./instance/proxy.js";
4
5
  export * from "./instance/usage.js";
@@ -0,0 +1,53 @@
1
+ export declare const flyRegions: readonly [{
2
+ readonly code: "ams";
3
+ readonly name: "Amsterdam, Netherlands";
4
+ }, {
5
+ readonly code: "arn";
6
+ readonly name: "Stockholm, Sweden";
7
+ }, {
8
+ readonly code: "cdg";
9
+ readonly name: "Paris, France";
10
+ }, {
11
+ readonly code: "dfw";
12
+ readonly name: "Dallas, Texas (US)";
13
+ }, {
14
+ readonly code: "ewr";
15
+ readonly name: "Secaucus, NJ (US)";
16
+ }, {
17
+ readonly code: "fra";
18
+ readonly name: "Frankfurt, Germany";
19
+ }, {
20
+ readonly code: "gru";
21
+ readonly name: "Sao Paulo, Brazil";
22
+ }, {
23
+ readonly code: "iad";
24
+ readonly name: "Ashburn, Virginia (US)";
25
+ }, {
26
+ readonly code: "jnb";
27
+ readonly name: "Johannesburg, South Africa";
28
+ }, {
29
+ readonly code: "lax";
30
+ readonly name: "Los Angeles, California (US)";
31
+ }, {
32
+ readonly code: "lhr";
33
+ readonly name: "London, United Kingdom";
34
+ }, {
35
+ readonly code: "nrt";
36
+ readonly name: "Tokyo, Japan";
37
+ }, {
38
+ readonly code: "ord";
39
+ readonly name: "Chicago, Illinois (US)";
40
+ }, {
41
+ readonly code: "sin";
42
+ readonly name: "Singapore, Singapore";
43
+ }, {
44
+ readonly code: "sjc";
45
+ readonly name: "San Jose, California (US)";
46
+ }, {
47
+ readonly code: "syd";
48
+ readonly name: "Sydney, Australia";
49
+ }, {
50
+ readonly code: "yyz";
51
+ readonly name: "Toronto, Canada";
52
+ }];
53
+ //# sourceMappingURL=fly-regions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fly-regions.d.ts","sourceRoot":"","sources":["../../lib/fly-regions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;aACpB,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,wBAAwB;;aAC3C,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,mBAAmB;;aACtC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,eAAe;;aAClC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,oBAAoB;;aACvC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,mBAAmB;;aACtC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,oBAAoB;;aACvC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,mBAAmB;;aACtC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,wBAAwB;;aAC3C,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,4BAA4B;;aAC/C,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,8BAA8B;;aACjD,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,wBAAwB;;aAC3C,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,cAAc;;aACjC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,wBAAwB;;aAC3C,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,sBAAsB;;aACzC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,2BAA2B;;aAC9C,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,mBAAmB;;aACtC,IAAI,EAAE,KAAK;aAAE,IAAI,EAAE,iBAAiB;EAC7B,CAAC"}
@@ -0,0 +1,19 @@
1
+ export const flyRegions = [
2
+ { code: "ams", name: "Amsterdam, Netherlands" },
3
+ { code: "arn", name: "Stockholm, Sweden" },
4
+ { code: "cdg", name: "Paris, France" },
5
+ { code: "dfw", name: "Dallas, Texas (US)" },
6
+ { code: "ewr", name: "Secaucus, NJ (US)" },
7
+ { code: "fra", name: "Frankfurt, Germany" },
8
+ { code: "gru", name: "Sao Paulo, Brazil" },
9
+ { code: "iad", name: "Ashburn, Virginia (US)" },
10
+ { code: "jnb", name: "Johannesburg, South Africa" },
11
+ { code: "lax", name: "Los Angeles, California (US)" },
12
+ { code: "lhr", name: "London, United Kingdom" },
13
+ { code: "nrt", name: "Tokyo, Japan" },
14
+ { code: "ord", name: "Chicago, Illinois (US)" },
15
+ { code: "sin", name: "Singapore, Singapore" },
16
+ { code: "sjc", name: "San Jose, California (US)" },
17
+ { code: "syd", name: "Sydney, Australia" },
18
+ { code: "yyz", name: "Toronto, Canada" },
19
+ ];
@@ -5,7 +5,7 @@ export interface PlanDefinition {
5
5
  annualPrice: number;
6
6
  maxInstances: number;
7
7
  }
8
- export type PlanKey = "free" | "basic" | "pro";
8
+ export type PlanKey = "free" | "basic" | "pro" | "enterprise";
9
9
  export type AnyPlanKey = string;
10
10
  export interface Plan {
11
11
  key: AnyPlanKey;
@@ -1 +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"}
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,GAAG,YAAY,CAAC;AAE9D,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,CA6B3D,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"}
package/.tsc/lib/plan.js CHANGED
@@ -21,6 +21,13 @@ export const planDefinitions = {
21
21
  annualPrice: 89,
22
22
  maxInstances: 0,
23
23
  },
24
+ enterprise: {
25
+ label: "Enterprise",
26
+ monthlyCredits: 100000,
27
+ monthlyPrice: 299,
28
+ annualPrice: (299 * 11) / 12,
29
+ maxInstances: Number.POSITIVE_INFINITY,
30
+ },
24
31
  };
25
32
  export const planKeys = Object.keys(planDefinitions);
26
33
  export function isPlanKey(value) {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @pdfvector/util
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#392](https://github.com/phuctm97/pdfvector/pull/392) [`ba1e57c`](https://github.com/phuctm97/pdfvector/commit/ba1e57cd88ccbcea74df1e5cd39cb41f1f6f12ca) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add workspace-owned Fly-managed local PDF instances with durable provisioning, verified API-key rotation, bounded text-only parsing, and idempotent per-page credit accounting. Expose managed lifecycle actions and local PDF uploads in the instance UI and extend gateway contracts with managed instance status and capabilities. Let users select a supported Fly region for the parser and its persistent volume, validating placement against the shared active-region catalog. Give new instances native Fly HTTPS hostnames `pv-<workspaceId>-<instanceId>-instance.fly.dev`, with an explicitly configured `pv-stg` prefix for staging and no custom DNS or certificate setup. Preserve existing native URLs and fail-closed certificate/readiness support for already persisted custom domains. Add instance-based Enterprise billing without a separate slot-purchase workflow, confirmation before destructive deletion, final accounting recovery before cleanup, and retained per-instance usage summaries for the workspace dashboard.
8
+
9
+ Add authenticated immutable parser-image releases with durable canary promotion, retry and rollback while retaining volumes, credentials and credit accounting. Verify compiled release metadata and a zero-credit admin parser smoke before publishing readiness, and safely defer asynchronous Fly machine replacements. Use one protected release job to build and publish directly to the configured private Fly registry, enqueue the gateway rollout and wait for convergence of the entire available managed fleet. Keep credential-free PR artifact verification and the image package private to npm. Recognize managed Enterprise subscription prices through existing lookup-key and credit-metadata conventions instead of a per-environment price ID, while retaining strict pricing, payment and concurrency checks.
10
+
11
+ Offer self-service Enterprise monthly and yearly subscriptions, with yearly pricing charged for eleven months and fixed workspace monthly credits. Keep the instance creation action visible for every plan, guide non-Enterprise workspaces into the preselected Change Plan dialog, and publish the Enterprise pricing and upgrade path on the landing page.
12
+
13
+ Keep the Enterprise workspace subscription at quantity one, including one dedicated instance and 100,000 monthly credits. Bill each additional dedicated instance through its own monthly or yearly subscription, with independent cancellation and payment recovery. Add a Details → Plan → Review creation wizard, durable accepted-price quotes and idempotent billing operations, and provision only after verified payment. Preserve deleted-instance history with clear destructive styling and release the included slot only after provider cleanup completes.
14
+
3
15
  ## 0.1.1
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/util",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "main": "./.tsc/lib/index.js",
6
6
  "exports": {