@dataformer/env-service 1.0.0 → 1.1.1
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/index.d.ts +3 -1
- package/dist/index.js +14 -0
- package/package.json +2 -2
- package/src/index.ts +13 -0
package/CHANGELOG.md
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare const setPostgresHostName: () => Promise<void>;
|
|
|
13
13
|
declare const setPostgresIpType: () => Promise<void>;
|
|
14
14
|
declare const setPostgresPoolSizeMax: () => Promise<void>;
|
|
15
15
|
declare const setPostgresInstanceConnectionName: () => Promise<void>;
|
|
16
|
+
declare const setPostgresAuthType: () => Promise<void>;
|
|
16
17
|
declare const setBigtableInstanceName: () => Promise<void>;
|
|
17
18
|
declare const setBigtableTableName: () => Promise<void>;
|
|
18
19
|
declare const setBigtableProjectId: () => Promise<void>;
|
|
@@ -31,6 +32,7 @@ declare const getPostgresHostName: () => Promise<string | null>;
|
|
|
31
32
|
declare const getPostgresIpType: () => Promise<string | null>;
|
|
32
33
|
declare const getPostgresPoolSizeMax: () => Promise<number | null>;
|
|
33
34
|
declare const getPostgresInstanceConnectionName: () => Promise<string | null>;
|
|
35
|
+
declare const getPostgresAuthType: () => Promise<string | null>;
|
|
34
36
|
declare const getBigtableInstanceName: () => Promise<string | null>;
|
|
35
37
|
declare const getBigtableTableName: () => Promise<string | null>;
|
|
36
38
|
declare const getBigtableProjectId: () => Promise<string | null>;
|
|
@@ -45,4 +47,4 @@ declare const getGcpUserEmail: () => Promise<string | null>;
|
|
|
45
47
|
declare const printEnv: () => Promise<void>;
|
|
46
48
|
declare const run: () => Promise<void>;
|
|
47
49
|
|
|
48
|
-
export { askQuestion, getBigtableInstanceName, getBigtableProjectId, getBigtableTableName, getCustomSearchApiKey, getEnvVar, getFirestoreProjectId, getGcpProjectId, getGcpUserEmail, getGeminiApiKey, getJiraApiBaseUrl, getJiraApiToken, getJiraUserEmail, getLogToConsole, getNpmToken, getPostgresDatabase, getPostgresHostName, getPostgresInstanceConnectionName, getPostgresIpType, getPostgresPassword, getPostgresPoolSizeMax, getPostgresUser, getProjectRoot, getSearchEngineId, obfuscateCred, printEnv, run, setBigtableInstanceName, setBigtableProjectId, setBigtableTableName, setCustomSearchApiKey, setEnvVar, setFirestoreProjectId, setGeminiApiKey, setJiraApiBaseUrl, setJiraApiToken, setJiraUserEmail, setLogToConsole, setNpmToken, setPostgresDatabase, setPostgresHostName, setPostgresInstanceConnectionName, setPostgresIpType, setPostgresPassword, setPostgresPoolSizeMax, setPostgresUser };
|
|
50
|
+
export { askQuestion, getBigtableInstanceName, getBigtableProjectId, getBigtableTableName, getCustomSearchApiKey, getEnvVar, getFirestoreProjectId, getGcpProjectId, getGcpUserEmail, getGeminiApiKey, getJiraApiBaseUrl, getJiraApiToken, getJiraUserEmail, getLogToConsole, getNpmToken, getPostgresAuthType, getPostgresDatabase, getPostgresHostName, getPostgresInstanceConnectionName, getPostgresIpType, getPostgresPassword, getPostgresPoolSizeMax, getPostgresUser, getProjectRoot, getSearchEngineId, obfuscateCred, printEnv, run, setBigtableInstanceName, setBigtableProjectId, setBigtableTableName, setCustomSearchApiKey, setEnvVar, setFirestoreProjectId, setGeminiApiKey, setJiraApiBaseUrl, setJiraApiToken, setJiraUserEmail, setLogToConsole, setNpmToken, setPostgresAuthType, setPostgresDatabase, setPostgresHostName, setPostgresInstanceConnectionName, setPostgresIpType, setPostgresPassword, setPostgresPoolSizeMax, setPostgresUser };
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,12 @@ var setPostgresInstanceConnectionName = async () => {
|
|
|
124
124
|
await setEnvVar("POSTGRES_INSTANCE_CONNECTION_NAME", instanceConnectionName);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
+
var setPostgresAuthType = async () => {
|
|
128
|
+
const authType = await askQuestion("Enter PostgreSQL Auth Type (PASSWORD, IAM)", "PASSWORD");
|
|
129
|
+
if (authType) {
|
|
130
|
+
await setEnvVar("POSTGRES_AUTH_TYPE", authType);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
127
133
|
var setBigtableInstanceName = async () => {
|
|
128
134
|
const btInstanceName = await askQuestion("Enter Bigtable Instance Name", "");
|
|
129
135
|
if (btInstanceName) {
|
|
@@ -191,6 +197,7 @@ var getPostgresPoolSizeMax = async () => {
|
|
|
191
197
|
return value ? parseInt(value, 10) : null;
|
|
192
198
|
};
|
|
193
199
|
var getPostgresInstanceConnectionName = async () => await getEnvVar("POSTGRES_INSTANCE_CONNECTION_NAME");
|
|
200
|
+
var getPostgresAuthType = async () => await getEnvVar("POSTGRES_AUTH_TYPE");
|
|
194
201
|
var getBigtableInstanceName = async () => await getEnvVar("BIGTABLE_INSTANCE_NAME");
|
|
195
202
|
var getBigtableTableName = async () => await getEnvVar("BIGTABLE_TABLE_NAME");
|
|
196
203
|
var getBigtableProjectId = async () => await getEnvVar("BIGTABLE_PROJECT_ID");
|
|
@@ -231,6 +238,7 @@ var printEnv = async () => {
|
|
|
231
238
|
const postgresIpType = await getPostgresIpType();
|
|
232
239
|
const postgresPoolSizeMax = await getPostgresPoolSizeMax();
|
|
233
240
|
const postgresInstanceConnectionName = await getPostgresInstanceConnectionName();
|
|
241
|
+
const postgresAuthType = await getPostgresAuthType();
|
|
234
242
|
const bigtableInstanceName = await getBigtableInstanceName();
|
|
235
243
|
const bigtableTableName = await getBigtableTableName();
|
|
236
244
|
const bigtableProjectId = await getBigtableProjectId();
|
|
@@ -254,6 +262,7 @@ var printEnv = async () => {
|
|
|
254
262
|
console.log(`PostgreSQL IP Type: ${postgresIpType}`);
|
|
255
263
|
console.log(`PostgreSQL Pool Size Max: ${postgresPoolSizeMax}`);
|
|
256
264
|
console.log(`PostgreSQL Instance Connection Name: ${postgresInstanceConnectionName}`);
|
|
265
|
+
console.log(`PostgreSQL Auth Type: ${postgresAuthType}`);
|
|
257
266
|
console.log(`Bigtable Instance Name: ${bigtableInstanceName}`);
|
|
258
267
|
console.log(`Bigtable Table Name: ${bigtableTableName}`);
|
|
259
268
|
console.log(`Bigtable Project ID: ${bigtableProjectId}`);
|
|
@@ -292,6 +301,9 @@ var run = async () => {
|
|
|
292
301
|
case "setPostgresInstanceConnectionName":
|
|
293
302
|
await setPostgresInstanceConnectionName();
|
|
294
303
|
break;
|
|
304
|
+
case "setPostgresAuthType":
|
|
305
|
+
await setPostgresAuthType();
|
|
306
|
+
break;
|
|
295
307
|
case "setBigtableInstanceName":
|
|
296
308
|
await setBigtableInstanceName();
|
|
297
309
|
break;
|
|
@@ -353,6 +365,7 @@ export {
|
|
|
353
365
|
getJiraUserEmail,
|
|
354
366
|
getLogToConsole,
|
|
355
367
|
getNpmToken,
|
|
368
|
+
getPostgresAuthType,
|
|
356
369
|
getPostgresDatabase,
|
|
357
370
|
getPostgresHostName,
|
|
358
371
|
getPostgresInstanceConnectionName,
|
|
@@ -377,6 +390,7 @@ export {
|
|
|
377
390
|
setJiraUserEmail,
|
|
378
391
|
setLogToConsole,
|
|
379
392
|
setNpmToken,
|
|
393
|
+
setPostgresAuthType,
|
|
380
394
|
setPostgresDatabase,
|
|
381
395
|
setPostgresHostName,
|
|
382
396
|
setPostgresInstanceConnectionName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataformer/env-service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Environment service for Dataformer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@google-cloud/secret-manager": "^5.4.0",
|
|
21
|
-
"@dataformer/secret-manager-client": "
|
|
21
|
+
"@dataformer/secret-manager-client": "^1.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"tsup": "^8.0.0",
|
package/src/index.ts
CHANGED
|
@@ -184,6 +184,13 @@ const setPostgresInstanceConnectionName = async (): Promise<void> => {
|
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
+
const setPostgresAuthType = async (): Promise<void> => {
|
|
188
|
+
const authType = await askQuestion('Enter PostgreSQL Auth Type (PASSWORD, IAM)', 'PASSWORD');
|
|
189
|
+
if (authType) {
|
|
190
|
+
await setEnvVar('POSTGRES_AUTH_TYPE', authType);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
187
194
|
const setBigtableInstanceName = async (): Promise<void> => {
|
|
188
195
|
const btInstanceName = await askQuestion('Enter Bigtable Instance Name', '');
|
|
189
196
|
if (btInstanceName) {
|
|
@@ -262,6 +269,7 @@ const getPostgresPoolSizeMax = async (): Promise<number | null> => {
|
|
|
262
269
|
return value ? parseInt(value, 10) : null;
|
|
263
270
|
};
|
|
264
271
|
const getPostgresInstanceConnectionName = async (): Promise<string | null> => await getEnvVar('POSTGRES_INSTANCE_CONNECTION_NAME');
|
|
272
|
+
const getPostgresAuthType = async (): Promise<string | null> => await getEnvVar('POSTGRES_AUTH_TYPE');
|
|
265
273
|
const getBigtableInstanceName = async (): Promise<string | null> => await getEnvVar('BIGTABLE_INSTANCE_NAME');
|
|
266
274
|
const getBigtableTableName = async (): Promise<string | null> => await getEnvVar('BIGTABLE_TABLE_NAME');
|
|
267
275
|
const getBigtableProjectId = async (): Promise<string | null> => await getEnvVar('BIGTABLE_PROJECT_ID');
|
|
@@ -309,6 +317,7 @@ const printEnv = async (): Promise<void> => {
|
|
|
309
317
|
const postgresIpType = await getPostgresIpType();
|
|
310
318
|
const postgresPoolSizeMax = await getPostgresPoolSizeMax();
|
|
311
319
|
const postgresInstanceConnectionName = await getPostgresInstanceConnectionName();
|
|
320
|
+
const postgresAuthType = await getPostgresAuthType();
|
|
312
321
|
const bigtableInstanceName = await getBigtableInstanceName();
|
|
313
322
|
const bigtableTableName = await getBigtableTableName();
|
|
314
323
|
const bigtableProjectId = await getBigtableProjectId();
|
|
@@ -333,6 +342,7 @@ const printEnv = async (): Promise<void> => {
|
|
|
333
342
|
console.log(`PostgreSQL IP Type: ${postgresIpType}`);
|
|
334
343
|
console.log(`PostgreSQL Pool Size Max: ${postgresPoolSizeMax}`);
|
|
335
344
|
console.log(`PostgreSQL Instance Connection Name: ${postgresInstanceConnectionName}`);
|
|
345
|
+
console.log(`PostgreSQL Auth Type: ${postgresAuthType}`);
|
|
336
346
|
console.log(`Bigtable Instance Name: ${bigtableInstanceName}`);
|
|
337
347
|
console.log(`Bigtable Table Name: ${bigtableTableName}`);
|
|
338
348
|
console.log(`Bigtable Project ID: ${bigtableProjectId}`);
|
|
@@ -356,6 +366,7 @@ const run = async (): Promise<void> => {
|
|
|
356
366
|
case 'setPostgresIpType': await setPostgresIpType(); break;
|
|
357
367
|
case 'setPostgresPoolSizeMax': await setPostgresPoolSizeMax(); break;
|
|
358
368
|
case 'setPostgresInstanceConnectionName': await setPostgresInstanceConnectionName(); break;
|
|
369
|
+
case 'setPostgresAuthType': await setPostgresAuthType(); break;
|
|
359
370
|
case 'setBigtableInstanceName': await setBigtableInstanceName(); break;
|
|
360
371
|
case 'setBigtableTableName': await setBigtableTableName(); break;
|
|
361
372
|
case 'setBigtableProjectId': await setBigtableProjectId(); break;
|
|
@@ -396,6 +407,7 @@ export {
|
|
|
396
407
|
setPostgresIpType,
|
|
397
408
|
setPostgresPoolSizeMax,
|
|
398
409
|
setPostgresInstanceConnectionName,
|
|
410
|
+
setPostgresAuthType,
|
|
399
411
|
setBigtableInstanceName,
|
|
400
412
|
setBigtableTableName,
|
|
401
413
|
setBigtableProjectId,
|
|
@@ -416,6 +428,7 @@ export {
|
|
|
416
428
|
getPostgresIpType,
|
|
417
429
|
getPostgresPoolSizeMax,
|
|
418
430
|
getPostgresInstanceConnectionName,
|
|
431
|
+
getPostgresAuthType,
|
|
419
432
|
getBigtableInstanceName,
|
|
420
433
|
getBigtableTableName,
|
|
421
434
|
getBigtableProjectId,
|