@seedgrid/fe-commons 2026.4.19 → 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.
@@ -0,0 +1,284 @@
1
+ {
2
+ "schemaVersion": "0.1",
3
+ "package": "@seedgrid/fe-commons",
4
+ "packageVersion": "0.2.0",
5
+ "components": [
6
+ {
7
+ "componentId": "hook.http-client",
8
+ "exportName": "createHttpClient",
9
+ "sgMeta": {
10
+ "version": "0.1",
11
+ "componentId": "hook.http-client",
12
+ "package": "@seedgrid/fe-commons",
13
+ "exportName": "createHttpClient",
14
+ "slug": "create-http-client",
15
+ "displayName": "HTTP Client Factory",
16
+ "category": "hook",
17
+ "subcategory": "http",
18
+ "description": "Factory function to create a typed HTTP client with automatic Content-Type and Bearer token injection. Returns a request function with generic type support.",
19
+ "tags": [
20
+ "http",
21
+ "api",
22
+ "fetch",
23
+ "client",
24
+ "auth"
25
+ ],
26
+ "capabilities": [
27
+ "fetch",
28
+ "auth",
29
+ "bearer-token",
30
+ "json"
31
+ ],
32
+ "fieldSemantics": [
33
+ "http",
34
+ "api",
35
+ "request"
36
+ ],
37
+ "props": [
38
+ {
39
+ "name": "baseUrl",
40
+ "type": "string",
41
+ "required": true,
42
+ "description": "Base URL for all requests (e.g. 'https://api.example.com').",
43
+ "semanticRole": "data"
44
+ },
45
+ {
46
+ "name": "getAccessToken",
47
+ "type": "() => string | null",
48
+ "required": false,
49
+ "description": "Callback to retrieve the access token. If provided, injected as 'Authorization: Bearer {token}'.",
50
+ "semanticRole": "behavior"
51
+ }
52
+ ],
53
+ "states": [
54
+ "ready",
55
+ "loading"
56
+ ]
57
+ },
58
+ "aiHints": {
59
+ "version": "0.1",
60
+ "preferredUseCases": [
61
+ "API communication with automatic Authorization header injection.",
62
+ "Type-safe HTTP requests with generic return types.",
63
+ "Authentication flows where tokens change at runtime (refresh tokens)."
64
+ ],
65
+ "avoidUseCases": [
66
+ "File uploads/downloads that require multipart or streaming.",
67
+ "GraphQL queries (use a GraphQL client instead)."
68
+ ],
69
+ "synonyms": [
70
+ "api client",
71
+ "fetch wrapper",
72
+ "http request client"
73
+ ],
74
+ "relatedEntityFields": [
75
+ "http",
76
+ "api",
77
+ "request",
78
+ "authentication"
79
+ ],
80
+ "compositionHints": [
81
+ "getAccessToken should be a getter function to support token refresh without recreating the client.",
82
+ "The returned request function automatically sets Content-Type: application/json.",
83
+ "HTTP errors (non-2xx) throw; 204 No Content returns undefined."
84
+ ],
85
+ "rankingSignals": {
86
+ "freeText": 0.2,
87
+ "structuredChoice": 0.3,
88
+ "date": 0,
89
+ "number": 0,
90
+ "denseLayout": 0.1
91
+ }
92
+ }
93
+ },
94
+ {
95
+ "componentId": "hook.cep-lookup",
96
+ "exportName": "buscarCep",
97
+ "sgMeta": {
98
+ "version": "0.1",
99
+ "componentId": "hook.cep-lookup",
100
+ "package": "@seedgrid/fe-commons",
101
+ "exportName": "buscarCep",
102
+ "slug": "buscar-cep",
103
+ "displayName": "CEP Lookup",
104
+ "category": "hook",
105
+ "subcategory": "lookup",
106
+ "description": "Async function to lookup Brazilian postal code (CEP) details using the free ViaCEP public API. Returns address information: street, city, state, district.",
107
+ "tags": [
108
+ "cep",
109
+ "postal code",
110
+ "address",
111
+ "brazil",
112
+ "lookup"
113
+ ],
114
+ "capabilities": [
115
+ "lookup",
116
+ "address",
117
+ "postal",
118
+ "brazil"
119
+ ],
120
+ "fieldSemantics": [
121
+ "cep",
122
+ "postal-code",
123
+ "address",
124
+ "location"
125
+ ],
126
+ "props": [
127
+ {
128
+ "name": "cep",
129
+ "type": "string",
130
+ "required": true,
131
+ "description": "Brazilian CEP (postal code) as string. Accepts with or without hyphen (e.g. '12345-678' or '12345678').",
132
+ "semanticRole": "data"
133
+ },
134
+ {
135
+ "name": "options",
136
+ "type": "{ signal?: AbortSignal }",
137
+ "required": false,
138
+ "description": "Optional abort signal for request cancellation.",
139
+ "semanticRole": "behavior"
140
+ }
141
+ ],
142
+ "states": [
143
+ "idle",
144
+ "loading",
145
+ "success",
146
+ "error"
147
+ ]
148
+ },
149
+ "aiHints": {
150
+ "version": "0.1",
151
+ "preferredUseCases": [
152
+ "Auto-populate address fields based on user-entered CEP in forms.",
153
+ "Validate that a CEP exists and belongs to a real location.",
154
+ "Build address fields: state, city, street based on postal code."
155
+ ],
156
+ "avoidUseCases": [
157
+ "High-frequency lookups on every keystroke — debounce/throttle the call.",
158
+ "Offline applications — ViaCEP requires internet connectivity."
159
+ ],
160
+ "synonyms": [
161
+ "postal code lookup",
162
+ "CEP search",
163
+ "address finder"
164
+ ],
165
+ "relatedEntityFields": [
166
+ "cep",
167
+ "postal-code",
168
+ "address",
169
+ "location",
170
+ "city",
171
+ "state"
172
+ ],
173
+ "compositionHints": [
174
+ "CEP format: 8 digits, with or without hyphen (both accepted).",
175
+ "Common pattern: user enters CEP, buscarCep fetches, populate 'cidade' (city) and 'estado' (state).",
176
+ "Error cases: throw on invalid CEP format, HTTP error, or data.erro flag.",
177
+ "Debounce rapid CEP input before calling buscarCep to reduce API load."
178
+ ],
179
+ "rankingSignals": {
180
+ "freeText": 0.4,
181
+ "structuredChoice": 0.2,
182
+ "date": 0,
183
+ "number": 0.3,
184
+ "denseLayout": 0.1
185
+ }
186
+ }
187
+ },
188
+ {
189
+ "componentId": "hook.cnpj-lookup",
190
+ "exportName": "buscarCnpj",
191
+ "sgMeta": {
192
+ "version": "0.1",
193
+ "componentId": "hook.cnpj-lookup",
194
+ "package": "@seedgrid/fe-commons",
195
+ "exportName": "buscarCnpj",
196
+ "slug": "buscar-cnpj",
197
+ "displayName": "CNPJ Lookup",
198
+ "category": "hook",
199
+ "subcategory": "lookup",
200
+ "description": "Async function to lookup Brazilian company registration (CNPJ) details using the free Publica CNPJ API. Returns business information: legal name, address, shareholders, tax status.",
201
+ "tags": [
202
+ "cnpj",
203
+ "company",
204
+ "business",
205
+ "brazil",
206
+ "lookup",
207
+ "registration"
208
+ ],
209
+ "capabilities": [
210
+ "lookup",
211
+ "business",
212
+ "company",
213
+ "brazil"
214
+ ],
215
+ "fieldSemantics": [
216
+ "cnpj",
217
+ "company",
218
+ "business",
219
+ "registration"
220
+ ],
221
+ "props": [
222
+ {
223
+ "name": "cnpj",
224
+ "type": "string",
225
+ "required": true,
226
+ "description": "Brazilian company registration (CNPJ) as string. Accepts with or without formatting (e.g. '12.345.678/0001-90' or '12345678000190').",
227
+ "semanticRole": "data"
228
+ },
229
+ {
230
+ "name": "options",
231
+ "type": "{ signal?: AbortSignal }",
232
+ "required": false,
233
+ "description": "Optional abort signal for request cancellation.",
234
+ "semanticRole": "behavior"
235
+ }
236
+ ],
237
+ "states": [
238
+ "idle",
239
+ "loading",
240
+ "success",
241
+ "error"
242
+ ]
243
+ },
244
+ "aiHints": {
245
+ "version": "0.1",
246
+ "preferredUseCases": [
247
+ "Auto-populate company/vendor fields in B2B forms based on CNPJ.",
248
+ "Verify company details (legal name, address) before contract.",
249
+ "Business directory or company search features."
250
+ ],
251
+ "avoidUseCases": [
252
+ "High-frequency lookups on every keystroke — debounce/throttle the call.",
253
+ "Offline applications — Publica API requires internet connectivity."
254
+ ],
255
+ "synonyms": [
256
+ "company lookup",
257
+ "CNPJ search",
258
+ "business finder"
259
+ ],
260
+ "relatedEntityFields": [
261
+ "cnpj",
262
+ "company",
263
+ "business",
264
+ "registration",
265
+ "vendor"
266
+ ],
267
+ "compositionHints": [
268
+ "CNPJ format: 14 digits, with or without formatting (both accepted).",
269
+ "Returns null on network error or non-2xx response — gracefully handle in UI.",
270
+ "Response includes établecimento (main address), sócios (shareholders), optants (tax status).",
271
+ "Common pattern: user enters CNPJ, buscarCnpj fetches, display company name and address.",
272
+ "Debounce rapid CNPJ input before calling buscarCnpj to reduce API load."
273
+ ],
274
+ "rankingSignals": {
275
+ "freeText": 0.35,
276
+ "structuredChoice": 0.25,
277
+ "date": 0,
278
+ "number": 0.3,
279
+ "denseLayout": 0.1
280
+ }
281
+ }
282
+ }
283
+ ]
284
+ }
@@ -0,0 +1,61 @@
1
+ type SgMetaPropV0 = {
2
+ name: string;
3
+ type: string;
4
+ required?: boolean;
5
+ default?: unknown;
6
+ description?: string;
7
+ semanticRole?: "value" | "label" | "validation" | "behavior" | "appearance" | "event" | "data";
8
+ bindable?: boolean;
9
+ };
10
+ type SgMetaExampleV0 = {
11
+ id: string;
12
+ title: string;
13
+ file: string;
14
+ kind: "sample" | "playground";
15
+ };
16
+ type SgMetaV0 = {
17
+ version: "0.1";
18
+ componentId: string;
19
+ package: string;
20
+ exportName: string;
21
+ slug: string;
22
+ displayName: string;
23
+ category: string;
24
+ subcategory?: string;
25
+ description: string;
26
+ tags?: string[];
27
+ capabilities?: string[];
28
+ fieldSemantics?: string[];
29
+ props?: SgMetaPropV0[];
30
+ states?: string[];
31
+ examples?: SgMetaExampleV0[];
32
+ showcase?: {
33
+ route: string;
34
+ hasPlayground: boolean;
35
+ hasPropsTable: boolean;
36
+ };
37
+ sdui?: {
38
+ rendererType: string;
39
+ acceptsDataBinding?: boolean;
40
+ defaultProps?: Record<string, unknown>;
41
+ };
42
+ };
43
+ type SgAiHintsV0 = {
44
+ version: "0.1";
45
+ preferredUseCases: string[];
46
+ avoidUseCases?: string[];
47
+ synonyms?: string[];
48
+ relatedEntityFields?: string[];
49
+ compositionHints?: string[];
50
+ rankingSignals?: {
51
+ freeText?: number;
52
+ structuredChoice?: number;
53
+ date?: number;
54
+ number?: number;
55
+ denseLayout?: number;
56
+ };
57
+ };
58
+ export declare const sgMeta: SgMetaV0;
59
+ export declare const aiHints: SgAiHintsV0;
60
+ export {};
61
+ //# sourceMappingURL=viacep.meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viacep.meta.d.ts","sourceRoot":"","sources":["../../src/cep/viacep.meta.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,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AAC;CACH,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAgCpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAiCrB,CAAC"}
@@ -0,0 +1,65 @@
1
+ export const sgMeta = {
2
+ version: "0.1",
3
+ componentId: "hook.cep-lookup",
4
+ package: "@seedgrid/fe-commons",
5
+ exportName: "buscarCep",
6
+ slug: "buscar-cep",
7
+ displayName: "CEP Lookup",
8
+ category: "hook",
9
+ subcategory: "lookup",
10
+ description: "Async function to lookup Brazilian postal code (CEP) details using the free ViaCEP public API. Returns address information: street, city, state, district.",
11
+ tags: ["cep", "postal code", "address", "brazil", "lookup"],
12
+ capabilities: ["lookup", "address", "postal", "brazil"],
13
+ fieldSemantics: ["cep", "postal-code", "address", "location"],
14
+ props: [
15
+ {
16
+ name: "cep",
17
+ type: "string",
18
+ required: true,
19
+ description: "Brazilian CEP (postal code) as string. Accepts with or without hyphen (e.g. '12345-678' or '12345678').",
20
+ semanticRole: "data",
21
+ },
22
+ {
23
+ name: "options",
24
+ type: "{ signal?: AbortSignal }",
25
+ required: false,
26
+ description: "Optional abort signal for request cancellation.",
27
+ semanticRole: "behavior",
28
+ },
29
+ ],
30
+ states: ["idle", "loading", "success", "error"],
31
+ };
32
+ export const aiHints = {
33
+ version: "0.1",
34
+ preferredUseCases: [
35
+ "Auto-populate address fields based on user-entered CEP in forms.",
36
+ "Validate that a CEP exists and belongs to a real location.",
37
+ "Build address fields: state, city, street based on postal code.",
38
+ ],
39
+ avoidUseCases: [
40
+ "High-frequency lookups on every keystroke — debounce/throttle the call.",
41
+ "Offline applications — ViaCEP requires internet connectivity.",
42
+ ],
43
+ synonyms: ["postal code lookup", "CEP search", "address finder"],
44
+ relatedEntityFields: [
45
+ "cep",
46
+ "postal-code",
47
+ "address",
48
+ "location",
49
+ "city",
50
+ "state",
51
+ ],
52
+ compositionHints: [
53
+ "CEP format: 8 digits, with or without hyphen (both accepted).",
54
+ "Common pattern: user enters CEP, buscarCep fetches, populate 'cidade' (city) and 'estado' (state).",
55
+ "Error cases: throw on invalid CEP format, HTTP error, or data.erro flag.",
56
+ "Debounce rapid CEP input before calling buscarCep to reduce API load.",
57
+ ],
58
+ rankingSignals: {
59
+ freeText: 0.4,
60
+ structuredChoice: 0.2,
61
+ date: 0,
62
+ number: 0.3,
63
+ denseLayout: 0.1,
64
+ },
65
+ };
@@ -0,0 +1,61 @@
1
+ type SgMetaPropV0 = {
2
+ name: string;
3
+ type: string;
4
+ required?: boolean;
5
+ default?: unknown;
6
+ description?: string;
7
+ semanticRole?: "value" | "label" | "validation" | "behavior" | "appearance" | "event" | "data";
8
+ bindable?: boolean;
9
+ };
10
+ type SgMetaExampleV0 = {
11
+ id: string;
12
+ title: string;
13
+ file: string;
14
+ kind: "sample" | "playground";
15
+ };
16
+ type SgMetaV0 = {
17
+ version: "0.1";
18
+ componentId: string;
19
+ package: string;
20
+ exportName: string;
21
+ slug: string;
22
+ displayName: string;
23
+ category: string;
24
+ subcategory?: string;
25
+ description: string;
26
+ tags?: string[];
27
+ capabilities?: string[];
28
+ fieldSemantics?: string[];
29
+ props?: SgMetaPropV0[];
30
+ states?: string[];
31
+ examples?: SgMetaExampleV0[];
32
+ showcase?: {
33
+ route: string;
34
+ hasPlayground: boolean;
35
+ hasPropsTable: boolean;
36
+ };
37
+ sdui?: {
38
+ rendererType: string;
39
+ acceptsDataBinding?: boolean;
40
+ defaultProps?: Record<string, unknown>;
41
+ };
42
+ };
43
+ type SgAiHintsV0 = {
44
+ version: "0.1";
45
+ preferredUseCases: string[];
46
+ avoidUseCases?: string[];
47
+ synonyms?: string[];
48
+ relatedEntityFields?: string[];
49
+ compositionHints?: string[];
50
+ rankingSignals?: {
51
+ freeText?: number;
52
+ structuredChoice?: number;
53
+ date?: number;
54
+ number?: number;
55
+ denseLayout?: number;
56
+ };
57
+ };
58
+ export declare const sgMeta: SgMetaV0;
59
+ export declare const aiHints: SgAiHintsV0;
60
+ export {};
61
+ //# sourceMappingURL=publica.meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publica.meta.d.ts","sourceRoot":"","sources":["../../src/cnpj/publica.meta.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;CAC/B,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,KAAK,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,C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tB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAgCpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WA2BrB,CAAC"}
@@ -0,0 +1,59 @@
1
+ export const sgMeta = {
2
+ version: "0.1",
3
+ componentId: "hook.cnpj-lookup",
4
+ package: "@seedgrid/fe-commons",
5
+ exportName: "buscarCnpj",
6
+ slug: "buscar-cnpj",
7
+ displayName: "CNPJ Lookup",
8
+ category: "hook",
9
+ subcategory: "lookup",
10
+ description: "Async function to lookup Brazilian company registration (CNPJ) details using the free Publica CNPJ API. Returns business information: legal name, address, shareholders, tax status.",
11
+ tags: ["cnpj", "company", "business", "brazil", "lookup", "registration"],
12
+ capabilities: ["lookup", "business", "company", "brazil"],
13
+ fieldSemantics: ["cnpj", "company", "business", "registration"],
14
+ props: [
15
+ {
16
+ name: "cnpj",
17
+ type: "string",
18
+ required: true,
19
+ description: "Brazilian company registration (CNPJ) as string. Accepts with or without formatting (e.g. '12.345.678/0001-90' or '12345678000190').",
20
+ semanticRole: "data",
21
+ },
22
+ {
23
+ name: "options",
24
+ type: "{ signal?: AbortSignal }",
25
+ required: false,
26
+ description: "Optional abort signal for request cancellation.",
27
+ semanticRole: "behavior",
28
+ },
29
+ ],
30
+ states: ["idle", "loading", "success", "error"],
31
+ };
32
+ export const aiHints = {
33
+ version: "0.1",
34
+ preferredUseCases: [
35
+ "Auto-populate company/vendor fields in B2B forms based on CNPJ.",
36
+ "Verify company details (legal name, address) before contract.",
37
+ "Business directory or company search features.",
38
+ ],
39
+ avoidUseCases: [
40
+ "High-frequency lookups on every keystroke — debounce/throttle the call.",
41
+ "Offline applications — Publica API requires internet connectivity.",
42
+ ],
43
+ synonyms: ["company lookup", "CNPJ search", "business finder"],
44
+ relatedEntityFields: ["cnpj", "company", "business", "registration", "vendor"],
45
+ compositionHints: [
46
+ "CNPJ format: 14 digits, with or without formatting (both accepted).",
47
+ "Returns null on network error or non-2xx response — gracefully handle in UI.",
48
+ "Response includes établecimento (main address), sócios (shareholders), optants (tax status).",
49
+ "Common pattern: user enters CNPJ, buscarCnpj fetches, display company name and address.",
50
+ "Debounce rapid CNPJ input before calling buscarCnpj to reduce API load.",
51
+ ],
52
+ rankingSignals: {
53
+ freeText: 0.35,
54
+ structuredChoice: 0.25,
55
+ date: 0,
56
+ number: 0.3,
57
+ denseLayout: 0.1,
58
+ },
59
+ };
@@ -0,0 +1,61 @@
1
+ type SgMetaPropV0 = {
2
+ name: string;
3
+ type: string;
4
+ required?: boolean;
5
+ default?: unknown;
6
+ description?: string;
7
+ semanticRole?: "value" | "label" | "validation" | "behavior" | "appearance" | "event" | "data";
8
+ bindable?: boolean;
9
+ };
10
+ type SgMetaExampleV0 = {
11
+ id: string;
12
+ title: string;
13
+ file: string;
14
+ kind: "sample" | "playground";
15
+ };
16
+ type SgMetaV0 = {
17
+ version: "0.1";
18
+ componentId: string;
19
+ package: string;
20
+ exportName: string;
21
+ slug: string;
22
+ displayName: string;
23
+ category: string;
24
+ subcategory?: string;
25
+ description: string;
26
+ tags?: string[];
27
+ capabilities?: string[];
28
+ fieldSemantics?: string[];
29
+ props?: SgMetaPropV0[];
30
+ states?: string[];
31
+ examples?: SgMetaExampleV0[];
32
+ showcase?: {
33
+ route: string;
34
+ hasPlayground: boolean;
35
+ hasPropsTable: boolean;
36
+ };
37
+ sdui?: {
38
+ rendererType: string;
39
+ acceptsDataBinding?: boolean;
40
+ defaultProps?: Record<string, unknown>;
41
+ };
42
+ };
43
+ type SgAiHintsV0 = {
44
+ version: "0.1";
45
+ preferredUseCases: string[];
46
+ avoidUseCases?: string[];
47
+ synonyms?: string[];
48
+ relatedEntityFields?: string[];
49
+ compositionHints?: string[];
50
+ rankingSignals?: {
51
+ freeText?: number;
52
+ structuredChoice?: number;
53
+ date?: number;
54
+ number?: number;
55
+ denseLayout?: number;
56
+ };
57
+ };
58
+ export declare const sgMeta: SgMetaV0;
59
+ export declare const aiHints: SgAiHintsV0;
60
+ export {};
61
+ //# sourceMappingURL=httpClient.meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpClient.meta.d.ts","sourceRoot":"","sources":["../../src/http/httpClient.meta.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;CAC/B,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,KAAK,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxC,CAAC;CACH,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAgCpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAyBrB,CAAC"}
@@ -0,0 +1,57 @@
1
+ export const sgMeta = {
2
+ version: "0.1",
3
+ componentId: "hook.http-client",
4
+ package: "@seedgrid/fe-commons",
5
+ exportName: "createHttpClient",
6
+ slug: "create-http-client",
7
+ displayName: "HTTP Client Factory",
8
+ category: "hook",
9
+ subcategory: "http",
10
+ description: "Factory function to create a typed HTTP client with automatic Content-Type and Bearer token injection. Returns a request function with generic type support.",
11
+ tags: ["http", "api", "fetch", "client", "auth"],
12
+ capabilities: ["fetch", "auth", "bearer-token", "json"],
13
+ fieldSemantics: ["http", "api", "request"],
14
+ props: [
15
+ {
16
+ name: "baseUrl",
17
+ type: "string",
18
+ required: true,
19
+ description: "Base URL for all requests (e.g. 'https://api.example.com').",
20
+ semanticRole: "data",
21
+ },
22
+ {
23
+ name: "getAccessToken",
24
+ type: "() => string | null",
25
+ required: false,
26
+ description: "Callback to retrieve the access token. If provided, injected as 'Authorization: Bearer {token}'.",
27
+ semanticRole: "behavior",
28
+ },
29
+ ],
30
+ states: ["ready", "loading"],
31
+ };
32
+ export const aiHints = {
33
+ version: "0.1",
34
+ preferredUseCases: [
35
+ "API communication with automatic Authorization header injection.",
36
+ "Type-safe HTTP requests with generic return types.",
37
+ "Authentication flows where tokens change at runtime (refresh tokens).",
38
+ ],
39
+ avoidUseCases: [
40
+ "File uploads/downloads that require multipart or streaming.",
41
+ "GraphQL queries (use a GraphQL client instead).",
42
+ ],
43
+ synonyms: ["api client", "fetch wrapper", "http request client"],
44
+ relatedEntityFields: ["http", "api", "request", "authentication"],
45
+ compositionHints: [
46
+ "getAccessToken should be a getter function to support token refresh without recreating the client.",
47
+ "The returned request function automatically sets Content-Type: application/json.",
48
+ "HTTP errors (non-2xx) throw; 204 No Content returns undefined.",
49
+ ],
50
+ rankingSignals: {
51
+ freeText: 0.2,
52
+ structuredChoice: 0.3,
53
+ date: 0,
54
+ number: 0,
55
+ denseLayout: 0.1,
56
+ },
57
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedgrid/fe-commons",
3
- "version": "2026.4.19",
3
+ "version": "2026.4.20",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@seedgrid/fe-core": "2026.4.19"
25
+ "@seedgrid/fe-core": "2026.4.20"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^18.2.0 || ^19.0.0"
@@ -31,7 +31,7 @@
31
31
  "fs-extra": "^11.2.0"
32
32
  },
33
33
  "scripts": {
34
- "build": "tsc -p tsconfig.json",
34
+ "build": "tsc -p tsconfig.json && node scripts/build-ai-manifest.mjs",
35
35
  "typecheck": "tsc -p tsconfig.json --noEmit"
36
36
  }
37
37
  }