partnermax 0.2.0 → 0.2.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +60 -47
  2. package/LICENSE +201 -201
  3. package/README.md +370 -370
  4. package/api-promise.js +1 -1
  5. package/client.js +1 -1
  6. package/client.mjs +1 -1
  7. package/core/api-promise.js +1 -1
  8. package/core/api-promise.mjs +1 -1
  9. package/error.js +1 -1
  10. package/package.json +9 -15
  11. package/resource.js +1 -1
  12. package/resources/dealers/dealers.js +1 -1
  13. package/resources/dealers/nlt/nlt.js +1 -1
  14. package/resources/dealers/nlt.js +1 -1
  15. package/resources/dealers/vehicles/vehicles.js +1 -1
  16. package/resources/dealers/vehicles.js +1 -1
  17. package/resources/dealers.js +1 -1
  18. package/resources.js +1 -1
  19. package/src/api-promise.ts +2 -2
  20. package/src/client.ts +841 -841
  21. package/src/core/README.md +3 -3
  22. package/src/core/api-promise.ts +92 -92
  23. package/src/core/error.ts +130 -130
  24. package/src/core/resource.ts +11 -11
  25. package/src/core/uploads.ts +2 -2
  26. package/src/error.ts +2 -2
  27. package/src/index.ts +22 -22
  28. package/src/internal/README.md +3 -3
  29. package/src/internal/builtin-types.ts +93 -93
  30. package/src/internal/detect-platform.ts +196 -196
  31. package/src/internal/errors.ts +33 -33
  32. package/src/internal/headers.ts +97 -97
  33. package/src/internal/parse.ts +56 -56
  34. package/src/internal/request-options.ts +91 -91
  35. package/src/internal/shim-types.ts +26 -26
  36. package/src/internal/shims.ts +107 -107
  37. package/src/internal/to-file.ts +154 -154
  38. package/src/internal/types.ts +93 -93
  39. package/src/internal/uploads.ts +187 -187
  40. package/src/internal/utils/base64.ts +40 -40
  41. package/src/internal/utils/bytes.ts +32 -32
  42. package/src/internal/utils/env.ts +18 -18
  43. package/src/internal/utils/log.ts +128 -128
  44. package/src/internal/utils/path.ts +88 -88
  45. package/src/internal/utils/query.ts +23 -23
  46. package/src/internal/utils/sleep.ts +3 -3
  47. package/src/internal/utils/uuid.ts +17 -17
  48. package/src/internal/utils/values.ts +105 -105
  49. package/src/internal/utils.ts +9 -9
  50. package/src/lib/.keep +4 -4
  51. package/src/resource.ts +2 -2
  52. package/src/resources/dealers/dealers.ts +348 -348
  53. package/src/resources/dealers/index.ts +28 -28
  54. package/src/resources/dealers/nlt/index.ts +11 -11
  55. package/src/resources/dealers/nlt/nlt.ts +29 -29
  56. package/src/resources/dealers/nlt/offers.ts +427 -427
  57. package/src/resources/dealers/nlt-settings.ts +269 -269
  58. package/src/resources/dealers/nlt.ts +3 -3
  59. package/src/resources/dealers/vehicles/images.ts +153 -153
  60. package/src/resources/dealers/vehicles/index.ts +25 -25
  61. package/src/resources/dealers/vehicles/vehicles.ts +796 -796
  62. package/src/resources/dealers/vehicles.ts +3 -3
  63. package/src/resources/dealers.ts +3 -3
  64. package/src/resources/index.ts +12 -12
  65. package/src/resources/keys.ts +128 -128
  66. package/src/resources.ts +1 -1
  67. package/src/tsconfig.json +11 -11
  68. package/src/uploads.ts +2 -2
  69. package/src/version.ts +1 -1
  70. package/uploads.js +1 -1
  71. package/version.d.mts +1 -1
  72. package/version.d.ts +1 -1
  73. package/version.js +1 -1
  74. package/version.mjs +1 -1
@@ -1,348 +1,348 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../core/resource';
4
- import * as NltSettingsAPI from './nlt-settings';
5
- import { DownPaymentTiers, NltSettingUpdateParams, NltSettings } from './nlt-settings';
6
- import * as NltAPI from './nlt/nlt';
7
- import { Nlt } from './nlt/nlt';
8
- import * as VehiclesAPI from './vehicles/vehicles';
9
- import {
10
- AIContent,
11
- BulkCreateVehiclesResponse,
12
- BulkRowOutcome,
13
- VehicleBulkParams,
14
- VehicleCreateParams,
15
- VehicleDeleteParams,
16
- VehicleDetail,
17
- VehicleList,
18
- VehicleListParams,
19
- VehicleRetrieveParams,
20
- VehicleSummary,
21
- VehicleUpdateParams,
22
- Vehicles,
23
- } from './vehicles/vehicles';
24
- import { APIPromise } from '../../core/api-promise';
25
- import { buildHeaders } from '../../internal/headers';
26
- import { RequestOptions } from '../../internal/request-options';
27
- import { path } from '../../internal/utils/path';
28
-
29
- /**
30
- * Provision, update, deactivate, and list dealers owned by the calling partner.
31
- */
32
- export class Dealers extends APIResource {
33
- nltSettings: NltSettingsAPI.NltSettings = new NltSettingsAPI.NltSettings(this._client);
34
- nlt: NltAPI.Nlt = new NltAPI.Nlt(this._client);
35
- vehicles: VehiclesAPI.Vehicles = new VehiclesAPI.Vehicles(this._client);
36
-
37
- /**
38
- * Provision a new dealer as child of the calling partner.
39
- */
40
- create(params: DealerCreateParams, options?: RequestOptions): APIPromise<DealerDetail> {
41
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
42
- return this._client.post('/v1/dealers', {
43
- body,
44
- ...options,
45
- headers: buildHeaders([
46
- { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
47
- options?.headers,
48
- ]),
49
- });
50
- }
51
-
52
- /**
53
- * Fetch a dealer's full detail. ACL-protected.
54
- */
55
- retrieve(dealerID: string, options?: RequestOptions): APIPromise<DealerDetail> {
56
- return this._client.get(path`/v1/dealers/${dealerID}`, options);
57
- }
58
-
59
- /**
60
- * Update or toggle status. Inactive dealers drop from AI surfaces within 5 min.
61
- */
62
- update(dealerID: string, params: DealerUpdateParams, options?: RequestOptions): APIPromise<DealerDetail> {
63
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
64
- return this._client.patch(path`/v1/dealers/${dealerID}`, {
65
- body,
66
- ...options,
67
- headers: buildHeaders([
68
- { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
69
- options?.headers,
70
- ]),
71
- });
72
- }
73
-
74
- /**
75
- * List dealers owned by the calling partner. Cursor-paginated.
76
- */
77
- list(
78
- query: DealerListParams | null | undefined = {},
79
- options?: RequestOptions,
80
- ): APIPromise<DealerListResponse> {
81
- return this._client.get('/v1/dealers', { query, ...options });
82
- }
83
-
84
- /**
85
- * Soft-delete. Audit trail retained; reactivation requires DealerMAX support.
86
- */
87
- delete(dealerID: string, options?: RequestOptions): APIPromise<void> {
88
- return this._client.delete(path`/v1/dealers/${dealerID}`, {
89
- ...options,
90
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
91
- });
92
- }
93
- }
94
-
95
- /**
96
- * Full dealer payload used by single-resource and write endpoints.
97
- */
98
- export interface DealerDetail {
99
- address: string;
100
-
101
- business_name: string;
102
-
103
- city: string;
104
-
105
- contact_email: string;
106
-
107
- created_at: string;
108
-
109
- dealer_id: string;
110
-
111
- nlt_enabled: boolean;
112
-
113
- partner_id: string;
114
-
115
- postal_code: string;
116
-
117
- primary_domain: string;
118
-
119
- province_code: string;
120
-
121
- status: 'active' | 'inactive' | 'deleted';
122
-
123
- vat_number: string;
124
-
125
- contact_phone?: string | null;
126
-
127
- /**
128
- * Per-surface AI indexing state. All values may be `false` immediately after
129
- * provisioning; reconciliation by `azurenet-engine` flips them within five
130
- * minutes.
131
- */
132
- indexed_in_surfaces?: DealerDetail.IndexedInSurfaces;
133
-
134
- last_active_at?: string | null;
135
-
136
- metadata?: { [key: string]: string };
137
-
138
- nlt_settings?: { [key: string]: unknown } | null;
139
- }
140
-
141
- export namespace DealerDetail {
142
- /**
143
- * Per-surface AI indexing state. All values may be `false` immediately after
144
- * provisioning; reconciliation by `azurenet-engine` flips them within five
145
- * minutes.
146
- */
147
- export interface IndexedInSurfaces {
148
- custom_gpt?: boolean;
149
-
150
- llms_txt?: boolean;
151
-
152
- mcp?: boolean;
153
-
154
- nlweb?: boolean;
155
- }
156
- }
157
-
158
- /**
159
- * Compact dealer payload used by list endpoints.
160
- */
161
- export interface DealerSummary {
162
- business_name: string;
163
-
164
- created_at: string;
165
-
166
- dealer_id: string;
167
-
168
- nlt_enabled: boolean;
169
-
170
- primary_domain: string;
171
-
172
- province_code: string;
173
-
174
- status: 'active' | 'inactive' | 'deleted';
175
-
176
- last_active_at?: string | null;
177
- }
178
-
179
- /**
180
- * Response envelope for `GET /v1/dealers`.
181
- */
182
- export interface DealerListResponse {
183
- data: Array<DealerSummary>;
184
-
185
- has_more: boolean;
186
-
187
- next_cursor?: string | null;
188
- }
189
-
190
- export interface DealerCreateParams {
191
- /**
192
- * Body param
193
- */
194
- address: string;
195
-
196
- /**
197
- * Body param
198
- */
199
- business_name: string;
200
-
201
- /**
202
- * Body param
203
- */
204
- city: string;
205
-
206
- /**
207
- * Body param
208
- */
209
- contact_email: string;
210
-
211
- /**
212
- * Body param
213
- */
214
- contact_phone: string;
215
-
216
- /**
217
- * Body param
218
- */
219
- postal_code: string;
220
-
221
- /**
222
- * Body param
223
- */
224
- primary_domain: string;
225
-
226
- /**
227
- * Body param
228
- */
229
- province_code: string;
230
-
231
- /**
232
- * Body param
233
- */
234
- vat_number: string;
235
-
236
- /**
237
- * Body param
238
- */
239
- activate?: boolean;
240
-
241
- /**
242
- * Body param
243
- */
244
- metadata?: { [key: string]: string };
245
-
246
- /**
247
- * Header param
248
- */
249
- 'Idempotency-Key'?: string;
250
- }
251
-
252
- export interface DealerUpdateParams {
253
- /**
254
- * Body param
255
- */
256
- address?: string | null;
257
-
258
- /**
259
- * Body param
260
- */
261
- business_name?: string | null;
262
-
263
- /**
264
- * Body param
265
- */
266
- city?: string | null;
267
-
268
- /**
269
- * Body param
270
- */
271
- contact_email?: string | null;
272
-
273
- /**
274
- * Body param
275
- */
276
- contact_phone?: string | null;
277
-
278
- /**
279
- * Body param
280
- */
281
- metadata?: { [key: string]: string } | null;
282
-
283
- /**
284
- * Body param
285
- */
286
- postal_code?: string | null;
287
-
288
- /**
289
- * Body param
290
- */
291
- province_code?: string | null;
292
-
293
- /**
294
- * Body param
295
- */
296
- status?: 'active' | 'inactive' | null;
297
-
298
- /**
299
- * Header param
300
- */
301
- 'Idempotency-Key'?: string;
302
- }
303
-
304
- export interface DealerListParams {
305
- cursor?: string | null;
306
-
307
- limit?: number;
308
-
309
- status?: 'active' | 'inactive' | 'all';
310
- }
311
-
312
- Dealers.Nlt = Nlt;
313
- Dealers.Vehicles = Vehicles;
314
-
315
- export declare namespace Dealers {
316
- export {
317
- type DealerDetail as DealerDetail,
318
- type DealerSummary as DealerSummary,
319
- type DealerListResponse as DealerListResponse,
320
- type DealerCreateParams as DealerCreateParams,
321
- type DealerUpdateParams as DealerUpdateParams,
322
- type DealerListParams as DealerListParams,
323
- };
324
-
325
- export {
326
- type NltSettings as NltSettings,
327
- type DownPaymentTiers as DownPaymentTiers,
328
- type NltSettingUpdateParams as NltSettingUpdateParams,
329
- };
330
-
331
- export { Nlt as Nlt };
332
-
333
- export {
334
- Vehicles as Vehicles,
335
- type AIContent as AIContent,
336
- type BulkCreateVehiclesResponse as BulkCreateVehiclesResponse,
337
- type BulkRowOutcome as BulkRowOutcome,
338
- type VehicleDetail as VehicleDetail,
339
- type VehicleList as VehicleList,
340
- type VehicleSummary as VehicleSummary,
341
- type VehicleCreateParams as VehicleCreateParams,
342
- type VehicleRetrieveParams as VehicleRetrieveParams,
343
- type VehicleUpdateParams as VehicleUpdateParams,
344
- type VehicleListParams as VehicleListParams,
345
- type VehicleDeleteParams as VehicleDeleteParams,
346
- type VehicleBulkParams as VehicleBulkParams,
347
- };
348
- }
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as NltSettingsAPI from './nlt-settings';
5
+ import { DownPaymentTiers, NltSettingUpdateParams, NltSettings } from './nlt-settings';
6
+ import * as NltAPI from './nlt/nlt';
7
+ import { Nlt } from './nlt/nlt';
8
+ import * as VehiclesAPI from './vehicles/vehicles';
9
+ import {
10
+ AIContent,
11
+ BulkCreateVehiclesResponse,
12
+ BulkRowOutcome,
13
+ VehicleBulkParams,
14
+ VehicleCreateParams,
15
+ VehicleDeleteParams,
16
+ VehicleDetail,
17
+ VehicleList,
18
+ VehicleListParams,
19
+ VehicleRetrieveParams,
20
+ VehicleSummary,
21
+ VehicleUpdateParams,
22
+ Vehicles,
23
+ } from './vehicles/vehicles';
24
+ import { APIPromise } from '../../core/api-promise';
25
+ import { buildHeaders } from '../../internal/headers';
26
+ import { RequestOptions } from '../../internal/request-options';
27
+ import { path } from '../../internal/utils/path';
28
+
29
+ /**
30
+ * Provision, update, deactivate, and list dealers owned by the calling partner.
31
+ */
32
+ export class Dealers extends APIResource {
33
+ nltSettings: NltSettingsAPI.NltSettings = new NltSettingsAPI.NltSettings(this._client);
34
+ nlt: NltAPI.Nlt = new NltAPI.Nlt(this._client);
35
+ vehicles: VehiclesAPI.Vehicles = new VehiclesAPI.Vehicles(this._client);
36
+
37
+ /**
38
+ * Provision a new dealer as child of the calling partner.
39
+ */
40
+ create(params: DealerCreateParams, options?: RequestOptions): APIPromise<DealerDetail> {
41
+ const { 'Idempotency-Key': idempotencyKey, ...body } = params;
42
+ return this._client.post('/v1/dealers', {
43
+ body,
44
+ ...options,
45
+ headers: buildHeaders([
46
+ { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
47
+ options?.headers,
48
+ ]),
49
+ });
50
+ }
51
+
52
+ /**
53
+ * Fetch a dealer's full detail. ACL-protected.
54
+ */
55
+ retrieve(dealerID: string, options?: RequestOptions): APIPromise<DealerDetail> {
56
+ return this._client.get(path`/v1/dealers/${dealerID}`, options);
57
+ }
58
+
59
+ /**
60
+ * Update or toggle status. Inactive dealers drop from AI surfaces within 5 min.
61
+ */
62
+ update(dealerID: string, params: DealerUpdateParams, options?: RequestOptions): APIPromise<DealerDetail> {
63
+ const { 'Idempotency-Key': idempotencyKey, ...body } = params;
64
+ return this._client.patch(path`/v1/dealers/${dealerID}`, {
65
+ body,
66
+ ...options,
67
+ headers: buildHeaders([
68
+ { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
69
+ options?.headers,
70
+ ]),
71
+ });
72
+ }
73
+
74
+ /**
75
+ * List dealers owned by the calling partner. Cursor-paginated.
76
+ */
77
+ list(
78
+ query: DealerListParams | null | undefined = {},
79
+ options?: RequestOptions,
80
+ ): APIPromise<DealerListResponse> {
81
+ return this._client.get('/v1/dealers', { query, ...options });
82
+ }
83
+
84
+ /**
85
+ * Soft-delete. Audit trail retained; reactivation requires DealerMAX support.
86
+ */
87
+ delete(dealerID: string, options?: RequestOptions): APIPromise<void> {
88
+ return this._client.delete(path`/v1/dealers/${dealerID}`, {
89
+ ...options,
90
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
91
+ });
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Full dealer payload used by single-resource and write endpoints.
97
+ */
98
+ export interface DealerDetail {
99
+ address: string;
100
+
101
+ business_name: string;
102
+
103
+ city: string;
104
+
105
+ contact_email: string;
106
+
107
+ created_at: string;
108
+
109
+ dealer_id: string;
110
+
111
+ nlt_enabled: boolean;
112
+
113
+ partner_id: string;
114
+
115
+ postal_code: string;
116
+
117
+ primary_domain: string;
118
+
119
+ province_code: string;
120
+
121
+ status: 'active' | 'inactive' | 'deleted';
122
+
123
+ vat_number: string;
124
+
125
+ contact_phone?: string | null;
126
+
127
+ /**
128
+ * Per-surface AI indexing state. All values may be `false` immediately after
129
+ * provisioning; reconciliation by `azurenet-engine` flips them within five
130
+ * minutes.
131
+ */
132
+ indexed_in_surfaces?: DealerDetail.IndexedInSurfaces;
133
+
134
+ last_active_at?: string | null;
135
+
136
+ metadata?: { [key: string]: string };
137
+
138
+ nlt_settings?: { [key: string]: unknown } | null;
139
+ }
140
+
141
+ export namespace DealerDetail {
142
+ /**
143
+ * Per-surface AI indexing state. All values may be `false` immediately after
144
+ * provisioning; reconciliation by `azurenet-engine` flips them within five
145
+ * minutes.
146
+ */
147
+ export interface IndexedInSurfaces {
148
+ custom_gpt?: boolean;
149
+
150
+ llms_txt?: boolean;
151
+
152
+ mcp?: boolean;
153
+
154
+ nlweb?: boolean;
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Compact dealer payload used by list endpoints.
160
+ */
161
+ export interface DealerSummary {
162
+ business_name: string;
163
+
164
+ created_at: string;
165
+
166
+ dealer_id: string;
167
+
168
+ nlt_enabled: boolean;
169
+
170
+ primary_domain: string;
171
+
172
+ province_code: string;
173
+
174
+ status: 'active' | 'inactive' | 'deleted';
175
+
176
+ last_active_at?: string | null;
177
+ }
178
+
179
+ /**
180
+ * Response envelope for `GET /v1/dealers`.
181
+ */
182
+ export interface DealerListResponse {
183
+ data: Array<DealerSummary>;
184
+
185
+ has_more: boolean;
186
+
187
+ next_cursor?: string | null;
188
+ }
189
+
190
+ export interface DealerCreateParams {
191
+ /**
192
+ * Body param
193
+ */
194
+ address: string;
195
+
196
+ /**
197
+ * Body param
198
+ */
199
+ business_name: string;
200
+
201
+ /**
202
+ * Body param
203
+ */
204
+ city: string;
205
+
206
+ /**
207
+ * Body param
208
+ */
209
+ contact_email: string;
210
+
211
+ /**
212
+ * Body param
213
+ */
214
+ contact_phone: string;
215
+
216
+ /**
217
+ * Body param
218
+ */
219
+ postal_code: string;
220
+
221
+ /**
222
+ * Body param
223
+ */
224
+ primary_domain: string;
225
+
226
+ /**
227
+ * Body param
228
+ */
229
+ province_code: string;
230
+
231
+ /**
232
+ * Body param
233
+ */
234
+ vat_number: string;
235
+
236
+ /**
237
+ * Body param
238
+ */
239
+ activate?: boolean;
240
+
241
+ /**
242
+ * Body param
243
+ */
244
+ metadata?: { [key: string]: string };
245
+
246
+ /**
247
+ * Header param
248
+ */
249
+ 'Idempotency-Key'?: string;
250
+ }
251
+
252
+ export interface DealerUpdateParams {
253
+ /**
254
+ * Body param
255
+ */
256
+ address?: string | null;
257
+
258
+ /**
259
+ * Body param
260
+ */
261
+ business_name?: string | null;
262
+
263
+ /**
264
+ * Body param
265
+ */
266
+ city?: string | null;
267
+
268
+ /**
269
+ * Body param
270
+ */
271
+ contact_email?: string | null;
272
+
273
+ /**
274
+ * Body param
275
+ */
276
+ contact_phone?: string | null;
277
+
278
+ /**
279
+ * Body param
280
+ */
281
+ metadata?: { [key: string]: string } | null;
282
+
283
+ /**
284
+ * Body param
285
+ */
286
+ postal_code?: string | null;
287
+
288
+ /**
289
+ * Body param
290
+ */
291
+ province_code?: string | null;
292
+
293
+ /**
294
+ * Body param
295
+ */
296
+ status?: 'active' | 'inactive' | null;
297
+
298
+ /**
299
+ * Header param
300
+ */
301
+ 'Idempotency-Key'?: string;
302
+ }
303
+
304
+ export interface DealerListParams {
305
+ cursor?: string | null;
306
+
307
+ limit?: number;
308
+
309
+ status?: 'active' | 'inactive' | 'all';
310
+ }
311
+
312
+ Dealers.Nlt = Nlt;
313
+ Dealers.Vehicles = Vehicles;
314
+
315
+ export declare namespace Dealers {
316
+ export {
317
+ type DealerDetail as DealerDetail,
318
+ type DealerSummary as DealerSummary,
319
+ type DealerListResponse as DealerListResponse,
320
+ type DealerCreateParams as DealerCreateParams,
321
+ type DealerUpdateParams as DealerUpdateParams,
322
+ type DealerListParams as DealerListParams,
323
+ };
324
+
325
+ export {
326
+ type NltSettings as NltSettings,
327
+ type DownPaymentTiers as DownPaymentTiers,
328
+ type NltSettingUpdateParams as NltSettingUpdateParams,
329
+ };
330
+
331
+ export { Nlt as Nlt };
332
+
333
+ export {
334
+ Vehicles as Vehicles,
335
+ type AIContent as AIContent,
336
+ type BulkCreateVehiclesResponse as BulkCreateVehiclesResponse,
337
+ type BulkRowOutcome as BulkRowOutcome,
338
+ type VehicleDetail as VehicleDetail,
339
+ type VehicleList as VehicleList,
340
+ type VehicleSummary as VehicleSummary,
341
+ type VehicleCreateParams as VehicleCreateParams,
342
+ type VehicleRetrieveParams as VehicleRetrieveParams,
343
+ type VehicleUpdateParams as VehicleUpdateParams,
344
+ type VehicleListParams as VehicleListParams,
345
+ type VehicleDeleteParams as VehicleDeleteParams,
346
+ type VehicleBulkParams as VehicleBulkParams,
347
+ };
348
+ }