@jd-data-limited/easy-fm 3.2.7 → 4.0.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.
Files changed (102) hide show
  1. package/README.md +36 -24
  2. package/package.json +15 -8
  3. package/src/FMError.d.ts +1 -1
  4. package/src/FMError.js +7 -2
  5. package/src/FMError.ts +3 -3
  6. package/src/connection/FMHost.d.ts +3 -2
  7. package/src/connection/FMHost.js +37 -47
  8. package/src/connection/FMHost.ts +6 -6
  9. package/src/connection/HostBase.d.ts +1 -1
  10. package/src/connection/HostBase.js +1 -1
  11. package/src/connection/HostBase.ts +2 -4
  12. package/src/connection/database.d.ts +12 -9
  13. package/src/connection/database.js +93 -116
  14. package/src/connection/database.ts +79 -90
  15. package/src/connection/databaseBase.d.ts +5 -2
  16. package/src/connection/databaseBase.js +1 -1
  17. package/src/connection/databaseBase.ts +5 -4
  18. package/src/databaseStructure.d.ts +6 -0
  19. package/src/databaseStructure.js +4 -0
  20. package/src/databaseStructure.ts +12 -0
  21. package/src/index.d.ts +3 -6
  22. package/src/index.js +3 -5
  23. package/src/index.ts +4 -9
  24. package/src/layouts/layout.d.ts +5 -19
  25. package/src/layouts/layout.js +27 -69
  26. package/src/layouts/layout.ts +26 -65
  27. package/src/layouts/layoutBase.d.ts +4 -4
  28. package/src/layouts/layoutBase.js +1 -1
  29. package/src/layouts/layoutBase.ts +5 -5
  30. package/src/layouts/layoutInterface.d.ts +1 -1
  31. package/src/layouts/layoutInterface.js +1 -1
  32. package/src/layouts/layoutInterface.ts +2 -2
  33. package/src/layouts/layoutRecordManager.d.ts +5 -6
  34. package/src/layouts/layoutRecordManager.js +20 -39
  35. package/src/layouts/layoutRecordManager.ts +20 -41
  36. package/src/layouts/recordFieldsMap.d.ts +2 -2
  37. package/src/layouts/recordFieldsMap.js +1 -1
  38. package/src/layouts/recordFieldsMap.ts +3 -3
  39. package/src/models/apiResults.d.ts +103 -0
  40. package/src/models/apiResults.js +28 -0
  41. package/src/models/apiResults.ts +112 -0
  42. package/src/records/field.d.ts +3 -22
  43. package/src/records/field.js +4 -177
  44. package/src/records/field.ts +4 -187
  45. package/src/records/fieldBase.d.ts +30 -0
  46. package/src/records/fieldBase.js +154 -0
  47. package/src/records/fieldBase.ts +174 -0
  48. package/src/records/getOperations/recordGetOperation.d.ts +47 -11
  49. package/src/records/getOperations/recordGetOperation.js +144 -30
  50. package/src/records/getOperations/recordGetOperation.ts +172 -30
  51. package/src/records/layoutRecord.d.ts +8 -7
  52. package/src/records/layoutRecord.js +107 -153
  53. package/src/records/layoutRecord.ts +117 -141
  54. package/src/records/portal.d.ts +6 -5
  55. package/src/records/portal.js +4 -1
  56. package/src/records/portal.ts +7 -7
  57. package/src/records/portalBase.d.ts +5 -4
  58. package/src/records/portalBase.js +1 -1
  59. package/src/records/portalBase.ts +6 -6
  60. package/src/records/portalRecord.d.ts +6 -6
  61. package/src/records/portalRecord.js +5 -3
  62. package/src/records/portalRecord.ts +5 -5
  63. package/src/records/recordBase.d.ts +7 -12
  64. package/src/records/recordBase.js +12 -11
  65. package/src/records/recordBase.ts +10 -15
  66. package/src/types.d.ts +18 -19
  67. package/src/types.js +7 -1
  68. package/src/types.ts +20 -21
  69. package/.expo/README.md +0 -15
  70. package/.expo/settings.json +0 -8
  71. package/.idea/compiler.xml +0 -7
  72. package/.idea/copyright/JD_Data.xml +0 -6
  73. package/.idea/copyright/profiles_settings.xml +0 -7
  74. package/.idea/discord.xml +0 -7
  75. package/.idea/easy-fm.iml +0 -8
  76. package/.idea/jsLibraryMappings.xml +0 -6
  77. package/.idea/modules.xml +0 -8
  78. package/.idea/php.xml +0 -18
  79. package/.idea/vcs.xml +0 -6
  80. package/decs.d.ts +0 -7
  81. package/dist/index.min.js +0 -2
  82. package/dist/index.min.js.LICENSE.txt +0 -3
  83. package/docs/classes/FileMakerConnection.md +0 -86
  84. package/docs/classes/layout.md +0 -0
  85. package/examples/test.js +0 -7
  86. package/fmErrors.json +0 -1010
  87. package/img.png +0 -0
  88. package/src/records/getOperations/find.d.ts +0 -15
  89. package/src/records/getOperations/find.js +0 -90
  90. package/src/records/getOperations/find.ts +0 -88
  91. package/src/records/getOperations/recordGetRange.d.ts +0 -13
  92. package/src/records/getOperations/recordGetRange.js +0 -95
  93. package/src/records/getOperations/recordGetRange.ts +0 -84
  94. package/src/records/portalRecordBase.d.ts +0 -4
  95. package/src/records/portalRecordBase.js +0 -6
  96. package/test.d.ts +0 -2
  97. package/test.js +0 -30
  98. package/test.ts +0 -33
  99. package/test2.d.ts +0 -1
  100. package/test2.js +0 -15
  101. package/tsconfig.json +0 -16
  102. package/webpack.config.cjs +0 -20
package/src/types.d.ts CHANGED
@@ -1,13 +1,7 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
3
  import * as http from "http";
4
4
  import { FMError } from "./FMError.js";
5
- import { LayoutInterface } from "./layouts/layoutInterface";
6
- export interface DatabaseStructure {
7
- layouts: {
8
- [key: string]: LayoutInterface;
9
- };
10
- }
11
5
  export interface databaseOptionsBase {
12
6
  database: string;
13
7
  credentials: loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris | loginOptionsToken;
@@ -39,17 +33,18 @@ export interface loginOptionsClaris {
39
33
  fmid: string;
40
34
  };
41
35
  }
42
- export interface limitPortalsInterface {
43
- portalName: string;
36
+ export interface portalFetchData<T = string> {
37
+ portalName: T;
44
38
  offset: number;
45
39
  limit: number;
46
40
  }
41
+ export type ScriptRequestData = {
42
+ prerequest?: Script;
43
+ presort?: Script;
44
+ after?: Script;
45
+ };
47
46
  export interface extraBodyOptions {
48
- scripts?: {
49
- prerequest?: Script;
50
- presort?: Script;
51
- after?: Script;
52
- };
47
+ scripts?: ScriptRequestData;
53
48
  }
54
49
  export declare enum DOWNLOAD_MODES {
55
50
  Stream = 0,
@@ -65,10 +60,6 @@ export interface recordObject {
65
60
  fieldData: any;
66
61
  portalData?: portalDataObject;
67
62
  }
68
- export interface fileMakerResponse {
69
- response: any;
70
- messages: any[];
71
- }
72
63
  export interface portalDataObject {
73
64
  [key: string]: recordObject;
74
65
  }
@@ -122,3 +113,11 @@ export interface AuthorizationHeadersOAuth {
122
113
  "X-FM-Data-OAuth-RequestId": string;
123
114
  "X-FM-Data-OAuth-Identifier": string;
124
115
  }
116
+ export type RecordFetchOptions = {
117
+ readonly portals: readonly string[];
118
+ };
119
+ export declare enum RecordTypes {
120
+ UNKNOWN = 0,
121
+ LAYOUT = 1,
122
+ PORTAL = 2
123
+ }
package/src/types.js CHANGED
@@ -1,8 +1,14 @@
1
1
  /*
2
- * Copyright (c) 2022-2023. See LICENSE file for more information
2
+ * Copyright (c) 2022-2024. See LICENSE file for more information
3
3
  */
4
4
  export var DOWNLOAD_MODES;
5
5
  (function (DOWNLOAD_MODES) {
6
6
  DOWNLOAD_MODES[DOWNLOAD_MODES["Stream"] = 0] = "Stream";
7
7
  DOWNLOAD_MODES[DOWNLOAD_MODES["Buffer"] = 1] = "Buffer";
8
8
  })(DOWNLOAD_MODES || (DOWNLOAD_MODES = {}));
9
+ export var RecordTypes;
10
+ (function (RecordTypes) {
11
+ RecordTypes[RecordTypes["UNKNOWN"] = 0] = "UNKNOWN";
12
+ RecordTypes[RecordTypes["LAYOUT"] = 1] = "LAYOUT";
13
+ RecordTypes[RecordTypes["PORTAL"] = 2] = "PORTAL";
14
+ })(RecordTypes || (RecordTypes = {}));
package/src/types.ts CHANGED
@@ -1,19 +1,11 @@
1
1
  /*
2
- * Copyright (c) 2022-2023. See LICENSE file for more information
2
+ * Copyright (c) 2022-2024. See LICENSE file for more information
3
3
  */
4
4
 
5
5
  // const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
6
6
  // @ts-ignore
7
7
  import * as http from "http";
8
8
  import {FMError} from "./FMError.js";
9
- import {LayoutInterface} from "./layouts/layoutInterface";
10
-
11
- // import * as btoa from "btoa";
12
- export interface DatabaseStructure {
13
- layouts: {
14
- [key: string]: LayoutInterface
15
- }
16
- }
17
9
 
18
10
  export interface databaseOptionsBase {
19
11
  database: string
@@ -52,18 +44,20 @@ export interface loginOptionsClaris {
52
44
  }
53
45
  }
54
46
 
55
- export interface limitPortalsInterface {
56
- portalName: string,
47
+ export interface portalFetchData<T = string> {
48
+ portalName: T,
57
49
  offset: number,
58
50
  limit: number
59
51
  }
60
52
 
53
+ export type ScriptRequestData = {
54
+ prerequest?: Script,
55
+ presort?: Script,
56
+ after?: Script,
57
+ }
58
+
61
59
  export interface extraBodyOptions {
62
- scripts?: {
63
- prerequest?: Script,
64
- presort?: Script,
65
- after?: Script,
66
- }
60
+ scripts?: ScriptRequestData
67
61
  }
68
62
 
69
63
  export enum DOWNLOAD_MODES {
@@ -83,11 +77,6 @@ export interface recordObject {
83
77
  portalData?: portalDataObject
84
78
  }
85
79
 
86
- export interface fileMakerResponse {
87
- response: any,
88
- messages: any[]
89
- }
90
-
91
80
  export interface portalDataObject {
92
81
  [key: string]: recordObject
93
82
  }
@@ -152,4 +141,14 @@ export interface AuthorizationHeadersOAuth {
152
141
  "Content-Type": "application/json"
153
142
  "X-FM-Data-OAuth-RequestId": string,
154
143
  "X-FM-Data-OAuth-Identifier": string
144
+ }
145
+
146
+ export type RecordFetchOptions = {
147
+ readonly portals: readonly string[]
148
+ }
149
+
150
+ export enum RecordTypes {
151
+ UNKNOWN,
152
+ LAYOUT,
153
+ PORTAL
155
154
  }
package/.expo/README.md DELETED
@@ -1,15 +0,0 @@
1
- > Why do I have a folder named ".expo" in my project?
2
-
3
- The ".expo" folder is created when an Expo project is started using "expo start" command.
4
-
5
- > What do the files contain?
6
-
7
- - "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
8
- - "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
9
- - "settings.json": contains the server configuration that is used to serve the application manifest.
10
-
11
- > Should I commit the ".expo" folder?
12
-
13
- No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
14
-
15
- Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
@@ -1,8 +0,0 @@
1
- {
2
- "hostType": "lan",
3
- "lanType": "ip",
4
- "dev": true,
5
- "minify": false,
6
- "urlRandomness": null,
7
- "https": false
8
- }
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="TypeScriptCompiler">
4
- <option name="recompileOnChanges" value="true" />
5
- <option name="versionType" value="EMBEDDED" />
6
- </component>
7
- </project>
@@ -1,6 +0,0 @@
1
- <component name="CopyrightManager">
2
- <copyright>
3
- <option name="notice" value="Copyright (c) &amp;#36;originalComment.match(&quot;Copyright \(c\) (\d+)&quot;, 1, &quot;-&quot;, &quot;&amp;#36;today.year&quot;)&amp;#36;today.year. See LICENSE file for more information" />
4
- <option name="myName" value="JD-Data" />
5
- </copyright>
6
- </component>
@@ -1,7 +0,0 @@
1
- <component name="CopyrightManager">
2
- <settings default="JD-Data">
3
- <module2copyright>
4
- <element module="Project Files" copyright="JD-Data" />
5
- </module2copyright>
6
- </settings>
7
- </component>
package/.idea/discord.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="DiscordProjectSettings">
4
- <option name="show" value="ASK" />
5
- <option name="description" value="" />
6
- </component>
7
- </project>
package/.idea/easy-fm.iml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$" />
5
- <orderEntry type="inheritedJdk" />
6
- <orderEntry type="sourceFolder" forTests="false" />
7
- </component>
8
- </module>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="JavaScriptLibraryMappings">
4
- <includedPredefinedLibrary name="Node.js Core" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/easy-fm.iml" filepath="$PROJECT_DIR$/.idea/easy-fm.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/php.xml DELETED
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="MessDetectorOptionsConfiguration">
4
- <option name="transferred" value="true" />
5
- </component>
6
- <component name="PHPCSFixerOptionsConfiguration">
7
- <option name="transferred" value="true" />
8
- </component>
9
- <component name="PHPCodeSnifferOptionsConfiguration">
10
- <option name="transferred" value="true" />
11
- </component>
12
- <component name="PhpStanOptionsConfiguration">
13
- <option name="transferred" value="true" />
14
- </component>
15
- <component name="PsalmOptionsConfiguration">
16
- <option name="transferred" value="true" />
17
- </component>
18
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>
package/decs.d.ts DELETED
@@ -1,7 +0,0 @@
1
- declare module "fs"
2
- declare module "events"
3
- declare module "path"
4
- declare module "url"
5
- declare module "node-fetch"
6
- declare module "btoa"
7
- declare module "buffer"