Initial typescript tidy up (#1239)
This commit is contained in:
parent
ac236efdae
commit
1bd99f6b67
|
|
@ -31,7 +31,7 @@ describe("Connection", () => {
|
||||||
return Promise.resolve("");
|
return Promise.resolve("");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("http://tempuri.org", options);
|
let connection = new HttpConnection("http://tempuri.org", options);
|
||||||
|
|
@ -67,7 +67,7 @@ describe("Connection", () => {
|
||||||
return Promise.resolve("");
|
return Promise.resolve("");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("http://tempuri.org", options);
|
let connection = new HttpConnection("http://tempuri.org", options);
|
||||||
|
|
@ -93,7 +93,7 @@ describe("Connection", () => {
|
||||||
return Promise.resolve("");
|
return Promise.resolve("");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("http://tempuri.org", options);
|
let connection = new HttpConnection("http://tempuri.org", options);
|
||||||
|
|
@ -125,7 +125,7 @@ describe("Connection", () => {
|
||||||
return Promise.resolve("");
|
return Promise.resolve("");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("http://tempuri.org", options);
|
let connection = new HttpConnection("http://tempuri.org", options);
|
||||||
|
|
@ -156,7 +156,9 @@ describe("Connection", () => {
|
||||||
send(data: any): Promise<void> {
|
send(data: any): Promise<void> {
|
||||||
return Promise.reject("");
|
return Promise.reject("");
|
||||||
},
|
},
|
||||||
stop(): void { },
|
stop(): Promise<void> {
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
onreceive: undefined,
|
onreceive: undefined,
|
||||||
onclose: undefined,
|
onclose: undefined,
|
||||||
}
|
}
|
||||||
|
|
@ -171,7 +173,7 @@ describe("Connection", () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
transport: fakeTransport,
|
transport: fakeTransport,
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -205,7 +207,7 @@ describe("Connection", () => {
|
||||||
return Promise.resolve("");
|
return Promise.resolve("");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
connection = new HttpConnection(givenUrl, options);
|
connection = new HttpConnection(givenUrl, options);
|
||||||
|
|
@ -238,7 +240,7 @@ describe("Connection", () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
transport: requestedTransport,
|
transport: requestedTransport,
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("http://tempuri.org", options);
|
let connection = new HttpConnection("http://tempuri.org", options);
|
||||||
|
|
@ -264,7 +266,7 @@ describe("Connection", () => {
|
||||||
return Promise.resolve("");
|
return Promise.resolve("");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("http://tempuri.org", options);
|
let connection = new HttpConnection("http://tempuri.org", options);
|
||||||
|
|
@ -290,7 +292,7 @@ describe("Connection", () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
transport: TransportType.WebSockets,
|
transport: TransportType.WebSockets,
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("http://tempuri.org", options);
|
let connection = new HttpConnection("http://tempuri.org", options);
|
||||||
|
|
@ -318,7 +320,7 @@ describe("Connection", () => {
|
||||||
// mode: TransferMode : TransferMode.Text
|
// mode: TransferMode : TransferMode.Text
|
||||||
connect(url: string, requestedTransferMode: TransferMode): Promise<TransferMode> { return Promise.resolve(transportTransferMode); },
|
connect(url: string, requestedTransferMode: TransferMode): Promise<TransferMode> { return Promise.resolve(transportTransferMode); },
|
||||||
send(data: any): Promise<void> { return Promise.resolve(); },
|
send(data: any): Promise<void> { return Promise.resolve(); },
|
||||||
stop(): void { },
|
stop(): Promise<void> { return Promise.resolve(); },
|
||||||
onreceive: null,
|
onreceive: null,
|
||||||
onclose: null,
|
onclose: null,
|
||||||
mode: transportTransferMode
|
mode: transportTransferMode
|
||||||
|
|
@ -334,7 +336,7 @@ describe("Connection", () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
transport: fakeTransport,
|
transport: fakeTransport,
|
||||||
logging: null
|
logger: null
|
||||||
} as IHttpConnectionOptions;
|
} as IHttpConnectionOptions;
|
||||||
|
|
||||||
let connection = new HttpConnection("https://tempuri.org", options);
|
let connection = new HttpConnection("https://tempuri.org", options);
|
||||||
|
|
@ -18,7 +18,7 @@ describe("HubConnection", () => {
|
||||||
describe("start", () => {
|
describe("start", () => {
|
||||||
it("sends negotiation message", async () => {
|
it("sends negotiation message", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection, { logging: null });
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
await hubConnection.start();
|
await hubConnection.start();
|
||||||
expect(connection.sentData.length).toBe(1)
|
expect(connection.sentData.length).toBe(1)
|
||||||
expect(JSON.parse(connection.sentData[0])).toEqual({
|
expect(JSON.parse(connection.sentData[0])).toEqual({
|
||||||
|
|
@ -32,7 +32,7 @@ describe("HubConnection", () => {
|
||||||
it("sends a non blocking invocation", async () => {
|
it("sends a non blocking invocation", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.send("testMethod", "arg", 42)
|
let invokePromise = hubConnection.send("testMethod", "arg", 42)
|
||||||
.catch((_) => { }); // Suppress exception and unhandled promise rejection warning.
|
.catch((_) => { }); // Suppress exception and unhandled promise rejection warning.
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ describe("HubConnection", () => {
|
||||||
it("sends an invocation", async () => {
|
it("sends an invocation", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.invoke("testMethod", "arg", 42)
|
let invokePromise = hubConnection.invoke("testMethod", "arg", 42)
|
||||||
.catch((_) => { }); // Suppress exception and unhandled promise rejection warning.
|
.catch((_) => { }); // Suppress exception and unhandled promise rejection warning.
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ describe("HubConnection", () => {
|
||||||
it("rejects the promise when an error is received", async () => {
|
it("rejects the promise when an error is received", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.invoke("testMethod", "arg", 42);
|
let invokePromise = hubConnection.invoke("testMethod", "arg", 42);
|
||||||
|
|
||||||
connection.receive({ type: MessageType.Completion, invocationId: connection.lastInvocationId, error: "foo" });
|
connection.receive({ type: MessageType.Completion, invocationId: connection.lastInvocationId, error: "foo" });
|
||||||
|
|
@ -91,7 +91,7 @@ describe("HubConnection", () => {
|
||||||
it("resolves the promise when a result is received", async () => {
|
it("resolves the promise when a result is received", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.invoke("testMethod", "arg", 42);
|
let invokePromise = hubConnection.invoke("testMethod", "arg", 42);
|
||||||
|
|
||||||
connection.receive({ type: MessageType.Completion, invocationId: connection.lastInvocationId, result: "foo" });
|
connection.receive({ type: MessageType.Completion, invocationId: connection.lastInvocationId, result: "foo" });
|
||||||
|
|
@ -102,7 +102,7 @@ describe("HubConnection", () => {
|
||||||
it("completes pending invocations when stopped", async () => {
|
it("completes pending invocations when stopped", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.invoke("testMethod");
|
let invokePromise = hubConnection.invoke("testMethod");
|
||||||
hubConnection.stop();
|
hubConnection.stop();
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ describe("HubConnection", () => {
|
||||||
it("completes pending invocations when connection is lost", async () => {
|
it("completes pending invocations when connection is lost", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.invoke("testMethod");
|
let invokePromise = hubConnection.invoke("testMethod");
|
||||||
// Typically this would be called by the transport
|
// Typically this would be called by the transport
|
||||||
connection.onclose(new Error("Connection lost"));
|
connection.onclose(new Error("Connection lost"));
|
||||||
|
|
@ -134,7 +134,7 @@ describe("HubConnection", () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection, { logging: logger });
|
let hubConnection = new HubConnection(connection, { logger: logger });
|
||||||
|
|
||||||
connection.receive({
|
connection.receive({
|
||||||
type: MessageType.Invocation,
|
type: MessageType.Invocation,
|
||||||
|
|
@ -149,7 +149,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("callback invoked when servers invokes a method on the client", async () => {
|
it("callback invoked when servers invokes a method on the client", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let value = 0;
|
let value = 0;
|
||||||
hubConnection.on("message", v => value = v);
|
hubConnection.on("message", v => value = v);
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("can have multiple callbacks", async () => {
|
it("can have multiple callbacks", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let numInvocations1 = 0;
|
let numInvocations1 = 0;
|
||||||
let numInvocations2 = 0;
|
let numInvocations2 = 0;
|
||||||
hubConnection.on("message", () => numInvocations1++);
|
hubConnection.on("message", () => numInvocations1++);
|
||||||
|
|
@ -186,7 +186,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("can unsubscribe from on", async () => {
|
it("can unsubscribe from on", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
|
|
||||||
var numInvocations = 0;
|
var numInvocations = 0;
|
||||||
var callback = () => numInvocations++;
|
var callback = () => numInvocations++;
|
||||||
|
|
@ -215,7 +215,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("unsubscribing from non-existing callbacks no-ops", async () => {
|
it("unsubscribing from non-existing callbacks no-ops", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
|
|
||||||
hubConnection.off("_", () => { });
|
hubConnection.off("_", () => { });
|
||||||
hubConnection.on("message", t => { });
|
hubConnection.on("message", t => { });
|
||||||
|
|
@ -234,7 +234,7 @@ describe("HubConnection", () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection, { logging: logger });
|
let hubConnection = new HubConnection(connection, { logger: logger });
|
||||||
|
|
||||||
hubConnection.on(null, undefined);
|
hubConnection.on(null, undefined);
|
||||||
hubConnection.on(undefined, null);
|
hubConnection.on(undefined, null);
|
||||||
|
|
@ -267,7 +267,7 @@ describe("HubConnection", () => {
|
||||||
it("sends an invocation", async () => {
|
it("sends an invocation", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.stream("testStream", "arg", 42);
|
let invokePromise = hubConnection.stream("testStream", "arg", 42);
|
||||||
|
|
||||||
// Verify the message is sent
|
// Verify the message is sent
|
||||||
|
|
@ -289,7 +289,7 @@ describe("HubConnection", () => {
|
||||||
it("completes with an error when an error is yielded", async () => {
|
it("completes with an error when an error is yielded", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let observer = new TestObserver();
|
let observer = new TestObserver();
|
||||||
hubConnection.stream<any>("testMethod", "arg", 42)
|
hubConnection.stream<any>("testMethod", "arg", 42)
|
||||||
.subscribe(observer);
|
.subscribe(observer);
|
||||||
|
|
@ -303,7 +303,7 @@ describe("HubConnection", () => {
|
||||||
it("completes the observer when a completion is received", async () => {
|
it("completes the observer when a completion is received", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let observer = new TestObserver();
|
let observer = new TestObserver();
|
||||||
hubConnection.stream<any>("testMethod", "arg", 42)
|
hubConnection.stream<any>("testMethod", "arg", 42)
|
||||||
.subscribe(observer);
|
.subscribe(observer);
|
||||||
|
|
@ -316,7 +316,7 @@ describe("HubConnection", () => {
|
||||||
it("completes pending streams when stopped", async () => {
|
it("completes pending streams when stopped", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let observer = new TestObserver();
|
let observer = new TestObserver();
|
||||||
hubConnection.stream<any>("testMethod")
|
hubConnection.stream<any>("testMethod")
|
||||||
.subscribe(observer);
|
.subscribe(observer);
|
||||||
|
|
@ -329,7 +329,7 @@ describe("HubConnection", () => {
|
||||||
it("completes pending streams when connection is lost", async () => {
|
it("completes pending streams when connection is lost", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let observer = new TestObserver();
|
let observer = new TestObserver();
|
||||||
hubConnection.stream<any>("testMethod")
|
hubConnection.stream<any>("testMethod")
|
||||||
.subscribe(observer);
|
.subscribe(observer);
|
||||||
|
|
@ -344,7 +344,7 @@ describe("HubConnection", () => {
|
||||||
it("yields items as they arrive", async () => {
|
it("yields items as they arrive", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let observer = new TestObserver();
|
let observer = new TestObserver();
|
||||||
hubConnection.stream<any>("testMethod")
|
hubConnection.stream<any>("testMethod")
|
||||||
.subscribe(observer);
|
.subscribe(observer);
|
||||||
|
|
@ -365,7 +365,7 @@ describe("HubConnection", () => {
|
||||||
it("does not require error function registered", async () => {
|
it("does not require error function registered", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let observer = hubConnection.stream("testMethod").subscribe({
|
let observer = hubConnection.stream("testMethod").subscribe({
|
||||||
next: val => { }
|
next: val => { }
|
||||||
});
|
});
|
||||||
|
|
@ -378,7 +378,7 @@ describe("HubConnection", () => {
|
||||||
it("does not require complete function registered", async () => {
|
it("does not require complete function registered", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
|
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let observer = hubConnection.stream("testMethod").subscribe({
|
let observer = hubConnection.stream("testMethod").subscribe({
|
||||||
next: val => { }
|
next: val => { }
|
||||||
});
|
});
|
||||||
|
|
@ -392,7 +392,7 @@ describe("HubConnection", () => {
|
||||||
describe("onClose", () => {
|
describe("onClose", () => {
|
||||||
it("can have multiple callbacks", async () => {
|
it("can have multiple callbacks", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invocations = 0;
|
let invocations = 0;
|
||||||
hubConnection.onclose(e => invocations++);
|
hubConnection.onclose(e => invocations++);
|
||||||
hubConnection.onclose(e => invocations++);
|
hubConnection.onclose(e => invocations++);
|
||||||
|
|
@ -403,7 +403,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("callbacks receive error", async () => {
|
it("callbacks receive error", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let error: Error;
|
let error: Error;
|
||||||
hubConnection.onclose(e => error = e);
|
hubConnection.onclose(e => error = e);
|
||||||
|
|
||||||
|
|
@ -414,7 +414,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("ignores null callbacks", async () => {
|
it("ignores null callbacks", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
hubConnection.onclose(null);
|
hubConnection.onclose(null);
|
||||||
hubConnection.onclose(undefined);
|
hubConnection.onclose(undefined);
|
||||||
// Typically this would be called by the transport
|
// Typically this would be called by the transport
|
||||||
|
|
@ -428,7 +428,7 @@ describe("HubConnection", () => {
|
||||||
// Receive the ping mid-invocation so we can see that the rest of the flow works fine
|
// Receive the ping mid-invocation so we can see that the rest of the flow works fine
|
||||||
|
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection);
|
let hubConnection = new HubConnection(connection, { logger: null });
|
||||||
let invokePromise = hubConnection.invoke("testMethod", "arg", 42);
|
let invokePromise = hubConnection.invoke("testMethod", "arg", 42);
|
||||||
|
|
||||||
connection.receive({ type: MessageType.Ping });
|
connection.receive({ type: MessageType.Ping });
|
||||||
|
|
@ -439,7 +439,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("does not terminate if messages are received", async () => {
|
it("does not terminate if messages are received", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection, { serverTimeoutInMilliseconds: 100 });
|
let hubConnection = new HubConnection(connection, { timeoutInMilliseconds: 100, logger: null });
|
||||||
|
|
||||||
let p = new PromiseSource<Error>();
|
let p = new PromiseSource<Error>();
|
||||||
hubConnection.onclose(error => p.resolve(error));
|
hubConnection.onclose(error => p.resolve(error));
|
||||||
|
|
@ -464,7 +464,7 @@ describe("HubConnection", () => {
|
||||||
|
|
||||||
it("terminates if no messages received within timeout interval", async () => {
|
it("terminates if no messages received within timeout interval", async () => {
|
||||||
let connection = new TestConnection();
|
let connection = new TestConnection();
|
||||||
let hubConnection = new HubConnection(connection, { serverTimeoutInMilliseconds: 100 });
|
let hubConnection = new HubConnection(connection, { timeoutInMilliseconds: 100, logger: null });
|
||||||
|
|
||||||
let p = new PromiseSource<Error>();
|
let p = new PromiseSource<Error>();
|
||||||
hubConnection.onclose(error => p.resolve(error));
|
hubConnection.onclose(error => p.resolve(error));
|
||||||
|
|
@ -500,10 +500,11 @@ class TestConnection implements IConnection {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
};
|
};
|
||||||
|
|
||||||
stop(error?: Error): void {
|
stop(error?: Error): Promise<void> {
|
||||||
if (this.onclose) {
|
if (this.onclose) {
|
||||||
this.onclose(error);
|
this.onclose(error);
|
||||||
}
|
}
|
||||||
|
return Promise.resolve();
|
||||||
};
|
};
|
||||||
|
|
||||||
receive(data: any): void {
|
receive(data: any): void {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export class HttpConnection implements IConnection {
|
||||||
readonly features: any = {};
|
readonly features: any = {};
|
||||||
|
|
||||||
constructor(url: string, options: IHttpConnectionOptions = {}) {
|
constructor(url: string, options: IHttpConnectionOptions = {}) {
|
||||||
this.logger = LoggerFactory.createLogger(options.logging);
|
this.logger = LoggerFactory.createLogger(options.logger);
|
||||||
this.baseUrl = this.resolveUrl(url);
|
this.baseUrl = this.resolveUrl(url);
|
||||||
options = options || {};
|
options = options || {};
|
||||||
this.httpClient = options.httpClient || new HttpClient();
|
this.httpClient = options.httpClient || new HttpClient();
|
||||||
|
|
@ -62,9 +62,9 @@ export class HttpConnection implements IConnection {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let headers;
|
let headers;
|
||||||
if (this.options.jwtBearer) {
|
if (this.options.accessToken) {
|
||||||
headers = new Map<string, string>();
|
headers = new Map<string, string>();
|
||||||
headers.set("Authorization", `Bearer ${this.options.jwtBearer()}`);
|
headers.set("Authorization", `Bearer ${this.options.accessToken()}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let negotiatePayload = await this.httpClient.post(this.resolveNegotiateUrl(this.baseUrl), "", headers);
|
let negotiatePayload = await this.httpClient.post(this.resolveNegotiateUrl(this.baseUrl), "", headers);
|
||||||
|
|
@ -110,13 +110,13 @@ export class HttpConnection implements IConnection {
|
||||||
transport = TransportType[availableTransports[0]];
|
transport = TransportType[availableTransports[0]];
|
||||||
}
|
}
|
||||||
if (transport === TransportType.WebSockets && availableTransports.indexOf(TransportType[transport]) >= 0) {
|
if (transport === TransportType.WebSockets && availableTransports.indexOf(TransportType[transport]) >= 0) {
|
||||||
return new WebSocketTransport(this.options.jwtBearer, this.logger);
|
return new WebSocketTransport(this.options.accessToken, this.logger);
|
||||||
}
|
}
|
||||||
if (transport === TransportType.ServerSentEvents && availableTransports.indexOf(TransportType[transport]) >= 0) {
|
if (transport === TransportType.ServerSentEvents && availableTransports.indexOf(TransportType[transport]) >= 0) {
|
||||||
return new ServerSentEventsTransport(this.httpClient, this.options.jwtBearer, this.logger);
|
return new ServerSentEventsTransport(this.httpClient, this.options.accessToken, this.logger);
|
||||||
}
|
}
|
||||||
if (transport === TransportType.LongPolling && availableTransports.indexOf(TransportType[transport]) >= 0) {
|
if (transport === TransportType.LongPolling && availableTransports.indexOf(TransportType[transport]) >= 0) {
|
||||||
return new LongPollingTransport(this.httpClient, this.options.jwtBearer, this.logger);
|
return new LongPollingTransport(this.httpClient, this.options.accessToken, this.logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isITransport(transport)) {
|
if (this.isITransport(transport)) {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import { Base64EncodedHubProtocol } from "./Base64EncodedHubProtocol"
|
||||||
import { ILogger, LogLevel } from "./ILogger"
|
import { ILogger, LogLevel } from "./ILogger"
|
||||||
import { ConsoleLogger, NullLogger, LoggerFactory } from "./Loggers"
|
import { ConsoleLogger, NullLogger, LoggerFactory } from "./Loggers"
|
||||||
import { IHubConnectionOptions } from "./IHubConnectionOptions"
|
import { IHubConnectionOptions } from "./IHubConnectionOptions"
|
||||||
import { setTimeout, clearTimeout } from "timers";
|
|
||||||
|
|
||||||
export { TransportType } from "./Transports"
|
export { TransportType } from "./Transports"
|
||||||
export { HttpConnection } from "./HttpConnection"
|
export { HttpConnection } from "./HttpConnection"
|
||||||
|
|
@ -21,7 +20,7 @@ export { JsonHubProtocol } from "./JsonHubProtocol"
|
||||||
export { LogLevel, ILogger } from "./ILogger"
|
export { LogLevel, ILogger } from "./ILogger"
|
||||||
export { ConsoleLogger, NullLogger } from "./Loggers"
|
export { ConsoleLogger, NullLogger } from "./Loggers"
|
||||||
|
|
||||||
const DEFAULT_SERVER_TIMEOUT_IN_MS: number = 30 * 1000;
|
const DEFAULT_TIMEOUT_IN_MS: number = 30 * 1000;
|
||||||
|
|
||||||
export class HubConnection {
|
export class HubConnection {
|
||||||
private readonly connection: IConnection;
|
private readonly connection: IConnection;
|
||||||
|
|
@ -32,12 +31,14 @@ export class HubConnection {
|
||||||
private id: number;
|
private id: number;
|
||||||
private closedCallbacks: ConnectionClosed[];
|
private closedCallbacks: ConnectionClosed[];
|
||||||
private timeoutHandle: NodeJS.Timer;
|
private timeoutHandle: NodeJS.Timer;
|
||||||
private serverTimeoutInMilliseconds: number;
|
private timeoutInMilliseconds: number;
|
||||||
|
|
||||||
|
constructor(url: string, options?: IHubConnectionOptions);
|
||||||
|
constructor(connection: IConnection, options?: IHubConnectionOptions);
|
||||||
constructor(urlOrConnection: string | IConnection, options: IHubConnectionOptions = {}) {
|
constructor(urlOrConnection: string | IConnection, options: IHubConnectionOptions = {}) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
this.serverTimeoutInMilliseconds = options.serverTimeoutInMilliseconds || DEFAULT_SERVER_TIMEOUT_IN_MS;
|
this.timeoutInMilliseconds = options.timeoutInMilliseconds || DEFAULT_TIMEOUT_IN_MS;
|
||||||
|
|
||||||
if (typeof urlOrConnection === "string") {
|
if (typeof urlOrConnection === "string") {
|
||||||
this.connection = new HttpConnection(urlOrConnection, options);
|
this.connection = new HttpConnection(urlOrConnection, options);
|
||||||
|
|
@ -46,7 +47,7 @@ export class HubConnection {
|
||||||
this.connection = urlOrConnection;
|
this.connection = urlOrConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger = LoggerFactory.createLogger(options.logging);
|
this.logger = LoggerFactory.createLogger(options.logger);
|
||||||
|
|
||||||
this.protocol = options.protocol || new JsonHubProtocol();
|
this.protocol = options.protocol || new JsonHubProtocol();
|
||||||
this.connection.onreceive = (data: any) => this.processIncomingData(data);
|
this.connection.onreceive = (data: any) => this.processIncomingData(data);
|
||||||
|
|
@ -98,7 +99,7 @@ export class HubConnection {
|
||||||
private configureTimeout() {
|
private configureTimeout() {
|
||||||
if (!this.connection.features || !this.connection.features.inherentKeepAlive) {
|
if (!this.connection.features || !this.connection.features.inherentKeepAlive) {
|
||||||
// Set the timeout timer
|
// Set the timeout timer
|
||||||
this.timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);
|
this.timeoutHandle = setTimeout(() => this.serverTimeout(), this.timeoutInMilliseconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,7 +157,7 @@ export class HubConnection {
|
||||||
this.configureTimeout();
|
this.configureTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(): void {
|
stop(): Promise<void> {
|
||||||
if (this.timeoutHandle) {
|
if (this.timeoutHandle) {
|
||||||
clearTimeout(this.timeoutHandle);
|
clearTimeout(this.timeoutHandle);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
import { DataReceived, ConnectionClosed } from "./Common"
|
import { DataReceived, ConnectionClosed } from "./Common"
|
||||||
import { TransportType, TransferMode, ITransport } from "./Transports"
|
import { TransportType, TransferMode, ITransport } from "./Transports"
|
||||||
|
|
||||||
export interface IConnection {
|
export interface IConnection {
|
||||||
readonly features: any;
|
readonly features: any;
|
||||||
|
|
||||||
start(): Promise<void>;
|
start(): Promise<void>;
|
||||||
send(data: any): Promise<void>;
|
send(data: any): Promise<void>;
|
||||||
stop(error?: Error): void;
|
stop(error?: Error): Promise<void>;
|
||||||
|
|
||||||
onreceive: DataReceived;
|
onreceive: DataReceived;
|
||||||
onclose: ConnectionClosed;
|
onclose: ConnectionClosed;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@ import { ILogger, LogLevel } from "./ILogger";
|
||||||
export interface IHttpConnectionOptions {
|
export interface IHttpConnectionOptions {
|
||||||
httpClient?: IHttpClient;
|
httpClient?: IHttpClient;
|
||||||
transport?: TransportType | ITransport;
|
transport?: TransportType | ITransport;
|
||||||
logging?: ILogger | LogLevel;
|
logger?: ILogger | LogLevel;
|
||||||
jwtBearer?: () => string;
|
accessToken?: () => string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,5 @@ import { ILogger, LogLevel } from "./ILogger"
|
||||||
|
|
||||||
export interface IHubConnectionOptions extends IHttpConnectionOptions {
|
export interface IHubConnectionOptions extends IHttpConnectionOptions {
|
||||||
protocol?: IHubProtocol;
|
protocol?: IHubProtocol;
|
||||||
serverTimeoutInMilliseconds?: number;
|
timeoutInMilliseconds?: number;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,27 +21,27 @@ export const enum TransferMode {
|
||||||
export interface ITransport {
|
export interface ITransport {
|
||||||
connect(url: string, requestedTransferMode: TransferMode, connection: IConnection): Promise<TransferMode>;
|
connect(url: string, requestedTransferMode: TransferMode, connection: IConnection): Promise<TransferMode>;
|
||||||
send(data: any): Promise<void>;
|
send(data: any): Promise<void>;
|
||||||
stop(): void;
|
stop(): Promise<void>;
|
||||||
onreceive: DataReceived;
|
onreceive: DataReceived;
|
||||||
onclose: TransportClosed;
|
onclose: TransportClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WebSocketTransport implements ITransport {
|
export class WebSocketTransport implements ITransport {
|
||||||
private readonly logger: ILogger;
|
private readonly logger: ILogger;
|
||||||
private readonly jwtBearer: () => string;
|
private readonly accessToken: () => string;
|
||||||
private webSocket: WebSocket;
|
private webSocket: WebSocket;
|
||||||
|
|
||||||
constructor(jwtBearer: () => string, logger: ILogger) {
|
constructor(accessToken: () => string, logger: ILogger) {
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.jwtBearer = jwtBearer;
|
this.accessToken = accessToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(url: string, requestedTransferMode: TransferMode, connection: IConnection): Promise<TransferMode> {
|
connect(url: string, requestedTransferMode: TransferMode, connection: IConnection): Promise<TransferMode> {
|
||||||
|
|
||||||
return new Promise<TransferMode>((resolve, reject) => {
|
return new Promise<TransferMode>((resolve, reject) => {
|
||||||
url = url.replace(/^http/, "ws");
|
url = url.replace(/^http/, "ws");
|
||||||
if (this.jwtBearer) {
|
if (this.accessToken) {
|
||||||
let token = this.jwtBearer();
|
let token = this.accessToken();
|
||||||
url += (url.indexOf("?") < 0 ? "?" : "&") + `signalRTokenHeader=${token}`;
|
url += (url.indexOf("?") < 0 ? "?" : "&") + `signalRTokenHeader=${token}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,11 +90,12 @@ export class WebSocketTransport implements ITransport {
|
||||||
return Promise.reject("WebSocket is not in the OPEN state");
|
return Promise.reject("WebSocket is not in the OPEN state");
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(): void {
|
stop(): Promise<void> {
|
||||||
if (this.webSocket) {
|
if (this.webSocket) {
|
||||||
this.webSocket.close();
|
this.webSocket.close();
|
||||||
this.webSocket = null;
|
this.webSocket = null;
|
||||||
}
|
}
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
onreceive: DataReceived;
|
onreceive: DataReceived;
|
||||||
|
|
@ -103,14 +104,14 @@ export class WebSocketTransport implements ITransport {
|
||||||
|
|
||||||
export class ServerSentEventsTransport implements ITransport {
|
export class ServerSentEventsTransport implements ITransport {
|
||||||
private readonly httpClient: IHttpClient;
|
private readonly httpClient: IHttpClient;
|
||||||
private readonly jwtBearer: () => string;
|
private readonly accessToken: () => string;
|
||||||
private readonly logger: ILogger;
|
private readonly logger: ILogger;
|
||||||
private eventSource: EventSource;
|
private eventSource: EventSource;
|
||||||
private url: string;
|
private url: string;
|
||||||
|
|
||||||
constructor(httpClient: IHttpClient, jwtBearer: () => string, logger: ILogger) {
|
constructor(httpClient: IHttpClient, accessToken: () => string, logger: ILogger) {
|
||||||
this.httpClient = httpClient;
|
this.httpClient = httpClient;
|
||||||
this.jwtBearer = jwtBearer;
|
this.accessToken = accessToken;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,8 +122,8 @@ export class ServerSentEventsTransport implements ITransport {
|
||||||
|
|
||||||
this.url = url;
|
this.url = url;
|
||||||
return new Promise<TransferMode>((resolve, reject) => {
|
return new Promise<TransferMode>((resolve, reject) => {
|
||||||
if (this.jwtBearer) {
|
if (this.accessToken) {
|
||||||
let token = this.jwtBearer();
|
let token = this.accessToken();
|
||||||
url += (url.indexOf("?") < 0 ? "?" : "&") + `signalRTokenHeader=${token}`;
|
url += (url.indexOf("?") < 0 ? "?" : "&") + `signalRTokenHeader=${token}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,14 +167,15 @@ export class ServerSentEventsTransport implements ITransport {
|
||||||
}
|
}
|
||||||
|
|
||||||
async send(data: any): Promise<void> {
|
async send(data: any): Promise<void> {
|
||||||
return send(this.httpClient, this.url, this.jwtBearer, data);
|
return send(this.httpClient, this.url, this.accessToken, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(): void {
|
stop(): Promise<void> {
|
||||||
if (this.eventSource) {
|
if (this.eventSource) {
|
||||||
this.eventSource.close();
|
this.eventSource.close();
|
||||||
this.eventSource = null;
|
this.eventSource = null;
|
||||||
}
|
}
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
onreceive: DataReceived;
|
onreceive: DataReceived;
|
||||||
|
|
@ -182,16 +184,16 @@ export class ServerSentEventsTransport implements ITransport {
|
||||||
|
|
||||||
export class LongPollingTransport implements ITransport {
|
export class LongPollingTransport implements ITransport {
|
||||||
private readonly httpClient: IHttpClient;
|
private readonly httpClient: IHttpClient;
|
||||||
private readonly jwtBearer: () => string;
|
private readonly accessToken: () => string;
|
||||||
private readonly logger: ILogger;
|
private readonly logger: ILogger;
|
||||||
|
|
||||||
private url: string;
|
private url: string;
|
||||||
private pollXhr: XMLHttpRequest;
|
private pollXhr: XMLHttpRequest;
|
||||||
private shouldPoll: boolean;
|
private shouldPoll: boolean;
|
||||||
|
|
||||||
constructor(httpClient: IHttpClient, jwtBearer: () => string, logger: ILogger) {
|
constructor(httpClient: IHttpClient, accessToken: () => string, logger: ILogger) {
|
||||||
this.httpClient = httpClient;
|
this.httpClient = httpClient;
|
||||||
this.jwtBearer = jwtBearer;
|
this.accessToken = accessToken;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -268,8 +270,8 @@ export class LongPollingTransport implements ITransport {
|
||||||
this.pollXhr = pollXhr;
|
this.pollXhr = pollXhr;
|
||||||
|
|
||||||
this.pollXhr.open("GET", `${url}&_=${Date.now()}`, true);
|
this.pollXhr.open("GET", `${url}&_=${Date.now()}`, true);
|
||||||
if (this.jwtBearer) {
|
if (this.accessToken) {
|
||||||
this.pollXhr.setRequestHeader("Authorization", `Bearer ${this.jwtBearer()}`);
|
this.pollXhr.setRequestHeader("Authorization", `Bearer ${this.accessToken()}`);
|
||||||
}
|
}
|
||||||
if (transferMode === TransferMode.Binary) {
|
if (transferMode === TransferMode.Binary) {
|
||||||
this.pollXhr.responseType = "arraybuffer";
|
this.pollXhr.responseType = "arraybuffer";
|
||||||
|
|
@ -281,26 +283,27 @@ export class LongPollingTransport implements ITransport {
|
||||||
}
|
}
|
||||||
|
|
||||||
async send(data: any): Promise<void> {
|
async send(data: any): Promise<void> {
|
||||||
return send(this.httpClient, this.url, this.jwtBearer, data);
|
return send(this.httpClient, this.url, this.accessToken, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(): void {
|
stop(): Promise<void> {
|
||||||
this.shouldPoll = false;
|
this.shouldPoll = false;
|
||||||
if (this.pollXhr) {
|
if (this.pollXhr) {
|
||||||
this.pollXhr.abort();
|
this.pollXhr.abort();
|
||||||
this.pollXhr = null;
|
this.pollXhr = null;
|
||||||
}
|
}
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
onreceive: DataReceived;
|
onreceive: DataReceived;
|
||||||
onclose: TransportClosed;
|
onclose: TransportClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function send(httpClient: IHttpClient, url: string, jwtBearer: () => string, data: any): Promise<void> {
|
async function send(httpClient: IHttpClient, url: string, accessToken: () => string, data: any): Promise<void> {
|
||||||
let headers;
|
let headers;
|
||||||
if (jwtBearer) {
|
if (accessToken) {
|
||||||
headers = new Map<string, string>();
|
headers = new Map<string, string>();
|
||||||
headers.set("Authorization", `Bearer ${jwtBearer()}`)
|
headers.set("Authorization", `Bearer ${accessToken()}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
await httpClient.post(url, data, headers);
|
await httpClient.post(url, data, headers);
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,7 @@ describe('hubConnection', function () {
|
||||||
var options = {
|
var options = {
|
||||||
transport: transportType,
|
transport: transportType,
|
||||||
logging: signalR.LogLevel.Trace,
|
logging: signalR.LogLevel.Trace,
|
||||||
jwtBearer: function () {
|
accessToken: function () {
|
||||||
return jwtToken;
|
return jwtToken;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -518,7 +518,7 @@ describe('hubConnection', function () {
|
||||||
var options = {
|
var options = {
|
||||||
transport: transportType,
|
transport: transportType,
|
||||||
logging: signalR.LogLevel.Trace,
|
logging: signalR.LogLevel.Trace,
|
||||||
serverTimeoutInMilliseconds: 100
|
timeoutInMilliseconds: 100
|
||||||
};
|
};
|
||||||
|
|
||||||
var hubConnection = new signalR.HubConnection(TESTHUBENDPOINT_URL, options);
|
var hubConnection = new signalR.HubConnection(TESTHUBENDPOINT_URL, options);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,16 @@
|
||||||
"integrity": "sha512-zT+t9841g1HsjLtPMCYxmb1U4pcZ2TOegAKiomlmj6bIziuaEYHUavxLE9NRwdntY0vOCrgHho6OXjDX7fm/Kw==",
|
"integrity": "sha512-zT+t9841g1HsjLtPMCYxmb1U4pcZ2TOegAKiomlmj6bIziuaEYHUavxLE9NRwdntY0vOCrgHho6OXjDX7fm/Kw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"JSONStream": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz",
|
||||||
|
"integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"jsonparse": "1.3.1",
|
||||||
|
"through": "2.3.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"acorn": {
|
"acorn": {
|
||||||
"version": "4.0.13",
|
"version": "4.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz",
|
||||||
|
|
@ -1017,9 +1027,9 @@
|
||||||
"integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=",
|
"integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"JSONStream": "1.3.1",
|
||||||
"combine-source-map": "0.7.2",
|
"combine-source-map": "0.7.2",
|
||||||
"defined": "1.0.0",
|
"defined": "1.0.0",
|
||||||
"JSONStream": "1.3.1",
|
|
||||||
"through2": "2.0.3",
|
"through2": "2.0.3",
|
||||||
"umd": "3.0.1"
|
"umd": "3.0.1"
|
||||||
}
|
}
|
||||||
|
|
@ -1047,6 +1057,7 @@
|
||||||
"integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=",
|
"integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"JSONStream": "1.3.1",
|
||||||
"assert": "1.4.1",
|
"assert": "1.4.1",
|
||||||
"browser-pack": "6.0.2",
|
"browser-pack": "6.0.2",
|
||||||
"browser-resolve": "1.11.2",
|
"browser-resolve": "1.11.2",
|
||||||
|
|
@ -1068,7 +1079,6 @@
|
||||||
"https-browserify": "0.0.1",
|
"https-browserify": "0.0.1",
|
||||||
"inherits": "2.0.3",
|
"inherits": "2.0.3",
|
||||||
"insert-module-globals": "7.0.1",
|
"insert-module-globals": "7.0.1",
|
||||||
"JSONStream": "1.3.1",
|
|
||||||
"labeled-stream-splicer": "2.0.0",
|
"labeled-stream-splicer": "2.0.0",
|
||||||
"module-deps": "4.1.1",
|
"module-deps": "4.1.1",
|
||||||
"os-browserify": "0.1.2",
|
"os-browserify": "0.1.2",
|
||||||
|
|
@ -2487,10 +2497,10 @@
|
||||||
"integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=",
|
"integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"JSONStream": "1.3.1",
|
||||||
"combine-source-map": "0.7.2",
|
"combine-source-map": "0.7.2",
|
||||||
"concat-stream": "1.5.2",
|
"concat-stream": "1.5.2",
|
||||||
"is-buffer": "1.1.5",
|
"is-buffer": "1.1.5",
|
||||||
"JSONStream": "1.3.1",
|
|
||||||
"lexical-scope": "1.2.0",
|
"lexical-scope": "1.2.0",
|
||||||
"process": "0.11.10",
|
"process": "0.11.10",
|
||||||
"through2": "2.0.3",
|
"through2": "2.0.3",
|
||||||
|
|
@ -2763,16 +2773,6 @@
|
||||||
"integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=",
|
"integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"JSONStream": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz",
|
|
||||||
"integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"jsonparse": "1.3.1",
|
|
||||||
"through": "2.3.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"kind-of": {
|
"kind-of": {
|
||||||
"version": "3.2.2",
|
"version": "3.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
|
||||||
|
|
@ -3126,6 +3126,7 @@
|
||||||
"integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=",
|
"integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"JSONStream": "1.3.1",
|
||||||
"browser-resolve": "1.11.2",
|
"browser-resolve": "1.11.2",
|
||||||
"cached-path-relative": "1.0.1",
|
"cached-path-relative": "1.0.1",
|
||||||
"concat-stream": "1.5.2",
|
"concat-stream": "1.5.2",
|
||||||
|
|
@ -3133,7 +3134,6 @@
|
||||||
"detective": "4.5.0",
|
"detective": "4.5.0",
|
||||||
"duplexer2": "0.1.4",
|
"duplexer2": "0.1.4",
|
||||||
"inherits": "2.0.3",
|
"inherits": "2.0.3",
|
||||||
"JSONStream": "1.3.1",
|
|
||||||
"parents": "1.0.1",
|
"parents": "1.0.1",
|
||||||
"readable-stream": "2.2.11",
|
"readable-stream": "2.2.11",
|
||||||
"resolve": "1.3.3",
|
"resolve": "1.3.3",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue