@seedgrid/fe-core 2026.4.18 → 2026.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/seedgrid-core.manifest.json +649 -0
- package/dist/http/api-client.d.ts +50 -0
- package/dist/http/api-client.d.ts.map +1 -0
- package/dist/http/api-client.js +281 -0
- package/dist/http/api-client.meta.d.ts +61 -0
- package/dist/http/api-client.meta.d.ts.map +1 -0
- package/dist/http/api-client.meta.js +99 -0
- package/dist/http/api-exception-handler.d.ts +15 -0
- package/dist/http/api-exception-handler.d.ts.map +1 -0
- package/dist/http/api-exception-handler.js +53 -0
- package/dist/http/api-exception-handler.meta.d.ts +61 -0
- package/dist/http/api-exception-handler.meta.d.ts.map +1 -0
- package/dist/http/api-exception-handler.meta.js +57 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/persistence-api.meta.d.ts +61 -0
- package/dist/persistence-api.meta.d.ts.map +1 -0
- package/dist/persistence-api.meta.js +73 -0
- package/dist/persistence-composite.meta.d.ts +61 -0
- package/dist/persistence-composite.meta.d.ts.map +1 -0
- package/dist/persistence-composite.meta.js +69 -0
- package/dist/persistence-localstorage.meta.d.ts +61 -0
- package/dist/persistence-localstorage.meta.d.ts.map +1 -0
- package/dist/persistence-localstorage.meta.js +55 -0
- package/dist/registry.meta.d.ts +61 -0
- package/dist/registry.meta.d.ts.map +1 -0
- package/dist/registry.meta.js +85 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "0.1",
|
|
3
|
+
"package": "@seedgrid/fe-core",
|
|
4
|
+
"packageVersion": "0.2.0",
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"componentId": "provider.registry",
|
|
8
|
+
"exportName": "SeedGridRegistry",
|
|
9
|
+
"sgMeta": {
|
|
10
|
+
"version": "0.1",
|
|
11
|
+
"componentId": "provider.registry",
|
|
12
|
+
"package": "@seedgrid/fe-core",
|
|
13
|
+
"exportName": "SeedGridRegistry",
|
|
14
|
+
"slug": "seedgrid-registry",
|
|
15
|
+
"displayName": "SeedGrid Registry",
|
|
16
|
+
"category": "provider",
|
|
17
|
+
"subcategory": "registry",
|
|
18
|
+
"description": "Centralized provider and route registry for modular SeedGrid applications. Manages composition of providers, navigation items, and routes with ordering support.",
|
|
19
|
+
"tags": [
|
|
20
|
+
"registry",
|
|
21
|
+
"provider",
|
|
22
|
+
"composition",
|
|
23
|
+
"modular",
|
|
24
|
+
"architecture"
|
|
25
|
+
],
|
|
26
|
+
"capabilities": [
|
|
27
|
+
"navItem",
|
|
28
|
+
"provider",
|
|
29
|
+
"route",
|
|
30
|
+
"ordering"
|
|
31
|
+
],
|
|
32
|
+
"fieldSemantics": [
|
|
33
|
+
"registry",
|
|
34
|
+
"composition",
|
|
35
|
+
"navigation"
|
|
36
|
+
],
|
|
37
|
+
"props": [
|
|
38
|
+
{
|
|
39
|
+
"name": "addProvider",
|
|
40
|
+
"type": "(provider: SeedGridProvider) => void",
|
|
41
|
+
"required": true,
|
|
42
|
+
"description": "Register a React provider component (context wrapper).",
|
|
43
|
+
"semanticRole": "behavior"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "addNavItem",
|
|
47
|
+
"type": "(item: SeedGridNavItem) => void",
|
|
48
|
+
"required": true,
|
|
49
|
+
"description": "Register a navigation item with id, labelKey, href, optional icon and order.",
|
|
50
|
+
"semanticRole": "behavior"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "addRoute",
|
|
54
|
+
"type": "(route: SeedGridRoute) => void",
|
|
55
|
+
"required": true,
|
|
56
|
+
"description": "Register an application route with id, path, and auth requirements.",
|
|
57
|
+
"semanticRole": "behavior"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "getProviders",
|
|
61
|
+
"type": "() => SeedGridProvider[]",
|
|
62
|
+
"required": true,
|
|
63
|
+
"description": "Retrieve all registered providers as a flat array.",
|
|
64
|
+
"semanticRole": "behavior"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "getNavItems",
|
|
68
|
+
"type": "() => SeedGridNavItem[]",
|
|
69
|
+
"required": true,
|
|
70
|
+
"description": "Retrieve all registered navigation items sorted by order (default 999).",
|
|
71
|
+
"semanticRole": "behavior"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "getRoutes",
|
|
75
|
+
"type": "() => SeedGridRoute[]",
|
|
76
|
+
"required": true,
|
|
77
|
+
"description": "Retrieve all registered routes.",
|
|
78
|
+
"semanticRole": "behavior"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"states": [
|
|
82
|
+
"initialized",
|
|
83
|
+
"empty",
|
|
84
|
+
"populated"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"aiHints": {
|
|
88
|
+
"version": "0.1",
|
|
89
|
+
"preferredUseCases": [
|
|
90
|
+
"Modular application architecture where features register themselves independently.",
|
|
91
|
+
"Dynamic provider composition to avoid prop drilling and provider hell.",
|
|
92
|
+
"Centralized routing and navigation configuration across modules."
|
|
93
|
+
],
|
|
94
|
+
"avoidUseCases": [
|
|
95
|
+
"Simple single-feature applications that don't need modular composition.",
|
|
96
|
+
"Direct React Context usage when a single provider suffices."
|
|
97
|
+
],
|
|
98
|
+
"synonyms": [
|
|
99
|
+
"module registry",
|
|
100
|
+
"provider registry",
|
|
101
|
+
"app composer",
|
|
102
|
+
"navigation builder"
|
|
103
|
+
],
|
|
104
|
+
"relatedEntityFields": [
|
|
105
|
+
"module",
|
|
106
|
+
"provider",
|
|
107
|
+
"navigation",
|
|
108
|
+
"route",
|
|
109
|
+
"composition"
|
|
110
|
+
],
|
|
111
|
+
"compositionHints": [
|
|
112
|
+
"Registry is typically paired with SeedGridModuleManifest for self-contained module definitions.",
|
|
113
|
+
"Providers registered to the registry should be wrapped to inject dependencies from environment/core.",
|
|
114
|
+
"Order-based nav item sorting enables feature modules to control their menu position without cross-module coupling."
|
|
115
|
+
],
|
|
116
|
+
"rankingSignals": {
|
|
117
|
+
"freeText": 0.3,
|
|
118
|
+
"structuredChoice": 0.4,
|
|
119
|
+
"date": 0,
|
|
120
|
+
"number": 0,
|
|
121
|
+
"denseLayout": 0.2
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"componentId": "hook.persistence-localstorage",
|
|
127
|
+
"exportName": "createLocalStorageStrategy",
|
|
128
|
+
"sgMeta": {
|
|
129
|
+
"version": "0.1",
|
|
130
|
+
"componentId": "hook.persistence-localstorage",
|
|
131
|
+
"package": "@seedgrid/fe-core",
|
|
132
|
+
"exportName": "createLocalStorageStrategy",
|
|
133
|
+
"slug": "create-localstorage-strategy",
|
|
134
|
+
"displayName": "Local Storage Persistence Strategy",
|
|
135
|
+
"category": "hook",
|
|
136
|
+
"subcategory": "persistence",
|
|
137
|
+
"description": "Creates a persistence strategy that stores and retrieves application state from browser localStorage with optional key prefix.",
|
|
138
|
+
"tags": [
|
|
139
|
+
"persistence",
|
|
140
|
+
"storage",
|
|
141
|
+
"state",
|
|
142
|
+
"localStorage",
|
|
143
|
+
"browser"
|
|
144
|
+
],
|
|
145
|
+
"capabilities": [
|
|
146
|
+
"persistence",
|
|
147
|
+
"offline",
|
|
148
|
+
"browser-native"
|
|
149
|
+
],
|
|
150
|
+
"fieldSemantics": [
|
|
151
|
+
"state",
|
|
152
|
+
"persistence",
|
|
153
|
+
"storage"
|
|
154
|
+
],
|
|
155
|
+
"props": [
|
|
156
|
+
{
|
|
157
|
+
"name": "options",
|
|
158
|
+
"type": "{ prefix?: string }",
|
|
159
|
+
"required": false,
|
|
160
|
+
"description": "Optional configuration: prefix for localStorage keys (default: no prefix).",
|
|
161
|
+
"semanticRole": "data"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"states": [
|
|
165
|
+
"ready",
|
|
166
|
+
"loading",
|
|
167
|
+
"error"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"aiHints": {
|
|
171
|
+
"version": "0.1",
|
|
172
|
+
"preferredUseCases": [
|
|
173
|
+
"Client-side application state persistence across browser sessions.",
|
|
174
|
+
"Caching user preferences, form state, or temporary data in the browser.",
|
|
175
|
+
"Single-origin applications where cross-origin data sharing is not needed."
|
|
176
|
+
],
|
|
177
|
+
"avoidUseCases": [
|
|
178
|
+
"Sensitive data (passwords, tokens) — use secure server-side persistence instead.",
|
|
179
|
+
"Large datasets that exceed localStorage limit (~5-10MB per origin).",
|
|
180
|
+
"Server-synchronized state that requires real-time consistency across tabs."
|
|
181
|
+
],
|
|
182
|
+
"synonyms": [
|
|
183
|
+
"browser persistence",
|
|
184
|
+
"local storage strategy",
|
|
185
|
+
"client-side state storage"
|
|
186
|
+
],
|
|
187
|
+
"relatedEntityFields": [
|
|
188
|
+
"persistence",
|
|
189
|
+
"state",
|
|
190
|
+
"storage",
|
|
191
|
+
"caching"
|
|
192
|
+
],
|
|
193
|
+
"compositionHints": [
|
|
194
|
+
"Use prefix option to namespace data when multiple apps share the same origin.",
|
|
195
|
+
"Combine with createCompositePersistenceStrategy to fall back to API persistence on failure.",
|
|
196
|
+
"State should be serializable to JSON — complex objects are converted via stringify."
|
|
197
|
+
],
|
|
198
|
+
"rankingSignals": {
|
|
199
|
+
"freeText": 0.2,
|
|
200
|
+
"structuredChoice": 0.3,
|
|
201
|
+
"date": 0,
|
|
202
|
+
"number": 0,
|
|
203
|
+
"denseLayout": 0.1
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"componentId": "hook.persistence-api",
|
|
209
|
+
"exportName": "createApiPersistenceStrategy",
|
|
210
|
+
"sgMeta": {
|
|
211
|
+
"version": "0.1",
|
|
212
|
+
"componentId": "hook.persistence-api",
|
|
213
|
+
"package": "@seedgrid/fe-core",
|
|
214
|
+
"exportName": "createApiPersistenceStrategy",
|
|
215
|
+
"slug": "create-api-persistence-strategy",
|
|
216
|
+
"displayName": "API Persistence Strategy",
|
|
217
|
+
"category": "hook",
|
|
218
|
+
"subcategory": "persistence",
|
|
219
|
+
"description": "Creates a persistence strategy that syncs application state with a backend API endpoint. Supports custom fetch implementations and versioned state.",
|
|
220
|
+
"tags": [
|
|
221
|
+
"persistence",
|
|
222
|
+
"api",
|
|
223
|
+
"state",
|
|
224
|
+
"server",
|
|
225
|
+
"sync"
|
|
226
|
+
],
|
|
227
|
+
"capabilities": [
|
|
228
|
+
"persistence",
|
|
229
|
+
"server-sync",
|
|
230
|
+
"versioned-state"
|
|
231
|
+
],
|
|
232
|
+
"fieldSemantics": [
|
|
233
|
+
"state",
|
|
234
|
+
"persistence",
|
|
235
|
+
"api",
|
|
236
|
+
"backend"
|
|
237
|
+
],
|
|
238
|
+
"props": [
|
|
239
|
+
{
|
|
240
|
+
"name": "baseUrl",
|
|
241
|
+
"type": "string",
|
|
242
|
+
"required": true,
|
|
243
|
+
"description": "Base URL of the persistence API (e.g. https://api.example.com/state).",
|
|
244
|
+
"semanticRole": "data"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "fetcher",
|
|
248
|
+
"type": "(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>",
|
|
249
|
+
"required": false,
|
|
250
|
+
"description": "Custom fetch implementation (default: global fetch). Useful for adding auth headers.",
|
|
251
|
+
"semanticRole": "behavior"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "scope",
|
|
255
|
+
"type": "string",
|
|
256
|
+
"required": true,
|
|
257
|
+
"description": "Scope/namespace for the persisted state (e.g. 'app.dashboard', 'user.preferences').",
|
|
258
|
+
"semanticRole": "data"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "stateVersion",
|
|
262
|
+
"type": "number",
|
|
263
|
+
"required": true,
|
|
264
|
+
"description": "Version number of the state schema. Increment when structure changes.",
|
|
265
|
+
"semanticRole": "data"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
"states": [
|
|
269
|
+
"ready",
|
|
270
|
+
"loading",
|
|
271
|
+
"syncing",
|
|
272
|
+
"error"
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
"aiHints": {
|
|
276
|
+
"version": "0.1",
|
|
277
|
+
"preferredUseCases": [
|
|
278
|
+
"Synchronizing application state with a backend server across sessions and devices.",
|
|
279
|
+
"Multi-device sync where a user's state updates on all their devices.",
|
|
280
|
+
"Server-side state versioning and schema evolution."
|
|
281
|
+
],
|
|
282
|
+
"avoidUseCases": [
|
|
283
|
+
"Offline-first applications — use localStorage first, then API (composite strategy).",
|
|
284
|
+
"High-frequency state updates that would overwhelm the server.",
|
|
285
|
+
"Real-time collaborative editing — use WebSocket-based persistence instead."
|
|
286
|
+
],
|
|
287
|
+
"synonyms": [
|
|
288
|
+
"server persistence",
|
|
289
|
+
"API state sync",
|
|
290
|
+
"backend storage"
|
|
291
|
+
],
|
|
292
|
+
"relatedEntityFields": [
|
|
293
|
+
"persistence",
|
|
294
|
+
"state",
|
|
295
|
+
"api",
|
|
296
|
+
"backend",
|
|
297
|
+
"sync"
|
|
298
|
+
],
|
|
299
|
+
"compositionHints": [
|
|
300
|
+
"Provide a custom fetcher that injects authorization headers if the API requires authentication.",
|
|
301
|
+
"Use scope to separate user preferences, app state, form cache, etc. on the server.",
|
|
302
|
+
"Increment stateVersion when the state shape changes to handle schema migrations.",
|
|
303
|
+
"Pair with createCompositePersistenceStrategy (localStorage primary, API fallback) for resilience."
|
|
304
|
+
],
|
|
305
|
+
"rankingSignals": {
|
|
306
|
+
"freeText": 0.25,
|
|
307
|
+
"structuredChoice": 0.35,
|
|
308
|
+
"date": 0,
|
|
309
|
+
"number": 0,
|
|
310
|
+
"denseLayout": 0.1
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"componentId": "hook.persistence-composite",
|
|
316
|
+
"exportName": "createCompositePersistenceStrategy",
|
|
317
|
+
"sgMeta": {
|
|
318
|
+
"version": "0.1",
|
|
319
|
+
"componentId": "hook.persistence-composite",
|
|
320
|
+
"package": "@seedgrid/fe-core",
|
|
321
|
+
"exportName": "createCompositePersistenceStrategy",
|
|
322
|
+
"slug": "create-composite-persistence-strategy",
|
|
323
|
+
"displayName": "Composite Persistence Strategy",
|
|
324
|
+
"category": "hook",
|
|
325
|
+
"subcategory": "persistence",
|
|
326
|
+
"description": "Combines two persistence strategies (primary and secondary) with configurable fallback behavior: strict (primary only), fallback (try primary, use secondary on error), or mirror (sync to both simultaneously).",
|
|
327
|
+
"tags": [
|
|
328
|
+
"persistence",
|
|
329
|
+
"composite",
|
|
330
|
+
"fallback",
|
|
331
|
+
"resilience",
|
|
332
|
+
"state"
|
|
333
|
+
],
|
|
334
|
+
"capabilities": [
|
|
335
|
+
"persistence",
|
|
336
|
+
"fallback",
|
|
337
|
+
"resilience",
|
|
338
|
+
"dual-strategy"
|
|
339
|
+
],
|
|
340
|
+
"fieldSemantics": [
|
|
341
|
+
"state",
|
|
342
|
+
"persistence",
|
|
343
|
+
"composition"
|
|
344
|
+
],
|
|
345
|
+
"props": [
|
|
346
|
+
{
|
|
347
|
+
"name": "mode",
|
|
348
|
+
"type": "'strict' | 'fallback' | 'mirror'",
|
|
349
|
+
"required": true,
|
|
350
|
+
"description": "Mode: 'strict' uses primary only, 'fallback' falls back to secondary on error, 'mirror' syncs to both.",
|
|
351
|
+
"semanticRole": "data"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"name": "primary",
|
|
355
|
+
"type": "PersistenceStrategy",
|
|
356
|
+
"required": true,
|
|
357
|
+
"description": "First-choice persistence strategy (e.g. localStorage for fast local access).",
|
|
358
|
+
"semanticRole": "behavior"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"name": "secondary",
|
|
362
|
+
"type": "PersistenceStrategy",
|
|
363
|
+
"required": true,
|
|
364
|
+
"description": "Fallback or mirror strategy (e.g. API persistence for server sync).",
|
|
365
|
+
"semanticRole": "behavior"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"states": [
|
|
369
|
+
"ready",
|
|
370
|
+
"loading",
|
|
371
|
+
"syncing",
|
|
372
|
+
"error"
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
"aiHints": {
|
|
376
|
+
"version": "0.1",
|
|
377
|
+
"preferredUseCases": [
|
|
378
|
+
"Resilient offline-first apps: localStorage primary, API fallback.",
|
|
379
|
+
"Multi-destination state sync: keep local cache and server in sync simultaneously.",
|
|
380
|
+
"Gradual migration: run old persistence (primary) and new (secondary) in parallel to validate."
|
|
381
|
+
],
|
|
382
|
+
"avoidUseCases": [
|
|
383
|
+
"Simple applications with only one persistence backend.",
|
|
384
|
+
"High-frequency updates to avoid bottleneck of syncing both strategies."
|
|
385
|
+
],
|
|
386
|
+
"synonyms": [
|
|
387
|
+
"dual persistence",
|
|
388
|
+
"fallback persistence",
|
|
389
|
+
"hybrid storage",
|
|
390
|
+
"resilient persistence"
|
|
391
|
+
],
|
|
392
|
+
"relatedEntityFields": [
|
|
393
|
+
"persistence",
|
|
394
|
+
"state",
|
|
395
|
+
"fallback",
|
|
396
|
+
"resilience"
|
|
397
|
+
],
|
|
398
|
+
"compositionHints": [
|
|
399
|
+
"Typical offline-first: createLocalStorageStrategy as primary, createApiPersistenceStrategy as secondary with fallback mode.",
|
|
400
|
+
"Mirror mode enables live sync across devices: load from local cache immediately, update server in background.",
|
|
401
|
+
"Fallback mode gracefully degrades when API is unavailable — app stays functional using localStorage."
|
|
402
|
+
],
|
|
403
|
+
"rankingSignals": {
|
|
404
|
+
"freeText": 0.2,
|
|
405
|
+
"structuredChoice": 0.4,
|
|
406
|
+
"date": 0,
|
|
407
|
+
"number": 0,
|
|
408
|
+
"denseLayout": 0.15
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"componentId": "factory.api-client",
|
|
414
|
+
"exportName": "createApiClient",
|
|
415
|
+
"sgMeta": {
|
|
416
|
+
"version": "0.1",
|
|
417
|
+
"componentId": "factory.api-client",
|
|
418
|
+
"package": "@seedgrid/fe-core",
|
|
419
|
+
"exportName": "createApiClient",
|
|
420
|
+
"slug": "create-api-client",
|
|
421
|
+
"displayName": "API Client Factory",
|
|
422
|
+
"category": "factory",
|
|
423
|
+
"subcategory": "http",
|
|
424
|
+
"description": "Factory function that creates a fetch-based API client with auth token injection, retry policies, response parsing, cURL debug output, and typed request helpers.",
|
|
425
|
+
"tags": [
|
|
426
|
+
"api",
|
|
427
|
+
"http",
|
|
428
|
+
"fetch",
|
|
429
|
+
"auth",
|
|
430
|
+
"retry",
|
|
431
|
+
"json"
|
|
432
|
+
],
|
|
433
|
+
"capabilities": [
|
|
434
|
+
"get",
|
|
435
|
+
"post",
|
|
436
|
+
"put",
|
|
437
|
+
"patch",
|
|
438
|
+
"delete",
|
|
439
|
+
"refresh-token",
|
|
440
|
+
"response-parse",
|
|
441
|
+
"query-params"
|
|
442
|
+
],
|
|
443
|
+
"fieldSemantics": [
|
|
444
|
+
"api",
|
|
445
|
+
"request",
|
|
446
|
+
"authentication",
|
|
447
|
+
"retry",
|
|
448
|
+
"error-handling"
|
|
449
|
+
],
|
|
450
|
+
"props": [
|
|
451
|
+
{
|
|
452
|
+
"name": "baseUrl",
|
|
453
|
+
"type": "string",
|
|
454
|
+
"required": true,
|
|
455
|
+
"description": "Base URL used to resolve relative API paths.",
|
|
456
|
+
"semanticRole": "data"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"name": "getAccessToken",
|
|
460
|
+
"type": "() => Promise<string | null>",
|
|
461
|
+
"required": false,
|
|
462
|
+
"description": "Async callback used to read the current access token before authenticated requests.",
|
|
463
|
+
"semanticRole": "behavior"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "refreshAccessToken",
|
|
467
|
+
"type": "() => Promise<string | null>",
|
|
468
|
+
"required": false,
|
|
469
|
+
"description": "Async callback used after a 401 to obtain a fresh access token and retry once.",
|
|
470
|
+
"semanticRole": "behavior"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "defaultHeaders",
|
|
474
|
+
"type": "HeadersInit",
|
|
475
|
+
"required": false,
|
|
476
|
+
"description": "Headers merged into every request before per-request overrides.",
|
|
477
|
+
"semanticRole": "data"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"name": "defaultCache",
|
|
481
|
+
"type": "RequestCache",
|
|
482
|
+
"required": false,
|
|
483
|
+
"description": "Default fetch cache mode used when a request does not override cache.",
|
|
484
|
+
"semanticRole": "behavior"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"name": "defaultNext",
|
|
488
|
+
"type": "{ revalidate?: false | number; tags?: string[] }",
|
|
489
|
+
"required": false,
|
|
490
|
+
"description": "Next.js fetch options reused across requests.",
|
|
491
|
+
"semanticRole": "behavior"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "onAuthFailure",
|
|
495
|
+
"type": "(context: ExceptionContext) => void | Promise<void>",
|
|
496
|
+
"required": false,
|
|
497
|
+
"description": "Optional callback fired when an authenticated request still fails with 401.",
|
|
498
|
+
"semanticRole": "event"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "onException",
|
|
502
|
+
"type": "(error: Error, context: ExceptionContext) => void | Promise<void>",
|
|
503
|
+
"required": false,
|
|
504
|
+
"description": "Optional callback invoked before captured API exceptions are rethrown.",
|
|
505
|
+
"semanticRole": "event"
|
|
506
|
+
}
|
|
507
|
+
],
|
|
508
|
+
"states": [
|
|
509
|
+
"ready",
|
|
510
|
+
"requesting",
|
|
511
|
+
"retrying",
|
|
512
|
+
"failed"
|
|
513
|
+
]
|
|
514
|
+
},
|
|
515
|
+
"aiHints": {
|
|
516
|
+
"version": "0.1",
|
|
517
|
+
"preferredUseCases": [
|
|
518
|
+
"Server or client HTTP access where auth tokens, retries, and typed JSON parsing should be standardized.",
|
|
519
|
+
"Application modules that need consistent GET/POST/PUT/PATCH/DELETE helpers instead of ad hoc fetch calls.",
|
|
520
|
+
"Next.js integrations that need cache/next options to flow through a shared API layer."
|
|
521
|
+
],
|
|
522
|
+
"avoidUseCases": [
|
|
523
|
+
"Very small one-off fetch calls where a dedicated client adds no value.",
|
|
524
|
+
"Streaming or multipart-heavy workflows that need low-level fetch control."
|
|
525
|
+
],
|
|
526
|
+
"synonyms": [
|
|
527
|
+
"api client",
|
|
528
|
+
"fetch wrapper",
|
|
529
|
+
"http client",
|
|
530
|
+
"authenticated fetch",
|
|
531
|
+
"request factory"
|
|
532
|
+
],
|
|
533
|
+
"relatedEntityFields": [
|
|
534
|
+
"api",
|
|
535
|
+
"request",
|
|
536
|
+
"auth",
|
|
537
|
+
"token",
|
|
538
|
+
"retry",
|
|
539
|
+
"http"
|
|
540
|
+
],
|
|
541
|
+
"compositionHints": [
|
|
542
|
+
"Pair createApiClient with captureException or module-level error translation when surfacing server errors to the UI.",
|
|
543
|
+
"Use requireAuth: false for public endpoints; leave it enabled by default for private endpoints.",
|
|
544
|
+
"Use parseAs: 'response' when the caller needs raw headers or binary body handling."
|
|
545
|
+
],
|
|
546
|
+
"rankingSignals": {
|
|
547
|
+
"freeText": 0.35,
|
|
548
|
+
"structuredChoice": 0.3,
|
|
549
|
+
"date": 0,
|
|
550
|
+
"number": 0.05,
|
|
551
|
+
"denseLayout": 0.1
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"componentId": "utility.exception-capture",
|
|
557
|
+
"exportName": "captureException",
|
|
558
|
+
"sgMeta": {
|
|
559
|
+
"version": "0.1",
|
|
560
|
+
"componentId": "utility.exception-capture",
|
|
561
|
+
"package": "@seedgrid/fe-core",
|
|
562
|
+
"exportName": "captureException",
|
|
563
|
+
"slug": "capture-exception",
|
|
564
|
+
"displayName": "Exception Capture",
|
|
565
|
+
"category": "utility",
|
|
566
|
+
"subcategory": "error-handling",
|
|
567
|
+
"description": "Captures, normalizes, deduplicates, and reports exceptions through registered reporters with contextual metadata.",
|
|
568
|
+
"tags": [
|
|
569
|
+
"error",
|
|
570
|
+
"exception",
|
|
571
|
+
"reporting",
|
|
572
|
+
"observability",
|
|
573
|
+
"guard"
|
|
574
|
+
],
|
|
575
|
+
"capabilities": [
|
|
576
|
+
"normalize-error",
|
|
577
|
+
"deduplicate",
|
|
578
|
+
"reporter-pipeline",
|
|
579
|
+
"context-metadata"
|
|
580
|
+
],
|
|
581
|
+
"fieldSemantics": [
|
|
582
|
+
"error",
|
|
583
|
+
"exception",
|
|
584
|
+
"context",
|
|
585
|
+
"reporting"
|
|
586
|
+
],
|
|
587
|
+
"props": [
|
|
588
|
+
{
|
|
589
|
+
"name": "error",
|
|
590
|
+
"type": "unknown",
|
|
591
|
+
"required": true,
|
|
592
|
+
"description": "Unknown thrown value that will be normalized into an Error instance.",
|
|
593
|
+
"semanticRole": "data"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"name": "context",
|
|
597
|
+
"type": "ExceptionContext",
|
|
598
|
+
"required": false,
|
|
599
|
+
"description": "Optional metadata describing area, source, HTTP status, retryability, and extra attributes.",
|
|
600
|
+
"semanticRole": "data"
|
|
601
|
+
}
|
|
602
|
+
],
|
|
603
|
+
"states": [
|
|
604
|
+
"idle",
|
|
605
|
+
"captured",
|
|
606
|
+
"reported",
|
|
607
|
+
"deduplicated"
|
|
608
|
+
]
|
|
609
|
+
},
|
|
610
|
+
"aiHints": {
|
|
611
|
+
"version": "0.1",
|
|
612
|
+
"preferredUseCases": [
|
|
613
|
+
"Centralized exception capture from UI events, async actions, and API failures.",
|
|
614
|
+
"Server or client flows that should log/report errors with structured context before rethrowing or translating them.",
|
|
615
|
+
"Wrapping actions with runGuarded to standardize error capture without repeating try/catch boilerplate."
|
|
616
|
+
],
|
|
617
|
+
"avoidUseCases": [
|
|
618
|
+
"User-facing validation branches that are expected control flow rather than real exceptions.",
|
|
619
|
+
"Hot paths where repeated non-error control flow would spam the reporter pipeline."
|
|
620
|
+
],
|
|
621
|
+
"synonyms": [
|
|
622
|
+
"error capture",
|
|
623
|
+
"exception reporter",
|
|
624
|
+
"error guard",
|
|
625
|
+
"run guarded"
|
|
626
|
+
],
|
|
627
|
+
"relatedEntityFields": [
|
|
628
|
+
"error",
|
|
629
|
+
"exception",
|
|
630
|
+
"status",
|
|
631
|
+
"source",
|
|
632
|
+
"reporting"
|
|
633
|
+
],
|
|
634
|
+
"compositionHints": [
|
|
635
|
+
"Register reporters at app bootstrap, then call captureException from feature modules instead of logging ad hoc.",
|
|
636
|
+
"Use runGuarded around async actions that should always capture and rethrow unexpected failures.",
|
|
637
|
+
"Use suppressException when an error was intentionally handled and should not be reported again."
|
|
638
|
+
],
|
|
639
|
+
"rankingSignals": {
|
|
640
|
+
"freeText": 0.3,
|
|
641
|
+
"structuredChoice": 0.25,
|
|
642
|
+
"date": 0,
|
|
643
|
+
"number": 0,
|
|
644
|
+
"denseLayout": 0.05
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
]
|
|
649
|
+
}
|