@ditojs/server 3.2.4 → 3.2.6

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 (2) hide show
  1. package/package.json +7 -7
  2. package/types/index.d.ts +25 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/server",
3
- "version": "3.2.4",
3
+ "version": "3.2.6",
4
4
  "type": "module",
5
5
  "description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/main/packages/server",
@@ -24,10 +24,10 @@
24
24
  "node >= 18"
25
25
  ],
26
26
  "dependencies": {
27
- "@ditojs/admin": "^3.2.4",
28
- "@ditojs/build": "^3.2.0",
29
- "@ditojs/router": "^3.2.0",
30
- "@ditojs/utils": "^3.2.0",
27
+ "@ditojs/admin": "^3.2.6",
28
+ "@ditojs/build": "^3.2.6",
29
+ "@ditojs/router": "^3.2.6",
30
+ "@ditojs/utils": "^3.2.6",
31
31
  "@koa/cors": "^5.0.0",
32
32
  "@koa/etag": "^5.0.2",
33
33
  "@koa/multer": "^4.0.0",
@@ -61,7 +61,7 @@
61
61
  "picocolors": "^1.1.1",
62
62
  "picomatch": "^4.0.7",
63
63
  "pino": "^10.4.0",
64
- "pino-pretty": "^13.1.3",
64
+ "pino-pretty": "^13.2.0",
65
65
  "pluralize": "^8.0.0",
66
66
  "repl": "^0.1.3",
67
67
  "type-fest": "^5.10.0",
@@ -89,5 +89,5 @@
89
89
  "objection": "^3.1.5",
90
90
  "typescript": "^6.0.3"
91
91
  },
92
- "gitHead": "32147a4ee71f5bca6c051af04be9c15a16f37567"
92
+ "gitHead": "d9868ae96d60a70b5e7ba89a5fc91e07b267a0d5"
93
93
  }
package/types/index.d.ts CHANGED
@@ -2161,7 +2161,7 @@ export type ControllerActionOptions<
2161
2161
  * }>
2162
2162
  * ```
2163
2163
  */
2164
- parameters?: { [K in keyof $Params]: Schema<$Params[K]> }
2164
+ parameters?: { [K in keyof $Params]: ParameterSchema<$Params[K]> }
2165
2165
  handler: ControllerActionHandler<$Controller, $Params>
2166
2166
  }
2167
2167
 
@@ -2172,7 +2172,7 @@ export type ModelControllerActionOptions<$ModelController = ModelController> =
2172
2172
  * The handler receives a single parameter object with
2173
2173
  * the same keys.
2174
2174
  */
2175
- parameters?: { [key: string]: Schema }
2175
+ parameters?: { [key: string]: ParameterSchema }
2176
2176
  /** The function to be called when the action route is requested. */
2177
2177
  handler: ModelControllerActionHandler<$ModelController>
2178
2178
  }
@@ -3160,22 +3160,22 @@ export class QueryBuilder<
3160
3160
  updateById(id: Id, data: PartialModelObject<M>): this
3161
3161
  upsertAndFetch(data: PartialModelObject<M>): this
3162
3162
  insertDitoGraph(
3163
- data: PartialDitoModelGraph<M>,
3163
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3164
3164
  options?: DitoGraphOptions
3165
3165
  ): this
3166
3166
 
3167
3167
  insertDitoGraphAndFetch(
3168
- data: PartialDitoModelGraph<M>,
3168
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3169
3169
  options?: DitoGraphOptions
3170
3170
  ): this
3171
3171
 
3172
3172
  upsertDitoGraph(
3173
- data: PartialDitoModelGraph<M>,
3173
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3174
3174
  options?: DitoGraphOptions
3175
3175
  ): this
3176
3176
 
3177
3177
  upsertDitoGraphAndFetch(
3178
- data: PartialDitoModelGraph<M>,
3178
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3179
3179
  options?: DitoGraphOptions
3180
3180
  ): this
3181
3181
 
@@ -3186,12 +3186,12 @@ export class QueryBuilder<
3186
3186
  ): this
3187
3187
 
3188
3188
  updateDitoGraph(
3189
- data: PartialDitoModelGraph<M>,
3189
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3190
3190
  options?: DitoGraphOptions
3191
3191
  ): this
3192
3192
 
3193
3193
  updateDitoGraphAndFetch(
3194
- data: PartialDitoModelGraph<M>,
3194
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3195
3195
  options?: DitoGraphOptions
3196
3196
  ): this
3197
3197
 
@@ -3202,12 +3202,12 @@ export class QueryBuilder<
3202
3202
  ): this
3203
3203
 
3204
3204
  patchDitoGraph(
3205
- data: PartialDitoModelGraph<M>,
3205
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3206
3206
  options?: DitoGraphOptions
3207
3207
  ): this
3208
3208
 
3209
3209
  patchDitoGraphAndFetch(
3210
- data: PartialDitoModelGraph<M>,
3210
+ data: OrArrayOf<PartialDitoModelGraph<M>>,
3211
3211
  options?: DitoGraphOptions
3212
3212
  ): this
3213
3213
 
@@ -3848,6 +3848,21 @@ export type SelectModelPropertyKeys<T extends Model> = keyof SerializedModel<T>
3848
3848
  * }
3849
3849
  * ```
3850
3850
  */
3851
+ /**
3852
+ * The schema of an action parameter, with the source of its value.
3853
+ */
3854
+ export type ParameterSchema<$Value = any> = Schema<$Value> & {
3855
+ /**
3856
+ * Where the value of the parameter comes from, instead of the parameters
3857
+ * of the request:
3858
+ * - `'root'`: The whole parameters, e.g. an array in the body.
3859
+ * - `'member'`: The member that a member action is called on.
3860
+ * - `'path'`, `'query'`, `'body'`: The path parameters, the query or the
3861
+ * body of the request.
3862
+ */
3863
+ from?: 'root' | 'member' | 'path' | 'query' | 'body'
3864
+ }
3865
+
3851
3866
  export type Schema<$Value = any> = JSONSchemaType<$Value> & {
3852
3867
  // keywords/_validate.js
3853
3868
  validate?: (params: {