@fanoutio/grip
Advanced tools
Comparing version 2.0.0-rc.1 to 2.0.0-rc.2
export default interface IGripConfig { | ||
control_uri: string; | ||
control_iss: string; | ||
key: string; | ||
control_iss?: string; | ||
key?: string; | ||
} |
@@ -5,3 +5,3 @@ /// <reference types="node" /> | ||
import IWebSocketEvent from "./data/websocket/IWebSocketEvent"; | ||
declare type Channels = string | Channel | Channel[]; | ||
declare type Channels = Channel | Channel[] | string | string[]; | ||
export declare function validateSig(token: string, key: any): boolean; | ||
@@ -17,5 +17,5 @@ export declare function decodeWebSocketEvents(body: Buffer | string): IWebSocketEvent[]; | ||
}; | ||
export declare function parseChannels(channels: Channels): Channel[]; | ||
export declare function parseChannels(inChannels: Channels): Channel[]; | ||
export declare function getHoldChannels(channels: string[] | Channel[]): import("./main").IExportedChannel[]; | ||
export declare function buildWebSocketControlMessage(type: string, args?: object | null): string; | ||
export {}; |
@@ -513,6 +513,2 @@ import { Buffer } from 'buffer'; | ||
var jspack = { | ||
jspack: jspack_1 | ||
}; | ||
// The WebSocketEvent class represents WebSocket event information that is | ||
@@ -772,10 +768,5 @@ // used with the GRIP WebSocket-over-HTTP protocol. It includes information | ||
// be a string, a Channel instance, or an array of Channel instances. | ||
function parseChannels(channels) { | ||
if (channels instanceof Channel) { | ||
channels = [channels]; | ||
} | ||
else if (isString(channels)) { | ||
channels = [new Channel(channels)]; | ||
} | ||
return channels; | ||
function parseChannels(inChannels) { | ||
var channels = !Array.isArray(inChannels) ? [inChannels] : inChannels; | ||
return channels.map(function (channel) { return isString(channel) ? new Channel(channel) : channel; }); | ||
} | ||
@@ -807,3 +798,2 @@ // An internal Get an array of hashes representing the specified channels parameter. The | ||
var jspack$1 = jspack.jspack; | ||
var WebSocketContext = /** @class */ (function () { | ||
@@ -872,3 +862,3 @@ function WebSocketContext(id, meta, inEvents, prefix) { | ||
if (Array.isArray(content) && content.length === 2) { | ||
this.closeCode = jspack$1.Unpack('>H', __spreadArrays(content))[0]; | ||
this.closeCode = jspack_1.Unpack('>H', __spreadArrays(content))[0]; | ||
} | ||
@@ -875,0 +865,0 @@ return null; |
@@ -519,6 +519,2 @@ 'use strict'; | ||
var jspack = { | ||
jspack: jspack_1 | ||
}; | ||
// The WebSocketEvent class represents WebSocket event information that is | ||
@@ -778,10 +774,5 @@ // used with the GRIP WebSocket-over-HTTP protocol. It includes information | ||
// be a string, a Channel instance, or an array of Channel instances. | ||
function parseChannels(channels) { | ||
if (channels instanceof Channel) { | ||
channels = [channels]; | ||
} | ||
else if (isString(channels)) { | ||
channels = [new Channel(channels)]; | ||
} | ||
return channels; | ||
function parseChannels(inChannels) { | ||
var channels = !Array.isArray(inChannels) ? [inChannels] : inChannels; | ||
return channels.map(function (channel) { return isString(channel) ? new Channel(channel) : channel; }); | ||
} | ||
@@ -813,3 +804,2 @@ // An internal Get an array of hashes representing the specified channels parameter. The | ||
var jspack$1 = jspack.jspack; | ||
var WebSocketContext = /** @class */ (function () { | ||
@@ -878,3 +868,3 @@ function WebSocketContext(id, meta, inEvents, prefix) { | ||
if (Array.isArray(content) && content.length === 2) { | ||
this.closeCode = jspack$1.Unpack('>H', __spreadArrays(content))[0]; | ||
this.closeCode = jspack_1.Unpack('>H', __spreadArrays(content))[0]; | ||
} | ||
@@ -881,0 +871,0 @@ return null; |
@@ -1,2 +0,6 @@ | ||
declare const main: {}; | ||
export default main; | ||
/// <reference types="node" /> | ||
import * as main from './main'; | ||
declare const _default: typeof main & { | ||
Buffer: typeof globalThis.Buffer; | ||
}; | ||
export default _default; |
{ | ||
"name": "@fanoutio/grip", | ||
"version": "2.0.0-rc.1", | ||
"version": "2.0.0-rc.2", | ||
"author": "Fanout, Inc. <info@fanout.io>", | ||
@@ -24,3 +24,3 @@ "description": "GRIP Interface Library", | ||
"build-commonjs": "npm run build-commonjs:clean && npm run build-commonjs:build", | ||
"build-commonjs:clean": "rimraf commonjs", | ||
"build-commonjs:clean": "rimraf build", | ||
"build-commonjs:build": "rollup -c rollup.commonjs.config.js", | ||
@@ -56,6 +56,6 @@ "build-browser": "npm run build-browser:clean && npm run build-browser:build", | ||
"@rollup/plugin-json": "^4.0.2", | ||
"@rollup/plugin-node-resolve": "^7.1.1", | ||
"@rollup/plugin-replace": "^2.3.1", | ||
"@rollup/plugin-typescript": "^3.0.0", | ||
"@types/mocha": "^7.0.2", | ||
"builtin-modules": "^3.1.0", | ||
"eslint": "^6.8.0", | ||
@@ -67,3 +67,2 @@ "mocha": "^7.1.1", | ||
"rollup-plugin-node-globals": "^1.4.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.2", | ||
@@ -70,0 +69,0 @@ "rollup-plugin-typescript2": "^0.26.0", |
import nodeGlobals from 'rollup-plugin-node-globals'; | ||
import nodeBuiltins from 'rollup-plugin-node-builtins'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import nodeResolve from 'rollup-plugin-node-resolve'; | ||
import nodeResolve from '@rollup/plugin-node-resolve'; | ||
import json from '@rollup/plugin-json'; | ||
@@ -38,4 +38,7 @@ import replace from '@rollup/plugin-replace'; | ||
json(), | ||
typescript({lib: ["es5", "dom", "es6"], target: "es5"}), | ||
typescript({ | ||
declaration: false, | ||
esModuleInterop: false, | ||
}), | ||
], | ||
}; |
import { Buffer } from 'buffer'; | ||
import jspackModule from "jspack"; | ||
const { jspack } = jspackModule; | ||
import { jspack } from "jspack"; | ||
/// <reference path="../../types/jspack.d.ts" /> | ||
@@ -6,0 +5,0 @@ |
export default interface IGripConfig { | ||
control_uri: string; | ||
control_iss: string; | ||
key: string; | ||
control_iss?: string; | ||
key?: string; | ||
} |
@@ -14,3 +14,3 @@ import { Buffer } from 'buffer'; | ||
type Channels = string | Channel | Channel[]; | ||
type Channels = Channel | Channel[] | string | string[]; | ||
@@ -227,9 +227,5 @@ // This file provides utilities that can be used in conjunction | ||
// be a string, a Channel instance, or an array of Channel instances. | ||
export function parseChannels(channels: Channels) { | ||
if (channels instanceof Channel) { | ||
channels = [channels]; | ||
} else if (isString(channels)) { | ||
channels = [new Channel(channels)]; | ||
} | ||
return channels; | ||
export function parseChannels(inChannels: Channels): Channel[] { | ||
let channels = !Array.isArray(inChannels) ? [inChannels] : inChannels; | ||
return channels.map(channel => isString(channel) ? new Channel(channel) : channel); | ||
} | ||
@@ -236,0 +232,0 @@ |
import { Buffer } from 'buffer'; | ||
import * as mainProps from './main'; | ||
const main = {}; | ||
export default main; | ||
import * as main from './main'; | ||
Object.assign(main, mainProps, { Buffer }); | ||
export default Object.assign(main, { Buffer }); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17
1462527
29735