@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.
Files changed (109) hide show
  1. package/adonis-env.d.ts +17 -0
  2. package/bundled_liqe.d.ts +6 -5
  3. package/bundled_xml_js.d.ts +5 -4
  4. package/definitions.d.ts +1 -1
  5. package/encoding.d.ts +6 -6
  6. package/errors.d.ts +23 -8
  7. package/{index-Bsyx9Sty.js → index-B-5JiNqG.js} +76 -221
  8. package/index-B-5JiNqG.js.map +1 -0
  9. package/{index-B6dIMDux.cjs → index-BrGbuAtt.cjs} +76 -221
  10. package/index-BrGbuAtt.cjs.map +1 -0
  11. package/index-C9zyi90j.js.map +1 -1
  12. package/{index-CpyTnwZV.cjs → index-CQApAM0M.cjs} +298 -353
  13. package/index-CQApAM0M.cjs.map +1 -0
  14. package/index-CxRBayw6.cjs.map +1 -1
  15. package/{index-C8mGEf4P.js → index-DLVvkVxI.js} +295 -350
  16. package/index-DLVvkVxI.js.map +1 -0
  17. package/index-DsojAcQ4.js.map +1 -1
  18. package/index-DuzIXu31.cjs.map +1 -1
  19. package/index.cjs +1 -1
  20. package/index.d.ts +7 -7
  21. package/index.mjs +1 -1
  22. package/integration/middlewares/odata_error.cjs +1 -1
  23. package/integration/middlewares/odata_error.d.ts +1 -1
  24. package/integration/middlewares/odata_error.mjs +1 -1
  25. package/integration/middlewares/resourceful_encoded_request.cjs +100 -12
  26. package/integration/middlewares/resourceful_encoded_request.cjs.map +1 -1
  27. package/integration/middlewares/resourceful_encoded_request.d.ts +1 -1
  28. package/integration/middlewares/resourceful_encoded_request.mjs +98 -10
  29. package/integration/middlewares/resourceful_encoded_request.mjs.map +1 -1
  30. package/integration/middlewares/resourceful_error.cjs +1 -1
  31. package/integration/middlewares/resourceful_error.d.ts +1 -1
  32. package/integration/middlewares/resourceful_error.mjs +1 -1
  33. package/integration/provider.cjs +1 -1
  34. package/integration/provider.mjs +1 -1
  35. package/joi.d.ts +1 -1
  36. package/{manager-OLS5T3G7-CJHhMwR7.cjs → manager-OLS5T3G7-BPVI59Zw.cjs} +2 -2
  37. package/{manager-OLS5T3G7-CJHhMwR7.cjs.map → manager-OLS5T3G7-BPVI59Zw.cjs.map} +1 -1
  38. package/{manager-OLS5T3G7-C-NS6lhx.js → manager-OLS5T3G7-DzVckqOB.js} +2 -2
  39. package/{manager-OLS5T3G7-C-NS6lhx.js.map → manager-OLS5T3G7-DzVckqOB.js.map} +1 -1
  40. package/odata/context.d.ts +1 -1
  41. package/odata/macro.d.ts +1 -1
  42. package/{odata_error_middleware-BWfOpQZV.cjs → odata_error_middleware-DhLzccN7.cjs} +4 -4
  43. package/{odata_error_middleware-BWfOpQZV.cjs.map → odata_error_middleware-DhLzccN7.cjs.map} +1 -1
  44. package/{odata_error_middleware-CWYqZMez.js → odata_error_middleware-Dspi8bct.js} +4 -4
  45. package/{odata_error_middleware-CWYqZMez.js.map → odata_error_middleware-Dspi8bct.js.map} +1 -1
  46. package/package.json +1 -1
  47. package/private/data_type_schemas.d.ts +12 -12
  48. package/private/data_types.d.ts +1 -1
  49. package/private/decorator_schemas.d.ts +1 -1
  50. package/private/decorator_utils.d.ts +1 -1
  51. package/private/decorators.d.ts +14 -11
  52. package/private/encoding.d.ts +3 -3
  53. package/private/joi/index.d.ts +3 -3
  54. package/private/lucene_to_lucid_translator.d.ts +1 -1
  55. package/private/mixin.d.ts +25 -8
  56. package/private/odata_macro/controllers/resourceful_model_controller.d.ts +4 -4
  57. package/private/odata_macro/index.d.ts +1 -1
  58. package/private/odata_macro/middlewares/odata_error_middleware.d.ts +22 -10
  59. package/private/odata_macro/services/odata_context_service.d.ts +1 -1
  60. package/private/odata_macro/services/odata_metadata_service.d.ts +3 -3
  61. package/private/odata_macro/utils/odata.d.ts +2 -2
  62. package/private/odata_to_lucid_translator.d.ts +1 -1
  63. package/private/open_api_schema_service.d.ts +3 -3
  64. package/private/router_macro/controllers/resourceful_model_controller.d.ts +5 -5
  65. package/private/router_macro/index.d.ts +3 -3
  66. package/private/router_macro/middlewares/resourceful_error_middleware.d.ts +22 -10
  67. package/private/router_macro/services/resourceful_router_choices_service.d.ts +3 -3
  68. package/private/router_macro/services/resourceful_router_context_service.d.ts +1 -1
  69. package/private/router_macro/services/resourceful_router_model_options_service.d.ts +1 -1
  70. package/private/router_macro/services/resourceful_router_model_resolver_service.d.ts +3 -3
  71. package/private/router_macro/services/resourceful_router_openapi_document_service.d.ts +4 -4
  72. package/private/router_macro/services/resourceful_router_options_service.d.ts +3 -3
  73. package/private/router_macro/types.d.ts +15 -8
  74. package/private/router_macro/utils/errors.d.ts +1 -1
  75. package/private/router_macro/utils/http.d.ts +1 -1
  76. package/private/router_macro/utils/openapi_validation_schemas.d.ts +2 -2
  77. package/private/router_macro/utils/relationships.d.ts +1 -1
  78. package/private/router_macro/utils/type_guards.d.ts +1 -1
  79. package/private/schema_types.d.ts +1 -1
  80. package/private/type_guards.d.ts +5 -5
  81. package/private/types.d.ts +5 -5
  82. package/private/utils/casters.d.ts +1 -1
  83. package/private/utils/consumers.d.ts +1 -1
  84. package/private/utils/preparers.d.ts +1 -1
  85. package/private/utils.d.ts +1 -1
  86. package/{resourceful_error_middleware-CMSZGdoG.js → resourceful_error_middleware-Cb_eTzST.js} +4 -4
  87. package/{resourceful_error_middleware-CMSZGdoG.js.map → resourceful_error_middleware-Cb_eTzST.js.map} +1 -1
  88. package/{resourceful_error_middleware-lXgefPIC.cjs → resourceful_error_middleware-CnjbNoev.cjs} +4 -4
  89. package/{resourceful_error_middleware-lXgefPIC.cjs.map → resourceful_error_middleware-CnjbNoev.cjs.map} +1 -1
  90. package/router/context.d.ts +1 -1
  91. package/router/utils.cjs +1 -1
  92. package/router/utils.d.ts +1 -1
  93. package/router/utils.mjs +1 -1
  94. package/router.cjs +1 -1
  95. package/router.d.ts +2 -2
  96. package/router.mjs +1 -1
  97. package/types.d.ts +13 -13
  98. package/utils.d.ts +4 -4
  99. package/vite-env.d.ts +3 -0
  100. package/index-B6dIMDux.cjs.map +0 -1
  101. package/index-Bsyx9Sty.js.map +0 -1
  102. package/index-C8mGEf4P.js.map +0 -1
  103. package/index-CpIq4gOr.js +0 -93
  104. package/index-CpIq4gOr.js.map +0 -1
  105. package/index-CpyTnwZV.cjs.map +0 -1
  106. package/index-DqbJXpcT.cjs +0 -92
  107. package/index-DqbJXpcT.cjs.map +0 -1
  108. package/private/controller_factory.d.ts +0 -1
  109. package/private/utils/function_serializer.d.ts +0 -32
@@ -0,0 +1,17 @@
1
+ import type { odataRouterMacro } from "./private/odata_macro/index";
2
+ import type { resourcefulRouterMacro } from "./private/router_macro/index";
3
+ import type { odataXmlResponseMacro } from "./odata/macro";
4
+ declare module '@adonisjs/core/http' {
5
+ export interface Router {
6
+ resourceful: typeof resourcefulRouterMacro;
7
+ resourcefulOdata: typeof odataRouterMacro;
8
+ }
9
+ export interface Response {
10
+ oXml: typeof odataXmlResponseMacro;
11
+ }
12
+ }
13
+ declare module '@adonisjs/http-server' {
14
+ export interface Request {
15
+ bodyType: 'unknown' | 'urlencoded' | 'multipart' | 'json' | 'raw' | 'resourceful-encoded';
16
+ }
17
+ }
package/bundled_liqe.d.ts CHANGED
@@ -39,12 +39,13 @@ export declare type FieldToken = {
39
39
 
40
40
  export declare const filter: <T extends Object>(ast: LiqeQuery, data: readonly T[]) => readonly T[];
41
41
 
42
- export declare type Highlight = {
42
+ export declare const highlight: <T extends Object>(ast: LiqeQuery, data: T) => Highlight_2[];
43
+
44
+ declare type Highlight_2 = {
43
45
  path: string;
44
46
  query?: RegExp;
45
47
  };
46
-
47
- export declare const highlight: <T extends Object>(ast: LiqeQuery, data: T) => Highlight[];
48
+ export { Highlight_2 as Highlight }
48
49
 
49
50
  export declare type ImplicitBooleanOperatorToken = {
50
51
  operator: 'AND';
@@ -99,7 +100,7 @@ export declare const parse: (query: string) => LiqeQuery;
99
100
 
100
101
  export declare type ParserAst = EmptyExpression | LogicalExpressionToken | ParenthesizedExpressionToken | TagToken | UnaryOperatorToken;
101
102
 
102
- declare type Range = {
103
+ declare type Range_2 = {
103
104
  max: number;
104
105
  maxInclusive: boolean;
105
106
  min: number;
@@ -108,7 +109,7 @@ declare type Range = {
108
109
 
109
110
  export declare type RangeExpressionToken = {
110
111
  location: TokenLocation;
111
- range: Range;
112
+ range: Range_2;
112
113
  type: 'RangeExpression';
113
114
  };
114
115
 
@@ -8,7 +8,7 @@ export declare interface DeclarationAttributes {
8
8
  standalone?: 'yes' | 'no'
9
9
  }
10
10
 
11
- export declare interface Element {
11
+ declare interface Element_2 {
12
12
  declaration?: {
13
13
  attributes?: DeclarationAttributes
14
14
  }
@@ -20,8 +20,9 @@ export declare interface Element {
20
20
  text?: string | number | boolean
21
21
  type?: string
22
22
  name?: string
23
- elements?: Array<Element>
23
+ elements?: Array<Element_2>
24
24
  }
25
+ export { Element_2 as Element }
25
26
 
26
27
  export declare interface ElementCompact {
27
28
  [key: string]: any
@@ -38,7 +39,7 @@ export declare interface ElementCompact {
38
39
  _text?: string | number
39
40
  }
40
41
 
41
- export declare function js2xml(obj: Element | ElementCompact, options?: Options.JS2XML): string;
42
+ export declare function js2xml(obj: Element_2 | ElementCompact, options?: Options.JS2XML): string;
42
43
 
43
44
  export declare function json2xml(json: string, options?: Options.JS2XML): string;
44
45
 
@@ -152,7 +153,7 @@ export declare namespace Options {
152
153
  }
153
154
  }
154
155
 
155
- export declare function xml2js(xml: string, options?: Options.XML2JS): Element | ElementCompact;
156
+ export declare function xml2js(xml: string, options?: Options.XML2JS): Element_2 | ElementCompact;
156
157
 
157
158
  export declare function xml2json(xml: string, options?: Options.XML2JSON): string;
158
159
 
package/definitions.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Column Data Type Definition Helpers for Resourceful Lucid Models
3
3
  * @module @nhtio/lucid-resourceful/definitions
4
4
  */
5
- export { ResourcefulStringType, ResourcefulDateType, ResourcefulDateTimeType, ResourcefulBinaryType, ResourcefulNumberType, ResourcefulIntegerType, ResourcefulBigintType, ResourcefulUnsignedIntegerType, ResourcefulBooleanType, ResourcefulObjectType, ResourcefulArrayType, } from './private/data_types'
5
+ export { ResourcefulStringType, ResourcefulDateType, ResourcefulDateTimeType, ResourcefulBinaryType, ResourcefulNumberType, ResourcefulIntegerType, ResourcefulBigintType, ResourcefulUnsignedIntegerType, ResourcefulBooleanType, ResourcefulObjectType, ResourcefulArrayType, } from "./private/data_types";
package/encoding.d.ts CHANGED
@@ -2,9 +2,9 @@
2
2
  * Portable cross-environment encoding and decoding of structured data.
3
3
  * @module @nhtio/lucid-resourceful/encoding
4
4
  */
5
- export { encode, decode, version } from './bundled_nhtio_encoder';
6
- export { E_UNENCODABLE_VALUE, E_CIRCULAR_REFERENCE, E_UNDECODABLE_VALUE, E_NOT_AN_ENCODED_VALUE, E_INVALID_VERSION, E_INCOMPATIBLE_VERSION, } from './bundled_nhtio_encoder_exceptions';
7
- export { FunctionSerializer } from './bundled_nhtio_encoder_function_serializer';
8
- export type { Encodable } from './bundled_nhtio_encoder';
9
- export type { BaseException } from './bundled_nhtio_encoder_exceptions';
10
- export type { DehydratedFunctionValue } from './bundled_nhtio_encoder_function_serializer';
5
+ export { encode, decode, version } from "./bundled_nhtio_encoder";
6
+ export { E_UNENCODABLE_VALUE, E_CIRCULAR_REFERENCE, E_UNDECODABLE_VALUE, E_NOT_AN_ENCODED_VALUE, E_INVALID_VERSION, E_INCOMPATIBLE_VERSION, } from "./bundled_nhtio_encoder_exceptions";
7
+ export { FunctionSerializer } from "./bundled_nhtio_encoder_function_serializer";
8
+ export type { Encodable } from "./bundled_nhtio_encoder";
9
+ export type { BaseException } from "./bundled_nhtio_encoder_exceptions";
10
+ export type { DehydratedFunctionValue } from "./bundled_nhtio_encoder_function_serializer";
package/errors.d.ts CHANGED
@@ -3,8 +3,8 @@
3
3
  * @module @nhtio/lucid-resourceful/errors
4
4
  */
5
5
  import { Exception } from '@poppinss/utils';
6
- import type { SyntaxError } from './bundled_liqe';
7
- import type { ValidationError } from './joi'
6
+ import type { SyntaxError } from "./bundled_liqe";
7
+ import type { ValidationError } from "./joi";
8
8
  export declare class E_INVALID_RESOURCEFUL_DATA_TYPE_OPTIONS extends Exception {
9
9
  static status: number;
10
10
  static code: string;
@@ -17,9 +17,18 @@ export declare class E_INVALID_RESOURCEFUL_MIXIN_OPTIONS extends Exception {
17
17
  readonly details?: ValidationError['details'];
18
18
  constructor(name: string, reason?: ValidationError);
19
19
  }
20
- export declare const E_INVALID_PREPARED_VALUE: new (args: [string, string], options?: globalThis.ErrorOptions) => Exception;
21
- export declare const E_INVALID_CONSUMED_VALUE: new (args: [string, any, string], options?: globalThis.ErrorOptions) => Exception;
22
- export declare const E_UNCASTABLE: new (args: [string], options?: globalThis.ErrorOptions) => Exception;
20
+ export declare const E_INVALID_PREPARED_VALUE: new (args: [
21
+ string,
22
+ string
23
+ ], options?: globalThis.ErrorOptions) => Exception;
24
+ export declare const E_INVALID_CONSUMED_VALUE: new (args: [
25
+ string,
26
+ any,
27
+ string
28
+ ], options?: globalThis.ErrorOptions) => Exception;
29
+ export declare const E_UNCASTABLE: new (args: [
30
+ string
31
+ ], options?: globalThis.ErrorOptions) => Exception;
23
32
  export declare class E_INVALID_RESOURCEFUL_DECORATOR_OPTIONS extends Exception {
24
33
  static status: number;
25
34
  static code: string;
@@ -193,14 +202,20 @@ export declare class E_RESOURCEFUL_ROUTER_MISCONFIGURED extends Exception {
193
202
  static code: string;
194
203
  constructor(reason?: unknown);
195
204
  }
196
- export declare const E_ROUTE_NOT_FOUND: new (args: [method: string, url: string], options?: globalThis.ErrorOptions) => Exception;
205
+ export declare const E_ROUTE_NOT_FOUND: new (args: [
206
+ method: string,
207
+ url: string
208
+ ], options?: globalThis.ErrorOptions) => Exception;
197
209
  export declare class E_NOT_IN_MODEL_CONTEXT extends Exception {
198
210
  static status: number;
199
211
  static code: string;
200
212
  constructor(reason?: unknown);
201
213
  }
202
- export declare const E_INVALID_HTTP_METHOD_EXCEPTION: new (args: [method: string, path: string], options?: globalThis.ErrorOptions) => Exception;
203
- export { UNIQUE_CONSTRAINT_VIOLATION, FOREIGN_KEY_VIOLATION, NOT_NULL_VIOLATION, CHECK_CONSTRAINT_VIOLATION, DATA_VALIDATION_ERROR, INVALID_DATA_TYPE, DEADLOCK, LOCK_TIMEOUT, SCHEMA_ERROR, DATABASE_CONNECTION_ERROR, PERMISSION_DENIED, SERIALIZATION_FAILURE, QUERY_SYNTAX_ERROR, DIVISION_BY_ZERO, } from './private/router_macro/utils/errors';
214
+ export declare const E_INVALID_HTTP_METHOD_EXCEPTION: new (args: [
215
+ method: string,
216
+ path: string
217
+ ], options?: globalThis.ErrorOptions) => Exception;
218
+ export { UNIQUE_CONSTRAINT_VIOLATION, FOREIGN_KEY_VIOLATION, NOT_NULL_VIOLATION, CHECK_CONSTRAINT_VIOLATION, DATA_VALIDATION_ERROR, INVALID_DATA_TYPE, DEADLOCK, LOCK_TIMEOUT, SCHEMA_ERROR, DATABASE_CONNECTION_ERROR, PERMISSION_DENIED, SERIALIZATION_FAILURE, QUERY_SYNTAX_ERROR, DIVISION_BY_ZERO, } from "./private/router_macro/utils/errors";
204
219
  export declare class E_NOT_IN_ODATA_CONTEXT extends Exception {
205
220
  static status: number;
206
221
  static code: string;