@nhtio/lucid-resourceful 0.1.0-master-29dd5a13 → 0.1.0-master-641df8fc
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/adonis-env.d.ts +17 -0
- package/bundled_liqe.d.ts +6 -5
- package/bundled_xml_js.d.ts +5 -4
- package/definitions.d.ts +1 -1
- package/encoding.d.ts +6 -6
- package/errors.d.ts +23 -8
- package/{index-Bsyx9Sty.js → index-B-5JiNqG.js} +76 -221
- package/index-B-5JiNqG.js.map +1 -0
- package/{index-B6dIMDux.cjs → index-BrGbuAtt.cjs} +76 -221
- package/index-BrGbuAtt.cjs.map +1 -0
- package/index-C9zyi90j.js.map +1 -1
- package/{index-CpyTnwZV.cjs → index-CQApAM0M.cjs} +298 -353
- package/index-CQApAM0M.cjs.map +1 -0
- package/index-CxRBayw6.cjs.map +1 -1
- package/{index-C8mGEf4P.js → index-DLVvkVxI.js} +295 -350
- package/index-DLVvkVxI.js.map +1 -0
- package/index-DsojAcQ4.js.map +1 -1
- package/index-DuzIXu31.cjs.map +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +7 -7
- package/index.mjs +1 -1
- package/integration/middlewares/odata_error.cjs +1 -1
- package/integration/middlewares/odata_error.d.ts +1 -1
- package/integration/middlewares/odata_error.mjs +1 -1
- package/integration/middlewares/resourceful_encoded_request.cjs +100 -12
- package/integration/middlewares/resourceful_encoded_request.cjs.map +1 -1
- package/integration/middlewares/resourceful_encoded_request.d.ts +1 -1
- package/integration/middlewares/resourceful_encoded_request.mjs +98 -10
- package/integration/middlewares/resourceful_encoded_request.mjs.map +1 -1
- package/integration/middlewares/resourceful_error.cjs +1 -1
- package/integration/middlewares/resourceful_error.d.ts +1 -1
- package/integration/middlewares/resourceful_error.mjs +1 -1
- package/integration/provider.cjs +1 -1
- package/integration/provider.mjs +1 -1
- package/joi.d.ts +1 -1
- package/{manager-OLS5T3G7-CJHhMwR7.cjs → manager-OLS5T3G7-BPVI59Zw.cjs} +2 -2
- package/{manager-OLS5T3G7-CJHhMwR7.cjs.map → manager-OLS5T3G7-BPVI59Zw.cjs.map} +1 -1
- package/{manager-OLS5T3G7-C-NS6lhx.js → manager-OLS5T3G7-DzVckqOB.js} +2 -2
- package/{manager-OLS5T3G7-C-NS6lhx.js.map → manager-OLS5T3G7-DzVckqOB.js.map} +1 -1
- package/odata/context.d.ts +1 -1
- package/odata/macro.d.ts +1 -1
- package/{odata_error_middleware-BWfOpQZV.cjs → odata_error_middleware-DhLzccN7.cjs} +4 -4
- package/{odata_error_middleware-BWfOpQZV.cjs.map → odata_error_middleware-DhLzccN7.cjs.map} +1 -1
- package/{odata_error_middleware-CWYqZMez.js → odata_error_middleware-Dspi8bct.js} +4 -4
- package/{odata_error_middleware-CWYqZMez.js.map → odata_error_middleware-Dspi8bct.js.map} +1 -1
- package/package.json +1 -1
- package/private/data_type_schemas.d.ts +12 -12
- package/private/data_types.d.ts +1 -1
- package/private/decorator_schemas.d.ts +1 -1
- package/private/decorator_utils.d.ts +1 -1
- package/private/decorators.d.ts +14 -11
- package/private/encoding.d.ts +3 -3
- package/private/joi/index.d.ts +3 -3
- package/private/lucene_to_lucid_translator.d.ts +1 -1
- package/private/mixin.d.ts +25 -8
- package/private/odata_macro/controllers/resourceful_model_controller.d.ts +4 -4
- package/private/odata_macro/index.d.ts +1 -1
- package/private/odata_macro/middlewares/odata_error_middleware.d.ts +22 -10
- package/private/odata_macro/services/odata_context_service.d.ts +1 -1
- package/private/odata_macro/services/odata_metadata_service.d.ts +3 -3
- package/private/odata_macro/utils/odata.d.ts +2 -2
- package/private/odata_to_lucid_translator.d.ts +1 -1
- package/private/open_api_schema_service.d.ts +3 -3
- package/private/router_macro/controllers/resourceful_model_controller.d.ts +5 -5
- package/private/router_macro/index.d.ts +3 -3
- package/private/router_macro/middlewares/resourceful_error_middleware.d.ts +22 -10
- package/private/router_macro/services/resourceful_router_choices_service.d.ts +3 -3
- package/private/router_macro/services/resourceful_router_context_service.d.ts +1 -1
- package/private/router_macro/services/resourceful_router_model_options_service.d.ts +1 -1
- package/private/router_macro/services/resourceful_router_model_resolver_service.d.ts +3 -3
- package/private/router_macro/services/resourceful_router_openapi_document_service.d.ts +4 -4
- package/private/router_macro/services/resourceful_router_options_service.d.ts +3 -3
- package/private/router_macro/types.d.ts +15 -8
- package/private/router_macro/utils/errors.d.ts +1 -1
- package/private/router_macro/utils/http.d.ts +1 -1
- package/private/router_macro/utils/openapi_validation_schemas.d.ts +2 -2
- package/private/router_macro/utils/relationships.d.ts +1 -1
- package/private/router_macro/utils/type_guards.d.ts +1 -1
- package/private/schema_types.d.ts +1 -1
- package/private/type_guards.d.ts +5 -5
- package/private/types.d.ts +5 -5
- package/private/utils/casters.d.ts +1 -1
- package/private/utils/consumers.d.ts +1 -1
- package/private/utils/preparers.d.ts +1 -1
- package/private/utils.d.ts +1 -1
- package/{resourceful_error_middleware-CMSZGdoG.js → resourceful_error_middleware-Cb_eTzST.js} +4 -4
- package/{resourceful_error_middleware-CMSZGdoG.js.map → resourceful_error_middleware-Cb_eTzST.js.map} +1 -1
- package/{resourceful_error_middleware-lXgefPIC.cjs → resourceful_error_middleware-CnjbNoev.cjs} +4 -4
- package/{resourceful_error_middleware-lXgefPIC.cjs.map → resourceful_error_middleware-CnjbNoev.cjs.map} +1 -1
- package/router/context.d.ts +1 -1
- package/router/utils.cjs +1 -1
- package/router/utils.d.ts +1 -1
- package/router/utils.mjs +1 -1
- package/router.cjs +1 -1
- package/router.d.ts +2 -2
- package/router.mjs +1 -1
- package/types.d.ts +13 -13
- package/utils.d.ts +4 -4
- package/vite-env.d.ts +3 -0
- package/index-B6dIMDux.cjs.map +0 -1
- package/index-Bsyx9Sty.js.map +0 -1
- package/index-C8mGEf4P.js.map +0 -1
- package/index-CpIq4gOr.js +0 -93
- package/index-CpIq4gOr.js.map +0 -1
- package/index-CpyTnwZV.cjs.map +0 -1
- package/index-DqbJXpcT.cjs +0 -92
- package/index-DqbJXpcT.cjs.map +0 -1
- package/private/controller_factory.d.ts +0 -1
- package/private/utils/function_serializer.d.ts +0 -32
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { errors } from '@vinejs/vine';
|
|
2
2
|
import { Exception } from '@poppinss/utils';
|
|
3
|
-
import { ValidationError as JoiValidationError } from
|
|
4
|
-
import type { JsonObject } from
|
|
3
|
+
import { ValidationError as JoiValidationError } from "../../../joi";
|
|
4
|
+
import type { JsonObject } from "../../../bundled_type_fest";
|
|
5
5
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
6
6
|
import type { NextFn } from '@adonisjs/core/types/http';
|
|
7
|
-
import type { EventMap } from
|
|
7
|
+
import type { EventMap } from "../../../bundled_nhtio_tiny_typed_emitter";
|
|
8
8
|
/**
|
|
9
9
|
* Type alias for Vine validation errors thrown by the VineJS validation library.
|
|
10
10
|
*
|
|
@@ -34,12 +34,24 @@ export type VineValidationError = InstanceType<typeof errors.E_VALIDATION_ERROR>
|
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
export type ResourcefulErrorMiddlewareEvents = EventMap<{
|
|
37
|
-
vineValidationError: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
vineValidationError: [
|
|
38
|
+
VineValidationError
|
|
39
|
+
];
|
|
40
|
+
joiValidationError: [
|
|
41
|
+
JoiValidationError
|
|
42
|
+
];
|
|
43
|
+
exception: [
|
|
44
|
+
Exception
|
|
45
|
+
];
|
|
46
|
+
error: [
|
|
47
|
+
Error
|
|
48
|
+
];
|
|
49
|
+
unknown: [
|
|
50
|
+
unknown
|
|
51
|
+
];
|
|
52
|
+
any: [
|
|
53
|
+
unknown
|
|
54
|
+
];
|
|
43
55
|
}>;
|
|
44
56
|
/**
|
|
45
57
|
* Configuration object for custom HTTP headers to be included in error responses.
|
|
@@ -187,7 +199,7 @@ export interface ResourcefulFormattedError {
|
|
|
187
199
|
* @example
|
|
188
200
|
* ```typescript
|
|
189
201
|
* // Standalone usage outside of resourceful routes
|
|
190
|
-
* import ResourcefulErrorMiddleware from '
|
|
202
|
+
* import ResourcefulErrorMiddleware from '@nhtio/lucid-resourceful/middlewares/resourceful_error'
|
|
191
203
|
*
|
|
192
204
|
* const errorHandler = new ResourcefulErrorMiddleware({
|
|
193
205
|
* onException: (error) => logger.error(error),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResourcefulRouterModelResolverService } from
|
|
1
|
+
import { ResourcefulRouterModelResolverService } from "./resourceful_router_model_resolver_service";
|
|
2
2
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
3
|
-
import type { ResourcefulRouterOptionsService } from
|
|
4
|
-
import type { ResourcefulModelController } from
|
|
3
|
+
import type { ResourcefulRouterOptionsService } from "./resourceful_router_options_service";
|
|
4
|
+
import type { ResourcefulModelController } from "../controllers/resourceful_model_controller";
|
|
5
5
|
export declare class ResourcefulRouterChoicesService {
|
|
6
6
|
#private;
|
|
7
7
|
constructor(options: ResourcefulRouterOptionsService, models: ResourcefulRouterModelResolverService, controllers: Map<string, ResourcefulModelController>);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
2
|
import type { default as ApplicationService } from '@adonisjs/core/services/app';
|
|
3
|
-
import type { ResourcefulModel, ResourcefulResponseFormat, ResourcefulHttpVerb } from
|
|
3
|
+
import type { ResourcefulModel, ResourcefulResponseFormat, ResourcefulHttpVerb } from "../../../types";
|
|
4
4
|
export interface ResolvedResourcefulHttpContext {
|
|
5
5
|
model: ResourcefulModel;
|
|
6
6
|
app: typeof ApplicationService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E_UNRESOLVABLE_MODEL } from
|
|
2
|
-
import type { ResourcefulModel } from
|
|
3
|
-
import type { MacroModelsMap } from
|
|
1
|
+
import { E_UNRESOLVABLE_MODEL } from "../../../errors";
|
|
2
|
+
import type { ResourcefulModel } from "../../../types";
|
|
3
|
+
import type { MacroModelsMap } from "../types";
|
|
4
4
|
export declare class ResourcefulRouterModelResolverService {
|
|
5
5
|
#private;
|
|
6
6
|
private constructor();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ResourcefulModelController } from
|
|
2
|
-
import type { ResourcefulResponseFormat } from
|
|
1
|
+
import { ResourcefulModelController } from "../controllers/resourceful_model_controller";
|
|
2
|
+
import type { ResourcefulResponseFormat } from "../types";
|
|
3
3
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
4
4
|
import type { default as ApplicationService } from '@adonisjs/core/services/app';
|
|
5
|
-
import type { ResourcefulRouterOptionsService } from
|
|
6
|
-
import type { ResourcefulRouterModelResolverService } from
|
|
5
|
+
import type { ResourcefulRouterOptionsService } from "./resourceful_router_options_service";
|
|
6
|
+
import type { ResourcefulRouterModelResolverService } from "./resourceful_router_model_resolver_service";
|
|
7
7
|
export declare class ResourcefulRouterOpenApiDocumentService {
|
|
8
8
|
#private;
|
|
9
9
|
constructor(opts: ResourcefulRouterOptionsService, modelMap: ResourcefulRouterModelResolverService, controllers: Map<string, ResourcefulModelController>, app: typeof ApplicationService);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ResourcefulRouterOptions, ResourcefulPolicy, ResourcefulRouterMutatorOptions } from
|
|
2
|
-
export declare const ResourcefulRouterMutatorOptionsSchema: import("
|
|
3
|
-
export declare const ResourcefulPolicySchema: import("
|
|
1
|
+
import type { ResourcefulRouterOptions, ResourcefulPolicy, ResourcefulRouterMutatorOptions } from "../types";
|
|
2
|
+
export declare const ResourcefulRouterMutatorOptionsSchema: import("../../../bundled_nhtio_validation").ObjectSchema<ResourcefulRouterMutatorOptions>;
|
|
3
|
+
export declare const ResourcefulPolicySchema: import("../../../bundled_nhtio_validation").ObjectSchema<ResourcefulPolicy>;
|
|
4
4
|
export declare class ResourcefulRouterOptionsService {
|
|
5
5
|
#private;
|
|
6
6
|
private constructor();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { OpenAPIV3 } from
|
|
1
|
+
import type { OpenAPIV3 } from "../../bundled_openapi_types";
|
|
2
2
|
import type { Exception } from '@poppinss/utils';
|
|
3
3
|
import type { NextFn } from '@adonisjs/core/types/http';
|
|
4
4
|
import type { ContainerResolver } from '@adonisjs/fold';
|
|
5
5
|
import type { HookHandler } from '@poppinss/hooks/types';
|
|
6
6
|
import type { LucidModel } from '@adonisjs/lucid/types/model';
|
|
7
|
-
import type { ResourcefulModelSerializableAttributes } from
|
|
8
|
-
import type { ResourcefulModel, ResourcefulIndexResult } from
|
|
7
|
+
import type { ResourcefulModelSerializableAttributes } from "../types";
|
|
8
|
+
import type { ResourcefulModel, ResourcefulIndexResult } from "../mixin";
|
|
9
9
|
import type { HttpContext, Router, RouteGroup } from '@adonisjs/core/http';
|
|
10
|
-
import type { E_UNRESOLVABLE_MODEL } from
|
|
11
|
-
import type { ValidationError as JoiValidationError } from
|
|
12
|
-
import type { VineValidationError, ResourcefulQueryScopeCallback, ResourcefulPayloadSchemaGetter } from
|
|
10
|
+
import type { E_UNRESOLVABLE_MODEL } from "../../errors";
|
|
11
|
+
import type { ValidationError as JoiValidationError } from "../../joi";
|
|
12
|
+
import type { VineValidationError, ResourcefulQueryScopeCallback, ResourcefulPayloadSchemaGetter } from "../../types";
|
|
13
13
|
export type Resolvable<T> = T | Promise<T> | PromiseLike<T> | Promise<{
|
|
14
14
|
default: T;
|
|
15
15
|
}> | PromiseLike<{
|
|
@@ -54,7 +54,10 @@ export type GetControllerHandlers<T> = {
|
|
|
54
54
|
/**
|
|
55
55
|
* Route callback that can be either a function or controller tuple
|
|
56
56
|
*/
|
|
57
|
-
export type RouteCallback<T extends Constructor<any> = Constructor> = RouteFn | [
|
|
57
|
+
export type RouteCallback<T extends Constructor<any> = Constructor> = RouteFn | [
|
|
58
|
+
LazyImport<T> | T,
|
|
59
|
+
keyof InstanceType<T>
|
|
60
|
+
];
|
|
58
61
|
/**
|
|
59
62
|
* Middleware function type (simplified for now)
|
|
60
63
|
*/
|
|
@@ -64,7 +67,11 @@ export type MiddlewareFn = (ctx: HttpContext, next: () => Promise<void>) => Prom
|
|
|
64
67
|
*/
|
|
65
68
|
export interface ParsedNamedMiddleware {
|
|
66
69
|
name: string;
|
|
67
|
-
handle: (resolver: ContainerResolver<any>, ...args: [
|
|
70
|
+
handle: (resolver: ContainerResolver<any>, ...args: [
|
|
71
|
+
ctx: HttpContext,
|
|
72
|
+
next: NextFn,
|
|
73
|
+
params?: any
|
|
74
|
+
]) => any;
|
|
68
75
|
args?: any[];
|
|
69
76
|
}
|
|
70
77
|
export type MiddlewareAsClass = Constructor<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { errors } from '@vinejs/vine';
|
|
2
2
|
import { Exception } from '@poppinss/utils';
|
|
3
|
-
import { ValidationError as JoiValidationError } from
|
|
3
|
+
import { ValidationError as JoiValidationError } from "../../../joi";
|
|
4
4
|
export type VineValidationError = InstanceType<typeof errors.E_VALIDATION_ERROR>;
|
|
5
5
|
export declare const isError: (value: unknown) => value is Error;
|
|
6
6
|
export declare const isException: (value: unknown) => value is Exception;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResourcefulResponseFormat } from
|
|
1
|
+
import { ResourcefulResponseFormat } from "../types";
|
|
2
2
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
3
3
|
export declare const negotiateContent: (ctx: HttpContext) => ResourcefulResponseFormat;
|
|
4
4
|
export declare const getPossibleHttpErrorCodes: () => number[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAPIV3 } from
|
|
2
|
-
import type { AlternativesSchema, ObjectSchema } from
|
|
1
|
+
import { OpenAPIV3 } from "../../../bundled_openapi_types";
|
|
2
|
+
import type { AlternativesSchema, ObjectSchema } from "../../../joi";
|
|
3
3
|
declare const ReferenceObjectSchema: ObjectSchema<OpenAPIV3.ReferenceObject>;
|
|
4
4
|
declare const ExternalDocumentationObjectSchema: ObjectSchema<OpenAPIV3.ExternalDocumentationObject>;
|
|
5
5
|
declare const ContactObjectSchema: ObjectSchema<OpenAPIV3.ContactObject>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ResourcefulModel } from
|
|
1
|
+
import type { ResourcefulModel } from "../../../types";
|
|
2
2
|
export declare const resolveModelDisplayColumn: (model: ResourcefulModel) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AdditionalResourcefulRouteDetails } from
|
|
1
|
+
import type { AdditionalResourcefulRouteDetails } from "../types";
|
|
2
2
|
export declare const isAdditionalResourcefulRouteDetails: (value: unknown) => value is AdditionalResourcefulRouteDetails;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from
|
|
1
|
+
export type * from "../bundled_nhtio_validation";
|
package/private/type_guards.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isArray, isBigInt, isBigIntTypedArray, isError, isInstanceOf, isLucidBinaryValue, isLuxonDateTime, isLuxonDuration, isLuxonInterval, isLuxonSystemZone, isMap, isNegativeZero, isNumber, isObject, isPhoneObject, isPrimitive, isSet, isTypedArray, isUniterableObject } from
|
|
2
|
-
import type { OpenAPIV3 } from
|
|
3
|
-
import type { ResourcefulModel } from
|
|
4
|
-
import type { ResourcefulStringType, ResourcefulDateType, ResourcefulDateTimeType, ResourcefulBinaryType, ResourcefulNumberType, ResourcefulIntegerType, ResourcefulBigintType, ResourcefulUnsignedIntegerType, ResourcefulBooleanType, ResourcefulObjectType, ResourcefulArrayType } from
|
|
1
|
+
import { isArray, isBigInt, isBigIntTypedArray, isError, isInstanceOf, isLucidBinaryValue, isLuxonDateTime, isLuxonDuration, isLuxonInterval, isLuxonSystemZone, isMap, isNegativeZero, isNumber, isObject, isPhoneObject, isPrimitive, isSet, isTypedArray, isUniterableObject } from "../bundled_nhtio_encoder_type_guards";
|
|
2
|
+
import type { OpenAPIV3 } from "../bundled_openapi_types";
|
|
3
|
+
import type { ResourcefulModel } from "./mixin";
|
|
4
|
+
import type { ResourcefulStringType, ResourcefulDateType, ResourcefulDateTimeType, ResourcefulBinaryType, ResourcefulNumberType, ResourcefulIntegerType, ResourcefulBigintType, ResourcefulUnsignedIntegerType, ResourcefulBooleanType, ResourcefulObjectType, ResourcefulArrayType } from "../definitions";
|
|
5
5
|
export { isArray, isBigInt, isBigIntTypedArray, isError, isInstanceOf, isLucidBinaryValue, isLuxonDateTime, isLuxonDuration, isLuxonInterval, isLuxonSystemZone, isMap, isNegativeZero, isNumber, isObject, isPhoneObject, isPrimitive, isSet, isTypedArray, isUniterableObject, };
|
|
6
6
|
/**
|
|
7
7
|
* Type guard to check if a value is a ResourcefulModel
|
|
@@ -91,4 +91,4 @@ export declare const isRegExp: (value: unknown) => value is RegExp;
|
|
|
91
91
|
export declare const isArrayBuffer: (value: unknown) => value is ArrayBuffer;
|
|
92
92
|
export declare const isDataView: (value: unknown) => value is DataView;
|
|
93
93
|
export declare const isNonArraySchemaObject: (value?: OpenAPIV3.SchemaObject | undefined) => value is OpenAPIV3.NonArraySchemaObject;
|
|
94
|
-
export { isStringContent } from
|
|
94
|
+
export { isStringContent } from "./utils";
|
package/private/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CustomConsumeFunction, CustomPrepareFunction } from
|
|
2
|
-
import type { OpenAPIV3 } from
|
|
1
|
+
import { CustomConsumeFunction, CustomPrepareFunction } from "./prepare_consume_chain_builder";
|
|
2
|
+
import type { OpenAPIV3 } from "../bundled_openapi_types";
|
|
3
3
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
4
4
|
import type { ApplicationService } from '@adonisjs/core/types';
|
|
5
|
-
import type { ResourcefulDataType } from
|
|
5
|
+
import type { ResourcefulDataType } from "../types";
|
|
6
6
|
import type { ModelRelationTypes } from '@adonisjs/lucid/types/relations';
|
|
7
7
|
import type { LucidModel, LucidRow, ModelColumnOptions, ComputedOptions } from '@adonisjs/lucid/types/model';
|
|
8
|
-
import type { AnySchema, StringSchema, BinarySchema, NumberSchema, BooleanSchema, ObjectSchema, ArraySchema, DateSchema } from
|
|
8
|
+
import type { AnySchema, StringSchema, BinarySchema, NumberSchema, BooleanSchema, ObjectSchema, ArraySchema, DateSchema } from "./schema_types";
|
|
9
9
|
export type PromiseAble<T = unknown> = T | Promise<T> | PromiseLike<T>;
|
|
10
10
|
export type Promised<T = unknown> = Promise<T> | PromiseLike<T>;
|
|
11
11
|
export interface ResourcefulGeneralAccessControlFilter {
|
|
@@ -146,4 +146,4 @@ export type ResourcefulModelRelationshipMeta = {
|
|
|
146
146
|
choices: ResourcefulModelRelationshipMetaChoice[] | string;
|
|
147
147
|
};
|
|
148
148
|
export type ResourcefulModelFieldRelationshipMeta = false | ResourcefulModelRelationshipMeta;
|
|
149
|
-
export type { ResourcefulEnum, ResourcefulEnumObject } from
|
|
149
|
+
export type { ResourcefulEnum, ResourcefulEnumObject } from "./data_types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { castValueAsString, castValueAsDate, castValueAsDateTime, castValueAsBinary, castValueAsNumber, castValueAsInteger, castValueAsBigint, castValueAsUnsignedInt, castValueAsBoolean, castValueAsObject, castValueAsArray, } from
|
|
1
|
+
export { castValueAsString, castValueAsDate, castValueAsDateTime, castValueAsBinary, castValueAsNumber, castValueAsInteger, castValueAsBigint, castValueAsUnsignedInt, castValueAsBoolean, castValueAsObject, castValueAsArray, } from "../decorator_utils";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { consumeString, consumeDate, consumeDateTime, consumeBinary, consumeNumber, consumeInteger, consumeBigint, consumeUnsignedint, consumeBoolean, consumeObject, consumeArray, } from
|
|
1
|
+
export { consumeString, consumeDate, consumeDateTime, consumeBinary, consumeNumber, consumeInteger, consumeBigint, consumeUnsignedint, consumeBoolean, consumeObject, consumeArray, } from "../decorator_utils";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { prepareString, prepareDate, prepareDateTime, prepareBinary, prepareNumber, prepareInteger, prepareBigint, prepareUnsignedint, prepareBoolean, prepareObject, prepareArray, } from
|
|
1
|
+
export { prepareString, prepareDate, prepareDateTime, prepareBinary, prepareNumber, prepareInteger, prepareBigint, prepareUnsignedint, prepareBoolean, prepareObject, prepareArray, } from "../decorator_utils";
|
package/private/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACLOperationsEnum, CRUDOperationsEnum } from
|
|
1
|
+
import { ACLOperationsEnum, CRUDOperationsEnum } from "./constants";
|
|
2
2
|
export declare const operationCRUDToACL: (operation: CRUDOperationsEnum) => ACLOperationsEnum | undefined;
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a value is a string
|
package/{resourceful_error_middleware-CMSZGdoG.js → resourceful_error_middleware-Cb_eTzST.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as string_default, l } from "./index-DLVvkVxI.js";
|
|
2
2
|
import { i as isObject, c as isError, d as isException, e as isJoiValidationError, f as isVineValidationError, s as stripUndefinedValuesFromObject, g as isNotImplementedError } from "./errors-b4tqg-tH.js";
|
|
3
3
|
const ResourcefulHttpVerb = [
|
|
4
4
|
"get",
|
|
@@ -6718,7 +6718,7 @@ class ResourcefulErrorMiddleware {
|
|
|
6718
6718
|
const help = "help" in error && "string" === typeof error.help ? error.help : void 0;
|
|
6719
6719
|
let details = Array.isArray(error.messages) ? error.messages.map((m) => {
|
|
6720
6720
|
return stripUndefinedValuesFromObject({
|
|
6721
|
-
code: m.rule ?
|
|
6721
|
+
code: m.rule ? string_default.snakeCase(m.rule).toUpperCase() : "E_VALIDATION_ERROR",
|
|
6722
6722
|
message: m.message || "Validation error",
|
|
6723
6723
|
target: m.field
|
|
6724
6724
|
});
|
|
@@ -6748,7 +6748,7 @@ class ResourcefulErrorMiddleware {
|
|
|
6748
6748
|
const help = "help" in error && "string" === typeof error.help ? error.help : void 0;
|
|
6749
6749
|
let details = Array.isArray(error.details) ? error.details.map((d) => {
|
|
6750
6750
|
return stripUndefinedValuesFromObject({
|
|
6751
|
-
code:
|
|
6751
|
+
code: string_default.snakeCase(d.type).toUpperCase(),
|
|
6752
6752
|
message: d.message || "Validation error",
|
|
6753
6753
|
target: d.path.length > 0 ? d.path.join(".") : void 0,
|
|
6754
6754
|
context: d.context || void 0
|
|
@@ -6843,4 +6843,4 @@ export {
|
|
|
6843
6843
|
getPossibleHttpErrorCodes as g,
|
|
6844
6844
|
negotiateContent as n
|
|
6845
6845
|
};
|
|
6846
|
-
//# sourceMappingURL=resourceful_error_middleware-
|
|
6846
|
+
//# sourceMappingURL=resourceful_error_middleware-Cb_eTzST.js.map
|