@opra/core 1.0.0-alpha.3 → 1.0.0-alpha.4

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.
@@ -11,7 +11,6 @@ class ExecutionContext extends strict_typed_events_1.AsyncEventEmitter {
11
11
  this.document = init.document;
12
12
  this.protocol = init.protocol;
13
13
  this.platform = init.platform;
14
- this.platformArgs = init.platformArgs;
15
14
  }
16
15
  addListener(event, listener) {
17
16
  return super.addListener(event, listener);
@@ -65,14 +65,9 @@ class ExpressAdapter extends http_adapter_js_1.HttpAdapter {
65
65
  const createContext = (_req, _res, args) => {
66
66
  const request = http_incoming_interface_js_1.HttpIncoming.from(_req);
67
67
  const response = http_outgoing_interface_js_1.HttpOutgoing.from(_res);
68
- const platformArgs = {
69
- request: _req,
70
- response: _res,
71
- };
72
68
  return new http_context_js_1.HttpContext({
73
69
  adapter: this,
74
70
  platform: this.platform,
75
- platformArgs,
76
71
  request,
77
72
  response,
78
73
  controller: args?.controller,
@@ -8,7 +8,6 @@ export class ExecutionContext extends AsyncEventEmitter {
8
8
  this.document = init.document;
9
9
  this.protocol = init.protocol;
10
10
  this.platform = init.platform;
11
- this.platformArgs = init.platformArgs;
12
11
  }
13
12
  addListener(event, listener) {
14
13
  return super.addListener(event, listener);
@@ -61,14 +61,9 @@ export class ExpressAdapter extends HttpAdapter {
61
61
  const createContext = (_req, _res, args) => {
62
62
  const request = HttpIncoming.from(_req);
63
63
  const response = HttpOutgoing.from(_res);
64
- const platformArgs = {
65
- request: _req,
66
- response: _res,
67
- };
68
64
  return new HttpContext({
69
65
  adapter: this,
70
66
  platform: this.platform,
71
- platformArgs,
72
67
  request,
73
68
  response,
74
69
  controller: args?.controller,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/core",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.4",
4
4
  "description": "Opra schema package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -21,8 +21,8 @@
21
21
  "lint": "eslint . --max-warnings=0",
22
22
  "check": "madge --circular src/**",
23
23
  "format": "prettier . --write --log-level=warn",
24
- "test": "jest",
25
- "cover": "jest --collect-coverage",
24
+ "test": "jest --passWithNoTests",
25
+ "cover": "jest --passWithNoTests --collect-coverage",
26
26
  "clean": "npm run clean:src && npm run clean:test && npm run clean:dist && npm run clean:cover",
27
27
  "clean:src": "ts-cleanup -s src --all",
28
28
  "clean:test": "ts-cleanup -s test --all",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@browsery/type-is": "^1.6.18-r2",
34
- "@opra/common": "^1.0.0-alpha.3",
34
+ "@opra/common": "^1.0.0-alpha.4",
35
35
  "@types/formidable": "^3.4.5",
36
36
  "accepts": "^1.3.8",
37
37
  "base64-stream": "^1.0.0",
@@ -8,7 +8,6 @@ export declare namespace ExecutionContext {
8
8
  document: ApiDocument;
9
9
  protocol: OpraSchema.Protocol;
10
10
  platform: string;
11
- platformArgs: any;
12
11
  }
13
12
  type OnFinishListener = (error: Error | undefined, context: ExecutionContext) => void | Promise<void>;
14
13
  }
@@ -19,7 +18,6 @@ export declare abstract class ExecutionContext extends AsyncEventEmitter {
19
18
  readonly document: ApiDocument;
20
19
  readonly protocol: OpraSchema.Protocol;
21
20
  readonly platform: string;
22
- readonly platformArgs: any;
23
21
  protected constructor(init: ExecutionContext.Initiator);
24
22
  addListener(event: 'finish', listener: ExecutionContext.OnFinishListener): this;
25
23
  removeListener(event: 'finish', listener: ExecutionContext.OnFinishListener): this;
@@ -1,21 +0,0 @@
1
- {
2
- "BAD_REQUEST": "Bad request",
3
- "FAILED_DEPENDENCY": "The request failed due to failure of a previous request",
4
- "FORBIDDEN": "You are not authorized to perform this action",
5
- "INTERNAL_SERVER_ERROR": "Internal server error",
6
- "METHOD_NOT_ALLOWED": "Method not allowed",
7
- "NOT_ACCEPTABLE": "Not acceptable",
8
- "NOT_FOUND": "Not found",
9
- "UNAUTHORIZED": "You have not been authenticated to perform this action",
10
- "UNPROCESSABLE_ENTITY": "Unprocessable entity",
11
- "REQUEST_VALIDATION": "Request validation failed",
12
- "RESPONSE_VALIDATION": "Response validation failed",
13
- "RESOURCE_NOT_AVAILABLE": "Resource is not available or you dont have access",
14
- "RESOURCE_CONFLICT": "There is already an other {{resource}} resource with same field values ({{fields}})",
15
- "OPERATION_FORBIDDEN": "The {{resource}} resource does not accept '{{operation}}' operations",
16
- "ACTION_NOT_FOUND": "The {{resource}} resource doesn't have an action named '{{action}}'",
17
- "UNKNOWN_FIELD": "Unknown field '{{field}}'",
18
- "UNACCEPTED_SORT_FIELD": "Field '{{field}}' is not available for sort operation",
19
- "UNACCEPTED_FILTER_FIELD": "Field '{{field}}' is not available for filter operation",
20
- "UNACCEPTED_FILTER_OPERATION": "'{{operation}}' for field '{{field}}' is not available for filter operation"
21
- }