partnermax 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -47
- package/LICENSE +201 -201
- package/README.md +370 -370
- package/api-promise.js +1 -1
- package/client.js +1 -1
- package/client.mjs +1 -1
- package/core/api-promise.js +1 -1
- package/core/api-promise.mjs +1 -1
- package/error.js +1 -1
- package/package.json +9 -15
- package/resource.js +1 -1
- package/resources/dealers/dealers.js +1 -1
- package/resources/dealers/nlt/nlt.js +1 -1
- package/resources/dealers/nlt.js +1 -1
- package/resources/dealers/vehicles/vehicles.js +1 -1
- package/resources/dealers/vehicles.js +1 -1
- package/resources/dealers.js +1 -1
- package/resources.js +1 -1
- package/src/api-promise.ts +2 -2
- package/src/client.ts +841 -841
- package/src/core/README.md +3 -3
- package/src/core/api-promise.ts +92 -92
- package/src/core/error.ts +130 -130
- package/src/core/resource.ts +11 -11
- package/src/core/uploads.ts +2 -2
- package/src/error.ts +2 -2
- package/src/index.ts +22 -22
- package/src/internal/README.md +3 -3
- package/src/internal/builtin-types.ts +93 -93
- package/src/internal/detect-platform.ts +196 -196
- package/src/internal/errors.ts +33 -33
- package/src/internal/headers.ts +97 -97
- package/src/internal/parse.ts +56 -56
- package/src/internal/request-options.ts +91 -91
- package/src/internal/shim-types.ts +26 -26
- package/src/internal/shims.ts +107 -107
- package/src/internal/to-file.ts +154 -154
- package/src/internal/types.ts +93 -93
- package/src/internal/uploads.ts +187 -187
- package/src/internal/utils/base64.ts +40 -40
- package/src/internal/utils/bytes.ts +32 -32
- package/src/internal/utils/env.ts +18 -18
- package/src/internal/utils/log.ts +128 -128
- package/src/internal/utils/path.ts +88 -88
- package/src/internal/utils/query.ts +23 -23
- package/src/internal/utils/sleep.ts +3 -3
- package/src/internal/utils/uuid.ts +17 -17
- package/src/internal/utils/values.ts +105 -105
- package/src/internal/utils.ts +9 -9
- package/src/lib/.keep +4 -4
- package/src/resource.ts +2 -2
- package/src/resources/dealers/dealers.ts +348 -348
- package/src/resources/dealers/index.ts +28 -28
- package/src/resources/dealers/nlt/index.ts +11 -11
- package/src/resources/dealers/nlt/nlt.ts +29 -29
- package/src/resources/dealers/nlt/offers.ts +427 -427
- package/src/resources/dealers/nlt-settings.ts +269 -269
- package/src/resources/dealers/nlt.ts +3 -3
- package/src/resources/dealers/vehicles/images.ts +153 -153
- package/src/resources/dealers/vehicles/index.ts +25 -25
- package/src/resources/dealers/vehicles/vehicles.ts +796 -796
- package/src/resources/dealers/vehicles.ts +3 -3
- package/src/resources/dealers.ts +3 -3
- package/src/resources/index.ts +12 -12
- package/src/resources/keys.ts +128 -128
- package/src/resources.ts +1 -1
- package/src/tsconfig.json +11 -11
- package/src/uploads.ts +2 -2
- package/src/version.ts +1 -1
- package/uploads.js +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export * from './vehicles/index';
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './vehicles/index';
|
package/src/resources/dealers.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export * from './dealers/index';
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './dealers/index';
|
package/src/resources/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
Dealers,
|
|
5
|
-
type DealerDetail,
|
|
6
|
-
type DealerSummary,
|
|
7
|
-
type DealerListResponse,
|
|
8
|
-
type DealerCreateParams,
|
|
9
|
-
type DealerUpdateParams,
|
|
10
|
-
type DealerListParams,
|
|
11
|
-
} from './dealers/dealers';
|
|
12
|
-
export { Keys, type KeyListResponse, type KeyIssueResponse, type KeyIssueParams } from './keys';
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Dealers,
|
|
5
|
+
type DealerDetail,
|
|
6
|
+
type DealerSummary,
|
|
7
|
+
type DealerListResponse,
|
|
8
|
+
type DealerCreateParams,
|
|
9
|
+
type DealerUpdateParams,
|
|
10
|
+
type DealerListParams,
|
|
11
|
+
} from './dealers/dealers';
|
|
12
|
+
export { Keys, type KeyListResponse, type KeyIssueResponse, type KeyIssueParams } from './keys';
|
package/src/resources/keys.ts
CHANGED
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../core/resource';
|
|
4
|
-
import { APIPromise } from '../core/api-promise';
|
|
5
|
-
import { buildHeaders } from '../internal/headers';
|
|
6
|
-
import { RequestOptions } from '../internal/request-options';
|
|
7
|
-
import { path } from '../internal/utils/path';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 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.
|
|
11
|
-
*/
|
|
12
|
-
export class Keys extends APIResource {
|
|
13
|
-
/**
|
|
14
|
-
* List metadata for keys owned by the calling partner.
|
|
15
|
-
*
|
|
16
|
-
* Returns both active and revoked keys — partners can audit revoked keys via the
|
|
17
|
-
* `is_active` flag. Key material is never returned.
|
|
18
|
-
*/
|
|
19
|
-
list(options?: RequestOptions): APIPromise<KeyListResponse> {
|
|
20
|
-
return this._client.get('/v1/keys', options);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Issue a new API key. Plaintext returned exactly once.
|
|
25
|
-
*
|
|
26
|
-
* Capability gate: caller's key must hold `can_issue_keys`. The bootstrap key
|
|
27
|
-
* handed to a partner by DealerMAX support carries this capability; keys minted
|
|
28
|
-
* here inherit the _same_ capabilities as the caller, so partners can never
|
|
29
|
-
* accidentally widen their own scope.
|
|
30
|
-
*/
|
|
31
|
-
issue(params: KeyIssueParams, options?: RequestOptions): APIPromise<KeyIssueResponse> {
|
|
32
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
33
|
-
return this._client.post('/v1/keys/issue', {
|
|
34
|
-
body,
|
|
35
|
-
...options,
|
|
36
|
-
headers: buildHeaders([
|
|
37
|
-
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
38
|
-
options?.headers,
|
|
39
|
-
]),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Revoke a key. Cannot revoke the key currently authenticating the request.
|
|
45
|
-
*/
|
|
46
|
-
revoke(keyID: string, options?: RequestOptions): APIPromise<void> {
|
|
47
|
-
return this._client.delete(path`/v1/keys/${keyID}`, {
|
|
48
|
-
...options,
|
|
49
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Response envelope for `GET /v1/keys`.
|
|
56
|
-
*/
|
|
57
|
-
export interface KeyListResponse {
|
|
58
|
-
data: Array<KeyListResponse.Data>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export namespace KeyListResponse {
|
|
62
|
-
/**
|
|
63
|
-
* Metadata-only representation of an API key. Safe to return on list calls.
|
|
64
|
-
*/
|
|
65
|
-
export interface Data {
|
|
66
|
-
created_at: string;
|
|
67
|
-
|
|
68
|
-
expires_at: string | null;
|
|
69
|
-
|
|
70
|
-
is_active: boolean;
|
|
71
|
-
|
|
72
|
-
key_id: string;
|
|
73
|
-
|
|
74
|
-
key_prefix: string;
|
|
75
|
-
|
|
76
|
-
label: string;
|
|
77
|
-
|
|
78
|
-
last_used_at: string | null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* One-time response for `POST /v1/keys/issue`.
|
|
84
|
-
*
|
|
85
|
-
* The `key` field is plaintext and is never retrievable again. Callers must
|
|
86
|
-
* persist it immediately on receipt.
|
|
87
|
-
*/
|
|
88
|
-
export interface KeyIssueResponse {
|
|
89
|
-
created_at: string;
|
|
90
|
-
|
|
91
|
-
expires_at: string | null;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Plaintext key material. Returned ONCE — never retrievable again.
|
|
95
|
-
*/
|
|
96
|
-
key: string;
|
|
97
|
-
|
|
98
|
-
key_id: string;
|
|
99
|
-
|
|
100
|
-
key_prefix: string;
|
|
101
|
-
|
|
102
|
-
label: string;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface KeyIssueParams {
|
|
106
|
-
/**
|
|
107
|
-
* Body param: Human-readable identifier for this key, used for safe logging.
|
|
108
|
-
*/
|
|
109
|
-
label: string;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Body param: Optional expiry timestamp. Null = never expires until revoked.
|
|
113
|
-
*/
|
|
114
|
-
expires_at?: string | null;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Header param
|
|
118
|
-
*/
|
|
119
|
-
'Idempotency-Key'?: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export declare namespace Keys {
|
|
123
|
-
export {
|
|
124
|
-
type KeyListResponse as KeyListResponse,
|
|
125
|
-
type KeyIssueResponse as KeyIssueResponse,
|
|
126
|
-
type KeyIssueParams as KeyIssueParams,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 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.
|
|
11
|
+
*/
|
|
12
|
+
export class Keys extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* List metadata for keys owned by the calling partner.
|
|
15
|
+
*
|
|
16
|
+
* Returns both active and revoked keys — partners can audit revoked keys via the
|
|
17
|
+
* `is_active` flag. Key material is never returned.
|
|
18
|
+
*/
|
|
19
|
+
list(options?: RequestOptions): APIPromise<KeyListResponse> {
|
|
20
|
+
return this._client.get('/v1/keys', options);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Issue a new API key. Plaintext returned exactly once.
|
|
25
|
+
*
|
|
26
|
+
* Capability gate: caller's key must hold `can_issue_keys`. The bootstrap key
|
|
27
|
+
* handed to a partner by DealerMAX support carries this capability; keys minted
|
|
28
|
+
* here inherit the _same_ capabilities as the caller, so partners can never
|
|
29
|
+
* accidentally widen their own scope.
|
|
30
|
+
*/
|
|
31
|
+
issue(params: KeyIssueParams, options?: RequestOptions): APIPromise<KeyIssueResponse> {
|
|
32
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
33
|
+
return this._client.post('/v1/keys/issue', {
|
|
34
|
+
body,
|
|
35
|
+
...options,
|
|
36
|
+
headers: buildHeaders([
|
|
37
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
38
|
+
options?.headers,
|
|
39
|
+
]),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Revoke a key. Cannot revoke the key currently authenticating the request.
|
|
45
|
+
*/
|
|
46
|
+
revoke(keyID: string, options?: RequestOptions): APIPromise<void> {
|
|
47
|
+
return this._client.delete(path`/v1/keys/${keyID}`, {
|
|
48
|
+
...options,
|
|
49
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Response envelope for `GET /v1/keys`.
|
|
56
|
+
*/
|
|
57
|
+
export interface KeyListResponse {
|
|
58
|
+
data: Array<KeyListResponse.Data>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export namespace KeyListResponse {
|
|
62
|
+
/**
|
|
63
|
+
* Metadata-only representation of an API key. Safe to return on list calls.
|
|
64
|
+
*/
|
|
65
|
+
export interface Data {
|
|
66
|
+
created_at: string;
|
|
67
|
+
|
|
68
|
+
expires_at: string | null;
|
|
69
|
+
|
|
70
|
+
is_active: boolean;
|
|
71
|
+
|
|
72
|
+
key_id: string;
|
|
73
|
+
|
|
74
|
+
key_prefix: string;
|
|
75
|
+
|
|
76
|
+
label: string;
|
|
77
|
+
|
|
78
|
+
last_used_at: string | null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* One-time response for `POST /v1/keys/issue`.
|
|
84
|
+
*
|
|
85
|
+
* The `key` field is plaintext and is never retrievable again. Callers must
|
|
86
|
+
* persist it immediately on receipt.
|
|
87
|
+
*/
|
|
88
|
+
export interface KeyIssueResponse {
|
|
89
|
+
created_at: string;
|
|
90
|
+
|
|
91
|
+
expires_at: string | null;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Plaintext key material. Returned ONCE — never retrievable again.
|
|
95
|
+
*/
|
|
96
|
+
key: string;
|
|
97
|
+
|
|
98
|
+
key_id: string;
|
|
99
|
+
|
|
100
|
+
key_prefix: string;
|
|
101
|
+
|
|
102
|
+
label: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface KeyIssueParams {
|
|
106
|
+
/**
|
|
107
|
+
* Body param: Human-readable identifier for this key, used for safe logging.
|
|
108
|
+
*/
|
|
109
|
+
label: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Body param: Optional expiry timestamp. Null = never expires until revoked.
|
|
113
|
+
*/
|
|
114
|
+
expires_at?: string | null;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Header param
|
|
118
|
+
*/
|
|
119
|
+
'Idempotency-Key'?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export declare namespace Keys {
|
|
123
|
+
export {
|
|
124
|
+
type KeyListResponse as KeyListResponse,
|
|
125
|
+
type KeyIssueResponse as KeyIssueResponse,
|
|
126
|
+
type KeyIssueParams as KeyIssueParams,
|
|
127
|
+
};
|
|
128
|
+
}
|
package/src/resources.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './resources/index';
|
|
1
|
+
export * from './resources/index';
|
package/src/tsconfig.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
// this config is included in the published src directory to prevent TS errors
|
|
3
|
-
// from appearing when users go to source, and VSCode opens the source .ts file
|
|
4
|
-
// via declaration maps
|
|
5
|
-
"include": ["index.ts"],
|
|
6
|
-
"compilerOptions": {
|
|
7
|
-
"target": "ES2015",
|
|
8
|
-
"lib": ["DOM", "DOM.Iterable", "ES2018"],
|
|
9
|
-
"moduleResolution": "node"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// this config is included in the published src directory to prevent TS errors
|
|
3
|
+
// from appearing when users go to source, and VSCode opens the source .ts file
|
|
4
|
+
// via declaration maps
|
|
5
|
+
"include": ["index.ts"],
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"target": "ES2015",
|
|
8
|
+
"lib": ["DOM", "DOM.Iterable", "ES2018"],
|
|
9
|
+
"moduleResolution": "node"
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/uploads.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** @deprecated Import from ./core/uploads instead */
|
|
2
|
-
export * from './core/uploads';
|
|
1
|
+
/** @deprecated Import from ./core/uploads instead */
|
|
2
|
+
export * from './core/uploads';
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.
|
|
1
|
+
export const VERSION = '0.2.1'; // x-release-please-version
|
package/uploads.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("./internal
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
4
|
/** @deprecated Import from ./core/uploads instead */
|
|
5
5
|
tslib_1.__exportStar(require("./core/uploads.js"), exports);
|
|
6
6
|
//# sourceMappingURL=uploads.js.map
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.2.
|
|
1
|
+
export const VERSION = '0.2.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|