@nomalism-com/types 0.9.554 → 0.9.556

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.
@@ -21,13 +21,16 @@ export interface IFindByQueryRequest {
21
21
  description?: string;
22
22
  internal?: boolean;
23
23
  }
24
+ export interface IFindByOwnersRequest {
25
+ owner_ids: string[];
26
+ }
24
27
  export interface IFindByOwnerResponse extends Entity {
25
28
  observation_type: ObservationType | null;
26
29
  }
27
30
  export interface IRepository {
28
31
  findById(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
29
32
  findByQuery(data: IFindByQueryRequest): Promise<Entity[]>;
30
- findByOwner(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerResponse[]>;
33
+ findByOwner(params: IFindByOwnersRequest): Promise<IFindByOwnerResponse[]>;
31
34
  create(data: ICreateRequest): Promise<IFindByOwnerResponse>;
32
35
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindByOwnerResponse | null>;
33
36
  deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
@@ -1,7 +1,9 @@
1
1
  import joi from 'joi';
2
- import { ICreateRequest, IUpdateRequest } from './interfaces';
2
+ import { ICreateRequest, IUpdateRequest, IFindByOwnersRequest } from './interfaces';
3
3
  import * as IShared from '../../../shared/interface';
4
4
  export declare const createBodyKeys: IShared.IRouteRequest<ICreateRequest>;
5
5
  export declare const createBody: joi.ObjectSchema<any>;
6
6
  export declare const updateBodyKeys: IShared.IRouteRequest<IUpdateRequest>;
7
7
  export declare const updateBody: joi.ObjectSchema<any>;
8
+ export declare const findByOwnerQueryKeys: IShared.IRouteRequest<IFindByOwnersRequest>;
9
+ export declare const findByOwnerQuery: joi.ObjectSchema<any>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.updateBody = exports.updateBodyKeys = exports.createBody = exports.createBodyKeys = void 0;
6
+ exports.findByOwnerQuery = exports.findByOwnerQueryKeys = exports.updateBody = exports.updateBodyKeys = exports.createBody = exports.createBodyKeys = void 0;
7
7
  var joi_1 = __importDefault(require("joi"));
8
8
  var messages_1 = require("../../../shared/messages");
9
9
  exports.createBodyKeys = {
@@ -19,3 +19,10 @@ exports.updateBodyKeys = {
19
19
  internal: joi_1.default.boolean().optional(),
20
20
  };
21
21
  exports.updateBody = joi_1.default.object().keys(exports.updateBodyKeys).messages(messages_1.messages);
22
+ exports.findByOwnerQueryKeys = {
23
+ owner_ids: joi_1.default.array().items(joi_1.default.string().uuid().required()).required(),
24
+ };
25
+ exports.findByOwnerQuery = joi_1.default
26
+ .object()
27
+ .keys(exports.findByOwnerQueryKeys)
28
+ .messages(messages_1.messages);
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.9.554",
12
+ "version": "0.9.556",
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [
@@ -33,23 +33,23 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "convert-units": "^2.3.4",
36
- "joi": "^17.9.2",
36
+ "joi": "^17.10.2",
37
37
  "joi-to-swagger": "^6.2.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@types/convert-units": "^2.3.6",
41
- "@types/node": "^18.17.1",
42
- "@typescript-eslint/eslint-plugin": "^5.62.0",
43
- "@typescript-eslint/parser": "^5.62.0",
44
- "concurrently": "^8.2.0",
45
- "eslint": "^8.45.0",
40
+ "@types/convert-units": "^2.3.7",
41
+ "@types/node": "^18.17.18",
42
+ "@typescript-eslint/eslint-plugin": "^6.7.2",
43
+ "@typescript-eslint/parser": "^6.7.2",
44
+ "concurrently": "^8.2.1",
45
+ "eslint": "^8.49.0",
46
46
  "eslint-config-airbnb-base": "^15.0.0",
47
- "eslint-config-prettier": "^8.9.0",
48
- "eslint-import-resolver-typescript": "^3.5.5",
49
- "eslint-plugin-import": "^2.28.0",
50
- "eslint-plugin-prettier": "^4.2.1",
51
- "prettier": "^2.8.8",
52
- "tsx": "^3.12.7",
53
- "typescript": "^5.1.6"
47
+ "eslint-config-prettier": "^9.0.0",
48
+ "eslint-import-resolver-typescript": "^3.6.0",
49
+ "eslint-plugin-import": "^2.28.1",
50
+ "eslint-plugin-prettier": "^5.0.0",
51
+ "prettier": "^3.0.3",
52
+ "tsx": "^3.12.10",
53
+ "typescript": "^5.2.2"
54
54
  }
55
55
  }