@meterapp/car-image-sdk 1.33.0 → 1.35.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/README.md +33 -19
- package/dist/client.d.ts +34 -12
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +61 -25
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +28 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +11 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +41 -26
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +96 -65
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/support.d.ts +20 -12
- package/dist/mcp/support.d.ts.map +1 -1
- package/dist/mcp/support.js +15 -5
- package/dist/mcp/support.js.map +1 -1
- package/dist/packs.d.ts +6 -6
- package/dist/packs.d.ts.map +1 -1
- package/dist/support.d.ts +36 -15
- package/dist/support.d.ts.map +1 -1
- package/dist/types.d.ts +152 -21
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +31 -3
- package/dist/types.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @meterapp/car-image-sdk
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for the **Car Image API** by Meter — studio-quality, transparent-background renders of any vehicle in the open [`@meterapp/vehicle-db`](https://github.com/MeterApp/vehicle-db) catalog (1,608 makes, 42,
|
|
3
|
+
TypeScript SDK for the **Car Image API** by Meter — studio-quality, transparent-background renders of any vehicle in the open [`@meterapp/vehicle-db`](https://github.com/MeterApp/vehicle-db) catalog (1,608 makes, 42,312 models, model years 1990–2027, each with a page at [carimage.dev/cars](https://carimage.dev/cars?ref=npm-sdk)), in eight camera views and any paint color; plus stable vehicle ids, free VIN decoding and textured 3D models.
|
|
4
4
|
|
|
5
5
|
- Zero runtime dependencies. Works in Node 20+, Vercel/Cloudflare edge runtimes, Deno, Bun and browsers.
|
|
6
6
|
- Typed parameters and responses for every endpoint.
|
|
@@ -14,11 +14,13 @@ npm install @meterapp/car-image-sdk
|
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
For vehicle images in chat, resolve the vehicle, call `create_car_image_urls` once (7-day TTL, unlimited uses, renewal off unless requested)
|
|
17
|
+
For vehicle images in chat, resolve the vehicle and call `get_car_image` with its id: the MCP result carries the picture, and chat apps show it inline. Where a tool's image does not reach the person (a terminal such as Claude Code or Codex), call `create_car_image_urls` once instead (7-day TTL, unlimited uses, renewal off unless requested) and link the returned `url`, or paste its `data[].markdown` where inline images render; state expiry and reuse unexpired URLs. Signed URLs are for pages, apps, emails and documents; REST responses are unchanged. Do not call both paid tools for one chat image.
|
|
18
18
|
|
|
19
19
|
## Pricing in one line
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Plans meter **vehicle images**: one vehicle (make, model, year) in one color from one angle, counted once per UTC month and delivered as often as you like, at any size and in any format (bytes, signed URLs, their renewals and every load included). An angle the catalog has not prepared yet counts the same: we prepare it so it can be shown in any color, which takes a little time the first time. **Free**: $0, no card, 100 vehicle images a month, 100 credits once at signup, evaluation and personal projects. **Pro**: $49/month ($490/year), 2,500 vehicle images a month, 1,000 credits a month, commercial license while subscribed. **Business**: $99/month ($990/year), 10,000 vehicle images a month, 4,000 credits a month, 600 requests a minute per key, 25 keys. **Enterprise**: custom. There is no overage: past an allowance, new images answer `402` (`plan_image_limit`, nothing charged) until the 1st (UTC), while images already received that month keep serving. Images cost no credits; credits are no longer sold and pay only for 3D models (**100 credits** once per vehicle and color), make logos (1 credit each) and quality upgrades (20 credits). A one-time [Image Pack](https://carimage.dev/docs/packs?ref=npm-sdk) buys a set of images to keep and self-host for good. VIN decoding, catalog lookups, availability checks, polling and downloads are free. `client.account()` returns the plan in force as `data.plan` (with `meter`) and this month's counts in `data.limits_usage`; `client.pricing()` is the live price list.
|
|
22
|
+
|
|
23
|
+
License: on Pro and Business, commercial use while subscribed, including copies on your own servers and CDN; within 30 days after the plan ends, delete stored copies. Image Pack images may be self-hosted forever. Accounts that paid before 2026-10-25 keep their old terms and credit meter (1 credit per image) until the cutover date in their notice. Terms: <https://carimage.dev/terms?ref=npm-sdk#license>.
|
|
22
24
|
|
|
23
25
|
Get a key at <https://carimage.dev/dashboard?ref=npm-sdk> or run `npx @meterapp/car-image login`.
|
|
24
26
|
|
|
@@ -41,7 +43,10 @@ const image = await client.getImage({
|
|
|
41
43
|
});
|
|
42
44
|
|
|
43
45
|
await writeFile("porsche-911.png", image.bytes);
|
|
44
|
-
console.log(image.source, image.
|
|
46
|
+
console.log(image.source, image.usage, image.requestId);
|
|
47
|
+
// usage: { vehicleImages: { used, included } } from the
|
|
48
|
+
// X-Vehicle-Images-* headers (included null = unlimited); X-Credits-Charged is 0.
|
|
49
|
+
// Legacy credit-meter accounts get creditsCharged 1 and creditsRemaining instead.
|
|
45
50
|
```
|
|
46
51
|
|
|
47
52
|
`image.vehicleId` is the stable id of the catalog vehicle served (the `X-Vehicle-Id` header), so a bytes response still names the car it rendered.
|
|
@@ -110,11 +115,19 @@ const { data } = await client.decodeVin(vin); // free
|
|
|
110
115
|
if (data.vehicle) {
|
|
111
116
|
const params = { vehicle: data.vehicle.id, view: "front-3-4" } as const;
|
|
112
117
|
const ready = await client.isImageReady(params); // free
|
|
113
|
-
const { data: [url] } = await client.createImageUrls(params); //
|
|
118
|
+
const { data: [url] } = await client.createImageUrls(params); // one vehicle image this month, a signed URL for any <img>
|
|
114
119
|
show(url.url, { instant: ready }); // a ready image loads at once
|
|
115
120
|
}
|
|
116
121
|
```
|
|
117
122
|
|
|
123
|
+
`checkAvailability(images)` checks up to 200 images at once before you ask for them, free and read-only (`POST /api/v1/images/availability`): whether each vehicle view is prepared, whether it would count a vehicle image or a new vehicle view this month, and whether the whole list fits the plan:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
const { data } = await client.checkAvailability(rows.map((row) => ({ vehicle: row.id, view: "front-3-4", color: row.paint })));
|
|
127
|
+
data.images[0]; // { index, prepared, counts_image, vehicle, view, color }
|
|
128
|
+
data.allowance; // { vehicle_images: { used, included, would_add, fits } } (null on the credit meter)
|
|
129
|
+
```
|
|
130
|
+
|
|
118
131
|
`cachedImageUrl(params)` builds the keyless `mode=cached` URL behind `isImageReady`. Without a key it loads only a public preview, a render the [/cars pages](https://carimage.dev/cars?ref=npm-sdk) show; any other rendered image answers `401` with `code: "signed_url_required"` and `cached: true` (docs: [image access](https://carimage.dev/docs/images?ref=npm-sdk#cached)).
|
|
119
132
|
|
|
120
133
|
## Browser
|
|
@@ -129,7 +142,7 @@ The SDK itself is browser-safe (no Node APIs), which is useful for public endpoi
|
|
|
129
142
|
|
|
130
143
|
## Account-signed URLs (available on request)
|
|
131
144
|
|
|
132
|
-
Sign image URLs on your own server, with no API call per image: `carImageUrl` builds `https://carimage.dev/i/{vehicle}/{view}.{format}?…&k=…&sig=…` and signs it with your key's signing secret (`imgsig_…`, made on the key's card in the [dashboard](https://carimage.dev/dashboard?ref=npm-sdk) or with `POST /api/v1/signing-secrets`). Each image
|
|
145
|
+
Sign image URLs on your own server, with no API call per image: `carImageUrl` builds `https://carimage.dev/i/{vehicle}/{view}.{format}?…&k=…&sig=…` and signs it with your key's signing secret (`imgsig_…`, made on the key's card in the [dashboard](https://carimage.dev/dashboard?ref=npm-sdk) or with `POST /api/v1/signing-secrets`). Each image counts one vehicle image for the month the first time our CDN fetches it that month (1 credit per account per calendar month on the legacy credit meter); the URL never expires unless you pass `expiresAt`. Early access: email support@carimage.dev to have it turned on (until then the URLs answer 403 `signed_urls_not_enabled`).
|
|
133
146
|
|
|
134
147
|
```ts
|
|
135
148
|
import { carImageUrl } from "@meterapp/car-image-sdk";
|
|
@@ -217,7 +230,7 @@ await client.getImage({
|
|
|
217
230
|
| `framing` | `consistent` (default), `tight`, `balanced` | A preset in place of `trim`/`padding`: `tight` is `trim: true, padding: 0` (the car fills the box), `balanced` is `trim: true, padding: 6` (even catalog margins), `consistent` keeps the camera scale all eight views of a vehicle share (galleries, spinners, 3D previews). Same image, cache entry and credit as the spelled-out form; never together with `trim` or `padding`. |
|
|
218
231
|
| `trim` | `true` | Crops to the car's alpha bounds before sizing so it fills the box instead of floating in the square source frame. Recommended for non-square layouts. |
|
|
219
232
|
| `padding` | 0–50 | Margin around a trimmed car, as a percentage of its longer side. Only with `trim`. |
|
|
220
|
-
| `shadow` | `true` | A soft, neutral ground shadow under the car, drawn from its own cut-out at delivery: semi-transparent on a transparent image, grey on a `background`. Same
|
|
233
|
+
| `shadow` | `true` | A soft, neutral ground shadow under the car, drawn from its own cut-out at delivery: semi-transparent on a transparent image, grey on a `background`. Same vehicle image, nothing extra; car images only, not `getMakeLogo`. |
|
|
221
234
|
| `format` | `png` (default) · `webp` · `jpg` · `auto` | `auto` picks WebP for clients whose `Accept` header lists it and PNG otherwise (`Vary: Accept`); a signed URL created with `auto` negotiates on every load. |
|
|
222
235
|
|
|
223
236
|
The same parameters apply to `getImageUrl` and to every entry of `createImageUrls`; the returned `vehicle` echoes `vehicle_id`, `color`, `fit`, `background`, `trim`, `padding` and `shadow` back. `assertImageParams` (and therefore every call) rejects a `padding` without `trim`, a `framing` beside `trim` or `padding`, a dimension that is not a whole number of pixels from 1, a color that is neither a preset, a CSS color name nor a hex, and a request that names neither a vehicle id nor all of make, model and year, before anything is sent. A size above 1024 is sent as given, for the server to clamp.
|
|
@@ -254,7 +267,7 @@ export async function POST(request: Request) {
|
|
|
254
267
|
## Everything else
|
|
255
268
|
|
|
256
269
|
```ts
|
|
257
|
-
await client.getImageUrl(params); //
|
|
270
|
+
await client.getImageUrl(params); // a signed URL instead of bytes; counts the vehicle image like getImage
|
|
258
271
|
await client.options(); // views, colors (and how hex paint is spelled), sizes, fits, backgrounds, trim limits, formats, pricing, catalog coverage, vehicle ids
|
|
259
272
|
await client.resolve("red 2024 porsche 911 side view"); // the lookup before a render: free text -> { vehicle_id, make, model, year, view, color } + candidates + confidence high|medium|low + extracted
|
|
260
273
|
await client.vehicles(); // years
|
|
@@ -268,8 +281,8 @@ await client.decodeVin("1HGCM82633A004352"); // free VIN decode + the
|
|
|
268
281
|
client.cachedImageUrl({ vehicle: id }); // keyless mode=cached URL: a public preview, else 401/404, never a render
|
|
269
282
|
await client.isImageReady({ vehicle: id }); // free, no key: whether that image can be shown now
|
|
270
283
|
await client.create3dModel({ vehicle: id }, { color }); // 100 credits; then wait3dModel, get3dModel, list3dModels, download3dModel
|
|
271
|
-
await client.
|
|
272
|
-
await client.
|
|
284
|
+
await client.checkAvailability(images); // free: prepared or not, what 1-200 images would count this month
|
|
285
|
+
await client.account(); // plan (meter, limits), limits_usage (vehicle images), credits, usage_30d, key scopes
|
|
273
286
|
await client.createPlanCheckout("pro", "month"); // hosted Checkout for a plan, or an in-place switch (data.changed) for an account already on one
|
|
274
287
|
await client.billingPortal(); // Stripe Customer Portal URL
|
|
275
288
|
await client.health(); // { status: "ok" | "degraded", checks }
|
|
@@ -277,7 +290,7 @@ await client.openapi(); // the OpenAPI 3.1 docum
|
|
|
277
290
|
await client.fetch("/api/v1/account"); // authenticated raw fetch (same-origin only)
|
|
278
291
|
```
|
|
279
292
|
|
|
280
|
-
`createImageUrls(images, options)` takes 1–50 images and `{ ttlSeconds, maxUses, renew, renewDays, idempotencyKey }`. With `renew: true` a URL keeps serving past its TTL
|
|
293
|
+
`createImageUrls(images, options)` takes 1–50 images and `{ ttlSeconds, maxUses, renew, renewDays, idempotencyKey }`. With `renew: true` a URL keeps serving past its TTL, renewing in each opened window of `ttlSeconds` (no extra count on a plan; one more credit per window on the legacy credit meter), until `renewDays` (1–365, default 365) — for email, CMS pages and documents that outlive a TTL. `resolve()` returns a `confidence` of `"high"`, `"medium"` or `"low"`; ask the human before making an image on `low`.
|
|
281
294
|
|
|
282
295
|
## Error handling
|
|
283
296
|
|
|
@@ -291,13 +304,14 @@ try {
|
|
|
291
304
|
} catch (error) {
|
|
292
305
|
if (error instanceof CarImageError) {
|
|
293
306
|
error.status; // 400 | 401 | 402 | 404 | 409 | 422 | 429 | 502 | 503 | 408 (wait3dModel timeout) | 0 (network)
|
|
294
|
-
error.title; // "
|
|
295
|
-
error.detail; // "
|
|
307
|
+
error.title; // "Plan limit reached"
|
|
308
|
+
error.detail; // "The Free plan covers 100 vehicle images a month … Nothing was charged."
|
|
296
309
|
error.requestId; // "0d1e…" — quote this when contacting support
|
|
297
|
-
error.problem; // the raw application/problem+json body (402
|
|
310
|
+
error.problem; // the raw application/problem+json body (a 402 carries code "plan_image_limit" with plan, used, included, requested, resets_at, pack_url and checkout_url; "subscription_required_for_credits" with balance and required_credits when a 3D model, logo or upgrade needs more credits than the account holds; "plan_vehicle_limit" on the legacy credit meter; a vehicle 404 includes suggestions: real catalog vehicles with ids to retry with, see /docs/vehicles#missing; a 400 for a query name the endpoint does not read includes parameter and allowed)
|
|
298
311
|
error.retryAfterSeconds; // set on 429, on a 409 (Idempotency-Key conflict, or a 3D file requested before the model is ready) and on a 503
|
|
299
312
|
if (error.isInsufficientCredits) {
|
|
300
|
-
//
|
|
313
|
+
// Any 402: nothing was charged. Show the human error.problem.checkout_url (a higher plan) or
|
|
314
|
+
// error.problem.pack_url (Image Packs); never buy automatically. Images already received keep serving.
|
|
301
315
|
}
|
|
302
316
|
}
|
|
303
317
|
}
|
|
@@ -319,7 +333,7 @@ import {
|
|
|
319
333
|
|
|
320
334
|
Register a tool's input as `readingTextArguments(MCP_TOOLS[name].inputSchema)`, as both servers do. A host that holds no typed schema for a tool sends every argument as text, and the wrapper reads `"true"`, `"960"` and the JSON of a list as the type the schema advertises before zod validates them; the JSON Schema it advertises is the zod schema's own. The shared `MAX_MCP_TOOL_INPUT_ELEMENTS` limit bounds combined array elements and object members to 10,000 before validation, including JSON values decoded from text; pass it as the MCP server’s `maxToolInputElements` option too.
|
|
321
335
|
|
|
322
|
-
Tools come in two sets. `MCP_TOOLSETS.core` (`DEFAULT_MCP_TOOLSET`, `"core"`) is the eleven core tools an agent needs to look a vehicle up, render it and watch the
|
|
336
|
+
Tools come in two sets. `MCP_TOOLSETS.core` (`DEFAULT_MCP_TOOLSET`, `"core"`) is the eleven core tools an agent needs to look a vehicle up, render it and watch the month's usage: `resolve_vehicle`, `search_vehicles`, `decode_vin`, `check_vehicles`, `get_car_image`, `create_car_image_urls`, `get_account`, `request_feature`, `report_issue`, `upvote_feedback`, `submit_review`. `MCP_TOOLSETS.all` (forty in total) adds `MCP_DOCUMENTED_EXTRAS`, the twenty-one more with `?toolset=all` that the reference documents, for make logos, 3D models, image options, the API reference, pricing, help and billing links: `list_feedback`, `get_feedback`, `list_my_feedback`, `remove_feedback_vote`, `comment_on_feedback`, `list_reviews`, `get_make_logo`, `create_3d_model`, `get_3d_model`, `publish_3d_model`, `list_image_options`, `describe_api`, `get_pricing`, `search_help`, `create_checkout_link`, `get_billing_link`, `purchase_plan`, `pay_invoice`, `checkout_status`, `list_members`, `list_webhooks`; and `MCP_UNLISTED_TOOLS`, tools both servers serve on `all` that the public reference leaves out. The hosted server exposes `core` at `https://carimage.dev/api/mcp` and `all` at `https://carimage.dev/api/mcp?toolset=all`; the stdio server takes `car-image mcp --toolset all`. `mcpInstructions(toolset)` returns the matching server instructions (`MCP_INSTRUCTIONS` is the `all` text) and `isMcpToolset(value)` validates a name from a URL or a flag. The instructions open with `mcpInstructionsHead(toolset)`: what an agent must know to use the tools well and safely (look the vehicle up with `resolve_vehicle`, then render by the `vehicle` id; what it costs; stop on a `402`), kept under `MCP_INSTRUCTIONS_HEAD_LIMIT` (2,048 characters) because some hosts pass a model only that much of a server's instructions. The reference follows it.
|
|
323
337
|
|
|
324
338
|
`get_car_image`, each `create_car_image_urls` entry and `create_3d_model` name the vehicle by make, model and year or by `vehicle` (a stable id) and take `color` as a preset, a CSS color name or a hex; the image tools also take `fit`, `background`, `trim`, `padding` and `shadow` alongside view, size and format (`auto` included; `inlineImageFormat` is what both servers deliver an inline image as for it: png), and `create_car_image_urls` honors `renew` and `renew_days` and takes `idempotency_key` (`IDEMPOTENCY_KEY_PATTERN`), which the stdio server forwards as the `Idempotency-Key` header. `create_3d_model` costs 100 credits, and its description and the server instructions tell the agent to confirm with the human first. Every tool but `describe_api`, whose result is the reference prose itself, advertises an `outputSchema` and returns `structuredContent` that matches it, so a host can hand the model typed data instead of re-parsing the text block. The schemas allow unknown fields: the payloads mirror the REST API and gain fields as it grows. The input bounds are the REST API's: `max_uses` 0–1000 and a search `limit` of 1–25; `width` and `height` have no upper bound in the schema because the server clamps a size above 1024. Numeric inputs are coerced, so a host that sends `"960"` for `960` is understood; the advertised JSON Schema still says integer, and flags such as `trim` stay strict booleans.
|
|
325
339
|
|
|
@@ -338,9 +352,9 @@ MIT © Meter
|
|
|
338
352
|
|
|
339
353
|
Feedback (free): `request_feature`, `report_issue`, `upvote_feedback` and `submit_review` are core tools; `list_feedback`, `get_feedback`, `list_my_feedback`, `remove_feedback_vote`, `comment_on_feedback` and `list_reviews` come with `?toolset=all`. REST: `GET /api/v1/feedback`, `POST /api/v1/feedback/features`, `POST /api/v1/feedback/issues`, `GET /api/v1/feedback/{id}`, `POST`/`DELETE /api/v1/feedback/{id}/votes`, `POST /api/v1/feedback/{id}/comments`, `GET /api/v1/reviews`, `PUT /api/v1/reviews/me`. CLI: `car-image feedback list|show|mine|request|report|upvote|comment`, `car-image review`, `car-image reviews`. After a failure that looks like a Car Image bug, offer `report_issue` with the failed call's `request_id`; when the human wishes the API did something, `request_feature`. Both return `similar` items first and file nothing until `force: true`: upvote a match instead. Issues are private to the reporter and the team. Every new item, upvote, official response and status change is emailed to the people who follow it. Guide: https://carimage.dev/docs/feedback?ref=npm-sdk
|
|
340
354
|
|
|
341
|
-
Use `search_help` for source-linked product, licensing, policy and Enterprise answers; search each question separately without customer emails or secrets. Use `report_gap: true` when related articles do not answer the question. Queries are recorded privately to improve documentation. `get_pricing` returns current plans and
|
|
355
|
+
Use `search_help` for source-linked product, licensing, policy and Enterprise answers; search each question separately without customer emails or secrets. Use `report_gap: true` when related articles do not answer the question. Queries are recorded privately to improve documentation. `get_pricing` returns current plans and Image Packs. On the human's request, `create_checkout_link` prepares a plan purchase (credits are not sold) and `get_billing_link` opens settings; the human confirms in the browser. Connected apps get a sign-in dashboard link. Never send an owner-account Stripe link to another customer.
|
|
342
356
|
|
|
343
|
-
CLI: `car-image pricing`, `car-image support "question" [--report-gap]`, `car-image billing --
|
|
357
|
+
CLI: `car-image pricing`, `car-image support "question" [--report-gap]`, `car-image billing --plan pro --no-browser`, `car-image billing --portal`. SDK: `pricing()`, `searchHelp(question)`, `createCheckoutLink({ plan: "pro" })`, `getBillingLink()`. The plugin includes the `car-image-support` skill.
|
|
344
358
|
|
|
345
359
|
[Help center](https://carimage.dev/help?ref=npm-sdk).
|
|
346
360
|
|
|
@@ -351,7 +365,7 @@ logo, or `car-image logo --make Toyota --width 256 --trim --out toyota-logo.png`
|
|
|
351
365
|
to save it. Both accept the image transforms; MCP `format: "auto"` returns PNG.
|
|
352
366
|
Each successful delivery costs 1 credit, including cache hits. There is no signed
|
|
353
367
|
logo URL: download and host the file for a site. Do not use the vehicle image URL
|
|
354
|
-
tools for logos. On 402, stop and ask the human;
|
|
368
|
+
tools for logos. On 402, stop and ask the human; credits come with a plan and are not sold.
|
|
355
369
|
|
|
356
370
|
SDK: `client.getMakeLogo({ make: "toyota", width: 256, trim: true })` returns bytes and billing metadata.
|
|
357
371
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentLimitResponse, AgentPurchaseResponse, CheckoutLinkInput, BillingLinkResponse, CheckoutStatusResponse, HelpResponse, PricingResponse, PurchasePlanInput } from "./support.js";
|
|
2
2
|
import type { CreatedPackBatchResponse, PackBatchInput, PackBatchItemInput, PackBatchResponse, PackExportInput, PackExportResponse, PackImageOptions, PackImageResult, PackListResponse, PackManifestResponse, PackQuality, PackQuoteResponse, PackResponse } from "./packs.js";
|
|
3
|
-
import { type AccountResponse, type MembersResponse, type BuildingResponse, type
|
|
3
|
+
import { type AccountResponse, type MembersResponse, type BuildingResponse, type PlanCheckoutResponse, type PlanInterval, type CreateImageUrlsOptions, type CreateImageUrlsResponse, type AvailabilityCheckResponse, type ImageUsage, type CreateModel3dOptions, type CreateModel3dResponse, type CreateRequestInput, type FiledFeedbackResponse, type ListReviewsParams, type ReportIssueInput, type RequestFeatureInput, type ReviewInput, type ReviewListResponse, type ReviewResponse, type CreateRequestResponse, type DecodeVinOptions, type DeviceCodeResponse, type DeviceTokenResult, type FeedbackInput, type FeedbackResponse, type FetchLike, type HealthResponse, type ImageParams, type MakeLogoParams, type ImageResult, type ImageUrlResponse, type ListRequestsParams, type Model3d, type Model3dFileKind, type Model3dFileResult, type Model3dListResponse, type Model3dResponse, type OpenApiDocument, type OptionsResponse, type PortalResponse, type ReferralResponse, type ReferralSource, type RequestCommentResponse, type RequestCommentsResponse, type RequestDetailResponse, type RequestListResponse, type RequestResponse, type ResolveResponse, type TelemetryEvent, type VehicleCheckEntry, type VehicleCheckResponse, type VehicleMakeModelsResponse, type VehicleMakesResponse, type VehicleModelLookupResponse, type VehicleModelsResponse, type VehicleResponse, type VehicleSearchResponse, type VehicleSelector, type VehicleYearsResponse, type VinResponse, type WaitModel3dOptions } from "./types.js";
|
|
4
4
|
import type { CreatedWebhookResponse, CreateWebhookInput, DeletedWebhookResponse, EventListResponse, ListEventsParams, UpdateWebhookInput, WebhookDeliveriesResponse, WebhookListResponse, WebhookResponse, WebhookTestResponse } from "./webhooks.js";
|
|
5
5
|
export interface CarImageClientOptions {
|
|
6
6
|
/** `cimg_…` key. Falls back to `process.env.CAR_IMAGE_API_KEY` when running on a server. */
|
|
@@ -39,6 +39,8 @@ export interface CheckVehiclesOptions extends RequestOptions {
|
|
|
39
39
|
/** Called after each request with how many entries have been checked so far and how many there are. */
|
|
40
40
|
onProgress?: (checked: number, total: number) => void;
|
|
41
41
|
}
|
|
42
|
+
/** The vehicle-image meter's headers (`X-Vehicle-Images-*`); null on the credit meter or older servers. */
|
|
43
|
+
export declare function usageFromHeaders(headers: Headers): ImageUsage | null;
|
|
42
44
|
/** The last call this client made that failed: what `reportIssue` attaches. */
|
|
43
45
|
export interface LastFailure {
|
|
44
46
|
request_id: string | null;
|
|
@@ -76,11 +78,17 @@ export declare class CarImageClient {
|
|
|
76
78
|
maskedApiKey(): string | null;
|
|
77
79
|
/** Keeps the key out of `JSON.stringify(client)`, logs and error reports. */
|
|
78
80
|
toJSON(): Record<string, unknown>;
|
|
79
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* GET /api/v1/images/car — the bytes plus usage headers. On a plan this
|
|
83
|
+
* counts one vehicle image for the month (vehicle, color and angle; every
|
|
84
|
+
* further delivery of it, at any size or format, is included) and costs no
|
|
85
|
+
* credits (`usage`); legacy credit-meter accounts pay 1 credit
|
|
86
|
+
* (`creditsRemaining`).
|
|
87
|
+
*/
|
|
80
88
|
getImage(params: ImageParams, options?: RequestOptions): Promise<ImageResult>;
|
|
81
89
|
/** GET /api/v1/images/logo — 1 credit. Third-party trademarks; no license granted. */
|
|
82
90
|
getMakeLogo(params: MakeLogoParams, options?: RequestOptions): Promise<ImageResult>;
|
|
83
|
-
/** GET /api/v1/images/car with `Accept: application/json` — 1 credit
|
|
91
|
+
/** GET /api/v1/images/car with `Accept: application/json` — a signed URL; counts the vehicle image like `getImage` (1 credit on the legacy credit meter). */
|
|
84
92
|
getImageUrl(params: ImageParams, options?: RequestOptions): Promise<ImageUrlResponse>;
|
|
85
93
|
/**
|
|
86
94
|
* The keyless `mode=cached` URL of an image: free, and it never renders.
|
|
@@ -98,15 +106,26 @@ export declare class CarImageClient {
|
|
|
98
106
|
* through a signed URL or a key), false on 404 `not_cached`; any other
|
|
99
107
|
* answer (an unknown vehicle id, an invalid parameter) throws a
|
|
100
108
|
* CarImageError. A ready image then loads at once through `createImageUrls`
|
|
101
|
-
* or `getImage
|
|
109
|
+
* or `getImage`; a missing one is prepared by them. To check many images,
|
|
110
|
+
* and what they would count against the month, use {@link checkAvailability}.
|
|
102
111
|
*/
|
|
103
112
|
isImageReady(params: ImageParams, options?: RequestOptions): Promise<boolean>;
|
|
104
113
|
/**
|
|
105
|
-
* POST /api/v1/image-urls —
|
|
106
|
-
*
|
|
107
|
-
*
|
|
114
|
+
* POST /api/v1/image-urls — up to 50 images per call. On a plan each URL's
|
|
115
|
+
* image counts once for the month when the URL is made (`billing.vehicle_images`),
|
|
116
|
+
* and loads and renewals add nothing; legacy credit-meter accounts pay 1
|
|
117
|
+
* credit per URL at creation and one per renewed window.
|
|
108
118
|
*/
|
|
109
119
|
createImageUrls(images: ImageParams | ImageParams[], options?: CreateImageUrlsOptions & RequestOptions): Promise<CreateImageUrlsResponse>;
|
|
120
|
+
/**
|
|
121
|
+
* POST /api/v1/images/availability — free and read-only (renders, queues and
|
|
122
|
+
* counts nothing). For up to 200 images (the image objects
|
|
123
|
+
* `createImageUrls` takes), whether each vehicle view is prepared (so every
|
|
124
|
+
* color of it serves now), whether asking for it would count a vehicle
|
|
125
|
+
* image or a new vehicle view this month, and whether the whole list fits
|
|
126
|
+
* the plan's allowances. Check a catalog here before importing it.
|
|
127
|
+
*/
|
|
128
|
+
checkAvailability(images: ImageParams | ImageParams[], options?: RequestOptions): Promise<AvailabilityCheckResponse>;
|
|
110
129
|
/** GET /api/v1/images/options — public; views, colors, sizes, formats, pricing, catalog. */
|
|
111
130
|
options(options?: RequestOptions): Promise<OptionsResponse>;
|
|
112
131
|
/** POST /api/v1/images/resolve — free; turns "red 2024 porsche 911 side view" into parameters. */
|
|
@@ -251,7 +270,7 @@ export declare class CarImageClient {
|
|
|
251
270
|
shareBuilding(building: string, options?: RequestOptions): Promise<BuildingResponse>;
|
|
252
271
|
/** POST /api/v1/account/referral — how you found the API (one of `REFERRAL_SOURCES`). Private to the team. */
|
|
253
272
|
shareReferral(source: ReferralSource, detail?: string, options?: RequestOptions): Promise<ReferralResponse>;
|
|
254
|
-
/** GET /api/v1/account —
|
|
273
|
+
/** GET /api/v1/account — the plan, this month's vehicle images (`limits_usage`), credits, 30-day usage, key scopes. */
|
|
255
274
|
account(options?: RequestOptions): Promise<AccountResponse>;
|
|
256
275
|
/** GET /api/v1/account/members — the organization's members and teams with their roles, read only. */
|
|
257
276
|
members(options?: RequestOptions): Promise<MembersResponse>;
|
|
@@ -309,8 +328,6 @@ export declare class CarImageClient {
|
|
|
309
328
|
createPackExport(packId: string, input?: PackExportInput, options?: RequestOptions): Promise<PackExportResponse>;
|
|
310
329
|
/** GET /api/v1/packs/{id}/exports/{export_id} — free; progress and, once ready, a signed link per ZIP part (7 days). */
|
|
311
330
|
getPackExport(packId: string, exportId: string, options?: RequestOptions): Promise<PackExportResponse>;
|
|
312
|
-
/** POST /api/v1/billing/checkout — hosted Stripe Checkout URL (scope billing:write). */
|
|
313
|
-
createCheckout(credits: number, options?: RequestOptions): Promise<CheckoutResponse>;
|
|
314
331
|
/**
|
|
315
332
|
* POST /api/v1/billing/checkout with a plan — hosted Stripe Checkout for Pro or
|
|
316
333
|
* Business (scope billing:write), or an in-place switch for an account already
|
|
@@ -320,13 +337,18 @@ export declare class CarImageClient {
|
|
|
320
337
|
createPlanCheckout(plan: "pro" | "business", interval?: PlanInterval, options?: RequestOptions): Promise<PlanCheckoutResponse>;
|
|
321
338
|
/** POST /api/v1/billing/portal — Stripe Customer Portal URL (scope billing:write). */
|
|
322
339
|
billingPortal(options?: RequestOptions): Promise<PortalResponse>;
|
|
323
|
-
/**
|
|
340
|
+
/** The public pricing document: plans, their vehicle images, Image Packs and the live 3D cost. Credits are not sold. */
|
|
324
341
|
pricing(options?: RequestOptions): Promise<PricingResponse>;
|
|
325
342
|
/** Product help. Queries are recorded privately; send no secrets or customer email text. */
|
|
326
343
|
searchHelp(query: string, options?: RequestOptions & {
|
|
327
344
|
reportGap?: boolean;
|
|
328
345
|
}): Promise<HelpResponse>;
|
|
329
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* A plan's purchase link, without charging or switching the account's
|
|
348
|
+
* plan. Credits are no longer sold (2026-10-25): a plan includes them every
|
|
349
|
+
* month, and an Image Pack (`quotePack`, `/pricing#packs`) buys a set of
|
|
350
|
+
* images to keep.
|
|
351
|
+
*/
|
|
330
352
|
createCheckoutLink(input: CheckoutLinkInput, options?: RequestOptions): Promise<BillingLinkResponse>;
|
|
331
353
|
/** Private Stripe portal for billing-scoped owner keys; signed-in dashboard for connected apps. */
|
|
332
354
|
getBillingLink(options?: RequestOptions): Promise<BillingLinkResponse>;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEhM,OAAO,KAAK,EACV,wBAAwB,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EACtI,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EACtG,MAAM,YAAY,CAAC;AAGpB,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,k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ED
|
@@ -15,6 +15,20 @@ function intHeader(headers, name) {
|
|
|
15
15
|
const value = Number(raw);
|
|
16
16
|
return Number.isFinite(value) ? value : null;
|
|
17
17
|
}
|
|
18
|
+
/** A usage header's count: a number, or null for `unlimited`. */
|
|
19
|
+
function allowanceHeader(headers, name) {
|
|
20
|
+
const raw = headers.get(name);
|
|
21
|
+
return raw === null || raw.trim() === "unlimited" ? null : intHeader(headers, name);
|
|
22
|
+
}
|
|
23
|
+
/** The vehicle-image meter's headers (`X-Vehicle-Images-*`); null on the credit meter or older servers. */
|
|
24
|
+
export function usageFromHeaders(headers) {
|
|
25
|
+
const used = intHeader(headers, "x-vehicle-images-used");
|
|
26
|
+
if (used === null)
|
|
27
|
+
return null;
|
|
28
|
+
return {
|
|
29
|
+
vehicleImages: { used, included: allowanceHeader(headers, "x-vehicle-images-included") },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
18
32
|
function sourceHeader(headers) {
|
|
19
33
|
const raw = headers.get("x-image-source");
|
|
20
34
|
return raw === "cache" || raw === "generated" ? raw : null;
|
|
@@ -97,7 +111,13 @@ export class CarImageClient {
|
|
|
97
111
|
};
|
|
98
112
|
}
|
|
99
113
|
// ---------------------------------------------------------------- images
|
|
100
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* GET /api/v1/images/car — the bytes plus usage headers. On a plan this
|
|
116
|
+
* counts one vehicle image for the month (vehicle, color and angle; every
|
|
117
|
+
* further delivery of it, at any size or format, is included) and costs no
|
|
118
|
+
* credits (`usage`); legacy credit-meter accounts pay 1 credit
|
|
119
|
+
* (`creditsRemaining`).
|
|
120
|
+
*/
|
|
101
121
|
async getImage(params, options = {}) {
|
|
102
122
|
const response = await this.send(`/api/v1/images/car?${imageSearchParams(params)}`, {
|
|
103
123
|
...options,
|
|
@@ -111,6 +131,7 @@ export class CarImageClient {
|
|
|
111
131
|
height: intHeader(response.headers, "x-image-height"),
|
|
112
132
|
creditsCharged: intHeader(response.headers, "x-credits-charged"),
|
|
113
133
|
creditsRemaining: intHeader(response.headers, "x-credits-remaining"),
|
|
134
|
+
usage: usageFromHeaders(response.headers),
|
|
114
135
|
source: sourceHeader(response.headers),
|
|
115
136
|
etag: response.headers.get("etag"),
|
|
116
137
|
requestId: response.headers.get("x-request-id"),
|
|
@@ -131,13 +152,14 @@ export class CarImageClient {
|
|
|
131
152
|
height: intHeader(response.headers, "x-image-height"),
|
|
132
153
|
creditsCharged: intHeader(response.headers, "x-credits-charged"),
|
|
133
154
|
creditsRemaining: intHeader(response.headers, "x-credits-remaining"),
|
|
155
|
+
usage: usageFromHeaders(response.headers),
|
|
134
156
|
source: sourceHeader(response.headers),
|
|
135
157
|
etag: response.headers.get("etag"),
|
|
136
158
|
requestId: response.headers.get("x-request-id"),
|
|
137
159
|
vehicleId: vehicleIdHeader(response.headers),
|
|
138
160
|
};
|
|
139
161
|
}
|
|
140
|
-
/** GET /api/v1/images/car with `Accept: application/json` — 1 credit
|
|
162
|
+
/** GET /api/v1/images/car with `Accept: application/json` — a signed URL; counts the vehicle image like `getImage` (1 credit on the legacy credit meter). */
|
|
141
163
|
async getImageUrl(params, options = {}) {
|
|
142
164
|
const response = await this.send(`/api/v1/images/car?${imageSearchParams(params)}`, {
|
|
143
165
|
...options,
|
|
@@ -165,7 +187,8 @@ export class CarImageClient {
|
|
|
165
187
|
* through a signed URL or a key), false on 404 `not_cached`; any other
|
|
166
188
|
* answer (an unknown vehicle id, an invalid parameter) throws a
|
|
167
189
|
* CarImageError. A ready image then loads at once through `createImageUrls`
|
|
168
|
-
* or `getImage
|
|
190
|
+
* or `getImage`; a missing one is prepared by them. To check many images,
|
|
191
|
+
* and what they would count against the month, use {@link checkAvailability}.
|
|
169
192
|
*/
|
|
170
193
|
async isImageReady(params, options = {}) {
|
|
171
194
|
const response = await this.rawSend(this.cachedImageUrl(params), {
|
|
@@ -193,9 +216,10 @@ export class CarImageClient {
|
|
|
193
216
|
throw error;
|
|
194
217
|
}
|
|
195
218
|
/**
|
|
196
|
-
* POST /api/v1/image-urls —
|
|
197
|
-
*
|
|
198
|
-
*
|
|
219
|
+
* POST /api/v1/image-urls — up to 50 images per call. On a plan each URL's
|
|
220
|
+
* image counts once for the month when the URL is made (`billing.vehicle_images`),
|
|
221
|
+
* and loads and renewals add nothing; legacy credit-meter accounts pay 1
|
|
222
|
+
* credit per URL at creation and one per renewed window.
|
|
199
223
|
*/
|
|
200
224
|
async createImageUrls(images, options = {}) {
|
|
201
225
|
const list = Array.isArray(images) ? images : [images];
|
|
@@ -231,6 +255,26 @@ export class CarImageClient {
|
|
|
231
255
|
result.idempotent_replayed = true;
|
|
232
256
|
return result;
|
|
233
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* POST /api/v1/images/availability — free and read-only (renders, queues and
|
|
260
|
+
* counts nothing). For up to 200 images (the image objects
|
|
261
|
+
* `createImageUrls` takes), whether each vehicle view is prepared (so every
|
|
262
|
+
* color of it serves now), whether asking for it would count a vehicle
|
|
263
|
+
* image or a new vehicle view this month, and whether the whole list fits
|
|
264
|
+
* the plan's allowances. Check a catalog here before importing it.
|
|
265
|
+
*/
|
|
266
|
+
async checkAvailability(images, options = {}) {
|
|
267
|
+
const list = Array.isArray(images) ? images : [images];
|
|
268
|
+
if (list.length < 1 || list.length > 200) {
|
|
269
|
+
throw new RangeError(`checkAvailability accepts 1 to 200 images (received ${list.length})`);
|
|
270
|
+
}
|
|
271
|
+
const response = await this.send("/api/v1/images/availability", {
|
|
272
|
+
...options,
|
|
273
|
+
method: "POST",
|
|
274
|
+
body: JSON.stringify({ images: list.map(imageRequestBody) }),
|
|
275
|
+
});
|
|
276
|
+
return this.json(response);
|
|
277
|
+
}
|
|
234
278
|
/** GET /api/v1/images/options — public; views, colors, sizes, formats, pricing, catalog. */
|
|
235
279
|
async options(options = {}) {
|
|
236
280
|
const response = await this.send("/api/v1/images/options", { ...options, auth: "optional" });
|
|
@@ -755,7 +799,7 @@ export class CarImageClient {
|
|
|
755
799
|
return this.json(response);
|
|
756
800
|
}
|
|
757
801
|
// -------------------------------------------------------------- account
|
|
758
|
-
/** GET /api/v1/account —
|
|
802
|
+
/** GET /api/v1/account — the plan, this month's vehicle images (`limits_usage`), credits, 30-day usage, key scopes. */
|
|
759
803
|
async account(options = {}) {
|
|
760
804
|
const response = await this.send("/api/v1/account", options);
|
|
761
805
|
return this.json(response);
|
|
@@ -912,17 +956,6 @@ export class CarImageClient {
|
|
|
912
956
|
async getPackExport(packId, exportId, options = {}) {
|
|
913
957
|
return this.json(await this.send(`/api/v1/packs/${requestPath(packId)}/exports/${requestPath(exportId)}`, options));
|
|
914
958
|
}
|
|
915
|
-
/** POST /api/v1/billing/checkout — hosted Stripe Checkout URL (scope billing:write). */
|
|
916
|
-
async createCheckout(credits, options = {}) {
|
|
917
|
-
if (!Number.isInteger(credits) || credits <= 0)
|
|
918
|
-
throw new RangeError("credits must be a positive integer");
|
|
919
|
-
const response = await this.send("/api/v1/billing/checkout", {
|
|
920
|
-
...options,
|
|
921
|
-
method: "POST",
|
|
922
|
-
body: JSON.stringify({ credits }),
|
|
923
|
-
});
|
|
924
|
-
return this.json(response);
|
|
925
|
-
}
|
|
926
959
|
/**
|
|
927
960
|
* POST /api/v1/billing/checkout with a plan — hosted Stripe Checkout for Pro or
|
|
928
961
|
* Business (scope billing:write), or an in-place switch for an account already
|
|
@@ -946,7 +979,7 @@ export class CarImageClient {
|
|
|
946
979
|
const response = await this.send("/api/v1/billing/portal", { ...options, method: "POST", body: "{}" });
|
|
947
980
|
return this.json(response);
|
|
948
981
|
}
|
|
949
|
-
/**
|
|
982
|
+
/** The public pricing document: plans, their vehicle images, Image Packs and the live 3D cost. Credits are not sold. */
|
|
950
983
|
async pricing(options = {}) {
|
|
951
984
|
return this.json(await this.send("/api/v1/pricing", { ...options, auth: "none" }));
|
|
952
985
|
}
|
|
@@ -957,13 +990,16 @@ export class CarImageClient {
|
|
|
957
990
|
const body = { query: query.trim(), ...(options.reportGap ? { report_gap: true } : {}) };
|
|
958
991
|
return this.json(await this.send("/api/v1/help", { ...options, method: "POST", body: JSON.stringify(body) }));
|
|
959
992
|
}
|
|
960
|
-
/**
|
|
993
|
+
/**
|
|
994
|
+
* A plan's purchase link, without charging or switching the account's
|
|
995
|
+
* plan. Credits are no longer sold (2026-10-25): a plan includes them every
|
|
996
|
+
* month, and an Image Pack (`quotePack`, `/pricing#packs`) buys a set of
|
|
997
|
+
* images to keep.
|
|
998
|
+
*/
|
|
961
999
|
async createCheckoutLink(input, options = {}) {
|
|
962
|
-
if (
|
|
963
|
-
throw new RangeError("
|
|
964
|
-
if (input.
|
|
965
|
-
throw new RangeError("Unknown credit pack");
|
|
966
|
-
if (input.plan !== undefined && input.plan !== "pro" && input.plan !== "business")
|
|
1000
|
+
if ("credits" in input)
|
|
1001
|
+
throw new RangeError("Credits are no longer sold; pass a plan (pro or business), or buy an Image Pack");
|
|
1002
|
+
if (input.plan !== "pro" && input.plan !== "business")
|
|
967
1003
|
throw new RangeError("Unknown plan");
|
|
968
1004
|
if (input.interval !== undefined && (!input.plan || !["month", "year"].includes(input.interval)))
|
|
969
1005
|
throw new RangeError("interval requires a plan and must be month or year");
|