Socket
Socket
Sign inDemoInstall

@bentley/imodeljs-common

Package Overview
Dependencies
90
Maintainers
4
Versions
524
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0-dev.62 to 3.0.0-dev.63

0

CHANGELOG.md

@@ -0,0 +0,0 @@ # Change Log - @bentley/imodeljs-common

3

lib/ElementProps.js

@@ -12,3 +12,2 @@ "use strict";

const bentleyjs_core_1 = require("@bentley/bentleyjs-core");
const CommonLoggerCategory_1 = require("./CommonLoggerCategory");
const IModelError_1 = require("./IModelError");

@@ -31,3 +30,3 @@ /** The Id and relationship class of an Element that is somehow related to another Element

if (r === undefined)
throw new IModelError_1.IModelError(IModelError_1.IModelStatus.BadArg, "Problem parsing Id64 from json", bentleyjs_core_1.Logger.logWarning, CommonLoggerCategory_1.CommonLoggerCategory.ElementProps);
throw new IModelError_1.IModelError(IModelError_1.IModelStatus.BadArg, "Problem parsing Id64 from json");
return r.id;

@@ -34,0 +33,0 @@ }

@@ -13,3 +13,2 @@ "use strict";

const geometry_core_1 = require("@bentley/geometry-core");
const CommonLoggerCategory_1 = require("../CommonLoggerCategory");
const Frustum_1 = require("../Frustum");

@@ -69,3 +68,3 @@ const IModelError_1 = require("../IModelError");

if (undefined === angles)
throw new IModelError_1.IModelError(bentleyjs_core_1.IModelStatus.BadRequest, "Invalid Transform", bentleyjs_core_1.Logger.logError, CommonLoggerCategory_1.CommonLoggerCategory.Geometry);
throw new IModelError_1.IModelError(bentleyjs_core_1.IModelStatus.BadRequest, "Invalid Transform");
this.angles = angles;

@@ -129,3 +128,3 @@ this.origin.setFrom(transform.origin);

if ((undefined === angles) || !angles.pitch.isAlmostZero || !angles.roll.isAlmostZero)
throw new IModelError_1.IModelError(bentleyjs_core_1.IModelStatus.BadRequest, "Invalid Transform", bentleyjs_core_1.Logger.logError, CommonLoggerCategory_1.CommonLoggerCategory.Geometry);
throw new IModelError_1.IModelError(bentleyjs_core_1.IModelStatus.BadRequest, "Invalid Transform");
this.angle = angles.yaw;

@@ -132,0 +131,0 @@ this.origin.setFrom(transform.origin);

/** @packageDocumentation
* @module iModels
*/
import { AuthStatus, BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, GetMetaDataFunction, IModelStatus, LogFunction, RepositoryStatus, RpcInterfaceStatus } from "@bentley/bentleyjs-core";
import { AuthStatus, BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, GetMetaDataFunction, IModelStatus, RepositoryStatus, RpcInterfaceStatus } from "@bentley/bentleyjs-core";
export { BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, GetMetaDataFunction, LogFunction, DbResult, AuthStatus, RepositoryStatus, ChangeSetStatus, RpcInterfaceStatus } from "@bentley/bentleyjs-core";

@@ -10,15 +10,15 @@ /** The error type thrown by this module. See [[IModelStatus]] for `errorNumber` values.

export declare class IModelError extends BentleyError {
constructor(errorNumber: number | IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | RepositoryStatus | ChangeSetStatus | RpcInterfaceStatus | AuthStatus, message: string, log?: LogFunction, category?: string, getMetaData?: GetMetaDataFunction);
constructor(errorNumber: number | IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | RepositoryStatus | ChangeSetStatus | RpcInterfaceStatus | AuthStatus, message: string, getMetaData?: GetMetaDataFunction);
}
/** @public */
export declare class ServerError extends IModelError {
constructor(errorNumber: number, message: string, log?: LogFunction);
constructor(errorNumber: number, message: string);
}
/** @public */
export declare class ServerTimeoutError extends ServerError {
constructor(message: string, log?: LogFunction);
constructor(message: string);
}
/** @public */
export declare class BackendError extends IModelError {
constructor(errorNumber: number, name: string, message: string, log?: LogFunction, category?: string, getMetaData?: GetMetaDataFunction);
constructor(errorNumber: number, name: string, message: string, getMetaData?: GetMetaDataFunction);
}

@@ -30,3 +30,3 @@ /**

export declare class ChannelConstraintError extends IModelError {
constructor(message: string, log?: LogFunction, category?: string, getMetaData?: GetMetaDataFunction);
constructor(message: string, getMetaData?: GetMetaDataFunction);
}

@@ -33,0 +33,0 @@ /** Intended for API "no content" semantics where the error case should not trigger application failure monitoring systems.

@@ -26,4 +26,4 @@ "use strict";

class IModelError extends bentleyjs_core_1.BentleyError {
constructor(errorNumber, message, log, category, getMetaData) {
super(errorNumber, message, log, category, getMetaData);
constructor(errorNumber, message, getMetaData) {
super(errorNumber, message, getMetaData);
}

@@ -34,4 +34,4 @@ }

class ServerError extends IModelError {
constructor(errorNumber, message, log) {
super(errorNumber, message, log);
constructor(errorNumber, message) {
super(errorNumber, message);
this.name = `Server error (${errorNumber})`;

@@ -43,4 +43,4 @@ }

class ServerTimeoutError extends ServerError {
constructor(message, log) {
super(bentleyjs_core_1.IModelStatus.ServerTimeout, message, log);
constructor(message) {
super(bentleyjs_core_1.IModelStatus.ServerTimeout, message);
this.name = "Server timeout error";

@@ -52,4 +52,4 @@ }

class BackendError extends IModelError {
constructor(errorNumber, name, message, log, category, getMetaData) {
super(errorNumber, message, log, category, getMetaData);
constructor(errorNumber, name, message, getMetaData) {
super(errorNumber, message, getMetaData);
this.name = name;

@@ -64,4 +64,4 @@ }

class ChannelConstraintError extends IModelError {
constructor(message, log, category, getMetaData) {
super(bentleyjs_core_1.RepositoryStatus.ChannelConstraintViolation, message, log, category, getMetaData);
constructor(message, getMetaData) {
super(bentleyjs_core_1.RepositoryStatus.ChannelConstraintViolation, message, getMetaData);
}

@@ -68,0 +68,0 @@ }

/** @packageDocumentation
* @module RpcInterface
*/
import { ClientRequestContext } from "@bentley/bentleyjs-core";
import { RpcInterface } from "../../RpcInterface";

@@ -16,2 +17,3 @@ import { RpcRequestStatus } from "./RpcConstants";

export declare class RpcInvocation {
static currentRequest: ClientRequestContext;
private _threw;

@@ -45,2 +47,6 @@ private _pending;

private handleUnknownOperation;
/** When processing an RPC request that throws an unhandled exception, log it with sanitized requestContext.
* @internal
*/
static logRpcException(currentRequest: ClientRequestContext, error: any): void;
private resolve;

@@ -47,0 +53,0 @@ private applyPolicies;

@@ -94,6 +94,17 @@ "use strict";

}
/** When processing an RPC request that throws an unhandled exception, log it with sanitized requestContext.
* @internal
*/
static logRpcException(currentRequest, error) {
var _a;
let msg = error.toString();
const errMeta = (_a = error.getMetaData) === null || _a === void 0 ? void 0 : _a.call(error);
if (errMeta)
msg += ` [${JSON.stringify(errMeta)}]`;
bentleyjs_core_1.Logger.logError(CommonLoggerCategory_1.CommonLoggerCategory.RpcInterfaceBackend, msg, () => currentRequest.sanitize());
}
async resolve() {
let currentRequest;
try {
const clientRequestContext = await RpcConfiguration_1.RpcConfiguration.requestContext.deserialize(this.request);
clientRequestContext.enter();
currentRequest = await RpcConfiguration_1.RpcConfiguration.requestContext.deserialize(this.request);
this.protocol.events.raiseEvent(RpcConstants_1.RpcProtocolEvent.RequestReceived, this);

@@ -105,7 +116,10 @@ const parameters = RpcMarshaling_1.RpcMarshaling.deserialize(this.protocol, this.request.parameters);

const op = this.lookupOperationFunction(impl);
// @typescript-eslint/return-await doesn't agree with awaiting values that *might* be a promise
// eslint-disable-next-line @typescript-eslint/return-await
// This global is a "pseudo-magic-argument" to every RPC call. RpcImplementations must pass it as an argument to
// any asynchronous code that may need it, and *not* rely on the global variable remaining unchanged across async calls.
RpcInvocation.currentRequest = currentRequest;
return await op.call(impl, ...parameters);
}
catch (error) {
if (currentRequest)
RpcInvocation.logRpcException(currentRequest, error);
return this.reject(error);

@@ -209,5 +223,4 @@ }

const func = implementation[this.operation.operationName];
if (!func || typeof (func) !== "function") {
throw new IModelError_1.IModelError(bentleyjs_core_1.BentleyStatus.ERROR, `RPC interface class "${implementation.constructor.name}" does not implement operation "${this.operation.operationName}".`, bentleyjs_core_1.Logger.logError, CommonLoggerCategory_1.CommonLoggerCategory.RpcInterfaceBackend);
}
if (!func || typeof (func) !== "function")
throw new IModelError_1.IModelError(bentleyjs_core_1.BentleyStatus.ERROR, `RPC interface class "${implementation.constructor.name}" does not implement operation "${this.operation.operationName}".`);
return func;

@@ -214,0 +227,0 @@ }

@@ -12,3 +12,2 @@ "use strict";

const bentleyjs_core_1 = require("@bentley/bentleyjs-core");
const CommonLoggerCategory_1 = require("../../CommonLoggerCategory");
const IModelError_1 = require("../../IModelError");

@@ -279,3 +278,3 @@ const RpcConfiguration_1 = require("./RpcConfiguration");

const errorNumber = (hasInfo && error.hasOwnProperty("errorNumber")) ? error.errorNumber : bentleyjs_core_1.BentleyStatus.ERROR;
return this.reject(new IModelError_1.BackendError(errorNumber, name, message, bentleyjs_core_1.Logger.logError, CommonLoggerCategory_1.CommonLoggerCategory.RpcInterfaceFrontend, () => error));
return this.reject(new IModelError_1.BackendError(errorNumber, name, message, () => error));
}

@@ -282,0 +281,0 @@ catch (err) {

@@ -6,6 +6,8 @@ /** @packageDocumentation

import { Range3dProps } from "@bentley/geometry-core";
import { CodeProps } from "../Code";
import { ElementLoadOptions, ElementProps } from "../ElementProps";
import { CodeProps } from "../Code";
import { EntityQueryParams } from "../EntityProps";
import { GeoCoordinatesResponseProps, IModelCoordinatesResponseProps } from "../GeoCoordinateServices";
import { FontMapProps } from "../Fonts";
import { GeoCoordinatesRequestProps, GeoCoordinatesResponseProps, IModelCoordinatesRequestProps, IModelCoordinatesResponseProps } from "../GeoCoordinateServices";
import { GeometryContainmentRequestProps, GeometryContainmentResponseProps } from "../GeometryContainment";
import { GeometrySummaryRequestProps } from "../GeometrySummary";

@@ -18,7 +20,6 @@ import { IModelConnectionProps, IModelRpcOpenProps, IModelRpcProps } from "../IModel";

import { SnapRequestProps, SnapResponseProps } from "../Snapping";
import { TextureData, TextureLoadProps } from "../TextureProps";
import { ViewStateLoadProps, ViewStateProps } from "../ViewProps";
import { RpcNotFoundResponse } from "./core/RpcControl";
import { GeometryContainmentRequestProps, GeometryContainmentResponseProps } from "../GeometryContainment";
import { RpcRoutingToken } from "./core/RpcRoutingToken";
import { TextureLoadProps } from "../TextureProps";
/** Response if the IModelDb was not found at the backend

@@ -57,3 +58,3 @@ * (if the service has moved)

getViewStateData(_iModelToken: IModelRpcProps, _viewDefinitionId: string, _options?: ViewStateLoadProps): Promise<ViewStateProps>;
readFontJson(_iModelToken: IModelRpcProps): Promise<any>;
readFontJson(_iModelToken: IModelRpcProps): Promise<FontMapProps>;
getToolTipMessage(_iModelToken: IModelRpcProps, _elementId: string): Promise<string[]>;

@@ -66,8 +67,8 @@ getViewThumbnail(_iModelToken: IModelRpcProps, _viewId: string): Promise<Uint8Array>;

getMassProperties(_iModelToken: IModelRpcProps, _props: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps>;
getIModelCoordinatesFromGeoCoordinates(_iModelToken: IModelRpcProps, _props: string): Promise<IModelCoordinatesResponseProps>;
getGeoCoordinatesFromIModelCoordinates(_iModelToken: IModelRpcProps, _props: string): Promise<GeoCoordinatesResponseProps>;
getIModelCoordinatesFromGeoCoordinates(_iModelToken: IModelRpcProps, _props: IModelCoordinatesRequestProps): Promise<IModelCoordinatesResponseProps>;
getGeoCoordinatesFromIModelCoordinates(_iModelToken: IModelRpcProps, _props: GeoCoordinatesRequestProps): Promise<GeoCoordinatesResponseProps>;
getGeometrySummary(_iModelToken: IModelRpcProps, _props: GeometrySummaryRequestProps): Promise<string>;
getTextureImage(_iModelToken: IModelRpcProps, _textureLoadProps: TextureLoadProps): Promise<Uint8Array | undefined>;
queryTextureData(_iModelToken: IModelRpcProps, _textureLoadProps: TextureLoadProps): Promise<TextureData | undefined>;
loadElementProps(_iModelToken: IModelRpcProps, _elementIdentifier: Id64String | GuidString | CodeProps, _options?: ElementLoadOptions): Promise<ElementProps | undefined>;
}
//# sourceMappingURL=IModelReadRpcInterface.d.ts.map

@@ -62,3 +62,3 @@ "use strict";

async getGeometrySummary(_iModelToken, _props) { return this.forward(arguments); }
async getTextureImage(_iModelToken, _textureLoadProps) { return this.forward(arguments); }
async queryTextureData(_iModelToken, _textureLoadProps) { return this.forward(arguments); }
async loadElementProps(_iModelToken, _elementIdentifier, _options) {

@@ -65,0 +65,0 @@ return this.forward(arguments);

@@ -13,3 +13,2 @@ "use strict";

const bentleyjs_core_1 = require("@bentley/bentleyjs-core");
const CommonLoggerCategory_1 = require("../../CommonLoggerCategory");
const IModelError_1 = require("../../IModelError");

@@ -90,3 +89,3 @@ const RpcConfiguration_1 = require("../core/RpcConfiguration");

else {
throw new IModelError_1.IModelError(bentleyjs_core_1.BentleyStatus.ERROR, "Invalid iModelToken for RPC operation request", bentleyjs_core_1.Logger.logError, CommonLoggerCategory_1.CommonLoggerCategory.RpcInterfaceFrontend);
throw new IModelError_1.IModelError(bentleyjs_core_1.BentleyStatus.ERROR, "Invalid iModelToken for RPC operation request");
}

@@ -93,0 +92,0 @@ }

@@ -31,2 +31,15 @@ /** @packageDocumentation

}
/** Information about [Texture]($backend) data returned by [[IModelReadRpcInterface.queryTextureData]].
* @public
*/
export interface TextureData {
/** The width of the image, possibly reduced from the original width based on [[TextureLoadProps.maxTextureSize]]. */
width: number;
/** The height of the image, possibly reduced from the original height based on [[TextureLoadProps.maxTextureSize]]. */
height: number;
/** The format of the returned data, Jpeg or Png. */
format: ImageSourceFormat;
/** returned byte data */
bytes: Uint8Array;
}
//# sourceMappingURL=TextureProps.d.ts.map
{
"name": "@bentley/imodeljs-common",
"version": "3.0.0-dev.62",
"version": "3.0.0-dev.63",
"description": "iModel.js components common to frontend and backend",

@@ -30,14 +30,14 @@ "main": "lib/imodeljs-common.js",

"peerDependencies": {
"@bentley/bentleyjs-core": "^3.0.0-dev.62",
"@bentley/geometry-core": "^3.0.0-dev.62",
"@bentley/imodelhub-client": "^3.0.0-dev.62",
"@bentley/itwin-client": "^3.0.0-dev.62"
"@bentley/bentleyjs-core": "^3.0.0-dev.63",
"@bentley/geometry-core": "^3.0.0-dev.63",
"@bentley/imodelhub-client": "^3.0.0-dev.63",
"@bentley/itwin-client": "^3.0.0-dev.63"
},
"devDependencies": {
"@bentley/bentleyjs-core": "3.0.0-dev.62",
"@bentley/build-tools": "3.0.0-dev.62",
"@bentley/eslint-plugin": "3.0.0-dev.62",
"@bentley/geometry-core": "3.0.0-dev.62",
"@bentley/imodelhub-client": "3.0.0-dev.62",
"@bentley/itwin-client": "3.0.0-dev.62",
"@bentley/bentleyjs-core": "3.0.0-dev.63",
"@bentley/build-tools": "3.0.0-dev.63",
"@bentley/eslint-plugin": "3.0.0-dev.63",
"@bentley/geometry-core": "3.0.0-dev.63",
"@bentley/imodelhub-client": "3.0.0-dev.63",
"@bentley/itwin-client": "3.0.0-dev.63",
"@types/chai": "^4.1.4",

@@ -44,0 +44,0 @@ "@types/flatbuffers": "~1.10.0",

@@ -0,0 +0,0 @@ # @bentley/imodeljs-common

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

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

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc