@tus/gcs-store
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
import http from 'node:http'; | ||
import { Upload, DataStore } from '@tus/server'; | ||
import { Upload, DataStore } from '@tus/utils'; | ||
type Options = { | ||
@@ -9,0 +9,0 @@ bucket: Bucket; |
@@ -9,6 +9,5 @@ "use strict"; | ||
const debug_1 = __importDefault(require("debug")); | ||
const server_1 = require("@tus/server"); | ||
const server_2 = require("@tus/server"); | ||
const utils_1 = require("@tus/utils"); | ||
const log = (0, debug_1.default)('tus-node-server:stores:gcsstore'); | ||
class GCSStore extends server_2.DataStore { | ||
class GCSStore extends utils_1.DataStore { | ||
constructor(options) { | ||
@@ -25,3 +24,3 @@ super(); | ||
if (!file.id) { | ||
reject(server_1.ERRORS.FILE_NOT_FOUND); | ||
reject(utils_1.ERRORS.FILE_NOT_FOUND); | ||
return; | ||
@@ -33,3 +32,3 @@ } | ||
metadata: { | ||
tus_version: server_1.TUS_RESUMABLE, | ||
tus_version: utils_1.TUS_RESUMABLE, | ||
size: file.size, | ||
@@ -70,3 +69,3 @@ sizeIsDeferred: `${file.sizeIsDeferred}`, | ||
metadata: { | ||
tus_version: server_1.TUS_RESUMABLE, | ||
tus_version: utils_1.TUS_RESUMABLE, | ||
size: upload.size, | ||
@@ -81,3 +80,3 @@ sizeIsDeferred: `${upload.sizeIsDeferred}`, | ||
if (!write_stream || readable.destroyed) { | ||
reject(server_1.ERRORS.FILE_WRITE_ERROR); | ||
reject(utils_1.ERRORS.FILE_WRITE_ERROR); | ||
return; | ||
@@ -96,3 +95,3 @@ } | ||
finally { | ||
reject(server_1.ERRORS.FILE_WRITE_ERROR); | ||
reject(utils_1.ERRORS.FILE_WRITE_ERROR); | ||
} | ||
@@ -114,3 +113,3 @@ } | ||
log(error); | ||
reject(server_1.ERRORS.FILE_WRITE_ERROR); | ||
reject(utils_1.ERRORS.FILE_WRITE_ERROR); | ||
} | ||
@@ -125,3 +124,3 @@ } | ||
if (!id) { | ||
reject(server_1.ERRORS.FILE_NOT_FOUND); | ||
reject(utils_1.ERRORS.FILE_NOT_FOUND); | ||
return; | ||
@@ -132,3 +131,3 @@ } | ||
if (error && error.code === 404) { | ||
return reject(server_1.ERRORS.FILE_NOT_FOUND); | ||
return reject(utils_1.ERRORS.FILE_NOT_FOUND); | ||
} | ||
@@ -140,3 +139,3 @@ if (error) { | ||
const { size, metadata: meta } = metadata.metadata; | ||
return resolve(new server_2.Upload({ | ||
return resolve(new utils_1.Upload({ | ||
id, | ||
@@ -143,0 +142,0 @@ size: size ? Number.parseInt(size, 10) : size, |
{ | ||
"$schema": "https://json.schemastore.org/package.json", | ||
"name": "@tus/gcs-store", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Google Cloud Storage for @tus/server", | ||
@@ -24,2 +24,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@tus/utils": "workspace:*", | ||
"debug": "^4.3.4" | ||
@@ -29,3 +30,3 @@ }, | ||
"@google-cloud/storage": "^6.12.0", | ||
"@tus/server": "^1.2.0", | ||
"@tus/server": "workspace:^", | ||
"@types/debug": "^4.1.12", | ||
@@ -35,3 +36,3 @@ "@types/mocha": "^10.0.6", | ||
"eslint": "^8.56.0", | ||
"eslint-config-custom": "0.0.0", | ||
"eslint-config-custom": "workspace:*", | ||
"mocha": "^10.2.0", | ||
@@ -42,4 +43,3 @@ "should": "^13.2.3", | ||
"peerDependencies": { | ||
"@google-cloud/storage": "*", | ||
"@tus/server": "^1.2.0" | ||
"@google-cloud/storage": "*" | ||
}, | ||
@@ -49,2 +49,2 @@ "engines": { | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11532
168
+ Added@tus/utils@workspace:*
- Removed@redis/client@1.6.0(transitive)
- Removed@tus/server@1.9.0(transitive)
- Removed@tus/utils@0.4.0(transitive)
- Removedcluster-key-slot@1.1.2(transitive)
- Removedgeneric-pool@3.9.0(transitive)
- Removedlodash.throttle@4.1.1(transitive)
- Removedyallist@4.0.0(transitive)