podverse-helpers 5.1.12-alpha.0 → 5.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/backend/os.d.ts +6 -0
- package/dist/lib/backend/os.d.ts.map +1 -0
- package/dist/lib/backend/os.js +30 -0
- package/dist/lib/guid.d.ts +1 -0
- package/dist/lib/guid.d.ts.map +1 -1
- package/dist/lib/guid.js +4 -0
- package/dist/lib/mq/mqConstants.d.ts +3 -0
- package/dist/lib/mq/mqConstants.d.ts.map +1 -1
- package/dist/lib/remoteItem.d.ts +2 -0
- package/dist/lib/remoteItem.d.ts.map +1 -1
- package/dist/lib/remoteItem.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os.d.ts","sourceRoot":"","sources":["../../../src/lib/backend/os.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAe3C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getContainerIpPart = getContainerIpPart;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
/**
|
|
10
|
+
* Return the container IP portion for use in IDs.
|
|
11
|
+
* Produces a string like "_192-168-0-5" or an empty string when none found.
|
|
12
|
+
*/
|
|
13
|
+
function getContainerIpPart() {
|
|
14
|
+
const nets = os_1.default.networkInterfaces();
|
|
15
|
+
for (const name of Object.keys(nets)) {
|
|
16
|
+
const addrs = nets[name];
|
|
17
|
+
if (!addrs)
|
|
18
|
+
continue;
|
|
19
|
+
for (const addr of addrs) {
|
|
20
|
+
if (!addr)
|
|
21
|
+
continue;
|
|
22
|
+
const family = addr.family;
|
|
23
|
+
const isIpv4 = (typeof family === 'string' && family.toLowerCase() === 'ipv4') || family === 4;
|
|
24
|
+
if (isIpv4 && !addr.internal && addr.address) {
|
|
25
|
+
return `_${addr.address.replace(/\./g, '-')}`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return '';
|
|
30
|
+
}
|
package/dist/lib/guid.d.ts
CHANGED
package/dist/lib/guid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guid.d.ts","sourceRoot":"","sources":["../../src/lib/guid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guid.d.ts","sourceRoot":"","sources":["../../src/lib/guid.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAElD"}
|
package/dist/lib/guid.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateGuidV4 = generateGuidV4;
|
|
4
|
+
exports.validateUUIDV5 = validateUUIDV5;
|
|
4
5
|
const uuid_1 = require("uuid");
|
|
5
6
|
function generateGuidV4() {
|
|
6
7
|
return (0, uuid_1.v4)();
|
|
7
8
|
}
|
|
9
|
+
function validateUUIDV5(id) {
|
|
10
|
+
return typeof id === 'string' && (0, uuid_1.validate)(id) && (0, uuid_1.version)(id) === 5;
|
|
11
|
+
}
|
|
@@ -6,6 +6,9 @@ export type MQQueueConfig = {
|
|
|
6
6
|
dedupeCacheTimeMS: number | null;
|
|
7
7
|
priority: 'normal' | 'slow';
|
|
8
8
|
};
|
|
9
|
+
export type MQQueueConfigFunctionParams = MQQueueConfig & {
|
|
10
|
+
closeAfterSend: boolean;
|
|
11
|
+
};
|
|
9
12
|
export declare const MQ_QUEUES: Record<MQQueueNameParamKey, MQQueueConfig>;
|
|
10
13
|
export {};
|
|
11
14
|
//# sourceMappingURL=mqConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mqConstants.d.ts","sourceRoot":"","sources":["../../../src/lib/mq/mqConstants.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,UAAU,CAAC;AAE3F,eAAO,MAAM,0BAA0B,EAAE,mBAAmB,EACD,CAAC;AAE5D,KAAK,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,WAAW,CAAC;IACvB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC7B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,mBAAmB,EAAE,aAAa,CAqBhE,CAAC"}
|
|
1
|
+
{"version":3,"file":"mqConstants.d.ts","sourceRoot":"","sources":["../../../src/lib/mq/mqConstants.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,UAAU,CAAC;AAE3F,eAAO,MAAM,0BAA0B,EAAE,mBAAmB,EACD,CAAC;AAE5D,KAAK,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,WAAW,CAAC;IACvB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC7B,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG;IACxD,cAAc,EAAE,OAAO,CAAC;CACzB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,mBAAmB,EAAE,aAAa,CAqBhE,CAAC"}
|
package/dist/lib/remoteItem.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ export type RemoteItemDto = {
|
|
|
3
3
|
feed_url: string | null;
|
|
4
4
|
item_guid: string | null;
|
|
5
5
|
};
|
|
6
|
+
export declare function hasValidFeedUuid(remoteItem: RemoteItemDto): boolean;
|
|
7
|
+
export declare function filterInvalidFeedUuids(remoteItems: RemoteItemDto[]): RemoteItemDto[];
|
|
6
8
|
//# sourceMappingURL=remoteItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteItem.d.ts","sourceRoot":"","sources":["../../src/lib/remoteItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remoteItem.d.ts","sourceRoot":"","sources":["../../src/lib/remoteItem.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAEzB,CAAA;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAEnE;AAED,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,CAEpF"}
|
package/dist/lib/remoteItem.js
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasValidFeedUuid = hasValidFeedUuid;
|
|
4
|
+
exports.filterInvalidFeedUuids = filterInvalidFeedUuids;
|
|
5
|
+
const guid_1 = require("./guid");
|
|
6
|
+
function hasValidFeedUuid(remoteItem) {
|
|
7
|
+
return typeof (remoteItem === null || remoteItem === void 0 ? void 0 : remoteItem.feed_guid) === 'string' && (0, guid_1.validateUUIDV5)(remoteItem.feed_guid);
|
|
8
|
+
}
|
|
9
|
+
function filterInvalidFeedUuids(remoteItems) {
|
|
10
|
+
return remoteItems.filter(hasValidFeedUuid);
|
|
11
|
+
}
|