@nomalism-com/types 0.35.8 → 0.35.9

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/dist/index.cjs CHANGED
@@ -5840,7 +5840,8 @@ var ITagType = Object.keys(ITagTypeEnum);
5840
5840
  var route_schema_exports111 = {};
5841
5841
  __export(route_schema_exports111, {
5842
5842
  createBody: () => createBody70,
5843
- updateBody: () => updateBody61
5843
+ updateBody: () => updateBody61,
5844
+ updateManyBody: () => updateManyBody3
5844
5845
  });
5845
5846
  import joi112 from "joi";
5846
5847
  var createBodyKeys69 = {
@@ -5855,6 +5856,12 @@ var updateBodyKeys59 = {
5855
5856
  type: joi112.string().valid("private", "public").optional()
5856
5857
  };
5857
5858
  var updateBody61 = joi112.object().keys(updateBodyKeys59).messages(messages);
5859
+ var updateManyBodyKeys2 = {
5860
+ id: joi112.string().uuid().required(),
5861
+ index: joi112.number().allow(0).optional(),
5862
+ type: joi112.string().valid("private", "public").optional()
5863
+ };
5864
+ var updateManyBody3 = joi112.array().items(joi112.object().keys(updateManyBodyKeys2)).messages(messages);
5858
5865
 
5859
5866
  // src/index.ts
5860
5867
  var index_default = main_exports;
package/dist/index.js CHANGED
@@ -5840,7 +5840,8 @@ var ITagType = Object.keys(ITagTypeEnum);
5840
5840
  var route_schema_exports111 = {};
5841
5841
  __export(route_schema_exports111, {
5842
5842
  createBody: () => createBody70,
5843
- updateBody: () => updateBody61
5843
+ updateBody: () => updateBody61,
5844
+ updateManyBody: () => updateManyBody3
5844
5845
  });
5845
5846
  import joi112 from "joi";
5846
5847
  var createBodyKeys69 = {
@@ -5855,6 +5856,12 @@ var updateBodyKeys59 = {
5855
5856
  type: joi112.string().valid("private", "public").optional()
5856
5857
  };
5857
5858
  var updateBody61 = joi112.object().keys(updateBodyKeys59).messages(messages);
5859
+ var updateManyBodyKeys2 = {
5860
+ id: joi112.string().uuid().required(),
5861
+ index: joi112.number().allow(0).optional(),
5862
+ type: joi112.string().valid("private", "public").optional()
5863
+ };
5864
+ var updateManyBody3 = joi112.array().items(joi112.object().keys(updateManyBodyKeys2)).messages(messages);
5858
5865
 
5859
5866
  // src/index.ts
5860
5867
  var index_default = main_exports;
@@ -1,3 +1,4 @@
1
1
  import joi from 'joi';
2
2
  export declare const createBody: joi.ObjectSchema<any>;
3
3
  export declare const updateBody: joi.ObjectSchema<any>;
4
+ export declare const updateManyBody: joi.ArraySchema<any[]>;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.35.8",
12
+ "version": "0.35.9",
13
13
  "type": "module",
14
14
  "module": "./dist/index.js",
15
15
  "main": "./dist/index.cjs",
@@ -1,7 +1,7 @@
1
1
  import joi from 'joi';
2
2
  import { messages } from '../../../shared/messages';
3
3
  import * as IShared from '../../../shared/interface';
4
- import { ICreateRequest, IUpdateRequest } from './interface';
4
+ import { ICreateRequest, IUpdateRequest, IUpdateManyRequest } from './interface';
5
5
 
6
6
  // create body validation
7
7
  const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
@@ -18,3 +18,14 @@ const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest> = {
18
18
  type: joi.string().valid('private', 'public').optional(),
19
19
  };
20
20
  export const updateBody = joi.object().keys(updateBodyKeys).messages(messages);
21
+
22
+ // update body validation
23
+ const updateManyBodyKeys: IShared.IRouteRequest<IUpdateManyRequest> = {
24
+ id: joi.string().uuid().required(),
25
+ index: joi.number().allow(0).optional(),
26
+ type: joi.string().valid('private', 'public').optional(),
27
+ };
28
+ export const updateManyBody = joi
29
+ .array()
30
+ .items(joi.object().keys(updateManyBodyKeys))
31
+ .messages(messages);