@dataformer/env-service 3.0.0 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @dataformer/env-service
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Add @dataformer/confluence-client - Confluence REST API v2 client
8
+
9
+ New package with:
10
+
11
+ - Page CRUD operations (create, read, update, delete)
12
+ - Space listing and discovery methods
13
+ - Default space configuration support
14
+ - Atlas Document Format (ADF) body format support
15
+ - Cursor-based pagination for listing operations
16
+
17
+ Also updates @dataformer/env-service with Confluence configuration methods:
18
+
19
+ - setConfluenceApiToken
20
+ - setConfluenceApiBaseUrl
21
+ - setConfluenceUserEmail
22
+ - setConfluenceDefaultSpaceId
23
+
3
24
  ## 3.0.0
4
25
 
5
26
  ### Major Changes
package/dist/index.d.ts CHANGED
@@ -20,8 +20,13 @@ declare const setBigtableProjectId: () => Promise<void>;
20
20
  declare const setJiraApiToken: () => Promise<void>;
21
21
  declare const setJiraApiBaseUrl: () => Promise<void>;
22
22
  declare const setJiraUserEmail: () => Promise<void>;
23
+ declare const setConfluenceApiToken: () => Promise<void>;
24
+ declare const setConfluenceApiBaseUrl: () => Promise<void>;
25
+ declare const setConfluenceUserEmail: () => Promise<void>;
26
+ declare const setConfluenceDefaultSpaceId: () => Promise<void>;
23
27
  declare const setGeminiApiKey: () => Promise<void>;
24
28
  declare const setNpmToken: () => Promise<void>;
29
+ declare const setPulumiAccessToken: () => Promise<void>;
25
30
  declare const setCustomSearchApiKey: () => Promise<void>;
26
31
  declare const setCustomSearchEngineId: () => Promise<void>;
27
32
  declare const setFirestoreProjectId: () => Promise<void>;
@@ -41,10 +46,15 @@ declare const getFirestoreProjectId: () => Promise<string | null>;
41
46
  declare const getJiraApiToken: () => Promise<string | null>;
42
47
  declare const getJiraApiBaseUrl: () => Promise<string | null>;
43
48
  declare const getJiraUserEmail: () => Promise<string | null>;
49
+ declare const getConfluenceApiToken: () => Promise<string | null>;
50
+ declare const getConfluenceApiBaseUrl: () => Promise<string | null>;
51
+ declare const getConfluenceUserEmail: () => Promise<string | null>;
52
+ declare const getConfluenceDefaultSpaceId: () => Promise<string | null>;
44
53
  declare const getGeminiApiKey: () => Promise<string | null>;
45
54
  declare const getNpmToken: () => Promise<string | null>;
55
+ declare const getPulumiAccessToken: () => Promise<string | null>;
46
56
  declare const getProjectRoot: () => string;
47
57
  declare const printEnv: () => Promise<void>;
48
58
  declare const run: () => Promise<void>;
49
59
 
50
- export { askQuestion, getBigtableInstanceName, getBigtableProjectId, getBigtableTableName, 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, 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
@@ -271,6 +271,30 @@ var setJiraUserEmail = async () => {
271
271
  await setEnvVar("JIRA_USER_EMAIL", jiraUserEmail);
272
272
  }
273
273
  };
274
+ var setConfluenceApiToken = async () => {
275
+ const confluenceApiToken = await askQuestion("Enter Confluence API token", "");
276
+ if (confluenceApiToken) {
277
+ await setEnvVar("CONFLUENCE_API_TOKEN", confluenceApiToken);
278
+ }
279
+ };
280
+ var setConfluenceApiBaseUrl = async () => {
281
+ const confluenceApiBaseUrl = await askQuestion("Enter Confluence API Base URL (e.g., https://yoursite.atlassian.net)", "");
282
+ if (confluenceApiBaseUrl) {
283
+ await setEnvVar("CONFLUENCE_API_BASE_URL", confluenceApiBaseUrl);
284
+ }
285
+ };
286
+ var setConfluenceUserEmail = async () => {
287
+ const confluenceUserEmail = await askQuestion("Enter Confluence user email", "you@domain.com");
288
+ if (confluenceUserEmail) {
289
+ await setEnvVar("CONFLUENCE_USER_EMAIL", confluenceUserEmail);
290
+ }
291
+ };
292
+ var setConfluenceDefaultSpaceId = async () => {
293
+ const confluenceDefaultSpaceId = await askQuestion("Enter Confluence default Space ID (numeric ID from space URL)", "");
294
+ if (confluenceDefaultSpaceId) {
295
+ await setEnvVar("CONFLUENCE_DEFAULT_SPACE_ID", confluenceDefaultSpaceId);
296
+ }
297
+ };
274
298
  var setGeminiApiKey = async () => {
275
299
  const apiKey = await askQuestion("Enter Gemini API key:");
276
300
  if (apiKey) await setEnvVar("GEMINI_API_KEY", apiKey);
@@ -279,6 +303,10 @@ var setNpmToken = async () => {
279
303
  const npmToken = await askQuestion("Enter NPM Token:");
280
304
  if (npmToken) await setEnvVar("NPM_TOKEN", npmToken);
281
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
+ };
282
310
  var setCustomSearchApiKey = async () => {
283
311
  const customSearchApiKey = await askQuestion("Enter Custom Search API Key", "");
284
312
  if (customSearchApiKey) {
@@ -317,8 +345,13 @@ var getFirestoreProjectId = _getFirestoreProjectId;
317
345
  var getJiraApiToken = async () => await getEnvVar("JIRA_API_TOKEN");
318
346
  var getJiraApiBaseUrl = async () => await getEnvVar("JIRA_API_BASE_URL");
319
347
  var getJiraUserEmail = async () => await getEnvVar("JIRA_USER_EMAIL");
348
+ var getConfluenceApiToken = async () => await getEnvVar("CONFLUENCE_API_TOKEN");
349
+ var getConfluenceApiBaseUrl = async () => await getEnvVar("CONFLUENCE_API_BASE_URL");
350
+ var getConfluenceUserEmail = async () => await getEnvVar("CONFLUENCE_USER_EMAIL");
351
+ var getConfluenceDefaultSpaceId = async () => await getEnvVar("CONFLUENCE_DEFAULT_SPACE_ID");
320
352
  var getGeminiApiKey = async () => await getEnvVar("GEMINI_API_KEY");
321
353
  var getNpmToken = async () => await getEnvVar("NPM_TOKEN");
354
+ var getPulumiAccessToken = async () => await getEnvVar("PULUMI_ACCESS_TOKEN");
322
355
  var getProjectRoot = () => {
323
356
  const currentDir = path.dirname(new URL(import.meta.url).pathname);
324
357
  return path.resolve(currentDir, "../..");
@@ -340,11 +373,16 @@ var printEnv = async () => {
340
373
  const jiraApiToken = await getJiraApiToken();
341
374
  const jiraApiBaseUrl = await getJiraApiBaseUrl();
342
375
  const jiraUserEmail = await getJiraUserEmail();
376
+ const confluenceApiToken = await getConfluenceApiToken();
377
+ const confluenceApiBaseUrl = await getConfluenceApiBaseUrl();
378
+ const confluenceUserEmail = await getConfluenceUserEmail();
379
+ const confluenceDefaultSpaceId = await getConfluenceDefaultSpaceId();
343
380
  const geminiApiKey = await getGeminiApiKey();
344
381
  const customSearchApiKey = await getCustomSearchApiKey();
345
382
  const customSearchEngineId = await getCustomSearchEngineId();
346
383
  const gcpProjectIdVal = await getGcpProjectId();
347
384
  const npmToken = await getNpmToken();
385
+ const pulumiAccessToken = await getPulumiAccessToken();
348
386
  console.log(`Project Root: ${getProjectRoot()}`);
349
387
  console.log(`GCP Project ID: ${gcpProjectIdVal}`);
350
388
  console.log(`Log to Console: ${logToConsole}`);
@@ -363,10 +401,15 @@ var printEnv = async () => {
363
401
  console.log(`Jira API Token: ${obfuscateCred(jiraApiToken)}`);
364
402
  console.log(`Jira API Base URL: ${jiraApiBaseUrl}`);
365
403
  console.log(`Jira User Email: ${jiraUserEmail}`);
404
+ console.log(`Confluence API Token: ${obfuscateCred(confluenceApiToken)}`);
405
+ console.log(`Confluence API Base URL: ${confluenceApiBaseUrl}`);
406
+ console.log(`Confluence User Email: ${confluenceUserEmail}`);
407
+ console.log(`Confluence Default Space ID: ${confluenceDefaultSpaceId}`);
366
408
  console.log(`Custom Search API Key: ${obfuscateCred(customSearchApiKey)}`);
367
409
  console.log(`Custom Search Engine ID: ${customSearchEngineId}`);
368
410
  console.log(`Gemini API Key: ${obfuscateCred(geminiApiKey)}`);
369
411
  console.log(`NPM Token: ${obfuscateCred(npmToken)}`);
412
+ console.log(`Pulumi Access Token: ${obfuscateCred(pulumiAccessToken)}`);
370
413
  };
371
414
  var run = async () => {
372
415
  const command = process.argv[2];
@@ -419,12 +462,27 @@ var run = async () => {
419
462
  case "setJiraUserEmail":
420
463
  await setJiraUserEmail();
421
464
  break;
465
+ case "setConfluenceApiToken":
466
+ await setConfluenceApiToken();
467
+ break;
468
+ case "setConfluenceApiBaseUrl":
469
+ await setConfluenceApiBaseUrl();
470
+ break;
471
+ case "setConfluenceUserEmail":
472
+ await setConfluenceUserEmail();
473
+ break;
474
+ case "setConfluenceDefaultSpaceId":
475
+ await setConfluenceDefaultSpaceId();
476
+ break;
422
477
  case "setGeminiApiKey":
423
478
  await setGeminiApiKey();
424
479
  break;
425
480
  case "setNpmToken":
426
481
  await setNpmToken();
427
482
  break;
483
+ case "setPulumiAccessToken":
484
+ await setPulumiAccessToken();
485
+ break;
428
486
  case "setCustomSearchApiKey":
429
487
  await setCustomSearchApiKey();
430
488
  break;
@@ -451,6 +509,10 @@ export {
451
509
  getBigtableInstanceName,
452
510
  getBigtableProjectId,
453
511
  getBigtableTableName,
512
+ getConfluenceApiBaseUrl,
513
+ getConfluenceApiToken,
514
+ getConfluenceDefaultSpaceId,
515
+ getConfluenceUserEmail,
454
516
  getCustomSearchApiKey,
455
517
  getCustomSearchEngineId,
456
518
  getEnvVar,
@@ -471,12 +533,17 @@ export {
471
533
  getPostgresPoolSizeMax,
472
534
  getPostgresUser,
473
535
  getProjectRoot,
536
+ getPulumiAccessToken,
474
537
  obfuscateCred,
475
538
  printEnv,
476
539
  run,
477
540
  setBigtableInstanceName,
478
541
  setBigtableProjectId,
479
542
  setBigtableTableName,
543
+ setConfluenceApiBaseUrl,
544
+ setConfluenceApiToken,
545
+ setConfluenceDefaultSpaceId,
546
+ setConfluenceUserEmail,
480
547
  setCustomSearchApiKey,
481
548
  setCustomSearchEngineId,
482
549
  setEnvVar,
@@ -494,5 +561,6 @@ export {
494
561
  setPostgresIpType,
495
562
  setPostgresPassword,
496
563
  setPostgresPoolSizeMax,
497
- setPostgresUser
564
+ setPostgresUser,
565
+ setPulumiAccessToken
498
566
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataformer/env-service",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Environment service for Dataformer",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,6 +11,11 @@
11
11
  "types": "./dist/index.d.ts"
12
12
  }
13
13
  },
14
+ "scripts": {
15
+ "build": "tsup src/index.ts --format esm --dts --clean",
16
+ "dev": "tsup src/index.ts --format esm --dts --watch",
17
+ "prepublish": "pnpm run build"
18
+ },
14
19
  "dependencies": {
15
20
  "@google-cloud/secret-manager": "^5.4.0"
16
21
  },
@@ -20,10 +25,5 @@
20
25
  },
21
26
  "peerDependencies": {
22
27
  "typescript": "^5.0.0"
23
- },
24
- "scripts": {
25
- "build": "tsup src/index.ts --format esm --dts --clean",
26
- "dev": "tsup src/index.ts --format esm --dts --watch",
27
- "prepublish": "pnpm run build"
28
28
  }
29
- }
29
+ }
package/src/index.ts CHANGED
@@ -374,6 +374,34 @@ const setJiraUserEmail = async (): Promise<void> => {
374
374
  }
375
375
  };
376
376
 
377
+ const setConfluenceApiToken = async (): Promise<void> => {
378
+ const confluenceApiToken = await askQuestion('Enter Confluence API token', '');
379
+ if (confluenceApiToken) {
380
+ await setEnvVar('CONFLUENCE_API_TOKEN', confluenceApiToken);
381
+ }
382
+ };
383
+
384
+ const setConfluenceApiBaseUrl = async (): Promise<void> => {
385
+ const confluenceApiBaseUrl = await askQuestion('Enter Confluence API Base URL (e.g., https://yoursite.atlassian.net)', '');
386
+ if (confluenceApiBaseUrl) {
387
+ await setEnvVar('CONFLUENCE_API_BASE_URL', confluenceApiBaseUrl);
388
+ }
389
+ };
390
+
391
+ const setConfluenceUserEmail = async (): Promise<void> => {
392
+ const confluenceUserEmail = await askQuestion('Enter Confluence user email', 'you@domain.com');
393
+ if (confluenceUserEmail) {
394
+ await setEnvVar('CONFLUENCE_USER_EMAIL', confluenceUserEmail);
395
+ }
396
+ };
397
+
398
+ const setConfluenceDefaultSpaceId = async (): Promise<void> => {
399
+ const confluenceDefaultSpaceId = await askQuestion('Enter Confluence default Space ID (numeric ID from space URL)', '');
400
+ if (confluenceDefaultSpaceId) {
401
+ await setEnvVar('CONFLUENCE_DEFAULT_SPACE_ID', confluenceDefaultSpaceId);
402
+ }
403
+ };
404
+
377
405
  const setGeminiApiKey = async (): Promise<void> => {
378
406
  const apiKey = await askQuestion('Enter Gemini API key:');
379
407
  if (apiKey) await setEnvVar('GEMINI_API_KEY', apiKey);
@@ -384,6 +412,11 @@ const setNpmToken = async (): Promise<void> => {
384
412
  if (npmToken) await setEnvVar('NPM_TOKEN', npmToken);
385
413
  };
386
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
+
387
420
  const setCustomSearchApiKey = async (): Promise<void> => {
388
421
  const customSearchApiKey = await askQuestion('Enter Custom Search API Key', '');
389
422
  if (customSearchApiKey) {
@@ -428,8 +461,13 @@ export const getFirestoreProjectId = _getFirestoreProjectId;
428
461
  const getJiraApiToken = async (): Promise<string | null> => await getEnvVar('JIRA_API_TOKEN');
429
462
  const getJiraApiBaseUrl = async (): Promise<string | null> => await getEnvVar('JIRA_API_BASE_URL');
430
463
  const getJiraUserEmail = async (): Promise<string | null> => await getEnvVar('JIRA_USER_EMAIL');
464
+ const getConfluenceApiToken = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_API_TOKEN');
465
+ const getConfluenceApiBaseUrl = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_API_BASE_URL');
466
+ const getConfluenceUserEmail = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_USER_EMAIL');
467
+ const getConfluenceDefaultSpaceId = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_DEFAULT_SPACE_ID');
431
468
  const getGeminiApiKey = async (): Promise<string | null> => await getEnvVar('GEMINI_API_KEY');
432
469
  const getNpmToken = async (): Promise<string | null> => await getEnvVar('NPM_TOKEN');
470
+ const getPulumiAccessToken = async (): Promise<string | null> => await getEnvVar('PULUMI_ACCESS_TOKEN');
433
471
 
434
472
  const getProjectRoot = (): string => {
435
473
  // When compiled, this will be in dist/services/, so we need to go up two levels
@@ -464,11 +502,16 @@ const printEnv = async (): Promise<void> => {
464
502
  const jiraApiToken = await getJiraApiToken();
465
503
  const jiraApiBaseUrl = await getJiraApiBaseUrl();
466
504
  const jiraUserEmail = await getJiraUserEmail();
505
+ const confluenceApiToken = await getConfluenceApiToken();
506
+ const confluenceApiBaseUrl = await getConfluenceApiBaseUrl();
507
+ const confluenceUserEmail = await getConfluenceUserEmail();
508
+ const confluenceDefaultSpaceId = await getConfluenceDefaultSpaceId();
467
509
  const geminiApiKey = await getGeminiApiKey();
468
510
  const customSearchApiKey = await getCustomSearchApiKey();
469
511
  const customSearchEngineId = await getCustomSearchEngineId();
470
512
  const gcpProjectIdVal = await getGcpProjectId();
471
513
  const npmToken = await getNpmToken();
514
+ const pulumiAccessToken = await getPulumiAccessToken();
472
515
 
473
516
  console.log(`Project Root: ${getProjectRoot()}`);
474
517
  console.log(`GCP Project ID: ${gcpProjectIdVal}`);
@@ -488,10 +531,15 @@ const printEnv = async (): Promise<void> => {
488
531
  console.log(`Jira API Token: ${obfuscateCred(jiraApiToken)}`);
489
532
  console.log(`Jira API Base URL: ${jiraApiBaseUrl}`);
490
533
  console.log(`Jira User Email: ${jiraUserEmail}`);
534
+ console.log(`Confluence API Token: ${obfuscateCred(confluenceApiToken)}`);
535
+ console.log(`Confluence API Base URL: ${confluenceApiBaseUrl}`);
536
+ console.log(`Confluence User Email: ${confluenceUserEmail}`);
537
+ console.log(`Confluence Default Space ID: ${confluenceDefaultSpaceId}`);
491
538
  console.log(`Custom Search API Key: ${obfuscateCred(customSearchApiKey)}`);
492
539
  console.log(`Custom Search Engine ID: ${customSearchEngineId}`);
493
540
  console.log(`Gemini API Key: ${obfuscateCred(geminiApiKey)}`);
494
541
  console.log(`NPM Token: ${obfuscateCred(npmToken)}`);
542
+ console.log(`Pulumi Access Token: ${obfuscateCred(pulumiAccessToken)}`);
495
543
  };
496
544
 
497
545
  const run = async (): Promise<void> => {
@@ -513,8 +561,13 @@ const run = async (): Promise<void> => {
513
561
  case 'setJiraApiToken': await setJiraApiToken(); break;
514
562
  case 'setJiraApiBaseUrl': await setJiraApiBaseUrl(); break;
515
563
  case 'setJiraUserEmail': await setJiraUserEmail(); break;
564
+ case 'setConfluenceApiToken': await setConfluenceApiToken(); break;
565
+ case 'setConfluenceApiBaseUrl': await setConfluenceApiBaseUrl(); break;
566
+ case 'setConfluenceUserEmail': await setConfluenceUserEmail(); break;
567
+ case 'setConfluenceDefaultSpaceId': await setConfluenceDefaultSpaceId(); break;
516
568
  case 'setGeminiApiKey': await setGeminiApiKey(); break;
517
569
  case 'setNpmToken': await setNpmToken(); break;
570
+ case 'setPulumiAccessToken': await setPulumiAccessToken(); break;
518
571
  case 'setCustomSearchApiKey': await setCustomSearchApiKey(); break;
519
572
  case 'setCustomSearchEngineId': await setCustomSearchEngineId(); break;
520
573
  case 'printEnv': await printEnv(); break;
@@ -555,8 +608,13 @@ export {
555
608
  setJiraApiToken,
556
609
  setJiraApiBaseUrl,
557
610
  setJiraUserEmail,
611
+ setConfluenceApiToken,
612
+ setConfluenceApiBaseUrl,
613
+ setConfluenceUserEmail,
614
+ setConfluenceDefaultSpaceId,
558
615
  setGeminiApiKey,
559
616
  setNpmToken,
617
+ setPulumiAccessToken,
560
618
  setCustomSearchApiKey,
561
619
  setCustomSearchEngineId,
562
620
 
@@ -576,8 +634,13 @@ export {
576
634
  getJiraApiToken,
577
635
  getJiraApiBaseUrl,
578
636
  getJiraUserEmail,
637
+ getConfluenceApiToken,
638
+ getConfluenceApiBaseUrl,
639
+ getConfluenceUserEmail,
640
+ getConfluenceDefaultSpaceId,
579
641
  getGeminiApiKey,
580
642
  getNpmToken,
643
+ getPulumiAccessToken,
581
644
 
582
645
  // Synchronous Getters / Utility
583
646
  getProjectRoot,