feat: return file hash from uploaded object #4640
ci.yaml
on: pull_request
Matrix: analyze-bundle
bundle-analyze-result
41s
Annotations
15 errors
typecheck
Object literal may only specify known properties, and 'hash' does not exist in type '{ readonly name: string; readonly size: number; readonly type: string; readonly lastModified?: number | undefined; readonly customId: string | null; readonly key: string; readonly url: string; readonly appUrl: string; readonly fileHash: string; }'.
|
typecheck
Object literal may only specify known properties, and 'hash' does not exist in type '{ readonly name: string; readonly size: number; readonly type: string; readonly lastModified?: number | undefined; readonly customId: string | null; readonly key: string; readonly url: string; readonly appUrl: string; readonly fileHash: string; }'.
|
typecheck
Object literal may only specify known properties, and 'hash' does not exist in type '{ readonly name: string; readonly size: number; readonly type: string; readonly lastModified?: number | undefined; readonly customId: string | null; readonly key: string; readonly url: string; readonly appUrl: string; readonly fileHash: string; }'.
|
typecheck
uploadthing#typecheck: command (/home/runner/work/uploadthing/uploadthing/packages/uploadthing) /home/runner/setup-pnpm/node_modules/.bin/pnpm run typecheck exited (2)
|
typecheck
Process completed with exit code 2.
|
test/client.test.ts > uploadFiles > uploads file using presigned PUT:
packages/uploadthing/test/client.test.ts#L124
AssertionError: expected [ { name: 'foo.txt', size: 3, …(8) } ] to deeply equal [ { name: 'foo.txt', size: 3, …(8) } ]
- Expected
+ Received
Array [
Object {
"appUrl": StringMatching /^https:\/\/utfs.io\/a\/app-1\/.+$/,
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "foo.txt",
"serverData": null,
"size": 3,
"type": "text/plain",
"url": StringMatching /^https:\/\/utfs.io\/f\/.+$/,
},
]
❯ test/client.test.ts:124:5
|
test/client.test.ts > uploadFiles > sends custom headers if set (static object):
packages/uploadthing/test/client.test.ts#L163
AssertionError: expected [ { name: 'foo.txt', size: 3, …(8) } ] to deeply equal [ { name: 'foo.txt', size: 3, …(8) } ]
- Expected
+ Received
Array [
Object {
"appUrl": StringMatching /^https:\/\/utfs.io\/a\/app-1\/.+$/,
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "foo.txt",
"serverData": null,
"size": 3,
"type": "text/plain",
"url": StringMatching /^https:\/\/utfs.io\/f\/.+$/,
},
]
❯ test/client.test.ts:163:5
|
test/client.test.ts > uploadFiles > sends custom headers if set (async function):
packages/uploadthing/test/client.test.ts#L198
AssertionError: expected [ { name: 'foo.txt', size: 3, …(8) } ] to deeply equal [ { name: 'foo.txt', size: 3, …(8) } ]
- Expected
+ Received
Array [
Object {
"appUrl": StringMatching /^https:\/\/utfs.io\/a\/app-1\/.+$/,
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "foo.txt",
"serverData": null,
"size": 3,
"type": "text/plain",
"url": StringMatching /^https:\/\/utfs.io\/f\/.+$/,
},
]
❯ test/client.test.ts:198:5
|
test/sdk.test.ts > uploadFiles > uploads successfully:
packages/uploadthing/test/sdk.test.ts#L47
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { data: { …(9) }, error: null }
- Expected
+ Received
Object {
"data": Object {
"appUrl": "https://utfs.io/a/app-1/u7rKiJYp268sZJMShtU2yCm18BzgAcp7P94kZtnx5wfsQdRG",
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": 1727385224809,
"name": "foo.txt",
"size": 3,
"type": "text/plain",
"url": "https://utfs.io/f/u7rKiJYp268sZJMShtU2yCm18BzgAcp7P94kZtnx5wfsQdRG",
},
"error": null,
}
❯ test/sdk.test.ts:47:20
|
test/sdk.test.ts > uploadFilesFromUrl > downloads, then uploads successfully:
packages/uploadthing/test/sdk.test.ts#L130
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { data: { …(9) }, error: null }
- Expected
+ Received
Object {
"data": Object {
"appUrl": "https://utfs.io/a/app-1/u7rKiJYp268sb6uTXWLYP6fDTeGNFuc7gC9W3QjBiZzoVlsO",
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "foo.txt",
"size": 26,
"type": "text/plain",
"url": "https://utfs.io/f/u7rKiJYp268sb6uTXWLYP6fDTeGNFuc7gC9W3QjBiZzoVlsO",
},
"error": null,
}
❯ test/sdk.test.ts:130:20
|
test/sdk.test.ts > uploadFilesFromUrl > preserves order if some download fails:
packages/uploadthing/test/sdk.test.ts#L229
AssertionError: expected [ …(3) ] to strictly equal [ …(3) ]
- Expected
+ Received
Array [
Object {
"data": Object {
"appUrl": "https://utfs.io/a/app-1/u7rKiJYp268sjeymNZ7OjbtucJRUAwfKWPMIia42lhsDp8E7",
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "foo.txt",
"size": 26,
"type": "text/plain",
"url": "https://utfs.io/f/u7rKiJYp268sjeymNZ7OjbtucJRUAwfKWPMIia42lhsDp8E7",
},
"error": null,
},
Object {
"data": null,
"error": Object {
"code": "BAD_REQUEST",
"data": undefined,
"message": "Please use uploadFiles() for data URLs. uploadFilesFromUrl() is intended for use with remote URLs only.",
},
},
Object {
"data": Object {
"appUrl": "https://utfs.io/a/app-1/u7rKiJYp268sgLiKPHUBLFCRHQVvwWhJKrOTfobGBcSMtzD6",
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "bar.txt",
"size": 26,
"type": "text/plain",
"url": "https://utfs.io/f/u7rKiJYp268sgLiKPHUBLFCRHQVvwWhJKrOTfobGBcSMtzD6",
},
"error": null,
},
]
❯ test/sdk.test.ts:229:20
|
test/sdk.test.ts > smoke test with live api > should upload a file:
packages/uploadthing/test/sdk.test.ts#L470
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) }
- Expected
+ Received
Object {
"data": Object {
"appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/,
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": 1727385226577,
"name": "foo.txt",
"size": 3,
"type": "text/plain",
"url": StringMatching /^https:\/\/utfs.io\/f\/.+$/,
},
"error": null,
}
❯ test/sdk.test.ts:470:22
|
test/sdk.test.ts > smoke test with live api > should upload a private file:
packages/uploadthing/test/sdk.test.ts#L506
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) }
- Expected
+ Received
Object {
"data": Object {
"appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/,
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": 1727385228683,
"name": "foo.txt",
"size": 3,
"type": "text/plain",
"url": StringMatching /^https:\/\/utfs.io\/f\/.+$/,
},
"error": null,
}
❯ test/sdk.test.ts:506:22
|
test/sdk.test.ts > smoke test with live api > should upload a file from a url:
packages/uploadthing/test/sdk.test.ts#L537
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) }
- Expected
+ Received
Object {
"data": Object {
"appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/,
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "favicon.ico",
"size": Any<Number>,
"type": "image/vnd.microsoft.icon",
"url": StringMatching /^https:\/\/utfs.io\/f\/.+$/,
},
"error": null,
}
❯ test/sdk.test.ts:537:22
|
test/sdk.test.ts > smoke test with live api > should rename a file with fileKey:
packages/uploadthing/test/sdk.test.ts#L562
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) }
- Expected
+ Received
Object {
"data": Object {
"appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/,
"customId": null,
- "hash": Any<String>,
+ "fileHash": undefined,
"key": StringMatching /.+/,
"lastModified": Any<Number>,
"name": "bar.txt",
"size": 3,
"type": "text/plain",
"url": StringMatching /^https:\/\/utfs.io\/f\/.+$/,
},
"error": null,
}
❯ test/sdk.test.ts:562:22
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
bundle-current-pr
Expired
|
45 KB |
|
bundle-main
Expired
|
45 KB |
|