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,141 @@
|
|
|
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.Vehicles = void 0;
|
|
5
|
+
const tslib_1 = require("./..\\..\\..\\internal\\tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const ImagesAPI = tslib_1.__importStar(require("./images.js"));
|
|
8
|
+
const images_1 = require("./images.js");
|
|
9
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
10
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
11
|
+
/**
|
|
12
|
+
* 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).
|
|
13
|
+
*/
|
|
14
|
+
class Vehicles extends resource_1.APIResource {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.images = new ImagesAPI.Images(this._client);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Provision a new used vehicle in a dealer's stock.
|
|
21
|
+
*
|
|
22
|
+
* Writes are atomic across `azlease_usatoin` and `azlease_usatoauto` using a
|
|
23
|
+
* `SAVEPOINT` so a UNIQUE plate violation rolls back cleanly. On success the
|
|
24
|
+
* AI-content worker (:mod:`azurenet-engine.app.jobs.usato_ai_content_worker`)
|
|
25
|
+
* picks up the new row within 60 seconds and generates the SEO body + pgvector
|
|
26
|
+
* embedding — at which point the vehicle becomes discoverable on the cross-network
|
|
27
|
+
* MCP / Custom GPT / NLWeb surfaces. The response returns immediately (no
|
|
28
|
+
* synchronous wait on the worker).
|
|
29
|
+
*/
|
|
30
|
+
create(dealerID, params, options) {
|
|
31
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
32
|
+
return this._client.post((0, path_1.path) `/v1/dealers/${dealerID}/vehicles`, {
|
|
33
|
+
body,
|
|
34
|
+
...options,
|
|
35
|
+
headers: (0, headers_1.buildHeaders)([
|
|
36
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
37
|
+
options?.headers,
|
|
38
|
+
]),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get Vehicle
|
|
43
|
+
*/
|
|
44
|
+
retrieve(vehicleID, params, options) {
|
|
45
|
+
const { dealer_id, ...query } = params;
|
|
46
|
+
return this._client.get((0, path_1.path) `/v1/dealers/${dealer_id}/vehicles/${vehicleID}`, { query, ...options });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Partial update of a vehicle.
|
|
50
|
+
*
|
|
51
|
+
* Splits the inbound body across the two physical tables (`azlease_usatoauto` and
|
|
52
|
+
* `azlease_usatoin`) and emits at most one UPDATE per table inside a single
|
|
53
|
+
* transaction. Fields not present in the body are not touched.
|
|
54
|
+
*/
|
|
55
|
+
update(vehicleID, params, options) {
|
|
56
|
+
const { dealer_id, 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
57
|
+
return this._client.patch((0, path_1.path) `/v1/dealers/${dealer_id}/vehicles/${vehicleID}`, {
|
|
58
|
+
body,
|
|
59
|
+
...options,
|
|
60
|
+
headers: (0, headers_1.buildHeaders)([
|
|
61
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
62
|
+
options?.headers,
|
|
63
|
+
]),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* List vehicles in a dealer's stock owned by the calling partner.
|
|
68
|
+
*
|
|
69
|
+
* Cursor pagination is opaque base64url over the last vehicle UUID. Default sort
|
|
70
|
+
* is `i.data_inserimento ASC` so freshly provisioned vehicles surface at the tail.
|
|
71
|
+
* Soft-deleted rows are excluded unless `include_deleted=true` is set explicitly —
|
|
72
|
+
* this preserves the soft-delete semantic across the API contract.
|
|
73
|
+
*/
|
|
74
|
+
list(dealerID, query = {}, options) {
|
|
75
|
+
return this._client.get((0, path_1.path) `/v1/dealers/${dealerID}/vehicles`, { query, ...options });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Withdraw a vehicle from sale without deleting the row.
|
|
79
|
+
*
|
|
80
|
+
* Sets `azlease_usatoin.visibile = FALSE` and stamps `venduto_il = now()`. The
|
|
81
|
+
* plate becomes reusable on the network the moment this returns (the
|
|
82
|
+
* active-uniqueness check excludes rows where `visibile = FALSE` OR
|
|
83
|
+
* `venduto_il IS NOT NULL`).
|
|
84
|
+
*
|
|
85
|
+
* Soft-delete is the canonical "remove this vehicle from sale" surface. The
|
|
86
|
+
* AI-citation consumers (MCP `_tool_search_vehicles`, Custom GPT
|
|
87
|
+
* `search_vehicles_network`, NLWeb `/ask`) each filter their own queries on
|
|
88
|
+
* `i.visibile = TRUE AND i.venduto_il IS NULL` — the shared `v_apimax_listing`
|
|
89
|
+
* view itself does not impose that filter, every consumer adds it. The result on
|
|
90
|
+
* the partner side is the same: a soft-deleted vehicle disappears from every AI
|
|
91
|
+
* surface within the next index cycle.
|
|
92
|
+
*
|
|
93
|
+
* Returns `409 vehicle_already_deleted` if the row is already soft- deleted — same
|
|
94
|
+
* idempotency pattern as the dealers DELETE endpoint.
|
|
95
|
+
*/
|
|
96
|
+
delete(vehicleID, params, options) {
|
|
97
|
+
const { dealer_id } = params;
|
|
98
|
+
return this._client.delete((0, path_1.path) `/v1/dealers/${dealer_id}/vehicles/${vehicleID}`, {
|
|
99
|
+
...options,
|
|
100
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Provision up to `BULK_MAX_ROWS` vehicles in a single synchronous call.
|
|
105
|
+
*
|
|
106
|
+
* Each row is processed inside its own `SAVEPOINT` so a failure on row N
|
|
107
|
+
* (validation, plate conflict, motornet not in catalogue, race) is isolated — the
|
|
108
|
+
* SAVEPOINT rolls back, the per-row outcome is collected with a structured error
|
|
109
|
+
* code, and the loop continues with row N+1.
|
|
110
|
+
*
|
|
111
|
+
* Successful rows accumulate in the outer transaction and are committed together
|
|
112
|
+
* at the end of the request. Failed rows leave no trace in the database.
|
|
113
|
+
*
|
|
114
|
+
* Returns `207 Multi-Status`. The response carries:
|
|
115
|
+
*
|
|
116
|
+
* - `total`, `succeeded`, `failed` — aggregate counters for quick branch logic on
|
|
117
|
+
* the partner side.
|
|
118
|
+
* - `results` — array of per-row outcomes, indexed by the position in the request
|
|
119
|
+
* `vehicles[]` array. Successful rows include the full `VehicleDetail`; failed
|
|
120
|
+
* rows include `error_code` + `error_message` keyed to the same codes as the
|
|
121
|
+
* single-POST surface so the partner reuses one error handler for both paths.
|
|
122
|
+
*
|
|
123
|
+
* For imports larger than `BULK_MAX_ROWS` (currently 100), the partner is expected
|
|
124
|
+
* to chunk the array client-side. A 5 000-vehicle initial migration is 50 calls;
|
|
125
|
+
* the partner controls concurrency.
|
|
126
|
+
*/
|
|
127
|
+
bulk(dealerID, params, options) {
|
|
128
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
129
|
+
return this._client.post((0, path_1.path) `/v1/dealers/${dealerID}/vehicles/bulk`, {
|
|
130
|
+
body,
|
|
131
|
+
...options,
|
|
132
|
+
headers: (0, headers_1.buildHeaders)([
|
|
133
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
134
|
+
options?.headers,
|
|
135
|
+
]),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.Vehicles = Vehicles;
|
|
140
|
+
Vehicles.Images = images_1.Images;
|
|
141
|
+
//# sourceMappingURL=vehicles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicles.js","sourceRoot":"","sources":["../../../src/resources/dealers/vehicles/vehicles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,+DAAsC;AACtC,wCAOkB;AAElB,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAA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AAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA/ID,4BA+IC;AA8lBD,QAAQ,CAAC,MAAM,GAAG,eAAM,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as ImagesAPI from "./images.mjs";
|
|
4
|
+
import { Images, } from "./images.mjs";
|
|
5
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
6
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* 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).
|
|
9
|
+
*/
|
|
10
|
+
export class Vehicles extends APIResource {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.images = new ImagesAPI.Images(this._client);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Provision a new used vehicle in a dealer's stock.
|
|
17
|
+
*
|
|
18
|
+
* Writes are atomic across `azlease_usatoin` and `azlease_usatoauto` using a
|
|
19
|
+
* `SAVEPOINT` so a UNIQUE plate violation rolls back cleanly. On success the
|
|
20
|
+
* AI-content worker (:mod:`azurenet-engine.app.jobs.usato_ai_content_worker`)
|
|
21
|
+
* picks up the new row within 60 seconds and generates the SEO body + pgvector
|
|
22
|
+
* embedding — at which point the vehicle becomes discoverable on the cross-network
|
|
23
|
+
* MCP / Custom GPT / NLWeb surfaces. The response returns immediately (no
|
|
24
|
+
* synchronous wait on the worker).
|
|
25
|
+
*/
|
|
26
|
+
create(dealerID, params, options) {
|
|
27
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
28
|
+
return this._client.post(path `/v1/dealers/${dealerID}/vehicles`, {
|
|
29
|
+
body,
|
|
30
|
+
...options,
|
|
31
|
+
headers: buildHeaders([
|
|
32
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
33
|
+
options?.headers,
|
|
34
|
+
]),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get Vehicle
|
|
39
|
+
*/
|
|
40
|
+
retrieve(vehicleID, params, options) {
|
|
41
|
+
const { dealer_id, ...query } = params;
|
|
42
|
+
return this._client.get(path `/v1/dealers/${dealer_id}/vehicles/${vehicleID}`, { query, ...options });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Partial update of a vehicle.
|
|
46
|
+
*
|
|
47
|
+
* Splits the inbound body across the two physical tables (`azlease_usatoauto` and
|
|
48
|
+
* `azlease_usatoin`) and emits at most one UPDATE per table inside a single
|
|
49
|
+
* transaction. Fields not present in the body are not touched.
|
|
50
|
+
*/
|
|
51
|
+
update(vehicleID, params, options) {
|
|
52
|
+
const { dealer_id, 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
53
|
+
return this._client.patch(path `/v1/dealers/${dealer_id}/vehicles/${vehicleID}`, {
|
|
54
|
+
body,
|
|
55
|
+
...options,
|
|
56
|
+
headers: buildHeaders([
|
|
57
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
58
|
+
options?.headers,
|
|
59
|
+
]),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* List vehicles in a dealer's stock owned by the calling partner.
|
|
64
|
+
*
|
|
65
|
+
* Cursor pagination is opaque base64url over the last vehicle UUID. Default sort
|
|
66
|
+
* is `i.data_inserimento ASC` so freshly provisioned vehicles surface at the tail.
|
|
67
|
+
* Soft-deleted rows are excluded unless `include_deleted=true` is set explicitly —
|
|
68
|
+
* this preserves the soft-delete semantic across the API contract.
|
|
69
|
+
*/
|
|
70
|
+
list(dealerID, query = {}, options) {
|
|
71
|
+
return this._client.get(path `/v1/dealers/${dealerID}/vehicles`, { query, ...options });
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Withdraw a vehicle from sale without deleting the row.
|
|
75
|
+
*
|
|
76
|
+
* Sets `azlease_usatoin.visibile = FALSE` and stamps `venduto_il = now()`. The
|
|
77
|
+
* plate becomes reusable on the network the moment this returns (the
|
|
78
|
+
* active-uniqueness check excludes rows where `visibile = FALSE` OR
|
|
79
|
+
* `venduto_il IS NOT NULL`).
|
|
80
|
+
*
|
|
81
|
+
* Soft-delete is the canonical "remove this vehicle from sale" surface. The
|
|
82
|
+
* AI-citation consumers (MCP `_tool_search_vehicles`, Custom GPT
|
|
83
|
+
* `search_vehicles_network`, NLWeb `/ask`) each filter their own queries on
|
|
84
|
+
* `i.visibile = TRUE AND i.venduto_il IS NULL` — the shared `v_apimax_listing`
|
|
85
|
+
* view itself does not impose that filter, every consumer adds it. The result on
|
|
86
|
+
* the partner side is the same: a soft-deleted vehicle disappears from every AI
|
|
87
|
+
* surface within the next index cycle.
|
|
88
|
+
*
|
|
89
|
+
* Returns `409 vehicle_already_deleted` if the row is already soft- deleted — same
|
|
90
|
+
* idempotency pattern as the dealers DELETE endpoint.
|
|
91
|
+
*/
|
|
92
|
+
delete(vehicleID, params, options) {
|
|
93
|
+
const { dealer_id } = params;
|
|
94
|
+
return this._client.delete(path `/v1/dealers/${dealer_id}/vehicles/${vehicleID}`, {
|
|
95
|
+
...options,
|
|
96
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Provision up to `BULK_MAX_ROWS` vehicles in a single synchronous call.
|
|
101
|
+
*
|
|
102
|
+
* Each row is processed inside its own `SAVEPOINT` so a failure on row N
|
|
103
|
+
* (validation, plate conflict, motornet not in catalogue, race) is isolated — the
|
|
104
|
+
* SAVEPOINT rolls back, the per-row outcome is collected with a structured error
|
|
105
|
+
* code, and the loop continues with row N+1.
|
|
106
|
+
*
|
|
107
|
+
* Successful rows accumulate in the outer transaction and are committed together
|
|
108
|
+
* at the end of the request. Failed rows leave no trace in the database.
|
|
109
|
+
*
|
|
110
|
+
* Returns `207 Multi-Status`. The response carries:
|
|
111
|
+
*
|
|
112
|
+
* - `total`, `succeeded`, `failed` — aggregate counters for quick branch logic on
|
|
113
|
+
* the partner side.
|
|
114
|
+
* - `results` — array of per-row outcomes, indexed by the position in the request
|
|
115
|
+
* `vehicles[]` array. Successful rows include the full `VehicleDetail`; failed
|
|
116
|
+
* rows include `error_code` + `error_message` keyed to the same codes as the
|
|
117
|
+
* single-POST surface so the partner reuses one error handler for both paths.
|
|
118
|
+
*
|
|
119
|
+
* For imports larger than `BULK_MAX_ROWS` (currently 100), the partner is expected
|
|
120
|
+
* to chunk the array client-side. A 5 000-vehicle initial migration is 50 calls;
|
|
121
|
+
* the partner controls concurrency.
|
|
122
|
+
*/
|
|
123
|
+
bulk(dealerID, params, options) {
|
|
124
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
125
|
+
return this._client.post(path `/v1/dealers/${dealerID}/vehicles/bulk`, {
|
|
126
|
+
body,
|
|
127
|
+
...options,
|
|
128
|
+
headers: buildHeaders([
|
|
129
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
130
|
+
options?.headers,
|
|
131
|
+
]),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
Vehicles.Images = Images;
|
|
136
|
+
//# sourceMappingURL=vehicles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicles.mjs","sourceRoot":"","sources":["../../../src/resources/dealers/vehicles/vehicles.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OA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AAQ,gBAAgB,EAAE;YACpE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA8lBD,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicles.d.mts","sourceRoot":"","sources":["../../src/resources/dealers/vehicles.ts"],"names":[],"mappings":"AAEA,qCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicles.d.ts","sourceRoot":"","sources":["../../src/resources/dealers/vehicles.ts"],"names":[],"mappings":"AAEA,oCAAiC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
const tslib_1 = require("./..\\..\\internal\\tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./vehicles/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=vehicles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicles.js","sourceRoot":"","sources":["../../src/resources/dealers/vehicles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vehicles.mjs","sourceRoot":"","sources":["../../src/resources/dealers/vehicles.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,qCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dealers.d.mts","sourceRoot":"","sources":["../src/resources/dealers.ts"],"names":[],"mappings":"AAEA,oCAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dealers.d.ts","sourceRoot":"","sources":["../src/resources/dealers.ts"],"names":[],"mappings":"AAEA,mCAAgC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
const tslib_1 = require("./..\\internal\\tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./dealers/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=dealers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dealers.js","sourceRoot":"","sources":["../src/resources/dealers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dealers.mjs","sourceRoot":"","sources":["../src/resources/dealers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,oCAAgC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Dealers, type DealerDetail, type DealerSummary, type DealerListResponse, type DealerCreateParams, type DealerUpdateParams, type DealerListParams, } from "./dealers/dealers.mjs";
|
|
2
|
+
export { Keys, type KeyListResponse, type KeyIssueResponse, type KeyIssueParams } from "./keys.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,8BAA0B;AAC3B,OAAO,EAAE,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,mBAAe"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Dealers, type DealerDetail, type DealerSummary, type DealerListResponse, type DealerCreateParams, type DealerUpdateParams, type DealerListParams, } from "./dealers/dealers.js";
|
|
2
|
+
export { Keys, type KeyListResponse, type KeyIssueResponse, type KeyIssueParams } from "./keys.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,6BAA0B;AAC3B,OAAO,EAAE,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,kBAAe"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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.Keys = exports.Dealers = void 0;
|
|
5
|
+
var dealers_1 = require("./dealers/dealers.js");
|
|
6
|
+
Object.defineProperty(exports, "Dealers", { enumerable: true, get: function () { return dealers_1.Dealers; } });
|
|
7
|
+
var keys_1 = require("./keys.js");
|
|
8
|
+
Object.defineProperty(exports, "Keys", { enumerable: true, get: function () { return keys_1.Keys; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAQ2B;AAPzB,kGAAA,OAAO,OAAA;AAQT,kCAAgG;AAAvF,4FAAA,IAAI,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,OAAO,GAOR,8BAA0B;AAC3B,OAAO,EAAE,IAAI,EAAoE,mBAAe"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* API key lifecycle management — issue, list, revoke. The partner authenticates every request with `X-Api-Key` (preferred) or `Authorization: Bearer <key>`; the server identifies the partner from the key and scopes all reads/writes to dealers owned by that partner.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Keys extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* List metadata for keys owned by the calling partner.
|
|
10
|
+
*
|
|
11
|
+
* Returns both active and revoked keys — partners can audit revoked keys via the
|
|
12
|
+
* `is_active` flag. Key material is never returned.
|
|
13
|
+
*/
|
|
14
|
+
list(options?: RequestOptions): APIPromise<KeyListResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Issue a new API key. Plaintext returned exactly once.
|
|
17
|
+
*
|
|
18
|
+
* Capability gate: caller's key must hold `can_issue_keys`. The bootstrap key
|
|
19
|
+
* handed to a partner by DealerMAX support carries this capability; keys minted
|
|
20
|
+
* here inherit the _same_ capabilities as the caller, so partners can never
|
|
21
|
+
* accidentally widen their own scope.
|
|
22
|
+
*/
|
|
23
|
+
issue(params: KeyIssueParams, options?: RequestOptions): APIPromise<KeyIssueResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Revoke a key. Cannot revoke the key currently authenticating the request.
|
|
26
|
+
*/
|
|
27
|
+
revoke(keyID: string, options?: RequestOptions): APIPromise<void>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Response envelope for `GET /v1/keys`.
|
|
31
|
+
*/
|
|
32
|
+
export interface KeyListResponse {
|
|
33
|
+
data: Array<KeyListResponse.Data>;
|
|
34
|
+
}
|
|
35
|
+
export declare namespace KeyListResponse {
|
|
36
|
+
/**
|
|
37
|
+
* Metadata-only representation of an API key. Safe to return on list calls.
|
|
38
|
+
*/
|
|
39
|
+
interface Data {
|
|
40
|
+
created_at: string;
|
|
41
|
+
expires_at: string | null;
|
|
42
|
+
is_active: boolean;
|
|
43
|
+
key_id: string;
|
|
44
|
+
key_prefix: string;
|
|
45
|
+
label: string;
|
|
46
|
+
last_used_at: string | null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* One-time response for `POST /v1/keys/issue`.
|
|
51
|
+
*
|
|
52
|
+
* The `key` field is plaintext and is never retrievable again. Callers must
|
|
53
|
+
* persist it immediately on receipt.
|
|
54
|
+
*/
|
|
55
|
+
export interface KeyIssueResponse {
|
|
56
|
+
created_at: string;
|
|
57
|
+
expires_at: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Plaintext key material. Returned ONCE — never retrievable again.
|
|
60
|
+
*/
|
|
61
|
+
key: string;
|
|
62
|
+
key_id: string;
|
|
63
|
+
key_prefix: string;
|
|
64
|
+
label: string;
|
|
65
|
+
}
|
|
66
|
+
export interface KeyIssueParams {
|
|
67
|
+
/**
|
|
68
|
+
* Body param: Human-readable identifier for this key, used for safe logging.
|
|
69
|
+
*/
|
|
70
|
+
label: string;
|
|
71
|
+
/**
|
|
72
|
+
* Body param: Optional expiry timestamp. Null = never expires until revoked.
|
|
73
|
+
*/
|
|
74
|
+
expires_at?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Header param
|
|
77
|
+
*/
|
|
78
|
+
'Idempotency-Key'?: string;
|
|
79
|
+
}
|
|
80
|
+
export declare namespace Keys {
|
|
81
|
+
export { type KeyListResponse as KeyListResponse, type KeyIssueResponse as KeyIssueResponse, type KeyIssueParams as KeyIssueParams, };
|
|
82
|
+
}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f,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* API key lifecycle management — issue, list, revoke. The partner authenticates every request with `X-Api-Key` (preferred) or `Authorization: Bearer <key>`; the server identifies the partner from the key and scopes all reads/writes to dealers owned by that partner.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Keys extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* List metadata for keys owned by the calling partner.
|
|
10
|
+
*
|
|
11
|
+
* Returns both active and revoked keys — partners can audit revoked keys via the
|
|
12
|
+
* `is_active` flag. Key material is never returned.
|
|
13
|
+
*/
|
|
14
|
+
list(options?: RequestOptions): APIPromise<KeyListResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Issue a new API key. Plaintext returned exactly once.
|
|
17
|
+
*
|
|
18
|
+
* Capability gate: caller's key must hold `can_issue_keys`. The bootstrap key
|
|
19
|
+
* handed to a partner by DealerMAX support carries this capability; keys minted
|
|
20
|
+
* here inherit the _same_ capabilities as the caller, so partners can never
|
|
21
|
+
* accidentally widen their own scope.
|
|
22
|
+
*/
|
|
23
|
+
issue(params: KeyIssueParams, options?: RequestOptions): APIPromise<KeyIssueResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Revoke a key. Cannot revoke the key currently authenticating the request.
|
|
26
|
+
*/
|
|
27
|
+
revoke(keyID: string, options?: RequestOptions): APIPromise<void>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Response envelope for `GET /v1/keys`.
|
|
31
|
+
*/
|
|
32
|
+
export interface KeyListResponse {
|
|
33
|
+
data: Array<KeyListResponse.Data>;
|
|
34
|
+
}
|
|
35
|
+
export declare namespace KeyListResponse {
|
|
36
|
+
/**
|
|
37
|
+
* Metadata-only representation of an API key. Safe to return on list calls.
|
|
38
|
+
*/
|
|
39
|
+
interface Data {
|
|
40
|
+
created_at: string;
|
|
41
|
+
expires_at: string | null;
|
|
42
|
+
is_active: boolean;
|
|
43
|
+
key_id: string;
|
|
44
|
+
key_prefix: string;
|
|
45
|
+
label: string;
|
|
46
|
+
last_used_at: string | null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* One-time response for `POST /v1/keys/issue`.
|
|
51
|
+
*
|
|
52
|
+
* The `key` field is plaintext and is never retrievable again. Callers must
|
|
53
|
+
* persist it immediately on receipt.
|
|
54
|
+
*/
|
|
55
|
+
export interface KeyIssueResponse {
|
|
56
|
+
created_at: string;
|
|
57
|
+
expires_at: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Plaintext key material. Returned ONCE — never retrievable again.
|
|
60
|
+
*/
|
|
61
|
+
key: string;
|
|
62
|
+
key_id: string;
|
|
63
|
+
key_prefix: string;
|
|
64
|
+
label: string;
|
|
65
|
+
}
|
|
66
|
+
export interface KeyIssueParams {
|
|
67
|
+
/**
|
|
68
|
+
* Body param: Human-readable identifier for this key, used for safe logging.
|
|
69
|
+
*/
|
|
70
|
+
label: string;
|
|
71
|
+
/**
|
|
72
|
+
* Body param: Optional expiry timestamp. Null = never expires until revoked.
|
|
73
|
+
*/
|
|
74
|
+
expires_at?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Header param
|
|
77
|
+
*/
|
|
78
|
+
'Idempotency-Key'?: string;
|
|
79
|
+
}
|
|
80
|
+
export declare namespace Keys {
|
|
81
|
+
export { type KeyListResponse as KeyListResponse, type KeyIssueResponse as KeyIssueResponse, type KeyIssueParams as KeyIssueParams, };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/resources/keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;OAKG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,eAAe,CAAC;IAI3D;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gBAAgB,CAAC;IAYrF;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAMlE;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,yBAAiB,eAAe,CAAC;IAC/B;;OAEG;IACH,UAAiB,IAAI;QACnB,UAAU,EAAE,MAAM,CAAC;QAEnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAE1B,SAAS,EAAE,OAAO,CAAC;QAEnB,MAAM,EAAE,MAAM,CAAC;QAEf,UAAU,EAAE,MAAM,CAAC;QAEnB,KAAK,EAAE,MAAM,CAAC;QAEd,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B;CACF;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC;IAEf,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.Keys = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* API key lifecycle management — issue, list, revoke. The partner authenticates every request with `X-Api-Key` (preferred) or `Authorization: Bearer <key>`; the server identifies the partner from the key and scopes all reads/writes to dealers owned by that partner.
|
|
10
|
+
*/
|
|
11
|
+
class Keys extends resource_1.APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* List metadata for keys owned by the calling partner.
|
|
14
|
+
*
|
|
15
|
+
* Returns both active and revoked keys — partners can audit revoked keys via the
|
|
16
|
+
* `is_active` flag. Key material is never returned.
|
|
17
|
+
*/
|
|
18
|
+
list(options) {
|
|
19
|
+
return this._client.get('/v1/keys', options);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Issue a new API key. Plaintext returned exactly once.
|
|
23
|
+
*
|
|
24
|
+
* Capability gate: caller's key must hold `can_issue_keys`. The bootstrap key
|
|
25
|
+
* handed to a partner by DealerMAX support carries this capability; keys minted
|
|
26
|
+
* here inherit the _same_ capabilities as the caller, so partners can never
|
|
27
|
+
* accidentally widen their own scope.
|
|
28
|
+
*/
|
|
29
|
+
issue(params, options) {
|
|
30
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
31
|
+
return this._client.post('/v1/keys/issue', {
|
|
32
|
+
body,
|
|
33
|
+
...options,
|
|
34
|
+
headers: (0, headers_1.buildHeaders)([
|
|
35
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
36
|
+
options?.headers,
|
|
37
|
+
]),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Revoke a key. Cannot revoke the key currently authenticating the request.
|
|
42
|
+
*/
|
|
43
|
+
revoke(keyID, options) {
|
|
44
|
+
return this._client.delete((0, path_1.path) `/v1/keys/${keyID}`, {
|
|
45
|
+
...options,
|
|
46
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.Keys = Keys;
|
|
51
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/resources/keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;OAKG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,MAAsB,EAAE,OAAwB;QACpD,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,YAAY,KAAK,EAAE,EAAE;YAClD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAxCD,oBAwCC"}
|