@salesforce/ui-bundle-template-feature-angular-search 0.0.0-stage → 12.14.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.
- package/LICENSE.txt +82 -0
- package/README.md +75 -2
- package/dist/.forceignore +15 -0
- package/dist/.husky/pre-commit +4 -0
- package/dist/.prettierignore +11 -0
- package/dist/.prettierrc +17 -0
- package/dist/CHANGELOG.md +5375 -0
- package/dist/README.md +83 -0
- package/dist/config/project-scratch-def.json +13 -0
- package/dist/eslint.config.js +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.postcssrc.json +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.prettierignore +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.prettierrc +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/CHANGELOG.md +4 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/README.md +85 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/angular.json +98 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/components.json +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/e2e/app.spec.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/esbuild/api-version.mjs +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/esbuild/graphql-codegen.mjs +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/eslint-plugin-angular-graphql.js +148 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/eslint.config.js +77 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/feature-angular-search.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/middleware/html.mjs +3 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/middleware/proxy.mjs +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/package.json +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/playwright.config.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/public/favicon.ico +0 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/scripts/get-graphql-schema.mjs +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/scripts/rewrite-e2e-assets.mjs +30 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/api/data-client.service.spec.ts +184 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/api/data-client.service.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.config.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.html +1 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.routes.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.spec.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/layout/app-layout/app-layout.html +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/layout/app-layout/app-layout.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/alert/alert.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/alert/alert.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/button/button.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/button/button.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/card/card.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/collapsible/collapsible.html +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/collapsible/collapsible.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-picker/date-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-picker/date-picker.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dialog/dialog.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dialog/dialog.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field/field.html +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field/field.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field-appearance.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field-size.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/icon/icon.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/input/input.html +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/input/input.ts +79 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/label/label.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/paginator/paginator.html +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/paginator/paginator.ts +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/paginator/types.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/popover/popover.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/popover/popover.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/select/select.html +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/select/select.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/separator/separator.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/skeleton/skeleton.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/spinner/spinner.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/registry.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/sobject/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/sobject/parse-response.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/sobject/query-fragment.ts +169 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/types.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search-response.spec.ts +114 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search-response.ts +73 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search.service.spec.ts +124 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search.service.ts +80 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/active-filters/active-filters.html +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/active-filters/active-filters.spec.ts +73 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/active-filters/active-filters.ts +77 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/default-filter-panel.html +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/default-filter-panel.ts +87 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/filter-box.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/filter-box.ts +39 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/global-search-box/global-search-box.html +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/global-search-box/global-search-box.ts +50 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/default-result-row.html +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/default-result-row.ts +91 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/merged-search-results.html +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/merged-search-results.ts +145 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/result-item.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/search-results.html +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/search-results.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/source-section.html +84 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/source-section.ts +146 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/scope/scope-selector.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/scope/scope-selector.ts +45 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search/search.html +55 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search/search.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search-bar/search-bar.html +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search-bar/search-bar.spec.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search-bar/search-bar.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/sort-control/sort-control.html +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/sort-control/sort-control.spec.ts +67 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/sort-control/sort-control.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/constants.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/default-search-config.ts +83 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/directives/search-result-template/search-result-template.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/boolean-filter.html +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/boolean-filter.spec.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/boolean-filter.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-filter.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-filter.spec.ts +56 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-filter.ts +78 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-range-filter.html +43 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-range-filter.spec.ts +70 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-range-filter.ts +125 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-field-wrapper.html +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-field-wrapper.spec.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-field-wrapper.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-types.spec.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-types.ts +64 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/multi-select-filter.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/multi-select-filter.spec.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/multi-select-filter.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/numeric-range-filter.html +32 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/numeric-range-filter.spec.ts +75 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/numeric-range-filter.ts +117 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/select-filter.html +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/select-filter.spec.ts +43 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/select-filter.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/text-filter.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/text-filter.spec.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/text-filter.ts +70 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/index.ts +55 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/query/build-search-query.spec.ts +157 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/query/build-search-query.ts +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/filter-mapping.ts +48 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/search-state.service.spec.ts +293 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/search-state.service.ts +735 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/search-state.types.ts +48 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/filter.types.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/index.ts +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/scope.types.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/search-config.types.ts +110 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/search-result.types.ts +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/sort.types.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/debounce.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/field-utils.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/filter-utils.spec.ts +335 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/filter-utils.ts +354 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/identifier.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/merge-utils.spec.ts +199 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/merge-utils.ts +177 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/scope-utils.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/sort-utils.ts +32 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/validate-config.spec.ts +48 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/validate-config.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/home/home.html +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/home/home.spec.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/home/home.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/not-found/not-found.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/not-found/not-found.spec.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/not-found/not-found.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/search/search-page.html +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/search/search-page.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert-action.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert-title.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/button/hlm-button.token.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/button/hlm-button.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/button/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-calendar.ts +189 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-action.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-avatar.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-footer.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-header.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card.token.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/index.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/index.ts +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/index.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/index.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-description.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-error.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-group.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-legend.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-separator.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-set.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-title.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/index.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input/hlm-input.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/label/hlm-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/label/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/label/label.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-content.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-content.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-item.ts +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-label.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-multiple.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-placeholder.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-separator.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-trigger.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-value-template.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-value.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-values-content.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-values.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/index.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/separator/hlm-separator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/separator/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/skeleton/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/spinner/hlm-spinner.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/spinner/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/utils/hlm.ts +313 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/utils/index.ts +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/utils/async-data.ts +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/index.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/main.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/styles.css +139 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/types/sf-globals.d.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/tsconfig.app.json +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/tsconfig.json +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/tsconfig.spec.json +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/ui-bundle.json +7 -0
- package/dist/jest.config.js +6 -0
- package/dist/package-lock.json +12554 -0
- package/dist/package.json +46 -0
- package/dist/scripts/apex/hello.apex +10 -0
- package/dist/scripts/gitignore-templates.json +4 -0
- package/dist/scripts/graphql-search.sh +191 -0
- package/dist/scripts/network-senders.mjs +84 -0
- package/dist/scripts/org-setup-config-schema.mjs +132 -0
- package/dist/scripts/org-setup-dev.mjs +114 -0
- package/dist/scripts/org-setup-url.mjs +108 -0
- package/dist/scripts/org-setup-utils.mjs +569 -0
- package/dist/scripts/org-setup-xml.mjs +283 -0
- package/dist/scripts/org-setup.config.json +5 -0
- package/dist/scripts/org-setup.mjs +2545 -0
- package/dist/scripts/sf-project-setup.mjs +103 -0
- package/dist/scripts/soql/account.soql +6 -0
- package/dist/scripts/validate-org-setup-config.mjs +38 -0
- package/dist/sfdx-project.json +12 -0
- package/package.json +43 -4
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@salesforce/ui-bundle-template-base-sfdx-project",
|
|
3
|
+
"version": "12.14.0",
|
|
4
|
+
"description": "Base SFDX project template",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"sf-project-setup": "node scripts/sf-project-setup.mjs",
|
|
11
|
+
"build": "echo 'No build required for base-sfdx-project'",
|
|
12
|
+
"clean": "echo 'No clean required for base-sfdx-project'",
|
|
13
|
+
"lint": "eslint --no-error-on-unmatched-pattern **/{aura,lwc}/**/*.js",
|
|
14
|
+
"validate:org-setup-config": "node scripts/validate-org-setup-config.mjs",
|
|
15
|
+
"test": "npm run test:unit",
|
|
16
|
+
"test:coverage": "npm run test",
|
|
17
|
+
"test:unit": "sfdx-lwc-jest -- --passWithNoTests",
|
|
18
|
+
"test:unit:watch": "sfdx-lwc-jest --watch",
|
|
19
|
+
"test:unit:debug": "sfdx-lwc-jest --debug",
|
|
20
|
+
"test:unit:coverage": "sfdx-lwc-jest --coverage",
|
|
21
|
+
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
|
|
22
|
+
"prettier:verify": "prettier --check \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
|
|
23
|
+
"precommit": "lint-staged",
|
|
24
|
+
"setup": "node scripts/org-setup.mjs",
|
|
25
|
+
"dev:preview": "node scripts/org-setup-dev.mjs"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"fast-xml-parser": "^5.9.3",
|
|
29
|
+
"zod": "^3.24.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@lwc/eslint-plugin-lwc": "^3.3.0",
|
|
33
|
+
"@prettier/plugin-xml": "^3.2.2",
|
|
34
|
+
"@salesforce/eslint-config-lwc": "^4.1.0",
|
|
35
|
+
"@salesforce/eslint-plugin-aura": "^3.0.0",
|
|
36
|
+
"@salesforce/eslint-plugin-lightning": "^2.0.0",
|
|
37
|
+
"@salesforce/sfdx-lwc-jest": "^7.0.1",
|
|
38
|
+
"eslint": "^9.39.0",
|
|
39
|
+
"eslint-plugin-import": "^2.25.4",
|
|
40
|
+
"eslint-plugin-jest": "^28.8.1",
|
|
41
|
+
"husky": "^9.1.5",
|
|
42
|
+
"lint-staged": "^15.1.0",
|
|
43
|
+
"prettier": "^3.1.0",
|
|
44
|
+
"prettier-plugin-apex": "^2.0.1"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Use .apex files to store anonymous Apex.
|
|
2
|
+
// You can execute anonymous Apex in VS Code by selecting the
|
|
3
|
+
// apex text and running the command:
|
|
4
|
+
// SFDX: Execute Anonymous Apex with Currently Selected Text
|
|
5
|
+
// You can also execute the entire file by running the command:
|
|
6
|
+
// SFDX: Execute Anonymous Apex with Editor Contents
|
|
7
|
+
|
|
8
|
+
string tempvar = 'Enter_your_name_here';
|
|
9
|
+
System.debug('Hello World!');
|
|
10
|
+
System.debug('My name is ' + tempvar);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sfdx": "# This file is used for Git repositories to specify intentionally untracked files that Git should ignore. \n# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore\n# For useful gitignore templates see: https://github.com/github/gitignore\n\n# Salesforce cache\n.sf/\n.sfdx/\n.localdevserver/\ndeploy-options.json\n\n# LWC VSCode autocomplete\n**/lwc/jsconfig.json\n\n# LWC Jest coverage reports\ncoverage/\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Dependency directories\nnode_modules/\n\n# Eslint cache\n.eslintcache\n\n# MacOS system files\n.DS_Store\n\n# Windows system files\nThumbs.db\nehthumbs.db\n[Dd]esktop.ini\n$RECYCLE.BIN/\n\n# Local environment variables\n.env\n\n# Python Salesforce Functions\n**/__pycache__/\n**/.venv/\n**/venv/\n",
|
|
3
|
+
"webapp": "# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.\n\n# Compiled output\n/dist\n/tmp\n/out-tsc\n/bazel-out\n\n# Node\n/node_modules\nnpm-debug.log\nyarn-error.log\npackage-lock.json\n\n# Playwright\n/test-results/\n/playwright-report/\n/blob-report/\n/playwright/.cache/\n\n# IDEs and editors\n.idea/\n.project\n.classpath\n.c9/\n*.launch\n.settings/\n*.sublime-workspace\n\n# Visual Studio Code\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n!.vscode/mcp.json\n.history/*\n\n# Miscellaneous\n/.angular/cache\n.sass-cache/\n/connect.lock\n/coverage\n/libpeerconnection.log\ntestem.log\n/typings\n__screenshots__/\n\n# System files\n.DS_Store\nThumbs.db\n"
|
|
4
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail # exit on error (-e), undefined vars (-u), and propagate pipeline failures (-o pipefail)
|
|
3
|
+
# graphql-search.sh — Look up one or more Salesforce entities in schema.graphql.
|
|
4
|
+
#
|
|
5
|
+
# Run from the SFDX project root (where schema.graphql lives):
|
|
6
|
+
# bash scripts/graphql-search.sh Account
|
|
7
|
+
# bash scripts/graphql-search.sh Account Contact Opportunity
|
|
8
|
+
#
|
|
9
|
+
# Pass a custom schema path with -s / --schema:
|
|
10
|
+
# bash scripts/graphql-search.sh -s /path/to/schema.graphql Account
|
|
11
|
+
# bash scripts/graphql-search.sh --schema ./other/schema.graphql Account Contact
|
|
12
|
+
#
|
|
13
|
+
# Output sections per entity:
|
|
14
|
+
# 1. Type definition — all fields and relationships
|
|
15
|
+
# 2. Filter options — <Entity>_Filter input (for `where:`)
|
|
16
|
+
# 3. Sort options — <Entity>_OrderBy input (for `orderBy:`)
|
|
17
|
+
# 4. Create mutation wrapper — <Entity>CreateInput
|
|
18
|
+
# 5. Create mutation fields — <Entity>CreateRepresentation (for create mutations)
|
|
19
|
+
# 6. Update mutation wrapper — <Entity>UpdateInput
|
|
20
|
+
# 7. Update mutation fields — <Entity>UpdateRepresentation (for update mutations)
|
|
21
|
+
|
|
22
|
+
SCHEMA="./schema.graphql"
|
|
23
|
+
|
|
24
|
+
# ── Argument parsing ─────────────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
while [[ $# -gt 0 ]]; do
|
|
27
|
+
case "$1" in
|
|
28
|
+
-s|--schema)
|
|
29
|
+
if [[ -z "${2-}" || "$2" == -* ]]; then
|
|
30
|
+
echo "ERROR: --schema requires a file path argument"
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
SCHEMA="$2"
|
|
34
|
+
shift 2
|
|
35
|
+
;;
|
|
36
|
+
--)
|
|
37
|
+
shift
|
|
38
|
+
break
|
|
39
|
+
;;
|
|
40
|
+
-*)
|
|
41
|
+
echo "ERROR: Unknown option: $1"
|
|
42
|
+
echo "Usage: bash $0 [-s <schema-path>] <EntityName> [EntityName2 ...]"
|
|
43
|
+
exit 1
|
|
44
|
+
;;
|
|
45
|
+
*)
|
|
46
|
+
break
|
|
47
|
+
;;
|
|
48
|
+
esac
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
if [ $# -eq 0 ]; then
|
|
52
|
+
echo "Usage: bash $0 [-s <schema-path>] <EntityName> [EntityName2 ...]"
|
|
53
|
+
echo "Example: bash $0 Account"
|
|
54
|
+
echo "Example: bash $0 Account Contact Opportunity"
|
|
55
|
+
echo "Example: bash $0 --schema /path/to/schema.graphql Account"
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if [ ! -f "$SCHEMA" ]; then
|
|
60
|
+
echo "ERROR: schema.graphql not found at $SCHEMA"
|
|
61
|
+
echo " Make sure you are running from the SFDX project root, or pass the path explicitly:"
|
|
62
|
+
echo " bash $0 --schema <path/to/schema.graphql> <EntityName>"
|
|
63
|
+
echo " If the file is missing entirely, generate it from the ui-bundle dir:"
|
|
64
|
+
echo " cd force-app/main/default/uiBundles/<app-name> && npm run graphql:schema"
|
|
65
|
+
exit 1
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
if [ ! -r "$SCHEMA" ]; then
|
|
69
|
+
echo "ERROR: schema.graphql is not readable at $SCHEMA"
|
|
70
|
+
echo " Check file permissions: ls -la $SCHEMA"
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
if [ ! -s "$SCHEMA" ]; then
|
|
75
|
+
echo "ERROR: schema.graphql is empty at $SCHEMA"
|
|
76
|
+
echo " Regenerate it from the ui-bundle dir:"
|
|
77
|
+
echo " cd force-app/main/default/uiBundles/<app-name> && npm run graphql:schema"
|
|
78
|
+
exit 1
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# ── Helper: extract lines from a grep match through the closing brace ────────
|
|
82
|
+
# Prints up to MAX_LINES lines after (and including) the first match of PATTERN.
|
|
83
|
+
# Uses a generous line count — blocks are always closed by a "}" line.
|
|
84
|
+
|
|
85
|
+
extract_block() {
|
|
86
|
+
local label="$1"
|
|
87
|
+
local pattern="$2"
|
|
88
|
+
local max_lines="$3"
|
|
89
|
+
|
|
90
|
+
local match
|
|
91
|
+
local grep_exit=0
|
|
92
|
+
match=$(grep -nE "$pattern" "$SCHEMA" | head -1) || grep_exit=$?
|
|
93
|
+
|
|
94
|
+
if [ "$grep_exit" -eq 2 ]; then
|
|
95
|
+
echo " ERROR: grep failed on pattern: $pattern" >&2
|
|
96
|
+
return 1
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
if [ -z "$match" ]; then
|
|
100
|
+
echo " (not found: $pattern)"
|
|
101
|
+
return 3
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
echo "### $label"
|
|
105
|
+
grep -E "$pattern" "$SCHEMA" -A "$max_lines" | \
|
|
106
|
+
awk '/^\}$/{print; exit} {print}' | \
|
|
107
|
+
head -n "$max_lines" || true
|
|
108
|
+
echo ""
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
# ── Main loop ────────────────────────────────────────────────────────────────
|
|
112
|
+
|
|
113
|
+
for ENTITY in "$@"; do
|
|
114
|
+
# Validate entity name: must be a valid PascalCase identifier (letters, digits, underscores)
|
|
115
|
+
if [[ ! "$ENTITY" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then
|
|
116
|
+
echo "ERROR: Invalid entity name: '$ENTITY'"
|
|
117
|
+
echo " Entity names must start with a letter or underscore, followed by letters, digits, or underscores."
|
|
118
|
+
echo " Examples: Account, My_Custom_Object__c"
|
|
119
|
+
continue
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
echo ""
|
|
123
|
+
echo "======================================================================"
|
|
124
|
+
echo " SCHEMA LOOKUP: $ENTITY"
|
|
125
|
+
echo "======================================================================"
|
|
126
|
+
echo ""
|
|
127
|
+
|
|
128
|
+
found=0
|
|
129
|
+
|
|
130
|
+
# Helper: call extract_block, track matches, surface errors
|
|
131
|
+
try_extract() {
|
|
132
|
+
local rc=0
|
|
133
|
+
extract_block "$@" || rc=$?
|
|
134
|
+
if [ "$rc" -eq 0 ]; then
|
|
135
|
+
found=$((found + 1))
|
|
136
|
+
elif [ "$rc" -eq 1 ]; then
|
|
137
|
+
echo " Aborting lookup for '$ENTITY' due to grep error" >&2
|
|
138
|
+
fi
|
|
139
|
+
# rc=3 is not-found — continue silently (already printed by extract_block)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
# 1. Type definition — all fields and relationships
|
|
143
|
+
try_extract \
|
|
144
|
+
"Type definition — fields and relationships" \
|
|
145
|
+
"^type ${ENTITY} implements Record" \
|
|
146
|
+
200
|
|
147
|
+
|
|
148
|
+
# 2. Filter input — used in `where:` arguments
|
|
149
|
+
try_extract \
|
|
150
|
+
"Filter options — use in where: { ... }" \
|
|
151
|
+
"^input ${ENTITY}_Filter" \
|
|
152
|
+
100
|
|
153
|
+
|
|
154
|
+
# 3. OrderBy input — used in `orderBy:` arguments
|
|
155
|
+
try_extract \
|
|
156
|
+
"Sort options — use in orderBy: { ... }" \
|
|
157
|
+
"^input ${ENTITY}_OrderBy" \
|
|
158
|
+
60
|
|
159
|
+
|
|
160
|
+
# 4. Create mutation wrapper
|
|
161
|
+
try_extract \
|
|
162
|
+
"Create mutation wrapper — ${ENTITY}CreateInput" \
|
|
163
|
+
"^input ${ENTITY}CreateInput" \
|
|
164
|
+
10
|
|
165
|
+
|
|
166
|
+
# 5. Create mutation fields
|
|
167
|
+
try_extract \
|
|
168
|
+
"Create mutation fields — ${ENTITY}CreateRepresentation" \
|
|
169
|
+
"^input ${ENTITY}CreateRepresentation" \
|
|
170
|
+
100
|
|
171
|
+
|
|
172
|
+
# 6. Update mutation wrapper
|
|
173
|
+
try_extract \
|
|
174
|
+
"Update mutation wrapper — ${ENTITY}UpdateInput" \
|
|
175
|
+
"^input ${ENTITY}UpdateInput" \
|
|
176
|
+
10
|
|
177
|
+
|
|
178
|
+
# 7. Update mutation fields
|
|
179
|
+
try_extract \
|
|
180
|
+
"Update mutation fields — ${ENTITY}UpdateRepresentation" \
|
|
181
|
+
"^input ${ENTITY}UpdateRepresentation" \
|
|
182
|
+
100
|
|
183
|
+
|
|
184
|
+
if [ "$found" -eq 0 ]; then
|
|
185
|
+
echo "WARNING: No schema entries found for '$ENTITY'."
|
|
186
|
+
echo " - Names are PascalCase (e.g., 'Account' not 'account')"
|
|
187
|
+
echo " - Custom objects may need deployment first"
|
|
188
|
+
fi
|
|
189
|
+
|
|
190
|
+
echo ""
|
|
191
|
+
done
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join, resolve, dirname } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { XMLBuilder } from 'fast-xml-parser';
|
|
6
|
+
import { parseNetworkDocument, NetworkXmlError } from './org-setup-xml.mjs';
|
|
7
|
+
import { escapeSoqlString } from './org-setup-utils.mjs';
|
|
8
|
+
|
|
9
|
+
const builder = new XMLBuilder({
|
|
10
|
+
ignoreAttributes: false,
|
|
11
|
+
commentPropName: '#comment',
|
|
12
|
+
format: true,
|
|
13
|
+
indentBy: ' ',
|
|
14
|
+
suppressEmptyNode: true,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export function preserveNetworkSenders(projectDir, targetOrg, run = execFileSync) {
|
|
18
|
+
const project = JSON.parse(readFileSync(join(projectDir, 'sfdx-project.json'), 'utf8'));
|
|
19
|
+
const files = (project.packageDirectories ?? []).flatMap(({ path }) => {
|
|
20
|
+
const dir = join(projectDir, path, 'main/default/networks');
|
|
21
|
+
if (!existsSync(dir)) return [];
|
|
22
|
+
return readdirSync(dir)
|
|
23
|
+
.filter((name) => name.endsWith('.network-meta.xml'))
|
|
24
|
+
.map((name) => ({ name: name.slice(0, -'.network-meta.xml'.length), path: join(dir, name) }));
|
|
25
|
+
});
|
|
26
|
+
if (!files.length) return;
|
|
27
|
+
|
|
28
|
+
const names = [...new Set(files.map(({ name }) => `'${escapeSoqlString(name)}'`))];
|
|
29
|
+
const response = JSON.parse(run('sf', [
|
|
30
|
+
'data', 'query', '--target-org', targetOrg,
|
|
31
|
+
'--query', `SELECT Name, EmailSenderAddress FROM Network WHERE Name IN (${names.join(',')})`,
|
|
32
|
+
'--json',
|
|
33
|
+
], { cwd: projectDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60000 }));
|
|
34
|
+
if (response.status !== 0 || !Array.isArray(response.result?.records) || !response.result.done) {
|
|
35
|
+
throw new Error('Could not read all target Network sender addresses; deployment stopped.');
|
|
36
|
+
}
|
|
37
|
+
const senders = new Map(response.result.records.map((record) => [record.Name, record.EmailSenderAddress]));
|
|
38
|
+
|
|
39
|
+
const updates = files.map((file) => {
|
|
40
|
+
const original = readFileSync(file.path, 'utf8');
|
|
41
|
+
const document = parseNetworkDocument(original);
|
|
42
|
+
const network = document.Network;
|
|
43
|
+
let changed = false;
|
|
44
|
+
if (senders.has(file.name)) {
|
|
45
|
+
const sender = senders.get(file.name);
|
|
46
|
+
if (typeof sender !== 'string' || !sender.trim()) {
|
|
47
|
+
throw new Error(`The target Network "${file.name}" has no sender address; deployment stopped.`);
|
|
48
|
+
}
|
|
49
|
+
if (typeof network.emailSenderAddress !== 'string') {
|
|
50
|
+
throw new NetworkXmlError(`Expected one emailSenderAddress in ${file.name}.network-meta.xml`);
|
|
51
|
+
}
|
|
52
|
+
if (network.emailSenderAddress !== sender) {
|
|
53
|
+
network.emailSenderAddress = sender;
|
|
54
|
+
changed = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Sender changes belong to the site's Administration workspace.
|
|
58
|
+
if ('newSenderAddress' in network) {
|
|
59
|
+
delete network.newSenderAddress;
|
|
60
|
+
changed = true;
|
|
61
|
+
}
|
|
62
|
+
return { ...file, xml: changed ? builder.build(document) : original, changed };
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
for (const file of updates) {
|
|
66
|
+
if (file.changed) writeFileSync(file.path, file.xml);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
71
|
+
const args = process.argv.slice(2);
|
|
72
|
+
if (args.length !== 2 || args[0] !== '--target-org' || !args[1].trim()) {
|
|
73
|
+
console.error('Usage: node scripts/network-senders.mjs --target-org <alias>');
|
|
74
|
+
process.exitCode = 1;
|
|
75
|
+
} else {
|
|
76
|
+
try {
|
|
77
|
+
preserveNetworkSenders(resolve(dirname(fileURLToPath(import.meta.url)), '..'), args[1]);
|
|
78
|
+
console.log('Network metadata prepared with the target org sender addresses.');
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error(`Network metadata preparation failed: ${error.message}`);
|
|
81
|
+
process.exitCode = 1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared schema + validator for org-setup.config.json (W-23043729).
|
|
3
|
+
*
|
|
4
|
+
* Authored ONCE, used at TWO moments:
|
|
5
|
+
* (a) build / CI time — `scripts/validate-org-setup-config.mjs` validates every
|
|
6
|
+
* org-setup.config.json this repo ships, failing the build on any violation.
|
|
7
|
+
* (b) setup runtime — `org-setup.mjs` calls `validateConfig` once in main(),
|
|
8
|
+
* before any step runs, to catch the developer's local post-scaffold edits.
|
|
9
|
+
*
|
|
10
|
+
* `validateConfig` is pure: it parses + validates and RETURNS a result. Each call
|
|
11
|
+
* site owns its own print/exit, so the build gate can report every bad file and
|
|
12
|
+
* the runtime can exit immediately — and the validator stays unit-testable.
|
|
13
|
+
*
|
|
14
|
+
* The zod schema uses `.strict()` at every level so unknown keys (e.g. the
|
|
15
|
+
* `permsetAssignment` singular typo) are rejected rather than silently ignored.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
|
|
20
|
+
/** Closed set of assignee values — no arbitrary usernames. */
|
|
21
|
+
const Assignee = z.enum(['currentUser', 'guestUser', 'skip']);
|
|
22
|
+
|
|
23
|
+
// No siteName: for guestUser the site is derived from the single
|
|
24
|
+
// networks/<siteName>.network-meta.xml the app ships (see spec §5.2).
|
|
25
|
+
const Assignment = z
|
|
26
|
+
.object({
|
|
27
|
+
assignee: Assignee,
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
|
|
31
|
+
export const ConfigSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
permsetAssignments: z
|
|
34
|
+
.object({
|
|
35
|
+
// guestUser is valid here — siteName is derived, not per-assignment.
|
|
36
|
+
defaultAssignee: Assignee.default('skip'),
|
|
37
|
+
assignments: z.record(z.string(), Assignment).default({}),
|
|
38
|
+
})
|
|
39
|
+
.strict()
|
|
40
|
+
.optional(),
|
|
41
|
+
role: z
|
|
42
|
+
.object({
|
|
43
|
+
assignee: z.literal('currentUser'), // only value the role code honors
|
|
44
|
+
roleName: z.string().min(1),
|
|
45
|
+
})
|
|
46
|
+
.strict()
|
|
47
|
+
.optional(),
|
|
48
|
+
selfRegistration: z
|
|
49
|
+
.object({
|
|
50
|
+
// No siteName: the site is derived from the single
|
|
51
|
+
// networks/<siteName>.network-meta.xml the app ships (see spec §5.2),
|
|
52
|
+
// exactly like the guestUser permset path.
|
|
53
|
+
//
|
|
54
|
+
// selfRegProfile also drives the M1 license pre-check (W-23043735):
|
|
55
|
+
// setup derives the required UserLicense from this profile
|
|
56
|
+
// (Profile.UserLicense, matched on the stable LicenseDefinitionKey) and
|
|
57
|
+
// warns + skips self-registration when the org lacks it or has no seats.
|
|
58
|
+
// No separate license field is declared — the requirement can't drift
|
|
59
|
+
// from the profile the flow actually assigns.
|
|
60
|
+
selfRegProfile: z.string().min(1),
|
|
61
|
+
accountName: z.string().min(1),
|
|
62
|
+
})
|
|
63
|
+
.strict()
|
|
64
|
+
.optional(),
|
|
65
|
+
socialLogin: z
|
|
66
|
+
.object({
|
|
67
|
+
// Profile to add to NetworkMemberGroup so SSO-registered users can access
|
|
68
|
+
// the community (e.g. "Customer Community User"). Also enables the
|
|
69
|
+
// "Allow standard external profiles" org setting.
|
|
70
|
+
communityMemberProfile: z.string().min(1),
|
|
71
|
+
// DeveloperName of AuthProvider (OAuth) or SamlSsoConfig (SAML) records to link to the site's AuthConfig.
|
|
72
|
+
// Required because React (Site Container) sites hide SSO config in Admin UI.
|
|
73
|
+
authProviderNames: z.array(z.string().min(1)).min(1),
|
|
74
|
+
// Permission set to assign to community users created via SSO.
|
|
75
|
+
// Required because getCurrentUser() calls UI API GraphQL (uiapi.currentUser)
|
|
76
|
+
// which needs API access (PermissionsApiEnabled) that the community profile lacks.
|
|
77
|
+
// Typically the app's "*_Guest_User_Api_Access" permset.
|
|
78
|
+
communityUserPermset: z.string().min(1).optional(),
|
|
79
|
+
})
|
|
80
|
+
.strict()
|
|
81
|
+
.optional(),
|
|
82
|
+
// URL members are redirected to after logging out, written to the site's
|
|
83
|
+
// <logoutUrl> network metadata (a post-deploy step). Steers logout back to THIS
|
|
84
|
+
// site so members aren't dropped on the org default-site login (which, in an
|
|
85
|
+
// org hosting multiple sites, can be a different community). Prefer a
|
|
86
|
+
// site-relative path (e.g. "/myapp/"): it is domain-independent, so the same
|
|
87
|
+
// shipped value is valid on every org. The platform REQUIRES an absolute logout
|
|
88
|
+
// URL, so org-setup resolves a relative path against the site's Experience Cloud
|
|
89
|
+
// origin (discovered from the org at deploy time) before writing it; an
|
|
90
|
+
// already-absolute value is used as-is. Kept a permissive non-empty string (not
|
|
91
|
+
// z.string().url()) so relative paths are valid; character-safety for raw XML
|
|
92
|
+
// interpolation is enforced at write time.
|
|
93
|
+
logoutUrl: z.string().min(1).optional(),
|
|
94
|
+
})
|
|
95
|
+
.strict();
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Render a single zod issue as a "path: message" line. Empty path (a root-level
|
|
99
|
+
* problem) renders as "<root>: message".
|
|
100
|
+
*/
|
|
101
|
+
function formatIssue(issue) {
|
|
102
|
+
const path = issue.path.length > 0 ? issue.path.join('.') : '<root>';
|
|
103
|
+
return `${path}: ${issue.message}`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Parse + validate a raw org-setup.config.json string.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} rawText raw file contents (not yet JSON-parsed)
|
|
110
|
+
* @param {string} [configPath] path used only for error messages
|
|
111
|
+
* @returns {{ ok: true, data: object } | { ok: false, errors: string[] }}
|
|
112
|
+
* On success, `data` is the parsed + defaulted config. On failure, `errors`
|
|
113
|
+
* is a non-empty list of human-readable messages (JSON parse error or zod
|
|
114
|
+
* issues). The caller decides whether to print/exit.
|
|
115
|
+
*/
|
|
116
|
+
export function validateConfig(rawText, configPath) {
|
|
117
|
+
const where = configPath ? ` (${configPath})` : '';
|
|
118
|
+
|
|
119
|
+
let parsed;
|
|
120
|
+
try {
|
|
121
|
+
parsed = JSON.parse(rawText);
|
|
122
|
+
} catch (err) {
|
|
123
|
+
return { ok: false, errors: [`malformed JSON${where}: ${err.message}`] };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const result = ConfigSchema.safeParse(parsed);
|
|
127
|
+
if (!result.success) {
|
|
128
|
+
return { ok: false, errors: result.error.issues.map(formatIssue) };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return { ok: true, data: result.data };
|
|
132
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Dev preview: refresh the GraphQL schema/types against a target org, then launch
|
|
4
|
+
* the Vite dev server (spec §5.5, M4). This is the step that used to be the final
|
|
5
|
+
* `dev` stage of org-setup.mjs — extracted here so `npm run setup` terminates
|
|
6
|
+
* cleanly after graphql, and the long-lived dev server is an explicit, separate
|
|
7
|
+
* `npm run dev:preview`.
|
|
8
|
+
*
|
|
9
|
+
* Unlike setup, this does NOT log in or deploy — it assumes the org is already
|
|
10
|
+
* set up. It shares org/bundle resolution and the process runner with org-setup
|
|
11
|
+
* via org-setup-utils.mjs.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* npm run dev:preview # prompt to pick an org + bundle
|
|
15
|
+
* npm run dev:preview -- --target-org myorg
|
|
16
|
+
* npm run dev:preview -- --target-org myorg --ui-bundle-name my-app
|
|
17
|
+
*
|
|
18
|
+
* Flow (in order):
|
|
19
|
+
* 1. resolve target org (explicit --target-org, else prompt / default org)
|
|
20
|
+
* 2. resolve UI bundle (explicit --ui-bundle-name, else picker / warning)
|
|
21
|
+
* 3. npm install (in the UI bundle)
|
|
22
|
+
* 4. npm run graphql:schema (SF_TARGET_ORG=<org>) — introspect the live schema
|
|
23
|
+
* 5. npm run graphql:codegen — regenerate typed operations
|
|
24
|
+
* 6. npm run dev (blocking, Ctrl+C to stop)
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { resolve, dirname } from 'node:path';
|
|
28
|
+
import { fileURLToPath } from 'node:url';
|
|
29
|
+
|
|
30
|
+
import { run, resolveSfdxSource, discoverUIBundleDir, resolveTargetOrg } from './org-setup-utils.mjs';
|
|
31
|
+
|
|
32
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
const ROOT = resolve(__dirname, '..');
|
|
34
|
+
|
|
35
|
+
function parseArgs() {
|
|
36
|
+
const args = process.argv.slice(2);
|
|
37
|
+
let targetOrg = null;
|
|
38
|
+
let uiBundleName = null;
|
|
39
|
+
for (let i = 0; i < args.length; i++) {
|
|
40
|
+
if (args[i] === '--target-org' && args[i + 1]) {
|
|
41
|
+
targetOrg = args[++i];
|
|
42
|
+
} else if (args[i] === '--ui-bundle-name' && args[i + 1]) {
|
|
43
|
+
uiBundleName = args[++i];
|
|
44
|
+
} else if (args[i] === '--help' || args[i] === '-h') {
|
|
45
|
+
console.log(`
|
|
46
|
+
Dev preview — refresh GraphQL types then launch the Vite dev server
|
|
47
|
+
|
|
48
|
+
Usage:
|
|
49
|
+
npm run dev:preview -- [--target-org <alias>] [--ui-bundle-name <name>]
|
|
50
|
+
|
|
51
|
+
Options:
|
|
52
|
+
--target-org <alias> Target Salesforce org alias. If omitted, you are prompted
|
|
53
|
+
to pick from authenticated orgs (or the default org is used).
|
|
54
|
+
--ui-bundle-name <name> UI bundle folder under uiBundles/ (default: auto-detect / prompt)
|
|
55
|
+
-h, --help Show this help
|
|
56
|
+
`);
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return { targetOrg, uiBundleName };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Print a heads-up about auth surfaces that only work on the deployed Experience
|
|
65
|
+
* site. In local preview, `sdk.fetch` is proxied to the org outside the site's
|
|
66
|
+
* guest/community context, so social login and password/MFA login cannot be
|
|
67
|
+
* exercised on localhost. This mirrors the "Local preview limitations" sections
|
|
68
|
+
* in the feature-react-authentication / feature-react-mfa READMEs — surfaced here
|
|
69
|
+
* so it is seen even when the READMEs are not.
|
|
70
|
+
*/
|
|
71
|
+
function printLocalPreviewWarning() {
|
|
72
|
+
console.log(
|
|
73
|
+
[
|
|
74
|
+
'',
|
|
75
|
+
'⚠️ Local preview limitation — some auth surfaces only work on the DEPLOYED site',
|
|
76
|
+
' Local preview proxies sdk.fetch to the org outside the Experience site guest',
|
|
77
|
+
' context (Site.getBaseUrl() is blank, no site session), so on localhost:',
|
|
78
|
+
' • Social Login buttons do not render (/auth/social-login-config returns no providers)',
|
|
79
|
+
' • Password / MFA login fails with "Your login attempt has failed…" (Site.login() cannot',
|
|
80
|
+
' establish the site session)',
|
|
81
|
+
' This is expected, not a misconfiguration. Test social login and MFA on the published',
|
|
82
|
+
' site login page: https://<domain>.site.com/<site-path>/login',
|
|
83
|
+
'',
|
|
84
|
+
].join('\n'),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function main() {
|
|
89
|
+
const parsed = parseArgs();
|
|
90
|
+
|
|
91
|
+
const targetOrg = await resolveTargetOrg(parsed);
|
|
92
|
+
const uiBundlesDir = resolve(resolveSfdxSource(ROOT), 'uiBundles');
|
|
93
|
+
const uiBundleDir = await discoverUIBundleDir(uiBundlesDir, parsed.uiBundleName);
|
|
94
|
+
|
|
95
|
+
console.log('Dev preview — target org:', targetOrg, '| UI bundle:', uiBundleDir);
|
|
96
|
+
|
|
97
|
+
run('UI Bundle npm install', 'npm', ['install'], { cwd: uiBundleDir });
|
|
98
|
+
run('GraphQL schema (introspect)', 'npm', ['run', 'graphql:schema'], {
|
|
99
|
+
cwd: uiBundleDir,
|
|
100
|
+
env: { ...process.env, SF_TARGET_ORG: targetOrg },
|
|
101
|
+
});
|
|
102
|
+
run('GraphQL codegen', 'npm', ['run', 'graphql:codegen'], { cwd: uiBundleDir });
|
|
103
|
+
|
|
104
|
+
printLocalPreviewWarning();
|
|
105
|
+
|
|
106
|
+
console.log('\n--- Launching dev server (Ctrl+C to stop) ---\n');
|
|
107
|
+
const devResult = run('Dev server', 'npm', ['run', 'dev'], { cwd: uiBundleDir, optional: true });
|
|
108
|
+
process.exit(devResult.status ?? 0);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
main().catch((err) => {
|
|
112
|
+
console.error(err);
|
|
113
|
+
process.exit(1);
|
|
114
|
+
});
|