@geekmidas/cli 1.2.3 → 1.4.0
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/CHANGELOG.md +12 -0
- package/dist/{CachedStateProvider-DVyKfaMm.mjs → CachedStateProvider-BDq5WqSy.mjs} +1 -1
- package/dist/{CachedStateProvider-DVyKfaMm.mjs.map → CachedStateProvider-BDq5WqSy.mjs.map} +1 -1
- package/dist/CachedStateProvider-CI61keQ1.mjs +3 -0
- package/dist/{HostingerProvider-DqUq6e9i.mjs → HostingerProvider-B9N-TKbp.mjs} +2 -2
- package/dist/{HostingerProvider-DqUq6e9i.mjs.map → HostingerProvider-B9N-TKbp.mjs.map} +1 -1
- package/dist/{LocalStateProvider-DxoSaWUV.mjs → LocalStateProvider-BDm7ZqJo.mjs} +1 -1
- package/dist/{LocalStateProvider-DxoSaWUV.mjs.map → LocalStateProvider-BDm7ZqJo.mjs.map} +1 -1
- package/dist/{Route53Provider-KUAX3vz9.mjs → Route53Provider-DOWmFnwN.mjs} +2 -2
- package/dist/{Route53Provider-KUAX3vz9.mjs.map → Route53Provider-DOWmFnwN.mjs.map} +1 -1
- package/dist/{Route53Provider-CpRIqu69.cjs → Route53Provider-xrWuBXih.cjs} +2 -2
- package/dist/{Route53Provider-CpRIqu69.cjs.map → Route53Provider-xrWuBXih.cjs.map} +1 -1
- package/dist/{SSMStateProvider-D79o_JjM.cjs → SSMStateProvider-DGrqYll0.cjs} +8 -4
- package/dist/SSMStateProvider-DGrqYll0.cjs.map +1 -0
- package/dist/{SSMStateProvider-BjCi_58g.mjs → SSMStateProvider-DT0WV-E_.mjs} +9 -4
- package/dist/SSMStateProvider-DT0WV-E_.mjs.map +1 -0
- package/dist/{bundler-BqTN5Dj5.mjs → bundler-DgXsOSxc.mjs} +3 -3
- package/dist/{bundler-BqTN5Dj5.mjs.map → bundler-DgXsOSxc.mjs.map} +1 -1
- package/dist/chunk-Duj1WY3L.mjs +7 -0
- package/dist/{config-BQ4a36Rq.mjs → config-C1bidhvG.mjs} +2 -2
- package/dist/{config-BQ4a36Rq.mjs.map → config-C1bidhvG.mjs.map} +1 -1
- package/dist/{config-Bayob8pB.cjs → config-C1dM7aZb.cjs} +2 -2
- package/dist/{config-Bayob8pB.cjs.map → config-C1dM7aZb.cjs.map} +1 -1
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/{credentials-DT1dSxIx.mjs → credentials-s1kLcIzK.mjs} +1 -1
- package/dist/{credentials-DT1dSxIx.mjs.map → credentials-s1kLcIzK.mjs.map} +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +65 -0
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -0
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -0
- package/dist/deploy/sniffer-routes-worker.mjs +64 -0
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -0
- package/dist/dokploy-api-DSJYNx88.mjs +3 -0
- package/dist/{dokploy-api-7k3t7_zd.mjs → dokploy-api-z0833e7r.mjs} +1 -1
- package/dist/{dokploy-api-7k3t7_zd.mjs.map → dokploy-api-z0833e7r.mjs.map} +1 -1
- package/dist/{encryption-JtMsiGNp.mjs → encryption-BOH5M-f-.mjs} +1 -1
- package/dist/{encryption-JtMsiGNp.mjs.map → encryption-BOH5M-f-.mjs.map} +1 -1
- package/dist/encryption-a9TNMWav.mjs +3 -0
- package/dist/{index-Bi9vGQJy.d.mts → index-DvpWzLD7.d.mts} +5 -2
- package/dist/index-DvpWzLD7.d.mts.map +1 -0
- package/dist/{index-CufAAnge.d.cts → index-DzmZ6SUW.d.cts} +4 -1
- package/dist/index-DzmZ6SUW.d.cts.map +1 -0
- package/dist/index.cjs +27 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +42 -27
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-NthphEWK.mjs → openapi-9k6a6VA4.mjs} +2 -2
- package/dist/{openapi-NthphEWK.mjs.map → openapi-9k6a6VA4.mjs.map} +1 -1
- package/dist/{openapi-ZhO7wwya.cjs → openapi-Dcja4e1C.cjs} +2 -2
- package/dist/{openapi-ZhO7wwya.cjs.map → openapi-Dcja4e1C.cjs.map} +1 -1
- package/dist/{openapi-react-query-DGEkD39r.mjs → openapi-react-query-DaTMSPD5.mjs} +1 -1
- package/dist/{openapi-react-query-DGEkD39r.mjs.map → openapi-react-query-DaTMSPD5.mjs.map} +1 -1
- package/dist/openapi-react-query.mjs +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +3 -3
- package/dist/{storage-BMW6yLu3.mjs → storage-DmCbr6DI.mjs} +1 -1
- package/dist/{storage-BMW6yLu3.mjs.map → storage-DmCbr6DI.mjs.map} +1 -1
- package/dist/{storage-D8XzjVaO.mjs → storage-Dx_jZbq6.mjs} +1 -1
- package/dist/{types-BldpmqQX.d.mts → types-B9UZ7fOG.d.mts} +1 -1
- package/dist/{types-BldpmqQX.d.mts.map → types-B9UZ7fOG.d.mts.map} +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +1 -1
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-CASoZOjs.mjs → workspace-Cb_I7oCJ.mjs} +5 -8
- package/dist/{workspace-CASoZOjs.mjs.map → workspace-Cb_I7oCJ.mjs.map} +1 -1
- package/dist/{workspace-BMJE18LV.cjs → workspace-CeFgIDC-.cjs} +3 -2
- package/dist/{workspace-BMJE18LV.cjs.map → workspace-CeFgIDC-.cjs.map} +1 -1
- package/package.json +3 -3
- package/src/deploy/SSMStateProvider.ts +14 -3
- package/src/deploy/StateProvider.ts +5 -1
- package/src/deploy/__tests__/SSMStateProvider.spec.ts +12 -0
- package/src/deploy/__tests__/createStateProvider.spec.ts +10 -0
- package/src/deploy/__tests__/env-resolver.spec.ts +145 -2
- package/src/deploy/__tests__/index.spec.ts +393 -5
- package/src/deploy/env-resolver.ts +10 -0
- package/src/deploy/index.ts +11 -0
- package/src/init/generators/monorepo.ts +3 -1
- package/src/init/generators/web.ts +6 -2
- package/src/workspace/schema.ts +2 -0
- package/tsdown.config.ts +1 -0
- package/dist/CachedStateProvider-OiFUGr7p.mjs +0 -3
- package/dist/SSMStateProvider-BjCi_58g.mjs.map +0 -1
- package/dist/SSMStateProvider-D79o_JjM.cjs.map +0 -1
- package/dist/dokploy-api-CHa8G51l.mjs +0 -3
- package/dist/encryption-UUmaWAmz.mjs +0 -3
- package/dist/index-Bi9vGQJy.d.mts.map +0 -1
- package/dist/index-CufAAnge.d.cts.map +0 -1
|
@@ -3,11 +3,17 @@ import { setupServer } from 'msw/node';
|
|
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
4
|
import type { NormalizedWorkspace } from '../../workspace/types.js';
|
|
5
5
|
import { DokployApi } from '../dokploy-api';
|
|
6
|
+
import {
|
|
7
|
+
type EnvResolverContext,
|
|
8
|
+
resolveEnvVar,
|
|
9
|
+
resolveEnvVars,
|
|
10
|
+
} from '../env-resolver';
|
|
6
11
|
import {
|
|
7
12
|
generateTag,
|
|
8
13
|
provisionServices,
|
|
9
14
|
workspaceDeployCommand,
|
|
10
15
|
} from '../index';
|
|
16
|
+
import { createEmptyState } from '../state';
|
|
11
17
|
import type { DeployOptions } from '../types';
|
|
12
18
|
|
|
13
19
|
const BASE_URL = 'https://dokploy.example.com';
|
|
@@ -77,7 +83,7 @@ describe('provisionServices', () => {
|
|
|
77
83
|
expect(result).toBeUndefined();
|
|
78
84
|
});
|
|
79
85
|
|
|
80
|
-
it('should skip postgres when
|
|
86
|
+
it('should skip postgres when already provisioned', async () => {
|
|
81
87
|
const api = new DokployApi({ baseUrl: BASE_URL, token: 'test-token' });
|
|
82
88
|
|
|
83
89
|
const result = await provisionServices(
|
|
@@ -86,14 +92,14 @@ describe('provisionServices', () => {
|
|
|
86
92
|
'env_1',
|
|
87
93
|
'myapp',
|
|
88
94
|
{ postgres: true },
|
|
89
|
-
{
|
|
95
|
+
{ postgresId: 'pg_existing' },
|
|
90
96
|
);
|
|
91
97
|
|
|
92
98
|
// Should return undefined since nothing new was provisioned
|
|
93
99
|
expect(result).toBeUndefined();
|
|
94
100
|
});
|
|
95
101
|
|
|
96
|
-
it('should skip redis when
|
|
102
|
+
it('should skip redis when already provisioned', async () => {
|
|
97
103
|
const api = new DokployApi({ baseUrl: BASE_URL, token: 'test-token' });
|
|
98
104
|
|
|
99
105
|
const result = await provisionServices(
|
|
@@ -102,7 +108,7 @@ describe('provisionServices', () => {
|
|
|
102
108
|
'env_1',
|
|
103
109
|
'myapp',
|
|
104
110
|
{ redis: true },
|
|
105
|
-
{
|
|
111
|
+
{ redisId: 'redis_existing' },
|
|
106
112
|
);
|
|
107
113
|
|
|
108
114
|
expect(result).toBeUndefined();
|
|
@@ -420,6 +426,7 @@ describe('workspaceDeployCommand', () => {
|
|
|
420
426
|
path: 'apps/api',
|
|
421
427
|
port: 3000,
|
|
422
428
|
dependencies: [],
|
|
429
|
+
resolvedDeployTarget: 'dokploy',
|
|
423
430
|
},
|
|
424
431
|
web: {
|
|
425
432
|
type: 'frontend',
|
|
@@ -427,6 +434,7 @@ describe('workspaceDeployCommand', () => {
|
|
|
427
434
|
port: 3001,
|
|
428
435
|
dependencies: ['api'],
|
|
429
436
|
framework: 'nextjs',
|
|
437
|
+
resolvedDeployTarget: 'dokploy',
|
|
430
438
|
},
|
|
431
439
|
},
|
|
432
440
|
services: {},
|
|
@@ -508,12 +516,14 @@ describe('workspaceDeployCommand', () => {
|
|
|
508
516
|
path: 'apps/api',
|
|
509
517
|
port: 3000,
|
|
510
518
|
dependencies: [],
|
|
519
|
+
resolvedDeployTarget: 'dokploy',
|
|
511
520
|
},
|
|
512
521
|
auth: {
|
|
513
522
|
type: 'backend',
|
|
514
523
|
path: 'apps/auth',
|
|
515
524
|
port: 3001,
|
|
516
525
|
dependencies: [],
|
|
526
|
+
resolvedDeployTarget: 'dokploy',
|
|
517
527
|
},
|
|
518
528
|
web: {
|
|
519
529
|
type: 'frontend',
|
|
@@ -521,6 +531,7 @@ describe('workspaceDeployCommand', () => {
|
|
|
521
531
|
port: 3002,
|
|
522
532
|
dependencies: ['api', 'auth'],
|
|
523
533
|
framework: 'nextjs',
|
|
534
|
+
resolvedDeployTarget: 'dokploy',
|
|
524
535
|
},
|
|
525
536
|
},
|
|
526
537
|
});
|
|
@@ -546,12 +557,14 @@ describe('workspaceDeployCommand', () => {
|
|
|
546
557
|
path: 'apps/db',
|
|
547
558
|
port: 3000,
|
|
548
559
|
dependencies: [],
|
|
560
|
+
resolvedDeployTarget: 'dokploy',
|
|
549
561
|
},
|
|
550
562
|
api: {
|
|
551
563
|
type: 'backend',
|
|
552
564
|
path: 'apps/api',
|
|
553
565
|
port: 3001,
|
|
554
566
|
dependencies: ['db'],
|
|
567
|
+
resolvedDeployTarget: 'dokploy',
|
|
555
568
|
},
|
|
556
569
|
web: {
|
|
557
570
|
type: 'frontend',
|
|
@@ -559,6 +572,7 @@ describe('workspaceDeployCommand', () => {
|
|
|
559
572
|
port: 3002,
|
|
560
573
|
dependencies: ['api'],
|
|
561
574
|
framework: 'nextjs',
|
|
575
|
+
resolvedDeployTarget: 'dokploy',
|
|
562
576
|
},
|
|
563
577
|
},
|
|
564
578
|
});
|
|
@@ -594,6 +608,116 @@ describe('workspaceDeployCommand', () => {
|
|
|
594
608
|
expect(envVars).toContain('AUTH_URL=http://test-workspace-auth:3001');
|
|
595
609
|
});
|
|
596
610
|
|
|
611
|
+
it('should build dependencyUrls from publicUrls for deployed apps', () => {
|
|
612
|
+
// Test the dependencyUrls building logic used in workspaceDeployCommand
|
|
613
|
+
const publicUrls: Record<string, string> = {
|
|
614
|
+
api: 'https://api.example.com',
|
|
615
|
+
auth: 'https://auth.example.com',
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
const app = {
|
|
619
|
+
type: 'frontend' as const,
|
|
620
|
+
path: 'apps/web',
|
|
621
|
+
port: 3000,
|
|
622
|
+
dependencies: ['api', 'auth'],
|
|
623
|
+
framework: 'nextjs' as const,
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
// Build dependency URLs from already-deployed apps (mimics workspaceDeployCommand logic)
|
|
627
|
+
const dependencyUrls: Record<string, string> = {};
|
|
628
|
+
if (app.dependencies) {
|
|
629
|
+
for (const dep of app.dependencies) {
|
|
630
|
+
if (publicUrls[dep]) {
|
|
631
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
expect(dependencyUrls).toEqual({
|
|
637
|
+
api: 'https://api.example.com',
|
|
638
|
+
auth: 'https://auth.example.com',
|
|
639
|
+
});
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
it('should only include dependencies that have been deployed', () => {
|
|
643
|
+
// Test that dependencyUrls only includes apps that exist in publicUrls
|
|
644
|
+
const publicUrls: Record<string, string> = {
|
|
645
|
+
api: 'https://api.example.com',
|
|
646
|
+
// auth is NOT deployed yet
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
const app = {
|
|
650
|
+
type: 'frontend' as const,
|
|
651
|
+
path: 'apps/web',
|
|
652
|
+
port: 3000,
|
|
653
|
+
dependencies: ['api', 'auth'], // wants both api and auth
|
|
654
|
+
framework: 'nextjs' as const,
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
const dependencyUrls: Record<string, string> = {};
|
|
658
|
+
if (app.dependencies) {
|
|
659
|
+
for (const dep of app.dependencies) {
|
|
660
|
+
if (publicUrls[dep]) {
|
|
661
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// Only api should be included, auth is not yet deployed
|
|
667
|
+
expect(dependencyUrls).toEqual({
|
|
668
|
+
api: 'https://api.example.com',
|
|
669
|
+
});
|
|
670
|
+
expect(dependencyUrls.auth).toBeUndefined();
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
it('should handle apps with no dependencies', () => {
|
|
674
|
+
const publicUrls: Record<string, string> = {
|
|
675
|
+
api: 'https://api.example.com',
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
const app = {
|
|
679
|
+
type: 'backend' as const,
|
|
680
|
+
path: 'apps/api',
|
|
681
|
+
port: 3000,
|
|
682
|
+
dependencies: [], // no dependencies
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
const dependencyUrls: Record<string, string> = {};
|
|
686
|
+
if (app.dependencies) {
|
|
687
|
+
for (const dep of app.dependencies) {
|
|
688
|
+
if (publicUrls[dep]) {
|
|
689
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
expect(dependencyUrls).toEqual({});
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
it('should handle apps with undefined dependencies', () => {
|
|
698
|
+
const publicUrls: Record<string, string> = {
|
|
699
|
+
api: 'https://api.example.com',
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
const app = {
|
|
703
|
+
type: 'backend' as const,
|
|
704
|
+
path: 'apps/api',
|
|
705
|
+
port: 3000,
|
|
706
|
+
dependencies: undefined as unknown as string[],
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
const dependencyUrls: Record<string, string> = {};
|
|
710
|
+
if (app.dependencies) {
|
|
711
|
+
for (const dep of app.dependencies) {
|
|
712
|
+
if (publicUrls[dep]) {
|
|
713
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
expect(dependencyUrls).toEqual({});
|
|
719
|
+
});
|
|
720
|
+
|
|
597
721
|
it('should inject DATABASE_URL for backend apps', () => {
|
|
598
722
|
const workspaceName = 'test-workspace';
|
|
599
723
|
const hasPostgres = true;
|
|
@@ -613,7 +737,7 @@ describe('workspaceDeployCommand', () => {
|
|
|
613
737
|
|
|
614
738
|
it('should not inject DATABASE_URL for frontend apps', () => {
|
|
615
739
|
const hasPostgres = true;
|
|
616
|
-
const appType
|
|
740
|
+
const appType = 'frontend' as 'backend' | 'frontend';
|
|
617
741
|
|
|
618
742
|
const envVars: string[] = [];
|
|
619
743
|
|
|
@@ -702,4 +826,268 @@ describe('workspaceDeployCommand', () => {
|
|
|
702
826
|
expect(result.failedCount).toBe(1);
|
|
703
827
|
});
|
|
704
828
|
});
|
|
829
|
+
|
|
830
|
+
describe('workspace dependencyUrls integration with env resolver', () => {
|
|
831
|
+
it('should resolve dependency URLs when building env context for an app', () => {
|
|
832
|
+
// Simulate the scenario where api and auth are deployed, then web needs their URLs
|
|
833
|
+
const publicUrls: Record<string, string> = {
|
|
834
|
+
api: 'https://api.myapp.com',
|
|
835
|
+
auth: 'https://auth.myapp.com',
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
const webApp = {
|
|
839
|
+
type: 'frontend' as const,
|
|
840
|
+
path: 'apps/web',
|
|
841
|
+
port: 3000,
|
|
842
|
+
dependencies: ['api', 'auth'],
|
|
843
|
+
framework: 'nextjs' as const,
|
|
844
|
+
resolvedDeployTarget: 'dokploy' as const,
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
// Build dependencyUrls (as done in workspaceDeployCommand)
|
|
848
|
+
const dependencyUrls: Record<string, string> = {};
|
|
849
|
+
for (const dep of webApp.dependencies) {
|
|
850
|
+
if (publicUrls[dep]) {
|
|
851
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// Create env context with dependencyUrls
|
|
856
|
+
const context: EnvResolverContext = {
|
|
857
|
+
app: webApp,
|
|
858
|
+
appName: 'web',
|
|
859
|
+
stage: 'production',
|
|
860
|
+
state: createEmptyState('production', 'proj_test', 'env-123'),
|
|
861
|
+
appHostname: 'web.myapp.com',
|
|
862
|
+
frontendUrls: [],
|
|
863
|
+
dependencyUrls,
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
// Resolve API_URL and AUTH_URL
|
|
867
|
+
expect(resolveEnvVar('API_URL', context)).toBe('https://api.myapp.com');
|
|
868
|
+
expect(resolveEnvVar('AUTH_URL', context)).toBe('https://auth.myapp.com');
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
it('should resolve multiple env vars including dependency URLs', () => {
|
|
872
|
+
const publicUrls: Record<string, string> = {
|
|
873
|
+
api: 'https://api.example.com',
|
|
874
|
+
payments: 'https://payments.example.com',
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
const webApp = {
|
|
878
|
+
type: 'frontend' as const,
|
|
879
|
+
path: 'apps/web',
|
|
880
|
+
port: 3001,
|
|
881
|
+
dependencies: ['api', 'payments'],
|
|
882
|
+
framework: 'nextjs' as const,
|
|
883
|
+
resolvedDeployTarget: 'dokploy' as const,
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
// Build dependencyUrls
|
|
887
|
+
const dependencyUrls: Record<string, string> = {};
|
|
888
|
+
for (const dep of webApp.dependencies) {
|
|
889
|
+
if (publicUrls[dep]) {
|
|
890
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
const context: EnvResolverContext = {
|
|
895
|
+
app: webApp,
|
|
896
|
+
appName: 'web',
|
|
897
|
+
stage: 'production',
|
|
898
|
+
state: createEmptyState('production', 'proj_test', 'env-123'),
|
|
899
|
+
appHostname: 'web.example.com',
|
|
900
|
+
frontendUrls: [],
|
|
901
|
+
dependencyUrls,
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
// Resolve all required vars including dependency URLs
|
|
905
|
+
const result = resolveEnvVars(
|
|
906
|
+
['PORT', 'NODE_ENV', 'API_URL', 'PAYMENTS_URL'],
|
|
907
|
+
context,
|
|
908
|
+
);
|
|
909
|
+
|
|
910
|
+
expect(result.resolved).toEqual({
|
|
911
|
+
PORT: '3001',
|
|
912
|
+
NODE_ENV: 'production',
|
|
913
|
+
API_URL: 'https://api.example.com',
|
|
914
|
+
PAYMENTS_URL: 'https://payments.example.com',
|
|
915
|
+
});
|
|
916
|
+
expect(result.missing).toEqual([]);
|
|
917
|
+
});
|
|
918
|
+
|
|
919
|
+
it('should report missing dependency URLs when dependency not yet deployed', () => {
|
|
920
|
+
// Scenario: web depends on api and auth, but only api is deployed
|
|
921
|
+
const publicUrls: Record<string, string> = {
|
|
922
|
+
api: 'https://api.example.com',
|
|
923
|
+
// auth is NOT deployed
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
const webApp = {
|
|
927
|
+
type: 'frontend' as const,
|
|
928
|
+
path: 'apps/web',
|
|
929
|
+
port: 3001,
|
|
930
|
+
dependencies: ['api', 'auth'],
|
|
931
|
+
framework: 'nextjs' as const,
|
|
932
|
+
resolvedDeployTarget: 'dokploy' as const,
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
// Build dependencyUrls (auth will be missing)
|
|
936
|
+
const dependencyUrls: Record<string, string> = {};
|
|
937
|
+
for (const dep of webApp.dependencies) {
|
|
938
|
+
if (publicUrls[dep]) {
|
|
939
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
const context: EnvResolverContext = {
|
|
944
|
+
app: webApp,
|
|
945
|
+
appName: 'web',
|
|
946
|
+
stage: 'production',
|
|
947
|
+
state: createEmptyState('production', 'proj_test', 'env-123'),
|
|
948
|
+
appHostname: 'web.example.com',
|
|
949
|
+
frontendUrls: [],
|
|
950
|
+
dependencyUrls,
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
const result = resolveEnvVars(['API_URL', 'AUTH_URL'], context);
|
|
954
|
+
|
|
955
|
+
expect(result.resolved).toEqual({
|
|
956
|
+
API_URL: 'https://api.example.com',
|
|
957
|
+
});
|
|
958
|
+
expect(result.missing).toEqual(['AUTH_URL']);
|
|
959
|
+
});
|
|
960
|
+
|
|
961
|
+
it('should correctly resolve chain of dependencies (db -> api -> web)', () => {
|
|
962
|
+
// Simulate deploying in order: db (no deps), api (depends on nothing but needs DATABASE_URL),
|
|
963
|
+
// then web (depends on api)
|
|
964
|
+
const publicUrls: Record<string, string> = {};
|
|
965
|
+
const state = createEmptyState('production', 'proj_test', 'env-123');
|
|
966
|
+
|
|
967
|
+
// Step 1: Deploy api first
|
|
968
|
+
const apiApp = {
|
|
969
|
+
type: 'backend' as const,
|
|
970
|
+
path: 'apps/api',
|
|
971
|
+
port: 3000,
|
|
972
|
+
dependencies: [],
|
|
973
|
+
resolvedDeployTarget: 'dokploy' as const,
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
const apiContext: EnvResolverContext = {
|
|
977
|
+
app: apiApp,
|
|
978
|
+
appName: 'api',
|
|
979
|
+
stage: 'production',
|
|
980
|
+
state,
|
|
981
|
+
appHostname: 'api.example.com',
|
|
982
|
+
frontendUrls: [],
|
|
983
|
+
appCredentials: { dbUser: 'api', dbPassword: 'secret' },
|
|
984
|
+
postgres: { host: 'db', port: 5432, database: 'myapp' },
|
|
985
|
+
dependencyUrls: {}, // api has no dependencies
|
|
986
|
+
};
|
|
987
|
+
|
|
988
|
+
const apiResult = resolveEnvVars(
|
|
989
|
+
['PORT', 'NODE_ENV', 'DATABASE_URL'],
|
|
990
|
+
apiContext,
|
|
991
|
+
);
|
|
992
|
+
expect(apiResult.missing).toEqual([]);
|
|
993
|
+
expect(apiResult.resolved.DATABASE_URL).toBe(
|
|
994
|
+
'postgresql://api:secret@db:5432/myapp',
|
|
995
|
+
);
|
|
996
|
+
|
|
997
|
+
// Simulate api is now deployed
|
|
998
|
+
publicUrls.api = 'https://api.example.com';
|
|
999
|
+
|
|
1000
|
+
// Step 2: Deploy web (depends on api)
|
|
1001
|
+
const webApp = {
|
|
1002
|
+
type: 'frontend' as const,
|
|
1003
|
+
path: 'apps/web',
|
|
1004
|
+
port: 3001,
|
|
1005
|
+
dependencies: ['api'],
|
|
1006
|
+
framework: 'nextjs' as const,
|
|
1007
|
+
resolvedDeployTarget: 'dokploy' as const,
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
const webDependencyUrls: Record<string, string> = {};
|
|
1011
|
+
for (const dep of webApp.dependencies) {
|
|
1012
|
+
if (publicUrls[dep]) {
|
|
1013
|
+
webDependencyUrls[dep] = publicUrls[dep];
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
const webContext: EnvResolverContext = {
|
|
1018
|
+
app: webApp,
|
|
1019
|
+
appName: 'web',
|
|
1020
|
+
stage: 'production',
|
|
1021
|
+
state,
|
|
1022
|
+
appHostname: 'web.example.com',
|
|
1023
|
+
frontendUrls: [],
|
|
1024
|
+
dependencyUrls: webDependencyUrls,
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
const webResult = resolveEnvVars(
|
|
1028
|
+
['PORT', 'NODE_ENV', 'API_URL'],
|
|
1029
|
+
webContext,
|
|
1030
|
+
);
|
|
1031
|
+
|
|
1032
|
+
expect(webResult.missing).toEqual([]);
|
|
1033
|
+
expect(webResult.resolved).toEqual({
|
|
1034
|
+
PORT: '3001',
|
|
1035
|
+
NODE_ENV: 'production',
|
|
1036
|
+
API_URL: 'https://api.example.com',
|
|
1037
|
+
});
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
it('should handle microservices topology with multiple inter-dependencies', () => {
|
|
1041
|
+
// Scenario:
|
|
1042
|
+
// - auth service (no deps)
|
|
1043
|
+
// - api service (depends on auth)
|
|
1044
|
+
// - notifications service (depends on api)
|
|
1045
|
+
// - web (depends on api, auth, notifications)
|
|
1046
|
+
const publicUrls: Record<string, string> = {
|
|
1047
|
+
auth: 'https://auth.example.com',
|
|
1048
|
+
api: 'https://api.example.com',
|
|
1049
|
+
notifications: 'https://notifications.example.com',
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
const webApp = {
|
|
1053
|
+
type: 'frontend' as const,
|
|
1054
|
+
path: 'apps/web',
|
|
1055
|
+
port: 3000,
|
|
1056
|
+
dependencies: ['api', 'auth', 'notifications'],
|
|
1057
|
+
framework: 'nextjs' as const,
|
|
1058
|
+
resolvedDeployTarget: 'dokploy' as const,
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
// Build dependencyUrls for web
|
|
1062
|
+
const dependencyUrls: Record<string, string> = {};
|
|
1063
|
+
for (const dep of webApp.dependencies) {
|
|
1064
|
+
if (publicUrls[dep]) {
|
|
1065
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
const context: EnvResolverContext = {
|
|
1070
|
+
app: webApp,
|
|
1071
|
+
appName: 'web',
|
|
1072
|
+
stage: 'production',
|
|
1073
|
+
state: createEmptyState('production', 'proj_test', 'env-123'),
|
|
1074
|
+
appHostname: 'web.example.com',
|
|
1075
|
+
frontendUrls: [],
|
|
1076
|
+
dependencyUrls,
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
const result = resolveEnvVars(
|
|
1080
|
+
['PORT', 'API_URL', 'AUTH_URL', 'NOTIFICATIONS_URL'],
|
|
1081
|
+
context,
|
|
1082
|
+
);
|
|
1083
|
+
|
|
1084
|
+
expect(result.missing).toEqual([]);
|
|
1085
|
+
expect(result.resolved).toEqual({
|
|
1086
|
+
PORT: '3000',
|
|
1087
|
+
API_URL: 'https://api.example.com',
|
|
1088
|
+
AUTH_URL: 'https://auth.example.com',
|
|
1089
|
+
NOTIFICATIONS_URL: 'https://notifications.example.com',
|
|
1090
|
+
});
|
|
1091
|
+
});
|
|
1092
|
+
});
|
|
705
1093
|
});
|
|
@@ -50,6 +50,8 @@ export interface EnvResolverContext {
|
|
|
50
50
|
userSecrets?: StageSecrets;
|
|
51
51
|
/** Master key for runtime decryption (optional) */
|
|
52
52
|
masterKey?: string;
|
|
53
|
+
/** URLs of deployed dependency apps (e.g., { auth: 'https://auth.example.com' }) */
|
|
54
|
+
dependencyUrls?: Record<string, string>;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
/**
|
|
@@ -205,6 +207,14 @@ export function resolveEnvVar(
|
|
|
205
207
|
break;
|
|
206
208
|
}
|
|
207
209
|
|
|
210
|
+
// Check dependency URLs (e.g., AUTH_URL -> dependencyUrls.auth)
|
|
211
|
+
if (context.dependencyUrls && varName.endsWith('_URL')) {
|
|
212
|
+
const depName = varName.slice(0, -4).toLowerCase(); // AUTH_URL -> auth
|
|
213
|
+
if (context.dependencyUrls[depName]) {
|
|
214
|
+
return context.dependencyUrls[depName];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
208
218
|
// Check user-provided secrets
|
|
209
219
|
if (context.userSecrets) {
|
|
210
220
|
// Check custom secrets first
|
package/src/deploy/index.ts
CHANGED
|
@@ -1375,6 +1375,16 @@ export async function workspaceDeployCommand(
|
|
|
1375
1375
|
false, // Backend apps are not main frontend
|
|
1376
1376
|
);
|
|
1377
1377
|
|
|
1378
|
+
// Build dependency URLs from already-deployed apps
|
|
1379
|
+
const dependencyUrls: Record<string, string> = {};
|
|
1380
|
+
if (app.dependencies) {
|
|
1381
|
+
for (const dep of app.dependencies) {
|
|
1382
|
+
if (publicUrls[dep]) {
|
|
1383
|
+
dependencyUrls[dep] = publicUrls[dep];
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1378
1388
|
// Build env resolver context
|
|
1379
1389
|
const envContext: EnvResolverContext = {
|
|
1380
1390
|
app,
|
|
@@ -1400,6 +1410,7 @@ export async function workspaceDeployCommand(
|
|
|
1400
1410
|
frontendUrls,
|
|
1401
1411
|
userSecrets: stageSecrets ?? undefined,
|
|
1402
1412
|
masterKey: appSecrets?.masterKey,
|
|
1413
|
+
dependencyUrls,
|
|
1403
1414
|
};
|
|
1404
1415
|
|
|
1405
1416
|
// Resolve all required environment variables
|
|
@@ -48,6 +48,7 @@ export function generateMonorepoFiles(
|
|
|
48
48
|
'@biomejs/biome': '~2.3.0',
|
|
49
49
|
'@geekmidas/cli': GEEKMIDAS_VERSIONS['@geekmidas/cli'],
|
|
50
50
|
esbuild: '~0.27.0',
|
|
51
|
+
tsx: '~4.20.0',
|
|
51
52
|
turbo: '~2.3.0',
|
|
52
53
|
typescript: '~5.8.2',
|
|
53
54
|
vitest: '~4.0.0',
|
|
@@ -342,7 +343,8 @@ export default defineWorkspace({
|
|
|
342
343
|
port: 3000,
|
|
343
344
|
routes: '${getRoutesGlob()}',
|
|
344
345
|
envParser: './src/config/env#envParser',
|
|
345
|
-
logger: './src/config/logger#logger'
|
|
346
|
+
logger: './src/config/logger#logger',
|
|
347
|
+
dependencies: ['auth'],`;
|
|
346
348
|
|
|
347
349
|
if (telescope) {
|
|
348
350
|
config += `
|
|
@@ -90,17 +90,21 @@ export default nextConfig;
|
|
|
90
90
|
name: 'next',
|
|
91
91
|
},
|
|
92
92
|
],
|
|
93
|
+
baseUrl: '.',
|
|
93
94
|
paths: {
|
|
94
|
-
'~/*': ['./src/*'],
|
|
95
|
+
'~/*': ['./src/*', '../../packages/ui/src/*'],
|
|
95
96
|
[`${modelsPackage}`]: ['../../packages/models/src'],
|
|
96
97
|
[`${modelsPackage}/*`]: ['../../packages/models/src/*'],
|
|
97
98
|
[`${uiPackage}`]: ['../../packages/ui/src'],
|
|
98
99
|
[`${uiPackage}/*`]: ['../../packages/ui/src/*'],
|
|
99
100
|
},
|
|
100
|
-
baseUrl: '.',
|
|
101
101
|
},
|
|
102
102
|
include: ['next-env.d.ts', '**/*.ts', '**/*.tsx', '.next/types/**/*.ts'],
|
|
103
103
|
exclude: ['node_modules'],
|
|
104
|
+
references: [
|
|
105
|
+
{ path: '../../packages/ui' },
|
|
106
|
+
{ path: '../../packages/models' },
|
|
107
|
+
],
|
|
104
108
|
};
|
|
105
109
|
|
|
106
110
|
// Query client singleton for browser, fresh instance for server
|
package/src/workspace/schema.ts
CHANGED
|
@@ -468,6 +468,8 @@ const SSMStateConfigSchema = z.object({
|
|
|
468
468
|
provider: z.literal('ssm'),
|
|
469
469
|
/** AWS region (required for SSM provider) */
|
|
470
470
|
region: AwsRegionSchema,
|
|
471
|
+
/** AWS profile name (optional - uses default credential chain if not provided) */
|
|
472
|
+
profile: z.string().optional(),
|
|
471
473
|
});
|
|
472
474
|
|
|
473
475
|
/**
|
package/tsdown.config.ts
CHANGED
|
@@ -10,6 +10,7 @@ export default defineConfig({
|
|
|
10
10
|
// Sniffer files need to be standalone for subprocess loading via --import
|
|
11
11
|
'src/deploy/sniffer-loader.ts',
|
|
12
12
|
'src/deploy/sniffer-worker.ts',
|
|
13
|
+
'src/deploy/sniffer-routes-worker.ts',
|
|
13
14
|
'src/deploy/sniffer-hooks.ts',
|
|
14
15
|
'src/deploy/sniffer-envkit-patch.ts',
|
|
15
16
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SSMStateProvider-BjCi_58g.mjs","names":["workspaceName: string","client: SSMClient","options: SSMStateProviderOptions","stage: string","state: DokployStageState"],"sources":["../src/deploy/SSMStateProvider.ts"],"sourcesContent":["/**\n * AWS SSM Parameter Store State Provider\n *\n * Stores deployment state as SecureString parameters in AWS SSM.\n * Uses AWS-managed KMS key for encryption (free tier).\n *\n * Parameter naming: /gkm/{workspaceName}/{stage}/state\n */\n\nimport {\n\tGetParameterCommand,\n\tParameterNotFound,\n\tPutParameterCommand,\n\tSSMClient,\n\ttype SSMClientConfig,\n} from '@aws-sdk/client-ssm';\nimport type { AwsRegion, StateProvider } from './StateProvider';\nimport type { DokployStageState } from './state';\n\nexport interface SSMStateProviderOptions {\n\t/** Workspace name (used in parameter path) */\n\tworkspaceName: string;\n\t/** AWS region */\n\tregion?: AwsRegion;\n\t/** AWS credentials (optional - uses default credential chain if not provided) */\n\tcredentials?: SSMClientConfig['credentials'];\n\t/** Custom endpoint (for LocalStack or other S3-compatible services) */\n\tendpoint?: string;\n}\n\n/**\n * AWS SSM Parameter Store state provider.\n *\n * Stores state as encrypted SecureString parameters.\n * Parameter path: /gkm/{workspaceName}/{stage}/state\n */\nexport class SSMStateProvider implements StateProvider {\n\tconstructor(\n\t\treadonly workspaceName: string,\n\t\tprivate readonly client: SSMClient,\n\t) {}\n\n\t/**\n\t * Create an SSMStateProvider with a new SSMClient.\n\t */\n\tstatic create(options: SSMStateProviderOptions): SSMStateProvider {\n\t\tconst client = new SSMClient({\n\t\t\tregion: options.region,\n\t\t\tcredentials: options.credentials,\n\t\t\tendpoint: options.endpoint,\n\t\t});\n\n\t\treturn new SSMStateProvider(options.workspaceName, client);\n\t}\n\n\t/**\n\t * Get the SSM parameter name for a stage.\n\t */\n\tprivate getParameterName(stage: string): string {\n\t\treturn `/gkm/${this.workspaceName}/${stage}/state`;\n\t}\n\n\tasync read(stage: string): Promise<DokployStageState | null> {\n\t\tconst parameterName = this.getParameterName(stage);\n\n\t\ttry {\n\t\t\tconst response = await this.client.send(\n\t\t\t\tnew GetParameterCommand({\n\t\t\t\t\tName: parameterName,\n\t\t\t\t\tWithDecryption: true,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tif (!response.Parameter?.Value) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn JSON.parse(response.Parameter.Value) as DokployStageState;\n\t\t} catch (error) {\n\t\t\t// Parameter doesn't exist - return null (new deployment)\n\t\t\tif (error instanceof ParameterNotFound) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Re-throw other errors (permission denied, network, etc.)\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync write(stage: string, state: DokployStageState): Promise<void> {\n\t\tconst parameterName = this.getParameterName(stage);\n\n\t\t// Update last deployed timestamp\n\t\tstate.lastDeployedAt = new Date().toISOString();\n\n\t\tawait this.client.send(\n\t\t\tnew PutParameterCommand({\n\t\t\t\tName: parameterName,\n\t\t\t\tValue: JSON.stringify(state),\n\t\t\t\tType: 'SecureString',\n\t\t\t\tOverwrite: true,\n\t\t\t\tDescription: `GKM deployment state for ${this.workspaceName}/${stage}`,\n\t\t\t}),\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;AAoCA,IAAa,mBAAb,MAAa,iBAA0C;CACtD,YACUA,eACQC,QAChB;EAFQ;EACQ;CACd;;;;CAKJ,OAAO,OAAOC,SAAoD;EACjE,MAAM,SAAS,IAAI,UAAU;GAC5B,QAAQ,QAAQ;GAChB,aAAa,QAAQ;GACrB,UAAU,QAAQ;EAClB;AAED,SAAO,IAAI,iBAAiB,QAAQ,eAAe;CACnD;;;;CAKD,AAAQ,iBAAiBC,OAAuB;AAC/C,UAAQ,OAAO,KAAK,cAAc,GAAG,MAAM;CAC3C;CAED,MAAM,KAAKA,OAAkD;EAC5D,MAAM,gBAAgB,KAAK,iBAAiB,MAAM;AAElD,MAAI;GACH,MAAM,WAAW,MAAM,KAAK,OAAO,KAClC,IAAI,oBAAoB;IACvB,MAAM;IACN,gBAAgB;GAChB,GACD;AAED,QAAK,SAAS,WAAW,MACxB,QAAO;AAGR,UAAO,KAAK,MAAM,SAAS,UAAU,MAAM;EAC3C,SAAQ,OAAO;AAEf,OAAI,iBAAiB,kBACpB,QAAO;AAIR,SAAM;EACN;CACD;CAED,MAAM,MAAMA,OAAeC,OAAyC;EACnE,MAAM,gBAAgB,KAAK,iBAAiB,MAAM;AAGlD,QAAM,iBAAiB,qBAAI,QAAO,aAAa;AAE/C,QAAM,KAAK,OAAO,KACjB,IAAI,oBAAoB;GACvB,MAAM;GACN,OAAO,KAAK,UAAU,MAAM;GAC5B,MAAM;GACN,WAAW;GACX,cAAc,2BAA2B,KAAK,cAAc,GAAG,MAAM;EACrE,GACD;CACD;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SSMStateProvider-D79o_JjM.cjs","names":["workspaceName: string","client: SSMClient","options: SSMStateProviderOptions","SSMClient","stage: string","GetParameterCommand","ParameterNotFound","state: DokployStageState","PutParameterCommand"],"sources":["../src/deploy/SSMStateProvider.ts"],"sourcesContent":["/**\n * AWS SSM Parameter Store State Provider\n *\n * Stores deployment state as SecureString parameters in AWS SSM.\n * Uses AWS-managed KMS key for encryption (free tier).\n *\n * Parameter naming: /gkm/{workspaceName}/{stage}/state\n */\n\nimport {\n\tGetParameterCommand,\n\tParameterNotFound,\n\tPutParameterCommand,\n\tSSMClient,\n\ttype SSMClientConfig,\n} from '@aws-sdk/client-ssm';\nimport type { AwsRegion, StateProvider } from './StateProvider';\nimport type { DokployStageState } from './state';\n\nexport interface SSMStateProviderOptions {\n\t/** Workspace name (used in parameter path) */\n\tworkspaceName: string;\n\t/** AWS region */\n\tregion?: AwsRegion;\n\t/** AWS credentials (optional - uses default credential chain if not provided) */\n\tcredentials?: SSMClientConfig['credentials'];\n\t/** Custom endpoint (for LocalStack or other S3-compatible services) */\n\tendpoint?: string;\n}\n\n/**\n * AWS SSM Parameter Store state provider.\n *\n * Stores state as encrypted SecureString parameters.\n * Parameter path: /gkm/{workspaceName}/{stage}/state\n */\nexport class SSMStateProvider implements StateProvider {\n\tconstructor(\n\t\treadonly workspaceName: string,\n\t\tprivate readonly client: SSMClient,\n\t) {}\n\n\t/**\n\t * Create an SSMStateProvider with a new SSMClient.\n\t */\n\tstatic create(options: SSMStateProviderOptions): SSMStateProvider {\n\t\tconst client = new SSMClient({\n\t\t\tregion: options.region,\n\t\t\tcredentials: options.credentials,\n\t\t\tendpoint: options.endpoint,\n\t\t});\n\n\t\treturn new SSMStateProvider(options.workspaceName, client);\n\t}\n\n\t/**\n\t * Get the SSM parameter name for a stage.\n\t */\n\tprivate getParameterName(stage: string): string {\n\t\treturn `/gkm/${this.workspaceName}/${stage}/state`;\n\t}\n\n\tasync read(stage: string): Promise<DokployStageState | null> {\n\t\tconst parameterName = this.getParameterName(stage);\n\n\t\ttry {\n\t\t\tconst response = await this.client.send(\n\t\t\t\tnew GetParameterCommand({\n\t\t\t\t\tName: parameterName,\n\t\t\t\t\tWithDecryption: true,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tif (!response.Parameter?.Value) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn JSON.parse(response.Parameter.Value) as DokployStageState;\n\t\t} catch (error) {\n\t\t\t// Parameter doesn't exist - return null (new deployment)\n\t\t\tif (error instanceof ParameterNotFound) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Re-throw other errors (permission denied, network, etc.)\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync write(stage: string, state: DokployStageState): Promise<void> {\n\t\tconst parameterName = this.getParameterName(stage);\n\n\t\t// Update last deployed timestamp\n\t\tstate.lastDeployedAt = new Date().toISOString();\n\n\t\tawait this.client.send(\n\t\t\tnew PutParameterCommand({\n\t\t\t\tName: parameterName,\n\t\t\t\tValue: JSON.stringify(state),\n\t\t\t\tType: 'SecureString',\n\t\t\t\tOverwrite: true,\n\t\t\t\tDescription: `GKM deployment state for ${this.workspaceName}/${stage}`,\n\t\t\t}),\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;;AAoCA,IAAa,mBAAb,MAAa,iBAA0C;CACtD,YACUA,eACQC,QAChB;EAFQ;EACQ;CACd;;;;CAKJ,OAAO,OAAOC,SAAoD;EACjE,MAAM,SAAS,IAAIC,+BAAU;GAC5B,QAAQ,QAAQ;GAChB,aAAa,QAAQ;GACrB,UAAU,QAAQ;EAClB;AAED,SAAO,IAAI,iBAAiB,QAAQ,eAAe;CACnD;;;;CAKD,AAAQ,iBAAiBC,OAAuB;AAC/C,UAAQ,OAAO,KAAK,cAAc,GAAG,MAAM;CAC3C;CAED,MAAM,KAAKA,OAAkD;EAC5D,MAAM,gBAAgB,KAAK,iBAAiB,MAAM;AAElD,MAAI;GACH,MAAM,WAAW,MAAM,KAAK,OAAO,KAClC,IAAIC,yCAAoB;IACvB,MAAM;IACN,gBAAgB;GAChB,GACD;AAED,QAAK,SAAS,WAAW,MACxB,QAAO;AAGR,UAAO,KAAK,MAAM,SAAS,UAAU,MAAM;EAC3C,SAAQ,OAAO;AAEf,OAAI,iBAAiBC,uCACpB,QAAO;AAIR,SAAM;EACN;CACD;CAED,MAAM,MAAMF,OAAeG,OAAyC;EACnE,MAAM,gBAAgB,KAAK,iBAAiB,MAAM;AAGlD,QAAM,iBAAiB,qBAAI,QAAO,aAAa;AAE/C,QAAM,KAAK,OAAO,KACjB,IAAIC,yCAAoB;GACvB,MAAM;GACN,OAAO,KAAK,UAAU,MAAM;GAC5B,MAAM;GACN,WAAW;GACX,cAAc,2BAA2B,KAAK,cAAc,GAAG,MAAM;EACrE,GACD;CACD;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Bi9vGQJy.d.mts","names":[],"sources":["../src/deploy/state.ts","../src/deploy/StateProvider.ts","../src/workspace/schema.ts","../src/workspace/types.ts","../src/workspace/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAaA;AAQA;AAQA;;;AAYiC,UA5BhB,gBAAA,CA4BgB;EAAgB,MAA/B,EAAA,MAAA;EAAM,UAEW,EAAA,MAAA;;;;AAEd;UAxBJ,qBAAA;;;ACJjB;;;;AAe6B,UDHZ,iBAAA,CCGY;EAAiB,QAAG,EAAA,SAAA;EAAO,KAAA,EAAA,MAAA;EAM5C;EAgCK,SAAA,EAAA,MAAA;EAOA,aAAA,EAAA,MAAc;EASd,YAAA,EDnDF,MCmDmB,CAAA,MAAA,EAAA,MAEvB,CAAA;EAMC,QAAA,EAAA;IAAW,UAAA,CAAA,EAAA,MAAA;IAAG,OAAA,CAAA,EAAA,MAAA;EAAgB,CAAA;EAAiB;EAAoB,cAAA,CAAA,EDrD7D,MCqD6D,CAAA,MAAA,EDrD9C,gBCqD8C,CAAA;;qBDnD3D,eAAe;;EEiD7B,WAAA,CAAA,EF/CS,ME+CT,CAAA,MAA+C,EF/CvB,q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