ozone-typescript-client
Advanced tools
Comparing version 6.0.4 to 6.0.5
import { FromOzone, Item, Query, SearchRequest, UUID, Patch, AggregationItem } from 'ozone-type'; | ||
export interface SearchResults<T extends Item> { | ||
interface ISearchResulsts<T> { | ||
id?: number; | ||
@@ -7,4 +7,7 @@ total?: number; | ||
results?: T[]; | ||
} | ||
export interface SearchResults<T extends Item> extends ISearchResulsts<T> { | ||
aggregations?: Array<AggregationItem>; | ||
} | ||
export declare type SearchIdsResults = ISearchResulsts<UUID>; | ||
export interface ItemClient<T extends Item> { | ||
@@ -19,2 +22,3 @@ save(item: Patch<T>): Promise<FromOzone<T>>; | ||
search(searchRequest: SearchRequest): Promise<SearchResults<FromOzone<T>>>; | ||
searchIds(searchRequest: SearchRequest): Promise<SearchIdsResults>; | ||
count(query?: Query): Promise<number>; | ||
@@ -24,3 +28,3 @@ deleteById(id: UUID, permanent?: boolean): Promise<UUID | null>; | ||
searchGenerator(searchRequest: SearchRequest): SearchIterator<T>; | ||
queryDelete(searchQuery: Query): Promise<UUID[]>; | ||
queryDelete(searchQuery: Query, permanent?: boolean): Promise<UUID[]>; | ||
} | ||
@@ -34,1 +38,2 @@ export interface SearchIterator<T> extends AsyncIterableIterator<SearchResults<FromOzone<T>>> { | ||
} | ||
export {}; |
import { FromOzone, Item, Query, SearchRequest, UUID, Patch } from 'ozone-type'; | ||
import { ItemClient, SearchResults, SearchIterator } from './itemClient'; | ||
import { ItemClient, SearchResults, SearchIterator, SearchIdsResults } from './itemClient'; | ||
import { OzoneClient } from '../ozoneClient/ozoneClient'; | ||
@@ -18,6 +18,7 @@ export declare class ItemClientImpl<T extends Item> implements ItemClient<T> { | ||
search(searchRequest: SearchRequest): Promise<SearchResults<FromOzone<T>>>; | ||
searchIds(searchRequest: SearchRequest): Promise<SearchIdsResults>; | ||
searchGenerator(searchRequest: SearchRequest): SearchIterator<T>; | ||
broadcast(item: T): Promise<FromOzone<T>>; | ||
bulkBroadcast(items: T[]): Promise<FromOzone<T>[]>; | ||
queryDelete(searchQuery: Query): Promise<UUID[]>; | ||
queryDelete(searchQuery: Query, permanent?: boolean): Promise<UUID[]>; | ||
} |
@@ -89,2 +89,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
searchIds(searchRequest) { | ||
const request = new Request(`${this.baseUrl}/rest/v3/items/${this.typeIdentifier}/searchIds`) | ||
.setMethod('POST') | ||
.setBody(searchRequest); | ||
return this.client.call(request); | ||
} | ||
searchGenerator(searchRequest) { | ||
@@ -117,5 +123,6 @@ return new SearchIteratorImpl(this.client, this.baseUrl, this.typeIdentifier, searchRequest); | ||
} | ||
queryDelete(searchQuery) { | ||
queryDelete(searchQuery, permanent = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const request = new Request(`${this.baseUrl}/rest/v3/items/${this.typeIdentifier}/queryDelete`) | ||
const url = `${this.baseUrl}/rest/v3/items/${this.typeIdentifier}/queryDelete${permanent ? '?permanent=true' : ''}`; | ||
const request = new Request(url) | ||
.setMethod('POST') | ||
@@ -137,2 +144,3 @@ .setBody(searchQuery); | ||
_search(searchRequest) { | ||
var _a; | ||
try { | ||
@@ -145,3 +153,3 @@ this.currentRequest = new Request(`${this.baseUrl}/rest/v3/items/${this.typeIdentifier}/search`) | ||
catch (err) { | ||
if (err.request && err.request.isAborted) { | ||
if ((_a = err.request) === null || _a === void 0 ? void 0 : _a.isAborted) { | ||
throw Error('search aborted'); | ||
@@ -155,2 +163,3 @@ } | ||
next(forceOffset) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -168,3 +177,3 @@ try { | ||
catch (err) { | ||
if (!(err.request && err.request.isAborted)) { | ||
if (!((_a = err.request) === null || _a === void 0 ? void 0 : _a.isAborted)) { | ||
throw err; | ||
@@ -171,0 +180,0 @@ } |
{ | ||
"name": "ozone-typescript-client", | ||
"version": "6.0.4", | ||
"version": "6.0.5", | ||
"description": "", | ||
@@ -33,3 +33,3 @@ "main": "dist/src/index.js", | ||
"typescript-http-client": "0.10.1", | ||
"typescript-state-machine": "0.9.6" | ||
"typescript-state-machine": "0.9.7" | ||
}, | ||
@@ -39,3 +39,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "30ec557cc07557685a96df7a468a7c09c781972d" | ||
"gitHead": "669aa4b70bf4f6c5d09e7aae15d58cfa6c3365c7" | ||
} |
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
472416
5130
+ Addedtypescript-state-machine@0.9.7(transitive)
- Removedtypescript-state-machine@0.9.6(transitive)