@pega/custom-dx-components 24.2.16 → 25.1.10-alpha-0.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.
Files changed (466) hide show
  1. package/package.json +37 -35
  2. package/src/cli.js +6 -0
  3. package/src/constants.js +11 -3
  4. package/src/tasks/authenticate/index.js +5 -0
  5. package/src/tasks/build-all/index.js +20 -1
  6. package/src/tasks/build-jest-assets/index.js +7 -8
  7. package/src/tasks/build-lib/helper.js +39 -20
  8. package/src/tasks/build-lib/index.js +40 -18
  9. package/src/tasks/create/index.js +5 -1
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +26 -0
  11. package/src/tasks/create/templates/Constellation/Field/Boolean/create-nonce.ts.mustache +1 -0
  12. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.test.tsx.mustache +19 -0
  13. package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +26 -0
  14. package/src/tasks/create/templates/Constellation/Field/Date/create-nonce.ts.mustache +1 -0
  15. package/src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache +0 -24
  16. package/src/tasks/create/templates/Constellation/Field/Date/demo.test.tsx.mustache +52 -0
  17. package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +26 -0
  18. package/src/tasks/create/templates/Constellation/Field/DateTime/create-nonce.ts.mustache +1 -0
  19. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +1 -0
  20. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.test.tsx.mustache +72 -0
  21. package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +26 -0
  22. package/src/tasks/create/templates/Constellation/Field/Decimal/create-nonce.ts.mustache +1 -0
  23. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.test.tsx.mustache +21 -0
  24. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +26 -0
  25. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/create-nonce.ts.mustache +1 -0
  26. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.test.tsx.mustache +23 -0
  27. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +26 -0
  28. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/create-nonce.ts.mustache +1 -0
  29. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.test.tsx.mustache +18 -0
  30. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/config.json.mustache +1 -0
  31. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/create-nonce.ts.mustache +1 -0
  32. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.test.tsx.mustache +27 -0
  33. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/localizations.json.mustache +10 -0
  34. package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +26 -0
  35. package/src/tasks/create/templates/Constellation/Field/Integer/create-nonce.ts.mustache +1 -0
  36. package/src/tasks/create/templates/Constellation/Field/Integer/demo.test.tsx.mustache +18 -0
  37. package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +26 -0
  38. package/src/tasks/create/templates/Constellation/Field/Picklist/create-nonce.ts.mustache +1 -0
  39. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.test.tsx.mustache +25 -0
  40. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/config.json.mustache +26 -0
  41. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/create-nonce.ts.mustache +1 -0
  42. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.test.tsx.mustache +33 -0
  43. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +7 -0
  44. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/localizations.json.mustache +5 -0
  45. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.ts.mustache +0 -4
  46. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/config.json.mustache +26 -0
  47. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/create-nonce.ts.mustache +1 -0
  48. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.test.tsx.mustache +29 -0
  49. package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +1 -0
  50. package/src/tasks/create/templates/Constellation/Field/Text/create-nonce.ts.mustache +1 -0
  51. package/src/tasks/create/templates/Constellation/Field/Text/demo.test.tsx.mustache +19 -0
  52. package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +26 -0
  53. package/src/tasks/create/templates/Constellation/Field/Text-Email/create-nonce.ts.mustache +1 -0
  54. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.test.tsx.mustache +20 -0
  55. package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +26 -0
  56. package/src/tasks/create/templates/Constellation/Field/Text-Input/create-nonce.ts.mustache +1 -0
  57. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.test.tsx.mustache +20 -0
  58. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +26 -0
  59. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/create-nonce.ts.mustache +1 -0
  60. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.test.tsx.mustache +21 -0
  61. package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +26 -0
  62. package/src/tasks/create/templates/Constellation/Field/Text-Phone/create-nonce.ts.mustache +1 -0
  63. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.test.tsx.mustache +23 -0
  64. package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +26 -0
  65. package/src/tasks/create/templates/Constellation/Field/Text-URL/create-nonce.ts.mustache +1 -0
  66. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.test.tsx.mustache +20 -0
  67. package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +26 -0
  68. package/src/tasks/create/templates/Constellation/Field/TimeofDay/create-nonce.ts.mustache +1 -0
  69. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.test.tsx.mustache +33 -0
  70. package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +1 -0
  71. package/src/tasks/create/templates/Constellation/Template/DETAILS/create-nonce.ts.mustache +1 -0
  72. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +1 -0
  73. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.test.tsx.mustache +47 -0
  74. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +1 -0
  75. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/create-nonce.ts.mustache +1 -0
  76. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.test.tsx.mustache +58 -0
  77. package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +1 -0
  78. package/src/tasks/create/templates/Constellation/Template/FORM/create-nonce.ts.mustache +1 -0
  79. package/src/tasks/create/templates/Constellation/Template/FORM/demo.test.tsx.mustache +40 -0
  80. package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +1 -0
  81. package/src/tasks/create/templates/Constellation/Template/FORM-region/create-nonce.ts.mustache +1 -0
  82. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.test.tsx.mustache +56 -0
  83. package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +1 -0
  84. package/src/tasks/create/templates/Constellation/Template/PAGE/create-nonce.ts.mustache +1 -0
  85. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -0
  86. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.test.tsx.mustache +24 -0
  87. package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +1 -0
  88. package/src/tasks/create/templates/Constellation/Widget/CASE/create-nonce.ts.mustache +1 -0
  89. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +1 -0
  90. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.test.tsx.mustache +28 -0
  91. package/src/tasks/create/templates/Constellation/Widget/CASE/localizations.json.mustache +8 -0
  92. package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +1 -0
  93. package/src/tasks/create/templates/Constellation/Widget/PAGE/create-nonce.ts.mustache +1 -0
  94. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +2 -0
  95. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.test.tsx.mustache +36 -0
  96. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +4 -1
  97. package/src/tasks/create/templates/Constellation/Widget/PAGE/localizations.json.mustache +10 -0
  98. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +1 -0
  99. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/create-nonce.ts.mustache +1 -0
  100. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +1 -0
  101. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.test.tsx.mustache +29 -0
  102. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/config.json.mustache +1 -0
  103. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/create-nonce.ts.mustache +1 -0
  104. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +1 -0
  105. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.test.tsx.mustache +27 -0
  106. package/src/tasks/create/templates/Launchpad/Widget/CASE/config.json.mustache +1 -0
  107. package/src/tasks/create/templates/Launchpad/Widget/CASE/create-nonce.ts.mustache +1 -0
  108. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +1 -0
  109. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.test.tsx.mustache +28 -0
  110. package/src/tasks/create/templates/Launchpad/Widget/PAGE/config.json.mustache +1 -0
  111. package/src/tasks/create/templates/Launchpad/Widget/PAGE/create-nonce.ts.mustache +1 -0
  112. package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +2 -0
  113. package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.test.tsx.mustache +36 -0
  114. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/config.json.mustache +1 -0
  115. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/create-nonce.ts.mustache +1 -0
  116. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.tsx.mustache +1 -0
  117. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.test.tsx.mustache +19 -0
  118. package/src/tasks/create-all/index.js +5 -1
  119. package/src/tasks/create-lib/helper.js +6 -2
  120. package/src/tasks/create-lib/index.js +18 -6
  121. package/src/tasks/create-version/helper.js +30 -0
  122. package/src/tasks/create-version/index.js +27 -8
  123. package/src/tasks/delete/helper.js +6 -2
  124. package/src/tasks/delete/index.js +5 -1
  125. package/src/tasks/delete-lib/helper.js +0 -1
  126. package/src/tasks/delete-lib/index.js +10 -11
  127. package/src/tasks/delete-pub/helper.js +142 -1
  128. package/src/tasks/delete-pub/index.js +75 -10
  129. package/src/tasks/delete-version/index.js +8 -2
  130. package/src/tasks/export-archive/helper.js +47 -3
  131. package/src/tasks/export-archive/index.js +70 -44
  132. package/src/tasks/import-archive/helper.js +249 -4
  133. package/src/tasks/import-archive/index.js +476 -40
  134. package/src/tasks/import-comp/helper.js +26 -3
  135. package/src/tasks/import-comp/index.js +78 -117
  136. package/src/tasks/index.js +1 -0
  137. package/src/tasks/init/template/.eslintrc.json +1 -1
  138. package/src/tasks/init/template/.storybook/{main.js → main.ts} +4 -3
  139. package/src/tasks/init/template/.storybook/manager.ts +6 -0
  140. package/src/tasks/init/template/.storybook/preview.tsx +4 -1
  141. package/src/tasks/init/template/.storybook/theme.js +1 -1
  142. package/src/tasks/init/template/babel.config.cjs +18 -9
  143. package/src/tasks/init/template/jest.config.cjs +29 -4
  144. package/src/tasks/init/template/package.json.mustache +54 -35
  145. package/src/tasks/init/template/setupFiles.ts +5 -0
  146. package/src/tasks/init/template/setupTests.ts +99 -0
  147. package/src/tasks/init/template/tasks.config.json +1 -1
  148. package/src/tasks/init/template/tsconfig.json +4 -1
  149. package/src/tasks/list/helper.js +21 -2
  150. package/src/tasks/list-lib/index.js +10 -1
  151. package/src/tasks/list-pub/helper.js +102 -1
  152. package/src/tasks/list-pub/index.js +108 -36
  153. package/src/tasks/move/index.js +1 -1
  154. package/src/tasks/promote-webpack/index.js +0 -3
  155. package/src/tasks/publish/helper.js +9 -7
  156. package/src/tasks/publish/index.js +85 -16
  157. package/src/tasks/publish-all/index.js +12 -1
  158. package/src/tasks/publish-archive/helper.js +58 -0
  159. package/src/tasks/publish-archive/index.js +238 -0
  160. package/src/tasks/publish-lib/index.js +277 -69
  161. package/src/tasks/rename/index.js +9 -1
  162. package/src/tasks/rename-lib/index.js +10 -1
  163. package/src/tasks/restore/index.js +84 -0
  164. package/src/tasks/set-perm/index.js +1 -2
  165. package/src/tasks/show-help/index.js +34 -13
  166. package/src/tasks/show-status/index.js +34 -11
  167. package/src/tasks/store/index.js +39 -18
  168. package/src/tasks/switch-lib/helper.js +0 -1
  169. package/src/tasks/switch-lib/index.js +13 -9
  170. package/src/tasks/switch-version/index.js +11 -6
  171. package/src/tasks/validator/index.js +1 -1
  172. package/src/util.js +463 -114
  173. package/tests/assets/library/components/create/Pega_DXIL_MyTestText/config.json +2 -1
  174. package/tests/assets/library/components/create/Pega_DXIL_MyTestText/demo.test.tsx +19 -0
  175. package/tests/assets/library/components/create/shared/create-nonce.ts +1 -0
  176. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +27 -1
  177. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.test.tsx +19 -0
  178. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +2 -1
  179. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +1 -0
  180. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.test.tsx +28 -0
  181. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/localizations.json +8 -0
  182. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +27 -1
  183. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.test.tsx +23 -0
  184. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +27 -1
  185. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/date.ts +0 -24
  186. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/demo.test.tsx +52 -0
  187. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +27 -1
  188. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -0
  189. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.test.tsx +72 -0
  190. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +27 -1
  191. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.test.tsx +21 -0
  192. package/tests/assets/library/components/{create/shared → createAll/Constellation/Pega_DXIL_MyDetails}/Avatar.tsx +1 -1
  193. package/tests/assets/library/components/createAll/Constellation/{shared → Pega_DXIL_MyDetails}/Operator.tsx +1 -1
  194. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +2 -1
  195. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +2 -1
  196. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.test.tsx +47 -0
  197. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +27 -1
  198. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.test.tsx +20 -0
  199. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +2 -1
  200. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/demo.test.tsx +40 -0
  201. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +2 -1
  202. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.test.tsx +27 -0
  203. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/localizations.json +10 -0
  204. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +27 -1
  205. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.test.tsx +18 -0
  206. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +2 -1
  207. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +4 -0
  208. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.test.tsx +24 -0
  209. package/tests/assets/library/components/createAll/Constellation/{shared → Pega_DXIL_MyPageCaseWidget}/Avatar.tsx +3 -4
  210. package/tests/assets/library/components/{create/shared → createAll/Constellation/Pega_DXIL_MyPageCaseWidget}/Operator.tsx +3 -3
  211. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +2 -1
  212. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +1 -0
  213. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.test.tsx +29 -0
  214. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.tsx +1 -1
  215. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +2 -1
  216. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +2 -0
  217. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.test.tsx +36 -0
  218. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +4 -1
  219. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/localizations.json +10 -0
  220. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +27 -1
  221. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.test.tsx +21 -0
  222. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +27 -1
  223. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.test.tsx +18 -0
  224. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +27 -1
  225. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.test.tsx +23 -0
  226. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +27 -1
  227. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.test.tsx +25 -0
  228. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +27 -1
  229. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.test.tsx +29 -0
  230. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +27 -1
  231. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.test.tsx +33 -0
  232. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +7 -0
  233. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/localizations.json +5 -0
  234. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +0 -4
  235. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/config.json +2 -1
  236. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/demo.test.tsx +19 -0
  237. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +27 -1
  238. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.test.tsx +20 -0
  239. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +27 -1
  240. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.test.tsx +33 -0
  241. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +76 -0
  242. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
  243. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +2 -1
  244. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -1
  245. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.test.tsx +58 -0
  246. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +2 -1
  247. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.test.tsx +56 -0
  248. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +27 -1
  249. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/demo.test.tsx +20 -0
  250. package/tests/assets/library/components/createAll/Constellation/shared/create-nonce.ts +1 -0
  251. package/tests/assets/original/components/create/Pega_DXIL_MyTestText/config.json +1 -0
  252. package/tests/assets/original/components/create/Pega_DXIL_MyTestText/create-nonce.ts +1 -0
  253. package/tests/assets/original/components/create/Pega_DXIL_MyTestText/demo.test.tsx +19 -0
  254. package/tests/assets/original/components/create/shared/PConnProps.d.ts +46 -0
  255. package/tests/assets/original/components/create/shared/create-nonce.ts +7 -0
  256. package/tests/assets/original/components/create/shared/suggestions-handler.ts +9 -0
  257. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +26 -0
  258. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/create-nonce.ts +1 -0
  259. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.test.tsx +19 -0
  260. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +1 -0
  261. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/create-nonce.ts +1 -0
  262. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +1 -0
  263. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.test.tsx +28 -0
  264. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/localizations.json +8 -0
  265. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +26 -0
  266. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/create-nonce.ts +1 -0
  267. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.test.tsx +23 -0
  268. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +26 -0
  269. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/create-nonce.ts +1 -0
  270. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/date.ts +0 -24
  271. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/demo.test.tsx +52 -0
  272. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +26 -0
  273. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/create-nonce.ts +1 -0
  274. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -0
  275. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.test.tsx +72 -0
  276. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +26 -0
  277. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/create-nonce.ts +1 -0
  278. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.test.tsx +21 -0
  279. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +1 -0
  280. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/create-nonce.ts +1 -0
  281. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +1 -0
  282. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.test.tsx +47 -0
  283. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +26 -0
  284. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/create-nonce.ts +1 -0
  285. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.test.tsx +20 -0
  286. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +1 -0
  287. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/create-nonce.ts +1 -0
  288. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/demo.test.tsx +40 -0
  289. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +1 -0
  290. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/create-nonce.ts +1 -0
  291. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.test.tsx +27 -0
  292. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/localizations.json +10 -0
  293. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +26 -0
  294. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/create-nonce.ts +1 -0
  295. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.test.tsx +18 -0
  296. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +1 -0
  297. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/create-nonce.ts +1 -0
  298. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +4 -0
  299. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.test.tsx +24 -0
  300. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +1 -0
  301. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/create-nonce.ts +1 -0
  302. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +1 -0
  303. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.test.tsx +29 -0
  304. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +1 -0
  305. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/create-nonce.ts +1 -0
  306. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +2 -0
  307. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.test.tsx +36 -0
  308. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +4 -1
  309. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/localizations.json +10 -0
  310. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +26 -0
  311. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/create-nonce.ts +1 -0
  312. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.test.tsx +21 -0
  313. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +26 -0
  314. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/create-nonce.ts +1 -0
  315. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.test.tsx +18 -0
  316. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +26 -0
  317. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/create-nonce.ts +1 -0
  318. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.test.tsx +23 -0
  319. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +26 -0
  320. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/create-nonce.ts +1 -0
  321. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.test.tsx +25 -0
  322. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +26 -0
  323. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/create-nonce.ts +1 -0
  324. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.test.tsx +29 -0
  325. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +26 -0
  326. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/create-nonce.ts +1 -0
  327. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.test.tsx +33 -0
  328. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +7 -0
  329. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/localizations.json +5 -0
  330. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +0 -4
  331. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/config.json +1 -0
  332. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/create-nonce.ts +1 -0
  333. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/demo.test.tsx +19 -0
  334. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +26 -0
  335. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/create-nonce.ts +1 -0
  336. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.test.tsx +20 -0
  337. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +26 -0
  338. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/create-nonce.ts +1 -0
  339. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.test.tsx +33 -0
  340. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +1 -0
  341. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/create-nonce.ts +1 -0
  342. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.test.tsx +58 -0
  343. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +1 -0
  344. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/create-nonce.ts +1 -0
  345. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.test.tsx +56 -0
  346. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +26 -0
  347. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/create-nonce.ts +1 -0
  348. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/demo.test.tsx +20 -0
  349. package/tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts +46 -0
  350. package/tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts +7 -0
  351. package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +9 -0
  352. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/config.json +26 -0
  353. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/create-nonce.ts +1 -0
  354. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.test.tsx +19 -0
  355. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/config.json +1 -0
  356. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/create-nonce.ts +1 -0
  357. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.tsx +1 -0
  358. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.test.tsx +28 -0
  359. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/config.json +26 -0
  360. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/create-nonce.ts +1 -0
  361. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.test.tsx +23 -0
  362. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +26 -0
  363. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/create-nonce.ts +1 -0
  364. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/date.ts +0 -24
  365. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.test.tsx +52 -0
  366. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/config.json +26 -0
  367. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/create-nonce.ts +1 -0
  368. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -0
  369. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.test.tsx +72 -0
  370. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/config.json +26 -0
  371. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/create-nonce.ts +1 -0
  372. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.test.tsx +21 -0
  373. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/config.json +1 -0
  374. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/create-nonce.ts +1 -0
  375. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +1 -0
  376. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.test.tsx +47 -0
  377. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/config.json +26 -0
  378. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/create-nonce.ts +1 -0
  379. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.test.tsx +20 -0
  380. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/config.json +1 -0
  381. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/create-nonce.ts +1 -0
  382. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.test.tsx +40 -0
  383. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/config.json +1 -0
  384. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/create-nonce.ts +1 -0
  385. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +1 -0
  386. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.test.tsx +27 -0
  387. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/config.json +26 -0
  388. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/create-nonce.ts +1 -0
  389. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.test.tsx +18 -0
  390. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/config.json +1 -0
  391. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/create-nonce.ts +1 -0
  392. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +4 -0
  393. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.test.tsx +24 -0
  394. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/config.json +1 -0
  395. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/create-nonce.ts +1 -0
  396. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +1 -0
  397. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.test.tsx +19 -0
  398. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/config.json +1 -0
  399. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/create-nonce.ts +1 -0
  400. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +2 -0
  401. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.test.tsx +36 -0
  402. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/config.json +26 -0
  403. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/create-nonce.ts +1 -0
  404. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.test.tsx +21 -0
  405. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/config.json +26 -0
  406. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/create-nonce.ts +1 -0
  407. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.test.tsx +18 -0
  408. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +26 -0
  409. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/create-nonce.ts +1 -0
  410. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.test.tsx +23 -0
  411. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/config.json +26 -0
  412. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/create-nonce.ts +1 -0
  413. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.test.tsx +25 -0
  414. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/config.json +26 -0
  415. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/create-nonce.ts +1 -0
  416. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/demo.test.tsx +29 -0
  417. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/config.json +26 -0
  418. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/create-nonce.ts +1 -0
  419. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.test.tsx +33 -0
  420. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +7 -0
  421. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/localizations.json +5 -0
  422. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts +0 -4
  423. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/config.json +1 -0
  424. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/create-nonce.ts +1 -0
  425. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/demo.test.tsx +19 -0
  426. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/config.json +26 -0
  427. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/create-nonce.ts +1 -0
  428. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.test.tsx +20 -0
  429. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/config.json +26 -0
  430. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/create-nonce.ts +1 -0
  431. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.test.tsx +33 -0
  432. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/config.json +1 -0
  433. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/create-nonce.ts +1 -0
  434. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.test.tsx +58 -0
  435. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/config.json +1 -0
  436. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/create-nonce.ts +1 -0
  437. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.test.tsx +56 -0
  438. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/config.json +26 -0
  439. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/create-nonce.ts +1 -0
  440. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.test.tsx +20 -0
  441. package/tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts +46 -0
  442. package/tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts +7 -0
  443. package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +9 -0
  444. package/tests/functional/localCreateAllListDeleteAll.test.js +12 -8
  445. package/tests/functional/localCreateBuildAllDeleteAll.test.js +12 -8
  446. package/tests/functional/localCreateBuildDelete.test.js +12 -8
  447. package/tests/functional/localCreateListDelete.test.js +14 -9
  448. package/tests/functional/localCreatePublishAllDeleteAll.test.js +13 -9
  449. package/tests/functional/localCreatePublishDelete.test.js +12 -8
  450. package/tests/functional/localCreateRenameDelete.test.js +12 -8
  451. package/tests/functional/localLibCreateLibAlreadyDeleteLib.test.js +14 -14
  452. package/tests/functional/localLibCreateLibBuildLibDeleteLib.test.js +17 -17
  453. package/tests/functional/localLibCreateLibBuildLibListPubDeleteLib.test.js +20 -20
  454. package/tests/functional/localLibCreateLibDeleteLib.test.js +17 -17
  455. package/tests/functional/localLibCreateLibExportImportLib.test.js +27 -27
  456. package/tests/functional/localLibCreateLibExportLib.test.js +19 -19
  457. package/tests/functional/localLibCreateLibImportCompDeleteLib.test.js +14 -14
  458. package/tests/functional/localLibCreateLibListDeleteLib.test.js +22 -22
  459. package/tests/functional/localLibCreateLibListMoveDeleteLib.test.js +31 -31
  460. package/tests/functional/localLibCreateLibListSwitchDeleteLib.test.js +20 -20
  461. package/tests/functional/localLibCreateLibStatusDeleteLib.test.js +13 -29
  462. package/tests/functional/localLibCreateLibStoreRestoreDeleteLib.test.js +376 -0
  463. package/tests/functional/localLibCreateLibValidateDeleteLib.test.js +18 -18
  464. package/tests/functional/localLibCreateLibVersionDeleteLib.test.js +27 -27
  465. package/tests/functional/localPromoteRevertWP.test.js +9 -8
  466. package/tests/functional/localLibCreateLibPermDeleteLib.test.js +0 -144
@@ -1,15 +1,26 @@
1
1
  import inquirer from 'inquirer';
2
2
  import { Listr } from 'listr2';
3
3
  import chalk from 'chalk';
4
+ import fetch from 'node-fetch';
5
+ import archiver from 'archiver';
6
+ import path from 'path';
7
+ import fs from 'fs';
8
+ import ora from 'ora';
4
9
 
5
10
  import validate from '../validator/index.js';
6
11
  import { lintComponent } from '../linter/index.js';
7
- import { getComponentDirectoryPath, showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deletePublishExtras, addDebugLog, checkLibraryAndArchives, checkJWTExpiration, getConfigDefaults, getUseInputConfig, getInputConfigForCommand } from '../../util.js';
12
+ import { constructCompleteUrl, getComponentDirectoryPath, getHttpsAgent, getPegaServerConfig, showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, getLibraryBasedCL, deletePublishExtras, addDebugLog, checkLibraryAndArchives, checkJWTExpiration, getConfigDefaults } from '../../util.js';
8
13
 
9
14
  import { publishLib, listLibJSONResponse, deleteLibVersion } from '@pega/constellation-dx-components-build-utils/index.js';
10
15
 
11
16
  import { getLibraryVersionQuestion } from './helper.js';
12
17
 
18
+ import {
19
+ LP_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
20
+ PUBLISH_COMPONENT_LIBRARY_SERVICE_REST_ENDPOINT,
21
+ TOKEN_PATH
22
+ } from '../../constants.js';
23
+
13
24
 
14
25
  export function getCustomTasks(componentKey, sourceMap, devBuild, options) {
15
26
  addDebugLog("getCustomTasks", `componentKey: ${componentKey}, sourceMap: ${sourceMap}, devBuild: ${devBuild}`, "");
@@ -54,6 +65,209 @@ addDebugLog("doesLibraryExist", `libraryName: ${libraryName}, libraryVersion: ${
54
65
  }
55
66
 
56
67
 
68
+ export const zipLibraryComponent = async (libraryName, version) => {
69
+ addDebugLog("zipLibraryComponent", `libraryName: ${libraryName}, libraryVersion: ${version}`, "");
70
+
71
+ const currentDirectory = process.cwd();
72
+ const libraryDirName = `${libraryName}/${version}`;
73
+ const libraryDirectory = path.join(currentDirectory, libraryDirName);
74
+ const componentsConfigJson = path.join(libraryDirectory, "componentsconfig.json");
75
+ // const componentsConfigJson = `${libraryDirectory}/componentsconfig.json`;
76
+ const localizationsJson = path.join(libraryDirectory, "componentslocalization.json");
77
+
78
+
79
+ const archive = archiver('zip', { zlib: { level: 9 } });
80
+ const zipChunks = [];
81
+ archive.on('data', chunk => zipChunks.push(chunk));
82
+
83
+ // No going to add full list of created by buildLib, instead
84
+ // below going just just *.js files and a few specific .json files
85
+ // // Add main directory as src directory in zip
86
+ // archive.directory(libraryDirectory, 'src');
87
+
88
+ // only zip *.js files, not *.js.br, *.js.map, license, text, json, etc.
89
+ archive.glob("*.js", { cwd: libraryDirectory });
90
+
91
+ // Add componentsconfig.json.json file (array of config.json)
92
+ if (fs.existsSync(componentsConfigJson)) {
93
+ archive.file(componentsConfigJson, { name: path.basename(componentsConfigJson) });
94
+ }
95
+
96
+ // Add componentslocalization.jspon (array of component localizations) file
97
+ if (fs.existsSync(localizationsJson)) {
98
+ archive.file(localizationsJson, { name: path.basename(localizationsJson) });
99
+ }
100
+
101
+ await archive.finalize();
102
+
103
+ const zipBuffer = Buffer.concat(zipChunks);
104
+ console.log(chalk.green(`component zipped with size: ${Math.ceil(zipBuffer.length / 1024)} KB`));
105
+ const zipContent = zipBuffer.toString('base64');
106
+
107
+ const configContent = Buffer.from(fs.readFileSync(componentsConfigJson)).toString();
108
+ let localizationsContent = "[]";
109
+ if (fs.existsSync(localizationsJson)) {
110
+ localizationsContent = Buffer.from(fs.readFileSync(localizationsJson)).toString();
111
+ }
112
+
113
+ // if (fs.existsSync(libraryDirectory)) {
114
+ // fs.rm(libraryDirectory, { recursive: true }, err => {
115
+ // if (err) {
116
+ // throw err;
117
+ // }
118
+ // });
119
+ // }
120
+
121
+ return { zipContent, configContent, localizationsContent};
122
+ };
123
+
124
+
125
+ export const publishComponentLibraryToServer = async (data, doFetch) => {
126
+ addDebugLog("publishComponentToServer", `data: ${data}`, "");
127
+ const { configContent, zipContent, localizationsContent, rulesetName, rulesetVersion, libraryName, version } = data;
128
+
129
+ const defaultPegaServerConfig = await getPegaServerConfig();
130
+ const { serverType, isolationId } = defaultPegaServerConfig;
131
+ const isLaunchpad = serverType === 'launchpad';
132
+ const launchpadRestEndpoint = LP_PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT.replace(
133
+ '{isolationId}',
134
+ isolationId || 'undefined'
135
+ );
136
+ let apiBody;
137
+
138
+ if (isLaunchpad) {
139
+ // currently no launchpad records to rule resolve a library
140
+
141
+ } else {
142
+ apiBody = {
143
+ configContent,
144
+ zipContent,
145
+ publishFor: 'constellation',
146
+ rulesetName,
147
+ rulesetVersion,
148
+ libraryName,
149
+ version,
150
+ category: '',
151
+ localizationsContent
152
+ };
153
+ }
154
+
155
+ const defaultPegaConfig = await getPegaServerConfig();
156
+ const url = constructCompleteUrl(
157
+ defaultPegaConfig.server,
158
+ isLaunchpad ? launchpadRestEndpoint : PUBLISH_COMPONENT_LIBRARY_SERVICE_REST_ENDPOINT
159
+ );
160
+
161
+ if (doFetch) {
162
+ try {
163
+ const OauthData = fs.readFileSync(TOKEN_PATH, 'utf8');
164
+ if (OauthData) {
165
+ const {
166
+ access_token: accessToken,
167
+ token_type: tokenType
168
+ // refresh_token: refreshToken
169
+ } = JSON.parse(OauthData);
170
+ let status = 500;
171
+ let headers = {};
172
+
173
+ if (isLaunchpad) {
174
+ headers.cookie = `Pega-AAT=${accessToken}`;
175
+ headers['Content-Type'] = 'application/json';
176
+ } else {
177
+ headers.Authorization = `${tokenType} ${accessToken}`;
178
+ }
179
+
180
+ let spinner;
181
+
182
+ console.log();
183
+ spinner = ora(chalk.green.bold('Publishing library...')).start();
184
+
185
+ const response = await fetch(url, {
186
+ method: 'POST',
187
+ agent: getHttpsAgent(defaultPegaConfig),
188
+ headers,
189
+ body: JSON.stringify(apiBody)
190
+ });
191
+
192
+ spinner.stop();
193
+
194
+ status = response.status;
195
+ if (!response.ok) {
196
+ if (status === 401) {
197
+ throw new Error(
198
+ 'Error occurred in authentication. Please regenerate using authenticate'
199
+ );
200
+ // console.log(accessTokenUri, refreshToken);
201
+ /* TODO - Handle refresh_token */
202
+ } else if (status === 404) {
203
+ throw new Error('404: Server resource not found');
204
+ } else if (status === 405) {
205
+ throw new Error('405: Server method not allowed');
206
+ } else if (status === 408) {
207
+ throw new Error('408: Server timed out');
208
+ } else if (response.status === 403) {
209
+ throw new Error('Error forbidden: User does not have privileges to Publish.');
210
+ }
211
+ }
212
+
213
+ try {
214
+ // const respData = isLaunchpad ? await response.text() : await response.json();
215
+ const headerType = response.headers.get('content-type');
216
+ const respData = headerType.includes("json") ? await response.json() : await response.text();
217
+ let respMessage = headerType.includes("json") ? respData.message : respData;
218
+
219
+
220
+ if (status === 500) {
221
+ status = 999;
222
+ if (respMessage === '') {
223
+ respMessage = `Server error, please check server logs for error.`;
224
+ }
225
+ throw new Error(respMessage);
226
+ }
227
+
228
+ console.log(chalk.bold.green(`Success : ${respMessage }`));
229
+
230
+ } catch (err) {
231
+ if (status === 500) {
232
+ throw new Error(`Server error, please check server logs for error.`);
233
+ } else if (status === 999) {
234
+ throw new Error(err);
235
+ }
236
+ }
237
+ } else {
238
+ throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
239
+ }
240
+ } catch (err) {
241
+ // throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
242
+ throw new Error(err);
243
+ }
244
+ }
245
+ };
246
+
247
+
248
+ export const publishUILibraryComponentToInfinity = async (content) => {
249
+ addDebugLog("publishUILibraryComponentToInfinity", `content: ${content}`, "");
250
+
251
+ console.log(chalk.green(`Publishing ${content.libraryName}/${content.version} to server...`));
252
+
253
+ const fromZip = await zipLibraryComponent(content.libraryName, content.version);
254
+
255
+ content = { ...fromZip, ...content };
256
+
257
+ try {
258
+ await publishComponentLibraryToServer(content, true );
259
+ // console.log(chalk.green.bold(`Success: Published ${content.libraryName}/${content.version} to server as a CL.`));
260
+ }
261
+ catch (err) {
262
+ let sErr = err.toString();
263
+ // strip all Error:
264
+ sErr = sErr.replaceAll("Error: ", "");
265
+ console.log(chalk.bold.red("Error: " + sErr));
266
+ }
267
+
268
+ }
269
+
270
+
57
271
  export const publishNewLibraryAsync = async (libraryName, version, checkDeleted = false) => {
58
272
  addDebugLog("publishNewLibraryAsync", `libraryName: ${libraryName}, version: ${version}, checkDeleted: ${checkDeleted} `, "");
59
273
 
@@ -92,12 +306,14 @@ addDebugLog("deleteLib", "services end", "");
92
306
 
93
307
  export default async (options) => {
94
308
  const isLibraryBased = getLibraryBased();
309
+ const isLibraryBasedCL = getLibraryBasedCL();
310
+
95
311
  if (!isLibraryBased) {
96
312
  console.log(`Command only supported for ${chalk.bold.green('library mode')} components.`)
97
313
  process.exit();
98
314
  }
99
315
 
100
- if (options.params.length != 4) {
316
+ if (options.params.length >= 4) {
101
317
  // internal so already called
102
318
  await showVersion();
103
319
  await checkLibraryAndArchives();
@@ -111,38 +327,38 @@ addDebugLog("publishLibrary", "", "+");
111
327
  let version;
112
328
  let devBuild;
113
329
  let internalPublish = false;
330
+ let rulesetName;
331
+ let rulesetVersion;
114
332
 
115
333
  let libraryName;
116
334
  let noRealPublish = false;
117
335
 
118
336
 
119
- if (options.params.length === 5) {
337
+ if (options.params.length === 7) {
120
338
  libraryName = options.params[3];
121
339
  version = options.params[4];
340
+ rulesetName = options.params[5];
341
+ rulesetVersion = options.params[6];
122
342
  }
123
- else if (options.params.length === 6) {
343
+ else if (options.params.length === 8) {
124
344
  libraryName = options.params[3];
125
345
  version = options.params[4];
346
+ rulesetName = options.params[5];
347
+ rulesetVersion = options.params[6];
126
348
  noRealPublish = true;
127
349
  }
128
- else if (options.params.length === 4) {
350
+ else if (options.params.length === 6) {
351
+ rulesetName = options.params[3];
352
+ rulesetVersion = options.params[4];
129
353
  // internal call from publish
130
354
  internalPublish = true;
131
355
  const orgLib = getConfigDefaults();
132
356
  library = orgLib.library;
133
357
  organization = orgLib.organization;
134
- // libraryName = `${organization}_${library}`;
135
358
  libraryName = orgLib.currentOrgLib;
136
359
 
137
360
  version = orgLib.buildVersion;
138
361
 
139
- // check to see if devBuild
140
- // const devBuild = await getConfigDevBuild();
141
- // const devBuild = orgLib.devBuild;
142
- // if (devBuild) {
143
- // version = version.concat("-dev");
144
- // }
145
-
146
362
  }
147
363
 
148
364
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
@@ -157,8 +373,6 @@ addDebugLog("publishLibrary", "", "+");
157
373
  const compDef = getConfigDefaults();
158
374
  organization = compDef.organization;
159
375
  library = compDef.library;
160
-
161
- // libraryName = `${organization}_${library}`;
162
376
  libraryName = compDef.currentOrgLib;
163
377
 
164
378
  try {
@@ -178,12 +392,6 @@ addDebugLog("publishLibrary", "", "+");
178
392
  ({version} = versionAnswers);
179
393
  }
180
394
 
181
- const useInputConfig = getUseInputConfig();
182
- let inputConfig = {};
183
- if (useInputConfig) {
184
- inputConfig = await getInputConfigForCommand("publish");
185
- }
186
-
187
395
  let okToPublish = true;
188
396
 
189
397
  // this check matches check below, but for JEST, we don't want to go any further, just verifying if will
@@ -193,10 +401,8 @@ addDebugLog("publishLibrary", "", "+");
193
401
  return;
194
402
  }
195
403
 
196
- if (!version.includes("-dev") && !internalPublish) {
404
+ if (!version.includes("-dev") && !internalPublish && !isLibraryBasedCL) {
197
405
  okToPublish = false;
198
-
199
-
200
406
  const publishAnswers = await inquirer.prompt([
201
407
 
202
408
  {
@@ -211,66 +417,69 @@ addDebugLog("publishLibrary", "", "+");
211
417
  }
212
418
  }
213
419
 
214
-
215
-
216
-
217
420
  if (noRealPublish) {
218
421
  // this is as far as JEST test can go since need server for rest and don't want to use server.
219
422
  console.log("OK to publish.");
220
423
  return;
221
424
  }
222
425
 
223
- if (okToPublish) {
224
426
 
225
- let libVersionExists = await doesLibraryExist(libraryName, version);
226
- let overrideExisting = false;
227
- let checkDeleted = false;
427
+ const isLibraryBasedCL = getLibraryBasedCL();
428
+ if (okToPublish) {
429
+ if (isLibraryBasedCL) {
430
+ // developer test
228
431
 
229
- await deletePublishExtras(libraryName, version);
432
+ let content = { libraryName, version, rulesetName, rulesetVersion };
433
+ await publishUILibraryComponentToInfinity(content);
230
434
 
231
- if (useInputConfig) {
232
- if (inputConfig.okToOverride) {
233
- // to override
234
- overrideExisting = true;
235
- }
236
435
  }
436
+ else {
437
+ let libVersionExists = await doesLibraryExist(libraryName, version);
438
+ let overrideExisting = false;
439
+ let checkDeleted = false;
440
+
441
+ await deletePublishExtras(libraryName, version);
442
+
443
+
444
+ if (libVersionExists) {
445
+ console.log("\nLibrary " + chalk.bold.yellow(`${libraryName}/${version}`) + " already exists.");
446
+ const questions = [
447
+ {
448
+ name: 'override',
449
+ type: 'confirm',
450
+ message: `Do you wish to overrite it`,
451
+ default: false
452
+ }
453
+ ];
454
+
455
+ await inquirer.prompt(questions).then(async answers => {
456
+ overrideExisting = answers.override;
457
+ });
458
+ }
237
459
 
460
+ if (libVersionExists) {
461
+ if (overrideExisting) {
462
+ console.log("\nDeleting existing library " + chalk.bold.yellow(`${libraryName}:${version}`) + " ...");
463
+ addDebugLog("deleteLibVersion", `services call: libraryName: ${libraryName}, version: ${version}`, "");
464
+ await deleteLibVersion(libraryName, version, tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
465
+ addDebugLog("deleteLibVersion", "services end", "");
466
+ checkDeleted = true;
467
+ }
468
+ else {
469
+ // don't override, so end
470
+ console.log(chalk.yellow(`You will need to increment your library version to publish`));
471
+ addDebugLog("publishLibrary", "END", "-");
472
+ return;
473
+ }
474
+ }
238
475
 
239
- if (libVersionExists && !overrideExisting) {
240
- console.log("\nLibrary " + chalk.bold.yellow(`${libraryName}/${version}`) + " already exists.");
241
- const questions = [
242
- {
243
- name: 'override',
244
- type: 'confirm',
245
- message: `Do you wish to overrite it`,
246
- default: false
247
- }
248
- ];
476
+ // need a timeout to give services time to delete the library
477
+ // setTimeout( function(){ await publishNewLibraryAsync(libraryName, version, checkDeleted)}, 700 );
478
+ await publishNewLibraryAsync(libraryName, version, checkDeleted);
249
479
 
250
- await inquirer.prompt(questions).then(async answers => {
251
- overrideExisting = answers.override;
252
- });
253
480
  }
254
481
 
255
- if (libVersionExists) {
256
- if (overrideExisting) {
257
- console.log("\nDeleting existing library " + chalk.bold.yellow(`${libraryName}:${version}`) + " ...");
258
- addDebugLog("deleteLibVersion", `services call: libraryName: ${libraryName}, version: ${version}`, "");
259
- await deleteLibVersion(libraryName, version, tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
260
- addDebugLog("deleteLibVersion", "services end", "");
261
- checkDeleted = true;
262
- }
263
- else {
264
- // don't override, so end
265
- console.log(chalk.yellow(`You will need to increment your library version to publish`));
266
- addDebugLog("publishLibrary", "END", "-");
267
- return;
268
- }
269
- }
270
482
 
271
- // need a timeout to give services time to delete the library
272
- // setTimeout( function(){ await publishNewLibraryAsync(libraryName, version, checkDeleted)}, 700 );
273
- await publishNewLibraryAsync(libraryName, version, checkDeleted);
274
483
  }
275
484
 
276
485
  }
@@ -280,7 +489,6 @@ addDebugLog("publishLibrary", "END", "-");
280
489
  }
281
490
 
282
491
 
283
-
284
492
  addDebugLog("publishLibrary", "END", "-");
285
493
 
286
494
  return true;
@@ -7,7 +7,15 @@ import inquirer from 'inquirer';
7
7
  import ncp from 'ncp';
8
8
  import chalk from 'chalk';
9
9
 
10
- import { checkPathAccess, showVersion, getComponentsObj, getDirectoryFiles, addDebugLog, checkLibraryAndArchives, getConfigDefaults, getLibraryBased } from '../../util.js';
10
+ import {
11
+ checkPathAccess,
12
+ showVersion,
13
+ getComponentsObj,
14
+ getDirectoryFiles,
15
+ addDebugLog,
16
+ checkLibraryAndArchives,
17
+ getConfigDefaults,
18
+ getLibraryBased } from '../../util.js';
11
19
  import { TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH, COMPONENTS_PATH } from '../../constants.js';
12
20
 
13
21
 
@@ -19,7 +19,8 @@ import {
19
19
  updateDefaultOrganization,
20
20
  addDebugLog,
21
21
  checkLibraryAndArchives,
22
- getConfigDefaults
22
+ getConfigDefaults,
23
+ getLibraryBasedCL
23
24
  } from '../../util.js';
24
25
  import {
25
26
  TASKS_CONFIG_JSON_FILENAME,
@@ -105,6 +106,8 @@ addDebugLog("renameLibrary", `library: ${library}, organization: ${organization}
105
106
  const currentLibrary = compDef.library;
106
107
  const currentVersion = compDef.version;
107
108
 
109
+ const isLibraryBasedCL = getLibraryBasedCL();
110
+
108
111
  let compVersion;
109
112
 
110
113
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
@@ -143,6 +146,12 @@ addDebugLog("renameLibrary", `library: ${library}, organization: ${organization}
143
146
  if (compVersion && compVersion.indexOf('-dev') != -1) {
144
147
  wasDevBuild = true;
145
148
  }
149
+
150
+ // no -dev with PegaInfinity
151
+ if (isLibraryBasedCL) {
152
+ wasDevBuild = false;
153
+ }
154
+
146
155
  const allowedApplications = configData.allowedApplications;
147
156
 
148
157
  await renameComponent(
@@ -0,0 +1,84 @@
1
+
2
+ import { Listr } from 'listr2';
3
+ import chalk from 'chalk';
4
+ import inquirer from 'inquirer';
5
+
6
+ import {
7
+ showVersion,
8
+ addDebugLog,
9
+ checkLibraryAndArchives,
10
+ getConfigDefaults,
11
+ getLibraryBased,
12
+ restoreFromArchive,
13
+ cleanUpTemp,
14
+ forceDefaultsUpdate
15
+ } from '../../util.js';
16
+
17
+ import { showCurrentStatus } from '../show-status/index.js';
18
+
19
+ export default async options => {
20
+ await showVersion();
21
+ await checkLibraryAndArchives();
22
+
23
+ addDebugLog("restoreComponent", "", "+");
24
+
25
+ await cleanUpTemp();
26
+
27
+ const isLibraryBased = getLibraryBased();
28
+ if (!isLibraryBased) {
29
+ console.log(`Command only supported for ${chalk.bold.green('library mode')} components.`)
30
+ process.exit();
31
+ }
32
+ const confDef = getConfigDefaults();
33
+
34
+ console.log(chalk.bold.yellow('\nChanges not saved to local storage will be LOST, code will be restored from local storage.'));
35
+ console.log("");
36
+
37
+ let restoreFromStore = {};
38
+
39
+ if (options.params.length === 4) {
40
+ const optConfirm = options.params[3];
41
+ restoreFromStore["confirmRestore"] = optConfirm === 'Y' || optConfirm === 'y' || optConfirm === true || optConfirm === 'true' ? true : false;
42
+ }
43
+ else {
44
+ restoreFromStore = await inquirer.prompt([
45
+ {
46
+ name: 'confirmRestore',
47
+ type: 'confirm',
48
+ message: `Restoring ${chalk.bold.green(`${confDef.displayLibVersion}`)} from local storage, proceed ?`,
49
+ default: true
50
+ }
51
+ ]);
52
+ }
53
+
54
+
55
+
56
+
57
+ if (restoreFromStore.confirmRestore) {
58
+ const switchToFileName = `${confDef.currentOrgLib}_${confDef.version}.arch.zip`;
59
+ const tasks = new Listr(
60
+ [
61
+ {
62
+ title: `Restoring ${confDef.displayLibVersion}`,
63
+ task: async () => {
64
+ await restoreFromArchive(switchToFileName, confDef.currentOrgLib, confDef.version);
65
+ }
66
+ }
67
+ ],
68
+ { concurrent: false, exitOnError: true }
69
+ );
70
+
71
+ await tasks.run().catch(err => {
72
+ console.log(chalk.bold.red(err.toString()));
73
+ addDebugLog("restoreComponent", "", "-");
74
+ process.exit(1);
75
+ });
76
+ console.log(chalk.greenBright('\nComponents restored'));
77
+
78
+ await forceDefaultsUpdate();
79
+ await showCurrentStatus();
80
+ }
81
+
82
+ addDebugLog("restoreComponent", "", "-");
83
+
84
+ };
@@ -1,5 +1,3 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
1
  import inquirer from 'inquirer';
4
2
  import chalk from 'chalk';
5
3
 
@@ -140,6 +138,7 @@ addDebugLog("setPerm", "", "+");
140
138
  await checkLibraryAndArchives();
141
139
 
142
140
  let inputYN = "";
141
+
143
142
  if (useInputConfig) {
144
143
  const inputConfig = await getInputConfigForCommand("setPermanent");
145
144
  inputYN = inputConfig.makePermanent;