@catladder/cli 0.0.0-main-8bf99edf → 0.0.0-main-4a04eb13
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/bundles/catenv/index.js +14 -2
- package/dist/bundles/cli/index.js +46 -13
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +3 -11
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.d.ts +9 -0
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.js +22 -0
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.js.map +1 -0
- package/dist/pipeline/src/build/node/cache.js +14 -2
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts +3 -13
- package/src/gcloud/cloudSql/parseConnectionString.ts +28 -0
|
@@ -2207,9 +2207,10 @@ const getYarnCache = (context, policy = "pull-push") => {
|
|
|
2207
2207
|
};
|
|
2208
2208
|
exports.getYarnCache = getYarnCache;
|
|
2209
2209
|
const getNodeModulesCache = (context, policy = "pull-push") => {
|
|
2210
|
-
var _a;
|
|
2210
|
+
var _a, _b;
|
|
2211
2211
|
const componentIsInWorkspace = context.type === "component" &&
|
|
2212
2212
|
context.packageManagerInfo.componentIsInWorkspace;
|
|
2213
|
+
const { isClassic } = context.packageManagerInfo;
|
|
2213
2214
|
// We intentionally do not use the contents of yarn.lock as a cache key, as yarn install should always guarantee that the files are updated, but it can still use part of the cache if not all packages are up-to-date.
|
|
2214
2215
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
2215
2216
|
return [
|
|
@@ -2226,8 +2227,19 @@ const getNodeModulesCache = (context, policy = "pull-push") => {
|
|
|
2226
2227
|
? (0, lodash_1.uniq)([
|
|
2227
2228
|
"node_modules",
|
|
2228
2229
|
...((_a = context.packageManagerInfo.workspaces.map((w) => (0, path_1.join)(w.location, "node_modules"))) !== null && _a !== void 0 ? _a : []),
|
|
2230
|
+
...(!isClassic
|
|
2231
|
+
? [
|
|
2232
|
+
".yarn/install-state.gz",
|
|
2233
|
+
...((_b = context.packageManagerInfo.workspaces.map((w) => (0, path_1.join)(w.location, ".yarn/install-state.gz"))) !== null && _b !== void 0 ? _b : []),
|
|
2234
|
+
]
|
|
2235
|
+
: []),
|
|
2229
2236
|
])
|
|
2230
|
-
: [
|
|
2237
|
+
: [
|
|
2238
|
+
(0, path_1.join)(context.build.dir, "node_modules"),
|
|
2239
|
+
...(!isClassic
|
|
2240
|
+
? [(0, path_1.join)(context.build.dir, ".yarn/install-state.gz")]
|
|
2241
|
+
: []),
|
|
2242
|
+
]),
|
|
2231
2243
|
],
|
|
2232
2244
|
},
|
|
2233
2245
|
];
|
|
@@ -857,7 +857,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
857
857
|
const getProjectConfig_1 = __nccwpck_require__(50001);
|
|
858
858
|
const startProxy_1 = __nccwpck_require__(95540);
|
|
859
859
|
const autocompletions_1 = __nccwpck_require__(52468);
|
|
860
|
-
const
|
|
860
|
+
const parseConnectionString_1 = __nccwpck_require__(77992);
|
|
861
861
|
const copyDb_1 = __nccwpck_require__(57151);
|
|
862
862
|
exports["default"] = async (vorpal) => vorpal
|
|
863
863
|
.command("project-cloud-sql-restore-db", "restores a project db from one source to another target")
|
|
@@ -888,11 +888,7 @@ exports["default"] = async (vorpal) => vorpal
|
|
|
888
888
|
targetProxy === null || targetProxy === void 0 ? void 0 : targetProxy.stop();
|
|
889
889
|
};
|
|
890
890
|
if (sourceEnv === "local") {
|
|
891
|
-
const
|
|
892
|
-
scheme: "postgres",
|
|
893
|
-
hosts: [],
|
|
894
|
-
});
|
|
895
|
-
const parsersResult = parser.parse(sourceEnvVars.DATABASE_URL.toString());
|
|
891
|
+
const parsersResult = (0, parseConnectionString_1.parseConnectionString)(sourceEnvVars.DATABASE_URL.toString());
|
|
896
892
|
sourcePort = (_b = (_a = parsersResult.hosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.port;
|
|
897
893
|
sourceUsername = parsersResult.username;
|
|
898
894
|
sourcePassword = parsersResult.password;
|
|
@@ -918,11 +914,7 @@ exports["default"] = async (vorpal) => vorpal
|
|
|
918
914
|
const targetContext = await (0, getProjectConfig_1.getPipelineContextByChoice)(targetEnv, targetComponent);
|
|
919
915
|
const targetEnvVars = await (0, getProjectConfig_1.getEnvVarsResolved)(this, targetContext.env, targetContext.name);
|
|
920
916
|
if (targetEnv === "local") {
|
|
921
|
-
const
|
|
922
|
-
scheme: "postgres",
|
|
923
|
-
hosts: [],
|
|
924
|
-
});
|
|
925
|
-
const parsersResult = parser.parse(targetEnvVars.DATABASE_URL.toString());
|
|
917
|
+
const parsersResult = (0, parseConnectionString_1.parseConnectionString)(targetEnvVars.DATABASE_URL.toString());
|
|
926
918
|
targetPort = (_e = (_d = parsersResult.hosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.port;
|
|
927
919
|
targetUsername = parsersResult.username;
|
|
928
920
|
targetPassword = parsersResult.password;
|
|
@@ -3002,6 +2994,35 @@ const createCopyDbScript = ({ targetPassword, targetPort, targetUsername, source
|
|
|
3002
2994
|
|
|
3003
2995
|
/***/ }),
|
|
3004
2996
|
|
|
2997
|
+
/***/ 77992:
|
|
2998
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2999
|
+
|
|
3000
|
+
"use strict";
|
|
3001
|
+
|
|
3002
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3003
|
+
exports.parseConnectionString = void 0;
|
|
3004
|
+
const connection_string_parser_1 = __nccwpck_require__(27827);
|
|
3005
|
+
/**
|
|
3006
|
+
* Parses a PostgreSQL connection string.
|
|
3007
|
+
* Accepts both postgres:// and postgresql:// schemes and normalizes to postgresql://
|
|
3008
|
+
*
|
|
3009
|
+
* @param connectionString - The connection string to parse (e.g., "postgresql://user:pass@localhost:5432/dbname")
|
|
3010
|
+
* @returns Parsed connection string parameters
|
|
3011
|
+
*/
|
|
3012
|
+
function parseConnectionString(connectionString) {
|
|
3013
|
+
const parser = new connection_string_parser_1.ConnectionStringParser({
|
|
3014
|
+
scheme: "postgresql",
|
|
3015
|
+
hosts: [],
|
|
3016
|
+
});
|
|
3017
|
+
// Normalize postgres:// to postgresql:// (the official IANA scheme)
|
|
3018
|
+
const normalizedConnectionString = connectionString.replace(/^postgres:\/\//, "postgresql://");
|
|
3019
|
+
return parser.parse(normalizedConnectionString);
|
|
3020
|
+
}
|
|
3021
|
+
exports.parseConnectionString = parseConnectionString;
|
|
3022
|
+
//# sourceMappingURL=parseConnectionString.js.map
|
|
3023
|
+
|
|
3024
|
+
/***/ }),
|
|
3025
|
+
|
|
3005
3026
|
/***/ 95540:
|
|
3006
3027
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
3007
3028
|
|
|
@@ -5418,9 +5439,10 @@ const getYarnCache = (context, policy = "pull-push") => {
|
|
|
5418
5439
|
};
|
|
5419
5440
|
exports.getYarnCache = getYarnCache;
|
|
5420
5441
|
const getNodeModulesCache = (context, policy = "pull-push") => {
|
|
5421
|
-
var _a;
|
|
5442
|
+
var _a, _b;
|
|
5422
5443
|
const componentIsInWorkspace = context.type === "component" &&
|
|
5423
5444
|
context.packageManagerInfo.componentIsInWorkspace;
|
|
5445
|
+
const { isClassic } = context.packageManagerInfo;
|
|
5424
5446
|
// We intentionally do not use the contents of yarn.lock as a cache key, as yarn install should always guarantee that the files are updated, but it can still use part of the cache if not all packages are up-to-date.
|
|
5425
5447
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
5426
5448
|
return [
|
|
@@ -5437,8 +5459,19 @@ const getNodeModulesCache = (context, policy = "pull-push") => {
|
|
|
5437
5459
|
? (0, lodash_1.uniq)([
|
|
5438
5460
|
"node_modules",
|
|
5439
5461
|
...((_a = context.packageManagerInfo.workspaces.map((w) => (0, path_1.join)(w.location, "node_modules"))) !== null && _a !== void 0 ? _a : []),
|
|
5462
|
+
...(!isClassic
|
|
5463
|
+
? [
|
|
5464
|
+
".yarn/install-state.gz",
|
|
5465
|
+
...((_b = context.packageManagerInfo.workspaces.map((w) => (0, path_1.join)(w.location, ".yarn/install-state.gz"))) !== null && _b !== void 0 ? _b : []),
|
|
5466
|
+
]
|
|
5467
|
+
: []),
|
|
5440
5468
|
])
|
|
5441
|
-
: [
|
|
5469
|
+
: [
|
|
5470
|
+
(0, path_1.join)(context.build.dir, "node_modules"),
|
|
5471
|
+
...(!isClassic
|
|
5472
|
+
? [(0, path_1.join)(context.build.dir, ".yarn/install-state.gz")]
|
|
5473
|
+
: []),
|
|
5474
|
+
]),
|
|
5442
5475
|
],
|
|
5443
5476
|
},
|
|
5444
5477
|
];
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const getProjectConfig_1 = require("../../../../../config/getProjectConfig");
|
|
4
4
|
const startProxy_1 = require("../../../../../gcloud/cloudSql/startProxy");
|
|
5
5
|
const autocompletions_1 = require("../utils/autocompletions");
|
|
6
|
-
const
|
|
6
|
+
const parseConnectionString_1 = require("../../../../../gcloud/cloudSql/parseConnectionString");
|
|
7
7
|
const copyDb_1 = require("../../../../../gcloud/cloudSql/copyDb");
|
|
8
8
|
exports.default = async (vorpal) => vorpal
|
|
9
9
|
.command("project-cloud-sql-restore-db", "restores a project db from one source to another target")
|
|
@@ -34,11 +34,7 @@ exports.default = async (vorpal) => vorpal
|
|
|
34
34
|
targetProxy === null || targetProxy === void 0 ? void 0 : targetProxy.stop();
|
|
35
35
|
};
|
|
36
36
|
if (sourceEnv === "local") {
|
|
37
|
-
const
|
|
38
|
-
scheme: "postgres",
|
|
39
|
-
hosts: [],
|
|
40
|
-
});
|
|
41
|
-
const parsersResult = parser.parse(sourceEnvVars.DATABASE_URL.toString());
|
|
37
|
+
const parsersResult = (0, parseConnectionString_1.parseConnectionString)(sourceEnvVars.DATABASE_URL.toString());
|
|
42
38
|
sourcePort = (_b = (_a = parsersResult.hosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.port;
|
|
43
39
|
sourceUsername = parsersResult.username;
|
|
44
40
|
sourcePassword = parsersResult.password;
|
|
@@ -64,11 +60,7 @@ exports.default = async (vorpal) => vorpal
|
|
|
64
60
|
const targetContext = await (0, getProjectConfig_1.getPipelineContextByChoice)(targetEnv, targetComponent);
|
|
65
61
|
const targetEnvVars = await (0, getProjectConfig_1.getEnvVarsResolved)(this, targetContext.env, targetContext.name);
|
|
66
62
|
if (targetEnv === "local") {
|
|
67
|
-
const
|
|
68
|
-
scheme: "postgres",
|
|
69
|
-
hosts: [],
|
|
70
|
-
});
|
|
71
|
-
const parsersResult = parser.parse(targetEnvVars.DATABASE_URL.toString());
|
|
63
|
+
const parsersResult = (0, parseConnectionString_1.parseConnectionString)(targetEnvVars.DATABASE_URL.toString());
|
|
72
64
|
targetPort = (_e = (_d = parsersResult.hosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.port;
|
|
73
65
|
targetUsername = parsersResult.username;
|
|
74
66
|
targetPassword = parsersResult.password;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandProjectRestoreDb.js","sourceRoot":"","sources":["../../../../../../../../src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts"],"names":[],"mappings":";;AACA,6EAGgD;AAEhD,0EAA2F;AAC3F,8DAA4D;AAE5D,
|
|
1
|
+
{"version":3,"file":"commandProjectRestoreDb.js","sourceRoot":"","sources":["../../../../../../../../src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts"],"names":[],"mappings":";;AACA,6EAGgD;AAEhD,0EAA2F;AAC3F,8DAA4D;AAE5D,gGAA6F;AAC7F,k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,EAAE,iBAAiB;YACvB,OAAO,EAAE,WAAW;SACrB,CAAC,CAAC;QAEH,IACE,eAAe,KAAK,aAAa,CAAC,kCAAkC,EACpE,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAClB,QAAQ,EAAE,CAAC;YACX,OAAO;QACT,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAA,oBAAW,EAAC;YAChB,cAAc;YACd,UAAU;YACV,cAAc;YACd,cAAc;YACd,cAAc;YACd,UAAU;YACV,YAAY;YACZ,YAAY;SACb,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,QAAQ,EAAE,CAAC;IACb,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IConnectionStringParameters } from "connection-string-parser";
|
|
2
|
+
/**
|
|
3
|
+
* Parses a PostgreSQL connection string.
|
|
4
|
+
* Accepts both postgres:// and postgresql:// schemes and normalizes to postgresql://
|
|
5
|
+
*
|
|
6
|
+
* @param connectionString - The connection string to parse (e.g., "postgresql://user:pass@localhost:5432/dbname")
|
|
7
|
+
* @returns Parsed connection string parameters
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseConnectionString(connectionString: string): IConnectionStringParameters;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseConnectionString = void 0;
|
|
4
|
+
const connection_string_parser_1 = require("connection-string-parser");
|
|
5
|
+
/**
|
|
6
|
+
* Parses a PostgreSQL connection string.
|
|
7
|
+
* Accepts both postgres:// and postgresql:// schemes and normalizes to postgresql://
|
|
8
|
+
*
|
|
9
|
+
* @param connectionString - The connection string to parse (e.g., "postgresql://user:pass@localhost:5432/dbname")
|
|
10
|
+
* @returns Parsed connection string parameters
|
|
11
|
+
*/
|
|
12
|
+
function parseConnectionString(connectionString) {
|
|
13
|
+
const parser = new connection_string_parser_1.ConnectionStringParser({
|
|
14
|
+
scheme: "postgresql",
|
|
15
|
+
hosts: [],
|
|
16
|
+
});
|
|
17
|
+
// Normalize postgres:// to postgresql:// (the official IANA scheme)
|
|
18
|
+
const normalizedConnectionString = connectionString.replace(/^postgres:\/\//, "postgresql://");
|
|
19
|
+
return parser.parse(normalizedConnectionString);
|
|
20
|
+
}
|
|
21
|
+
exports.parseConnectionString = parseConnectionString;
|
|
22
|
+
//# sourceMappingURL=parseConnectionString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseConnectionString.js","sourceRoot":"","sources":["../../../../../src/gcloud/cloudSql/parseConnectionString.ts"],"names":[],"mappings":";;;AAAA,uEAGkC;AAElC;;;;;;GAMG;AACH,SAAgB,qBAAqB,CACnC,gBAAwB;IAExB,MAAM,MAAM,GAAG,IAAI,iDAAsB,CAAC;QACxC,MAAM,EAAE,YAAY;QACpB,KAAK,EAAE,EAAE;KACV,CAAC,CAAC;IAEH,oEAAoE;IACpE,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,OAAO,CACzD,gBAAgB,EAChB,eAAe,CAChB,CAAC;IAEF,OAAO,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAClD,CAAC;AAfD,sDAeC"}
|
|
@@ -22,9 +22,10 @@ const getYarnCache = (context, policy = "pull-push") => {
|
|
|
22
22
|
};
|
|
23
23
|
exports.getYarnCache = getYarnCache;
|
|
24
24
|
const getNodeModulesCache = (context, policy = "pull-push") => {
|
|
25
|
-
var _a;
|
|
25
|
+
var _a, _b;
|
|
26
26
|
const componentIsInWorkspace = context.type === "component" &&
|
|
27
27
|
context.packageManagerInfo.componentIsInWorkspace;
|
|
28
|
+
const { isClassic } = context.packageManagerInfo;
|
|
28
29
|
// We intentionally do not use the contents of yarn.lock as a cache key, as yarn install should always guarantee that the files are updated, but it can still use part of the cache if not all packages are up-to-date.
|
|
29
30
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
30
31
|
return [
|
|
@@ -41,8 +42,19 @@ const getNodeModulesCache = (context, policy = "pull-push") => {
|
|
|
41
42
|
? (0, lodash_1.uniq)([
|
|
42
43
|
"node_modules",
|
|
43
44
|
...((_a = context.packageManagerInfo.workspaces.map((w) => (0, path_1.join)(w.location, "node_modules"))) !== null && _a !== void 0 ? _a : []),
|
|
45
|
+
...(!isClassic
|
|
46
|
+
? [
|
|
47
|
+
".yarn/install-state.gz",
|
|
48
|
+
...((_b = context.packageManagerInfo.workspaces.map((w) => (0, path_1.join)(w.location, ".yarn/install-state.gz"))) !== null && _b !== void 0 ? _b : []),
|
|
49
|
+
]
|
|
50
|
+
: []),
|
|
44
51
|
])
|
|
45
|
-
: [
|
|
52
|
+
: [
|
|
53
|
+
(0, path_1.join)(context.build.dir, "node_modules"),
|
|
54
|
+
...(!isClassic
|
|
55
|
+
? [(0, path_1.join)(context.build.dir, ".yarn/install-state.gz")]
|
|
56
|
+
: []),
|
|
57
|
+
]),
|
|
46
58
|
],
|
|
47
59
|
},
|
|
48
60
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../../../../pipeline/src/build/node/cache.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA8B;AAC9B,+BAA4B;AAC5B,sDAA8B;AAKvB,MAAM,YAAY,GAAG,CAC1B,OAAgB,EAChB,MAAM,GAAG,WAAW,EACL,EAAE;IACjB,MAAM,sBAAsB,GAC1B,OAAO,CAAC,IAAI,KAAK,WAAW;QAC5B,OAAO,CAAC,kBAAkB,CAAC,sBAAsB,CAAC;IACpD,OAAO;QACL;YACE,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU;YACrD,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;YAC1D,GAAG,EAAE,MAAM;YACX,MAAM;YACN,KAAK,EAAE,CAAC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