@dataformer/env-service 2.0.0 → 2.2.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 +11 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +0 -12
- package/package.json +2 -2
- package/src/index.ts +2 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @dataformer/env-service
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- removed requirement for user email from secret manager name
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @dataformer/secret-manager-client@2.2.0
|
|
13
|
+
|
|
3
14
|
## 2.0.0
|
|
4
15
|
|
|
5
16
|
### Major Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -43,8 +43,7 @@ declare const getJiraUserEmail: () => Promise<string | null>;
|
|
|
43
43
|
declare const getGeminiApiKey: () => Promise<string | null>;
|
|
44
44
|
declare const getNpmToken: () => Promise<string | null>;
|
|
45
45
|
declare const getProjectRoot: () => string;
|
|
46
|
-
declare const getGcpUserEmail: () => Promise<string | null>;
|
|
47
46
|
declare const printEnv: () => Promise<void>;
|
|
48
47
|
declare const run: () => Promise<void>;
|
|
49
48
|
|
|
50
|
-
export { askQuestion, getBigtableInstanceName, getBigtableProjectId, getBigtableTableName, getCustomSearchApiKey, getEnvVar, getFirestoreProjectId, getGcpProjectId,
|
|
49
|
+
export { askQuestion, getBigtableInstanceName, getBigtableProjectId, getBigtableTableName, getCustomSearchApiKey, getEnvVar, getFirestoreProjectId, getGcpProjectId, 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
|
@@ -226,15 +226,6 @@ var getProjectRoot = () => {
|
|
|
226
226
|
const currentDir = path.dirname(new URL(import.meta.url).pathname);
|
|
227
227
|
return path.resolve(currentDir, "../..");
|
|
228
228
|
};
|
|
229
|
-
var _getResolvedGcpUserEmail = async () => {
|
|
230
|
-
const sm = await getSecretManager();
|
|
231
|
-
if (!sm) {
|
|
232
|
-
console.warn("[EnvService.ts] SecretManager not available for _getResolvedGcpUserEmail");
|
|
233
|
-
return null;
|
|
234
|
-
}
|
|
235
|
-
return sm.getResolvedUserEmail();
|
|
236
|
-
};
|
|
237
|
-
var getGcpUserEmail = _getResolvedGcpUserEmail;
|
|
238
229
|
var printEnv = async () => {
|
|
239
230
|
const logToConsole = await getLogToConsole();
|
|
240
231
|
const postgresUser = await getPostgresUser();
|
|
@@ -255,11 +246,9 @@ var printEnv = async () => {
|
|
|
255
246
|
const geminiApiKey = await getGeminiApiKey();
|
|
256
247
|
const customSearchApiKey = await getCustomSearchApiKey();
|
|
257
248
|
const gcpProjectIdVal = await getGcpProjectId();
|
|
258
|
-
const gcpUserEmailVal = await getGcpUserEmail();
|
|
259
249
|
const npmToken = await getNpmToken();
|
|
260
250
|
console.log(`Project Root: ${getProjectRoot()}`);
|
|
261
251
|
console.log(`GCP Project ID: ${gcpProjectIdVal}`);
|
|
262
|
-
console.log(`GCP User Email (for Secret Manager naming): ${gcpUserEmailVal}`);
|
|
263
252
|
console.log(`Log to Console: ${logToConsole}`);
|
|
264
253
|
console.log(`PostgreSQL User: ${postgresUser}`);
|
|
265
254
|
console.log(`PostgreSQL Password: ${obfuscateCred(postgresPassword)}`);
|
|
@@ -364,7 +353,6 @@ export {
|
|
|
364
353
|
getEnvVar,
|
|
365
354
|
getFirestoreProjectId,
|
|
366
355
|
getGcpProjectId,
|
|
367
|
-
getGcpUserEmail,
|
|
368
356
|
getGeminiApiKey,
|
|
369
357
|
getJiraApiBaseUrl,
|
|
370
358
|
getJiraApiToken,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataformer/env-service",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Environment service for Dataformer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@google-cloud/secret-manager": "^5.4.0",
|
|
16
|
-
"@dataformer/secret-manager-client": "^2.
|
|
16
|
+
"@dataformer/secret-manager-client": "^2.2.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsup": "^8.0.0",
|
package/src/index.ts
CHANGED
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
// 2. Local gcloud configuration (for development: `gcloud config get-value project`)
|
|
31
31
|
//
|
|
32
32
|
// SECRET NAMING CONVENTION:
|
|
33
|
-
// Secrets are named using the format: {projectId}_{
|
|
34
|
-
// This ensures
|
|
33
|
+
// Secrets are named using the format: {projectId}_{secretId}
|
|
34
|
+
// This ensures project-specific secrets that don't conflict across projects.
|
|
35
35
|
|
|
36
36
|
import readline from 'readline';
|
|
37
37
|
import path from 'path';
|
|
@@ -319,17 +319,6 @@ const _getResolvedGcpProjectId = async (): Promise<string | null> => {
|
|
|
319
319
|
return sm.getResolvedProjectId();
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
-
const _getResolvedGcpUserEmail = async (): Promise<string | null> => {
|
|
323
|
-
const sm = await getSecretManager();
|
|
324
|
-
if (!sm) {
|
|
325
|
-
console.warn('[EnvService.ts] SecretManager not available for _getResolvedGcpUserEmail');
|
|
326
|
-
return null;
|
|
327
|
-
}
|
|
328
|
-
return sm.getResolvedUserEmail();
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
const getGcpUserEmail = _getResolvedGcpUserEmail;
|
|
332
|
-
|
|
333
322
|
const printEnv = async (): Promise<void> => {
|
|
334
323
|
const logToConsole = await getLogToConsole();
|
|
335
324
|
const postgresUser = await getPostgresUser();
|
|
@@ -350,12 +339,10 @@ const printEnv = async (): Promise<void> => {
|
|
|
350
339
|
const geminiApiKey = await getGeminiApiKey();
|
|
351
340
|
const customSearchApiKey = await getCustomSearchApiKey();
|
|
352
341
|
const gcpProjectIdVal = await getGcpProjectId();
|
|
353
|
-
const gcpUserEmailVal = await getGcpUserEmail();
|
|
354
342
|
const npmToken = await getNpmToken();
|
|
355
343
|
|
|
356
344
|
console.log(`Project Root: ${getProjectRoot()}`);
|
|
357
345
|
console.log(`GCP Project ID: ${gcpProjectIdVal}`);
|
|
358
|
-
console.log(`GCP User Email (for Secret Manager naming): ${gcpUserEmailVal}`);
|
|
359
346
|
console.log(`Log to Console: ${logToConsole}`);
|
|
360
347
|
console.log(`PostgreSQL User: ${postgresUser}`);
|
|
361
348
|
console.log(`PostgreSQL Password: ${obfuscateCred(postgresPassword)}`);
|
|
@@ -462,7 +449,6 @@ export {
|
|
|
462
449
|
|
|
463
450
|
// Synchronous Getters / Utility
|
|
464
451
|
getProjectRoot,
|
|
465
|
-
getGcpUserEmail,
|
|
466
452
|
|
|
467
453
|
// Generic accessors
|
|
468
454
|
getEnvVar,
|