Socket
Socket
Sign inDemoInstall

@bentley/bentleyjs-core

Package Overview
Dependencies
Maintainers
4
Versions
524
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bentley/bentleyjs-core - npm Package Compare versions

Comparing version 0.191.0 to 1.0.0

27

CHANGELOG.json

@@ -5,2 +5,29 @@ {

{
"version": "1.0.0",
"tag": "@bentley/bentleyjs-core_v1.0.0",
"date": "Mon, 03 Jun 2019 18:09:39 GMT",
"comments": {
"none": [
{
"comment": "RPC system now accepts only basic values (primitives, \"interface\" objects, and binary)."
},
{
"comment": "added Id64.getFirst to get the first value of an Id64Arg"
},
{
"comment": "Added an error for seed file initialization timeout"
},
{
"comment": "Switched from iModelHub Project API to Context API"
},
{
"comment": "Refactored and simplified implementation of IModelDb.open"
},
{
"comment": "add property accessor for empty Guid"
}
]
}
},
{
"version": "0.191.0",

@@ -7,0 +34,0 @@ "tag": "@bentley/bentleyjs-core_v0.191.0",

14

CHANGELOG.md
# Change Log - @bentley/bentleyjs-core
This log was last generated on Mon, 13 May 2019 15:52:05 GMT and should not be manually modified.
This log was last generated on Mon, 03 Jun 2019 18:09:39 GMT and should not be manually modified.
## 1.0.0
Mon, 03 Jun 2019 18:09:39 GMT
### Updates
- RPC system now accepts only basic values (primitives, "interface" objects, and binary).
- added Id64.getFirst to get the first value of an Id64Arg
- Added an error for seed file initialization timeout
- Switched from iModelHub Project API to Context API
- Refactored and simplified implementation of IModelDb.open
- add property accessor for empty Guid
## 0.191.0

@@ -6,0 +18,0 @@ Mon, 13 May 2019 15:52:05 GMT

/** @module Errors */
import { DbResult } from "./BeSQLite";
import { LogFunction } from "./Logger";

@@ -86,3 +85,4 @@ /** Standard status code.

ConstraintNotUnique = 65601,
NoGeoLocation = 65602
NoGeoLocation = 65602,
ServerTimeout = 65603
}

@@ -289,2 +289,4 @@ /** Error status from various briefcase operations

SeedFileInitializationFailed = 102444,
FailedToGetAssetPermissions = 102445,
FailedToGetAssetMembers = 102446,
UndefinedArgumentError = 102657,

@@ -295,3 +297,4 @@ InvalidArgumentError = 102658,

FileHandlerNotSet = 102661,
FileNotFound = 102662
FileNotFound = 102662,
InitializationTimeout = 102663
}

@@ -324,4 +327,14 @@ /** Authentication Errors

errorNumber: number;
constructor(errorNumber: number | IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | RepositoryStatus | ChangeSetStatus | HttpStatus | WSStatus | IModelHubStatus, message?: string, log?: LogFunction, category?: string, getMetaData?: GetMetaDataFunction);
/** Construct a new BentleyError
* @param errorNumber The required error number originating from one of the standard status enums.
* See [[IModelStatus]], [[DbResult]], [[BentleyStatus]], [[BriefcaseStatus]], [[RepositoryStatus]], [[ChangeSetStatus]], [[HttpStatus]], [[WSStatus]], [[IModelHubStatus]]
* @param message The optional error message (should not be localized).
* @param log The optional LogFunction that should be used to log this BentleyError.
* @param category The optional logger category to use when logging.
* @param getMetaData Optional data to be passed to the logger.
*/
constructor(errorNumber: number, message?: string, log?: LogFunction, category?: string, getMetaData?: GetMetaDataFunction);
/** Returns true if this BentleyError includes (optional) meta data. */
readonly hasMetaData: boolean;
/** Return the meta data associated with this BentleyError. */
getMetaData(): any;

@@ -328,0 +341,0 @@ /** This function returns the name of each error status. Override this method to handle more error status codes. */

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

IModelStatus[IModelStatus["NoGeoLocation"] = 65602] = "NoGeoLocation";
IModelStatus[IModelStatus["ServerTimeout"] = 65603] = "ServerTimeout";
})(IModelStatus = exports.IModelStatus || (exports.IModelStatus = {}));

@@ -304,2 +305,4 @@ /** Error status from various briefcase operations

IModelHubStatus[IModelHubStatus["SeedFileInitializationFailed"] = 102444] = "SeedFileInitializationFailed";
IModelHubStatus[IModelHubStatus["FailedToGetAssetPermissions"] = 102445] = "FailedToGetAssetPermissions";
IModelHubStatus[IModelHubStatus["FailedToGetAssetMembers"] = 102446] = "FailedToGetAssetMembers";
// Errors that are returned for incorrect iModelHub request.

@@ -312,2 +315,3 @@ IModelHubStatus[IModelHubStatus["UndefinedArgumentError"] = 102657] = "UndefinedArgumentError";

IModelHubStatus[IModelHubStatus["FileNotFound"] = 102662] = "FileNotFound";
IModelHubStatus[IModelHubStatus["InitializationTimeout"] = 102663] = "InitializationTimeout";
})(IModelHubStatus = exports.IModelHubStatus || (exports.IModelHubStatus = {}));

@@ -327,2 +331,10 @@ /** Authentication Errors

class BentleyError extends Error {
/** Construct a new BentleyError
* @param errorNumber The required error number originating from one of the standard status enums.
* See [[IModelStatus]], [[DbResult]], [[BentleyStatus]], [[BriefcaseStatus]], [[RepositoryStatus]], [[ChangeSetStatus]], [[HttpStatus]], [[WSStatus]], [[IModelHubStatus]]
* @param message The optional error message (should not be localized).
* @param log The optional LogFunction that should be used to log this BentleyError.
* @param category The optional logger category to use when logging.
* @param getMetaData Optional data to be passed to the logger.
*/
constructor(errorNumber, message, log, category, getMetaData) {

@@ -336,3 +348,5 @@ super(message);

}
/** Returns true if this BentleyError includes (optional) meta data. */
get hasMetaData() { return this._getMetaData !== undefined; }
/** Return the meta data associated with this BentleyError. */
getMetaData() {

@@ -512,3 +526,3 @@ return this.hasMetaData ? this._getMetaData() : undefined;

case ChangeSetStatus.CorruptedChangeStream: return "Contents of the change stream are corrupted and does not match the ChangeSet";
case ChangeSetStatus.FileNotFound: return "File containing the changes to the change set is not found";
case ChangeSetStatus.FileNotFound: return "File containing the changes was not found";
case ChangeSetStatus.FileWriteError: return "Error writing the contents of the change set to the backing change stream file";

@@ -608,2 +622,4 @@ case ChangeSetStatus.HasLocalChanges: return "Cannot perform the operation since the Db has local changes";

case IModelHubStatus.FailedToGetProjectMembers: return "Failed to get project members";
case IModelHubStatus.FailedToGetAssetPermissions: return "Failed to get asset permissions";
case IModelHubStatus.FailedToGetAssetMembers: return "Failed to get asset members";
case IModelHubStatus.ChangeSetAlreadyHasVersion: return "ChangeSet already has version";

@@ -610,0 +626,0 @@ case IModelHubStatus.VersionAlreadyExists: return "Version already exists";

/** @module Utils */
import { GuidString } from "./Id";
/** The data properties of ClientRequestContext.
* @public
*/
export interface ClientRequestContextProps {
/** Used for logging to correlate all service requests that originated from this client request */
readonly activityId: GuidString;
/** Used for logging and usage tracking to identify the application that created this client request */
readonly applicationId: string;
/** Used for logging and usage tracking to identify the application version that created this client request */
readonly applicationVersion: string;
/** Used for logging to identify the session that created this client request */
readonly sessionId: GuidString;
}
/** Provides generic context for a server application to get details of a particular

@@ -11,5 +25,5 @@ * request that originated at the client. This context is used to pass information for various

*/
export declare class ClientRequestContext {
export declare class ClientRequestContext implements ClientRequestContextProps {
/** Used for logging to correlate all service requests that originated from this client request */
readonly activityId: string;
readonly activityId: GuidString;
/** Used for logging and usage tracking to identify the application that created this client request */

@@ -19,6 +33,6 @@ readonly applicationId: string;

readonly applicationVersion: string;
/** Used for logging to to identify the session that created this client request */
readonly sessionId: string;
/** Used for logging to identify the session that created this client request */
readonly sessionId: GuidString;
/** Create a new ClientRequestContext */
constructor(activityId?: string, applicationId?: string, applicationVersion?: string, sessionId?: string);
constructor(activityId?: GuidString, applicationId?: string, applicationVersion?: string, sessionId?: GuidString);
/** Get the current client request context */

@@ -37,2 +51,4 @@ static readonly current: ClientRequestContext;

useContextForRpc: boolean;
/** @internal */
toJSON(): ClientRequestContextProps;
}

@@ -39,0 +55,0 @@ /** Serialized format for sending the client request context across the RPC layer

17

lib/ClientRequestContext.js

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

/** Create a new ClientRequestContext */
constructor(activityId = Id_1.Guid.createValue(), applicationId = "", applicationVersion = "", sessionId = "") {
constructor(activityId = Id_1.Guid.createValue(), applicationId = "", applicationVersion = "", sessionId = Id_1.Guid.empty) {
this.activityId = activityId;

@@ -38,8 +38,13 @@ this.applicationId = applicationId;

}
get useContextForRpc() {
return this._useContextForRpc;
get useContextForRpc() { return this._useContextForRpc; }
set useContextForRpc(value) { this._useContextForRpc = value; }
/** @internal */
toJSON() {
return {
activityId: this.activityId,
applicationId: this.applicationId,
applicationVersion: this.applicationVersion,
sessionId: this.sessionId,
};
}
set useContextForRpc(value) {
this._useContextForRpc = value;
}
}

@@ -46,0 +51,0 @@ ClientRequestContext._current = new ClientRequestContext();

@@ -43,3 +43,3 @@ /** @module Utils */

/** Disposes of and empties a list of disposable objects.
* @param list The list of disposable obejcts.
* @param list The list of disposable objects.
* @returns undefined

@@ -46,0 +46,0 @@ * @public

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

/** Disposes of and empties a list of disposable objects.
* @param list The list of disposable obejcts.
* @param list The list of disposable objects.
* @returns undefined

@@ -36,0 +36,0 @@ * @public

@@ -109,4 +109,8 @@ /** @module Ids */

function iterate(arg: Id64Arg, callback: (id: Id64String) => boolean): boolean;
/** Return the first [[Id64String]] of an [[Id64Arg]]. */
function getFirst(arg: Id64Arg): Id64String;
/** Return the number of [[Id64String]]s represented by an [[Id64Arg]]. */
function sizeOf(arg: Id64Arg): number;
/** Returns true if the [[Id64Arg]] contains the specified Id. */
function has(arg: Id64Arg, id: Id64String): boolean;
/** The string representation of an invalid Id. */

@@ -169,2 +173,4 @@ const invalid = "0";

addId(id: Id64String): void;
/** Add any number of Ids to the set. */
addIds(ids: Id64Arg): void;
/** Returns true if the set contains the specified Id. */

@@ -174,2 +180,8 @@ hasId(id: Id64String): boolean;

add(low: number, high: number): void;
/** Remove an Id from the set. */
deleteId(id: Id64String): void;
/** Remove any number of Ids from the set. */
deleteIds(ids: Id64Arg): void;
/** Remove an Id from the set. */
delete(low: number, high: number): void;
/** Returns true if the set contains the specified Id. */

@@ -231,2 +243,4 @@ has(low: number, high: number): boolean;

export declare namespace Guid {
/** Represents the empty Guid 00000000-0000-0000-0000-000000000000 */
const empty: GuidString;
/** Determine whether the input string is "guid-like". That is, it follows the 8-4-4-4-12 pattern. This does not enforce

@@ -233,0 +247,0 @@ * that the string is actually in valid UUID format.

@@ -298,12 +298,21 @@ "use strict";

Id64.iterate = iterate;
/** Return the first [[Id64String]] of an [[Id64Arg]]. */
function getFirst(arg) {
return typeof arg === "string" ? arg : (Array.isArray(arg) ? arg[0] : arg.values().next().value);
}
Id64.getFirst = getFirst;
/** Return the number of [[Id64String]]s represented by an [[Id64Arg]]. */
function sizeOf(arg) {
return typeof arg === "string" ? 1 : (Array.isArray(arg) ? arg.length : arg.size);
}
Id64.sizeOf = sizeOf;
/** Returns true if the [[Id64Arg]] contains the specified Id. */
function has(arg, id) {
if (typeof arg === "string")
return 1;
else if (Array.isArray(arg))
return arg.length;
else
return arg.size;
return arg === id;
if (Array.isArray(arg))
return -1 !== arg.indexOf(id);
return arg.has(id);
}
Id64.sizeOf = sizeOf;
Id64.has = has;
/** The string representation of an invalid Id. */

@@ -339,3 +348,3 @@ Id64.invalid = "0";

const len = id.length;
if (0 === len)
if (0 === len || 18 < len)
return false;

@@ -405,8 +414,16 @@ if ("0" !== id[0])

if (undefined !== ids)
Id64.forEach(ids, (id) => this.addId(id));
this.addIds(ids);
}
/** Remove all contents of this set. */
clear() { this._map.clear(); }
clear() {
this._map.clear();
}
/** Add an Id to the set. */
addId(id) { this.add(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }
addId(id) {
this.add(Id64.getLowerUint32(id), Id64.getUpperUint32(id));
}
/** Add any number of Ids to the set. */
addIds(ids) {
Id64.forEach(ids, (id) => this.addId(id));
}
/** Returns true if the set contains the specified Id. */

@@ -423,2 +440,16 @@ hasId(id) { return this.has(Id64.getLowerUint32(id), Id64.getUpperUint32(id)); }

}
/** Remove an Id from the set. */
deleteId(id) {
this.delete(Id64.getLowerUint32(id), Id64.getUpperUint32(id));
}
/** Remove any number of Ids from the set. */
deleteIds(ids) {
Id64.forEach(ids, (id) => this.deleteId(id));
}
/** Remove an Id from the set. */
delete(low, high) {
const set = this._map.get(high);
if (undefined !== set)
set.delete(low);
}
/** Returns true if the set contains the specified Id. */

@@ -532,2 +563,4 @@ has(low, high) {

const uuidPattern = new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
/** Represents the empty Guid 00000000-0000-0000-0000-000000000000 */
Guid.empty = "00000000-0000-0000-0000-000000000000";
/** Determine whether the input string is "guid-like". That is, it follows the 8-4-4-4-12 pattern. This does not enforce

@@ -534,0 +567,0 @@ * that the string is actually in valid UUID format.

@@ -13,3 +13,3 @@ /** @module Collections */

}
/** The interface that must be satisified by the underlying container type used by a LRUCache.
/** The interface that must be satisfied by the underlying container type used by a LRUCache.
* Compatible with a [[Dictionary]] or a standard Map.

@@ -16,0 +16,0 @@ * @public

@@ -49,2 +49,3 @@ /******/ (function(modules) { // webpackBootstrap

/******/ }
/******/
/******/ return result;

@@ -51,0 +52,0 @@ /******/ }

{
"name": "@bentley/bentleyjs-core",
"version": "0.191.0",
"version": "1.0.0",
"description": "Bentley JavaScript core components",

@@ -42,4 +42,4 @@ "main": "lib/bentleyjs-core.js",

"devDependencies": {
"@bentley/build-tools": "0.191.0",
"@bentley/webpack-tools": "0.191.0",
"@bentley/build-tools": "1.0.0",
"@bentley/webpack-tools": "1.0.0",
"@types/chai": "^4.1.4",

@@ -53,3 +53,2 @@ "@types/mocha": "^5.2.5",

"tslint-etc": "^1.5.2",
"typedoc": "^0.14.2",
"typescript": "~3.2.2",

@@ -56,0 +55,0 @@ "ts-node": "^7.0.1",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc