@epilot/file-client 1.23.0 → 1.24.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 +24 -0
- package/dist/openapi.d.ts +2335 -18
- package/dist/openapi.json +262 -4
- package/package.json +5 -8
package/dist/openapi.json
CHANGED
|
@@ -780,6 +780,101 @@
|
|
|
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": true
|
|
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
|
+
},
|
|
783
878
|
"/v1/files/{id}/preview": {
|
|
784
879
|
"get": {
|
|
785
880
|
"operationId": "previewFile",
|
|
@@ -1199,8 +1294,7 @@
|
|
|
1199
1294
|
"get": {
|
|
1200
1295
|
"operationId": "listPublicLinksForFile",
|
|
1201
1296
|
"summary": "listPublicLinksForFile",
|
|
1202
|
-
"description": "
|
|
1203
|
-
"x-not-implemented": true,
|
|
1297
|
+
"description": "Fetches all public links previously generated for a file",
|
|
1204
1298
|
"parameters": [
|
|
1205
1299
|
{
|
|
1206
1300
|
"name": "id",
|
|
@@ -1340,8 +1434,7 @@
|
|
|
1340
1434
|
"delete": {
|
|
1341
1435
|
"operationId": "revokePublicLink",
|
|
1342
1436
|
"summary": "revokePublicLink",
|
|
1343
|
-
"description": "
|
|
1344
|
-
"x-not-implemented": true,
|
|
1437
|
+
"description": "Revokes a given public link by ID",
|
|
1345
1438
|
"parameters": [
|
|
1346
1439
|
{
|
|
1347
1440
|
"name": "id",
|
|
@@ -2378,6 +2471,171 @@
|
|
|
2378
2471
|
]
|
|
2379
2472
|
}
|
|
2380
2473
|
},
|
|
2474
|
+
"CreateZipJobPayload": {
|
|
2475
|
+
"type": "object",
|
|
2476
|
+
"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",
|
|
2477
|
+
"properties": {
|
|
2478
|
+
"file_entity_ids": {
|
|
2479
|
+
"type": "array",
|
|
2480
|
+
"description": "List of file entity IDs to include in the ZIP",
|
|
2481
|
+
"items": {
|
|
2482
|
+
"type": "string",
|
|
2483
|
+
"format": "uuid"
|
|
2484
|
+
},
|
|
2485
|
+
"minItems": 1,
|
|
2486
|
+
"maxItems": 1000,
|
|
2487
|
+
"example": [
|
|
2488
|
+
"ef7d985c-2385-44f4-9c71-ae06a52264f8",
|
|
2489
|
+
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
2490
|
+
]
|
|
2491
|
+
},
|
|
2492
|
+
"entity_query": {
|
|
2493
|
+
"type": "object",
|
|
2494
|
+
"description": "Entity search query used to resolve files to include in the ZIP",
|
|
2495
|
+
"properties": {
|
|
2496
|
+
"q": {
|
|
2497
|
+
"type": "string",
|
|
2498
|
+
"description": "Lucene-style search query (same syntax as entity search)",
|
|
2499
|
+
"example": "_schema:file AND _tags:invoice"
|
|
2500
|
+
},
|
|
2501
|
+
"sort": {
|
|
2502
|
+
"type": "string",
|
|
2503
|
+
"description": "Sort expression forwarded to the entity search",
|
|
2504
|
+
"example": "_created_at:desc"
|
|
2505
|
+
}
|
|
2506
|
+
},
|
|
2507
|
+
"required": [
|
|
2508
|
+
"q"
|
|
2509
|
+
]
|
|
2510
|
+
},
|
|
2511
|
+
"zip_filename": {
|
|
2512
|
+
"type": "string",
|
|
2513
|
+
"description": "Name of the generated ZIP file",
|
|
2514
|
+
"default": "Files.zip",
|
|
2515
|
+
"example": "Documents.zip"
|
|
2516
|
+
},
|
|
2517
|
+
"notify_email": {
|
|
2518
|
+
"type": "boolean",
|
|
2519
|
+
"description": "Send email notification when ZIP is ready",
|
|
2520
|
+
"default": true
|
|
2521
|
+
}
|
|
2522
|
+
},
|
|
2523
|
+
"oneOf": [
|
|
2524
|
+
{
|
|
2525
|
+
"required": [
|
|
2526
|
+
"file_entity_ids"
|
|
2527
|
+
]
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
"required": [
|
|
2531
|
+
"entity_query"
|
|
2532
|
+
]
|
|
2533
|
+
}
|
|
2534
|
+
]
|
|
2535
|
+
},
|
|
2536
|
+
"ZipJob": {
|
|
2537
|
+
"type": "object",
|
|
2538
|
+
"description": "ZIP job status and result",
|
|
2539
|
+
"properties": {
|
|
2540
|
+
"job_id": {
|
|
2541
|
+
"type": "string",
|
|
2542
|
+
"format": "uuid",
|
|
2543
|
+
"description": "Unique identifier for the ZIP job",
|
|
2544
|
+
"example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
|
2545
|
+
},
|
|
2546
|
+
"status": {
|
|
2547
|
+
"type": "string",
|
|
2548
|
+
"description": "Current status of the ZIP job",
|
|
2549
|
+
"enum": [
|
|
2550
|
+
"queued",
|
|
2551
|
+
"downloading",
|
|
2552
|
+
"zipping",
|
|
2553
|
+
"uploading",
|
|
2554
|
+
"sending_notification",
|
|
2555
|
+
"completed",
|
|
2556
|
+
"failed"
|
|
2557
|
+
],
|
|
2558
|
+
"example": "completed"
|
|
2559
|
+
},
|
|
2560
|
+
"progress": {
|
|
2561
|
+
"type": "object",
|
|
2562
|
+
"description": "Progress information for the job",
|
|
2563
|
+
"properties": {
|
|
2564
|
+
"total_files": {
|
|
2565
|
+
"type": "integer",
|
|
2566
|
+
"description": "Total number of files to process",
|
|
2567
|
+
"example": 100
|
|
2568
|
+
},
|
|
2569
|
+
"downloaded_files": {
|
|
2570
|
+
"type": "integer",
|
|
2571
|
+
"description": "Number of files successfully downloaded",
|
|
2572
|
+
"example": 75
|
|
2573
|
+
},
|
|
2574
|
+
"failed_files": {
|
|
2575
|
+
"type": "integer",
|
|
2576
|
+
"description": "Number of files that failed to download",
|
|
2577
|
+
"example": 2
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
},
|
|
2581
|
+
"result": {
|
|
2582
|
+
"type": "object",
|
|
2583
|
+
"description": "Result of the completed ZIP job",
|
|
2584
|
+
"properties": {
|
|
2585
|
+
"file_entity_id": {
|
|
2586
|
+
"type": "string",
|
|
2587
|
+
"format": "uuid",
|
|
2588
|
+
"description": "File entity ID of the generated ZIP",
|
|
2589
|
+
"example": "ef7d985c-2385-44f4-9c71-ae06a52264f8"
|
|
2590
|
+
},
|
|
2591
|
+
"download_url": {
|
|
2592
|
+
"type": "string",
|
|
2593
|
+
"format": "uri",
|
|
2594
|
+
"description": "Presigned download URL (expires in 24 hours)",
|
|
2595
|
+
"example": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/files.zip?X-Amz-..."
|
|
2596
|
+
},
|
|
2597
|
+
"expires_at": {
|
|
2598
|
+
"type": "string",
|
|
2599
|
+
"format": "date-time",
|
|
2600
|
+
"description": "When the download URL expires",
|
|
2601
|
+
"example": "2024-01-02T12:00:00Z"
|
|
2602
|
+
},
|
|
2603
|
+
"zip_size_bytes": {
|
|
2604
|
+
"type": "integer",
|
|
2605
|
+
"description": "Size of the generated ZIP file in bytes",
|
|
2606
|
+
"example": 104857600
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
},
|
|
2610
|
+
"error": {
|
|
2611
|
+
"type": "string",
|
|
2612
|
+
"description": "Error message if job failed",
|
|
2613
|
+
"example": "Failed to download file: access denied"
|
|
2614
|
+
},
|
|
2615
|
+
"created_at": {
|
|
2616
|
+
"type": "string",
|
|
2617
|
+
"format": "date-time",
|
|
2618
|
+
"description": "When the job was created",
|
|
2619
|
+
"example": "2024-01-01T12:00:00Z"
|
|
2620
|
+
},
|
|
2621
|
+
"created_by": {
|
|
2622
|
+
"type": "string",
|
|
2623
|
+
"description": "User ID who created the job",
|
|
2624
|
+
"example": "10234"
|
|
2625
|
+
},
|
|
2626
|
+
"org_id": {
|
|
2627
|
+
"type": "string",
|
|
2628
|
+
"description": "Organization ID",
|
|
2629
|
+
"example": "123"
|
|
2630
|
+
},
|
|
2631
|
+
"updated_at": {
|
|
2632
|
+
"type": "string",
|
|
2633
|
+
"format": "date-time",
|
|
2634
|
+
"description": "When the job was last updated",
|
|
2635
|
+
"example": "2024-01-01T12:05:00Z"
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
},
|
|
2381
2639
|
"VerifyCustomDownloadUrlPayload": {
|
|
2382
2640
|
"type": "object",
|
|
2383
2641
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/file-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.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",
|