@opra/core 1.0.3 → 1.0.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.
@@ -10,11 +10,14 @@ const constants_js_1 = require("./constants.js");
10
10
  * @class PlatformAdapter
11
11
  */
12
12
  class PlatformAdapter extends node_events_async_1.AsyncEventEmitter {
13
- constructor(document, options) {
13
+ constructor(options) {
14
14
  super();
15
15
  this[constants_js_1.kAssetCache] = new asset_cache_js_1.AssetCache();
16
- this.document = document;
17
16
  this.i18n = options?.i18n || common_1.I18n.defaultInstance;
17
+ this.logger = options?.logger;
18
+ }
19
+ get document() {
20
+ return this._document;
18
21
  }
19
22
  }
20
23
  exports.PlatformAdapter = PlatformAdapter;
@@ -7,10 +7,13 @@ import { kAssetCache } from './constants.js';
7
7
  * @class PlatformAdapter
8
8
  */
9
9
  export class PlatformAdapter extends AsyncEventEmitter {
10
- constructor(document, options) {
10
+ constructor(options) {
11
11
  super();
12
12
  this[kAssetCache] = new AssetCache();
13
- this.document = document;
14
13
  this.i18n = options?.i18n || I18n.defaultInstance;
14
+ this.logger = options?.logger;
15
+ }
16
+ get document() {
17
+ return this._document;
15
18
  }
16
19
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@opra/core",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Opra schema package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
- "@opra/common": "^1.0.3",
8
+ "@opra/common": "^1.0.5",
9
9
  "node-events-async": "^1.0.0",
10
10
  "reflect-metadata": "^0.2.2",
11
- "tslib": "^2.7.0"
11
+ "tslib": "^2.8.0"
12
12
  },
13
13
  "type": "module",
14
14
  "exports": {
@@ -1,4 +1,4 @@
1
- import { ApiDocument, OpraHttpError, OpraSchema } from '@opra/common';
1
+ import { ApiDocument, OpraException, OpraSchema } from '@opra/common';
2
2
  import { AsyncEventEmitter } from 'node-events-async';
3
3
  /**
4
4
  * @namespace ExecutionContext
@@ -18,6 +18,6 @@ export declare abstract class ExecutionContext extends AsyncEventEmitter {
18
18
  readonly document: ApiDocument;
19
19
  readonly protocol: OpraSchema.Transport;
20
20
  readonly platform: string;
21
- errors: OpraHttpError[];
21
+ errors: OpraException[];
22
22
  protected constructor(init: ExecutionContext.Initiator);
23
23
  }
@@ -18,10 +18,11 @@ export declare namespace PlatformAdapter {
18
18
  */
19
19
  export declare abstract class PlatformAdapter extends AsyncEventEmitter {
20
20
  protected [kAssetCache]: AssetCache;
21
- readonly document: ApiDocument;
21
+ protected _document: ApiDocument;
22
22
  abstract readonly protocol: OpraSchema.Transport;
23
23
  i18n: I18n;
24
24
  logger?: ILogger;
25
- protected constructor(document: ApiDocument, options?: PlatformAdapter.Options);
25
+ protected constructor(options?: PlatformAdapter.Options);
26
+ get document(): ApiDocument;
26
27
  abstract close(): Promise<void>;
27
28
  }