@jesusacd/mediafire 1.1.0 → 1.2.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.
@@ -0,0 +1,115 @@
1
+ import { InternalSession } from '../api';
2
+ /**
3
+ * Upload result
4
+ */
5
+ export interface UploadResult {
6
+ /** Quick key of uploaded file */
7
+ quickKey: string;
8
+ /** File name */
9
+ filename: string;
10
+ /** File size in bytes */
11
+ size: number;
12
+ /** Upload key (for polling) */
13
+ uploadKey?: string;
14
+ }
15
+ /**
16
+ * Upload options
17
+ */
18
+ export interface UploadOptions {
19
+ /** Destination folder key (default: root) */
20
+ folderKey?: string;
21
+ /** Action on duplicate: 'skip', 'keep', 'replace' */
22
+ actionOnDuplicate?: 'skip' | 'keep' | 'replace';
23
+ /** Path within folder */
24
+ path?: string;
25
+ }
26
+ /**
27
+ * Upload module for file upload operations
28
+ */
29
+ export declare class UploadModule {
30
+ private getSession;
31
+ constructor(getSession: () => InternalSession | null);
32
+ /**
33
+ * Upload a file from disk
34
+ *
35
+ * @param filePath - Path to the file to upload
36
+ * @param options - Upload options
37
+ * @returns Upload result with quick key
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const result = await client.upload.file('C:/path/to/file.pdf');
42
+ * console.log(`Uploaded: ${result.quickKey}`);
43
+ * ```
44
+ */
45
+ file(filePath: string, options?: UploadOptions): Promise<UploadResult>;
46
+ /**
47
+ * Upload a file from buffer
48
+ *
49
+ * @param buffer - File content as buffer
50
+ * @param filename - File name with extension
51
+ * @param options - Upload options
52
+ * @returns Upload result with quick key
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * const buffer = Buffer.from('Hello World');
57
+ * const result = await client.upload.buffer(buffer, 'hello.txt');
58
+ * console.log(`Uploaded: ${result.quickKey}`);
59
+ * ```
60
+ */
61
+ buffer(buffer: Buffer, filename: string, options?: UploadOptions & {
62
+ hash?: string;
63
+ }): Promise<UploadResult>;
64
+ /**
65
+ * Poll upload status until complete
66
+ *
67
+ * @param uploadKey - Upload key from simple upload
68
+ * @returns Upload result
69
+ */
70
+ pollUpload(uploadKey: string, maxAttempts?: number): Promise<{
71
+ quickKey: string;
72
+ filename?: string;
73
+ size?: number;
74
+ }>;
75
+ /**
76
+ * Check if a file can be instant uploaded (already exists on MediaFire)
77
+ *
78
+ * @param hash - SHA256 hash of the file
79
+ * @param filename - File name
80
+ * @param size - File size in bytes
81
+ * @param folderKey - Destination folder key
82
+ * @returns Check result
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const check = await client.upload.check(hash, 'file.pdf', 1024);
87
+ * if (check.hashExists) {
88
+ * console.log('File can be instant uploaded!');
89
+ * }
90
+ * ```
91
+ */
92
+ check(hash: string, filename: string, size: number, folderKey?: string): Promise<{
93
+ hashExists: boolean;
94
+ inAccount: boolean;
95
+ inFolder: boolean;
96
+ duplicateQuickKey?: string;
97
+ }>;
98
+ /**
99
+ * Instant upload a file (if it already exists on MediaFire servers)
100
+ *
101
+ * @param hash - SHA256 hash of the file
102
+ * @param filename - File name
103
+ * @param size - File size in bytes
104
+ * @param folderKey - Destination folder key
105
+ * @returns Upload result
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * const result = await client.upload.instant(hash, 'file.pdf', 1024);
110
+ * console.log(`Instant uploaded: ${result.quickKey}`);
111
+ * ```
112
+ */
113
+ instant(hash: string, filename: string, size: number, folderKey?: string): Promise<UploadResult>;
114
+ }
115
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/modules/upload.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAW,MAAM,QAAQ,CAAC;AAOlD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb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ACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CA4BvG"}
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.UploadModule = void 0;
40
+ /**
41
+ * Upload Module - File upload operations
42
+ */
43
+ const fs = __importStar(require("fs"));
44
+ const path = __importStar(require("path"));
45
+ const crypto = __importStar(require("crypto"));
46
+ const node_fetch_1 = __importDefault(require("node-fetch"));
47
+ const api_1 = require("../api");
48
+ const auth_1 = require("../auth");
49
+ const types_1 = require("../types");
50
+ const API_BASE = 'https://www.mediafire.com/api';
51
+ const DEFAULT_API_VERSION = '1.3';
52
+ /**
53
+ * Upload module for file upload operations
54
+ */
55
+ class UploadModule {
56
+ constructor(getSession) {
57
+ this.getSession = getSession;
58
+ }
59
+ /**
60
+ * Upload a file from disk
61
+ *
62
+ * @param filePath - Path to the file to upload
63
+ * @param options - Upload options
64
+ * @returns Upload result with quick key
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const result = await client.upload.file('C:/path/to/file.pdf');
69
+ * console.log(`Uploaded: ${result.quickKey}`);
70
+ * ```
71
+ */
72
+ async file(filePath, options = {}) {
73
+ const session = this.getSession();
74
+ if (!session) {
75
+ throw new Error('Not authenticated. Please call login() first.');
76
+ }
77
+ // Read file
78
+ const fileBuffer = fs.readFileSync(filePath);
79
+ const filename = path.basename(filePath);
80
+ const fileHash = crypto.createHash('sha256').update(fileBuffer).digest('hex');
81
+ return this.buffer(fileBuffer, filename, {
82
+ ...options,
83
+ hash: fileHash
84
+ });
85
+ }
86
+ /**
87
+ * Upload a file from buffer
88
+ *
89
+ * @param buffer - File content as buffer
90
+ * @param filename - File name with extension
91
+ * @param options - Upload options
92
+ * @returns Upload result with quick key
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * const buffer = Buffer.from('Hello World');
97
+ * const result = await client.upload.buffer(buffer, 'hello.txt');
98
+ * console.log(`Uploaded: ${result.quickKey}`);
99
+ * ```
100
+ */
101
+ async buffer(buffer, filename, options = {}) {
102
+ const session = this.getSession();
103
+ if (!session) {
104
+ throw new Error('Not authenticated. Please call login() first.');
105
+ }
106
+ const fileSize = buffer.length;
107
+ const fileHash = options.hash || crypto.createHash('sha256').update(buffer).digest('hex');
108
+ // Build upload params
109
+ const params = new URLSearchParams();
110
+ params.append('response_format', 'json');
111
+ params.append('session_token', session.sessionToken);
112
+ if (options.folderKey) {
113
+ params.append('folder_key', options.folderKey);
114
+ }
115
+ if (options.actionOnDuplicate) {
116
+ params.append('action_on_duplicate', options.actionOnDuplicate);
117
+ }
118
+ if (options.path) {
119
+ params.append('path', options.path);
120
+ }
121
+ // Sort params alphabetically (required for signature)
122
+ const sortedParams = new URLSearchParams([...params.entries()].sort());
123
+ // Generate signature
124
+ const uri = `/api/${DEFAULT_API_VERSION}/upload/simple.php`;
125
+ const query = sortedParams.toString();
126
+ const secretKeyMod = parseInt(session.secretKey, 10) % 256;
127
+ const signatureBase = `${secretKeyMod}${session.time}${uri}?${query}`;
128
+ const signature = crypto.createHash('md5').update(signatureBase).digest('hex');
129
+ sortedParams.append('signature', signature);
130
+ const uploadUrl = `${API_BASE}/${DEFAULT_API_VERSION}/upload/simple.php?${sortedParams.toString()}`;
131
+ // Upload file
132
+ const response = await (0, node_fetch_1.default)(uploadUrl, {
133
+ method: 'POST',
134
+ headers: {
135
+ 'Content-Type': 'application/octet-stream',
136
+ 'x-filename': encodeURIComponent(filename),
137
+ 'x-filesize': String(fileSize),
138
+ 'x-filehash': fileHash,
139
+ 'User-Agent': 'MediaFire-SDK/1.0 (Node.js)'
140
+ },
141
+ body: buffer
142
+ });
143
+ const responseText = await response.text();
144
+ let data;
145
+ try {
146
+ data = JSON.parse(responseText);
147
+ }
148
+ catch {
149
+ throw new types_1.MediaFireError(`Invalid upload response: ${responseText}`);
150
+ }
151
+ if (data.response?.result !== 'Success') {
152
+ throw new types_1.MediaFireError(data.response?.message || 'Upload failed', data.response?.error, data);
153
+ }
154
+ // Handle secret key regeneration (same as apiCall)
155
+ if (data.response?.new_key === 'yes' && session) {
156
+ session.secretKey = (0, auth_1.regenerateSecretKey)(session.secretKey);
157
+ }
158
+ const uploadKey = data.response?.doupload?.key;
159
+ if (!uploadKey) {
160
+ throw new types_1.MediaFireError('No upload key received');
161
+ }
162
+ // Poll for completion
163
+ const result = await this.pollUpload(uploadKey);
164
+ return {
165
+ quickKey: result.quickKey,
166
+ filename: result.filename || filename,
167
+ size: result.size || fileSize,
168
+ uploadKey
169
+ };
170
+ }
171
+ /**
172
+ * Poll upload status until complete
173
+ *
174
+ * @param uploadKey - Upload key from simple upload
175
+ * @returns Upload result
176
+ */
177
+ async pollUpload(uploadKey, maxAttempts = 30) {
178
+ const session = this.getSession();
179
+ if (!session) {
180
+ throw new Error('Not authenticated. Please call login() first.');
181
+ }
182
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
183
+ const response = await (0, api_1.apiCall)('upload/poll_upload', {
184
+ key: uploadKey
185
+ }, session);
186
+ const status = response.doupload?.status;
187
+ // Check for errors
188
+ if (response.doupload?.fileerror) {
189
+ throw new types_1.MediaFireError(`Upload error: ${response.doupload.fileerror}`);
190
+ }
191
+ // Status 99 means complete
192
+ if (status === '99' && response.doupload?.quickkey) {
193
+ return {
194
+ quickKey: response.doupload.quickkey,
195
+ filename: response.doupload.filename,
196
+ size: response.doupload.size ? parseInt(response.doupload.size, 10) : undefined
197
+ };
198
+ }
199
+ // Wait before next poll
200
+ await new Promise(resolve => setTimeout(resolve, 1000));
201
+ }
202
+ throw new types_1.MediaFireError('Upload timed out');
203
+ }
204
+ /**
205
+ * Check if a file can be instant uploaded (already exists on MediaFire)
206
+ *
207
+ * @param hash - SHA256 hash of the file
208
+ * @param filename - File name
209
+ * @param size - File size in bytes
210
+ * @param folderKey - Destination folder key
211
+ * @returns Check result
212
+ *
213
+ * @example
214
+ * ```typescript
215
+ * const check = await client.upload.check(hash, 'file.pdf', 1024);
216
+ * if (check.hashExists) {
217
+ * console.log('File can be instant uploaded!');
218
+ * }
219
+ * ```
220
+ */
221
+ async check(hash, filename, size, folderKey) {
222
+ const session = this.getSession();
223
+ if (!session) {
224
+ throw new Error('Not authenticated. Please call login() first.');
225
+ }
226
+ const response = await (0, api_1.apiCall)('upload/check', {
227
+ hash,
228
+ filename,
229
+ size,
230
+ folder_key: folderKey || 'myfiles'
231
+ }, session);
232
+ return {
233
+ hashExists: response.hash_exists === 'yes',
234
+ inAccount: response.in_account === 'yes',
235
+ inFolder: response.in_folder === 'yes',
236
+ duplicateQuickKey: response.duplicate_quickkey
237
+ };
238
+ }
239
+ /**
240
+ * Instant upload a file (if it already exists on MediaFire servers)
241
+ *
242
+ * @param hash - SHA256 hash of the file
243
+ * @param filename - File name
244
+ * @param size - File size in bytes
245
+ * @param folderKey - Destination folder key
246
+ * @returns Upload result
247
+ *
248
+ * @example
249
+ * ```typescript
250
+ * const result = await client.upload.instant(hash, 'file.pdf', 1024);
251
+ * console.log(`Instant uploaded: ${result.quickKey}`);
252
+ * ```
253
+ */
254
+ async instant(hash, filename, size, folderKey) {
255
+ const session = this.getSession();
256
+ if (!session) {
257
+ throw new Error('Not authenticated. Please call login() first.');
258
+ }
259
+ const response = await (0, api_1.apiCall)('upload/instant', {
260
+ hash,
261
+ filename,
262
+ size,
263
+ folder_key: folderKey || 'myfiles'
264
+ }, session);
265
+ if (!response.quickkey) {
266
+ throw new types_1.MediaFireError('Instant upload failed - file may not exist on servers');
267
+ }
268
+ return {
269
+ quickKey: response.quickkey,
270
+ filename: response.filename || filename,
271
+ size
272
+ };
273
+ }
274
+ }
275
+ exports.UploadModule = UploadModule;
276
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/modules/upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,4DAA+B;AAC/B,gCAAkD;AAClD,kCAA8C;AAC9C,oCAA0C;AAE1C,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AACjD,MAAM,mBAAmB,GAAG,KAAK,CAAC;AA4BlC;;GAEG;AACH,MAAa,YAAY;IACvB,YAAoB,UAAwC;QAAxC,eAAU,GAAV,UAAU,CAA8B;IAAG,CAAC;IAEhE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ACnC,EAAE,OAAO,CAAC,CAAC;QAEZ,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACvB,MAAM,IAAI,sBAAc,CAAC,uDAAuD,CAAC,CAAC;QACpF,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,IAAI,QAAQ;YACvC,IAAI;SACL,CAAC;IACJ,CAAC;CACF;AAxRD,oCAwRC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jesusacd/mediafire",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "MediaFire API SDK for Node.js - Upload, download, and manage files on MediaFire",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",