@itwin/ecschema-locaters 3.5.0-dev.8 → 3.5.1
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 +72 -1
- package/lib/cjs/SchemaFileLocater.d.ts +82 -82
- package/lib/cjs/SchemaFileLocater.js +212 -212
- package/lib/cjs/SchemaFileLocater.js.map +1 -1
- package/lib/cjs/SchemaFileUtility.d.ts +17 -17
- package/lib/cjs/SchemaFileUtility.js +48 -48
- package/lib/cjs/SchemaFileUtility.js.map +1 -1
- package/lib/cjs/SchemaJsonFileLocater.d.ts +33 -33
- package/lib/cjs/SchemaJsonFileLocater.js +90 -90
- package/lib/cjs/SchemaJsonFileLocater.js.map +1 -1
- package/lib/cjs/SchemaXmlFileLocater.d.ts +33 -33
- package/lib/cjs/SchemaXmlFileLocater.js +93 -93
- package/lib/cjs/SchemaXmlFileLocater.js.map +1 -1
- package/lib/cjs/StubSchemaXmlFileLocater.d.ts +69 -69
- package/lib/cjs/StubSchemaXmlFileLocater.js +177 -177
- package/lib/cjs/StubSchemaXmlFileLocater.js.map +1 -1
- package/lib/cjs/ecschema-locaters.d.ts +17 -17
- package/lib/cjs/ecschema-locaters.js +33 -33
- 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 +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,77 @@
|
|
|
1
1
|
# Change Log - @itwin/ecschema-locaters
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu,
|
|
3
|
+
This log was last generated on Thu, 15 Dec 2022 16:38:29 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.5.1
|
|
6
|
+
Thu, 15 Dec 2022 16:38:29 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 3.5.0
|
|
11
|
+
Wed, 07 Dec 2022 19:12:37 GMT
|
|
12
|
+
|
|
13
|
+
### Updates
|
|
14
|
+
|
|
15
|
+
- bump up xmldom/xmldom version to avoid prototype pollution
|
|
16
|
+
|
|
17
|
+
## 3.4.7
|
|
18
|
+
Wed, 30 Nov 2022 14:28:19 GMT
|
|
19
|
+
|
|
20
|
+
_Version update only_
|
|
21
|
+
|
|
22
|
+
## 3.4.6
|
|
23
|
+
Tue, 22 Nov 2022 14:24:19 GMT
|
|
24
|
+
|
|
25
|
+
_Version update only_
|
|
26
|
+
|
|
27
|
+
## 3.4.5
|
|
28
|
+
Thu, 17 Nov 2022 21:32:50 GMT
|
|
29
|
+
|
|
30
|
+
_Version update only_
|
|
31
|
+
|
|
32
|
+
## 3.4.4
|
|
33
|
+
Thu, 10 Nov 2022 19:32:17 GMT
|
|
34
|
+
|
|
35
|
+
### Updates
|
|
36
|
+
|
|
37
|
+
- bump xmldom to resolve GHSA-crh6-fp67-6883
|
|
38
|
+
|
|
39
|
+
## 3.4.3
|
|
40
|
+
Fri, 28 Oct 2022 13:34:58 GMT
|
|
41
|
+
|
|
42
|
+
_Version update only_
|
|
43
|
+
|
|
44
|
+
## 3.4.2
|
|
45
|
+
Mon, 24 Oct 2022 13:23:45 GMT
|
|
46
|
+
|
|
47
|
+
_Version update only_
|
|
48
|
+
|
|
49
|
+
## 3.4.1
|
|
50
|
+
Mon, 17 Oct 2022 20:06:51 GMT
|
|
51
|
+
|
|
52
|
+
_Version update only_
|
|
53
|
+
|
|
54
|
+
## 3.4.0
|
|
55
|
+
Thu, 13 Oct 2022 20:24:47 GMT
|
|
56
|
+
|
|
57
|
+
### Updates
|
|
58
|
+
|
|
59
|
+
- Updated Node types declaration to support latest v16
|
|
60
|
+
|
|
61
|
+
## 3.3.5
|
|
62
|
+
Tue, 27 Sep 2022 11:50:59 GMT
|
|
63
|
+
|
|
64
|
+
_Version update only_
|
|
65
|
+
|
|
66
|
+
## 3.3.4
|
|
67
|
+
Thu, 08 Sep 2022 19:00:05 GMT
|
|
68
|
+
|
|
69
|
+
_Version update only_
|
|
70
|
+
|
|
71
|
+
## 3.3.3
|
|
72
|
+
Tue, 06 Sep 2022 20:54:19 GMT
|
|
73
|
+
|
|
74
|
+
_Version update only_
|
|
4
75
|
|
|
5
76
|
## 3.3.2
|
|
6
77
|
Thu, 01 Sep 2022 14:37:22 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
|