@opra/core 0.28.1 → 0.29.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.
- package/cjs/http/http-adapter-host.js +15 -5
- package/esm/http/http-adapter-host.js +15 -5
- package/package.json +2 -2
- package/types/augmentation/collection.augmentation.d.ts +1 -1
- package/types/augmentation/singleton.augmentation.d.ts +1 -1
- package/types/augmentation/storage.augmentation.d.ts +1 -1
- package/types/platform-adapter.host.d.ts +2 -2
- package/types/request.d.ts +2 -2
- package/types/request.host.d.ts +2 -2
|
@@ -195,7 +195,9 @@ class HttpAdapterHost extends platform_adapter_host_js_1.PlatformAdapterHost {
|
|
|
195
195
|
case 'POST': {
|
|
196
196
|
if (p.key == null) {
|
|
197
197
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'create');
|
|
198
|
-
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
198
|
+
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
199
|
+
limit: endpoint.options.inputMaxContentSize
|
|
200
|
+
}, endpoint);
|
|
199
201
|
let data = await jsonReader(incoming);
|
|
200
202
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
201
203
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -284,7 +286,9 @@ class HttpAdapterHost extends platform_adapter_host_js_1.PlatformAdapterHost {
|
|
|
284
286
|
case 'PATCH': {
|
|
285
287
|
if (p.key != null) {
|
|
286
288
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'update');
|
|
287
|
-
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
289
|
+
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
290
|
+
limit: endpoint.options.inputMaxContentSize
|
|
291
|
+
}, endpoint);
|
|
288
292
|
let data = await jsonReader(incoming);
|
|
289
293
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
290
294
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -305,7 +309,9 @@ class HttpAdapterHost extends platform_adapter_host_js_1.PlatformAdapterHost {
|
|
|
305
309
|
});
|
|
306
310
|
}
|
|
307
311
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'updateMany');
|
|
308
|
-
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
312
|
+
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
313
|
+
limit: endpoint.options.inputMaxContentSize
|
|
314
|
+
}, endpoint);
|
|
309
315
|
let data = await jsonReader(incoming);
|
|
310
316
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
311
317
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -335,7 +341,9 @@ class HttpAdapterHost extends platform_adapter_host_js_1.PlatformAdapterHost {
|
|
|
335
341
|
switch (incoming.method) {
|
|
336
342
|
case 'POST': {
|
|
337
343
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'create');
|
|
338
|
-
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
344
|
+
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
345
|
+
limit: endpoint.options.inputMaxContentSize
|
|
346
|
+
}, endpoint);
|
|
339
347
|
let data = await jsonReader(incoming);
|
|
340
348
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
341
349
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -385,7 +393,9 @@ class HttpAdapterHost extends platform_adapter_host_js_1.PlatformAdapterHost {
|
|
|
385
393
|
}
|
|
386
394
|
case 'PATCH': {
|
|
387
395
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'update');
|
|
388
|
-
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
396
|
+
const jsonReader = (0, json_body_loader_js_1.jsonBodyLoader)({
|
|
397
|
+
limit: endpoint.options.inputMaxContentSize
|
|
398
|
+
}, endpoint);
|
|
389
399
|
let data = await jsonReader(incoming);
|
|
390
400
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
391
401
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -191,7 +191,9 @@ export class HttpAdapterHost extends PlatformAdapterHost {
|
|
|
191
191
|
case 'POST': {
|
|
192
192
|
if (p.key == null) {
|
|
193
193
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'create');
|
|
194
|
-
const jsonReader = jsonBodyLoader({
|
|
194
|
+
const jsonReader = jsonBodyLoader({
|
|
195
|
+
limit: endpoint.options.inputMaxContentSize
|
|
196
|
+
}, endpoint);
|
|
195
197
|
let data = await jsonReader(incoming);
|
|
196
198
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
197
199
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -280,7 +282,9 @@ export class HttpAdapterHost extends PlatformAdapterHost {
|
|
|
280
282
|
case 'PATCH': {
|
|
281
283
|
if (p.key != null) {
|
|
282
284
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'update');
|
|
283
|
-
const jsonReader = jsonBodyLoader({
|
|
285
|
+
const jsonReader = jsonBodyLoader({
|
|
286
|
+
limit: endpoint.options.inputMaxContentSize
|
|
287
|
+
}, endpoint);
|
|
284
288
|
let data = await jsonReader(incoming);
|
|
285
289
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
286
290
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -301,7 +305,9 @@ export class HttpAdapterHost extends PlatformAdapterHost {
|
|
|
301
305
|
});
|
|
302
306
|
}
|
|
303
307
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'updateMany');
|
|
304
|
-
const jsonReader = jsonBodyLoader({
|
|
308
|
+
const jsonReader = jsonBodyLoader({
|
|
309
|
+
limit: endpoint.options.inputMaxContentSize
|
|
310
|
+
}, endpoint);
|
|
305
311
|
let data = await jsonReader(incoming);
|
|
306
312
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
307
313
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -331,7 +337,9 @@ export class HttpAdapterHost extends PlatformAdapterHost {
|
|
|
331
337
|
switch (incoming.method) {
|
|
332
338
|
case 'POST': {
|
|
333
339
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'create');
|
|
334
|
-
const jsonReader = jsonBodyLoader({
|
|
340
|
+
const jsonReader = jsonBodyLoader({
|
|
341
|
+
limit: endpoint.options.inputMaxContentSize
|
|
342
|
+
}, endpoint);
|
|
335
343
|
let data = await jsonReader(incoming);
|
|
336
344
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
337
345
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
|
@@ -381,7 +389,9 @@ export class HttpAdapterHost extends PlatformAdapterHost {
|
|
|
381
389
|
}
|
|
382
390
|
case 'PATCH': {
|
|
383
391
|
const { controller, endpoint, handler } = await this.getOperationHandler(resource, 'update');
|
|
384
|
-
const jsonReader = jsonBodyLoader({
|
|
392
|
+
const jsonReader = jsonBodyLoader({
|
|
393
|
+
limit: endpoint.options.inputMaxContentSize
|
|
394
|
+
}, endpoint);
|
|
385
395
|
let data = await jsonReader(incoming);
|
|
386
396
|
data = endpoint.decodeInput(data, { coerce: true });
|
|
387
397
|
const params = this.parseParameters(endpoint.parameters, searchParams);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.1",
|
|
4
4
|
"description": "Opra schema package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@browsery/type-is": "^0.6.3",
|
|
31
|
-
"@opra/common": "^0.
|
|
31
|
+
"@opra/common": "^0.29.1",
|
|
32
32
|
"accepts": "^1.3.8",
|
|
33
33
|
"content-disposition": "^0.5.4",
|
|
34
34
|
"content-type": "^1.0.5",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StrictOmit } from 'ts-gems';
|
|
2
|
-
import type { Action as _Action,
|
|
2
|
+
import type { Action as _Action, CrudOperation as _Operation, PartialOutput } from '@opra/common';
|
|
3
3
|
import type { Request as _Request } from '../request.js';
|
|
4
4
|
import type { RequestContext } from '../request-context';
|
|
5
5
|
declare module "@opra/common" {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StrictOmit } from 'ts-gems';
|
|
2
|
-
import type { Action as _Action,
|
|
2
|
+
import type { Action as _Action, CrudOperation as _Operation, PartialOutput } from '@opra/common';
|
|
3
3
|
import type { Request as _Request } from '../request.js';
|
|
4
4
|
import type { RequestContext } from '../request-context.js';
|
|
5
5
|
declare module "@opra/common" {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StrictOmit } from 'ts-gems';
|
|
2
|
-
import type { Action as _Action,
|
|
2
|
+
import type { Action as _Action, CrudOperation as _Operation } from '@opra/common';
|
|
3
3
|
import type { MultipartIterator } from '../http/helpers/multipart-helper';
|
|
4
4
|
import type { Request as _Request } from '../request.js';
|
|
5
5
|
import type { RequestContext } from '../request-context.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './augmentation/18n.augmentation.js';
|
|
2
2
|
import { AsyncEventEmitter } from 'strict-typed-events';
|
|
3
|
-
import { Action, ApiDocument,
|
|
3
|
+
import { Action, ApiDocument, CrudOperation, I18n, Resource } from '@opra/common';
|
|
4
4
|
import { ExecutionContext } from './execution-context.js';
|
|
5
5
|
import { Interceptor } from './interfaces/interceptor.interface.js';
|
|
6
6
|
import type { PlatformAdapter, Protocol } from './platform-adapter.js';
|
|
@@ -34,7 +34,7 @@ export declare abstract class PlatformAdapterHost extends AsyncEventEmitter impl
|
|
|
34
34
|
handler: Function;
|
|
35
35
|
}>;
|
|
36
36
|
getOperationHandler(resource: Resource | string, name: string): Promise<{
|
|
37
|
-
endpoint:
|
|
37
|
+
endpoint: CrudOperation;
|
|
38
38
|
controller: any;
|
|
39
39
|
handler: Function;
|
|
40
40
|
}>;
|
package/types/request.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Action,
|
|
1
|
+
import { Action, CrudOperation, Resource } from '@opra/common';
|
|
2
2
|
import { HttpServerRequest } from './http/http-server-request.js';
|
|
3
3
|
export interface Request {
|
|
4
4
|
resource: Resource;
|
|
5
|
-
endpoint: Action |
|
|
5
|
+
endpoint: Action | CrudOperation;
|
|
6
6
|
key?: any;
|
|
7
7
|
controller: Object;
|
|
8
8
|
handler: Function;
|
package/types/request.host.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PartialSome, StrictOmit } from 'ts-gems';
|
|
2
2
|
import type { Resource } from '@opra/common';
|
|
3
|
-
import { Action,
|
|
3
|
+
import { Action, CrudOperation } from '@opra/common';
|
|
4
4
|
import type { HttpServerRequest } from './http/http-server-request.js';
|
|
5
5
|
import type { Request } from './request.js';
|
|
6
6
|
export declare namespace RequestHost {
|
|
@@ -15,7 +15,7 @@ export interface RequestHost extends Request {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class RequestHost implements Request {
|
|
17
17
|
controller: any;
|
|
18
|
-
endpoint: Action |
|
|
18
|
+
endpoint: Action | CrudOperation;
|
|
19
19
|
http?: HttpServerRequest;
|
|
20
20
|
key?: any;
|
|
21
21
|
params: Record<string, any>;
|