@dataformer/env-service 3.0.1 → 3.0.2

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.d.ts CHANGED
@@ -26,6 +26,7 @@ declare const setConfluenceUserEmail: () => Promise<void>;
26
26
  declare const setConfluenceDefaultSpaceId: () => Promise<void>;
27
27
  declare const setGeminiApiKey: () => Promise<void>;
28
28
  declare const setNpmToken: () => Promise<void>;
29
+ declare const setPulumiAccessToken: () => Promise<void>;
29
30
  declare const setCustomSearchApiKey: () => Promise<void>;
30
31
  declare const setCustomSearchEngineId: () => Promise<void>;
31
32
  declare const setFirestoreProjectId: () => Promise<void>;
@@ -51,8 +52,9 @@ declare const getConfluenceUserEmail: () => Promise<string | null>;
51
52
  declare const getConfluenceDefaultSpaceId: () => Promise<string | null>;
52
53
  declare const getGeminiApiKey: () => Promise<string | null>;
53
54
  declare const getNpmToken: () => Promise<string | null>;
55
+ declare const getPulumiAccessToken: () => Promise<string | null>;
54
56
  declare const getProjectRoot: () => string;
55
57
  declare const printEnv: () => Promise<void>;
56
58
  declare const run: () => Promise<void>;
57
59
 
58
- export { askQuestion, getBigtableInstanceName, getBigtableProjectId, getBigtableTableName, getConfluenceApiBaseUrl, getConfluenceApiToken, getConfluenceDefaultSpaceId, getConfluenceUserEmail, getCustomSearchApiKey, getCustomSearchEngineId, getEnvVar, getFirestoreProjectId, getGcpProjectId, getGeminiApiKey, getJiraApiBaseUrl, getJiraApiToken, getJiraUserEmail, getLogToConsole, getNpmToken, getPostgresAuthType, getPostgresDatabase, getPostgresHostName, getPostgresInstanceConnectionName, getPostgresIpType, getPostgresPassword, getPostgresPoolSizeMax, getPostgresUser, getProjectRoot, obfuscateCred, printEnv, run, setBigtableInstanceName, setBigtableProjectId, setBigtableTableName, setConfluenceApiBaseUrl, setConfluenceApiToken, setConfluenceDefaultSpaceId, setConfluenceUserEmail, setCustomSearchApiKey, setCustomSearchEngineId, setEnvVar, setFirestoreProjectId, setGeminiApiKey, setJiraApiBaseUrl, setJiraApiToken, setJiraUserEmail, setLogToConsole, setNpmToken, setPostgresAuthType, setPostgresDatabase, setPostgresHostName, setPostgresInstanceConnectionName, setPostgresIpType, setPostgresPassword, setPostgresPoolSizeMax, setPostgresUser };
60
+ export { askQuestion, getBigtableInstanceName, getBigtableProjectId, getBigtableTableName, getConfluenceApiBaseUrl, getConfluenceApiToken, getConfluenceDefaultSpaceId, getConfluenceUserEmail, getCustomSearchApiKey, getCustomSearchEngineId, getEnvVar, getFirestoreProjectId, getGcpProjectId, getGeminiApiKey, getJiraApiBaseUrl, getJiraApiToken, getJiraUserEmail, getLogToConsole, getNpmToken, getPostgresAuthType, getPostgresDatabase, getPostgresHostName, getPostgresInstanceConnectionName, getPostgresIpType, getPostgresPassword, getPostgresPoolSizeMax, getPostgresUser, getProjectRoot, getPulumiAccessToken, obfuscateCred, printEnv, run, setBigtableInstanceName, setBigtableProjectId, setBigtableTableName, setConfluenceApiBaseUrl, setConfluenceApiToken, setConfluenceDefaultSpaceId, setConfluenceUserEmail, setCustomSearchApiKey, setCustomSearchEngineId, setEnvVar, setFirestoreProjectId, setGeminiApiKey, setJiraApiBaseUrl, setJiraApiToken, setJiraUserEmail, setLogToConsole, setNpmToken, setPostgresAuthType, setPostgresDatabase, setPostgresHostName, setPostgresInstanceConnectionName, setPostgresIpType, setPostgresPassword, setPostgresPoolSizeMax, setPostgresUser, setPulumiAccessToken };
package/dist/index.js CHANGED
@@ -303,6 +303,10 @@ var setNpmToken = async () => {
303
303
  const npmToken = await askQuestion("Enter NPM Token:");
304
304
  if (npmToken) await setEnvVar("NPM_TOKEN", npmToken);
305
305
  };
306
+ var setPulumiAccessToken = async () => {
307
+ const pulumiToken = await askQuestion("Enter Pulumi Access Token (from https://app.pulumi.com/account/tokens):");
308
+ if (pulumiToken) await setEnvVar("PULUMI_ACCESS_TOKEN", pulumiToken);
309
+ };
306
310
  var setCustomSearchApiKey = async () => {
307
311
  const customSearchApiKey = await askQuestion("Enter Custom Search API Key", "");
308
312
  if (customSearchApiKey) {
@@ -347,6 +351,7 @@ var getConfluenceUserEmail = async () => await getEnvVar("CONFLUENCE_USER_EMAIL"
347
351
  var getConfluenceDefaultSpaceId = async () => await getEnvVar("CONFLUENCE_DEFAULT_SPACE_ID");
348
352
  var getGeminiApiKey = async () => await getEnvVar("GEMINI_API_KEY");
349
353
  var getNpmToken = async () => await getEnvVar("NPM_TOKEN");
354
+ var getPulumiAccessToken = async () => await getEnvVar("PULUMI_ACCESS_TOKEN");
350
355
  var getProjectRoot = () => {
351
356
  const currentDir = path.dirname(new URL(import.meta.url).pathname);
352
357
  return path.resolve(currentDir, "../..");
@@ -377,6 +382,7 @@ var printEnv = async () => {
377
382
  const customSearchEngineId = await getCustomSearchEngineId();
378
383
  const gcpProjectIdVal = await getGcpProjectId();
379
384
  const npmToken = await getNpmToken();
385
+ const pulumiAccessToken = await getPulumiAccessToken();
380
386
  console.log(`Project Root: ${getProjectRoot()}`);
381
387
  console.log(`GCP Project ID: ${gcpProjectIdVal}`);
382
388
  console.log(`Log to Console: ${logToConsole}`);
@@ -403,6 +409,7 @@ var printEnv = async () => {
403
409
  console.log(`Custom Search Engine ID: ${customSearchEngineId}`);
404
410
  console.log(`Gemini API Key: ${obfuscateCred(geminiApiKey)}`);
405
411
  console.log(`NPM Token: ${obfuscateCred(npmToken)}`);
412
+ console.log(`Pulumi Access Token: ${obfuscateCred(pulumiAccessToken)}`);
406
413
  };
407
414
  var run = async () => {
408
415
  const command = process.argv[2];
@@ -473,6 +480,9 @@ var run = async () => {
473
480
  case "setNpmToken":
474
481
  await setNpmToken();
475
482
  break;
483
+ case "setPulumiAccessToken":
484
+ await setPulumiAccessToken();
485
+ break;
476
486
  case "setCustomSearchApiKey":
477
487
  await setCustomSearchApiKey();
478
488
  break;
@@ -523,6 +533,7 @@ export {
523
533
  getPostgresPoolSizeMax,
524
534
  getPostgresUser,
525
535
  getProjectRoot,
536
+ getPulumiAccessToken,
526
537
  obfuscateCred,
527
538
  printEnv,
528
539
  run,
@@ -550,5 +561,6 @@ export {
550
561
  setPostgresIpType,
551
562
  setPostgresPassword,
552
563
  setPostgresPoolSizeMax,
553
- setPostgresUser
564
+ setPostgresUser,
565
+ setPulumiAccessToken
554
566
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataformer/env-service",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Environment service for Dataformer",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -412,6 +412,11 @@ const setNpmToken = async (): Promise<void> => {
412
412
  if (npmToken) await setEnvVar('NPM_TOKEN', npmToken);
413
413
  };
414
414
 
415
+ const setPulumiAccessToken = async (): Promise<void> => {
416
+ const pulumiToken = await askQuestion('Enter Pulumi Access Token (from https://app.pulumi.com/account/tokens):');
417
+ if (pulumiToken) await setEnvVar('PULUMI_ACCESS_TOKEN', pulumiToken);
418
+ };
419
+
415
420
  const setCustomSearchApiKey = async (): Promise<void> => {
416
421
  const customSearchApiKey = await askQuestion('Enter Custom Search API Key', '');
417
422
  if (customSearchApiKey) {
@@ -462,6 +467,7 @@ const getConfluenceUserEmail = async (): Promise<string | null> => await getEnvV
462
467
  const getConfluenceDefaultSpaceId = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_DEFAULT_SPACE_ID');
463
468
  const getGeminiApiKey = async (): Promise<string | null> => await getEnvVar('GEMINI_API_KEY');
464
469
  const getNpmToken = async (): Promise<string | null> => await getEnvVar('NPM_TOKEN');
470
+ const getPulumiAccessToken = async (): Promise<string | null> => await getEnvVar('PULUMI_ACCESS_TOKEN');
465
471
 
466
472
  const getProjectRoot = (): string => {
467
473
  // When compiled, this will be in dist/services/, so we need to go up two levels
@@ -505,6 +511,7 @@ const printEnv = async (): Promise<void> => {
505
511
  const customSearchEngineId = await getCustomSearchEngineId();
506
512
  const gcpProjectIdVal = await getGcpProjectId();
507
513
  const npmToken = await getNpmToken();
514
+ const pulumiAccessToken = await getPulumiAccessToken();
508
515
 
509
516
  console.log(`Project Root: ${getProjectRoot()}`);
510
517
  console.log(`GCP Project ID: ${gcpProjectIdVal}`);
@@ -532,6 +539,7 @@ const printEnv = async (): Promise<void> => {
532
539
  console.log(`Custom Search Engine ID: ${customSearchEngineId}`);
533
540
  console.log(`Gemini API Key: ${obfuscateCred(geminiApiKey)}`);
534
541
  console.log(`NPM Token: ${obfuscateCred(npmToken)}`);
542
+ console.log(`Pulumi Access Token: ${obfuscateCred(pulumiAccessToken)}`);
535
543
  };
536
544
 
537
545
  const run = async (): Promise<void> => {
@@ -559,6 +567,7 @@ const run = async (): Promise<void> => {
559
567
  case 'setConfluenceDefaultSpaceId': await setConfluenceDefaultSpaceId(); break;
560
568
  case 'setGeminiApiKey': await setGeminiApiKey(); break;
561
569
  case 'setNpmToken': await setNpmToken(); break;
570
+ case 'setPulumiAccessToken': await setPulumiAccessToken(); break;
562
571
  case 'setCustomSearchApiKey': await setCustomSearchApiKey(); break;
563
572
  case 'setCustomSearchEngineId': await setCustomSearchEngineId(); break;
564
573
  case 'printEnv': await printEnv(); break;
@@ -605,6 +614,7 @@ export {
605
614
  setConfluenceDefaultSpaceId,
606
615
  setGeminiApiKey,
607
616
  setNpmToken,
617
+ setPulumiAccessToken,
608
618
  setCustomSearchApiKey,
609
619
  setCustomSearchEngineId,
610
620
 
@@ -630,6 +640,7 @@ export {
630
640
  getConfluenceDefaultSpaceId,
631
641
  getGeminiApiKey,
632
642
  getNpmToken,
643
+ getPulumiAccessToken,
633
644
 
634
645
  // Synchronous Getters / Utility
635
646
  getProjectRoot,