@itwin/core-i18n 4.8.0-dev.4 → 4.8.0-dev.41
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 +46 -1
- package/ThirdPartyNotices.md +1 -1
- package/lib/cjs/test/webpack/bundled-tests.instrumented.js +488 -420
- package/lib/cjs/test/webpack/bundled-tests.instrumented.js.map +1 -1
- package/lib/cjs/test/webpack/bundled-tests.js +347 -279
- package/lib/cjs/test/webpack/bundled-tests.js.map +1 -1
- package/package.json +6 -6
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
/** @packageDocumentation
|
|
18
18
|
* @module Localization
|
|
19
19
|
*/
|
|
20
|
-
function
|
|
21
|
-
var path = "D:\\vsts_a\\
|
|
22
|
-
var hash = "
|
|
20
|
+
function cov_13zvjr7880() {
|
|
21
|
+
var path = "D:\\vsts_a\\7\\s\\core\\i18n\\lib\\cjs\\ITwinLocalization.js";
|
|
22
|
+
var hash = "b7d28e8be81a5b8215543db3ffacca996586e768";
|
|
23
23
|
var global = new Function("return this")();
|
|
24
24
|
var gcv = "__coverage__";
|
|
25
25
|
var coverageData = {
|
|
26
|
-
path: "D:\\vsts_a\\
|
|
26
|
+
path: "D:\\vsts_a\\7\\s\\core\\i18n\\lib\\cjs\\ITwinLocalization.js",
|
|
27
27
|
statementMap: {
|
|
28
28
|
"0": {
|
|
29
29
|
start: {
|
|
@@ -2270,13 +2270,13 @@ function cov_1exkrud5g4() {
|
|
|
2270
2270
|
inputSourceMap: {
|
|
2271
2271
|
version: 3,
|
|
2272
2272
|
file: "ITwinLocalization.js",
|
|
2273
|
-
sources: ["D:\\vsts_a\\
|
|
2273
|
+
sources: ["D:\\vsts_a\\7\\s\\core\\i18n\\src\\ITwinLocalization.ts"],
|
|
2274
2274
|
names: [],
|
|
2275
2275
|
mappings: "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",
|
|
2276
2276
|
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 Localization\r\n */\r\n\r\nimport i18next, { i18n, InitOptions, Module, TOptionsBase } from \"i18next\";\r\nimport i18nextBrowserLanguageDetector, { DetectorOptions } from \"i18next-browser-languagedetector\";\r\nimport Backend, { BackendOptions } from \"i18next-http-backend\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport type { Localization } from \"@itwin/core-common\";\r\n\r\nconst DEFAULT_MAX_RETRIES: number = 1; // a low number prevents wasted time and potential timeouts when requesting localization files throws an error\r\n\r\n/** Options for ITwinLocalization\r\n * @public\r\n */\r\nexport interface LocalizationOptions {\r\n urlTemplate?: string;\r\n backendPlugin?: Module;\r\n detectorPlugin?: Module;\r\n initOptions?: InitOptions;\r\n backendHttpOptions?: BackendOptions;\r\n detectorOptions?: DetectorOptions;\r\n}\r\n\r\n/** Supplies localizations for iTwin.js\r\n * @note this class uses the [i18next](https://www.i18next.com/) package.\r\n * @public\r\n */\r\nexport class ITwinLocalization implements Localization {\r\n public i18next: i18n;\r\n private readonly _initOptions: InitOptions;\r\n private readonly _backendOptions: BackendOptions;\r\n private readonly _detectionOptions: DetectorOptions;\r\n private readonly _namespaces = new Map<string, Promise<void>>();\r\n\r\n public constructor(options?: LocalizationOptions) {\r\n this.i18next = i18next.createInstance();\r\n\r\n this._backendOptions = {\r\n loadPath: options?.urlTemplate ?? \"locales/{{lng}}/{{ns}}.json\",\r\n crossDomain: true,\r\n ...options?.backendHttpOptions,\r\n };\r\n\r\n this._detectionOptions = {\r\n order: [\"querystring\", \"navigator\", \"htmlTag\"],\r\n lookupQuerystring: \"lng\",\r\n caches: [],\r\n ...options?.detectorOptions,\r\n };\r\n\r\n this._initOptions = {\r\n interpolation: { escapeValue: true },\r\n fallbackLng: \"en\",\r\n maxRetries: DEFAULT_MAX_RETRIES,\r\n backend: this._backendOptions,\r\n detection: this._detectionOptions,\r\n ...options?.initOptions,\r\n };\r\n\r\n this.i18next\r\n .use(options?.detectorPlugin ?? i18nextBrowserLanguageDetector)\r\n .use(options?.backendPlugin ?? Backend)\r\n .use(TranslationLogger);\r\n }\r\n\r\n public async initialize(namespaces: string[]): Promise<void> {\r\n\r\n // Also consider namespaces passed into constructor\r\n const initNamespaces: string[] = [this._initOptions.ns || []].flat();\r\n const combinedNamespaces: Set<string> = new Set([...namespaces, ...initNamespaces]); // without duplicates\r\n\r\n const defaultNamespace: string | false | readonly string[] = this._initOptions.defaultNS ?? namespaces[0];\r\n if (defaultNamespace)\r\n combinedNamespaces.add(defaultNamespace as string); // Make sure default namespace is in namespaces list\r\n\r\n const initOptions: InitOptions = {\r\n ...this._initOptions,\r\n defaultNS: defaultNamespace,\r\n ns: [...combinedNamespaces],\r\n };\r\n\r\n // if in a development environment, set debugging\r\n if (process.env.NODE_ENV === \"development\")\r\n initOptions.debug = true;\r\n\r\n const initPromise = this.i18next.init(initOptions) as unknown as Promise<void>;\r\n\r\n for (const ns of namespaces)\r\n this._namespaces.set(ns, initPromise);\r\n\r\n return initPromise;\r\n }\r\n\r\n /** Replace all instances of `%{key}` within a string with the translations of those keys.\r\n * For example:\r\n * ``` ts\r\n * \"MyKeys\": {\r\n * \"Key1\": \"First value\",\r\n * \"Key2\": \"Second value\"\r\n * }\r\n * ```\r\n *\r\n * ``` ts\r\n * i18.translateKeys(\"string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!\"\") // returns \"string with First Value followed by Second Value!\"\r\n * ```\r\n * @param line The input line, potentially containing %{keys}.\r\n * @returns The line with all %{keys} translated\r\n * @public\r\n */\r\n public getLocalizedKeys(line: string): string {\r\n return line.replace(/\\%\\{(.+?)\\}/g, (_match, tag) => this.getLocalizedString(tag));\r\n }\r\n\r\n /** Return the translated value of a key.\r\n * @param key - the key that matches a property in the JSON localization file.\r\n * @note The key includes the namespace, which identifies the particular localization file that contains the property,\r\n * followed by a colon, followed by the property in the JSON file.\r\n * For example:\r\n * ``` ts\r\n * const dataString: string = IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.BingDataAttribution\");\r\n * ```\r\n * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.\r\n * @returns The string corresponding to the first key that resolves.\r\n * @throws Error if no keys resolve to a string.\r\n * @public\r\n */\r\n public getLocalizedString(key: string | string[], options?: TOptionsBase): string {\r\n if (options?.returnDetails || options?.returnObjects) {\r\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\r\n }\r\n\r\n const value = this.i18next.t(key, options);\r\n\r\n if (typeof value !== \"string\") {\r\n throw new Error(\"Translation key(s) string not found\");\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need\r\n * to include a namespace. If a key includes a namespace, that namespace will be used for interpolating that key.\r\n * @param namespace - the namespace that identifies the particular localization file that contains the property.\r\n * @param key - the key that matches a property in the JSON localization file.\r\n * @returns The string corresponding to the first key that resolves.\r\n * @throws Error if no keys resolve to a string.\r\n * @internal\r\n */\r\n public getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TOptionsBase): string {\r\n let fullKey: string | string[] = \"\";\r\n\r\n if (typeof key === \"string\") {\r\n fullKey = `${namespace}:${key}`;\r\n } else {\r\n fullKey = key.map((subKey: string) => {\r\n return `${namespace}:${subKey}`;\r\n });\r\n }\r\n\r\n return this.getLocalizedString(fullKey, options);\r\n }\r\n\r\n /** Gets the English translation.\r\n * @param namespace - the namespace that identifies the particular localization file that contains the property.\r\n * @param key - the key that matches a property in the JSON localization file.\r\n * @returns The string corresponding to the first key that resolves.\r\n * @throws Error if no keys resolve to a string.\r\n * @internal\r\n */\r\n public getEnglishString(namespace: string, key: string | string[], options?: TOptionsBase): string {\r\n if (options?.returnDetails || options?.returnObjects) {\r\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\r\n }\r\n\r\n options = {\r\n ...options,\r\n ns: namespace, // ensure namespace argument is used\r\n };\r\n\r\n const en = this.i18next.getFixedT(\"en\", namespace);\r\n const str = en(key, options);\r\n if (typeof str !== \"string\")\r\n throw new Error(\"Translation key(s) not found\");\r\n\r\n return str;\r\n }\r\n\r\n /** Get the promise for an already registered Namespace.\r\n * @param name - the name of the namespace\r\n * @public\r\n */\r\n public getNamespacePromise(name: string): Promise<void> | undefined {\r\n return this._namespaces.get(name);\r\n }\r\n\r\n /** @internal */\r\n public getLanguageList(): readonly string[] {\r\n return this.i18next.languages;\r\n }\r\n\r\n /** override the language detected in the browser */\r\n public async changeLanguage(language: string) {\r\n return this.i18next.changeLanguage(language) as unknown as Promise<void>;\r\n }\r\n\r\n /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.\r\n * @param name - the name of the namespace, which is the base name of the JSON file that contains the localization properties.\r\n * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,\r\n * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await\r\n * fulfillment of the readPromise Promise property of the returned LocalizationNamespace.\r\n * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)\r\n * @public\r\n */\r\n public async registerNamespace(name: string): Promise<void> {\r\n const existing = this._namespaces.get(name);\r\n if (existing !== undefined)\r\n return existing;\r\n\r\n const theReadPromise = new Promise<void>((resolve) => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.i18next.loadNamespaces(name, (err) => {\r\n if (!err)\r\n return resolve();\r\n\r\n // Here we got a non-null err object.\r\n // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.\r\n // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.\r\n // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.\r\n // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.\r\n let locales = this.getLanguageList().map((thisLocale: any) => `/${thisLocale}/`);\r\n\r\n try {\r\n for (const thisError of err) {\r\n if (typeof thisError === \"string\")\r\n locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));\r\n }\r\n } catch (e) {\r\n locales = [];\r\n }\r\n // if we removed every locale from the array, it wasn't loaded.\r\n if (locales.length === 0)\r\n Logger.logError(\"i18n\", `No resources for namespace ${name} could be loaded`);\r\n\r\n resolve();\r\n });\r\n });\r\n this._namespaces.set(name, theReadPromise);\r\n return theReadPromise;\r\n }\r\n\r\n /** @internal */\r\n public unregisterNamespace(name: string): void {\r\n this._namespaces.delete(name);\r\n }\r\n}\r\n\r\nclass TranslationLogger {\r\n public static readonly type = \"logger\";\r\n public log(args: string[]) { Logger.logInfo(\"i18n\", this.createLogMessage(args)); }\r\n public warn(args: string[]) { Logger.logWarning(\"i18n\", this.createLogMessage(args)); }\r\n public error(args: string[]) { Logger.logError(\"i18n\", this.createLogMessage(args)); }\r\n private createLogMessage(args: string[]) {\r\n let message = args[0];\r\n for (let i = 1; i < args.length; ++i) {\r\n if (typeof args[i] === \"string\")\r\n message += `\\n ${args[i]}`;\r\n }\r\n return message;\r\n }\r\n}\r\n"]
|
|
2277
2277
|
},
|
|
2278
2278
|
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
2279
|
-
hash: "
|
|
2279
|
+
hash: "b7d28e8be81a5b8215543db3ffacca996586e768"
|
|
2280
2280
|
};
|
|
2281
2281
|
var coverage = global[gcv] || (global[gcv] = {});
|
|
2282
2282
|
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
@@ -2285,56 +2285,56 @@ function cov_1exkrud5g4() {
|
|
|
2285
2285
|
var actualCoverage = coverage[path];
|
|
2286
2286
|
{
|
|
2287
2287
|
// @ts-ignore
|
|
2288
|
-
|
|
2288
|
+
cov_13zvjr7880 = function () {
|
|
2289
2289
|
return actualCoverage;
|
|
2290
2290
|
};
|
|
2291
2291
|
}
|
|
2292
2292
|
return actualCoverage;
|
|
2293
2293
|
}
|
|
2294
|
-
|
|
2295
|
-
var __importDefault = (
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
return (
|
|
2294
|
+
cov_13zvjr7880();
|
|
2295
|
+
var __importDefault = (cov_13zvjr7880().s[0]++, (cov_13zvjr7880().b[0][0]++, this) && (cov_13zvjr7880().b[0][1]++, this.__importDefault) || (cov_13zvjr7880().b[0][2]++, function (mod) {
|
|
2296
|
+
cov_13zvjr7880().f[0]++;
|
|
2297
|
+
cov_13zvjr7880().s[1]++;
|
|
2298
|
+
return (cov_13zvjr7880().b[2][0]++, mod) && (cov_13zvjr7880().b[2][1]++, mod.__esModule) ? (cov_13zvjr7880().b[1][0]++, mod) : (cov_13zvjr7880().b[1][1]++, {
|
|
2299
2299
|
"default": mod
|
|
2300
2300
|
});
|
|
2301
2301
|
}));
|
|
2302
|
-
|
|
2302
|
+
cov_13zvjr7880().s[2]++;
|
|
2303
2303
|
Object.defineProperty(exports, "__esModule", ({
|
|
2304
2304
|
value: true
|
|
2305
2305
|
}));
|
|
2306
|
-
|
|
2306
|
+
cov_13zvjr7880().s[3]++;
|
|
2307
2307
|
exports.ITwinLocalization = void 0;
|
|
2308
|
-
const i18next_1 = (
|
|
2309
|
-
const i18next_browser_languagedetector_1 = (
|
|
2310
|
-
const i18next_http_backend_1 = (
|
|
2311
|
-
const core_bentley_1 = (
|
|
2312
|
-
const DEFAULT_MAX_RETRIES = (
|
|
2308
|
+
const i18next_1 = (cov_13zvjr7880().s[4]++, __importDefault(__webpack_require__(/*! i18next */ "../../common/temp/node_modules/.pnpm/i18next@21.9.1/node_modules/i18next/dist/cjs/i18next.js")));
|
|
2309
|
+
const i18next_browser_languagedetector_1 = (cov_13zvjr7880().s[5]++, __importDefault(__webpack_require__(/*! i18next-browser-languagedetector */ "../../common/temp/node_modules/.pnpm/i18next-browser-languagedetector@6.1.2/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js")));
|
|
2310
|
+
const i18next_http_backend_1 = (cov_13zvjr7880().s[6]++, __importDefault(__webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@1.4.4/node_modules/i18next-http-backend/cjs/index.js")));
|
|
2311
|
+
const core_bentley_1 = (cov_13zvjr7880().s[7]++, __webpack_require__(/*! @itwin/core-bentley */ "../bentley/lib/esm/core-bentley.js"));
|
|
2312
|
+
const DEFAULT_MAX_RETRIES = (cov_13zvjr7880().s[8]++, 1); // a low number prevents wasted time and potential timeouts when requesting localization files throws an error
|
|
2313
2313
|
/** Supplies localizations for iTwin.js
|
|
2314
2314
|
* @note this class uses the [i18next](https://www.i18next.com/) package.
|
|
2315
2315
|
* @public
|
|
2316
2316
|
*/
|
|
2317
2317
|
class ITwinLocalization {
|
|
2318
2318
|
constructor(options) {
|
|
2319
|
-
|
|
2320
|
-
|
|
2319
|
+
cov_13zvjr7880().f[1]++;
|
|
2320
|
+
cov_13zvjr7880().s[9]++;
|
|
2321
2321
|
this._namespaces = new Map();
|
|
2322
|
-
|
|
2322
|
+
cov_13zvjr7880().s[10]++;
|
|
2323
2323
|
this.i18next = i18next_1.default.createInstance();
|
|
2324
|
-
|
|
2324
|
+
cov_13zvjr7880().s[11]++;
|
|
2325
2325
|
this._backendOptions = {
|
|
2326
|
-
loadPath: (
|
|
2326
|
+
loadPath: (cov_13zvjr7880().b[3][0]++, options?.urlTemplate) ?? (cov_13zvjr7880().b[3][1]++, "locales/{{lng}}/{{ns}}.json"),
|
|
2327
2327
|
crossDomain: true,
|
|
2328
2328
|
...options?.backendHttpOptions
|
|
2329
2329
|
};
|
|
2330
|
-
|
|
2330
|
+
cov_13zvjr7880().s[12]++;
|
|
2331
2331
|
this._detectionOptions = {
|
|
2332
2332
|
order: ["querystring", "navigator", "htmlTag"],
|
|
2333
2333
|
lookupQuerystring: "lng",
|
|
2334
2334
|
caches: [],
|
|
2335
2335
|
...options?.detectorOptions
|
|
2336
2336
|
};
|
|
2337
|
-
|
|
2337
|
+
cov_13zvjr7880().s[13]++;
|
|
2338
2338
|
this._initOptions = {
|
|
2339
2339
|
interpolation: {
|
|
2340
2340
|
escapeValue: true
|
|
@@ -2345,40 +2345,40 @@ class ITwinLocalization {
|
|
|
2345
2345
|
detection: this._detectionOptions,
|
|
2346
2346
|
...options?.initOptions
|
|
2347
2347
|
};
|
|
2348
|
-
|
|
2349
|
-
this.i18next.use((
|
|
2348
|
+
cov_13zvjr7880().s[14]++;
|
|
2349
|
+
this.i18next.use((cov_13zvjr7880().b[4][0]++, options?.detectorPlugin) ?? (cov_13zvjr7880().b[4][1]++, i18next_browser_languagedetector_1.default)).use((cov_13zvjr7880().b[5][0]++, options?.backendPlugin) ?? (cov_13zvjr7880().b[5][1]++, i18next_http_backend_1.default)).use(TranslationLogger);
|
|
2350
2350
|
}
|
|
2351
2351
|
async initialize(namespaces) {
|
|
2352
|
-
|
|
2352
|
+
cov_13zvjr7880().f[2]++;
|
|
2353
2353
|
// Also consider namespaces passed into constructor
|
|
2354
|
-
const initNamespaces = (
|
|
2355
|
-
const combinedNamespaces = (
|
|
2356
|
-
const defaultNamespace = (
|
|
2357
|
-
|
|
2354
|
+
const initNamespaces = (cov_13zvjr7880().s[15]++, [(cov_13zvjr7880().b[6][0]++, this._initOptions.ns) || (cov_13zvjr7880().b[6][1]++, [])].flat());
|
|
2355
|
+
const combinedNamespaces = (cov_13zvjr7880().s[16]++, new Set([...namespaces, ...initNamespaces])); // without duplicates
|
|
2356
|
+
const defaultNamespace = (cov_13zvjr7880().s[17]++, (cov_13zvjr7880().b[7][0]++, this._initOptions.defaultNS) ?? (cov_13zvjr7880().b[7][1]++, namespaces[0]));
|
|
2357
|
+
cov_13zvjr7880().s[18]++;
|
|
2358
2358
|
if (defaultNamespace) {
|
|
2359
|
-
|
|
2360
|
-
|
|
2359
|
+
cov_13zvjr7880().b[8][0]++;
|
|
2360
|
+
cov_13zvjr7880().s[19]++;
|
|
2361
2361
|
combinedNamespaces.add(defaultNamespace);
|
|
2362
2362
|
} else {
|
|
2363
|
-
|
|
2363
|
+
cov_13zvjr7880().b[8][1]++;
|
|
2364
2364
|
} // Make sure default namespace is in namespaces list
|
|
2365
|
-
const initOptions = (
|
|
2365
|
+
const initOptions = (cov_13zvjr7880().s[20]++, {
|
|
2366
2366
|
...this._initOptions,
|
|
2367
2367
|
defaultNS: defaultNamespace,
|
|
2368
2368
|
ns: [...combinedNamespaces]
|
|
2369
2369
|
});
|
|
2370
2370
|
// if in a development environment, set debugging
|
|
2371
|
-
|
|
2371
|
+
cov_13zvjr7880().s[21]++;
|
|
2372
2372
|
if (false) {} else {
|
|
2373
|
-
|
|
2373
|
+
cov_13zvjr7880().b[9][1]++;
|
|
2374
2374
|
}
|
|
2375
|
-
const initPromise = (
|
|
2376
|
-
|
|
2375
|
+
const initPromise = (cov_13zvjr7880().s[23]++, this.i18next.init(initOptions));
|
|
2376
|
+
cov_13zvjr7880().s[24]++;
|
|
2377
2377
|
for (const ns of namespaces) {
|
|
2378
|
-
|
|
2378
|
+
cov_13zvjr7880().s[25]++;
|
|
2379
2379
|
this._namespaces.set(ns, initPromise);
|
|
2380
2380
|
}
|
|
2381
|
-
|
|
2381
|
+
cov_13zvjr7880().s[26]++;
|
|
2382
2382
|
return initPromise;
|
|
2383
2383
|
}
|
|
2384
2384
|
/** Replace all instances of `%{key}` within a string with the translations of those keys.
|
|
@@ -2398,11 +2398,11 @@ class ITwinLocalization {
|
|
|
2398
2398
|
* @public
|
|
2399
2399
|
*/
|
|
2400
2400
|
getLocalizedKeys(line) {
|
|
2401
|
-
|
|
2402
|
-
|
|
2401
|
+
cov_13zvjr7880().f[3]++;
|
|
2402
|
+
cov_13zvjr7880().s[27]++;
|
|
2403
2403
|
return line.replace(/\%\{(.+?)\}/g, (_match, tag) => {
|
|
2404
|
-
|
|
2405
|
-
|
|
2404
|
+
cov_13zvjr7880().f[4]++;
|
|
2405
|
+
cov_13zvjr7880().s[28]++;
|
|
2406
2406
|
return this.getLocalizedString(tag);
|
|
2407
2407
|
});
|
|
2408
2408
|
}
|
|
@@ -2420,25 +2420,25 @@ class ITwinLocalization {
|
|
|
2420
2420
|
* @public
|
|
2421
2421
|
*/
|
|
2422
2422
|
getLocalizedString(key, options) {
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
if ((
|
|
2426
|
-
|
|
2427
|
-
|
|
2423
|
+
cov_13zvjr7880().f[5]++;
|
|
2424
|
+
cov_13zvjr7880().s[29]++;
|
|
2425
|
+
if ((cov_13zvjr7880().b[11][0]++, options?.returnDetails) || (cov_13zvjr7880().b[11][1]++, options?.returnObjects)) {
|
|
2426
|
+
cov_13zvjr7880().b[10][0]++;
|
|
2427
|
+
cov_13zvjr7880().s[30]++;
|
|
2428
2428
|
throw new Error("Translation key must map to a string, but the given options will result in an object");
|
|
2429
2429
|
} else {
|
|
2430
|
-
|
|
2430
|
+
cov_13zvjr7880().b[10][1]++;
|
|
2431
2431
|
}
|
|
2432
|
-
const value = (
|
|
2433
|
-
|
|
2432
|
+
const value = (cov_13zvjr7880().s[31]++, this.i18next.t(key, options));
|
|
2433
|
+
cov_13zvjr7880().s[32]++;
|
|
2434
2434
|
if (typeof value !== "string") {
|
|
2435
|
-
|
|
2436
|
-
|
|
2435
|
+
cov_13zvjr7880().b[12][0]++;
|
|
2436
|
+
cov_13zvjr7880().s[33]++;
|
|
2437
2437
|
throw new Error("Translation key(s) string not found");
|
|
2438
2438
|
} else {
|
|
2439
|
-
|
|
2439
|
+
cov_13zvjr7880().b[12][1]++;
|
|
2440
2440
|
}
|
|
2441
|
-
|
|
2441
|
+
cov_13zvjr7880().s[34]++;
|
|
2442
2442
|
return value;
|
|
2443
2443
|
}
|
|
2444
2444
|
/** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need
|
|
@@ -2450,23 +2450,23 @@ class ITwinLocalization {
|
|
|
2450
2450
|
* @internal
|
|
2451
2451
|
*/
|
|
2452
2452
|
getLocalizedStringWithNamespace(namespace, key, options) {
|
|
2453
|
-
|
|
2454
|
-
let fullKey = (
|
|
2455
|
-
|
|
2453
|
+
cov_13zvjr7880().f[6]++;
|
|
2454
|
+
let fullKey = (cov_13zvjr7880().s[35]++, "");
|
|
2455
|
+
cov_13zvjr7880().s[36]++;
|
|
2456
2456
|
if (typeof key === "string") {
|
|
2457
|
-
|
|
2458
|
-
|
|
2457
|
+
cov_13zvjr7880().b[13][0]++;
|
|
2458
|
+
cov_13zvjr7880().s[37]++;
|
|
2459
2459
|
fullKey = `${namespace}:${key}`;
|
|
2460
2460
|
} else {
|
|
2461
|
-
|
|
2462
|
-
|
|
2461
|
+
cov_13zvjr7880().b[13][1]++;
|
|
2462
|
+
cov_13zvjr7880().s[38]++;
|
|
2463
2463
|
fullKey = key.map(subKey => {
|
|
2464
|
-
|
|
2465
|
-
|
|
2464
|
+
cov_13zvjr7880().f[7]++;
|
|
2465
|
+
cov_13zvjr7880().s[39]++;
|
|
2466
2466
|
return `${namespace}:${subKey}`;
|
|
2467
2467
|
});
|
|
2468
2468
|
}
|
|
2469
|
-
|
|
2469
|
+
cov_13zvjr7880().s[40]++;
|
|
2470
2470
|
return this.getLocalizedString(fullKey, options);
|
|
2471
2471
|
}
|
|
2472
2472
|
/** Gets the English translation.
|
|
@@ -2477,31 +2477,31 @@ class ITwinLocalization {
|
|
|
2477
2477
|
* @internal
|
|
2478
2478
|
*/
|
|
2479
2479
|
getEnglishString(namespace, key, options) {
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
if ((
|
|
2483
|
-
|
|
2484
|
-
|
|
2480
|
+
cov_13zvjr7880().f[8]++;
|
|
2481
|
+
cov_13zvjr7880().s[41]++;
|
|
2482
|
+
if ((cov_13zvjr7880().b[15][0]++, options?.returnDetails) || (cov_13zvjr7880().b[15][1]++, options?.returnObjects)) {
|
|
2483
|
+
cov_13zvjr7880().b[14][0]++;
|
|
2484
|
+
cov_13zvjr7880().s[42]++;
|
|
2485
2485
|
throw new Error("Translation key must map to a string, but the given options will result in an object");
|
|
2486
2486
|
} else {
|
|
2487
|
-
|
|
2487
|
+
cov_13zvjr7880().b[14][1]++;
|
|
2488
2488
|
}
|
|
2489
|
-
|
|
2489
|
+
cov_13zvjr7880().s[43]++;
|
|
2490
2490
|
options = {
|
|
2491
2491
|
...options,
|
|
2492
2492
|
ns: namespace // ensure namespace argument is used
|
|
2493
2493
|
};
|
|
2494
|
-
const en = (
|
|
2495
|
-
const str = (
|
|
2496
|
-
|
|
2494
|
+
const en = (cov_13zvjr7880().s[44]++, this.i18next.getFixedT("en", namespace));
|
|
2495
|
+
const str = (cov_13zvjr7880().s[45]++, en(key, options));
|
|
2496
|
+
cov_13zvjr7880().s[46]++;
|
|
2497
2497
|
if (typeof str !== "string") {
|
|
2498
|
-
|
|
2499
|
-
|
|
2498
|
+
cov_13zvjr7880().b[16][0]++;
|
|
2499
|
+
cov_13zvjr7880().s[47]++;
|
|
2500
2500
|
throw new Error("Translation key(s) not found");
|
|
2501
2501
|
} else {
|
|
2502
|
-
|
|
2502
|
+
cov_13zvjr7880().b[16][1]++;
|
|
2503
2503
|
}
|
|
2504
|
-
|
|
2504
|
+
cov_13zvjr7880().s[48]++;
|
|
2505
2505
|
return str;
|
|
2506
2506
|
}
|
|
2507
2507
|
/** Get the promise for an already registered Namespace.
|
|
@@ -2509,20 +2509,20 @@ class ITwinLocalization {
|
|
|
2509
2509
|
* @public
|
|
2510
2510
|
*/
|
|
2511
2511
|
getNamespacePromise(name) {
|
|
2512
|
-
|
|
2513
|
-
|
|
2512
|
+
cov_13zvjr7880().f[9]++;
|
|
2513
|
+
cov_13zvjr7880().s[49]++;
|
|
2514
2514
|
return this._namespaces.get(name);
|
|
2515
2515
|
}
|
|
2516
2516
|
/** @internal */
|
|
2517
2517
|
getLanguageList() {
|
|
2518
|
-
|
|
2519
|
-
|
|
2518
|
+
cov_13zvjr7880().f[10]++;
|
|
2519
|
+
cov_13zvjr7880().s[50]++;
|
|
2520
2520
|
return this.i18next.languages;
|
|
2521
2521
|
}
|
|
2522
2522
|
/** override the language detected in the browser */
|
|
2523
2523
|
async changeLanguage(language) {
|
|
2524
|
-
|
|
2525
|
-
|
|
2524
|
+
cov_13zvjr7880().f[11]++;
|
|
2525
|
+
cov_13zvjr7880().s[51]++;
|
|
2526
2526
|
return this.i18next.changeLanguage(language);
|
|
2527
2527
|
}
|
|
2528
2528
|
/** Register a new Namespace and return it. If the namespace is already registered, it will be returned.
|
|
@@ -2534,123 +2534,123 @@ class ITwinLocalization {
|
|
|
2534
2534
|
* @public
|
|
2535
2535
|
*/
|
|
2536
2536
|
async registerNamespace(name) {
|
|
2537
|
-
|
|
2538
|
-
const existing = (
|
|
2539
|
-
|
|
2537
|
+
cov_13zvjr7880().f[12]++;
|
|
2538
|
+
const existing = (cov_13zvjr7880().s[52]++, this._namespaces.get(name));
|
|
2539
|
+
cov_13zvjr7880().s[53]++;
|
|
2540
2540
|
if (existing !== undefined) {
|
|
2541
|
-
|
|
2542
|
-
|
|
2541
|
+
cov_13zvjr7880().b[17][0]++;
|
|
2542
|
+
cov_13zvjr7880().s[54]++;
|
|
2543
2543
|
return existing;
|
|
2544
2544
|
} else {
|
|
2545
|
-
|
|
2545
|
+
cov_13zvjr7880().b[17][1]++;
|
|
2546
2546
|
}
|
|
2547
|
-
const theReadPromise = (
|
|
2548
|
-
|
|
2549
|
-
|
|
2547
|
+
const theReadPromise = (cov_13zvjr7880().s[55]++, new Promise(resolve => {
|
|
2548
|
+
cov_13zvjr7880().f[13]++;
|
|
2549
|
+
cov_13zvjr7880().s[56]++;
|
|
2550
2550
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
2551
2551
|
this.i18next.loadNamespaces(name, err => {
|
|
2552
|
-
|
|
2553
|
-
|
|
2552
|
+
cov_13zvjr7880().f[14]++;
|
|
2553
|
+
cov_13zvjr7880().s[57]++;
|
|
2554
2554
|
if (!err) {
|
|
2555
|
-
|
|
2556
|
-
|
|
2555
|
+
cov_13zvjr7880().b[18][0]++;
|
|
2556
|
+
cov_13zvjr7880().s[58]++;
|
|
2557
2557
|
return resolve();
|
|
2558
2558
|
} else {
|
|
2559
|
-
|
|
2559
|
+
cov_13zvjr7880().b[18][1]++;
|
|
2560
2560
|
}
|
|
2561
2561
|
// Here we got a non-null err object.
|
|
2562
2562
|
// This method is called when the system has attempted to load the resources for the namespaces for each possible locale.
|
|
2563
2563
|
// For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.
|
|
2564
2564
|
// Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.
|
|
2565
2565
|
// There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.
|
|
2566
|
-
let locales = (
|
|
2567
|
-
|
|
2568
|
-
|
|
2566
|
+
let locales = (cov_13zvjr7880().s[59]++, this.getLanguageList().map(thisLocale => {
|
|
2567
|
+
cov_13zvjr7880().f[15]++;
|
|
2568
|
+
cov_13zvjr7880().s[60]++;
|
|
2569
2569
|
return `/${thisLocale}/`;
|
|
2570
2570
|
}));
|
|
2571
|
-
|
|
2571
|
+
cov_13zvjr7880().s[61]++;
|
|
2572
2572
|
try {
|
|
2573
|
-
|
|
2573
|
+
cov_13zvjr7880().s[62]++;
|
|
2574
2574
|
for (const thisError of err) {
|
|
2575
|
-
|
|
2575
|
+
cov_13zvjr7880().s[63]++;
|
|
2576
2576
|
if (typeof thisError === "string") {
|
|
2577
|
-
|
|
2578
|
-
|
|
2577
|
+
cov_13zvjr7880().b[19][0]++;
|
|
2578
|
+
cov_13zvjr7880().s[64]++;
|
|
2579
2579
|
locales = locales.filter(thisLocale => {
|
|
2580
|
-
|
|
2581
|
-
|
|
2580
|
+
cov_13zvjr7880().f[16]++;
|
|
2581
|
+
cov_13zvjr7880().s[65]++;
|
|
2582
2582
|
return !thisError.includes(thisLocale);
|
|
2583
2583
|
});
|
|
2584
2584
|
} else {
|
|
2585
|
-
|
|
2585
|
+
cov_13zvjr7880().b[19][1]++;
|
|
2586
2586
|
}
|
|
2587
2587
|
}
|
|
2588
2588
|
} catch (e) {
|
|
2589
|
-
|
|
2589
|
+
cov_13zvjr7880().s[66]++;
|
|
2590
2590
|
locales = [];
|
|
2591
2591
|
}
|
|
2592
2592
|
// if we removed every locale from the array, it wasn't loaded.
|
|
2593
|
-
|
|
2593
|
+
cov_13zvjr7880().s[67]++;
|
|
2594
2594
|
if (locales.length === 0) {
|
|
2595
|
-
|
|
2596
|
-
|
|
2595
|
+
cov_13zvjr7880().b[20][0]++;
|
|
2596
|
+
cov_13zvjr7880().s[68]++;
|
|
2597
2597
|
core_bentley_1.Logger.logError("i18n", `No resources for namespace ${name} could be loaded`);
|
|
2598
2598
|
} else {
|
|
2599
|
-
|
|
2599
|
+
cov_13zvjr7880().b[20][1]++;
|
|
2600
2600
|
}
|
|
2601
|
-
|
|
2601
|
+
cov_13zvjr7880().s[69]++;
|
|
2602
2602
|
resolve();
|
|
2603
2603
|
});
|
|
2604
2604
|
}));
|
|
2605
|
-
|
|
2605
|
+
cov_13zvjr7880().s[70]++;
|
|
2606
2606
|
this._namespaces.set(name, theReadPromise);
|
|
2607
|
-
|
|
2607
|
+
cov_13zvjr7880().s[71]++;
|
|
2608
2608
|
return theReadPromise;
|
|
2609
2609
|
}
|
|
2610
2610
|
/** @internal */
|
|
2611
2611
|
unregisterNamespace(name) {
|
|
2612
|
-
|
|
2613
|
-
|
|
2612
|
+
cov_13zvjr7880().f[17]++;
|
|
2613
|
+
cov_13zvjr7880().s[72]++;
|
|
2614
2614
|
this._namespaces.delete(name);
|
|
2615
2615
|
}
|
|
2616
2616
|
}
|
|
2617
|
-
|
|
2617
|
+
cov_13zvjr7880().s[73]++;
|
|
2618
2618
|
exports.ITwinLocalization = ITwinLocalization;
|
|
2619
2619
|
class TranslationLogger {
|
|
2620
2620
|
log(args) {
|
|
2621
|
-
|
|
2622
|
-
|
|
2621
|
+
cov_13zvjr7880().f[18]++;
|
|
2622
|
+
cov_13zvjr7880().s[74]++;
|
|
2623
2623
|
core_bentley_1.Logger.logInfo("i18n", this.createLogMessage(args));
|
|
2624
2624
|
}
|
|
2625
2625
|
warn(args) {
|
|
2626
|
-
|
|
2627
|
-
|
|
2626
|
+
cov_13zvjr7880().f[19]++;
|
|
2627
|
+
cov_13zvjr7880().s[75]++;
|
|
2628
2628
|
core_bentley_1.Logger.logWarning("i18n", this.createLogMessage(args));
|
|
2629
2629
|
}
|
|
2630
2630
|
error(args) {
|
|
2631
|
-
|
|
2632
|
-
|
|
2631
|
+
cov_13zvjr7880().f[20]++;
|
|
2632
|
+
cov_13zvjr7880().s[76]++;
|
|
2633
2633
|
core_bentley_1.Logger.logError("i18n", this.createLogMessage(args));
|
|
2634
2634
|
}
|
|
2635
2635
|
createLogMessage(args) {
|
|
2636
|
-
|
|
2637
|
-
let message = (
|
|
2638
|
-
|
|
2639
|
-
for (let i = (
|
|
2640
|
-
|
|
2636
|
+
cov_13zvjr7880().f[21]++;
|
|
2637
|
+
let message = (cov_13zvjr7880().s[77]++, args[0]);
|
|
2638
|
+
cov_13zvjr7880().s[78]++;
|
|
2639
|
+
for (let i = (cov_13zvjr7880().s[79]++, 1); i < args.length; ++i) {
|
|
2640
|
+
cov_13zvjr7880().s[80]++;
|
|
2641
2641
|
if (typeof args[i] === "string") {
|
|
2642
|
-
|
|
2643
|
-
|
|
2642
|
+
cov_13zvjr7880().b[21][0]++;
|
|
2643
|
+
cov_13zvjr7880().s[81]++;
|
|
2644
2644
|
message += `\n ${args[i]}`;
|
|
2645
2645
|
} else {
|
|
2646
|
-
|
|
2646
|
+
cov_13zvjr7880().b[21][1]++;
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
|
-
|
|
2649
|
+
cov_13zvjr7880().s[82]++;
|
|
2650
2650
|
return message;
|
|
2651
2651
|
}
|
|
2652
2652
|
}
|
|
2653
|
-
|
|
2653
|
+
cov_13zvjr7880().s[83]++;
|
|
2654
2654
|
TranslationLogger.type = "logger";
|
|
2655
2655
|
|
|
2656
2656
|
/***/ }),
|
|
@@ -18561,12 +18561,8 @@ class BeEventList {
|
|
|
18561
18561
|
"use strict";
|
|
18562
18562
|
__webpack_require__.r(__webpack_exports__);
|
|
18563
18563
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18564
|
-
/* harmony export */ "DbChangeStage": () => (/* binding */ DbChangeStage),
|
|
18565
|
-
/* harmony export */ "DbConflictCause": () => (/* binding */ DbConflictCause),
|
|
18566
|
-
/* harmony export */ "DbConflictResolution": () => (/* binding */ DbConflictResolution),
|
|
18567
18564
|
/* harmony export */ "DbOpcode": () => (/* binding */ DbOpcode),
|
|
18568
18565
|
/* harmony export */ "DbResult": () => (/* binding */ DbResult),
|
|
18569
|
-
/* harmony export */ "DbValueType": () => (/* binding */ DbValueType),
|
|
18570
18566
|
/* harmony export */ "OpenMode": () => (/* binding */ OpenMode)
|
|
18571
18567
|
/* harmony export */ });
|
|
18572
18568
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -18596,48 +18592,6 @@ var DbOpcode;
|
|
|
18596
18592
|
/** Some columns of an existing row were updated. */
|
|
18597
18593
|
DbOpcode[DbOpcode["Update"] = 23] = "Update";
|
|
18598
18594
|
})(DbOpcode || (DbOpcode = {}));
|
|
18599
|
-
/** Change value stage.
|
|
18600
|
-
* @internal
|
|
18601
|
-
*/
|
|
18602
|
-
var DbChangeStage;
|
|
18603
|
-
(function (DbChangeStage) {
|
|
18604
|
-
DbChangeStage[DbChangeStage["Old"] = 0] = "Old";
|
|
18605
|
-
DbChangeStage[DbChangeStage["New"] = 1] = "New";
|
|
18606
|
-
})(DbChangeStage || (DbChangeStage = {}));
|
|
18607
|
-
/** Change value type.
|
|
18608
|
-
* @internal
|
|
18609
|
-
*/
|
|
18610
|
-
var DbValueType;
|
|
18611
|
-
(function (DbValueType) {
|
|
18612
|
-
DbValueType[DbValueType["IntegerVal"] = 1] = "IntegerVal";
|
|
18613
|
-
DbValueType[DbValueType["FloatVal"] = 2] = "FloatVal";
|
|
18614
|
-
DbValueType[DbValueType["TextVal"] = 3] = "TextVal";
|
|
18615
|
-
DbValueType[DbValueType["BlobVal"] = 4] = "BlobVal";
|
|
18616
|
-
DbValueType[DbValueType["NullVal"] = 5] = "NullVal";
|
|
18617
|
-
})(DbValueType || (DbValueType = {}));
|
|
18618
|
-
/** Cause of conflict when applying a changeset
|
|
18619
|
-
* @internal
|
|
18620
|
-
*/
|
|
18621
|
-
var DbConflictCause;
|
|
18622
|
-
(function (DbConflictCause) {
|
|
18623
|
-
DbConflictCause[DbConflictCause["Data"] = 1] = "Data";
|
|
18624
|
-
DbConflictCause[DbConflictCause["NotFound"] = 2] = "NotFound";
|
|
18625
|
-
DbConflictCause[DbConflictCause["Conflict"] = 3] = "Conflict";
|
|
18626
|
-
DbConflictCause[DbConflictCause["Constraint"] = 4] = "Constraint";
|
|
18627
|
-
DbConflictCause[DbConflictCause["ForeignKey"] = 5] = "ForeignKey";
|
|
18628
|
-
})(DbConflictCause || (DbConflictCause = {}));
|
|
18629
|
-
/** Conflict resolution strategy
|
|
18630
|
-
* @internal
|
|
18631
|
-
*/
|
|
18632
|
-
var DbConflictResolution;
|
|
18633
|
-
(function (DbConflictResolution) {
|
|
18634
|
-
/** Skip incoming change */
|
|
18635
|
-
DbConflictResolution[DbConflictResolution["Skip"] = 0] = "Skip";
|
|
18636
|
-
/** Replace local row with incoming changed row */
|
|
18637
|
-
DbConflictResolution[DbConflictResolution["Replace"] = 1] = "Replace";
|
|
18638
|
-
/** Abort apply changeset */
|
|
18639
|
-
DbConflictResolution[DbConflictResolution["Abort"] = 2] = "Abort";
|
|
18640
|
-
})(DbConflictResolution || (DbConflictResolution = {}));
|
|
18641
18595
|
/** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations.
|
|
18642
18596
|
* @public
|
|
18643
18597
|
*/
|
|
@@ -18815,10 +18769,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18815
18769
|
/* harmony export */ "IModelHubStatus": () => (/* binding */ IModelHubStatus),
|
|
18816
18770
|
/* harmony export */ "IModelStatus": () => (/* binding */ IModelStatus),
|
|
18817
18771
|
/* harmony export */ "RealityDataStatus": () => (/* binding */ RealityDataStatus),
|
|
18818
|
-
/* harmony export */ "RepositoryStatus": () => (/* binding */ RepositoryStatus),
|
|
18819
18772
|
/* harmony export */ "RpcInterfaceStatus": () => (/* binding */ RpcInterfaceStatus)
|
|
18820
18773
|
/* harmony export */ });
|
|
18821
18774
|
/* harmony import */ var _BeSQLite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BeSQLite */ "../bentley/lib/esm/BeSQLite.js");
|
|
18775
|
+
/* harmony import */ var _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/RepositoryStatus */ "../bentley/lib/esm/internal/RepositoryStatus.js");
|
|
18822
18776
|
/*---------------------------------------------------------------------------------------------
|
|
18823
18777
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
18824
18778
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -18827,6 +18781,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18827
18781
|
* @module Errors
|
|
18828
18782
|
*/
|
|
18829
18783
|
|
|
18784
|
+
|
|
18830
18785
|
/** Standard status code.
|
|
18831
18786
|
* This status code should be rarely used.
|
|
18832
18787
|
* Prefer to throw an exception to indicate an error, rather than returning a special status code.
|
|
@@ -19004,43 +18959,6 @@ var ChangeSetStatus;
|
|
|
19004
18959
|
/** ChangeSet(s) download was cancelled. */
|
|
19005
18960
|
ChangeSetStatus[ChangeSetStatus["DownloadCancelled"] = 90138] = "DownloadCancelled";
|
|
19006
18961
|
})(ChangeSetStatus || (ChangeSetStatus = {}));
|
|
19007
|
-
/** Return codes for methods which perform repository management operations
|
|
19008
|
-
* @internal
|
|
19009
|
-
*/
|
|
19010
|
-
var RepositoryStatus;
|
|
19011
|
-
(function (RepositoryStatus) {
|
|
19012
|
-
RepositoryStatus[RepositoryStatus["Success"] = 0] = "Success";
|
|
19013
|
-
/** The repository server did not respond to a request */
|
|
19014
|
-
RepositoryStatus[RepositoryStatus["ServerUnavailable"] = 86017] = "ServerUnavailable";
|
|
19015
|
-
/** A requested lock was already held by another briefcase */
|
|
19016
|
-
RepositoryStatus[RepositoryStatus["LockAlreadyHeld"] = 86018] = "LockAlreadyHeld";
|
|
19017
|
-
/** Failed to sync briefcase manager with server */
|
|
19018
|
-
RepositoryStatus[RepositoryStatus["SyncError"] = 86019] = "SyncError";
|
|
19019
|
-
/** Response from server not understood */
|
|
19020
|
-
RepositoryStatus[RepositoryStatus["InvalidResponse"] = 86020] = "InvalidResponse";
|
|
19021
|
-
/** An operation requires local changes to be committed or abandoned */
|
|
19022
|
-
RepositoryStatus[RepositoryStatus["PendingTransactions"] = 86021] = "PendingTransactions";
|
|
19023
|
-
/** A lock cannot be relinquished because the associated object has been modified */
|
|
19024
|
-
RepositoryStatus[RepositoryStatus["LockUsed"] = 86022] = "LockUsed";
|
|
19025
|
-
/** An operation required creation of a ChangeSet, which failed */
|
|
19026
|
-
RepositoryStatus[RepositoryStatus["CannotCreateChangeSet"] = 86023] = "CannotCreateChangeSet";
|
|
19027
|
-
/** Request to server not understood */
|
|
19028
|
-
RepositoryStatus[RepositoryStatus["InvalidRequest"] = 86024] = "InvalidRequest";
|
|
19029
|
-
/** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
|
|
19030
|
-
RepositoryStatus[RepositoryStatus["ChangeSetRequired"] = 86025] = "ChangeSetRequired";
|
|
19031
|
-
/** A requested DgnCode is reserved by another briefcase or in use */
|
|
19032
|
-
RepositoryStatus[RepositoryStatus["CodeUnavailable"] = 86026] = "CodeUnavailable";
|
|
19033
|
-
/** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
|
|
19034
|
-
RepositoryStatus[RepositoryStatus["CodeNotReserved"] = 86027] = "CodeNotReserved";
|
|
19035
|
-
/** A DgnCode cannot be relinquished because it has been used locally */
|
|
19036
|
-
RepositoryStatus[RepositoryStatus["CodeUsed"] = 86028] = "CodeUsed";
|
|
19037
|
-
/** A required lock is not held by this briefcase */
|
|
19038
|
-
RepositoryStatus[RepositoryStatus["LockNotHeld"] = 86029] = "LockNotHeld";
|
|
19039
|
-
/** Repository is currently locked, no changes allowed */
|
|
19040
|
-
RepositoryStatus[RepositoryStatus["RepositoryIsLocked"] = 86030] = "RepositoryIsLocked";
|
|
19041
|
-
/** Channel write constraint violation, such as an attempt to write outside the designated channel. */
|
|
19042
|
-
RepositoryStatus[RepositoryStatus["ChannelConstraintViolation"] = 86031] = "ChannelConstraintViolation";
|
|
19043
|
-
})(RepositoryStatus || (RepositoryStatus = {}));
|
|
19044
18962
|
/** Status from returned HTTP status code
|
|
19045
18963
|
* @beta
|
|
19046
18964
|
*/
|
|
@@ -19370,21 +19288,21 @@ class BentleyError extends Error {
|
|
|
19370
19288
|
case ChangeSetStatus.CannotMergeIntoMaster: return "Cannot merge changes into a Master DgnDb";
|
|
19371
19289
|
case ChangeSetStatus.CannotMergeIntoReversed: return "Cannot merge changes into a DgnDb that has reversed change sets";
|
|
19372
19290
|
case ChangeSetStatus.DownloadCancelled: return "ChangeSet(s) download was cancelled.";
|
|
19373
|
-
case RepositoryStatus.ServerUnavailable: return "ServerUnavailable";
|
|
19374
|
-
case RepositoryStatus.LockAlreadyHeld: return "LockAlreadyHeld";
|
|
19375
|
-
case RepositoryStatus.SyncError: return "SyncError";
|
|
19376
|
-
case RepositoryStatus.InvalidResponse: return "InvalidResponse";
|
|
19377
|
-
case RepositoryStatus.PendingTransactions: return "PendingTransactions";
|
|
19378
|
-
case RepositoryStatus.LockUsed: return "LockUsed";
|
|
19379
|
-
case RepositoryStatus.CannotCreateChangeSet: return "CannotCreateChangeSet";
|
|
19380
|
-
case RepositoryStatus.InvalidRequest: return "InvalidRequest";
|
|
19381
|
-
case RepositoryStatus.ChangeSetRequired: return "ChangeSetRequired";
|
|
19382
|
-
case RepositoryStatus.CodeUnavailable: return "CodeUnavailable";
|
|
19383
|
-
case RepositoryStatus.CodeNotReserved: return "CodeNotReserved";
|
|
19384
|
-
case RepositoryStatus.CodeUsed: return "CodeUsed";
|
|
19385
|
-
case RepositoryStatus.LockNotHeld: return "LockNotHeld";
|
|
19386
|
-
case RepositoryStatus.RepositoryIsLocked: return "RepositoryIsLocked";
|
|
19387
|
-
case RepositoryStatus.ChannelConstraintViolation: return "ChannelConstraintViolation";
|
|
19291
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ServerUnavailable: return "ServerUnavailable";
|
|
19292
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockAlreadyHeld: return "LockAlreadyHeld";
|
|
19293
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.SyncError: return "SyncError";
|
|
19294
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidResponse: return "InvalidResponse";
|
|
19295
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.PendingTransactions: return "PendingTransactions";
|
|
19296
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockUsed: return "LockUsed";
|
|
19297
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CannotCreateChangeSet: return "CannotCreateChangeSet";
|
|
19298
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidRequest: return "InvalidRequest";
|
|
19299
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChangeSetRequired: return "ChangeSetRequired";
|
|
19300
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUnavailable: return "CodeUnavailable";
|
|
19301
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeNotReserved: return "CodeNotReserved";
|
|
19302
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUsed: return "CodeUsed";
|
|
19303
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockNotHeld: return "LockNotHeld";
|
|
19304
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.RepositoryIsLocked: return "RepositoryIsLocked";
|
|
19305
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChannelConstraintViolation: return "ChannelConstraintViolation";
|
|
19388
19306
|
case HttpStatus.Info: return "HTTP Info";
|
|
19389
19307
|
case HttpStatus.Redirection: return "HTTP Redirection";
|
|
19390
19308
|
case HttpStatus.ClientError: return "HTTP Client error";
|
|
@@ -19921,7 +19839,7 @@ var CompressedId64Set;
|
|
|
19921
19839
|
}
|
|
19922
19840
|
CompressedId64Set.compressSet = compressSet;
|
|
19923
19841
|
/** Create a sorted array from `ids`, then return a compact string representation of those Ids.
|
|
19924
|
-
* @see [[compressIds]] if `ids` is known to already be sorted.
|
|
19842
|
+
* @see [[CompressedId64Set.compressIds]] if `ids` is known to already be sorted.
|
|
19925
19843
|
*/
|
|
19926
19844
|
function sortAndCompress(ids) {
|
|
19927
19845
|
// `string` is an Iterable<string>. In that case assume caller passed a single Id64String.
|
|
@@ -21212,6 +21130,11 @@ var Id64;
|
|
|
21212
21130
|
}
|
|
21213
21131
|
Id64.Uint32Map = Uint32Map;
|
|
21214
21132
|
})(Id64 || (Id64 = {}));
|
|
21133
|
+
function validateLocalId(num) {
|
|
21134
|
+
if (num < 0 || Math.round(num) !== num) {
|
|
21135
|
+
throw new Error("Local Id must be a non-negative integer");
|
|
21136
|
+
}
|
|
21137
|
+
}
|
|
21215
21138
|
/**
|
|
21216
21139
|
* Generates unique [[Id64String]] values in sequence, which are guaranteed not to conflict with Ids associated with persistent elements or models.
|
|
21217
21140
|
* This is useful for associating stable, non-persistent identifiers with things like [Decorator]($frontend)s.
|
|
@@ -21219,8 +21142,20 @@ var Id64;
|
|
|
21219
21142
|
* @public
|
|
21220
21143
|
*/
|
|
21221
21144
|
class TransientIdSequence {
|
|
21222
|
-
|
|
21223
|
-
|
|
21145
|
+
/** Constructor.
|
|
21146
|
+
* @param initialLocalId The starting local Id. The local Id of the first [[Id64String]] generated by [[getNext]] will be `initialLocalId + 1`.
|
|
21147
|
+
*/
|
|
21148
|
+
constructor(initialLocalId = 0) {
|
|
21149
|
+
validateLocalId(initialLocalId);
|
|
21150
|
+
this.initialLocalId = initialLocalId;
|
|
21151
|
+
this._localId = initialLocalId;
|
|
21152
|
+
}
|
|
21153
|
+
/** The maximum local Id generated by the sequence thus far. It is never less than [[initialLocalId]]. If it is equal to [[initialLocalId]], then the sequence has
|
|
21154
|
+
* not yet generated any Ids.
|
|
21155
|
+
* Each call to [[getNext]] increments this by 1 and uses it as the local Id of the generated [[Id64String]].
|
|
21156
|
+
*/
|
|
21157
|
+
get currentLocalId() {
|
|
21158
|
+
return this._localId;
|
|
21224
21159
|
}
|
|
21225
21160
|
/** Generate and return the next transient Id64String in the sequence.
|
|
21226
21161
|
* @deprecated in 3.x. Use [[getNext]].
|
|
@@ -21238,6 +21173,55 @@ class TransientIdSequence {
|
|
|
21238
21173
|
peekNext() {
|
|
21239
21174
|
return Id64.fromLocalAndBriefcaseIds(this._localId + 1, 0xffffff);
|
|
21240
21175
|
}
|
|
21176
|
+
/** Convert this sequence to its JSON representation. */
|
|
21177
|
+
toJSON() {
|
|
21178
|
+
return {
|
|
21179
|
+
initialLocalId: this.initialLocalId,
|
|
21180
|
+
currentLocalId: this.currentLocalId,
|
|
21181
|
+
};
|
|
21182
|
+
}
|
|
21183
|
+
/** Create a sequence from its JSON representation. */
|
|
21184
|
+
static fromJSON(props) {
|
|
21185
|
+
validateLocalId(props.currentLocalId);
|
|
21186
|
+
const sequence = new TransientIdSequence(props.initialLocalId);
|
|
21187
|
+
sequence._localId = props.currentLocalId;
|
|
21188
|
+
return sequence;
|
|
21189
|
+
}
|
|
21190
|
+
/** Obtain the JSON representation of a new sequence that diverges from this sequence, with its [[initialLocalId]] set to this sequence's [[currentLocalId]].
|
|
21191
|
+
* The two sequences can generate Ids independently. Later, you can [[merge]] the sequences, resolving conflicts where the two sequences generated identical Ids.
|
|
21192
|
+
* This is chiefly useful when generating transient Ids on a [Worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker).
|
|
21193
|
+
*/
|
|
21194
|
+
fork() {
|
|
21195
|
+
return {
|
|
21196
|
+
initialLocalId: this.currentLocalId,
|
|
21197
|
+
currentLocalId: this.currentLocalId,
|
|
21198
|
+
};
|
|
21199
|
+
}
|
|
21200
|
+
/** Integrate the Ids generated by a [[fork]] of this sequence. All of the Ids generated by `source` will be remapped to Ids at the end of this sequence.
|
|
21201
|
+
* This is chiefly useful when generating transient Ids on a [Worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker).
|
|
21202
|
+
* @param source The JSON representation of the [[fork]]ed sequence to be merged with this one.
|
|
21203
|
+
* @returns a function that permits you to remap the local Ids generated by `source` into the corresponding local Ids assigned by this sequence.
|
|
21204
|
+
* @throws Error if `source` is not a fork of this sequence or is malformed (e.g., contains negative and/or non-integer local Ids).
|
|
21205
|
+
*/
|
|
21206
|
+
merge(source) {
|
|
21207
|
+
const { initialLocalId, currentLocalId } = source;
|
|
21208
|
+
validateLocalId(initialLocalId);
|
|
21209
|
+
validateLocalId(currentLocalId);
|
|
21210
|
+
if (initialLocalId > this.currentLocalId) {
|
|
21211
|
+
throw new Error("Transient Id sequences do not intersect");
|
|
21212
|
+
}
|
|
21213
|
+
if (initialLocalId > currentLocalId) {
|
|
21214
|
+
throw new Error("Current local Id cannot be less than initial local Id");
|
|
21215
|
+
}
|
|
21216
|
+
const delta = this.currentLocalId - initialLocalId;
|
|
21217
|
+
this._localId += currentLocalId - initialLocalId;
|
|
21218
|
+
return (sourceLocalId) => {
|
|
21219
|
+
if (sourceLocalId > initialLocalId && sourceLocalId <= currentLocalId) {
|
|
21220
|
+
return sourceLocalId + delta;
|
|
21221
|
+
}
|
|
21222
|
+
return sourceLocalId;
|
|
21223
|
+
};
|
|
21224
|
+
}
|
|
21241
21225
|
}
|
|
21242
21226
|
/**
|
|
21243
21227
|
* The Guid namespace provides facilities for working with GUID strings using the "8-4-4-4-12" pattern.
|
|
@@ -21945,8 +21929,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21945
21929
|
/* harmony export */ "Logger": () => (/* binding */ Logger),
|
|
21946
21930
|
/* harmony export */ "PerfLogger": () => (/* binding */ PerfLogger)
|
|
21947
21931
|
/* harmony export */ });
|
|
21948
|
-
/* harmony import */ var
|
|
21949
|
-
/* harmony import */ var
|
|
21932
|
+
/* harmony import */ var _BeEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BeEvent */ "../bentley/lib/esm/BeEvent.js");
|
|
21933
|
+
/* harmony import */ var _BentleyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BentleyError */ "../bentley/lib/esm/BentleyError.js");
|
|
21934
|
+
/* harmony import */ var _BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BentleyLoggerCategory */ "../bentley/lib/esm/BentleyLoggerCategory.js");
|
|
21935
|
+
/* harmony import */ var _internal_staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internal/staticLoggerMetadata */ "../bentley/lib/esm/internal/staticLoggerMetadata.js");
|
|
21950
21936
|
/*---------------------------------------------------------------------------------------------
|
|
21951
21937
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
21952
21938
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -21956,6 +21942,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21956
21942
|
*/
|
|
21957
21943
|
|
|
21958
21944
|
|
|
21945
|
+
|
|
21946
|
+
|
|
21959
21947
|
/** Use to categorize logging messages by severity.
|
|
21960
21948
|
* @public
|
|
21961
21949
|
*/
|
|
@@ -21977,13 +21965,29 @@ var LogLevel;
|
|
|
21977
21965
|
* @public
|
|
21978
21966
|
*/
|
|
21979
21967
|
class Logger {
|
|
21980
|
-
/**
|
|
21968
|
+
/** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */
|
|
21969
|
+
static get onLogLevelChanged() {
|
|
21970
|
+
// We have to lazily initialize because it's static and BeEvent imports UnexpectedErrors which imports Logger which wants to instantiate BeEvent.
|
|
21971
|
+
if (undefined === Logger._onLogLevelChanged) {
|
|
21972
|
+
Logger._onLogLevelChanged = new _BeEvent__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
21973
|
+
}
|
|
21974
|
+
return Logger._onLogLevelChanged;
|
|
21975
|
+
}
|
|
21976
|
+
/** Maps category names to the least severe level at which messages in that category should be displayed,
|
|
21977
|
+
* or `undefined` if a minimum has not been defined.
|
|
21978
|
+
* @see [[setLevel]] to change the minimum logging level for a category.
|
|
21979
|
+
*/
|
|
21981
21980
|
static get categoryFilter() {
|
|
21982
|
-
|
|
21981
|
+
// NOTE: this property is accessed by native code.
|
|
21982
|
+
return this._categoryFilter;
|
|
21983
21983
|
}
|
|
21984
|
-
/**
|
|
21984
|
+
/** The least severe level at which messages should be displayed by default.
|
|
21985
|
+
* @see [[setLevelDefault]] to change this default.
|
|
21986
|
+
* @see [[setLevel]] to override this default for specific categories.
|
|
21987
|
+
*/
|
|
21985
21988
|
static get minLevel() {
|
|
21986
|
-
|
|
21989
|
+
// NOTE: this property is accessed by native code. */
|
|
21990
|
+
return this._minLevel;
|
|
21987
21991
|
}
|
|
21988
21992
|
/** Initialize the logger streams. Should be called at application initialization time. */
|
|
21989
21993
|
static initialize(logError, logWarning, logInfo, logTrace) {
|
|
@@ -22002,12 +22006,12 @@ class Logger {
|
|
|
22002
22006
|
/** merge the supplied metadata with all static metadata into one object */
|
|
22003
22007
|
static getMetaData(metaData) {
|
|
22004
22008
|
const metaObj = {};
|
|
22005
|
-
for (const meta of
|
|
22006
|
-
const val =
|
|
22009
|
+
for (const meta of _internal_staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_3__.staticLoggerMetadata) {
|
|
22010
|
+
const val = _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getMetaData(meta[1]);
|
|
22007
22011
|
if (val)
|
|
22008
22012
|
Object.assign(metaObj, val);
|
|
22009
22013
|
}
|
|
22010
|
-
Object.assign(metaObj,
|
|
22014
|
+
Object.assign(metaObj, _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getMetaData(metaData)); // do this last so user supplied values take precedence
|
|
22011
22015
|
return metaObj;
|
|
22012
22016
|
}
|
|
22013
22017
|
/** 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. */
|
|
@@ -22018,14 +22022,14 @@ class Logger {
|
|
|
22018
22022
|
/** Set the least severe level at which messages should be displayed by default. Call setLevel to override this default setting for specific categories. */
|
|
22019
22023
|
static setLevelDefault(minLevel) {
|
|
22020
22024
|
this._minLevel = minLevel;
|
|
22021
|
-
this.
|
|
22025
|
+
this.onLogLevelChanged.raiseEvent();
|
|
22022
22026
|
}
|
|
22023
22027
|
/** Set the minimum logging level for the specified category. The minimum level is least severe level at which messages in the
|
|
22024
22028
|
* specified category should be displayed.
|
|
22025
22029
|
*/
|
|
22026
22030
|
static setLevel(category, minLevel) {
|
|
22027
22031
|
Logger._categoryFilter[category] = minLevel;
|
|
22028
|
-
this.
|
|
22032
|
+
this.onLogLevelChanged.raiseEvent();
|
|
22029
22033
|
}
|
|
22030
22034
|
/** Interpret a string as the name of a LogLevel */
|
|
22031
22035
|
static parseLogLevel(str) {
|
|
@@ -22060,20 +22064,20 @@ class Logger {
|
|
|
22060
22064
|
const validProps = ["defaultLevel", "categoryLevels"];
|
|
22061
22065
|
for (const prop of Object.keys(config)) {
|
|
22062
22066
|
if (!validProps.includes(prop))
|
|
22063
|
-
throw new
|
|
22067
|
+
throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig - unrecognized property: ${prop}`);
|
|
22064
22068
|
if (prop === "defaultLevel") {
|
|
22065
22069
|
if (!Logger.isLogLevel(config.defaultLevel))
|
|
22066
|
-
throw new
|
|
22070
|
+
throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.defaultLevel must be a LogLevel. Invalid value: ${JSON.stringify(config.defaultLevel)}`);
|
|
22067
22071
|
}
|
|
22068
22072
|
else if (prop === "categoryLevels") {
|
|
22069
22073
|
const value = config[prop];
|
|
22070
22074
|
if (!Array.isArray(value))
|
|
22071
|
-
throw new
|
|
22075
|
+
throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels must be an array. Invalid value: ${JSON.stringify(value)}`);
|
|
22072
22076
|
for (const item of config[prop]) {
|
|
22073
22077
|
if (!item.hasOwnProperty("category") || !item.hasOwnProperty("logLevel"))
|
|
22074
|
-
throw new
|
|
22078
|
+
throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item must be a LoggerCategoryAndLevel {category: logLevel:}. Invalid value: ${JSON.stringify(item)}`);
|
|
22075
22079
|
if (!Logger.isLogLevel(item.logLevel))
|
|
22076
|
-
throw new
|
|
22080
|
+
throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item's logLevel property must be a LogLevel. Invalid value: ${JSON.stringify(item.logLevel)}`);
|
|
22077
22081
|
}
|
|
22078
22082
|
}
|
|
22079
22083
|
}
|
|
@@ -22081,7 +22085,7 @@ class Logger {
|
|
|
22081
22085
|
/** Get the minimum logging level for the specified category. */
|
|
22082
22086
|
static getLevel(category) {
|
|
22083
22087
|
// Prefer the level set for this category specifically
|
|
22084
|
-
const minLevelForThisCategory = Logger.
|
|
22088
|
+
const minLevelForThisCategory = Logger.categoryFilter[category];
|
|
22085
22089
|
if (minLevelForThisCategory !== undefined)
|
|
22086
22090
|
return minLevelForThisCategory;
|
|
22087
22091
|
// Fall back on the level set for the parent of this category.
|
|
@@ -22089,7 +22093,7 @@ class Logger {
|
|
|
22089
22093
|
if (parent !== -1)
|
|
22090
22094
|
return Logger.getLevel(category.slice(0, parent));
|
|
22091
22095
|
// Fall back on the default level.
|
|
22092
|
-
return Logger.
|
|
22096
|
+
return Logger.minLevel;
|
|
22093
22097
|
}
|
|
22094
22098
|
/** Turns off the least severe level at which messages should be displayed by default.
|
|
22095
22099
|
* This turns off logging for all messages for which no category minimum level is defined.
|
|
@@ -22117,8 +22121,8 @@ class Logger {
|
|
|
22117
22121
|
Logger._logError(category, message, metaData);
|
|
22118
22122
|
}
|
|
22119
22123
|
static getExceptionMessage(err) {
|
|
22120
|
-
const stack = Logger.logExceptionCallstacks ? `\n${
|
|
22121
|
-
return
|
|
22124
|
+
const stack = Logger.logExceptionCallstacks ? `\n${_BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorStack(err)}` : "";
|
|
22125
|
+
return _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorMessage(err) + stack;
|
|
22122
22126
|
}
|
|
22123
22127
|
/** Log the specified exception. The special "ExceptionType" property will be added as metadata.
|
|
22124
22128
|
* @param category The category of the message.
|
|
@@ -22127,7 +22131,7 @@ class Logger {
|
|
|
22127
22131
|
*/
|
|
22128
22132
|
static logException(category, err, log = (_category, message, metaData) => Logger.logError(_category, message, metaData)) {
|
|
22129
22133
|
log(category, Logger.getExceptionMessage(err), () => {
|
|
22130
|
-
return { ...
|
|
22134
|
+
return { ..._BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorMetadata(err), exceptionType: err.constructor.name };
|
|
22131
22135
|
});
|
|
22132
22136
|
}
|
|
22133
22137
|
/** Log the specified message to the **warning** stream.
|
|
@@ -22161,11 +22165,6 @@ class Logger {
|
|
|
22161
22165
|
Logger._categoryFilter = {};
|
|
22162
22166
|
/** Should the call stack be included when an exception is logged? */
|
|
22163
22167
|
Logger.logExceptionCallstacks = false;
|
|
22164
|
-
/** All static metadata is combined with per-call metadata and stringified in every log message.
|
|
22165
|
-
* Static metadata can either be an object or a function that returns an object.
|
|
22166
|
-
* Use a key to identify entries in the map so the can be removed individually.
|
|
22167
|
-
* @internal */
|
|
22168
|
-
Logger.staticMetaData = new Map();
|
|
22169
22168
|
/** Simple performance diagnostics utility.
|
|
22170
22169
|
* It measures the time from construction to disposal. On disposal it logs the routine name along with
|
|
22171
22170
|
* the duration in milliseconds.
|
|
@@ -22179,19 +22178,19 @@ class PerfLogger {
|
|
|
22179
22178
|
constructor(operation, metaData) {
|
|
22180
22179
|
this._operation = operation;
|
|
22181
22180
|
this._metaData = metaData;
|
|
22182
|
-
if (!Logger.isEnabled(
|
|
22181
|
+
if (!Logger.isEnabled(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, PerfLogger._severity)) {
|
|
22183
22182
|
this._startTimeStamp = 0;
|
|
22184
22183
|
return;
|
|
22185
22184
|
}
|
|
22186
|
-
Logger.logInfo(
|
|
22185
|
+
Logger.logInfo(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, `${this._operation},START`, this._metaData);
|
|
22187
22186
|
this._startTimeStamp = new Date().getTime(); // take timestamp
|
|
22188
22187
|
}
|
|
22189
22188
|
logMessage() {
|
|
22190
22189
|
const endTimeStamp = new Date().getTime();
|
|
22191
|
-
if (!Logger.isEnabled(
|
|
22190
|
+
if (!Logger.isEnabled(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, PerfLogger._severity))
|
|
22192
22191
|
return;
|
|
22193
|
-
Logger.logInfo(
|
|
22194
|
-
const mdata = this._metaData ?
|
|
22192
|
+
Logger.logInfo(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, `${this._operation},END`, () => {
|
|
22193
|
+
const mdata = this._metaData ? _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getMetaData(this._metaData) : {};
|
|
22195
22194
|
return {
|
|
22196
22195
|
...mdata, TimeElapsed: endTimeStamp - this._startTimeStamp, // eslint-disable-line @typescript-eslint/naming-convention
|
|
22197
22196
|
};
|
|
@@ -22250,14 +22249,18 @@ class ObservableSet extends Set {
|
|
|
22250
22249
|
return ret;
|
|
22251
22250
|
};
|
|
22252
22251
|
}
|
|
22253
|
-
/**
|
|
22252
|
+
/** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising
|
|
22253
|
+
* the [[onDeleted]] event if the item was removed from the set.
|
|
22254
|
+
*/
|
|
22254
22255
|
delete(item) {
|
|
22255
22256
|
const ret = super.delete(item);
|
|
22256
22257
|
if (ret)
|
|
22257
22258
|
this.onDeleted.raiseEvent(item);
|
|
22258
22259
|
return ret;
|
|
22259
22260
|
}
|
|
22260
|
-
/**
|
|
22261
|
+
/** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)
|
|
22262
|
+
* and raises the [[onCleared]] event.
|
|
22263
|
+
*/
|
|
22261
22264
|
clear() {
|
|
22262
22265
|
if (0 !== this.size) {
|
|
22263
22266
|
super.clear();
|
|
@@ -23274,6 +23277,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23274
23277
|
/* harmony export */ "SuccessCategory": () => (/* binding */ SuccessCategory)
|
|
23275
23278
|
/* harmony export */ });
|
|
23276
23279
|
/* harmony import */ var _BentleyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BentleyError */ "../bentley/lib/esm/BentleyError.js");
|
|
23280
|
+
/* harmony import */ var _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/RepositoryStatus */ "../bentley/lib/esm/internal/RepositoryStatus.js");
|
|
23277
23281
|
/*---------------------------------------------------------------------------------------------
|
|
23278
23282
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
23279
23283
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -23282,6 +23286,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23282
23286
|
* @module Errors
|
|
23283
23287
|
*/
|
|
23284
23288
|
|
|
23289
|
+
|
|
23285
23290
|
/** A group of related statuses for aggregate reporting purposes.
|
|
23286
23291
|
* @alpha
|
|
23287
23292
|
*/
|
|
@@ -23646,22 +23651,22 @@ function lookupHttpStatusCategory(statusCode) {
|
|
|
23646
23651
|
case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.ChangeSetStatus.CannotMergeIntoReadonly: return new ValidationError();
|
|
23647
23652
|
case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.ChangeSetStatus.CannotMergeIntoMaster: return new ValidationError();
|
|
23648
23653
|
case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.ChangeSetStatus.CannotMergeIntoReversed: return new ValidationError();
|
|
23649
|
-
case
|
|
23650
|
-
case
|
|
23651
|
-
case
|
|
23652
|
-
case
|
|
23653
|
-
case
|
|
23654
|
-
case
|
|
23655
|
-
case
|
|
23656
|
-
case
|
|
23657
|
-
case
|
|
23658
|
-
case
|
|
23659
|
-
case
|
|
23660
|
-
case
|
|
23661
|
-
case
|
|
23662
|
-
case
|
|
23663
|
-
case
|
|
23664
|
-
case
|
|
23654
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.Success: return new Success();
|
|
23655
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ServerUnavailable: return new NetworkError();
|
|
23656
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockAlreadyHeld: return new Conflict();
|
|
23657
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.SyncError: return new NetworkError();
|
|
23658
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidResponse: return new NetworkError();
|
|
23659
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.PendingTransactions: return new StateViolation();
|
|
23660
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockUsed: return new StateViolation();
|
|
23661
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CannotCreateChangeSet: return new InternalError();
|
|
23662
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidRequest: return new NetworkError();
|
|
23663
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChangeSetRequired: return new StateViolation();
|
|
23664
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUnavailable: return new Conflict();
|
|
23665
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeNotReserved: return new StateViolation();
|
|
23666
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUsed: return new StateViolation();
|
|
23667
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockNotHeld: return new Forbidden();
|
|
23668
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.RepositoryIsLocked: return new Locked();
|
|
23669
|
+
case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChannelConstraintViolation: return new ConstraintViolation();
|
|
23665
23670
|
case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.HttpStatus.Success: return new Success();
|
|
23666
23671
|
case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelHubStatus.Success: return new Success();
|
|
23667
23672
|
case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelHubStatus.Unknown: return new UnknownError();
|
|
@@ -23748,8 +23753,7 @@ function lookupHttpStatusCategory(statusCode) {
|
|
|
23748
23753
|
__webpack_require__.r(__webpack_exports__);
|
|
23749
23754
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23750
23755
|
/* harmony export */ "base64StringToUint8Array": () => (/* binding */ base64StringToUint8Array),
|
|
23751
|
-
/* harmony export */ "utf8ToString": () => (/* binding */ utf8ToString)
|
|
23752
|
-
/* harmony export */ "utf8ToStringPolyfill": () => (/* binding */ utf8ToStringPolyfill)
|
|
23756
|
+
/* harmony export */ "utf8ToString": () => (/* binding */ utf8ToString)
|
|
23753
23757
|
/* harmony export */ });
|
|
23754
23758
|
/*---------------------------------------------------------------------------------------------
|
|
23755
23759
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
@@ -23758,110 +23762,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23758
23762
|
/** @packageDocumentation
|
|
23759
23763
|
* @module Utils
|
|
23760
23764
|
*/
|
|
23761
|
-
// TextDecoder is not supported on all platforms - this is an alternative for utf-8.
|
|
23762
|
-
// From https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/getStringFromTypedArray.js
|
|
23763
|
-
// which is itself inspired by https://github.com/inexorabletash/text-encoding
|
|
23764
|
-
/** @internal */
|
|
23765
|
-
var Utf8ToString;
|
|
23766
|
-
(function (Utf8ToString) {
|
|
23767
|
-
function inRange(a, min, max) {
|
|
23768
|
-
return min <= a && a <= max;
|
|
23769
|
-
}
|
|
23770
|
-
function utf8Handler(bytes) {
|
|
23771
|
-
let codePoint = 0;
|
|
23772
|
-
let bytesSeen = 0;
|
|
23773
|
-
let bytesNeeded = 0;
|
|
23774
|
-
let lowerBoundary = 0x80;
|
|
23775
|
-
let upperBoundary = 0xbf;
|
|
23776
|
-
const codePoints = [];
|
|
23777
|
-
const length = bytes.length;
|
|
23778
|
-
for (let i = 0; i < length; i++) {
|
|
23779
|
-
const currentByte = bytes[i];
|
|
23780
|
-
// If bytesNeeded = 0, then we are starting a new character
|
|
23781
|
-
if (0 === bytesNeeded) {
|
|
23782
|
-
// 1 byte ascii character
|
|
23783
|
-
if (inRange(currentByte, 0x00, 0x7f)) {
|
|
23784
|
-
// return a code point whose value is byte.
|
|
23785
|
-
codePoints.push(currentByte);
|
|
23786
|
-
continue;
|
|
23787
|
-
}
|
|
23788
|
-
// 2 byte character
|
|
23789
|
-
if (inRange(currentByte, 0xc2, 0xdf)) {
|
|
23790
|
-
bytesNeeded = 1;
|
|
23791
|
-
codePoint = currentByte & 0x1f;
|
|
23792
|
-
continue;
|
|
23793
|
-
}
|
|
23794
|
-
// 3 byte character
|
|
23795
|
-
if (inRange(currentByte, 0xe0, 0xef)) {
|
|
23796
|
-
if (0xe0 === currentByte)
|
|
23797
|
-
lowerBoundary = 0xa0;
|
|
23798
|
-
else if (0xed === currentByte)
|
|
23799
|
-
upperBoundary = 0x9f;
|
|
23800
|
-
bytesNeeded = 2;
|
|
23801
|
-
codePoint = currentByte & 0xf;
|
|
23802
|
-
continue;
|
|
23803
|
-
}
|
|
23804
|
-
// 4 byte character
|
|
23805
|
-
if (inRange(currentByte, 0xf0, 0xf4)) {
|
|
23806
|
-
if (0xf0 === currentByte)
|
|
23807
|
-
lowerBoundary = 0x90;
|
|
23808
|
-
else if (0xf4 === currentByte)
|
|
23809
|
-
upperBoundary = 0x8f;
|
|
23810
|
-
bytesNeeded = 3;
|
|
23811
|
-
codePoint = currentByte & 0x7;
|
|
23812
|
-
continue;
|
|
23813
|
-
}
|
|
23814
|
-
// invalid utf-8
|
|
23815
|
-
return undefined;
|
|
23816
|
-
}
|
|
23817
|
-
// out of range so ignore the first part(s) of the character and continue with this byte on its own
|
|
23818
|
-
if (!inRange(currentByte, lowerBoundary, upperBoundary)) {
|
|
23819
|
-
codePoint = bytesNeeded = bytesSeen = 0;
|
|
23820
|
-
lowerBoundary = 0x80;
|
|
23821
|
-
upperBoundary = 0xbf;
|
|
23822
|
-
--i;
|
|
23823
|
-
continue;
|
|
23824
|
-
}
|
|
23825
|
-
// set appropriate boundaries since we've now checked byte 2 of a potential longer character
|
|
23826
|
-
lowerBoundary = 0x80;
|
|
23827
|
-
upperBoundary = 0xbf;
|
|
23828
|
-
// add byte to code point
|
|
23829
|
-
codePoint = (codePoint << 6) | (currentByte & 0x3f);
|
|
23830
|
-
// We have the correct number of bytes, so push and reset for next character
|
|
23831
|
-
++bytesSeen;
|
|
23832
|
-
if (bytesSeen === bytesNeeded) {
|
|
23833
|
-
codePoints.push(codePoint);
|
|
23834
|
-
codePoint = bytesNeeded = bytesSeen = 0;
|
|
23835
|
-
}
|
|
23836
|
-
}
|
|
23837
|
-
return codePoints;
|
|
23838
|
-
}
|
|
23839
|
-
function decodeWithFromCharCode(view) {
|
|
23840
|
-
let result = "";
|
|
23841
|
-
const codePoints = utf8Handler(view);
|
|
23842
|
-
if (undefined === codePoints)
|
|
23843
|
-
return undefined;
|
|
23844
|
-
for (let cp of codePoints) {
|
|
23845
|
-
if (cp <= 0xffff) {
|
|
23846
|
-
result += String.fromCharCode(cp);
|
|
23847
|
-
}
|
|
23848
|
-
else {
|
|
23849
|
-
cp -= 0x10000;
|
|
23850
|
-
result += String.fromCharCode((cp >> 10) + 0xd800, (cp & 0x3ff) + 0xdc00);
|
|
23851
|
-
}
|
|
23852
|
-
}
|
|
23853
|
-
return result;
|
|
23854
|
-
}
|
|
23855
|
-
Utf8ToString.decodeWithFromCharCode = decodeWithFromCharCode;
|
|
23856
|
-
})(Utf8ToString || (Utf8ToString = {}));
|
|
23857
|
-
/** Exposed only for testing the fall-back used when TextDecoder is unsupported.
|
|
23858
|
-
* @internal
|
|
23859
|
-
*/
|
|
23860
|
-
function utf8ToStringPolyfill(utf8) {
|
|
23861
|
-
return Utf8ToString.decodeWithFromCharCode(utf8);
|
|
23862
|
-
}
|
|
23863
|
-
// TextDecoder unsupported in Edge at time of writing.
|
|
23864
|
-
let textDecoderSupported = true;
|
|
23865
23765
|
/** Given an array of bytes containing a utf-8 string, convert to a string.
|
|
23866
23766
|
* @param utf8: An array of utf-8 characters as a byte array
|
|
23867
23767
|
* @returns An equivalent string, or undefined if the array does not contain a valid utf-8 string.
|
|
@@ -23870,19 +23770,8 @@ let textDecoderSupported = true;
|
|
|
23870
23770
|
* @public
|
|
23871
23771
|
*/
|
|
23872
23772
|
function utf8ToString(utf8) {
|
|
23873
|
-
|
|
23874
|
-
|
|
23875
|
-
try {
|
|
23876
|
-
decoder = new TextDecoder("utf-8");
|
|
23877
|
-
}
|
|
23878
|
-
catch (_ex) {
|
|
23879
|
-
textDecoderSupported = false;
|
|
23880
|
-
}
|
|
23881
|
-
}
|
|
23882
|
-
if (undefined !== decoder)
|
|
23883
|
-
return decoder.decode(utf8);
|
|
23884
|
-
else
|
|
23885
|
-
return utf8ToStringPolyfill(utf8);
|
|
23773
|
+
const decoder = new TextDecoder("utf-8");
|
|
23774
|
+
return decoder.decode(utf8);
|
|
23886
23775
|
}
|
|
23887
23776
|
/** Given a base-64-encoded string, decode it into an array of bytes.
|
|
23888
23777
|
* @param base64 The base-64-encoded string.
|
|
@@ -24180,7 +24069,6 @@ class Tracing {
|
|
|
24180
24069
|
/**
|
|
24181
24070
|
* Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation
|
|
24182
24071
|
* @param e error (exception) object
|
|
24183
|
-
* @internal
|
|
24184
24072
|
*/
|
|
24185
24073
|
static recordException(e) {
|
|
24186
24074
|
Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);
|
|
@@ -24745,7 +24633,6 @@ class YieldManager {
|
|
|
24745
24633
|
await this.actualYield();
|
|
24746
24634
|
}
|
|
24747
24635
|
}
|
|
24748
|
-
/** @internal */
|
|
24749
24636
|
async actualYield() {
|
|
24750
24637
|
await new Promise((r) => setTimeout(r, 0));
|
|
24751
24638
|
}
|
|
@@ -24776,12 +24663,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24776
24663
|
/* harmony export */ "ByteStream": () => (/* reexport safe */ _ByteStream__WEBPACK_IMPORTED_MODULE_7__.ByteStream),
|
|
24777
24664
|
/* harmony export */ "ChangeSetStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.ChangeSetStatus),
|
|
24778
24665
|
/* harmony export */ "CompressedId64Set": () => (/* reexport safe */ _CompressedId64Set__WEBPACK_IMPORTED_MODULE_10__.CompressedId64Set),
|
|
24779
|
-
/* harmony export */ "DbChangeStage": () => (/* reexport safe */
|
|
24780
|
-
/* harmony export */ "DbConflictCause": () => (/* reexport safe */
|
|
24781
|
-
/* harmony export */ "DbConflictResolution": () => (/* reexport safe */
|
|
24666
|
+
/* harmony export */ "DbChangeStage": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbChangeStage),
|
|
24667
|
+
/* harmony export */ "DbConflictCause": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbConflictCause),
|
|
24668
|
+
/* harmony export */ "DbConflictResolution": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbConflictResolution),
|
|
24782
24669
|
/* harmony export */ "DbOpcode": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbOpcode),
|
|
24783
24670
|
/* harmony export */ "DbResult": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbResult),
|
|
24784
|
-
/* harmony export */ "DbValueType": () => (/* reexport safe */
|
|
24671
|
+
/* harmony export */ "DbValueType": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbValueType),
|
|
24785
24672
|
/* harmony export */ "Dictionary": () => (/* reexport safe */ _Dictionary__WEBPACK_IMPORTED_MODULE_11__.Dictionary),
|
|
24786
24673
|
/* harmony export */ "DisposableList": () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.DisposableList),
|
|
24787
24674
|
/* harmony export */ "DuplicatePolicy": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.DuplicatePolicy),
|
|
@@ -24814,7 +24701,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24814
24701
|
/* harmony export */ "ReadonlyOrderedSet": () => (/* reexport safe */ _OrderedSet__WEBPACK_IMPORTED_MODULE_22__.ReadonlyOrderedSet),
|
|
24815
24702
|
/* harmony export */ "ReadonlySortedArray": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.ReadonlySortedArray),
|
|
24816
24703
|
/* harmony export */ "RealityDataStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.RealityDataStatus),
|
|
24817
|
-
/* harmony export */ "RepositoryStatus": () => (/* reexport safe */
|
|
24704
|
+
/* harmony export */ "RepositoryStatus": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.RepositoryStatus),
|
|
24818
24705
|
/* harmony export */ "RpcInterfaceStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.RpcInterfaceStatus),
|
|
24819
24706
|
/* harmony export */ "SortedArray": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.SortedArray),
|
|
24820
24707
|
/* harmony export */ "SpanKind": () => (/* reexport safe */ _Tracing__WEBPACK_IMPORTED_MODULE_29__.SpanKind),
|
|
@@ -24853,9 +24740,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24853
24740
|
/* harmony export */ "omit": () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_33__.omit),
|
|
24854
24741
|
/* harmony export */ "partitionArray": () => (/* reexport safe */ _partitionArray__WEBPACK_IMPORTED_MODULE_23__.partitionArray),
|
|
24855
24742
|
/* harmony export */ "shallowClone": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.shallowClone),
|
|
24743
|
+
/* harmony export */ "staticLoggerMetadata": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.staticLoggerMetadata),
|
|
24856
24744
|
/* harmony export */ "using": () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.using),
|
|
24857
|
-
/* harmony export */ "utf8ToString": () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_27__.utf8ToString)
|
|
24858
|
-
/* harmony export */ "utf8ToStringPolyfill": () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_27__.utf8ToStringPolyfill)
|
|
24745
|
+
/* harmony export */ "utf8ToString": () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_27__.utf8ToString)
|
|
24859
24746
|
/* harmony export */ });
|
|
24860
24747
|
/* harmony import */ var _AccessToken__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AccessToken */ "../bentley/lib/esm/AccessToken.js");
|
|
24861
24748
|
/* harmony import */ var _Assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Assert */ "../bentley/lib/esm/Assert.js");
|
|
@@ -24892,6 +24779,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24892
24779
|
/* harmony import */ var _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./UnexpectedErrors */ "../bentley/lib/esm/UnexpectedErrors.js");
|
|
24893
24780
|
/* harmony import */ var _UtilityTypes__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./UtilityTypes */ "../bentley/lib/esm/UtilityTypes.js");
|
|
24894
24781
|
/* harmony import */ var _YieldManager__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./YieldManager */ "../bentley/lib/esm/YieldManager.js");
|
|
24782
|
+
/* harmony import */ var _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./internal/cross-package */ "../bentley/lib/esm/internal/cross-package.js");
|
|
24895
24783
|
/*---------------------------------------------------------------------------------------------
|
|
24896
24784
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
24897
24785
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -24930,6 +24818,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24930
24818
|
|
|
24931
24819
|
|
|
24932
24820
|
|
|
24821
|
+
|
|
24822
|
+
// Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.
|
|
24933
24823
|
|
|
24934
24824
|
/** @docs-package-description
|
|
24935
24825
|
* The core-bentley package contains classes to solve problems that are common for both client and server use cases.
|
|
@@ -24972,6 +24862,184 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24972
24862
|
*/
|
|
24973
24863
|
|
|
24974
24864
|
|
|
24865
|
+
/***/ }),
|
|
24866
|
+
|
|
24867
|
+
/***/ "../bentley/lib/esm/internal/BeSQLiteInternal.js":
|
|
24868
|
+
/*!*******************************************************!*\
|
|
24869
|
+
!*** ../bentley/lib/esm/internal/BeSQLiteInternal.js ***!
|
|
24870
|
+
\*******************************************************/
|
|
24871
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
24872
|
+
|
|
24873
|
+
"use strict";
|
|
24874
|
+
__webpack_require__.r(__webpack_exports__);
|
|
24875
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
24876
|
+
/* harmony export */ "DbChangeStage": () => (/* binding */ DbChangeStage),
|
|
24877
|
+
/* harmony export */ "DbConflictCause": () => (/* binding */ DbConflictCause),
|
|
24878
|
+
/* harmony export */ "DbConflictResolution": () => (/* binding */ DbConflictResolution),
|
|
24879
|
+
/* harmony export */ "DbValueType": () => (/* binding */ DbValueType)
|
|
24880
|
+
/* harmony export */ });
|
|
24881
|
+
/*---------------------------------------------------------------------------------------------
|
|
24882
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
24883
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
24884
|
+
*--------------------------------------------------------------------------------------------*/
|
|
24885
|
+
/** @packageDocumentation
|
|
24886
|
+
* @module BeSQLite
|
|
24887
|
+
*/
|
|
24888
|
+
/** @internal */
|
|
24889
|
+
var DbChangeStage;
|
|
24890
|
+
(function (DbChangeStage) {
|
|
24891
|
+
DbChangeStage[DbChangeStage["Old"] = 0] = "Old";
|
|
24892
|
+
DbChangeStage[DbChangeStage["New"] = 1] = "New";
|
|
24893
|
+
})(DbChangeStage || (DbChangeStage = {}));
|
|
24894
|
+
/** @internal */
|
|
24895
|
+
var DbValueType;
|
|
24896
|
+
(function (DbValueType) {
|
|
24897
|
+
DbValueType[DbValueType["IntegerVal"] = 1] = "IntegerVal";
|
|
24898
|
+
DbValueType[DbValueType["FloatVal"] = 2] = "FloatVal";
|
|
24899
|
+
DbValueType[DbValueType["TextVal"] = 3] = "TextVal";
|
|
24900
|
+
DbValueType[DbValueType["BlobVal"] = 4] = "BlobVal";
|
|
24901
|
+
DbValueType[DbValueType["NullVal"] = 5] = "NullVal";
|
|
24902
|
+
})(DbValueType || (DbValueType = {}));
|
|
24903
|
+
/** Cause of conflict when applying a changeset.
|
|
24904
|
+
* @internal
|
|
24905
|
+
*/
|
|
24906
|
+
var DbConflictCause;
|
|
24907
|
+
(function (DbConflictCause) {
|
|
24908
|
+
DbConflictCause[DbConflictCause["Data"] = 1] = "Data";
|
|
24909
|
+
DbConflictCause[DbConflictCause["NotFound"] = 2] = "NotFound";
|
|
24910
|
+
DbConflictCause[DbConflictCause["Conflict"] = 3] = "Conflict";
|
|
24911
|
+
DbConflictCause[DbConflictCause["Constraint"] = 4] = "Constraint";
|
|
24912
|
+
DbConflictCause[DbConflictCause["ForeignKey"] = 5] = "ForeignKey";
|
|
24913
|
+
})(DbConflictCause || (DbConflictCause = {}));
|
|
24914
|
+
/** @internal */
|
|
24915
|
+
var DbConflictResolution;
|
|
24916
|
+
(function (DbConflictResolution) {
|
|
24917
|
+
/** Skip incoming change */
|
|
24918
|
+
DbConflictResolution[DbConflictResolution["Skip"] = 0] = "Skip";
|
|
24919
|
+
/** Replace local row with incoming changed row */
|
|
24920
|
+
DbConflictResolution[DbConflictResolution["Replace"] = 1] = "Replace";
|
|
24921
|
+
/** Abort apply changeset */
|
|
24922
|
+
DbConflictResolution[DbConflictResolution["Abort"] = 2] = "Abort";
|
|
24923
|
+
})(DbConflictResolution || (DbConflictResolution = {}));
|
|
24924
|
+
|
|
24925
|
+
|
|
24926
|
+
/***/ }),
|
|
24927
|
+
|
|
24928
|
+
/***/ "../bentley/lib/esm/internal/RepositoryStatus.js":
|
|
24929
|
+
/*!*******************************************************!*\
|
|
24930
|
+
!*** ../bentley/lib/esm/internal/RepositoryStatus.js ***!
|
|
24931
|
+
\*******************************************************/
|
|
24932
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
24933
|
+
|
|
24934
|
+
"use strict";
|
|
24935
|
+
__webpack_require__.r(__webpack_exports__);
|
|
24936
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
24937
|
+
/* harmony export */ "RepositoryStatus": () => (/* binding */ RepositoryStatus)
|
|
24938
|
+
/* harmony export */ });
|
|
24939
|
+
/*---------------------------------------------------------------------------------------------
|
|
24940
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
24941
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
24942
|
+
*--------------------------------------------------------------------------------------------*/
|
|
24943
|
+
/** @packageDocumentation
|
|
24944
|
+
* @module Errors
|
|
24945
|
+
*/
|
|
24946
|
+
/** Return codes for methods which perform repository management operations.
|
|
24947
|
+
* @internal
|
|
24948
|
+
*/
|
|
24949
|
+
var RepositoryStatus;
|
|
24950
|
+
(function (RepositoryStatus) {
|
|
24951
|
+
RepositoryStatus[RepositoryStatus["Success"] = 0] = "Success";
|
|
24952
|
+
/** The repository server did not respond to a request */
|
|
24953
|
+
RepositoryStatus[RepositoryStatus["ServerUnavailable"] = 86017] = "ServerUnavailable";
|
|
24954
|
+
/** A requested lock was already held by another briefcase */
|
|
24955
|
+
RepositoryStatus[RepositoryStatus["LockAlreadyHeld"] = 86018] = "LockAlreadyHeld";
|
|
24956
|
+
/** Failed to sync briefcase manager with server */
|
|
24957
|
+
RepositoryStatus[RepositoryStatus["SyncError"] = 86019] = "SyncError";
|
|
24958
|
+
/** Response from server not understood */
|
|
24959
|
+
RepositoryStatus[RepositoryStatus["InvalidResponse"] = 86020] = "InvalidResponse";
|
|
24960
|
+
/** An operation requires local changes to be committed or abandoned */
|
|
24961
|
+
RepositoryStatus[RepositoryStatus["PendingTransactions"] = 86021] = "PendingTransactions";
|
|
24962
|
+
/** A lock cannot be relinquished because the associated object has been modified */
|
|
24963
|
+
RepositoryStatus[RepositoryStatus["LockUsed"] = 86022] = "LockUsed";
|
|
24964
|
+
/** An operation required creation of a ChangeSet, which failed */
|
|
24965
|
+
RepositoryStatus[RepositoryStatus["CannotCreateChangeSet"] = 86023] = "CannotCreateChangeSet";
|
|
24966
|
+
/** Request to server not understood */
|
|
24967
|
+
RepositoryStatus[RepositoryStatus["InvalidRequest"] = 86024] = "InvalidRequest";
|
|
24968
|
+
/** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
|
|
24969
|
+
RepositoryStatus[RepositoryStatus["ChangeSetRequired"] = 86025] = "ChangeSetRequired";
|
|
24970
|
+
/** A requested DgnCode is reserved by another briefcase or in use */
|
|
24971
|
+
RepositoryStatus[RepositoryStatus["CodeUnavailable"] = 86026] = "CodeUnavailable";
|
|
24972
|
+
/** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
|
|
24973
|
+
RepositoryStatus[RepositoryStatus["CodeNotReserved"] = 86027] = "CodeNotReserved";
|
|
24974
|
+
/** A DgnCode cannot be relinquished because it has been used locally */
|
|
24975
|
+
RepositoryStatus[RepositoryStatus["CodeUsed"] = 86028] = "CodeUsed";
|
|
24976
|
+
/** A required lock is not held by this briefcase */
|
|
24977
|
+
RepositoryStatus[RepositoryStatus["LockNotHeld"] = 86029] = "LockNotHeld";
|
|
24978
|
+
/** Repository is currently locked, no changes allowed */
|
|
24979
|
+
RepositoryStatus[RepositoryStatus["RepositoryIsLocked"] = 86030] = "RepositoryIsLocked";
|
|
24980
|
+
/** Channel write constraint violation, such as an attempt to write outside the designated channel. */
|
|
24981
|
+
RepositoryStatus[RepositoryStatus["ChannelConstraintViolation"] = 86031] = "ChannelConstraintViolation";
|
|
24982
|
+
})(RepositoryStatus || (RepositoryStatus = {}));
|
|
24983
|
+
|
|
24984
|
+
|
|
24985
|
+
/***/ }),
|
|
24986
|
+
|
|
24987
|
+
/***/ "../bentley/lib/esm/internal/cross-package.js":
|
|
24988
|
+
/*!****************************************************!*\
|
|
24989
|
+
!*** ../bentley/lib/esm/internal/cross-package.js ***!
|
|
24990
|
+
\****************************************************/
|
|
24991
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
24992
|
+
|
|
24993
|
+
"use strict";
|
|
24994
|
+
__webpack_require__.r(__webpack_exports__);
|
|
24995
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
24996
|
+
/* harmony export */ "DbChangeStage": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbChangeStage),
|
|
24997
|
+
/* harmony export */ "DbConflictCause": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbConflictCause),
|
|
24998
|
+
/* harmony export */ "DbConflictResolution": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbConflictResolution),
|
|
24999
|
+
/* harmony export */ "DbValueType": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbValueType),
|
|
25000
|
+
/* harmony export */ "RepositoryStatus": () => (/* reexport safe */ _RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus),
|
|
25001
|
+
/* harmony export */ "staticLoggerMetadata": () => (/* reexport safe */ _staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_0__.staticLoggerMetadata)
|
|
25002
|
+
/* harmony export */ });
|
|
25003
|
+
/* harmony import */ var _staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./staticLoggerMetadata */ "../bentley/lib/esm/internal/staticLoggerMetadata.js");
|
|
25004
|
+
/* harmony import */ var _RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepositoryStatus */ "../bentley/lib/esm/internal/RepositoryStatus.js");
|
|
25005
|
+
/* harmony import */ var _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BeSQLiteInternal */ "../bentley/lib/esm/internal/BeSQLiteInternal.js");
|
|
25006
|
+
/*---------------------------------------------------------------------------------------------
|
|
25007
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25008
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
25009
|
+
*--------------------------------------------------------------------------------------------*/
|
|
25010
|
+
|
|
25011
|
+
|
|
25012
|
+
|
|
25013
|
+
|
|
25014
|
+
|
|
25015
|
+
/***/ }),
|
|
25016
|
+
|
|
25017
|
+
/***/ "../bentley/lib/esm/internal/staticLoggerMetadata.js":
|
|
25018
|
+
/*!***********************************************************!*\
|
|
25019
|
+
!*** ../bentley/lib/esm/internal/staticLoggerMetadata.js ***!
|
|
25020
|
+
\***********************************************************/
|
|
25021
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25022
|
+
|
|
25023
|
+
"use strict";
|
|
25024
|
+
__webpack_require__.r(__webpack_exports__);
|
|
25025
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
25026
|
+
/* harmony export */ "staticLoggerMetadata": () => (/* binding */ staticLoggerMetadata)
|
|
25027
|
+
/* harmony export */ });
|
|
25028
|
+
/*---------------------------------------------------------------------------------------------
|
|
25029
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25030
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
25031
|
+
*--------------------------------------------------------------------------------------------*/
|
|
25032
|
+
/** @packageDocumentation
|
|
25033
|
+
* @module Logging
|
|
25034
|
+
*/
|
|
25035
|
+
/** All static metadata is combined with per-call metadata and stringified in every log message.
|
|
25036
|
+
* Static metadata can either be an object or a function that returns an object.
|
|
25037
|
+
* Use a key to identify entries in the map so the can be removed individually.
|
|
25038
|
+
* @internal
|
|
25039
|
+
*/
|
|
25040
|
+
const staticLoggerMetadata = new Map();
|
|
25041
|
+
|
|
25042
|
+
|
|
24975
25043
|
/***/ }),
|
|
24976
25044
|
|
|
24977
25045
|
/***/ "../bentley/lib/esm/partitionArray.js":
|