@itwin/imodel-transformer 1.0.0-dev.16 → 1.0.0-dev.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/imodel-transformer",
3
- "version": "1.0.0-dev.16",
3
+ "version": "1.0.0-dev.18",
4
4
  "description": "API for exporting an iModel's parts and also importing them into another iModel",
5
5
  "main": "lib/cjs/transformer.js",
6
6
  "typings": "lib/cjs/transformer",
@@ -1,37 +0,0 @@
1
- /** @packageDocumentation
2
- * @module Utils
3
- */
4
- import { EntityReference } from "@itwin/core-common";
5
- import { ConcreteEntity } from "@itwin/core-backend";
6
- import { EntityKey } from "./EntityMap";
7
- /**
8
- * A reference relationships from an element, "referencer", to an element or its submodel, "referenced"
9
- * @internal
10
- */
11
- export interface PendingReference {
12
- referencer: EntityReference;
13
- referenced: EntityReference;
14
- }
15
- export declare namespace PendingReference {
16
- function from(referencer: ConcreteEntity | EntityReference, referenced: ConcreteEntity | EntityReference): PendingReference;
17
- function toKey(props: PendingReference): string;
18
- function fromKey(key: string): PendingReference;
19
- }
20
- /**
21
- * a map that supports using PendingReferences objects as structural keys,
22
- * as well as getting a list of referencers from a referencee (called referenced)
23
- */
24
- export declare class PendingReferenceMap<T> {
25
- private _map;
26
- private _referencedToReferencers;
27
- getReferencers(referenced: ConcreteEntity): Set<EntityReference>;
28
- getReferencersByEntityKey(referenced: EntityKey): Set<EntityReference>;
29
- clear(): void;
30
- delete(ref: PendingReference): boolean;
31
- get(ref: PendingReference): T | undefined;
32
- has(ref: PendingReference): boolean;
33
- set(ref: PendingReference, value: T): this;
34
- get size(): number;
35
- get [Symbol.toStringTag](): string;
36
- }
37
- //# sourceMappingURL=PendingReferenceMap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PendingReferenceMap.d.ts","sourceRoot":"","sources":["../../src/PendingReferenceMap.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAoB,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAa,MAAM,aAAa,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,yBAAiB,gBAAgB,CAAC;IAChC,SAAgB,IAAI,CAClB,UAAU,EAAE,cAAc,GAAG,eAAe,EAC5C,UAAU,EAAE,cAAc,GAAG,eAAe,GAC3C,gBAAgB,CAMlB;IAED,SAAgB,KAAK,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAErD;IAED,SAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAMrD;CACF;AAED;;;GAGG;AACH,qBAAa,mBAAmB,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,wBAAwB,CAAyC;IAElE,cAAc,CAAC,UAAU,EAAE,cAAc,GAAG,GAAG,CAAC,eAAe,CAAC;IAKhE,yBAAyB,CAC9B,UAAU,EAAE,SAAS,GACpB,GAAG,CAAC,eAAe,CAAC;IAUhB,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;IAQtC,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,CAAC,GAAG,SAAS;IAIzC,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;IAInC,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAYjD,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAExC;CACF"}
@@ -1,92 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Utils
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.PendingReferenceMap = exports.PendingReference = void 0;
11
- const core_backend_1 = require("@itwin/core-backend");
12
- const BigMap_1 = require("./BigMap");
13
- const EntityMap_1 = require("./EntityMap");
14
- var PendingReference;
15
- (function (PendingReference) {
16
- function from(referencer, referenced) {
17
- if (typeof referencer !== "string")
18
- referencer = core_backend_1.EntityReferences.from(referencer);
19
- if (typeof referenced !== "string")
20
- referenced = core_backend_1.EntityReferences.from(referenced);
21
- return { referencer, referenced };
22
- }
23
- PendingReference.from = from;
24
- function toKey(props) {
25
- return `${props.referencer}\x00${props.referenced}`;
26
- }
27
- PendingReference.toKey = toKey;
28
- function fromKey(key) {
29
- const [referencer, referenced] = key.split("\x00");
30
- return { referencer, referenced };
31
- }
32
- PendingReference.fromKey = fromKey;
33
- })(PendingReference || (exports.PendingReference = PendingReference = {}));
34
- /**
35
- * a map that supports using PendingReferences objects as structural keys,
36
- * as well as getting a list of referencers from a referencee (called referenced)
37
- */
38
- class PendingReferenceMap {
39
- constructor() {
40
- this._map = new BigMap_1.BigMap();
41
- this._referencedToReferencers = new EntityMap_1.EntityMap();
42
- }
43
- getReferencers(referenced) {
44
- const referencedKey = EntityMap_1.EntityMap.makeKey(referenced);
45
- return this.getReferencersByEntityKey(referencedKey);
46
- }
47
- getReferencersByEntityKey(referenced) {
48
- let referencers = this._referencedToReferencers.getByKey(referenced);
49
- if (referencers === undefined) {
50
- referencers = new Set();
51
- this._referencedToReferencers.setByKey(referenced, referencers);
52
- }
53
- return referencers;
54
- }
55
- /// Map implementation
56
- clear() {
57
- this._map.clear();
58
- }
59
- delete(ref) {
60
- const deleteResult = this._map.delete(PendingReference.toKey(ref));
61
- const referencedKey = ref.referenced;
62
- const referencers = this._referencedToReferencers.getByKey(referencedKey);
63
- if (referencers !== undefined)
64
- referencers.delete(ref.referencer);
65
- return deleteResult;
66
- }
67
- get(ref) {
68
- return this._map.get(PendingReference.toKey(ref));
69
- }
70
- has(ref) {
71
- return this._map.has(PendingReference.toKey(ref));
72
- }
73
- set(ref, value) {
74
- this._map.set(PendingReference.toKey(ref), value);
75
- const referencedKey = ref.referenced;
76
- let referencers = this._referencedToReferencers.getByKey(referencedKey);
77
- if (referencers === undefined) {
78
- referencers = new Set();
79
- this._referencedToReferencers.setByKey(referencedKey, referencers);
80
- }
81
- referencers.add(ref.referencer);
82
- return this;
83
- }
84
- get size() {
85
- return this._map.size;
86
- }
87
- get [Symbol.toStringTag]() {
88
- return "PendingReferenceMap";
89
- }
90
- }
91
- exports.PendingReferenceMap = PendingReferenceMap;
92
- //# sourceMappingURL=PendingReferenceMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PendingReferenceMap.js","sourceRoot":"","sources":["../../src/PendingReferenceMap.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,sDAAuE;AACvE,qCAAkC;AAClC,2CAAmD;AAWnD,IAAiB,gBAAgB,CAuBhC;AAvBD,WAAiB,gBAAgB;IAC/B,SAAgB,IAAI,CAClB,UAA4C,EAC5C,UAA4C;QAE5C,IAAI,OAAO,UAAU,KAAK,QAAQ;YAChC,UAAU,GAAG,+BAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,OAAO,UAAU,KAAK,QAAQ;YAChC,UAAU,GAAG,+BAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,CAAC;IATe,qBAAI,OASnB,CAAA;IAED,SAAgB,KAAK,CAAC,KAAuB;QAC3C,OAAO,GAAG,KAAK,CAAC,UAAU,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IACtD,CAAC;IAFe,sBAAK,QAEpB,CAAA;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;QAC1E,IAAI,WAAW,KAAK,SAAS;YAAE,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAClE,OAAO,YAAY,CAAC;IACtB,CAAC;IAEM,GAAG,CAAC,GAAqB;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;IAEM,GAAG,CAAC,GAAqB;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;IAEM,GAAG,CAAC,GAAqB,EAAE,KAAQ;QACxC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,GAAG,CAAC,UAAU,CAAC;QACrC,IAAI,WAAW,GAAG,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACxE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QACrE,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,IAAW,CAAC,MAAM,CAAC,WAAW,CAAC;QAC7B,OAAO,qBAAqB,CAAC;IAC/B,CAAC;CACF;AA5DD,kDA4DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\nimport { EntityReference } from \"@itwin/core-common\";\nimport { ConcreteEntity, EntityReferences } from \"@itwin/core-backend\";\nimport { BigMap } from \"./BigMap\";\nimport { EntityKey, EntityMap } from \"./EntityMap\";\n\n/**\n * A reference relationships from an element, \"referencer\", to an element or its submodel, \"referenced\"\n * @internal\n */\nexport interface PendingReference {\n referencer: EntityReference;\n referenced: EntityReference;\n}\n\nexport namespace PendingReference {\n export function from(\n referencer: ConcreteEntity | EntityReference,\n referenced: ConcreteEntity | EntityReference\n ): PendingReference {\n if (typeof referencer !== \"string\")\n referencer = EntityReferences.from(referencer);\n if (typeof referenced !== \"string\")\n referenced = EntityReferences.from(referenced);\n return { referencer, referenced };\n }\n\n export function toKey(props: PendingReference): string {\n return `${props.referencer}\\x00${props.referenced}`;\n }\n\n export function fromKey(key: string): PendingReference {\n const [referencer, referenced] = key.split(\"\\x00\") as [\n EntityReference,\n EntityReference,\n ];\n return { referencer, referenced };\n }\n}\n\n/**\n * a map that supports using PendingReferences objects as structural keys,\n * as well as getting a list of referencers from a referencee (called referenced)\n */\nexport class PendingReferenceMap<T> {\n private _map = new BigMap<T>();\n private _referencedToReferencers = new EntityMap<Set<EntityReference>>();\n\n public getReferencers(referenced: ConcreteEntity): Set<EntityReference> {\n const referencedKey = EntityMap.makeKey(referenced);\n return this.getReferencersByEntityKey(referencedKey);\n }\n\n public getReferencersByEntityKey(\n referenced: EntityKey\n ): Set<EntityReference> {\n let referencers = this._referencedToReferencers.getByKey(referenced);\n if (referencers === undefined) {\n referencers = new Set();\n this._referencedToReferencers.setByKey(referenced, referencers);\n }\n return referencers;\n }\n\n /// Map implementation\n public clear(): void {\n this._map.clear();\n }\n\n public delete(ref: PendingReference): boolean {\n const deleteResult = this._map.delete(PendingReference.toKey(ref));\n const referencedKey = ref.referenced;\n const referencers = this._referencedToReferencers.getByKey(referencedKey);\n if (referencers !== undefined) referencers.delete(ref.referencer);\n return deleteResult;\n }\n\n public get(ref: PendingReference): T | undefined {\n return this._map.get(PendingReference.toKey(ref));\n }\n\n public has(ref: PendingReference): boolean {\n return this._map.has(PendingReference.toKey(ref));\n }\n\n public set(ref: PendingReference, value: T): this {\n this._map.set(PendingReference.toKey(ref), value);\n const referencedKey = ref.referenced;\n let referencers = this._referencedToReferencers.getByKey(referencedKey);\n if (referencers === undefined) {\n referencers = new Set();\n this._referencedToReferencers.setByKey(referencedKey, referencers);\n }\n referencers.add(ref.referencer);\n return this;\n }\n\n public get size(): number {\n return this._map.size;\n }\n\n public get [Symbol.toStringTag](): string {\n return \"PendingReferenceMap\";\n }\n}\n"]}