@hahnpro/hpc-api 2025.2.6 → 2025.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahnpro/hpc-api",
3
- "version": "2025.2.6",
3
+ "version": "2025.2.7",
4
4
  "description": "Module for easy access to the HahnPRO Cloud API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,4 +1,4 @@
1
- import { Readable } from 'stream';
1
+ import type { Readable } from 'stream';
2
2
  import FormData from 'form-data';
3
3
  import { APIBase } from './api-base';
4
4
  import { Content, ReturnType } from './content.interface';
@@ -1,4 +1,4 @@
1
- import { Readable } from 'stream';
1
+ import type { Readable } from 'stream';
2
2
  import FormData from 'form-data';
3
3
  import { Content, ReturnType } from '../content.interface';
4
4
  import { ContentService } from '../content.service';
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ContentMockService = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const stream_1 = require("stream");
6
5
  const ts_mixer_1 = require("ts-mixer");
7
6
  const content_interface_1 = require("../content.interface");
8
7
  const api_base_mock_1 = require("./api-base.mock");
@@ -62,7 +61,12 @@ class ContentMockService extends BaseService {
62
61
  case content_interface_1.ReturnType.ARRAYBUFFER:
63
62
  return Promise.resolve(Buffer.from(this.contentData.get(id)).buffer);
64
63
  case content_interface_1.ReturnType.NODESTREAM:
65
- return Promise.resolve(stream_1.Readable.from(this.contentData.get(id)));
64
+ if (typeof process !== 'undefined' && process.versions && process.versions.node) {
65
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
66
+ const { Readable } = require('stream');
67
+ return Promise.resolve(Readable.from(this.contentData.get(id)));
68
+ }
69
+ throw new Error('Readable streams are only available in Node.js environment');
66
70
  }
67
71
  }
68
72
  deleteOne(contentId, force = false) {
@@ -1,5 +1,5 @@
1
- import { HttpClient } from '@shr/api';
2
1
  import { DataService } from './data.service';
2
+ import { HttpClient } from './http.service';
3
3
  import { NotificationRule } from './notification-rule.interface';
4
4
  export declare class NotificationRuleService extends DataService<NotificationRule> {
5
5
  constructor(httpClient: HttpClient);