@pdfvector/client 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/contract.cjs +155 -6
- package/dist/contract.d.cts +145 -1
- package/dist/contract.d.mts +145 -1
- package/dist/contract.mjs +155 -6
- package/dist/index.cjs +54 -17
- package/dist/index.d.cts +145 -1
- package/dist/index.d.mts +145 -1
- package/dist/index.mjs +54 -17
- package/package.json +2 -2
package/dist/contract.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
Array.isArray;
|
|
4
|
-
// ../../node_modules/.bun/@orpc+shared@1.
|
|
4
|
+
// ../../node_modules/.bun/@orpc+shared@1.16.2+e40b0dfdd726a224/node_modules/@orpc/shared/dist/index.mjs
|
|
5
5
|
function resolveMaybeOptionalOptions(rest) {
|
|
6
6
|
return rest[0] ?? {};
|
|
7
7
|
}
|
|
@@ -12,9 +12,9 @@ function getConstructor(value) {
|
|
|
12
12
|
function isTypescriptObject(value) {
|
|
13
13
|
return !!value && (typeof value === "object" || typeof value === "function");
|
|
14
14
|
}
|
|
15
|
-
// ../../node_modules/.bun/@orpc+client@1.
|
|
15
|
+
// ../../node_modules/.bun/@orpc+client@1.16.2+e40b0dfdd726a224/node_modules/@orpc/client/dist/shared/client.DeR0HTYb.mjs
|
|
16
16
|
const ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
|
|
17
|
-
const ORPC_CLIENT_PACKAGE_VERSION = "1.
|
|
17
|
+
const ORPC_CLIENT_PACKAGE_VERSION = "1.16.2";
|
|
18
18
|
const COMMON_ORPC_ERROR_DEFS = {
|
|
19
19
|
BAD_REQUEST: {
|
|
20
20
|
status: 400,
|
|
@@ -153,7 +153,7 @@ let globalORPCErrorConstructors;
|
|
|
153
153
|
function isORPCErrorStatus(status) {
|
|
154
154
|
return status < 200 || status >= 400;
|
|
155
155
|
}
|
|
156
|
-
// ../../node_modules/.bun/@orpc+contract@1.
|
|
156
|
+
// ../../node_modules/.bun/@orpc+contract@1.16.2+e40b0dfdd726a224/node_modules/@orpc/contract/dist/shared/contract.D_dZrO__.mjs
|
|
157
157
|
function mergeErrorMap(errorMap1, errorMap2) {
|
|
158
158
|
return {
|
|
159
159
|
...errorMap1,
|
|
@@ -175,7 +175,7 @@ function isContractProcedure(item) {
|
|
|
175
175
|
if (item instanceof ContractProcedure) return true;
|
|
176
176
|
return (typeof item === "object" || typeof item === "function") && item !== null && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "errorMap" in item["~orpc"] && "route" in item["~orpc"] && "meta" in item["~orpc"];
|
|
177
177
|
}
|
|
178
|
-
// ../../node_modules/.bun/@orpc+contract@1.
|
|
178
|
+
// ../../node_modules/.bun/@orpc+contract@1.16.2+e40b0dfdd726a224/node_modules/@orpc/contract/dist/index.mjs
|
|
179
179
|
function mergeMeta(meta1, meta2) {
|
|
180
180
|
return {
|
|
181
181
|
...meta1,
|
|
@@ -2419,7 +2419,7 @@ const search = oc.input(z.object({
|
|
|
2419
2419
|
})).output(z.object({
|
|
2420
2420
|
estimatedTotalResults: z.number(),
|
|
2421
2421
|
results: z.array(publicationSchema$1),
|
|
2422
|
-
errors: z.array(providerErrorSchema$1).nullish(),
|
|
2422
|
+
errors: z.array(providerErrorSchema$1).nullish().describe("Providers that failed for this request (for example rate limited or unavailable). When present, `results` only contain papers from the providers that succeeded, so treat the response as partial. Credits are the same either way."),
|
|
2423
2423
|
requestId: z.number().int()
|
|
2424
2424
|
})).route({
|
|
2425
2425
|
summary: "Search academic papers",
|
|
@@ -2646,6 +2646,136 @@ var academic_exports = /* @__PURE__ */ __exportAll({
|
|
|
2646
2646
|
searchGrants: () => searchGrants,
|
|
2647
2647
|
similarPapers: () => similarPapers
|
|
2648
2648
|
});
|
|
2649
|
+
// ../util/lib/contract/instance/router/admin/retained-input-schema.ts
|
|
2650
|
+
const retainedInputUsageKinds = ["api", "free"];
|
|
2651
|
+
const retainedInputReasons = [
|
|
2652
|
+
"system_error",
|
|
2653
|
+
"user_error",
|
|
2654
|
+
"fallback_success"
|
|
2655
|
+
];
|
|
2656
|
+
const retainedInputFileStatuses = [
|
|
2657
|
+
"kept",
|
|
2658
|
+
"skipped",
|
|
2659
|
+
"deleted",
|
|
2660
|
+
"expired",
|
|
2661
|
+
"evicted"
|
|
2662
|
+
];
|
|
2663
|
+
const retainedInputSkipReasons = [
|
|
2664
|
+
"input_not_read",
|
|
2665
|
+
"password_protected",
|
|
2666
|
+
"too_large",
|
|
2667
|
+
"not_eligible",
|
|
2668
|
+
"storage_full",
|
|
2669
|
+
"storage_error"
|
|
2670
|
+
];
|
|
2671
|
+
const retainedInputActorTypes = [
|
|
2672
|
+
"admin",
|
|
2673
|
+
"workspace_owner",
|
|
2674
|
+
"account_deletion"
|
|
2675
|
+
];
|
|
2676
|
+
const retainedInputUsageKindSchema = z.enum(retainedInputUsageKinds);
|
|
2677
|
+
const retainedInputActorSchema = z.object({
|
|
2678
|
+
type: z.enum(retainedInputActorTypes),
|
|
2679
|
+
userId: z.string().min(1).max(200),
|
|
2680
|
+
email: z.string().max(320).optional()
|
|
2681
|
+
});
|
|
2682
|
+
const providerChainEntrySchema = z.object({
|
|
2683
|
+
provider: z.string(),
|
|
2684
|
+
service: z.string(),
|
|
2685
|
+
model: z.string().nullable(),
|
|
2686
|
+
status: z.string(),
|
|
2687
|
+
error: z.string().nullable()
|
|
2688
|
+
});
|
|
2689
|
+
const inputDiagnosticsSchema = z.object({
|
|
2690
|
+
errorCode: z.string().nullable(),
|
|
2691
|
+
errorStage: z.string().nullable(),
|
|
2692
|
+
errorStatus: z.string().nullable(),
|
|
2693
|
+
providerChain: z.array(providerChainEntrySchema),
|
|
2694
|
+
inputSource: z.string().nullable(),
|
|
2695
|
+
declaredMime: z.string().nullable(),
|
|
2696
|
+
detectedMime: z.string().nullable(),
|
|
2697
|
+
detectedExtension: z.string().nullable(),
|
|
2698
|
+
extension: z.string().nullable(),
|
|
2699
|
+
documentType: z.string().nullable(),
|
|
2700
|
+
sizeBytes: z.number().nullable(),
|
|
2701
|
+
sha256: z.string().nullable(),
|
|
2702
|
+
pageCount: z.number().nullable(),
|
|
2703
|
+
pdf: z.object({
|
|
2704
|
+
version: z.string().nullable(),
|
|
2705
|
+
producer: z.string().nullable(),
|
|
2706
|
+
creator: z.string().nullable(),
|
|
2707
|
+
encrypted: z.boolean(),
|
|
2708
|
+
hasForms: z.boolean().nullable(),
|
|
2709
|
+
hasAttachments: z.boolean().nullable(),
|
|
2710
|
+
pagesSampled: z.number(),
|
|
2711
|
+
pagesWithoutText: z.number(),
|
|
2712
|
+
scannedRatio: z.number().nullable(),
|
|
2713
|
+
openError: z.string().nullable()
|
|
2714
|
+
}).nullable(),
|
|
2715
|
+
image: z.object({
|
|
2716
|
+
width: z.number().nullable(),
|
|
2717
|
+
height: z.number().nullable(),
|
|
2718
|
+
type: z.string().nullable()
|
|
2719
|
+
}).nullable()
|
|
2720
|
+
});
|
|
2721
|
+
const retainedInputAuditEntrySchema = z.object({
|
|
2722
|
+
action: z.enum(["download", "delete"]),
|
|
2723
|
+
actorType: z.enum(retainedInputActorTypes),
|
|
2724
|
+
actorId: z.string(),
|
|
2725
|
+
actorEmail: z.string().nullable(),
|
|
2726
|
+
createdAt: z.number()
|
|
2727
|
+
});
|
|
2728
|
+
const retainedInputRecordSchema = z.object({
|
|
2729
|
+
usageKind: retainedInputUsageKindSchema,
|
|
2730
|
+
usageId: z.number(),
|
|
2731
|
+
workspaceId: z.number().nullable(),
|
|
2732
|
+
operation: z.string(),
|
|
2733
|
+
reason: z.enum(retainedInputReasons),
|
|
2734
|
+
fileStatus: z.enum(retainedInputFileStatuses),
|
|
2735
|
+
skipReason: z.enum(retainedInputSkipReasons).nullable(),
|
|
2736
|
+
inputBytes: z.number().nullable(),
|
|
2737
|
+
expiresAt: z.number().nullable(),
|
|
2738
|
+
deletedAt: z.number().nullable(),
|
|
2739
|
+
diagnostics: inputDiagnosticsSchema,
|
|
2740
|
+
audit: z.array(retainedInputAuditEntrySchema),
|
|
2741
|
+
createdAt: z.number()
|
|
2742
|
+
});
|
|
2743
|
+
// ../util/lib/contract/instance/router/admin/delete-retained-inputs.ts
|
|
2744
|
+
const deleteRetainedInputs = oc.route({
|
|
2745
|
+
summary: "Delete retained inputs",
|
|
2746
|
+
description: "Deletes one request's kept input, or every kept input of a workspace; every deletion is audit-logged",
|
|
2747
|
+
tags: ["Admin"],
|
|
2748
|
+
spec: (op) => {
|
|
2749
|
+
op.security = [{ bearerAuth: [] }];
|
|
2750
|
+
return op;
|
|
2751
|
+
}
|
|
2752
|
+
}).input(z.union([z.object({
|
|
2753
|
+
usageKind: retainedInputUsageKindSchema,
|
|
2754
|
+
usageId: z.number().int().positive(),
|
|
2755
|
+
workspaceId: z.number().int().optional(),
|
|
2756
|
+
actor: retainedInputActorSchema
|
|
2757
|
+
}), z.object({
|
|
2758
|
+
workspaceId: z.number().int(),
|
|
2759
|
+
actor: retainedInputActorSchema
|
|
2760
|
+
})])).output(z.object({ deleted: z.number() }));
|
|
2761
|
+
// ../util/lib/contract/instance/router/admin/download-retained-input.ts
|
|
2762
|
+
const downloadRetainedInput = oc.route({
|
|
2763
|
+
summary: "Download a retained input",
|
|
2764
|
+
description: "Decrypts and returns a failed request's kept input; every call is audit-logged",
|
|
2765
|
+
tags: ["Admin"],
|
|
2766
|
+
spec: (op) => {
|
|
2767
|
+
op.security = [{ bearerAuth: [] }];
|
|
2768
|
+
return op;
|
|
2769
|
+
}
|
|
2770
|
+
}).input(z.object({
|
|
2771
|
+
usageKind: retainedInputUsageKindSchema,
|
|
2772
|
+
usageId: z.number().int().positive(),
|
|
2773
|
+
actor: retainedInputActorSchema
|
|
2774
|
+
})).output(z.object({
|
|
2775
|
+
file: z.instanceof(File),
|
|
2776
|
+
url: z.string().nullable(),
|
|
2777
|
+
responseHeaders: z.record(z.string(), z.string()).nullable()
|
|
2778
|
+
}));
|
|
2649
2779
|
// ../util/lib/contract/instance/router/admin/get-environment.ts
|
|
2650
2780
|
const getEnvironment = oc.route({
|
|
2651
2781
|
summary: "Get instance server's environment",
|
|
@@ -2735,6 +2865,22 @@ const getProviderUsageRecords = oc.route({
|
|
|
2735
2865
|
records: z.array(providerUsageRecordSchema),
|
|
2736
2866
|
hasMore: z.boolean()
|
|
2737
2867
|
}));
|
|
2868
|
+
// ../util/lib/contract/instance/router/admin/get-retained-inputs.ts
|
|
2869
|
+
const getRetainedInputs = oc.route({
|
|
2870
|
+
summary: "Get retained inputs",
|
|
2871
|
+
description: "Returns the diagnostics and retention state of failed requests' inputs",
|
|
2872
|
+
tags: ["Admin"],
|
|
2873
|
+
spec: (op) => {
|
|
2874
|
+
op.security = [{ bearerAuth: [] }];
|
|
2875
|
+
return op;
|
|
2876
|
+
}
|
|
2877
|
+
}).input(z.object({
|
|
2878
|
+
usageKind: retainedInputUsageKindSchema,
|
|
2879
|
+
usageIds: z.array(z.number().int().positive()).min(1).max(200)
|
|
2880
|
+
})).output(z.object({
|
|
2881
|
+
enabled: z.boolean(),
|
|
2882
|
+
records: z.array(retainedInputRecordSchema)
|
|
2883
|
+
}));
|
|
2738
2884
|
// ../util/lib/contract/instance/router/admin/get-usage-records.ts
|
|
2739
2885
|
const usageRecordSchema = z.object({
|
|
2740
2886
|
id: z.number(),
|
|
@@ -2832,9 +2978,12 @@ const setVersion = oc.route({
|
|
|
2832
2978
|
}).input(setVersionInputSchema).output(adminOutputSchema);
|
|
2833
2979
|
// ../util/lib/contract/instance/router/admin/index.ts
|
|
2834
2980
|
var admin_exports = /* @__PURE__ */ __exportAll({
|
|
2981
|
+
deleteRetainedInputs: () => deleteRetainedInputs,
|
|
2982
|
+
downloadRetainedInput: () => downloadRetainedInput,
|
|
2835
2983
|
getEnvironment: () => getEnvironment,
|
|
2836
2984
|
getFreeUsageRecords: () => getFreeUsageRecords,
|
|
2837
2985
|
getProviderUsageRecords: () => getProviderUsageRecords,
|
|
2986
|
+
getRetainedInputs: () => getRetainedInputs,
|
|
2838
2987
|
getUsageRecords: () => getUsageRecords,
|
|
2839
2988
|
healthCheck: () => healthCheck,
|
|
2840
2989
|
setDomain: () => setDomain,
|
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
Array.isArray;
|
|
3
|
-
// ../../node_modules/.bun/@orpc+shared@1.
|
|
3
|
+
// ../../node_modules/.bun/@orpc+shared@1.16.2+e40b0dfdd726a224/node_modules/@orpc/shared/dist/index.mjs
|
|
4
4
|
function resolveMaybeOptionalOptions(rest) {
|
|
5
5
|
return rest[0] ?? {};
|
|
6
6
|
}
|
|
7
7
|
function toArray(value) {
|
|
8
8
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
9
9
|
}
|
|
10
|
+
const DEFAULT_MAX_BIGINT_DIGITS = 4300;
|
|
11
|
+
const BIGINT_PATTERN = /^-?(?:0|[1-9]\d*)$/;
|
|
12
|
+
function parseBigIntString(value, maxDigits) {
|
|
13
|
+
if ((value.startsWith("-") ? value.length - 1 : value.length) > maxDigits || !BIGINT_PATTERN.test(value)) return;
|
|
14
|
+
return BigInt(value);
|
|
15
|
+
}
|
|
10
16
|
const ORPC_NAME = "orpc";
|
|
11
17
|
const ORPC_SHARED_PACKAGE_NAME = "@orpc/shared";
|
|
12
|
-
const ORPC_SHARED_PACKAGE_VERSION = "1.
|
|
18
|
+
const ORPC_SHARED_PACKAGE_VERSION = "1.16.2";
|
|
13
19
|
var AbortError = class extends Error {
|
|
14
20
|
constructor(...rest) {
|
|
15
21
|
super(...rest);
|
|
@@ -215,6 +221,25 @@ function isObject(value) {
|
|
|
215
221
|
function isTypescriptObject(value) {
|
|
216
222
|
return !!value && (typeof value === "object" || typeof value === "function");
|
|
217
223
|
}
|
|
224
|
+
function setOwn(object, key, value) {
|
|
225
|
+
if (key === "__proto__") Object.defineProperty(object, key, {
|
|
226
|
+
value,
|
|
227
|
+
writable: true,
|
|
228
|
+
enumerable: true,
|
|
229
|
+
configurable: true
|
|
230
|
+
});
|
|
231
|
+
else object[key] = value;
|
|
232
|
+
}
|
|
233
|
+
function copyOnWrite(parent, key, original) {
|
|
234
|
+
const value = parent[key];
|
|
235
|
+
if (value !== original) return value;
|
|
236
|
+
let copy;
|
|
237
|
+
if (Array.isArray(value)) copy = value.slice();
|
|
238
|
+
else if (isObject(value)) copy = { ...value };
|
|
239
|
+
else return value;
|
|
240
|
+
setOwn(parent, key, copy);
|
|
241
|
+
return copy;
|
|
242
|
+
}
|
|
218
243
|
function value(value2, ...args) {
|
|
219
244
|
if (typeof value2 === "function") return value2(...args);
|
|
220
245
|
return value2;
|
|
@@ -286,9 +311,9 @@ function tryDecodeURIComponent(value) {
|
|
|
286
311
|
return value;
|
|
287
312
|
}
|
|
288
313
|
}
|
|
289
|
-
// ../../node_modules/.bun/@orpc+client@1.
|
|
314
|
+
// ../../node_modules/.bun/@orpc+client@1.16.2+e40b0dfdd726a224/node_modules/@orpc/client/dist/shared/client.DeR0HTYb.mjs
|
|
290
315
|
const ORPC_CLIENT_PACKAGE_NAME = "@orpc/client";
|
|
291
|
-
const ORPC_CLIENT_PACKAGE_VERSION = "1.
|
|
316
|
+
const ORPC_CLIENT_PACKAGE_VERSION = "1.16.2";
|
|
292
317
|
const RECURSIVE_CLIENT_UNWRAP_KEYS = /* @__PURE__ */ new Set([
|
|
293
318
|
"bind",
|
|
294
319
|
"valueOf",
|
|
@@ -457,7 +482,7 @@ function createORPCErrorFromJson(json, options = {}) {
|
|
|
457
482
|
...json
|
|
458
483
|
});
|
|
459
484
|
}
|
|
460
|
-
// ../../node_modules/.bun/@orpc+standard-server@1.
|
|
485
|
+
// ../../node_modules/.bun/@orpc+standard-server@1.16.2+e40b0dfdd726a224/node_modules/@orpc/standard-server/dist/index.mjs
|
|
461
486
|
var EventEncoderError = class extends TypeError {};
|
|
462
487
|
var EventDecoderError = class extends TypeError {};
|
|
463
488
|
var ErrorEvent = class extends Error {
|
|
@@ -658,7 +683,7 @@ function mergeStandardHeaders(a, b) {
|
|
|
658
683
|
}
|
|
659
684
|
return merged;
|
|
660
685
|
}
|
|
661
|
-
// ../../node_modules/.bun/@orpc+client@1.
|
|
686
|
+
// ../../node_modules/.bun/@orpc+client@1.16.2+e40b0dfdd726a224/node_modules/@orpc/client/dist/shared/client.BLtwTQUg.mjs
|
|
662
687
|
function mapEventIterator(iterator, maps) {
|
|
663
688
|
const mapError = async (error) => {
|
|
664
689
|
let mappedError = await maps.error(error);
|
|
@@ -693,7 +718,7 @@ function mapEventIterator(iterator, maps) {
|
|
|
693
718
|
}
|
|
694
719
|
});
|
|
695
720
|
}
|
|
696
|
-
// ../../node_modules/.bun/@orpc+client@1.
|
|
721
|
+
// ../../node_modules/.bun/@orpc+client@1.16.2+e40b0dfdd726a224/node_modules/@orpc/client/dist/index.mjs
|
|
697
722
|
function resolveFriendlyClientOptions(options) {
|
|
698
723
|
return {
|
|
699
724
|
...options,
|
|
@@ -713,7 +738,7 @@ function createORPCClient(link, options = {}) {
|
|
|
713
738
|
});
|
|
714
739
|
} }));
|
|
715
740
|
}
|
|
716
|
-
// ../../node_modules/.bun/@orpc+standard-server-fetch@1.
|
|
741
|
+
// ../../node_modules/.bun/@orpc+standard-server-fetch@1.16.2+e40b0dfdd726a224/node_modules/@orpc/standard-server-fetch/dist/index.mjs
|
|
717
742
|
function toEventIterator(stream, options = {}) {
|
|
718
743
|
const reader = (stream?.pipeThrough(new TextDecoderStream()).pipeThrough(new EventDecoderStream()))?.getReader();
|
|
719
744
|
let span;
|
|
@@ -734,7 +759,7 @@ function toEventIterator(stream, options = {}) {
|
|
|
734
759
|
value: void 0
|
|
735
760
|
};
|
|
736
761
|
}
|
|
737
|
-
switch (value.event) {
|
|
762
|
+
switch (value.event ?? (value.data !== void 0 ? "message" : void 0)) {
|
|
738
763
|
case "message": {
|
|
739
764
|
let message = parseEmptyableJSON(value.data);
|
|
740
765
|
if (isTypescriptObject(message)) message = withEventMeta(message, value);
|
|
@@ -750,7 +775,8 @@ function toEventIterator(stream, options = {}) {
|
|
|
750
775
|
span?.addEvent("error");
|
|
751
776
|
throw error;
|
|
752
777
|
}
|
|
753
|
-
case "done":
|
|
778
|
+
case "done":
|
|
779
|
+
case "close": {
|
|
754
780
|
let done2 = parseEmptyableJSON(value.data);
|
|
755
781
|
if (isTypescriptObject(done2)) done2 = withEventMeta(done2, value);
|
|
756
782
|
span?.addEvent("done");
|
|
@@ -939,7 +965,7 @@ function toStandardLazyResponse(response, options = {}) {
|
|
|
939
965
|
}
|
|
940
966
|
};
|
|
941
967
|
}
|
|
942
|
-
// ../../node_modules/.bun/@orpc+client@1.
|
|
968
|
+
// ../../node_modules/.bun/@orpc+client@1.16.2+e40b0dfdd726a224/node_modules/@orpc/client/dist/shared/client.BmCiDGqJ.mjs
|
|
943
969
|
var CompositeStandardLinkPlugin = class {
|
|
944
970
|
plugins;
|
|
945
971
|
constructor(plugins = []) {
|
|
@@ -1147,24 +1173,31 @@ var StandardRPCJsonSerializer = class {
|
|
|
1147
1173
|
}
|
|
1148
1174
|
deserialize(json, meta, maps, getBlob) {
|
|
1149
1175
|
const ref = { data: json };
|
|
1176
|
+
const input = { data: json };
|
|
1150
1177
|
if (maps && getBlob) maps.forEach((segments, i) => {
|
|
1178
|
+
const blob = getBlob(i);
|
|
1179
|
+
if (!(blob instanceof Blob)) throw invalidSerializedData(`blob ${i} is not a Blob.`);
|
|
1180
|
+
let original = input;
|
|
1151
1181
|
let currentRef = ref;
|
|
1152
1182
|
let preSegment = "data";
|
|
1153
1183
|
segments.forEach((segment) => {
|
|
1154
|
-
|
|
1184
|
+
original = original[preSegment];
|
|
1185
|
+
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
1155
1186
|
preSegment = segment;
|
|
1156
1187
|
if (!Object.hasOwn(currentRef, preSegment)) throw invalidSerializedData(`segment "${preSegment}" does not exist.`);
|
|
1157
1188
|
});
|
|
1158
|
-
currentRef[preSegment] =
|
|
1189
|
+
currentRef[preSegment] = blob;
|
|
1159
1190
|
});
|
|
1160
1191
|
for (const item of meta) {
|
|
1161
1192
|
const type = item[0];
|
|
1162
1193
|
const custom = this.customSerializers.find((custom2) => custom2.type === type);
|
|
1163
1194
|
if (custom === void 0 && !BUILT_IN_TYPES.has(type)) continue;
|
|
1195
|
+
let original = input;
|
|
1164
1196
|
let currentRef = ref;
|
|
1165
1197
|
let preSegment = "data";
|
|
1166
1198
|
for (let i = 1; i < item.length; i++) {
|
|
1167
|
-
|
|
1199
|
+
original = original[preSegment];
|
|
1200
|
+
currentRef = copyOnWrite(currentRef, preSegment, original);
|
|
1168
1201
|
preSegment = item[i];
|
|
1169
1202
|
if (!Object.hasOwn(currentRef, preSegment)) throw invalidSerializedData(`segment "${preSegment}" does not exist.`);
|
|
1170
1203
|
}
|
|
@@ -1174,10 +1207,13 @@ var StandardRPCJsonSerializer = class {
|
|
|
1174
1207
|
}
|
|
1175
1208
|
const serialized = currentRef[preSegment];
|
|
1176
1209
|
switch (type) {
|
|
1177
|
-
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.BIGINT:
|
|
1210
|
+
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.BIGINT: {
|
|
1178
1211
|
if (typeof serialized !== "string") throw invalidSerializedType(type, "bigint", "a string");
|
|
1179
|
-
|
|
1212
|
+
const value = parseBigIntString(serialized, DEFAULT_MAX_BIGINT_DIGITS);
|
|
1213
|
+
if (value === void 0) throw invalidSerializedType(type, "bigint", `a decimal integer string of at most ${DEFAULT_MAX_BIGINT_DIGITS} digits`);
|
|
1214
|
+
currentRef[preSegment] = value;
|
|
1180
1215
|
break;
|
|
1216
|
+
}
|
|
1181
1217
|
case STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES.DATE:
|
|
1182
1218
|
if (typeof serialized !== "string" && serialized !== null) throw invalidSerializedType(type, "date", "a string or null");
|
|
1183
1219
|
currentRef[preSegment] = new Date(serialized ?? NaN);
|
|
@@ -1266,6 +1302,7 @@ var StandardRPCLinkCodec = class {
|
|
|
1266
1302
|
};
|
|
1267
1303
|
}
|
|
1268
1304
|
async decode(response) {
|
|
1305
|
+
if (response.status >= 300 && response.status < 400) throw new Error(`Unexpected redirect response (status ${response.status}): RPCLink does not follow redirects.`);
|
|
1269
1306
|
const isOk = !isORPCErrorStatus(response.status);
|
|
1270
1307
|
const deserialized = await (async () => {
|
|
1271
1308
|
let isBodyOk = false;
|
|
@@ -1353,7 +1390,7 @@ var StandardRPCLink = class extends StandardLink {
|
|
|
1353
1390
|
super(linkCodec, linkClient, options);
|
|
1354
1391
|
}
|
|
1355
1392
|
};
|
|
1356
|
-
// ../../node_modules/.bun/@orpc+client@1.
|
|
1393
|
+
// ../../node_modules/.bun/@orpc+client@1.16.2+e40b0dfdd726a224/node_modules/@orpc/client/dist/adapters/fetch/index.mjs
|
|
1357
1394
|
var CompositeLinkFetchPlugin = class extends CompositeStandardLinkPlugin {
|
|
1358
1395
|
initRuntimeAdapter(options) {
|
|
1359
1396
|
for (const plugin of this.plugins) plugin.initRuntimeAdapter?.(options);
|
package/dist/index.d.cts
CHANGED
|
@@ -1544,6 +1544,56 @@ declare const similarPapers: ContractProcedureBuilderWithInputOutput<z.ZodObject
|
|
|
1544
1544
|
declare namespace index_d_exports$8 {
|
|
1545
1545
|
export { fetch, findCitations, paperGraph, parse$4 as parse, search, searchGrants, similarPapers };
|
|
1546
1546
|
}
|
|
1547
|
+
declare const deleteRetainedInputs: ContractProcedureBuilderWithInputOutput<z.ZodUnion<readonly [z.ZodObject<{
|
|
1548
|
+
usageKind: z.ZodEnum<{
|
|
1549
|
+
api: "api";
|
|
1550
|
+
free: "free";
|
|
1551
|
+
}>;
|
|
1552
|
+
usageId: z.ZodNumber;
|
|
1553
|
+
workspaceId: z.ZodOptional<z.ZodNumber>;
|
|
1554
|
+
actor: z.ZodObject<{
|
|
1555
|
+
type: z.ZodEnum<{
|
|
1556
|
+
account_deletion: "account_deletion";
|
|
1557
|
+
admin: "admin";
|
|
1558
|
+
workspace_owner: "workspace_owner";
|
|
1559
|
+
}>;
|
|
1560
|
+
userId: z.ZodString;
|
|
1561
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1562
|
+
}, z.core.$strip>;
|
|
1563
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1564
|
+
workspaceId: z.ZodNumber;
|
|
1565
|
+
actor: z.ZodObject<{
|
|
1566
|
+
type: z.ZodEnum<{
|
|
1567
|
+
account_deletion: "account_deletion";
|
|
1568
|
+
admin: "admin";
|
|
1569
|
+
workspace_owner: "workspace_owner";
|
|
1570
|
+
}>;
|
|
1571
|
+
userId: z.ZodString;
|
|
1572
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1573
|
+
}, z.core.$strip>;
|
|
1574
|
+
}, z.core.$strip>]>, z.ZodObject<{
|
|
1575
|
+
deleted: z.ZodNumber;
|
|
1576
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1577
|
+
declare const downloadRetainedInput: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1578
|
+
usageKind: z.ZodEnum<{
|
|
1579
|
+
api: "api";
|
|
1580
|
+
free: "free";
|
|
1581
|
+
}>;
|
|
1582
|
+
usageId: z.ZodNumber;
|
|
1583
|
+
actor: z.ZodObject<{
|
|
1584
|
+
type: z.ZodEnum<{
|
|
1585
|
+
account_deletion: "account_deletion";
|
|
1586
|
+
admin: "admin";
|
|
1587
|
+
workspace_owner: "workspace_owner";
|
|
1588
|
+
}>;
|
|
1589
|
+
userId: z.ZodString;
|
|
1590
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1591
|
+
}, z.core.$strip>;
|
|
1592
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1593
|
+
file: z.ZodInstanceOf<any>;
|
|
1594
|
+
url: z.ZodNullable<z.ZodString>;
|
|
1595
|
+
responseHeaders: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1596
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1547
1597
|
declare const getEnvironment: ContractProcedureBuilderWithOutput<Schema$1<unknown, unknown>, z.ZodObject<{
|
|
1548
1598
|
environment: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1549
1599
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
@@ -1629,6 +1679,100 @@ declare const getProviderUsageRecords: ContractProcedureBuilderWithInputOutput<z
|
|
|
1629
1679
|
}, z.core.$strip>>;
|
|
1630
1680
|
hasMore: z.ZodBoolean;
|
|
1631
1681
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1682
|
+
declare const getRetainedInputs: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1683
|
+
usageKind: z.ZodEnum<{
|
|
1684
|
+
api: "api";
|
|
1685
|
+
free: "free";
|
|
1686
|
+
}>;
|
|
1687
|
+
usageIds: z.ZodArray<z.ZodNumber>;
|
|
1688
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1689
|
+
enabled: z.ZodBoolean;
|
|
1690
|
+
records: z.ZodArray<z.ZodObject<{
|
|
1691
|
+
usageKind: z.ZodEnum<{
|
|
1692
|
+
api: "api";
|
|
1693
|
+
free: "free";
|
|
1694
|
+
}>;
|
|
1695
|
+
usageId: z.ZodNumber;
|
|
1696
|
+
workspaceId: z.ZodNullable<z.ZodNumber>;
|
|
1697
|
+
operation: z.ZodString;
|
|
1698
|
+
reason: z.ZodEnum<{
|
|
1699
|
+
fallback_success: "fallback_success";
|
|
1700
|
+
system_error: "system_error";
|
|
1701
|
+
user_error: "user_error";
|
|
1702
|
+
}>;
|
|
1703
|
+
fileStatus: z.ZodEnum<{
|
|
1704
|
+
deleted: "deleted";
|
|
1705
|
+
evicted: "evicted";
|
|
1706
|
+
expired: "expired";
|
|
1707
|
+
kept: "kept";
|
|
1708
|
+
skipped: "skipped";
|
|
1709
|
+
}>;
|
|
1710
|
+
skipReason: z.ZodNullable<z.ZodEnum<{
|
|
1711
|
+
input_not_read: "input_not_read";
|
|
1712
|
+
not_eligible: "not_eligible";
|
|
1713
|
+
password_protected: "password_protected";
|
|
1714
|
+
storage_error: "storage_error";
|
|
1715
|
+
storage_full: "storage_full";
|
|
1716
|
+
too_large: "too_large";
|
|
1717
|
+
}>>;
|
|
1718
|
+
inputBytes: z.ZodNullable<z.ZodNumber>;
|
|
1719
|
+
expiresAt: z.ZodNullable<z.ZodNumber>;
|
|
1720
|
+
deletedAt: z.ZodNullable<z.ZodNumber>;
|
|
1721
|
+
diagnostics: z.ZodObject<{
|
|
1722
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
1723
|
+
errorStage: z.ZodNullable<z.ZodString>;
|
|
1724
|
+
errorStatus: z.ZodNullable<z.ZodString>;
|
|
1725
|
+
providerChain: z.ZodArray<z.ZodObject<{
|
|
1726
|
+
provider: z.ZodString;
|
|
1727
|
+
service: z.ZodString;
|
|
1728
|
+
model: z.ZodNullable<z.ZodString>;
|
|
1729
|
+
status: z.ZodString;
|
|
1730
|
+
error: z.ZodNullable<z.ZodString>;
|
|
1731
|
+
}, z.core.$strip>>;
|
|
1732
|
+
inputSource: z.ZodNullable<z.ZodString>;
|
|
1733
|
+
declaredMime: z.ZodNullable<z.ZodString>;
|
|
1734
|
+
detectedMime: z.ZodNullable<z.ZodString>;
|
|
1735
|
+
detectedExtension: z.ZodNullable<z.ZodString>;
|
|
1736
|
+
extension: z.ZodNullable<z.ZodString>;
|
|
1737
|
+
documentType: z.ZodNullable<z.ZodString>;
|
|
1738
|
+
sizeBytes: z.ZodNullable<z.ZodNumber>;
|
|
1739
|
+
sha256: z.ZodNullable<z.ZodString>;
|
|
1740
|
+
pageCount: z.ZodNullable<z.ZodNumber>;
|
|
1741
|
+
pdf: z.ZodNullable<z.ZodObject<{
|
|
1742
|
+
version: z.ZodNullable<z.ZodString>;
|
|
1743
|
+
producer: z.ZodNullable<z.ZodString>;
|
|
1744
|
+
creator: z.ZodNullable<z.ZodString>;
|
|
1745
|
+
encrypted: z.ZodBoolean;
|
|
1746
|
+
hasForms: z.ZodNullable<z.ZodBoolean>;
|
|
1747
|
+
hasAttachments: z.ZodNullable<z.ZodBoolean>;
|
|
1748
|
+
pagesSampled: z.ZodNumber;
|
|
1749
|
+
pagesWithoutText: z.ZodNumber;
|
|
1750
|
+
scannedRatio: z.ZodNullable<z.ZodNumber>;
|
|
1751
|
+
openError: z.ZodNullable<z.ZodString>;
|
|
1752
|
+
}, z.core.$strip>>;
|
|
1753
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
1754
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
1755
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
1756
|
+
type: z.ZodNullable<z.ZodString>;
|
|
1757
|
+
}, z.core.$strip>>;
|
|
1758
|
+
}, z.core.$strip>;
|
|
1759
|
+
audit: z.ZodArray<z.ZodObject<{
|
|
1760
|
+
action: z.ZodEnum<{
|
|
1761
|
+
delete: "delete";
|
|
1762
|
+
download: "download";
|
|
1763
|
+
}>;
|
|
1764
|
+
actorType: z.ZodEnum<{
|
|
1765
|
+
account_deletion: "account_deletion";
|
|
1766
|
+
admin: "admin";
|
|
1767
|
+
workspace_owner: "workspace_owner";
|
|
1768
|
+
}>;
|
|
1769
|
+
actorId: z.ZodString;
|
|
1770
|
+
actorEmail: z.ZodNullable<z.ZodString>;
|
|
1771
|
+
createdAt: z.ZodNumber;
|
|
1772
|
+
}, z.core.$strip>>;
|
|
1773
|
+
createdAt: z.ZodNumber;
|
|
1774
|
+
}, z.core.$strip>>;
|
|
1775
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1632
1776
|
declare const getUsageRecords: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1633
1777
|
cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1634
1778
|
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -1696,7 +1840,7 @@ declare const setVersion: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
|
1696
1840
|
message: z.ZodString;
|
|
1697
1841
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1698
1842
|
declare namespace index_d_exports$7 {
|
|
1699
|
-
export { getEnvironment, getFreeUsageRecords, getProviderUsageRecords, getUsageRecords, healthCheck, setDomain, setEnvironment, setVersion };
|
|
1843
|
+
export { deleteRetainedInputs, downloadRetainedInput, getEnvironment, getFreeUsageRecords, getProviderUsageRecords, getRetainedInputs, getUsageRecords, healthCheck, setDomain, setEnvironment, setVersion };
|
|
1700
1844
|
}
|
|
1701
1845
|
declare const validateCredential: ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
1702
1846
|
status: z.ZodString;
|