@openstax/highlights-client
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -20,2 +20,5 @@ /** | ||
} | ||
export interface GetHighlightRequest { | ||
id: string; | ||
} | ||
export interface GetHighlightsRequest { | ||
@@ -41,3 +44,3 @@ sourceType?: GetHighlightsSourceTypeEnum; | ||
/** | ||
* no description | ||
* | ||
*/ | ||
@@ -66,2 +69,12 @@ export declare class HighlightsApi extends runtime.BaseAPI { | ||
/** | ||
* Get a highlight without its annotation data. | ||
* Get a highlight without its annotation data. | ||
*/ | ||
getHighlightRaw(requestParameters: GetHighlightRequest): Promise<runtime.ApiResponse<Highlight>>; | ||
/** | ||
* Get a highlight without its annotation data. | ||
* Get a highlight without its annotation data. | ||
*/ | ||
getHighlight(requestParameters: GetHighlightRequest): Promise<Highlight>; | ||
/** | ||
* Get filtered highlights belonging to the calling user. Highlights can be filtered thru query parameters: source_type, scope_id, source_ids, and color. Results are paginated and ordered. When source_ids are specified, the order is order within the sources. When source_ids are not specified, the order is by creation time. Example call: /api/v0/highlights?source_type=openstax_page&scope_id=123&color=yellow | ||
@@ -68,0 +81,0 @@ * Get filtered highlights |
@@ -67,3 +67,3 @@ "use strict"; | ||
/** | ||
* no description | ||
* | ||
*/ | ||
@@ -168,2 +168,48 @@ var HighlightsApi = /** @class */ (function (_super) { | ||
/** | ||
* Get a highlight without its annotation data. | ||
* Get a highlight without its annotation data. | ||
*/ | ||
HighlightsApi.prototype.getHighlightRaw = function (requestParameters) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var queryParameters, headerParameters, response; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (requestParameters.id === null || requestParameters.id === undefined) { | ||
throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getHighlight.'); | ||
} | ||
queryParameters = {}; | ||
headerParameters = {}; | ||
return [4 /*yield*/, this.request({ | ||
path: "/highlights/{id}".replace("{" + "id" + "}", encodeURIComponent(String(requestParameters.id))), | ||
method: 'GET', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
})]; | ||
case 1: | ||
response = _a.sent(); | ||
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return models_1.HighlightFromJSON(jsonValue); })]; | ||
} | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Get a highlight without its annotation data. | ||
* Get a highlight without its annotation data. | ||
*/ | ||
HighlightsApi.prototype.getHighlight = function (requestParameters) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var response; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getHighlightRaw(requestParameters)]; | ||
case 1: | ||
response = _a.sent(); | ||
return [4 /*yield*/, response.value()]; | ||
case 2: return [2 /*return*/, _a.sent()]; | ||
} | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Get filtered highlights belonging to the calling user. Highlights can be filtered thru query parameters: source_type, scope_id, source_ids, and color. Results are paginated and ordered. When source_ids are specified, the order is order within the sources. When source_ids are not specified, the order is by creation time. Example call: /api/v0/highlights?source_type=openstax_page&scope_id=123&color=yellow | ||
@@ -170,0 +216,0 @@ * Get filtered highlights |
@@ -15,3 +15,3 @@ /** | ||
/** | ||
* no description | ||
* | ||
*/ | ||
@@ -18,0 +18,0 @@ export declare class InfoApi extends runtime.BaseAPI { |
@@ -67,3 +67,3 @@ "use strict"; | ||
/** | ||
* no description | ||
* | ||
*/ | ||
@@ -70,0 +70,0 @@ var InfoApi = /** @class */ (function (_super) { |
@@ -31,3 +31,3 @@ /** | ||
/** | ||
* One or more sets to load data from; default is \"user:me\" | ||
* One or more sets to load data from; default is "user:me" | ||
* @type {Array<string>} | ||
@@ -34,0 +34,0 @@ * @memberof GetHighlightsParameters |
@@ -31,3 +31,3 @@ /** | ||
/** | ||
* One or more sets to load data from; default is \"user:me\" | ||
* One or more sets to load data from; default is "user:me" | ||
* @type {Array<string>} | ||
@@ -34,0 +34,0 @@ * @memberof GetHighlightsSummaryParameters |
@@ -31,3 +31,3 @@ /** | ||
/** | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the \'openstax_page\' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the 'openstax_page' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* @type {string} | ||
@@ -38,3 +38,3 @@ * @memberof Highlight | ||
/** | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the \'openstax_page\' source_type). | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the 'openstax_page' source_type). | ||
* @type {string} | ||
@@ -87,3 +87,3 @@ * @memberof Highlight | ||
/** | ||
* A number whose relative value gives the highlight\'s order within the source. Its value has no meaning on its own. | ||
* A number whose relative value gives the highlight's order within the source. Its value has no meaning on its own. | ||
* @type {number} | ||
@@ -90,0 +90,0 @@ * @memberof Highlight |
@@ -31,3 +31,3 @@ /** | ||
/** | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the \'openstax_page\' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the 'openstax_page' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* @type {string} | ||
@@ -38,3 +38,3 @@ * @memberof NewHighlight | ||
/** | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the \'openstax_page\' source_type). | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the 'openstax_page' source_type). | ||
* @type {string} | ||
@@ -41,0 +41,0 @@ * @memberof NewHighlight |
@@ -71,3 +71,3 @@ /** | ||
export declare type Json = any; | ||
export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; | ||
export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; | ||
export declare type HTTPHeaders = { | ||
@@ -74,0 +74,0 @@ [key: string]: string; |
@@ -183,3 +183,3 @@ "use strict"; | ||
} | ||
var body = (context.body instanceof FormData || context.body instanceof URLSearchParams || isBlob(context.body)) | ||
var body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body)) | ||
? context.body | ||
@@ -234,3 +234,3 @@ : JSON.stringify(context.body); | ||
get: function () { | ||
return this.configuration.basePath || exports.BASE_PATH; | ||
return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH; | ||
}, | ||
@@ -237,0 +237,0 @@ enumerable: true, |
{ | ||
"name": "@openstax/highlights-client", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "OpenAPI client for @openstax/highlights-client", | ||
@@ -5,0 +5,0 @@ "author": "OpenAPI-Generator", |
@@ -43,2 +43,6 @@ /* tslint:disable */ | ||
export interface GetHighlightRequest { | ||
id: string; | ||
} | ||
export interface GetHighlightsRequest { | ||
@@ -67,3 +71,3 @@ sourceType?: GetHighlightsSourceTypeEnum; | ||
/** | ||
* no description | ||
* | ||
*/ | ||
@@ -81,3 +85,3 @@ export class HighlightsApi extends runtime.BaseAPI { | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
const queryParameters: any = {}; | ||
@@ -117,3 +121,3 @@ const headerParameters: runtime.HTTPHeaders = {}; | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
const queryParameters: any = {}; | ||
@@ -141,2 +145,34 @@ const headerParameters: runtime.HTTPHeaders = {}; | ||
/** | ||
* Get a highlight without its annotation data. | ||
* Get a highlight without its annotation data. | ||
*/ | ||
async getHighlightRaw(requestParameters: GetHighlightRequest): Promise<runtime.ApiResponse<Highlight>> { | ||
if (requestParameters.id === null || requestParameters.id === undefined) { | ||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getHighlight.'); | ||
} | ||
const queryParameters: any = {}; | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
const response = await this.request({ | ||
path: `/highlights/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), | ||
method: 'GET', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
}); | ||
return new runtime.JSONApiResponse(response, (jsonValue) => HighlightFromJSON(jsonValue)); | ||
} | ||
/** | ||
* Get a highlight without its annotation data. | ||
* Get a highlight without its annotation data. | ||
*/ | ||
async getHighlight(requestParameters: GetHighlightRequest): Promise<Highlight> { | ||
const response = await this.getHighlightRaw(requestParameters); | ||
return await response.value(); | ||
} | ||
/** | ||
* Get filtered highlights belonging to the calling user. Highlights can be filtered thru query parameters: source_type, scope_id, source_ids, and color. Results are paginated and ordered. When source_ids are specified, the order is order within the sources. When source_ids are not specified, the order is by creation time. Example call: /api/v0/highlights?source_type=openstax_page&scope_id=123&color=yellow | ||
@@ -146,3 +182,3 @@ * Get filtered highlights | ||
async getHighlightsRaw(requestParameters: GetHighlightsRequest): Promise<runtime.ApiResponse<Highlights>> { | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
const queryParameters: any = {}; | ||
@@ -203,3 +239,3 @@ if (requestParameters.sourceType !== undefined) { | ||
async getHighlightsSummaryRaw(requestParameters: GetHighlightsSummaryRequest): Promise<runtime.ApiResponse<HighlightsSummary>> { | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
const queryParameters: any = {}; | ||
@@ -256,3 +292,3 @@ if (requestParameters.sourceType !== undefined) { | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
const queryParameters: any = {}; | ||
@@ -259,0 +295,0 @@ const headerParameters: runtime.HTTPHeaders = {}; |
@@ -24,3 +24,3 @@ /* tslint:disable */ | ||
/** | ||
* no description | ||
* | ||
*/ | ||
@@ -34,3 +34,3 @@ export class InfoApi extends runtime.BaseAPI { | ||
async infoRaw(): Promise<runtime.ApiResponse<InfoResults>> { | ||
const queryParameters: runtime.HTTPQuery = {}; | ||
const queryParameters: any = {}; | ||
@@ -37,0 +37,0 @@ const headerParameters: runtime.HTTPHeaders = {}; |
@@ -35,3 +35,3 @@ /* tslint:disable */ | ||
/** | ||
* One or more sets to load data from; default is \"user:me\" | ||
* One or more sets to load data from; default is "user:me" | ||
* @type {Array<string>} | ||
@@ -38,0 +38,0 @@ * @memberof GetHighlightsParameters |
@@ -35,3 +35,3 @@ /* tslint:disable */ | ||
/** | ||
* One or more sets to load data from; default is \"user:me\" | ||
* One or more sets to load data from; default is "user:me" | ||
* @type {Array<string>} | ||
@@ -38,0 +38,0 @@ * @memberof GetHighlightsSummaryParameters |
@@ -35,3 +35,3 @@ /* tslint:disable */ | ||
/** | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the \'openstax_page\' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the 'openstax_page' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* @type {string} | ||
@@ -42,3 +42,3 @@ * @memberof Highlight | ||
/** | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the \'openstax_page\' source_type). | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the 'openstax_page' source_type). | ||
* @type {string} | ||
@@ -91,3 +91,3 @@ * @memberof Highlight | ||
/** | ||
* A number whose relative value gives the highlight\'s order within the source. Its value has no meaning on its own. | ||
* A number whose relative value gives the highlight's order within the source. Its value has no meaning on its own. | ||
* @type {number} | ||
@@ -94,0 +94,0 @@ * @memberof Highlight |
@@ -35,3 +35,3 @@ /* tslint:disable */ | ||
/** | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the \'openstax_page\' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* The ID of the source document in which the highlight is made. Has source_type-specific constraints (e.g. all lowercase UUID for the 'openstax_page' source_type). Because source_ids are passed to query endpoints as comma-separated values, they cannot contain commas. | ||
* @type {string} | ||
@@ -42,3 +42,3 @@ * @memberof NewHighlight | ||
/** | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the \'openstax_page\' source_type). | ||
* The ID of the container for the source in which the highlight is made. Varies depending on source_type (e.g. is the lowercase, versionless book UUID for the 'openstax_page' source_type). | ||
* @type {string} | ||
@@ -45,0 +45,0 @@ * @memberof NewHighlight |
@@ -64,3 +64,3 @@ /* tslint:disable */ | ||
} | ||
const body = (context.body instanceof FormData || context.body instanceof URLSearchParams || isBlob(context.body)) | ||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body)) | ||
? context.body | ||
@@ -148,3 +148,3 @@ : JSON.stringify(context.body); | ||
get basePath(): string { | ||
return this.configuration.basePath || BASE_PATH; | ||
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; | ||
} | ||
@@ -198,3 +198,3 @@ | ||
export type Json = any; | ||
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; | ||
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; | ||
export type HTTPHeaders = { [key: string]: string }; | ||
@@ -201,0 +201,0 @@ export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | HTTPQuery }; |
Sorry, the diff of this file is not supported yet
196434
68
5085