hcloud-sdk 22.22.0 → 22.23.1
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 +3 -3
- package/lib/helper/ValidationHelper.d.ts +2 -1
- package/lib/helper/ValidationHelper.js +6 -0
- package/lib/interfaces/auditor/index.d.ts +2 -1
- package/lib/interfaces/auditor/index.js +1 -0
- package/lib/interfaces/high5/index.d.ts +1 -0
- package/lib/interfaces/high5/index.js +1 -0
- package/lib/interfaces/high5/space/watchfolder/index.d.ts +80 -0
- package/lib/interfaces/high5/space/watchfolder/index.js +17 -0
- package/lib/interfaces/nats/index.d.ts +21 -0
- package/lib/interfaces/nats/index.js +53 -33
- package/lib/service/cosmo/space/index.d.ts +3 -1
- package/lib/service/cosmo/space/index.js +5 -3
- package/lib/service/high5/space/index.d.ts +3 -0
- package/lib/service/high5/space/index.js +7 -0
- package/lib/service/high5/space/watchfolder/index.d.ts +89 -0
- package/lib/service/high5/space/watchfolder/index.js +131 -0
- package/lib/service/nats/index.js +6 -3
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## [22.
|
|
1
|
+
## [22.23.1](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.23.0...v22.23.1) (2026-08-31)
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
*
|
|
5
|
+
* add limit and page support to cosemo.listSpaceUsers ([a4034f5](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/a4034f51a91b7104cad2d2201d758fed820d83b3))
|
|
@@ -51,7 +51,8 @@ declare enum Entity {
|
|
|
51
51
|
TAG_COLOR = "TAG_COLOR",
|
|
52
52
|
MODULE_NAME = "MODULE_NAME",
|
|
53
53
|
LOG_COLLECTOR_NAME = "LOG_COLLECTOR_NAME",
|
|
54
|
-
PASSKEY_NAME = "PASSKEY_NAME"
|
|
54
|
+
PASSKEY_NAME = "PASSKEY_NAME",
|
|
55
|
+
WATCH_FOLDER_NAME = "WATCH_FOLDER_NAME"
|
|
55
56
|
}
|
|
56
57
|
declare class EntityDetails {
|
|
57
58
|
private entity;
|
|
@@ -57,6 +57,7 @@ var Entity;
|
|
|
57
57
|
Entity["MODULE_NAME"] = "MODULE_NAME";
|
|
58
58
|
Entity["LOG_COLLECTOR_NAME"] = "LOG_COLLECTOR_NAME";
|
|
59
59
|
Entity["PASSKEY_NAME"] = "PASSKEY_NAME";
|
|
60
|
+
Entity["WATCH_FOLDER_NAME"] = "WATCH_FOLDER_NAME";
|
|
60
61
|
})(Entity || (exports.Entity = Entity = {}));
|
|
61
62
|
class EntityDetails {
|
|
62
63
|
constructor(name) {
|
|
@@ -392,4 +393,9 @@ const entityCollection = {
|
|
|
392
393
|
minLength: 3,
|
|
393
394
|
maxLength: 128,
|
|
394
395
|
},
|
|
396
|
+
[Entity.WATCH_FOLDER_NAME]: {
|
|
397
|
+
pattern: /^[\w-.]{2,128}$/i,
|
|
398
|
+
minLength: 2,
|
|
399
|
+
maxLength: 128,
|
|
400
|
+
},
|
|
395
401
|
};
|
|
@@ -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/watchfolder";
|
|
10
11
|
export * from "./space/request";
|
|
11
12
|
export * from "./space/database";
|
|
12
13
|
export * from "./space/database/document";
|
|
@@ -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/watchfolder"), exports);
|
|
26
27
|
__exportStar(require("./space/request"), exports);
|
|
27
28
|
__exportStar(require("./space/database"), exports);
|
|
28
29
|
__exportStar(require("./space/database/document"), exports);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ReducedSpace } from "../../../global";
|
|
2
|
+
import { ReducedOrganization, ReducedUser } from "../../../idp";
|
|
3
|
+
export declare enum WatchFolderResourceType {
|
|
4
|
+
S3 = "S3",
|
|
5
|
+
LOCAL = "LOCAL"
|
|
6
|
+
}
|
|
7
|
+
interface S3WatchFolderCredentials {
|
|
8
|
+
resourceType: WatchFolderResourceType.S3;
|
|
9
|
+
accessKeyId: string;
|
|
10
|
+
secretAccessKey: string;
|
|
11
|
+
region: string;
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
bucket: string;
|
|
14
|
+
}
|
|
15
|
+
interface LocalWatchFolderCredentials {
|
|
16
|
+
resourceType: WatchFolderResourceType.LOCAL;
|
|
17
|
+
}
|
|
18
|
+
export type WatchFolderCredentials = S3WatchFolderCredentials | LocalWatchFolderCredentials;
|
|
19
|
+
export interface WatchFolder {
|
|
20
|
+
_id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
target: string;
|
|
23
|
+
space: ReducedSpace;
|
|
24
|
+
organization: ReducedOrganization;
|
|
25
|
+
creator: ReducedUser;
|
|
26
|
+
createDate: number;
|
|
27
|
+
resourceType: WatchFolderResourceType;
|
|
28
|
+
path: string;
|
|
29
|
+
interval: number;
|
|
30
|
+
eventName: string;
|
|
31
|
+
credentials: WatchFolderCredentials;
|
|
32
|
+
}
|
|
33
|
+
export interface CreateWatchFolder {
|
|
34
|
+
name: string;
|
|
35
|
+
target: string;
|
|
36
|
+
resourceType: WatchFolderResourceType;
|
|
37
|
+
path: string;
|
|
38
|
+
interval: number;
|
|
39
|
+
eventName: string;
|
|
40
|
+
credentials: WatchFolderCredentials;
|
|
41
|
+
}
|
|
42
|
+
export interface PatchWatchFolder {
|
|
43
|
+
name?: string;
|
|
44
|
+
target?: string;
|
|
45
|
+
resourceType?: WatchFolderResourceType;
|
|
46
|
+
path?: string;
|
|
47
|
+
interval?: number;
|
|
48
|
+
eventName?: string;
|
|
49
|
+
credentials?: WatchFolderCredentials;
|
|
50
|
+
}
|
|
51
|
+
export declare enum WatchFolderFileStatus {
|
|
52
|
+
NEW = "NEW",
|
|
53
|
+
GROWING = "GROWING",
|
|
54
|
+
STABLE = "STABLE",
|
|
55
|
+
PROCESSING = "PROCESSING",
|
|
56
|
+
PROCESSED = "PROCESSED",
|
|
57
|
+
MISSING = "MISSING"
|
|
58
|
+
}
|
|
59
|
+
export interface WatchFolderFile {
|
|
60
|
+
_id: string;
|
|
61
|
+
watchFolderId: string;
|
|
62
|
+
spaceId: string;
|
|
63
|
+
organizationId: string;
|
|
64
|
+
path: string;
|
|
65
|
+
size: number;
|
|
66
|
+
status: WatchFolderFileStatus;
|
|
67
|
+
lastSeen: number;
|
|
68
|
+
createDate: number;
|
|
69
|
+
}
|
|
70
|
+
export interface WatchFolderScanReport {
|
|
71
|
+
files: {
|
|
72
|
+
path: string;
|
|
73
|
+
size: number;
|
|
74
|
+
}[];
|
|
75
|
+
}
|
|
76
|
+
export interface WatchFolderScanConfig {
|
|
77
|
+
path: string;
|
|
78
|
+
credentials: WatchFolderCredentials;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WatchFolderFileStatus = exports.WatchFolderResourceType = void 0;
|
|
4
|
+
var WatchFolderResourceType;
|
|
5
|
+
(function (WatchFolderResourceType) {
|
|
6
|
+
WatchFolderResourceType["S3"] = "S3";
|
|
7
|
+
WatchFolderResourceType["LOCAL"] = "LOCAL";
|
|
8
|
+
})(WatchFolderResourceType || (exports.WatchFolderResourceType = WatchFolderResourceType = {}));
|
|
9
|
+
var WatchFolderFileStatus;
|
|
10
|
+
(function (WatchFolderFileStatus) {
|
|
11
|
+
WatchFolderFileStatus["NEW"] = "NEW";
|
|
12
|
+
WatchFolderFileStatus["GROWING"] = "GROWING";
|
|
13
|
+
WatchFolderFileStatus["STABLE"] = "STABLE";
|
|
14
|
+
WatchFolderFileStatus["PROCESSING"] = "PROCESSING";
|
|
15
|
+
WatchFolderFileStatus["PROCESSED"] = "PROCESSED";
|
|
16
|
+
WatchFolderFileStatus["MISSING"] = "MISSING";
|
|
17
|
+
})(WatchFolderFileStatus || (exports.WatchFolderFileStatus = WatchFolderFileStatus = {}));
|
|
@@ -50,6 +50,9 @@ declare enum NatsSubject {
|
|
|
50
50
|
HIGH5_JOBS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.jobs",
|
|
51
51
|
HIGH5_JOB_LOGS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.jobs.${jobId}.logs",
|
|
52
52
|
HIGH5_CAPTURED_REQUEST = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.request.catch",
|
|
53
|
+
HIGH5_WATCH_FOLDERS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.watchfolders.>",
|
|
54
|
+
HIGH5_WATCH_FOLDER = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.watchfolders.${base64watchFolderName}",
|
|
55
|
+
HIGH5_WATCHFOLDER_SCAN = "hcloud.high5.organization.${organizationId}.watchfolder.${watchFolderId}.scan",
|
|
53
56
|
COSMO_SPACES = "hcloud.cosmo.organization.${base64orgName}.spaces",
|
|
54
57
|
COSMO_NAMESPACES = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces",
|
|
55
58
|
COSMO_ASSETS = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.assets",
|
|
@@ -98,6 +101,8 @@ declare enum NatsObjectType {
|
|
|
98
101
|
SECRET = "SECRET",
|
|
99
102
|
CATALOG = "CATALOG",
|
|
100
103
|
POOL = "POOL",
|
|
104
|
+
WATCH_FOLDER = "WATCH_FOLDER",
|
|
105
|
+
WATCH_FOLDER_SCAN = "WATCH_FOLDER_SCAN",
|
|
101
106
|
AUDIT_LOG = "AUDIT_LOG",
|
|
102
107
|
MAIL = "MAIL",
|
|
103
108
|
JOB = "JOB",
|
|
@@ -161,6 +166,9 @@ interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, Nat
|
|
|
161
166
|
[NatsSubject.HIGH5_JOBS]: NatsIdObject;
|
|
162
167
|
[NatsSubject.HIGH5_JOB_LOGS]: NatsIdObject;
|
|
163
168
|
[NatsSubject.HIGH5_CAPTURED_REQUEST]: CapturedRequest;
|
|
169
|
+
[NatsSubject.HIGH5_WATCH_FOLDERS]: NatsIdObject;
|
|
170
|
+
[NatsSubject.HIGH5_WATCH_FOLDER]: NatsWatchFolderObject;
|
|
171
|
+
[NatsSubject.HIGH5_WATCHFOLDER_SCAN]: NatsWatchFolderScanObject;
|
|
164
172
|
[NatsSubject.COSMO_ASSETS]: NatsAssetObject[];
|
|
165
173
|
[NatsSubject.COSMO_STACKS]: NatsAssetObject[];
|
|
166
174
|
[NatsSubject.COSMO_SHARE]: NatsIdObject;
|
|
@@ -215,6 +223,13 @@ interface NatsPoolObject extends NatsIdObject {
|
|
|
215
223
|
interface NatsTargetObject {
|
|
216
224
|
target: string;
|
|
217
225
|
}
|
|
226
|
+
interface NatsWatchFolderObject extends NatsIdObject {
|
|
227
|
+
name: string;
|
|
228
|
+
target: string;
|
|
229
|
+
}
|
|
230
|
+
interface NatsWatchFolderScanObject extends NatsIdObject {
|
|
231
|
+
secret: string;
|
|
232
|
+
}
|
|
218
233
|
interface NatsCosmoReferenceObject {
|
|
219
234
|
refId: string;
|
|
220
235
|
}
|
|
@@ -316,6 +331,8 @@ declare class NatsSubjects {
|
|
|
316
331
|
JOB_LOGS: (organizationName: string, spaceName: string, jobId: string) => string;
|
|
317
332
|
};
|
|
318
333
|
CAPTURED_REQUEST: (organizationName: string, spaceName: string) => string;
|
|
334
|
+
WATCH_FOLDERS: (organizationName: string, spaceName: string) => string;
|
|
335
|
+
WATCH_FOLDER: (organizationName: string, spaceName: string, watchFolderName: string) => string;
|
|
319
336
|
};
|
|
320
337
|
WAVE: {
|
|
321
338
|
new (): {};
|
|
@@ -324,6 +341,10 @@ declare class NatsSubjects {
|
|
|
324
341
|
LATEST: NatsSubject;
|
|
325
342
|
};
|
|
326
343
|
};
|
|
344
|
+
WatchFolder: {
|
|
345
|
+
new (): {};
|
|
346
|
+
SCAN: (organizationId: string, watchFolderId: string) => string;
|
|
347
|
+
};
|
|
327
348
|
};
|
|
328
349
|
static Mothership: {
|
|
329
350
|
new (): {};
|
|
@@ -3,7 +3,7 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
|
|
|
3
3
|
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
4
4
|
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
5
5
|
};
|
|
6
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.NatsSubjects = exports.NatsSubject = exports.NatsObjectType = exports.NatsMessageType = void 0;
|
|
9
9
|
var NatsSubject;
|
|
@@ -53,6 +53,9 @@ var NatsSubject;
|
|
|
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
55
|
NatsSubject["HIGH5_CAPTURED_REQUEST"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.request.catch";
|
|
56
|
+
NatsSubject["HIGH5_WATCH_FOLDERS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.watchfolders.>";
|
|
57
|
+
NatsSubject["HIGH5_WATCH_FOLDER"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.watchfolders.${base64watchFolderName}";
|
|
58
|
+
NatsSubject["HIGH5_WATCHFOLDER_SCAN"] = "hcloud.high5.organization.${organizationId}.watchfolder.${watchFolderId}.scan";
|
|
56
59
|
NatsSubject["COSMO_SPACES"] = "hcloud.cosmo.organization.${base64orgName}.spaces";
|
|
57
60
|
NatsSubject["COSMO_NAMESPACES"] = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces";
|
|
58
61
|
NatsSubject["COSMO_ASSETS"] = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.assets";
|
|
@@ -103,6 +106,8 @@ var NatsObjectType;
|
|
|
103
106
|
NatsObjectType["SECRET"] = "SECRET";
|
|
104
107
|
NatsObjectType["CATALOG"] = "CATALOG";
|
|
105
108
|
NatsObjectType["POOL"] = "POOL";
|
|
109
|
+
NatsObjectType["WATCH_FOLDER"] = "WATCH_FOLDER";
|
|
110
|
+
NatsObjectType["WATCH_FOLDER_SCAN"] = "WATCH_FOLDER_SCAN";
|
|
106
111
|
NatsObjectType["AUDIT_LOG"] = "AUDIT_LOG";
|
|
107
112
|
NatsObjectType["MAIL"] = "MAIL";
|
|
108
113
|
NatsObjectType["JOB"] = "JOB";
|
|
@@ -369,6 +374,12 @@ NatsSubjects.High5 = (_f = class {
|
|
|
369
374
|
_h.CAPTURED_REQUEST = (organizationName, spaceName) => {
|
|
370
375
|
return NatsSubjects.replace(NatsSubject.HIGH5_CAPTURED_REQUEST, { organizationName, spaceName });
|
|
371
376
|
},
|
|
377
|
+
_h.WATCH_FOLDERS = (organizationName, spaceName) => {
|
|
378
|
+
return NatsSubjects.replace(NatsSubject.HIGH5_WATCH_FOLDERS, { organizationName, spaceName });
|
|
379
|
+
},
|
|
380
|
+
_h.WATCH_FOLDER = (organizationName, spaceName, watchFolderName) => {
|
|
381
|
+
return NatsSubjects.replace(NatsSubject.HIGH5_WATCH_FOLDER, { organizationName, spaceName, watchFolderName });
|
|
382
|
+
},
|
|
372
383
|
_h),
|
|
373
384
|
_f.WAVE = (_p = class {
|
|
374
385
|
},
|
|
@@ -379,76 +390,83 @@ NatsSubjects.High5 = (_f = class {
|
|
|
379
390
|
_q.LATEST = NatsSubject.HIGH5_WAVE_ENGINE_LATEST,
|
|
380
391
|
_q),
|
|
381
392
|
_p),
|
|
393
|
+
_f.WatchFolder = (_r = class {
|
|
394
|
+
},
|
|
395
|
+
__setFunctionName(_r, "WatchFolder"),
|
|
396
|
+
_r.SCAN = (organizationId, watchFolderId) => {
|
|
397
|
+
return NatsSubjects.replace(NatsSubject.HIGH5_WATCHFOLDER_SCAN, { organizationId, watchFolderId });
|
|
398
|
+
},
|
|
399
|
+
_r),
|
|
382
400
|
_f);
|
|
383
|
-
NatsSubjects.Mothership = (
|
|
401
|
+
NatsSubjects.Mothership = (_s = class {
|
|
384
402
|
},
|
|
385
|
-
__setFunctionName(
|
|
386
|
-
|
|
403
|
+
__setFunctionName(_s, "Mothership"),
|
|
404
|
+
_s.CONNECTION = (organizationName) => {
|
|
387
405
|
return NatsSubjects.replace(NatsSubject.MOTHERSHIP_AGENT_CONNECTION, { organizationName });
|
|
388
406
|
},
|
|
389
|
-
|
|
390
|
-
NatsSubjects.Auditor = (
|
|
407
|
+
_s);
|
|
408
|
+
NatsSubjects.Auditor = (_t = class {
|
|
391
409
|
},
|
|
392
|
-
__setFunctionName(
|
|
393
|
-
|
|
410
|
+
__setFunctionName(_t, "Auditor"),
|
|
411
|
+
_t.LOGS = (organizationName) => {
|
|
394
412
|
return NatsSubjects.replace(NatsSubject.AUDITOR_LOGS, { organizationName });
|
|
395
413
|
},
|
|
396
|
-
|
|
414
|
+
_t);
|
|
397
415
|
NatsSubjects.Logging = (product) => {
|
|
398
416
|
return NatsSubjects.replace(NatsSubject.DEBUG_NAMESPACE, { product });
|
|
399
417
|
};
|
|
400
|
-
NatsSubjects.Cosmo = (
|
|
418
|
+
NatsSubjects.Cosmo = (_u = class {
|
|
401
419
|
},
|
|
402
|
-
__setFunctionName(
|
|
403
|
-
|
|
420
|
+
__setFunctionName(_u, "Cosmo"),
|
|
421
|
+
_u.SPACES = (organizationName) => {
|
|
404
422
|
return NatsSubjects.replace(NatsSubject.COSMO_SPACES, { organizationName });
|
|
405
423
|
},
|
|
406
|
-
|
|
424
|
+
_u.Space = (_v = class {
|
|
407
425
|
},
|
|
408
|
-
__setFunctionName(
|
|
409
|
-
|
|
426
|
+
__setFunctionName(_v, "Space"),
|
|
427
|
+
_v.NAMESPACES = (organizationName, spaceName) => {
|
|
410
428
|
return NatsSubjects.replace(NatsSubject.COSMO_NAMESPACES, { organizationName, spaceName });
|
|
411
429
|
},
|
|
412
|
-
|
|
430
|
+
_v.Namespace = (_w = class {
|
|
413
431
|
},
|
|
414
|
-
__setFunctionName(
|
|
415
|
-
|
|
432
|
+
__setFunctionName(_w, "Namespace"),
|
|
433
|
+
_w.TAGS = (organizationName, spaceName, namespaceName) => {
|
|
416
434
|
return NatsSubjects.replace(NatsSubject.COSMO_TAGS_NAMESPACE, { organizationName, spaceName, namespaceName });
|
|
417
435
|
},
|
|
418
|
-
|
|
436
|
+
_w.METADATA = (organizationName, spaceName, namespaceName) => {
|
|
419
437
|
return NatsSubjects.replace(NatsSubject.COSMO_METADATA, { organizationName, spaceName, namespaceName });
|
|
420
438
|
},
|
|
421
|
-
|
|
422
|
-
|
|
439
|
+
_w),
|
|
440
|
+
_v.ASSETS = (organizationName, spaceName) => {
|
|
423
441
|
return NatsSubjects.replace(NatsSubject.COSMO_ASSETS, { organizationName, spaceName });
|
|
424
442
|
},
|
|
425
|
-
|
|
443
|
+
_v.STACKS = (organizationName, spaceName) => {
|
|
426
444
|
return NatsSubjects.replace(NatsSubject.COSMO_STACKS, { organizationName, spaceName });
|
|
427
445
|
},
|
|
428
|
-
|
|
446
|
+
_v.SHARES = (organizationName, spaceName) => {
|
|
429
447
|
return NatsSubjects.replace(NatsSubject.COSMO_SHARE, { organizationName, spaceName });
|
|
430
448
|
},
|
|
431
|
-
|
|
449
|
+
_v.ROLES = (organizationName, spaceName) => {
|
|
432
450
|
return NatsSubjects.replace(NatsSubject.COSMO_ROLES, { organizationName, spaceName });
|
|
433
451
|
},
|
|
434
|
-
|
|
452
|
+
_v.Asset = (_x = class {
|
|
435
453
|
},
|
|
436
|
-
__setFunctionName(
|
|
437
|
-
|
|
454
|
+
__setFunctionName(_x, "Asset"),
|
|
455
|
+
_x.COMMENTS = (organizationName, spaceName, namespaceName, assetId) => {
|
|
438
456
|
return NatsSubjects.replace(NatsSubject.COSMO_COMMENTS, { organizationName, spaceName, namespaceName, assetId });
|
|
439
457
|
},
|
|
440
|
-
|
|
458
|
+
_x.TAGS = (organizationName, spaceName, namespaceName, assetId) => {
|
|
441
459
|
return NatsSubjects.replace(NatsSubject.COSMO_TAGS_ASSET, { organizationName, spaceName, namespaceName, assetId });
|
|
442
460
|
},
|
|
443
|
-
|
|
461
|
+
_x.STATUS = (organizationName, spaceName, namespaceName, assetId) => {
|
|
444
462
|
return NatsSubjects.replace(NatsSubject.COSMO_STATUS, { organizationName, spaceName, namespaceName, assetId });
|
|
445
463
|
},
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
464
|
+
_x),
|
|
465
|
+
_v),
|
|
466
|
+
_u.ASSETS = (organizationName) => {
|
|
449
467
|
return NatsSubjects.replace(NatsSubject.COSMO_CROSS_SPACES_ASSETS, { organizationName });
|
|
450
468
|
},
|
|
451
|
-
|
|
469
|
+
_u);
|
|
452
470
|
// eslint-disable-next-line complexity
|
|
453
471
|
NatsSubjects.replace = (subject, replacements) => {
|
|
454
472
|
subject = subject.replace("${userId}", replacements.userId || "null");
|
|
@@ -473,6 +491,8 @@ NatsSubjects.replace = (subject, replacements) => {
|
|
|
473
491
|
subject = subject.replace("${executionSecret}", replacements.executionSecret || "null");
|
|
474
492
|
subject = subject.replace("${base64databaseName}", replacements.databaseName ? (replacements.databaseName === "*" ? "*" : base64Encode(replacements.databaseName)) : "null");
|
|
475
493
|
subject = subject.replace("${assetId}", replacements.assetId || "null");
|
|
494
|
+
subject = subject.replace("${base64watchFolderName}", replacements.watchFolderName ? (replacements.watchFolderName === "*" ? "*" : base64Encode(replacements.watchFolderName)) : "null");
|
|
495
|
+
subject = subject.replace("${watchFolderId}", replacements.watchFolderId || "null");
|
|
476
496
|
return subject;
|
|
477
497
|
};
|
|
478
498
|
const base64Encode = (str) => {
|
|
@@ -98,9 +98,11 @@ export declare class CosmoSpace extends Base {
|
|
|
98
98
|
* List all users with access to the given Space.
|
|
99
99
|
* @param orgName Name of the Organization
|
|
100
100
|
* @param spaceName Name of the Cosmo Space
|
|
101
|
+
* @param limit Number of users to return per page (default is 25)
|
|
102
|
+
* @param page Page number to return (default is 0)
|
|
101
103
|
* @returns The SpaceUser array
|
|
102
104
|
*/
|
|
103
|
-
listSpaceUsers<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
105
|
+
listSpaceUsers<R extends boolean = false>(orgName: string, spaceName: string, limit?: number, page?: number, raw?: {
|
|
104
106
|
raw: R;
|
|
105
107
|
}): Promise<MaybeRaw<R, SpaceUser[]>>;
|
|
106
108
|
/**
|
|
@@ -137,11 +137,13 @@ class CosmoSpace extends Base_1.default {
|
|
|
137
137
|
* List all users with access to the given Space.
|
|
138
138
|
* @param orgName Name of the Organization
|
|
139
139
|
* @param spaceName Name of the Cosmo Space
|
|
140
|
+
* @param limit Number of users to return per page (default is 25)
|
|
141
|
+
* @param page Page number to return (default is 0)
|
|
140
142
|
* @returns The SpaceUser array
|
|
141
143
|
*/
|
|
142
|
-
listSpaceUsers(
|
|
143
|
-
return __awaiter(this,
|
|
144
|
-
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/users`));
|
|
144
|
+
listSpaceUsers(orgName_1, spaceName_1) {
|
|
145
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, limit = 25, page = 0, raw) {
|
|
146
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/users?limit=${limit}&page=${page}`));
|
|
145
147
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
146
148
|
});
|
|
147
149
|
}
|
|
@@ -11,6 +11,7 @@ import High5Node from "./node";
|
|
|
11
11
|
import High5Pool from "./pool";
|
|
12
12
|
import High5Secret from "./secret";
|
|
13
13
|
import { High5SpaceStat } from "./stat";
|
|
14
|
+
import { High5WatchFolder } from "./watchfolder";
|
|
14
15
|
import High5Wave from "./wave";
|
|
15
16
|
import { High5Webhook } from "./webhook";
|
|
16
17
|
export declare class High5Space extends Base {
|
|
@@ -34,6 +35,8 @@ export declare class High5Space extends Base {
|
|
|
34
35
|
private _job?;
|
|
35
36
|
get stat(): High5SpaceStat;
|
|
36
37
|
private _stat?;
|
|
38
|
+
get watchfolder(): High5WatchFolder;
|
|
39
|
+
private _watchfolder?;
|
|
37
40
|
/**
|
|
38
41
|
* Retrieves all High5 Spaces of the specified Organization matching the search filter(s). Will return all Spaces if no search filter is provided.
|
|
39
42
|
* @param orgName Name of the organization
|
|
@@ -24,6 +24,7 @@ const node_1 = __importDefault(require("./node"));
|
|
|
24
24
|
const pool_1 = __importDefault(require("./pool"));
|
|
25
25
|
const secret_1 = __importDefault(require("./secret"));
|
|
26
26
|
const stat_1 = require("./stat");
|
|
27
|
+
const watchfolder_1 = require("./watchfolder");
|
|
27
28
|
const wave_1 = __importDefault(require("./wave"));
|
|
28
29
|
const webhook_1 = require("./webhook");
|
|
29
30
|
class High5Space extends Base_1.default {
|
|
@@ -87,6 +88,12 @@ class High5Space extends Base_1.default {
|
|
|
87
88
|
}
|
|
88
89
|
return this._stat;
|
|
89
90
|
}
|
|
91
|
+
get watchfolder() {
|
|
92
|
+
if (this._watchfolder === undefined) {
|
|
93
|
+
this._watchfolder = new watchfolder_1.High5WatchFolder(this.options, this.axios);
|
|
94
|
+
}
|
|
95
|
+
return this._watchfolder;
|
|
96
|
+
}
|
|
90
97
|
/**
|
|
91
98
|
* Retrieves all High5 Spaces of the specified Organization matching the search filter(s). Will return all Spaces if no search filter is provided.
|
|
92
99
|
* @param orgName Name of the organization
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { MaybeRaw, Options } from "../../../../Base";
|
|
3
|
+
import { CreateWatchFolder, PatchWatchFolder, WatchFolder, WatchFolderFile, WatchFolderScanConfig, WatchFolderScanReport } from "../../../../interfaces/high5/space/watchfolder";
|
|
4
|
+
export declare class High5WatchFolder extends Base {
|
|
5
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves all watch folders the current user is assigned to as target, directly or
|
|
8
|
+
* through a pool. Used mostly by idp to compute NATS permissions and by the agent to join
|
|
9
|
+
* the watch folders it is already assigned to on startup/reconnect
|
|
10
|
+
* @returns Array of watch folders
|
|
11
|
+
*/
|
|
12
|
+
getWatchFolders<R extends boolean = false>(raw?: {
|
|
13
|
+
raw: R;
|
|
14
|
+
}): Promise<MaybeRaw<R, WatchFolder[]>>;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves a watch folder by its ID
|
|
17
|
+
* @param orgName Name of the organization
|
|
18
|
+
* @param spaceName Name of the space
|
|
19
|
+
* @param watchFolderId Database ID of the watch folder
|
|
20
|
+
* @returns Requested watch folder
|
|
21
|
+
*/
|
|
22
|
+
getWatchFolder<R extends boolean = false>(orgName: string, spaceName: string, watchFolderId: string, raw?: {
|
|
23
|
+
raw: R;
|
|
24
|
+
}): Promise<MaybeRaw<R, WatchFolder>>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new watch folder in the specified space
|
|
27
|
+
* @param orgName Name of the organization
|
|
28
|
+
* @param spaceName Name of the space
|
|
29
|
+
* @param watchFolder Watch folder creation data
|
|
30
|
+
* @returns Created watch folder
|
|
31
|
+
*/
|
|
32
|
+
createWatchFolder<R extends boolean = false>(orgName: string, spaceName: string, watchFolder: CreateWatchFolder, raw?: {
|
|
33
|
+
raw: R;
|
|
34
|
+
}): Promise<MaybeRaw<R, WatchFolder>>;
|
|
35
|
+
/**
|
|
36
|
+
* Updates an existing watch folder
|
|
37
|
+
* @param orgName Name of the organization
|
|
38
|
+
* @param spaceName Name of the space
|
|
39
|
+
* @param watchFolderId Database ID of the watch folder
|
|
40
|
+
* @param patch Fields to update
|
|
41
|
+
* @returns Updated watch folder
|
|
42
|
+
*/
|
|
43
|
+
updateWatchFolder<R extends boolean = false>(orgName: string, spaceName: string, watchFolderId: string, patchWatchFolder: PatchWatchFolder, raw?: {
|
|
44
|
+
raw: R;
|
|
45
|
+
}): Promise<MaybeRaw<R, WatchFolder>>;
|
|
46
|
+
/**
|
|
47
|
+
* Permanently deletes a watch folder
|
|
48
|
+
* @param orgName Name of the organization
|
|
49
|
+
* @param spaceName Name of the space
|
|
50
|
+
* @param watchFolderId Database ID of the watch folder
|
|
51
|
+
*/
|
|
52
|
+
deleteWatchFolder<R extends boolean = false>(orgName: string, spaceName: string, watchFolderId: string, raw?: {
|
|
53
|
+
raw: R;
|
|
54
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the scan configuration (including decrypted credentials) for the agent that
|
|
57
|
+
* received this watch folder's scan dispatch
|
|
58
|
+
* @param orgName Name of the organization
|
|
59
|
+
* @param spaceName Name of the space
|
|
60
|
+
* @param watchFolderId Database ID of the watch folder
|
|
61
|
+
* @param scanSecret One-time secret handed out with the scan's NATS dispatch
|
|
62
|
+
* @returns Scan configuration
|
|
63
|
+
*/
|
|
64
|
+
getWatchFolderScanConfig<R extends boolean = false>(orgName: string, spaceName: string, watchFolderId: string, scanSecret: string, raw?: {
|
|
65
|
+
raw: R;
|
|
66
|
+
}): Promise<MaybeRaw<R, WatchFolderScanConfig>>;
|
|
67
|
+
/**
|
|
68
|
+
* Submits a scan report with the list of files discovered by the agent
|
|
69
|
+
* @param orgName Name of the organization
|
|
70
|
+
* @param spaceName Name of the space
|
|
71
|
+
* @param watchFolderId Database ID of the watch folder
|
|
72
|
+
* @param scanSecret One-time secret handed out with the scan's NATS dispatch
|
|
73
|
+
* @param report Scan report containing the list of discovered files
|
|
74
|
+
*/
|
|
75
|
+
submitScanReport<R extends boolean = false>(orgName: string, spaceName: string, watchFolderId: string, scanSecret: string, report: WatchFolderScanReport, raw?: {
|
|
76
|
+
raw: R;
|
|
77
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
78
|
+
/**
|
|
79
|
+
* Retrieves the list of files currently tracked by a watch folder
|
|
80
|
+
* @param orgName Name of the organization
|
|
81
|
+
* @param spaceName Name of the space
|
|
82
|
+
* @param watchFolderId Database ID of the watch folder
|
|
83
|
+
* @returns Array of tracked file entries
|
|
84
|
+
*/
|
|
85
|
+
getWatchFolderFiles<R extends boolean = false>(orgName: string, spaceName: string, watchFolderId: string, raw?: {
|
|
86
|
+
raw: R;
|
|
87
|
+
}): Promise<MaybeRaw<R, WatchFolderFile[]>>;
|
|
88
|
+
protected getEndpoint(endpoint: string): string;
|
|
89
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
exports.High5WatchFolder = void 0;
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
17
|
+
class High5WatchFolder extends Base_1.default {
|
|
18
|
+
constructor(options, axios) {
|
|
19
|
+
super(options, axios);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves all watch folders the current user is assigned to as target, directly or
|
|
23
|
+
* through a pool. Used mostly by idp to compute NATS permissions and by the agent to join
|
|
24
|
+
* the watch folders it is already assigned to on startup/reconnect
|
|
25
|
+
* @returns Array of watch folders
|
|
26
|
+
*/
|
|
27
|
+
getWatchFolders(raw) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const resp = yield this.axios.get(this.getEndpoint("/v1/watchfolders"));
|
|
30
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves a watch folder by its ID
|
|
35
|
+
* @param orgName Name of the organization
|
|
36
|
+
* @param spaceName Name of the space
|
|
37
|
+
* @param watchFolderId Database ID of the watch folder
|
|
38
|
+
* @returns Requested watch folder
|
|
39
|
+
*/
|
|
40
|
+
getWatchFolder(orgName, spaceName, watchFolderId, raw) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/watchfolders/${watchFolderId}`));
|
|
43
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new watch folder in the specified space
|
|
48
|
+
* @param orgName Name of the organization
|
|
49
|
+
* @param spaceName Name of the space
|
|
50
|
+
* @param watchFolder Watch folder creation data
|
|
51
|
+
* @returns Created watch folder
|
|
52
|
+
*/
|
|
53
|
+
createWatchFolder(orgName, spaceName, watchFolder, raw) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/watchfolders`), watchFolder);
|
|
56
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Updates an existing watch folder
|
|
61
|
+
* @param orgName Name of the organization
|
|
62
|
+
* @param spaceName Name of the space
|
|
63
|
+
* @param watchFolderId Database ID of the watch folder
|
|
64
|
+
* @param patch Fields to update
|
|
65
|
+
* @returns Updated watch folder
|
|
66
|
+
*/
|
|
67
|
+
updateWatchFolder(orgName, spaceName, watchFolderId, patchWatchFolder, raw) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/watchfolders/${watchFolderId}`), patchWatchFolder);
|
|
70
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Permanently deletes a watch folder
|
|
75
|
+
* @param orgName Name of the organization
|
|
76
|
+
* @param spaceName Name of the space
|
|
77
|
+
* @param watchFolderId Database ID of the watch folder
|
|
78
|
+
*/
|
|
79
|
+
deleteWatchFolder(orgName, spaceName, watchFolderId, raw) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/watchfolders/${watchFolderId}`));
|
|
82
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves the scan configuration (including decrypted credentials) for the agent that
|
|
87
|
+
* received this watch folder's scan dispatch
|
|
88
|
+
* @param orgName Name of the organization
|
|
89
|
+
* @param spaceName Name of the space
|
|
90
|
+
* @param watchFolderId Database ID of the watch folder
|
|
91
|
+
* @param scanSecret One-time secret handed out with the scan's NATS dispatch
|
|
92
|
+
* @returns Scan configuration
|
|
93
|
+
*/
|
|
94
|
+
getWatchFolderScanConfig(orgName, spaceName, watchFolderId, scanSecret, raw) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/watchfolders/${watchFolderId}/scan/${scanSecret}`));
|
|
97
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Submits a scan report with the list of files discovered by the agent
|
|
102
|
+
* @param orgName Name of the organization
|
|
103
|
+
* @param spaceName Name of the space
|
|
104
|
+
* @param watchFolderId Database ID of the watch folder
|
|
105
|
+
* @param scanSecret One-time secret handed out with the scan's NATS dispatch
|
|
106
|
+
* @param report Scan report containing the list of discovered files
|
|
107
|
+
*/
|
|
108
|
+
submitScanReport(orgName, spaceName, watchFolderId, scanSecret, report, raw) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/watchfolders/${watchFolderId}/scan/${scanSecret}`), report);
|
|
111
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves the list of files currently tracked by a watch folder
|
|
116
|
+
* @param orgName Name of the organization
|
|
117
|
+
* @param spaceName Name of the space
|
|
118
|
+
* @param watchFolderId Database ID of the watch folder
|
|
119
|
+
* @returns Array of tracked file entries
|
|
120
|
+
*/
|
|
121
|
+
getWatchFolderFiles(orgName, spaceName, watchFolderId, raw) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/watchfolders/${watchFolderId}/files`));
|
|
124
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
getEndpoint(endpoint) {
|
|
128
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.High5WatchFolder = High5WatchFolder;
|
|
@@ -60,9 +60,12 @@ class Nats extends Base_1.default {
|
|
|
60
60
|
yield this.sub(entry.subject, (err, data, msg) => {
|
|
61
61
|
var _a, _b;
|
|
62
62
|
(_b = (_a = entry.sub).callback) === null || _b === void 0 ? void 0 : _b.call(_a, err, msg ? msg : {});
|
|
63
|
-
});
|
|
63
|
+
}, entry.options);
|
|
64
64
|
}
|
|
65
|
-
this.natsConnection.reconnect()
|
|
65
|
+
// Do NOT call this.natsConnection.reconnect() here. A previous revision did this unconditionally on every connect() (including the very first one),
|
|
66
|
+
// which forced an immediate, un-awaited disconnect/redial right after the connection above was established and its subscriptions restored - creating a window
|
|
67
|
+
// where a request could be delivered but its reply never made it back (NatsError TIMEOUT), and afterwards NATS core would no longer see any subscriber at all (NatsError 503/"no responders").
|
|
68
|
+
// The connection returned above is already fully connected; forcing another reconnect here serves no purpose and only reintroduces that instability.
|
|
66
69
|
return this.natsConnection;
|
|
67
70
|
});
|
|
68
71
|
}
|
|
@@ -103,7 +106,7 @@ class Nats extends Base_1.default {
|
|
|
103
106
|
}
|
|
104
107
|
} });
|
|
105
108
|
const sub = conn.subscribe(subject, newOptions);
|
|
106
|
-
this.subMap.push({ subject, sub });
|
|
109
|
+
this.subMap.push({ subject, sub, options });
|
|
107
110
|
return sub;
|
|
108
111
|
}
|
|
109
112
|
catch (err) {
|