@itwin/core-backend 4.3.0-dev.2 → 4.3.0-dev.21
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 +54 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +196 -0
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -0
- package/lib/cjs/ChangesetECAdaptor.js +746 -0
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -0
- package/lib/cjs/ECDb.d.ts +8 -1
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +9 -0
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +5 -5
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +1 -1
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +2 -2
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts +185 -0
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -0
- package/lib/cjs/SqliteChangesetReader.js +217 -0
- package/lib/cjs/SqliteChangesetReader.js.map +1 -0
- package/lib/cjs/core-backend.d.ts +2 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +2 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/package.json +20 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
# Change Log - @itwin/core-backend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 06 Nov 2023 14:03:28 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.2.3
|
|
6
|
+
Mon, 06 Nov 2023 14:01:52 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.2.2
|
|
11
|
+
Thu, 02 Nov 2023 15:36:20 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.2.1
|
|
16
|
+
Tue, 24 Oct 2023 15:09:13 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.2.0
|
|
21
|
+
Tue, 17 Oct 2023 15:14:32 GMT
|
|
22
|
+
|
|
23
|
+
### Updates
|
|
24
|
+
|
|
25
|
+
- Add ECSqlExpr api
|
|
26
|
+
- Add support for schema synchronization
|
|
27
|
+
- Fixed a null reference error when upgrading schemas to EC3
|
|
28
|
+
- Adds logging for checkpoint application and V2 checkpoint downloads
|
|
29
|
+
- add exportGraphics test to verify uv-parameter output
|
|
30
|
+
- ECDb.createQueryReader and IModelDb.createQueryReader are now public
|
|
31
|
+
- restart default txn after 10 minutes inactivity on v2 checkpoints
|
|
32
|
+
- Add TxnManager events raised when applying external txns.
|
|
33
|
+
- Fix RenderMaterialElement using the wrong CodeSpec.
|
|
34
|
+
- Fix two potential bugs when closing and reopening an iModel while pulling changes."
|
|
35
|
+
- Make watching for briefcase changes more reliable.
|
|
36
|
+
- As instance access no longer an experimental feature, removed experimental features option from relevant ecsql.
|
|
37
|
+
- Use instance query to get aspects for abstract classes
|
|
38
|
+
- ViewStore.ViewDb.getViewGroups select statement was referring to ParentId when parent was meant
|
|
39
|
+
- Remove `storageType` from `BlobContainer.RequestTokenProps`.
|
|
40
|
+
- Add 'provider' to 'BlobContainer.CreatedContainerProps'
|
|
41
|
+
- add TileStorage.getCachedTilesGenerator
|
|
42
|
+
|
|
43
|
+
## 4.1.9
|
|
44
|
+
Tue, 10 Oct 2023 18:48:12 GMT
|
|
45
|
+
|
|
46
|
+
_Version update only_
|
|
4
47
|
|
|
5
48
|
## 4.1.8
|
|
6
49
|
Fri, 06 Oct 2023 04:00:18 GMT
|
|
@@ -137,6 +180,16 @@ Mon, 22 May 2023 15:34:14 GMT
|
|
|
137
180
|
- allow passing a custom schema read context to IModelDb.importSchemas
|
|
138
181
|
- Added test to verify Id serialization to hex for system properties.
|
|
139
182
|
|
|
183
|
+
## 3.7.16
|
|
184
|
+
Mon, 16 Oct 2023 12:49:07 GMT
|
|
185
|
+
|
|
186
|
+
_Version update only_
|
|
187
|
+
|
|
188
|
+
## 3.7.15
|
|
189
|
+
Tue, 10 Oct 2023 19:58:35 GMT
|
|
190
|
+
|
|
191
|
+
_Version update only_
|
|
192
|
+
|
|
140
193
|
## 3.7.14
|
|
141
194
|
Fri, 29 Sep 2023 16:57:16 GMT
|
|
142
195
|
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module ECDb
|
|
3
|
+
*/
|
|
4
|
+
import { Id64String, IDisposable } from "@itwin/core-bentley";
|
|
5
|
+
import { SqliteChangeOp, SqliteChangesetReader, SqliteValueStage } from "./SqliteChangesetReader";
|
|
6
|
+
/**
|
|
7
|
+
* Record meta data for the change.
|
|
8
|
+
* @beta
|
|
9
|
+
* */
|
|
10
|
+
export interface ChangeMetaData {
|
|
11
|
+
/** list of tables making up this EC change */
|
|
12
|
+
tables: string[];
|
|
13
|
+
/** full name of the class of this EC change */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** sqlite operation that caused the change */
|
|
16
|
+
op: SqliteChangeOp;
|
|
17
|
+
/** version of the value read from sqlite change */
|
|
18
|
+
stage: SqliteValueStage;
|
|
19
|
+
/** if classId for the change was not found in db then fallback class for the table */
|
|
20
|
+
fallbackClassId?: Id64String;
|
|
21
|
+
/** list of change index making up this change (one per table) */
|
|
22
|
+
changeIndexes: number[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represent EC change derived from low level sqlite change
|
|
26
|
+
* @beta
|
|
27
|
+
*/
|
|
28
|
+
export interface ChangedECInstance {
|
|
29
|
+
ECInstanceId: Id64String;
|
|
30
|
+
ECClassId?: Id64String;
|
|
31
|
+
$meta?: ChangeMetaData;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Combine partial changed instance into single instance.
|
|
36
|
+
* Partial changes is per table and a single instance can
|
|
37
|
+
* span multiple tables.
|
|
38
|
+
* @beta
|
|
39
|
+
*/
|
|
40
|
+
export declare class PartialECChangeUnifier {
|
|
41
|
+
private _cache;
|
|
42
|
+
private _readonly;
|
|
43
|
+
/**
|
|
44
|
+
* Combine partial instance with instance with same key if already exists.
|
|
45
|
+
* @param rhs partial instance
|
|
46
|
+
*/
|
|
47
|
+
private combine;
|
|
48
|
+
/**
|
|
49
|
+
* Build key from EC change.
|
|
50
|
+
* @param change EC change
|
|
51
|
+
* @returns key created from EC change.
|
|
52
|
+
*/
|
|
53
|
+
private static buildKey;
|
|
54
|
+
/**
|
|
55
|
+
* Append partial changes which will be combine using there instance key.
|
|
56
|
+
* @note $meta property must be present on partial change as information
|
|
57
|
+
* in it is used to combine partial instances.
|
|
58
|
+
* @param adaptor changeset adaptor is use to read the partial EC change.
|
|
59
|
+
* @beta
|
|
60
|
+
*/
|
|
61
|
+
appendFrom(adaptor: ChangesetECAdaptor): void;
|
|
62
|
+
/**
|
|
63
|
+
* Delete $meta from all the instances.
|
|
64
|
+
*/
|
|
65
|
+
stripMetaData(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Returns complete EC change instances.
|
|
68
|
+
* @beta
|
|
69
|
+
*/
|
|
70
|
+
get instances(): IterableIterator<ChangedECInstance>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Transform sqlite change to ec change. EC change is partial change as
|
|
74
|
+
* it is per table while a single instance can span multiple table.
|
|
75
|
+
* @note PrimitiveArray and StructArray are not supported types.
|
|
76
|
+
* @beta
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
export declare class ChangesetECAdaptor implements IDisposable {
|
|
80
|
+
readonly reader: SqliteChangesetReader;
|
|
81
|
+
readonly disableMetaData: boolean;
|
|
82
|
+
private readonly _mapCache;
|
|
83
|
+
private readonly _tableFilter;
|
|
84
|
+
private readonly _opFilter;
|
|
85
|
+
private readonly _classFilter;
|
|
86
|
+
private _allowedClasses;
|
|
87
|
+
/**
|
|
88
|
+
* set debug flags
|
|
89
|
+
*/
|
|
90
|
+
readonly debugFlags: {
|
|
91
|
+
replaceBlobWithEllipsis: boolean;
|
|
92
|
+
replaceGeomWithEllipsis: boolean;
|
|
93
|
+
replaceGuidWithEllipsis: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Return partial inserted instance
|
|
97
|
+
* For updates inserted represent new version of instance after update.
|
|
98
|
+
*/
|
|
99
|
+
inserted?: ChangedECInstance;
|
|
100
|
+
/**
|
|
101
|
+
* Return partial deleted instance.
|
|
102
|
+
* For updates deleted represent old version of instance before update.
|
|
103
|
+
*/
|
|
104
|
+
deleted?: ChangedECInstance;
|
|
105
|
+
/**
|
|
106
|
+
* Setup filter that will result in change enumeration restricted to
|
|
107
|
+
* list of tables added by acceptTable().
|
|
108
|
+
* @param table Name of the table
|
|
109
|
+
* @returns Fluent reference to ChangesetAdaptor.
|
|
110
|
+
*/
|
|
111
|
+
acceptTable(table: string): ChangesetECAdaptor;
|
|
112
|
+
/**
|
|
113
|
+
* Setup filter that will result in change enumeration restricted to
|
|
114
|
+
* list of op added by acceptOp().
|
|
115
|
+
* @param op
|
|
116
|
+
* @returns Fluent reference to ChangesetAdaptor.
|
|
117
|
+
*/
|
|
118
|
+
acceptOp(op: SqliteChangeOp): ChangesetECAdaptor;
|
|
119
|
+
/**
|
|
120
|
+
* Setup filter that will result in change enumeration restricted to
|
|
121
|
+
* list of class and its derived classes added by acceptClass().
|
|
122
|
+
* @param classFullName
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
acceptClass(classFullName: string): ChangesetECAdaptor;
|
|
126
|
+
private buildClassFilter;
|
|
127
|
+
/**
|
|
128
|
+
* Construct adaptor with a initialized reader.
|
|
129
|
+
* @note the changeset reader must have disableSchemaCheck
|
|
130
|
+
* set to false and db must also be set.
|
|
131
|
+
* @param reader wrap changeset reader.
|
|
132
|
+
*/
|
|
133
|
+
constructor(reader: SqliteChangesetReader, disableMetaData?: boolean);
|
|
134
|
+
/**
|
|
135
|
+
* dispose current instance and it will also dispose the changeset reader.
|
|
136
|
+
*/
|
|
137
|
+
dispose(): void;
|
|
138
|
+
/**
|
|
139
|
+
* close current instance and it will also close the changeset reader.
|
|
140
|
+
*/
|
|
141
|
+
close(): void;
|
|
142
|
+
/**
|
|
143
|
+
* Convert binary GUID into string GUID.
|
|
144
|
+
* @param binaryGUID binary version of guid.
|
|
145
|
+
* @returns GUID string.
|
|
146
|
+
*/
|
|
147
|
+
private static convertBinaryToGuid;
|
|
148
|
+
/**
|
|
149
|
+
* Set value use access string in a JS object.
|
|
150
|
+
* @param targetObj object that will be updated.
|
|
151
|
+
* @param accessString access string token separated by '.'.
|
|
152
|
+
*/
|
|
153
|
+
private static setValue;
|
|
154
|
+
/**
|
|
155
|
+
* Check if sqlite change table is a EC data table
|
|
156
|
+
* @param tableName name of the table.
|
|
157
|
+
* @returns true if table has EC data.
|
|
158
|
+
*/
|
|
159
|
+
isECTable(tableName: string): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Attempt find ECClassId from ECInstanceId for a change of type 'updated'.
|
|
162
|
+
* @param tableName name of the table to find ECClassId from given ECInstanceId
|
|
163
|
+
* @param instanceId instance id for which we need ECClassId for.
|
|
164
|
+
* @returns if successful returns ECClassId else return undefined.
|
|
165
|
+
*/
|
|
166
|
+
private getClassIdFromDb;
|
|
167
|
+
/** helper method around reader.op */
|
|
168
|
+
get op(): SqliteChangeOp;
|
|
169
|
+
/** Return true if current change is of type "Inserted" */
|
|
170
|
+
get isInserted(): boolean;
|
|
171
|
+
/** Return true if current change is of type "Deleted" */
|
|
172
|
+
get isDeleted(): boolean;
|
|
173
|
+
/** Return true if current change is of type "Updated" */
|
|
174
|
+
get isUpdated(): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Advance reader to next change or a change that meets the filter set in the current adaptor
|
|
177
|
+
* @returns return false if no more changes to read.
|
|
178
|
+
*/
|
|
179
|
+
step(): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Transform nav change column into navigation EC property
|
|
182
|
+
* @param prop navigation property definition.
|
|
183
|
+
* @param change sqlite change.
|
|
184
|
+
* @param out ec instance that will be updated with navigation property.
|
|
185
|
+
*/
|
|
186
|
+
private transformNavigationProperty;
|
|
187
|
+
/**
|
|
188
|
+
* Transform sqlite change into EC change.
|
|
189
|
+
* @param classMap classMap use to deserialize sqlite change into EC change.
|
|
190
|
+
* @param change sqlite change from changeset.
|
|
191
|
+
* @param table table definition of sqlite change provided.
|
|
192
|
+
* @param out EC changeset that will be updated with properties.
|
|
193
|
+
*/
|
|
194
|
+
private transform;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=ChangesetECAdaptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangesetECAdaptor.d.ts","sourceRoot":"","sources":["../../src/ChangesetECAdaptor.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAwB,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAuB,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA+UvH;;;KAGK;AACL,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,EAAE,EAAE,cAAc,CAAC;IACnB,mDAAmD;IACnD,KAAK,EAAE,gBAAgB,CAAC;IACxB,sFAAsF;IACtF,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,iEAAiE;IACjE,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAEhC,YAAY,EAAE,UAAU,CAAC;IAEzB,SAA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