@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/README.md CHANGED
@@ -1,27 +1,29 @@
1
1
  # easy-fm
2
2
 
3
- Making NodeJS + FileMaker easier than ever
3
+ A [FileMaker Data API](https://help.claris.com/en/data-api-guide/content/index.html) client for NodeJS
4
4
 
5
5
  easy-fm is a Node.js module that allows you to interact with
6
- a [FileMaker database](https://www.claris.com/filemaker/) stored on
7
- a [FileMaker server](https://www.claris.com/filemaker/server/)
6
+ a [FileMaker database](https://www.claris.com/filemaker/) stored on a [FileMaker server](https://www.claris.com/filemaker/server/)
8
7
  or [FileMaker Cloud](https://store.claris.com/filemaker-cloud). This module interacts with your server using the
9
8
  [FileMaker Data API](https://help.claris.com/en/data-api-guide/content/index.html).
10
9
  <!-- TOC -->
10
+
11
11
  * [easy-fm](#easy-fm)
12
- * [FileMaker setup instructions](#filemaker-setup-instructions)
13
- * [Before you begin](#before-you-begin)
14
- * [Connecting to a database](#connecting-to-a-database)
15
- * [Getting records](#getting-records)
16
- * [Fetch a range of records](#fetch-a-range-of-records)
17
- * [Searching for records](#searching-for-records)
18
- * [Fetch a record using its record ID (NOT RECOMMENDED)](#fetch-a-record-using-its-record-id-not-recommended)
19
- * [Create a record](#create-a-record)
20
- * [Modify a record](#modify-a-record)
12
+ * [FileMaker setup instructions](#filemaker-setup-instructions)
13
+ * [Before you begin](#before-you-begin)
14
+ * [Connecting to a database](#connecting-to-a-database)
15
+ * [Getting records](#getting-records)
16
+ * [Fetch a range of records](#fetch-a-range-of-records)
17
+ * [Searching for records](#searching-for-records)
18
+ * [Fetch a record using its record ID (NOT RECOMMENDED)](#fetch-a-record-using-its-record-id-not-recommended)
19
+ * [Create a record](#create-a-record)
20
+ * [Modify a record](#modify-a-record)
21
21
  * [Field names](#field-names)
22
22
  * [Portal names](#portal-names)
23
23
  * [Typescript Implementation](#typescript-implementation)
24
+
24
25
  <!-- TOC -->
26
+
25
27
  ## FileMaker setup instructions
26
28
 
27
29
  1. Enable the FileMaker Data API from the server's admin console. This setting is located
@@ -34,7 +36,8 @@ or [FileMaker Cloud](https://store.claris.com/filemaker-cloud). This module inte
34
36
  ## Before you begin
35
37
 
36
38
  - You need to know what your server's UTC time offset (in minutes) is.
37
- - Running `0 - (new Date()).getTimezoneOffset()` in javascript will give you the UTC time offset for your current timezone.
39
+ - Running `0 - (new Date()).getTimezoneOffset()` in javascript will give you the UTC time offset for your current
40
+ timezone.
38
41
 
39
42
  ## Connecting to a database
40
43
 
@@ -77,26 +80,34 @@ One of (if not the) most common interactions you'll need to use is fetching reco
77
80
 
78
81
  ```javascript
79
82
  let layout = database.getLayout("Your layout name")
80
- let range_request = layout.records.range()
81
-
82
- range_request.setOffset(50) // Starting from the 50th record...
83
- range_request.setLimit(100) // Fetch 100 records
83
+ let query = layout.records.list({
84
+ portals: {
85
+ test: {limit: 10, offset: 1} // Include results from the 'test' portal
86
+ },
87
+ limit: 10, // Limit result set to 10 records...
88
+ offset: 30 // ...starting from the 30th record
89
+ })
84
90
 
85
- let records = await range_request.fetch()
91
+ let records = await query.fetch()
86
92
  console.log(records)
87
93
  ```
88
94
 
89
95
  ### Searching for records
96
+ Searching for records uses the same syntax as above, but with additional steps to add your search parameters.
90
97
 
91
98
  ```javascript
92
99
  let layout = database.getLayout("Your layout name")
93
- let find_request = layout.records.find()
100
+ let query = layout.records.list({
101
+ portals: {
102
+ test: {limit: 10, offset: 1} // Include results from the 'test' portal
103
+ },
104
+ limit: 10, // Limit result set to 10 records...
105
+ offset: 30 // ...starting from the 30th record
106
+ })
94
107
 
95
- find_request.addRequests({"GroupID": "abc"}) // Find only the records with field GroupID set to 'abc'
96
- find_request.setOffset(30) // Starting from the 30th matching record
97
- find_request.setLimit(10) // Fetch only 10 records
108
+ query.addRequest({"GroupID": "=abc"}) // Add a filter
98
109
 
99
- let records = await range_request.fetch()
110
+ let records = await query.fetch()
100
111
  console.log(records)
101
112
  ```
102
113
 
@@ -152,7 +163,8 @@ When interacting with FileMaker, it is important to remember how FileMaker field
152
163
 
153
164
  > Please read this section carefully if you are working with portals
154
165
 
155
- It is important to note that a portal's name **is not** the same as the name of the table that it links to. The name of a
166
+ It is important to note that a portal's name **is not** the same as the name of the table that it links to. The name of
167
+ a
156
168
  portal matches the object name it was assigned in FileMaker's layout editor.
157
169
 
158
170
  > **NOTE**: When no name has been manually assigned to it, it will default to the name of the related table.
package/package.json CHANGED
@@ -1,13 +1,9 @@
1
1
  {
2
2
  "name": "@jd-data-limited/easy-fm",
3
- "version": "3.2.7",
3
+ "version": "4.0.0",
4
4
  "dependencies": {
5
- "@types/btoa": "^1.2.3",
6
- "@types/events": "^3.0.0",
7
- "moment": "^2.29.4",
8
- "node-fetch": "3.2.8",
9
- "typescript": "^5.2.2",
10
- "ytdl-core": "^4.11.4"
5
+ "follow-redirects": "^1.15.5",
6
+ "moment": "^2.29.4"
11
7
  },
12
8
  "type": "module",
13
9
  "main": "src/index.js",
@@ -16,8 +12,11 @@
16
12
  "url": "https://github.com/JD-Data-Limited/easy-fm",
17
13
  "license": "SEE LICENSE IN LICENSE",
18
14
  "description": "easy-fm is a Node.js module that allows you to interact with\r a [FileMaker database stored](https://www.claris.com/filemaker/) on\r a [FileMaker server](https://www.claris.com/filemaker/server/). This module interacts with your server using the\r [FileMaker Data API](https://help.claris.com/en/data-api-guide/content/index.html).",
15
+ "files": [
16
+ "./src/**/*"
17
+ ],
19
18
  "scripts": {
20
- "test": "echo \"Error: no test specified\" && exit 1",
19
+ "test": "node --test tests/login.js",
21
20
  "build": "webpack"
22
21
  },
23
22
  "repository": {
@@ -34,7 +33,15 @@
34
33
  "url": "https://github.com/JD-Data-Limited/easy-fm/issues"
35
34
  },
36
35
  "devDependencies": {
36
+ "@types/btoa": "^1.2.3",
37
+ "@types/events": "^3.0.0",
38
+ "@types/follow-redirects": "^1.14.4",
39
+ "dotenv": "^16.3.1",
40
+ "typescript": "^5.3.3",
37
41
  "webpack": "^5.81.0",
38
42
  "webpack-cli": "^5.0.2"
43
+ },
44
+ "engines": {
45
+ "node": ">=20.9.0"
39
46
  }
40
47
  }
package/src/FMError.d.ts CHANGED
@@ -8,5 +8,5 @@ export declare class FMError extends Error {
8
8
  readonly code: number;
9
9
  readonly message: string;
10
10
  readonly messages: string;
11
- constructor(code: any, httpStatus: any, res: any, trace?: Error);
11
+ constructor(code: string | number, httpStatus: number, res: any, trace?: Error);
12
12
  }
package/src/FMError.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2023. See LICENSE file for more information
2
+ * Copyright (c) 2023-2024. See LICENSE file for more information
3
3
  */
4
4
  // @ts-ignore
5
5
  export const errs = [
@@ -1013,10 +1013,15 @@ export const errs = [
1013
1013
  }
1014
1014
  ];
1015
1015
  export class FMError extends Error {
1016
+ httpStatus;
1017
+ res;
1018
+ code;
1019
+ message;
1020
+ messages;
1016
1021
  constructor(code, httpStatus, res, trace) {
1017
1022
  if (typeof code === "string")
1018
1023
  code = parseInt(code);
1019
- super(errs.find(err => err.e === code).d || "Unknown error");
1024
+ super(errs.find(err => err.e === code)?.d || "Unknown error");
1020
1025
  this.httpStatus = httpStatus;
1021
1026
  this.res = res;
1022
1027
  this.messages = res.messages;
package/src/FMError.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2023. See LICENSE file for more information
2
+ * Copyright (c) 2023-2024. See LICENSE file for more information
3
3
  */
4
4
 
5
5
  // @ts-ignore
@@ -1021,9 +1021,9 @@ export class FMError extends Error {
1021
1021
  readonly message: string
1022
1022
  readonly messages: string
1023
1023
 
1024
- constructor(code, httpStatus, res, trace?: Error) {
1024
+ constructor(code: string | number, httpStatus: number, res: any, trace?: Error) {
1025
1025
  if (typeof code === "string") code = parseInt(code)
1026
- super(errs.find(err => err.e === code).d || "Unknown error");
1026
+ super(errs.find(err => err.e === code)?.d || "Unknown error");
1027
1027
  this.httpStatus = httpStatus
1028
1028
  this.res = res
1029
1029
  this.messages = res.messages
@@ -1,6 +1,7 @@
1
1
  import { Database } from "./database.js";
2
2
  import { HostBase } from "./HostBase.js";
3
- import { databaseOptionsWithExternalSources, DatabaseStructure, FMHostMetadata, loginOptionsClaris, loginOptionsFileMaker, loginOptionsOAuth } from "../types.js";
3
+ import { databaseOptionsWithExternalSources, FMHostMetadata, loginOptionsClaris, loginOptionsFileMaker, loginOptionsOAuth } from "../types.js";
4
+ import { DatabaseStructure } from "../databaseStructure.js";
4
5
  export default class FMHost implements HostBase {
5
6
  readonly hostname: string;
6
7
  readonly timezoneOffset: number;
@@ -9,5 +10,5 @@ export default class FMHost implements HostBase {
9
10
  constructor(_hostname: string, timezoneOffset?: number, verify?: boolean);
10
11
  listDatabases(credentials?: loginOptionsOAuth | loginOptionsFileMaker | loginOptionsClaris): Promise<any>;
11
12
  database<T extends DatabaseStructure>(data: databaseOptionsWithExternalSources): Database<T>;
12
- getMetadata(): Promise<any>;
13
+ getMetadata(): Promise<FMHostMetadata>;
13
14
  }
@@ -1,20 +1,14 @@
1
1
  /*
2
- * Copyright (c) 2023. See LICENSE file for more information
2
+ * Copyright (c) 2023-2024. See LICENSE file for more information
3
3
  */
4
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
- return new (P || (P = Promise))(function (resolve, reject) {
7
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
- step((generator = generator.apply(thisArg, _arguments || [])).next());
11
- });
12
- };
13
4
  import { generateAuthorizationHeaders } from "./generateAuthorizationHeaders.js";
14
- import fetch from "node-fetch";
15
5
  import { FMError } from "../FMError.js";
16
6
  import { Database } from "./database.js";
17
7
  export default class FMHost {
8
+ hostname;
9
+ timezoneOffset;
10
+ verify;
11
+ metadata;
18
12
  constructor(_hostname, timezoneOffset = 0 - (new Date()).getTimezoneOffset(), verify = true) {
19
13
  if (!(/^https?:\/\//).test(_hostname))
20
14
  throw "hostname MUST begin with either http:// or https://";
@@ -22,47 +16,43 @@ export default class FMHost {
22
16
  this.timezoneOffset = timezoneOffset;
23
17
  this.verify = verify;
24
18
  }
25
- listDatabases(credentials) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- let headers = {};
28
- if (credentials) {
29
- headers = generateAuthorizationHeaders(credentials);
30
- }
31
- let _fetch = yield fetch(`${this.hostname}/fmi/data/v2/databases`, {
32
- method: "GET",
33
- headers
34
- });
35
- let data = yield _fetch.json();
36
- // console.log(data.messages[0])
37
- if (data.messages[0].code === "0") {
38
- return data.response.databases;
39
- }
40
- else {
41
- // @ts-ignore
42
- throw new FMError(data.messages[0].code, data.status, data);
43
- }
19
+ async listDatabases(credentials) {
20
+ let headers = {};
21
+ if (credentials) {
22
+ headers = generateAuthorizationHeaders(credentials);
23
+ }
24
+ let _fetch = await fetch(`${this.hostname}/fmi/data/v2/databases`, {
25
+ method: "GET",
26
+ headers
44
27
  });
28
+ let data = await _fetch.json();
29
+ // console.log(data.messages[0])
30
+ if (data.messages[0].code === "0") {
31
+ return data.response.databases;
32
+ }
33
+ else {
34
+ // @ts-ignore
35
+ throw new FMError(data.messages[0].code, data.status, data);
36
+ }
45
37
  }
46
38
  database(data) {
47
39
  return new Database(this, data);
48
40
  }
49
- getMetadata() {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- if (this.metadata)
52
- return this.metadata;
53
- let _fetch = yield fetch(`${this.hostname}/fmi/data/v2/productInfo`, {
54
- method: "GET",
55
- });
56
- let data = yield _fetch.json();
57
- // console.log(data.messages[0])
58
- if (data.messages[0].code === "0") {
59
- this.metadata = data.response;
60
- return data.response;
61
- }
62
- else {
63
- // @ts-ignore
64
- throw new FMError(data.messages[0].code, data.status, data);
65
- }
41
+ async getMetadata() {
42
+ if (this.metadata)
43
+ return this.metadata;
44
+ let _fetch = await fetch(`${this.hostname}/fmi/data/v2/productInfo`, {
45
+ method: "GET",
66
46
  });
47
+ let data = await _fetch.json();
48
+ // console.log(data.messages[0])
49
+ if (data.messages[0].code === "0") {
50
+ this.metadata = data.response;
51
+ return data.response;
52
+ }
53
+ else {
54
+ // @ts-ignore
55
+ throw new FMError(data.messages[0].code, data.status, data);
56
+ }
67
57
  }
68
58
  }
@@ -1,20 +1,20 @@
1
1
  /*
2
- * Copyright (c) 2023. See LICENSE file for more information
2
+ * Copyright (c) 2023-2024. See LICENSE file for more information
3
3
  */
4
4
 
5
5
  import {generateAuthorizationHeaders} from "./generateAuthorizationHeaders.js";
6
- import fetch from "node-fetch";
7
6
  import {FMError} from "../FMError.js";
8
7
  import {Database} from "./database.js";
9
8
  import {HostBase} from "./HostBase.js"
10
9
  import {
11
- databaseOptionsWithExternalSources, DatabaseStructure,
12
- fileMakerResponse,
10
+ databaseOptionsWithExternalSources,
13
11
  FMHostMetadata,
14
12
  loginOptionsClaris,
15
13
  loginOptionsFileMaker,
16
14
  loginOptionsOAuth
17
15
  } from "../types.js";
16
+ import {ApiResults} from "../models/apiResults.js";
17
+ import {DatabaseStructure} from "../databaseStructure.js";
18
18
 
19
19
  export default class FMHost implements HostBase {
20
20
  readonly hostname: string
@@ -39,7 +39,7 @@ export default class FMHost implements HostBase {
39
39
  method: "GET",
40
40
  headers
41
41
  })
42
- let data = await _fetch.json() as fileMakerResponse
42
+ let data = await _fetch.json() as ApiResults<{databases: any}>
43
43
  // console.log(data.messages[0])
44
44
 
45
45
  if (data.messages[0].code === "0") {
@@ -61,7 +61,7 @@ export default class FMHost implements HostBase {
61
61
  let _fetch = await fetch(`${this.hostname}/fmi/data/v2/productInfo`, {
62
62
  method: "GET",
63
63
  })
64
- let data = await _fetch.json() as fileMakerResponse
64
+ let data = await _fetch.json() as ApiResults<FMHostMetadata>
65
65
  // console.log(data.messages[0])
66
66
 
67
67
  if (data.messages[0].code === "0") {
@@ -1,4 +1,4 @@
1
- import { FMHostMetadata } from "../types";
1
+ import { FMHostMetadata } from "../types.js";
2
2
  export interface HostBase {
3
3
  readonly hostname: string;
4
4
  readonly timezoneOffset: number;
@@ -1,4 +1,4 @@
1
1
  /*
2
- * Copyright (c) 2023. See LICENSE file for more information
2
+ * Copyright (c) 2023-2024. See LICENSE file for more information
3
3
  */
4
4
  export {};
@@ -1,10 +1,8 @@
1
1
  /*
2
- * Copyright (c) 2023. See LICENSE file for more information
2
+ * Copyright (c) 2023-2024. See LICENSE file for more information
3
3
  */
4
4
 
5
- import {
6
- FMHostMetadata
7
- } from "../types";
5
+ import {FMHostMetadata} from "../types.js";
8
6
 
9
7
  export interface HostBase {
10
8
  readonly hostname: string
@@ -1,12 +1,14 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
2
3
  import { EventEmitter } from "events";
3
- import { Request } from "node-fetch";
4
4
  import { LayoutInterface } from "../layouts/layoutInterface.js";
5
5
  import { Layout } from "../layouts/layout.js";
6
- import HTTP_REDIRECT from "follow-redirects";
7
- import { databaseOptionsWithExternalSources, DatabaseStructure, Script } from "../types.js";
6
+ import { databaseOptionsWithExternalSources, Script } from "../types.js";
8
7
  import { HostBase } from "./HostBase.js";
9
- import { DatabaseBase } from "./databaseBase";
8
+ import { DatabaseBase } from "./databaseBase.js";
9
+ import { ApiResults } from "../models/apiResults.js";
10
+ import { DatabaseStructure } from "../databaseStructure.js";
11
+ import { IncomingMessage } from "http";
10
12
  export declare class Database<T extends DatabaseStructure> extends EventEmitter implements DatabaseBase {
11
13
  private _token;
12
14
  readonly host: HostBase;
@@ -16,14 +18,15 @@ export declare class Database<T extends DatabaseStructure> extends EventEmitter
16
18
  constructor(host: HostBase, conn: databaseOptionsWithExternalSources);
17
19
  private generateExternalSourceLogin;
18
20
  logout(): Promise<void>;
19
- login(): Promise<string>;
21
+ login(): Promise<any>;
20
22
  get token(): any;
21
23
  get endpoint(): string;
22
- apiRequest<T = any>(url: string | Request, options?: any, autoRelogin?: boolean): Promise<T>;
23
- getLayout<R extends string>(name: R): Layout<T["layouts"][R]>;
24
+ apiRequest<T = any>(url: string | Request, options?: any, autoRelogin?: boolean): Promise<ApiResults<T>>;
25
+ listLayouts(): Promise<Layout<LayoutInterface>[]>;
26
+ getLayout<R extends keyof T["layouts"]>(name: R): Layout<T["layouts"][R]>;
24
27
  getLayout<R extends LayoutInterface>(name: string): Layout<R>;
25
28
  setGlobals(globalFields: any): Promise<void>;
26
29
  script(name: any, parameter?: string): Script;
27
30
  _tokenExpired(): void;
28
- streamContainer(field: any, url: any): Promise<HTTP_REDIRECT.http.IncomingMessage>;
31
+ streamURL(url: string): Promise<IncomingMessage>;
29
32
  }