@itwin/core-backend 5.12.0-dev.2 → 5.12.0-dev.5
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 +15 -1
- package/lib/cjs/BackendHubAccess.d.ts +1 -1
- package/lib/cjs/BackendHubAccess.js +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +1 -1
- package/lib/cjs/ClassRegistry.js +1 -1
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +4 -4
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +4 -4
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +6 -6
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +4 -4
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +1 -1
- package/lib/cjs/Element.js +1 -1
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +1 -1
- package/lib/cjs/ElementAspect.js +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/Entity.d.ts +1 -1
- package/lib/cjs/Entity.js +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +14 -14
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +14 -14
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +2 -2
- package/lib/cjs/IModelHost.js +2 -2
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +1 -1
- package/lib/cjs/SQLiteDb.js +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +1 -1
- package/lib/cjs/SqliteStatement.d.ts.map +1 -1
- package/lib/cjs/SqliteStatement.js +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +8 -7
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +28 -2
- package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/BackendHubAccess.d.ts +1 -1
- package/lib/esm/BackendHubAccess.js +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/ClassRegistry.d.ts +1 -1
- package/lib/esm/ClassRegistry.js +1 -1
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/ECDb.d.ts +4 -4
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +4 -4
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts +6 -6
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js +4 -4
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +1 -1
- package/lib/esm/Element.js +1 -1
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +1 -1
- package/lib/esm/ElementAspect.js +1 -1
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/Entity.d.ts +1 -1
- package/lib/esm/Entity.js +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +14 -14
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +14 -14
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/esm/IModelElementCloneContext.js +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +2 -2
- package/lib/esm/IModelHost.js +2 -2
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/SQLiteDb.d.ts +1 -1
- package/lib/esm/SQLiteDb.js +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/SqliteStatement.d.ts +1 -1
- package/lib/esm/SqliteStatement.d.ts.map +1 -1
- package/lib/esm/SqliteStatement.js +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.d.ts.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js +8 -7
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/TestUtils.d.ts +1 -1
- package/lib/esm/test/TestUtils.d.ts.map +1 -1
- package/lib/esm/test/TestUtils.js +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js +6 -0
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.d.ts +28 -2
- package/lib/esm/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestUtils.js","sourceRoot":"","sources":["../../../src/test/TestUtils.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAkB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAqB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,mCAAmC;AACnC,MAAM,OAAO,KAAK;IACR,MAAM,CAAS;IACf,MAAM,CAAO;IACrB,YAAY,KAAa;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,CAAC;IAEM,GAAG;QACR,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACvD,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,CAAC;IA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,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzF,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvF,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1F,CAAC;IAED,sDAAsD;IACtD,2DAA2D;IACpD,MAAM,CAAC,mBAAmB;QAC/B,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAEM,MAAM,CAAC,mBAAmB;QAC/B,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AAED,kFAAkF;AAClF,MAAM,CAAC,KAAK,IAAI,EAAE;IAChB,SAAS,CAAC,YAAY,EAAE,CAAC;IACzB,MAAM,SAAS,CAAC,YAAY,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH,KAAK,CAAC,KAAK,IAAI,EAAE;IACf,MAAM,SAAS,CAAC,eAAe,EAAE,CAAC;AACpC,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport * as path from \"path\";\nimport { IModelJsNative, NativeLoggerCategory } from \"@bentley/imodeljs-native\";\nimport { BentleyLoggerCategory, Logger, LogLevel, ProcessDetector } from \"@itwin/core-bentley\";\nimport { BackendLoggerCategory } from \"../BackendLoggerCategory\";\nimport { IModelHost, IModelHostOptions } from \"../IModelHost\";\nimport { IModelNative } from \"../internal/NativePlatform\";\nimport { GeoCoordConfig } from \"../GeoCoordConfig\";\nimport { SettingsPriority } from \"../workspace/Settings\";\n\n/** Class for simple test timing */\nexport class Timer {\n private _label: string;\n private _start: Date;\n constructor(label: string) {\n this._label = `\\t${label}`;\n this._start = new Date();\n }\n\n public end() {\n const stop = new Date();\n const elapsed = stop.getTime() - this._start.getTime();\n // eslint-disable-next-line no-console\n console.log(`${this._label}: ${elapsed}ms`);\n }\n}\n\n/**\n * Disables native code assertions from firing. This can be used by tests that intentionally\n * test failing operations. If those failing operations raise assertions in native code, the test\n * would fail unexpectedly in a debug build. In that case the native code assertions can be disabled with\n * this class.\n */\nexport class DisableNativeAssertions implements Disposable {\n private _native: IModelJsNative.DisableNativeAssertions | undefined;\n\n constructor() {\n this._native = new IModelNative.platform.DisableNativeAssertions();\n }\n\n public [Symbol.dispose](): void {\n if (!this._native)\n return;\n\n this._native.dispose();\n this._native = undefined;\n }\n\n /** @deprecated in 5.0 - might be removed in next major version. Use [Symbol.dispose] instead. */\n public dispose(): void {\n this[Symbol.dispose]();\n }\n}\n\nexport class TestUtils {\n private static shouldLogToConsole(): boolean {\n return process.env.ITWINJS_CORE_BACKEND_TEST_LOG_TO_CONSOLE === \"1\";\n }\n\n public static getCacheDir(fallback: string | undefined = undefined) {\n if (ProcessDetector.isMobileAppBackend) {\n return undefined; // Let the native side handle the cache.\n }\n return fallback ?? path.join(__dirname, \".cache\"); // Set the cache dir to be under the lib directory.\n }\n\n /** Handles the startup of IModelHost for unit tests.\n * The provided config is used and will override any of the default values used in this method.\n *\n * The default includes:\n * - cacheDir = path.join(__dirname, \".cache\")\n * - allowSharedChannel = false;\n *\n * GCS (Geographic Coordinate System) workspace loading is disabled by default, since unit tests\n * should not make network requests. Pass `loadGcsWorkspaces: true` for the rare test that genuinely\n * needs GCS data (which then belongs in the integration suite). This flag is test-only and is not\n * forwarded to `IModelHost.startup`.\n */\n public static async startBackend(config?: IModelHostOptions & { loadGcsWorkspaces?: boolean }): Promise<void> {\n const { loadGcsWorkspaces, ...cfg } = config ?? {};\n cfg.cacheDir = TestUtils.getCacheDir(cfg.cacheDir);\n cfg.allowSharedChannel ??= false; // Override default to test shared channel enforcement. Remove in version 5.0.\n cfg.implicitWriteEnforcement ??= \"throw\";\n await IModelHost.startup(cfg);\n if (!loadGcsWorkspaces)\n TestUtils.disableGcsWorkspaces();\n }\n\n /**\n * Suppress loading of Geographic Coordinate System (GCS) workspaces from cloud containers (and the\n * network requests they issue when iModels are opened) by overriding the existing GeoCoordConfig\n * setting. Unit tests should not make network calls; tests that genuinely require GCS data belong\n * in the integration suite. GCS workspaces load lazily on first iModel open, so overriding the\n * setting any time after `IModelHost.startup` is sufficient.\n */\n public static disableGcsWorkspaces(): void {\n IModelHost.appWorkspace.settings.addDictionary(\n { name: \"test-gcs-disable-override\", priority: SettingsPriority.application },\n { [GeoCoordConfig.settingName.disableWorkspaces]: true },\n );\n }\n\n public static async shutdownBackend(): Promise<void> {\n return IModelHost.shutdown();\n }\n\n public static setupLogging() {\n if (TestUtils.shouldLogToConsole())\n Logger.initializeToConsole();\n else\n Logger.initialize();\n Logger.setLevelDefault(LogLevel.Error);\n }\n\n private static initDebugLogLevels(reset?: boolean) {\n Logger.setLevelDefault(reset ? LogLevel.Error : LogLevel.Warning);\n Logger.setLevel(BentleyLoggerCategory.Performance, reset ? LogLevel.Error : LogLevel.Info);\n Logger.setLevel(BackendLoggerCategory.IModelDb, reset ? LogLevel.Error : LogLevel.Trace);\n Logger.setLevel(NativeLoggerCategory.DgnCore, reset ? LogLevel.Error : LogLevel.Trace);\n Logger.setLevel(NativeLoggerCategory.BeSQLite, reset ? LogLevel.Error : LogLevel.Trace);\n }\n\n // Setup typical programmatic log level overrides here\n // Convenience method used to debug specific tests/fixtures\n public static setupDebugLogLevels() {\n TestUtils.initDebugLogLevels(false);\n }\n\n public static resetDebugLogLevels() {\n TestUtils.initDebugLogLevels(true);\n }\n}\n\n// The very first \"before\" run to initially setup the logging and initial backend.\nbefore(async () => {\n TestUtils.setupLogging();\n await TestUtils.startBackend();\n});\n\nafter(async () => {\n await TestUtils.shutdownBackend();\n});\n\n"]}
|
|
@@ -101,6 +101,12 @@ describe("SettingsSchemas", () => {
|
|
|
101
101
|
expect(nested).to.not.have.property("extends");
|
|
102
102
|
expect(nested?.required).to.have.members(["nestedReq"]);
|
|
103
103
|
expect(nested?.properties).to.include.keys("nestedReq", "nestedBaseOnly", "nestedChildOnly");
|
|
104
|
+
const resolvedPreservingExtends = schemas.getResolvedSettingDef(`${prefix}/thing`, { preserveExtends: true });
|
|
105
|
+
expect(resolvedPreservingExtends.extends).to.equal(`${prefix}/baseThing`);
|
|
106
|
+
expect(resolvedPreservingExtends.properties?.overridden.type).to.equal("number");
|
|
107
|
+
const nestedPreservingExtends = resolvedPreservingExtends.properties?.nested;
|
|
108
|
+
expect(nestedPreservingExtends?.extends).to.equal(`${prefix}/nestedBase`);
|
|
109
|
+
expect(nestedPreservingExtends?.properties).to.include.keys("nestedReq", "nestedBaseOnly", "nestedChildOnly");
|
|
104
110
|
}
|
|
105
111
|
finally {
|
|
106
112
|
schemas.removeGroup(prefix);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsSchemas.test.js","sourceRoot":"","sources":["../../../../src/test/standalone/SettingsSchemas.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAE/B,2FAA2F;IAC3F,kIAAkI;IAClI,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;QAChC,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC5B,MAAM,SAAS,CAAC,YAAY,EAAE,CAAC;IACjC,CAAC,CAAC;IACF,MAAM,CAAC,KAAK,I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AC1B;aACF;SACF,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAChH,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC;QAC3C,MAAM,MAAM,GAAG,gCAAgC,CAAC;QAChD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,QAAQ,CAAC;YACf,YAAY,EAAE,MAAM;YACpB,WAAW,EAAE,gDAAgD;YAC7D,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,GAAG,MAAM,cAAc;iBACjC;aACF;SACF,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,MAAM,6BAA6B,CAAC,CAAC;QAC1H,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { expect } from \"chai\";\nimport { IModelTestUtils } from \"../IModelTestUtils\";\nimport { IModelHost } from \"../../IModelHost\";\nimport { TestUtils } from \"../TestUtils\";\n\ndescribe(\"SettingsSchemas\", () => {\n\n // SettingsSchema tests change the state of the IModelHost object. They should always clear\n // the current state before and after they run so they're not affected by, nor influence, other tests running in the same process.\n const restartSession = async () => {\n await IModelHost.shutdown();\n await TestUtils.startBackend();\n };\n before(async () => {\n await restartSession();\n });\n after(async () => {\n await restartSession();\n });\n\n it(\"add groups\", async () => {\n const schemas = IModelHost.settingsSchemas;\n // can't add a group with no name\n expect(() => schemas.addGroup({} as any)).throws(`has no \"schemaPrefix\" member`);\n\n schemas.addGroup({\n schemaPrefix: \"title-test\",\n title: \"Title Test\",\n description: \"schema with a user-facing title\",\n settingDefs: {\n setting: {\n type: \"string\",\n },\n },\n });\n expect(schemas.groups.get(\"title-test\")?.title).equals(\"Title Test\");\n expect(schemas.groups.get(\"title-test\")?.description).equals(\"schema with a user-facing title\");\n expect(schemas.settingDefs.get(\"title-test/setting\")!.type).equals(\"string\");\n\n schemas.addFile(IModelTestUtils.resolveAssetFile(\"TestSettings.schema.json\"));\n expect(schemas.groups.get(\"testApp\")?.title).equals(\"Test App\");\n expect(schemas.groups.get(\"testApp\")?.description).equals(\"the settings for test application 1\");\n expect(schemas.settingDefs.get(\"testApp/list/openMode\")!.type).equals(\"string\");\n expect(schemas.settingDefs.get(\"testApp/list/openMode\")!.default).equals(\"singleClick\");\n expect(schemas.settingDefs.get(\"testApp/tree/blah\")!.default).equals(true);\n });\n\n it(\"resolveSchema resolves object extends chains recursively\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-object\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test object resolution\",\n typeDefs: {\n nestedBase: {\n type: \"object\",\n required: [\"nestedReq\"],\n properties: {\n nestedReq: { type: \"integer\" },\n nestedBaseOnly: { type: \"string\" },\n },\n },\n baseThing: {\n type: \"object\",\n required: [\"baseReq\"],\n properties: {\n baseReq: { type: \"string\" },\n overridden: { type: \"string\" },\n baseOnly: { type: \"number\" },\n nested: {\n type: \"object\",\n extends: `${prefix}/nestedBase`,\n properties: {\n nestedChildOnly: { type: \"boolean\" },\n },\n },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/baseThing`,\n required: [\"derivedReq\"],\n properties: {\n derivedReq: { type: \"boolean\" },\n overridden: { type: \"number\" },\n },\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/thing`)!;\n expect(resolved.type).to.equal(\"object\");\n expect(resolved).to.not.have.property(\"extends\");\n expect(resolved.required).to.have.members([\"baseReq\", \"derivedReq\"]);\n expect(resolved.properties).to.include.keys(\"baseReq\", \"baseOnly\", \"derivedReq\", \"overridden\", \"nested\");\n expect(resolved.properties?.overridden.type).to.equal(\"number\");\n expect(resolved.properties?.baseOnly.type).to.equal(\"number\");\n\n const nested = resolved.properties?.nested;\n expect(nested?.type).to.equal(\"object\");\n expect(nested).to.not.have.property(\"extends\");\n expect(nested?.required).to.have.members([\"nestedReq\"]);\n expect(nested?.properties).to.include.keys(\"nestedReq\", \"nestedBaseOnly\", \"nestedChildOnly\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema includes inherited properties from object typedefs\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-object-inherited-props\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test inherited object properties\",\n typeDefs: {\n baseThing: {\n type: \"object\",\n properties: {\n inheritedName: { type: \"string\" },\n inheritedEnabled: { type: \"boolean\" },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/baseThing`,\n properties: {\n localCount: { type: \"integer\" },\n },\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/thing`)!;\n expect(resolved.properties).to.include.keys(\"inheritedName\", \"inheritedEnabled\", \"localCount\");\n expect(resolved.properties?.inheritedName.type).to.equal(\"string\");\n expect(resolved.properties?.inheritedEnabled.type).to.equal(\"boolean\");\n expect(resolved.properties?.localCount.type).to.equal(\"integer\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema deduplicates required properties inherited from object typedefs\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-object-required\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test required property deduplication\",\n typeDefs: {\n baseThing: {\n type: \"object\",\n required: [\"sharedReq\", \"baseReq\"],\n properties: {\n sharedReq: { type: \"string\" },\n baseReq: { type: \"boolean\" },\n derivedReq: { type: \"integer\" },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/baseThing`,\n required: [\"sharedReq\", \"derivedReq\"],\n properties: {\n sharedReq: { type: \"string\" },\n derivedReq: { type: \"integer\" },\n },\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/thing`)!;\n expect(resolved.required).to.have.members([\"sharedReq\", \"baseReq\", \"derivedReq\"]);\n expect(resolved.required?.filter((name) => name === \"sharedReq\")).to.have.lengthOf(1);\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema resolves array items through extends\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-array\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test array resolution\",\n typeDefs: {\n stringList: {\n type: \"array\",\n combineArray: true,\n minItems: 1,\n description: \"base array typedef\",\n items: { type: \"string\" },\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/stringList`,\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`)!;\n expect(resolved.type).to.equal(\"array\");\n expect(resolved).to.not.have.property(\"extends\");\n expect(resolved.combineArray).to.equal(true);\n expect(resolved.minItems).to.equal(1);\n expect(resolved.description).to.equal(\"base array typedef\");\n expect(resolved.items?.type).to.equal(\"string\");\n expect(resolved.items).to.not.have.property(\"extends\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema lets derived array schema properties override inherited typedef properties\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-array-overrides\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test array override precedence\",\n typeDefs: {\n stringList: {\n type: \"array\",\n combineArray: true,\n minItems: 1,\n description: \"base array typedef\",\n items: { type: \"string\" },\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/stringList`,\n combineArray: false,\n minItems: 3,\n description: \"derived array schema\",\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`)!;\n expect(resolved.combineArray).to.equal(false);\n expect(resolved.minItems).to.equal(3);\n expect(resolved.description).to.equal(\"derived array schema\");\n expect(resolved.items?.type).to.equal(\"string\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema resolves array items through multi-level typedef inheritance\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-array-multilevel\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test multi-level array typedef inheritance\",\n typeDefs: {\n c: {\n type: \"array\",\n combineArray: true,\n items: { type: \"string\" },\n },\n b: {\n type: \"array\",\n extends: `${prefix}/c`,\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/b`,\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`)!;\n expect(resolved.combineArray).to.equal(true);\n expect(resolved.items?.type).to.equal(\"string\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef returns a resolved setting schema by name\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-setting-schema\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test resolved setting schema lookup\",\n typeDefs: {\n stringList: {\n type: \"array\",\n combineArray: true,\n items: { type: \"string\" },\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/stringList`,\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`);\n expect(resolved).to.not.be.undefined;\n expect(resolved?.type).to.equal(\"array\");\n expect(resolved).to.not.have.property(\"extends\");\n expect(resolved?.combineArray).to.equal(true);\n expect(resolved?.items?.type).to.equal(\"string\");\n expect(schemas.getResolvedSettingDef(`${prefix}/missing`)).to.be.undefined;\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef resolves built-in workspace settings schemas\", () => {\n const schemas = IModelHost.settingsSchemas;\n\n const resolved = schemas.getResolvedSettingDef(\"itwin/core/workspace/settingsWorkspaces\");\n expect(resolved).to.not.be.undefined;\n expect(resolved?.type).to.equal(\"array\");\n expect(resolved?.items?.type).to.equal(\"object\");\n expect(resolved?.items).to.not.have.property(\"extends\");\n expect(resolved?.items?.required).to.have.members([\"containerId\", \"baseUri\"]);\n expect(resolved?.items?.properties).to.include.keys(\"dbName\", \"baseUri\", \"containerId\", \"storageType\", \"resourceName\", \"priority\");\n expect(resolved?.items?.properties?.storageType.default).to.equal(\"azure\");\n });\n\n it(\"getResolvedSettingDef throws on circular typedef references\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-cycle\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test circular typedef resolution\",\n typeDefs: {\n a: {\n type: \"object\",\n extends: `${prefix}/b`,\n properties: {\n aOnly: { type: \"string\" },\n },\n },\n b: {\n type: \"object\",\n extends: `${prefix}/a`,\n properties: {\n bOnly: { type: \"string\" },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/a`,\n },\n },\n });\n\n try {\n expect(() => schemas.getResolvedSettingDef(`${prefix}/thing`)).to.throw(\"circular typeDef reference detected\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef throws on nested recursive typedef references\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-nested-cycle\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test nested recursive typedef resolution\",\n typeDefs: {\n node: {\n type: \"object\",\n properties: {\n child: {\n type: \"object\",\n extends: `${prefix}/node`,\n },\n },\n },\n },\n settingDefs: {\n root: {\n type: \"object\",\n extends: `${prefix}/node`,\n },\n },\n });\n\n try {\n expect(() => schemas.getResolvedSettingDef(`${prefix}/root`)).to.throw(\"circular typeDef reference detected\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef throws when an extends target cannot be found\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-missing-typedef\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test missing typedef resolution\",\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/missingType`,\n },\n },\n });\n\n try {\n expect(() => schemas.getResolvedSettingDef(`${prefix}/thing`)).to.throw(`typeDef ${prefix}/missingType does not exist`);\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n});\n"]}
|
|
1
|
+
{"version":3,"file":"SettingsSchemas.test.js","sourceRoot":"","sources":["../../../../src/test/standalone/SettingsSchemas.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAE/B,2FAA2F;IAC3F,kIAAkI;IAClI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,gCAAgC,CAAC;QAChD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,QAAQ,CAAC;YACf,YAAY,EAAE,MAAM;YACpB,WAAW,EAAE,gDAAgD;YAC7D,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,GAAG,MAAM,cAAc;iBACjC;aACF;SACF,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,MAAM,6BAA6B,CAAC,CAAC;QAC1H,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { expect } from \"chai\";\nimport { IModelTestUtils } from \"../IModelTestUtils\";\nimport { IModelHost } from \"../../IModelHost\";\nimport { TestUtils } from \"../TestUtils\";\n\ndescribe(\"SettingsSchemas\", () => {\n\n // SettingsSchema tests change the state of the IModelHost object. They should always clear\n // the current state before and after they run so they're not affected by, nor influence, other tests running in the same process.\n const restartSession = async () => {\n await IModelHost.shutdown();\n await TestUtils.startBackend();\n };\n before(async () => {\n await restartSession();\n });\n after(async () => {\n await restartSession();\n });\n\n it(\"add groups\", async () => {\n const schemas = IModelHost.settingsSchemas;\n // can't add a group with no name\n expect(() => schemas.addGroup({} as any)).throws(`has no \"schemaPrefix\" member`);\n\n schemas.addGroup({\n schemaPrefix: \"title-test\",\n title: \"Title Test\",\n description: \"schema with a user-facing title\",\n settingDefs: {\n setting: {\n type: \"string\",\n },\n },\n });\n expect(schemas.groups.get(\"title-test\")?.title).equals(\"Title Test\");\n expect(schemas.groups.get(\"title-test\")?.description).equals(\"schema with a user-facing title\");\n expect(schemas.settingDefs.get(\"title-test/setting\")!.type).equals(\"string\");\n\n schemas.addFile(IModelTestUtils.resolveAssetFile(\"TestSettings.schema.json\"));\n expect(schemas.groups.get(\"testApp\")?.title).equals(\"Test App\");\n expect(schemas.groups.get(\"testApp\")?.description).equals(\"the settings for test application 1\");\n expect(schemas.settingDefs.get(\"testApp/list/openMode\")!.type).equals(\"string\");\n expect(schemas.settingDefs.get(\"testApp/list/openMode\")!.default).equals(\"singleClick\");\n expect(schemas.settingDefs.get(\"testApp/tree/blah\")!.default).equals(true);\n });\n\n it(\"resolveSchema resolves object extends chains recursively\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-object\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test object resolution\",\n typeDefs: {\n nestedBase: {\n type: \"object\",\n required: [\"nestedReq\"],\n properties: {\n nestedReq: { type: \"integer\" },\n nestedBaseOnly: { type: \"string\" },\n },\n },\n baseThing: {\n type: \"object\",\n required: [\"baseReq\"],\n properties: {\n baseReq: { type: \"string\" },\n overridden: { type: \"string\" },\n baseOnly: { type: \"number\" },\n nested: {\n type: \"object\",\n extends: `${prefix}/nestedBase`,\n properties: {\n nestedChildOnly: { type: \"boolean\" },\n },\n },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/baseThing`,\n required: [\"derivedReq\"],\n properties: {\n derivedReq: { type: \"boolean\" },\n overridden: { type: \"number\" },\n },\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/thing`)!;\n expect(resolved.type).to.equal(\"object\");\n expect(resolved).to.not.have.property(\"extends\");\n expect(resolved.required).to.have.members([\"baseReq\", \"derivedReq\"]);\n expect(resolved.properties).to.include.keys(\"baseReq\", \"baseOnly\", \"derivedReq\", \"overridden\", \"nested\");\n expect(resolved.properties?.overridden.type).to.equal(\"number\");\n expect(resolved.properties?.baseOnly.type).to.equal(\"number\");\n\n const nested = resolved.properties?.nested;\n expect(nested?.type).to.equal(\"object\");\n expect(nested).to.not.have.property(\"extends\");\n expect(nested?.required).to.have.members([\"nestedReq\"]);\n expect(nested?.properties).to.include.keys(\"nestedReq\", \"nestedBaseOnly\", \"nestedChildOnly\");\n\n const resolvedPreservingExtends = schemas.getResolvedSettingDef(`${prefix}/thing`, { preserveExtends: true })!;\n expect(resolvedPreservingExtends.extends).to.equal(`${prefix}/baseThing`);\n expect(resolvedPreservingExtends.properties?.overridden.type).to.equal(\"number\");\n\n const nestedPreservingExtends = resolvedPreservingExtends.properties?.nested;\n expect(nestedPreservingExtends?.extends).to.equal(`${prefix}/nestedBase`);\n expect(nestedPreservingExtends?.properties).to.include.keys(\"nestedReq\", \"nestedBaseOnly\", \"nestedChildOnly\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema includes inherited properties from object typedefs\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-object-inherited-props\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test inherited object properties\",\n typeDefs: {\n baseThing: {\n type: \"object\",\n properties: {\n inheritedName: { type: \"string\" },\n inheritedEnabled: { type: \"boolean\" },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/baseThing`,\n properties: {\n localCount: { type: \"integer\" },\n },\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/thing`)!;\n expect(resolved.properties).to.include.keys(\"inheritedName\", \"inheritedEnabled\", \"localCount\");\n expect(resolved.properties?.inheritedName.type).to.equal(\"string\");\n expect(resolved.properties?.inheritedEnabled.type).to.equal(\"boolean\");\n expect(resolved.properties?.localCount.type).to.equal(\"integer\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema deduplicates required properties inherited from object typedefs\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-object-required\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test required property deduplication\",\n typeDefs: {\n baseThing: {\n type: \"object\",\n required: [\"sharedReq\", \"baseReq\"],\n properties: {\n sharedReq: { type: \"string\" },\n baseReq: { type: \"boolean\" },\n derivedReq: { type: \"integer\" },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/baseThing`,\n required: [\"sharedReq\", \"derivedReq\"],\n properties: {\n sharedReq: { type: \"string\" },\n derivedReq: { type: \"integer\" },\n },\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/thing`)!;\n expect(resolved.required).to.have.members([\"sharedReq\", \"baseReq\", \"derivedReq\"]);\n expect(resolved.required?.filter((name) => name === \"sharedReq\")).to.have.lengthOf(1);\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema resolves array items through extends\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-array\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test array resolution\",\n typeDefs: {\n stringList: {\n type: \"array\",\n combineArray: true,\n minItems: 1,\n description: \"base array typedef\",\n items: { type: \"string\" },\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/stringList`,\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`)!;\n expect(resolved.type).to.equal(\"array\");\n expect(resolved).to.not.have.property(\"extends\");\n expect(resolved.combineArray).to.equal(true);\n expect(resolved.minItems).to.equal(1);\n expect(resolved.description).to.equal(\"base array typedef\");\n expect(resolved.items?.type).to.equal(\"string\");\n expect(resolved.items).to.not.have.property(\"extends\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema lets derived array schema properties override inherited typedef properties\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-array-overrides\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test array override precedence\",\n typeDefs: {\n stringList: {\n type: \"array\",\n combineArray: true,\n minItems: 1,\n description: \"base array typedef\",\n items: { type: \"string\" },\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/stringList`,\n combineArray: false,\n minItems: 3,\n description: \"derived array schema\",\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`)!;\n expect(resolved.combineArray).to.equal(false);\n expect(resolved.minItems).to.equal(3);\n expect(resolved.description).to.equal(\"derived array schema\");\n expect(resolved.items?.type).to.equal(\"string\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"resolveSchema resolves array items through multi-level typedef inheritance\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-array-multilevel\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test multi-level array typedef inheritance\",\n typeDefs: {\n c: {\n type: \"array\",\n combineArray: true,\n items: { type: \"string\" },\n },\n b: {\n type: \"array\",\n extends: `${prefix}/c`,\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/b`,\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`)!;\n expect(resolved.combineArray).to.equal(true);\n expect(resolved.items?.type).to.equal(\"string\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef returns a resolved setting schema by name\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-setting-schema\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test resolved setting schema lookup\",\n typeDefs: {\n stringList: {\n type: \"array\",\n combineArray: true,\n items: { type: \"string\" },\n },\n },\n settingDefs: {\n names: {\n type: \"array\",\n extends: `${prefix}/stringList`,\n },\n },\n });\n\n try {\n const resolved = schemas.getResolvedSettingDef(`${prefix}/names`);\n expect(resolved).to.not.be.undefined;\n expect(resolved?.type).to.equal(\"array\");\n expect(resolved).to.not.have.property(\"extends\");\n expect(resolved?.combineArray).to.equal(true);\n expect(resolved?.items?.type).to.equal(\"string\");\n expect(schemas.getResolvedSettingDef(`${prefix}/missing`)).to.be.undefined;\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef resolves built-in workspace settings schemas\", () => {\n const schemas = IModelHost.settingsSchemas;\n\n const resolved = schemas.getResolvedSettingDef(\"itwin/core/workspace/settingsWorkspaces\");\n expect(resolved).to.not.be.undefined;\n expect(resolved?.type).to.equal(\"array\");\n expect(resolved?.items?.type).to.equal(\"object\");\n expect(resolved?.items).to.not.have.property(\"extends\");\n expect(resolved?.items?.required).to.have.members([\"containerId\", \"baseUri\"]);\n expect(resolved?.items?.properties).to.include.keys(\"dbName\", \"baseUri\", \"containerId\", \"storageType\", \"resourceName\", \"priority\");\n expect(resolved?.items?.properties?.storageType.default).to.equal(\"azure\");\n });\n\n it(\"getResolvedSettingDef throws on circular typedef references\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-cycle\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test circular typedef resolution\",\n typeDefs: {\n a: {\n type: \"object\",\n extends: `${prefix}/b`,\n properties: {\n aOnly: { type: \"string\" },\n },\n },\n b: {\n type: \"object\",\n extends: `${prefix}/a`,\n properties: {\n bOnly: { type: \"string\" },\n },\n },\n },\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/a`,\n },\n },\n });\n\n try {\n expect(() => schemas.getResolvedSettingDef(`${prefix}/thing`)).to.throw(\"circular typeDef reference detected\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef throws on nested recursive typedef references\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-nested-cycle\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test nested recursive typedef resolution\",\n typeDefs: {\n node: {\n type: \"object\",\n properties: {\n child: {\n type: \"object\",\n extends: `${prefix}/node`,\n },\n },\n },\n },\n settingDefs: {\n root: {\n type: \"object\",\n extends: `${prefix}/node`,\n },\n },\n });\n\n try {\n expect(() => schemas.getResolvedSettingDef(`${prefix}/root`)).to.throw(\"circular typeDef reference detected\");\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n it(\"getResolvedSettingDef throws when an extends target cannot be found\", () => {\n const schemas = IModelHost.settingsSchemas;\n const prefix = \"resolve-schema-missing-typedef\";\n schemas.removeGroup(prefix);\n schemas.addGroup({\n schemaPrefix: prefix,\n description: \"schema used to test missing typedef resolution\",\n settingDefs: {\n thing: {\n type: \"object\",\n extends: `${prefix}/missingType`,\n },\n },\n });\n\n try {\n expect(() => schemas.getResolvedSettingDef(`${prefix}/thing`)).to.throw(`typeDef ${prefix}/missingType does not exist`);\n } finally {\n schemas.removeGroup(prefix);\n }\n });\n\n});\n"]}
|
|
@@ -79,6 +79,21 @@ export interface SettingGroupSchema {
|
|
|
79
79
|
/** A description of this group suitable for displaying to a user. */
|
|
80
80
|
readonly description: string;
|
|
81
81
|
}
|
|
82
|
+
/** Options controlling how [[SettingsSchemas.getResolvedSettingDef]] resolves a [[SettingSchema]].
|
|
83
|
+
* @beta
|
|
84
|
+
*/
|
|
85
|
+
export interface GetResolvedSettingDefOptions {
|
|
86
|
+
/** When `true`, the `extends` property is retained on resolved schemas that originally
|
|
87
|
+
* declared it. By default (`false`) it is stripped after resolution, because the inherited
|
|
88
|
+
* properties have already been merged into the output schema.
|
|
89
|
+
*
|
|
90
|
+
* Set to `true` when the caller needs to inspect schema inheritance - for example, when
|
|
91
|
+
* building a schema editor that shows which base type a setting definition inherits from.
|
|
92
|
+
*
|
|
93
|
+
* @defaultValue false
|
|
94
|
+
*/
|
|
95
|
+
readonly preserveExtends?: boolean;
|
|
96
|
+
}
|
|
82
97
|
/**
|
|
83
98
|
* The registry of available [[SettingGroupSchema]]s.
|
|
84
99
|
* The registry is used for editing Settings files and for finding default values for settings.
|
|
@@ -140,13 +155,24 @@ export interface SettingsSchemas {
|
|
|
140
155
|
/**
|
|
141
156
|
* Looks up a setting schema in [[settingDefs]] and returns its resolved form.
|
|
142
157
|
* Resolution uses the [[typeDefs]] currently registered with this [[SettingsSchemas]] instance.
|
|
158
|
+
* By default, `extends` metadata is removed from the resolved schema. Pass [[GetResolvedSettingDefOptions.preserveExtends]]
|
|
159
|
+
* to preserve `extends` members on resolved schemas that originally declared them.
|
|
143
160
|
* @returns The resolved schema for `settingName`, or `undefined` if no schema has been registered for that setting.
|
|
144
161
|
* @throws Error if a registered setting schema cannot be resolved because a referenced type definition is missing or circular.
|
|
145
|
-
* @example
|
|
162
|
+
* @example Default - `extends` is stripped after resolution:
|
|
146
163
|
* ```ts
|
|
147
164
|
* const resolved = IModelHost.settingsSchemas.getResolvedSettingDef("app/font");
|
|
165
|
+
* // resolved.extends === undefined
|
|
166
|
+
* ```
|
|
167
|
+
* @example Preserving `extends` for tooling (e.g. a schema editor):
|
|
168
|
+
* ```ts
|
|
169
|
+
* const resolved = IModelHost.settingsSchemas.getResolvedSettingDef(
|
|
170
|
+
* "app/font",
|
|
171
|
+
* { preserveExtends: true },
|
|
172
|
+
* );
|
|
173
|
+
* // resolved.extends === "app/baseFont" (if originally declared)
|
|
148
174
|
* ```
|
|
149
175
|
*/
|
|
150
|
-
getResolvedSettingDef(settingName: SettingName): SettingSchema | undefined;
|
|
176
|
+
getResolvedSettingDef(settingName: SettingName, options?: GetResolvedSettingDefOptions): SettingSchema | undefined;
|
|
151
177
|
}
|
|
152
178
|
//# sourceMappingURL=SettingsSchemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsSchemas.d.ts","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 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsSchemas.js","sourceRoot":"","sources":["../../../src/workspace/SettingsSchemas.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Workspace\n */\n\nimport { BeEvent, JSONSchema, JSONSchemaTypeName } from \"@itwin/core-bentley\";\nimport { LocalDirName, LocalFileName } from \"@itwin/core-common\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\nimport { SettingName } from \"./Settings\";\n\n/** Metadata describing a single [[Setting]] as part of a [[SettingGroupSchema]].\n * Every setting has a [[type]], which can be one of the following:\n * - A primitive type like `string` or `number`;\n * - An object containing any number of named properties, each with their own types; or\n * - An array of elements, all of the same type.\n * This metadata is used to validate setting values against the schema, and to enable user interfaces by which\n * users can view and modify their settings.\n * @beta\n */\nexport interface SettingSchema extends Readonly<JSONSchema> {\n /** For arrays only, the metadata describing every element in the array. */\n readonly items?: SettingSchema;\n /** The name of the [[Setting]]'s data type. */\n readonly type: JSONSchemaTypeName;\n /** For objects and arrays only, the name of a [[SettingSchema]] that provides a base definition for this type.\n * The name is expected to refer to a type definition registered with [[SettingsSchema.typeDefs]].\n * Therefore, it must be the full name, including the [[SettingGroupSchema.schemaPrefix]].\n */\n readonly extends?: string;\n /** For objects only, the name and metadata of each of the object's properties. */\n readonly properties?: { [name: SettingName]: SettingSchema };\n /** For arrays only, specifies how [[SettingsDictionary.getArray]] resolves the value of the setting.\n * By default, like other types of settings, the setting uses the value of the setting from the highest-priority dictionary.\n * If `combineArray` is `true`, then the value of the setting is computed by combining the elements of every array from every dictionary,\n * ordered by priority and eliminating duplicate elements.\n * Two elements are considered duplicates of one another if [[Setting.areEqual]] returns `true`.\n */\n readonly combineArray?: boolean;\n}\n\n/** Metadata describing a group of related [[SettingSchema]]s. You can register setting schema groups via [[SettingsSchemas.addGroup]] and\n * remove them via [[SettingsSchemas.removeGroup]].\n *\n * All of the settings share the same [[schemaPrefix]], which must be unique amongst all other groups.\n * The prefix is a stable identifier combined with the name of each [[SettingSchema]] in the group to form the fully-qualified name used to refer\n * to the setting outside of the group, e.g., when accessing [[SettingsSchemas.settingDefs]] or in [[SettingSchema.extends]].\n * In the following example, the fully-qualified name of the setting named \"metric\" is \"format/units/metric\".\n *\n * ```json\n * {\n * \"schemaPrefix\": \"format/units\",\n * \"settingDefs\": {\n * \"metric\": { \"type\": \"boolean\" }\n * }\n * }\n * ```\n *\n * A group can also define [[SettingSchema]]s that, rather than describing actual [[Setting]]s, instead describe types that can be extended by [[Setting]]s via\n * [[SettingSchema.extends]]. A [[SettingSchema]] can refer to type definitions defined in its own group or any other group.\n * @beta\n */\nexport interface SettingGroupSchema {\n /** Uniquely identifies this group amongst all other groups.\n * The prefix can use forward-slashes to define logical subgroups - for example, two related groups with the prefixes \"units/metric\" and \"units/imperial\".\n *\n * @note Schema prefixes beginning with \"itwin\" are reserved for use by iTwin.js.\n */\n readonly schemaPrefix: string;\n /** A title of this group suitable for displaying to a user. */\n readonly title?: string;\n /** Metadata for each [[Setting]] in this group. */\n readonly settingDefs?: { [name: string]: SettingSchema | undefined };\n /** Metadata for types that can be extended by other [[Setting]]s via [[SettingSchema.extends]]. */\n readonly typeDefs?: { [name: string]: SettingSchema | undefined };\n /** An integer used when displaying a list of schemas in a user interface, to sort schemas with a lower `order` before those with a `higher` order. */\n readonly order?: number;\n /** A description of this group suitable for displaying to a user. */\n readonly description: string;\n}\n\n/**\n * The registry of available [[SettingGroupSchema]]s.\n * The registry is used for editing Settings files and for finding default values for settings.\n * @beta\n */\n\n/** The registry of metadata describing groups of [[SettingSchema]]s available to the current session.\n * The schemas are used to look up the default values of [[Setting]]s, validate that their values are of the type dictated by the schema, and\n * query metadata like [[SettingsSchema.combineArray]] that modify their behavior.\n * They can also be used to drive a user interface that enables end users to edit [[Settings]].\n *\n * When [[IModelHost.startup]] is invoked at the beginning of a session, schemas delivered with the application - like those describing\n * [[Workspace]]s - are automatically loaded.\n * The application can manually register additional schemas using methods like [[addGroup]], [[addFile]], [[addDirectory]], and [[addJson]].\n * When [[IModelHost.shutdown]] is invoked at the end of a session, all registered schemas are unregistered.\n *\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overiew and examples.\n *\n * @see [[IModelHost.settingsSchemas]] to access the registry for the current session.\n * @beta\n */\nexport interface SettingsSchemas {\n /** @internal */\n readonly [_implementationProhibited]: unknown;\n\n /** The map of each registered [[SettingGroupSchema]], accessed by its [[SettingGroupSchema.schemaPrefix]]. */\n readonly groups: ReadonlyMap<string, SettingGroupSchema>;\n\n /** The map of each individual registered [[SettingSchema]] defining a [[Setting]], accessed by its fully-qualified name (including its [[SettingGroupSchema.schemaPrefix]]).\n * Schemas in this map may include an [[SettingSchema.extends]] property referring to a registered type definition.\n * Use [[resolveSchema]] to obtain the fully expanded schema.\n */\n readonly settingDefs: ReadonlyMap<SettingName, SettingSchema>;\n\n /** The map of each individual registered [[SettingSchema]] defining a type that can be extended by other [[SettingSchema]]s via [[SettingSchema.extends]],\n * accessed by its fully-qualified name (including its [[SettingGroupSchema.schemaPrefix]]).\n */\n readonly typeDefs: ReadonlyMap<SettingName, SettingSchema>;\n\n /** An event raised whenever schemas are added or removed. */\n readonly onSchemaChanged: BeEvent<() => void>;\n\n /**\n * Ensure that the setting value supplied is valid according to its [[SettingSchema]].\n * If no schema has been registered for the setting, no validation is performed.\n * @param value The value of the setting to validate against the schema.\n * @param settingName The fully-qualified setting name.\n * @returns `value` if `value` matches the schema corresponding to `settingName`, or if no such schema has been registered.\n * @throws Error if `value` is invalid according to the schema.\n */\n validateSetting<T>(value: T, settingName: SettingName): T;\n\n /** Register one or more [[SettingGroupSchema]]s.\n * If a group with the same [[SettingGroupSchema.prefix]] was previously registered, it will be replaced.\n * Each [[SettingSchema]] in the group will be added to [[settingDefs]] or [[typeDefs]].\n */\n addGroup(settingsGroup: SettingGroupSchema | SettingGroupSchema[]): void;\n\n /** Invokes [[addGroup]] for a [[SettingGroupSchema]] supplied as stringified json5. */\n addJson(settingSchema: string): void;\n\n /** Invokes [[addGroup]] for a json5 file containiner a [[SettingGroupSchema]]. */\n addFile(fileName: LocalFileName): void;\n\n /** Invokes [[addFile]] for every json and json5 file in the specified directory. */\n addDirectory(dirName: LocalDirName): void;\n\n /** Unregisters all [[settingDefs]] and [[typeDefs]] with the specified [[SettingGroupSchema.schemaPrefix]]. */\n removeGroup(schemaPrefix: string): void;\n\n /**\n * Looks up a setting schema in [[settingDefs]] and returns its resolved form.\n * Resolution uses the [[typeDefs]] currently registered with this [[SettingsSchemas]] instance.\n * @returns The resolved schema for `settingName`, or `undefined` if no schema has been registered for that setting.\n * @throws Error if a registered setting schema cannot be resolved because a referenced type definition is missing or circular.\n * @example\n * ```ts\n * const resolved = IModelHost.settingsSchemas.getResolvedSettingDef(\"app/font\");\n * ```\n */\n getResolvedSettingDef(settingName: SettingName): SettingSchema | undefined;\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SettingsSchemas.js","sourceRoot":"","sources":["../../../src/workspace/SettingsSchemas.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Workspace\n */\n\nimport { BeEvent, JSONSchema, JSONSchemaTypeName } from \"@itwin/core-bentley\";\nimport { LocalDirName, LocalFileName } from \"@itwin/core-common\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\nimport { SettingName } from \"./Settings\";\n\n/** Metadata describing a single [[Setting]] as part of a [[SettingGroupSchema]].\n * Every setting has a [[type]], which can be one of the following:\n * - A primitive type like `string` or `number`;\n * - An object containing any number of named properties, each with their own types; or\n * - An array of elements, all of the same type.\n * This metadata is used to validate setting values against the schema, and to enable user interfaces by which\n * users can view and modify their settings.\n * @beta\n */\nexport interface SettingSchema extends Readonly<JSONSchema> {\n /** For arrays only, the metadata describing every element in the array. */\n readonly items?: SettingSchema;\n /** The name of the [[Setting]]'s data type. */\n readonly type: JSONSchemaTypeName;\n /** For objects and arrays only, the name of a [[SettingSchema]] that provides a base definition for this type.\n * The name is expected to refer to a type definition registered with [[SettingsSchema.typeDefs]].\n * Therefore, it must be the full name, including the [[SettingGroupSchema.schemaPrefix]].\n */\n readonly extends?: string;\n /** For objects only, the name and metadata of each of the object's properties. */\n readonly properties?: { [name: SettingName]: SettingSchema };\n /** For arrays only, specifies how [[SettingsDictionary.getArray]] resolves the value of the setting.\n * By default, like other types of settings, the setting uses the value of the setting from the highest-priority dictionary.\n * If `combineArray` is `true`, then the value of the setting is computed by combining the elements of every array from every dictionary,\n * ordered by priority and eliminating duplicate elements.\n * Two elements are considered duplicates of one another if [[Setting.areEqual]] returns `true`.\n */\n readonly combineArray?: boolean;\n}\n\n/** Metadata describing a group of related [[SettingSchema]]s. You can register setting schema groups via [[SettingsSchemas.addGroup]] and\n * remove them via [[SettingsSchemas.removeGroup]].\n *\n * All of the settings share the same [[schemaPrefix]], which must be unique amongst all other groups.\n * The prefix is a stable identifier combined with the name of each [[SettingSchema]] in the group to form the fully-qualified name used to refer\n * to the setting outside of the group, e.g., when accessing [[SettingsSchemas.settingDefs]] or in [[SettingSchema.extends]].\n * In the following example, the fully-qualified name of the setting named \"metric\" is \"format/units/metric\".\n *\n * ```json\n * {\n * \"schemaPrefix\": \"format/units\",\n * \"settingDefs\": {\n * \"metric\": { \"type\": \"boolean\" }\n * }\n * }\n * ```\n *\n * A group can also define [[SettingSchema]]s that, rather than describing actual [[Setting]]s, instead describe types that can be extended by [[Setting]]s via\n * [[SettingSchema.extends]]. A [[SettingSchema]] can refer to type definitions defined in its own group or any other group.\n * @beta\n */\nexport interface SettingGroupSchema {\n /** Uniquely identifies this group amongst all other groups.\n * The prefix can use forward-slashes to define logical subgroups - for example, two related groups with the prefixes \"units/metric\" and \"units/imperial\".\n *\n * @note Schema prefixes beginning with \"itwin\" are reserved for use by iTwin.js.\n */\n readonly schemaPrefix: string;\n /** A title of this group suitable for displaying to a user. */\n readonly title?: string;\n /** Metadata for each [[Setting]] in this group. */\n readonly settingDefs?: { [name: string]: SettingSchema | undefined };\n /** Metadata for types that can be extended by other [[Setting]]s via [[SettingSchema.extends]]. */\n readonly typeDefs?: { [name: string]: SettingSchema | undefined };\n /** An integer used when displaying a list of schemas in a user interface, to sort schemas with a lower `order` before those with a `higher` order. */\n readonly order?: number;\n /** A description of this group suitable for displaying to a user. */\n readonly description: string;\n}\n\n/** Options controlling how [[SettingsSchemas.getResolvedSettingDef]] resolves a [[SettingSchema]].\n * @beta\n */\nexport interface GetResolvedSettingDefOptions {\n /** When `true`, the `extends` property is retained on resolved schemas that originally\n * declared it. By default (`false`) it is stripped after resolution, because the inherited\n * properties have already been merged into the output schema.\n *\n * Set to `true` when the caller needs to inspect schema inheritance - for example, when\n * building a schema editor that shows which base type a setting definition inherits from.\n *\n * @defaultValue false\n */\n readonly preserveExtends?: boolean;\n}\n\n/**\n * The registry of available [[SettingGroupSchema]]s.\n * The registry is used for editing Settings files and for finding default values for settings.\n * @beta\n */\n\n/** The registry of metadata describing groups of [[SettingSchema]]s available to the current session.\n * The schemas are used to look up the default values of [[Setting]]s, validate that their values are of the type dictated by the schema, and\n * query metadata like [[SettingsSchema.combineArray]] that modify their behavior.\n * They can also be used to drive a user interface that enables end users to edit [[Settings]].\n *\n * When [[IModelHost.startup]] is invoked at the beginning of a session, schemas delivered with the application - like those describing\n * [[Workspace]]s - are automatically loaded.\n * The application can manually register additional schemas using methods like [[addGroup]], [[addFile]], [[addDirectory]], and [[addJson]].\n * When [[IModelHost.shutdown]] is invoked at the end of a session, all registered schemas are unregistered.\n *\n * See the [learning article]($docs/learning/backend/Workspace) for a detailed overiew and examples.\n *\n * @see [[IModelHost.settingsSchemas]] to access the registry for the current session.\n * @beta\n */\nexport interface SettingsSchemas {\n /** @internal */\n readonly [_implementationProhibited]: unknown;\n\n /** The map of each registered [[SettingGroupSchema]], accessed by its [[SettingGroupSchema.schemaPrefix]]. */\n readonly groups: ReadonlyMap<string, SettingGroupSchema>;\n\n /** The map of each individual registered [[SettingSchema]] defining a [[Setting]], accessed by its fully-qualified name (including its [[SettingGroupSchema.schemaPrefix]]).\n * Schemas in this map may include an [[SettingSchema.extends]] property referring to a registered type definition.\n * Use [[resolveSchema]] to obtain the fully expanded schema.\n */\n readonly settingDefs: ReadonlyMap<SettingName, SettingSchema>;\n\n /** The map of each individual registered [[SettingSchema]] defining a type that can be extended by other [[SettingSchema]]s via [[SettingSchema.extends]],\n * accessed by its fully-qualified name (including its [[SettingGroupSchema.schemaPrefix]]).\n */\n readonly typeDefs: ReadonlyMap<SettingName, SettingSchema>;\n\n /** An event raised whenever schemas are added or removed. */\n readonly onSchemaChanged: BeEvent<() => void>;\n\n /**\n * Ensure that the setting value supplied is valid according to its [[SettingSchema]].\n * If no schema has been registered for the setting, no validation is performed.\n * @param value The value of the setting to validate against the schema.\n * @param settingName The fully-qualified setting name.\n * @returns `value` if `value` matches the schema corresponding to `settingName`, or if no such schema has been registered.\n * @throws Error if `value` is invalid according to the schema.\n */\n validateSetting<T>(value: T, settingName: SettingName): T;\n\n /** Register one or more [[SettingGroupSchema]]s.\n * If a group with the same [[SettingGroupSchema.prefix]] was previously registered, it will be replaced.\n * Each [[SettingSchema]] in the group will be added to [[settingDefs]] or [[typeDefs]].\n */\n addGroup(settingsGroup: SettingGroupSchema | SettingGroupSchema[]): void;\n\n /** Invokes [[addGroup]] for a [[SettingGroupSchema]] supplied as stringified json5. */\n addJson(settingSchema: string): void;\n\n /** Invokes [[addGroup]] for a json5 file containiner a [[SettingGroupSchema]]. */\n addFile(fileName: LocalFileName): void;\n\n /** Invokes [[addFile]] for every json and json5 file in the specified directory. */\n addDirectory(dirName: LocalDirName): void;\n\n /** Unregisters all [[settingDefs]] and [[typeDefs]] with the specified [[SettingGroupSchema.schemaPrefix]]. */\n removeGroup(schemaPrefix: string): void;\n\n /**\n * Looks up a setting schema in [[settingDefs]] and returns its resolved form.\n * Resolution uses the [[typeDefs]] currently registered with this [[SettingsSchemas]] instance.\n * By default, `extends` metadata is removed from the resolved schema. Pass [[GetResolvedSettingDefOptions.preserveExtends]]\n * to preserve `extends` members on resolved schemas that originally declared them.\n * @returns The resolved schema for `settingName`, or `undefined` if no schema has been registered for that setting.\n * @throws Error if a registered setting schema cannot be resolved because a referenced type definition is missing or circular.\n * @example Default - `extends` is stripped after resolution:\n * ```ts\n * const resolved = IModelHost.settingsSchemas.getResolvedSettingDef(\"app/font\");\n * // resolved.extends === undefined\n * ```\n * @example Preserving `extends` for tooling (e.g. a schema editor):\n * ```ts\n * const resolved = IModelHost.settingsSchemas.getResolvedSettingDef(\n * \"app/font\",\n * { preserveExtends: true },\n * );\n * // resolved.extends === \"app/baseFont\" (if originally declared)\n * ```\n */\n getResolvedSettingDef(settingName: SettingName, options?: GetResolvedSettingDefOptions): SettingSchema | undefined;\n\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-backend",
|
|
3
|
-
"version": "5.12.0-dev.
|
|
3
|
+
"version": "5.12.0-dev.5",
|
|
4
4
|
"description": "iTwin.js backend components",
|
|
5
5
|
"main": "lib/cjs/core-backend.js",
|
|
6
6
|
"module": "lib/esm/core-backend.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@opentelemetry/api": "^1.0.4",
|
|
30
|
-
"@itwin/core-bentley": "5.12.0-dev.
|
|
31
|
-
"@itwin/core-common": "5.12.0-dev.
|
|
32
|
-
"@itwin/
|
|
33
|
-
"@itwin/
|
|
30
|
+
"@itwin/core-bentley": "5.12.0-dev.5",
|
|
31
|
+
"@itwin/core-common": "5.12.0-dev.5",
|
|
32
|
+
"@itwin/core-geometry": "5.12.0-dev.5",
|
|
33
|
+
"@itwin/ecschema-metadata": "5.12.0-dev.5"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@opentelemetry/api": {
|
|
@@ -77,17 +77,17 @@
|
|
|
77
77
|
"marked": "^14.1.3",
|
|
78
78
|
"sql-formatter": "^15.4.6",
|
|
79
79
|
"webpack": "^5.97.1",
|
|
80
|
-
"@itwin/
|
|
81
|
-
"@itwin/
|
|
82
|
-
"@itwin/
|
|
83
|
-
"@itwin/
|
|
84
|
-
"@itwin/ecschema-locaters": "5.12.0-dev.
|
|
85
|
-
"@itwin/core-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
80
|
+
"@itwin/build-tools": "5.12.0-dev.5",
|
|
81
|
+
"@itwin/core-geometry": "5.12.0-dev.5",
|
|
82
|
+
"@itwin/core-common": "5.12.0-dev.5",
|
|
83
|
+
"@itwin/ecsql-common": "5.12.0-dev.5",
|
|
84
|
+
"@itwin/ecschema-locaters": "5.12.0-dev.5",
|
|
85
|
+
"@itwin/core-bentley": "5.12.0-dev.5",
|
|
86
|
+
"internal-tools": "3.0.0-dev.69",
|
|
87
|
+
"@itwin/ecschema-metadata": "5.12.0-dev.5"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@bentley/imodeljs-native": "5.12.
|
|
90
|
+
"@bentley/imodeljs-native": "5.12.2",
|
|
91
91
|
"@itwin/object-storage-azure": "^3.0.4",
|
|
92
92
|
"@azure/storage-blob": "^12.28.0",
|
|
93
93
|
"form-data": "^4.0.6",
|