@itwin/core-common 4.8.0-dev.11 → 4.8.0-dev.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/IModelError.d.ts +37 -0
- package/lib/cjs/IModelError.d.ts.map +1 -1
- package/lib/cjs/IModelError.js +27 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/esm/IModelError.d.ts +37 -0
- package/lib/esm/IModelError.d.ts.map +1 -1
- package/lib/esm/IModelError.js +26 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/package.json +6 -6
package/lib/cjs/IModelError.d.ts
CHANGED
|
@@ -16,6 +16,43 @@ export type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | Briefc
|
|
|
16
16
|
export declare class IModelError extends BentleyError {
|
|
17
17
|
constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData);
|
|
18
18
|
}
|
|
19
|
+
/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare enum LockState {
|
|
23
|
+
/** The element is not locked */
|
|
24
|
+
None = 0,
|
|
25
|
+
/** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
|
|
26
|
+
Shared = 1,
|
|
27
|
+
/** A Lock that permits modifications to an element and blocks other users from making modifications to it.
|
|
28
|
+
* Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
|
|
29
|
+
*/
|
|
30
|
+
Exclusive = 2
|
|
31
|
+
}
|
|
32
|
+
/** Detailed information about a particular object Lock that is causing the Lock update conflict.
|
|
33
|
+
* An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export interface ConflictingLock {
|
|
37
|
+
/** Id of the object that is causing conflict. */
|
|
38
|
+
objectId: string;
|
|
39
|
+
/**
|
|
40
|
+
* The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.
|
|
41
|
+
* See {@link LockState}.
|
|
42
|
+
*/
|
|
43
|
+
state: LockState;
|
|
44
|
+
/** An array of Briefcase ids that hold this lock. */
|
|
45
|
+
briefcaseIds: number[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* An error raised when there is a lock conflict detected.
|
|
49
|
+
* Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare class ConflictingLocksError extends IModelError {
|
|
53
|
+
conflictingLocks?: ConflictingLock[];
|
|
54
|
+
constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]);
|
|
55
|
+
}
|
|
19
56
|
/** @public */
|
|
20
57
|
export declare class ServerError extends IModelError {
|
|
21
58
|
constructor(errorNumber: number, message: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAmB,YAAY,EAAE,eAAe,EACxH,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAC,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAE3F;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WAAW;;CAI9C"}
|
package/lib/cjs/IModelError.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module iModels
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.NoContentError = exports.ChannelConstraintError = exports.BackendError = exports.ServerTimeoutError = exports.ServerError = exports.IModelError = exports.ChangeSetStatus = exports.DbResult = exports.BriefcaseStatus = exports.IModelStatus = exports.BentleyError = exports.BentleyStatus = void 0;
|
|
10
|
+
exports.NoContentError = exports.ChannelConstraintError = exports.BackendError = exports.ServerTimeoutError = exports.ServerError = exports.ConflictingLocksError = exports.LockState = exports.IModelError = exports.ChangeSetStatus = exports.DbResult = exports.BriefcaseStatus = exports.IModelStatus = exports.BentleyError = exports.BentleyStatus = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
var core_bentley_2 = require("@itwin/core-bentley");
|
|
13
13
|
Object.defineProperty(exports, "BentleyStatus", { enumerable: true, get: function () { return core_bentley_2.BentleyStatus; } });
|
|
@@ -26,6 +26,32 @@ class IModelError extends core_bentley_1.BentleyError {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
exports.IModelError = IModelError;
|
|
29
|
+
/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
var LockState;
|
|
33
|
+
(function (LockState) {
|
|
34
|
+
/** The element is not locked */
|
|
35
|
+
LockState[LockState["None"] = 0] = "None";
|
|
36
|
+
/** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
|
|
37
|
+
LockState[LockState["Shared"] = 1] = "Shared";
|
|
38
|
+
/** A Lock that permits modifications to an element and blocks other users from making modifications to it.
|
|
39
|
+
* Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
|
|
40
|
+
*/
|
|
41
|
+
LockState[LockState["Exclusive"] = 2] = "Exclusive";
|
|
42
|
+
})(LockState || (exports.LockState = LockState = {}));
|
|
43
|
+
/**
|
|
44
|
+
* An error raised when there is a lock conflict detected.
|
|
45
|
+
* Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
class ConflictingLocksError extends IModelError {
|
|
49
|
+
constructor(message, getMetaData, conflictingLocks) {
|
|
50
|
+
super(core_bentley_1.IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);
|
|
51
|
+
this.conflictingLocks = conflictingLocks;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.ConflictingLocksError = ConflictingLocksError;
|
|
29
55
|
/** @public */
|
|
30
56
|
class ServerError extends IModelError {
|
|
31
57
|
constructor(errorNumber, message) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAE7B,oDAE6B;AAD3B,6GAAA,aAAa,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,+GAAA,eAAe,OAAA;AAAE,wGAAA,QAAQ,OAAA;AAAE,+GAAA,eAAe,OAAA;AAWvF;;;GAGG;AACH,MAAa,WAAY,SAAQ,2BAAY;IAC3C,YAAmB,WAAuC,EAAE,OAAe,EAAE,WAA6B;QACxG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AAJD,kCAIC;AAED,cAAc;AACd,MAAa,WAAY,SAAQ,WAAW;IAC1C,YAAmB,WAAmB,EAAE,OAAe;QACrD,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,iBAAiB,WAAW,GAAG,CAAC;IAC9C,CAAC;CACF;AALD,kCAKC;AAED,cAAc;AACd,MAAa,kBAAmB,SAAQ,WAAW;IACjD,YAAmB,OAAe;QAChC,KAAK,CAAC,2BAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,gDAKC;AAED,cAAc;AACd,MAAa,YAAa,SAAQ,WAAW;IAC3C,YAAmB,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,WAA6B;QAClG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AALD,oCAKC;AAED;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,WAAW;IACrD,YAAmB,OAAe,EAAE,WAA6B;QAC/D,KAAK,CAAC,+BAAgB,CAAC,0BAA0B,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC;CACF;AAJD,wDAIC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,2BAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF;AAJD,wCAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelStatus, LoggingMetaData, RepositoryStatus,\n} from \"@itwin/core-bentley\";\n\nexport {\n BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus,\n} from \"@itwin/core-bentley\";\n\nexport type {GetMetaDataFunction, LogFunction, LoggingMetaData} from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/**\n * Channel constraint error\n * @alpha\n */\nexport class ChannelConstraintError extends IModelError {\n public constructor(message: string, getMetaData?: LoggingMetaData) {\n super(RepositoryStatus.ChannelConstraintViolation, message, getMetaData);\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"No Content\");\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAE7B,oDAE6B;AAD3B,6GAAA,aAAa,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,+GAAA,eAAe,OAAA;AAAE,wGAAA,QAAQ,OAAA;AAAE,+GAAA,eAAe,OAAA;AAWvF;;;GAGG;AACH,MAAa,WAAY,SAAQ,2BAAY;IAC3C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a,sBAAuB,SAAQ,WAAW;IACrD,YAAmB,OAAe,EAAE,WAA6B;QAC/D,KAAK,CAAC,+BAAgB,CAAC,0BAA0B,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC;CACF;AAJD,wDAIC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,2BAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF;AAJD,wCAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData, RepositoryStatus,\n} from \"@itwin/core-bentley\";\n\nexport {\n BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus,\n} from \"@itwin/core-bentley\";\n\nexport type {GetMetaDataFunction, LogFunction, LoggingMetaData} from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @public\n*/\nexport interface ConflictingLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @public\n */\nexport class ConflictingLocksError extends IModelError {\n public conflictingLocks?: ConflictingLock[];\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\n this.conflictingLocks = conflictingLocks;\n }\n\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/**\n * Channel constraint error\n * @alpha\n */\nexport class ChannelConstraintError extends IModelError {\n public constructor(message: string, getMetaData?: LoggingMetaData) {\n super(RepositoryStatus.ChannelConstraintViolation, message, getMetaData);\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"No Content\");\n }\n}\n"]}
|
package/lib/esm/IModelError.d.ts
CHANGED
|
@@ -16,6 +16,43 @@ export type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | Briefc
|
|
|
16
16
|
export declare class IModelError extends BentleyError {
|
|
17
17
|
constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData);
|
|
18
18
|
}
|
|
19
|
+
/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare enum LockState {
|
|
23
|
+
/** The element is not locked */
|
|
24
|
+
None = 0,
|
|
25
|
+
/** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
|
|
26
|
+
Shared = 1,
|
|
27
|
+
/** A Lock that permits modifications to an element and blocks other users from making modifications to it.
|
|
28
|
+
* Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
|
|
29
|
+
*/
|
|
30
|
+
Exclusive = 2
|
|
31
|
+
}
|
|
32
|
+
/** Detailed information about a particular object Lock that is causing the Lock update conflict.
|
|
33
|
+
* An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export interface ConflictingLock {
|
|
37
|
+
/** Id of the object that is causing conflict. */
|
|
38
|
+
objectId: string;
|
|
39
|
+
/**
|
|
40
|
+
* The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.
|
|
41
|
+
* See {@link LockState}.
|
|
42
|
+
*/
|
|
43
|
+
state: LockState;
|
|
44
|
+
/** An array of Briefcase ids that hold this lock. */
|
|
45
|
+
briefcaseIds: number[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* An error raised when there is a lock conflict detected.
|
|
49
|
+
* Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare class ConflictingLocksError extends IModelError {
|
|
53
|
+
conflictingLocks?: ConflictingLock[];
|
|
54
|
+
constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]);
|
|
55
|
+
}
|
|
19
56
|
/** @public */
|
|
20
57
|
export declare class ServerError extends IModelError {
|
|
21
58
|
constructor(errorNumber: number, message: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAmB,YAAY,EAAE,eAAe,EACxH,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAC,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAE3F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,eAAe,CAAC;AAE5G;;;GAGG;AACH,qBAAa,WAAY,SAAQ,YAAY;gBACxB,WAAW,EAAE,iBAAiB,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAG3G;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,gCAAgC;IAChC,IAAI,IAAI;IACR,mJAAmJ;IACnJ,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAI;CACd;AAED;;;EAGE;AACF,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;SAGK;IACL,KAAK,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IAC7C,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;gBAChC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAE,eAAe,EAAE;CAKjG;AAED,cAAc;AACd,qBAAa,WAAY,SAAQ,WAAW;gBACvB,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIxD;AAED,cAAc;AACd,qBAAa,kBAAmB,SAAQ,WAAW;gBAC9B,OAAO,EAAE,MAAM;CAInC;AAED,cAAc;AACd,qBAAa,YAAa,SAAQ,WAAW;gBACxB,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAIrG;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;gBAClC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAGlE;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;;CAI9C"}
|
package/lib/esm/IModelError.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module iModels
|
|
7
7
|
*/
|
|
8
|
-
import { BentleyError, IModelStatus, RepositoryStatus, } from "@itwin/core-bentley";
|
|
8
|
+
import { BentleyError, IModelHubStatus, IModelStatus, RepositoryStatus, } from "@itwin/core-bentley";
|
|
9
9
|
export { BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus, } from "@itwin/core-bentley";
|
|
10
10
|
/** The error type thrown by this module.
|
|
11
11
|
* @see [[IModelErrorNumber]] for commonly-used error codes.
|
|
@@ -16,6 +16,31 @@ export class IModelError extends BentleyError {
|
|
|
16
16
|
super(errorNumber, message, getMetaData);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export var LockState;
|
|
23
|
+
(function (LockState) {
|
|
24
|
+
/** The element is not locked */
|
|
25
|
+
LockState[LockState["None"] = 0] = "None";
|
|
26
|
+
/** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
|
|
27
|
+
LockState[LockState["Shared"] = 1] = "Shared";
|
|
28
|
+
/** A Lock that permits modifications to an element and blocks other users from making modifications to it.
|
|
29
|
+
* Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
|
|
30
|
+
*/
|
|
31
|
+
LockState[LockState["Exclusive"] = 2] = "Exclusive";
|
|
32
|
+
})(LockState || (LockState = {}));
|
|
33
|
+
/**
|
|
34
|
+
* An error raised when there is a lock conflict detected.
|
|
35
|
+
* Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export class ConflictingLocksError extends IModelError {
|
|
39
|
+
constructor(message, getMetaData, conflictingLocks) {
|
|
40
|
+
super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);
|
|
41
|
+
this.conflictingLocks = conflictingLocks;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
19
44
|
/** @public */
|
|
20
45
|
export class ServerError extends IModelError {
|
|
21
46
|
constructor(errorNumber, message) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,YAAY,EAA6D,YAAY,EAAmB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,YAAY,EAA6D,eAAe,EAAE,YAAY,EAAmB,gBAAgB,GAC1I,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAU7B;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,YAAY;IAC3C,YAAmB,WAAuC,EAAE,OAAe,EAAE,WAA6B;QACxG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,gCAAgC;IAChC,yCAAQ,CAAA;IACR,mJAAmJ;IACnJ,6CAAU,CAAA;IACV;;OAEG;IACH,mDAAa,CAAA;AACf,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAkBD;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IAEpD,YAAY,OAAe,EAAE,WAA6B,EAAE,gBAAoC;QAC9F,KAAK,CAAC,eAAe,CAAC,2BAA2B,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;CAEF;AAED,cAAc;AACd,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C,YAAmB,WAAmB,EAAE,OAAe;QACrD,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,iBAAiB,WAAW,GAAG,CAAC;IAC9C,CAAC;CACF;AAED,cAAc;AACd,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACjD,YAAmB,OAAe;QAChC,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,cAAc;AACd,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,YAAmB,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,WAA6B;QAClG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,WAAW;IACrD,YAAmB,OAAe,EAAE,WAA6B;QAC/D,KAAK,CAAC,gBAAgB,CAAC,0BAA0B,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData, RepositoryStatus,\n} from \"@itwin/core-bentley\";\n\nexport {\n BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus,\n} from \"@itwin/core-bentley\";\n\nexport type {GetMetaDataFunction, LogFunction, LoggingMetaData} from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @public\n*/\nexport interface ConflictingLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @public\n */\nexport class ConflictingLocksError extends IModelError {\n public conflictingLocks?: ConflictingLock[];\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\n this.conflictingLocks = conflictingLocks;\n }\n\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/**\n * Channel constraint error\n * @alpha\n */\nexport class ChannelConstraintError extends IModelError {\n public constructor(message: string, getMetaData?: LoggingMetaData) {\n super(RepositoryStatus.ChannelConstraintViolation, message, getMetaData);\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"No Content\");\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-common",
|
|
3
|
-
"version": "4.8.0-dev.
|
|
3
|
+
"version": "4.8.0-dev.13",
|
|
4
4
|
"description": "iTwin.js components common to frontend and backend",
|
|
5
5
|
"main": "lib/cjs/core-common.js",
|
|
6
6
|
"module": "lib/esm/core-common.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"js-base64": "^3.6.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@itwin/core-bentley": "^4.8.0-dev.
|
|
31
|
-
"@itwin/core-geometry": "^4.8.0-dev.
|
|
30
|
+
"@itwin/core-bentley": "^4.8.0-dev.13",
|
|
31
|
+
"@itwin/core-geometry": "^4.8.0-dev.13"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@itwin/eslint-plugin": "^4.0.2",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"nyc": "^15.1.0",
|
|
44
44
|
"rimraf": "^3.0.2",
|
|
45
45
|
"typescript": "~5.3.3",
|
|
46
|
-
"@itwin/build-tools": "4.8.0-dev.
|
|
47
|
-
"@itwin/core-
|
|
48
|
-
"@itwin/core-
|
|
46
|
+
"@itwin/build-tools": "4.8.0-dev.13",
|
|
47
|
+
"@itwin/core-geometry": "4.8.0-dev.13",
|
|
48
|
+
"@itwin/core-bentley": "4.8.0-dev.13"
|
|
49
49
|
},
|
|
50
50
|
"nyc": {
|
|
51
51
|
"extends": "./node_modules/@itwin/build-tools/.nycrc",
|