@nomalism-com/types 0.35.7 → 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;
|
|
@@ -18,8 +18,8 @@ export interface IRepository {
|
|
|
18
18
|
create(data: ICreateRequest): Promise<void>;
|
|
19
19
|
findByDocumentHeaderId(selector: IShared.IFindByIdRequest): Promise<IFindResponse[]>;
|
|
20
20
|
findById(selector: IShared.IFindByIdRequest): Promise<IFindResponse>;
|
|
21
|
-
update(data: IUpdateRequest): Promise<void>;
|
|
22
|
-
updateMany(
|
|
21
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
22
|
+
updateMany(data: IUpdateRequest): Promise<void>;
|
|
23
23
|
delete(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
24
24
|
}
|
|
25
25
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
package/package.json
CHANGED
|
@@ -31,8 +31,8 @@ export interface IRepository {
|
|
|
31
31
|
create(data: ICreateRequest): Promise<void>;
|
|
32
32
|
findByDocumentHeaderId(selector: IShared.IFindByIdRequest): Promise<IFindResponse[]>;
|
|
33
33
|
findById(selector: IShared.IFindByIdRequest): Promise<IFindResponse>;
|
|
34
|
-
update(data: IUpdateRequest): Promise<void>;
|
|
35
|
-
updateMany(
|
|
34
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
35
|
+
updateMany(data: IUpdateRequest): Promise<void>;
|
|
36
36
|
delete(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -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);
|