@jd-data-limited/easy-fm 3.2.4 → 3.2.5
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { EventEmitter } from "events";
|
|
|
3
3
|
import { Request } from "node-fetch";
|
|
4
4
|
import { LayoutInterface } from "../layouts/layoutInterface.js";
|
|
5
5
|
import { Layout } from "../layouts/layout.js";
|
|
6
|
-
import
|
|
6
|
+
import redirecter from "follow-redirects";
|
|
7
7
|
import { databaseOptionsWithExternalSources, DatabaseStructure, Script } from "../types.js";
|
|
8
8
|
import { HostBase } from "./HostBase.js";
|
|
9
9
|
import { DatabaseBase } from "./databaseBase";
|
|
@@ -25,5 +25,5 @@ export declare class Database<T extends DatabaseStructure> extends EventEmitter
|
|
|
25
25
|
setGlobals(globalFields: any): Promise<void>;
|
|
26
26
|
script(name: any, parameter?: string): Script;
|
|
27
27
|
_tokenExpired(): void;
|
|
28
|
-
streamContainer(field: any, url: any): Promise<http.IncomingMessage>;
|
|
28
|
+
streamContainer(field: any, url: any): Promise<redirecter.http.IncomingMessage>;
|
|
29
29
|
}
|
|
@@ -15,7 +15,7 @@ import fetch from "node-fetch";
|
|
|
15
15
|
import { generateAuthorizationHeaders } from "./generateAuthorizationHeaders.js";
|
|
16
16
|
import { FMError } from "../FMError.js";
|
|
17
17
|
import { Layout } from "../layouts/layout.js";
|
|
18
|
-
import
|
|
18
|
+
import redirecter from "follow-redirects";
|
|
19
19
|
export class Database extends EventEmitter {
|
|
20
20
|
constructor(host, conn) {
|
|
21
21
|
super();
|
|
@@ -176,7 +176,7 @@ export class Database extends EventEmitter {
|
|
|
176
176
|
.join("; ");
|
|
177
177
|
}
|
|
178
178
|
// Automatically switch between the http and https modules, based on which is needed
|
|
179
|
-
(url.startsWith("https") ? https : http).get(url, {
|
|
179
|
+
(url.startsWith("https") ? redirecter.https : redirecter.http).get(url, {
|
|
180
180
|
headers
|
|
181
181
|
}, (res) => {
|
|
182
182
|
// Check for the 'set-cookie' header. If it exists, remember it and strip it for better security.
|
|
@@ -8,7 +8,7 @@ import {generateAuthorizationHeaders} from "./generateAuthorizationHeaders.js";
|
|
|
8
8
|
import {FMError} from "../FMError.js";
|
|
9
9
|
import {LayoutInterface} from "../layouts/layoutInterface.js";
|
|
10
10
|
import {Layout} from "../layouts/layout.js";
|
|
11
|
-
import
|
|
11
|
+
import redirecter from "follow-redirects"
|
|
12
12
|
import {
|
|
13
13
|
databaseOptionsBase,
|
|
14
14
|
databaseOptionsWithExternalSources, DatabaseStructure,
|
|
@@ -180,7 +180,7 @@ export class Database<T extends DatabaseStructure> extends EventEmitter implemen
|
|
|
180
180
|
this.emit("token_expired")
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
streamContainer(field, url): Promise<http.IncomingMessage> {
|
|
183
|
+
streamContainer(field, url): Promise<redirecter.http.IncomingMessage> {
|
|
184
184
|
return new Promise((resolve, reject) => {
|
|
185
185
|
if (field.metadata.result !== "container") {
|
|
186
186
|
reject("Cannot stream the field " + field.id + " as it is not a container")
|
|
@@ -201,7 +201,7 @@ export class Database<T extends DatabaseStructure> extends EventEmitter implemen
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// Automatically switch between the http and https modules, based on which is needed
|
|
204
|
-
(url.startsWith("https") ? https : http).get(url, {
|
|
204
|
+
(url.startsWith("https") ? redirecter.https : redirecter.http).get(url, {
|
|
205
205
|
headers
|
|
206
206
|
}, (res) => {
|
|
207
207
|
// Check for the 'set-cookie' header. If it exists, remember it and strip it for better security.
|