autoinspector 2.7.0 → 2.9.0
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/package.json +1 -1
- package/dist/resources/Cellphone.d.ts +11 -0
- package/dist/resources/Cellphone.js +40 -0
- package/dist/resources/Inspections.d.ts +23 -0
- package/dist/resources/Inspections.js +20 -0
- package/dist/resources/Products.d.ts +3 -1
- package/dist/resources/Products.js +10 -8
- package/dist/types/cellphone.d.ts +10 -0
- package/dist/types/cellphone.js +2 -0
- package/dist/types/pagination.d.ts +1 -0
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IUpdateResourceResponse } from '../types/api';
|
|
2
|
+
import { ICreateCellphoneInspection, ICellphone } from '../types/cellphone';
|
|
3
|
+
import { ICreateInspectionOutput } from '../types/inspection';
|
|
4
|
+
import { IProductMethods } from '../types/productMethods';
|
|
5
|
+
import { HTTPClient } from './HTTPClient';
|
|
6
|
+
export declare class Cellphone implements IProductMethods<ICreateCellphoneInspection, Partial<ICellphone>> {
|
|
7
|
+
private readonly httpClient;
|
|
8
|
+
constructor(httpClient: HTTPClient);
|
|
9
|
+
create(body: ICreateCellphoneInspection): Promise<ICreateInspectionOutput>;
|
|
10
|
+
update(productId: string, cellphone: Partial<ICellphone>): Promise<IUpdateResourceResponse>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Cellphone = void 0;
|
|
13
|
+
const idempotency_1 = require("../utils/idempotency");
|
|
14
|
+
class Cellphone {
|
|
15
|
+
constructor(httpClient) {
|
|
16
|
+
this.httpClient = httpClient;
|
|
17
|
+
}
|
|
18
|
+
create(body) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
return yield this.httpClient.makeRequest({
|
|
21
|
+
method: 'POST',
|
|
22
|
+
path: `/inspection/cellphone`,
|
|
23
|
+
headers: (0, idempotency_1.generateIdempotencyHeader)(),
|
|
24
|
+
body,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
update(productId, cellphone) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return yield this.httpClient.makeRequest({
|
|
31
|
+
method: 'PUT',
|
|
32
|
+
path: `/inspection/cellphone/${productId}`,
|
|
33
|
+
body: {
|
|
34
|
+
cellphone,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.Cellphone = Cellphone;
|
|
@@ -39,8 +39,31 @@ export declare class Inspections extends Products {
|
|
|
39
39
|
* @param {String} input.type - Represents the type of the inspection.
|
|
40
40
|
* @param {String} input.consumerIdentification - Identification value of target consumer
|
|
41
41
|
* @param {String} input.plate - Car License Plate parameter to filter inspections
|
|
42
|
+
* @param {String} input.templateId - ID del template de inspección
|
|
42
43
|
* @return {Promise} - Returns a Promise that, when fulfilled, will either return an JSON Object with the requested
|
|
43
44
|
* data or an Error with the problem.
|
|
44
45
|
*/
|
|
45
46
|
list(input?: Partial<IPagination>): Promise<IPaginationResponse<IInspection[]>>;
|
|
47
|
+
createReportRequest(inspectionId: string, data?: {
|
|
48
|
+
callbackURL?: string;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
_id: string;
|
|
51
|
+
}>;
|
|
52
|
+
listReportRequests(inspectionId: string): Promise<{
|
|
53
|
+
reportRequests: {
|
|
54
|
+
inspectionId: string;
|
|
55
|
+
companyId: string;
|
|
56
|
+
status: 'completed' | 'failed' | 'processing' | 'pending';
|
|
57
|
+
callbackURL?: string;
|
|
58
|
+
result?: {
|
|
59
|
+
url: string;
|
|
60
|
+
};
|
|
61
|
+
processingAt?: Date;
|
|
62
|
+
completedAt?: Date;
|
|
63
|
+
failedAt?: Date;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
66
|
+
retrieveReportRequest(inspectionId: string, reportRequestId: string): Promise<{
|
|
67
|
+
_id: string;
|
|
68
|
+
}>;
|
|
46
69
|
}
|
|
@@ -60,6 +60,7 @@ class Inspections extends Products_1.Products {
|
|
|
60
60
|
* @param {String} input.type - Represents the type of the inspection.
|
|
61
61
|
* @param {String} input.consumerIdentification - Identification value of target consumer
|
|
62
62
|
* @param {String} input.plate - Car License Plate parameter to filter inspections
|
|
63
|
+
* @param {String} input.templateId - ID del template de inspección
|
|
63
64
|
* @return {Promise} - Returns a Promise that, when fulfilled, will either return an JSON Object with the requested
|
|
64
65
|
* data or an Error with the problem.
|
|
65
66
|
*/
|
|
@@ -70,5 +71,24 @@ class Inspections extends Products_1.Products {
|
|
|
70
71
|
params: input,
|
|
71
72
|
});
|
|
72
73
|
}
|
|
74
|
+
createReportRequest(inspectionId, data) {
|
|
75
|
+
return this.httpClient.makeRequest({
|
|
76
|
+
method: 'POST',
|
|
77
|
+
path: `/inspection/${inspectionId}/report/request`,
|
|
78
|
+
body: data,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
listReportRequests(inspectionId) {
|
|
82
|
+
return this.httpClient.makeRequest({
|
|
83
|
+
method: 'GET',
|
|
84
|
+
path: `/inspection/${inspectionId}/report/request`,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
retrieveReportRequest(inspectionId, reportRequestId) {
|
|
88
|
+
return this.httpClient.makeRequest({
|
|
89
|
+
method: 'GET',
|
|
90
|
+
path: `/inspection/${inspectionId}/report/request/${reportRequestId}`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
73
93
|
}
|
|
74
94
|
exports.Inspections = Inspections;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Bike } from './Bike';
|
|
2
2
|
import { Car } from './Car';
|
|
3
|
+
import { Cellphone } from './Cellphone';
|
|
3
4
|
import { Custom } from './Custom';
|
|
4
5
|
import { Goods } from './Goods';
|
|
5
6
|
import { HTTPClient } from './HTTPClient';
|
|
@@ -14,5 +15,6 @@ export declare class Products {
|
|
|
14
15
|
moto: Moto;
|
|
15
16
|
custom: Custom;
|
|
16
17
|
bike: Bike;
|
|
17
|
-
|
|
18
|
+
cellphone: Cellphone;
|
|
19
|
+
constructor(httpRef: HTTPClient);
|
|
18
20
|
}
|
|
@@ -3,20 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Products = void 0;
|
|
4
4
|
const Bike_1 = require("./Bike");
|
|
5
5
|
const Car_1 = require("./Car");
|
|
6
|
+
const Cellphone_1 = require("./Cellphone");
|
|
6
7
|
const Custom_1 = require("./Custom");
|
|
7
8
|
const Goods_1 = require("./Goods");
|
|
8
9
|
const Machinery_1 = require("./Machinery");
|
|
9
10
|
const Moto_1 = require("./Moto");
|
|
10
11
|
const People_1 = require("./People");
|
|
11
12
|
class Products {
|
|
12
|
-
constructor(
|
|
13
|
-
this.machinery = new Machinery_1.Machinery(
|
|
14
|
-
this.people = new People_1.People(
|
|
15
|
-
this.goods = new Goods_1.Goods(
|
|
16
|
-
this.car = new Car_1.Car(
|
|
17
|
-
this.moto = new Moto_1.Moto(
|
|
18
|
-
this.custom = new Custom_1.Custom(
|
|
19
|
-
this.bike = new Bike_1.Bike(
|
|
13
|
+
constructor(httpRef) {
|
|
14
|
+
this.machinery = new Machinery_1.Machinery(httpRef);
|
|
15
|
+
this.people = new People_1.People(httpRef);
|
|
16
|
+
this.goods = new Goods_1.Goods(httpRef);
|
|
17
|
+
this.car = new Car_1.Car(httpRef);
|
|
18
|
+
this.moto = new Moto_1.Moto(httpRef);
|
|
19
|
+
this.custom = new Custom_1.Custom(httpRef);
|
|
20
|
+
this.bike = new Bike_1.Bike(httpRef);
|
|
21
|
+
this.cellphone = new Cellphone_1.Cellphone(httpRef);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
exports.Products = Products;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICreateInspectionProducer, IInspectionCommonParamsV2 } from './inspection';
|
|
2
|
+
export interface ICellphone {
|
|
3
|
+
make: string;
|
|
4
|
+
model: string;
|
|
5
|
+
price: number;
|
|
6
|
+
serialNumber: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ICreateCellphoneInspection extends IInspectionCommonParamsV2<ICreateInspectionProducer> {
|
|
9
|
+
cellphone?: Partial<ICellphone>;
|
|
10
|
+
}
|