Comparing version 6.0.0 to 6.0.1
@@ -103,11 +103,11 @@ "use strict"; | ||
let actualNews = yield api.search({ | ||
filter: (0, filters_1.text)("one", { onlyBody: true }) | ||
filter: (0, filters_1.text)(["one"], { onlyBody: true }) | ||
}); | ||
(0, chai_1.expect)(actualNews.length).to.eq(1); | ||
actualNews = yield api.search({ | ||
filter: (0, filters_1.text)("1", { onlyBody: true }) | ||
filter: (0, filters_1.text)(["1"], { onlyBody: true }) | ||
}); | ||
(0, chai_1.expect)(actualNews.length).to.eq(0); | ||
actualNews = yield api.search({ | ||
filter: (0, filters_1.text)("1 two", { onlyBody: true }) | ||
filter: (0, filters_1.text)(["1 two"], { onlyBody: true }) | ||
}); | ||
@@ -119,11 +119,11 @@ (0, chai_1.expect)(actualNews.length).to.eq(0); | ||
let actualNews = yield api.search({ | ||
filter: (0, filters_1.text)("one", { onlyHeadline: true }) | ||
filter: (0, filters_1.text)(["one"], { onlyHeadline: true }) | ||
}); | ||
(0, chai_1.expect)(actualNews.length).to.eq(0); | ||
actualNews = yield api.search({ | ||
filter: (0, filters_1.text)("one 2", { onlyHeadline: true }) | ||
filter: (0, filters_1.text)(["one 2"], { onlyHeadline: true }) | ||
}); | ||
(0, chai_1.expect)(actualNews.length).to.eq(0); | ||
actualNews = yield api.search({ | ||
filter: (0, filters_1.text)("1", { onlyHeadline: true }) | ||
filter: (0, filters_1.text)(["1"], { onlyHeadline: true }) | ||
}); | ||
@@ -203,7 +203,7 @@ (0, chai_1.expect)(actualNews.length).to.eq(1); | ||
let actualNews = yield api.search({ | ||
filter: (0, filters_1.and)((0, filters_1.text)("1"), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [1])) | ||
filter: (0, filters_1.and)((0, filters_1.text)(["1"]), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [1])) | ||
}); | ||
(0, chai_1.expect)(actualNews.length).to.eq(1); | ||
actualNews = yield api.search({ | ||
filter: (0, filters_1.and)((0, filters_1.text)("2"), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [1])) | ||
filter: (0, filters_1.and)((0, filters_1.text)(["2"]), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [1])) | ||
}); | ||
@@ -215,7 +215,7 @@ (0, chai_1.expect)(actualNews.length).to.eq(0); | ||
let actualNews = yield api.search({ | ||
filter: (0, filters_1.or)((0, filters_1.text)("1"), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [2])) | ||
filter: (0, filters_1.or)((0, filters_1.text)(["1"]), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [2])) | ||
}); | ||
(0, chai_1.expect)(actualNews.length).to.eq(2); | ||
actualNews = yield api.search({ | ||
filter: (0, filters_1.or)((0, filters_1.text)("2"), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [1]), (0, filters_1.tickers)(enums_1.FilterArrayAction.ANY, ["ticker3"])) | ||
filter: (0, filters_1.or)((0, filters_1.text)(["2"]), (0, filters_1.ciks)(enums_1.FilterArrayAction.ANY, [1]), (0, filters_1.tickers)(enums_1.FilterArrayAction.ANY, ["ticker3"])) | ||
}); | ||
@@ -222,0 +222,0 @@ (0, chai_1.expect)(actualNews.length).to.eq(3); |
@@ -5,3 +5,3 @@ import { Filter, FilterArray, TextOptions } from "./types"; | ||
export declare const or: (...queries: Filter[]) => Filter; | ||
export declare const text: (value: string, options?: TextOptions) => Filter; | ||
export declare const text: (value: string[], options?: TextOptions) => Filter; | ||
export declare const tickers: (action: FilterArrayAction, value: string[]) => FilterArray; | ||
@@ -8,0 +8,0 @@ export declare const ciks: (action: FilterArrayAction, value: number[]) => FilterArray; |
@@ -25,3 +25,3 @@ /// <reference types="ws" /> | ||
type: FilterType.TEXT; | ||
value: string; | ||
value: string[]; | ||
} | ||
@@ -28,0 +28,0 @@ export interface FilterCondition { |
{ | ||
"name": "newsware", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "Typescript client for interacting with the Newsware API", | ||
@@ -5,0 +5,0 @@ "main": "lib/src/index.js", |
@@ -111,3 +111,3 @@ import {Api} from "./api"; | ||
let actualNews = await api.search({ | ||
filter: text("one", {onlyBody: true}) | ||
filter: text(["one"], {onlyBody: true}) | ||
}) | ||
@@ -117,3 +117,3 @@ expect(actualNews.length).to.eq(1) | ||
actualNews = await api.search({ | ||
filter: text("1", {onlyBody: true}) | ||
filter: text(["1"], {onlyBody: true}) | ||
}) | ||
@@ -123,3 +123,3 @@ expect(actualNews.length).to.eq(0) | ||
actualNews = await api.search({ | ||
filter: text("1 two", {onlyBody: true}) | ||
filter: text(["1 two"], {onlyBody: true}) | ||
}) | ||
@@ -133,3 +133,3 @@ expect(actualNews.length).to.eq(0) | ||
let actualNews = await api.search({ | ||
filter: text("one", {onlyHeadline: true}) | ||
filter: text(["one"], {onlyHeadline: true}) | ||
}) | ||
@@ -139,3 +139,3 @@ expect(actualNews.length).to.eq(0) | ||
actualNews = await api.search({ | ||
filter: text("one 2", {onlyHeadline: true}) | ||
filter: text(["one 2"], {onlyHeadline: true}) | ||
}) | ||
@@ -145,3 +145,3 @@ expect(actualNews.length).to.eq(0) | ||
actualNews = await api.search({ | ||
filter: text("1", {onlyHeadline: true}) | ||
filter: text(["1"], {onlyHeadline: true}) | ||
}) | ||
@@ -242,3 +242,3 @@ expect(actualNews.length).to.eq(1) | ||
filter: and( | ||
text("1"), | ||
text(["1"]), | ||
ciks(FilterArrayAction.ANY, [1]) | ||
@@ -251,3 +251,3 @@ ) | ||
filter: and( | ||
text("2"), | ||
text(["2"]), | ||
ciks(FilterArrayAction.ANY, [1]) | ||
@@ -264,3 +264,3 @@ ) | ||
filter: or( | ||
text("1"), | ||
text(["1"]), | ||
ciks(FilterArrayAction.ANY, [2]) | ||
@@ -273,3 +273,3 @@ ) | ||
filter: or( | ||
text("2"), | ||
text(["2"]), | ||
ciks(FilterArrayAction.ANY, [1]), | ||
@@ -276,0 +276,0 @@ tickers(FilterArrayAction.ANY, ["ticker3"]) |
@@ -18,3 +18,3 @@ import {Filter, FilterArray, TextOptions} from "./types"; | ||
export const text = (value: string, options?: TextOptions): Filter => { | ||
export const text = (value: string[], options?: TextOptions): Filter => { | ||
return { | ||
@@ -21,0 +21,0 @@ type: FilterType.TEXT, |
@@ -28,3 +28,3 @@ import {CloseEvent} from "isomorphic-ws" | ||
type: FilterType.TEXT | ||
value: string | ||
value: string[] | ||
} | ||
@@ -31,0 +31,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80662