hcloud-sdk 20.1.0 → 20.4.0

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,5 @@
1
- ## [20.1.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v20.0.1...v20.1.0) (2026-05-18)
1
+ ## [20.4.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v20.3.0...v20.4.0) (2026-06-11)
2
2
 
3
3
  ### Features
4
4
 
5
- * bump version ([6f33221](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/6f33221ecc027e08ba1b1df397605025a2f6b341))
5
+ * add panel service ([d92886d](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/d92886d338d3992fe08b815e6193ab56152afb3f))
package/lib/Base.d.ts CHANGED
@@ -16,6 +16,9 @@ export interface Options {
16
16
  agent?: {
17
17
  server: string;
18
18
  };
19
+ panel?: {
20
+ server: string;
21
+ };
19
22
  logger?: HcloudLogger;
20
23
  }
21
24
  export default abstract class Base {
package/lib/Hcloud.d.ts CHANGED
@@ -11,6 +11,7 @@ import IdpService from "./service/idp";
11
11
  import MailerService from "./service/mailer";
12
12
  import MothershipService from "./service/mothership";
13
13
  import NatsService from "./service/nats";
14
+ import PanelService from "./service/panel";
14
15
  import ShortsService from "./service/shorts";
15
16
  export declare class HCloud {
16
17
  get Agent(): AgentService;
@@ -29,6 +30,8 @@ export declare class HCloud {
29
30
  private _Dali?;
30
31
  get Mailer(): MailerService;
31
32
  private _Mailer?;
33
+ get Panels(): PanelService;
34
+ private _Panels?;
32
35
  get Mothership(): MothershipService;
33
36
  private _Mothership?;
34
37
  get Shorts(): ShortsService;
package/lib/Hcloud.js CHANGED
@@ -28,6 +28,7 @@ const idp_2 = __importDefault(require("./service/idp"));
28
28
  const mailer_1 = __importDefault(require("./service/mailer"));
29
29
  const mothership_1 = __importDefault(require("./service/mothership"));
30
30
  const nats_1 = __importDefault(require("./service/nats"));
31
+ const panel_1 = __importDefault(require("./service/panel"));
31
32
  const shorts_1 = __importDefault(require("./service/shorts"));
32
33
  // tslint:disable-next-line
33
34
  class HCloud {
@@ -79,6 +80,12 @@ class HCloud {
79
80
  }
80
81
  return this._Mailer;
81
82
  }
83
+ get Panels() {
84
+ if (this._Panels === undefined) {
85
+ this._Panels = new panel_1.default(this.options, this.axios);
86
+ }
87
+ return this._Panels;
88
+ }
82
89
  get Mothership() {
83
90
  if (this._Mothership === undefined) {
84
91
  this._Mothership = new mothership_1.default(this.options, this.axios);
@@ -1,4 +1,5 @@
1
1
  import { ReducedTeam, ReducedUser } from "../../idp";
2
+ type Primitive = string | number | boolean;
2
3
  export interface CreateComment {
3
4
  refId: string;
4
5
  text: string;
@@ -6,6 +7,7 @@ export interface CreateComment {
6
7
  annotation?: string;
7
8
  mentions?: string[];
8
9
  mentionsTeams?: string[];
10
+ metadata?: Record<string, Primitive | Primitive[]>;
9
11
  }
10
12
  export interface EditComment {
11
13
  text: string;
@@ -14,6 +16,7 @@ export interface EditComment {
14
16
  mentions?: string[];
15
17
  mentionsTeams?: string[];
16
18
  completed?: boolean;
19
+ metadata?: Record<string, Primitive | Primitive[]>;
17
20
  }
18
21
  export declare enum CommentType {
19
22
  COMMENT = "COMMENT",
@@ -44,6 +47,7 @@ export interface Comment {
44
47
  completed: boolean;
45
48
  completedBy?: ReducedUser;
46
49
  completedAt?: number;
50
+ metadata?: Record<string, Primitive | Primitive[]>;
47
51
  }
48
52
  export interface Reply extends Omit<Comment, "timestamp" | "replies"> {
49
53
  commentRef: string;
@@ -53,3 +57,4 @@ export interface Timestamp {
53
57
  out: number;
54
58
  color: string;
55
59
  }
60
+ export {};
@@ -0,0 +1,13 @@
1
+ export interface PanelVersions {
2
+ latestDev: string;
3
+ latest: string;
4
+ versions: Record<string, PanelVersion[]>;
5
+ }
6
+ export interface PanelVersion {
7
+ path: string;
8
+ published_date: number;
9
+ version: string;
10
+ arch: string;
11
+ os: string;
12
+ dev: boolean;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { AxiosInstance } from "axios";
2
+ import Base, { MaybeRaw, Options } from "../../Base";
3
+ import { PanelVersions } from "../../interfaces/panel";
4
+ export default class PanelService extends Base {
5
+ private sourceServer;
6
+ constructor(options: Options, axios: AxiosInstance);
7
+ getVersions<R extends boolean = false>(raw?: {
8
+ raw: R;
9
+ }): Promise<MaybeRaw<R, PanelVersions>>;
10
+ protected getEndpoint(endpoint: string): string;
11
+ }
@@ -0,0 +1,33 @@
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 };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const Base_1 = __importDefault(require("../../Base"));
16
+ const axios_1 = require("../../interfaces/axios");
17
+ class PanelService extends Base_1.default {
18
+ constructor(options, axios) {
19
+ var _a;
20
+ super(options, axios);
21
+ this.sourceServer = ((_a = options.panel) === null || _a === void 0 ? void 0 : _a.server) || "https://cosmo-panel.s3.helmut.cloud";
22
+ }
23
+ getVersions(raw) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ const resp = yield this.axios.get(this.getEndpoint("/index.json"), { headers: axios_1.disableCacheHeaders });
26
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
27
+ });
28
+ }
29
+ getEndpoint(endpoint) {
30
+ return this.sourceServer + endpoint;
31
+ }
32
+ }
33
+ exports.default = PanelService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hcloud-sdk",
3
- "version": "20.1.0",
3
+ "version": "20.4.0",
4
4
  "description": "hcloud platform sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",