@ductape/cli 0.5.5 → 0.5.6

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,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.6",
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",