@salesforce/ui-bundle-template-feature-vue-authentication 0.0.0-stage → 13.1.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 +106 -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 +5423 -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/classes/UIBundleAuthUtils.cls +68 -0
- package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleAuthUtils_Test.cls +141 -0
- package/dist/force-app/main/default/classes/UIBundleAuthUtils_Test.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleChangePassword.cls +77 -0
- package/dist/force-app/main/default/classes/UIBundleChangePassword.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls +71 -0
- package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleLogin.cls +105 -0
- package/dist/force-app/main/default/classes/UIBundleLogin.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleRegistration.cls +162 -0
- package/dist/force-app/main/default/classes/UIBundleRegistration.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig.cls +145 -0
- package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig.cls-meta.xml +5 -0
- package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig_Test.cls +181 -0
- package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig_Test.cls-meta.xml +5 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.prettierignore +9 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.prettierrc +11 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/README.md +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/components.json +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/e2e/app.spec.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/eslint.config.js +124 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/feature-vue-authentication.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/index.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/package.json +74 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/playwright.config.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/scripts/get-graphql-schema.mjs +71 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/scripts/rewrite-e2e-assets.mjs +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/App.vue +5 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/api/graphqlClient.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/appLayout.vue +80 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/alerts/status-alert.vue +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/layouts/card-layout.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/Alert.vue +21 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/AlertAction.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/AlertDescription.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/AlertTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/Avatar.vue +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/AvatarFallback.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/AvatarImage.vue +16 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/button/Button.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/button/index.ts +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/Card.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardAction.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardContent.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardDescription.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardFooter.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardHeader.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/checkbox/Checkbox.vue +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/checkbox/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/Collapsible.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/CollapsibleContent.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/Dialog.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogClose.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogContent.vue +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogDescription.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogFooter.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogOverlay.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogPortal.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogTitle.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/index.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +51 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuContent.vue +47 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuItem.vue +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuPortal.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +52 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +37 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +38 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/index.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/Field.vue +27 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldContent.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldDescription.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldError.vue +48 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldGroup.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldLabel.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldLegend.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldSeparator.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldSet.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/index.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/index.ts +115 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/input/Input.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/input/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/label/Label.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/label/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/Pagination.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationContent.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationEllipsis.vue +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationItem.vue +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationLink.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationNext.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationPrevious.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/Popover.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverAnchor.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverContent.vue +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverDescription.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverHeader.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverTitle.vue +14 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/Select.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectContent.vue +65 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectGroup.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectItem.vue +41 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectLabel.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectScrollDownButton.vue +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectScrollUpButton.vue +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectSeparator.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectTrigger.vue +45 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectValue.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/index.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/separator/Separator.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/separator/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/skeleton/Skeleton.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/skeleton/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/sonner/Sonner.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/sonner/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/spinner/Spinner.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/spinner/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/composables/useAsyncData.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/api/userProfileApi.ts +107 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/authHelpers.ts +78 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/authenticationConfig.ts +66 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/components/SocialLogin.vue +150 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/composables/useCountdownTimer.ts +246 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/composables/useRetryWithBackoff.ts +112 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/composables/useSessionTimeout.ts +244 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/context/authContext.ts +115 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/footers/FooterLink.vue +47 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/forms/AuthForm.vue +141 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/forms/SubmitButton.vue +57 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/EmailField.vue +46 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/PasswordField.vue +48 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/TextField.vue +106 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/form.ts +90 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/formContexts.ts +61 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/layout/CenteredPageLayout.vue +76 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/layouts/AuthAppLayout.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/layouts/PrivateRouteLayout.vue +50 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/menu/AuthMenu.vue +143 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/ChangePassword.vue +122 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/ForgotPassword.vue +90 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/Login.vue +106 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/Profile.vue +180 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/Register.vue +135 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/ResetPassword.vue +114 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/SessionExpiredAlert.vue +50 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/SessionTimeoutValidator.vue +136 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/SessionWarningModal.vue +151 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/sessionTimeService.ts +142 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/sessionTimeoutConfig.ts +82 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/utils/helpers.ts +90 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/utils/queryToSearchParams.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/lib/utils.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/main.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/pages/Home.vue +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/pages/NotFound.vue +18 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/router-utils.ts +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/router.ts +90 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/styles/global.css +134 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/test/setup.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/tsconfig.json +45 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/tsconfig.node.json +13 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/tsconfig.tsbuildinfo +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/ui-bundle.json +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/vite-env.d.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/vite.config.ts +106 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-authentication/vitest-env.d.ts +2 -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 +44 -4
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
schema: '../../../../../schema.graphql'
|
|
2
|
+
documents: 'src/**/*.{graphql,ts,tsx,vue}'
|
|
3
|
+
generates:
|
|
4
|
+
src/api/graphql-operations-types.ts:
|
|
5
|
+
plugins:
|
|
6
|
+
- 'graphql-codegen-typescript-operation-types'
|
|
7
|
+
- 'typescript-operations'
|
|
8
|
+
config:
|
|
9
|
+
onlyOperationTypes: true
|
|
10
|
+
skipTypename: true
|
|
11
|
+
preResolveTypes: true
|
|
12
|
+
scalars:
|
|
13
|
+
# String-serialized scalars
|
|
14
|
+
JSON:
|
|
15
|
+
input: 'string'
|
|
16
|
+
output: 'string'
|
|
17
|
+
Date:
|
|
18
|
+
input: 'string'
|
|
19
|
+
output: 'string'
|
|
20
|
+
DateTime:
|
|
21
|
+
input: 'string'
|
|
22
|
+
output: 'string'
|
|
23
|
+
Time:
|
|
24
|
+
input: 'string'
|
|
25
|
+
output: 'string'
|
|
26
|
+
Email:
|
|
27
|
+
input: 'string'
|
|
28
|
+
output: 'string'
|
|
29
|
+
Url:
|
|
30
|
+
input: 'string'
|
|
31
|
+
output: 'string'
|
|
32
|
+
PhoneNumber:
|
|
33
|
+
input: 'string'
|
|
34
|
+
output: 'string'
|
|
35
|
+
Picklist:
|
|
36
|
+
input: 'string'
|
|
37
|
+
output: 'string'
|
|
38
|
+
MultiPicklist:
|
|
39
|
+
input: 'string'
|
|
40
|
+
output: 'string'
|
|
41
|
+
TextArea:
|
|
42
|
+
input: 'string'
|
|
43
|
+
output: 'string'
|
|
44
|
+
LongTextArea:
|
|
45
|
+
input: 'string'
|
|
46
|
+
output: 'string'
|
|
47
|
+
RichTextArea:
|
|
48
|
+
input: 'string'
|
|
49
|
+
output: 'string'
|
|
50
|
+
EncryptedString:
|
|
51
|
+
input: 'string'
|
|
52
|
+
output: 'string'
|
|
53
|
+
Base64:
|
|
54
|
+
input: 'string'
|
|
55
|
+
output: 'string'
|
|
56
|
+
IdOrRef:
|
|
57
|
+
input: 'string'
|
|
58
|
+
output: 'string'
|
|
59
|
+
# BigDecimal-serialized scalars (accepts number or string, returns number)
|
|
60
|
+
Currency:
|
|
61
|
+
input: 'number | string'
|
|
62
|
+
output: 'number'
|
|
63
|
+
BigDecimal:
|
|
64
|
+
input: 'number | string'
|
|
65
|
+
output: 'number'
|
|
66
|
+
Double:
|
|
67
|
+
input: 'number | string'
|
|
68
|
+
output: 'number'
|
|
69
|
+
Percent:
|
|
70
|
+
input: 'number | string'
|
|
71
|
+
output: 'number'
|
|
72
|
+
Longitude:
|
|
73
|
+
input: 'number | string'
|
|
74
|
+
output: 'number'
|
|
75
|
+
Latitude:
|
|
76
|
+
input: 'number | string'
|
|
77
|
+
output: 'number'
|
|
78
|
+
# Integer-like scalars
|
|
79
|
+
Long:
|
|
80
|
+
input: 'number'
|
|
81
|
+
output: 'number'
|
|
82
|
+
BigInteger:
|
|
83
|
+
input: 'number'
|
|
84
|
+
output: 'number'
|
|
85
|
+
Short:
|
|
86
|
+
input: 'number'
|
|
87
|
+
output: 'number'
|
|
88
|
+
Byte:
|
|
89
|
+
input: 'number'
|
|
90
|
+
output: 'number'
|
|
91
|
+
Char:
|
|
92
|
+
input: 'number'
|
|
93
|
+
output: 'number'
|
|
94
|
+
overwrite: true
|
|
95
|
+
ignoreNoDocuments: true
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://shadcn-vue.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"typescript": true,
|
|
5
|
+
"tailwind": {
|
|
6
|
+
"config": "",
|
|
7
|
+
"css": "src/styles/global.css",
|
|
8
|
+
"baseColor": "neutral",
|
|
9
|
+
"cssVariables": true
|
|
10
|
+
},
|
|
11
|
+
"iconLibrary": "lucide",
|
|
12
|
+
"aliases": {
|
|
13
|
+
"components": "@/components",
|
|
14
|
+
"utils": "@/lib/utils",
|
|
15
|
+
"ui": "@/components/ui",
|
|
16
|
+
"lib": "@/lib",
|
|
17
|
+
"composables": "@/composables"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
test.describe('base-vue-app', () => {
|
|
4
|
+
test('home page loads and shows welcome content', async ({ page }) => {
|
|
5
|
+
await page.goto('/');
|
|
6
|
+
await expect(page.getByRole('heading', { name: 'Home' })).toBeVisible();
|
|
7
|
+
await expect(
|
|
8
|
+
page.getByText('Welcome to your Vue application.')
|
|
9
|
+
).toBeVisible();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('not found route shows 404', async ({ page }) => {
|
|
13
|
+
await page.goto('/non-existent-route');
|
|
14
|
+
await expect(page.getByRole('heading', { name: '404' })).toBeVisible();
|
|
15
|
+
await expect(page.getByText('Page not found')).toBeVisible();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { dirname } from 'node:path';
|
|
5
|
+
import js from '@eslint/js';
|
|
6
|
+
import pluginVue from 'eslint-plugin-vue';
|
|
7
|
+
import vueTsConfig from '@vue/eslint-config-typescript';
|
|
8
|
+
import globals from 'globals';
|
|
9
|
+
import graphqlPlugin from '@graphql-eslint/eslint-plugin';
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const schemaPath = resolve(__dirname, '../../../../../schema.graphql');
|
|
13
|
+
const schemaExists = existsSync(schemaPath);
|
|
14
|
+
|
|
15
|
+
const config = [
|
|
16
|
+
// Global ignores
|
|
17
|
+
{
|
|
18
|
+
ignores: [
|
|
19
|
+
'build/**/*',
|
|
20
|
+
'dist/**/*',
|
|
21
|
+
'coverage/**/*',
|
|
22
|
+
'src/api/graphql-operations-types.ts',
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
js.configs.recommended,
|
|
26
|
+
...pluginVue.configs['flat/recommended'],
|
|
27
|
+
...vueTsConfig(),
|
|
28
|
+
{
|
|
29
|
+
files: ['scripts/**/*.{js,cjs,mjs}'],
|
|
30
|
+
languageOptions: {
|
|
31
|
+
globals: globals.node,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
// Main TypeScript/Vue files
|
|
35
|
+
{
|
|
36
|
+
files: ['**/*.{ts,vue}'],
|
|
37
|
+
languageOptions: {
|
|
38
|
+
ecmaVersion: 'latest',
|
|
39
|
+
sourceType: 'module',
|
|
40
|
+
globals: {
|
|
41
|
+
...globals.browser,
|
|
42
|
+
process: 'readonly',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
'@typescript-eslint/no-unused-vars': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
argsIgnorePattern: '^_',
|
|
50
|
+
varsIgnorePattern: '^_',
|
|
51
|
+
caughtErrorsIgnorePattern: '^_',
|
|
52
|
+
ignoreRestSiblings: true,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
56
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
57
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
58
|
+
// Base app ships single-word component files (Home.vue, App.vue) mirroring
|
|
59
|
+
// the React template's page naming; allow them.
|
|
60
|
+
'vue/multi-word-component-names': 'off',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
// Node scripts (schema fetch, e2e asset rewrite)
|
|
64
|
+
{
|
|
65
|
+
files: ['scripts/**/*.{js,mjs}'],
|
|
66
|
+
languageOptions: {
|
|
67
|
+
globals: {
|
|
68
|
+
...globals.node,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
// Test files
|
|
73
|
+
{
|
|
74
|
+
files: [
|
|
75
|
+
'**/*.test.{ts,tsx}',
|
|
76
|
+
'**/test/**/*.{ts,tsx}',
|
|
77
|
+
'src/test/**/*.{ts,tsx}',
|
|
78
|
+
],
|
|
79
|
+
languageOptions: {
|
|
80
|
+
globals: {
|
|
81
|
+
...globals.browser,
|
|
82
|
+
...globals.node,
|
|
83
|
+
global: 'writable',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
rules: {
|
|
87
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
// Only add GraphQL rules when schema exists (e.g. after graphql:schema).
|
|
93
|
+
// In CI or when schema is not checked in, skip so lint succeeds.
|
|
94
|
+
if (schemaExists) {
|
|
95
|
+
config.push(
|
|
96
|
+
{
|
|
97
|
+
files: ['**/*.{ts,vue}'],
|
|
98
|
+
processor: graphqlPlugin.processor,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
files: ['**/*.graphql'],
|
|
102
|
+
languageOptions: {
|
|
103
|
+
parser: graphqlPlugin.parser,
|
|
104
|
+
parserOptions: {
|
|
105
|
+
graphQLConfig: {
|
|
106
|
+
schema: '../../../../../schema.graphql',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
plugins: {
|
|
111
|
+
'@graphql-eslint': graphqlPlugin,
|
|
112
|
+
},
|
|
113
|
+
rules: {
|
|
114
|
+
'@graphql-eslint/no-anonymous-operations': 'error',
|
|
115
|
+
'@graphql-eslint/no-duplicate-fields': 'error',
|
|
116
|
+
'@graphql-eslint/known-fragment-names': 'error',
|
|
117
|
+
'@graphql-eslint/no-undefined-variables': 'error',
|
|
118
|
+
'@graphql-eslint/no-unused-variables': 'error',
|
|
119
|
+
},
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export default config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<UIBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
3
|
+
<masterLabel>feature-vue-authentication</masterLabel>
|
|
4
|
+
<description>A Salesforce UI Bundle.</description>
|
|
5
|
+
<isActive>true</isActive>
|
|
6
|
+
<version>1</version>
|
|
7
|
+
</UIBundle>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Welcome to Vue App</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="app"></div>
|
|
10
|
+
<script type="module" src="src/main.ts"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "base-vue-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.59.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite",
|
|
11
|
+
"dev:design": "vite --mode design",
|
|
12
|
+
"build": "vue-tsc -b && vite build",
|
|
13
|
+
"build:e2e": "npm run build && node scripts/rewrite-e2e-assets.mjs",
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"preview": "vite preview",
|
|
16
|
+
"test": "vitest",
|
|
17
|
+
"graphql:codegen": "graphql-codegen",
|
|
18
|
+
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@lucide/vue": "^1.47.0",
|
|
22
|
+
"@salesforce/platform-sdk": "^13.1.0",
|
|
23
|
+
"@salesforce/ui-bundle": "^13.1.0",
|
|
24
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
25
|
+
"class-variance-authority": "^0.7.1",
|
|
26
|
+
"clsx": "^2.1.1",
|
|
27
|
+
"date-fns": "^4.1.0",
|
|
28
|
+
"reka-ui": "^2.5.0",
|
|
29
|
+
"tailwind-merge": "^3.5.0",
|
|
30
|
+
"tailwindcss": "^4.1.17",
|
|
31
|
+
"tw-animate-css": "^1.4.0",
|
|
32
|
+
"vue": "^3.5.13",
|
|
33
|
+
"vue-router": "^4.5.0",
|
|
34
|
+
"vue-sonner": "^2.0.0",
|
|
35
|
+
"@tanstack/vue-form": "^1.33.5",
|
|
36
|
+
"zod": "^4.3.5"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@eslint/js": "^9.39.1",
|
|
40
|
+
"@graphql-codegen/cli": "^6.1.0",
|
|
41
|
+
"@graphql-codegen/typescript": "^5.0.6",
|
|
42
|
+
"@graphql-codegen/typescript-operations": "^5.0.6",
|
|
43
|
+
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
44
|
+
"@graphql-tools/utils": "^12.0.3",
|
|
45
|
+
"@playwright/test": "^1.49.0",
|
|
46
|
+
"@salesforce/graphiti": "^13.1.0",
|
|
47
|
+
"@salesforce/vite-plugin-ui-bundle": "^13.1.0",
|
|
48
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
49
|
+
"@testing-library/user-event": "^14.5.2",
|
|
50
|
+
"@testing-library/vue": "^8.1.0",
|
|
51
|
+
"@types/node": "^24.10.1",
|
|
52
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
53
|
+
"@vitest/ui": "^4.1.0",
|
|
54
|
+
"@vue/eslint-config-typescript": "^14.1.4",
|
|
55
|
+
"@vue/test-utils": "^2.4.6",
|
|
56
|
+
"eslint": "^9.39.1",
|
|
57
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
58
|
+
"globals": "^16.5.0",
|
|
59
|
+
"graphql": "^16.11.0",
|
|
60
|
+
"graphql-codegen-typescript-operation-types": "^2.0.2",
|
|
61
|
+
"jsdom": "^25.0.1",
|
|
62
|
+
"serve": "^14.2.5",
|
|
63
|
+
"typescript": "~5.9.3",
|
|
64
|
+
"typescript-eslint": "^8.71.2",
|
|
65
|
+
"vite": "^7.2.4",
|
|
66
|
+
"vite-plugin-graphql-codegen": "^3.6.3",
|
|
67
|
+
"vitest": "^4.1.0",
|
|
68
|
+
"vue-tsc": "^2.2.0"
|
|
69
|
+
},
|
|
70
|
+
"overrides": {
|
|
71
|
+
"lodash": "^4.18.1",
|
|
72
|
+
"undici": "^8.0.0"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
const E2E_PORT = 5177;
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
testDir: './e2e',
|
|
7
|
+
fullyParallel: true,
|
|
8
|
+
forbidOnly: !!process.env.CI,
|
|
9
|
+
retries: process.env.CI ? 2 : 0,
|
|
10
|
+
workers: process.env.CI ? 1 : undefined,
|
|
11
|
+
reporter: 'html',
|
|
12
|
+
use: {
|
|
13
|
+
baseURL: `http://localhost:${E2E_PORT}`,
|
|
14
|
+
trace: 'on-first-retry',
|
|
15
|
+
},
|
|
16
|
+
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
|
|
17
|
+
webServer: {
|
|
18
|
+
// Serve built dist/ with static server so e2e works in CI without SF org (vite preview runs plugin and can fail)
|
|
19
|
+
command: `npx serve dist -l ${E2E_PORT}`,
|
|
20
|
+
url: `http://localhost:${E2E_PORT}`,
|
|
21
|
+
reuseExistingServer: !process.env.CI,
|
|
22
|
+
timeout: process.env.CI ? 120_000 : 60_000,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Downloads the full GraphQL schema from a connected Salesforce org via introspection.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* npm run graphql:schema
|
|
6
|
+
* node scripts/get-graphql-schema.mjs [output-path]
|
|
7
|
+
*
|
|
8
|
+
* The default output path matches the schema location expected by codegen.yml
|
|
9
|
+
* and .graphqlrc.yml so that codegen and IDE tooling resolve it automatically.
|
|
10
|
+
*/
|
|
11
|
+
import { writeFileSync } from 'node:fs';
|
|
12
|
+
import { resolve } from 'node:path';
|
|
13
|
+
import { getOrgInfo } from '@salesforce/ui-bundle/app';
|
|
14
|
+
import { buildClientSchema, getIntrospectionQuery, printSchema } from 'graphql';
|
|
15
|
+
import { pruneSchema } from '@graphql-tools/utils';
|
|
16
|
+
|
|
17
|
+
const DEFAULT_SCHEMA_PATH = '../../../../../schema.graphql';
|
|
18
|
+
const TARGET_ORG = process.env.SF_TARGET_ORG || undefined;
|
|
19
|
+
|
|
20
|
+
async function executeSalesforceGraphQLQuery(query, variables, operationName) {
|
|
21
|
+
const orgInfo = await getOrgInfo(TARGET_ORG);
|
|
22
|
+
if (!orgInfo) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
'Could not resolve a Salesforce org. Set SF_TARGET_ORG or a default org.'
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const { rawInstanceUrl: instanceUrl, apiVersion, accessToken } = orgInfo;
|
|
28
|
+
|
|
29
|
+
const targetUrl = `${instanceUrl}/services/data/v${apiVersion}/graphql`;
|
|
30
|
+
|
|
31
|
+
console.log(`Executing introspection query against ${targetUrl}`);
|
|
32
|
+
const response = await fetch(targetUrl, {
|
|
33
|
+
method: 'POST',
|
|
34
|
+
headers: {
|
|
35
|
+
Authorization: `Bearer ${accessToken}`,
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
'X-Chatter-Entity-Encoding': 'false',
|
|
38
|
+
},
|
|
39
|
+
body: JSON.stringify({ query, variables, operationName }),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
const errorText = await response.text();
|
|
44
|
+
throw new Error(
|
|
45
|
+
`Salesforce GraphQL request failed: ${response.status} ${response.statusText} - ${errorText}`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return response.json();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
const outputPath = resolve(process.argv[2] || DEFAULT_SCHEMA_PATH);
|
|
54
|
+
|
|
55
|
+
const introspectionResult = await executeSalesforceGraphQLQuery(
|
|
56
|
+
getIntrospectionQuery(),
|
|
57
|
+
{},
|
|
58
|
+
'IntrospectionQuery'
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const schema = buildClientSchema(introspectionResult.data);
|
|
62
|
+
const prunedSchema = pruneSchema(schema);
|
|
63
|
+
const sdl = printSchema(prunedSchema);
|
|
64
|
+
|
|
65
|
+
writeFileSync(outputPath, sdl);
|
|
66
|
+
|
|
67
|
+
console.log(`Schema saved to ${outputPath}`);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error('Error:', error.message);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prepares dist/ for e2e: root-relative asset paths + SPA fallback for serve.
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { join, dirname } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const distDir = join(__dirname, '..', 'dist');
|
|
10
|
+
|
|
11
|
+
// Rewrite index.html so asset paths are root-relative (/assets/...)
|
|
12
|
+
const indexPath = join(distDir, 'index.html');
|
|
13
|
+
let html = readFileSync(indexPath, 'utf8');
|
|
14
|
+
html = html.replace(/(src|href)="[^"]*\/assets\//g, '$1="/assets/');
|
|
15
|
+
writeFileSync(indexPath, html);
|
|
16
|
+
|
|
17
|
+
// SPA fallback so /about, /non-existent-route etc. serve index.html
|
|
18
|
+
writeFileSync(
|
|
19
|
+
join(distDir, 'serve.json'),
|
|
20
|
+
JSON.stringify({
|
|
21
|
+
rewrites: [{ source: '**', destination: '/index.html' }],
|
|
22
|
+
})
|
|
23
|
+
);
|
package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/api/graphqlClient.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin GraphQL client: createDataSDK + sdk.graphql with centralized error
|
|
3
|
+
* handling. Mutations are routed to sdk.graphql.mutate and everything else to
|
|
4
|
+
* sdk.graphql.query (the SDK rejects an operation sent to the wrong method).
|
|
5
|
+
* Use with gql-tagged queries and generated operation types for type-safe calls.
|
|
6
|
+
*/
|
|
7
|
+
import { createDataSDK } from '@salesforce/platform-sdk';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* True when the operation's first definition is a `mutation`. Strips GraphQL
|
|
11
|
+
* comments first so a leading `# ...` line can't mask the keyword. Queries
|
|
12
|
+
* (named or anonymous `{ ... }` shorthand) and subscriptions fall through to
|
|
13
|
+
* query().
|
|
14
|
+
*/
|
|
15
|
+
function isMutation(operation: string): boolean {
|
|
16
|
+
return /^\s*mutation\b/.test(operation.replace(/#[^\n\r]*/g, ''));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function executeGraphQL<TData, TVariables>(
|
|
20
|
+
operation: string,
|
|
21
|
+
variables?: TVariables
|
|
22
|
+
): Promise<TData> {
|
|
23
|
+
const data = await createDataSDK();
|
|
24
|
+
const result = isMutation(operation)
|
|
25
|
+
? await data.graphql!.mutate<TData, TVariables>({
|
|
26
|
+
mutation: operation,
|
|
27
|
+
variables: variables,
|
|
28
|
+
})
|
|
29
|
+
: await data.graphql!.query<TData, TVariables>({
|
|
30
|
+
query: operation,
|
|
31
|
+
variables: variables,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (result.errors?.length) {
|
|
35
|
+
const msg = result.errors.map(e => e.message).join('; ');
|
|
36
|
+
throw new Error(`GraphQL Error: ${msg}`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (result.data == null) {
|
|
40
|
+
throw new Error('GraphQL response data is null');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return result.data;
|
|
44
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from 'vue';
|
|
3
|
+
import { RouterLink, RouterView, useRoute } from 'vue-router';
|
|
4
|
+
import { getAllRoutes } from '@/router-utils';
|
|
5
|
+
|
|
6
|
+
const isOpen = ref(false);
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
|
|
9
|
+
const toggleMenu = () => {
|
|
10
|
+
isOpen.value = !isOpen.value;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const isActive = (path: string) => route.path === path;
|
|
14
|
+
|
|
15
|
+
const navigationRoutes = computed<{ path: string; label: string }[]>(() =>
|
|
16
|
+
getAllRoutes()
|
|
17
|
+
.filter(
|
|
18
|
+
r =>
|
|
19
|
+
r.meta?.showInNavigation === true &&
|
|
20
|
+
r.fullPath !== undefined &&
|
|
21
|
+
r.meta?.label !== undefined
|
|
22
|
+
)
|
|
23
|
+
.map(r => ({
|
|
24
|
+
path: r.fullPath,
|
|
25
|
+
label: r.meta?.label as string,
|
|
26
|
+
}))
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<nav class="bg-white border-b border-gray-200">
|
|
32
|
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
33
|
+
<div class="flex justify-between items-center h-16">
|
|
34
|
+
<RouterLink to="/" class="text-xl font-semibold text-gray-900">
|
|
35
|
+
Vue App
|
|
36
|
+
</RouterLink>
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
class="p-2 rounded-md text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
40
|
+
aria-label="Toggle menu"
|
|
41
|
+
@click="toggleMenu"
|
|
42
|
+
>
|
|
43
|
+
<div class="w-6 h-6 flex flex-col justify-center space-y-1.5">
|
|
44
|
+
<span
|
|
45
|
+
class="block h-0.5 w-6 bg-current transition-all"
|
|
46
|
+
:class="{ 'rotate-45 translate-y-2': isOpen }"
|
|
47
|
+
/>
|
|
48
|
+
<span
|
|
49
|
+
class="block h-0.5 w-6 bg-current transition-all"
|
|
50
|
+
:class="{ 'opacity-0': isOpen }"
|
|
51
|
+
/>
|
|
52
|
+
<span
|
|
53
|
+
class="block h-0.5 w-6 bg-current transition-all"
|
|
54
|
+
:class="{ '-rotate-45 -translate-y-2': isOpen }"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
<div v-if="isOpen" class="pb-4">
|
|
60
|
+
<div class="flex flex-col space-y-2">
|
|
61
|
+
<RouterLink
|
|
62
|
+
v-for="item in navigationRoutes"
|
|
63
|
+
:key="item.path"
|
|
64
|
+
:to="item.path"
|
|
65
|
+
class="px-3 py-2 rounded-md text-sm font-medium transition-colors"
|
|
66
|
+
:class="
|
|
67
|
+
isActive(item.path)
|
|
68
|
+
? 'bg-blue-100 text-blue-700'
|
|
69
|
+
: 'text-gray-700 hover:bg-gray-100'
|
|
70
|
+
"
|
|
71
|
+
@click="isOpen = false"
|
|
72
|
+
>
|
|
73
|
+
{{ item.label }}
|
|
74
|
+
</RouterLink>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</nav>
|
|
79
|
+
<RouterView />
|
|
80
|
+
</template>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useId } from 'vue';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { AlertCircleIcon, CheckCircle2Icon, InfoIcon } from '@lucide/vue';
|
|
5
|
+
import { Alert, AlertDescription } from '@/components/ui/alert';
|
|
6
|
+
|
|
7
|
+
const statusAlertVariants = cva('', {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
error: '',
|
|
11
|
+
success: '',
|
|
12
|
+
info: 'text-blue-700 dark:text-blue-400 *:[svg]:text-current *:data-[slot=alert-description]:text-blue-700 dark:*:data-[slot=alert-description]:text-blue-400',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: 'error',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Status alert component for displaying error, success, or info messages.
|
|
22
|
+
* Renders nothing when the default slot is empty.
|
|
23
|
+
*/
|
|
24
|
+
const props = withDefaults(
|
|
25
|
+
defineProps<{
|
|
26
|
+
/** Alert variant type. @default "error" */
|
|
27
|
+
variant?: 'error' | 'success' | 'info';
|
|
28
|
+
}>(),
|
|
29
|
+
{
|
|
30
|
+
variant: 'error',
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const descriptionId = useId();
|
|
35
|
+
const isError = computed(() => props.variant === 'error');
|
|
36
|
+
const icon = computed(
|
|
37
|
+
() =>
|
|
38
|
+
({
|
|
39
|
+
error: AlertCircleIcon,
|
|
40
|
+
success: CheckCircle2Icon,
|
|
41
|
+
info: InfoIcon,
|
|
42
|
+
})[props.variant]
|
|
43
|
+
);
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<Alert
|
|
48
|
+
v-if="$slots.default"
|
|
49
|
+
:variant="isError ? 'destructive' : 'default'"
|
|
50
|
+
:class="statusAlertVariants({ variant })"
|
|
51
|
+
:aria-describedby="descriptionId"
|
|
52
|
+
:role="isError ? 'alert' : 'status'"
|
|
53
|
+
>
|
|
54
|
+
<component :is="icon" aria-hidden="true" />
|
|
55
|
+
<AlertDescription :id="descriptionId">
|
|
56
|
+
<slot />
|
|
57
|
+
</AlertDescription>
|
|
58
|
+
</Alert>
|
|
59
|
+
</template>
|