Comparing version 10.0.0-beta.23 to 10.0.0-beta.24
@@ -9,4 +9,4 @@ import { RestHelper } from "./rest-helper"; | ||
getById(id: string, errorHandler?: (apiResponse: RestResponseError<News>) => void): Promise<News>; | ||
getCategoryCodes(source: string): Promise<CategoryCode[]>; | ||
getSources(): Promise<SourceDetails[]>; | ||
static getCategoryCodes(source: string, endpoint?: EndpointDescription): Promise<CategoryCode[]>; | ||
static getSources(endpoint?: EndpointDescription): Promise<SourceDetails[]>; | ||
} |
@@ -34,5 +34,6 @@ "use strict"; | ||
} | ||
getCategoryCodes(source) { | ||
static getCategoryCodes(source, endpoint = enums_1.Endpoint.PRODUCTION) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield this.restHelper.get('/category-codes', { | ||
return (yield new rest_helper_1.RestHelper(endpoint) | ||
.get('/category-codes', { | ||
source | ||
@@ -42,5 +43,5 @@ })).data; | ||
} | ||
getSources() { | ||
static getSources(endpoint = enums_1.Endpoint.PRODUCTION) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield (this.restHelper.get('/sources'))).data; | ||
return (yield (new rest_helper_1.RestHelper(endpoint).get('/sources'))).data; | ||
}); | ||
@@ -47,0 +48,0 @@ } |
{ | ||
"name": "newsware", | ||
"version": "10.0.0-beta.23", | ||
"version": "10.0.0-beta.24", | ||
"description": "Typescript client for interacting with the Newsware API", | ||
@@ -5,0 +5,0 @@ "main": "lib/src/index.js", |
@@ -37,11 +37,16 @@ import { Endpoint } from "./enums" | ||
async getCategoryCodes(source: string): Promise<CategoryCode[]> { | ||
return (await this.restHelper.get<CategoryCode[]>('/category-codes', { | ||
source | ||
})).data; | ||
static async getCategoryCodes(source: string, endpoint: EndpointDescription = Endpoint.PRODUCTION): Promise<CategoryCode[]> { | ||
return ( | ||
await new RestHelper(endpoint) | ||
.get<CategoryCode[]>('/category-codes', { | ||
source | ||
}) | ||
).data; | ||
} | ||
async getSources(): Promise<SourceDetails[]> { | ||
return (await (this.restHelper.get<SourceDetails[]>('/sources'))).data; | ||
static async getSources(endpoint: EndpointDescription = Endpoint.PRODUCTION): Promise<SourceDetails[]> { | ||
return ( | ||
await (new RestHelper(endpoint).get<SourceDetails[]>('/sources')) | ||
).data; | ||
} | ||
} |
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
102549
2002