@pega/custom-dx-components 25.1.10-alpha-0.7 → 25.1.10-alpha-0.8
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/package.json
CHANGED
|
@@ -122,7 +122,8 @@ addDebugLog("fetchComponenLibrariessFromInfinity", `apiUrl: ${apiUrl}`, "");
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
// const getInfinityLibraries = async(rulesetName, rulesetVersion) => {
|
|
126
|
+
export const getInfinityLibraries = async() => {
|
|
126
127
|
addDebugLog("getInfinityLibraries", '', "");
|
|
127
128
|
|
|
128
129
|
const { app_name, app_version } = await getApplicationAndVersionFromToken();
|
|
@@ -140,10 +141,9 @@ addDebugLog("getInfinityLibraries", '', "");
|
|
|
140
141
|
|
|
141
142
|
// inquire
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
//urlParams =
|
|
146
|
-
|
|
144
|
+
// want to get a list of all for application, so make ruleset/version blank
|
|
145
|
+
let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/""/rulesetversion/""`;
|
|
146
|
+
// let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
|
|
147
147
|
|
|
148
148
|
url = url.concat(urlParams);
|
|
149
149
|
|
|
@@ -3,7 +3,7 @@ import ora from 'ora';
|
|
|
3
3
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
|
|
6
|
-
import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion, addDebugLog, getConfigDefaults, getLibraryBasedCL, getPegaServerConfig, deleteInfinityServerComponentLibrary, checkAccessTokenExpiration } from '../../util.js';
|
|
6
|
+
import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion, addDebugLog, getConfigDefaults, getLibraryBasedCL, getPegaServerConfig, deleteInfinityServerComponentLibrary, checkAccessTokenExpiration, getApplicationAndVersionFromToken } from '../../util.js';
|
|
7
7
|
import { deleteLib } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
8
8
|
|
|
9
9
|
import { getDeleteLibraryQuestions, getLibraryVersionQuestion, getRulesetAndVersionQuestion, SOURCE_OF_COMPONENT_TYPES, getInfinityLibraries } from './helper.js';
|
|
@@ -94,19 +94,27 @@ addDebugLog("deletePublished", "END", "-");
|
|
|
94
94
|
if (isLibraryBasedCL) {
|
|
95
95
|
|
|
96
96
|
const serverConfg = await getPegaServerConfig();
|
|
97
|
+
const { app_name, app_version } = await getApplicationAndVersionFromToken();
|
|
97
98
|
|
|
98
99
|
console.log();
|
|
99
100
|
console.log(`Current server: ${chalk.green.bold(`${serverConfg.server}`)}`);
|
|
101
|
+
console.log(`List of libraries for Application: ${chalk.green.bold(`${app_name} - ${app_version}`)}`);
|
|
102
|
+
console.log(chalk.bold.yellow(`>> Caution...`));
|
|
103
|
+
console.log(chalk.bold.yellow(`>> This list may contain built on libraries if your application is built on an application.`));
|
|
104
|
+
console.log(chalk.bold.yellow(`>> Deleting built on libraries may cause issues with built on application.`));
|
|
100
105
|
|
|
101
|
-
const questions = await getRulesetAndVersionQuestion(serverConfg);
|
|
102
|
-
const answers = await inquirer.prompt(questions);
|
|
103
|
-
const { rulesetName, rulesetVersion } = answers;
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
// want to get all in application, so ignore ruleset/version questions
|
|
108
|
+
// const questions = await getRulesetAndVersionQuestion(serverConfg);
|
|
109
|
+
// const answers = await inquirer.prompt(questions);
|
|
110
|
+
// const { rulesetName, rulesetVersion } = answers;
|
|
111
|
+
|
|
112
|
+
// const arLibs = await getInfinityLibraries(rulesetName, rulesetVersion);
|
|
113
|
+
const arLibs = await getInfinityLibraries();
|
|
106
114
|
|
|
107
115
|
if (arLibs && arLibs.pxResults && arLibs.pxResults.length > 0) {
|
|
108
116
|
|
|
109
|
-
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value:
|
|
117
|
+
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel + " (" + oLib.pyRuleSet + ":" + oLib.pyRuleSetVersion + ")", value: index}));
|
|
110
118
|
|
|
111
119
|
const libAnswers = await inquirer.prompt([
|
|
112
120
|
{
|
|
@@ -117,7 +125,9 @@ addDebugLog("deletePublished", "END", "-");
|
|
|
117
125
|
}
|
|
118
126
|
]);
|
|
119
127
|
|
|
120
|
-
const libraryName = libAnswers.library;
|
|
128
|
+
const libraryName = arLibs.pxResults[libAnswers.library].pyRuleName;
|
|
129
|
+
const rulesetName = arLibs.pxResults[libAnswers.library].pyRuleSet;
|
|
130
|
+
const rulesetVersion = arLibs.pxResults[libAnswers.library].pyRuleSetVersion;
|
|
121
131
|
// let spinner;
|
|
122
132
|
|
|
123
133
|
|
|
@@ -138,8 +148,10 @@ addDebugLog("deletePublished", "END", "-");
|
|
|
138
148
|
else {
|
|
139
149
|
// No library with that name
|
|
140
150
|
const serverConfig = await getPegaServerConfig();
|
|
141
|
-
console.log(chalk.redBright(`No server component libraries exist in given ruleset ${chalk.bold(`${rulesetName}:${rulesetVersion}`)}`));
|
|
142
|
-
|
|
151
|
+
// console.log(chalk.redBright(`No server component libraries exist in given ruleset ${chalk.bold(`${rulesetName}:${rulesetVersion}`)}`));
|
|
152
|
+
console.log(chalk.redBright(`No server component libraries exist in given application`));
|
|
153
|
+
|
|
154
|
+
addDebugLog("listPublished", "END", "-");
|
|
143
155
|
process.exit(1);
|
|
144
156
|
|
|
145
157
|
}
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@babel/preset-react": "^7.27.1",
|
|
109
109
|
"@babel/preset-typescript": "^7.27.1",
|
|
110
110
|
"@pega/configs": "^0.16.3",
|
|
111
|
-
"@pega/custom-dx-components": "~25.1.10-alpha-0.
|
|
111
|
+
"@pega/custom-dx-components": "~25.1.10-alpha-0.8",
|
|
112
112
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
113
113
|
"@storybook/addon-actions": "^8.6.14",
|
|
114
114
|
"@storybook/addon-essentials": "^8.6.14",
|
|
@@ -136,10 +136,13 @@ addDebugLog("getInfinityLibraries", '', "");
|
|
|
136
136
|
|
|
137
137
|
const ApplicationName = app_name;
|
|
138
138
|
const ApplicationVersion = app_version;
|
|
139
|
-
const rulesetName = defaultPegaServerConfig.rulesetName;
|
|
140
|
-
const rulesetVersion = defaultPegaServerConfig.rulesetVersion;
|
|
139
|
+
// const rulesetName = defaultPegaServerConfig.rulesetName;
|
|
140
|
+
// const rulesetVersion = defaultPegaServerConfig.rulesetVersion;
|
|
141
|
+
// let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
|
|
142
|
+
|
|
143
|
+
// currently want to get all published libraries for an application, so make ruleset/version blank
|
|
144
|
+
let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/""/rulesetversion/""`;
|
|
141
145
|
|
|
142
|
-
let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
|
|
143
146
|
|
|
144
147
|
url = url.concat(urlParams);
|
|
145
148
|
|
|
@@ -158,21 +158,22 @@ addDebugLog("listPublished", "END", "-");
|
|
|
158
158
|
|
|
159
159
|
if (arLibs && arLibs.pxResults && arLibs.pxResults.length > 0) {
|
|
160
160
|
|
|
161
|
-
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: index}));
|
|
161
|
+
// const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: index}));
|
|
162
|
+
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel + " (" + oLib.pyRuleSet + ":" + oLib.pyRuleSetVersion + ")", value: index}));
|
|
162
163
|
|
|
163
164
|
|
|
164
165
|
const {app_name, app_version } = await getApplicationAndVersionFromToken();
|
|
165
166
|
const serverConfig = await getPegaServerConfig();
|
|
166
167
|
console.log(`\nServer ${chalk.green.bold(`${serverConfig.server}`)}.`);
|
|
167
|
-
console.log(
|
|
168
|
-
console.log(`in ruleset: ${chalk.green.bold(`${serverConfig.rulesetName}:${serverConfig.rulesetVersion}`)}`);
|
|
168
|
+
console.log(`List of libraries (including built on) for Application: ${chalk.bold.green(`${app_name} - ${app_version}`)}`);
|
|
169
|
+
// console.log(`in ruleset: ${chalk.green.bold(`${serverConfig.rulesetName}:${serverConfig.rulesetVersion}`)}`);
|
|
169
170
|
|
|
170
171
|
|
|
171
172
|
const libAnswers = await inquirer.prompt([
|
|
172
173
|
{
|
|
173
174
|
name: 'library',
|
|
174
175
|
type: 'rawlist',
|
|
175
|
-
message: 'Pick library',
|
|
176
|
+
message: 'Pick component library',
|
|
176
177
|
choices: libs
|
|
177
178
|
}
|
|
178
179
|
]);
|