node-opcua-address-space 2.178.0 → 2.179.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.
Files changed (184) hide show
  1. package/dist/source/address_space_ts.d.ts +16 -6
  2. package/dist/source/address_space_ts.js +1 -1
  3. package/dist/source/address_space_ts.js.map +1 -1
  4. package/dist/source/helpers/argument_list.js +2 -2
  5. package/dist/source/helpers/argument_list.js.map +1 -1
  6. package/dist/source/helpers/call_helpers.js +3 -0
  7. package/dist/source/helpers/call_helpers.js.map +1 -1
  8. package/dist/source/helpers/dump_tools.js +6 -2
  9. package/dist/source/helpers/dump_tools.js.map +1 -1
  10. package/dist/source/helpers/make_optionals_map.d.ts +3 -1
  11. package/dist/source/helpers/make_optionals_map.js.map +1 -1
  12. package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
  13. package/dist/source/interfaces/state_machine/ua_state_machine_type.js +0 -1
  14. package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -1
  15. package/dist/source/loader/decode_xml_extension_object.js.map +1 -1
  16. package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
  17. package/dist/source/loader/generateAddressSpaceRaw.js +2 -1
  18. package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
  19. package/dist/source/loader/load_nodeset2.js +12 -8
  20. package/dist/source/loader/load_nodeset2.js.map +1 -1
  21. package/dist/source/loader/make_xml_extension_object_parser.js +26 -7
  22. package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
  23. package/dist/source/loader/namespace_post_step.js.map +1 -1
  24. package/dist/source/loader/parsers/extension_object_parser.d.ts +6 -4
  25. package/dist/source/loader/parsers/extension_object_parser.js +12 -6
  26. package/dist/source/loader/parsers/extension_object_parser.js.map +1 -1
  27. package/dist/source/loader/parsers/localized_text_parser.d.ts +1 -1
  28. package/dist/source/loader/parsers/nodeid_parser.d.ts +10 -2
  29. package/dist/source/loader/parsers/nodeid_parser.js.map +1 -1
  30. package/dist/source/loader/parsers/qualified_name_parser.d.ts +1 -2
  31. package/dist/source/loader/parsers/variant_parser.d.ts +8 -2
  32. package/dist/source/loader/parsers/variant_parser.js +11 -8
  33. package/dist/source/loader/parsers/variant_parser.js.map +1 -1
  34. package/dist/source/pseudo_session.js +70 -24
  35. package/dist/source/pseudo_session.js.map +1 -1
  36. package/dist/source/session_context.js.map +1 -1
  37. package/dist/source/xml_writer.d.ts +1 -1
  38. package/dist/src/_instantiate_helpers.js +0 -3
  39. package/dist/src/_instantiate_helpers.js.map +1 -1
  40. package/dist/src/_mandatory_child_or_requested_optional_filter.d.ts +3 -2
  41. package/dist/src/_mandatory_child_or_requested_optional_filter.js +0 -2
  42. package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +1 -1
  43. package/dist/src/address_space.d.ts +7 -2
  44. package/dist/src/address_space.js +36 -28
  45. package/dist/src/address_space.js.map +1 -1
  46. package/dist/src/address_space_private.d.ts +1 -0
  47. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +6 -9
  48. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
  49. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +6 -6
  50. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
  51. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +8 -4
  52. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  53. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
  54. package/dist/src/alarms_and_conditions/ua_condition_impl.js +6 -5
  55. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  56. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +3 -0
  57. package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -1
  58. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +0 -1
  59. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
  60. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
  61. package/dist/src/base_node_impl.js +17 -8
  62. package/dist/src/base_node_impl.js.map +1 -1
  63. package/dist/src/base_node_private.js +0 -6
  64. package/dist/src/base_node_private.js.map +1 -1
  65. package/dist/src/extension_object_array_node.d.ts +9 -1
  66. package/dist/src/extension_object_array_node.js +20 -3
  67. package/dist/src/extension_object_array_node.js.map +1 -1
  68. package/dist/src/get_basic_datatype.js +3 -1
  69. package/dist/src/get_basic_datatype.js.map +1 -1
  70. package/dist/src/historical_access/address_space_historical_data_node.js +2 -4
  71. package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
  72. package/dist/src/namespace_impl.js +6 -5
  73. package/dist/src/namespace_impl.js.map +1 -1
  74. package/dist/src/nodeid_manager.js +4 -5
  75. package/dist/src/nodeid_manager.js.map +1 -1
  76. package/dist/src/nodeset_tools/construct_namespace_dependency.js +10 -11
  77. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
  78. package/dist/src/nodeset_tools/dump_to_bsd.js +2 -4
  79. package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
  80. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
  81. package/dist/src/nodeset_tools/nodeset_to_xml.js +71 -43
  82. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  83. package/dist/src/private_namespace.js.map +1 -1
  84. package/dist/src/reference_impl.d.ts +2 -2
  85. package/dist/src/reference_impl.js +5 -4
  86. package/dist/src/reference_impl.js.map +1 -1
  87. package/dist/src/state_machine/finite_state_machine.js +1 -1
  88. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  89. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
  90. package/dist/src/state_machine/ua_two_state_variable.js +9 -7
  91. package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
  92. package/dist/src/tool_isSubtypeOf.js.map +1 -1
  93. package/dist/src/ua_data_type_impl.js +4 -4
  94. package/dist/src/ua_data_type_impl.js.map +1 -1
  95. package/dist/src/ua_method_impl.js +21 -11
  96. package/dist/src/ua_method_impl.js.map +1 -1
  97. package/dist/src/ua_object_type_impl.d.ts +5 -2
  98. package/dist/src/ua_object_type_impl.js +4 -3
  99. package/dist/src/ua_object_type_impl.js.map +1 -1
  100. package/dist/src/ua_reference_type_impl.js +1 -2
  101. package/dist/src/ua_reference_type_impl.js.map +1 -1
  102. package/dist/src/ua_variable_impl.d.ts +9 -11
  103. package/dist/src/ua_variable_impl.js +103 -65
  104. package/dist/src/ua_variable_impl.js.map +1 -1
  105. package/dist/src/ua_variable_impl_ext_obj.d.ts +6 -6
  106. package/dist/src/ua_variable_impl_ext_obj.js +33 -22
  107. package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
  108. package/dist/src/ua_variable_type_impl.js +6 -2
  109. package/dist/src/ua_variable_type_impl.js.map +1 -1
  110. package/dist/tsconfig_base.tsbuildinfo +1 -1
  111. package/distHelpers/add_event_generator_object.js +3 -0
  112. package/distHelpers/add_event_generator_object.js.map +1 -1
  113. package/distHelpers/boiler_system.js +27 -6
  114. package/distHelpers/boiler_system.js.map +1 -1
  115. package/distHelpers/create_minimalist_address_space_nodeset.js +3 -3
  116. package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
  117. package/distHelpers/date_utils.js.map +1 -1
  118. package/distHelpers/dump_statemachine.js +1 -1
  119. package/distHelpers/dump_statemachine.js.map +1 -1
  120. package/distHelpers/get_address_space_fixture.js +0 -1
  121. package/distHelpers/get_address_space_fixture.js.map +1 -1
  122. package/package.json +41 -41
  123. package/source/address_space_ts.ts +19 -9
  124. package/source/helpers/argument_list.ts +2 -2
  125. package/source/helpers/call_helpers.ts +4 -1
  126. package/source/helpers/dump_tools.ts +7 -3
  127. package/source/helpers/make_optionals_map.ts +4 -2
  128. package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +4 -3
  129. package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +10 -11
  130. package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +6 -7
  131. package/source/interfaces/extension_object_constructor.ts +1 -1
  132. package/source/interfaces/state_machine/ua_program_state_machine_type.ts +0 -1
  133. package/source/interfaces/state_machine/ua_state_machine_type.ts +0 -1
  134. package/source/loader/decode_xml_extension_object.ts +3 -3
  135. package/source/loader/ensure_datatype_extracted.ts +6 -2
  136. package/source/loader/generateAddressSpaceRaw.ts +5 -4
  137. package/source/loader/load_nodeset2.ts +12 -8
  138. package/source/loader/make_xml_extension_object_parser.ts +78 -45
  139. package/source/loader/namespace_post_step.ts +1 -1
  140. package/source/loader/parsers/extension_object_parser.ts +36 -27
  141. package/source/loader/parsers/localized_text_parser.ts +1 -1
  142. package/source/loader/parsers/nodeid_parser.ts +10 -2
  143. package/source/loader/parsers/qualified_name_parser.ts +1 -1
  144. package/source/loader/parsers/variant_parser.ts +53 -40
  145. package/source/pseudo_session.ts +81 -28
  146. package/source/session_context.ts +1 -0
  147. package/source/xml_writer.ts +1 -1
  148. package/src/_instantiate_helpers.ts +0 -3
  149. package/src/_mandatory_child_or_requested_optional_filter.ts +3 -4
  150. package/src/address_space.ts +58 -42
  151. package/src/address_space_private.ts +2 -0
  152. package/src/alarms_and_conditions/condition_snapshot_impl.ts +6 -10
  153. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +5 -7
  154. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +20 -13
  155. package/src/alarms_and_conditions/ua_base_event_impl.ts +1 -1
  156. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +1 -1
  157. package/src/alarms_and_conditions/ua_condition_impl.ts +12 -10
  158. package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +8 -5
  159. package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +0 -1
  160. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +0 -1
  161. package/src/apply_condition_refresh.ts +1 -1
  162. package/src/base_node_impl.ts +30 -35
  163. package/src/base_node_private.ts +0 -6
  164. package/src/extension_object_array_node.ts +44 -15
  165. package/src/get_basic_datatype.ts +4 -1
  166. package/src/historical_access/address_space_historical_data_node.ts +2 -5
  167. package/src/namespace_impl.ts +24 -17
  168. package/src/nodeid_manager.ts +8 -11
  169. package/src/nodeset_tools/construct_namespace_dependency.ts +18 -15
  170. package/src/nodeset_tools/dump_to_bsd.ts +6 -8
  171. package/src/nodeset_tools/nodeset_to_xml.ts +105 -75
  172. package/src/private_namespace.ts +7 -2
  173. package/src/reference_impl.ts +11 -10
  174. package/src/state_machine/finite_state_machine.ts +12 -10
  175. package/src/state_machine/ua_shelving_state_machine_ex.ts +4 -4
  176. package/src/state_machine/ua_two_state_variable.ts +12 -9
  177. package/src/tool_isSubtypeOf.ts +2 -9
  178. package/src/ua_data_type_impl.ts +4 -4
  179. package/src/ua_method_impl.ts +24 -14
  180. package/src/ua_object_type_impl.ts +12 -6
  181. package/src/ua_reference_type_impl.ts +2 -3
  182. package/src/ua_variable_impl.ts +142 -96
  183. package/src/ua_variable_impl_ext_obj.ts +110 -82
  184. package/src/ua_variable_type_impl.ts +17 -5
@@ -15,6 +15,7 @@ import { VariableTypeIds } from "node-opcua-constants";
15
15
  import {
16
16
  BrowseDirection,
17
17
  coerceLocalizedText,
18
+ coerceLocalizedTextStrict,
18
19
  type LocalizedText,
19
20
  type LocalizedTextLike,
20
21
  type QualifiedNameLike
@@ -93,13 +94,13 @@ function _getEffectiveDisplayName<_T, _DT extends DataType>(
93
94
  }
94
95
  const boolValue = node.getValue();
95
96
 
96
- let subStateNodes;
97
+ let subStateNodes: BaseNode[];
97
98
  if (boolValue) {
98
99
  subStateNodes = node.findReferencesExAsObject("HasTrueSubState", BrowseDirection.Forward);
99
100
  } else {
100
101
  subStateNodes = node.findReferencesExAsObject("HasFalseSubState", BrowseDirection.Forward);
101
102
  }
102
- const _states = subStateNodes.forEach((_n: any) => {
103
+ const _states = subStateNodes.forEach((_n: BaseNode) => {
103
104
  // todo happen
104
105
  });
105
106
 
@@ -113,7 +114,7 @@ function _getHumanReadableString(node: UATwoStateVariableImpl): DataValueT<Local
113
114
  const _c = dataValue.clone() as DataValueT<LocalizedText, DataType.LocalizedText>;
114
115
  _c.value = new Variant({
115
116
  dataType: DataType.LocalizedText,
116
- value: coerceLocalizedText("")!
117
+ value: coerceLocalizedTextStrict("")
117
118
  }) as VariantT<LocalizedText, DataType.LocalizedText>;
118
119
 
119
120
  return _c;
@@ -199,6 +200,7 @@ export declare interface UATwoStateVariableImpl extends UATwoStateVariableEx {
199
200
  /***
200
201
  * @class UATwoStateVariable
201
202
  */
203
+ // biome-ignore lint/suspicious/noUnsafeDeclarationMerging: interface adds typed members/overloads for this class
202
204
  export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataType.LocalizedText> implements UATwoStateVariableEx {
203
205
  private _trueState?: string;
204
206
  private _falseState?: string;
@@ -222,7 +224,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
222
224
  value: coerceLocalizedText(options.trueState)
223
225
  });
224
226
  } else {
225
- this._trueState = coerceLocalizedText(options.trueState)?.text!;
227
+ this._trueState = coerceLocalizedTextStrict(options.trueState).text ?? undefined;
226
228
  }
227
229
  if (this.falseState) {
228
230
  this.falseState.setValueFromSource({
@@ -230,7 +232,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
230
232
  value: coerceLocalizedText(options.falseState)
231
233
  });
232
234
  } else {
233
- this._falseState = coerceLocalizedText(options.falseState)?.text!;
235
+ this._falseState = coerceLocalizedTextStrict(options.falseState).text ?? undefined;
234
236
  }
235
237
  }
236
238
 
@@ -305,10 +307,11 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
305
307
  // EffectiveDisplayName will be constructed by adding the EnabledState
306
308
  // and the State of the addTrue state
307
309
  if (this.effectiveDisplayName) {
310
+ const effectiveDisplayName = this.effectiveDisplayName as UAVariableImpl;
308
311
  this.id.on("value_changed", () => {
309
- (this.effectiveDisplayName! as UAVariableImpl)._internal_set_dataValue(_getEffectiveDisplayName(this));
312
+ effectiveDisplayName._internal_set_dataValue(_getEffectiveDisplayName(this));
310
313
  });
311
- (this.effectiveDisplayName! as UAVariableImpl)._internal_set_dataValue(_getEffectiveDisplayName(this));
314
+ effectiveDisplayName._internal_set_dataValue(_getEffectiveDisplayName(this));
312
315
  }
313
316
  }
314
317
  /**
@@ -344,10 +347,10 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
344
347
  return dataValue.value.value.text?.toString() || "";
345
348
  }
346
349
  public getTrueState(): LocalizedText {
347
- return this.trueState ? this.trueState.readValue().value.value : coerceLocalizedText(this._trueState || "TRUE")!;
350
+ return this.trueState ? this.trueState.readValue().value.value : coerceLocalizedTextStrict(this._trueState || "TRUE");
348
351
  }
349
352
  public getFalseState(): LocalizedText {
350
- return this.falseState ? this.falseState.readValue().value.value : coerceLocalizedText(this._falseState || "FALSE")!;
353
+ return this.falseState ? this.falseState.readValue().value.value : coerceLocalizedTextStrict(this._falseState || "FALSE");
351
354
  }
352
355
  // TODO : shall we care about overloading the remove_backward_reference method ?
353
356
  // some TrueSubState and FalseSubState relationship may be added later
@@ -4,7 +4,6 @@
4
4
 
5
5
  import type {
6
6
  BaseNode,
7
- BaseNodeEvents,
8
7
  UADataType,
9
8
  UAObjectType,
10
9
  UAReference,
@@ -26,11 +25,7 @@ function _filterSubType(reference: UAReference) {
26
25
 
27
26
  export type BaseNodeConstructor<T extends BaseNode> = new () => T;
28
27
 
29
- function _slow_isSubtypeOf<T extends UAType>(
30
- this: T,
31
- Class: typeof BaseNodeImpl,
32
- baseType: T | NodeIdLike
33
- ): boolean {
28
+ function _slow_isSubtypeOf<T extends UAType>(this: T, Class: typeof BaseNodeImpl, baseType: T | NodeIdLike): boolean {
34
29
  if (!(baseType instanceof Class)) {
35
30
  const node = this.addressSpace.findNode(baseType as NodeIdLike);
36
31
  if (!node || !(node instanceof Class)) {
@@ -117,9 +112,7 @@ export type IsSubtypeOfFunc<T extends UAType> = (this: T, baseType: T) => boolea
117
112
 
118
113
  export type UAType = UAReferenceType | UADataType | UAObjectType | UAVariableType;
119
114
 
120
- export function construct_isSubtypeOf<T extends UAType>(
121
- Class: typeof BaseNodeImpl
122
- ): IsSubtypeOfFunc<T> {
115
+ export function construct_isSubtypeOf<T extends UAType>(Class: typeof BaseNodeImpl): IsSubtypeOfFunc<T> {
123
116
  return wrap_memoize(function (this: T, baseType: T | NodeIdLike): boolean {
124
117
  if (!(baseType instanceof Class)) {
125
118
  throw new Error(
@@ -272,7 +272,6 @@ export class UADataTypeImpl extends BaseNodeImpl implements UADataType {
272
272
  return definition as EnumDefinition;
273
273
  }
274
274
 
275
- // eslint-disable-next-line complexity
276
275
  public _getDefinition(): DataTypeDefinition | null {
277
276
  if (this.$fullDefinition !== undefined) {
278
277
  return this.$fullDefinition;
@@ -314,7 +313,6 @@ export class UADataTypeImpl extends BaseNodeImpl implements UADataType {
314
313
  this.$fullDefinition = makeStructureDefinition(basicDataType, defaultEncodingId, definitionFields, isUnion);
315
314
  } else if (isEnumeration) {
316
315
  const allPartialDefinitions: StructureFieldOptions[][] = [];
317
- // eslint-disable-next-line @typescript-eslint/no-this-alias
318
316
  let dataTypeNode: UADataTypeImpl | null = this;
319
317
  while (dataTypeNode && !isRootDataType(dataTypeNode)) {
320
318
  if (dataTypeNode.$partialDefinition) {
@@ -420,10 +418,12 @@ function makeStructureDefinition(
420
418
  const hasSubtypedFields = fields.filter((field) => field.allowSubTypes).length > 0;
421
419
 
422
420
  if (hasSubtypedFields && doDebug) {
423
- debugLog("Fields with subtypes:");
421
+ // c8 ignore next
422
+ doDebug && debugLog("Fields with subtypes:");
424
423
  for (const field of fields) {
425
424
  if (field.allowSubTypes) {
426
- debugLog(" ", field.name, field.dataType?.toString());
425
+ // c8 ignore next
426
+ doDebug && debugLog(" ", field.name, field.dataType?.toString());
427
427
  }
428
428
  }
429
429
  }
@@ -15,7 +15,7 @@ import {
15
15
  type MethodFunctorC,
16
16
  makeDefaultCloneExtraInfo,
17
17
  type UAMethod,
18
- type UAMethodEvents,
18
+ type UAMethodEvents,
19
19
  type UAObject,
20
20
  type UAObjectType,
21
21
  type UAVariable
@@ -23,7 +23,7 @@ import {
23
23
  import { assert } from "node-opcua-assert";
24
24
  import { AttributeIds, type DiagnosticInfo, NodeClass, type QualifiedNameLike } from "node-opcua-data-model";
25
25
  import { DataValue, type DataValueLike } from "node-opcua-data-value";
26
- import { make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
26
+ import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
27
27
  import type { NodeId } from "node-opcua-nodeid";
28
28
  import type { NumericRange } from "node-opcua-numeric-range";
29
29
  import { Argument } from "node-opcua-service-call";
@@ -38,6 +38,7 @@ import { _handle_hierarchy_parent } from "./namespace_impl";
38
38
 
39
39
  const warningLog = make_warningLog(__filename);
40
40
  const debugLog = make_debugLog(__filename);
41
+ const doDebug = checkDebugFlag(__filename);
41
42
  const errorLog = make_errorLog(__filename);
42
43
 
43
44
  function default_check_valid_argument(arg: unknown): boolean {
@@ -157,7 +158,7 @@ export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMeth
157
158
  inputArguments: VariantLike[] | null,
158
159
  context: ISessionContext,
159
160
  callback?: CallbackT<CallMethodResultOptions>
160
- ): any {
161
+ ): Promise<CallMethodResultOptions> | undefined {
161
162
  // c8 ignore next
162
163
  if (!callback) {
163
164
  throw new Error("execute need to be promisified");
@@ -174,7 +175,8 @@ export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMeth
174
175
  // c8 ignore next
175
176
  if (!object) {
176
177
  errorLog("UAMethod#execute expects a valid object");
177
- return callback(null, { statusCode: StatusCodes.BadInternalError });
178
+ callback(null, { statusCode: StatusCodes.BadInternalError });
179
+ return;
178
180
  }
179
181
 
180
182
  if (object.nodeClass !== NodeClass.Object && object.nodeClass !== NodeClass.ObjectType) {
@@ -186,24 +188,29 @@ export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMeth
186
188
  " called for a node that is not a Object/ObjectType but " +
187
189
  NodeClass[context.object?.nodeClass as number]
188
190
  );
189
- return callback(null, { statusCode: StatusCodes.BadNodeIdInvalid });
191
+ callback(null, { statusCode: StatusCodes.BadNodeIdInvalid });
192
+ return;
190
193
  }
191
194
  if (!this._asyncExecutionFunction) {
192
195
  warningLog(`Method ${this.nodeId.toString()} ${this.browseName.toString()} has not been bound`);
193
- return callback(null, { statusCode: StatusCodes.BadInternalError });
196
+ callback(null, { statusCode: StatusCodes.BadInternalError });
197
+ return;
194
198
  }
195
199
 
196
200
  if (!this.getExecutableFlag(context)) {
197
201
  warningLog(`Method ${this.nodeId.toString()} ${this.browseName.toString()} is not executable`);
198
- return callback(null, { statusCode: StatusCodes.BadNotExecutable });
202
+ callback(null, { statusCode: StatusCodes.BadNotExecutable });
203
+ return;
199
204
  }
200
205
 
201
206
  if (context.isAccessRestricted(this)) {
202
- return callback(null, { statusCode: StatusCodes.BadSecurityModeInsufficient });
207
+ callback(null, { statusCode: StatusCodes.BadSecurityModeInsufficient });
208
+ return;
203
209
  }
204
210
 
205
211
  if (!context.checkPermission(this, PermissionType.Call)) {
206
- return callback(null, { statusCode: StatusCodes.BadUserAccessDenied });
212
+ callback(null, { statusCode: StatusCodes.BadUserAccessDenied });
213
+ return;
207
214
  }
208
215
 
209
216
  // verify that input arguments are correct
@@ -240,7 +247,8 @@ export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMeth
240
247
  inputArgumentResults: coercedInputArguments?.map(() => status) || [],
241
248
  inputArgumentDiagnosticInfos
242
249
  };
243
- return callback?.(null, callMethodResult);
250
+ callback?.(null, callMethodResult);
251
+ return;
244
252
  }
245
253
  }
246
254
 
@@ -252,8 +260,11 @@ export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMeth
252
260
  context,
253
261
  (err: Error | null, callMethodResult?: CallMethodResultOptions) => {
254
262
  if (err) {
255
- debugLog(err.message);
256
- debugLog(err);
263
+ // c8 ignore next
264
+ if (doDebug) {
265
+ debugLog(err.message);
266
+ debugLog(err);
267
+ }
257
268
  }
258
269
  callMethodResult = callMethodResult || {};
259
270
 
@@ -296,6 +307,7 @@ export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMeth
296
307
  const callMethodResponse = { statusCode: StatusCodes.BadInternalError };
297
308
  callback?.(err as Error, callMethodResponse);
298
309
  });
310
+ return undefined;
299
311
  }
300
312
 
301
313
  public clone(options: CloneOptions, optionalFilter?: CloneFilter, extraInfo?: CloneExtraInfo): UAMethod {
@@ -345,8 +357,6 @@ export class UAMethodImpl extends BaseNodeImpl<UAMethodEvents> implements UAMeth
345
357
  }
346
358
  }
347
359
 
348
- // tslint:disable:no-var-requires
349
- // tslint:disable:max-line-length
350
360
  import { withCallback } from "thenify-ex";
351
361
 
352
362
  UAMethodImpl.prototype.execute = withCallback(UAMethodImpl.prototype.execute);
@@ -12,21 +12,24 @@ import type {
12
12
  UAReference
13
13
  } from "node-opcua-address-space-base";
14
14
  import { assert } from "node-opcua-assert";
15
- import { AttributeIds, NodeClass } from "node-opcua-data-model";
15
+ import { AttributeIds, type LocalizedTextLike, NodeClass } from "node-opcua-data-model";
16
16
  import { DataValue, type DataValueLike } from "node-opcua-data-value";
17
17
  import type { NodeId } from "node-opcua-nodeid";
18
18
  import { StatusCodes } from "node-opcua-status-code";
19
- import { isNullOrUndefined } from "node-opcua-utils";
20
19
  import { DataType } from "node-opcua-variant";
21
20
 
22
21
  import { SessionContext } from "../source/session_context";
23
22
  import { initialize_properties_and_components } from "./_instantiate_helpers";
24
23
  import type { AddressSpacePrivate } from "./address_space_private";
25
- import { BaseNodeImpl } from "./base_node_impl";
24
+ import { BaseNodeImpl, type InternalBaseNodeOptions } from "./base_node_impl";
26
25
  import { ToStringBuilder, UAObjectType_toString } from "./base_node_private";
27
26
  import { construct_isSubtypeOf, get_subtypeOf, get_subtypeOfObj } from "./tool_isSubtypeOf";
28
27
  import { assertUnusedChildBrowseName, topMostParentIsObjectTypeOrVariableType } from "./ua_variable_type_impl";
29
28
 
29
+ export interface UAObjectTypeOptions extends InternalBaseNodeOptions {
30
+ isAbstract?: boolean | null;
31
+ }
32
+
30
33
  export class UAObjectTypeImpl extends BaseNodeImpl<BaseNodeEvents> implements UAObjectType {
31
34
  public readonly nodeClass = NodeClass.ObjectType;
32
35
  public readonly isAbstract: boolean;
@@ -48,9 +51,9 @@ export class UAObjectTypeImpl extends BaseNodeImpl<BaseNodeEvents> implements UA
48
51
  /** @deprecated - use isSubtypeOf instead */
49
52
  public isSupertypeOf = construct_isSubtypeOf<UAObjectType>(UAObjectTypeImpl);
50
53
 
51
- constructor(options: any) {
54
+ constructor(options: UAObjectTypeOptions) {
52
55
  super(options);
53
- this.isAbstract = isNullOrUndefined(options.isAbstract) ? false : options.isAbstract;
56
+ this.isAbstract = options.isAbstract ?? false;
54
57
  }
55
58
 
56
59
  public readAttribute(context: ISessionContext, attributeId: AttributeIds): DataValue {
@@ -123,7 +126,10 @@ export class UAObjectTypeImpl extends BaseNodeImpl<BaseNodeEvents> implements UA
123
126
  browseName: options.browseName,
124
127
  componentOf: options.componentOf,
125
128
  displayName: options.displayName || "",
126
- description: options.description === undefined ? this.description?.clone() : options.description,
129
+ description:
130
+ options.description === undefined
131
+ ? (this.description?.clone() as LocalizedTextLike | undefined)
132
+ : options.description,
127
133
  encodingOf: options.encodingOf,
128
134
  eventSourceOf: options.eventSourceOf,
129
135
  notifierOf: options.notifierOf,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type { BaseNodeEvents, UAReference, UAReferenceType } from "node-opcua-address-space-base";
6
6
  import { assert } from "node-opcua-assert";
7
- import { AttributeIds, coerceLocalizedText, LocalizedText, type LocalizedTextOptions, NodeClass } from "node-opcua-data-model";
7
+ import { AttributeIds, LocalizedText, type LocalizedTextOptions, NodeClass } from "node-opcua-data-model";
8
8
  import { DataValue, type DataValueLike } from "node-opcua-data-value";
9
9
  import type { NodeId } from "node-opcua-nodeid";
10
10
  import { StatusCodes } from "node-opcua-status-code";
@@ -112,8 +112,7 @@ export class UAReferenceTypeImpl extends BaseNodeImpl<BaseNodeEvents> implements
112
112
  this.isAbstract = options.isAbstract === undefined ? false : !!options.isAbstract;
113
113
  this.symmetric = options.symmetric === undefined ? false : !!options.symmetric;
114
114
  // Note: Inverse name is not required anymore in 1.0.4
115
- this.inverseName =
116
- new LocalizedText(options.inverseName || this.browseName.name);
115
+ this.inverseName = new LocalizedText(options.inverseName || this.browseName.name);
117
116
 
118
117
  ReferenceTypeCounter.count += 1;
119
118
  }