@muhgholy/next-drive 4.4.0 → 4.6.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/README.md +116 -30
- package/dist/{chunk-ZNXH3LYN.cjs → chunk-I3AR7V7Z.cjs} +182 -5
- package/dist/chunk-I3AR7V7Z.cjs.map +1 -0
- package/dist/{chunk-5CAP2MNG.js → chunk-UT2XCOS7.js} +182 -5
- package/dist/chunk-UT2XCOS7.js.map +1 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/server/express.cjs +11 -11
- package/dist/server/express.js +2 -2
- package/dist/server/index.cjs +13 -13
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/utils.d.ts +21 -0
- package/dist/server/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-5CAP2MNG.js.map +0 -1
- package/dist/chunk-ZNXH3LYN.cjs.map +0 -1
package/dist/server/express.cjs
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkI3AR7V7Z_cjs = require('../chunk-I3AR7V7Z.cjs');
|
|
4
4
|
require('../chunk-TA6L5FYG.cjs');
|
|
5
5
|
|
|
6
6
|
// src/server/express.ts
|
|
7
|
-
var driveAPIHandlerExpress =
|
|
8
|
-
var driveConfigurationExpress =
|
|
7
|
+
var driveAPIHandlerExpress = chunkI3AR7V7Z_cjs.driveAPIHandler;
|
|
8
|
+
var driveConfigurationExpress = chunkI3AR7V7Z_cjs.driveConfiguration;
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "driveDelete", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveDelete; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "driveFilePath", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveFilePath; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "driveFileSchemaZod", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveFileSchemaZod; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "driveGetUrl", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveGetUrl; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "driveList", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveList; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "driveReadFile", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveReadFile; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "driveUpload", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveUpload; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "getDriveConfig", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkI3AR7V7Z_cjs.getDriveConfig; }
|
|
41
41
|
});
|
|
42
42
|
exports.driveAPIHandlerExpress = driveAPIHandlerExpress;
|
|
43
43
|
exports.driveConfigurationExpress = driveConfigurationExpress;
|
package/dist/server/express.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { driveAPIHandler, driveConfiguration } from '../chunk-
|
|
2
|
-
export { driveDelete, driveFilePath, driveFileSchemaZod, driveGetUrl, driveList, driveReadFile, driveUpload, getDriveConfig } from '../chunk-
|
|
1
|
+
import { driveAPIHandler, driveConfiguration } from '../chunk-UT2XCOS7.js';
|
|
2
|
+
export { driveDelete, driveFilePath, driveFileSchemaZod, driveGetUrl, driveList, driveReadFile, driveUpload, getDriveConfig } from '../chunk-UT2XCOS7.js';
|
|
3
3
|
import '../chunk-TMSG5WJZ.js';
|
|
4
4
|
|
|
5
5
|
// src/server/express.ts
|
package/dist/server/index.cjs
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkI3AR7V7Z_cjs = require('../chunk-I3AR7V7Z.cjs');
|
|
4
4
|
var chunkTA6L5FYG_cjs = require('../chunk-TA6L5FYG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "driveAPIHandler", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveAPIHandler; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "driveConfiguration", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveConfiguration; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "driveDelete", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveDelete; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "driveFilePath", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveFilePath; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "driveFileSchemaZod", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveFileSchemaZod; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "driveGetUrl", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveGetUrl; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "driveInfo", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveInfo; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "driveList", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveList; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "driveReadFile", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveReadFile; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "driveUpload", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkI3AR7V7Z_cjs.driveUpload; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "getDriveConfig", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkI3AR7V7Z_cjs.getDriveConfig; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "getDriveInformation", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkI3AR7V7Z_cjs.getDriveInformation; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "driveCreateUrl", {
|
|
57
57
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAQ5D,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAQ5D,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA+F1F,eAAO,MAAM,eAAe,GAAU,KAAK,cAAc,EAAE,KAAK,eAAe,KAAG,OAAO,CAAC,IAAI,CAy2B7F,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvI,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpE,mBAAmB,gBAAgB,CAAC"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { driveAPIHandler, driveConfiguration, driveDelete, driveFilePath, driveFileSchemaZod, driveGetUrl, driveInfo, driveList, driveReadFile, driveUpload, getDriveConfig, getDriveInformation } from '../chunk-
|
|
1
|
+
export { driveAPIHandler, driveConfiguration, driveDelete, driveFilePath, driveFileSchemaZod, driveGetUrl, driveInfo, driveList, driveReadFile, driveUpload, getDriveConfig, getDriveInformation } from '../chunk-UT2XCOS7.js';
|
|
2
2
|
export { driveCreateUrl } from '../chunk-TMSG5WJZ.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/server/utils.d.ts
CHANGED
|
@@ -10,4 +10,25 @@ export declare const extractImageMetadata: (filePath: string) => Promise<{
|
|
|
10
10
|
} | null>;
|
|
11
11
|
export declare const formatFileSize: (bytes: number) => string;
|
|
12
12
|
export declare const ownerMatches: (a: Record<string, unknown> | null, b: Record<string, unknown> | null) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Image optimization settings returned by getImageSettings
|
|
15
|
+
*/
|
|
16
|
+
export interface ImageSettings {
|
|
17
|
+
quality: number;
|
|
18
|
+
effort: number;
|
|
19
|
+
pngCompression: number;
|
|
20
|
+
width?: number;
|
|
21
|
+
height?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Calculates all image optimization settings based on file size, quality, display, and size.
|
|
25
|
+
*
|
|
26
|
+
* @param fileSizeInBytes - Original file size in bytes
|
|
27
|
+
* @param qualityPreset - Quality preset ('low', 'medium', 'high') or number (1-100)
|
|
28
|
+
* @param display - Display context preset for quality adjustment
|
|
29
|
+
* @param size - Size preset for dimensions
|
|
30
|
+
* @returns Complete image settings including quality, effort, and optional dimensions
|
|
31
|
+
*/
|
|
32
|
+
export declare const getImageSettings: (fileSizeInBytes: number | undefined, qualityPreset: string | undefined, display: string | undefined, size: string | undefined) => ImageSettings;
|
|
33
|
+
export declare const getQualitySettings: (fileSizeInBytes: number | undefined, qualityPreset: string | undefined) => ImageSettings;
|
|
13
34
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/server/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,OAA8F,CAAC;AAE9I,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,EAAE,KAAG,OAUvE,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI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