@adaptive-recognition/carmen-cloud-client
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -12,6 +12,16 @@ { | ||
"apis": { | ||
"type": "array", | ||
"description": "The list of APIs to subscribe to. Valid values are: `'vehicle'`, `'transport'`." | ||
"type": "object", | ||
"description": "An object with properties that correspond to API subscriptions.", | ||
"properties": { | ||
"vehicle": { | ||
"type": "boolean", | ||
"description": "Optional. Indicates whether to enable storage for the Vehicle API." | ||
}, | ||
"transport": { | ||
"type": "boolean", | ||
"description": "Optional. Indicates whether to enable storage for the Transport API." | ||
} | ||
} | ||
} | ||
} | ||
} |
@@ -29,3 +29,3 @@ { | ||
"type": "string", | ||
"description": "The API the event originates from. Currently only one API, `vehicle` is available." | ||
"description": "The API the event originates from. At the time of writing this documentation, the available APIs were `vehicle` and `transport` (Vehicle API and Transportation & Cargo API)." | ||
} | ||
@@ -32,0 +32,0 @@ }, |
@@ -17,4 +17,14 @@ { | ||
"apis": { | ||
"type": "array", | ||
"description": "The list of APIs to subscribe to. Valid values are: `'vehicle'`, `'transport'`." | ||
"type": "object", | ||
"description": "An object with properties that correspond to API subscriptions.", | ||
"properties": { | ||
"vehicle": { | ||
"type": "boolean", | ||
"description": "Optional. Indicates whether to enable storage for the Vehicle API." | ||
}, | ||
"transport": { | ||
"type": "boolean", | ||
"description": "Optional. Indicates whether to enable storage for the Transport API." | ||
} | ||
} | ||
}, | ||
@@ -21,0 +31,0 @@ "hookUrl": { |
@@ -7,6 +7,13 @@ { | ||
"enabledApis": { | ||
"description": "The list of APIs where event storage is currently enabled.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
"type": "object", | ||
"description": "An object indicating whether storage is enabled for the APIs included.", | ||
"properties": { | ||
"vehicle": { | ||
"type": "boolean", | ||
"description": "Optional. Indicates whether to enable storage for the Vehicle API." | ||
}, | ||
"transport": { | ||
"type": "boolean", | ||
"description": "Optional. Indicates whether to enable storage for the Transport API." | ||
} | ||
} | ||
@@ -13,0 +20,0 @@ }, |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -12,16 +35,17 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const dotenv = __importStar(require("dotenv")); | ||
const _1 = require("."); | ||
dotenv.config(); | ||
const testOptions = { | ||
apiKey: process.env.TEST_DEV_API_KEY || "", | ||
services: { anpr: true }, | ||
inputImageLocation: _1.Locations.Europe.Hungary, | ||
endpoint: process.env.TEST_DEV_ENDPOINT_URL, | ||
}; | ||
const euProdAPIKey = process.env.TEST_EU_PROD_API_KEY || ""; | ||
const usProdAPIKey = process.env.TEST_US_PROD_API_KEY || ""; | ||
function main() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const client = new _1.StorageAndHookAPIClient({ | ||
apiKey: '14kyB65n7b9EfAB6wb3xjar05v1G9QTi3KEcGBG0', | ||
endpoint: 'https://api.dev.carmencloud.com', | ||
}); | ||
const events = yield client.getEvents('vehicle', { | ||
limit: 5, | ||
order: 'desc', | ||
// before: Date.now(), | ||
after: Date.now() - 1000 * 60 * 60 * 24, | ||
}); | ||
console.log(events); | ||
const client = new _1.VehicleAPIClient(Object.assign(Object.assign({}, testOptions), { apiKey: usProdAPIKey, cloudServiceRegion: "US", endpoint: undefined })); | ||
const response = yield client.send("./test/vehicle/test.jpg"); | ||
}); | ||
@@ -28,0 +52,0 @@ } |
@@ -15,7 +15,17 @@ /** | ||
/** | ||
* The list of APIs to subscribe to. Valid values are: `'vehicle'`, `'transport'`. | ||
* An object with properties that correspond to API subscriptions. | ||
*/ | ||
apis: unknown[]; | ||
apis: { | ||
/** | ||
* Optional. Indicates whether to enable storage for the Vehicle API. | ||
*/ | ||
vehicle?: boolean; | ||
/** | ||
* Optional. Indicates whether to enable storage for the Transport API. | ||
*/ | ||
transport?: boolean; | ||
[k: string]: unknown; | ||
}; | ||
[k: string]: unknown; | ||
} | ||
//# sourceMappingURL=createhookrequest.d.ts.map |
@@ -29,3 +29,3 @@ /** | ||
/** | ||
* The API the event originates from. Currently only one API, `vehicle` is available. | ||
* The API the event originates from. At the time of writing this documentation, the available APIs were `vehicle` and `transport` (Vehicle API and Transportation & Cargo API). | ||
*/ | ||
@@ -32,0 +32,0 @@ api: string; |
@@ -19,5 +19,15 @@ /** | ||
/** | ||
* The list of APIs to subscribe to. Valid values are: `'vehicle'`, `'transport'`. | ||
* An object with properties that correspond to API subscriptions. | ||
*/ | ||
apis?: unknown[]; | ||
apis?: { | ||
/** | ||
* Optional. Indicates whether to enable storage for the Vehicle API. | ||
*/ | ||
vehicle?: boolean; | ||
/** | ||
* Optional. Indicates whether to enable storage for the Transport API. | ||
*/ | ||
transport?: boolean; | ||
[k: string]: unknown; | ||
}; | ||
/** | ||
@@ -24,0 +34,0 @@ * The URL of the webhook events will be sent to. |
@@ -23,5 +23,15 @@ /** | ||
/** | ||
* The list of APIs to subscribe to. Valid values are: `'vehicle'`, `'transport'`. | ||
* An object with properties that correspond to API subscriptions. | ||
*/ | ||
apis?: unknown[]; | ||
apis?: { | ||
/** | ||
* Optional. Indicates whether to enable storage for the Vehicle API. | ||
*/ | ||
vehicle?: boolean; | ||
/** | ||
* Optional. Indicates whether to enable storage for the Transport API. | ||
*/ | ||
transport?: boolean; | ||
[k: string]: unknown; | ||
}; | ||
/** | ||
@@ -28,0 +38,0 @@ * The URL of the webhook events will be sent to. |
@@ -50,4 +50,2 @@ "use strict"; | ||
const url = (0, urlcat_1.default)(this.apiUrl, '/events/:api', Object.assign({ api }, filters)); | ||
console.log(url); | ||
console.log(headers); | ||
const httpResponse = yield axios_1.default.get(url, { headers }); | ||
@@ -54,0 +52,0 @@ return httpResponse.data; |
@@ -11,5 +11,15 @@ /** | ||
/** | ||
* The list of APIs where event storage is currently enabled. | ||
* An object indicating whether storage is enabled for the APIs included. | ||
*/ | ||
enabledApis: string[]; | ||
enabledApis: { | ||
/** | ||
* Optional. Indicates whether to enable storage for the Vehicle API. | ||
*/ | ||
vehicle?: boolean; | ||
/** | ||
* Optional. Indicates whether to enable storage for the Transport API. | ||
*/ | ||
transport?: boolean; | ||
[k: string]: unknown; | ||
}; | ||
/** | ||
@@ -16,0 +26,0 @@ * The ARN of the SNS topic hook requests are sent from. The value is `null` if storage is disabled. |
@@ -6,2 +6,4 @@ /// <reference types="node" /> | ||
import { TransportationCargoAPIResponse } from "./response"; | ||
export * from "./options"; | ||
export * from "./response"; | ||
export declare class TransportAPIClient { | ||
@@ -8,0 +10,0 @@ private options; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -23,2 +37,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
const errors_1 = require("../errors"); | ||
__exportStar(require("./options"), exports); | ||
__exportStar(require("./response"), exports); | ||
class TransportAPIClient { | ||
@@ -25,0 +41,0 @@ constructor(options) { |
export declare enum CodeType { | ||
/** | ||
* US container codes (6 or 10 digits) | ||
* ISO and ILU shipping container codes | ||
*/ | ||
ACCR_USA = "accr_usa", | ||
/** | ||
* Intermodal shipping container codes (ilu) | ||
*/ | ||
ILU = "ilu", | ||
/** | ||
* Intermodal shipping container codes (iso) | ||
*/ | ||
ISO = "iso", | ||
/** | ||
* Moco container codes (8 digits) | ||
* Identification codes used on trucks (ACCR, US DOT, CHASSIS and others) | ||
*/ | ||
MOCO = "moco", | ||
TRUCK = "truck", | ||
/** | ||
* Brasil wagon codes (10 or 11 digits) | ||
* American wagon and locomotive codes used across the American continent to | ||
* identify individual rail vehicles (AAR, BRA and others) | ||
*/ | ||
BRA = "bra", | ||
AM_RAIL = "am-rail", | ||
/** | ||
* Russian and Ukrainian wagon codes (8 digits) | ||
* European wagon and locomotive codes used across Europe to identify individual rail vehicles | ||
*/ | ||
RUS = "rus", | ||
/** | ||
* Cargo wagon codes | ||
*/ | ||
UIC = "uic", | ||
/** | ||
* US Cargo wagon codes | ||
*/ | ||
AAR = "aar", | ||
/** | ||
* US truck chassis code | ||
*/ | ||
CHASSIS = "chassis", | ||
/** | ||
* US Department of Transportation registration number | ||
*/ | ||
USDOT = "usdot" | ||
EU_RAIL = "eu-rail" | ||
} | ||
@@ -43,0 +20,0 @@ export interface TransportAPIOptions { |
"use strict"; | ||
// A 24Q1-től az alábbi OCR engine-eket adjuk ki, egyaránt negyedéves frissítési gyakorisággal: | ||
// EU_RAIL: az eddigi UIC ill. RUS OCR engine-ek együtt + egyéb, európai vagon- és mozdonykódok | ||
// AM_RAIL: az eddigi AAR ill. BRA OCR engine-ek együtt + egyéb, az amerikai kontinenseken található vagon- és mozdonykódok | ||
// TRUCK: az eddigi ACCR_USA, USDOT és CHASSIS OCR engine-ek együtt + egyéb, teherautókon előforduló azonosító kódok | ||
// ISO: az eddigi ISO, ILU és ISOILU OCR engine-ek együtt | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -7,42 +12,19 @@ exports.CodeType = void 0; | ||
/** | ||
* US container codes (6 or 10 digits) | ||
* ISO and ILU shipping container codes | ||
*/ | ||
CodeType["ACCR_USA"] = "accr_usa"; | ||
/** | ||
* Intermodal shipping container codes (ilu) | ||
*/ | ||
CodeType["ILU"] = "ilu"; | ||
/** | ||
* Intermodal shipping container codes (iso) | ||
*/ | ||
CodeType["ISO"] = "iso"; | ||
/** | ||
* Moco container codes (8 digits) | ||
* Identification codes used on trucks (ACCR, US DOT, CHASSIS and others) | ||
*/ | ||
CodeType["MOCO"] = "moco"; | ||
CodeType["TRUCK"] = "truck"; | ||
/** | ||
* Brasil wagon codes (10 or 11 digits) | ||
* American wagon and locomotive codes used across the American continent to | ||
* identify individual rail vehicles (AAR, BRA and others) | ||
*/ | ||
CodeType["BRA"] = "bra"; | ||
CodeType["AM_RAIL"] = "am-rail"; | ||
/** | ||
* Russian and Ukrainian wagon codes (8 digits) | ||
* European wagon and locomotive codes used across Europe to identify individual rail vehicles | ||
*/ | ||
CodeType["RUS"] = "rus"; | ||
/** | ||
* Cargo wagon codes | ||
*/ | ||
CodeType["UIC"] = "uic"; | ||
/** | ||
* US Cargo wagon codes | ||
*/ | ||
CodeType["AAR"] = "aar"; | ||
/** | ||
* US truck chassis code | ||
*/ | ||
CodeType["CHASSIS"] = "chassis"; | ||
/** | ||
* US Department of Transportation registration number | ||
*/ | ||
CodeType["USDOT"] = "usdot"; | ||
CodeType["EU_RAIL"] = "eu-rail"; | ||
})(CodeType = exports.CodeType || (exports.CodeType = {})); | ||
//# sourceMappingURL=options.js.map |
@@ -6,2 +6,4 @@ /// <reference types="node" /> | ||
import { VehicleAPIResponse } from "./response"; | ||
export * from "./options"; | ||
export * from "./response"; | ||
/** | ||
@@ -8,0 +10,0 @@ * A client for interacting with the Carmen Cloud Vehicle API. |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -23,2 +37,12 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
const errors_1 = require("../errors"); | ||
__exportStar(require("./options"), exports); | ||
__exportStar(require("./response"), exports); | ||
axios_1.default.interceptors.request.use(request => { | ||
console.log('Starting Request', request); | ||
return request; | ||
}); | ||
axios_1.default.interceptors.response.use(response => { | ||
console.log('Response:', response); | ||
return response; | ||
}); | ||
/** | ||
@@ -127,3 +151,3 @@ * A client for interacting with the Carmen Cloud Vehicle API. | ||
return (0, urlcat_1.default)(baseUrl, "/vehicle/:region", { | ||
region: this.options.inputImageLocation.region, | ||
region: this.options.inputImageLocation.region.toLowerCase(), | ||
}); | ||
@@ -130,0 +154,0 @@ } |
{ | ||
"name": "@adaptive-recognition/carmen-cloud-client", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "Node.js client for Carmen Cloud by Adaptive Recognition. Efficiently read license plates, recognize vehicle details, and process container, railway wagon, and US DOT codes.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
223827
3547
7