@espressif/rainmaker-admin-sdk 1.4.0 → 1.5.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 +25 -0
- package/dist/cjs/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.cjs +2 -1
- package/dist/cjs/utils/error/parser.cjs +1 -1
- package/dist/esm/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.js +2 -1
- package/dist/esm/utils/error/parser.js +1 -1
- package/dist/types/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.d.ts +6 -4
- package/dist/types/types/deployment_capability.d.ts +6 -5
- package/dist/types/types/input.d.ts +1 -1
- package/dist/types/utils/error/parser.d.ts +2 -1
- package/dist/types-cjs/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.d.cts +6 -4
- package/dist/types-cjs/types/deployment_capability.d.cts +6 -5
- package/dist/types-cjs/types/input.d.cts +1 -1
- package/dist/types-cjs/utils/error/parser.d.cts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and follows the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.
|
|
5
5
|
|
|
6
|
+
## [1.5.0] - 2026-10-08
|
|
7
|
+
|
|
8
|
+
Minor release that lets callers fetch a single deployment capability by name,
|
|
9
|
+
which the dashboards use to read the ESP Insights URL. Calling
|
|
10
|
+
`getDeploymentCapabilities()` without arguments is unchanged; the two type
|
|
11
|
+
corrections below are fixes, one of which changes `errorCode` at runtime.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `ESPRMAdminDeploymentCapability.getDeploymentCapabilities({ name })` fetches
|
|
16
|
+
a single capability by name (`GET admin/deployment_capabilities?name=`).
|
|
17
|
+
The parameter is optional; calling it without arguments is unchanged. The
|
|
18
|
+
backend rejects an unknown name with error code `122005`.
|
|
19
|
+
- Type `GetDeploymentCapabilitiesParams`.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- `GetDeploymentCapabilitiesResponse` is now `DeploymentCapabilityInfo[]`. The
|
|
24
|
+
backend has always returned a top-level array; the old
|
|
25
|
+
`{ capabilities: [...] }` shape never matched the response.
|
|
26
|
+
- `ESPAPIError.errorCode` is now always a string, as its type declares. The
|
|
27
|
+
RainMaker backend sends `error_code` as a number, which the SDK passed
|
|
28
|
+
through unchanged, so `errorCode === "122005"` was false at runtime. Callers
|
|
29
|
+
that compared against a number must compare against the string instead.
|
|
30
|
+
|
|
6
31
|
## [1.4.0] - 2026-10-07
|
|
7
32
|
|
|
8
33
|
Minor release that adds OAuth 2.0 authorization-code login, so dashboards can
|
|
@@ -10,10 +10,11 @@ var ESPRMAPIManager = require('../../services/ESPRMAPIManager.cjs');
|
|
|
10
10
|
var constants = require('../../utils/constants.cjs');
|
|
11
11
|
|
|
12
12
|
ESPRMAdminDeploymentCapability.ESPRMAdminDeploymentCapability.prototype.getDeploymentCapabilities =
|
|
13
|
-
async function () {
|
|
13
|
+
async function (params) {
|
|
14
14
|
const requestConfig = {
|
|
15
15
|
url: constants.APIEndpoints.ADMIN_DEPLOYMENT_CAPABILITIES,
|
|
16
16
|
method: constants.HTTPMethods.GET,
|
|
17
|
+
...(params && { params }),
|
|
17
18
|
};
|
|
18
19
|
const response = await ESPRMAPIManager.ESPRMAPIManager.authorizeRequest(requestConfig);
|
|
19
20
|
return response;
|
|
@@ -11,7 +11,7 @@ const parseAPIErrorResponse = (error, statusCode) => {
|
|
|
11
11
|
let description = "An error has occurred";
|
|
12
12
|
if (error) {
|
|
13
13
|
status = error.status ?? "";
|
|
14
|
-
errorCode = error.error_code ?? error.error ?? "";
|
|
14
|
+
errorCode = String(error.error_code ?? error.error ?? "");
|
|
15
15
|
description =
|
|
16
16
|
error.description ?? error.error_description ?? "An error has occurred";
|
|
17
17
|
}
|
|
@@ -8,10 +8,11 @@ import { ESPRMAPIManager } from '../../services/ESPRMAPIManager.js';
|
|
|
8
8
|
import { HTTPMethods, APIEndpoints } from '../../utils/constants.js';
|
|
9
9
|
|
|
10
10
|
ESPRMAdminDeploymentCapability.prototype.getDeploymentCapabilities =
|
|
11
|
-
async function () {
|
|
11
|
+
async function (params) {
|
|
12
12
|
const requestConfig = {
|
|
13
13
|
url: APIEndpoints.ADMIN_DEPLOYMENT_CAPABILITIES,
|
|
14
14
|
method: HTTPMethods.GET,
|
|
15
|
+
...(params && { params }),
|
|
15
16
|
};
|
|
16
17
|
const response = await ESPRMAPIManager.authorizeRequest(requestConfig);
|
|
17
18
|
return response;
|
|
@@ -9,7 +9,7 @@ const parseAPIErrorResponse = (error, statusCode) => {
|
|
|
9
9
|
let description = "An error has occurred";
|
|
10
10
|
if (error) {
|
|
11
11
|
status = error.status ?? "";
|
|
12
|
-
errorCode = error.error_code ?? error.error ?? "";
|
|
12
|
+
errorCode = String(error.error_code ?? error.error ?? "");
|
|
13
13
|
description =
|
|
14
14
|
error.description ?? error.error_description ?? "An error has occurred";
|
|
15
15
|
}
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { GetDeploymentCapabilitiesResponse } from "../../types/deployment_capability.js";
|
|
6
|
+
import { GetDeploymentCapabilitiesParams, GetDeploymentCapabilitiesResponse } from "../../types/deployment_capability.js";
|
|
7
7
|
declare module "../../ESPRMAdminDeploymentCapability.js" {
|
|
8
8
|
interface ESPRMAdminDeploymentCapability {
|
|
9
9
|
/**
|
|
10
|
-
* Retrieves the
|
|
10
|
+
* Retrieves the deployment capabilities of the current deployment.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @param params - Optional filter. Pass `name` to fetch a single capability.
|
|
13
|
+
* @returns The matching capabilities. The backend rejects an unknown `name`
|
|
14
|
+
* with error code 122005 instead of returning an empty list.
|
|
13
15
|
*/
|
|
14
|
-
getDeploymentCapabilities(): Promise<GetDeploymentCapabilitiesResponse>;
|
|
16
|
+
getDeploymentCapabilities(params?: GetDeploymentCapabilitiesParams): Promise<GetDeploymentCapabilitiesResponse>;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
@@ -17,9 +17,10 @@ export interface DeploymentCapabilityInfo {
|
|
|
17
17
|
/** The capability value. */
|
|
18
18
|
value?: string;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
21
|
-
export interface
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
[key: string]: unknown;
|
|
20
|
+
/** Query parameters for fetching deployment capabilities. */
|
|
21
|
+
export interface GetDeploymentCapabilitiesParams {
|
|
22
|
+
/** Fetch only the capability with this name. */
|
|
23
|
+
name?: string;
|
|
25
24
|
}
|
|
25
|
+
/** Deployment capabilities, returned by the backend as a top-level array. */
|
|
26
|
+
export type GetDeploymentCapabilitiesResponse = DeploymentCapabilityInfo[];
|
|
@@ -49,7 +49,7 @@ export type { GetMailFailuresParams } from "./mail_failure.js";
|
|
|
49
49
|
export type { UpdateTermsPolicyRequest, GetTermsPolicyParams, DeleteTermsPolicyParams, } from "./terms_policy.js";
|
|
50
50
|
export type { AddCloudwatchLogUserRequest } from "./cloudwatch_log.js";
|
|
51
51
|
export type { UpdateLogConfigRequest } from "./log_config.js";
|
|
52
|
-
export type { UpdateDeploymentCapabilityRequest } from "./deployment_capability.js";
|
|
52
|
+
export type { GetDeploymentCapabilitiesParams, UpdateDeploymentCapabilityRequest, } from "./deployment_capability.js";
|
|
53
53
|
export type { GetAPIStatisticsParams } from "./api_statistics.js";
|
|
54
54
|
export type { GetMQTTStatisticsParams } from "./mqtt_statistics.js";
|
|
55
55
|
export type { CreateMatterAuthRequest, CreateMatterBatchRequest, UpdateMatterBatchRequest, GetMatterBatchParams, GetMatterBatchNodesParams, } from "./matter.js";
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import { ESPAPIError } from "../../types/api.js";
|
|
7
7
|
interface RawAPIErrorBody {
|
|
8
8
|
status?: string;
|
|
9
|
-
|
|
9
|
+
/** The RainMaker backend sends a number; some endpoints send a string. */
|
|
10
|
+
error_code?: string | number;
|
|
10
11
|
description?: string;
|
|
11
12
|
/** RFC 6749 error code, returned by the OAuth endpoints instead of `error_code`. */
|
|
12
13
|
error?: string;
|
package/dist/types-cjs/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.d.cts
CHANGED
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { GetDeploymentCapabilitiesResponse } from "../../types/deployment_capability.cjs";
|
|
6
|
+
import { GetDeploymentCapabilitiesParams, GetDeploymentCapabilitiesResponse } from "../../types/deployment_capability.cjs";
|
|
7
7
|
declare module "../../ESPRMAdminDeploymentCapability.cjs" {
|
|
8
8
|
interface ESPRMAdminDeploymentCapability {
|
|
9
9
|
/**
|
|
10
|
-
* Retrieves the
|
|
10
|
+
* Retrieves the deployment capabilities of the current deployment.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @param params - Optional filter. Pass `name` to fetch a single capability.
|
|
13
|
+
* @returns The matching capabilities. The backend rejects an unknown `name`
|
|
14
|
+
* with error code 122005 instead of returning an empty list.
|
|
13
15
|
*/
|
|
14
|
-
getDeploymentCapabilities(): Promise<GetDeploymentCapabilitiesResponse>;
|
|
16
|
+
getDeploymentCapabilities(params?: GetDeploymentCapabilitiesParams): Promise<GetDeploymentCapabilitiesResponse>;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
@@ -17,9 +17,10 @@ export interface DeploymentCapabilityInfo {
|
|
|
17
17
|
/** The capability value. */
|
|
18
18
|
value?: string;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
21
|
-
export interface
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
[key: string]: unknown;
|
|
20
|
+
/** Query parameters for fetching deployment capabilities. */
|
|
21
|
+
export interface GetDeploymentCapabilitiesParams {
|
|
22
|
+
/** Fetch only the capability with this name. */
|
|
23
|
+
name?: string;
|
|
25
24
|
}
|
|
25
|
+
/** Deployment capabilities, returned by the backend as a top-level array. */
|
|
26
|
+
export type GetDeploymentCapabilitiesResponse = DeploymentCapabilityInfo[];
|
|
@@ -49,7 +49,7 @@ export type { GetMailFailuresParams } from "./mail_failure.cjs";
|
|
|
49
49
|
export type { UpdateTermsPolicyRequest, GetTermsPolicyParams, DeleteTermsPolicyParams, } from "./terms_policy.cjs";
|
|
50
50
|
export type { AddCloudwatchLogUserRequest } from "./cloudwatch_log.cjs";
|
|
51
51
|
export type { UpdateLogConfigRequest } from "./log_config.cjs";
|
|
52
|
-
export type { UpdateDeploymentCapabilityRequest } from "./deployment_capability.cjs";
|
|
52
|
+
export type { GetDeploymentCapabilitiesParams, UpdateDeploymentCapabilityRequest, } from "./deployment_capability.cjs";
|
|
53
53
|
export type { GetAPIStatisticsParams } from "./api_statistics.cjs";
|
|
54
54
|
export type { GetMQTTStatisticsParams } from "./mqtt_statistics.cjs";
|
|
55
55
|
export type { CreateMatterAuthRequest, CreateMatterBatchRequest, UpdateMatterBatchRequest, GetMatterBatchParams, GetMatterBatchNodesParams, } from "./matter.cjs";
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import { ESPAPIError } from "../../types/api.cjs";
|
|
7
7
|
interface RawAPIErrorBody {
|
|
8
8
|
status?: string;
|
|
9
|
-
|
|
9
|
+
/** The RainMaker backend sends a number; some endpoints send a string. */
|
|
10
|
+
error_code?: string | number;
|
|
10
11
|
description?: string;
|
|
11
12
|
/** RFC 6749 error code, returned by the OAuth endpoints instead of `error_code`. */
|
|
12
13
|
error?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@espressif/rainmaker-admin-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Espressif's Rainmaker Admin SDK enables seamless integration of admin applications with the ESP Rainmaker ecosystem.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Espressif Systems (Shanghai) CO LTD",
|