Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.4.1"
".": "0.4.2"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/azure/partnermax-0c2a3d56340127842c8ff928074b12d81705700b06b497d6965138738b28b656.yml
openapi_spec_hash: 515afa9ff78787ae666a539d452d5d35
config_hash: a9bb2c41f2e0cabac79eda1df90a1445
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 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)

### Bug Fixes

* expose dealer create in SDK ([8f9a868](https://github.com/DealerMax-app/partnermax-node/commit/8f9a8688809ecfc588e3edf97225042133cd7e79))

## 0.4.1 (2026-06-28)

Full Changelog: [v0.4.0...v0.4.1](https://github.com/DealerMax-app/partnermax-node/compare/v0.4.0...v0.4.1)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ Types:

- <code><a href="./src/resources/dealers/dealers.ts">DealerDetail</a></code>
- <code><a href="./src/resources/dealers/dealers.ts">DealerSummary</a></code>
- <code><a href="./src/resources/dealers/dealers.ts">PartnerDealerResponse</a></code>

Methods:

- <code title="post /api/partner/dealers">client.dealers.<a href="./src/resources/dealers/dealers.ts">create</a>({ ...params }) -> PartnerDealerResponse</code>
- <code title="get /v1/dealers/{dealer_id}">client.dealers.<a href="./src/resources/dealers/dealers.ts">retrieve</a>(dealerID) -> DealerDetail</code>
- <code title="patch /v1/dealers/{dealer_id}">client.dealers.<a href="./src/resources/dealers/dealers.ts">update</a>(dealerID, { ...params }) -> DealerDetail</code>
- <code title="get /v1/dealers">client.dealers.<a href="./src/resources/dealers/dealers.ts">list</a>({ ...params }) -> DealerSummariesCursorPage</code>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "partnermax",
"version": "0.4.1",
"version": "0.4.2",
"description": "The official TypeScript library for the Partnermax API",
"author": "Partnermax <support@dealermax.app>",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ import * as API from './resources/index';
import { APIPromise } from './core/api-promise';
import { KeyIssueParams, KeyIssueResponse, KeyListResponse, Keys } from './resources/keys';
import {
DealerCreateParams,
DealerDetail,
DealerListParams,
DealerSummariesCursorPage,
DealerSummary,
DealerUpdateParams,
Dealers,
PartnerDealerResponse,
} from './resources/dealers/dealers';
import { type Fetch } from './internal/builtin-types';
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
Expand Down Expand Up @@ -861,7 +863,9 @@ export declare namespace Partnermax {
Dealers as Dealers,
type DealerDetail as DealerDetail,
type DealerSummary as DealerSummary,
type PartnerDealerResponse as PartnerDealerResponse,
type DealerSummariesCursorPage as DealerSummariesCursorPage,
type DealerCreateParams as DealerCreateParams,
type DealerUpdateParams as DealerUpdateParams,
type DealerListParams as DealerListParams,
};
Expand Down
70 changes: 70 additions & 0 deletions src/resources/dealers/dealers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ export class Dealers extends APIResource {
nlt: NltAPI.Nlt = new NltAPI.Nlt(this._client);
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.
*/
create(params: DealerCreateParams, options?: RequestOptions): APIPromise<PartnerDealerResponse> {
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
return this._client.post('/api/partner/dealers', {
body,
...options,
headers: buildHeaders([
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
options?.headers,
]),
});
}

/**
* Fetch a dealer's full detail. ACL-protected.
*/
Expand Down Expand Up @@ -165,6 +182,57 @@ export interface DealerSummary {
last_active_at?: string | null;
}

/**
* Partner dealer registry response. Use dealer_id as the path parameter for
* vehicle and NLT SDK calls.
*/
export interface PartnerDealerResponse {
created_at: string;

/**
* The partner-owned external dealer id.
*/
dealer_id: string;

partner_id: string;

public_surfaces_enabled: boolean;

status: 'active' | 'suspended' | 'revoked';

updated_at: string;

/**
* True only when this request inserted the registry row.
*/
created?: boolean;
}

export interface DealerCreateParams {
/**
* Body param: Partner-owned 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
* activated.
*/
activate?: boolean;

/**
* Body param: Optional scalar partner-side correlation metadata.
*/
metadata?: { [key: string]: string | number | boolean | null };

/**
* Header param: Recommended stable key per logical dealer provisioning operation.
*/
'Idempotency-Key'?: string;
}

export interface DealerUpdateParams {
/**
* Body param
Expand Down Expand Up @@ -228,7 +296,9 @@ export declare namespace Dealers {
export {
type DealerDetail as DealerDetail,
type DealerSummary as DealerSummary,
type PartnerDealerResponse as PartnerDealerResponse,
type DealerSummariesCursorPage as DealerSummariesCursorPage,
type DealerCreateParams as DealerCreateParams,
type DealerUpdateParams as DealerUpdateParams,
type DealerListParams as DealerListParams,
};
Expand Down
2 changes: 2 additions & 0 deletions src/resources/dealers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export {
Dealers,
type DealerDetail,
type DealerSummary,
type PartnerDealerResponse,
type DealerCreateParams,
type DealerUpdateParams,
type DealerListParams,
type DealerSummariesCursorPage,
Expand Down
2 changes: 2 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export {
Dealers,
type DealerDetail,
type DealerSummary,
type PartnerDealerResponse,
type DealerCreateParams,
type DealerUpdateParams,
type DealerListParams,
type DealerSummariesCursorPage,
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.4.1'; // x-release-please-version
export const VERSION = '0.4.2'; // x-release-please-version
22 changes: 22 additions & 0 deletions tests/api-resources/dealers/dealers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@ const client = new Partnermax({
});

describe('resource dealers', () => {
// Mock server tests are disabled
test.skip('create: only required params', async () => {
const responsePromise = client.dealers.create({ external_dealer_id: '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('create: required and optional params', async () => {
const response = await client.dealers.create({
external_dealer_id: 'x',
activate: true,
metadata: { foo: 'string' },
'Idempotency-Key': 'Idempotency-Key',
});
});

// Mock server tests are disabled
test.skip('retrieve', async () => {
const responsePromise = client.dealers.retrieve('dealer_id');
Expand Down
Loading