@datatruck/cli 0.0.1 → 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.
Files changed (156) hide show
  1. package/{lib/Action → Action}/BackupAction.d.ts +0 -0
  2. package/{lib/Action → Action}/BackupAction.js +0 -0
  3. package/{lib/Action → Action}/BackupSessionsAction.d.ts +0 -0
  4. package/{lib/Action → Action}/BackupSessionsAction.js +0 -0
  5. package/{lib/Action → Action}/CleanCacheAction.d.ts +0 -0
  6. package/{lib/Action → Action}/CleanCacheAction.js +0 -0
  7. package/{lib/Action → Action}/ConfigAction.d.ts +0 -0
  8. package/{lib/Action → Action}/ConfigAction.js +0 -0
  9. package/{lib/Action → Action}/InitAction.d.ts +0 -0
  10. package/{lib/Action → Action}/InitAction.js +0 -0
  11. package/{lib/Action → Action}/PruneAction.d.ts +0 -0
  12. package/{lib/Action → Action}/PruneAction.js +0 -0
  13. package/{lib/Action → Action}/RestoreAction.d.ts +0 -0
  14. package/{lib/Action → Action}/RestoreAction.js +0 -0
  15. package/{lib/Action → Action}/RestoreSessionsAction.d.ts +0 -0
  16. package/{lib/Action → Action}/RestoreSessionsAction.js +0 -0
  17. package/{lib/Action → Action}/SnapshotsAction.d.ts +0 -0
  18. package/{lib/Action → Action}/SnapshotsAction.js +0 -0
  19. package/CHANGELOG.md +21 -0
  20. package/{lib/Command → Command}/BackupCommand.d.ts +0 -0
  21. package/{lib/Command → Command}/BackupCommand.js +0 -0
  22. package/{lib/Command → Command}/BackupSessionsCommand.d.ts +0 -0
  23. package/{lib/Command → Command}/BackupSessionsCommand.js +0 -0
  24. package/{lib/Command → Command}/CleanCacheCommand.d.ts +0 -0
  25. package/{lib/Command → Command}/CleanCacheCommand.js +0 -0
  26. package/{lib/Command → Command}/CommandAbstract.d.ts +0 -0
  27. package/{lib/Command → Command}/CommandAbstract.js +0 -0
  28. package/{lib/Command → Command}/ConfigCommand.d.ts +0 -0
  29. package/{lib/Command → Command}/ConfigCommand.js +0 -0
  30. package/{lib/Command → Command}/InitCommand.d.ts +0 -0
  31. package/{lib/Command → Command}/InitCommand.js +0 -0
  32. package/{lib/Command → Command}/PruneCommand.d.ts +0 -0
  33. package/{lib/Command → Command}/PruneCommand.js +0 -0
  34. package/{lib/Command → Command}/RestoreCommand.d.ts +0 -0
  35. package/{lib/Command → Command}/RestoreCommand.js +0 -0
  36. package/{lib/Command → Command}/RestoreSessionsCommand.d.ts +0 -0
  37. package/{lib/Command → Command}/RestoreSessionsCommand.js +0 -0
  38. package/{lib/Command → Command}/SnapshotsCommand.d.ts +0 -0
  39. package/{lib/Command → Command}/SnapshotsCommand.js +0 -0
  40. package/{lib/Config → Config}/Config.d.ts +0 -0
  41. package/{lib/Config → Config}/Config.js +0 -0
  42. package/{lib/Config → Config}/PackageConfig.d.ts +0 -0
  43. package/{lib/Config → Config}/PackageConfig.js +0 -0
  44. package/{lib/Config → Config}/PackageRepositoryConfig.d.ts +0 -0
  45. package/{lib/Config → Config}/PackageRepositoryConfig.js +0 -0
  46. package/{lib/Config → Config}/PrunePolicyConfig.d.ts +0 -0
  47. package/{lib/Config → Config}/PrunePolicyConfig.js +0 -0
  48. package/{lib/Config → Config}/RepositoryConfig.d.ts +0 -0
  49. package/{lib/Config → Config}/RepositoryConfig.js +0 -0
  50. package/{lib/Config → Config}/TaskConfig.d.ts +0 -0
  51. package/{lib/Config → Config}/TaskConfig.js +0 -0
  52. package/{lib/Decorator → Decorator}/EntityDecorator.d.ts +0 -0
  53. package/{lib/Decorator → Decorator}/EntityDecorator.js +0 -0
  54. package/{lib/Entity → Entity}/BackupSessionEntity.d.ts +0 -0
  55. package/{lib/Entity → Entity}/BackupSessionEntity.js +0 -0
  56. package/{lib/Entity → Entity}/BackupSessionRepositoryEntity.d.ts +0 -0
  57. package/{lib/Entity → Entity}/BackupSessionRepositoryEntity.js +0 -0
  58. package/{lib/Entity → Entity}/BackupSessionTaskEntity.d.ts +0 -0
  59. package/{lib/Entity → Entity}/BackupSessionTaskEntity.js +0 -0
  60. package/{lib/Entity → Entity}/CrudEntityAbstract.d.ts +0 -0
  61. package/{lib/Entity → Entity}/CrudEntityAbstract.js +0 -0
  62. package/{lib/Entity → Entity}/RestoreSessionEntity.d.ts +0 -0
  63. package/{lib/Entity → Entity}/RestoreSessionEntity.js +0 -0
  64. package/{lib/Entity → Entity}/RestoreSessionRepositoryEntity.d.ts +0 -0
  65. package/{lib/Entity → Entity}/RestoreSessionRepositoryEntity.js +0 -0
  66. package/{lib/Entity → Entity}/RestoreSessionTaskEntity.d.ts +0 -0
  67. package/{lib/Entity → Entity}/RestoreSessionTaskEntity.js +0 -0
  68. package/{lib/Entity → Entity}/StateEntityAbstract.d.ts +0 -0
  69. package/{lib/Entity → Entity}/StateEntityAbstract.js +0 -0
  70. package/{lib/Error → Error}/AppError.d.ts +0 -0
  71. package/{lib/Error → Error}/AppError.js +0 -0
  72. package/{lib/Factory → Factory}/CommandFactory.d.ts +0 -0
  73. package/{lib/Factory → Factory}/CommandFactory.js +0 -0
  74. package/{lib/Factory → Factory}/EntityFactory.d.ts +0 -0
  75. package/{lib/Factory → Factory}/EntityFactory.js +0 -0
  76. package/{lib/Factory → Factory}/RepositoryFactory.d.ts +0 -0
  77. package/{lib/Factory → Factory}/RepositoryFactory.js +0 -0
  78. package/{lib/Factory → Factory}/TaskFactory.d.ts +0 -0
  79. package/{lib/Factory → Factory}/TaskFactory.js +0 -0
  80. package/{lib/JsonSchema → JsonSchema}/DefinitionEnum.d.ts +0 -0
  81. package/{lib/JsonSchema → JsonSchema}/DefinitionEnum.js +0 -0
  82. package/{lib/JsonSchema → JsonSchema}/JsonSchema.d.ts +0 -0
  83. package/{lib/JsonSchema → JsonSchema}/JsonSchema.js +0 -0
  84. package/{lib/Repository → Repository}/GitRepository.d.ts +0 -0
  85. package/{lib/Repository → Repository}/GitRepository.js +0 -0
  86. package/{lib/Repository → Repository}/LocalRepository.d.ts +0 -0
  87. package/{lib/Repository → Repository}/LocalRepository.js +0 -0
  88. package/{lib/Repository → Repository}/RepositoryAbstract.d.ts +0 -0
  89. package/{lib/Repository → Repository}/RepositoryAbstract.js +0 -0
  90. package/{lib/Repository → Repository}/ResticRepository.d.ts +0 -0
  91. package/{lib/Repository → Repository}/ResticRepository.js +0 -0
  92. package/{lib/SessionDriver → SessionDriver}/ConsoleSessionDriver.d.ts +0 -0
  93. package/{lib/SessionDriver → SessionDriver}/ConsoleSessionDriver.js +0 -0
  94. package/{lib/SessionDriver → SessionDriver}/SessionDriverAbstract.d.ts +0 -0
  95. package/{lib/SessionDriver → SessionDriver}/SessionDriverAbstract.js +0 -0
  96. package/{lib/SessionDriver → SessionDriver}/SqliteSessionDriver.d.ts +0 -0
  97. package/{lib/SessionDriver → SessionDriver}/SqliteSessionDriver.js +2 -1
  98. package/{lib/SessionManager → SessionManager}/BackupSessionManager.d.ts +0 -0
  99. package/{lib/SessionManager → SessionManager}/BackupSessionManager.js +0 -0
  100. package/{lib/SessionManager → SessionManager}/RestoreSessionManager.d.ts +0 -0
  101. package/{lib/SessionManager → SessionManager}/RestoreSessionManager.js +0 -0
  102. package/{lib/Task → Task}/GitTask.d.ts +0 -0
  103. package/{lib/Task → Task}/GitTask.js +0 -0
  104. package/{lib/Task → Task}/MariadbTask.d.ts +0 -0
  105. package/{lib/Task → Task}/MariadbTask.js +0 -0
  106. package/{lib/Task → Task}/MssqlTask.d.ts +0 -0
  107. package/{lib/Task → Task}/MssqlTask.js +0 -0
  108. package/{lib/Task → Task}/MysqlDumpTask.d.ts +0 -0
  109. package/{lib/Task → Task}/MysqlDumpTask.js +0 -0
  110. package/{lib/Task → Task}/PostgresqlDumpTask.d.ts +0 -0
  111. package/{lib/Task → Task}/PostgresqlDumpTask.js +0 -0
  112. package/{lib/Task → Task}/SqlDumpTaskAbstract.d.ts +0 -0
  113. package/{lib/Task → Task}/SqlDumpTaskAbstract.js +0 -0
  114. package/{lib/Task → Task}/TaskAbstract.d.ts +0 -0
  115. package/{lib/Task → Task}/TaskAbstract.js +0 -0
  116. package/{lib/bin.d.ts → bin.d.ts} +0 -0
  117. package/{lib/bin.js → bin.js} +0 -0
  118. package/{lib/cli.d.ts → cli.d.ts} +0 -0
  119. package/{lib/cli.js → cli.js} +0 -0
  120. package/{lib/index.d.ts → index.d.ts} +0 -0
  121. package/{lib/index.js → index.js} +0 -0
  122. package/package.json +3 -22
  123. package/{lib/util → util}/DataFormat.d.ts +0 -0
  124. package/{lib/util → util}/DataFormat.js +0 -0
  125. package/{lib/util → util}/GitUtil.d.ts +0 -0
  126. package/{lib/util → util}/GitUtil.js +0 -0
  127. package/{lib/util → util}/ObjectVault.d.ts +0 -0
  128. package/{lib/util → util}/ObjectVault.js +0 -0
  129. package/{lib/util → util}/ResticUtil.d.ts +0 -0
  130. package/{lib/util → util}/ResticUtil.js +0 -0
  131. package/{lib/util → util}/cli-util.d.ts +0 -0
  132. package/{lib/util → util}/cli-util.js +0 -0
  133. package/{lib/util → util}/datatruck/config-util.d.ts +0 -0
  134. package/{lib/util → util}/datatruck/config-util.js +0 -0
  135. package/{lib/util → util}/datatruck/paths-util.d.ts +0 -0
  136. package/{lib/util → util}/datatruck/paths-util.js +0 -0
  137. package/{lib/util → util}/datatruck/snapshot-util.d.ts +0 -0
  138. package/{lib/util → util}/datatruck/snapshot-util.js +0 -0
  139. package/{lib/util → util}/date-util.d.ts +0 -0
  140. package/{lib/util → util}/date-util.js +0 -0
  141. package/{lib/util → util}/entity-util.d.ts +0 -0
  142. package/{lib/util → util}/entity-util.js +0 -0
  143. package/{lib/util → util}/fs-util.d.ts +0 -0
  144. package/{lib/util → util}/fs-util.js +2 -1
  145. package/{lib/util → util}/math-util.d.ts +0 -0
  146. package/{lib/util → util}/math-util.js +0 -0
  147. package/{lib/util → util}/object-util.d.ts +0 -0
  148. package/{lib/util → util}/object-util.js +0 -0
  149. package/util/path-util.d.ts +1 -0
  150. package/util/path-util.js +8 -0
  151. /package/{lib/util → util}/process-util.d.ts +0 -0
  152. /package/{lib/util → util}/process-util.js +0 -0
  153. /package/{lib/util → util}/string-util.d.ts +0 -0
  154. /package/{lib/util → util}/string-util.js +0 -0
  155. /package/{lib/util → util}/zip-util.d.ts +0 -0
  156. /package/{lib/util → util}/zip-util.js +0 -0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # @datatruck/cli
2
+
3
+ ## 0.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d9e534b`](https://github.com/swordev/datatruck/commit/d9e534bd968acf9cd1c93f20e6152c004cb1f23b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix package file read
8
+
9
+ * [`b882c58`](https://github.com/swordev/datatruck/commit/b882c58183e9a75abc876645e18d7b67186dd662) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix read of migrations
10
+
11
+ ## 0.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`051a7da`](https://github.com/swordev/datatruck/commit/051a7da225fcfea1c30a4fbfa8aea1b8f5538367) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix dist files
16
+
17
+ ## 0.0.2
18
+
19
+ ### Patch Changes
20
+
21
+ - [`0911351`](https://github.com/swordev/datatruck/commit/09113517e1a77f2d2a1e19e4c3d9af7da1e28415) Thanks [@juanrgm](https://github.com/juanrgm)! - Publish docker image
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -11,6 +11,7 @@ const RestoreSessionEntity_1 = require("../Entity/RestoreSessionEntity");
11
11
  const RestoreSessionRepositoryEntity_1 = require("../Entity/RestoreSessionRepositoryEntity");
12
12
  const cli_util_1 = require("../util/cli-util");
13
13
  const entity_util_1 = require("../util/entity-util");
14
+ const path_util_1 = require("../util/path-util");
14
15
  const process_util_1 = require("../util/process-util");
15
16
  const SessionDriverAbstract_1 = require("./SessionDriverAbstract");
16
17
  const assert_1 = require("assert");
@@ -30,7 +31,7 @@ class SqliteSessionDriver extends SessionDriverAbstract_1.SessionDriverAbstract
30
31
  driver: sqlite3_1.default.Database,
31
32
  });
32
33
  await this.db.migrate({
33
- migrationsPath: __dirname + "/../../migrations",
34
+ migrationsPath: (0, path_1.join)(path_util_1.rootPath, "migrations"),
34
35
  });
35
36
  }
36
37
  buildInsertStm(tableName, values) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datatruck/cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "description": "Tool for creating and managing backups",
5
5
  "homepage": "https://github.com/swordev/datatruck#readme",
6
6
  "bugs": {
@@ -16,18 +16,10 @@
16
16
  "email": "juanrgm724@gmail.com",
17
17
  "url": "https://github.com/juanrgm"
18
18
  },
19
- "exports": {
20
- "./*": "./lib/*.js"
21
- },
22
- "main": "lib/index.js",
23
19
  "bin": {
24
- "datatruck": "lib/bin.js",
25
- "dtt": "lib/bin.js"
20
+ "datatruck": "bin.js",
21
+ "dtt": "bin.js"
26
22
  },
27
- "files": [
28
- "lib",
29
- "migrations"
30
- ],
31
23
  "dependencies": {
32
24
  "ajv": "^8.10.0",
33
25
  "chalk": "^4.1.2",
@@ -41,22 +33,11 @@
41
33
  "sqlite": "^4.0.23",
42
34
  "sqlite3": "^5.0.2"
43
35
  },
44
- "devDependencies": {
45
- "@types/fs-extra": "^9.0.13",
46
- "@types/json-schema": "^7.0.9",
47
- "@types/micromatch": "^4.0.2",
48
- "json-schema": "^0.4.0"
49
- },
50
36
  "optionalDependencies": {
51
37
  "ts-node": "^10.5.0",
52
38
  "yaml": "^1.10.2"
53
39
  },
54
40
  "engine": {
55
41
  "node": ">=16.0.0"
56
- },
57
- "scripts": {
58
- "build": "tsc --build",
59
- "clean": "tsc --build --clean",
60
- "watch": "tsc --build -w"
61
42
  }
62
43
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.writePathLists = exports.forEachFile = exports.checkDir = exports.checkFile = exports.readPartialFile = exports.mkTmpDir = exports.tmpDir = exports.sessionTmpDir = exports.parentTmpDir = exports.existsFile = exports.findFile = exports.parsePackageFile = exports.parseFile = exports.parseFileExtensions = exports.readdirIfExists = exports.writeJSONFile = exports.existsDir = exports.ensureEmptyDir = exports.mkdirIfNotExists = exports.isDirEmpty = exports.isLocalDir = void 0;
4
+ const path_util_1 = require("./path-util");
4
5
  const crypto_1 = require("crypto");
5
6
  const fs_1 = require("fs");
6
7
  const fs_2 = require("fs");
@@ -75,7 +76,7 @@ async function parseFile(path, jsKey) {
75
76
  }
76
77
  exports.parseFile = parseFile;
77
78
  function parsePackageFile() {
78
- return require(`${__dirname}/../../package.json`);
79
+ return require(`${path_util_1.rootPath}/package.json`);
79
80
  }
80
81
  exports.parsePackageFile = parsePackageFile;
81
82
  async function findFile(sourcePath, baseName, extensions, errorMessage = "Path not found") {
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export declare const rootPath: string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rootPath = void 0;
4
+ const path_1 = require("path");
5
+ const fromSrc = __filename.endsWith(".ts");
6
+ exports.rootPath = fromSrc
7
+ ? (0, path_1.normalize)(`${__dirname}/../../`)
8
+ : (0, path_1.normalize)(`${__dirname}/../`);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes