@pdfvector/util 0.0.31 → 0.0.32
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/contract/gateway/index.d.ts +6 -0
- package/.tsc/lib/contract/gateway/index.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/index.js +2 -0
- package/.tsc/lib/contract/gateway/router/admin/billing.d.ts +50 -0
- package/.tsc/lib/contract/gateway/router/admin/billing.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/billing.js +51 -0
- package/.tsc/lib/contract/gateway/router/admin/blog.d.ts +38 -0
- package/.tsc/lib/contract/gateway/router/admin/blog.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/blog.js +36 -0
- package/.tsc/lib/contract/gateway/router/admin/feedback.d.ts +48 -0
- package/.tsc/lib/contract/gateway/router/admin/feedback.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/feedback.js +52 -0
- package/.tsc/lib/contract/gateway/router/admin/instances.d.ts +8 -0
- package/.tsc/lib/contract/gateway/router/admin/instances.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/instances.js +8 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/free.d.ts +98 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/free.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/free.js +84 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/index.d.ts +4 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/index.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/index.js +3 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/overview.d.ts +103 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/overview.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/overview.js +65 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/records.d.ts +71 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/records.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/usage/records.js +55 -0
- package/.tsc/lib/contract/gateway/router/admin/users.d.ts +93 -0
- package/.tsc/lib/contract/gateway/router/admin/users.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin/users.js +101 -0
- package/.tsc/lib/contract/gateway/router/admin.d.ts +7 -0
- package/.tsc/lib/contract/gateway/router/admin.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/admin.js +6 -0
- package/.tsc/lib/contract/gateway/router/billing.d.ts +17 -0
- package/.tsc/lib/contract/gateway/router/billing.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/billing.js +20 -0
- package/.tsc/lib/contract/gateway/router/blog.d.ts +35 -0
- package/.tsc/lib/contract/gateway/router/blog.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/blog.js +29 -0
- package/.tsc/lib/contract/gateway/router/feedback.d.ts +14 -0
- package/.tsc/lib/contract/gateway/router/feedback.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/feedback.js +15 -0
- package/.tsc/lib/contract/gateway/router/free-feedback.d.ts +19 -0
- package/.tsc/lib/contract/gateway/router/free-feedback.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/free-feedback.js +10 -0
- package/.tsc/lib/contract/gateway/router/greeting.d.ts +7 -0
- package/.tsc/lib/contract/gateway/router/greeting.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/greeting.js +11 -0
- package/.tsc/lib/contract/gateway/router/health.d.ts +5 -0
- package/.tsc/lib/contract/gateway/router/health.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/health.js +6 -0
- package/.tsc/lib/contract/gateway/router/index.d.ts +10 -0
- package/.tsc/lib/contract/gateway/router/index.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/index.js +9 -0
- package/.tsc/lib/contract/gateway/router/instance/api-keys.d.ts +30 -0
- package/.tsc/lib/contract/gateway/router/instance/api-keys.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/instance/api-keys.js +20 -0
- package/.tsc/lib/contract/gateway/router/instance/instances.d.ts +40 -0
- package/.tsc/lib/contract/gateway/router/instance/instances.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/instance/instances.js +24 -0
- package/.tsc/lib/contract/gateway/router/instance/proxy.d.ts +50 -0
- package/.tsc/lib/contract/gateway/router/instance/proxy.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/instance/proxy.js +55 -0
- package/.tsc/lib/contract/gateway/router/instance/usage.d.ts +201 -0
- package/.tsc/lib/contract/gateway/router/instance/usage.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/instance/usage.js +92 -0
- package/.tsc/lib/contract/gateway/router/instance.d.ts +5 -0
- package/.tsc/lib/contract/gateway/router/instance.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/instance.js +4 -0
- package/.tsc/lib/contract/gateway/router/workspace.d.ts +31 -0
- package/.tsc/lib/contract/gateway/router/workspace.d.ts.map +1 -0
- package/.tsc/lib/contract/gateway/router/workspace.js +30 -0
- package/.tsc/lib/contract/instance/fetchable-url-schema.d.ts +3 -0
- package/.tsc/lib/contract/instance/fetchable-url-schema.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/fetchable-url-schema.js +5 -0
- package/.tsc/lib/contract/instance/index.d.ts +12 -0
- package/.tsc/lib/contract/instance/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/index.js +7 -0
- package/.tsc/lib/contract/instance/json-schema-input.d.ts +3 -0
- package/.tsc/lib/contract/instance/json-schema-input.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/json-schema-input.js +23 -0
- package/.tsc/lib/contract/instance/page-markdown-schema.d.ts +6 -0
- package/.tsc/lib/contract/instance/page-markdown-schema.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/page-markdown-schema.js +9 -0
- package/.tsc/lib/contract/instance/pdfvector-model-schema.d.ts +8 -0
- package/.tsc/lib/contract/instance/pdfvector-model-schema.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/pdfvector-model-schema.js +4 -0
- package/.tsc/lib/contract/instance/pdfvector-model.d.ts +4 -0
- package/.tsc/lib/contract/instance/pdfvector-model.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/pdfvector-model.js +0 -0
- package/.tsc/lib/contract/instance/router/academic/fetch.d.ts +69 -0
- package/.tsc/lib/contract/instance/router/academic/fetch.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/fetch.js +119 -0
- package/.tsc/lib/contract/instance/router/academic/find-citations.d.ts +70 -0
- package/.tsc/lib/contract/instance/router/academic/find-citations.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/find-citations.js +116 -0
- package/.tsc/lib/contract/instance/router/academic/index.d.ts +8 -0
- package/.tsc/lib/contract/instance/router/academic/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/index.js +7 -0
- package/.tsc/lib/contract/instance/router/academic/paper-graph.d.ts +113 -0
- package/.tsc/lib/contract/instance/router/academic/paper-graph.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/paper-graph.js +144 -0
- package/.tsc/lib/contract/instance/router/academic/parse.d.ts +50 -0
- package/.tsc/lib/contract/instance/router/academic/parse.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/parse.js +146 -0
- package/.tsc/lib/contract/instance/router/academic/provider.d.ts +18 -0
- package/.tsc/lib/contract/instance/router/academic/provider.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/provider.js +16 -0
- package/.tsc/lib/contract/instance/router/academic/search-grants.d.ts +84 -0
- package/.tsc/lib/contract/instance/router/academic/search-grants.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/search-grants.js +171 -0
- package/.tsc/lib/contract/instance/router/academic/search.d.ts +83 -0
- package/.tsc/lib/contract/instance/router/academic/search.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/search.js +154 -0
- package/.tsc/lib/contract/instance/router/academic/similar-papers.d.ts +89 -0
- package/.tsc/lib/contract/instance/router/academic/similar-papers.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/academic/similar-papers.js +143 -0
- package/.tsc/lib/contract/instance/router/admin/get-environment.d.ts +5 -0
- package/.tsc/lib/contract/instance/router/admin/get-environment.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/get-environment.js +13 -0
- package/.tsc/lib/contract/instance/router/admin/get-free-usage-records.d.ts +34 -0
- package/.tsc/lib/contract/instance/router/admin/get-free-usage-records.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/get-free-usage-records.js +38 -0
- package/.tsc/lib/contract/instance/router/admin/get-provider-usage-records.d.ts +41 -0
- package/.tsc/lib/contract/instance/router/admin/get-provider-usage-records.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/get-provider-usage-records.js +50 -0
- package/.tsc/lib/contract/instance/router/admin/get-usage-records.d.ts +48 -0
- package/.tsc/lib/contract/instance/router/admin/get-usage-records.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/get-usage-records.js +44 -0
- package/.tsc/lib/contract/instance/router/admin/health-check.d.ts +5 -0
- package/.tsc/lib/contract/instance/router/admin/health-check.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/health-check.js +14 -0
- package/.tsc/lib/contract/instance/router/admin/index.d.ts +9 -0
- package/.tsc/lib/contract/instance/router/admin/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/index.js +8 -0
- package/.tsc/lib/contract/instance/router/admin/set-domain.d.ts +7 -0
- package/.tsc/lib/contract/instance/router/admin/set-domain.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/set-domain.js +20 -0
- package/.tsc/lib/contract/instance/router/admin/set-environment.d.ts +7 -0
- package/.tsc/lib/contract/instance/router/admin/set-environment.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/set-environment.js +41 -0
- package/.tsc/lib/contract/instance/router/admin/set-version.d.ts +7 -0
- package/.tsc/lib/contract/instance/router/admin/set-version.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/admin/set-version.js +21 -0
- package/.tsc/lib/contract/instance/router/authenticate/index.d.ts +2 -0
- package/.tsc/lib/contract/instance/router/authenticate/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/authenticate/index.js +1 -0
- package/.tsc/lib/contract/instance/router/authenticate/validate-credential.d.ts +7 -0
- package/.tsc/lib/contract/instance/router/authenticate/validate-credential.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/authenticate/validate-credential.js +20 -0
- package/.tsc/lib/contract/instance/router/bankStatement/ask.d.ts +32 -0
- package/.tsc/lib/contract/instance/router/bankStatement/ask.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/bankStatement/ask.js +88 -0
- package/.tsc/lib/contract/instance/router/bankStatement/extract.d.ts +33 -0
- package/.tsc/lib/contract/instance/router/bankStatement/extract.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/bankStatement/extract.js +113 -0
- package/.tsc/lib/contract/instance/router/bankStatement/get-default-spec.d.ts +2 -0
- package/.tsc/lib/contract/instance/router/bankStatement/get-default-spec.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/bankStatement/get-default-spec.js +19 -0
- package/.tsc/lib/contract/instance/router/bankStatement/index.d.ts +4 -0
- package/.tsc/lib/contract/instance/router/bankStatement/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/bankStatement/index.js +3 -0
- package/.tsc/lib/contract/instance/router/bankStatement/parse.d.ts +28 -0
- package/.tsc/lib/contract/instance/router/bankStatement/parse.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/bankStatement/parse.js +105 -0
- package/.tsc/lib/contract/instance/router/document/ask.d.ts +32 -0
- package/.tsc/lib/contract/instance/router/document/ask.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/document/ask.js +134 -0
- package/.tsc/lib/contract/instance/router/document/extract.d.ts +33 -0
- package/.tsc/lib/contract/instance/router/document/extract.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/document/extract.js +152 -0
- package/.tsc/lib/contract/instance/router/document/get-default-spec.d.ts +2 -0
- package/.tsc/lib/contract/instance/router/document/get-default-spec.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/document/get-default-spec.js +19 -0
- package/.tsc/lib/contract/instance/router/document/index.d.ts +4 -0
- package/.tsc/lib/contract/instance/router/document/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/document/index.js +3 -0
- package/.tsc/lib/contract/instance/router/document/parse.d.ts +40 -0
- package/.tsc/lib/contract/instance/router/document/parse.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/document/parse.js +142 -0
- package/.tsc/lib/contract/instance/router/free/bank-statement-parse.d.ts +16 -0
- package/.tsc/lib/contract/instance/router/free/bank-statement-parse.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/free/bank-statement-parse.js +87 -0
- package/.tsc/lib/contract/instance/router/free/generate-schema.d.ts +8 -0
- package/.tsc/lib/contract/instance/router/free/generate-schema.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/free/generate-schema.js +110 -0
- package/.tsc/lib/contract/instance/router/free/index.d.ts +5 -0
- package/.tsc/lib/contract/instance/router/free/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/free/index.js +4 -0
- package/.tsc/lib/contract/instance/router/free/publication-pdf-url.d.ts +12 -0
- package/.tsc/lib/contract/instance/router/free/publication-pdf-url.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/free/publication-pdf-url.js +86 -0
- package/.tsc/lib/contract/instance/router/free/rate-limit-status.d.ts +19 -0
- package/.tsc/lib/contract/instance/router/free/rate-limit-status.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/free/rate-limit-status.js +36 -0
- package/.tsc/lib/contract/instance/router/identity/ask.d.ts +32 -0
- package/.tsc/lib/contract/instance/router/identity/ask.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/identity/ask.js +95 -0
- package/.tsc/lib/contract/instance/router/identity/extract.d.ts +33 -0
- package/.tsc/lib/contract/instance/router/identity/extract.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/identity/extract.js +103 -0
- package/.tsc/lib/contract/instance/router/identity/get-default-spec.d.ts +2 -0
- package/.tsc/lib/contract/instance/router/identity/get-default-spec.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/identity/get-default-spec.js +19 -0
- package/.tsc/lib/contract/instance/router/identity/index.d.ts +4 -0
- package/.tsc/lib/contract/instance/router/identity/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/identity/index.js +3 -0
- package/.tsc/lib/contract/instance/router/identity/parse.d.ts +29 -0
- package/.tsc/lib/contract/instance/router/identity/parse.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/identity/parse.js +109 -0
- package/.tsc/lib/contract/instance/router/index.d.ts +9 -0
- package/.tsc/lib/contract/instance/router/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/index.js +8 -0
- package/.tsc/lib/contract/instance/router/invoice/ask.d.ts +32 -0
- package/.tsc/lib/contract/instance/router/invoice/ask.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/invoice/ask.js +85 -0
- package/.tsc/lib/contract/instance/router/invoice/extract.d.ts +33 -0
- package/.tsc/lib/contract/instance/router/invoice/extract.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/invoice/extract.js +109 -0
- package/.tsc/lib/contract/instance/router/invoice/get-default-spec.d.ts +2 -0
- package/.tsc/lib/contract/instance/router/invoice/get-default-spec.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/invoice/get-default-spec.js +19 -0
- package/.tsc/lib/contract/instance/router/invoice/index.d.ts +4 -0
- package/.tsc/lib/contract/instance/router/invoice/index.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/invoice/index.js +3 -0
- package/.tsc/lib/contract/instance/router/invoice/parse.d.ts +28 -0
- package/.tsc/lib/contract/instance/router/invoice/parse.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/router/invoice/parse.js +100 -0
- package/.tsc/lib/contract/instance/supported-mimes.d.ts +35 -0
- package/.tsc/lib/contract/instance/supported-mimes.d.ts.map +1 -0
- package/.tsc/lib/contract/instance/supported-mimes.js +130 -0
- package/.tsc/lib/date.d.ts.map +1 -1
- package/.tsc/lib/date.js +3 -5
- package/CHANGELOG.md +12 -0
- package/package.json +14 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { apiSources } from "@pdfvector/util";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
const breakdownItemSchema = z.object({
|
|
5
|
+
label: z.string(),
|
|
6
|
+
count: z.number(),
|
|
7
|
+
});
|
|
8
|
+
export const getUsageOverview = oc
|
|
9
|
+
.input(z.object({
|
|
10
|
+
period: z.enum(["7d", "30d", "90d", "all"]).default("30d"),
|
|
11
|
+
instanceId: z.number().nullable().optional(),
|
|
12
|
+
sources: z.array(z.enum(apiSources)).optional(),
|
|
13
|
+
}))
|
|
14
|
+
.output(z.object({
|
|
15
|
+
totalRequests: z.number(),
|
|
16
|
+
totalCredits: z.number(),
|
|
17
|
+
successCount: z.number(),
|
|
18
|
+
userErrorCount: z.number(),
|
|
19
|
+
systemErrorCount: z.number(),
|
|
20
|
+
avgDuration: z.number(),
|
|
21
|
+
p95Duration: z.number(),
|
|
22
|
+
uniqueUsers: z.number(),
|
|
23
|
+
avgPages: z.number().nullable(),
|
|
24
|
+
totalFileSize: z.number(),
|
|
25
|
+
daily: z.array(z.object({
|
|
26
|
+
date: z.string(),
|
|
27
|
+
success: z.number(),
|
|
28
|
+
userError: z.number(),
|
|
29
|
+
systemError: z.number(),
|
|
30
|
+
credits: z.number(),
|
|
31
|
+
})),
|
|
32
|
+
dailyByOperation: z.array(z.object({
|
|
33
|
+
date: z.string(),
|
|
34
|
+
operation: z.string(),
|
|
35
|
+
count: z.number(),
|
|
36
|
+
})),
|
|
37
|
+
dailyBySource: z.array(z.object({
|
|
38
|
+
date: z.string(),
|
|
39
|
+
source: z.enum(apiSources),
|
|
40
|
+
count: z.number(),
|
|
41
|
+
})),
|
|
42
|
+
byOperation: z.array(breakdownItemSchema),
|
|
43
|
+
byModel: z.array(breakdownItemSchema),
|
|
44
|
+
byDocumentType: z.array(breakdownItemSchema),
|
|
45
|
+
byIp: z.array(breakdownItemSchema),
|
|
46
|
+
topActualModels: z.array(breakdownItemSchema),
|
|
47
|
+
topModels: z.array(breakdownItemSchema),
|
|
48
|
+
topRequestedModels: z.array(breakdownItemSchema),
|
|
49
|
+
topSources: z.array(breakdownItemSchema),
|
|
50
|
+
topSystemErrors: z.array(z.object({
|
|
51
|
+
message: z.string(),
|
|
52
|
+
count: z.number(),
|
|
53
|
+
})),
|
|
54
|
+
topUserErrors: z.array(z.object({
|
|
55
|
+
message: z.string(),
|
|
56
|
+
count: z.number(),
|
|
57
|
+
})),
|
|
58
|
+
topUsers: z.array(z.object({
|
|
59
|
+
workspaceId: z.number(),
|
|
60
|
+
label: z.string(),
|
|
61
|
+
sublabel: z.string().nullable(),
|
|
62
|
+
requestCount: z.number(),
|
|
63
|
+
totalCredits: z.number(),
|
|
64
|
+
})),
|
|
65
|
+
}));
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const listUsage: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
+
search: z.ZodOptional<z.ZodString>;
|
|
4
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
all: "all";
|
|
8
|
+
success: "success";
|
|
9
|
+
system_error: "system_error";
|
|
10
|
+
user_error: "user_error";
|
|
11
|
+
}>>;
|
|
12
|
+
instanceId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
13
|
+
sortBy: z.ZodDefault<z.ZodEnum<{
|
|
14
|
+
createdAt: "createdAt";
|
|
15
|
+
credits: "credits";
|
|
16
|
+
duration: "duration";
|
|
17
|
+
operation: "operation";
|
|
18
|
+
requestedModel: "requestedModel";
|
|
19
|
+
}>>;
|
|
20
|
+
sortOrder: z.ZodDefault<z.ZodEnum<{
|
|
21
|
+
asc: "asc";
|
|
22
|
+
desc: "desc";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
items: z.ZodArray<z.ZodObject<{
|
|
26
|
+
id: z.ZodNumber;
|
|
27
|
+
instanceId: z.ZodNullable<z.ZodNumber>;
|
|
28
|
+
remoteId: z.ZodNumber;
|
|
29
|
+
credits: z.ZodNumber;
|
|
30
|
+
model: z.ZodNullable<z.ZodString>;
|
|
31
|
+
inputSource: z.ZodString;
|
|
32
|
+
inputRef: z.ZodNullable<z.ZodString>;
|
|
33
|
+
fileSize: z.ZodNumber;
|
|
34
|
+
documentType: z.ZodString;
|
|
35
|
+
documentId: z.ZodNullable<z.ZodString>;
|
|
36
|
+
error: z.ZodNullable<z.ZodString>;
|
|
37
|
+
status: z.ZodEnum<{
|
|
38
|
+
success: "success";
|
|
39
|
+
system_error: "system_error";
|
|
40
|
+
user_error: "user_error";
|
|
41
|
+
}>;
|
|
42
|
+
errorStage: z.ZodNullable<z.ZodEnum<{
|
|
43
|
+
auth: "auth";
|
|
44
|
+
preprocessing: "preprocessing";
|
|
45
|
+
processing: "processing";
|
|
46
|
+
validation: "validation";
|
|
47
|
+
}>>;
|
|
48
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
49
|
+
duration: z.ZodNumber;
|
|
50
|
+
operation: z.ZodString;
|
|
51
|
+
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
52
|
+
requestedModel: z.ZodString;
|
|
53
|
+
source: z.ZodEnum<{
|
|
54
|
+
api: "api";
|
|
55
|
+
make: "make";
|
|
56
|
+
n8n: "n8n";
|
|
57
|
+
playground: "playground";
|
|
58
|
+
sdk: "sdk";
|
|
59
|
+
unknown: "unknown";
|
|
60
|
+
zapier: "zapier";
|
|
61
|
+
}>;
|
|
62
|
+
createdAt: z.ZodDate;
|
|
63
|
+
userEmail: z.ZodNullable<z.ZodString>;
|
|
64
|
+
userName: z.ZodNullable<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
total: z.ZodNumber;
|
|
67
|
+
successCount: z.ZodNumber;
|
|
68
|
+
userErrorCount: z.ZodNumber;
|
|
69
|
+
systemErrorCount: z.ZodNumber;
|
|
70
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
71
|
+
//# sourceMappingURL=records.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../../../../../lib/contract/gateway/router/admin/usage/records.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAyDpB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { apiSources } from "@pdfvector/util";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
export const listUsage = oc
|
|
5
|
+
.input(z.object({
|
|
6
|
+
search: z.string().optional(),
|
|
7
|
+
page: z.number().int().min(1).default(1),
|
|
8
|
+
pageSize: z.number().int().min(1).max(100).default(20),
|
|
9
|
+
status: z
|
|
10
|
+
.enum(["all", "success", "user_error", "system_error"])
|
|
11
|
+
.default("all"),
|
|
12
|
+
instanceId: z.number().nullable().optional(),
|
|
13
|
+
sortBy: z
|
|
14
|
+
.enum([
|
|
15
|
+
"createdAt",
|
|
16
|
+
"operation",
|
|
17
|
+
"requestedModel",
|
|
18
|
+
"credits",
|
|
19
|
+
"duration",
|
|
20
|
+
])
|
|
21
|
+
.default("createdAt"),
|
|
22
|
+
sortOrder: z.enum(["asc", "desc"]).default("desc"),
|
|
23
|
+
}))
|
|
24
|
+
.output(z.object({
|
|
25
|
+
items: z.array(z.object({
|
|
26
|
+
id: z.number(),
|
|
27
|
+
instanceId: z.number().nullable(),
|
|
28
|
+
remoteId: z.number(),
|
|
29
|
+
credits: z.number(),
|
|
30
|
+
model: z.string().nullable(),
|
|
31
|
+
inputSource: z.string(),
|
|
32
|
+
inputRef: z.string().nullable(),
|
|
33
|
+
fileSize: z.number(),
|
|
34
|
+
documentType: z.string(),
|
|
35
|
+
documentId: z.string().nullable(),
|
|
36
|
+
error: z.string().nullable(),
|
|
37
|
+
status: z.enum(["success", "user_error", "system_error"]),
|
|
38
|
+
errorStage: z
|
|
39
|
+
.enum(["auth", "validation", "preprocessing", "processing"])
|
|
40
|
+
.nullable(),
|
|
41
|
+
errorCode: z.string().nullable(),
|
|
42
|
+
duration: z.number(),
|
|
43
|
+
operation: z.string(),
|
|
44
|
+
pageCount: z.number().nullable(),
|
|
45
|
+
requestedModel: z.string(),
|
|
46
|
+
source: z.enum(apiSources),
|
|
47
|
+
createdAt: z.date(),
|
|
48
|
+
userEmail: z.string().nullable(),
|
|
49
|
+
userName: z.string().nullable(),
|
|
50
|
+
})),
|
|
51
|
+
total: z.number(),
|
|
52
|
+
successCount: z.number(),
|
|
53
|
+
userErrorCount: z.number(),
|
|
54
|
+
systemErrorCount: z.number(),
|
|
55
|
+
}));
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const listUsers: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
+
search: z.ZodOptional<z.ZodString>;
|
|
4
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
sortBy: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
createdAt: "createdAt";
|
|
8
|
+
email: "email";
|
|
9
|
+
name: "name";
|
|
10
|
+
plan: "plan";
|
|
11
|
+
remainingCredits: "remainingCredits";
|
|
12
|
+
role: "role";
|
|
13
|
+
usedCredits: "usedCredits";
|
|
14
|
+
}>>;
|
|
15
|
+
sortDirection: z.ZodDefault<z.ZodEnum<{
|
|
16
|
+
asc: "asc";
|
|
17
|
+
desc: "desc";
|
|
18
|
+
}>>;
|
|
19
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
users: z.ZodArray<z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
email: z.ZodString;
|
|
24
|
+
role: z.ZodNullable<z.ZodString>;
|
|
25
|
+
emailVerified: z.ZodBoolean;
|
|
26
|
+
banned: z.ZodNullable<z.ZodBoolean>;
|
|
27
|
+
banReason: z.ZodNullable<z.ZodString>;
|
|
28
|
+
banExpires: z.ZodNullable<z.ZodNumber>;
|
|
29
|
+
createdAt: z.ZodDate;
|
|
30
|
+
plan: z.ZodNullable<z.ZodString>;
|
|
31
|
+
usedCredits: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
aggregatedCredits: z.ZodNullable<z.ZodNumber>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
total: z.ZodNumber;
|
|
35
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
36
|
+
export declare const userDetail: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
37
|
+
userId: z.ZodString;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
40
|
+
id: z.ZodNumber;
|
|
41
|
+
aggregatedCredits: z.ZodNumber;
|
|
42
|
+
usedCredits: z.ZodNumber;
|
|
43
|
+
changedPlans: z.ZodArray<z.ZodObject<{
|
|
44
|
+
key: z.ZodString;
|
|
45
|
+
time: z.ZodNumber;
|
|
46
|
+
credits: z.ZodNumber;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
createdAt: z.ZodDate;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
plan: z.ZodNullable<z.ZodObject<{
|
|
51
|
+
currentPlan: z.ZodObject<{
|
|
52
|
+
key: z.ZodString;
|
|
53
|
+
annual: z.ZodBoolean;
|
|
54
|
+
monthlyCredits: z.ZodNumber;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
planSchedule: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
plan: z.ZodObject<{
|
|
58
|
+
key: z.ZodString;
|
|
59
|
+
annual: z.ZodBoolean;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
date: z.ZodDate;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
planValidity: z.ZodBoolean;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
stripe: z.ZodNullable<z.ZodObject<{
|
|
66
|
+
customerId: z.ZodString;
|
|
67
|
+
subscription: z.ZodNullable<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
status: z.ZodString;
|
|
70
|
+
currentPeriodStart: z.ZodDate;
|
|
71
|
+
currentPeriodEnd: z.ZodDate;
|
|
72
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
invoices: z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
status: z.ZodNullable<z.ZodString>;
|
|
77
|
+
amountPaid: z.ZodNumber;
|
|
78
|
+
currency: z.ZodString;
|
|
79
|
+
created: z.ZodDate;
|
|
80
|
+
hostedInvoiceUrl: z.ZodNullable<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
usageStats: z.ZodObject<{
|
|
84
|
+
totalCreditsUsed: z.ZodNumber;
|
|
85
|
+
totalDocuments: z.ZodNumber;
|
|
86
|
+
usageByOperation: z.ZodArray<z.ZodObject<{
|
|
87
|
+
operation: z.ZodString;
|
|
88
|
+
count: z.ZodNumber;
|
|
89
|
+
totalCredits: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
93
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../../../lib/contract/gateway/router/admin/users.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAYzB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DA8BpB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAwEtB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
const listUsersSortBySchema = z.enum([
|
|
4
|
+
"name",
|
|
5
|
+
"email",
|
|
6
|
+
"createdAt",
|
|
7
|
+
"role",
|
|
8
|
+
"plan",
|
|
9
|
+
"usedCredits",
|
|
10
|
+
"remainingCredits",
|
|
11
|
+
]);
|
|
12
|
+
export const listUsers = oc
|
|
13
|
+
.input(z.object({
|
|
14
|
+
search: z.string().optional(),
|
|
15
|
+
offset: z.number().int().min(0).default(0),
|
|
16
|
+
limit: z.number().int().min(1).max(100).default(15),
|
|
17
|
+
sortBy: listUsersSortBySchema.default("createdAt"),
|
|
18
|
+
sortDirection: z.enum(["asc", "desc"]).default("desc"),
|
|
19
|
+
}))
|
|
20
|
+
.output(z.object({
|
|
21
|
+
users: z.array(z.object({
|
|
22
|
+
id: z.string(),
|
|
23
|
+
name: z.string(),
|
|
24
|
+
email: z.string(),
|
|
25
|
+
role: z.string().nullable(),
|
|
26
|
+
emailVerified: z.boolean(),
|
|
27
|
+
banned: z.boolean().nullable(),
|
|
28
|
+
banReason: z.string().nullable(),
|
|
29
|
+
banExpires: z.number().nullable(),
|
|
30
|
+
createdAt: z.date(),
|
|
31
|
+
plan: z.string().nullable(),
|
|
32
|
+
usedCredits: z.number().nullable(),
|
|
33
|
+
aggregatedCredits: z.number().nullable(),
|
|
34
|
+
})),
|
|
35
|
+
total: z.number(),
|
|
36
|
+
}));
|
|
37
|
+
export const userDetail = oc.input(z.object({ userId: z.string() })).output(z.object({
|
|
38
|
+
workspace: z
|
|
39
|
+
.object({
|
|
40
|
+
id: z.number(),
|
|
41
|
+
aggregatedCredits: z.number(),
|
|
42
|
+
usedCredits: z.number(),
|
|
43
|
+
changedPlans: z.array(z.object({
|
|
44
|
+
key: z.string(),
|
|
45
|
+
time: z.number(),
|
|
46
|
+
credits: z.number(),
|
|
47
|
+
})),
|
|
48
|
+
createdAt: z.date(),
|
|
49
|
+
})
|
|
50
|
+
.nullable(),
|
|
51
|
+
plan: z
|
|
52
|
+
.object({
|
|
53
|
+
currentPlan: z.object({
|
|
54
|
+
key: z.string(),
|
|
55
|
+
annual: z.boolean(),
|
|
56
|
+
monthlyCredits: z.number(),
|
|
57
|
+
}),
|
|
58
|
+
planSchedule: z
|
|
59
|
+
.object({
|
|
60
|
+
plan: z.object({
|
|
61
|
+
key: z.string(),
|
|
62
|
+
annual: z.boolean(),
|
|
63
|
+
}),
|
|
64
|
+
date: z.date(),
|
|
65
|
+
})
|
|
66
|
+
.optional(),
|
|
67
|
+
planValidity: z.boolean(),
|
|
68
|
+
})
|
|
69
|
+
.nullable(),
|
|
70
|
+
stripe: z
|
|
71
|
+
.object({
|
|
72
|
+
customerId: z.string(),
|
|
73
|
+
subscription: z
|
|
74
|
+
.object({
|
|
75
|
+
id: z.string(),
|
|
76
|
+
status: z.string(),
|
|
77
|
+
currentPeriodStart: z.date(),
|
|
78
|
+
currentPeriodEnd: z.date(),
|
|
79
|
+
cancelAtPeriodEnd: z.boolean(),
|
|
80
|
+
})
|
|
81
|
+
.nullable(),
|
|
82
|
+
invoices: z.array(z.object({
|
|
83
|
+
id: z.string(),
|
|
84
|
+
status: z.string().nullable(),
|
|
85
|
+
amountPaid: z.number(),
|
|
86
|
+
currency: z.string(),
|
|
87
|
+
created: z.date(),
|
|
88
|
+
hostedInvoiceUrl: z.string().nullable(),
|
|
89
|
+
})),
|
|
90
|
+
})
|
|
91
|
+
.nullable(),
|
|
92
|
+
usageStats: z.object({
|
|
93
|
+
totalCreditsUsed: z.number(),
|
|
94
|
+
totalDocuments: z.number(),
|
|
95
|
+
usageByOperation: z.array(z.object({
|
|
96
|
+
operation: z.string(),
|
|
97
|
+
count: z.number(),
|
|
98
|
+
totalCredits: z.number(),
|
|
99
|
+
})),
|
|
100
|
+
}),
|
|
101
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/admin.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const manage: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
+
returnURL: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodString, Record<never, never>, Record<never, never>>;
|
|
5
|
+
export declare const update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
6
|
+
plan: z.ZodObject<{
|
|
7
|
+
key: z.ZodEnum<{
|
|
8
|
+
basic: "basic";
|
|
9
|
+
free: "free";
|
|
10
|
+
pro: "pro";
|
|
11
|
+
}>;
|
|
12
|
+
annual: z.ZodBoolean;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
succeedURL: z.ZodString;
|
|
15
|
+
returnURL: z.ZodString;
|
|
16
|
+
}, z.core.$strip>, z.ZodOptional<z.ZodString>, Record<never, never>, Record<never, never>>;
|
|
17
|
+
//# sourceMappingURL=billing.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
export const manage = oc
|
|
4
|
+
.input(z.object({ returnURL: z.string() }))
|
|
5
|
+
.output(z.string());
|
|
6
|
+
export const update = oc
|
|
7
|
+
.input(z
|
|
8
|
+
.object({
|
|
9
|
+
plan: z.object({
|
|
10
|
+
key: z.enum(["free", "basic", "pro"]),
|
|
11
|
+
annual: z.boolean(),
|
|
12
|
+
}),
|
|
13
|
+
succeedURL: z.string(),
|
|
14
|
+
returnURL: z.string(),
|
|
15
|
+
})
|
|
16
|
+
.refine((data) => !(data.plan.key === "free" && data.plan.annual), {
|
|
17
|
+
message: "free plan cannot be annual",
|
|
18
|
+
path: ["plan", "annual"],
|
|
19
|
+
}))
|
|
20
|
+
.output(z.string().optional());
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const publicList: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
4
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
posts: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodNumber;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
slug: z.ZodString;
|
|
10
|
+
keyword: z.ZodNullable<z.ZodString>;
|
|
11
|
+
metaDescription: z.ZodNullable<z.ZodString>;
|
|
12
|
+
coverImage: z.ZodNullable<z.ZodString>;
|
|
13
|
+
publishedAt: z.ZodDate;
|
|
14
|
+
createdAt: z.ZodDate;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
total: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
18
|
+
export declare const publicGetBySlug: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
19
|
+
slug: z.ZodString;
|
|
20
|
+
}, z.core.$strip>, z.ZodNullable<z.ZodObject<{
|
|
21
|
+
id: z.ZodNumber;
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
slug: z.ZodString;
|
|
24
|
+
keyword: z.ZodNullable<z.ZodString>;
|
|
25
|
+
content: z.ZodString;
|
|
26
|
+
metaDescription: z.ZodNullable<z.ZodString>;
|
|
27
|
+
coverImage: z.ZodNullable<z.ZodString>;
|
|
28
|
+
publishedAt: z.ZodDate;
|
|
29
|
+
createdAt: z.ZodDate;
|
|
30
|
+
updatedAt: z.ZodDate;
|
|
31
|
+
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
32
|
+
export declare const publicListSlugs: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
slugs: z.ZodArray<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
35
|
+
//# sourceMappingURL=blog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blog.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/blog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAezB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;8DAYrB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;+DAEO,CAAC;AAEpC,eAAO,MAAM,eAAe;;8DAEsB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
const blogPostSchema = z.object({
|
|
4
|
+
id: z.number(),
|
|
5
|
+
title: z.string(),
|
|
6
|
+
slug: z.string(),
|
|
7
|
+
keyword: z.string().nullable(),
|
|
8
|
+
content: z.string(),
|
|
9
|
+
metaDescription: z.string().nullable(),
|
|
10
|
+
coverImage: z.string().nullable(),
|
|
11
|
+
publishedAt: z.date(),
|
|
12
|
+
createdAt: z.date(),
|
|
13
|
+
updatedAt: z.date(),
|
|
14
|
+
});
|
|
15
|
+
export const publicList = oc
|
|
16
|
+
.input(z.object({
|
|
17
|
+
offset: z.number().int().min(0).default(0),
|
|
18
|
+
limit: z.number().int().min(1).max(50).default(12),
|
|
19
|
+
}))
|
|
20
|
+
.output(z.object({
|
|
21
|
+
posts: z.array(blogPostSchema.omit({ content: true, updatedAt: true })),
|
|
22
|
+
total: z.number(),
|
|
23
|
+
}));
|
|
24
|
+
export const publicGetBySlug = oc
|
|
25
|
+
.input(z.object({ slug: z.string() }))
|
|
26
|
+
.output(blogPostSchema.nullable());
|
|
27
|
+
export const publicListSlugs = oc
|
|
28
|
+
.input(z.object({}))
|
|
29
|
+
.output(z.object({ slugs: z.array(z.string()) }));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const submit: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
+
type: z.ZodEnum<{
|
|
4
|
+
bug: "bug";
|
|
5
|
+
feature: "feature";
|
|
6
|
+
improvement: "improvement";
|
|
7
|
+
other: "other";
|
|
8
|
+
question: "question";
|
|
9
|
+
}>;
|
|
10
|
+
message: z.ZodString;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
id: z.ZodNumber;
|
|
13
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
14
|
+
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/feedback.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAUzB,eAAO,MAAM,MAAM;;;;;;;;;;;8DAOmB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
const feedbackTypeSchema = z.enum([
|
|
4
|
+
"bug",
|
|
5
|
+
"feature",
|
|
6
|
+
"improvement",
|
|
7
|
+
"question",
|
|
8
|
+
"other",
|
|
9
|
+
]);
|
|
10
|
+
export const submit = oc
|
|
11
|
+
.input(z.object({
|
|
12
|
+
type: feedbackTypeSchema,
|
|
13
|
+
message: z.string().min(10).max(500),
|
|
14
|
+
}))
|
|
15
|
+
.output(z.object({ id: z.number() }));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const submit: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
+
tool: z.ZodEnum<{
|
|
4
|
+
bankStatementConverter: "bankStatementConverter";
|
|
5
|
+
doiToPdf: "doiToPdf";
|
|
6
|
+
jsonSchemaEditor: "jsonSchemaEditor";
|
|
7
|
+
}>;
|
|
8
|
+
type: z.ZodEnum<{
|
|
9
|
+
bug: "bug";
|
|
10
|
+
feature: "feature";
|
|
11
|
+
improvement: "improvement";
|
|
12
|
+
other: "other";
|
|
13
|
+
}>;
|
|
14
|
+
message: z.ZodString;
|
|
15
|
+
email: z.ZodEmail;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
id: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
19
|
+
//# sourceMappingURL=free-feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-feedback.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/free-feedback.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;8DASmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
export const submit = oc
|
|
4
|
+
.input(z.object({
|
|
5
|
+
tool: z.enum(["bankStatementConverter", "jsonSchemaEditor", "doiToPdf"]),
|
|
6
|
+
type: z.enum(["feature", "bug", "improvement", "other"]),
|
|
7
|
+
message: z.string().min(10).max(500),
|
|
8
|
+
email: z.email(),
|
|
9
|
+
}))
|
|
10
|
+
.output(z.object({ id: z.number() }));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const greeting: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
message: z.ZodString;
|
|
6
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
7
|
+
//# sourceMappingURL=greeting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greeting.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/greeting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAUzB,eAAO,MAAM,QAAQ;;;;8DAES,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
const greetingInputSchema = z.object({
|
|
4
|
+
name: z.string(),
|
|
5
|
+
});
|
|
6
|
+
const greetingOutputSchema = z.object({
|
|
7
|
+
message: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export const greeting = oc
|
|
10
|
+
.input(greetingInputSchema)
|
|
11
|
+
.output(greetingOutputSchema);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const health: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
|
3
|
+
status: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
5
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/health.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAMzB,eAAO,MAAM,MAAM;;8DAAgC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as admin from "./admin.js";
|
|
2
|
+
export * as billing from "./billing.js";
|
|
3
|
+
export * as blog from "./blog.js";
|
|
4
|
+
export * as feedback from "./feedback.js";
|
|
5
|
+
export * as freeFeedback from "./free-feedback.js";
|
|
6
|
+
export * from "./greeting.js";
|
|
7
|
+
export * from "./health.js";
|
|
8
|
+
export * as instance from "./instance.js";
|
|
9
|
+
export * as workspace from "./workspace.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/contract/gateway/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC"}
|