@pdfvector/client 0.1.0 → 0.1.2

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.
@@ -1459,6 +1459,56 @@ declare const similarPapers: ContractProcedureBuilderWithInputOutput<z.ZodObject
1459
1459
  declare namespace index_d_exports$8 {
1460
1460
  export { fetch, findCitations, paperGraph, parse$4 as parse, search, searchGrants, similarPapers };
1461
1461
  }
1462
+ declare const deleteRetainedInputs: ContractProcedureBuilderWithInputOutput<z.ZodUnion<readonly [z.ZodObject<{
1463
+ usageKind: z.ZodEnum<{
1464
+ api: "api";
1465
+ free: "free";
1466
+ }>;
1467
+ usageId: z.ZodNumber;
1468
+ workspaceId: z.ZodOptional<z.ZodNumber>;
1469
+ actor: z.ZodObject<{
1470
+ type: z.ZodEnum<{
1471
+ account_deletion: "account_deletion";
1472
+ admin: "admin";
1473
+ workspace_owner: "workspace_owner";
1474
+ }>;
1475
+ userId: z.ZodString;
1476
+ email: z.ZodOptional<z.ZodString>;
1477
+ }, z.core.$strip>;
1478
+ }, z.core.$strip>, z.ZodObject<{
1479
+ workspaceId: z.ZodNumber;
1480
+ actor: z.ZodObject<{
1481
+ type: z.ZodEnum<{
1482
+ account_deletion: "account_deletion";
1483
+ admin: "admin";
1484
+ workspace_owner: "workspace_owner";
1485
+ }>;
1486
+ userId: z.ZodString;
1487
+ email: z.ZodOptional<z.ZodString>;
1488
+ }, z.core.$strip>;
1489
+ }, z.core.$strip>]>, z.ZodObject<{
1490
+ deleted: z.ZodNumber;
1491
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1492
+ declare const downloadRetainedInput: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1493
+ usageKind: z.ZodEnum<{
1494
+ api: "api";
1495
+ free: "free";
1496
+ }>;
1497
+ usageId: z.ZodNumber;
1498
+ actor: z.ZodObject<{
1499
+ type: z.ZodEnum<{
1500
+ account_deletion: "account_deletion";
1501
+ admin: "admin";
1502
+ workspace_owner: "workspace_owner";
1503
+ }>;
1504
+ userId: z.ZodString;
1505
+ email: z.ZodOptional<z.ZodString>;
1506
+ }, z.core.$strip>;
1507
+ }, z.core.$strip>, z.ZodObject<{
1508
+ file: z.ZodInstanceOf<any>;
1509
+ url: z.ZodNullable<z.ZodString>;
1510
+ responseHeaders: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
1511
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1462
1512
  declare const getEnvironment: ContractProcedureBuilderWithOutput<Schema$1<unknown, unknown>, z.ZodObject<{
1463
1513
  environment: z.ZodRecord<z.ZodString, z.ZodString>;
1464
1514
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -1544,6 +1594,100 @@ declare const getProviderUsageRecords: ContractProcedureBuilderWithInputOutput<z
1544
1594
  }, z.core.$strip>>;
1545
1595
  hasMore: z.ZodBoolean;
1546
1596
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1597
+ declare const getRetainedInputs: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1598
+ usageKind: z.ZodEnum<{
1599
+ api: "api";
1600
+ free: "free";
1601
+ }>;
1602
+ usageIds: z.ZodArray<z.ZodNumber>;
1603
+ }, z.core.$strip>, z.ZodObject<{
1604
+ enabled: z.ZodBoolean;
1605
+ records: z.ZodArray<z.ZodObject<{
1606
+ usageKind: z.ZodEnum<{
1607
+ api: "api";
1608
+ free: "free";
1609
+ }>;
1610
+ usageId: z.ZodNumber;
1611
+ workspaceId: z.ZodNullable<z.ZodNumber>;
1612
+ operation: z.ZodString;
1613
+ reason: z.ZodEnum<{
1614
+ fallback_success: "fallback_success";
1615
+ system_error: "system_error";
1616
+ user_error: "user_error";
1617
+ }>;
1618
+ fileStatus: z.ZodEnum<{
1619
+ deleted: "deleted";
1620
+ evicted: "evicted";
1621
+ expired: "expired";
1622
+ kept: "kept";
1623
+ skipped: "skipped";
1624
+ }>;
1625
+ skipReason: z.ZodNullable<z.ZodEnum<{
1626
+ input_not_read: "input_not_read";
1627
+ not_eligible: "not_eligible";
1628
+ password_protected: "password_protected";
1629
+ storage_error: "storage_error";
1630
+ storage_full: "storage_full";
1631
+ too_large: "too_large";
1632
+ }>>;
1633
+ inputBytes: z.ZodNullable<z.ZodNumber>;
1634
+ expiresAt: z.ZodNullable<z.ZodNumber>;
1635
+ deletedAt: z.ZodNullable<z.ZodNumber>;
1636
+ diagnostics: z.ZodObject<{
1637
+ errorCode: z.ZodNullable<z.ZodString>;
1638
+ errorStage: z.ZodNullable<z.ZodString>;
1639
+ errorStatus: z.ZodNullable<z.ZodString>;
1640
+ providerChain: z.ZodArray<z.ZodObject<{
1641
+ provider: z.ZodString;
1642
+ service: z.ZodString;
1643
+ model: z.ZodNullable<z.ZodString>;
1644
+ status: z.ZodString;
1645
+ error: z.ZodNullable<z.ZodString>;
1646
+ }, z.core.$strip>>;
1647
+ inputSource: z.ZodNullable<z.ZodString>;
1648
+ declaredMime: z.ZodNullable<z.ZodString>;
1649
+ detectedMime: z.ZodNullable<z.ZodString>;
1650
+ detectedExtension: z.ZodNullable<z.ZodString>;
1651
+ extension: z.ZodNullable<z.ZodString>;
1652
+ documentType: z.ZodNullable<z.ZodString>;
1653
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
1654
+ sha256: z.ZodNullable<z.ZodString>;
1655
+ pageCount: z.ZodNullable<z.ZodNumber>;
1656
+ pdf: z.ZodNullable<z.ZodObject<{
1657
+ version: z.ZodNullable<z.ZodString>;
1658
+ producer: z.ZodNullable<z.ZodString>;
1659
+ creator: z.ZodNullable<z.ZodString>;
1660
+ encrypted: z.ZodBoolean;
1661
+ hasForms: z.ZodNullable<z.ZodBoolean>;
1662
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
1663
+ pagesSampled: z.ZodNumber;
1664
+ pagesWithoutText: z.ZodNumber;
1665
+ scannedRatio: z.ZodNullable<z.ZodNumber>;
1666
+ openError: z.ZodNullable<z.ZodString>;
1667
+ }, z.core.$strip>>;
1668
+ image: z.ZodNullable<z.ZodObject<{
1669
+ width: z.ZodNullable<z.ZodNumber>;
1670
+ height: z.ZodNullable<z.ZodNumber>;
1671
+ type: z.ZodNullable<z.ZodString>;
1672
+ }, z.core.$strip>>;
1673
+ }, z.core.$strip>;
1674
+ audit: z.ZodArray<z.ZodObject<{
1675
+ action: z.ZodEnum<{
1676
+ delete: "delete";
1677
+ download: "download";
1678
+ }>;
1679
+ actorType: z.ZodEnum<{
1680
+ account_deletion: "account_deletion";
1681
+ admin: "admin";
1682
+ workspace_owner: "workspace_owner";
1683
+ }>;
1684
+ actorId: z.ZodString;
1685
+ actorEmail: z.ZodNullable<z.ZodString>;
1686
+ createdAt: z.ZodNumber;
1687
+ }, z.core.$strip>>;
1688
+ createdAt: z.ZodNumber;
1689
+ }, z.core.$strip>>;
1690
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1547
1691
  declare const getUsageRecords: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1548
1692
  cursor: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
1549
1693
  limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
@@ -1611,7 +1755,7 @@ declare const setVersion: ContractProcedureBuilderWithInputOutput<z.ZodObject<{
1611
1755
  message: z.ZodString;
1612
1756
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1613
1757
  declare namespace index_d_exports$7 {
1614
- export { getEnvironment, getFreeUsageRecords, getProviderUsageRecords, getUsageRecords, healthCheck, setDomain, setEnvironment, setVersion };
1758
+ export { deleteRetainedInputs, downloadRetainedInput, getEnvironment, getFreeUsageRecords, getProviderUsageRecords, getRetainedInputs, getUsageRecords, healthCheck, setDomain, setEnvironment, setVersion };
1615
1759
  }
1616
1760
  declare const validateCredential: ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
1617
1761
  status: z.ZodString;
@@ -2079,6 +2223,168 @@ export declare const pdfvectorModelSchema: z.ZodEnum<{
2079
2223
  pro: "pro";
2080
2224
  }>;
2081
2225
  type PDFVectorModel = z.infer<typeof pdfvectorModelSchema>;
2226
+ export declare const retainedInputUsageKinds: readonly ["api", "free"];
2227
+ export declare const retainedInputReasons: readonly ["system_error", "user_error", "fallback_success"];
2228
+ export declare const retainedInputFileStatuses: readonly ["kept", "skipped", "deleted", "expired", "evicted"];
2229
+ export declare const retainedInputSkipReasons: readonly ["input_not_read", "password_protected", "too_large", "not_eligible", "storage_full", "storage_error"];
2230
+ export declare const retainedInputActorTypes: readonly ["admin", "workspace_owner", "account_deletion"];
2231
+ export declare const retainedInputUsageKindSchema: z.ZodEnum<{
2232
+ api: "api";
2233
+ free: "free";
2234
+ }>;
2235
+ export declare const retainedInputActorSchema: z.ZodObject<{
2236
+ type: z.ZodEnum<{
2237
+ account_deletion: "account_deletion";
2238
+ admin: "admin";
2239
+ workspace_owner: "workspace_owner";
2240
+ }>;
2241
+ userId: z.ZodString;
2242
+ email: z.ZodOptional<z.ZodString>;
2243
+ }, z.core.$strip>;
2244
+ export declare const providerChainEntrySchema: z.ZodObject<{
2245
+ provider: z.ZodString;
2246
+ service: z.ZodString;
2247
+ model: z.ZodNullable<z.ZodString>;
2248
+ status: z.ZodString;
2249
+ error: z.ZodNullable<z.ZodString>;
2250
+ }, z.core.$strip>;
2251
+ export declare const inputDiagnosticsSchema: z.ZodObject<{
2252
+ errorCode: z.ZodNullable<z.ZodString>;
2253
+ errorStage: z.ZodNullable<z.ZodString>;
2254
+ errorStatus: z.ZodNullable<z.ZodString>;
2255
+ providerChain: z.ZodArray<z.ZodObject<{
2256
+ provider: z.ZodString;
2257
+ service: z.ZodString;
2258
+ model: z.ZodNullable<z.ZodString>;
2259
+ status: z.ZodString;
2260
+ error: z.ZodNullable<z.ZodString>;
2261
+ }, z.core.$strip>>;
2262
+ inputSource: z.ZodNullable<z.ZodString>;
2263
+ declaredMime: z.ZodNullable<z.ZodString>;
2264
+ detectedMime: z.ZodNullable<z.ZodString>;
2265
+ detectedExtension: z.ZodNullable<z.ZodString>;
2266
+ extension: z.ZodNullable<z.ZodString>;
2267
+ documentType: z.ZodNullable<z.ZodString>;
2268
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
2269
+ sha256: z.ZodNullable<z.ZodString>;
2270
+ pageCount: z.ZodNullable<z.ZodNumber>;
2271
+ pdf: z.ZodNullable<z.ZodObject<{
2272
+ version: z.ZodNullable<z.ZodString>;
2273
+ producer: z.ZodNullable<z.ZodString>;
2274
+ creator: z.ZodNullable<z.ZodString>;
2275
+ encrypted: z.ZodBoolean;
2276
+ hasForms: z.ZodNullable<z.ZodBoolean>;
2277
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
2278
+ pagesSampled: z.ZodNumber;
2279
+ pagesWithoutText: z.ZodNumber;
2280
+ scannedRatio: z.ZodNullable<z.ZodNumber>;
2281
+ openError: z.ZodNullable<z.ZodString>;
2282
+ }, z.core.$strip>>;
2283
+ image: z.ZodNullable<z.ZodObject<{
2284
+ width: z.ZodNullable<z.ZodNumber>;
2285
+ height: z.ZodNullable<z.ZodNumber>;
2286
+ type: z.ZodNullable<z.ZodString>;
2287
+ }, z.core.$strip>>;
2288
+ }, z.core.$strip>;
2289
+ export declare const retainedInputAuditEntrySchema: z.ZodObject<{
2290
+ action: z.ZodEnum<{
2291
+ delete: "delete";
2292
+ download: "download";
2293
+ }>;
2294
+ actorType: z.ZodEnum<{
2295
+ account_deletion: "account_deletion";
2296
+ admin: "admin";
2297
+ workspace_owner: "workspace_owner";
2298
+ }>;
2299
+ actorId: z.ZodString;
2300
+ actorEmail: z.ZodNullable<z.ZodString>;
2301
+ createdAt: z.ZodNumber;
2302
+ }, z.core.$strip>;
2303
+ export declare const retainedInputRecordSchema: z.ZodObject<{
2304
+ usageKind: z.ZodEnum<{
2305
+ api: "api";
2306
+ free: "free";
2307
+ }>;
2308
+ usageId: z.ZodNumber;
2309
+ workspaceId: z.ZodNullable<z.ZodNumber>;
2310
+ operation: z.ZodString;
2311
+ reason: z.ZodEnum<{
2312
+ fallback_success: "fallback_success";
2313
+ system_error: "system_error";
2314
+ user_error: "user_error";
2315
+ }>;
2316
+ fileStatus: z.ZodEnum<{
2317
+ deleted: "deleted";
2318
+ evicted: "evicted";
2319
+ expired: "expired";
2320
+ kept: "kept";
2321
+ skipped: "skipped";
2322
+ }>;
2323
+ skipReason: z.ZodNullable<z.ZodEnum<{
2324
+ input_not_read: "input_not_read";
2325
+ not_eligible: "not_eligible";
2326
+ password_protected: "password_protected";
2327
+ storage_error: "storage_error";
2328
+ storage_full: "storage_full";
2329
+ too_large: "too_large";
2330
+ }>>;
2331
+ inputBytes: z.ZodNullable<z.ZodNumber>;
2332
+ expiresAt: z.ZodNullable<z.ZodNumber>;
2333
+ deletedAt: z.ZodNullable<z.ZodNumber>;
2334
+ diagnostics: z.ZodObject<{
2335
+ errorCode: z.ZodNullable<z.ZodString>;
2336
+ errorStage: z.ZodNullable<z.ZodString>;
2337
+ errorStatus: z.ZodNullable<z.ZodString>;
2338
+ providerChain: z.ZodArray<z.ZodObject<{
2339
+ provider: z.ZodString;
2340
+ service: z.ZodString;
2341
+ model: z.ZodNullable<z.ZodString>;
2342
+ status: z.ZodString;
2343
+ error: z.ZodNullable<z.ZodString>;
2344
+ }, z.core.$strip>>;
2345
+ inputSource: z.ZodNullable<z.ZodString>;
2346
+ declaredMime: z.ZodNullable<z.ZodString>;
2347
+ detectedMime: z.ZodNullable<z.ZodString>;
2348
+ detectedExtension: z.ZodNullable<z.ZodString>;
2349
+ extension: z.ZodNullable<z.ZodString>;
2350
+ documentType: z.ZodNullable<z.ZodString>;
2351
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
2352
+ sha256: z.ZodNullable<z.ZodString>;
2353
+ pageCount: z.ZodNullable<z.ZodNumber>;
2354
+ pdf: z.ZodNullable<z.ZodObject<{
2355
+ version: z.ZodNullable<z.ZodString>;
2356
+ producer: z.ZodNullable<z.ZodString>;
2357
+ creator: z.ZodNullable<z.ZodString>;
2358
+ encrypted: z.ZodBoolean;
2359
+ hasForms: z.ZodNullable<z.ZodBoolean>;
2360
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
2361
+ pagesSampled: z.ZodNumber;
2362
+ pagesWithoutText: z.ZodNumber;
2363
+ scannedRatio: z.ZodNullable<z.ZodNumber>;
2364
+ openError: z.ZodNullable<z.ZodString>;
2365
+ }, z.core.$strip>>;
2366
+ image: z.ZodNullable<z.ZodObject<{
2367
+ width: z.ZodNullable<z.ZodNumber>;
2368
+ height: z.ZodNullable<z.ZodNumber>;
2369
+ type: z.ZodNullable<z.ZodString>;
2370
+ }, z.core.$strip>>;
2371
+ }, z.core.$strip>;
2372
+ audit: z.ZodArray<z.ZodObject<{
2373
+ action: z.ZodEnum<{
2374
+ delete: "delete";
2375
+ download: "download";
2376
+ }>;
2377
+ actorType: z.ZodEnum<{
2378
+ account_deletion: "account_deletion";
2379
+ admin: "admin";
2380
+ workspace_owner: "workspace_owner";
2381
+ }>;
2382
+ actorId: z.ZodString;
2383
+ actorEmail: z.ZodNullable<z.ZodString>;
2384
+ createdAt: z.ZodNumber;
2385
+ }, z.core.$strip>>;
2386
+ createdAt: z.ZodNumber;
2387
+ }, z.core.$strip>;
2082
2388
  type ContractInputs = InferContractRouterInputs<typeof index_d_exports>;
2083
2389
  type ContractOutputs = InferContractRouterOutputs<typeof index_d_exports>;
2084
2390
  export { type ContractInputs, type ContractOutputs, type ContractRouterClient, type PDFVectorModel, index_d_exports as contract };
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.15.2+e40b0dfdd726a224/node_modules/@orpc/shared/dist/index.mjs
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.2+e40b0dfdd726a224/node_modules/@orpc/client/dist/shared/client.t2tsjbV-.mjs
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.15.2";
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.15.2+e40b0dfdd726a224/node_modules/@orpc/contract/dist/shared/contract.D_dZrO__.mjs
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.15.2+e40b0dfdd726a224/node_modules/@orpc/contract/dist/index.mjs
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,
@@ -433,6 +433,7 @@ const allTierFormats = [
433
433
  "Word (.docx)",
434
434
  "Excel (.xlsx)",
435
435
  "PowerPoint (.pptx)",
436
+ "Word, Excel and PowerPoint 97-2003 (.doc, .xls, .ppt)",
436
437
  "CSV",
437
438
  "Text (.txt, .md, .tsv, .xml)",
438
439
  "HTML",
@@ -444,9 +445,9 @@ const allTierFormats = [
444
445
  /** Formats added by the pro/max/auto tiers. */
445
446
  const proTierAdditionalFormats = ["Image (PNG, JPG, TIFF, BMP, HEIF)"];
446
447
  /** Short human-readable summary of all supported formats. */
447
- const allSupportedFormatsShort = "PDF, DOCX, XLSX, PPTX, CSV, PNG, JPG, TIFF, BMP, HEIF, TXT, MD, TSV, XML, RTF, HTML, ODT, ODS, ODP, EPUB, BIB, RIS, NBIB, ENW";
448
+ const allSupportedFormatsShort = "PDF, DOCX, XLSX, PPTX, DOC, XLS, PPT, CSV, PNG, JPG, TIFF, BMP, HEIF, TXT, MD, TSV, XML, RTF, HTML, ODT, ODS, ODP, EPUB, BIB, RIS, NBIB, ENW";
448
449
  /** Long human-readable summary of all supported formats. */
449
- const allSupportedFormatsLong = "PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), CSV, Image (.png, .jpg, .tiff, .bmp, .heif), Plain Text (.txt, .md, .tsv, .xml), RTF, HTML, OpenDocument (.odt, .ods, .odp), EPUB, and Bibliography (.bib, .ris, .nbib, .enw) files";
450
+ const allSupportedFormatsLong = "PDF, Word (.docx, .doc), Excel (.xlsx, .xls), PowerPoint (.pptx, .ppt), CSV, Image (.png, .jpg, .tiff, .bmp, .heif), Plain Text (.txt, .md, .tsv, .xml), RTF, HTML, OpenDocument (.odt, .ods, .odp), EPUB, and Bibliography (.bib, .ris, .nbib, .enw) files";
450
451
  /** Image dimension limits enforced by the underlying OCR engine (Azure Document Intelligence).
451
452
  * Images outside this range are rejected with HTTP 400 before processing begins. */
452
453
  const imageDimensionLimits = {
@@ -455,7 +456,7 @@ const imageDimensionLimits = {
455
456
  };
456
457
  /** Pre-built format note for API descriptions (used in contract model descriptions). */
457
458
  const formatsByTierDescription = `Supported formats by tier:
458
- - All tiers: ${allTierFormats.join(", ")}.\n- Pro/Max/Auto adds: ${proTierAdditionalFormats.join(", ")}. Image dimensions must be between ${imageDimensionLimits.minPixels}×${imageDimensionLimits.minPixels} and ${imageDimensionLimits.maxPixels}×${imageDimensionLimits.maxPixels} pixels.`;
459
+ - All tiers: ${allTierFormats.join(", ")}.\n- Pro/Max/Auto adds: ${proTierAdditionalFormats.join(", ")}. Image dimensions must be between ${imageDimensionLimits.minPixels}×${imageDimensionLimits.minPixels} and ${imageDimensionLimits.maxPixels}×${imageDimensionLimits.maxPixels} pixels.\nHow pages are counted: PDF and TIFF pages as they are; Word (.docx, .doc), RTF, OpenDocument text, HTML and EPUB: every 3,000 characters of text is one page; Excel (.xlsx, .xls) and OpenDocument spreadsheets: one page per worksheet; PowerPoint (.pptx, .ppt) and OpenDocument presentations: one page per slide; images: one page per image; CSV and plain text: every 3,000 characters is one page; bibliographies: every 10 entries is one page.`;
459
460
  /** Academic/grant API: fixed credits per request */
460
461
  const academicCreditCosts = {
461
462
  academicSearch: 2,
@@ -2180,6 +2181,9 @@ const supportedFileMimes = [
2180
2181
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2181
2182
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2182
2183
  "application/vnd.openxmlformats-officedocument.presentationml.presentation",
2184
+ "application/msword",
2185
+ "application/vnd.ms-excel",
2186
+ "application/vnd.ms-powerpoint",
2183
2187
  "text/csv",
2184
2188
  "application/csv",
2185
2189
  "image/png",
@@ -2419,7 +2423,7 @@ const search = oc.input(z.object({
2419
2423
  })).output(z.object({
2420
2424
  estimatedTotalResults: z.number(),
2421
2425
  results: z.array(publicationSchema$1),
2422
- errors: z.array(providerErrorSchema$1).nullish(),
2426
+ 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
2427
  requestId: z.number().int()
2424
2428
  })).route({
2425
2429
  summary: "Search academic papers",
@@ -2646,6 +2650,136 @@ var academic_exports = /* @__PURE__ */ __exportAll({
2646
2650
  searchGrants: () => searchGrants,
2647
2651
  similarPapers: () => similarPapers
2648
2652
  });
2653
+ // ../util/lib/contract/instance/router/admin/retained-input-schema.ts
2654
+ const retainedInputUsageKinds = ["api", "free"];
2655
+ const retainedInputReasons = [
2656
+ "system_error",
2657
+ "user_error",
2658
+ "fallback_success"
2659
+ ];
2660
+ const retainedInputFileStatuses = [
2661
+ "kept",
2662
+ "skipped",
2663
+ "deleted",
2664
+ "expired",
2665
+ "evicted"
2666
+ ];
2667
+ const retainedInputSkipReasons = [
2668
+ "input_not_read",
2669
+ "password_protected",
2670
+ "too_large",
2671
+ "not_eligible",
2672
+ "storage_full",
2673
+ "storage_error"
2674
+ ];
2675
+ const retainedInputActorTypes = [
2676
+ "admin",
2677
+ "workspace_owner",
2678
+ "account_deletion"
2679
+ ];
2680
+ const retainedInputUsageKindSchema = z.enum(retainedInputUsageKinds);
2681
+ const retainedInputActorSchema = z.object({
2682
+ type: z.enum(retainedInputActorTypes),
2683
+ userId: z.string().min(1).max(200),
2684
+ email: z.string().max(320).optional()
2685
+ });
2686
+ const providerChainEntrySchema = z.object({
2687
+ provider: z.string(),
2688
+ service: z.string(),
2689
+ model: z.string().nullable(),
2690
+ status: z.string(),
2691
+ error: z.string().nullable()
2692
+ });
2693
+ const inputDiagnosticsSchema = z.object({
2694
+ errorCode: z.string().nullable(),
2695
+ errorStage: z.string().nullable(),
2696
+ errorStatus: z.string().nullable(),
2697
+ providerChain: z.array(providerChainEntrySchema),
2698
+ inputSource: z.string().nullable(),
2699
+ declaredMime: z.string().nullable(),
2700
+ detectedMime: z.string().nullable(),
2701
+ detectedExtension: z.string().nullable(),
2702
+ extension: z.string().nullable(),
2703
+ documentType: z.string().nullable(),
2704
+ sizeBytes: z.number().nullable(),
2705
+ sha256: z.string().nullable(),
2706
+ pageCount: z.number().nullable(),
2707
+ pdf: z.object({
2708
+ version: z.string().nullable(),
2709
+ producer: z.string().nullable(),
2710
+ creator: z.string().nullable(),
2711
+ encrypted: z.boolean(),
2712
+ hasForms: z.boolean().nullable(),
2713
+ hasAttachments: z.boolean().nullable(),
2714
+ pagesSampled: z.number(),
2715
+ pagesWithoutText: z.number(),
2716
+ scannedRatio: z.number().nullable(),
2717
+ openError: z.string().nullable()
2718
+ }).nullable(),
2719
+ image: z.object({
2720
+ width: z.number().nullable(),
2721
+ height: z.number().nullable(),
2722
+ type: z.string().nullable()
2723
+ }).nullable()
2724
+ });
2725
+ const retainedInputAuditEntrySchema = z.object({
2726
+ action: z.enum(["download", "delete"]),
2727
+ actorType: z.enum(retainedInputActorTypes),
2728
+ actorId: z.string(),
2729
+ actorEmail: z.string().nullable(),
2730
+ createdAt: z.number()
2731
+ });
2732
+ const retainedInputRecordSchema = z.object({
2733
+ usageKind: retainedInputUsageKindSchema,
2734
+ usageId: z.number(),
2735
+ workspaceId: z.number().nullable(),
2736
+ operation: z.string(),
2737
+ reason: z.enum(retainedInputReasons),
2738
+ fileStatus: z.enum(retainedInputFileStatuses),
2739
+ skipReason: z.enum(retainedInputSkipReasons).nullable(),
2740
+ inputBytes: z.number().nullable(),
2741
+ expiresAt: z.number().nullable(),
2742
+ deletedAt: z.number().nullable(),
2743
+ diagnostics: inputDiagnosticsSchema,
2744
+ audit: z.array(retainedInputAuditEntrySchema),
2745
+ createdAt: z.number()
2746
+ });
2747
+ // ../util/lib/contract/instance/router/admin/delete-retained-inputs.ts
2748
+ const deleteRetainedInputs = oc.route({
2749
+ summary: "Delete retained inputs",
2750
+ description: "Deletes one request's kept input, or every kept input of a workspace; every deletion is audit-logged",
2751
+ tags: ["Admin"],
2752
+ spec: (op) => {
2753
+ op.security = [{ bearerAuth: [] }];
2754
+ return op;
2755
+ }
2756
+ }).input(z.union([z.object({
2757
+ usageKind: retainedInputUsageKindSchema,
2758
+ usageId: z.number().int().positive(),
2759
+ workspaceId: z.number().int().optional(),
2760
+ actor: retainedInputActorSchema
2761
+ }), z.object({
2762
+ workspaceId: z.number().int(),
2763
+ actor: retainedInputActorSchema
2764
+ })])).output(z.object({ deleted: z.number() }));
2765
+ // ../util/lib/contract/instance/router/admin/download-retained-input.ts
2766
+ const downloadRetainedInput = oc.route({
2767
+ summary: "Download a retained input",
2768
+ description: "Decrypts and returns a failed request's kept input; every call is audit-logged",
2769
+ tags: ["Admin"],
2770
+ spec: (op) => {
2771
+ op.security = [{ bearerAuth: [] }];
2772
+ return op;
2773
+ }
2774
+ }).input(z.object({
2775
+ usageKind: retainedInputUsageKindSchema,
2776
+ usageId: z.number().int().positive(),
2777
+ actor: retainedInputActorSchema
2778
+ })).output(z.object({
2779
+ file: z.instanceof(File),
2780
+ url: z.string().nullable(),
2781
+ responseHeaders: z.record(z.string(), z.string()).nullable()
2782
+ }));
2649
2783
  // ../util/lib/contract/instance/router/admin/get-environment.ts
2650
2784
  const getEnvironment = oc.route({
2651
2785
  summary: "Get instance server's environment",
@@ -2735,6 +2869,22 @@ const getProviderUsageRecords = oc.route({
2735
2869
  records: z.array(providerUsageRecordSchema),
2736
2870
  hasMore: z.boolean()
2737
2871
  }));
2872
+ // ../util/lib/contract/instance/router/admin/get-retained-inputs.ts
2873
+ const getRetainedInputs = oc.route({
2874
+ summary: "Get retained inputs",
2875
+ description: "Returns the diagnostics and retention state of failed requests' inputs",
2876
+ tags: ["Admin"],
2877
+ spec: (op) => {
2878
+ op.security = [{ bearerAuth: [] }];
2879
+ return op;
2880
+ }
2881
+ }).input(z.object({
2882
+ usageKind: retainedInputUsageKindSchema,
2883
+ usageIds: z.array(z.number().int().positive()).min(1).max(200)
2884
+ })).output(z.object({
2885
+ enabled: z.boolean(),
2886
+ records: z.array(retainedInputRecordSchema)
2887
+ }));
2738
2888
  // ../util/lib/contract/instance/router/admin/get-usage-records.ts
2739
2889
  const usageRecordSchema = z.object({
2740
2890
  id: z.number(),
@@ -2832,9 +2982,12 @@ const setVersion = oc.route({
2832
2982
  }).input(setVersionInputSchema).output(adminOutputSchema);
2833
2983
  // ../util/lib/contract/instance/router/admin/index.ts
2834
2984
  var admin_exports = /* @__PURE__ */ __exportAll({
2985
+ deleteRetainedInputs: () => deleteRetainedInputs,
2986
+ downloadRetainedInput: () => downloadRetainedInput,
2835
2987
  getEnvironment: () => getEnvironment,
2836
2988
  getFreeUsageRecords: () => getFreeUsageRecords,
2837
2989
  getProviderUsageRecords: () => getProviderUsageRecords,
2990
+ getRetainedInputs: () => getRetainedInputs,
2838
2991
  getUsageRecords: () => getUsageRecords,
2839
2992
  healthCheck: () => healthCheck,
2840
2993
  setDomain: () => setDomain,
@@ -3942,4 +4095,4 @@ var router_exports = /* @__PURE__ */ __exportAll({
3942
4095
  identity: () => identity_exports,
3943
4096
  invoice: () => invoice_exports
3944
4097
  });
3945
- export { router_exports as contract, pdfvectorModelSchema };
4098
+ export { router_exports as contract, inputDiagnosticsSchema, pdfvectorModelSchema, providerChainEntrySchema, retainedInputActorSchema, retainedInputActorTypes, retainedInputAuditEntrySchema, retainedInputFileStatuses, retainedInputReasons, retainedInputRecordSchema, retainedInputSkipReasons, retainedInputUsageKindSchema, retainedInputUsageKinds };