@nomalism-com/types 0.16.32 → 0.16.34

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.
@@ -40,54 +40,42 @@ var sendBodyKeys = {
40
40
  .required(),
41
41
  to: joi_1.default
42
42
  .array()
43
- .items(joi_1.default
44
- .object()
45
- .keys({
43
+ .items(joi_1.default.object().keys({
46
44
  name: joi_1.default.string().required(),
47
45
  address: joi_1.default
48
46
  .string()
49
47
  .email({ tlds: { allow: false } })
50
48
  .required(),
51
- })
52
- .required())
49
+ }))
53
50
  .required(),
54
51
  cc: joi_1.default
55
52
  .array()
56
- .items(joi_1.default
57
- .object()
58
- .keys({
53
+ .items(joi_1.default.object().keys({
59
54
  name: joi_1.default.string().required(),
60
55
  address: joi_1.default
61
56
  .string()
62
57
  .email({ tlds: { allow: false } })
63
58
  .required(),
64
- })
65
- .required())
59
+ }))
66
60
  .required(),
67
61
  bcc: joi_1.default
68
62
  .array()
69
- .items(joi_1.default
70
- .object()
71
- .keys({
63
+ .items(joi_1.default.object().keys({
72
64
  name: joi_1.default.string().required(),
73
65
  address: joi_1.default
74
66
  .string()
75
67
  .email({ tlds: { allow: false } })
76
68
  .required(),
77
- })
78
- .required())
69
+ }))
79
70
  .required(),
80
71
  subject: joi_1.default.string().required(),
81
72
  html: joi_1.default.string().required(),
82
73
  attachments: joi_1.default
83
74
  .array()
84
- .items(joi_1.default
85
- .object()
86
- .keys({
75
+ .items(joi_1.default.object().keys({
87
76
  filename: joi_1.default.string().required(),
88
77
  path: joi_1.default.string().required(),
89
- })
90
- .required())
78
+ }))
91
79
  .required(),
92
80
  };
93
81
  exports.sendBody = joi_1.default.object().keys(sendBodyKeys).messages(messages_1.messages);
@@ -27,12 +27,20 @@ export interface ICheckLinesInPrisonLinesRequest {
27
27
  export interface ICheckLinesInPrisonRequest {
28
28
  lines: ICheckLinesInPrisonLinesRequest[];
29
29
  }
30
+ export interface ICreateLinesInPrisonProduct {
31
+ product_id: string;
32
+ quantity: number;
33
+ }
34
+ export interface ICreateLinesInPrisonRequest {
35
+ products: ICreateLinesInPrisonProduct[];
36
+ }
30
37
  export interface IRepository {
31
38
  findLinesInPrison(): Promise<IFindLinesInPrisonResponse[]>;
32
39
  findLinesInPrisonProviders(): Promise<IShared.IFindMinifiedResponse[]>;
33
40
  putLineInPrison(params: IShared.IFindByIdRequest): Promise<void>;
34
41
  removeLineFromPrison(params: IShared.IFindByIdRequest): Promise<void>;
35
42
  checkLinesInPrison(params: ICheckLinesInPrisonRequest): Promise<IShared.IBrokerMessage<IShared.IBrokerTopic>[]>;
43
+ createLinesInPrison(params: ICreateLinesInPrisonRequest): Promise<string>;
36
44
  }
37
45
  export type IApi = Omit<IRepository, 'checkLinesInPrison'> & {
38
46
  checkLinesInPrison(params: ICheckLinesInPrisonRequest): Promise<void>;
@@ -1,2 +1,4 @@
1
1
  import joi from 'joi';
2
+ import { ICreateLinesInPrisonRequest } from './interface';
2
3
  export declare const checkLinesInPrisonBody: joi.ObjectSchema<any>;
4
+ export declare const createLinesInPrisonBody: joi.ObjectSchema<ICreateLinesInPrisonRequest>;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.checkLinesInPrisonBody = void 0;
7
+ exports.createLinesInPrisonBody = exports.checkLinesInPrisonBody = void 0;
8
8
  var joi_1 = __importDefault(require("joi"));
9
9
  var messages_1 = require("../../../shared/messages");
10
10
  var interface_1 = require("./interface");
@@ -25,3 +25,18 @@ exports.checkLinesInPrisonBody = joi_1.default
25
25
  .object()
26
26
  .keys(checkLinesInPrisonBodyKeys)
27
27
  .messages(messages_1.messages);
28
+ exports.createLinesInPrisonBody = joi_1.default
29
+ .object()
30
+ .keys({
31
+ products: joi_1.default
32
+ .array()
33
+ .items(joi_1.default
34
+ .object()
35
+ .keys({
36
+ product_id: joi_1.default.string().uuid().required(),
37
+ quantity: joi_1.default.number().positive().allow(0).required(),
38
+ })
39
+ .required())
40
+ .required(),
41
+ })
42
+ .required();
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.16.32",
12
+ "version": "0.16.34",
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [