hcloud-sdk 19.3.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
- ## [19.3.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v19.2.1...v19.3.0) (2026-05-12)
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
- * new public version ([d33d2c1](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/d33d2c1f48e1e0aa3e1559d730dea1802e112fd9))
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);
@@ -16,6 +16,8 @@ export interface BaseAsset {
16
16
  space: ReducedSpace;
17
17
  permissions?: string[];
18
18
  breadcrumb?: (Asset | CosmoSpace)[];
19
+ purgeAt?: number;
20
+ deletedAt?: number;
19
21
  }
20
22
  export type Asset = BaseAsset & ({
21
23
  type: ItemType.MEDIA_ASSET;
@@ -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,7 +7,7 @@ export interface CreateComment {
6
7
  annotation?: string;
7
8
  mentions?: string[];
8
9
  mentionsTeams?: string[];
9
- visibility?: CommentVisibility;
10
+ metadata?: Record<string, Primitive | Primitive[]>;
10
11
  }
11
12
  export interface EditComment {
12
13
  text: string;
@@ -15,7 +16,7 @@ export interface EditComment {
15
16
  mentions?: string[];
16
17
  mentionsTeams?: string[];
17
18
  completed?: boolean;
18
- visibility?: CommentVisibility;
19
+ metadata?: Record<string, Primitive | Primitive[]>;
19
20
  }
20
21
  export declare enum CommentType {
21
22
  COMMENT = "COMMENT",
@@ -31,10 +32,6 @@ export declare enum CommentSortDirection {
31
32
  ASC = "ASC",
32
33
  DESC = "DESC"
33
34
  }
34
- export declare enum CommentVisibility {
35
- INTERNAL = "internal",
36
- EXTERNAL = "external"
37
- }
38
35
  export interface Comment {
39
36
  _id: string;
40
37
  text: string;
@@ -50,7 +47,7 @@ export interface Comment {
50
47
  completed: boolean;
51
48
  completedBy?: ReducedUser;
52
49
  completedAt?: number;
53
- visibility?: CommentVisibility;
50
+ metadata?: Record<string, Primitive | Primitive[]>;
54
51
  }
55
52
  export interface Reply extends Omit<Comment, "timestamp" | "replies"> {
56
53
  commentRef: string;
@@ -60,3 +57,4 @@ export interface Timestamp {
60
57
  out: number;
61
58
  color: string;
62
59
  }
60
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommentVisibility = exports.CommentSortDirection = exports.CommentSortField = exports.CommentType = void 0;
3
+ exports.CommentSortDirection = exports.CommentSortField = exports.CommentType = void 0;
4
4
  var CommentType;
5
5
  (function (CommentType) {
6
6
  CommentType["COMMENT"] = "COMMENT";
@@ -18,8 +18,3 @@ var CommentSortDirection;
18
18
  CommentSortDirection["ASC"] = "ASC";
19
19
  CommentSortDirection["DESC"] = "DESC";
20
20
  })(CommentSortDirection || (exports.CommentSortDirection = CommentSortDirection = {}));
21
- var CommentVisibility;
22
- (function (CommentVisibility) {
23
- CommentVisibility["INTERNAL"] = "internal";
24
- CommentVisibility["EXTERNAL"] = "external";
25
- })(CommentVisibility || (exports.CommentVisibility = CommentVisibility = {}));
@@ -13,6 +13,7 @@ export interface PublicLink {
13
13
  * Represents a share entity containing shared items and permissions.
14
14
  * @property _id - Unique identifier for the share.
15
15
  * @property name - Name of the share.
16
+ * @property active - Whether the share is currently active.
16
17
  * @property creator - The user who created the share.
17
18
  * @property createDate - Timestamp of when the share was created (in milliseconds since epoch).
18
19
  * @property items - Array of item IDs included in the share.
@@ -27,6 +28,7 @@ export interface PublicLink {
27
28
  export interface Share {
28
29
  _id: string;
29
30
  name: string;
31
+ active: boolean;
30
32
  creator: ReducedUser;
31
33
  createDate: number;
32
34
  items?: ({
@@ -91,7 +93,7 @@ export type ShareWithUsers = Share & {
91
93
  * @property public - (Optional) Whether the share is public.
92
94
  * @property visitsLimit - (Optional) New maximum number of allowed visits (only applicable for public shares).
93
95
  */
94
- export type SharePatch = Partial<Pick<ShareCreate, "name" | "users"> & {
96
+ export type SharePatch = Partial<Pick<ShareCreate, "name" | "users" | "active"> & {
95
97
  items: string[];
96
98
  permissions?: string[];
97
99
  assetPermissionGroups?: ShareAssetPermissionGroup[];
@@ -31,3 +31,21 @@ export declare enum GrantType {
31
31
  AUTHORIZATION_CODE = "authorization_code",
32
32
  REFRESH_TOKEN = "refresh_token"
33
33
  }
34
+ export interface OAuthMetadata {
35
+ issuer: string;
36
+ authorization_endpoint: string;
37
+ token_endpoint: string;
38
+ device_authorization_endpoint: string;
39
+ device_token_endpoint: string;
40
+ jwks_uri?: string;
41
+ userinfo_endpoint?: string;
42
+ http_logout_supported: boolean;
43
+ end_session_endpoint?: string;
44
+ scopes_supported: Scope[];
45
+ response_types_supported: string[];
46
+ grant_types_supported: string[];
47
+ token_endpoint_auth_methods_supported: string[];
48
+ token_endpoint_auth_signing_alg_values_supported: string[];
49
+ service_documentation: string[];
50
+ ui_locales_supported: string[];
51
+ }
@@ -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 });
@@ -122,7 +122,7 @@ export declare class CosmoSpace extends Base {
122
122
  * Updates the trashbin auto-delete policy for the specified Cosmo space.
123
123
  * @param orgName Name of the organization
124
124
  * @param spaceName Name of the space
125
- * @param policy Trash policy to apply. When `enabled` is `true`, `ttlDays` (1–365) must be provided. When `enabled` is `false`, `ttlDays` must be omitted.
125
+ * @param policy Trash policy to apply. If enabled, items in the trash will be automatically deleted after the specified TTL (in days).
126
126
  * @returns The updated Space
127
127
  */
128
128
  updateTrashbinPolicy<R extends boolean = false>(orgName: string, spaceName: string, policy: TrashPolicy, raw?: {
@@ -177,7 +177,7 @@ class CosmoSpace extends Base_1.default {
177
177
  * Updates the trashbin auto-delete policy for the specified Cosmo space.
178
178
  * @param orgName Name of the organization
179
179
  * @param spaceName Name of the space
180
- * @param policy Trash policy to apply. When `enabled` is `true`, `ttlDays` (1–365) must be provided. When `enabled` is `false`, `ttlDays` must be omitted.
180
+ * @param policy Trash policy to apply. If enabled, items in the trash will be automatically deleted after the specified TTL (in days).
181
181
  * @returns The updated Space
182
182
  */
183
183
  updateTrashbinPolicy(orgName, spaceName, policy, raw) {
@@ -1,5 +1,5 @@
1
1
  import Base, { MaybeRaw } from "../../../Base";
2
- import { OAuthToken, OAuthTokenRequest } from "../../../interfaces/idp/oauth";
2
+ import { OAuthMetadata, OAuthToken, OAuthTokenRequest } from "../../../interfaces/idp/oauth";
3
3
  import { OAuthAppPublicInfo } from "../../../interfaces/idp/organization/settings/oauthApp";
4
4
  import IdpOAuthDevice from "./device";
5
5
  export declare class IdpOAuth extends Base {
@@ -58,5 +58,13 @@ export declare class IdpOAuth extends Base {
58
58
  getOAuthAppInfo<R extends boolean = false>(clientId: string, raw?: {
59
59
  raw: R;
60
60
  }): Promise<MaybeRaw<R, OAuthAppPublicInfo>>;
61
+ /**
62
+ * Retrieves the OAuth 2.0 authorization server metadata
63
+ * This method enables dynamic discovery of endpoint locations and server capabilities as defined in RFC 8414
64
+ * @returns Authorization server metadata
65
+ */
66
+ getMetadata<R extends boolean = false>(raw?: {
67
+ raw: R;
68
+ }): Promise<MaybeRaw<R, OAuthMetadata>>;
61
69
  protected getEndpoint(endpoint: string): string;
62
70
  }
@@ -119,6 +119,17 @@ class IdpOAuth extends Base_1.default {
119
119
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? response : response.data);
120
120
  });
121
121
  }
122
+ /**
123
+ * Retrieves the OAuth 2.0 authorization server metadata
124
+ * This method enables dynamic discovery of endpoint locations and server capabilities as defined in RFC 8414
125
+ * @returns Authorization server metadata
126
+ */
127
+ getMetadata(raw) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ const response = yield this.axios.get(this.getEndpoint("/v1/.well-known/oauth-authorization-server"));
130
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? response : response.data);
131
+ });
132
+ }
122
133
  getEndpoint(endpoint) {
123
134
  return `${this.options.server}/api/account${endpoint}`;
124
135
  }
@@ -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": "19.3.0",
3
+ "version": "20.4.0",
4
4
  "description": "hcloud platform sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",