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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/tesla/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tesla",
"displayName": "Tesla Fleet Management API",
"version": "0.4.0",
"version": "0.4.1",
"description": "Integrate and consume the APIMatic-generated Tesla Fleet Management API SDK — bundled skills for C#/.NET, Python, TypeScript.",
"author": {
"name": "APIMatic",
Expand Down
2 changes: 1 addition & 1 deletion plugins/tesla/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tesla",
"version": "0.4.0",
"version": "0.4.1",
"description": "Integrate and consume the APIMatic-generated Tesla Fleet Management API SDK — bundled skills for C#/.NET, Python, TypeScript.",
"skills": "./skills",
"interface": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/tesla/.cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tesla",
"displayName": "Tesla Fleet Management API",
"version": "0.4.0",
"version": "0.4.1",
"description": "Integrate and consume the APIMatic-generated Tesla Fleet Management API SDK — bundled skills for C#/.NET, Python, TypeScript.",
"author": {
"name": "APIMatic",
Expand Down
2 changes: 1 addition & 1 deletion plugins/tesla/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tesla",
"displayName": "Tesla Fleet Management API",
"version": "0.4.0",
"version": "0.4.1",
"description": "Integrate and consume the APIMatic-generated Tesla Fleet Management API SDK — bundled skills for C#/.NET, Python, TypeScript.",
"author": {
"name": "APIMatic",
Expand Down
4 changes: 2 additions & 2 deletions plugins/tesla/skills/dotnet/dotnet-authentication/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ options.ThirdpartytokenAuthorizationCode = new OAuth2AuthorizationCodeCredential
};
```

The SDK sends the user to `https://auth.tesla.com/oauth2/v3/authorize`, exchanges the returned code for a token at `https://auth.tesla.com/oauth2/v3/token`, and refreshes it when it expires; if the refresh fails, it invokes `PromptForAuthorizationCode` again to re-authorize.
The SDK sends the user to `https://auth.tesla.com/oauth2/v3/authorize`, exchanges the returned code for a token at `https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/token`, and refreshes it when it expires; if the refresh fails, it invokes `PromptForAuthorizationCode` again to re-authorize.

`PromptForAuthorizationCode` runs inside the call that needs a new token, so it must not make an SDK call that uses this scheme. It counts against the per-attempt `options.Retry.Timeout`, 100 s by default, and a timed-out attempt on a retryable call is retried and prompts again. A prompt that throws anything but `OperationCanceledException` fails the call with `AuthSchemeException`. `State` is sent as you set it and never checked, so your redirect handler must verify it.

Expand All @@ -66,7 +66,7 @@ options.ThirdpartytokenClientCredentials = new OAuth2ClientCredentials
};
```

The SDK fetches the token from `https://auth.tesla.com/oauth2/v3/token` and caches it, acquiring a fresh one when it expires; on a `401` it drops the cached token, acquires a new one and re-sends the call once (the upload exception is under **Token caching & refresh**). The token request carries the client id and secret in the form body.
The SDK fetches the token from `https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3/token` and caches it, acquiring a fresh one when it expires; on a `401` it drops the cached token, acquires a new one and re-sends the call once (the upload exception is under **Token caching & refresh**). The token request carries the client id and secret in the form body.

## Credential providers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Usage companions: `dotnet-client-initialization`, `dotnet-authentication`, `dotn
| Client class | `TeslaFleetManagementApiClient` |
| Options class | `TeslaFleetManagementApiClientOptions` |
| Auth | **Bearer** token — set `BearerAuth`<br>**OAuth 2.0** authorization code — set `ThirdpartytokenAuthorizationCode`<br>**OAuth 2.0** client credentials — set `ThirdpartytokenClientCredentials` |
| Environments | `ServerEnvironment.Production` *(default)*<br>base URL per server group (2 groups): `sdk-map.md` *Servers & auth* |
| Environments | `ServerEnvironment.Production` *(default)*<br>base URL per server group (3 groups): `sdk-map.md` *Servers & auth* |
| Log environment variable | `TESLA_FLEET_MANAGEMENT_API_LOG` |
| Target framework | `netstandard2.0` (C# `LangVersion 14`) |

Expand Down
11 changes: 6 additions & 5 deletions plugins/tesla/skills/python/python-getting-started/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This page owns the SDK's *identity and surface* (install, imports, controllers,
| Async client class | `AsyncTeslaFleetManagementApiClient` (alias `AsyncClient`) |
| Client construction | **keyword-only**: `server_config` · `timeout` (default `30.0`) · `retry_options` · `logging_options` · `bearer_auth` · `thirdpartytoken_authorization_code` · `thirdpartytoken_authorization_code_token_source` · `thirdpartytoken_client_credentials` · `thirdpartytoken_client_credentials_token_source`, and the transport override — `custom_http_client` on the sync client, `custom_async_http_client` on the async one (the names differ) |
| Auth | **Bearer** token — set `bearer_auth` · **OAuth 2.0** authorization code — set `thirdpartytoken_authorization_code` · **OAuth 2.0** client credentials — set `thirdpartytoken_client_credentials` |
| Environments | one environment; 2 named servers configured through `server_config` |
| Environments | one environment; 3 named servers configured through `server_config` |
| Base-URL config | `ServerConfig` (`tesla_fleet_management_api/server/server_config.py`) |
| Python floor | **`>=3.10`** (classifiers list `3.10–3.14`) |
| Runtime dependencies | `httpx2 (>=2.13.1,<3.0.0)` · `certifi (>=2024.7.4)` · `pydantic[email] (>=2.11.0,<3.0.0)` · `typing-extensions (>=4.13.0,<5.0.0)` |
Expand Down Expand Up @@ -74,17 +74,18 @@ Everything else comes from its own subpackage:

## Servers — one config object, several servers

This SDK has 2 named servers and a single environment, so the constructor takes `server_config: ServerConfigOrDict | None = None` rather than a bare `base_url`. Each server is a field on that config:
This SDK has 3 named servers and a single environment, so the constructor takes `server_config: ServerConfigOrDict | None = None` rather than a bare `base_url`. Each server is a field on that config:

| Server field | Base URL |
| --- | --- |
| `default` | `https://fleet-api.prd.na.vn.cloud.tesla.com` |
| `auth_server` | `https://auth.tesla.com/oauth2/v3` |
| `access_token_server` | `https://fleet-auth.prd.vn.cloud.tesla.com/oauth2/v3` |

Consequences to state on every contract sheet that touches configuration:

- Omitting `server_config` falls through to the config's own defaults rather than writing `None` over them.
- The token endpoint (`/token`) resolves against the `auth_server` server rather than a client-wide base URL, so `server_config` is what moves token traffic.
- The token endpoint (`/token`) resolves against the `access_token_server` server rather than a client-wide base URL, so `server_config` is what moves token traffic.
- `ServerConfig` is a frozen pydantic model with `extra="forbid"`: a misspelled keyword raises `ValidationError` at construction rather than being ignored.
- `timeout` is validated too — the base client raises `ValueError` for any non-positive value.

Expand All @@ -98,7 +99,7 @@ from tesla_fleet_management_api import Client
client = Client(bearer_auth="<bearer_auth>")
```

OAuth 2.0 authorization code, exposed as the client's `thirdpartytoken_authorization_code=` keyword taking `AuthorizationCodeCredentials` **or a plain dict**. The client fetches and caches the bearer token itself, lazily, from `/token` on the `auth_server` server.
OAuth 2.0 authorization code, exposed as the client's `thirdpartytoken_authorization_code=` keyword taking `AuthorizationCodeCredentials` **or a plain dict**. The client fetches and caches the bearer token itself, lazily, from `/token` on the `access_token_server` server.

```python
from tesla_fleet_management_api import Client
Expand All @@ -111,7 +112,7 @@ client = Client(thirdpartytoken_authorization_code=AuthorizationCodeCredentials(
client = Client(thirdpartytoken_authorization_code={"client_id": "…", "client_secret": "…", "redirect_uri": "…", "prompt_for_authorization_code": prompt}) # equivalent
```

OAuth 2.0 client credentials, exposed as the client's `thirdpartytoken_client_credentials=` keyword taking `ClientCredentials` **or a plain dict**. The client fetches and caches the bearer token itself, lazily, from `/token` on the `auth_server` server.
OAuth 2.0 client credentials, exposed as the client's `thirdpartytoken_client_credentials=` keyword taking `ClientCredentials` **or a plain dict**. The client fetches and caches the bearer token itself, lazily, from `/token` on the `access_token_server` server.

```python
from tesla_fleet_management_api import Client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Verified against `package.json` and `sdk-map.md` of the package at version `1.0.
| Options type | `ClientOptions` (`src/client-options.ts`) |
| Client construction | `new TeslaFleetManagementApiClient(options: ClientOptions = {})` — the argument is optional, as is **every** field on it, so `new TeslaFleetManagementApiClient()` compiles. Fields: `serverOptions` · `retry` · `logging` · `fetch` · `bearerAuth` · `thirdpartytokenAuthorizationCode` · `thirdpartytokenAuthorizationCodeStrategy` · `thirdpartytokenClientCredentials` · `thirdpartytokenClientCredentialsStrategy`. `retry` is the `RetryOptions` policy |
| Auth | **Bearer token** — set `ClientOptions.bearerAuth`<br>**OAuth 2 authorization code** — set `ClientOptions.thirdpartytokenAuthorizationCode`<br>**OAuth 2 client credentials** — set `ClientOptions.thirdpartytokenClientCredentials` |
| Environments | no selector — one environment; 2 server groups |
| Environments | no selector — one environment; 3 server groups |
| Base-URL config | `serverOptions.<group>.baseUrl` (`src/servers.ts`) |
| Log environment variable | `TESLA_FLEET_MANAGEMENT_API_CLIENT_LOG` |
| Node floor | `>=20.3` (`engines.node`) |
Expand Down Expand Up @@ -95,8 +95,8 @@ const client = new TeslaFleetManagementApiClient({

| Flow | Token endpoint | Client credentials travel |
| --- | --- | --- |
| `thirdpartytokenAuthorizationCode` | `authServer` + `/token` | in the token request's form body |
| `thirdpartytokenClientCredentials` | `authServer` + `/token` | in the token request's form body |
| `thirdpartytokenAuthorizationCode` | `accessTokenServer` + `/token` | in the token request's form body |
| `thirdpartytokenClientCredentials` | `accessTokenServer` + `/token` | in the token request's form body |

`thirdpartytokenAuthorizationCodeStrategy`, `thirdpartytokenClientCredentialsStrategy` on `ClientOptions` substitute the whole token request. The **token endpoint follows the base URL of its group** (named in the table), so it tracks the environment and any override.

Expand Down
Loading