@quiltdata/benchling-webhook 0.6.1-20251104T051705Z → 0.6.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.
- package/dist/bin/check-logs.d.ts +7 -0
- package/dist/bin/check-logs.d.ts.map +1 -0
- package/dist/bin/check-logs.js +51 -60
- package/dist/bin/check-logs.js.map +1 -0
- package/dist/bin/dev-deploy.d.ts +20 -0
- package/dist/bin/dev-deploy.d.ts.map +1 -0
- package/dist/bin/dev-deploy.js +289 -0
- package/dist/bin/dev-deploy.js.map +1 -0
- package/dist/bin/get-env.d.ts +16 -0
- package/dist/bin/get-env.d.ts.map +1 -0
- package/dist/bin/get-env.js +61 -31
- package/dist/bin/get-env.js.map +1 -0
- package/dist/bin/publish.d.ts +20 -0
- package/dist/bin/publish.d.ts.map +1 -0
- package/dist/bin/publish.js +280 -280
- package/dist/bin/publish.js.map +1 -0
- package/dist/bin/release.d.ts +11 -0
- package/dist/bin/release.d.ts.map +1 -0
- package/dist/bin/release.js +125 -102
- package/dist/bin/release.js.map +1 -0
- package/dist/bin/send-event.d.ts +6 -0
- package/dist/bin/send-event.d.ts.map +1 -0
- package/dist/bin/send-event.js +73 -59
- package/dist/bin/send-event.js.map +1 -0
- package/dist/bin/test-invalid-signature.d.ts +3 -0
- package/dist/bin/test-invalid-signature.d.ts.map +1 -0
- package/dist/bin/test-invalid-signature.js +64 -74
- package/dist/bin/test-invalid-signature.js.map +1 -0
- package/dist/bin/version.d.ts +13 -0
- package/dist/bin/version.d.ts.map +1 -0
- package/dist/bin/version.js +194 -181
- package/dist/bin/version.js.map +1 -0
- package/dist/lib/utils/secrets.d.ts +14 -0
- package/dist/lib/utils/secrets.d.ts.map +1 -1
- package/dist/lib/utils/secrets.js +19 -0
- package/dist/lib/utils/secrets.js.map +1 -1
- package/dist/package.json +7 -7
- package/dist/scripts/config-health-check.d.ts +1 -1
- package/dist/scripts/config-health-check.d.ts.map +1 -1
- package/dist/scripts/config-health-check.js +33 -43
- package/dist/scripts/config-health-check.js.map +1 -1
- package/dist/scripts/sync-secrets.d.ts.map +1 -1
- package/dist/scripts/sync-secrets.js +2 -16
- package/dist/scripts/sync-secrets.js.map +1 -1
- package/package.json +7 -7
- package/dist/bin/cdk-dev.js +0 -308
|
@@ -1,125 +1,115 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
5
7
|
// Parse command line arguments
|
|
6
8
|
const args = process.argv.slice(2);
|
|
7
9
|
if (args.length === 0) {
|
|
8
|
-
console.error(
|
|
9
|
-
console.error(
|
|
10
|
+
console.error("Usage: test-invalid-signature.js <webhook-url>");
|
|
11
|
+
console.error("Example: test-invalid-signature.js https://example.com/prod/lifecycle");
|
|
10
12
|
process.exit(1);
|
|
11
13
|
}
|
|
12
|
-
|
|
13
14
|
const webhookUrl = args[0];
|
|
14
|
-
|
|
15
15
|
// Read the test payload
|
|
16
|
-
const testPayload = JSON.parse(
|
|
16
|
+
const testPayload = JSON.parse((0, fs_1.readFileSync)("test-events/app-installed.json", "utf8"));
|
|
17
17
|
const rawBody = JSON.stringify(testPayload);
|
|
18
|
-
|
|
19
18
|
// Generate a WRONG key pair (not the one Benchling has)
|
|
20
|
-
const { privateKey } = generateKeyPairSync(
|
|
21
|
-
namedCurve:
|
|
19
|
+
const { privateKey } = (0, crypto_1.generateKeyPairSync)("ec", {
|
|
20
|
+
namedCurve: "prime256v1",
|
|
22
21
|
});
|
|
23
|
-
|
|
24
22
|
// Create realistic webhook headers
|
|
25
|
-
const webhookId =
|
|
23
|
+
const webhookId = "wh_test123";
|
|
26
24
|
const webhookTimestamp = Math.floor(Date.now() / 1000).toString();
|
|
27
|
-
|
|
28
25
|
// Sign with the WRONG private key
|
|
29
26
|
const payloadToSign = `${webhookId}.${webhookTimestamp}.${rawBody}`;
|
|
30
|
-
const signer = createSign(
|
|
27
|
+
const signer = (0, crypto_1.createSign)("sha256");
|
|
31
28
|
signer.update(payloadToSign);
|
|
32
29
|
signer.end();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
console.log(
|
|
37
|
-
console.log(
|
|
38
|
-
console.log(
|
|
39
|
-
console.log(
|
|
40
|
-
console.log(
|
|
41
|
-
console.log(
|
|
42
|
-
console.log('\nNote: This signature is valid ECDSA format but signed with the WRONG key.');
|
|
43
|
-
console.log('The webhook MUST reject this request.\n');
|
|
44
|
-
|
|
30
|
+
const invalidSignature = signer.sign(privateKey).toString("base64");
|
|
31
|
+
console.log("Testing webhook security with INVALID signature");
|
|
32
|
+
console.log("=".repeat(60));
|
|
33
|
+
console.log("Target URL:", webhookUrl);
|
|
34
|
+
console.log("Webhook-Id:", webhookId);
|
|
35
|
+
console.log("Webhook-Timestamp:", webhookTimestamp);
|
|
36
|
+
console.log("Webhook-Signature:", `v1bder,${invalidSignature}`);
|
|
37
|
+
console.log("\nNote: This signature is valid ECDSA format but signed with the WRONG key.");
|
|
38
|
+
console.log("The webhook MUST reject this request.\n");
|
|
45
39
|
// Make the actual HTTP request
|
|
46
40
|
(async () => {
|
|
47
41
|
try {
|
|
48
42
|
const response = await fetch(webhookUrl, {
|
|
49
|
-
method:
|
|
43
|
+
method: "POST",
|
|
50
44
|
headers: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
"Content-Type": "application/json",
|
|
46
|
+
"webhook-id": webhookId,
|
|
47
|
+
"webhook-timestamp": webhookTimestamp,
|
|
48
|
+
"webhook-signature": `v1bder,${invalidSignature}`,
|
|
55
49
|
},
|
|
56
|
-
body: rawBody
|
|
50
|
+
body: rawBody,
|
|
57
51
|
});
|
|
58
|
-
|
|
59
52
|
const responseText = await response.text();
|
|
60
53
|
let responseBody;
|
|
61
54
|
try {
|
|
62
55
|
responseBody = JSON.parse(responseText);
|
|
63
|
-
}
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
64
58
|
responseBody = responseText;
|
|
65
59
|
}
|
|
66
|
-
|
|
67
|
-
console.log(
|
|
68
|
-
console.log('Response Body:', JSON.stringify(responseBody, null, 2));
|
|
60
|
+
console.log("Response Status:", response.status, response.statusText);
|
|
61
|
+
console.log("Response Body:", JSON.stringify(responseBody, null, 2));
|
|
69
62
|
console.log();
|
|
70
|
-
|
|
71
63
|
// Validate the response
|
|
72
64
|
if (response.status === 202) {
|
|
73
|
-
console.log(
|
|
74
|
-
console.log(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
console.log(' Checking execution status...');
|
|
65
|
+
console.log("⚠️ WARNING: Request was ACCEPTED (202)");
|
|
66
|
+
console.log(" This means validation happens asynchronously.");
|
|
67
|
+
if (typeof responseBody === "object" && responseBody.executionArn) {
|
|
68
|
+
console.log(" Checking execution status...");
|
|
78
69
|
const executionArn = responseBody.executionArn;
|
|
79
|
-
|
|
80
70
|
// Wait a bit for execution to start
|
|
81
71
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
82
|
-
|
|
83
72
|
// Check execution status using AWS CLI
|
|
84
|
-
const { execSync } = require('child_process');
|
|
85
73
|
try {
|
|
86
|
-
const status = execSync(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (status === 'FAILED') {
|
|
94
|
-
const history = execSync(
|
|
95
|
-
`aws stepfunctions get-execution-history --execution-arn "${executionArn}" --query 'events[?type==\`ExecutionFailed\`].executionFailedEventDetails.error' --output text`,
|
|
96
|
-
{ encoding: 'utf8' }
|
|
97
|
-
).trim();
|
|
98
|
-
console.log(' Failure Reason:', history || 'WebhookVerificationError');
|
|
99
|
-
console.log('\n✅ PASS: Webhook correctly rejected invalid signature (async)');
|
|
74
|
+
const status = (0, child_process_1.execSync)(`aws stepfunctions describe-execution --execution-arn "${executionArn}" --query 'status' --output text`, { encoding: "utf8" }).trim();
|
|
75
|
+
console.log(" Execution Status:", status);
|
|
76
|
+
if (status === "FAILED") {
|
|
77
|
+
const history = (0, child_process_1.execSync)(`aws stepfunctions get-execution-history --execution-arn "${executionArn}" --query 'events[?type==\`ExecutionFailed\`].executionFailedEventDetails.error' --output text`, { encoding: "utf8" }).trim();
|
|
78
|
+
console.log(" Failure Reason:", history || "WebhookVerificationError");
|
|
79
|
+
console.log("\n✅ PASS: Webhook correctly rejected invalid signature (async)");
|
|
100
80
|
process.exit(0);
|
|
101
|
-
}
|
|
102
|
-
|
|
81
|
+
}
|
|
82
|
+
else if (status === "SUCCEEDED") {
|
|
83
|
+
console.log("\n❌ FAIL: Webhook accepted invalid signature!");
|
|
103
84
|
process.exit(1);
|
|
104
|
-
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
105
87
|
console.log(` Status: ${status} - manual verification needed`);
|
|
106
88
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
92
|
+
console.log(" Could not check execution status:", errorMessage);
|
|
109
93
|
}
|
|
110
94
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
95
|
+
}
|
|
96
|
+
else if (response.status === 401 || response.status === 403) {
|
|
97
|
+
console.log("✅ PASS: Webhook correctly rejected invalid signature (sync)");
|
|
113
98
|
process.exit(0);
|
|
114
|
-
}
|
|
99
|
+
}
|
|
100
|
+
else if (response.status >= 400) {
|
|
115
101
|
console.log(`⚠️ Request rejected with status ${response.status}`);
|
|
116
|
-
console.log(
|
|
117
|
-
}
|
|
118
|
-
|
|
102
|
+
console.log(" Manual verification needed");
|
|
103
|
+
}
|
|
104
|
+
else if (response.status >= 200 && response.status < 300) {
|
|
105
|
+
console.log("❌ FAIL: Webhook accepted invalid signature!");
|
|
119
106
|
process.exit(1);
|
|
120
107
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
111
|
+
console.error("Error making request:", errorMessage);
|
|
123
112
|
process.exit(1);
|
|
124
113
|
}
|
|
125
114
|
})();
|
|
115
|
+
//# sourceMappingURL=test-invalid-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-invalid-signature.js","sourceRoot":"","sources":["../../bin/test-invalid-signature.ts"],"names":[],"mappings":";;;AACA,mCAAyD;AACzD,2BAAkC;AAClC,iDAAyC;AAEzC,+BAA+B;AAC/B,MAAM,IAAI,GAAa,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC7C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IACpB,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAChE,OAAO,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;IACvF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,GAAW,IAAI,CAAC,CAAC,CAAC,CAAC;AAEnC,wBAAwB;AACxB,MAAM,WAAW,GAAY,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,gCAAgC,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,MAAM,OAAO,GAAW,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAEpD,wDAAwD;AACxD,MAAM,EAAE,UAAU,EAAE,GAAG,IAAA,4BAAmB,EAAC,IAAI,EAAE;IAC7C,UAAU,EAAE,YAAY;CAC3B,CAAC,CAAC;AAEH,mCAAmC;AACnC,MAAM,SAAS,GAAW,YAAY,CAAC;AACvC,MAAM,gBAAgB,GAAW,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,QAAQ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MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACzD,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;YAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Version management script - bumps version numbers across all files
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node bin/version.js # Show all three version files
|
|
7
|
+
* node bin/version.js patch # 0.4.7 -> 0.4.8
|
|
8
|
+
* node bin/version.js minor # 0.4.7 -> 0.5.0
|
|
9
|
+
* node bin/version.js major # 0.4.7 -> 1.0.0
|
|
10
|
+
* node bin/version.js sync # Force TOML and YAML to match JSON version
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../bin/version.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG"}
|
package/dist/bin/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
"use strict";
|
|
3
3
|
/**
|
|
4
4
|
* Version management script - bumps version numbers across all files
|
|
5
5
|
*
|
|
@@ -10,205 +10,218 @@
|
|
|
10
10
|
* node bin/version.js major # 0.4.7 -> 1.0.0
|
|
11
11
|
* node bin/version.js sync # Force TOML and YAML to match JSON version
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
const fs = __importStar(require("fs"));
|
|
48
|
+
const path = __importStar(require("path"));
|
|
49
|
+
const child_process_1 = require("child_process");
|
|
50
|
+
const packagePath = path.join(__dirname, "..", "package.json");
|
|
51
|
+
const pyprojectPath = path.join(__dirname, "..", "docker", "pyproject.toml");
|
|
52
|
+
const appManifestPath = path.join(__dirname, "..", "docker", "app-manifest.yaml");
|
|
53
|
+
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf8"));
|
|
23
54
|
function readPyprojectVersion() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
55
|
+
const content = fs.readFileSync(pyprojectPath, "utf8");
|
|
56
|
+
const match = content.match(/^version\s*=\s*"([^"]+)"/m);
|
|
57
|
+
return match ? match[1] : null;
|
|
27
58
|
}
|
|
28
|
-
|
|
29
59
|
function readAppManifestVersion() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
60
|
+
const content = fs.readFileSync(appManifestPath, "utf8");
|
|
61
|
+
const match = content.match(/^\s*version:\s*(.+)$/m);
|
|
62
|
+
return match ? match[1].trim() : null;
|
|
33
63
|
}
|
|
34
|
-
|
|
35
64
|
function parseVersion(version) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
65
|
+
const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
|
|
66
|
+
if (!match) {
|
|
67
|
+
throw new Error(`Invalid version format: ${version}`);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
major: parseInt(match[1], 10),
|
|
71
|
+
minor: parseInt(match[2], 10),
|
|
72
|
+
patch: parseInt(match[3], 10),
|
|
73
|
+
};
|
|
45
74
|
}
|
|
46
|
-
|
|
47
75
|
function formatVersion(ver) {
|
|
48
|
-
|
|
76
|
+
return `${ver.major}.${ver.minor}.${ver.patch}`;
|
|
49
77
|
}
|
|
50
|
-
|
|
51
78
|
function bumpVersion(currentVersion, bumpType) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return formatVersion(ver);
|
|
79
|
+
const ver = parseVersion(currentVersion);
|
|
80
|
+
switch (bumpType) {
|
|
81
|
+
case "major":
|
|
82
|
+
ver.major++;
|
|
83
|
+
ver.minor = 0;
|
|
84
|
+
ver.patch = 0;
|
|
85
|
+
break;
|
|
86
|
+
case "minor":
|
|
87
|
+
ver.minor++;
|
|
88
|
+
ver.patch = 0;
|
|
89
|
+
break;
|
|
90
|
+
case "patch":
|
|
91
|
+
ver.patch++;
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
throw new Error(`Unknown bump type: ${bumpType}`);
|
|
95
|
+
}
|
|
96
|
+
return formatVersion(ver);
|
|
72
97
|
}
|
|
73
|
-
|
|
74
98
|
function updatePackageVersion(newVersion) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
99
|
+
pkg.version = newVersion;
|
|
100
|
+
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2) + "\n");
|
|
101
|
+
console.log(`✅ Updated package.json to version ${newVersion}`);
|
|
78
102
|
}
|
|
79
|
-
|
|
80
103
|
function updatePyprojectVersion(newVersion) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
let content = fs.readFileSync(pyprojectPath, "utf8");
|
|
105
|
+
content = content.replace(/^version\s*=\s*"[^"]+"/m, `version = "${newVersion}"`);
|
|
106
|
+
fs.writeFileSync(pyprojectPath, content);
|
|
107
|
+
console.log(`✅ Updated docker/pyproject.toml to version ${newVersion}`);
|
|
85
108
|
}
|
|
86
|
-
|
|
87
109
|
function updateAppManifestVersion(newVersion) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
110
|
+
let content = fs.readFileSync(appManifestPath, "utf8");
|
|
111
|
+
content = content.replace(/^(\s*)version:\s*.+$/m, `$1version: ${newVersion}`);
|
|
112
|
+
fs.writeFileSync(appManifestPath, content);
|
|
113
|
+
console.log(`✅ Updated docker/app-manifest.yaml to version ${newVersion}`);
|
|
92
114
|
}
|
|
93
|
-
|
|
94
115
|
function main() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
const args = process.argv.slice(2);
|
|
117
|
+
// No args: display all three versions
|
|
118
|
+
if (args.length === 0) {
|
|
119
|
+
const jsonVersion = pkg.version;
|
|
120
|
+
const tomlVersion = readPyprojectVersion();
|
|
121
|
+
const yamlVersion = readAppManifestVersion();
|
|
122
|
+
console.log("Version files:");
|
|
123
|
+
console.log(` package.json: ${jsonVersion}`);
|
|
124
|
+
console.log(` docker/pyproject.toml: ${tomlVersion}`);
|
|
125
|
+
console.log(` docker/app-manifest.yaml: ${yamlVersion}`);
|
|
126
|
+
if (jsonVersion === tomlVersion && jsonVersion === yamlVersion) {
|
|
127
|
+
console.log("\n✅ All versions are in sync");
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
console.log("\n⚠️ Versions are out of sync! Run \"node bin/version.js sync\" to fix.");
|
|
131
|
+
}
|
|
132
|
+
process.exit(0);
|
|
133
|
+
}
|
|
134
|
+
// Help
|
|
135
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
136
|
+
console.log("Current version:", pkg.version);
|
|
137
|
+
console.log("");
|
|
138
|
+
console.log("Usage: node bin/version.js [command]");
|
|
139
|
+
console.log("");
|
|
140
|
+
console.log("Commands:");
|
|
141
|
+
console.log(" (no args) - Display all three version files");
|
|
142
|
+
console.log(" major - Bump major version (1.0.0 -> 2.0.0)");
|
|
143
|
+
console.log(" minor - Bump minor version (0.4.7 -> 0.5.0)");
|
|
144
|
+
console.log(" patch - Bump patch version (0.4.7 -> 0.4.8)");
|
|
145
|
+
console.log(" sync - Force TOML and YAML to match JSON version");
|
|
146
|
+
console.log("");
|
|
147
|
+
console.log("This script updates version numbers in:");
|
|
148
|
+
console.log(" - package.json");
|
|
149
|
+
console.log(" - docker/pyproject.toml");
|
|
150
|
+
console.log(" - docker/app-manifest.yaml");
|
|
151
|
+
console.log("");
|
|
152
|
+
console.log("To create a release tag, use: npm run release or npm run release:dev");
|
|
153
|
+
process.exit(0);
|
|
154
|
+
}
|
|
155
|
+
const bumpType = args[0];
|
|
156
|
+
// Sync command - force TOML and YAML to match JSON
|
|
157
|
+
if (bumpType === "sync") {
|
|
158
|
+
const jsonVersion = pkg.version;
|
|
159
|
+
const tomlVersion = readPyprojectVersion();
|
|
160
|
+
const yamlVersion = readAppManifestVersion();
|
|
161
|
+
console.log("Syncing versions to match package.json:");
|
|
162
|
+
console.log(` package.json: ${jsonVersion}`);
|
|
163
|
+
console.log(` docker/pyproject.toml: ${tomlVersion} -> ${jsonVersion}`);
|
|
164
|
+
console.log(` docker/app-manifest.yaml: ${yamlVersion} -> ${jsonVersion}`);
|
|
165
|
+
console.log("");
|
|
166
|
+
try {
|
|
167
|
+
updatePyprojectVersion(jsonVersion);
|
|
168
|
+
updateAppManifestVersion(jsonVersion);
|
|
169
|
+
// Check if version files have changes
|
|
170
|
+
let hasChanges = false;
|
|
171
|
+
try {
|
|
172
|
+
(0, child_process_1.execSync)("git diff --quiet docker/pyproject.toml docker/app-manifest.yaml", { stdio: "ignore" });
|
|
173
|
+
}
|
|
174
|
+
catch (e) {
|
|
175
|
+
hasChanges = true;
|
|
176
|
+
}
|
|
177
|
+
if (hasChanges) {
|
|
178
|
+
(0, child_process_1.execSync)("git add docker/pyproject.toml docker/app-manifest.yaml", { stdio: "inherit" });
|
|
179
|
+
(0, child_process_1.execSync)(`git commit -m "chore: sync versions to ${jsonVersion}"`, { stdio: "inherit" });
|
|
180
|
+
console.log("✅ Committed version sync");
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
console.log("✅ All versions already in sync (no changes to commit)");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
188
|
+
console.error("❌ Error:", message);
|
|
189
|
+
process.exit(1);
|
|
190
|
+
}
|
|
191
|
+
process.exit(0);
|
|
112
192
|
}
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Help
|
|
117
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
118
|
-
console.log('Current version:', pkg.version);
|
|
119
|
-
console.log('');
|
|
120
|
-
console.log('Usage: node bin/version.js [command]');
|
|
121
|
-
console.log('');
|
|
122
|
-
console.log('Commands:');
|
|
123
|
-
console.log(' (no args) - Display all three version files');
|
|
124
|
-
console.log(' major - Bump major version (1.0.0 -> 2.0.0)');
|
|
125
|
-
console.log(' minor - Bump minor version (0.4.7 -> 0.5.0)');
|
|
126
|
-
console.log(' patch - Bump patch version (0.4.7 -> 0.4.8)');
|
|
127
|
-
console.log(' sync - Force TOML and YAML to match JSON version');
|
|
128
|
-
console.log('');
|
|
129
|
-
console.log('This script updates version numbers in:');
|
|
130
|
-
console.log(' - package.json');
|
|
131
|
-
console.log(' - docker/pyproject.toml');
|
|
132
|
-
console.log(' - docker/app-manifest.yaml');
|
|
133
|
-
console.log('');
|
|
134
|
-
console.log('To create a release tag, use: npm run release or npm run release:dev');
|
|
135
|
-
process.exit(0);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const bumpType = args[0];
|
|
139
|
-
|
|
140
|
-
// Sync command - force TOML and YAML to match JSON
|
|
141
|
-
if (bumpType === 'sync') {
|
|
142
|
-
const jsonVersion = pkg.version;
|
|
143
|
-
const tomlVersion = readPyprojectVersion();
|
|
144
|
-
const yamlVersion = readAppManifestVersion();
|
|
145
|
-
|
|
146
|
-
console.log('Syncing versions to match package.json:');
|
|
147
|
-
console.log(` package.json: ${jsonVersion}`);
|
|
148
|
-
console.log(` docker/pyproject.toml: ${tomlVersion} -> ${jsonVersion}`);
|
|
149
|
-
console.log(` docker/app-manifest.yaml: ${yamlVersion} -> ${jsonVersion}`);
|
|
150
|
-
console.log('');
|
|
151
|
-
|
|
193
|
+
// Check for uncommitted changes
|
|
152
194
|
try {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
195
|
+
(0, child_process_1.execSync)("git diff-index --quiet HEAD --", { stdio: "ignore" });
|
|
196
|
+
}
|
|
197
|
+
catch (e) {
|
|
198
|
+
console.error("❌ You have uncommitted changes");
|
|
199
|
+
console.error(" Commit or stash your changes before bumping version");
|
|
200
|
+
process.exit(1);
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
const currentVersion = pkg.version;
|
|
204
|
+
const newVersion = bumpVersion(currentVersion, bumpType);
|
|
205
|
+
console.log(`Bumping version: ${currentVersion} -> ${newVersion}`);
|
|
206
|
+
console.log("");
|
|
207
|
+
// Update all version files
|
|
208
|
+
updatePackageVersion(newVersion);
|
|
209
|
+
updatePyprojectVersion(newVersion);
|
|
210
|
+
updateAppManifestVersion(newVersion);
|
|
211
|
+
// Commit the changes
|
|
212
|
+
(0, child_process_1.execSync)("git add package.json docker/pyproject.toml docker/app-manifest.yaml", { stdio: "inherit" });
|
|
213
|
+
(0, child_process_1.execSync)(`git commit -m "chore: bump version to ${newVersion}"`, { stdio: "inherit" });
|
|
214
|
+
console.log("✅ Committed version change");
|
|
215
|
+
console.log("");
|
|
216
|
+
console.log("Next steps:");
|
|
217
|
+
console.log(" 1. Push changes: git push");
|
|
218
|
+
console.log(" 2. Create release: npm run release (or npm run release:dev for dev release)");
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
222
|
+
console.error("❌ Error:", message);
|
|
223
|
+
process.exit(1);
|
|
174
224
|
}
|
|
175
|
-
process.exit(0);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Check for uncommitted changes
|
|
179
|
-
try {
|
|
180
|
-
execSync('git diff-index --quiet HEAD --', { stdio: 'ignore' });
|
|
181
|
-
} catch (e) {
|
|
182
|
-
console.error('❌ You have uncommitted changes');
|
|
183
|
-
console.error(' Commit or stash your changes before bumping version');
|
|
184
|
-
process.exit(1);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
const currentVersion = pkg.version;
|
|
189
|
-
const newVersion = bumpVersion(currentVersion, bumpType);
|
|
190
|
-
|
|
191
|
-
console.log(`Bumping version: ${currentVersion} -> ${newVersion}`);
|
|
192
|
-
console.log('');
|
|
193
|
-
|
|
194
|
-
// Update all version files
|
|
195
|
-
updatePackageVersion(newVersion);
|
|
196
|
-
updatePyprojectVersion(newVersion);
|
|
197
|
-
updateAppManifestVersion(newVersion);
|
|
198
|
-
|
|
199
|
-
// Commit the changes
|
|
200
|
-
execSync('git add package.json docker/pyproject.toml docker/app-manifest.yaml', { stdio: 'inherit' });
|
|
201
|
-
execSync(`git commit -m "chore: bump version to ${newVersion}"`, { stdio: 'inherit' });
|
|
202
|
-
console.log(`✅ Committed version change`);
|
|
203
|
-
console.log('');
|
|
204
|
-
console.log('Next steps:');
|
|
205
|
-
console.log(' 1. Push changes: git push');
|
|
206
|
-
console.log(' 2. Create release: npm run release (or npm run release:dev for dev release)');
|
|
207
|
-
|
|
208
|
-
} catch (error) {
|
|
209
|
-
console.error('❌ Error:', error.message);
|
|
210
|
-
process.exit(1);
|
|
211
|
-
}
|
|
212
225
|
}
|
|
213
|
-
|
|
214
226
|
main();
|
|
227
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../bin/version.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAyC;AAezC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAC/D,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC;AAC7E,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAClF,MAAM,GAAG,GAAgB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1E,SAAS,oBAAoB;IACzB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,SAAS,sBAAsB;IAC3B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC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