partnermax 0.2.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/CHANGELOG.md +47 -0
- package/LICENSE +201 -0
- package/README.md +370 -0
- package/api-promise.d.mts +3 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +3 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +3 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +212 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +212 -0
- package/client.d.ts.map +1 -0
- package/client.js +528 -0
- package/client.js.map +1 -0
- package/client.mjs +524 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +3 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +3 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +3 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +26 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +26 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +87 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +81 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +149 -0
- package/resource.d.mts +3 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +3 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +3 -0
- package/resource.mjs.map +1 -0
- package/resources/dealers/dealers.d.mts +211 -0
- package/resources/dealers/dealers.d.mts.map +1 -0
- package/resources/dealers/dealers.d.ts +211 -0
- package/resources/dealers/dealers.d.ts.map +1 -0
- package/resources/dealers/dealers.js +77 -0
- package/resources/dealers/dealers.js.map +1 -0
- package/resources/dealers/dealers.mjs +72 -0
- package/resources/dealers/dealers.mjs.map +1 -0
- package/resources/dealers/index.d.mts +5 -0
- package/resources/dealers/index.d.mts.map +1 -0
- package/resources/dealers/index.d.ts +5 -0
- package/resources/dealers/index.d.ts.map +1 -0
- package/resources/dealers/index.js +13 -0
- package/resources/dealers/index.js.map +1 -0
- package/resources/dealers/index.mjs +6 -0
- package/resources/dealers/index.mjs.map +1 -0
- package/resources/dealers/nlt/index.d.mts +3 -0
- package/resources/dealers/nlt/index.d.mts.map +1 -0
- package/resources/dealers/nlt/index.d.ts +3 -0
- package/resources/dealers/nlt/index.d.ts.map +1 -0
- package/resources/dealers/nlt/index.js +9 -0
- package/resources/dealers/nlt/index.js.map +1 -0
- package/resources/dealers/nlt/index.mjs +4 -0
- package/resources/dealers/nlt/index.mjs.map +1 -0
- package/resources/dealers/nlt/nlt.d.mts +10 -0
- package/resources/dealers/nlt/nlt.d.mts.map +1 -0
- package/resources/dealers/nlt/nlt.d.ts +10 -0
- package/resources/dealers/nlt/nlt.d.ts.map +1 -0
- package/resources/dealers/nlt/nlt.js +17 -0
- package/resources/dealers/nlt/nlt.js.map +1 -0
- package/resources/dealers/nlt/nlt.mjs +12 -0
- package/resources/dealers/nlt/nlt.mjs.map +1 -0
- package/resources/dealers/nlt/offers.d.mts +303 -0
- package/resources/dealers/nlt/offers.d.mts.map +1 -0
- package/resources/dealers/nlt/offers.d.ts +303 -0
- package/resources/dealers/nlt/offers.d.ts.map +1 -0
- package/resources/dealers/nlt/offers.js +35 -0
- package/resources/dealers/nlt/offers.js.map +1 -0
- package/resources/dealers/nlt/offers.mjs +31 -0
- package/resources/dealers/nlt/offers.mjs.map +1 -0
- package/resources/dealers/nlt-settings.d.mts +221 -0
- package/resources/dealers/nlt-settings.d.mts.map +1 -0
- package/resources/dealers/nlt-settings.d.ts +221 -0
- package/resources/dealers/nlt-settings.d.ts.map +1 -0
- package/resources/dealers/nlt-settings.js +54 -0
- package/resources/dealers/nlt-settings.js.map +1 -0
- package/resources/dealers/nlt-settings.mjs +50 -0
- package/resources/dealers/nlt-settings.mjs.map +1 -0
- package/resources/dealers/nlt.d.mts +2 -0
- package/resources/dealers/nlt.d.mts.map +1 -0
- package/resources/dealers/nlt.d.ts +2 -0
- package/resources/dealers/nlt.d.ts.map +1 -0
- package/resources/dealers/nlt.js +6 -0
- package/resources/dealers/nlt.js.map +1 -0
- package/resources/dealers/nlt.mjs +3 -0
- package/resources/dealers/nlt.mjs.map +1 -0
- package/resources/dealers/vehicles/images.d.mts +113 -0
- package/resources/dealers/vehicles/images.d.mts.map +1 -0
- package/resources/dealers/vehicles/images.d.ts +113 -0
- package/resources/dealers/vehicles/images.d.ts.map +1 -0
- package/resources/dealers/vehicles/images.js +64 -0
- package/resources/dealers/vehicles/images.js.map +1 -0
- package/resources/dealers/vehicles/images.mjs +60 -0
- package/resources/dealers/vehicles/images.mjs.map +1 -0
- package/resources/dealers/vehicles/index.d.mts +3 -0
- package/resources/dealers/vehicles/index.d.mts.map +1 -0
- package/resources/dealers/vehicles/index.d.ts +3 -0
- package/resources/dealers/vehicles/index.d.ts.map +1 -0
- package/resources/dealers/vehicles/index.js +9 -0
- package/resources/dealers/vehicles/index.js.map +1 -0
- package/resources/dealers/vehicles/index.mjs +4 -0
- package/resources/dealers/vehicles/index.mjs.map +1 -0
- package/resources/dealers/vehicles/vehicles.d.mts +576 -0
- package/resources/dealers/vehicles/vehicles.d.mts.map +1 -0
- package/resources/dealers/vehicles/vehicles.d.ts +576 -0
- package/resources/dealers/vehicles/vehicles.d.ts.map +1 -0
- package/resources/dealers/vehicles/vehicles.js +141 -0
- package/resources/dealers/vehicles/vehicles.js.map +1 -0
- package/resources/dealers/vehicles/vehicles.mjs +136 -0
- package/resources/dealers/vehicles/vehicles.mjs.map +1 -0
- package/resources/dealers/vehicles.d.mts +2 -0
- package/resources/dealers/vehicles.d.mts.map +1 -0
- package/resources/dealers/vehicles.d.ts +2 -0
- package/resources/dealers/vehicles.d.ts.map +1 -0
- package/resources/dealers/vehicles.js +6 -0
- package/resources/dealers/vehicles.js.map +1 -0
- package/resources/dealers/vehicles.mjs +3 -0
- package/resources/dealers/vehicles.mjs.map +1 -0
- package/resources/dealers.d.mts +2 -0
- package/resources/dealers.d.mts.map +1 -0
- package/resources/dealers.d.ts +2 -0
- package/resources/dealers.d.ts.map +1 -0
- package/resources/dealers.js +6 -0
- package/resources/dealers.js.map +1 -0
- package/resources/dealers.mjs +3 -0
- package/resources/dealers.mjs.map +1 -0
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +9 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -0
- package/resources/keys.d.mts +83 -0
- package/resources/keys.d.mts.map +1 -0
- package/resources/keys.d.ts +83 -0
- package/resources/keys.d.ts.map +1 -0
- package/resources/keys.js +51 -0
- package/resources/keys.js.map +1 -0
- package/resources/keys.mjs +47 -0
- package/resources/keys.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +841 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +93 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +128 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/dealers/dealers.ts +348 -0
- package/src/resources/dealers/index.ts +28 -0
- package/src/resources/dealers/nlt/index.ts +11 -0
- package/src/resources/dealers/nlt/nlt.ts +29 -0
- package/src/resources/dealers/nlt/offers.ts +427 -0
- package/src/resources/dealers/nlt-settings.ts +269 -0
- package/src/resources/dealers/nlt.ts +3 -0
- package/src/resources/dealers/vehicles/images.ts +153 -0
- package/src/resources/dealers/vehicles/index.ts +25 -0
- package/src/resources/dealers/vehicles/vehicles.ts +796 -0
- package/src/resources/dealers/vehicles.ts +3 -0
- package/src/resources/dealers.ts +3 -0
- package/src/resources/index.ts +12 -0
- package/src/resources/keys.ts +128 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +3 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +3 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +3 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
4
|
+
export declare class Offers extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Full offer detail. Payload shape mirrors apimax MCP `get_nlt_offer_details`
|
|
7
|
+
* bit-for-bit (mcp_server.py:1546-1606).
|
|
8
|
+
*/
|
|
9
|
+
retrieve(offerID: string, params: OfferRetrieveParams, options?: RequestOptions): APIPromise<OfferRetrieveResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Listing of NLT offers with monthly canon repriced for this dealer.
|
|
12
|
+
*
|
|
13
|
+
* Strategy:
|
|
14
|
+
*
|
|
15
|
+
* 1. Resolve + ACL the dealer.
|
|
16
|
+
* 2. Pull at most `limit + 1` offers from the catalog after the cursor. The extra
|
|
17
|
+
* row lets us know if there's a next page without a second COUNT(\*) query.
|
|
18
|
+
* 3. Apply text/enum filters server-side via SQL where possible (brand, segment,
|
|
19
|
+
* fuel) and the numeric `canone_max_eur` filter in Python after the pricing
|
|
20
|
+
* pass (the DB has no "displayed canon" column; we synthesize it per dealer).
|
|
21
|
+
* 4. For each surviving offer, price the (duration, km) cells the caller filtered
|
|
22
|
+
* to (if specified) or all 18, pick the cheapest cell as the headline.
|
|
23
|
+
*/
|
|
24
|
+
list(dealerID: string, query?: OfferListParams | null | undefined, options?: RequestOptions): APIPromise<OfferListResponse>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Single row in the offers list. Pricing is dealer-aware.
|
|
28
|
+
*
|
|
29
|
+
* Field names: American English snake_case. Values: Italian raw, apimax-aligned
|
|
30
|
+
* (`fuel_type: "Benzina"`, `segment: "SUV piccoli"`). No enum normalization —
|
|
31
|
+
* apimax labels are surfaced verbatim, exactly as the detail endpoint does, so the
|
|
32
|
+
* partner client sees the same string in both listing and detail.
|
|
33
|
+
*/
|
|
34
|
+
export interface NltOfferSummary {
|
|
35
|
+
brand: string;
|
|
36
|
+
dealer_id: string;
|
|
37
|
+
duration_months: number;
|
|
38
|
+
km_per_year_at_quote: number;
|
|
39
|
+
model: string;
|
|
40
|
+
monthly_canon_from_eur: number;
|
|
41
|
+
offer_id: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
vat_treatment: 'private' | 'business';
|
|
44
|
+
canonical_url?: string | null;
|
|
45
|
+
fuel_type?: string | null;
|
|
46
|
+
has_promo?: boolean;
|
|
47
|
+
image_url?: string | null;
|
|
48
|
+
segment?: string | null;
|
|
49
|
+
trim?: string | null;
|
|
50
|
+
vehicle_type?: 'auto' | 'vcom';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Full offer detail.
|
|
54
|
+
*
|
|
55
|
+
* Shape mirrors `_tool_get_nlt_offer_details` (apimax MCP) with all field names
|
|
56
|
+
* translated to American English snake_case for the partner SDK contract. VALUES
|
|
57
|
+
* stay Italian raw (apimax-aligned). The dict `technical_details` keeps Italian
|
|
58
|
+
* KEYS because they are `mnet_dettagli` column names (raw DB).
|
|
59
|
+
*/
|
|
60
|
+
export interface OfferRetrieveResponse {
|
|
61
|
+
found: boolean;
|
|
62
|
+
network_dealer_count: number;
|
|
63
|
+
offer_id: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
title: string;
|
|
66
|
+
vat_included: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Container for optional add-ons (apimax: `addons_disponibili`).
|
|
69
|
+
*/
|
|
70
|
+
available_addons?: OfferRetrieveResponse.AvailableAddons;
|
|
71
|
+
brand?: string | null;
|
|
72
|
+
description_full?: string | null;
|
|
73
|
+
description_short?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Three down-payment scenarios in EUR (whole amounts).
|
|
76
|
+
*
|
|
77
|
+
* apimax: `anticipo_scenari_eur` (keys remapped to American English snake_case for
|
|
78
|
+
* partnermax SDK: `zero/medium/standard`).
|
|
79
|
+
*/
|
|
80
|
+
down_payment_scenarios_eur?: OfferRetrieveResponse.DownPaymentScenariosEur | null;
|
|
81
|
+
/**
|
|
82
|
+
* Italian labels paired 1:1 with `NltDownPaymentScenariosEur`.
|
|
83
|
+
*
|
|
84
|
+
* apimax: `anticipo_scenari_labels` — used by Custom GPT to render the three
|
|
85
|
+
* options in conversation. Values stay in Italian raw ("Senza anticipo" /
|
|
86
|
+
* "Anticipo 12,5%" / "Anticipo 25%").
|
|
87
|
+
*/
|
|
88
|
+
down_payment_scenarios_labels?: OfferRetrieveResponse.DownPaymentScenariosLabels | null;
|
|
89
|
+
faqs?: Array<OfferRetrieveResponse.Faq>;
|
|
90
|
+
fuel_type?: string | null;
|
|
91
|
+
gallery?: Array<OfferRetrieveResponse.Gallery>;
|
|
92
|
+
image_url?: string | null;
|
|
93
|
+
included_accessories?: Array<OfferRetrieveResponse.IncludedAccessory>;
|
|
94
|
+
included_services?: Array<OfferRetrieveResponse.IncludedService>;
|
|
95
|
+
last_modified?: string | null;
|
|
96
|
+
min_monthly_canon_eur?: number | null;
|
|
97
|
+
model?: string | null;
|
|
98
|
+
network_offers?: Array<OfferRetrieveResponse.NetworkOffer>;
|
|
99
|
+
primary_dealer_city?: string | null;
|
|
100
|
+
primary_dealer_name?: string | null;
|
|
101
|
+
primary_dealer_province?: string | null;
|
|
102
|
+
private_only?: boolean | null;
|
|
103
|
+
quotations?: Array<OfferRetrieveResponse.Quotation>;
|
|
104
|
+
schema_org?: {
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
} | null;
|
|
107
|
+
segment?: string | null;
|
|
108
|
+
standard_equipment?: Array<string>;
|
|
109
|
+
tags?: Array<OfferRetrieveResponse.Tag>;
|
|
110
|
+
technical_details?: {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
};
|
|
113
|
+
total_price_eur?: number | null;
|
|
114
|
+
transmission?: string | null;
|
|
115
|
+
trim?: string | null;
|
|
116
|
+
vehicle_type?: 'auto' | 'vcom';
|
|
117
|
+
}
|
|
118
|
+
export declare namespace OfferRetrieveResponse {
|
|
119
|
+
/**
|
|
120
|
+
* Container for optional add-ons (apimax: `addons_disponibili`).
|
|
121
|
+
*/
|
|
122
|
+
interface AvailableAddons {
|
|
123
|
+
/**
|
|
124
|
+
* Replacement-vehicle add-on lookup (apimax:
|
|
125
|
+
* `addons_disponibili.auto_sostitutiva`).
|
|
126
|
+
*
|
|
127
|
+
* Always category B (utilitaria) per founder decision — the spoken "average
|
|
128
|
+
* customer" segment.
|
|
129
|
+
*/
|
|
130
|
+
replacement_vehicle?: AvailableAddons.ReplacementVehicle | null;
|
|
131
|
+
/**
|
|
132
|
+
* Tyre-replacement add-on lookup (apimax: `addons_disponibili.pneumatici`).
|
|
133
|
+
*
|
|
134
|
+
* Populated when `mnet_dettagli.pneumatici_anteriori` matches `R\d+` and a row
|
|
135
|
+
* exists in `nlt_pneumatici` for that diameter. Null otherwise. Replacement rule
|
|
136
|
+
* (founder decision 2026-05-12): 1 set of 4 tyres every 30 000 km, rounded up.
|
|
137
|
+
*/
|
|
138
|
+
tires?: AvailableAddons.Tires | null;
|
|
139
|
+
}
|
|
140
|
+
namespace AvailableAddons {
|
|
141
|
+
/**
|
|
142
|
+
* Replacement-vehicle add-on lookup (apimax:
|
|
143
|
+
* `addons_disponibili.auto_sostitutiva`).
|
|
144
|
+
*
|
|
145
|
+
* Always category B (utilitaria) per founder decision — the spoken "average
|
|
146
|
+
* customer" segment.
|
|
147
|
+
*/
|
|
148
|
+
interface ReplacementVehicle {
|
|
149
|
+
category_description: string;
|
|
150
|
+
default_category: string;
|
|
151
|
+
monthly_cost_eur: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Tyre-replacement add-on lookup (apimax: `addons_disponibili.pneumatici`).
|
|
155
|
+
*
|
|
156
|
+
* Populated when `mnet_dettagli.pneumatici_anteriori` matches `R\d+` and a row
|
|
157
|
+
* exists in `nlt_pneumatici` for that diameter. Null otherwise. Replacement rule
|
|
158
|
+
* (founder decision 2026-05-12): 1 set of 4 tyres every 30 000 km, rounded up.
|
|
159
|
+
*/
|
|
160
|
+
interface Tires {
|
|
161
|
+
diameter_in: number;
|
|
162
|
+
replacement_rule: string;
|
|
163
|
+
set_cost_eur: number;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Three down-payment scenarios in EUR (whole amounts).
|
|
168
|
+
*
|
|
169
|
+
* apimax: `anticipo_scenari_eur` (keys remapped to American English snake_case for
|
|
170
|
+
* partnermax SDK: `zero/medium/standard`).
|
|
171
|
+
*/
|
|
172
|
+
interface DownPaymentScenariosEur {
|
|
173
|
+
medium: number;
|
|
174
|
+
standard: number;
|
|
175
|
+
zero: number;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Italian labels paired 1:1 with `NltDownPaymentScenariosEur`.
|
|
179
|
+
*
|
|
180
|
+
* apimax: `anticipo_scenari_labels` — used by Custom GPT to render the three
|
|
181
|
+
* options in conversation. Values stay in Italian raw ("Senza anticipo" /
|
|
182
|
+
* "Anticipo 12,5%" / "Anticipo 25%").
|
|
183
|
+
*/
|
|
184
|
+
interface DownPaymentScenariosLabels {
|
|
185
|
+
medium: string;
|
|
186
|
+
standard: string;
|
|
187
|
+
zero: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* One Italian Q&A entry derived per-offer.
|
|
191
|
+
*
|
|
192
|
+
* apimax: `build_offer_faqs` in `seo_engine/nlt_faq_builder.py` — generates up to
|
|
193
|
+
* ~11 Q&A pairs (dimensions, fuel, transmission, CO2, monthly canon at preset
|
|
194
|
+
* combo, available durations, VAT inclusion, down-payment tiers, etc.). Partnermax
|
|
195
|
+
* surfaces them all, 1:1.
|
|
196
|
+
*/
|
|
197
|
+
interface Faq {
|
|
198
|
+
answer: string;
|
|
199
|
+
question: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* One image in the offer gallery (apimax: `gallery[]`).
|
|
203
|
+
*/
|
|
204
|
+
interface Gallery {
|
|
205
|
+
is_cover: boolean;
|
|
206
|
+
url: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* One accessory bundled with the offer (apimax: `accessori_inclusi[]`).
|
|
210
|
+
*/
|
|
211
|
+
interface IncludedAccessory {
|
|
212
|
+
code: string;
|
|
213
|
+
description: string;
|
|
214
|
+
extra_price_eur: number;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* One NLT service normally included in the canone.
|
|
218
|
+
*
|
|
219
|
+
* apimax: `_get_services_included` (`nlt_resolver.py:719`). Source is the global
|
|
220
|
+
* `nlt_services` table (active rows only). Same set of services across the network
|
|
221
|
+
* (Assicurazione RCA / Kasco / Incendio-Furto, Manutenzione, Assistenza Stradale,
|
|
222
|
+
* Bollo, Pneumatici, Veicolo in anticipo, Vettura sostitutiva). Not per-offer.
|
|
223
|
+
*/
|
|
224
|
+
interface IncludedService {
|
|
225
|
+
name: string;
|
|
226
|
+
description?: string | null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* One network dealer's quote for this offer (apimax: `network_offers[]`).
|
|
230
|
+
*
|
|
231
|
+
* Sorted by `min_monthly_canon_eur ASC`. In partnermax this list is scoped to
|
|
232
|
+
* dealers owned by the calling partner (`utenti.parent_id = partner.user_id`) —
|
|
233
|
+
* same shape as the apimax cross-network list, partner-scoped to avoid data
|
|
234
|
+
* leakage.
|
|
235
|
+
*/
|
|
236
|
+
interface NetworkOffer {
|
|
237
|
+
dealer_id: number;
|
|
238
|
+
dealer_name: string;
|
|
239
|
+
min_monthly_canon_eur: number;
|
|
240
|
+
city?: string | null;
|
|
241
|
+
contact_url?: string | null;
|
|
242
|
+
google_maps_url?: string | null;
|
|
243
|
+
phone?: string | null;
|
|
244
|
+
province?: string | null;
|
|
245
|
+
rating_value?: number | null;
|
|
246
|
+
review_count?: number | null;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* One priced cell of the 18-combination matrix.
|
|
250
|
+
*
|
|
251
|
+
* apimax: `quotazioni[]` entry — `_compute_quotazioni_dealer_aware`
|
|
252
|
+
* (mcp_server.py:180). Reflects the dealer's vetrina formula applied to each
|
|
253
|
+
* (durata, km) combo; cells with implausible canon (<€50) are dropped upstream, so
|
|
254
|
+
* the list may contain fewer than 18 rows.
|
|
255
|
+
*/
|
|
256
|
+
interface Quotation {
|
|
257
|
+
duration_months: number;
|
|
258
|
+
km_per_year: number;
|
|
259
|
+
monthly_canon_eur: number;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Category tag for an offer (apimax: `tags[]`).
|
|
263
|
+
*
|
|
264
|
+
* Populated from `nlt_offerta_tag` ⋈ `nlt_offerte_tag`. Examples in production:
|
|
265
|
+
* "Promo", "Stock pronto", "GreenChoice".
|
|
266
|
+
*/
|
|
267
|
+
interface Tag {
|
|
268
|
+
name: string;
|
|
269
|
+
color?: string | null;
|
|
270
|
+
icon?: string | null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Cursor-paginated list of offer summaries.
|
|
275
|
+
*/
|
|
276
|
+
export interface OfferListResponse {
|
|
277
|
+
data: Array<NltOfferSummary>;
|
|
278
|
+
has_more: boolean;
|
|
279
|
+
next_cursor?: string | null;
|
|
280
|
+
}
|
|
281
|
+
export interface OfferRetrieveParams {
|
|
282
|
+
dealer_id: string;
|
|
283
|
+
}
|
|
284
|
+
export interface OfferListParams {
|
|
285
|
+
brand?: string | null;
|
|
286
|
+
canone_max_eur?: number | null;
|
|
287
|
+
cursor?: string | null;
|
|
288
|
+
duration_months?: number | null;
|
|
289
|
+
fuel_type?: string | null;
|
|
290
|
+
km_per_year?: number | null;
|
|
291
|
+
limit?: number;
|
|
292
|
+
segment?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* Macro discriminator: 'auto' (passenger vehicles) or 'vcom' (light commercial ≤35
|
|
295
|
+
* q.li: vans, panel trucks, multispace, pickups, minibuses). Omit to return the
|
|
296
|
+
* mixed catalog.
|
|
297
|
+
*/
|
|
298
|
+
vehicle_type?: string | null;
|
|
299
|
+
}
|
|
300
|
+
export declare namespace Offers {
|
|
301
|
+
export { type NltOfferSummary as NltOfferSummary, type OfferRetrieveResponse as OfferRetrieveResponse, type OfferListResponse as OfferListResponse, type OfferRetrieveParams as OfferRetrieveParams, type OfferListParams as OfferListParams, };
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=offers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offers.d.mts","sourceRoot":"","sources":["../../../src/resources/dealers/nlt/offers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAGjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAElB,eAAe,EAAE,MAAM,CAAC;IAExB,oBAAoB,EAAE,MAAM,CAAC;IAE7B,KAAK,EAAE,MAAM,CAAC;IAEd,sBAAsB,EAAE,MAAM,CAAC;IAE/B,QAAQ,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,MAAM,CAAC;IAEb,aAAa,EAAE,SAAS,GAAG,UAAU,CAAC;IAEtC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,OAAO,CAAC,EAAE,MAAM,GA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9B;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
4
|
+
export declare class Offers extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Full offer detail. Payload shape mirrors apimax MCP `get_nlt_offer_details`
|
|
7
|
+
* bit-for-bit (mcp_server.py:1546-1606).
|
|
8
|
+
*/
|
|
9
|
+
retrieve(offerID: string, params: OfferRetrieveParams, options?: RequestOptions): APIPromise<OfferRetrieveResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Listing of NLT offers with monthly canon repriced for this dealer.
|
|
12
|
+
*
|
|
13
|
+
* Strategy:
|
|
14
|
+
*
|
|
15
|
+
* 1. Resolve + ACL the dealer.
|
|
16
|
+
* 2. Pull at most `limit + 1` offers from the catalog after the cursor. The extra
|
|
17
|
+
* row lets us know if there's a next page without a second COUNT(\*) query.
|
|
18
|
+
* 3. Apply text/enum filters server-side via SQL where possible (brand, segment,
|
|
19
|
+
* fuel) and the numeric `canone_max_eur` filter in Python after the pricing
|
|
20
|
+
* pass (the DB has no "displayed canon" column; we synthesize it per dealer).
|
|
21
|
+
* 4. For each surviving offer, price the (duration, km) cells the caller filtered
|
|
22
|
+
* to (if specified) or all 18, pick the cheapest cell as the headline.
|
|
23
|
+
*/
|
|
24
|
+
list(dealerID: string, query?: OfferListParams | null | undefined, options?: RequestOptions): APIPromise<OfferListResponse>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Single row in the offers list. Pricing is dealer-aware.
|
|
28
|
+
*
|
|
29
|
+
* Field names: American English snake_case. Values: Italian raw, apimax-aligned
|
|
30
|
+
* (`fuel_type: "Benzina"`, `segment: "SUV piccoli"`). No enum normalization —
|
|
31
|
+
* apimax labels are surfaced verbatim, exactly as the detail endpoint does, so the
|
|
32
|
+
* partner client sees the same string in both listing and detail.
|
|
33
|
+
*/
|
|
34
|
+
export interface NltOfferSummary {
|
|
35
|
+
brand: string;
|
|
36
|
+
dealer_id: string;
|
|
37
|
+
duration_months: number;
|
|
38
|
+
km_per_year_at_quote: number;
|
|
39
|
+
model: string;
|
|
40
|
+
monthly_canon_from_eur: number;
|
|
41
|
+
offer_id: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
vat_treatment: 'private' | 'business';
|
|
44
|
+
canonical_url?: string | null;
|
|
45
|
+
fuel_type?: string | null;
|
|
46
|
+
has_promo?: boolean;
|
|
47
|
+
image_url?: string | null;
|
|
48
|
+
segment?: string | null;
|
|
49
|
+
trim?: string | null;
|
|
50
|
+
vehicle_type?: 'auto' | 'vcom';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Full offer detail.
|
|
54
|
+
*
|
|
55
|
+
* Shape mirrors `_tool_get_nlt_offer_details` (apimax MCP) with all field names
|
|
56
|
+
* translated to American English snake_case for the partner SDK contract. VALUES
|
|
57
|
+
* stay Italian raw (apimax-aligned). The dict `technical_details` keeps Italian
|
|
58
|
+
* KEYS because they are `mnet_dettagli` column names (raw DB).
|
|
59
|
+
*/
|
|
60
|
+
export interface OfferRetrieveResponse {
|
|
61
|
+
found: boolean;
|
|
62
|
+
network_dealer_count: number;
|
|
63
|
+
offer_id: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
title: string;
|
|
66
|
+
vat_included: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Container for optional add-ons (apimax: `addons_disponibili`).
|
|
69
|
+
*/
|
|
70
|
+
available_addons?: OfferRetrieveResponse.AvailableAddons;
|
|
71
|
+
brand?: string | null;
|
|
72
|
+
description_full?: string | null;
|
|
73
|
+
description_short?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Three down-payment scenarios in EUR (whole amounts).
|
|
76
|
+
*
|
|
77
|
+
* apimax: `anticipo_scenari_eur` (keys remapped to American English snake_case for
|
|
78
|
+
* partnermax SDK: `zero/medium/standard`).
|
|
79
|
+
*/
|
|
80
|
+
down_payment_scenarios_eur?: OfferRetrieveResponse.DownPaymentScenariosEur | null;
|
|
81
|
+
/**
|
|
82
|
+
* Italian labels paired 1:1 with `NltDownPaymentScenariosEur`.
|
|
83
|
+
*
|
|
84
|
+
* apimax: `anticipo_scenari_labels` — used by Custom GPT to render the three
|
|
85
|
+
* options in conversation. Values stay in Italian raw ("Senza anticipo" /
|
|
86
|
+
* "Anticipo 12,5%" / "Anticipo 25%").
|
|
87
|
+
*/
|
|
88
|
+
down_payment_scenarios_labels?: OfferRetrieveResponse.DownPaymentScenariosLabels | null;
|
|
89
|
+
faqs?: Array<OfferRetrieveResponse.Faq>;
|
|
90
|
+
fuel_type?: string | null;
|
|
91
|
+
gallery?: Array<OfferRetrieveResponse.Gallery>;
|
|
92
|
+
image_url?: string | null;
|
|
93
|
+
included_accessories?: Array<OfferRetrieveResponse.IncludedAccessory>;
|
|
94
|
+
included_services?: Array<OfferRetrieveResponse.IncludedService>;
|
|
95
|
+
last_modified?: string | null;
|
|
96
|
+
min_monthly_canon_eur?: number | null;
|
|
97
|
+
model?: string | null;
|
|
98
|
+
network_offers?: Array<OfferRetrieveResponse.NetworkOffer>;
|
|
99
|
+
primary_dealer_city?: string | null;
|
|
100
|
+
primary_dealer_name?: string | null;
|
|
101
|
+
primary_dealer_province?: string | null;
|
|
102
|
+
private_only?: boolean | null;
|
|
103
|
+
quotations?: Array<OfferRetrieveResponse.Quotation>;
|
|
104
|
+
schema_org?: {
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
} | null;
|
|
107
|
+
segment?: string | null;
|
|
108
|
+
standard_equipment?: Array<string>;
|
|
109
|
+
tags?: Array<OfferRetrieveResponse.Tag>;
|
|
110
|
+
technical_details?: {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
};
|
|
113
|
+
total_price_eur?: number | null;
|
|
114
|
+
transmission?: string | null;
|
|
115
|
+
trim?: string | null;
|
|
116
|
+
vehicle_type?: 'auto' | 'vcom';
|
|
117
|
+
}
|
|
118
|
+
export declare namespace OfferRetrieveResponse {
|
|
119
|
+
/**
|
|
120
|
+
* Container for optional add-ons (apimax: `addons_disponibili`).
|
|
121
|
+
*/
|
|
122
|
+
interface AvailableAddons {
|
|
123
|
+
/**
|
|
124
|
+
* Replacement-vehicle add-on lookup (apimax:
|
|
125
|
+
* `addons_disponibili.auto_sostitutiva`).
|
|
126
|
+
*
|
|
127
|
+
* Always category B (utilitaria) per founder decision — the spoken "average
|
|
128
|
+
* customer" segment.
|
|
129
|
+
*/
|
|
130
|
+
replacement_vehicle?: AvailableAddons.ReplacementVehicle | null;
|
|
131
|
+
/**
|
|
132
|
+
* Tyre-replacement add-on lookup (apimax: `addons_disponibili.pneumatici`).
|
|
133
|
+
*
|
|
134
|
+
* Populated when `mnet_dettagli.pneumatici_anteriori` matches `R\d+` and a row
|
|
135
|
+
* exists in `nlt_pneumatici` for that diameter. Null otherwise. Replacement rule
|
|
136
|
+
* (founder decision 2026-05-12): 1 set of 4 tyres every 30 000 km, rounded up.
|
|
137
|
+
*/
|
|
138
|
+
tires?: AvailableAddons.Tires | null;
|
|
139
|
+
}
|
|
140
|
+
namespace AvailableAddons {
|
|
141
|
+
/**
|
|
142
|
+
* Replacement-vehicle add-on lookup (apimax:
|
|
143
|
+
* `addons_disponibili.auto_sostitutiva`).
|
|
144
|
+
*
|
|
145
|
+
* Always category B (utilitaria) per founder decision — the spoken "average
|
|
146
|
+
* customer" segment.
|
|
147
|
+
*/
|
|
148
|
+
interface ReplacementVehicle {
|
|
149
|
+
category_description: string;
|
|
150
|
+
default_category: string;
|
|
151
|
+
monthly_cost_eur: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Tyre-replacement add-on lookup (apimax: `addons_disponibili.pneumatici`).
|
|
155
|
+
*
|
|
156
|
+
* Populated when `mnet_dettagli.pneumatici_anteriori` matches `R\d+` and a row
|
|
157
|
+
* exists in `nlt_pneumatici` for that diameter. Null otherwise. Replacement rule
|
|
158
|
+
* (founder decision 2026-05-12): 1 set of 4 tyres every 30 000 km, rounded up.
|
|
159
|
+
*/
|
|
160
|
+
interface Tires {
|
|
161
|
+
diameter_in: number;
|
|
162
|
+
replacement_rule: string;
|
|
163
|
+
set_cost_eur: number;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Three down-payment scenarios in EUR (whole amounts).
|
|
168
|
+
*
|
|
169
|
+
* apimax: `anticipo_scenari_eur` (keys remapped to American English snake_case for
|
|
170
|
+
* partnermax SDK: `zero/medium/standard`).
|
|
171
|
+
*/
|
|
172
|
+
interface DownPaymentScenariosEur {
|
|
173
|
+
medium: number;
|
|
174
|
+
standard: number;
|
|
175
|
+
zero: number;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Italian labels paired 1:1 with `NltDownPaymentScenariosEur`.
|
|
179
|
+
*
|
|
180
|
+
* apimax: `anticipo_scenari_labels` — used by Custom GPT to render the three
|
|
181
|
+
* options in conversation. Values stay in Italian raw ("Senza anticipo" /
|
|
182
|
+
* "Anticipo 12,5%" / "Anticipo 25%").
|
|
183
|
+
*/
|
|
184
|
+
interface DownPaymentScenariosLabels {
|
|
185
|
+
medium: string;
|
|
186
|
+
standard: string;
|
|
187
|
+
zero: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* One Italian Q&A entry derived per-offer.
|
|
191
|
+
*
|
|
192
|
+
* apimax: `build_offer_faqs` in `seo_engine/nlt_faq_builder.py` — generates up to
|
|
193
|
+
* ~11 Q&A pairs (dimensions, fuel, transmission, CO2, monthly canon at preset
|
|
194
|
+
* combo, available durations, VAT inclusion, down-payment tiers, etc.). Partnermax
|
|
195
|
+
* surfaces them all, 1:1.
|
|
196
|
+
*/
|
|
197
|
+
interface Faq {
|
|
198
|
+
answer: string;
|
|
199
|
+
question: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* One image in the offer gallery (apimax: `gallery[]`).
|
|
203
|
+
*/
|
|
204
|
+
interface Gallery {
|
|
205
|
+
is_cover: boolean;
|
|
206
|
+
url: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* One accessory bundled with the offer (apimax: `accessori_inclusi[]`).
|
|
210
|
+
*/
|
|
211
|
+
interface IncludedAccessory {
|
|
212
|
+
code: string;
|
|
213
|
+
description: string;
|
|
214
|
+
extra_price_eur: number;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* One NLT service normally included in the canone.
|
|
218
|
+
*
|
|
219
|
+
* apimax: `_get_services_included` (`nlt_resolver.py:719`). Source is the global
|
|
220
|
+
* `nlt_services` table (active rows only). Same set of services across the network
|
|
221
|
+
* (Assicurazione RCA / Kasco / Incendio-Furto, Manutenzione, Assistenza Stradale,
|
|
222
|
+
* Bollo, Pneumatici, Veicolo in anticipo, Vettura sostitutiva). Not per-offer.
|
|
223
|
+
*/
|
|
224
|
+
interface IncludedService {
|
|
225
|
+
name: string;
|
|
226
|
+
description?: string | null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* One network dealer's quote for this offer (apimax: `network_offers[]`).
|
|
230
|
+
*
|
|
231
|
+
* Sorted by `min_monthly_canon_eur ASC`. In partnermax this list is scoped to
|
|
232
|
+
* dealers owned by the calling partner (`utenti.parent_id = partner.user_id`) —
|
|
233
|
+
* same shape as the apimax cross-network list, partner-scoped to avoid data
|
|
234
|
+
* leakage.
|
|
235
|
+
*/
|
|
236
|
+
interface NetworkOffer {
|
|
237
|
+
dealer_id: number;
|
|
238
|
+
dealer_name: string;
|
|
239
|
+
min_monthly_canon_eur: number;
|
|
240
|
+
city?: string | null;
|
|
241
|
+
contact_url?: string | null;
|
|
242
|
+
google_maps_url?: string | null;
|
|
243
|
+
phone?: string | null;
|
|
244
|
+
province?: string | null;
|
|
245
|
+
rating_value?: number | null;
|
|
246
|
+
review_count?: number | null;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* One priced cell of the 18-combination matrix.
|
|
250
|
+
*
|
|
251
|
+
* apimax: `quotazioni[]` entry — `_compute_quotazioni_dealer_aware`
|
|
252
|
+
* (mcp_server.py:180). Reflects the dealer's vetrina formula applied to each
|
|
253
|
+
* (durata, km) combo; cells with implausible canon (<€50) are dropped upstream, so
|
|
254
|
+
* the list may contain fewer than 18 rows.
|
|
255
|
+
*/
|
|
256
|
+
interface Quotation {
|
|
257
|
+
duration_months: number;
|
|
258
|
+
km_per_year: number;
|
|
259
|
+
monthly_canon_eur: number;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Category tag for an offer (apimax: `tags[]`).
|
|
263
|
+
*
|
|
264
|
+
* Populated from `nlt_offerta_tag` ⋈ `nlt_offerte_tag`. Examples in production:
|
|
265
|
+
* "Promo", "Stock pronto", "GreenChoice".
|
|
266
|
+
*/
|
|
267
|
+
interface Tag {
|
|
268
|
+
name: string;
|
|
269
|
+
color?: string | null;
|
|
270
|
+
icon?: string | null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Cursor-paginated list of offer summaries.
|
|
275
|
+
*/
|
|
276
|
+
export interface OfferListResponse {
|
|
277
|
+
data: Array<NltOfferSummary>;
|
|
278
|
+
has_more: boolean;
|
|
279
|
+
next_cursor?: string | null;
|
|
280
|
+
}
|
|
281
|
+
export interface OfferRetrieveParams {
|
|
282
|
+
dealer_id: string;
|
|
283
|
+
}
|
|
284
|
+
export interface OfferListParams {
|
|
285
|
+
brand?: string | null;
|
|
286
|
+
canone_max_eur?: number | null;
|
|
287
|
+
cursor?: string | null;
|
|
288
|
+
duration_months?: number | null;
|
|
289
|
+
fuel_type?: string | null;
|
|
290
|
+
km_per_year?: number | null;
|
|
291
|
+
limit?: number;
|
|
292
|
+
segment?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* Macro discriminator: 'auto' (passenger vehicles) or 'vcom' (light commercial ≤35
|
|
295
|
+
* q.li: vans, panel trucks, multispace, pickups, minibuses). Omit to return the
|
|
296
|
+
* mixed catalog.
|
|
297
|
+
*/
|
|
298
|
+
vehicle_type?: string | null;
|
|
299
|
+
}
|
|
300
|
+
export declare namespace Offers {
|
|
301
|
+
export { type NltOfferSummary as NltOfferSummary, type OfferRetrieveResponse as OfferRetrieveResponse, type OfferListResponse as OfferListResponse, type OfferRetrieveParams as OfferRetrieveParams, type OfferListParams as OfferListParams, };
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=offers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["../../../src/resources/dealers/nlt/offers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAGjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAElB,eAAe,EA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K,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Offers = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
7
|
+
class Offers extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Full offer detail. Payload shape mirrors apimax MCP `get_nlt_offer_details`
|
|
10
|
+
* bit-for-bit (mcp_server.py:1546-1606).
|
|
11
|
+
*/
|
|
12
|
+
retrieve(offerID, params, options) {
|
|
13
|
+
const { dealer_id } = params;
|
|
14
|
+
return this._client.get((0, path_1.path) `/v1/dealers/${dealer_id}/nlt/offers/${offerID}`, options);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Listing of NLT offers with monthly canon repriced for this dealer.
|
|
18
|
+
*
|
|
19
|
+
* Strategy:
|
|
20
|
+
*
|
|
21
|
+
* 1. Resolve + ACL the dealer.
|
|
22
|
+
* 2. Pull at most `limit + 1` offers from the catalog after the cursor. The extra
|
|
23
|
+
* row lets us know if there's a next page without a second COUNT(\*) query.
|
|
24
|
+
* 3. Apply text/enum filters server-side via SQL where possible (brand, segment,
|
|
25
|
+
* fuel) and the numeric `canone_max_eur` filter in Python after the pricing
|
|
26
|
+
* pass (the DB has no "displayed canon" column; we synthesize it per dealer).
|
|
27
|
+
* 4. For each surviving offer, price the (duration, km) cells the caller filtered
|
|
28
|
+
* to (if specified) or all 18, pick the cheapest cell as the headline.
|
|
29
|
+
*/
|
|
30
|
+
list(dealerID, query = {}, options) {
|
|
31
|
+
return this._client.get((0, path_1.path) `/v1/dealers/${dealerID}/nlt/offers`, { query, ...options });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.Offers = Offers;
|
|
35
|
+
//# sourceMappingURL=offers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offers.js","sourceRoot":"","sources":["../../../src/resources/dealers/nlt/offers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;OAGG;IACH,QAAQ,CACN,OAAe,EACf,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,SAAS,eAAe,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,QAAgB,EAChB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AAnCD,wBAmCC"}
|