@@ -45,7 +45,6 @@ import { makeBrowsePath } from "node-opcua-service-translate-browse-path";
45
45
import { StatusCodes } from "node-opcua-status-code" ;
46
46
47
47
import { schemaDataValue } from "./codec" ;
48
- import { FormElementProperty } from "wot-thing-description-types" ;
49
48
import { opcuaJsonEncodeVariant } from "node-opcua-json" ;
50
49
import { Argument , BrowseDescription , BrowseResult } from "node-opcua-types" ;
51
50
import { isGoodish2 , ReferenceTypeIds } from "node-opcua" ;
@@ -64,20 +63,11 @@ export type NodeIdLike2 = NodeIdLike & {
64
63
} ;
65
64
66
65
export interface FormPartialNodeDescription {
67
- "opcua:nodeId" ?: NodeIdLike | NodeByBrowsePath ;
66
+ "opcua:nodeId" ?: NodeIdLike | NodeByBrowsePath ; // TODO remove in future, kept for backwards compatibility only
68
67
}
69
68
70
69
export interface OPCUAForm extends Form , FormPartialNodeDescription { }
71
70
72
- export interface OPCUAFormElement extends FormElementProperty , FormPartialNodeDescription { }
73
-
74
- export interface OPCUAFormInvoke extends OPCUAForm {
75
- "opcua:method" ?: NodeIdLike | NodeByBrowsePath ;
76
- }
77
- export interface OPCUAFormSubscribe extends OPCUAForm {
78
- "opcua:samplingInterval" ?: number ;
79
- }
80
-
81
71
interface OPCUAConnection {
82
72
session : ClientSession ;
83
73
client : OPCUAClient ;
@@ -301,14 +291,14 @@ export class OPCUAProtocolClient implements ProtocolClient {
301
291
} ) ;
302
292
}
303
293
304
- private async _resolveMethodNodeId ( form : OPCUAFormInvoke ) : Promise < NodeId > {
294
+ private async _resolveMethodNodeId ( form : OPCUAForm ) : Promise < NodeId > {
305
295
// const objectNode = this._resolveNodeId(form);
306
296
const fNodeId = form [ "opcua:method" ] ;
307
297
if ( fNodeId == null ) {
308
298
debug ( `resolveNodeId: form = ${ form } ` ) ;
309
299
throw new Error ( "form must expose a 'opcua:method'" ) ;
310
300
}
311
- return this . _resolveNodeId2 ( form , fNodeId ) ;
301
+ return this . _resolveNodeId2 ( form , fNodeId as NodeIdLike | NodeByBrowsePath ) ;
312
302
}
313
303
314
304
public async readResource ( form : OPCUAForm ) : Promise < Content > {
@@ -343,7 +333,7 @@ export class OPCUAProtocolClient implements ProtocolClient {
343
333
}
344
334
}
345
335
346
- public async invokeResource ( form : OPCUAFormInvoke , content : Content ) : Promise < Content > {
336
+ public async invokeResource ( form : OPCUAForm , content : Content ) : Promise < Content > {
347
337
return await this . _withSession ( form , async ( session ) => {
348
338
const objectId = await this . _resolveNodeId ( form ) ;
349
339
const methodId = await this . _resolveMethodNodeId ( form ) ;
@@ -590,7 +580,7 @@ export class OPCUAProtocolClient implements ProtocolClient {
590
580
591
581
private async _resolveInputArguments (
592
582
session : IBasicSession ,
593
- form : OPCUAFormInvoke ,
583
+ form : OPCUAForm ,
594
584
content : Content | undefined | null ,
595
585
argumentDefinition : ArgumentDefinition
596
586
) : Promise < VariantOptions [ ] > {
@@ -638,7 +628,7 @@ export class OPCUAProtocolClient implements ProtocolClient {
638
628
639
629
private async _resolveOutputArguments (
640
630
session : IBasicSession ,
641
- form : OPCUAFormInvoke ,
631
+ form : OPCUAForm ,
642
632
argumentDefinition : ArgumentDefinition ,
643
633
outputVariants : Variant [ ]
644
634
) : Promise < Content > {
0 commit comments