@pipedream/vincario 0.0.1 → 0.1.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/actions/check-stolen/check-stolen.mjs +31 -0
- package/actions/decode-vin/decode-vin.mjs +31 -0
- package/actions/get-vehicle-market-value/get-vehicle-market-value.mjs +51 -0
- package/actions/get-vin-decoder-info/get-vin-decoder-info.mjs +31 -0
- package/package.json +4 -1
- package/vincario.app.mjs +67 -5
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import vincario from "../../vincario.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "vincario-check-stolen",
|
|
5
|
+
name: "Check Stolen",
|
|
6
|
+
description: "Performs a real-time VIN check in national police databases of stolen vehicles of Czech Republic, Hungary, Romania, Slovenia, Slovakia and Vincario's own database of stolen vehicles. [See the documentation](https://vincario.com/api-docs/3.2/#api-endpoints)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
vincario,
|
|
16
|
+
vin: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
vincario,
|
|
19
|
+
"vin",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
async run({ $ }) {
|
|
24
|
+
const response = await this.vincario.checkStolen({
|
|
25
|
+
$,
|
|
26
|
+
vin: this.vin,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully performed check for VIN: ${this.vin}`);
|
|
29
|
+
return response;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import vincario from "../../vincario.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "vincario-decode-vin",
|
|
5
|
+
name: "Decode VIN",
|
|
6
|
+
description: "Decode a VIN number. Returns an object with price, balance and array of vehicle specifications. [See the documentation](https://vincario.com/api-docs/3.2/#api-endpoints)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
vincario,
|
|
16
|
+
vin: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
vincario,
|
|
19
|
+
"vin",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
async run({ $ }) {
|
|
24
|
+
const response = await this.vincario.decodeVin({
|
|
25
|
+
$,
|
|
26
|
+
vin: this.vin,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully decoded VIN: ${this.vin}`);
|
|
29
|
+
return response;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import vincario from "../../vincario.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "vincario-get-vehicle-market-value",
|
|
5
|
+
name: "Get Vehicle Market Value",
|
|
6
|
+
description: "Get the market value of a vehicle. [See the documentation](https://vincario.com/api-docs/3.2/#api-endpoints)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
vincario,
|
|
16
|
+
vin: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
vincario,
|
|
19
|
+
"vin",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
odometer: {
|
|
23
|
+
type: "integer",
|
|
24
|
+
label: "Odometer",
|
|
25
|
+
description: "The odometer reading of the vehicle",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
odometerUnit: {
|
|
29
|
+
type: "string",
|
|
30
|
+
label: "Odometer Unit",
|
|
31
|
+
description: "The unit of the odometer reading. Defaults to 'km' if not provided",
|
|
32
|
+
optional: true,
|
|
33
|
+
options: [
|
|
34
|
+
"km",
|
|
35
|
+
"mi",
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
async run({ $ }) {
|
|
40
|
+
const response = await this.vincario.getVehicleMarketValue({
|
|
41
|
+
$,
|
|
42
|
+
vin: this.vin,
|
|
43
|
+
params: {
|
|
44
|
+
odometer: this.odometer,
|
|
45
|
+
odometerUnit: this.odometerUnit,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
$.export("$summary", `Successfully retrieved market value for VIN: ${this.vin}`);
|
|
49
|
+
return response;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import vincario from "../../vincario.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "vincario-get-vin-decoder-info",
|
|
5
|
+
name: "Get VIN Decoder Info",
|
|
6
|
+
description: "Get a list of vehicle attributes. Each represents label that is available for given VIN when you do a 'VIN Decode' request. [See the documentation](https://vincario.com/api-docs/3.2/#api-endpoints)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
vincario,
|
|
16
|
+
vin: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
vincario,
|
|
19
|
+
"vin",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
async run({ $ }) {
|
|
24
|
+
const response = await this.vincario.getVinDecoderInfo({
|
|
25
|
+
$,
|
|
26
|
+
vin: this.vin,
|
|
27
|
+
});
|
|
28
|
+
$.export("$summary", `Successfully retrieved VIN decoder info for VIN: ${this.vin}`);
|
|
29
|
+
return response;
|
|
30
|
+
},
|
|
31
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/vincario",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Pipedream Vincario Components",
|
|
5
5
|
"main": "vincario.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^3.1.1"
|
|
14
17
|
}
|
|
15
18
|
}
|
package/vincario.app.mjs
CHANGED
|
@@ -1,11 +1,73 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
import crypto from "crypto";
|
|
3
|
+
|
|
1
4
|
export default {
|
|
2
5
|
type: "app",
|
|
3
6
|
app: "vincario",
|
|
4
|
-
propDefinitions: {
|
|
7
|
+
propDefinitions: {
|
|
8
|
+
vin: {
|
|
9
|
+
type: "string",
|
|
10
|
+
label: "VIN",
|
|
11
|
+
description: "The Vehicle Identification Number",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
5
14
|
methods: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
_baseUrl() {
|
|
16
|
+
return `https://api.vincario.com/3.2/${this.$auth.api_key}`;
|
|
17
|
+
},
|
|
18
|
+
_controlSum(id, vin) {
|
|
19
|
+
return crypto.createHash("sha1")
|
|
20
|
+
.update(`${vin.toUpperCase()}|${id}|${this.$auth.api_key}|${this.$auth.secret_key}`)
|
|
21
|
+
.digest("hex")
|
|
22
|
+
.substring(0, 10);
|
|
23
|
+
},
|
|
24
|
+
_makeRequest({
|
|
25
|
+
$ = this, path, id, vin, ...opts
|
|
26
|
+
}) {
|
|
27
|
+
return axios($, {
|
|
28
|
+
url: `${this._baseUrl()}/${this._controlSum(id, vin)}${path}`,
|
|
29
|
+
...opts,
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
getVinDecoderInfo({
|
|
33
|
+
vin, ...opts
|
|
34
|
+
}) {
|
|
35
|
+
return this._makeRequest({
|
|
36
|
+
path: `/decode/info/${vin}.json`,
|
|
37
|
+
id: "info",
|
|
38
|
+
vin,
|
|
39
|
+
...opts,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
decodeVin({
|
|
43
|
+
vin, ...opts
|
|
44
|
+
}) {
|
|
45
|
+
return this._makeRequest({
|
|
46
|
+
path: `/decode/${vin}.json`,
|
|
47
|
+
id: "decode",
|
|
48
|
+
vin,
|
|
49
|
+
...opts,
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
checkStolen({
|
|
53
|
+
vin, ...opts
|
|
54
|
+
}) {
|
|
55
|
+
return this._makeRequest({
|
|
56
|
+
path: `/stolen-check/${vin}.json`,
|
|
57
|
+
id: "stolen-check",
|
|
58
|
+
vin,
|
|
59
|
+
...opts,
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
getVehicleMarketValue({
|
|
63
|
+
vin, ...opts
|
|
64
|
+
}) {
|
|
65
|
+
return this._makeRequest({
|
|
66
|
+
path: `/vehicle-market-value/${vin}.json`,
|
|
67
|
+
id: "vehicle-market-value",
|
|
68
|
+
vin,
|
|
69
|
+
...opts,
|
|
70
|
+
});
|
|
9
71
|
},
|
|
10
72
|
},
|
|
11
|
-
};
|
|
73
|
+
};
|