@schandlergarcia/sf-web-components 2.3.16 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/CLAUDE.md +12 -13
- package/README.md +0 -15
- package/dist/styles/global.css +46 -48
- package/package.json +1 -2
- package/scripts/apply-brand.mjs +47 -30
- package/scripts/postinstall.mjs +1 -11
- package/src/styles/global.css +46 -48
- package/brands/engine/PARTNER_HUB_PRD.md +0 -584
- package/brands/engine/agentApiConfig.ts +0 -36
- package/brands/engine/app/api/graphql-operations-types.ts +0 -11260
- package/brands/engine/app/api/graphqlClient.ts +0 -25
- package/brands/engine/app/api/partnerQueries.ts +0 -212
- package/brands/engine/app/appLayout.tsx +0 -5
- package/brands/engine/app/components/AgentPanel.tsx +0 -402
- package/brands/engine/app/components/AgentforceConversationClient.tsx +0 -201
- package/brands/engine/app/components/__inherit_AgentforceConversationClient.tsx +0 -3
- package/brands/engine/app/components/alerts/status-alert.tsx +0 -49
- package/brands/engine/app/components/layouts/card-layout.tsx +0 -29
- package/brands/engine/app/components/workspace/CommandCenter.tsx +0 -16
- package/brands/engine/app/config/agentApi.ts +0 -36
- package/brands/engine/app/features/object-search/__examples__/api/accountSearchService.ts +0 -46
- package/brands/engine/app/features/object-search/__examples__/api/query/distinctAccountIndustries.graphql +0 -19
- package/brands/engine/app/features/object-search/__examples__/api/query/distinctAccountTypes.graphql +0 -19
- package/brands/engine/app/features/object-search/__examples__/api/query/getAccountDetail.graphql +0 -121
- package/brands/engine/app/features/object-search/__examples__/api/query/searchAccounts.graphql +0 -51
- package/brands/engine/app/features/object-search/__examples__/pages/AccountObjectDetailPage.tsx +0 -357
- package/brands/engine/app/features/object-search/__examples__/pages/AccountSearch.tsx +0 -312
- package/brands/engine/app/features/object-search/__examples__/pages/Home.tsx +0 -34
- package/brands/engine/app/features/object-search/api/objectSearchService.ts +0 -84
- package/brands/engine/app/features/object-search/components/ActiveFilters.tsx +0 -89
- package/brands/engine/app/features/object-search/components/FilterContext.tsx +0 -83
- package/brands/engine/app/features/object-search/components/ObjectBreadcrumb.tsx +0 -66
- package/brands/engine/app/features/object-search/components/PaginationControls.tsx +0 -109
- package/brands/engine/app/features/object-search/components/SearchBar.tsx +0 -41
- package/brands/engine/app/features/object-search/components/SortControl.tsx +0 -143
- package/brands/engine/app/features/object-search/components/filters/BooleanFilter.tsx +0 -78
- package/brands/engine/app/features/object-search/components/filters/DateFilter.tsx +0 -128
- package/brands/engine/app/features/object-search/components/filters/DateRangeFilter.tsx +0 -70
- package/brands/engine/app/features/object-search/components/filters/FilterFieldWrapper.tsx +0 -33
- package/brands/engine/app/features/object-search/components/filters/MultiSelectFilter.tsx +0 -97
- package/brands/engine/app/features/object-search/components/filters/NumericRangeFilter.tsx +0 -163
- package/brands/engine/app/features/object-search/components/filters/SearchFilter.tsx +0 -50
- package/brands/engine/app/features/object-search/components/filters/SelectFilter.tsx +0 -97
- package/brands/engine/app/features/object-search/components/filters/TextFilter.tsx +0 -91
- package/brands/engine/app/features/object-search/hooks/useAsyncData.ts +0 -54
- package/brands/engine/app/features/object-search/hooks/useCachedAsyncData.ts +0 -184
- package/brands/engine/app/features/object-search/hooks/useDebouncedCallback.ts +0 -34
- package/brands/engine/app/features/object-search/hooks/useObjectSearchParams.ts +0 -252
- package/brands/engine/app/features/object-search/utils/debounce.ts +0 -25
- package/brands/engine/app/features/object-search/utils/fieldUtils.ts +0 -29
- package/brands/engine/app/features/object-search/utils/filterUtils.ts +0 -404
- package/brands/engine/app/features/object-search/utils/sortUtils.ts +0 -38
- package/brands/engine/app/hooks/useEngineLiveData.ts +0 -49
- package/brands/engine/app/hooks/useEvaAgent.ts +0 -288
- package/brands/engine/app/hooks/usePartnerDashboardData.ts +0 -141
- package/brands/engine/app/navigationMenu.tsx +0 -80
- package/brands/engine/app/pages/AccountObjectDetailPage.tsx +0 -361
- package/brands/engine/app/pages/AccountSearch.tsx +0 -305
- package/brands/engine/app/pages/BlankDashboard.tsx +0 -15
- package/brands/engine/app/pages/DataTest.tsx +0 -78
- package/brands/engine/app/pages/Home.tsx +0 -5
- package/brands/engine/app/pages/NotFound.tsx +0 -19
- package/brands/engine/app/pages/PartnerHubDashboard.tsx +0 -2077
- package/brands/engine/app/pages/Search.tsx +0 -13
- package/brands/engine/app/router-utils.tsx +0 -35
- package/brands/engine/app/routes.tsx +0 -39
- package/brands/engine/app/styles/global.css +0 -269
- package/brands/engine/brand.css +0 -40
- package/brands/engine/engine-command-center-prd.md +0 -575
- package/brands/engine/engine-live-data.js +0 -135
- package/brands/engine/engine-sample-data.js +0 -378
- package/brands/engine/engine_logo.png +0 -0
- package/brands/engine/global.css +0 -269
- package/brands/engine/partner-hub-sample-data.js +0 -281
- package/brands/engine/schema.graphql +0 -292
- package/brands/engine/useEngineLiveData.ts +0 -49
- package/brands/engine/useEvaAgent.ts +0 -288
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* For full license text, see the LICENSE.txt file
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { embedAgentforceClient } from "@salesforce/agentforce-conversation-client";
|
|
8
|
-
import type { AgentforceClientConfig } from "@salesforce/agentforce-conversation-client";
|
|
9
|
-
import { useEffect, useMemo, useRef } from "react";
|
|
10
|
-
import type {
|
|
11
|
-
ResolvedEmbedOptions,
|
|
12
|
-
AgentforceConversationClientProps,
|
|
13
|
-
} from "../types/conversation";
|
|
14
|
-
|
|
15
|
-
const GLOBAL_HOST_ID = "agentforce-conversation-client-global-host";
|
|
16
|
-
|
|
17
|
-
const DEFAULT_STYLE_TOKENS: NonNullable<AgentforceClientConfig["styleTokens"]> = {
|
|
18
|
-
containerBackground: "#fafafa",
|
|
19
|
-
|
|
20
|
-
headerBlockBackground: "#372949",
|
|
21
|
-
headerBlockTextColor: "#ffffff",
|
|
22
|
-
headerBlockIconColor: "#ffffff",
|
|
23
|
-
headerBlockBorderBottomColor: "#3b0764",
|
|
24
|
-
headerBlockFocusBorder: "#c4b5fd",
|
|
25
|
-
|
|
26
|
-
messageBlockInboundBackgroundColor: "#ffffff",
|
|
27
|
-
messageBlockInboundTextColor: "#1f2937",
|
|
28
|
-
messageBlockInboundBorder: "1px solid #e5e7eb",
|
|
29
|
-
|
|
30
|
-
messageBlockOutboundBackgroundColor: "#ede9fe",
|
|
31
|
-
messageBlockOutboundTextColor: "#1f2937",
|
|
32
|
-
messageBlockOutboundBorder: "1px solid #d8b4fe",
|
|
33
|
-
|
|
34
|
-
messageInputTextColor: "#1f2937",
|
|
35
|
-
messageInputTextBackgroundColor: "#ffffff",
|
|
36
|
-
messageInputFooterBorderColor: "#d1d5db",
|
|
37
|
-
messageInputFooterBorderFocusColor: "#9ca3af",
|
|
38
|
-
messageInputFocusShadow: "0 0 0 3px rgba(156, 163, 175, 0.25)",
|
|
39
|
-
messageInputFooterPlaceholderText: "#6b7280",
|
|
40
|
-
|
|
41
|
-
messageInputFooterSendButton: "#7e22ce",
|
|
42
|
-
messageInputFooterSendButtonHoverColor: "#6b21a8",
|
|
43
|
-
messageInputSendButtonIconColor: "#ffffff",
|
|
44
|
-
messageInputSendButtonDisabledColor: "#e5e7eb",
|
|
45
|
-
messageInputActionButtonFocusBorder: "#a855f7",
|
|
46
|
-
};
|
|
47
|
-
const SINGLETON_KEY = "__agentforceConversationClientSingleton";
|
|
48
|
-
|
|
49
|
-
interface AgentforceConversationClientSingleton {
|
|
50
|
-
initPromise?: Promise<void>;
|
|
51
|
-
initialized: boolean;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface WindowWithAgentforceSingleton extends Window {
|
|
55
|
-
[SINGLETON_KEY]?: AgentforceConversationClientSingleton;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function getSingleton(): AgentforceConversationClientSingleton {
|
|
59
|
-
const win = window as WindowWithAgentforceSingleton;
|
|
60
|
-
if (!win[SINGLETON_KEY]) {
|
|
61
|
-
win[SINGLETON_KEY] = {
|
|
62
|
-
initialized: false,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return win[SINGLETON_KEY]!;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function getOrCreateGlobalHost(): HTMLDivElement {
|
|
69
|
-
let host = document.getElementById(GLOBAL_HOST_ID) as HTMLDivElement | null;
|
|
70
|
-
if (!host) {
|
|
71
|
-
host = document.createElement("div");
|
|
72
|
-
host.id = GLOBAL_HOST_ID;
|
|
73
|
-
document.body.appendChild(host);
|
|
74
|
-
}
|
|
75
|
-
return host;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function getDefaultEmbedOptions(): ResolvedEmbedOptions {
|
|
79
|
-
return { salesforceOrigin: window.location.origin };
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* React wrapper that embeds the Agentforce Conversation Client (copilot/agent UI)
|
|
84
|
-
* using Lightning Out. Requires a valid Salesforce session for the given org.
|
|
85
|
-
* Config is passed through from the consumer to the embed client as-is.
|
|
86
|
-
*/
|
|
87
|
-
export function AgentforceConversationClient({
|
|
88
|
-
agentId,
|
|
89
|
-
agentLabel,
|
|
90
|
-
inline: inlineProp,
|
|
91
|
-
headerEnabled,
|
|
92
|
-
showHeaderIcon,
|
|
93
|
-
width,
|
|
94
|
-
height,
|
|
95
|
-
styleTokens,
|
|
96
|
-
salesforceOrigin,
|
|
97
|
-
frontdoorUrl,
|
|
98
|
-
}: AgentforceConversationClientProps) {
|
|
99
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
100
|
-
const normalizedAgentforceClientConfig = useMemo<AgentforceClientConfig>(() => {
|
|
101
|
-
const renderingConfig: NonNullable<AgentforceClientConfig["renderingConfig"]> = {
|
|
102
|
-
mode: inlineProp ? "inline" : "floating",
|
|
103
|
-
...(headerEnabled !== undefined && { headerEnabled }),
|
|
104
|
-
...(showHeaderIcon !== undefined && { showHeaderIcon }),
|
|
105
|
-
...{ showAvatar: false },
|
|
106
|
-
...(width !== undefined && { width }),
|
|
107
|
-
...(height !== undefined && { height }),
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
...(agentId !== undefined && { agentId }),
|
|
112
|
-
agentLabel: agentLabel ?? "Chat with us",
|
|
113
|
-
styleTokens: { ...DEFAULT_STYLE_TOKENS, ...styleTokens },
|
|
114
|
-
renderingConfig,
|
|
115
|
-
};
|
|
116
|
-
}, [agentId, agentLabel, inlineProp, headerEnabled, showHeaderIcon, width, height, styleTokens]);
|
|
117
|
-
|
|
118
|
-
const inline = normalizedAgentforceClientConfig?.renderingConfig?.mode === "inline";
|
|
119
|
-
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
if (!normalizedAgentforceClientConfig?.agentId) {
|
|
122
|
-
throw new Error(
|
|
123
|
-
"AgentforceConversationClient requires agentId. " +
|
|
124
|
-
"Pass flat props only (agentId, agentLabel, inline, headerEnabled, showHeaderIcon, width, height, styleTokens).",
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const singleton = getSingleton();
|
|
129
|
-
if (singleton.initialized || singleton.initPromise) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (inline && !containerRef.current) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const initialize = (options: ResolvedEmbedOptions) => {
|
|
138
|
-
if (singleton.initialized) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const existingEmbed = document.querySelector('lightning-out-application[data-lo="acc"]');
|
|
142
|
-
if (existingEmbed) {
|
|
143
|
-
singleton.initialized = true;
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const host = inline ? containerRef.current! : getOrCreateGlobalHost();
|
|
147
|
-
|
|
148
|
-
embedAgentforceClient({
|
|
149
|
-
container: host,
|
|
150
|
-
salesforceOrigin: salesforceOrigin ?? options.salesforceOrigin,
|
|
151
|
-
frontdoorUrl: frontdoorUrl ?? options.frontdoorUrl,
|
|
152
|
-
agentforceClientConfig: normalizedAgentforceClientConfig,
|
|
153
|
-
});
|
|
154
|
-
singleton.initialized = true;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const shouldFetchFrontdoor = window.location.hostname === "localhost";
|
|
158
|
-
|
|
159
|
-
if (shouldFetchFrontdoor) {
|
|
160
|
-
singleton.initPromise = fetch("/__lo/frontdoor")
|
|
161
|
-
.then(async (res) => {
|
|
162
|
-
if (!res.ok) {
|
|
163
|
-
console.error("frontdoor fetch failed");
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
const { frontdoorUrl: resolvedFrontdoorUrl } = await res.json();
|
|
167
|
-
initialize({ frontdoorUrl: resolvedFrontdoorUrl });
|
|
168
|
-
})
|
|
169
|
-
.catch((err) => {
|
|
170
|
-
console.error("AgentforceConversationClient: failed to fetch frontdoor URL", err);
|
|
171
|
-
})
|
|
172
|
-
.finally(() => {
|
|
173
|
-
singleton.initPromise = undefined;
|
|
174
|
-
});
|
|
175
|
-
} else {
|
|
176
|
-
singleton.initPromise = Promise.resolve()
|
|
177
|
-
.then(() => {
|
|
178
|
-
initialize(getDefaultEmbedOptions());
|
|
179
|
-
})
|
|
180
|
-
.catch((err) => {
|
|
181
|
-
console.error("AgentforceConversationClient: failed to embed Agentforce client", err);
|
|
182
|
-
})
|
|
183
|
-
.finally(() => {
|
|
184
|
-
singleton.initPromise = undefined;
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return () => {
|
|
189
|
-
// Intentionally no cleanup:
|
|
190
|
-
// This component guarantees a single LO initialization per window.
|
|
191
|
-
};
|
|
192
|
-
}, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline]);
|
|
193
|
-
|
|
194
|
-
if (!inline) {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return <div ref={containerRef} />;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export default AgentforceConversationClient;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
-
import { AlertCircleIcon, CheckCircle2Icon } from 'lucide-react';
|
|
3
|
-
import { Alert, AlertDescription } from '../../components/ui/alert';
|
|
4
|
-
import { useId } from 'react';
|
|
5
|
-
|
|
6
|
-
const statusAlertVariants = cva('', {
|
|
7
|
-
variants: {
|
|
8
|
-
variant: {
|
|
9
|
-
error: '',
|
|
10
|
-
success: '',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
defaultVariants: {
|
|
14
|
-
variant: 'error',
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
interface StatusAlertProps extends VariantProps<typeof statusAlertVariants> {
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
/** Alert variant type. @default "error" */
|
|
21
|
-
variant?: 'error' | 'success';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Status alert component for displaying error or success messages.
|
|
26
|
-
* Returns null if no children are provided.
|
|
27
|
-
*/
|
|
28
|
-
export function StatusAlert({ children, variant = 'error' }: StatusAlertProps) {
|
|
29
|
-
const descriptionId = useId();
|
|
30
|
-
if (!children) return null;
|
|
31
|
-
|
|
32
|
-
const isError = variant === 'error';
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<Alert
|
|
36
|
-
variant={isError ? 'destructive' : 'default'}
|
|
37
|
-
className={statusAlertVariants({ variant })}
|
|
38
|
-
aria-describedby={descriptionId}
|
|
39
|
-
role={isError ? 'alert' : 'status'}
|
|
40
|
-
>
|
|
41
|
-
{isError ? (
|
|
42
|
-
<AlertCircleIcon aria-hidden="true" />
|
|
43
|
-
) : (
|
|
44
|
-
<CheckCircle2Icon aria-hidden="true" />
|
|
45
|
-
)}
|
|
46
|
-
<AlertDescription id={descriptionId}>{children}</AlertDescription>
|
|
47
|
-
</Alert>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Card,
|
|
3
|
-
CardContent,
|
|
4
|
-
CardDescription,
|
|
5
|
-
CardHeader,
|
|
6
|
-
CardTitle,
|
|
7
|
-
} from '../../components/ui/card';
|
|
8
|
-
|
|
9
|
-
interface CardLayoutProps {
|
|
10
|
-
title: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Card layout component for authentication pages.
|
|
17
|
-
* Provides CardHeader with title and optional description, and CardContent.
|
|
18
|
-
*/
|
|
19
|
-
export function CardLayout({ title, description, children }: CardLayoutProps) {
|
|
20
|
-
return (
|
|
21
|
-
<Card>
|
|
22
|
-
<CardHeader>
|
|
23
|
-
<CardTitle className="text-2xl">{title}</CardTitle>
|
|
24
|
-
{description && <CardDescription>{description}</CardDescription>}
|
|
25
|
-
</CardHeader>
|
|
26
|
-
<CardContent>{children}</CardContent>
|
|
27
|
-
</Card>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import AppThemeProvider from "@/components/library/theme/AppThemeProvider";
|
|
2
|
-
import DataModeProvider from "@/components/library/data/DataModeProvider";
|
|
3
|
-
import { ENABLE_SAMPLE_DATA_CACHE } from "@/lib/dataStrategy";
|
|
4
|
-
import { Toaster } from "sonner";
|
|
5
|
-
import PartnerHubDashboard from "../../pages/PartnerHubDashboard";
|
|
6
|
-
|
|
7
|
-
export default function CommandCenter() {
|
|
8
|
-
return (
|
|
9
|
-
<AppThemeProvider initialMode="light">
|
|
10
|
-
<DataModeProvider initialMode={ENABLE_SAMPLE_DATA_CACHE ? "sample" : "live"}>
|
|
11
|
-
<PartnerHubDashboard />
|
|
12
|
-
<Toaster position="bottom-right" />
|
|
13
|
-
</DataModeProvider>
|
|
14
|
-
</AppThemeProvider>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agentforce Agent API Configuration
|
|
3
|
-
*
|
|
4
|
-
* These values connect the ChatBar to the real Agentforce agent (Eva)
|
|
5
|
-
* via the REST-based Agent API instead of the iframe-based
|
|
6
|
-
* AgentforceConversationClient.
|
|
7
|
-
*
|
|
8
|
-
* Flow: OAuth token → create session → send messages → end session
|
|
9
|
-
*
|
|
10
|
-
* All requests are proxied through the Vite dev server to avoid CORS.
|
|
11
|
-
* See vite.config.ts proxy rules:
|
|
12
|
-
* /sf-oauth/* → myDomainUrl (for OAuth token)
|
|
13
|
-
* /sf-agent/* → agentApiBaseUrl (for Agent API calls)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export const AGENT_API_CONFIG = {
|
|
17
|
-
myDomainUrl: "https://tdx26-keynote-org-1com.my.salesforce.com",
|
|
18
|
-
|
|
19
|
-
clientId:
|
|
20
|
-
"3MVG9Gm6vbdjgMWSOIAuIN3VSB5Rju6PgYQ5rl1yH3bVTTg9E2as4.C61Q0cyT.zqv2vUWNaxrm.A7SW5o3t7",
|
|
21
|
-
clientSecret:
|
|
22
|
-
"9ADF795A183A6B074A2E4B4CB1748B8DF7090C74191AF1C190213B512A733E03",
|
|
23
|
-
|
|
24
|
-
agentId: "0Xxa5000000rQlxCAE",
|
|
25
|
-
|
|
26
|
-
agentApiBaseUrl: "https://api.salesforce.com",
|
|
27
|
-
|
|
28
|
-
bypassUser: true,
|
|
29
|
-
|
|
30
|
-
demoTraveler: {
|
|
31
|
-
contactId: "003a500000mj4TlAAI",
|
|
32
|
-
email: "sarah.chen@arcline.ai",
|
|
33
|
-
firstName: "Sarah",
|
|
34
|
-
lastName: "Chen",
|
|
35
|
-
},
|
|
36
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
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 "../../api/objectSearchService";
|
|
10
|
-
import type {
|
|
11
|
-
SearchAccountsQuery,
|
|
12
|
-
SearchAccountsQueryVariables,
|
|
13
|
-
DistinctAccountIndustriesQuery,
|
|
14
|
-
DistinctAccountTypesQuery,
|
|
15
|
-
} from "../../../../api/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
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
package/brands/engine/app/features/object-search/__examples__/api/query/getAccountDetail.graphql
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
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
|
-
}
|
package/brands/engine/app/features/object-search/__examples__/api/query/searchAccounts.graphql
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
}
|