autoinspector 1.1.1 → 2.0.0-beta.1

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.
Files changed (79) hide show
  1. package/.env +6 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +4 -0
  4. package/dist/package.json +57 -0
  5. package/dist/resources/Autoinspector.d.ts +22 -0
  6. package/dist/resources/Autoinspector.js +43 -0
  7. package/dist/resources/Car.d.ts +10 -0
  8. package/dist/resources/Car.js +41 -0
  9. package/dist/resources/Custom.d.ts +8 -0
  10. package/dist/resources/Custom.js +30 -0
  11. package/dist/resources/Goods.d.ts +24 -0
  12. package/dist/resources/Goods.js +43 -0
  13. package/dist/resources/HTTPClient.d.ts +32 -0
  14. package/dist/resources/HTTPClient.js +87 -0
  15. package/dist/resources/Helper.d.ts +18 -0
  16. package/dist/resources/Helper.js +84 -0
  17. package/dist/resources/Image.d.ts +21 -0
  18. package/dist/resources/Image.js +56 -0
  19. package/dist/resources/Inspections.d.ts +41 -0
  20. package/dist/resources/Inspections.js +69 -0
  21. package/dist/resources/Machinery.d.ts +28 -0
  22. package/dist/resources/Machinery.js +43 -0
  23. package/dist/resources/Memberships.d.ts +14 -0
  24. package/dist/resources/Memberships.js +24 -0
  25. package/dist/resources/Moto.d.ts +10 -0
  26. package/dist/resources/Moto.js +41 -0
  27. package/dist/resources/OAuth.d.ts +37 -0
  28. package/dist/resources/OAuth.js +52 -0
  29. package/dist/resources/People.d.ts +22 -0
  30. package/dist/resources/People.js +32 -0
  31. package/dist/resources/Products.d.ts +16 -0
  32. package/dist/resources/Products.js +20 -0
  33. package/dist/resources/Template.d.ts +8 -0
  34. package/dist/resources/Template.js +35 -0
  35. package/dist/resources/User.d.ts +35 -0
  36. package/dist/resources/User.js +47 -0
  37. package/dist/types/api.d.ts +12 -0
  38. package/dist/types/api.js +2 -0
  39. package/dist/types/authenticatedUser.d.ts +65 -0
  40. package/dist/types/authenticatedUser.js +2 -0
  41. package/dist/types/autoinspector.d.ts +15 -0
  42. package/dist/types/autoinspector.js +2 -0
  43. package/dist/types/car.d.ts +42 -0
  44. package/dist/types/car.js +2 -0
  45. package/dist/types/colors.d.ts +1 -0
  46. package/dist/types/colors.js +2 -0
  47. package/dist/types/configuration.d.ts +27 -0
  48. package/dist/types/configuration.js +2 -0
  49. package/dist/types/consumer.d.ts +14 -0
  50. package/dist/types/consumer.js +2 -0
  51. package/dist/types/goods.d.ts +51 -0
  52. package/dist/types/goods.js +2 -0
  53. package/dist/types/helper.d.ts +5 -0
  54. package/dist/types/helper.js +2 -0
  55. package/dist/types/http.d.ts +22 -0
  56. package/dist/types/http.js +2 -0
  57. package/dist/types/image.d.ts +15 -0
  58. package/dist/types/image.js +2 -0
  59. package/dist/types/inspection.d.ts +122 -0
  60. package/dist/types/inspection.js +2 -0
  61. package/dist/types/machinery.d.ts +64 -0
  62. package/dist/types/machinery.js +2 -0
  63. package/dist/types/moto.d.ts +10 -0
  64. package/dist/types/moto.js +2 -0
  65. package/dist/types/oauth20.d.ts +19 -0
  66. package/dist/types/oauth20.js +2 -0
  67. package/dist/types/pagination.d.ts +21 -0
  68. package/dist/types/pagination.js +2 -0
  69. package/dist/types/people.d.ts +45 -0
  70. package/dist/types/people.js +2 -0
  71. package/dist/types/producer.d.ts +4 -0
  72. package/dist/types/producer.js +2 -0
  73. package/dist/types/productMethods.d.ts +4 -0
  74. package/dist/types/productMethods.js +2 -0
  75. package/dist/types/template.d.ts +58 -0
  76. package/dist/types/template.js +2 -0
  77. package/dist/types/vehicle.d.ts +116 -0
  78. package/dist/types/vehicle.js +2 -0
  79. package/package.json +4 -5
@@ -0,0 +1,15 @@
1
+ import { IOAuth20Credentials } from './oauth20';
2
+ export interface IAutoinspector {
3
+ /**
4
+ * The apikey for authenticate to Autoinspector API.
5
+ */
6
+ apikey: string;
7
+ /**
8
+ * The timeout limit that one request can take
9
+ */
10
+ timeout?: number;
11
+ /**
12
+ * Credentials for make OAuth Authorization Code Flow
13
+ */
14
+ oauthCredentials?: IOAuth20Credentials;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,42 @@
1
+ import { Colors } from './colors';
2
+ import { ICreateInspectionParamsV2, IUpdateInspectionParamsV2 } from './inspection';
3
+ export interface ICar {
4
+ /**
5
+ * Plate: The plate of the vehicle.
6
+ */
7
+ plate: string;
8
+ /**
9
+ * Color: The color of the vehicle.
10
+ */
11
+ color?: Colors;
12
+ /**
13
+ * Milage: The milage of the vehicle.
14
+ */
15
+ milage?: number;
16
+ /**
17
+ * Use: The use of the vehicle.
18
+ */
19
+ use?: string;
20
+ /**
21
+ * Year: The year of the vehicle.
22
+ */
23
+ year?: number;
24
+ /**
25
+ * make: The make/brand of the vehicle.
26
+ */
27
+ make?: string;
28
+ /**
29
+ * Model: The model of the vehicle.
30
+ */
31
+ model?: string;
32
+ /**
33
+ * Chassis: The chassis of the vehicle.
34
+ */
35
+ chassis?: string;
36
+ }
37
+ export interface ICreateCarInspection extends ICreateInspectionParamsV2 {
38
+ car: ICar;
39
+ }
40
+ export interface IUpdateCarInspection extends IUpdateInspectionParamsV2 {
41
+ car?: Partial<ICar>;
42
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export declare type Colors = 'yellow' | 'blue' | 'white' | 'gold' | 'grey' | 'orange' | 'black' | 'red' | 'green';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,27 @@
1
+ export interface IConfigurationCommonValidations {
2
+ /**
3
+ * Date: Validation that verifies the image/photo taken is between an range of time defined by Autoinspector.
4
+ */
5
+ date: IConfiguration;
6
+ /**
7
+ * Distance: Validation that verifies the distance between each photo taken is not more than certain threshold.
8
+ */
9
+ distance: IConfiguration;
10
+ /**
11
+ * Recaptured: Validation that verifies the image taken is not recaptured or fake.
12
+ */
13
+ recaptured: IConfiguration;
14
+ }
15
+ /**
16
+ * Represents the object that indicates if some validation has to run and if its required for approve the image.
17
+ */
18
+ export interface IConfiguration {
19
+ /**
20
+ * required: `Set the validation as required for approve the image. That means, if some validation has the required setted and it was not approved, the image will be disapproved.`
21
+ */
22
+ required: boolean;
23
+ /**
24
+ * required: `Set the validation to be considered at the moment of run the validations. You can have some validation not required but yes for run.`
25
+ */
26
+ run: boolean;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ export declare type Sex = 0 | 1 | 2 | 9;
2
+ export interface IConsumer {
3
+ firstName: string;
4
+ lastName: string;
5
+ identification: string;
6
+ email: string;
7
+ birthdate?: string;
8
+ sex?: Sex;
9
+ phone?: string;
10
+ state?: string;
11
+ country?: string;
12
+ city?: string;
13
+ address?: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,51 @@
1
+ import { IConfiguration, IConfigurationCommonValidations } from './configuration';
2
+ import { ICreateInspectionParamsV2, IUpdateInspectionParamsV2 } from './inspection';
3
+ export interface IGoodConfiguration extends IConfigurationCommonValidations {
4
+ /**
5
+ * object: `Validation that verifies the serial number that appears in the serialNumber photo is the same as declared.`
6
+ */
7
+ serialNumber: IConfiguration;
8
+ }
9
+ export declare type GoodsCategory = 'sports' | 'electronics' | 'instruments' | 'jewellery' | 'art' | 'home' | 'mobility';
10
+ export declare type GoodsType = 'skies' | 'surf_table' | 'kayak' | 'golf_set' | 'skate_board' | 'mobile' | 'laptop' | 'tablets' | 'monitor' | 'watch_digital' | 'printer_3d' | 'headsets' | 'camera' | 'controllers' | 'drone' | 'sax' | 'violin' | 'guitar' | 'drums' | 'keyboard' | 'amplifier' | 'jewel' | 'watch_luxury' | 'paint' | 'refrigerator' | 'microwave' | 'tv' | 'freezer' | 'bike' | 'scuter';
11
+ /**
12
+ * Represents the people object to be attached to the inspection.
13
+ */
14
+ export interface IGood {
15
+ /**
16
+ * make: `The make of the good item.`
17
+ */
18
+ make: string;
19
+ /**
20
+ * model: `The model of the good item.`
21
+ */
22
+ model: string;
23
+ /**
24
+ * type: `The type of the good item.`
25
+ */
26
+ type: GoodsType;
27
+ /**
28
+ * category: `The category of the good item.`
29
+ */
30
+ category: GoodsCategory;
31
+ /**
32
+ * serialNumber: `The serialNumber of the good item.`
33
+ */
34
+ serialNumber?: string;
35
+ /**
36
+ * price: `The price of the good item.`
37
+ */
38
+ price: string;
39
+ }
40
+ /**
41
+ * Represents the object to be sended when create an inspection of type vehicle.
42
+ */
43
+ export interface ICreateGoodsInspection extends ICreateInspectionParamsV2 {
44
+ goods: IGood[];
45
+ }
46
+ /**
47
+ * Represents the object to be sended when create an inspection of type vehicle.
48
+ */
49
+ export interface IUpdateGoodsInspection extends IUpdateInspectionParamsV2 {
50
+ good?: Partial<IGood>;
51
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { IInputValue } from './inspection';
2
+ export interface IFilterInputValuesOutput {
3
+ inputValuesFiles: IInputValue[];
4
+ inputValuesNonFiles: IInputValue[];
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { APIMethods } from './api';
2
+ export interface IDynamicMap<T = any> {
3
+ [key: string]: T;
4
+ }
5
+ export interface IHeaders extends IDynamicMap<string | number> {
6
+ }
7
+ export interface IParams extends IDynamicMap<any> {
8
+ }
9
+ export interface IMakeRequest {
10
+ method: APIMethods;
11
+ path: string;
12
+ body?: any;
13
+ params?: IParams;
14
+ headers?: IHeaders;
15
+ withoutPredefinedHeaders?: boolean;
16
+ }
17
+ export interface IHTTPClient {
18
+ headers: IHeaders;
19
+ timeout: number;
20
+ baseURL: string;
21
+ pathPrefix: string;
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" />
2
+ import { ReadStream } from 'fs';
3
+ export declare type ImageSide = string;
4
+ export interface ICoordinates {
5
+ latitude: number;
6
+ longitude: number;
7
+ }
8
+ export interface IUploadImage {
9
+ coordinates?: ICoordinates;
10
+ date?: Date;
11
+ imageToken?: string;
12
+ side: ImageSide;
13
+ image: ReadStream;
14
+ productId: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,122 @@
1
+ /// <reference types="node" />
2
+ import { IConsumer } from './consumer';
3
+ import { GoodsType } from './goods';
4
+ import { MachineryType } from './machinery';
5
+ import { PeopleType } from './people';
6
+ import { VehicleType } from './vehicle';
7
+ export declare type InspectionCompletedBy = 'client' | 'expiration';
8
+ export interface IValidation {
9
+ confidence: number;
10
+ valid: boolean;
11
+ _id: string;
12
+ type: string;
13
+ }
14
+ export declare type InspectionType = 'goods' | 'people' | 'vehicle' | 'machinery' | 'car' | 'moto';
15
+ export declare type InspectionVeredict = 'approved' | 'disapproved' | 'not_defined' | 'not_provided';
16
+ export declare type ImageGeneratedBy = 'configuration' | 'damage_declaration' | 'full_control';
17
+ export declare type InspectionStatus = 'created' | 'started' | 'completed' | 'blocked' | 'processing';
18
+ export declare type InspectionMode = 'full_control' | 'normal';
19
+ export interface IImageDetection {
20
+ name: string;
21
+ result: any;
22
+ }
23
+ export declare type ImageSide = 'front' | 'sideLeft' | 'sideRight' | 'side' | 'back' | 'id' | 'wheel' | 'tank' | 'board' | 'chassis_number' | 'serial_number' | 'dni' | 'selfie' | 'backSideLeft' | 'backSideRight' | 'frontSideRight' | 'frontSideLeft' | 'roof' | 'cabin' | 'backBumper' | 'tailgate' | 'hood' | 'frontBumper' | 'backRightDoor' | 'backLeftDoor' | 'frontLeftDoor' | 'frontRightDoor' | 'backRightDefense' | 'backLeftDefense' | 'frontLeftDefense' | 'frontRightDefense' | 'inferiorRightPanel' | 'inferiorLeftPanel' | 'backRightWindow' | 'backLeftWindow' | 'frontLeftWindow' | 'frontRightWindow' | 'backWindow' | 'windShield' | 'backRightLight' | 'backLeftLight' | 'frontLeftLight' | 'frontRightLight' | 'leftMirror' | 'rightMirror' | 'frontLeftWheel' | 'frontRightWheel' | 'backLeftWheel' | 'backRightWheel' | 'under_hood' | 'backTires' | 'frontTires' | 'chassis' | 'body' | 'gasTank' | 'seat' | 'handlebar' | 'tailOptic' | 'headOptic' | 'backFender' | 'frontFender';
24
+ export declare type IImageDamagePart = 'light_broken' | 'glass_broken' | 'corrosion' | 'dent' | 'scratch' | 'missing' | 'broken';
25
+ export declare type IDamage = 'light_broken' | 'glass_broken' | 'corrosion' | 'dent' | 'scratch' | 'missing' | 'broken';
26
+ export interface IImageDamage {
27
+ percentage: number;
28
+ part: IImageDamagePart;
29
+ type: IDamage;
30
+ }
31
+ export interface IImage {
32
+ side: ImageSide;
33
+ processed: boolean;
34
+ uploadedAt: Date;
35
+ _id: string;
36
+ validations: IValidation[];
37
+ approved: boolean;
38
+ src: string;
39
+ generatedBy: ImageGeneratedBy;
40
+ damages: IImageDamage[];
41
+ }
42
+ export declare type KindOf = 'easy' | 'deep' | 'damage' | 'full_control';
43
+ export interface IInspectionUpdateCommonParams extends Pick<IInspectionCommonParams, 'consumer' | 'metadata'> {
44
+ productId: string;
45
+ }
46
+ export interface IInspectionCommonParams<P = IProducer> {
47
+ consumer: IConsumer;
48
+ producer: P;
49
+ kindOf?: KindOf;
50
+ mode?: InspectionMode;
51
+ metadata?: object;
52
+ access_token?: string;
53
+ }
54
+ export interface IInputValue {
55
+ label: string;
56
+ value: string | Buffer;
57
+ }
58
+ export interface IUpdateInspection extends Pick<IIInspectionCommonParamsV2, 'inputs' | 'consumer'> {
59
+ inspectionId: string;
60
+ }
61
+ export interface IIInspectionCommonParamsV2<P = IProducer> {
62
+ inputs: IInputValue[];
63
+ consumer: IConsumer;
64
+ producer: P;
65
+ templateId: string;
66
+ initialStatus?: 'created' | 'started';
67
+ metadata?: object;
68
+ access_token?: string;
69
+ }
70
+ export interface IUpdateInspectionParamsV2 {
71
+ productId: string;
72
+ inputs?: IInputValue[];
73
+ consumer?: Partial<IConsumer>;
74
+ metadata?: object;
75
+ }
76
+ export interface IFinishInspection extends IGetInspection {
77
+ }
78
+ export interface ICreateInspectionGoodsOutput extends ICreateInspectionOutputCommon {
79
+ productIds: string[];
80
+ }
81
+ export interface ICreateInspectionOutput extends ICreateInspectionOutputCommon {
82
+ productId: string;
83
+ }
84
+ export interface ICreateInspectionOutputCommon {
85
+ message: string;
86
+ inspectionId: string;
87
+ }
88
+ export interface IGetInspection {
89
+ inspectionId: string;
90
+ }
91
+ export declare type ProductTypes = GoodsType | VehicleType | PeopleType | MachineryType;
92
+ export interface IProduct {
93
+ images: IImage[];
94
+ extraImages: string[];
95
+ _id: string;
96
+ type: ProductTypes;
97
+ }
98
+ export interface ICreateInspectionProducer {
99
+ internalId: string;
100
+ mustMatchUser?: boolean;
101
+ }
102
+ export interface IProducer {
103
+ userId: string;
104
+ companyId: string;
105
+ internalId: string;
106
+ }
107
+ export interface IImageToken {
108
+ token: string;
109
+ }
110
+ export interface IInspection {
111
+ veredict: InspectionVeredict;
112
+ type: InspectionType;
113
+ status: InspectionStatus;
114
+ completedBy: InspectionCompletedBy;
115
+ products: IProduct[];
116
+ _id: string;
117
+ producer: IProducer;
118
+ metadata: object;
119
+ }
120
+ export interface IInspectionHandler {
121
+ }
122
+ export declare type ICreateInspectionParamsV2 = IIInspectionCommonParamsV2<ICreateInspectionProducer>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,64 @@
1
+ import { Colors } from './colors';
2
+ import { IConfiguration, IConfigurationCommonValidations } from './configuration';
3
+ import { ICreateInspectionParamsV2, IUpdateInspectionParamsV2 } from './inspection';
4
+ export declare type MachineryPurpose = 'Agrícola' | 'Vial' | 'Industrial';
5
+ export declare type MachineryUse = 'OFICIAL' | 'PRIVADO' | 'PÚBLICO';
6
+ export declare type MachineryType = 'tractor' | 'combine_harvester' | 'sprayer' | 'seeder' | 'fumigator' | 'baler' | 'round_baler' | 'paver' | 'leveler' | 'crane' | 'excavator' | 'carts' | 'grader' | 'loader' | 'scrapers' | 'compacting_machine' | 'machine_soil_treatment' | 'forklift' | 'motor_vehicle_with_coupling_device' | 'fertilizer' | 'backhoe' | 'bulldozer' | 'compactor' | 'hidrogua' | 'trencher' | 'mixer' | 'hopper' | 'mechanical_shovel';
7
+ export interface IMachineryConfiguration extends IConfigurationCommonValidations {
8
+ /**
9
+ * type: `Validation that verifies the type that appears in the identification product card is the same as declared.`
10
+ */
11
+ type: IConfiguration;
12
+ /**
13
+ * purpose: `Validation that verifies the purpose that appears in the identification product card is the same as declared.`
14
+ */
15
+ purpose: IConfiguration;
16
+ /**
17
+ * use: `Validation that verifies the use that appears in the identification product card is the same as declared.`
18
+ */
19
+ use: IConfiguration;
20
+ /**
21
+ * plate: `Validation that verifies the plate that appears in the identification product card is the same as declared.`
22
+ */
23
+ plate: IConfiguration;
24
+ }
25
+ export interface IMachinery {
26
+ /**
27
+ * make: `The make of the machinery.`
28
+ */
29
+ make?: string;
30
+ /**
31
+ * color: `The color of the machinery.`
32
+ */
33
+ color?: Colors;
34
+ /**
35
+ * year: `The year of the machinery.`
36
+ */
37
+ year?: number;
38
+ /**
39
+ * model: `The model of the machinery.`
40
+ */
41
+ model?: string;
42
+ /**
43
+ * purpose: `The purpose of the machinery.`
44
+ */
45
+ purpose?: MachineryPurpose;
46
+ /**
47
+ * use: `The use of the machinery.`
48
+ */
49
+ use?: string;
50
+ /**
51
+ * type: `The type of the machinery.`
52
+ */
53
+ type: MachineryType;
54
+ /**
55
+ * configuration: `The validation configuration template to be attached to the machinery.`
56
+ */
57
+ configuration?: Partial<IMachineryConfiguration>;
58
+ }
59
+ export interface ICreateMachineryInspection extends ICreateInspectionParamsV2 {
60
+ machinery: IMachinery;
61
+ }
62
+ export interface IUpdateMachineryInspection extends IUpdateInspectionParamsV2 {
63
+ machinery?: Partial<IMachinery>;
64
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { ICar } from './car';
2
+ import { ICreateInspectionParamsV2, IUpdateInspectionParamsV2 } from './inspection';
3
+ export interface IMoto extends ICar {
4
+ }
5
+ export interface ICreateMotoInspection extends ICreateInspectionParamsV2 {
6
+ moto: IMoto;
7
+ }
8
+ export interface IUpdateMotoInspection extends IUpdateInspectionParamsV2 {
9
+ moto?: Partial<IMoto>;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ export interface IOAuth20Credentials {
2
+ client_app_id: string;
3
+ client_secret: string;
4
+ }
5
+ export interface IExchangeCodeForAccessToken {
6
+ code: string;
7
+ }
8
+ export interface IExchangeCodeForAccessTokenOutput {
9
+ access_token: string;
10
+ refresh_token: string;
11
+ expires_in: number;
12
+ }
13
+ export interface IRefreshAccessToken {
14
+ refresh_token: string;
15
+ }
16
+ export interface IRefreshAccessTokenOutput {
17
+ access_token: string;
18
+ expires_in: number;
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ import { InspectionStatus, InspectionType, InspectionVeredict } from './inspection';
2
+ export interface IPagination {
3
+ page: number;
4
+ limit: number;
5
+ status: InspectionStatus;
6
+ type: InspectionType;
7
+ veredict: InspectionVeredict;
8
+ internalId: string;
9
+ }
10
+ export interface IPaginationResponse<R = any> {
11
+ totalInspections: number;
12
+ inspections: R;
13
+ limit: number;
14
+ page?: number | undefined;
15
+ totalPages: number;
16
+ nextPage?: number | null | undefined;
17
+ prevPage?: number | null | undefined;
18
+ pagingCounter: number;
19
+ hasPrevPage: boolean;
20
+ hasNextPage: boolean;
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,45 @@
1
+ import { IConfiguration, IConfigurationCommonValidations } from './configuration';
2
+ import { ICreateInspectionParamsV2, IUpdateInspectionParamsV2 } from './inspection';
3
+ export declare type PeopleType = 'person';
4
+ export interface IPeopleConfiguration extends IConfigurationCommonValidations {
5
+ /**
6
+ * full_name: `Validation that verifies the full name that appears in the id photo is the same as declared.`.
7
+ */
8
+ full_name: IConfiguration;
9
+ /**
10
+ * sex: `Validation that verifies the person that appears in the photos has the same sex as declared.`.
11
+ */
12
+ sex: IConfiguration;
13
+ /**
14
+ * age: `Validation that verifies the person that appears in the photos has the same age as declared.`.
15
+ */
16
+ age: IConfiguration;
17
+ /**
18
+ * dni: `Validation that verifies the identification number that appears in the dni photo is the same as declared.`.
19
+ */
20
+ dni: IConfiguration;
21
+ /**
22
+ * birthdate: `Validation that verifies the birthdate that appears in the dni is the same as declared.`.
23
+ */
24
+ birthdate: IConfiguration;
25
+ /**
26
+ * face_comparison: `Validation that verifies the photos taken belongs to the same person.`.
27
+ */
28
+ face_comparison: IConfiguration;
29
+ }
30
+ /**
31
+ * Represents the people object to be attached to the inspection.
32
+ */
33
+ export interface IPeople {
34
+ /**
35
+ * configuration: `Validation Configuration Templated to be attached to the People inspection. If it not setted, the default configuration will be applied.`
36
+ */
37
+ configuration?: Partial<IPeopleConfiguration>;
38
+ }
39
+ /**
40
+ * Represents the object to be sended when create an inspection of type vehicle.
41
+ */
42
+ export interface ICreatePeopleInspection extends ICreateInspectionParamsV2 {
43
+ }
44
+ export interface IUpdatePeopleInspection extends IUpdateInspectionParamsV2 {
45
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface ICreateInspectionProducer {
2
+ mustMatchUser?: boolean;
3
+ internalId?: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface IProductMethods {
2
+ create(input: any): Promise<any>;
3
+ update?(input: any): Promise<any>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,58 @@
1
+ import { InspectionType } from './inspection';
2
+ export interface ITemplateFeature {
3
+ _id: string;
4
+ isActive: boolean;
5
+ feature: string;
6
+ }
7
+ export declare type ITemplateType = 'built-in' | 'created';
8
+ export declare type IInputStages = 'create' | 'update';
9
+ export interface IInputOptions {
10
+ label: string;
11
+ }
12
+ export interface IInputValidationSchema {
13
+ required: boolean;
14
+ maxLength?: number;
15
+ minLength?: number;
16
+ minimum?: number;
17
+ maximum?: number;
18
+ email?: boolean;
19
+ minDate?: Date;
20
+ maxDate?: Date;
21
+ }
22
+ export declare type ITemplateInputTypes = 'text' | 'date' | 'textare' | 'select' | 'numeric' | 'check' | 'file';
23
+ export interface ITemplateInput {
24
+ _id: string;
25
+ options: IInputOptions[];
26
+ stages: IInputStages;
27
+ type: ITemplateInputTypes;
28
+ label: string;
29
+ helperMessage?: string;
30
+ validationSchema: IInputValidationSchema;
31
+ }
32
+ export interface ITemplateValidation {
33
+ validation: string;
34
+ required: boolean;
35
+ run: boolean;
36
+ }
37
+ export interface ITemplateImage {
38
+ _id: string;
39
+ side: string;
40
+ validations: ITemplateValidation[];
41
+ inputs: ITemplateInput[];
42
+ features: ITemplateFeature[];
43
+ }
44
+ export interface ITemplate {
45
+ type: ITemplateType;
46
+ _id: string;
47
+ inspectionType: InspectionType;
48
+ lastSave: string;
49
+ name: string;
50
+ images: ITemplateImage[];
51
+ inputs: ITemplateInput[];
52
+ features: ITemplateFeature[];
53
+ }
54
+ export declare type TemplateType = 'built-in' | 'created';
55
+ export interface ITemplateListInput {
56
+ inspectionType?: InspectionType;
57
+ type?: TemplateType;
58
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });