@quiltdata/benchling-webhook 0.6.1-20251104T053146Z → 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.
@@ -1,125 +1,115 @@
1
1
  #!/usr/bin/env node
2
- const { createSign, generateKeyPairSync } = require('crypto');
3
- const fs = require('fs');
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('Usage: test-invalid-signature.js <webhook-url>');
9
- console.error('Example: test-invalid-signature.js https://example.com/prod/lifecycle');
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(fs.readFileSync('test-events/app-installed.json', 'utf8'));
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('ec', {
21
- namedCurve: 'prime256v1'
19
+ const { privateKey } = (0, crypto_1.generateKeyPairSync)("ec", {
20
+ namedCurve: "prime256v1",
22
21
  });
23
-
24
22
  // Create realistic webhook headers
25
- const webhookId = 'wh_test123';
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('sha256');
27
+ const signer = (0, crypto_1.createSign)("sha256");
31
28
  signer.update(payloadToSign);
32
29
  signer.end();
33
-
34
- const invalidSignature = signer.sign(privateKey).toString('base64');
35
-
36
- console.log('Testing webhook security with INVALID signature');
37
- console.log('='.repeat(60));
38
- console.log('Target URL:', webhookUrl);
39
- console.log('Webhook-Id:', webhookId);
40
- console.log('Webhook-Timestamp:', webhookTimestamp);
41
- console.log('Webhook-Signature:', `v1bder,${invalidSignature}`);
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: 'POST',
43
+ method: "POST",
50
44
  headers: {
51
- 'Content-Type': 'application/json',
52
- 'webhook-id': webhookId,
53
- 'webhook-timestamp': webhookTimestamp,
54
- 'webhook-signature': `v1bder,${invalidSignature}`
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
- } catch {
56
+ }
57
+ catch {
64
58
  responseBody = responseText;
65
59
  }
66
-
67
- console.log('Response Status:', response.status, response.statusText);
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('⚠️ WARNING: Request was ACCEPTED (202)');
74
- console.log(' This means validation happens asynchronously.');
75
-
76
- if (responseBody.executionArn) {
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
- `aws stepfunctions describe-execution --execution-arn "${executionArn}" --query 'status' --output text`,
88
- { encoding: 'utf8' }
89
- ).trim();
90
-
91
- console.log(' Execution Status:', status);
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
- } else if (status === 'SUCCEEDED') {
102
- console.log('\n❌ FAIL: Webhook accepted invalid signature!');
81
+ }
82
+ else if (status === "SUCCEEDED") {
83
+ console.log("\n❌ FAIL: Webhook accepted invalid signature!");
103
84
  process.exit(1);
104
- } else {
85
+ }
86
+ else {
105
87
  console.log(` Status: ${status} - manual verification needed`);
106
88
  }
107
- } catch (error) {
108
- console.log(' Could not check execution status:', error.message);
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
- } else if (response.status === 401 || response.status === 403) {
112
- console.log('✅ PASS: Webhook correctly rejected invalid signature (sync)');
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
- } else if (response.status >= 400) {
99
+ }
100
+ else if (response.status >= 400) {
115
101
  console.log(`⚠️ Request rejected with status ${response.status}`);
116
- console.log(' Manual verification needed');
117
- } else if (response.status >= 200 && response.status < 300) {
118
- console.log('❌ FAIL: Webhook accepted invalid signature!');
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
- } catch (error) {
122
- console.error('Error making request:', error.message);
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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# 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"}
@@ -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
- const fs = require('fs');
15
- const path = require('path');
16
- const { execSync } = require('child_process');
17
-
18
- const packagePath = path.join(__dirname, '..', 'package.json');
19
- const pyprojectPath = path.join(__dirname, '..', 'docker', 'pyproject.toml');
20
- const appManifestPath = path.join(__dirname, '..', 'docker', 'app-manifest.yaml');
21
- const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
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
- const content = fs.readFileSync(pyprojectPath, 'utf8');
25
- const match = content.match(/^version\s*=\s*"([^"]+)"/m);
26
- return match ? match[1] : null;
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
- const content = fs.readFileSync(appManifestPath, 'utf8');
31
- const match = content.match(/^\s*version:\s*(.+)$/m);
32
- return match ? match[1].trim() : null;
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
- const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
37
- if (!match) {
38
- throw new Error(`Invalid version format: ${version}`);
39
- }
40
- return {
41
- major: parseInt(match[1]),
42
- minor: parseInt(match[2]),
43
- patch: parseInt(match[3])
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
- return `${ver.major}.${ver.minor}.${ver.patch}`;
76
+ return `${ver.major}.${ver.minor}.${ver.patch}`;
49
77
  }
50
-
51
78
  function bumpVersion(currentVersion, bumpType) {
52
- const ver = parseVersion(currentVersion);
53
-
54
- switch (bumpType) {
55
- case 'major':
56
- ver.major++;
57
- ver.minor = 0;
58
- ver.patch = 0;
59
- break;
60
- case 'minor':
61
- ver.minor++;
62
- ver.patch = 0;
63
- break;
64
- case 'patch':
65
- ver.patch++;
66
- break;
67
- default:
68
- throw new Error(`Unknown bump type: ${bumpType}`);
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
- pkg.version = newVersion;
76
- fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2) + '\n');
77
- console.log(`✅ Updated package.json to version ${newVersion}`);
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
- let content = fs.readFileSync(pyprojectPath, 'utf8');
82
- content = content.replace(/^version\s*=\s*"[^"]+"/m, `version = "${newVersion}"`);
83
- fs.writeFileSync(pyprojectPath, content);
84
- console.log(`✅ Updated docker/pyproject.toml to version ${newVersion}`);
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
- let content = fs.readFileSync(appManifestPath, 'utf8');
89
- content = content.replace(/^(\s*)version:\s*.+$/m, `$1version: ${newVersion}`);
90
- fs.writeFileSync(appManifestPath, content);
91
- console.log(`✅ Updated docker/app-manifest.yaml to version ${newVersion}`);
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
- const args = process.argv.slice(2);
96
-
97
- // No args: display all three versions
98
- if (args.length === 0) {
99
- const jsonVersion = pkg.version;
100
- const tomlVersion = readPyprojectVersion();
101
- const yamlVersion = readAppManifestVersion();
102
-
103
- console.log('Version files:');
104
- console.log(` package.json: ${jsonVersion}`);
105
- console.log(` docker/pyproject.toml: ${tomlVersion}`);
106
- console.log(` docker/app-manifest.yaml: ${yamlVersion}`);
107
-
108
- if (jsonVersion === tomlVersion && jsonVersion === yamlVersion) {
109
- console.log('\n All versions are in sync');
110
- } else {
111
- console.log('\n⚠️ Versions are out of sync! Run "node bin/version.js sync" to fix.');
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
- process.exit(0);
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
- updatePyprojectVersion(jsonVersion);
154
- updateAppManifestVersion(jsonVersion);
155
-
156
- // Check if version files have changes
157
- let hasChanges = false;
158
- try {
159
- execSync('git diff --quiet docker/pyproject.toml docker/app-manifest.yaml', { stdio: 'ignore' });
160
- } catch (e) {
161
- hasChanges = true;
162
- }
163
-
164
- if (hasChanges) {
165
- execSync('git add docker/pyproject.toml docker/app-manifest.yaml', { stdio: 'inherit' });
166
- execSync(`git commit -m "chore: sync versions to ${jsonVersion}"`, { stdio: 'inherit' });
167
- console.log('✅ Committed version sync');
168
- } else {
169
- console.log('✅ All versions already in sync (no changes to commit)');
170
- }
171
- } catch (error) {
172
- console.error('❌ Error:', error.message);
173
- process.exit(1);
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,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