@seamapi/react 1.65.0 → 2.0.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.
Files changed (75) hide show
  1. package/README.md +1 -1
  2. package/dist/elements.js +6760 -6689
  3. package/dist/elements.js.map +1 -1
  4. package/dist/index.css +15 -15
  5. package/dist/index.min.css +1 -1
  6. package/dist/index.min.css.map +1 -1
  7. package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +1 -5
  8. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +2 -2
  9. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
  10. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +2 -2
  11. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
  12. package/lib/seam/components/DeviceTable/DeviceTable.d.ts +1 -5
  13. package/lib/seam/components/DeviceTable/DeviceTable.js +2 -2
  14. package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
  15. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +3 -3
  16. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +11 -17
  17. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
  18. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +1 -1
  19. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js +1 -7
  20. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +1 -1
  21. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +3 -3
  22. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +12 -31
  23. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -1
  24. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.d.ts +2 -2
  25. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.js +2 -4
  26. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.js.map +1 -1
  27. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +8 -0
  28. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js +35 -0
  29. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js.map +1 -0
  30. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +2 -1
  31. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +10 -6
  32. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -1
  33. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +3 -7
  34. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +4 -5
  35. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -1
  36. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +5 -5
  37. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +16 -17
  38. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -1
  39. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.d.ts +8 -0
  40. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js +37 -0
  41. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js.map +1 -0
  42. package/lib/version.d.ts +1 -1
  43. package/lib/version.js +1 -1
  44. package/lib/version.js.map +1 -1
  45. package/package.json +3 -3
  46. package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +2 -8
  47. package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +2 -2
  48. package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +2 -8
  49. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +23 -29
  50. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +3 -9
  51. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +22 -41
  52. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterResultRow.tsx +8 -12
  53. package/src/lib/seam/components/SupportedDeviceTable/{SupportedDeviceBrandSection.tsx → SupportedDeviceManufacturerSection.tsx} +19 -26
  54. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +20 -11
  55. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +2 -3
  56. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +10 -17
  57. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +31 -20
  58. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.ts +54 -0
  59. package/src/lib/version.ts +1 -1
  60. package/src/styles/_supported-device-table.scss +4 -4
  61. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.d.ts +0 -8
  62. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.js +0 -42
  63. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.js.map +0 -1
  64. package/lib/seam/components/SupportedDeviceTable/use-device-provider.d.ts +0 -2
  65. package/lib/seam/components/SupportedDeviceTable/use-device-provider.js +0 -13
  66. package/lib/seam/components/SupportedDeviceTable/use-device-provider.js.map +0 -1
  67. package/lib/seam/device-models/use-device-models.d.ts +0 -5
  68. package/lib/seam/device-models/use-device-models.js +0 -19
  69. package/lib/seam/device-models/use-device-models.js.map +0 -1
  70. package/lib/strings.d.ts +0 -1
  71. package/lib/strings.js +0 -4
  72. package/lib/strings.js.map +0 -1
  73. package/src/lib/seam/components/SupportedDeviceTable/use-device-provider.ts +0 -16
  74. package/src/lib/seam/device-models/use-device-models.ts +0 -39
  75. package/src/lib/strings.ts +0 -3
@@ -13,12 +13,8 @@ import type { DeviceModelFilters } from 'lib/seam/components/SupportedDeviceTabl
13
13
 
14
14
  export interface SupportedDeviceTableProps extends CommonProps {
15
15
  disableFilter?: boolean
16
- /**
17
- * @deprecated Use disableFilter.
18
- */
19
- cannotFilter?: boolean
20
- brands?: string[] | null
21
- excludedBrands?: string[]
16
+ manufacturers?: string[] | null
17
+ excludedManufacturers?: string[]
22
18
  }
23
19
 
24
20
  export const NestedSupportedDeviceTable =
@@ -26,9 +22,8 @@ export const NestedSupportedDeviceTable =
26
22
 
27
23
  export function SupportedDeviceTable({
28
24
  disableFilter = false,
29
- cannotFilter,
30
- brands = null,
31
- excludedBrands = [],
25
+ manufacturers = null,
26
+ excludedManufacturers = [],
32
27
  className,
33
28
  }: SupportedDeviceTableProps = {}): JSX.Element {
34
29
  useComponentTelemetry('SupportedDeviceTable')
@@ -36,11 +31,9 @@ export function SupportedDeviceTable({
36
31
  const [filterValue, setFilterValue] = useState('')
37
32
  const [filters, setFilters] = useState<DeviceModelFilters>({
38
33
  supportedOnly: true,
39
- brand: null,
34
+ manufacturer: null,
40
35
  })
41
36
 
42
- const hideFilter = cannotFilter ?? disableFilter
43
-
44
37
  return (
45
38
  <div
46
39
  className={classNames(
@@ -48,14 +41,14 @@ export function SupportedDeviceTable({
48
41
  className
49
42
  )}
50
43
  >
51
- {!hideFilter && (
44
+ {!disableFilter && (
52
45
  <SupportedDeviceFilterArea
53
46
  filterValue={filterValue}
54
47
  setFilterValue={setFilterValue}
55
48
  filters={filters}
56
49
  setFilters={setFilters}
57
- brands={brands}
58
- excludedBrands={excludedBrands}
50
+ manufacturers={manufacturers}
51
+ excludedManufacturers={excludedManufacturers}
59
52
  />
60
53
  )}
61
54
  <SupportedDeviceContent
@@ -64,8 +57,8 @@ export function SupportedDeviceTable({
64
57
  }}
65
58
  filterValue={filterValue}
66
59
  filters={filters}
67
- brands={brands}
68
- excludedBrands={excludedBrands}
60
+ manufacturers={manufacturers}
61
+ excludedManufacturers={excludedManufacturers}
69
62
  />
70
63
  </div>
71
64
  )
@@ -1,24 +1,27 @@
1
1
  import {
2
2
  useDeviceModels,
3
3
  type UseDeviceModelsParams,
4
- } from 'lib/seam/device-models/use-device-models.js'
4
+ } from 'lib/seam/components/SupportedDeviceTable/use-device-models.js'
5
+
6
+ import { useFilteredManufacturers } from './use-filtered-manufacturers.js'
5
7
 
6
8
  export interface DeviceModelFilters {
7
9
  supportedOnly: boolean
8
- brand: string | null
10
+ manufacturer: string | null
9
11
  }
10
12
 
11
13
  export const useFilteredDeviceModels = ({
12
14
  filterValue,
13
15
  filters,
14
- brands,
15
- excludedBrands,
16
+ ...manufacturersParams
16
17
  }: {
17
18
  filterValue: string
18
19
  filters: DeviceModelFilters
19
- brands: string[] | null
20
- excludedBrands: string[]
20
+ manufacturers: string[] | null
21
+ excludedManufacturers: string[]
21
22
  }): ReturnType<typeof useDeviceModels> => {
23
+ const { manufacturers } = useFilteredManufacturers(manufacturersParams)
24
+
22
25
  const params: UseDeviceModelsParams = {}
23
26
 
24
27
  if (filterValue.trim() !== '') {
@@ -26,26 +29,34 @@ export const useFilteredDeviceModels = ({
26
29
  }
27
30
 
28
31
  if (filters.supportedOnly) {
29
- params.support_level = 'live'
32
+ params.integration_status = 'stable'
33
+ }
34
+
35
+ if (filters.manufacturer !== null) {
36
+ const manufacturer = manufacturers?.find(
37
+ (manufacturer) => manufacturer.display_name === filters.manufacturer
38
+ )
39
+
40
+ if (manufacturer != null) {
41
+ params.manufacturer_id = manufacturer.manufacturer_id
42
+ }
30
43
  }
31
44
 
32
- if (filters.brand !== null) {
33
- params.brand = filters.brand
45
+ if (filters.manufacturer == null && manufacturers != null) {
46
+ params.manufacturer_ids = manufacturers.map((m) => m.manufacturer_id)
34
47
  }
35
48
 
36
- const query = useDeviceModels(params)
49
+ const { deviceModels, ...query } = useDeviceModels(params)
37
50
 
38
- // UPSTREAM: The API does not have a brands or excludedBrands query parameter,
39
- // so selected brands are filtered here.
40
51
  return {
41
52
  ...query,
42
- deviceModels: query.deviceModels
43
- ?.filter(({ brand }) => {
44
- if (brands === null) return true
45
- return brands.includes(brand)
46
- })
47
- .filter(({ brand }) => {
48
- return !excludedBrands.includes(brand)
49
- }),
53
+ deviceModels: deviceModels?.filter(
54
+ (deviceModel) =>
55
+ manufacturers?.some(
56
+ (manufacturer) =>
57
+ deviceModel.manufacturer.manufacturer_id ===
58
+ manufacturer.manufacturer_id
59
+ )
60
+ ),
50
61
  }
51
62
  }
@@ -0,0 +1,54 @@
1
+ import { useManufacturers } from 'lib/seam/components/SupportedDeviceTable/use-manufacturers.js'
2
+
3
+ interface Params {
4
+ manufacturers: string[] | null
5
+ excludedManufacturers: string[]
6
+ }
7
+ export const useFilteredManufacturers = (
8
+ params: Params
9
+ ): ReturnType<typeof useManufacturers> => {
10
+ return useManufacturers({
11
+ liqe_query: createLiqeQuery(params),
12
+ })
13
+ }
14
+
15
+ export const createLiqeQuery = ({
16
+ manufacturers,
17
+ excludedManufacturers,
18
+ }: Params): string | undefined => {
19
+ if (
20
+ (manufacturers?.some(isInvalidInput) ?? false) ||
21
+ excludedManufacturers.some(isInvalidInput)
22
+ ) {
23
+ return undefined
24
+ }
25
+
26
+ const excludedManufacturersClause = `NOT (${excludedManufacturers
27
+ .map(manufacturerToMatcher)
28
+ .join(' OR ')})`
29
+
30
+ if (manufacturers == null) {
31
+ if (excludedManufacturers.length === 0) return undefined
32
+ return excludedManufacturersClause
33
+ }
34
+
35
+ if (manufacturers.length === 0) {
36
+ return 'manufacturer_id:none'
37
+ }
38
+
39
+ const includedManufacturersClause = `(${manufacturers
40
+ .map(manufacturerToMatcher)
41
+ .join(' OR ')})`
42
+
43
+ if (excludedManufacturers.length === 0) return includedManufacturersClause
44
+
45
+ return `${includedManufacturersClause} AND ${excludedManufacturersClause}`
46
+ }
47
+
48
+ const manufacturerToMatcher = (value: string): string => {
49
+ const [manufacturer, uuid] = value.split('=')
50
+ if (uuid != null) return `manufacturer_id:"${uuid}"`
51
+ return `display_name:"${manufacturer}"`
52
+ }
53
+
54
+ const isInvalidInput = (value: string): boolean => value.includes('"')
@@ -1,3 +1,3 @@
1
- const seamapiReactVersion = '1.65.0'
1
+ const seamapiReactVersion = '2.0.0'
2
2
 
3
3
  export default seamapiReactVersion
@@ -96,7 +96,7 @@ $row-padding: 8px;
96
96
  }
97
97
  }
98
98
 
99
- .seam-brand-section {
99
+ .seam-manufacturer-section {
100
100
  margin-bottom: 32px;
101
101
  position: relative;
102
102
 
@@ -105,7 +105,7 @@ $row-padding: 8px;
105
105
  align-items: center;
106
106
  height: 64px;
107
107
 
108
- .seam-brand-image {
108
+ .seam-manufacturer-image {
109
109
  width: 48px;
110
110
  height: 48px;
111
111
  padding: 0 8px;
@@ -113,7 +113,7 @@ $row-padding: 8px;
113
113
  margin-right: 8px;
114
114
  }
115
115
 
116
- .seam-brand-name {
116
+ .seam-manufacturer-name {
117
117
  font-size: 21px;
118
118
  line-height: 132%;
119
119
  flex: 1;
@@ -254,7 +254,7 @@ $row-padding: 8px;
254
254
  display: flex;
255
255
  align-items: center;
256
256
 
257
- .seam-brand-image {
257
+ .seam-manufacturer-image {
258
258
  width: 32px;
259
259
  margin-right: 4px;
260
260
  }
@@ -1,8 +0,0 @@
1
- /// <reference types="react" resolution-mode="require"/>
2
- import type { DeviceModel } from 'seamapi';
3
- interface SupportedDeviceBrandSectionProps {
4
- brand: string;
5
- deviceModels: DeviceModel[];
6
- }
7
- export declare function SupportedDeviceBrandSection({ brand, deviceModels, }: SupportedDeviceBrandSectionProps): JSX.Element | null;
8
- export {};
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from 'classnames';
3
- import { ChevronRightIcon } from '../../../../lib/icons/ChevronRight.js';
4
- import { HiddenDevicesOverlay } from '../../../../lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js';
5
- import { ShowAllDevicesButton } from '../../../../lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js';
6
- import { SupportedDeviceRow } from '../../../../lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js';
7
- import { useDeviceProvider } from '../../../../lib/seam/components/SupportedDeviceTable/use-device-provider.js';
8
- import { useToggle } from '../../../../lib/ui/use-toggle.js';
9
- /**
10
- * How many device models required before we collapse
11
- * the list, and require the user to click to
12
- * view all.
13
- */
14
- const maxDevicesBeforeCollapsing = 3;
15
- export function SupportedDeviceBrandSection({ brand, deviceModels, }) {
16
- const deviceProvider = useDeviceProvider(brand);
17
- const [expanded, toggleExpand] = useToggle();
18
- const canExpand = deviceModels.length > maxDevicesBeforeCollapsing;
19
- const visibleDevices = !canExpand || expanded
20
- ? deviceModels
21
- : deviceModels.filter((_deviceModel, index) => index < maxDevicesBeforeCollapsing);
22
- const handleHeaderClick = () => {
23
- if (!canExpand) {
24
- return;
25
- }
26
- toggleExpand();
27
- };
28
- return (_jsxs("div", { className: classNames('seam-brand-section', {
29
- 'can-expand': canExpand,
30
- expanded,
31
- }), children: [_jsxs("div", { className: 'seam-header', onClick: handleHeaderClick, children: [_jsx("img", { src: deviceProvider.image_url, alt: brand, className: 'seam-brand-image' }), _jsxs("h5", { className: 'seam-brand-name', children: [deviceProvider.display_name, " ", t.devices] }), canExpand && _jsx(ChevronRightIcon, { className: 'chevron' })] }), _jsx("div", { className: 'seam-supported-device-table-content', children: visibleDevices.map((deviceModel, index) => (_jsx(SupportedDeviceRow, { deviceModel: deviceModel }, [
32
- deviceModel.main_category,
33
- deviceModel.brand,
34
- deviceModel.model_name,
35
- deviceModel.manufacturer_model_id,
36
- index,
37
- ].join(':')))) }), _jsx(ShowAllDevicesButton, { visible: canExpand, onClick: toggleExpand, expanded: expanded, totalDeviceCount: deviceModels.length }), _jsx(HiddenDevicesOverlay, { visible: canExpand && !expanded })] }));
38
- }
39
- const t = {
40
- devices: 'Devices',
41
- };
42
- //# sourceMappingURL=SupportedDeviceBrandSection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportedDeviceBrandSection.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/SupportedDeviceBrandSection.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAA;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAA;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,iEAAiE,CAAA;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAOpC,MAAM,UAAU,2BAA2B,CAAC,EAC1C,KAAK,EACL,YAAY,GACqB;IACjC,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA;IAE/C,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,SAAS,EAAE,CAAA;IAE5C,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,GAAG,0BAA0B,CAAA;IAElE,MAAM,cAAc,GAClB,CAAC,SAAS,IAAI,QAAQ;QACpB,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,YAAY,CAAC,MAAM,CACjB,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,0BAA0B,CAC5D,CAAA;IAEP,MAAM,iBAAiB,GAAG,GAAS,EAAE;QACnC,IAAI,CAAC,SAAS,EAAE;YACd,OAAM;SACP;QAED,YAAY,EAAE,CAAA;IAChB,CAAC,CAAA;IAED,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE;YAC1C,YAAY,EAAE,SAAS;YACvB,QAAQ;SACT,CAAC,aAEF,eAAK,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,iBAAiB,aACrD,cACE,GAAG,EAAE,cAAc,CAAC,SAAS,EAC7B,GAAG,EAAE,KAAK,EACV,SAAS,EAAC,kBAAkB,GAC5B,EACF,cAAI,SAAS,EAAC,iBAAiB,aAC5B,cAAc,CAAC,YAAY,OAAG,CAAC,CAAC,OAAO,IACrC,EACJ,SAAS,IAAI,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,GAAG,IAClD,EACN,cAAK,SAAS,EAAC,qCAAqC,YACjD,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1C,KAAC,kBAAkB,IAQjB,WAAW,EAAE,WAAW,IAPnB;oBACH,WAAW,CAAC,aAAa;oBACzB,WAAW,CAAC,KAAK;oBACjB,WAAW,CAAC,UAAU;oBACtB,WAAW,CAAC,qBAAqB;oBACjC,KAAK;iBACN,CAAC,IAAI,CAAC,GAAG,CAAC,CAEX,CACH,CAAC,GACE,EACN,KAAC,oBAAoB,IACnB,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,YAAY,CAAC,MAAM,GACrC,EACF,KAAC,oBAAoB,IAAC,OAAO,EAAE,SAAS,IAAI,CAAC,QAAQ,GAAI,IACrD,CACP,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,SAAS;CACnB,CAAA"}
@@ -1,2 +0,0 @@
1
- import type { DeviceProvider } from 'seamapi';
2
- export declare function useDeviceProvider(name: string): DeviceProvider;
@@ -1,13 +0,0 @@
1
- import { useDeviceProviders } from '../../../../lib/seam/devices/use-device-providers.js';
2
- export function useDeviceProvider(name) {
3
- const { deviceProviders } = useDeviceProviders();
4
- const provider = deviceProviders?.find((p) => p.device_provider_name === name);
5
- return provider ?? unknownProvider;
6
- }
7
- const unknownProvider = {
8
- device_provider_name: 'unknown',
9
- display_name: 'Unknown',
10
- image_url: 'https://connect.getseam.com/assets/images/logos/seam.png',
11
- provider_categories: [],
12
- };
13
- //# sourceMappingURL=use-device-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-device-provider.js","sourceRoot":"","sources":["../../../../src/lib/seam/components/SupportedDeviceTable/use-device-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAA;AAE7E,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,EAAE,eAAe,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAChD,MAAM,QAAQ,GAAG,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,oBAAoB,KAAK,IAAI,CAAC,CAAA;IAC9E,OAAO,QAAQ,IAAI,eAAe,CAAA;AACpC,CAAC;AAED,MAAM,eAAe,GAAmB;IACtC,oBAAoB,EAAE,SAAS;IAC/B,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,0DAA0D;IACrE,mBAAmB,EAAE,EAAE;CACxB,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { DeviceModel, DeviceModelsListRequest } from 'seamapi';
2
- import type { UseSeamQueryResult } from '../../../lib/seam/use-seam-query-result.js';
3
- export type UseDeviceModelsParams = DeviceModelsListRequest;
4
- export type UseDeviceModelsData = DeviceModel[];
5
- export declare function useDeviceModels(params?: Omit<UseDeviceModelsParams, 'acknowledge_intentional_use_of_internal_api'>): UseSeamQueryResult<'deviceModels', UseDeviceModelsData>;
@@ -1,19 +0,0 @@
1
- import { useQuery } from '@tanstack/react-query';
2
- import { useSeamClient } from '../../../lib/seam/use-seam-client.js';
3
- export function useDeviceModels(params) {
4
- const { client } = useSeamClient();
5
- const { data, ...rest } = useQuery({
6
- enabled: client != null,
7
- queryKey: ['device_models', 'list', params],
8
- queryFn: async () => {
9
- if (client == null)
10
- return [];
11
- return await client.deviceModels.list({
12
- ...params,
13
- acknowledge_intentional_use_of_internal_api: true,
14
- });
15
- },
16
- });
17
- return { ...rest, deviceModels: data };
18
- }
19
- //# sourceMappingURL=use-device-models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-device-models.js","sourceRoot":"","sources":["../../../src/lib/seam/device-models/use-device-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAQhD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAM3D,MAAM,UAAU,eAAe,CAC7B,MAGC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;IAElC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAGhC;QACA,OAAO,EAAE,MAAM,IAAI,IAAI;QACvB,QAAQ,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC;QAC3C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,MAAM,IAAI,IAAI;gBAAE,OAAO,EAAE,CAAA;YAC7B,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC;gBACpC,GAAG,MAAM;gBACT,2CAA2C,EAAE,IAAI;aAClD,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACxC,CAAC"}
package/lib/strings.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function capitalize(str: string): string;
package/lib/strings.js DELETED
@@ -1,4 +0,0 @@
1
- export function capitalize(str) {
2
- return str.charAt(0).toUpperCase() + str.slice(1);
3
- }
4
- //# sourceMappingURL=strings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strings.js","sourceRoot":"","sources":["../src/lib/strings.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { DeviceProvider } from 'seamapi'
2
-
3
- import { useDeviceProviders } from 'lib/seam/devices/use-device-providers.js'
4
-
5
- export function useDeviceProvider(name: string): DeviceProvider {
6
- const { deviceProviders } = useDeviceProviders()
7
- const provider = deviceProviders?.find((p) => p.device_provider_name === name)
8
- return provider ?? unknownProvider
9
- }
10
-
11
- const unknownProvider: DeviceProvider = {
12
- device_provider_name: 'unknown',
13
- display_name: 'Unknown',
14
- image_url: 'https://connect.getseam.com/assets/images/logos/seam.png',
15
- provider_categories: [],
16
- }
@@ -1,39 +0,0 @@
1
- import { useQuery } from '@tanstack/react-query'
2
- import type {
3
- DeviceModel,
4
- DeviceModelsListRequest,
5
- DeviceModelsListResponse,
6
- SeamError,
7
- } from 'seamapi'
8
-
9
- import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
- import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
-
12
- export type UseDeviceModelsParams = DeviceModelsListRequest
13
- export type UseDeviceModelsData = DeviceModel[]
14
-
15
- export function useDeviceModels(
16
- params?: Omit<
17
- UseDeviceModelsParams,
18
- 'acknowledge_intentional_use_of_internal_api'
19
- >
20
- ): UseSeamQueryResult<'deviceModels', UseDeviceModelsData> {
21
- const { client } = useSeamClient()
22
-
23
- const { data, ...rest } = useQuery<
24
- DeviceModelsListResponse['device_models'],
25
- SeamError
26
- >({
27
- enabled: client != null,
28
- queryKey: ['device_models', 'list', params],
29
- queryFn: async () => {
30
- if (client == null) return []
31
- return await client.deviceModels.list({
32
- ...params,
33
- acknowledge_intentional_use_of_internal_api: true,
34
- })
35
- },
36
- })
37
-
38
- return { ...rest, deviceModels: data }
39
- }
@@ -1,3 +0,0 @@
1
- export function capitalize(str: string): string {
2
- return str.charAt(0).toUpperCase() + str.slice(1)
3
- }