hcloud-sdk 19.2.0 → 20.1.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.2.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v19.1.0...v19.2.0) (2026-05-07)
1
+ ## [20.1.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v20.0.1...v20.1.0) (2026-05-18)
2
2
 
3
3
  ### Features
4
4
 
5
- * implements visibility field in comment to toggle internal and external visibility ([2d3e1f7](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/2d3e1f74b61412f141bfdc497a2160eb1178dbde))
5
+ * bump version ([6f33221](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/6f33221ecc027e08ba1b1df397605025a2f6b341))
@@ -20,6 +20,7 @@ declare enum Entity {
20
20
  WAVE_ENGINE_RELEASE = "WAVE_ENGINE_RELEASE",
21
21
  CHALLENGE_STRING = "CHALLENGE_STRING",
22
22
  DATABASE_NAME = "DATABASE_NAME",
23
+ DATABASE_API_KEY = "DATABASE_API_KEY",
23
24
  DOCUMENT_KEY = "DOCUMENT_KEY",
24
25
  DOMAIN_NAME = "DOMAIN_NAME",
25
26
  USER_ID = "USER_ID",
@@ -70,7 +71,7 @@ declare class EntityDetails {
70
71
  * @param value - Incoming string to sanitize
71
72
  * @returns Sanitized string
72
73
  */
73
- sanitize(value: string): string;
74
+ sanitize(value: string, delimiter?: string): string;
74
75
  }
75
76
  declare function ValidationHelper(name: Entity): EntityDetails;
76
77
  export { Entity, EntityDetails, ValidationHelper };
@@ -25,6 +25,7 @@ var Entity;
25
25
  Entity["WAVE_ENGINE_RELEASE"] = "WAVE_ENGINE_RELEASE";
26
26
  Entity["CHALLENGE_STRING"] = "CHALLENGE_STRING";
27
27
  Entity["DATABASE_NAME"] = "DATABASE_NAME";
28
+ Entity["DATABASE_API_KEY"] = "DATABASE_API_KEY";
28
29
  Entity["DOCUMENT_KEY"] = "DOCUMENT_KEY";
29
30
  Entity["DOMAIN_NAME"] = "DOMAIN_NAME";
30
31
  Entity["USER_ID"] = "USER_ID";
@@ -87,7 +88,7 @@ class EntityDetails {
87
88
  * @param value - Incoming string to sanitize
88
89
  * @returns Sanitized string
89
90
  */
90
- sanitize(value) {
91
+ sanitize(value, delimiter) {
91
92
  if (typeof value !== "string")
92
93
  return "";
93
94
  if (!this.validate(value)) {
@@ -99,8 +100,8 @@ class EntityDetails {
99
100
  .split("")
100
101
  .filter(char => this.entity.symbols.test(char))
101
102
  .join("")
102
- .replace(/^[\s-.]+|[\s-.]+$/g, "")
103
- .replace(/-{2,}/g, "-");
103
+ .replace(/^[\s-.]+|[\s-.]+$/g, delimiter !== null && delimiter !== void 0 ? delimiter : "")
104
+ .replace(/-_.{2,}/g, "-");
104
105
  if (value.length < this.entity.minLength)
105
106
  value = value.concat("x".repeat(this.entity.minLength - value.length));
106
107
  return value.slice(0, this.entity.maxLength);
@@ -223,6 +224,11 @@ const entityCollection = {
223
224
  minLength: 1,
224
225
  maxLength: 128,
225
226
  },
227
+ [Entity.DATABASE_API_KEY]: {
228
+ pattern: /^[\w-]{3,64}$/i,
229
+ minLength: 3,
230
+ maxLength: 64,
231
+ },
226
232
  [Entity.DOCUMENT_KEY]: {
227
233
  pattern: /^[\w-.]{1,64}$/i,
228
234
  minLength: 1,
@@ -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;
@@ -6,7 +6,6 @@ export interface CreateComment {
6
6
  annotation?: string;
7
7
  mentions?: string[];
8
8
  mentionsTeams?: string[];
9
- visibility?: CommentVisibility;
10
9
  }
11
10
  export interface EditComment {
12
11
  text: string;
@@ -15,7 +14,6 @@ export interface EditComment {
15
14
  mentions?: string[];
16
15
  mentionsTeams?: string[];
17
16
  completed?: boolean;
18
- visibility?: CommentVisibility;
19
17
  }
20
18
  export declare enum CommentType {
21
19
  COMMENT = "COMMENT",
@@ -31,10 +29,6 @@ export declare enum CommentSortDirection {
31
29
  ASC = "ASC",
32
30
  DESC = "DESC"
33
31
  }
34
- export declare enum CommentVisibility {
35
- INTERNAL = "internal",
36
- EXTERNAL = "external"
37
- }
38
32
  export interface Comment {
39
33
  _id: string;
40
34
  text: string;
@@ -50,7 +44,6 @@ export interface Comment {
50
44
  completed: boolean;
51
45
  completedBy?: ReducedUser;
52
46
  completedAt?: number;
53
- visibility?: CommentVisibility;
54
47
  }
55
48
  export interface Reply extends Omit<Comment, "timestamp" | "replies"> {
56
49
  commentRef: string;
@@ -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?: ({
@@ -59,10 +61,11 @@ export interface Share {
59
61
  * @property public - (Optional) Whether the share is public.
60
62
  * @property visitsLimit - (Optional) Maximum number of allowed visits for the share (only applicable for public shares).
61
63
  */
62
- export interface ShareCreate extends Omit<Share, "_id" | "createDate" | "creator" | "permissionGroups" | "users"> {
64
+ export interface ShareCreate extends Omit<Share, "_id" | "createDate" | "creator" | "permissionGroups" | "users" | "items" | "waiting"> {
63
65
  password?: string;
64
66
  expires?: number;
65
67
  namespaces?: Record<string, string[]>;
68
+ items: string[];
66
69
  assetPermissionGroups?: ShareAssetPermissionGroup[];
67
70
  /**
68
71
  * Array of emails
@@ -90,7 +93,7 @@ export type ShareWithUsers = Share & {
90
93
  * @property public - (Optional) Whether the share is public.
91
94
  * @property visitsLimit - (Optional) New maximum number of allowed visits (only applicable for public shares).
92
95
  */
93
- export type SharePatch = Partial<Pick<ShareCreate, "name" | "expires" | "password" | "users"> & {
96
+ export type SharePatch = Partial<Pick<ShareCreate, "name" | "users" | "active"> & {
94
97
  items: string[];
95
98
  permissions?: string[];
96
99
  assetPermissionGroups?: ShareAssetPermissionGroup[];
@@ -99,6 +102,8 @@ export type SharePatch = Partial<Pick<ShareCreate, "name" | "expires" | "passwor
99
102
  public?: boolean;
100
103
  visitsLimit?: number;
101
104
  users?: string[];
105
+ expires?: number | null;
106
+ password?: string | null;
102
107
  }>;
103
108
  export declare enum ShareAssetPermissionGroup {
104
109
  VIEW_ASSETS_ONLY = "VIEW_ASSETS_ONLY",
@@ -7,6 +7,7 @@ export * from "./space/event/stream/node";
7
7
  export * from "./space/webhook";
8
8
  export * from "./space/secret";
9
9
  export * from "./space/pool";
10
+ export * from "./space/request";
10
11
  export * from "./space/database";
11
12
  export * from "./space/database/document";
12
13
  export * from "./execution";
@@ -23,6 +23,7 @@ __exportStar(require("./space/event/stream/node"), exports);
23
23
  __exportStar(require("./space/webhook"), exports);
24
24
  __exportStar(require("./space/secret"), exports);
25
25
  __exportStar(require("./space/pool"), exports);
26
+ __exportStar(require("./space/request"), exports);
26
27
  __exportStar(require("./space/database"), exports);
27
28
  __exportStar(require("./space/database/document"), exports);
28
29
  __exportStar(require("./execution"), exports);
@@ -1,7 +1,7 @@
1
1
  import { ReducedSpace } from "../../../global";
2
2
  import { ReducedOrganization } from "../../../idp/organization";
3
3
  import { ReducedUser } from "../../../idp/user";
4
- interface Database {
4
+ export interface Database {
5
5
  _id: string;
6
6
  name: string;
7
7
  space: ReducedSpace;
@@ -9,4 +9,19 @@ interface Database {
9
9
  creator: ReducedUser;
10
10
  createDate: number;
11
11
  }
12
- export { Database };
12
+ export declare enum ApiKeyPermission {
13
+ READ = "read",
14
+ WRITE = "write"
15
+ }
16
+ export interface ApiKey {
17
+ _id: string;
18
+ name: string;
19
+ hash: string;
20
+ permission: ApiKeyPermission;
21
+ databaseId: string;
22
+ spaceId: string;
23
+ organizationId: string;
24
+ userId: string;
25
+ createDate: number;
26
+ lastUsed: number;
27
+ }
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiKeyPermission = void 0;
4
+ var ApiKeyPermission;
5
+ (function (ApiKeyPermission) {
6
+ ApiKeyPermission["READ"] = "read";
7
+ ApiKeyPermission["WRITE"] = "write";
8
+ })(ApiKeyPermission || (exports.ApiKeyPermission = ApiKeyPermission = {}));
@@ -0,0 +1,10 @@
1
+ import { IncomingHttpHeaders } from "http";
2
+ import { HttpMethod } from "../../global";
3
+ export interface CapturedRequest {
4
+ method: HttpMethod;
5
+ headers: IncomingHttpHeaders;
6
+ body: any;
7
+ spaceId: string;
8
+ organizationId: string;
9
+ creatorId: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -77,7 +77,7 @@ export interface StreamNodeSpecificationWrappedWithEngineVersion {
77
77
  export interface StreamNodeSpecification {
78
78
  specVersion: number;
79
79
  }
80
- export type StreamNodeSpecifications = StreamNodeSpecificationV1 | StreamNodeSpecificationV2 | StreamNodeSpecificationV3;
80
+ export type StreamNodeSpecifications = StreamNodeSpecificationV1 | StreamNodeSpecificationV2 | StreamNodeSpecificationV3 | StreamNodeSpecificationV4;
81
81
  export interface StreamNodeSpecificationV1 extends StreamNodeSpecification {
82
82
  specVersion: 1;
83
83
  name: string;
@@ -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
+ }
@@ -2,6 +2,7 @@ import { Msg } from "nats";
2
2
  import { Asset, UploadStatus } from "../cosmo/asset";
3
3
  import { Products, Space } from "../global";
4
4
  import { High5ExecuteOnAgentRequest, High5ExecutionCancelRequest } from "../high5/space/execution";
5
+ import { CapturedRequest } from "../high5/space/request";
5
6
  import { LicenseTier } from "../idp";
6
7
  declare enum NatsSubject {
7
8
  IDP_USER_GENERAL = "hcloud.idp.user.${userId}.general",
@@ -48,6 +49,7 @@ declare enum NatsSubject {
48
49
  HIGH5_DOCUMENTS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.databases.${base64databaseName}.documents",
49
50
  HIGH5_JOBS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.jobs",
50
51
  HIGH5_JOB_LOGS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.jobs.${jobId}.logs",
52
+ HIGH5_CAPTURED_REQUEST = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.request.catch",
51
53
  COSMO_SPACES = "hcloud.cosmo.organization.${base64orgName}.spaces",
52
54
  COSMO_NAMESPACES = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces",
53
55
  COSMO_ASSETS = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.assets",
@@ -113,14 +115,15 @@ declare enum NatsObjectType {
113
115
  FOLDER = "FOLDER",
114
116
  ROLE = "ROLE",
115
117
  STATUS = "STATUS",
116
- REFERENCE = "REFERENCE"
118
+ REFERENCE = "REFERENCE",
119
+ REQUEST = "REQUEST"
117
120
  }
118
121
  interface NatsMessage {
119
122
  type: NatsMessageType;
120
123
  object: NatsObject;
121
124
  objectType: NatsObjectType;
122
125
  }
123
- interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, NatsSecretObject, NatsExecTargetObject, High5ExecuteOnAgentRequest, High5ExecutionCancelRequest, NatsLicenseObject, NatsCustomNodeObject, NatsAssetObject, NatsIdNoUnderscoreObject, NatsTargetObject, NatsCosmoStatusObject {
126
+ interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, NatsSecretObject, NatsExecTargetObject, High5ExecuteOnAgentRequest, High5ExecutionCancelRequest, CapturedRequest, NatsLicenseObject, NatsCustomNodeObject, NatsAssetObject, NatsIdNoUnderscoreObject, NatsTargetObject, NatsCosmoStatusObject {
124
127
  [NatsSubject.IDP_USER_GENERAL]: NatsIdObject;
125
128
  [NatsSubject.IDP_USER_PROFILE]: NatsIdObject;
126
129
  [NatsSubject.IDP_USER_SECURITY_PATS]: NatsIdObject;
@@ -155,6 +158,7 @@ interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, Nat
155
158
  [NatsSubject.HIGH5_DOCUMENTS]: NatsNameObject;
156
159
  [NatsSubject.HIGH5_JOBS]: NatsIdObject;
157
160
  [NatsSubject.HIGH5_JOB_LOGS]: NatsIdObject;
161
+ [NatsSubject.HIGH5_CAPTURED_REQUEST]: CapturedRequest;
158
162
  [NatsSubject.COSMO_ASSETS]: NatsAssetObject[];
159
163
  [NatsSubject.COSMO_SHARE]: NatsIdObject;
160
164
  [NatsSubject.COSMO_ROLES]: NatsIdObject;
@@ -308,6 +312,7 @@ declare class NatsSubjects {
308
312
  JOBS: (organizationName: string, spaceName: string) => string;
309
313
  JOB_LOGS: (organizationName: string, spaceName: string, jobId: string) => string;
310
314
  };
315
+ CAPTURED_REQUEST: (organizationName: string, spaceName: string) => string;
311
316
  };
312
317
  WAVE: {
313
318
  new (): {};
@@ -52,6 +52,7 @@ var NatsSubject;
52
52
  NatsSubject["HIGH5_DOCUMENTS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.databases.${base64databaseName}.documents";
53
53
  NatsSubject["HIGH5_JOBS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.jobs";
54
54
  NatsSubject["HIGH5_JOB_LOGS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.jobs.${jobId}.logs";
55
+ NatsSubject["HIGH5_CAPTURED_REQUEST"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.request.catch";
55
56
  NatsSubject["COSMO_SPACES"] = "hcloud.cosmo.organization.${base64orgName}.spaces";
56
57
  NatsSubject["COSMO_NAMESPACES"] = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces";
57
58
  NatsSubject["COSMO_ASSETS"] = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.assets";
@@ -120,6 +121,7 @@ var NatsObjectType;
120
121
  NatsObjectType["ROLE"] = "ROLE";
121
122
  NatsObjectType["STATUS"] = "STATUS";
122
123
  NatsObjectType["REFERENCE"] = "REFERENCE";
124
+ NatsObjectType["REQUEST"] = "REQUEST";
123
125
  })(NatsObjectType || (exports.NatsObjectType = NatsObjectType = {}));
124
126
  /**
125
127
  * This helper class creates subject strings to be used with nats.subscribe and nats.publish
@@ -362,6 +364,9 @@ NatsSubjects.High5 = (_f = class {
362
364
  return NatsSubjects.replace(NatsSubject.HIGH5_JOB_LOGS, { organizationName, spaceName, jobId });
363
365
  },
364
366
  _o),
367
+ _h.CAPTURED_REQUEST = (organizationName, spaceName) => {
368
+ return NatsSubjects.replace(NatsSubject.HIGH5_CAPTURED_REQUEST, { organizationName, spaceName });
369
+ },
365
370
  _h),
366
371
  _f.WAVE = (_p = class {
367
372
  },
@@ -158,9 +158,10 @@ export declare class CosmoAsset extends Base {
158
158
  * Fetches an assets VTT file and parses it to return an array of VTTThumbnail objects.
159
159
  *
160
160
  * @param {string} url - The URL of the VTT file to fetch and parse.
161
+ * @param {string} keepAuthHeader - Keep the current set Authorization header. Otherwise it will be unset since S3 denies it.
161
162
  * @returns {Promise<VTTThumbnail[]>} A promise that resolves to an array of `VTTThumbnail` objects representing the asset’s thumbnails.
162
163
  */
163
- fetchAndParseAssetVTT<R extends boolean = false>(url: string, raw?: {
164
+ fetchAndParseAssetVTT<R extends boolean = false>(url: string, keepAuthHeader?: boolean, raw?: {
164
165
  raw: R;
165
166
  }): Promise<MaybeRaw<R, VTTThumbnail[]>>;
166
167
  /**
@@ -231,13 +231,14 @@ class CosmoAsset extends Base_1.default {
231
231
  * Fetches an assets VTT file and parses it to return an array of VTTThumbnail objects.
232
232
  *
233
233
  * @param {string} url - The URL of the VTT file to fetch and parse.
234
+ * @param {string} keepAuthHeader - Keep the current set Authorization header. Otherwise it will be unset since S3 denies it.
234
235
  * @returns {Promise<VTTThumbnail[]>} A promise that resolves to an array of `VTTThumbnail` objects representing the asset’s thumbnails.
235
236
  */
236
- fetchAndParseAssetVTT(url, raw) {
237
+ fetchAndParseAssetVTT(url, keepAuthHeader, raw) {
237
238
  return __awaiter(this, void 0, void 0, function* () {
238
239
  var _a;
239
240
  const resp = yield this.axios.get(url, {
240
- headers: Object.assign(Object.assign({}, axios_1.disableCacheHeaders), { Authorization: undefined }),
241
+ headers: Object.assign(Object.assign({}, axios_1.disableCacheHeaders), (keepAuthHeader ? {} : { Authorization: undefined })),
241
242
  });
242
243
  const parseTimestamp = (ts) => {
243
244
  const parts = ts.split(":").map(Number);
@@ -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,6 +1,6 @@
1
1
  import Base, { MaybeRaw } from "../../../../Base";
2
2
  import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
3
- import { Database } from "../../../../interfaces/high5";
3
+ import { ApiKey, ApiKeyPermission, Database } from "../../../../interfaces/high5";
4
4
  import { High5Document } from "./document";
5
5
  export declare class High5Database extends Base {
6
6
  get document(): High5Document;
@@ -61,5 +61,27 @@ export declare class High5Database extends Base {
61
61
  deleteDatabase<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, raw?: {
62
62
  raw: R;
63
63
  }): Promise<MaybeRaw<R, void>>;
64
+ /**
65
+ * Generates a new API key for a specific database within the space
66
+ * @param orgName Name of the Organization
67
+ * @param spaceName Name of the Space
68
+ * @param dbName Name of the Database
69
+ * @param name Name of the API key
70
+ * @param permission Permission level for the API key
71
+ * @returns The created API key details
72
+ */
73
+ createDatabaseApiKey<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, name: string, permission: ApiKeyPermission, raw?: {
74
+ raw: R;
75
+ }): Promise<MaybeRaw<R, ApiKey>>;
76
+ /**
77
+ * Removes an existing API key by its name, revoking access to the database
78
+ * @param orgName Name of the Organization
79
+ * @param spaceName Name of the Space
80
+ * @param dbName Name of the Database
81
+ * @param keyName Name of the API key to delete
82
+ */
83
+ deleteDatabaseApiKey<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, keyName: string, raw?: {
84
+ raw: R;
85
+ }): Promise<MaybeRaw<R, void>>;
64
86
  protected getEndpoint(endpoint: string): string;
65
87
  }
@@ -98,6 +98,37 @@ class High5Database extends Base_1.default {
98
98
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
99
99
  });
100
100
  }
101
+ /**
102
+ * Generates a new API key for a specific database within the space
103
+ * @param orgName Name of the Organization
104
+ * @param spaceName Name of the Space
105
+ * @param dbName Name of the Database
106
+ * @param name Name of the API key
107
+ * @param permission Permission level for the API key
108
+ * @returns The created API key details
109
+ */
110
+ createDatabaseApiKey(orgName, spaceName, dbName, name, permission, raw) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/apikey`), {
113
+ name,
114
+ permission,
115
+ });
116
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
117
+ });
118
+ }
119
+ /**
120
+ * Removes an existing API key by its name, revoking access to the database
121
+ * @param orgName Name of the Organization
122
+ * @param spaceName Name of the Space
123
+ * @param dbName Name of the Database
124
+ * @param keyName Name of the API key to delete
125
+ */
126
+ deleteDatabaseApiKey(orgName, spaceName, dbName, keyName, raw) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/apikey/${keyName}`));
129
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
130
+ });
131
+ }
101
132
  getEndpoint(endpoint) {
102
133
  return `${this.options.server}/api/high5${endpoint}`;
103
134
  }
@@ -1,7 +1,8 @@
1
1
  import Base, { MaybeRaw } from "../../../Base";
2
- import { PaginatedResponse, SearchParams } from "../../../interfaces/global";
2
+ import { HttpMethod, PaginatedResponse, SearchParams } from "../../../interfaces/global";
3
3
  import { Stream } from "../../../interfaces/high5";
4
4
  import { High5Space as Space, High5SpaceEntityPermission as SpaceEntityPermission, High5SpacePermission as SpacePermission } from "../../../interfaces/high5/space";
5
+ import { CapturedRequest } from "../../../interfaces/high5/space/request";
5
6
  import { High5Database } from "./database";
6
7
  import { High5Event } from "./event";
7
8
  import { High5SpaceExecute } from "./execution";
@@ -158,5 +159,18 @@ export declare class High5Space extends Base {
158
159
  updateAvatar<R extends boolean = false>(orgName: string, spaceName: string, file: File, raw?: {
159
160
  raw: R;
160
161
  }): Promise<MaybeRaw<R, Space>>;
162
+ /**
163
+ * Captures and forwards an HTTP request to NATS for the specified space
164
+ * This endpoint accepts any HTTP method and persists headers and body
165
+ * @param method HTTP method to use (GET, POST, PUT, etc.)
166
+ * @param orgName Name of the Organization
167
+ * @param spaceName Name of the Space
168
+ * @param data (optional) The body of the request
169
+ * @param headers (optional) Additional headers to forward
170
+ * @returns Captured request details
171
+ */
172
+ capturedRequest<R extends boolean = false>(method: HttpMethod, orgName: string, spaceName: string, data?: any, headers?: Record<string, string>, raw?: {
173
+ raw: R;
174
+ }): Promise<MaybeRaw<R, CapturedRequest>>;
161
175
  protected getEndpoint(endpoint: string): string;
162
176
  }
@@ -263,6 +263,27 @@ class High5Space extends Base_1.default {
263
263
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
264
264
  });
265
265
  }
266
+ /**
267
+ * Captures and forwards an HTTP request to NATS for the specified space
268
+ * This endpoint accepts any HTTP method and persists headers and body
269
+ * @param method HTTP method to use (GET, POST, PUT, etc.)
270
+ * @param orgName Name of the Organization
271
+ * @param spaceName Name of the Space
272
+ * @param data (optional) The body of the request
273
+ * @param headers (optional) Additional headers to forward
274
+ * @returns Captured request details
275
+ */
276
+ capturedRequest(method, orgName, spaceName, data, headers, raw) {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ const resp = yield this.axios.request({
279
+ method,
280
+ url: this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/request/catch`),
281
+ data,
282
+ headers,
283
+ });
284
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
285
+ });
286
+ }
266
287
  getEndpoint(endpoint) {
267
288
  return `${this.options.server}/api/high5${endpoint}`;
268
289
  }
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hcloud-sdk",
3
- "version": "19.2.0",
3
+ "version": "20.1.0",
4
4
  "description": "hcloud platform sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",