podverse-helpers 5.1.12-alpha.0 → 5.1.12-alpha.1

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Return the container IP portion for use in IDs.
3
+ * Produces a string like "_192-168-0-5" or an empty string when none found.
4
+ */
5
+ export declare function getContainerIpPart(): string;
6
+ //# sourceMappingURL=os.d.ts.map
@@ -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
+ }
@@ -1,2 +1,3 @@
1
1
  export declare function generateGuidV4(): string;
2
+ export declare function validateUUIDV5(id: string): boolean;
2
3
  //# sourceMappingURL=guid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guid.d.ts","sourceRoot":"","sources":["../../src/lib/guid.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
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"}
@@ -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":"AAAA,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"}
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"}
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-helpers",
3
- "version": "5.1.12-alpha.0",
3
+ "version": "5.1.12-alpha.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",