@ductape/cli 0.5.5 → 0.5.7

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/index.js CHANGED
@@ -127,7 +127,7 @@ const codeTarget = (c) => c
127
127
  .option('--product <tag>').option('--function <name>').option('--fn-version <version>').option('--env <slug>');
128
128
  remote('step-up', 'start', 'Email yourself a six-digit code for one change (a person only)', codeTarget).action(op('stepup.start'));
129
129
  remote('step-up', 'verify', 'Check the code and print a grant, good for ten minutes and for that one change; put it in an environment variable and pass its name with --grant-env', (c) => codeTarget(c).requiredOption('--code <code>', 'the six-digit code from your email')).action(op('stepup.verify'));
130
- remote('plans', 'create', 'Create a plan from a JSON file; nothing is changed', (c) => c.requiredOption('--file <file>', 'Plan request JSON')).action(op('plans.create'));
130
+ remote('plans', 'create', 'Create a plan from a JSON file; nothing is changed', (c) => c.requiredOption('--file <file>', 'Plan request JSON (static egress uses runtime.vpcEgress on Cloud Run with optional provision: true or runtime.awsVpcEgress on Lambda or ECS Fargate)')).action(op('plans.create'));
131
131
  remote('plans', 'approve <planId>', 'Approve a plan (a person only; refused for agents)', grantOption).action(op('plans.approve'));
132
132
  remote('plans', 'list', 'List plans with where each stands: blocked, pending_approval, approved, ready, applied or expired', (c) => c.option('--product <tag>').option('--env <env>').option('--stage <stage>')).action(op('plans.list'));
133
133
  remote('plans', 'get <planId>', 'Show one plan: what it would change, its warnings and the state of the cloud it was made from').action(op('plans.get'));
@@ -136,7 +136,7 @@ remote('deployments', 'list', 'List deployments (functions and services)', (c) =
136
136
  remote('deployments', 'get <deploymentId>', 'Show one deployment').action(op('deployments.get'));
137
137
  remote('deployments', 'journal <deploymentId>', 'Show a deployment\'s journal').action(op('deployments.journal'));
138
138
  const planFromDeployment = (c) => c
139
- .option('--runtime-file <file>', 'Runtime settings JSON that replace the deployment\'s own (cpu, memory, minInstances, maxInstances ...)')
139
+ .option('--runtime-file <file>', 'Runtime settings JSON that replace the deployment\'s own (cpu, memory, minInstances, maxInstances, or Cloud Run vpcEgress with network and subnet names)')
140
140
  .option('--observed-file <file>', 'What the provider holds; only while the control plane does not read the provider itself');
141
141
  remote('deployments', 'redeploy <deploymentId>', 'Plan running the deployment\'s current release again (retry a failed one); nothing changes until the plan is approved and applied', planFromDeployment).action(op('deployments.redeploy'));
142
142
  remote('deployments', 'rollback <deploymentId>', 'Plan putting an earlier release back at full traffic (default: the last one that held all traffic)', (c) => planFromDeployment(c).option('--release-hash <hash>', 'A release this deployment has run')).action(op('deployments.rollback'));
@@ -309,6 +309,9 @@ export const GCP_DEPLOY_CREATES = [
309
309
  ];
310
310
  export const GCP_DEPLOY_SAFETY = 'Ductape only adds resources it labels 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 project if you can, so what Ductape adds is easy to see.';
311
311
  export const GCP_DEPLOY_TROUBLESHOOTING = [
312
+ { problem: 'Static egress creation fails with a Compute API or IAM error', fix: 'Enable compute.googleapis.com in the connected project. Grant the connection service account the Compute permissions named in the error, then retry the deployment. The journal records the outbound IPv4 once the network is ready.' },
313
+ { problem: 'Cloud Run cannot attach the VPC subnet', fix: 'Check that the subnet belongs to the selected VPC and is in the deployment region and connected project. If Google Cloud reports an IAM denial, check the principal and permission named in the error.' },
314
+ { problem: 'Cloud Run starts but Atlas connections time out or fail during TLS setup', fix: 'Check that Cloud NAT serves the selected subnet and uses a reserved IPv4. Verify the actual outbound IP from the revision and allowlist it as a /32 in Atlas. If the Ductape resolver returns 502, check the integrations logs for that request separately.' },
312
315
  { problem: '"<API> has not been used in project <PROJECT_ID> before or it is disabled"', fix: 'Enable that API (step 1), wait a minute or two for it to take effect, and try again.' },
313
316
  { problem: 'Validation lists missing permissions and the roles that grant them', fix: 'Grant exactly those roles to the Ductape service account on the project (step 3) and validate again. Role changes can take a minute to apply.' },
314
317
  { problem: '"caller does not have permission to act as service account ..." when a build or deploy starts', fix: 'Grant roles/iam.serviceAccountUser to the Ductape service account on the project. Cloud Build and Cloud Run run as a service account, and the Ductape account must be allowed to act as it.' },
@@ -595,7 +598,7 @@ export function connectionGuide(providerInput, purposeInput = 'resources') {
595
598
  },
596
599
  {
597
600
  step: 4, who: 'you', title: 'Deploy the template into the resource group',
598
- commands: ['az deployment group create --resource-group ductape-deploy --template-file ductape-deploy.json --query properties.outputs'],
601
+ commands: ['az deployment group create --resource-group ductape-deploy --template-file ductape-deploy.json --query properties.outputs', '# Static egress: add --parameters environmentName=ductape-env-nat provisionStaticEgress=true (creates a billable NAT gateway and static IP). To reuse a delegated NAT subnet, set infrastructureSubnetId instead.'],
599
602
  notes: ['It creates a user assigned identity for your apps to run as, a container registry, a log workspace and a container apps environment, and lets the identity pull from the registry. Read it first. The role assignment in it needs you to hold Owner or User Access Administrator on the group.', 'The outputs give the registry name, environment name and identity id used in step 6.'],
600
603
  },
601
604
  {
@@ -1,6 +1,6 @@
1
1
  /** Enum values aligned with @ductape/sdk — used for CLI dropdowns */
2
2
  export declare const STORAGE_PROVIDERS: readonly ["aws", "gcp", "azure"];
3
- export declare const DATABASE_TYPES: readonly ["postgresql", "mongodb", "mysql"];
3
+ export declare const DATABASE_TYPES: readonly ["postgresql", "mongodb", "mysql", "redis"];
4
4
  export declare const GRAPH_TYPES: readonly ["neo4j", "neptune", "arangodb", "memgraph"];
5
5
  export declare const VECTOR_DB_TYPES: readonly ["pinecone", "qdrant", "weaviate", "chroma", "milvus", "pgvector", "memory"];
6
6
  export declare const VECTOR_DISTANCE_METRICS: readonly ["cosine", "euclidean", "dotproduct"];
@@ -1,6 +1,6 @@
1
1
  /** Enum values aligned with @ductape/sdk — used for CLI dropdowns */
2
2
  export const STORAGE_PROVIDERS = ['aws', 'gcp', 'azure'];
3
- export const DATABASE_TYPES = ['postgresql', 'mongodb', 'mysql'];
3
+ export const DATABASE_TYPES = ['postgresql', 'mongodb', 'mysql', 'redis'];
4
4
  export const GRAPH_TYPES = ['neo4j', 'neptune', 'arangodb', 'memgraph'];
5
5
  export const VECTOR_DB_TYPES = [
6
6
  'pinecone',
@@ -1,3 +1,4 @@
1
+ import password from '@inquirer/password';
1
2
  import input from '@inquirer/input';
2
3
  import select from '@inquirer/select';
3
4
  import { MESSAGE_BROKER_TYPES, STORAGE_PROVIDERS } from './enums.js';
@@ -66,7 +67,26 @@ async function promptEnvs(variant, context) {
66
67
  message: `Environment slug #${envs.length + 1} (3 letters)`,
67
68
  validate: (v) => (v.length >= 1 && v.length <= 3 ? true : 'Use 1–3 characters'),
68
69
  });
69
- if (variant === 'database' || variant === 'graph') {
70
+ if (variant === 'database' && context?.databaseType === 'redis') {
71
+ const mode = await select({ message: 'Redis connection', choices: [
72
+ { name: 'Redis URL', value: 'url' }, { name: 'Import cloud instance', value: 'import' }, { name: 'Provision cloud instance', value: 'provision' },
73
+ ] });
74
+ if (mode === 'url')
75
+ envs.push({ slug, connection_url: await password({ message: 'Redis URL (redis:// or rediss://)' }) });
76
+ else {
77
+ const row = { slug, cloud: await input({ message: 'Cloud connection tag' }),
78
+ instance: await input({ message: 'Redis instance name or resource ID' }), region: await input({ message: 'Cloud region' }), importExisting: mode === 'import' };
79
+ if (mode === 'import') {
80
+ const token = await password({ message: 'AWS Redis AUTH token (leave empty for GCP/Azure or stored credentials)' });
81
+ if (token)
82
+ row.masterPassword = token;
83
+ }
84
+ else
85
+ row.redis = await promptJsonObject('Redis provider settings (GCP: authorizedNetwork, memorySizeGb; AWS: cacheSubnetGroupName, securityGroupIds, nodeType; Azure: resourceGroup, sku)');
86
+ envs.push(row);
87
+ }
88
+ }
89
+ else if (variant === 'database' || variant === 'graph') {
70
90
  const connection_url = await input({
71
91
  message: 'Connection URL',
72
92
  });
@@ -159,6 +179,7 @@ export async function promptForm(schema, opts) {
159
179
  const patch = Boolean(opts?.patch);
160
180
  const body = {};
161
181
  let vectorType;
182
+ let databaseType;
162
183
  for (const field of schema.fields) {
163
184
  if (patch && !field.required) {
164
185
  const set = await askYesNo(`Set ${field.label}?`, false);
@@ -170,9 +191,14 @@ export async function promptForm(schema, opts) {
170
191
  if (value !== undefined) {
171
192
  body.type = value;
172
193
  vectorType = String(value);
194
+ databaseType = String(value);
173
195
  }
174
196
  continue;
175
197
  }
198
+ if (field.kind === 'envs' && field.envsVariant === 'database' && databaseType === 'redis') {
199
+ body[field.key] = await promptEnvs('database', { databaseType });
200
+ continue;
201
+ }
176
202
  if (field.kind === 'envs' && field.envsVariant === 'vector') {
177
203
  const envs = await promptEnvs('vector', { vectorType });
178
204
  if (envs.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/cli",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Ductape CLI — local platform, login, link projects, and manage resources via the proxy (Workbench-compatible)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",