@itwin/core-backend 3.3.0-dev.66 → 3.3.0-dev.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/GeoCoordConfig.d.ts +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +7 -7
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +53 -29
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +35 -51
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts +2 -2
- package/lib/cjs/IpcHost.d.ts.map +1 -1
- package/lib/cjs/IpcHost.js +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.d.ts +2 -2
- package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/assets/Settings/backend.setting.json5 +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +6 -6
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js +19 -12
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/package.json +13 -13
|
@@ -9,6 +9,6 @@ export declare class GeoCoordConfig {
|
|
|
9
9
|
private static _defaultDbsLoaded;
|
|
10
10
|
static onStartup(): void;
|
|
11
11
|
static loadDefaultDatabases(): void;
|
|
12
|
-
static loadForImodel(
|
|
12
|
+
static loadForImodel(settings: Settings): void;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=GeoCoordConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUhD,6EAA6E;AAC7E,qBAAa,cAAc;IAEzB,OAAO,CAAC,MAAM,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUhD,6EAA6E;AAC7E,qBAAa,cAAc;IAEzB,OAAO,CAAC,MAAM,CAAC,eAAe;IAmC9B,OAAO,CAAC,MAAM,CAAC,OAAO;IAYtB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;WAC3B,SAAS;WAIT,oBAAoB,IAAI,IAAI;WAO5B,aAAa,CAAC,QAAQ,EAAE,QAAQ;CAI/C"}
|
|
@@ -33,13 +33,14 @@ class GeoCoordConfig {
|
|
|
33
33
|
throw new Error(`database "${gcsDbName}" not found in container "${containerProps.containerId}"`);
|
|
34
34
|
if (!IModelHost_1.IModelHost.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))
|
|
35
35
|
return; // already had this db
|
|
36
|
-
IModelHost_1.IModelHost.
|
|
37
|
-
|
|
36
|
+
if (IModelHost_1.IModelHost.appWorkspace.settings.getBoolean("gcs/noLocalData", false))
|
|
37
|
+
IModelHost_1.IModelHost.platform.enableLocalGcsFiles(false);
|
|
38
|
+
core_bentley_1.Logger.logInfo(loggerCat, `loaded gcsDb "${gcsDbName}", from "${account.accessName}${containerProps.containerId}" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);
|
|
38
39
|
if (true === dbProps.prefetch)
|
|
39
40
|
new IModelHost_1.IModelHost.platform.CloudPrefetch(cloudContainer, gcsDbName);
|
|
40
41
|
}
|
|
41
42
|
catch (e) {
|
|
42
|
-
core_bentley_1.Logger.logError(loggerCat,
|
|
43
|
+
core_bentley_1.Logger.logError(loggerCat, `Cannot load GCS workspace: ${core_bentley_1.BentleyError.getErrorMessage(e)}, account=${account.accessName}`);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
static loadAll(settings, settingName) {
|
|
@@ -62,10 +63,9 @@ class GeoCoordConfig {
|
|
|
62
63
|
this.loadAll(IModelHost_1.IModelHost.appWorkspace.settings, "gcs/default/databases");
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
static loadForImodel(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// this.loadAll(settings, "gcs/databases");
|
|
66
|
+
static loadForImodel(settings) {
|
|
67
|
+
this.loadDefaultDatabases();
|
|
68
|
+
this.loadAll(settings, "gcs/databases");
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
exports.GeoCoordConfig = GeoCoordConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoCoordConfig.js","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0BAA0B;AAE1B,sDAA2D;AAC3D,6CAA0C;AAI1C,MAAM,SAAS,GAAG,UAAU,CAAC;AAO7B,6EAA6E;AAC7E,MAAa,cAAc;IAEjB,MAAM,CAAC,eAAe,CAAC,UAAkB;QAC/C,MAAM,EAAE,GAAG,uBAAU,CAAC,YAAY,CAAC;QACnC,MAAM,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,CAAe,CAAC;QAC7D,MAAM,cAAc,GAAG,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAC9D,cAAc,CAAC,aAAa,GAAG,IAAI,CAAC;QACpC,IAAI;YACF,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAC3D,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,CAAC;YAChD,IAAI,CAAC,CAAA,cA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C,eAAe,CAAC,CAAC,CAAC,aAAa,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;SAC5H;IACH,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,QAAkB,EAAE,WAAmB;QAC5D,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE;YAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACtB,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE;oBACvB,IAAI,OAAO,KAAK,KAAK,QAAQ;wBAC3B,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;iBAC/B;aACF;YACD,OAAO,SAAS,CAAC,CAAC,sCAAsC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAGM,MAAM,CAAC,SAAS;QACrB,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,uBAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;SACzE;IACH,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAkB;QAC5C,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAC1C,CAAC;;AAhEH,wCAiEC;AAhBgB,gCAAiB,GAAG,KAAK,CAAC","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 iModels\r\n */\r\n\r\n// cspell:ignore customuri\r\n\r\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { Settings } from \"./workspace/Settings\";\r\nimport { WorkspaceContainer, WorkspaceDb } from \"./workspace/Workspace\";\r\n\r\nconst loggerCat = \"GeoCoord\";\r\n\r\ninterface GcsDbProps extends WorkspaceDb.Props, WorkspaceContainer.Alias {\r\n prefetch?: boolean;\r\n priority?: number;\r\n}\r\n\r\n/** Internal class to configure and load the gcs workspaces for an iModel. */\r\nexport class GeoCoordConfig {\r\n\r\n private static addGcsWorkspace(gcsDbAlias: string) {\r\n const ws = IModelHost.appWorkspace;\r\n const dbProps = ws.resolveDatabase(gcsDbAlias) as GcsDbProps;\r\n const containerProps = ws.resolveContainer(dbProps.containerName);\r\n const account = ws.resolveAccount(containerProps.accountName);\r\n containerProps.syncOnConnect = true;\r\n try {\r\n const container = ws.getContainer(containerProps, account);\r\n const cloudContainer = container.cloudContainer;\r\n if (!cloudContainer?.isConnected) {\r\n Logger.logInfo(\"GeoCoord\", `could not load gcs database \"${gcsDbAlias}\"`);\r\n return;\r\n }\r\n\r\n const gcsDbName = container.resolveDbFileName(dbProps);\r\n const gcsDbProps = cloudContainer.queryDatabase(gcsDbName);\r\n if (undefined === gcsDbProps)\r\n throw new Error(`database \"${gcsDbName}\" not found in container \"${containerProps.containerId}\"`);\r\n\r\n if (!IModelHost.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))\r\n return; // already had this db\r\n\r\n if (IModelHost.appWorkspace.settings.getBoolean(\"gcs/noLocalData\", false))\r\n IModelHost.platform.enableLocalGcsFiles(false);\r\n\r\n Logger.logInfo(loggerCat, `loaded gcsDb \"${gcsDbName}\", from \"${account.accessName}${containerProps.containerId}\" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);\r\n\r\n if (true === dbProps.prefetch)\r\n new IModelHost.platform.CloudPrefetch(cloudContainer, gcsDbName);\r\n\r\n } catch (e: unknown) {\r\n Logger.logError(loggerCat, `Cannot load GCS workspace: ${BentleyError.getErrorMessage(e)}, account=${account.accessName}`);\r\n }\r\n }\r\n\r\n private static loadAll(settings: Settings, settingName: string) {\r\n settings.resolveSetting(settingName, (val) => {\r\n if (Array.isArray(val)) {\r\n for (const entry of val) {\r\n if (typeof entry === \"string\")\r\n this.addGcsWorkspace(entry);\r\n }\r\n }\r\n return undefined; // keep going through all dictionaries\r\n });\r\n }\r\n\r\n private static _defaultDbsLoaded = false;\r\n public static onStartup() {\r\n this._defaultDbsLoaded = false;\r\n }\r\n\r\n public static loadDefaultDatabases(): void {\r\n if (!this._defaultDbsLoaded) {\r\n this._defaultDbsLoaded = true;\r\n this.loadAll(IModelHost.appWorkspace.settings, \"gcs/default/databases\");\r\n }\r\n }\r\n\r\n public static loadForImodel(settings: Settings) {\r\n this.loadDefaultDatabases();\r\n this.loadAll(settings, \"gcs/databases\");\r\n }\r\n}\r\n"]}
|
package/lib/cjs/IModelHost.d.ts
CHANGED
|
@@ -39,10 +39,11 @@ export interface CrashReportingConfig {
|
|
|
39
39
|
/** Upload crash dump and node-reports to Bentley's crash-reporting service? Defaults to false */
|
|
40
40
|
uploadToBentley?: boolean;
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Options for [[IModelHost.startup]]
|
|
43
44
|
* @public
|
|
44
45
|
*/
|
|
45
|
-
export
|
|
46
|
+
export interface IModelHostOptions {
|
|
46
47
|
/**
|
|
47
48
|
* Root of the directory holding all the files that iTwin.js caches
|
|
48
49
|
* - If not specified at startup a platform specific default is used -
|
|
@@ -58,13 +59,15 @@ export declare class IModelHostConfiguration {
|
|
|
58
59
|
* @see [[IModelHost.cacheDir]] for the value it's set to after startup
|
|
59
60
|
*/
|
|
60
61
|
cacheDir?: LocalDirName;
|
|
61
|
-
/**
|
|
62
|
+
/** The directory where application assets are found. */
|
|
63
|
+
appAssetsDir?: LocalDirName;
|
|
64
|
+
/**
|
|
65
|
+
* Options for creating the [[Workspace]]
|
|
62
66
|
* @beta
|
|
63
67
|
*/
|
|
64
68
|
workspace?: WorkspaceOpts;
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
/** The kind of iModel hub server to use.
|
|
69
|
+
/**
|
|
70
|
+
* The kind of iModel hub server to use.
|
|
68
71
|
* @beta
|
|
69
72
|
*/
|
|
70
73
|
hubAccess?: BackendHubAccess;
|
|
@@ -89,31 +92,19 @@ export declare class IModelHostConfiguration {
|
|
|
89
92
|
/** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileTreeProps]($common) should wait before returning a "pending" status.
|
|
90
93
|
* @internal
|
|
91
94
|
*/
|
|
92
|
-
tileTreeRequestTimeout
|
|
95
|
+
tileTreeRequestTimeout?: number;
|
|
93
96
|
/** The time, in milliseconds, for which [IModelTileRpcInterface.requestTileContent]($common) should wait before returning a "pending" status.
|
|
94
97
|
* @internal
|
|
95
98
|
*/
|
|
96
|
-
tileContentRequestTimeout
|
|
97
|
-
/** The default time, in milliseconds, used for [[tileTreeRequestTimeout]] and [[tileContentRequestTimeout]]. To change this, override one or both of those properties.
|
|
98
|
-
* @internal
|
|
99
|
-
*/
|
|
100
|
-
static defaultTileRequestTimeout: number;
|
|
101
|
-
/** The default time, in seconds, used for [[logTileLoadTimeThreshold]]. To change this, override that property.
|
|
102
|
-
* @internal
|
|
103
|
-
*/
|
|
104
|
-
static defaultLogTileLoadTimeThreshold: number;
|
|
99
|
+
tileContentRequestTimeout?: number;
|
|
105
100
|
/** The backend will log when a tile took longer to load than this threshold in seconds.
|
|
106
101
|
* @internal
|
|
107
102
|
*/
|
|
108
|
-
logTileLoadTimeThreshold
|
|
109
|
-
/** The default size, in bytes, used for [[logTileSizeThreshold]]. To change this, override that property.
|
|
110
|
-
* @internal
|
|
111
|
-
*/
|
|
112
|
-
static defaultLogTileSizeThreshold: number;
|
|
103
|
+
logTileLoadTimeThreshold?: number;
|
|
113
104
|
/** The backend will log when a tile is loaded with a size in bytes above this threshold.
|
|
114
105
|
* @internal
|
|
115
106
|
*/
|
|
116
|
-
logTileSizeThreshold
|
|
107
|
+
logTileSizeThreshold?: number;
|
|
117
108
|
/** Crash-reporting configuration
|
|
118
109
|
* @alpha
|
|
119
110
|
*/
|
|
@@ -123,6 +114,39 @@ export declare class IModelHostConfiguration {
|
|
|
123
114
|
*/
|
|
124
115
|
authorizationClient?: AuthorizationClient;
|
|
125
116
|
}
|
|
117
|
+
/** Configuration of core-backend.
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
export declare class IModelHostConfiguration implements IModelHostOptions {
|
|
121
|
+
static defaultTileRequestTimeout: number;
|
|
122
|
+
static defaultLogTileLoadTimeThreshold: number;
|
|
123
|
+
static defaultLogTileSizeThreshold: number;
|
|
124
|
+
appAssetsDir?: LocalDirName;
|
|
125
|
+
cacheDir?: LocalDirName;
|
|
126
|
+
/** @beta */
|
|
127
|
+
workspace?: WorkspaceOpts;
|
|
128
|
+
/** @beta */
|
|
129
|
+
hubAccess?: BackendHubAccess;
|
|
130
|
+
/** @beta */
|
|
131
|
+
authorizationClient?: AuthorizationClient;
|
|
132
|
+
/** @beta */
|
|
133
|
+
tileCacheService?: CloudStorageService;
|
|
134
|
+
/** @beta */
|
|
135
|
+
restrictTileUrlsByClientIp?: boolean;
|
|
136
|
+
compressCachedTiles?: boolean;
|
|
137
|
+
/** @beta */
|
|
138
|
+
tileCacheAzureCredentials?: AzureBlobStorageCredentials;
|
|
139
|
+
/** @internal */
|
|
140
|
+
tileTreeRequestTimeout: number;
|
|
141
|
+
/** @internal */
|
|
142
|
+
tileContentRequestTimeout: number;
|
|
143
|
+
/** @internal */
|
|
144
|
+
logTileLoadTimeThreshold: number;
|
|
145
|
+
/** @internal */
|
|
146
|
+
logTileSizeThreshold: number;
|
|
147
|
+
/** @alpha */
|
|
148
|
+
crashReportingConfig?: CrashReportingConfig;
|
|
149
|
+
}
|
|
126
150
|
/** IModelHost initializes ($backend) and captures its configuration. A backend must call [[IModelHost.startup]] before using any backend classes.
|
|
127
151
|
* See [the learning article]($docs/learning/backend/IModelHost.md)
|
|
128
152
|
* @public
|
|
@@ -138,7 +162,7 @@ export declare class IModelHost {
|
|
|
138
162
|
private static _platform?;
|
|
139
163
|
/** @internal */
|
|
140
164
|
static get platform(): typeof IModelJsNative;
|
|
141
|
-
static configuration?:
|
|
165
|
+
static configuration?: IModelHostOptions;
|
|
142
166
|
/** Event raised during startup to allow loading settings data */
|
|
143
167
|
static readonly onWorkspaceStartup: BeEvent<() => void>;
|
|
144
168
|
/** Event raised just after the backend IModelHost was started */
|
|
@@ -183,7 +207,7 @@ export declare class IModelHost {
|
|
|
183
207
|
private static validateNativePlatformVersion;
|
|
184
208
|
/**
|
|
185
209
|
* @internal
|
|
186
|
-
* @note Use [[
|
|
210
|
+
* @note Use [[IModelHostOptions.tileCacheService]] to set the service provider.
|
|
187
211
|
*/
|
|
188
212
|
static tileCacheService?: CloudStorageService;
|
|
189
213
|
/** @internal */
|
|
@@ -197,7 +221,7 @@ export declare class IModelHost {
|
|
|
197
221
|
static getHubAccess(): BackendHubAccess | undefined;
|
|
198
222
|
/** Provides access to the IModelHub for this IModelHost
|
|
199
223
|
* @beta
|
|
200
|
-
* @note If [[
|
|
224
|
+
* @note If [[IModelHostOptions.hubAccess]] was undefined when initializing this class, accessing this property will throw an error.
|
|
201
225
|
* To determine whether one is present, use [[getHubAccess]].
|
|
202
226
|
*/
|
|
203
227
|
static get hubAccess(): BackendHubAccess;
|
|
@@ -206,11 +230,11 @@ export declare class IModelHost {
|
|
|
206
230
|
/** Returns true if IModelHost is started. */
|
|
207
231
|
static get isValid(): boolean;
|
|
208
232
|
/** This method must be called before any iTwin.js services are used.
|
|
209
|
-
* @param
|
|
233
|
+
* @param options Host configuration data.
|
|
210
234
|
* Raises [[onAfterStartup]].
|
|
211
235
|
* @see [[shutdown]].
|
|
212
236
|
*/
|
|
213
|
-
static startup(
|
|
237
|
+
static startup(options?: IModelHostOptions): Promise<void>;
|
|
214
238
|
private static _briefcaseCacheDir;
|
|
215
239
|
private static logStartup;
|
|
216
240
|
private static setupHostDirs;
|
|
@@ -236,11 +260,11 @@ export declare class IModelHost {
|
|
|
236
260
|
static getCrashReportProperties(): CrashReportingConfigNameValuePair[];
|
|
237
261
|
/** The directory where application assets may be found */
|
|
238
262
|
static get appAssetsDir(): string | undefined;
|
|
239
|
-
/** The time, in milliseconds, for which
|
|
263
|
+
/** The time, in milliseconds, for which IModelTileRpcInterface.requestTileTreeProps should wait before returning a "pending" status.
|
|
240
264
|
* @internal
|
|
241
265
|
*/
|
|
242
266
|
static get tileTreeRequestTimeout(): number;
|
|
243
|
-
/** The time, in milliseconds, for which
|
|
267
|
+
/** The time, in milliseconds, for which IModelTileRpcInterface.requestTileContent should wait before returning a "pending" status.
|
|
244
268
|
* @internal
|
|
245
269
|
*/
|
|
246
270
|
static get tileContentRequestTimeout(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelHost.d.ts","sourceRoot":"","sources":["../../src/IModelHost.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAU,OAAO,EAAQ,UAAU,EAAkC,OAAO,EAAmB,MAAM,qBAAqB,CAAC;AAC/I,OAAO,EAAE,mBAAmB,EAA8B,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAAoB,2BAA2B,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAarI,OAAO,EAAkB,SAAS,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMjF,aAAa;AACb,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;I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AQ,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAEzF;IAED,gBAAgB;WACF,IAAI,IAAI,OAAO,cAAc;CAG5C;AAED;;GAEG;AACH,qBAAa,cAAc;IAEzB,iEAAiE;IACjE,WAAkB,eAAe,IAAI,MAAM,CAAqD;IAEhG,8DAA8D;IAC9D,WAAkB,gBAAgB,IAAI,MAAM,CAE3C;IAED,+BAA+B;IAC/B,WAAkB,MAAM,IAAI,MAAM,CAEjC;CACF;AAED;;;;GAIG;AACH,8BAAsB,gBAAgB;IACpC;;;OAGG;IACI,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAC1D;;;;OAIG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAO1C;;;OAGG;IACI,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IACjE;;;;OAIG;IACI,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAOnD"}
|
package/lib/cjs/IModelHost.js
CHANGED
|
@@ -38,36 +38,19 @@ const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.IModelHost;
|
|
|
38
38
|
*/
|
|
39
39
|
class IModelHostConfiguration {
|
|
40
40
|
constructor() {
|
|
41
|
-
/**
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
41
|
+
/** @internal */
|
|
44
42
|
this.tileTreeRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;
|
|
45
|
-
/**
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
43
|
+
/** @internal */
|
|
48
44
|
this.tileContentRequestTimeout = IModelHostConfiguration.defaultTileRequestTimeout;
|
|
49
|
-
/**
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
45
|
+
/** @internal */
|
|
52
46
|
this.logTileLoadTimeThreshold = IModelHostConfiguration.defaultLogTileLoadTimeThreshold;
|
|
53
|
-
/**
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
47
|
+
/** @internal */
|
|
56
48
|
this.logTileSizeThreshold = IModelHostConfiguration.defaultLogTileSizeThreshold;
|
|
57
49
|
}
|
|
58
50
|
}
|
|
59
51
|
exports.IModelHostConfiguration = IModelHostConfiguration;
|
|
60
|
-
/** The default time, in milliseconds, used for [[tileTreeRequestTimeout]] and [[tileContentRequestTimeout]]. To change this, override one or both of those properties.
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
52
|
IModelHostConfiguration.defaultTileRequestTimeout = 20 * 1000;
|
|
64
|
-
/** The default time, in seconds, used for [[logTileLoadTimeThreshold]]. To change this, override that property.
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
53
|
IModelHostConfiguration.defaultLogTileLoadTimeThreshold = 40;
|
|
68
|
-
/** The default size, in bytes, used for [[logTileSizeThreshold]]. To change this, override that property.
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
54
|
IModelHostConfiguration.defaultLogTileSizeThreshold = 20 * 1000000;
|
|
72
55
|
/**
|
|
73
56
|
* Settings for `IModelHost.appWorkspace`.
|
|
@@ -181,12 +164,12 @@ class IModelHost {
|
|
|
181
164
|
static getHubAccess() { return this._hubAccess; }
|
|
182
165
|
/** Provides access to the IModelHub for this IModelHost
|
|
183
166
|
* @beta
|
|
184
|
-
* @note If [[
|
|
167
|
+
* @note If [[IModelHostOptions.hubAccess]] was undefined when initializing this class, accessing this property will throw an error.
|
|
185
168
|
* To determine whether one is present, use [[getHubAccess]].
|
|
186
169
|
*/
|
|
187
170
|
static get hubAccess() {
|
|
188
171
|
if (this._hubAccess === undefined)
|
|
189
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "No BackendHubAccess supplied in
|
|
172
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "No BackendHubAccess supplied in IModelHostOptions");
|
|
190
173
|
return this._hubAccess;
|
|
191
174
|
}
|
|
192
175
|
static initializeWorkspace(configuration) {
|
|
@@ -201,17 +184,19 @@ class IModelHost {
|
|
|
201
184
|
/** Returns true if IModelHost is started. */
|
|
202
185
|
static get isValid() { return this._isValid; }
|
|
203
186
|
/** This method must be called before any iTwin.js services are used.
|
|
204
|
-
* @param
|
|
187
|
+
* @param options Host configuration data.
|
|
205
188
|
* Raises [[onAfterStartup]].
|
|
206
189
|
* @see [[shutdown]].
|
|
207
190
|
*/
|
|
208
|
-
static async startup(
|
|
191
|
+
static async startup(options) {
|
|
192
|
+
var _a, _b, _c, _d;
|
|
209
193
|
if (this._isValid)
|
|
210
194
|
return; // we're already initialized
|
|
211
195
|
this._isValid = true;
|
|
196
|
+
options = options !== null && options !== void 0 ? options : {};
|
|
212
197
|
if (IModelHost.sessionId === "")
|
|
213
198
|
IModelHost.sessionId = core_bentley_1.Guid.createValue();
|
|
214
|
-
this.authorizationClient =
|
|
199
|
+
this.authorizationClient = options.authorizationClient;
|
|
215
200
|
this.logStartup();
|
|
216
201
|
this.backendVersion = require("../../package.json").version; // eslint-disable-line @typescript-eslint/no-var-requires
|
|
217
202
|
(0, RpcBackend_1.initializeRpcBackend)();
|
|
@@ -220,27 +205,24 @@ class IModelHost {
|
|
|
220
205
|
this.loadNative();
|
|
221
206
|
}
|
|
222
207
|
catch (error) {
|
|
223
|
-
core_bentley_1.Logger.logError(loggerCategory, "Error registering/loading the native platform API", () => (
|
|
208
|
+
core_bentley_1.Logger.logError(loggerCategory, "Error registering/loading the native platform API", () => (options));
|
|
224
209
|
throw error;
|
|
225
210
|
}
|
|
226
211
|
}
|
|
227
|
-
if (
|
|
228
|
-
this.platform.setCrashReporting(
|
|
229
|
-
core_bentley_1.Logger.logTrace(loggerCategory, "Configured crash reporting",
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
enableNodeReport: (_c = configuration.crashReportingConfig) === null || _c === void 0 ? void 0 : _c.enableNodeReport,
|
|
235
|
-
uploadToBentley: (_d = configuration.crashReportingConfig) === null || _d === void 0 ? void 0 : _d.uploadToBentley,
|
|
236
|
-
});
|
|
212
|
+
if (options.crashReportingConfig && options.crashReportingConfig.crashDir && !core_bentley_1.ProcessDetector.isElectronAppBackend && !core_bentley_1.ProcessDetector.isMobileAppBackend) {
|
|
213
|
+
this.platform.setCrashReporting(options.crashReportingConfig);
|
|
214
|
+
core_bentley_1.Logger.logTrace(loggerCategory, "Configured crash reporting", {
|
|
215
|
+
enableCrashDumps: (_a = options.crashReportingConfig) === null || _a === void 0 ? void 0 : _a.enableCrashDumps,
|
|
216
|
+
wantFullMemoryDumps: (_b = options.crashReportingConfig) === null || _b === void 0 ? void 0 : _b.wantFullMemoryDumps,
|
|
217
|
+
enableNodeReport: (_c = options.crashReportingConfig) === null || _c === void 0 ? void 0 : _c.enableNodeReport,
|
|
218
|
+
uploadToBentley: (_d = options.crashReportingConfig) === null || _d === void 0 ? void 0 : _d.uploadToBentley,
|
|
237
219
|
});
|
|
238
|
-
if (
|
|
220
|
+
if (options.crashReportingConfig.enableNodeReport) {
|
|
239
221
|
try {
|
|
240
222
|
// node-report reports on V8 fatal errors and unhandled exceptions/Promise rejections.
|
|
241
223
|
const nodereport = require("node-report/api"); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
242
224
|
nodereport.setEvents("exception+fatalerror+apicall");
|
|
243
|
-
nodereport.setDirectory(
|
|
225
|
+
nodereport.setDirectory(options.crashReportingConfig.crashDir);
|
|
244
226
|
nodereport.setVerbose("yes");
|
|
245
227
|
core_bentley_1.Logger.logTrace(loggerCategory, "Configured native crash reporting (node-report)");
|
|
246
228
|
}
|
|
@@ -249,8 +231,8 @@ class IModelHost {
|
|
|
249
231
|
}
|
|
250
232
|
}
|
|
251
233
|
}
|
|
252
|
-
this.setupHostDirs(
|
|
253
|
-
this.initializeWorkspace(
|
|
234
|
+
this.setupHostDirs(options);
|
|
235
|
+
this.initializeWorkspace(options);
|
|
254
236
|
BriefcaseManager_1.BriefcaseManager.initialize(this._briefcaseCacheDir);
|
|
255
237
|
[
|
|
256
238
|
IModelReadRpcImpl_1.IModelReadRpcImpl,
|
|
@@ -264,9 +246,9 @@ class IModelHost {
|
|
|
264
246
|
GenericSchema_1.GenericSchema,
|
|
265
247
|
FunctionalSchema_1.FunctionalSchema,
|
|
266
248
|
].forEach((schema) => schema.registerSchema()); // register all of the schemas
|
|
267
|
-
if (undefined !==
|
|
268
|
-
this._hubAccess =
|
|
269
|
-
this.configuration =
|
|
249
|
+
if (undefined !== options.hubAccess)
|
|
250
|
+
this._hubAccess = options.hubAccess;
|
|
251
|
+
this.configuration = options;
|
|
270
252
|
this.setupTileCache();
|
|
271
253
|
this.platform.setUseTileCache(IModelHost.tileCacheService ? false : true);
|
|
272
254
|
process.once("beforeExit", IModelHost.shutdown);
|
|
@@ -312,7 +294,7 @@ class IModelHost {
|
|
|
312
294
|
IModelHost.configuration = undefined;
|
|
313
295
|
IModelHost.tileCacheService = undefined;
|
|
314
296
|
IModelHost.tileUploader = undefined;
|
|
315
|
-
|
|
297
|
+
IModelHost.appWorkspace.close();
|
|
316
298
|
IModelHost._appWorkspace = undefined;
|
|
317
299
|
process.removeListener("beforeExit", IModelHost.shutdown);
|
|
318
300
|
}
|
|
@@ -345,22 +327,24 @@ class IModelHost {
|
|
|
345
327
|
}
|
|
346
328
|
/** The directory where application assets may be found */
|
|
347
329
|
static get appAssetsDir() { return undefined !== IModelHost.configuration ? IModelHost.configuration.appAssetsDir : undefined; }
|
|
348
|
-
/** The time, in milliseconds, for which
|
|
330
|
+
/** The time, in milliseconds, for which IModelTileRpcInterface.requestTileTreeProps should wait before returning a "pending" status.
|
|
349
331
|
* @internal
|
|
350
332
|
*/
|
|
351
333
|
static get tileTreeRequestTimeout() {
|
|
352
|
-
|
|
334
|
+
var _a, _b;
|
|
335
|
+
return (_b = (_a = IModelHost.configuration) === null || _a === void 0 ? void 0 : _a.tileTreeRequestTimeout) !== null && _b !== void 0 ? _b : IModelHostConfiguration.defaultTileRequestTimeout;
|
|
353
336
|
}
|
|
354
|
-
/** The time, in milliseconds, for which
|
|
337
|
+
/** The time, in milliseconds, for which IModelTileRpcInterface.requestTileContent should wait before returning a "pending" status.
|
|
355
338
|
* @internal
|
|
356
339
|
*/
|
|
357
340
|
static get tileContentRequestTimeout() {
|
|
358
|
-
|
|
341
|
+
var _a, _b;
|
|
342
|
+
return (_b = (_a = IModelHost.configuration) === null || _a === void 0 ? void 0 : _a.tileContentRequestTimeout) !== null && _b !== void 0 ? _b : IModelHostConfiguration.defaultTileRequestTimeout;
|
|
359
343
|
}
|
|
360
344
|
/** The backend will log when a tile took longer to load than this threshold in seconds. */
|
|
361
|
-
static get logTileLoadTimeThreshold() { return
|
|
345
|
+
static get logTileLoadTimeThreshold() { var _a, _b; return (_b = (_a = IModelHost.configuration) === null || _a === void 0 ? void 0 : _a.logTileLoadTimeThreshold) !== null && _b !== void 0 ? _b : IModelHostConfiguration.defaultLogTileLoadTimeThreshold; }
|
|
362
346
|
/** The backend will log when a tile is loaded with a size in bytes above this threshold. */
|
|
363
|
-
static get logTileSizeThreshold() { return
|
|
347
|
+
static get logTileSizeThreshold() { var _a, _b; return (_b = (_a = IModelHost.configuration) === null || _a === void 0 ? void 0 : _a.logTileSizeThreshold) !== null && _b !== void 0 ? _b : IModelHostConfiguration.defaultLogTileSizeThreshold; }
|
|
364
348
|
/** Whether external tile caching is active.
|
|
365
349
|
* @internal
|
|
366
350
|
*/
|