@nomalism-com/types 0.9.481 → 0.9.483

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.
@@ -53,10 +53,15 @@ export type IFindWithPaginationResponse = IShared.IPaginationResponse<IFindRespo
53
53
  export interface IPrintLabelQueryRequest {
54
54
  token: string;
55
55
  }
56
+ export interface IBasicSearchRequest extends IShared.IPaginationRequest {
57
+ search_value: string | null;
58
+ inactive?: boolean;
59
+ }
56
60
  export interface IRepository {
57
61
  create(data: ICreateRequest): Promise<Entity>;
58
62
  find(data: IFindRequest): Promise<IFindResponse[]>;
59
63
  findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
64
+ findByBasicSearch(data: IBasicSearchRequest): Promise<IShared.IPaginationResponse<IFindResponse>>;
60
65
  findCabideProviders(search_value: IShared.IFindMinifiedRequest): Promise<IFindCabideProvidersResponse[]>;
61
66
  findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
62
67
  findByIdProvider(selector: IFindByIdProviderRequest): Promise<IFindByIdProviderResponse[]>;
@@ -5,3 +5,4 @@ export declare const findQueryParams: joi.ObjectSchema<any>;
5
5
  export declare const findByIdProviderBody: joi.ObjectSchema<any>;
6
6
  export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
7
7
  export declare const printLabelQuery: joi.ObjectSchema<any>;
8
+ export declare const basicSearchQuery: joi.ObjectSchema<any>;
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.printLabelQuery = exports.findWithPaginationQuery = exports.findByIdProviderBody = exports.findQueryParams = exports.updateBody = exports.createBody = void 0;
17
+ exports.basicSearchQuery = exports.printLabelQuery = exports.findWithPaginationQuery = exports.findByIdProviderBody = exports.findQueryParams = exports.updateBody = exports.createBody = void 0;
18
18
  var joi_1 = __importDefault(require("joi"));
19
19
  var messages_1 = require("../../../shared/messages");
20
20
  var createBodyKeys = {
@@ -55,3 +55,19 @@ exports.printLabelQuery = joi_1.default
55
55
  .object()
56
56
  .keys(printLabelQueryKeys)
57
57
  .messages(messages_1.messages);
58
+ var basicSearchQueryKeys = {
59
+ search_value: joi_1.default.string().allow('', null).optional(),
60
+ per_page: joi_1.default
61
+ .number()
62
+ .positive()
63
+ .integer()
64
+ .default(10)
65
+ .allow(null)
66
+ .optional(),
67
+ inactive: joi_1.default.boolean().default(false).optional(),
68
+ current_page: joi_1.default.number().positive().integer().allow(null).optional(),
69
+ };
70
+ exports.basicSearchQuery = joi_1.default
71
+ .object()
72
+ .keys(basicSearchQueryKeys)
73
+ .messages(messages_1.messages);
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
- {
2
- "name": "@nomalism-com/types",
3
- "description": "A nomalism package with all necessary types and validations for developing APIs",
4
- "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
5
- "keywords": [
6
- "nomalism",
7
- "api",
8
- "types",
9
- "typescript",
10
- "helper"
11
- ],
12
- "version": "0.9.481",
13
- "main": "./dist/index.js",
14
- "types": "./dist/index.d.ts",
15
- "files": [
16
- "dist"
17
- ],
18
- "browserslist": "> 0.25%, not dead",
19
- "license": "UNLICENSED",
20
- "homepage": "https://gitlab.com/nomalism-develop/types",
21
- "bugs": {
22
- "url": "https://gitlab.com/nomalism-develop/types/issues"
23
- },
24
- "repository": {
25
- "type": "git",
26
- "url": "git+https://gitlab.com/nomalism-develop/types.git"
27
- },
28
- "scripts": {
29
- "lint": "eslint src --ext .ts,.js --ignore-pattern node_modules --ignore-pattern dist --cache",
30
- "build": "rm -rf dist && tsc --project tsconfig.json",
31
- "start": "tsx --tsconfig ./tsconfig.json src/index.ts",
32
- "prepack": "concurrently --success all \"npm run lint\" \"npm run build\" \"npm run start\""
33
- },
34
- "dependencies": {
35
- "convert-units": "^2.3.4",
36
- "joi": "^17.9.2",
37
- "joi-to-swagger": "^6.2.0"
38
- },
39
- "devDependencies": {
40
- "@types/convert-units": "^2.3.6",
41
- "@types/node": "^18.16.19",
42
- "@typescript-eslint/eslint-plugin": "^5.61.0",
43
- "@typescript-eslint/parser": "^5.61.0",
44
- "concurrently": "^8.2.0",
45
- "eslint": "^8.44.0",
46
- "eslint-config-airbnb-base": "^15.0.0",
47
- "eslint-config-prettier": "^8.8.0",
48
- "eslint-import-resolver-typescript": "^3.5.5",
49
- "eslint-plugin-import": "^2.27.5",
50
- "eslint-plugin-prettier": "^4.2.1",
51
- "prettier": "^2.8.8",
52
- "tsx": "^3.12.7",
53
- "typescript": "^5.1.6"
54
- }
55
- }
1
+ {
2
+ "name": "@nomalism-com/types",
3
+ "description": "A nomalism package with all necessary types and validations for developing APIs",
4
+ "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
5
+ "keywords": [
6
+ "nomalism",
7
+ "api",
8
+ "types",
9
+ "typescript",
10
+ "helper"
11
+ ],
12
+ "version": "0.9.483",
13
+ "main": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "browserslist": "> 0.25%, not dead",
19
+ "license": "UNLICENSED",
20
+ "homepage": "https://gitlab.com/nomalism-develop/types",
21
+ "bugs": {
22
+ "url": "https://gitlab.com/nomalism-develop/types/issues"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://gitlab.com/nomalism-develop/types.git"
27
+ },
28
+ "scripts": {
29
+ "lint": "eslint src --ext .ts,.js --ignore-pattern node_modules --ignore-pattern dist --cache",
30
+ "build": "rm -rf dist && tsc --project tsconfig.json",
31
+ "start": "tsx --tsconfig ./tsconfig.json src/index.ts",
32
+ "prepack": "concurrently --success all \"npm run lint\" \"npm run build\" \"npm run start\""
33
+ },
34
+ "dependencies": {
35
+ "convert-units": "^2.3.4",
36
+ "joi": "^17.9.2",
37
+ "joi-to-swagger": "^6.2.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/convert-units": "^2.3.6",
41
+ "@types/node": "^18.16.19",
42
+ "@typescript-eslint/eslint-plugin": "^5.61.0",
43
+ "@typescript-eslint/parser": "^5.61.0",
44
+ "concurrently": "^8.2.0",
45
+ "eslint": "^8.44.0",
46
+ "eslint-config-airbnb-base": "^15.0.0",
47
+ "eslint-config-prettier": "^8.8.0",
48
+ "eslint-import-resolver-typescript": "^3.5.5",
49
+ "eslint-plugin-import": "^2.27.5",
50
+ "eslint-plugin-prettier": "^4.2.1",
51
+ "prettier": "^2.8.8",
52
+ "tsx": "^3.12.7",
53
+ "typescript": "^5.1.6"
54
+ }
55
+ }