@pega/custom-dx-components 0.0.1 → 0.8.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/.prettierrc.json +7 -1
- package/.vscode/extensions.json +1 -1
- package/README.md +6 -189
- package/babel.config.cjs +13 -0
- package/jest.config.cjs +37 -0
- package/package.json +45 -33
- package/src/auth.js +637 -0
- package/src/cli.js +49 -1
- package/src/constants.js +123 -8
- package/src/currentPath.cjs +1 -0
- package/src/tasks/authenticate/helper.js +155 -8
- package/src/tasks/authenticate/index.js +188 -51
- package/src/tasks/build/helper.js +116 -0
- package/src/tasks/build/index.js +76 -0
- package/src/tasks/build-all/helper.js +71 -0
- package/src/tasks/build-all/index.js +86 -0
- package/src/tasks/{publish/bundle → bundle}/builder/index.js +54 -5
- package/src/tasks/{publish/bundle → bundle}/builder/webpack.config.js +9 -8
- package/src/tasks/{publish/bundle → bundle}/index.js +2 -2
- package/src/tasks/create/index.js +129 -69
- package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +38 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +26 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +145 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +61 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +170 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/mock.stories.js.mustache +21 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +61 -0
- package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +41 -0
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +195 -0
- package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +439 -0
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +73 -0
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +256 -0
- package/src/tasks/create/templates/Constellation/Field/Date/mock.stories.js.mustache +23 -0
- package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Date/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +256 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +92 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js.mustache +288 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +331 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +73 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +254 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/mock.stories.js.mustache +23 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +278 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +273 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/mock.stories.js.mustache +21 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +291 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +53 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +299 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.stories.js.mustache +23 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +93 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +281 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.stories.js.mustache +21 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +347 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +336 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/mock.stories.js.mustache +21 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +114 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +351 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/mock.stories.js.mustache +67 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/suggestions-handler.js +10 -0
- package/src/tasks/create/{template → templates/Constellation/Field/Text}/config.json.mustache +14 -5
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +51 -0
- package/src/tasks/create/{template → templates/Constellation/Field/Text}/index.jsx.mustache +5 -0
- package/src/tasks/create/templates/Constellation/Field/Text/mock.stories.js.mustache +13 -0
- package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +231 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.stories.js.mustache +22 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.jsx +26 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +239 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.stories.js.mustache +21 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +231 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.stories.js.mustache +20 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +123 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +46 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +266 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.stories.js.mustache +37 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +237 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +46 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +232 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.stories.js.mustache +22 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.jsx.mustache +173 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/config.json.mustache +185 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/demo.stories.jsx.mustache +57 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/index.jsx.mustache +213 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/mock.stories.js.mustache +20 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/time-of-day.js.mustache +288 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/OneColumnDetails.svg +22 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.jsx.mustache +26 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +35 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +132 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +86 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.stories.js.mustache +189 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +152 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.jsx.mustache +26 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/TwoColumnDetails.svg +28 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +42 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +136 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +86 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.stories.js.mustache +230 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +155 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +169 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +45 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/mock.stories.js.mustache +137 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +178 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache +143 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.jsx.mustache +35 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +32 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +102 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +70 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/mock.stories.js.mustache +94 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +229 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +76 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +390 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +30 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +23 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.jsx.mustache +75 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.jsx.mustache +240 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +66 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +68 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +110 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.stories.js.mustache +51 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Launchpad/Field/__components.md +3 -0
- package/src/tasks/create/templates/Launchpad/Template/__components.md +3 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.jsx.mustache +78 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.jsx.mustache +76 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/mock.stories.js.mustache +390 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.jsx.mustache +75 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.jsx.mustache +282 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/config.json.mustache +55 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.jsx.mustache +74 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.jsx.mustache +82 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.stories.js.mustache +51 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Launchpad/Widget/__components.md +3 -0
- package/src/tasks/create-all/index.js +383 -0
- package/src/tasks/delete/helper.js +158 -55
- package/src/tasks/delete/index.js +11 -14
- package/src/tasks/delete-all/helper.js +265 -0
- package/src/tasks/delete-all/index.js +42 -0
- package/src/tasks/index.js +8 -0
- package/src/tasks/init/index.js +27 -23
- package/src/tasks/init/template/.eslintignore +8 -0
- package/src/tasks/init/template/.eslintrc.json +186 -5
- package/src/tasks/init/template/.storybook/package.json +1 -0
- package/src/tasks/init/template/.vscode/extensions.json +1 -1
- package/src/tasks/init/template/README.md +6 -189
- package/src/tasks/init/template/babel.config.cjs +13 -0
- package/src/tasks/init/template/keys/DX-ComponentDev.zip +0 -0
- package/src/tasks/init/template/keys/dxcb.crt +32 -0
- package/src/tasks/init/template/keys/dxcb.key +51 -0
- package/src/tasks/init/template/package.json.mustache +55 -23
- package/src/tasks/init/template/src/components/_components.md +1 -0
- package/src/tasks/init/template/tasks.config.json +25 -8
- package/src/tasks/init/template/templateNPMRC.txt +8 -0
- package/src/tasks/linter/index.js +46 -0
- package/src/tasks/list/helper.js +195 -57
- package/src/tasks/list/index.js +22 -3
- package/src/tasks/promote-webpack/index.js +126 -0
- package/src/tasks/promote-webpack/webpack.config.js +376 -0
- package/src/tasks/publish/helper.js +110 -61
- package/src/tasks/publish/index.js +43 -12
- package/src/tasks/publish-all/helper.js +187 -0
- package/src/tasks/publish-all/index.js +107 -0
- package/src/tasks/rename/index.js +344 -0
- package/src/tasks/revert-webpack/index.js +71 -0
- package/src/tasks/validator/index.js +291 -18
- package/src/util.js +246 -76
- package/tests/assets/components/create/Pega_DXIL_MyTestText/config.json +55 -0
- package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.jsx +51 -0
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.jsx +60 -0
- package/tests/assets/components/create/Pega_DXIL_MyTestText/mock.stories.js +13 -0
- package/tests/assets/components/create/Pega_DXIL_MyTestText/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/Boolean.js +38 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/boolean-format.js +26 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +145 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.jsx +61 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.jsx +170 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +23 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.jsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.jsx +73 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/mock.stories.js +390 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +291 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.jsx +53 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.jsx +296 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/DateFormatter.js +61 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/FormattedText.jsx +41 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +195 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/date.js +439 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.jsx +73 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.jsx +256 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +256 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-time.js +92 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-utils.js +288 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date.js +331 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.jsx +73 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.jsx +254 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +278 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.jsx +49 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.jsx +270 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/OneColumnDetails.svg +22 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.jsx +26 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +35 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.jsx +132 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.jsx +83 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/mock.stories.js +189 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/utils.js +152 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +111 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.jsx +48 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.jsx +231 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/mock.stories.js +22 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/DefaultForm.svg +29 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +45 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.jsx +166 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.jsx +42 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/mock.stories.js +137 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +344 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.jsx +49 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.jsx +333 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.jsx +35 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +32 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.jsx +102 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/index.jsx +70 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/localizations.json +4 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/mock.stories.js +94 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/utils.js +229 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.jsx +75 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.jsx +237 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +66 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.jsx +68 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.jsx +108 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/mock.stories.js +51 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +59 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.jsx +30 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.jsx +48 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +111 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.jsx +48 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.jsx +231 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/mock.stories.js +20 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +93 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.jsx +49 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.jsx +275 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +123 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.jsx +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.jsx +266 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/mock.stories.js +37 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +114 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.jsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.jsx +351 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/mock.stories.js +67 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/suggestions-handler.js +10 -0
- package/{src/tasks/init/template/src/components/Organization_Library_VideoPlayer → tests/assets/components/createAll/Constellation/Pega_DXIL_MyText}/config.json +24 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.jsx +51 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.jsx +60 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/mock.stories.js +13 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.jsx +26 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +111 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.jsx +48 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.jsx +239 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +185 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.jsx +57 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.jsx +213 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/mock.stories.js +20 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/time-of-day.js +288 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.jsx +26 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/TwoColumnDetails.svg +28 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +42 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +136 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.jsx +83 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/mock.stories.js +230 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/utils.js +155 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/TwoColumn.svg +38 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +27 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +175 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.jsx +45 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/mock.stories.js +143 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +237 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.jsx +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/event-utils.js +18 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.jsx +232 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/mock.stories.js +22 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/styles.js +14 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/text-url.jsx +173 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/Boolean.js +38 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/boolean-format.js +26 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/config.json +145 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.jsx +61 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.jsx +170 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/config.json +23 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.jsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.jsx +73 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/mock.stories.js +390 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/config.json +291 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.jsx +53 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.jsx +296 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/DateFormatter.js +61 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/FormattedText.jsx +41 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +195 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/date.js +439 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.jsx +73 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.jsx +256 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/config.json +256 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-time.js +92 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-utils.js +288 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date.js +331 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.jsx +73 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.jsx +254 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/config.json +278 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.jsx +49 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.jsx +270 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/OneColumnDetails.svg +22 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.jsx +26 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/config.json +35 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.jsx +132 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.jsx +83 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/mock.stories.js +189 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/utils.js +152 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/config.json +111 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.jsx +48 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.jsx +231 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/mock.stories.js +22 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/DefaultForm.svg +29 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/config.json +45 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.jsx +166 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.jsx +42 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/mock.stories.js +137 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/config.json +344 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.jsx +49 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.jsx +333 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.jsx +35 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/config.json +32 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.jsx +102 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/index.jsx +70 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/localizations.json +4 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/mock.stories.js +94 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/utils.js +229 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Avatar.jsx +75 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Operator.jsx +279 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/config.json +55 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.stories.jsx +74 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.jsx +80 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/mock.stories.js +51 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/OneColumnPage.svg +36 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/config.json +59 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.jsx +30 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.jsx +48 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/mock.stories.js +23 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/config.json +111 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.jsx +48 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.jsx +231 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/mock.stories.js +20 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/config.json +93 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.jsx +49 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.jsx +275 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +123 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.jsx +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.jsx +266 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.stories.js +37 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/config.json +114 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.jsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.jsx +351 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/mock.stories.js +67 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/config.json +55 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.jsx +51 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.jsx +60 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/mock.stories.js +13 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.jsx +26 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/config.json +111 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.jsx +48 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.jsx +239 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/mock.stories.js +21 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/config.json +185 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.jsx +57 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.jsx +213 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/mock.stories.js +20 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/time-of-day.js +288 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.jsx +26 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/TwoColumnDetails.svg +28 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/config.json +42 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +136 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.jsx +83 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/mock.stories.js +230 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/utils.js +155 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/TwoColumn.svg +38 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/config.json +27 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +175 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.jsx +45 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/mock.stories.js +143 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/config.json +237 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.jsx +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/event-utils.js +18 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.jsx +232 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/mock.stories.js +22 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/styles.js +14 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/suggestions-handler.js +10 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/text-url.jsx +173 -0
- package/tests/functional/localCreateAllListDeleteAll.test.js +163 -0
- package/tests/functional/localCreateBuildAllDeleteAll.test.js +148 -0
- package/tests/functional/localCreateBuildDelete.test.js +84 -0
- package/tests/functional/localCreateListDelete.test.js +108 -0
- package/tests/functional/localCreatePublishAllDeleteAll.test.js +148 -0
- package/tests/functional/localCreatePublishDelete.test.js +84 -0
- package/tests/functional/localCreateRenameDelete.test.js +84 -0
- package/tests/functional/localPromoteRevertWP.test.js +59 -0
- package/tests/unit/util.test.js +544 -0
- package/src/tasks/create/template/demo.stories.jsx.mustache +0 -44
- package/src/tasks/create/template/styles.js.mustache +0 -7
- package/src/tasks/init/template/src/components/MBTAList/MBTAList.stories.tsx +0 -10
- package/src/tasks/init/template/src/components/MBTAList/MBTAList.tsx +0 -122
- package/src/tasks/init/template/src/components/MBTAList/icons/accessible.icon.tsx +0 -14
- package/src/tasks/init/template/src/components/MBTAList/icons/bus.icon.tsx +0 -13
- package/src/tasks/init/template/src/components/MBTAList/icons/mbta.icon.tsx +0 -10
- package/src/tasks/init/template/src/components/MBTAList/icons/subway.icon.tsx +0 -14
- package/src/tasks/init/template/src/components/MBTAList/index.ts +0 -2
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURL.stories.tsx +0 -19
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURL.styles.ts +0 -5
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURL.types.ts +0 -10
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURLDisplay.tsx +0 -25
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURLInput.tsx +0 -24
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/config.json +0 -13
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/index.ts +0 -2
- package/src/tasks/init/template/src/components/Organization_Library_VideoPlayer/demo.stories.jsx +0 -40
- package/src/tasks/init/template/src/components/Organization_Library_VideoPlayer/index.jsx +0 -42
- package/src/tasks/init/template/src/components/Organization_Library_VideoPlayer/styles.js +0 -5
- /package/src/tasks/{publish/bundle → bundle}/builder/modules.js +0 -0
- /package/src/tasks/{publish/bundle → bundle}/builder/paths.js +0 -0
- /package/src/tasks/init/template/.storybook/{main.js → main.cjs} +0 -0
package/src/auth.js
ADDED
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
class PegaAuth {
|
|
2
|
+
constructor(ssKeyConfig) {
|
|
3
|
+
if (typeof ssKeyConfig === 'string') {
|
|
4
|
+
this.ssKeyConfig = ssKeyConfig;
|
|
5
|
+
this.#reloadConfig();
|
|
6
|
+
} else {
|
|
7
|
+
// object with config structure is passed in
|
|
8
|
+
this.config = ssKeyConfig;
|
|
9
|
+
}
|
|
10
|
+
this.urlencoded = 'application/x-www-form-urlencoded';
|
|
11
|
+
this.isNode = typeof window === 'undefined';
|
|
12
|
+
|
|
13
|
+
// For isNode path the below attributes are initialized on first method invocation
|
|
14
|
+
if (!this.isNode) {
|
|
15
|
+
this.crypto = window.crypto;
|
|
16
|
+
this.subtle = window.crypto.subtle;
|
|
17
|
+
}
|
|
18
|
+
if (!this.config.serverType) {
|
|
19
|
+
this.config.serverType = 'infinity';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#reloadConfig() {
|
|
24
|
+
if (!this.ssKeyConfig) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const peConfig = window.sessionStorage.getItem(this.ssKeyConfig);
|
|
28
|
+
let obj = {};
|
|
29
|
+
if (peConfig) {
|
|
30
|
+
try {
|
|
31
|
+
obj = JSON.parse(peConfig);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
try {
|
|
34
|
+
obj = JSON.parse(atob(peConfig));
|
|
35
|
+
} catch (err) {
|
|
36
|
+
obj = {};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
this.config = peConfig ? obj : {};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#updateConfig() {
|
|
44
|
+
if (this.ssKeyConfig) {
|
|
45
|
+
window.sessionStorage.setItem(this.ssKeyConfig, btoa(JSON.stringify(this.config)));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async #importSingleLib(libName, libProp) {
|
|
50
|
+
return import(libName)
|
|
51
|
+
.then((mod) => {
|
|
52
|
+
this[libProp] = mod.default;
|
|
53
|
+
})
|
|
54
|
+
.catch((e) => {
|
|
55
|
+
console.error(`Library ${libName} failed to load`);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async #importNodeLibs() {
|
|
60
|
+
// Also current assumption is using Node 18 or better
|
|
61
|
+
return Promise.all([
|
|
62
|
+
this.#importSingleLib('node-fetch', 'fetch'),
|
|
63
|
+
this.#importSingleLib('open', 'open'),
|
|
64
|
+
this.#importSingleLib('node:crypto', 'crypto'),
|
|
65
|
+
this.#importSingleLib('node:https', 'https'),
|
|
66
|
+
this.#importSingleLib('node:http', 'http'),
|
|
67
|
+
this.#importSingleLib('node:fs', 'fs')
|
|
68
|
+
]).then(() => {
|
|
69
|
+
this.subtle = this.crypto.subtle || this.crypto.webcrypto.subtle;
|
|
70
|
+
/* eslint-disable-next-line no-global-assign */
|
|
71
|
+
fetch = this.fetch;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// For PKCE the authorize includes a code_challenge & code_challenge_method as well
|
|
76
|
+
async #buildAuthorizeUrl(state) {
|
|
77
|
+
const {
|
|
78
|
+
serverType,
|
|
79
|
+
clientId,
|
|
80
|
+
redirectUri,
|
|
81
|
+
authorizeUri,
|
|
82
|
+
authService,
|
|
83
|
+
sessionIndex,
|
|
84
|
+
appAlias,
|
|
85
|
+
userIdentifier,
|
|
86
|
+
password,
|
|
87
|
+
noPKCE,
|
|
88
|
+
isolationId
|
|
89
|
+
} = this.config;
|
|
90
|
+
const bInfinity = serverType === 'infinity';
|
|
91
|
+
|
|
92
|
+
if (!noPKCE) {
|
|
93
|
+
// Generate random string of 64 chars for verifier. RFC 7636 says from 43-128 chars
|
|
94
|
+
const buf = new Uint8Array(64);
|
|
95
|
+
this.crypto.getRandomValues(buf);
|
|
96
|
+
this.config.codeVerifier = this.#base64UrlSafeEncode(buf);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// If sessionIndex exists then increment attempts count (we will stop sending session_index after two failures)
|
|
100
|
+
if (sessionIndex) {
|
|
101
|
+
this.config.sessionIndexAttempts += 1;
|
|
102
|
+
}
|
|
103
|
+
// Persist codeVerifier in session storage so it survives the redirects that are to follow
|
|
104
|
+
this.#updateConfig();
|
|
105
|
+
|
|
106
|
+
if (!state) {
|
|
107
|
+
// Calc random state variable
|
|
108
|
+
const buf = new Uint8Array(32);
|
|
109
|
+
this.crypto.getRandomValues(buf);
|
|
110
|
+
state = this.#base64UrlSafeEncode(buf);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Trim alias to include just the real alias piece
|
|
114
|
+
const addtlScope = appAlias ? `+app.alias.${appAlias.replace(/^app\//, '')}` : '';
|
|
115
|
+
const scope = bInfinity ? `openid${addtlScope}` : 'user_info';
|
|
116
|
+
|
|
117
|
+
// Add explicit creds if specified to try to avoid login popup
|
|
118
|
+
const authServiceArg = authService ? `&authentication_service=${encodeURIComponent(authService)}` : '';
|
|
119
|
+
const sessionIndexArg =
|
|
120
|
+
sessionIndex && this.config.sessionIndexAttempts < 3 ? `&session_index=${sessionIndex}` : '';
|
|
121
|
+
const userIdentifierArg = userIdentifier ? `&UserIdentifier=${encodeURIComponent(userIdentifier)}` : '';
|
|
122
|
+
const passwordArg = password && userIdentifier ? `&Password=${encodeURIComponent(atob(password))}` : '';
|
|
123
|
+
const moreAuthArgs = bInfinity
|
|
124
|
+
? `&enable_psyncid=true${authServiceArg}${sessionIndexArg}${userIdentifierArg}${passwordArg}`
|
|
125
|
+
: `&isolationID=${isolationId}`;
|
|
126
|
+
|
|
127
|
+
let pkceArgs = '';
|
|
128
|
+
if (!noPKCE) {
|
|
129
|
+
const cc = await this.#getCodeChallenge(this.config.codeVerifier);
|
|
130
|
+
pkceArgs = `&code_challenge=${cc}&code_challenge_method=S256`;
|
|
131
|
+
}
|
|
132
|
+
return `${authorizeUri}?client_id=${clientId}&response_type=code&redirect_uri=${redirectUri}&scope=${scope}&state=${state}${pkceArgs}${moreAuthArgs}`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async login() {
|
|
136
|
+
if (this.isNode && !this.crypto) {
|
|
137
|
+
// Deferring dynamic loading of node libraries til this first method to avoid doing this in constructor
|
|
138
|
+
await this.#importNodeLibs();
|
|
139
|
+
}
|
|
140
|
+
const { grantType, noPKCE } = this.config;
|
|
141
|
+
if (grantType && grantType !== 'authCode') {
|
|
142
|
+
return this.getToken();
|
|
143
|
+
}
|
|
144
|
+
// Make sure browser in a secure context, else PKCE will fail
|
|
145
|
+
if (!this.isNode && !noPKCE && !window.isSecureContext) {
|
|
146
|
+
throw (new Error(`Authorization code grant flow failed due to insecure browser context at ${window.location.origin}. Use localhost or https.`));
|
|
147
|
+
}
|
|
148
|
+
return this.#authCodeStart();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// authCode login issues the authorize endpoint transaction and deals with redirects
|
|
152
|
+
/* eslint-disable-next-line sonarjs/cognitive-complexity */
|
|
153
|
+
async #authCodeStart() {
|
|
154
|
+
const fnGetRedirectUriOrigin = () => {
|
|
155
|
+
const redirectUri = this.config.redirectUri;
|
|
156
|
+
const nRootOffset = redirectUri.indexOf('//');
|
|
157
|
+
const nFirstPathOffset = nRootOffset !== -1 ? redirectUri.indexOf('/', nRootOffset + 2) : -1;
|
|
158
|
+
return nFirstPathOffset !== -1 ? redirectUri.substring(0, nFirstPathOffset) : redirectUri;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const redirectOrigin = fnGetRedirectUriOrigin();
|
|
162
|
+
const state = this.isNode ? '' : btoa(window.location.origin);
|
|
163
|
+
|
|
164
|
+
return new Promise((resolve, reject) => {
|
|
165
|
+
this.#buildAuthorizeUrl(state).then((url) => {
|
|
166
|
+
let myWindow = null; // popup or iframe
|
|
167
|
+
let elIframe = null;
|
|
168
|
+
let elCloseBtn = null;
|
|
169
|
+
const iframeTimeout = this.config.silentTimeout !== undefined ? this.config.silentTimeout : 5000;
|
|
170
|
+
let bWinIframe =
|
|
171
|
+
!this.isNode &&
|
|
172
|
+
iframeTimeout > 0 &&
|
|
173
|
+
((!!this.config.userIdentifier && !!this.config.password) ||
|
|
174
|
+
this.config.iframeLoginUI ||
|
|
175
|
+
this.config.authService !== 'pega');
|
|
176
|
+
let tmrAuthComplete = null;
|
|
177
|
+
let checkWindowClosed = null;
|
|
178
|
+
const myWinOnLoad = () => {
|
|
179
|
+
try {
|
|
180
|
+
if (bWinIframe) {
|
|
181
|
+
elIframe.contentWindow.postMessage({ type: 'PegaAuth' }, redirectOrigin);
|
|
182
|
+
} else {
|
|
183
|
+
myWindow.postMessage({ type: 'PegaAuth' }, redirectOrigin);
|
|
184
|
+
}
|
|
185
|
+
} catch (e) {
|
|
186
|
+
// Exception trying to postMessage on load (perhaps should console.warn)
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
/* eslint-disable prefer-promise-reject-errors */
|
|
190
|
+
const fnOpenPopup = () => {
|
|
191
|
+
if (this.config.noPopups) {
|
|
192
|
+
return reject('no-popups');
|
|
193
|
+
}
|
|
194
|
+
myWindow = (this.isNode ? this.open : window.open)(url, '_blank', 'width=700,height=500,left=200,top=100');
|
|
195
|
+
if (!myWindow) {
|
|
196
|
+
// Blocked by popup-blocker
|
|
197
|
+
return reject('blocked');
|
|
198
|
+
}
|
|
199
|
+
checkWindowClosed = setInterval(() => {
|
|
200
|
+
if (myWindow.closed) {
|
|
201
|
+
clearInterval(checkWindowClosed);
|
|
202
|
+
reject('closed');
|
|
203
|
+
}
|
|
204
|
+
}, 500);
|
|
205
|
+
if (!this.isNode) {
|
|
206
|
+
try {
|
|
207
|
+
myWindow.addEventListener('load', myWinOnLoad, true);
|
|
208
|
+
} catch (e) {
|
|
209
|
+
// Exception trying to add onload handler to opened window
|
|
210
|
+
console.error(`Error adding event listener on popup window: ${e}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
/* eslint-enable prefer-promise-reject-errors */
|
|
215
|
+
const fnCloseIframe = () => {
|
|
216
|
+
elIframe.parentNode.removeChild(elIframe);
|
|
217
|
+
elCloseBtn.parentNode.removeChild(elCloseBtn);
|
|
218
|
+
elIframe = null;
|
|
219
|
+
elCloseBtn = null;
|
|
220
|
+
bWinIframe = false;
|
|
221
|
+
};
|
|
222
|
+
const fnCloseAndReject = () => {
|
|
223
|
+
fnCloseIframe();
|
|
224
|
+
/* eslint-disable-next-line prefer-promise-reject-errors */
|
|
225
|
+
reject('closed');
|
|
226
|
+
};
|
|
227
|
+
let authMessageReceiver = null;
|
|
228
|
+
/* Retrieve token(s) and close login window */
|
|
229
|
+
const fnGetTokenAndFinish = (code) => {
|
|
230
|
+
if (!this.isNode) {
|
|
231
|
+
window.removeEventListener('message', authMessageReceiver, false);
|
|
232
|
+
}
|
|
233
|
+
this.getToken(code)
|
|
234
|
+
.then((token) => {
|
|
235
|
+
if (bWinIframe) {
|
|
236
|
+
clearTimeout(tmrAuthComplete);
|
|
237
|
+
fnCloseIframe();
|
|
238
|
+
} else if (!this.isNode) {
|
|
239
|
+
clearInterval(checkWindowClosed);
|
|
240
|
+
myWindow.close();
|
|
241
|
+
}
|
|
242
|
+
resolve(token);
|
|
243
|
+
})
|
|
244
|
+
.catch((e) => {
|
|
245
|
+
reject(e);
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
// If there is a userIdentifier and password specified or an external SSO auth service,
|
|
249
|
+
// we can try to use this silently in an iFrame first
|
|
250
|
+
if (bWinIframe) {
|
|
251
|
+
const nFrameZLevel = 99999;
|
|
252
|
+
elIframe = document.createElement('iframe');
|
|
253
|
+
elIframe.id = `pe${this.config.clientId}`;
|
|
254
|
+
const loginBoxWidth = 500;
|
|
255
|
+
const loginBoxHeight = 700;
|
|
256
|
+
const oStyle = elIframe.style;
|
|
257
|
+
oStyle.position = 'absolute';
|
|
258
|
+
oStyle.display = 'none';
|
|
259
|
+
oStyle.zIndex = nFrameZLevel;
|
|
260
|
+
oStyle.top = `${Math.round(Math.max(window.innerHeight - loginBoxHeight, 0) / 2)}px`;
|
|
261
|
+
oStyle.left = `${Math.round(Math.max(window.innerWidth - loginBoxWidth, 0) / 2)}px`;
|
|
262
|
+
oStyle.width = '500px';
|
|
263
|
+
oStyle.height = '700px';
|
|
264
|
+
// Add Iframe to top of document DOM to have it load
|
|
265
|
+
document.body.insertBefore(elIframe, document.body.firstChild);
|
|
266
|
+
// document.getElementsByTagName('body')[0].appendChild(elIframe);
|
|
267
|
+
elIframe.addEventListener('load', myWinOnLoad, true);
|
|
268
|
+
// Disallow iframe content attempts to navigate main window
|
|
269
|
+
elIframe.setAttribute('sandbox', 'allow-scripts allow-forms allow-same-origin');
|
|
270
|
+
// Adding prompt=none as this is standard OIDC way to communicate no UI is expected (expecting Pega security to support this one day)
|
|
271
|
+
elIframe.setAttribute('src', `${url}&prompt=none`);
|
|
272
|
+
|
|
273
|
+
const svgCloseBtn = `<?xml version="1.0" encoding="UTF-8"?>
|
|
274
|
+
<svg width="34px" height="34px" viewBox="0 0 34 34" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
275
|
+
<title>Dismiss - Black</title>
|
|
276
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
277
|
+
<g transform="translate(1.000000, 1.000000)">
|
|
278
|
+
<circle fill="#252C32" cx="16" cy="16" r="16"></circle>
|
|
279
|
+
<g transform="translate(9.109375, 9.214844)" fill="#FFFFFF" fill-rule="nonzero">
|
|
280
|
+
<path d="M12.7265625,0 L0,12.6210938 L1.0546875,13.5703125 L13.78125,1.0546875 L12.7265625,0 Z M13.7460938,12.5507812 L1.01953125,0 L0,1.01953125 L12.7617188,13.6054688 L13.7460938,12.5507812 Z"></path>
|
|
281
|
+
</g>
|
|
282
|
+
</g>
|
|
283
|
+
</g>
|
|
284
|
+
</svg>`;
|
|
285
|
+
const bCloseWithinFrame = false;
|
|
286
|
+
elCloseBtn = document.createElement('img');
|
|
287
|
+
elCloseBtn.onclick = fnCloseAndReject;
|
|
288
|
+
elCloseBtn.src = `data:image/svg+xml;base64,${btoa(svgCloseBtn)}`;
|
|
289
|
+
const oBtnStyle = elCloseBtn.style;
|
|
290
|
+
oBtnStyle.cursor = 'pointer';
|
|
291
|
+
// If svg doesn't set width and height might want to set oBtStyle width and height to something like '2em'
|
|
292
|
+
oBtnStyle.position = 'absolute';
|
|
293
|
+
oBtnStyle.display = 'none';
|
|
294
|
+
oBtnStyle.zIndex = nFrameZLevel + 1;
|
|
295
|
+
const nTopOffset = bCloseWithinFrame ? 5 : -10;
|
|
296
|
+
const nRightOffset = bCloseWithinFrame ? -34 : -20;
|
|
297
|
+
const nTop = Math.round(Math.max(window.innerHeight - loginBoxHeight, 0) / 2) + nTopOffset;
|
|
298
|
+
oBtnStyle.top = `${nTop}px`;
|
|
299
|
+
const nLeft = Math.round(Math.max(window.innerWidth - loginBoxWidth, 0) / 2) + loginBoxWidth + nRightOffset;
|
|
300
|
+
oBtnStyle.left = `${nLeft}px`;
|
|
301
|
+
document.body.insertBefore(elCloseBtn, document.body.firstChild);
|
|
302
|
+
// If the password was wrong, then the login screen will be in the iframe
|
|
303
|
+
// ..and with Pega without realization of US-372314 it may replace the top (main portal) window
|
|
304
|
+
// For now set a timer and if the timer expires, remove the iFrame and use same url within
|
|
305
|
+
// visible window
|
|
306
|
+
tmrAuthComplete = setTimeout(() => {
|
|
307
|
+
clearTimeout(tmrAuthComplete);
|
|
308
|
+
// remove password from config
|
|
309
|
+
if (this.config.password) {
|
|
310
|
+
delete this.config.password;
|
|
311
|
+
this.#updateConfig();
|
|
312
|
+
}
|
|
313
|
+
// Display the iframe where the redirects did not succeed (or invoke a popup window)
|
|
314
|
+
if (this.config.iframeLoginUI) {
|
|
315
|
+
elIframe.style.display = 'block';
|
|
316
|
+
elCloseBtn.style.display = 'block';
|
|
317
|
+
} else {
|
|
318
|
+
fnCloseIframe();
|
|
319
|
+
fnOpenPopup();
|
|
320
|
+
}
|
|
321
|
+
}, iframeTimeout);
|
|
322
|
+
} else {
|
|
323
|
+
if (this.isNode) {
|
|
324
|
+
// Determine port to listen to by extracting it from redirect uri
|
|
325
|
+
const { redirectUri, cert, key } = this.config;
|
|
326
|
+
const isHttp = redirectUri.startsWith('http:');
|
|
327
|
+
const nLocalhost = redirectUri.indexOf('localhost:');
|
|
328
|
+
const nSlash = redirectUri.indexOf('/', nLocalhost + 10);
|
|
329
|
+
const nPort = parseInt(redirectUri.substring(nLocalhost + 10, nSlash), 10);
|
|
330
|
+
if (nLocalhost !== -1) {
|
|
331
|
+
const options =
|
|
332
|
+
key && cert && !isHttp
|
|
333
|
+
? {
|
|
334
|
+
key: this.fs.readFileSync(key),
|
|
335
|
+
cert: this.fs.readFileSync(cert)
|
|
336
|
+
}
|
|
337
|
+
: {};
|
|
338
|
+
const server = (isHttp ? this.http : this.https).createServer(options, (req, res) => {
|
|
339
|
+
const { winTitle, winBodyHtml } = this.config;
|
|
340
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
341
|
+
// Auto closing window for now. Can always leave it up and allow authConfig props to set title and bodyHtml
|
|
342
|
+
res.end(
|
|
343
|
+
`<html><head><title>${winTitle}</title><script>window.close();</script></head><body>${winBodyHtml}</body></html>`
|
|
344
|
+
);
|
|
345
|
+
const queryString = req.url.split('?')[1];
|
|
346
|
+
const urlParams = new URLSearchParams(queryString);
|
|
347
|
+
const code = urlParams.get('code');
|
|
348
|
+
if (code) {
|
|
349
|
+
// Stop receiving connections and close when all are handled.
|
|
350
|
+
server.close();
|
|
351
|
+
fnGetTokenAndFinish(code);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
/* eslint-enable no-undef */
|
|
355
|
+
server.listen(nPort);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
fnOpenPopup();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (!this.isNode) {
|
|
362
|
+
/* Handler to receive the auth code */
|
|
363
|
+
authMessageReceiver = (event) => {
|
|
364
|
+
// Check origin to make sure it is the redirect origin
|
|
365
|
+
if (event.origin !== redirectOrigin) return;
|
|
366
|
+
if (!event.data || !event.data.type || event.data.type !== 'PegaAuth') return;
|
|
367
|
+
const code = event.data.code.toString();
|
|
368
|
+
fnGetTokenAndFinish(code);
|
|
369
|
+
};
|
|
370
|
+
window.addEventListener('message', authMessageReceiver, false);
|
|
371
|
+
window.authCodeCallback = (code) => {
|
|
372
|
+
fnGetTokenAndFinish(code);
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// For PKCE token endpoint includes code_verifier
|
|
380
|
+
/* eslint-disable-next-line sonarjs/cognitive-complexity */
|
|
381
|
+
getToken(authCode) {
|
|
382
|
+
// Reload config to pick up the previously stored codeVerifier
|
|
383
|
+
this.#reloadConfig();
|
|
384
|
+
|
|
385
|
+
const {
|
|
386
|
+
serverType,
|
|
387
|
+
isolationId,
|
|
388
|
+
clientId,
|
|
389
|
+
clientSecret,
|
|
390
|
+
redirectUri,
|
|
391
|
+
tokenUri,
|
|
392
|
+
codeVerifier,
|
|
393
|
+
grantType,
|
|
394
|
+
sessionIndex,
|
|
395
|
+
customTokenParams,
|
|
396
|
+
userIdentifier,
|
|
397
|
+
password,
|
|
398
|
+
noPKCE
|
|
399
|
+
} = this.config;
|
|
400
|
+
|
|
401
|
+
const bAuthCode = !grantType || grantType === 'authCode';
|
|
402
|
+
if (bAuthCode && !authCode && !this.isNode) {
|
|
403
|
+
const queryString = window.location.search;
|
|
404
|
+
const urlParams = new URLSearchParams(queryString);
|
|
405
|
+
authCode = urlParams.get('code');
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const formData = new URLSearchParams();
|
|
409
|
+
formData.append('client_id', clientId);
|
|
410
|
+
if (clientSecret) {
|
|
411
|
+
formData.append('client_secret', clientSecret);
|
|
412
|
+
}
|
|
413
|
+
/* eslint-disable camelcase */
|
|
414
|
+
const fullGTName = {
|
|
415
|
+
authCode: 'authorization_code',
|
|
416
|
+
clientCreds: 'client_credentials',
|
|
417
|
+
customBearer: 'custom-bearer',
|
|
418
|
+
passwordCreds: 'password'
|
|
419
|
+
}[grantType];
|
|
420
|
+
const grant_type = fullGTName || grantType || 'authorization_code';
|
|
421
|
+
formData.append('grant_type', grant_type);
|
|
422
|
+
if (serverType === 'launchpad' && grantType !== 'authCode') {
|
|
423
|
+
formData.append('isolation_ids', isolationId);
|
|
424
|
+
}
|
|
425
|
+
if (bAuthCode) {
|
|
426
|
+
formData.append('code', authCode);
|
|
427
|
+
formData.append('redirect_uri', redirectUri);
|
|
428
|
+
if (!noPKCE) {
|
|
429
|
+
formData.append('code_verifier', codeVerifier);
|
|
430
|
+
}
|
|
431
|
+
} else if (sessionIndex) {
|
|
432
|
+
formData.append('session_index', sessionIndex);
|
|
433
|
+
}
|
|
434
|
+
/* eslint-enable camelcase */
|
|
435
|
+
if (grantType === 'customBearer' && customTokenParams) {
|
|
436
|
+
Object.keys(customTokenParams).forEach((param) => {
|
|
437
|
+
formData.append(param, customTokenParams[param]);
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
if (grantType !== 'authCode') {
|
|
441
|
+
formData.append('enable_psyncId', 'true');
|
|
442
|
+
}
|
|
443
|
+
if (grantType === 'passwordCreds') {
|
|
444
|
+
formData.append('username', userIdentifier);
|
|
445
|
+
formData.append('password', atob(password));
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
return fetch(tokenUri, {
|
|
449
|
+
agent: this.#getAgent(),
|
|
450
|
+
method: 'POST',
|
|
451
|
+
headers: new Headers({
|
|
452
|
+
'content-type': this.urlencoded
|
|
453
|
+
}),
|
|
454
|
+
|
|
455
|
+
body: formData.toString()
|
|
456
|
+
})
|
|
457
|
+
.then((response) => response.json())
|
|
458
|
+
.then((token) => {
|
|
459
|
+
if (token.errors || token.error) {
|
|
460
|
+
console.error(`Token endpoint error: ${JSON.stringify(token.errors || token.error)}`);
|
|
461
|
+
} else {
|
|
462
|
+
// .expires_in contains the # of seconds before access token expires
|
|
463
|
+
// add property to keep track of current time when the token expires
|
|
464
|
+
token.eA = Date.now() + token.expires_in * 1000;
|
|
465
|
+
if (this.config.codeVerifier) {
|
|
466
|
+
delete this.config.codeVerifier;
|
|
467
|
+
}
|
|
468
|
+
// If there is a session_index then move this to the peConfig structure (as used on authorize)
|
|
469
|
+
if (token.session_index) {
|
|
470
|
+
this.config.sessionIndex = token.session_index;
|
|
471
|
+
}
|
|
472
|
+
// If we got a token and have a session index, then reset the sessionIndexAttempts
|
|
473
|
+
if (this.config.sessionIndex) {
|
|
474
|
+
this.config.sessionIndexAttempts = 0;
|
|
475
|
+
}
|
|
476
|
+
this.#updateConfig();
|
|
477
|
+
}
|
|
478
|
+
return token;
|
|
479
|
+
})
|
|
480
|
+
.catch((e) => {
|
|
481
|
+
console.error(`Token endpoint error: ${e}`);
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/* eslint-disable camelcase */
|
|
486
|
+
async refreshToken(refresh_token) {
|
|
487
|
+
const { clientId, clientSecret, tokenUri } = this.config;
|
|
488
|
+
|
|
489
|
+
if (this.isNode && !this.crypto) {
|
|
490
|
+
// Deferring dynamic loading of node libraries til this first method to avoid doing this in constructor
|
|
491
|
+
await this.#importNodeLibs();
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
const formData = new URLSearchParams();
|
|
495
|
+
formData.append('client_id', clientId);
|
|
496
|
+
if (clientSecret) {
|
|
497
|
+
formData.append('client_secret', clientSecret);
|
|
498
|
+
}
|
|
499
|
+
formData.append('grant_type', 'refresh_token');
|
|
500
|
+
formData.append('refresh_token', refresh_token);
|
|
501
|
+
|
|
502
|
+
return fetch(tokenUri, {
|
|
503
|
+
agent: this.#getAgent(),
|
|
504
|
+
method: 'POST',
|
|
505
|
+
headers: new Headers({
|
|
506
|
+
'content-type': this.urlencoded
|
|
507
|
+
}),
|
|
508
|
+
|
|
509
|
+
body: formData.toString()
|
|
510
|
+
})
|
|
511
|
+
.then((response) => {
|
|
512
|
+
if (!response.ok && response.status === 401) {
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
return response.json();
|
|
516
|
+
})
|
|
517
|
+
.then((token) => {
|
|
518
|
+
if (token) {
|
|
519
|
+
// .expires_in contains the # of seconds before access token expires
|
|
520
|
+
// add property to keep track of current time when the token expires
|
|
521
|
+
token.eA = Date.now() + token.expires_in * 1000;
|
|
522
|
+
}
|
|
523
|
+
return token;
|
|
524
|
+
})
|
|
525
|
+
.catch((e) => {
|
|
526
|
+
console.warn(`Refresh token failed: ${e}`);
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
async revokeTokens(access_token, refresh_token = null) {
|
|
531
|
+
if (Object.keys(this.config).length === 0) {
|
|
532
|
+
// Must have a config structure to proceed
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
const { clientId, clientSecret, revokeUri } = this.config;
|
|
536
|
+
|
|
537
|
+
if (this.isNode && !this.crypto) {
|
|
538
|
+
// Deferring dynamic loading of node libraries til this first method to avoid doing this in constructor
|
|
539
|
+
await this.#importNodeLibs();
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const hdrs = { 'content-type': this.urlencoded };
|
|
543
|
+
if (clientSecret) {
|
|
544
|
+
const basicCreds = btoa(`${clientId}:${clientSecret}`);
|
|
545
|
+
hdrs.authorization = `Basic ${basicCreds}`;
|
|
546
|
+
}
|
|
547
|
+
const aTknProps = ['access_token'];
|
|
548
|
+
if (refresh_token) {
|
|
549
|
+
aTknProps.push('refresh_token');
|
|
550
|
+
}
|
|
551
|
+
aTknProps.forEach((prop) => {
|
|
552
|
+
const formData = new URLSearchParams();
|
|
553
|
+
if (!clientSecret) {
|
|
554
|
+
formData.append('client_id', clientId);
|
|
555
|
+
}
|
|
556
|
+
formData.append('token', prop === 'access_token' ? access_token : refresh_token);
|
|
557
|
+
formData.append('token_type_hint', prop);
|
|
558
|
+
fetch(revokeUri, {
|
|
559
|
+
agent: this.#getAgent(),
|
|
560
|
+
method: 'POST',
|
|
561
|
+
headers: new Headers(hdrs),
|
|
562
|
+
body: formData.toString()
|
|
563
|
+
})
|
|
564
|
+
.then((response) => {
|
|
565
|
+
if (!response.ok) {
|
|
566
|
+
console.error(`Error revoking ${prop}:${response.status}`);
|
|
567
|
+
}
|
|
568
|
+
})
|
|
569
|
+
.catch((e) => {
|
|
570
|
+
console.error(`Error revoking ${prop}`);
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
// Also clobber any sessionIndex
|
|
574
|
+
if (this.config.sessionIndex) {
|
|
575
|
+
delete this.config.sessionIndex;
|
|
576
|
+
this.#updateConfig();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
/* eslint-enable camelcase */
|
|
580
|
+
|
|
581
|
+
#sha256Hash(str) {
|
|
582
|
+
// Found that the Node implementation of subtle.digest is yielding incorrect results
|
|
583
|
+
// so using a different set of apis to get expected results.
|
|
584
|
+
if (this.isNode) {
|
|
585
|
+
return new Promise((resolve) => {
|
|
586
|
+
return resolve(this.crypto.createHash('sha256').update(str).digest());
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
return this.subtle.digest('SHA-256', new TextEncoder().encode(str));
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// Base64 encode
|
|
593
|
+
#encode64(buff) {
|
|
594
|
+
return btoa(new Uint8Array(buff).reduce((s, b) => s + String.fromCharCode(b), ''));
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/*
|
|
598
|
+
* Base64 url safe encoding of an array
|
|
599
|
+
*/
|
|
600
|
+
#base64UrlSafeEncode(buf) {
|
|
601
|
+
return this.#encode64(buf).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/* Calc code verifier if necessary
|
|
605
|
+
*/
|
|
606
|
+
/* eslint-disable camelcase */
|
|
607
|
+
async #getCodeChallenge(code_verifier) {
|
|
608
|
+
return this.#sha256Hash(code_verifier)
|
|
609
|
+
.then((hashed) => {
|
|
610
|
+
return this.#base64UrlSafeEncode(hashed);
|
|
611
|
+
})
|
|
612
|
+
.catch((error) => {
|
|
613
|
+
console.error(`Error calculation code challenge for PKCE: ${error}`);
|
|
614
|
+
})
|
|
615
|
+
.finally(() => {
|
|
616
|
+
return null;
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
/* eslint-enable camelcase */
|
|
620
|
+
|
|
621
|
+
/*
|
|
622
|
+
* Return agent value for POST commands
|
|
623
|
+
*/
|
|
624
|
+
#getAgent() {
|
|
625
|
+
if (this.isNode && this.config.ignoreInvalidCerts) {
|
|
626
|
+
let options = {rejectUnauthorized: false};
|
|
627
|
+
if (this.config.legacyTLS) {
|
|
628
|
+
options.secureOptions = this.crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT;
|
|
629
|
+
}
|
|
630
|
+
return new this.https.Agent(options);
|
|
631
|
+
} else {
|
|
632
|
+
return undefined;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export default PegaAuth;
|