@pega/custom-dx-components 0.23.39 → 0.23.41
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/README.md +2 -2
- package/package.json +1 -1
- package/src/tasks/init/template/README.md +4 -4
- package/src/tasks/init/template/SECURITY.md +10 -0
- package/src/tasks/init/template/package.json.mustache +6 -6
- package/src/tasks/init/template/tasks.config.json +2 -2
- package/src/tasks/promote-webpack/index.js +3 -6
- package/src/tasks/revert-webpack/index.js +1 -0
- package/src/util.js +66 -28
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ Ensure you have access to the following in your system:
|
|
|
12
12
|
|
|
13
13
|
- Git version 2.30 or later
|
|
14
14
|
|
|
15
|
-
- System node version 18
|
|
15
|
+
- System node version 18, 20
|
|
16
16
|
|
|
17
|
-
- System npm version 8
|
|
17
|
+
- System npm version 8, 10 (9 is not supported)
|
|
18
18
|
|
|
19
19
|
## Latest Documentation
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -8,14 +8,14 @@ This project provides you with an environment to extend Constellation by giving
|
|
|
8
8
|
|
|
9
9
|
Ensure you have access to the following in your system:
|
|
10
10
|
|
|
11
|
-
- Pega Infinity Server version
|
|
11
|
+
- Pega Infinity Server version 23 or later
|
|
12
12
|
|
|
13
13
|
- Git version 2.30 or later
|
|
14
14
|
|
|
15
|
-
- System node version 18
|
|
15
|
+
- System node version 18, 20
|
|
16
16
|
|
|
17
|
-
- System npm version 8
|
|
17
|
+
- System npm version 8, 10 (9 is not supported)
|
|
18
18
|
|
|
19
19
|
## Latest Documentation
|
|
20
20
|
|
|
21
|
-
Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components
|
|
21
|
+
Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/lifecycle-dx-cosmos-components.html)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Reporting Security Issues
|
|
2
|
+
|
|
3
|
+
Pegasystems takes security seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
|
|
4
|
+
|
|
5
|
+
To report a security issue, [email us](mailto:opensource@pega.com;security@pega.com) and include the word "SECURITY" in the subject line.
|
|
6
|
+
|
|
7
|
+
The Pega team will send a response indicating the next steps in handling your report. We may ask for additional information or guidance.
|
|
8
|
+
|
|
9
|
+
## Learning More About Security
|
|
10
|
+
To learn more about securing a Pega application or our security capabilities, please see the [security article](https://community.pega.com/knowledgebase/capabilities/security) on Pega Community and the [Pega Trust Center](https://www.pega.com/products/cloud/pega-trust-center).
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"revertWebPack": "custom-dx-components revertWebPack",
|
|
26
26
|
"lint:types": "tsc --noEmit",
|
|
27
27
|
"lint:es": "eslint .",
|
|
28
|
-
"lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
|
|
29
|
-
"lint:format": "prettier -c .",
|
|
30
|
-
"lint:spelling": "cspell --no-progress **/*",
|
|
31
28
|
"test-coverage": "node --input-type=module --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand node_modules/@pega/custom-dx-component --ci --testResultsProcessor='jest-junit' --coverage",
|
|
32
|
-
"_internal-test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run
|
|
29
|
+
"_internal-test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run _internal-test-full; fi ",
|
|
33
30
|
"_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
|
|
34
31
|
"_internal-test-functional": "npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
|
|
35
|
-
"_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components"
|
|
32
|
+
"_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components",
|
|
33
|
+
"_lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
|
|
34
|
+
"_lint:format": "prettier -c .",
|
|
35
|
+
"_lint:spelling": "cspell --no-progress **/*"
|
|
36
36
|
},
|
|
37
37
|
"scriptsComments": {
|
|
38
38
|
"build": "tsc -b tsconfig.build.json",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@pega/configs": "^0.6.0",
|
|
72
|
-
"@pega/custom-dx-components": "0.23.
|
|
72
|
+
"@pega/custom-dx-components": "0.23.41",
|
|
73
73
|
"@pega/pcore-pconnect-typedefs": "~2.1.1",
|
|
74
74
|
"@storybook/addon-actions": "^7.6.7",
|
|
75
75
|
"@storybook/addon-essentials": "^7.6.7",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"questions_askOnce": "server,authService",
|
|
28
28
|
"questions_askedOnce": ""
|
|
29
29
|
},
|
|
30
|
-
"usePromotedWebPack": false,
|
|
31
30
|
"component": {
|
|
32
31
|
"library": "Extensions",
|
|
33
32
|
"type": "",
|
|
@@ -35,5 +34,6 @@
|
|
|
35
34
|
"subtype": "",
|
|
36
35
|
"description": "",
|
|
37
36
|
"icon": ""
|
|
38
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"usePromotedWebPack": false
|
|
39
39
|
}
|
|
@@ -23,8 +23,6 @@ import {
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
let redirectFile = "";
|
|
27
|
-
|
|
28
26
|
export const copyWebPack = async () => {
|
|
29
27
|
|
|
30
28
|
// first check to see if already have the file
|
|
@@ -80,13 +78,12 @@ export const copyWebPack = async () => {
|
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
console.log(chalk.bold.green(`Bundler now using ${newWebPackConfigDir}.`));
|
|
82
|
+
console.log(chalk.bold.green(`Utilize this file for webpack modifications.`));
|
|
86
83
|
|
|
87
84
|
}
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
|
|
90
87
|
|
|
91
88
|
|
|
92
89
|
|
package/src/util.js
CHANGED
|
@@ -33,12 +33,14 @@ export const checkPathAccess = async (path, options = {}, throwError = false) =>
|
|
|
33
33
|
} catch (err) {
|
|
34
34
|
if (throwError) {
|
|
35
35
|
throw new Error(err);
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
37
38
|
const message =
|
|
38
39
|
errorMessage || `${chalk.red.bold('ERROR')} Could not able to access path - ${path}`;
|
|
39
40
|
console.error(message);
|
|
40
41
|
process.exit(1);
|
|
41
42
|
}
|
|
43
|
+
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
46
|
|
|
@@ -49,7 +51,8 @@ export const getUseWebPackPromotion = async () => {
|
|
|
49
51
|
try {
|
|
50
52
|
// force to throw error and not console log
|
|
51
53
|
await checkPathAccess(pegaConfigJsonPath, {}, true);
|
|
52
|
-
}
|
|
54
|
+
}
|
|
55
|
+
catch (ex) {
|
|
53
56
|
// when can't find it, always be false, assume no webpack override.
|
|
54
57
|
// This is IMPORTANT for init (npx install)
|
|
55
58
|
return false;
|
|
@@ -72,9 +75,10 @@ export const getUseWebPackPromotion = async () => {
|
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
return data[USE_PROMOTED_WEB_PACK];
|
|
75
|
-
};
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const updateUseWebPackPromotion = async ( useValue = false ) => {
|
|
78
82
|
const currentDirectory = process.cwd();
|
|
79
83
|
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
80
84
|
|
|
@@ -90,10 +94,11 @@ export const updateUseWebPackPromotion = async (useValue = false) => {
|
|
|
90
94
|
process.exit(1);
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
data
|
|
97
|
+
data["usePromotedWebPack"] = useValue;
|
|
94
98
|
|
|
95
99
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8' });
|
|
96
|
-
|
|
100
|
+
|
|
101
|
+
}
|
|
97
102
|
|
|
98
103
|
export const deleteLocalComponent = async componentKey => {
|
|
99
104
|
const currentDirectory = process.cwd();
|
|
@@ -430,37 +435,55 @@ export const deleteInfinityServerComponent = async componentKey => {
|
|
|
430
435
|
status = response.status;
|
|
431
436
|
if (!response.ok) {
|
|
432
437
|
if (status === 401) {
|
|
433
|
-
throw new Error(
|
|
438
|
+
throw new Error(
|
|
439
|
+
'Error occurred in authentication. Please regenerate using authenticate'
|
|
440
|
+
);
|
|
434
441
|
// console.log(accessTokenUri, refreshToken);
|
|
435
442
|
/* TODO - Handle refresh_token */
|
|
436
|
-
}
|
|
443
|
+
}
|
|
444
|
+
else if (status === 404){
|
|
437
445
|
throw new Error('404: Server resource not found');
|
|
438
|
-
}
|
|
446
|
+
}
|
|
447
|
+
else if (status === 405){
|
|
439
448
|
throw new Error('405: Server method not allowed');
|
|
440
|
-
}
|
|
449
|
+
}
|
|
450
|
+
else if (status === 408){
|
|
441
451
|
throw new Error('408: Server timed out');
|
|
442
|
-
} else if (response.status === 403) {
|
|
443
|
-
throw new Error('Error forbidden: User does not have privileges to Publish.');
|
|
444
452
|
}
|
|
453
|
+
else if (response.status === 403) {
|
|
454
|
+
throw new Error(
|
|
455
|
+
'Error forbidden: User does not have privileges to Publish.'
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
|
|
445
460
|
}
|
|
446
461
|
|
|
447
462
|
try {
|
|
448
463
|
const respData = await response.json();
|
|
449
|
-
console.log(
|
|
464
|
+
console.log(
|
|
465
|
+
chalk.bold.green(`Success : ${respData.message}`)
|
|
466
|
+
);
|
|
450
467
|
|
|
451
468
|
if (status === 500) {
|
|
452
469
|
status = 999;
|
|
453
470
|
throw new Error(respData.message);
|
|
454
471
|
}
|
|
455
|
-
}
|
|
472
|
+
}
|
|
473
|
+
catch (err) {
|
|
456
474
|
if (status === 500) {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
475
|
+
throw new Error(
|
|
476
|
+
`Error occurred in authentication. Please regenerate using authenticate`
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
else if (status === 999) {
|
|
480
|
+
throw new Error (err);
|
|
460
481
|
}
|
|
461
482
|
}
|
|
483
|
+
|
|
462
484
|
}
|
|
463
485
|
} catch (error) {
|
|
486
|
+
|
|
464
487
|
throw new Error(error);
|
|
465
488
|
}
|
|
466
489
|
};
|
|
@@ -492,6 +515,7 @@ export const deleteLaunchpadServerComponent = async componentKey => {
|
|
|
492
515
|
componentName
|
|
493
516
|
};
|
|
494
517
|
|
|
518
|
+
|
|
495
519
|
const response = await fetch(deleteUrl, {
|
|
496
520
|
method: 'DELETE',
|
|
497
521
|
agent: new https.Agent({ rejectUnauthorized: false }),
|
|
@@ -502,33 +526,47 @@ export const deleteLaunchpadServerComponent = async componentKey => {
|
|
|
502
526
|
status = response.status;
|
|
503
527
|
if (!response.ok) {
|
|
504
528
|
if (status === 401) {
|
|
505
|
-
throw new Error(
|
|
529
|
+
throw new Error(
|
|
530
|
+
'Error occurred in authentication. Please regenerate using authenticate'
|
|
531
|
+
);
|
|
506
532
|
// console.log(accessTokenUri, refreshToken);
|
|
507
533
|
/* TODO - Handle refresh_token */
|
|
508
|
-
}
|
|
534
|
+
}
|
|
535
|
+
else if (status === 404){
|
|
509
536
|
throw new Error('404: Server resource not found');
|
|
510
|
-
}
|
|
537
|
+
}
|
|
538
|
+
else if (status === 405){
|
|
511
539
|
throw new Error('405: Server method not allowed');
|
|
512
|
-
}
|
|
540
|
+
}
|
|
541
|
+
else if (status === 408){
|
|
513
542
|
throw new Error('408: Server timed out');
|
|
514
|
-
}
|
|
515
|
-
|
|
543
|
+
}
|
|
544
|
+
else if (response.status === 403) {
|
|
545
|
+
throw new Error(
|
|
546
|
+
'Error forbidden: User does not have privileges to Publish.'
|
|
547
|
+
);
|
|
516
548
|
}
|
|
517
549
|
}
|
|
518
550
|
|
|
519
551
|
try {
|
|
520
552
|
const respData = await response.text();
|
|
521
|
-
console.log(
|
|
553
|
+
console.log(
|
|
554
|
+
chalk.bold.green(`Success : ${respData}`)
|
|
555
|
+
);
|
|
522
556
|
|
|
523
557
|
if (status === 500) {
|
|
524
558
|
status = 999;
|
|
525
559
|
throw new Error(respData.message);
|
|
526
560
|
}
|
|
527
|
-
}
|
|
561
|
+
}
|
|
562
|
+
catch (err) {
|
|
528
563
|
if (status === 500) {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
564
|
+
throw new Error(
|
|
565
|
+
`Error occurred in authentication. Please regenerate using authenticate`
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
else if (status === 999) {
|
|
569
|
+
throw new Error (err);
|
|
532
570
|
}
|
|
533
571
|
}
|
|
534
572
|
}
|