dc-cloud 0.0.2 → 0.0.4

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.
@@ -53,7 +53,7 @@ export class DCloudClass {
53
53
  try {
54
54
  this.inputPath = normalize(_inputPath);
55
55
  if (!this.inputPath)
56
- return Promise.reject(undefined);
56
+ return Promise.reject(new Error("[DCloud] [Error]: Invalid input path"));
57
57
  console.log(chalk.cyan("[DCloud] [Process]: Preparing Discord thread..."));
58
58
  const threadReady = await this.initializeNewChannel(path.basename(this.inputPath));
59
59
  if (!threadReady) {
package/dist/index.js CHANGED
@@ -1,10 +1,2 @@
1
- import { DCloud } from "./classes/dCloud.js";
2
- const TOKEN = "MTQxODYyMjg0MDE4NTQyMTgzNg.Gtq4z_.FT7e39PscQjNet23o4TfMBzYVAMbG_TzkjQ9a8";
3
- const CHANNEL_ID = "1465235994243502162";
4
- const GUILD_ID = "1316439358609297418";
5
- const dCloud = DCloud({ FORUM_CHANNEL_ID: CHANNEL_ID, TOKEN: TOKEN, SERVER_ID: GUILD_ID });
6
- dCloud.init();
7
- setTimeout(() => {
8
- dCloud.upload("C:\\Users\\neelo\\OneDrive\\Desktop\\DCloud\\text.txt");
9
- }, 10000);
10
- // dCloud.downloader("https://cdn.discordapp.com/attachments/1465344532462702639/1465344646329929923/metadata.json?ex=6978c40c&is=6977728c&hm=3b51d006d31594712dbc8c76c5a5b24d83c01c4b6d9bf8339ed175f9c5114e4a&", "..")
1
+ export { DCloud, DCloudClass } from "./classes/dCloud.js";
2
+ export { CloudBot, CloudBotClass } from "./classes/cloudBot.js";
@@ -133,6 +133,8 @@ export async function Restore(folder, destination, onDone, onFailed) {
133
133
  return reject(new Error("First archive part missing"));
134
134
  }
135
135
  const outDir = destination ? normalize(destination) : folderPath;
136
+ if (!outDir)
137
+ return reject(new Error("[7z] [Error]: Invalid output directory"));
136
138
  const args = ["x", firstPart, `-o${outDir}`, "-aoa", "-y"];
137
139
  const on7zDone = () => {
138
140
  console.log(chalk.green("[7z] [Restore]: Extraction completed successfully."));
package/dist/utils/lib.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import path from "path";
2
2
  import fs from "fs";
3
3
  export function normalize(filePath) {
4
- if (!filePath && typeof filePath !== "string")
4
+ if (!filePath || typeof filePath !== "string")
5
5
  return null;
6
6
  return path.resolve(filePath.replace(/["']/g, ""));
7
7
  }
package/package.json CHANGED
@@ -1,59 +1,60 @@
1
- {
2
- "name": "dc-cloud",
3
- "version": "0.0.2",
4
- "description": "Discord-based cloud storage solution for file compression, segmentation, and backup using Discord as a backend",
5
- "type": "module",
6
- "license":"MIT",
7
- "module": "dist/index.js",
8
- "main": "dist/index.js",
9
-
10
- "author": {
11
- "name": "Neel Frostrain",
12
- "url": "https://github.com/NeelFrostrain"
13
- },
14
-
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/NeelFrostrain/DCloud.git"
18
- },
19
-
20
- "keywords": [
21
- "discord",
22
- "cloud-storage",
23
- "compression",
24
- "7zip",
25
- "file-backup",
26
- "bot"
27
- ],
28
-
29
- "engines": {
30
- "node": ">=18.0.0",
31
- "npm": ">=9.0.0"
32
- },
33
-
34
- "scripts": {
35
- "start": "npm run build && node dist/index.js",
36
- "dev": "nodemon --exec ts-node src/index.ts",
37
- "build": "tsc",
38
- "lint": "eslint src/**/*.ts",
39
- "type-check": "tsc --noEmit"
40
- },
41
-
42
- "dependencies": {
43
- "7zip-bin": "^5.2.0",
44
- "chalk": "^5.6.2",
45
- "discord.js": "^14.25.1"
46
- },
47
-
48
- "devDependencies": {
49
- "eslint": "^9.39.2",
50
- "globals": "^17.1.0",
51
- "jiti": "^2.6.1",
52
- "nodemon": "^3.1.11",
53
- "typescript-eslint": "^8.53.1"
54
- },
55
-
56
- "peerDependencies": {
57
- "typescript": "^5"
58
- }
59
- }
1
+ {
2
+ "name": "dc-cloud",
3
+ "version": "0.0.4",
4
+ "description": "Discord-based cloud storage solution for file compression, segmentation, and backup using Discord as a backend",
5
+ "type": "module",
6
+ "license":"MIT",
7
+ "module": "dist/index.js",
8
+ "main": "dist/index.js",
9
+ "types": "index.d.ts",
10
+
11
+ "author": {
12
+ "name": "Neel Frostrain",
13
+ "url": "https://github.com/NeelFrostrain"
14
+ },
15
+
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/NeelFrostrain/DCloud.git"
19
+ },
20
+
21
+ "keywords": [
22
+ "discord",
23
+ "cloud-storage",
24
+ "compression",
25
+ "7zip",
26
+ "file-backup",
27
+ "bot"
28
+ ],
29
+
30
+ "engines": {
31
+ "node": ">=18.0.0",
32
+ "npm": ">=9.0.0"
33
+ },
34
+
35
+ "scripts": {
36
+ "start": "npm run build && node dist/index.js",
37
+ "dev": "nodemon --exec ts-node src/index.ts",
38
+ "build": "tsc",
39
+ "lint": "eslint src/**/*.ts",
40
+ "type-check": "tsc --noEmit"
41
+ },
42
+
43
+ "dependencies": {
44
+ "7zip-bin": "^5.2.0",
45
+ "chalk": "^5.6.2",
46
+ "discord.js": "^14.25.1"
47
+ },
48
+
49
+ "devDependencies": {
50
+ "eslint": "^9.39.2",
51
+ "globals": "^17.1.0",
52
+ "jiti": "^2.6.1",
53
+ "nodemon": "^3.1.11",
54
+ "typescript-eslint": "^8.53.1"
55
+ },
56
+
57
+ "peerDependencies": {
58
+ "typescript": "^5"
59
+ }
60
+ }