@itwin/core-bentley 4.8.0-dev.2 → 4.8.0-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/lib/cjs/BeEvent.d.ts +17 -0
- package/lib/cjs/BeEvent.d.ts.map +1 -1
- package/lib/cjs/BeEvent.js.map +1 -1
- package/lib/cjs/BeSQLite.d.ts +0 -38
- package/lib/cjs/BeSQLite.d.ts.map +1 -1
- package/lib/cjs/BeSQLite.js +1 -43
- package/lib/cjs/BeSQLite.js.map +1 -1
- package/lib/cjs/BentleyError.d.ts +0 -43
- package/lib/cjs/BentleyError.d.ts.map +1 -1
- package/lib/cjs/BentleyError.js +17 -53
- package/lib/cjs/BentleyError.js.map +1 -1
- package/lib/cjs/CompressedId64Set.d.ts +1 -1
- package/lib/cjs/CompressedId64Set.js +1 -1
- package/lib/cjs/CompressedId64Set.js.map +1 -1
- package/lib/cjs/Logger.d.ts +15 -12
- package/lib/cjs/Logger.d.ts.map +1 -1
- package/lib/cjs/Logger.js +27 -14
- package/lib/cjs/Logger.js.map +1 -1
- package/lib/cjs/ObservableSet.d.ts +6 -2
- package/lib/cjs/ObservableSet.d.ts.map +1 -1
- package/lib/cjs/ObservableSet.js +6 -2
- package/lib/cjs/ObservableSet.js.map +1 -1
- package/lib/cjs/StatusCategory.js +17 -16
- package/lib/cjs/StatusCategory.js.map +1 -1
- package/lib/cjs/StringUtils.d.ts +0 -4
- package/lib/cjs/StringUtils.d.ts.map +1 -1
- package/lib/cjs/StringUtils.js +3 -119
- package/lib/cjs/StringUtils.js.map +1 -1
- package/lib/cjs/Tracing.d.ts +0 -1
- package/lib/cjs/Tracing.d.ts.map +1 -1
- package/lib/cjs/Tracing.js +0 -1
- package/lib/cjs/Tracing.js.map +1 -1
- package/lib/cjs/YieldManager.d.ts +1 -2
- package/lib/cjs/YieldManager.d.ts.map +1 -1
- package/lib/cjs/YieldManager.js +0 -1
- package/lib/cjs/YieldManager.js.map +1 -1
- package/lib/cjs/core-bentley.d.ts +1 -0
- package/lib/cjs/core-bentley.d.ts.map +1 -1
- package/lib/cjs/core-bentley.js +2 -0
- package/lib/cjs/core-bentley.js.map +1 -1
- package/lib/cjs/internal/BeSQLiteInternal.d.ts +36 -0
- package/lib/cjs/internal/BeSQLiteInternal.d.ts.map +1 -0
- package/lib/cjs/internal/BeSQLiteInternal.js +47 -0
- package/lib/cjs/internal/BeSQLiteInternal.js.map +1 -0
- package/lib/cjs/internal/RepositoryStatus.d.ts +40 -0
- package/lib/cjs/internal/RepositoryStatus.d.ts.map +1 -0
- package/lib/cjs/internal/RepositoryStatus.js +48 -0
- package/lib/cjs/internal/RepositoryStatus.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +4 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -0
- package/lib/cjs/internal/cross-package.js +17 -0
- package/lib/cjs/internal/cross-package.js.map +1 -0
- package/lib/cjs/internal/staticLoggerMetadata.d.ts +11 -0
- package/lib/cjs/internal/staticLoggerMetadata.d.ts.map +1 -0
- package/lib/cjs/internal/staticLoggerMetadata.js +17 -0
- package/lib/cjs/internal/staticLoggerMetadata.js.map +1 -0
- package/lib/esm/BeEvent.d.ts +17 -0
- package/lib/esm/BeEvent.d.ts.map +1 -1
- package/lib/esm/BeEvent.js.map +1 -1
- package/lib/esm/BeSQLite.d.ts +0 -38
- package/lib/esm/BeSQLite.d.ts.map +1 -1
- package/lib/esm/BeSQLite.js +0 -42
- package/lib/esm/BeSQLite.js.map +1 -1
- package/lib/esm/BentleyError.d.ts +0 -43
- package/lib/esm/BentleyError.d.ts.map +1 -1
- package/lib/esm/BentleyError.js +1 -37
- package/lib/esm/BentleyError.js.map +1 -1
- package/lib/esm/CompressedId64Set.d.ts +1 -1
- package/lib/esm/CompressedId64Set.js +1 -1
- package/lib/esm/CompressedId64Set.js.map +1 -1
- package/lib/esm/Logger.d.ts +15 -12
- package/lib/esm/Logger.d.ts.map +1 -1
- package/lib/esm/Logger.js +27 -14
- package/lib/esm/Logger.js.map +1 -1
- package/lib/esm/ObservableSet.d.ts +6 -2
- package/lib/esm/ObservableSet.d.ts.map +1 -1
- package/lib/esm/ObservableSet.js +6 -2
- package/lib/esm/ObservableSet.js.map +1 -1
- package/lib/esm/StatusCategory.js +2 -1
- package/lib/esm/StatusCategory.js.map +1 -1
- package/lib/esm/StringUtils.d.ts +0 -4
- package/lib/esm/StringUtils.d.ts.map +1 -1
- package/lib/esm/StringUtils.js +2 -117
- package/lib/esm/StringUtils.js.map +1 -1
- package/lib/esm/Tracing.d.ts +0 -1
- package/lib/esm/Tracing.d.ts.map +1 -1
- package/lib/esm/Tracing.js +0 -1
- package/lib/esm/Tracing.js.map +1 -1
- package/lib/esm/YieldManager.d.ts +1 -2
- package/lib/esm/YieldManager.d.ts.map +1 -1
- package/lib/esm/YieldManager.js +0 -1
- package/lib/esm/YieldManager.js.map +1 -1
- package/lib/esm/core-bentley.d.ts +1 -0
- package/lib/esm/core-bentley.d.ts.map +1 -1
- package/lib/esm/core-bentley.js +2 -0
- package/lib/esm/core-bentley.js.map +1 -1
- package/lib/esm/internal/BeSQLiteInternal.d.ts +36 -0
- package/lib/esm/internal/BeSQLiteInternal.d.ts.map +1 -0
- package/lib/esm/internal/BeSQLiteInternal.js +44 -0
- package/lib/esm/internal/BeSQLiteInternal.js.map +1 -0
- package/lib/esm/internal/RepositoryStatus.d.ts +40 -0
- package/lib/esm/internal/RepositoryStatus.d.ts.map +1 -0
- package/lib/esm/internal/RepositoryStatus.js +45 -0
- package/lib/esm/internal/RepositoryStatus.js.map +1 -0
- package/lib/esm/internal/cross-package.d.ts +4 -0
- package/lib/esm/internal/cross-package.d.ts.map +1 -0
- package/lib/esm/internal/cross-package.js +8 -0
- package/lib/esm/internal/cross-package.js.map +1 -0
- package/lib/esm/internal/staticLoggerMetadata.d.ts +11 -0
- package/lib/esm/internal/staticLoggerMetadata.d.ts.map +1 -0
- package/lib/esm/internal/staticLoggerMetadata.js +14 -0
- package/lib/esm/internal/staticLoggerMetadata.js.map +1 -0
- package/package.json +4 -3
package/lib/cjs/StringUtils.js
CHANGED
|
@@ -7,112 +7,7 @@
|
|
|
7
7
|
* @module Utils
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.base64StringToUint8Array = exports.utf8ToString =
|
|
11
|
-
// TextDecoder is not supported on all platforms - this is an alternative for utf-8.
|
|
12
|
-
// From https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/getStringFromTypedArray.js
|
|
13
|
-
// which is itself inspired by https://github.com/inexorabletash/text-encoding
|
|
14
|
-
/** @internal */
|
|
15
|
-
var Utf8ToString;
|
|
16
|
-
(function (Utf8ToString) {
|
|
17
|
-
function inRange(a, min, max) {
|
|
18
|
-
return min <= a && a <= max;
|
|
19
|
-
}
|
|
20
|
-
function utf8Handler(bytes) {
|
|
21
|
-
let codePoint = 0;
|
|
22
|
-
let bytesSeen = 0;
|
|
23
|
-
let bytesNeeded = 0;
|
|
24
|
-
let lowerBoundary = 0x80;
|
|
25
|
-
let upperBoundary = 0xbf;
|
|
26
|
-
const codePoints = [];
|
|
27
|
-
const length = bytes.length;
|
|
28
|
-
for (let i = 0; i < length; i++) {
|
|
29
|
-
const currentByte = bytes[i];
|
|
30
|
-
// If bytesNeeded = 0, then we are starting a new character
|
|
31
|
-
if (0 === bytesNeeded) {
|
|
32
|
-
// 1 byte ascii character
|
|
33
|
-
if (inRange(currentByte, 0x00, 0x7f)) {
|
|
34
|
-
// return a code point whose value is byte.
|
|
35
|
-
codePoints.push(currentByte);
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
// 2 byte character
|
|
39
|
-
if (inRange(currentByte, 0xc2, 0xdf)) {
|
|
40
|
-
bytesNeeded = 1;
|
|
41
|
-
codePoint = currentByte & 0x1f;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
// 3 byte character
|
|
45
|
-
if (inRange(currentByte, 0xe0, 0xef)) {
|
|
46
|
-
if (0xe0 === currentByte)
|
|
47
|
-
lowerBoundary = 0xa0;
|
|
48
|
-
else if (0xed === currentByte)
|
|
49
|
-
upperBoundary = 0x9f;
|
|
50
|
-
bytesNeeded = 2;
|
|
51
|
-
codePoint = currentByte & 0xf;
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
// 4 byte character
|
|
55
|
-
if (inRange(currentByte, 0xf0, 0xf4)) {
|
|
56
|
-
if (0xf0 === currentByte)
|
|
57
|
-
lowerBoundary = 0x90;
|
|
58
|
-
else if (0xf4 === currentByte)
|
|
59
|
-
upperBoundary = 0x8f;
|
|
60
|
-
bytesNeeded = 3;
|
|
61
|
-
codePoint = currentByte & 0x7;
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
// invalid utf-8
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
// out of range so ignore the first part(s) of the character and continue with this byte on its own
|
|
68
|
-
if (!inRange(currentByte, lowerBoundary, upperBoundary)) {
|
|
69
|
-
codePoint = bytesNeeded = bytesSeen = 0;
|
|
70
|
-
lowerBoundary = 0x80;
|
|
71
|
-
upperBoundary = 0xbf;
|
|
72
|
-
--i;
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
// set appropriate boundaries since we've now checked byte 2 of a potential longer character
|
|
76
|
-
lowerBoundary = 0x80;
|
|
77
|
-
upperBoundary = 0xbf;
|
|
78
|
-
// add byte to code point
|
|
79
|
-
codePoint = (codePoint << 6) | (currentByte & 0x3f);
|
|
80
|
-
// We have the correct number of bytes, so push and reset for next character
|
|
81
|
-
++bytesSeen;
|
|
82
|
-
if (bytesSeen === bytesNeeded) {
|
|
83
|
-
codePoints.push(codePoint);
|
|
84
|
-
codePoint = bytesNeeded = bytesSeen = 0;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return codePoints;
|
|
88
|
-
}
|
|
89
|
-
function decodeWithFromCharCode(view) {
|
|
90
|
-
let result = "";
|
|
91
|
-
const codePoints = utf8Handler(view);
|
|
92
|
-
if (undefined === codePoints)
|
|
93
|
-
return undefined;
|
|
94
|
-
for (let cp of codePoints) {
|
|
95
|
-
if (cp <= 0xffff) {
|
|
96
|
-
result += String.fromCharCode(cp);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
cp -= 0x10000;
|
|
100
|
-
result += String.fromCharCode((cp >> 10) + 0xd800, (cp & 0x3ff) + 0xdc00);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
Utf8ToString.decodeWithFromCharCode = decodeWithFromCharCode;
|
|
106
|
-
})(Utf8ToString || (Utf8ToString = {}));
|
|
107
|
-
/** Exposed only for testing the fall-back used when TextDecoder is unsupported.
|
|
108
|
-
* @internal
|
|
109
|
-
*/
|
|
110
|
-
function utf8ToStringPolyfill(utf8) {
|
|
111
|
-
return Utf8ToString.decodeWithFromCharCode(utf8);
|
|
112
|
-
}
|
|
113
|
-
exports.utf8ToStringPolyfill = utf8ToStringPolyfill;
|
|
114
|
-
// TextDecoder unsupported in Edge at time of writing.
|
|
115
|
-
let textDecoderSupported = true;
|
|
10
|
+
exports.base64StringToUint8Array = exports.utf8ToString = void 0;
|
|
116
11
|
/** Given an array of bytes containing a utf-8 string, convert to a string.
|
|
117
12
|
* @param utf8: An array of utf-8 characters as a byte array
|
|
118
13
|
* @returns An equivalent string, or undefined if the array does not contain a valid utf-8 string.
|
|
@@ -121,19 +16,8 @@ let textDecoderSupported = true;
|
|
|
121
16
|
* @public
|
|
122
17
|
*/
|
|
123
18
|
function utf8ToString(utf8) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
decoder = new TextDecoder("utf-8");
|
|
128
|
-
}
|
|
129
|
-
catch (_ex) {
|
|
130
|
-
textDecoderSupported = false;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (undefined !== decoder)
|
|
134
|
-
return decoder.decode(utf8);
|
|
135
|
-
else
|
|
136
|
-
return utf8ToStringPolyfill(utf8);
|
|
19
|
+
const decoder = new TextDecoder("utf-8");
|
|
20
|
+
return decoder.decode(utf8);
|
|
137
21
|
}
|
|
138
22
|
exports.utf8ToString = utf8ToString;
|
|
139
23
|
/** Given a base-64-encoded string, decode it into an array of bytes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringUtils.js","sourceRoot":"","sources":["../../src/StringUtils.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH
|
|
1
|
+
{"version":3,"file":"StringUtils.js","sourceRoot":"","sources":["../../src/StringUtils.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,IAAgB;IAC3C,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAHD,oCAGC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,MAAc;IACrD,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,8CAA8C;AAC3H,CAAC;AAFD,4DAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/** Given an array of bytes containing a utf-8 string, convert to a string.\r\n * @param utf8: An array of utf-8 characters as a byte array\r\n * @returns An equivalent string, or undefined if the array does not contain a valid utf-8 string.\r\n * @note This function uses Javascript's TextDecoder if supported by the browser; otherwise, it\r\n * falls back to a less efficient polyfill.\r\n * @public\r\n */\r\nexport function utf8ToString(utf8: Uint8Array): string | undefined {\r\n const decoder = new TextDecoder(\"utf-8\");\r\n return decoder.decode(utf8);\r\n}\r\n\r\n/** Given a base-64-encoded string, decode it into an array of bytes.\r\n * @param base64 The base-64-encoded string.\r\n * @returns the decoded byte array.\r\n * @throws DOMException if the length of the input string is not a multiple of 4.\r\n * @public\r\n */\r\nexport function base64StringToUint8Array(base64: string): Uint8Array {\r\n return new Uint8Array(atob(base64).split(\"\").map((c) => c.charCodeAt(0))); // eslint-disable-line deprecation/deprecation\r\n}\r\n"]}
|
package/lib/cjs/Tracing.d.ts
CHANGED
package/lib/cjs/Tracing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tracing.d.ts","sourceRoot":"","sources":["../../src/Tracing.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAc,cAAc,EAAsB,WAAW,EAAE,WAAW,EAAY,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIrI;;;;GAIG;AACH,oBAAY,QAAQ;IAClB,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,QAAQ,IAAI;CACb;AA6DD;;;;GAIG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAS;IAChC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAoH;IAElJ;;;;;;;OAOG;WACiB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IA4BnI
|
|
1
|
+
{"version":3,"file":"Tracing.d.ts","sourceRoot":"","sources":["../../src/Tracing.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAc,cAAc,EAAsB,WAAW,EAAE,WAAW,EAAY,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIrI;;;;GAIG;AACH,oBAAY,QAAQ;IAClB,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,MAAM,IAAI;IACV,QAAQ,IAAI;IACZ,QAAQ,IAAI;CACb;AA6DD;;;;GAIG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAS;IAChC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAoH;IAElJ;;;;;;;OAOG;WACiB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IA4BnI;;;OAGG;WACW,eAAe,CAAC,CAAC,EAAE,KAAK;IAItC;;;;OAIG;WACW,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,OAAO,CAAC,cAAc;IASpF,OAAO,CAAC,MAAM,CAAC,iBAAiB;IA+BhC;;OAEG;WACW,aAAa,CAAC,UAAU,EAAE,cAAc;CAGvD"}
|
package/lib/cjs/Tracing.js
CHANGED
|
@@ -108,7 +108,6 @@ class Tracing {
|
|
|
108
108
|
/**
|
|
109
109
|
* Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation
|
|
110
110
|
* @param e error (exception) object
|
|
111
|
-
* @internal
|
|
112
111
|
*/
|
|
113
112
|
static recordException(e) {
|
|
114
113
|
Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);
|
package/lib/cjs/Tracing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tracing.js","sourceRoot":"","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M,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACxD,IAAG,eAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;gBACrC,IAAI,CAAC;oBACH,OAAO,CAAC,cAAc,EAAE,KAAK;yBAC1B,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;wBACjD,EAAE,QAAQ,CAAC,OAAO,EAAE;wBAClB,GAAG,aAAa,CAAC,kBAAkB,CAAC;wBACpC,KAAK,EAAE,OAAO;wBACd,cAAc,EAAE,QAAQ;qBACzB,CAAC,CAAC;gBACP,CAAC;gBAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,mHAAmH;gBAEpI,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;gBACrF,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE;oBACtB,GAAG,kBAAkB;oBACrB,yDAAyD;oBACzD,QAAQ,EAAE,WAAW,EAAE,OAAO;oBAC9B,OAAO,EAAE,WAAW,EAAE,MAAM;oBAC5B,WAAW,EAAE,WAAW,EAAE,UAAU;oBACpC,wDAAwD;iBACzD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,aAAa,CAAC,UAA0B;QACpD,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;CACF;AApGD,0BAoGC;AAED,2CAA2C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Logging\r\n */\r\n\r\nimport type { ContextAPI, SpanAttributes, SpanAttributeValue, SpanContext, SpanOptions, TraceAPI, Tracer } from \"@opentelemetry/api\";\r\nimport { LogFunction, Logger, LogLevel } from \"./Logger\";\r\n\r\n// re-export so that consumers can construct full SpanOptions object without external dependencies\r\n/**\r\n * Mirrors the SpanKind enum from [@opentelemetry/api](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api.SpanKind.html)\r\n * @public\r\n * @deprecated in 4.4 - OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\r\n */\r\nexport enum SpanKind {\r\n INTERNAL = 0,\r\n SERVER = 1,\r\n CLIENT = 2,\r\n PRODUCER = 3,\r\n CONSUMER = 4\r\n}\r\n\r\nfunction isValidPrimitive(val: unknown): val is SpanAttributeValue {\r\n return typeof val === \"string\" || typeof val === \"number\" || typeof val === \"boolean\";\r\n}\r\n\r\n// Only _homogenous_ arrays of strings, numbers, or booleans are supported as OpenTelemetry Attribute values.\r\n// Per the spec (https://opentelemetry.io/docs/reference/specification/common/common/#attribute), empty arrays and null values are supported too.\r\nfunction isValidPrimitiveArray(val: unknown): val is SpanAttributeValue {\r\n if (!Array.isArray(val))\r\n return false;\r\n\r\n let itemType;\r\n for (const x of val) {\r\n if (x === undefined || x === null)\r\n continue;\r\n\r\n if (!itemType) {\r\n itemType = typeof x;\r\n if (!isValidPrimitive(x))\r\n return false;\r\n }\r\n\r\n if (typeof x !== itemType)\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\nfunction isPlainObject(obj: unknown): obj is object {\r\n return typeof obj === \"object\" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;\r\n}\r\n\r\nfunction* getFlatEntries(obj: unknown, path = \"\"): Iterable<[string, SpanAttributeValue]> {\r\n if (isValidPrimitiveArray(obj)) {\r\n yield [path, obj];\r\n return;\r\n }\r\n\r\n // Prefer JSON serialization over flattening for any non-POJO types.\r\n // There's just too many ways trying to flatten those can go wrong (Dates, Buffers, TypedArrays, etc.)\r\n if (!isPlainObject(obj) && !Array.isArray(obj)) {\r\n yield [path, isValidPrimitive(obj) ? obj : JSON.stringify(obj)];\r\n return;\r\n }\r\n\r\n // Always serialize empty objects/arrays as empty array values\r\n const entries = Object.entries(obj);\r\n if (entries.length === 0)\r\n yield [path, []];\r\n\r\n for (const [key, val] of entries)\r\n yield* getFlatEntries(val, (path === \"\") ? key : `${path}.${key}`);\r\n}\r\n\r\nfunction flattenObject(obj: object): SpanAttributes {\r\n return Object.fromEntries(getFlatEntries(obj));\r\n}\r\n\r\n/* eslint-disable deprecation/deprecation -- lots of self-references here... */\r\n\r\n/**\r\n * Enables OpenTelemetry tracing in addition to traditional logging.\r\n * @public\r\n * @deprecated in 4.4 - OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\r\n */\r\nexport class Tracing {\r\n private static _tracer?: Tracer;\r\n private static _openTelemetry?: { trace: Pick<TraceAPI, \"setSpan\" | \"setSpanContext\" | \"getSpan\">, context: Pick<ContextAPI, \"active\" | \"with\"> };\r\n\r\n /**\r\n * If OpenTelemetry tracing is enabled, creates a new span and runs the provided function in it.\r\n * If OpenTelemetry tracing is _not_ enabled, runs the provided function.\r\n * @param name name of the new span\r\n * @param fn function to run inside the new span\r\n * @param options span options\r\n * @param parentContext optional context used to retrieve parent span id\r\n */\r\n public static async withSpan<T>(name: string, fn: () => Promise<T>, options?: SpanOptions, parentContext?: SpanContext): Promise<T> {\r\n if (Tracing._tracer === undefined || Tracing._openTelemetry === undefined)\r\n return fn();\r\n\r\n // this case is for context propagation - parentContext is typically constructed from HTTP headers\r\n const parent = parentContext === undefined\r\n ? Tracing._openTelemetry.context.active()\r\n : Tracing._openTelemetry.trace.setSpanContext(Tracing._openTelemetry.context.active(), parentContext);\r\n\r\n return Tracing._openTelemetry.context.with(\r\n Tracing._openTelemetry.trace.setSpan(\r\n parent,\r\n Tracing._tracer.startSpan(name, options, Tracing._openTelemetry.context.active()),\r\n ),\r\n async () => {\r\n try {\r\n return await fn();\r\n } catch (err) {\r\n if (err instanceof Error) // ignore non-Error throws, such as RpcControlResponse\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttribute(\"error\", true);\r\n throw err;\r\n } finally {\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.end();\r\n }\r\n },\r\n );\r\n }\r\n\r\n /**\r\n * Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation\r\n * @param e error (exception) object\r\n * @internal\r\n */\r\n public static recordException(e: Error) {\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);\r\n }\r\n\r\n /**\r\n * Enable logging to OpenTelemetry. [[Tracing.withSpan]] will be enabled, all log entries will be attached to active span as span events.\r\n * [IModelHost.startup]($backend) will call this automatically if the `enableOpenTelemetry` option is enabled and it succeeds in requiring `@opentelemetry/api`.\r\n * @note Node.js OpenTelemetry SDK should be initialized by the user.\r\n */\r\n public static enableOpenTelemetry(tracer: Tracer, api: typeof Tracing._openTelemetry) {\r\n Tracing._tracer = tracer;\r\n Tracing._openTelemetry = api;\r\n Logger.logTrace = Tracing.withOpenTelemetry(LogLevel.Trace, Logger.logTrace.bind(Logger)).bind(Logger);\r\n Logger.logInfo = Tracing.withOpenTelemetry(LogLevel.Info, Logger.logInfo.bind(Logger)).bind(Logger);\r\n Logger.logWarning = Tracing.withOpenTelemetry(LogLevel.Warning, Logger.logWarning.bind(Logger)).bind(Logger);\r\n Logger.logError = Tracing.withOpenTelemetry(LogLevel.Error, Logger.logError.bind(Logger)).bind(Logger);\r\n }\r\n\r\n private static withOpenTelemetry(level: LogLevel, base: LogFunction, isError: boolean = false): LogFunction {\r\n return (category, message, metaData) => {\r\n const oTelContext = Tracing._openTelemetry?.context.active();\r\n if(Tracing._openTelemetry === undefined || oTelContext === undefined)\r\n return base(category, message, metaData);\r\n\r\n const serializedMetadata = Logger.getMetaData(metaData);\r\n if(Logger.isEnabled(category, level)) {\r\n try {\r\n Tracing._openTelemetry?.trace\r\n .getSpan(Tracing._openTelemetry.context.active())\r\n ?.addEvent(message, {\r\n ...flattenObject(serializedMetadata),\r\n error: isError,\r\n loggerCategory: category,\r\n });\r\n } catch (_e) { } // avoid throwing random errors (with stack trace mangled by async hooks) when openTelemetry collector doesn't work\r\n\r\n const spanContext = Tracing._openTelemetry.trace.getSpan(oTelContext)?.spanContext();\r\n base(category, message, {\r\n ...serializedMetadata,\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n trace_id: spanContext?.traceId,\r\n span_id: spanContext?.spanId,\r\n trace_flags: spanContext?.traceFlags,\r\n /* eslint-enable @typescript-eslint/naming-convention */\r\n });\r\n }\r\n };\r\n }\r\n\r\n /** Set attributes on currently active openTelemetry span. Doesn't do anything if openTelemetry logging is not initialized.\r\n * @param attributes The attributes to set\r\n */\r\n public static setAttributes(attributes: SpanAttributes) {\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttributes(attributes);\r\n }\r\n}\r\n\r\n/* eslint-enable deprecation/deprecation */\r\n"]}
|
|
1
|
+
{"version":3,"file":"Tracing.js","sourceRoot":"","sources":["../../src/Tracing.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,qCAAyD;AAEzD,kGAAkG;AAClG;;;;GAIG;AACH,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,+CAAY,CAAA;IACZ,2CAAU,CAAA;IACV,2CAAU,CAAA;IACV,+CAAY,CAAA;IACZ,+CAAY,CAAA;AACd,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,SAAS,gBAAgB,CAAC,GAAY;IACpC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,SAAS,CAAC;AACxF,CAAC;AAED,6GAA6G;AAC7G,iJAAiJ;AACjJ,SAAS,qBAAqB,CA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AO,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;gBACrF,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE;oBACtB,GAAG,kBAAkB;oBACrB,yDAAyD;oBACzD,QAAQ,EAAE,WAAW,EAAE,OAAO;oBAC9B,OAAO,EAAE,WAAW,EAAE,MAAM;oBAC5B,WAAW,EAAE,WAAW,EAAE,UAAU;oBACpC,wDAAwD;iBACzD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,aAAa,CAAC,UAA0B;QACpD,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;CACF;AAnGD,0BAmGC;AAED,2CAA2C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Logging\r\n */\r\n\r\nimport type { ContextAPI, SpanAttributes, SpanAttributeValue, SpanContext, SpanOptions, TraceAPI, Tracer } from \"@opentelemetry/api\";\r\nimport { LogFunction, Logger, LogLevel } from \"./Logger\";\r\n\r\n// re-export so that consumers can construct full SpanOptions object without external dependencies\r\n/**\r\n * Mirrors the SpanKind enum from [@opentelemetry/api](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api.SpanKind.html)\r\n * @public\r\n * @deprecated in 4.4 - OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\r\n */\r\nexport enum SpanKind {\r\n INTERNAL = 0,\r\n SERVER = 1,\r\n CLIENT = 2,\r\n PRODUCER = 3,\r\n CONSUMER = 4\r\n}\r\n\r\nfunction isValidPrimitive(val: unknown): val is SpanAttributeValue {\r\n return typeof val === \"string\" || typeof val === \"number\" || typeof val === \"boolean\";\r\n}\r\n\r\n// Only _homogenous_ arrays of strings, numbers, or booleans are supported as OpenTelemetry Attribute values.\r\n// Per the spec (https://opentelemetry.io/docs/reference/specification/common/common/#attribute), empty arrays and null values are supported too.\r\nfunction isValidPrimitiveArray(val: unknown): val is SpanAttributeValue {\r\n if (!Array.isArray(val))\r\n return false;\r\n\r\n let itemType;\r\n for (const x of val) {\r\n if (x === undefined || x === null)\r\n continue;\r\n\r\n if (!itemType) {\r\n itemType = typeof x;\r\n if (!isValidPrimitive(x))\r\n return false;\r\n }\r\n\r\n if (typeof x !== itemType)\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\nfunction isPlainObject(obj: unknown): obj is object {\r\n return typeof obj === \"object\" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;\r\n}\r\n\r\nfunction* getFlatEntries(obj: unknown, path = \"\"): Iterable<[string, SpanAttributeValue]> {\r\n if (isValidPrimitiveArray(obj)) {\r\n yield [path, obj];\r\n return;\r\n }\r\n\r\n // Prefer JSON serialization over flattening for any non-POJO types.\r\n // There's just too many ways trying to flatten those can go wrong (Dates, Buffers, TypedArrays, etc.)\r\n if (!isPlainObject(obj) && !Array.isArray(obj)) {\r\n yield [path, isValidPrimitive(obj) ? obj : JSON.stringify(obj)];\r\n return;\r\n }\r\n\r\n // Always serialize empty objects/arrays as empty array values\r\n const entries = Object.entries(obj);\r\n if (entries.length === 0)\r\n yield [path, []];\r\n\r\n for (const [key, val] of entries)\r\n yield* getFlatEntries(val, (path === \"\") ? key : `${path}.${key}`);\r\n}\r\n\r\nfunction flattenObject(obj: object): SpanAttributes {\r\n return Object.fromEntries(getFlatEntries(obj));\r\n}\r\n\r\n/* eslint-disable deprecation/deprecation -- lots of self-references here... */\r\n\r\n/**\r\n * Enables OpenTelemetry tracing in addition to traditional logging.\r\n * @public\r\n * @deprecated in 4.4 - OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.\r\n */\r\nexport class Tracing {\r\n private static _tracer?: Tracer;\r\n private static _openTelemetry?: { trace: Pick<TraceAPI, \"setSpan\" | \"setSpanContext\" | \"getSpan\">, context: Pick<ContextAPI, \"active\" | \"with\"> };\r\n\r\n /**\r\n * If OpenTelemetry tracing is enabled, creates a new span and runs the provided function in it.\r\n * If OpenTelemetry tracing is _not_ enabled, runs the provided function.\r\n * @param name name of the new span\r\n * @param fn function to run inside the new span\r\n * @param options span options\r\n * @param parentContext optional context used to retrieve parent span id\r\n */\r\n public static async withSpan<T>(name: string, fn: () => Promise<T>, options?: SpanOptions, parentContext?: SpanContext): Promise<T> {\r\n if (Tracing._tracer === undefined || Tracing._openTelemetry === undefined)\r\n return fn();\r\n\r\n // this case is for context propagation - parentContext is typically constructed from HTTP headers\r\n const parent = parentContext === undefined\r\n ? Tracing._openTelemetry.context.active()\r\n : Tracing._openTelemetry.trace.setSpanContext(Tracing._openTelemetry.context.active(), parentContext);\r\n\r\n return Tracing._openTelemetry.context.with(\r\n Tracing._openTelemetry.trace.setSpan(\r\n parent,\r\n Tracing._tracer.startSpan(name, options, Tracing._openTelemetry.context.active()),\r\n ),\r\n async () => {\r\n try {\r\n return await fn();\r\n } catch (err) {\r\n if (err instanceof Error) // ignore non-Error throws, such as RpcControlResponse\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttribute(\"error\", true);\r\n throw err;\r\n } finally {\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.end();\r\n }\r\n },\r\n );\r\n }\r\n\r\n /**\r\n * Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation\r\n * @param e error (exception) object\r\n */\r\n public static recordException(e: Error) {\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);\r\n }\r\n\r\n /**\r\n * Enable logging to OpenTelemetry. [[Tracing.withSpan]] will be enabled, all log entries will be attached to active span as span events.\r\n * [IModelHost.startup]($backend) will call this automatically if the `enableOpenTelemetry` option is enabled and it succeeds in requiring `@opentelemetry/api`.\r\n * @note Node.js OpenTelemetry SDK should be initialized by the user.\r\n */\r\n public static enableOpenTelemetry(tracer: Tracer, api: typeof Tracing._openTelemetry) {\r\n Tracing._tracer = tracer;\r\n Tracing._openTelemetry = api;\r\n Logger.logTrace = Tracing.withOpenTelemetry(LogLevel.Trace, Logger.logTrace.bind(Logger)).bind(Logger);\r\n Logger.logInfo = Tracing.withOpenTelemetry(LogLevel.Info, Logger.logInfo.bind(Logger)).bind(Logger);\r\n Logger.logWarning = Tracing.withOpenTelemetry(LogLevel.Warning, Logger.logWarning.bind(Logger)).bind(Logger);\r\n Logger.logError = Tracing.withOpenTelemetry(LogLevel.Error, Logger.logError.bind(Logger)).bind(Logger);\r\n }\r\n\r\n private static withOpenTelemetry(level: LogLevel, base: LogFunction, isError: boolean = false): LogFunction {\r\n return (category, message, metaData) => {\r\n const oTelContext = Tracing._openTelemetry?.context.active();\r\n if(Tracing._openTelemetry === undefined || oTelContext === undefined)\r\n return base(category, message, metaData);\r\n\r\n const serializedMetadata = Logger.getMetaData(metaData);\r\n if(Logger.isEnabled(category, level)) {\r\n try {\r\n Tracing._openTelemetry?.trace\r\n .getSpan(Tracing._openTelemetry.context.active())\r\n ?.addEvent(message, {\r\n ...flattenObject(serializedMetadata),\r\n error: isError,\r\n loggerCategory: category,\r\n });\r\n } catch (_e) { } // avoid throwing random errors (with stack trace mangled by async hooks) when openTelemetry collector doesn't work\r\n\r\n const spanContext = Tracing._openTelemetry.trace.getSpan(oTelContext)?.spanContext();\r\n base(category, message, {\r\n ...serializedMetadata,\r\n /* eslint-disable @typescript-eslint/naming-convention */\r\n trace_id: spanContext?.traceId,\r\n span_id: spanContext?.spanId,\r\n trace_flags: spanContext?.traceFlags,\r\n /* eslint-enable @typescript-eslint/naming-convention */\r\n });\r\n }\r\n };\r\n }\r\n\r\n /** Set attributes on currently active openTelemetry span. Doesn't do anything if openTelemetry logging is not initialized.\r\n * @param attributes The attributes to set\r\n */\r\n public static setAttributes(attributes: SpanAttributes) {\r\n Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttributes(attributes);\r\n }\r\n}\r\n\r\n/* eslint-enable deprecation/deprecation */\r\n"]}
|
|
@@ -28,7 +28,6 @@ export declare class YieldManager {
|
|
|
28
28
|
constructor(options?: YieldManagerOptions);
|
|
29
29
|
/** Increment the iteration counter, yielding control and resetting the counter if [[options.iterationsBeforeYield]] is exceeded. */
|
|
30
30
|
allowYield(): Promise<void>;
|
|
31
|
-
|
|
32
|
-
protected actualYield(): Promise<void>;
|
|
31
|
+
private actualYield;
|
|
33
32
|
}
|
|
34
33
|
//# sourceMappingURL=YieldManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YieldManager.d.ts","sourceRoot":"","sources":["../../src/YieldManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAMD;;;;;;;GAOG;AACH,qBAAa,YAAY;IACvB,8CAA8C;IAC9C,SAAgB,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,QAAQ,CAAK;IAErB;;OAEG;gBACgB,OAAO,GAAE,mBAAwB;IAIpD,oIAAoI;IACvH,UAAU;
|
|
1
|
+
{"version":3,"file":"YieldManager.d.ts","sourceRoot":"","sources":["../../src/YieldManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAMD;;;;;;;GAOG;AACH,qBAAa,YAAY;IACvB,8CAA8C;IAC9C,SAAgB,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,QAAQ,CAAK;IAErB;;OAEG;gBACgB,OAAO,GAAE,mBAAwB;IAIpD,oIAAoI;IACvH,UAAU;YAOT,WAAW;CAG1B"}
|
package/lib/cjs/YieldManager.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YieldManager.js","sourceRoot":"","sources":["../../src/YieldManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,MAAM,0BAA0B,GAAkC;IAChE,qBAAqB,EAAE,IAAI;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAa,YAAY;IAKvB;;OAEG;IACH,YAAmB,UAA+B,EAAE;QAL5C,aAAQ,GAAG,CAAC,CAAC;QAMnB,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,0BAA0B,EAAE,GAAG,OAAO,EAAE,CAAC;IAC/D,CAAC;IAED,oIAAoI;IAC7H,KAAK,CAAC,UAAU;QACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;QACzE,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;
|
|
1
|
+
{"version":3,"file":"YieldManager.js","sourceRoot":"","sources":["../../src/YieldManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAYH,MAAM,0BAA0B,GAAkC;IAChE,qBAAqB,EAAE,IAAI;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAa,YAAY;IAKvB;;OAEG;IACH,YAAmB,UAA+B,EAAE;QAL5C,aAAQ,GAAG,CAAC,CAAC;QAMnB,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,0BAA0B,EAAE,GAAG,OAAO,EAAE,CAAC;IAC/D,CAAC;IAED,oIAAoI;IAC7H,KAAK,CAAC,UAAU;QACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;QACzE,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,WAAW;QACvB,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF;AAvBD,oCAuBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/** Options supplied to a [[YieldManager]].\r\n * @public\r\n */\r\nexport interface YieldManagerOptions {\r\n /** The number of times [[YieldManager.allowYield]] must be called to trigger an actual yield.\r\n * Default: 1000.\r\n */\r\n iterationsBeforeYield?: number;\r\n}\r\n\r\nconst defaultYieldManagerOptions: Required<YieldManagerOptions> = {\r\n iterationsBeforeYield: 1000,\r\n};\r\n\r\n/** Provides a mechanism by which a loop can be made to periodically yield control back to the browser/node environment.\r\n * This can alleviate [performance and memory consumption issues](https://github.com/nodejs/node-addon-api/issues/1140).\r\n * It maintains a count of the number of iterations that have occurred since the last yield.\r\n * The constructor specifies how many iterations of the loop are permitted before yielding.\r\n * The loop should `await` [[allowYield]] on each iteration.\r\n * [[allowYield]] will yield (and reset the iteration counter) if the counter exceeds the specified maximum.\r\n * @public\r\n */\r\nexport class YieldManager {\r\n /** Options controlling the yield behavior. */\r\n public readonly options: Readonly<Required<YieldManagerOptions>>;\r\n private _counter = 0;\r\n\r\n /** Constructor.\r\n * @param options Options customizing the yield behavior. Omitted properties are assigned their default values.\r\n */\r\n public constructor(options: YieldManagerOptions = {}) {\r\n this.options = { ...defaultYieldManagerOptions, ...options };\r\n }\r\n\r\n /** Increment the iteration counter, yielding control and resetting the counter if [[options.iterationsBeforeYield]] is exceeded. */\r\n public async allowYield() {\r\n this._counter = (this._counter + 1) % this.options.iterationsBeforeYield;\r\n if (this._counter === 0) {\r\n await this.actualYield();\r\n }\r\n }\r\n\r\n private async actualYield() {\r\n await new Promise((r) => setTimeout(r, 0));\r\n }\r\n}\r\n"]}
|
|
@@ -33,6 +33,7 @@ export * from "./TypedArrayBuilder";
|
|
|
33
33
|
export * from "./UnexpectedErrors";
|
|
34
34
|
export * from "./UtilityTypes";
|
|
35
35
|
export * from "./YieldManager";
|
|
36
|
+
export * from "./internal/cross-package";
|
|
36
37
|
/** @docs-package-description
|
|
37
38
|
* The core-bentley package contains classes to solve problems that are common for both client and server use cases.
|
|
38
39
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-bentley.d.ts","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AA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,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,0BAA0B,CAAC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
package/lib/cjs/core-bentley.js
CHANGED
|
@@ -53,6 +53,8 @@ __exportStar(require("./TypedArrayBuilder"), exports);
|
|
|
53
53
|
__exportStar(require("./UnexpectedErrors"), exports);
|
|
54
54
|
__exportStar(require("./UtilityTypes"), exports);
|
|
55
55
|
__exportStar(require("./YieldManager"), exports);
|
|
56
|
+
// Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.
|
|
57
|
+
__exportStar(require("./internal/cross-package"), exports);
|
|
56
58
|
/** @docs-package-description
|
|
57
59
|
* The core-bentley package contains classes to solve problems that are common for both client and server use cases.
|
|
58
60
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-bentley.js","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,0DAAwC;AACxC,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,sDAAoC;AACpC,+CAA6B;AAC7B,+CAA6B;AAC7B,uCAAqB;AACrB,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,qDAAmC;AACnC,wDAAsC;AACtC,+CAA6B;AAC7B,mDAAiC;AACjC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,yCAAuB;AACvB,4CAA0B;AAC1B,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,iDAA+B;AAC/B,iDAA+B;AAE/B;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./AccessToken\";\r\nexport * from \"./Assert\";\r\nexport * from \"./BeEvent\";\r\nexport * from \"./BentleyError\";\r\nexport * from \"./BentleyLoggerCategory\";\r\nexport * from \"./StatusCategory\";\r\nexport * from \"./BeSQLite\";\r\nexport * from \"./ByteStream\";\r\nexport * from \"./ClassUtils\";\r\nexport * from \"./Compare\";\r\nexport * from \"./CompressedId64Set\";\r\nexport * from \"./Dictionary\";\r\nexport * from \"./Disposable\";\r\nexport * from \"./Id\";\r\nexport * from \"./IndexMap\";\r\nexport * from \"./JsonSchema\";\r\nexport * from \"./JsonUtils\";\r\nexport * from \"./Logger\";\r\nexport * from \"./LRUMap\";\r\nexport * from \"./ObservableSet\";\r\nexport * from \"./OneAtATimeAction\";\r\nexport * from \"./OrderedId64Iterable\";\r\nexport * from \"./OrderedSet\";\r\nexport * from \"./partitionArray\";\r\nexport * from \"./PriorityQueue\";\r\nexport * from \"./ProcessDetector\";\r\nexport * from \"./SortedArray\";\r\nexport * from \"./StringUtils\";\r\nexport * from \"./Time\";\r\nexport * from \"./Tracing\";\r\nexport * from \"./TupleKeyedMap\";\r\nexport * from \"./TypedArrayBuilder\";\r\nexport * from \"./UnexpectedErrors\";\r\nexport * from \"./UtilityTypes\";\r\nexport * from \"./YieldManager\";\r\n\r\n/** @docs-package-description\r\n * The core-bentley package contains classes to solve problems that are common for both client and server use cases.\r\n */\r\n/**\r\n * @docs-group-description BeSQLite\r\n * Classes for working with SQLite databases. SQLite underlies IModelDb and ECDb - see [Executing ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n/**\r\n * @docs-group-description Errors\r\n * Classes for working with errors.\r\n */\r\n/**\r\n * @docs-group-description Events\r\n * Classes for raising and handling events.\r\n */\r\n/**\r\n * @docs-group-description Ids\r\n * Classes for working with unique identifiers.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Classes for configuring and logging diagnostic messages - see [Learning about Logging]($docs/learning/common/Logging.md)\r\n */\r\n/**\r\n * @docs-group-description Collections\r\n * Specialized, customizable collection classes like priority queues.\r\n */\r\n/**\r\n * @docs-group-description Json\r\n * utilities for dealing with Json strings and files.\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description ProcessDetector\r\n * Functions for determining the type of the current JavaScript process.\r\n */\r\n"]}
|
|
1
|
+
{"version":3,"file":"core-bentley.js","sourceRoot":"","sources":["../../src/core-bentley.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,0DAAwC;AACxC,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,sDAAoC;AACpC,+CAA6B;AAC7B,+CAA6B;AAC7B,uCAAqB;AACrB,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,qDAAmC;AACnC,wDAAsC;AACtC,+CAA6B;AAC7B,mDAAiC;AACjC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,yCAAuB;AACvB,4CAA0B;AAC1B,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,iDAA+B;AAC/B,iDAA+B;AAE/B,oFAAoF;AACpF,2DAAyC;AAEzC;;GAEG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./AccessToken\";\r\nexport * from \"./Assert\";\r\nexport * from \"./BeEvent\";\r\nexport * from \"./BentleyError\";\r\nexport * from \"./BentleyLoggerCategory\";\r\nexport * from \"./StatusCategory\";\r\nexport * from \"./BeSQLite\";\r\nexport * from \"./ByteStream\";\r\nexport * from \"./ClassUtils\";\r\nexport * from \"./Compare\";\r\nexport * from \"./CompressedId64Set\";\r\nexport * from \"./Dictionary\";\r\nexport * from \"./Disposable\";\r\nexport * from \"./Id\";\r\nexport * from \"./IndexMap\";\r\nexport * from \"./JsonSchema\";\r\nexport * from \"./JsonUtils\";\r\nexport * from \"./Logger\";\r\nexport * from \"./LRUMap\";\r\nexport * from \"./ObservableSet\";\r\nexport * from \"./OneAtATimeAction\";\r\nexport * from \"./OrderedId64Iterable\";\r\nexport * from \"./OrderedSet\";\r\nexport * from \"./partitionArray\";\r\nexport * from \"./PriorityQueue\";\r\nexport * from \"./ProcessDetector\";\r\nexport * from \"./SortedArray\";\r\nexport * from \"./StringUtils\";\r\nexport * from \"./Time\";\r\nexport * from \"./Tracing\";\r\nexport * from \"./TupleKeyedMap\";\r\nexport * from \"./TypedArrayBuilder\";\r\nexport * from \"./UnexpectedErrors\";\r\nexport * from \"./UtilityTypes\";\r\nexport * from \"./YieldManager\";\r\n\r\n// Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.\r\nexport * from \"./internal/cross-package\";\r\n\r\n/** @docs-package-description\r\n * The core-bentley package contains classes to solve problems that are common for both client and server use cases.\r\n */\r\n/**\r\n * @docs-group-description BeSQLite\r\n * Classes for working with SQLite databases. SQLite underlies IModelDb and ECDb - see [Executing ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n/**\r\n * @docs-group-description Errors\r\n * Classes for working with errors.\r\n */\r\n/**\r\n * @docs-group-description Events\r\n * Classes for raising and handling events.\r\n */\r\n/**\r\n * @docs-group-description Ids\r\n * Classes for working with unique identifiers.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Classes for configuring and logging diagnostic messages - see [Learning about Logging]($docs/learning/common/Logging.md)\r\n */\r\n/**\r\n * @docs-group-description Collections\r\n * Specialized, customizable collection classes like priority queues.\r\n */\r\n/**\r\n * @docs-group-description Json\r\n * utilities for dealing with Json strings and files.\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description ProcessDetector\r\n * Functions for determining the type of the current JavaScript process.\r\n */\r\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module BeSQLite
|
|
3
|
+
*/
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare enum DbChangeStage {
|
|
6
|
+
Old = 0,
|
|
7
|
+
New = 1
|
|
8
|
+
}
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare enum DbValueType {
|
|
11
|
+
IntegerVal = 1,
|
|
12
|
+
FloatVal = 2,
|
|
13
|
+
TextVal = 3,
|
|
14
|
+
BlobVal = 4,
|
|
15
|
+
NullVal = 5
|
|
16
|
+
}
|
|
17
|
+
/** Cause of conflict when applying a changeset.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare enum DbConflictCause {
|
|
21
|
+
Data = 1,
|
|
22
|
+
NotFound = 2,
|
|
23
|
+
Conflict = 3,
|
|
24
|
+
Constraint = 4,
|
|
25
|
+
ForeignKey = 5
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare enum DbConflictResolution {
|
|
29
|
+
/** Skip incoming change */
|
|
30
|
+
Skip = 0,
|
|
31
|
+
/** Replace local row with incoming changed row */
|
|
32
|
+
Replace = 1,
|
|
33
|
+
/** Abort apply changeset */
|
|
34
|
+
Abort = 2
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=BeSQLiteInternal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeSQLiteInternal.d.ts","sourceRoot":"","sources":["../../../src/internal/BeSQLiteInternal.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,gBAAgB;AAChB,oBAAY,aAAa;IACvB,GAAG,IAAI;IACP,GAAG,IAAI;CACR;AAED,gBAAgB;AAChB,oBAAY,WAAW;IACrB,UAAU,IAAI;IACd,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,OAAO,IAAI;IACX,OAAO,IAAI;CACZ;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,UAAU,IAAI;IACd,UAAU,IAAI;CACf;AAED,gBAAgB;AAChB,oBAAY,oBAAoB;IAC9B,2BAA2B;IAC3B,IAAI,IAAI;IACR,kDAAkD;IAClD,OAAO,IAAI;IACX,4BAA4B;IAC5B,KAAK,IAAI;CACV"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module BeSQLite
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DbConflictResolution = exports.DbConflictCause = exports.DbValueType = exports.DbChangeStage = void 0;
|
|
11
|
+
/** @internal */
|
|
12
|
+
var DbChangeStage;
|
|
13
|
+
(function (DbChangeStage) {
|
|
14
|
+
DbChangeStage[DbChangeStage["Old"] = 0] = "Old";
|
|
15
|
+
DbChangeStage[DbChangeStage["New"] = 1] = "New";
|
|
16
|
+
})(DbChangeStage || (exports.DbChangeStage = DbChangeStage = {}));
|
|
17
|
+
/** @internal */
|
|
18
|
+
var DbValueType;
|
|
19
|
+
(function (DbValueType) {
|
|
20
|
+
DbValueType[DbValueType["IntegerVal"] = 1] = "IntegerVal";
|
|
21
|
+
DbValueType[DbValueType["FloatVal"] = 2] = "FloatVal";
|
|
22
|
+
DbValueType[DbValueType["TextVal"] = 3] = "TextVal";
|
|
23
|
+
DbValueType[DbValueType["BlobVal"] = 4] = "BlobVal";
|
|
24
|
+
DbValueType[DbValueType["NullVal"] = 5] = "NullVal";
|
|
25
|
+
})(DbValueType || (exports.DbValueType = DbValueType = {}));
|
|
26
|
+
/** Cause of conflict when applying a changeset.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
var DbConflictCause;
|
|
30
|
+
(function (DbConflictCause) {
|
|
31
|
+
DbConflictCause[DbConflictCause["Data"] = 1] = "Data";
|
|
32
|
+
DbConflictCause[DbConflictCause["NotFound"] = 2] = "NotFound";
|
|
33
|
+
DbConflictCause[DbConflictCause["Conflict"] = 3] = "Conflict";
|
|
34
|
+
DbConflictCause[DbConflictCause["Constraint"] = 4] = "Constraint";
|
|
35
|
+
DbConflictCause[DbConflictCause["ForeignKey"] = 5] = "ForeignKey";
|
|
36
|
+
})(DbConflictCause || (exports.DbConflictCause = DbConflictCause = {}));
|
|
37
|
+
/** @internal */
|
|
38
|
+
var DbConflictResolution;
|
|
39
|
+
(function (DbConflictResolution) {
|
|
40
|
+
/** Skip incoming change */
|
|
41
|
+
DbConflictResolution[DbConflictResolution["Skip"] = 0] = "Skip";
|
|
42
|
+
/** Replace local row with incoming changed row */
|
|
43
|
+
DbConflictResolution[DbConflictResolution["Replace"] = 1] = "Replace";
|
|
44
|
+
/** Abort apply changeset */
|
|
45
|
+
DbConflictResolution[DbConflictResolution["Abort"] = 2] = "Abort";
|
|
46
|
+
})(DbConflictResolution || (exports.DbConflictResolution = DbConflictResolution = {}));
|
|
47
|
+
//# sourceMappingURL=BeSQLiteInternal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeSQLiteInternal.js","sourceRoot":"","sources":["../../../src/internal/BeSQLiteInternal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gBAAgB;AAChB,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,+CAAO,CAAA;IACP,+CAAO,CAAA;AACT,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,gBAAgB;AAChB,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,yDAAc,CAAA;IACd,qDAAY,CAAA;IACZ,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,mDAAW,CAAA;AACb,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAED;;GAEG;AACH,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,6DAAY,CAAA;IACZ,6DAAY,CAAA;IACZ,iEAAc,CAAA;IACd,iEAAc,CAAA;AAChB,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,gBAAgB;AAChB,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,2BAA2B;IAC3B,+DAAQ,CAAA;IACR,kDAAkD;IAClD,qEAAW,CAAA;IACX,4BAA4B;IAC5B,iEAAS,CAAA;AACX,CAAC,EAPW,oBAAoB,oCAApB,oBAAoB,QAO/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module BeSQLite\r\n */\r\n\r\n/** @internal */\r\nexport enum DbChangeStage {\r\n Old = 0,\r\n New = 1\r\n}\r\n\r\n/** @internal */\r\nexport enum DbValueType {\r\n IntegerVal = 1,\r\n FloatVal = 2,\r\n TextVal = 3,\r\n BlobVal = 4,\r\n NullVal = 5\r\n}\r\n\r\n/** Cause of conflict when applying a changeset.\r\n * @internal\r\n */\r\nexport enum DbConflictCause {\r\n Data = 1,\r\n NotFound = 2,\r\n Conflict = 3,\r\n Constraint = 4,\r\n ForeignKey = 5,\r\n}\r\n\r\n/** @internal */\r\nexport enum DbConflictResolution {\r\n /** Skip incoming change */\r\n Skip = 0,\r\n /** Replace local row with incoming changed row */\r\n Replace = 1,\r\n /** Abort apply changeset */\r\n Abort = 2,\r\n}\r\n\r\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Errors
|
|
3
|
+
*/
|
|
4
|
+
/** Return codes for methods which perform repository management operations.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare enum RepositoryStatus {
|
|
8
|
+
Success = 0,
|
|
9
|
+
/** The repository server did not respond to a request */
|
|
10
|
+
ServerUnavailable = 86017,
|
|
11
|
+
/** A requested lock was already held by another briefcase */
|
|
12
|
+
LockAlreadyHeld = 86018,
|
|
13
|
+
/** Failed to sync briefcase manager with server */
|
|
14
|
+
SyncError = 86019,
|
|
15
|
+
/** Response from server not understood */
|
|
16
|
+
InvalidResponse = 86020,
|
|
17
|
+
/** An operation requires local changes to be committed or abandoned */
|
|
18
|
+
PendingTransactions = 86021,
|
|
19
|
+
/** A lock cannot be relinquished because the associated object has been modified */
|
|
20
|
+
LockUsed = 86022,
|
|
21
|
+
/** An operation required creation of a ChangeSet, which failed */
|
|
22
|
+
CannotCreateChangeSet = 86023,
|
|
23
|
+
/** Request to server not understood */
|
|
24
|
+
InvalidRequest = 86024,
|
|
25
|
+
/** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
|
|
26
|
+
ChangeSetRequired = 86025,
|
|
27
|
+
/** A requested DgnCode is reserved by another briefcase or in use */
|
|
28
|
+
CodeUnavailable = 86026,
|
|
29
|
+
/** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
|
|
30
|
+
CodeNotReserved = 86027,
|
|
31
|
+
/** A DgnCode cannot be relinquished because it has been used locally */
|
|
32
|
+
CodeUsed = 86028,
|
|
33
|
+
/** A required lock is not held by this briefcase */
|
|
34
|
+
LockNotHeld = 86029,
|
|
35
|
+
/** Repository is currently locked, no changes allowed */
|
|
36
|
+
RepositoryIsLocked = 86030,
|
|
37
|
+
/** Channel write constraint violation, such as an attempt to write outside the designated channel. */
|
|
38
|
+
ChannelConstraintViolation = 86031
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=RepositoryStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepositoryStatus.d.ts","sourceRoot":"","sources":["../../../src/internal/RepositoryStatus.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,OAAO,IAAI;IACX,yDAAyD;IACzD,iBAAiB,QAAU;IAC3B,6DAA6D;IAC7D,eAAe,QAAU;IACzB,mDAAmD;IACnD,SAAS,QAAU;IACnB,0CAA0C;IAC1C,eAAe,QAAU;IACzB,uEAAuE;IACvE,mBAAmB,QAAU;IAC7B,oFAAoF;IACpF,QAAQ,QAAU;IAClB,kEAAkE;IAClE,qBAAqB,QAAU;IAC/B,uCAAuC;IACvC,cAAc,QAAU;IACxB,uHAAuH;IACvH,iBAAiB,QAAU;IAC3B,qEAAqE;IACrE,eAAe,QAAU;IACzB,gGAAgG;IAChG,eAAe,QAAU;IACzB,wEAAwE;IACxE,QAAQ,QAAU;IAClB,oDAAoD;IACpD,WAAW,QAAU;IACrB,yDAAyD;IACzD,kBAAkB,QAAU;IAC5B,sGAAsG;IACtG,0BAA0B,QAAU;CACrC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Errors
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.RepositoryStatus = void 0;
|
|
11
|
+
/** Return codes for methods which perform repository management operations.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
var RepositoryStatus;
|
|
15
|
+
(function (RepositoryStatus) {
|
|
16
|
+
RepositoryStatus[RepositoryStatus["Success"] = 0] = "Success";
|
|
17
|
+
/** The repository server did not respond to a request */
|
|
18
|
+
RepositoryStatus[RepositoryStatus["ServerUnavailable"] = 86017] = "ServerUnavailable";
|
|
19
|
+
/** A requested lock was already held by another briefcase */
|
|
20
|
+
RepositoryStatus[RepositoryStatus["LockAlreadyHeld"] = 86018] = "LockAlreadyHeld";
|
|
21
|
+
/** Failed to sync briefcase manager with server */
|
|
22
|
+
RepositoryStatus[RepositoryStatus["SyncError"] = 86019] = "SyncError";
|
|
23
|
+
/** Response from server not understood */
|
|
24
|
+
RepositoryStatus[RepositoryStatus["InvalidResponse"] = 86020] = "InvalidResponse";
|
|
25
|
+
/** An operation requires local changes to be committed or abandoned */
|
|
26
|
+
RepositoryStatus[RepositoryStatus["PendingTransactions"] = 86021] = "PendingTransactions";
|
|
27
|
+
/** A lock cannot be relinquished because the associated object has been modified */
|
|
28
|
+
RepositoryStatus[RepositoryStatus["LockUsed"] = 86022] = "LockUsed";
|
|
29
|
+
/** An operation required creation of a ChangeSet, which failed */
|
|
30
|
+
RepositoryStatus[RepositoryStatus["CannotCreateChangeSet"] = 86023] = "CannotCreateChangeSet";
|
|
31
|
+
/** Request to server not understood */
|
|
32
|
+
RepositoryStatus[RepositoryStatus["InvalidRequest"] = 86024] = "InvalidRequest";
|
|
33
|
+
/** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
|
|
34
|
+
RepositoryStatus[RepositoryStatus["ChangeSetRequired"] = 86025] = "ChangeSetRequired";
|
|
35
|
+
/** A requested DgnCode is reserved by another briefcase or in use */
|
|
36
|
+
RepositoryStatus[RepositoryStatus["CodeUnavailable"] = 86026] = "CodeUnavailable";
|
|
37
|
+
/** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
|
|
38
|
+
RepositoryStatus[RepositoryStatus["CodeNotReserved"] = 86027] = "CodeNotReserved";
|
|
39
|
+
/** A DgnCode cannot be relinquished because it has been used locally */
|
|
40
|
+
RepositoryStatus[RepositoryStatus["CodeUsed"] = 86028] = "CodeUsed";
|
|
41
|
+
/** A required lock is not held by this briefcase */
|
|
42
|
+
RepositoryStatus[RepositoryStatus["LockNotHeld"] = 86029] = "LockNotHeld";
|
|
43
|
+
/** Repository is currently locked, no changes allowed */
|
|
44
|
+
RepositoryStatus[RepositoryStatus["RepositoryIsLocked"] = 86030] = "RepositoryIsLocked";
|
|
45
|
+
/** Channel write constraint violation, such as an attempt to write outside the designated channel. */
|
|
46
|
+
RepositoryStatus[RepositoryStatus["ChannelConstraintViolation"] = 86031] = "ChannelConstraintViolation";
|
|
47
|
+
})(RepositoryStatus || (exports.RepositoryStatus = RepositoryStatus = {}));
|
|
48
|
+
//# sourceMappingURL=RepositoryStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepositoryStatus.js","sourceRoot":"","sources":["../../../src/internal/RepositoryStatus.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,gBAgCX;AAhCD,WAAY,gBAAgB;IAC1B,6DAAW,CAAA;IACX,yDAAyD;IACzD,qFAA2B,CAAA;IAC3B,6DAA6D;IAC7D,iFAAyB,CAAA;IACzB,mDAAmD;IACnD,qEAAmB,CAAA;IACnB,0CAA0C;IAC1C,iFAAyB,CAAA;IACzB,uEAAuE;IACvE,yFAA6B,CAAA;IAC7B,oFAAoF;IACpF,mEAAkB,CAAA;IAClB,kEAAkE;IAClE,6FAA+B,CAAA;IAC/B,uCAAuC;IACvC,+EAAwB,CAAA;IACxB,uHAAuH;IACvH,qFAA2B,CAAA;IAC3B,qEAAqE;IACrE,iFAAyB,CAAA;IACzB,gGAAgG;IAChG,iFAAyB,CAAA;IACzB,wEAAwE;IACxE,mEAAkB,CAAA;IAClB,oDAAoD;IACpD,yEAAqB,CAAA;IACrB,yDAAyD;IACzD,uFAA4B,CAAA;IAC5B,sGAAsG;IACtG,uGAAoC,CAAA;AACtC,CAAC,EAhCW,gBAAgB,gCAAhB,gBAAgB,QAgC3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Errors\r\n */\r\n\r\n/** Return codes for methods which perform repository management operations.\r\n * @internal\r\n */\r\nexport enum RepositoryStatus {\r\n Success = 0,\r\n /** The repository server did not respond to a request */\r\n ServerUnavailable = 0x15001,\r\n /** A requested lock was already held by another briefcase */\r\n LockAlreadyHeld = 0x15002,\r\n /** Failed to sync briefcase manager with server */\r\n SyncError = 0x15003,\r\n /** Response from server not understood */\r\n InvalidResponse = 0x15004,\r\n /** An operation requires local changes to be committed or abandoned */\r\n PendingTransactions = 0x15005,\r\n /** A lock cannot be relinquished because the associated object has been modified */\r\n LockUsed = 0x15006,\r\n /** An operation required creation of a ChangeSet, which failed */\r\n CannotCreateChangeSet = 0x15007,\r\n /** Request to server not understood */\r\n InvalidRequest = 0x15008,\r\n /** A change set committed to the server must be integrated into the briefcase before the operation can be completed */\r\n ChangeSetRequired = 0x15009,\r\n /** A requested DgnCode is reserved by another briefcase or in use */\r\n CodeUnavailable = 0x1500A,\r\n /** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */\r\n CodeNotReserved = 0x1500B,\r\n /** A DgnCode cannot be relinquished because it has been used locally */\r\n CodeUsed = 0x1500C,\r\n /** A required lock is not held by this briefcase */\r\n LockNotHeld = 0x1500D,\r\n /** Repository is currently locked, no changes allowed */\r\n RepositoryIsLocked = 0x1500E,\r\n /** Channel write constraint violation, such as an attempt to write outside the designated channel. */\r\n ChannelConstraintViolation = 0x1500F,\r\n}\r\n\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DbValueType = exports.DbConflictResolution = exports.DbConflictCause = exports.DbChangeStage = exports.RepositoryStatus = exports.staticLoggerMetadata = void 0;
|
|
8
|
+
var staticLoggerMetadata_1 = require("./staticLoggerMetadata");
|
|
9
|
+
Object.defineProperty(exports, "staticLoggerMetadata", { enumerable: true, get: function () { return staticLoggerMetadata_1.staticLoggerMetadata; } });
|
|
10
|
+
var RepositoryStatus_1 = require("./RepositoryStatus");
|
|
11
|
+
Object.defineProperty(exports, "RepositoryStatus", { enumerable: true, get: function () { return RepositoryStatus_1.RepositoryStatus; } });
|
|
12
|
+
var BeSQLiteInternal_1 = require("./BeSQLiteInternal");
|
|
13
|
+
Object.defineProperty(exports, "DbChangeStage", { enumerable: true, get: function () { return BeSQLiteInternal_1.DbChangeStage; } });
|
|
14
|
+
Object.defineProperty(exports, "DbConflictCause", { enumerable: true, get: function () { return BeSQLiteInternal_1.DbConflictCause; } });
|
|
15
|
+
Object.defineProperty(exports, "DbConflictResolution", { enumerable: true, get: function () { return BeSQLiteInternal_1.DbConflictResolution; } });
|
|
16
|
+
Object.defineProperty(exports, "DbValueType", { enumerable: true, get: function () { return BeSQLiteInternal_1.DbValueType; } });
|
|
17
|
+
//# sourceMappingURL=cross-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,uDAAuG;AAA9F,iHAAA,aAAa,OAAA;AAAE,mHAAA,eAAe,OAAA;AAAE,wHAAA,oBAAoB,OAAA;AAAE,+GAAA,WAAW,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport { staticLoggerMetadata } from \"./staticLoggerMetadata\";\r\nexport { RepositoryStatus } from \"./RepositoryStatus\";\r\nexport { DbChangeStage, DbConflictCause, DbConflictResolution, DbValueType } from \"./BeSQLiteInternal\";\r\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Logging
|
|
3
|
+
*/
|
|
4
|
+
import { LoggingMetaData } from "../BentleyError";
|
|
5
|
+
/** All static metadata is combined with per-call metadata and stringified in every log message.
|
|
6
|
+
* Static metadata can either be an object or a function that returns an object.
|
|
7
|
+
* Use a key to identify entries in the map so the can be removed individually.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const staticLoggerMetadata: Map<String, LoggingMetaData>;
|
|
11
|
+
//# sourceMappingURL=staticLoggerMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staticLoggerMetadata.d.ts","sourceRoot":"","sources":["../../../src/internal/staticLoggerMetadata.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,8BAAqC,CAAC"}
|