@itwin/core-bentley 5.0.0-dev.32 → 5.0.0-dev.34

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.
@@ -118,6 +118,7 @@ export var CompressedId64Set;
118
118
  CompressedId64Set.compressIds = compressIds;
119
119
  /** This exists strictly for the purposes of compressed sets of 64-bit Ids, to avoid the overhead of BigInt for handling 64-bit integers. */
120
120
  class Uint64 {
121
+ static { this._base = 0x100000000; }
121
122
  static assertUint32(num) {
122
123
  assert(num >= 0);
123
124
  assert(num < Uint64._base);
@@ -179,7 +180,6 @@ export var CompressedId64Set;
179
180
  return Id64.fromUint32Pair(this.lower, this.upper);
180
181
  }
181
182
  }
182
- Uint64._base = 0x100000000;
183
183
  /** Supplies an iterator over the [[Id64String]]s in a [[CompressedId64Set]].
184
184
  * The Ids are iterated in ascending order based on their unsigned 64-bit integer values.
185
185
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CompressedId64Set.js","sourceRoot":"","sources":["../../src/CompressedId64Set.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAkC,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C;;;;;;;;GAQG;AACH,MAAM,KAAW,iBAAiB,CAoUjC;AApUD,WAAiB,iBAAiB;IAChC,SAAS,UAAU,CAAC,EAAU;QAC5B,gBAAgB;QAChB,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;QAEX,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,SAAS,YAAY,CAAC,SAA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BAChB,OAAO,IAAI,CAAC;YAEd,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAC3B,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC;QACtB,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ;YAC3B,OAAO,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC;QAE5B,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,mBAAmB,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvD,CAAC;IAED,IAAY,QAAQ;QAClB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC3D,CAAC;IAEO,SAAS;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO;QAET,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5G,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7G,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,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 Ids\n */\n\nimport { assert } from \"./Assert\";\nimport { Id64, Id64Array, Id64Set, Id64String } from \"./Id\";\nimport { OrderedId64Iterable } from \"./OrderedId64Iterable\";\nimport { SortedArray } from \"./SortedArray\";\n\n/** @public */\nexport type CompressedId64Set = string;\n\n/** A compact string representation of an [[Id64Set]]. Such a representation is useful when serializing potentially very large\n * sets of Ids.\n * @see [[CompressedId64Set.iterable]] to efficiently iterate the Ids represented by a compact string.\n * @see [[CompressedId64Set.compressSet]] and [[CompressedId64Set.compressArray]] to produce a compact string from a collection of Ids.\n * @see [[CompressedId64Set.decompressSet]] and [[CompressedId64Set.decompressArray]] to produce a collection of Ids from a compact string.\n * @see [[OrderedId64Iterable]] for a generic representation of an ordered set of Ids (compressed or otherwise).\n * @see [[MutableCompressedId64Set]] for a mutable version.\n * @public\n */\nexport namespace CompressedId64Set { // eslint-disable-line @typescript-eslint/no-redeclare\n function isHexDigit(ch: number): boolean {\n // ascii values:\n // '0' = 48\n // '9' = 57\n // 'a' = 65\n // 'f' = 70\n\n return (ch >= 48 && ch <= 57) || (ch >= 65 && ch <= 70);\n }\n\n function compactRange(increment: Uint64, length: number): string {\n assert(length > 0);\n const inc = `+${increment.toString()}`;\n if (length <= 1)\n return inc;\n\n const len = length.toString(16).toUpperCase();\n return `${inc}*${len}`;\n }\n\n /** Given a set of [[Id64String]]s, produce a compact string representation. Useful when serializing potentially large sets of Ids.\n * @note Invalid Ids are ignored.\n * @see [[CompressedId64Set.sortAndCompress]] to compress any unordered collection of Ids.\n * @see [[CompressedId64Set.compressArray]] to perform the same operation on an [[Id64Array]].\n * @see [[CompressedId64Set.decompressSet]] to perform the inverse operation.\n */\n export function compressSet(ids: Id64Set): CompressedId64Set {\n return sortAndCompress(ids);\n }\n\n /** Create a sorted array from `ids`, then return a compact string representation of those Ids.\n * @see [[CompressedId64Set.compressIds]] if `ids` is known to already be sorted.\n */\n export function sortAndCompress(ids: Iterable<Id64String>): CompressedId64Set {\n // `string` is an Iterable<string>. In that case assume caller passed a single Id64String.\n const arr = typeof ids === \"string\" ? [ids] : Array.from(ids);\n OrderedId64Iterable.sortArray(arr);\n return compressArray(arr);\n }\n\n /** Give a **numerically-ordered** array of [[Id64String]]s, produce a compact string representation. Useful when serializing potentially large sets of Ids.\n * Duplicate Ids are included only once in the string representation.\n * @throws Error if two consecutive Ids `x` and `y` exist such that the numerical value of `x` is greater than that of `y` - i.e., the array is not properly sorted.\n * @note The array must be sorted according to the 64-bit numerical value of each Id.\n * @note Invalid Ids are ignored.\n * @see [[CompressedId64Set.decompressArray]] to perform the inverse operation.\n * @see [[OrderedId64Iterable.sortArray]] to ensure the Ids are properly sorted.\n * @see [[CompressedId64Set.sortAndCompress]] to compress any unordered collection of Ids.\n */\n export function compressArray(ids: Id64Array): CompressedId64Set {\n return compressIds(ids);\n }\n\n /** Give a **numerically-ordered** collection of [[Id64String]]s, produce a compact string representation. Useful when serializing potentially large sets of Ids.\n * Duplicate Ids are included only once in the string representation.\n * @throws Error if two consecutive Ids `x` and `y` exist such that the numerical value of `x` is greater than that of `y` - i.e., the collection is not properly sorted.\n * @note The collection must be sorted according to the 64-bit numerical value of each Id.\n * @note Invalid Ids are ignored.\n * @see [[CompressedId64Set.iterable]] to perform the inverse operation.\n * @see [[OrderedId64Iterable.sortArray]] or [[OrderedId64Iterable.compare]] to ensure the Ids are properly sorted.\n * @see [[CompressedId64Set.sortAndCompress]] to compress any unordered collection of Ids.\n */\n export function compressIds(ids: OrderedId64Iterable): CompressedId64Set {\n if (\"string\" === typeof ids)\n return ids;\n\n let str = \"\";\n\n const prevId = new Uint64();\n const rangeIncrement = new Uint64();\n let rangeLen = 0;\n\n const curId = new Uint64();\n const curIncrement = new Uint64();\n for (const id of ids) {\n if (!Id64.isValidId64(id))\n continue; // ignore garbage and invalid Ids (\"0\")\n\n curId.setFromId(id);\n curIncrement.setFromDifference(curId, prevId);\n\n const cmp = prevId.compare(curId);\n if (0 === cmp)\n continue; // ignore duplicates\n else if (cmp > 0)\n throw new Error(\"CompressedId64Set.compressArray requires a sorted array as input\");\n\n prevId.copyFrom(curId);\n\n if (0 === rangeLen) {\n rangeIncrement.copyFrom(curIncrement);\n rangeLen = 1;\n } else if (curIncrement.equals(rangeIncrement)) {\n ++rangeLen;\n } else {\n str += compactRange(rangeIncrement, rangeLen);\n rangeIncrement.copyFrom(curIncrement);\n rangeLen = 1;\n }\n }\n\n if (0 < rangeLen)\n str += compactRange(rangeIncrement, rangeLen);\n\n return str;\n }\n\n /** This exists strictly for the purposes of compressed sets of 64-bit Ids, to avoid the overhead of BigInt for handling 64-bit integers. */\n class Uint64 implements Id64.Uint32Pair {\n private static readonly _base = 0x100000000;\n\n private static assertUint32(num: number): void {\n assert(num >= 0);\n assert(num < Uint64._base);\n assert(Math.floor(num) === num);\n }\n\n private assertConstraints(): void {\n Uint64.assertUint32(this.lower);\n Uint64.assertUint32(this.upper);\n }\n\n constructor(public lower = 0, public upper = 0) {\n this.assertConstraints();\n }\n\n public compare(rhs: Uint64): number {\n const diff = this.upper - rhs.upper;\n return 0 === diff ? this.lower - rhs.lower : diff;\n }\n\n public equals(rhs: Uint64): boolean { return 0 === this.compare(rhs); }\n public isLessThan(rhs: Uint64): boolean { return this.compare(rhs) < 0; }\n public isGreaterThan(rhs: Uint64): boolean { return this.compare(rhs) > 0; }\n\n public get isZero(): boolean { return 0 === this.lower && 0 === this.upper; }\n\n public setFromDifference(lhs: Uint64, rhs: Uint64): void {\n assert(!rhs.isGreaterThan(lhs));\n\n this.lower = lhs.lower - rhs.lower;\n this.upper = lhs.upper - rhs.upper;\n if (this.lower < 0) {\n this.lower += Uint64._base;\n this.upper -= 1;\n }\n }\n\n public add(rhs: Uint64): void {\n let lower = rhs.lower;\n let upper = rhs.upper;\n if (lower + this.lower >= Uint64._base) {\n lower -= Uint64._base;\n upper += 1;\n }\n\n this.lower += lower;\n this.upper += upper;\n this.assertConstraints();\n }\n\n public setFromId(id: Id64String): void {\n Id64.getUint32Pair(id, this);\n }\n\n public copyFrom(other: Uint64): void {\n this.lower = other.lower;\n this.upper = other.upper;\n }\n\n public toString(): string {\n if (0 === this.upper)\n return this.lower.toString(16).toUpperCase();\n\n const upper = this.upper.toString(16);\n const lower = this.lower.toString(16).padStart(8, \"0\");\n assert(lower.length === 8);\n return `${upper}${lower}`.toUpperCase();\n }\n\n public toId64String(): string {\n return Id64.fromUint32Pair(this.lower, this.upper);\n }\n }\n\n /** Supplies an iterator over the [[Id64String]]s in a [[CompressedId64Set]].\n * The Ids are iterated in ascending order based on their unsigned 64-bit integer values.\n */\n export function* iterator(ids: CompressedId64Set): Iterator<Id64String> {\n if (0 === ids.length)\n return; // empty set.\n\n if (\"+\" !== ids[0])\n throw new Error(\"Invalid CompressedId64Set\");\n\n let curIndex = 1; // skip the leading '+'\n const curId = new Uint64();\n\n function parseUint32(): number {\n let value = 0;\n let nChars = 0;\n while (curIndex < ids.length && nChars < 8) {\n ++nChars;\n const ch = ids.charCodeAt(curIndex);\n if (!isHexDigit(ch))\n break; // not a hex digit in [0..9] or [A..F]\n\n value <<= 4;\n value |= (ch >= 65 ? ch - 65 + 10 : ch - 48); // ch - 'A' + 10 or ch - '0'\n value = value >>> 0; // restore unsignedness because silly javascript.\n ++curIndex;\n }\n\n return value;\n }\n\n function parseUint64(uint64: Uint64): void {\n let lower = 0;\n let upper = 0;\n\n // Read up to the first 8 digits.\n const startIndex = curIndex;\n const first = parseUint32();\n\n const nFirstDigits = curIndex - startIndex;\n assert(nFirstDigits <= 8);\n\n if (8 === nFirstDigits && curIndex + 1 < ids.length && isHexDigit(ids.charCodeAt(curIndex + 1))) {\n // We've got up to 8 more digits remaining\n const secondIndex = curIndex;\n const second = parseUint32();\n\n // Transfer excess digits from upper to lower.\n const nSecondDigits = curIndex - secondIndex;\n assert(nSecondDigits > 0 && nSecondDigits <= 8);\n\n const nDigitsToTransfer = 8 - nSecondDigits;\n upper = first >>> (4 * nDigitsToTransfer);\n const transfer = first - ((upper << (4 * nDigitsToTransfer)) >>> 0);\n lower = (second | ((transfer << (4 * nSecondDigits)) >>> 0)) >>> 0;\n } else {\n lower = first;\n }\n\n uint64.lower = lower;\n uint64.upper = upper;\n }\n\n const increment = new Uint64();\n while (curIndex < ids.length) {\n let multiplier = 1;\n parseUint64(increment);\n if (increment.isZero)\n throw new Error(\"Invalid CompressedId64Set\");\n\n if (curIndex < ids.length) {\n switch (ids[curIndex++]) {\n case \"*\":\n multiplier = parseUint32();\n if (0 === multiplier)\n throw new Error(\"Invalid CompressedId64Set\");\n\n if (curIndex !== ids.length && ids[curIndex++] !== \"+\")\n return;\n\n break;\n case \"+\":\n break;\n default:\n throw new Error(\"Invalid CompressedId64Set\");\n }\n }\n\n for (let i = 0; i < multiplier; i++) {\n curId.add(increment);\n yield curId.toId64String();\n }\n }\n }\n\n /** Supplies an iterable over the [[Id64String]]s in a [[CompressedId64Set]].\n * The Ids are iterated in ascending order based on their unsigned 64-bit integer values.\n */\n export function iterable(ids: CompressedId64Set): OrderedId64Iterable {\n return {\n [Symbol.iterator]: () => iterator(ids),\n };\n }\n\n /** Decompress the compact string representation of an [[Id64Set]] into an [[Id64Set]].\n * @param compressedIds The compact string representation.\n * @param out If supplied, the Ids will be inserted into this set rather than allocating and returning a new set.\n * @returns The set containing the decompressed Ids.\n * @throws Error if `compressedIds` is not a well-formed [[CompressedId64Set]].\n * @see [[CompressedId64Set.compressSet]] to perform the inverse operation.\n * @see [[CompressedId64Set.decompressArray]] to decompress as an [[Id64Array]] instead.\n * @see [[CompressedId64Set.iterable]] to efficiently iterate the Ids.\n */\n export function decompressSet(compressedIds: CompressedId64Set, out?: Id64Set): Id64Set {\n const set = out ?? new Set<string>();\n for (const id of iterable(compressedIds))\n set.add(id);\n\n return set;\n }\n\n /** Decompress the compact string representation of an [[Id64Set]] into an [[Id64Array]].\n * @param compressedIds The compact string representation.\n * @param out If supplied, the Ids will be appended to this array rather than allocating and returning a new array.\n * @returns The array containing the decompressed Ids.\n * @throws Error if `compressedIds` is not a well-formed [[CompressedId64Set]].\n * @note The Ids are decompressed and appended to the array in ascending order based on their 64-bit numerical values.\n * @see [[CompressedId64Set.compressArray]] to perform the inverse operation.\n * @see [[CompressedId64Set.decompressSet]] to decompress as an [[Id64Set]] instead.\n * @see [[CompressedId64Set.iterable]] to efficiently iterate the Ids.\n */\n export function decompressArray(compressedIds: CompressedId64Set, out?: Id64Array): Id64Array {\n const arr = out ?? [];\n for (const id of iterable(compressedIds))\n arr.push(id);\n\n return arr;\n }\n}\n\n/** A [[SortedArray]] of unique [[Id64String]]s sorted in ascending order by the 64-bit unsigned integer values of the Ids.\n * @see [[CompressedId64Set]] for an immutable compact string representation.\n * @public\n */\nexport class OrderedId64Array extends SortedArray<Id64String> {\n /** Construct a new, empty array. */\n public constructor() {\n super((lhs, rhs) => OrderedId64Iterable.compare(lhs, rhs));\n }\n\n /** An iterable that iterates over the Ids in sorted order. */\n public get ids(): OrderedId64Iterable { return this._array; }\n\n /** The underlying array of Ids. */\n public get array(): ReadonlyArray<Id64String> { return this._array; }\n}\n\n/** A mutable set of valid [[Id64String]]s sorted in ascending order by the 64-bit unsigned integer value of the Ids.\n * Internally the set of Ids is maintained as a [[CompressedId64Set]] string representation.\n * Insertions and removals are buffered until the string representation needs to be recomputed. The string representation is recomputed by every public method except [[add]] and [[delete]] -\n * therefore, if multiple removals and/or insertions are required, it is most efficient to perform them all before invoking other methods.\n * @public\n */\nexport class MutableCompressedId64Set implements OrderedId64Iterable {\n private _ids: CompressedId64Set;\n private readonly _inserted = new OrderedId64Array();\n private readonly _deleted = new OrderedId64Array();\n\n /** Construct a new set, optionally initialized to contain the Ids represented by `ids`. */\n public constructor(ids?: CompressedId64Set) {\n this._ids = ids ?? \"\";\n }\n\n /** Obtain the compact string representation of the contents of this set. If any insertions or removals are pending, they will be applied and the string recomputed. */\n public get ids(): CompressedId64Set {\n this.updateIds();\n return this._ids;\n }\n\n /** Add the specified Id to the set.\n * @throws Error if `id` is not a valid [[Id64String]].\n */\n public add(id: Id64String): void {\n if (!Id64.isValidId64(id))\n throw new Error(\"MutableCompressedId64Set.add: invalid Id\");\n\n this._deleted.remove(id);\n this._inserted.insert(id);\n }\n\n /** Remove the specified Id from the set.\n * @throws Error if `id` is not a valid [[Id64String]].\n */\n public delete(id: Id64String): void {\n if (!Id64.isValidId64(id))\n throw new Error(\"MutableCompressedId64Set.delete: invalid Id\");\n\n this._inserted.remove(id);\n this._deleted.insert(id);\n }\n\n /** Remove all Ids from the set. */\n public clear(): void {\n this._ids = \"\";\n this._inserted.clear();\n this._deleted.clear();\n }\n\n /** Remove all Ids from the set, then add the specified Ids. */\n public reset(ids?: CompressedId64Set): void {\n this.clear();\n this._ids = ids ?? \"\";\n }\n\n /** Obtain an iterator over the Ids in this set. The Ids are returned in ascending order based on their unsigned 64-bit integer values. */\n public [Symbol.iterator]() {\n return CompressedId64Set.iterator(this.ids);\n }\n\n /** Compute a compact string representation of the union of this and another set of Ids - i.e., those Ids present in either this and/or the other set. */\n public computeUnion(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set {\n if (this.isEmpty)\n return CompressedId64Set.compressIds(ids);\n else if (OrderedId64Iterable.isEmptySet(ids) || this.equals(ids))\n return this.ids;\n\n return CompressedId64Set.compressIds(OrderedId64Iterable.union(this, ids));\n }\n\n /** Compute a compact string representation of the intersection of this and another set of Ids - i.e., those Ids present in both this and the other set. */\n public computeIntersection(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set {\n if (this.equals(ids))\n return this.ids;\n else if (this.isEmpty || OrderedId64Iterable.isEmptySet(ids))\n return \"\";\n\n return CompressedId64Set.compressIds(OrderedId64Iterable.intersection(this, ids));\n }\n\n /** Compute a compact string representation of the difference between this and another set - i.e., those Ids present in this but not in the other set. */\n public computeDifference(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set {\n if (this.isEmpty || this.equals(ids))\n return \"\";\n\n return CompressedId64Set.compressIds(OrderedId64Iterable.difference(this, ids));\n }\n\n /** Return true if this set contains no Ids. */\n public get isEmpty(): boolean {\n return OrderedId64Iterable.isEmptySet(this.ids);\n }\n\n /** Return true if the set of Ids represented by `other` is identical to those in this set.\n * @note This considers only the **distinct** Ids in `other` - duplicates are ignored.\n */\n public equals(other: CompressedId64Set | MutableCompressedId64Set | OrderedId64Iterable): boolean {\n if (other instanceof MutableCompressedId64Set) {\n if (other === this)\n return true;\n\n if (typeof other !== \"string\")\n other = other.ids;\n }\n\n if (typeof other === \"string\")\n return other === this.ids;\n\n this.updateIds();\n return OrderedId64Iterable.areEqualSets(this, other);\n }\n\n private get _isDirty(): boolean {\n return !this._inserted.isEmpty || !this._deleted.isEmpty;\n }\n\n private updateIds(): void {\n if (!this._isDirty)\n return;\n\n const difference = OrderedId64Iterable.difference(CompressedId64Set.iterable(this._ids), this._deleted.ids);\n const union = { [Symbol.iterator]: () => OrderedId64Iterable.unionIterator(difference, this._inserted.ids) };\n this._ids = CompressedId64Set.compressIds(union);\n\n this._inserted.clear();\n this._deleted.clear();\n }\n}\n"]}
1
+ {"version":3,"file":"CompressedId64Set.js","sourceRoot":"","sources":["../../src/CompressedId64Set.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAkC,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C;;;;;;;;GAQG;AACH,MAAM,KAAW,iBAAiB,CAoUjC;AApUD,WAAiB,iBAAiB;IAChC,SAAS,UAAU,CAAC,EAAU;QAC5B,gBAAgB;QAChB,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;QAEX,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,SAAS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KAAK,IAAI;gBAChB,OAAO,IAAI,CAAC;YAEd,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAC3B,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC;QACtB,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ;YAC3B,OAAO,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC;QAE5B,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,mBAAmB,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvD,CAAC;IAED,IAAY,QAAQ;QAClB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC3D,CAAC;IAEO,SAAS;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO;QAET,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5G,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7G,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,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 Ids\n */\n\nimport { assert } from \"./Assert\";\nimport { Id64, Id64Array, Id64Set, Id64String } from \"./Id\";\nimport { OrderedId64Iterable } from \"./OrderedId64Iterable\";\nimport { SortedArray } from \"./SortedArray\";\n\n/** @public */\nexport type CompressedId64Set = string;\n\n/** A compact string representation of an [[Id64Set]]. Such a representation is useful when serializing potentially very large\n * sets of Ids.\n * @see [[CompressedId64Set.iterable]] to efficiently iterate the Ids represented by a compact string.\n * @see [[CompressedId64Set.compressSet]] and [[CompressedId64Set.compressArray]] to produce a compact string from a collection of Ids.\n * @see [[CompressedId64Set.decompressSet]] and [[CompressedId64Set.decompressArray]] to produce a collection of Ids from a compact string.\n * @see [[OrderedId64Iterable]] for a generic representation of an ordered set of Ids (compressed or otherwise).\n * @see [[MutableCompressedId64Set]] for a mutable version.\n * @public\n */\nexport namespace CompressedId64Set { // eslint-disable-line @typescript-eslint/no-redeclare\n function isHexDigit(ch: number): boolean {\n // ascii values:\n // '0' = 48\n // '9' = 57\n // 'a' = 65\n // 'f' = 70\n\n return (ch >= 48 && ch <= 57) || (ch >= 65 && ch <= 70);\n }\n\n function compactRange(increment: Uint64, length: number): string {\n assert(length > 0);\n const inc = `+${increment.toString()}`;\n if (length <= 1)\n return inc;\n\n const len = length.toString(16).toUpperCase();\n return `${inc}*${len}`;\n }\n\n /** Given a set of [[Id64String]]s, produce a compact string representation. Useful when serializing potentially large sets of Ids.\n * @note Invalid Ids are ignored.\n * @see [[CompressedId64Set.sortAndCompress]] to compress any unordered collection of Ids.\n * @see [[CompressedId64Set.compressArray]] to perform the same operation on an [[Id64Array]].\n * @see [[CompressedId64Set.decompressSet]] to perform the inverse operation.\n */\n export function compressSet(ids: Id64Set): CompressedId64Set {\n return sortAndCompress(ids);\n }\n\n /** Create a sorted array from `ids`, then return a compact string representation of those Ids.\n * @see [[CompressedId64Set.compressIds]] if `ids` is known to already be sorted.\n */\n export function sortAndCompress(ids: Iterable<Id64String>): CompressedId64Set {\n // `string` is an Iterable<string>. In that case assume caller passed a single Id64String.\n const arr = typeof ids === \"string\" ? [ids] : Array.from(ids);\n OrderedId64Iterable.sortArray(arr);\n return compressArray(arr);\n }\n\n /** Give a **numerically-ordered** array of [[Id64String]]s, produce a compact string representation. Useful when serializing potentially large sets of Ids.\n * Duplicate Ids are included only once in the string representation.\n * @throws Error if two consecutive Ids `x` and `y` exist such that the numerical value of `x` is greater than that of `y` - i.e., the array is not properly sorted.\n * @note The array must be sorted according to the 64-bit numerical value of each Id.\n * @note Invalid Ids are ignored.\n * @see [[CompressedId64Set.decompressArray]] to perform the inverse operation.\n * @see [[OrderedId64Iterable.sortArray]] to ensure the Ids are properly sorted.\n * @see [[CompressedId64Set.sortAndCompress]] to compress any unordered collection of Ids.\n */\n export function compressArray(ids: Id64Array): CompressedId64Set {\n return compressIds(ids);\n }\n\n /** Give a **numerically-ordered** collection of [[Id64String]]s, produce a compact string representation. Useful when serializing potentially large sets of Ids.\n * Duplicate Ids are included only once in the string representation.\n * @throws Error if two consecutive Ids `x` and `y` exist such that the numerical value of `x` is greater than that of `y` - i.e., the collection is not properly sorted.\n * @note The collection must be sorted according to the 64-bit numerical value of each Id.\n * @note Invalid Ids are ignored.\n * @see [[CompressedId64Set.iterable]] to perform the inverse operation.\n * @see [[OrderedId64Iterable.sortArray]] or [[OrderedId64Iterable.compare]] to ensure the Ids are properly sorted.\n * @see [[CompressedId64Set.sortAndCompress]] to compress any unordered collection of Ids.\n */\n export function compressIds(ids: OrderedId64Iterable): CompressedId64Set {\n if (\"string\" === typeof ids)\n return ids;\n\n let str = \"\";\n\n const prevId = new Uint64();\n const rangeIncrement = new Uint64();\n let rangeLen = 0;\n\n const curId = new Uint64();\n const curIncrement = new Uint64();\n for (const id of ids) {\n if (!Id64.isValidId64(id))\n continue; // ignore garbage and invalid Ids (\"0\")\n\n curId.setFromId(id);\n curIncrement.setFromDifference(curId, prevId);\n\n const cmp = prevId.compare(curId);\n if (0 === cmp)\n continue; // ignore duplicates\n else if (cmp > 0)\n throw new Error(\"CompressedId64Set.compressArray requires a sorted array as input\");\n\n prevId.copyFrom(curId);\n\n if (0 === rangeLen) {\n rangeIncrement.copyFrom(curIncrement);\n rangeLen = 1;\n } else if (curIncrement.equals(rangeIncrement)) {\n ++rangeLen;\n } else {\n str += compactRange(rangeIncrement, rangeLen);\n rangeIncrement.copyFrom(curIncrement);\n rangeLen = 1;\n }\n }\n\n if (0 < rangeLen)\n str += compactRange(rangeIncrement, rangeLen);\n\n return str;\n }\n\n /** This exists strictly for the purposes of compressed sets of 64-bit Ids, to avoid the overhead of BigInt for handling 64-bit integers. */\n class Uint64 implements Id64.Uint32Pair {\n private static readonly _base = 0x100000000;\n\n private static assertUint32(num: number): void {\n assert(num >= 0);\n assert(num < Uint64._base);\n assert(Math.floor(num) === num);\n }\n\n private assertConstraints(): void {\n Uint64.assertUint32(this.lower);\n Uint64.assertUint32(this.upper);\n }\n\n constructor(public lower = 0, public upper = 0) {\n this.assertConstraints();\n }\n\n public compare(rhs: Uint64): number {\n const diff = this.upper - rhs.upper;\n return 0 === diff ? this.lower - rhs.lower : diff;\n }\n\n public equals(rhs: Uint64): boolean { return 0 === this.compare(rhs); }\n public isLessThan(rhs: Uint64): boolean { return this.compare(rhs) < 0; }\n public isGreaterThan(rhs: Uint64): boolean { return this.compare(rhs) > 0; }\n\n public get isZero(): boolean { return 0 === this.lower && 0 === this.upper; }\n\n public setFromDifference(lhs: Uint64, rhs: Uint64): void {\n assert(!rhs.isGreaterThan(lhs));\n\n this.lower = lhs.lower - rhs.lower;\n this.upper = lhs.upper - rhs.upper;\n if (this.lower < 0) {\n this.lower += Uint64._base;\n this.upper -= 1;\n }\n }\n\n public add(rhs: Uint64): void {\n let lower = rhs.lower;\n let upper = rhs.upper;\n if (lower + this.lower >= Uint64._base) {\n lower -= Uint64._base;\n upper += 1;\n }\n\n this.lower += lower;\n this.upper += upper;\n this.assertConstraints();\n }\n\n public setFromId(id: Id64String): void {\n Id64.getUint32Pair(id, this);\n }\n\n public copyFrom(other: Uint64): void {\n this.lower = other.lower;\n this.upper = other.upper;\n }\n\n public toString(): string {\n if (0 === this.upper)\n return this.lower.toString(16).toUpperCase();\n\n const upper = this.upper.toString(16);\n const lower = this.lower.toString(16).padStart(8, \"0\");\n assert(lower.length === 8);\n return `${upper}${lower}`.toUpperCase();\n }\n\n public toId64String(): string {\n return Id64.fromUint32Pair(this.lower, this.upper);\n }\n }\n\n /** Supplies an iterator over the [[Id64String]]s in a [[CompressedId64Set]].\n * The Ids are iterated in ascending order based on their unsigned 64-bit integer values.\n */\n export function* iterator(ids: CompressedId64Set): Iterator<Id64String> {\n if (0 === ids.length)\n return; // empty set.\n\n if (\"+\" !== ids[0])\n throw new Error(\"Invalid CompressedId64Set\");\n\n let curIndex = 1; // skip the leading '+'\n const curId = new Uint64();\n\n function parseUint32(): number {\n let value = 0;\n let nChars = 0;\n while (curIndex < ids.length && nChars < 8) {\n ++nChars;\n const ch = ids.charCodeAt(curIndex);\n if (!isHexDigit(ch))\n break; // not a hex digit in [0..9] or [A..F]\n\n value <<= 4;\n value |= (ch >= 65 ? ch - 65 + 10 : ch - 48); // ch - 'A' + 10 or ch - '0'\n value = value >>> 0; // restore unsignedness because silly javascript.\n ++curIndex;\n }\n\n return value;\n }\n\n function parseUint64(uint64: Uint64): void {\n let lower = 0;\n let upper = 0;\n\n // Read up to the first 8 digits.\n const startIndex = curIndex;\n const first = parseUint32();\n\n const nFirstDigits = curIndex - startIndex;\n assert(nFirstDigits <= 8);\n\n if (8 === nFirstDigits && curIndex + 1 < ids.length && isHexDigit(ids.charCodeAt(curIndex + 1))) {\n // We've got up to 8 more digits remaining\n const secondIndex = curIndex;\n const second = parseUint32();\n\n // Transfer excess digits from upper to lower.\n const nSecondDigits = curIndex - secondIndex;\n assert(nSecondDigits > 0 && nSecondDigits <= 8);\n\n const nDigitsToTransfer = 8 - nSecondDigits;\n upper = first >>> (4 * nDigitsToTransfer);\n const transfer = first - ((upper << (4 * nDigitsToTransfer)) >>> 0);\n lower = (second | ((transfer << (4 * nSecondDigits)) >>> 0)) >>> 0;\n } else {\n lower = first;\n }\n\n uint64.lower = lower;\n uint64.upper = upper;\n }\n\n const increment = new Uint64();\n while (curIndex < ids.length) {\n let multiplier = 1;\n parseUint64(increment);\n if (increment.isZero)\n throw new Error(\"Invalid CompressedId64Set\");\n\n if (curIndex < ids.length) {\n switch (ids[curIndex++]) {\n case \"*\":\n multiplier = parseUint32();\n if (0 === multiplier)\n throw new Error(\"Invalid CompressedId64Set\");\n\n if (curIndex !== ids.length && ids[curIndex++] !== \"+\")\n return;\n\n break;\n case \"+\":\n break;\n default:\n throw new Error(\"Invalid CompressedId64Set\");\n }\n }\n\n for (let i = 0; i < multiplier; i++) {\n curId.add(increment);\n yield curId.toId64String();\n }\n }\n }\n\n /** Supplies an iterable over the [[Id64String]]s in a [[CompressedId64Set]].\n * The Ids are iterated in ascending order based on their unsigned 64-bit integer values.\n */\n export function iterable(ids: CompressedId64Set): OrderedId64Iterable {\n return {\n [Symbol.iterator]: () => iterator(ids),\n };\n }\n\n /** Decompress the compact string representation of an [[Id64Set]] into an [[Id64Set]].\n * @param compressedIds The compact string representation.\n * @param out If supplied, the Ids will be inserted into this set rather than allocating and returning a new set.\n * @returns The set containing the decompressed Ids.\n * @throws Error if `compressedIds` is not a well-formed [[CompressedId64Set]].\n * @see [[CompressedId64Set.compressSet]] to perform the inverse operation.\n * @see [[CompressedId64Set.decompressArray]] to decompress as an [[Id64Array]] instead.\n * @see [[CompressedId64Set.iterable]] to efficiently iterate the Ids.\n */\n export function decompressSet(compressedIds: CompressedId64Set, out?: Id64Set): Id64Set {\n const set = out ?? new Set<string>();\n for (const id of iterable(compressedIds))\n set.add(id);\n\n return set;\n }\n\n /** Decompress the compact string representation of an [[Id64Set]] into an [[Id64Array]].\n * @param compressedIds The compact string representation.\n * @param out If supplied, the Ids will be appended to this array rather than allocating and returning a new array.\n * @returns The array containing the decompressed Ids.\n * @throws Error if `compressedIds` is not a well-formed [[CompressedId64Set]].\n * @note The Ids are decompressed and appended to the array in ascending order based on their 64-bit numerical values.\n * @see [[CompressedId64Set.compressArray]] to perform the inverse operation.\n * @see [[CompressedId64Set.decompressSet]] to decompress as an [[Id64Set]] instead.\n * @see [[CompressedId64Set.iterable]] to efficiently iterate the Ids.\n */\n export function decompressArray(compressedIds: CompressedId64Set, out?: Id64Array): Id64Array {\n const arr = out ?? [];\n for (const id of iterable(compressedIds))\n arr.push(id);\n\n return arr;\n }\n}\n\n/** A [[SortedArray]] of unique [[Id64String]]s sorted in ascending order by the 64-bit unsigned integer values of the Ids.\n * @see [[CompressedId64Set]] for an immutable compact string representation.\n * @public\n */\nexport class OrderedId64Array extends SortedArray<Id64String> {\n /** Construct a new, empty array. */\n public constructor() {\n super((lhs, rhs) => OrderedId64Iterable.compare(lhs, rhs));\n }\n\n /** An iterable that iterates over the Ids in sorted order. */\n public get ids(): OrderedId64Iterable { return this._array; }\n\n /** The underlying array of Ids. */\n public get array(): ReadonlyArray<Id64String> { return this._array; }\n}\n\n/** A mutable set of valid [[Id64String]]s sorted in ascending order by the 64-bit unsigned integer value of the Ids.\n * Internally the set of Ids is maintained as a [[CompressedId64Set]] string representation.\n * Insertions and removals are buffered until the string representation needs to be recomputed. The string representation is recomputed by every public method except [[add]] and [[delete]] -\n * therefore, if multiple removals and/or insertions are required, it is most efficient to perform them all before invoking other methods.\n * @public\n */\nexport class MutableCompressedId64Set implements OrderedId64Iterable {\n private _ids: CompressedId64Set;\n private readonly _inserted = new OrderedId64Array();\n private readonly _deleted = new OrderedId64Array();\n\n /** Construct a new set, optionally initialized to contain the Ids represented by `ids`. */\n public constructor(ids?: CompressedId64Set) {\n this._ids = ids ?? \"\";\n }\n\n /** Obtain the compact string representation of the contents of this set. If any insertions or removals are pending, they will be applied and the string recomputed. */\n public get ids(): CompressedId64Set {\n this.updateIds();\n return this._ids;\n }\n\n /** Add the specified Id to the set.\n * @throws Error if `id` is not a valid [[Id64String]].\n */\n public add(id: Id64String): void {\n if (!Id64.isValidId64(id))\n throw new Error(\"MutableCompressedId64Set.add: invalid Id\");\n\n this._deleted.remove(id);\n this._inserted.insert(id);\n }\n\n /** Remove the specified Id from the set.\n * @throws Error if `id` is not a valid [[Id64String]].\n */\n public delete(id: Id64String): void {\n if (!Id64.isValidId64(id))\n throw new Error(\"MutableCompressedId64Set.delete: invalid Id\");\n\n this._inserted.remove(id);\n this._deleted.insert(id);\n }\n\n /** Remove all Ids from the set. */\n public clear(): void {\n this._ids = \"\";\n this._inserted.clear();\n this._deleted.clear();\n }\n\n /** Remove all Ids from the set, then add the specified Ids. */\n public reset(ids?: CompressedId64Set): void {\n this.clear();\n this._ids = ids ?? \"\";\n }\n\n /** Obtain an iterator over the Ids in this set. The Ids are returned in ascending order based on their unsigned 64-bit integer values. */\n public [Symbol.iterator]() {\n return CompressedId64Set.iterator(this.ids);\n }\n\n /** Compute a compact string representation of the union of this and another set of Ids - i.e., those Ids present in either this and/or the other set. */\n public computeUnion(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set {\n if (this.isEmpty)\n return CompressedId64Set.compressIds(ids);\n else if (OrderedId64Iterable.isEmptySet(ids) || this.equals(ids))\n return this.ids;\n\n return CompressedId64Set.compressIds(OrderedId64Iterable.union(this, ids));\n }\n\n /** Compute a compact string representation of the intersection of this and another set of Ids - i.e., those Ids present in both this and the other set. */\n public computeIntersection(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set {\n if (this.equals(ids))\n return this.ids;\n else if (this.isEmpty || OrderedId64Iterable.isEmptySet(ids))\n return \"\";\n\n return CompressedId64Set.compressIds(OrderedId64Iterable.intersection(this, ids));\n }\n\n /** Compute a compact string representation of the difference between this and another set - i.e., those Ids present in this but not in the other set. */\n public computeDifference(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set {\n if (this.isEmpty || this.equals(ids))\n return \"\";\n\n return CompressedId64Set.compressIds(OrderedId64Iterable.difference(this, ids));\n }\n\n /** Return true if this set contains no Ids. */\n public get isEmpty(): boolean {\n return OrderedId64Iterable.isEmptySet(this.ids);\n }\n\n /** Return true if the set of Ids represented by `other` is identical to those in this set.\n * @note This considers only the **distinct** Ids in `other` - duplicates are ignored.\n */\n public equals(other: CompressedId64Set | MutableCompressedId64Set | OrderedId64Iterable): boolean {\n if (other instanceof MutableCompressedId64Set) {\n if (other === this)\n return true;\n\n if (typeof other !== \"string\")\n other = other.ids;\n }\n\n if (typeof other === \"string\")\n return other === this.ids;\n\n this.updateIds();\n return OrderedId64Iterable.areEqualSets(this, other);\n }\n\n private get _isDirty(): boolean {\n return !this._inserted.isEmpty || !this._deleted.isEmpty;\n }\n\n private updateIds(): void {\n if (!this._isDirty)\n return;\n\n const difference = OrderedId64Iterable.difference(CompressedId64Set.iterable(this._ids), this._deleted.ids);\n const union = { [Symbol.iterator]: () => OrderedId64Iterable.unionIterator(difference, this._inserted.ids) };\n this._ids = CompressedId64Set.compressIds(union);\n\n this._inserted.clear();\n this._deleted.clear();\n }\n}\n"]}
package/lib/esm/Logger.js CHANGED
@@ -29,6 +29,7 @@ export var LogLevel;
29
29
  * @public
30
30
  */
31
31
  export class Logger {
32
+ static { this._staticMetaData = new Map(); }
32
33
  /** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */
33
34
  static get onLogLevelChanged() {
34
35
  // We have to lazily initialize because it's static and BeEvent imports UnexpectedErrors which imports Logger which wants to instantiate BeEvent.
@@ -37,6 +38,7 @@ export class Logger {
37
38
  }
38
39
  return Logger._onLogLevelChanged;
39
40
  }
41
+ static { this._categoryFilter = {}; }
40
42
  /** Maps category names to the least severe level at which messages in that category should be displayed,
41
43
  * or `undefined` if a minimum has not been defined.
42
44
  * @see [[setLevel]] to change the minimum logging level for a category.
@@ -53,6 +55,8 @@ export class Logger {
53
55
  // NOTE: this property is accessed by native code. */
54
56
  return this._minLevel;
55
57
  }
58
+ /** Should the call stack be included when an exception is logged? */
59
+ static { this.logExceptionCallstacks = false; }
56
60
  /** Contains metadata that should be included with every logged message.
57
61
  * @beta
58
62
  */
@@ -238,10 +242,6 @@ export class Logger {
238
242
  Logger._logTrace(category, message, metaData);
239
243
  }
240
244
  }
241
- Logger._staticMetaData = new Map();
242
- Logger._categoryFilter = {};
243
- /** Should the call stack be included when an exception is logged? */
244
- Logger.logExceptionCallstacks = false;
245
245
  /** Simple performance diagnostics utility.
246
246
  * It measures the time from construction to disposal. On disposal it logs the routine name along with
247
247
  * the duration in milliseconds.
@@ -252,6 +252,7 @@ Logger.logExceptionCallstacks = false;
252
252
  * @public
253
253
  */
254
254
  export class PerfLogger {
255
+ static { this._severity = LogLevel.Info; }
255
256
  constructor(operation, metaData) {
256
257
  this._operation = operation;
257
258
  this._metaData = metaData;
@@ -277,5 +278,4 @@ export class PerfLogger {
277
278
  this.logMessage();
278
279
  }
279
280
  }
280
- PerfLogger._severity = LogLevel.Info;
281
281
  //# sourceMappingURL=Logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/Logger.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAQhE;;GAEG;AACH,MAAM,CAAN,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,wCAAwC;IACxC,yCAAK,CAAA;IACL,8BAA8B;IAC9B,uCAAI,CAAA;IACJ,4BAA4B;IAC5B,6CAAO,CAAA;IACP,6BAA6B;IAC7B,yCAAK,CAAA;IACL,+EAA+E;IAC/E,uCAAI,CAAA;AACN,CAAC,EAXW,QAAQ,KAAR,QAAQ,QAWnB;AAmCD;;;GAGG;AACH,MAAM,OAAO,MAAM;IASjB,8EAA8E;IACvE,MAAM,KAAK,iBAAiB;QACjC,iJAAiJ;QACjJ,IAAI,SAAS,KAAK,MAAM,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AAW,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5E,OAAO;QAET,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE;YAC/E,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7E,OAAO;gBACL,GAAG,KAAK,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,2DAA2D;aACxH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;;AAlCc,oBAAS,GAAa,QAAQ,CAAC,IAAI,CAAC","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 Logging\n */\n\nimport { BeEvent } from \"./BeEvent\";\nimport { BentleyError, IModelStatus, LoggingMetaData } from \"./BentleyError\";\nimport { BentleyLoggerCategory } from \"./BentleyLoggerCategory\";\nimport { IDisposable } from \"./Disposable\";\n\n/** Defines the *signature* for a log function.\n * @public\n */\nexport type LogFunction = (category: string, message: string, metaData: LoggingMetaData) => void;\n\n/** Use to categorize logging messages by severity.\n * @public\n */\nexport enum LogLevel {\n /** Tracing and debugging - low level */\n Trace,\n /** Information - mid level */\n Info,\n /** Warnings - high level */\n Warning,\n /** Errors - highest level */\n Error,\n /** Higher than any real logging level. This is used to turn a category off. */\n None,\n}\n\n/** Identifies a logging category and the LogLevel that should be used for it. The LogLevel is specified by its string name.\n * @public\n */\nexport interface LoggerCategoryAndLevel {\n category: string;\n logLevel: string;\n}\n\n/** Specifies logging levels, including the default logging level and a set of categories and levels for them.\n * @public\n */\nexport interface LoggerLevelsConfig {\n defaultLevel?: string;\n categoryLevels?: LoggerCategoryAndLevel[];\n}\n\n/** A global set of metadata that should be included with every log message.\n * You can provide an object representing the metadata, or a function to be invoked to obtain the metadata object each\n * time a message is logged.\n * Each key-value pair of the object will be stringified and combined with the log message's per-call metadata.\n * The keys you provide to each method is used solely to identify your entries so that you can later update or delete them - these keys\n * are **not** included in log messages. Don't modify or remove metadata associated with keys that belong to someone else.\n * @note Each extra bit of metadata adds cost and overhead to the logging system. Avoid adding unnecessary or unnecessarily verbose metadata.\n * @see [[Logger.staticMetaData]] to access the global metadata.\n * @beta\n */\nexport interface StaticLoggerMetaData {\n /** Add or update some metadata to be included with every logged message. */\n set(key: string, metadata: LoggingMetaData): void;\n /** Remove metadata previously [[set]] using the specified `key`, so it will no longer be included with every logged message. */\n delete(key: string): void;\n}\n\n/** Logger allows libraries and apps to report potentially useful information about operations, and it allows apps and users to control\n * how or if the logged information is displayed or collected. See [Learning about Logging]($docs/learning/common/Logging.md).\n * @public\n */\nexport class Logger {\n protected static _logError: LogFunction | undefined;\n protected static _logWarning: LogFunction | undefined;\n protected static _logInfo: LogFunction | undefined;\n protected static _logTrace: LogFunction | undefined;\n\n private static _onLogLevelChanged: BeEvent<() => void> | undefined;\n private static _staticMetaData = new Map<string, LoggingMetaData>();\n\n /** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */\n public static get onLogLevelChanged(): BeEvent<() => void> {\n // We have to lazily initialize because it's static and BeEvent imports UnexpectedErrors which imports Logger which wants to instantiate BeEvent.\n if (undefined === Logger._onLogLevelChanged) {\n Logger._onLogLevelChanged = new BeEvent<() => void>();\n }\n\n return Logger._onLogLevelChanged;\n }\n\n private static _categoryFilter: {[categoryName: string]: LogLevel | undefined} = {};\n\n /** Maps category names to the least severe level at which messages in that category should be displayed,\n * or `undefined` if a minimum has not been defined.\n * @see [[setLevel]] to change the minimum logging level for a category.\n */\n public static get categoryFilter(): Readonly<{[categoryName: string]: LogLevel | undefined}> {\n // NOTE: this property is accessed by native code.\n return this._categoryFilter;\n }\n\n private static _minLevel: LogLevel | undefined;\n\n /** The least severe level at which messages should be displayed by default.\n * @see [[setLevelDefault]] to change this default.\n * @see [[setLevel]] to override this default for specific categories.\n */\n public static get minLevel(): LogLevel | undefined {\n // NOTE: this property is accessed by native code. */\n return this._minLevel;\n }\n\n /** Should the call stack be included when an exception is logged? */\n public static logExceptionCallstacks = false;\n\n /** Contains metadata that should be included with every logged message.\n * @beta\n */\n public static get staticMetaData(): StaticLoggerMetaData {\n return this._staticMetaData;\n }\n\n /** Initialize the logger streams. Should be called at application initialization time. */\n public static initialize(logError?: LogFunction, logWarning?: LogFunction, logInfo?: LogFunction, logTrace?: LogFunction): void {\n Logger._logError = logError;\n Logger._logWarning = logWarning;\n Logger._logInfo = logInfo;\n Logger._logTrace = logTrace;\n Logger.turnOffLevelDefault();\n Logger.turnOffCategories();\n }\n\n /** Initialize the logger to output to the console. */\n public static initializeToConsole(): void {\n const logConsole = (level: string) => (category: string, message: string, metaData: LoggingMetaData) =>\n console.log(`${level} | ${category} | ${message} ${Logger.stringifyMetaData(metaData)}`); // eslint-disable-line no-console\n\n Logger.initialize(logConsole(\"Error\"), logConsole(\"Warning\"), logConsole(\"Info\"), logConsole(\"Trace\"));\n }\n\n /** merge the supplied metadata with all static metadata into one object */\n public static getMetaData(metaData?: LoggingMetaData): object {\n const metaObj = {};\n for (const meta of this._staticMetaData) {\n const val = BentleyError.getMetaData(meta[1]);\n if (val)\n Object.assign(metaObj, val);\n }\n Object.assign(metaObj, BentleyError.getMetaData(metaData)); // do this last so user supplied values take precedence\n return metaObj;\n }\n\n /** stringify the metadata for a log message by merging the supplied metadata with all static metadata into one object that is then `JSON.stringify`ed. */\n public static stringifyMetaData(metaData?: LoggingMetaData): string {\n const metaObj = this.getMetaData(metaData);\n return Object.keys(metaObj).length > 0 ? JSON.stringify(metaObj) : \"\";\n }\n\n /** Set the least severe level at which messages should be displayed by default. Call setLevel to override this default setting for specific categories. */\n public static setLevelDefault(minLevel: LogLevel): void {\n this._minLevel = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Set the minimum logging level for the specified category. The minimum level is least severe level at which messages in the\n * specified category should be displayed.\n */\n public static setLevel(category: string, minLevel: LogLevel) {\n Logger._categoryFilter[category] = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Interpret a string as the name of a LogLevel */\n public static parseLogLevel(str: string): LogLevel {\n switch (str.toUpperCase()) {\n case \"EXCEPTION\": return LogLevel.Error;\n case \"FATAL\": return LogLevel.Error;\n case \"ERROR\": return LogLevel.Error;\n case \"WARNING\": return LogLevel.Warning;\n case \"INFO\": return LogLevel.Info;\n case \"TRACE\": return LogLevel.Trace;\n case \"DEBUG\": return LogLevel.Trace;\n }\n return LogLevel.None;\n }\n\n /** Set the log level for multiple categories at once. Also see [[validateProps]] */\n public static configureLevels(cfg: LoggerLevelsConfig) {\n Logger.validateProps(cfg);\n if (cfg.defaultLevel !== undefined) {\n this.setLevelDefault(Logger.parseLogLevel(cfg.defaultLevel));\n }\n if (cfg.categoryLevels !== undefined) {\n for (const cl of cfg.categoryLevels) {\n this.setLevel(cl.category, Logger.parseLogLevel(cl.logLevel));\n }\n }\n }\n\n private static isLogLevel(v: string) {\n return LogLevel.hasOwnProperty(v);\n }\n\n /** Check that the specified object is a valid LoggerLevelsConfig. This is useful when reading a config from a .json file. */\n public static validateProps(config: any) {\n const validProps = [\"defaultLevel\", \"categoryLevels\"];\n for (const prop of Object.keys(config)) {\n if (!validProps.includes(prop))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig - unrecognized property: ${prop}`);\n if (prop === \"defaultLevel\") {\n if (!Logger.isLogLevel(config.defaultLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.defaultLevel must be a LogLevel. Invalid value: ${JSON.stringify(config.defaultLevel)}`);\n } else if (prop === \"categoryLevels\") {\n const value = config[prop];\n if (!Array.isArray(value))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels must be an array. Invalid value: ${JSON.stringify(value)}`);\n for (const item of config[prop]) {\n if (!item.hasOwnProperty(\"category\") || !item.hasOwnProperty(\"logLevel\"))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item must be a LoggerCategoryAndLevel {category: logLevel:}. Invalid value: ${JSON.stringify(item)}`);\n if (!Logger.isLogLevel(item.logLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item's logLevel property must be a LogLevel. Invalid value: ${JSON.stringify(item.logLevel)}`);\n }\n }\n }\n }\n\n /** Get the minimum logging level for the specified category. */\n public static getLevel(category: string): LogLevel | undefined {\n // Prefer the level set for this category specifically\n const minLevelForThisCategory = Logger.categoryFilter[category];\n if (minLevelForThisCategory !== undefined)\n return minLevelForThisCategory;\n\n // Fall back on the level set for the parent of this category.\n const parent = category.lastIndexOf(\".\");\n if (parent !== -1)\n return Logger.getLevel(category.slice(0, parent));\n\n // Fall back on the default level.\n return Logger.minLevel;\n }\n\n /** Turns off the least severe level at which messages should be displayed by default.\n * This turns off logging for all messages for which no category minimum level is defined.\n */\n public static turnOffLevelDefault(): void {\n Logger._minLevel = undefined;\n }\n\n /** Turns off all category level filters previously defined with [[Logger.setLevel]].\n */\n public static turnOffCategories(): void {\n Logger._categoryFilter = {};\n }\n\n /** Check if messages in the specified category should be displayed at this level of severity. */\n public static isEnabled(category: string, level: LogLevel): boolean {\n const minLevel = Logger.getLevel(category);\n return (minLevel !== undefined) && (level >= minLevel);\n }\n\n /** Log the specified message to the **error** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logError(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logError && Logger.isEnabled(category, LogLevel.Error))\n Logger._logError(category, message, metaData);\n }\n\n private static getExceptionMessage(err: unknown): string {\n if (err === undefined) {\n return \"Error: err is undefined.\";\n }\n if (err === null) {\n return \"Error: err is null.\";\n }\n const stack = Logger.logExceptionCallstacks ? `\\n${BentleyError.getErrorStack(err)}` : \"\";\n return BentleyError.getErrorMessage(err) + stack;\n }\n\n /** Log the specified exception. The special \"ExceptionType\" property will be added as metadata.\n * @param category The category of the message.\n * @param err The exception object.\n * @param log The logger output function to use - defaults to Logger.logError\n */\n public static logException(category: string, err: any, log: LogFunction = (_category, message, metaData) => Logger.logError(_category, message, metaData)): void {\n log(category, Logger.getExceptionMessage(err), () => {\n return { ...BentleyError.getErrorMetadata(err), exceptionType: err?.constructor?.name ?? \"<Unknown>\"};\n });\n }\n\n /** Log the specified message to the **warning** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logWarning(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logWarning && Logger.isEnabled(category, LogLevel.Warning))\n Logger._logWarning(category, message, metaData);\n }\n\n /** Log the specified message to the **info** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logInfo(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logInfo && Logger.isEnabled(category, LogLevel.Info))\n Logger._logInfo(category, message, metaData);\n }\n\n /** Log the specified message to the **trace** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logTrace(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logTrace && Logger.isEnabled(category, LogLevel.Trace))\n Logger._logTrace(category, message, metaData);\n }\n}\n\n/** Simple performance diagnostics utility.\n * It measures the time from construction to disposal. On disposal it logs the routine name along with\n * the duration in milliseconds.\n * It also logs the routine name at construction time so that nested calls can be disambiguated.\n *\n * The timings are logged using the log category **Performance** and log severity [[LogLevel.INFO]].\n * Enable those, if you want to capture timings.\n * @public\n */\nexport class PerfLogger implements IDisposable {\n private static _severity: LogLevel = LogLevel.Info;\n\n private _operation: string;\n private _metaData?: LoggingMetaData;\n private _startTimeStamp: number;\n\n public constructor(operation: string, metaData?: LoggingMetaData) {\n this._operation = operation;\n this._metaData = metaData;\n\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity)) {\n this._startTimeStamp = 0;\n return;\n }\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},START`, this._metaData);\n this._startTimeStamp = new Date().getTime(); // take timestamp\n }\n\n private logMessage(): void {\n const endTimeStamp: number = new Date().getTime();\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity))\n return;\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},END`, () => {\n const mdata = this._metaData ? BentleyError.getMetaData(this._metaData) : {};\n return {\n ...mdata, TimeElapsed: endTimeStamp - this._startTimeStamp, // eslint-disable-line @typescript-eslint/naming-convention\n };\n });\n }\n\n public dispose(): void {\n this.logMessage();\n }\n}\n\n"]}
1
+ {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/Logger.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAQhE;;GAEG;AACH,MAAM,CAAN,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,wCAAwC;IACxC,yCAAK,CAAA;IACL,8BAA8B;IAC9B,uCAAI,CAAA;IACJ,4BAA4B;IAC5B,6CAAO,CAAA;IACP,6BAA6B;IAC7B,yCAAK,CAAA;IACL,+EAA+E;IAC/E,uCAAI,CAAA;AACN,CAAC,EAXW,QAAQ,KAAR,QAAQ,QAWnB;AAmCD;;;GAGG;AACH,MAAM,OAAO,MAAM;aAOF,oBAAe,GAAG,IAAI,GAAG,EAA2B,CAAC;IAEpE,8EAA8E;IACvE,MAAM,KAAK,iBAAiB;QACjC,iJAAiJ;QACjJ,IAAI,SAAS,KAAK,MAA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EAAE,UAAU,CAAC,SAAS,CAAC;YAC5E,OAAO;QAET,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE;YAC/E,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7E,OAAO;gBACL,GAAG,KAAK,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,2DAA2D;aACxH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC","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 Logging\n */\n\nimport { BeEvent } from \"./BeEvent\";\nimport { BentleyError, IModelStatus, LoggingMetaData } from \"./BentleyError\";\nimport { BentleyLoggerCategory } from \"./BentleyLoggerCategory\";\nimport { IDisposable } from \"./Disposable\";\n\n/** Defines the *signature* for a log function.\n * @public\n */\nexport type LogFunction = (category: string, message: string, metaData: LoggingMetaData) => void;\n\n/** Use to categorize logging messages by severity.\n * @public\n */\nexport enum LogLevel {\n /** Tracing and debugging - low level */\n Trace,\n /** Information - mid level */\n Info,\n /** Warnings - high level */\n Warning,\n /** Errors - highest level */\n Error,\n /** Higher than any real logging level. This is used to turn a category off. */\n None,\n}\n\n/** Identifies a logging category and the LogLevel that should be used for it. The LogLevel is specified by its string name.\n * @public\n */\nexport interface LoggerCategoryAndLevel {\n category: string;\n logLevel: string;\n}\n\n/** Specifies logging levels, including the default logging level and a set of categories and levels for them.\n * @public\n */\nexport interface LoggerLevelsConfig {\n defaultLevel?: string;\n categoryLevels?: LoggerCategoryAndLevel[];\n}\n\n/** A global set of metadata that should be included with every log message.\n * You can provide an object representing the metadata, or a function to be invoked to obtain the metadata object each\n * time a message is logged.\n * Each key-value pair of the object will be stringified and combined with the log message's per-call metadata.\n * The keys you provide to each method is used solely to identify your entries so that you can later update or delete them - these keys\n * are **not** included in log messages. Don't modify or remove metadata associated with keys that belong to someone else.\n * @note Each extra bit of metadata adds cost and overhead to the logging system. Avoid adding unnecessary or unnecessarily verbose metadata.\n * @see [[Logger.staticMetaData]] to access the global metadata.\n * @beta\n */\nexport interface StaticLoggerMetaData {\n /** Add or update some metadata to be included with every logged message. */\n set(key: string, metadata: LoggingMetaData): void;\n /** Remove metadata previously [[set]] using the specified `key`, so it will no longer be included with every logged message. */\n delete(key: string): void;\n}\n\n/** Logger allows libraries and apps to report potentially useful information about operations, and it allows apps and users to control\n * how or if the logged information is displayed or collected. See [Learning about Logging]($docs/learning/common/Logging.md).\n * @public\n */\nexport class Logger {\n protected static _logError: LogFunction | undefined;\n protected static _logWarning: LogFunction | undefined;\n protected static _logInfo: LogFunction | undefined;\n protected static _logTrace: LogFunction | undefined;\n\n private static _onLogLevelChanged: BeEvent<() => void> | undefined;\n private static _staticMetaData = new Map<string, LoggingMetaData>();\n\n /** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */\n public static get onLogLevelChanged(): BeEvent<() => void> {\n // We have to lazily initialize because it's static and BeEvent imports UnexpectedErrors which imports Logger which wants to instantiate BeEvent.\n if (undefined === Logger._onLogLevelChanged) {\n Logger._onLogLevelChanged = new BeEvent<() => void>();\n }\n\n return Logger._onLogLevelChanged;\n }\n\n private static _categoryFilter: {[categoryName: string]: LogLevel | undefined} = {};\n\n /** Maps category names to the least severe level at which messages in that category should be displayed,\n * or `undefined` if a minimum has not been defined.\n * @see [[setLevel]] to change the minimum logging level for a category.\n */\n public static get categoryFilter(): Readonly<{[categoryName: string]: LogLevel | undefined}> {\n // NOTE: this property is accessed by native code.\n return this._categoryFilter;\n }\n\n private static _minLevel: LogLevel | undefined;\n\n /** The least severe level at which messages should be displayed by default.\n * @see [[setLevelDefault]] to change this default.\n * @see [[setLevel]] to override this default for specific categories.\n */\n public static get minLevel(): LogLevel | undefined {\n // NOTE: this property is accessed by native code. */\n return this._minLevel;\n }\n\n /** Should the call stack be included when an exception is logged? */\n public static logExceptionCallstacks = false;\n\n /** Contains metadata that should be included with every logged message.\n * @beta\n */\n public static get staticMetaData(): StaticLoggerMetaData {\n return this._staticMetaData;\n }\n\n /** Initialize the logger streams. Should be called at application initialization time. */\n public static initialize(logError?: LogFunction, logWarning?: LogFunction, logInfo?: LogFunction, logTrace?: LogFunction): void {\n Logger._logError = logError;\n Logger._logWarning = logWarning;\n Logger._logInfo = logInfo;\n Logger._logTrace = logTrace;\n Logger.turnOffLevelDefault();\n Logger.turnOffCategories();\n }\n\n /** Initialize the logger to output to the console. */\n public static initializeToConsole(): void {\n const logConsole = (level: string) => (category: string, message: string, metaData: LoggingMetaData) =>\n console.log(`${level} | ${category} | ${message} ${Logger.stringifyMetaData(metaData)}`); // eslint-disable-line no-console\n\n Logger.initialize(logConsole(\"Error\"), logConsole(\"Warning\"), logConsole(\"Info\"), logConsole(\"Trace\"));\n }\n\n /** merge the supplied metadata with all static metadata into one object */\n public static getMetaData(metaData?: LoggingMetaData): object {\n const metaObj = {};\n for (const meta of this._staticMetaData) {\n const val = BentleyError.getMetaData(meta[1]);\n if (val)\n Object.assign(metaObj, val);\n }\n Object.assign(metaObj, BentleyError.getMetaData(metaData)); // do this last so user supplied values take precedence\n return metaObj;\n }\n\n /** stringify the metadata for a log message by merging the supplied metadata with all static metadata into one object that is then `JSON.stringify`ed. */\n public static stringifyMetaData(metaData?: LoggingMetaData): string {\n const metaObj = this.getMetaData(metaData);\n return Object.keys(metaObj).length > 0 ? JSON.stringify(metaObj) : \"\";\n }\n\n /** Set the least severe level at which messages should be displayed by default. Call setLevel to override this default setting for specific categories. */\n public static setLevelDefault(minLevel: LogLevel): void {\n this._minLevel = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Set the minimum logging level for the specified category. The minimum level is least severe level at which messages in the\n * specified category should be displayed.\n */\n public static setLevel(category: string, minLevel: LogLevel) {\n Logger._categoryFilter[category] = minLevel;\n this.onLogLevelChanged.raiseEvent();\n }\n\n /** Interpret a string as the name of a LogLevel */\n public static parseLogLevel(str: string): LogLevel {\n switch (str.toUpperCase()) {\n case \"EXCEPTION\": return LogLevel.Error;\n case \"FATAL\": return LogLevel.Error;\n case \"ERROR\": return LogLevel.Error;\n case \"WARNING\": return LogLevel.Warning;\n case \"INFO\": return LogLevel.Info;\n case \"TRACE\": return LogLevel.Trace;\n case \"DEBUG\": return LogLevel.Trace;\n }\n return LogLevel.None;\n }\n\n /** Set the log level for multiple categories at once. Also see [[validateProps]] */\n public static configureLevels(cfg: LoggerLevelsConfig) {\n Logger.validateProps(cfg);\n if (cfg.defaultLevel !== undefined) {\n this.setLevelDefault(Logger.parseLogLevel(cfg.defaultLevel));\n }\n if (cfg.categoryLevels !== undefined) {\n for (const cl of cfg.categoryLevels) {\n this.setLevel(cl.category, Logger.parseLogLevel(cl.logLevel));\n }\n }\n }\n\n private static isLogLevel(v: string) {\n return LogLevel.hasOwnProperty(v);\n }\n\n /** Check that the specified object is a valid LoggerLevelsConfig. This is useful when reading a config from a .json file. */\n public static validateProps(config: any) {\n const validProps = [\"defaultLevel\", \"categoryLevels\"];\n for (const prop of Object.keys(config)) {\n if (!validProps.includes(prop))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig - unrecognized property: ${prop}`);\n if (prop === \"defaultLevel\") {\n if (!Logger.isLogLevel(config.defaultLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.defaultLevel must be a LogLevel. Invalid value: ${JSON.stringify(config.defaultLevel)}`);\n } else if (prop === \"categoryLevels\") {\n const value = config[prop];\n if (!Array.isArray(value))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels must be an array. Invalid value: ${JSON.stringify(value)}`);\n for (const item of config[prop]) {\n if (!item.hasOwnProperty(\"category\") || !item.hasOwnProperty(\"logLevel\"))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item must be a LoggerCategoryAndLevel {category: logLevel:}. Invalid value: ${JSON.stringify(item)}`);\n if (!Logger.isLogLevel(item.logLevel))\n throw new BentleyError(IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item's logLevel property must be a LogLevel. Invalid value: ${JSON.stringify(item.logLevel)}`);\n }\n }\n }\n }\n\n /** Get the minimum logging level for the specified category. */\n public static getLevel(category: string): LogLevel | undefined {\n // Prefer the level set for this category specifically\n const minLevelForThisCategory = Logger.categoryFilter[category];\n if (minLevelForThisCategory !== undefined)\n return minLevelForThisCategory;\n\n // Fall back on the level set for the parent of this category.\n const parent = category.lastIndexOf(\".\");\n if (parent !== -1)\n return Logger.getLevel(category.slice(0, parent));\n\n // Fall back on the default level.\n return Logger.minLevel;\n }\n\n /** Turns off the least severe level at which messages should be displayed by default.\n * This turns off logging for all messages for which no category minimum level is defined.\n */\n public static turnOffLevelDefault(): void {\n Logger._minLevel = undefined;\n }\n\n /** Turns off all category level filters previously defined with [[Logger.setLevel]].\n */\n public static turnOffCategories(): void {\n Logger._categoryFilter = {};\n }\n\n /** Check if messages in the specified category should be displayed at this level of severity. */\n public static isEnabled(category: string, level: LogLevel): boolean {\n const minLevel = Logger.getLevel(category);\n return (minLevel !== undefined) && (level >= minLevel);\n }\n\n /** Log the specified message to the **error** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logError(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logError && Logger.isEnabled(category, LogLevel.Error))\n Logger._logError(category, message, metaData);\n }\n\n private static getExceptionMessage(err: unknown): string {\n if (err === undefined) {\n return \"Error: err is undefined.\";\n }\n if (err === null) {\n return \"Error: err is null.\";\n }\n const stack = Logger.logExceptionCallstacks ? `\\n${BentleyError.getErrorStack(err)}` : \"\";\n return BentleyError.getErrorMessage(err) + stack;\n }\n\n /** Log the specified exception. The special \"ExceptionType\" property will be added as metadata.\n * @param category The category of the message.\n * @param err The exception object.\n * @param log The logger output function to use - defaults to Logger.logError\n */\n public static logException(category: string, err: any, log: LogFunction = (_category, message, metaData) => Logger.logError(_category, message, metaData)): void {\n log(category, Logger.getExceptionMessage(err), () => {\n return { ...BentleyError.getErrorMetadata(err), exceptionType: err?.constructor?.name ?? \"<Unknown>\"};\n });\n }\n\n /** Log the specified message to the **warning** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logWarning(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logWarning && Logger.isEnabled(category, LogLevel.Warning))\n Logger._logWarning(category, message, metaData);\n }\n\n /** Log the specified message to the **info** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logInfo(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logInfo && Logger.isEnabled(category, LogLevel.Info))\n Logger._logInfo(category, message, metaData);\n }\n\n /** Log the specified message to the **trace** stream.\n * @param category The category of the message.\n * @param message The message.\n * @param metaData Optional data for the message\n */\n public static logTrace(category: string, message: string, metaData?: LoggingMetaData): void {\n if (Logger._logTrace && Logger.isEnabled(category, LogLevel.Trace))\n Logger._logTrace(category, message, metaData);\n }\n}\n\n/** Simple performance diagnostics utility.\n * It measures the time from construction to disposal. On disposal it logs the routine name along with\n * the duration in milliseconds.\n * It also logs the routine name at construction time so that nested calls can be disambiguated.\n *\n * The timings are logged using the log category **Performance** and log severity [[LogLevel.INFO]].\n * Enable those, if you want to capture timings.\n * @public\n */\nexport class PerfLogger implements IDisposable {\n private static _severity: LogLevel = LogLevel.Info;\n\n private _operation: string;\n private _metaData?: LoggingMetaData;\n private _startTimeStamp: number;\n\n public constructor(operation: string, metaData?: LoggingMetaData) {\n this._operation = operation;\n this._metaData = metaData;\n\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity)) {\n this._startTimeStamp = 0;\n return;\n }\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},START`, this._metaData);\n this._startTimeStamp = new Date().getTime(); // take timestamp\n }\n\n private logMessage(): void {\n const endTimeStamp: number = new Date().getTime();\n if (!Logger.isEnabled(BentleyLoggerCategory.Performance, PerfLogger._severity))\n return;\n\n Logger.logInfo(BentleyLoggerCategory.Performance, `${this._operation},END`, () => {\n const mdata = this._metaData ? BentleyError.getMetaData(this._metaData) : {};\n return {\n ...mdata, TimeElapsed: endTimeStamp - this._startTimeStamp, // eslint-disable-line @typescript-eslint/naming-convention\n };\n });\n }\n\n public dispose(): void {\n this.logMessage();\n }\n}\n\n"]}
@@ -11,6 +11,7 @@ import { RepositoryStatus } from "./internal/RepositoryStatus";
11
11
  * @alpha
12
12
  */
13
13
  export class StatusCategory {
14
+ static { this.handlers = new Set(); }
14
15
  static for(error) {
15
16
  for (const handler of this.handlers) {
16
17
  const category = handler(error);
@@ -24,7 +25,6 @@ export class StatusCategory {
24
25
  return new UnknownError();
25
26
  }
26
27
  }
27
- StatusCategory.handlers = new Set();
28
28
  /***
29
29
  * A success status.
30
30
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"StatusCategory.js","sourceRoot":"","sources":["../../src/StatusCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAEL,aAAa,EACb,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAO/D;;GAEG;AACH,MAAM,OAAgB,cAAc;IAG3B,MAAM,CAAC,GAAG,CAAC,KAAY;QAC5B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,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,OAAO,CAAC,CAAC,OAAO,IAAI,YAAY,EAAE,CAAC;IACrC,CAAC;AACH,CAAC","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 Errors\n */\n\nimport {\n BentleyError,\n BentleyStatus,\n BriefcaseStatus,\n ChangeSetStatus,\n GeoServiceStatus,\n HttpStatus,\n IModelHubStatus,\n IModelStatus,\n RealityDataStatus,\n RpcInterfaceStatus,\n} from \"./BentleyError\";\nimport { RepositoryStatus } from \"./internal/RepositoryStatus\";\n\n/* eslint-disable @typescript-eslint/no-shadow */\n\n/** @alpha */\nexport type StatusCategoryHandler = (error: Error) => StatusCategory | undefined;\n\n/** A group of related statuses for aggregate reporting purposes.\n * @alpha\n */\nexport abstract class StatusCategory {\n public static handlers: Set<StatusCategoryHandler> = new Set();\n\n public static for(error: Error): StatusCategory {\n for (const handler of this.handlers) {\n const category = handler(error);\n if (category) {\n return category;\n }\n }\n\n const errorNumber = (error as BentleyError).errorNumber as unknown;\n if (typeof errorNumber === \"number\")\n return lookupHttpStatusCategory(errorNumber);\n\n return new UnknownError();\n }\n\n public abstract name: string;\n public abstract code: number;\n public abstract error: boolean;\n}\n\n/***\n * A success status.\n * @alpha\n */\nexport abstract class SuccessCategory extends StatusCategory {\n public error = false;\n}\n\n/**\n * An error status.\n * @alpha\n */\nexport abstract class ErrorCategory extends StatusCategory {\n public error = true;\n}\n\nnamespace HTTP {\n export class OK extends SuccessCategory { public name = \"OK\"; public code = 200; }\n export class Accepted extends SuccessCategory { public name = \"Accepted\"; public code = 202; }\n export class NoContent extends SuccessCategory { public name = \"NoContent\"; public code = 204; }\n\n export class BadRequest extends ErrorCategory { public name = \"BadRequest\"; public code = 400; }\n export class Unauthorized extends ErrorCategory { public name = \"Unauthorized\"; public code = 401; }\n export class Forbidden extends ErrorCategory { public name = \"Forbidden\"; public code = 403; }\n export class NotFound extends ErrorCategory { public name = \"NotFound\"; public code = 404; }\n export class RequestTimeout extends ErrorCategory { public name = \"RequestTimeout\"; public code = 408; }\n export class Conflict extends ErrorCategory { public name = \"Conflict\"; public code = 409; }\n export class Gone extends ErrorCategory { public name = \"Gone\"; public code = 410; }\n export class PreconditionFailed extends ErrorCategory { public name = \"PreconditionFailed\"; public code = 412; }\n export class ExpectationFailed extends ErrorCategory { public name = \"ExpectationFailed\"; public code = 417; }\n export class MisdirectedRequest extends ErrorCategory { public name = \"MisdirectedRequest\"; public code = 421; }\n export class UnprocessableEntity extends ErrorCategory { public name = \"UnprocessableEntity\"; public code = 422; }\n export class UpgradeRequired extends ErrorCategory { public name = \"UpgradeRequired\"; public code = 426; }\n export class PreconditionRequired extends ErrorCategory { public name = \"PreconditionRequired\"; public code = 428; }\n export class TooManyRequests extends ErrorCategory { public name = \"TooManyRequests\"; public code = 429; }\n\n export class InternalServerError extends ErrorCategory { public name = \"InternalServerError\"; public code = 500; }\n export class NotImplemented extends ErrorCategory { public name = \"NotImplemented\"; public code = 501; }\n}\n\nclass Success extends HTTP.OK { }\n\nclass Pending extends HTTP.Accepted { }\n\nclass NoContent extends HTTP.NoContent { }\nclass NothingToDo extends HTTP.NoContent { }\n\nclass BadRequest extends HTTP.BadRequest { }\n\nclass Forbidden extends HTTP.Forbidden { }\nclass PermissionsViolation extends HTTP.Forbidden { }\nclass ReadOnly extends HTTP.Forbidden { }\n\nclass NotFound extends HTTP.NotFound { }\n\nclass NotEnabled extends HTTP.UnprocessableEntity { }\nclass NotSupported extends HTTP.UnprocessableEntity { }\n\nclass ValidationError extends HTTP.BadRequest { }\n\nclass Timeout extends HTTP.RequestTimeout { }\n\nclass Conflict extends HTTP.Conflict { }\n\nclass Cancelled extends HTTP.Gone { }\n\nclass ConstraintViolation extends HTTP.Forbidden { }\nclass VersioningViolation extends HTTP.Forbidden { }\n\nclass Corruption extends HTTP.InternalServerError { }\nclass InvalidData extends HTTP.InternalServerError { }\nclass OperationFailed extends HTTP.InternalServerError { }\nclass StateViolation extends HTTP.InternalServerError { }\n\nclass Locked extends HTTP.Conflict { }\n\nclass NetworkError extends HTTP.InternalServerError { }\n\nclass Throttled extends HTTP.TooManyRequests { }\n\nclass FileSystemError extends HTTP.InternalServerError { }\nclass InternalError extends HTTP.InternalServerError { }\nclass UnknownError extends HTTP.InternalServerError { }\n\nclass NotImplemented extends HTTP.NotImplemented { }\n\nclass Aborted extends HTTP.BadRequest { }\n\nfunction lookupHttpStatusCategory(statusCode: number): StatusCategory {\n switch (statusCode) {\n case BentleyStatus.SUCCESS: return new Success();\n case BentleyStatus.ERROR: return new UnknownError();\n\n case IModelStatus.Success: return new Success();\n case IModelStatus.AlreadyLoaded: return new StateViolation();\n case IModelStatus.AlreadyOpen: return new StateViolation();\n case IModelStatus.BadArg: return new ValidationError();\n case IModelStatus.BadElement: return new ValidationError();\n case IModelStatus.BadModel: return new ValidationError();\n case IModelStatus.BadRequest: return new BadRequest();\n case IModelStatus.BadSchema: return new ValidationError();\n case IModelStatus.CannotUndo: return new OperationFailed();\n case IModelStatus.CodeNotReserved: return new StateViolation();\n case IModelStatus.DeletionProhibited: return new Forbidden();\n case IModelStatus.DuplicateCode: return new Conflict();\n case IModelStatus.DuplicateName: return new Conflict();\n case IModelStatus.ElementBlockedChange: return new ConstraintViolation();\n case IModelStatus.FileAlreadyExists: return new Conflict();\n case IModelStatus.FileNotFound: return new NotFound();\n case IModelStatus.FileNotLoaded: return new FileSystemError();\n case IModelStatus.ForeignKeyConstraint: return new ConstraintViolation();\n case IModelStatus.IdExists: return new Conflict();\n case IModelStatus.InDynamicTransaction: return new StateViolation();\n case IModelStatus.InvalidCategory: return new ValidationError();\n case IModelStatus.InvalidCode: return new ValidationError();\n case IModelStatus.InvalidCodeSpec: return new ValidationError();\n case IModelStatus.InvalidId: return new ValidationError();\n case IModelStatus.InvalidName: return new ValidationError();\n case IModelStatus.InvalidParent: return new Conflict();\n case IModelStatus.InvalidProfileVersion: return new InvalidData();\n case IModelStatus.IsCreatingChangeSet: return new StateViolation();\n case IModelStatus.LockNotHeld: return new Forbidden();\n case IModelStatus.Mismatch2d3d: return new ValidationError();\n case IModelStatus.MismatchGcs: return new ValidationError();\n case IModelStatus.MissingDomain: return new ValidationError();\n case IModelStatus.MissingHandler: return new ValidationError();\n case IModelStatus.MissingId: return new ValidationError();\n case IModelStatus.NoGeometry: return new NoContent();\n case IModelStatus.NoMultiTxnOperation: return new StateViolation();\n case IModelStatus.NotEnabled: return new NotEnabled();\n case IModelStatus.NotFound: return new NotFound();\n case IModelStatus.NotOpen: return new StateViolation();\n case IModelStatus.NotOpenForWrite: return new Forbidden();\n case IModelStatus.NotSameUnitBase: return new ValidationError();\n case IModelStatus.NothingToRedo: return new NothingToDo();\n case IModelStatus.NothingToUndo: return new NothingToDo();\n case IModelStatus.ParentBlockedChange: return new Forbidden();\n case IModelStatus.ReadError: return new FileSystemError();\n case IModelStatus.ReadOnly: return new ReadOnly();\n case IModelStatus.ReadOnlyDomain: return new ReadOnly();\n case IModelStatus.RepositoryManagerError: return new NetworkError();\n case IModelStatus.SQLiteError: return new InternalError();\n case IModelStatus.TransactionActive: return new StateViolation();\n case IModelStatus.UnitsMissing: return new ValidationError();\n case IModelStatus.UnknownFormat: return new InvalidData();\n case IModelStatus.UpgradeFailed: return new OperationFailed();\n case IModelStatus.ValidationFailed: return new ValidationError();\n case IModelStatus.VersionTooNew: return new VersioningViolation();\n case IModelStatus.VersionTooOld: return new VersioningViolation();\n case IModelStatus.ViewNotFound: return new NotFound();\n case IModelStatus.WriteError: return new FileSystemError();\n case IModelStatus.WrongClass: return new ValidationError();\n case IModelStatus.WrongIModel: return new ValidationError();\n case IModelStatus.WrongDomain: return new ValidationError();\n case IModelStatus.WrongElement: return new ValidationError();\n case IModelStatus.WrongHandler: return new ValidationError();\n case IModelStatus.WrongModel: return new ValidationError();\n case IModelStatus.ConstraintNotUnique: return new ConstraintViolation();\n case IModelStatus.NoGeoLocation: return new ValidationError();\n case IModelStatus.ServerTimeout: return new Timeout();\n case IModelStatus.NoContent: return new NoContent();\n case IModelStatus.NotRegistered: return new NotImplemented();\n case IModelStatus.FunctionNotFound: return new NotImplemented();\n case IModelStatus.NoActiveCommand: return new StateViolation();\n case IModelStatus.Aborted: return new Aborted();\n\n case BriefcaseStatus.CannotAcquire: return new OperationFailed();\n case BriefcaseStatus.CannotDownload: return new OperationFailed();\n case BriefcaseStatus.CannotUpload: return new OperationFailed();\n case BriefcaseStatus.CannotCopy: return new OperationFailed();\n case BriefcaseStatus.CannotDelete: return new OperationFailed();\n case BriefcaseStatus.VersionNotFound: return new NotFound();\n case BriefcaseStatus.CannotApplyChanges: return new OperationFailed();\n case BriefcaseStatus.DownloadCancelled: return new Cancelled();\n case BriefcaseStatus.ContainsDeletedChangeSets: return new ValidationError();\n\n case RpcInterfaceStatus.Success: return new Success();\n case RpcInterfaceStatus.IncompatibleVersion: return new VersioningViolation();\n\n case ChangeSetStatus.Success: return new Success();\n case ChangeSetStatus.ApplyError: return new OperationFailed();\n case ChangeSetStatus.ChangeTrackingNotEnabled: return new NotEnabled();\n case ChangeSetStatus.CorruptedChangeStream: return new Corruption();\n case ChangeSetStatus.FileNotFound: return new NotFound();\n case ChangeSetStatus.FileWriteError: return new FileSystemError();\n case ChangeSetStatus.HasLocalChanges: return new StateViolation();\n case ChangeSetStatus.HasUncommittedChanges: return new StateViolation();\n case ChangeSetStatus.InvalidId: return new Corruption();\n case ChangeSetStatus.InvalidVersion: return new Corruption();\n case ChangeSetStatus.InDynamicTransaction: return new StateViolation();\n case ChangeSetStatus.IsCreatingChangeSet: return new StateViolation();\n case ChangeSetStatus.IsNotCreatingChangeSet: return new StateViolation();\n case ChangeSetStatus.MergePropagationError: return new OperationFailed();\n case ChangeSetStatus.NothingToMerge: return new NothingToDo();\n case ChangeSetStatus.NoTransactions: return new OperationFailed();\n case ChangeSetStatus.ParentMismatch: return new ValidationError();\n case ChangeSetStatus.SQLiteError: return new InternalError();\n case ChangeSetStatus.WrongDgnDb: return new ValidationError();\n case ChangeSetStatus.CouldNotOpenDgnDb: return new OperationFailed();\n case ChangeSetStatus.MergeSchemaChangesOnOpen: return new BadRequest();\n case ChangeSetStatus.ReverseOrReinstateSchemaChanges: return new Conflict();\n case ChangeSetStatus.ProcessSchemaChangesOnOpen: return new BadRequest();\n case ChangeSetStatus.CannotMergeIntoReadonly: return new ValidationError();\n case ChangeSetStatus.CannotMergeIntoMaster: return new ValidationError();\n case ChangeSetStatus.CannotMergeIntoReversed: return new ValidationError();\n\n case RepositoryStatus.Success: return new Success();\n case RepositoryStatus.ServerUnavailable: return new NetworkError();\n case RepositoryStatus.LockAlreadyHeld: return new Conflict();\n case RepositoryStatus.SyncError: return new NetworkError();\n case RepositoryStatus.InvalidResponse: return new NetworkError();\n case RepositoryStatus.PendingTransactions: return new StateViolation();\n case RepositoryStatus.LockUsed: return new StateViolation();\n case RepositoryStatus.CannotCreateChangeSet: return new InternalError();\n case RepositoryStatus.InvalidRequest: return new NetworkError();\n case RepositoryStatus.ChangeSetRequired: return new StateViolation();\n case RepositoryStatus.CodeUnavailable: return new Conflict();\n case RepositoryStatus.CodeNotReserved: return new StateViolation();\n case RepositoryStatus.CodeUsed: return new StateViolation();\n case RepositoryStatus.LockNotHeld: return new Forbidden();\n case RepositoryStatus.RepositoryIsLocked: return new Locked();\n case RepositoryStatus.ChannelConstraintViolation: return new ConstraintViolation();\n\n case HttpStatus.Success: return new Success();\n\n case IModelHubStatus.Success: return new Success();\n case IModelHubStatus.Unknown: return new UnknownError();\n case IModelHubStatus.MissingRequiredProperties: return new ValidationError();\n case IModelHubStatus.InvalidPropertiesValues: return new ValidationError();\n case IModelHubStatus.UserDoesNotHavePermission: return new PermissionsViolation();\n case IModelHubStatus.UserDoesNotHaveAccess: return new PermissionsViolation();\n case IModelHubStatus.InvalidBriefcase: return new ValidationError();\n case IModelHubStatus.BriefcaseDoesNotExist: return new NotFound();\n case IModelHubStatus.BriefcaseDoesNotBelongToUser: return new PermissionsViolation();\n case IModelHubStatus.AnotherUserPushing: return new StateViolation();\n case IModelHubStatus.ChangeSetAlreadyExists: return new Conflict();\n case IModelHubStatus.ChangeSetDoesNotExist: return new NotFound();\n case IModelHubStatus.FileIsNotUploaded: return new StateViolation();\n case IModelHubStatus.iModelIsNotInitialized: return new StateViolation();\n case IModelHubStatus.ChangeSetPointsToBadSeed: return new InvalidData();\n case IModelHubStatus.OperationFailed: return new OperationFailed();\n case IModelHubStatus.PullIsRequired: return new StateViolation();\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUser: return new Throttled();\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUserPerMinute: return new Throttled();\n case IModelHubStatus.DatabaseTemporarilyLocked: return new Locked();\n case IModelHubStatus.iModelIsLocked: return new Locked();\n case IModelHubStatus.CodesExist: return new Conflict();\n case IModelHubStatus.LocksExist: return new Conflict();\n case IModelHubStatus.iModelAlreadyExists: return new Conflict();\n case IModelHubStatus.iModelDoesNotExist: return new NotFound();\n case IModelHubStatus.FileDoesNotExist: return new NotFound();\n case IModelHubStatus.FileAlreadyExists: return new Conflict();\n case IModelHubStatus.LockDoesNotExist: return new NotFound();\n case IModelHubStatus.LockOwnedByAnotherBriefcase: return new Conflict();\n case IModelHubStatus.CodeStateInvalid: return new StateViolation();\n case IModelHubStatus.CodeReservedByAnotherBriefcase: return new Conflict();\n case IModelHubStatus.CodeDoesNotExist: return new NotFound();\n case IModelHubStatus.EventTypeDoesNotExist: return new NotFound();\n case IModelHubStatus.EventSubscriptionDoesNotExist: return new NotFound();\n case IModelHubStatus.EventSubscriptionAlreadyExists: return new StateViolation();\n case IModelHubStatus.ITwinIdIsNotSpecified: return new ValidationError();\n case IModelHubStatus.FailedToGetITwinPermissions: return new OperationFailed();\n case IModelHubStatus.FailedToGetITwinMembers: return new OperationFailed();\n case IModelHubStatus.ChangeSetAlreadyHasVersion: return new Conflict();\n case IModelHubStatus.VersionAlreadyExists: return new Conflict();\n case IModelHubStatus.JobSchedulingFailed: return new InternalError();\n case IModelHubStatus.ConflictsAggregate: return new Conflict();\n case IModelHubStatus.FailedToGetITwinById: return new OperationFailed();\n case IModelHubStatus.DatabaseOperationFailed: return new OperationFailed();\n case IModelHubStatus.SeedFileInitializationFailed: return new OperationFailed();\n case IModelHubStatus.FailedToGetAssetPermissions: return new OperationFailed();\n case IModelHubStatus.FailedToGetAssetMembers: return new OperationFailed();\n case IModelHubStatus.ITwinDoesNotExist: return new NotFound();\n case IModelHubStatus.LockChunkDoesNotExist: return new NotFound();\n case IModelHubStatus.CheckpointAlreadyExists: return new Conflict();\n case IModelHubStatus.CheckpointDoesNotExist: return new NotFound();\n case IModelHubStatus.UndefinedArgumentError: return new ValidationError();\n case IModelHubStatus.InvalidArgumentError: return new ValidationError();\n case IModelHubStatus.MissingDownloadUrlError: return new ValidationError();\n case IModelHubStatus.NotSupportedInBrowser: return new NotSupported();\n case IModelHubStatus.FileHandlerNotSet: return new NotImplemented();\n case IModelHubStatus.FileNotFound: return new NotFound();\n case IModelHubStatus.InitializationTimeout: return new Timeout();\n\n case GeoServiceStatus.Success: return new Success();\n case GeoServiceStatus.NoGeoLocation: return new ValidationError();\n case GeoServiceStatus.OutOfUsefulRange: return new ValidationError();\n case GeoServiceStatus.OutOfMathematicalDomain: return new ValidationError();\n case GeoServiceStatus.NoDatumConverter: return new OperationFailed();\n case GeoServiceStatus.VerticalDatumConvertError: return new OperationFailed();\n case GeoServiceStatus.CSMapError: return new InternalError();\n case GeoServiceStatus.Pending: return new Pending();\n\n case RealityDataStatus.Success: return new Success();\n case RealityDataStatus.InvalidData: return new InvalidData();\n\n default: return new UnknownError();\n }\n}\n"]}
1
+ {"version":3,"file":"StatusCategory.js","sourceRoot":"","sources":["../../src/StatusCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAEL,aAAa,EACb,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EAC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AAC,CAAC,OAAO,IAAI,aAAa,EAAE,CAAC;QAC7D,KAAK,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,EAAE,CAAC;QAEpD,KAAK,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,EAAE,CAAC;QACrD,KAAK,iBAAiB,CAAC,WAAW,CAAC,CAAC,OAAO,IAAI,WAAW,EAAE,CAAC;QAE7D,OAAO,CAAC,CAAC,OAAO,IAAI,YAAY,EAAE,CAAC;IACrC,CAAC;AACH,CAAC","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 Errors\n */\n\nimport {\n BentleyError,\n BentleyStatus,\n BriefcaseStatus,\n ChangeSetStatus,\n GeoServiceStatus,\n HttpStatus,\n IModelHubStatus,\n IModelStatus,\n RealityDataStatus,\n RpcInterfaceStatus,\n} from \"./BentleyError\";\nimport { RepositoryStatus } from \"./internal/RepositoryStatus\";\n\n/* eslint-disable @typescript-eslint/no-shadow */\n\n/** @alpha */\nexport type StatusCategoryHandler = (error: Error) => StatusCategory | undefined;\n\n/** A group of related statuses for aggregate reporting purposes.\n * @alpha\n */\nexport abstract class StatusCategory {\n public static handlers: Set<StatusCategoryHandler> = new Set();\n\n public static for(error: Error): StatusCategory {\n for (const handler of this.handlers) {\n const category = handler(error);\n if (category) {\n return category;\n }\n }\n\n const errorNumber = (error as BentleyError).errorNumber as unknown;\n if (typeof errorNumber === \"number\")\n return lookupHttpStatusCategory(errorNumber);\n\n return new UnknownError();\n }\n\n public abstract name: string;\n public abstract code: number;\n public abstract error: boolean;\n}\n\n/***\n * A success status.\n * @alpha\n */\nexport abstract class SuccessCategory extends StatusCategory {\n public error = false;\n}\n\n/**\n * An error status.\n * @alpha\n */\nexport abstract class ErrorCategory extends StatusCategory {\n public error = true;\n}\n\nnamespace HTTP {\n export class OK extends SuccessCategory { public name = \"OK\"; public code = 200; }\n export class Accepted extends SuccessCategory { public name = \"Accepted\"; public code = 202; }\n export class NoContent extends SuccessCategory { public name = \"NoContent\"; public code = 204; }\n\n export class BadRequest extends ErrorCategory { public name = \"BadRequest\"; public code = 400; }\n export class Unauthorized extends ErrorCategory { public name = \"Unauthorized\"; public code = 401; }\n export class Forbidden extends ErrorCategory { public name = \"Forbidden\"; public code = 403; }\n export class NotFound extends ErrorCategory { public name = \"NotFound\"; public code = 404; }\n export class RequestTimeout extends ErrorCategory { public name = \"RequestTimeout\"; public code = 408; }\n export class Conflict extends ErrorCategory { public name = \"Conflict\"; public code = 409; }\n export class Gone extends ErrorCategory { public name = \"Gone\"; public code = 410; }\n export class PreconditionFailed extends ErrorCategory { public name = \"PreconditionFailed\"; public code = 412; }\n export class ExpectationFailed extends ErrorCategory { public name = \"ExpectationFailed\"; public code = 417; }\n export class MisdirectedRequest extends ErrorCategory { public name = \"MisdirectedRequest\"; public code = 421; }\n export class UnprocessableEntity extends ErrorCategory { public name = \"UnprocessableEntity\"; public code = 422; }\n export class UpgradeRequired extends ErrorCategory { public name = \"UpgradeRequired\"; public code = 426; }\n export class PreconditionRequired extends ErrorCategory { public name = \"PreconditionRequired\"; public code = 428; }\n export class TooManyRequests extends ErrorCategory { public name = \"TooManyRequests\"; public code = 429; }\n\n export class InternalServerError extends ErrorCategory { public name = \"InternalServerError\"; public code = 500; }\n export class NotImplemented extends ErrorCategory { public name = \"NotImplemented\"; public code = 501; }\n}\n\nclass Success extends HTTP.OK { }\n\nclass Pending extends HTTP.Accepted { }\n\nclass NoContent extends HTTP.NoContent { }\nclass NothingToDo extends HTTP.NoContent { }\n\nclass BadRequest extends HTTP.BadRequest { }\n\nclass Forbidden extends HTTP.Forbidden { }\nclass PermissionsViolation extends HTTP.Forbidden { }\nclass ReadOnly extends HTTP.Forbidden { }\n\nclass NotFound extends HTTP.NotFound { }\n\nclass NotEnabled extends HTTP.UnprocessableEntity { }\nclass NotSupported extends HTTP.UnprocessableEntity { }\n\nclass ValidationError extends HTTP.BadRequest { }\n\nclass Timeout extends HTTP.RequestTimeout { }\n\nclass Conflict extends HTTP.Conflict { }\n\nclass Cancelled extends HTTP.Gone { }\n\nclass ConstraintViolation extends HTTP.Forbidden { }\nclass VersioningViolation extends HTTP.Forbidden { }\n\nclass Corruption extends HTTP.InternalServerError { }\nclass InvalidData extends HTTP.InternalServerError { }\nclass OperationFailed extends HTTP.InternalServerError { }\nclass StateViolation extends HTTP.InternalServerError { }\n\nclass Locked extends HTTP.Conflict { }\n\nclass NetworkError extends HTTP.InternalServerError { }\n\nclass Throttled extends HTTP.TooManyRequests { }\n\nclass FileSystemError extends HTTP.InternalServerError { }\nclass InternalError extends HTTP.InternalServerError { }\nclass UnknownError extends HTTP.InternalServerError { }\n\nclass NotImplemented extends HTTP.NotImplemented { }\n\nclass Aborted extends HTTP.BadRequest { }\n\nfunction lookupHttpStatusCategory(statusCode: number): StatusCategory {\n switch (statusCode) {\n case BentleyStatus.SUCCESS: return new Success();\n case BentleyStatus.ERROR: return new UnknownError();\n\n case IModelStatus.Success: return new Success();\n case IModelStatus.AlreadyLoaded: return new StateViolation();\n case IModelStatus.AlreadyOpen: return new StateViolation();\n case IModelStatus.BadArg: return new ValidationError();\n case IModelStatus.BadElement: return new ValidationError();\n case IModelStatus.BadModel: return new ValidationError();\n case IModelStatus.BadRequest: return new BadRequest();\n case IModelStatus.BadSchema: return new ValidationError();\n case IModelStatus.CannotUndo: return new OperationFailed();\n case IModelStatus.CodeNotReserved: return new StateViolation();\n case IModelStatus.DeletionProhibited: return new Forbidden();\n case IModelStatus.DuplicateCode: return new Conflict();\n case IModelStatus.DuplicateName: return new Conflict();\n case IModelStatus.ElementBlockedChange: return new ConstraintViolation();\n case IModelStatus.FileAlreadyExists: return new Conflict();\n case IModelStatus.FileNotFound: return new NotFound();\n case IModelStatus.FileNotLoaded: return new FileSystemError();\n case IModelStatus.ForeignKeyConstraint: return new ConstraintViolation();\n case IModelStatus.IdExists: return new Conflict();\n case IModelStatus.InDynamicTransaction: return new StateViolation();\n case IModelStatus.InvalidCategory: return new ValidationError();\n case IModelStatus.InvalidCode: return new ValidationError();\n case IModelStatus.InvalidCodeSpec: return new ValidationError();\n case IModelStatus.InvalidId: return new ValidationError();\n case IModelStatus.InvalidName: return new ValidationError();\n case IModelStatus.InvalidParent: return new Conflict();\n case IModelStatus.InvalidProfileVersion: return new InvalidData();\n case IModelStatus.IsCreatingChangeSet: return new StateViolation();\n case IModelStatus.LockNotHeld: return new Forbidden();\n case IModelStatus.Mismatch2d3d: return new ValidationError();\n case IModelStatus.MismatchGcs: return new ValidationError();\n case IModelStatus.MissingDomain: return new ValidationError();\n case IModelStatus.MissingHandler: return new ValidationError();\n case IModelStatus.MissingId: return new ValidationError();\n case IModelStatus.NoGeometry: return new NoContent();\n case IModelStatus.NoMultiTxnOperation: return new StateViolation();\n case IModelStatus.NotEnabled: return new NotEnabled();\n case IModelStatus.NotFound: return new NotFound();\n case IModelStatus.NotOpen: return new StateViolation();\n case IModelStatus.NotOpenForWrite: return new Forbidden();\n case IModelStatus.NotSameUnitBase: return new ValidationError();\n case IModelStatus.NothingToRedo: return new NothingToDo();\n case IModelStatus.NothingToUndo: return new NothingToDo();\n case IModelStatus.ParentBlockedChange: return new Forbidden();\n case IModelStatus.ReadError: return new FileSystemError();\n case IModelStatus.ReadOnly: return new ReadOnly();\n case IModelStatus.ReadOnlyDomain: return new ReadOnly();\n case IModelStatus.RepositoryManagerError: return new NetworkError();\n case IModelStatus.SQLiteError: return new InternalError();\n case IModelStatus.TransactionActive: return new StateViolation();\n case IModelStatus.UnitsMissing: return new ValidationError();\n case IModelStatus.UnknownFormat: return new InvalidData();\n case IModelStatus.UpgradeFailed: return new OperationFailed();\n case IModelStatus.ValidationFailed: return new ValidationError();\n case IModelStatus.VersionTooNew: return new VersioningViolation();\n case IModelStatus.VersionTooOld: return new VersioningViolation();\n case IModelStatus.ViewNotFound: return new NotFound();\n case IModelStatus.WriteError: return new FileSystemError();\n case IModelStatus.WrongClass: return new ValidationError();\n case IModelStatus.WrongIModel: return new ValidationError();\n case IModelStatus.WrongDomain: return new ValidationError();\n case IModelStatus.WrongElement: return new ValidationError();\n case IModelStatus.WrongHandler: return new ValidationError();\n case IModelStatus.WrongModel: return new ValidationError();\n case IModelStatus.ConstraintNotUnique: return new ConstraintViolation();\n case IModelStatus.NoGeoLocation: return new ValidationError();\n case IModelStatus.ServerTimeout: return new Timeout();\n case IModelStatus.NoContent: return new NoContent();\n case IModelStatus.NotRegistered: return new NotImplemented();\n case IModelStatus.FunctionNotFound: return new NotImplemented();\n case IModelStatus.NoActiveCommand: return new StateViolation();\n case IModelStatus.Aborted: return new Aborted();\n\n case BriefcaseStatus.CannotAcquire: return new OperationFailed();\n case BriefcaseStatus.CannotDownload: return new OperationFailed();\n case BriefcaseStatus.CannotUpload: return new OperationFailed();\n case BriefcaseStatus.CannotCopy: return new OperationFailed();\n case BriefcaseStatus.CannotDelete: return new OperationFailed();\n case BriefcaseStatus.VersionNotFound: return new NotFound();\n case BriefcaseStatus.CannotApplyChanges: return new OperationFailed();\n case BriefcaseStatus.DownloadCancelled: return new Cancelled();\n case BriefcaseStatus.ContainsDeletedChangeSets: return new ValidationError();\n\n case RpcInterfaceStatus.Success: return new Success();\n case RpcInterfaceStatus.IncompatibleVersion: return new VersioningViolation();\n\n case ChangeSetStatus.Success: return new Success();\n case ChangeSetStatus.ApplyError: return new OperationFailed();\n case ChangeSetStatus.ChangeTrackingNotEnabled: return new NotEnabled();\n case ChangeSetStatus.CorruptedChangeStream: return new Corruption();\n case ChangeSetStatus.FileNotFound: return new NotFound();\n case ChangeSetStatus.FileWriteError: return new FileSystemError();\n case ChangeSetStatus.HasLocalChanges: return new StateViolation();\n case ChangeSetStatus.HasUncommittedChanges: return new StateViolation();\n case ChangeSetStatus.InvalidId: return new Corruption();\n case ChangeSetStatus.InvalidVersion: return new Corruption();\n case ChangeSetStatus.InDynamicTransaction: return new StateViolation();\n case ChangeSetStatus.IsCreatingChangeSet: return new StateViolation();\n case ChangeSetStatus.IsNotCreatingChangeSet: return new StateViolation();\n case ChangeSetStatus.MergePropagationError: return new OperationFailed();\n case ChangeSetStatus.NothingToMerge: return new NothingToDo();\n case ChangeSetStatus.NoTransactions: return new OperationFailed();\n case ChangeSetStatus.ParentMismatch: return new ValidationError();\n case ChangeSetStatus.SQLiteError: return new InternalError();\n case ChangeSetStatus.WrongDgnDb: return new ValidationError();\n case ChangeSetStatus.CouldNotOpenDgnDb: return new OperationFailed();\n case ChangeSetStatus.MergeSchemaChangesOnOpen: return new BadRequest();\n case ChangeSetStatus.ReverseOrReinstateSchemaChanges: return new Conflict();\n case ChangeSetStatus.ProcessSchemaChangesOnOpen: return new BadRequest();\n case ChangeSetStatus.CannotMergeIntoReadonly: return new ValidationError();\n case ChangeSetStatus.CannotMergeIntoMaster: return new ValidationError();\n case ChangeSetStatus.CannotMergeIntoReversed: return new ValidationError();\n\n case RepositoryStatus.Success: return new Success();\n case RepositoryStatus.ServerUnavailable: return new NetworkError();\n case RepositoryStatus.LockAlreadyHeld: return new Conflict();\n case RepositoryStatus.SyncError: return new NetworkError();\n case RepositoryStatus.InvalidResponse: return new NetworkError();\n case RepositoryStatus.PendingTransactions: return new StateViolation();\n case RepositoryStatus.LockUsed: return new StateViolation();\n case RepositoryStatus.CannotCreateChangeSet: return new InternalError();\n case RepositoryStatus.InvalidRequest: return new NetworkError();\n case RepositoryStatus.ChangeSetRequired: return new StateViolation();\n case RepositoryStatus.CodeUnavailable: return new Conflict();\n case RepositoryStatus.CodeNotReserved: return new StateViolation();\n case RepositoryStatus.CodeUsed: return new StateViolation();\n case RepositoryStatus.LockNotHeld: return new Forbidden();\n case RepositoryStatus.RepositoryIsLocked: return new Locked();\n case RepositoryStatus.ChannelConstraintViolation: return new ConstraintViolation();\n\n case HttpStatus.Success: return new Success();\n\n case IModelHubStatus.Success: return new Success();\n case IModelHubStatus.Unknown: return new UnknownError();\n case IModelHubStatus.MissingRequiredProperties: return new ValidationError();\n case IModelHubStatus.InvalidPropertiesValues: return new ValidationError();\n case IModelHubStatus.UserDoesNotHavePermission: return new PermissionsViolation();\n case IModelHubStatus.UserDoesNotHaveAccess: return new PermissionsViolation();\n case IModelHubStatus.InvalidBriefcase: return new ValidationError();\n case IModelHubStatus.BriefcaseDoesNotExist: return new NotFound();\n case IModelHubStatus.BriefcaseDoesNotBelongToUser: return new PermissionsViolation();\n case IModelHubStatus.AnotherUserPushing: return new StateViolation();\n case IModelHubStatus.ChangeSetAlreadyExists: return new Conflict();\n case IModelHubStatus.ChangeSetDoesNotExist: return new NotFound();\n case IModelHubStatus.FileIsNotUploaded: return new StateViolation();\n case IModelHubStatus.iModelIsNotInitialized: return new StateViolation();\n case IModelHubStatus.ChangeSetPointsToBadSeed: return new InvalidData();\n case IModelHubStatus.OperationFailed: return new OperationFailed();\n case IModelHubStatus.PullIsRequired: return new StateViolation();\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUser: return new Throttled();\n case IModelHubStatus.MaximumNumberOfBriefcasesPerUserPerMinute: return new Throttled();\n case IModelHubStatus.DatabaseTemporarilyLocked: return new Locked();\n case IModelHubStatus.iModelIsLocked: return new Locked();\n case IModelHubStatus.CodesExist: return new Conflict();\n case IModelHubStatus.LocksExist: return new Conflict();\n case IModelHubStatus.iModelAlreadyExists: return new Conflict();\n case IModelHubStatus.iModelDoesNotExist: return new NotFound();\n case IModelHubStatus.FileDoesNotExist: return new NotFound();\n case IModelHubStatus.FileAlreadyExists: return new Conflict();\n case IModelHubStatus.LockDoesNotExist: return new NotFound();\n case IModelHubStatus.LockOwnedByAnotherBriefcase: return new Conflict();\n case IModelHubStatus.CodeStateInvalid: return new StateViolation();\n case IModelHubStatus.CodeReservedByAnotherBriefcase: return new Conflict();\n case IModelHubStatus.CodeDoesNotExist: return new NotFound();\n case IModelHubStatus.EventTypeDoesNotExist: return new NotFound();\n case IModelHubStatus.EventSubscriptionDoesNotExist: return new NotFound();\n case IModelHubStatus.EventSubscriptionAlreadyExists: return new StateViolation();\n case IModelHubStatus.ITwinIdIsNotSpecified: return new ValidationError();\n case IModelHubStatus.FailedToGetITwinPermissions: return new OperationFailed();\n case IModelHubStatus.FailedToGetITwinMembers: return new OperationFailed();\n case IModelHubStatus.ChangeSetAlreadyHasVersion: return new Conflict();\n case IModelHubStatus.VersionAlreadyExists: return new Conflict();\n case IModelHubStatus.JobSchedulingFailed: return new InternalError();\n case IModelHubStatus.ConflictsAggregate: return new Conflict();\n case IModelHubStatus.FailedToGetITwinById: return new OperationFailed();\n case IModelHubStatus.DatabaseOperationFailed: return new OperationFailed();\n case IModelHubStatus.SeedFileInitializationFailed: return new OperationFailed();\n case IModelHubStatus.FailedToGetAssetPermissions: return new OperationFailed();\n case IModelHubStatus.FailedToGetAssetMembers: return new OperationFailed();\n case IModelHubStatus.ITwinDoesNotExist: return new NotFound();\n case IModelHubStatus.LockChunkDoesNotExist: return new NotFound();\n case IModelHubStatus.CheckpointAlreadyExists: return new Conflict();\n case IModelHubStatus.CheckpointDoesNotExist: return new NotFound();\n case IModelHubStatus.UndefinedArgumentError: return new ValidationError();\n case IModelHubStatus.InvalidArgumentError: return new ValidationError();\n case IModelHubStatus.MissingDownloadUrlError: return new ValidationError();\n case IModelHubStatus.NotSupportedInBrowser: return new NotSupported();\n case IModelHubStatus.FileHandlerNotSet: return new NotImplemented();\n case IModelHubStatus.FileNotFound: return new NotFound();\n case IModelHubStatus.InitializationTimeout: return new Timeout();\n\n case GeoServiceStatus.Success: return new Success();\n case GeoServiceStatus.NoGeoLocation: return new ValidationError();\n case GeoServiceStatus.OutOfUsefulRange: return new ValidationError();\n case GeoServiceStatus.OutOfMathematicalDomain: return new ValidationError();\n case GeoServiceStatus.NoDatumConverter: return new OperationFailed();\n case GeoServiceStatus.VerticalDatumConvertError: return new OperationFailed();\n case GeoServiceStatus.CSMapError: return new InternalError();\n case GeoServiceStatus.Pending: return new Pending();\n\n case RealityDataStatus.Success: return new Success();\n case RealityDataStatus.InvalidData: return new InvalidData();\n\n default: return new UnknownError();\n }\n}\n"]}
@@ -5,7 +5,6 @@
5
5
  /** @packageDocumentation
6
6
  * @module Errors
7
7
  */
8
- var _a;
9
8
  import { Logger } from "./Logger";
10
9
  /**
11
10
  * Utility for handling/reporting unexpected runtime errors. This class establishes a global handler for
@@ -15,6 +14,16 @@ import { Logger } from "./Logger";
15
14
  * @public
16
15
  */
17
16
  export class UnexpectedErrors {
17
+ /** handler for re-throwing exceptions directly */
18
+ static { this.reThrowImmediate = (e) => { throw e; }; }
19
+ /** handler for re-throwing exceptions from an asynchronous interval (so the current call stack is not aborted) */
20
+ static { this.reThrowDeferred = (e) => setTimeout(() => { throw e; }, 0); }
21
+ /** handler for logging exception to console */
22
+ static { this.consoleLog = (e) => console.error(e); } // eslint-disable-line no-console
23
+ /** handler for logging exception with [[Logger]] */
24
+ static { this.errorLog = (e) => Logger.logException("unhandled", e); }
25
+ static { this._telemetry = []; }
26
+ static { this._handler = this.errorLog; } // default to error logging
18
27
  constructor() { } // this is a singleton
19
28
  /** Add a "telemetry tracker" for unexpected errors. Useful for tracking/reporting errors without changing handler.
20
29
  * @returns a method to remove the tracker
@@ -51,15 +60,4 @@ export class UnexpectedErrors {
51
60
  return oldHandler;
52
61
  }
53
62
  }
54
- _a = UnexpectedErrors;
55
- /** handler for re-throwing exceptions directly */
56
- UnexpectedErrors.reThrowImmediate = (e) => { throw e; };
57
- /** handler for re-throwing exceptions from an asynchronous interval (so the current call stack is not aborted) */
58
- UnexpectedErrors.reThrowDeferred = (e) => setTimeout(() => { throw e; }, 0);
59
- /** handler for logging exception to console */
60
- UnexpectedErrors.consoleLog = (e) => console.error(e); // eslint-disable-line no-console
61
- /** handler for logging exception with [[Logger]] */
62
- UnexpectedErrors.errorLog = (e) => Logger.logException("unhandled", e);
63
- UnexpectedErrors._telemetry = [];
64
- UnexpectedErrors._handler = _a.errorLog; // default to error logging
65
63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HAAkH;AAC3F,gCAAe,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,AAAhD,CAAiD;AACvF,+CAA+C;AACxB,2BAAU,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,AAA/B,CAAgC,CAAC,iCAAiC;AACnG,oDAAoD;AAC7B,yBAAQ,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,AAAlD,CAAmD;AAEnE,2BAAU,GAAwB,EAAE,AAA1B,CAA2B;AACrC,yBAAQ,GAAG,EAAI,CAAC,QAAQ,AAAhB,CAAiB,CAAC,2BAA2B","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 Errors\n */\n\nimport { Logger } from \"./Logger\";\n\n/** A function to be notified when an unexpected error happens\n * @public\n */\nexport type OnUnexpectedError = (error: any) => void;\n\n/**\n * Utility for handling/reporting unexpected runtime errors. This class establishes a global handler for\n * unexpected errors, and programmers should use its `handle` method when they occur. Generally, unexpected\n * errors should not cause program termination, and should instead be logged and swallowed. However, for\n * development/debugging, it can be helpful to re-throw exceptions so they are not missed.\n * @public\n */\nexport class UnexpectedErrors {\n /** handler for re-throwing exceptions directly */\n public static readonly reThrowImmediate = (e: any) => { throw e; };\n /** handler for re-throwing exceptions from an asynchronous interval (so the current call stack is not aborted) */\n public static readonly reThrowDeferred = (e: any) => setTimeout(() => { throw e; }, 0);\n /** handler for logging exception to console */\n public static readonly consoleLog = (e: any) => console.error(e); // eslint-disable-line no-console\n /** handler for logging exception with [[Logger]] */\n public static readonly errorLog = (e: any) => Logger.logException(\"unhandled\", e);\n\n private static _telemetry: OnUnexpectedError[] = [];\n private static _handler = this.errorLog; // default to error logging\n private constructor() { } // this is a singleton\n\n /** Add a \"telemetry tracker\" for unexpected errors. Useful for tracking/reporting errors without changing handler.\n * @returns a method to remove the tracker\n */\n public static addTelemetry(tracker: OnUnexpectedError): () => void {\n this._telemetry.push(tracker);\n return () => this._telemetry.splice(this._telemetry.indexOf(tracker), 1);\n }\n\n /** call this method when an unexpected error happens so the global handler can process it.\n * @param error the unexpected error\n * @param notifyTelemetry if false, don't notify telemetry trackers. Use this for exceptions from third-party code, for example.\n */\n public static handle(error: any, notifyTelemetry = true): void {\n this._handler(error);\n if (notifyTelemetry) {\n this._telemetry.forEach((telemetry) => {\n try {\n telemetry(error);\n } catch {\n // ignore errors from telemetry trackers\n }\n });\n }\n }\n\n /** establish a new global *unexpected error* handler.\n * @param handler the new global handler. You may provide your own function or use one of the static members of this class.\n * The default is [[errorLog]].\n * @returns the previous handler. Useful to temporarily change the handler.\n */\n public static setHandler(handler: OnUnexpectedError): OnUnexpectedError {\n const oldHandler = this._handler;\n this._handler = handler;\n return oldHandler;\n }\n}\n"]}
1
+ {"version":3,"file":"UnexpectedErrors.js","sourceRoot":"","sources":["../../src/UnexpectedErrors.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IAC3B,kDAAkD;aAC3B,qBAAgB,GAAG,CAAC,CAAM,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,kHAAkH;aAC3F,oBAAe,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvF,+CAA+C;aACxB,eAAU,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAC,iCAAiC;IACnG,oDAAoD;aAC7B,aAAQ,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;aAEnE,eAAU,GAAwB,EAAE,CAAC;aACrC,aAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAC,2BAA2B;IACpE,gBAAwB,CAAC,CAAC,sBAAsB;IAEhD;;OAEG;IACI,MAAM,CAAC,YAAY,CAAC,OAA0B;QACnD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,KAAU,EAAE,eAAe,GAAG,IAAI;QACrD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,eAAe,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;gBACpC,IAAI,CAAC;oBACH,SAAS,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC;gBAAC,MAAM,CAAC;oBACP,wCAAwC;gBAC1C,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU,CAAC,OAA0B;QACjD,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,OAAO,UAAU,CAAC;IACpB,CAAC","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 Errors\n */\n\nimport { Logger } from \"./Logger\";\n\n/** A function to be notified when an unexpected error happens\n * @public\n */\nexport type OnUnexpectedError = (error: any) => void;\n\n/**\n * Utility for handling/reporting unexpected runtime errors. This class establishes a global handler for\n * unexpected errors, and programmers should use its `handle` method when they occur. Generally, unexpected\n * errors should not cause program termination, and should instead be logged and swallowed. However, for\n * development/debugging, it can be helpful to re-throw exceptions so they are not missed.\n * @public\n */\nexport class UnexpectedErrors {\n /** handler for re-throwing exceptions directly */\n public static readonly reThrowImmediate = (e: any) => { throw e; };\n /** handler for re-throwing exceptions from an asynchronous interval (so the current call stack is not aborted) */\n public static readonly reThrowDeferred = (e: any) => setTimeout(() => { throw e; }, 0);\n /** handler for logging exception to console */\n public static readonly consoleLog = (e: any) => console.error(e); // eslint-disable-line no-console\n /** handler for logging exception with [[Logger]] */\n public static readonly errorLog = (e: any) => Logger.logException(\"unhandled\", e);\n\n private static _telemetry: OnUnexpectedError[] = [];\n private static _handler = this.errorLog; // default to error logging\n private constructor() { } // this is a singleton\n\n /** Add a \"telemetry tracker\" for unexpected errors. Useful for tracking/reporting errors without changing handler.\n * @returns a method to remove the tracker\n */\n public static addTelemetry(tracker: OnUnexpectedError): () => void {\n this._telemetry.push(tracker);\n return () => this._telemetry.splice(this._telemetry.indexOf(tracker), 1);\n }\n\n /** call this method when an unexpected error happens so the global handler can process it.\n * @param error the unexpected error\n * @param notifyTelemetry if false, don't notify telemetry trackers. Use this for exceptions from third-party code, for example.\n */\n public static handle(error: any, notifyTelemetry = true): void {\n this._handler(error);\n if (notifyTelemetry) {\n this._telemetry.forEach((telemetry) => {\n try {\n telemetry(error);\n } catch {\n // ignore errors from telemetry trackers\n }\n });\n }\n }\n\n /** establish a new global *unexpected error* handler.\n * @param handler the new global handler. You may provide your own function or use one of the static members of this class.\n * The default is [[errorLog]].\n * @returns the previous handler. Useful to temporarily change the handler.\n */\n public static setHandler(handler: OnUnexpectedError): OnUnexpectedError {\n const oldHandler = this._handler;\n this._handler = handler;\n return oldHandler;\n }\n}\n"]}