@dataformer/env-service 3.0.0 → 3.0.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 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,6 +20,10 @@ 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>;
25
29
  declare const setCustomSearchApiKey: () => Promise<void>;
@@ -41,10 +45,14 @@ declare const getFirestoreProjectId: () => Promise<string | null>;
41
45
  declare const getJiraApiToken: () => Promise<string | null>;
42
46
  declare const getJiraApiBaseUrl: () => Promise<string | null>;
43
47
  declare const getJiraUserEmail: () => Promise<string | null>;
48
+ declare const getConfluenceApiToken: () => Promise<string | null>;
49
+ declare const getConfluenceApiBaseUrl: () => Promise<string | null>;
50
+ declare const getConfluenceUserEmail: () => Promise<string | null>;
51
+ declare const getConfluenceDefaultSpaceId: () => Promise<string | null>;
44
52
  declare const getGeminiApiKey: () => Promise<string | null>;
45
53
  declare const getNpmToken: () => Promise<string | null>;
46
54
  declare const getProjectRoot: () => string;
47
55
  declare const printEnv: () => Promise<void>;
48
56
  declare const run: () => Promise<void>;
49
57
 
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 };
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 };
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);
@@ -317,6 +341,10 @@ var getFirestoreProjectId = _getFirestoreProjectId;
317
341
  var getJiraApiToken = async () => await getEnvVar("JIRA_API_TOKEN");
318
342
  var getJiraApiBaseUrl = async () => await getEnvVar("JIRA_API_BASE_URL");
319
343
  var getJiraUserEmail = async () => await getEnvVar("JIRA_USER_EMAIL");
344
+ var getConfluenceApiToken = async () => await getEnvVar("CONFLUENCE_API_TOKEN");
345
+ var getConfluenceApiBaseUrl = async () => await getEnvVar("CONFLUENCE_API_BASE_URL");
346
+ var getConfluenceUserEmail = async () => await getEnvVar("CONFLUENCE_USER_EMAIL");
347
+ var getConfluenceDefaultSpaceId = async () => await getEnvVar("CONFLUENCE_DEFAULT_SPACE_ID");
320
348
  var getGeminiApiKey = async () => await getEnvVar("GEMINI_API_KEY");
321
349
  var getNpmToken = async () => await getEnvVar("NPM_TOKEN");
322
350
  var getProjectRoot = () => {
@@ -340,6 +368,10 @@ var printEnv = async () => {
340
368
  const jiraApiToken = await getJiraApiToken();
341
369
  const jiraApiBaseUrl = await getJiraApiBaseUrl();
342
370
  const jiraUserEmail = await getJiraUserEmail();
371
+ const confluenceApiToken = await getConfluenceApiToken();
372
+ const confluenceApiBaseUrl = await getConfluenceApiBaseUrl();
373
+ const confluenceUserEmail = await getConfluenceUserEmail();
374
+ const confluenceDefaultSpaceId = await getConfluenceDefaultSpaceId();
343
375
  const geminiApiKey = await getGeminiApiKey();
344
376
  const customSearchApiKey = await getCustomSearchApiKey();
345
377
  const customSearchEngineId = await getCustomSearchEngineId();
@@ -363,6 +395,10 @@ var printEnv = async () => {
363
395
  console.log(`Jira API Token: ${obfuscateCred(jiraApiToken)}`);
364
396
  console.log(`Jira API Base URL: ${jiraApiBaseUrl}`);
365
397
  console.log(`Jira User Email: ${jiraUserEmail}`);
398
+ console.log(`Confluence API Token: ${obfuscateCred(confluenceApiToken)}`);
399
+ console.log(`Confluence API Base URL: ${confluenceApiBaseUrl}`);
400
+ console.log(`Confluence User Email: ${confluenceUserEmail}`);
401
+ console.log(`Confluence Default Space ID: ${confluenceDefaultSpaceId}`);
366
402
  console.log(`Custom Search API Key: ${obfuscateCred(customSearchApiKey)}`);
367
403
  console.log(`Custom Search Engine ID: ${customSearchEngineId}`);
368
404
  console.log(`Gemini API Key: ${obfuscateCred(geminiApiKey)}`);
@@ -419,6 +455,18 @@ var run = async () => {
419
455
  case "setJiraUserEmail":
420
456
  await setJiraUserEmail();
421
457
  break;
458
+ case "setConfluenceApiToken":
459
+ await setConfluenceApiToken();
460
+ break;
461
+ case "setConfluenceApiBaseUrl":
462
+ await setConfluenceApiBaseUrl();
463
+ break;
464
+ case "setConfluenceUserEmail":
465
+ await setConfluenceUserEmail();
466
+ break;
467
+ case "setConfluenceDefaultSpaceId":
468
+ await setConfluenceDefaultSpaceId();
469
+ break;
422
470
  case "setGeminiApiKey":
423
471
  await setGeminiApiKey();
424
472
  break;
@@ -451,6 +499,10 @@ export {
451
499
  getBigtableInstanceName,
452
500
  getBigtableProjectId,
453
501
  getBigtableTableName,
502
+ getConfluenceApiBaseUrl,
503
+ getConfluenceApiToken,
504
+ getConfluenceDefaultSpaceId,
505
+ getConfluenceUserEmail,
454
506
  getCustomSearchApiKey,
455
507
  getCustomSearchEngineId,
456
508
  getEnvVar,
@@ -477,6 +529,10 @@ export {
477
529
  setBigtableInstanceName,
478
530
  setBigtableProjectId,
479
531
  setBigtableTableName,
532
+ setConfluenceApiBaseUrl,
533
+ setConfluenceApiToken,
534
+ setConfluenceDefaultSpaceId,
535
+ setConfluenceUserEmail,
480
536
  setCustomSearchApiKey,
481
537
  setCustomSearchEngineId,
482
538
  setEnvVar,
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.1",
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);
@@ -428,6 +456,10 @@ export const getFirestoreProjectId = _getFirestoreProjectId;
428
456
  const getJiraApiToken = async (): Promise<string | null> => await getEnvVar('JIRA_API_TOKEN');
429
457
  const getJiraApiBaseUrl = async (): Promise<string | null> => await getEnvVar('JIRA_API_BASE_URL');
430
458
  const getJiraUserEmail = async (): Promise<string | null> => await getEnvVar('JIRA_USER_EMAIL');
459
+ const getConfluenceApiToken = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_API_TOKEN');
460
+ const getConfluenceApiBaseUrl = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_API_BASE_URL');
461
+ const getConfluenceUserEmail = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_USER_EMAIL');
462
+ const getConfluenceDefaultSpaceId = async (): Promise<string | null> => await getEnvVar('CONFLUENCE_DEFAULT_SPACE_ID');
431
463
  const getGeminiApiKey = async (): Promise<string | null> => await getEnvVar('GEMINI_API_KEY');
432
464
  const getNpmToken = async (): Promise<string | null> => await getEnvVar('NPM_TOKEN');
433
465
 
@@ -464,6 +496,10 @@ const printEnv = async (): Promise<void> => {
464
496
  const jiraApiToken = await getJiraApiToken();
465
497
  const jiraApiBaseUrl = await getJiraApiBaseUrl();
466
498
  const jiraUserEmail = await getJiraUserEmail();
499
+ const confluenceApiToken = await getConfluenceApiToken();
500
+ const confluenceApiBaseUrl = await getConfluenceApiBaseUrl();
501
+ const confluenceUserEmail = await getConfluenceUserEmail();
502
+ const confluenceDefaultSpaceId = await getConfluenceDefaultSpaceId();
467
503
  const geminiApiKey = await getGeminiApiKey();
468
504
  const customSearchApiKey = await getCustomSearchApiKey();
469
505
  const customSearchEngineId = await getCustomSearchEngineId();
@@ -488,6 +524,10 @@ const printEnv = async (): Promise<void> => {
488
524
  console.log(`Jira API Token: ${obfuscateCred(jiraApiToken)}`);
489
525
  console.log(`Jira API Base URL: ${jiraApiBaseUrl}`);
490
526
  console.log(`Jira User Email: ${jiraUserEmail}`);
527
+ console.log(`Confluence API Token: ${obfuscateCred(confluenceApiToken)}`);
528
+ console.log(`Confluence API Base URL: ${confluenceApiBaseUrl}`);
529
+ console.log(`Confluence User Email: ${confluenceUserEmail}`);
530
+ console.log(`Confluence Default Space ID: ${confluenceDefaultSpaceId}`);
491
531
  console.log(`Custom Search API Key: ${obfuscateCred(customSearchApiKey)}`);
492
532
  console.log(`Custom Search Engine ID: ${customSearchEngineId}`);
493
533
  console.log(`Gemini API Key: ${obfuscateCred(geminiApiKey)}`);
@@ -513,6 +553,10 @@ const run = async (): Promise<void> => {
513
553
  case 'setJiraApiToken': await setJiraApiToken(); break;
514
554
  case 'setJiraApiBaseUrl': await setJiraApiBaseUrl(); break;
515
555
  case 'setJiraUserEmail': await setJiraUserEmail(); break;
556
+ case 'setConfluenceApiToken': await setConfluenceApiToken(); break;
557
+ case 'setConfluenceApiBaseUrl': await setConfluenceApiBaseUrl(); break;
558
+ case 'setConfluenceUserEmail': await setConfluenceUserEmail(); break;
559
+ case 'setConfluenceDefaultSpaceId': await setConfluenceDefaultSpaceId(); break;
516
560
  case 'setGeminiApiKey': await setGeminiApiKey(); break;
517
561
  case 'setNpmToken': await setNpmToken(); break;
518
562
  case 'setCustomSearchApiKey': await setCustomSearchApiKey(); break;
@@ -555,6 +599,10 @@ export {
555
599
  setJiraApiToken,
556
600
  setJiraApiBaseUrl,
557
601
  setJiraUserEmail,
602
+ setConfluenceApiToken,
603
+ setConfluenceApiBaseUrl,
604
+ setConfluenceUserEmail,
605
+ setConfluenceDefaultSpaceId,
558
606
  setGeminiApiKey,
559
607
  setNpmToken,
560
608
  setCustomSearchApiKey,
@@ -576,6 +624,10 @@ export {
576
624
  getJiraApiToken,
577
625
  getJiraApiBaseUrl,
578
626
  getJiraUserEmail,
627
+ getConfluenceApiToken,
628
+ getConfluenceApiBaseUrl,
629
+ getConfluenceUserEmail,
630
+ getConfluenceDefaultSpaceId,
579
631
  getGeminiApiKey,
580
632
  getNpmToken,
581
633