@meterapp/car-image-sdk 1.44.0 → 1.46.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 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,353 models, model years 1990–2027, each with a page at [carimage.dev/cars](https://carimage.dev/cars?ref=npm-sdk)), in nine camera views and any paint color; plus stable vehicle ids, free VIN decoding and textured 3D models.
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,610 makes, 42,377 models, model years 1990–2027, each with a page at [carimage.dev/cars](https://carimage.dev/cars?ref=npm-sdk)), in nine 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.
@@ -189,6 +189,24 @@ The SDK sends a generated key (`sdk_<uuid>`) on every `createImageUrls` call, so
189
189
  await client.createImageUrls(images, { ttlSeconds: 604_800, idempotencyKey: `order-${order.id}` });
190
190
  ```
191
191
 
192
+ ## Campaign tracking
193
+
194
+ Tag an image or a URL mint with the campaign or send it is for (`campaign`, one line of at most 100 characters) and how many pieces — emails, mail pieces, impressions — it will appear in (`pieces`, a whole number from 1 to 10,000,000). They are recorded beside the request for your logs, campaign reports and Enterprise usage reporting, and never change the image, its cache entry, its URL or its charge. `getImage` and `getImageUrl` take them with the image; on `createImageUrls` each image may carry its own, and the options' `campaign` and `pieces` are the default for images that name none (`pieces` is per URL):
195
+
196
+ ```ts
197
+ const minted = await client.createImageUrls(
198
+ [{ vehicle: camry, view: "side", pieces: 3200 }, { vehicle: f150, view: "side", pieces: 5100 }],
199
+ { campaign: "Owners mailer Nov", ttlSeconds: 604_800, renew: true }
200
+ );
201
+ minted.pieces; // 8300, the sum over the URLs; each data[] item echoes its own campaign and pieces
202
+
203
+ const { data } = await client.getCampaignUsage({ from: "2026-11-01" }); // account:read, free
204
+ data.by_campaign; // [{ campaign: "Owners mailer Nov", requests, pieces, loads }]
205
+ data.by_vehicle; // [{ vehicle_id, make, model, year, requests, pieces, campaigns }]
206
+ ```
207
+
208
+ `ImageResult.campaign` and `.pieces` read the `X-Campaign` and `X-Pieces` echo. The SDK checks both before sending (`normalizeCampaign`, `normalizePieces`: a blank label reads as none). They are not image query parameters (`IMAGE_QUERY_ALIASES` leaves them out), and `utm_campaign` stays an ignored tracking tag. The hosted `/images/car.png`, `cachedImageUrl` and `carImageUrl` URLs do not take them: tag the signed URLs a send uses.
209
+
192
210
  ## 3D models
193
211
 
194
212
  `create3dModel` builds a textured 3D model — GLB, USDZ, FBX, a PNG thumbnail, `glb_web`, a smaller browser build, and `paint_mask`, a grayscale PNG aligned with the GLB's base-colour texture (white where the texel is paint) for recolouring live in your own viewer — of any catalog vehicle in any paint color, from the same renders the images use. It costs 100 credits at creation whether the model is cached, in progress or new, and nothing for a vehicle and color your account already owns (`billing.already_owned`; a failed model is refunded); polling, downloads and publishing are free. The first model of a vehicle takes 10–20 minutes; further colors take 1–2 minutes.
@@ -309,7 +327,7 @@ await client.openapi(); // the OpenAPI 3.1 docum
309
327
  await client.fetch("/api/v1/account"); // authenticated raw fetch (same-origin only)
310
328
  ```
311
329
 
312
- `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`.
330
+ `createImageUrls(images, options)` takes 1–50 images and `{ ttlSeconds, maxUses, renew, renewDays, idempotencyKey, market, campaign, pieces }`. 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`.
313
331
 
314
332
  ## Error handling
315
333
 
@@ -352,9 +370,9 @@ import {
352
370
 
353
371
  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.
354
372
 
355
- Tools come in two sets. `MCP_TOOLSETS.core` (`DEFAULT_MCP_TOOLSET`, `"core"`) is the twelve 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-one 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 defaults to `all` at `https://carimage.dev/api/mcp` and takes `?toolset=core` for the core set. The stdio server defaults to `core` and takes `car-image mcp --toolset all` for the full set. `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. Tool descriptions explain individual operations.
373
+ Tools come in two sets. `MCP_TOOLSETS.core` (`DEFAULT_MCP_TOOLSET`, `"core"`) is the twelve 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_image_availability`, `get_account`, `request_feature`, `report_issue`, `upvote_feedback`, `submit_review`. `MCP_TOOLSETS.all` (forty-one in total) adds `MCP_DOCUMENTED_EXTRAS`, the twenty-two more with `?toolset=all` that the reference documents, for image reports, make logos, 3D models, image options, the API reference, pricing, help and billing links: `report_image`, `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 defaults to `all` at `https://carimage.dev/api/mcp` and takes `?toolset=core` for the core set. The stdio server defaults to `core` and takes `car-image mcp --toolset all` for the full set. `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. Tool descriptions explain individual operations.
356
374
 
357
- `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.
375
+ `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), `get_car_image` and each `create_car_image_urls` entry take the campaign tracking labels `campaign` and `pieces` (`create_car_image_urls` also beside `images`, as the default), 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.
358
376
 
359
377
  The one-line summary above a result leads both the text block and the structured content (`jsonToolResult` puts it first, as `summary`, since some hosts hand a model only the structured content). It comes from the same helpers on both servers, built from the payload they share: `accountSummary` (the balance, the plan and its vehicle cap, and "ask the human" under `LOW_BALANCE_CREDITS`), `resolveSummary` (the vehicle, the call that renders it by id, and a question for the human first when the confidence is low or the year is not the one asked for), `searchSummary` (which keeps an empty search from reading as a missing vehicle), `imageUrlsSummary` (the charge and until when the URLs serve, a replay included), `vinSummary` and `model3dSummary`. So does the step under an error: `nextStepFor(status)` for every tool, and `vinNextStepFor(status)` for `decode_vin`, which sends a refused or unknown VIN back to the human (re-check it, above all the maker code, or send a partial VIN with `*` and a year) instead of to the catalog.
360
378
 
@@ -369,7 +387,9 @@ MIT © Meter
369
387
 
370
388
  ## Product help and billing links
371
389
 
372
- 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
390
+ 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|report-image|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
391
+
392
+ Image reports (free): when a picture is the wrong car, generation, angle or paint, is poorly drawn, or a vehicle is missing from the catalog, file one tracked report that starts the fix. SDK: `client.reportImage({ requestId, category: 'identity', reason, externalRef })` (or `assetId`, or a vehicle with `view` and `color`; `{ type: 'missing_vehicle', make, model, year }` for a missing vehicle) and `client.getImageReport(id)`. MCP: `report_image` (with `?toolset=all`). CLI: `car-image feedback report-image --request-id <id> --category identity`, `car-image feedback report-image --type missing_vehicle --make … --model … --year …`, `car-image feedback report-image show <id>`. REST: `POST /api/v1/images/reports`, `GET /api/v1/images/reports/{id}`. A repeat on the same image folds into the open report (`created: false`, same `id`); open reports from 2 accounts take an image out of service while it is redrawn. Keep the `id`: `image.issue_reported`, `image.issue_resolved` and `vehicle.available` webhooks carry it as `report_id` with your `external_ref`, to your account only. `url` is the report's page, private to your account. Guide: https://carimage.dev/docs/feedback?ref=npm-sdk#image-reports
373
393
 
374
394
  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.
375
395
 
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, PackUnit } from "./packs.js";
3
- import { type AccountResponse, type MembersResponse, type BuildingResponse, type PlanCheckoutResponse, type PlanInterval, type CreateImageUrlsOptions, type CreateImageUrlsResponse, type AvailabilityCheckResponse, type ImageAvailabilityParams, type ImageAvailabilityResponse, 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, type Market, type MarketOption } from "./types.js";
3
+ import { type AccountResponse, type CampaignUsageParams, type CampaignUsageResponse, type MembersResponse, type BuildingResponse, type PlanCheckoutResponse, type PlanInterval, type CreateImageUrlsOptions, type CreateImageUrlsResponse, type AvailabilityCheckResponse, type ImageAvailabilityParams, type ImageAvailabilityResponse, 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 ImageReportInput, type ImageReportResponse, type FetchLike, type HealthResponse, type ImageParams, type TaggedImageParams, 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, type Market, type MarketOption } 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. */
@@ -92,13 +92,14 @@ export declare class CarImageClient {
92
92
  * counts one vehicle image for the month (vehicle, color and angle; every
93
93
  * further delivery of it, at any size or format, is included) and costs no
94
94
  * credits (`usage`); legacy credit-meter accounts pay 1 credit
95
- * (`creditsRemaining`).
95
+ * (`creditsRemaining`). `campaign` and `pieces` tag the request for
96
+ * campaign tracking ({@link CampaignTags}) and never change the image.
96
97
  */
97
- getImage(params: ImageParams, options?: RequestOptions): Promise<ImageResult>;
98
+ getImage(params: TaggedImageParams, options?: RequestOptions): Promise<ImageResult>;
98
99
  /** GET /api/v1/images/logo — 1 credit. Third-party trademarks; no license granted. */
99
100
  getMakeLogo(params: MakeLogoParams, options?: RequestOptions): Promise<ImageResult>;
100
101
  /** 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). */
101
- getImageUrl(params: ImageParams, options?: RequestOptions): Promise<ImageUrlResponse>;
102
+ getImageUrl(params: TaggedImageParams, options?: RequestOptions): Promise<ImageUrlResponse>;
102
103
  /**
103
104
  * The keyless `mode=cached` URL of an image: free, and it never renders.
104
105
  * Without credentials it loads only a public preview, a render the /cars
@@ -124,8 +125,13 @@ export declare class CarImageClient {
124
125
  * image counts once for the month when the URL is made (`billing.vehicle_images`),
125
126
  * and loads and renewals add nothing; legacy credit-meter accounts pay 1
126
127
  * credit per URL at creation and one per renewed window.
128
+ *
129
+ * Campaign tracking: `campaign` and `pieces` on an image are that URL's
130
+ * own; in `options` they are the default for every image that names none.
131
+ * Each `data[]` item echoes its labels, and the top-level `pieces` is the
132
+ * sum over the URLs. They never change an image or the charge.
127
133
  */
128
- createImageUrls(images: ImageParams | ImageParams[], options?: CreateImageUrlsOptions & RequestOptions): Promise<CreateImageUrlsResponse>;
134
+ createImageUrls(images: TaggedImageParams | TaggedImageParams[], options?: CreateImageUrlsOptions & RequestOptions): Promise<CreateImageUrlsResponse>;
129
135
  /** GET /api/v1/images/availability — cached/prepared views, which of them are verified, quality and wait estimates; never renders or bills. */
130
136
  getImageAvailability(params: ImageAvailabilityParams, options?: RequestOptions): Promise<ImageAvailabilityResponse>;
131
137
  /**
@@ -231,8 +237,19 @@ export declare class CarImageClient {
231
237
  limit?: number;
232
238
  year?: number;
233
239
  } & RequestOptions): Promise<VehicleSearchResponse>;
234
- /** POST /api/v1/feedback — free; rate a delivered image by request id or by vehicle (make, model and year, or a vehicle id). */
235
- feedback(input: FeedbackInput, options?: RequestOptions): Promise<FeedbackResponse>;
240
+ /**
241
+ * POST /api/v1/images/reports — free; file a tracked report that starts the
242
+ * fix. `wrong_image` (category `identity`, `camera` or `paint`) and
243
+ * `poor_quality` name a stored image by `assetId`, by the `requestId` that
244
+ * delivered it, or by vehicle with `view` and `color`; `missing_vehicle`
245
+ * names `make`, `model` and `year` only. A repeat from the same account on
246
+ * the same image (or vehicle) folds into the open report: `created: false`
247
+ * and the same `id`. Keep `data.id`: webhooks carry it as `report_id` with
248
+ * your `externalRef`. `data.url` is the report's page, private to your account.
249
+ */
250
+ reportImage(input: ImageReportInput, options?: RequestOptions): Promise<ImageReportResponse>;
251
+ /** GET /api/v1/images/reports/{id} — one of your image reports with its status now; another account's is a 404. */
252
+ getImageReport(id: string, options?: RequestOptions): Promise<ImageReportResponse>;
236
253
  /** GET /api/v1/requests — public board of vehicle and feature requests; `viewer.voted` is filled in when a key is sent. */
237
254
  listRequests(params?: ListRequestsParams, options?: RequestOptions): Promise<RequestListResponse>;
238
255
  /**
@@ -290,6 +307,13 @@ export declare class CarImageClient {
290
307
  shareReferral(source: ReferralSource, detail?: string, options?: RequestOptions): Promise<ReferralResponse>;
291
308
  /** GET /api/v1/account — the plan, this month's vehicle images (`limits_usage`), credits, 30-day usage, key scopes. */
292
309
  account(options?: RequestOptions): Promise<AccountResponse>;
310
+ /**
311
+ * GET /api/v1/account/campaigns — campaign tracking over `[from, to)`
312
+ * (default: this UTC month so far): totals, pieces and requests by campaign
313
+ * with the delivery-URL loads logged under each, and pieces by vehicle with
314
+ * the campaigns that used it. Needs `account:read`; free.
315
+ */
316
+ getCampaignUsage(params?: CampaignUsageParams, options?: RequestOptions): Promise<CampaignUsageResponse>;
293
317
  /** GET /api/v1/account/members — the organization's members and teams with their roles, read only. */
294
318
  members(options?: RequestOptions): Promise<MembersResponse>;
295
319
  /** GET /api/v1/webhooks — free; the account's webhook endpoints and which events it receives. */
@@ -354,7 +378,7 @@ export declare class CarImageClient {
354
378
  * on a Stripe plan, which can immediately invoice a proration. Prefer
355
379
  * createCheckoutLink for a link-only flow with browser confirmation.
356
380
  */
357
- createPlanCheckout(plan: "pro" | "business", interval?: PlanInterval, options?: RequestOptions): Promise<PlanCheckoutResponse>;
381
+ createPlanCheckout(plan: "starter" | "pro" | "business", interval?: PlanInterval, options?: RequestOptions): Promise<PlanCheckoutResponse>;
358
382
  /** POST /api/v1/billing/portal — Stripe Customer Portal URL (scope billing:write). */
359
383
  billingPortal(options?: RequestOptions): Promise<PortalResponse>;
360
384
  /** The public pricing document: plans, their vehicle images, Image Packs and the live 3D cost. Credits are not sold. */
@@ -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,EAAE,QAAQ,EAChH,MAAM,YAAY,CAAC;AAGpB,OAAO,EAQL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,UAAU,EACf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AC,CAQxE;IAID,OAAO,CAAC,GAAG;IAKX,OAAO,CAAC,UAAU;IAQlB,sFAAsF;YACxE,kBAAkB;YAelB,IAAI;IAIlB,OAAO,CAAC,SAAS;IAWjB,gEAAgE;YAClD,IAAI;IAkBlB,8EAA8E;YAChE,OAAO;CAmEtB"}
package/dist/client.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { CarImageError } from "./errors.js";
2
- import { imageRequestBody, imageSearchParams, makeLogoSearchParams, isColor, normalizeMarket, normalizeYear, vehicleRequestBody } from "./params.js";
2
+ import { IMAGE_REPORT_CATEGORIES, IMAGE_REPORT_EXTERNAL_REF_MAX_LENGTH, IMAGE_REPORT_REASON_MAX_LENGTH, IMAGE_REPORT_TYPES } from "./types.js";
3
+ import { campaignTags, imageRequestBody, imageSearchParams, makeLogoSearchParams, isColor, normalizeMarket, normalizeYear, vehicleRequestBody } from "./params.js";
3
4
  import { RETRYABLE_STATUSES, backoffDelayMs, retryDelayMs } from "./retry.js";
4
5
  import { COLORS, DEFAULT_BASE_URL, MAX_CHECK_VEHICLES, MAX_CHECK_VIEWS_VEHICLES, MODEL_3D_FILE_KINDS, REFERRAL_SOURCES, VEHICLE_ID_PATTERN, } from "./types.js";
5
6
  import { SDK_VERSION } from "./version.js";
@@ -44,11 +45,110 @@ function appearanceHeader(headers) {
44
45
  const market = members.map((member) => /^market=([A-Za-z]{2})$/.exec(member)?.[1]).find((value) => value !== undefined);
45
46
  return { market: market ? market.toUpperCase() : null, scope };
46
47
  }
48
+ /** `X-Image-Verified`, a UTC day, or null. */
49
+ function verifiedHeader(headers) {
50
+ const raw = headers.get("x-image-verified");
51
+ return raw !== null && /^\d{4}-\d{2}-\d{2}$/.test(raw) ? raw : null;
52
+ }
53
+ /** `X-Campaign`, percent-encoded UTF-8; null when absent or undecodable. */
54
+ function campaignHeader(headers) {
55
+ const raw = headers.get("x-campaign");
56
+ if (raw === null || raw === "")
57
+ return null;
58
+ try {
59
+ return decodeURIComponent(raw);
60
+ }
61
+ catch {
62
+ return null;
63
+ }
64
+ }
65
+ /** Query string for GET /api/v1/images/car: the image's parameters, then its campaign tracking labels. */
66
+ function taggedImageSearch(params) {
67
+ const search = imageSearchParams(params);
68
+ const tags = campaignTags(params);
69
+ if (tags.campaign !== undefined)
70
+ search.set("campaign", tags.campaign);
71
+ if (tags.pieces !== undefined)
72
+ search.set("pieces", String(tags.pieces));
73
+ return search;
74
+ }
75
+ /** A `getCampaignUsage` bound: a Date as an ISO timestamp, a string as given. */
76
+ function usageBound(value, name) {
77
+ if (value === undefined)
78
+ return undefined;
79
+ if (value instanceof Date) {
80
+ if (Number.isNaN(value.getTime()))
81
+ throw new RangeError(`${name} is an invalid Date`);
82
+ return value.toISOString();
83
+ }
84
+ if (typeof value !== "string" || !value.trim())
85
+ throw new TypeError(`${name} must be a date such as 2026-11-01, an ISO 8601 timestamp or a Date`);
86
+ return value.trim();
87
+ }
47
88
  function vehicleIdHeader(headers) {
48
89
  const raw = headers.get("x-vehicle-id");
49
90
  return raw !== null && VEHICLE_ID_PATTERN.test(raw) ? raw : null;
50
91
  }
51
92
  /** Validates and URL-encodes a request id for use in a path. */
93
+ /** The JSON body of POST /api/v1/images/reports, checked the way the server reads it so a mistake fails before the call. */
94
+ function imageReportBody(input) {
95
+ if (!input || typeof input !== "object")
96
+ throw new TypeError("reportImage requires an input object");
97
+ const body = {};
98
+ if (input.type !== undefined) {
99
+ if (!IMAGE_REPORT_TYPES.includes(input.type))
100
+ throw new TypeError(`type must be one of ${IMAGE_REPORT_TYPES.join(", ")}`);
101
+ body.type = input.type;
102
+ }
103
+ const reason = input.reason?.trim();
104
+ if (reason) {
105
+ if (reason.length > IMAGE_REPORT_REASON_MAX_LENGTH)
106
+ throw new TypeError(`reason must be at most ${IMAGE_REPORT_REASON_MAX_LENGTH} characters`);
107
+ body.reason = reason;
108
+ }
109
+ const externalRef = input.externalRef?.trim();
110
+ if (externalRef) {
111
+ if (externalRef.length > IMAGE_REPORT_EXTERNAL_REF_MAX_LENGTH)
112
+ throw new TypeError(`externalRef must be at most ${IMAGE_REPORT_EXTERNAL_REF_MAX_LENGTH} characters`);
113
+ body.external_ref = externalRef;
114
+ }
115
+ if (input.type === "missing_vehicle") {
116
+ const make = input.make?.trim();
117
+ const model = input.model?.trim();
118
+ if (!make || !model)
119
+ throw new TypeError("a missing_vehicle report needs make and model");
120
+ body.make = make;
121
+ body.model = model;
122
+ body.year = normalizeYear(input.year);
123
+ return body;
124
+ }
125
+ if (input.category !== undefined) {
126
+ if (!IMAGE_REPORT_CATEGORIES.includes(input.category))
127
+ throw new TypeError(`category must be one of ${IMAGE_REPORT_CATEGORIES.join(", ")}`);
128
+ body.category = input.category;
129
+ }
130
+ if (input.assetId !== undefined) {
131
+ if (!input.assetId.trim())
132
+ throw new TypeError("assetId must not be empty");
133
+ body.asset_id = input.assetId.trim();
134
+ }
135
+ else if (input.requestId !== undefined) {
136
+ if (!input.requestId.trim())
137
+ throw new TypeError("requestId must not be empty");
138
+ body.request_id = input.requestId.trim();
139
+ }
140
+ else if ("vehicle" in input || "make" in input) {
141
+ Object.assign(body, vehicleRequestBody(input));
142
+ if (input.view)
143
+ body.view = input.view;
144
+ if (input.color)
145
+ body.color = String(input.color).trim();
146
+ }
147
+ else {
148
+ throw new TypeError("reportImage requires assetId, requestId, a vehicle id, or make/model/year (or type missing_vehicle)");
149
+ }
150
+ return body;
151
+ }
52
152
  function requestPath(id) {
53
153
  if (typeof id !== "string" || !id.trim())
54
154
  throw new TypeError("request id is required");
@@ -127,10 +227,11 @@ export class CarImageClient {
127
227
  * counts one vehicle image for the month (vehicle, color and angle; every
128
228
  * further delivery of it, at any size or format, is included) and costs no
129
229
  * credits (`usage`); legacy credit-meter accounts pay 1 credit
130
- * (`creditsRemaining`).
230
+ * (`creditsRemaining`). `campaign` and `pieces` tag the request for
231
+ * campaign tracking ({@link CampaignTags}) and never change the image.
131
232
  */
132
233
  async getImage(params, options = {}) {
133
- const response = await this.send(`/api/v1/images/car?${imageSearchParams(params)}`, {
234
+ const response = await this.send(`/api/v1/images/car?${taggedImageSearch(params)}`, {
134
235
  ...options,
135
236
  accept: "image/png, image/webp, image/jpeg, image/*;q=0.9, application/problem+json;q=0.8",
136
237
  });
@@ -148,6 +249,9 @@ export class CarImageClient {
148
249
  requestId: response.headers.get("x-request-id"),
149
250
  vehicleId: vehicleIdHeader(response.headers),
150
251
  appearance: appearanceHeader(response.headers),
252
+ verifiedOn: verifiedHeader(response.headers),
253
+ campaign: campaignHeader(response.headers),
254
+ pieces: intHeader(response.headers, "x-pieces"),
151
255
  };
152
256
  }
153
257
  /** GET /api/v1/images/logo — 1 credit. Third-party trademarks; no license granted. */
@@ -174,7 +278,7 @@ export class CarImageClient {
174
278
  }
175
279
  /** 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). */
176
280
  async getImageUrl(params, options = {}) {
177
- const response = await this.send(`/api/v1/images/car?${imageSearchParams(params)}`, {
281
+ const response = await this.send(`/api/v1/images/car?${taggedImageSearch(params)}`, {
178
282
  ...options,
179
283
  accept: "application/json",
180
284
  });
@@ -235,14 +339,22 @@ export class CarImageClient {
235
339
  * image counts once for the month when the URL is made (`billing.vehicle_images`),
236
340
  * and loads and renewals add nothing; legacy credit-meter accounts pay 1
237
341
  * credit per URL at creation and one per renewed window.
342
+ *
343
+ * Campaign tracking: `campaign` and `pieces` on an image are that URL's
344
+ * own; in `options` they are the default for every image that names none.
345
+ * Each `data[]` item echoes its labels, and the top-level `pieces` is the
346
+ * sum over the URLs. They never change an image or the charge.
238
347
  */
239
348
  async createImageUrls(images, options = {}) {
240
349
  const list = Array.isArray(images) ? images : [images];
241
350
  if (list.length < 1 || list.length > 50) {
242
351
  throw new RangeError(`createImageUrls accepts 1 to 50 images (received ${list.length})`);
243
352
  }
244
- const { ttlSeconds, maxUses, renew, renewDays, idempotencyKey, market, ...request } = options;
245
- const body = { images: list.map(imageRequestBody) };
353
+ const { ttlSeconds, maxUses, renew, renewDays, idempotencyKey, market, campaign, pieces, ...request } = options;
354
+ const body = {
355
+ images: list.map((image) => ({ ...imageRequestBody(image), ...campaignTags(image) })),
356
+ ...campaignTags({ campaign, pieces }),
357
+ };
246
358
  if (market !== undefined)
247
359
  body.market = normalizeMarket(market);
248
360
  if (ttlSeconds !== undefined)
@@ -588,37 +700,31 @@ export class CarImageClient {
588
700
  return this.json(response);
589
701
  }
590
702
  // ------------------------------------------------------------- feedback
591
- /** POST /api/v1/feedback — free; rate a delivered image by request id or by vehicle (make, model and year, or a vehicle id). */
592
- async feedback(input, options = {}) {
593
- if (input.rating === undefined && input.verdict === undefined) {
594
- throw new TypeError("feedback requires a rating (1-5) or a verdict (good|bad)");
595
- }
596
- const body = {};
597
- if ("requestId" in input && input.requestId) {
598
- body.request_id = input.requestId;
599
- }
600
- else if ("make" in input || "vehicle" in input) {
601
- Object.assign(body, imageRequestBody(input));
602
- delete body.width;
603
- delete body.height;
604
- delete body.format;
605
- }
606
- else {
607
- throw new TypeError("feedback requires requestId, a vehicle id, or make/model/year");
608
- }
609
- if (input.rating !== undefined)
610
- body.rating = input.rating;
611
- if (input.verdict !== undefined)
612
- body.verdict = input.verdict;
613
- if (input.reason !== undefined)
614
- body.reason = input.reason;
615
- const response = await this.send("/api/v1/feedback", {
703
+ /**
704
+ * POST /api/v1/images/reports — free; file a tracked report that starts the
705
+ * fix. `wrong_image` (category `identity`, `camera` or `paint`) and
706
+ * `poor_quality` name a stored image by `assetId`, by the `requestId` that
707
+ * delivered it, or by vehicle with `view` and `color`; `missing_vehicle`
708
+ * names `make`, `model` and `year` only. A repeat from the same account on
709
+ * the same image (or vehicle) folds into the open report: `created: false`
710
+ * and the same `id`. Keep `data.id`: webhooks carry it as `report_id` with
711
+ * your `externalRef`. `data.url` is the report's page, private to your account.
712
+ */
713
+ async reportImage(input, options = {}) {
714
+ const response = await this.send("/api/v1/images/reports", {
616
715
  ...options,
617
716
  method: "POST",
618
- body: JSON.stringify(body),
717
+ body: JSON.stringify(imageReportBody(input)),
619
718
  });
620
719
  return this.json(response);
621
720
  }
721
+ /** GET /api/v1/images/reports/{id} — one of your image reports with its status now; another account's is a 404. */
722
+ async getImageReport(id, options = {}) {
723
+ if (typeof id !== "string" || !id.trim())
724
+ throw new TypeError("report id is required");
725
+ const response = await this.send(`/api/v1/images/reports/${encodeURIComponent(id.trim())}`, options);
726
+ return this.json(response);
727
+ }
622
728
  // -------------------------------------------------------------- requests
623
729
  /** GET /api/v1/requests — public board of vehicle and feature requests; `viewer.voted` is filled in when a key is sent. */
624
730
  async listRequests(params = {}, options = {}) {
@@ -863,6 +969,24 @@ export class CarImageClient {
863
969
  const response = await this.send("/api/v1/account", options);
864
970
  return this.json(response);
865
971
  }
972
+ /**
973
+ * GET /api/v1/account/campaigns — campaign tracking over `[from, to)`
974
+ * (default: this UTC month so far): totals, pieces and requests by campaign
975
+ * with the delivery-URL loads logged under each, and pieces by vehicle with
976
+ * the campaigns that used it. Needs `account:read`; free.
977
+ */
978
+ async getCampaignUsage(params = {}, options = {}) {
979
+ const search = new URLSearchParams();
980
+ const from = usageBound(params.from, "from");
981
+ const to = usageBound(params.to, "to");
982
+ if (from !== undefined)
983
+ search.set("from", from);
984
+ if (to !== undefined)
985
+ search.set("to", to);
986
+ const query = search.size ? `?${search}` : "";
987
+ const response = await this.send(`/api/v1/account/campaigns${query}`, options);
988
+ return this.json(response);
989
+ }
866
990
  /** GET /api/v1/account/members — the organization's members and teams with their roles, read only. */
867
991
  async members(options = {}) {
868
992
  const response = await this.send("/api/v1/account/members", options);