node-red-contrib-homekit-bridged 2.0.0-dev.5 → 2.0.0-dev.7

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.
Files changed (128) hide show
  1. package/build/lib/HAPHostNode.js +183 -141
  2. package/build/lib/HAPServiceNode.js +199 -172
  3. package/build/lib/HAPServiceNode2.js +207 -172
  4. package/build/lib/NRCHKBError.js +23 -2
  5. package/build/lib/PairingQRCode.js +62 -0
  6. package/build/lib/Storage.js +157 -92
  7. package/build/lib/api.js +654 -288
  8. package/build/lib/camera/CameraControl.js +119 -84
  9. package/build/lib/camera/CameraDelegate.js +481 -404
  10. package/build/lib/camera/MP4StreamingServer.js +148 -139
  11. package/build/lib/hap/HAPCharacteristic.js +25 -4
  12. package/build/lib/hap/HAPService.js +25 -4
  13. package/build/lib/hap/eve-app/EveCharacteristics.js +124 -81
  14. package/build/lib/hap/eve-app/EveServices.js +50 -17
  15. package/build/lib/hap/hap-nodejs.js +32 -0
  16. package/build/lib/migration/HomeKitService2Migration.js +34 -0
  17. package/build/lib/migration/NodeMigration.js +75 -0
  18. package/build/lib/types/AccessoryInformationType.js +15 -1
  19. package/build/lib/types/CameraConfigType.js +15 -1
  20. package/build/lib/types/CustomCharacteristicType.js +15 -1
  21. package/build/lib/types/HAPHostConfigType.js +15 -1
  22. package/build/lib/types/HAPHostNodeType.js +15 -1
  23. package/build/lib/types/HAPService2ConfigType.js +15 -1
  24. package/build/lib/types/HAPService2NodeType.js +15 -1
  25. package/build/lib/types/HAPServiceConfigType.js +15 -1
  26. package/build/lib/types/HAPServiceNodeType.js +15 -1
  27. package/build/lib/types/HAPStatusConfigType.js +15 -1
  28. package/build/lib/types/HAPStatusNodeType.js +15 -1
  29. package/build/lib/types/HostType.js +28 -7
  30. package/build/lib/types/NodeType.js +15 -1
  31. package/build/lib/types/PublishTimersType.js +15 -1
  32. package/build/lib/types/UniFiControllerConfigType.js +16 -0
  33. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +28 -7
  34. package/build/lib/types/hap-nodejs/HapCategories.js +64 -43
  35. package/build/lib/types/storage/SerializedHostType.js +15 -1
  36. package/build/lib/types/storage/StorageType.js +34 -10
  37. package/build/lib/unifi/ProtectDiscovery.js +80 -0
  38. package/build/lib/utils/AccessoryUtils.js +152 -110
  39. package/build/lib/utils/BridgeUtils.js +82 -39
  40. package/build/lib/utils/CharacteristicUtils.js +5 -49
  41. package/build/lib/utils/CharacteristicUtils2.js +5 -49
  42. package/build/lib/utils/CharacteristicUtilsBase.js +81 -0
  43. package/build/lib/utils/NodeStatusUtils.js +89 -40
  44. package/build/lib/utils/ServiceUtils.js +434 -375
  45. package/build/lib/utils/ServiceUtils2.js +514 -309
  46. package/build/lib/utils/index.js +10 -11
  47. package/build/nodes/bridge.html +184 -166
  48. package/build/nodes/bridge.js +27 -9
  49. package/build/nodes/locales/en-US/node-red-contrib-homekit-bridged.json +22 -0
  50. package/build/nodes/nrchkb.html +1601 -88
  51. package/build/nodes/nrchkb.js +66 -88
  52. package/build/nodes/plugin-instance.html +499 -0
  53. package/build/nodes/plugin-instance.js +46 -0
  54. package/build/nodes/service.html +517 -299
  55. package/build/nodes/service.js +5 -6
  56. package/build/nodes/service2.html +1683 -460
  57. package/build/nodes/service2.js +5 -8
  58. package/build/nodes/standalone.html +187 -174
  59. package/build/nodes/standalone.js +27 -9
  60. package/build/nodes/status.html +51 -18
  61. package/build/nodes/status.js +47 -40
  62. package/build/nodes/unifi-controller.html +92 -0
  63. package/build/nodes/unifi-controller.js +20 -0
  64. package/build/plugins/embedded/homebridge-camera-ffmpeg/index.js +479 -0
  65. package/build/plugins/embedded/homebridge-unifi-protect/index.js +521 -0
  66. package/build/plugins/embedded/index.js +58 -0
  67. package/build/plugins/nrchkb-homekit-plugins.js +17 -0
  68. package/build/plugins/registry/index.js +203 -0
  69. package/build/plugins/registry/types.js +16 -0
  70. package/build/scripts/migrate-homekit-service-flows.js +47 -0
  71. package/examples/demo/01 - ALL Demos single import.json +1885 -1885
  72. package/examples/demo/02 - Air Purifier.json +279 -279
  73. package/examples/demo/03 - Air Quality sensor with Battery.json +254 -254
  74. package/examples/demo/04 - Dimmable Bulb.json +172 -172
  75. package/examples/demo/05 - Color Bulb (HSV).json +195 -195
  76. package/examples/demo/06 - Fan (simple, 3 speeds).json +240 -240
  77. package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +175 -175
  78. package/examples/demo/08 - CO2 detector.json +224 -224
  79. package/examples/demo/09 - CO (carbon monoxide) example.json +255 -255
  80. package/examples/demo/10 - Door window contact sensor.json +234 -234
  81. package/examples/demos (advanced)/01 - Television with inputs and speaker.json +541 -541
  82. package/examples/switch/01 - Plain Switch.json +178 -178
  83. package/package.json +95 -84
  84. package/build/lib/HAPHostNode.d.ts +0 -1
  85. package/build/lib/HAPServiceNode.d.ts +0 -1
  86. package/build/lib/HAPServiceNode2.d.ts +0 -1
  87. package/build/lib/NRCHKBError.d.ts +0 -3
  88. package/build/lib/Storage.d.ts +0 -30
  89. package/build/lib/api.d.ts +0 -1
  90. package/build/lib/camera/CameraControl.d.ts +0 -3
  91. package/build/lib/camera/CameraDelegate.d.ts +0 -38
  92. package/build/lib/camera/MP4StreamingServer.d.ts +0 -26
  93. package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
  94. package/build/lib/hap/HAPService.d.ts +0 -6
  95. package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
  96. package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
  97. package/build/lib/types/AccessoryInformationType.d.ts +0 -11
  98. package/build/lib/types/CameraConfigType.d.ts +0 -24
  99. package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
  100. package/build/lib/types/HAPHostConfigType.d.ts +0 -22
  101. package/build/lib/types/HAPHostNodeType.d.ts +0 -14
  102. package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
  103. package/build/lib/types/HAPService2NodeType.d.ts +0 -7
  104. package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
  105. package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
  106. package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
  107. package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
  108. package/build/lib/types/HostType.d.ts +0 -5
  109. package/build/lib/types/NodeType.d.ts +0 -3
  110. package/build/lib/types/PublishTimersType.d.ts +0 -4
  111. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
  112. package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
  113. package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
  114. package/build/lib/types/storage/StorageType.d.ts +0 -8
  115. package/build/lib/utils/AccessoryUtils.d.ts +0 -1
  116. package/build/lib/utils/BridgeUtils.d.ts +0 -1
  117. package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
  118. package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
  119. package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
  120. package/build/lib/utils/ServiceUtils.d.ts +0 -1
  121. package/build/lib/utils/ServiceUtils2.d.ts +0 -1
  122. package/build/lib/utils/index.d.ts +0 -1
  123. package/build/nodes/bridge.d.ts +0 -1
  124. package/build/nodes/nrchkb.d.ts +0 -1
  125. package/build/nodes/service.d.ts +0 -1
  126. package/build/nodes/service2.d.ts +0 -1
  127. package/build/nodes/standalone.d.ts +0 -1
  128. package/build/nodes/status.d.ts +0 -1
@@ -1,149 +1,191 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
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
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const hap_nodejs_1 = require("@homebridge/hap-nodejs");
16
- const logger_1 = require("@nrchkb/logger");
17
- const semver_1 = require("semver");
18
- const preload_1 = __importDefault(require("semver/preload"));
19
- const NRCHKBError_1 = __importDefault(require("./NRCHKBError"));
20
- const HostType_1 = __importDefault(require("./types/HostType"));
21
- const HapCategories_1 = __importDefault(require("./types/hap-nodejs/HapCategories"));
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
- const init = function (config) {
24
- var _a, _b, _c;
25
- const log = (0, logger_1.logger)('NRCHKB', 'HAPHostNode', config.bridgeName, this);
26
- this.hostType = hostType;
27
- RED.nodes.createNode(this, config);
28
- this.config = config;
29
- this.name = config.bridgeName;
30
- if (!hostNameValidator(config.bridgeName)) {
31
- log.error('Host name is incorrect', false);
32
- return new NRCHKBError_1.default('Host name is incorrect');
33
- }
34
- if (preload_1.default.parse(config.firmwareRev) == null) {
35
- config.firmwareRev = new semver_1.SemVer('0.0.0');
36
- }
37
- this.accessoryCategory = (this.hostType == HostType_1.default.BRIDGE
38
- ? HapCategories_1.default.BRIDGE
39
- : this.config.accessoryCategory);
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
+ );
40
89
  this.published = false;
41
- try {
42
- this.bridgeUsername = macify(this.id);
43
- }
44
- catch (error) {
45
- log.error(error);
46
- return error;
47
- }
48
- const hostUUID = hap_nodejs_1.uuid.generate(this.id);
49
- const hostTypeName = this.hostType == HostType_1.default.BRIDGE ? 'Bridge' : 'Standalone Accessory';
50
- log.debug(`Creating ${hostTypeName} with UUID ${hostUUID}`);
51
- if (this.hostType == HostType_1.default.BRIDGE) {
52
- this.host = new hap_nodejs_1.Bridge(this.name, hostUUID);
53
- }
54
- else {
55
- this.host = new hap_nodejs_1.Accessory(this.name, hostUUID);
56
- }
57
- this.publish = () => {
58
- var _a, _b;
59
- if (this.hostType == HostType_1.default.BRIDGE) {
60
- log.debug(`Publishing ${hostTypeName} with pin code ${this.config.pinCode} and ${this.host.bridgedAccessories.length} accessories`);
61
- }
62
- else {
63
- log.debug(`Publishing ${hostTypeName} with pin code ${this.config.pinCode}`);
64
- }
65
- if (this.config.port === 1880) {
66
- log.error(`Cannot publish on ${hostTypeName} port 1880 as it is reserved for node-red`);
67
- this.published = false;
68
- return false;
69
- }
70
- let oldPinCode = this.config.pinCode;
71
- if ((oldPinCode.match(/-/g) || []).length === 1) {
72
- oldPinCode = oldPinCode.replace(/-/g, '');
73
- oldPinCode = `${oldPinCode.slice(0, 3)}-${oldPinCode.slice(3, 5)}-${oldPinCode.slice(5, 8)}`;
74
- }
75
- let bind;
76
- if (((_a = this.config.bind) === null || _a === void 0 ? void 0 : _a.length) && this.config.bindType) {
77
- if (this.config.bindType === 'str') {
78
- bind = this.config.bind;
79
- }
80
- else if (this.config.bindType === 'json') {
81
- bind = JSON.parse(this.config.bind);
82
- }
83
- }
84
- this.host.publish({
85
- username: this.bridgeUsername,
86
- port: this.config.port && !Number.isNaN(this.config.port)
87
- ? this.config.port
88
- : 0,
89
- pincode: oldPinCode,
90
- category: this.accessoryCategory,
91
- bind: bind,
92
- advertiser: (_b = this.config.advertiser) !== null && _b !== void 0 ? _b : "bonjour-hap"
93
- }, this.config.allowInsecureRequest);
94
- this.published = true;
95
- return true;
96
- };
97
- this.on('close', (removed, done) => __awaiter(this, void 0, void 0, function* () {
98
- if (removed) {
99
- log.debug('This node has been deleted');
100
- yield this.host.destroy();
101
- }
102
- else {
103
- log.debug('This node is being restarted');
104
- yield this.host.unpublish();
105
- }
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
106
  this.published = false;
107
- done();
108
- }));
109
- this.host.on('identify', (paired, callback) => {
110
- if (paired) {
111
- log.debug(`Identify called on paired ${hostTypeName}`);
112
- }
113
- else {
114
- log.debug(`Identify called on unpaired ${hostTypeName}`);
115
- }
116
- callback();
117
- });
118
- const accessoryInformationService = this.host.getService(hap_nodejs_1.Service.AccessoryInformation) ||
119
- this.host.addService(hap_nodejs_1.Service.AccessoryInformation);
120
- accessoryInformationService
121
- .setCharacteristic(hap_nodejs_1.Characteristic.Manufacturer, this.config.manufacturer)
122
- .setCharacteristic(hap_nodejs_1.Characteristic.SerialNumber, this.config.serialNo)
123
- .setCharacteristic(hap_nodejs_1.Characteristic.Model, this.config.model)
124
- .setCharacteristic(hap_nodejs_1.Characteristic.FirmwareRevision, (_a = this.config.firmwareRev) === null || _a === void 0 ? void 0 : _a.toString())
125
- .setCharacteristic(hap_nodejs_1.Characteristic.HardwareRevision, (_b = this.config.hardwareRev) === null || _b === void 0 ? void 0 : _b.toString())
126
- .setCharacteristic(hap_nodejs_1.Characteristic.SoftwareRevision, (_c = this.config.softwareRev) === null || _c === void 0 ? void 0 : _c.toString());
127
- };
128
- const macify = (nodeId) => {
129
- if (nodeId) {
130
- const noDecimalStr = nodeId.replace('.', '');
131
- const paddedStr = noDecimalStr.padEnd(12, '0');
132
- const match = paddedStr.match(/.{1,2}/g);
133
- if (match) {
134
- return match.join(':').substr(0, 17).toUpperCase();
135
- }
136
- else {
137
- throw new NRCHKBError_1.default(`match failed in macify process for padded string ${paddedStr}`);
138
- }
139
- }
140
- else {
141
- throw new NRCHKBError_1.default('nodeId cannot be empty in macify process');
107
+ return false;
108
+ }
142
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;
143
125
  };
144
- const hostNameValidator = (hostName) => hostName ? /^[^.]{1,64}$/.test(hostName) : false;
145
- return {
146
- init,
147
- macify
148
- };
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
+ };
149
191
  };