@nomalism-com/types 0.47.17 → 0.47.19
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 +9 -2
- package/dist/index.js +9 -2
- package/dist/modules/document/billOfLading/interfaces.d.ts +1 -1
- package/dist/modules/documentManagement/multimedia/interfaces.d.ts +2 -2
- package/dist/modules/stock/productGoogleSheets/interface.d.ts +2 -2
- package/dist/modules/stock/queryList/interfaces.d.ts +1 -2
- package/dist/shared/interface.d.ts +2 -2
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -407,7 +407,7 @@ var messages = {
|
|
|
407
407
|
var createBillOfLadingBody = joi.object().keys({
|
|
408
408
|
persona_id: joi.string().uuid().required(),
|
|
409
409
|
persona_name: joi.string().required(),
|
|
410
|
-
persona_nif: joi.string().
|
|
410
|
+
persona_nif: joi.string().optional().allow("", null),
|
|
411
411
|
document_type_id: joi.number().required(),
|
|
412
412
|
from_document_header_id: joi.string().required(),
|
|
413
413
|
delivery_addresses: joi.object().keys({
|
|
@@ -1888,7 +1888,14 @@ var createBodyKeys13 = {
|
|
|
1888
1888
|
var createBody15 = joi42.object().keys(createBodyKeys13).messages(messages);
|
|
1889
1889
|
var updateBodyKeys12 = {
|
|
1890
1890
|
chat_document_header_id: joi42.string().uuid().optional(),
|
|
1891
|
-
filename: joi42.string().min(1).max(255).
|
|
1891
|
+
filename: joi42.string().min(1).max(255).pattern(/^[^<>:"/\\|?*]+$/).custom((value, helpers) => {
|
|
1892
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
1893
|
+
if (value.charCodeAt(i) <= 31) {
|
|
1894
|
+
return helpers.error("string.pattern.base");
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
return value;
|
|
1898
|
+
}).optional()
|
|
1892
1899
|
};
|
|
1893
1900
|
var updateBody12 = joi42.object().keys(updateBodyKeys12).messages(messages);
|
|
1894
1901
|
var findByOwnerIdQuery = joi42.object().keys({
|
package/dist/index.js
CHANGED
|
@@ -407,7 +407,7 @@ var messages = {
|
|
|
407
407
|
var createBillOfLadingBody = joi.object().keys({
|
|
408
408
|
persona_id: joi.string().uuid().required(),
|
|
409
409
|
persona_name: joi.string().required(),
|
|
410
|
-
persona_nif: joi.string().
|
|
410
|
+
persona_nif: joi.string().optional().allow("", null),
|
|
411
411
|
document_type_id: joi.number().required(),
|
|
412
412
|
from_document_header_id: joi.string().required(),
|
|
413
413
|
delivery_addresses: joi.object().keys({
|
|
@@ -1888,7 +1888,14 @@ var createBodyKeys13 = {
|
|
|
1888
1888
|
var createBody15 = joi42.object().keys(createBodyKeys13).messages(messages);
|
|
1889
1889
|
var updateBodyKeys12 = {
|
|
1890
1890
|
chat_document_header_id: joi42.string().uuid().optional(),
|
|
1891
|
-
filename: joi42.string().min(1).max(255).
|
|
1891
|
+
filename: joi42.string().min(1).max(255).pattern(/^[^<>:"/\\|?*]+$/).custom((value, helpers) => {
|
|
1892
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
1893
|
+
if (value.charCodeAt(i) <= 31) {
|
|
1894
|
+
return helpers.error("string.pattern.base");
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
return value;
|
|
1898
|
+
}).optional()
|
|
1892
1899
|
};
|
|
1893
1900
|
var updateBody12 = joi42.object().keys(updateBodyKeys12).messages(messages);
|
|
1894
1901
|
var findByOwnerIdQuery = joi42.object().keys({
|
|
@@ -13,7 +13,7 @@ export interface IDeliveryAddressRequest {
|
|
|
13
13
|
export interface ICreateRequest {
|
|
14
14
|
persona_id: string;
|
|
15
15
|
persona_name: string;
|
|
16
|
-
persona_nif
|
|
16
|
+
persona_nif?: string;
|
|
17
17
|
document_type_id: number;
|
|
18
18
|
from_document_header_id: string;
|
|
19
19
|
delivery_addresses: IDeliveryAddressRequest;
|
|
@@ -5,8 +5,8 @@ export interface IFindByIdRequest {
|
|
|
5
5
|
download?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export interface IRepository {
|
|
8
|
-
create(multipartFormData:
|
|
9
|
-
update(id: string, multipartFormData:
|
|
8
|
+
create(multipartFormData: unknown, headers?: Record<string, string>): Promise<Entity>;
|
|
9
|
+
update(id: string, multipartFormData: unknown, headers?: Record<string, string>): Promise<void>;
|
|
10
10
|
findById(multimedia_id: string): Promise<Entity | null>;
|
|
11
11
|
}
|
|
12
12
|
export interface IController extends Omit<IRepository, "findById"> {
|
|
@@ -6,8 +6,8 @@ export type IProductPromotionVirtuals = ProductPromotionVirtuals;
|
|
|
6
6
|
export type IProductVirtuals = ProductVirtuals;
|
|
7
7
|
export type IProductBaseVirtuals = ProductBaseVirtuals;
|
|
8
8
|
export type Entity = ProductSheet;
|
|
9
|
-
export type IProductsForSheetsResponse = Record<string,
|
|
10
|
-
export type IProductFromSheetsValues = Record<string,
|
|
9
|
+
export type IProductsForSheetsResponse = Record<string, unknown>;
|
|
10
|
+
export type IProductFromSheetsValues = Record<string, unknown>;
|
|
11
11
|
export type IProductSheetState = "Ativa" | "NaoVemMais" | "VemTemporariamente" | "DescontinuadoFabrica";
|
|
12
12
|
export declare const ProductStateEnum: {
|
|
13
13
|
Ativa: "Ativa";
|
|
@@ -17,7 +17,7 @@ export interface IFindResponse extends QueryList {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const executeOutput: readonly ["csv", "pdf", "xlsx", "json"];
|
|
19
19
|
export type IExecuteOutput = (typeof executeOutput)[number];
|
|
20
|
-
type IParameterDataType = string | Date | number | boolean | null | undefined;
|
|
20
|
+
export type IParameterDataType = string | Date | number | boolean | null | undefined;
|
|
21
21
|
export type IExecuteInputParameters = Record<string, IParameterDataType>;
|
|
22
22
|
export interface IExecuteRequest extends IExecuteInputParameters {
|
|
23
23
|
query_id: string;
|
|
@@ -39,4 +39,3 @@ export type IApi = Omit<IRepository, "execute"> & {
|
|
|
39
39
|
execute(data: IExecuteRequest): Promise<IExecuteResponse>;
|
|
40
40
|
};
|
|
41
41
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
42
|
-
export {};
|
|
@@ -44,7 +44,7 @@ export interface IUserToken {
|
|
|
44
44
|
system_modules?: SystemModuleEnum[];
|
|
45
45
|
}
|
|
46
46
|
export type IEntityWithUserToken<T> = {
|
|
47
|
-
[K in keyof T]: T[K] extends (...params: infer U) =>
|
|
47
|
+
[K in keyof T]: T[K] extends (...params: infer U) => unknown ? (...params: [...U, IUserToken]) => ReturnType<T[K]> : T[K];
|
|
48
48
|
};
|
|
49
49
|
export type WithStamps = WithTimestamps & WithUserstamps;
|
|
50
50
|
export type WithStampsResponse<T> = T & WithStamps;
|
|
@@ -422,7 +422,7 @@ export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<
|
|
|
422
422
|
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
423
423
|
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
424
424
|
}[Keys];
|
|
425
|
-
type Impossible<K extends
|
|
425
|
+
type Impossible<K extends PropertyKey> = {
|
|
426
426
|
[P in K]: never;
|
|
427
427
|
};
|
|
428
428
|
export type NoExtraProperties<T, U extends T = T> = U & Impossible<Exclude<keyof U, keyof T>>;
|
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": "0.47.
|
|
4
|
+
"version": "0.47.19",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"prepare": "husky"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"joi": "^18.2.
|
|
30
|
+
"joi": "^18.2.5"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@eslint/js": "^10.0.1",
|
|
34
|
-
"@swc/core": "^1.
|
|
35
|
-
"@types/node": "^26.
|
|
34
|
+
"@swc/core": "^1.16.1",
|
|
35
|
+
"@types/node": "^26.3.0",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
|
37
37
|
"@typescript-eslint/parser": "^8.62.0",
|
|
38
|
-
"eslint": "^10.
|
|
38
|
+
"eslint": "^10.9.1",
|
|
39
39
|
"eslint-config-prettier": "^10.1.8",
|
|
40
40
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
41
|
-
"globals": "^17.
|
|
41
|
+
"globals": "^17.11.0",
|
|
42
42
|
"husky": "^9.1.7",
|
|
43
|
-
"lint-staged": "^17.
|
|
44
|
-
"prettier": "^3.9.
|
|
43
|
+
"lint-staged": "^17.3.0",
|
|
44
|
+
"prettier": "^3.9.6",
|
|
45
45
|
"tsup": "^8.5.1",
|
|
46
|
-
"typescript-eslint": "^8.
|
|
46
|
+
"typescript-eslint": "^8.68.0"
|
|
47
47
|
},
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|