@pega/dx-component-builder-sdk 0.1.47 → 0.1.49
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 +3 -2
- package/src/auth.js +726 -508
- package/src/cli.js +1 -1
- package/src/constants.js +728 -2
- package/src/tasks/authenticate/index.js +12 -2
- package/src/tasks/build/helper.js +10 -6
- package/src/tasks/build/index.js +76 -22
- package/src/tasks/build-all/helper.js +16 -11
- package/src/tasks/build-all/index.js +106 -42
- package/src/tasks/bundle/{builder → builderAngular}/paths.js +3 -2
- package/src/tasks/bundle/builderAngular/webpack.config.js +342 -0
- package/src/tasks/bundle/builderAssociated/index.js +218 -0
- package/src/tasks/bundle/builderAssociated/modules.js +139 -0
- package/src/tasks/bundle/builderAssociated/paths.js +51 -0
- package/src/tasks/bundle/{builder → builderAssociated}/webpack.config.js +5 -4
- package/src/tasks/bundle/builderReact/index.js +218 -0
- package/src/tasks/bundle/builderReact/modules.js +139 -0
- package/src/tasks/bundle/builderReact/paths.js +51 -0
- package/src/tasks/bundle/builderReact/webpack.config.js +337 -0
- package/src/tasks/bundle/index.js +122 -5
- package/src/tasks/create/index.js +54 -12
- package/src/tasks/create/templates/Constellation/field/Boolean/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Date/DateFormatter.js.mustache +7 -7
- package/src/tasks/create/templates/Constellation/field/Date/date.js.mustache +8 -8
- package/src/tasks/create/templates/Constellation/field/Date/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/DateTime/date-time.js.mustache +10 -10
- package/src/tasks/create/templates/Constellation/field/DateTime/date-utils.js.mustache +6 -5
- package/src/tasks/create/templates/Constellation/field/DateTime/date.js.mustache +6 -3
- package/src/tasks/create/templates/Constellation/field/DateTime/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Decimal/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.jsx.mustache +4 -4
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Integer/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Integer/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Picklist/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Email/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Input/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Paragraph/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Phone/index.jsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/field/Text-Phone/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-URL/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/TimeOfDay/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/time-of-day.js.mustache +6 -5
- package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.jsx.mustache +20 -6
- package/src/tasks/create/templates/Constellation/template/DETAILS/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS/mock.stories.js.mustache +20 -10
- package/src/tasks/create/templates/Constellation/template/DETAILS/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/demo.stories.jsx.mustache +20 -7
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/mock.stories.js.mustache +28 -13
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/FORM/demo.stories.jsx.mustache +92 -16
- package/src/tasks/create/templates/Constellation/template/FORM/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/FORM/mock.stories.js.mustache +24 -12
- package/src/tasks/create/templates/Constellation/template/FORM/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/FORM-region/demo.stories.jsx.mustache +91 -13
- package/src/tasks/create/templates/Constellation/template/FORM-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/FORM-region/mock.stories.js.mustache +24 -12
- package/src/tasks/create/templates/Constellation/template/FORM-region/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/template/PAGE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/CASE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/PAGE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Operator.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +42 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.scss.mustache +24 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +165 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/config.json.mustache +87 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/demo.stories.jsx.mustache +56 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/mock.stories.js.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/config.json.mustache +147 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.html.mustache +35 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +209 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/config.json.mustache +204 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +177 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/config.json.mustache +94 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.html.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +170 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/config.json.mustache +125 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +175 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/config.json.mustache +94 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +176 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/config.json.mustache +88 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +180 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/config.json.mustache +86 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.scss.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +195 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.html.mustache +17 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.scss.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +145 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +175 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +177 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +179 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/config.json.mustache +95 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.scss.mustache +81 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +194 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/config.json.mustache +111 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.spec.ts.mustache +26 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +174 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +172 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/config.json.mustache +21 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/demo.stories.jsx.mustache +71 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.html.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.scss.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +121 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/mock.stories.js.mustache +294 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/TwoColumnDetails.svg +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/demo.stories.jsx.mustache +73 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.html.mustache +6 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.scss.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +92 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/mock.stories.js.mustache +290 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/demo.stories.jsx.mustache +215 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.html.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.scss.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +71 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/config.json.mustache +49 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/demo.stories.jsx.mustache +183 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.html.mustache +16 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +26 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.stories.js.mustache +132 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/OneColumnPage.svg +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/config.json.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/demo.stories.jsx.mustache +80 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/mock.stories.js.mustache +115 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.html.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.scss.mustache +3 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +63 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.html.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.scss.mustache +22 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.ts.mustache +111 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/demo.stories.jsx.mustache +70 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/mock.stories.js.mustache +390 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/demo.stories.jsx.mustache +29 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/mock.stories.js.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.html.mustache +17 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.scss.mustache +19 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.ts.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/pagecomponent.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/config.json.mustache +66 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/demo.stories.jsx.mustache +52 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/mock.stories.js.mustache +52 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.html.mustache +28 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.scss.mustache +137 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +115 -0
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -7
- package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.jsx.mustache +5 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +78 -28
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Picklist/demo.stories.jsx.mustache +13 -0
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +30 -10
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +6 -5
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +11 -0
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/config.json.mustache +135 -0
- package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/index.tsx.mustache +12 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +7 -3
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +30 -20
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.jsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +4 -3
- package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +7 -7
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.jsx.mustache +2 -10
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +138 -36
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/mock.stories.js.mustache +1 -1
- package/src/tasks/create-all/index.js +112 -56
- package/src/tasks/delete/helper.js +88 -24
- package/src/tasks/delete/index.js +17 -8
- package/src/tasks/delete-all/helper.js +88 -25
- package/src/tasks/delete-all/index.js +15 -6
- package/src/tasks/list/helper.js +2 -3
- package/src/tasks/list/index.js +14 -7
- package/src/tasks/map/map.js +212 -20
- package/src/tasks/map-all/index.js +19 -2
- package/src/tasks/override/index.js +140 -79
- package/src/tasks/override-all/index.js +54 -6
- package/src/tasks/publish/helper.js +94 -51
- package/src/tasks/publish/index.js +87 -34
- package/src/tasks/publish-all/helper.js +97 -58
- package/src/tasks/publish-all/index.js +127 -48
- package/src/tasks/rename/index.js +184 -111
- package/src/tasks/validator/index.js +31 -7
- package/src/util.js +187 -39
- package/src/tasks/create/templates/Constellation/field/TimeofDay/styles.js.mustache +0 -7
- /package/src/tasks/bundle/{builder → builderAngular}/index.js +0 -0
- /package/src/tasks/bundle/{builder → builderAngular}/modules.js +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/index.jsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/suggestions-handler.js +0 -0
- /package/src/tasks/create/templates/{SDK-React/field/TimeofDay → SDK-Angular/field/TimeOfDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/styles.js.mustache +0 -0
|
@@ -9,12 +9,14 @@ import {
|
|
|
9
9
|
COMPONENT_SCHEMA,
|
|
10
10
|
CATEGORY_CUSTOM,
|
|
11
11
|
CATEGORY_OVERRIDE } from '../../constants.js';
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
import {
|
|
14
14
|
getComponentDirectoryPath,
|
|
15
15
|
getComponents,
|
|
16
16
|
getOOTBComponents,
|
|
17
|
-
removeComponentPrefix
|
|
17
|
+
removeComponentPrefix,
|
|
18
|
+
getFramework,
|
|
19
|
+
getLocalComponentKeyFromConfig} from '../../util.js';
|
|
18
20
|
|
|
19
21
|
const ajv = new Ajv({ allErrors: true });
|
|
20
22
|
|
|
@@ -34,7 +36,7 @@ const allowedOverrideSubtypes = [
|
|
|
34
36
|
...COMPONENT_SCHEMA.subtype.field.map(({ value }) => value),
|
|
35
37
|
...COMPONENT_SCHEMA.subtype.template.map(({ value }) => value),
|
|
36
38
|
...COMPONENT_SCHEMA.subtype.widget.map(({ value }) => value)
|
|
37
|
-
]), "ACTION", "DATA_CAPTURE", "SUMMARY", "CASEVIEW", "DATAVIEW", "LIST"
|
|
39
|
+
]), "ACTION", "DATA_CAPTURE", "SUMMARY", "CASEVIEW", "DATAVIEW", "LIST", "TAB"
|
|
38
40
|
];
|
|
39
41
|
|
|
40
42
|
const schema = {
|
|
@@ -312,12 +314,14 @@ const overrideSchema = {
|
|
|
312
314
|
};
|
|
313
315
|
|
|
314
316
|
const validateSchema = ajv.compile(schema);
|
|
315
|
-
const
|
|
317
|
+
const validateOverrideSchema = ajv.compile(overrideSchema);
|
|
316
318
|
|
|
317
319
|
|
|
318
320
|
|
|
319
321
|
export default async (option, category = CATEGORY_CUSTOM) => {
|
|
320
322
|
let componentToValidate = null;
|
|
323
|
+
const framework = await getFramework();
|
|
324
|
+
|
|
321
325
|
if (option.params && option.params[3]) {
|
|
322
326
|
componentToValidate = option.params[3];
|
|
323
327
|
} else if (option && option.task === 'validateSchema') {
|
|
@@ -352,7 +356,7 @@ export default async (option, category = CATEGORY_CUSTOM) => {
|
|
|
352
356
|
}
|
|
353
357
|
else if (category === CATEGORY_OVERRIDE) {
|
|
354
358
|
// for now, if now file just end
|
|
355
|
-
console.log(`${chalk.bold.yellow('Config file not
|
|
359
|
+
console.log(`${chalk.bold.yellow('Config file not available for: ' + componentToValidate)}`);
|
|
356
360
|
return;
|
|
357
361
|
}
|
|
358
362
|
}
|
|
@@ -360,15 +364,29 @@ export default async (option, category = CATEGORY_CUSTOM) => {
|
|
|
360
364
|
//const data = JSON.parse(fs.readFileSync(path.resolve(configFile), 'utf8'));
|
|
361
365
|
const data = JSON.parse(configData);
|
|
362
366
|
|
|
363
|
-
const valid = (category === CATEGORY_OVERRIDE) ?
|
|
367
|
+
const valid = (category === CATEGORY_OVERRIDE) ? validateOverrideSchema(data) : validateSchema(data);
|
|
364
368
|
|
|
365
369
|
if (valid) {
|
|
366
370
|
|
|
367
371
|
// need to remove path
|
|
372
|
+
const originalComponentToValidate = componentToValidate;
|
|
368
373
|
componentToValidate = removeComponentPrefix(componentToValidate);
|
|
369
374
|
|
|
370
375
|
// don't check for out the box if override
|
|
371
376
|
if (category != CATEGORY_OVERRIDE) {
|
|
377
|
+
|
|
378
|
+
// we are validating the component name, not the actual component
|
|
379
|
+
// so need to get the component name (or key) from config.json
|
|
380
|
+
switch(framework) {
|
|
381
|
+
case "SDK-Angular":
|
|
382
|
+
componentToValidate = await getLocalComponentKeyFromConfig(originalComponentToValidate);
|
|
383
|
+
break;
|
|
384
|
+
case "SDK-React":
|
|
385
|
+
break;
|
|
386
|
+
case "SDK-WebComponents":
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
|
|
372
390
|
if (
|
|
373
391
|
componentToValidate &&
|
|
374
392
|
!/^[A-Za-z0-9]+_[A-Za-z0-9]+_[A-Za-z0-9]+$/.test(componentToValidate)
|
|
@@ -383,6 +401,12 @@ export default async (option, category = CATEGORY_CUSTOM) => {
|
|
|
383
401
|
|
|
384
402
|
console.log(`${chalk.bold.green(componentToValidate)} schema is valid`);
|
|
385
403
|
} else {
|
|
386
|
-
|
|
404
|
+
if (category === CATEGORY_OVERRIDE) {
|
|
405
|
+
throw new Error(`Invalid: ${ajv.errorsText(validateOverrideSchema.errors)}`);
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
throw new Error(`Invalid: ${ajv.errorsText(validateSchema.errors)}`);
|
|
409
|
+
}
|
|
410
|
+
|
|
387
411
|
}
|
|
388
412
|
};
|
package/src/util.js
CHANGED
|
@@ -4,15 +4,18 @@ import { join } from 'path';
|
|
|
4
4
|
import { promisify } from 'util';
|
|
5
5
|
import https from 'https';
|
|
6
6
|
import inquirer from 'inquirer';
|
|
7
|
+
import crypto from 'node:crypto';
|
|
7
8
|
import { createRequire } from "module";
|
|
8
9
|
|
|
9
10
|
import chalk from 'chalk';
|
|
10
11
|
import mustache from 'mustache';
|
|
11
12
|
import pascalCase from 'pascalcase';
|
|
12
13
|
import fetch from 'node-fetch';
|
|
14
|
+
import kebabcase from 'kebab-case';
|
|
13
15
|
|
|
14
16
|
import {
|
|
15
|
-
|
|
17
|
+
REACT_COMPONENTS_DIRECTORY_PATH,
|
|
18
|
+
ANGULAR_COMPONENTS_DIRECTORY_PATH,
|
|
16
19
|
SDK_CONFIG_JSON_FILENAME,
|
|
17
20
|
DXCB_CONFIG,
|
|
18
21
|
DXCB_PUBLISH_ACCESS,
|
|
@@ -42,11 +45,16 @@ import {
|
|
|
42
45
|
|
|
43
46
|
export const DXCB_CONFIG_INTERNAL_JSON_FILENAME = 'src/dxcb.config.json';
|
|
44
47
|
|
|
48
|
+
let componentsDirectoryPath = "";
|
|
49
|
+
let framework = "";
|
|
50
|
+
|
|
45
51
|
const access = promisify(fs.access);
|
|
46
52
|
|
|
47
53
|
export const checkPathAccess = async (path, options = {}) => {
|
|
48
54
|
const { errorMessage } = options;
|
|
49
55
|
|
|
56
|
+
await updateComponentsDirectoryPath();
|
|
57
|
+
|
|
50
58
|
try {
|
|
51
59
|
await access(path, fs.constants.R_OK);
|
|
52
60
|
} catch (err) {
|
|
@@ -57,6 +65,27 @@ export const checkPathAccess = async (path, options = {}) => {
|
|
|
57
65
|
}
|
|
58
66
|
};
|
|
59
67
|
|
|
68
|
+
export const updateComponentsDirectoryPath = async () => {
|
|
69
|
+
|
|
70
|
+
if (framework === "") {
|
|
71
|
+
framework = await getFramework();
|
|
72
|
+
|
|
73
|
+
switch (framework) {
|
|
74
|
+
case "SDK-Angular":
|
|
75
|
+
componentsDirectoryPath = ANGULAR_COMPONENTS_DIRECTORY_PATH;
|
|
76
|
+
break;
|
|
77
|
+
case "SDK-React":
|
|
78
|
+
componentsDirectoryPath = REACT_COMPONENTS_DIRECTORY_PATH;
|
|
79
|
+
break;
|
|
80
|
+
case "SDK-WebComponents":
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
60
89
|
export const visualLCCategory = (category) => {
|
|
61
90
|
|
|
62
91
|
switch (category) {
|
|
@@ -70,13 +99,68 @@ export const visualLCCategory = (category) => {
|
|
|
70
99
|
return category.toLowerCase();
|
|
71
100
|
}
|
|
72
101
|
|
|
102
|
+
let componentFramework = "";
|
|
103
|
+
|
|
73
104
|
export const getFramework = async () => {
|
|
74
|
-
const pegaConfigInternalJsonPath = path.join(path.resolve(), DXCB_CONFIG_INTERNAL_JSON_FILENAME);
|
|
75
105
|
|
|
76
|
-
|
|
77
|
-
|
|
106
|
+
if ( componentFramework === "") {
|
|
107
|
+
const pegaConfigInternalJsonPath = path.join(path.resolve(), DXCB_CONFIG_INTERNAL_JSON_FILENAME);
|
|
108
|
+
|
|
109
|
+
let internalData = fs.readFileSync(pegaConfigInternalJsonPath, { encoding: 'utf8' });
|
|
110
|
+
internalData = internalData && JSON.parse(internalData);
|
|
111
|
+
componentFramework = internalData.sdkType;
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return componentFramework
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const getLocalComponentConfig = async (componentKey, category = CATEGORY_CUSTOM) => {
|
|
119
|
+
|
|
120
|
+
if (category != "custom") {
|
|
121
|
+
return "";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
let configJSON = null;
|
|
125
|
+
const currentDirectory = process.cwd();
|
|
126
|
+
const pegaConfigJsonPath = join(currentDirectory, SDK_CONFIG_JSON_FILENAME);
|
|
127
|
+
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase() + COMPONENT_DIRECTORY_SUFFIX_SDK);
|
|
128
|
+
|
|
129
|
+
await checkPathAccess(pegaConfigJsonPath);
|
|
130
|
+
|
|
131
|
+
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
132
|
+
data = JSON.parse(data);
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
const directory = join(currentDirectory, componentsDirectoryPath, categoryDirectory, componentKey);
|
|
136
|
+
|
|
137
|
+
// test for the directory
|
|
138
|
+
if (fs.existsSync(directory)) {
|
|
139
|
+
|
|
140
|
+
// get config.json if exists
|
|
141
|
+
const configJsonPath = join(directory, "config.json");
|
|
142
|
+
|
|
143
|
+
if (fs.existsSync(configJsonPath)) {
|
|
144
|
+
let data = fs.readFileSync(configJsonPath, { encoding: 'utf8'});
|
|
145
|
+
configJSON = JSON.parse(data);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
}
|
|
78
149
|
|
|
79
|
-
return
|
|
150
|
+
return configJSON;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export const getLocalComponentKeyFromConfig = async (folderName, category) => {
|
|
154
|
+
|
|
155
|
+
const configJSON = await getLocalComponentConfig(folderName, category);
|
|
156
|
+
if (typeof(configJSON) == 'object') {
|
|
157
|
+
return configJSON.componentKey;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
return "";
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
80
164
|
}
|
|
81
165
|
|
|
82
166
|
export const deleteLocalComponent = async (componentKey, category = CATEGORY_CUSTOM) => {
|
|
@@ -90,7 +174,7 @@ export const deleteLocalComponent = async (componentKey, category = CATEGORY_CUS
|
|
|
90
174
|
data = JSON.parse(data);
|
|
91
175
|
|
|
92
176
|
|
|
93
|
-
const directory = join(currentDirectory,
|
|
177
|
+
const directory = join(currentDirectory, componentsDirectoryPath, categoryDirectory, componentKey);
|
|
94
178
|
|
|
95
179
|
// test for the directory
|
|
96
180
|
if (fs.existsSync(directory)) {
|
|
@@ -112,14 +196,25 @@ export const deleteLocalComponent = async (componentKey, category = CATEGORY_CUS
|
|
|
112
196
|
}
|
|
113
197
|
};
|
|
114
198
|
|
|
199
|
+
export const getHttpsAgent = (serverConfig) => {
|
|
200
|
+
const agentOptions = { rejectUnauthorized: false };
|
|
201
|
+
if (serverConfig.legacyTLS) {
|
|
202
|
+
agentOptions.secureOptions = crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT;
|
|
203
|
+
}
|
|
204
|
+
return new https.Agent(agentOptions);
|
|
205
|
+
};
|
|
206
|
+
|
|
115
207
|
export const deleteServerComponent = async componentKey => {
|
|
116
|
-
const
|
|
208
|
+
const serverConfig = await getPegaServerConfig();
|
|
209
|
+
const { server, user, password } = serverConfig;
|
|
117
210
|
const url = constructCompleteUrl(server, DELETE_COMPONENT_SERVICE_REST_ENDPOINT);
|
|
118
211
|
const [componentName, rulesetName, rulesetVersion] = componentKey.split('~|~');
|
|
119
212
|
const deleteUrl = `${url}/${componentName}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
|
|
120
213
|
try {
|
|
121
214
|
const OauthData = fs.readFileSync(TOKEN_PATH, 'utf8');
|
|
122
215
|
|
|
216
|
+
let status = 500;
|
|
217
|
+
|
|
123
218
|
if (OauthData) {
|
|
124
219
|
const {
|
|
125
220
|
access_token: accessToken,
|
|
@@ -128,12 +223,15 @@ export const deleteServerComponent = async componentKey => {
|
|
|
128
223
|
} = JSON.parse(OauthData);
|
|
129
224
|
fetch(deleteUrl, {
|
|
130
225
|
method: 'DELETE',
|
|
131
|
-
agent:
|
|
226
|
+
agent: getHttpsAgent(serverConfig),
|
|
132
227
|
headers: {
|
|
133
228
|
Authorization: `${tokenType} ${accessToken}`
|
|
134
229
|
}
|
|
135
230
|
})
|
|
136
|
-
.then(response =>
|
|
231
|
+
.then(response => {
|
|
232
|
+
status = response.status;
|
|
233
|
+
return response.text();
|
|
234
|
+
})
|
|
137
235
|
.then(resp => {
|
|
138
236
|
const respData = JSON.parse(resp);
|
|
139
237
|
if (respData.status == 200) {
|
|
@@ -142,7 +240,21 @@ export const deleteServerComponent = async componentKey => {
|
|
|
142
240
|
throw new Error(`${respData.message}`);
|
|
143
241
|
}
|
|
144
242
|
})
|
|
145
|
-
.catch(e =>
|
|
243
|
+
.catch(e => {
|
|
244
|
+
if (status === 403) {
|
|
245
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
246
|
+
Promise.reject(
|
|
247
|
+
`${chalk.bold.red(
|
|
248
|
+
'Error forbidden: User does not have privileges to Delete.'
|
|
249
|
+
)}`
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
254
|
+
Promise.reject(`${chalk.bold.red(e)}`)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
});
|
|
146
258
|
}
|
|
147
259
|
} catch (error) {
|
|
148
260
|
console.log(`\n${chalk.bold.red(error)}`);
|
|
@@ -187,7 +299,7 @@ export const getOptionsSource = (options) => {
|
|
|
187
299
|
return sourceType;
|
|
188
300
|
}
|
|
189
301
|
|
|
190
|
-
export const getComponents = async (showSeparator = false, category = CATEGORY_CUSTOM) => {
|
|
302
|
+
export const getComponents = async (showSeparator = false, category = CATEGORY_CUSTOM, isName = true) => {
|
|
191
303
|
const currentDirectory = process.cwd();
|
|
192
304
|
const pegaConfigJsonPath = join(currentDirectory, SDK_CONFIG_JSON_FILENAME);
|
|
193
305
|
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase() + COMPONENT_DIRECTORY_SUFFIX_SDK);
|
|
@@ -197,16 +309,29 @@ export const getComponents = async (showSeparator = false, category = CATEGORY_C
|
|
|
197
309
|
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
198
310
|
data = JSON.parse(data);
|
|
199
311
|
|
|
200
|
-
const directory = join(currentDirectory,
|
|
312
|
+
const directory = join(currentDirectory, componentsDirectoryPath, categoryDirectory);
|
|
201
313
|
let compList = new Array();
|
|
202
314
|
|
|
203
315
|
switch (category) {
|
|
204
316
|
case CATEGORY_CUSTOM:
|
|
205
317
|
case CATEGORY_CONSTELLATION:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
318
|
+
let fieldComps;
|
|
319
|
+
let templateComps;
|
|
320
|
+
let widgetComps
|
|
321
|
+
|
|
322
|
+
if (isName) {
|
|
323
|
+
// this is new (better) way, where we ALWAYS have the Pascal case, even when the file is in another case, like Kabab
|
|
324
|
+
// keeping all in Pascal case makes display same for different SDKs and is the case that the customer typed in
|
|
325
|
+
fieldComps = await getSubComponentsName(directory, FIELD_PATH);
|
|
326
|
+
templateComps = await getSubComponentsName(directory, TEMPLATE_PATH);
|
|
327
|
+
widgetComps = await getSubComponentsName(directory, WIDGET_PATH);
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
// this is the old way, were we get the actual name from the file (for Angular this is Kabab case)
|
|
331
|
+
fieldComps = await getSubComponents(directory, FIELD_PATH);
|
|
332
|
+
templateComps = await getSubComponents(directory, TEMPLATE_PATH);
|
|
333
|
+
widgetComps = await getSubComponents(directory, WIDGET_PATH);
|
|
334
|
+
}
|
|
210
335
|
|
|
211
336
|
|
|
212
337
|
if (fieldComps.length > 0) {
|
|
@@ -275,6 +400,24 @@ export const getSubComponents = async (directory, type) => {
|
|
|
275
400
|
.map(dirent => dirent.name);
|
|
276
401
|
}
|
|
277
402
|
|
|
403
|
+
export const getSubComponentsName = async (directory, type) => {
|
|
404
|
+
|
|
405
|
+
const subDirectory = join(directory, type);
|
|
406
|
+
const directoryList = fs.readdirSync(subDirectory, { withFileTypes: true })
|
|
407
|
+
.filter(dirent => dirent.isDirectory());
|
|
408
|
+
|
|
409
|
+
let componentList = new Array();
|
|
410
|
+
|
|
411
|
+
for ( let i =0; i < directoryList.length; i++) {
|
|
412
|
+
const directoryObj = directoryList[i];
|
|
413
|
+
const configJSON = await getLocalComponentConfig(join(type, directoryObj.name));
|
|
414
|
+
componentList.push(configJSON['componentKey']);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return componentList;
|
|
418
|
+
|
|
419
|
+
}
|
|
420
|
+
|
|
278
421
|
|
|
279
422
|
export const getDirectoryFiles = async (directory) => {
|
|
280
423
|
return fs
|
|
@@ -294,14 +437,14 @@ export const getComponentsObj = async (showSeparator = false, category = CATEGOR
|
|
|
294
437
|
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
295
438
|
data = JSON.parse(data);
|
|
296
439
|
|
|
297
|
-
const directory = join(currentDirectory,
|
|
440
|
+
const directory = join(currentDirectory, componentsDirectoryPath, categoryDirectory);
|
|
298
441
|
let compList = new Array();
|
|
299
442
|
|
|
300
443
|
switch (category) {
|
|
301
444
|
case CATEGORY_CUSTOM:
|
|
302
|
-
const fieldComps = await
|
|
303
|
-
const templateComps = await
|
|
304
|
-
const widgetComps = await
|
|
445
|
+
const fieldComps = await getSubComponentsName(directory, FIELD_PATH);
|
|
446
|
+
const templateComps = await getSubComponentsName(directory, TEMPLATE_PATH);
|
|
447
|
+
const widgetComps = await getSubComponentsName(directory, WIDGET_PATH);
|
|
305
448
|
|
|
306
449
|
if (fieldComps.length > 0) {
|
|
307
450
|
if (showSeparator) compList.push(new inquirer.Separator("---- fields ----"));
|
|
@@ -447,7 +590,7 @@ export const getComponentsAndSubDirectory = async (category = CATEGORY_CUSTOM) =
|
|
|
447
590
|
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
448
591
|
data = JSON.parse(data);
|
|
449
592
|
|
|
450
|
-
const directory = join(currentDirectory,
|
|
593
|
+
const directory = join(currentDirectory, componentsDirectoryPath, categoryDirectory);
|
|
451
594
|
|
|
452
595
|
const fieldComps = await getSubComponentsAndDir(directory, FIELD_PATH);
|
|
453
596
|
const templateComps = await getSubComponentsAndDir(directory, TEMPLATE_PATH);
|
|
@@ -516,7 +659,7 @@ export const getComponentDirectoryPath = async (componentKey, category = CATEGOR
|
|
|
516
659
|
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
517
660
|
data = JSON.parse(data);
|
|
518
661
|
|
|
519
|
-
return join(currentDirectory,
|
|
662
|
+
return join(currentDirectory, componentsDirectoryPath, categoryDirectory, componentKey);
|
|
520
663
|
};
|
|
521
664
|
|
|
522
665
|
|
|
@@ -533,24 +676,28 @@ export const convertIntoPascalCase = string => {
|
|
|
533
676
|
return pascalCase(string);
|
|
534
677
|
};
|
|
535
678
|
|
|
536
|
-
export const
|
|
537
|
-
|
|
538
|
-
|
|
679
|
+
export const convertIntoKebabCase = string => {
|
|
680
|
+
let kCase = kebabcase(string);
|
|
681
|
+
if (kCase.length > 0 && string.length > 0) {
|
|
682
|
+
if (kCase[0] == '-' && string[0] != '-') {
|
|
683
|
+
kCase = kCase.substring(1);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
539
686
|
|
|
540
|
-
export const nodeFetch = (url, config) => {
|
|
541
|
-
const { method, user, password, headers, ...restConfig } = config;
|
|
542
687
|
|
|
543
|
-
|
|
688
|
+
return kCase;
|
|
689
|
+
}
|
|
544
690
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
691
|
+
export const reverseKebabCase = string => {
|
|
692
|
+
if (string[0] != '-') {
|
|
693
|
+
string = "-".concat(string);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
return kebabcase.reverse(string);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export const constructCompleteUrl = (baseServer, endPoint) => {
|
|
700
|
+
return baseServer.endsWith('/') ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`;
|
|
554
701
|
};
|
|
555
702
|
|
|
556
703
|
export const sanitize = str => {
|
|
@@ -601,7 +748,8 @@ export const getOOTBComponents = async () => {
|
|
|
601
748
|
fs.readFile(OOTB_COMPONENTS, 'utf-8', async (err, data) => {
|
|
602
749
|
if (err) {
|
|
603
750
|
try {
|
|
604
|
-
const
|
|
751
|
+
const serverConfig = await getPegaServerConfig();
|
|
752
|
+
const { server } = serverConfig;
|
|
605
753
|
const url = constructCompleteUrl(server, OOTB_COMPONENT_SERVICE_REST_ENDPOINT);
|
|
606
754
|
const OauthData = fs.readFileSync(TOKEN_PATH, 'utf8');
|
|
607
755
|
if (OauthData) {
|
|
@@ -612,7 +760,7 @@ export const getOOTBComponents = async () => {
|
|
|
612
760
|
} = JSON.parse(OauthData);
|
|
613
761
|
fetch(url, {
|
|
614
762
|
method: 'GET',
|
|
615
|
-
agent:
|
|
763
|
+
agent: getHttpsAgent(serverConfig),
|
|
616
764
|
headers: {
|
|
617
765
|
Authorization: `${tokenType} ${accessToken}`
|
|
618
766
|
}
|
|
File without changes
|
|
File without changes
|
/package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/config.json.mustache
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/index.jsx.mustache
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache
RENAMED
|
File without changes
|
/package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/styles.js.mustache
RENAMED
|
File without changes
|