@salesforce/ui-bundle-template-app-react-template-b2x 1.117.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/LICENSE.txt +82 -0
- package/README.md +52 -0
- package/dist/.forceignore +15 -0
- package/dist/.husky/pre-commit +4 -0
- package/dist/.prettierignore +11 -0
- package/dist/.prettierrc +17 -0
- package/dist/AGENT.md +193 -0
- package/dist/CHANGELOG.md +2128 -0
- package/dist/README.md +72 -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/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/digitalExperienceConfigs/reactexternalapp1.digitalExperienceConfig-meta.xml +8 -0
- package/dist/force-app/main/default/digitalExperiences/site/reactexternalapp1/reactexternalapp1.digitalExperience-meta.xml +11 -0
- package/dist/force-app/main/default/digitalExperiences/site/reactexternalapp1/sfdc_cms__site/reactexternalapp1/_meta.json +5 -0
- package/dist/force-app/main/default/digitalExperiences/site/reactexternalapp1/sfdc_cms__site/reactexternalapp1/content.json +10 -0
- package/dist/force-app/main/default/networks/reactexternalapp.network-meta.xml +60 -0
- package/dist/force-app/main/default/package.xml +20 -0
- package/dist/force-app/main/default/sites/reactexternalapp.site-meta.xml +31 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/.prettierignore +9 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/.prettierrc +11 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/CHANGELOG.md +10 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/README.md +35 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/components.json +18 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/e2e/app.spec.ts +17 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/eslint.config.js +169 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/index.html +12 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/package.json +70 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/playwright.config.ts +24 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/reactexternalapp.uibundle-meta.xml +8 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/scripts/get-graphql-schema.mjs +68 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/scripts/rewrite-e2e-assets.mjs +23 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/api/account/accountSearchService.ts +46 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/api/account/query/distinctAccountIndustries.graphql +19 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/api/account/query/distinctAccountTypes.graphql +19 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/api/account/query/getAccountDetail.graphql +121 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/api/account/query/searchAccounts.graphql +51 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/api/graphql-operations-types.ts +11260 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/api/graphqlClient.ts +25 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/app.tsx +16 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/appLayout.tsx +83 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/icons/book.svg +3 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/icons/copy.svg +4 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/icons/rocket.svg +3 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/icons/star.svg +3 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/images/codey-1.png +0 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/images/codey-2.png +0 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/images/codey-3.png +0 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/assets/images/vibe-codey.svg +194 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/alerts/status-alert.tsx +49 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/layouts/card-layout.tsx +29 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/alert.tsx +76 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/badge.tsx +48 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/breadcrumb.tsx +109 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/button.tsx +67 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/calendar.tsx +232 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/card.tsx +103 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/checkbox.tsx +32 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/collapsible.tsx +33 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/datePicker.tsx +127 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/dialog.tsx +162 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/field.tsx +237 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/index.ts +84 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/input.tsx +19 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/label.tsx +22 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/pagination.tsx +132 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/popover.tsx +89 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/select.tsx +193 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/separator.tsx +26 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/skeleton.tsx +14 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/sonner.tsx +20 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/spinner.tsx +16 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/table.tsx +114 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/ui/tabs.tsx +88 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/api/userProfileApi.ts +95 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/authHelpers.ts +73 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/authenticationConfig.ts +61 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/context/AuthContext.tsx +95 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/footers/footer-link.tsx +36 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/forms/auth-form.tsx +81 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/forms/submit-button.tsx +49 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/hooks/form.tsx +120 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/hooks/useCountdownTimer.ts +266 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/hooks/useRetryWithBackoff.ts +109 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/layout/card-skeleton.tsx +38 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/layout/centered-page-layout.tsx +87 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/layouts/AuthAppLayout.tsx +12 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/layouts/authenticationRouteLayout.tsx +21 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/layouts/privateRouteLayout.tsx +44 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/pages/ChangePassword.tsx +107 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/pages/ForgotPassword.tsx +73 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/pages/Login.tsx +97 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/pages/Profile.tsx +161 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/pages/Register.tsx +133 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/pages/ResetPassword.tsx +107 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/sessionTimeout/SessionTimeoutValidator.tsx +602 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/sessionTimeout/sessionTimeService.ts +149 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/sessionTimeout/sessionTimeoutConfig.ts +77 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/authentication/utils/helpers.ts +121 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/api/accountSearchService.ts +46 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/api/query/distinctAccountIndustries.graphql +19 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/api/query/distinctAccountTypes.graphql +19 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/api/query/getAccountDetail.graphql +121 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/api/query/searchAccounts.graphql +51 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/pages/AccountObjectDetailPage.tsx +357 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/pages/AccountSearch.tsx +312 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/__examples__/pages/Home.tsx +34 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/api/objectSearchService.ts +84 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/ActiveFilters.tsx +89 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/FilterContext.tsx +83 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/ObjectBreadcrumb.tsx +66 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/PaginationControls.tsx +109 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/SearchBar.tsx +41 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/SortControl.tsx +143 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/BooleanFilter.tsx +78 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/DateFilter.tsx +128 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/DateRangeFilter.tsx +70 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/FilterFieldWrapper.tsx +33 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/MultiSelectFilter.tsx +97 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/NumericRangeFilter.tsx +163 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/SearchFilter.tsx +50 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/SelectFilter.tsx +97 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/components/filters/TextFilter.tsx +91 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/hooks/useAsyncData.ts +54 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/hooks/useCachedAsyncData.ts +184 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/hooks/useDebouncedCallback.ts +34 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/hooks/useObjectSearchParams.ts +252 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/utils/debounce.ts +25 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/utils/fieldUtils.ts +29 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/utils/filterUtils.ts +395 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/features/object-search/utils/sortUtils.ts +38 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/lib/utils.ts +6 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/navigationMenu.tsx +80 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/pages/AccountObjectDetailPage.tsx +361 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/pages/AccountSearch.tsx +305 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/pages/Home.tsx +34 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/pages/NotFound.tsx +18 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/router-utils.tsx +35 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/routes.tsx +81 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/styles/global.css +135 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/tsconfig.json +42 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/tsconfig.node.json +13 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/ui-bundle.json +7 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/vite-env.d.ts +1 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/vite.config.ts +106 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/vitest-env.d.ts +2 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/vitest.config.ts +11 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/vitest.setup.ts +1 -0
- package/dist/jest.config.js +6 -0
- package/dist/package-lock.json +9995 -0
- package/dist/package.json +40 -0
- package/dist/scripts/apex/hello.apex +10 -0
- package/dist/scripts/graphql-search.sh +191 -0
- package/dist/scripts/prepare-import-unique-fields.js +122 -0
- package/dist/scripts/setup-cli.mjs +563 -0
- package/dist/scripts/sf-project-setup.mjs +66 -0
- package/dist/scripts/soql/account.soql +6 -0
- package/dist/sfdx-project.json +12 -0
- package/package.json +40 -0
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
|
|
19
|
+
async function executeSalesforceGraphQLQuery(query, variables, operationName) {
|
|
20
|
+
const {
|
|
21
|
+
rawInstanceUrl: instanceUrl,
|
|
22
|
+
apiVersion,
|
|
23
|
+
accessToken,
|
|
24
|
+
} = await getOrgInfo();
|
|
25
|
+
|
|
26
|
+
const targetUrl = `${instanceUrl}/services/data/v${apiVersion}/graphql`;
|
|
27
|
+
|
|
28
|
+
console.log(`Executing introspection query against ${targetUrl}`);
|
|
29
|
+
const response = await fetch(targetUrl, {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
headers: {
|
|
32
|
+
Authorization: `Bearer ${accessToken}`,
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
'X-Chatter-Entity-Encoding': 'false',
|
|
35
|
+
},
|
|
36
|
+
body: JSON.stringify({ query, variables, operationName }),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
const errorText = await response.text();
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Salesforce GraphQL request failed: ${response.status} ${response.statusText} - ${errorText}`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return response.json();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const outputPath = resolve(process.argv[2] || DEFAULT_SCHEMA_PATH);
|
|
51
|
+
|
|
52
|
+
const introspectionResult = await executeSalesforceGraphQLQuery(
|
|
53
|
+
getIntrospectionQuery(),
|
|
54
|
+
{},
|
|
55
|
+
'IntrospectionQuery'
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const schema = buildClientSchema(introspectionResult.data);
|
|
59
|
+
const prunedSchema = pruneSchema(schema);
|
|
60
|
+
const sdl = printSchema(prunedSchema);
|
|
61
|
+
|
|
62
|
+
writeFileSync(outputPath, sdl);
|
|
63
|
+
|
|
64
|
+
console.log(`Schema saved to ${outputPath}`);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error('Error:', error.message);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
@@ -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
|
+
);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import SEARCH_ACCOUNTS_QUERY from "./query/searchAccounts.graphql?raw";
|
|
2
|
+
import DISTINCT_INDUSTRIES_QUERY from "./query/distinctAccountIndustries.graphql?raw";
|
|
3
|
+
import DISTINCT_TYPES_QUERY from "./query/distinctAccountTypes.graphql?raw";
|
|
4
|
+
import {
|
|
5
|
+
searchObjects,
|
|
6
|
+
fetchDistinctValues,
|
|
7
|
+
type ObjectSearchOptions,
|
|
8
|
+
type PicklistOption,
|
|
9
|
+
} from "../../features/object-search/api/objectSearchService";
|
|
10
|
+
import type {
|
|
11
|
+
SearchAccountsQuery,
|
|
12
|
+
SearchAccountsQueryVariables,
|
|
13
|
+
DistinctAccountIndustriesQuery,
|
|
14
|
+
DistinctAccountTypesQuery,
|
|
15
|
+
} from "../graphql-operations-types";
|
|
16
|
+
|
|
17
|
+
export type AccountSearchResult = NonNullable<SearchAccountsQuery["uiapi"]["query"]["Account"]>;
|
|
18
|
+
|
|
19
|
+
export type AccountSearchOptions = ObjectSearchOptions<
|
|
20
|
+
SearchAccountsQueryVariables["where"],
|
|
21
|
+
SearchAccountsQueryVariables["orderBy"]
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export type { PicklistOption };
|
|
25
|
+
|
|
26
|
+
export async function searchAccounts(
|
|
27
|
+
options: AccountSearchOptions = {},
|
|
28
|
+
): Promise<AccountSearchResult> {
|
|
29
|
+
return searchObjects<AccountSearchResult, SearchAccountsQuery, SearchAccountsQueryVariables>(
|
|
30
|
+
SEARCH_ACCOUNTS_QUERY,
|
|
31
|
+
"Account",
|
|
32
|
+
options,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function fetchDistinctIndustries(): Promise<PicklistOption[]> {
|
|
37
|
+
return fetchDistinctValues<DistinctAccountIndustriesQuery>(
|
|
38
|
+
DISTINCT_INDUSTRIES_QUERY,
|
|
39
|
+
"Account",
|
|
40
|
+
"Industry",
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export async function fetchDistinctTypes(): Promise<PicklistOption[]> {
|
|
45
|
+
return fetchDistinctValues<DistinctAccountTypesQuery>(DISTINCT_TYPES_QUERY, "Account", "Type");
|
|
46
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
query DistinctAccountIndustries {
|
|
2
|
+
uiapi {
|
|
3
|
+
aggregate {
|
|
4
|
+
Account(groupBy: { Industry: { group: true } }) {
|
|
5
|
+
edges {
|
|
6
|
+
node {
|
|
7
|
+
aggregate @optional {
|
|
8
|
+
Industry @optional {
|
|
9
|
+
value
|
|
10
|
+
displayValue
|
|
11
|
+
label
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
query GetAccountDetail($id: ID!) {
|
|
2
|
+
uiapi {
|
|
3
|
+
query {
|
|
4
|
+
Account(where: { Id: { eq: $id } }) {
|
|
5
|
+
edges {
|
|
6
|
+
node {
|
|
7
|
+
Id
|
|
8
|
+
Name @optional {
|
|
9
|
+
value
|
|
10
|
+
displayValue
|
|
11
|
+
}
|
|
12
|
+
Owner @optional {
|
|
13
|
+
Name @optional {
|
|
14
|
+
value
|
|
15
|
+
displayValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
Phone @optional {
|
|
19
|
+
value
|
|
20
|
+
displayValue
|
|
21
|
+
}
|
|
22
|
+
Fax @optional {
|
|
23
|
+
value
|
|
24
|
+
displayValue
|
|
25
|
+
}
|
|
26
|
+
Parent @optional {
|
|
27
|
+
Name @optional {
|
|
28
|
+
value
|
|
29
|
+
displayValue
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
Website @optional {
|
|
33
|
+
value
|
|
34
|
+
displayValue
|
|
35
|
+
}
|
|
36
|
+
Type @optional {
|
|
37
|
+
value
|
|
38
|
+
displayValue
|
|
39
|
+
}
|
|
40
|
+
NumberOfEmployees @optional {
|
|
41
|
+
value
|
|
42
|
+
displayValue
|
|
43
|
+
}
|
|
44
|
+
Industry @optional {
|
|
45
|
+
value
|
|
46
|
+
displayValue
|
|
47
|
+
}
|
|
48
|
+
AnnualRevenue @optional {
|
|
49
|
+
value
|
|
50
|
+
displayValue
|
|
51
|
+
}
|
|
52
|
+
Description @optional {
|
|
53
|
+
value
|
|
54
|
+
displayValue
|
|
55
|
+
}
|
|
56
|
+
BillingStreet @optional {
|
|
57
|
+
value
|
|
58
|
+
displayValue
|
|
59
|
+
}
|
|
60
|
+
BillingCity @optional {
|
|
61
|
+
value
|
|
62
|
+
displayValue
|
|
63
|
+
}
|
|
64
|
+
BillingState @optional {
|
|
65
|
+
value
|
|
66
|
+
displayValue
|
|
67
|
+
}
|
|
68
|
+
BillingPostalCode @optional {
|
|
69
|
+
value
|
|
70
|
+
displayValue
|
|
71
|
+
}
|
|
72
|
+
BillingCountry @optional {
|
|
73
|
+
value
|
|
74
|
+
displayValue
|
|
75
|
+
}
|
|
76
|
+
ShippingStreet @optional {
|
|
77
|
+
value
|
|
78
|
+
displayValue
|
|
79
|
+
}
|
|
80
|
+
ShippingCity @optional {
|
|
81
|
+
value
|
|
82
|
+
displayValue
|
|
83
|
+
}
|
|
84
|
+
ShippingState @optional {
|
|
85
|
+
value
|
|
86
|
+
displayValue
|
|
87
|
+
}
|
|
88
|
+
ShippingPostalCode @optional {
|
|
89
|
+
value
|
|
90
|
+
displayValue
|
|
91
|
+
}
|
|
92
|
+
ShippingCountry @optional {
|
|
93
|
+
value
|
|
94
|
+
displayValue
|
|
95
|
+
}
|
|
96
|
+
CreatedBy @optional {
|
|
97
|
+
Name @optional {
|
|
98
|
+
value
|
|
99
|
+
displayValue
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
CreatedDate @optional {
|
|
103
|
+
value
|
|
104
|
+
displayValue
|
|
105
|
+
}
|
|
106
|
+
LastModifiedBy @optional {
|
|
107
|
+
Name @optional {
|
|
108
|
+
value
|
|
109
|
+
displayValue
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
LastModifiedDate @optional {
|
|
113
|
+
value
|
|
114
|
+
displayValue
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
query SearchAccounts(
|
|
2
|
+
$first: Int
|
|
3
|
+
$after: String
|
|
4
|
+
$where: Account_Filter
|
|
5
|
+
$orderBy: Account_OrderBy
|
|
6
|
+
) {
|
|
7
|
+
uiapi {
|
|
8
|
+
query {
|
|
9
|
+
Account(first: $first, after: $after, where: $where, orderBy: $orderBy) {
|
|
10
|
+
edges {
|
|
11
|
+
node {
|
|
12
|
+
Id
|
|
13
|
+
Name @optional {
|
|
14
|
+
value
|
|
15
|
+
displayValue
|
|
16
|
+
}
|
|
17
|
+
Industry @optional {
|
|
18
|
+
value
|
|
19
|
+
displayValue
|
|
20
|
+
}
|
|
21
|
+
Type @optional {
|
|
22
|
+
value
|
|
23
|
+
displayValue
|
|
24
|
+
}
|
|
25
|
+
Phone @optional {
|
|
26
|
+
value
|
|
27
|
+
displayValue
|
|
28
|
+
}
|
|
29
|
+
Owner @optional {
|
|
30
|
+
Name @optional {
|
|
31
|
+
value
|
|
32
|
+
displayValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
AnnualRevenue @optional {
|
|
36
|
+
value
|
|
37
|
+
displayValue
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
pageInfo {
|
|
42
|
+
hasNextPage
|
|
43
|
+
hasPreviousPage
|
|
44
|
+
endCursor
|
|
45
|
+
startCursor
|
|
46
|
+
}
|
|
47
|
+
totalCount
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|