Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

newsware

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newsware - npm Package Compare versions

Comparing version 10.0.0-beta.14 to 10.0.0-beta.15

4

lib/src/api.d.ts

@@ -1,2 +0,2 @@

import { EndpointDescription, HistoricalFilter, News, RestResponse, RestResponseError, RestResponseSuccess } from "./types";
import { CategoryCode, EndpointDescription, HistoricalFilter, News, RestResponse, RestResponseError, RestResponseSuccess, Source } from "./types";
export declare class Api {

@@ -9,2 +9,4 @@ private apikey;

getById(id: string, errorHandler?: (apiResponse: RestResponseError<News>) => void): Promise<News>;
getCategoryCodes(source: string): Promise<CategoryCode[]>;
getSources(): Promise<Source[]>;
get<T>(path: string, params?: any, errorHandler?: (apiResponse: RestResponseError<T>) => void): Promise<RestResponse<T>>;

@@ -11,0 +13,0 @@ post<T, Z>(path: string, body: T, errorHandler?: (apiResponse: RestResponseError<Z>) => void): Promise<RestResponseSuccess<Z>>;

@@ -36,2 +36,14 @@ "use strict";

}
getCategoryCodes(source) {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.get('/category-codes', {
source
})).data;
});
}
getSources() {
return __awaiter(this, void 0, void 0, function* () {
return (yield (this.get('/sources'))).data;
});
}
get(path, params, errorHandler = this.handleError) {

@@ -38,0 +50,0 @@ var _a, _b;

@@ -133,1 +133,9 @@ /// <reference types="ws" />

};
export interface CategoryCode {
code: string;
source: string;
description: string;
}
export interface Source {
code: string;
}
{
"name": "newsware",
"version": "10.0.0-beta.14",
"version": "10.0.0-beta.15",
"description": "Typescript client for interacting with the Newsware API",

@@ -5,0 +5,0 @@ "main": "lib/src/index.js",

import {
CategoryCode,
EndpointDescription,

@@ -7,3 +8,4 @@ HistoricalFilter,

RestResponseError,
RestResponseSuccess
RestResponseSuccess,
Source
} from "./types"

@@ -35,2 +37,12 @@ import { Endpoint } from "./enums"

async getCategoryCodes(source: string): Promise<CategoryCode[]> {
return (await this.get<CategoryCode[]>('/category-codes', {
source
})).data;
}
async getSources(): Promise<Source[]> {
return (await (this.get<Source[]>('/sources'))).data;
}
async get<T>(

@@ -37,0 +49,0 @@ path: string,

@@ -149,2 +149,12 @@ import { CloseEvent } from "isomorphic-ws"

reconnectDelay?: number // In milliseconds
}
export interface CategoryCode {
code: string
source: string
description: string
}
export interface Source {
code: string
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc