@itwin/core-backend 4.0.0-dev.99 → 4.1.0-dev.2
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/BlobContainerService.d.ts +4 -4
- package/lib/cjs/BlobContainerService.d.ts.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts +1 -28
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +0 -99
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChannelControl.d.ts +13 -1
- package/lib/cjs/ChannelControl.d.ts.map +1 -1
- package/lib/cjs/ChannelControl.js +8 -5
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js +2 -2
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +17 -20
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +1 -0
- package/lib/cjs/CloudSqlite.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/GeoCoordConfig.d.ts.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +4 -6
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +6 -29
- package/lib/cjs/assets/Settings/backend.setting.json5 +2 -8
- package/lib/cjs/workspace/Workspace.d.ts +8 -27
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js +10 -25
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";A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C,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAxGD,oDAwGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAcpC","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 ElementAspects\r\n */\r\n\r\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/** Argument for the `ElementAspect.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnAspectArg {\r\n /** The iModel for the aspect affected by this event. */\r\n iModel: IModelDb;\r\n /** The model for the aspect affected by this event */\r\n model: Id64String;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnAspectPropsArg extends OnAspectArg {\r\n /** The new properties of the aspect affected by this event. */\r\n props: Readonly<ElementAspectProps>;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\r\n * @beta\r\n */\r\nexport interface OnAspectIdArg extends OnAspectArg {\r\n /** The Id of the aspect affected by this event */\r\n aspectId: Id64String;\r\n}\r\n\r\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\r\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\r\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\r\n * @public\r\n */\r\nexport class ElementAspect extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementAspect\"; }\r\n public element: RelatedElement;\r\n\r\n /** @internal */\r\n constructor(props: ElementAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ElementAspectProps {\r\n const val = super.toJSON() as ElementAspectProps;\r\n val.element = this.element;\r\n return val;\r\n }\r\n\r\n /** Called before a new ElementAspect is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after a new ElementAspect was inserted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was updated.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnAspectIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was deleted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnAspectIdArg): void { }\r\n}\r\n\r\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementUniqueAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementUniqueAspect\"; }\r\n}\r\n\r\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementMultiAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementMultiAspect\"; }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class ChannelRootAspect extends ElementUniqueAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ChannelRootAspect\"; }\r\n /** Insert a ChannelRootAspect on the specified element.\r\n * @deprecated in 4.0 use [[ChannelControl.insertChannelSubject]]\r\n */\r\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\r\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\r\n iModel.elements.insertAspect(props);\r\n }\r\n}\r\n\r\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\r\n * @public\r\n */\r\nexport class ExternalSourceAspect extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAspect\"; }\r\n\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n public scope: RelatedElement;\r\n /** The identifier of the object in the source repository. */\r\n public identifier: string;\r\n /** The kind of object within the source repository. */\r\n public kind: string;\r\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n public checksum?: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n public version?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n public jsonProperties?: string;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n public source?: RelatedElement;\r\n\r\n /** @internal */\r\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n this.source = RelatedElement.fromJSON(props.source);\r\n this.identifier = props.identifier;\r\n this.kind = props.kind;\r\n this.checksum = props.checksum;\r\n this.version = props.version;\r\n this.jsonProperties = props.jsonProperties;\r\n }\r\n\r\n /** @deprecated in 3.x. findAllBySource */\r\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n let elementId: Id64String | undefined;\r\n let aspectId: Id64String | undefined;\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n elementId = statement.getValue(0).getId();\r\n aspectId = statement.getValue(1).getId();\r\n }\r\n });\r\n return { elementId, aspectId };\r\n }\r\n\r\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\r\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\r\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\r\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\r\n * Therefore, the result array could have more than one entry with the same elementId.\r\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\r\n * @param iModelDb The iModel to query\r\n * @param scope The scope of the ExternalSourceAspects to find\r\n * @param kind The kind of the ExternalSourceAspects to find\r\n * @param identifier The identifier of the ExternalSourceAspects to find\r\n * @returns the query results\r\n */\r\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ExternalSourceAspectProps {\r\n const val = super.toJSON() as ExternalSourceAspectProps;\r\n val.scope = this.scope;\r\n val.source = this.source;\r\n val.identifier = this.identifier;\r\n val.kind = this.kind;\r\n val.checksum = this.checksum;\r\n val.version = this.version;\r\n val.jsonProperties = this.jsonProperties;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.scope)\r\n referenceIds.addElement(this.scope.id);\r\n referenceIds.addElement(this.element.id);\r\n if (this.source)\r\n referenceIds.addElement(this.source.id);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace ExternalSourceAspect { // eslint-disable-line no-redeclare\r\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\r\n * @public\r\n */\r\n export enum Kind {\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\r\n Element = \"Element\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\r\n Relationship = \"Relationship\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\r\n * @see [[ExternalSourceAspect.scope]]\r\n */\r\n Scope = \"Scope\",\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA+I;AAC/I,qCAAkC;AAGlC,sDAA2D;AA0B3D;;;;GAIG;AACH,MAAa,aAAc,SAAQ,eAAM;IACvC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAG1E,gBAAgB;IAChB,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC,+DAA+D;IACzH,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CAAC;QACjD,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;OAIG;IACO,MAAM,CAAC,QAAQ,CAAC,GAAqB;QAC7C,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa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G,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC;IAEkB,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAxGD,oDAwGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAcpC","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 ElementAspects\r\n */\r\n\r\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/** Argument for the `ElementAspect.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnAspectArg {\r\n /** The iModel for the aspect affected by this event. */\r\n iModel: IModelDb;\r\n /** The model for the aspect affected by this event */\r\n model: Id64String;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnAspectPropsArg extends OnAspectArg {\r\n /** The new properties of the aspect affected by this event. */\r\n props: Readonly<ElementAspectProps>;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\r\n * @beta\r\n */\r\nexport interface OnAspectIdArg extends OnAspectArg {\r\n /** The Id of the aspect affected by this event */\r\n aspectId: Id64String;\r\n}\r\n\r\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\r\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\r\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\r\n * @public\r\n */\r\nexport class ElementAspect extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementAspect\"; }\r\n public element: RelatedElement;\r\n\r\n /** @internal */\r\n constructor(props: ElementAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ElementAspectProps {\r\n const val = super.toJSON() as ElementAspectProps;\r\n val.element = this.element;\r\n return val;\r\n }\r\n\r\n /** Called before a new ElementAspect is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after a new ElementAspect was inserted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was updated.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnAspectIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was deleted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnAspectIdArg): void { }\r\n}\r\n\r\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementUniqueAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementUniqueAspect\"; }\r\n}\r\n\r\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementMultiAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementMultiAspect\"; }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class ChannelRootAspect extends ElementUniqueAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ChannelRootAspect\"; }\r\n /** Insert a ChannelRootAspect on the specified element.\r\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\r\n */\r\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\r\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\r\n iModel.elements.insertAspect(props);\r\n }\r\n}\r\n\r\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\r\n * @public\r\n */\r\nexport class ExternalSourceAspect extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAspect\"; }\r\n\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n public scope: RelatedElement;\r\n /** The identifier of the object in the source repository. */\r\n public identifier: string;\r\n /** The kind of object within the source repository. */\r\n public kind: string;\r\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n public checksum?: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n public version?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n public jsonProperties?: string;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n public source?: RelatedElement;\r\n\r\n /** @internal */\r\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n this.source = RelatedElement.fromJSON(props.source);\r\n this.identifier = props.identifier;\r\n this.kind = props.kind;\r\n this.checksum = props.checksum;\r\n this.version = props.version;\r\n this.jsonProperties = props.jsonProperties;\r\n }\r\n\r\n /** @deprecated in 3.x. findAllBySource */\r\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n let elementId: Id64String | undefined;\r\n let aspectId: Id64String | undefined;\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n elementId = statement.getValue(0).getId();\r\n aspectId = statement.getValue(1).getId();\r\n }\r\n });\r\n return { elementId, aspectId };\r\n }\r\n\r\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\r\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\r\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\r\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\r\n * Therefore, the result array could have more than one entry with the same elementId.\r\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\r\n * @param iModelDb The iModel to query\r\n * @param scope The scope of the ExternalSourceAspects to find\r\n * @param kind The kind of the ExternalSourceAspects to find\r\n * @param identifier The identifier of the ExternalSourceAspects to find\r\n * @returns the query results\r\n */\r\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ExternalSourceAspectProps {\r\n const val = super.toJSON() as ExternalSourceAspectProps;\r\n val.scope = this.scope;\r\n val.source = this.source;\r\n val.identifier = this.identifier;\r\n val.kind = this.kind;\r\n val.checksum = this.checksum;\r\n val.version = this.version;\r\n val.jsonProperties = this.jsonProperties;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.scope)\r\n referenceIds.addElement(this.scope.id);\r\n referenceIds.addElement(this.element.id);\r\n if (this.source)\r\n referenceIds.addElement(this.source.id);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace ExternalSourceAspect { // eslint-disable-line no-redeclare\r\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\r\n * @public\r\n */\r\n export enum Kind {\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\r\n Element = \"Element\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\r\n Relationship = \"Relationship\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\r\n * @see [[ExternalSourceAspect.scope]]\r\n */\r\n Scope = \"Scope\",\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUhD;;;GAGG;AACH,qBAAa,cAAc;IACzB,gFAAgF;IAChF,gBAAuB,UAAU,EAAE,WAAW,CAAC,aAAa,EAAE,CAAM;IAEpE,OAAO,CAAC,MAAM,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUhD;;;GAGG;AACH,qBAAa,cAAc;IACzB,gFAAgF;IAChF,gBAAuB,UAAU,EAAE,WAAW,CAAC,aAAa,EAAE,CAAM;IAEpE,OAAO,CAAC,MAAM,CAAC,eAAe;IAyC9B,OAAO,CAAC,MAAM,CAAC,OAAO;IAYtB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;WAC3B,SAAS;WAKT,oBAAoB,IAAI,IAAI;WAO5B,aAAa,CAAC,QAAQ,EAAE,QAAQ;CAI/C"}
|
|
@@ -21,14 +21,12 @@ class GeoCoordConfig {
|
|
|
21
21
|
// override to disable loading GCS data from workspaces
|
|
22
22
|
if (IModelHost_1.IModelHost.appWorkspace.settings.getBoolean("gcs/disableWorkspaces", false))
|
|
23
23
|
return;
|
|
24
|
-
let account;
|
|
25
24
|
let containerProps;
|
|
26
25
|
try {
|
|
27
26
|
const ws = IModelHost_1.IModelHost.appWorkspace;
|
|
28
27
|
const dbProps = ws.resolveDatabase(gcsDbAlias);
|
|
29
28
|
containerProps = ws.resolveContainer(dbProps.containerName);
|
|
30
|
-
|
|
31
|
-
const container = ws.getContainer(containerProps, account);
|
|
29
|
+
const container = ws.getContainer(containerProps);
|
|
32
30
|
const cloudContainer = container.cloudContainer;
|
|
33
31
|
if (!cloudContainer?.isConnected) {
|
|
34
32
|
core_bentley_1.Logger.logError("GeoCoord", `could not load gcs database "${gcsDbAlias}"`);
|
|
@@ -42,14 +40,14 @@ class GeoCoordConfig {
|
|
|
42
40
|
return; // already had this db
|
|
43
41
|
if (IModelHost_1.IModelHost.appWorkspace.settings.getBoolean("gcs/noLocalData", false))
|
|
44
42
|
IModelHost_1.IModelHost.platform.enableLocalGcsFiles(false);
|
|
45
|
-
core_bentley_1.Logger.logInfo(loggerCat, `loaded gcsDb "${gcsDbName}", from "${
|
|
43
|
+
core_bentley_1.Logger.logInfo(loggerCat, `loaded gcsDb "${gcsDbName}", from "${containerProps.baseUri}/${containerProps.containerId}" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);
|
|
46
44
|
if (true === dbProps.prefetch)
|
|
47
45
|
this.prefetches.push(CloudSqlite_1.CloudSqlite.startCloudPrefetch(cloudContainer, gcsDbName));
|
|
48
46
|
}
|
|
49
47
|
catch (e) {
|
|
50
48
|
let msg = `Cannot load GCS workspace (${e.errorNumber}): ${core_bentley_1.BentleyError.getErrorMessage(e)}`;
|
|
51
|
-
if (
|
|
52
|
-
msg += `,container=${
|
|
49
|
+
if (containerProps)
|
|
50
|
+
msg += `,container=${containerProps.baseUri}/${containerProps.containerId}, storage=${containerProps.storageType}, public=${containerProps.isPublic}, cacheDir=${IModelHost_1.IModelHost.cacheDir}`;
|
|
53
51
|
core_bentley_1.Logger.logError(loggerCat, msg);
|
|
54
52
|
}
|
|
55
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoCoordConfig.js","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2D;AAC3D,+CAA4C;AAC5C,6CAA0C;AAI1C,MAAM,SAAS,GAAG,UAAU,CAAC;AAO7B;;;GAGG;AACH,MAAa,cAAc;IAIjB,MAAM,CAAC,eAAe,CAAC,UAAkB;QAC/C,uDAAuD;QACvD,IAAI,uBAAU,CAA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AO,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;QAC/B,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,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;;AAxED,gFAAgF;AACzD,yBAAU,GAAgC,EAAE,CAAC;AAuDrD,gCAAiB,GAAG,KAAK,CAAC;AAzD9B,wCAAc","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\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\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/**\r\n * Internal class to configure and load the gcs workspaces for an iModel.\r\n * @internal\r\n */\r\nexport class GeoCoordConfig {\r\n /** array of cloud prefetch tasks that may be awaited to permit offline usage */\r\n public static readonly prefetches: CloudSqlite.CloudPrefetch[] = [];\r\n\r\n private static addGcsWorkspace(gcsDbAlias: string) {\r\n // override to disable loading GCS data from workspaces\r\n if (IModelHost.appWorkspace.settings.getBoolean(\"gcs/disableWorkspaces\", false))\r\n return;\r\n\r\n let containerProps: WorkspaceContainer.Props | undefined;\r\n try {\r\n const ws = IModelHost.appWorkspace;\r\n const dbProps = ws.resolveDatabase(gcsDbAlias) as GcsDbProps;\r\n containerProps = ws.resolveContainer(dbProps.containerName);\r\n const container = ws.getContainer(containerProps);\r\n const cloudContainer = container.cloudContainer;\r\n if (!cloudContainer?.isConnected) {\r\n Logger.logError(\"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 \"${containerProps.baseUri}/${containerProps.containerId}\" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);\r\n\r\n if (true === dbProps.prefetch)\r\n this.prefetches.push(CloudSqlite.startCloudPrefetch(cloudContainer, gcsDbName));\r\n\r\n } catch (e: any) {\r\n let msg = `Cannot load GCS workspace (${e.errorNumber}): ${BentleyError.getErrorMessage(e)}`;\r\n if (containerProps)\r\n msg += `,container=${containerProps.baseUri}/${containerProps.containerId}, storage=${containerProps.storageType}, public=${containerProps.isPublic}, cacheDir=${IModelHost.cacheDir}`;\r\n Logger.logError(loggerCat, msg);\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 this.prefetches.length = 0;\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"]}
|
|
@@ -6,33 +6,6 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"groupName": "cloud",
|
|
8
8
|
"properties": {
|
|
9
|
-
"cloud/accounts": {
|
|
10
|
-
"type": "array",
|
|
11
|
-
"description": "array of cloud accounts",
|
|
12
|
-
"cumulative": true,
|
|
13
|
-
"items": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"required": [
|
|
16
|
-
"name",
|
|
17
|
-
"accessName",
|
|
18
|
-
"storageType"
|
|
19
|
-
],
|
|
20
|
-
"properties": {
|
|
21
|
-
"name": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"description": "the alias name of the cloud account used in `cloud/container.containerId` values"
|
|
24
|
-
},
|
|
25
|
-
"accessName": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "the accessName for the cloud account"
|
|
28
|
-
},
|
|
29
|
-
"storageType": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "the storageType of the cloud account"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
9
|
"cloud/containers": {
|
|
37
10
|
"type": "array",
|
|
38
11
|
"description": "array of cloud containers",
|
|
@@ -48,13 +21,17 @@
|
|
|
48
21
|
"type": "string",
|
|
49
22
|
"description": "the alias name of this cloud container"
|
|
50
23
|
},
|
|
24
|
+
"baseUri": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "the baseUri for the container, without trailing slash (e.g., https://myAcct.blob.core.windows.net)"
|
|
27
|
+
},
|
|
51
28
|
"containerId": {
|
|
52
29
|
"type": "string",
|
|
53
30
|
"description": "the containerId of this cloud container"
|
|
54
31
|
},
|
|
55
|
-
"
|
|
32
|
+
"storageType": {
|
|
56
33
|
"type": "string",
|
|
57
|
-
"description": "
|
|
34
|
+
"description": "one of: 'azure', 'aws', 'google'"
|
|
58
35
|
},
|
|
59
36
|
"isPublic": {
|
|
60
37
|
"type": "boolean",
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"cloud/accounts": [
|
|
3
|
-
{
|
|
4
|
-
"name": "gcs/account",
|
|
5
|
-
"accessName": "https://geocoord-workspace.itwinjs.org",
|
|
6
|
-
"storageType": "azure?customuri=1&sas=1"
|
|
7
|
-
}
|
|
8
|
-
],
|
|
9
2
|
"cloud/containers": [
|
|
10
3
|
{
|
|
11
4
|
"name": "gcs/container",
|
|
12
|
-
"
|
|
5
|
+
"baseUri": "https://geocoord-workspace.itwinjs.org",
|
|
6
|
+
"storageType": "azure",
|
|
13
7
|
"containerId": "gcs",
|
|
14
8
|
"isPublic": true
|
|
15
9
|
}
|
|
@@ -14,19 +14,6 @@ export declare const WorkspaceSetting: {
|
|
|
14
14
|
Containers: string;
|
|
15
15
|
Databases: string;
|
|
16
16
|
};
|
|
17
|
-
/** Types used to identify cloud accounts for Workspaces.
|
|
18
|
-
* @beta
|
|
19
|
-
*/
|
|
20
|
-
export declare namespace WorkspaceAccount {
|
|
21
|
-
/** The name of a WorkspaceAccount in a "cloud/accounts" setting. */
|
|
22
|
-
type Name = string;
|
|
23
|
-
/** A member named `accountName` that specifies by an entry in a "cloud/accounts" setting */
|
|
24
|
-
interface Alias {
|
|
25
|
-
accountName: string;
|
|
26
|
-
}
|
|
27
|
-
/** The properties of a cloud account required to open containers with CloudSqlite. Usually supplied via a "cloud/accounts" setting. */
|
|
28
|
-
type Props = CloudSqlite.AccountAccessProps;
|
|
29
|
-
}
|
|
30
17
|
/** @beta */
|
|
31
18
|
export declare namespace WorkspaceContainer {
|
|
32
19
|
/** The name of a WorkspaceContainer in a "cloud/containers" setting. */
|
|
@@ -45,17 +32,14 @@ export declare namespace WorkspaceContainer {
|
|
|
45
32
|
}
|
|
46
33
|
/** Properties that specify a WorkspaceContainer. */
|
|
47
34
|
interface Props extends Optional<CloudSqlite.ContainerProps, "accessToken"> {
|
|
48
|
-
/** true if the container is public (doesn't require authentication) */
|
|
49
|
-
isPublic?: boolean;
|
|
50
35
|
/** attempt to synchronize (i.e. call `checkForChanges`) this cloud container whenever it is connected to a cloud cache. Default=true */
|
|
51
36
|
syncOnConnect?: boolean;
|
|
52
37
|
}
|
|
53
38
|
/** A function to supply an [AccessToken]($bentley) for a `WorkspaceContainer`.
|
|
54
39
|
* @param props The properties of the WorkspaceContainer necessary to obtain the access token
|
|
55
|
-
* @param account The properties of the account for the container
|
|
56
40
|
* @returns a Promise that resolves to the AccessToken for the container.
|
|
57
41
|
*/
|
|
58
|
-
type TokenFunc = (props: Props
|
|
42
|
+
type TokenFunc = (props: Props) => Promise<AccessToken>;
|
|
59
43
|
}
|
|
60
44
|
/** @beta */
|
|
61
45
|
export declare namespace WorkspaceDb {
|
|
@@ -192,18 +176,16 @@ export interface Workspace {
|
|
|
192
176
|
* Otherwise it is created.
|
|
193
177
|
* @param account If present, the properties for this container if it is to be opened from the cloud. If not present, the container is just a local directory.
|
|
194
178
|
*/
|
|
195
|
-
getContainer(props: WorkspaceContainer.Props
|
|
196
|
-
/** get the properties for the supplied account name by searching for an entry with that name in a `cloud/accounts` setting. */
|
|
197
|
-
resolveAccount(accountName: WorkspaceAccount.Name): WorkspaceAccount.Props;
|
|
179
|
+
getContainer(props: WorkspaceContainer.Props): WorkspaceContainer;
|
|
198
180
|
/** get the properties for the supplied container name by searching for an entry with that name in a `cloud/containers` setting. */
|
|
199
|
-
resolveContainer(containerName: WorkspaceContainer.Name): WorkspaceContainer.Props
|
|
181
|
+
resolveContainer(containerName: WorkspaceContainer.Name): WorkspaceContainer.Props;
|
|
200
182
|
/** get the properties for the supplied workspace database name by searching for an entry with that name in a `workspace/databases` setting. */
|
|
201
183
|
resolveDatabase(databaseAlias: WorkspaceDb.Name): WorkspaceDb.Props & WorkspaceContainer.Alias;
|
|
202
184
|
/**
|
|
203
185
|
* Get an opened [[WorkspaceDb]]. If the WorkspaceDb is present but not open, it is opened first.
|
|
204
186
|
* If `cloudProps` are supplied, a CloudContainer will be used to open the WorkspaceDb.
|
|
205
187
|
*/
|
|
206
|
-
getWorkspaceDbFromProps(dbProps: WorkspaceDb.Props, containerProps: WorkspaceContainer.Props
|
|
188
|
+
getWorkspaceDbFromProps(dbProps: WorkspaceDb.Props, containerProps: WorkspaceContainer.Props): WorkspaceDb;
|
|
207
189
|
/** Get an opened [[WorkspaceDb]] from a WorkspaceDb alias.
|
|
208
190
|
* @param dbAlias the database alias, resolved via [[resolveDatabase]].
|
|
209
191
|
* @param tokenFunc optional function to obtain an AccessToken for the resolved WorkspaceContainer. This function will only be called the first
|
|
@@ -255,13 +237,12 @@ export declare class ITwinWorkspace implements Workspace {
|
|
|
255
237
|
constructor(settings: Settings, opts?: WorkspaceOpts);
|
|
256
238
|
addContainer(toAdd: ITwinWorkspaceContainer): void;
|
|
257
239
|
findContainer(containerId: WorkspaceContainer.Id): ITwinWorkspaceContainer | undefined;
|
|
258
|
-
getContainer(props: WorkspaceContainer.Props
|
|
259
|
-
getWorkspaceDbFromProps(dbProps: WorkspaceDb.Props, containerProps: WorkspaceContainer.Props
|
|
240
|
+
getContainer(props: WorkspaceContainer.Props): WorkspaceContainer;
|
|
241
|
+
getWorkspaceDbFromProps(dbProps: WorkspaceDb.Props, containerProps: WorkspaceContainer.Props): WorkspaceDb;
|
|
260
242
|
getWorkspaceDb(dbAlias: string, tokenFunc?: WorkspaceContainer.TokenFunc): Promise<WorkspaceDb>;
|
|
261
243
|
loadSettingsDictionary(settingRsc: WorkspaceResource.Name, db: WorkspaceDb, priority: SettingsPriority): void;
|
|
262
244
|
close(): void;
|
|
263
|
-
|
|
264
|
-
resolveContainer(containerName: string): WorkspaceContainer.Props & WorkspaceAccount.Alias;
|
|
245
|
+
resolveContainer(containerName: string): WorkspaceContainer.Props;
|
|
265
246
|
resolveDatabase(databaseName: string): WorkspaceDb.Props & WorkspaceContainer.Alias;
|
|
266
247
|
}
|
|
267
248
|
/** @internal */
|
|
@@ -280,7 +261,7 @@ export declare class ITwinWorkspaceContainer implements WorkspaceContainer {
|
|
|
280
261
|
*/
|
|
281
262
|
private static validateContainerId;
|
|
282
263
|
static validateDbName(dbName: WorkspaceDb.DbName): void;
|
|
283
|
-
constructor(workspace: ITwinWorkspace, props: WorkspaceContainer.Props
|
|
264
|
+
constructor(workspace: ITwinWorkspace, props: WorkspaceContainer.Props);
|
|
284
265
|
static validateVersion(version?: WorkspaceDb.Version): string;
|
|
285
266
|
static parseDbFileName(dbFileName: WorkspaceDb.DbFullName): {
|
|
286
267
|
dbName: WorkspaceDb.DbName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspace.d.ts","sourceRoot":"","sources":["../../../src/workspace/Workspace.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAsB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAe,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,gB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I;IAI1D;;;OAGG;IACI,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;IAMtE;;;;OAIG;IACI,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;IAKzE;;OAEG;IACI,aAAa,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM;IAStE,8BAA8B;IACvB,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,GAAG,IAAI;IAIxD;;;;;;OAMG;IACI,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAQrG;;;;OAIG;IACI,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,aAAa,GAAG,IAAI;IAKtF,8BAA8B;IACvB,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,GAAG,IAAI;CAQzD"}
|
|
@@ -55,21 +55,20 @@ class ITwinWorkspace {
|
|
|
55
55
|
findContainer(containerId) {
|
|
56
56
|
return this._containers.get(containerId);
|
|
57
57
|
}
|
|
58
|
-
getContainer(props
|
|
59
|
-
return this.findContainer(props.containerId) ?? new ITwinWorkspaceContainer(this, props
|
|
58
|
+
getContainer(props) {
|
|
59
|
+
return this.findContainer(props.containerId) ?? new ITwinWorkspaceContainer(this, props);
|
|
60
60
|
}
|
|
61
|
-
getWorkspaceDbFromProps(dbProps, containerProps
|
|
62
|
-
return this.getContainer(containerProps
|
|
61
|
+
getWorkspaceDbFromProps(dbProps, containerProps) {
|
|
62
|
+
return this.getContainer(containerProps).getWorkspaceDb(dbProps);
|
|
63
63
|
}
|
|
64
64
|
async getWorkspaceDb(dbAlias, tokenFunc) {
|
|
65
65
|
const dbProps = this.resolveDatabase(dbAlias);
|
|
66
66
|
const containerProps = this.resolveContainer(dbProps.containerName);
|
|
67
|
-
const account = containerProps.accountName !== "" ? this.resolveAccount(containerProps.accountName) : undefined;
|
|
68
67
|
let container = this.findContainer(containerProps.containerId);
|
|
69
68
|
if (undefined === container) {
|
|
70
|
-
if (tokenFunc
|
|
71
|
-
containerProps.accessToken = await tokenFunc(containerProps
|
|
72
|
-
container = this.getContainer(containerProps
|
|
69
|
+
if (tokenFunc)
|
|
70
|
+
containerProps.accessToken = await tokenFunc(containerProps);
|
|
71
|
+
container = this.getContainer(containerProps);
|
|
73
72
|
}
|
|
74
73
|
return container?.getWorkspaceDb(dbProps);
|
|
75
74
|
}
|
|
@@ -85,20 +84,6 @@ class ITwinWorkspace {
|
|
|
85
84
|
container.close();
|
|
86
85
|
this._containers.clear();
|
|
87
86
|
}
|
|
88
|
-
resolveAccount(accountName) {
|
|
89
|
-
const resolved = this.settings.resolveSetting(exports.WorkspaceSetting.Accounts, (val) => {
|
|
90
|
-
if (Array.isArray(val)) {
|
|
91
|
-
for (const entry of val) {
|
|
92
|
-
if (typeof entry === "object" && entry.name === accountName)
|
|
93
|
-
return SettingsSchemas_1.SettingsSchemas.validateArrayObject(entry, exports.WorkspaceSetting.Accounts, accountName);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return undefined; // keep going through all settings dictionaries
|
|
97
|
-
});
|
|
98
|
-
if (resolved === undefined)
|
|
99
|
-
throw new Error(`no setting "${exports.WorkspaceSetting.Accounts}" entry for "${accountName}"`);
|
|
100
|
-
return resolved;
|
|
101
|
-
}
|
|
102
87
|
resolveContainer(containerName) {
|
|
103
88
|
const resolved = this.settings.resolveSetting(exports.WorkspaceSetting.Containers, (val) => {
|
|
104
89
|
if (Array.isArray(val)) {
|
|
@@ -150,13 +135,13 @@ class ITwinWorkspaceContainer {
|
|
|
150
135
|
throw new Error(`invalid dbName: [${dbName}]`);
|
|
151
136
|
this.noLeadingOrTrailingSpaces(dbName, "dbName");
|
|
152
137
|
}
|
|
153
|
-
constructor(workspace, props
|
|
138
|
+
constructor(workspace, props) {
|
|
154
139
|
this._wsDbs = new Map();
|
|
155
140
|
ITwinWorkspaceContainer.validateContainerId(props.containerId);
|
|
156
141
|
this.workspace = workspace;
|
|
157
142
|
this.id = props.containerId;
|
|
158
|
-
if (
|
|
159
|
-
this.cloudContainer = CloudSqlite_1.CloudSqlite.createCloudContainer({ accessToken: "", ...props
|
|
143
|
+
if (props.baseUri !== "")
|
|
144
|
+
this.cloudContainer = CloudSqlite_1.CloudSqlite.createCloudContainer({ accessToken: "", ...props });
|
|
160
145
|
workspace.addContainer(this);
|
|
161
146
|
this.filesDir = (0, path_1.join)(this.dirName, "Files");
|
|
162
147
|
const cloudContainer = this.cloudContainer;
|