ozone-typescript-client
Advanced tools
Comparing version 6.0.4 to 6.1.0
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=blobClient.js.map |
@@ -10,4 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Request = httpclient.Request; | ||
import { Request } from 'typescript-http-client'; | ||
export class BlobClientImpl { | ||
@@ -14,0 +13,0 @@ constructor(client, baseUrl) { |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=filetypeClient.js.map |
@@ -19,5 +19,4 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
import { httpclient } from 'typescript-http-client'; | ||
import { Request } from 'typescript-http-client'; | ||
import { once } from 'helpful-decorators'; | ||
var Request = httpclient.Request; | ||
import { returnNullOn404 } from '../utility/utility'; | ||
@@ -24,0 +23,0 @@ export class FiletypeCacheImpl { |
import { ExportSpec, UUID, ImportSpec } from 'ozone-type'; | ||
import { httpclient } from 'typescript-http-client'; | ||
import Request = httpclient.Request; | ||
import { Request } from 'typescript-http-client'; | ||
export interface ArchiveType { | ||
@@ -5,0 +4,0 @@ archiveId: UUID; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=importExportClient.js.map |
@@ -10,4 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Request = httpclient.Request; | ||
import { Request } from 'typescript-http-client'; | ||
const UPLOAD_TIMEOUT = 60 * 60 * 1000; // let 1hour max to upload the archive | ||
@@ -14,0 +13,0 @@ export class ImportExportClientImpl { |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=itemClient.js.map |
@@ -11,4 +11,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { State as MetaState } from 'ozone-type'; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Request = httpclient.Request; | ||
import { Request, Response } from 'typescript-http-client'; | ||
import { returnNullOn404 } from '../utility/utility'; | ||
@@ -42,2 +41,3 @@ export class ItemClientImpl { | ||
findAll() { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -47,3 +47,3 @@ const results = yield this.search({ | ||
}); | ||
return results.results || []; | ||
return (_a = results === null || results === void 0 ? void 0 : results.results) !== null && _a !== void 0 ? _a : []; | ||
}); | ||
@@ -145,11 +145,12 @@ } | ||
catch (err) { | ||
if (err.request && err.request.isAborted) { | ||
throw Error('search aborted'); | ||
if (err instanceof Response) { | ||
if (err.request && err.request.isAborted) { | ||
throw Error('search aborted'); | ||
} | ||
} | ||
else { | ||
throw err; | ||
} | ||
throw err; | ||
} | ||
} | ||
next(forceOffset) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -167,3 +168,4 @@ try { | ||
catch (err) { | ||
if (!(err.request && err.request.isAborted)) { | ||
if (!(err instanceof Response) | ||
|| !((_a = err.request) === null || _a === void 0 ? void 0 : _a.isAborted)) { | ||
throw err; | ||
@@ -170,0 +172,0 @@ } |
@@ -0,6 +1,4 @@ | ||
import type { Logger } from 'generic-logger-typings'; | ||
import { StateMachine, ListenerRegistration } from 'typescript-state-machine'; | ||
import { httpclient } from 'typescript-http-client'; | ||
import Response = httpclient.Response; | ||
import Request = httpclient.Request; | ||
import InstalledFilter = httpclient.InstalledFilter; | ||
import type { Filter, InstalledFilter, Request, Response } from 'typescript-http-client'; | ||
import { DeviceMessage, Item } from 'ozone-type'; | ||
@@ -76,3 +74,8 @@ import { ClientState } from './clientState'; | ||
*/ | ||
addCustomFilter(filter: httpclient.Filter<any, any>, name: string): void; | ||
addCustomFilter(filter: Filter<any, any>, name: string): void; | ||
/** | ||
* Provide external logger to client | ||
* @param logger The logger to use | ||
*/ | ||
setLogger(logger: Logger): void; | ||
} |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=ozoneClient.js.map |
@@ -0,6 +1,4 @@ | ||
import type { Logger } from 'generic-logger-typings'; | ||
import { StateMachineImpl, ListenerRegistration } from 'typescript-state-machine'; | ||
import { httpclient } from 'typescript-http-client'; | ||
import Response = httpclient.Response; | ||
import Request = httpclient.Request; | ||
import InstalledFilter = httpclient.InstalledFilter; | ||
import { Response, Request, InstalledFilter, Filter } from 'typescript-http-client'; | ||
import { DeviceMessage, Item } from 'ozone-type'; | ||
@@ -14,3 +12,2 @@ import { ClientState } from './clientState'; | ||
import { OzoneClient, OzoneCredentials, AuthInfo, ClientConfiguration } from './ozoneClient'; | ||
import Filter = httpclient.Filter; | ||
import { TaskClient } from '../taskClient/taskClient'; | ||
@@ -33,2 +30,4 @@ import { ImportExportClient } from '../importExportClient/importExportClient'; | ||
readonly postFilters: InstalledFilter[]; | ||
protected static log?: Logger; | ||
setLogger(logger: Logger): void; | ||
constructor(configuration: ClientConfiguration); | ||
@@ -35,0 +34,0 @@ get config(): ClientConfiguration; |
@@ -20,6 +20,4 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import { AssumeStateIsNot, AssumeStateIs, StateMachineImpl } from 'typescript-state-machine'; | ||
import { httpclient } from 'typescript-http-client'; | ||
import { Response, Request, newHttpClient, FilterCollection, setLogger } from 'typescript-http-client'; | ||
import SockJS from 'sockjs-client'; | ||
var Response = httpclient.Response; | ||
var Request = httpclient.Request; | ||
import { states, validTransitions } from './clientState'; | ||
@@ -32,5 +30,2 @@ import { ItemClientImpl } from '../itemClient/itemClientImpl'; | ||
import { Cache } from '../cache/cache'; | ||
var newHttpClient = httpclient.newHttpClient; | ||
var FilterCollection = httpclient.FilterCollection; | ||
import { getLogger } from 'log4javascript'; | ||
import { TaskClientImpl } from '../taskClient/taskClientImpl'; | ||
@@ -45,3 +40,2 @@ import { ImportExportClientImpl } from '../importExportClient/importExportClientImpl'; | ||
const DEFAULT_TIMEOUT = 5000; | ||
const log = getLogger('ozoneClient'); | ||
class Listener { | ||
@@ -90,2 +84,7 @@ constructor() { | ||
} | ||
setLogger(logger) { | ||
super.setLogger(logger); | ||
OzoneClientImpl.log = logger; | ||
setLogger(logger); | ||
} | ||
get config() { | ||
@@ -179,2 +178,3 @@ return this._config; | ||
acknowledgeMessage(postingId, ttl) { | ||
var _a; | ||
let shouldProcess = true; | ||
@@ -189,3 +189,3 @@ try { | ||
catch (err) { | ||
log.warn(err, 'error in WS message acknowledge'); | ||
(_a = this.log) === null || _a === void 0 ? void 0 : _a.warn(err, 'error in WS message acknowledge'); | ||
} | ||
@@ -195,2 +195,3 @@ return shouldProcess; | ||
static parseMessage(message) { | ||
var _a; | ||
try { | ||
@@ -200,3 +201,3 @@ return JSON.parse(message.data); | ||
catch (e) { | ||
log.error('Unable to parse websocket message:', message, '// Error:', e); | ||
(_a = OzoneClientImpl.log) === null || _a === void 0 ? void 0 : _a.error('Unable to parse websocket message:', message, '// Error:', e); | ||
return null; | ||
@@ -521,2 +522,3 @@ } | ||
static invokeMessageListeners(message, listeners) { | ||
var _a; | ||
if (listeners) { | ||
@@ -530,3 +532,3 @@ for (let index = 0; index < listeners.length; index++) { | ||
catch (e) { | ||
log.warn('Uncaught error in message listener :' + e); | ||
(_a = OzoneClientImpl.log) === null || _a === void 0 ? void 0 : _a.warn('Uncaught error in message listener :' + e); | ||
} | ||
@@ -533,0 +535,0 @@ } |
@@ -10,6 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Response = httpclient.Response; | ||
var Request = httpclient.Request; | ||
var newHttpClient = httpclient.newHttpClient; | ||
import { Response, Request, newHttpClient } from 'typescript-http-client'; | ||
export class SessionCredentials { | ||
@@ -16,0 +13,0 @@ authenticate(ozoneURL) { |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=permissionClient.js.map |
@@ -11,4 +11,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { FieldsPermissionUtility } from 'ozone-type'; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Request = httpclient.Request; | ||
import { Request } from 'typescript-http-client'; | ||
export class PermissionClientImpl { | ||
@@ -15,0 +14,0 @@ constructor(client, baseUrl) { |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=roleClient.js.map |
@@ -1,3 +0,2 @@ | ||
import { httpclient } from 'typescript-http-client'; | ||
var Request = httpclient.Request; | ||
import { Request } from 'typescript-http-client'; | ||
import { returnNullOn404 } from '../utility/utility'; | ||
@@ -4,0 +3,0 @@ export class RoleClientImpl { |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=taskClient.js.map |
@@ -10,4 +10,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Request = httpclient.Request; | ||
import { Request } from 'typescript-http-client'; | ||
export class TaskClientImpl { | ||
@@ -14,0 +13,0 @@ constructor(client, baseUrl) { |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=typeCache.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=typeClient.js.map |
@@ -19,5 +19,4 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
import { httpclient } from 'typescript-http-client'; | ||
import { Request } from 'typescript-http-client'; | ||
import { once } from 'helpful-decorators'; | ||
var Request = httpclient.Request; | ||
import { TypeCacheImpl } from './typeCacheImpl'; | ||
@@ -24,0 +23,0 @@ import { returnNullOn404 } from '../utility/utility'; |
@@ -1,4 +0,3 @@ | ||
import { httpclient } from 'typescript-http-client'; | ||
import Response = httpclient.Response; | ||
import { Response } from 'typescript-http-client'; | ||
export declare function returnNullOn404<T>(response: Response<T>): null; | ||
export declare function deepCopy<T extends Object>(obj: T): T; |
@@ -16,4 +16,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var newOzoneClient = OzoneClient.newOzoneClient; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Response = httpclient.Response; | ||
import { Response } from 'typescript-http-client'; | ||
describe('OzoneClient', () => { | ||
@@ -20,0 +19,0 @@ const wait = (timeMs) => new Promise(resolve => setTimeout(resolve, timeMs)); |
@@ -15,4 +15,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var newOzoneClient = OzoneClient.newOzoneClient; | ||
import { httpclient } from 'typescript-http-client'; | ||
var Response = httpclient.Response; | ||
import { Response } from 'typescript-http-client'; | ||
describe('OzoneClient', () => { | ||
@@ -19,0 +18,0 @@ const wait = (timeMs) => new Promise(resolve => setTimeout(resolve, timeMs)); |
{ | ||
"name": "ozone-typescript-client", | ||
"version": "6.0.4", | ||
"version": "6.1.0", | ||
"description": "", | ||
@@ -27,9 +27,9 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"generic-logger-typings": "1.0.0", | ||
"helpful-decorators": "2.0.4", | ||
"log4javascript": "1.4.15", | ||
"ozone-search-helper": "^6.0.3", | ||
"ozone-type": "^6.0.3", | ||
"sockjs-client": "1.4.0", | ||
"typescript-http-client": "0.10.1", | ||
"typescript-state-machine": "0.9.6" | ||
"typescript-http-client": "0.10.4", | ||
"typescript-state-machine": "0.9.8" | ||
}, | ||
@@ -39,3 +39,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "30ec557cc07557685a96df7a468a7c09c781972d" | ||
"gitHead": "a723ead1ef0f5b31a3a055f10366be78dc4cd3b4" | ||
} |
@@ -9,4 +9,3 @@ import { assert, expect } from 'chai' | ||
import newOzoneClient = OzoneClient.newOzoneClient | ||
import { httpclient } from 'typescript-http-client' | ||
import Response = httpclient.Response | ||
import { Response } from 'typescript-http-client' | ||
@@ -84,3 +83,3 @@ describe('OzoneClient', () => { | ||
assert.instanceOf(response, Response) | ||
assert.equal(response.status, 500) | ||
assert.equal((response as Response<unknown>).status, 500) | ||
} | ||
@@ -87,0 +86,0 @@ }) |
@@ -1,4 +0,3 @@ | ||
import { assert, expect } from 'chai' | ||
import { TypeDescriptor, FieldDescriptor } from 'ozone-type' | ||
import sinon, { SinonFakeServer, SinonSpy } from 'sinon' | ||
import { expect } from 'chai' | ||
import sinon, { SinonFakeServer } from 'sinon' | ||
import { SearchQuery } from 'ozone-search-helper' | ||
@@ -9,4 +8,2 @@ import { OzoneClient } from './../../src/index' | ||
import newOzoneClient = OzoneClient.newOzoneClient | ||
import { httpclient } from 'typescript-http-client' | ||
import Response = httpclient.Response | ||
@@ -13,0 +10,0 @@ describe('OzoneClient', () => { |
@@ -1,3 +0,3 @@ | ||
import { assert, expect } from 'chai' | ||
import sinon, { SinonFakeServer, SinonSpy } from 'sinon' | ||
import { expect } from 'chai' | ||
import sinon, { SinonFakeServer } from 'sinon' | ||
import { OzoneClient } from './../../src/index' | ||
@@ -197,3 +197,3 @@ import UserCredentials = OzoneClient.UserCredentials | ||
} catch (error) { | ||
expect(error.message).to.equal('An error occurs') | ||
expect((error as Error).message).to.equal('An error occurs') | ||
} | ||
@@ -200,0 +200,0 @@ }) |
import { assert, expect } from 'chai' | ||
import { TypeDescriptor, FieldDescriptor } from 'ozone-type' | ||
import sinon, { SinonFakeServer, SinonSpy } from 'sinon' | ||
import { FieldDescriptor } from 'ozone-type' | ||
import sinon, { SinonFakeServer } from 'sinon' | ||
import { OzoneClient } from './../../src/index' | ||
@@ -8,4 +8,3 @@ import UserCredentials = OzoneClient.UserCredentials | ||
import newOzoneClient = OzoneClient.newOzoneClient | ||
import { httpclient } from 'typescript-http-client' | ||
import Response = httpclient.Response | ||
import { Response } from 'typescript-http-client' | ||
@@ -84,3 +83,3 @@ describe('OzoneClient', () => { | ||
assert.instanceOf(response, Response) | ||
assert.equal(response.status, 500) | ||
assert.equal((response as Response<unknown>).status, 500) | ||
} | ||
@@ -87,0 +86,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
470771
5112
+ Addedgeneric-logger-typings@1.0.0
+ Addedgeneric-logger-typings@1.0.0(transitive)
+ Addedtypescript-http-client@0.10.4(transitive)
+ Addedtypescript-state-machine@0.9.8(transitive)
- Removedlog4javascript@1.4.15
- Removedlog4javascript@1.4.15(transitive)
- Removedtypescript-http-client@0.10.1(transitive)
- Removedtypescript-state-machine@0.9.6(transitive)