You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/fmodata/skills/typegen-fmodata/SKILL.md
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ sources:
28
28
## Prerequisites
29
29
30
30
-**FileMaker Server 22.0.4+** accessible via port 443
31
-
-**OttoFMS 4.11+** installed on the FM server (optional, only for API key auth)
31
+
-**OttoFMS 4.11+** installed on the FM server (only required for API key auth)
32
32
-**FileMaker account** with the `fmodata` extended privilege enabled
33
33
-**OData API enabled** on the FileMaker server
34
34
@@ -47,9 +47,9 @@ npm add @proofkit/fmodata
47
47
FM_SERVER=https://your-server.com # must start with https://
48
48
FM_DATABASE=MyFile.fmp12 # must end with .fmp12
49
49
50
-
# API key auth (OttoFMS 4.11+, recommended)
50
+
#Option A: API key auth (requires OttoFMS 4.11+)
51
51
OTTO_API_KEY=dk_123456...789
52
-
#OR username/password
52
+
#Option B: username/password auth
53
53
FM_USERNAME=admin
54
54
FM_PASSWORD=password
55
55
```
@@ -68,7 +68,6 @@ This creates `proofkit-typegen-config.jsonc`. Configure for OData mode:
68
68
"config": {
69
69
"type":"fmodata",
70
70
"path":"schema/odata",
71
-
"reduceMetadata":true,
72
71
"tables": [
73
72
{
74
73
"tableName":"Customers",
@@ -95,6 +94,7 @@ Add a convenience script to `package.json`:
95
94
{
96
95
"scripts": {
97
96
"typegen": "npx @proofkit/typegen@beta"
97
+
"typegen:ui": "npm run tyepgen ui"
98
98
}
99
99
}
100
100
```
@@ -252,24 +252,33 @@ The `config` key can be an array mixing `fmdapi` and `fmodata` entries, each wit
252
252
253
253
## Common Mistakes
254
254
255
-
### CRITICAL: Manually adding fields or inventing entity IDs
255
+
### CRITICAL: Inventing entity IDs or guessing field names
256
256
257
257
Wrong:
258
258
```ts
259
-
// Agent adds a field it thinks exists in FileMaker
259
+
// Agent adds a field with a guessed entity ID
260
260
const contacts =fmTableOccurrence("contacts", {
261
261
...existingFields,
262
262
newField: textField().entityId("FMFID:99"), // guessed ID — will silently fail
263
263
});
264
264
```
265
265
266
-
Correct:
266
+
Entity IDs (`FMFID`/`FMTID`) are opaque and MUST come from FileMaker metadata via typegen. Guessed entity IDs cause silent query failures — wrong data or empty results with no error.
267
+
268
+
To add new fields, use the fmodata CLI to discover real field names programmatically, then add them to the `tables[].fields` array in `proofkit-typegen-config.jsonc`, and re-run typegen to generate the correct definitions with entity IDs:
269
+
267
270
```bash
268
-
# Re-run typegen to pick up new fields from FileMaker
# Add --details for field types, nullability, etc.
274
+
275
+
# 2. Edit proofkit-typegen-config.jsonc to include the new field(s)
276
+
277
+
# 3. Re-run typegen to regenerate schemas with correct entity IDs
269
278
npx @proofkit/typegen@beta
270
279
```
271
280
272
-
Field definitions and entity IDs (`FMFID`/`FMTID`) must come from FileMaker metadata via typegen. Guessed entity IDs cause silent query failures — wrong data or empty results with no error.
281
+
Never manually edit entity IDs or field definitions in generated files — always re-run typegen after config changes.
273
282
274
283
Source: packages/typegen/src/fmodata/typegen.ts
275
284
@@ -346,19 +355,20 @@ Without `"type": "fmodata"`, the config defaults to `"fmdapi"` and expects a `la
346
355
347
356
Source: packages/typegen/src/types.ts:238-243
348
357
349
-
### HIGH: Not running typegen after FileMaker schema changes
358
+
### HIGH: Not running typegen after FileMaker schema changes or config edits
350
359
351
360
Wrong:
352
361
```ts
353
362
// Manually editing a generated file to add a new field
363
+
// OR editing proofkit-typegen-config.jsonc without re-running typegen
354
364
```
355
365
356
366
Correct:
357
367
```bash
358
368
npx @proofkit/typegen@beta
359
369
```
360
370
361
-
After changing table schemas in FileMaker, re-run typegen to regenerate types. The generated schemas are the source of truth for field names, types, and entity IDs.
371
+
After changing table schemas in FileMaker or editing `proofkit-typegen-config.jsonc`, re-run typegen to regenerate types. The generated schemas are the source of truth for field names, types, and entity IDs.
0 commit comments