node-opcua-client-dynamic-extension-object 2.56.2 → 2.61.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.
@@ -7,7 +7,7 @@ import * as chalk from "chalk";
7
7
 
8
8
  import { assert } from "node-opcua-assert";
9
9
  import { AttributeIds, makeNodeClassMask, makeResultMask, QualifiedName } from "node-opcua-data-model";
10
- import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
10
+ import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog} from "node-opcua-debug";
11
11
  import { ConstructorFuncWithSchema, DataTypeFactory, getStandardDataTypeFactory } from "node-opcua-factory";
12
12
  import { ExpandedNodeId, NodeId, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
13
13
  import { browseAll, BrowseDescriptionLike, IBasicSession } from "node-opcua-pseudo-session";
@@ -31,6 +31,7 @@ import {
31
31
  const doDebug = checkDebugFlag(__filename);
32
32
  const debugLog = make_debugLog(__filename);
33
33
  const errorLog = make_errorLog(__filename);
34
+ const warningLog = make_warningLog(__filename);
34
35
 
35
36
  // DataType
36
37
  // | 1
@@ -126,7 +127,10 @@ async function _enrichWithDescriptionOf(session: IBasicSession, dataTypeDescript
126
127
  const dataTypeDescription = dataTypeDescriptions[i++];
127
128
 
128
129
  result3.references = result3.references || [];
129
- assert(result3.references.length === 1);
130
+ if (result3.references.length !== 1) {
131
+ warningLog("_enrichWithDescriptionOf : expecting 1 reference for ", dataTypeDescription.browseName.toString());
132
+ continue;
133
+ }
130
134
  for (const ref of result3.references) {
131
135
  const binaryEncodingNodeId = ref.nodeId;
132
136
  dataTypeDescription.encodings = dataTypeDescription.encodings || {
@@ -353,7 +357,7 @@ async function _extractDataTypeDictionary(
353
357
  );
354
358
  debugLog("let's use the new way (1.04) and let's crawl all dataTypes exposed by this name space");
355
359
 
356
- // dataType definition in store directly in UADataType under the $definition property
360
+ // dataType definition in store directly in UADataType under the definition attribute
357
361
  const dataTypeFactory2 = dataTypeManager.getDataTypeFactory(dataTypeDictionaryNodeId.namespace);
358
362
  if (!dataTypeFactory2) {
359
363
  throw new Error("cannot find dataTypeFactory for namespace " + dataTypeDictionaryNodeId.namespace);
@@ -1,25 +0,0 @@
1
- import { DataTypeFactory, FieldCategory, StructuredTypeSchema, TypeDefinition } from "node-opcua-factory";
2
- import { NodeId } from "node-opcua-nodeid";
3
- import { IBasicSession } from "node-opcua-pseudo-session";
4
- import { AnyConstructorFunc } from "node-opcua-schemas";
5
- import { DataTypeDefinition } from "node-opcua-types";
6
- import { ExtraDataTypeManager } from "./extra_data_type_manager";
7
- /**
8
- * Extract all custom dataType
9
- * @param session
10
- * @param dataTypeManager
11
- * @async
12
- */
13
- export declare function populateDataTypeManager(session: IBasicSession, dataTypeManager: ExtraDataTypeManager): Promise<void>;
14
- export declare function getDataTypeDefinition(session: IBasicSession, dataTypeNodeId: NodeId, dataTypeManager: ExtraDataTypeManager): Promise<StructuredTypeSchema>;
15
- interface Cache {
16
- fieldTypeName: string;
17
- schema: TypeDefinition;
18
- category: FieldCategory;
19
- }
20
- export declare function convertDataTypeDefinitionToStructureTypeSchema(session: IBasicSession, dataTypeNodeId: NodeId, name: string, definition: DataTypeDefinition, dataTypeFactory: DataTypeFactory, cache: {
21
- [key: string]: Cache;
22
- }): Promise<StructuredTypeSchema>;
23
- export declare function extractNamespaceDataType(session: IBasicSession): Promise<ExtraDataTypeManager>;
24
- export declare function getExtensionObjectConstructor(session: IBasicSession, dataTypeNodeId: NodeId): Promise<AnyConstructorFunc>;
25
- export {};