diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4cff5b9..f1c1e58 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.2" + ".": "0.5.0" } diff --git a/.stats.yml b/.stats.yml index c5955c5..e87950d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/azure/partnermax-fa73d56cb03e02b0bf904b1336512bcdef94150eb14ecd514ef709214608d69f.yml -openapi_spec_hash: 5b05f6d46fc6d51dcd5b9930a6fc29ba -config_hash: 085d04841ad5a779fb40c5000448d9d9 +configured_endpoints: 27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/azure/partnermax-33c6a68b0b225895b68bd2e9bf19b189b01fa887239b98a5867eb7b1505985ef.yml +openapi_spec_hash: c79381758719d11fc5fb4f1fb1b1d8b2 +config_hash: b71de6785b0e0c91836519dead13f632 diff --git a/CHANGELOG.md b/CHANGELOG.md index b4c3d61..cb7553b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.5.0 (2026-06-29) + +Full Changelog: [v0.4.2...v0.5.0](https://github.com/DealerMax-app/partnermax-node/compare/v0.4.2...v0.5.0) + +### Features + +* regenerate PartnerMAX SDKs for v1.5.13 ([f52c426](https://github.com/DealerMax-app/partnermax-node/commit/f52c4261a25303874f7243c6f2626f1d210f9ee4)) +* regenerate SDK for vehicle contract 1.5.12 ([6393333](https://github.com/DealerMax-app/partnermax-node/commit/6393333117d270671b25bc196ea47c87ec20360b)) + ## 0.4.2 (2026-06-28) Full Changelog: [v0.4.1...v0.4.2](https://github.com/DealerMax-app/partnermax-node/compare/v0.4.1...v0.4.2) diff --git a/api.md b/api.md index dd2a86c..0ed4de5 100644 --- a/api.md +++ b/api.md @@ -26,6 +26,9 @@ Methods: - client.dealers.update(dealerID, { ...params }) -> DealerDetail - client.dealers.list({ ...params }) -> DealerSummariesCursorPage - client.dealers.delete(dealerID) -> void +- client.dealers.activateReference(externalDealerID) -> PartnerDealerResponse +- client.dealers.revokeReference(externalDealerID) -> void +- client.dealers.suspendReference(externalDealerID) -> PartnerDealerResponse ## NltSettings @@ -85,3 +88,16 @@ Methods: - client.dealers.vehicles.images.create(vehicleID, { ...params }) -> VehicleImage - client.dealers.vehicles.images.list(vehicleID, { ...params }) -> VehicleImageList - client.dealers.vehicles.images.delete(imageID, { ...params }) -> void + +### Accessories + +Types: + +- VehicleAccessoriesCatalog +- VehicleAccessoryItem + +Methods: + +- client.dealers.vehicles.accessories.update(vehicleID, { ...params }) -> VehicleAccessoriesCatalog +- client.dealers.vehicles.accessories.refreshCatalog(vehicleID, { ...params }) -> VehicleAccessoriesCatalog +- client.dealers.vehicles.accessories.retrieveCatalog(vehicleID, { ...params }) -> VehicleAccessoriesCatalog diff --git a/package.json b/package.json index 9092d7b..7f4d443 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "partnermax", - "version": "0.4.2", + "version": "0.5.0", "description": "The official TypeScript library for the Partnermax API", "author": "Partnermax ", "types": "dist/index.d.ts", diff --git a/src/client.ts b/src/client.ts index 80f8215..988052d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -838,7 +838,7 @@ export class Partnermax { */ keys: API.Keys = new API.Keys(this); /** - * Provision, update, deactivate, and list dealers owned by the calling partner. + * Register, update, deactivate, and list dealer references registered for the calling partner. */ dealers: API.Dealers = new API.Dealers(this); } diff --git a/src/resources/dealers/dealers.ts b/src/resources/dealers/dealers.ts index 0cf67d2..f01dddb 100644 --- a/src/resources/dealers/dealers.ts +++ b/src/resources/dealers/dealers.ts @@ -29,7 +29,7 @@ import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; /** - * Provision, update, deactivate, and list dealers owned by the calling partner. + * Register, update, deactivate, and list dealer references registered for the calling partner. */ export class Dealers extends APIResource { nltSettings: NltSettingsAPI.NltSettings = new NltSettingsAPI.NltSettings(this._client); @@ -37,9 +37,9 @@ export class Dealers extends APIResource { vehicles: VehiclesAPI.Vehicles = new VehiclesAPI.Vehicles(this._client); /** - * Create a partner-owned opaque dealer reference. SDK users call - * `client.dealers.create(...)`; the generated client sends this request to the - * core-owned `/api/partner/dealers` route. + * Register an opaque dealer reference for this partner. SDK users call + * `client.dealers.create(...)`; the generated client sends this request to + * `/api/partner/dealers` on the public PartnerMAX API host. */ create(params: DealerCreateParams, options?: RequestOptions): APIPromise { const { 'Idempotency-Key': idempotencyKey, ...body } = params; @@ -76,7 +76,7 @@ export class Dealers extends APIResource { } /** - * List dealers owned by the calling partner. Cursor-paginated. + * List dealer references registered for the calling partner. Cursor-paginated. */ list( query: DealerListParams | null | undefined = {}, @@ -94,6 +94,36 @@ export class Dealers extends APIResource { headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } + + /** + * Reactivate a non-terminal opaque dealer reference. SDK users can also call + * `PATCH /v1/dealers/{dealer_id}` with `status=active`; this registry endpoint is + * exposed for integrations that manage the `/api/partner` lifecycle directly. + */ + activateReference(externalDealerID: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/api/partner/dealers/${externalDealerID}/activate`, options); + } + + /** + * Terminally revoke an opaque dealer reference. This is equivalent to deleting the + * dealer through `/v1/dealers/{dealer_id}` from the partner's perspective: the + * public status becomes `deleted` and reactivation requires DealerMAX support. + */ + revokeReference(externalDealerID: string, options?: RequestOptions): APIPromise { + return this._client.delete(path`/api/partner/dealers/${externalDealerID}`, { + ...options, + headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), + }); + } + + /** + * Temporarily deactivate an opaque dealer reference. SDK users can also call + * `PATCH /v1/dealers/{dealer_id}` with `status=inactive`; both routes map the + * public status to `inactive`. + */ + suspendReference(externalDealerID: string, options?: RequestOptions): APIPromise { + return this._client.post(path`/api/partner/dealers/${externalDealerID}/suspend`, options); + } } export type DealerSummariesCursorPage = CursorPage; @@ -190,7 +220,7 @@ export interface PartnerDealerResponse { created_at: string; /** - * The partner-owned external dealer id. + * The partner-supplied external dealer id. */ dealer_id: string; @@ -198,7 +228,11 @@ export interface PartnerDealerResponse { public_surfaces_enabled: boolean; - status: 'active' | 'suspended' | 'revoked'; + /** + * Public API status. The backing registry may store internal states such as + * suspended/revoked, but SDK responses expose inactive/deleted. + */ + status: 'active' | 'inactive' | 'deleted'; updated_at: string; @@ -210,14 +244,14 @@ export interface PartnerDealerResponse { export interface DealerCreateParams { /** - * Body param: Partner-owned opaque dealer id. This becomes the dealer_id used by - * vehicle and NLT SDK calls. + * Body param: Partner-supplied opaque dealer id. This becomes the dealer_id used + * by vehicle and NLT SDK calls. */ external_dealer_id: string; /** * Body param: When true, the dealer can immediately receive vehicle/NLT - * operations. When false, create the registry row but keep it suspended until + * operations. When false, create the registry row but keep it inactive until * activated. */ activate?: boolean; @@ -286,7 +320,7 @@ export interface DealerUpdateParams { } export interface DealerListParams extends CursorPageParams { - status?: 'active' | 'inactive' | 'all'; + status?: 'active' | 'inactive' | 'deleted' | 'all'; } Dealers.Nlt = Nlt; diff --git a/src/resources/dealers/nlt/offers.ts b/src/resources/dealers/nlt/offers.ts index 7a89669..7cab083 100644 --- a/src/resources/dealers/nlt/offers.ts +++ b/src/resources/dealers/nlt/offers.ts @@ -312,9 +312,8 @@ export namespace OfferRetrieveResponse { * One network dealer's quote for this offer. * * Sorted by `min_monthly_canon_eur ASC`. In PartnerMAX this list is scoped to the - * calling partner's `partner_dealers` rows and returns the partner-owned - * `external_dealer_id`. Legacy `dlr_` values remain only for compatibility - * callers. + * calling partner's dealer references and returns the partner-supplied external + * dealer id. */ export interface NetworkOffer { dealer_id: string; diff --git a/src/resources/dealers/vehicles/accessories.ts b/src/resources/dealers/vehicles/accessories.ts new file mode 100644 index 0000000..98ec21f --- /dev/null +++ b/src/resources/dealers/vehicles/accessories.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../core/resource'; +import { APIPromise } from '../../../core/api-promise'; +import { RequestOptions } from '../../../internal/request-options'; +import { path } from '../../../internal/utils/path'; + +/** + * Used-vehicle stock management for dealers registered under a partner. Every vehicle request is scoped by dealer_id; the partner uploads each used vehicle by its canonical Motornet UNI code; DealerMAX joins the partner-provided pricing and stock metadata with the catalog master so the resulting listing is immediately indexed by the AI surfaces (MCP server, ChatGPT Custom GPT, NLWeb /ask, and the SEO/JSON-LD layer). + */ +export class Accessories extends APIResource { + /** + * Set Vehicle Accessories + */ + update( + vehicleID: string, + params: AccessoryUpdateParams, + options?: RequestOptions, + ): APIPromise { + const { dealer_id, ...body } = params; + return this._client.put(path`/v1/dealers/${dealer_id}/vehicles/${vehicleID}/accessories`, { + body, + ...options, + }); + } + + /** + * Refresh Vehicle Accessories Catalog + */ + refreshCatalog( + vehicleID: string, + params: AccessoryRefreshCatalogParams, + options?: RequestOptions, + ): APIPromise { + const { dealer_id } = params; + return this._client.post( + path`/v1/dealers/${dealer_id}/vehicles/${vehicleID}/accessories/catalog/refresh`, + options, + ); + } + + /** + * Get Vehicle Accessories Catalog + */ + retrieveCatalog( + vehicleID: string, + params: AccessoryRetrieveCatalogParams, + options?: RequestOptions, + ): APIPromise { + const { dealer_id } = params; + return this._client.get( + path`/v1/dealers/${dealer_id}/vehicles/${vehicleID}/accessories/catalog`, + options, + ); + } +} + +/** + * Per-vehicle accessories catalog plus current selections. + */ +export interface VehicleAccessoriesCatalog { + alloy_wheel_size?: number | null; + + equipment?: Array; + + optionals?: Array; + + packages?: Array; + + series?: Array; +} + +/** + * Single accessory/equipment row available for a used vehicle. + */ +export interface VehicleAccessoryItem { + id: string; + + description: string; + + category?: string | null; + + code?: string | null; + + group?: string | null; + + price_eur?: number | null; + + selected?: boolean; +} + +export interface AccessoryUpdateParams { + /** + * Path param + */ + dealer_id: string; + + /** + * Body param + */ + alloy_wheel_size?: number | null; + + /** + * Body param + */ + equipment_ids?: Array; + + /** + * Body param + */ + optional_ids?: Array; + + /** + * Body param + */ + package_ids?: Array; +} + +export interface AccessoryRefreshCatalogParams { + dealer_id: string; +} + +export interface AccessoryRetrieveCatalogParams { + dealer_id: string; +} + +export declare namespace Accessories { + export { + type VehicleAccessoriesCatalog as VehicleAccessoriesCatalog, + type VehicleAccessoryItem as VehicleAccessoryItem, + type AccessoryUpdateParams as AccessoryUpdateParams, + type AccessoryRefreshCatalogParams as AccessoryRefreshCatalogParams, + type AccessoryRetrieveCatalogParams as AccessoryRetrieveCatalogParams, + }; +} diff --git a/src/resources/dealers/vehicles/images.ts b/src/resources/dealers/vehicles/images.ts index ec6d9b3..3c5d909 100644 --- a/src/resources/dealers/vehicles/images.ts +++ b/src/resources/dealers/vehicles/images.ts @@ -9,7 +9,7 @@ import { multipartFormRequestOptions } from '../../../internal/uploads'; import { path } from '../../../internal/utils/path'; /** - * Used-vehicle stock management for partner-owned dealers. The partner uploads each used vehicle by its canonical Motornet UNI code; DealerMAX joins the partner-provided pricing and stock metadata with the catalog master so the resulting listing is immediately indexed by the AI surfaces (MCP server, ChatGPT Custom GPT, NLWeb /ask, and the SEO/JSON-LD layer). + * Used-vehicle stock management for dealers registered under a partner. Every vehicle request is scoped by dealer_id; the partner uploads each used vehicle by its canonical Motornet UNI code; DealerMAX joins the partner-provided pricing and stock metadata with the catalog master so the resulting listing is immediately indexed by the AI surfaces (MCP server, ChatGPT Custom GPT, NLWeb /ask, and the SEO/JSON-LD layer). */ export class Images extends APIResource { /** diff --git a/src/resources/dealers/vehicles/index.ts b/src/resources/dealers/vehicles/index.ts index 6338dde..76cfbe3 100644 --- a/src/resources/dealers/vehicles/index.ts +++ b/src/resources/dealers/vehicles/index.ts @@ -1,5 +1,13 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { + Accessories, + type VehicleAccessoriesCatalog, + type VehicleAccessoryItem, + type AccessoryUpdateParams, + type AccessoryRefreshCatalogParams, + type AccessoryRetrieveCatalogParams, +} from './accessories'; export { Images, type VehicleImage, diff --git a/src/resources/dealers/vehicles/vehicles.ts b/src/resources/dealers/vehicles/vehicles.ts index a8e848b..2de4817 100644 --- a/src/resources/dealers/vehicles/vehicles.ts +++ b/src/resources/dealers/vehicles/vehicles.ts @@ -1,6 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; +import * as AccessoriesAPI from './accessories'; +import { + Accessories, + AccessoryRefreshCatalogParams, + AccessoryRetrieveCatalogParams, + AccessoryUpdateParams, + VehicleAccessoriesCatalog, + VehicleAccessoryItem, +} from './accessories'; import * as ImagesAPI from './images'; import { ImageCreateParams, @@ -17,10 +26,11 @@ import { RequestOptions } from '../../../internal/request-options'; import { path } from '../../../internal/utils/path'; /** - * Used-vehicle stock management for partner-owned dealers. The partner uploads each used vehicle by its canonical Motornet UNI code; DealerMAX joins the partner-provided pricing and stock metadata with the catalog master so the resulting listing is immediately indexed by the AI surfaces (MCP server, ChatGPT Custom GPT, NLWeb /ask, and the SEO/JSON-LD layer). + * Used-vehicle stock management for dealers registered under a partner. Every vehicle request is scoped by dealer_id; the partner uploads each used vehicle by its canonical Motornet UNI code; DealerMAX joins the partner-provided pricing and stock metadata with the catalog master so the resulting listing is immediately indexed by the AI surfaces (MCP server, ChatGPT Custom GPT, NLWeb /ask, and the SEO/JSON-LD layer). */ export class Vehicles extends APIResource { images: ImagesAPI.Images = new ImagesAPI.Images(this._client); + accessories: AccessoriesAPI.Accessories = new AccessoriesAPI.Accessories(this._client); /** * Provision a new used vehicle in a dealer's stock. @@ -80,7 +90,7 @@ export class Vehicles extends APIResource { } /** - * List vehicles in a dealer's stock owned by the calling partner. + * List vehicles in the resolved dealer's stock for the calling partner. * * Cursor pagination is opaque base64url over the last vehicle UUID. Default sort * is `i.data_inserimento ASC` so freshly provisioned vehicles surface at the tail. @@ -281,9 +291,9 @@ export interface BulkRowOutcome { * consumers display (descriptions, highlights, FAQ, SEO meta). `null` until the * worker has processed the vehicle. * - * Dealer-internal margin and operations data remains outside this SDK surface; - * partners receive only the inventory, commercial, catalogue, media, and - * AI-derived fields needed to publish the vehicle. + * Dealer-entered inventory, commercial, condition, service-history, catalogue, + * media, and AI-derived fields are available through the SDK so partners can keep + * the same stock record DealerMax shows. */ vehicle?: VehicleDetail | null; } @@ -303,9 +313,9 @@ export interface BulkRowOutcome { * consumers display (descriptions, highlights, FAQ, SEO meta). `null` until the * worker has processed the vehicle. * - * Dealer-internal margin and operations data remains outside this SDK surface; - * partners receive only the inventory, commercial, catalogue, media, and - * AI-derived fields needed to publish the vehicle. + * Dealer-entered inventory, commercial, condition, service-history, catalogue, + * media, and AI-derived fields are available through the SDK so partners can keep + * the same stock record DealerMax shows. */ export interface VehicleDetail { certified_km: number; @@ -316,9 +326,9 @@ export interface VehicleDetail { description: string; - extended_warranty_enabled: boolean; + enabled_channels: Array<'rewind' | 'nos'>; - is_for_sale: boolean; + extended_warranty_enabled: boolean; is_visible: boolean; @@ -336,8 +346,6 @@ export interface VehicleDetail { vat_displayed: boolean; - vehicle_damaged: boolean; - vehicle_id: string; /** @@ -347,28 +355,72 @@ export interface VehicleDetail { */ ai_content?: AIContent | null; + ai_short?: string | null; + + ai_tagline?: string | null; + alloy_wheel_size?: number | null; + base_color?: string | null; + brand?: string | null; + co2_emissions_g_km_override?: number | null; + color?: string | null; + cost_price_eur?: number | null; + + cover_image_url?: string | null; + + damage_repaired?: boolean | null; + + deleted_at?: string | null; + + double_keys_available?: boolean; + extended_warranty_months?: number | null; fuel_type?: string | null; + fuel_type_override?: string | null; + + image_count?: number; + /** * Vehicle photos in display order. The first entry is the cover photo * (`position=1` in the dedicated images endpoint). */ image_urls?: Array; + inspection_due_date?: string | null; + + last_inspection_date?: string | null; + + last_inspection_km?: number | null; + + last_service_date?: string | null; + + last_service_km?: number | null; + + last_service_notes?: string | null; + model?: string | null; notes?: string | null; + ownership_transfer_date?: string | null; + + power_kw_override?: number | null; + + previous_owner_count?: number | null; + + property_tax_due_date?: string | null; + registration_month?: number | null; + service_history_available?: boolean; + /** * Flat dictionary of Motornet-backed technical attributes for this * `motornet_code`. Keys stay in Italian domain vocabulary; native units are @@ -378,7 +430,17 @@ export interface VehicleDetail { trim?: string | null; + trim_alias?: string | null; + + vehicle_damaged?: boolean | null; + vin?: string | null; + + wltp_consumption_combined_l_100km?: number | null; + + wltp_consumption_extraurban_l_100km?: number | null; + + wltp_consumption_urban_l_100km?: number | null; } /** @@ -407,10 +469,12 @@ export interface VehicleSummary { dealer_id: string; - is_for_sale: boolean; + enabled_channels: Array<'rewind' | 'nos'>; is_visible: boolean; + last_modified_at: string; + motornet_code: string; plate: string; @@ -419,17 +483,39 @@ export interface VehicleSummary { sale_price_eur: number; + vat_displayed: boolean; + vehicle_id: string; + ai_short?: string | null; + + ai_tagline?: string | null; + brand?: string | null; color?: string | null; + cost_price_eur?: number | null; + + cover_image_url?: string | null; + + damage_repaired?: boolean | null; + + deleted_at?: string | null; + fuel_type?: string | null; + image_count?: number; + model?: string | null; + registration_month?: number | null; + trim?: string | null; + + trim_alias?: string | null; + + vehicle_damaged?: boolean | null; } export interface VehicleCreateParams { @@ -442,8 +528,8 @@ export interface VehicleCreateParams { * Body param: Motornet UNI code identifying the exact vehicle configuration. Must * exist in the DealerMAX auto/VCOM catalogue at submission time; otherwise the * call returns 422 `motornet_code_not_in_catalogue`. Partners may send a code from - * their own Motornet agreement or use the paid control-plane targa/VIN resolver - * before creating the vehicle. + * their own Motornet agreement or use the paid targa/VIN resolver on + * api.dealermax.app before creating the vehicle. */ motornet_code: string; @@ -460,27 +546,53 @@ export interface VehicleCreateParams { registration_year: number; /** - * Body param: Public sale price in EUR. Surfaced on MCP / Custom GPT / NLWeb and - * on the dealer's site JSON-LD `Offer.price`. + * Body param */ - sale_price_eur: number; + alloy_wheel_size?: number | null; /** * Body param */ - alloy_wheel_size?: number | null; + base_color?: string | null; + + /** + * Body param + */ + co2_emissions_g_km_override?: number | null; /** * Body param */ color?: string | null; + /** + * Body param + */ + cost_price_eur?: number | null; + + /** + * Body param: Tri-state repaired-damage declaration: true=yes, false=no, + * null=unknown. + */ + damage_repaired?: boolean | null; + /** * Body param: Partner-supplied long description. Surfaced on the dealer site * detail page. */ description?: string; + /** + * Body param + */ + double_keys_available?: boolean; + + /** + * Body param: Publication channels enabled for this vehicle. Default is + * ['rewind']. + */ + enabled_channels?: Array<'rewind' | 'nos'>; + /** * Body param */ @@ -492,9 +604,14 @@ export interface VehicleCreateParams { extended_warranty_months?: number | null; /** - * Body param: When false the vehicle remains in stock but is not offered for sale. + * Body param */ - is_for_sale?: boolean; + fuel_type_override?: string | null; + + /** + * Body param + */ + inspection_due_date?: string | null; /** * Body param: Soft-publish flag. When false the row exists in stock but is @@ -502,16 +619,77 @@ export interface VehicleCreateParams { */ is_visible?: boolean; + /** + * Body param + */ + last_inspection_date?: string | null; + + /** + * Body param + */ + last_inspection_km?: number | null; + + /** + * Body param + */ + last_service_date?: string | null; + + /** + * Body param + */ + last_service_km?: number | null; + + /** + * Body param + */ + last_service_notes?: string | null; + /** * Body param: Free-form short notes for partner-facing vehicle detail views. */ notes?: string | null; + /** + * Body param + */ + ownership_transfer_date?: string | null; + + /** + * Body param + */ + power_kw_override?: number | null; + + /** + * Body param + */ + previous_owner_count?: number | null; + + /** + * Body param + */ + property_tax_due_date?: string | null; + /** * Body param: Month of registration (1–12). */ registration_month?: number | null; + /** + * Body param: Public REWIND sale price in EUR. Required when enabled_channels + * contains 'rewind'; optional/0 for NOS-only vehicles. + */ + sale_price_eur?: number | null; + + /** + * Body param: Dealer-declared certified service-history availability. + */ + service_history_available?: boolean; + + /** + * Body param + */ + trim_alias?: string | null; + /** * Body param: If true the public price is displayed VAT-exposed (B2B); otherwise * VAT-inclusive (B2C). @@ -519,9 +697,9 @@ export interface VehicleCreateParams { vat_displayed?: boolean; /** - * Body param + * Body param: Tri-state damage declaration: true=yes, false=no, null=unknown. */ - vehicle_damaged?: boolean; + vehicle_damaged?: boolean | null; /** * Body param: ISO 3779 vehicle identification number. Optional but strongly @@ -529,6 +707,21 @@ export interface VehicleCreateParams { */ vin?: string | null; + /** + * Body param + */ + wltp_consumption_combined_l_100km?: number | null; + + /** + * Body param + */ + wltp_consumption_extraurban_l_100km?: number | null; + + /** + * Body param + */ + wltp_consumption_urban_l_100km?: number | null; + /** * Header param */ @@ -560,21 +753,51 @@ export interface VehicleUpdateParams { */ alloy_wheel_size?: number | null; + /** + * Body param + */ + base_color?: string | null; + /** * Body param */ certified_km?: number | null; + /** + * Body param + */ + co2_emissions_g_km_override?: number | null; + /** * Body param */ color?: string | null; + /** + * Body param + */ + cost_price_eur?: number | null; + + /** + * Body param + */ + damage_repaired?: boolean | null; + /** * Body param */ description?: string | null; + /** + * Body param + */ + double_keys_available?: boolean | null; + + /** + * Body param + */ + enabled_channels?: Array<'rewind' | 'nos'> | null; + /** * Body param */ @@ -588,28 +811,93 @@ export interface VehicleUpdateParams { /** * Body param */ - is_for_sale?: boolean | null; + fuel_type_override?: string | null; + + /** + * Body param + */ + inspection_due_date?: string | null; /** * Body param */ is_visible?: boolean | null; + /** + * Body param + */ + last_inspection_date?: string | null; + + /** + * Body param + */ + last_inspection_km?: number | null; + + /** + * Body param + */ + last_service_date?: string | null; + + /** + * Body param + */ + last_service_km?: number | null; + + /** + * Body param + */ + last_service_notes?: string | null; + /** * Body param */ notes?: string | null; + /** + * Body param + */ + ownership_transfer_date?: string | null; + + /** + * Body param + */ + power_kw_override?: number | null; + + /** + * Body param + */ + previous_owner_count?: number | null; + + /** + * Body param + */ + property_tax_due_date?: string | null; + /** * Body param */ registration_month?: number | null; + /** + * Body param + */ + registration_year?: number | null; + /** * Body param */ sale_price_eur?: number | null; + /** + * Body param + */ + service_history_available?: boolean | null; + + /** + * Body param + */ + trim_alias?: string | null; + /** * Body param */ @@ -620,6 +908,26 @@ export interface VehicleUpdateParams { */ vehicle_damaged?: boolean | null; + /** + * Body param + */ + vin?: string | null; + + /** + * Body param + */ + wltp_consumption_combined_l_100km?: number | null; + + /** + * Body param + */ + wltp_consumption_extraurban_l_100km?: number | null; + + /** + * Body param + */ + wltp_consumption_urban_l_100km?: number | null; + /** * Header param */ @@ -628,15 +936,15 @@ export interface VehicleUpdateParams { export interface VehicleListParams extends CursorPageParams { /** - * If true, soft-deleted rows (`venduto_il` populated) are also returned. Default - * false — listings hide soft-deleted vehicles. + * Filter vehicles enabled on one publication channel: rewind or nos. */ - include_deleted?: boolean; + enabled_channel?: 'rewind' | 'nos' | null; /** - * Filter on the sale flag. + * If true, soft-deleted rows (`venduto_il` populated) are also returned. Default + * false — listings hide soft-deleted vehicles. */ - is_for_sale?: boolean | null; + include_deleted?: boolean; /** * Filter on the visibility flag. @@ -671,8 +979,8 @@ export namespace VehicleBulkParams { * server-side from DealerMAX's licensed Motornet-backed catalogue — the partner * never types them. * - * Fields immutable after creation: `motornet_code`, `plate`, `vin`. Other fields - * may be updated via PATCH. + * Fields immutable after creation: `motornet_code`, `plate`. The VIN and other + * dealer-entered fields may be corrected via PATCH. */ export interface Vehicle { /** @@ -684,8 +992,8 @@ export namespace VehicleBulkParams { * Motornet UNI code identifying the exact vehicle configuration. Must exist in the * DealerMAX auto/VCOM catalogue at submission time; otherwise the call returns 422 * `motornet_code_not_in_catalogue`. Partners may send a code from their own - * Motornet agreement or use the paid control-plane targa/VIN resolver before - * creating the vehicle. + * Motornet agreement or use the paid targa/VIN resolver on api.dealermax.app + * before creating the vehicle. */ motornet_code: string; @@ -701,29 +1009,40 @@ export namespace VehicleBulkParams { */ registration_year: number; - /** - * Public sale price in EUR. Surfaced on MCP / Custom GPT / NLWeb and on the - * dealer's site JSON-LD `Offer.price`. - */ - sale_price_eur: number; - alloy_wheel_size?: number | null; + base_color?: string | null; + + co2_emissions_g_km_override?: number | null; + color?: string | null; + cost_price_eur?: number | null; + + /** + * Tri-state repaired-damage declaration: true=yes, false=no, null=unknown. + */ + damage_repaired?: boolean | null; + /** * Partner-supplied long description. Surfaced on the dealer site detail page. */ description?: string; + double_keys_available?: boolean; + + /** + * Publication channels enabled for this vehicle. Default is ['rewind']. + */ + enabled_channels?: Array<'rewind' | 'nos'>; + extended_warranty_enabled?: boolean; extended_warranty_months?: number | null; - /** - * When false the vehicle remains in stock but is not offered for sale. - */ - is_for_sale?: boolean; + fuel_type_override?: string | null; + + inspection_due_date?: string | null; /** * Soft-publish flag. When false the row exists in stock but is excluded from @@ -731,32 +1050,73 @@ export namespace VehicleBulkParams { */ is_visible?: boolean; + last_inspection_date?: string | null; + + last_inspection_km?: number | null; + + last_service_date?: string | null; + + last_service_km?: number | null; + + last_service_notes?: string | null; + /** * Free-form short notes for partner-facing vehicle detail views. */ notes?: string | null; + ownership_transfer_date?: string | null; + + power_kw_override?: number | null; + + previous_owner_count?: number | null; + + property_tax_due_date?: string | null; + /** * Month of registration (1–12). */ registration_month?: number | null; + /** + * Public REWIND sale price in EUR. Required when enabled_channels contains + * 'rewind'; optional/0 for NOS-only vehicles. + */ + sale_price_eur?: number | null; + + /** + * Dealer-declared certified service-history availability. + */ + service_history_available?: boolean; + + trim_alias?: string | null; + /** * If true the public price is displayed VAT-exposed (B2B); otherwise VAT-inclusive * (B2C). */ vat_displayed?: boolean; - vehicle_damaged?: boolean; + /** + * Tri-state damage declaration: true=yes, false=no, null=unknown. + */ + vehicle_damaged?: boolean | null; /** * ISO 3779 vehicle identification number. Optional but strongly recommended. */ vin?: string | null; + + wltp_consumption_combined_l_100km?: number | null; + + wltp_consumption_extraurban_l_100km?: number | null; + + wltp_consumption_urban_l_100km?: number | null; } } Vehicles.Images = Images; +Vehicles.Accessories = Accessories; export declare namespace Vehicles { export { @@ -783,4 +1143,13 @@ export declare namespace Vehicles { type ImageListParams as ImageListParams, type ImageDeleteParams as ImageDeleteParams, }; + + export { + Accessories as Accessories, + type VehicleAccessoriesCatalog as VehicleAccessoriesCatalog, + type VehicleAccessoryItem as VehicleAccessoryItem, + type AccessoryUpdateParams as AccessoryUpdateParams, + type AccessoryRefreshCatalogParams as AccessoryRefreshCatalogParams, + type AccessoryRetrieveCatalogParams as AccessoryRetrieveCatalogParams, + }; } diff --git a/src/version.ts b/src/version.ts index 7b8959a..1f5d158 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.4.2'; // x-release-please-version +export const VERSION = '0.5.0'; // x-release-please-version diff --git a/tests/api-resources/dealers/dealers.test.ts b/tests/api-resources/dealers/dealers.test.ts index f8b1b86..6199d8e 100644 --- a/tests/api-resources/dealers/dealers.test.ts +++ b/tests/api-resources/dealers/dealers.test.ts @@ -92,4 +92,40 @@ describe('resource dealers', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // Mock server tests are disabled + test.skip('activateReference', async () => { + const responsePromise = client.dealers.activateReference('x'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('revokeReference', async () => { + const responsePromise = client.dealers.revokeReference('x'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('suspendReference', async () => { + const responsePromise = client.dealers.suspendReference('x'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); }); diff --git a/tests/api-resources/dealers/vehicles/accessories.test.ts b/tests/api-resources/dealers/vehicles/accessories.test.ts new file mode 100644 index 0000000..6068592 --- /dev/null +++ b/tests/api-resources/dealers/vehicles/accessories.test.ts @@ -0,0 +1,77 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Partnermax from 'partnermax'; + +const client = new Partnermax({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource accessories', () => { + // Mock server tests are disabled + test.skip('update: only required params', async () => { + const responsePromise = client.dealers.vehicles.accessories.update('vehicle_id', { + dealer_id: 'dealer_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('update: required and optional params', async () => { + const response = await client.dealers.vehicles.accessories.update('vehicle_id', { + dealer_id: 'dealer_id', + alloy_wheel_size: 13, + equipment_ids: ['string'], + optional_ids: ['string'], + package_ids: ['string'], + }); + }); + + // Mock server tests are disabled + test.skip('refreshCatalog: only required params', async () => { + const responsePromise = client.dealers.vehicles.accessories.refreshCatalog('vehicle_id', { + dealer_id: 'dealer_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('refreshCatalog: required and optional params', async () => { + const response = await client.dealers.vehicles.accessories.refreshCatalog('vehicle_id', { + dealer_id: 'dealer_id', + }); + }); + + // Mock server tests are disabled + test.skip('retrieveCatalog: only required params', async () => { + const responsePromise = client.dealers.vehicles.accessories.retrieveCatalog('vehicle_id', { + dealer_id: 'dealer_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieveCatalog: required and optional params', async () => { + const response = await client.dealers.vehicles.accessories.retrieveCatalog('vehicle_id', { + dealer_id: 'dealer_id', + }); + }); +}); diff --git a/tests/api-resources/dealers/vehicles/vehicles.test.ts b/tests/api-resources/dealers/vehicles/vehicles.test.ts index 4d49d48..cf2439d 100644 --- a/tests/api-resources/dealers/vehicles/vehicles.test.ts +++ b/tests/api-resources/dealers/vehicles/vehicles.test.ts @@ -15,7 +15,6 @@ describe('resource vehicles', () => { motornet_code: 'xxxx', plate: '26F1KLZN', registration_year: 1960, - sale_price_eur: 100, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -33,19 +32,40 @@ describe('resource vehicles', () => { motornet_code: 'xxxx', plate: '26F1KLZN', registration_year: 1960, - sale_price_eur: 100, alloy_wheel_size: 13, + base_color: 'base_color', + co2_emissions_g_km_override: 0, color: 'color', + cost_price_eur: 0, + damage_repaired: true, description: 'description', + double_keys_available: true, + enabled_channels: ['rewind'], extended_warranty_enabled: true, extended_warranty_months: 1, - is_for_sale: true, + fuel_type_override: 'fuel_type_override', + inspection_due_date: '2019-12-27', is_visible: true, + last_inspection_date: '2019-12-27', + last_inspection_km: 0, + last_service_date: '2019-12-27', + last_service_km: 0, + last_service_notes: 'last_service_notes', notes: 'notes', + ownership_transfer_date: '2019-12-27', + power_kw_override: 1, + previous_owner_count: 0, + property_tax_due_date: '2019-12-27', registration_month: 1, + sale_price_eur: 0, + service_history_available: true, + trim_alias: 'trim_alias', vat_displayed: true, vehicle_damaged: true, vin: 'PTNLCJPPNYGP316PJ', + wltp_consumption_combined_l_100km: 0, + wltp_consumption_extraurban_l_100km: 0, + wltp_consumption_urban_l_100km: 0, 'Idempotency-Key': 'Idempotency-Key', }); }); @@ -87,18 +107,41 @@ describe('resource vehicles', () => { const response = await client.dealers.vehicles.update('vehicle_id', { dealer_id: 'dealer_id', alloy_wheel_size: 13, + base_color: 'base_color', certified_km: 0, + co2_emissions_g_km_override: 0, color: 'color', + cost_price_eur: 0, + damage_repaired: true, description: 'description', + double_keys_available: true, + enabled_channels: ['rewind'], extended_warranty_enabled: true, extended_warranty_months: 1, - is_for_sale: true, + fuel_type_override: 'fuel_type_override', + inspection_due_date: '2019-12-27', is_visible: true, + last_inspection_date: '2019-12-27', + last_inspection_km: 0, + last_service_date: '2019-12-27', + last_service_km: 0, + last_service_notes: 'last_service_notes', notes: 'notes', + ownership_transfer_date: '2019-12-27', + power_kw_override: 1, + previous_owner_count: 0, + property_tax_due_date: '2019-12-27', registration_month: 1, - sale_price_eur: 100, + registration_year: 1960, + sale_price_eur: 0, + service_history_available: true, + trim_alias: 'trim_alias', vat_displayed: true, vehicle_damaged: true, + vin: 'PTNLCJPPNYGP316PJ', + wltp_consumption_combined_l_100km: 0, + wltp_consumption_extraurban_l_100km: 0, + wltp_consumption_urban_l_100km: 0, 'Idempotency-Key': 'Idempotency-Key', }); }); @@ -123,8 +166,8 @@ describe('resource vehicles', () => { 'dealer_id', { cursor: 'cursor', + enabled_channel: 'rewind', include_deleted: true, - is_for_sale: true, is_visible: true, limit: 1, }, @@ -159,7 +202,6 @@ describe('resource vehicles', () => { motornet_code: 'xxxx', plate: '26F1KLZN', registration_year: 1960, - sale_price_eur: 100, }, ], }); @@ -181,19 +223,40 @@ describe('resource vehicles', () => { motornet_code: 'xxxx', plate: '26F1KLZN', registration_year: 1960, - sale_price_eur: 100, alloy_wheel_size: 13, + base_color: 'base_color', + co2_emissions_g_km_override: 0, color: 'color', + cost_price_eur: 0, + damage_repaired: true, description: 'description', + double_keys_available: true, + enabled_channels: ['rewind'], extended_warranty_enabled: true, extended_warranty_months: 1, - is_for_sale: true, + fuel_type_override: 'fuel_type_override', + inspection_due_date: '2019-12-27', is_visible: true, + last_inspection_date: '2019-12-27', + last_inspection_km: 0, + last_service_date: '2019-12-27', + last_service_km: 0, + last_service_notes: 'last_service_notes', notes: 'notes', + ownership_transfer_date: '2019-12-27', + power_kw_override: 1, + previous_owner_count: 0, + property_tax_due_date: '2019-12-27', registration_month: 1, + sale_price_eur: 0, + service_history_available: true, + trim_alias: 'trim_alias', vat_displayed: true, vehicle_damaged: true, vin: 'PTNLCJPPNYGP316PJ', + wltp_consumption_combined_l_100km: 0, + wltp_consumption_extraurban_l_100km: 0, + wltp_consumption_urban_l_100km: 0, }, ], 'Idempotency-Key': 'Idempotency-Key',