@seamapi/react 5.0.0 → 5.1.1

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 (125) hide show
  1. package/README.md +111 -2
  2. package/dist/ecosystem.js +45 -0
  3. package/dist/ecosystem.js.map +1 -0
  4. package/dist/elements.js +12872 -11737
  5. package/dist/elements.js.map +1 -1
  6. package/dist/index.css +469 -0
  7. package/dist/index.css.map +1 -1
  8. package/dist/index.min.css +1 -1
  9. package/dist/index.min.css.map +1 -1
  10. package/lib/seam/SeamProvider.d.ts +10 -3
  11. package/lib/seam/SeamProvider.js +5 -3
  12. package/lib/seam/SeamProvider.js.map +1 -1
  13. package/lib/seam/components/CompatibleApps/CompatibleApps.d.ts +26 -0
  14. package/lib/seam/components/CompatibleApps/CompatibleApps.js +126 -0
  15. package/lib/seam/components/CompatibleApps/CompatibleApps.js.map +1 -0
  16. package/lib/seam/components/SupportedDevices/DeviceModelRow.d.ts +8 -0
  17. package/lib/seam/components/SupportedDevices/DeviceModelRow.js +31 -0
  18. package/lib/seam/components/SupportedDevices/DeviceModelRow.js.map +1 -0
  19. package/lib/seam/components/SupportedDevices/FilterSelect.d.ts +12 -0
  20. package/lib/seam/components/SupportedDevices/FilterSelect.js +9 -0
  21. package/lib/seam/components/SupportedDevices/FilterSelect.js.map +1 -0
  22. package/lib/seam/components/SupportedDevices/ManufacturerSection.d.ts +10 -0
  23. package/lib/seam/components/SupportedDevices/ManufacturerSection.js +35 -0
  24. package/lib/seam/components/SupportedDevices/ManufacturerSection.js.map +1 -0
  25. package/lib/seam/components/SupportedDevices/SupportedDevices.d.ts +24 -0
  26. package/lib/seam/components/SupportedDevices/SupportedDevices.js +151 -0
  27. package/lib/seam/components/SupportedDevices/SupportedDevices.js.map +1 -0
  28. package/lib/seam/components/SupportedDevices/device-models.d.ts +47 -0
  29. package/lib/seam/components/SupportedDevices/device-models.js +217 -0
  30. package/lib/seam/components/SupportedDevices/device-models.js.map +1 -0
  31. package/lib/seam/components/index.d.ts +2 -0
  32. package/lib/seam/components/index.js +2 -0
  33. package/lib/seam/components/index.js.map +1 -1
  34. package/lib/seam/ecosystem/EcosystemProvider.d.ts +37 -0
  35. package/lib/seam/ecosystem/EcosystemProvider.js +56 -0
  36. package/lib/seam/ecosystem/EcosystemProvider.js.map +1 -0
  37. package/lib/seam/ecosystem/client.d.ts +28 -0
  38. package/lib/seam/ecosystem/client.js +74 -0
  39. package/lib/seam/ecosystem/client.js.map +1 -0
  40. package/lib/seam/ecosystem/index.d.ts +9 -0
  41. package/lib/seam/ecosystem/index.js +8 -0
  42. package/lib/seam/ecosystem/index.js.map +1 -0
  43. package/lib/seam/ecosystem/types.d.ts +312 -0
  44. package/lib/seam/ecosystem/types.js +10 -0
  45. package/lib/seam/ecosystem/types.js.map +1 -0
  46. package/lib/seam/ecosystem/use-compatible-partners.d.ts +21 -0
  47. package/lib/seam/ecosystem/use-compatible-partners.js +36 -0
  48. package/lib/seam/ecosystem/use-compatible-partners.js.map +1 -0
  49. package/lib/seam/ecosystem/use-ecosystem-device-model-summaries.d.ts +11 -0
  50. package/lib/seam/ecosystem/use-ecosystem-device-model-summaries.js +53 -0
  51. package/lib/seam/ecosystem/use-ecosystem-device-model-summaries.js.map +1 -0
  52. package/lib/seam/ecosystem/use-ecosystem-device-models.d.ts +20 -0
  53. package/lib/seam/ecosystem/use-ecosystem-device-models.js +51 -0
  54. package/lib/seam/ecosystem/use-ecosystem-device-models.js.map +1 -0
  55. package/lib/seam/ecosystem/use-ecosystem-manufacturers.d.ts +11 -0
  56. package/lib/seam/ecosystem/use-ecosystem-manufacturers.js +49 -0
  57. package/lib/seam/ecosystem/use-ecosystem-manufacturers.js.map +1 -0
  58. package/lib/seam/ecosystem/use-ecosystem-query-result.d.ts +7 -0
  59. package/lib/seam/ecosystem/use-ecosystem-query-result.js +7 -0
  60. package/lib/seam/ecosystem/use-ecosystem-query-result.js.map +1 -0
  61. package/lib/seam/ecosystem/use-embed-key-resolution.d.ts +20 -0
  62. package/lib/seam/ecosystem/use-embed-key-resolution.js +51 -0
  63. package/lib/seam/ecosystem/use-embed-key-resolution.js.map +1 -0
  64. package/lib/seam/index.d.ts +1 -0
  65. package/lib/seam/index.js +1 -0
  66. package/lib/seam/index.js.map +1 -1
  67. package/lib/seam/seam-components-class-name.d.ts +1 -0
  68. package/lib/seam/seam-components-class-name.js +2 -0
  69. package/lib/seam/seam-components-class-name.js.map +1 -0
  70. package/lib/ui/ecosystem/SearchField.d.ts +9 -0
  71. package/lib/ui/ecosystem/SearchField.js +8 -0
  72. package/lib/ui/ecosystem/SearchField.js.map +1 -0
  73. package/lib/ui/ecosystem/StateMessage.d.ts +8 -0
  74. package/lib/ui/ecosystem/StateMessage.js +5 -0
  75. package/lib/ui/ecosystem/StateMessage.js.map +1 -0
  76. package/lib/ui/ecosystem/errors.d.ts +5 -0
  77. package/lib/ui/ecosystem/errors.js +25 -0
  78. package/lib/ui/ecosystem/errors.js.map +1 -0
  79. package/lib/ui/ecosystem/storybook.d.ts +15 -0
  80. package/lib/ui/ecosystem/storybook.js +16 -0
  81. package/lib/ui/ecosystem/storybook.js.map +1 -0
  82. package/lib/ui/ecosystem/theme.d.ts +6 -0
  83. package/lib/ui/ecosystem/theme.js +11 -0
  84. package/lib/ui/ecosystem/theme.js.map +1 -0
  85. package/lib/version.d.ts +1 -1
  86. package/lib/version.js +1 -1
  87. package/package.json +11 -3
  88. package/src/ecosystem.d.ts +2 -0
  89. package/src/ecosystem.ts +12 -0
  90. package/src/elements.ts +4 -0
  91. package/src/lib/ecosystem-element.tsx +154 -0
  92. package/src/lib/element.tsx +6 -0
  93. package/src/lib/seam/SeamProvider.tsx +18 -2
  94. package/src/lib/seam/components/CompatibleApps/CompatibleApps.element.ts +19 -0
  95. package/src/lib/seam/components/CompatibleApps/CompatibleApps.tsx +344 -0
  96. package/src/lib/seam/components/SupportedDevices/DeviceModelRow.tsx +108 -0
  97. package/src/lib/seam/components/SupportedDevices/FilterSelect.tsx +43 -0
  98. package/src/lib/seam/components/SupportedDevices/ManufacturerSection.tsx +114 -0
  99. package/src/lib/seam/components/SupportedDevices/SupportedDevices.element.ts +17 -0
  100. package/src/lib/seam/components/SupportedDevices/SupportedDevices.tsx +382 -0
  101. package/src/lib/seam/components/SupportedDevices/device-models.ts +326 -0
  102. package/src/lib/seam/components/ecosystem-elements.ts +2 -0
  103. package/src/lib/seam/components/index.ts +2 -0
  104. package/src/lib/seam/ecosystem/EcosystemProvider.tsx +133 -0
  105. package/src/lib/seam/ecosystem/client.ts +116 -0
  106. package/src/lib/seam/ecosystem/index.ts +19 -0
  107. package/src/lib/seam/ecosystem/types.ts +402 -0
  108. package/src/lib/seam/ecosystem/use-compatible-partners.ts +80 -0
  109. package/src/lib/seam/ecosystem/use-ecosystem-device-model-summaries.ts +89 -0
  110. package/src/lib/seam/ecosystem/use-ecosystem-device-models.ts +96 -0
  111. package/src/lib/seam/ecosystem/use-ecosystem-manufacturers.ts +86 -0
  112. package/src/lib/seam/ecosystem/use-ecosystem-query-result.ts +19 -0
  113. package/src/lib/seam/ecosystem/use-embed-key-resolution.ts +80 -0
  114. package/src/lib/seam/index.ts +1 -0
  115. package/src/lib/seam/seam-components-class-name.ts +1 -0
  116. package/src/lib/ui/ecosystem/SearchField.tsx +32 -0
  117. package/src/lib/ui/ecosystem/StateMessage.tsx +29 -0
  118. package/src/lib/ui/ecosystem/errors.ts +30 -0
  119. package/src/lib/ui/ecosystem/storybook.tsx +40 -0
  120. package/src/lib/ui/ecosystem/theme.ts +14 -0
  121. package/src/lib/version.ts +1 -1
  122. package/src/styles/_compatible-apps.scss +102 -0
  123. package/src/styles/_ecosystem.scss +295 -0
  124. package/src/styles/_main.scss +6 -0
  125. package/src/styles/_supported-devices.scss +153 -0
@@ -0,0 +1,312 @@
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 055335c, 2026-10-17) 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
+ /** The manufacturer a manufacturer-owned key scopes DeviceDB widgets to (DEVDB-439). */
88
+ export interface EmbedManufacturerContext {
89
+ manufacturer_slug: string;
90
+ }
91
+ export interface EmbedResolution {
92
+ embed_key: EmbedKey;
93
+ /** Set for manufacturer-owned keys; null for partner and Seam keys. */
94
+ manufacturer_context?: EmbedManufacturerContext | null;
95
+ exclusions: EmbedExclusions;
96
+ }
97
+ export interface MediaFormat {
98
+ object_key: string;
99
+ url: string;
100
+ mime: string | null;
101
+ width: number | null;
102
+ height: number | null;
103
+ bytes: number | null;
104
+ sha256: string | null;
105
+ }
106
+ export type MediaFormatName = 'thumbnail' | 'small' | 'medium' | 'large';
107
+ export type DeviceAssetKind = 'square_logo' | 'square_logo_mono' | 'horizontal_logo' | 'horizontal_logo_mono' | 'default_device_image' | 'featured' | 'variant_image';
108
+ export interface DeviceAsset {
109
+ asset_id: string;
110
+ kind: DeviceAssetKind;
111
+ object_key: string;
112
+ url: string;
113
+ mime: string | null;
114
+ width: number | null;
115
+ height: number | null;
116
+ bytes: number | null;
117
+ sha256: string | null;
118
+ sort_order: number;
119
+ formats: Partial<Record<MediaFormatName, MediaFormat>>;
120
+ created_at: string;
121
+ updated_at: string;
122
+ }
123
+ export interface DeviceTypeRef {
124
+ device_type_id: string;
125
+ slug: string;
126
+ display_name: string;
127
+ is_accessory: boolean;
128
+ }
129
+ export interface ManufacturerRef {
130
+ manufacturer_id: string;
131
+ slug: string;
132
+ display_name: string | null;
133
+ }
134
+ export interface ProviderRef {
135
+ provider_id: string;
136
+ slug: string;
137
+ display_name: string | null;
138
+ }
139
+ 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';
140
+ export type CapabilitySupported = 'yes' | 'no' | 'conditionally';
141
+ export type IntegrationSupportLevel = 'inquire' | 'unavailable' | 'planned' | 'in-progress' | 'beta' | 'stable';
142
+ export interface CapabilityReport {
143
+ details: string;
144
+ requirements?: Record<string, {
145
+ message: string;
146
+ device_slugs?: string[];
147
+ [key: string]: unknown;
148
+ }>;
149
+ dependencies?: string[];
150
+ [key: string]: unknown;
151
+ }
152
+ export interface CapabilityDetail {
153
+ capability_id: string;
154
+ name: CapabilityName;
155
+ supported: CapabilitySupported;
156
+ integration_support_level: IntegrationSupportLevel | null;
157
+ report: CapabilityReport | null;
158
+ report_raw: CapabilityReport | null;
159
+ locale: string;
160
+ computed_at: string;
161
+ }
162
+ export interface ProviderCapabilities {
163
+ provider: ProviderRef;
164
+ capabilities: CapabilityDetail[];
165
+ }
166
+ export interface DeviceModelVariant {
167
+ device_model_variant_id: string;
168
+ color_name: string | null;
169
+ style_name: string | null;
170
+ primary_color_hex: string | null;
171
+ manufacturer_model_id: string | null;
172
+ asin: string | null;
173
+ gtins: unknown;
174
+ marketplace_listings: unknown;
175
+ sort_order: number;
176
+ images: DeviceAsset[];
177
+ created_at: string;
178
+ updated_at: string;
179
+ }
180
+ export interface DeviceModel {
181
+ device_model_id: string;
182
+ slug: string;
183
+ display_name: string | null;
184
+ description_md: string | null;
185
+ product_url: string | null;
186
+ is_forbidden_to_3dparty: boolean | null;
187
+ no_longer_sold: boolean | null;
188
+ shop_listings: unknown;
189
+ last_commerce_search_at: string | null;
190
+ manufacturer: ManufacturerRef | null;
191
+ device_type: DeviceTypeRef | null;
192
+ device_type_properties: unknown;
193
+ variants: DeviceModelVariant[];
194
+ featured_image: DeviceAsset | null;
195
+ providers: ProviderRef[];
196
+ capabilities_by_provider: ProviderCapabilities[];
197
+ capabilities_stale: boolean;
198
+ created_at: string;
199
+ updated_at: string;
200
+ }
201
+ export interface DeviceImageFormat {
202
+ url: string;
203
+ width: number | null;
204
+ height: number | null;
205
+ }
206
+ export interface DeviceImage {
207
+ url: string;
208
+ mime: string | null;
209
+ width: number | null;
210
+ height: number | null;
211
+ formats: Partial<Record<MediaFormatName, DeviceImageFormat>>;
212
+ }
213
+ export interface CapabilitySummary {
214
+ name: CapabilityName;
215
+ supported: CapabilitySupported;
216
+ integration_support_level: IntegrationSupportLevel | null;
217
+ report: CapabilityReport | null;
218
+ }
219
+ export interface DeviceModelSummaryVariant {
220
+ device_model_variant_id: string;
221
+ color_name: string | null;
222
+ style_name: string | null;
223
+ primary_color_hex: string | null;
224
+ manufacturer_model_id: string | null;
225
+ images: DeviceImage[];
226
+ /** Only with `include=commerce`. */
227
+ asin?: string | null;
228
+ /** Only with `include=commerce`. */
229
+ gtins?: unknown;
230
+ /** Only with `include=commerce`. */
231
+ marketplace_listings?: unknown;
232
+ }
233
+ export interface DeviceModelSummary {
234
+ device_model_id: string;
235
+ slug: string;
236
+ display_name: string | null;
237
+ description_md: string | null;
238
+ product_url: string | null;
239
+ no_longer_sold: boolean | null;
240
+ is_forbidden_to_3dparty: boolean | null;
241
+ manufacturer: ManufacturerRef | null;
242
+ device_type: DeviceTypeRef | null;
243
+ device_type_properties: unknown;
244
+ featured_image: DeviceImage | null;
245
+ variants: DeviceModelSummaryVariant[];
246
+ providers: ProviderRef[];
247
+ capabilities_by_provider: Array<{
248
+ provider: ProviderRef;
249
+ capabilities: CapabilitySummary[];
250
+ }>;
251
+ capabilities_stale: boolean;
252
+ /** Only with `include=commerce`. */
253
+ shop_listings?: unknown;
254
+ /** Only with `include=commerce`. */
255
+ last_commerce_search_at?: string | null;
256
+ updated_at: string;
257
+ }
258
+ export interface ManufacturerDefaultDeviceImage {
259
+ device_type: DeviceTypeRef;
260
+ asset: DeviceAsset;
261
+ }
262
+ export interface Manufacturer {
263
+ manufacturer_id: string;
264
+ slug: string;
265
+ display_name: string | null;
266
+ website: string | null;
267
+ headquarters: string | null;
268
+ country_of_origin: string | null;
269
+ parent_org: string | null;
270
+ inc_date: string | null;
271
+ customer_support_phone: string | null;
272
+ customer_support_email: string | null;
273
+ customer_support_url: string | null;
274
+ description_md: string | null;
275
+ seam_api_guide: string | null;
276
+ commerce_footprint: unknown;
277
+ last_commerce_search_at: string | null;
278
+ logos: DeviceAsset[];
279
+ default_device_images: ManufacturerDefaultDeviceImage[];
280
+ providers: ProviderRef[];
281
+ device_model_count: number;
282
+ created_at: string;
283
+ updated_at: string;
284
+ }
285
+ export interface Pagination {
286
+ has_next_page: boolean;
287
+ next_page_cursor: string | null;
288
+ }
289
+ export interface CompatibilityResponse {
290
+ partners: CompatiblePartner[];
291
+ }
292
+ export interface DeviceModelsListResponse {
293
+ device_models: DeviceModel[];
294
+ pagination: Pagination;
295
+ }
296
+ export interface DeviceModelSummariesListResponse {
297
+ device_models: DeviceModelSummary[];
298
+ pagination: Pagination;
299
+ }
300
+ export interface ManufacturersListResponse {
301
+ manufacturers: Manufacturer[];
302
+ pagination: Pagination;
303
+ }
304
+ export interface EcosystemErrorResponse {
305
+ ok: false;
306
+ error: {
307
+ type: string;
308
+ message: string;
309
+ data?: Record<string, unknown>;
310
+ request_id?: string;
311
+ };
312
+ }
@@ -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 055335c, 2026-10-17) 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,11 @@
1
+ import type { DeviceModelSummary } from '../../../lib/seam/ecosystem/types.js';
2
+ import type { UseEcosystemDeviceModelsParams } from '../../../lib/seam/ecosystem/use-ecosystem-device-models.js';
3
+ import { type UseEcosystemQueryResult } from '../../../lib/seam/ecosystem/use-ecosystem-query-result.js';
4
+ export type UseEcosystemDeviceModelSummariesParams = UseEcosystemDeviceModelsParams;
5
+ export type UseEcosystemDeviceModelSummariesData = DeviceModelSummary[];
6
+ /**
7
+ * Published device models in the slim summary shape from Ecosystem
8
+ * `GET /v1/device_models/summaries/list` (no commerce data),
9
+ * following pagination to return every matching model.
10
+ */
11
+ export declare function useEcosystemDeviceModelSummaries({ manufacturer, deviceType, provider, capability, enabled, }?: UseEcosystemDeviceModelSummariesParams): UseEcosystemQueryResult<'deviceModels', UseEcosystemDeviceModelSummariesData>;
@@ -0,0 +1,53 @@
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 in the slim summary shape from Ecosystem
9
+ * `GET /v1/device_models/summaries/list` (no commerce data),
10
+ * following pagination to return every matching model.
11
+ */
12
+ export function useEcosystemDeviceModelSummaries({ manufacturer = '', deviceType = '', provider = '', capability = '', enabled = true, } = {}) {
13
+ const { embedKey, endpoint } = useEcosystemContext();
14
+ const params = {
15
+ manufacturer: manufacturer.trim(),
16
+ device_type: deviceType.trim(),
17
+ provider: provider.trim(),
18
+ capability: capability.trim(),
19
+ };
20
+ const { data, ...rest } = useQuery({
21
+ enabled,
22
+ queryKey: [
23
+ 'ecosystem',
24
+ endpoint,
25
+ embedKey ?? null,
26
+ 'device_models',
27
+ 'summaries',
28
+ 'list',
29
+ params,
30
+ ],
31
+ queryFn: async ({ signal }) => {
32
+ const deviceModels = [];
33
+ let pageCursor;
34
+ for (let page = 0; page < maxPages; page++) {
35
+ const res = await fetchEcosystem('device_models/summaries/list', {
36
+ endpoint,
37
+ embedKey,
38
+ params: { ...params, limit: pageSize, page_cursor: pageCursor },
39
+ signal,
40
+ });
41
+ deviceModels.push(...res.device_models);
42
+ const { has_next_page: hasNextPage, next_page_cursor: nextPageCursor } = res.pagination;
43
+ if (!hasNextPage || nextPageCursor == null)
44
+ break;
45
+ pageCursor = nextPageCursor;
46
+ }
47
+ return deviceModels;
48
+ },
49
+ retry: retryEcosystemQuery,
50
+ });
51
+ return { ...rest, deviceModels: data };
52
+ }
53
+ //# sourceMappingURL=use-ecosystem-device-model-summaries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-ecosystem-device-model-summaries.js","sourceRoot":"","sources":["../../../src/lib/seam/ecosystem/use-ecosystem-device-model-summaries.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;AAM7E,OAAO,EACL,mBAAmB,GAEpB,MAAM,kDAAkD,CAAA;AAOzD,MAAM,QAAQ,GAAG,GAAG,CAAA;AACpB,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAAC,EAC/C,YAAY,GAAG,EAAE,EACjB,UAAU,GAAG,EAAE,EACf,QAAQ,GAAG,EAAE,EACb,UAAU,GAAG,EAAE,EACf,OAAO,GAAG,IAAI,MAC4B,EAAE;IAI5C,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,WAAW;YACX,MAAM;YACN,MAAM;SACP;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5B,MAAM,YAAY,GAAyB,EAAE,CAAA;YAC7C,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,8BAA8B,EAC9B;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,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;