node-red-contrib-homekit-bridged 2.0.0-dev.1 → 2.0.0-dev.10
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/build/lib/HAPHostNode.js +185 -146
- package/build/lib/HAPServiceNode.js +200 -177
- package/build/lib/HAPServiceNode2.js +208 -177
- package/build/lib/NRCHKBError.js +23 -2
- package/build/lib/PairingQRCode.js +62 -0
- package/build/lib/Storage.js +152 -90
- package/build/lib/api.js +654 -290
- package/build/lib/camera/CameraControl.js +125 -0
- package/build/lib/camera/CameraDelegate.js +507 -0
- package/build/lib/camera/MP4StreamingServer.js +159 -0
- package/build/lib/hap/HAPCharacteristic.js +25 -4
- package/build/lib/hap/HAPService.js +25 -4
- package/build/lib/hap/eve-app/EveCharacteristics.js +124 -81
- package/build/lib/hap/eve-app/EveServices.js +50 -17
- package/build/lib/hap/hap-nodejs.js +32 -0
- package/build/lib/migration/HomeKitService2Migration.js +34 -0
- package/build/lib/migration/NodeMigration.js +75 -0
- package/build/lib/types/AccessoryInformationType.js +15 -1
- package/build/lib/types/CameraConfigType.js +15 -1
- package/build/lib/types/CustomCharacteristicType.js +15 -1
- package/build/lib/types/HAPHostConfigType.js +15 -1
- package/build/lib/types/HAPHostNodeType.js +15 -1
- package/build/lib/types/HAPService2ConfigType.js +15 -1
- package/build/lib/types/HAPService2NodeType.js +15 -1
- package/build/lib/types/HAPServiceConfigType.js +15 -1
- package/build/lib/types/HAPServiceNodeType.js +15 -1
- package/build/lib/types/HAPStatusConfigType.js +15 -1
- package/build/lib/types/HAPStatusNodeType.js +15 -1
- package/build/lib/types/HostType.js +28 -7
- package/build/lib/types/NodeType.js +15 -1
- package/build/lib/types/PublishTimersType.js +15 -1
- package/build/lib/types/UniFiControllerConfigType.js +16 -0
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +28 -7
- package/build/lib/types/hap-nodejs/HapCategories.js +64 -43
- package/build/lib/types/storage/SerializedHostType.js +15 -1
- package/build/lib/types/storage/StorageType.js +34 -10
- package/build/lib/unifi/ProtectDiscovery.js +80 -0
- package/build/lib/utils/AccessoryUtils.js +152 -112
- package/build/lib/utils/BridgeUtils.js +95 -39
- package/build/lib/utils/CharacteristicUtils.js +5 -49
- package/build/lib/utils/CharacteristicUtils2.js +5 -49
- package/build/lib/utils/CharacteristicUtilsBase.js +81 -0
- package/build/lib/utils/NodeStatusUtils.js +89 -40
- package/build/lib/utils/ServiceUtils.js +433 -368
- package/build/lib/utils/ServiceUtils2.js +519 -304
- package/build/lib/utils/index.js +11 -12
- package/build/nodes/bridge.html +206 -168
- package/build/nodes/bridge.js +27 -9
- package/build/nodes/locales/en-US/node-red-contrib-homekit-bridged.json +22 -0
- package/build/nodes/nrchkb.html +1753 -117
- package/build/nodes/nrchkb.js +66 -88
- package/build/nodes/plugin-instance.html +509 -0
- package/build/nodes/plugin-instance.js +46 -0
- package/build/nodes/service.html +557 -306
- package/build/nodes/service.js +5 -6
- package/build/nodes/service2.html +1735 -455
- package/build/nodes/service2.js +5 -8
- package/build/nodes/standalone.html +208 -176
- package/build/nodes/standalone.js +27 -9
- package/build/nodes/status.html +51 -18
- package/build/nodes/status.js +47 -41
- package/build/nodes/unifi-controller.html +92 -0
- package/build/nodes/unifi-controller.js +20 -0
- package/build/plugins/embedded/homebridge-camera-ffmpeg/index.js +479 -0
- package/build/plugins/embedded/homebridge-unifi-protect/index.js +521 -0
- package/build/plugins/embedded/index.js +58 -0
- package/build/plugins/nrchkb-homekit-plugins.js +17 -0
- package/build/plugins/registry/index.js +203 -0
- package/build/plugins/registry/types.js +16 -0
- package/build/scripts/migrate-homekit-service-flows.js +47 -0
- package/examples/demo/01 - ALL Demos single import.json +1885 -1885
- package/examples/demo/02 - Air Purifier.json +279 -279
- package/examples/demo/03 - Air Quality sensor with Battery.json +254 -254
- package/examples/demo/04 - Dimmable Bulb.json +172 -172
- package/examples/demo/05 - Color Bulb (HSV).json +195 -195
- package/examples/demo/06 - Fan (simple, 3 speeds).json +240 -240
- package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +175 -175
- package/examples/demo/08 - CO2 detector.json +224 -224
- package/examples/demo/09 - CO (carbon monoxide) example.json +255 -255
- package/examples/demo/10 - Door window contact sensor.json +234 -234
- package/examples/demos (advanced)/01 - Television with inputs and speaker.json +541 -541
- package/examples/switch/01 - Plain Switch.json +178 -178
- package/package.json +95 -82
- package/build/lib/HAPHostNode.d.ts +0 -1
- package/build/lib/HAPServiceNode.d.ts +0 -1
- package/build/lib/HAPServiceNode2.d.ts +0 -1
- package/build/lib/NRCHKBError.d.ts +0 -3
- package/build/lib/Storage.d.ts +0 -30
- package/build/lib/api.d.ts +0 -1
- package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
- package/build/lib/hap/HAPService.d.ts +0 -6
- package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
- package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
- package/build/lib/types/AccessoryInformationType.d.ts +0 -11
- package/build/lib/types/CameraConfigType.d.ts +0 -24
- package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
- package/build/lib/types/HAPHostConfigType.d.ts +0 -22
- package/build/lib/types/HAPHostNodeType.d.ts +0 -14
- package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
- package/build/lib/types/HAPService2NodeType.d.ts +0 -7
- package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
- package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
- package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
- package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
- package/build/lib/types/HostType.d.ts +0 -5
- package/build/lib/types/NodeType.d.ts +0 -3
- package/build/lib/types/PublishTimersType.d.ts +0 -4
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
- package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
- package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
- package/build/lib/types/storage/StorageType.d.ts +0 -8
- package/build/lib/utils/AccessoryUtils.d.ts +0 -1
- package/build/lib/utils/BridgeUtils.d.ts +0 -1
- package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
- package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
- package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
- package/build/lib/utils/ServiceUtils.d.ts +0 -1
- package/build/lib/utils/ServiceUtils2.d.ts +0 -1
- package/build/lib/utils/index.d.ts +0 -1
- package/build/nodes/bridge.d.ts +0 -1
- package/build/nodes/nrchkb.d.ts +0 -1
- package/build/nodes/service.d.ts +0 -1
- package/build/nodes/service2.d.ts +0 -1
- package/build/nodes/standalone.d.ts +0 -1
- package/build/nodes/status.d.ts +0 -1
package/build/lib/HAPHostNode.js
CHANGED
|
@@ -1,152 +1,191 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
13
15
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_hap_nodejs = require("@homebridge/hap-nodejs");
|
|
25
|
+
var import_logger = require("@nrchkb/logger");
|
|
26
|
+
var import_semver = require("semver");
|
|
27
|
+
var import_preload = __toESM(require("semver/preload"));
|
|
28
|
+
var import_NRCHKBError = __toESM(require("./NRCHKBError"));
|
|
29
|
+
var import_HostType = __toESM(require("./types/HostType"));
|
|
30
|
+
var import_HapCategories = __toESM(require("./types/hap-nodejs/HapCategories"));
|
|
22
31
|
module.exports = (RED, hostType) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
yield self.host.destroy();
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
log.debug('This node is being restarted');
|
|
104
|
-
yield self.host.unpublish();
|
|
105
|
-
}
|
|
106
|
-
self.published = false;
|
|
107
|
-
done();
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
self.host.on('identify', function (paired, callback) {
|
|
111
|
-
if (paired) {
|
|
112
|
-
log.debug(`Identify called on paired ${hostTypeName}`);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
log.debug(`Identify called on unpaired ${hostTypeName}`);
|
|
116
|
-
}
|
|
117
|
-
callback();
|
|
118
|
-
});
|
|
119
|
-
const accessoryInformationService = self.host.getService(hap_nodejs_1.Service.AccessoryInformation) ||
|
|
120
|
-
self.host.addService(hap_nodejs_1.Service.AccessoryInformation);
|
|
121
|
-
accessoryInformationService
|
|
122
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.Manufacturer, self.config.manufacturer)
|
|
123
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.SerialNumber, self.config.serialNo)
|
|
124
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.Model, self.config.model)
|
|
125
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.FirmwareRevision, (_a = self.config.firmwareRev) === null || _a === void 0 ? void 0 : _a.toString())
|
|
126
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.HardwareRevision, (_b = self.config.hardwareRev) === null || _b === void 0 ? void 0 : _b.toString())
|
|
127
|
-
.setCharacteristic(hap_nodejs_1.Characteristic.SoftwareRevision, (_c = self.config.softwareRev) === null || _c === void 0 ? void 0 : _c.toString());
|
|
128
|
-
};
|
|
129
|
-
const macify = (nodeId) => {
|
|
130
|
-
if (nodeId) {
|
|
131
|
-
const noDecimalStr = nodeId.replace('.', '');
|
|
132
|
-
const paddedStr = noDecimalStr.padEnd(12, '0');
|
|
133
|
-
const match = paddedStr.match(/.{1,2}/g);
|
|
134
|
-
if (match) {
|
|
135
|
-
return match.join(':').substr(0, 17).toUpperCase();
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
throw new NRCHKBError_1.default(`match failed in macify process for padded string ${paddedStr}`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
throw new NRCHKBError_1.default('nodeId cannot be empty in macify process');
|
|
32
|
+
const normalizePort = (port) => {
|
|
33
|
+
if (port === void 0 || port === null || port === "") {
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
const normalizedPort = Number(port);
|
|
37
|
+
return Number.isNaN(normalizedPort) ? 0 : normalizedPort;
|
|
38
|
+
};
|
|
39
|
+
const init = function(config) {
|
|
40
|
+
const log = (0, import_logger.logger)("NRCHKB", "HAPHostNode", config.bridgeName, this);
|
|
41
|
+
this.hostType = hostType;
|
|
42
|
+
RED.nodes.createNode(this, config);
|
|
43
|
+
this.config = config;
|
|
44
|
+
this.name = config.bridgeName;
|
|
45
|
+
if (!hostNameValidator(config.bridgeName)) {
|
|
46
|
+
log.error("Host name is incorrect", false);
|
|
47
|
+
return new import_NRCHKBError.default("Host name is incorrect");
|
|
48
|
+
}
|
|
49
|
+
if (import_preload.default.parse(config.firmwareRev) == null) {
|
|
50
|
+
config.firmwareRev = new import_semver.SemVer("0.0.0");
|
|
51
|
+
}
|
|
52
|
+
if (!config.bind?.length && config.customMdnsConfig) {
|
|
53
|
+
log.error(
|
|
54
|
+
"Custom mDNS configuration is deprecated and ignored by HAP-NodeJS 2.x. Use Bind and Advertiser instead."
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
this.accessoryCategory = this.hostType == import_HostType.default.BRIDGE ? import_HapCategories.default.BRIDGE : this.config.accessoryCategory;
|
|
58
|
+
this.published = false;
|
|
59
|
+
this.paired = false;
|
|
60
|
+
try {
|
|
61
|
+
this.bridgeUsername = macify(this.id);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
log.error(error);
|
|
64
|
+
return error;
|
|
65
|
+
}
|
|
66
|
+
const hostUUID = import_hap_nodejs.uuid.generate(this.id);
|
|
67
|
+
const hostTypeName = this.hostType == import_HostType.default.BRIDGE ? "Bridge" : "Standalone Accessory";
|
|
68
|
+
log.debug(`Creating ${hostTypeName} with UUID ${hostUUID}`);
|
|
69
|
+
if (this.hostType == import_HostType.default.BRIDGE) {
|
|
70
|
+
this.host = new import_hap_nodejs.Bridge(this.name, hostUUID);
|
|
71
|
+
} else {
|
|
72
|
+
this.host = new import_hap_nodejs.Accessory(this.name, hostUUID);
|
|
73
|
+
}
|
|
74
|
+
this.publish = () => {
|
|
75
|
+
if (this.hostType == import_HostType.default.BRIDGE) {
|
|
76
|
+
log.debug(
|
|
77
|
+
`Publishing ${hostTypeName} with pin code ${this.config.pinCode} and ${this.host.bridgedAccessories.length} accessories`
|
|
78
|
+
);
|
|
79
|
+
} else {
|
|
80
|
+
log.debug(
|
|
81
|
+
`Publishing ${hostTypeName} with pin code ${this.config.pinCode}`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
const port = normalizePort(this.config.port);
|
|
85
|
+
if (port === 1880) {
|
|
86
|
+
log.error(
|
|
87
|
+
`Cannot publish on ${hostTypeName} port 1880 as it is reserved for node-red`
|
|
88
|
+
);
|
|
89
|
+
this.published = false;
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
let oldPinCode = this.config.pinCode;
|
|
93
|
+
if ((oldPinCode.match(/-/g) || []).length === 1) {
|
|
94
|
+
oldPinCode = oldPinCode.replace(/-/g, "");
|
|
95
|
+
oldPinCode = `${oldPinCode.slice(0, 3)}-${oldPinCode.slice(3, 5)}-${oldPinCode.slice(5, 8)}`;
|
|
96
|
+
}
|
|
97
|
+
let bind;
|
|
98
|
+
if (this.config.bind?.length && this.config.bindType) {
|
|
99
|
+
if (this.config.bindType === "str") {
|
|
100
|
+
bind = this.config.bind;
|
|
101
|
+
} else if (this.config.bindType === "json") {
|
|
102
|
+
try {
|
|
103
|
+
bind = JSON.parse(this.config.bind);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
log.error(`Invalid bind JSON: ${error}`);
|
|
106
|
+
this.published = false;
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
143
109
|
}
|
|
110
|
+
}
|
|
111
|
+
this.host.publish(
|
|
112
|
+
{
|
|
113
|
+
username: this.bridgeUsername,
|
|
114
|
+
port,
|
|
115
|
+
pincode: oldPinCode,
|
|
116
|
+
category: this.accessoryCategory,
|
|
117
|
+
bind,
|
|
118
|
+
advertiser: this.config.advertiser ?? import_hap_nodejs.MDNSAdvertiser.BONJOUR
|
|
119
|
+
},
|
|
120
|
+
this.config.allowInsecureRequest
|
|
121
|
+
);
|
|
122
|
+
this.published = true;
|
|
123
|
+
this.paired = !!this.host._accessoryInfo?.paired();
|
|
124
|
+
return true;
|
|
144
125
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
126
|
+
this.on("close", async (removed, done) => {
|
|
127
|
+
if (removed) {
|
|
128
|
+
log.debug("This node has been deleted");
|
|
129
|
+
await this.host.destroy();
|
|
130
|
+
} else {
|
|
131
|
+
log.debug("This node is being restarted");
|
|
132
|
+
await this.host.unpublish();
|
|
133
|
+
}
|
|
134
|
+
this.published = false;
|
|
135
|
+
this.paired = false;
|
|
136
|
+
done();
|
|
137
|
+
});
|
|
138
|
+
this.host.on("identify", (paired, callback) => {
|
|
139
|
+
if (paired) {
|
|
140
|
+
log.debug(`Identify called on paired ${hostTypeName}`);
|
|
141
|
+
} else {
|
|
142
|
+
log.debug(`Identify called on unpaired ${hostTypeName}`);
|
|
143
|
+
}
|
|
144
|
+
callback();
|
|
145
|
+
});
|
|
146
|
+
this.host.on("paired", () => {
|
|
147
|
+
this.paired = true;
|
|
148
|
+
});
|
|
149
|
+
this.host.on("unpaired", () => {
|
|
150
|
+
this.paired = false;
|
|
151
|
+
});
|
|
152
|
+
const accessoryInformationService = this.host.getService(import_hap_nodejs.Service.AccessoryInformation) || this.host.addService(import_hap_nodejs.Service.AccessoryInformation);
|
|
153
|
+
accessoryInformationService.setCharacteristic(
|
|
154
|
+
import_hap_nodejs.Characteristic.Manufacturer,
|
|
155
|
+
this.config.manufacturer
|
|
156
|
+
).setCharacteristic(
|
|
157
|
+
import_hap_nodejs.Characteristic.SerialNumber,
|
|
158
|
+
this.config.serialNo
|
|
159
|
+
).setCharacteristic(import_hap_nodejs.Characteristic.Model, this.config.model).setCharacteristic(
|
|
160
|
+
import_hap_nodejs.Characteristic.FirmwareRevision,
|
|
161
|
+
this.config.firmwareRev?.toString()
|
|
162
|
+
).setCharacteristic(
|
|
163
|
+
import_hap_nodejs.Characteristic.HardwareRevision,
|
|
164
|
+
this.config.hardwareRev?.toString()
|
|
165
|
+
).setCharacteristic(
|
|
166
|
+
import_hap_nodejs.Characteristic.SoftwareRevision,
|
|
167
|
+
this.config.softwareRev?.toString()
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
const macify = (nodeId) => {
|
|
171
|
+
if (nodeId) {
|
|
172
|
+
const noDecimalStr = nodeId.replace(/\./g, "");
|
|
173
|
+
const paddedStr = noDecimalStr.padEnd(12, "0");
|
|
174
|
+
const match = paddedStr.match(/.{1,2}/g);
|
|
175
|
+
if (match) {
|
|
176
|
+
return match.join(":").slice(0, 17).toUpperCase();
|
|
177
|
+
} else {
|
|
178
|
+
throw new import_NRCHKBError.default(
|
|
179
|
+
`match failed in macify process for padded string ${paddedStr}`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
throw new import_NRCHKBError.default("nodeId cannot be empty in macify process");
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const hostNameValidator = (hostName) => hostName ? /^[^.]{1,64}$/.test(hostName) : false;
|
|
187
|
+
return {
|
|
188
|
+
init,
|
|
189
|
+
macify
|
|
190
|
+
};
|
|
152
191
|
};
|