opcjs-client 0.1.3

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/index.cjs ADDED
@@ -0,0 +1,1177 @@
1
+ 'use strict';
2
+
3
+ var base = require('@opcua/base');
4
+
5
+ // src/client.ts
6
+ var ServiceBase = class {
7
+ constructor(authToken, secureChannel) {
8
+ this.authToken = authToken;
9
+ this.secureChannel = secureChannel;
10
+ }
11
+ createRequestHeader() {
12
+ const requestHeader = new base.RequestHeader();
13
+ requestHeader.authenticationToken = this.authToken;
14
+ requestHeader.timestamp = /* @__PURE__ */ new Date();
15
+ requestHeader.requestHandle = 0;
16
+ requestHeader.returnDiagnostics = 0;
17
+ requestHeader.auditEntryId = "";
18
+ requestHeader.timeoutHint = 6e4;
19
+ requestHeader.additionalHeader = base.ExtensionObject.newEmpty();
20
+ return requestHeader;
21
+ }
22
+ };
23
+
24
+ // src/services/sessionService.ts
25
+ var SessionService = class _SessionService extends ServiceBase {
26
+ constructor(authToken, secureChannel, configuration) {
27
+ super(authToken, secureChannel);
28
+ this.configuration = configuration;
29
+ }
30
+ async createSession() {
31
+ console.log("Creating session...");
32
+ const clientDescription = new base.ApplicationDescription();
33
+ clientDescription.applicationUri = this.configuration.applicationUri;
34
+ clientDescription.productUri = this.configuration.productUri;
35
+ clientDescription.applicationName = new base.LocalizedText(void 0, this.configuration.productName);
36
+ clientDescription.applicationType = base.ApplicationTypeEnum.Client;
37
+ clientDescription.gatewayServerUri = "";
38
+ clientDescription.discoveryProfileUri = "";
39
+ clientDescription.discoveryUrls = new Array();
40
+ const request = new base.CreateSessionRequest();
41
+ request.requestHeader = this.createRequestHeader();
42
+ request.clientDescription = clientDescription;
43
+ request.serverUri = "";
44
+ request.endpointUrl = this.secureChannel.getEndpointUrl();
45
+ request.sessionName = "";
46
+ request.clientNonce = null;
47
+ request.clientCertificate = null;
48
+ request.requestedSessionTimeout = 6e4;
49
+ request.maxResponseMessageSize = 0;
50
+ console.log("Sending CreateSessionRequest...");
51
+ const response = await this.secureChannel.issueServiceRequest(request);
52
+ if (!response || !(response instanceof base.CreateSessionResponse)) {
53
+ throw new Error("Invalid response type for CreateSessionRequest");
54
+ }
55
+ const castedResponse = response;
56
+ if (!castedResponse || !castedResponse.sessionId || !castedResponse.authenticationToken) {
57
+ throw new Error("CreateSessionResponse missing SessionId or AuthenticationToken");
58
+ }
59
+ const endpoint = "opc." + this.secureChannel.getEndpointUrl();
60
+ const securityMode = this.secureChannel.getSecurityMode();
61
+ const securityPolicyUri = this.secureChannel.getSecurityPolicy();
62
+ const serverEndpoint = castedResponse?.serverEndpoints?.find((ep) => ep.endpointUrl === endpoint && ep.securityMode === securityMode && ep.securityPolicyUri === securityPolicyUri);
63
+ if (!serverEndpoint) {
64
+ throw new Error(`Server endpoint ${endpoint} not found in CreateSessionResponse`);
65
+ }
66
+ console.log("Session created with id:", castedResponse.sessionId.identifier);
67
+ return {
68
+ sessionId: castedResponse.sessionId.identifier,
69
+ authToken: castedResponse.authenticationToken,
70
+ endpoint: serverEndpoint
71
+ };
72
+ }
73
+ async activateSession(identityToken) {
74
+ const signatureData = new base.SignatureData();
75
+ signatureData.algorithm = this.secureChannel.getSecurityPolicy();
76
+ signatureData.signature = new Uint8Array(0);
77
+ const request = new base.ActivateSessionRequest();
78
+ request.requestHeader = this.createRequestHeader();
79
+ request.clientSignature = signatureData;
80
+ request.clientSoftwareCertificates = new Array();
81
+ request.localeIds = ["en-US"];
82
+ request.userIdentityToken = base.ExtensionObject.newBinary(identityToken);
83
+ request.userTokenSignature = signatureData;
84
+ console.log("Sending ActivateSessionRequest...");
85
+ await this.secureChannel.issueServiceRequest(request);
86
+ console.log("Session activated.");
87
+ }
88
+ recreate(authToken) {
89
+ return new _SessionService(authToken, this.secureChannel, this.configuration);
90
+ }
91
+ };
92
+
93
+ // src/issuerConfiguration.ts
94
+ var IssuerConfiguration = class _IssuerConfiguration {
95
+ constructor(resourceId, authorityUrl, authorityProfileUri, tokenEndpoint, authorizationEndpoint, requestTypes, scopes) {
96
+ this.resourceId = resourceId;
97
+ this.authorityUrl = authorityUrl;
98
+ this.authorityProfileUri = authorityProfileUri;
99
+ this.tokenEndpoint = tokenEndpoint;
100
+ this.authorizationEndpoint = authorizationEndpoint;
101
+ this.requestTypes = requestTypes;
102
+ this.scopes = scopes;
103
+ }
104
+ static newFrom(issuerEndpointUrl) {
105
+ return new _IssuerConfiguration(
106
+ issuerEndpointUrl["ua.resourceId"],
107
+ issuerEndpointUrl["ua.authorityUrl"],
108
+ issuerEndpointUrl["ua.authorityProfileUri"],
109
+ issuerEndpointUrl["ua.tokenEndpoint"],
110
+ issuerEndpointUrl["ua.authorizationEndpoint"],
111
+ issuerEndpointUrl["ua.requestTypes"],
112
+ issuerEndpointUrl["ua.scopes"]
113
+ );
114
+ }
115
+ };
116
+
117
+ // src/sessions/session.ts
118
+ var Session = class {
119
+ constructor(sessionId, authToken, endpoint, sessionServices) {
120
+ this.sessionId = sessionId;
121
+ this.authToken = authToken;
122
+ this.endpoint = endpoint;
123
+ this.sessionServices = sessionServices;
124
+ }
125
+ async activateSession(identity) {
126
+ const token = identity.getUserIdentityToken();
127
+ const tokenType = identity.getTokenType();
128
+ const tokenPolicy = this.endpoint.userIdentityTokens?.find((t) => t.tokenType === tokenType);
129
+ if (!tokenPolicy) {
130
+ throw new Error(`UserIdentityToken of type ${tokenType} not supported by server`);
131
+ }
132
+ token.policyId = tokenPolicy.policyId;
133
+ if (tokenType === base.UserTokenTypeEnum.IssuedToken) {
134
+ if (!tokenPolicy.issuerEndpointUrl) {
135
+ throw new Error("IssuerEndpointUrl not defined for IssuedToken");
136
+ }
137
+ const issuerEndpointUrl = JSON.parse(tokenPolicy.issuerEndpointUrl);
138
+ const issuerConfig = IssuerConfiguration.newFrom(issuerEndpointUrl);
139
+ const issuerLoginCallback = identity.getIssuerLoginCallback();
140
+ const tokenData = await issuerLoginCallback(issuerConfig);
141
+ const issuerToken = token;
142
+ issuerToken.tokenData = new TextEncoder().encode(tokenData.json);
143
+ }
144
+ await this.sessionServices.activateSession(token);
145
+ }
146
+ getAuthToken() {
147
+ return this.authToken;
148
+ }
149
+ };
150
+
151
+ // src/sessions/sessionHandler.ts
152
+ var SessionHandler = class {
153
+ sessionServices;
154
+ async createNewSession(identity) {
155
+ const ret = await this.sessionServices.createSession();
156
+ this.sessionServices = this.sessionServices.recreate(ret.authToken);
157
+ const session = new Session(ret.sessionId, ret.authToken, ret.endpoint, this.sessionServices);
158
+ await session.activateSession(identity);
159
+ return session;
160
+ }
161
+ constructor(secureChannel, configuration) {
162
+ this.sessionServices = new SessionService(base.NodeId.newTwoByte(0), secureChannel, configuration);
163
+ }
164
+ };
165
+
166
+ // src/services/attributeServiceAttributes.ts
167
+ var AttrIdValue = 13;
168
+
169
+ // src/services/attributeService.ts
170
+ var AttributeService = class extends ServiceBase {
171
+ async ReadValue(nodeIds) {
172
+ const readValueIds = nodeIds.map((ni) => {
173
+ const readValueId = new base.ReadValueId();
174
+ readValueId.nodeId = ni;
175
+ readValueId.attributeId = AttrIdValue;
176
+ readValueId.indexRange = "";
177
+ readValueId.dataEncoding = new base.QualifiedName(0, "");
178
+ return readValueId;
179
+ });
180
+ const request = new base.ReadRequest();
181
+ request.requestHeader = this.createRequestHeader();
182
+ request.maxAge = 6e4;
183
+ request.timestampsToReturn = base.TimestampsToReturnEnum.Source;
184
+ request.nodesToRead = readValueIds;
185
+ console.log("Sending ReadRequest...");
186
+ const response = await this.secureChannel.issueServiceRequest(request);
187
+ const results = new Array();
188
+ for (let dataValue of response.results ?? []) {
189
+ const result = {
190
+ status: dataValue.statusCode?.toString() ?? "Unknown",
191
+ value: dataValue.value
192
+ };
193
+ results.push(result);
194
+ }
195
+ return results;
196
+ }
197
+ constructor(authToken, secureChannel) {
198
+ super(authToken, secureChannel);
199
+ }
200
+ };
201
+
202
+ // src/readValueResult.ts
203
+ var ReadValueResult = class {
204
+ constructor(value, status) {
205
+ this.value = value;
206
+ this.status = status;
207
+ }
208
+ };
209
+
210
+ // src/subscriptionHandlerEntry.ts
211
+ var SubscriptionHandlerEntry = class {
212
+ constructor(subscriptionId, handle, id, callback) {
213
+ this.subscriptionId = subscriptionId;
214
+ this.handle = handle;
215
+ this.id = id;
216
+ this.callback = callback;
217
+ }
218
+ };
219
+
220
+ // src/subscriptionHandler.ts
221
+ var SubscriptionHandler = class {
222
+ constructor(subscriptionService, monitoredItemService) {
223
+ this.subscriptionService = subscriptionService;
224
+ this.monitoredItemService = monitoredItemService;
225
+ }
226
+ entries = new Array();
227
+ nextHandle = 0;
228
+ async subscribe(ids, callback) {
229
+ if (this.entries.length > 0) {
230
+ throw new Error("Subscribing more than once is not implemented");
231
+ }
232
+ const subscriptionId = await this.subscriptionService.createSubscription();
233
+ const items = [];
234
+ for (let id of ids) {
235
+ const entry = new SubscriptionHandlerEntry(
236
+ subscriptionId,
237
+ this.nextHandle++,
238
+ id,
239
+ callback
240
+ );
241
+ this.entries.push(entry);
242
+ const item = {
243
+ id: id.toNodeId(),
244
+ handle: entry.handle
245
+ };
246
+ items.push(item);
247
+ }
248
+ await this.monitoredItemService.createMonitoredItems(subscriptionId, items);
249
+ this.publish([]);
250
+ }
251
+ async publish(acknowledgeSequenceNumbers) {
252
+ const acknowledgements = [];
253
+ for (let i = 0; i < acknowledgeSequenceNumbers.length; i++) {
254
+ const acknowledgement = new base.SubscriptionAcknowledgement();
255
+ acknowledgement.subscriptionId = this.entries[i].subscriptionId;
256
+ acknowledgement.sequenceNumber = acknowledgeSequenceNumbers[i];
257
+ acknowledgements.push(acknowledgement);
258
+ }
259
+ const response = await this.subscriptionService.publish(acknowledgements);
260
+ const messagesToAcknowledge = response.notificationMessage.sequenceNumber;
261
+ const notificationDatas = response.notificationMessage.notificationData;
262
+ for (let notificationData of notificationDatas) {
263
+ const decodedData = notificationData.data;
264
+ const typeNodeId = notificationData.typeId;
265
+ if (typeNodeId.namespace === 0 && typeNodeId.identifier === 811) {
266
+ const dataChangeNotification = decodedData;
267
+ for (let item of dataChangeNotification.monitoredItems) {
268
+ const clientHandle = item.clientHandle;
269
+ const value = item.value;
270
+ const entry = this.entries.find((e) => e.handle == clientHandle);
271
+ entry?.callback([{
272
+ id: entry.id,
273
+ value: value.value?.value
274
+ }]);
275
+ }
276
+ } else {
277
+ console.log(`The change notification data type ${typeNodeId.namespace}:${typeNodeId.identifier} is not supported.`);
278
+ }
279
+ }
280
+ setTimeout(() => {
281
+ this.publish([messagesToAcknowledge]);
282
+ }, 500);
283
+ }
284
+ };
285
+ var SubscriptionService = class extends ServiceBase {
286
+ // https://reference.opcfoundation.org/Core/Part4/v105/docs/5.14.2
287
+ async createSubscription() {
288
+ const request = new base.CreateSubscriptionRequest();
289
+ request.requestHeader = this.createRequestHeader();
290
+ request.requestedPublishingInterval = 2e3;
291
+ request.requestedLifetimeCount = 36e4;
292
+ request.requestedMaxKeepAliveCount = 6e4;
293
+ request.maxNotificationsPerPublish = 200;
294
+ request.publishingEnabled = true;
295
+ request.priority = 1;
296
+ console.log("Sending createSubscription...");
297
+ const response = await this.secureChannel.issueServiceRequest(request);
298
+ console.log("Subscription created with id:", response.subscriptionId);
299
+ return response.subscriptionId;
300
+ }
301
+ // https://reference.opcfoundation.org/Core/Part4/v105/docs/5.14.5
302
+ async publish(acknowledgements) {
303
+ const request = new base.PublishRequest();
304
+ request.requestHeader = this.createRequestHeader();
305
+ request.subscriptionAcknowledgements = acknowledgements;
306
+ console.log("Sending publish...");
307
+ const response = await this.secureChannel.issueServiceRequest(request);
308
+ console.log("Received publish response.");
309
+ return response;
310
+ }
311
+ constructor(authToken, secureChannel) {
312
+ super(authToken, secureChannel);
313
+ }
314
+ };
315
+ var MonitoredItemService = class extends ServiceBase {
316
+ async createMonitoredItems(subscriptionId, ids) {
317
+ const items = ids.map((ni) => {
318
+ const readValueId = new base.ReadValueId();
319
+ readValueId.nodeId = ni.id;
320
+ readValueId.attributeId = AttrIdValue;
321
+ readValueId.indexRange = "";
322
+ readValueId.dataEncoding = new base.QualifiedName(0, "");
323
+ const monitoringParameters = new base.MonitoringParameters();
324
+ monitoringParameters.clientHandle = ni.handle;
325
+ monitoringParameters.samplingInterval = 1e3;
326
+ monitoringParameters.filter = base.ExtensionObject.newEmpty();
327
+ monitoringParameters.queueSize = 100;
328
+ monitoringParameters.discardOldest = true;
329
+ const monitoredItemCreateRequest = new base.MonitoredItemCreateRequest();
330
+ monitoredItemCreateRequest.itemToMonitor = readValueId;
331
+ monitoredItemCreateRequest.requestedParameters = monitoringParameters;
332
+ return monitoredItemCreateRequest;
333
+ });
334
+ const request = new base.CreateMonitoredItemsRequest();
335
+ request.requestHeader = this.createRequestHeader();
336
+ request.subscriptionId = subscriptionId;
337
+ request.timestampsToReturn = base.TimestampsToReturnEnum.Source;
338
+ request.itemsToCreate = items;
339
+ console.log("Sending createMonitoredItems...");
340
+ await this.secureChannel.issueServiceRequest(request);
341
+ }
342
+ constructor(authToken, secureChannel) {
343
+ super(authToken, secureChannel);
344
+ }
345
+ };
346
+
347
+ // src/client.ts
348
+ var Client = class {
349
+ constructor(endpointUrl, configuration, identity) {
350
+ this.configuration = configuration;
351
+ this.identity = identity;
352
+ this.endpointUrl = endpointUrl;
353
+ }
354
+ endpointUrl;
355
+ channel;
356
+ session;
357
+ subscriptionHandler;
358
+ getSession() {
359
+ if (!this.session) {
360
+ throw new Error("No session available");
361
+ }
362
+ return this.session;
363
+ }
364
+ async connect() {
365
+ const channel = base.ChannelFactory.createChannel(this.endpointUrl);
366
+ let connected = false;
367
+ while (!connected) {
368
+ console.log(`Connecting to OPC UA server at ${this.endpointUrl}...`);
369
+ connected = await channel.connect();
370
+ if (!connected) {
371
+ console.log("Connection failed, retrying in 2 seconds...");
372
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
373
+ }
374
+ }
375
+ console.log("Connected to OPC UA server.");
376
+ this.channel = new base.SecureChannel(channel, this.configuration);
377
+ await this.channel.openSecureChannelRequest();
378
+ const sessionHandler = new SessionHandler(this.channel, this.configuration);
379
+ this.session = await sessionHandler.createNewSession(this.identity);
380
+ this.subscriptionHandler = new SubscriptionHandler(
381
+ new SubscriptionService(this.session.getAuthToken(), this.channel),
382
+ new MonitoredItemService(this.session.getAuthToken(), this.channel)
383
+ );
384
+ }
385
+ async disconnect() {
386
+ console.log("Disconnecting from OPC UA server...");
387
+ if (this.channel) {
388
+ await this.channel.disconnect();
389
+ }
390
+ }
391
+ async read(ids) {
392
+ const service = new AttributeService(this.getSession().getAuthToken(), this.channel);
393
+ const result = await service.ReadValue(ids.map((i) => i.toNodeId()));
394
+ return result.map((r) => new ReadValueResult(r.value, r.status));
395
+ }
396
+ async subscribe(ids, callback) {
397
+ this.subscriptionHandler?.subscribe(ids, callback);
398
+ }
399
+ };
400
+
401
+ // ../base/src/codecs/codecError.ts
402
+ var CodecError = class _CodecError extends Error {
403
+ /**
404
+ * The encoding ID involved in the error (if applicable).
405
+ */
406
+ encodingId;
407
+ /**
408
+ * The encoding format where the error occurred (Binary, Xml, Json).
409
+ */
410
+ format;
411
+ /**
412
+ * Suggested action to resolve the error.
413
+ */
414
+ suggestedAction;
415
+ /**
416
+ * The type name involved in the error (if applicable).
417
+ */
418
+ typeName;
419
+ /**
420
+ * Original error that caused this codec error (if any).
421
+ */
422
+ cause;
423
+ constructor(message, options) {
424
+ super(message);
425
+ this.name = "CodecError";
426
+ this.encodingId = options?.encodingId;
427
+ this.format = options?.format;
428
+ this.suggestedAction = options?.suggestedAction;
429
+ this.typeName = options?.typeName;
430
+ this.cause = options?.cause;
431
+ if (Error.captureStackTrace) {
432
+ Error.captureStackTrace(this, _CodecError);
433
+ }
434
+ }
435
+ /**
436
+ * Returns a detailed error message including all context.
437
+ */
438
+ toString() {
439
+ let result = `${this.name}: ${this.message}`;
440
+ if (this.encodingId) {
441
+ result += `
442
+ Encoding ID: ${this.encodingId}`;
443
+ }
444
+ if (this.format) {
445
+ result += `
446
+ Format: ${this.format}`;
447
+ }
448
+ if (this.typeName) {
449
+ result += `
450
+ Type: ${this.typeName}`;
451
+ }
452
+ if (this.suggestedAction) {
453
+ result += `
454
+ Suggested Action: ${this.suggestedAction}`;
455
+ }
456
+ return result;
457
+ }
458
+ };
459
+
460
+ // ../base/src/codecs/binary/binaryWriter.ts
461
+ var EPOCH_DIFF_MS = 11644473600000n;
462
+ var TICKS_PER_MS = 10000n;
463
+ function selectNodeIdEncodingFormat(nodeId) {
464
+ if (nodeId.identifierType === 0 /* Numeric */) {
465
+ const id = nodeId.identifier;
466
+ const ns = nodeId.namespace;
467
+ if (ns === 0 && id >= 0 && id <= 255) {
468
+ return 0 /* TwoByte */;
469
+ }
470
+ if (ns >= 0 && ns <= 255 && id >= 0 && id <= 65535) {
471
+ return 1 /* FourByte */;
472
+ }
473
+ return 2 /* Numeric */;
474
+ }
475
+ if (nodeId.identifierType === 1 /* String */) {
476
+ return 3 /* String */;
477
+ }
478
+ if (nodeId.identifierType === 2 /* Guid */) {
479
+ return 4 /* Guid */;
480
+ }
481
+ if (nodeId.identifierType === 3 /* ByteString */) {
482
+ return 5 /* ByteString */;
483
+ }
484
+ throw new CodecError(`Invalid NodeId identifier type: ${nodeId.identifierType}`);
485
+ }
486
+ var ExpandedNodeIdMask = {
487
+ ServerIndexFlag: 64,
488
+ NamespaceUriFlag: 128
489
+ };
490
+ var LocalizedTextMask = {
491
+ LocaleFlag: 1,
492
+ TextFlag: 2
493
+ };
494
+ var DataValueMaskBits = {
495
+ Value: 1,
496
+ StatusCode: 2,
497
+ SourceTimestamp: 4,
498
+ ServerTimestamp: 8,
499
+ SourcePicoseconds: 16,
500
+ ServerPicoseconds: 32
501
+ };
502
+ var DiagnosticInfoMaskBits = {
503
+ SymbolicId: 1,
504
+ NamespaceUri: 2,
505
+ LocalizedText: 4,
506
+ Locale: 8,
507
+ AdditionalInfo: 16,
508
+ InnerStatusCode: 32,
509
+ InnerDiagnosticInfo: 64
510
+ };
511
+ var VariantMask = {
512
+ TypeMask: 63,
513
+ ArrayDimensions: 64,
514
+ Array: 128
515
+ };
516
+ var BinaryWriter = class {
517
+ buffer;
518
+ position;
519
+ getData() {
520
+ return this.buffer.subarray(0, this.position);
521
+ }
522
+ /** Returns the number of bytes written so far. */
523
+ getLength() {
524
+ return this.position;
525
+ }
526
+ /** Appends raw bytes to the buffer. */
527
+ writeBytes(data) {
528
+ this.ensureCapacity(data.length);
529
+ this.buffer.set(data, this.position);
530
+ this.position += data.length;
531
+ }
532
+ /**
533
+ * Overwrites bytes in the buffer starting at the given position.
534
+ * Also truncates the written length to `offset + data.length` if that
535
+ * is less than the current position (i.e. replaces and trims the tail).
536
+ */
537
+ writeBytesAt(data, offset) {
538
+ const end = offset + data.length;
539
+ this.ensureCapacity(Math.max(0, end - this.position));
540
+ this.buffer.set(data, offset);
541
+ if (end > this.position) {
542
+ this.position = end;
543
+ }
544
+ }
545
+ /**
546
+ * Inserts bytes at the given offset, shifting all subsequent content right.
547
+ */
548
+ insertBytesAt(data, offset) {
549
+ this.ensureCapacity(data.length);
550
+ this.buffer.copyWithin(offset + data.length, offset, this.position);
551
+ this.buffer.set(data, offset);
552
+ this.position += data.length;
553
+ }
554
+ /**
555
+ * Overwrites a UInt32 (little-endian) at the given byte offset without
556
+ * advancing the write position.
557
+ */
558
+ writeUInt32At(value, offset) {
559
+ if (!Number.isInteger(value) || value < 0 || value > 4294967295) {
560
+ throw new CodecError(`UInt32 value ${value} out of range [0, 4294967295]`);
561
+ }
562
+ this.buffer.writeUInt32LE(value, offset);
563
+ }
564
+ /**
565
+ * Ensure buffer has enough capacity, growing if necessary.
566
+ */
567
+ ensureCapacity(additionalBytes) {
568
+ const required = this.position + additionalBytes;
569
+ if (required > this.buffer.length) {
570
+ const newSize = Math.max(required, this.buffer.length * 2);
571
+ const newBuffer = Buffer.allocUnsafe(newSize);
572
+ this.buffer.copy(newBuffer, 0, 0, this.position);
573
+ this.buffer = newBuffer;
574
+ }
575
+ }
576
+ writeBoolean(value) {
577
+ this.ensureCapacity(1);
578
+ this.buffer.writeUInt8(value ? 1 : 0, this.position);
579
+ this.position += 1;
580
+ }
581
+ writeByte(value) {
582
+ if (value < 0 || value > 255) {
583
+ throw new CodecError(`Byte value ${value} out of range [0, 255]`);
584
+ }
585
+ this.ensureCapacity(1);
586
+ this.buffer.writeUInt8(value, this.position);
587
+ this.position += 1;
588
+ }
589
+ writeSByte(value) {
590
+ if (value < -128 || value > 127) {
591
+ throw new CodecError(`SByte value ${value} out of range [-128, 127]`);
592
+ }
593
+ this.ensureCapacity(1);
594
+ this.buffer.writeInt8(value, this.position);
595
+ this.position += 1;
596
+ }
597
+ writeInt16(value) {
598
+ if (value < -32768 || value > 32767) {
599
+ throw new CodecError(`Int16 value ${value} out of range [-32768, 32767]`);
600
+ }
601
+ this.ensureCapacity(2);
602
+ this.buffer.writeInt16LE(value, this.position);
603
+ this.position += 2;
604
+ }
605
+ writeUInt16(value) {
606
+ if (value < 0 || value > 65535) {
607
+ throw new CodecError(`UInt16 value ${value} out of range [0, 65535]`);
608
+ }
609
+ this.ensureCapacity(2);
610
+ this.buffer.writeUInt16LE(value, this.position);
611
+ this.position += 2;
612
+ }
613
+ writeInt32(value) {
614
+ if (!Number.isInteger(value) || value < -2147483648 || value > 2147483647) {
615
+ throw new CodecError(`Int32 value ${value} out of range [-2147483648, 2147483647]`);
616
+ }
617
+ this.ensureCapacity(4);
618
+ this.buffer.writeInt32LE(value, this.position);
619
+ this.position += 4;
620
+ }
621
+ writeUInt32(value) {
622
+ if (!Number.isInteger(value) || value < 0 || value > 4294967295) {
623
+ throw new CodecError(`UInt32 value ${value} out of range [0, 4294967295]`);
624
+ }
625
+ this.ensureCapacity(4);
626
+ this.buffer.writeUInt32LE(value, this.position);
627
+ this.position += 4;
628
+ }
629
+ writeInt64(value) {
630
+ this.ensureCapacity(8);
631
+ this.buffer.writeBigInt64LE(value, this.position);
632
+ this.position += 8;
633
+ }
634
+ writeUInt64(value) {
635
+ this.ensureCapacity(8);
636
+ this.buffer.writeBigUInt64LE(value, this.position);
637
+ this.position += 8;
638
+ }
639
+ writeFloat(value) {
640
+ this.ensureCapacity(4);
641
+ this.buffer.writeFloatLE(value, this.position);
642
+ this.position += 4;
643
+ }
644
+ writeDouble(value) {
645
+ this.ensureCapacity(8);
646
+ this.buffer.writeDoubleLE(value, this.position);
647
+ this.position += 8;
648
+ }
649
+ writeString(value) {
650
+ if (value == null) {
651
+ this.writeInt32(-1);
652
+ return;
653
+ }
654
+ const utf8Bytes = Buffer.from(value, "utf8");
655
+ const length = utf8Bytes.length;
656
+ if (length > 16777216) {
657
+ throw new CodecError(
658
+ `String length ${length} exceeds maximum allowed length of 16,777,216 bytes`,
659
+ { format: "Binary", suggestedAction: "Reduce string length" }
660
+ );
661
+ }
662
+ this.writeInt32(length);
663
+ this.ensureCapacity(length);
664
+ utf8Bytes.copy(this.buffer, this.position);
665
+ this.position += length;
666
+ }
667
+ writeDateTime(value) {
668
+ const jsTimestamp = BigInt(value.getTime());
669
+ const opcTimestamp = (jsTimestamp + EPOCH_DIFF_MS) * TICKS_PER_MS;
670
+ this.writeInt64(opcTimestamp);
671
+ }
672
+ writeGuid(value) {
673
+ const hex = value.replace(/-/g, "");
674
+ if (hex.length !== 32) {
675
+ throw new CodecError(`Invalid GUID format: ${value}`);
676
+ }
677
+ this.ensureCapacity(16);
678
+ const data1 = parseInt(hex.substr(0, 8), 16);
679
+ this.buffer.writeUInt32LE(data1, this.position);
680
+ const data2 = parseInt(hex.substr(8, 4), 16);
681
+ this.buffer.writeUInt16LE(data2, this.position + 4);
682
+ const data3 = parseInt(hex.substr(12, 4), 16);
683
+ this.buffer.writeUInt16LE(data3, this.position + 6);
684
+ for (let i = 0; i < 8; i++) {
685
+ const byte = parseInt(hex.substr(16 + i * 2, 2), 16);
686
+ this.buffer.writeUInt8(byte, this.position + 8 + i);
687
+ }
688
+ this.position += 16;
689
+ }
690
+ writeByteString(value) {
691
+ if (value == null) {
692
+ this.writeInt32(-1);
693
+ return;
694
+ }
695
+ const length = value.length;
696
+ if (length > 16777216) {
697
+ throw new CodecError(
698
+ `ByteString length ${length} exceeds maximum allowed length of 16,777,216 bytes`,
699
+ { format: "Binary", suggestedAction: "Reduce ByteString length" }
700
+ );
701
+ }
702
+ this.writeInt32(length);
703
+ this.ensureCapacity(length);
704
+ if (Buffer.isBuffer(value)) {
705
+ value.copy(this.buffer, this.position);
706
+ } else {
707
+ this.buffer.set(value, this.position);
708
+ }
709
+ this.position += length;
710
+ }
711
+ writeXmlElement(value) {
712
+ this.writeString(value);
713
+ }
714
+ /**
715
+ * Write an array with Int32 length prefix.
716
+ * Per FR-011: -1 = null, 0 = empty, positive = element count
717
+ * Per FR-019: Maximum array length is 2,147,483,647 elements
718
+ *
719
+ * @param array The array to encode (undefined for null array)
720
+ * @param encodeElement Function to encode each element
721
+ * @throws {CodecError} if array length exceeds Int32 maximum
722
+ * @see OPC 10000-6 Section 5.2.5 - Arrays
723
+ */
724
+ writeArray(array, encodeElement) {
725
+ if (array === void 0) {
726
+ this.writeInt32(-1);
727
+ return;
728
+ }
729
+ const length = array.length;
730
+ if (length > 2147483647) {
731
+ throw new CodecError(
732
+ `Array length ${length} exceeds maximum allowed length of 2,147,483,647 elements`,
733
+ { format: "Binary", suggestedAction: "Reduce array size" }
734
+ );
735
+ }
736
+ this.writeInt32(length);
737
+ for (const element of array) {
738
+ encodeElement(this, element);
739
+ }
740
+ }
741
+ // === Complex type write methods ===
742
+ /**
743
+ * Encode a NodeId in binary format using the most compact representation.
744
+ * @see OPC 10000-6 Tables 16-19
745
+ */
746
+ writeNodeId(value) {
747
+ const format = selectNodeIdEncodingFormat(value);
748
+ switch (format) {
749
+ case 0 /* TwoByte */:
750
+ this.writeByte(0 /* TwoByte */);
751
+ this.writeByte(value.identifier);
752
+ break;
753
+ case 1 /* FourByte */:
754
+ this.writeByte(1 /* FourByte */);
755
+ this.writeByte(value.namespace);
756
+ this.writeUInt16(value.identifier);
757
+ break;
758
+ case 2 /* Numeric */:
759
+ this.writeByte(2 /* Numeric */);
760
+ this.writeUInt16(value.namespace);
761
+ this.writeUInt32(value.identifier);
762
+ break;
763
+ case 3 /* String */:
764
+ this.writeByte(3 /* String */);
765
+ this.writeUInt16(value.namespace);
766
+ this.writeString(value.identifier);
767
+ break;
768
+ case 4 /* Guid */:
769
+ this.writeByte(4 /* Guid */);
770
+ this.writeUInt16(value.namespace);
771
+ this.writeGuid(value.identifier);
772
+ break;
773
+ case 5 /* ByteString */: {
774
+ this.writeByte(5 /* ByteString */);
775
+ this.writeUInt16(value.namespace);
776
+ const ident = value.identifier;
777
+ const buf = ident instanceof Uint8Array && !(ident instanceof Buffer) ? Buffer.from(ident) : ident;
778
+ this.writeByteString(buf);
779
+ break;
780
+ }
781
+ default:
782
+ throw new CodecError(`Unsupported NodeId encoding format: ${format}`);
783
+ }
784
+ }
785
+ /**
786
+ * Encode an ExpandedNodeId in binary format.
787
+ * @see OPC 10000-6 Table 20
788
+ */
789
+ writeExpandedNodeId(value) {
790
+ const startPos = this.position;
791
+ this.writeNodeId(value);
792
+ let encodingByte = this.buffer[startPos];
793
+ if (value.namespaceUri !== void 0) {
794
+ encodingByte |= ExpandedNodeIdMask.NamespaceUriFlag;
795
+ }
796
+ if (value.serverIndex !== void 0) {
797
+ encodingByte |= ExpandedNodeIdMask.ServerIndexFlag;
798
+ }
799
+ this.buffer[startPos] = encodingByte;
800
+ if (value.namespaceUri !== void 0) {
801
+ this.writeString(value.namespaceUri);
802
+ }
803
+ if (value.serverIndex !== void 0) {
804
+ this.writeUInt32(value.serverIndex);
805
+ }
806
+ }
807
+ /**
808
+ * Encode a StatusCode as a UInt32.
809
+ * @see OPC 10000-6 Section 5.2.2.16
810
+ */
811
+ writeStatusCode(value) {
812
+ this.writeUInt32(value);
813
+ }
814
+ /**
815
+ * Encode a QualifiedName as NamespaceIndex (UInt16) + Name (String).
816
+ * @see OPC 10000-6 Table 8
817
+ */
818
+ writeQualifiedName(value) {
819
+ this.writeUInt16(value.namespaceIndex);
820
+ this.writeString(value.name);
821
+ }
822
+ /**
823
+ * Encode a LocalizedText with optional locale and text.
824
+ * @see OPC 10000-6 Table 9
825
+ */
826
+ writeLocalizedText(value) {
827
+ let encodingMask = 0;
828
+ if (value.locale !== void 0 && value.locale !== "") {
829
+ encodingMask |= LocalizedTextMask.LocaleFlag;
830
+ }
831
+ if (value.text !== "") {
832
+ encodingMask |= LocalizedTextMask.TextFlag;
833
+ }
834
+ this.writeByte(encodingMask);
835
+ if (encodingMask & LocalizedTextMask.LocaleFlag) {
836
+ this.writeString(value.locale);
837
+ }
838
+ if (encodingMask & LocalizedTextMask.TextFlag) {
839
+ this.writeString(value.text);
840
+ }
841
+ }
842
+ /**
843
+ * Encode an ExtensionObject with its TypeId and body.
844
+ * @see OPC 10000-6 Section 5.2.2.15
845
+ */
846
+ writeExtensionObject(value, encoder) {
847
+ const typeId = value.typeId;
848
+ if ("namespaceUri" in typeId || "serverIndex" in typeId) {
849
+ this.writeExpandedNodeId(typeId);
850
+ } else {
851
+ this.writeNodeId(typeId);
852
+ }
853
+ this.writeByte(value.encoding);
854
+ switch (value.encoding) {
855
+ case 0 /* None */:
856
+ break;
857
+ case 1 /* Binary */:
858
+ if (!value.data) {
859
+ throw new CodecError("ExtensionObject with Binary encoding must have data");
860
+ }
861
+ const binaryData = encoder.encodeWithoutId(value.data, "binary");
862
+ this.writeByteString(binaryData);
863
+ break;
864
+ case 2 /* Xml */:
865
+ if (!value.data) {
866
+ throw new CodecError("ExtensionObject with Xml encoding must have data");
867
+ }
868
+ const xmlString = encoder.encodeWithoutId(value.data, "xml");
869
+ this.writeXmlElement(xmlString);
870
+ break;
871
+ default:
872
+ throw new CodecError(`Invalid ExtensionObject encoding: ${value.encoding}`);
873
+ }
874
+ }
875
+ /**
876
+ * Encode a DataValue with optional fields controlled by an encoding mask.
877
+ * @see OPC 10000-6 Table 26
878
+ */
879
+ writeDataValue(value, encoder) {
880
+ let encodingMask = 0;
881
+ if (value.value !== null && value.value !== void 0) {
882
+ encodingMask |= DataValueMaskBits.Value;
883
+ }
884
+ if (value.statusCode !== null) {
885
+ encodingMask |= DataValueMaskBits.StatusCode;
886
+ }
887
+ if (value.sourceTimestamp !== null) {
888
+ encodingMask |= DataValueMaskBits.SourceTimestamp;
889
+ }
890
+ if (value.serverTimestamp !== null) {
891
+ encodingMask |= DataValueMaskBits.ServerTimestamp;
892
+ }
893
+ if (value.sourcePicoseconds !== null) {
894
+ encodingMask |= DataValueMaskBits.SourcePicoseconds;
895
+ }
896
+ if (value.serverPicoseconds !== null) {
897
+ encodingMask |= DataValueMaskBits.ServerPicoseconds;
898
+ }
899
+ this.writeByte(encodingMask);
900
+ if (encodingMask & DataValueMaskBits.Value) {
901
+ this.writeVariant(value.value, encoder);
902
+ }
903
+ if (encodingMask & DataValueMaskBits.StatusCode) {
904
+ this.writeUInt32(value.statusCode ?? 0 /* Good */);
905
+ }
906
+ if (encodingMask & DataValueMaskBits.SourceTimestamp) {
907
+ this.writeDateTime(value.sourceTimestamp);
908
+ }
909
+ if (encodingMask & DataValueMaskBits.ServerTimestamp) {
910
+ this.writeDateTime(value.serverTimestamp);
911
+ }
912
+ if (encodingMask & DataValueMaskBits.SourcePicoseconds) {
913
+ this.writeUInt16(value.sourcePicoseconds);
914
+ }
915
+ if (encodingMask & DataValueMaskBits.ServerPicoseconds) {
916
+ this.writeUInt16(value.serverPicoseconds);
917
+ }
918
+ }
919
+ /**
920
+ * Encode a Variant with type ID, value(s), and optional array dimensions.
921
+ * @see OPC 10000-6 Section 5.2.2.16
922
+ */
923
+ writeVariant(value, encoder) {
924
+ if (value.variantType < 0 || value.variantType > 25) {
925
+ throw new CodecError(`Invalid Variant type ID: ${value.variantType}. Must be 0-25.`);
926
+ }
927
+ let mask = value.variantType & VariantMask.TypeMask;
928
+ const isArrayValue = Array.isArray(value.value);
929
+ if (isArrayValue) {
930
+ mask |= VariantMask.Array;
931
+ }
932
+ if (value.arrayDimensions !== void 0 && value.arrayDimensions.length > 0) {
933
+ mask |= VariantMask.ArrayDimensions;
934
+ }
935
+ this.writeByte(mask);
936
+ if (isArrayValue) {
937
+ const array = value.value;
938
+ this.writeInt32(array.length);
939
+ for (const elem of array) {
940
+ this.writeVariantValue(value.variantType, elem, encoder);
941
+ }
942
+ } else if (value.variantType !== 0 /* Null */) {
943
+ this.writeVariantValue(value.variantType, value.value, encoder);
944
+ }
945
+ if (value.arrayDimensions !== void 0 && value.arrayDimensions.length > 0) {
946
+ this.writeInt32(value.arrayDimensions.length);
947
+ for (const dim of value.arrayDimensions) {
948
+ this.writeInt32(dim);
949
+ }
950
+ }
951
+ }
952
+ /**
953
+ * Encode a DiagnosticInfo with optional fields controlled by an encoding mask.
954
+ * Supports recursive InnerDiagnosticInfo.
955
+ * @see OPC 10000-6 Table 24
956
+ */
957
+ writeDiagnosticInfo(value) {
958
+ let encodingMask = 0;
959
+ if (value.symbolicId !== null) {
960
+ encodingMask |= DiagnosticInfoMaskBits.SymbolicId;
961
+ }
962
+ if (value.namespaceUri !== null) {
963
+ encodingMask |= DiagnosticInfoMaskBits.NamespaceUri;
964
+ }
965
+ if (value.localizedText !== null) {
966
+ encodingMask |= DiagnosticInfoMaskBits.LocalizedText;
967
+ }
968
+ if (value.locale !== null) {
969
+ encodingMask |= DiagnosticInfoMaskBits.Locale;
970
+ }
971
+ if (value.additionalInfo !== null) {
972
+ encodingMask |= DiagnosticInfoMaskBits.AdditionalInfo;
973
+ }
974
+ if (value.innerStatusCode !== null) {
975
+ encodingMask |= DiagnosticInfoMaskBits.InnerStatusCode;
976
+ }
977
+ if (value.innerDiagnosticInfo !== null) {
978
+ encodingMask |= DiagnosticInfoMaskBits.InnerDiagnosticInfo;
979
+ }
980
+ this.writeByte(encodingMask);
981
+ if (encodingMask & DiagnosticInfoMaskBits.SymbolicId) {
982
+ this.writeInt32(value.symbolicId);
983
+ }
984
+ if (encodingMask & DiagnosticInfoMaskBits.NamespaceUri) {
985
+ this.writeInt32(value.namespaceUri);
986
+ }
987
+ if (encodingMask & DiagnosticInfoMaskBits.LocalizedText) {
988
+ this.writeInt32(value.localizedText);
989
+ }
990
+ if (encodingMask & DiagnosticInfoMaskBits.Locale) {
991
+ this.writeInt32(value.locale);
992
+ }
993
+ if (encodingMask & DiagnosticInfoMaskBits.AdditionalInfo) {
994
+ this.writeString(value.additionalInfo);
995
+ }
996
+ if (encodingMask & DiagnosticInfoMaskBits.InnerStatusCode) {
997
+ this.writeUInt32(value.innerStatusCode ?? 0 /* Good */);
998
+ }
999
+ if (encodingMask & DiagnosticInfoMaskBits.InnerDiagnosticInfo) {
1000
+ this.writeDiagnosticInfo(value.innerDiagnosticInfo);
1001
+ }
1002
+ }
1003
+ // === Private helpers ===
1004
+ writeVariantValue(type, value, encoder) {
1005
+ switch (type) {
1006
+ case 0 /* Null */:
1007
+ break;
1008
+ case 1 /* Boolean */:
1009
+ this.writeBoolean(value);
1010
+ break;
1011
+ case 2 /* SByte */:
1012
+ this.writeSByte(value);
1013
+ break;
1014
+ case 3 /* Byte */:
1015
+ this.writeByte(value);
1016
+ break;
1017
+ case 4 /* Int16 */:
1018
+ this.writeInt16(value);
1019
+ break;
1020
+ case 5 /* UInt16 */:
1021
+ this.writeUInt16(value);
1022
+ break;
1023
+ case 6 /* Int32 */:
1024
+ this.writeInt32(value);
1025
+ break;
1026
+ case 7 /* UInt32 */:
1027
+ this.writeUInt32(value);
1028
+ break;
1029
+ case 8 /* Int64 */:
1030
+ this.writeInt64(value);
1031
+ break;
1032
+ case 9 /* UInt64 */:
1033
+ this.writeUInt64(value);
1034
+ break;
1035
+ case 10 /* Float */:
1036
+ this.writeFloat(value);
1037
+ break;
1038
+ case 11 /* Double */:
1039
+ this.writeDouble(value);
1040
+ break;
1041
+ case 12 /* String */:
1042
+ this.writeString(value);
1043
+ break;
1044
+ case 13 /* DateTime */:
1045
+ this.writeDateTime(value);
1046
+ break;
1047
+ case 14 /* Guid */:
1048
+ this.writeGuid(value);
1049
+ break;
1050
+ case 15 /* ByteString */:
1051
+ this.writeByteString(value);
1052
+ break;
1053
+ case 16 /* XmlElement */:
1054
+ this.writeXmlElement(value);
1055
+ break;
1056
+ case 17 /* NodeId */:
1057
+ this.writeNodeId(value);
1058
+ break;
1059
+ case 18 /* ExpandedNodeId */:
1060
+ this.writeExpandedNodeId(value);
1061
+ break;
1062
+ case 19 /* StatusCode */:
1063
+ this.writeStatusCode(value);
1064
+ break;
1065
+ case 20 /* QualifiedName */:
1066
+ this.writeQualifiedName(value);
1067
+ break;
1068
+ case 21 /* LocalizedText */:
1069
+ this.writeLocalizedText(value);
1070
+ break;
1071
+ case 22 /* ExtensionObject */:
1072
+ this.writeExtensionObject(value, encoder);
1073
+ break;
1074
+ case 23 /* DataValue */:
1075
+ this.writeDataValue(value, encoder);
1076
+ break;
1077
+ case 24 /* Variant */:
1078
+ this.writeVariant(value, encoder);
1079
+ break;
1080
+ case 25 /* DiagnosticInfo */:
1081
+ this.writeDiagnosticInfo(value);
1082
+ break;
1083
+ default:
1084
+ throw new CodecError(`Unsupported Variant type: ${type}`);
1085
+ }
1086
+ }
1087
+ constructor(initialSize = 1024) {
1088
+ this.buffer = Buffer.allocUnsafe(initialSize);
1089
+ this.position = 0;
1090
+ }
1091
+ };
1092
+
1093
+ // src/configurationClient.ts
1094
+ var ConfigurationClient = class _ConfigurationClient extends base.Configuration {
1095
+ static getSimple(name, company) {
1096
+ const applicationUri = `urn:${company}:${name}`;
1097
+ const productUri = `urn:${company}:${name}:product`;
1098
+ const encoder = new base.Encoder();
1099
+ encoder.registerWriterFactory("binary", () => {
1100
+ return new BinaryWriter();
1101
+ });
1102
+ base.registerEncoders(encoder);
1103
+ const decoder = new base.Decoder();
1104
+ decoder.registerReaderFactory("binary", (data) => {
1105
+ return new base.BinaryReader(data);
1106
+ });
1107
+ base.registerTypeDecoders(decoder);
1108
+ base.registerBinaryDecoders(decoder);
1109
+ return new _ConfigurationClient(name, applicationUri, name, productUri, encoder, decoder);
1110
+ }
1111
+ constructor(applicationName, applicationUri, productName, productUri, encoder, decoder) {
1112
+ super(applicationName, applicationUri, productName, productUri, encoder, decoder);
1113
+ }
1114
+ };
1115
+ var Id = class _Id {
1116
+ constructor(nodeId) {
1117
+ this.nodeId = nodeId;
1118
+ }
1119
+ static newId(namespace, identifier) {
1120
+ return new _Id(new base.NodeId(namespace, identifier));
1121
+ }
1122
+ toNodeId() {
1123
+ return this.nodeId;
1124
+ }
1125
+ toString() {
1126
+ return `${this.nodeId.namespace}:${this.nodeId.identifier}`;
1127
+ }
1128
+ };
1129
+ var UserIdentity = class _UserIdentity {
1130
+ userIdentityToken;
1131
+ tokenType = base.UserTokenTypeEnum.Anonymous;
1132
+ issuerLoginCallback = void 0;
1133
+ static newAnonymous() {
1134
+ const userIdentity = new _UserIdentity();
1135
+ userIdentity.userIdentityToken = new base.AnonymousIdentityToken();
1136
+ userIdentity.userIdentityToken.policyId = "anonymous";
1137
+ userIdentity.tokenType = base.UserTokenTypeEnum.Anonymous;
1138
+ return userIdentity;
1139
+ }
1140
+ static newWithUserName(userName, password) {
1141
+ const userIdentity = new _UserIdentity();
1142
+ const nameToken = new base.UserNameIdentityToken();
1143
+ nameToken.userName = userName;
1144
+ nameToken.password = new TextEncoder().encode(password);
1145
+ userIdentity.userIdentityToken = nameToken;
1146
+ userIdentity.tokenType = base.UserTokenTypeEnum.UserName;
1147
+ return userIdentity;
1148
+ }
1149
+ static newWithIssuerToken(loginCallback) {
1150
+ const userIdentity = new _UserIdentity();
1151
+ const issuedToken = new base.IssuedIdentityToken();
1152
+ issuedToken.tokenData = new TextEncoder().encode("");
1153
+ userIdentity.userIdentityToken = issuedToken;
1154
+ userIdentity.tokenType = base.UserTokenTypeEnum.IssuedToken;
1155
+ userIdentity.issuerLoginCallback = loginCallback;
1156
+ return userIdentity;
1157
+ }
1158
+ getUserIdentityToken() {
1159
+ return this.userIdentityToken;
1160
+ }
1161
+ getTokenType() {
1162
+ return this.tokenType;
1163
+ }
1164
+ getIssuerLoginCallback() {
1165
+ if (!this.issuerLoginCallback) {
1166
+ throw new Error("No issuer login callback defined");
1167
+ }
1168
+ return this.issuerLoginCallback;
1169
+ }
1170
+ };
1171
+
1172
+ exports.Client = Client;
1173
+ exports.ConfigurationClient = ConfigurationClient;
1174
+ exports.Id = Id;
1175
+ exports.UserIdentity = UserIdentity;
1176
+ //# sourceMappingURL=index.cjs.map
1177
+ //# sourceMappingURL=index.cjs.map