@uploadista/client-core 0.0.20-beta.5 → 0.0.20-beta.7

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.
@@ -1,16 +1,16 @@
1
1
  export {
2
- MockAbortController,
3
- MockAbortControllerFactory,
4
- MockBase64Service,
5
- MockChecksumService,
6
- MockFileReaderService,
7
- MockFingerprintService,
8
- MockHttpClient,
9
- type MockHttpResponseConfig,
10
- MockIdGenerationService,
11
- MockPlatformService,
12
- MockStorageService,
13
- MockWebSocket,
14
- MockWebSocketFactory,
15
- createMockServiceContainer,
2
+ createMockServiceContainer,
3
+ MockAbortController,
4
+ MockAbortControllerFactory,
5
+ MockBase64Service,
6
+ MockChecksumService,
7
+ MockFileReaderService,
8
+ MockFingerprintService,
9
+ MockHttpClient,
10
+ type MockHttpResponseConfig,
11
+ MockIdGenerationService,
12
+ MockPlatformService,
13
+ MockStorageService,
14
+ MockWebSocket,
15
+ MockWebSocketFactory,
16
16
  } from "./mock-service-container";
@@ -20,10 +20,7 @@ import type {
20
20
  HttpResponse,
21
21
  } from "../services/http-client";
22
22
  import type { IdGenerationService } from "../services/id-generation-service";
23
- import type {
24
- PlatformService,
25
- Timeout,
26
- } from "../services/platform-service";
23
+ import type { PlatformService, Timeout } from "../services/platform-service";
27
24
  import type { ServiceContainer } from "../services/service-container";
28
25
  import type { StorageService } from "../services/storage-service";
29
26
  import type {
@@ -121,7 +118,9 @@ export class MockHttpClient implements HttpClient {
121
118
 
122
119
  // Simulate network delay if configured
123
120
  if (config.delay) {
124
- await new Promise<void>((resolve) => setTimeout(() => resolve(), config.delay ?? 0));
121
+ await new Promise<void>((resolve) =>
122
+ setTimeout(() => resolve(), config.delay ?? 0),
123
+ );
125
124
  }
126
125
 
127
126
  // Create mock headers
@@ -1,15 +1,15 @@
1
1
  export * from "./chunk-metrics";
2
+ export * from "./flow-inputs";
2
3
  export * from "./flow-result";
3
4
  export * from "./flow-upload-config";
4
5
  export * from "./flow-upload-item";
5
6
  export * from "./flow-upload-options";
6
- export * from "./flow-inputs";
7
7
  export * from "./multi-flow-upload-options";
8
8
  export * from "./multi-flow-upload-state";
9
9
  export * from "./performance-insights";
10
10
  export * from "./previous-upload";
11
- export * from "./upload-options";
12
11
  export * from "./upload-metrics";
12
+ export * from "./upload-options";
13
13
  export * from "./upload-response";
14
14
  export * from "./upload-result";
15
15
  export * from "./upload-session-metrics";
@@ -1,3 +1,3 @@
1
+ export * from "./flow-upload-orchestrator";
1
2
  export * from "./upload-metrics";
2
3
  export * from "./upload-utils";
3
- export * from "./flow-upload-orchestrator";
@@ -38,7 +38,7 @@ describe("buildFlowInputs", () => {
38
38
 
39
39
  it("handles File without name", () => {
40
40
  const file = new File(["content"], "", { type: "text/plain" });
41
- const result = buildFlowInputs({ "node": file }, storageId);
41
+ const result = buildFlowInputs({ node: file }, storageId);
42
42
 
43
43
  expect(result["node"]).toMatchObject({
44
44
  metadata: {
@@ -49,7 +49,7 @@ describe("buildFlowInputs", () => {
49
49
 
50
50
  it("handles File without type", () => {
51
51
  const file = new File(["content"], "test.txt");
52
- const result = buildFlowInputs({ "node": file }, storageId);
52
+ const result = buildFlowInputs({ node: file }, storageId);
53
53
 
54
54
  expect(result["node"]).toMatchObject({
55
55
  metadata: {
@@ -148,10 +148,7 @@ describe("buildFlowInputs", () => {
148
148
  it("handles two file inputs", () => {
149
149
  const file1 = new File(["content1"], "file1.txt");
150
150
  const file2 = new File(["content2"], "file2.txt");
151
- const result = buildFlowInputs(
152
- { "node1": file1, "node2": file2 },
153
- storageId,
154
- );
151
+ const result = buildFlowInputs({ node1: file1, node2: file2 }, storageId);
155
152
 
156
153
  expect(result["node1"]).toMatchObject({
157
154
  operation: "init",
@@ -207,7 +204,7 @@ describe("buildFlowInputs", () => {
207
204
 
208
205
  it("uses provided storageId for file operations", () => {
209
206
  const file = new File(["content"], "test.txt");
210
- const result = buildFlowInputs({ "node": file }, "custom-storage");
207
+ const result = buildFlowInputs({ node: file }, "custom-storage");
211
208
 
212
209
  expect(result["node"]).toMatchObject({
213
210
  storageId: "custom-storage",
@@ -216,7 +213,7 @@ describe("buildFlowInputs", () => {
216
213
 
217
214
  it("uses provided storageId for URL operations", () => {
218
215
  const url = "https://example.com/file.jpg";
219
- const result = buildFlowInputs({ "node": url }, "custom-storage");
216
+ const result = buildFlowInputs({ node: url }, "custom-storage");
220
217
 
221
218
  expect(result["node"]).toMatchObject({
222
219
  storageId: "custom-storage",
@@ -1,5 +1,5 @@
1
- import { inputTypeRegistry } from "@uploadista/core/flow";
2
1
  import type { Flow } from "@uploadista/core/flow";
2
+ import { inputTypeRegistry } from "@uploadista/core/flow";
3
3
  import { beforeAll, describe, expect, it } from "vitest";
4
4
  import { z } from "zod";
5
5
  import { UploadistaError } from "../../error";
@@ -62,7 +62,8 @@ export function buildFlowInputs(
62
62
  "type" in file && typeof file.type === "string"
63
63
  ? file.type
64
64
  : "application/octet-stream",
65
- size: "size" in file && typeof file.size === "number" ? file.size : 0,
65
+ size:
66
+ "size" in file && typeof file.size === "number" ? file.size : 0,
66
67
  };
67
68
 
68
69
  flowInputs[nodeId] = {
@@ -4,6 +4,6 @@
4
4
  * @module utils
5
5
  */
6
6
 
7
- export * from "./input-detection";
8
7
  export * from "./flow-inputs-builder";
8
+ export * from "./input-detection";
9
9
  export * from "./input-validation";