@jd-data-limited/easy-fm 3.0.9 → 3.1.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.
- package/.idea/compiler.xml +7 -0
- package/.idea/discord.xml +7 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.LICENSE.txt +3 -0
- package/examples/test.js +7 -0
- package/img.png +0 -0
- package/package.json +1 -1
- package/src/FMError.d.ts +12 -0
- package/src/FMError.js +1028 -0
- package/src/FMError.ts +1035 -0
- package/src/connection/FMHost.d.ts +12 -0
- package/src/connection/FMHost.js +68 -0
- package/src/connection/FMHost.ts +75 -0
- package/src/connection/database.d.ts +26 -0
- package/src/connection/database.js +195 -0
- package/src/connection/database.ts +216 -0
- package/src/connection/generateAuthorizationHeaders.d.ts +2 -0
- package/src/connection/generateAuthorizationHeaders.js +23 -0
- package/src/connection/generateAuthorizationHeaders.ts +32 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +5 -2073
- package/src/index.ts +3 -2323
- package/src/layouts/layout.d.ts +29 -0
- package/src/layouts/layout.js +84 -0
- package/src/layouts/layout.ts +92 -0
- package/src/layouts/layoutInterface.d.ts +13 -0
- package/src/layouts/layoutInterface.js +4 -0
- package/src/layouts/layoutInterface.ts +21 -0
- package/src/layouts/layoutRecordManager.d.ts +13 -0
- package/src/layouts/layoutRecordManager.js +50 -0
- package/src/layouts/layoutRecordManager.ts +59 -0
- package/src/records/field.d.ts +21 -0
- package/src/records/field.js +177 -0
- package/src/records/field.ts +189 -0
- package/src/records/getOperations/find.d.ts +15 -0
- package/src/records/getOperations/find.js +90 -0
- package/src/records/getOperations/find.ts +88 -0
- package/src/records/getOperations/recordGetOperation.d.ts +17 -0
- package/src/records/getOperations/recordGetOperation.js +43 -0
- package/src/records/getOperations/recordGetOperation.ts +54 -0
- package/src/records/getOperations/recordGetRange.d.ts +13 -0
- package/src/records/getOperations/recordGetRange.js +95 -0
- package/src/records/getOperations/recordGetRange.ts +84 -0
- package/src/records/layoutRecord.d.ts +16 -0
- package/src/records/layoutRecord.js +211 -0
- package/src/records/layoutRecord.ts +220 -0
- package/src/records/portal.d.ts +10 -0
- package/src/records/portal.js +19 -0
- package/src/records/portal.ts +28 -0
- package/src/records/portalRecord.d.ts +12 -0
- package/src/records/portalRecord.js +32 -0
- package/src/records/portalRecord.ts +43 -0
- package/src/records/recordBase.d.ts +20 -0
- package/src/records/recordBase.js +95 -0
- package/src/records/recordBase.ts +121 -0
- package/src/types.d.ts +117 -0
- package/src/types.js +8 -0
- package/src/types.ts +151 -0
- package/test.d.ts +1 -0
- package/test.js +4 -0
- package/tsconfig.json +4 -0
- package/TEMP/FILEMAKER.txt +0 -218
- package/TEMP/WEBAPP.txt +0 -92
- package/TEMP/config.yaml +0 -40
- package/TEMP/data.json +0 -19837
- package/temp2/1.19.2-forge-43.2.8.json +0 -347
- package/temp2/Quinn-1.19.2-forge-43.2.8.json +0 -347
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EventEmitter } from "events";
|
|
2
|
+
import { Field } from "./field";
|
|
3
|
+
import { Layout } from "../layouts/layout";
|
|
4
|
+
import { FieldValue, RecordFieldsMap } from "../layouts/layoutInterface";
|
|
5
|
+
import { recordObject } from "../types.js";
|
|
6
|
+
export declare class RecordBase<T extends RecordFieldsMap> extends EventEmitter {
|
|
7
|
+
readonly layout: Layout<any>;
|
|
8
|
+
recordId: number;
|
|
9
|
+
modId: number;
|
|
10
|
+
fields: T;
|
|
11
|
+
protected portalData: any[];
|
|
12
|
+
constructor(layout: any, recordId: any, modId?: any);
|
|
13
|
+
get endpoint(): string;
|
|
14
|
+
get edited(): boolean;
|
|
15
|
+
get fieldsArray(): Field<FieldValue>[];
|
|
16
|
+
protected processFieldData(fieldData: any): T;
|
|
17
|
+
_onSave(): void;
|
|
18
|
+
getField(field: any): Field<FieldValue>;
|
|
19
|
+
toObject(filter?: (a: any) => any, portalFilter?: (a: any) => any, portalRowFilter?: (a: any) => any, portalFieldFilter?: (a: any) => any): recordObject;
|
|
20
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023. See LICENSE file for more information
|
|
3
|
+
*/
|
|
4
|
+
import { EventEmitter } from "events";
|
|
5
|
+
import * as moment from "moment/moment";
|
|
6
|
+
import { Field } from "./field";
|
|
7
|
+
export class RecordBase extends EventEmitter {
|
|
8
|
+
constructor(layout, recordId, modId = recordId) {
|
|
9
|
+
super();
|
|
10
|
+
this.layout = layout;
|
|
11
|
+
this.recordId = recordId;
|
|
12
|
+
this.modId = modId;
|
|
13
|
+
}
|
|
14
|
+
get endpoint() {
|
|
15
|
+
return `${this.layout.endpoint}/records/${this.recordId}`;
|
|
16
|
+
}
|
|
17
|
+
get edited() {
|
|
18
|
+
return !!this.fieldsArray.find(i => i.edited);
|
|
19
|
+
}
|
|
20
|
+
get fieldsArray() {
|
|
21
|
+
return Object.values(this.fields);
|
|
22
|
+
}
|
|
23
|
+
processFieldData(fieldData) {
|
|
24
|
+
let fields = {};
|
|
25
|
+
for (let key of Object.keys(fieldData)) {
|
|
26
|
+
let _field = new Field(this, key, fieldData[key]);
|
|
27
|
+
if (!!fieldData[key]) {
|
|
28
|
+
if (_field.metadata.result === "timeStamp") {
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
let date = moment.default(fieldData[key], this.layout.database.host.metadata.productInfo.timeStampFormat.replace("dd", "DD"))
|
|
31
|
+
.utcOffset(this.layout.database.host.timezoneOffset, true)
|
|
32
|
+
.local();
|
|
33
|
+
_field.set(date.toDate());
|
|
34
|
+
_field.edited = false;
|
|
35
|
+
}
|
|
36
|
+
else if (_field.metadata.result === "time") {
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
let date = moment.default(fieldData[key], this.layout.database.host.metadata.productInfo.timeFormat.replace("dd", "DD"))
|
|
39
|
+
.utcOffset(this.layout.database.host.timezoneOffset, true)
|
|
40
|
+
.local();
|
|
41
|
+
_field.set(date.toDate());
|
|
42
|
+
_field.edited = false;
|
|
43
|
+
}
|
|
44
|
+
else if (_field.metadata.result === "date") {
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
let date = moment.default(fieldData[key], this.layout.database.host.metadata.productInfo.dateFormat.replace("dd", "DD"))
|
|
47
|
+
.utcOffset(this.layout.database.host.timezoneOffset, true)
|
|
48
|
+
.local();
|
|
49
|
+
_field.set(date.toDate());
|
|
50
|
+
_field.edited = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
fields[key] = _field;
|
|
54
|
+
}
|
|
55
|
+
this.fields = fields;
|
|
56
|
+
return fields;
|
|
57
|
+
}
|
|
58
|
+
_onSave() {
|
|
59
|
+
this.emit("saved");
|
|
60
|
+
for (let field of this.fieldsArray)
|
|
61
|
+
field.edited = false;
|
|
62
|
+
}
|
|
63
|
+
getField(field) {
|
|
64
|
+
return this.fieldsArray.find(_field => _field.id === field);
|
|
65
|
+
}
|
|
66
|
+
toObject(filter = (a) => a.edited, portalFilter = (a) => a.records.find(record => record.edited), portalRowFilter = (a) => a.edited, portalFieldFilter = (a) => a.edited) {
|
|
67
|
+
let fields_processed = {};
|
|
68
|
+
for (let field of this.fieldsArray.filter(field => filter(field))) {
|
|
69
|
+
let value = field.value;
|
|
70
|
+
if (value instanceof Date) {
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
let _value = moment.default(value)
|
|
73
|
+
.utcOffset(this.layout.database.host.timezoneOffset);
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
switch (field.metadata.result) {
|
|
76
|
+
case "time":
|
|
77
|
+
value = _value.format(this.layout.database.host.metadata.productInfo.timeFormat.replace("dd", "DD"));
|
|
78
|
+
break;
|
|
79
|
+
case "date":
|
|
80
|
+
value = _value.format(this.layout.database.host.metadata.productInfo.dateFormat.replace("dd", "DD"));
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
value = _value.format(this.layout.database.host.metadata.productInfo.timeStampFormat.replace("dd", "DD"));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
fields_processed[field.id] = value;
|
|
87
|
+
}
|
|
88
|
+
let obj = {
|
|
89
|
+
"recordId": this.recordId,
|
|
90
|
+
"modId": this.modId,
|
|
91
|
+
"fieldData": fields_processed
|
|
92
|
+
};
|
|
93
|
+
return obj;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023. See LICENSE file for more information
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {EventEmitter} from "events";
|
|
6
|
+
import * as moment from "moment/moment";
|
|
7
|
+
import {Field} from "./field";
|
|
8
|
+
import {Portal} from "./portal";
|
|
9
|
+
import {Layout} from "../layouts/layout";
|
|
10
|
+
import {FieldValue, RecordFieldsMap} from "../layouts/layoutInterface";
|
|
11
|
+
import {recordObject} from "../types.js";
|
|
12
|
+
|
|
13
|
+
export class RecordBase<T extends RecordFieldsMap> extends EventEmitter {
|
|
14
|
+
readonly layout: Layout<any>;
|
|
15
|
+
public recordId: number;
|
|
16
|
+
modId: number;
|
|
17
|
+
fields: T
|
|
18
|
+
protected portalData: any[];
|
|
19
|
+
|
|
20
|
+
constructor(layout, recordId, modId = recordId) {
|
|
21
|
+
super();
|
|
22
|
+
this.layout = layout
|
|
23
|
+
this.recordId = recordId
|
|
24
|
+
this.modId = modId
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get endpoint(): string {
|
|
28
|
+
return `${this.layout.endpoint}/records/${this.recordId}`
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get edited(): boolean {
|
|
32
|
+
return !!this.fieldsArray.find(i => i.edited)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get fieldsArray() {
|
|
36
|
+
return Object.values(this.fields)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected processFieldData(fieldData) {
|
|
40
|
+
let fields: RecordFieldsMap = {}
|
|
41
|
+
|
|
42
|
+
for (let key of Object.keys(fieldData)) {
|
|
43
|
+
let _field = new Field(this, key, fieldData[key])
|
|
44
|
+
if (!!fieldData[key]) {
|
|
45
|
+
if (_field.metadata.result === "timeStamp") {
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
let date = moment.default(fieldData[key], this.layout.database.host.metadata.productInfo.timeStampFormat.replace("dd", "DD"))
|
|
48
|
+
.utcOffset(this.layout.database.host.timezoneOffset, true)
|
|
49
|
+
.local()
|
|
50
|
+
_field.set(date.toDate())
|
|
51
|
+
_field.edited = false
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
else if (_field.metadata.result === "time") {
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
let date = moment.default(fieldData[key], this.layout.database.host.metadata.productInfo.timeFormat.replace("dd", "DD"))
|
|
57
|
+
.utcOffset(this.layout.database.host.timezoneOffset, true)
|
|
58
|
+
.local()
|
|
59
|
+
_field.set(date.toDate())
|
|
60
|
+
_field.edited = false
|
|
61
|
+
}
|
|
62
|
+
else if (_field.metadata.result === "date") {
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
let date = moment.default(fieldData[key], this.layout.database.host.metadata.productInfo.dateFormat.replace("dd", "DD"))
|
|
65
|
+
.utcOffset(this.layout.database.host.timezoneOffset, true)
|
|
66
|
+
.local()
|
|
67
|
+
_field.set(date.toDate())
|
|
68
|
+
_field.edited = false
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
fields[key] = _field
|
|
72
|
+
}
|
|
73
|
+
this.fields = fields as T
|
|
74
|
+
return fields as T
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
_onSave() {
|
|
78
|
+
this.emit("saved")
|
|
79
|
+
for (let field of this.fieldsArray) field.edited = false
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
getField(field) {
|
|
83
|
+
return this.fieldsArray.find(_field => _field.id === field)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
toObject(filter = (a) => a.edited,
|
|
87
|
+
portalFilter = (a) => a.records.find(record => record.edited),
|
|
88
|
+
portalRowFilter = (a) => a.edited,
|
|
89
|
+
portalFieldFilter = (a) => a.edited
|
|
90
|
+
): recordObject {
|
|
91
|
+
let fields_processed = {}
|
|
92
|
+
for (let field of this.fieldsArray.filter(field => filter(field))) {
|
|
93
|
+
let value = field.value
|
|
94
|
+
if (value instanceof Date) {
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
let _value = moment.default(value)
|
|
97
|
+
.utcOffset(this.layout.database.host.timezoneOffset)
|
|
98
|
+
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
|
|
101
|
+
switch (field.metadata.result) {
|
|
102
|
+
case "time":
|
|
103
|
+
value = _value.format(this.layout.database.host.metadata.productInfo.timeFormat.replace("dd", "DD"))
|
|
104
|
+
break
|
|
105
|
+
case "date":
|
|
106
|
+
value = _value.format(this.layout.database.host.metadata.productInfo.dateFormat.replace("dd", "DD"))
|
|
107
|
+
break
|
|
108
|
+
default:
|
|
109
|
+
value = _value.format(this.layout.database.host.metadata.productInfo.timeStampFormat.replace("dd", "DD"))
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
fields_processed[field.id] = value
|
|
113
|
+
}
|
|
114
|
+
let obj = {
|
|
115
|
+
"recordId": this.recordId,
|
|
116
|
+
"modId": this.modId,
|
|
117
|
+
"fieldData": fields_processed
|
|
118
|
+
}
|
|
119
|
+
return obj
|
|
120
|
+
}
|
|
121
|
+
}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as http from "http";
|
|
2
|
+
import { Portal } from "./records/portal";
|
|
3
|
+
import { FMError } from "./FMError";
|
|
4
|
+
export interface databaseOptionsBase {
|
|
5
|
+
database: string;
|
|
6
|
+
credentials: loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris | loginOptionsToken;
|
|
7
|
+
}
|
|
8
|
+
export interface databaseOptionsWithExternalSources extends databaseOptionsBase {
|
|
9
|
+
database: string;
|
|
10
|
+
credentials: loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris | loginOptionsToken;
|
|
11
|
+
externalSources: databaseOptionsBase[];
|
|
12
|
+
}
|
|
13
|
+
export interface loginOptionsToken {
|
|
14
|
+
method: "token";
|
|
15
|
+
token: string;
|
|
16
|
+
}
|
|
17
|
+
export interface loginOptionsOAuth {
|
|
18
|
+
method: "oauth";
|
|
19
|
+
oauth: {
|
|
20
|
+
requestId: string;
|
|
21
|
+
requestIdentifier: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface loginOptionsFileMaker {
|
|
25
|
+
method: "filemaker";
|
|
26
|
+
username: string;
|
|
27
|
+
password: string;
|
|
28
|
+
}
|
|
29
|
+
export interface loginOptionsClaris {
|
|
30
|
+
method: "claris";
|
|
31
|
+
claris: {
|
|
32
|
+
fmid: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface limitPortalsInterface {
|
|
36
|
+
portal: Portal<any>;
|
|
37
|
+
offset: number;
|
|
38
|
+
limit: number;
|
|
39
|
+
}
|
|
40
|
+
export interface extraBodyOptions {
|
|
41
|
+
scripts?: {
|
|
42
|
+
prerequest?: Script;
|
|
43
|
+
presort?: Script;
|
|
44
|
+
after?: Script;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export declare enum DOWNLOAD_MODES {
|
|
48
|
+
Stream = 0,
|
|
49
|
+
Buffer = 1
|
|
50
|
+
}
|
|
51
|
+
export interface Script {
|
|
52
|
+
name: string;
|
|
53
|
+
parameter: string;
|
|
54
|
+
}
|
|
55
|
+
export interface recordObject {
|
|
56
|
+
recordId: number;
|
|
57
|
+
modId: number;
|
|
58
|
+
fieldData: any;
|
|
59
|
+
portalData?: portalDataObject;
|
|
60
|
+
}
|
|
61
|
+
export interface fileMakerResponse {
|
|
62
|
+
response: any;
|
|
63
|
+
messages: any[];
|
|
64
|
+
}
|
|
65
|
+
export interface portalDataObject {
|
|
66
|
+
[key: string]: recordObject;
|
|
67
|
+
}
|
|
68
|
+
export interface FieldMetaData {
|
|
69
|
+
name: string;
|
|
70
|
+
type: string;
|
|
71
|
+
displayType: string;
|
|
72
|
+
result: string;
|
|
73
|
+
global: boolean;
|
|
74
|
+
autoEnter: boolean;
|
|
75
|
+
fourDigitYear: boolean;
|
|
76
|
+
maxRepeat: number;
|
|
77
|
+
maxCharacters: number;
|
|
78
|
+
notEmpty: boolean;
|
|
79
|
+
numeric: boolean;
|
|
80
|
+
timeOfDay: false;
|
|
81
|
+
repetitionStart: number;
|
|
82
|
+
repetitionEnd: number;
|
|
83
|
+
}
|
|
84
|
+
export interface LayoutMetaData {
|
|
85
|
+
fieldMetaData: FieldMetaData[];
|
|
86
|
+
portalMetaData?: {
|
|
87
|
+
[key: string]: FieldMetaData[];
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export interface FMHostMetadata {
|
|
91
|
+
productInfo: {
|
|
92
|
+
buildDate: Date;
|
|
93
|
+
name: string;
|
|
94
|
+
version: string;
|
|
95
|
+
dateFormat: string;
|
|
96
|
+
timeFormat: string;
|
|
97
|
+
timeStampFormat: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface ScriptResult {
|
|
101
|
+
scriptError?: FMError;
|
|
102
|
+
scriptResult?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface ContainerBufferResult {
|
|
105
|
+
buffer: Buffer;
|
|
106
|
+
mime: string;
|
|
107
|
+
request: http.IncomingMessage;
|
|
108
|
+
}
|
|
109
|
+
export interface AuthorizationHeaders {
|
|
110
|
+
"Content-Type": "application/json";
|
|
111
|
+
Authorization: string;
|
|
112
|
+
}
|
|
113
|
+
export interface AuthorizationHeadersOAuth {
|
|
114
|
+
"Content-Type": "application/json";
|
|
115
|
+
"X-FM-Data-OAuth-RequestId": string;
|
|
116
|
+
"X-FM-Data-OAuth-Identifier": string;
|
|
117
|
+
}
|
package/src/types.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022-2023. See LICENSE file for more information
|
|
3
|
+
*/
|
|
4
|
+
export var DOWNLOAD_MODES;
|
|
5
|
+
(function (DOWNLOAD_MODES) {
|
|
6
|
+
DOWNLOAD_MODES[DOWNLOAD_MODES["Stream"] = 0] = "Stream";
|
|
7
|
+
DOWNLOAD_MODES[DOWNLOAD_MODES["Buffer"] = 1] = "Buffer";
|
|
8
|
+
})(DOWNLOAD_MODES || (DOWNLOAD_MODES = {}));
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022-2023. See LICENSE file for more information
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
import * as moment from "moment"
|
|
8
|
+
import * as http from "http";
|
|
9
|
+
import {Portal} from "./records/portal";
|
|
10
|
+
import {FMError} from "./FMError";
|
|
11
|
+
|
|
12
|
+
// import * as btoa from "btoa";
|
|
13
|
+
export interface databaseOptionsBase {
|
|
14
|
+
database: string
|
|
15
|
+
credentials: loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris | loginOptionsToken,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface databaseOptionsWithExternalSources extends databaseOptionsBase {
|
|
19
|
+
database: string
|
|
20
|
+
credentials: loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris | loginOptionsToken,
|
|
21
|
+
externalSources: databaseOptionsBase[]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface loginOptionsToken {
|
|
25
|
+
method: "token"
|
|
26
|
+
token: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface loginOptionsOAuth {
|
|
30
|
+
method: "oauth"
|
|
31
|
+
oauth: {
|
|
32
|
+
requestId: string,
|
|
33
|
+
requestIdentifier: string
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface loginOptionsFileMaker {
|
|
38
|
+
method: "filemaker"
|
|
39
|
+
username: string,
|
|
40
|
+
password: string,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface loginOptionsClaris {
|
|
44
|
+
method: "claris"
|
|
45
|
+
claris: {
|
|
46
|
+
fmid: string
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface limitPortalsInterface {
|
|
51
|
+
portal: Portal<any>,
|
|
52
|
+
offset: number,
|
|
53
|
+
limit: number
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface extraBodyOptions {
|
|
57
|
+
scripts?: {
|
|
58
|
+
prerequest?: Script,
|
|
59
|
+
presort?: Script,
|
|
60
|
+
after?: Script,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export enum DOWNLOAD_MODES {
|
|
65
|
+
Stream,
|
|
66
|
+
Buffer
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface Script {
|
|
70
|
+
name: string
|
|
71
|
+
parameter: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface recordObject {
|
|
75
|
+
recordId: number
|
|
76
|
+
modId: number,
|
|
77
|
+
fieldData: any,
|
|
78
|
+
portalData?: portalDataObject
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface fileMakerResponse {
|
|
82
|
+
response: any,
|
|
83
|
+
messages: any[]
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface portalDataObject {
|
|
87
|
+
[key: string]: recordObject
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface FieldMetaData {
|
|
91
|
+
name: string,
|
|
92
|
+
type: string,
|
|
93
|
+
displayType: string,
|
|
94
|
+
result: string,
|
|
95
|
+
global: boolean,
|
|
96
|
+
autoEnter: boolean,
|
|
97
|
+
fourDigitYear: boolean,
|
|
98
|
+
maxRepeat: number,
|
|
99
|
+
maxCharacters: number,
|
|
100
|
+
notEmpty: boolean,
|
|
101
|
+
numeric: boolean,
|
|
102
|
+
timeOfDay: false,
|
|
103
|
+
repetitionStart: number,
|
|
104
|
+
repetitionEnd: number
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface LayoutMetaData {
|
|
108
|
+
fieldMetaData: FieldMetaData[],
|
|
109
|
+
portalMetaData?: {
|
|
110
|
+
[key: string]: FieldMetaData[]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface FMHostMetadata {
|
|
115
|
+
productInfo: {
|
|
116
|
+
buildDate: Date,
|
|
117
|
+
name: string,
|
|
118
|
+
version: string,
|
|
119
|
+
dateFormat: string,
|
|
120
|
+
timeFormat: string,
|
|
121
|
+
timeStampFormat: string
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface ScriptResult {
|
|
126
|
+
scriptError?: FMError,
|
|
127
|
+
scriptResult?: string
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface ContainerBufferResult {
|
|
131
|
+
buffer: Buffer,
|
|
132
|
+
mime: string,
|
|
133
|
+
request: http.IncomingMessage
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
//
|
|
137
|
+
// module.exports = {
|
|
138
|
+
// default: {FileMakerConnection}
|
|
139
|
+
// }
|
|
140
|
+
|
|
141
|
+
export interface AuthorizationHeaders {
|
|
142
|
+
"Content-Type": "application/json"
|
|
143
|
+
Authorization: string
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface AuthorizationHeadersOAuth {
|
|
147
|
+
"Content-Type": "application/json"
|
|
148
|
+
"X-FM-Data-OAuth-RequestId": string,
|
|
149
|
+
"X-FM-Data-OAuth-Identifier": string
|
|
150
|
+
}
|
|
151
|
+
|
package/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/test.js
ADDED