@nomalism-com/types 0.47.18 → 0.47.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
@@ -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).regex(/^[^<>:"/\\|?*\x00-\x1F]+$/).optional()
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
@@ -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).regex(/^[^<>:"/\\|?*\x00-\x1F]+$/).optional()
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({
@@ -5,8 +5,8 @@ export interface IFindByIdRequest {
5
5
  download?: boolean;
6
6
  }
7
7
  export interface IRepository {
8
- create(multipartFormData: any, headers?: any): Promise<Entity>;
9
- update(id: string, multipartFormData: any, headers?: any): Promise<void>;
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"> {
@@ -39,7 +39,7 @@ export interface IFindResponse {
39
39
  }
40
40
  export interface IRepository {
41
41
  claim(): Promise<IClaimResponse[]>;
42
- result(id: string, data: IResultRequest): Promise<void>;
42
+ result(id: string, data: IResultRequest, sender_id: string): Promise<void>;
43
43
  findById(id: string): Promise<IFindResponse>;
44
44
  find(): Promise<IFindResponse[]>;
45
45
  }
@@ -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, any>;
10
- export type IProductFromSheetsValues = Record<string, any>;
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) => any ? (...params: [...U, IUserToken]) => ReturnType<T[K]> : T[K];
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 keyof any> = {
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.18",
4
+ "version": "0.47.21",
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.3"
30
+ "joi": "^18.2.5"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@eslint/js": "^10.0.1",
34
- "@swc/core": "^1.15.46",
35
- "@types/node": "^26.1.1",
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.7.0",
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.7.0",
41
+ "globals": "^17.11.0",
42
42
  "husky": "^9.1.7",
43
- "lint-staged": "^17.1.0",
44
- "prettier": "^3.9.5",
43
+ "lint-staged": "^17.3.0",
44
+ "prettier": "^3.9.6",
45
45
  "tsup": "^8.5.1",
46
- "typescript-eslint": "^8.65.0"
46
+ "typescript-eslint": "^8.68.0"
47
47
  },
48
48
  "repository": {
49
49
  "type": "git",