@datatruck/cli 0.25.0 → 0.26.1

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.
@@ -14,6 +14,7 @@ export type RestoreActionOptionsType = {
14
14
  repositoryNames?: string[];
15
15
  repositoryTypes?: string[];
16
16
  verbose?: boolean;
17
+ noRestorePath?: boolean;
17
18
  };
18
19
  type SnapshotType = SnapshotResultType & {
19
20
  repositoryName: string;
@@ -145,6 +145,11 @@ class RestoreAction {
145
145
  });
146
146
  let repoError;
147
147
  let repoInstance;
148
+ if (this.options.noRestorePath)
149
+ pkg = {
150
+ ...pkg,
151
+ restorePath: pkg.path,
152
+ };
148
153
  try {
149
154
  if (typeof pkg.restorePath !== "string")
150
155
  throw new AppError_1.AppError("Restore path is not defined");
@@ -9,6 +9,7 @@ export type RestoreCommandOptionsType<TResolved = false> = {
9
9
  repository?: If<TResolved, string[]>;
10
10
  repositoryType?: If<TResolved, RepositoryConfigType["type"][]>;
11
11
  tag?: If<TResolved, string[]>;
12
+ noRestorePath?: boolean;
12
13
  };
13
14
  export declare class RestoreCommand extends CommandAbstract<RestoreCommandOptionsType<false>, RestoreCommandOptionsType<true>> {
14
15
  onOptions(): import("../utils/cli").OptionsType<RestoreCommandOptionsType<false>, RestoreCommandOptionsType<true>>;
@@ -21,6 +21,10 @@ class RestoreCommand extends CommandAbstract_1.CommandAbstract {
21
21
  option: "-p,--package <values>",
22
22
  parser: string_1.parseStringList,
23
23
  },
24
+ noRestorePath: {
25
+ description: "Disable restore path",
26
+ option: "--no-restore-path",
27
+ },
24
28
  packageTask: {
25
29
  description: "Filter by package task names",
26
30
  option: "-pt,--package-task <values>",
@@ -59,6 +63,7 @@ class RestoreCommand extends CommandAbstract_1.CommandAbstract {
59
63
  repositoryTypes: this.options.repositoryType,
60
64
  tags: this.options.tag,
61
65
  verbose: verbose > 0,
66
+ noRestorePath: this.options.noRestorePath,
62
67
  });
63
68
  const sessionManager = new RestoreSessionManager_1.RestoreSessionManager({
64
69
  driver: new SqliteSessionDriver_1.SqliteSessionDriver({
@@ -10,6 +10,7 @@ export type PackageConfigType = {
10
10
  task?: TaskConfigType;
11
11
  path?: string;
12
12
  restorePath?: string;
13
+ meta?: Record<string, any>;
13
14
  restorePermissions?: {
14
15
  uid: string | number;
15
16
  gid: string | number;
@@ -13,6 +13,7 @@ exports.packageConfigDefinition = {
13
13
  task: (0, DefinitionEnum_1.makeRef)(DefinitionEnum_1.DefinitionEnum.task),
14
14
  path: { type: "string" },
15
15
  restorePath: { type: "string" },
16
+ meta: { type: "object" },
16
17
  restorePermissions: {
17
18
  type: "object",
18
19
  required: ["uid", "gid"],
@@ -163,7 +163,7 @@ class MysqlDumpTask extends TaskAbstract_1.TaskAbstract {
163
163
  const database = {
164
164
  name: (0, config_1.resolveDatabaseName)(this.config.database, params),
165
165
  };
166
- if (this.config.targetDatabase)
166
+ if (this.config.targetDatabase && !data.options.noRestorePath)
167
167
  database.name = (0, config_1.resolveDatabaseName)(this.config.targetDatabase.name, {
168
168
  ...params,
169
169
  database: database.name,
@@ -192,7 +192,7 @@ class SqlDumpTaskAbstract extends TaskAbstract_1.TaskAbstract {
192
192
  database: undefined,
193
193
  }),
194
194
  };
195
- if (this.config.targetDatabase) {
195
+ if (this.config.targetDatabase && !data.options.noRestorePath) {
196
196
  database.name = (0, config_1.resolveDatabaseName)(this.config.targetDatabase.name, {
197
197
  packageName: data.package.name,
198
198
  snapshotId: data.options.snapshotId,
@@ -138,6 +138,9 @@
138
138
  "restorePath": {
139
139
  "type": "string"
140
140
  },
141
+ "meta": {
142
+ "type": "object"
143
+ },
141
144
  "restorePermissions": {
142
145
  "type": "object",
143
146
  "required": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datatruck/cli",
3
- "version": "0.25.0",
3
+ "version": "0.26.1",
4
4
  "dependencies": {
5
5
  "@supercharge/promise-pool": "^3.1.0",
6
6
  "ajv": "^8.12.0",