hcloud-sdk 19.1.0 → 19.3.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 +2 -20
- package/lib/helper/ValidationHelper.d.ts +2 -1
- package/lib/helper/ValidationHelper.js +9 -3
- package/lib/interfaces/cosmo/comment/index.d.ts +7 -0
- package/lib/interfaces/cosmo/comment/index.js +6 -1
- package/lib/interfaces/cosmo/share/index.d.ts +5 -2
- package/lib/interfaces/high5/index.d.ts +1 -0
- package/lib/interfaces/high5/index.js +1 -0
- package/lib/interfaces/high5/space/database/index.d.ts +17 -2
- package/lib/interfaces/high5/space/database/index.js +6 -0
- package/lib/interfaces/high5/space/request.d.ts +10 -0
- package/lib/interfaces/high5/space/request.js +2 -0
- package/lib/interfaces/high5/wave/index.d.ts +1 -1
- package/lib/interfaces/nats/index.d.ts +7 -2
- package/lib/interfaces/nats/index.js +5 -0
- package/lib/service/cosmo/asset/index.d.ts +2 -1
- package/lib/service/cosmo/asset/index.js +3 -2
- package/lib/service/high5/space/database/index.d.ts +23 -1
- package/lib/service/high5/space/database/index.js +31 -0
- package/lib/service/high5/space/index.d.ts +15 -1
- package/lib/service/high5/space/index.js +21 -0
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
## [19.
|
|
1
|
+
## [19.3.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v19.2.1...v19.3.0) (2026-05-12)
|
|
2
2
|
|
|
3
3
|
### Features
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
* add arch to installer versions ([7aa7e6c](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/7aa7e6cf0d2a73f38dae9538e95db910b66a133f))
|
|
7
|
-
* add comment completion ([8f494c4](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/8f494c40af4f8019ba13b7e15f2b5eb19cdac148))
|
|
8
|
-
* add position to tags ([522891b](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/522891ba1ba0daf54a8c6160ce64d9055fd6e9e2))
|
|
9
|
-
* add queuePosition and queueTotal to Asset type ([e25ba33](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/e25ba334038fccb876f3f4eb0036567aa7c3083c))
|
|
10
|
-
* add reorderTags method to sort tags in Cosmo ([a1b70d1](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/a1b70d149b196b19df36c687ecb1c04ddda6c66c))
|
|
11
|
-
* add sorting options for comments by timecode and creator ([b28816c](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/b28816c678078ce8cf9c3c462458f5a069c3b7a9))
|
|
12
|
-
* change thumbnail resolution and add posterframe ([d34eabf](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/d34eabffeed7a1f3cddaf742e43040858e894339))
|
|
13
|
-
* extend asset response with permission and author details in namespaces ([5f12f9a](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/5f12f9a3d89adb8af8b1bdb7c5028ecc51110729))
|
|
14
|
-
* extend input to be optionally be dependent ([14f0e59](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/14f0e590fc0808cee1586397f517f86fb74ad367))
|
|
15
|
-
* extend node input to hold optional if property to use for dependent fields ([8afd90a](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/8afd90aa38894251adceee8b1e01b80fd6f4b736))
|
|
16
|
-
* **high5:** align getStreamExecutionPackage with design caching changes ([600cf14](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/600cf14d9a0f7d5f120fd05381187031f6f162e7))
|
|
17
|
-
* include org and space IDs in ExtendedExecutionPackage ([4ac0108](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/4ac0108d9e1f2e70c98cfe14df9f5b3258fe1770))
|
|
18
|
-
* includes thumbnailUrls of first four assets in share object ([738010a](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/738010a33ef056a91510e1f117e2b536c43278bd))
|
|
19
|
-
* includes thumbnailUrls of first four assets in share object ([f239f80](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/f239f80b651817b83e8099de8ef079731bfc031e))
|
|
20
|
-
|
|
21
|
-
### Bug Fixes
|
|
22
|
-
|
|
23
|
-
* typo in thumbnail property ([3778bdd](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/3778bdd57c91a00425572af8913433efd1279b7f))
|
|
5
|
+
* new public version ([d33d2c1](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/d33d2c1f48e1e0aa3e1559d730dea1802e112fd9))
|
|
@@ -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,
|
|
@@ -6,6 +6,7 @@ export interface CreateComment {
|
|
|
6
6
|
annotation?: string;
|
|
7
7
|
mentions?: string[];
|
|
8
8
|
mentionsTeams?: string[];
|
|
9
|
+
visibility?: CommentVisibility;
|
|
9
10
|
}
|
|
10
11
|
export interface EditComment {
|
|
11
12
|
text: string;
|
|
@@ -14,6 +15,7 @@ export interface EditComment {
|
|
|
14
15
|
mentions?: string[];
|
|
15
16
|
mentionsTeams?: string[];
|
|
16
17
|
completed?: boolean;
|
|
18
|
+
visibility?: CommentVisibility;
|
|
17
19
|
}
|
|
18
20
|
export declare enum CommentType {
|
|
19
21
|
COMMENT = "COMMENT",
|
|
@@ -29,6 +31,10 @@ export declare enum CommentSortDirection {
|
|
|
29
31
|
ASC = "ASC",
|
|
30
32
|
DESC = "DESC"
|
|
31
33
|
}
|
|
34
|
+
export declare enum CommentVisibility {
|
|
35
|
+
INTERNAL = "internal",
|
|
36
|
+
EXTERNAL = "external"
|
|
37
|
+
}
|
|
32
38
|
export interface Comment {
|
|
33
39
|
_id: string;
|
|
34
40
|
text: string;
|
|
@@ -44,6 +50,7 @@ export interface Comment {
|
|
|
44
50
|
completed: boolean;
|
|
45
51
|
completedBy?: ReducedUser;
|
|
46
52
|
completedAt?: number;
|
|
53
|
+
visibility?: CommentVisibility;
|
|
47
54
|
}
|
|
48
55
|
export interface Reply extends Omit<Comment, "timestamp" | "replies"> {
|
|
49
56
|
commentRef: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommentSortDirection = exports.CommentSortField = exports.CommentType = void 0;
|
|
3
|
+
exports.CommentVisibility = exports.CommentSortDirection = exports.CommentSortField = exports.CommentType = void 0;
|
|
4
4
|
var CommentType;
|
|
5
5
|
(function (CommentType) {
|
|
6
6
|
CommentType["COMMENT"] = "COMMENT";
|
|
@@ -18,3 +18,8 @@ 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 = {}));
|
|
@@ -59,10 +59,11 @@ export interface Share {
|
|
|
59
59
|
* @property public - (Optional) Whether the share is public.
|
|
60
60
|
* @property visitsLimit - (Optional) Maximum number of allowed visits for the share (only applicable for public shares).
|
|
61
61
|
*/
|
|
62
|
-
export interface ShareCreate extends Omit<Share, "_id" | "createDate" | "creator" | "permissionGroups" | "users"> {
|
|
62
|
+
export interface ShareCreate extends Omit<Share, "_id" | "createDate" | "creator" | "permissionGroups" | "users" | "items" | "waiting"> {
|
|
63
63
|
password?: string;
|
|
64
64
|
expires?: number;
|
|
65
65
|
namespaces?: Record<string, string[]>;
|
|
66
|
+
items: string[];
|
|
66
67
|
assetPermissionGroups?: ShareAssetPermissionGroup[];
|
|
67
68
|
/**
|
|
68
69
|
* Array of emails
|
|
@@ -90,7 +91,7 @@ export type ShareWithUsers = Share & {
|
|
|
90
91
|
* @property public - (Optional) Whether the share is public.
|
|
91
92
|
* @property visitsLimit - (Optional) New maximum number of allowed visits (only applicable for public shares).
|
|
92
93
|
*/
|
|
93
|
-
export type SharePatch = Partial<Pick<ShareCreate, "name" | "
|
|
94
|
+
export type SharePatch = Partial<Pick<ShareCreate, "name" | "users"> & {
|
|
94
95
|
items: string[];
|
|
95
96
|
permissions?: string[];
|
|
96
97
|
assetPermissionGroups?: ShareAssetPermissionGroup[];
|
|
@@ -99,6 +100,8 @@ export type SharePatch = Partial<Pick<ShareCreate, "name" | "expires" | "passwor
|
|
|
99
100
|
public?: boolean;
|
|
100
101
|
visitsLimit?: number;
|
|
101
102
|
users?: string[];
|
|
103
|
+
expires?: number | null;
|
|
104
|
+
password?: string | null;
|
|
102
105
|
}>;
|
|
103
106
|
export declare enum ShareAssetPermissionGroup {
|
|
104
107
|
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
|
|
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
|
+
}
|
|
@@ -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;
|
|
@@ -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);
|
|
@@ -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
|
}
|