@opra/kafka 1.4.4 → 1.5.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.
@@ -55,6 +55,9 @@ class KafkaAdapter extends core_1.PlatformAdapter {
55
55
  get kafka() {
56
56
  return this._kafka;
57
57
  }
58
+ get scope() {
59
+ return this._config.scope;
60
+ }
58
61
  get status() {
59
62
  return this._status;
60
63
  }
@@ -280,9 +283,11 @@ class KafkaAdapter extends core_1.PlatformAdapter {
280
283
  const parsePayload = request_parser_js_1.RequestParser.STRING;
281
284
  /** Prepare decoders */
282
285
  const decodeKey = operation.keyType?.generateCodec('decode', {
286
+ scope: this.scope,
283
287
  ignoreWriteonlyFields: true,
284
288
  }) || valgen_1.vg.isAny();
285
289
  const decodePayload = operation.payloadType?.generateCodec('decode', {
290
+ scope: this.scope,
286
291
  ignoreWriteonlyFields: true,
287
292
  }) || valgen_1.vg.isAny();
288
293
  operation.headers.forEach(header => {
@@ -290,6 +295,7 @@ class KafkaAdapter extends core_1.PlatformAdapter {
290
295
  if (!decode) {
291
296
  decode =
292
297
  header.type?.generateCodec('decode', {
298
+ scope: this.scope,
293
299
  ignoreReadonlyFields: true,
294
300
  }) || valgen_1.vg.isAny();
295
301
  this[core_1.kAssetCache].set(header, 'decode', decode);
@@ -52,6 +52,9 @@ export class KafkaAdapter extends PlatformAdapter {
52
52
  get kafka() {
53
53
  return this._kafka;
54
54
  }
55
+ get scope() {
56
+ return this._config.scope;
57
+ }
55
58
  get status() {
56
59
  return this._status;
57
60
  }
@@ -277,9 +280,11 @@ export class KafkaAdapter extends PlatformAdapter {
277
280
  const parsePayload = RequestParser.STRING;
278
281
  /** Prepare decoders */
279
282
  const decodeKey = operation.keyType?.generateCodec('decode', {
283
+ scope: this.scope,
280
284
  ignoreWriteonlyFields: true,
281
285
  }) || vg.isAny();
282
286
  const decodePayload = operation.payloadType?.generateCodec('decode', {
287
+ scope: this.scope,
283
288
  ignoreWriteonlyFields: true,
284
289
  }) || vg.isAny();
285
290
  operation.headers.forEach(header => {
@@ -287,6 +292,7 @@ export class KafkaAdapter extends PlatformAdapter {
287
292
  if (!decode) {
288
293
  decode =
289
294
  header.type?.generateCodec('decode', {
295
+ scope: this.scope,
290
296
  ignoreReadonlyFields: true,
291
297
  }) || vg.isAny();
292
298
  this[kAssetCache].set(header, 'decode', decode);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@opra/kafka",
3
- "version": "1.4.4",
3
+ "version": "1.5.1",
4
4
  "description": "Opra Kafka package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
- "@opra/common": "^1.4.4",
9
- "@opra/core": "^1.4.4",
8
+ "@opra/common": "^1.5.1",
9
+ "@opra/core": "^1.5.1",
10
10
  "node-events-async": "^1.0.0",
11
11
  "tslib": "^2.8.1",
12
12
  "valgen": "^5.12.0"
@@ -29,7 +29,6 @@ export declare class KafkaAdapter extends PlatformAdapter {
29
29
  protected _handlerArgs: HandlerArguments[];
30
30
  protected _kafka: Kafka;
31
31
  protected _status: KafkaAdapter.Status;
32
- protected _starting?: boolean;
33
32
  readonly protocol: OpraSchema.Transport;
34
33
  readonly platform = "kafka";
35
34
  readonly interceptors: (KafkaAdapter.InterceptorFunction | KafkaAdapter.IKafkaInterceptor)[];
@@ -42,6 +41,7 @@ export declare class KafkaAdapter extends PlatformAdapter {
42
41
  constructor(document: ApiDocument, config: KafkaAdapter.Config);
43
42
  get api(): RpcApi;
44
43
  get kafka(): Kafka;
44
+ get scope(): string | undefined;
45
45
  get status(): KafkaAdapter.Status;
46
46
  initialize(): Promise<void>;
47
47
  /**
@@ -101,6 +101,7 @@ export declare namespace KafkaAdapter {
101
101
  fromBeginning?: boolean;
102
102
  };
103
103
  };
104
+ scope?: string;
104
105
  interceptors?: (InterceptorFunction | IKafkaInterceptor)[];
105
106
  logExtra?: boolean;
106
107
  }