@cloudpdf/contract 3.0.0-next.5 → 3.0.0-next.6

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/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
- import * as _embedpdf_engine_core_wire from '@embedpdf/engine-core/wire';
2
1
  import * as _embedpdf_engine_core_runtime from '@embedpdf/engine-core/runtime';
3
2
  import { DocCapability } from '@embedpdf/engine-core/runtime';
4
3
  import { z } from 'zod';
5
4
 
5
+ /**
6
+ * Tenant ids share the doc-id charset: URL-safe by construction, since
7
+ * they appear in every tenant-scoped path (and therefore in logs — do
8
+ * not put PII in tenant ids).
9
+ */
10
+ declare const tenantIdPattern: RegExp;
6
11
  /**
7
12
  * Wire paths. The URL carries the full resource identity — tenant
8
13
  * resources live under `/v1/tenants/{tenantId}/…` — and the auth model
@@ -14,6 +19,7 @@ declare const adminWirePaths: {
14
19
  readonly tenant: (tenantId: string) => string;
15
20
  readonly documents: (tenantId: string) => string;
16
21
  readonly documentsInit: (tenantId: string) => string;
22
+ readonly documentsImport: (tenantId: string) => string;
17
23
  readonly document: (tenantId: string, docId: string) => string;
18
24
  readonly documentCommit: (tenantId: string, docId: string) => string;
19
25
  readonly documentUploadProxy: (tenantId: string, docId: string) => string;
@@ -669,6 +675,239 @@ declare const AdminDocumentCommitResponseSchema: z.ZodObject<{
669
675
  };
670
676
  }>;
671
677
  type AdminDocumentCommitResponse = z.infer<typeof AdminDocumentCommitResponseSchema>;
678
+ /**
679
+ * A server-side pull source for `documents.importFrom`. The discriminator
680
+ * distinguishes AUTHORIZATION MODELS, not storage vendors:
681
+ *
682
+ * - `url` — the CALLER supplies authority: a presigned
683
+ * S3/GCS/Azure/R2/MinIO GET, or any HTTPS endpoint the
684
+ * deployment's import policy allows. The URL is a capability:
685
+ * treat it as a secret. Servers never echo its query string back
686
+ * in errors, logs, or stored failure reasons.
687
+ * - `connection` — the OPERATOR pre-registered authority: the
688
+ * request names a connection and a key; which provider backs it
689
+ * (S3, GCS, Azure Blob, filesystem, ...) is deployment
690
+ * configuration, never wire surface. `revision` is opaque here
691
+ * and provider-interpreted (S3 VersionId, GCS generation, Azure
692
+ * version id); unsupported providers reject it.
693
+ *
694
+ * Key validation at this layer is deliberately generic (byte length,
695
+ * no NUL); provider-exact rules live in the server's source adapters,
696
+ * which know which backend a connection names.
697
+ */
698
+ declare const AdminImportSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
699
+ kind: z.ZodLiteral<"url">;
700
+ url: z.ZodString;
701
+ }, "strip", z.ZodTypeAny, {
702
+ url: string;
703
+ kind: "url";
704
+ }, {
705
+ url: string;
706
+ kind: "url";
707
+ }>, z.ZodObject<{
708
+ kind: z.ZodLiteral<"connection">;
709
+ connectionId: z.ZodString;
710
+ key: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
711
+ revision: z.ZodOptional<z.ZodString>;
712
+ }, "strip", z.ZodTypeAny, {
713
+ kind: "connection";
714
+ key: string;
715
+ connectionId: string;
716
+ revision?: string | undefined;
717
+ }, {
718
+ kind: "connection";
719
+ key: string;
720
+ connectionId: string;
721
+ revision?: string | undefined;
722
+ }>]>;
723
+ type AdminImportSource = z.infer<typeof AdminImportSourceSchema>;
724
+ declare const AdminDocumentImportRequestSchema: z.ZodObject<{
725
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
726
+ kind: z.ZodLiteral<"url">;
727
+ url: z.ZodString;
728
+ }, "strip", z.ZodTypeAny, {
729
+ url: string;
730
+ kind: "url";
731
+ }, {
732
+ url: string;
733
+ kind: "url";
734
+ }>, z.ZodObject<{
735
+ kind: z.ZodLiteral<"connection">;
736
+ connectionId: z.ZodString;
737
+ key: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
738
+ revision: z.ZodOptional<z.ZodString>;
739
+ }, "strip", z.ZodTypeAny, {
740
+ kind: "connection";
741
+ key: string;
742
+ connectionId: string;
743
+ revision?: string | undefined;
744
+ }, {
745
+ kind: "connection";
746
+ key: string;
747
+ connectionId: string;
748
+ revision?: string | undefined;
749
+ }>]>;
750
+ /**
751
+ * Optional integrity pins, enforced when present: `sizeBytes`
752
+ * against the source's declared Content-Length before the transfer,
753
+ * `sha256` against the server-observed digest after it. When absent
754
+ * the server-observed values become authoritative.
755
+ * `dedupMode=reuse-existing` REQUIRES `sha256` — without a declared
756
+ * hash the server cannot know what content to reuse.
757
+ */
758
+ expected: z.ZodOptional<z.ZodObject<{
759
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
760
+ sha256: z.ZodOptional<z.ZodString>;
761
+ }, "strip", z.ZodTypeAny, {
762
+ sha256?: string | undefined;
763
+ sizeBytes?: number | undefined;
764
+ }, {
765
+ sha256?: string | undefined;
766
+ sizeBytes?: number | undefined;
767
+ }>>;
768
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
769
+ idempotencyKey: z.ZodOptional<z.ZodString>;
770
+ dedupMode: z.ZodOptional<z.ZodEnum<["always-create", "reuse-existing"]>>;
771
+ docId: z.ZodOptional<z.ZodString>;
772
+ /**
773
+ * `sync` (default) holds the response open for the whole transfer.
774
+ * `async` accepts the request (202, document `pending`), transfers
775
+ * in the background, and the caller polls the document. Async
776
+ * requires a `connection` source (URLs are secrets and expire, so
777
+ * they cannot sit in a durable job); filesystem connections
778
+ * additionally require `expected.sha256`, since they have no
779
+ * revisions to pin retries to.
780
+ */
781
+ mode: z.ZodOptional<z.ZodEnum<["sync", "async"]>>;
782
+ }, "strip", z.ZodTypeAny, {
783
+ source: {
784
+ url: string;
785
+ kind: "url";
786
+ } | {
787
+ kind: "connection";
788
+ key: string;
789
+ connectionId: string;
790
+ revision?: string | undefined;
791
+ };
792
+ expected?: {
793
+ sha256?: string | undefined;
794
+ sizeBytes?: number | undefined;
795
+ } | undefined;
796
+ metadata?: Record<string, unknown> | undefined;
797
+ idempotencyKey?: string | undefined;
798
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
799
+ docId?: string | undefined;
800
+ mode?: "sync" | "async" | undefined;
801
+ }, {
802
+ source: {
803
+ url: string;
804
+ kind: "url";
805
+ } | {
806
+ kind: "connection";
807
+ key: string;
808
+ connectionId: string;
809
+ revision?: string | undefined;
810
+ };
811
+ expected?: {
812
+ sha256?: string | undefined;
813
+ sizeBytes?: number | undefined;
814
+ } | undefined;
815
+ metadata?: Record<string, unknown> | undefined;
816
+ idempotencyKey?: string | undefined;
817
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
818
+ docId?: string | undefined;
819
+ mode?: "sync" | "async" | undefined;
820
+ }>;
821
+ type AdminDocumentImportRequest = z.infer<typeof AdminDocumentImportRequestSchema>;
822
+ declare const AdminDocumentImportResponseSchema: z.ZodObject<{
823
+ /**
824
+ * `imported` — bytes were pulled, verified, and committed (sync).
825
+ * `deduped` — an existing document satisfied the request without a
826
+ * transfer (content dedup or idempotent replay).
827
+ * `accepted` — async: the job is queued (HTTP 202); poll the
828
+ * document until `ready` or `failed`.
829
+ */
830
+ tag: z.ZodEnum<["imported", "deduped", "accepted"]>;
831
+ document: z.ZodObject<{
832
+ id: z.ZodString;
833
+ tenantId: z.ZodString;
834
+ state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
835
+ baseSha: z.ZodNullable<z.ZodString>;
836
+ storageSizeBytes: z.ZodNullable<z.ZodNumber>;
837
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
838
+ idempotencyKey: z.ZodNullable<z.ZodString>;
839
+ failureReason: z.ZodNullable<z.ZodString>;
840
+ /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
841
+ thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
842
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
843
+ createdAt: z.ZodNumber;
844
+ updatedAt: z.ZodNumber;
845
+ createdBy: z.ZodNullable<z.ZodString>;
846
+ }, "strip", z.ZodTypeAny, {
847
+ id: string;
848
+ tenantId: string;
849
+ state: "pending" | "ready" | "failed" | "deleting";
850
+ baseSha: string | null;
851
+ storageSizeBytes: number | null;
852
+ metadata: Record<string, unknown> | null;
853
+ idempotencyKey: string | null;
854
+ failureReason: string | null;
855
+ createdAt: number;
856
+ updatedAt: number;
857
+ createdBy: string | null;
858
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
859
+ thumbnailUrl?: string | null | undefined;
860
+ }, {
861
+ id: string;
862
+ tenantId: string;
863
+ state: "pending" | "ready" | "failed" | "deleting";
864
+ baseSha: string | null;
865
+ storageSizeBytes: number | null;
866
+ metadata: Record<string, unknown> | null;
867
+ idempotencyKey: string | null;
868
+ failureReason: string | null;
869
+ createdAt: number;
870
+ updatedAt: number;
871
+ createdBy: string | null;
872
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
873
+ thumbnailUrl?: string | null | undefined;
874
+ }>;
875
+ }, "strip", z.ZodTypeAny, {
876
+ tag: "deduped" | "imported" | "accepted";
877
+ document: {
878
+ id: string;
879
+ tenantId: string;
880
+ state: "pending" | "ready" | "failed" | "deleting";
881
+ baseSha: string | null;
882
+ storageSizeBytes: number | null;
883
+ metadata: Record<string, unknown> | null;
884
+ idempotencyKey: string | null;
885
+ failureReason: string | null;
886
+ createdAt: number;
887
+ updatedAt: number;
888
+ createdBy: string | null;
889
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
890
+ thumbnailUrl?: string | null | undefined;
891
+ };
892
+ }, {
893
+ tag: "deduped" | "imported" | "accepted";
894
+ document: {
895
+ id: string;
896
+ tenantId: string;
897
+ state: "pending" | "ready" | "failed" | "deleting";
898
+ baseSha: string | null;
899
+ storageSizeBytes: number | null;
900
+ metadata: Record<string, unknown> | null;
901
+ idempotencyKey: string | null;
902
+ failureReason: string | null;
903
+ createdAt: number;
904
+ updatedAt: number;
905
+ createdBy: string | null;
906
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
907
+ thumbnailUrl?: string | null | undefined;
908
+ };
909
+ }>;
910
+ type AdminDocumentImportResponse = z.infer<typeof AdminDocumentImportResponseSchema>;
672
911
  declare const AdminDocumentResponseSchema: z.ZodObject<{
673
912
  document: z.ZodObject<{
674
913
  id: z.ZodString;
@@ -2935,14 +3174,14 @@ declare const adminOperations: {
2935
3174
  };
2936
3175
  readonly notes: "This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available.";
2937
3176
  };
2938
- readonly 'documents.list': {
2939
- readonly operationId: "documents.list";
2940
- readonly title: "List documents";
2941
- readonly summary: "List documents in the tenant, newest first, cursor-paginated.";
2942
- readonly method: "GET";
2943
- readonly path: "/v1/tenants/:tenantId/documents";
3177
+ readonly 'documents.importFrom': {
3178
+ readonly operationId: "documents.importFrom";
3179
+ readonly title: "Import document";
3180
+ readonly summary: "Server-side pull: fetch a PDF from a caller-supplied URL (e.g. a presigned object-store GET) or an operator-registered storage connection into CloudPDF-owned storage, verify it, and commit it.";
3181
+ readonly method: "POST";
3182
+ readonly path: "/v1/tenants/:tenantId/documents/import";
2944
3183
  readonly credentials: readonly ["api-token", "tenant-jwt"];
2945
- readonly scope: readonly ["docs.read"];
3184
+ readonly scope: readonly ["docs.create"];
2946
3185
  readonly params: z.ZodObject<{
2947
3186
  tenantId: z.ZodString;
2948
3187
  }, "strip", z.ZodTypeAny, {
@@ -2950,24 +3189,119 @@ declare const adminOperations: {
2950
3189
  }, {
2951
3190
  tenantId: string;
2952
3191
  }>;
2953
- readonly query: z.ZodObject<{
2954
- limit: z.ZodDefault<z.ZodNumber>;
2955
- cursor: z.ZodOptional<z.ZodString>;
2956
- state: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "deleting"]>>;
2957
- }, "strip", z.ZodTypeAny, {
2958
- limit: number;
2959
- state?: "pending" | "ready" | "failed" | "deleting" | undefined;
2960
- cursor?: string | undefined;
2961
- }, {
2962
- state?: "pending" | "ready" | "failed" | "deleting" | undefined;
2963
- limit?: number | undefined;
2964
- cursor?: string | undefined;
2965
- }>;
3192
+ readonly body: {
3193
+ readonly contentType: "application/json";
3194
+ readonly schema: z.ZodObject<{
3195
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
3196
+ kind: z.ZodLiteral<"url">;
3197
+ url: z.ZodString;
3198
+ }, "strip", z.ZodTypeAny, {
3199
+ url: string;
3200
+ kind: "url";
3201
+ }, {
3202
+ url: string;
3203
+ kind: "url";
3204
+ }>, z.ZodObject<{
3205
+ kind: z.ZodLiteral<"connection">;
3206
+ connectionId: z.ZodString;
3207
+ key: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
3208
+ revision: z.ZodOptional<z.ZodString>;
3209
+ }, "strip", z.ZodTypeAny, {
3210
+ kind: "connection";
3211
+ key: string;
3212
+ connectionId: string;
3213
+ revision?: string | undefined;
3214
+ }, {
3215
+ kind: "connection";
3216
+ key: string;
3217
+ connectionId: string;
3218
+ revision?: string | undefined;
3219
+ }>]>;
3220
+ /**
3221
+ * Optional integrity pins, enforced when present: `sizeBytes`
3222
+ * against the source's declared Content-Length before the transfer,
3223
+ * `sha256` against the server-observed digest after it. When absent
3224
+ * the server-observed values become authoritative.
3225
+ * `dedupMode=reuse-existing` REQUIRES `sha256` — without a declared
3226
+ * hash the server cannot know what content to reuse.
3227
+ */
3228
+ expected: z.ZodOptional<z.ZodObject<{
3229
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
3230
+ sha256: z.ZodOptional<z.ZodString>;
3231
+ }, "strip", z.ZodTypeAny, {
3232
+ sha256?: string | undefined;
3233
+ sizeBytes?: number | undefined;
3234
+ }, {
3235
+ sha256?: string | undefined;
3236
+ sizeBytes?: number | undefined;
3237
+ }>>;
3238
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3239
+ idempotencyKey: z.ZodOptional<z.ZodString>;
3240
+ dedupMode: z.ZodOptional<z.ZodEnum<["always-create", "reuse-existing"]>>;
3241
+ docId: z.ZodOptional<z.ZodString>;
3242
+ /**
3243
+ * `sync` (default) holds the response open for the whole transfer.
3244
+ * `async` accepts the request (202, document `pending`), transfers
3245
+ * in the background, and the caller polls the document. Async
3246
+ * requires a `connection` source (URLs are secrets and expire, so
3247
+ * they cannot sit in a durable job); filesystem connections
3248
+ * additionally require `expected.sha256`, since they have no
3249
+ * revisions to pin retries to.
3250
+ */
3251
+ mode: z.ZodOptional<z.ZodEnum<["sync", "async"]>>;
3252
+ }, "strip", z.ZodTypeAny, {
3253
+ source: {
3254
+ url: string;
3255
+ kind: "url";
3256
+ } | {
3257
+ kind: "connection";
3258
+ key: string;
3259
+ connectionId: string;
3260
+ revision?: string | undefined;
3261
+ };
3262
+ expected?: {
3263
+ sha256?: string | undefined;
3264
+ sizeBytes?: number | undefined;
3265
+ } | undefined;
3266
+ metadata?: Record<string, unknown> | undefined;
3267
+ idempotencyKey?: string | undefined;
3268
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
3269
+ docId?: string | undefined;
3270
+ mode?: "sync" | "async" | undefined;
3271
+ }, {
3272
+ source: {
3273
+ url: string;
3274
+ kind: "url";
3275
+ } | {
3276
+ kind: "connection";
3277
+ key: string;
3278
+ connectionId: string;
3279
+ revision?: string | undefined;
3280
+ };
3281
+ expected?: {
3282
+ sha256?: string | undefined;
3283
+ sizeBytes?: number | undefined;
3284
+ } | undefined;
3285
+ metadata?: Record<string, unknown> | undefined;
3286
+ idempotencyKey?: string | undefined;
3287
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
3288
+ docId?: string | undefined;
3289
+ mode?: "sync" | "async" | undefined;
3290
+ }>;
3291
+ };
2966
3292
  readonly responses: {
2967
3293
  readonly 200: {
2968
3294
  readonly contentType: "application/json";
2969
3295
  readonly schema: z.ZodObject<{
2970
- documents: z.ZodArray<z.ZodObject<{
3296
+ /**
3297
+ * `imported` — bytes were pulled, verified, and committed (sync).
3298
+ * `deduped` — an existing document satisfied the request without a
3299
+ * transfer (content dedup or idempotent replay).
3300
+ * `accepted` — async: the job is queued (HTTP 202); poll the
3301
+ * document until `ready` or `failed`.
3302
+ */
3303
+ tag: z.ZodEnum<["imported", "deduped", "accepted"]>;
3304
+ document: z.ZodObject<{
2971
3305
  id: z.ZodString;
2972
3306
  tenantId: z.ZodString;
2973
3307
  state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
@@ -3010,15 +3344,10 @@ declare const adminOperations: {
3010
3344
  createdBy: string | null;
3011
3345
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3012
3346
  thumbnailUrl?: string | null | undefined;
3013
- }>, "many">;
3014
- /**
3015
- * Opaque cursor for the next page; `null` on the last page. Optional
3016
- * because pre-pagination servers omit it — clients treat absence as
3017
- * "no continuation available", same convention as the thumbnail fields.
3018
- */
3019
- nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3347
+ }>;
3020
3348
  }, "strip", z.ZodTypeAny, {
3021
- documents: {
3349
+ tag: "deduped" | "imported" | "accepted";
3350
+ document: {
3022
3351
  id: string;
3023
3352
  tenantId: string;
3024
3353
  state: "pending" | "ready" | "failed" | "deleting";
@@ -3032,10 +3361,10 @@ declare const adminOperations: {
3032
3361
  createdBy: string | null;
3033
3362
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3034
3363
  thumbnailUrl?: string | null | undefined;
3035
- }[];
3036
- nextCursor?: string | null | undefined;
3364
+ };
3037
3365
  }, {
3038
- documents: {
3366
+ tag: "deduped" | "imported" | "accepted";
3367
+ document: {
3039
3368
  id: string;
3040
3369
  tenantId: string;
3041
3370
  state: "pending" | "ready" | "failed" | "deleting";
@@ -3049,88 +3378,49 @@ declare const adminOperations: {
3049
3378
  createdBy: string | null;
3050
3379
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3051
3380
  thumbnailUrl?: string | null | undefined;
3052
- }[];
3053
- nextCursor?: string | null | undefined;
3381
+ };
3054
3382
  }>;
3055
3383
  };
3056
- readonly 400: {
3384
+ readonly 202: {
3057
3385
  readonly contentType: "application/json";
3058
3386
  readonly schema: z.ZodObject<{
3059
- error: z.ZodObject<{
3060
- code: z.ZodString;
3061
- message: z.ZodString;
3387
+ /**
3388
+ * `imported` — bytes were pulled, verified, and committed (sync).
3389
+ * `deduped` — an existing document satisfied the request without a
3390
+ * transfer (content dedup or idempotent replay).
3391
+ * `accepted` — async: the job is queued (HTTP 202); poll the
3392
+ * document until `ready` or `failed`.
3393
+ */
3394
+ tag: z.ZodEnum<["imported", "deduped", "accepted"]>;
3395
+ document: z.ZodObject<{
3396
+ id: z.ZodString;
3397
+ tenantId: z.ZodString;
3398
+ state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
3399
+ baseSha: z.ZodNullable<z.ZodString>;
3400
+ storageSizeBytes: z.ZodNullable<z.ZodNumber>;
3401
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3402
+ idempotencyKey: z.ZodNullable<z.ZodString>;
3403
+ failureReason: z.ZodNullable<z.ZodString>;
3404
+ /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
3405
+ thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
3406
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3407
+ createdAt: z.ZodNumber;
3408
+ updatedAt: z.ZodNumber;
3409
+ createdBy: z.ZodNullable<z.ZodString>;
3062
3410
  }, "strip", z.ZodTypeAny, {
3063
- code: string;
3064
- message: string;
3065
- }, {
3066
- code: string;
3067
- message: string;
3068
- }>;
3069
- }, "strip", z.ZodTypeAny, {
3070
- error: {
3071
- code: string;
3072
- message: string;
3073
- };
3074
- }, {
3075
- error: {
3076
- code: string;
3077
- message: string;
3078
- };
3079
- }>;
3080
- };
3081
- };
3082
- };
3083
- readonly 'documents.get': {
3084
- readonly operationId: "documents.get";
3085
- readonly title: "Get document";
3086
- readonly summary: "Fetch one document record.";
3087
- readonly method: "GET";
3088
- readonly path: "/v1/tenants/:tenantId/documents/:id";
3089
- readonly credentials: readonly ["api-token", "tenant-jwt"];
3090
- readonly scope: readonly ["docs.read"];
3091
- readonly params: z.ZodObject<{
3092
- tenantId: z.ZodString;
3093
- id: z.ZodString;
3094
- }, "strip", z.ZodTypeAny, {
3095
- id: string;
3096
- tenantId: string;
3097
- }, {
3098
- id: string;
3099
- tenantId: string;
3100
- }>;
3101
- readonly responses: {
3102
- readonly 200: {
3103
- readonly contentType: "application/json";
3104
- readonly schema: z.ZodObject<{
3105
- document: z.ZodObject<{
3106
- id: z.ZodString;
3107
- tenantId: z.ZodString;
3108
- state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
3109
- baseSha: z.ZodNullable<z.ZodString>;
3110
- storageSizeBytes: z.ZodNullable<z.ZodNumber>;
3111
- metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3112
- idempotencyKey: z.ZodNullable<z.ZodString>;
3113
- failureReason: z.ZodNullable<z.ZodString>;
3114
- /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
3115
- thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
3116
- thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3117
- createdAt: z.ZodNumber;
3118
- updatedAt: z.ZodNumber;
3119
- createdBy: z.ZodNullable<z.ZodString>;
3120
- }, "strip", z.ZodTypeAny, {
3121
- id: string;
3122
- tenantId: string;
3123
- state: "pending" | "ready" | "failed" | "deleting";
3124
- baseSha: string | null;
3125
- storageSizeBytes: number | null;
3126
- metadata: Record<string, unknown> | null;
3127
- idempotencyKey: string | null;
3128
- failureReason: string | null;
3129
- createdAt: number;
3130
- updatedAt: number;
3131
- createdBy: string | null;
3132
- thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3133
- thumbnailUrl?: string | null | undefined;
3411
+ id: string;
3412
+ tenantId: string;
3413
+ state: "pending" | "ready" | "failed" | "deleting";
3414
+ baseSha: string | null;
3415
+ storageSizeBytes: number | null;
3416
+ metadata: Record<string, unknown> | null;
3417
+ idempotencyKey: string | null;
3418
+ failureReason: string | null;
3419
+ createdAt: number;
3420
+ updatedAt: number;
3421
+ createdBy: string | null;
3422
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3423
+ thumbnailUrl?: string | null | undefined;
3134
3424
  }, {
3135
3425
  id: string;
3136
3426
  tenantId: string;
@@ -3147,6 +3437,7 @@ declare const adminOperations: {
3147
3437
  thumbnailUrl?: string | null | undefined;
3148
3438
  }>;
3149
3439
  }, "strip", z.ZodTypeAny, {
3440
+ tag: "deduped" | "imported" | "accepted";
3150
3441
  document: {
3151
3442
  id: string;
3152
3443
  tenantId: string;
@@ -3163,6 +3454,7 @@ declare const adminOperations: {
3163
3454
  thumbnailUrl?: string | null | undefined;
3164
3455
  };
3165
3456
  }, {
3457
+ tag: "deduped" | "imported" | "accepted";
3166
3458
  document: {
3167
3459
  id: string;
3168
3460
  tenantId: string;
@@ -3180,32 +3472,7 @@ declare const adminOperations: {
3180
3472
  };
3181
3473
  }>;
3182
3474
  };
3183
- readonly 403: {
3184
- readonly contentType: "application/json";
3185
- readonly schema: z.ZodObject<{
3186
- error: z.ZodObject<{
3187
- code: z.ZodString;
3188
- message: z.ZodString;
3189
- }, "strip", z.ZodTypeAny, {
3190
- code: string;
3191
- message: string;
3192
- }, {
3193
- code: string;
3194
- message: string;
3195
- }>;
3196
- }, "strip", z.ZodTypeAny, {
3197
- error: {
3198
- code: string;
3199
- message: string;
3200
- };
3201
- }, {
3202
- error: {
3203
- code: string;
3204
- message: string;
3205
- };
3206
- }>;
3207
- };
3208
- readonly 404: {
3475
+ readonly 400: {
3209
3476
  readonly contentType: "application/json";
3210
3477
  readonly schema: z.ZodObject<{
3211
3478
  error: z.ZodObject<{
@@ -3230,30 +3497,6 @@ declare const adminOperations: {
3230
3497
  };
3231
3498
  }>;
3232
3499
  };
3233
- };
3234
- };
3235
- readonly 'documents.download': {
3236
- readonly operationId: "documents.download";
3237
- readonly title: "Download document";
3238
- readonly summary: "Download the stored base PDF bytes.";
3239
- readonly method: "GET";
3240
- readonly path: "/v1/tenants/:tenantId/documents/:id/download";
3241
- readonly credentials: readonly ["api-token", "tenant-jwt"];
3242
- readonly scope: readonly ["docs.read"];
3243
- readonly params: z.ZodObject<{
3244
- tenantId: z.ZodString;
3245
- id: z.ZodString;
3246
- }, "strip", z.ZodTypeAny, {
3247
- id: string;
3248
- tenantId: string;
3249
- }, {
3250
- id: string;
3251
- tenantId: string;
3252
- }>;
3253
- readonly responses: {
3254
- readonly 200: {
3255
- readonly contentType: "application/pdf";
3256
- };
3257
3500
  readonly 403: {
3258
3501
  readonly contentType: "application/json";
3259
3502
  readonly schema: z.ZodObject<{
@@ -3279,7 +3522,7 @@ declare const adminOperations: {
3279
3522
  };
3280
3523
  }>;
3281
3524
  };
3282
- readonly 404: {
3525
+ readonly 502: {
3283
3526
  readonly contentType: "application/json";
3284
3527
  readonly schema: z.ZodObject<{
3285
3528
  error: z.ZodObject<{
@@ -3305,53 +3548,127 @@ declare const adminOperations: {
3305
3548
  }>;
3306
3549
  };
3307
3550
  };
3551
+ readonly notes: "Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id).";
3308
3552
  };
3309
- readonly 'documents.delete': {
3310
- readonly operationId: "documents.delete";
3311
- readonly title: "Delete document";
3312
- readonly summary: "Delete a document and its stored artifacts.";
3313
- readonly method: "DELETE";
3314
- readonly path: "/v1/tenants/:tenantId/documents/:id";
3553
+ readonly 'documents.list': {
3554
+ readonly operationId: "documents.list";
3555
+ readonly title: "List documents";
3556
+ readonly summary: "List documents in the tenant, newest first, cursor-paginated.";
3557
+ readonly method: "GET";
3558
+ readonly path: "/v1/tenants/:tenantId/documents";
3315
3559
  readonly credentials: readonly ["api-token", "tenant-jwt"];
3316
- readonly scope: readonly ["docs.delete"];
3560
+ readonly scope: readonly ["docs.read"];
3317
3561
  readonly params: z.ZodObject<{
3318
3562
  tenantId: z.ZodString;
3319
- id: z.ZodString;
3320
3563
  }, "strip", z.ZodTypeAny, {
3321
- id: string;
3322
3564
  tenantId: string;
3323
3565
  }, {
3324
- id: string;
3325
3566
  tenantId: string;
3326
3567
  }>;
3568
+ readonly query: z.ZodObject<{
3569
+ limit: z.ZodDefault<z.ZodNumber>;
3570
+ cursor: z.ZodOptional<z.ZodString>;
3571
+ state: z.ZodOptional<z.ZodEnum<["pending", "ready", "failed", "deleting"]>>;
3572
+ }, "strip", z.ZodTypeAny, {
3573
+ limit: number;
3574
+ state?: "pending" | "ready" | "failed" | "deleting" | undefined;
3575
+ cursor?: string | undefined;
3576
+ }, {
3577
+ state?: "pending" | "ready" | "failed" | "deleting" | undefined;
3578
+ limit?: number | undefined;
3579
+ cursor?: string | undefined;
3580
+ }>;
3327
3581
  readonly responses: {
3328
- readonly 204: {};
3329
- readonly 403: {
3582
+ readonly 200: {
3330
3583
  readonly contentType: "application/json";
3331
3584
  readonly schema: z.ZodObject<{
3332
- error: z.ZodObject<{
3333
- code: z.ZodString;
3334
- message: z.ZodString;
3585
+ documents: z.ZodArray<z.ZodObject<{
3586
+ id: z.ZodString;
3587
+ tenantId: z.ZodString;
3588
+ state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
3589
+ baseSha: z.ZodNullable<z.ZodString>;
3590
+ storageSizeBytes: z.ZodNullable<z.ZodNumber>;
3591
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3592
+ idempotencyKey: z.ZodNullable<z.ZodString>;
3593
+ failureReason: z.ZodNullable<z.ZodString>;
3594
+ /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
3595
+ thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
3596
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3597
+ createdAt: z.ZodNumber;
3598
+ updatedAt: z.ZodNumber;
3599
+ createdBy: z.ZodNullable<z.ZodString>;
3335
3600
  }, "strip", z.ZodTypeAny, {
3336
- code: string;
3337
- message: string;
3601
+ id: string;
3602
+ tenantId: string;
3603
+ state: "pending" | "ready" | "failed" | "deleting";
3604
+ baseSha: string | null;
3605
+ storageSizeBytes: number | null;
3606
+ metadata: Record<string, unknown> | null;
3607
+ idempotencyKey: string | null;
3608
+ failureReason: string | null;
3609
+ createdAt: number;
3610
+ updatedAt: number;
3611
+ createdBy: string | null;
3612
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3613
+ thumbnailUrl?: string | null | undefined;
3338
3614
  }, {
3339
- code: string;
3340
- message: string;
3341
- }>;
3615
+ id: string;
3616
+ tenantId: string;
3617
+ state: "pending" | "ready" | "failed" | "deleting";
3618
+ baseSha: string | null;
3619
+ storageSizeBytes: number | null;
3620
+ metadata: Record<string, unknown> | null;
3621
+ idempotencyKey: string | null;
3622
+ failureReason: string | null;
3623
+ createdAt: number;
3624
+ updatedAt: number;
3625
+ createdBy: string | null;
3626
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3627
+ thumbnailUrl?: string | null | undefined;
3628
+ }>, "many">;
3629
+ /**
3630
+ * Opaque cursor for the next page; `null` on the last page. Optional
3631
+ * because pre-pagination servers omit it — clients treat absence as
3632
+ * "no continuation available", same convention as the thumbnail fields.
3633
+ */
3634
+ nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3342
3635
  }, "strip", z.ZodTypeAny, {
3343
- error: {
3344
- code: string;
3345
- message: string;
3346
- };
3636
+ documents: {
3637
+ id: string;
3638
+ tenantId: string;
3639
+ state: "pending" | "ready" | "failed" | "deleting";
3640
+ baseSha: string | null;
3641
+ storageSizeBytes: number | null;
3642
+ metadata: Record<string, unknown> | null;
3643
+ idempotencyKey: string | null;
3644
+ failureReason: string | null;
3645
+ createdAt: number;
3646
+ updatedAt: number;
3647
+ createdBy: string | null;
3648
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3649
+ thumbnailUrl?: string | null | undefined;
3650
+ }[];
3651
+ nextCursor?: string | null | undefined;
3347
3652
  }, {
3348
- error: {
3349
- code: string;
3350
- message: string;
3351
- };
3653
+ documents: {
3654
+ id: string;
3655
+ tenantId: string;
3656
+ state: "pending" | "ready" | "failed" | "deleting";
3657
+ baseSha: string | null;
3658
+ storageSizeBytes: number | null;
3659
+ metadata: Record<string, unknown> | null;
3660
+ idempotencyKey: string | null;
3661
+ failureReason: string | null;
3662
+ createdAt: number;
3663
+ updatedAt: number;
3664
+ createdBy: string | null;
3665
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3666
+ thumbnailUrl?: string | null | undefined;
3667
+ }[];
3668
+ nextCursor?: string | null | undefined;
3352
3669
  }>;
3353
3670
  };
3354
- readonly 404: {
3671
+ readonly 400: {
3355
3672
  readonly contentType: "application/json";
3356
3673
  readonly schema: z.ZodObject<{
3357
3674
  error: z.ZodObject<{
@@ -3378,12 +3695,12 @@ declare const adminOperations: {
3378
3695
  };
3379
3696
  };
3380
3697
  };
3381
- readonly 'documents.thumbnail': {
3382
- readonly operationId: "documents.thumbnail";
3383
- readonly title: "Get thumbnail";
3384
- readonly summary: "Fetch the warmed dashboard-tile render for a document.";
3698
+ readonly 'documents.get': {
3699
+ readonly operationId: "documents.get";
3700
+ readonly title: "Get document";
3701
+ readonly summary: "Fetch one document record.";
3385
3702
  readonly method: "GET";
3386
- readonly path: "/v1/tenants/:tenantId/documents/:id/thumbnail";
3703
+ readonly path: "/v1/tenants/:tenantId/documents/:id";
3387
3704
  readonly credentials: readonly ["api-token", "tenant-jwt"];
3388
3705
  readonly scope: readonly ["docs.read"];
3389
3706
  readonly params: z.ZodObject<{
@@ -3398,171 +3715,112 @@ declare const adminOperations: {
3398
3715
  }>;
3399
3716
  readonly responses: {
3400
3717
  readonly 200: {
3401
- readonly contentType: readonly ["image/webp", "image/png"];
3402
- };
3403
- readonly 404: {
3718
+ readonly contentType: "application/json";
3719
+ readonly schema: z.ZodObject<{
3720
+ document: z.ZodObject<{
3721
+ id: z.ZodString;
3722
+ tenantId: z.ZodString;
3723
+ state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
3724
+ baseSha: z.ZodNullable<z.ZodString>;
3725
+ storageSizeBytes: z.ZodNullable<z.ZodNumber>;
3726
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3727
+ idempotencyKey: z.ZodNullable<z.ZodString>;
3728
+ failureReason: z.ZodNullable<z.ZodString>;
3729
+ /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
3730
+ thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
3731
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3732
+ createdAt: z.ZodNumber;
3733
+ updatedAt: z.ZodNumber;
3734
+ createdBy: z.ZodNullable<z.ZodString>;
3735
+ }, "strip", z.ZodTypeAny, {
3736
+ id: string;
3737
+ tenantId: string;
3738
+ state: "pending" | "ready" | "failed" | "deleting";
3739
+ baseSha: string | null;
3740
+ storageSizeBytes: number | null;
3741
+ metadata: Record<string, unknown> | null;
3742
+ idempotencyKey: string | null;
3743
+ failureReason: string | null;
3744
+ createdAt: number;
3745
+ updatedAt: number;
3746
+ createdBy: string | null;
3747
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3748
+ thumbnailUrl?: string | null | undefined;
3749
+ }, {
3750
+ id: string;
3751
+ tenantId: string;
3752
+ state: "pending" | "ready" | "failed" | "deleting";
3753
+ baseSha: string | null;
3754
+ storageSizeBytes: number | null;
3755
+ metadata: Record<string, unknown> | null;
3756
+ idempotencyKey: string | null;
3757
+ failureReason: string | null;
3758
+ createdAt: number;
3759
+ updatedAt: number;
3760
+ createdBy: string | null;
3761
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3762
+ thumbnailUrl?: string | null | undefined;
3763
+ }>;
3764
+ }, "strip", z.ZodTypeAny, {
3765
+ document: {
3766
+ id: string;
3767
+ tenantId: string;
3768
+ state: "pending" | "ready" | "failed" | "deleting";
3769
+ baseSha: string | null;
3770
+ storageSizeBytes: number | null;
3771
+ metadata: Record<string, unknown> | null;
3772
+ idempotencyKey: string | null;
3773
+ failureReason: string | null;
3774
+ createdAt: number;
3775
+ updatedAt: number;
3776
+ createdBy: string | null;
3777
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3778
+ thumbnailUrl?: string | null | undefined;
3779
+ };
3780
+ }, {
3781
+ document: {
3782
+ id: string;
3783
+ tenantId: string;
3784
+ state: "pending" | "ready" | "failed" | "deleting";
3785
+ baseSha: string | null;
3786
+ storageSizeBytes: number | null;
3787
+ metadata: Record<string, unknown> | null;
3788
+ idempotencyKey: string | null;
3789
+ failureReason: string | null;
3790
+ createdAt: number;
3791
+ updatedAt: number;
3792
+ createdBy: string | null;
3793
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
3794
+ thumbnailUrl?: string | null | undefined;
3795
+ };
3796
+ }>;
3797
+ };
3798
+ readonly 403: {
3404
3799
  readonly contentType: "application/json";
3405
3800
  readonly schema: z.ZodObject<{
3406
3801
  error: z.ZodObject<{
3407
3802
  code: z.ZodString;
3408
3803
  message: z.ZodString;
3409
- state: z.ZodString;
3410
3804
  }, "strip", z.ZodTypeAny, {
3411
3805
  code: string;
3412
3806
  message: string;
3413
- state: string;
3414
3807
  }, {
3415
3808
  code: string;
3416
3809
  message: string;
3417
- state: string;
3418
3810
  }>;
3419
3811
  }, "strip", z.ZodTypeAny, {
3420
3812
  error: {
3421
3813
  code: string;
3422
3814
  message: string;
3423
- state: string;
3424
3815
  };
3425
3816
  }, {
3426
3817
  error: {
3427
3818
  code: string;
3428
3819
  message: string;
3429
- state: string;
3430
3820
  };
3431
3821
  }>;
3432
3822
  };
3433
- };
3434
- };
3435
- readonly 'deployment.licenseStatus': {
3436
- readonly operationId: "deployment.licenseStatus";
3437
- readonly title: "License status";
3438
- readonly summary: "License decision plus usage-reporting and meter snapshots for this deployment.";
3439
- readonly method: "GET";
3440
- readonly path: "/v1/deployment/license/status";
3441
- readonly credentials: readonly ["api-token"];
3442
- readonly scope: readonly [];
3443
- readonly responses: {
3444
- readonly 200: {
3445
- readonly contentType: "application/json";
3446
- readonly schema: z.ZodObject<{
3447
- license: z.ZodUnknown;
3448
- reporting: z.ZodNullable<z.ZodUnknown>;
3449
- usage: z.ZodNullable<z.ZodUnknown>;
3450
- }, "strip", z.ZodTypeAny, {
3451
- license?: unknown;
3452
- reporting?: unknown;
3453
- usage?: unknown;
3454
- }, {
3455
- license?: unknown;
3456
- reporting?: unknown;
3457
- usage?: unknown;
3458
- }>;
3459
- };
3460
- };
3461
- };
3462
- readonly 'tokens.issue': {
3463
- readonly operationId: "tokens.issue";
3464
- readonly title: "Issue token";
3465
- readonly summary: "Mint a delegated JWT: a doc token, or (API token only) a tenant token.";
3466
- readonly method: "POST";
3467
- readonly path: "/v1/tenants/:tenantId/tokens";
3468
- readonly credentials: readonly ["api-token", "tenant-jwt"];
3469
- readonly scope: readonly ["tokens.issue-doc"];
3470
- readonly params: z.ZodObject<{
3471
- tenantId: z.ZodString;
3472
- }, "strip", z.ZodTypeAny, {
3473
- tenantId: string;
3474
- }, {
3475
- tenantId: string;
3476
- }>;
3477
- readonly body: {
3478
- readonly contentType: "application/json";
3479
- readonly schema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
3480
- kind: z.ZodLiteral<"doc">;
3481
- /** Subject of the minted token — the end user's id in your system. */
3482
- sub: z.ZodString;
3483
- docId: z.ZodString;
3484
- layerName: z.ZodOptional<z.ZodString>;
3485
- /**
3486
- * Doc capability scopes (`doc.open`, `doc.render`, …, plus the
3487
- * collab grammar). Validated server-side against the engine's scope
3488
- * vocabulary — an unknown string rejects the whole request.
3489
- */
3490
- scope: z.ZodArray<z.ZodString, "many">;
3491
- userId: z.ZodOptional<z.ZodString>;
3492
- displayName: z.ZodOptional<z.ZodString>;
3493
- groupId: z.ZodOptional<z.ZodString>;
3494
- groups: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3495
- /**
3496
- * Origin lock: web origins (scheme + host, optional port; one leading
3497
- * `*.` wildcard label allowed) the minted token may be presented
3498
- * from. Enforced on every engine request that carries a browser
3499
- * `Origin` header — hotlink prevention, not DRM: non-browser callers
3500
- * are governed by the token itself.
3501
- */
3502
- origins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3503
- /** Token lifetime in seconds. */
3504
- expiresIn: z.ZodNumber;
3505
- }, "strip", z.ZodTypeAny, {
3506
- docId: string;
3507
- kind: "doc";
3508
- sub: string;
3509
- scope: string[];
3510
- expiresIn: number;
3511
- layerName?: string | undefined;
3512
- userId?: string | undefined;
3513
- displayName?: string | undefined;
3514
- groupId?: string | undefined;
3515
- groups?: string[] | undefined;
3516
- origins?: string[] | undefined;
3517
- }, {
3518
- docId: string;
3519
- kind: "doc";
3520
- sub: string;
3521
- scope: string[];
3522
- expiresIn: number;
3523
- layerName?: string | undefined;
3524
- userId?: string | undefined;
3525
- displayName?: string | undefined;
3526
- groupId?: string | undefined;
3527
- groups?: string[] | undefined;
3528
- origins?: string[] | undefined;
3529
- }>, z.ZodObject<{
3530
- kind: z.ZodLiteral<"tenant">;
3531
- sub: z.ZodString;
3532
- scope: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"*">, z.ZodEnum<["docs.create", "docs.read", "docs.delete", "tokens.issue-doc", "tokens.revoke", "shares.manage"]>]>, "many">;
3533
- /** Token lifetime in seconds. */
3534
- expiresIn: z.ZodNumber;
3535
- }, "strip", z.ZodTypeAny, {
3536
- kind: "tenant";
3537
- sub: string;
3538
- scope: ("docs.create" | "docs.read" | "docs.delete" | "tokens.issue-doc" | "tokens.revoke" | "shares.manage" | "*")[];
3539
- expiresIn: number;
3540
- }, {
3541
- kind: "tenant";
3542
- sub: string;
3543
- scope: ("docs.create" | "docs.read" | "docs.delete" | "tokens.issue-doc" | "tokens.revoke" | "shares.manage" | "*")[];
3544
- expiresIn: number;
3545
- }>]>;
3546
- };
3547
- readonly responses: {
3548
- readonly 200: {
3549
- readonly contentType: "application/json";
3550
- readonly schema: z.ZodObject<{
3551
- token: z.ZodString;
3552
- jti: z.ZodString;
3553
- /** Unix seconds. */
3554
- expiresAt: z.ZodNumber;
3555
- }, "strip", z.ZodTypeAny, {
3556
- expiresAt: number;
3557
- jti: string;
3558
- token: string;
3559
- }, {
3560
- expiresAt: number;
3561
- jti: string;
3562
- token: string;
3563
- }>;
3564
- };
3565
- readonly 400: {
3823
+ readonly 404: {
3566
3824
  readonly contentType: "application/json";
3567
3825
  readonly schema: z.ZodObject<{
3568
3826
  error: z.ZodObject<{
@@ -3587,6 +3845,30 @@ declare const adminOperations: {
3587
3845
  };
3588
3846
  }>;
3589
3847
  };
3848
+ };
3849
+ };
3850
+ readonly 'documents.download': {
3851
+ readonly operationId: "documents.download";
3852
+ readonly title: "Download document";
3853
+ readonly summary: "Download the stored base PDF bytes.";
3854
+ readonly method: "GET";
3855
+ readonly path: "/v1/tenants/:tenantId/documents/:id/download";
3856
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
3857
+ readonly scope: readonly ["docs.read"];
3858
+ readonly params: z.ZodObject<{
3859
+ tenantId: z.ZodString;
3860
+ id: z.ZodString;
3861
+ }, "strip", z.ZodTypeAny, {
3862
+ id: string;
3863
+ tenantId: string;
3864
+ }, {
3865
+ id: string;
3866
+ tenantId: string;
3867
+ }>;
3868
+ readonly responses: {
3869
+ readonly 200: {
3870
+ readonly contentType: "application/pdf";
3871
+ };
3590
3872
  readonly 403: {
3591
3873
  readonly contentType: "application/json";
3592
3874
  readonly schema: z.ZodObject<{
@@ -3638,140 +3920,28 @@ declare const adminOperations: {
3638
3920
  }>;
3639
3921
  };
3640
3922
  };
3641
- readonly notes: "kind \"tenant\" requires the API token — authority mints only downward. Mounted only when the deployment can sign (HS256 mode); asymmetric deployments mint with their own private key.";
3642
3923
  };
3643
- readonly 'tokens.revoke': {
3644
- readonly operationId: "tokens.revoke";
3645
- readonly title: "Revoke token";
3646
- readonly summary: "Revoke a token by jti; live sessions drop on their next heartbeat.";
3647
- readonly method: "POST";
3648
- readonly path: "/v1/tenants/:tenantId/tokens/:jti/revoke";
3649
- readonly credentials: readonly ["api-token", "tenant-jwt"];
3650
- readonly scope: readonly ["tokens.revoke"];
3651
- readonly params: z.ZodObject<{
3652
- tenantId: z.ZodString;
3653
- jti: z.ZodString;
3654
- }, "strip", z.ZodTypeAny, {
3655
- tenantId: string;
3656
- jti: string;
3657
- }, {
3658
- tenantId: string;
3659
- jti: string;
3660
- }>;
3661
- readonly body: {
3662
- readonly contentType: "application/json";
3663
- readonly schema: z.ZodObject<{
3664
- /** Optional human reason, written to the audit row. */
3665
- reason: z.ZodOptional<z.ZodString>;
3666
- /**
3667
- * The token's `exp` (unix seconds), used to GC the revocation row
3668
- * once the token would have expired anyway. Defaults server-side to
3669
- * now + 30 days.
3670
- */
3671
- expiresAtSeconds: z.ZodOptional<z.ZodNumber>;
3672
- }, "strip", z.ZodTypeAny, {
3673
- reason?: string | undefined;
3674
- expiresAtSeconds?: number | undefined;
3675
- }, {
3676
- reason?: string | undefined;
3677
- expiresAtSeconds?: number | undefined;
3678
- }>;
3679
- readonly required: false;
3680
- };
3681
- readonly responses: {
3682
- readonly 204: {};
3683
- readonly 400: {
3684
- readonly contentType: "application/json";
3685
- readonly schema: z.ZodObject<{
3686
- error: z.ZodObject<{
3687
- code: z.ZodString;
3688
- message: z.ZodString;
3689
- }, "strip", z.ZodTypeAny, {
3690
- code: string;
3691
- message: string;
3692
- }, {
3693
- code: string;
3694
- message: string;
3695
- }>;
3696
- }, "strip", z.ZodTypeAny, {
3697
- error: {
3698
- code: string;
3699
- message: string;
3700
- };
3701
- }, {
3702
- error: {
3703
- code: string;
3704
- message: string;
3705
- };
3706
- }>;
3707
- };
3708
- };
3709
- readonly notes: "Mounted only when the deployment enables token revocation.";
3710
- };
3711
- readonly 'tenants.usage': {
3712
- readonly operationId: "tenants.usage";
3713
- readonly title: "Tenant usage";
3714
- readonly summary: "Per-tenant usage facts (views, uploads, stored bytes) for one UTC month.";
3715
- readonly method: "GET";
3716
- readonly path: "/v1/tenants/:tenantId/usage";
3924
+ readonly 'documents.delete': {
3925
+ readonly operationId: "documents.delete";
3926
+ readonly title: "Delete document";
3927
+ readonly summary: "Delete a document and its stored artifacts.";
3928
+ readonly method: "DELETE";
3929
+ readonly path: "/v1/tenants/:tenantId/documents/:id";
3717
3930
  readonly credentials: readonly ["api-token", "tenant-jwt"];
3718
- readonly scope: readonly ["docs.read"];
3931
+ readonly scope: readonly ["docs.delete"];
3719
3932
  readonly params: z.ZodObject<{
3720
3933
  tenantId: z.ZodString;
3934
+ id: z.ZodString;
3721
3935
  }, "strip", z.ZodTypeAny, {
3936
+ id: string;
3722
3937
  tenantId: string;
3723
3938
  }, {
3939
+ id: string;
3724
3940
  tenantId: string;
3725
3941
  }>;
3726
- readonly query: z.ZodObject<{
3727
- /** UTC month to report, `YYYY-MM`. Defaults to the current month. */
3728
- period: z.ZodOptional<z.ZodString>;
3729
- }, "strip", z.ZodTypeAny, {
3730
- period?: string | undefined;
3731
- }, {
3732
- period?: string | undefined;
3733
- }>;
3734
3942
  readonly responses: {
3735
- readonly 200: {
3736
- readonly contentType: "application/json";
3737
- readonly schema: z.ZodObject<{
3738
- tenantId: z.ZodString;
3739
- periodStart: z.ZodString;
3740
- periodEnd: z.ZodString;
3741
- metrics: z.ZodObject<{
3742
- 'pdf.views': z.ZodNumber;
3743
- 'pdf.uploads': z.ZodNumber;
3744
- 'storage.bytes': z.ZodNumber;
3745
- }, "strip", z.ZodTypeAny, {
3746
- 'pdf.views': number;
3747
- 'pdf.uploads': number;
3748
- 'storage.bytes': number;
3749
- }, {
3750
- 'pdf.views': number;
3751
- 'pdf.uploads': number;
3752
- 'storage.bytes': number;
3753
- }>;
3754
- }, "strip", z.ZodTypeAny, {
3755
- tenantId: string;
3756
- periodStart: string;
3757
- periodEnd: string;
3758
- metrics: {
3759
- 'pdf.views': number;
3760
- 'pdf.uploads': number;
3761
- 'storage.bytes': number;
3762
- };
3763
- }, {
3764
- tenantId: string;
3765
- periodStart: string;
3766
- periodEnd: string;
3767
- metrics: {
3768
- 'pdf.views': number;
3769
- 'pdf.uploads': number;
3770
- 'storage.bytes': number;
3771
- };
3772
- }>;
3773
- };
3774
- readonly 400: {
3943
+ readonly 204: {};
3944
+ readonly 403: {
3775
3945
  readonly contentType: "application/json";
3776
3946
  readonly schema: z.ZodObject<{
3777
3947
  error: z.ZodObject<{
@@ -3822,117 +3992,96 @@ declare const adminOperations: {
3822
3992
  }>;
3823
3993
  };
3824
3994
  };
3825
- readonly notes: string;
3826
3995
  };
3827
- readonly 'tenants.suspend': {
3828
- readonly operationId: "tenants.suspend";
3829
- readonly title: "Suspend tenant";
3830
- readonly summary: "Fail the tenant closed: refuse every tenant JWT, doc JWT, and share exchange.";
3831
- readonly method: "POST";
3832
- readonly path: "/v1/tenants/:tenantId/suspend";
3833
- readonly credentials: readonly ["api-token"];
3834
- readonly scope: readonly [];
3996
+ readonly 'documents.thumbnail': {
3997
+ readonly operationId: "documents.thumbnail";
3998
+ readonly title: "Get thumbnail";
3999
+ readonly summary: "Fetch the warmed dashboard-tile render for a document.";
4000
+ readonly method: "GET";
4001
+ readonly path: "/v1/tenants/:tenantId/documents/:id/thumbnail";
4002
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
4003
+ readonly scope: readonly ["docs.read"];
3835
4004
  readonly params: z.ZodObject<{
3836
4005
  tenantId: z.ZodString;
4006
+ id: z.ZodString;
3837
4007
  }, "strip", z.ZodTypeAny, {
4008
+ id: string;
3838
4009
  tenantId: string;
3839
4010
  }, {
4011
+ id: string;
3840
4012
  tenantId: string;
3841
4013
  }>;
3842
- readonly body: {
3843
- readonly contentType: "application/json";
3844
- readonly schema: z.ZodObject<{
3845
- /** Optional operator reason, written to the security-events trail. */
3846
- reason: z.ZodOptional<z.ZodString>;
3847
- }, "strip", z.ZodTypeAny, {
3848
- reason?: string | undefined;
3849
- }, {
3850
- reason?: string | undefined;
3851
- }>;
3852
- readonly required: false;
3853
- };
3854
4014
  readonly responses: {
3855
- readonly 204: {};
4015
+ readonly 200: {
4016
+ readonly contentType: readonly ["image/webp", "image/png"];
4017
+ };
3856
4018
  readonly 404: {
3857
4019
  readonly contentType: "application/json";
3858
4020
  readonly schema: z.ZodObject<{
3859
4021
  error: z.ZodObject<{
3860
4022
  code: z.ZodString;
3861
4023
  message: z.ZodString;
4024
+ state: z.ZodString;
3862
4025
  }, "strip", z.ZodTypeAny, {
3863
4026
  code: string;
3864
4027
  message: string;
4028
+ state: string;
3865
4029
  }, {
3866
4030
  code: string;
3867
4031
  message: string;
4032
+ state: string;
3868
4033
  }>;
3869
4034
  }, "strip", z.ZodTypeAny, {
3870
4035
  error: {
3871
4036
  code: string;
3872
4037
  message: string;
4038
+ state: string;
3873
4039
  };
3874
4040
  }, {
3875
4041
  error: {
3876
4042
  code: string;
3877
4043
  message: string;
4044
+ state: string;
3878
4045
  };
3879
4046
  }>;
3880
4047
  };
3881
4048
  };
3882
- readonly notes: string;
3883
4049
  };
3884
- readonly 'tenants.resume': {
3885
- readonly operationId: "tenants.resume";
3886
- readonly title: "Resume tenant";
3887
- readonly summary: "Lift a suspension; credentials for the tenant verify again.";
3888
- readonly method: "POST";
3889
- readonly path: "/v1/tenants/:tenantId/resume";
4050
+ readonly 'deployment.licenseStatus': {
4051
+ readonly operationId: "deployment.licenseStatus";
4052
+ readonly title: "License status";
4053
+ readonly summary: "License decision plus usage-reporting and meter snapshots for this deployment.";
4054
+ readonly method: "GET";
4055
+ readonly path: "/v1/deployment/license/status";
3890
4056
  readonly credentials: readonly ["api-token"];
3891
4057
  readonly scope: readonly [];
3892
- readonly params: z.ZodObject<{
3893
- tenantId: z.ZodString;
3894
- }, "strip", z.ZodTypeAny, {
3895
- tenantId: string;
3896
- }, {
3897
- tenantId: string;
3898
- }>;
3899
4058
  readonly responses: {
3900
- readonly 204: {};
3901
- readonly 404: {
4059
+ readonly 200: {
3902
4060
  readonly contentType: "application/json";
3903
4061
  readonly schema: z.ZodObject<{
3904
- error: z.ZodObject<{
3905
- code: z.ZodString;
3906
- message: z.ZodString;
3907
- }, "strip", z.ZodTypeAny, {
3908
- code: string;
3909
- message: string;
3910
- }, {
3911
- code: string;
3912
- message: string;
3913
- }>;
4062
+ license: z.ZodUnknown;
4063
+ reporting: z.ZodNullable<z.ZodUnknown>;
4064
+ usage: z.ZodNullable<z.ZodUnknown>;
3914
4065
  }, "strip", z.ZodTypeAny, {
3915
- error: {
3916
- code: string;
3917
- message: string;
3918
- };
4066
+ license?: unknown;
4067
+ reporting?: unknown;
4068
+ usage?: unknown;
3919
4069
  }, {
3920
- error: {
3921
- code: string;
3922
- message: string;
3923
- };
4070
+ license?: unknown;
4071
+ reporting?: unknown;
4072
+ usage?: unknown;
3924
4073
  }>;
3925
4074
  };
3926
4075
  };
3927
4076
  };
3928
- readonly 'shares.create': {
3929
- readonly operationId: "shares.create";
3930
- readonly title: "Create share";
3931
- readonly summary: "Create a standing share grant for one document — the no-backend embed credential.";
4077
+ readonly 'tokens.issue': {
4078
+ readonly operationId: "tokens.issue";
4079
+ readonly title: "Issue token";
4080
+ readonly summary: "Mint a delegated JWT: a doc token, or (API token only) a tenant token.";
3932
4081
  readonly method: "POST";
3933
- readonly path: "/v1/tenants/:tenantId/shares";
4082
+ readonly path: "/v1/tenants/:tenantId/tokens";
3934
4083
  readonly credentials: readonly ["api-token", "tenant-jwt"];
3935
- readonly scope: readonly ["shares.manage"];
4084
+ readonly scope: readonly ["tokens.issue-doc"];
3936
4085
  readonly params: z.ZodObject<{
3937
4086
  tenantId: z.ZodString;
3938
4087
  }, "strip", z.ZodTypeAny, {
@@ -3942,141 +4091,118 @@ declare const adminOperations: {
3942
4091
  }>;
3943
4092
  readonly body: {
3944
4093
  readonly contentType: "application/json";
3945
- readonly schema: z.ZodObject<{
4094
+ readonly schema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
4095
+ kind: z.ZodLiteral<"doc">;
4096
+ /** Subject of the minted token — the end user's id in your system. */
4097
+ sub: z.ZodString;
3946
4098
  docId: z.ZodString;
3947
4099
  layerName: z.ZodOptional<z.ZodString>;
3948
4100
  /**
3949
- * Doc capability scopes the exchanged session will carry. Validated
3950
- * server-side against the engine's scope vocabulary, same as
3951
- * `tokens.issue`.
4101
+ * Doc capability scopes (`doc.open`, `doc.render`, …, plus the
4102
+ * collab grammar). Validated server-side against the engine's scope
4103
+ * vocabulary — an unknown string rejects the whole request.
3952
4104
  */
3953
4105
  scope: z.ZodArray<z.ZodString, "many">;
3954
- /** Origin allowlist; omit to allow any origin. */
4106
+ userId: z.ZodOptional<z.ZodString>;
4107
+ displayName: z.ZodOptional<z.ZodString>;
4108
+ groupId: z.ZodOptional<z.ZodString>;
4109
+ groups: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4110
+ /**
4111
+ * Origin lock: web origins (scheme + host, optional port; one leading
4112
+ * `*.` wildcard label allowed) the minted token may be presented
4113
+ * from. Enforced on every engine request that carries a browser
4114
+ * `Origin` header — hotlink prevention, not DRM: non-browser callers
4115
+ * are governed by the token itself.
4116
+ */
3955
4117
  origins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3956
- /** Optional passphrase gate, checked at exchange. Stored as a hash; never returned. */
3957
- password: z.ZodOptional<z.ZodString>;
3958
- /** Lifetime of exchanged session tokens. Default 600. */
3959
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
3960
- /** Unix epoch ms after which the grant stops exchanging; omit for no expiry. */
3961
- expiresAt: z.ZodOptional<z.ZodNumber>;
4118
+ /** Token lifetime in seconds. */
4119
+ expiresIn: z.ZodNumber;
3962
4120
  }, "strip", z.ZodTypeAny, {
3963
4121
  docId: string;
4122
+ kind: "doc";
4123
+ sub: string;
3964
4124
  scope: string[];
3965
- expiresAt?: number | undefined;
4125
+ expiresIn: number;
3966
4126
  layerName?: string | undefined;
4127
+ userId?: string | undefined;
4128
+ displayName?: string | undefined;
4129
+ groupId?: string | undefined;
4130
+ groups?: string[] | undefined;
3967
4131
  origins?: string[] | undefined;
3968
- sessionTtlSeconds?: number | undefined;
3969
- password?: string | undefined;
3970
4132
  }, {
3971
4133
  docId: string;
4134
+ kind: "doc";
4135
+ sub: string;
3972
4136
  scope: string[];
3973
- expiresAt?: number | undefined;
4137
+ expiresIn: number;
3974
4138
  layerName?: string | undefined;
4139
+ userId?: string | undefined;
4140
+ displayName?: string | undefined;
4141
+ groupId?: string | undefined;
4142
+ groups?: string[] | undefined;
3975
4143
  origins?: string[] | undefined;
3976
- sessionTtlSeconds?: number | undefined;
3977
- password?: string | undefined;
3978
- }>;
4144
+ }>, z.ZodObject<{
4145
+ kind: z.ZodLiteral<"tenant">;
4146
+ sub: z.ZodString;
4147
+ scope: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"*">, z.ZodEnum<["docs.create", "docs.read", "docs.delete", "tokens.issue-doc", "tokens.revoke", "shares.manage"]>]>, "many">;
4148
+ /** Token lifetime in seconds. */
4149
+ expiresIn: z.ZodNumber;
4150
+ }, "strip", z.ZodTypeAny, {
4151
+ kind: "tenant";
4152
+ sub: string;
4153
+ scope: ("docs.create" | "docs.read" | "docs.delete" | "tokens.issue-doc" | "tokens.revoke" | "shares.manage" | "*")[];
4154
+ expiresIn: number;
4155
+ }, {
4156
+ kind: "tenant";
4157
+ sub: string;
4158
+ scope: ("docs.create" | "docs.read" | "docs.delete" | "tokens.issue-doc" | "tokens.revoke" | "shares.manage" | "*")[];
4159
+ expiresIn: number;
4160
+ }>]>;
3979
4161
  };
3980
4162
  readonly responses: {
3981
4163
  readonly 200: {
3982
4164
  readonly contentType: "application/json";
3983
4165
  readonly schema: z.ZodObject<{
3984
- share: z.ZodObject<{
3985
- /** Grant id; doubles as the public share token (`shr_…`). */
3986
- id: z.ZodString;
3987
- tenantId: z.ZodString;
3988
- docId: z.ZodString;
3989
- layerName: z.ZodString;
3990
- /** Doc capabilities the exchanged session carries. */
3991
- scope: z.ZodArray<z.ZodString, "many">;
3992
- /** Origin allowlist; null means any origin. */
3993
- origins: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
3994
- /** True when a passphrase is required at exchange. The passphrase itself is never returned. */
3995
- passwordProtected: z.ZodBoolean;
3996
- /** Lifetime of each exchanged session token, in seconds. */
3997
- sessionTtlSeconds: z.ZodNumber;
3998
- /** Paused grants refuse exchange (404) but keep their configuration. */
3999
- disabled: z.ZodBoolean;
4000
- /** Unix epoch ms after which exchange returns 410; null = no expiry. */
4001
- expiresAt: z.ZodNullable<z.ZodNumber>;
4002
- /** Total successful exchanges — a dashboard convenience, not the usage meter. */
4003
- exchangeCount: z.ZodNumber;
4004
- lastExchangedAt: z.ZodNullable<z.ZodNumber>;
4005
- createdBy: z.ZodString;
4006
- createdAt: z.ZodNumber;
4007
- updatedAt: z.ZodNumber;
4166
+ token: z.ZodString;
4167
+ jti: z.ZodString;
4168
+ /** Unix seconds. */
4169
+ expiresAt: z.ZodNumber;
4170
+ }, "strip", z.ZodTypeAny, {
4171
+ expiresAt: number;
4172
+ jti: string;
4173
+ token: string;
4174
+ }, {
4175
+ expiresAt: number;
4176
+ jti: string;
4177
+ token: string;
4178
+ }>;
4179
+ };
4180
+ readonly 400: {
4181
+ readonly contentType: "application/json";
4182
+ readonly schema: z.ZodObject<{
4183
+ error: z.ZodObject<{
4184
+ code: z.ZodString;
4185
+ message: z.ZodString;
4008
4186
  }, "strip", z.ZodTypeAny, {
4009
- id: string;
4010
- tenantId: string;
4011
- createdAt: number;
4012
- updatedAt: number;
4013
- createdBy: string;
4014
- docId: string;
4015
- expiresAt: number | null;
4016
- layerName: string;
4017
- scope: string[];
4018
- origins: string[] | null;
4019
- passwordProtected: boolean;
4020
- sessionTtlSeconds: number;
4021
- disabled: boolean;
4022
- exchangeCount: number;
4023
- lastExchangedAt: number | null;
4187
+ code: string;
4188
+ message: string;
4024
4189
  }, {
4025
- id: string;
4026
- tenantId: string;
4027
- createdAt: number;
4028
- updatedAt: number;
4029
- createdBy: string;
4030
- docId: string;
4031
- expiresAt: number | null;
4032
- layerName: string;
4033
- scope: string[];
4034
- origins: string[] | null;
4035
- passwordProtected: boolean;
4036
- sessionTtlSeconds: number;
4037
- disabled: boolean;
4038
- exchangeCount: number;
4039
- lastExchangedAt: number | null;
4190
+ code: string;
4191
+ message: string;
4040
4192
  }>;
4041
4193
  }, "strip", z.ZodTypeAny, {
4042
- share: {
4043
- id: string;
4044
- tenantId: string;
4045
- createdAt: number;
4046
- updatedAt: number;
4047
- createdBy: string;
4048
- docId: string;
4049
- expiresAt: number | null;
4050
- layerName: string;
4051
- scope: string[];
4052
- origins: string[] | null;
4053
- passwordProtected: boolean;
4054
- sessionTtlSeconds: number;
4055
- disabled: boolean;
4056
- exchangeCount: number;
4057
- lastExchangedAt: number | null;
4194
+ error: {
4195
+ code: string;
4196
+ message: string;
4058
4197
  };
4059
4198
  }, {
4060
- share: {
4061
- id: string;
4062
- tenantId: string;
4063
- createdAt: number;
4064
- updatedAt: number;
4065
- createdBy: string;
4066
- docId: string;
4067
- expiresAt: number | null;
4068
- layerName: string;
4069
- scope: string[];
4070
- origins: string[] | null;
4071
- passwordProtected: boolean;
4072
- sessionTtlSeconds: number;
4073
- disabled: boolean;
4074
- exchangeCount: number;
4075
- lastExchangedAt: number | null;
4199
+ error: {
4200
+ code: string;
4201
+ message: string;
4076
4202
  };
4077
4203
  }>;
4078
4204
  };
4079
- readonly 400: {
4205
+ readonly 403: {
4080
4206
  readonly contentType: "application/json";
4081
4207
  readonly schema: z.ZodObject<{
4082
4208
  error: z.ZodObject<{
@@ -4101,7 +4227,7 @@ declare const adminOperations: {
4101
4227
  };
4102
4228
  }>;
4103
4229
  };
4104
- readonly 403: {
4230
+ readonly 404: {
4105
4231
  readonly contentType: "application/json";
4106
4232
  readonly schema: z.ZodObject<{
4107
4233
  error: z.ZodObject<{
@@ -4126,7 +4252,50 @@ declare const adminOperations: {
4126
4252
  };
4127
4253
  }>;
4128
4254
  };
4129
- readonly 404: {
4255
+ };
4256
+ readonly notes: "kind \"tenant\" requires the API token — authority mints only downward. Mounted only when the deployment can sign (HS256 mode); asymmetric deployments mint with their own private key.";
4257
+ };
4258
+ readonly 'tokens.revoke': {
4259
+ readonly operationId: "tokens.revoke";
4260
+ readonly title: "Revoke token";
4261
+ readonly summary: "Revoke a token by jti; live sessions drop on their next heartbeat.";
4262
+ readonly method: "POST";
4263
+ readonly path: "/v1/tenants/:tenantId/tokens/:jti/revoke";
4264
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
4265
+ readonly scope: readonly ["tokens.revoke"];
4266
+ readonly params: z.ZodObject<{
4267
+ tenantId: z.ZodString;
4268
+ jti: z.ZodString;
4269
+ }, "strip", z.ZodTypeAny, {
4270
+ tenantId: string;
4271
+ jti: string;
4272
+ }, {
4273
+ tenantId: string;
4274
+ jti: string;
4275
+ }>;
4276
+ readonly body: {
4277
+ readonly contentType: "application/json";
4278
+ readonly schema: z.ZodObject<{
4279
+ /** Optional human reason, written to the audit row. */
4280
+ reason: z.ZodOptional<z.ZodString>;
4281
+ /**
4282
+ * The token's `exp` (unix seconds), used to GC the revocation row
4283
+ * once the token would have expired anyway. Defaults server-side to
4284
+ * now + 30 days.
4285
+ */
4286
+ expiresAtSeconds: z.ZodOptional<z.ZodNumber>;
4287
+ }, "strip", z.ZodTypeAny, {
4288
+ reason?: string | undefined;
4289
+ expiresAtSeconds?: number | undefined;
4290
+ }, {
4291
+ reason?: string | undefined;
4292
+ expiresAtSeconds?: number | undefined;
4293
+ }>;
4294
+ readonly required: false;
4295
+ };
4296
+ readonly responses: {
4297
+ readonly 204: {};
4298
+ readonly 400: {
4130
4299
  readonly contentType: "application/json";
4131
4300
  readonly schema: z.ZodObject<{
4132
4301
  error: z.ZodObject<{
@@ -4152,16 +4321,16 @@ declare const adminOperations: {
4152
4321
  }>;
4153
4322
  };
4154
4323
  };
4155
- readonly notes: string;
4324
+ readonly notes: "Mounted only when the deployment enables token revocation.";
4156
4325
  };
4157
- readonly 'shares.list': {
4158
- readonly operationId: "shares.list";
4159
- readonly title: "List shares";
4160
- readonly summary: "List share grants in the tenant, newest first, cursor-paginated.";
4326
+ readonly 'tenants.usage': {
4327
+ readonly operationId: "tenants.usage";
4328
+ readonly title: "Tenant usage";
4329
+ readonly summary: "Per-tenant usage facts (views, uploads, stored bytes) for one UTC month.";
4161
4330
  readonly method: "GET";
4162
- readonly path: "/v1/tenants/:tenantId/shares";
4331
+ readonly path: "/v1/tenants/:tenantId/usage";
4163
4332
  readonly credentials: readonly ["api-token", "tenant-jwt"];
4164
- readonly scope: readonly ["shares.manage"];
4333
+ readonly scope: readonly ["docs.read"];
4165
4334
  readonly params: z.ZodObject<{
4166
4335
  tenantId: z.ZodString;
4167
4336
  }, "strip", z.ZodTypeAny, {
@@ -4170,120 +4339,51 @@ declare const adminOperations: {
4170
4339
  tenantId: string;
4171
4340
  }>;
4172
4341
  readonly query: z.ZodObject<{
4173
- limit: z.ZodDefault<z.ZodNumber>;
4174
- cursor: z.ZodOptional<z.ZodString>;
4175
- /** Filter to one document's grants. */
4176
- docId: z.ZodOptional<z.ZodString>;
4342
+ /** UTC month to report, `YYYY-MM`. Defaults to the current month. */
4343
+ period: z.ZodOptional<z.ZodString>;
4177
4344
  }, "strip", z.ZodTypeAny, {
4178
- limit: number;
4179
- docId?: string | undefined;
4180
- cursor?: string | undefined;
4345
+ period?: string | undefined;
4181
4346
  }, {
4182
- docId?: string | undefined;
4183
- limit?: number | undefined;
4184
- cursor?: string | undefined;
4347
+ period?: string | undefined;
4185
4348
  }>;
4186
4349
  readonly responses: {
4187
4350
  readonly 200: {
4188
4351
  readonly contentType: "application/json";
4189
4352
  readonly schema: z.ZodObject<{
4190
- shares: z.ZodArray<z.ZodObject<{
4191
- /** Grant id; doubles as the public share token (`shr_…`). */
4192
- id: z.ZodString;
4193
- tenantId: z.ZodString;
4194
- docId: z.ZodString;
4195
- layerName: z.ZodString;
4196
- /** Doc capabilities the exchanged session carries. */
4197
- scope: z.ZodArray<z.ZodString, "many">;
4198
- /** Origin allowlist; null means any origin. */
4199
- origins: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
4200
- /** True when a passphrase is required at exchange. The passphrase itself is never returned. */
4201
- passwordProtected: z.ZodBoolean;
4202
- /** Lifetime of each exchanged session token, in seconds. */
4203
- sessionTtlSeconds: z.ZodNumber;
4204
- /** Paused grants refuse exchange (404) but keep their configuration. */
4205
- disabled: z.ZodBoolean;
4206
- /** Unix epoch ms after which exchange returns 410; null = no expiry. */
4207
- expiresAt: z.ZodNullable<z.ZodNumber>;
4208
- /** Total successful exchanges — a dashboard convenience, not the usage meter. */
4209
- exchangeCount: z.ZodNumber;
4210
- lastExchangedAt: z.ZodNullable<z.ZodNumber>;
4211
- createdBy: z.ZodString;
4212
- createdAt: z.ZodNumber;
4213
- updatedAt: z.ZodNumber;
4353
+ tenantId: z.ZodString;
4354
+ periodStart: z.ZodString;
4355
+ periodEnd: z.ZodString;
4356
+ metrics: z.ZodObject<{
4357
+ 'pdf.views': z.ZodNumber;
4358
+ 'pdf.uploads': z.ZodNumber;
4359
+ 'storage.bytes': z.ZodNumber;
4214
4360
  }, "strip", z.ZodTypeAny, {
4215
- id: string;
4216
- tenantId: string;
4217
- createdAt: number;
4218
- updatedAt: number;
4219
- createdBy: string;
4220
- docId: string;
4221
- expiresAt: number | null;
4222
- layerName: string;
4223
- scope: string[];
4224
- origins: string[] | null;
4225
- passwordProtected: boolean;
4226
- sessionTtlSeconds: number;
4227
- disabled: boolean;
4228
- exchangeCount: number;
4229
- lastExchangedAt: number | null;
4361
+ 'pdf.views': number;
4362
+ 'pdf.uploads': number;
4363
+ 'storage.bytes': number;
4230
4364
  }, {
4231
- id: string;
4232
- tenantId: string;
4233
- createdAt: number;
4234
- updatedAt: number;
4235
- createdBy: string;
4236
- docId: string;
4237
- expiresAt: number | null;
4238
- layerName: string;
4239
- scope: string[];
4240
- origins: string[] | null;
4241
- passwordProtected: boolean;
4242
- sessionTtlSeconds: number;
4243
- disabled: boolean;
4244
- exchangeCount: number;
4245
- lastExchangedAt: number | null;
4246
- }>, "many">;
4247
- /** Opaque cursor for the next page; `null` on the last page. */
4248
- nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4365
+ 'pdf.views': number;
4366
+ 'pdf.uploads': number;
4367
+ 'storage.bytes': number;
4368
+ }>;
4249
4369
  }, "strip", z.ZodTypeAny, {
4250
- shares: {
4251
- id: string;
4252
- tenantId: string;
4253
- createdAt: number;
4254
- updatedAt: number;
4255
- createdBy: string;
4256
- docId: string;
4257
- expiresAt: number | null;
4258
- layerName: string;
4259
- scope: string[];
4260
- origins: string[] | null;
4261
- passwordProtected: boolean;
4262
- sessionTtlSeconds: number;
4263
- disabled: boolean;
4264
- exchangeCount: number;
4265
- lastExchangedAt: number | null;
4266
- }[];
4267
- nextCursor?: string | null | undefined;
4370
+ tenantId: string;
4371
+ periodStart: string;
4372
+ periodEnd: string;
4373
+ metrics: {
4374
+ 'pdf.views': number;
4375
+ 'pdf.uploads': number;
4376
+ 'storage.bytes': number;
4377
+ };
4268
4378
  }, {
4269
- shares: {
4270
- id: string;
4271
- tenantId: string;
4272
- createdAt: number;
4273
- updatedAt: number;
4274
- createdBy: string;
4275
- docId: string;
4276
- expiresAt: number | null;
4277
- layerName: string;
4278
- scope: string[];
4279
- origins: string[] | null;
4280
- passwordProtected: boolean;
4281
- sessionTtlSeconds: number;
4282
- disabled: boolean;
4283
- exchangeCount: number;
4284
- lastExchangedAt: number | null;
4285
- }[];
4286
- nextCursor?: string | null | undefined;
4379
+ tenantId: string;
4380
+ periodStart: string;
4381
+ periodEnd: string;
4382
+ metrics: {
4383
+ 'pdf.views': number;
4384
+ 'pdf.uploads': number;
4385
+ 'storage.bytes': number;
4386
+ };
4287
4387
  }>;
4288
4388
  };
4289
4389
  readonly 400: {
@@ -4311,125 +4411,6 @@ declare const adminOperations: {
4311
4411
  };
4312
4412
  }>;
4313
4413
  };
4314
- };
4315
- };
4316
- readonly 'shares.get': {
4317
- readonly operationId: "shares.get";
4318
- readonly title: "Get share";
4319
- readonly summary: "Fetch one share grant.";
4320
- readonly method: "GET";
4321
- readonly path: "/v1/tenants/:tenantId/shares/:shareId";
4322
- readonly credentials: readonly ["api-token", "tenant-jwt"];
4323
- readonly scope: readonly ["shares.manage"];
4324
- readonly params: z.ZodObject<{
4325
- tenantId: z.ZodString;
4326
- shareId: z.ZodString;
4327
- }, "strip", z.ZodTypeAny, {
4328
- tenantId: string;
4329
- shareId: string;
4330
- }, {
4331
- tenantId: string;
4332
- shareId: string;
4333
- }>;
4334
- readonly responses: {
4335
- readonly 200: {
4336
- readonly contentType: "application/json";
4337
- readonly schema: z.ZodObject<{
4338
- share: z.ZodObject<{
4339
- /** Grant id; doubles as the public share token (`shr_…`). */
4340
- id: z.ZodString;
4341
- tenantId: z.ZodString;
4342
- docId: z.ZodString;
4343
- layerName: z.ZodString;
4344
- /** Doc capabilities the exchanged session carries. */
4345
- scope: z.ZodArray<z.ZodString, "many">;
4346
- /** Origin allowlist; null means any origin. */
4347
- origins: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
4348
- /** True when a passphrase is required at exchange. The passphrase itself is never returned. */
4349
- passwordProtected: z.ZodBoolean;
4350
- /** Lifetime of each exchanged session token, in seconds. */
4351
- sessionTtlSeconds: z.ZodNumber;
4352
- /** Paused grants refuse exchange (404) but keep their configuration. */
4353
- disabled: z.ZodBoolean;
4354
- /** Unix epoch ms after which exchange returns 410; null = no expiry. */
4355
- expiresAt: z.ZodNullable<z.ZodNumber>;
4356
- /** Total successful exchanges — a dashboard convenience, not the usage meter. */
4357
- exchangeCount: z.ZodNumber;
4358
- lastExchangedAt: z.ZodNullable<z.ZodNumber>;
4359
- createdBy: z.ZodString;
4360
- createdAt: z.ZodNumber;
4361
- updatedAt: z.ZodNumber;
4362
- }, "strip", z.ZodTypeAny, {
4363
- id: string;
4364
- tenantId: string;
4365
- createdAt: number;
4366
- updatedAt: number;
4367
- createdBy: string;
4368
- docId: string;
4369
- expiresAt: number | null;
4370
- layerName: string;
4371
- scope: string[];
4372
- origins: string[] | null;
4373
- passwordProtected: boolean;
4374
- sessionTtlSeconds: number;
4375
- disabled: boolean;
4376
- exchangeCount: number;
4377
- lastExchangedAt: number | null;
4378
- }, {
4379
- id: string;
4380
- tenantId: string;
4381
- createdAt: number;
4382
- updatedAt: number;
4383
- createdBy: string;
4384
- docId: string;
4385
- expiresAt: number | null;
4386
- layerName: string;
4387
- scope: string[];
4388
- origins: string[] | null;
4389
- passwordProtected: boolean;
4390
- sessionTtlSeconds: number;
4391
- disabled: boolean;
4392
- exchangeCount: number;
4393
- lastExchangedAt: number | null;
4394
- }>;
4395
- }, "strip", z.ZodTypeAny, {
4396
- share: {
4397
- id: string;
4398
- tenantId: string;
4399
- createdAt: number;
4400
- updatedAt: number;
4401
- createdBy: string;
4402
- docId: string;
4403
- expiresAt: number | null;
4404
- layerName: string;
4405
- scope: string[];
4406
- origins: string[] | null;
4407
- passwordProtected: boolean;
4408
- sessionTtlSeconds: number;
4409
- disabled: boolean;
4410
- exchangeCount: number;
4411
- lastExchangedAt: number | null;
4412
- };
4413
- }, {
4414
- share: {
4415
- id: string;
4416
- tenantId: string;
4417
- createdAt: number;
4418
- updatedAt: number;
4419
- createdBy: string;
4420
- docId: string;
4421
- expiresAt: number | null;
4422
- layerName: string;
4423
- scope: string[];
4424
- origins: string[] | null;
4425
- passwordProtected: boolean;
4426
- sessionTtlSeconds: number;
4427
- disabled: boolean;
4428
- exchangeCount: number;
4429
- lastExchangedAt: number | null;
4430
- };
4431
- }>;
4432
- };
4433
4414
  readonly 404: {
4434
4415
  readonly contentType: "application/json";
4435
4416
  readonly schema: z.ZodObject<{
@@ -4456,48 +4437,159 @@ declare const adminOperations: {
4456
4437
  }>;
4457
4438
  };
4458
4439
  };
4440
+ readonly notes: string;
4459
4441
  };
4460
- readonly 'shares.update': {
4461
- readonly operationId: "shares.update";
4462
- readonly title: "Update share";
4463
- readonly summary: "Edit a grant in place — every embedded copy of the token follows the row.";
4464
- readonly method: "PATCH";
4465
- readonly path: "/v1/tenants/:tenantId/shares/:shareId";
4466
- readonly credentials: readonly ["api-token", "tenant-jwt"];
4467
- readonly scope: readonly ["shares.manage"];
4442
+ readonly 'tenants.suspend': {
4443
+ readonly operationId: "tenants.suspend";
4444
+ readonly title: "Suspend tenant";
4445
+ readonly summary: "Fail the tenant closed: refuse every tenant JWT, doc JWT, and share exchange.";
4446
+ readonly method: "POST";
4447
+ readonly path: "/v1/tenants/:tenantId/suspend";
4448
+ readonly credentials: readonly ["api-token"];
4449
+ readonly scope: readonly [];
4468
4450
  readonly params: z.ZodObject<{
4469
4451
  tenantId: z.ZodString;
4470
- shareId: z.ZodString;
4471
4452
  }, "strip", z.ZodTypeAny, {
4472
4453
  tenantId: string;
4473
- shareId: string;
4474
4454
  }, {
4475
4455
  tenantId: string;
4476
- shareId: string;
4477
4456
  }>;
4478
4457
  readonly body: {
4479
4458
  readonly contentType: "application/json";
4480
4459
  readonly schema: z.ZodObject<{
4481
- scope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4482
- origins: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
4483
- password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4484
- sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
4485
- disabled: z.ZodOptional<z.ZodBoolean>;
4486
- expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4460
+ /** Optional operator reason, written to the security-events trail. */
4461
+ reason: z.ZodOptional<z.ZodString>;
4487
4462
  }, "strip", z.ZodTypeAny, {
4488
- expiresAt?: number | null | undefined;
4489
- scope?: string[] | undefined;
4490
- origins?: string[] | null | undefined;
4491
- sessionTtlSeconds?: number | undefined;
4492
- disabled?: boolean | undefined;
4493
- password?: string | null | undefined;
4463
+ reason?: string | undefined;
4494
4464
  }, {
4495
- expiresAt?: number | null | undefined;
4496
- scope?: string[] | undefined;
4497
- origins?: string[] | null | undefined;
4465
+ reason?: string | undefined;
4466
+ }>;
4467
+ readonly required: false;
4468
+ };
4469
+ readonly responses: {
4470
+ readonly 204: {};
4471
+ readonly 404: {
4472
+ readonly contentType: "application/json";
4473
+ readonly schema: z.ZodObject<{
4474
+ error: z.ZodObject<{
4475
+ code: z.ZodString;
4476
+ message: z.ZodString;
4477
+ }, "strip", z.ZodTypeAny, {
4478
+ code: string;
4479
+ message: string;
4480
+ }, {
4481
+ code: string;
4482
+ message: string;
4483
+ }>;
4484
+ }, "strip", z.ZodTypeAny, {
4485
+ error: {
4486
+ code: string;
4487
+ message: string;
4488
+ };
4489
+ }, {
4490
+ error: {
4491
+ code: string;
4492
+ message: string;
4493
+ };
4494
+ }>;
4495
+ };
4496
+ };
4497
+ readonly notes: string;
4498
+ };
4499
+ readonly 'tenants.resume': {
4500
+ readonly operationId: "tenants.resume";
4501
+ readonly title: "Resume tenant";
4502
+ readonly summary: "Lift a suspension; credentials for the tenant verify again.";
4503
+ readonly method: "POST";
4504
+ readonly path: "/v1/tenants/:tenantId/resume";
4505
+ readonly credentials: readonly ["api-token"];
4506
+ readonly scope: readonly [];
4507
+ readonly params: z.ZodObject<{
4508
+ tenantId: z.ZodString;
4509
+ }, "strip", z.ZodTypeAny, {
4510
+ tenantId: string;
4511
+ }, {
4512
+ tenantId: string;
4513
+ }>;
4514
+ readonly responses: {
4515
+ readonly 204: {};
4516
+ readonly 404: {
4517
+ readonly contentType: "application/json";
4518
+ readonly schema: z.ZodObject<{
4519
+ error: z.ZodObject<{
4520
+ code: z.ZodString;
4521
+ message: z.ZodString;
4522
+ }, "strip", z.ZodTypeAny, {
4523
+ code: string;
4524
+ message: string;
4525
+ }, {
4526
+ code: string;
4527
+ message: string;
4528
+ }>;
4529
+ }, "strip", z.ZodTypeAny, {
4530
+ error: {
4531
+ code: string;
4532
+ message: string;
4533
+ };
4534
+ }, {
4535
+ error: {
4536
+ code: string;
4537
+ message: string;
4538
+ };
4539
+ }>;
4540
+ };
4541
+ };
4542
+ };
4543
+ readonly 'shares.create': {
4544
+ readonly operationId: "shares.create";
4545
+ readonly title: "Create share";
4546
+ readonly summary: "Create a standing share grant for one document — the no-backend embed credential.";
4547
+ readonly method: "POST";
4548
+ readonly path: "/v1/tenants/:tenantId/shares";
4549
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
4550
+ readonly scope: readonly ["shares.manage"];
4551
+ readonly params: z.ZodObject<{
4552
+ tenantId: z.ZodString;
4553
+ }, "strip", z.ZodTypeAny, {
4554
+ tenantId: string;
4555
+ }, {
4556
+ tenantId: string;
4557
+ }>;
4558
+ readonly body: {
4559
+ readonly contentType: "application/json";
4560
+ readonly schema: z.ZodObject<{
4561
+ docId: z.ZodString;
4562
+ layerName: z.ZodOptional<z.ZodString>;
4563
+ /**
4564
+ * Doc capability scopes the exchanged session will carry. Validated
4565
+ * server-side against the engine's scope vocabulary, same as
4566
+ * `tokens.issue`.
4567
+ */
4568
+ scope: z.ZodArray<z.ZodString, "many">;
4569
+ /** Origin allowlist; omit to allow any origin. */
4570
+ origins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4571
+ /** Optional passphrase gate, checked at exchange. Stored as a hash; never returned. */
4572
+ password: z.ZodOptional<z.ZodString>;
4573
+ /** Lifetime of exchanged session tokens. Default 600. */
4574
+ sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
4575
+ /** Unix epoch ms after which the grant stops exchanging; omit for no expiry. */
4576
+ expiresAt: z.ZodOptional<z.ZodNumber>;
4577
+ }, "strip", z.ZodTypeAny, {
4578
+ docId: string;
4579
+ scope: string[];
4580
+ expiresAt?: number | undefined;
4581
+ layerName?: string | undefined;
4582
+ origins?: string[] | undefined;
4498
4583
  sessionTtlSeconds?: number | undefined;
4499
- disabled?: boolean | undefined;
4500
- password?: string | null | undefined;
4584
+ password?: string | undefined;
4585
+ }, {
4586
+ docId: string;
4587
+ scope: string[];
4588
+ expiresAt?: number | undefined;
4589
+ layerName?: string | undefined;
4590
+ origins?: string[] | undefined;
4591
+ sessionTtlSeconds?: number | undefined;
4592
+ password?: string | undefined;
4501
4593
  }>;
4502
4594
  };
4503
4595
  readonly responses: {
@@ -4624,7 +4716,7 @@ declare const adminOperations: {
4624
4716
  };
4625
4717
  }>;
4626
4718
  };
4627
- readonly 404: {
4719
+ readonly 403: {
4628
4720
  readonly contentType: "application/json";
4629
4721
  readonly schema: z.ZodObject<{
4630
4722
  error: z.ZodObject<{
@@ -4649,28 +4741,6 @@ declare const adminOperations: {
4649
4741
  };
4650
4742
  }>;
4651
4743
  };
4652
- };
4653
- };
4654
- readonly 'shares.delete': {
4655
- readonly operationId: "shares.delete";
4656
- readonly title: "Revoke share";
4657
- readonly summary: "Delete a grant; exchange stops immediately, live sessions lapse at their exp.";
4658
- readonly method: "DELETE";
4659
- readonly path: "/v1/tenants/:tenantId/shares/:shareId";
4660
- readonly credentials: readonly ["api-token", "tenant-jwt"];
4661
- readonly scope: readonly ["shares.manage"];
4662
- readonly params: z.ZodObject<{
4663
- tenantId: z.ZodString;
4664
- shareId: z.ZodString;
4665
- }, "strip", z.ZodTypeAny, {
4666
- tenantId: string;
4667
- shareId: string;
4668
- }, {
4669
- tenantId: string;
4670
- shareId: string;
4671
- }>;
4672
- readonly responses: {
4673
- readonly 204: {};
4674
4744
  readonly 404: {
4675
4745
  readonly contentType: "application/json";
4676
4746
  readonly schema: z.ZodObject<{
@@ -4697,102 +4767,141 @@ declare const adminOperations: {
4697
4767
  }>;
4698
4768
  };
4699
4769
  };
4770
+ readonly notes: string;
4700
4771
  };
4701
- readonly 'shares.exchange': {
4702
- readonly operationId: "shares.exchange";
4703
- readonly title: "Exchange share token";
4704
- readonly summary: "Trade a public share token for a short-lived document session JWT.";
4705
- readonly method: "POST";
4706
- readonly path: "/v1/share-sessions";
4707
- readonly credentials: readonly [];
4708
- readonly scope: readonly [];
4709
- readonly body: {
4710
- readonly contentType: "application/json";
4711
- readonly schema: z.ZodObject<{
4712
- shareToken: z.ZodString;
4713
- /** Required when the grant is passphrase-protected (422 otherwise). */
4714
- password: z.ZodOptional<z.ZodString>;
4715
- }, "strip", z.ZodTypeAny, {
4716
- shareToken: string;
4717
- password?: string | undefined;
4718
- }, {
4719
- shareToken: string;
4720
- password?: string | undefined;
4721
- }>;
4722
- };
4772
+ readonly 'shares.list': {
4773
+ readonly operationId: "shares.list";
4774
+ readonly title: "List shares";
4775
+ readonly summary: "List share grants in the tenant, newest first, cursor-paginated.";
4776
+ readonly method: "GET";
4777
+ readonly path: "/v1/tenants/:tenantId/shares";
4778
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
4779
+ readonly scope: readonly ["shares.manage"];
4780
+ readonly params: z.ZodObject<{
4781
+ tenantId: z.ZodString;
4782
+ }, "strip", z.ZodTypeAny, {
4783
+ tenantId: string;
4784
+ }, {
4785
+ tenantId: string;
4786
+ }>;
4787
+ readonly query: z.ZodObject<{
4788
+ limit: z.ZodDefault<z.ZodNumber>;
4789
+ cursor: z.ZodOptional<z.ZodString>;
4790
+ /** Filter to one document's grants. */
4791
+ docId: z.ZodOptional<z.ZodString>;
4792
+ }, "strip", z.ZodTypeAny, {
4793
+ limit: number;
4794
+ docId?: string | undefined;
4795
+ cursor?: string | undefined;
4796
+ }, {
4797
+ docId?: string | undefined;
4798
+ limit?: number | undefined;
4799
+ cursor?: string | undefined;
4800
+ }>;
4723
4801
  readonly responses: {
4724
4802
  readonly 200: {
4725
4803
  readonly contentType: "application/json";
4726
4804
  readonly schema: z.ZodObject<{
4727
- /** A doc-scoped session JWT carrying the grant's capabilities and origin lock. */
4728
- token: z.ZodString;
4729
- docId: z.ZodString;
4730
- layerName: z.ZodString;
4731
- /** Unix seconds when the session token expires; exchange again for a fresh one. */
4732
- expiresAt: z.ZodNumber;
4733
- }, "strip", z.ZodTypeAny, {
4734
- docId: string;
4735
- expiresAt: number;
4736
- layerName: string;
4737
- token: string;
4738
- }, {
4739
- docId: string;
4740
- expiresAt: number;
4741
- layerName: string;
4742
- token: string;
4743
- }>;
4744
- };
4745
- readonly 400: {
4746
- readonly contentType: "application/json";
4747
- readonly schema: z.ZodObject<{
4748
- error: z.ZodObject<{
4749
- code: z.ZodString;
4750
- message: z.ZodString;
4805
+ shares: z.ZodArray<z.ZodObject<{
4806
+ /** Grant id; doubles as the public share token (`shr_…`). */
4807
+ id: z.ZodString;
4808
+ tenantId: z.ZodString;
4809
+ docId: z.ZodString;
4810
+ layerName: z.ZodString;
4811
+ /** Doc capabilities the exchanged session carries. */
4812
+ scope: z.ZodArray<z.ZodString, "many">;
4813
+ /** Origin allowlist; null means any origin. */
4814
+ origins: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
4815
+ /** True when a passphrase is required at exchange. The passphrase itself is never returned. */
4816
+ passwordProtected: z.ZodBoolean;
4817
+ /** Lifetime of each exchanged session token, in seconds. */
4818
+ sessionTtlSeconds: z.ZodNumber;
4819
+ /** Paused grants refuse exchange (404) but keep their configuration. */
4820
+ disabled: z.ZodBoolean;
4821
+ /** Unix epoch ms after which exchange returns 410; null = no expiry. */
4822
+ expiresAt: z.ZodNullable<z.ZodNumber>;
4823
+ /** Total successful exchanges — a dashboard convenience, not the usage meter. */
4824
+ exchangeCount: z.ZodNumber;
4825
+ lastExchangedAt: z.ZodNullable<z.ZodNumber>;
4826
+ createdBy: z.ZodString;
4827
+ createdAt: z.ZodNumber;
4828
+ updatedAt: z.ZodNumber;
4751
4829
  }, "strip", z.ZodTypeAny, {
4752
- code: string;
4753
- message: string;
4754
- }, {
4755
- code: string;
4756
- message: string;
4757
- }>;
4758
- }, "strip", z.ZodTypeAny, {
4759
- error: {
4760
- code: string;
4761
- message: string;
4762
- };
4763
- }, {
4764
- error: {
4765
- code: string;
4766
- message: string;
4767
- };
4768
- }>;
4769
- };
4770
- readonly 403: {
4771
- readonly contentType: "application/json";
4772
- readonly schema: z.ZodObject<{
4773
- error: z.ZodObject<{
4774
- code: z.ZodString;
4775
- message: z.ZodString;
4776
- }, "strip", z.ZodTypeAny, {
4777
- code: string;
4778
- message: string;
4830
+ id: string;
4831
+ tenantId: string;
4832
+ createdAt: number;
4833
+ updatedAt: number;
4834
+ createdBy: string;
4835
+ docId: string;
4836
+ expiresAt: number | null;
4837
+ layerName: string;
4838
+ scope: string[];
4839
+ origins: string[] | null;
4840
+ passwordProtected: boolean;
4841
+ sessionTtlSeconds: number;
4842
+ disabled: boolean;
4843
+ exchangeCount: number;
4844
+ lastExchangedAt: number | null;
4779
4845
  }, {
4780
- code: string;
4781
- message: string;
4782
- }>;
4846
+ id: string;
4847
+ tenantId: string;
4848
+ createdAt: number;
4849
+ updatedAt: number;
4850
+ createdBy: string;
4851
+ docId: string;
4852
+ expiresAt: number | null;
4853
+ layerName: string;
4854
+ scope: string[];
4855
+ origins: string[] | null;
4856
+ passwordProtected: boolean;
4857
+ sessionTtlSeconds: number;
4858
+ disabled: boolean;
4859
+ exchangeCount: number;
4860
+ lastExchangedAt: number | null;
4861
+ }>, "many">;
4862
+ /** Opaque cursor for the next page; `null` on the last page. */
4863
+ nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4783
4864
  }, "strip", z.ZodTypeAny, {
4784
- error: {
4785
- code: string;
4786
- message: string;
4787
- };
4865
+ shares: {
4866
+ id: string;
4867
+ tenantId: string;
4868
+ createdAt: number;
4869
+ updatedAt: number;
4870
+ createdBy: string;
4871
+ docId: string;
4872
+ expiresAt: number | null;
4873
+ layerName: string;
4874
+ scope: string[];
4875
+ origins: string[] | null;
4876
+ passwordProtected: boolean;
4877
+ sessionTtlSeconds: number;
4878
+ disabled: boolean;
4879
+ exchangeCount: number;
4880
+ lastExchangedAt: number | null;
4881
+ }[];
4882
+ nextCursor?: string | null | undefined;
4788
4883
  }, {
4789
- error: {
4790
- code: string;
4791
- message: string;
4792
- };
4884
+ shares: {
4885
+ id: string;
4886
+ tenantId: string;
4887
+ createdAt: number;
4888
+ updatedAt: number;
4889
+ createdBy: string;
4890
+ docId: string;
4891
+ expiresAt: number | null;
4892
+ layerName: string;
4893
+ scope: string[];
4894
+ origins: string[] | null;
4895
+ passwordProtected: boolean;
4896
+ sessionTtlSeconds: number;
4897
+ disabled: boolean;
4898
+ exchangeCount: number;
4899
+ lastExchangedAt: number | null;
4900
+ }[];
4901
+ nextCursor?: string | null | undefined;
4793
4902
  }>;
4794
4903
  };
4795
- readonly 404: {
4904
+ readonly 400: {
4796
4905
  readonly contentType: "application/json";
4797
4906
  readonly schema: z.ZodObject<{
4798
4907
  error: z.ZodObject<{
@@ -4817,32 +4926,126 @@ declare const adminOperations: {
4817
4926
  };
4818
4927
  }>;
4819
4928
  };
4820
- readonly 410: {
4929
+ };
4930
+ };
4931
+ readonly 'shares.get': {
4932
+ readonly operationId: "shares.get";
4933
+ readonly title: "Get share";
4934
+ readonly summary: "Fetch one share grant.";
4935
+ readonly method: "GET";
4936
+ readonly path: "/v1/tenants/:tenantId/shares/:shareId";
4937
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
4938
+ readonly scope: readonly ["shares.manage"];
4939
+ readonly params: z.ZodObject<{
4940
+ tenantId: z.ZodString;
4941
+ shareId: z.ZodString;
4942
+ }, "strip", z.ZodTypeAny, {
4943
+ tenantId: string;
4944
+ shareId: string;
4945
+ }, {
4946
+ tenantId: string;
4947
+ shareId: string;
4948
+ }>;
4949
+ readonly responses: {
4950
+ readonly 200: {
4821
4951
  readonly contentType: "application/json";
4822
4952
  readonly schema: z.ZodObject<{
4823
- error: z.ZodObject<{
4824
- code: z.ZodString;
4825
- message: z.ZodString;
4953
+ share: z.ZodObject<{
4954
+ /** Grant id; doubles as the public share token (`shr_…`). */
4955
+ id: z.ZodString;
4956
+ tenantId: z.ZodString;
4957
+ docId: z.ZodString;
4958
+ layerName: z.ZodString;
4959
+ /** Doc capabilities the exchanged session carries. */
4960
+ scope: z.ZodArray<z.ZodString, "many">;
4961
+ /** Origin allowlist; null means any origin. */
4962
+ origins: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
4963
+ /** True when a passphrase is required at exchange. The passphrase itself is never returned. */
4964
+ passwordProtected: z.ZodBoolean;
4965
+ /** Lifetime of each exchanged session token, in seconds. */
4966
+ sessionTtlSeconds: z.ZodNumber;
4967
+ /** Paused grants refuse exchange (404) but keep their configuration. */
4968
+ disabled: z.ZodBoolean;
4969
+ /** Unix epoch ms after which exchange returns 410; null = no expiry. */
4970
+ expiresAt: z.ZodNullable<z.ZodNumber>;
4971
+ /** Total successful exchanges — a dashboard convenience, not the usage meter. */
4972
+ exchangeCount: z.ZodNumber;
4973
+ lastExchangedAt: z.ZodNullable<z.ZodNumber>;
4974
+ createdBy: z.ZodString;
4975
+ createdAt: z.ZodNumber;
4976
+ updatedAt: z.ZodNumber;
4826
4977
  }, "strip", z.ZodTypeAny, {
4827
- code: string;
4828
- message: string;
4978
+ id: string;
4979
+ tenantId: string;
4980
+ createdAt: number;
4981
+ updatedAt: number;
4982
+ createdBy: string;
4983
+ docId: string;
4984
+ expiresAt: number | null;
4985
+ layerName: string;
4986
+ scope: string[];
4987
+ origins: string[] | null;
4988
+ passwordProtected: boolean;
4989
+ sessionTtlSeconds: number;
4990
+ disabled: boolean;
4991
+ exchangeCount: number;
4992
+ lastExchangedAt: number | null;
4829
4993
  }, {
4830
- code: string;
4831
- message: string;
4994
+ id: string;
4995
+ tenantId: string;
4996
+ createdAt: number;
4997
+ updatedAt: number;
4998
+ createdBy: string;
4999
+ docId: string;
5000
+ expiresAt: number | null;
5001
+ layerName: string;
5002
+ scope: string[];
5003
+ origins: string[] | null;
5004
+ passwordProtected: boolean;
5005
+ sessionTtlSeconds: number;
5006
+ disabled: boolean;
5007
+ exchangeCount: number;
5008
+ lastExchangedAt: number | null;
4832
5009
  }>;
4833
5010
  }, "strip", z.ZodTypeAny, {
4834
- error: {
4835
- code: string;
4836
- message: string;
5011
+ share: {
5012
+ id: string;
5013
+ tenantId: string;
5014
+ createdAt: number;
5015
+ updatedAt: number;
5016
+ createdBy: string;
5017
+ docId: string;
5018
+ expiresAt: number | null;
5019
+ layerName: string;
5020
+ scope: string[];
5021
+ origins: string[] | null;
5022
+ passwordProtected: boolean;
5023
+ sessionTtlSeconds: number;
5024
+ disabled: boolean;
5025
+ exchangeCount: number;
5026
+ lastExchangedAt: number | null;
4837
5027
  };
4838
5028
  }, {
4839
- error: {
4840
- code: string;
4841
- message: string;
5029
+ share: {
5030
+ id: string;
5031
+ tenantId: string;
5032
+ createdAt: number;
5033
+ updatedAt: number;
5034
+ createdBy: string;
5035
+ docId: string;
5036
+ expiresAt: number | null;
5037
+ layerName: string;
5038
+ scope: string[];
5039
+ origins: string[] | null;
5040
+ passwordProtected: boolean;
5041
+ sessionTtlSeconds: number;
5042
+ disabled: boolean;
5043
+ exchangeCount: number;
5044
+ lastExchangedAt: number | null;
4842
5045
  };
4843
5046
  }>;
4844
5047
  };
4845
- readonly 422: {
5048
+ readonly 404: {
4846
5049
  readonly contentType: "application/json";
4847
5050
  readonly schema: z.ZodObject<{
4848
5051
  error: z.ZodObject<{
@@ -4868,32 +5071,444 @@ declare const adminOperations: {
4868
5071
  }>;
4869
5072
  };
4870
5073
  };
4871
- readonly notes: string;
4872
5074
  };
4873
- };
4874
- type AdminOperationId = keyof typeof adminOperations;
4875
- declare const DocIdParamsSchema: z.ZodObject<{
4876
- docId: z.ZodString;
4877
- }, "strip", z.ZodTypeAny, {
4878
- docId: string;
4879
- }, {
4880
- docId: string;
4881
- }>;
4882
- declare const DocLayerParamsSchema: z.ZodObject<{
4883
- docId: z.ZodString;
4884
- } & {
4885
- layerName: z.ZodString;
4886
- }, "strip", z.ZodTypeAny, {
4887
- docId: string;
4888
- layerName: string;
4889
- }, {
4890
- docId: string;
4891
- layerName: string;
4892
- }>;
4893
- declare const DocPageParamsSchema: z.ZodObject<{
4894
- docId: z.ZodString;
4895
- } & {
4896
- layerName: z.ZodString;
5075
+ readonly 'shares.update': {
5076
+ readonly operationId: "shares.update";
5077
+ readonly title: "Update share";
5078
+ readonly summary: "Edit a grant in place — every embedded copy of the token follows the row.";
5079
+ readonly method: "PATCH";
5080
+ readonly path: "/v1/tenants/:tenantId/shares/:shareId";
5081
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
5082
+ readonly scope: readonly ["shares.manage"];
5083
+ readonly params: z.ZodObject<{
5084
+ tenantId: z.ZodString;
5085
+ shareId: z.ZodString;
5086
+ }, "strip", z.ZodTypeAny, {
5087
+ tenantId: string;
5088
+ shareId: string;
5089
+ }, {
5090
+ tenantId: string;
5091
+ shareId: string;
5092
+ }>;
5093
+ readonly body: {
5094
+ readonly contentType: "application/json";
5095
+ readonly schema: z.ZodObject<{
5096
+ scope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5097
+ origins: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
5098
+ password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5099
+ sessionTtlSeconds: z.ZodOptional<z.ZodNumber>;
5100
+ disabled: z.ZodOptional<z.ZodBoolean>;
5101
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
5102
+ }, "strip", z.ZodTypeAny, {
5103
+ expiresAt?: number | null | undefined;
5104
+ scope?: string[] | undefined;
5105
+ origins?: string[] | null | undefined;
5106
+ sessionTtlSeconds?: number | undefined;
5107
+ disabled?: boolean | undefined;
5108
+ password?: string | null | undefined;
5109
+ }, {
5110
+ expiresAt?: number | null | undefined;
5111
+ scope?: string[] | undefined;
5112
+ origins?: string[] | null | undefined;
5113
+ sessionTtlSeconds?: number | undefined;
5114
+ disabled?: boolean | undefined;
5115
+ password?: string | null | undefined;
5116
+ }>;
5117
+ };
5118
+ readonly responses: {
5119
+ readonly 200: {
5120
+ readonly contentType: "application/json";
5121
+ readonly schema: z.ZodObject<{
5122
+ share: z.ZodObject<{
5123
+ /** Grant id; doubles as the public share token (`shr_…`). */
5124
+ id: z.ZodString;
5125
+ tenantId: z.ZodString;
5126
+ docId: z.ZodString;
5127
+ layerName: z.ZodString;
5128
+ /** Doc capabilities the exchanged session carries. */
5129
+ scope: z.ZodArray<z.ZodString, "many">;
5130
+ /** Origin allowlist; null means any origin. */
5131
+ origins: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
5132
+ /** True when a passphrase is required at exchange. The passphrase itself is never returned. */
5133
+ passwordProtected: z.ZodBoolean;
5134
+ /** Lifetime of each exchanged session token, in seconds. */
5135
+ sessionTtlSeconds: z.ZodNumber;
5136
+ /** Paused grants refuse exchange (404) but keep their configuration. */
5137
+ disabled: z.ZodBoolean;
5138
+ /** Unix epoch ms after which exchange returns 410; null = no expiry. */
5139
+ expiresAt: z.ZodNullable<z.ZodNumber>;
5140
+ /** Total successful exchanges — a dashboard convenience, not the usage meter. */
5141
+ exchangeCount: z.ZodNumber;
5142
+ lastExchangedAt: z.ZodNullable<z.ZodNumber>;
5143
+ createdBy: z.ZodString;
5144
+ createdAt: z.ZodNumber;
5145
+ updatedAt: z.ZodNumber;
5146
+ }, "strip", z.ZodTypeAny, {
5147
+ id: string;
5148
+ tenantId: string;
5149
+ createdAt: number;
5150
+ updatedAt: number;
5151
+ createdBy: string;
5152
+ docId: string;
5153
+ expiresAt: number | null;
5154
+ layerName: string;
5155
+ scope: string[];
5156
+ origins: string[] | null;
5157
+ passwordProtected: boolean;
5158
+ sessionTtlSeconds: number;
5159
+ disabled: boolean;
5160
+ exchangeCount: number;
5161
+ lastExchangedAt: number | null;
5162
+ }, {
5163
+ id: string;
5164
+ tenantId: string;
5165
+ createdAt: number;
5166
+ updatedAt: number;
5167
+ createdBy: string;
5168
+ docId: string;
5169
+ expiresAt: number | null;
5170
+ layerName: string;
5171
+ scope: string[];
5172
+ origins: string[] | null;
5173
+ passwordProtected: boolean;
5174
+ sessionTtlSeconds: number;
5175
+ disabled: boolean;
5176
+ exchangeCount: number;
5177
+ lastExchangedAt: number | null;
5178
+ }>;
5179
+ }, "strip", z.ZodTypeAny, {
5180
+ share: {
5181
+ id: string;
5182
+ tenantId: string;
5183
+ createdAt: number;
5184
+ updatedAt: number;
5185
+ createdBy: string;
5186
+ docId: string;
5187
+ expiresAt: number | null;
5188
+ layerName: string;
5189
+ scope: string[];
5190
+ origins: string[] | null;
5191
+ passwordProtected: boolean;
5192
+ sessionTtlSeconds: number;
5193
+ disabled: boolean;
5194
+ exchangeCount: number;
5195
+ lastExchangedAt: number | null;
5196
+ };
5197
+ }, {
5198
+ share: {
5199
+ id: string;
5200
+ tenantId: string;
5201
+ createdAt: number;
5202
+ updatedAt: number;
5203
+ createdBy: string;
5204
+ docId: string;
5205
+ expiresAt: number | null;
5206
+ layerName: string;
5207
+ scope: string[];
5208
+ origins: string[] | null;
5209
+ passwordProtected: boolean;
5210
+ sessionTtlSeconds: number;
5211
+ disabled: boolean;
5212
+ exchangeCount: number;
5213
+ lastExchangedAt: number | null;
5214
+ };
5215
+ }>;
5216
+ };
5217
+ readonly 400: {
5218
+ readonly contentType: "application/json";
5219
+ readonly schema: z.ZodObject<{
5220
+ error: z.ZodObject<{
5221
+ code: z.ZodString;
5222
+ message: z.ZodString;
5223
+ }, "strip", z.ZodTypeAny, {
5224
+ code: string;
5225
+ message: string;
5226
+ }, {
5227
+ code: string;
5228
+ message: string;
5229
+ }>;
5230
+ }, "strip", z.ZodTypeAny, {
5231
+ error: {
5232
+ code: string;
5233
+ message: string;
5234
+ };
5235
+ }, {
5236
+ error: {
5237
+ code: string;
5238
+ message: string;
5239
+ };
5240
+ }>;
5241
+ };
5242
+ readonly 404: {
5243
+ readonly contentType: "application/json";
5244
+ readonly schema: z.ZodObject<{
5245
+ error: z.ZodObject<{
5246
+ code: z.ZodString;
5247
+ message: z.ZodString;
5248
+ }, "strip", z.ZodTypeAny, {
5249
+ code: string;
5250
+ message: string;
5251
+ }, {
5252
+ code: string;
5253
+ message: string;
5254
+ }>;
5255
+ }, "strip", z.ZodTypeAny, {
5256
+ error: {
5257
+ code: string;
5258
+ message: string;
5259
+ };
5260
+ }, {
5261
+ error: {
5262
+ code: string;
5263
+ message: string;
5264
+ };
5265
+ }>;
5266
+ };
5267
+ };
5268
+ };
5269
+ readonly 'shares.delete': {
5270
+ readonly operationId: "shares.delete";
5271
+ readonly title: "Revoke share";
5272
+ readonly summary: "Delete a grant; exchange stops immediately, live sessions lapse at their exp.";
5273
+ readonly method: "DELETE";
5274
+ readonly path: "/v1/tenants/:tenantId/shares/:shareId";
5275
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
5276
+ readonly scope: readonly ["shares.manage"];
5277
+ readonly params: z.ZodObject<{
5278
+ tenantId: z.ZodString;
5279
+ shareId: z.ZodString;
5280
+ }, "strip", z.ZodTypeAny, {
5281
+ tenantId: string;
5282
+ shareId: string;
5283
+ }, {
5284
+ tenantId: string;
5285
+ shareId: string;
5286
+ }>;
5287
+ readonly responses: {
5288
+ readonly 204: {};
5289
+ readonly 404: {
5290
+ readonly contentType: "application/json";
5291
+ readonly schema: z.ZodObject<{
5292
+ error: z.ZodObject<{
5293
+ code: z.ZodString;
5294
+ message: z.ZodString;
5295
+ }, "strip", z.ZodTypeAny, {
5296
+ code: string;
5297
+ message: string;
5298
+ }, {
5299
+ code: string;
5300
+ message: string;
5301
+ }>;
5302
+ }, "strip", z.ZodTypeAny, {
5303
+ error: {
5304
+ code: string;
5305
+ message: string;
5306
+ };
5307
+ }, {
5308
+ error: {
5309
+ code: string;
5310
+ message: string;
5311
+ };
5312
+ }>;
5313
+ };
5314
+ };
5315
+ };
5316
+ readonly 'shares.exchange': {
5317
+ readonly operationId: "shares.exchange";
5318
+ readonly title: "Exchange share token";
5319
+ readonly summary: "Trade a public share token for a short-lived document session JWT.";
5320
+ readonly method: "POST";
5321
+ readonly path: "/v1/share-sessions";
5322
+ readonly credentials: readonly [];
5323
+ readonly scope: readonly [];
5324
+ readonly body: {
5325
+ readonly contentType: "application/json";
5326
+ readonly schema: z.ZodObject<{
5327
+ shareToken: z.ZodString;
5328
+ /** Required when the grant is passphrase-protected (422 otherwise). */
5329
+ password: z.ZodOptional<z.ZodString>;
5330
+ }, "strip", z.ZodTypeAny, {
5331
+ shareToken: string;
5332
+ password?: string | undefined;
5333
+ }, {
5334
+ shareToken: string;
5335
+ password?: string | undefined;
5336
+ }>;
5337
+ };
5338
+ readonly responses: {
5339
+ readonly 200: {
5340
+ readonly contentType: "application/json";
5341
+ readonly schema: z.ZodObject<{
5342
+ /** A doc-scoped session JWT carrying the grant's capabilities and origin lock. */
5343
+ token: z.ZodString;
5344
+ docId: z.ZodString;
5345
+ layerName: z.ZodString;
5346
+ /** Unix seconds when the session token expires; exchange again for a fresh one. */
5347
+ expiresAt: z.ZodNumber;
5348
+ }, "strip", z.ZodTypeAny, {
5349
+ docId: string;
5350
+ expiresAt: number;
5351
+ layerName: string;
5352
+ token: string;
5353
+ }, {
5354
+ docId: string;
5355
+ expiresAt: number;
5356
+ layerName: string;
5357
+ token: string;
5358
+ }>;
5359
+ };
5360
+ readonly 400: {
5361
+ readonly contentType: "application/json";
5362
+ readonly schema: z.ZodObject<{
5363
+ error: z.ZodObject<{
5364
+ code: z.ZodString;
5365
+ message: z.ZodString;
5366
+ }, "strip", z.ZodTypeAny, {
5367
+ code: string;
5368
+ message: string;
5369
+ }, {
5370
+ code: string;
5371
+ message: string;
5372
+ }>;
5373
+ }, "strip", z.ZodTypeAny, {
5374
+ error: {
5375
+ code: string;
5376
+ message: string;
5377
+ };
5378
+ }, {
5379
+ error: {
5380
+ code: string;
5381
+ message: string;
5382
+ };
5383
+ }>;
5384
+ };
5385
+ readonly 403: {
5386
+ readonly contentType: "application/json";
5387
+ readonly schema: z.ZodObject<{
5388
+ error: z.ZodObject<{
5389
+ code: z.ZodString;
5390
+ message: z.ZodString;
5391
+ }, "strip", z.ZodTypeAny, {
5392
+ code: string;
5393
+ message: string;
5394
+ }, {
5395
+ code: string;
5396
+ message: string;
5397
+ }>;
5398
+ }, "strip", z.ZodTypeAny, {
5399
+ error: {
5400
+ code: string;
5401
+ message: string;
5402
+ };
5403
+ }, {
5404
+ error: {
5405
+ code: string;
5406
+ message: string;
5407
+ };
5408
+ }>;
5409
+ };
5410
+ readonly 404: {
5411
+ readonly contentType: "application/json";
5412
+ readonly schema: z.ZodObject<{
5413
+ error: z.ZodObject<{
5414
+ code: z.ZodString;
5415
+ message: z.ZodString;
5416
+ }, "strip", z.ZodTypeAny, {
5417
+ code: string;
5418
+ message: string;
5419
+ }, {
5420
+ code: string;
5421
+ message: string;
5422
+ }>;
5423
+ }, "strip", z.ZodTypeAny, {
5424
+ error: {
5425
+ code: string;
5426
+ message: string;
5427
+ };
5428
+ }, {
5429
+ error: {
5430
+ code: string;
5431
+ message: string;
5432
+ };
5433
+ }>;
5434
+ };
5435
+ readonly 410: {
5436
+ readonly contentType: "application/json";
5437
+ readonly schema: z.ZodObject<{
5438
+ error: z.ZodObject<{
5439
+ code: z.ZodString;
5440
+ message: z.ZodString;
5441
+ }, "strip", z.ZodTypeAny, {
5442
+ code: string;
5443
+ message: string;
5444
+ }, {
5445
+ code: string;
5446
+ message: string;
5447
+ }>;
5448
+ }, "strip", z.ZodTypeAny, {
5449
+ error: {
5450
+ code: string;
5451
+ message: string;
5452
+ };
5453
+ }, {
5454
+ error: {
5455
+ code: string;
5456
+ message: string;
5457
+ };
5458
+ }>;
5459
+ };
5460
+ readonly 422: {
5461
+ readonly contentType: "application/json";
5462
+ readonly schema: z.ZodObject<{
5463
+ error: z.ZodObject<{
5464
+ code: z.ZodString;
5465
+ message: z.ZodString;
5466
+ }, "strip", z.ZodTypeAny, {
5467
+ code: string;
5468
+ message: string;
5469
+ }, {
5470
+ code: string;
5471
+ message: string;
5472
+ }>;
5473
+ }, "strip", z.ZodTypeAny, {
5474
+ error: {
5475
+ code: string;
5476
+ message: string;
5477
+ };
5478
+ }, {
5479
+ error: {
5480
+ code: string;
5481
+ message: string;
5482
+ };
5483
+ }>;
5484
+ };
5485
+ };
5486
+ readonly notes: string;
5487
+ };
5488
+ };
5489
+ type AdminOperationId = keyof typeof adminOperations;
5490
+ declare const DocIdParamsSchema: z.ZodObject<{
5491
+ docId: z.ZodString;
5492
+ }, "strip", z.ZodTypeAny, {
5493
+ docId: string;
5494
+ }, {
5495
+ docId: string;
5496
+ }>;
5497
+ declare const DocLayerParamsSchema: z.ZodObject<{
5498
+ docId: z.ZodString;
5499
+ } & {
5500
+ layerName: z.ZodString;
5501
+ }, "strip", z.ZodTypeAny, {
5502
+ docId: string;
5503
+ layerName: string;
5504
+ }, {
5505
+ docId: string;
5506
+ layerName: string;
5507
+ }>;
5508
+ declare const DocPageParamsSchema: z.ZodObject<{
5509
+ docId: z.ZodString;
5510
+ } & {
5511
+ layerName: z.ZodString;
4897
5512
  } & {
4898
5513
  pon: z.ZodNumber;
4899
5514
  }, "strip", z.ZodTypeAny, {
@@ -5095,7 +5710,7 @@ declare const docOperations: {
5095
5710
  readonly responses: {
5096
5711
  readonly 200: {
5097
5712
  readonly contentType: "application/json";
5098
- readonly schema: z.ZodType<_embedpdf_engine_core_wire.DocumentManifest, z.ZodTypeDef, _embedpdf_engine_core_wire.DocumentManifest>;
5713
+ readonly schema: z.ZodType<_embedpdf_engine_core_runtime.DocumentManifest, z.ZodTypeDef, _embedpdf_engine_core_runtime.DocumentManifest>;
5099
5714
  };
5100
5715
  readonly 404: {
5101
5716
  readonly contentType: "application/json";
@@ -5277,11 +5892,11 @@ declare const docOperations: {
5277
5892
  readonly 200: {
5278
5893
  readonly contentType: "application/json";
5279
5894
  readonly schema: z.ZodObject<{
5280
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
5895
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5281
5896
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5282
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
5897
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5283
5898
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5284
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
5899
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5285
5900
  }, z.ZodTypeAny, "passthrough">>;
5286
5901
  };
5287
5902
  readonly 400: {
@@ -5331,11 +5946,11 @@ declare const docOperations: {
5331
5946
  readonly 200: {
5332
5947
  readonly contentType: "application/json";
5333
5948
  readonly schema: z.ZodObject<{
5334
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
5949
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5335
5950
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5336
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
5951
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5337
5952
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5338
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
5953
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5339
5954
  }, z.ZodTypeAny, "passthrough">>;
5340
5955
  };
5341
5956
  readonly 400: {
@@ -5381,11 +5996,11 @@ declare const docOperations: {
5381
5996
  readonly 200: {
5382
5997
  readonly contentType: "application/json";
5383
5998
  readonly schema: z.ZodObject<{
5384
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
5999
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5385
6000
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5386
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6001
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5387
6002
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5388
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6003
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5389
6004
  }, z.ZodTypeAny, "passthrough">>;
5390
6005
  };
5391
6006
  readonly 404: {
@@ -5459,11 +6074,11 @@ declare const docOperations: {
5459
6074
  readonly 200: {
5460
6075
  readonly contentType: "application/json";
5461
6076
  readonly schema: z.ZodObject<{
5462
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6077
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5463
6078
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5464
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6079
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5465
6080
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5466
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6081
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5467
6082
  }, z.ZodTypeAny, "passthrough">>;
5468
6083
  };
5469
6084
  readonly 400: {
@@ -5505,11 +6120,11 @@ declare const docOperations: {
5505
6120
  readonly 200: {
5506
6121
  readonly contentType: "application/json";
5507
6122
  readonly schema: z.ZodObject<{
5508
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6123
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5509
6124
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5510
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6125
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5511
6126
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5512
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6127
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5513
6128
  }, z.ZodTypeAny, "passthrough">>;
5514
6129
  };
5515
6130
  readonly 404: {
@@ -5585,11 +6200,11 @@ declare const docOperations: {
5585
6200
  readonly 200: {
5586
6201
  readonly contentType: "application/json";
5587
6202
  readonly schema: z.ZodObject<{
5588
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6203
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5589
6204
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5590
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6205
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5591
6206
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5592
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6207
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5593
6208
  }, z.ZodTypeAny, "passthrough">>;
5594
6209
  };
5595
6210
  readonly 400: {
@@ -5631,11 +6246,11 @@ declare const docOperations: {
5631
6246
  readonly 200: {
5632
6247
  readonly contentType: "application/json";
5633
6248
  readonly schema: z.ZodObject<{
5634
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6249
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5635
6250
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5636
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6251
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5637
6252
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5638
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6253
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5639
6254
  }, z.ZodTypeAny, "passthrough">>;
5640
6255
  };
5641
6256
  readonly 400: {
@@ -5677,11 +6292,11 @@ declare const docOperations: {
5677
6292
  readonly 200: {
5678
6293
  readonly contentType: "application/json";
5679
6294
  readonly schema: z.ZodObject<{
5680
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6295
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5681
6296
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5682
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6297
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5683
6298
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5684
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6299
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5685
6300
  }, z.ZodTypeAny, "passthrough">>;
5686
6301
  };
5687
6302
  readonly 400: {
@@ -5723,11 +6338,11 @@ declare const docOperations: {
5723
6338
  readonly 200: {
5724
6339
  readonly contentType: "application/json";
5725
6340
  readonly schema: z.ZodObject<{
5726
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6341
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5727
6342
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5728
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6343
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5729
6344
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5730
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6345
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5731
6346
  }, z.ZodTypeAny, "passthrough">>;
5732
6347
  };
5733
6348
  readonly 400: {
@@ -5770,11 +6385,11 @@ declare const docOperations: {
5770
6385
  readonly 200: {
5771
6386
  readonly contentType: "application/json";
5772
6387
  readonly schema: z.ZodObject<{
5773
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6388
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5774
6389
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5775
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6390
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5776
6391
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5777
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6392
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5778
6393
  }, z.ZodTypeAny, "passthrough">>;
5779
6394
  };
5780
6395
  readonly 400: {
@@ -5817,11 +6432,11 @@ declare const docOperations: {
5817
6432
  readonly 200: {
5818
6433
  readonly contentType: "application/json";
5819
6434
  readonly schema: z.ZodObject<{
5820
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6435
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5821
6436
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5822
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6437
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5823
6438
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5824
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6439
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
5825
6440
  }, z.ZodTypeAny, "passthrough">>;
5826
6441
  };
5827
6442
  readonly 400: {
@@ -6018,7 +6633,7 @@ declare const allOperations: {
6018
6633
  readonly responses: {
6019
6634
  readonly 200: {
6020
6635
  readonly contentType: "application/json";
6021
- readonly schema: z.ZodType<_embedpdf_engine_core_wire.DocumentManifest, z.ZodTypeDef, _embedpdf_engine_core_wire.DocumentManifest>;
6636
+ readonly schema: z.ZodType<_embedpdf_engine_core_runtime.DocumentManifest, z.ZodTypeDef, _embedpdf_engine_core_runtime.DocumentManifest>;
6022
6637
  };
6023
6638
  readonly 404: {
6024
6639
  readonly contentType: "application/json";
@@ -6200,11 +6815,11 @@ declare const allOperations: {
6200
6815
  readonly 200: {
6201
6816
  readonly contentType: "application/json";
6202
6817
  readonly schema: z.ZodObject<{
6203
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6818
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6204
6819
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6205
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6820
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6206
6821
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6207
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6822
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6208
6823
  }, z.ZodTypeAny, "passthrough">>;
6209
6824
  };
6210
6825
  readonly 400: {
@@ -6254,11 +6869,11 @@ declare const allOperations: {
6254
6869
  readonly 200: {
6255
6870
  readonly contentType: "application/json";
6256
6871
  readonly schema: z.ZodObject<{
6257
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6872
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6258
6873
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6259
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6874
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6260
6875
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6261
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6876
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6262
6877
  }, z.ZodTypeAny, "passthrough">>;
6263
6878
  };
6264
6879
  readonly 400: {
@@ -6304,11 +6919,11 @@ declare const allOperations: {
6304
6919
  readonly 200: {
6305
6920
  readonly contentType: "application/json";
6306
6921
  readonly schema: z.ZodObject<{
6307
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6922
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6308
6923
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6309
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6924
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6310
6925
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6311
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
6926
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6312
6927
  }, z.ZodTypeAny, "passthrough">>;
6313
6928
  };
6314
6929
  readonly 404: {
@@ -6382,11 +6997,11 @@ declare const allOperations: {
6382
6997
  readonly 200: {
6383
6998
  readonly contentType: "application/json";
6384
6999
  readonly schema: z.ZodObject<{
6385
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7000
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6386
7001
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6387
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7002
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6388
7003
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6389
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7004
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6390
7005
  }, z.ZodTypeAny, "passthrough">>;
6391
7006
  };
6392
7007
  readonly 400: {
@@ -6428,11 +7043,11 @@ declare const allOperations: {
6428
7043
  readonly 200: {
6429
7044
  readonly contentType: "application/json";
6430
7045
  readonly schema: z.ZodObject<{
6431
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7046
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6432
7047
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6433
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7048
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6434
7049
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6435
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7050
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6436
7051
  }, z.ZodTypeAny, "passthrough">>;
6437
7052
  };
6438
7053
  readonly 404: {
@@ -6508,11 +7123,11 @@ declare const allOperations: {
6508
7123
  readonly 200: {
6509
7124
  readonly contentType: "application/json";
6510
7125
  readonly schema: z.ZodObject<{
6511
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7126
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6512
7127
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6513
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7128
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6514
7129
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6515
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7130
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6516
7131
  }, z.ZodTypeAny, "passthrough">>;
6517
7132
  };
6518
7133
  readonly 400: {
@@ -6554,11 +7169,11 @@ declare const allOperations: {
6554
7169
  readonly 200: {
6555
7170
  readonly contentType: "application/json";
6556
7171
  readonly schema: z.ZodObject<{
6557
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7172
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6558
7173
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6559
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7174
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6560
7175
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6561
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7176
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6562
7177
  }, z.ZodTypeAny, "passthrough">>;
6563
7178
  };
6564
7179
  readonly 400: {
@@ -6600,11 +7215,11 @@ declare const allOperations: {
6600
7215
  readonly 200: {
6601
7216
  readonly contentType: "application/json";
6602
7217
  readonly schema: z.ZodObject<{
6603
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7218
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6604
7219
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6605
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7220
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6606
7221
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6607
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7222
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6608
7223
  }, z.ZodTypeAny, "passthrough">>;
6609
7224
  };
6610
7225
  readonly 400: {
@@ -6646,11 +7261,11 @@ declare const allOperations: {
6646
7261
  readonly 200: {
6647
7262
  readonly contentType: "application/json";
6648
7263
  readonly schema: z.ZodObject<{
6649
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7264
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6650
7265
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6651
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7266
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6652
7267
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6653
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7268
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6654
7269
  }, z.ZodTypeAny, "passthrough">>;
6655
7270
  };
6656
7271
  readonly 400: {
@@ -6693,11 +7308,11 @@ declare const allOperations: {
6693
7308
  readonly 200: {
6694
7309
  readonly contentType: "application/json";
6695
7310
  readonly schema: z.ZodObject<{
6696
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7311
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6697
7312
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6698
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7313
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6699
7314
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6700
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7315
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6701
7316
  }, z.ZodTypeAny, "passthrough">>;
6702
7317
  };
6703
7318
  readonly 400: {
@@ -6740,11 +7355,11 @@ declare const allOperations: {
6740
7355
  readonly 200: {
6741
7356
  readonly contentType: "application/json";
6742
7357
  readonly schema: z.ZodObject<{
6743
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7358
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6744
7359
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6745
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7360
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6746
7361
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6747
- meta: z.ZodType<_embedpdf_engine_core_wire.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_wire.MutationMeta>;
7362
+ meta: z.ZodType<_embedpdf_engine_core_runtime.MutationMeta, z.ZodTypeDef, _embedpdf_engine_core_runtime.MutationMeta>;
6748
7363
  }, z.ZodTypeAny, "passthrough">>;
6749
7364
  };
6750
7365
  readonly 400: {
@@ -7116,62 +7731,220 @@ declare const allOperations: {
7116
7731
  code: string;
7117
7732
  message: string;
7118
7733
  };
7119
- }>;
7120
- };
7121
- };
7122
- readonly notes: "Destroys the tenant and everything in its namespace — documents, layers, stored bytes, audit history. Irreversible.";
7123
- };
7124
- readonly 'documents.init': {
7125
- readonly operationId: "documents.init";
7126
- readonly title: "Initialize upload";
7127
- readonly summary: "Begin an upload: create (or resume/dedupe) a pending document and issue upload access.";
7128
- readonly method: "POST";
7129
- readonly path: "/v1/tenants/:tenantId/documents/init";
7130
- readonly credentials: readonly ["api-token", "tenant-jwt"];
7131
- readonly scope: readonly ["docs.create"];
7132
- readonly params: z.ZodObject<{
7133
- tenantId: z.ZodString;
7134
- }, "strip", z.ZodTypeAny, {
7135
- tenantId: string;
7136
- }, {
7137
- tenantId: string;
7138
- }>;
7139
- readonly body: {
7140
- readonly contentType: "application/json";
7141
- readonly schema: z.ZodObject<{
7142
- contentLength: z.ZodNumber;
7143
- contentSha256: z.ZodString;
7144
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7145
- idempotencyKey: z.ZodOptional<z.ZodString>;
7146
- dedupMode: z.ZodOptional<z.ZodEnum<["always-create", "reuse-existing"]>>;
7147
- docId: z.ZodOptional<z.ZodString>;
7148
- uploadTtlSec: z.ZodOptional<z.ZodNumber>;
7149
- uploadPreference: z.ZodOptional<z.ZodEnum<["auto", "presigned", "proxy"]>>;
7150
- }, "strip", z.ZodTypeAny, {
7151
- contentLength: number;
7152
- contentSha256: string;
7153
- metadata?: Record<string, unknown> | undefined;
7154
- idempotencyKey?: string | undefined;
7155
- dedupMode?: "always-create" | "reuse-existing" | undefined;
7156
- docId?: string | undefined;
7157
- uploadTtlSec?: number | undefined;
7158
- uploadPreference?: "auto" | "presigned" | "proxy" | undefined;
7159
- }, {
7160
- contentLength: number;
7161
- contentSha256: string;
7162
- metadata?: Record<string, unknown> | undefined;
7163
- idempotencyKey?: string | undefined;
7164
- dedupMode?: "always-create" | "reuse-existing" | undefined;
7165
- docId?: string | undefined;
7166
- uploadTtlSec?: number | undefined;
7167
- uploadPreference?: "auto" | "presigned" | "proxy" | undefined;
7168
- }>;
7169
- };
7170
- readonly responses: {
7171
- readonly 200: {
7172
- readonly contentType: "application/json";
7173
- readonly schema: z.ZodDiscriminatedUnion<"tag", [z.ZodObject<{
7174
- tag: z.ZodLiteral<"created">;
7734
+ }>;
7735
+ };
7736
+ };
7737
+ readonly notes: "Destroys the tenant and everything in its namespace — documents, layers, stored bytes, audit history. Irreversible.";
7738
+ };
7739
+ readonly 'documents.init': {
7740
+ readonly operationId: "documents.init";
7741
+ readonly title: "Initialize upload";
7742
+ readonly summary: "Begin an upload: create (or resume/dedupe) a pending document and issue upload access.";
7743
+ readonly method: "POST";
7744
+ readonly path: "/v1/tenants/:tenantId/documents/init";
7745
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
7746
+ readonly scope: readonly ["docs.create"];
7747
+ readonly params: z.ZodObject<{
7748
+ tenantId: z.ZodString;
7749
+ }, "strip", z.ZodTypeAny, {
7750
+ tenantId: string;
7751
+ }, {
7752
+ tenantId: string;
7753
+ }>;
7754
+ readonly body: {
7755
+ readonly contentType: "application/json";
7756
+ readonly schema: z.ZodObject<{
7757
+ contentLength: z.ZodNumber;
7758
+ contentSha256: z.ZodString;
7759
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7760
+ idempotencyKey: z.ZodOptional<z.ZodString>;
7761
+ dedupMode: z.ZodOptional<z.ZodEnum<["always-create", "reuse-existing"]>>;
7762
+ docId: z.ZodOptional<z.ZodString>;
7763
+ uploadTtlSec: z.ZodOptional<z.ZodNumber>;
7764
+ uploadPreference: z.ZodOptional<z.ZodEnum<["auto", "presigned", "proxy"]>>;
7765
+ }, "strip", z.ZodTypeAny, {
7766
+ contentLength: number;
7767
+ contentSha256: string;
7768
+ metadata?: Record<string, unknown> | undefined;
7769
+ idempotencyKey?: string | undefined;
7770
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
7771
+ docId?: string | undefined;
7772
+ uploadTtlSec?: number | undefined;
7773
+ uploadPreference?: "auto" | "presigned" | "proxy" | undefined;
7774
+ }, {
7775
+ contentLength: number;
7776
+ contentSha256: string;
7777
+ metadata?: Record<string, unknown> | undefined;
7778
+ idempotencyKey?: string | undefined;
7779
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
7780
+ docId?: string | undefined;
7781
+ uploadTtlSec?: number | undefined;
7782
+ uploadPreference?: "auto" | "presigned" | "proxy" | undefined;
7783
+ }>;
7784
+ };
7785
+ readonly responses: {
7786
+ readonly 200: {
7787
+ readonly contentType: "application/json";
7788
+ readonly schema: z.ZodDiscriminatedUnion<"tag", [z.ZodObject<{
7789
+ tag: z.ZodLiteral<"created">;
7790
+ document: z.ZodObject<{
7791
+ id: z.ZodString;
7792
+ tenantId: z.ZodString;
7793
+ state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
7794
+ baseSha: z.ZodNullable<z.ZodString>;
7795
+ storageSizeBytes: z.ZodNullable<z.ZodNumber>;
7796
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7797
+ idempotencyKey: z.ZodNullable<z.ZodString>;
7798
+ failureReason: z.ZodNullable<z.ZodString>;
7799
+ /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
7800
+ thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
7801
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7802
+ createdAt: z.ZodNumber;
7803
+ updatedAt: z.ZodNumber;
7804
+ createdBy: z.ZodNullable<z.ZodString>;
7805
+ }, "strip", z.ZodTypeAny, {
7806
+ id: string;
7807
+ tenantId: string;
7808
+ state: "pending" | "ready" | "failed" | "deleting";
7809
+ baseSha: string | null;
7810
+ storageSizeBytes: number | null;
7811
+ metadata: Record<string, unknown> | null;
7812
+ idempotencyKey: string | null;
7813
+ failureReason: string | null;
7814
+ createdAt: number;
7815
+ updatedAt: number;
7816
+ createdBy: string | null;
7817
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7818
+ thumbnailUrl?: string | null | undefined;
7819
+ }, {
7820
+ id: string;
7821
+ tenantId: string;
7822
+ state: "pending" | "ready" | "failed" | "deleting";
7823
+ baseSha: string | null;
7824
+ storageSizeBytes: number | null;
7825
+ metadata: Record<string, unknown> | null;
7826
+ idempotencyKey: string | null;
7827
+ failureReason: string | null;
7828
+ createdAt: number;
7829
+ updatedAt: number;
7830
+ createdBy: string | null;
7831
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7832
+ thumbnailUrl?: string | null | undefined;
7833
+ }>;
7834
+ upload: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
7835
+ kind: z.ZodLiteral<"presigned">;
7836
+ presigned: z.ZodObject<{
7837
+ url: z.ZodString;
7838
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
7839
+ method: z.ZodLiteral<"PUT">;
7840
+ expiresAt: z.ZodNumber;
7841
+ }, "strip", z.ZodTypeAny, {
7842
+ url: string;
7843
+ headers: Record<string, string>;
7844
+ method: "PUT";
7845
+ expiresAt: number;
7846
+ }, {
7847
+ url: string;
7848
+ headers: Record<string, string>;
7849
+ method: "PUT";
7850
+ expiresAt: number;
7851
+ }>;
7852
+ key: z.ZodString;
7853
+ }, "strip", z.ZodTypeAny, {
7854
+ presigned: {
7855
+ url: string;
7856
+ headers: Record<string, string>;
7857
+ method: "PUT";
7858
+ expiresAt: number;
7859
+ };
7860
+ kind: "presigned";
7861
+ key: string;
7862
+ }, {
7863
+ presigned: {
7864
+ url: string;
7865
+ headers: Record<string, string>;
7866
+ method: "PUT";
7867
+ expiresAt: number;
7868
+ };
7869
+ kind: "presigned";
7870
+ key: string;
7871
+ }>, z.ZodObject<{
7872
+ kind: z.ZodLiteral<"proxy">;
7873
+ url: z.ZodString;
7874
+ key: z.ZodString;
7875
+ }, "strip", z.ZodTypeAny, {
7876
+ url: string;
7877
+ kind: "proxy";
7878
+ key: string;
7879
+ }, {
7880
+ url: string;
7881
+ kind: "proxy";
7882
+ key: string;
7883
+ }>]>;
7884
+ }, "strip", z.ZodTypeAny, {
7885
+ tag: "created";
7886
+ document: {
7887
+ id: string;
7888
+ tenantId: string;
7889
+ state: "pending" | "ready" | "failed" | "deleting";
7890
+ baseSha: string | null;
7891
+ storageSizeBytes: number | null;
7892
+ metadata: Record<string, unknown> | null;
7893
+ idempotencyKey: string | null;
7894
+ failureReason: string | null;
7895
+ createdAt: number;
7896
+ updatedAt: number;
7897
+ createdBy: string | null;
7898
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7899
+ thumbnailUrl?: string | null | undefined;
7900
+ };
7901
+ upload: {
7902
+ presigned: {
7903
+ url: string;
7904
+ headers: Record<string, string>;
7905
+ method: "PUT";
7906
+ expiresAt: number;
7907
+ };
7908
+ kind: "presigned";
7909
+ key: string;
7910
+ } | {
7911
+ url: string;
7912
+ kind: "proxy";
7913
+ key: string;
7914
+ };
7915
+ }, {
7916
+ tag: "created";
7917
+ document: {
7918
+ id: string;
7919
+ tenantId: string;
7920
+ state: "pending" | "ready" | "failed" | "deleting";
7921
+ baseSha: string | null;
7922
+ storageSizeBytes: number | null;
7923
+ metadata: Record<string, unknown> | null;
7924
+ idempotencyKey: string | null;
7925
+ failureReason: string | null;
7926
+ createdAt: number;
7927
+ updatedAt: number;
7928
+ createdBy: string | null;
7929
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7930
+ thumbnailUrl?: string | null | undefined;
7931
+ };
7932
+ upload: {
7933
+ presigned: {
7934
+ url: string;
7935
+ headers: Record<string, string>;
7936
+ method: "PUT";
7937
+ expiresAt: number;
7938
+ };
7939
+ kind: "presigned";
7940
+ key: string;
7941
+ } | {
7942
+ url: string;
7943
+ kind: "proxy";
7944
+ key: string;
7945
+ };
7946
+ }>, z.ZodObject<{
7947
+ tag: z.ZodLiteral<"resumed">;
7175
7948
  document: z.ZodObject<{
7176
7949
  id: z.ZodString;
7177
7950
  tenantId: z.ZodString;
@@ -7258,17 +8031,233 @@ declare const allOperations: {
7258
8031
  url: z.ZodString;
7259
8032
  key: z.ZodString;
7260
8033
  }, "strip", z.ZodTypeAny, {
7261
- url: string;
7262
- kind: "proxy";
7263
- key: string;
7264
- }, {
7265
- url: string;
7266
- kind: "proxy";
7267
- key: string;
7268
- }>]>;
7269
- }, "strip", z.ZodTypeAny, {
7270
- tag: "created";
7271
- document: {
8034
+ url: string;
8035
+ kind: "proxy";
8036
+ key: string;
8037
+ }, {
8038
+ url: string;
8039
+ kind: "proxy";
8040
+ key: string;
8041
+ }>]>;
8042
+ }, "strip", z.ZodTypeAny, {
8043
+ tag: "resumed";
8044
+ document: {
8045
+ id: string;
8046
+ tenantId: string;
8047
+ state: "pending" | "ready" | "failed" | "deleting";
8048
+ baseSha: string | null;
8049
+ storageSizeBytes: number | null;
8050
+ metadata: Record<string, unknown> | null;
8051
+ idempotencyKey: string | null;
8052
+ failureReason: string | null;
8053
+ createdAt: number;
8054
+ updatedAt: number;
8055
+ createdBy: string | null;
8056
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
8057
+ thumbnailUrl?: string | null | undefined;
8058
+ };
8059
+ upload: {
8060
+ presigned: {
8061
+ url: string;
8062
+ headers: Record<string, string>;
8063
+ method: "PUT";
8064
+ expiresAt: number;
8065
+ };
8066
+ kind: "presigned";
8067
+ key: string;
8068
+ } | {
8069
+ url: string;
8070
+ kind: "proxy";
8071
+ key: string;
8072
+ };
8073
+ }, {
8074
+ tag: "resumed";
8075
+ document: {
8076
+ id: string;
8077
+ tenantId: string;
8078
+ state: "pending" | "ready" | "failed" | "deleting";
8079
+ baseSha: string | null;
8080
+ storageSizeBytes: number | null;
8081
+ metadata: Record<string, unknown> | null;
8082
+ idempotencyKey: string | null;
8083
+ failureReason: string | null;
8084
+ createdAt: number;
8085
+ updatedAt: number;
8086
+ createdBy: string | null;
8087
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
8088
+ thumbnailUrl?: string | null | undefined;
8089
+ };
8090
+ upload: {
8091
+ presigned: {
8092
+ url: string;
8093
+ headers: Record<string, string>;
8094
+ method: "PUT";
8095
+ expiresAt: number;
8096
+ };
8097
+ kind: "presigned";
8098
+ key: string;
8099
+ } | {
8100
+ url: string;
8101
+ kind: "proxy";
8102
+ key: string;
8103
+ };
8104
+ }>, z.ZodObject<{
8105
+ tag: z.ZodLiteral<"deduped">;
8106
+ document: z.ZodObject<{
8107
+ id: z.ZodString;
8108
+ tenantId: z.ZodString;
8109
+ state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
8110
+ baseSha: z.ZodNullable<z.ZodString>;
8111
+ storageSizeBytes: z.ZodNullable<z.ZodNumber>;
8112
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8113
+ idempotencyKey: z.ZodNullable<z.ZodString>;
8114
+ failureReason: z.ZodNullable<z.ZodString>;
8115
+ /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
8116
+ thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
8117
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8118
+ createdAt: z.ZodNumber;
8119
+ updatedAt: z.ZodNumber;
8120
+ createdBy: z.ZodNullable<z.ZodString>;
8121
+ }, "strip", z.ZodTypeAny, {
8122
+ id: string;
8123
+ tenantId: string;
8124
+ state: "pending" | "ready" | "failed" | "deleting";
8125
+ baseSha: string | null;
8126
+ storageSizeBytes: number | null;
8127
+ metadata: Record<string, unknown> | null;
8128
+ idempotencyKey: string | null;
8129
+ failureReason: string | null;
8130
+ createdAt: number;
8131
+ updatedAt: number;
8132
+ createdBy: string | null;
8133
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
8134
+ thumbnailUrl?: string | null | undefined;
8135
+ }, {
8136
+ id: string;
8137
+ tenantId: string;
8138
+ state: "pending" | "ready" | "failed" | "deleting";
8139
+ baseSha: string | null;
8140
+ storageSizeBytes: number | null;
8141
+ metadata: Record<string, unknown> | null;
8142
+ idempotencyKey: string | null;
8143
+ failureReason: string | null;
8144
+ createdAt: number;
8145
+ updatedAt: number;
8146
+ createdBy: string | null;
8147
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
8148
+ thumbnailUrl?: string | null | undefined;
8149
+ }>;
8150
+ }, "strip", z.ZodTypeAny, {
8151
+ tag: "deduped";
8152
+ document: {
8153
+ id: string;
8154
+ tenantId: string;
8155
+ state: "pending" | "ready" | "failed" | "deleting";
8156
+ baseSha: string | null;
8157
+ storageSizeBytes: number | null;
8158
+ metadata: Record<string, unknown> | null;
8159
+ idempotencyKey: string | null;
8160
+ failureReason: string | null;
8161
+ createdAt: number;
8162
+ updatedAt: number;
8163
+ createdBy: string | null;
8164
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
8165
+ thumbnailUrl?: string | null | undefined;
8166
+ };
8167
+ }, {
8168
+ tag: "deduped";
8169
+ document: {
8170
+ id: string;
8171
+ tenantId: string;
8172
+ state: "pending" | "ready" | "failed" | "deleting";
8173
+ baseSha: string | null;
8174
+ storageSizeBytes: number | null;
8175
+ metadata: Record<string, unknown> | null;
8176
+ idempotencyKey: string | null;
8177
+ failureReason: string | null;
8178
+ createdAt: number;
8179
+ updatedAt: number;
8180
+ createdBy: string | null;
8181
+ thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
8182
+ thumbnailUrl?: string | null | undefined;
8183
+ };
8184
+ }>]>;
8185
+ };
8186
+ readonly 400: {
8187
+ readonly contentType: "application/json";
8188
+ readonly schema: z.ZodObject<{
8189
+ error: z.ZodObject<{
8190
+ code: z.ZodString;
8191
+ message: z.ZodString;
8192
+ }, "strip", z.ZodTypeAny, {
8193
+ code: string;
8194
+ message: string;
8195
+ }, {
8196
+ code: string;
8197
+ message: string;
8198
+ }>;
8199
+ }, "strip", z.ZodTypeAny, {
8200
+ error: {
8201
+ code: string;
8202
+ message: string;
8203
+ };
8204
+ }, {
8205
+ error: {
8206
+ code: string;
8207
+ message: string;
8208
+ };
8209
+ }>;
8210
+ };
8211
+ };
8212
+ };
8213
+ readonly 'documents.commit': {
8214
+ readonly operationId: "documents.commit";
8215
+ readonly title: "Commit upload";
8216
+ readonly summary: "Finish an upload: verify the SHA-256 and promote the document to ready.";
8217
+ readonly method: "POST";
8218
+ readonly path: "/v1/tenants/:tenantId/documents/:id/commit";
8219
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
8220
+ readonly scope: readonly ["docs.create"];
8221
+ readonly params: z.ZodObject<{
8222
+ tenantId: z.ZodString;
8223
+ id: z.ZodString;
8224
+ }, "strip", z.ZodTypeAny, {
8225
+ id: string;
8226
+ tenantId: string;
8227
+ }, {
8228
+ id: string;
8229
+ tenantId: string;
8230
+ }>;
8231
+ readonly body: {
8232
+ readonly contentType: "application/json";
8233
+ readonly schema: z.ZodObject<{
8234
+ sha256: z.ZodString;
8235
+ }, "strip", z.ZodTypeAny, {
8236
+ sha256: string;
8237
+ }, {
8238
+ sha256: string;
8239
+ }>;
8240
+ };
8241
+ readonly responses: {
8242
+ readonly 200: {
8243
+ readonly contentType: "application/json";
8244
+ readonly schema: z.ZodObject<{
8245
+ document: z.ZodObject<{
8246
+ id: z.ZodString;
8247
+ tenantId: z.ZodString;
8248
+ state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
8249
+ baseSha: z.ZodNullable<z.ZodString>;
8250
+ storageSizeBytes: z.ZodNullable<z.ZodNumber>;
8251
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8252
+ idempotencyKey: z.ZodNullable<z.ZodString>;
8253
+ failureReason: z.ZodNullable<z.ZodString>;
8254
+ /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
8255
+ thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
8256
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8257
+ createdAt: z.ZodNumber;
8258
+ updatedAt: z.ZodNumber;
8259
+ createdBy: z.ZodNullable<z.ZodString>;
8260
+ }, "strip", z.ZodTypeAny, {
7272
8261
  id: string;
7273
8262
  tenantId: string;
7274
8263
  state: "pending" | "ready" | "failed" | "deleting";
@@ -7282,24 +8271,7 @@ declare const allOperations: {
7282
8271
  createdBy: string | null;
7283
8272
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7284
8273
  thumbnailUrl?: string | null | undefined;
7285
- };
7286
- upload: {
7287
- presigned: {
7288
- url: string;
7289
- headers: Record<string, string>;
7290
- method: "PUT";
7291
- expiresAt: number;
7292
- };
7293
- kind: "presigned";
7294
- key: string;
7295
- } | {
7296
- url: string;
7297
- kind: "proxy";
7298
- key: string;
7299
- };
7300
- }, {
7301
- tag: "created";
7302
- document: {
8274
+ }, {
7303
8275
  id: string;
7304
8276
  tenantId: string;
7305
8277
  state: "pending" | "ready" | "failed" | "deleting";
@@ -7313,39 +8285,9 @@ declare const allOperations: {
7313
8285
  createdBy: string | null;
7314
8286
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7315
8287
  thumbnailUrl?: string | null | undefined;
7316
- };
7317
- upload: {
7318
- presigned: {
7319
- url: string;
7320
- headers: Record<string, string>;
7321
- method: "PUT";
7322
- expiresAt: number;
7323
- };
7324
- kind: "presigned";
7325
- key: string;
7326
- } | {
7327
- url: string;
7328
- kind: "proxy";
7329
- key: string;
7330
- };
7331
- }>, z.ZodObject<{
7332
- tag: z.ZodLiteral<"resumed">;
7333
- document: z.ZodObject<{
7334
- id: z.ZodString;
7335
- tenantId: z.ZodString;
7336
- state: z.ZodEnum<["pending", "ready", "failed", "deleting"]>;
7337
- baseSha: z.ZodNullable<z.ZodString>;
7338
- storageSizeBytes: z.ZodNullable<z.ZodNumber>;
7339
- metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7340
- idempotencyKey: z.ZodNullable<z.ZodString>;
7341
- failureReason: z.ZodNullable<z.ZodString>;
7342
- /** Dashboard tile lifecycle. Optional because older servers omit these fields. */
7343
- thumbnailState: z.ZodOptional<z.ZodEnum<["pending", "ready", "locked", "failed"]>>;
7344
- thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7345
- createdAt: z.ZodNumber;
7346
- updatedAt: z.ZodNumber;
7347
- createdBy: z.ZodNullable<z.ZodString>;
7348
- }, "strip", z.ZodTypeAny, {
8288
+ }>;
8289
+ }, "strip", z.ZodTypeAny, {
8290
+ document: {
7349
8291
  id: string;
7350
8292
  tenantId: string;
7351
8293
  state: "pending" | "ready" | "failed" | "deleting";
@@ -7359,7 +8301,9 @@ declare const allOperations: {
7359
8301
  createdBy: string | null;
7360
8302
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7361
8303
  thumbnailUrl?: string | null | undefined;
7362
- }, {
8304
+ };
8305
+ }, {
8306
+ document: {
7363
8307
  id: string;
7364
8308
  tenantId: string;
7365
8309
  state: "pending" | "ready" | "failed" | "deleting";
@@ -7373,121 +8317,273 @@ declare const allOperations: {
7373
8317
  createdBy: string | null;
7374
8318
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7375
8319
  thumbnailUrl?: string | null | undefined;
8320
+ };
8321
+ }>;
8322
+ };
8323
+ readonly 400: {
8324
+ readonly contentType: "application/json";
8325
+ readonly schema: z.ZodObject<{
8326
+ error: z.ZodObject<{
8327
+ code: z.ZodString;
8328
+ message: z.ZodString;
8329
+ }, "strip", z.ZodTypeAny, {
8330
+ code: string;
8331
+ message: string;
8332
+ }, {
8333
+ code: string;
8334
+ message: string;
7376
8335
  }>;
7377
- upload: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
7378
- kind: z.ZodLiteral<"presigned">;
7379
- presigned: z.ZodObject<{
7380
- url: z.ZodString;
7381
- headers: z.ZodRecord<z.ZodString, z.ZodString>;
7382
- method: z.ZodLiteral<"PUT">;
7383
- expiresAt: z.ZodNumber;
7384
- }, "strip", z.ZodTypeAny, {
7385
- url: string;
7386
- headers: Record<string, string>;
7387
- method: "PUT";
7388
- expiresAt: number;
7389
- }, {
7390
- url: string;
7391
- headers: Record<string, string>;
7392
- method: "PUT";
7393
- expiresAt: number;
7394
- }>;
7395
- key: z.ZodString;
8336
+ }, "strip", z.ZodTypeAny, {
8337
+ error: {
8338
+ code: string;
8339
+ message: string;
8340
+ };
8341
+ }, {
8342
+ error: {
8343
+ code: string;
8344
+ message: string;
8345
+ };
8346
+ }>;
8347
+ };
8348
+ readonly 404: {
8349
+ readonly contentType: "application/json";
8350
+ readonly schema: z.ZodObject<{
8351
+ error: z.ZodObject<{
8352
+ code: z.ZodString;
8353
+ message: z.ZodString;
7396
8354
  }, "strip", z.ZodTypeAny, {
7397
- presigned: {
7398
- url: string;
7399
- headers: Record<string, string>;
7400
- method: "PUT";
7401
- expiresAt: number;
7402
- };
7403
- kind: "presigned";
7404
- key: string;
8355
+ code: string;
8356
+ message: string;
7405
8357
  }, {
7406
- presigned: {
7407
- url: string;
7408
- headers: Record<string, string>;
7409
- method: "PUT";
7410
- expiresAt: number;
7411
- };
7412
- kind: "presigned";
7413
- key: string;
7414
- }>, z.ZodObject<{
7415
- kind: z.ZodLiteral<"proxy">;
7416
- url: z.ZodString;
7417
- key: z.ZodString;
8358
+ code: string;
8359
+ message: string;
8360
+ }>;
8361
+ }, "strip", z.ZodTypeAny, {
8362
+ error: {
8363
+ code: string;
8364
+ message: string;
8365
+ };
8366
+ }, {
8367
+ error: {
8368
+ code: string;
8369
+ message: string;
8370
+ };
8371
+ }>;
8372
+ };
8373
+ };
8374
+ };
8375
+ readonly 'documents.uploadProxy': {
8376
+ readonly operationId: "documents.uploadProxy";
8377
+ readonly title: "Upload document through the origin";
8378
+ readonly summary: "Upload a bounded PDF through the API when the initialized transfer kind is proxy.";
8379
+ readonly method: "POST";
8380
+ readonly path: "/v1/tenants/:tenantId/documents/:id/upload-proxy";
8381
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
8382
+ readonly scope: readonly ["docs.create"];
8383
+ readonly params: z.ZodObject<{
8384
+ tenantId: z.ZodString;
8385
+ id: z.ZodString;
8386
+ }, "strip", z.ZodTypeAny, {
8387
+ id: string;
8388
+ tenantId: string;
8389
+ }, {
8390
+ id: string;
8391
+ tenantId: string;
8392
+ }>;
8393
+ readonly body: {
8394
+ readonly contentType: "multipart/form-data";
8395
+ };
8396
+ readonly responses: {
8397
+ readonly 200: {
8398
+ readonly contentType: "application/json";
8399
+ readonly schema: z.ZodObject<{
8400
+ sha256: z.ZodString;
8401
+ }, "strip", z.ZodTypeAny, {
8402
+ sha256: string;
8403
+ }, {
8404
+ sha256: string;
8405
+ }>;
8406
+ };
8407
+ readonly 400: {
8408
+ readonly contentType: "application/json";
8409
+ readonly schema: z.ZodObject<{
8410
+ error: z.ZodObject<{
8411
+ code: z.ZodString;
8412
+ message: z.ZodString;
8413
+ }, "strip", z.ZodTypeAny, {
8414
+ code: string;
8415
+ message: string;
8416
+ }, {
8417
+ code: string;
8418
+ message: string;
8419
+ }>;
8420
+ }, "strip", z.ZodTypeAny, {
8421
+ error: {
8422
+ code: string;
8423
+ message: string;
8424
+ };
8425
+ }, {
8426
+ error: {
8427
+ code: string;
8428
+ message: string;
8429
+ };
8430
+ }>;
8431
+ };
8432
+ readonly 409: {
8433
+ readonly contentType: "application/json";
8434
+ readonly schema: z.ZodObject<{
8435
+ error: z.ZodObject<{
8436
+ code: z.ZodString;
8437
+ message: z.ZodString;
7418
8438
  }, "strip", z.ZodTypeAny, {
7419
- url: string;
7420
- kind: "proxy";
7421
- key: string;
8439
+ code: string;
8440
+ message: string;
7422
8441
  }, {
7423
- url: string;
7424
- kind: "proxy";
7425
- key: string;
7426
- }>]>;
8442
+ code: string;
8443
+ message: string;
8444
+ }>;
7427
8445
  }, "strip", z.ZodTypeAny, {
7428
- tag: "resumed";
7429
- document: {
7430
- id: string;
7431
- tenantId: string;
7432
- state: "pending" | "ready" | "failed" | "deleting";
7433
- baseSha: string | null;
7434
- storageSizeBytes: number | null;
7435
- metadata: Record<string, unknown> | null;
7436
- idempotencyKey: string | null;
7437
- failureReason: string | null;
7438
- createdAt: number;
7439
- updatedAt: number;
7440
- createdBy: string | null;
7441
- thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7442
- thumbnailUrl?: string | null | undefined;
7443
- };
7444
- upload: {
7445
- presigned: {
7446
- url: string;
7447
- headers: Record<string, string>;
7448
- method: "PUT";
7449
- expiresAt: number;
7450
- };
7451
- kind: "presigned";
7452
- key: string;
7453
- } | {
7454
- url: string;
7455
- kind: "proxy";
7456
- key: string;
8446
+ error: {
8447
+ code: string;
8448
+ message: string;
7457
8449
  };
7458
8450
  }, {
7459
- tag: "resumed";
7460
- document: {
7461
- id: string;
7462
- tenantId: string;
7463
- state: "pending" | "ready" | "failed" | "deleting";
7464
- baseSha: string | null;
7465
- storageSizeBytes: number | null;
7466
- metadata: Record<string, unknown> | null;
7467
- idempotencyKey: string | null;
7468
- failureReason: string | null;
7469
- createdAt: number;
7470
- updatedAt: number;
7471
- createdBy: string | null;
7472
- thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7473
- thumbnailUrl?: string | null | undefined;
7474
- };
7475
- upload: {
7476
- presigned: {
7477
- url: string;
7478
- headers: Record<string, string>;
7479
- method: "PUT";
7480
- expiresAt: number;
7481
- };
7482
- kind: "presigned";
7483
- key: string;
7484
- } | {
7485
- url: string;
7486
- kind: "proxy";
7487
- key: string;
8451
+ error: {
8452
+ code: string;
8453
+ message: string;
7488
8454
  };
8455
+ }>;
8456
+ };
8457
+ };
8458
+ readonly notes: "This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available.";
8459
+ };
8460
+ readonly 'documents.importFrom': {
8461
+ readonly operationId: "documents.importFrom";
8462
+ readonly title: "Import document";
8463
+ readonly summary: "Server-side pull: fetch a PDF from a caller-supplied URL (e.g. a presigned object-store GET) or an operator-registered storage connection into CloudPDF-owned storage, verify it, and commit it.";
8464
+ readonly method: "POST";
8465
+ readonly path: "/v1/tenants/:tenantId/documents/import";
8466
+ readonly credentials: readonly ["api-token", "tenant-jwt"];
8467
+ readonly scope: readonly ["docs.create"];
8468
+ readonly params: z.ZodObject<{
8469
+ tenantId: z.ZodString;
8470
+ }, "strip", z.ZodTypeAny, {
8471
+ tenantId: string;
8472
+ }, {
8473
+ tenantId: string;
8474
+ }>;
8475
+ readonly body: {
8476
+ readonly contentType: "application/json";
8477
+ readonly schema: z.ZodObject<{
8478
+ source: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
8479
+ kind: z.ZodLiteral<"url">;
8480
+ url: z.ZodString;
8481
+ }, "strip", z.ZodTypeAny, {
8482
+ url: string;
8483
+ kind: "url";
8484
+ }, {
8485
+ url: string;
8486
+ kind: "url";
7489
8487
  }>, z.ZodObject<{
7490
- tag: z.ZodLiteral<"deduped">;
8488
+ kind: z.ZodLiteral<"connection">;
8489
+ connectionId: z.ZodString;
8490
+ key: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
8491
+ revision: z.ZodOptional<z.ZodString>;
8492
+ }, "strip", z.ZodTypeAny, {
8493
+ kind: "connection";
8494
+ key: string;
8495
+ connectionId: string;
8496
+ revision?: string | undefined;
8497
+ }, {
8498
+ kind: "connection";
8499
+ key: string;
8500
+ connectionId: string;
8501
+ revision?: string | undefined;
8502
+ }>]>;
8503
+ /**
8504
+ * Optional integrity pins, enforced when present: `sizeBytes`
8505
+ * against the source's declared Content-Length before the transfer,
8506
+ * `sha256` against the server-observed digest after it. When absent
8507
+ * the server-observed values become authoritative.
8508
+ * `dedupMode=reuse-existing` REQUIRES `sha256` — without a declared
8509
+ * hash the server cannot know what content to reuse.
8510
+ */
8511
+ expected: z.ZodOptional<z.ZodObject<{
8512
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
8513
+ sha256: z.ZodOptional<z.ZodString>;
8514
+ }, "strip", z.ZodTypeAny, {
8515
+ sha256?: string | undefined;
8516
+ sizeBytes?: number | undefined;
8517
+ }, {
8518
+ sha256?: string | undefined;
8519
+ sizeBytes?: number | undefined;
8520
+ }>>;
8521
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8522
+ idempotencyKey: z.ZodOptional<z.ZodString>;
8523
+ dedupMode: z.ZodOptional<z.ZodEnum<["always-create", "reuse-existing"]>>;
8524
+ docId: z.ZodOptional<z.ZodString>;
8525
+ /**
8526
+ * `sync` (default) holds the response open for the whole transfer.
8527
+ * `async` accepts the request (202, document `pending`), transfers
8528
+ * in the background, and the caller polls the document. Async
8529
+ * requires a `connection` source (URLs are secrets and expire, so
8530
+ * they cannot sit in a durable job); filesystem connections
8531
+ * additionally require `expected.sha256`, since they have no
8532
+ * revisions to pin retries to.
8533
+ */
8534
+ mode: z.ZodOptional<z.ZodEnum<["sync", "async"]>>;
8535
+ }, "strip", z.ZodTypeAny, {
8536
+ source: {
8537
+ url: string;
8538
+ kind: "url";
8539
+ } | {
8540
+ kind: "connection";
8541
+ key: string;
8542
+ connectionId: string;
8543
+ revision?: string | undefined;
8544
+ };
8545
+ expected?: {
8546
+ sha256?: string | undefined;
8547
+ sizeBytes?: number | undefined;
8548
+ } | undefined;
8549
+ metadata?: Record<string, unknown> | undefined;
8550
+ idempotencyKey?: string | undefined;
8551
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
8552
+ docId?: string | undefined;
8553
+ mode?: "sync" | "async" | undefined;
8554
+ }, {
8555
+ source: {
8556
+ url: string;
8557
+ kind: "url";
8558
+ } | {
8559
+ kind: "connection";
8560
+ key: string;
8561
+ connectionId: string;
8562
+ revision?: string | undefined;
8563
+ };
8564
+ expected?: {
8565
+ sha256?: string | undefined;
8566
+ sizeBytes?: number | undefined;
8567
+ } | undefined;
8568
+ metadata?: Record<string, unknown> | undefined;
8569
+ idempotencyKey?: string | undefined;
8570
+ dedupMode?: "always-create" | "reuse-existing" | undefined;
8571
+ docId?: string | undefined;
8572
+ mode?: "sync" | "async" | undefined;
8573
+ }>;
8574
+ };
8575
+ readonly responses: {
8576
+ readonly 200: {
8577
+ readonly contentType: "application/json";
8578
+ readonly schema: z.ZodObject<{
8579
+ /**
8580
+ * `imported` — bytes were pulled, verified, and committed (sync).
8581
+ * `deduped` — an existing document satisfied the request without a
8582
+ * transfer (content dedup or idempotent replay).
8583
+ * `accepted` — async: the job is queued (HTTP 202); poll the
8584
+ * document until `ready` or `failed`.
8585
+ */
8586
+ tag: z.ZodEnum<["imported", "deduped", "accepted"]>;
7491
8587
  document: z.ZodObject<{
7492
8588
  id: z.ZodString;
7493
8589
  tenantId: z.ZodString;
@@ -7533,7 +8629,7 @@ declare const allOperations: {
7533
8629
  thumbnailUrl?: string | null | undefined;
7534
8630
  }>;
7535
8631
  }, "strip", z.ZodTypeAny, {
7536
- tag: "deduped";
8632
+ tag: "deduped" | "imported" | "accepted";
7537
8633
  document: {
7538
8634
  id: string;
7539
8635
  tenantId: string;
@@ -7550,7 +8646,7 @@ declare const allOperations: {
7550
8646
  thumbnailUrl?: string | null | undefined;
7551
8647
  };
7552
8648
  }, {
7553
- tag: "deduped";
8649
+ tag: "deduped" | "imported" | "accepted";
7554
8650
  document: {
7555
8651
  id: string;
7556
8652
  tenantId: string;
@@ -7566,67 +8662,19 @@ declare const allOperations: {
7566
8662
  thumbnailState?: "pending" | "ready" | "failed" | "locked" | undefined;
7567
8663
  thumbnailUrl?: string | null | undefined;
7568
8664
  };
7569
- }>]>;
7570
- };
7571
- readonly 400: {
7572
- readonly contentType: "application/json";
7573
- readonly schema: z.ZodObject<{
7574
- error: z.ZodObject<{
7575
- code: z.ZodString;
7576
- message: z.ZodString;
7577
- }, "strip", z.ZodTypeAny, {
7578
- code: string;
7579
- message: string;
7580
- }, {
7581
- code: string;
7582
- message: string;
7583
- }>;
7584
- }, "strip", z.ZodTypeAny, {
7585
- error: {
7586
- code: string;
7587
- message: string;
7588
- };
7589
- }, {
7590
- error: {
7591
- code: string;
7592
- message: string;
7593
- };
7594
8665
  }>;
7595
8666
  };
7596
- };
7597
- };
7598
- readonly 'documents.commit': {
7599
- readonly operationId: "documents.commit";
7600
- readonly title: "Commit upload";
7601
- readonly summary: "Finish an upload: verify the SHA-256 and promote the document to ready.";
7602
- readonly method: "POST";
7603
- readonly path: "/v1/tenants/:tenantId/documents/:id/commit";
7604
- readonly credentials: readonly ["api-token", "tenant-jwt"];
7605
- readonly scope: readonly ["docs.create"];
7606
- readonly params: z.ZodObject<{
7607
- tenantId: z.ZodString;
7608
- id: z.ZodString;
7609
- }, "strip", z.ZodTypeAny, {
7610
- id: string;
7611
- tenantId: string;
7612
- }, {
7613
- id: string;
7614
- tenantId: string;
7615
- }>;
7616
- readonly body: {
7617
- readonly contentType: "application/json";
7618
- readonly schema: z.ZodObject<{
7619
- sha256: z.ZodString;
7620
- }, "strip", z.ZodTypeAny, {
7621
- sha256: string;
7622
- }, {
7623
- sha256: string;
7624
- }>;
7625
- };
7626
- readonly responses: {
7627
- readonly 200: {
8667
+ readonly 202: {
7628
8668
  readonly contentType: "application/json";
7629
8669
  readonly schema: z.ZodObject<{
8670
+ /**
8671
+ * `imported` — bytes were pulled, verified, and committed (sync).
8672
+ * `deduped` — an existing document satisfied the request without a
8673
+ * transfer (content dedup or idempotent replay).
8674
+ * `accepted` — async: the job is queued (HTTP 202); poll the
8675
+ * document until `ready` or `failed`.
8676
+ */
8677
+ tag: z.ZodEnum<["imported", "deduped", "accepted"]>;
7630
8678
  document: z.ZodObject<{
7631
8679
  id: z.ZodString;
7632
8680
  tenantId: z.ZodString;
@@ -7672,6 +8720,7 @@ declare const allOperations: {
7672
8720
  thumbnailUrl?: string | null | undefined;
7673
8721
  }>;
7674
8722
  }, "strip", z.ZodTypeAny, {
8723
+ tag: "deduped" | "imported" | "accepted";
7675
8724
  document: {
7676
8725
  id: string;
7677
8726
  tenantId: string;
@@ -7688,6 +8737,7 @@ declare const allOperations: {
7688
8737
  thumbnailUrl?: string | null | undefined;
7689
8738
  };
7690
8739
  }, {
8740
+ tag: "deduped" | "imported" | "accepted";
7691
8741
  document: {
7692
8742
  id: string;
7693
8743
  tenantId: string;
@@ -7730,66 +8780,7 @@ declare const allOperations: {
7730
8780
  };
7731
8781
  }>;
7732
8782
  };
7733
- readonly 404: {
7734
- readonly contentType: "application/json";
7735
- readonly schema: z.ZodObject<{
7736
- error: z.ZodObject<{
7737
- code: z.ZodString;
7738
- message: z.ZodString;
7739
- }, "strip", z.ZodTypeAny, {
7740
- code: string;
7741
- message: string;
7742
- }, {
7743
- code: string;
7744
- message: string;
7745
- }>;
7746
- }, "strip", z.ZodTypeAny, {
7747
- error: {
7748
- code: string;
7749
- message: string;
7750
- };
7751
- }, {
7752
- error: {
7753
- code: string;
7754
- message: string;
7755
- };
7756
- }>;
7757
- };
7758
- };
7759
- };
7760
- readonly 'documents.uploadProxy': {
7761
- readonly operationId: "documents.uploadProxy";
7762
- readonly title: "Upload document through the origin";
7763
- readonly summary: "Upload a bounded PDF through the API when the initialized transfer kind is proxy.";
7764
- readonly method: "POST";
7765
- readonly path: "/v1/tenants/:tenantId/documents/:id/upload-proxy";
7766
- readonly credentials: readonly ["api-token", "tenant-jwt"];
7767
- readonly scope: readonly ["docs.create"];
7768
- readonly params: z.ZodObject<{
7769
- tenantId: z.ZodString;
7770
- id: z.ZodString;
7771
- }, "strip", z.ZodTypeAny, {
7772
- id: string;
7773
- tenantId: string;
7774
- }, {
7775
- id: string;
7776
- tenantId: string;
7777
- }>;
7778
- readonly body: {
7779
- readonly contentType: "multipart/form-data";
7780
- };
7781
- readonly responses: {
7782
- readonly 200: {
7783
- readonly contentType: "application/json";
7784
- readonly schema: z.ZodObject<{
7785
- sha256: z.ZodString;
7786
- }, "strip", z.ZodTypeAny, {
7787
- sha256: string;
7788
- }, {
7789
- sha256: string;
7790
- }>;
7791
- };
7792
- readonly 400: {
8783
+ readonly 403: {
7793
8784
  readonly contentType: "application/json";
7794
8785
  readonly schema: z.ZodObject<{
7795
8786
  error: z.ZodObject<{
@@ -7814,7 +8805,7 @@ declare const allOperations: {
7814
8805
  };
7815
8806
  }>;
7816
8807
  };
7817
- readonly 409: {
8808
+ readonly 502: {
7818
8809
  readonly contentType: "application/json";
7819
8810
  readonly schema: z.ZodObject<{
7820
8811
  error: z.ZodObject<{
@@ -7840,7 +8831,7 @@ declare const allOperations: {
7840
8831
  }>;
7841
8832
  };
7842
8833
  };
7843
- readonly notes: "This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available.";
8834
+ readonly notes: "Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id).";
7844
8835
  };
7845
8836
  readonly 'documents.list': {
7846
8837
  readonly operationId: "documents.list";
@@ -9827,4 +10818,4 @@ declare const docsGroups: {
9827
10818
  };
9828
10819
  };
9829
10820
 
9830
- export { ADMIN_DOCUMENT_LIST_DEFAULT_LIMIT, ADMIN_DOCUMENT_LIST_MAX_LIMIT, type AdminCredential, type AdminDocumentCommitRequest, AdminDocumentCommitRequestSchema, type AdminDocumentCommitResponse, AdminDocumentCommitResponseSchema, type AdminDocumentInitRequest, AdminDocumentInitRequestSchema, type AdminDocumentInitResponse, AdminDocumentInitResponseSchema, type AdminDocumentListQuery, AdminDocumentListQuerySchema, type AdminDocumentListResponse, AdminDocumentListResponseSchema, type AdminDocumentRecord, AdminDocumentRecordSchema, type AdminDocumentResponse, AdminDocumentResponseSchema, type AdminErrorPayload, AdminErrorPayloadSchema, type AdminInitUpload, AdminInitUploadSchema, type AdminLicenseStatusResponse, AdminLicenseStatusResponseSchema, type AdminOperation, type AdminOperationBody, type AdminOperationHeader, type AdminOperationId, type AdminOperationMethod, type AdminOperationResponse, type AdminPresignedUpload, AdminPresignedUploadSchema, type AdminTenantCreateRequest, AdminTenantCreateRequestSchema, type AdminTenantCreateResponse, AdminTenantCreateResponseSchema, type AdminTenantDocParams, AdminTenantDocParamsSchema, type AdminTenantJtiParams, AdminTenantJtiParamsSchema, type AdminTenantListQuery, AdminTenantListQuerySchema, type AdminTenantListResponse, AdminTenantListResponseSchema, type AdminTenantParams, AdminTenantParamsSchema, type AdminTenantRecord, AdminTenantRecordSchema, type AdminTenantResponse, AdminTenantResponseSchema, type AdminTenantScope, type AdminTenantShareParams, AdminTenantShareParamsSchema, type AdminThumbnailUnavailablePayload, AdminThumbnailUnavailablePayloadSchema, type AdminTokenIssueDocRequest, AdminTokenIssueDocRequestSchema, type AdminTokenIssueRequest, AdminTokenIssueRequestSchema, type AdminTokenIssueResponse, AdminTokenIssueResponseSchema, type AdminTokenIssueTenantRequest, AdminTokenIssueTenantRequestSchema, type AdminTokenRevokeRequest, AdminTokenRevokeRequestSchema, type AdminUploadProxyResponse, AdminUploadProxyResponseSchema, type DedupMode, DedupModeSchema, DocAnnotationParamsSchema, DocFieldParamsSchema, DocIdParamsSchema, DocLayerParamsSchema, type DocOperationId, DocPageParamsSchema, type DocsGroup, type DocumentState, DocumentStateSchema, type ShareExchangeRequest, ShareExchangeRequestSchema, type ShareGrantCreateRequest, ShareGrantCreateRequestSchema, type ShareGrantListQuery, ShareGrantListQuerySchema, type ShareGrantListResponse, ShareGrantListResponseSchema, type ShareGrantRecord, ShareGrantRecordSchema, type ShareGrantResponse, ShareGrantResponseSchema, type ShareGrantUpdateRequest, ShareGrantUpdateRequestSchema, type ShareSessionResponse, ShareSessionResponseSchema, type TenantSuspendRequest, TenantSuspendRequestSchema, type TenantUsageQuery, TenantUsageQuerySchema, type TenantUsageResponse, TenantUsageResponseSchema, type UploadPreference, UploadPreferenceSchema, adminCredentials, adminOperations, adminTenantScopes, adminWirePaths, allOperations, docOperations, docsGroups, documentPasswordHeader };
10821
+ export { ADMIN_DOCUMENT_LIST_DEFAULT_LIMIT, ADMIN_DOCUMENT_LIST_MAX_LIMIT, type AdminCredential, type AdminDocumentCommitRequest, AdminDocumentCommitRequestSchema, type AdminDocumentCommitResponse, AdminDocumentCommitResponseSchema, type AdminDocumentImportRequest, AdminDocumentImportRequestSchema, type AdminDocumentImportResponse, AdminDocumentImportResponseSchema, type AdminDocumentInitRequest, AdminDocumentInitRequestSchema, type AdminDocumentInitResponse, AdminDocumentInitResponseSchema, type AdminDocumentListQuery, AdminDocumentListQuerySchema, type AdminDocumentListResponse, AdminDocumentListResponseSchema, type AdminDocumentRecord, AdminDocumentRecordSchema, type AdminDocumentResponse, AdminDocumentResponseSchema, type AdminErrorPayload, AdminErrorPayloadSchema, type AdminImportSource, AdminImportSourceSchema, type AdminInitUpload, AdminInitUploadSchema, type AdminLicenseStatusResponse, AdminLicenseStatusResponseSchema, type AdminOperation, type AdminOperationBody, type AdminOperationHeader, type AdminOperationId, type AdminOperationMethod, type AdminOperationResponse, type AdminPresignedUpload, AdminPresignedUploadSchema, type AdminTenantCreateRequest, AdminTenantCreateRequestSchema, type AdminTenantCreateResponse, AdminTenantCreateResponseSchema, type AdminTenantDocParams, AdminTenantDocParamsSchema, type AdminTenantJtiParams, AdminTenantJtiParamsSchema, type AdminTenantListQuery, AdminTenantListQuerySchema, type AdminTenantListResponse, AdminTenantListResponseSchema, type AdminTenantParams, AdminTenantParamsSchema, type AdminTenantRecord, AdminTenantRecordSchema, type AdminTenantResponse, AdminTenantResponseSchema, type AdminTenantScope, type AdminTenantShareParams, AdminTenantShareParamsSchema, type AdminThumbnailUnavailablePayload, AdminThumbnailUnavailablePayloadSchema, type AdminTokenIssueDocRequest, AdminTokenIssueDocRequestSchema, type AdminTokenIssueRequest, AdminTokenIssueRequestSchema, type AdminTokenIssueResponse, AdminTokenIssueResponseSchema, type AdminTokenIssueTenantRequest, AdminTokenIssueTenantRequestSchema, type AdminTokenRevokeRequest, AdminTokenRevokeRequestSchema, type AdminUploadProxyResponse, AdminUploadProxyResponseSchema, type DedupMode, DedupModeSchema, DocAnnotationParamsSchema, DocFieldParamsSchema, DocIdParamsSchema, DocLayerParamsSchema, type DocOperationId, DocPageParamsSchema, type DocsGroup, type DocumentState, DocumentStateSchema, type ShareExchangeRequest, ShareExchangeRequestSchema, type ShareGrantCreateRequest, ShareGrantCreateRequestSchema, type ShareGrantListQuery, ShareGrantListQuerySchema, type ShareGrantListResponse, ShareGrantListResponseSchema, type ShareGrantRecord, ShareGrantRecordSchema, type ShareGrantResponse, ShareGrantResponseSchema, type ShareGrantUpdateRequest, ShareGrantUpdateRequestSchema, type ShareSessionResponse, ShareSessionResponseSchema, type TenantSuspendRequest, TenantSuspendRequestSchema, type TenantUsageQuery, TenantUsageQuerySchema, type TenantUsageResponse, TenantUsageResponseSchema, type UploadPreference, UploadPreferenceSchema, adminCredentials, adminOperations, adminTenantScopes, adminWirePaths, allOperations, docOperations, docsGroups, documentPasswordHeader, tenantIdPattern };