@nomalism-com/types 1.3.58 → 1.3.59
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/modules/stock/productImage/interface.d.ts +0 -19
- package/dist/modules/stock/promotion/interface.d.ts +0 -37
- package/dist/modules/stock/stockMovement/interface.d.ts +0 -3
- package/dist/modules/supply/orderManagement/interface.d.ts +0 -1
- package/dist/modules/user/clients/interface.d.ts +0 -6
- package/dist/modules/user/commissioner/interface.d.ts +0 -12
- package/dist/modules/user/persona/interface.d.ts +2 -4
- package/dist/modules/user/providers/interface.d.ts +0 -8
- package/dist/modules/user/users/interface.d.ts +1 -20
- package/package.json +3 -3
|
@@ -2,20 +2,12 @@ import { ProductImage } from "../../../shared/entities/stock";
|
|
|
2
2
|
import * as IShared from "../../../shared/interface";
|
|
3
3
|
export type Entity = ProductImage;
|
|
4
4
|
export declare const Route = "product_image";
|
|
5
|
-
type IFindDetailedResponse = Entity;
|
|
6
|
-
export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
|
|
7
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "">;
|
|
8
|
-
export type IFindRequest = Record<string, unknown>;
|
|
9
|
-
export type IFindResponse = Omit<IFindDetailedResponse, "">;
|
|
10
5
|
export declare const ImageTypeEnum: {
|
|
11
6
|
thumbnail: "thumbnail";
|
|
12
7
|
site: "site";
|
|
13
8
|
};
|
|
14
9
|
export type IImageType = (typeof ImageTypeEnum)[keyof typeof ImageTypeEnum];
|
|
15
10
|
export declare const imageTypes: string[];
|
|
16
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
|
|
17
|
-
}
|
|
18
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
|
|
19
11
|
export interface ICreateRequest {
|
|
20
12
|
product_id: string;
|
|
21
13
|
product_sheet_id?: string;
|
|
@@ -24,19 +16,8 @@ export interface ICreateRequest {
|
|
|
24
16
|
created_by?: string | null;
|
|
25
17
|
updated_by?: string | null;
|
|
26
18
|
}
|
|
27
|
-
export interface IUpdateRequest {
|
|
28
|
-
product_id?: string;
|
|
29
|
-
multimedia_id?: string;
|
|
30
|
-
type?: IImageType;
|
|
31
|
-
}
|
|
32
19
|
export interface IRepository {
|
|
33
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
34
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
35
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
36
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
37
20
|
create(data: ICreateRequest): Promise<Entity>;
|
|
38
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
39
21
|
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
40
22
|
}
|
|
41
23
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
42
|
-
export {};
|
|
@@ -1,40 +1,3 @@
|
|
|
1
1
|
import { Promotion } from "../../../shared/entities/stock";
|
|
2
|
-
import * as IShared from "../../../shared/interface";
|
|
3
2
|
export type Entity = Promotion;
|
|
4
3
|
export declare const Route = "promotion";
|
|
5
|
-
type IFindDetailedResponse = Entity;
|
|
6
|
-
export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
|
|
7
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "">;
|
|
8
|
-
export type IFindRequest = Record<string, unknown>;
|
|
9
|
-
export type IFindResponse = Omit<IFindDetailedResponse, "">;
|
|
10
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
|
|
11
|
-
}
|
|
12
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
|
|
13
|
-
export interface ICreateRequest {
|
|
14
|
-
name: string;
|
|
15
|
-
initial_date: Date;
|
|
16
|
-
final_date: Date;
|
|
17
|
-
active_for_purchases_above?: number;
|
|
18
|
-
free_shipping_for_purchases_above?: number | null;
|
|
19
|
-
discount: number;
|
|
20
|
-
}
|
|
21
|
-
export interface IUpdateRequest {
|
|
22
|
-
name?: string;
|
|
23
|
-
initial_date?: Date;
|
|
24
|
-
final_date?: Date;
|
|
25
|
-
active_for_purchases_above?: number;
|
|
26
|
-
free_shipping_for_purchases_above?: number | null;
|
|
27
|
-
discount?: number;
|
|
28
|
-
}
|
|
29
|
-
export interface IRepository {
|
|
30
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
31
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
32
|
-
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
33
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
34
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
35
|
-
create(data: ICreateRequest): Promise<Entity>;
|
|
36
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
37
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
|
|
38
|
-
}
|
|
39
|
-
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
40
|
-
export {};
|
|
@@ -33,13 +33,10 @@ export interface IExportCsvResponse {
|
|
|
33
33
|
unitOfMeasure: string;
|
|
34
34
|
closingStockValue: number;
|
|
35
35
|
}
|
|
36
|
-
export interface IFindStockMovementPaginatedRequest extends IShared.IFindByOwnerIdRequest, IShared.IPaginationRequest {
|
|
37
|
-
}
|
|
38
36
|
export interface IRepository {
|
|
39
37
|
findByProvider(selector: IShared.IFindByIdNumberRequest): Promise<IFindByProviderResponse[]>;
|
|
40
38
|
findByOwnerId(selector: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
41
39
|
exportCsv(selector: IExportRequest): Promise<IExportCsvResponse[]>;
|
|
42
|
-
findStockMovementPaginated(selector: IFindStockMovementPaginatedRequest): Promise<IShared.IPaginationResponse<IFindByOwnerIdResponse>>;
|
|
43
40
|
}
|
|
44
41
|
export interface IController extends IRepository {
|
|
45
42
|
findByOwnerId(selector: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
@@ -19,14 +19,12 @@ interface IFindDetailedResponse extends Entity {
|
|
|
19
19
|
default_vehicle: Vehicles | null;
|
|
20
20
|
}
|
|
21
21
|
export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
|
|
22
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "user" | "main_persona" | "client_type" | "segments_area" | "country" | "language" | "default_payment_method" | "default_maturity_date" | "default_delivery_method" | "default_vehicle">;
|
|
23
22
|
export interface IFindByQueryRequest {
|
|
24
23
|
number?: number[];
|
|
25
24
|
id?: string[];
|
|
26
25
|
nif?: string | null;
|
|
27
26
|
}
|
|
28
27
|
export type IFindResponse = Omit<IFindDetailedResponse, "">;
|
|
29
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
|
|
30
28
|
export type ICreateMainPersona = Pick<Persona, "nif" | "name" | "email" | "telephone"> & Partial<Pick<Persona, "street" | "locality" | "postal_code" | "country_id" | "vat_taxpayer">>;
|
|
31
29
|
export interface ICreateRequest {
|
|
32
30
|
user_id?: string;
|
|
@@ -66,14 +64,10 @@ export interface IUpdateRequest {
|
|
|
66
64
|
}
|
|
67
65
|
export interface IRepository {
|
|
68
66
|
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
69
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
70
67
|
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
71
68
|
findByQuery(params: IFindByQueryRequest): Promise<IFindResponse[]>;
|
|
72
|
-
find(): Promise<IFindResponse[]>;
|
|
73
|
-
findPaginated(selector: IShared.IPaginationRequest): Promise<IFindWithPaginationResponse>;
|
|
74
69
|
create(data: ICreateRequest): Promise<IFindResponse>;
|
|
75
70
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
|
|
76
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
77
71
|
}
|
|
78
72
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
79
73
|
export {};
|
|
@@ -16,13 +16,7 @@ interface IFindDetailedResponse extends Entity {
|
|
|
16
16
|
default_delivery_method: DeliveryMethods | null;
|
|
17
17
|
default_vehicle: Vehicles | null;
|
|
18
18
|
}
|
|
19
|
-
export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
|
|
20
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "user" | "main_persona" | "country" | "language" | "default_payment_method" | "default_maturity_date" | "default_delivery_method" | "default_vehicle">;
|
|
21
|
-
export type IFindRequest = Record<string, unknown>;
|
|
22
19
|
export type IFindResponse = Omit<IFindDetailedResponse, "">;
|
|
23
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
|
|
24
|
-
}
|
|
25
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
|
|
26
20
|
export type ICreateMainPersona = Pick<Persona, "nif" | "name" | "email" | "telephone">;
|
|
27
21
|
export interface ICreateRequest {
|
|
28
22
|
user_id: string;
|
|
@@ -47,14 +41,8 @@ export interface IUpdateRequest {
|
|
|
47
41
|
default_vehicle_id?: string | null;
|
|
48
42
|
}
|
|
49
43
|
export interface IRepository {
|
|
50
|
-
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
51
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
52
|
-
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
53
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
54
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
55
44
|
create(data: ICreateRequest): Promise<IFindResponse>;
|
|
56
45
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
|
|
57
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
58
46
|
}
|
|
59
47
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
60
48
|
export {};
|
|
@@ -162,9 +162,8 @@ export interface IDuplicatedGroupResponse {
|
|
|
162
162
|
data?: IDuplicatedGroupData;
|
|
163
163
|
members: IDuplicatedGroupMember[];
|
|
164
164
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
165
|
+
/** `GET find_duplicateds` não recebe parâmetros. */
|
|
166
|
+
export type IFindDuplicatedsRequest = Record<string, never>;
|
|
168
167
|
export interface IExecuteMergeDuplicatedGroupRequest {
|
|
169
168
|
target_client_id: string;
|
|
170
169
|
source_client_ids: string[];
|
|
@@ -190,7 +189,6 @@ export interface IRepository {
|
|
|
190
189
|
publicUpdate(selector: IShared.IFindByIdRequest, data: IPublicUpdateRequest): Promise<void>;
|
|
191
190
|
findDuplicateds(): Promise<IDuplicatedGroupResponse[]>;
|
|
192
191
|
refreshDuplicateds(): Promise<void>;
|
|
193
|
-
resolveDuplicateds(selector: IShared.IFindByIdRequest, data: IResolveDuplicatedGroupRequest): Promise<void>;
|
|
194
192
|
executeMergeDuplicateds(selector: IShared.IFindByIdRequest, data: IExecuteMergeDuplicatedGroupRequest): Promise<IExecuteMergeDuplicatedGroupResponse>;
|
|
195
193
|
}
|
|
196
194
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -20,14 +20,11 @@ interface IFindDetailedResponse extends Entity {
|
|
|
20
20
|
default_vehicle: Vehicles | null;
|
|
21
21
|
}
|
|
22
22
|
export type IFindByIdResponse = Omit<IFindDetailedResponse, "">;
|
|
23
|
-
export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, "user" | "main_persona" | "country" | "language" | "support_language" | "provider_type" | "default_payment_method" | "default_maturity_date" | "default_delivery_method" | "default_vehicle">;
|
|
24
23
|
export interface IFindByQueryRequest {
|
|
25
24
|
number?: number[];
|
|
26
25
|
id?: string[];
|
|
27
26
|
}
|
|
28
27
|
export type IFindResponse = Omit<IFindDetailedResponse, "">;
|
|
29
|
-
export type IFindPaginatedRequest = IShared.IPaginationRequest;
|
|
30
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, "">>;
|
|
31
28
|
export type ICreateMainPersona = Pick<Persona, "nif" | "name" | "email" | "telephone">;
|
|
32
29
|
export interface ICreateRequest {
|
|
33
30
|
user_id?: string;
|
|
@@ -72,15 +69,10 @@ export interface IFindByNumberResponse extends Pick<DocumentHeader, "owner_id" |
|
|
|
72
69
|
}
|
|
73
70
|
export interface IRepository {
|
|
74
71
|
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
75
|
-
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
76
72
|
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
77
|
-
findMinifiedManufacturer(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
78
73
|
findByQuery(params: IFindByQueryRequest): Promise<IFindResponse[]>;
|
|
79
|
-
find(): Promise<IFindResponse[]>;
|
|
80
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
81
74
|
create(data: ICreateRequest): Promise<IFindResponse>;
|
|
82
75
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
|
|
83
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
84
76
|
findByNumber(selector: IFindByNumberRequest): Promise<IFindByNumberResponse | null>;
|
|
85
77
|
}
|
|
86
78
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -54,11 +54,6 @@ export interface IFindByIdResponse extends EntityWithoutPassword {
|
|
|
54
54
|
main_persona: IMainPersona;
|
|
55
55
|
}) | null;
|
|
56
56
|
}
|
|
57
|
-
export type IFindRequest = Record<string, unknown>;
|
|
58
|
-
export type IFindResponse = EntityWithoutPassword;
|
|
59
|
-
export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
|
|
60
|
-
}
|
|
61
|
-
export type IFindWithPaginationResponse = IShared.IPaginationResponse<EntityWithoutPassword>;
|
|
62
57
|
export interface IFindProvidersWithClientIdResponse {
|
|
63
58
|
name: string;
|
|
64
59
|
provider_id: string;
|
|
@@ -67,13 +62,6 @@ export interface IFindProvidersWithClientIdResponse {
|
|
|
67
62
|
export interface IFindProvidersWithClientIdRequest {
|
|
68
63
|
provider_ids: string[];
|
|
69
64
|
}
|
|
70
|
-
export interface ICreateRequest {
|
|
71
|
-
password: string;
|
|
72
|
-
}
|
|
73
|
-
export interface IUpdateRequest {
|
|
74
|
-
old_password?: string;
|
|
75
|
-
password?: string;
|
|
76
|
-
}
|
|
77
65
|
export interface IUpdatePassword {
|
|
78
66
|
password: string;
|
|
79
67
|
}
|
|
@@ -96,17 +84,10 @@ export interface IFindFromClientOrProviderResponse {
|
|
|
96
84
|
}
|
|
97
85
|
export interface IRepository {
|
|
98
86
|
findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
|
|
99
|
-
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
100
|
-
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
101
|
-
findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
102
87
|
resetPassword(id: string, data: IUpdatePassword): Promise<Users>;
|
|
103
|
-
removeAccess(user_id: string): Promise<boolean>;
|
|
104
|
-
create(data: ICreateRequest): Promise<IFindResponse>;
|
|
105
|
-
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
|
|
106
|
-
deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
107
88
|
findProvidersWithClientId(data: IFindProvidersWithClientIdRequest): Promise<IFindProvidersWithClientIdResponse[]>;
|
|
108
89
|
findFromClientOrProviderId(data: IFindFromClientOrProviderRequest): Promise<IFindFromClientOrProviderResponse[]>;
|
|
109
90
|
}
|
|
110
91
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
111
|
-
export type IApi = Omit<IRepository, "resetPassword"
|
|
92
|
+
export type IApi = Omit<IRepository, "resetPassword">;
|
|
112
93
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomalism-com/types",
|
|
3
3
|
"description": "A nomalism package with all necessary types and validations for developing APIs",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.59",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@swc/core": "^1.16.13",
|
|
29
|
-
"@types/node": "^26.6.
|
|
29
|
+
"@types/node": "^26.6.5",
|
|
30
30
|
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
|
31
31
|
"@typescript-eslint/parser": "^8.62.0",
|
|
32
32
|
"eslint": "^10.12.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"globals": "^17.13.0",
|
|
36
36
|
"husky": "^9.1.7",
|
|
37
37
|
"lint-staged": "^17.6.0",
|
|
38
|
-
"prettier": "^3.9.
|
|
38
|
+
"prettier": "^3.9.10",
|
|
39
39
|
"tsup": "^8.5.1",
|
|
40
40
|
"typescript-eslint": "^8.71.1"
|
|
41
41
|
},
|