fms-odata-js 0.3.0 → 0.4.0

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,103 @@
1
+ /**
2
+ * Schema modification (DDL) for FileMaker Server via the OData system tables.
3
+ *
4
+ * FMS exposes DDL through two system tables:
5
+ *
6
+ * FileMaker_Tables — create tables, add fields, delete tables/fields
7
+ * FileMaker_Indexes — create and delete field indexes
8
+ *
9
+ * All operations require a FileMaker account with full access (schema
10
+ * modification) privileges in the target file.
11
+ *
12
+ * Destructive operations (`deleteTable`, `deleteField`) require an explicit
13
+ * `confirm: true` option to prevent accidental data loss, per the spec's
14
+ * security guidance (docs/10-schema-modification.md).
15
+ *
16
+ * @see https://github.com/fsans/fms-odata-spec/blob/main/docs/10-schema-modification.md
17
+ */
18
+ import { type CreateTableParams, type AddFieldsParams } from '@fms-odata/spec-ts';
19
+ import type { FMSOData } from './client.js';
20
+ import type { RequestOptions } from './types.js';
21
+ /** Options accepted by schema operations. */
22
+ export interface SchemaOptions extends RequestOptions {
23
+ }
24
+ /** Options for destructive schema operations (deleteTable, deleteField). */
25
+ export interface DeleteSchemaOptions extends SchemaOptions {
26
+ /**
27
+ * Must be `true` to proceed. Destructive DDL operations permanently destroy
28
+ * data with no undo. This guard prevents accidental invocation.
29
+ */
30
+ confirm: true;
31
+ }
32
+ /**
33
+ * Schema editor for FileMaker DDL operations.
34
+ *
35
+ * Obtain an instance via `db.schema()` or use the convenience methods on
36
+ * `FMSOData` (`db.createTable`, `db.addFields`, etc.).
37
+ */
38
+ export declare class SchemaEditor {
39
+ /** @internal */ readonly _client: FMSOData;
40
+ constructor(client: FMSOData);
41
+ /**
42
+ * Create a new table with the given field definitions.
43
+ *
44
+ * ```ts
45
+ * await db.schema().createTable({
46
+ * tableName: 'Company',
47
+ * fields: [
48
+ * { name: 'Company ID', type: 'int', primary: true },
49
+ * { name: 'Company Name', type: 'varchar(100)', nullable: false },
50
+ * ],
51
+ * })
52
+ * ```
53
+ */
54
+ createTable(params: CreateTableParams, opts?: SchemaOptions): Promise<unknown>;
55
+ /**
56
+ * Add fields to an existing table.
57
+ *
58
+ * ```ts
59
+ * await db.schema().addFields({
60
+ * tableName: 'Company',
61
+ * fields: [{ name: 'Phone', type: 'varchar(30)' }],
62
+ * })
63
+ * ```
64
+ */
65
+ addFields(params: AddFieldsParams, opts?: SchemaOptions): Promise<unknown>;
66
+ /**
67
+ * Delete a table and ALL its records. Irreversible.
68
+ *
69
+ * Requires `opts.confirm === true` as a safety guard.
70
+ *
71
+ * ```ts
72
+ * await db.schema().deleteTable('OldTable', { confirm: true })
73
+ * ```
74
+ */
75
+ deleteTable(tableName: string, opts: DeleteSchemaOptions): Promise<void>;
76
+ /**
77
+ * Delete a field from a table. Irreversible.
78
+ *
79
+ * Requires `opts.confirm === true` as a safety guard.
80
+ *
81
+ * ```ts
82
+ * await db.schema().deleteField('Company', 'OldField', { confirm: true })
83
+ * ```
84
+ */
85
+ deleteField(tableName: string, fieldName: string, opts: DeleteSchemaOptions): Promise<void>;
86
+ /**
87
+ * Create an index on a field.
88
+ *
89
+ * ```ts
90
+ * await db.schema().createIndex('Company', 'Company Name')
91
+ * ```
92
+ */
93
+ createIndex(tableName: string, fieldName: string, opts?: SchemaOptions): Promise<unknown>;
94
+ /**
95
+ * Delete an index from a field.
96
+ *
97
+ * ```ts
98
+ * await db.schema().deleteIndex('Company', 'Company Name')
99
+ * ```
100
+ */
101
+ deleteIndex(tableName: string, fieldName: string, opts?: SchemaOptions): Promise<void>;
102
+ }
103
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD,6CAA6C;AAC7C,MAAM,WAAW,aAAc,SAAQ,cAAc;CAAG;AAExD,4EAA4E;AAC5E,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD;;;OAGG;IACH,OAAO,EAAE,IAAI,CAAA;CACd;AAkBD;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,gBAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;gBAE/B,MAAM,EAAE,QAAQ;IAI5B;;;;;;;;;;;;OAYG;IACG,WAAW,CACf,MAAM,EAAE,iBAAiB,EACzB,IAAI,GAAE,aAAkB,GACvB,OAAO,CAAC,OAAO,CAAC;IAenB;;;;;;;;;OASG;IACG,SAAS,CACb,MAAM,EAAE,eAAe,EACvB,IAAI,GAAE,aAAkB,GACvB,OAAO,CAAC,OAAO,CAAC;IAenB;;;;;;;;OAQG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,IAAI,CAAC;IAgBhB;;;;;;;;OAQG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,IAAI,CAAC;IAiBhB;;;;;;OAMG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,aAAkB,GACvB,OAAO,CAAC,OAAO,CAAC;IAcnB;;;;;;OAMG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,aAAkB,GACvB,OAAO,CAAC,IAAI,CAAC;CAWjB"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Webhook management for FileMaker Server OData.
3
+ *
4
+ * FMS exposes webhook management through five endpoints following the
5
+ * standard OData function-call shape: read endpoints use GET, and action
6
+ * endpoints use POST with the `<id>` passed as a function argument in the
7
+ * URL path.
8
+ *
9
+ * GET /<db>/Webhook.GetAll — list all webhooks
10
+ * GET /<db>/Webhook.Get(<id>) — get one webhook by id
11
+ * POST /<db>/Webhook.Add — create a webhook (config in JSON body)
12
+ * POST /<db>/Webhook.Delete(<id>) — delete a webhook (id in URL path)
13
+ * POST /<db>/Webhook.Invoke(<id>) — manually trigger a webhook (id in URL path)
14
+ *
15
+ * Webhooks require FileMaker Server 2025+ (v22). Use
16
+ * `db.hasFeature('webhooks')` to check before calling.
17
+ *
18
+ * @see https://github.com/fsans/fms-odata-spec/blob/main/docs/09-webhooks.md
19
+ */
20
+ import type { WebhookCreateParams, WebhookData } from '@fms-odata/spec-ts';
21
+ import type { FMSOData } from './client.js';
22
+ import type { RequestOptions } from './types.js';
23
+ /** Options accepted by webhook operations. */
24
+ export interface WebhookOptions extends RequestOptions {
25
+ }
26
+ /**
27
+ * Webhook manager for FileMaker Server webhook CRUD.
28
+ *
29
+ * Obtain an instance via `db.webhooks()` or use the convenience methods on
30
+ * `FMSOData` (`db.createWebhook`, `db.removeWebhook`, etc.).
31
+ *
32
+ * Requires FileMaker Server 2025+ (v22).
33
+ */
34
+ export declare class WebhookManager {
35
+ /** @internal */ readonly _client: FMSOData;
36
+ constructor(client: FMSOData);
37
+ /** Build the URL for a webhook operation. */
38
+ private _url;
39
+ /**
40
+ * Create a webhook.
41
+ *
42
+ * ```ts
43
+ * const { id } = await db.webhooks().create({
44
+ * webhook: 'https://my.example.com:8080/webhook',
45
+ * tableName: 'contact',
46
+ * select: 'id,first_name',
47
+ * filter: "status eq 'active'",
48
+ * notifySchemaChanges: true,
49
+ * })
50
+ * ```
51
+ *
52
+ * @returns An object with the server-generated `id` of the new webhook.
53
+ */
54
+ create(params: WebhookCreateParams, opts?: WebhookOptions): Promise<{
55
+ id: string;
56
+ }>;
57
+ /**
58
+ * Delete a webhook by its ID.
59
+ *
60
+ * ```ts
61
+ * await db.webhooks().remove('1')
62
+ * ```
63
+ */
64
+ remove(id: string | number, opts?: WebhookOptions): Promise<unknown>;
65
+ /** Alias for {@link remove} (matches the FMS endpoint name `Webhook.Delete`). */
66
+ delete(id: string | number, opts?: WebhookOptions): Promise<unknown>;
67
+ /**
68
+ * Get a specific webhook's data by ID.
69
+ *
70
+ * ```ts
71
+ * const data = await db.webhooks().get('1')
72
+ * ```
73
+ */
74
+ get(id: string | number, opts?: WebhookOptions): Promise<WebhookData | unknown>;
75
+ /**
76
+ * List all webhooks.
77
+ *
78
+ * ```ts
79
+ * const result = await db.webhooks().getAll()
80
+ * ```
81
+ */
82
+ getAll(opts?: WebhookOptions): Promise<unknown>;
83
+ /**
84
+ * Manually invoke (trigger) a webhook by ID. Useful for testing.
85
+ *
86
+ * Optionally pass `rowIDs` to target specific records; if omitted, FMS
87
+ * triggers the webhook for all pending records.
88
+ *
89
+ * ```ts
90
+ * await db.webhooks().invoke('1')
91
+ * await db.webhooks().invoke('1', { rowIDs: [10, 20] })
92
+ * ```
93
+ */
94
+ invoke(id: string | number, opts?: WebhookOptions & {
95
+ rowIDs?: ReadonlyArray<string | number>;
96
+ }): Promise<unknown>;
97
+ }
98
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD,8CAA8C;AAC9C,MAAM,WAAW,cAAe,SAAQ,cAAc;CAAG;AAmCzD;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,gBAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;gBAE/B,MAAM,EAAE,QAAQ;IAI5B,6CAA6C;IAC7C,OAAO,CAAC,IAAI;IAKZ;;;;;;;;;;;;;;OAcG;IACG,MAAM,CACV,MAAM,EAAE,mBAAmB,EAC3B,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAmB1B;;;;;;OAMG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAS9E,iFAAiF;IAC3E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9E;;;;;;OAMG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC;IASzF;;;;;;OAMG;IACG,MAAM,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAQzD;;;;;;;;;;OAUG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,GAAE,cAAc,GAAG;QAAE,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;KAAO,GACtE,OAAO,CAAC,OAAO,CAAC;CAgBpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fms-odata-js",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Zero-runtime-dependency TypeScript client for FileMaker Server OData v4 (Web Viewer, browser, Node).",
5
5
  "type": "module",
6
6
  "main": "./dist/fms-odata.esm.js",
@@ -50,7 +50,7 @@
50
50
  "node": ">=18"
51
51
  },
52
52
  "devDependencies": {
53
- "@fms-odata/spec-ts": "^1.1.0",
53
+ "@fms-odata/spec-ts": "^2.0.1",
54
54
  "@playwright/test": "^1.47.0",
55
55
  "@types/node": "^20.14.0",
56
56
  "@vitest/coverage-v8": "^2.0.0",
package/src/client.ts CHANGED
@@ -2,8 +2,10 @@ import { Batch } from './batch.js'
2
2
  import { executeJson, executeRequest, type HttpClientContext, type HttpRequestOptions } from './http.js'
3
3
  import { MetadataFetcher, type MetadataOptions, type ODataMetadata } from './metadata.js'
4
4
  import { Query } from './query.js'
5
+ import { SchemaEditor, type DeleteSchemaOptions, type SchemaOptions } from './schema.js'
5
6
  import { runScriptAtDatabase, runScriptByIdAtDatabase, type ScriptOptions, type ScriptResult } from './scripts.js'
6
7
  import type { FMSODataOptions, RequestOptions } from './types.js'
8
+ import { WebhookManager, type WebhookOptions } from './webhooks.js'
7
9
  import {
8
10
  type FMVersionMajor,
9
11
  type FMVersionInfo,
@@ -145,7 +147,7 @@ export class FMSOData {
145
147
  * `@fms-odata/spec-ts` `parseServerVersion`). The result is cached for the
146
148
  * lifetime of this `FMSOData` instance.
147
149
  *
148
- * Returns the major version string (`'19'`, `'21'`, `'22'`, `'26'`) or
150
+ * Returns the major version string (`'20'`, `'21'`, `'22'`, `'26'`) or
149
151
  * `'future'` if the version is newer than the spec knows about. Returns
150
152
  * `null` if the version cannot be determined (e.g. the metadata lacks the
151
153
  * annotation).
@@ -234,6 +236,121 @@ export class FMSOData {
234
236
  return specHasFeature(v, feature)
235
237
  }
236
238
 
239
+ // -------------------------------------------------------------------------
240
+ // Schema modification (DDL)
241
+ // -------------------------------------------------------------------------
242
+
243
+ /** @internal */ private _schemaEditor?: SchemaEditor
244
+
245
+ /**
246
+ * Get a `SchemaEditor` handle for DDL operations (create/delete tables,
247
+ * add/delete fields, create/delete indexes). Requires a FileMaker account
248
+ * with full access privileges.
249
+ *
250
+ * ```ts
251
+ * await db.schema().createTable({ tableName: 'Company', fields: [...] })
252
+ * ```
253
+ */
254
+ schema(): SchemaEditor {
255
+ if (!this._schemaEditor) this._schemaEditor = new SchemaEditor(this)
256
+ return this._schemaEditor
257
+ }
258
+
259
+ /** Convenience: create a table. See {@link SchemaEditor#createTable}. */
260
+ async createTable(
261
+ params: import('@fms-odata/spec-ts').CreateTableParams,
262
+ opts: SchemaOptions = {},
263
+ ): Promise<unknown> {
264
+ return this.schema().createTable(params, opts)
265
+ }
266
+
267
+ /** Convenience: add fields to a table. See {@link SchemaEditor#addFields}. */
268
+ async addFields(
269
+ params: import('@fms-odata/spec-ts').AddFieldsParams,
270
+ opts: SchemaOptions = {},
271
+ ): Promise<unknown> {
272
+ return this.schema().addFields(params, opts)
273
+ }
274
+
275
+ /** Convenience: delete a table (requires `confirm: true`). See {@link SchemaEditor#deleteTable}. */
276
+ async deleteTable(tableName: string, opts: DeleteSchemaOptions): Promise<void> {
277
+ return this.schema().deleteTable(tableName, opts)
278
+ }
279
+
280
+ /** Convenience: delete a field (requires `confirm: true`). See {@link SchemaEditor#deleteField}. */
281
+ async deleteField(
282
+ tableName: string,
283
+ fieldName: string,
284
+ opts: DeleteSchemaOptions,
285
+ ): Promise<void> {
286
+ return this.schema().deleteField(tableName, fieldName, opts)
287
+ }
288
+
289
+ /** Convenience: create an index. See {@link SchemaEditor#createIndex}. */
290
+ async createIndex(
291
+ tableName: string,
292
+ fieldName: string,
293
+ opts: SchemaOptions = {},
294
+ ): Promise<unknown> {
295
+ return this.schema().createIndex(tableName, fieldName, opts)
296
+ }
297
+
298
+ /** Convenience: delete an index. See {@link SchemaEditor#deleteIndex}. */
299
+ async deleteIndex(
300
+ tableName: string,
301
+ fieldName: string,
302
+ opts: SchemaOptions = {},
303
+ ): Promise<void> {
304
+ return this.schema().deleteIndex(tableName, fieldName, opts)
305
+ }
306
+
307
+ // -------------------------------------------------------------------------
308
+ // Webhook management (requires FileMaker Server 2025+ / v22)
309
+ // -------------------------------------------------------------------------
310
+
311
+ /** @internal */ private _webhookManager?: WebhookManager
312
+
313
+ /**
314
+ * Get a `WebhookManager` handle for webhook CRUD operations (create, remove,
315
+ * get, getAll, invoke). Requires FileMaker Server 2025+ (v22).
316
+ *
317
+ * ```ts
318
+ * await db.webhooks().create({ webhook: 'https://...', tableName: 'contact' })
319
+ * ```
320
+ */
321
+ webhooks(): WebhookManager {
322
+ if (!this._webhookManager) this._webhookManager = new WebhookManager(this)
323
+ return this._webhookManager
324
+ }
325
+
326
+ /** Convenience: create a webhook. See {@link WebhookManager#create}. */
327
+ async createWebhook(
328
+ params: import('@fms-odata/spec-ts').WebhookCreateParams,
329
+ opts: WebhookOptions = {},
330
+ ): Promise<unknown> {
331
+ return this.webhooks().create(params, opts)
332
+ }
333
+
334
+ /** Convenience: delete a webhook by ID. See {@link WebhookManager#remove}. */
335
+ async removeWebhook(id: string | number, opts: WebhookOptions = {}): Promise<unknown> {
336
+ return this.webhooks().remove(id, opts)
337
+ }
338
+
339
+ /** Convenience: get a webhook by ID. See {@link WebhookManager#get}. */
340
+ async getWebhook(id: string | number, opts: WebhookOptions = {}): Promise<unknown> {
341
+ return this.webhooks().get(id, opts)
342
+ }
343
+
344
+ /** Convenience: list all webhooks. See {@link WebhookManager#getAll}. */
345
+ async getAllWebhooks(opts: WebhookOptions = {}): Promise<unknown> {
346
+ return this.webhooks().getAll(opts)
347
+ }
348
+
349
+ /** Convenience: manually invoke a webhook by ID. See {@link WebhookManager#invoke}. */
350
+ async invokeWebhook(id: string | number, opts: WebhookOptions = {}): Promise<unknown> {
351
+ return this.webhooks().invoke(id, opts)
352
+ }
353
+
237
354
  /**
238
355
  * Create a new `$batch` builder for composing multiple OData operations
239
356
  * into a single HTTP round-trip.
package/src/http.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * timeout composition, browser/Web Viewer compatibility).
9
9
  *
10
10
  * Responsibilities:
11
- * - Authorization header resolution (Basic, Bearer, or FMID, auto-detected).
11
+ * - Authorization header resolution (Basic or Bearer/OAuth, auto-detected).
12
12
  * - Timeout + AbortSignal composition.
13
13
  * - 401 retry via `onUnauthorized` (once).
14
14
  * - Error envelope normalization into `FMSODataError`.
@@ -19,8 +19,8 @@
19
19
  import { parseErrorResponse, FMSODataError } from './errors.js'
20
20
  import type { TokenProvider, RequestOptions } from './types.js'
21
21
 
22
- /** A scheme-prefixed Authorization value (e.g. `Basic …`, `Bearer …`, or `FMID …`). */
23
- const AUTH_SCHEME_RE = /^(basic|bearer|fmid|negotiate|digest)\s+\S/i
22
+ /** A scheme-prefixed Authorization value (e.g. `Basic …` or `Bearer …`). */
23
+ const AUTH_SCHEME_RE = /^(basic|bearer|negotiate|digest)\s+\S/i
24
24
 
25
25
  /** Resolve a `TokenProvider` to a complete Authorization header value. */
26
26
  export async function resolveAuthHeader(provider: TokenProvider): Promise<string> {
@@ -45,9 +45,9 @@ export function basicAuth(user: string, password: string): string {
45
45
  return `Basic ${b64}`
46
46
  }
47
47
 
48
- /** Build an FMID auth header value for FileMaker Cloud (Claris ID token). */
49
- export function fmidAuth(token: string): string {
50
- return `FMID ${token}`
48
+ /** Build a Bearer auth header value for an OAuth session token (FileMaker Cloud / external IdP). */
49
+ export function bearerAuth(token: string): string {
50
+ return `Bearer ${token}`
51
51
  }
52
52
 
53
53
  /** Auth scheme type (aligned with spec). */
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@ export { EntityRef } from './entity.js'
23
23
  export type { EntityWriteOptions, EntityRefInfo } from './entity.js'
24
24
  export { FMSODataError, FMScriptError, isFMSODataError, isFMScriptError } from './errors.js'
25
25
  export type { ODataErrorBody } from './errors.js'
26
- export { basicAuth, fmidAuth } from './http.js'
26
+ export { basicAuth, bearerAuth } from './http.js'
27
27
  export type { FMAuthScheme, FMAuthToken, FMAuthTokenProvider } from './http.js'
28
28
  export { MetadataFetcher } from './metadata.js'
29
29
  export type {
@@ -39,6 +39,10 @@ export type { FilterFactory, FilterInput, OrderDir, QueryResult } from './query.
39
39
  export type { AggregateFunction } from '@fms-odata/spec-ts'
40
40
  export { ScriptInvoker } from './scripts.js'
41
41
  export type { ScriptOptions, ScriptResult, ScriptScope, ScriptIdentifier } from './scripts.js'
42
+ export { SchemaEditor } from './schema.js'
43
+ export type { SchemaOptions, DeleteSchemaOptions } from './schema.js'
44
+ export { WebhookManager } from './webhooks.js'
45
+ export type { WebhookOptions } from './webhooks.js'
42
46
  export type { FMSODataOptions, TokenProvider, RequestOptions } from './types.js'
43
47
  export type { ODataLiteral } from './url.js'
44
48
 
@@ -65,6 +69,19 @@ export type {
65
69
  FMServerVersion,
66
70
  } from '@fms-odata/spec-ts'
67
71
 
72
+ // Schema (DDL) types from @fms-odata/spec-ts
73
+ export { FIELD_TYPES, FIELD_DEFAULTS, parseFieldType } from '@fms-odata/spec-ts'
74
+ export type {
75
+ FMFieldType,
76
+ FMFieldDefault,
77
+ FMFieldDefinition,
78
+ CreateTableParams,
79
+ AddFieldsParams,
80
+ } from '@fms-odata/spec-ts'
81
+
82
+ // Webhook types from @fms-odata/spec-ts
83
+ export type { WebhookCreateParams, WebhookData, WebhookOperation } from '@fms-odata/spec-ts'
84
+
68
85
  // ---------------------------------------------------------------------------
69
86
  // Deprecated aliases (kept for backward compatibility with fm-odata-js).
70
87
  // These re-export the renamed symbols under their old names and will be
package/src/query.ts CHANGED
@@ -212,14 +212,14 @@ export class Query<T = Record<string, unknown>> {
212
212
  }
213
213
 
214
214
  // -------------------------------------------------------------------------
215
- // $apply (aggregation) — requires FMS 22.0.1+ (FileMaker 2024)
215
+ // $apply (aggregation) — requires FMS 22.0.1+ (FileMaker 2025)
216
216
  // -------------------------------------------------------------------------
217
217
 
218
218
  /**
219
219
  * Set a raw `$apply` expression. Use this for advanced transformations
220
220
  * that the `aggregate()` / `groupBy()` helpers don't cover.
221
221
  *
222
- * Requires FileMaker Server 2024+ (v22). Use `db.hasFeature('applyAggregation')`
222
+ * Requires FileMaker Server 2025+ (v22). Use `db.hasFeature('applyAggregation')`
223
223
  * to check before calling.
224
224
  *
225
225
  * @example
@@ -236,7 +236,7 @@ export class Query<T = Record<string, unknown>> {
236
236
  /**
237
237
  * Aggregate the entity set. Produces a `$apply=aggregate(...)` expression.
238
238
  *
239
- * Requires FileMaker Server 2024+ (v22).
239
+ * Requires FileMaker Server 2025+ (v22).
240
240
  *
241
241
  * @example
242
242
  * ```ts
@@ -256,7 +256,7 @@ export class Query<T = Record<string, unknown>> {
256
256
  * Group the entity set by one or more fields, optionally with aggregation.
257
257
  * Produces a `$apply=groupby((fields), aggregate(...))` expression.
258
258
  *
259
- * Requires FileMaker Server 2024+ (v22).
259
+ * Requires FileMaker Server 2025+ (v22).
260
260
  *
261
261
  * @example
262
262
  * ```ts