@itwin/ecschema-locaters 3.4.0-dev.9 → 3.5.0-dev.12
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 +24 -1
- package/lib/cjs/SchemaFileLocater.d.ts +82 -82
- package/lib/cjs/SchemaFileLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaFileLocater.js +212 -209
- package/lib/cjs/SchemaFileLocater.js.map +1 -1
- package/lib/cjs/SchemaFileUtility.d.ts +17 -14
- package/lib/cjs/SchemaFileUtility.d.ts.map +1 -1
- package/lib/cjs/SchemaFileUtility.js +48 -45
- package/lib/cjs/SchemaFileUtility.js.map +1 -1
- package/lib/cjs/SchemaJsonFileLocater.d.ts +33 -30
- package/lib/cjs/SchemaJsonFileLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaJsonFileLocater.js +90 -87
- package/lib/cjs/SchemaJsonFileLocater.js.map +1 -1
- package/lib/cjs/SchemaXmlFileLocater.d.ts +33 -30
- package/lib/cjs/SchemaXmlFileLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaXmlFileLocater.js +93 -90
- package/lib/cjs/SchemaXmlFileLocater.js.map +1 -1
- package/lib/cjs/StubSchemaXmlFileLocater.d.ts +69 -69
- package/lib/cjs/StubSchemaXmlFileLocater.d.ts.map +1 -1
- package/lib/cjs/StubSchemaXmlFileLocater.js +177 -174
- package/lib/cjs/StubSchemaXmlFileLocater.js.map +1 -1
- package/lib/cjs/ecschema-locaters.d.ts +17 -4
- package/lib/cjs/ecschema-locaters.d.ts.map +1 -1
- package/lib/cjs/ecschema-locaters.js +33 -20
- package/lib/cjs/ecschema-locaters.js.map +1 -1
- package/lib/cjs/test/SchemaFileUtility.test.d.ts +1 -1
- package/lib/cjs/test/SchemaFileUtility.test.js +56 -56
- package/lib/cjs/test/SchemaFileUtility.test.js.map +1 -1
- package/lib/cjs/test/SchemaJsonFileLocator.test.d.ts +1 -1
- package/lib/cjs/test/SchemaJsonFileLocator.test.js +119 -119
- package/lib/cjs/test/SchemaJsonFileLocator.test.js.map +1 -1
- package/lib/cjs/test/SchemaXmlFileLocator.test.d.ts +1 -1
- package/lib/cjs/test/SchemaXmlFileLocator.test.js +180 -180
- package/lib/cjs/test/SchemaXmlFileLocator.test.js.map +1 -1
- package/lib/cjs/test/StubSchemaXmlFileLocater.test.d.ts +1 -1
- package/lib/cjs/test/StubSchemaXmlFileLocater.test.js +170 -170
- package/lib/cjs/test/StubSchemaXmlFileLocater.test.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
# Change Log - @itwin/ecschema-locaters
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 01 Sep 2022 14:37:22 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.3.2
|
|
6
|
+
Thu, 01 Sep 2022 14:37:22 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 3.3.1
|
|
11
|
+
Fri, 26 Aug 2022 15:40:02 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 3.3.0
|
|
16
|
+
Thu, 18 Aug 2022 19:08:02 GMT
|
|
17
|
+
|
|
18
|
+
### Updates
|
|
19
|
+
|
|
20
|
+
- upgrade mocha to version 10.0.0
|
|
21
|
+
- The new utility method SchemaFileUtility.writeSchemaXmlFile writes an EC Schema to an xml file on the file system.
|
|
22
|
+
|
|
23
|
+
## 3.2.9
|
|
24
|
+
Fri, 26 Aug 2022 14:21:40 GMT
|
|
25
|
+
|
|
26
|
+
_Version update only_
|
|
4
27
|
|
|
5
28
|
## 3.2.8
|
|
6
29
|
Tue, 09 Aug 2022 15:52:41 GMT
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { Schema, SchemaContext, SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata";
|
|
2
|
-
/**
|
|
3
|
-
* A SchemaKey implementation that aids in identifying Schema files via the
|
|
4
|
-
* addition of two properties: fileName and schemaText. The fileName contains the
|
|
5
|
-
* full path to the file on disk and schemaText is the full string representation
|
|
6
|
-
* of the Schema.
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
export declare class FileSchemaKey extends SchemaKey {
|
|
10
|
-
fileName: string;
|
|
11
|
-
schemaText?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Initializes a new FileSchemaKey object.
|
|
14
|
-
* @param key The EC SchemaKey identifying the Schema.
|
|
15
|
-
* @param fileName The full path to the Schema file.
|
|
16
|
-
* @param schemaText The string representation of the Schema
|
|
17
|
-
* loaded from disk. Optional.
|
|
18
|
-
*/
|
|
19
|
-
constructor(key: SchemaKey, fileName: string, schemaJson?: string);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Abstract class to hold common/overlapping functionality between SchemaJsonFileLocater and SchemaXmlFileLocater
|
|
23
|
-
* @beta - Needs further testing and possibly moved to a separate package.
|
|
24
|
-
*/
|
|
25
|
-
export declare abstract class SchemaFileLocater {
|
|
26
|
-
searchPaths: string[];
|
|
27
|
-
constructor();
|
|
28
|
-
readUtf8FileToString(filePath: string): Promise<string | undefined>;
|
|
29
|
-
readUtf8FileToStringSync(filePath: string): string | undefined;
|
|
30
|
-
fileExists(filePath: string): Promise<boolean | undefined>;
|
|
31
|
-
fileExistsSync(filePath: string): boolean | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Adds more search paths used by this locator to find the
|
|
34
|
-
* Schema files.
|
|
35
|
-
* @param schemaPaths An array of search paths to add
|
|
36
|
-
*/
|
|
37
|
-
addSchemaSearchPaths(schemaPaths: string[]): void;
|
|
38
|
-
/**
|
|
39
|
-
* Add one search path used by this locator to find the
|
|
40
|
-
* Schema files.
|
|
41
|
-
* @param schemaPath A search path to add
|
|
42
|
-
*/
|
|
43
|
-
addSchemaSearchPath(schemaPath: string): void;
|
|
44
|
-
protected abstract getSchemaKey(data: string): SchemaKey;
|
|
45
|
-
/**
|
|
46
|
-
* Adds SchemaKeys to the provided foundFiles collection that match the desired SchemaKey. This method
|
|
47
|
-
* only attempts to find schema files that have no version in the file name.
|
|
48
|
-
* @param foundFiles The collection of SchemaKeys found in the given directory.
|
|
49
|
-
* @param schemaPath The directory in which to search for the Schemas.
|
|
50
|
-
* @param schemaName The short name of the Schema (without version).
|
|
51
|
-
* @param desiredKey The SchemaKey used to find matching Schema files.
|
|
52
|
-
* @param matchType The SchemaMatchType to use when comparing the desiredKey and the keys found during the search.
|
|
53
|
-
* @param format The type of file that the schema key refers to. json or xml
|
|
54
|
-
*/
|
|
55
|
-
private addCandidateNoExtSchemaKey;
|
|
56
|
-
/**
|
|
57
|
-
* Adds SchemaKeys to the provided foundFiles collection that match the desired SchemaKey
|
|
58
|
-
* @param foundFiles The collection of SchemaKeys found in the given directory
|
|
59
|
-
* @param schemaPath The directory in which to search for the Schemas
|
|
60
|
-
* @param fileFilter The file filter, potentially with wildcards, used to locate the Schema files.
|
|
61
|
-
* @param desiredKey The schemaKey used to find matching Schema files
|
|
62
|
-
* @param matchType The SchemaMatchType to use when comparing the desired Key and the keys found during the search.
|
|
63
|
-
* @param format The type of file that the schema key refers to. json or xml
|
|
64
|
-
*/
|
|
65
|
-
private addCandidateSchemaKeys;
|
|
66
|
-
/**
|
|
67
|
-
* Attempts to find all Schema files in the configurable search paths that match
|
|
68
|
-
* the desired SchemaKey.
|
|
69
|
-
* @param desiredKey The SchemaKey to match.
|
|
70
|
-
* @param matchType The SchemaMatchType.
|
|
71
|
-
* @param format The type of file that the schema key refers to. json or xml
|
|
72
|
-
*/
|
|
73
|
-
protected findEligibleSchemaKeys(desiredKey: SchemaKey, matchType: SchemaMatchType, format: string): FileSchemaKey[];
|
|
74
|
-
abstract getSchema<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;
|
|
75
|
-
/**
|
|
76
|
-
* Compares two Schema versions. If the left-hand version is greater, 1 is returned. If the
|
|
77
|
-
* left-hand version is less, -1 us returned. If the versions are an exact match, 0 is returned.
|
|
78
|
-
* @param lhs The 'left-hand' FileSchemaKey.
|
|
79
|
-
* @param rhs The 'right-hand' FileSchemaKey.
|
|
80
|
-
*/
|
|
81
|
-
compareSchemaKeyByVersion: (lhs: FileSchemaKey, rhs: FileSchemaKey) => number;
|
|
82
|
-
}
|
|
1
|
+
import { Schema, SchemaContext, SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata";
|
|
2
|
+
/**
|
|
3
|
+
* A SchemaKey implementation that aids in identifying Schema files via the
|
|
4
|
+
* addition of two properties: fileName and schemaText. The fileName contains the
|
|
5
|
+
* full path to the file on disk and schemaText is the full string representation
|
|
6
|
+
* of the Schema.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export declare class FileSchemaKey extends SchemaKey {
|
|
10
|
+
fileName: string;
|
|
11
|
+
schemaText?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Initializes a new FileSchemaKey object.
|
|
14
|
+
* @param key The EC SchemaKey identifying the Schema.
|
|
15
|
+
* @param fileName The full path to the Schema file.
|
|
16
|
+
* @param schemaText The string representation of the Schema
|
|
17
|
+
* loaded from disk. Optional.
|
|
18
|
+
*/
|
|
19
|
+
constructor(key: SchemaKey, fileName: string, schemaJson?: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Abstract class to hold common/overlapping functionality between SchemaJsonFileLocater and SchemaXmlFileLocater
|
|
23
|
+
* @beta - Needs further testing and possibly moved to a separate package.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class SchemaFileLocater {
|
|
26
|
+
searchPaths: string[];
|
|
27
|
+
constructor();
|
|
28
|
+
readUtf8FileToString(filePath: string): Promise<string | undefined>;
|
|
29
|
+
readUtf8FileToStringSync(filePath: string): string | undefined;
|
|
30
|
+
fileExists(filePath: string): Promise<boolean | undefined>;
|
|
31
|
+
fileExistsSync(filePath: string): boolean | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Adds more search paths used by this locator to find the
|
|
34
|
+
* Schema files.
|
|
35
|
+
* @param schemaPaths An array of search paths to add
|
|
36
|
+
*/
|
|
37
|
+
addSchemaSearchPaths(schemaPaths: string[]): void;
|
|
38
|
+
/**
|
|
39
|
+
* Add one search path used by this locator to find the
|
|
40
|
+
* Schema files.
|
|
41
|
+
* @param schemaPath A search path to add
|
|
42
|
+
*/
|
|
43
|
+
addSchemaSearchPath(schemaPath: string): void;
|
|
44
|
+
protected abstract getSchemaKey(data: string): SchemaKey;
|
|
45
|
+
/**
|
|
46
|
+
* Adds SchemaKeys to the provided foundFiles collection that match the desired SchemaKey. This method
|
|
47
|
+
* only attempts to find schema files that have no version in the file name.
|
|
48
|
+
* @param foundFiles The collection of SchemaKeys found in the given directory.
|
|
49
|
+
* @param schemaPath The directory in which to search for the Schemas.
|
|
50
|
+
* @param schemaName The short name of the Schema (without version).
|
|
51
|
+
* @param desiredKey The SchemaKey used to find matching Schema files.
|
|
52
|
+
* @param matchType The SchemaMatchType to use when comparing the desiredKey and the keys found during the search.
|
|
53
|
+
* @param format The type of file that the schema key refers to. json or xml
|
|
54
|
+
*/
|
|
55
|
+
private addCandidateNoExtSchemaKey;
|
|
56
|
+
/**
|
|
57
|
+
* Adds SchemaKeys to the provided foundFiles collection that match the desired SchemaKey
|
|
58
|
+
* @param foundFiles The collection of SchemaKeys found in the given directory
|
|
59
|
+
* @param schemaPath The directory in which to search for the Schemas
|
|
60
|
+
* @param fileFilter The file filter, potentially with wildcards, used to locate the Schema files.
|
|
61
|
+
* @param desiredKey The schemaKey used to find matching Schema files
|
|
62
|
+
* @param matchType The SchemaMatchType to use when comparing the desired Key and the keys found during the search.
|
|
63
|
+
* @param format The type of file that the schema key refers to. json or xml
|
|
64
|
+
*/
|
|
65
|
+
private addCandidateSchemaKeys;
|
|
66
|
+
/**
|
|
67
|
+
* Attempts to find all Schema files in the configurable search paths that match
|
|
68
|
+
* the desired SchemaKey.
|
|
69
|
+
* @param desiredKey The SchemaKey to match.
|
|
70
|
+
* @param matchType The SchemaMatchType.
|
|
71
|
+
* @param format The type of file that the schema key refers to. json or xml
|
|
72
|
+
*/
|
|
73
|
+
protected findEligibleSchemaKeys(desiredKey: SchemaKey, matchType: SchemaMatchType, format: string): FileSchemaKey[];
|
|
74
|
+
abstract getSchema<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* Compares two Schema versions. If the left-hand version is greater, 1 is returned. If the
|
|
77
|
+
* left-hand version is less, -1 us returned. If the versions are an exact match, 0 is returned.
|
|
78
|
+
* @param lhs The 'left-hand' FileSchemaKey.
|
|
79
|
+
* @param rhs The 'right-hand' FileSchemaKey.
|
|
80
|
+
*/
|
|
81
|
+
compareSchemaKeyByVersion: (lhs: FileSchemaKey, rhs: FileSchemaKey) => number;
|
|
82
|
+
}
|
|
83
83
|
//# sourceMappingURL=SchemaFileLocater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaFileLocater.d.ts","sourceRoot":"","sources":["../../src/SchemaFileLocater.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"SchemaFileLocater.d.ts","sourceRoot":"","sources":["../../src/SchemaFileLocater.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AA4B7F;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAEnC,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;OAMG;gBACS,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,E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