@epilot/file-client 1.23.0 → 1.25.0
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/client.d.ts +1 -1
- package/dist/definition.js +1 -1
- package/dist/openapi-runtime.json +37 -0
- package/dist/openapi.d.ts +2475 -18
- package/dist/openapi.json +346 -4
- package/package.json +5 -8
package/dist/openapi.json
CHANGED
|
@@ -780,6 +780,149 @@
|
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
782
|
},
|
|
783
|
+
"/v1/files:zipJob": {
|
|
784
|
+
"post": {
|
|
785
|
+
"operationId": "createZipJob",
|
|
786
|
+
"summary": "createZipJob",
|
|
787
|
+
"description": "Create a background job to ZIP multiple files and send a download link via email.\n\nFor bulk downloads of more than 50 files, use this async endpoint instead of client-side zipping.\nThe job will:\n1. Download all requested files from S3\n2. Create a ZIP archive\n3. Upload the ZIP to temporary storage\n4. Send an email notification with the download link\n\nThe ZIP file will be available for 7 days.\n",
|
|
788
|
+
"tags": [
|
|
789
|
+
"File"
|
|
790
|
+
],
|
|
791
|
+
"requestBody": {
|
|
792
|
+
"content": {
|
|
793
|
+
"application/json": {
|
|
794
|
+
"schema": {
|
|
795
|
+
"$ref": "#/components/schemas/CreateZipJobPayload"
|
|
796
|
+
},
|
|
797
|
+
"examples": {
|
|
798
|
+
"Zip multiple files": {
|
|
799
|
+
"value": {
|
|
800
|
+
"file_entity_ids": [
|
|
801
|
+
"ef7d985c-2385-44f4-9c71-ae06a52264f8",
|
|
802
|
+
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
803
|
+
],
|
|
804
|
+
"zip_filename": "Documents.zip",
|
|
805
|
+
"notify_email": "user@example.com"
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
"responses": {
|
|
813
|
+
"202": {
|
|
814
|
+
"description": "Job created, processing in background",
|
|
815
|
+
"content": {
|
|
816
|
+
"application/json": {
|
|
817
|
+
"schema": {
|
|
818
|
+
"$ref": "#/components/schemas/ZipJob"
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
},
|
|
823
|
+
"400": {
|
|
824
|
+
"$ref": "#/components/responses/BadRequestError"
|
|
825
|
+
},
|
|
826
|
+
"401": {
|
|
827
|
+
"$ref": "#/components/responses/UnauthorizedError"
|
|
828
|
+
},
|
|
829
|
+
"500": {
|
|
830
|
+
"$ref": "#/components/responses/InternalServerError"
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
"/v1/files:zipJob/{job_id}": {
|
|
836
|
+
"get": {
|
|
837
|
+
"operationId": "getZipJob",
|
|
838
|
+
"summary": "getZipJob",
|
|
839
|
+
"description": "Get the status of a ZIP job",
|
|
840
|
+
"tags": [
|
|
841
|
+
"File"
|
|
842
|
+
],
|
|
843
|
+
"parameters": [
|
|
844
|
+
{
|
|
845
|
+
"name": "job_id",
|
|
846
|
+
"in": "path",
|
|
847
|
+
"required": true,
|
|
848
|
+
"description": "The UUID of the ZIP job",
|
|
849
|
+
"schema": {
|
|
850
|
+
"type": "string",
|
|
851
|
+
"format": "uuid"
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
],
|
|
855
|
+
"responses": {
|
|
856
|
+
"200": {
|
|
857
|
+
"description": "ZIP job status",
|
|
858
|
+
"content": {
|
|
859
|
+
"application/json": {
|
|
860
|
+
"schema": {
|
|
861
|
+
"$ref": "#/components/schemas/ZipJob"
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
"401": {
|
|
867
|
+
"$ref": "#/components/responses/UnauthorizedError"
|
|
868
|
+
},
|
|
869
|
+
"404": {
|
|
870
|
+
"$ref": "#/components/responses/NotFoundError"
|
|
871
|
+
},
|
|
872
|
+
"500": {
|
|
873
|
+
"$ref": "#/components/responses/InternalServerError"
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
"/v1/files/{id}/summary:generate": {
|
|
879
|
+
"post": {
|
|
880
|
+
"operationId": "generateFileSummary",
|
|
881
|
+
"summary": "generateFileSummary",
|
|
882
|
+
"description": "Request AI generation of preview and short summaries for a file entity.",
|
|
883
|
+
"tags": [
|
|
884
|
+
"File"
|
|
885
|
+
],
|
|
886
|
+
"parameters": [
|
|
887
|
+
{
|
|
888
|
+
"name": "id",
|
|
889
|
+
"in": "path",
|
|
890
|
+
"required": true,
|
|
891
|
+
"description": "The UUID of the file entity",
|
|
892
|
+
"schema": {
|
|
893
|
+
"$ref": "#/components/schemas/FileEntityId"
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
],
|
|
897
|
+
"responses": {
|
|
898
|
+
"202": {
|
|
899
|
+
"description": "Summary generation accepted",
|
|
900
|
+
"content": {
|
|
901
|
+
"application/json": {
|
|
902
|
+
"schema": {
|
|
903
|
+
"$ref": "#/components/schemas/FileSummaryGenerationStatus"
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
"400": {
|
|
909
|
+
"$ref": "#/components/responses/BadRequestError"
|
|
910
|
+
},
|
|
911
|
+
"401": {
|
|
912
|
+
"$ref": "#/components/responses/UnauthorizedError"
|
|
913
|
+
},
|
|
914
|
+
"403": {
|
|
915
|
+
"$ref": "#/components/responses/ForbiddenError"
|
|
916
|
+
},
|
|
917
|
+
"404": {
|
|
918
|
+
"$ref": "#/components/responses/NotFoundError"
|
|
919
|
+
},
|
|
920
|
+
"500": {
|
|
921
|
+
"$ref": "#/components/responses/InternalServerError"
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
},
|
|
783
926
|
"/v1/files/{id}/preview": {
|
|
784
927
|
"get": {
|
|
785
928
|
"operationId": "previewFile",
|
|
@@ -1199,8 +1342,7 @@
|
|
|
1199
1342
|
"get": {
|
|
1200
1343
|
"operationId": "listPublicLinksForFile",
|
|
1201
1344
|
"summary": "listPublicLinksForFile",
|
|
1202
|
-
"description": "
|
|
1203
|
-
"x-not-implemented": true,
|
|
1345
|
+
"description": "Fetches all public links previously generated for a file",
|
|
1204
1346
|
"parameters": [
|
|
1205
1347
|
{
|
|
1206
1348
|
"name": "id",
|
|
@@ -1340,8 +1482,7 @@
|
|
|
1340
1482
|
"delete": {
|
|
1341
1483
|
"operationId": "revokePublicLink",
|
|
1342
1484
|
"summary": "revokePublicLink",
|
|
1343
|
-
"description": "
|
|
1344
|
-
"x-not-implemented": true,
|
|
1485
|
+
"description": "Revokes a given public link by ID",
|
|
1345
1486
|
"parameters": [
|
|
1346
1487
|
{
|
|
1347
1488
|
"name": "id",
|
|
@@ -2020,6 +2161,19 @@
|
|
|
2020
2161
|
},
|
|
2021
2162
|
"custom_download_url": {
|
|
2022
2163
|
"$ref": "#/components/schemas/CustomDownloadUrl"
|
|
2164
|
+
},
|
|
2165
|
+
"preview_summary": {
|
|
2166
|
+
"type": "string",
|
|
2167
|
+
"description": "AI-generated compact summary for hover and list preview surfaces.",
|
|
2168
|
+
"readOnly": true
|
|
2169
|
+
},
|
|
2170
|
+
"short_summary": {
|
|
2171
|
+
"type": "string",
|
|
2172
|
+
"description": "AI-generated short paragraph summary for file preview surfaces.",
|
|
2173
|
+
"readOnly": true
|
|
2174
|
+
},
|
|
2175
|
+
"summary_status": {
|
|
2176
|
+
"$ref": "#/components/schemas/FileSummaryStatus"
|
|
2023
2177
|
}
|
|
2024
2178
|
}
|
|
2025
2179
|
},
|
|
@@ -2040,6 +2194,28 @@
|
|
|
2040
2194
|
"unknown"
|
|
2041
2195
|
]
|
|
2042
2196
|
},
|
|
2197
|
+
"FileSummaryStatus": {
|
|
2198
|
+
"type": "string",
|
|
2199
|
+
"description": "Current AI summary generation state for the file.",
|
|
2200
|
+
"enum": [
|
|
2201
|
+
"processing",
|
|
2202
|
+
"completed",
|
|
2203
|
+
"failed",
|
|
2204
|
+
"unsupported"
|
|
2205
|
+
],
|
|
2206
|
+
"readOnly": true
|
|
2207
|
+
},
|
|
2208
|
+
"FileSummaryGenerationStatus": {
|
|
2209
|
+
"type": "object",
|
|
2210
|
+
"properties": {
|
|
2211
|
+
"status": {
|
|
2212
|
+
"$ref": "#/components/schemas/FileSummaryStatus"
|
|
2213
|
+
}
|
|
2214
|
+
},
|
|
2215
|
+
"required": [
|
|
2216
|
+
"status"
|
|
2217
|
+
]
|
|
2218
|
+
},
|
|
2043
2219
|
"CustomDownloadUrl": {
|
|
2044
2220
|
"description": "Custom external download url used for the file",
|
|
2045
2221
|
"type": "string",
|
|
@@ -2378,6 +2554,172 @@
|
|
|
2378
2554
|
]
|
|
2379
2555
|
}
|
|
2380
2556
|
},
|
|
2557
|
+
"CreateZipJobPayload": {
|
|
2558
|
+
"type": "object",
|
|
2559
|
+
"description": "Request payload to create a ZIP job for bulk file download.\nProvide either an explicit list of `file_entity_ids` (up to 1000) or an\n`entity_query` that resolves to file entities (up to 10000).\n",
|
|
2560
|
+
"properties": {
|
|
2561
|
+
"file_entity_ids": {
|
|
2562
|
+
"type": "array",
|
|
2563
|
+
"description": "List of file entity IDs to include in the ZIP",
|
|
2564
|
+
"items": {
|
|
2565
|
+
"type": "string",
|
|
2566
|
+
"format": "uuid"
|
|
2567
|
+
},
|
|
2568
|
+
"minItems": 1,
|
|
2569
|
+
"maxItems": 1000,
|
|
2570
|
+
"example": [
|
|
2571
|
+
"ef7d985c-2385-44f4-9c71-ae06a52264f8",
|
|
2572
|
+
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
2573
|
+
]
|
|
2574
|
+
},
|
|
2575
|
+
"entity_query": {
|
|
2576
|
+
"type": "object",
|
|
2577
|
+
"description": "Entity search query used to resolve files to include in the ZIP",
|
|
2578
|
+
"properties": {
|
|
2579
|
+
"q": {
|
|
2580
|
+
"type": "string",
|
|
2581
|
+
"description": "Lucene-style search query (same syntax as entity search)",
|
|
2582
|
+
"example": "_schema:file AND _tags:invoice"
|
|
2583
|
+
},
|
|
2584
|
+
"sort": {
|
|
2585
|
+
"type": "string",
|
|
2586
|
+
"description": "Sort expression forwarded to the entity search",
|
|
2587
|
+
"example": "_created_at:desc"
|
|
2588
|
+
}
|
|
2589
|
+
},
|
|
2590
|
+
"required": [
|
|
2591
|
+
"q"
|
|
2592
|
+
]
|
|
2593
|
+
},
|
|
2594
|
+
"zip_filename": {
|
|
2595
|
+
"type": "string",
|
|
2596
|
+
"description": "Name of the generated ZIP file",
|
|
2597
|
+
"default": "Files.zip",
|
|
2598
|
+
"example": "Documents.zip"
|
|
2599
|
+
},
|
|
2600
|
+
"notify_email": {
|
|
2601
|
+
"type": "string",
|
|
2602
|
+
"format": "email",
|
|
2603
|
+
"description": "Email address to notify when the ZIP is ready. Omit to skip the email notification.",
|
|
2604
|
+
"example": "user@example.com"
|
|
2605
|
+
}
|
|
2606
|
+
},
|
|
2607
|
+
"oneOf": [
|
|
2608
|
+
{
|
|
2609
|
+
"required": [
|
|
2610
|
+
"file_entity_ids"
|
|
2611
|
+
]
|
|
2612
|
+
},
|
|
2613
|
+
{
|
|
2614
|
+
"required": [
|
|
2615
|
+
"entity_query"
|
|
2616
|
+
]
|
|
2617
|
+
}
|
|
2618
|
+
]
|
|
2619
|
+
},
|
|
2620
|
+
"ZipJob": {
|
|
2621
|
+
"type": "object",
|
|
2622
|
+
"description": "ZIP job status and result",
|
|
2623
|
+
"properties": {
|
|
2624
|
+
"job_id": {
|
|
2625
|
+
"type": "string",
|
|
2626
|
+
"format": "uuid",
|
|
2627
|
+
"description": "Unique identifier for the ZIP job",
|
|
2628
|
+
"example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
2629
|
+
},
|
|
2630
|
+
"status": {
|
|
2631
|
+
"type": "string",
|
|
2632
|
+
"description": "Current status of the ZIP job",
|
|
2633
|
+
"enum": [
|
|
2634
|
+
"queued",
|
|
2635
|
+
"downloading",
|
|
2636
|
+
"zipping",
|
|
2637
|
+
"uploading",
|
|
2638
|
+
"sending_notification",
|
|
2639
|
+
"completed",
|
|
2640
|
+
"failed"
|
|
2641
|
+
],
|
|
2642
|
+
"example": "completed"
|
|
2643
|
+
},
|
|
2644
|
+
"progress": {
|
|
2645
|
+
"type": "object",
|
|
2646
|
+
"description": "Progress information for the job",
|
|
2647
|
+
"properties": {
|
|
2648
|
+
"total_files": {
|
|
2649
|
+
"type": "integer",
|
|
2650
|
+
"description": "Total number of files to process",
|
|
2651
|
+
"example": 100
|
|
2652
|
+
},
|
|
2653
|
+
"downloaded_files": {
|
|
2654
|
+
"type": "integer",
|
|
2655
|
+
"description": "Number of files successfully downloaded",
|
|
2656
|
+
"example": 75
|
|
2657
|
+
},
|
|
2658
|
+
"failed_files": {
|
|
2659
|
+
"type": "integer",
|
|
2660
|
+
"description": "Number of files that failed to download",
|
|
2661
|
+
"example": 2
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
},
|
|
2665
|
+
"result": {
|
|
2666
|
+
"type": "object",
|
|
2667
|
+
"description": "Result of the completed ZIP job",
|
|
2668
|
+
"properties": {
|
|
2669
|
+
"file_entity_id": {
|
|
2670
|
+
"type": "string",
|
|
2671
|
+
"format": "uuid",
|
|
2672
|
+
"description": "File entity ID of the generated ZIP",
|
|
2673
|
+
"example": "ef7d985c-2385-44f4-9c71-ae06a52264f8"
|
|
2674
|
+
},
|
|
2675
|
+
"download_url": {
|
|
2676
|
+
"type": "string",
|
|
2677
|
+
"format": "uri",
|
|
2678
|
+
"description": "Presigned download URL (expires in 24 hours)",
|
|
2679
|
+
"example": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/files.zip?X-Amz-..."
|
|
2680
|
+
},
|
|
2681
|
+
"expires_at": {
|
|
2682
|
+
"type": "string",
|
|
2683
|
+
"format": "date-time",
|
|
2684
|
+
"description": "When the download URL expires",
|
|
2685
|
+
"example": "2024-01-02T12:00:00Z"
|
|
2686
|
+
},
|
|
2687
|
+
"zip_size_bytes": {
|
|
2688
|
+
"type": "integer",
|
|
2689
|
+
"description": "Size of the generated ZIP file in bytes",
|
|
2690
|
+
"example": 104857600
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
},
|
|
2694
|
+
"error": {
|
|
2695
|
+
"type": "string",
|
|
2696
|
+
"description": "Error message if job failed",
|
|
2697
|
+
"example": "Failed to download file: access denied"
|
|
2698
|
+
},
|
|
2699
|
+
"created_at": {
|
|
2700
|
+
"type": "string",
|
|
2701
|
+
"format": "date-time",
|
|
2702
|
+
"description": "When the job was created",
|
|
2703
|
+
"example": "2024-01-01T12:00:00Z"
|
|
2704
|
+
},
|
|
2705
|
+
"created_by": {
|
|
2706
|
+
"type": "string",
|
|
2707
|
+
"description": "User ID who created the job",
|
|
2708
|
+
"example": "10234"
|
|
2709
|
+
},
|
|
2710
|
+
"org_id": {
|
|
2711
|
+
"type": "string",
|
|
2712
|
+
"description": "Organization ID",
|
|
2713
|
+
"example": "123"
|
|
2714
|
+
},
|
|
2715
|
+
"updated_at": {
|
|
2716
|
+
"type": "string",
|
|
2717
|
+
"format": "date-time",
|
|
2718
|
+
"description": "When the job was last updated",
|
|
2719
|
+
"example": "2024-01-01T12:05:00Z"
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
},
|
|
2381
2723
|
"VerifyCustomDownloadUrlPayload": {
|
|
2382
2724
|
"type": "object",
|
|
2383
2725
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/file-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Client library for the epilot File API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"private": false,
|
|
10
10
|
"scripts": {
|
|
11
|
-
"test": "
|
|
11
|
+
"test": "vitest",
|
|
12
12
|
"typescript": "tsc",
|
|
13
13
|
"bundle-definition": "webpack",
|
|
14
14
|
"openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/file.yaml",
|
|
15
|
-
"typegen": "openapi typegen src/openapi.json --client
|
|
15
|
+
"typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
|
|
16
16
|
"build": "tsc && npm run build:patch && npm run bundle-definition",
|
|
17
17
|
"build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
|
|
18
18
|
"build:watch": "npm run build && tsc -w",
|
|
19
19
|
"prepublishOnly": "npm run typegen && npm run build",
|
|
20
|
-
"lint": "
|
|
20
|
+
"lint": "biome check src"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
@@ -58,13 +58,10 @@
|
|
|
58
58
|
"util": "^0.12.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/jest": "^26.0.20",
|
|
62
61
|
"axios": "^1.11.0",
|
|
63
62
|
"copy-webpack-plugin": "^7.0.0",
|
|
64
|
-
"jest": "^29.6.2",
|
|
65
63
|
"json-loader": "^0.5.7",
|
|
66
|
-
"openapicmd": "^2.
|
|
67
|
-
"ts-jest": "^29.4.1",
|
|
64
|
+
"openapicmd": "^2.9.2",
|
|
68
65
|
"ts-loader": "^8.0.14",
|
|
69
66
|
"ts-node": "^10.9.1",
|
|
70
67
|
"typescript": "^4.1.3",
|