@eclipse-emfcloud/modelserver-client
Advanced tools
Comparing version 0.8.0-next.453f51a.81 to 0.8.0-next.46ba3ca.93
@@ -33,5 +33,5 @@ /******************************************************************************** | ||
/** JSON formats supported by the V2 client API. */ | ||
export declare type JsonFormat = 'json' | 'json-v2'; | ||
export type JsonFormat = 'json' | 'json-v2'; | ||
/** Message formats supported by the V2 client API. */ | ||
export declare type Format = string; | ||
export type Format = string; | ||
/** | ||
@@ -58,3 +58,3 @@ * Additional subscription options supported by API v2 model subscriptions. | ||
*/ | ||
export declare type PatchOrCommand = Operation | Operation[] | ModelPatch | ModelPatch[] | ModelServerCommand; | ||
export type PatchOrCommand = Operation | Operation[] | ModelPatch | ModelPatch[] | ModelServerCommand; | ||
/** | ||
@@ -61,0 +61,0 @@ * Basic client API to interact with a model server that conforms to the Modelserver API Version 2. |
/******************************************************************************** | ||
* Copyright (c) 2022 STMicroelectronics and others. | ||
* Copyright (c) 2022-2023 STMicroelectronics and others. | ||
* | ||
@@ -4,0 +4,0 @@ * This program and the accompanying materials are made available under the |
@@ -19,3 +19,3 @@ "use strict"; | ||
/******************************************************************************** | ||
* Copyright (c) 2022 STMicroelectronics and others. | ||
* Copyright (c) 2022-2023 STMicroelectronics and others. | ||
* | ||
@@ -259,3 +259,3 @@ * This program and the accompanying materials are made available under the | ||
catch (error) { | ||
if (isAxiosError(error)) { | ||
if (axios_1.default.isAxiosError(error)) { | ||
const message = ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) ? error.response.data : error.message; | ||
@@ -271,5 +271,2 @@ throw new model_server_client_api_v1_1.ModelServerError(message, error.code); | ||
exports.ModelServerClientV2 = ModelServerClientV2; | ||
function isAxiosError(error) { | ||
return error !== undefined && error instanceof Error && 'isAxiosError' in error && error['isAxiosError']; | ||
} | ||
function mapModel(model, guard, toString = false) { | ||
@@ -276,0 +273,0 @@ const { modeluri, content } = model; |
/******************************************************************************** | ||
* Copyright (c) 2021-2022 STMicroelectronics and others. | ||
* Copyright (c) 2021-2023 STMicroelectronics and others. | ||
* | ||
@@ -4,0 +4,0 @@ * This program and the accompanying materials are made available under the |
@@ -19,3 +19,3 @@ "use strict"; | ||
/******************************************************************************** | ||
* Copyright (c) 2021-2022 STMicroelectronics and others. | ||
* Copyright (c) 2021-2023 STMicroelectronics and others. | ||
* | ||
@@ -219,3 +219,3 @@ * This program and the accompanying materials are made available under the | ||
catch (error) { | ||
if (isAxiosError(error)) { | ||
if (axios_1.default.isAxiosError(error)) { | ||
const message = ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) ? error.response.data : error.message; | ||
@@ -231,5 +231,2 @@ throw new model_server_client_api_v1_1.ModelServerError(message, error.code); | ||
exports.ModelServerClient = ModelServerClient; | ||
function isAxiosError(error) { | ||
return error !== undefined && error instanceof Error && 'isAxiosError' in error && error['isAxiosError']; | ||
} | ||
/** | ||
@@ -236,0 +233,0 @@ * Creates a modelserver message data mapper that maps the response either to a generic JSON object, a specific typed object or string. |
@@ -71,3 +71,3 @@ import URI from 'urijs'; | ||
*/ | ||
export declare type Mapper<M, D = unknown> = (message: M) => D; | ||
export type Mapper<M, D = unknown> = (message: M) => D; | ||
/** | ||
@@ -80,3 +80,3 @@ * A Mapper which directly returns the message. | ||
*/ | ||
export declare type MessageDataMapper<D = unknown> = (message: ModelServerMessage) => D; | ||
export type MessageDataMapper<D = unknown> = (message: ModelServerMessage) => D; | ||
/** | ||
@@ -83,0 +83,0 @@ * A collection of utility functions to map the `data` property of a {@link ModelServerMessage} to a specific type. |
@@ -118,3 +118,3 @@ /******************************************************************************** | ||
*/ | ||
export declare type UnknownNotification = ModelServerNotification & ModelServerMessage; | ||
export type UnknownNotification = ModelServerNotification & ModelServerMessage; | ||
export declare namespace UnknownNotification { | ||
@@ -121,0 +121,0 @@ function is(object?: unknown): object is UnknownNotification; |
@@ -1,2 +0,2 @@ | ||
export declare type DataValueType = boolean | number | string; | ||
export type DataValueType = boolean | number | string; | ||
export declare class ModelServerObject { | ||
@@ -3,0 +3,0 @@ readonly eClass: string; |
@@ -19,3 +19,3 @@ /******************************************************************************** | ||
*/ | ||
export declare type AnyObject = Record<PropertyKey, unknown>; | ||
export type AnyObject = Record<PropertyKey, unknown>; | ||
export declare namespace AnyObject { | ||
@@ -34,3 +34,3 @@ /** | ||
*/ | ||
export declare type TypeGuard<T> = (object: unknown) => object is T; | ||
export type TypeGuard<T> = (object: unknown) => object is T; | ||
/** | ||
@@ -120,3 +120,3 @@ * Validates whether the given object as a property of type `string` with the given key. | ||
/** Protocol of a message encoder. */ | ||
export declare type Encoder<T = unknown> = (object: string | AnyObject) => T | string; | ||
export type Encoder<T = unknown> = (object: string | AnyObject) => T | string; | ||
/** | ||
@@ -123,0 +123,0 @@ * Obtain a message encoder for the request body. |
@@ -17,3 +17,3 @@ { | ||
"bugs": "https://github.com/eclipse-emfcloud/emfcloud-modelserver-theia/issues", | ||
"version": "0.8.0-next.453f51a.81+453f51a", | ||
"version": "0.8.0-next.46ba3ca.93+46ba3ca", | ||
"files": [ | ||
@@ -49,3 +49,3 @@ "lib", | ||
"urijs": "^1.19.11", | ||
"ws": "^7.4.6" | ||
"ws": "^7.1.2" | ||
}, | ||
@@ -70,3 +70,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "453f51a2e6fb4418e22e34aa8998c3def763c038" | ||
"gitHead": "46ba3caacf87f014c12e9886bd1eda5f74ae10c5" | ||
} |
/******************************************************************************** | ||
* Copyright (c) 2022 STMicroelectronics and others. | ||
* Copyright (c) 2022-2023 STMicroelectronics and others. | ||
* | ||
@@ -11,3 +11,3 @@ * This program and the accompanying materials are made available under the | ||
*******************************************************************************/ | ||
import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
import { deepClone } from 'fast-json-patch'; | ||
@@ -348,3 +348,3 @@ import WebSocket from 'isomorphic-ws'; | ||
} catch (error) { | ||
if (isAxiosError(error)) { | ||
if (axios.isAxiosError(error)) { | ||
const message = error.response?.data ? error.response.data : error.message; | ||
@@ -359,6 +359,2 @@ throw new ModelServerError(message, error.code); | ||
function isAxiosError(error: any): error is AxiosError { | ||
return error !== undefined && error instanceof Error && 'isAxiosError' in error && error['isAxiosError']; | ||
} | ||
/** | ||
@@ -365,0 +361,0 @@ * Helper type for method overloads where on parameter could either be |
/******************************************************************************** | ||
* Copyright (c) 2021-2022 STMicroelectronics and others. | ||
* Copyright (c) 2021-2023 STMicroelectronics and others. | ||
* | ||
@@ -11,3 +11,3 @@ * This program and the accompanying materials are made available under the | ||
*******************************************************************************/ | ||
import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
import WebSocket from 'isomorphic-ws'; | ||
@@ -270,3 +270,3 @@ import URI from 'urijs'; | ||
} catch (error) { | ||
if (isAxiosError(error)) { | ||
if (axios.isAxiosError(error)) { | ||
const message = error.response?.data ? error.response.data : error.message; | ||
@@ -281,6 +281,2 @@ throw new ModelServerError(message, error.code); | ||
function isAxiosError(error: any): error is AxiosError { | ||
return error !== undefined && error instanceof Error && 'isAxiosError' in error && error['isAxiosError']; | ||
} | ||
/** | ||
@@ -287,0 +283,0 @@ * Helper type for method overloads where on parameter could either be |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 4 instances 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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
616876
118
9191
18
Updatedws@^7.1.2