@geekmidas/cli 1.10.16 → 1.10.18

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 (41) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{bundler-B4AackW5.mjs → bundler-C5xkxnyr.mjs} +2 -2
  3. package/dist/{bundler-B4AackW5.mjs.map → bundler-C5xkxnyr.mjs.map} +1 -1
  4. package/dist/{bundler-BhhfkI9T.cjs → bundler-i-az1DZ2.cjs} +2 -2
  5. package/dist/{bundler-BhhfkI9T.cjs.map → bundler-i-az1DZ2.cjs.map} +1 -1
  6. package/dist/index.cjs +699 -712
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.mjs +686 -699
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/{openapi-BYxAWwok.cjs → openapi-CsCNpSf8.cjs} +1 -1
  11. package/dist/{openapi-BYxAWwok.cjs.map → openapi-CsCNpSf8.cjs.map} +1 -1
  12. package/dist/{openapi-DenF-okj.mjs → openapi-kvwpKbNe.mjs} +1 -1
  13. package/dist/{openapi-DenF-okj.mjs.map → openapi-kvwpKbNe.mjs.map} +1 -1
  14. package/dist/openapi.cjs +1 -1
  15. package/dist/openapi.mjs +1 -1
  16. package/dist/{storage-DOEtT2Hr.cjs → storage-ChVQI_G7.cjs} +1 -1
  17. package/dist/{storage-dbb9RyBl.mjs → storage-CpMNB77O.mjs} +1 -1
  18. package/dist/{storage-dbb9RyBl.mjs.map → storage-CpMNB77O.mjs.map} +1 -1
  19. package/dist/{storage-B1wvztiJ.cjs → storage-DLEb8Dkd.cjs} +1 -1
  20. package/dist/{storage-B1wvztiJ.cjs.map → storage-DLEb8Dkd.cjs.map} +1 -1
  21. package/dist/{storage-Cs4WBsc4.mjs → storage-mwbL7PhP.mjs} +1 -1
  22. package/dist/{sync-DGXXSk2v.cjs → sync-BWD_I5Ai.cjs} +2 -2
  23. package/dist/{sync-DGXXSk2v.cjs.map → sync-BWD_I5Ai.cjs.map} +1 -1
  24. package/dist/sync-ByaRPBxh.cjs +4 -0
  25. package/dist/{sync-COnAugP-.mjs → sync-CYBVB64f.mjs} +1 -1
  26. package/dist/{sync-D_NowTkZ.mjs → sync-lExOTa9t.mjs} +2 -2
  27. package/dist/{sync-D_NowTkZ.mjs.map → sync-lExOTa9t.mjs.map} +1 -1
  28. package/package.json +3 -3
  29. package/src/credentials/__tests__/fullDockerPorts.spec.ts +144 -0
  30. package/src/credentials/__tests__/helpers.ts +112 -0
  31. package/src/credentials/__tests__/prepareEntryCredentials.spec.ts +125 -0
  32. package/src/credentials/__tests__/readonlyDockerPorts.spec.ts +190 -0
  33. package/src/credentials/__tests__/workspaceCredentials.spec.ts +209 -0
  34. package/src/credentials/index.ts +826 -0
  35. package/src/dev/__tests__/index.spec.ts +68 -0
  36. package/src/dev/index.ts +44 -821
  37. package/src/exec/index.ts +120 -0
  38. package/src/init/versions.ts +1 -1
  39. package/src/setup/index.ts +4 -1
  40. package/src/test/index.ts +32 -109
  41. package/dist/sync-D1Pa30oV.cjs +0 -4
@@ -1237,6 +1237,28 @@ describe('replacePortInUrl', () => {
1237
1237
  // Only the :5432 before / should be replaced
1238
1238
  expect(result).toBe('postgresql://app:pass5432@localhost:5433/db5432');
1239
1239
  });
1240
+
1241
+ it('should replace port followed by query string', () => {
1242
+ const url = 'pgboss://pgboss:pass@localhost:5432/mydb?schema=pgboss';
1243
+ expect(replacePortInUrl(url, 5432, 5433)).toBe(
1244
+ 'pgboss://pgboss:pass@localhost:5433/mydb?schema=pgboss',
1245
+ );
1246
+ });
1247
+
1248
+ it('should replace port in SNS URL with query params and no path', () => {
1249
+ const url = 'sns://key:secret@localhost:4566?region=us-east-1';
1250
+ expect(replacePortInUrl(url, 4566, 4567)).toBe(
1251
+ 'sns://key:secret@localhost:4567?region=us-east-1',
1252
+ );
1253
+ });
1254
+
1255
+ it('should replace URL-encoded port in query params', () => {
1256
+ const url =
1257
+ 'sns://key:secret@localhost:4566?region=us-east-1&endpoint=http%3A%2F%2Flocalhost%3A4566';
1258
+ expect(replacePortInUrl(url, 4566, 4567)).toBe(
1259
+ 'sns://key:secret@localhost:4567?region=us-east-1&endpoint=http%3A%2F%2Flocalhost%3A4567',
1260
+ );
1261
+ });
1240
1262
  });
1241
1263
 
1242
1264
  describe('rewriteUrlsWithPorts', () => {
@@ -1384,6 +1406,52 @@ describe('rewriteUrlsWithPorts', () => {
1384
1406
  expect(result.POSTGRES_HOST).toBe('localhost');
1385
1407
  });
1386
1408
 
1409
+ it('should rewrite EVENT_PUBLISHER_CONNECTION_STRING and EVENT_SUBSCRIBER_CONNECTION_STRING', () => {
1410
+ const secrets = {
1411
+ EVENT_PUBLISHER_CONNECTION_STRING:
1412
+ 'pgboss://pgboss:pass@localhost:5432/mydb?schema=pgboss',
1413
+ EVENT_SUBSCRIBER_CONNECTION_STRING:
1414
+ 'pgboss://pgboss:pass@localhost:5432/mydb?schema=pgboss',
1415
+ };
1416
+ const result = rewriteUrlsWithPorts(secrets, {
1417
+ dockerEnv: { POSTGRES_HOST_PORT: '5433' },
1418
+ ports: { POSTGRES_HOST_PORT: 5433 },
1419
+ mappings: [pgMapping],
1420
+ });
1421
+ expect(result.EVENT_PUBLISHER_CONNECTION_STRING).toBe(
1422
+ 'pgboss://pgboss:pass@localhost:5433/mydb?schema=pgboss',
1423
+ );
1424
+ expect(result.EVENT_SUBSCRIBER_CONNECTION_STRING).toBe(
1425
+ 'pgboss://pgboss:pass@localhost:5433/mydb?schema=pgboss',
1426
+ );
1427
+ });
1428
+
1429
+ it('should rewrite SNS connection strings with encoded endpoint port', () => {
1430
+ const localstackMapping = {
1431
+ service: 'localstack',
1432
+ envVar: 'LOCALSTACK_PORT',
1433
+ defaultPort: 4566,
1434
+ containerPort: 4566,
1435
+ };
1436
+ const secrets = {
1437
+ EVENT_PUBLISHER_CONNECTION_STRING:
1438
+ 'sns://LSIAkey:secret@localhost:4566?region=us-east-1&endpoint=http%3A%2F%2Flocalhost%3A4566',
1439
+ EVENT_SUBSCRIBER_CONNECTION_STRING:
1440
+ 'sqs://LSIAkey:secret@localhost:4566?region=us-east-1&endpoint=http%3A%2F%2Flocalhost%3A4566',
1441
+ };
1442
+ const result = rewriteUrlsWithPorts(secrets, {
1443
+ dockerEnv: { LOCALSTACK_PORT: '4567' },
1444
+ ports: { LOCALSTACK_PORT: 4567 },
1445
+ mappings: [localstackMapping],
1446
+ });
1447
+ expect(result.EVENT_PUBLISHER_CONNECTION_STRING).toBe(
1448
+ 'sns://LSIAkey:secret@localhost:4567?region=us-east-1&endpoint=http%3A%2F%2Flocalhost%3A4567',
1449
+ );
1450
+ expect(result.EVENT_SUBSCRIBER_CONNECTION_STRING).toBe(
1451
+ 'sqs://LSIAkey:secret@localhost:4567?region=us-east-1&endpoint=http%3A%2F%2Flocalhost%3A4567',
1452
+ );
1453
+ });
1454
+
1387
1455
  it('should return empty for no mappings', () => {
1388
1456
  const result = rewriteUrlsWithPorts(
1389
1457
  {},