@openmbee/opensysml 0.12.1 → 0.12.2-nightly.20261107.gfdf6ec872c
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/dist/core/capabilities.d.ts +4 -0
- package/dist/core/capabilities.js +4 -0
- package/dist/core/connection.d.ts +9 -0
- package/dist/core/connection.js +26 -3
- package/dist/core/conversion.d.ts +3 -0
- package/dist/core/element-properties.d.ts +84 -0
- package/dist/core/element-properties.js +126 -0
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.js +2 -1
- package/dist/core/model.d.ts +3 -0
- package/dist/core/model.js +4 -0
- package/dist/core/render-view.d.ts +14 -0
- package/dist/core/render-view.js +15 -0
- package/dist/generated/sysml_pb.d.ts +578 -2
- package/dist/generated/sysml_pb.js +205 -140
- package/package.json +9 -10
- package/release-digests.json +6 -1
|
@@ -3,6 +3,10 @@ import { OpenSysMLError } from "./errors.js";
|
|
|
3
3
|
export declare const CAPABILITY_TYPE_FACTS = "type_facts";
|
|
4
4
|
/** Populated `SymbolInfo.attributes`. */
|
|
5
5
|
export declare const CAPABILITY_SYMBOL_ATTRIBUTES = "symbol_attributes";
|
|
6
|
+
/** Populated `SymbolInfo.members`: every member, own and inherited, with its provenance. */
|
|
7
|
+
export declare const CAPABILITY_SYMBOL_MEMBERS = "symbol_members";
|
|
8
|
+
/** The `GetElementProperties` RPC: an element's metamodel properties by their specification names. */
|
|
9
|
+
export declare const CAPABILITY_ELEMENT_PROPERTIES = "element_properties";
|
|
6
10
|
/** Evaluating an expression against an instantiated subject. */
|
|
7
11
|
export declare const CAPABILITY_EVALUATE_SUBJECT = "evaluate_subject";
|
|
8
12
|
/** An object's values as `Instance.feature_values`. */
|
|
@@ -7,6 +7,10 @@ import { PLATFORM_PACKAGE_PREFIX } from "./package.js";
|
|
|
7
7
|
export const CAPABILITY_TYPE_FACTS = "type_facts";
|
|
8
8
|
/** Populated `SymbolInfo.attributes`. */
|
|
9
9
|
export const CAPABILITY_SYMBOL_ATTRIBUTES = "symbol_attributes";
|
|
10
|
+
/** Populated `SymbolInfo.members`: every member, own and inherited, with its provenance. */
|
|
11
|
+
export const CAPABILITY_SYMBOL_MEMBERS = "symbol_members";
|
|
12
|
+
/** The `GetElementProperties` RPC: an element's metamodel properties by their specification names. */
|
|
13
|
+
export const CAPABILITY_ELEMENT_PROPERTIES = "element_properties";
|
|
10
14
|
/** Evaluating an expression against an instantiated subject. */
|
|
11
15
|
export const CAPABILITY_EVALUATE_SUBJECT = "evaluate_subject";
|
|
12
16
|
/** An object's values as `Instance.feature_values`. */
|
|
@@ -6,6 +6,7 @@ import { Model, type ParseOptions, type ParseSourcesOptions } from "./model.js";
|
|
|
6
6
|
import { type Source } from "./sources.js";
|
|
7
7
|
import { Conversion, Migration } from "./conversion.js";
|
|
8
8
|
import type { ConvertOptions, MigrateOptions } from "./conversion.js";
|
|
9
|
+
import { type ElementProperties } from "./element-properties.js";
|
|
9
10
|
import { type QueryElement, type QueryForm, type QueryPayload } from "./query.js";
|
|
10
11
|
import { DocumentEvent, type BindingValues, type DocumentQueryResult } from "./document.js";
|
|
11
12
|
import { type RenderedView } from "./render-view.js";
|
|
@@ -151,6 +152,14 @@ export declare class Connection {
|
|
|
151
152
|
query(modelHash: string, options?: {
|
|
152
153
|
payload?: QueryPayload;
|
|
153
154
|
} & QueryForm): Promise<QueryElement[]>;
|
|
155
|
+
/**
|
|
156
|
+
* Reads the metamodel properties of one element by their specification names
|
|
157
|
+
* (`inheritedFeature`, `connectorEnd`, ...), as the model's API element form
|
|
158
|
+
* spells them; every property the element carries when none is named. The
|
|
159
|
+
* element is a qualified name, the positional id of an unnamed member
|
|
160
|
+
* (`Owner::@2`) or an element form id.
|
|
161
|
+
*/
|
|
162
|
+
elementProperties(modelHash: string, element: string, properties?: readonly string[]): Promise<ElementProperties>;
|
|
154
163
|
/** Runs a named document query and answers its typed rows. */
|
|
155
164
|
runDocumentQuery(modelHash: string, queryId: string, bindings?: Readonly<Record<string, BindingValues>>): Promise<DocumentQueryResult>;
|
|
156
165
|
/** Applies source-preserving edits to a loaded model. Operations are the
|
package/dist/core/connection.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// tells the client what that service can do.
|
|
3
3
|
import { Code, ConnectError, createClient, } from "@connectrpc/connect";
|
|
4
4
|
import { create } from "@bufbuild/protobuf";
|
|
5
|
-
import { CAPABILITY_APPLY_EDITS, CAPABILITY_BIG_INT_VALUES, CAPABILITY_RATIONAL_VALUES, CAPABILITY_CONVERT, CAPABILITY_CONVERT_CHECK_DIAGNOSTICS, CAPABILITY_CONVERT_COMPACT, CAPABILITY_CONVERT_LIBRARY_STUBS, CAPABILITY_DOCUMENT_QUERY, CAPABILITY_ENGINES, CAPABILITY_FEATURE_VALUES, CAPABILITY_INLINE_LANGUAGE, CAPABILITY_MIGRATE, CAPABILITY_PARSE_SOURCES, CAPABILITY_PARSE_SOURCES_AFFECTED, CAPABILITY_PERFORMER, CAPABILITY_STATE_TRACE, CAPABILITY_ACTION_TRACE, CAPABILITY_QUERY, CAPABILITY_QUERY_ORDER_BY, CAPABILITY_OSLC_QUERY, CAPABILITY_RENDER_DOCUMENT, CAPABILITY_RENDER_DOCUMENT_HTML, CAPABILITY_RENDER_DOCUMENT_ASCIIDOC, CAPABILITY_RENDER_VIEW, CAPABILITY_CHECK, CAPABILITY_EXPORT_GRAPHS, CAPABILITY_IMPORT_DATA, CAPABILITY_COMPARE_RESULTS, CAPABILITY_SCHEDULE, CAPABILITY_SCHEDULE_EXPLORE, CAPABILITY_STRICT_CONFORMANCE, CAPABILITY_RUNS, CAPABILITY_SELF_CHECK, CAPABILITY_RECORD_RUN, CAPABILITY_VERIFICATION, CAPABILITY_VERIFICATION_QUESTIONS, CAPABILITY_VERIFICATION_ARGUMENTS, capabilityRefusal, mismatchReason, requireCapability, upgradeRemedy, ServerInfo, } from "./capabilities.js";
|
|
6
|
-
import { ClosedConnectionError, ConversionError, ExecutionError, InvalidRequestError, MigrationError, ParseError, StaleServiceError, UnsupportedValueError, } from "./errors.js";
|
|
7
|
-
import { ApplyEditsRequestSchema, ExecuteActionRequestSchema, ExecuteStateRequestSchema, ConvertRequestSchema, ListEnginesRequestSchema, MigrateRequestSchema, ParseSourcesRequestSchema, QueryRequestSchema, RenderDocumentRequestSchema, RenderViewRequestSchema, CheckBehaviorRequestSchema, ExportGraphsRequestSchema, ImportDataRequestSchema, CompareResultsRequestSchema, RunAnalysisRequestSchema, RunDocumentQueryRequestSchema, RunSweepRequestSchema, RunRunsRequestSchema, SelfCheckRequestSchema, RecordRunRequestSchema, SweepRangeSchema, ValidateInstanceRequestSchema, EvaluateCalcRequestSchema, VerifyConstraintRequestSchema, VerifyRequirementRequestSchema, VerifySatisfactionRequestSchema, FailureReason, SysMLService, } from "../generated/sysml_pb.js";
|
|
5
|
+
import { CAPABILITY_APPLY_EDITS, CAPABILITY_BIG_INT_VALUES, CAPABILITY_RATIONAL_VALUES, CAPABILITY_CONVERT, CAPABILITY_CONVERT_CHECK_DIAGNOSTICS, CAPABILITY_CONVERT_COMPACT, CAPABILITY_CONVERT_LIBRARY_STUBS, CAPABILITY_DOCUMENT_QUERY, CAPABILITY_ENGINES, CAPABILITY_FEATURE_VALUES, CAPABILITY_INLINE_LANGUAGE, CAPABILITY_MIGRATE, CAPABILITY_PARSE_SOURCES, CAPABILITY_PARSE_SOURCES_AFFECTED, CAPABILITY_PERFORMER, CAPABILITY_STATE_TRACE, CAPABILITY_ACTION_TRACE, CAPABILITY_QUERY, CAPABILITY_ELEMENT_PROPERTIES, CAPABILITY_QUERY_ORDER_BY, CAPABILITY_OSLC_QUERY, CAPABILITY_RENDER_DOCUMENT, CAPABILITY_RENDER_DOCUMENT_HTML, CAPABILITY_RENDER_DOCUMENT_ASCIIDOC, CAPABILITY_RENDER_VIEW, CAPABILITY_CHECK, CAPABILITY_EXPORT_GRAPHS, CAPABILITY_IMPORT_DATA, CAPABILITY_COMPARE_RESULTS, CAPABILITY_SCHEDULE, CAPABILITY_SCHEDULE_EXPLORE, CAPABILITY_STRICT_CONFORMANCE, CAPABILITY_RUNS, CAPABILITY_SELF_CHECK, CAPABILITY_RECORD_RUN, CAPABILITY_VERIFICATION, CAPABILITY_VERIFICATION_QUESTIONS, CAPABILITY_VERIFICATION_ARGUMENTS, capabilityRefusal, mismatchReason, requireCapability, upgradeRemedy, ServerInfo, } from "./capabilities.js";
|
|
6
|
+
import { ClosedConnectionError, ConversionError, SymbolNotFoundError, ExecutionError, InvalidRequestError, MigrationError, ParseError, StaleServiceError, UnsupportedValueError, } from "./errors.js";
|
|
7
|
+
import { ApplyEditsRequestSchema, ExecuteActionRequestSchema, ExecuteStateRequestSchema, ConvertRequestSchema, ListEnginesRequestSchema, MigrateRequestSchema, ParseSourcesRequestSchema, QueryRequestSchema, GetElementPropertiesRequestSchema, RenderDocumentRequestSchema, RenderViewRequestSchema, CheckBehaviorRequestSchema, ExportGraphsRequestSchema, ImportDataRequestSchema, CompareResultsRequestSchema, RunAnalysisRequestSchema, RunDocumentQueryRequestSchema, RunSweepRequestSchema, RunRunsRequestSchema, SelfCheckRequestSchema, RecordRunRequestSchema, SweepRangeSchema, ValidateInstanceRequestSchema, EvaluateCalcRequestSchema, VerifyConstraintRequestSchema, VerifyRequirementRequestSchema, VerifySatisfactionRequestSchema, FailureReason, SysMLService, } from "../generated/sysml_pb.js";
|
|
8
8
|
import { callRpc, fromHandshakeError, fromRpcError } from "./status.js";
|
|
9
9
|
import { requireString } from "./arguments.js";
|
|
10
10
|
import { decodeDiagnostic, Instance, Model, } from "./model.js";
|
|
11
11
|
import { sourceDocuments } from "./sources.js";
|
|
12
12
|
import { Conversion, EXPERIMENTAL_NOTICE, isExperimental, isV1, MIGRATED_NOT_CONVERTED, Migration, MIGRATION_NOTICE, migrationReportOf, pathIsV1, } from "./conversion.js";
|
|
13
|
+
import { elementPropertiesOf } from "./element-properties.js";
|
|
13
14
|
import { buildQuery, elementsOf, } from "./query.js";
|
|
14
15
|
import { bindingHoldsBigInt, bindingHoldsRational, bindingRationalsAsReals, buildBindings, documentEventOf, documentResult, DocumentEvent, } from "./document.js";
|
|
15
16
|
import { renderedViewOf } from "./render-view.js";
|
|
@@ -308,6 +309,28 @@ export class Connection {
|
|
|
308
309
|
}), this.callOptions()), "model", capabilityRefusal(this.info, needed));
|
|
309
310
|
return elementsOf(response);
|
|
310
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Reads the metamodel properties of one element by their specification names
|
|
314
|
+
* (`inheritedFeature`, `connectorEnd`, ...), as the model's API element form
|
|
315
|
+
* spells them; every property the element carries when none is named. The
|
|
316
|
+
* element is a qualified name, the positional id of an unnamed member
|
|
317
|
+
* (`Owner::@2`) or an element form id.
|
|
318
|
+
*/
|
|
319
|
+
async elementProperties(modelHash, element, properties = []) {
|
|
320
|
+
requireCapability(this.info, CAPABILITY_ELEMENT_PROPERTIES, upgradeRemedy(CAPABILITY_ELEMENT_PROPERTIES));
|
|
321
|
+
const response = await callRpc(this.rpc.getElementProperties(create(GetElementPropertiesRequestSchema, {
|
|
322
|
+
modelHash,
|
|
323
|
+
elementId: element,
|
|
324
|
+
properties: [...properties],
|
|
325
|
+
}), this.callOptions()), "model", capabilityRefusal(this.info, [CAPABILITY_ELEMENT_PROPERTIES]));
|
|
326
|
+
if (response.error !== "") {
|
|
327
|
+
if (response.error.startsWith("element not found")) {
|
|
328
|
+
throw new SymbolNotFoundError(element);
|
|
329
|
+
}
|
|
330
|
+
throw new ConversionError(response.error);
|
|
331
|
+
}
|
|
332
|
+
return elementPropertiesOf(response);
|
|
333
|
+
}
|
|
311
334
|
/** Runs a named document query and answers its typed rows. */
|
|
312
335
|
async runDocumentQuery(modelHash, queryId, bindings) {
|
|
313
336
|
requireCapability(this.info, CAPABILITY_DOCUMENT_QUERY, upgradeRemedy(CAPABILITY_DOCUMENT_QUERY));
|
|
@@ -53,8 +53,11 @@ export interface ConvertOptions {
|
|
|
53
53
|
/** A referenced standard-library element, not a model root. */
|
|
54
54
|
export interface LibraryReference {
|
|
55
55
|
readonly id: string;
|
|
56
|
+
/** Empty for an unnamed member, which `libraryPath` names instead. */
|
|
56
57
|
readonly qualifiedName: string;
|
|
57
58
|
readonly type: string;
|
|
59
|
+
/** The positional path `Owner::qualifiedName/Metaclass[i]` of an unnamed member. */
|
|
60
|
+
readonly libraryPath?: string;
|
|
58
61
|
}
|
|
59
62
|
/** A model written out in one of the formats OpenSysML writes. */
|
|
60
63
|
export declare class Conversion {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading an element's metamodel properties by their specification names.
|
|
3
|
+
*
|
|
4
|
+
* The `GetElementProperties` RPC answers the KerML 1.1 / SysML 2.1 abstract
|
|
5
|
+
* syntax of one element — `inheritedFeature`, `connectorEnd`,
|
|
6
|
+
* `directedFeature`, `payloadType`, ... — as the model's API element form
|
|
7
|
+
* (`Convert` to `api-json`) spells it, without converting the whole model. An
|
|
8
|
+
* element is named by qualified name, by the positional id of an unnamed
|
|
9
|
+
* member (`Owner::@2`) or by the element form's own id, which every element
|
|
10
|
+
* reference in an answer carries, so a client walks the graph with one vocabulary.
|
|
11
|
+
*/
|
|
12
|
+
import type { ElementPropertyValue as ElementPropertyValueMessage, ElementRef, GetElementPropertiesResponse } from "../generated/sysml_pb.js";
|
|
13
|
+
/** An element the model's element form knows: one of the model, or a standard-library element it references. */
|
|
14
|
+
export declare class ElementIdentity {
|
|
15
|
+
/** The element form's `@id`, accepted back as the element to read. */
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/** Empty for an unnamed element; an unnamed standard-library member carries its library path (`owner/Metaclass[i]`). */
|
|
18
|
+
readonly qualifiedName: string;
|
|
19
|
+
/** `ConnectionUsage`, `PartDefinition`, ...; empty when the id is known to nothing. */
|
|
20
|
+
readonly metaclass: string;
|
|
21
|
+
constructor(fields: {
|
|
22
|
+
id: string;
|
|
23
|
+
qualifiedName?: string;
|
|
24
|
+
metaclass?: string;
|
|
25
|
+
});
|
|
26
|
+
/** The qualified name, or the id for an unnamed element. */
|
|
27
|
+
toString(): string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* One value of a metamodel property, as the element form spells it: an element
|
|
31
|
+
* reference, a string (an enumeration literal included), a boolean, a number,
|
|
32
|
+
* or a `bigint` for an integer beyond the safe range. A number beyond `int64`
|
|
33
|
+
* and `float64` arrives as its decimal text.
|
|
34
|
+
*/
|
|
35
|
+
export type PropertyValue = ElementIdentity | string | boolean | number | bigint;
|
|
36
|
+
/** One metamodel property of an element. */
|
|
37
|
+
export declare class ElementProperty {
|
|
38
|
+
/** The specification name (`connectorEnd`). */
|
|
39
|
+
readonly name: string;
|
|
40
|
+
/** The metaclass declaring the property (`Connector`); empty when the element's metaclass declares no such property. */
|
|
41
|
+
readonly definingClass: string;
|
|
42
|
+
/** Whether the property holds a collection. */
|
|
43
|
+
readonly many: boolean;
|
|
44
|
+
/** Whether the specification derives the property. */
|
|
45
|
+
readonly derived: boolean;
|
|
46
|
+
/** The values in the collection's order; empty for an empty or null property. */
|
|
47
|
+
readonly values: readonly PropertyValue[];
|
|
48
|
+
/**
|
|
49
|
+
* Why there are no values when the property cannot be answered: the metaclass
|
|
50
|
+
* declares no such property, or OpenSysML does not derive it yet. Empty for a
|
|
51
|
+
* property that is answered.
|
|
52
|
+
*/
|
|
53
|
+
readonly unsupported: string;
|
|
54
|
+
constructor(fields: {
|
|
55
|
+
name: string;
|
|
56
|
+
definingClass?: string;
|
|
57
|
+
many?: boolean;
|
|
58
|
+
derived?: boolean;
|
|
59
|
+
values?: readonly PropertyValue[];
|
|
60
|
+
unsupported?: string;
|
|
61
|
+
});
|
|
62
|
+
/** Whether the property was answered, with or without values. */
|
|
63
|
+
get supported(): boolean;
|
|
64
|
+
/** The one value of a single-valued property, `undefined` when it has none. */
|
|
65
|
+
get value(): PropertyValue | undefined;
|
|
66
|
+
/** The element references among the values, in order. */
|
|
67
|
+
get elements(): ElementIdentity[];
|
|
68
|
+
}
|
|
69
|
+
/** What one read answered: the element and its properties, in the order asked for, or the element form's order when none was named. */
|
|
70
|
+
export declare class ElementProperties {
|
|
71
|
+
readonly element: ElementIdentity;
|
|
72
|
+
readonly properties: readonly ElementProperty[];
|
|
73
|
+
private readonly byName;
|
|
74
|
+
constructor(element: ElementIdentity, properties: readonly ElementProperty[]);
|
|
75
|
+
/** The entry for the named property, `undefined` when the read did not ask for it. */
|
|
76
|
+
get(name: string): ElementProperty | undefined;
|
|
77
|
+
/** Whether the read answered the named property. */
|
|
78
|
+
has(name: string): boolean;
|
|
79
|
+
[Symbol.iterator](): Iterator<ElementProperty>;
|
|
80
|
+
}
|
|
81
|
+
export declare function elementIdentityOf(reference: ElementRef | undefined): ElementIdentity;
|
|
82
|
+
export declare function propertyValueOf(message: ElementPropertyValueMessage): PropertyValue;
|
|
83
|
+
/** Decodes a `GetElementPropertiesResponse` the service answered without error. */
|
|
84
|
+
export declare function elementPropertiesOf(response: GetElementPropertiesResponse): ElementProperties;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading an element's metamodel properties by their specification names.
|
|
3
|
+
*
|
|
4
|
+
* The `GetElementProperties` RPC answers the KerML 1.1 / SysML 2.1 abstract
|
|
5
|
+
* syntax of one element — `inheritedFeature`, `connectorEnd`,
|
|
6
|
+
* `directedFeature`, `payloadType`, ... — as the model's API element form
|
|
7
|
+
* (`Convert` to `api-json`) spells it, without converting the whole model. An
|
|
8
|
+
* element is named by qualified name, by the positional id of an unnamed
|
|
9
|
+
* member (`Owner::@2`) or by the element form's own id, which every element
|
|
10
|
+
* reference in an answer carries, so a client walks the graph with one vocabulary.
|
|
11
|
+
*/
|
|
12
|
+
/** An element the model's element form knows: one of the model, or a standard-library element it references. */
|
|
13
|
+
export class ElementIdentity {
|
|
14
|
+
/** The element form's `@id`, accepted back as the element to read. */
|
|
15
|
+
id;
|
|
16
|
+
/** Empty for an unnamed element; an unnamed standard-library member carries its library path (`owner/Metaclass[i]`). */
|
|
17
|
+
qualifiedName;
|
|
18
|
+
/** `ConnectionUsage`, `PartDefinition`, ...; empty when the id is known to nothing. */
|
|
19
|
+
metaclass;
|
|
20
|
+
constructor(fields) {
|
|
21
|
+
this.id = fields.id;
|
|
22
|
+
this.qualifiedName = fields.qualifiedName ?? "";
|
|
23
|
+
this.metaclass = fields.metaclass ?? "";
|
|
24
|
+
}
|
|
25
|
+
/** The qualified name, or the id for an unnamed element. */
|
|
26
|
+
toString() {
|
|
27
|
+
return this.qualifiedName === "" ? this.id : this.qualifiedName;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** One metamodel property of an element. */
|
|
31
|
+
export class ElementProperty {
|
|
32
|
+
/** The specification name (`connectorEnd`). */
|
|
33
|
+
name;
|
|
34
|
+
/** The metaclass declaring the property (`Connector`); empty when the element's metaclass declares no such property. */
|
|
35
|
+
definingClass;
|
|
36
|
+
/** Whether the property holds a collection. */
|
|
37
|
+
many;
|
|
38
|
+
/** Whether the specification derives the property. */
|
|
39
|
+
derived;
|
|
40
|
+
/** The values in the collection's order; empty for an empty or null property. */
|
|
41
|
+
values;
|
|
42
|
+
/**
|
|
43
|
+
* Why there are no values when the property cannot be answered: the metaclass
|
|
44
|
+
* declares no such property, or OpenSysML does not derive it yet. Empty for a
|
|
45
|
+
* property that is answered.
|
|
46
|
+
*/
|
|
47
|
+
unsupported;
|
|
48
|
+
constructor(fields) {
|
|
49
|
+
this.name = fields.name;
|
|
50
|
+
this.definingClass = fields.definingClass ?? "";
|
|
51
|
+
this.many = fields.many ?? false;
|
|
52
|
+
this.derived = fields.derived ?? false;
|
|
53
|
+
this.values = fields.values ?? [];
|
|
54
|
+
this.unsupported = fields.unsupported ?? "";
|
|
55
|
+
}
|
|
56
|
+
/** Whether the property was answered, with or without values. */
|
|
57
|
+
get supported() {
|
|
58
|
+
return this.unsupported === "";
|
|
59
|
+
}
|
|
60
|
+
/** The one value of a single-valued property, `undefined` when it has none. */
|
|
61
|
+
get value() {
|
|
62
|
+
return this.values[0];
|
|
63
|
+
}
|
|
64
|
+
/** The element references among the values, in order. */
|
|
65
|
+
get elements() {
|
|
66
|
+
return this.values.filter((value) => value instanceof ElementIdentity);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** What one read answered: the element and its properties, in the order asked for, or the element form's order when none was named. */
|
|
70
|
+
export class ElementProperties {
|
|
71
|
+
element;
|
|
72
|
+
properties;
|
|
73
|
+
byName;
|
|
74
|
+
constructor(element, properties) {
|
|
75
|
+
this.element = element;
|
|
76
|
+
this.properties = properties;
|
|
77
|
+
this.byName = new Map(properties.map((property) => [property.name, property]));
|
|
78
|
+
}
|
|
79
|
+
/** The entry for the named property, `undefined` when the read did not ask for it. */
|
|
80
|
+
get(name) {
|
|
81
|
+
return this.byName.get(name);
|
|
82
|
+
}
|
|
83
|
+
/** Whether the read answered the named property. */
|
|
84
|
+
has(name) {
|
|
85
|
+
return this.byName.has(name);
|
|
86
|
+
}
|
|
87
|
+
[Symbol.iterator]() {
|
|
88
|
+
return this.properties[Symbol.iterator]();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export function elementIdentityOf(reference) {
|
|
92
|
+
return new ElementIdentity({
|
|
93
|
+
id: reference?.id ?? "",
|
|
94
|
+
qualifiedName: reference?.qualifiedName ?? "",
|
|
95
|
+
metaclass: reference?.metaclass ?? "",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
export function propertyValueOf(message) {
|
|
99
|
+
const value = message.value;
|
|
100
|
+
switch (value.case) {
|
|
101
|
+
case "element":
|
|
102
|
+
return elementIdentityOf(value.value);
|
|
103
|
+
case "stringValue":
|
|
104
|
+
case "number":
|
|
105
|
+
return value.value;
|
|
106
|
+
case "boolValue":
|
|
107
|
+
return value.value;
|
|
108
|
+
case "intValue":
|
|
109
|
+
return Number.isSafeInteger(Number(value.value)) ? Number(value.value) : value.value;
|
|
110
|
+
case "realValue":
|
|
111
|
+
return value.value;
|
|
112
|
+
default:
|
|
113
|
+
throw new Error("an ElementPropertyValue with no value");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Decodes a `GetElementPropertiesResponse` the service answered without error. */
|
|
117
|
+
export function elementPropertiesOf(response) {
|
|
118
|
+
return new ElementProperties(elementIdentityOf(response.element), response.properties.map((property) => new ElementProperty({
|
|
119
|
+
name: property.name,
|
|
120
|
+
definingClass: property.definingClass,
|
|
121
|
+
many: property.many,
|
|
122
|
+
derived: property.derived,
|
|
123
|
+
values: property.values.map(propertyValueOf),
|
|
124
|
+
unsupported: property.unsupported,
|
|
125
|
+
})));
|
|
126
|
+
}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Connection } from "./connection.js";
|
|
2
|
+
export { ElementIdentity, ElementProperties, ElementProperty, type PropertyValue, elementPropertiesOf, } from "./element-properties.js";
|
|
2
3
|
export type { ConnectionBackend, Encoding, ResponseTap, TransportOptions, VerifyArguments, VerifyOptions, } from "./connection.js";
|
|
3
4
|
export type { WasmHost } from "./wasm.js";
|
|
4
5
|
export { Instance, InstanceTree, Model, ModelSymbol, decodeDiagnostic, instanceFromJson } from "./model.js";
|
|
@@ -11,7 +12,7 @@ export { QueryElement, TYPE_COMPOSITE_CONSTRAINT, TYPE_PRIMITIVE_CONSTRAINT, TYP
|
|
|
11
12
|
export type { ConstraintPayload, QueryForm, QueryPayload, ScopeEntry } from "./query.js";
|
|
12
13
|
export { DocumentQueryResult, DocumentRow, DocumentEvent, documentEventOf, DocumentState, DocumentVerdict, ElementRef, ObjectRef, buildBindings, } from "./document.js";
|
|
13
14
|
export type { BindingValues, DocumentValue } from "./document.js";
|
|
14
|
-
export type { RenderCanvas, RenderEdge, RenderGeometry, RenderNode, RenderNote, RenderPoint, RenderPort, RenderRow, RenderSpan, RenderStyle, RenderedView, } from "./render-view.js";
|
|
15
|
+
export type { RenderCanvas, RenderEdge, RenderGeometry, RenderNode, RenderFrame, RenderNote, RenderPoint, RenderPort, RenderRow, RenderSpan, RenderStyle, RenderedView, } from "./render-view.js";
|
|
15
16
|
export { renderedViewFromJson } from "./render-view.js";
|
|
16
17
|
export type { Graphs } from "./graphs.js";
|
|
17
18
|
export type { CheckDivergence, CheckFinal, CheckOptions, CheckResult, CheckSearch, CheckViolation, CheckWitness, } from "./check.js";
|
|
@@ -24,7 +25,7 @@ export type { EditOperationData, EditTarget } from "./edit.js";
|
|
|
24
25
|
export type { ToolDryRun } from "./verdict.js";
|
|
25
26
|
export { AnalysisResult, toolDryRunOf, CalcResult, CaseEvaluation, KIND_ASSERTION, KIND_CONSTRAINT, KIND_OBJECT, KIND_OBJECTIVE, KIND_REQUIREMENT, KIND_SATISFY, QUESTION_EVALUATE, QUESTION_HOLDS, QUESTION_SATISFIABLE, STATUS_HOLDS, STATUS_SATISFIABLE, STATUS_UNDECIDED, STATUS_UNSATISFIABLE, STATUS_VIOLATED, SweepRow, SweepTable, RunsResult, SelfCheckResult, Recording, type RunDistribution, type RunPercentile, type RunHistogramBin, type RunCountedValue, type SelfCheckFinding, type RecordedDocument, Validation, VERDICT_ERROR, VERDICT_FAIL, VERDICT_INCONCLUSIVE, VERDICT_PASS, explainVerificationVerdict, explainVerdict, raiseVerdictError, verificationPassed, verdictEvaluated, verdictHolds, ImportResult, ImportedFile, ImportedValue, Comparison, ConfigurationComparison, ObservableComparison, ComparedDistribution, type StatisticDifference, type CaseStatistics, type CaseStatistic, } from "./verdict.js";
|
|
26
27
|
export type { Verdict } from "./verdict.js";
|
|
27
|
-
export { CAPABILITY_APPLY_EDITS, CAPABILITY_ACTION_BODY_STATEMENT_AUTHORING, CAPABILITY_CASE_EVALUATIONS, CAPABILITY_COMPLEX_VALUES, CAPABILITY_BIG_INT_VALUES, CAPABILITY_RATIONAL_VALUES, CAPABILITY_CONVERT, CAPABILITY_CONVERT_DOCUMENTS, CAPABILITY_CONVERT_COMPACT, CAPABILITY_CONVERT_LIBRARY_REFERENCES, CAPABILITY_CONVERT_LIBRARY_STUBS, CAPABILITY_CONVERT_CHECK_DIAGNOSTICS, CAPABILITY_PARSE_SOURCES_AFFECTED, CAPABILITY_RENDER_DOCUMENT_FILE_NAME, CAPABILITY_MIGRATE, CAPABILITY_DIAGNOSTIC_CODES, CAPABILITY_EDIT_DOCUMENTS, CAPABILITY_ENGINES, CAPABILITY_ENUM_VALUES, CAPABILITY_EVALUATE_SUBJECT, CAPABILITY_FEATURE_VALUES, CAPABILITY_FINAL_TIME, CAPABILITY_FUNCTION_VALUES, CAPABILITY_ORDER_DEPENDENCE, CAPABILITY_INFINITY_VALUE, CAPABILITY_INLINE_LANGUAGE, CAPABILITY_MEASUREMENT_REFS, CAPABILITY_METAOBJECT_VALUES, CAPABILITY_PERFORMER, CAPABILITY_RUNS, CAPABILITY_SELF_CHECK, CAPABILITY_RECORD_RUN, CAPABILITY_STATE_TRACE, CAPABILITY_ACTION_TRACE, CAPABILITY_QUERY, CAPABILITY_QUERY_ORDER_BY, CAPABILITY_OSLC_QUERY, CAPABILITY_SCHEDULE, CAPABILITY_SCHEDULE_EXPLORE, CAPABILITY_SEQUENCE_AUTHORING, CAPABILITY_SET_VALUES, CAPABILITY_STRICT_CONFORMANCE, CAPABILITY_STRUCTURED_VALUES, CAPABILITY_UNDETERMINED_VALUE, CAPABILITY_VERIFICATION_VERDICTS, CAPABILITY_SYMBOL_ATTRIBUTES, CAPABILITY_TENSOR_VALUES, CAPABILITY_TYPE_FACTS, CAPABILITY_UNSET_VALUE, CAPABILITY_VERIFICATION, CAPABILITY_AUTHORING, CAPABILITY_COMMENT_AUTHORING, CAPABILITY_CONNECTION_AUTHORING, CAPABILITY_CONSTRAINT_BODY_AUTHORING, CAPABILITY_DOCUMENTATION_AUTHORING, CAPABILITY_DOCUMENT_QUERY, CAPABILITY_IMPLICIT_PARAMETERS, CAPABILITY_IMPORT_AUTHORING, CAPABILITY_MEMBER_MODIFIERS, CAPABILITY_METADATA_AUTHORING, CAPABILITY_METADATA_PREFIX_AUTHORING, CAPABILITY_PARSE_SOURCES, CAPABILITY_RENDER_DOCUMENT, CAPABILITY_RENDER_DOCUMENT_HTML, CAPABILITY_RENDER_DOCUMENT_ASCIIDOC, CAPABILITY_REQUIREMENT_CONSTRAINT_AUTHORING, CAPABILITY_SATISFY_AUTHORING, CAPABILITY_STATE_ACTION_AUTHORING, CAPABILITY_TRANSITION_AUTHORING, CAPABILITY_VERIFICATION_OBJECTIVE_AUTHORING, CAPABILITY_VERIFICATION_QUESTIONS, CAPABILITY_VERIFICATION_ARGUMENTS, CAPABILITY_VERDICT_NOTES, MissingCapabilityError, ServerInfo, capabilityRefusal, mismatchReason, requireCapability, upgradeRemedy, CAPABILITY_IMPORT_DATA, CAPABILITY_COMPARE_RESULTS, } from "./capabilities.js";
|
|
28
|
+
export { CAPABILITY_APPLY_EDITS, CAPABILITY_ACTION_BODY_STATEMENT_AUTHORING, CAPABILITY_CASE_EVALUATIONS, CAPABILITY_COMPLEX_VALUES, CAPABILITY_BIG_INT_VALUES, CAPABILITY_RATIONAL_VALUES, CAPABILITY_CONVERT, CAPABILITY_CONVERT_DOCUMENTS, CAPABILITY_CONVERT_COMPACT, CAPABILITY_CONVERT_LIBRARY_REFERENCES, CAPABILITY_CONVERT_LIBRARY_STUBS, CAPABILITY_CONVERT_CHECK_DIAGNOSTICS, CAPABILITY_PARSE_SOURCES_AFFECTED, CAPABILITY_RENDER_DOCUMENT_FILE_NAME, CAPABILITY_MIGRATE, CAPABILITY_DIAGNOSTIC_CODES, CAPABILITY_EDIT_DOCUMENTS, CAPABILITY_ENGINES, CAPABILITY_ENUM_VALUES, CAPABILITY_EVALUATE_SUBJECT, CAPABILITY_FEATURE_VALUES, CAPABILITY_FINAL_TIME, CAPABILITY_FUNCTION_VALUES, CAPABILITY_ORDER_DEPENDENCE, CAPABILITY_INFINITY_VALUE, CAPABILITY_INLINE_LANGUAGE, CAPABILITY_MEASUREMENT_REFS, CAPABILITY_METAOBJECT_VALUES, CAPABILITY_PERFORMER, CAPABILITY_RUNS, CAPABILITY_SELF_CHECK, CAPABILITY_RECORD_RUN, CAPABILITY_STATE_TRACE, CAPABILITY_ACTION_TRACE, CAPABILITY_QUERY, CAPABILITY_QUERY_ORDER_BY, CAPABILITY_OSLC_QUERY, CAPABILITY_SCHEDULE, CAPABILITY_SCHEDULE_EXPLORE, CAPABILITY_SEQUENCE_AUTHORING, CAPABILITY_SET_VALUES, CAPABILITY_STRICT_CONFORMANCE, CAPABILITY_STRUCTURED_VALUES, CAPABILITY_UNDETERMINED_VALUE, CAPABILITY_VERIFICATION_VERDICTS, CAPABILITY_SYMBOL_ATTRIBUTES, CAPABILITY_SYMBOL_MEMBERS, CAPABILITY_ELEMENT_PROPERTIES, CAPABILITY_TENSOR_VALUES, CAPABILITY_TYPE_FACTS, CAPABILITY_UNSET_VALUE, CAPABILITY_VERIFICATION, CAPABILITY_AUTHORING, CAPABILITY_COMMENT_AUTHORING, CAPABILITY_CONNECTION_AUTHORING, CAPABILITY_CONSTRAINT_BODY_AUTHORING, CAPABILITY_DOCUMENTATION_AUTHORING, CAPABILITY_DOCUMENT_QUERY, CAPABILITY_IMPLICIT_PARAMETERS, CAPABILITY_IMPORT_AUTHORING, CAPABILITY_MEMBER_MODIFIERS, CAPABILITY_METADATA_AUTHORING, CAPABILITY_METADATA_PREFIX_AUTHORING, CAPABILITY_PARSE_SOURCES, CAPABILITY_RENDER_DOCUMENT, CAPABILITY_RENDER_DOCUMENT_HTML, CAPABILITY_RENDER_DOCUMENT_ASCIIDOC, CAPABILITY_REQUIREMENT_CONSTRAINT_AUTHORING, CAPABILITY_SATISFY_AUTHORING, CAPABILITY_STATE_ACTION_AUTHORING, CAPABILITY_TRANSITION_AUTHORING, CAPABILITY_VERIFICATION_OBJECTIVE_AUTHORING, CAPABILITY_VERIFICATION_QUESTIONS, CAPABILITY_VERIFICATION_ARGUMENTS, CAPABILITY_VERDICT_NOTES, MissingCapabilityError, ServerInfo, capabilityRefusal, mismatchReason, requireCapability, upgradeRemedy, CAPABILITY_IMPORT_DATA, CAPABILITY_COMPARE_RESULTS, } from "./capabilities.js";
|
|
28
29
|
export { AnalysisRunError, ChecksumMismatchError, ClosedConnectionError, ConversionError, DeleteReferencedError, DocumentQueryError, DownloadError, EditError, EditResultError, EditTargetError, EvaluationError, ExecutionError, FeatureValueError, IllegalMemberKindError, InstanceTypeError, InvalidEditError, InvalidRequestError, AuthenticationError, MemberNameTakenError, MigrationError, MoveReferencedError, NoEditsError, OverlappingEditsError, OwnerInsideTargetError, OwnerNotFoundError, OwnerNotNamespaceError, ReferencedElsewhereError, Referrer, RenameReferencedError, MalformedValueError, ManifestSignatureError, ModelFileNotFoundError, ModelNotFoundError, OpenSysMLError, ParseError, QueryError, ServiceError, ServiceStartError, ServiceTimeoutError, ServiceUnavailableError, StaleServiceError, SymbolNotFoundError, TypeMismatchError, UnpinnedReleaseError, UnsignedReleaseError, UnsupportedOperationError, UnsupportedValueError, WrongKindError, } from "./errors.js";
|
|
29
30
|
export type { FailureCause, ModelDiagnostic } from "./errors.js";
|
|
30
31
|
export { TypedObject, asBoolean, asComplex, asEnum, asInt, asObject, asQuantity, asRational, asReal, asString, asTyped, featureValue, listFeatureValue, optionalFeatureValue, registerTyped, } from "./typed.js";
|
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// The isomorphic core: everything that does not need a process to spawn.
|
|
2
2
|
export { Connection } from "./connection.js";
|
|
3
|
+
export { ElementIdentity, ElementProperties, ElementProperty, elementPropertiesOf, } from "./element-properties.js";
|
|
3
4
|
export { Instance, InstanceTree, Model, ModelSymbol, decodeDiagnostic, instanceFromJson } from "./model.js";
|
|
4
5
|
export { LANGUAGES, SourceDocument, sourceDocuments } from "./sources.js";
|
|
5
6
|
export { Conversion, EXPERIMENTAL_NOTICE, FORMAT_API_JSON, FORMAT_SYSML, FORMAT_TURTLE, MIGRATED_NOT_CONVERTED, MIGRATION_NOTICE, Migration, MigrationReport, formatOfPath, isExperimental, isV1, migrationReportOf, pathIsV1, } from "./conversion.js";
|
|
@@ -10,7 +11,7 @@ export { ENGINE_ALL, ENGINE_AUTO, STRENGTH_BOUNDED, STRENGTH_NOT_COVERED, STRENG
|
|
|
10
11
|
export { Exploration, Outcome } from "./exploration.js";
|
|
11
12
|
export { AppliedEdit, Body, EditedDocument, EditRequestBuilder, EditResult, Editor, editErrorOf, editResultOf, errorForFailure, failureName, referrersOf, } from "./edit.js";
|
|
12
13
|
export { AnalysisResult, toolDryRunOf, CalcResult, CaseEvaluation, KIND_ASSERTION, KIND_CONSTRAINT, KIND_OBJECT, KIND_OBJECTIVE, KIND_REQUIREMENT, KIND_SATISFY, QUESTION_EVALUATE, QUESTION_HOLDS, QUESTION_SATISFIABLE, STATUS_HOLDS, STATUS_SATISFIABLE, STATUS_UNDECIDED, STATUS_UNSATISFIABLE, STATUS_VIOLATED, SweepRow, SweepTable, RunsResult, SelfCheckResult, Recording, Validation, VERDICT_ERROR, VERDICT_FAIL, VERDICT_INCONCLUSIVE, VERDICT_PASS, explainVerificationVerdict, explainVerdict, raiseVerdictError, verificationPassed, verdictEvaluated, verdictHolds, ImportResult, ImportedFile, ImportedValue, Comparison, ConfigurationComparison, ObservableComparison, ComparedDistribution, } from "./verdict.js";
|
|
13
|
-
export { CAPABILITY_APPLY_EDITS, CAPABILITY_ACTION_BODY_STATEMENT_AUTHORING, CAPABILITY_CASE_EVALUATIONS, CAPABILITY_COMPLEX_VALUES, CAPABILITY_BIG_INT_VALUES, CAPABILITY_RATIONAL_VALUES, CAPABILITY_CONVERT, CAPABILITY_CONVERT_DOCUMENTS, CAPABILITY_CONVERT_COMPACT, CAPABILITY_CONVERT_LIBRARY_REFERENCES, CAPABILITY_CONVERT_LIBRARY_STUBS, CAPABILITY_CONVERT_CHECK_DIAGNOSTICS, CAPABILITY_PARSE_SOURCES_AFFECTED, CAPABILITY_RENDER_DOCUMENT_FILE_NAME, CAPABILITY_MIGRATE, CAPABILITY_DIAGNOSTIC_CODES, CAPABILITY_EDIT_DOCUMENTS, CAPABILITY_ENGINES, CAPABILITY_ENUM_VALUES, CAPABILITY_EVALUATE_SUBJECT, CAPABILITY_FEATURE_VALUES, CAPABILITY_FINAL_TIME, CAPABILITY_FUNCTION_VALUES, CAPABILITY_ORDER_DEPENDENCE, CAPABILITY_INFINITY_VALUE, CAPABILITY_INLINE_LANGUAGE, CAPABILITY_MEASUREMENT_REFS, CAPABILITY_METAOBJECT_VALUES, CAPABILITY_PERFORMER, CAPABILITY_RUNS, CAPABILITY_SELF_CHECK, CAPABILITY_RECORD_RUN, CAPABILITY_STATE_TRACE, CAPABILITY_ACTION_TRACE, CAPABILITY_QUERY, CAPABILITY_QUERY_ORDER_BY, CAPABILITY_OSLC_QUERY, CAPABILITY_SCHEDULE, CAPABILITY_SCHEDULE_EXPLORE, CAPABILITY_SEQUENCE_AUTHORING, CAPABILITY_SET_VALUES, CAPABILITY_STRICT_CONFORMANCE, CAPABILITY_STRUCTURED_VALUES, CAPABILITY_UNDETERMINED_VALUE, CAPABILITY_VERIFICATION_VERDICTS, CAPABILITY_SYMBOL_ATTRIBUTES, CAPABILITY_TENSOR_VALUES, CAPABILITY_TYPE_FACTS, CAPABILITY_UNSET_VALUE, CAPABILITY_VERIFICATION, CAPABILITY_AUTHORING, CAPABILITY_COMMENT_AUTHORING, CAPABILITY_CONNECTION_AUTHORING, CAPABILITY_CONSTRAINT_BODY_AUTHORING, CAPABILITY_DOCUMENTATION_AUTHORING, CAPABILITY_DOCUMENT_QUERY, CAPABILITY_IMPLICIT_PARAMETERS, CAPABILITY_IMPORT_AUTHORING, CAPABILITY_MEMBER_MODIFIERS, CAPABILITY_METADATA_AUTHORING, CAPABILITY_METADATA_PREFIX_AUTHORING, CAPABILITY_PARSE_SOURCES, CAPABILITY_RENDER_DOCUMENT, CAPABILITY_RENDER_DOCUMENT_HTML, CAPABILITY_RENDER_DOCUMENT_ASCIIDOC, CAPABILITY_REQUIREMENT_CONSTRAINT_AUTHORING, CAPABILITY_SATISFY_AUTHORING, CAPABILITY_STATE_ACTION_AUTHORING, CAPABILITY_TRANSITION_AUTHORING, CAPABILITY_VERIFICATION_OBJECTIVE_AUTHORING, CAPABILITY_VERIFICATION_QUESTIONS, CAPABILITY_VERIFICATION_ARGUMENTS, CAPABILITY_VERDICT_NOTES, MissingCapabilityError, ServerInfo, capabilityRefusal, mismatchReason, requireCapability, upgradeRemedy, CAPABILITY_IMPORT_DATA, CAPABILITY_COMPARE_RESULTS, } from "./capabilities.js";
|
|
14
|
+
export { CAPABILITY_APPLY_EDITS, CAPABILITY_ACTION_BODY_STATEMENT_AUTHORING, CAPABILITY_CASE_EVALUATIONS, CAPABILITY_COMPLEX_VALUES, CAPABILITY_BIG_INT_VALUES, CAPABILITY_RATIONAL_VALUES, CAPABILITY_CONVERT, CAPABILITY_CONVERT_DOCUMENTS, CAPABILITY_CONVERT_COMPACT, CAPABILITY_CONVERT_LIBRARY_REFERENCES, CAPABILITY_CONVERT_LIBRARY_STUBS, CAPABILITY_CONVERT_CHECK_DIAGNOSTICS, CAPABILITY_PARSE_SOURCES_AFFECTED, CAPABILITY_RENDER_DOCUMENT_FILE_NAME, CAPABILITY_MIGRATE, CAPABILITY_DIAGNOSTIC_CODES, CAPABILITY_EDIT_DOCUMENTS, CAPABILITY_ENGINES, CAPABILITY_ENUM_VALUES, CAPABILITY_EVALUATE_SUBJECT, CAPABILITY_FEATURE_VALUES, CAPABILITY_FINAL_TIME, CAPABILITY_FUNCTION_VALUES, CAPABILITY_ORDER_DEPENDENCE, CAPABILITY_INFINITY_VALUE, CAPABILITY_INLINE_LANGUAGE, CAPABILITY_MEASUREMENT_REFS, CAPABILITY_METAOBJECT_VALUES, CAPABILITY_PERFORMER, CAPABILITY_RUNS, CAPABILITY_SELF_CHECK, CAPABILITY_RECORD_RUN, CAPABILITY_STATE_TRACE, CAPABILITY_ACTION_TRACE, CAPABILITY_QUERY, CAPABILITY_QUERY_ORDER_BY, CAPABILITY_OSLC_QUERY, CAPABILITY_SCHEDULE, CAPABILITY_SCHEDULE_EXPLORE, CAPABILITY_SEQUENCE_AUTHORING, CAPABILITY_SET_VALUES, CAPABILITY_STRICT_CONFORMANCE, CAPABILITY_STRUCTURED_VALUES, CAPABILITY_UNDETERMINED_VALUE, CAPABILITY_VERIFICATION_VERDICTS, CAPABILITY_SYMBOL_ATTRIBUTES, CAPABILITY_SYMBOL_MEMBERS, CAPABILITY_ELEMENT_PROPERTIES, CAPABILITY_TENSOR_VALUES, CAPABILITY_TYPE_FACTS, CAPABILITY_UNSET_VALUE, CAPABILITY_VERIFICATION, CAPABILITY_AUTHORING, CAPABILITY_COMMENT_AUTHORING, CAPABILITY_CONNECTION_AUTHORING, CAPABILITY_CONSTRAINT_BODY_AUTHORING, CAPABILITY_DOCUMENTATION_AUTHORING, CAPABILITY_DOCUMENT_QUERY, CAPABILITY_IMPLICIT_PARAMETERS, CAPABILITY_IMPORT_AUTHORING, CAPABILITY_MEMBER_MODIFIERS, CAPABILITY_METADATA_AUTHORING, CAPABILITY_METADATA_PREFIX_AUTHORING, CAPABILITY_PARSE_SOURCES, CAPABILITY_RENDER_DOCUMENT, CAPABILITY_RENDER_DOCUMENT_HTML, CAPABILITY_RENDER_DOCUMENT_ASCIIDOC, CAPABILITY_REQUIREMENT_CONSTRAINT_AUTHORING, CAPABILITY_SATISFY_AUTHORING, CAPABILITY_STATE_ACTION_AUTHORING, CAPABILITY_TRANSITION_AUTHORING, CAPABILITY_VERIFICATION_OBJECTIVE_AUTHORING, CAPABILITY_VERIFICATION_QUESTIONS, CAPABILITY_VERIFICATION_ARGUMENTS, CAPABILITY_VERDICT_NOTES, MissingCapabilityError, ServerInfo, capabilityRefusal, mismatchReason, requireCapability, upgradeRemedy, CAPABILITY_IMPORT_DATA, CAPABILITY_COMPARE_RESULTS, } from "./capabilities.js";
|
|
14
15
|
export { AnalysisRunError, ChecksumMismatchError, ClosedConnectionError, ConversionError, DeleteReferencedError, DocumentQueryError, DownloadError, EditError, EditResultError, EditTargetError, EvaluationError, ExecutionError, FeatureValueError, IllegalMemberKindError, InstanceTypeError, InvalidEditError, InvalidRequestError, AuthenticationError, MemberNameTakenError, MigrationError, MoveReferencedError, NoEditsError, OverlappingEditsError, OwnerInsideTargetError, OwnerNotFoundError, OwnerNotNamespaceError, ReferencedElsewhereError, Referrer, RenameReferencedError, MalformedValueError, ManifestSignatureError, ModelFileNotFoundError, ModelNotFoundError, OpenSysMLError, ParseError, QueryError, ServiceError, ServiceStartError, ServiceTimeoutError, ServiceUnavailableError, StaleServiceError, SymbolNotFoundError, TypeMismatchError, UnpinnedReleaseError, UnsignedReleaseError, UnsupportedOperationError, UnsupportedValueError, WrongKindError, } from "./errors.js";
|
|
15
16
|
export { TypedObject, asBoolean, asComplex, asEnum, asInt, asObject, asQuantity, asRational, asReal, asString, asTyped, featureValue, listFeatureValue, optionalFeatureValue, registerTyped, } from "./typed.js";
|
|
16
17
|
export { callRpc, fromHandshakeError, fromRpcError, statusName } from "./status.js";
|
package/dist/core/model.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Connection, VerifyOptions } from "./connection.js";
|
|
2
2
|
import type { ModelDiagnostic } from "./errors.js";
|
|
3
3
|
import type { Conversion, ConvertOptions } from "./conversion.js";
|
|
4
|
+
import type { ElementProperties } from "./element-properties.js";
|
|
4
5
|
import type { QueryForm, QueryElement, QueryPayload } from "./query.js";
|
|
5
6
|
import type { BindingValues, DocumentQueryResult } from "./document.js";
|
|
6
7
|
import type { RenderedView } from "./render-view.js";
|
|
@@ -106,6 +107,8 @@ export declare class Model {
|
|
|
106
107
|
query(options?: {
|
|
107
108
|
payload?: QueryPayload;
|
|
108
109
|
} & QueryForm): Promise<QueryElement[]>;
|
|
110
|
+
/** Reads the metamodel properties of one element by their specification names. */
|
|
111
|
+
elementProperties(element: string, ...properties: string[]): Promise<ElementProperties>;
|
|
109
112
|
/** Runs a named document query against this model. */
|
|
110
113
|
runDocumentQuery(queryId: string, bindings?: Readonly<Record<string, BindingValues>>): Promise<DocumentQueryResult>;
|
|
111
114
|
/** Renders a named document of this model to Markdown, HTML or AsciiDoc. */
|
package/dist/core/model.js
CHANGED
|
@@ -269,6 +269,10 @@ export class Model {
|
|
|
269
269
|
query(options = {}) {
|
|
270
270
|
return this.connection.query(this.hash, options);
|
|
271
271
|
}
|
|
272
|
+
/** Reads the metamodel properties of one element by their specification names. */
|
|
273
|
+
elementProperties(element, ...properties) {
|
|
274
|
+
return this.connection.elementProperties(this.hash, element, properties);
|
|
275
|
+
}
|
|
272
276
|
/** Runs a named document query against this model. */
|
|
273
277
|
runDocumentQuery(queryId, bindings) {
|
|
274
278
|
return this.connection.runDocumentQuery(this.hash, queryId, bindings);
|
|
@@ -45,9 +45,13 @@ export interface RenderNode {
|
|
|
45
45
|
type: string;
|
|
46
46
|
detail: string;
|
|
47
47
|
text: string;
|
|
48
|
+
/** On an item box drawn on a connection line: `right` toward the line's second end, `left` toward its first; empty otherwise. */
|
|
49
|
+
arrow: string;
|
|
48
50
|
standIn: boolean;
|
|
49
51
|
/** The owner the node is drawn or listed under has the usage through typing, subclassification or subsetting rather than declares it; the notation draws `^` before `name`. */
|
|
50
52
|
inherited: boolean;
|
|
53
|
+
/** The state's substates run in parallel; the notation writes «parallel» under the name. */
|
|
54
|
+
parallel: boolean;
|
|
51
55
|
parent: string;
|
|
52
56
|
/** The compartment of the parent this node is a row of ("attributes", "parts", ...); empty for a box. */
|
|
53
57
|
compartment: string;
|
|
@@ -90,6 +94,14 @@ export interface RenderNote {
|
|
|
90
94
|
hasSize: boolean;
|
|
91
95
|
origin?: RenderSpan;
|
|
92
96
|
}
|
|
97
|
+
/** The view frame of SysML v2 §8.2.3.26 round a graph-shaped rendering. */
|
|
98
|
+
export interface RenderFrame {
|
|
99
|
+
name: string;
|
|
100
|
+
type: string;
|
|
101
|
+
exposes: readonly string[];
|
|
102
|
+
filters: readonly string[];
|
|
103
|
+
annotations: readonly string[];
|
|
104
|
+
}
|
|
93
105
|
export interface RenderedView {
|
|
94
106
|
view: string;
|
|
95
107
|
kind: string;
|
|
@@ -103,6 +115,8 @@ export interface RenderedView {
|
|
|
103
115
|
notices: readonly string[];
|
|
104
116
|
/** The optional notation elements the rendering drew. */
|
|
105
117
|
shown: readonly string[];
|
|
118
|
+
/** The view frame; absent for a frameless rendering. */
|
|
119
|
+
frame?: RenderFrame;
|
|
106
120
|
}
|
|
107
121
|
/** Reads a rendering saved as the protojson of a RenderViewResponse (as JSON.parse returns it), as a service or a WASM module answers it. */
|
|
108
122
|
export declare function renderedViewFromJson(json: unknown): RenderedView;
|
package/dist/core/render-view.js
CHANGED
|
@@ -55,8 +55,10 @@ function nodeOf(node) {
|
|
|
55
55
|
type: node.type,
|
|
56
56
|
detail: node.detail,
|
|
57
57
|
text: node.text,
|
|
58
|
+
arrow: node.arrow,
|
|
58
59
|
standIn: node.standIn,
|
|
59
60
|
inherited: node.inherited,
|
|
61
|
+
parallel: node.parallel,
|
|
60
62
|
compartment: node.compartment,
|
|
61
63
|
parent: node.parent,
|
|
62
64
|
ports: node.ports.map(portOf),
|
|
@@ -112,8 +114,20 @@ function canvasOf(canvas) {
|
|
|
112
114
|
export function renderedViewFromJson(json) {
|
|
113
115
|
return renderedViewOf(fromJson(RenderViewResponseSchema, json));
|
|
114
116
|
}
|
|
117
|
+
function frameOf(frame) {
|
|
118
|
+
return frame === undefined
|
|
119
|
+
? undefined
|
|
120
|
+
: {
|
|
121
|
+
name: frame.name,
|
|
122
|
+
type: frame.type,
|
|
123
|
+
exposes: [...frame.exposes],
|
|
124
|
+
filters: [...frame.filters],
|
|
125
|
+
annotations: [...frame.annotations],
|
|
126
|
+
};
|
|
127
|
+
}
|
|
115
128
|
export function renderedViewOf(response) {
|
|
116
129
|
const canvas = canvasOf(response.canvas);
|
|
130
|
+
const frame = frameOf(response.frame);
|
|
117
131
|
return {
|
|
118
132
|
view: response.view,
|
|
119
133
|
kind: response.kind,
|
|
@@ -126,5 +140,6 @@ export function renderedViewOf(response) {
|
|
|
126
140
|
notices: [...response.notices],
|
|
127
141
|
shown: [...response.shown],
|
|
128
142
|
...(canvas === undefined ? {} : { canvas }),
|
|
143
|
+
...(frame === undefined ? {} : { frame }),
|
|
129
144
|
};
|
|
130
145
|
}
|