@rsdk/nats.object-storage 5.6.0-next.4 → 5.6.0-next.5
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.
|
@@ -5,6 +5,11 @@ export type WatchConfig = {
|
|
|
5
5
|
includeHistory?: boolean;
|
|
6
6
|
connectionName?: string;
|
|
7
7
|
domain?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Flag indicating whether the readiness probe for bucket is optional.
|
|
10
|
+
* If set to `true`, an error in the probe will not affect the global system status.
|
|
11
|
+
*/
|
|
12
|
+
isOptionalIndicator?: boolean;
|
|
8
13
|
};
|
|
9
14
|
export interface ObjectStorageWatcher {
|
|
10
15
|
onDelete(entry: ObjectInfo | null): Promise<void>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WatchObjectStorage = exports.WatchObjectStorageMetadata = exports.WATCH_NATS_OBJECT_STORAGE_KEY = void 0;
|
|
4
4
|
const core_1 = require("@nestjs/core");
|
|
5
|
+
const common_1 = require("@rsdk/common");
|
|
5
6
|
const metadata_1 = require("@rsdk/metadata");
|
|
6
7
|
const nats_common_1 = require("@rsdk/nats.common");
|
|
7
8
|
/**
|
|
@@ -22,11 +23,12 @@ const WatchObjectStorage = (config) => {
|
|
|
22
23
|
return (target) => {
|
|
23
24
|
(0, exports.WatchObjectStorageMetadata)(config)(target);
|
|
24
25
|
const streamName = `OBJ_${config.bucket}`;
|
|
25
|
-
const moduleDefinition = nats_common_1.NatsStreamIndicatorModuleGenerator.createClientModuleDefinition(target, {
|
|
26
|
+
const moduleDefinition = nats_common_1.NatsStreamIndicatorModuleGenerator.createClientModuleDefinition(target, (0, common_1.omitUndefined)({
|
|
26
27
|
streamName,
|
|
27
28
|
connectionName: config.connectionName,
|
|
28
29
|
domain: config.domain,
|
|
29
|
-
|
|
30
|
+
isOptional: config.isOptionalIndicator,
|
|
31
|
+
}));
|
|
30
32
|
metadata_1.RsdkMetadata.setWithScope(target, metadata_1.PLATFORM_RAW_GLOBAL_METADATA_SCOPE, (0, nats_common_1.getStreamIndicatorKey)(streamName, config.connectionName, config.domain), moduleDefinition, true);
|
|
31
33
|
};
|
|
32
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-object-storage.decorator.js","sourceRoot":"","sources":["../src/watch-object-storage.decorator.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AACzC,6CAGwB;AACxB,mDAG2B;
|
|
1
|
+
{"version":3,"file":"watch-object-storage.decorator.js","sourceRoot":"","sources":["../src/watch-object-storage.decorator.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AACzC,yCAA6C;AAC7C,6CAGwB;AACxB,mDAG2B;AAsB3B;;GAEG;AACU,QAAA,6BAA6B,GAAG,2BAA2B,CAAC;AAE5D,QAAA,0BAA0B,GACrC,gBAAS,CAAC,eAAe,CAAc;IACrC,GAAG,EAAE,qCAA6B;CACnC,CAAC,CAAC;AAEL;;;;;;GAMG;AACI,MAAM,kBAAkB,GAAG,CAAC,MAAmB,EAAkB,EAAE;IACxE,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,IAAA,kCAA0B,EAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;QAE3C,MAAM,UAAU,GAAG,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;QAC1C,MAAM,gBAAgB,GACpB,gDAAkC,CAAC,4BAA4B,CAC7D,MAAM,EACN,IAAA,sBAAa,EAAC;YACZ,UAAU;YACV,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,UAAU,EAAE,MAAM,CAAC,mBAAmB;SACvC,CAAC,CACH,CAAC;QAEJ,uBAAY,CAAC,YAAY,CACvB,MAAM,EACN,6CAAkC,EAClC,IAAA,mCAAqB,EAAC,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,EACvE,gBAAgB,EAChB,IAAI,CACL,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,kBAAkB,sBAwB7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/nats.object-storage",
|
|
3
|
-
"version": "5.6.0-next.
|
|
3
|
+
"version": "5.6.0-next.5",
|
|
4
4
|
"description": "Nats NestJS object storage",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "Apache License 2.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"rxjs": "^7.8.1"
|
|
39
39
|
},
|
|
40
40
|
"nx": {},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "754d114b6ef5c9d30dc844735a00b6155784bf1f"
|
|
42
42
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Reflector } from '@nestjs/core';
|
|
2
|
+
import { omitUndefined } from '@rsdk/common';
|
|
2
3
|
import {
|
|
3
4
|
PLATFORM_RAW_GLOBAL_METADATA_SCOPE,
|
|
4
5
|
RsdkMetadata,
|
|
@@ -15,6 +16,12 @@ export type WatchConfig = {
|
|
|
15
16
|
includeHistory?: boolean;
|
|
16
17
|
connectionName?: string;
|
|
17
18
|
domain?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Flag indicating whether the readiness probe for bucket is optional.
|
|
22
|
+
* If set to `true`, an error in the probe will not affect the global system status.
|
|
23
|
+
*/
|
|
24
|
+
isOptionalIndicator?: boolean;
|
|
18
25
|
};
|
|
19
26
|
|
|
20
27
|
export interface ObjectStorageWatcher {
|
|
@@ -45,11 +52,15 @@ export const WatchObjectStorage = (config: WatchConfig): ClassDecorator => {
|
|
|
45
52
|
|
|
46
53
|
const streamName = `OBJ_${config.bucket}`;
|
|
47
54
|
const moduleDefinition =
|
|
48
|
-
NatsStreamIndicatorModuleGenerator.createClientModuleDefinition(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
NatsStreamIndicatorModuleGenerator.createClientModuleDefinition(
|
|
56
|
+
target,
|
|
57
|
+
omitUndefined({
|
|
58
|
+
streamName,
|
|
59
|
+
connectionName: config.connectionName,
|
|
60
|
+
domain: config.domain,
|
|
61
|
+
isOptional: config.isOptionalIndicator,
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
53
64
|
|
|
54
65
|
RsdkMetadata.setWithScope(
|
|
55
66
|
target,
|