fmdapi-client
БесплатноБез исполняемых скриптовНе проверенDataApi factory, OttoAdapter (dk_ API key), FetchAdapter (username/password with token stores), CRUD methods: list, listAll, find, findOne, findFirst…
от proofsh★ 21 звезда на GitHubОб этом скилле
Setup
Start with typegen. Before manually configuring a DataApi client, use
npx @proofkit/typegen@betato generate type-safe clients from your FileMaker layouts. See the typegen-fmdapi skill. Manual setup below is only needed for advanced or non-typegen workflows.
Install the package:
pnpm add @proofkit/fmdapi
OttoAdapter (recommended)
Requires OttoFMS installed on the FileMaker Server. No token management needed — the proxy handles sessions.
import { DataApi, OttoAdapter } from "@proofkit/fmdapi";
const client = DataApi({
adapter: new OttoAdapter({
auth: { apiKey: process.env.OTTO_API_KEY as `dk_${string}` },
db: process.env.FM_DATABASE,
server: process.env.FM_SERVER, // must start with https://
}),
layout: "API_Contacts",
});
API keys must start with dk_ (OttoFMS) or KEY_ (Otto v3). OttoFMS keys use the default HTTPS port with an /otto path prefix. Otto v3 keys use port 3030 by default (configurable via auth.ottoPort).
FetchAdapter (direct Data API)
Authenticates with username/password. Manages Data API session tokens automatically.
import { DataApi, FetchAdapter } from "@proofkit/fmdapi";
const client = DataApi({
adapter: new FetchAdapter({
auth: {
username: process.env.FM_USERNAME,
password: process.env.FM_PASSWORD,
},
db: process.env.FM_DATABASE,
server: process.env.FM_SERVER,
tokenStore: fileTokenStore(), // IMPORTANT for production — see Common Mistakes
}),
layout: "API_Contacts",
});
With typegen-generated clients
The recommended path is to use @proofkit/typegen to generate layout-specific clients with full type safety and schema validation. The generated client file exports a pre-configured DataApi instance per layout:
import { CustomersLayout } from "./schema/client";
const { data } = await CustomersLayout.findOne({
query: { id: "==abc123" },
});
// data.fieldData is fully typed with your FM field names
Core Patterns
CRUD Operations
Every DataApi client is bound to a single layout. All methods operate on that layout.
Find records:
// Standard find — returns { data: FMRecord[], dataInfo }
const response = await client.find({
query: { city: "Portland" },
});
// OR finds — pass an array of query objects
const response = await client.find({
query: [{ city: "Portland" }, { city: "Seattle" }],
});
// findOne — throws unless exactly 1 record found
const { data } = await client.findOne({
query: { email: "[email protected]" },
});
// findFirst — returns first record, throws if none found
const { data } = await client.findFirst({
query: { status: "Active" },
});
// maybeFindFirst — returns first record or null
const result = await client.maybeFindFirst({
query: { email: "[email protected]" },
});
// findAll — auto-paginates through all results (caution with large datasets)
const allRecords = await client.findAll({
query: { status: "==Active" },
});
// Suppress error on empty result set (FM error 401)
const response = await client.find({
query: { email: "[email protected]" },
ignoreEmptyResult: true, // returns empty array instead of throwing
});
List records (no find criteria):
// list — returns up to 100 records by default
const response = await client.list({
sort: [{ fieldName: "lastName", sortOrder: "ascend" }],
limit: 50,
offset: 1,
});
// listAll — auto-paginates (caution with large datasets)
const allRecords = await client.listAll();
Create:
const { recordId, modId } = await client.create({
fieldData: {
firstName: "Jane",
lastName: "Doe",
email: "[email protected]",
},
});
Update:
// recordId is FileMaker's internal record ID (from find/list/create responses)
await client.update({
recordId: 42,
fieldData: { email: "[email protected]" },
modId: 5, // optional optimistic locking
});
Delete:
await client.delete({ recordId: 42 });
Get by record ID:
const response = await client.get({ recordId: 42 });
Script Execution
// Direct execution
const result = await client.executeScript({
script: "Process Order",
scriptParam: JSON.stringify({ orderId: "12345" }),
});
console.log(result.scriptResult); // string returned by Exit Script
// Scripts attached to CRUD operations
const { recordId, scriptResult } = await client.create({
fieldData: { name: "New Record" },
script: "After Create Hook",
"script.param": JSON.stringify({ notify: true }),
// Also available: script.prerequest, script.presort (and their .param variants)
});
Portal Data
Portal data is returned on every record in the portalData property. Each portal row includes its own recordId and modId.
// Type-safe portal access with manual types
type TOrderRow = {
"Orders::orderId": string;
"Orders::orderDate": string;
"Orders::total": number;
};
type TPortals = {
port
Установить fmdapi-client в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл fmdapi-client?
DataApi factory, OttoAdapter (dk_ API key), FetchAdapter (username/password with token stores), CRUD methods: list, listAll, find, findOne, findFirst, maybeFindFirst, findAll, create, update, delete, get, executeScript, containerUpload, Standard Schema validation, portal data access, FileMaker Data API, layout-bound clients, schema inference
Как установить скилл fmdapi-client?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fmdapi-client запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic