@itwin/core-common 3.4.0-dev.9 → 3.5.0-dev.11
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 +33 -1
- package/lib/cjs/Camera.d.ts.map +1 -1
- package/lib/cjs/Camera.js +7 -3
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/CloudStorage.d.ts +20 -5
- package/lib/cjs/CloudStorage.d.ts.map +1 -1
- package/lib/cjs/CloudStorage.js +13 -3
- package/lib/cjs/CloudStorage.js.map +1 -1
- package/lib/cjs/CloudStorageTileCache.d.ts +4 -1
- package/lib/cjs/CloudStorageTileCache.d.ts.map +1 -1
- package/lib/cjs/CloudStorageTileCache.js +5 -1
- package/lib/cjs/CloudStorageTileCache.js.map +1 -1
- package/lib/cjs/Code.d.ts +10 -4
- package/lib/cjs/Code.d.ts.map +1 -1
- package/lib/cjs/Code.js +6 -2
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorDef.d.ts.map +1 -1
- package/lib/cjs/ColorDef.js +2 -0
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +56 -14
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.d.ts +21 -0
- package/lib/cjs/ContextRealityModel.d.ts.map +1 -1
- package/lib/cjs/ContextRealityModel.js +33 -0
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.d.ts +32 -0
- package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +30 -0
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.d.ts +40 -0
- package/lib/cjs/ECSchemaProps.d.ts.map +1 -0
- package/lib/cjs/ECSchemaProps.js +10 -0
- package/lib/cjs/ECSchemaProps.js.map +1 -0
- package/lib/cjs/ElementProps.d.ts +6 -0
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/FeatureGates.d.ts.map +1 -1
- package/lib/cjs/FeatureGates.js +6 -2
- package/lib/cjs/FeatureGates.js.map +1 -1
- package/lib/cjs/FeatureIndex.d.ts.map +1 -1
- package/lib/cjs/FeatureIndex.js +5 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/Fonts.d.ts.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.d.ts.map +1 -1
- package/lib/cjs/Frustum.js +55 -21
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/Gradient.d.ts +18 -2
- package/lib/cjs/Gradient.d.ts.map +1 -1
- package/lib/cjs/Gradient.js +29 -18
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/IModel.d.ts +4 -0
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js +8 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/Image.d.ts.map +1 -1
- package/lib/cjs/Image.js +3 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/Localization.d.ts +4 -5
- package/lib/cjs/Localization.d.ts.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/QPoint.d.ts +185 -5
- package/lib/cjs/QPoint.d.ts.map +1 -1
- package/lib/cjs/QPoint.js +204 -4
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.d.ts +119 -0
- package/lib/cjs/RealityModelDisplaySettings.d.ts.map +1 -0
- package/lib/cjs/RealityModelDisplaySettings.js +115 -0
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -0
- package/lib/cjs/Render.d.ts.map +1 -1
- package/lib/cjs/Render.js +11 -3
- package/lib/cjs/Render.js.map +1 -1
- package/lib/cjs/RgbColor.d.ts +9 -1
- package/lib/cjs/RgbColor.d.ts.map +1 -1
- package/lib/cjs/RgbColor.js +12 -2
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.d.ts.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.d.ts +12 -7
- package/lib/cjs/TerrainSettings.d.ts.map +1 -1
- package/lib/cjs/TerrainSettings.js +2 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/ThematicDisplay.d.ts +6 -10
- package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/TileProps.d.ts +5 -0
- package/lib/cjs/TileProps.d.ts.map +1 -1
- package/lib/cjs/TileProps.js +12 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/ViewFlags.d.ts.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/core-common.d.ts +2 -0
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +2 -0
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.d.ts.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js +8 -2
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/TextString.d.ts.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js +10 -3
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts +9 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +12 -2
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.d.ts +3 -1
- package/lib/cjs/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js +4 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +8 -2
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +3 -0
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js +17 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.d.ts.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/Camera.d.ts.map +1 -1
- package/lib/esm/Camera.js +7 -3
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/CloudStorage.d.ts +20 -5
- package/lib/esm/CloudStorage.d.ts.map +1 -1
- package/lib/esm/CloudStorage.js +13 -3
- package/lib/esm/CloudStorage.js.map +1 -1
- package/lib/esm/CloudStorageTileCache.d.ts +4 -1
- package/lib/esm/CloudStorageTileCache.d.ts.map +1 -1
- package/lib/esm/CloudStorageTileCache.js +5 -1
- package/lib/esm/CloudStorageTileCache.js.map +1 -1
- package/lib/esm/Code.d.ts +10 -4
- package/lib/esm/Code.d.ts.map +1 -1
- package/lib/esm/Code.js +6 -2
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorDef.d.ts.map +1 -1
- package/lib/esm/ColorDef.js +2 -0
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js +56 -14
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.d.ts +21 -0
- package/lib/esm/ContextRealityModel.d.ts.map +1 -1
- package/lib/esm/ContextRealityModel.js +33 -0
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.d.ts +32 -0
- package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +30 -0
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.d.ts +40 -0
- package/lib/esm/ECSchemaProps.d.ts.map +1 -0
- package/lib/esm/ECSchemaProps.js +9 -0
- package/lib/esm/ECSchemaProps.js.map +1 -0
- package/lib/esm/ElementProps.d.ts +6 -0
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/FeatureGates.d.ts.map +1 -1
- package/lib/esm/FeatureGates.js +6 -2
- package/lib/esm/FeatureGates.js.map +1 -1
- package/lib/esm/FeatureIndex.d.ts.map +1 -1
- package/lib/esm/FeatureIndex.js +5 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/Fonts.d.ts.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.d.ts.map +1 -1
- package/lib/esm/Frustum.js +55 -21
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/Gradient.d.ts +18 -2
- package/lib/esm/Gradient.d.ts.map +1 -1
- package/lib/esm/Gradient.js +29 -18
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/IModel.d.ts +4 -0
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js +8 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/Image.d.ts.map +1 -1
- package/lib/esm/Image.js +3 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/Localization.d.ts +4 -5
- package/lib/esm/Localization.d.ts.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/QPoint.d.ts +185 -5
- package/lib/esm/QPoint.d.ts.map +1 -1
- package/lib/esm/QPoint.js +203 -5
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.d.ts +119 -0
- package/lib/esm/RealityModelDisplaySettings.d.ts.map +1 -0
- package/lib/esm/RealityModelDisplaySettings.js +110 -0
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -0
- package/lib/esm/Render.d.ts.map +1 -1
- package/lib/esm/Render.js +11 -3
- package/lib/esm/Render.js.map +1 -1
- package/lib/esm/RgbColor.d.ts +9 -1
- package/lib/esm/RgbColor.d.ts.map +1 -1
- package/lib/esm/RgbColor.js +12 -2
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/SubCategoryOverride.d.ts.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.d.ts +12 -7
- package/lib/esm/TerrainSettings.d.ts.map +1 -1
- package/lib/esm/TerrainSettings.js +2 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/ThematicDisplay.d.ts +6 -10
- package/lib/esm/ThematicDisplay.d.ts.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/TileProps.d.ts +5 -0
- package/lib/esm/TileProps.d.ts.map +1 -1
- package/lib/esm/TileProps.js +10 -0
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/ViewFlags.d.ts.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/core-common.d.ts +2 -0
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +2 -0
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.d.ts.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js +8 -2
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/TextString.d.ts.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js +10 -3
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts +9 -1
- package/lib/esm/rpc/IModelTileRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +12 -2
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.d.ts +3 -1
- package/lib/esm/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js +4 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +8 -2
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +3 -0
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js +17 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.d.ts.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/package.json +9 -8
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module CloudStorage
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @beta
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
5
8
|
export declare enum CloudStorageProvider {
|
|
6
9
|
Azure = 0,
|
|
7
10
|
Amazon = 1,
|
|
@@ -9,13 +12,19 @@ export declare enum CloudStorageProvider {
|
|
|
9
12
|
External = 3,
|
|
10
13
|
Unknown = 4
|
|
11
14
|
}
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @beta
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
13
19
|
export interface CloudStorageContainerDescriptor {
|
|
14
20
|
provider?: CloudStorageProvider;
|
|
15
21
|
name: string;
|
|
16
22
|
resource?: string;
|
|
17
23
|
}
|
|
18
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @beta
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
19
28
|
export interface CloudStorageContainerUrl {
|
|
20
29
|
descriptor: CloudStorageContainerDescriptor;
|
|
21
30
|
valid: number;
|
|
@@ -25,11 +34,17 @@ export interface CloudStorageContainerUrl {
|
|
|
25
34
|
headers?: Record<string, string>;
|
|
26
35
|
bound?: boolean;
|
|
27
36
|
}
|
|
28
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @beta
|
|
39
|
+
* @deprecated
|
|
40
|
+
*/
|
|
29
41
|
export declare namespace CloudStorageContainerUrl {
|
|
30
42
|
function empty(): CloudStorageContainerUrl;
|
|
31
43
|
}
|
|
32
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* @beta
|
|
46
|
+
* @deprecated
|
|
47
|
+
*/
|
|
33
48
|
export declare abstract class CloudStorageCache<TContentId, TContentType> {
|
|
34
49
|
private _containers;
|
|
35
50
|
provider: CloudStorageProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudStorage.d.ts","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"CloudStorage.d.ts","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH;;;GAGG;AACH,oBAAY,oBAAoB;IAC9B,KAAK,IAAA;IACL,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,OAAO,IAAA;CACR;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,+BAA+B,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,yBAAiB,wBAAwB,CAAC;IACxC,SAAgB,KAAK,IAAI,wBAAwB,CAOhD;CACF;AAED;;;GAGG;AACH,8BAAsB,iBAAiB,CAAC,UAAU,EAAE,YAAY;IAC9D,OAAO,CAAC,WAAW,CAAwC;IAEpD,QAAQ,EAAE,oBAAoB,CAAgC;aACrD,iBAAiB,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;aACzC,gBAAgB,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;IACxD,SAAS,CAAC,gBAAgB,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM;IAClD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,+BAA+B,GAAG,OAAO,CAAC,wBAAwB,CAAC;IACrI,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAC7F,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;;IAMrF,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;cAkBxD,eAAe,CAAC,SAAS,EAAE,wBAAwB,EAAE,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAgBvG,OAAO,CAAC,yBAAyB,CAA6D;cAE9E,YAAY,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAmChF"}
|
package/lib/esm/CloudStorage.js
CHANGED
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
* @module CloudStorage
|
|
7
7
|
*/
|
|
8
8
|
import { UnexpectedErrors } from "@itwin/core-bentley";
|
|
9
|
-
|
|
9
|
+
/* eslint-disable deprecation/deprecation */
|
|
10
|
+
/**
|
|
11
|
+
* @beta
|
|
12
|
+
* @deprecated
|
|
13
|
+
*/
|
|
10
14
|
export var CloudStorageProvider;
|
|
11
15
|
(function (CloudStorageProvider) {
|
|
12
16
|
CloudStorageProvider[CloudStorageProvider["Azure"] = 0] = "Azure";
|
|
@@ -15,7 +19,10 @@ export var CloudStorageProvider;
|
|
|
15
19
|
CloudStorageProvider[CloudStorageProvider["External"] = 3] = "External";
|
|
16
20
|
CloudStorageProvider[CloudStorageProvider["Unknown"] = 4] = "Unknown";
|
|
17
21
|
})(CloudStorageProvider || (CloudStorageProvider = {}));
|
|
18
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @beta
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
19
26
|
export var CloudStorageContainerUrl;
|
|
20
27
|
(function (CloudStorageContainerUrl) {
|
|
21
28
|
function empty() {
|
|
@@ -28,7 +35,10 @@ export var CloudStorageContainerUrl;
|
|
|
28
35
|
}
|
|
29
36
|
CloudStorageContainerUrl.empty = empty;
|
|
30
37
|
})(CloudStorageContainerUrl || (CloudStorageContainerUrl = {}));
|
|
31
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @beta
|
|
40
|
+
* @deprecated
|
|
41
|
+
*/
|
|
32
42
|
export class CloudStorageCache {
|
|
33
43
|
constructor() {
|
|
34
44
|
this.provider = CloudStorageProvider.Unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudStorage.js","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,
|
|
1
|
+
{"version":3,"file":"CloudStorage.js","sourceRoot":"","sources":["../../src/CloudStorage.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,4CAA4C;AAE5C;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,o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C,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,GAAG,IAAI,SAAS,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE;YACpF,SAAS,GAAG,SAAS,CAAC;YACtB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,SAAS,EAAE;YACd,IAAI,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtD,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO,GAAG,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;oBAC9C,IAAI;wBACF,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;wBAClE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;wBACrC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC3C,OAAO,CAAC,SAAS,CAAC,CAAC;qBACpB;oBAAC,OAAO,GAAG,EAAE;wBACZ,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC3C,MAAM,CAAC,GAAG,CAAC,CAAC;qBACb;gBACH,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aAClD;YAED,OAAO,OAAO,CAAC;SAChB;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","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 CloudStorage\r\n */\r\n\r\nimport { UnexpectedErrors } from \"@itwin/core-bentley\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport enum CloudStorageProvider {\r\n Azure,\r\n Amazon,\r\n AliCloud,\r\n External,\r\n Unknown,\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport interface CloudStorageContainerDescriptor {\r\n provider?: CloudStorageProvider;\r\n name: string;\r\n resource?: string;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport interface CloudStorageContainerUrl {\r\n descriptor: CloudStorageContainerDescriptor;\r\n valid: number;\r\n expires: number;\r\n url: string;\r\n method?: string;\r\n headers?: Record<string, string>;\r\n bound?: boolean;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport namespace CloudStorageContainerUrl {\r\n export function empty(): CloudStorageContainerUrl {\r\n return {\r\n descriptor: { name: \"\" },\r\n valid: 0,\r\n expires: 0,\r\n url: \"\",\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport abstract class CloudStorageCache<TContentId, TContentType> {\r\n private _containers: Map<string, CloudStorageContainerUrl>;\r\n\r\n public provider: CloudStorageProvider = CloudStorageProvider.Unknown;\r\n public abstract formContainerName(id: TContentId): string;\r\n public abstract formResourceName(id: TContentId): string;\r\n protected formContainerKey(id: TContentId): string { return this.formContainerName(id); }\r\n protected abstract obtainContainerUrl(id: TContentId, descriptor: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl>;\r\n protected abstract instantiateResource(response: Response): Promise<TContentType | undefined>;\r\n protected supplyUrlBase(_container: CloudStorageContainerUrl, _id: TContentId): string | undefined { return undefined; }\r\n\r\n public constructor() {\r\n this._containers = new Map();\r\n }\r\n\r\n public async retrieve(id: TContentId): Promise<TContentType | undefined> {\r\n try {\r\n const container = await this.getContainer(id);\r\n if (!container.url)\r\n return undefined;\r\n\r\n const response = await this.requestResource(container, id);\r\n if (response.ok) {\r\n const content = await this.instantiateResource(response);\r\n return content;\r\n }\r\n } catch (err) {\r\n UnexpectedErrors.handle(err);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n protected async requestResource(container: CloudStorageContainerUrl, id: TContentId): Promise<Response> {\r\n const base = this.supplyUrlBase(container, id);\r\n const url = (undefined === base || \"\" === base) ? new URL(container.url) : new URL(container.url, base);\r\n\r\n if (!container.bound) {\r\n url.pathname += `/${this.formResourceName(id)}`;\r\n }\r\n\r\n const init: RequestInit = {\r\n headers: container.headers,\r\n method: \"GET\",\r\n };\r\n\r\n return fetch(url.toString(), init);\r\n }\r\n\r\n private _pendingContainerRequests: Map<string, Promise<CloudStorageContainerUrl>> = new Map();\r\n\r\n protected async getContainer(id: TContentId): Promise<CloudStorageContainerUrl> {\r\n const now = new Date().getTime();\r\n const name = this.formContainerName(id);\r\n const resource = this.formResourceName(id);\r\n const key = this.formContainerKey(id);\r\n\r\n let container = this._containers.get(key);\r\n if (container && container.url && (container.valid > now || container.expires < now)) {\r\n container = undefined;\r\n this._containers.delete(key);\r\n }\r\n\r\n if (!container) {\r\n let request = this._pendingContainerRequests.get(key);\r\n if (!request) {\r\n request = new Promise(async (resolve, reject) => {\r\n try {\r\n container = await this.obtainContainerUrl(id, { name, resource });\r\n this._containers.set(key, container);\r\n this._pendingContainerRequests.delete(key);\r\n resolve(container);\r\n } catch (err) {\r\n this._pendingContainerRequests.delete(key);\r\n reject(err);\r\n }\r\n });\r\n\r\n this._pendingContainerRequests.set(key, request);\r\n }\r\n\r\n return request;\r\n }\r\n\r\n return container;\r\n }\r\n}\r\n"]}
|
|
@@ -10,7 +10,10 @@ export interface TileContentIdentifier {
|
|
|
10
10
|
contentId: string;
|
|
11
11
|
guid: string | undefined;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @beta
|
|
15
|
+
* @deprecated
|
|
16
|
+
*/
|
|
14
17
|
export declare class CloudStorageTileCache extends CloudStorageCache<TileContentIdentifier, Uint8Array> {
|
|
15
18
|
private static _instance;
|
|
16
19
|
static getCache(): CloudStorageTileCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudStorageTileCache.d.ts","sourceRoot":"","sources":["../../src/CloudStorageTileCache.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"CloudStorageTileCache.d.ts","sourceRoot":"","sources":["../../src/CloudStorageTileCache.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,wBAAwB,EAAwB,MAAM,gBAAgB,CAAC;AACpI,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,YAAY;AACZ,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,cAAc,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,iBAAiB,CAAC,qBAAqB,EAAE,UAAU,CAAC;IAC7F,OAAO,CAAC,MAAM,CAAC,SAAS,CAAwB;WAElC,QAAQ,IAAI,qBAAqB;IAQxC,2BAA2B,CAAC,GAAG,EAAE,+BAA+B,GAAG,IAAI;IAe9E,SAAS;cAIO,kBAAkB,CAAC,EAAE,EAAE,qBAAqB,EAAE,UAAU,EAAE,+BAA+B,GAAG,OAAO,CAAC,wBAAwB,CAAC;cAK7H,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IASjF,iBAAiB,CAAC,EAAE,EAAE,qBAAqB,GAAG,MAAM;IAIpD,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,GAAG,MAAM;cAMvC,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,GAAG,MAAM;CAOvE"}
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module CloudStorage
|
|
7
7
|
*/
|
|
8
|
+
/* eslint-disable deprecation/deprecation */
|
|
8
9
|
import { CloudStorageCache, CloudStorageProvider } from "./CloudStorage";
|
|
9
10
|
import { IModelTileRpcInterface } from "./rpc/IModelTileRpcInterface";
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @beta
|
|
13
|
+
* @deprecated
|
|
14
|
+
*/
|
|
11
15
|
export class CloudStorageTileCache extends CloudStorageCache {
|
|
12
16
|
constructor() {
|
|
13
17
|
super();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudStorageTileCache.js","sourceRoot":"","sources":["../../src/CloudStorageTileCache.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAA6D,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEpI,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAUtE
|
|
1
|
+
{"version":3,"file":"CloudStorageTileCache.js","sourceRoot":"","sources":["../../src/CloudStorageTileCache.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4CAA4C;AAE5C,OAAO,EAAE,iBAAiB,EAA6D,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEpI,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAUtE;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iBAAoD;IA0B7F;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAzBM,MAAM,CAAC,QAAQ;QACpB,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE;YACpC,qBAAqB,CAAC,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;SAC/D;QAED,OAAO,qBAAqB,CAAC,SAAS,CAAC;IACzC,CAAC;IAEM,2BAA2B,CAAC,GAAoC;QACrE,MAAM,MAAM,GAAG,IAAI,I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AAoE;QACrH,OAAO,SAAS,EAAE,CAAC,MAAM,IAAI,OAAO,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;IACzD,CAAC;IAEkB,gBAAgB,CAAC,EAAyB;QAC3D,IAAI,IAAI,CAAC,QAAQ,KAAK,oBAAoB,CAAC,QAAQ,EAAE;YACnD,OAAO,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;SAC/D;QAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;CACF","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 CloudStorage\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\nimport { CloudStorageCache, CloudStorageContainerDescriptor, CloudStorageContainerUrl, CloudStorageProvider } from \"./CloudStorage\";\r\nimport { IModelRpcProps } from \"./IModel\";\r\nimport { IModelTileRpcInterface } from \"./rpc/IModelTileRpcInterface\";\r\n\r\n/** @beta */\r\nexport interface TileContentIdentifier {\r\n tokenProps: IModelRpcProps;\r\n treeId: string;\r\n contentId: string;\r\n guid: string | undefined;\r\n}\r\n\r\n/**\r\n * @beta\r\n * @deprecated\r\n */\r\nexport class CloudStorageTileCache extends CloudStorageCache<TileContentIdentifier, Uint8Array> {\r\n private static _instance: CloudStorageTileCache;\r\n\r\n public static getCache(): CloudStorageTileCache {\r\n if (!CloudStorageTileCache._instance) {\r\n CloudStorageTileCache._instance = new CloudStorageTileCache();\r\n }\r\n\r\n return CloudStorageTileCache._instance;\r\n }\r\n\r\n public supplyExpiryForContainerUrl(_id: CloudStorageContainerDescriptor): Date {\r\n const expiry = new Date();\r\n\r\n const today = new Date().getDay();\r\n const rolloverDay = 6; // saturday\r\n expiry.setHours((rolloverDay - today) * 24);\r\n\r\n expiry.setHours(23);\r\n expiry.setMinutes(59);\r\n expiry.setSeconds(59);\r\n expiry.setMilliseconds(999);\r\n\r\n return expiry;\r\n }\r\n\r\n protected constructor() {\r\n super();\r\n }\r\n\r\n protected async obtainContainerUrl(id: TileContentIdentifier, descriptor: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl> {\r\n const client = IModelTileRpcInterface.getClient();\r\n return client.getTileCacheContainerUrl(id.tokenProps, descriptor);\r\n }\r\n\r\n protected async instantiateResource(response: Response): Promise<Uint8Array | undefined> {\r\n const data = await response.arrayBuffer();\r\n if (!data.byteLength) {\r\n return undefined;\r\n }\r\n\r\n return new Uint8Array(data);\r\n }\r\n\r\n public formContainerName(id: TileContentIdentifier): string {\r\n return `${id.tokenProps.iModelId}`;\r\n }\r\n\r\n public formResourceName(id: TileContentIdentifier): string {\r\n const changesetId = id.tokenProps.changeset?.id || \"first\";\r\n const version = id.guid ? id.guid : changesetId; // NB: id.guid can be null (backend) OR undefined (frontend) here...\r\n return `tiles/${id.treeId}/${version}/${id.contentId}`;\r\n }\r\n\r\n protected override formContainerKey(id: TileContentIdentifier): string {\r\n if (this.provider === CloudStorageProvider.AliCloud) {\r\n return this.formContainerName(id) + this.formResourceName(id);\r\n }\r\n\r\n return super.formContainerKey(id);\r\n }\r\n}\r\n"]}
|
package/lib/esm/Code.d.ts
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { GuidString, Id64String } from "@itwin/core-bentley";
|
|
5
5
|
import { IModel } from "./IModel";
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* The identity of the element defining the scope for a Code value.
|
|
8
|
+
* For query input, may either be an ElementId or a FederationGuid. When returned from a query, it will be an ElementId.
|
|
7
9
|
* @public
|
|
8
10
|
* @extensions
|
|
9
11
|
*/
|
|
@@ -13,18 +15,22 @@ export declare type CodeScopeProps = Id64String | GuidString;
|
|
|
13
15
|
* @extensions
|
|
14
16
|
*/
|
|
15
17
|
export interface CodeProps {
|
|
16
|
-
|
|
18
|
+
/** Either the stringified 64-bit Id of the CodeSpec for this code, or the name of the CodeSpec. */
|
|
19
|
+
spec: Id64String | string;
|
|
20
|
+
/** Either the ElementId or the FederationGuid of the element that provides the scope for this code. */
|
|
17
21
|
scope: CodeScopeProps;
|
|
22
|
+
/** the value of this code. May be undefined. */
|
|
18
23
|
value?: string;
|
|
19
24
|
}
|
|
20
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* A three-part structure containing information about the [Code]($docs/bis/guide/fundamentals/codes) of an Element
|
|
21
27
|
* @public
|
|
22
28
|
*/
|
|
23
29
|
export declare class Code implements CodeProps {
|
|
24
30
|
/** The id of the [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec) of the Element */
|
|
25
31
|
spec: Id64String;
|
|
26
32
|
/** The [CodeScope]($docs/bis/guide/fundamentals/codes.md#codescope-property) of the Element */
|
|
27
|
-
scope:
|
|
33
|
+
scope: Id64String;
|
|
28
34
|
/** The [CodeValue]($docs/bis/guide/fundamentals/codes.md#codevalue-property) of the Element
|
|
29
35
|
* @note Leading and trailing whitespace is invalid so is automatically trimmed.
|
|
30
36
|
*/
|
package/lib/esm/Code.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/Code.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAQ,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/Code.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAQ,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;GAKG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AM,EAAE,MAAM,CAAC;IACtB,+BAA+B;IACxB,EAAE,EAAE,UAAU,CAAC;IACtB,iCAAiC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACI,UAAU,EAAE,GAAG,CAAC;IAEvB;OACG;IACH,OAAO;IAqBP;;;OAGG;WACW,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,aAAa,CAAC,gBAAgB,GAAG,QAAQ;IAItI;;OAEG;WACW,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,QAAQ;IAIrG,wDAAwD;IACxD,IAAW,OAAO,IAAI,OAAO,CAAkC;IAE/D,uCAAuC;IACvC,IAAW,SAAS,IAAI,aAAa,CAAC,IAAI,CAA2C;IACrF,IAAW,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,EAAiD;IAEnG,0MAA0M;IAC1M,IAAW,QAAQ,IAAI,aAAa,CAAC,gBAAgB,CAEpD;IACD,IAAW,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC,gBAAgB,EAKtD;IAED;;OAEG;IACH,IAAW,mBAAmB,IAAI,OAAO,CAKxC;IACD,IAAW,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAK5C;CACF"}
|
package/lib/esm/Code.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @module Codes
|
|
7
7
|
*/
|
|
8
8
|
import { Id64, JsonUtils } from "@itwin/core-bentley";
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A three-part structure containing information about the [Code]($docs/bis/guide/fundamentals/codes) of an Element
|
|
10
11
|
* @public
|
|
11
12
|
*/
|
|
12
13
|
export class Code {
|
|
@@ -21,7 +22,10 @@ export class Code {
|
|
|
21
22
|
get value() { var _a; return (_a = this._value) !== null && _a !== void 0 ? _a : ""; }
|
|
22
23
|
set value(val) { this._value = val === null || val === void 0 ? void 0 : val.trim(); }
|
|
23
24
|
/** Create an empty, non-unique code with no special meaning. */
|
|
24
|
-
static createEmpty() {
|
|
25
|
+
static createEmpty() {
|
|
26
|
+
const id = Id64.fromLocalAndBriefcaseIds(1, 0);
|
|
27
|
+
return new Code({ spec: id, scope: id });
|
|
28
|
+
}
|
|
25
29
|
static fromJSON(json) { return json ? new Code(json) : Code.createEmpty(); }
|
|
26
30
|
toJSON() { return { spec: this.spec, scope: this.scope, value: this.value }; }
|
|
27
31
|
equals(other) { return Code.equalCodes(this, other); }
|
package/lib/esm/Code.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../src/Code.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAmB9E;;GAEG;AACH,MAAM,OAAO,IAAI;IAYf,YAAY,SAAoB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAXD;;OAEG;IACH,IAAW,KAAK,aAAK,OAAO,MAAA,IAAI,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,CAAC;IAChD,IAAW,KAAK,CAAC,GAAW,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAS5D,gEAAgE;IACzD,MAAM,CAAC,WAAW,KAAW,MAAM,EAA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;IAED;;OAEG;IACH,IAAW,mBAAmB;QAC5B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;YACjF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC;SAChD;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAW,mBAAmB,CAAC,KAAc;QAC3C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI;YAAE,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClD,CAAC;CACF","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 Codes\r\n */\r\n\r\nimport { GuidString, Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { IModel } from \"./IModel\";\r\n\r\n/** The props that hold the identity of the object defining the uniqueness scope for a set of Code values.\r\n * @public\r\n * @extensions\r\n */\r\nexport type CodeScopeProps = Id64String | GuidString;\r\n\r\n/** The wire format for a Code\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CodeProps {\r\n spec: Id64String;\r\n scope: CodeScopeProps;\r\n value?: string;\r\n}\r\n\r\n/** A three-part structure containing information about the [Code]($docs/bis/guide/fundamentals/codes) of an Element\r\n * @public\r\n */\r\nexport class Code implements CodeProps {\r\n /** The id of the [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec) of the Element */\r\n public spec: Id64String;\r\n /** The [CodeScope]($docs/bis/guide/fundamentals/codes.md#codescope-property) of the Element */\r\n public scope: string;\r\n /** The [CodeValue]($docs/bis/guide/fundamentals/codes.md#codevalue-property) of the Element\r\n * @note Leading and trailing whitespace is invalid so is automatically trimmed.\r\n */\r\n public get value() { return this._value ?? \"\"; }\r\n public set value(val: string) { this._value = val?.trim(); }\r\n private _value?: string;\r\n\r\n constructor(codeProps: CodeProps) {\r\n this.spec = Id64.fromJSON(codeProps.spec);\r\n this.scope = JsonUtils.asString(codeProps.scope);\r\n this.value = JsonUtils.asString(codeProps.value);\r\n }\r\n\r\n /** Create an empty, non-unique code with no special meaning. */\r\n public static createEmpty(): Code { const id: Id64String = Id64.fromLocalAndBriefcaseIds(1, 0); return new Code({ spec: id, scope: id }); }\r\n public static fromJSON(json?: any): Code { return json ? new Code(json) : Code.createEmpty(); }\r\n public toJSON(): CodeProps { return { spec: this.spec, scope: this.scope, value: this.value }; }\r\n public equals(other: Code): boolean { return Code.equalCodes(this, other); }\r\n /** @internal */\r\n public static equalCodes(c1: CodeProps, c2: CodeProps): boolean {\r\n return c1.spec === c2.spec && c1.scope === c2.scope && c1.value === c2.value;\r\n }\r\n /** Determine whether this Code is valid. */\r\n public static isValid(c: CodeProps): boolean { return Id64.isValidId64(c.spec); }\r\n /** Determine if this code is valid but not otherwise meaningful (and therefore not necessarily unique) */\r\n public static isEmpty(c: CodeProps): boolean { return this.isValid(c) && (c.value === undefined || c.value === \"\"); }\r\n}\r\n\r\n/** Names of the internal BIS CodeSpecs. These names match those specified by the native library.\r\n * For other domains, the best practice is to include the domain name or alias as part of the CodeSpec name to ensure global uniqueness.\r\n * @public\r\n* @extensions\r\n* @see [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec)\r\n */\r\nexport enum BisCodeSpec {\r\n /** The name of the standard [[CodeSpec]] used when creating *empty* codes.\r\n * @see [[Code.createEmpty]]\r\n */\r\n nullCodeSpec = \"bis:NullCodeSpec\",\r\n /** @internal */\r\n annotationFrameStyle = \"bis:AnnotationFrameStyle\",\r\n /** @internal */\r\n annotationLeaderStyle = \"bis:AnnotationLeaderStyle\",\r\n /** @internal */\r\n annotationTextStyle = \"bis:AnnotationTextStyle\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem2d]($backend) elements.\r\n * @see [AuxCoordSystem2d.createCode]($backend)\r\n */\r\n auxCoordSystem2d = \"bis:AuxCoordSystem2d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem3d]($backend) elements.\r\n * @see [AuxCoordSystem3d.createCode]($backend)\r\n */\r\n auxCoordSystem3d = \"bis:AuxCoordSystem3d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystemSpatial]($backend) elements.\r\n * @see [AuxCoordSystemSpatial.createCode]($backend)\r\n */\r\n auxCoordSystemSpatial = \"bis:AuxCoordSystemSpatial\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [CategorySelector]($backend) elements.\r\n * @see [CategorySelector.createCode]($backend)\r\n */\r\n categorySelector = \"bis:CategorySelector\",\r\n /** @internal */\r\n colorBook = \"bis:ColorBook\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [DisplayStyle]($backend) elements.\r\n * @see [DisplayStyle.createCode]($backend)\r\n */\r\n displayStyle = \"bis:DisplayStyle\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Drawing]($backend) elements.\r\n * @see [Drawing.createCode]($backend)\r\n */\r\n drawing = \"bis:Drawing\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [DrawingCategory]($backend) elements.\r\n * @see [DrawingCategory.createCode]($backend)\r\n */\r\n drawingCategory = \"bis:DrawingCategory\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSource]($backend) elements.\r\n * @note This CodeSpec is not automatically created, so use [ExternalSource.ensureCodeSpec]($backend) to make sure that it exists.\r\n * @see [ExternalSource.createCode]($backend)\r\n */\r\n externalSource = \"bis:ExternalSource\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSourceAttachment]($backend) elements.\r\n * @note This CodeSpec is not automatically created, so use [ExternalSourceAttachment.ensureCodeSpec]($backend) to make sure that it exists.\r\n * @see [ExternalSource.createCode]($backend)\r\n */\r\n externalSourceAttachment = \"bis:ExternalSourceAttachment\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [GeometryPart]($backend) elements.\r\n * @see [GeometryPart.createCode]($backend)\r\n */\r\n geometryPart = \"bis:GeometryPart\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [GraphicalType2d]($backend) elements.\r\n * @see [GraphicalType2d.createCode]($backend)\r\n */\r\n graphicalType2d = \"bis:GraphicalType2d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [LineStyle]($backend) elements.\r\n * @see [LineStyle.createCode]($backend)\r\n */\r\n lineStyle = \"bis:LineStyle\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [LinkElement]($backend) elements.\r\n * @see [LinkElement.createCode]($backend)\r\n */\r\n linkElement = \"bis:LinkElement\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ModelSelector]($backend) elements.\r\n * @see [ModelSelector.createCode]($backend)\r\n */\r\n modelSelector = \"bis:ModelSelector\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalMaterial]($backend) elements.\r\n * @see [PhysicalMaterial.createCode]($backend)\r\n */\r\n physicalMaterial = \"bis:PhysicalMaterial\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalType]($backend) elements.\r\n * @see [PhysicalType.createCode]($backend)\r\n */\r\n physicalType = \"bis:PhysicalType\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [InformationPartitionElement]($backend) elements.\r\n * @see [InformationPartitionElement.createCode]($backend)\r\n */\r\n informationPartitionElement = \"bis:InformationPartitionElement\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [RenderMaterialElement]($backend) elements.\r\n * @see [RenderMaterialElement.createCode]($backend)\r\n */\r\n renderMaterial = \"bis:RenderMaterial\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Sheet]($backend) elements.\r\n * @see [Sheet.createCode]($backend)\r\n */\r\n sheet = \"bis:Sheet\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialCategory]($backend) elements.\r\n * @see [SpatialCategory.createCode]($backend)\r\n */\r\n spatialCategory = \"bis:SpatialCategory\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialLocationType]($backend) elements.\r\n * @see [SpatialLocationType.createCode]($backend)\r\n */\r\n spatialLocationType = \"bis:SpatialLocationType\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [SubCategory]($backend) elements.\r\n * @see [SubCategory.createCode]($backend)\r\n */\r\n subCategory = \"bis:SubCategory\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Subject]($backend) elements.\r\n * @see [Subject.createCode]($backend)\r\n */\r\n subject = \"bis:Subject\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe2d]($backend) elements.\r\n * @see [TemplateRecipe2d.createCode]($backend)\r\n */\r\n templateRecipe2d = \"bis:TemplateRecipe2d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe3d]($backend) elements.\r\n * @see [TemplateRecipe3d.createCode]($backend)\r\n */\r\n templateRecipe3d = \"bis:TemplateRecipe3d\",\r\n /** @internal */\r\n textAnnotationSeed = \"bis:TextAnnotationSeed\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Texture]($backend) elements.\r\n * @see [Texture.createCode]($backend)\r\n */\r\n texture = \"bis:Texture\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ViewDefinition]($backend) elements.\r\n * @see [ViewDefinition.createCode]($backend)\r\n */\r\n viewDefinition = \"bis:ViewDefinition\",\r\n}\r\n\r\n/** The scope of the Code.\r\n * @public\r\n */\r\nexport namespace CodeScopeSpec {\r\n /** The standard ways the CodeScope can be specified.\r\n * @public\r\n */\r\n export enum Type {\r\n /** The Code value must be unique within (at least) the iModel repository */\r\n Repository = 1,\r\n /** The Code value must be unique within the scope of the Model */\r\n Model = 2,\r\n /** The Code value must be unique among other children of the same parent element */\r\n ParentElement = 3,\r\n /** The Code value must be unique among other elements also scoped by the same element */\r\n RelatedElement = 4,\r\n }\r\n\r\n /** Requirements for how the CodeScope Element is identified.\r\n * @public\r\n */\r\n export enum ScopeRequirement {\r\n /** The Code is required to have a valid ElementId as its scope */\r\n ElementId = 1,\r\n /** The Code is required to have a valid FederationGuid as its scope */\r\n FederationGuid = 2,\r\n }\r\n}\r\n\r\n/** A [Code Specification]($docs/bis/guide/references/glossary#codespec) captures the rules for encoding and decoding significant business information into\r\n * and from a Code (string). This specification is used to generate and validate Codes.\r\n *\r\n * A CodeSpec defines the format of a Code for a certain type of Element in an IModel.\r\n * A CodeSpec can identify an external system that maintains and/or assigns Codes.\r\n * @public\r\n */\r\nexport class CodeSpec {\r\n /** The iModel holding this CodeSpec. */\r\n public iModel: IModel;\r\n /** The id of this CodeSpec. */\r\n public id: Id64String;\r\n /** The name of this CodeSpec. */\r\n public name: string;\r\n /** The JSON properties for this CodeSpec.\r\n * > Note: Use the getters and setters instead of accessing this directly.\r\n * @internal\r\n */\r\n public properties: any;\r\n\r\n /** Internal-only constructor. Proper use is to supply `properties` only or `scopeType` and `scopeReq` but not `properties`.\r\n */\r\n private constructor(iModel: IModel, id: Id64String, name: string, scopeType?: CodeScopeSpec.Type, scopeReq?: CodeScopeSpec.ScopeRequirement, properties?: any) {\r\n this.iModel = iModel;\r\n this.id = id;\r\n this.name = name;\r\n if (properties) {\r\n this.properties = properties;\r\n if (!this.properties.scopeSpec) {\r\n this.properties.scopeSpec = {};\r\n this.scopeType = CodeScopeSpec.Type.Repository;\r\n }\r\n } else {\r\n this.properties = { scopeSpec: {} };\r\n this.scopeType = CodeScopeSpec.Type.Repository;\r\n }\r\n if (undefined !== scopeType) this.scopeType = scopeType;\r\n if (undefined !== scopeReq) this.scopeReq = scopeReq;\r\n }\r\n\r\n /** Create a new CodeSpec from the specified parameters\r\n * > Note: CodeSpec.id will not be valid until inserted\r\n * @see [CodeSpecs.insert]($backend)\r\n */\r\n public static create(iModel: IModel, name: string, scopeType: CodeScopeSpec.Type, scopeReq?: CodeScopeSpec.ScopeRequirement): CodeSpec {\r\n return new CodeSpec(iModel, Id64.invalid, name, scopeType, scopeReq, undefined);\r\n }\r\n\r\n /** Create a new CodeSpec directly from JSON. Used internally by the CodeSpecs.load function.\r\n * @internal\r\n */\r\n public static createFromJson(iModel: IModel, id: Id64String, name: string, properties: any): CodeSpec {\r\n return new CodeSpec(iModel, id, name, undefined, undefined, properties); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Will be true if the id of this CodeSpec is valid. */\r\n public get isValid(): boolean { return Id64.isValid(this.id); }\r\n\r\n /** The scope type of this CodeSpec. */\r\n public get scopeType(): CodeScopeSpec.Type { return this.properties.scopeSpec.type; }\r\n public set scopeType(scopeType: CodeScopeSpec.Type) { this.properties.scopeSpec.type = scopeType; }\r\n\r\n /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or `CodeScopeSpec.ScopeRequirement.ElementId` otherwise (which is the default). */\r\n public get scopeReq(): CodeScopeSpec.ScopeRequirement {\r\n return this.properties.scopeSpec.fGuidRequired ? CodeScopeSpec.ScopeRequirement.FederationGuid : CodeScopeSpec.ScopeRequirement.ElementId;\r\n }\r\n public set scopeReq(req: CodeScopeSpec.ScopeRequirement) {\r\n if (CodeScopeSpec.ScopeRequirement.FederationGuid === req)\r\n this.properties.scopeSpec.fGuidRequired = true;\r\n else\r\n this.properties.scopeSpec.fGuidRequired = undefined;\r\n }\r\n\r\n /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.\r\n * @beta\r\n */\r\n public get isManagedWithIModel(): boolean {\r\n if (this.properties.spec && this.properties.spec.isManagedWithDgnDb !== undefined) {\r\n return this.properties.spec.isManagedWithDgnDb;\r\n }\r\n return true;\r\n }\r\n public set isManagedWithIModel(value: boolean) {\r\n if (!this.properties.spec) this.properties.spec = {};\r\n this.properties.spec.isManagedWithDgnDb = value;\r\n }\r\n}\r\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CAAC;IAClD,CAAC;CACF","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 Codes\r\n */\r\n\r\nimport { GuidString, Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { IModel } from \"./IModel\";\r\n\r\n/**\r\n * The identity of the element defining the scope for a Code value.\r\n * For query input, may either be an ElementId or a FederationGuid. When returned from a query, it will be an ElementId.\r\n * @public\r\n * @extensions\r\n */\r\nexport type CodeScopeProps = Id64String | GuidString;\r\n\r\n/** The wire format for a Code\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CodeProps {\r\n /** Either the stringified 64-bit Id of the CodeSpec for this code, or the name of the CodeSpec. */\r\n spec: Id64String | string;\r\n /** Either the ElementId or the FederationGuid of the element that provides the scope for this code. */\r\n scope: CodeScopeProps;\r\n /** the value of this code. May be undefined. */\r\n value?: string;\r\n}\r\n\r\n/**\r\n * A three-part structure containing information about the [Code]($docs/bis/guide/fundamentals/codes) of an Element\r\n * @public\r\n */\r\nexport class Code implements CodeProps {\r\n /** The id of the [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec) of the Element */\r\n public spec: Id64String;\r\n /** The [CodeScope]($docs/bis/guide/fundamentals/codes.md#codescope-property) of the Element */\r\n public scope: Id64String;\r\n /** The [CodeValue]($docs/bis/guide/fundamentals/codes.md#codevalue-property) of the Element\r\n * @note Leading and trailing whitespace is invalid so is automatically trimmed.\r\n */\r\n public get value() { return this._value ?? \"\"; }\r\n public set value(val: string) { this._value = val?.trim(); }\r\n private _value?: string;\r\n\r\n constructor(codeProps: CodeProps) {\r\n this.spec = Id64.fromJSON(codeProps.spec);\r\n this.scope = JsonUtils.asString(codeProps.scope);\r\n this.value = JsonUtils.asString(codeProps.value);\r\n }\r\n\r\n /** Create an empty, non-unique code with no special meaning. */\r\n public static createEmpty(): Code {\r\n const id = Id64.fromLocalAndBriefcaseIds(1, 0);\r\n return new Code({ spec: id, scope: id });\r\n }\r\n\r\n public static fromJSON(json?: any): Code { return json ? new Code(json) : Code.createEmpty(); }\r\n public toJSON(): CodeProps { return { spec: this.spec, scope: this.scope, value: this.value }; }\r\n public equals(other: Code): boolean { return Code.equalCodes(this, other); }\r\n /** @internal */\r\n public static equalCodes(c1: CodeProps, c2: CodeProps): boolean {\r\n return c1.spec === c2.spec && c1.scope === c2.scope && c1.value === c2.value;\r\n }\r\n /** Determine whether this Code is valid. */\r\n public static isValid(c: CodeProps): boolean { return Id64.isValidId64(c.spec); }\r\n /** Determine if this code is valid but not otherwise meaningful (and therefore not necessarily unique) */\r\n public static isEmpty(c: CodeProps): boolean { return this.isValid(c) && (c.value === undefined || c.value === \"\"); }\r\n}\r\n\r\n/** Names of the internal BIS CodeSpecs. These names match those specified by the native library.\r\n * For other domains, the best practice is to include the domain name or alias as part of the CodeSpec name to ensure global uniqueness.\r\n * @public\r\n* @extensions\r\n* @see [CodeSpec]($docs/bis/guide/fundamentals/codes.md#codespec)\r\n */\r\nexport enum BisCodeSpec {\r\n /** The name of the standard [[CodeSpec]] used when creating *empty* codes.\r\n * @see [[Code.createEmpty]]\r\n */\r\n nullCodeSpec = \"bis:NullCodeSpec\",\r\n /** @internal */\r\n annotationFrameStyle = \"bis:AnnotationFrameStyle\",\r\n /** @internal */\r\n annotationLeaderStyle = \"bis:AnnotationLeaderStyle\",\r\n /** @internal */\r\n annotationTextStyle = \"bis:AnnotationTextStyle\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem2d]($backend) elements.\r\n * @see [AuxCoordSystem2d.createCode]($backend)\r\n */\r\n auxCoordSystem2d = \"bis:AuxCoordSystem2d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystem3d]($backend) elements.\r\n * @see [AuxCoordSystem3d.createCode]($backend)\r\n */\r\n auxCoordSystem3d = \"bis:AuxCoordSystem3d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [AuxCoordSystemSpatial]($backend) elements.\r\n * @see [AuxCoordSystemSpatial.createCode]($backend)\r\n */\r\n auxCoordSystemSpatial = \"bis:AuxCoordSystemSpatial\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [CategorySelector]($backend) elements.\r\n * @see [CategorySelector.createCode]($backend)\r\n */\r\n categorySelector = \"bis:CategorySelector\",\r\n /** @internal */\r\n colorBook = \"bis:ColorBook\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [DisplayStyle]($backend) elements.\r\n * @see [DisplayStyle.createCode]($backend)\r\n */\r\n displayStyle = \"bis:DisplayStyle\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Drawing]($backend) elements.\r\n * @see [Drawing.createCode]($backend)\r\n */\r\n drawing = \"bis:Drawing\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [DrawingCategory]($backend) elements.\r\n * @see [DrawingCategory.createCode]($backend)\r\n */\r\n drawingCategory = \"bis:DrawingCategory\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSource]($backend) elements.\r\n * @note This CodeSpec is not automatically created, so use [ExternalSource.ensureCodeSpec]($backend) to make sure that it exists.\r\n * @see [ExternalSource.createCode]($backend)\r\n */\r\n externalSource = \"bis:ExternalSource\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ExternalSourceAttachment]($backend) elements.\r\n * @note This CodeSpec is not automatically created, so use [ExternalSourceAttachment.ensureCodeSpec]($backend) to make sure that it exists.\r\n * @see [ExternalSource.createCode]($backend)\r\n */\r\n externalSourceAttachment = \"bis:ExternalSourceAttachment\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [GeometryPart]($backend) elements.\r\n * @see [GeometryPart.createCode]($backend)\r\n */\r\n geometryPart = \"bis:GeometryPart\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [GraphicalType2d]($backend) elements.\r\n * @see [GraphicalType2d.createCode]($backend)\r\n */\r\n graphicalType2d = \"bis:GraphicalType2d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [LineStyle]($backend) elements.\r\n * @see [LineStyle.createCode]($backend)\r\n */\r\n lineStyle = \"bis:LineStyle\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [LinkElement]($backend) elements.\r\n * @see [LinkElement.createCode]($backend)\r\n */\r\n linkElement = \"bis:LinkElement\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ModelSelector]($backend) elements.\r\n * @see [ModelSelector.createCode]($backend)\r\n */\r\n modelSelector = \"bis:ModelSelector\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalMaterial]($backend) elements.\r\n * @see [PhysicalMaterial.createCode]($backend)\r\n */\r\n physicalMaterial = \"bis:PhysicalMaterial\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [PhysicalType]($backend) elements.\r\n * @see [PhysicalType.createCode]($backend)\r\n */\r\n physicalType = \"bis:PhysicalType\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [InformationPartitionElement]($backend) elements.\r\n * @see [InformationPartitionElement.createCode]($backend)\r\n */\r\n informationPartitionElement = \"bis:InformationPartitionElement\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [RenderMaterialElement]($backend) elements.\r\n * @see [RenderMaterialElement.createCode]($backend)\r\n */\r\n renderMaterial = \"bis:RenderMaterial\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Sheet]($backend) elements.\r\n * @see [Sheet.createCode]($backend)\r\n */\r\n sheet = \"bis:Sheet\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialCategory]($backend) elements.\r\n * @see [SpatialCategory.createCode]($backend)\r\n */\r\n spatialCategory = \"bis:SpatialCategory\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [SpatialLocationType]($backend) elements.\r\n * @see [SpatialLocationType.createCode]($backend)\r\n */\r\n spatialLocationType = \"bis:SpatialLocationType\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [SubCategory]($backend) elements.\r\n * @see [SubCategory.createCode]($backend)\r\n */\r\n subCategory = \"bis:SubCategory\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Subject]($backend) elements.\r\n * @see [Subject.createCode]($backend)\r\n */\r\n subject = \"bis:Subject\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe2d]($backend) elements.\r\n * @see [TemplateRecipe2d.createCode]($backend)\r\n */\r\n templateRecipe2d = \"bis:TemplateRecipe2d\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [TemplateRecipe3d]($backend) elements.\r\n * @see [TemplateRecipe3d.createCode]($backend)\r\n */\r\n templateRecipe3d = \"bis:TemplateRecipe3d\",\r\n /** @internal */\r\n textAnnotationSeed = \"bis:TextAnnotationSeed\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [Texture]($backend) elements.\r\n * @see [Texture.createCode]($backend)\r\n */\r\n texture = \"bis:Texture\",\r\n /** The name of the standard [[CodeSpec]] used when creating codes for [ViewDefinition]($backend) elements.\r\n * @see [ViewDefinition.createCode]($backend)\r\n */\r\n viewDefinition = \"bis:ViewDefinition\",\r\n}\r\n\r\n/** The scope of the Code.\r\n * @public\r\n */\r\nexport namespace CodeScopeSpec {\r\n /** The standard ways the CodeScope can be specified.\r\n * @public\r\n */\r\n export enum Type {\r\n /** The Code value must be unique within (at least) the iModel repository */\r\n Repository = 1,\r\n /** The Code value must be unique within the scope of the Model */\r\n Model = 2,\r\n /** The Code value must be unique among other children of the same parent element */\r\n ParentElement = 3,\r\n /** The Code value must be unique among other elements also scoped by the same element */\r\n RelatedElement = 4,\r\n }\r\n\r\n /** Requirements for how the CodeScope Element is identified.\r\n * @public\r\n */\r\n export enum ScopeRequirement {\r\n /** The Code is required to have a valid ElementId as its scope */\r\n ElementId = 1,\r\n /** The Code is required to have a valid FederationGuid as its scope */\r\n FederationGuid = 2,\r\n }\r\n}\r\n\r\n/** A [Code Specification]($docs/bis/guide/references/glossary#codespec) captures the rules for encoding and decoding significant business information into\r\n * and from a Code (string). This specification is used to generate and validate Codes.\r\n *\r\n * A CodeSpec defines the format of a Code for a certain type of Element in an IModel.\r\n * A CodeSpec can identify an external system that maintains and/or assigns Codes.\r\n * @public\r\n */\r\nexport class CodeSpec {\r\n /** The iModel holding this CodeSpec. */\r\n public iModel: IModel;\r\n /** The id of this CodeSpec. */\r\n public id: Id64String;\r\n /** The name of this CodeSpec. */\r\n public name: string;\r\n /** The JSON properties for this CodeSpec.\r\n * > Note: Use the getters and setters instead of accessing this directly.\r\n * @internal\r\n */\r\n public properties: any;\r\n\r\n /** Internal-only constructor. Proper use is to supply `properties` only or `scopeType` and `scopeReq` but not `properties`.\r\n */\r\n private constructor(iModel: IModel, id: Id64String, name: string, scopeType?: CodeScopeSpec.Type, scopeReq?: CodeScopeSpec.ScopeRequirement, properties?: any) {\r\n this.iModel = iModel;\r\n this.id = id;\r\n this.name = name;\r\n if (properties) {\r\n this.properties = properties;\r\n if (!this.properties.scopeSpec) {\r\n this.properties.scopeSpec = {};\r\n this.scopeType = CodeScopeSpec.Type.Repository;\r\n }\r\n } else {\r\n this.properties = { scopeSpec: {} };\r\n this.scopeType = CodeScopeSpec.Type.Repository;\r\n }\r\n if (undefined !== scopeType)\r\n this.scopeType = scopeType;\r\n\r\n if (undefined !== scopeReq)\r\n this.scopeReq = scopeReq;\r\n }\r\n\r\n /** Create a new CodeSpec from the specified parameters\r\n * > Note: CodeSpec.id will not be valid until inserted\r\n * @see [CodeSpecs.insert]($backend)\r\n */\r\n public static create(iModel: IModel, name: string, scopeType: CodeScopeSpec.Type, scopeReq?: CodeScopeSpec.ScopeRequirement): CodeSpec {\r\n return new CodeSpec(iModel, Id64.invalid, name, scopeType, scopeReq, undefined);\r\n }\r\n\r\n /** Create a new CodeSpec directly from JSON. Used internally by the CodeSpecs.load function.\r\n * @internal\r\n */\r\n public static createFromJson(iModel: IModel, id: Id64String, name: string, properties: any): CodeSpec {\r\n return new CodeSpec(iModel, id, name, undefined, undefined, properties); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Will be true if the id of this CodeSpec is valid. */\r\n public get isValid(): boolean { return Id64.isValid(this.id); }\r\n\r\n /** The scope type of this CodeSpec. */\r\n public get scopeType(): CodeScopeSpec.Type { return this.properties.scopeSpec.type; }\r\n public set scopeType(scopeType: CodeScopeSpec.Type) { this.properties.scopeSpec.type = scopeType; }\r\n\r\n /** Will be `CodeScopeSpec.ScopeRequirement.FederationGuid` if the scoping element is required to have a FederationGuid or `CodeScopeSpec.ScopeRequirement.ElementId` otherwise (which is the default). */\r\n public get scopeReq(): CodeScopeSpec.ScopeRequirement {\r\n return this.properties.scopeSpec.fGuidRequired ? CodeScopeSpec.ScopeRequirement.FederationGuid : CodeScopeSpec.ScopeRequirement.ElementId;\r\n }\r\n public set scopeReq(req: CodeScopeSpec.ScopeRequirement) {\r\n if (CodeScopeSpec.ScopeRequirement.FederationGuid === req)\r\n this.properties.scopeSpec.fGuidRequired = true;\r\n else\r\n this.properties.scopeSpec.fGuidRequired = undefined;\r\n }\r\n\r\n /** Will be true if the codes associated with this CodeSpec are managed along with the iModel and false if the codes are managed by an external service.\r\n * @beta\r\n */\r\n public get isManagedWithIModel(): boolean {\r\n if (this.properties.spec && this.properties.spec.isManagedWithDgnDb !== undefined) {\r\n return this.properties.spec.isManagedWithDgnDb;\r\n }\r\n return true;\r\n }\r\n public set isManagedWithIModel(value: boolean) {\r\n if (!this.properties.spec)\r\n this.properties.spec = {};\r\n\r\n this.properties.spec.isManagedWithDgnDb = value;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorDef.d.ts","sourceRoot":"","sources":["../../src/ColorDef.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AASpD;;;GAG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IAChB,gBAAuB,IAAI,WAAkC;CAC9D"}
|
package/lib/esm/ColorDef.js
CHANGED
|
@@ -484,6 +484,7 @@ export class ColorDef {
|
|
|
484
484
|
const v = 0xff & Math.floor(dvalue * 255 + 0.5);
|
|
485
485
|
let r = 0, b = 0, g = 0;
|
|
486
486
|
switch (hueIntpart) {
|
|
487
|
+
/* eslint-disable max-statements-per-line */
|
|
487
488
|
case 0:
|
|
488
489
|
r = v;
|
|
489
490
|
g = t;
|
|
@@ -509,6 +510,7 @@ export class ColorDef {
|
|
|
509
510
|
r = v, g = p;
|
|
510
511
|
b = q;
|
|
511
512
|
break; // magenta-ish
|
|
513
|
+
/* eslint-enable max-statements-per-line */
|
|
512
514
|
}
|
|
513
515
|
return ColorDef.from(r, g, b, transparency);
|
|
514
516
|
}
|