Comparing version 0.1.1 to 0.1.2
@@ -1,2 +0,3 @@ | ||
import { Or, And, Text } from "./queries"; | ||
export { Or, And, Text }; | ||
export { Or, And, Text } from "./queries"; | ||
export { Api } from "./api"; | ||
export { News, Filter, TextQuery, ApiHost } from "./types"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Text = exports.And = exports.Or = void 0; | ||
const queries_1 = require("./queries"); | ||
exports.ApiHost = exports.Api = exports.Text = exports.And = exports.Or = void 0; | ||
var queries_1 = require("./queries"); | ||
Object.defineProperty(exports, "Or", { enumerable: true, get: function () { return queries_1.Or; } }); | ||
Object.defineProperty(exports, "And", { enumerable: true, get: function () { return queries_1.And; } }); | ||
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return queries_1.Text; } }); | ||
var api_1 = require("./api"); | ||
Object.defineProperty(exports, "Api", { enumerable: true, get: function () { return api_1.Api; } }); | ||
var types_1 = require("./types"); | ||
Object.defineProperty(exports, "ApiHost", { enumerable: true, get: function () { return types_1.ApiHost; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -1,18 +0,2 @@ | ||
export interface TextQuery { | ||
searchBody: boolean; | ||
searchHeadline: boolean; | ||
isRegex: boolean; | ||
text: string; | ||
ignore: boolean; | ||
} | ||
type QueryDto = { | ||
type: QueryType.And | QueryType.Or; | ||
value: QueryDto[]; | ||
} | { | ||
type: QueryType.Text; | ||
value: TextQuery; | ||
}; | ||
interface Query { | ||
toJSON(): QueryDto; | ||
} | ||
import { Query, QueryDto, TextQuery } from "./types"; | ||
export declare class And implements Query { | ||
@@ -33,2 +17,1 @@ private value; | ||
} | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Text = exports.Or = exports.And = void 0; | ||
const types_1 = require("./types"); | ||
class And { | ||
@@ -10,3 +11,3 @@ constructor(value) { | ||
return { | ||
type: QueryType.And, | ||
type: types_1.QueryType.And, | ||
value: this.value.map(v => v.toJSON()) | ||
@@ -23,3 +24,3 @@ }; | ||
return { | ||
type: QueryType.Or, | ||
type: types_1.QueryType.Or, | ||
value: this.value.map(v => v.toJSON()) | ||
@@ -36,3 +37,3 @@ }; | ||
return { | ||
type: QueryType.Text, | ||
type: types_1.QueryType.Text, | ||
value: this.value | ||
@@ -39,0 +40,0 @@ }; |
{ | ||
"name": "newsware", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Typescript client for interacting with the Newsware API", | ||
@@ -13,3 +13,4 @@ "main": "lib/index.js", | ||
"build": "tsc -p tsconfig.build.json", | ||
"bundle": "browserify lib/index.js -o lib/bundle.js" | ||
"bundle": "browserify lib/index.js -o lib/bundle.js", | ||
"publish": "npm run build && npm publish" | ||
}, | ||
@@ -16,0 +17,0 @@ "repository": { |
@@ -1,7 +0,3 @@ | ||
import {Or, And, Text} from "./queries"; | ||
export { | ||
Or, | ||
And, | ||
Text | ||
} | ||
export {Or, And, Text} from "./queries"; | ||
export {Api} from "./api" | ||
export {News, Filter, TextQuery, ApiHost} from "./types" |
@@ -1,19 +0,7 @@ | ||
export interface TextQuery { | ||
searchBody: boolean | ||
searchHeadline: boolean | ||
isRegex: boolean, | ||
text: string, | ||
ignore: boolean | ||
} | ||
import {Query, QueryDto, QueryType, TextQuery} from "./types"; | ||
type QueryDto = | ||
{ type: QueryType.And | QueryType.Or, value: QueryDto[] } | | ||
{ type: QueryType.Text, value: TextQuery }; | ||
interface Query { | ||
toJSON(): QueryDto | ||
} | ||
export class And implements Query { | ||
constructor(private value: Query[]) { | ||
constructor( | ||
private value: Query[] | ||
) { | ||
} | ||
@@ -42,3 +30,5 @@ | ||
export class Text implements Query { | ||
constructor(private value: TextQuery) { | ||
constructor( | ||
private value: TextQuery | ||
) { | ||
} | ||
@@ -45,0 +35,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12045
21
285