node-opcua-alias-name-server 2.176.0 → 2.177.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/README.md +30 -0
- package/dist/install_alias_names.d.ts +20 -0
- package/dist/install_alias_names.js.map +1 -1
- package/dist/last_change.d.ts +10 -0
- package/dist/last_change.js +10 -0
- package/dist/last_change.js.map +1 -1
- package/package.json +11 -10
- package/source/install_alias_names.ts +20 -0
- package/source/last_change.ts +10 -0
package/README.md
CHANGED
|
@@ -312,6 +312,36 @@ Two things worth designing around:
|
|
|
312
312
|
(`ns=1;s=Aliases/TagVariables/Unit200`) rather than taking the next free numeric id,
|
|
313
313
|
which would shift whenever an unrelated Node happened to be created first.
|
|
314
314
|
|
|
315
|
+
### Out-of-band store mutations
|
|
316
|
+
|
|
317
|
+
The binding advances `LastChange` by itself for every change that flows through it:
|
|
318
|
+
`addAlias`, `removeAlias`, `addAliasCategory`, and the `AddAliasesToCategory` /
|
|
319
|
+
`DeleteAliasesFromCategory` Methods. A host that mutates an **injected store**
|
|
320
|
+
directly — replacing entries during a reconcile, re-reading a database, swapping a
|
|
321
|
+
whole subtree — is the one case the binding cannot observe, so such a host reports
|
|
322
|
+
the change itself through the tracker returned by installation:
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
import { installAliasNames, WellKnownCategories } from "node-opcua-alias-name-server";
|
|
326
|
+
|
|
327
|
+
const { lastChange } = await installAliasNames(server, { store: myStore });
|
|
328
|
+
|
|
329
|
+
// ... after each out-of-band mutation of myStore:
|
|
330
|
+
await lastChange?.touch(WellKnownCategories.Aliases);
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
`touch(categoryNodeId, versionTime?)` records the change on that category and rolls
|
|
334
|
+
it up to every ancestor including the `Aliases` root, exactly as an internal change
|
|
335
|
+
would — clause 6.3.1's nested rule, "the latest VersionTime of all Organized
|
|
336
|
+
AliasNames and AliasNameCategories". Touch the most specific category that changed,
|
|
337
|
+
not the root: the rollup moves ancestors for you, and a Client watching one branch
|
|
338
|
+
only re-browses when *that* branch moved. `versionTime` defaults to "now"; pass one
|
|
339
|
+
to backdate a change that was discovered late. Values never move backwards.
|
|
340
|
+
|
|
341
|
+
This is the supported API for a store whose content changes behind the Server's
|
|
342
|
+
back; there is no store-side change-notification hook, deliberately, so a store
|
|
343
|
+
stays a plain data source.
|
|
344
|
+
|
|
315
345
|
## The configuration Methods (clauses 6.3.4, 6.3.5)
|
|
316
346
|
|
|
317
347
|
Off by default. Turning them on exposes `AddAliasesToCategory` and
|
|
@@ -167,6 +167,26 @@ export interface InstallAliasNamesResult {
|
|
|
167
167
|
/**
|
|
168
168
|
* Keeps `LastChange` correct across the hierarchy, and persists it
|
|
169
169
|
* (clause 6.3.1).
|
|
170
|
+
*
|
|
171
|
+
* The binding advances it by itself for every change that flows through this
|
|
172
|
+
* package — `addAlias`, `removeAlias`, `addAliasCategory`, and the
|
|
173
|
+
* `AddAliasesToCategory` / `DeleteAliasesFromCategory` Methods. A host that
|
|
174
|
+
* mutates an **injected store out-of-band** — replacing entries during a
|
|
175
|
+
* reconcile, pulling a fresh snapshot from a database — is the one case the
|
|
176
|
+
* binding cannot see, so such a host reports the change itself:
|
|
177
|
+
*
|
|
178
|
+
* ```ts
|
|
179
|
+
* const { lastChange } = await installAliasNames(server, { store: myStore });
|
|
180
|
+
* // ... after each out-of-band mutation of myStore:
|
|
181
|
+
* await lastChange?.touch(categoryNodeId);
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* `touch(categoryNodeId, versionTime?)` records the change on that category
|
|
185
|
+
* and rolls it up to every ancestor including the `Aliases` root, exactly as
|
|
186
|
+
* an internal change would (clause 6.3.1's nested-category rule). Omit
|
|
187
|
+
* `versionTime` to use "now"; pass one to backdate a change that was
|
|
188
|
+
* discovered late. This is the supported API for out-of-band store
|
|
189
|
+
* mutations.
|
|
170
190
|
*/
|
|
171
191
|
lastChange?: LastChangeTracker;
|
|
172
192
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install_alias_names.js","sourceRoot":"","sources":["../source/install_alias_names.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAyCH,0DAEC;
|
|
1
|
+
{"version":3,"file":"install_alias_names.js","sourceRoot":"","sources":["../source/install_alias_names.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAyCH,0DAEC;AAmMD,4DAWC;AAeD,8CAiBC;AAQD,0EA8DC;AA1VD,iFAAwE;AACxE,6DAA4D;AAC5D,qEAKkC;AAElC,qDAAqD;AACrD,mDAA2E;AAElE,oGAFA,mCAAmB,OAEA;AAgB5B;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAC,eAA0C;IAC9E,OAAO,CAAC,YAA2B,EAAE,EAAE,CAAC,IAAA,yCAAoB,EAAC,YAAY,EAAE,eAAe,CAAC,CAAC;AAChG,CAAC;AAgLD;;;;;GAKG;AACU,QAAA,0BAA0B,GAAG,OAAO,CAAC;AAElD,sEAAsE;AACtE,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CAAC,YAAsB;IAC3D,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,kCAA0B,CAAC,EAAE,CAAC;QAC3E,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,8DAA8D;IAC9D,MAAM,gBAAgB,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,yBAAyB,CAAC,CAAC;IACtG,IAAI,gBAAgB,IAAI,CAAC,EAAE,CAAC;QACxB,YAAY,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,YAAY,CAAC,IAAI,CAAC,kCAA0B,CAAC,CAAC;IAC9C,OAAO,IAAI,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S,CAAC,UAAU,CAAC,CAAC;IAE5C,OAAO,EAAE,GAAG,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC7C,CAAC"}
|
package/dist/last_change.d.ts
CHANGED
|
@@ -60,10 +60,20 @@ export declare class LastChangeTracker {
|
|
|
60
60
|
/**
|
|
61
61
|
* Record that a category changed, and roll the change up to every ancestor.
|
|
62
62
|
*
|
|
63
|
+
* This is a public entry point, not only the binding's internal hook: a host
|
|
64
|
+
* that mutates an injected `IAliasStore` out-of-band — outside
|
|
65
|
+
* `addAlias`/`removeAlias` and the configuration Methods — calls it to
|
|
66
|
+
* report the change, since the binding has no way to observe one. Reach the
|
|
67
|
+
* tracker through the `lastChange` field of the `installAliasNames` result.
|
|
68
|
+
*
|
|
63
69
|
* Ancestors are walked at write time rather than computed at read time, so
|
|
64
70
|
* the Property a Client subscribes to actually carries the value — a
|
|
65
71
|
* rollup that existed only inside the Server would be invisible on the
|
|
66
72
|
* wire, which is the whole point of the Property.
|
|
73
|
+
*
|
|
74
|
+
* @param categoryNodeId the category that changed
|
|
75
|
+
* @param versionTime the change's VersionTime; defaults to "now"
|
|
76
|
+
* @returns the VersionTime that was recorded
|
|
67
77
|
*/
|
|
68
78
|
touch(categoryNodeId: NodeId, versionTime?: number): Promise<number>;
|
|
69
79
|
/** Restore persisted values and publish them to the address space. */
|
package/dist/last_change.js
CHANGED
|
@@ -63,10 +63,20 @@ class LastChangeTracker {
|
|
|
63
63
|
/**
|
|
64
64
|
* Record that a category changed, and roll the change up to every ancestor.
|
|
65
65
|
*
|
|
66
|
+
* This is a public entry point, not only the binding's internal hook: a host
|
|
67
|
+
* that mutates an injected `IAliasStore` out-of-band — outside
|
|
68
|
+
* `addAlias`/`removeAlias` and the configuration Methods — calls it to
|
|
69
|
+
* report the change, since the binding has no way to observe one. Reach the
|
|
70
|
+
* tracker through the `lastChange` field of the `installAliasNames` result.
|
|
71
|
+
*
|
|
66
72
|
* Ancestors are walked at write time rather than computed at read time, so
|
|
67
73
|
* the Property a Client subscribes to actually carries the value — a
|
|
68
74
|
* rollup that existed only inside the Server would be invisible on the
|
|
69
75
|
* wire, which is the whole point of the Property.
|
|
76
|
+
*
|
|
77
|
+
* @param categoryNodeId the category that changed
|
|
78
|
+
* @param versionTime the change's VersionTime; defaults to "now"
|
|
79
|
+
* @returns the VersionTime that was recorded
|
|
70
80
|
*/
|
|
71
81
|
async touch(categoryNodeId, versionTime) {
|
|
72
82
|
const value = versionTime ?? this.now();
|
package/dist/last_change.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"last_change.js","sourceRoot":"","sources":["../source/last_change.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;;;AAGH,+EAA8E;AAC9E,iEAAmE;AAEnE,2DAA8C;AAC9C,mEAKiC;AACjC,mDAAsD;AAEtD,4DAA4D;AAC/C,QAAA,uBAAuB,GAAG,YAAY,CAAC;AAYpD;;;GAGG;AACH,MAAa,iBAAiB;IACT,YAAY,CAAgB;IAC5B,eAAe,CAAU;IACzB,GAAG,CAAe;IACnC,6CAA6C;IAC5B,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACpD,4EAA4E;IACpE,WAAW,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAEvD,YAAY,YAA2B,EAAE,OAAkC;QACvE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,eAAe,GAAG,OAAO,EAAE,eAAe,CAAC;QAChD,IAAI,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,6CAAc,CAAC;IAC9C,CAAC;IAED,2DAA2D;IACpD,GAAG,CAAC,cAAsB;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"last_change.js","sourceRoot":"","sources":["../source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;gBAChB,OAAO;YACX,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAEpB,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChD,IAAI,CAAC,IAAI,EAAE,CAAC;gBACR,OAAO;YACX,CAAC;YACD,KAAK,MAAM,MAAM,IAAK,IAAiB,CAAC,wBAAwB,CAAC,wBAAwB,EAAE,uCAAe,CAAC,OAAO,CAAC,EAAE,CAAC;gBAClH,IAAI,MAAM,CAAC,SAAS,KAAK,iCAAS,CAAC,MAAM,EAAE,CAAC;oBACxC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACzB,CAAC;YACL,CAAC;QACL,CAAC,CAAC;QAEF,KAAK,CAAC,cAAc,CAAC,CAAC;QACtB,sEAAsE;QACtE,qCAAqC;QACrC,MAAM,OAAO,GAAG,mCAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mCAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;YAChF,MAAM,CAAC,IAAI,CAAC,mCAAmB,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AApJD,8CAoJC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-alias-name-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.177.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - server-side alias names (OPC 10000-17)",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -b",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"npm": ">=10.x"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"node-opcua-address-space-base": "2.
|
|
21
|
-
"node-opcua-alias-name-common": "2.
|
|
20
|
+
"node-opcua-address-space-base": "2.177.0",
|
|
21
|
+
"node-opcua-alias-name-common": "2.177.0",
|
|
22
22
|
"node-opcua-constants": "2.176.0",
|
|
23
|
-
"node-opcua-data-model": "2.
|
|
24
|
-
"node-opcua-nodeid": "2.
|
|
25
|
-
"node-opcua-service-call": "2.
|
|
23
|
+
"node-opcua-data-model": "2.177.0",
|
|
24
|
+
"node-opcua-nodeid": "2.177.0",
|
|
25
|
+
"node-opcua-service-call": "2.177.0",
|
|
26
26
|
"node-opcua-status-code": "2.176.0",
|
|
27
|
-
"node-opcua-types": "2.
|
|
28
|
-
"node-opcua-variant": "2.
|
|
27
|
+
"node-opcua-types": "2.177.0",
|
|
28
|
+
"node-opcua-variant": "2.177.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"node-opcua-address-space": "2.
|
|
31
|
+
"node-opcua-address-space": "2.177.0",
|
|
32
32
|
"node-opcua-leak-detector": "2.175.6",
|
|
33
33
|
"node-opcua-nodesets": "2.175.3"
|
|
34
34
|
},
|
|
@@ -50,5 +50,6 @@
|
|
|
50
50
|
"files": [
|
|
51
51
|
"dist",
|
|
52
52
|
"source"
|
|
53
|
-
]
|
|
53
|
+
],
|
|
54
|
+
"gitHead": "a00d1d3f4db4522ed6bb2c6104d86c57df79946a"
|
|
54
55
|
}
|
|
@@ -182,6 +182,26 @@ export interface InstallAliasNamesResult {
|
|
|
182
182
|
/**
|
|
183
183
|
* Keeps `LastChange` correct across the hierarchy, and persists it
|
|
184
184
|
* (clause 6.3.1).
|
|
185
|
+
*
|
|
186
|
+
* The binding advances it by itself for every change that flows through this
|
|
187
|
+
* package — `addAlias`, `removeAlias`, `addAliasCategory`, and the
|
|
188
|
+
* `AddAliasesToCategory` / `DeleteAliasesFromCategory` Methods. A host that
|
|
189
|
+
* mutates an **injected store out-of-band** — replacing entries during a
|
|
190
|
+
* reconcile, pulling a fresh snapshot from a database — is the one case the
|
|
191
|
+
* binding cannot see, so such a host reports the change itself:
|
|
192
|
+
*
|
|
193
|
+
* ```ts
|
|
194
|
+
* const { lastChange } = await installAliasNames(server, { store: myStore });
|
|
195
|
+
* // ... after each out-of-band mutation of myStore:
|
|
196
|
+
* await lastChange?.touch(categoryNodeId);
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* `touch(categoryNodeId, versionTime?)` records the change on that category
|
|
200
|
+
* and rolls it up to every ancestor including the `Aliases` root, exactly as
|
|
201
|
+
* an internal change would (clause 6.3.1's nested-category rule). Omit
|
|
202
|
+
* `versionTime` to use "now"; pass one to backdate a change that was
|
|
203
|
+
* discovered late. This is the supported API for out-of-band store
|
|
204
|
+
* mutations.
|
|
185
205
|
*/
|
|
186
206
|
lastChange?: LastChangeTracker;
|
|
187
207
|
/**
|
package/source/last_change.ts
CHANGED
|
@@ -83,10 +83,20 @@ export class LastChangeTracker {
|
|
|
83
83
|
/**
|
|
84
84
|
* Record that a category changed, and roll the change up to every ancestor.
|
|
85
85
|
*
|
|
86
|
+
* This is a public entry point, not only the binding's internal hook: a host
|
|
87
|
+
* that mutates an injected `IAliasStore` out-of-band — outside
|
|
88
|
+
* `addAlias`/`removeAlias` and the configuration Methods — calls it to
|
|
89
|
+
* report the change, since the binding has no way to observe one. Reach the
|
|
90
|
+
* tracker through the `lastChange` field of the `installAliasNames` result.
|
|
91
|
+
*
|
|
86
92
|
* Ancestors are walked at write time rather than computed at read time, so
|
|
87
93
|
* the Property a Client subscribes to actually carries the value — a
|
|
88
94
|
* rollup that existed only inside the Server would be invisible on the
|
|
89
95
|
* wire, which is the whole point of the Property.
|
|
96
|
+
*
|
|
97
|
+
* @param categoryNodeId the category that changed
|
|
98
|
+
* @param versionTime the change's VersionTime; defaults to "now"
|
|
99
|
+
* @returns the VersionTime that was recorded
|
|
90
100
|
*/
|
|
91
101
|
public async touch(categoryNodeId: NodeId, versionTime?: number): Promise<number> {
|
|
92
102
|
const value = versionTime ?? this.now();
|