@seamapi/react 4.14.2 → 5.1.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/README.md +111 -3
- package/dist/ecosystem.js +45 -0
- package/dist/ecosystem.js.map +1 -0
- package/dist/elements.js +11464 -11007
- package/dist/elements.js.map +1 -1
- package/dist/index.css +469 -345
- package/dist/index.css.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.min.css.map +1 -1
- package/lib/seam/SeamProvider.d.ts +10 -3
- package/lib/seam/SeamProvider.js +5 -3
- package/lib/seam/SeamProvider.js.map +1 -1
- package/lib/seam/components/CompatibleApps/CompatibleApps.d.ts +26 -0
- package/lib/seam/components/CompatibleApps/CompatibleApps.js +126 -0
- package/lib/seam/components/CompatibleApps/CompatibleApps.js.map +1 -0
- package/lib/seam/components/SupportedDevices/DeviceModelRow.d.ts +8 -0
- package/lib/seam/components/SupportedDevices/DeviceModelRow.js +31 -0
- package/lib/seam/components/SupportedDevices/DeviceModelRow.js.map +1 -0
- package/lib/seam/components/SupportedDevices/FilterSelect.d.ts +12 -0
- package/lib/seam/components/SupportedDevices/FilterSelect.js +9 -0
- package/lib/seam/components/SupportedDevices/FilterSelect.js.map +1 -0
- package/lib/seam/components/SupportedDevices/ManufacturerSection.d.ts +10 -0
- package/lib/seam/components/SupportedDevices/ManufacturerSection.js +35 -0
- package/lib/seam/components/SupportedDevices/ManufacturerSection.js.map +1 -0
- package/lib/seam/components/SupportedDevices/SupportedDevices.d.ts +24 -0
- package/lib/seam/components/SupportedDevices/SupportedDevices.js +151 -0
- package/lib/seam/components/SupportedDevices/SupportedDevices.js.map +1 -0
- package/lib/seam/components/SupportedDevices/device-models.d.ts +47 -0
- package/lib/seam/components/SupportedDevices/device-models.js +217 -0
- package/lib/seam/components/SupportedDevices/device-models.js.map +1 -0
- package/lib/seam/components/index.d.ts +2 -2
- package/lib/seam/components/index.js +2 -2
- package/lib/seam/components/index.js.map +1 -1
- package/lib/seam/ecosystem/EcosystemProvider.d.ts +37 -0
- package/lib/seam/ecosystem/EcosystemProvider.js +56 -0
- package/lib/seam/ecosystem/EcosystemProvider.js.map +1 -0
- package/lib/seam/ecosystem/client.d.ts +28 -0
- package/lib/seam/ecosystem/client.js +74 -0
- package/lib/seam/ecosystem/client.js.map +1 -0
- package/lib/seam/ecosystem/index.d.ts +9 -0
- package/lib/seam/ecosystem/index.js +8 -0
- package/lib/seam/ecosystem/index.js.map +1 -0
- package/lib/seam/ecosystem/types.d.ts +253 -0
- package/lib/seam/ecosystem/types.js +10 -0
- package/lib/seam/ecosystem/types.js.map +1 -0
- package/lib/seam/ecosystem/use-compatible-partners.d.ts +21 -0
- package/lib/seam/ecosystem/use-compatible-partners.js +36 -0
- package/lib/seam/ecosystem/use-compatible-partners.js.map +1 -0
- package/lib/seam/ecosystem/use-ecosystem-device-models.d.ts +20 -0
- package/lib/seam/ecosystem/use-ecosystem-device-models.js +51 -0
- package/lib/seam/ecosystem/use-ecosystem-device-models.js.map +1 -0
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.d.ts +11 -0
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.js +49 -0
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.js.map +1 -0
- package/lib/seam/ecosystem/use-ecosystem-query-result.d.ts +7 -0
- package/lib/seam/ecosystem/use-ecosystem-query-result.js +7 -0
- package/lib/seam/ecosystem/use-ecosystem-query-result.js.map +1 -0
- package/lib/seam/ecosystem/use-embed-key-resolution.d.ts +20 -0
- package/lib/seam/ecosystem/use-embed-key-resolution.js +51 -0
- package/lib/seam/ecosystem/use-embed-key-resolution.js.map +1 -0
- package/lib/seam/index.d.ts +1 -0
- package/lib/seam/index.js +1 -0
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/seam-components-class-name.d.ts +1 -0
- package/lib/seam/seam-components-class-name.js +2 -0
- package/lib/seam/seam-components-class-name.js.map +1 -0
- package/lib/ui/ecosystem/SearchField.d.ts +9 -0
- package/lib/ui/ecosystem/SearchField.js +8 -0
- package/lib/ui/ecosystem/SearchField.js.map +1 -0
- package/lib/ui/ecosystem/StateMessage.d.ts +8 -0
- package/lib/ui/ecosystem/StateMessage.js +5 -0
- package/lib/ui/ecosystem/StateMessage.js.map +1 -0
- package/lib/ui/ecosystem/errors.d.ts +5 -0
- package/lib/ui/ecosystem/errors.js +25 -0
- package/lib/ui/ecosystem/errors.js.map +1 -0
- package/lib/ui/ecosystem/storybook.d.ts +15 -0
- package/lib/ui/ecosystem/storybook.js +16 -0
- package/lib/ui/ecosystem/storybook.js.map +1 -0
- package/lib/ui/ecosystem/theme.d.ts +6 -0
- package/lib/ui/ecosystem/theme.js +11 -0
- package/lib/ui/ecosystem/theme.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +11 -3
- package/src/ecosystem.d.ts +2 -0
- package/src/ecosystem.ts +12 -0
- package/src/elements.ts +4 -0
- package/src/lib/ecosystem-element.tsx +154 -0
- package/src/lib/element.tsx +6 -0
- package/src/lib/seam/SeamProvider.tsx +18 -2
- package/src/lib/seam/components/CompatibleApps/CompatibleApps.element.ts +19 -0
- package/src/lib/seam/components/CompatibleApps/CompatibleApps.tsx +344 -0
- package/src/lib/seam/components/SupportedDevices/DeviceModelRow.tsx +105 -0
- package/src/lib/seam/components/SupportedDevices/FilterSelect.tsx +43 -0
- package/src/lib/seam/components/SupportedDevices/ManufacturerSection.tsx +114 -0
- package/src/lib/seam/components/SupportedDevices/SupportedDevices.element.ts +17 -0
- package/src/lib/seam/components/SupportedDevices/SupportedDevices.tsx +382 -0
- package/src/lib/seam/components/SupportedDevices/device-models.ts +326 -0
- package/src/lib/seam/components/ecosystem-elements.ts +2 -0
- package/src/lib/seam/components/elements.ts +0 -2
- package/src/lib/seam/components/index.ts +2 -2
- package/src/lib/seam/ecosystem/EcosystemProvider.tsx +133 -0
- package/src/lib/seam/ecosystem/client.ts +116 -0
- package/src/lib/seam/ecosystem/index.ts +19 -0
- package/src/lib/seam/ecosystem/types.ts +334 -0
- package/src/lib/seam/ecosystem/use-compatible-partners.ts +80 -0
- package/src/lib/seam/ecosystem/use-ecosystem-device-models.ts +96 -0
- package/src/lib/seam/ecosystem/use-ecosystem-manufacturers.ts +86 -0
- package/src/lib/seam/ecosystem/use-ecosystem-query-result.ts +19 -0
- package/src/lib/seam/ecosystem/use-embed-key-resolution.ts +80 -0
- package/src/lib/seam/index.ts +1 -0
- package/src/lib/seam/seam-components-class-name.ts +1 -0
- package/src/lib/ui/ecosystem/SearchField.tsx +32 -0
- package/src/lib/ui/ecosystem/StateMessage.tsx +29 -0
- package/src/lib/ui/ecosystem/errors.ts +30 -0
- package/src/lib/ui/ecosystem/storybook.tsx +40 -0
- package/src/lib/ui/ecosystem/theme.ts +14 -0
- package/src/lib/version.ts +1 -1
- package/src/styles/_compatible-apps.scss +102 -0
- package/src/styles/_ecosystem.scss +295 -0
- package/src/styles/_main.scss +6 -4
- package/src/styles/_supported-devices.scss +153 -0
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -20
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js +0 -22
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +0 -6
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js +0 -8
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +0 -9
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js +0 -14
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -13
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +0 -58
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js +0 -6
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -12
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +0 -58
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +0 -8
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js +0 -39
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -10
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +0 -35
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -11
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +0 -20
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +0 -6
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js +0 -21
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js +0 -21
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-models.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js +0 -30
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +0 -15
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +0 -45
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.d.ts +0 -10
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js +0 -42
- package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +0 -17
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +0 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.d.ts +0 -7
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +0 -26
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +0 -1
- package/src/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.tsx +0 -78
- package/src/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.tsx +0 -13
- package/src/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.tsx +0 -32
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -161
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +0 -22
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +0 -145
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.tsx +0 -109
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -93
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +0 -15
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -70
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.element.ts +0 -9
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx +0 -64
- package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +0 -44
- package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +0 -57
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +0 -88
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.ts +0 -69
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +0 -40
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +0 -53
- package/src/styles/_supported-device-table-manufacturer-keys.scss +0 -20
- package/src/styles/_supported-device-table.scss +0 -412
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response types for the public Seam Ecosystem API (PartnerDB and DeviceDB).
|
|
3
|
+
*
|
|
4
|
+
* Hand-copied from the zod schemas in `seamapi/ecosystem` `public-types/`
|
|
5
|
+
* (origin/main 733edf3, 2026-10-16) to avoid a zod runtime dependency.
|
|
6
|
+
* Fields stored verbatim from the source as JSON are typed as `unknown`.
|
|
7
|
+
* Keep in sync with Ecosystem until it publishes its types as a package.
|
|
8
|
+
*/
|
|
9
|
+
export interface EcosystemIndustry {
|
|
10
|
+
industry_id: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
display_name: string;
|
|
13
|
+
short_name: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface EcosystemSolution {
|
|
16
|
+
solution_id: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
display_name: string;
|
|
19
|
+
short_name: string | null;
|
|
20
|
+
type: 'software' | 'service';
|
|
21
|
+
}
|
|
22
|
+
export type PartnerAssetKind = 'square_logo' | 'square_logo_mono' | 'horizontal_logo' | 'horizontal_logo_mono' | 'product_image';
|
|
23
|
+
export interface PartnerAsset {
|
|
24
|
+
partner_asset_id: string;
|
|
25
|
+
kind: PartnerAssetKind;
|
|
26
|
+
url: string;
|
|
27
|
+
mime: string;
|
|
28
|
+
width: number | null;
|
|
29
|
+
height: number | null;
|
|
30
|
+
sort_order: number;
|
|
31
|
+
}
|
|
32
|
+
export interface Partner {
|
|
33
|
+
partner_id: string;
|
|
34
|
+
slug: string;
|
|
35
|
+
display_name: string;
|
|
36
|
+
website: string | null;
|
|
37
|
+
description_md: string | null;
|
|
38
|
+
is_live: boolean;
|
|
39
|
+
is_featured: boolean;
|
|
40
|
+
legacy_industry_featured: boolean;
|
|
41
|
+
industries: EcosystemIndustry[];
|
|
42
|
+
solutions: EcosystemSolution[];
|
|
43
|
+
assets: PartnerAsset[];
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
}
|
|
47
|
+
export type SupportLevel = 'device_category' | 'manufacturer' | 'provider' | 'capability';
|
|
48
|
+
export type ObservedStatus = 'active' | 'trace' | 'none' | 'unknown';
|
|
49
|
+
export type DeclaredStatus = 'enabled' | 'disabled' | 'not_via_seam';
|
|
50
|
+
export interface SupportResolution {
|
|
51
|
+
supported: boolean;
|
|
52
|
+
resolved_level: SupportLevel | null;
|
|
53
|
+
declared_status: DeclaredStatus | null;
|
|
54
|
+
observed_status: ObservedStatus | null;
|
|
55
|
+
note: string | null;
|
|
56
|
+
}
|
|
57
|
+
export interface CompatiblePartner extends Partner {
|
|
58
|
+
support: SupportResolution;
|
|
59
|
+
}
|
|
60
|
+
export type EmbedKeyOwnerKind = 'partner' | 'manufacturer' | 'seam';
|
|
61
|
+
/** The public record of an embed key, as returned by `embed/resolve`. */
|
|
62
|
+
export interface EmbedKey {
|
|
63
|
+
embed_key_id: string;
|
|
64
|
+
display_name: string;
|
|
65
|
+
owner_kind: EmbedKeyOwnerKind;
|
|
66
|
+
partner_id: string | null;
|
|
67
|
+
manufacturer_slug: string | null;
|
|
68
|
+
allowed_origins: string[];
|
|
69
|
+
config: Record<string, unknown>;
|
|
70
|
+
revoked_at: string | null;
|
|
71
|
+
created_at: string;
|
|
72
|
+
}
|
|
73
|
+
export interface EmbedCapabilityExclusion {
|
|
74
|
+
device_category: string;
|
|
75
|
+
/** Empty means every manufacturer in the category. */
|
|
76
|
+
manufacturer_slug: string;
|
|
77
|
+
/** Empty means every provider in the category. */
|
|
78
|
+
provider_slug: string;
|
|
79
|
+
}
|
|
80
|
+
export interface EmbedExclusions {
|
|
81
|
+
excluded_manufacturers: string[];
|
|
82
|
+
excluded_device_types: string[];
|
|
83
|
+
unsupported_providers: string[];
|
|
84
|
+
capability: string;
|
|
85
|
+
capability_exclusions: EmbedCapabilityExclusion[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Manufacturer context for manufacturer-owned keys.
|
|
89
|
+
* Not returned by Ecosystem yet (DEVDB-439); read when present.
|
|
90
|
+
*/
|
|
91
|
+
export interface EmbedManufacturerContext {
|
|
92
|
+
manufacturer_slug: string;
|
|
93
|
+
}
|
|
94
|
+
export interface EmbedResolution {
|
|
95
|
+
embed_key: EmbedKey;
|
|
96
|
+
exclusions: EmbedExclusions;
|
|
97
|
+
manufacturer_context?: EmbedManufacturerContext | null;
|
|
98
|
+
}
|
|
99
|
+
export interface MediaFormat {
|
|
100
|
+
object_key: string;
|
|
101
|
+
url: string;
|
|
102
|
+
mime: string | null;
|
|
103
|
+
width: number | null;
|
|
104
|
+
height: number | null;
|
|
105
|
+
bytes: number | null;
|
|
106
|
+
sha256: string | null;
|
|
107
|
+
}
|
|
108
|
+
export type MediaFormatName = 'thumbnail' | 'small' | 'medium' | 'large';
|
|
109
|
+
export type DeviceAssetKind = 'square_logo' | 'square_logo_mono' | 'horizontal_logo' | 'horizontal_logo_mono' | 'default_device_image' | 'featured' | 'variant_image';
|
|
110
|
+
export interface DeviceAsset {
|
|
111
|
+
asset_id: string;
|
|
112
|
+
kind: DeviceAssetKind;
|
|
113
|
+
object_key: string;
|
|
114
|
+
url: string;
|
|
115
|
+
mime: string | null;
|
|
116
|
+
width: number | null;
|
|
117
|
+
height: number | null;
|
|
118
|
+
bytes: number | null;
|
|
119
|
+
sha256: string | null;
|
|
120
|
+
sort_order: number;
|
|
121
|
+
formats: Partial<Record<MediaFormatName, MediaFormat>>;
|
|
122
|
+
created_at: string;
|
|
123
|
+
updated_at: string;
|
|
124
|
+
}
|
|
125
|
+
export interface DeviceTypeRef {
|
|
126
|
+
device_type_id: string;
|
|
127
|
+
slug: string;
|
|
128
|
+
display_name: string;
|
|
129
|
+
is_accessory: boolean;
|
|
130
|
+
}
|
|
131
|
+
export interface ManufacturerRef {
|
|
132
|
+
manufacturer_id: string;
|
|
133
|
+
slug: string;
|
|
134
|
+
display_name: string | null;
|
|
135
|
+
}
|
|
136
|
+
export interface ProviderRef {
|
|
137
|
+
provider_id: string;
|
|
138
|
+
slug: string;
|
|
139
|
+
display_name: string | null;
|
|
140
|
+
}
|
|
141
|
+
export type CapabilityName = 'device_connectivity' | 'can_program_online_access_codes' | 'can_program_offline_access_codes' | 'can_remotely_unlock' | 'can_remotely_lock' | 'can_encode_plastic_cards' | 'can_provision_mobile_keys' | 'can_provision_wallet_keys' | 'can_hvac_cool' | 'can_hvac_heat' | 'can_hvac_auto' | 'can_hvac_fan' | 'can_program_thermostat_weekly_programs' | 'can_monitor';
|
|
142
|
+
export type CapabilitySupported = 'yes' | 'no' | 'conditionally';
|
|
143
|
+
export type IntegrationSupportLevel = 'inquire' | 'unavailable' | 'planned' | 'in-progress' | 'beta' | 'stable';
|
|
144
|
+
export interface CapabilityReport {
|
|
145
|
+
details: string;
|
|
146
|
+
requirements?: Record<string, {
|
|
147
|
+
message: string;
|
|
148
|
+
device_slugs?: string[];
|
|
149
|
+
[key: string]: unknown;
|
|
150
|
+
}>;
|
|
151
|
+
dependencies?: string[];
|
|
152
|
+
[key: string]: unknown;
|
|
153
|
+
}
|
|
154
|
+
export interface CapabilityDetail {
|
|
155
|
+
capability_id: string;
|
|
156
|
+
name: CapabilityName;
|
|
157
|
+
supported: CapabilitySupported;
|
|
158
|
+
integration_support_level: IntegrationSupportLevel | null;
|
|
159
|
+
report: CapabilityReport | null;
|
|
160
|
+
report_raw: CapabilityReport | null;
|
|
161
|
+
locale: string;
|
|
162
|
+
computed_at: string;
|
|
163
|
+
}
|
|
164
|
+
export interface ProviderCapabilities {
|
|
165
|
+
provider: ProviderRef;
|
|
166
|
+
capabilities: CapabilityDetail[];
|
|
167
|
+
}
|
|
168
|
+
export interface DeviceModelVariant {
|
|
169
|
+
device_model_variant_id: string;
|
|
170
|
+
color_name: string | null;
|
|
171
|
+
style_name: string | null;
|
|
172
|
+
primary_color_hex: string | null;
|
|
173
|
+
manufacturer_model_id: string | null;
|
|
174
|
+
asin: string | null;
|
|
175
|
+
gtins: unknown;
|
|
176
|
+
marketplace_listings: unknown;
|
|
177
|
+
sort_order: number;
|
|
178
|
+
images: DeviceAsset[];
|
|
179
|
+
created_at: string;
|
|
180
|
+
updated_at: string;
|
|
181
|
+
}
|
|
182
|
+
export interface DeviceModel {
|
|
183
|
+
device_model_id: string;
|
|
184
|
+
slug: string;
|
|
185
|
+
display_name: string | null;
|
|
186
|
+
description_md: string | null;
|
|
187
|
+
product_url: string | null;
|
|
188
|
+
is_forbidden_to_3dparty: boolean | null;
|
|
189
|
+
no_longer_sold: boolean | null;
|
|
190
|
+
shop_listings: unknown;
|
|
191
|
+
last_commerce_search_at: string | null;
|
|
192
|
+
manufacturer: ManufacturerRef | null;
|
|
193
|
+
device_type: DeviceTypeRef | null;
|
|
194
|
+
device_type_properties: unknown;
|
|
195
|
+
variants: DeviceModelVariant[];
|
|
196
|
+
featured_image: DeviceAsset | null;
|
|
197
|
+
providers: ProviderRef[];
|
|
198
|
+
capabilities_by_provider: ProviderCapabilities[];
|
|
199
|
+
capabilities_stale: boolean;
|
|
200
|
+
created_at: string;
|
|
201
|
+
updated_at: string;
|
|
202
|
+
}
|
|
203
|
+
export interface ManufacturerDefaultDeviceImage {
|
|
204
|
+
device_type: DeviceTypeRef;
|
|
205
|
+
asset: DeviceAsset;
|
|
206
|
+
}
|
|
207
|
+
export interface Manufacturer {
|
|
208
|
+
manufacturer_id: string;
|
|
209
|
+
slug: string;
|
|
210
|
+
display_name: string | null;
|
|
211
|
+
website: string | null;
|
|
212
|
+
headquarters: string | null;
|
|
213
|
+
country_of_origin: string | null;
|
|
214
|
+
parent_org: string | null;
|
|
215
|
+
inc_date: string | null;
|
|
216
|
+
customer_support_phone: string | null;
|
|
217
|
+
customer_support_email: string | null;
|
|
218
|
+
customer_support_url: string | null;
|
|
219
|
+
description_md: string | null;
|
|
220
|
+
seam_api_guide: string | null;
|
|
221
|
+
commerce_footprint: unknown;
|
|
222
|
+
last_commerce_search_at: string | null;
|
|
223
|
+
logos: DeviceAsset[];
|
|
224
|
+
default_device_images: ManufacturerDefaultDeviceImage[];
|
|
225
|
+
providers: ProviderRef[];
|
|
226
|
+
device_model_count: number;
|
|
227
|
+
created_at: string;
|
|
228
|
+
updated_at: string;
|
|
229
|
+
}
|
|
230
|
+
export interface Pagination {
|
|
231
|
+
has_next_page: boolean;
|
|
232
|
+
next_page_cursor: string | null;
|
|
233
|
+
}
|
|
234
|
+
export interface CompatibilityResponse {
|
|
235
|
+
partners: CompatiblePartner[];
|
|
236
|
+
}
|
|
237
|
+
export interface DeviceModelsListResponse {
|
|
238
|
+
device_models: DeviceModel[];
|
|
239
|
+
pagination: Pagination;
|
|
240
|
+
}
|
|
241
|
+
export interface ManufacturersListResponse {
|
|
242
|
+
manufacturers: Manufacturer[];
|
|
243
|
+
pagination: Pagination;
|
|
244
|
+
}
|
|
245
|
+
export interface EcosystemErrorResponse {
|
|
246
|
+
ok: false;
|
|
247
|
+
error: {
|
|
248
|
+
type: string;
|
|
249
|
+
message: string;
|
|
250
|
+
data?: Record<string, unknown>;
|
|
251
|
+
request_id?: string;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response types for the public Seam Ecosystem API (PartnerDB and DeviceDB).
|
|
3
|
+
*
|
|
4
|
+
* Hand-copied from the zod schemas in `seamapi/ecosystem` `public-types/`
|
|
5
|
+
* (origin/main 733edf3, 2026-10-16) to avoid a zod runtime dependency.
|
|
6
|
+
* Fields stored verbatim from the source as JSON are typed as `unknown`.
|
|
7
|
+
* Keep in sync with Ecosystem until it publishes its types as a package.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CompatiblePartner } from '../../../lib/seam/ecosystem/types.js';
|
|
2
|
+
import { type UseEcosystemQueryResult } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
3
|
+
export interface UseCompatiblePartnersParams {
|
|
4
|
+
/** Device category, e.g., `smartlock`, `thermostat`, `sensor`, `intercom`. */
|
|
5
|
+
deviceType: string;
|
|
6
|
+
/** DeviceDB manufacturer slug, e.g., `schlage`. */
|
|
7
|
+
manufacturer?: string | undefined;
|
|
8
|
+
/** DeviceDB provider slug, e.g., `salto-ks`. */
|
|
9
|
+
provider?: string | undefined;
|
|
10
|
+
/** DeviceDB capability, e.g., `can_provision_mobile_keys`. */
|
|
11
|
+
capability?: string | undefined;
|
|
12
|
+
/** Industry slug, e.g., `short-term-rental`. */
|
|
13
|
+
industry?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export type UseCompatiblePartnersData = CompatiblePartner[];
|
|
16
|
+
/**
|
|
17
|
+
* The live partners that support a device category, manufacturer, provider
|
|
18
|
+
* or capability through Seam, from Ecosystem `GET /v1/compatibility`.
|
|
19
|
+
* Declared-first: a partner is listed only where Seam or the partner declared support.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCompatiblePartners({ deviceType, manufacturer, provider, capability, industry, }: UseCompatiblePartnersParams): UseEcosystemQueryResult<'partners', UseCompatiblePartnersData>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { fetchEcosystem, } from '../../../lib/seam/ecosystem/client.js';
|
|
3
|
+
import { useEcosystemContext } from '../../../lib/seam/ecosystem/EcosystemProvider.js';
|
|
4
|
+
import { retryEcosystemQuery, } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
5
|
+
/**
|
|
6
|
+
* The live partners that support a device category, manufacturer, provider
|
|
7
|
+
* or capability through Seam, from Ecosystem `GET /v1/compatibility`.
|
|
8
|
+
* Declared-first: a partner is listed only where Seam or the partner declared support.
|
|
9
|
+
*/
|
|
10
|
+
export function useCompatiblePartners({ deviceType, manufacturer = '', provider = '', capability = '', industry = '', }) {
|
|
11
|
+
const { embedKey, endpoint } = useEcosystemContext();
|
|
12
|
+
const params = {
|
|
13
|
+
device_category: deviceType.trim(),
|
|
14
|
+
manufacturer_slug: manufacturer.trim(),
|
|
15
|
+
provider_slug: provider.trim(),
|
|
16
|
+
capability: capability.trim(),
|
|
17
|
+
industry: industry.trim(),
|
|
18
|
+
};
|
|
19
|
+
const { data, ...rest } = useQuery({
|
|
20
|
+
enabled: params.device_category.length > 0,
|
|
21
|
+
queryKey: [
|
|
22
|
+
'ecosystem',
|
|
23
|
+
endpoint,
|
|
24
|
+
embedKey ?? null,
|
|
25
|
+
'compatibility',
|
|
26
|
+
params,
|
|
27
|
+
],
|
|
28
|
+
queryFn: async ({ signal }) => {
|
|
29
|
+
const { partners } = await fetchEcosystem('compatibility', { endpoint, embedKey, params, signal });
|
|
30
|
+
return partners;
|
|
31
|
+
},
|
|
32
|
+
retry: retryEcosystemQuery,
|
|
33
|
+
});
|
|
34
|
+
return { ...rest, partners: data };
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=use-compatible-partners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-compatible-partners.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/use-compatible-partners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAEL,cAAc,GACf,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAK7E,OAAO,EACL,mBAAmB,GAEpB,MAAM,kDAAkD,CAAA;AAiBzD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,EACV,YAAY,GAAG,EAAE,EACjB,QAAQ,GAAG,EAAE,EACb,UAAU,GAAG,EAAE,EACf,QAAQ,GAAG,EAAE,GACe;IAI5B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAA;IAEpD,MAAM,MAAM,GAAG;QACb,eAAe,EAAE,UAAU,CAAC,IAAI,EAAE;QAClC,iBAAiB,EAAE,YAAY,CAAC,IAAI,EAAE;QACtC,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE;QAC9B,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE;QAC7B,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE;KAC1B,CAAA;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAGhC;QACA,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;QAC1C,QAAQ,EAAE;YACR,WAAW;YACX,QAAQ;YACR,QAAQ,IAAI,IAAI;YAChB,eAAe;YACf,MAAM;SACP;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,cAAc,CACvC,eAAe,EACf,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CACvC,CAAA;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,KAAK,EAAE,mBAAmB;KAC3B,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DeviceModel } from '../../../lib/seam/ecosystem/types.js';
|
|
2
|
+
import { type UseEcosystemQueryResult } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
3
|
+
export interface UseEcosystemDeviceModelsParams {
|
|
4
|
+
/** DeviceDB manufacturer slug, e.g., `schlage`. */
|
|
5
|
+
manufacturer?: string | undefined;
|
|
6
|
+
/** DeviceDB device type slug, e.g., `smartlock`. */
|
|
7
|
+
deviceType?: string | undefined;
|
|
8
|
+
/** DeviceDB provider slug, e.g., `salto-ks`. */
|
|
9
|
+
provider?: string | undefined;
|
|
10
|
+
/** Only device models with a computed capability of this name. */
|
|
11
|
+
capability?: string | undefined;
|
|
12
|
+
/** Set to false to wait before fetching. */
|
|
13
|
+
enabled?: boolean | undefined;
|
|
14
|
+
}
|
|
15
|
+
export type UseEcosystemDeviceModelsData = DeviceModel[];
|
|
16
|
+
/**
|
|
17
|
+
* Published device models from Ecosystem `GET /v1/device_models/list`,
|
|
18
|
+
* following pagination to return every matching model.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useEcosystemDeviceModels({ manufacturer, deviceType, provider, capability, enabled, }?: UseEcosystemDeviceModelsParams): UseEcosystemQueryResult<'deviceModels', UseEcosystemDeviceModelsData>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { fetchEcosystem, } from '../../../lib/seam/ecosystem/client.js';
|
|
3
|
+
import { useEcosystemContext } from '../../../lib/seam/ecosystem/EcosystemProvider.js';
|
|
4
|
+
import { retryEcosystemQuery, } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
5
|
+
const pageSize = 500;
|
|
6
|
+
const maxPages = 20;
|
|
7
|
+
/**
|
|
8
|
+
* Published device models from Ecosystem `GET /v1/device_models/list`,
|
|
9
|
+
* following pagination to return every matching model.
|
|
10
|
+
*/
|
|
11
|
+
export function useEcosystemDeviceModels({ manufacturer = '', deviceType = '', provider = '', capability = '', enabled = true, } = {}) {
|
|
12
|
+
const { embedKey, endpoint } = useEcosystemContext();
|
|
13
|
+
const params = {
|
|
14
|
+
manufacturer: manufacturer.trim(),
|
|
15
|
+
device_type: deviceType.trim(),
|
|
16
|
+
provider: provider.trim(),
|
|
17
|
+
capability: capability.trim(),
|
|
18
|
+
};
|
|
19
|
+
const { data, ...rest } = useQuery({
|
|
20
|
+
enabled,
|
|
21
|
+
queryKey: [
|
|
22
|
+
'ecosystem',
|
|
23
|
+
endpoint,
|
|
24
|
+
embedKey ?? null,
|
|
25
|
+
'device_models',
|
|
26
|
+
'list',
|
|
27
|
+
params,
|
|
28
|
+
],
|
|
29
|
+
queryFn: async ({ signal }) => {
|
|
30
|
+
const deviceModels = [];
|
|
31
|
+
let pageCursor;
|
|
32
|
+
for (let page = 0; page < maxPages; page++) {
|
|
33
|
+
const res = await fetchEcosystem('device_models/list', {
|
|
34
|
+
endpoint,
|
|
35
|
+
embedKey,
|
|
36
|
+
params: { ...params, limit: pageSize, page_cursor: pageCursor },
|
|
37
|
+
signal,
|
|
38
|
+
});
|
|
39
|
+
deviceModels.push(...res.device_models);
|
|
40
|
+
const { has_next_page: hasNextPage, next_page_cursor: nextPageCursor } = res.pagination;
|
|
41
|
+
if (!hasNextPage || nextPageCursor == null)
|
|
42
|
+
break;
|
|
43
|
+
pageCursor = nextPageCursor;
|
|
44
|
+
}
|
|
45
|
+
return deviceModels;
|
|
46
|
+
},
|
|
47
|
+
retry: retryEcosystemQuery,
|
|
48
|
+
});
|
|
49
|
+
return { ...rest, deviceModels: data };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=use-ecosystem-device-models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ecosystem-device-models.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/use-ecosystem-device-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAEL,cAAc,GACf,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAK7E,OAAO,EACL,mBAAmB,GAEpB,MAAM,kDAAkD,CAAA;AAiBzD,MAAM,QAAQ,GAAG,GAAG,CAAA;AACpB,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,YAAY,GAAG,EAAE,EACjB,UAAU,GAAG,EAAE,EACf,QAAQ,GAAG,EAAE,EACb,UAAU,GAAG,EAAE,EACf,OAAO,GAAG,IAAI,MACoB,EAAE;IAIpC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAA;IAEpD,MAAM,MAAM,GAAG;QACb,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE;QACjC,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE;QAC9B,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE;QACzB,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE;KAC9B,CAAA;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAGhC;QACA,OAAO;QACP,QAAQ,EAAE;YACR,WAAW;YACX,QAAQ;YACR,QAAQ,IAAI,IAAI;YAChB,eAAe;YACf,MAAM;YACN,MAAM;SACP;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,MAAM,YAAY,GAAkB,EAAE,CAAA;YACtC,IAAI,UAA8B,CAAA;YAClC,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;gBAC3C,MAAM,GAAG,GAAG,MAAM,cAAc,CAC9B,oBAAoB,EACpB;oBACE,QAAQ;oBACR,QAAQ;oBACR,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE;oBAC/D,MAAM;iBACP,CACF,CAAA;gBACD,YAAY,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC,CAAA;gBACvC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,GACpE,GAAG,CAAC,UAAU,CAAA;gBAChB,IAAI,CAAC,WAAW,IAAI,cAAc,IAAI,IAAI;oBAAE,MAAK;gBACjD,UAAU,GAAG,cAAc,CAAA;YAC7B,CAAC;YACD,OAAO,YAAY,CAAA;QACrB,CAAC;QACD,KAAK,EAAE,mBAAmB;KAC3B,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Manufacturer } from '../../../lib/seam/ecosystem/types.js';
|
|
2
|
+
import { type UseEcosystemQueryResult } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
3
|
+
export interface UseEcosystemManufacturersParams {
|
|
4
|
+
/** Only manufacturers with these slugs. */
|
|
5
|
+
slugs?: string[] | undefined;
|
|
6
|
+
/** Set to false to wait before fetching. */
|
|
7
|
+
enabled?: boolean | undefined;
|
|
8
|
+
}
|
|
9
|
+
export type UseEcosystemManufacturersData = Manufacturer[];
|
|
10
|
+
/** Published manufacturers from Ecosystem `GET /v1/manufacturers/list`. */
|
|
11
|
+
export declare function useEcosystemManufacturers({ slugs, enabled, }?: UseEcosystemManufacturersParams): UseEcosystemQueryResult<'manufacturers', UseEcosystemManufacturersData>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { fetchEcosystem, } from '../../../lib/seam/ecosystem/client.js';
|
|
3
|
+
import { useEcosystemContext } from '../../../lib/seam/ecosystem/EcosystemProvider.js';
|
|
4
|
+
import { retryEcosystemQuery, } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
5
|
+
const pageSize = 500;
|
|
6
|
+
const maxPages = 10;
|
|
7
|
+
/** Published manufacturers from Ecosystem `GET /v1/manufacturers/list`. */
|
|
8
|
+
export function useEcosystemManufacturers({ slugs, enabled = true, } = {}) {
|
|
9
|
+
const { embedKey, endpoint } = useEcosystemContext();
|
|
10
|
+
const sortedSlugs = slugs == null
|
|
11
|
+
? null
|
|
12
|
+
: [...new Set(slugs)].sort((a, b) => a.localeCompare(b));
|
|
13
|
+
const { data, ...rest } = useQuery({
|
|
14
|
+
enabled: enabled && (sortedSlugs == null || sortedSlugs.length > 0),
|
|
15
|
+
queryKey: [
|
|
16
|
+
'ecosystem',
|
|
17
|
+
endpoint,
|
|
18
|
+
embedKey ?? null,
|
|
19
|
+
'manufacturers',
|
|
20
|
+
'list',
|
|
21
|
+
{ slugs: sortedSlugs },
|
|
22
|
+
],
|
|
23
|
+
queryFn: async ({ signal }) => {
|
|
24
|
+
const manufacturers = [];
|
|
25
|
+
let pageCursor;
|
|
26
|
+
for (let page = 0; page < maxPages; page++) {
|
|
27
|
+
const res = await fetchEcosystem('manufacturers/list', {
|
|
28
|
+
endpoint,
|
|
29
|
+
embedKey,
|
|
30
|
+
params: {
|
|
31
|
+
slugs: sortedSlugs ?? undefined,
|
|
32
|
+
limit: pageSize,
|
|
33
|
+
page_cursor: pageCursor,
|
|
34
|
+
},
|
|
35
|
+
signal,
|
|
36
|
+
});
|
|
37
|
+
manufacturers.push(...res.manufacturers);
|
|
38
|
+
const { has_next_page: hasNextPage, next_page_cursor: nextPageCursor } = res.pagination;
|
|
39
|
+
if (!hasNextPage || nextPageCursor == null)
|
|
40
|
+
break;
|
|
41
|
+
pageCursor = nextPageCursor;
|
|
42
|
+
}
|
|
43
|
+
return manufacturers;
|
|
44
|
+
},
|
|
45
|
+
retry: retryEcosystemQuery,
|
|
46
|
+
});
|
|
47
|
+
return { ...rest, manufacturers: data };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=use-ecosystem-manufacturers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ecosystem-manufacturers.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/use-ecosystem-manufacturers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAEL,cAAc,GACf,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAK7E,OAAO,EACL,mBAAmB,GAEpB,MAAM,kDAAkD,CAAA;AAWzD,MAAM,QAAQ,GAAG,GAAG,CAAA;AACpB,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB,2EAA2E;AAC3E,MAAM,UAAU,yBAAyB,CAAC,EACxC,KAAK,EACL,OAAO,GAAG,IAAI,MACqB,EAAE;IAIrC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAA;IAEpD,MAAM,WAAW,GACf,KAAK,IAAI,IAAI;QACX,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IAE5D,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAGhC;QACA,OAAO,EAAE,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;QACnE,QAAQ,EAAE;YACR,WAAW;YACX,QAAQ;YACR,QAAQ,IAAI,IAAI;YAChB,eAAe;YACf,MAAM;YACN,EAAE,KAAK,EAAE,WAAW,EAAE;SACvB;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,MAAM,aAAa,GAAmB,EAAE,CAAA;YACxC,IAAI,UAA8B,CAAA;YAClC,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;gBAC3C,MAAM,GAAG,GAAG,MAAM,cAAc,CAC9B,oBAAoB,EACpB;oBACE,QAAQ;oBACR,QAAQ;oBACR,MAAM,EAAE;wBACN,KAAK,EAAE,WAAW,IAAI,SAAS;wBAC/B,KAAK,EAAE,QAAQ;wBACf,WAAW,EAAE,UAAU;qBACxB;oBACD,MAAM;iBACP,CACF,CAAA;gBACD,aAAa,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC,CAAA;gBACxC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,GACpE,GAAG,CAAC,UAAU,CAAA;gBAChB,IAAI,CAAC,WAAW,IAAI,cAAc,IAAI,IAAI;oBAAE,MAAK;gBACjD,UAAU,GAAG,cAAc,CAAA;YAC7B,CAAC;YACD,OAAO,aAAa,CAAA;QACtB,CAAC;QACD,KAAK,EAAE,mBAAmB;KAC3B,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { EcosystemApiError } from '../../../lib/seam/ecosystem/client.js';
|
|
3
|
+
export type UseEcosystemQueryResult<Field extends string, Data> = Omit<UseQueryResult<Data, EcosystemApiError>, 'data'> & {
|
|
4
|
+
[key in Field]?: Data;
|
|
5
|
+
};
|
|
6
|
+
/** Retry server and network errors, but not client errors such as an invalid embed key. */
|
|
7
|
+
export declare const retryEcosystemQuery: (failureCount: number, error: EcosystemApiError) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Retry server and network errors, but not client errors such as an invalid embed key. */
|
|
2
|
+
export const retryEcosystemQuery = (failureCount, error) => {
|
|
3
|
+
if (error.status >= 400 && error.status < 500)
|
|
4
|
+
return false;
|
|
5
|
+
return failureCount < 2;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=use-ecosystem-query-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ecosystem-query-result.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/use-ecosystem-query-result.ts"],"names":[],"mappings":"AAWA,2FAA2F;AAC3F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,YAAoB,EACpB,KAAwB,EACf,EAAE;IACX,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG;QAAE,OAAO,KAAK,CAAA;IAC3D,OAAO,YAAY,GAAG,CAAC,CAAA;AACzB,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EmbedResolution } from '../../../lib/seam/ecosystem/types.js';
|
|
2
|
+
import { type UseEcosystemQueryResult } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
3
|
+
export interface UseEmbedKeyResolutionParams {
|
|
4
|
+
/** Resolve the partner's capability exclusions for this capability. */
|
|
5
|
+
capability?: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
export type UseEmbedKeyResolutionData = EmbedResolution;
|
|
8
|
+
/**
|
|
9
|
+
* Validates the provider's embed key against the page origin with
|
|
10
|
+
* Ecosystem `GET /v1/embed/resolve` and returns the key's public record
|
|
11
|
+
* and, for partner keys, what the partner's widgets must not show.
|
|
12
|
+
* Disabled when there is no embed key.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useEmbedKeyResolution({ capability, }?: UseEmbedKeyResolutionParams): UseEcosystemQueryResult<'embedResolution', UseEmbedKeyResolutionData>;
|
|
15
|
+
/**
|
|
16
|
+
* The manufacturer an embed key is scoped to, if any.
|
|
17
|
+
* Prefers the `manufacturer_context` Ecosystem returns for manufacturer keys (DEVDB-439),
|
|
18
|
+
* and falls back to the key's own `manufacturer_slug`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getEmbedKeyManufacturer: (resolution: EmbedResolution | null | undefined) => string | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { fetchEcosystem, } from '../../../lib/seam/ecosystem/client.js';
|
|
3
|
+
import { useEcosystemContext } from '../../../lib/seam/ecosystem/EcosystemProvider.js';
|
|
4
|
+
import { retryEcosystemQuery, } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
|
|
5
|
+
/**
|
|
6
|
+
* Validates the provider's embed key against the page origin with
|
|
7
|
+
* Ecosystem `GET /v1/embed/resolve` and returns the key's public record
|
|
8
|
+
* and, for partner keys, what the partner's widgets must not show.
|
|
9
|
+
* Disabled when there is no embed key.
|
|
10
|
+
*/
|
|
11
|
+
export function useEmbedKeyResolution({ capability = '', } = {}) {
|
|
12
|
+
const { embedKey, endpoint } = useEcosystemContext();
|
|
13
|
+
const params = { capability: capability.trim() };
|
|
14
|
+
const { data, ...rest } = useQuery({
|
|
15
|
+
enabled: embedKey != null,
|
|
16
|
+
queryKey: [
|
|
17
|
+
'ecosystem',
|
|
18
|
+
endpoint,
|
|
19
|
+
embedKey ?? null,
|
|
20
|
+
'embed',
|
|
21
|
+
'resolve',
|
|
22
|
+
params,
|
|
23
|
+
],
|
|
24
|
+
queryFn: async ({ signal }) => await fetchEcosystem('embed/resolve', {
|
|
25
|
+
endpoint,
|
|
26
|
+
embedKey,
|
|
27
|
+
params,
|
|
28
|
+
signal,
|
|
29
|
+
}),
|
|
30
|
+
retry: retryEcosystemQuery,
|
|
31
|
+
});
|
|
32
|
+
return { ...rest, embedResolution: data };
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The manufacturer an embed key is scoped to, if any.
|
|
36
|
+
* Prefers the `manufacturer_context` Ecosystem returns for manufacturer keys (DEVDB-439),
|
|
37
|
+
* and falls back to the key's own `manufacturer_slug`.
|
|
38
|
+
*/
|
|
39
|
+
export const getEmbedKeyManufacturer = (resolution) => {
|
|
40
|
+
if (resolution == null)
|
|
41
|
+
return null;
|
|
42
|
+
const contextSlug = resolution.manufacturer_context?.manufacturer_slug;
|
|
43
|
+
if (contextSlug != null && contextSlug.length > 0)
|
|
44
|
+
return contextSlug;
|
|
45
|
+
const { owner_kind: ownerKind, manufacturer_slug: slug } = resolution.embed_key;
|
|
46
|
+
if (ownerKind === 'manufacturer' && slug != null && slug.length > 0) {
|
|
47
|
+
return slug;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=use-embed-key-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-embed-key-resolution.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/use-embed-key-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAEL,cAAc,GACf,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAE7E,OAAO,EACL,mBAAmB,GAEpB,MAAM,kDAAkD,CAAA;AASzD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,GAAG,EAAE,MACgB,EAAE;IAIjC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAA;IAEpD,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,CAAA;IAEhD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAGhC;QACA,OAAO,EAAE,QAAQ,IAAI,IAAI;QACzB,QAAQ,EAAE;YACR,WAAW;YACX,QAAQ;YACR,QAAQ,IAAI,IAAI;YAChB,OAAO;YACP,SAAS;YACT,MAAM;SACP;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAC5B,MAAM,cAAc,CAAkB,eAAe,EAAE;YACrD,QAAQ;YACR,QAAQ;YACR,MAAM;YACN,MAAM;SACP,CAAC;QACJ,KAAK,EAAE,mBAAmB;KAC3B,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAA;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,UAA8C,EAC/B,EAAE;IACjB,IAAI,UAAU,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACnC,MAAM,WAAW,GAAG,UAAU,CAAC,oBAAoB,EAAE,iBAAiB,CAAA;IACtE,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,WAAW,CAAA;IACrE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,GACtD,UAAU,CAAC,SAAS,CAAA;IACtB,IAAI,SAAS,KAAK,cAAc,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpE,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
package/lib/seam/index.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ export * from './connected-accounts/use-connected-account.js';
|
|
|
10
10
|
export * from './devices/use-device.js';
|
|
11
11
|
export * from './devices/use-device-providers.js';
|
|
12
12
|
export * from './devices/use-devices.js';
|
|
13
|
+
export * from './ecosystem/index.js';
|
|
13
14
|
export * from './SeamProvider.js';
|
|
14
15
|
export * from './use-seam-query-result.js';
|
package/lib/seam/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './connected-accounts/use-connected-account.js';
|
|
|
10
10
|
export * from './devices/use-device.js';
|
|
11
11
|
export * from './devices/use-device-providers.js';
|
|
12
12
|
export * from './devices/use-devices.js';
|
|
13
|
+
export * from './ecosystem/index.js';
|
|
13
14
|
export * from './SeamProvider.js';
|
|
14
15
|
export * from './use-seam-query-result.js';
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/lib/seam/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/seam/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA;AAClD,cAAc,0CAA0C,CAAA;AACxD,cAAc,0CAA0C,CAAA;AACxD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,0CAA0C,CAAA;AACxD,cAAc,yCAAyC,CAAA;AACvD,cAAc,kDAAkD,CAAA;AAChE,cAAc,+CAA+C,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,mCAAmC,CAAA;AACjD,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/seam/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA;AAClD,cAAc,0CAA0C,CAAA;AACxD,cAAc,0CAA0C,CAAA;AACxD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,0CAA0C,CAAA;AACxD,cAAc,yCAAyC,CAAA;AACvD,cAAc,kDAAkD,CAAA;AAChE,cAAc,+CAA+C,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,mCAAmC,CAAA;AACjD,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const seamComponentsClassName = "seam-components";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seam-components-class-name.js","sourceRoot":"","sources":["../../src/lib/seam/seam-components-class-name.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface SearchFieldProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function SearchField({ value, onChange, label, disabled, }: SearchFieldProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SearchIcon } from '../../../lib/icons/Search.js';
|
|
3
|
+
export function SearchField({ value, onChange, label, disabled = false, }) {
|
|
4
|
+
return (_jsxs("label", { className: 'seam-ecosystem-search', children: [_jsx(SearchIcon, { "aria-hidden": true, className: 'seam-ecosystem-search-icon' }), _jsx("input", { type: 'search', className: 'seam-ecosystem-search-input', placeholder: label, "aria-label": label, value: value, disabled: disabled, onChange: (event) => {
|
|
5
|
+
onChange(event.target.value);
|
|
6
|
+
} })] }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=SearchField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchField.js","sourceRoot":"","sources":["../../../src/lib/ui/ecosystem/SearchField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAShD,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,GAAG,KAAK,GACC;IACjB,OAAO,CACL,iBAAO,SAAS,EAAC,uBAAuB,aACtC,KAAC,UAAU,yBAAa,SAAS,EAAC,4BAA4B,GAAG,EACjE,gBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,6BAA6B,EACvC,WAAW,EAAE,KAAK,gBACN,KAAK,EACjB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBAC9B,CAAC,GACD,IACI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
interface StateMessageProps extends PropsWithChildren {
|
|
3
|
+
actionLabel?: string;
|
|
4
|
+
onAction?: () => void;
|
|
5
|
+
role?: 'status' | 'alert';
|
|
6
|
+
}
|
|
7
|
+
export declare function StateMessage({ children, actionLabel, onAction, role, }: StateMessageProps): JSX.Element;
|
|
8
|
+
export {};
|