@nomalism-com/types 0.34.13 → 0.34.15
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 +133 -162
- package/dist/index.js +133 -162
- package/dist/modules/user/storeOperator/interface.d.ts +11 -53
- package/dist/modules/user/storeOperator/route.schema.d.ts +1 -4
- package/dist/shared/interface.d.ts +2 -14
- package/package-lock.json +340 -276
- package/package.json +1 -1
- package/src/modules/user/storeOperator/interface.ts +13 -86
- package/src/modules/user/storeOperator/route.schema.ts +13 -64
- package/src/shared/interface.ts +2 -6
|
@@ -1,55 +1,19 @@
|
|
|
1
|
-
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { StoreOperator, Users,
|
|
3
|
-
import type { IChatType } from '../../stock/chat/interfaces';
|
|
1
|
+
import type * as IShared from '../../../shared/interface';
|
|
2
|
+
import type { StoreOperator, Users, Persona } from '../../../shared/entities/user';
|
|
4
3
|
export type Entity = StoreOperator;
|
|
5
4
|
export declare const Route = "store_operator";
|
|
6
5
|
export declare const UpperName = "StoreOperator";
|
|
7
6
|
export declare const LowerName: string;
|
|
8
|
-
interface
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export interface IFindResponse extends Pick<Entity, 'id'> {
|
|
8
|
+
user: Pick<Users, 'id' | 'account'>;
|
|
9
|
+
main_persona: Pick<Persona, 'name' | 'email'>;
|
|
11
10
|
}
|
|
12
|
-
interface IFindDetailedResponse extends Entity {
|
|
13
|
-
user: Users;
|
|
14
|
-
support_language: Language | null;
|
|
15
|
-
user_position: UserPositions | null;
|
|
16
|
-
main_persona: IMainPersona;
|
|
17
|
-
}
|
|
18
|
-
export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
|
|
19
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, 'user' | 'support_language' | 'user_position' | 'main_persona'>;
|
|
20
|
-
export type IFindRequest = Record<string, unknown>;
|
|
21
|
-
export type IFindResponse = Omit<IFindDetailedResponse, ''>;
|
|
22
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
|
|
23
|
-
}
|
|
24
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, ''>>;
|
|
25
11
|
export type ICreateMainPersona = Pick<Persona, 'nif' | 'name' | 'email' | 'telephone'>;
|
|
26
12
|
export interface ICreateRequest {
|
|
27
13
|
user_id: string;
|
|
28
|
-
user_position_id?: string | null;
|
|
29
|
-
location_id: string;
|
|
30
|
-
internal_email?: string | null;
|
|
31
|
-
support_language_id?: string | null;
|
|
32
14
|
main_persona: ICreateMainPersona;
|
|
33
15
|
}
|
|
34
16
|
export interface IUpdateRequest {
|
|
35
|
-
chat_type?: IChatType;
|
|
36
|
-
inactive?: boolean;
|
|
37
|
-
pin?: string;
|
|
38
|
-
old_pin?: string;
|
|
39
|
-
user_position_id?: string;
|
|
40
|
-
location_id?: string;
|
|
41
|
-
internal_email?: string | null;
|
|
42
|
-
support_language_id?: string | null;
|
|
43
|
-
main_persona_id?: string;
|
|
44
|
-
contact_persona_id?: string;
|
|
45
|
-
}
|
|
46
|
-
export interface ICheckPinRequest {
|
|
47
|
-
conference_pin: string;
|
|
48
|
-
}
|
|
49
|
-
export interface IFindUnique {
|
|
50
|
-
user_id: string;
|
|
51
|
-
}
|
|
52
|
-
export interface IStoreOperatorUpdateRequest {
|
|
53
17
|
name: string | null;
|
|
54
18
|
account: string | null;
|
|
55
19
|
email: string | null;
|
|
@@ -57,18 +21,12 @@ export interface IStoreOperatorUpdateRequest {
|
|
|
57
21
|
inactive: boolean;
|
|
58
22
|
}
|
|
59
23
|
export interface IRepository {
|
|
60
|
-
|
|
61
|
-
checkPin(data: ICheckPinRequest): Promise<IFindResponse | null>;
|
|
62
|
-
findUnique(data: IFindUnique): Promise<IFindResponse | null>;
|
|
63
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
24
|
+
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindResponse[]>;
|
|
64
25
|
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
65
|
-
find(
|
|
66
|
-
findPaginated(selector:
|
|
67
|
-
create(data: ICreateRequest): Promise<
|
|
68
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<
|
|
69
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<
|
|
70
|
-
updateStoreOperator(selector: IShared.IFindByIdRequest, data: IStoreOperatorUpdateRequest): Promise<void>;
|
|
26
|
+
find(): Promise<IFindResponse[]>;
|
|
27
|
+
findPaginated(selector: IShared.IPaginationRequest): Promise<IShared.IPaginationResponse<IFindResponse>>;
|
|
28
|
+
create(data: ICreateRequest): Promise<string>;
|
|
29
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
30
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
71
31
|
}
|
|
72
32
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
73
|
-
export type IApi = Omit<IRepository, 'findUnique'>;
|
|
74
|
-
export {};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import joi from 'joi';
|
|
2
2
|
export declare const createBody: joi.ObjectSchema<any>;
|
|
3
|
-
export declare const updateBody: joi.ObjectSchema<any>;
|
|
4
|
-
export declare const checkPinBody: joi.ObjectSchema<any>;
|
|
5
|
-
export declare const findQuery: joi.ObjectSchema<any>;
|
|
6
|
-
export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
|
|
7
3
|
export declare const updateStoreOperatorQuery: joi.ObjectSchema<any>;
|
|
4
|
+
export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
|
|
@@ -7,6 +7,7 @@ import type { IScheduleType } from '../modules/supply/schedule/interface';
|
|
|
7
7
|
import type { IWarningType } from '../modules/supply/documentHeader/interfaces';
|
|
8
8
|
import type { IProjectInfoType } from '../modules/integration/projectInfo/interfaces';
|
|
9
9
|
import type { IChat, IEmail, IEncomenda, IMultimedia, IMultimediaSummary, IPostgresBackup, IPrint, IProjectInfo, IProposta, IServiceLogs, IServiceStatus, IStock, ITask } from '../modules/view/adminPanel/interfaces';
|
|
10
|
+
import type * as ErrorLog from '../modules/view/errorLog/interfaces';
|
|
10
11
|
export { messages };
|
|
11
12
|
type CreatedAt = 'created_at';
|
|
12
13
|
type UpdatedAt = 'updated_at';
|
|
@@ -319,20 +320,7 @@ export type IBrokerTopicPayload = {
|
|
|
319
320
|
output?: unknown;
|
|
320
321
|
done: boolean;
|
|
321
322
|
};
|
|
322
|
-
[IBrokerTopic.error_log]:
|
|
323
|
-
service: string;
|
|
324
|
-
type: 'prisma' | 'unhandled' | 'axios' | 'webapp' | 'moloni';
|
|
325
|
-
error: {
|
|
326
|
-
name: string;
|
|
327
|
-
message: string;
|
|
328
|
-
stack?: string;
|
|
329
|
-
};
|
|
330
|
-
request?: {
|
|
331
|
-
body?: unknown;
|
|
332
|
-
query?: unknown;
|
|
333
|
-
params?: unknown;
|
|
334
|
-
};
|
|
335
|
-
};
|
|
323
|
+
[IBrokerTopic.error_log]: ErrorLog.ICreateRequest;
|
|
336
324
|
[IBrokerTopic.express_log]: {
|
|
337
325
|
id: string;
|
|
338
326
|
service: string;
|