@salesforce/templates 66.3.1 → 66.3.2
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/lib/templates/project/reactb2e/.a4drules/{graphql.md → features/feature-graphql-graphql-data-access-rule.md} +186 -125
- package/lib/templates/project/reactb2e/.a4drules/features/feature-react-agentforce-conversation-client-embedded-agent-rule.md +32 -0
- package/lib/templates/project/reactb2e/.a4drules/features/feature-react-chart-analytics-charts-rule.md +27 -0
- package/lib/templates/project/reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/SKILL.md +155 -0
- package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/explore-schema.md} +58 -29
- package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-mutation-query.md} +52 -42
- package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-read-query.md} +32 -22
- package/lib/templates/project/{reactb2x/.a4drules/graphql/tools/schemas/shared.graphqls → reactb2e/.a4drules/skills/feature-graphql-graphql-data-access/docs/shared-schema.graphqls} +1 -1
- package/lib/templates/project/reactb2e/.a4drules/skills/feature-micro-frontend-micro-frontend/SKILL.md +137 -0
- package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/SKILL.md +108 -0
- package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/docs/embed-examples.md +182 -0
- package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-chart-analytics-charts/SKILL.md +41 -0
- package/lib/templates/project/reactb2e/.a4drules/skills/feature-react-chart-analytics-charts/docs/schema-mapping.md +4 -0
- package/lib/templates/project/reactb2e/.a4drules/webapp-code-quality.md +136 -0
- package/lib/templates/project/reactb2e/.a4drules/{images.md → webapp-images.md} +6 -4
- package/lib/templates/project/reactb2e/.a4drules/webapp-no-node-e.md +3 -2
- package/lib/templates/project/reactb2e/.a4drules/webapp-react.md +149 -0
- package/lib/templates/project/reactb2e/.a4drules/{typescript.md → webapp-typescript.md} +10 -29
- package/lib/templates/project/reactb2e/.a4drules/webapp.md +60 -45
- package/lib/templates/project/reactb2e/AGENT.md +1 -1
- package/lib/templates/project/reactb2e/CHANGELOG.md +377 -0
- package/lib/templates/project/reactb2e/README.md +38 -4
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/CHANGELOG.md +10 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/README.md +35 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/package.json +17 -7
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/appLayout.tsx +76 -10
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/__inherit_AgentforceConversationClient.tsx +3 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/alerts/status-alert.tsx +49 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/layouts/card-layout.tsx +29 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/alert.tsx +76 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/button.tsx +67 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/card.tsx +103 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/dialog.tsx +162 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/field.tsx +237 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/index.ts +84 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/input.tsx +19 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/label.tsx +22 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/pagination.tsx +132 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/select.tsx +193 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/separator.tsx +26 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/skeleton.tsx +14 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/spinner.tsx +16 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/table.tsx +114 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/ui/tabs.tsx +88 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components.json +18 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/constants.ts +39 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/index.ts +19 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/objectDetailService.ts +125 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/objectInfoGraphQLService.ts +194 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/objectInfoService.ts +199 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/api/recordListGraphQLService.ts +365 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailFields.tsx +55 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailForm.tsx +146 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailHeader.tsx +34 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/DetailLayoutSections.tsx +80 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/Section.tsx +108 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/SectionRow.tsx +20 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/UiApiDetailForm.tsx +140 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FieldValueDisplay.tsx +73 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedAddress.tsx +29 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedEmail.tsx +17 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedPhone.tsx +24 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedText.tsx +11 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/FormattedUrl.tsx +29 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/detail/formatted/index.ts +6 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FilterField.tsx +54 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FilterInput.tsx +55 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FilterSelect.tsx +72 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/filters/FiltersPanel.tsx +380 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/forms/filters-form.tsx +114 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/forms/submit-button.tsx +47 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/GlobalSearchInput.tsx +114 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/ResultCardFields.tsx +71 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchHeader.tsx +31 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchPagination.tsx +144 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchResultCard.tsx +136 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/search/SearchResultsPanel.tsx +197 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/components/shared/LoadingFallback.tsx +61 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/filters/FilterInput.tsx +55 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/filters/FilterSelect.tsx +72 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/form.tsx +209 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/index.ts +22 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useObjectInfoBatch.ts +65 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useObjectSearchData.ts +395 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useRecordDetailLayout.ts +156 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/hooks/useRecordListGraphQL.ts +135 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/pages/DetailPage.tsx +109 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/pages/GlobalSearch.tsx +229 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/filters/filters.ts +120 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/filters/picklist.ts +32 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/index.ts +4 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/objectInfo/objectInfo.ts +166 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/recordDetail/recordDetail.ts +61 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/types/search/searchResults.ts +229 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/apiUtils.ts +125 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/cacheUtils.ts +76 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/debounce.ts +89 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/fieldUtils.ts +354 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/fieldValueExtractor.ts +67 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/filterUtils.ts +32 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/formDataTransformUtils.ts +260 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/formUtils.ts +142 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/graphQLNodeFieldUtils.ts +186 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/graphQLObjectInfoAdapter.ts +319 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/graphQLRecordAdapter.ts +90 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/index.ts +59 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/layoutTransformUtils.ts +236 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/linkUtils.ts +14 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/paginationUtils.ts +49 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/recordUtils.ts +159 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/features/global-search/utils/sanitizationUtils.ts +49 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/lib/utils.ts +6 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/Home.tsx +11 -10
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/TestAccPage.tsx +19 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/routes.tsx +28 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/styles/global.css +122 -0
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/vite.config.ts +2 -1
- package/lib/templates/project/reactb2e/package.json +1 -1
- package/lib/templates/project/reactb2x/.a4drules/{graphql.md → features/feature-graphql-graphql-data-access-rule.md} +186 -125
- package/lib/templates/project/reactb2x/.a4drules/features/feature-react-agentforce-conversation-client-embedded-agent-rule.md +32 -0
- package/lib/templates/project/reactb2x/.a4drules/features/feature-react-chart-analytics-charts-rule.md +27 -0
- package/lib/templates/project/reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/SKILL.md +155 -0
- package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/explore-schema.md} +58 -29
- package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-mutation-query.md} +52 -42
- package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/generate-read-query.md} +32 -22
- package/lib/templates/project/{reactb2e/.a4drules/graphql/tools/schemas/shared.graphqls → reactb2x/.a4drules/skills/feature-graphql-graphql-data-access/docs/shared-schema.graphqls} +1 -1
- package/lib/templates/project/reactb2x/.a4drules/skills/feature-micro-frontend-micro-frontend/SKILL.md +137 -0
- package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/SKILL.md +108 -0
- package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-agentforce-conversation-client-embedded-agent/docs/embed-examples.md +182 -0
- package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-chart-analytics-charts/SKILL.md +41 -0
- package/lib/templates/project/reactb2x/.a4drules/skills/feature-react-chart-analytics-charts/docs/schema-mapping.md +4 -0
- package/lib/templates/project/reactb2x/.a4drules/webapp-code-quality.md +136 -0
- package/lib/templates/project/reactb2x/.a4drules/{images.md → webapp-images.md} +6 -4
- package/lib/templates/project/reactb2x/.a4drules/webapp-no-node-e.md +3 -2
- package/lib/templates/project/reactb2x/.a4drules/webapp-react.md +149 -0
- package/lib/templates/project/reactb2x/.a4drules/{typescript.md → webapp-typescript.md} +10 -29
- package/lib/templates/project/reactb2x/.a4drules/webapp.md +60 -45
- package/lib/templates/project/reactb2x/AGENT.md +1 -1
- package/lib/templates/project/reactb2x/CHANGELOG.md +377 -0
- package/lib/templates/project/reactb2x/README.md +58 -4
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/CHANGELOG.md +10 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/README.md +35 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/package.json +8 -7
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/appLayout.tsx +75 -3
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/alerts/status-alert.tsx +36 -32
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layouts/card-layout.tsx +29 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/alert.tsx +61 -54
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/button.tsx +57 -57
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/card.tsx +86 -75
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/dialog.tsx +129 -110
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/field.tsx +208 -193
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/index.ts +65 -53
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/input.tsx +14 -14
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/label.tsx +17 -14
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/pagination.tsx +108 -88
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/select.tsx +156 -146
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/separator.tsx +19 -19
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/skeleton.tsx +10 -10
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/spinner.tsx +12 -11
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/table.tsx +96 -69
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/tabs.tsx +71 -61
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components.json +1 -1
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/constants.ts +39 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{context → features/authentication/context}/AuthContext.tsx +1 -1
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/footers/footer-link.tsx +1 -1
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/forms/auth-form.tsx +4 -4
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/forms/submit-button.tsx +4 -4
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{hooks → features/authentication/hooks}/form.tsx +13 -9
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/layout/card-skeleton.tsx +2 -2
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components → features/authentication}/layout/centered-page-layout.tsx +2 -3
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{layouts → features/authentication/layouts}/AuthAppLayout.tsx +2 -2
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication/layouts}/authenticationRouteLayout.tsx +2 -2
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication/layouts}/privateRouteLayout.tsx +2 -2
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/ChangePassword.tsx +6 -6
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/ForgotPassword.tsx +5 -5
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/Login.tsx +6 -6
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/Profile.tsx +22 -13
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/Register.tsx +6 -11
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{pages → features/authentication/pages}/ResetPassword.tsx +8 -8
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/sessionTimeout/SessionTimeoutValidator.tsx +6 -6
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/index.ts +19 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/objectDetailService.ts +125 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/objectInfoGraphQLService.ts +194 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/objectInfoService.ts +199 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/api/recordListGraphQLService.ts +365 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailFields.tsx +55 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailForm.tsx +146 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailHeader.tsx +34 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/DetailLayoutSections.tsx +80 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/Section.tsx +108 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/SectionRow.tsx +20 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/UiApiDetailForm.tsx +140 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FieldValueDisplay.tsx +73 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedAddress.tsx +29 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedEmail.tsx +17 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedPhone.tsx +24 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedText.tsx +11 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/FormattedUrl.tsx +29 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/detail/formatted/index.ts +6 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FilterField.tsx +54 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FilterInput.tsx +55 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FilterSelect.tsx +72 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/filters/FiltersPanel.tsx +380 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/forms/filters-form.tsx +114 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/forms/submit-button.tsx +47 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/GlobalSearchInput.tsx +114 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/ResultCardFields.tsx +71 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchHeader.tsx +31 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchPagination.tsx +144 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchResultCard.tsx +136 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/search/SearchResultsPanel.tsx +197 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/components/shared/LoadingFallback.tsx +61 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/filters/FilterInput.tsx +55 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/filters/FilterSelect.tsx +72 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/form.tsx +209 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/index.ts +22 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useObjectInfoBatch.ts +65 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useObjectSearchData.ts +395 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useRecordDetailLayout.ts +156 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/hooks/useRecordListGraphQL.ts +135 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/pages/DetailPage.tsx +109 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/pages/GlobalSearch.tsx +229 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/filters/filters.ts +120 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/filters/picklist.ts +32 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/index.ts +4 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/objectInfo/objectInfo.ts +166 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/recordDetail/recordDetail.ts +61 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/types/search/searchResults.ts +229 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/apiUtils.ts +125 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/cacheUtils.ts +76 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/debounce.ts +89 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/fieldUtils.ts +354 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/fieldValueExtractor.ts +67 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/filterUtils.ts +32 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/formDataTransformUtils.ts +260 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/formUtils.ts +142 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/graphQLNodeFieldUtils.ts +186 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/graphQLObjectInfoAdapter.ts +319 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/graphQLRecordAdapter.ts +90 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/index.ts +59 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/layoutTransformUtils.ts +236 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/linkUtils.ts +14 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/paginationUtils.ts +49 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/recordUtils.ts +159 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/features/global-search/utils/sanitizationUtils.ts +49 -0
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/utils.ts +3 -3
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Home.tsx +11 -10
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/routes.tsx +33 -11
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/styles/global.css +107 -107
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/vite.config.ts +2 -1
- package/lib/templates/project/reactb2x/package.json +1 -1
- package/lib/templates/webapplication/reactbasic/CHANGELOG.md +10 -0
- package/lib/templates/webapplication/reactbasic/README.md +75 -0
- package/lib/templates/webapplication/reactbasic/package.json +13 -5
- package/lib/templates/webapplication/reactbasic/src/appLayout.tsx +75 -3
- package/lib/templates/webapplication/reactbasic/src/components/alerts/status-alert.tsx +49 -0
- package/lib/templates/webapplication/reactbasic/src/components/layouts/card-layout.tsx +29 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/alert.tsx +76 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/button.tsx +67 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/card.tsx +103 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/dialog.tsx +162 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/field.tsx +237 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/index.ts +84 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/input.tsx +19 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/label.tsx +22 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/pagination.tsx +132 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/select.tsx +193 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/separator.tsx +26 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/skeleton.tsx +14 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/spinner.tsx +16 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/table.tsx +114 -0
- package/lib/templates/webapplication/reactbasic/src/components/ui/tabs.tsx +88 -0
- package/lib/templates/webapplication/reactbasic/src/components.json +18 -0
- package/lib/templates/webapplication/reactbasic/src/lib/utils.ts +6 -0
- package/lib/templates/webapplication/reactbasic/src/styles/global.css +122 -0
- package/lib/templates/webapplication/reactbasic/vite.config.ts +2 -1
- package/lib/templates/webapplication/webappbasic/README.md +15 -0
- package/lib/utils/webappTemplateUtils.d.ts +10 -0
- package/lib/utils/webappTemplateUtils.js +55 -7
- package/lib/utils/webappTemplateUtils.js.map +1 -1
- package/package.json +5 -5
- package/lib/templates/project/reactb2e/.a4drules/README.md +0 -35
- package/lib/templates/project/reactb2e/.a4drules/a4d-webapp-generate.md +0 -27
- package/lib/templates/project/reactb2e/.a4drules/build-validation.md +0 -78
- package/lib/templates/project/reactb2e/.a4drules/code-quality.md +0 -137
- package/lib/templates/project/reactb2e/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +0 -205
- package/lib/templates/project/reactb2e/.a4drules/react.md +0 -387
- package/lib/templates/project/reactb2e/.a4drules/react_image_processing.md +0 -45
- package/lib/templates/project/reactb2e/.a4drules/ui-layout.md +0 -23
- package/lib/templates/project/reactb2e/.a4drules/webapp-nav-and-placeholders.md +0 -33
- package/lib/templates/project/reactb2e/.a4drules/webapp-ui-first.md +0 -32
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.d.ts +0 -2
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.js +0 -93
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/package-lock.json +0 -14392
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/graphql-operations-types.ts +0 -116
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/accounts.ts +0 -33
- package/lib/templates/project/reactb2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/query/highRevenueAccountsQuery.graphql +0 -29
- package/lib/templates/project/reactb2x/.a4drules/README.md +0 -35
- package/lib/templates/project/reactb2x/.a4drules/a4d-webapp-generate.md +0 -27
- package/lib/templates/project/reactb2x/.a4drules/build-validation.md +0 -78
- package/lib/templates/project/reactb2x/.a4drules/code-quality.md +0 -137
- package/lib/templates/project/reactb2x/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +0 -205
- package/lib/templates/project/reactb2x/.a4drules/react.md +0 -387
- package/lib/templates/project/reactb2x/.a4drules/react_image_processing.md +0 -45
- package/lib/templates/project/reactb2x/.a4drules/ui-layout.md +0 -23
- package/lib/templates/project/reactb2x/.a4drules/webapp-nav-and-placeholders.md +0 -33
- package/lib/templates/project/reactb2x/.a4drules/webapp-ui-first.md +0 -32
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.d.ts +0 -2
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.js +0 -93
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/package-lock.json +0 -18408
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/graphql-operations-types.ts +0 -116
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/accounts.ts +0 -33
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/query/highRevenueAccountsQuery.graphql +0 -29
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/card-layout.tsx +0 -23
- package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/data-sdk.ts +0 -21
- package/lib/templates/webapplication/reactbasic/build/vite.config.d.ts +0 -2
- package/lib/templates/webapplication/reactbasic/build/vite.config.js +0 -93
- package/lib/templates/webapplication/reactbasic/package-lock.json +0 -14373
- package/lib/templates/webapplication/reactbasic/src/api/graphql-operations-types.ts +0 -116
- package/lib/templates/webapplication/reactbasic/src/api/utils/accounts.ts +0 -33
- package/lib/templates/webapplication/reactbasic/src/api/utils/query/highRevenueAccountsQuery.graphql +0 -29
- /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/authHelpers.ts +0 -0
- /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/authenticationConfig.ts +0 -0
- /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{hooks → features/authentication/hooks}/useCountdownTimer.ts +0 -0
- /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{hooks → features/authentication/hooks}/useRetryWithBackoff.ts +0 -0
- /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/sessionTimeout/sessionTimeService.ts +0 -0
- /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{components/auth → features/authentication}/sessionTimeout/sessionTimeoutConfig.ts +0 -0
- /package/lib/templates/project/reactb2x/force-app/main/default/webapplications/appreacttemplateb2x/src/{utils → features/authentication/utils}/helpers.ts +0 -0
|
@@ -1,51 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- "**/*.ts"
|
|
4
|
+
- "**/*.tsx"
|
|
5
|
+
---
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
# GraphQL Data Access
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
- `force-app/main/default/webapplications/<appName>/**/*.ts`
|
|
7
|
-
- `force-app/main/default/webapplications/<appName>/**/*.tsx`
|
|
9
|
+
Instructs agents to use the established GraphQL utilities for Salesforce data access.
|
|
8
10
|
|
|
9
11
|
## TypeScript Types & Code Generation
|
|
10
12
|
|
|
11
13
|
### Generated Types File
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
Types are auto-generated at: `src/api/graphql-operations-types.ts`
|
|
13
16
|
|
|
14
17
|
### Generation Command
|
|
15
|
-
|
|
18
|
+
|
|
16
19
|
```bash
|
|
17
|
-
|
|
20
|
+
npm run graphql:codegen
|
|
18
21
|
```
|
|
19
22
|
|
|
20
|
-
The codegen configuration is
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
+
The codegen configuration is at `codegen.yml` and generates types from:
|
|
24
|
+
|
|
25
|
+
- Schema: `schema.graphql` (project root)
|
|
26
|
+
- Documents: `src/**/*.{graphql,ts,tsx}`
|
|
23
27
|
|
|
24
28
|
### Type Naming Convention
|
|
29
|
+
|
|
25
30
|
For a GraphQL operation named `GetHighRevenueAccounts`:
|
|
31
|
+
|
|
26
32
|
- **Query/Mutation Response Type**: `GetHighRevenueAccountsQuery` or `GetHighRevenueAccountsMutation`
|
|
27
33
|
- **Input Variables Type**: `GetHighRevenueAccountsQueryVariables` or `GetHighRevenueAccountsMutationVariables`
|
|
28
34
|
|
|
29
35
|
## Core Types & Function Signatures
|
|
30
36
|
|
|
31
|
-
###
|
|
32
|
-
|
|
37
|
+
### getDataSDK Function
|
|
38
|
+
|
|
39
|
+
Available from `@salesforce/sdk-data`:
|
|
33
40
|
|
|
34
41
|
```typescript
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
import { getDataSDK } from "@salesforce/sdk-data";
|
|
43
|
+
|
|
44
|
+
const data = await getDataSDK();
|
|
45
|
+
const response = await data.graphql?.<ResponseType, VariablesType>(query, variables);
|
|
39
46
|
```
|
|
40
47
|
|
|
41
|
-
- `
|
|
42
|
-
- `InputVariables` - The variables type (e.g., `GetHighRevenueAccountsQueryVariables`)
|
|
48
|
+
`getDataSDK()` returns a lazily-initialized `DataSDK` singleton. The `graphql` method uses optional chaining (`?.`) because not all surfaces support GraphQL.
|
|
43
49
|
|
|
44
50
|
### gql Template Tag
|
|
45
|
-
|
|
51
|
+
|
|
52
|
+
Also available from `@salesforce/sdk-data` for inline query definitions:
|
|
46
53
|
|
|
47
54
|
```typescript
|
|
48
|
-
import { gql } from
|
|
55
|
+
import { gql } from "@salesforce/sdk-data";
|
|
49
56
|
|
|
50
57
|
const MY_QUERY = gql`
|
|
51
58
|
query MyQuery {
|
|
@@ -59,7 +66,8 @@ const MY_QUERY = gql`
|
|
|
59
66
|
The `gql` tag is a template literal that allows defining GraphQL queries inline while maintaining syntax highlighting in most editors.
|
|
60
67
|
|
|
61
68
|
### GraphQLResponse Shape
|
|
62
|
-
|
|
69
|
+
|
|
70
|
+
`data.graphql?.()` returns `GraphQLResponse<T>`. Callers destructure `{ data, errors }` and handle errors themselves:
|
|
63
71
|
|
|
64
72
|
```typescript
|
|
65
73
|
interface GraphQLResponse<T> {
|
|
@@ -72,20 +80,55 @@ interface GraphQLResponse<T> {
|
|
|
72
80
|
}
|
|
73
81
|
```
|
|
74
82
|
|
|
83
|
+
### Handling Mixed Responses (Partial Success)
|
|
84
|
+
|
|
85
|
+
GraphQL can return **both `data` and `errors`** in the same response (partial success). For example, some fields may resolve while others fail due to field-level security. Choose a strategy per use case:
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// Strategy A: Strict — treat any errors as failure (default for most queries)
|
|
89
|
+
if (response?.errors?.length) {
|
|
90
|
+
throw new Error(response.errors.map((e) => e.message).join("; "));
|
|
91
|
+
}
|
|
92
|
+
const result = response?.data;
|
|
93
|
+
|
|
94
|
+
// Strategy B: Tolerant — log errors but use partial data
|
|
95
|
+
if (response?.errors?.length) {
|
|
96
|
+
console.warn("GraphQL partial errors:", response.errors);
|
|
97
|
+
}
|
|
98
|
+
const result = response?.data;
|
|
99
|
+
|
|
100
|
+
// Strategy C: Discriminated — fail only when no data came back
|
|
101
|
+
if (response?.errors?.length && !response?.data) {
|
|
102
|
+
throw new Error(response.errors.map((e) => e.message).join("; "));
|
|
103
|
+
}
|
|
104
|
+
if (response?.errors?.length) {
|
|
105
|
+
console.warn("Partial success with errors:", response.errors);
|
|
106
|
+
}
|
|
107
|
+
const result = response?.data;
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**When to use each:**
|
|
111
|
+
|
|
112
|
+
- **Strategy A** — Default. Use for queries where incomplete data would be misleading (e.g., financial summaries, approval workflows).
|
|
113
|
+
- **Strategy B** — Use when partial data is still useful and the UI can degrade gracefully (e.g., dashboard tiles, optional fields).
|
|
114
|
+
- **Strategy C** — Use for mutations where the operation may succeed but some return fields are inaccessible.
|
|
115
|
+
|
|
116
|
+
For mutation-specific partial responses, see `docs/generate-mutation-query.md` which covers `PARTIAL` and `FAILED` status handling workflows.
|
|
117
|
+
|
|
75
118
|
### NodeOfConnection Utility Type
|
|
119
|
+
|
|
76
120
|
Extract the node type from a connection (edges/node pattern):
|
|
77
121
|
|
|
78
122
|
```typescript
|
|
79
|
-
import { type NodeOfConnection } from
|
|
123
|
+
import { type NodeOfConnection } from "@salesforce/sdk-data";
|
|
80
124
|
|
|
81
125
|
// Extract Account node type from the query response
|
|
82
|
-
type AccountNode = NodeOfConnection<
|
|
83
|
-
GetHighRevenueAccountsQuery['uiapi']['query']['Account']
|
|
84
|
-
>;
|
|
126
|
+
type AccountNode = NodeOfConnection<GetHighRevenueAccountsQuery["uiapi"]["query"]["Account"]>;
|
|
85
127
|
```
|
|
86
128
|
|
|
87
129
|
### UIAPI Response Shape
|
|
88
|
-
|
|
130
|
+
|
|
131
|
+
All Salesforce GraphQL record queries follow this structure (https://developer.salesforce.com/docs/platform/graphql/guide/query-record-objects.html):
|
|
89
132
|
|
|
90
133
|
```typescript
|
|
91
134
|
interface UIAPIQueryResponse {
|
|
@@ -98,7 +141,7 @@ interface UIAPIQueryResponse {
|
|
|
98
141
|
[FieldName]?: { value?: FieldType | null } | null;
|
|
99
142
|
// Reference fields include the related record
|
|
100
143
|
[ReferenceField]?: {
|
|
101
|
-
value?: string | null;
|
|
144
|
+
value?: string | null; // The ID
|
|
102
145
|
[RelatedField]?: { value?: RelatedType | null } | null;
|
|
103
146
|
} | null;
|
|
104
147
|
} | null;
|
|
@@ -116,10 +159,11 @@ There are **two acceptable patterns** for defining GraphQL queries:
|
|
|
116
159
|
### Pattern 1: External .graphql File (Recommended for complex queries)
|
|
117
160
|
|
|
118
161
|
#### Step 1: Create .graphql File
|
|
162
|
+
|
|
119
163
|
Store queries in `.graphql` files for codegen to process:
|
|
120
164
|
|
|
121
165
|
```graphql
|
|
122
|
-
#
|
|
166
|
+
# src/api/utils/query/myQuery.graphql
|
|
123
167
|
query GetMyData($myVariable: String) {
|
|
124
168
|
uiapi {
|
|
125
169
|
query {
|
|
@@ -127,7 +171,9 @@ query GetMyData($myVariable: String) {
|
|
|
127
171
|
edges {
|
|
128
172
|
node {
|
|
129
173
|
Id
|
|
130
|
-
Name {
|
|
174
|
+
Name {
|
|
175
|
+
value
|
|
176
|
+
}
|
|
131
177
|
}
|
|
132
178
|
}
|
|
133
179
|
}
|
|
@@ -137,41 +183,50 @@ query GetMyData($myVariable: String) {
|
|
|
137
183
|
```
|
|
138
184
|
|
|
139
185
|
#### Step 2: Run Code Generation
|
|
186
|
+
|
|
140
187
|
```bash
|
|
141
|
-
|
|
188
|
+
npm run graphql:codegen
|
|
142
189
|
```
|
|
143
190
|
|
|
144
191
|
This generates types in `graphql-operations-types.ts`:
|
|
192
|
+
|
|
145
193
|
- `GetMyDataQuery` - response type
|
|
146
194
|
- `GetMyDataQueryVariables` - variables type
|
|
147
195
|
|
|
148
196
|
#### Step 3: Import and Use
|
|
197
|
+
|
|
149
198
|
```typescript
|
|
150
|
-
import {
|
|
151
|
-
import MY_QUERY from
|
|
152
|
-
import type {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
199
|
+
import { getDataSDK, type NodeOfConnection } from "@salesforce/sdk-data";
|
|
200
|
+
import MY_QUERY from "./query/myQuery.graphql?raw";
|
|
201
|
+
import type { GetMyDataQuery, GetMyDataQueryVariables } from "../graphql-operations-types";
|
|
202
|
+
|
|
203
|
+
type MyNode = NodeOfConnection<GetMyDataQuery["uiapi"]["query"]["MyObject"]>;
|
|
204
|
+
|
|
205
|
+
export async function getMyData(variables: GetMyDataQueryVariables): Promise<MyNode[]> {
|
|
206
|
+
const data = await getDataSDK();
|
|
207
|
+
const response = await data.graphql?.<GetMyDataQuery, GetMyDataQueryVariables>(
|
|
208
|
+
MY_QUERY,
|
|
209
|
+
variables,
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
if (response?.errors?.length) {
|
|
213
|
+
const errorMessages = response.errors.map((e) => e.message).join("; ");
|
|
214
|
+
throw new Error(`GraphQL Error: ${errorMessages}`);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return response?.data?.uiapi?.query?.MyObject?.edges?.map((edge) => edge?.node) || [];
|
|
165
218
|
}
|
|
166
219
|
```
|
|
167
220
|
|
|
168
221
|
**Key imports for Pattern 1:**
|
|
169
|
-
|
|
222
|
+
|
|
223
|
+
- `getDataSDK` - Get the DataSDK singleton
|
|
170
224
|
- `NodeOfConnection` - Extract node types from connection responses
|
|
171
225
|
- Query from `.graphql` file with `?raw` suffix
|
|
172
226
|
- Generated types from `graphql-operations-types.ts`
|
|
173
227
|
|
|
174
228
|
**Pattern 1 Benefits:**
|
|
229
|
+
|
|
175
230
|
- Full codegen support with automatic type generation
|
|
176
231
|
- Syntax highlighting and validation in `.graphql` files
|
|
177
232
|
- Easier to share queries across multiple files/components
|
|
@@ -181,6 +236,7 @@ export async function getMyData(
|
|
|
181
236
|
- Clear separation of concerns between query definition and usage
|
|
182
237
|
|
|
183
238
|
**Pattern 1 Limitations:**
|
|
239
|
+
|
|
184
240
|
- Requires separate file management
|
|
185
241
|
- Extra step to run codegen after query changes
|
|
186
242
|
- More boilerplate (file import with `?raw`, separate file to maintain)
|
|
@@ -193,8 +249,8 @@ export async function getMyData(
|
|
|
193
249
|
For simpler queries without variables or when colocation is preferred:
|
|
194
250
|
|
|
195
251
|
```typescript
|
|
196
|
-
import {
|
|
197
|
-
import { type CurrentUserQuery } from
|
|
252
|
+
import { getDataSDK, gql } from "@salesforce/sdk-data";
|
|
253
|
+
import { type CurrentUserQuery } from "../graphql-operations-types";
|
|
198
254
|
|
|
199
255
|
const CURRENT_USER_QUERY = gql`
|
|
200
256
|
query CurrentUser {
|
|
@@ -210,37 +266,44 @@ const CURRENT_USER_QUERY = gql`
|
|
|
210
266
|
`;
|
|
211
267
|
|
|
212
268
|
interface User {
|
|
213
|
-
|
|
214
|
-
|
|
269
|
+
id: string;
|
|
270
|
+
name: string;
|
|
215
271
|
}
|
|
216
272
|
|
|
217
273
|
export async function getCurrentUser(): Promise<User | null> {
|
|
218
274
|
try {
|
|
219
|
-
const
|
|
275
|
+
const data = await getDataSDK();
|
|
276
|
+
const response = await data.graphql?.<CurrentUserQuery>(CURRENT_USER_QUERY);
|
|
277
|
+
|
|
278
|
+
if (response?.errors?.length) {
|
|
279
|
+
throw new Error(response.errors.map((e) => e.message).join("; "));
|
|
280
|
+
}
|
|
220
281
|
|
|
221
|
-
const userData = response
|
|
282
|
+
const userData = response?.data?.uiapi.currentUser;
|
|
222
283
|
|
|
223
284
|
if (!userData) {
|
|
224
|
-
throw new Error(
|
|
285
|
+
throw new Error("No user data found");
|
|
225
286
|
}
|
|
226
287
|
|
|
227
288
|
return {
|
|
228
289
|
id: userData.Id,
|
|
229
|
-
name: userData.Name?.value ||
|
|
290
|
+
name: userData.Name?.value || "User",
|
|
230
291
|
};
|
|
231
292
|
} catch (error) {
|
|
232
|
-
console.error(
|
|
293
|
+
console.error("Error fetching user data:", error);
|
|
233
294
|
throw error;
|
|
234
295
|
}
|
|
235
296
|
}
|
|
236
297
|
```
|
|
237
298
|
|
|
238
299
|
**Key imports for Pattern 2:**
|
|
239
|
-
|
|
300
|
+
|
|
301
|
+
- `getDataSDK` - Get the DataSDK singleton
|
|
240
302
|
- `gql` - Template tag for inline query definition
|
|
241
303
|
- Generated types from `graphql-operations-types.ts`
|
|
242
304
|
|
|
243
305
|
**Pattern 2 Benefits:**
|
|
306
|
+
|
|
244
307
|
- Query is colocated with usage code
|
|
245
308
|
- Supports dynamic queries (e.g., the set of fields changes based on runtime conditions and cannot be predetermined)
|
|
246
309
|
- No separate file to maintain
|
|
@@ -248,51 +311,33 @@ export async function getCurrentUser(): Promise<User | null> {
|
|
|
248
311
|
- Simpler for straightforward queries
|
|
249
312
|
|
|
250
313
|
**Pattern 2 Limitations:**
|
|
314
|
+
|
|
251
315
|
- Inline queries without `gql` template tag are not processed by codegen
|
|
252
316
|
- Must manually ensure query name matches generated types
|
|
253
317
|
- Less suitable for complex queries with fragments
|
|
254
318
|
|
|
255
|
-
## Reference Examples
|
|
256
|
-
|
|
257
|
-
### Pattern 1 Example: accounts.ts
|
|
258
|
-
See `force-app/main/default/webapplications/<appName>/src/api/utils/accounts.ts` for Pattern 1:
|
|
259
|
-
1. Importing query from `.graphql` file with `?raw` suffix
|
|
260
|
-
2. Importing generated types from `graphql-operations-types.ts`
|
|
261
|
-
3. Using `NodeOfConnection` to extract node types
|
|
262
|
-
4. Proper typing with `executeGraphQL<ResponseType>(query, variables)`
|
|
263
|
-
5. Safe data extraction from the nested response
|
|
264
|
-
|
|
265
|
-
### Pattern 2 Example: user.ts
|
|
266
|
-
See `force-app/main/default/webapplications/<appName>/src/api/utils/user.ts` for Pattern 2:
|
|
267
|
-
1. Using `gql` template tag for inline query definition
|
|
268
|
-
2. Importing generated types from `graphql-operations-types.ts`
|
|
269
|
-
3. Simple query without variables
|
|
270
|
-
4. Error handling with try/catch
|
|
271
|
-
5. Direct access to `uiapi.currentUser` (non-connection response)
|
|
272
|
-
|
|
273
319
|
## Conditional Field Selection with Directives
|
|
274
320
|
|
|
275
321
|
For dynamic fieldsets with known fields that should be conditionally included, use GraphQL directives instead of building queries dynamically. This preserves type generation while allowing runtime control.
|
|
276
322
|
|
|
277
323
|
### Directives
|
|
324
|
+
|
|
278
325
|
- **`@include(if: $condition)`** - include field/fragment when `$condition` is `true`
|
|
279
326
|
- **`@skip(if: $condition)`** - skip field/fragment when `$condition` is `true`
|
|
280
327
|
|
|
281
328
|
### Example with Fragments
|
|
329
|
+
|
|
282
330
|
```graphql
|
|
283
|
-
|
|
284
|
-
query GetAccountDetails(
|
|
285
|
-
$id: ID!
|
|
286
|
-
$includeFinancials: Boolean!
|
|
287
|
-
$includeContacts: Boolean!
|
|
288
|
-
) {
|
|
331
|
+
query GetAccountDetails($id: ID!, $includeFinancials: Boolean!, $includeContacts: Boolean!) {
|
|
289
332
|
uiapi {
|
|
290
333
|
query {
|
|
291
334
|
Account(where: { Id: { eq: $id } }) {
|
|
292
335
|
edges {
|
|
293
336
|
node {
|
|
294
337
|
Id
|
|
295
|
-
Name {
|
|
338
|
+
Name {
|
|
339
|
+
value
|
|
340
|
+
}
|
|
296
341
|
...FinancialFields @include(if: $includeFinancials)
|
|
297
342
|
...ContactFields @include(if: $includeContacts)
|
|
298
343
|
}
|
|
@@ -303,107 +348,123 @@ query GetAccountDetails(
|
|
|
303
348
|
}
|
|
304
349
|
|
|
305
350
|
fragment FinancialFields on Account {
|
|
306
|
-
AnnualRevenue {
|
|
307
|
-
|
|
351
|
+
AnnualRevenue {
|
|
352
|
+
value
|
|
353
|
+
}
|
|
354
|
+
NumberOfEmployees {
|
|
355
|
+
value
|
|
356
|
+
}
|
|
308
357
|
}
|
|
309
358
|
|
|
310
359
|
fragment ContactFields on Account {
|
|
311
|
-
Phone {
|
|
312
|
-
|
|
360
|
+
Phone {
|
|
361
|
+
value
|
|
362
|
+
}
|
|
363
|
+
Website {
|
|
364
|
+
value
|
|
365
|
+
}
|
|
313
366
|
}
|
|
314
367
|
```
|
|
315
368
|
|
|
316
369
|
### Usage
|
|
370
|
+
|
|
317
371
|
```typescript
|
|
318
|
-
import {
|
|
319
|
-
import QUERY from
|
|
372
|
+
import { getDataSDK } from "@salesforce/sdk-data";
|
|
373
|
+
import QUERY from "./query/getAccountDetails.graphql?raw";
|
|
320
374
|
import type {
|
|
321
375
|
GetAccountDetailsQuery,
|
|
322
376
|
GetAccountDetailsQueryVariables,
|
|
323
|
-
} from
|
|
324
|
-
|
|
325
|
-
const data = await
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
377
|
+
} from "../graphql-operations-types";
|
|
378
|
+
|
|
379
|
+
const data = await getDataSDK();
|
|
380
|
+
const response = await data.graphql?.<GetAccountDetailsQuery, GetAccountDetailsQueryVariables>(
|
|
381
|
+
QUERY,
|
|
382
|
+
{
|
|
383
|
+
id: accountId,
|
|
384
|
+
includeFinancials: userWantsFinancials,
|
|
385
|
+
includeContacts: userWantsContacts,
|
|
386
|
+
},
|
|
387
|
+
);
|
|
330
388
|
```
|
|
331
389
|
|
|
332
|
-
### Benefits
|
|
333
|
-
- Query stays in `.graphql` file (codegen works)
|
|
334
|
-
- Generated types include all possible fields as optional
|
|
335
|
-
- Runtime control over which fields are fetched
|
|
336
|
-
- Better performance when fields aren't needed
|
|
337
|
-
- Type safety is preserved
|
|
338
|
-
|
|
339
390
|
## Anti-Patterns (Not Recommended)
|
|
340
391
|
|
|
341
392
|
### Direct API Calls
|
|
393
|
+
|
|
342
394
|
```typescript
|
|
343
395
|
// NOT RECOMMENDED: Direct axios/fetch calls for GraphQL
|
|
344
|
-
const response = await axios.post(
|
|
396
|
+
const response = await axios.post("/graphql", { query });
|
|
345
397
|
|
|
346
|
-
// PREFERRED: Use
|
|
347
|
-
const data = await
|
|
398
|
+
// PREFERRED: Use the DataSDK
|
|
399
|
+
const data = await getDataSDK();
|
|
400
|
+
const response = await data.graphql?.<ResponseType>(query, variables);
|
|
348
401
|
```
|
|
349
402
|
|
|
350
403
|
### Missing Type Definitions
|
|
404
|
+
|
|
351
405
|
```typescript
|
|
352
406
|
// NOT RECOMMENDED: Untyped GraphQL calls
|
|
353
|
-
const data = await
|
|
407
|
+
const data = await getDataSDK();
|
|
408
|
+
await data.graphql?.(query);
|
|
354
409
|
|
|
355
410
|
// PREFERRED: Provide response type
|
|
356
|
-
const data = await
|
|
411
|
+
const data = await getDataSDK();
|
|
412
|
+
const response = await data.graphql?.<GetMyDataQuery>(query);
|
|
357
413
|
```
|
|
358
414
|
|
|
359
415
|
### Plain String Queries (Without gql Tag)
|
|
416
|
+
|
|
360
417
|
```typescript
|
|
361
418
|
// NOT RECOMMENDED: Plain string queries without gql tag
|
|
362
419
|
const query = `query { ... }`;
|
|
363
|
-
const data = await
|
|
420
|
+
const data = await getDataSDK();
|
|
421
|
+
await data.graphql?.(query);
|
|
364
422
|
|
|
365
423
|
// PREFERRED: Use gql tag for inline queries
|
|
366
424
|
const QUERY = gql`query { ... }`;
|
|
367
|
-
const data = await
|
|
425
|
+
const data = await getDataSDK();
|
|
426
|
+
const response = await data.graphql?.<ResponseType>(QUERY);
|
|
368
427
|
|
|
369
428
|
// OR: Use .graphql file for complex queries
|
|
370
|
-
import QUERY from
|
|
371
|
-
const data = await
|
|
429
|
+
import QUERY from "./query/myQuery.graphql?raw";
|
|
430
|
+
const data = await getDataSDK();
|
|
431
|
+
const response = await data.graphql?.<ResponseType>(QUERY);
|
|
372
432
|
```
|
|
373
433
|
|
|
374
|
-
|
|
375
|
-
- No syntax highlighting or validation
|
|
376
|
-
- Harder to maintain and refactor
|
|
377
|
-
- More error-prone
|
|
434
|
+
## Benefits of the DataSDK GraphQL API
|
|
378
435
|
|
|
379
|
-
|
|
380
|
-
- Centralized error handling for GraphQL errors
|
|
436
|
+
- Uses the DataSDK with proper authentication and CSRF token handling
|
|
381
437
|
- Consistent typing with `GraphQLResponse<T>` interface
|
|
382
|
-
-
|
|
383
|
-
-
|
|
438
|
+
- Optional chaining (`?.`) safely handles surfaces where GraphQL is unavailable
|
|
439
|
+
- Callers get full `GraphQLResponse<T>` for flexible error handling
|
|
384
440
|
|
|
385
441
|
## Quality Checklist
|
|
442
|
+
|
|
386
443
|
Before completing GraphQL data access code:
|
|
387
444
|
|
|
388
445
|
### For Pattern 1 (.graphql files):
|
|
446
|
+
|
|
389
447
|
1. [ ] Create `.graphql` file for the query/mutation
|
|
390
448
|
2. [ ] Run `npm run graphql:codegen` to generate types
|
|
391
449
|
3. [ ] Import query with `?raw` suffix
|
|
392
450
|
4. [ ] Import generated types from `graphql-operations-types.ts`
|
|
393
|
-
5. [ ] Use `
|
|
394
|
-
6. [ ]
|
|
395
|
-
7. [ ]
|
|
396
|
-
8. [ ]
|
|
451
|
+
5. [ ] Use `data.graphql?.<ResponseType>()` with proper generic
|
|
452
|
+
6. [ ] Handle `response.errors` and destructure `response.data`
|
|
453
|
+
7. [ ] Use `NodeOfConnection` for cleaner node types when needed
|
|
454
|
+
8. [ ] Handle optional chaining for nested response data
|
|
455
|
+
9. [ ] Follow the pattern in `accounts.ts`
|
|
397
456
|
|
|
398
457
|
### For Pattern 2 (inline with gql):
|
|
458
|
+
|
|
399
459
|
1. [ ] Define query using `gql` template tag
|
|
400
460
|
2. [ ] Ensure query name matches generated types in `graphql-operations-types.ts`
|
|
401
461
|
3. [ ] Import generated types for the query
|
|
402
|
-
4. [ ] Use `
|
|
403
|
-
5. [ ] Handle errors
|
|
462
|
+
4. [ ] Use `data.graphql?.<ResponseType>()` with proper generic
|
|
463
|
+
5. [ ] Handle `response.errors` and destructure `response.data`
|
|
404
464
|
6. [ ] Handle optional chaining for nested response data
|
|
405
465
|
7. [ ] Follow the pattern in `user.ts`
|
|
406
466
|
|
|
407
467
|
### General:
|
|
468
|
+
|
|
408
469
|
- [ ] Choose Pattern 1 for complex queries with variables, fragments, or when shared
|
|
409
470
|
- [ ] Choose Pattern 2 for simple, colocated queries without complex requirements
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- "**/*.tsx"
|
|
4
|
+
- "**/components/**/*.ts"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agentforce Conversation Client (standards)
|
|
8
|
+
|
|
9
|
+
When adding or editing the embedded Agentforce chat client in this project, follow these conventions.
|
|
10
|
+
|
|
11
|
+
## Component and library
|
|
12
|
+
|
|
13
|
+
- Use the shared **AgentforceConversationClient** React component from `@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental`. Do not call `embedAgentforceClient` directly in application code.
|
|
14
|
+
- Install with `npm install @salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental`. The underlying SDK (`@salesforce/agentforce-conversation-client`) is included automatically as a dependency.
|
|
15
|
+
|
|
16
|
+
## Authentication
|
|
17
|
+
|
|
18
|
+
- The component resolves auth automatically: **localhost** fetches `frontdoorUrl` from `/__lo/frontdoor`; **production** uses `window.location.origin` as `salesforceOrigin`.
|
|
19
|
+
- Do not hard-code `salesforceOrigin` or `frontdoorUrl` unless the consumer explicitly provides them as props.
|
|
20
|
+
|
|
21
|
+
## Rendering mode
|
|
22
|
+
|
|
23
|
+
- Pass `agentforceClientConfig.renderingConfig.mode` to select **floating** (default) or **inline**. Do not apply custom positioning CSS to override the built-in layout.
|
|
24
|
+
- For inline mode, set `width` and `height` in `renderingConfig`. Do not override iframe dimensions with external CSS.
|
|
25
|
+
|
|
26
|
+
## Agent selection
|
|
27
|
+
|
|
28
|
+
- Use `agentforceClientConfig.agentId` to select a specific agent. Ask the user for the agent ID; if not provided, note that the org's default agent is used.
|
|
29
|
+
|
|
30
|
+
## Placement
|
|
31
|
+
|
|
32
|
+
- Render `<AgentforceConversationClient />` inside the existing app layout (e.g. alongside `<Outlet />`). Do not replace the entire page shell with the chat client.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- "**/*.tsx"
|
|
4
|
+
- "**/components/**/*.ts"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Analytics charts (standards)
|
|
8
|
+
|
|
9
|
+
When adding or editing chart UI in this project, follow these conventions.
|
|
10
|
+
|
|
11
|
+
## Components and library
|
|
12
|
+
|
|
13
|
+
- Use the shared **AnalyticsChart** component (and **ChartContainer** when a framed block is needed). Do not use raw Recharts components for standard line or bar charts.
|
|
14
|
+
- The project must have **recharts** installed (`npm install recharts`).
|
|
15
|
+
|
|
16
|
+
## Data shape
|
|
17
|
+
|
|
18
|
+
- **Time-series** (line): data must be an array of `{ x: string, y: number }`. Map raw fields (e.g. `date`, `value`) to these keys before passing to the chart.
|
|
19
|
+
- **Categorical** (bar): data must be an array of `{ name: string, value: number }`. Map raw fields (e.g. `category`, `total`) accordingly.
|
|
20
|
+
|
|
21
|
+
## Theming
|
|
22
|
+
|
|
23
|
+
- Use only the **theme** prop on AnalyticsChart: `red` (decline/loss), `green` (growth/gain), `neutral` (default or mixed). Do not introduce ad-hoc color schemes for these semantics.
|
|
24
|
+
|
|
25
|
+
## Placement
|
|
26
|
+
|
|
27
|
+
- Render charts inside the existing application frame (e.g. main content or a route). Do not replace the full app shell with a single chart.
|