@salesforce/webapp-template-app-react-sample-b2x-experimental 1.112.7 → 1.112.9
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/dist/CHANGELOG.md +19 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/package.json +6 -5
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/graphql-operations-types.ts +12058 -214
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/graphqlClient.ts +18 -15
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/{propertyListingGraphQL.ts → properties/propertyListingGraphQL.ts} +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/appLayout.tsx +4 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{TopBar.tsx → layout/TopBar.tsx} +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{MaintenanceRequestList.tsx → maintenanceRequests/MaintenanceRequestList.tsx} +4 -4
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{MaintenanceRequestListItem.tsx → maintenanceRequests/MaintenanceRequestListItem.tsx} +3 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/maintenanceRequests/MaintenanceSummaryDetailsModal.tsx +87 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{PropertyListingCard.tsx → properties/PropertyListingCard.tsx} +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/{features/global-search/components/search/SearchPagination.tsx → components/properties/PropertyListingSearchPagination.tsx} +20 -28
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/constants/propertyListing.ts +4 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/api/accountSearchService.ts +46 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/api/query/distinctAccountIndustries.graphql +19 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/api/query/distinctAccountTypes.graphql +19 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/api/query/getAccountDetail.graphql +121 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/api/query/searchAccounts.graphql +51 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/pages/AccountObjectDetailPage.tsx +357 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/pages/AccountSearch.tsx +303 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/__examples__/pages/Home.tsx +34 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/api/objectSearchService.ts +84 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/ActiveFilters.tsx +89 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/FilterContext.tsx +73 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/ObjectBreadcrumb.tsx +66 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/PaginationControls.tsx +109 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/SearchBar.tsx +41 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/SortControl.tsx +143 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/BooleanFilter.tsx +74 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/DateFilter.tsx +121 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/DateRangeFilter.tsx +69 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/MultiSelectFilter.tsx +98 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/NumericRangeFilter.tsx +85 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/SearchFilter.tsx +37 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/SelectFilter.tsx +93 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/components/filters/TextFilter.tsx +74 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/hooks/useAsyncData.ts +54 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/hooks/useCachedAsyncData.ts +184 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/hooks/useObjectSearchParams.ts +247 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/utils/debounce.ts +22 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/utils/fieldUtils.ts +29 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/utils/filterUtils.ts +372 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/object-search/utils/sortUtils.ts +38 -0
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/useMaintenanceRequests.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/usePropertyAddresses.ts +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/usePropertyDetail.ts +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/usePropertyListingAmenities.ts +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/usePropertyListingSearch.ts +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/usePropertyMapMarkers.ts +3 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/usePropertyPrimaryImages.ts +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Application.tsx +3 -3
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Dashboard.tsx +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Home.tsx +4 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Maintenance.tsx +2 -2
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/PropertyDetails.tsx +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/PropertySearch.tsx +12 -10
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/routes.tsx +6 -18
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/utils/propertyListingPaginationUtils.ts +18 -0
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/dist/scripts/graphql-search.sh +69 -17
- package/package.json +1 -1
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/MaintenanceDetailsModal.tsx +0 -128
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/api/objectDetailService.ts +0 -102
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/api/objectInfoGraphQLService.ts +0 -137
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/api/objectInfoService.ts +0 -95
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/api/recordListGraphQLService.ts +0 -364
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/DetailFields.tsx +0 -55
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/DetailForm.tsx +0 -146
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/DetailHeader.tsx +0 -34
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/DetailLayoutSections.tsx +0 -80
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/Section.tsx +0 -108
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/SectionRow.tsx +0 -20
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/UiApiDetailForm.tsx +0 -140
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/formatted/FieldValueDisplay.tsx +0 -73
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/formatted/FormattedAddress.tsx +0 -29
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/formatted/FormattedEmail.tsx +0 -17
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/formatted/FormattedPhone.tsx +0 -24
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/formatted/FormattedText.tsx +0 -11
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/detail/formatted/FormattedUrl.tsx +0 -29
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/filters/FilterField.tsx +0 -54
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/filters/FilterInput.tsx +0 -55
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/filters/FilterSelect.tsx +0 -72
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/filters/FiltersPanel.tsx +0 -380
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/forms/filters-form.tsx +0 -114
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/forms/submit-button.tsx +0 -47
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/search/GlobalSearchInput.tsx +0 -114
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/search/ResultCardFields.tsx +0 -71
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/search/SearchHeader.tsx +0 -31
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/search/SearchResultCard.tsx +0 -138
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/search/SearchResultsPanel.tsx +0 -197
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/components/shared/LoadingFallback.tsx +0 -61
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/constants.ts +0 -39
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/filters/FilterInput.tsx +0 -55
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/filters/FilterSelect.tsx +0 -72
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/form.tsx +0 -209
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/useObjectInfoBatch.ts +0 -72
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/useObjectSearchData.ts +0 -174
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/useRecordDetailLayout.ts +0 -137
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/hooks/useRecordListGraphQL.ts +0 -135
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/pages/DetailPage.tsx +0 -109
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/pages/GlobalSearch.tsx +0 -235
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/filters/filters.ts +0 -121
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/filters/picklist.ts +0 -6
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/objectInfo/objectInfo.ts +0 -49
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/recordDetail/recordDetail.ts +0 -61
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/types/schema.d.ts +0 -200
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/apiUtils.ts +0 -59
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/cacheUtils.ts +0 -76
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/debounce.ts +0 -90
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/fieldUtils.ts +0 -354
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/fieldValueExtractor.ts +0 -67
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/filterUtils.ts +0 -32
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/formDataTransformUtils.ts +0 -260
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/formUtils.ts +0 -142
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/graphQLNodeFieldUtils.ts +0 -186
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/graphQLObjectInfoAdapter.ts +0 -77
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/graphQLRecordAdapter.ts +0 -90
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/layoutTransformUtils.ts +0 -236
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/linkUtils.ts +0 -14
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/paginationUtils.ts +0 -49
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/recordUtils.ts +0 -159
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/features/global-search/utils/sanitizationUtils.ts +0 -50
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/hooks/usePropertyListingPriceRange.ts +0 -64
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/index.ts +0 -120
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/About.tsx +0 -8
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/HelpCenter.tsx +0 -29
- package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/PropertyListings.tsx +0 -100
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/{applicationApi.ts → applications/applicationApi.ts} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/{maintenanceRequestApi.ts → maintenanceRequests/maintenanceRequestApi.ts} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/{propertyDetailGraphQL.ts → properties/propertyDetailGraphQL.ts} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{WeatherWidget.tsx → dashboard/WeatherWidget.tsx} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{NavMenu.tsx → layout/VerticalNav.tsx} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{MaintenanceRequestIcon.tsx → maintenanceRequests/MaintenanceRequestIcon.tsx} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{StatusBadge.tsx → maintenanceRequests/StatusBadge.tsx} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{PropertyMap.tsx → properties/PropertyMap.tsx} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/{PropertySearchFilters.tsx → properties/PropertySearchFilters.tsx} +0 -0
- /package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/{features/global-search/types/search → types}/searchResults.ts +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Type definitions and Zod schemas for Record Detail APIs:
|
|
5
|
-
* - Layout API (layout/{objectApiName}?layoutType=Full&mode=View&recordTypeId=...)
|
|
6
|
-
* - Record API (records/{recordId}?optionalFields=...)
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const LayoutComponentSchema = z.object({
|
|
10
|
-
apiName: z.string().nullable(),
|
|
11
|
-
behavior: z.string().optional(),
|
|
12
|
-
componentType: z.enum(["Field", "CustomLink", "EmptySpace"]),
|
|
13
|
-
customLinkUrl: z.string().optional(),
|
|
14
|
-
label: z.string().optional(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export type LayoutComponent = z.infer<typeof LayoutComponentSchema>;
|
|
18
|
-
|
|
19
|
-
const LayoutItemSchema = z.object({
|
|
20
|
-
editableForNew: z.boolean(),
|
|
21
|
-
editableForUpdate: z.boolean(),
|
|
22
|
-
label: z.string(),
|
|
23
|
-
layoutComponents: z.array(LayoutComponentSchema),
|
|
24
|
-
lookupIdApiName: z.string().nullable(),
|
|
25
|
-
required: z.boolean(),
|
|
26
|
-
sortable: z.boolean(),
|
|
27
|
-
uiBehavior: z.string().nullable(),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export type LayoutItem = z.infer<typeof LayoutItemSchema>;
|
|
31
|
-
|
|
32
|
-
const LayoutRowSchema = z.object({
|
|
33
|
-
layoutItems: z.array(LayoutItemSchema),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const LayoutSectionSchema = z.object({
|
|
37
|
-
collapsible: z.boolean(),
|
|
38
|
-
columns: z.number(),
|
|
39
|
-
heading: z.string(),
|
|
40
|
-
id: z.string(),
|
|
41
|
-
layoutRows: z.array(LayoutRowSchema),
|
|
42
|
-
rows: z.number(),
|
|
43
|
-
tabOrder: z.string(),
|
|
44
|
-
useHeading: z.boolean(),
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export type LayoutSection = z.infer<typeof LayoutSectionSchema>;
|
|
48
|
-
|
|
49
|
-
export const LayoutResponseSchema = z.object({
|
|
50
|
-
eTag: z.string(),
|
|
51
|
-
id: z.string(),
|
|
52
|
-
layoutType: z.string(),
|
|
53
|
-
mode: z.string(),
|
|
54
|
-
objectApiName: z.string(),
|
|
55
|
-
recordTypeId: z.string(),
|
|
56
|
-
saveOptions: z.array(z.unknown()).optional(),
|
|
57
|
-
sections: z.array(LayoutSectionSchema),
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
export type LayoutResponse = z.infer<typeof LayoutResponseSchema>;
|
|
61
|
-
export type LayoutRow = z.infer<typeof LayoutRowSchema>;
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
export type Maybe<T> = T | null;
|
|
2
|
-
export type InputMaybe<T> = Maybe<T>;
|
|
3
|
-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
|
4
|
-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
5
|
-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
6
|
-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = {
|
|
7
|
-
[_ in K]?: never;
|
|
8
|
-
};
|
|
9
|
-
export type Incremental<T> =
|
|
10
|
-
| T
|
|
11
|
-
| { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
12
|
-
/** All built-in and custom scalars, mapped to their actual values */
|
|
13
|
-
export type Scalars = {
|
|
14
|
-
ID: { input: string; output: string };
|
|
15
|
-
String: { input: string; output: string };
|
|
16
|
-
Boolean: { input: boolean; output: boolean };
|
|
17
|
-
Int: { input: number; output: number };
|
|
18
|
-
Float: { input: number; output: number };
|
|
19
|
-
Base64: { input: string; output: string };
|
|
20
|
-
/** An arbitrary precision signed decimal */
|
|
21
|
-
BigDecimal: { input: number | string; output: number };
|
|
22
|
-
/** An arbitrary precision signed integer */
|
|
23
|
-
BigInteger: { input: number; output: number };
|
|
24
|
-
/** An 8-bit signed integer */
|
|
25
|
-
Byte: { input: number; output: number };
|
|
26
|
-
/** A UTF-16 code unit; a character on Unicode's BMP */
|
|
27
|
-
Char: { input: number; output: number };
|
|
28
|
-
Currency: { input: number | string; output: number };
|
|
29
|
-
Date: { input: string; output: string };
|
|
30
|
-
DateTime: { input: string; output: string };
|
|
31
|
-
Double: { input: number | string; output: number };
|
|
32
|
-
Email: { input: string; output: string };
|
|
33
|
-
EncryptedString: { input: string; output: string };
|
|
34
|
-
/** Can be set to an ID or a Reference to the result of another mutation operation. */
|
|
35
|
-
IdOrRef: { input: string; output: string };
|
|
36
|
-
JSON: { input: string; output: string };
|
|
37
|
-
Latitude: { input: number | string; output: number };
|
|
38
|
-
/** A 64-bit signed integer */
|
|
39
|
-
Long: { input: number; output: number };
|
|
40
|
-
LongTextArea: { input: string; output: string };
|
|
41
|
-
Longitude: { input: number | string; output: number };
|
|
42
|
-
MultiPicklist: { input: string; output: string };
|
|
43
|
-
Percent: { input: number | string; output: number };
|
|
44
|
-
PhoneNumber: { input: string; output: string };
|
|
45
|
-
Picklist: { input: string; output: string };
|
|
46
|
-
RichTextArea: { input: string; output: string };
|
|
47
|
-
/** A 16-bit signed integer */
|
|
48
|
-
Short: { input: number; output: number };
|
|
49
|
-
TextArea: { input: string; output: string };
|
|
50
|
-
Time: { input: string; output: string };
|
|
51
|
-
Url: { input: string; output: string };
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export enum DataType {
|
|
55
|
-
Address = "ADDRESS",
|
|
56
|
-
Anytype = "ANYTYPE",
|
|
57
|
-
Base64 = "BASE64",
|
|
58
|
-
Boolean = "BOOLEAN",
|
|
59
|
-
Combobox = "COMBOBOX",
|
|
60
|
-
Complexvalue = "COMPLEXVALUE",
|
|
61
|
-
Currency = "CURRENCY",
|
|
62
|
-
Date = "DATE",
|
|
63
|
-
Datetime = "DATETIME",
|
|
64
|
-
Double = "DOUBLE",
|
|
65
|
-
Email = "EMAIL",
|
|
66
|
-
Encryptedstring = "ENCRYPTEDSTRING",
|
|
67
|
-
Int = "INT",
|
|
68
|
-
Json = "JSON",
|
|
69
|
-
Junctionidlist = "JUNCTIONIDLIST",
|
|
70
|
-
Location = "LOCATION",
|
|
71
|
-
Long = "LONG",
|
|
72
|
-
Multipicklist = "MULTIPICKLIST",
|
|
73
|
-
Percent = "PERCENT",
|
|
74
|
-
Phone = "PHONE",
|
|
75
|
-
Picklist = "PICKLIST",
|
|
76
|
-
Reference = "REFERENCE",
|
|
77
|
-
String = "STRING",
|
|
78
|
-
Textarea = "TEXTAREA",
|
|
79
|
-
Time = "TIME",
|
|
80
|
-
Url = "URL",
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export enum FieldExtraTypeInfo {
|
|
84
|
-
ExternalLookup = "EXTERNAL_LOOKUP",
|
|
85
|
-
ImageUrl = "IMAGE_URL",
|
|
86
|
-
IndirectLookup = "INDIRECT_LOOKUP",
|
|
87
|
-
Personname = "PERSONNAME",
|
|
88
|
-
Plaintextarea = "PLAINTEXTAREA",
|
|
89
|
-
Richtextarea = "RICHTEXTAREA",
|
|
90
|
-
SwitchablePersonname = "SWITCHABLE_PERSONNAME",
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** Input for ObjectInfo and PickValues */
|
|
94
|
-
export type ObjectInfoInput = {
|
|
95
|
-
apiName: Scalars["String"]["input"];
|
|
96
|
-
fieldNames?: InputMaybe<Array<Scalars["String"]["input"]>>;
|
|
97
|
-
recordTypeIDs?: InputMaybe<Array<Scalars["ID"]["input"]>>;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export enum ResultOrder {
|
|
101
|
-
Asc = "ASC",
|
|
102
|
-
Desc = "DESC",
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export type GetObjectInfosQueryVariables = Exact<{
|
|
106
|
-
apiNames: Array<Scalars["String"]["input"]> | Scalars["String"]["input"];
|
|
107
|
-
}>;
|
|
108
|
-
|
|
109
|
-
export type GetObjectInfosQuery = {
|
|
110
|
-
uiapi: {
|
|
111
|
-
objectInfos?: Array<{
|
|
112
|
-
ApiName: string;
|
|
113
|
-
label?: string | null;
|
|
114
|
-
labelPlural?: string | null;
|
|
115
|
-
nameFields: Array<string | null>;
|
|
116
|
-
defaultRecordTypeId?: string | null;
|
|
117
|
-
keyPrefix?: string | null;
|
|
118
|
-
layoutable: boolean;
|
|
119
|
-
queryable: boolean;
|
|
120
|
-
searchable: boolean;
|
|
121
|
-
updateable: boolean;
|
|
122
|
-
deletable: boolean;
|
|
123
|
-
createable: boolean;
|
|
124
|
-
custom: boolean;
|
|
125
|
-
mruEnabled: boolean;
|
|
126
|
-
feedEnabled: boolean;
|
|
127
|
-
fields: Array<
|
|
128
|
-
| {
|
|
129
|
-
ApiName: string;
|
|
130
|
-
label?: string | null;
|
|
131
|
-
dataType?: DataType | null;
|
|
132
|
-
relationshipName?: string | null;
|
|
133
|
-
reference: boolean;
|
|
134
|
-
compound: boolean;
|
|
135
|
-
compoundFieldName?: string | null;
|
|
136
|
-
compoundComponentName?: string | null;
|
|
137
|
-
controllingFields: Array<string | null>;
|
|
138
|
-
controllerName?: string | null;
|
|
139
|
-
referenceToInfos: Array<{ ApiName: string; nameFields: Array<string | null> } | null>;
|
|
140
|
-
}
|
|
141
|
-
| {
|
|
142
|
-
ApiName: string;
|
|
143
|
-
label?: string | null;
|
|
144
|
-
dataType?: DataType | null;
|
|
145
|
-
relationshipName?: string | null;
|
|
146
|
-
reference: boolean;
|
|
147
|
-
compound: boolean;
|
|
148
|
-
compoundFieldName?: string | null;
|
|
149
|
-
compoundComponentName?: string | null;
|
|
150
|
-
controllingFields: Array<string | null>;
|
|
151
|
-
controllerName?: string | null;
|
|
152
|
-
referenceToInfos: Array<{ ApiName: string; nameFields: Array<string | null> } | null>;
|
|
153
|
-
}
|
|
154
|
-
| null
|
|
155
|
-
>;
|
|
156
|
-
recordTypeInfos: Array<{
|
|
157
|
-
recordTypeId?: string | null;
|
|
158
|
-
name?: string | null;
|
|
159
|
-
master: boolean;
|
|
160
|
-
available: boolean;
|
|
161
|
-
defaultRecordTypeMapping: boolean;
|
|
162
|
-
} | null>;
|
|
163
|
-
themeInfo?: { color?: string | null; iconUrl?: string | null } | null;
|
|
164
|
-
childRelationships: Array<{
|
|
165
|
-
relationshipName?: string | null;
|
|
166
|
-
fieldName?: string | null;
|
|
167
|
-
childObjectApiName: string;
|
|
168
|
-
} | null>;
|
|
169
|
-
dependentFields: Array<{ controllingField: string } | null>;
|
|
170
|
-
} | null> | null;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export type GetPicklistValuesQueryVariables = Exact<{
|
|
175
|
-
objectInfoInputs: Array<ObjectInfoInput> | ObjectInfoInput;
|
|
176
|
-
}>;
|
|
177
|
-
|
|
178
|
-
export type GetPicklistValuesQuery = {
|
|
179
|
-
uiapi: {
|
|
180
|
-
objectInfos?: Array<{
|
|
181
|
-
ApiName: string;
|
|
182
|
-
fields: Array<
|
|
183
|
-
| {
|
|
184
|
-
ApiName: string;
|
|
185
|
-
picklistValuesByRecordTypeIDs?: Array<{
|
|
186
|
-
recordTypeID: string;
|
|
187
|
-
defaultValue?: { value?: string | null } | null;
|
|
188
|
-
picklistValues?: Array<{
|
|
189
|
-
label?: string | null;
|
|
190
|
-
value?: string | null;
|
|
191
|
-
validFor?: Array<number | null> | null;
|
|
192
|
-
}> | null;
|
|
193
|
-
} | null> | null;
|
|
194
|
-
}
|
|
195
|
-
| { ApiName: string }
|
|
196
|
-
| null
|
|
197
|
-
>;
|
|
198
|
-
} | null> | null;
|
|
199
|
-
};
|
|
200
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Utilities
|
|
3
|
-
*
|
|
4
|
-
* Generic utility functions for API requests, validation, and URL handling.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { ZodSchema } from "zod";
|
|
8
|
-
|
|
9
|
-
export interface FetchAndValidateOptions<T> {
|
|
10
|
-
schema: ZodSchema<T>;
|
|
11
|
-
errorContext: string;
|
|
12
|
-
extractData?: (data: unknown) => unknown;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export async function fetchAndValidate<T>(
|
|
16
|
-
fetchFn: () => Promise<Response>,
|
|
17
|
-
options: FetchAndValidateOptions<T>,
|
|
18
|
-
): Promise<T> {
|
|
19
|
-
const { schema, errorContext, extractData } = options;
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
const response = await fetchFn();
|
|
23
|
-
|
|
24
|
-
if (!response.ok) {
|
|
25
|
-
throw new Error(`Failed to fetch ${errorContext}: ${response.status} ${response.statusText}`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const data = await response.json();
|
|
29
|
-
const dataToValidate = extractData ? extractData(data) : data;
|
|
30
|
-
const validationResult = schema.safeParse(dataToValidate);
|
|
31
|
-
|
|
32
|
-
if (!validationResult.success) {
|
|
33
|
-
throw new Error(`Invalid ${errorContext} response format: ${validationResult.error.message}`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return validationResult.data;
|
|
37
|
-
} catch (error) {
|
|
38
|
-
if (error instanceof Error && error.name === "ZodError") {
|
|
39
|
-
throw new Error(`Invalid ${errorContext} response format: ${error.message}`);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
error instanceof Error &&
|
|
44
|
-
(error.message.includes("Failed to fetch") || error.message.includes("Invalid"))
|
|
45
|
-
) {
|
|
46
|
-
throw error;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
throw new Error(
|
|
50
|
-
`Error fetching ${errorContext}: ${
|
|
51
|
-
error instanceof Error ? error.message : (error?.toString() ?? "Unknown error")
|
|
52
|
-
}`,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function safeEncodePath(segment: string): string {
|
|
58
|
-
return encodeURIComponent(segment);
|
|
59
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cache Utilities
|
|
3
|
-
*
|
|
4
|
-
* Utility functions for creating deterministic cache keys and managing cache operations.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { FilterCriteria } from "../types/filters/filters";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Creates a deterministic cache key from filter criteria array.
|
|
11
|
-
* Sorts filters and their values to ensure consistent keys regardless of input order.
|
|
12
|
-
*
|
|
13
|
-
* @param filters - Array of filter criteria (FilterCriteria[])
|
|
14
|
-
* @returns Deterministic string key for caching
|
|
15
|
-
*
|
|
16
|
-
* @remarks
|
|
17
|
-
* - Sorts filters by objectApiName, then fieldPath, then operator
|
|
18
|
-
* - Sorts values within each filter to ensure consistency
|
|
19
|
-
* - Handles null/undefined values safely
|
|
20
|
-
* - Prevents cache key collisions from different object ordering
|
|
21
|
-
*
|
|
22
|
-
* Why is sorting required?
|
|
23
|
-
* If a user filters by "Name" then "Date", the array is [Name, Date].
|
|
24
|
-
* If they filter by "Date" then "Name", the array is [Date, Name].
|
|
25
|
-
* - Without sorting, these would generate different cache keys ("Name-Date" vs "Date-Name"),
|
|
26
|
-
* causing the app to re-fetch data it actually already has. Sorting ensures that
|
|
27
|
-
* the order of user clicks doesn't invalidate the cache.
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
* @example
|
|
31
|
-
* ```tsx
|
|
32
|
-
* const cacheKey = createFiltersKey(filters);
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export function createFiltersKey(filters: FilterCriteria[]): string {
|
|
36
|
-
if (!Array.isArray(filters) || filters.length === 0) {
|
|
37
|
-
return "[]";
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const normalized = filters
|
|
41
|
-
.map((filter) => {
|
|
42
|
-
if (!filter || typeof filter !== "object") {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const f = filter as FilterCriteria;
|
|
47
|
-
|
|
48
|
-
const sortedValues =
|
|
49
|
-
Array.isArray(f.values) && f.values.length > 0
|
|
50
|
-
? [...f.values].sort((a, b) => {
|
|
51
|
-
const aStr = a.toString();
|
|
52
|
-
const bStr = b.toString();
|
|
53
|
-
return aStr.localeCompare(bStr);
|
|
54
|
-
})
|
|
55
|
-
: [];
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
objectApiName: f.objectApiName ?? "",
|
|
59
|
-
fieldPath: f.fieldPath ?? "",
|
|
60
|
-
operator: f.operator ?? "",
|
|
61
|
-
values: sortedValues,
|
|
62
|
-
};
|
|
63
|
-
})
|
|
64
|
-
.filter((f): f is NonNullable<typeof f> => f !== null)
|
|
65
|
-
.sort((a, b) => {
|
|
66
|
-
const objectCompare = a.objectApiName.localeCompare(b.objectApiName);
|
|
67
|
-
if (objectCompare !== 0) return objectCompare;
|
|
68
|
-
|
|
69
|
-
const fieldCompare = a.fieldPath.localeCompare(b.fieldPath);
|
|
70
|
-
if (fieldCompare !== 0) return fieldCompare;
|
|
71
|
-
|
|
72
|
-
return a.operator.localeCompare(b.operator);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
return JSON.stringify(normalized);
|
|
76
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debounce Utility
|
|
3
|
-
*
|
|
4
|
-
* Provides debouncing functionality for functions with React-safe cleanup methods.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Interface for the debounced function, exposing utility methods.
|
|
9
|
-
*/
|
|
10
|
-
export interface DebouncedFunc<T extends (...args: any[]) => any> {
|
|
11
|
-
/**
|
|
12
|
-
* Call the original function, but delayed.
|
|
13
|
-
*/
|
|
14
|
-
(...args: Parameters<T>): void;
|
|
15
|
-
/**
|
|
16
|
-
* Cancel any pending execution.
|
|
17
|
-
*/
|
|
18
|
-
cancel: () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Immediately execute the pending function (if any) and clear the timer.
|
|
21
|
-
* Useful for saving data before unmounting.
|
|
22
|
-
*/
|
|
23
|
-
flush: () => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Creates a debounced function that delays invoking func until after wait milliseconds
|
|
28
|
-
* have elapsed since the last time the debounced function was invoked.
|
|
29
|
-
*
|
|
30
|
-
* @param func - The function to debounce
|
|
31
|
-
* @param wait - The number of milliseconds to delay
|
|
32
|
-
* @returns A debounced function with .cancel() and .flush() methods
|
|
33
|
-
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* - Includes .cancel() method for cleanup in React useEffects
|
|
36
|
-
* - Includes .flush() method to immediately execute pending calls
|
|
37
|
-
* - Preserves function context (this binding)
|
|
38
|
-
* - Type-safe with TypeScript generics
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```tsx
|
|
42
|
-
* const debouncedSearch = debounce((query: string) => {
|
|
43
|
-
* performSearch(query);
|
|
44
|
-
* }, 300);
|
|
45
|
-
*
|
|
46
|
-
* // In useEffect cleanup
|
|
47
|
-
* return () => debouncedSearch.cancel();
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export function debounce<T extends (...args: any[]) => any>(
|
|
51
|
-
func: T,
|
|
52
|
-
wait: number,
|
|
53
|
-
): DebouncedFunc<T> {
|
|
54
|
-
// 1. Type Safety: Use a generic return type compatible with Browser and Node
|
|
55
|
-
let timeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
56
|
-
let lastContext: ThisParameterType<T> | null = null;
|
|
57
|
-
let lastArgs: Parameters<T> | null = null;
|
|
58
|
-
function debounced(this: ThisParameterType<T>, ...args: Parameters<T>) {
|
|
59
|
-
// 2. Context Safety: Capture 'this' to support class methods
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias -- required for debouncing class methods
|
|
61
|
-
lastContext = this;
|
|
62
|
-
lastArgs = args;
|
|
63
|
-
if (timeoutId) {
|
|
64
|
-
clearTimeout(timeoutId);
|
|
65
|
-
}
|
|
66
|
-
timeoutId = setTimeout(() => {
|
|
67
|
-
func.apply(lastContext, lastArgs as Parameters<T>);
|
|
68
|
-
timeoutId = null;
|
|
69
|
-
lastArgs = null;
|
|
70
|
-
lastContext = null;
|
|
71
|
-
}, wait);
|
|
72
|
-
}
|
|
73
|
-
// 3. React Safety: Add a cancel method to clear pending timers
|
|
74
|
-
debounced.cancel = () => {
|
|
75
|
-
if (timeoutId) {
|
|
76
|
-
clearTimeout(timeoutId);
|
|
77
|
-
timeoutId = null;
|
|
78
|
-
}
|
|
79
|
-
lastArgs = null;
|
|
80
|
-
lastContext = null;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
debounced.flush = () => {
|
|
84
|
-
if (timeoutId && lastArgs) {
|
|
85
|
-
func.apply(lastContext, lastArgs);
|
|
86
|
-
debounced.cancel();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
return debounced;
|
|
90
|
-
}
|