@nomalism-com/types 0.34.19 → 0.34.21
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
|
@@ -3192,15 +3192,11 @@ __export(route_schema_exports48, {
|
|
|
3192
3192
|
updateStoreOperatorQuery: () => updateStoreOperatorQuery
|
|
3193
3193
|
});
|
|
3194
3194
|
import joi49 from "joi";
|
|
3195
|
-
var createMainPersonaKeys4 = {
|
|
3196
|
-
name: joi49.string().optional(),
|
|
3197
|
-
nif: joi49.string().allow(null).optional(),
|
|
3198
|
-
email: joi49.string().email({ tlds: { allow: false } }).allow(null).optional(),
|
|
3199
|
-
telephone: joi49.string().allow(null).optional()
|
|
3200
|
-
};
|
|
3201
3195
|
var createBodyKeys35 = {
|
|
3202
|
-
|
|
3203
|
-
|
|
3196
|
+
main_persona_name: joi49.string().required(),
|
|
3197
|
+
main_persona_email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
|
|
3198
|
+
user_account: joi49.string().allow(null, "").optional(),
|
|
3199
|
+
password: joi49.string().required()
|
|
3204
3200
|
};
|
|
3205
3201
|
var createBody36 = joi49.object().keys(createBodyKeys35).messages(messages);
|
|
3206
3202
|
var updateStoreOperatorQueryKeys = {
|
package/dist/index.js
CHANGED
|
@@ -3192,15 +3192,11 @@ __export(route_schema_exports48, {
|
|
|
3192
3192
|
updateStoreOperatorQuery: () => updateStoreOperatorQuery
|
|
3193
3193
|
});
|
|
3194
3194
|
import joi49 from "joi";
|
|
3195
|
-
var createMainPersonaKeys4 = {
|
|
3196
|
-
name: joi49.string().optional(),
|
|
3197
|
-
nif: joi49.string().allow(null).optional(),
|
|
3198
|
-
email: joi49.string().email({ tlds: { allow: false } }).allow(null).optional(),
|
|
3199
|
-
telephone: joi49.string().allow(null).optional()
|
|
3200
|
-
};
|
|
3201
3195
|
var createBodyKeys35 = {
|
|
3202
|
-
|
|
3203
|
-
|
|
3196
|
+
main_persona_name: joi49.string().required(),
|
|
3197
|
+
main_persona_email: joi49.string().email({ tlds: { allow: false } }).allow(null, "").optional(),
|
|
3198
|
+
user_account: joi49.string().allow(null, "").optional(),
|
|
3199
|
+
password: joi49.string().required()
|
|
3204
3200
|
};
|
|
3205
3201
|
var createBody36 = joi49.object().keys(createBodyKeys35).messages(messages);
|
|
3206
3202
|
var updateStoreOperatorQueryKeys = {
|
|
@@ -5,14 +5,15 @@ export declare const Route = "store_operator";
|
|
|
5
5
|
export declare const UpperName = "StoreOperator";
|
|
6
6
|
export declare const LowerName: string;
|
|
7
7
|
export type IFindPaginatedRequest = IShared.IPaginationRequest & Pick<Entity, 'inactive'>;
|
|
8
|
-
export interface IFindResponse extends Pick<Entity, 'id'> {
|
|
8
|
+
export interface IFindResponse extends Pick<Entity, 'id' | 'inactive'> {
|
|
9
9
|
user: Pick<Users, 'id' | 'account'>;
|
|
10
10
|
main_persona: Pick<Persona, 'id' | 'name' | 'email'>;
|
|
11
11
|
}
|
|
12
|
-
export type ICreateMainPersona = Pick<Persona, 'nif' | 'name' | 'email' | 'telephone'>;
|
|
13
12
|
export interface ICreateRequest {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
main_persona_name: string;
|
|
14
|
+
main_persona_email: string | null;
|
|
15
|
+
user_account: string | null;
|
|
16
|
+
password: string;
|
|
16
17
|
}
|
|
17
18
|
export interface IUpdateRequest {
|
|
18
19
|
main_persona_name: string | null;
|
package/package.json
CHANGED
|
@@ -8,16 +8,16 @@ export const LowerName = UpperName[0].toLowerCase() + UpperName.substring(1);
|
|
|
8
8
|
|
|
9
9
|
export type IFindPaginatedRequest = IShared.IPaginationRequest & Pick<Entity, 'inactive'>;
|
|
10
10
|
|
|
11
|
-
export interface IFindResponse extends Pick<Entity, 'id'> {
|
|
11
|
+
export interface IFindResponse extends Pick<Entity, 'id' | 'inactive'> {
|
|
12
12
|
user: Pick<Users, 'id' | 'account'>;
|
|
13
13
|
main_persona: Pick<Persona, 'id' | 'name' | 'email'>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export type ICreateMainPersona = Pick<Persona, 'nif' | 'name' | 'email' | 'telephone'>;
|
|
17
|
-
|
|
18
16
|
export interface ICreateRequest {
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
main_persona_name: string;
|
|
18
|
+
main_persona_email: string | null;
|
|
19
|
+
user_account: string | null;
|
|
20
|
+
password: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface IUpdateRequest {
|
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import joi from 'joi';
|
|
2
2
|
import { messages } from '../../../shared/messages';
|
|
3
3
|
import type * as IShared from '../../../shared/interface';
|
|
4
|
-
import type {
|
|
5
|
-
ICreateRequest,
|
|
6
|
-
ICreateMainPersona,
|
|
7
|
-
IUpdateRequest,
|
|
8
|
-
IFindPaginatedRequest,
|
|
9
|
-
} from './interface';
|
|
4
|
+
import type { ICreateRequest, IUpdateRequest, IFindPaginatedRequest } from './interface';
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
// create body validation
|
|
7
|
+
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
8
|
+
main_persona_name: joi.string().required(),
|
|
9
|
+
main_persona_email: joi
|
|
15
10
|
.string()
|
|
16
11
|
.email({ tlds: { allow: false } })
|
|
17
|
-
.allow(null)
|
|
12
|
+
.allow(null, '')
|
|
18
13
|
.optional(),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// create body validation
|
|
23
|
-
const createBodyKeys: IShared.IRouteRequest<ICreateRequest> = {
|
|
24
|
-
user_id: joi.string().uuid().required(),
|
|
25
|
-
main_persona: joi.object().keys(createMainPersonaKeys).required(),
|
|
14
|
+
user_account: joi.string().allow(null, '').optional(),
|
|
15
|
+
password: joi.string().required(),
|
|
26
16
|
};
|
|
27
17
|
export const createBody = joi.object().keys(createBodyKeys).messages(messages);
|
|
28
18
|
|