@pega/custom-dx-components 26.1.11-alpha-0.2 → 26.1.11

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "26.1.11-alpha-0.2",
3
+ "version": "26.1.11",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": {
6
6
  "custom-dx-components": "./bin/index.js"
@@ -25,8 +25,8 @@ export const getAuthQuestions = async dxcbConfig => {
25
25
  answers.serverType = initAnswer('serverType', AUTHENTICATE_DEFAULTS.serverType);
26
26
  answers.isVanity = defaultPegaConfig.isVanity;
27
27
  answers.server = initAnswer('server', AUTHENTICATE_DEFAULTS.server);
28
- answers.authUrl = initAnswer('authUrl', '');
29
- answers.accessTokenUrl = initAnswer('accessTokenUrl', '');
28
+ answers.authorizeUri = initAnswer('authorizeUri', '');
29
+ answers.tokenUri = initAnswer('tokenUri', '');
30
30
  answers.clientId = initAnswer('clientId', AUTHENTICATE_DEFAULTS.clientId);
31
31
  answers.grantType = initAnswer('grantType', AUTHENTICATE_DEFAULTS.grantType);
32
32
  answers.authService = initAnswer('authService', AUTHENTICATE_DEFAULTS.authService);
@@ -99,21 +99,24 @@ export const getAuthQuestions = async dxcbConfig => {
99
99
  }
100
100
  },
101
101
  {
102
- name: 'authUrl',
102
+ name: 'authorizeUri',
103
103
  type: 'input',
104
104
  message: 'Enter complete authorization URL',
105
- default: defaultPegaConfig.authUrl,
105
+ default: defaultPegaConfig.authorizeUri,
106
106
  validate: value => isCompleteHttpUrl(value) || 'Authorization URL must be a complete HTTP(S) URL',
107
107
  when: answers =>
108
- answers.serverType === 'launchpad' && answers.isVanity !== false && answers.grantType === 'authCode' && fnStandardWhen('authUrl', answers)
108
+ answers.serverType === 'launchpad' &&
109
+ answers.isVanity !== false &&
110
+ answers.grantType === 'authCode' &&
111
+ fnStandardWhen('authorizeUri', answers)
109
112
  },
110
113
  {
111
- name: 'accessTokenUrl',
114
+ name: 'tokenUri',
112
115
  type: 'input',
113
116
  message: 'Enter complete access token URL',
114
- default: defaultPegaConfig.accessTokenUrl,
117
+ default: defaultPegaConfig.tokenUri,
115
118
  validate: value => isCompleteHttpUrl(value) || 'Access token URL must be a complete HTTP(S) URL',
116
- when: answers => answers.serverType === 'launchpad' && answers.isVanity !== false && fnStandardWhen('accessTokenUrl', answers)
119
+ when: answers => answers.serverType === 'launchpad' && answers.isVanity !== false && fnStandardWhen('tokenUri', answers)
117
120
  },
118
121
  {
119
122
  name: 'authService',
@@ -19,15 +19,17 @@ export const generateAccessToken = async config => {
19
19
  let authSuccess = false;
20
20
  const { serverType, authService, isolationId, grantType, clientId, clientSecret, user, password, legacyTLS } = config;
21
21
  const launchpadVanity = isLaunchpadVanity(config);
22
- if (launchpadVanity && (!isCompleteHttpUrl(config.accessTokenUrl) || (grantType === 'authCode' && !isCompleteHttpUrl(config.authUrl)))) {
23
- throw new Error('Launchpad vanity configuration requires complete HTTP(S) authUrl and accessTokenUrl values');
22
+ if (launchpadVanity && (!isCompleteHttpUrl(config.tokenUri) || (grantType === 'authCode' && !isCompleteHttpUrl(config.authorizeUri)))) {
23
+ throw new Error('Launchpad vanity configuration requires complete HTTP(S) authorizeUri and tokenUri values');
24
24
  }
25
25
  // Try to gracefully deal with missing trailing slashes for server (and later conditionally for redirectUri)
26
26
  const server = config.server.endsWith('/') ? config.server : `${config.server}/`;
27
27
 
28
28
  return new Promise((resolve, reject) => {
29
- const sTokenUri = launchpadVanity ? config.accessTokenUrl : `${server}${serverType === 'infinity' ? INF_TOKEN_URL_V1 : LP_TOKEN_URL}`;
30
- const sAuthorizeUri = launchpadVanity ? config.authUrl : `${server}${serverType === 'infinity' ? INF_AUTHORIZE_URL_V1 : LP_AUTHORIZE_URL}`;
29
+ const sTokenUriInfinity = config.tokenUri || `${server}${INF_TOKEN_URL_V1}`;
30
+ const sAuthorizeUriInfinity = config.authorizeUri || `${server}${INF_AUTHORIZE_URL_V1}`;
31
+ const sTokenUri = launchpadVanity ? config.tokenUri : serverType === 'infinity' ? sTokenUriInfinity : `${server}${LP_TOKEN_URL}`;
32
+ const sAuthorizeUri = launchpadVanity ? config.authorizeUri : serverType === 'infinity' ? sAuthorizeUriInfinity : `${server}${LP_AUTHORIZE_URL}`;
31
33
  // console.log(`grantType: ${config.grantType}`);
32
34
  const browserAuthSuccessMarkup = `<div style="width: 300px; padding: 10px;">
33
35
  <svg xmlns="http://www. w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 311 68" version="1.1">
@@ -164,8 +166,8 @@ export default async options => {
164
166
  'serverType',
165
167
  'server',
166
168
  'isVanity',
167
- 'authUrl',
168
- 'accessTokenUrl',
169
+ 'authorizeUri',
170
+ 'tokenUri',
169
171
  'isolationId',
170
172
  'clientId',
171
173
  'grantType',
@@ -109,7 +109,7 @@
109
109
  "@babel/preset-react": "^7.27.1",
110
110
  "@babel/preset-typescript": "^7.27.1",
111
111
  "@pega/configs": "^0.16.3",
112
- "@pega/custom-dx-components": "~26.1.11-alpha-0.2",
112
+ "@pega/custom-dx-components": "~26.1.11",
113
113
  "@pega/pcore-pconnect-typedefs": "^5.1.0",
114
114
  "@storybook/addon-docs": "^9.1.7",
115
115
  "@storybook/addon-essentials": "^9.0.0-alpha.12",
@@ -10,10 +10,10 @@
10
10
  "devServerPort": "3030",
11
11
  "serverType": "infinity",
12
12
  "server": "https://localhost:1080/prweb",
13
- "authUrl": "",
14
- "authUrlComment": "Authorization URL for the OAuth2 authentication",
15
- "accessTokenUrl": "",
16
- "accessTokenUrlComment": "Access token URL for the OAuth2 authentication",
13
+ "authorizeUri": "",
14
+ "authorizeUriComment": "Authorization URL for the OAuth2 authentication (mandatory when serverType is 'launchpad')",
15
+ "tokenUri": "",
16
+ "tokenUriComment": "Access token URL for the OAuth2 authentication (mandatory when serverType is 'launchpad')",
17
17
  "clientId": "10095186356008396159",
18
18
  "clientSecret_comment": "Needed only when using 'passwordCreds' or 'clientCreds' grantType",
19
19
  "clientSecret": "",