@muhgholy/next-drive 4.20.0 → 4.21.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/dist/server/hono.cjs +45 -0
- package/dist/server/hono.cjs.map +1 -0
- package/dist/server/hono.d.ts +10 -0
- package/dist/server/hono.d.ts.map +1 -0
- package/dist/server/hono.js +11 -0
- package/dist/server/hono.js.map +1 -0
- package/dist/types/server/hono.d.ts +67 -0
- package/dist/types/server/hono.d.ts.map +1 -0
- package/package.json +8 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkTBBX3C6E_cjs = require('../chunk-TBBX3C6E.cjs');
|
|
4
|
+
require('../chunk-TA6L5FYG.cjs');
|
|
5
|
+
|
|
6
|
+
// src/server/hono.ts
|
|
7
|
+
var driveAPIHandlerHono = chunkTBBX3C6E_cjs.driveAPIHandler;
|
|
8
|
+
var driveConfigurationHono = chunkTBBX3C6E_cjs.driveConfiguration;
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "driveDelete", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkTBBX3C6E_cjs.driveDelete; }
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "driveFilePath", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkTBBX3C6E_cjs.driveFilePath; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "driveFileSchemaZod", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkTBBX3C6E_cjs.driveFileSchemaZod; }
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "driveGetUrl", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return chunkTBBX3C6E_cjs.driveGetUrl; }
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "driveList", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return chunkTBBX3C6E_cjs.driveList; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "driveReadFile", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkTBBX3C6E_cjs.driveReadFile; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "driveUpload", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkTBBX3C6E_cjs.driveUpload; }
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "getDriveConfig", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return chunkTBBX3C6E_cjs.getDriveConfig; }
|
|
41
|
+
});
|
|
42
|
+
exports.driveAPIHandlerHono = driveAPIHandlerHono;
|
|
43
|
+
exports.driveConfigurationHono = driveConfigurationHono;
|
|
44
|
+
//# sourceMappingURL=hono.cjs.map
|
|
45
|
+
//# sourceMappingURL=hono.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/server/hono.ts"],"names":["driveAPIHandler","driveConfiguration"],"mappings":";;;;;;AASO,IAAM,mBAAA,GAAsBA;AAI5B,IAAM,sBAAA,GAAyBC","file":"hono.cjs","sourcesContent":["// ** Hono Adapter for next-drive\n// ** Provides Hono-compatible types for the drive API handler and configuration\nimport type { Context } from 'hono';\nimport type { TDriveConfigurationHono } from '@/types/server/hono';\n\nimport { driveAPIHandler, driveConfiguration } from '@/server/index';\n\n// ** Hono API Handler\n// ** Type-cast wrapper that allows Hono Context to be used with the core handler\nexport const driveAPIHandlerHono = driveAPIHandler as unknown as (c: Context) => Promise<void>;\n\n// ** Hono Configuration\n// ** Type-cast wrapper that accepts Hono Context in the information callback\nexport const driveConfigurationHono = driveConfiguration as unknown as (config: TDriveConfigurationHono) => Promise<TDriveConfigurationHono>;\n\n// ** Re-export utilities that work with any framework\nexport { driveGetUrl, driveReadFile, driveFilePath, driveUpload, driveDelete, driveList } from '@/server/controllers/drive';\nexport { driveFileSchemaZod } from '@/server/zod/schemas';\nexport { getDriveConfig } from '@/server/config';\n\n// ** Re-export types\nexport type { TDriveConfigurationHono, TDriveConfigInformation } from '@/types/server/hono';\nexport type { TDriveFile, TDriveInformation } from '@/types/client';\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
import type { TDriveConfigurationHono } from '../types/server/hono';
|
|
3
|
+
export declare const driveAPIHandlerHono: (c: Context) => Promise<void>;
|
|
4
|
+
export declare const driveConfigurationHono: (config: TDriveConfigurationHono) => Promise<TDriveConfigurationHono>;
|
|
5
|
+
export { driveGetUrl, driveReadFile, driveFilePath, driveUpload, driveDelete, driveList } from '../server/controllers/drive';
|
|
6
|
+
export { driveFileSchemaZod } from '../server/zod/schemas';
|
|
7
|
+
export { getDriveConfig } from '../server/config';
|
|
8
|
+
export type { TDriveConfigurationHono, TDriveConfigInformation } from '../types/server/hono';
|
|
9
|
+
export type { TDriveFile, TDriveInformation } from '../types/client';
|
|
10
|
+
//# sourceMappingURL=hono.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono.d.ts","sourceRoot":"","sources":["../../src/server/hono.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMnE,eAAO,MAAM,mBAAmB,EAAiC,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAI/F,eAAO,MAAM,sBAAsB,EAAoC,CAAC,MAAM,EAAE,uBAAuB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAG7I,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5H,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,YAAY,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { driveAPIHandler, driveConfiguration } from '../chunk-FWX344WM.js';
|
|
2
|
+
export { driveDelete, driveFilePath, driveFileSchemaZod, driveGetUrl, driveList, driveReadFile, driveUpload, getDriveConfig } from '../chunk-FWX344WM.js';
|
|
3
|
+
import '../chunk-TMSG5WJZ.js';
|
|
4
|
+
|
|
5
|
+
// src/server/hono.ts
|
|
6
|
+
var driveAPIHandlerHono = driveAPIHandler;
|
|
7
|
+
var driveConfigurationHono = driveConfiguration;
|
|
8
|
+
|
|
9
|
+
export { driveAPIHandlerHono, driveConfigurationHono };
|
|
10
|
+
//# sourceMappingURL=hono.js.map
|
|
11
|
+
//# sourceMappingURL=hono.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/server/hono.ts"],"names":[],"mappings":";;;;;AASO,IAAM,mBAAA,GAAsB;AAI5B,IAAM,sBAAA,GAAyB","file":"hono.js","sourcesContent":["// ** Hono Adapter for next-drive\n// ** Provides Hono-compatible types for the drive API handler and configuration\nimport type { Context } from 'hono';\nimport type { TDriveConfigurationHono } from '@/types/server/hono';\n\nimport { driveAPIHandler, driveConfiguration } from '@/server/index';\n\n// ** Hono API Handler\n// ** Type-cast wrapper that allows Hono Context to be used with the core handler\nexport const driveAPIHandlerHono = driveAPIHandler as unknown as (c: Context) => Promise<void>;\n\n// ** Hono Configuration\n// ** Type-cast wrapper that accepts Hono Context in the information callback\nexport const driveConfigurationHono = driveConfiguration as unknown as (config: TDriveConfigurationHono) => Promise<TDriveConfigurationHono>;\n\n// ** Re-export utilities that work with any framework\nexport { driveGetUrl, driveReadFile, driveFilePath, driveUpload, driveDelete, driveList } from '@/server/controllers/drive';\nexport { driveFileSchemaZod } from '@/server/zod/schemas';\nexport { getDriveConfig } from '@/server/config';\n\n// ** Re-export types\nexport type { TDriveConfigurationHono, TDriveConfigInformation } from '@/types/server/hono';\nexport type { TDriveFile, TDriveInformation } from '@/types/client';\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
export type { TDriveConfigInformation, TDriveInformationInput, TDriveSecurityConfig, TDriveStorageConfig, TDriveDatabase, TDriveCorsConfig, TDriveMode } from './config';
|
|
3
|
+
type TDriveConfigurationHonoBase = {
|
|
4
|
+
database: 'MONGOOSE';
|
|
5
|
+
storage: {
|
|
6
|
+
path: string;
|
|
7
|
+
google?: {
|
|
8
|
+
clientId: string;
|
|
9
|
+
clientSecret: string;
|
|
10
|
+
redirectUri: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
cors?: {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
origins?: string | string[];
|
|
16
|
+
methods?: string[];
|
|
17
|
+
allowedHeaders?: string[];
|
|
18
|
+
exposedHeaders?: string[];
|
|
19
|
+
credentials?: boolean;
|
|
20
|
+
maxAge?: number;
|
|
21
|
+
};
|
|
22
|
+
apiUrl: string;
|
|
23
|
+
};
|
|
24
|
+
type TDriveConfigurationHonoNormal = TDriveConfigurationHonoBase & {
|
|
25
|
+
mode?: 'NORMAL';
|
|
26
|
+
security: {
|
|
27
|
+
maxUploadSizeInBytes: number;
|
|
28
|
+
allowedMimeTypes: string[];
|
|
29
|
+
signedUrls?: {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
secret: string;
|
|
32
|
+
expiresIn: number;
|
|
33
|
+
};
|
|
34
|
+
trash?: {
|
|
35
|
+
retentionDays: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
information: (c: Context) => Promise<{
|
|
39
|
+
key: Record<string, unknown> | null;
|
|
40
|
+
storage: {
|
|
41
|
+
quotaInBytes: number;
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
type TDriveConfigurationHonoRoot = TDriveConfigurationHonoBase & {
|
|
46
|
+
mode: 'ROOT';
|
|
47
|
+
security?: {
|
|
48
|
+
maxUploadSizeInBytes: number;
|
|
49
|
+
allowedMimeTypes: string[];
|
|
50
|
+
signedUrls?: {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
secret: string;
|
|
53
|
+
expiresIn: number;
|
|
54
|
+
};
|
|
55
|
+
trash?: {
|
|
56
|
+
retentionDays: number;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
information?: (c: Context) => Promise<{
|
|
60
|
+
key: Record<string, unknown> | null;
|
|
61
|
+
storage: {
|
|
62
|
+
quotaInBytes: number;
|
|
63
|
+
};
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
export type TDriveConfigurationHono = TDriveConfigurationHonoNormal | TDriveConfigurationHonoRoot;
|
|
67
|
+
//# sourceMappingURL=hono.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono.d.ts","sourceRoot":"","sources":["../../../src/types/server/hono.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzK,KAAK,2BAA2B,GAAG;IAC/B,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE;YACL,QAAQ,EAAE,MAAM,CAAC;YACjB,YAAY,EAAE,MAAM,CAAC;YACrB,WAAW,EAAE,MAAM,CAAC;SACvB,CAAC;KACL,CAAC;IACF,IAAI,CAAC,EAAE;QACH,OAAO,EAAE,OAAO,CAAC;QACjB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AM,CAAA;SAAE,CAAC;KACrC,CAAC;IACF,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;QAClC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;QACpC,OAAO,EAAE;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC;KACrC,CAAC,CAAC;CACN,CAAC;AAGF,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GAAG,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muhgholy/next-drive",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.21.0",
|
|
4
4
|
"description": "File storage and management for Next.js applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"import": "./dist/server/express.js",
|
|
15
15
|
"require": "./dist/server/express.cjs"
|
|
16
16
|
},
|
|
17
|
+
"./server/hono": {
|
|
18
|
+
"types": "./dist/server/hono.d.ts",
|
|
19
|
+
"import": "./dist/server/hono.js",
|
|
20
|
+
"require": "./dist/server/hono.cjs"
|
|
21
|
+
},
|
|
17
22
|
"./client": {
|
|
18
23
|
"types": "./dist/client/index.d.ts",
|
|
19
24
|
"import": "./dist/client/index.js",
|
|
@@ -81,6 +86,7 @@
|
|
|
81
86
|
"@tailwindcss/cli": "^4.1.18",
|
|
82
87
|
"@tailwindcss/postcss": "^4.1.18",
|
|
83
88
|
"@types/express": "^5.0.6",
|
|
89
|
+
"hono": "^4.0.0",
|
|
84
90
|
"@types/fluent-ffmpeg": "^2.1.21",
|
|
85
91
|
"@types/formidable": "^3.4.6",
|
|
86
92
|
"@types/node": "^20.0.0",
|
|
@@ -116,4 +122,4 @@
|
|
|
116
122
|
"type": "git",
|
|
117
123
|
"url": "https://github.com/muhgholy/next-drive"
|
|
118
124
|
}
|
|
119
|
-
}
|
|
125
|
+
}
|