@uploadista/client-core 0.0.20-beta.9 → 0.1.0-beta.5
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.mts +9 -11
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/auth/__tests__/auth-http-client.test.ts +55 -8
- package/src/auth/__tests__/direct-auth.test.ts +50 -10
- package/src/auth/__tests__/uploadista-cloud-auth.test.ts +102 -19
- package/src/client/create-uploadista-client.ts +0 -1
- package/src/managers/__tests__/upload-manager.test.ts +1 -1
- package/src/types/previous-upload.ts +18 -5
- package/src/upload/flow-upload-orchestrator.ts +0 -3
- package/src/upload/single-upload.ts +1 -1
- package/src/upload/upload-storage.ts +2 -1
- package/src/utils/__tests__/flow-inputs-builder.test.ts +10 -7
|
@@ -23,7 +23,10 @@ describe("buildFlowInputs", () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
it("builds init operation for Blob input", () => {
|
|
26
|
-
const blob = new Blob(["content"], {
|
|
26
|
+
const blob = new Blob(["content"], {
|
|
27
|
+
type: "application/json",
|
|
28
|
+
lastModified: 0,
|
|
29
|
+
});
|
|
27
30
|
const result = buildFlowInputs({ "blob-node": blob }, storageId);
|
|
28
31
|
|
|
29
32
|
expect(result["blob-node"]).toMatchObject({
|
|
@@ -40,7 +43,7 @@ describe("buildFlowInputs", () => {
|
|
|
40
43
|
const file = new File(["content"], "", { type: "text/plain" });
|
|
41
44
|
const result = buildFlowInputs({ node: file }, storageId);
|
|
42
45
|
|
|
43
|
-
expect(result
|
|
46
|
+
expect(result.node).toMatchObject({
|
|
44
47
|
metadata: {
|
|
45
48
|
originalName: "",
|
|
46
49
|
},
|
|
@@ -51,7 +54,7 @@ describe("buildFlowInputs", () => {
|
|
|
51
54
|
const file = new File(["content"], "test.txt");
|
|
52
55
|
const result = buildFlowInputs({ node: file }, storageId);
|
|
53
56
|
|
|
54
|
-
expect(result
|
|
57
|
+
expect(result.node).toMatchObject({
|
|
55
58
|
metadata: {
|
|
56
59
|
mimeType: "",
|
|
57
60
|
},
|
|
@@ -150,11 +153,11 @@ describe("buildFlowInputs", () => {
|
|
|
150
153
|
const file2 = new File(["content2"], "file2.txt");
|
|
151
154
|
const result = buildFlowInputs({ node1: file1, node2: file2 }, storageId);
|
|
152
155
|
|
|
153
|
-
expect(result
|
|
156
|
+
expect(result.node1).toMatchObject({
|
|
154
157
|
operation: "init",
|
|
155
158
|
metadata: { originalName: "file1.txt" },
|
|
156
159
|
});
|
|
157
|
-
expect(result
|
|
160
|
+
expect(result.node2).toMatchObject({
|
|
158
161
|
operation: "init",
|
|
159
162
|
metadata: { originalName: "file2.txt" },
|
|
160
163
|
});
|
|
@@ -206,7 +209,7 @@ describe("buildFlowInputs", () => {
|
|
|
206
209
|
const file = new File(["content"], "test.txt");
|
|
207
210
|
const result = buildFlowInputs({ node: file }, "custom-storage");
|
|
208
211
|
|
|
209
|
-
expect(result
|
|
212
|
+
expect(result.node).toMatchObject({
|
|
210
213
|
storageId: "custom-storage",
|
|
211
214
|
});
|
|
212
215
|
});
|
|
@@ -215,7 +218,7 @@ describe("buildFlowInputs", () => {
|
|
|
215
218
|
const url = "https://example.com/file.jpg";
|
|
216
219
|
const result = buildFlowInputs({ node: url }, "custom-storage");
|
|
217
220
|
|
|
218
|
-
expect(result
|
|
221
|
+
expect(result.node).toMatchObject({
|
|
219
222
|
storageId: "custom-storage",
|
|
220
223
|
});
|
|
221
224
|
});
|