hcloud-sdk 22.22.0 → 22.23.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,19 @@
1
- ## [22.22.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.21.0...v22.22.0) (2026-08-25)
1
+ ## [22.23.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.22.0...v22.23.0) (2026-08-25)
2
2
 
3
3
  ### Features
4
4
 
5
- * update error codes ([a4056ff](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/a4056ff61c23f61aea934e4b59228dfd79587591))
5
+ * add WatchFolder name validation rules ([de335cf](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/de335cf5b811715f5aef4e1f717a529c257449ac))
6
+ * **auditor:** add WatchFolder event ([1b6f682](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/1b6f6821b51e00ba853feca8e9897771611703e8))
7
+ * **ci:** move release trigger to main ([8128658](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/81286583958ee1a576ab2004f609cc2506b1a7a1))
8
+ * **high5:** add WatchFolder interfaces and methods ([dae83d6](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/dae83d63e00056d40cf4a03753e2d42e83021678))
9
+ * implement metadata for comments, replies and annotations ([e0cbf51](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/e0cbf51d9a080689b07d5d4d431a2db5f7eea64c))
10
+ * implement metadata for comments, replies and annotations ([4aad210](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/4aad2100fd7155b4daa94fd1925c095a492230a0))
11
+ * implements visibility field in comment to toggle internal and external visibility ([ff52bb4](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/ff52bb463223a39062aa4d398fbb49f552978c0e))
12
+ * **nats:** add watchfolder scan subject & extend WatchFolderObject ([2483d68](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/2483d68078b3cabbf08e6790d1fc91e00361a150))
13
+ * **nats:** add WatchFolder subjects ([02ed6dd](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/02ed6dd39c0d1a47b88358cdd9bf6e6a72f8785d))
14
+ * **watchfolder:** finalize scan API and type fixes ([b248938](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/b248938240cd98b840bf6a08489b2e0d57afe99b))
15
+ * **watchfolder:** return full WatchFolder objects ([1b6829d](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/1b6829d81b8f2829e0edbce0d60ce716ff5bd0bf))
16
+
17
+ ### Bug Fixes
18
+
19
+ * **nats:** preserve queue group on reconnect ([290163b](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/290163b64278c2ae43c47e4146446be8cc239e42))
@@ -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
  };
@@ -41,7 +41,8 @@ export declare enum Event {
41
41
  Group = "group",
42
42
  Tag = "tag",
43
43
  Reference = "reference",
44
- Storage = "storage"
44
+ Storage = "storage",
45
+ WatchFolder = "WatchFolder"
45
46
  }
46
47
  export declare enum Type {
47
48
  Read = "read",
@@ -47,6 +47,7 @@ var Event;
47
47
  Event["Tag"] = "tag";
48
48
  Event["Reference"] = "reference";
49
49
  Event["Storage"] = "storage";
50
+ Event["WatchFolder"] = "WatchFolder";
50
51
  })(Event || (exports.Event = Event = {}));
51
52
  var Type;
52
53
  (function (Type) {
@@ -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 = (_r = class {
401
+ NatsSubjects.Mothership = (_s = class {
384
402
  },
385
- __setFunctionName(_r, "Mothership"),
386
- _r.CONNECTION = (organizationName) => {
403
+ __setFunctionName(_s, "Mothership"),
404
+ _s.CONNECTION = (organizationName) => {
387
405
  return NatsSubjects.replace(NatsSubject.MOTHERSHIP_AGENT_CONNECTION, { organizationName });
388
406
  },
389
- _r);
390
- NatsSubjects.Auditor = (_s = class {
407
+ _s);
408
+ NatsSubjects.Auditor = (_t = class {
391
409
  },
392
- __setFunctionName(_s, "Auditor"),
393
- _s.LOGS = (organizationName) => {
410
+ __setFunctionName(_t, "Auditor"),
411
+ _t.LOGS = (organizationName) => {
394
412
  return NatsSubjects.replace(NatsSubject.AUDITOR_LOGS, { organizationName });
395
413
  },
396
- _s);
414
+ _t);
397
415
  NatsSubjects.Logging = (product) => {
398
416
  return NatsSubjects.replace(NatsSubject.DEBUG_NAMESPACE, { product });
399
417
  };
400
- NatsSubjects.Cosmo = (_t = class {
418
+ NatsSubjects.Cosmo = (_u = class {
401
419
  },
402
- __setFunctionName(_t, "Cosmo"),
403
- _t.SPACES = (organizationName) => {
420
+ __setFunctionName(_u, "Cosmo"),
421
+ _u.SPACES = (organizationName) => {
404
422
  return NatsSubjects.replace(NatsSubject.COSMO_SPACES, { organizationName });
405
423
  },
406
- _t.Space = (_u = class {
424
+ _u.Space = (_v = class {
407
425
  },
408
- __setFunctionName(_u, "Space"),
409
- _u.NAMESPACES = (organizationName, spaceName) => {
426
+ __setFunctionName(_v, "Space"),
427
+ _v.NAMESPACES = (organizationName, spaceName) => {
410
428
  return NatsSubjects.replace(NatsSubject.COSMO_NAMESPACES, { organizationName, spaceName });
411
429
  },
412
- _u.Namespace = (_v = class {
430
+ _v.Namespace = (_w = class {
413
431
  },
414
- __setFunctionName(_v, "Namespace"),
415
- _v.TAGS = (organizationName, spaceName, namespaceName) => {
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
- _v.METADATA = (organizationName, spaceName, namespaceName) => {
436
+ _w.METADATA = (organizationName, spaceName, namespaceName) => {
419
437
  return NatsSubjects.replace(NatsSubject.COSMO_METADATA, { organizationName, spaceName, namespaceName });
420
438
  },
421
- _v),
422
- _u.ASSETS = (organizationName, spaceName) => {
439
+ _w),
440
+ _v.ASSETS = (organizationName, spaceName) => {
423
441
  return NatsSubjects.replace(NatsSubject.COSMO_ASSETS, { organizationName, spaceName });
424
442
  },
425
- _u.STACKS = (organizationName, spaceName) => {
443
+ _v.STACKS = (organizationName, spaceName) => {
426
444
  return NatsSubjects.replace(NatsSubject.COSMO_STACKS, { organizationName, spaceName });
427
445
  },
428
- _u.SHARES = (organizationName, spaceName) => {
446
+ _v.SHARES = (organizationName, spaceName) => {
429
447
  return NatsSubjects.replace(NatsSubject.COSMO_SHARE, { organizationName, spaceName });
430
448
  },
431
- _u.ROLES = (organizationName, spaceName) => {
449
+ _v.ROLES = (organizationName, spaceName) => {
432
450
  return NatsSubjects.replace(NatsSubject.COSMO_ROLES, { organizationName, spaceName });
433
451
  },
434
- _u.Asset = (_w = class {
452
+ _v.Asset = (_x = class {
435
453
  },
436
- __setFunctionName(_w, "Asset"),
437
- _w.COMMENTS = (organizationName, spaceName, namespaceName, assetId) => {
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
- _w.TAGS = (organizationName, spaceName, namespaceName, assetId) => {
458
+ _x.TAGS = (organizationName, spaceName, namespaceName, assetId) => {
441
459
  return NatsSubjects.replace(NatsSubject.COSMO_TAGS_ASSET, { organizationName, spaceName, namespaceName, assetId });
442
460
  },
443
- _w.STATUS = (organizationName, spaceName, namespaceName, assetId) => {
461
+ _x.STATUS = (organizationName, spaceName, namespaceName, assetId) => {
444
462
  return NatsSubjects.replace(NatsSubject.COSMO_STATUS, { organizationName, spaceName, namespaceName, assetId });
445
463
  },
446
- _w),
447
- _u),
448
- _t.ASSETS = (organizationName) => {
464
+ _x),
465
+ _v),
466
+ _u.ASSETS = (organizationName) => {
449
467
  return NatsSubjects.replace(NatsSubject.COSMO_CROSS_SPACES_ASSETS, { organizationName });
450
468
  },
451
- _t);
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) => {
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hcloud-sdk",
3
- "version": "22.22.0",
3
+ "version": "22.23.0",
4
4
  "description": "hcloud platform sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",