@ductape/cli 0.5.0 → 0.5.3
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/commands/app-webhooks.d.ts +16 -0
- package/dist/commands/app-webhooks.js +60 -0
- package/dist/commands/apps.d.ts +6 -0
- package/dist/commands/apps.js +20 -4
- package/dist/commands/cloud.d.ts +8 -0
- package/dist/commands/cloud.js +40 -1
- package/dist/commands/deploy-builds.d.ts +3 -1
- package/dist/commands/deploy-builds.js +11 -3
- package/dist/commands/deploy-remote.d.ts +34 -1
- package/dist/commands/deploy-remote.js +109 -3
- package/dist/commands/deploy-worker.d.ts +30 -0
- package/dist/commands/deploy-worker.js +85 -0
- package/dist/commands/install.d.ts +28 -1
- package/dist/commands/install.js +72 -24
- package/dist/commands/platform.js +9 -3
- package/dist/commands/secrets-scan.d.ts +49 -0
- package/dist/commands/secrets-scan.js +113 -0
- package/dist/index.js +108 -17
- package/dist/lib/api-client.js +4 -2
- package/dist/lib/app-import.d.ts +1 -0
- package/dist/lib/app-import.js +8 -1
- package/dist/lib/cloud-connection.d.ts +89 -1
- package/dist/lib/cloud-connection.js +417 -5
- package/dist/lib/env-scan.d.ts +57 -0
- package/dist/lib/env-scan.js +161 -0
- package/dist/lib/platform-api.js +3 -9
- package/package.json +1 -1
- package/templates/api-gateway.conf +53 -34
- package/templates/docker-compose.backend.yml +7 -0
- package/templates/docker-compose.release.yml +122 -103
- package/templates/docker-compose.workbench.yml +58 -0
- package/templates/platform.env +65 -7
package/dist/lib/app-import.js
CHANGED
|
@@ -5,6 +5,12 @@ export const IMPORT_DOC_TYPES = {
|
|
|
5
5
|
postman: 'PostmanV2.1',
|
|
6
6
|
openapi: 'OpenApiV3.0',
|
|
7
7
|
};
|
|
8
|
+
export function requireImportVersion(version) {
|
|
9
|
+
if (!version?.trim()) {
|
|
10
|
+
throw new Error('Provide --version with the verified provider API version. For unversioned or mixed APIs, choose an explicit integration revision; no placeholder version is assigned automatically.');
|
|
11
|
+
}
|
|
12
|
+
return version.trim();
|
|
13
|
+
}
|
|
8
14
|
export function parseImportFormat(value) {
|
|
9
15
|
const v = value.toLowerCase().replace(/[_\s]/g, '');
|
|
10
16
|
if (v === 'postman' || v === 'postmanv21' || v === 'postman2.1' || v === 'postmanv2.1') {
|
|
@@ -24,6 +30,7 @@ function uploadFilename(filePath) {
|
|
|
24
30
|
return `${base}.json`;
|
|
25
31
|
}
|
|
26
32
|
export async function importAppFromFile(ctx, opts) {
|
|
33
|
+
const version = requireImportVersion(opts.version);
|
|
27
34
|
const abs = path.resolve(opts.filePath);
|
|
28
35
|
if (!fs.existsSync(abs))
|
|
29
36
|
throw new Error(`File not found: ${abs}`);
|
|
@@ -35,7 +42,7 @@ export async function importAppFromFile(ctx, opts) {
|
|
|
35
42
|
form.append('public_key', ctx.credentials.public_key);
|
|
36
43
|
form.append('user_id', ctx.credentials.user_id);
|
|
37
44
|
form.append('type', IMPORT_DOC_TYPES[opts.format]);
|
|
38
|
-
form.append('version',
|
|
45
|
+
form.append('version', version);
|
|
39
46
|
form.append('update', opts.update ? 'true' : 'false');
|
|
40
47
|
if (opts.appId)
|
|
41
48
|
form.append('app_id', opts.appId);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CLOUD_PROVIDERS: readonly ["aws", "gcp", "azure", "mongodb_atlas", "neo4j_aura"];
|
|
1
|
+
export declare const CLOUD_PROVIDERS: readonly ["aws", "gcp", "azure", "cloudflare", "mongodb_atlas", "neo4j_aura"];
|
|
2
2
|
export type CloudProviderName = (typeof CLOUD_PROVIDERS)[number];
|
|
3
3
|
export type GuidePurpose = 'resources' | 'deploy';
|
|
4
4
|
export interface IConnectionFlags {
|
|
@@ -13,11 +13,45 @@ export interface IConnectionFlags {
|
|
|
13
13
|
serviceAccountFile?: string;
|
|
14
14
|
runtimeServiceAccount?: string;
|
|
15
15
|
roleArn?: string;
|
|
16
|
+
runtimeRoleArn?: string;
|
|
17
|
+
buildRoleArn?: string;
|
|
18
|
+
defaultRegion?: string;
|
|
19
|
+
/** The outputs of the ductape-fargate stack as saved by `aws cloudformation describe-stacks`, read from a file; the individual flags below win over it. */
|
|
20
|
+
fargateOutputsFile?: string;
|
|
21
|
+
fargateCluster?: string;
|
|
22
|
+
fargateListenerArn?: string;
|
|
23
|
+
fargateBaseDomain?: string;
|
|
24
|
+
fargateVpcId?: string;
|
|
25
|
+
fargateSubnets?: string;
|
|
26
|
+
fargateSecurityGroups?: string;
|
|
27
|
+
fargateTaskRoleArn?: string;
|
|
28
|
+
fargateExecutionRoleArn?: string;
|
|
29
|
+
fargateLogGroup?: string;
|
|
30
|
+
fargatePrivateTasks?: boolean;
|
|
31
|
+
/** `on` or `off`: scale releases that no longer serve to zero tasks (never deleted). */
|
|
32
|
+
fargateScaleDownIdle?: string;
|
|
33
|
+
/** `on` or `off`: the load balancer is internal, so releases are checked from inside the network through the relay function. */
|
|
34
|
+
fargateInternal?: string;
|
|
35
|
+
/** The relay function (the ductape-fargate stack's VerifierFunctionName output). Needed when the load balancer is internal. */
|
|
36
|
+
fargateVerifierFunction?: string;
|
|
37
|
+
/** ECS Express Mode: the role AWS uses to build the load balancer (the ductape-ecs-express stack's InfrastructureRoleArn output). */
|
|
38
|
+
expressInfrastructureRoleArn?: string;
|
|
39
|
+
/** The saved output of `aws cloudformation describe-stacks --stack-name ductape-ecs-express`. */
|
|
40
|
+
expressOutputsFile?: string;
|
|
16
41
|
tenantId?: string;
|
|
17
42
|
subscriptionId?: string;
|
|
18
43
|
clientId?: string;
|
|
19
44
|
clientSecretEnv?: string;
|
|
20
45
|
defaultLocation?: string;
|
|
46
|
+
resourceGroup?: string;
|
|
47
|
+
registryName?: string;
|
|
48
|
+
runtimeIdentityId?: string;
|
|
49
|
+
environmentName?: string;
|
|
50
|
+
keyVaultUri?: string;
|
|
51
|
+
accountId?: string;
|
|
52
|
+
apiTokenEnv?: string;
|
|
53
|
+
/** Cloudflare Secrets Store that { secret: NAME } references are bound from; empty clears it. */
|
|
54
|
+
secretsStoreId?: string;
|
|
21
55
|
atlasPublicKey?: string;
|
|
22
56
|
atlasPrivateKeyEnv?: string;
|
|
23
57
|
auraClientId?: string;
|
|
@@ -29,6 +63,11 @@ export interface IConnectionIo {
|
|
|
29
63
|
env: Record<string, string | undefined>;
|
|
30
64
|
}
|
|
31
65
|
export declare const realIo: IConnectionIo;
|
|
66
|
+
/**
|
|
67
|
+
* The Fargate fields of a connection: from the saved outputs of the setup stack, then any individual flag on top. Accepts what
|
|
68
|
+
* `aws cloudformation describe-stacks --stack-name ductape-fargate` prints, the bare list of outputs, or a plain object of them.
|
|
69
|
+
*/
|
|
70
|
+
export declare function fargateFields(flags: IConnectionFlags, io: IConnectionIo): Record<string, unknown>;
|
|
32
71
|
/**
|
|
33
72
|
* Builds the request body for `ductape cloud connections <verb>` from flags, on top of any body read from a file. Flags win.
|
|
34
73
|
* Nothing secret is accepted as a flag value.
|
|
@@ -69,6 +108,18 @@ export interface IConnectionGuide {
|
|
|
69
108
|
problem: string;
|
|
70
109
|
fix: string;
|
|
71
110
|
}>;
|
|
111
|
+
/** An optional second path on the same connection, such as Fargate on top of Lambda. */
|
|
112
|
+
optional?: Array<{
|
|
113
|
+
title: string;
|
|
114
|
+
summary: string;
|
|
115
|
+
steps: IGuideStep[];
|
|
116
|
+
creates: string[];
|
|
117
|
+
limits: string[];
|
|
118
|
+
troubleshooting: Array<{
|
|
119
|
+
problem: string;
|
|
120
|
+
fix: string;
|
|
121
|
+
}>;
|
|
122
|
+
}>;
|
|
72
123
|
/** What to do once the connection is active. */
|
|
73
124
|
next?: string[];
|
|
74
125
|
}
|
|
@@ -83,6 +134,43 @@ export declare const GCP_DEPLOY_TROUBLESHOOTING: {
|
|
|
83
134
|
problem: string;
|
|
84
135
|
fix: string;
|
|
85
136
|
}[];
|
|
137
|
+
export declare const AWS_DEPLOY_ROLE_LIST: {
|
|
138
|
+
role: string;
|
|
139
|
+
for: string;
|
|
140
|
+
}[];
|
|
141
|
+
export declare const AWS_DEPLOY_CREATES: string[];
|
|
142
|
+
export declare const AWS_DEPLOY_SAFETY = "Ductape only adds resources it tags as its own (ductape_managed), never changes or reuses one it did not create, and never deletes anything, including what it created. Removing deployed resources is always your own action. Use a dedicated account if you can, so what Ductape adds is easy to see.";
|
|
143
|
+
export declare const AWS_DEPLOY_TROUBLESHOOTING: {
|
|
144
|
+
problem: string;
|
|
145
|
+
fix: string;
|
|
146
|
+
}[];
|
|
147
|
+
/**
|
|
148
|
+
* Extra steps for a connection that also deploys to AWS Fargate. Lambda needs none of this; Fargate runs your containers behind a load balancer
|
|
149
|
+
* in your account, so it needs a cluster, a certificate for a domain you own, and the permissions to manage them.
|
|
150
|
+
*/
|
|
151
|
+
export declare const AWS_FARGATE_OPTIONAL: NonNullable<IConnectionGuide['optional']>[number];
|
|
152
|
+
/** Extra steps for a connection that also deploys to ECS Express Mode. It builds on the Fargate stack and changes what is guaranteed, which the steps say plainly. */
|
|
153
|
+
export declare const AWS_EXPRESS_OPTIONAL: NonNullable<IConnectionGuide['optional']>[number];
|
|
154
|
+
export declare const AZURE_DEPLOY_ROLE_LIST: {
|
|
155
|
+
role: string;
|
|
156
|
+
for: string;
|
|
157
|
+
}[];
|
|
158
|
+
export declare const AZURE_DEPLOY_CREATES: string[];
|
|
159
|
+
export declare const AZURE_DEPLOY_SAFETY = "Ductape only adds resources it tags as its own (ductape_managed), never changes or reuses one it did not create, and never deletes anything, including what it created. It never registers resource providers or changes anything outside the one resource group. Removing deployed resources is always your own action.";
|
|
160
|
+
export declare const AZURE_DEPLOY_TROUBLESHOOTING: {
|
|
161
|
+
problem: string;
|
|
162
|
+
fix: string;
|
|
163
|
+
}[];
|
|
164
|
+
export declare const CLOUDFLARE_DEPLOY_ROLE_LIST: {
|
|
165
|
+
role: string;
|
|
166
|
+
for: string;
|
|
167
|
+
}[];
|
|
168
|
+
export declare const CLOUDFLARE_DEPLOY_CREATES: string[];
|
|
169
|
+
export declare const CLOUDFLARE_DEPLOY_SAFETY = "Ductape only adds resources it tags as its own (ductape_managed), never changes or reuses one it did not create, and never deletes anything, including what it created. Removing deployed Workers is always your own action. A Worker has no cloud-level access check in front of it: the function's own signature check, which every call must pass, is the access control. Only functions can run on Workers, not services, and only TypeScript functions.";
|
|
170
|
+
export declare const CLOUDFLARE_DEPLOY_TROUBLESHOOTING: {
|
|
171
|
+
problem: string;
|
|
172
|
+
fix: string;
|
|
173
|
+
}[];
|
|
86
174
|
export declare const GCP_DEPLOY_APIS: string[];
|
|
87
175
|
export declare function connectionGuide(providerInput: string, purposeInput?: string): IConnectionGuide;
|
|
88
176
|
/** A copy of a request body that is safe to print: secrets and key material are replaced, everything else is kept. */
|