@privateaim/kit 0.8.21 → 0.8.22

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.22](https://github.com/PrivateAIM/hub/compare/v0.8.21...v0.8.22) (2026-01-27)
4
+
5
+
6
+ ### Features
7
+
8
+ * bucket-file aggregation with analysis-bucket-file management ([#1324](https://github.com/PrivateAIM/hub/issues/1324)) ([00d5aa8](https://github.com/PrivateAIM/hub/commit/00d5aa8bc16a66d7a761ef60b2b4ec27983e5c9a))
9
+ * check handlers for analysis building and distribution ([#1318](https://github.com/PrivateAIM/hub/issues/1318)) ([a43ba20](https://github.com/PrivateAIM/hub/commit/a43ba203223ee5ffc00e63c3ff1d8829970590b2))
10
+ * migrate to esm & replace jest with vitest ([#1368](https://github.com/PrivateAIM/hub/issues/1368)) ([5a4d9d1](https://github.com/PrivateAIM/hub/commit/5a4d9d1ce118f65740aa49caf948208eac299032))
11
+ * replace AnalysisXXXStatus with ProcessStatus ([#1276](https://github.com/PrivateAIM/hub/issues/1276)) ([f4826cf](https://github.com/PrivateAIM/hub/commit/f4826cf0938d0171565a1aae880c5d724fbc107b))
12
+ * store analysis build hash, size & os ([#1374](https://github.com/PrivateAIM/hub/issues/1374)) ([6110ba6](https://github.com/PrivateAIM/hub/commit/6110ba6c94b3321c1477173c35afdea8b04ad33d))
13
+
3
14
  ## [0.8.21](https://github.com/PrivateAIM/hub/compare/v0.8.20...v0.8.21) (2025-11-04)
4
15
 
5
16
  ## [0.8.20](https://github.com/PrivateAIM/hub/compare/v0.8.19...v0.8.20) (2025-10-29)
@@ -3,6 +3,14 @@ export declare enum EnvironmentName {
3
3
  DEVELOPMENT = "development",
4
4
  PRODUCTION = "production"
5
5
  }
6
+ export declare enum ProcessStatus {
7
+ STARTING = "starting",
8
+ STARTED = "started",
9
+ STOPPING = "stopping",
10
+ STOPPED = "stopped",
11
+ FINISHED = "finished",
12
+ FAILED = "failed"
13
+ }
6
14
  export declare const MINUTE_IN_MS: number;
7
15
  export declare const HOUR_IN_MS: number;
8
16
  export declare const DAY_IN_MS: number;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAOA,oBAAY,eAAe;IACvB,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,UAAU,eAAe;CAC5B;AAED,eAAO,MAAM,YAAY,QAAY,CAAC;AACtC,eAAO,MAAM,UAAU,QAAoB,CAAC;AAC5C,eAAO,MAAM,SAAS,QAAkB,CAAC;AACzC,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,WAAW,QAAiB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAOA,oBAAY,eAAe;IACvB,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,UAAU,eAAe;CAC5B;AAED,oBAAY,aAAa;IACrB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,YAAY,QAAY,CAAC;AACtC,eAAO,MAAM,UAAU,QAAoB,CAAC;AAC5C,eAAO,MAAM,SAAS,QAAkB,CAAC;AACzC,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,WAAW,QAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare class HubError extends Error {
2
+ }
3
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAS,SAAQ,KAAK;CAElC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './crypto';
2
2
  export * from './domains';
3
+ export * from './error';
3
4
  export * from './domain-event';
4
5
  export * from './utils';
5
6
  export * from './constants';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
package/dist/index.mjs CHANGED
@@ -17,165 +17,50 @@ import { customAlphabet } from 'nanoid';
17
17
  * Author Peter Placzek (tada5hi)
18
18
  * For the full copyright and license information,
19
19
  * view the LICENSE file that was distributed with this source code.
20
- */ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
21
- try {
22
- var info = gen[key](arg);
23
- var value = info.value;
24
- } catch (error) {
25
- reject(error);
26
- return;
27
- }
28
- if (info.done) {
29
- resolve(value);
30
- } else {
31
- Promise.resolve(value).then(_next, _throw);
32
- }
33
- }
34
- function _async_to_generator$2(fn) {
35
- return function() {
36
- var self = this, args = arguments;
37
- return new Promise(function(resolve, reject) {
38
- var gen = fn.apply(self, args);
39
- function _next(value) {
40
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
41
- }
42
- function _throw(err) {
43
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
44
- }
45
- _next(undefined);
46
- });
47
- };
48
- }
49
- function arrayBufferToBase64(arrayBuffer) {
20
+ */ function arrayBufferToBase64(arrayBuffer) {
50
21
  return btoa(String.fromCharCode.apply(null, new Uint8Array(arrayBuffer)));
51
22
  }
52
- function exportAsymmetricPublicKey(key) {
53
- return _async_to_generator$2(function*() {
54
- const exported = yield crypto.subtle.exportKey('spki', key);
55
- return `-----BEGIN PUBLIC KEY-----\n${arrayBufferToBase64(exported)}\n-----END PUBLIC KEY-----`;
56
- })();
23
+ async function exportAsymmetricPublicKey(key) {
24
+ const exported = await crypto.subtle.exportKey('spki', key);
25
+ return `-----BEGIN PUBLIC KEY-----\n${arrayBufferToBase64(exported)}\n-----END PUBLIC KEY-----`;
57
26
  }
58
- function exportAsymmetricPrivateKey(key) {
59
- return _async_to_generator$2(function*() {
60
- const exported = yield crypto.subtle.exportKey('pkcs8', key);
61
- return `-----BEGIN PRIVATE KEY-----\n${arrayBufferToBase64(exported)}\n-----END PRIVATE KEY-----`;
62
- })();
27
+ async function exportAsymmetricPrivateKey(key) {
28
+ const exported = await crypto.subtle.exportKey('pkcs8', key);
29
+ return `-----BEGIN PRIVATE KEY-----\n${arrayBufferToBase64(exported)}\n-----END PRIVATE KEY-----`;
63
30
  }
64
31
 
65
- /*
66
- * Copyright (c) 2024.
67
- * Author Peter Placzek (tada5hi)
68
- * For the full copyright and license information,
69
- * view the LICENSE file that was distributed with this source code.
70
- */ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
71
- try {
72
- var info = gen[key](arg);
73
- var value = info.value;
74
- } catch (error) {
75
- reject(error);
76
- return;
77
- }
78
- if (info.done) {
79
- resolve(value);
80
- } else {
81
- Promise.resolve(value).then(_next, _throw);
82
- }
83
- }
84
- function _async_to_generator$1(fn) {
85
- return function() {
86
- var self = this, args = arguments;
87
- return new Promise(function(resolve, reject) {
88
- var gen = fn.apply(self, args);
89
- function _next(value) {
90
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
91
- }
92
- function _throw(err) {
93
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
94
- }
95
- _next(undefined);
96
- });
97
- };
98
- }
99
- function _define_property(obj, key, value) {
100
- if (key in obj) {
101
- Object.defineProperty(obj, key, {
102
- value: value,
103
- enumerable: true,
104
- configurable: true,
105
- writable: true
106
- });
107
- } else {
108
- obj[key] = value;
109
- }
110
- return obj;
111
- }
112
- function _object_spread(target) {
113
- for(var i = 1; i < arguments.length; i++){
114
- var source = arguments[i] != null ? arguments[i] : {};
115
- var ownKeys = Object.keys(source);
116
- if (typeof Object.getOwnPropertySymbols === "function") {
117
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
118
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
119
- }));
120
- }
121
- ownKeys.forEach(function(key) {
122
- _define_property(target, key, source[key]);
123
- });
124
- }
125
- return target;
126
- }
127
- function ownKeys(object, enumerableOnly) {
128
- var keys = Object.keys(object);
129
- if (Object.getOwnPropertySymbols) {
130
- var symbols = Object.getOwnPropertySymbols(object);
131
- keys.push.apply(keys, symbols);
132
- }
133
- return keys;
134
- }
135
- function _object_spread_props(target, source) {
136
- source = source != null ? source : {};
137
- if (Object.getOwnPropertyDescriptors) {
138
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
139
- } else {
140
- ownKeys(Object(source)).forEach(function(key) {
141
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
142
- });
143
- }
144
- return target;
145
- }
146
32
  class CryptoAsymmetricAlgorithm {
147
- generateKeyPair() {
148
- return _async_to_generator$1(function*() {
149
- if (this.algorithm.name === AsymmetricCryptoAlgorithmName.RSA_OAEP) {
150
- this.keyPair = yield crypto.subtle.generateKey(this.algorithm, true, [
151
- 'encrypt',
152
- 'decrypt'
153
- ]);
154
- return this.keyPair;
155
- }
156
- if (this.algorithm.name === AsymmetricCryptoAlgorithmName.ECDH) {
157
- this.keyPair = yield crypto.subtle.generateKey(this.algorithm, true, [
158
- 'deriveKey'
159
- ]);
160
- return this.keyPair;
161
- }
162
- throw new Error('The algorithm is not supported for key generation.');
163
- }).call(this);
164
- }
33
+ algorithm;
34
+ keyPair;
165
35
  constructor(algorithm){
166
- _define_property(this, "algorithm", void 0);
167
- _define_property(this, "keyPair", void 0);
168
36
  if (algorithm.name === AsymmetricCryptoAlgorithmName.RSA_OAEP) {
169
- algorithm = _object_spread_props(_object_spread({}, algorithm), {
37
+ algorithm = {
38
+ ...algorithm,
170
39
  publicExponent: new Uint8Array([
171
40
  1,
172
41
  0,
173
42
  1
174
43
  ])
175
- });
44
+ };
176
45
  }
177
46
  this.algorithm = algorithm;
178
47
  }
48
+ async generateKeyPair() {
49
+ if (this.algorithm.name === AsymmetricCryptoAlgorithmName.RSA_OAEP) {
50
+ this.keyPair = await crypto.subtle.generateKey(this.algorithm, true, [
51
+ 'encrypt',
52
+ 'decrypt'
53
+ ]);
54
+ return this.keyPair;
55
+ }
56
+ if (this.algorithm.name === AsymmetricCryptoAlgorithmName.ECDH) {
57
+ this.keyPair = await crypto.subtle.generateKey(this.algorithm, true, [
58
+ 'deriveKey'
59
+ ]);
60
+ return this.keyPair;
61
+ }
62
+ throw new Error('The algorithm is not supported for key generation.');
63
+ }
179
64
  }
180
65
 
181
66
  /*
@@ -252,6 +137,44 @@ function extractErrorMessage(e) {
252
137
  return e.message;
253
138
  }
254
139
 
140
+ /*
141
+ * Copyright (c) 2026.
142
+ * Author Peter Placzek (tada5hi)
143
+ * For the full copyright and license information,
144
+ * view the LICENSE file that was distributed with this source code.
145
+ */ function humanFileSize(bytes, si = false, dp = 1) {
146
+ const thresh = si ? 1000 : 1024;
147
+ if (Math.abs(bytes) < thresh) {
148
+ return `${bytes} B`;
149
+ }
150
+ const units = si ? [
151
+ 'kB',
152
+ 'MB',
153
+ 'GB',
154
+ 'TB',
155
+ 'PB',
156
+ 'EB',
157
+ 'ZB',
158
+ 'YB'
159
+ ] : [
160
+ 'KiB',
161
+ 'MiB',
162
+ 'GiB',
163
+ 'TiB',
164
+ 'PiB',
165
+ 'EiB',
166
+ 'ZiB',
167
+ 'YiB'
168
+ ];
169
+ let u = -1;
170
+ const r = 10 ** dp;
171
+ do {
172
+ bytes /= thresh;
173
+ ++u;
174
+ }while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1)
175
+ return `${bytes.toFixed(dp)} ${units[u]}`;
176
+ }
177
+
255
178
  /*
256
179
  * Copyright (c) 2021-2024.
257
180
  * Author Peter Placzek (tada5hi)
@@ -309,7 +232,7 @@ function createNanoID(alphabetOrLen, len) {
309
232
  * For the full copyright and license information,
310
233
  * view the LICENSE file that was distributed with this source code.
311
234
  */ function nanoSeconds() {
312
- return BigInt(Math.floor(performance.timeOrigin)) * 1000000n + BigInt(Math.floor(performance.now() * 1000000));
235
+ return BigInt(Math.floor(performance.timeOrigin)) * 1_000_000n + BigInt(Math.floor(performance.now() * 1_000_000));
313
236
  }
314
237
 
315
238
  /*
@@ -391,41 +314,10 @@ const registryRobotSecretRegex = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\d).{8,}$/;
391
314
  * Author Peter Placzek (tada5hi)
392
315
  * For the full copyright and license information,
393
316
  * view the LICENSE file that was distributed with this source code.
394
- */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
395
- try {
396
- var info = gen[key](arg);
397
- var value = info.value;
398
- } catch (error) {
399
- reject(error);
400
- return;
401
- }
402
- if (info.done) {
403
- resolve(value);
404
- } else {
405
- Promise.resolve(value).then(_next, _throw);
406
- }
407
- }
408
- function _async_to_generator(fn) {
409
- return function() {
410
- var self = this, args = arguments;
411
- return new Promise(function(resolve, reject) {
412
- var gen = fn.apply(self, args);
413
- function _next(value) {
414
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
415
- }
416
- function _throw(err) {
417
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
418
- }
419
- _next(undefined);
420
- });
421
- };
422
- }
423
- function wait(ms) {
424
- return _async_to_generator(function*() {
425
- return new Promise((resolve)=>{
426
- setTimeout(resolve, ms);
427
- });
428
- })();
317
+ */ async function wait(ms) {
318
+ return new Promise((resolve)=>{
319
+ setTimeout(resolve, ms);
320
+ });
429
321
  }
430
322
 
431
323
  /**
@@ -448,7 +340,7 @@ function wait(ms) {
448
340
  if (isPropertySet(realm, 'name') && realm.name === REALM_MASTER_NAME) {
449
341
  return true;
450
342
  }
451
- return (realm === null || realm === void 0 ? void 0 : realm.id) === resourceRealmId;
343
+ return realm?.id === resourceRealmId;
452
344
  }
453
345
  /**
454
346
  * Check if realm resource is readable.
@@ -473,7 +365,7 @@ function wait(ms) {
473
365
  if (isPropertySet(realm, 'name') && realm.name === REALM_MASTER_NAME) {
474
366
  return true;
475
367
  }
476
- return !resourceRealmId || (realm === null || realm === void 0 ? void 0 : realm.id) === resourceRealmId;
368
+ return !resourceRealmId || realm?.id === resourceRealmId;
477
369
  }
478
370
 
479
371
  /*
@@ -505,6 +397,14 @@ function buildDomainNamespaceName(id) {
505
397
  return id ? `/resources:${id}` : '/resources';
506
398
  }
507
399
 
400
+ /*
401
+ * Copyright (c) 2025.
402
+ * Author Peter Placzek (tada5hi)
403
+ * For the full copyright and license information,
404
+ * view the LICENSE file that was distributed with this source code.
405
+ */ class HubError extends Error {
406
+ }
407
+
508
408
  /*
509
409
  * Copyright (c) 2025.
510
410
  * Author Peter Placzek (tada5hi)
@@ -526,11 +426,20 @@ function buildDomainNamespaceName(id) {
526
426
  EnvironmentName["PRODUCTION"] = "production";
527
427
  return EnvironmentName;
528
428
  }({});
429
+ var ProcessStatus = /*#__PURE__*/ function(ProcessStatus) {
430
+ ProcessStatus["STARTING"] = "starting";
431
+ ProcessStatus["STARTED"] = "started";
432
+ ProcessStatus["STOPPING"] = "stopping";
433
+ ProcessStatus["STOPPED"] = "stopped";
434
+ ProcessStatus["FINISHED"] = "finished";
435
+ ProcessStatus["FAILED"] = "failed";
436
+ return ProcessStatus;
437
+ }({});
529
438
  const MINUTE_IN_MS = 1000 * 60;
530
439
  const HOUR_IN_MS = MINUTE_IN_MS * 60;
531
440
  const DAY_IN_MS = HOUR_IN_MS * 24;
532
441
  const WEEK_IN_MS = DAY_IN_MS * 7;
533
442
  const MONTH_IN_MS = WEEK_IN_MS * 4;
534
443
 
535
- export { AsymmetricCryptoAlgorithmName, CryptoAsymmetricAlgorithm, DAY_IN_MS, DomainEventName, DomainEventNamespace, EnvironmentName, HOUR_IN_MS, MINUTE_IN_MS, MONTH_IN_MS, PermissionName, WEEK_IN_MS, alphaNumHyphenUnderscoreRegex, buildDomainChannelName, buildDomainEventFullName, buildDomainNamespaceName, createNanoID, deleteUndefinedObjectProperties, detectProxyConnectionConfig, exportAsymmetricPrivateKey, exportAsymmetricPublicKey, extractErrorMessage, getHostNameFromString, hasOwnProperty, hexToUTF8, isBool, isBoolFalse, isBoolTrue, isError, isHex, isObject, isPropertySet, isRealmResourceReadable, isRealmResourceWritable, nanoSeconds, nullifyEmptyObjectProperties, parseProxyConnectionString, registryRobotSecretRegex, wait };
444
+ export { AsymmetricCryptoAlgorithmName, CryptoAsymmetricAlgorithm, DAY_IN_MS, DomainEventName, DomainEventNamespace, EnvironmentName, HOUR_IN_MS, HubError, MINUTE_IN_MS, MONTH_IN_MS, PermissionName, ProcessStatus, WEEK_IN_MS, alphaNumHyphenUnderscoreRegex, buildDomainChannelName, buildDomainEventFullName, buildDomainNamespaceName, createNanoID, deleteUndefinedObjectProperties, detectProxyConnectionConfig, exportAsymmetricPrivateKey, exportAsymmetricPublicKey, extractErrorMessage, getHostNameFromString, hasOwnProperty, hexToUTF8, humanFileSize, isBool, isBoolFalse, isBoolTrue, isError, isHex, isObject, isPropertySet, isRealmResourceReadable, isRealmResourceWritable, nanoSeconds, nullifyEmptyObjectProperties, parseProxyConnectionString, registryRobotSecretRegex, wait };
536
445
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/crypto/asymmetric/constants.ts","../src/crypto/asymmetric/helpers.ts","../src/crypto/asymmetric/module.ts","../src/domains/permission/constants.ts","../src/utils/boolean.ts","../src/utils/has-own-property.ts","../src/utils/error.ts","../src/utils/hex-checker.ts","../src/utils/hostname.ts","../src/utils/is-object.ts","../src/utils/nanoid.ts","../src/utils/nanoseconds.ts","../src/utils/object-properties.ts","../src/utils/proxy-connection-string.ts","../src/utils/regex-patterns.ts","../src/utils/wait.ts","../src/domains/realm/helper.ts","../src/domains/constants.ts","../src/domains/helpers.ts","../src/domain-event/helpers.ts","../src/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum AsymmetricCryptoAlgorithmName {\n RSA_OAEP = 'RSA-OAEP',\n\n ECDH = 'ECDH',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nfunction arrayBufferToBase64(arrayBuffer: ArrayBuffer): string {\n return btoa(String.fromCharCode.apply(null, new Uint8Array(arrayBuffer)));\n}\n\nexport async function exportAsymmetricPublicKey(key: CryptoKey): Promise<string> {\n const exported = await crypto.subtle.exportKey(\n 'spki',\n key,\n );\n\n return `-----BEGIN PUBLIC KEY-----\\n${arrayBufferToBase64(exported)}\\n-----END PUBLIC KEY-----`;\n}\n\nexport async function exportAsymmetricPrivateKey(key: CryptoKey): Promise<string> {\n const exported = await crypto.subtle.exportKey(\n 'pkcs8',\n key,\n );\n\n return `-----BEGIN PRIVATE KEY-----\\n${arrayBufferToBase64(exported)}\\n-----END PRIVATE KEY-----`;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { AsymmetricCryptoAlgorithmName } from './constants';\nimport type { AsymmetricAlgorithmParams } from './types';\n\nexport class CryptoAsymmetricAlgorithm {\n public readonly algorithm: AsymmetricAlgorithmParams;\n\n protected keyPair : CryptoKeyPair | undefined;\n\n constructor(algorithm: AsymmetricAlgorithmParams) {\n if (algorithm.name === AsymmetricCryptoAlgorithmName.RSA_OAEP) {\n algorithm = {\n ...algorithm,\n publicExponent: new Uint8Array([1, 0, 1]),\n };\n }\n\n this.algorithm = algorithm;\n }\n\n async generateKeyPair() : Promise<CryptoKeyPair> {\n if (this.algorithm.name === AsymmetricCryptoAlgorithmName.RSA_OAEP) {\n this.keyPair = await crypto.subtle.generateKey(\n this.algorithm,\n true,\n ['encrypt', 'decrypt'],\n );\n\n return this.keyPair;\n }\n\n if (this.algorithm.name === AsymmetricCryptoAlgorithmName.ECDH) {\n this.keyPair = await crypto.subtle.generateKey(\n this.algorithm,\n true,\n ['deriveKey'],\n );\n\n return this.keyPair;\n }\n\n throw new Error('The algorithm is not supported for key generation.');\n }\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum PermissionName {\n EVENT_CREATE = 'event_create',\n EVENT_READ = 'event_read',\n EVENT_DELETE = 'event_delete',\n\n BUCKET_CREATE = 'bucket_create',\n BUCKET_UPDATE = 'bucket_update',\n BUCKET_DELETE = 'bucket_delete',\n\n LOG_CREATE = 'log_create',\n LOG_DELETE = 'log_delete',\n LOG_READ = 'log_read',\n\n PROJECT_CREATE = 'project_create',\n PROJECT_DELETE = 'project_delete',\n PROJECT_UPDATE = 'project_update',\n PROJECT_APPROVE = 'project_approve',\n\n REGISTRY_MANAGE = 'registry_manage',\n REGISTRY_PROJECT_MANAGE = 'registry_project_manage',\n\n NODE_CREATE = 'node_create',\n NODE_DELETE = 'node_delete',\n NODE_UPDATE = 'node_update',\n\n ANALYSIS_APPROVE = 'analysis_approve',\n ANALYSIS_UPDATE = 'analysis_update',\n ANALYSIS_CREATE = 'analysis_create',\n ANALYSIS_EXECUTION_START = 'analysis_execution_start',\n ANALYSIS_EXECUTION_STOP = 'analysis_execution_stop',\n ANALYSIS_DELETE = 'analysis_delete',\n ANALYSIS_RESULT_READ = 'analysis_result_read', // todo: this is maybe not required anymore\n\n ANALYSIS_SELF_MESSAGE_BROKER_USE = 'analysis_self_message_broker_use',\n ANALYSIS_SELF_STORAGE_USE = 'analysis_self_storage_use',\n\n MASTER_IMAGE_MANAGE = 'master_image_manage',\n MASTER_IMAGE_GROUP_MANAGE = 'master_image_group_manage',\n\n SERVICE_MANAGE = 'service_manage',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function isBoolTrue<T = any>(input: T | boolean) : input is true {\n return typeof input === 'boolean' && !!input;\n}\n\nexport function isBoolFalse<T = any>(input: T | boolean) : input is false {\n return typeof input === 'boolean' && !input;\n}\n\nexport function isBool<T = any>(input: T | boolean) : input is boolean {\n return typeof input === 'boolean';\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown> {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function isPropertySet<X extends Record<string, any>, K extends keyof X>(\n obj: X,\n prop: K,\n) : boolean {\n return hasOwnProperty(obj, prop);\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { hasOwnProperty } from './has-own-property';\n\nexport function isError(e: unknown) {\n return typeof e === 'object' && e && hasOwnProperty(e, 'message');\n}\n\nexport function extractErrorMessage(e: Error) {\n return e.message;\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function isHex(value: string) : boolean {\n return /^[A-Fa-f0-9]+$/i.test(value);\n}\n\nexport function hexToUTF8(value: string) {\n try {\n return decodeURIComponent(`%${value.match(/.{1,2}/g).join('%')}`);\n } catch (e) {\n if (e instanceof URIError) {\n return value;\n }\n\n throw e;\n }\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function getHostNameFromString(value: string) : string {\n if (\n value.startsWith('http://') ||\n value.startsWith('https://')\n ) {\n const url = new URL(value);\n value = url.hostname;\n }\n\n return value;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function isObject(item: unknown) : item is Record<string, any> {\n return (\n !!item &&\n typeof item === 'object' &&\n !Array.isArray(item)\n );\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { customAlphabet } from 'nanoid';\n\nexport function createNanoID(alphabet?: string) : string;\nexport function createNanoID(len?: number) : string;\nexport function createNanoID(alphabet?: string, len?: number) : string;\nexport function createNanoID(alphabetOrLen?: string | number, len?: number) : string {\n if (typeof alphabetOrLen === 'string') {\n return customAlphabet(alphabetOrLen, len || 21)();\n }\n\n if (typeof alphabetOrLen === 'number') {\n return customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', alphabetOrLen)();\n }\n\n return customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', len || 21)();\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function nanoSeconds() : bigint {\n return BigInt(\n Math.floor(performance.timeOrigin),\n ) * 1_000_000n + BigInt(\n Math.floor(performance.now() * 1_000_000),\n );\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function nullifyEmptyObjectProperties<T extends Record<string, any>>(data: T) : T {\n const keys : (keyof T)[] = Object.keys(data);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (data[key] === '') {\n data[key] = null as T[keyof T];\n }\n }\n\n return data as T;\n}\n\nexport function deleteUndefinedObjectProperties<T extends Record<string, any>>(data: T) : T {\n const keys : string[] = Object.keys(data);\n\n for (let i = 0; i < keys.length; i++) {\n if (typeof data[keys[i]] === 'undefined') {\n delete data[keys[i]];\n }\n }\n\n return data;\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport type ProxyConnectionConfig = {\n protocol: 'http' | 'https',\n host: string,\n port: number,\n auth: {\n username: string,\n password: string,\n }\n};\n\nexport function parseProxyConnectionString(connectionStr: string) : ProxyConnectionConfig | undefined {\n const match = connectionStr\n .match(/(?:(https|http):\\/\\/)(?:(\\w+)(?::(\\w+))?@)?(?:([^:]+))(?::(\\d{1,5}))?$/);\n\n if (!match) {\n return undefined;\n }\n\n return {\n protocol: match[1] as 'http' | 'https',\n host: match[4],\n port: parseInt(match[5], 10),\n auth: {\n username: match[2],\n password: match[3],\n },\n };\n}\n\nexport function detectProxyConnectionConfig() : ProxyConnectionConfig | undefined {\n const envKeys = [\n 'https_proxy',\n 'HTTPS_PROXY',\n 'http_proxy',\n 'HTTP_PROXY',\n ];\n\n let result : string | undefined;\n\n for (let i = 0; i < envKeys.length; i++) {\n const envKey = envKeys[i];\n const envVal = process.env[envKey];\n\n if (\n envVal !== undefined &&\n envVal !== null\n ) {\n result = result || envVal;\n }\n }\n\n if (!result) {\n return undefined;\n }\n\n return parseProxyConnectionString(result);\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport const alphaNumHyphenUnderscoreRegex = /^[a-z0-9-_]*$/;\nexport const registryRobotSecretRegex = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d).{8,}$/;\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport async function wait(ms: number): Promise<void> {\n return new Promise<void>((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Realm } from '@authup/core-kit';\nimport { REALM_MASTER_NAME } from '@authup/core-kit';\nimport { isPropertySet } from '../../utils';\n\n/**\n * Check if a realm resource is writable.\n *\n * @param realm\n * @param resourceRealmId\n */\nexport function isRealmResourceWritable(realm: Partial<Realm>, resourceRealmId: string | string[]) {\n if (Array.isArray(resourceRealmId)) {\n for (let i = 0; i < resourceRealmId.length; i++) {\n if (isRealmResourceWritable(realm, resourceRealmId[i])) {\n return true;\n }\n }\n return false;\n }\n\n if (!realm) {\n return false;\n }\n\n if (\n isPropertySet(realm, 'name') &&\n realm.name === REALM_MASTER_NAME\n ) {\n return true;\n }\n\n return realm?.id === resourceRealmId;\n}\n/**\n * Check if realm resource is readable.\n *\n * @param realm\n * @param resourceRealmId\n */\n\nexport function isRealmResourceReadable(realm: Partial<Realm>, resourceRealmId: string | string[]) {\n if (Array.isArray(resourceRealmId)) {\n if (resourceRealmId.length === 0) {\n return true;\n }\n for (let i = 0; i < resourceRealmId.length; i++) {\n if (isRealmResourceReadable(realm, resourceRealmId[i])) {\n return true;\n }\n }\n return false;\n }\n\n if (typeof realm === 'undefined') {\n return false;\n }\n\n if (\n isPropertySet(realm, 'name') &&\n realm.name === REALM_MASTER_NAME\n ) {\n return true;\n }\n\n return !resourceRealmId || realm?.id === resourceRealmId;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum DomainEventName {\n CREATED = 'created',\n DELETED = 'deleted',\n UPDATED = 'updated',\n}\n\nexport const DomainEventNamespace = 'resources';\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function buildDomainChannelName(\n domain: string,\n id?: string | number,\n) {\n if (typeof id === 'string' || typeof id === 'number') {\n return `${domain}:${id}`;\n }\n\n return domain;\n}\n\n// todo: rename to buildEntityNamespaceName\nexport function buildDomainNamespaceName(id?: string) {\n return id ?\n `/resources:${id}` :\n '/resources';\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { DomainEventFullName } from './types';\n\nexport function buildDomainEventFullName<\n ENTITY extends string,\n EVENT extends string,\n>(\n type: ENTITY,\n event: EVENT,\n) : DomainEventFullName<ENTITY, EVENT> {\n const eventCapitalized = event.substring(0, 1).toUpperCase() + event.substring(1);\n\n return type + eventCapitalized as DomainEventFullName<ENTITY, EVENT>;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum EnvironmentName {\n TEST = 'test',\n DEVELOPMENT = 'development',\n PRODUCTION = 'production',\n}\n\nexport const MINUTE_IN_MS = 1000 * 60;\nexport const HOUR_IN_MS = MINUTE_IN_MS * 60;\nexport const DAY_IN_MS = HOUR_IN_MS * 24;\nexport const WEEK_IN_MS = DAY_IN_MS * 7;\nexport const MONTH_IN_MS = WEEK_IN_MS * 4;\n"],"names":["AsymmetricCryptoAlgorithmName","asyncGeneratorStep","arrayBufferToBase64","arrayBuffer","btoa","String","fromCharCode","apply","Uint8Array","exportAsymmetricPublicKey","key","exported","crypto","subtle","exportKey","exportAsymmetricPrivateKey","CryptoAsymmetricAlgorithm","generateKeyPair","algorithm","name","RSA_OAEP","keyPair","generateKey","ECDH","Error","publicExponent","PermissionName","isBoolTrue","input","isBoolFalse","isBool","hasOwnProperty","obj","prop","Object","prototype","call","isPropertySet","isError","e","extractErrorMessage","message","isHex","value","test","hexToUTF8","decodeURIComponent","match","join","URIError","getHostNameFromString","startsWith","url","URL","hostname","isObject","item","Array","isArray","createNanoID","alphabetOrLen","len","customAlphabet","nanoSeconds","BigInt","Math","floor","performance","timeOrigin","now","nullifyEmptyObjectProperties","data","keys","i","length","deleteUndefinedObjectProperties","parseProxyConnectionString","connectionStr","undefined","protocol","host","port","parseInt","auth","username","password","detectProxyConnectionConfig","envKeys","result","envKey","envVal","process","env","alphaNumHyphenUnderscoreRegex","registryRobotSecretRegex","wait","ms","Promise","resolve","setTimeout","isRealmResourceWritable","realm","resourceRealmId","REALM_MASTER_NAME","id","isRealmResourceReadable","DomainEventName","DomainEventNamespace","buildDomainChannelName","domain","buildDomainNamespaceName","buildDomainEventFullName","type","event","eventCapitalized","substring","toUpperCase","EnvironmentName","MINUTE_IN_MS","HOUR_IN_MS","DAY_IN_MS","WEEK_IN_MS","MONTH_IN_MS"],"mappings":";;;AAAA;;;;;IAOO,IAAKA,6BAAAA,iBAAAA,SAAAA,6BAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,6BAAAA;AAIX,CAAA,CAAA,EAAA;;ACXD;;;;;AAKC,IAAA,SAAAC,oBAAA,CAAA,GAAA,EAAA,OAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,EAAA,GAAA,EAAA,GAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,SAASC,oBAAoBC,WAAwB,EAAA;IACjD,OAAOC,IAAAA,CAAKC,OAAOC,YAAY,CAACC,KAAK,CAAC,IAAA,EAAM,IAAIC,UAAAA,CAAWL,WAAAA,CAAAA,CAAAA,CAAAA;AAC/D;AAEO,SAAeM,0BAA0BC,GAAc,EAAA;;AAC1D,QAAA,MAAMC,WAAW,MAAMC,MAAAA,CAAOC,MAAM,CAACC,SAAS,CAC1C,MAAA,EACAJ,GAAAA,CAAA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D,QAAA,OAAO,CAAA,EAAGK,MAAAA,CAAO,CAAC,EAAEL,EAAAA,CAAAA,CAAI;AAC5B,IAAA;IAEA,OAAOK,MAAAA;AACX;AAEA;AACO,SAASC,yBAAyBN,EAAW,EAAA;AAChD,IAAA,OAAOA,EAAAA,GACH,CAAC,WAAW,EAAEA,IAAI,GAClB,YAAA;AACR;;ACvBA;;;;;AAKC,IAIM,SAASO,wBAAAA,CAIZC,IAAY,EACZC,KAAY,EAAA;IAEZ,MAAMC,gBAAAA,GAAmBD,KAAAA,CAAME,SAAS,CAAC,CAAA,EAAG,GAAGC,WAAW,EAAA,GAAKH,KAAAA,CAAME,SAAS,CAAC,CAAA,CAAA;AAE/E,IAAA,OAAOH,IAAAA,GAAOE,gBAAAA;AAClB;;ACnBA;;;;;IAOO,IAAKG,eAAAA,iBAAAA,SAAAA,eAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,eAAAA;AAIX,CAAA,CAAA,EAAA;AAEM,MAAMC,YAAAA,GAAe,IAAA,GAAO;AAC5B,MAAMC,UAAAA,GAAaD,YAAAA,GAAe;AAClC,MAAME,SAAAA,GAAYD,UAAAA,GAAa;AAC/B,MAAME,UAAAA,GAAaD,SAAAA,GAAY;AAC/B,MAAME,WAAAA,GAAcD,UAAAA,GAAa;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/crypto/asymmetric/constants.ts","../src/crypto/asymmetric/helpers.ts","../src/crypto/asymmetric/module.ts","../src/domains/permission/constants.ts","../src/utils/boolean.ts","../src/utils/has-own-property.ts","../src/utils/error.ts","../src/utils/file-size.ts","../src/utils/hex-checker.ts","../src/utils/hostname.ts","../src/utils/is-object.ts","../src/utils/nanoid.ts","../src/utils/nanoseconds.ts","../src/utils/object-properties.ts","../src/utils/proxy-connection-string.ts","../src/utils/regex-patterns.ts","../src/utils/wait.ts","../src/domains/realm/helper.ts","../src/domains/constants.ts","../src/domains/helpers.ts","../src/error.ts","../src/domain-event/helpers.ts","../src/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum AsymmetricCryptoAlgorithmName {\n RSA_OAEP = 'RSA-OAEP',\n\n ECDH = 'ECDH',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nfunction arrayBufferToBase64(arrayBuffer: ArrayBuffer): string {\n return btoa(String.fromCharCode.apply(null, new Uint8Array(arrayBuffer)));\n}\n\nexport async function exportAsymmetricPublicKey(key: CryptoKey): Promise<string> {\n const exported = await crypto.subtle.exportKey(\n 'spki',\n key,\n );\n\n return `-----BEGIN PUBLIC KEY-----\\n${arrayBufferToBase64(exported)}\\n-----END PUBLIC KEY-----`;\n}\n\nexport async function exportAsymmetricPrivateKey(key: CryptoKey): Promise<string> {\n const exported = await crypto.subtle.exportKey(\n 'pkcs8',\n key,\n );\n\n return `-----BEGIN PRIVATE KEY-----\\n${arrayBufferToBase64(exported)}\\n-----END PRIVATE KEY-----`;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { AsymmetricCryptoAlgorithmName } from './constants';\nimport type { AsymmetricAlgorithmParams } from './types';\n\nexport class CryptoAsymmetricAlgorithm {\n public readonly algorithm: AsymmetricAlgorithmParams;\n\n protected keyPair : CryptoKeyPair | undefined;\n\n constructor(algorithm: AsymmetricAlgorithmParams) {\n if (algorithm.name === AsymmetricCryptoAlgorithmName.RSA_OAEP) {\n algorithm = {\n ...algorithm,\n publicExponent: new Uint8Array([1, 0, 1]),\n };\n }\n\n this.algorithm = algorithm;\n }\n\n async generateKeyPair() : Promise<CryptoKeyPair> {\n if (this.algorithm.name === AsymmetricCryptoAlgorithmName.RSA_OAEP) {\n this.keyPair = await crypto.subtle.generateKey(\n this.algorithm,\n true,\n ['encrypt', 'decrypt'],\n );\n\n return this.keyPair;\n }\n\n if (this.algorithm.name === AsymmetricCryptoAlgorithmName.ECDH) {\n this.keyPair = await crypto.subtle.generateKey(\n this.algorithm,\n true,\n ['deriveKey'],\n );\n\n return this.keyPair;\n }\n\n throw new Error('The algorithm is not supported for key generation.');\n }\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum PermissionName {\n EVENT_CREATE = 'event_create',\n EVENT_READ = 'event_read',\n EVENT_DELETE = 'event_delete',\n\n BUCKET_CREATE = 'bucket_create',\n BUCKET_UPDATE = 'bucket_update',\n BUCKET_DELETE = 'bucket_delete',\n\n LOG_CREATE = 'log_create',\n LOG_DELETE = 'log_delete',\n LOG_READ = 'log_read',\n\n PROJECT_CREATE = 'project_create',\n PROJECT_DELETE = 'project_delete',\n PROJECT_UPDATE = 'project_update',\n PROJECT_APPROVE = 'project_approve',\n\n REGISTRY_MANAGE = 'registry_manage',\n REGISTRY_PROJECT_MANAGE = 'registry_project_manage',\n\n NODE_CREATE = 'node_create',\n NODE_DELETE = 'node_delete',\n NODE_UPDATE = 'node_update',\n\n ANALYSIS_APPROVE = 'analysis_approve',\n ANALYSIS_UPDATE = 'analysis_update',\n ANALYSIS_CREATE = 'analysis_create',\n ANALYSIS_EXECUTION_START = 'analysis_execution_start',\n ANALYSIS_EXECUTION_STOP = 'analysis_execution_stop',\n ANALYSIS_DELETE = 'analysis_delete',\n ANALYSIS_RESULT_READ = 'analysis_result_read', // todo: this is maybe not required anymore\n\n ANALYSIS_SELF_MESSAGE_BROKER_USE = 'analysis_self_message_broker_use',\n ANALYSIS_SELF_STORAGE_USE = 'analysis_self_storage_use',\n\n MASTER_IMAGE_MANAGE = 'master_image_manage',\n MASTER_IMAGE_GROUP_MANAGE = 'master_image_group_manage',\n\n SERVICE_MANAGE = 'service_manage',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function isBoolTrue<T = any>(input: T | boolean) : input is true {\n return typeof input === 'boolean' && !!input;\n}\n\nexport function isBoolFalse<T = any>(input: T | boolean) : input is false {\n return typeof input === 'boolean' && !input;\n}\n\nexport function isBool<T = any>(input: T | boolean) : input is boolean {\n return typeof input === 'boolean';\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown> {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function isPropertySet<X extends Record<string, any>, K extends keyof X>(\n obj: X,\n prop: K,\n) : boolean {\n return hasOwnProperty(obj, prop);\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { hasOwnProperty } from './has-own-property';\n\nexport function isError(e: unknown) {\n return typeof e === 'object' && e && hasOwnProperty(e, 'message');\n}\n\nexport function extractErrorMessage(e: Error) {\n return e.message;\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function humanFileSize(bytes: number, si : boolean = false, dp : number = 1) {\n const thresh = si ? 1000 : 1024;\n\n if (Math.abs(bytes) < thresh) {\n return `${bytes} B`;\n }\n\n const units = si ?\n ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] :\n ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];\n let u = -1;\n const r = 10 ** dp;\n\n do {\n bytes /= thresh;\n ++u;\n } while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);\n\n return `${bytes.toFixed(dp)} ${units[u]}`;\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function isHex(value: string) : boolean {\n return /^[A-Fa-f0-9]+$/i.test(value);\n}\n\nexport function hexToUTF8(value: string) {\n try {\n return decodeURIComponent(`%${value.match(/.{1,2}/g).join('%')}`);\n } catch (e) {\n if (e instanceof URIError) {\n return value;\n }\n\n throw e;\n }\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function getHostNameFromString(value: string) : string {\n if (\n value.startsWith('http://') ||\n value.startsWith('https://')\n ) {\n const url = new URL(value);\n value = url.hostname;\n }\n\n return value;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function isObject(item: unknown) : item is Record<string, any> {\n return (\n !!item &&\n typeof item === 'object' &&\n !Array.isArray(item)\n );\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { customAlphabet } from 'nanoid';\n\nexport function createNanoID(alphabet?: string) : string;\nexport function createNanoID(len?: number) : string;\nexport function createNanoID(alphabet?: string, len?: number) : string;\nexport function createNanoID(alphabetOrLen?: string | number, len?: number) : string {\n if (typeof alphabetOrLen === 'string') {\n return customAlphabet(alphabetOrLen, len || 21)();\n }\n\n if (typeof alphabetOrLen === 'number') {\n return customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', alphabetOrLen)();\n }\n\n return customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', len || 21)();\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function nanoSeconds() : bigint {\n return BigInt(\n Math.floor(performance.timeOrigin),\n ) * 1_000_000n + BigInt(\n Math.floor(performance.now() * 1_000_000),\n );\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function nullifyEmptyObjectProperties<T extends Record<string, any>>(data: T) : T {\n const keys : (keyof T)[] = Object.keys(data);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (data[key] === '') {\n data[key] = null as T[keyof T];\n }\n }\n\n return data as T;\n}\n\nexport function deleteUndefinedObjectProperties<T extends Record<string, any>>(data: T) : T {\n const keys : string[] = Object.keys(data);\n\n for (let i = 0; i < keys.length; i++) {\n if (typeof data[keys[i]] === 'undefined') {\n delete data[keys[i]];\n }\n }\n\n return data;\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport type ProxyConnectionConfig = {\n protocol: 'http' | 'https',\n host: string,\n port: number,\n auth: {\n username: string,\n password: string,\n }\n};\n\nexport function parseProxyConnectionString(connectionStr: string) : ProxyConnectionConfig | undefined {\n const match = connectionStr\n .match(/(?:(https|http):\\/\\/)(?:(\\w+)(?::(\\w+))?@)?(?:([^:]+))(?::(\\d{1,5}))?$/);\n\n if (!match) {\n return undefined;\n }\n\n return {\n protocol: match[1] as 'http' | 'https',\n host: match[4],\n port: parseInt(match[5], 10),\n auth: {\n username: match[2],\n password: match[3],\n },\n };\n}\n\nexport function detectProxyConnectionConfig() : ProxyConnectionConfig | undefined {\n const envKeys = [\n 'https_proxy',\n 'HTTPS_PROXY',\n 'http_proxy',\n 'HTTP_PROXY',\n ];\n\n let result : string | undefined;\n\n for (let i = 0; i < envKeys.length; i++) {\n const envKey = envKeys[i];\n const envVal = process.env[envKey];\n\n if (\n envVal !== undefined &&\n envVal !== null\n ) {\n result = result || envVal;\n }\n }\n\n if (!result) {\n return undefined;\n }\n\n return parseProxyConnectionString(result);\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport const alphaNumHyphenUnderscoreRegex = /^[a-z0-9-_]*$/;\nexport const registryRobotSecretRegex = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d).{8,}$/;\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport async function wait(ms: number): Promise<void> {\n return new Promise<void>((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Realm } from '@authup/core-kit';\nimport { REALM_MASTER_NAME } from '@authup/core-kit';\nimport { isPropertySet } from '../../utils';\n\n/**\n * Check if a realm resource is writable.\n *\n * @param realm\n * @param resourceRealmId\n */\nexport function isRealmResourceWritable(realm: Partial<Realm>, resourceRealmId: string | string[]) {\n if (Array.isArray(resourceRealmId)) {\n for (let i = 0; i < resourceRealmId.length; i++) {\n if (isRealmResourceWritable(realm, resourceRealmId[i])) {\n return true;\n }\n }\n return false;\n }\n\n if (!realm) {\n return false;\n }\n\n if (\n isPropertySet(realm, 'name') &&\n realm.name === REALM_MASTER_NAME\n ) {\n return true;\n }\n\n return realm?.id === resourceRealmId;\n}\n/**\n * Check if realm resource is readable.\n *\n * @param realm\n * @param resourceRealmId\n */\n\nexport function isRealmResourceReadable(realm: Partial<Realm>, resourceRealmId: string | string[]) {\n if (Array.isArray(resourceRealmId)) {\n if (resourceRealmId.length === 0) {\n return true;\n }\n for (let i = 0; i < resourceRealmId.length; i++) {\n if (isRealmResourceReadable(realm, resourceRealmId[i])) {\n return true;\n }\n }\n return false;\n }\n\n if (typeof realm === 'undefined') {\n return false;\n }\n\n if (\n isPropertySet(realm, 'name') &&\n realm.name === REALM_MASTER_NAME\n ) {\n return true;\n }\n\n return !resourceRealmId || realm?.id === resourceRealmId;\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum DomainEventName {\n CREATED = 'created',\n DELETED = 'deleted',\n UPDATED = 'updated',\n}\n\nexport const DomainEventNamespace = 'resources';\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function buildDomainChannelName(\n domain: string,\n id?: string | number,\n) {\n if (typeof id === 'string' || typeof id === 'number') {\n return `${domain}:${id}`;\n }\n\n return domain;\n}\n\n// todo: rename to buildEntityNamespaceName\nexport function buildDomainNamespaceName(id?: string) {\n return id ?\n `/resources:${id}` :\n '/resources';\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport class HubError extends Error {\n\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { DomainEventFullName } from './types';\n\nexport function buildDomainEventFullName<\n ENTITY extends string,\n EVENT extends string,\n>(\n type: ENTITY,\n event: EVENT,\n) : DomainEventFullName<ENTITY, EVENT> {\n const eventCapitalized = event.substring(0, 1).toUpperCase() + event.substring(1);\n\n return type + eventCapitalized as DomainEventFullName<ENTITY, EVENT>;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum EnvironmentName {\n TEST = 'test',\n DEVELOPMENT = 'development',\n PRODUCTION = 'production',\n}\n\nexport enum ProcessStatus {\n STARTING = 'starting',\n STARTED = 'started',\n STOPPING = 'stopping',\n STOPPED = 'stopped',\n FINISHED = 'finished',\n FAILED = 'failed',\n}\n\nexport const MINUTE_IN_MS = 1000 * 60;\nexport const HOUR_IN_MS = MINUTE_IN_MS * 60;\nexport const DAY_IN_MS = HOUR_IN_MS * 24;\nexport const WEEK_IN_MS = DAY_IN_MS * 7;\nexport const MONTH_IN_MS = WEEK_IN_MS * 4;\n"],"names":["AsymmetricCryptoAlgorithmName","arrayBufferToBase64","arrayBuffer","btoa","String","fromCharCode","apply","Uint8Array","exportAsymmetricPublicKey","key","exported","crypto","subtle","exportKey","exportAsymmetricPrivateKey","CryptoAsymmetricAlgorithm","algorithm","keyPair","name","RSA_OAEP","publicExponent","generateKeyPair","generateKey","ECDH","Error","PermissionName","isBoolTrue","input","isBoolFalse","isBool","hasOwnProperty","obj","prop","Object","prototype","call","isPropertySet","isError","e","extractErrorMessage","message","humanFileSize","bytes","si","dp","thresh","Math","abs","units","u","r","round","length","toFixed","isHex","value","test","hexToUTF8","decodeURIComponent","match","join","URIError","getHostNameFromString","startsWith","url","URL","hostname","isObject","item","Array","isArray","createNanoID","alphabetOrLen","len","customAlphabet","nanoSeconds","BigInt","floor","performance","timeOrigin","now","nullifyEmptyObjectProperties","data","keys","i","deleteUndefinedObjectProperties","parseProxyConnectionString","connectionStr","undefined","protocol","host","port","parseInt","auth","username","password","detectProxyConnectionConfig","envKeys","result","envKey","envVal","process","env","alphaNumHyphenUnderscoreRegex","registryRobotSecretRegex","wait","ms","Promise","resolve","setTimeout","isRealmResourceWritable","realm","resourceRealmId","REALM_MASTER_NAME","id","isRealmResourceReadable","DomainEventName","DomainEventNamespace","buildDomainChannelName","domain","buildDomainNamespaceName","HubError","buildDomainEventFullName","type","event","eventCapitalized","substring","toUpperCase","EnvironmentName","ProcessStatus","MINUTE_IN_MS","HOUR_IN_MS","DAY_IN_MS","WEEK_IN_MS","MONTH_IN_MS"],"mappings":";;;AAAA;;;;;IAOO,IAAKA,6BAAAA,iBAAAA,SAAAA,6BAAAA,EAAAA;;;AAAAA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AAAA,GAAOE,gBAAAA;AAClB;;ACnBA;;;;;IAOO,IAAKG,eAAAA,iBAAAA,SAAAA,eAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,eAAAA;AAIX,CAAA,CAAA,EAAA;AAEM,IAAA,aAAKC,iBAAAA,SAAAA,aAAAA,EAAAA;;;;;;;AAAAA,IAAAA,OAAAA,aAAAA;AAOX,CAAA,CAAA,EAAA;AAEM,MAAMC,YAAAA,GAAe,IAAA,GAAO;AAC5B,MAAMC,UAAAA,GAAaD,YAAAA,GAAe;AAClC,MAAME,SAAAA,GAAYD,UAAAA,GAAa;AAC/B,MAAME,UAAAA,GAAaD,SAAAA,GAAY;AAC/B,MAAME,WAAAA,GAAcD,UAAAA,GAAa;;;;"}
package/dist/types.d.ts CHANGED
@@ -8,4 +8,5 @@ export type ObjectDiff<T extends ObjectLiteral = ObjectLiteral> = {
8
8
  previous?: T[K];
9
9
  };
10
10
  };
11
+ export type ToTuple<T> = T extends [unknown, ...unknown[]] | [] ? T : [T];
11
12
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAChD,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI;KACpE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI;KAC7D,CAAC,IAAI,MAAM,CAAC,GAAG;QACZ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACX,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAClB;CACJ,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAChD,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI;KACpE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI;KAC7D,CAAC,IAAI,MAAM,CAAC,GAAG;QACZ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACX,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAClB;CACJ,CAAC;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function humanFileSize(bytes: number, si?: boolean, dp?: number): string;
2
+ //# sourceMappingURL=file-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-size.d.ts","sourceRoot":"","sources":["../../src/utils/file-size.ts"],"names":[],"mappings":"AAOA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,OAAe,EAAE,EAAE,GAAG,MAAU,UAmBjF"}
@@ -1,5 +1,6 @@
1
1
  export * from './boolean';
2
2
  export * from './error';
3
+ export * from './file-size';
3
4
  export * from './has-own-property';
4
5
  export * from './hex-checker';
5
6
  export * from './hostname';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@privateaim/kit",
3
- "version": "0.8.21",
3
+ "type": "module",
4
+ "version": "0.8.22",
4
5
  "license": "Apache-2.0",
5
6
  "description": "",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
6
9
  "exports": {
7
10
  "./package.json": "./package.json",
8
11
  ".": {
9
12
  "types": "./dist/index.d.ts",
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.cjs"
13
+ "import": "./dist/index.mjs"
12
14
  }
13
15
  },
14
- "main": "./dist/index.cjs",
15
- "module": "./dist/index.mjs",
16
- "types": "./dist/index.d.ts",
17
16
  "author": {
18
17
  "name": "Peter Placzek",
19
18
  "email": "admin@tada5hi.net",
@@ -27,11 +26,11 @@
27
26
  },
28
27
  "devDependencies": {
29
28
  "@authup/kit": "^1.0.0-beta.27",
30
- "@authup/core-kit": "^1.0.0-beta.27"
29
+ "@authup/core-kit": "^1.0.0-beta.28"
31
30
  },
32
31
  "peerDependencies": {
33
- "@authup/kit": "^1.0.0-beta.27",
34
- "@authup/core-kit": "^1.0.0-beta.27"
32
+ "@authup/kit": "^1.0.0-beta.28",
33
+ "@authup/core-kit": "^1.0.0-beta.28"
35
34
  },
36
35
  "dependencies": {
37
36
  "nanoid": "^3.3.8"
package/rollup.config.mjs CHANGED
@@ -10,10 +10,5 @@ import fs from 'node:fs';
10
10
  import { createConfig } from '../../rollup.config.mjs';
11
11
 
12
12
  export default createConfig({
13
- pkg: JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), {encoding: 'utf-8'})),
14
- swc: {
15
- jsc: {
16
- target: 'es2016'
17
- }
18
- }
13
+ pkg: JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), { encoding: 'utf-8' })),
19
14
  });