@proofkit/fmodata 0.1.0-alpha.1 → 0.1.0-alpha.11
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/README.md +760 -69
- package/dist/esm/client/base-table.d.ts +120 -5
- package/dist/esm/client/base-table.js +43 -5
- package/dist/esm/client/base-table.js.map +1 -1
- package/dist/esm/client/batch-builder.d.ts +54 -0
- package/dist/esm/client/batch-builder.js +179 -0
- package/dist/esm/client/batch-builder.js.map +1 -0
- package/dist/esm/client/batch-request.d.ts +61 -0
- package/dist/esm/client/batch-request.js +252 -0
- package/dist/esm/client/batch-request.js.map +1 -0
- package/dist/esm/client/build-occurrences.d.ts +74 -0
- package/dist/esm/client/build-occurrences.js +31 -0
- package/dist/esm/client/build-occurrences.js.map +1 -0
- package/dist/esm/client/database.d.ts +55 -6
- package/dist/esm/client/database.js +118 -15
- package/dist/esm/client/database.js.map +1 -1
- package/dist/esm/client/delete-builder.d.ts +21 -2
- package/dist/esm/client/delete-builder.js +96 -32
- package/dist/esm/client/delete-builder.js.map +1 -1
- package/dist/esm/client/entity-set.d.ts +26 -12
- package/dist/esm/client/entity-set.js +43 -12
- package/dist/esm/client/entity-set.js.map +1 -1
- package/dist/esm/client/filemaker-odata.d.ts +23 -4
- package/dist/esm/client/filemaker-odata.js +124 -29
- package/dist/esm/client/filemaker-odata.js.map +1 -1
- package/dist/esm/client/insert-builder.d.ts +38 -3
- package/dist/esm/client/insert-builder.js +231 -34
- package/dist/esm/client/insert-builder.js.map +1 -1
- package/dist/esm/client/query-builder.d.ts +28 -7
- package/dist/esm/client/query-builder.js +470 -212
- package/dist/esm/client/query-builder.js.map +1 -1
- package/dist/esm/client/record-builder.d.ts +96 -10
- package/dist/esm/client/record-builder.js +378 -39
- package/dist/esm/client/record-builder.js.map +1 -1
- package/dist/esm/client/response-processor.d.ts +38 -0
- package/dist/esm/client/schema-manager.d.ts +57 -0
- package/dist/esm/client/schema-manager.js +132 -0
- package/dist/esm/client/schema-manager.js.map +1 -0
- package/dist/esm/client/table-occurrence.d.ts +69 -8
- package/dist/esm/client/table-occurrence.js +35 -24
- package/dist/esm/client/table-occurrence.js.map +1 -1
- package/dist/esm/client/update-builder.d.ts +34 -11
- package/dist/esm/client/update-builder.js +135 -31
- package/dist/esm/client/update-builder.js.map +1 -1
- package/dist/esm/errors.d.ts +73 -0
- package/dist/esm/errors.js +148 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/index.d.ts +13 -3
- package/dist/esm/index.js +29 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/transform.d.ts +65 -0
- package/dist/esm/transform.js +114 -0
- package/dist/esm/transform.js.map +1 -0
- package/dist/esm/types.d.ts +89 -5
- package/dist/esm/validation.d.ts +6 -3
- package/dist/esm/validation.js +104 -33
- package/dist/esm/validation.js.map +1 -1
- package/package.json +10 -1
- package/src/client/base-table.ts +161 -8
- package/src/client/batch-builder.ts +265 -0
- package/src/client/batch-request.ts +485 -0
- package/src/client/build-occurrences.ts +155 -0
- package/src/client/database.ts +175 -18
- package/src/client/delete-builder.ts +149 -48
- package/src/client/entity-set.ts +134 -28
- package/src/client/filemaker-odata.ts +179 -35
- package/src/client/insert-builder.ts +350 -40
- package/src/client/query-builder.ts +632 -244
- package/src/client/query-builder.ts.bak +1457 -0
- package/src/client/record-builder.ts +692 -68
- package/src/client/response-processor.ts +103 -0
- package/src/client/schema-manager.ts +246 -0
- package/src/client/table-occurrence.ts +107 -51
- package/src/client/update-builder.ts +235 -49
- package/src/errors.ts +217 -0
- package/src/index.ts +63 -6
- package/src/transform.ts +249 -0
- package/src/types.ts +201 -35
- package/src/validation.ts +120 -36
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FFetchOptions } from '@fetchkit/ffetch';
|
|
2
|
+
import { ExecutionContext } from '../types.js';
|
|
3
|
+
type GenericField = {
|
|
4
|
+
name: string;
|
|
5
|
+
nullable?: boolean;
|
|
6
|
+
primary?: boolean;
|
|
7
|
+
unique?: boolean;
|
|
8
|
+
global?: boolean;
|
|
9
|
+
repetitions?: number;
|
|
10
|
+
};
|
|
11
|
+
type StringField = GenericField & {
|
|
12
|
+
type: "string";
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
default?: "USER" | "USERNAME" | "CURRENT_USER";
|
|
15
|
+
};
|
|
16
|
+
type NumericField = GenericField & {
|
|
17
|
+
type: "numeric";
|
|
18
|
+
};
|
|
19
|
+
type DateField = GenericField & {
|
|
20
|
+
type: "date";
|
|
21
|
+
default?: "CURRENT_DATE" | "CURDATE";
|
|
22
|
+
};
|
|
23
|
+
type TimeField = GenericField & {
|
|
24
|
+
type: "time";
|
|
25
|
+
default?: "CURRENT_TIME" | "CURTIME";
|
|
26
|
+
};
|
|
27
|
+
type TimestampField = GenericField & {
|
|
28
|
+
type: "timestamp";
|
|
29
|
+
default?: "CURRENT_TIMESTAMP" | "CURTIMESTAMP";
|
|
30
|
+
};
|
|
31
|
+
type ContainerField = GenericField & {
|
|
32
|
+
type: "container";
|
|
33
|
+
externalSecurePath?: string;
|
|
34
|
+
};
|
|
35
|
+
export type Field = StringField | NumericField | DateField | TimeField | TimestampField | ContainerField;
|
|
36
|
+
export type { StringField, NumericField, DateField, TimeField, TimestampField, ContainerField, };
|
|
37
|
+
type FileMakerField = Omit<Field, "type" | "repetitions" | "maxLength"> & {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
type TableDefinition = {
|
|
41
|
+
tableName: string;
|
|
42
|
+
fields: FileMakerField[];
|
|
43
|
+
};
|
|
44
|
+
export declare class SchemaManager {
|
|
45
|
+
private readonly databaseName;
|
|
46
|
+
private readonly context;
|
|
47
|
+
constructor(databaseName: string, context: ExecutionContext);
|
|
48
|
+
createTable(tableName: string, fields: Field[], options?: RequestInit & FFetchOptions): Promise<TableDefinition>;
|
|
49
|
+
addFields(tableName: string, fields: Field[], options?: RequestInit & FFetchOptions): Promise<TableDefinition>;
|
|
50
|
+
deleteTable(tableName: string, options?: RequestInit & FFetchOptions): Promise<void>;
|
|
51
|
+
deleteField(tableName: string, fieldName: string, options?: RequestInit & FFetchOptions): Promise<void>;
|
|
52
|
+
createIndex(tableName: string, fieldName: string, options?: RequestInit & FFetchOptions): Promise<{
|
|
53
|
+
indexName: string;
|
|
54
|
+
}>;
|
|
55
|
+
deleteIndex(tableName: string, fieldName: string, options?: RequestInit & FFetchOptions): Promise<void>;
|
|
56
|
+
private static compileFieldDefinition;
|
|
57
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
class SchemaManager {
|
|
2
|
+
constructor(databaseName, context) {
|
|
3
|
+
this.databaseName = databaseName;
|
|
4
|
+
this.context = context;
|
|
5
|
+
}
|
|
6
|
+
async createTable(tableName, fields, options) {
|
|
7
|
+
const result = await this.context._makeRequest(
|
|
8
|
+
`/${this.databaseName}/FileMaker_Tables`,
|
|
9
|
+
{
|
|
10
|
+
method: "POST",
|
|
11
|
+
body: JSON.stringify({
|
|
12
|
+
tableName,
|
|
13
|
+
fields: fields.map(SchemaManager.compileFieldDefinition)
|
|
14
|
+
}),
|
|
15
|
+
...options
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
if (result.error) {
|
|
19
|
+
throw result.error;
|
|
20
|
+
}
|
|
21
|
+
return result.data;
|
|
22
|
+
}
|
|
23
|
+
async addFields(tableName, fields, options) {
|
|
24
|
+
const result = await this.context._makeRequest(
|
|
25
|
+
`/${this.databaseName}/FileMaker_Tables/${tableName}`,
|
|
26
|
+
{
|
|
27
|
+
method: "PATCH",
|
|
28
|
+
body: JSON.stringify({
|
|
29
|
+
fields: fields.map(SchemaManager.compileFieldDefinition)
|
|
30
|
+
}),
|
|
31
|
+
...options
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
if (result.error) {
|
|
35
|
+
throw result.error;
|
|
36
|
+
}
|
|
37
|
+
return result.data;
|
|
38
|
+
}
|
|
39
|
+
async deleteTable(tableName, options) {
|
|
40
|
+
const result = await this.context._makeRequest(
|
|
41
|
+
`/${this.databaseName}/FileMaker_Tables/${tableName}`,
|
|
42
|
+
{ method: "DELETE", ...options }
|
|
43
|
+
);
|
|
44
|
+
if (result.error) {
|
|
45
|
+
throw result.error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async deleteField(tableName, fieldName, options) {
|
|
49
|
+
const result = await this.context._makeRequest(
|
|
50
|
+
`/${this.databaseName}/FileMaker_Tables/${tableName}/${fieldName}`,
|
|
51
|
+
{
|
|
52
|
+
method: "DELETE",
|
|
53
|
+
...options
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
if (result.error) {
|
|
57
|
+
throw result.error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async createIndex(tableName, fieldName, options) {
|
|
61
|
+
const result = await this.context._makeRequest(
|
|
62
|
+
`/${this.databaseName}/FileMaker_Indexes/${tableName}`,
|
|
63
|
+
{
|
|
64
|
+
method: "POST",
|
|
65
|
+
body: JSON.stringify({ indexName: fieldName }),
|
|
66
|
+
...options
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
if (result.error) {
|
|
70
|
+
throw result.error;
|
|
71
|
+
}
|
|
72
|
+
return result.data;
|
|
73
|
+
}
|
|
74
|
+
async deleteIndex(tableName, fieldName, options) {
|
|
75
|
+
const result = await this.context._makeRequest(
|
|
76
|
+
`/${this.databaseName}/FileMaker_Indexes/${tableName}/${fieldName}`,
|
|
77
|
+
{
|
|
78
|
+
method: "DELETE",
|
|
79
|
+
...options
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
if (result.error) {
|
|
83
|
+
throw result.error;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
static compileFieldDefinition(field) {
|
|
87
|
+
let type = field.type;
|
|
88
|
+
const repetitions = field.repetitions;
|
|
89
|
+
if (field.type === "string") {
|
|
90
|
+
type = "varchar";
|
|
91
|
+
const stringField = field;
|
|
92
|
+
if (stringField.maxLength !== void 0) {
|
|
93
|
+
type += `(${stringField.maxLength})`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (repetitions !== void 0) {
|
|
97
|
+
type += `[${repetitions}]`;
|
|
98
|
+
}
|
|
99
|
+
const result = {
|
|
100
|
+
name: field.name,
|
|
101
|
+
type
|
|
102
|
+
};
|
|
103
|
+
if (field.nullable !== void 0) result.nullable = field.nullable;
|
|
104
|
+
if (field.primary !== void 0) result.primary = field.primary;
|
|
105
|
+
if (field.unique !== void 0) result.unique = field.unique;
|
|
106
|
+
if (field.global !== void 0) result.global = field.global;
|
|
107
|
+
if (field.type === "string") {
|
|
108
|
+
const stringField = field;
|
|
109
|
+
if (stringField.default !== void 0)
|
|
110
|
+
result.default = stringField.default;
|
|
111
|
+
} else if (field.type === "date") {
|
|
112
|
+
const dateField = field;
|
|
113
|
+
if (dateField.default !== void 0) result.default = dateField.default;
|
|
114
|
+
} else if (field.type === "time") {
|
|
115
|
+
const timeField = field;
|
|
116
|
+
if (timeField.default !== void 0) result.default = timeField.default;
|
|
117
|
+
} else if (field.type === "timestamp") {
|
|
118
|
+
const timestampField = field;
|
|
119
|
+
if (timestampField.default !== void 0)
|
|
120
|
+
result.default = timestampField.default;
|
|
121
|
+
} else if (field.type === "container") {
|
|
122
|
+
const containerField = field;
|
|
123
|
+
if (containerField.externalSecurePath !== void 0)
|
|
124
|
+
result.externalSecurePath = containerField.externalSecurePath;
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
SchemaManager
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=schema-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-manager.js","sources":["../../../src/client/schema-manager.ts"],"sourcesContent":["import type { FFetchOptions } from \"@fetchkit/ffetch\";\nimport type { ExecutionContext } from \"../types\";\n\ntype GenericField = {\n name: string;\n nullable?: boolean;\n primary?: boolean;\n unique?: boolean;\n global?: boolean;\n repetitions?: number;\n};\n\ntype StringField = GenericField & {\n type: \"string\";\n maxLength?: number;\n default?: \"USER\" | \"USERNAME\" | \"CURRENT_USER\";\n};\n\ntype NumericField = GenericField & {\n type: \"numeric\";\n};\n\ntype DateField = GenericField & {\n type: \"date\";\n default?: \"CURRENT_DATE\" | \"CURDATE\";\n};\n\ntype TimeField = GenericField & {\n type: \"time\";\n default?: \"CURRENT_TIME\" | \"CURTIME\";\n};\n\ntype TimestampField = GenericField & {\n type: \"timestamp\";\n default?: \"CURRENT_TIMESTAMP\" | \"CURTIMESTAMP\";\n};\n\ntype ContainerField = GenericField & {\n type: \"container\";\n externalSecurePath?: string;\n};\n\nexport type Field =\n | StringField\n | NumericField\n | DateField\n | TimeField\n | TimestampField\n | ContainerField;\n\nexport type {\n StringField,\n NumericField,\n DateField,\n TimeField,\n TimestampField,\n ContainerField,\n};\n\ntype FileMakerField = Omit<Field, \"type\" | \"repetitions\" | \"maxLength\"> & {\n type: string;\n};\n\ntype TableDefinition = {\n tableName: string;\n fields: FileMakerField[];\n};\n\nexport class SchemaManager {\n public constructor(\n private readonly databaseName: string,\n private readonly context: ExecutionContext,\n ) {}\n\n public async createTable(\n tableName: string,\n fields: Field[],\n options?: RequestInit & FFetchOptions,\n ): Promise<TableDefinition> {\n const result = await this.context._makeRequest<TableDefinition>(\n `/${this.databaseName}/FileMaker_Tables`,\n {\n method: \"POST\",\n body: JSON.stringify({\n tableName,\n fields: fields.map(SchemaManager.compileFieldDefinition),\n }),\n ...options,\n },\n );\n\n if (result.error) {\n throw result.error;\n }\n\n return result.data;\n }\n\n public async addFields(\n tableName: string,\n fields: Field[],\n options?: RequestInit & FFetchOptions,\n ): Promise<TableDefinition> {\n const result = await this.context._makeRequest<TableDefinition>(\n `/${this.databaseName}/FileMaker_Tables/${tableName}`,\n {\n method: \"PATCH\",\n body: JSON.stringify({\n fields: fields.map(SchemaManager.compileFieldDefinition),\n }),\n ...options,\n },\n );\n\n if (result.error) {\n throw result.error;\n }\n\n return result.data;\n }\n\n public async deleteTable(\n tableName: string,\n options?: RequestInit & FFetchOptions,\n ): Promise<void> {\n const result = await this.context._makeRequest(\n `/${this.databaseName}/FileMaker_Tables/${tableName}`,\n { method: \"DELETE\", ...options },\n );\n\n if (result.error) {\n throw result.error;\n }\n }\n\n public async deleteField(\n tableName: string,\n fieldName: string,\n options?: RequestInit & FFetchOptions,\n ): Promise<void> {\n const result = await this.context._makeRequest(\n `/${this.databaseName}/FileMaker_Tables/${tableName}/${fieldName}`,\n {\n method: \"DELETE\",\n ...options,\n },\n );\n\n if (result.error) {\n throw result.error;\n }\n }\n\n public async createIndex(\n tableName: string,\n fieldName: string,\n options?: RequestInit & FFetchOptions,\n ): Promise<{ indexName: string }> {\n const result = await this.context._makeRequest<{ indexName: string }>(\n `/${this.databaseName}/FileMaker_Indexes/${tableName}`,\n {\n method: \"POST\",\n body: JSON.stringify({ indexName: fieldName }),\n ...options,\n },\n );\n\n if (result.error) {\n throw result.error;\n }\n\n return result.data;\n }\n\n public async deleteIndex(\n tableName: string,\n fieldName: string,\n options?: RequestInit & FFetchOptions,\n ): Promise<void> {\n const result = await this.context._makeRequest(\n `/${this.databaseName}/FileMaker_Indexes/${tableName}/${fieldName}`,\n {\n method: \"DELETE\",\n ...options,\n },\n );\n\n if (result.error) {\n throw result.error;\n }\n }\n\n private static compileFieldDefinition(field: Field): FileMakerField {\n let type: string = field.type;\n const repetitions = field.repetitions;\n\n // Handle string fields - convert to varchar and add maxLength if present\n if (field.type === \"string\") {\n type = \"varchar\";\n const stringField = field as StringField;\n if (stringField.maxLength !== undefined) {\n type += `(${stringField.maxLength})`;\n }\n }\n\n // Add repetitions suffix if present\n if (repetitions !== undefined) {\n type += `[${repetitions}]`;\n }\n\n // Build the result object, excluding type, maxLength, and repetitions\n const result: any = {\n name: field.name,\n type,\n };\n\n // Add optional properties that FileMaker expects\n if (field.nullable !== undefined) result.nullable = field.nullable;\n if (field.primary !== undefined) result.primary = field.primary;\n if (field.unique !== undefined) result.unique = field.unique;\n if (field.global !== undefined) result.global = field.global;\n\n // Add type-specific properties\n if (field.type === \"string\") {\n const stringField = field as StringField;\n if (stringField.default !== undefined)\n result.default = stringField.default;\n } else if (field.type === \"date\") {\n const dateField = field as DateField;\n if (dateField.default !== undefined) result.default = dateField.default;\n } else if (field.type === \"time\") {\n const timeField = field as TimeField;\n if (timeField.default !== undefined) result.default = timeField.default;\n } else if (field.type === \"timestamp\") {\n const timestampField = field as TimestampField;\n if (timestampField.default !== undefined)\n result.default = timestampField.default;\n } else if (field.type === \"container\") {\n const containerField = field as ContainerField;\n if (containerField.externalSecurePath !== undefined)\n result.externalSecurePath = containerField.externalSecurePath;\n }\n\n return result as FileMakerField;\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,25 +1,86 @@
|
|
|
1
1
|
import { BaseTable } from './base-table.js';
|
|
2
2
|
type ExtractSchema<BT> = BT extends BaseTable<infer S, any, any, any> ? S : never;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export declare class TableOccurrence<BT extends BaseTable<any, any, any, any> = any, Name extends string = string, Nav extends Record<string, TableOccurrence<any, any, any, any> | (() => TableOccurrence<any, any, any, any>)> = {}, DefSelect extends "all" | "schema" | readonly (keyof ExtractSchema<BT>)[] = "schema"> {
|
|
3
|
+
declare const INTERNAL_NAV: unique symbol;
|
|
4
|
+
export declare class TableOccurrence<BT extends BaseTable<any, any, any, any> = any, Name extends string = string, Nav extends Record<string, TableOccurrence<any, any, any, any>> = {}, DefSelect extends "all" | "schema" | readonly (keyof ExtractSchema<BT>)[] = "schema"> {
|
|
7
5
|
readonly name: Name;
|
|
8
6
|
readonly baseTable: BT;
|
|
9
|
-
|
|
10
|
-
readonly navigation: ResolveNavigation<Nav>;
|
|
7
|
+
readonly navigation: Nav;
|
|
11
8
|
readonly defaultSelect: DefSelect;
|
|
9
|
+
readonly fmtId?: `FMTID:${string}`;
|
|
12
10
|
constructor(config: {
|
|
13
11
|
readonly name: Name;
|
|
14
12
|
readonly baseTable: BT;
|
|
15
|
-
readonly navigation?: Nav;
|
|
16
13
|
readonly defaultSelect?: DefSelect;
|
|
14
|
+
readonly fmtId?: `FMTID:${string}`;
|
|
15
|
+
/** @internal Used by buildOccurrences - do not use directly */
|
|
16
|
+
readonly [INTERNAL_NAV]?: Nav;
|
|
17
17
|
});
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Returns the FileMaker table occurrence ID (FMTID) if available, or the table name.
|
|
20
|
+
* @returns The FMTID string or the table name
|
|
21
|
+
*/
|
|
22
|
+
getTableId(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the table occurrence name.
|
|
25
|
+
* @returns The table name
|
|
26
|
+
*/
|
|
27
|
+
getTableName(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if this TableOccurrence is using FileMaker table occurrence IDs.
|
|
30
|
+
*/
|
|
31
|
+
isUsingTableId(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @internal Creates a new TableOccurrence with navigation - used by buildOccurrences
|
|
34
|
+
*/
|
|
35
|
+
static _withNavigation<BT extends BaseTable<any, any, any, any>, Name extends string, Nav extends Record<string, TableOccurrence<any, any, any, any>>, DefSelect extends "all" | "schema" | readonly (keyof ExtractSchema<BT>)[] = "schema">(base: TableOccurrence<BT, Name, any, DefSelect>, navigation: Nav): TableOccurrence<BT, Name, Nav, DefSelect>;
|
|
19
36
|
}
|
|
20
37
|
export declare function createTableOccurrence<const Name extends string, BT extends BaseTable<any, any, any, any>, DefSelect extends "all" | "schema" | readonly (keyof ExtractSchema<BT>)[] = "schema">(config: {
|
|
21
38
|
name: Name;
|
|
22
39
|
baseTable: BT;
|
|
23
40
|
defaultSelect?: DefSelect;
|
|
41
|
+
fmtId?: `FMTID:${string}`;
|
|
42
|
+
}): TableOccurrence<BT, Name, {}, DefSelect>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a TableOccurrence with proper TypeScript type inference.
|
|
45
|
+
*
|
|
46
|
+
* Use this function to create TableOccurrence instances with full type safety.
|
|
47
|
+
* For navigation between tables, use `buildOccurrences()` after defining your TOs.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const users = defineTableOccurrence({
|
|
52
|
+
* name: "users",
|
|
53
|
+
* baseTable: usersBase,
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example With entity IDs
|
|
58
|
+
* ```ts
|
|
59
|
+
* const products = defineTableOccurrence({
|
|
60
|
+
* name: "products",
|
|
61
|
+
* baseTable: productsBase,
|
|
62
|
+
* fmtId: "FMTID:12345",
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @example With navigation (use buildOccurrences)
|
|
67
|
+
* ```ts
|
|
68
|
+
* const _users = defineTableOccurrence({ name: "users", baseTable: usersBase });
|
|
69
|
+
* const _contacts = defineTableOccurrence({ name: "contacts", baseTable: contactsBase });
|
|
70
|
+
*
|
|
71
|
+
* const [users, contacts] = buildOccurrences({
|
|
72
|
+
* occurrences: [_users, _contacts],
|
|
73
|
+
* navigation: {
|
|
74
|
+
* users: ["contacts"],
|
|
75
|
+
* contacts: ["users"],
|
|
76
|
+
* },
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function defineTableOccurrence<const Name extends string, BT extends BaseTable<any, any, any, any>, const DefSelect extends "all" | "schema" | readonly (keyof ExtractSchema<BT>)[] = "schema">(config: {
|
|
81
|
+
readonly name: Name;
|
|
82
|
+
readonly baseTable: BT;
|
|
83
|
+
readonly fmtId?: `FMTID:${string}`;
|
|
84
|
+
readonly defaultSelect?: DefSelect;
|
|
24
85
|
}): TableOccurrence<BT, Name, {}, DefSelect>;
|
|
25
86
|
export {};
|
|
@@ -1,47 +1,58 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
|
|
5
|
-
const result = {};
|
|
6
|
-
for (const key in navConfig) {
|
|
7
|
-
Object.defineProperty(result, key, {
|
|
8
|
-
get() {
|
|
9
|
-
const navItem = navConfig[key];
|
|
10
|
-
return typeof navItem === "function" ? navItem() : navItem;
|
|
11
|
-
},
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
4
|
+
const INTERNAL_NAV = Symbol("internal-navigation");
|
|
18
5
|
class TableOccurrence {
|
|
19
6
|
constructor(config) {
|
|
20
7
|
__publicField(this, "name");
|
|
21
8
|
__publicField(this, "baseTable");
|
|
22
|
-
__publicField(this, "_navigationConfig");
|
|
23
9
|
__publicField(this, "navigation");
|
|
24
10
|
__publicField(this, "defaultSelect");
|
|
11
|
+
__publicField(this, "fmtId");
|
|
25
12
|
this.name = config.name;
|
|
26
13
|
this.baseTable = config.baseTable;
|
|
27
|
-
this.
|
|
14
|
+
this.navigation = config[INTERNAL_NAV] ?? {};
|
|
28
15
|
this.defaultSelect = config.defaultSelect ?? "schema";
|
|
29
|
-
this.
|
|
16
|
+
this.fmtId = config.fmtId;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns the FileMaker table occurrence ID (FMTID) if available, or the table name.
|
|
20
|
+
* @returns The FMTID string or the table name
|
|
21
|
+
*/
|
|
22
|
+
getTableId() {
|
|
23
|
+
return this.fmtId ?? this.name;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the table occurrence name.
|
|
27
|
+
* @returns The table name
|
|
28
|
+
*/
|
|
29
|
+
getTableName() {
|
|
30
|
+
return this.name;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns true if this TableOccurrence is using FileMaker table occurrence IDs.
|
|
34
|
+
*/
|
|
35
|
+
isUsingTableId() {
|
|
36
|
+
return this.fmtId !== void 0;
|
|
30
37
|
}
|
|
31
|
-
|
|
38
|
+
/**
|
|
39
|
+
* @internal Creates a new TableOccurrence with navigation - used by buildOccurrences
|
|
40
|
+
*/
|
|
41
|
+
static _withNavigation(base, navigation) {
|
|
32
42
|
return new TableOccurrence({
|
|
33
|
-
name:
|
|
34
|
-
baseTable:
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
name: base.name,
|
|
44
|
+
baseTable: base.baseTable,
|
|
45
|
+
defaultSelect: base.defaultSelect,
|
|
46
|
+
fmtId: base.fmtId,
|
|
47
|
+
[INTERNAL_NAV]: navigation
|
|
37
48
|
});
|
|
38
49
|
}
|
|
39
50
|
}
|
|
40
|
-
function
|
|
51
|
+
function defineTableOccurrence(config) {
|
|
41
52
|
return new TableOccurrence(config);
|
|
42
53
|
}
|
|
43
54
|
export {
|
|
44
55
|
TableOccurrence,
|
|
45
|
-
|
|
56
|
+
defineTableOccurrence
|
|
46
57
|
};
|
|
47
58
|
//# sourceMappingURL=table-occurrence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-occurrence.js","sources":["../../../src/client/table-occurrence.ts"],"sourcesContent":["import { BaseTable } from \"./base-table\";\n\n// Helper type to extract schema from BaseTable\ntype ExtractSchema<BT> =\n BT extends BaseTable<infer S, any, any, any> ? S : never;\n\n//
|
|
1
|
+
{"version":3,"file":"table-occurrence.js","sources":["../../../src/client/table-occurrence.ts"],"sourcesContent":["import { BaseTable } from \"./base-table\";\n\n// Helper type to extract schema from BaseTable\ntype ExtractSchema<BT> =\n BT extends BaseTable<infer S, any, any, any> ? S : never;\n\n// Symbol for internal navigation setting (used by buildOccurrences)\nconst INTERNAL_NAV = Symbol(\"internal-navigation\");\n\nexport class TableOccurrence<\n BT extends BaseTable<any, any, any, any> = any,\n Name extends string = string,\n Nav extends Record<string, TableOccurrence<any, any, any, any>> = {},\n DefSelect extends\n | \"all\"\n | \"schema\"\n | readonly (keyof ExtractSchema<BT>)[] = \"schema\",\n> {\n public readonly name: Name;\n public readonly baseTable: BT;\n public readonly navigation: Nav;\n public readonly defaultSelect: DefSelect;\n public readonly fmtId?: `FMTID:${string}`;\n\n constructor(config: {\n readonly name: Name;\n readonly baseTable: BT;\n readonly defaultSelect?: DefSelect;\n readonly fmtId?: `FMTID:${string}`;\n /** @internal Used by buildOccurrences - do not use directly */\n readonly [INTERNAL_NAV]?: Nav;\n }) {\n this.name = config.name;\n this.baseTable = config.baseTable;\n this.navigation = (config[INTERNAL_NAV] ?? {}) as Nav;\n this.defaultSelect = (config.defaultSelect ?? \"schema\") as DefSelect;\n this.fmtId = config.fmtId;\n }\n\n /**\n * Returns the FileMaker table occurrence ID (FMTID) if available, or the table name.\n * @returns The FMTID string or the table name\n */\n getTableId(): string {\n return this.fmtId ?? this.name;\n }\n\n /**\n * Returns the table occurrence name.\n * @returns The table name\n */\n getTableName(): string {\n return this.name;\n }\n\n /**\n * Returns true if this TableOccurrence is using FileMaker table occurrence IDs.\n */\n isUsingTableId(): boolean {\n return this.fmtId !== undefined;\n }\n\n /**\n * @internal Creates a new TableOccurrence with navigation - used by buildOccurrences\n */\n static _withNavigation<\n BT extends BaseTable<any, any, any, any>,\n Name extends string,\n Nav extends Record<string, TableOccurrence<any, any, any, any>>,\n DefSelect extends\n | \"all\"\n | \"schema\"\n | readonly (keyof ExtractSchema<BT>)[] = \"schema\",\n >(\n base: TableOccurrence<BT, Name, any, DefSelect>,\n navigation: Nav,\n ): TableOccurrence<BT, Name, Nav, DefSelect> {\n return new TableOccurrence({\n name: base.name,\n baseTable: base.baseTable,\n defaultSelect: base.defaultSelect,\n fmtId: base.fmtId,\n [INTERNAL_NAV]: navigation,\n }) as TableOccurrence<BT, Name, Nav, DefSelect>;\n }\n}\n\n// Helper function to create TableOccurrence with proper type inference\nexport function createTableOccurrence<\n const Name extends string,\n BT extends BaseTable<any, any, any, any>,\n DefSelect extends\n | \"all\"\n | \"schema\"\n | readonly (keyof ExtractSchema<BT>)[] = \"schema\",\n>(config: {\n name: Name;\n baseTable: BT;\n defaultSelect?: DefSelect;\n fmtId?: `FMTID:${string}`;\n}): TableOccurrence<BT, Name, {}, DefSelect> {\n return new TableOccurrence(config);\n}\n\n/**\n * Creates a TableOccurrence with proper TypeScript type inference.\n *\n * Use this function to create TableOccurrence instances with full type safety.\n * For navigation between tables, use `buildOccurrences()` after defining your TOs.\n *\n * @example\n * ```ts\n * const users = defineTableOccurrence({\n * name: \"users\",\n * baseTable: usersBase,\n * });\n * ```\n *\n * @example With entity IDs\n * ```ts\n * const products = defineTableOccurrence({\n * name: \"products\",\n * baseTable: productsBase,\n * fmtId: \"FMTID:12345\",\n * });\n * ```\n *\n * @example With navigation (use buildOccurrences)\n * ```ts\n * const _users = defineTableOccurrence({ name: \"users\", baseTable: usersBase });\n * const _contacts = defineTableOccurrence({ name: \"contacts\", baseTable: contactsBase });\n *\n * const [users, contacts] = buildOccurrences({\n * occurrences: [_users, _contacts],\n * navigation: {\n * users: [\"contacts\"],\n * contacts: [\"users\"],\n * },\n * });\n * ```\n */\nexport function defineTableOccurrence<\n const Name extends string,\n BT extends BaseTable<any, any, any, any>,\n const DefSelect extends\n | \"all\"\n | \"schema\"\n | readonly (keyof ExtractSchema<BT>)[] = \"schema\",\n>(config: {\n readonly name: Name;\n readonly baseTable: BT;\n readonly fmtId?: `FMTID:${string}`;\n readonly defaultSelect?: DefSelect;\n}): TableOccurrence<BT, Name, {}, DefSelect> {\n return new TableOccurrence(config);\n}\n"],"names":[],"mappings":";;;AAOA,MAAM,eAAe,OAAO,qBAAqB;AAE1C,MAAM,gBAQX;AAAA,EAOA,YAAY,QAOT;AAba;AACA;AACA;AACA;AACA;AAUd,SAAK,OAAO,OAAO;AACnB,SAAK,YAAY,OAAO;AACxB,SAAK,aAAc,OAAO,YAAY,KAAK,CAAC;AACvC,SAAA,gBAAiB,OAAO,iBAAiB;AAC9C,SAAK,QAAQ,OAAO;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOtB,aAAqB;AACZ,WAAA,KAAK,SAAS,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO5B,eAAuB;AACrB,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMd,iBAA0B;AACxB,WAAO,KAAK,UAAU;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMxB,OAAO,gBASL,MACA,YAC2C;AAC3C,WAAO,IAAI,gBAAgB;AAAA,MACzB,MAAM,KAAK;AAAA,MACX,WAAW,KAAK;AAAA,MAChB,eAAe,KAAK;AAAA,MACpB,OAAO,KAAK;AAAA,MACZ,CAAC,YAAY,GAAG;AAAA,IAAA,CACjB;AAAA,EAAA;AAEL;AAwDO,SAAS,sBAOd,QAK2C;AACpC,SAAA,IAAI,gBAAgB,MAAM;AACnC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExecutionContext, ExecutableBuilder, Result, WithSystemFields } from '../types.js';
|
|
1
|
+
import { ExecutionContext, ExecutableBuilder, Result, WithSystemFields, ExecuteOptions } from '../types.js';
|
|
2
2
|
import { TableOccurrence } from './table-occurrence.js';
|
|
3
3
|
import { BaseTable } from './base-table.js';
|
|
4
4
|
import { QueryBuilder } from './query-builder.js';
|
|
@@ -7,39 +7,43 @@ import { FFetchOptions } from '@fetchkit/ffetch';
|
|
|
7
7
|
* Initial update builder returned from EntitySet.update(data)
|
|
8
8
|
* Requires calling .byId() or .where() before .execute() is available
|
|
9
9
|
*/
|
|
10
|
-
export declare class UpdateBuilder<T extends Record<string, any>, BT extends BaseTable<any, any, any, any
|
|
10
|
+
export declare class UpdateBuilder<T extends Record<string, any>, BT extends BaseTable<any, any, any, any>, ReturnPreference extends "minimal" | "representation" = "minimal"> {
|
|
11
11
|
private tableName;
|
|
12
12
|
private databaseName;
|
|
13
13
|
private context;
|
|
14
14
|
private occurrence?;
|
|
15
15
|
private data;
|
|
16
|
+
private returnPreference;
|
|
17
|
+
private databaseUseEntityIds;
|
|
16
18
|
constructor(config: {
|
|
17
19
|
occurrence?: TableOccurrence<any, any, any, any>;
|
|
18
20
|
tableName: string;
|
|
19
21
|
databaseName: string;
|
|
20
22
|
context: ExecutionContext;
|
|
21
23
|
data: Partial<T>;
|
|
24
|
+
returnPreference: ReturnPreference;
|
|
25
|
+
databaseUseEntityIds?: boolean;
|
|
22
26
|
});
|
|
23
27
|
/**
|
|
24
28
|
* Update a single record by ID
|
|
25
|
-
* Returns
|
|
29
|
+
* Returns updated count by default, or full record if returnFullRecord was set to true
|
|
26
30
|
*/
|
|
27
|
-
byId(id: string | number): ExecutableUpdateBuilder<T, true>;
|
|
31
|
+
byId(id: string | number): ExecutableUpdateBuilder<T, true, ReturnPreference>;
|
|
28
32
|
/**
|
|
29
33
|
* Update records matching a filter query
|
|
30
|
-
* Returns
|
|
34
|
+
* Returns updated count by default, or full record if returnFullRecord was set to true
|
|
31
35
|
* @param fn Callback that receives a QueryBuilder for building the filter
|
|
32
36
|
*/
|
|
33
|
-
where(fn: (q: QueryBuilder<WithSystemFields<T>>) => QueryBuilder<WithSystemFields<T>>): ExecutableUpdateBuilder<T, true>;
|
|
37
|
+
where(fn: (q: QueryBuilder<WithSystemFields<T>>) => QueryBuilder<WithSystemFields<T>>): ExecutableUpdateBuilder<T, true, ReturnPreference>;
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
40
|
* Executable update builder - has execute() method
|
|
37
41
|
* Returned after calling .byId() or .where()
|
|
38
|
-
*
|
|
42
|
+
* Can return either updated count or full record based on returnFullRecord option
|
|
39
43
|
*/
|
|
40
|
-
export declare class ExecutableUpdateBuilder<T extends Record<string, any>, IsByFilter extends boolean> implements ExecutableBuilder<{
|
|
44
|
+
export declare class ExecutableUpdateBuilder<T extends Record<string, any>, IsByFilter extends boolean, ReturnPreference extends "minimal" | "representation" = "minimal"> implements ExecutableBuilder<ReturnPreference extends "minimal" ? {
|
|
41
45
|
updatedCount: number;
|
|
42
|
-
}> {
|
|
46
|
+
} : T> {
|
|
43
47
|
private tableName;
|
|
44
48
|
private databaseName;
|
|
45
49
|
private context;
|
|
@@ -48,6 +52,8 @@ export declare class ExecutableUpdateBuilder<T extends Record<string, any>, IsBy
|
|
|
48
52
|
private mode;
|
|
49
53
|
private recordId?;
|
|
50
54
|
private queryBuilder?;
|
|
55
|
+
private returnPreference;
|
|
56
|
+
private databaseUseEntityIds;
|
|
51
57
|
constructor(config: {
|
|
52
58
|
occurrence?: TableOccurrence<any, any, any, any>;
|
|
53
59
|
tableName: string;
|
|
@@ -57,13 +63,30 @@ export declare class ExecutableUpdateBuilder<T extends Record<string, any>, IsBy
|
|
|
57
63
|
mode: "byId" | "byFilter";
|
|
58
64
|
recordId?: string | number;
|
|
59
65
|
queryBuilder?: QueryBuilder<any>;
|
|
66
|
+
returnPreference: ReturnPreference;
|
|
67
|
+
databaseUseEntityIds?: boolean;
|
|
60
68
|
});
|
|
61
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Helper to merge database-level useEntityIds with per-request options
|
|
71
|
+
*/
|
|
72
|
+
private mergeExecuteOptions;
|
|
73
|
+
/**
|
|
74
|
+
* Gets the table ID (FMTID) if using entity IDs, otherwise returns the table name
|
|
75
|
+
* @param useEntityIds - Optional override for entity ID usage
|
|
76
|
+
*/
|
|
77
|
+
private getTableId;
|
|
78
|
+
execute(options?: RequestInit & FFetchOptions & {
|
|
79
|
+
useEntityIds?: boolean;
|
|
80
|
+
}): Promise<Result<ReturnPreference extends "minimal" ? {
|
|
62
81
|
updatedCount: number;
|
|
63
|
-
}>>;
|
|
82
|
+
} : T>>;
|
|
64
83
|
getRequestConfig(): {
|
|
65
84
|
method: string;
|
|
66
85
|
url: string;
|
|
67
86
|
body?: any;
|
|
68
87
|
};
|
|
88
|
+
toRequest(baseUrl: string): Request;
|
|
89
|
+
processResponse(response: Response, options?: ExecuteOptions): Promise<Result<ReturnPreference extends "minimal" ? {
|
|
90
|
+
updatedCount: number;
|
|
91
|
+
} : T>>;
|
|
69
92
|
}
|