@docupace/pipeline 1.0.77 → 1.0.79

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.
Files changed (69) hide show
  1. package/.prettierrc.cjs +12 -12
  2. package/README.md +135 -135
  3. package/bin/azuread_update_callbacks_for_app.sh +58 -58
  4. package/bin/next-changeset-validate.sh +8 -8
  5. package/bitbucket-pipelines.yml +59 -59
  6. package/eslint.config.js +49 -49
  7. package/jest.config.js +15 -15
  8. package/next/changeset.sh +75 -75
  9. package/next/copy.sh +34 -34
  10. package/next/deploy.sh +40 -40
  11. package/next/execute.sh +123 -123
  12. package/next/sonar.sh +23 -23
  13. package/package.json +1 -1
  14. package/src/auth0/alias.js +79 -79
  15. package/src/auth0/alias.test.js +172 -172
  16. package/src/auth0/cli.js +82 -82
  17. package/src/auth0/configure.js +902 -902
  18. package/src/auth0/configure.test.js +167 -167
  19. package/src/auth0/export.js +48 -48
  20. package/src/auth0/export.test.js +103 -103
  21. package/src/auth0/metadata.js +141 -141
  22. package/src/auth0/metadata.test.js +186 -186
  23. package/src/auth0/vault.js +60 -60
  24. package/src/auth0/vault.test.js +134 -134
  25. package/src/changeset/changelog-wiki.js +328 -328
  26. package/src/changeset/changeset-config.js +34 -34
  27. package/src/changeset/cli.js +237 -237
  28. package/src/changeset/create.js +215 -215
  29. package/src/changeset/package-util.js +87 -87
  30. package/src/changeset/util.js +43 -43
  31. package/src/changeset/validate.js +91 -91
  32. package/src/changeset/version.js +102 -102
  33. package/src/jenkins/setParams.groovy +58 -58
  34. package/src/lib/merge-driver.js +204 -204
  35. package/src/merge/cli-merge-all.js +507 -507
  36. package/src/merge/cli-merge.js +492 -492
  37. package/src/merge/cli-resolve.js +399 -399
  38. package/src/merge/cli.js +38 -38
  39. package/src/merge/merge-changelog.js +87 -87
  40. package/src/merge/merge-package.js +106 -106
  41. package/src/merge/merge-types.js +82 -82
  42. package/src/merge/pr.js +231 -231
  43. package/src/micro/deploy-microservice.js +153 -0
  44. package/src/micro/{ms-publish.js → publish-ms.js} +8 -6
  45. package/src/next/alias.js +53 -53
  46. package/src/next/apache.js +81 -81
  47. package/src/next/cli.js +10 -1
  48. package/src/next/config.js +137 -137
  49. package/src/next/connect.js +226 -226
  50. package/src/next/copy.js +61 -61
  51. package/src/next/deploy.js +666 -633
  52. package/src/next/git-to-semver.js +79 -79
  53. package/src/next/haproxy.js +76 -76
  54. package/src/next/jenkins.js +123 -123
  55. package/src/next/jira.js +84 -84
  56. package/src/next/logger.js +17 -17
  57. package/src/next/pipline.js +114 -114
  58. package/src/next/publish.js +71 -71
  59. package/src/next/pull.js +7 -7
  60. package/src/next/sonar.js +23 -23
  61. package/src/next/test.js +5 -5
  62. package/src/next/util.js +95 -93
  63. package/src/next/vault.js +45 -45
  64. package/terraform/apply.sh +37 -37
  65. package/terraform/init.sh +72 -72
  66. package/terraform/plan.sh +76 -76
  67. package/terraform/validate.sh +17 -17
  68. package/src/micro/cli.js +0 -71
  69. package/src/micro/ms-deploy.js +0 -271
@@ -1,60 +1,60 @@
1
- // src/auth0/vault.js
2
- import axios from 'axios';
3
-
4
- export async function getVaultSecrets(vaultPath) {
5
- if (!vaultPath) throw new Error('VAULT_PATH is required.');
6
-
7
- const token = process.env.VAULT_TOKEN;
8
- const addr = process.env.VAULT_ADDR;
9
- if (!token || !addr)
10
- throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
11
-
12
- if (process.env.VAULT_SKIP_VERIFY === 'true') {
13
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
14
- }
15
-
16
- try {
17
- const response = await axios.get(`${addr}/v1/${vaultPath}`, {
18
- headers: { 'X-Vault-Token': token },
19
- });
20
-
21
- const data = response.data;
22
- if (data && typeof data === 'object') return data.data.data;
23
- throw new Error('Invalid JSON received from Vault.');
24
- } catch (err) {
25
- console.error(
26
- 'Vault GET error:',
27
- err?.message || err?.response?.statusText || err,
28
- );
29
- }
30
- }
31
-
32
- export async function updateVaultSecrets(vaultPath, secretData) {
33
- if (!vaultPath || !secretData)
34
- throw new Error('Both vaultPath and secretData are required.');
35
-
36
- const token = process.env.VAULT_TOKEN;
37
- const addr = process.env.VAULT_ADDR;
38
- if (!token || !addr)
39
- throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
40
-
41
- if (process.env.VAULT_SKIP_VERIFY === 'true') {
42
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
43
- }
44
-
45
- try {
46
- const response = await axios.post(`${addr}/v1/${vaultPath}`, secretData, {
47
- headers: {
48
- 'X-Vault-Token': token,
49
- 'Content-Type': 'application/json',
50
- },
51
- });
52
-
53
- return response.data;
54
- } catch (err) {
55
- console.error(
56
- 'Vault POST error:',
57
- err?.message || err?.response?.statusText || err,
58
- );
59
- }
60
- }
1
+ // src/auth0/vault.js
2
+ import axios from 'axios';
3
+
4
+ export async function getVaultSecrets(vaultPath) {
5
+ if (!vaultPath) throw new Error('VAULT_PATH is required.');
6
+
7
+ const token = process.env.VAULT_TOKEN;
8
+ const addr = process.env.VAULT_ADDR;
9
+ if (!token || !addr)
10
+ throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
11
+
12
+ if (process.env.VAULT_SKIP_VERIFY === 'true') {
13
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
14
+ }
15
+
16
+ try {
17
+ const response = await axios.get(`${addr}/v1/${vaultPath}`, {
18
+ headers: { 'X-Vault-Token': token },
19
+ });
20
+
21
+ const data = response.data;
22
+ if (data && typeof data === 'object') return data.data.data;
23
+ throw new Error('Invalid JSON received from Vault.');
24
+ } catch (err) {
25
+ console.error(
26
+ 'Vault GET error:',
27
+ err?.message || err?.response?.statusText || err,
28
+ );
29
+ }
30
+ }
31
+
32
+ export async function updateVaultSecrets(vaultPath, secretData) {
33
+ if (!vaultPath || !secretData)
34
+ throw new Error('Both vaultPath and secretData are required.');
35
+
36
+ const token = process.env.VAULT_TOKEN;
37
+ const addr = process.env.VAULT_ADDR;
38
+ if (!token || !addr)
39
+ throw new Error('VAULT_TOKEN and VAULT_ADDR must be set.');
40
+
41
+ if (process.env.VAULT_SKIP_VERIFY === 'true') {
42
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
43
+ }
44
+
45
+ try {
46
+ const response = await axios.post(`${addr}/v1/${vaultPath}`, secretData, {
47
+ headers: {
48
+ 'X-Vault-Token': token,
49
+ 'Content-Type': 'application/json',
50
+ },
51
+ });
52
+
53
+ return response.data;
54
+ } catch (err) {
55
+ console.error(
56
+ 'Vault POST error:',
57
+ err?.message || err?.response?.statusText || err,
58
+ );
59
+ }
60
+ }
@@ -1,134 +1,134 @@
1
- // src/auth0/vault.test.js
2
- import { jest } from '@jest/globals';
3
-
4
- // ESM-compatible mocking
5
- jest.unstable_mockModule('axios', () => ({
6
- default: {
7
- get: jest.fn(),
8
- post: jest.fn(),
9
- },
10
- }));
11
-
12
- describe('Vault Utilities', () => {
13
- let axios;
14
- let getVaultSecrets;
15
- let updateVaultSecrets;
16
- const OLD_ENV = process.env;
17
-
18
- beforeAll(async () => {
19
- // Dynamic import AFTER mocking
20
- axios = (await import('axios')).default;
21
- const vault = await import('./vault.js');
22
- getVaultSecrets = vault.getVaultSecrets;
23
- updateVaultSecrets = vault.updateVaultSecrets;
24
- });
25
-
26
- beforeEach(() => {
27
- jest.resetModules();
28
- process.env = { ...OLD_ENV };
29
- jest.clearAllMocks();
30
- });
31
-
32
- afterAll(() => {
33
- process.env = OLD_ENV;
34
- });
35
-
36
- describe('getVaultSecrets', () => {
37
- it('should fetch secrets from Vault successfully', async () => {
38
- process.env.VAULT_TOKEN = 'test-token';
39
- process.env.VAULT_ADDR = 'https://vault.example.com';
40
-
41
- axios.get.mockResolvedValueOnce({
42
- data: {
43
- data: {
44
- data: {
45
- username: 'admin',
46
- password: 'secret',
47
- },
48
- },
49
- },
50
- });
51
-
52
- const result = await getVaultSecrets('secret/data/myapp');
53
- expect(result).toEqual({ username: 'admin', password: 'secret' });
54
- });
55
-
56
- it('should throw error if vaultPath is missing', async () => {
57
- await expect(getVaultSecrets()).rejects.toThrow(
58
- 'VAULT_PATH is required.',
59
- );
60
- });
61
-
62
- it('should throw error if env vars are missing', async () => {
63
- delete process.env.VAULT_TOKEN;
64
- delete process.env.VAULT_ADDR;
65
-
66
- await expect(getVaultSecrets('secret/data/myapp')).rejects.toThrow(
67
- 'VAULT_TOKEN and VAULT_ADDR must be set.',
68
- );
69
- });
70
-
71
- it('should handle Vault error response', async () => {
72
- process.env.VAULT_TOKEN = 'token';
73
- process.env.VAULT_ADDR = 'https://vault.example.com';
74
-
75
- axios.get.mockRejectedValueOnce({
76
- response: { status: 403, statusText: 'Forbidden' },
77
- });
78
-
79
- const result = await getVaultSecrets('secret/data/myapp');
80
- expect(result).toBeUndefined();
81
- });
82
- });
83
-
84
- describe('updateVaultSecrets', () => {
85
- it('should update secrets in Vault successfully', async () => {
86
- process.env.VAULT_TOKEN = 'test-token';
87
- process.env.VAULT_ADDR = 'https://vault.example.com';
88
-
89
- const secretData = {
90
- data: {
91
- apiKey: '123456',
92
- },
93
- };
94
-
95
- axios.post.mockResolvedValueOnce({
96
- data: {
97
- success: true,
98
- },
99
- });
100
-
101
- const result = await updateVaultSecrets('secret/data/myapp', secretData);
102
- expect(result).toEqual({ success: true });
103
- });
104
-
105
- it('should throw error if vaultPath or secretData is missing', async () => {
106
- await expect(updateVaultSecrets()).rejects.toThrow(
107
- 'Both vaultPath and secretData are required.',
108
- );
109
- });
110
-
111
- it('should throw error if env vars are missing', async () => {
112
- delete process.env.VAULT_TOKEN;
113
- delete process.env.VAULT_ADDR;
114
-
115
- await expect(updateVaultSecrets('secret/data/myapp', {})).rejects.toThrow(
116
- 'VAULT_TOKEN and VAULT_ADDR must be set.',
117
- );
118
- });
119
-
120
- it('should handle Vault error response', async () => {
121
- process.env.VAULT_TOKEN = 'token';
122
- process.env.VAULT_ADDR = 'https://vault.example.com';
123
-
124
- axios.post.mockRejectedValueOnce({
125
- response: { status: 500, statusText: 'Internal Server Error' },
126
- });
127
-
128
- const result = await updateVaultSecrets('secret/data/myapp', {
129
- data: {},
130
- });
131
- expect(result).toBeUndefined();
132
- });
133
- });
134
- });
1
+ // src/auth0/vault.test.js
2
+ import { jest } from '@jest/globals';
3
+
4
+ // ESM-compatible mocking
5
+ jest.unstable_mockModule('axios', () => ({
6
+ default: {
7
+ get: jest.fn(),
8
+ post: jest.fn(),
9
+ },
10
+ }));
11
+
12
+ describe('Vault Utilities', () => {
13
+ let axios;
14
+ let getVaultSecrets;
15
+ let updateVaultSecrets;
16
+ const OLD_ENV = process.env;
17
+
18
+ beforeAll(async () => {
19
+ // Dynamic import AFTER mocking
20
+ axios = (await import('axios')).default;
21
+ const vault = await import('./vault.js');
22
+ getVaultSecrets = vault.getVaultSecrets;
23
+ updateVaultSecrets = vault.updateVaultSecrets;
24
+ });
25
+
26
+ beforeEach(() => {
27
+ jest.resetModules();
28
+ process.env = { ...OLD_ENV };
29
+ jest.clearAllMocks();
30
+ });
31
+
32
+ afterAll(() => {
33
+ process.env = OLD_ENV;
34
+ });
35
+
36
+ describe('getVaultSecrets', () => {
37
+ it('should fetch secrets from Vault successfully', async () => {
38
+ process.env.VAULT_TOKEN = 'test-token';
39
+ process.env.VAULT_ADDR = 'https://vault.example.com';
40
+
41
+ axios.get.mockResolvedValueOnce({
42
+ data: {
43
+ data: {
44
+ data: {
45
+ username: 'admin',
46
+ password: 'secret',
47
+ },
48
+ },
49
+ },
50
+ });
51
+
52
+ const result = await getVaultSecrets('secret/data/myapp');
53
+ expect(result).toEqual({ username: 'admin', password: 'secret' });
54
+ });
55
+
56
+ it('should throw error if vaultPath is missing', async () => {
57
+ await expect(getVaultSecrets()).rejects.toThrow(
58
+ 'VAULT_PATH is required.',
59
+ );
60
+ });
61
+
62
+ it('should throw error if env vars are missing', async () => {
63
+ delete process.env.VAULT_TOKEN;
64
+ delete process.env.VAULT_ADDR;
65
+
66
+ await expect(getVaultSecrets('secret/data/myapp')).rejects.toThrow(
67
+ 'VAULT_TOKEN and VAULT_ADDR must be set.',
68
+ );
69
+ });
70
+
71
+ it('should handle Vault error response', async () => {
72
+ process.env.VAULT_TOKEN = 'token';
73
+ process.env.VAULT_ADDR = 'https://vault.example.com';
74
+
75
+ axios.get.mockRejectedValueOnce({
76
+ response: { status: 403, statusText: 'Forbidden' },
77
+ });
78
+
79
+ const result = await getVaultSecrets('secret/data/myapp');
80
+ expect(result).toBeUndefined();
81
+ });
82
+ });
83
+
84
+ describe('updateVaultSecrets', () => {
85
+ it('should update secrets in Vault successfully', async () => {
86
+ process.env.VAULT_TOKEN = 'test-token';
87
+ process.env.VAULT_ADDR = 'https://vault.example.com';
88
+
89
+ const secretData = {
90
+ data: {
91
+ apiKey: '123456',
92
+ },
93
+ };
94
+
95
+ axios.post.mockResolvedValueOnce({
96
+ data: {
97
+ success: true,
98
+ },
99
+ });
100
+
101
+ const result = await updateVaultSecrets('secret/data/myapp', secretData);
102
+ expect(result).toEqual({ success: true });
103
+ });
104
+
105
+ it('should throw error if vaultPath or secretData is missing', async () => {
106
+ await expect(updateVaultSecrets()).rejects.toThrow(
107
+ 'Both vaultPath and secretData are required.',
108
+ );
109
+ });
110
+
111
+ it('should throw error if env vars are missing', async () => {
112
+ delete process.env.VAULT_TOKEN;
113
+ delete process.env.VAULT_ADDR;
114
+
115
+ await expect(updateVaultSecrets('secret/data/myapp', {})).rejects.toThrow(
116
+ 'VAULT_TOKEN and VAULT_ADDR must be set.',
117
+ );
118
+ });
119
+
120
+ it('should handle Vault error response', async () => {
121
+ process.env.VAULT_TOKEN = 'token';
122
+ process.env.VAULT_ADDR = 'https://vault.example.com';
123
+
124
+ axios.post.mockRejectedValueOnce({
125
+ response: { status: 500, statusText: 'Internal Server Error' },
126
+ });
127
+
128
+ const result = await updateVaultSecrets('secret/data/myapp', {
129
+ data: {},
130
+ });
131
+ expect(result).toBeUndefined();
132
+ });
133
+ });
134
+ });