@adaptive-recognition/carmen-cloud-client
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -11,2 +11,4 @@ export { VehicleAPIClient } from "./vehicle"; | ||
export { StorageStatusResponse } from "./storage-and-hook/storagestatusresponse"; | ||
export { DescriptorAPIClient } from "./descriptor"; | ||
export { DescriptorAPIOptions, APIFilters } from "./descriptor/options"; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StorageAndHookAPIClient = exports.CodeType = exports.TransportAPIClient = exports.Locations = exports.CarmenAPIConfigError = exports.VehicleAPIClient = void 0; | ||
exports.DescriptorAPIClient = exports.StorageAndHookAPIClient = exports.CodeType = exports.TransportAPIClient = exports.Locations = exports.CarmenAPIConfigError = exports.VehicleAPIClient = void 0; | ||
var vehicle_1 = require("./vehicle"); | ||
@@ -16,2 +16,4 @@ Object.defineProperty(exports, "VehicleAPIClient", { enumerable: true, get: function () { return vehicle_1.VehicleAPIClient; } }); | ||
Object.defineProperty(exports, "StorageAndHookAPIClient", { enumerable: true, get: function () { return storage_and_hook_1.StorageAndHookAPIClient; } }); | ||
var descriptor_1 = require("./descriptor"); | ||
Object.defineProperty(exports, "DescriptorAPIClient", { enumerable: true, get: function () { return descriptor_1.DescriptorAPIClient; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -38,14 +38,34 @@ "use strict"; | ||
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.VehicleAPIClient(Object.assign(Object.assign({}, testOptions), { apiKey: usProdAPIKey, cloudServiceRegion: "US", endpoint: undefined })); | ||
const response = yield client.send("./test/vehicle/test.jpg"); | ||
const options = { | ||
apiKey: "14kyB65n7b9EfAB6wb3xjar05v1G9QTi3KEcGBG0", | ||
endpoint: "https://api.dev.carmencloud.com", | ||
}; | ||
const client = new _1.DescriptorAPIClient(options); | ||
// const apis = await client.getApis({ | ||
// detailed: true, | ||
// api: 'vehicle' | ||
// }); | ||
// console.log(apis); | ||
// const dimensions = await client.getDimensions(); | ||
// console.log(dimensions); | ||
// const freeCallCount = await client.getFreeCallCount('carmen'); | ||
// console.log(freeCallCount); | ||
// const paidSubscriptionUsage = await client.getPaidSubscriptionUsage('carmen'); | ||
// console.log(paidSubscriptionUsage); | ||
// const paidSubscriptions = await client.getPaidSubscriptions(); | ||
// console.log(paidSubscriptions); | ||
// const prices = await client.getPrices('carmen', 'HU'); | ||
// console.log(JSON.stringify(prices, null, 2)); | ||
// const products = await client.getProducts(); | ||
// console.log(JSON.stringify(products, null, 2)); | ||
// const region = await client.getRegion(); | ||
// console.log(region); | ||
// const usagePlanSubscriptions = await client.getUsagePlanSubscriptions(); | ||
// console.log(usagePlanSubscriptions); | ||
// const usagePlanUsage = await client.getUsagePlanUsage(); | ||
// console.log(usagePlanUsage); | ||
const usagePlans = yield client.getUsagePlans(); | ||
console.log(usagePlans); | ||
}); | ||
@@ -52,0 +72,0 @@ } |
@@ -60,3 +60,3 @@ "use strict"; | ||
if (response.version !== this.supportedAPIVersion) { | ||
console.error(`WARNING: API version mismatch. Expected ${this.supportedAPIVersion}, got ${response.version}.`); | ||
console.warn(`WARNING: API version mismatch. Expected ${this.supportedAPIVersion}, got ${response.version}.`); | ||
} | ||
@@ -63,0 +63,0 @@ return response; |
@@ -39,10 +39,2 @@ "use strict"; | ||
__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; | ||
}); | ||
/** | ||
@@ -80,3 +72,3 @@ * A client for interacting with the Carmen Cloud Vehicle API. | ||
if (response.version !== this.supportedAPIVersion) { | ||
console.error(`WARNING: API version mismatch. Expected ${this.supportedAPIVersion}, got ${response.version}.`); | ||
console.warn(`WARNING: API version mismatch. Expected ${this.supportedAPIVersion}, got ${response.version}.`); | ||
} | ||
@@ -83,0 +75,0 @@ return response; |
{ | ||
"name": "@adaptive-recognition/carmen-cloud-client", | ||
"version": "2.0.0", | ||
"version": "2.1.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.", | ||
@@ -13,10 +13,12 @@ "main": "dist/index.js", | ||
"test:ci": "jest --config ./jest.config.js --collectCoverage --coverageDirectory=\"./coverage\" --ci --reporters=default --reporters=jest-junit --watchAll=false", | ||
"update-types": "npm run update-types:vehicle && npm run update-types:transport && npm run update-types:storage-and-hook", | ||
"update-types": "npm run update-types:vehicle && npm run update-types:transport && npm run update-types:storage-and-hook && npm run update-types:descriptor", | ||
"update-types:vehicle": "./scripts/update-schemas.sh vehicle", | ||
"update-types:transport": "./scripts/update-schemas.sh transport", | ||
"update-types:storage-and-hook": "./scripts/update-schemas.sh storage-and-hook", | ||
"generate-types": "npm run generate-types:vehicle && npm run generate-types:transport && npm run generate-types:storage-and-hook", | ||
"update-types:descriptor": "./scripts/update-schemas.sh descriptor", | ||
"generate-types": "npm run generate-types:vehicle && npm run generate-types:transport && npm run generate-types:storage-and-hook && npm run generate-types:descriptor", | ||
"generate-types:vehicle": "./scripts/generate-types.sh vehicle", | ||
"generate-types:transport": "./scripts/generate-types.sh transport", | ||
"generate-types:storage-and-hook": "./scripts/generate-types.sh storage-and-hook" | ||
"generate-types:storage-and-hook": "./scripts/generate-types.sh storage-and-hook", | ||
"generate-types:descriptor": "./scripts/generate-types.sh descriptor" | ||
}, | ||
@@ -23,0 +25,0 @@ "keywords": [ |
@@ -110,4 +110,49 @@ # Carmen Cloud Client by Adaptive Recognition | ||
### βοΈ Descriptor API | ||
```typescript | ||
import { DescriptorAPIClient, DescriptorAPIOptions } from "."; | ||
const options: DescriptorAPIOptions = { | ||
apiKey: "<YOUR_API_KEY>", | ||
cloudServiceRegion: 'EU' | ||
}; | ||
const client = new DescriptorAPIClient(options); | ||
const apis = await client.getApis({ detailed: true }); | ||
console.log('apis:', apis); | ||
const dimensions = await client.getDimensions(); | ||
console.log('dimensions:', dimensions); | ||
const freeCallCount = await client.getFreeCallCount('carmen'); | ||
console.log('freeCallCount:', freeCallCount); | ||
const paidSubscriptionUsage = await client.getPaidSubscriptionUsage('carmen'); | ||
console.log('paidSubscriptionUsage:', paidSubscriptionUsage); | ||
const paidSubscriptions = await client.getPaidSubscriptions(); | ||
console.log('paidSubscriptions:', paidSubscriptions); | ||
const prices = await client.getPrices('carmen', 'HU'); | ||
console.log('prices:', prices); | ||
const products = await client.getProducts(); | ||
console.log('products:', products); | ||
const region = await client.getRegion(); | ||
console.log('region:', region); | ||
const usagePlanSubscriptions = await client.getUsagePlanSubscriptions(); | ||
console.log('usagePlanSubscriptions:', usagePlanSubscriptions); | ||
const usagePlanUsage = await client.getUsagePlanUsage(); | ||
console.log('usagePlanUsage:', usagePlanUsage); | ||
const usagePlans = await client.getUsagePlans(); | ||
console.log('usagePlans:', usagePlans); | ||
``` | ||
## π§ Development | ||
For more information about developing and contributing to this project, see [DEVELOPMENT.md](DEVELOPMENT.md). |
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
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
290145
146
4979
158
3