@abco20/btxml-checker 0.1.0
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/LICENSE +21 -0
- package/README.md +159 -0
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/dist/ast-BbfR3S_b.d.ts +62 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +33 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.js +1 -0
- package/dist/diagnostic-B5htzyJ9.d.ts +42 -0
- package/dist/editor-node.d.ts +21 -0
- package/dist/editor-node.js +30 -0
- package/dist/editor.d.ts +16 -0
- package/dist/editor.js +28 -0
- package/dist/effective-t_u6qJ-7.d.ts +12 -0
- package/dist/index-CZlTfNCD.d.ts +47 -0
- package/dist/index.d.ts +327 -0
- package/dist/index.js +11 -0
- package/dist/model.d.ts +127 -0
- package/dist/model.js +2 -0
- package/dist/public-types-B2noBQY9.d.ts +125 -0
- package/dist/public-types-DaawwXHQ.d.ts +250 -0
- package/dist/rules.d.ts +356 -0
- package/dist/rules.js +5 -0
- package/dist/semantic.d.ts +42 -0
- package/dist/semantic.js +2 -0
- package/dist/server.cjs +46155 -0
- package/dist/server.cjs.map +1 -0
- package/dist/syntax.d.ts +84 -0
- package/dist/syntax.js +8 -0
- package/dist/types-BaOc_AYN.d.ts +104 -0
- package/dist/types-BgqDzlJ8.d.ts +425 -0
- package/dist/types-CkOvIGPf.d.ts +105 -0
- package/dist/types-SY4-jKCn.d.ts +112 -0
- package/package.json +93 -0
- package/schemas/btxml.config.schema.json +441 -0
- package/schemas/btxml.nodes.schema.json +64 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { D as Diagnostic } from './diagnostic-B5htzyJ9.js';
|
|
2
|
+
import { B as BtDocument } from './ast-BbfR3S_b.js';
|
|
3
|
+
|
|
4
|
+
type ParseOptions = {
|
|
5
|
+
readonly uri?: string;
|
|
6
|
+
readonly path?: string;
|
|
7
|
+
readonly kind?: "bt-xml" | "model-xml" | "unknown";
|
|
8
|
+
readonly mode?: "strict" | "tolerant";
|
|
9
|
+
};
|
|
10
|
+
type ParseResult = {
|
|
11
|
+
readonly ok: true;
|
|
12
|
+
readonly document: BtDocument;
|
|
13
|
+
readonly diagnostics: Diagnostic[];
|
|
14
|
+
readonly partial: false;
|
|
15
|
+
} | {
|
|
16
|
+
readonly ok: false;
|
|
17
|
+
readonly document?: BtDocument;
|
|
18
|
+
readonly diagnostics: Diagnostic[];
|
|
19
|
+
readonly partial: boolean;
|
|
20
|
+
};
|
|
21
|
+
type FormatOptions = {
|
|
22
|
+
readonly indentWidth?: number;
|
|
23
|
+
readonly xmlDeclaration?: "always" | "never" | "preserve";
|
|
24
|
+
readonly blankLineBetweenBehaviorTrees?: boolean;
|
|
25
|
+
readonly lineEnding?: "lf" | "crlf" | "auto";
|
|
26
|
+
readonly force?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type FormatResult = {
|
|
29
|
+
readonly ok: true;
|
|
30
|
+
readonly text: string;
|
|
31
|
+
readonly changed: boolean;
|
|
32
|
+
readonly skipped: false;
|
|
33
|
+
readonly diagnostics: Diagnostic[];
|
|
34
|
+
} | {
|
|
35
|
+
readonly ok: true;
|
|
36
|
+
readonly skipped: true;
|
|
37
|
+
readonly diagnostics: Diagnostic[];
|
|
38
|
+
} | {
|
|
39
|
+
readonly ok: false;
|
|
40
|
+
readonly text?: string;
|
|
41
|
+
readonly skipped: false;
|
|
42
|
+
readonly diagnostics: Diagnostic[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
declare function formatBtXml(text: string, options?: FormatOptions): FormatResult;
|
|
46
|
+
|
|
47
|
+
export { type FormatOptions as F, type ParseOptions as P, type ParseResult as a, type FormatResult as b, formatBtXml as f };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
export { f as formatBtXml } from './index-CZlTfNCD.js';
|
|
2
|
+
import { E as EffectiveFileConfig, R as ResolvedBtxmlConfig } from './types-BgqDzlJ8.js';
|
|
3
|
+
import { D as Diagnostic } from './diagnostic-B5htzyJ9.js';
|
|
4
|
+
import { M as ModelAugmentationFile, W as WorkspaceInput } from './types-BaOc_AYN.js';
|
|
5
|
+
export { c as createInitConfig, g as getEffectiveConfigForFile, a as getEffectiveConfigForUri, n as normalizeBtxmlConfig, p as parseBtxmlConfig } from './effective-t_u6qJ-7.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import './ast-BbfR3S_b.js';
|
|
8
|
+
import './public-types-B2noBQY9.js';
|
|
9
|
+
|
|
10
|
+
type ValidateOptions = {
|
|
11
|
+
config: EffectiveFileConfig;
|
|
12
|
+
augmentations?: readonly ModelAugmentationFile[];
|
|
13
|
+
uri?: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
};
|
|
16
|
+
type ValidateResult = {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
diagnostics: Diagnostic[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
declare function validateBtXml(text: string, options: ValidateOptions): ValidateResult;
|
|
22
|
+
|
|
23
|
+
type CheckOptions = {
|
|
24
|
+
readonly config: EffectiveFileConfig;
|
|
25
|
+
readonly uri?: string;
|
|
26
|
+
readonly path?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to check formatting.
|
|
29
|
+
* Default: true.
|
|
30
|
+
*/
|
|
31
|
+
readonly format?: boolean;
|
|
32
|
+
};
|
|
33
|
+
type CheckResult = {
|
|
34
|
+
readonly ok: true;
|
|
35
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
36
|
+
readonly formattedText?: string;
|
|
37
|
+
readonly needsFormat: false;
|
|
38
|
+
readonly skipped: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
readonly ok: false;
|
|
41
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
42
|
+
readonly formattedText?: string;
|
|
43
|
+
readonly needsFormat: boolean;
|
|
44
|
+
readonly skipped: boolean;
|
|
45
|
+
};
|
|
46
|
+
declare function checkBtXml(text: string, options: CheckOptions): CheckResult;
|
|
47
|
+
|
|
48
|
+
type WorkspaceCheckInput = {
|
|
49
|
+
inputs: WorkspaceInput[];
|
|
50
|
+
config: ResolvedBtxmlConfig;
|
|
51
|
+
};
|
|
52
|
+
type WorkspaceCheckResult = {
|
|
53
|
+
ok: boolean;
|
|
54
|
+
files: Array<{
|
|
55
|
+
uri: string;
|
|
56
|
+
path?: string;
|
|
57
|
+
diagnostics: Diagnostic[];
|
|
58
|
+
skipped?: boolean;
|
|
59
|
+
skipReason?: string;
|
|
60
|
+
formatted?: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
projectDiagnostics: Diagnostic[];
|
|
63
|
+
summary: {
|
|
64
|
+
files: number;
|
|
65
|
+
errors: number;
|
|
66
|
+
warnings: number;
|
|
67
|
+
infos: number;
|
|
68
|
+
formatErrors?: number;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
declare function checkBtWorkspace(input: WorkspaceCheckInput): Promise<WorkspaceCheckResult>;
|
|
73
|
+
|
|
74
|
+
declare const jsonCheckReportSchema: z.ZodObject<{
|
|
75
|
+
ok: z.ZodBoolean;
|
|
76
|
+
version: z.ZodLiteral<2>;
|
|
77
|
+
schemaVersion: z.ZodLiteral<"2">;
|
|
78
|
+
toolVersion: z.ZodString;
|
|
79
|
+
project: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
80
|
+
projectDiagnostics: z.ZodArray<z.ZodObject<{
|
|
81
|
+
code: z.ZodString;
|
|
82
|
+
rule: z.ZodOptional<z.ZodString>;
|
|
83
|
+
severity: z.ZodEnum<{
|
|
84
|
+
error: "error";
|
|
85
|
+
warning: "warning";
|
|
86
|
+
info: "info";
|
|
87
|
+
}>;
|
|
88
|
+
message: z.ZodString;
|
|
89
|
+
uri: z.ZodString;
|
|
90
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
start: z.ZodObject<{
|
|
92
|
+
line: z.ZodNumber;
|
|
93
|
+
character: z.ZodNumber;
|
|
94
|
+
offset: z.ZodNumber;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
end: z.ZodObject<{
|
|
97
|
+
line: z.ZodNumber;
|
|
98
|
+
character: z.ZodNumber;
|
|
99
|
+
offset: z.ZodNumber;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
relatedInformation: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
103
|
+
uri: z.ZodString;
|
|
104
|
+
range: z.ZodObject<{
|
|
105
|
+
start: z.ZodObject<{
|
|
106
|
+
line: z.ZodNumber;
|
|
107
|
+
character: z.ZodNumber;
|
|
108
|
+
offset: z.ZodNumber;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
end: z.ZodObject<{
|
|
111
|
+
line: z.ZodNumber;
|
|
112
|
+
character: z.ZodNumber;
|
|
113
|
+
offset: z.ZodNumber;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
message: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>>;
|
|
118
|
+
suppressed: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
primaryLabel: z.ZodOptional<z.ZodString>;
|
|
121
|
+
help: z.ZodOptional<z.ZodString>;
|
|
122
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
123
|
+
}, z.core.$strict>>;
|
|
124
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
125
|
+
}, z.core.$strict>>;
|
|
126
|
+
files: z.ZodArray<z.ZodObject<{
|
|
127
|
+
path: z.ZodString;
|
|
128
|
+
diagnostics: z.ZodArray<z.ZodObject<{
|
|
129
|
+
code: z.ZodString;
|
|
130
|
+
rule: z.ZodOptional<z.ZodString>;
|
|
131
|
+
severity: z.ZodEnum<{
|
|
132
|
+
error: "error";
|
|
133
|
+
warning: "warning";
|
|
134
|
+
info: "info";
|
|
135
|
+
}>;
|
|
136
|
+
message: z.ZodString;
|
|
137
|
+
uri: z.ZodString;
|
|
138
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
start: z.ZodObject<{
|
|
140
|
+
line: z.ZodNumber;
|
|
141
|
+
character: z.ZodNumber;
|
|
142
|
+
offset: z.ZodNumber;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
end: z.ZodObject<{
|
|
145
|
+
line: z.ZodNumber;
|
|
146
|
+
character: z.ZodNumber;
|
|
147
|
+
offset: z.ZodNumber;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
relatedInformation: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
151
|
+
uri: z.ZodString;
|
|
152
|
+
range: z.ZodObject<{
|
|
153
|
+
start: z.ZodObject<{
|
|
154
|
+
line: z.ZodNumber;
|
|
155
|
+
character: z.ZodNumber;
|
|
156
|
+
offset: z.ZodNumber;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
end: z.ZodObject<{
|
|
159
|
+
line: z.ZodNumber;
|
|
160
|
+
character: z.ZodNumber;
|
|
161
|
+
offset: z.ZodNumber;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
message: z.ZodString;
|
|
165
|
+
}, z.core.$strict>>>;
|
|
166
|
+
suppressed: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
primaryLabel: z.ZodOptional<z.ZodString>;
|
|
169
|
+
help: z.ZodOptional<z.ZodString>;
|
|
170
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
171
|
+
}, z.core.$strict>>;
|
|
172
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
173
|
+
}, z.core.$strict>>;
|
|
174
|
+
needsFormat: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
skipped: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
skipReason: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strict>>;
|
|
178
|
+
summary: z.ZodObject<{
|
|
179
|
+
files: z.ZodNumber;
|
|
180
|
+
errors: z.ZodNumber;
|
|
181
|
+
warnings: z.ZodNumber;
|
|
182
|
+
infos: z.ZodNumber;
|
|
183
|
+
suppressed: z.ZodNumber;
|
|
184
|
+
baselineFiltered: z.ZodNumber;
|
|
185
|
+
}, z.core.$strict>;
|
|
186
|
+
}, z.core.$strict>;
|
|
187
|
+
declare const jsonRepairReportSchema: z.ZodObject<{
|
|
188
|
+
ok: z.ZodBoolean;
|
|
189
|
+
version: z.ZodLiteral<2>;
|
|
190
|
+
schemaVersion: z.ZodLiteral<"2">;
|
|
191
|
+
toolVersion: z.ZodString;
|
|
192
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
kind: z.ZodEnum<{
|
|
195
|
+
"model-signature-conflict": "model-signature-conflict";
|
|
196
|
+
"duplicate-model-id": "duplicate-model-id";
|
|
197
|
+
"duplicate-port-name": "duplicate-port-name";
|
|
198
|
+
}>;
|
|
199
|
+
nodeId: z.ZodString;
|
|
200
|
+
portName: z.ZodOptional<z.ZodString>;
|
|
201
|
+
displayName: z.ZodString;
|
|
202
|
+
codes: z.ZodArray<z.ZodString>;
|
|
203
|
+
severity: z.ZodEnum<{
|
|
204
|
+
error: "error";
|
|
205
|
+
warning: "warning";
|
|
206
|
+
}>;
|
|
207
|
+
pairwiseConflictCount: z.ZodNumber;
|
|
208
|
+
definitions: z.ZodArray<z.ZodObject<{
|
|
209
|
+
definitionId: z.ZodString;
|
|
210
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
211
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
start: z.ZodObject<{
|
|
213
|
+
line: z.ZodNumber;
|
|
214
|
+
character: z.ZodNumber;
|
|
215
|
+
offset: z.ZodNumber;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
end: z.ZodObject<{
|
|
218
|
+
line: z.ZodNumber;
|
|
219
|
+
character: z.ZodNumber;
|
|
220
|
+
offset: z.ZodNumber;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
}, z.core.$strict>>;
|
|
223
|
+
sourceKind: z.ZodString;
|
|
224
|
+
kind: z.ZodString;
|
|
225
|
+
signatureId: z.ZodString;
|
|
226
|
+
signatureText: z.ZodString;
|
|
227
|
+
}, z.core.$strict>>;
|
|
228
|
+
signatures: z.ZodArray<z.ZodObject<{
|
|
229
|
+
id: z.ZodString;
|
|
230
|
+
signatureKey: z.ZodString;
|
|
231
|
+
signatureText: z.ZodString;
|
|
232
|
+
definitions: z.ZodArray<z.ZodObject<{
|
|
233
|
+
definitionId: z.ZodString;
|
|
234
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
235
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
start: z.ZodObject<{
|
|
237
|
+
line: z.ZodNumber;
|
|
238
|
+
character: z.ZodNumber;
|
|
239
|
+
offset: z.ZodNumber;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
end: z.ZodObject<{
|
|
242
|
+
line: z.ZodNumber;
|
|
243
|
+
character: z.ZodNumber;
|
|
244
|
+
offset: z.ZodNumber;
|
|
245
|
+
}, z.core.$strict>;
|
|
246
|
+
}, z.core.$strict>>;
|
|
247
|
+
}, z.core.$strict>>;
|
|
248
|
+
editableDefinitions: z.ZodArray<z.ZodObject<{
|
|
249
|
+
definitionId: z.ZodString;
|
|
250
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
251
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
start: z.ZodObject<{
|
|
253
|
+
line: z.ZodNumber;
|
|
254
|
+
character: z.ZodNumber;
|
|
255
|
+
offset: z.ZodNumber;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
end: z.ZodObject<{
|
|
258
|
+
line: z.ZodNumber;
|
|
259
|
+
character: z.ZodNumber;
|
|
260
|
+
offset: z.ZodNumber;
|
|
261
|
+
}, z.core.$strict>;
|
|
262
|
+
}, z.core.$strict>>;
|
|
263
|
+
}, z.core.$strict>>;
|
|
264
|
+
nonEditableDefinitions: z.ZodArray<z.ZodObject<{
|
|
265
|
+
definitionId: z.ZodString;
|
|
266
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
267
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
268
|
+
start: z.ZodObject<{
|
|
269
|
+
line: z.ZodNumber;
|
|
270
|
+
character: z.ZodNumber;
|
|
271
|
+
offset: z.ZodNumber;
|
|
272
|
+
}, z.core.$strict>;
|
|
273
|
+
end: z.ZodObject<{
|
|
274
|
+
line: z.ZodNumber;
|
|
275
|
+
character: z.ZodNumber;
|
|
276
|
+
offset: z.ZodNumber;
|
|
277
|
+
}, z.core.$strict>;
|
|
278
|
+
}, z.core.$strict>>;
|
|
279
|
+
}, z.core.$strict>>;
|
|
280
|
+
}, z.core.$strict>>;
|
|
281
|
+
differences: z.ZodArray<z.ZodUnknown>;
|
|
282
|
+
usageEvidence: z.ZodObject<{
|
|
283
|
+
nodeId: z.ZodString;
|
|
284
|
+
totalUsages: z.ZodNumber;
|
|
285
|
+
byPort: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
286
|
+
}, z.core.$strict>;
|
|
287
|
+
usageImpacts: z.ZodArray<z.ZodUnknown>;
|
|
288
|
+
differencePattern: z.ZodObject<{
|
|
289
|
+
key: z.ZodString;
|
|
290
|
+
label: z.ZodString;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
title: z.ZodString;
|
|
295
|
+
description: z.ZodString;
|
|
296
|
+
kind: z.ZodEnum<{
|
|
297
|
+
"match-signature": "match-signature";
|
|
298
|
+
"keep-model-definition": "keep-model-definition";
|
|
299
|
+
"keep-port-definition": "keep-port-definition";
|
|
300
|
+
manual: "manual";
|
|
301
|
+
skip: "skip";
|
|
302
|
+
}>;
|
|
303
|
+
applicable: z.ZodBoolean;
|
|
304
|
+
targetSignatureId: z.ZodOptional<z.ZodString>;
|
|
305
|
+
editSummary: z.ZodObject<{
|
|
306
|
+
files: z.ZodNumber;
|
|
307
|
+
definitions: z.ZodNumber;
|
|
308
|
+
edits: z.ZodNumber;
|
|
309
|
+
affectedUris: z.ZodArray<z.ZodString>;
|
|
310
|
+
}, z.core.$strict>;
|
|
311
|
+
workspaceEdits: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
312
|
+
usageImpact: z.ZodOptional<z.ZodUnknown>;
|
|
313
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
314
|
+
}, z.core.$strict>>;
|
|
315
|
+
}, z.core.$strict>>;
|
|
316
|
+
summary: z.ZodObject<{
|
|
317
|
+
groups: z.ZodNumber;
|
|
318
|
+
signatureConflictGroups: z.ZodNumber;
|
|
319
|
+
duplicateModelGroups: z.ZodNumber;
|
|
320
|
+
duplicatePortGroups: z.ZodNumber;
|
|
321
|
+
pairwiseSignatureConflicts: z.ZodNumber;
|
|
322
|
+
errors: z.ZodNumber;
|
|
323
|
+
warnings: z.ZodNumber;
|
|
324
|
+
}, z.core.$strict>;
|
|
325
|
+
}, z.core.$strict>;
|
|
326
|
+
|
|
327
|
+
export { type CheckResult, type WorkspaceCheckResult, checkBtWorkspace, checkBtXml, jsonCheckReportSchema, jsonRepairReportSchema, validateBtXml };
|