@salesforce/ui-bundle-template-app-angular-template-b2x 11.30.0

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 (211) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/.forceignore +15 -0
  3. package/dist/.husky/pre-commit +4 -0
  4. package/dist/.prettierignore +11 -0
  5. package/dist/.prettierrc +17 -0
  6. package/dist/CHANGELOG.md +3966 -0
  7. package/dist/README.md +77 -0
  8. package/dist/config/project-scratch-def.json +13 -0
  9. package/dist/eslint.config.js +7 -0
  10. package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls +68 -0
  11. package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls-meta.xml +5 -0
  12. package/dist/force-app/main/default/classes/UIBundleChangePassword.cls +77 -0
  13. package/dist/force-app/main/default/classes/UIBundleChangePassword.cls-meta.xml +5 -0
  14. package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls +71 -0
  15. package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls-meta.xml +5 -0
  16. package/dist/force-app/main/default/classes/UIBundleLogin.cls +105 -0
  17. package/dist/force-app/main/default/classes/UIBundleLogin.cls-meta.xml +5 -0
  18. package/dist/force-app/main/default/classes/UIBundleRegistration.cls +162 -0
  19. package/dist/force-app/main/default/classes/UIBundleRegistration.cls-meta.xml +5 -0
  20. package/dist/force-app/main/default/digitalExperienceConfigs/angularexternalapp1.digitalExperienceConfig-meta.xml +8 -0
  21. package/dist/force-app/main/default/digitalExperiences/site/angularexternalapp1/angularexternalapp1.digitalExperience-meta.xml +11 -0
  22. package/dist/force-app/main/default/digitalExperiences/site/angularexternalapp1/sfdc_cms__site/angularexternalapp1/_meta.json +5 -0
  23. package/dist/force-app/main/default/digitalExperiences/site/angularexternalapp1/sfdc_cms__site/angularexternalapp1/content.json +10 -0
  24. package/dist/force-app/main/default/networks/angularexternalapp.network-meta.xml +60 -0
  25. package/dist/force-app/main/default/package.xml +24 -0
  26. package/dist/force-app/main/default/permissionsets/angularexternalapp_Guest_User_Api_Access.permissionset-meta.xml +9 -0
  27. package/dist/force-app/main/default/sites/angularexternalapp.site-meta.xml +31 -0
  28. package/dist/force-app/main/default/uiBundles/angularexternalapp/.forceignore +15 -0
  29. package/dist/force-app/main/default/uiBundles/angularexternalapp/.postcssrc.json +5 -0
  30. package/dist/force-app/main/default/uiBundles/angularexternalapp/.prettierignore +8 -0
  31. package/dist/force-app/main/default/uiBundles/angularexternalapp/.prettierrc +12 -0
  32. package/dist/force-app/main/default/uiBundles/angularexternalapp/CHANGELOG.md +4 -0
  33. package/dist/force-app/main/default/uiBundles/angularexternalapp/README.md +85 -0
  34. package/dist/force-app/main/default/uiBundles/angularexternalapp/angular.json +98 -0
  35. package/dist/force-app/main/default/uiBundles/angularexternalapp/angularexternalapp.uibundle-meta.xml +8 -0
  36. package/dist/force-app/main/default/uiBundles/angularexternalapp/e2e/app.spec.ts +15 -0
  37. package/dist/force-app/main/default/uiBundles/angularexternalapp/esbuild/api-version.mjs +17 -0
  38. package/dist/force-app/main/default/uiBundles/angularexternalapp/eslint.config.js +60 -0
  39. package/dist/force-app/main/default/uiBundles/angularexternalapp/middleware/html.mjs +3 -0
  40. package/dist/force-app/main/default/uiBundles/angularexternalapp/middleware/proxy.mjs +12 -0
  41. package/dist/force-app/main/default/uiBundles/angularexternalapp/package.json +56 -0
  42. package/dist/force-app/main/default/uiBundles/angularexternalapp/playwright.config.ts +25 -0
  43. package/dist/force-app/main/default/uiBundles/angularexternalapp/public/favicon.ico +0 -0
  44. package/dist/force-app/main/default/uiBundles/angularexternalapp/scripts/rewrite-e2e-assets.mjs +30 -0
  45. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/account/account-search.service.ts +196 -0
  46. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/account/distinctAccountIndustries.ts +26 -0
  47. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/account/distinctAccountTypes.ts +26 -0
  48. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/account/getAccountDetail.ts +128 -0
  49. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/account/searchAccounts.ts +58 -0
  50. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/data-client.service.spec.ts +184 -0
  51. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/data-client.service.ts +74 -0
  52. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/api/user-profile.service.ts +126 -0
  53. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/app.config.ts +22 -0
  54. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/app.html +1 -0
  55. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/app.routes.ts +77 -0
  56. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/app.spec.ts +18 -0
  57. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/app.ts +15 -0
  58. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/layout/app-layout/app-layout.component.html +53 -0
  59. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/layout/app-layout/app-layout.component.spec.ts +89 -0
  60. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/layout/app-layout/app-layout.component.ts +81 -0
  61. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/_field-size.scss +42 -0
  62. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/alert/alert.component.html +31 -0
  63. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/alert/alert.component.ts +53 -0
  64. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/button/button.component.html +18 -0
  65. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/button/button.component.scss +112 -0
  66. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/button/button.component.ts +57 -0
  67. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/card/card.component.scss +34 -0
  68. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/card/card.component.ts +110 -0
  69. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/collapsible/collapsible.component.html +10 -0
  70. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/collapsible/collapsible.component.ts +26 -0
  71. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/date-picker/date-picker.component.html +25 -0
  72. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/date-picker/date-picker.component.scss +36 -0
  73. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/date-picker/date-picker.component.ts +41 -0
  74. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/date-range-picker/date-range-picker.component.html +34 -0
  75. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/date-range-picker/date-range-picker.component.scss +33 -0
  76. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/date-range-picker/date-range-picker.component.ts +66 -0
  77. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/dialog/dialog.component.html +37 -0
  78. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/dialog/dialog.component.ts +55 -0
  79. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/field/field.component.html +21 -0
  80. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/field/field.component.ts +36 -0
  81. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/field-size.ts +8 -0
  82. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/input/input.component.html +19 -0
  83. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/input/input.component.scss +35 -0
  84. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/input/input.component.ts +36 -0
  85. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/label/label.component.html +3 -0
  86. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/label/label.component.ts +17 -0
  87. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/paginator/paginator.component.html +10 -0
  88. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/paginator/paginator.component.ts +37 -0
  89. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/popover/popover.component.html +41 -0
  90. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/popover/popover.component.ts +40 -0
  91. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/select/select.component.html +24 -0
  92. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/select/select.component.scss +35 -0
  93. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/select/select.component.ts +72 -0
  94. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/separator/separator.component.html +1 -0
  95. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/separator/separator.component.scss +23 -0
  96. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/separator/separator.component.ts +56 -0
  97. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/skeleton/skeleton.component.html +1 -0
  98. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/skeleton/skeleton.component.scss +28 -0
  99. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/skeleton/skeleton.component.ts +24 -0
  100. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/components/ui/spinner/spinner.component.ts +35 -0
  101. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/auth/auth.guard.ts +50 -0
  102. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/auth/auth.service.ts +126 -0
  103. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/components/status-alert/status-alert.component.html +7 -0
  104. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/components/status-alert/status-alert.component.ts +52 -0
  105. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/config/authentication.config.ts +75 -0
  106. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/auth-form/auth-form.component.html +38 -0
  107. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/auth-form/auth-form.component.ts +94 -0
  108. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/footer-link/footer-link.component.html +11 -0
  109. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/footer-link/footer-link.component.ts +26 -0
  110. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/reactive-form-page.base.ts +50 -0
  111. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/submit-button/submit-button.component.html +8 -0
  112. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/submit-button/submit-button.component.scss +17 -0
  113. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/forms/submit-button/submit-button.component.ts +35 -0
  114. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/layouts/auth-app-layout/auth-app-layout.component.html +2 -0
  115. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/layouts/auth-app-layout/auth-app-layout.component.ts +30 -0
  116. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/layouts/card-layout/card-layout.component.html +17 -0
  117. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/layouts/card-layout/card-layout.component.ts +40 -0
  118. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/menu/auth-menu/auth-menu.component.html +26 -0
  119. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/menu/auth-menu/auth-menu.component.ts +46 -0
  120. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/session-timeout/session-time-servlet.ts +130 -0
  121. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/session-timeout/session-timeout-validator/session-timeout-validator.component.html +57 -0
  122. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/session-timeout/session-timeout-validator/session-timeout-validator.component.ts +205 -0
  123. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/session-timeout/session-timeout.config.ts +83 -0
  124. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/session-timeout/session-timeout.service.ts +201 -0
  125. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/utils/auth-helpers.ts +68 -0
  126. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/utils/auth-validators.ts +72 -0
  127. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/authentication/utils/helpers.ts +85 -0
  128. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/active-filters/active-filters.component.html +23 -0
  129. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/active-filters/active-filters.component.ts +78 -0
  130. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/date-filter/date-filter.component.html +18 -0
  131. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/date-filter/date-filter.component.ts +137 -0
  132. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/date-range-filter/date-range-filter.component.html +11 -0
  133. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/date-range-filter/date-range-filter.component.ts +69 -0
  134. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/filter-field-wrapper/filter-field-wrapper.component.html +11 -0
  135. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/filter-field-wrapper/filter-field-wrapper.component.ts +36 -0
  136. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/multi-select-filter/multi-select-filter.component.html +10 -0
  137. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/multi-select-filter/multi-select-filter.component.ts +58 -0
  138. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/numeric-range-filter/numeric-range-filter.component.html +22 -0
  139. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/numeric-range-filter/numeric-range-filter.component.ts +146 -0
  140. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/search-filter/search-filter.component.html +8 -0
  141. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/search-filter/search-filter.component.ts +82 -0
  142. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/select-filter/select-filter.component.html +12 -0
  143. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/select-filter/select-filter.component.ts +65 -0
  144. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/text-filter/text-filter.component.html +12 -0
  145. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/filters/text-filter/text-filter.component.ts +90 -0
  146. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/object-breadcrumb/object-breadcrumb.component.html +55 -0
  147. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/object-breadcrumb/object-breadcrumb.component.ts +40 -0
  148. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/pagination-controls/pagination-controls.component.html +8 -0
  149. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/pagination-controls/pagination-controls.component.ts +61 -0
  150. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/search-bar/search-bar.component.html +59 -0
  151. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/search-bar/search-bar.component.ts +108 -0
  152. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/sort-control/sort-control.component.html +50 -0
  153. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/components/sort-control/sort-control.component.ts +72 -0
  154. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/object-search-state.service.ts +232 -0
  155. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/utils/debounce.ts +31 -0
  156. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/utils/field-utils.ts +54 -0
  157. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/utils/filter-utils.ts +354 -0
  158. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/utils/index.ts +12 -0
  159. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/features/object-search/utils/sort-utils.ts +46 -0
  160. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/account-detail/account-detail-page.component.html +174 -0
  161. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/account-detail/account-detail-page.component.scss +7 -0
  162. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/account-detail/account-detail-page.component.ts +199 -0
  163. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/account-search/account-search-page.component.html +111 -0
  164. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/account-search/account-search-page.component.ts +217 -0
  165. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/change-password/change-password-page.component.html +68 -0
  166. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/change-password/change-password-page.component.ts +82 -0
  167. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/forgot-password/forgot-password-page.component.html +35 -0
  168. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/forgot-password/forgot-password-page.component.ts +87 -0
  169. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/home/home-page.component.html +18 -0
  170. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/home/home-page.component.ts +47 -0
  171. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/home/home.component.html +6 -0
  172. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/home/home.component.spec.ts +23 -0
  173. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/home/home.component.ts +13 -0
  174. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/login/login-page.component.html +47 -0
  175. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/login/login-page.component.ts +89 -0
  176. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/not-found/not-found.component.html +12 -0
  177. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/not-found/not-found.component.spec.ts +33 -0
  178. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/not-found/not-found.component.ts +15 -0
  179. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/profile/profile-page.component.html +126 -0
  180. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/profile/profile-page.component.ts +194 -0
  181. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/register/register-page.component.html +80 -0
  182. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/register/register-page.component.ts +93 -0
  183. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/reset-password/reset-password-page.component.html +60 -0
  184. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/pages/reset-password/reset-password-page.component.ts +96 -0
  185. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/app/utils/async-data.ts +99 -0
  186. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/index.html +14 -0
  187. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/main.ts +5 -0
  188. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/styles.scss +170 -0
  189. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/theme.scss +39 -0
  190. package/dist/force-app/main/default/uiBundles/angularexternalapp/src/types/sf-globals.d.ts +9 -0
  191. package/dist/force-app/main/default/uiBundles/angularexternalapp/tsconfig.app.json +11 -0
  192. package/dist/force-app/main/default/uiBundles/angularexternalapp/tsconfig.json +33 -0
  193. package/dist/force-app/main/default/uiBundles/angularexternalapp/tsconfig.spec.json +10 -0
  194. package/dist/force-app/main/default/uiBundles/angularexternalapp/ui-bundle.json +7 -0
  195. package/dist/jest.config.js +6 -0
  196. package/dist/package-lock.json +10066 -0
  197. package/dist/package.json +46 -0
  198. package/dist/scripts/apex/hello.apex +10 -0
  199. package/dist/scripts/gitignore-templates.json +4 -0
  200. package/dist/scripts/graphql-search.sh +191 -0
  201. package/dist/scripts/org-setup-config-schema.mjs +103 -0
  202. package/dist/scripts/org-setup-dev.mjs +87 -0
  203. package/dist/scripts/org-setup-utils.mjs +369 -0
  204. package/dist/scripts/org-setup-xml.mjs +182 -0
  205. package/dist/scripts/org-setup.config.json +9 -0
  206. package/dist/scripts/org-setup.mjs +1702 -0
  207. package/dist/scripts/sf-project-setup.mjs +103 -0
  208. package/dist/scripts/soql/account.soql +6 -0
  209. package/dist/scripts/validate-org-setup-config.mjs +38 -0
  210. package/dist/sfdx-project.json +12 -0
  211. package/package.json +40 -0
@@ -0,0 +1,196 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { Injectable, inject } from "@angular/core";
7
+ // DataClient is provided by the base-angular-app. Consumed via the
8
+ // `__inherit__` stub one level up (app/api/account/ -> app/api/); post-compose
9
+ // patches-cli strips the prefix so it resolves to the seeded base file at
10
+ // app/api/data-client.service.ts.
11
+ import { DataClient } from "../data-client.service";
12
+ // Query constants are owned by this feature (sibling files) so object-search
13
+ // is self-contained — no external GraphQL dependency.
14
+ import { SEARCH_ACCOUNTS } from "./searchAccounts";
15
+ import { GET_ACCOUNT_DETAIL } from "./getAccountDetail";
16
+ import { DISTINCT_ACCOUNT_INDUSTRIES } from "./distinctAccountIndustries";
17
+ import { DISTINCT_ACCOUNT_TYPES } from "./distinctAccountTypes";
18
+
19
+ // ---------------------------------------------------------------------------
20
+ // Local response shape types. Codegen is PARKED for the Angular port; when it
21
+ // lands, replace these hand-written interfaces with the generated ones from
22
+ // graphql-operations-types (see the React reference for the equivalent).
23
+ // ---------------------------------------------------------------------------
24
+
25
+ /** A Salesforce GraphQL scalar field: `{ value, displayValue }`. */
26
+ export interface UiScalarField<T = unknown> {
27
+ value?: T | null;
28
+ displayValue?: string | null;
29
+ }
30
+
31
+ /** An Account node with the fields the search + detail queries request. */
32
+ export interface AccountNode {
33
+ Id: string;
34
+ Name?: UiScalarField<string> | null;
35
+ Industry?: UiScalarField<string> | null;
36
+ Type?: UiScalarField<string> | null;
37
+ Phone?: UiScalarField<string> | null;
38
+ Owner?: { Name?: UiScalarField<string> | null } | null;
39
+ AnnualRevenue?: UiScalarField<number> | null;
40
+ // Detail-only fields (undefined in list responses).
41
+ Fax?: UiScalarField<string> | null;
42
+ Parent?: { Name?: UiScalarField<string> | null } | null;
43
+ Website?: UiScalarField<string> | null;
44
+ NumberOfEmployees?: UiScalarField<number> | null;
45
+ Description?: UiScalarField<string> | null;
46
+ BillingStreet?: UiScalarField<string> | null;
47
+ BillingCity?: UiScalarField<string> | null;
48
+ BillingState?: UiScalarField<string> | null;
49
+ BillingPostalCode?: UiScalarField<string> | null;
50
+ BillingCountry?: UiScalarField<string> | null;
51
+ ShippingStreet?: UiScalarField<string> | null;
52
+ ShippingCity?: UiScalarField<string> | null;
53
+ ShippingState?: UiScalarField<string> | null;
54
+ ShippingPostalCode?: UiScalarField<string> | null;
55
+ ShippingCountry?: UiScalarField<string> | null;
56
+ CreatedBy?: { Name?: UiScalarField<string> | null } | null;
57
+ CreatedDate?: UiScalarField<string> | null;
58
+ LastModifiedBy?: { Name?: UiScalarField<string> | null } | null;
59
+ LastModifiedDate?: UiScalarField<string> | null;
60
+ }
61
+
62
+ /** GraphQL page-info block returned by the connection response. */
63
+ export interface AccountPageInfo {
64
+ hasNextPage?: boolean;
65
+ hasPreviousPage?: boolean;
66
+ endCursor?: string | null;
67
+ startCursor?: string | null;
68
+ }
69
+
70
+ /** The `uiapi.query.Account` connection returned by the search query. */
71
+ export interface AccountSearchResult {
72
+ edges: Array<{ node: AccountNode } | null> | null;
73
+ pageInfo: AccountPageInfo;
74
+ totalCount?: number;
75
+ }
76
+
77
+ /** Wire shape for the `search` query. */
78
+ interface SearchAccountsData {
79
+ uiapi: { query: { Account: AccountSearchResult | null } };
80
+ }
81
+
82
+ /** Wire shape for the `getAccountDetail` query. */
83
+ interface GetAccountDetailData {
84
+ uiapi: {
85
+ query: {
86
+ Account: { edges: Array<{ node: AccountNode } | null> | null } | null;
87
+ };
88
+ };
89
+ }
90
+
91
+ /** Wire shape for the distinct-value aggregate queries. */
92
+ interface DistinctAccountData {
93
+ uiapi: {
94
+ aggregate: {
95
+ Account: {
96
+ edges: Array<{
97
+ node: {
98
+ aggregate?: Record<
99
+ string,
100
+ {
101
+ value?: string | null;
102
+ displayValue?: string | null;
103
+ label?: string | null;
104
+ } | null
105
+ > | null;
106
+ };
107
+ } | null> | null;
108
+ } | null;
109
+ };
110
+ };
111
+ }
112
+
113
+ /** Picklist option shape shared with filter components. */
114
+ export interface PicklistOption {
115
+ value: string;
116
+ label: string;
117
+ }
118
+
119
+ /** Search args mirroring the React `AccountSearchOptions`. */
120
+ export interface AccountSearchArgs {
121
+ where?: unknown;
122
+ orderBy?: unknown;
123
+ first?: number;
124
+ after?: string;
125
+ }
126
+
127
+ /**
128
+ * Angular account-search data service.
129
+ *
130
+ * Wraps the base-app's `DataClient` with typed methods per feature query
131
+ * (search, detail, and the two distinct-value aggregates that populate the
132
+ * Industry / Type filter options). Provided in root; the service is stateless
133
+ * (all state lives in `ObjectSearchStateService` per-page).
134
+ *
135
+ * Mirrors the React `accountSearchService` module — the shape of the returned
136
+ * data is identical so the templates can be a straight JSX-to-Angular port.
137
+ */
138
+ @Injectable({ providedIn: "root" })
139
+ export class AccountSearchService {
140
+ private readonly client = inject(DataClient);
141
+
142
+ /** Runs the search query and returns the `Account` connection. */
143
+ async searchAccounts(args: AccountSearchArgs = {}): Promise<AccountSearchResult> {
144
+ const { where, orderBy, first = 20, after } = args;
145
+ const data = await this.client.execute<SearchAccountsData, AccountSearchArgs>(SEARCH_ACCOUNTS, {
146
+ where,
147
+ orderBy,
148
+ first,
149
+ after,
150
+ });
151
+ const account = data.uiapi.query.Account;
152
+ if (!account) {
153
+ throw new Error("No Account data returned");
154
+ }
155
+ return account;
156
+ }
157
+
158
+ /** Fetches a single Account by Id; returns `null` if not found. */
159
+ async getAccountDetail(id: string): Promise<AccountNode | null> {
160
+ const data = await this.client.execute<GetAccountDetailData, { id: string }>(
161
+ GET_ACCOUNT_DETAIL,
162
+ { id },
163
+ );
164
+ return data.uiapi.query.Account?.edges?.[0]?.node ?? null;
165
+ }
166
+
167
+ /** Distinct `Industry` values for the picklist filter. */
168
+ async fetchDistinctIndustries(): Promise<PicklistOption[]> {
169
+ return this.fetchDistinctValues("Industry", DISTINCT_ACCOUNT_INDUSTRIES);
170
+ }
171
+
172
+ /** Distinct `Type` values for the multipicklist filter. */
173
+ async fetchDistinctTypes(): Promise<PicklistOption[]> {
174
+ return this.fetchDistinctValues("Type", DISTINCT_ACCOUNT_TYPES);
175
+ }
176
+
177
+ /**
178
+ * Shared distinct-value shape parser. Mirrors the React
179
+ * `fetchDistinctValues` in `objectSearchService.ts`: pulls
180
+ * `uiapi.aggregate.Account.edges[].node.aggregate[fieldName]` and derives a
181
+ * `{ value, label }` option, preferring `label` -> `displayValue` -> `value`
182
+ * as the display string.
183
+ */
184
+ private async fetchDistinctValues(fieldName: string, query: string): Promise<PicklistOption[]> {
185
+ const data = await this.client.execute<DistinctAccountData>(query);
186
+ const edges = data.uiapi.aggregate.Account?.edges ?? [];
187
+ const options: PicklistOption[] = [];
188
+ for (const edge of edges) {
189
+ const field = edge?.node.aggregate?.[fieldName];
190
+ const value = field?.value;
191
+ if (!value) continue;
192
+ options.push({ value, label: field.label ?? field.displayValue ?? value });
193
+ }
194
+ return options;
195
+ }
196
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export const DISTINCT_ACCOUNT_INDUSTRIES = /* GraphQL */ `
7
+ query DistinctAccountIndustries {
8
+ uiapi {
9
+ aggregate {
10
+ Account(groupBy: { Industry: { group: true } }) {
11
+ edges {
12
+ node {
13
+ aggregate @optional {
14
+ Industry @optional {
15
+ value
16
+ displayValue
17
+ label
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ `;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export const DISTINCT_ACCOUNT_TYPES = /* GraphQL */ `
7
+ query DistinctAccountTypes {
8
+ uiapi {
9
+ aggregate {
10
+ Account(groupBy: { Type: { group: true } }) {
11
+ edges {
12
+ node {
13
+ aggregate @optional {
14
+ Type @optional {
15
+ value
16
+ displayValue
17
+ label
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ `;
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export const GET_ACCOUNT_DETAIL = /* GraphQL */ `
7
+ query GetAccountDetail($id: ID!) {
8
+ uiapi {
9
+ query {
10
+ Account(where: { Id: { eq: $id } }) {
11
+ edges {
12
+ node {
13
+ Id
14
+ Name @optional {
15
+ value
16
+ displayValue
17
+ }
18
+ Owner @optional {
19
+ Name @optional {
20
+ value
21
+ displayValue
22
+ }
23
+ }
24
+ Phone @optional {
25
+ value
26
+ displayValue
27
+ }
28
+ Fax @optional {
29
+ value
30
+ displayValue
31
+ }
32
+ Parent @optional {
33
+ Name @optional {
34
+ value
35
+ displayValue
36
+ }
37
+ }
38
+ Website @optional {
39
+ value
40
+ displayValue
41
+ }
42
+ Type @optional {
43
+ value
44
+ displayValue
45
+ }
46
+ NumberOfEmployees @optional {
47
+ value
48
+ displayValue
49
+ }
50
+ Industry @optional {
51
+ value
52
+ displayValue
53
+ }
54
+ AnnualRevenue @optional {
55
+ value
56
+ displayValue
57
+ }
58
+ Description @optional {
59
+ value
60
+ displayValue
61
+ }
62
+ BillingStreet @optional {
63
+ value
64
+ displayValue
65
+ }
66
+ BillingCity @optional {
67
+ value
68
+ displayValue
69
+ }
70
+ BillingState @optional {
71
+ value
72
+ displayValue
73
+ }
74
+ BillingPostalCode @optional {
75
+ value
76
+ displayValue
77
+ }
78
+ BillingCountry @optional {
79
+ value
80
+ displayValue
81
+ }
82
+ ShippingStreet @optional {
83
+ value
84
+ displayValue
85
+ }
86
+ ShippingCity @optional {
87
+ value
88
+ displayValue
89
+ }
90
+ ShippingState @optional {
91
+ value
92
+ displayValue
93
+ }
94
+ ShippingPostalCode @optional {
95
+ value
96
+ displayValue
97
+ }
98
+ ShippingCountry @optional {
99
+ value
100
+ displayValue
101
+ }
102
+ CreatedBy @optional {
103
+ Name @optional {
104
+ value
105
+ displayValue
106
+ }
107
+ }
108
+ CreatedDate @optional {
109
+ value
110
+ displayValue
111
+ }
112
+ LastModifiedBy @optional {
113
+ Name @optional {
114
+ value
115
+ displayValue
116
+ }
117
+ }
118
+ LastModifiedDate @optional {
119
+ value
120
+ displayValue
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ `;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export const SEARCH_ACCOUNTS = /* GraphQL */ `
7
+ query SearchAccounts(
8
+ $first: Int
9
+ $after: String
10
+ $where: Account_Filter
11
+ $orderBy: Account_OrderBy
12
+ ) {
13
+ uiapi {
14
+ query {
15
+ Account(first: $first, after: $after, where: $where, orderBy: $orderBy) {
16
+ edges {
17
+ node {
18
+ Id
19
+ Name @optional {
20
+ value
21
+ displayValue
22
+ }
23
+ Industry @optional {
24
+ value
25
+ displayValue
26
+ }
27
+ Type @optional {
28
+ value
29
+ displayValue
30
+ }
31
+ Phone @optional {
32
+ value
33
+ displayValue
34
+ }
35
+ Owner @optional {
36
+ Name @optional {
37
+ value
38
+ displayValue
39
+ }
40
+ }
41
+ AnnualRevenue @optional {
42
+ value
43
+ displayValue
44
+ }
45
+ }
46
+ }
47
+ pageInfo {
48
+ hasNextPage
49
+ hasPreviousPage
50
+ endCursor
51
+ startCursor
52
+ }
53
+ totalCount
54
+ }
55
+ }
56
+ }
57
+ }
58
+ `;
@@ -0,0 +1,184 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { DataClient } from './data-client.service';
3
+ import { createDataSDK } from '@salesforce/platform-sdk';
4
+
5
+ vi.mock('@salesforce/platform-sdk', () => ({
6
+ createDataSDK: vi.fn(),
7
+ }));
8
+
9
+ describe('DataClient', () => {
10
+ let service: DataClient;
11
+ let mockGraphqlQuery: ReturnType<typeof vi.fn>;
12
+ let mockGraphqlMutate: ReturnType<typeof vi.fn>;
13
+ let mockFetch: ReturnType<typeof vi.fn>;
14
+
15
+ beforeEach(async () => {
16
+ mockGraphqlQuery = vi.fn();
17
+ mockGraphqlMutate = vi.fn();
18
+ mockFetch = vi.fn();
19
+
20
+ vi.mocked(createDataSDK).mockResolvedValue({
21
+ graphql: {
22
+ query: mockGraphqlQuery,
23
+ mutate: mockGraphqlMutate,
24
+ },
25
+ fetch: mockFetch,
26
+ } as any);
27
+
28
+ await TestBed.configureTestingModule({
29
+ providers: [DataClient],
30
+ }).compileComponents();
31
+
32
+ service = TestBed.inject(DataClient);
33
+ });
34
+
35
+ afterEach(() => {
36
+ vi.clearAllMocks();
37
+ });
38
+
39
+ it('should create the service', () => {
40
+ expect(service).toBeTruthy();
41
+ expect(service).toBeInstanceOf(DataClient);
42
+ });
43
+
44
+ it('should route plain query operations to graphql.query and return result.data', async () => {
45
+ const operation = 'query { user { id name } }';
46
+ const expectedData = { user: { id: '123', name: 'Test User' } };
47
+ mockGraphqlQuery.mockResolvedValue({ data: expectedData });
48
+
49
+ const result = await service.execute(operation);
50
+
51
+ expect(mockGraphqlQuery).toHaveBeenCalledWith({ query: operation, variables: undefined });
52
+ expect(mockGraphqlMutate).not.toHaveBeenCalled();
53
+ expect(result).toEqual(expectedData);
54
+ });
55
+
56
+ it('should route anonymous query operations to graphql.query', async () => {
57
+ const operation = '{ user { id name } }';
58
+ const expectedData = { user: { id: '456', name: 'Anonymous User' } };
59
+ mockGraphqlQuery.mockResolvedValue({ data: expectedData });
60
+
61
+ const result = await service.execute(operation);
62
+
63
+ expect(mockGraphqlQuery).toHaveBeenCalledWith({ query: operation, variables: undefined });
64
+ expect(mockGraphqlMutate).not.toHaveBeenCalled();
65
+ expect(result).toEqual(expectedData);
66
+ });
67
+
68
+ it('should route mutation operations to graphql.mutate', async () => {
69
+ const operation = 'mutation { updateUser(id: "123", name: "New Name") { id name } }';
70
+ const expectedData = { updateUser: { id: '123', name: 'New Name' } };
71
+ mockGraphqlMutate.mockResolvedValue({ data: expectedData });
72
+
73
+ const result = await service.execute(operation);
74
+
75
+ expect(mockGraphqlMutate).toHaveBeenCalledWith({ mutation: operation, variables: undefined });
76
+ expect(mockGraphqlQuery).not.toHaveBeenCalled();
77
+ expect(result).toEqual(expectedData);
78
+ });
79
+
80
+ it('should detect mutation with leading GraphQL comment and route to graphql.mutate', async () => {
81
+ const operation = '# This is a comment\nmutation { deleteUser(id: "123") { success } }';
82
+ const expectedData = { deleteUser: { success: true } };
83
+ mockGraphqlMutate.mockResolvedValue({ data: expectedData });
84
+
85
+ const result = await service.execute(operation);
86
+
87
+ expect(mockGraphqlMutate).toHaveBeenCalledWith({ mutation: operation, variables: undefined });
88
+ expect(mockGraphqlQuery).not.toHaveBeenCalled();
89
+ expect(result).toEqual(expectedData);
90
+ });
91
+
92
+ it('should not treat query as mutation when comment contains "mutation" word', async () => {
93
+ const operation = '# this is not a mutation, just a query\nquery { user { id } }';
94
+ const expectedData = { user: { id: '789' } };
95
+ mockGraphqlQuery.mockResolvedValue({ data: expectedData });
96
+
97
+ const result = await service.execute(operation);
98
+
99
+ expect(mockGraphqlQuery).toHaveBeenCalledWith({ query: operation, variables: undefined });
100
+ expect(mockGraphqlMutate).not.toHaveBeenCalled();
101
+ expect(result).toEqual(expectedData);
102
+ });
103
+
104
+ it('should throw error when result.errors contains errors', async () => {
105
+ const operation = 'query { user { id } }';
106
+ mockGraphqlQuery.mockResolvedValue({
107
+ data: null,
108
+ errors: [{ message: 'Field not found' }, { message: 'Permission denied' }],
109
+ });
110
+
111
+ await expect(service.execute(operation)).rejects.toThrow(
112
+ 'GraphQL Error: Field not found; Permission denied',
113
+ );
114
+ });
115
+
116
+ it('should throw error when result.errors contains a single error', async () => {
117
+ const operation = 'query { user { id } }';
118
+ mockGraphqlQuery.mockResolvedValue({
119
+ data: null,
120
+ errors: [{ message: 'Unauthorized' }],
121
+ });
122
+
123
+ await expect(service.execute(operation)).rejects.toThrow('GraphQL Error: Unauthorized');
124
+ });
125
+
126
+ it('should throw error when result.data is null with no errors', async () => {
127
+ const operation = 'query { user { id } }';
128
+ mockGraphqlQuery.mockResolvedValue({ data: null });
129
+
130
+ await expect(service.execute(operation)).rejects.toThrow('GraphQL response data is null');
131
+ });
132
+
133
+ it('should pass variables through to graphql.query', async () => {
134
+ const operation = 'query GetUser($id: ID!) { user(id: $id) { id name } }';
135
+ const variables = { id: '999' };
136
+ const expectedData = { user: { id: '999', name: 'Variable User' } };
137
+ mockGraphqlQuery.mockResolvedValue({ data: expectedData });
138
+
139
+ const result = await service.execute(operation, variables);
140
+
141
+ expect(mockGraphqlQuery).toHaveBeenCalledWith({ query: operation, variables });
142
+ expect(result).toEqual(expectedData);
143
+ });
144
+
145
+ it('should pass variables through to graphql.mutate', async () => {
146
+ const operation =
147
+ 'mutation UpdateUser($id: ID!, $name: String!) { updateUser(id: $id, name: $name) { id name } }';
148
+ const variables = { id: '888', name: 'Updated Name' };
149
+ const expectedData = { updateUser: { id: '888', name: 'Updated Name' } };
150
+ mockGraphqlMutate.mockResolvedValue({ data: expectedData });
151
+
152
+ const result = await service.execute(operation, variables);
153
+
154
+ expect(mockGraphqlMutate).toHaveBeenCalledWith({ mutation: operation, variables });
155
+ expect(result).toEqual(expectedData);
156
+ });
157
+
158
+ it('should proxy fetch to sdk.fetch and return the raw Response', async () => {
159
+ const url = '/services/apexrest/auth/login';
160
+ const init: RequestInit = {
161
+ method: 'POST',
162
+ body: JSON.stringify({ email: 'a@b.com' }),
163
+ headers: { 'Content-Type': 'application/json' },
164
+ };
165
+ const expectedResponse = { ok: true, status: 200 } as Response;
166
+ mockFetch.mockResolvedValue(expectedResponse);
167
+
168
+ const response = await service.fetch(url, init);
169
+
170
+ expect(mockFetch).toHaveBeenCalledWith(url, init);
171
+ expect(response).toBe(expectedResponse);
172
+ });
173
+
174
+ it('should call fetch with no init when omitted', async () => {
175
+ const url = '/services/data/v64.0/chatter/users/me';
176
+ const expectedResponse = { ok: true, status: 200 } as Response;
177
+ mockFetch.mockResolvedValue(expectedResponse);
178
+
179
+ const response = await service.fetch(url);
180
+
181
+ expect(mockFetch).toHaveBeenCalledWith(url, undefined);
182
+ expect(response).toBe(expectedResponse);
183
+ });
184
+ });
@@ -0,0 +1,74 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { createDataSDK } from '@salesforce/platform-sdk';
3
+
4
+ /**
5
+ * True when the operation's first definition is a `mutation`. Strips GraphQL
6
+ * comments first so a leading `# ...` line can't mask the keyword. Queries
7
+ * (named or anonymous `{ ... }` shorthand) and subscriptions fall through to
8
+ * query().
9
+ */
10
+ function isMutation(operation: string): boolean {
11
+ return /^\s*mutation\b/.test(operation.replace(/#[^\n\r]*/g, ''));
12
+ }
13
+
14
+ /**
15
+ * The single data-access client for the app — a thin wrapper over
16
+ * `createDataSDK` that centralizes both of the SDK's surfaces:
17
+ *
18
+ * - `execute()` for GraphQL (routes mutations to `sdk.graphql.mutate` and
19
+ * everything else to `sdk.graphql.query`, with centralized error handling).
20
+ * Use with gql-tagged queries and generated operation types for type-safe
21
+ * calls.
22
+ * - `fetch()` for REST (proxies `sdk.fetch`, returning the raw `Response` so
23
+ * callers keep full control over response parsing / error shaping).
24
+ *
25
+ * Consumers inject this instead of calling `createDataSDK` directly, so the SDK
26
+ * bootstrap lives in exactly one place. Feature packages consume it via an
27
+ * `__inherit__data-client.service` stub (base wins at compose).
28
+ */
29
+ @Injectable({ providedIn: 'root' })
30
+ export class DataClient {
31
+ /**
32
+ * Executes a GraphQL operation and returns its `data`, throwing on GraphQL
33
+ * errors or a null payload.
34
+ */
35
+ async execute<TData, TVariables = Record<string, unknown>>(
36
+ operation: string,
37
+ variables?: TVariables,
38
+ ): Promise<TData> {
39
+ const data = await createDataSDK();
40
+ const result = isMutation(operation)
41
+ ? await data.graphql!.mutate<TData, TVariables>({
42
+ mutation: operation,
43
+ variables,
44
+ })
45
+ : await data.graphql!.query<TData, TVariables>({
46
+ query: operation,
47
+ variables,
48
+ });
49
+
50
+ if (result.errors?.length) {
51
+ const msg = result.errors.map((e) => e.message).join('; ');
52
+ throw new Error(`GraphQL Error: ${msg}`);
53
+ }
54
+
55
+ if (result.data == null) {
56
+ throw new Error('GraphQL response data is null');
57
+ }
58
+
59
+ return result.data;
60
+ }
61
+
62
+ /**
63
+ * Performs a REST request through the SDK's authenticated `fetch`, returning
64
+ * the raw `Response`. Callers parse the body / shape errors themselves (e.g.
65
+ * via `handleApiResponse`).
66
+ *
67
+ * @param input - The request URL (e.g. an Apex REST route).
68
+ * @param init - Standard `fetch` options (method, headers, body, …).
69
+ */
70
+ async fetch(input: string, init?: RequestInit): Promise<Response> {
71
+ const sdk = await createDataSDK();
72
+ return sdk.fetch!(input, init);
73
+ }
74
+ }