@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/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "CloudPDF Engine API",
5
- "version": "3.0.0-next.5",
5
+ "version": "3.0.0-next.6",
6
6
  "description": "The backend-callable surface of the CloudPDF document engine: deployment and tenant administration plus the document operations (reads, annotations, forms, page operations, redaction, download). Interactive viewing goes through the CloudPDF viewer SDKs, whose session protocol is deliberately not part of this API. Generated from the @cloudpdf/contract operation registry — do not edit by hand.",
7
7
  "license": {
8
8
  "name": "Apache-2.0",
@@ -2835,6 +2835,108 @@
2835
2835
  }
2836
2836
  }
2837
2837
  },
2838
+ "/v1/tenants/{tenantId}/documents/import": {
2839
+ "post": {
2840
+ "operationId": "documents.importFrom",
2841
+ "x-fern-sdk-group-name": ["documents"],
2842
+ "x-fern-sdk-method-name": "importFrom",
2843
+ "x-docs-title": "Import document",
2844
+ "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.",
2845
+ "description": "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).",
2846
+ "security": [
2847
+ {
2848
+ "apiToken": []
2849
+ },
2850
+ {
2851
+ "tenantToken": []
2852
+ }
2853
+ ],
2854
+ "x-required-scope": ["docs.create"],
2855
+ "parameters": [
2856
+ {
2857
+ "name": "tenantId",
2858
+ "in": "path",
2859
+ "required": true,
2860
+ "schema": {
2861
+ "type": "string",
2862
+ "pattern": "^[A-Za-z0-9_-]+$"
2863
+ }
2864
+ }
2865
+ ],
2866
+ "requestBody": {
2867
+ "required": true,
2868
+ "content": {
2869
+ "application/json": {
2870
+ "schema": {
2871
+ "$ref": "#/components/schemas/DocumentsImportFromRequest"
2872
+ }
2873
+ }
2874
+ }
2875
+ },
2876
+ "responses": {
2877
+ "200": {
2878
+ "description": "OK",
2879
+ "content": {
2880
+ "application/json": {
2881
+ "schema": {
2882
+ "$ref": "#/components/schemas/DocumentsImportFrom200Response"
2883
+ }
2884
+ }
2885
+ }
2886
+ },
2887
+ "202": {
2888
+ "description": "Response",
2889
+ "content": {
2890
+ "application/json": {
2891
+ "schema": {
2892
+ "$ref": "#/components/schemas/DocumentsImportFrom202Response"
2893
+ }
2894
+ }
2895
+ }
2896
+ },
2897
+ "400": {
2898
+ "description": "Bad request",
2899
+ "content": {
2900
+ "application/json": {
2901
+ "schema": {
2902
+ "$ref": "#/components/schemas/DocumentsImportFrom400Response"
2903
+ }
2904
+ }
2905
+ }
2906
+ },
2907
+ "403": {
2908
+ "description": "Forbidden",
2909
+ "content": {
2910
+ "application/json": {
2911
+ "schema": {
2912
+ "$ref": "#/components/schemas/DocumentsImportFrom403Response"
2913
+ }
2914
+ }
2915
+ }
2916
+ },
2917
+ "502": {
2918
+ "description": "Response",
2919
+ "content": {
2920
+ "application/json": {
2921
+ "schema": {
2922
+ "$ref": "#/components/schemas/DocumentsImportFrom502Response"
2923
+ }
2924
+ }
2925
+ }
2926
+ },
2927
+ "default": {
2928
+ "description": "Error",
2929
+ "content": {
2930
+ "application/json": {
2931
+ "schema": {
2932
+ "$ref": "#/components/schemas/AdminErrorPayload"
2933
+ }
2934
+ }
2935
+ }
2936
+ }
2937
+ }
2938
+ }
2939
+ },
2838
2940
  "/v1/tenants/{tenantId}/documents/init": {
2839
2941
  "post": {
2840
2942
  "operationId": "documents.init",
@@ -4393,6 +4495,309 @@
4393
4495
  "required": ["error"],
4394
4496
  "additionalProperties": false
4395
4497
  },
4498
+ "DocumentsImportFromRequest": {
4499
+ "type": "object",
4500
+ "properties": {
4501
+ "source": {
4502
+ "anyOf": [
4503
+ {
4504
+ "type": "object",
4505
+ "properties": {
4506
+ "kind": {
4507
+ "type": "string",
4508
+ "enum": ["url"]
4509
+ },
4510
+ "url": {
4511
+ "type": "string",
4512
+ "format": "uri",
4513
+ "maxLength": 8192
4514
+ }
4515
+ },
4516
+ "required": ["kind", "url"],
4517
+ "additionalProperties": false
4518
+ },
4519
+ {
4520
+ "type": "object",
4521
+ "properties": {
4522
+ "kind": {
4523
+ "type": "string",
4524
+ "enum": ["connection"]
4525
+ },
4526
+ "connectionId": {
4527
+ "type": "string",
4528
+ "minLength": 1,
4529
+ "maxLength": 128
4530
+ },
4531
+ "key": {
4532
+ "type": "string",
4533
+ "minLength": 1
4534
+ },
4535
+ "revision": {
4536
+ "type": "string",
4537
+ "minLength": 1,
4538
+ "maxLength": 1024
4539
+ }
4540
+ },
4541
+ "required": ["kind", "connectionId", "key"],
4542
+ "additionalProperties": false
4543
+ }
4544
+ ]
4545
+ },
4546
+ "expected": {
4547
+ "type": "object",
4548
+ "properties": {
4549
+ "sizeBytes": {
4550
+ "type": "integer",
4551
+ "minimum": 1
4552
+ },
4553
+ "sha256": {
4554
+ "type": "string",
4555
+ "pattern": "^[0-9a-f]{64}$"
4556
+ }
4557
+ },
4558
+ "additionalProperties": false
4559
+ },
4560
+ "metadata": {
4561
+ "type": "object",
4562
+ "additionalProperties": {}
4563
+ },
4564
+ "idempotencyKey": {
4565
+ "type": "string"
4566
+ },
4567
+ "dedupMode": {
4568
+ "type": "string",
4569
+ "enum": ["always-create", "reuse-existing"]
4570
+ },
4571
+ "docId": {
4572
+ "type": "string",
4573
+ "pattern": "^[A-Za-z0-9_-]+$"
4574
+ },
4575
+ "mode": {
4576
+ "type": "string",
4577
+ "enum": ["sync", "async"]
4578
+ }
4579
+ },
4580
+ "required": ["source"],
4581
+ "additionalProperties": false
4582
+ },
4583
+ "DocumentsImportFrom200Response": {
4584
+ "type": "object",
4585
+ "properties": {
4586
+ "tag": {
4587
+ "type": "string",
4588
+ "enum": ["imported", "deduped", "accepted"]
4589
+ },
4590
+ "document": {
4591
+ "type": "object",
4592
+ "properties": {
4593
+ "id": {
4594
+ "type": "string"
4595
+ },
4596
+ "tenantId": {
4597
+ "type": "string"
4598
+ },
4599
+ "state": {
4600
+ "type": "string",
4601
+ "enum": ["pending", "ready", "failed", "deleting"]
4602
+ },
4603
+ "baseSha": {
4604
+ "type": "string",
4605
+ "nullable": true
4606
+ },
4607
+ "storageSizeBytes": {
4608
+ "type": "number",
4609
+ "nullable": true
4610
+ },
4611
+ "metadata": {
4612
+ "type": "object",
4613
+ "additionalProperties": {},
4614
+ "nullable": true
4615
+ },
4616
+ "idempotencyKey": {
4617
+ "type": "string",
4618
+ "nullable": true
4619
+ },
4620
+ "failureReason": {
4621
+ "type": "string",
4622
+ "nullable": true
4623
+ },
4624
+ "thumbnailState": {
4625
+ "type": "string",
4626
+ "enum": ["pending", "ready", "locked", "failed"]
4627
+ },
4628
+ "thumbnailUrl": {
4629
+ "type": "string",
4630
+ "nullable": true
4631
+ },
4632
+ "createdAt": {
4633
+ "type": "number"
4634
+ },
4635
+ "updatedAt": {
4636
+ "type": "number"
4637
+ },
4638
+ "createdBy": {
4639
+ "type": "string",
4640
+ "nullable": true
4641
+ }
4642
+ },
4643
+ "required": [
4644
+ "id",
4645
+ "tenantId",
4646
+ "state",
4647
+ "baseSha",
4648
+ "storageSizeBytes",
4649
+ "metadata",
4650
+ "idempotencyKey",
4651
+ "failureReason",
4652
+ "createdAt",
4653
+ "updatedAt",
4654
+ "createdBy"
4655
+ ],
4656
+ "additionalProperties": false
4657
+ }
4658
+ },
4659
+ "required": ["tag", "document"],
4660
+ "additionalProperties": false
4661
+ },
4662
+ "DocumentsImportFrom202Response": {
4663
+ "type": "object",
4664
+ "properties": {
4665
+ "tag": {
4666
+ "type": "string",
4667
+ "enum": ["imported", "deduped", "accepted"]
4668
+ },
4669
+ "document": {
4670
+ "type": "object",
4671
+ "properties": {
4672
+ "id": {
4673
+ "type": "string"
4674
+ },
4675
+ "tenantId": {
4676
+ "type": "string"
4677
+ },
4678
+ "state": {
4679
+ "type": "string",
4680
+ "enum": ["pending", "ready", "failed", "deleting"]
4681
+ },
4682
+ "baseSha": {
4683
+ "type": "string",
4684
+ "nullable": true
4685
+ },
4686
+ "storageSizeBytes": {
4687
+ "type": "number",
4688
+ "nullable": true
4689
+ },
4690
+ "metadata": {
4691
+ "type": "object",
4692
+ "additionalProperties": {},
4693
+ "nullable": true
4694
+ },
4695
+ "idempotencyKey": {
4696
+ "type": "string",
4697
+ "nullable": true
4698
+ },
4699
+ "failureReason": {
4700
+ "type": "string",
4701
+ "nullable": true
4702
+ },
4703
+ "thumbnailState": {
4704
+ "type": "string",
4705
+ "enum": ["pending", "ready", "locked", "failed"]
4706
+ },
4707
+ "thumbnailUrl": {
4708
+ "type": "string",
4709
+ "nullable": true
4710
+ },
4711
+ "createdAt": {
4712
+ "type": "number"
4713
+ },
4714
+ "updatedAt": {
4715
+ "type": "number"
4716
+ },
4717
+ "createdBy": {
4718
+ "type": "string",
4719
+ "nullable": true
4720
+ }
4721
+ },
4722
+ "required": [
4723
+ "id",
4724
+ "tenantId",
4725
+ "state",
4726
+ "baseSha",
4727
+ "storageSizeBytes",
4728
+ "metadata",
4729
+ "idempotencyKey",
4730
+ "failureReason",
4731
+ "createdAt",
4732
+ "updatedAt",
4733
+ "createdBy"
4734
+ ],
4735
+ "additionalProperties": false
4736
+ }
4737
+ },
4738
+ "required": ["tag", "document"],
4739
+ "additionalProperties": false
4740
+ },
4741
+ "DocumentsImportFrom400Response": {
4742
+ "type": "object",
4743
+ "properties": {
4744
+ "error": {
4745
+ "type": "object",
4746
+ "properties": {
4747
+ "code": {
4748
+ "type": "string"
4749
+ },
4750
+ "message": {
4751
+ "type": "string"
4752
+ }
4753
+ },
4754
+ "required": ["code", "message"],
4755
+ "additionalProperties": false
4756
+ }
4757
+ },
4758
+ "required": ["error"],
4759
+ "additionalProperties": false
4760
+ },
4761
+ "DocumentsImportFrom403Response": {
4762
+ "type": "object",
4763
+ "properties": {
4764
+ "error": {
4765
+ "type": "object",
4766
+ "properties": {
4767
+ "code": {
4768
+ "type": "string"
4769
+ },
4770
+ "message": {
4771
+ "type": "string"
4772
+ }
4773
+ },
4774
+ "required": ["code", "message"],
4775
+ "additionalProperties": false
4776
+ }
4777
+ },
4778
+ "required": ["error"],
4779
+ "additionalProperties": false
4780
+ },
4781
+ "DocumentsImportFrom502Response": {
4782
+ "type": "object",
4783
+ "properties": {
4784
+ "error": {
4785
+ "type": "object",
4786
+ "properties": {
4787
+ "code": {
4788
+ "type": "string"
4789
+ },
4790
+ "message": {
4791
+ "type": "string"
4792
+ }
4793
+ },
4794
+ "required": ["code", "message"],
4795
+ "additionalProperties": false
4796
+ }
4797
+ },
4798
+ "required": ["error"],
4799
+ "additionalProperties": false
4800
+ },
4396
4801
  "DocumentsList200Response": {
4397
4802
  "type": "object",
4398
4803
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudpdf/contract",
3
- "version": "3.0.0-next.5",
3
+ "version": "3.0.0-next.6",
4
4
  "private": false,
5
5
  "description": "The CloudPDF engine contract: operation registry, Zod schemas, and OpenAPI emitter for every backend-callable surface — used by @cloudpdf/server and the generated @cloudpdf/sdk, and the source of the committed openapi.json.",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "zod": "^3.23.8",
44
44
  "zod-to-json-schema": "^3.24.6",
45
- "@embedpdf/engine-core": "3.0.0-next.5"
45
+ "@embedpdf/engine-core": "3.0.0-next.6"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "latest",