@espressif/rainmaker-admin-sdk 1.4.0 → 1.6.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 +51 -0
- package/dist/cjs/entries/ESPRMAdminDashboard.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/methods/ESPRMAdminDashboard/CheckDashboardUpdate.cjs +20 -0
- package/dist/cjs/methods/ESPRMAdminDashboard/GetDashboardVersionMapping.cjs +2 -1
- package/dist/cjs/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.cjs +2 -1
- package/dist/cjs/utils/error/parser.cjs +1 -1
- package/dist/esm/entries/ESPRMAdminDashboard.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/methods/ESPRMAdminDashboard/CheckDashboardUpdate.js +18 -0
- package/dist/esm/methods/ESPRMAdminDashboard/GetDashboardVersionMapping.js +2 -1
- package/dist/esm/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.js +2 -1
- package/dist/esm/utils/error/parser.js +1 -1
- package/dist/types/methods/ESPRMAdminDashboard/CheckDashboardUpdate.d.ts +19 -0
- package/dist/types/methods/ESPRMAdminDashboard/GetDashboardUpdateStatus.d.ts +2 -0
- package/dist/types/methods/ESPRMAdminDashboard/GetDashboardVersionMapping.d.ts +4 -2
- package/dist/types/methods/ESPRMAdminDashboard/index.d.ts +1 -0
- package/dist/types/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.d.ts +6 -4
- package/dist/types/types/dashboard.d.ts +29 -2
- package/dist/types/types/deployment_capability.d.ts +6 -5
- package/dist/types/types/input.d.ts +2 -2
- package/dist/types/types/output.d.ts +1 -1
- package/dist/types/utils/error/parser.d.ts +2 -1
- package/dist/types-cjs/methods/ESPRMAdminDashboard/CheckDashboardUpdate.d.cts +19 -0
- package/dist/types-cjs/methods/ESPRMAdminDashboard/GetDashboardUpdateStatus.d.cts +2 -0
- package/dist/types-cjs/methods/ESPRMAdminDashboard/GetDashboardVersionMapping.d.cts +4 -2
- package/dist/types-cjs/methods/ESPRMAdminDashboard/index.d.cts +1 -0
- package/dist/types-cjs/methods/ESPRMAdminDeploymentCapability/GetDeploymentCapabilities.d.cts +6 -4
- package/dist/types-cjs/types/dashboard.d.cts +29 -2
- package/dist/types-cjs/types/deployment_capability.d.cts +6 -5
- package/dist/types-cjs/types/input.d.cts +2 -2
- package/dist/types-cjs/types/output.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,57 @@
|
|
|
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.6.0] - 2026-10-08
|
|
7
|
+
|
|
8
|
+
Minor release that makes the dashboard update endpoints usable from the
|
|
9
|
+
dashboards: the update check now sends the `current_version` the backend
|
|
10
|
+
requires, and the version mapping accepts its filters. Existing calls are
|
|
11
|
+
unchanged; `getDashboardUpdateStatus()` is deprecated because it could never
|
|
12
|
+
succeed.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `ESPRMAdminDashboard.checkDashboardUpdate({ current_version })` checks for a
|
|
17
|
+
newer dashboard (`GET admin/dashboard/update?current_version=`). Returns
|
|
18
|
+
`{ version, backend_updated }` when one exists, otherwise a plain success
|
|
19
|
+
response.
|
|
20
|
+
- `ESPRMAdminDashboard.getDashboardVersionMapping({ type, version })` accepts
|
|
21
|
+
optional filters. Calling it without arguments is unchanged.
|
|
22
|
+
- Types `CheckDashboardUpdateParams`, `CheckDashboardUpdateResponse`,
|
|
23
|
+
`DashboardUpdateAvailable`, `GetDashboardVersionMappingParams` and
|
|
24
|
+
`DashboardVersionMappingType`.
|
|
25
|
+
|
|
26
|
+
### Deprecated
|
|
27
|
+
|
|
28
|
+
- `ESPRMAdminDashboard.getDashboardUpdateStatus()` sends no `current_version`,
|
|
29
|
+
which the backend requires, so it always fails with error code `110001`. Use
|
|
30
|
+
`checkDashboardUpdate` instead.
|
|
31
|
+
|
|
32
|
+
## [1.5.0] - 2026-10-08
|
|
33
|
+
|
|
34
|
+
Minor release that lets callers fetch a single deployment capability by name,
|
|
35
|
+
which the dashboards use to read the ESP Insights URL. Calling
|
|
36
|
+
`getDeploymentCapabilities()` without arguments is unchanged; the two type
|
|
37
|
+
corrections below are fixes, one of which changes `errorCode` at runtime.
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- `ESPRMAdminDeploymentCapability.getDeploymentCapabilities({ name })` fetches
|
|
42
|
+
a single capability by name (`GET admin/deployment_capabilities?name=`).
|
|
43
|
+
The parameter is optional; calling it without arguments is unchanged. The
|
|
44
|
+
backend rejects an unknown name with error code `122005`.
|
|
45
|
+
- Type `GetDeploymentCapabilitiesParams`.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- `GetDeploymentCapabilitiesResponse` is now `DeploymentCapabilityInfo[]`. The
|
|
50
|
+
backend has always returned a top-level array; the old
|
|
51
|
+
`{ capabilities: [...] }` shape never matched the response.
|
|
52
|
+
- `ESPAPIError.errorCode` is now always a string, as its type declares. The
|
|
53
|
+
RainMaker backend sends `error_code` as a number, which the SDK passed
|
|
54
|
+
through unchanged, so `errorCode === "122005"` was false at runtime. Callers
|
|
55
|
+
that compared against a number must compare against the string instead.
|
|
56
|
+
|
|
6
57
|
## [1.4.0] - 2026-10-07
|
|
7
58
|
|
|
8
59
|
Minor release that adds OAuth 2.0 authorization-code login, so dashboards can
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
require('../methods/ESPRMAdminDashboard/UpdateDashboard.cjs');
|
|
9
9
|
require('../methods/ESPRMAdminDashboard/GetDashboardUpdateStatus.cjs');
|
|
10
|
+
require('../methods/ESPRMAdminDashboard/CheckDashboardUpdate.cjs');
|
|
10
11
|
require('../methods/ESPRMAdminDashboard/GetDashboardVersionMapping.cjs');
|
|
11
12
|
var ESPRMAdminDashboard = require('../ESPRMAdminDashboard.cjs');
|
|
12
13
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -155,6 +155,7 @@ require('./methods/ESPRMAdminMessageTemplate/DeleteMessageTemplate.cjs');
|
|
|
155
155
|
require('./methods/ESPRMAdminMessageTemplate/GetVerifiedEmails.cjs');
|
|
156
156
|
require('./methods/ESPRMAdminDashboard/UpdateDashboard.cjs');
|
|
157
157
|
require('./methods/ESPRMAdminDashboard/GetDashboardUpdateStatus.cjs');
|
|
158
|
+
require('./methods/ESPRMAdminDashboard/CheckDashboardUpdate.cjs');
|
|
158
159
|
require('./methods/ESPRMAdminDashboard/GetDashboardVersionMapping.cjs');
|
|
159
160
|
require('./methods/ESPRMAdminLicense/UploadLicenseFile.cjs');
|
|
160
161
|
require('./methods/ESPRMAdminLicense/GetLicenseFile.cjs');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
var ESPRMAdminDashboard = require('../../ESPRMAdminDashboard.cjs');
|
|
9
|
+
var ESPRMAPIManager = require('../../services/ESPRMAPIManager.cjs');
|
|
10
|
+
var constants = require('../../utils/constants.cjs');
|
|
11
|
+
|
|
12
|
+
ESPRMAdminDashboard.ESPRMAdminDashboard.prototype.checkDashboardUpdate = async function (params) {
|
|
13
|
+
const requestConfig = {
|
|
14
|
+
url: constants.APIEndpoints.ADMIN_DASHBOARD_UPDATE,
|
|
15
|
+
method: constants.HTTPMethods.GET,
|
|
16
|
+
params,
|
|
17
|
+
};
|
|
18
|
+
const response = await ESPRMAPIManager.ESPRMAPIManager.authorizeRequest(requestConfig);
|
|
19
|
+
return response;
|
|
20
|
+
};
|
|
@@ -10,10 +10,11 @@ var ESPRMAPIManager = require('../../services/ESPRMAPIManager.cjs');
|
|
|
10
10
|
var constants = require('../../utils/constants.cjs');
|
|
11
11
|
|
|
12
12
|
ESPRMAdminDashboard.ESPRMAdminDashboard.prototype.getDashboardVersionMapping =
|
|
13
|
-
async function () {
|
|
13
|
+
async function (params) {
|
|
14
14
|
const requestConfig = {
|
|
15
15
|
url: constants.APIEndpoints.ADMIN_DASHBOARD_VERSION_MAPPING,
|
|
16
16
|
method: constants.HTTPMethods.GET,
|
|
17
|
+
...(params && { params }),
|
|
17
18
|
};
|
|
18
19
|
const response = await ESPRMAPIManager.ESPRMAPIManager.authorizeRequest(requestConfig);
|
|
19
20
|
return response;
|
|
@@ -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
|
}
|
|
@@ -5,5 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import '../methods/ESPRMAdminDashboard/UpdateDashboard.js';
|
|
7
7
|
import '../methods/ESPRMAdminDashboard/GetDashboardUpdateStatus.js';
|
|
8
|
+
import '../methods/ESPRMAdminDashboard/CheckDashboardUpdate.js';
|
|
8
9
|
import '../methods/ESPRMAdminDashboard/GetDashboardVersionMapping.js';
|
|
9
10
|
export { ESPRMAdminDashboard } from '../ESPRMAdminDashboard.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -153,6 +153,7 @@ import './methods/ESPRMAdminMessageTemplate/DeleteMessageTemplate.js';
|
|
|
153
153
|
import './methods/ESPRMAdminMessageTemplate/GetVerifiedEmails.js';
|
|
154
154
|
import './methods/ESPRMAdminDashboard/UpdateDashboard.js';
|
|
155
155
|
import './methods/ESPRMAdminDashboard/GetDashboardUpdateStatus.js';
|
|
156
|
+
import './methods/ESPRMAdminDashboard/CheckDashboardUpdate.js';
|
|
156
157
|
import './methods/ESPRMAdminDashboard/GetDashboardVersionMapping.js';
|
|
157
158
|
import './methods/ESPRMAdminLicense/UploadLicenseFile.js';
|
|
158
159
|
import './methods/ESPRMAdminLicense/GetLicenseFile.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ESPRMAdminDashboard } from '../../ESPRMAdminDashboard.js';
|
|
7
|
+
import { ESPRMAPIManager } from '../../services/ESPRMAPIManager.js';
|
|
8
|
+
import { HTTPMethods, APIEndpoints } from '../../utils/constants.js';
|
|
9
|
+
|
|
10
|
+
ESPRMAdminDashboard.prototype.checkDashboardUpdate = async function (params) {
|
|
11
|
+
const requestConfig = {
|
|
12
|
+
url: APIEndpoints.ADMIN_DASHBOARD_UPDATE,
|
|
13
|
+
method: HTTPMethods.GET,
|
|
14
|
+
params,
|
|
15
|
+
};
|
|
16
|
+
const response = await ESPRMAPIManager.authorizeRequest(requestConfig);
|
|
17
|
+
return response;
|
|
18
|
+
};
|
|
@@ -8,10 +8,11 @@ import { ESPRMAPIManager } from '../../services/ESPRMAPIManager.js';
|
|
|
8
8
|
import { HTTPMethods, APIEndpoints } from '../../utils/constants.js';
|
|
9
9
|
|
|
10
10
|
ESPRMAdminDashboard.prototype.getDashboardVersionMapping =
|
|
11
|
-
async function () {
|
|
11
|
+
async function (params) {
|
|
12
12
|
const requestConfig = {
|
|
13
13
|
url: APIEndpoints.ADMIN_DASHBOARD_VERSION_MAPPING,
|
|
14
14
|
method: HTTPMethods.GET,
|
|
15
|
+
...(params && { params }),
|
|
15
16
|
};
|
|
16
17
|
const response = await ESPRMAPIManager.authorizeRequest(requestConfig);
|
|
17
18
|
return response;
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CheckDashboardUpdateParams, CheckDashboardUpdateResponse } from "../../types/dashboard.js";
|
|
7
|
+
declare module "../../ESPRMAdminDashboard.js" {
|
|
8
|
+
interface ESPRMAdminDashboard {
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether a newer dashboard version is published for this deployment.
|
|
11
|
+
*
|
|
12
|
+
* @param params - The dashboard version currently deployed.
|
|
13
|
+
* @returns `DashboardUpdateAvailable` when an update exists, otherwise a
|
|
14
|
+
* plain success response. The backend rejects a missing or malformed
|
|
15
|
+
* `current_version` with error code 110001.
|
|
16
|
+
*/
|
|
17
|
+
checkDashboardUpdate(params: CheckDashboardUpdateParams): Promise<CheckDashboardUpdateResponse>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -9,6 +9,8 @@ declare module "../../ESPRMAdminDashboard.js" {
|
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves the current status of a dashboard update operation.
|
|
11
11
|
*
|
|
12
|
+
* @deprecated Sends no `current_version`, which the backend requires, so
|
|
13
|
+
* it always fails with error code 110001. Use `checkDashboardUpdate`.
|
|
12
14
|
* @returns The dashboard update status response.
|
|
13
15
|
*/
|
|
14
16
|
getDashboardUpdateStatus(): Promise<GetDashboardUpdateStatusResponse>;
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { GetDashboardVersionMappingResponse } from "../../types/dashboard.js";
|
|
6
|
+
import { GetDashboardVersionMappingParams, GetDashboardVersionMappingResponse } from "../../types/dashboard.js";
|
|
7
7
|
declare module "../../ESPRMAdminDashboard.js" {
|
|
8
8
|
interface ESPRMAdminDashboard {
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves the version mapping for the dashboard, showing available versions and their associations.
|
|
11
11
|
*
|
|
12
|
+
* @param params - Optional filter. `version` is only honoured together with
|
|
13
|
+
* `type`. Supported only on SAM deployments; others get error code 110010.
|
|
12
14
|
* @returns The dashboard version mapping response.
|
|
13
15
|
*/
|
|
14
|
-
getDashboardVersionMapping(): Promise<GetDashboardVersionMappingResponse>;
|
|
16
|
+
getDashboardVersionMapping(params?: GetDashboardVersionMappingParams): Promise<GetDashboardVersionMappingResponse>;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
@@ -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
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { ESPAPISuccessResponse } from "./api.js";
|
|
6
7
|
/** Request body for updating the dashboard version. */
|
|
7
8
|
export interface UpdateDashboardRequest {
|
|
8
9
|
/** The target dashboard version. */
|
|
@@ -14,10 +15,36 @@ export interface GetDashboardUpdateStatusResponse {
|
|
|
14
15
|
version?: string;
|
|
15
16
|
[key: string]: unknown;
|
|
16
17
|
}
|
|
18
|
+
/** Query parameters for checking dashboard updates. */
|
|
19
|
+
export interface CheckDashboardUpdateParams {
|
|
20
|
+
/** The dashboard version currently deployed, e.g. `"2.6.0"`. */
|
|
21
|
+
current_version: string;
|
|
22
|
+
}
|
|
23
|
+
/** Returned when a newer dashboard version is published. */
|
|
24
|
+
export interface DashboardUpdateAvailable {
|
|
25
|
+
/** The latest published dashboard version. */
|
|
26
|
+
version: string;
|
|
27
|
+
/** Whether the backend is already on a version that supports `version`. */
|
|
28
|
+
backend_updated: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Response of the dashboard update check. When no newer version exists the
|
|
32
|
+
* backend returns a plain success response instead of `DashboardUpdateAvailable`.
|
|
33
|
+
*/
|
|
34
|
+
export type CheckDashboardUpdateResponse = DashboardUpdateAvailable | ESPAPISuccessResponse;
|
|
35
|
+
/** Which side of the version mapping to filter on. */
|
|
36
|
+
export type DashboardVersionMappingType = "backend" | "frontend";
|
|
37
|
+
/** Query parameters for the dashboard version mapping. */
|
|
38
|
+
export interface GetDashboardVersionMappingParams {
|
|
39
|
+
/** Return only this side of the mapping. */
|
|
40
|
+
type?: DashboardVersionMappingType;
|
|
41
|
+
/** Return only the entry for this version. Requires `type`. */
|
|
42
|
+
version?: string;
|
|
43
|
+
}
|
|
17
44
|
/** Response containing dashboard version compatibility mappings. */
|
|
18
45
|
export interface GetDashboardVersionMappingResponse {
|
|
19
|
-
/** Backend version
|
|
46
|
+
/** Backend version to compatible dashboard versions. */
|
|
20
47
|
backend?: Record<string, string[]>;
|
|
21
|
-
/**
|
|
48
|
+
/** Dashboard version to compatible backend versions. */
|
|
22
49
|
frontend?: Record<string, string[]>;
|
|
23
50
|
}
|
|
@@ -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[];
|
|
@@ -26,7 +26,7 @@ export type { CreateCognitoAppClientRequest, UpdateCognitoAppClientRequest, GetC
|
|
|
26
26
|
export type { CreateCognitoDomainRequest, GetCognitoDomainParams, DeleteCognitoDomainParams, } from "./cognito_domain.js";
|
|
27
27
|
export type { CreateIdentityProviderRequest, UpdateIdentityProviderRequest, GetIdentityProvidersParams, DeleteIdentityProviderParams, } from "./identity_provider.js";
|
|
28
28
|
export type { CreateMessageTemplateRequest, UpdateMessageTemplateRequest, GetMessageTemplatesParams, DeleteMessageTemplateParams, } from "./message_template.js";
|
|
29
|
-
export type { UpdateDashboardRequest } from "./dashboard.js";
|
|
29
|
+
export type { UpdateDashboardRequest, CheckDashboardUpdateParams, DashboardVersionMappingType, GetDashboardVersionMappingParams, } from "./dashboard.js";
|
|
30
30
|
export type { UploadLicenseFileRequest, GetLicenseFileParams } from "./license.js";
|
|
31
31
|
export type { GenerateNodeIdsRequest, GetNodeIdsParams, GetNodeCertificatesParams, RegisterNodeCertificatesRequest, GetNodeCertificateRegistrationParams, } from "./node_registration.js";
|
|
32
32
|
export type { ChangeSuperAdminRequest } from "./super_admin.js";
|
|
@@ -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";
|
|
@@ -25,7 +25,7 @@ export type { CognitoAppClientInfo, GetCognitoAppClientsResponse, } from "./cogn
|
|
|
25
25
|
export type { GetCognitoDomainResponse } from "./cognito_domain.js";
|
|
26
26
|
export type { GetIdentityProvidersResponse } from "./identity_provider.js";
|
|
27
27
|
export type { MessageTemplateInfo, GetMessageTemplatesResponse, GetVerifiedEmailsResponse, } from "./message_template.js";
|
|
28
|
-
export type { GetDashboardUpdateStatusResponse, GetDashboardVersionMappingResponse, } from "./dashboard.js";
|
|
28
|
+
export type { GetDashboardUpdateStatusResponse, GetDashboardVersionMappingResponse, CheckDashboardUpdateResponse, DashboardUpdateAvailable, } from "./dashboard.js";
|
|
29
29
|
export type { LicenseFileInfo, GetLicenseFileResponse, GetLicenseQuotaResponse, } from "./license.js";
|
|
30
30
|
export type { GenerateNodeIdsResponse, GetNodeIdsResponse, NodeCertificateInfo, GetNodeCertificatesResponse, NodeCertificateRegistrationStatusResponse, GetMQTTHostResponse, } from "./node_registration.js";
|
|
31
31
|
export type { GetDeploymentDetailsResponse } from "./deployment_details.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;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CheckDashboardUpdateParams, CheckDashboardUpdateResponse } from "../../types/dashboard.cjs";
|
|
7
|
+
declare module "../../ESPRMAdminDashboard.cjs" {
|
|
8
|
+
interface ESPRMAdminDashboard {
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether a newer dashboard version is published for this deployment.
|
|
11
|
+
*
|
|
12
|
+
* @param params - The dashboard version currently deployed.
|
|
13
|
+
* @returns `DashboardUpdateAvailable` when an update exists, otherwise a
|
|
14
|
+
* plain success response. The backend rejects a missing or malformed
|
|
15
|
+
* `current_version` with error code 110001.
|
|
16
|
+
*/
|
|
17
|
+
checkDashboardUpdate(params: CheckDashboardUpdateParams): Promise<CheckDashboardUpdateResponse>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -9,6 +9,8 @@ declare module "../../ESPRMAdminDashboard.cjs" {
|
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves the current status of a dashboard update operation.
|
|
11
11
|
*
|
|
12
|
+
* @deprecated Sends no `current_version`, which the backend requires, so
|
|
13
|
+
* it always fails with error code 110001. Use `checkDashboardUpdate`.
|
|
12
14
|
* @returns The dashboard update status response.
|
|
13
15
|
*/
|
|
14
16
|
getDashboardUpdateStatus(): Promise<GetDashboardUpdateStatusResponse>;
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { GetDashboardVersionMappingResponse } from "../../types/dashboard.cjs";
|
|
6
|
+
import { GetDashboardVersionMappingParams, GetDashboardVersionMappingResponse } from "../../types/dashboard.cjs";
|
|
7
7
|
declare module "../../ESPRMAdminDashboard.cjs" {
|
|
8
8
|
interface ESPRMAdminDashboard {
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves the version mapping for the dashboard, showing available versions and their associations.
|
|
11
11
|
*
|
|
12
|
+
* @param params - Optional filter. `version` is only honoured together with
|
|
13
|
+
* `type`. Supported only on SAM deployments; others get error code 110010.
|
|
12
14
|
* @returns The dashboard version mapping response.
|
|
13
15
|
*/
|
|
14
|
-
getDashboardVersionMapping(): Promise<GetDashboardVersionMappingResponse>;
|
|
16
|
+
getDashboardVersionMapping(params?: GetDashboardVersionMappingParams): Promise<GetDashboardVersionMappingResponse>;
|
|
15
17
|
}
|
|
16
18
|
}
|
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
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { ESPAPISuccessResponse } from "./api.cjs";
|
|
6
7
|
/** Request body for updating the dashboard version. */
|
|
7
8
|
export interface UpdateDashboardRequest {
|
|
8
9
|
/** The target dashboard version. */
|
|
@@ -14,10 +15,36 @@ export interface GetDashboardUpdateStatusResponse {
|
|
|
14
15
|
version?: string;
|
|
15
16
|
[key: string]: unknown;
|
|
16
17
|
}
|
|
18
|
+
/** Query parameters for checking dashboard updates. */
|
|
19
|
+
export interface CheckDashboardUpdateParams {
|
|
20
|
+
/** The dashboard version currently deployed, e.g. `"2.6.0"`. */
|
|
21
|
+
current_version: string;
|
|
22
|
+
}
|
|
23
|
+
/** Returned when a newer dashboard version is published. */
|
|
24
|
+
export interface DashboardUpdateAvailable {
|
|
25
|
+
/** The latest published dashboard version. */
|
|
26
|
+
version: string;
|
|
27
|
+
/** Whether the backend is already on a version that supports `version`. */
|
|
28
|
+
backend_updated: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Response of the dashboard update check. When no newer version exists the
|
|
32
|
+
* backend returns a plain success response instead of `DashboardUpdateAvailable`.
|
|
33
|
+
*/
|
|
34
|
+
export type CheckDashboardUpdateResponse = DashboardUpdateAvailable | ESPAPISuccessResponse;
|
|
35
|
+
/** Which side of the version mapping to filter on. */
|
|
36
|
+
export type DashboardVersionMappingType = "backend" | "frontend";
|
|
37
|
+
/** Query parameters for the dashboard version mapping. */
|
|
38
|
+
export interface GetDashboardVersionMappingParams {
|
|
39
|
+
/** Return only this side of the mapping. */
|
|
40
|
+
type?: DashboardVersionMappingType;
|
|
41
|
+
/** Return only the entry for this version. Requires `type`. */
|
|
42
|
+
version?: string;
|
|
43
|
+
}
|
|
17
44
|
/** Response containing dashboard version compatibility mappings. */
|
|
18
45
|
export interface GetDashboardVersionMappingResponse {
|
|
19
|
-
/** Backend version
|
|
46
|
+
/** Backend version to compatible dashboard versions. */
|
|
20
47
|
backend?: Record<string, string[]>;
|
|
21
|
-
/**
|
|
48
|
+
/** Dashboard version to compatible backend versions. */
|
|
22
49
|
frontend?: Record<string, string[]>;
|
|
23
50
|
}
|
|
@@ -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[];
|
|
@@ -26,7 +26,7 @@ export type { CreateCognitoAppClientRequest, UpdateCognitoAppClientRequest, GetC
|
|
|
26
26
|
export type { CreateCognitoDomainRequest, GetCognitoDomainParams, DeleteCognitoDomainParams, } from "./cognito_domain.cjs";
|
|
27
27
|
export type { CreateIdentityProviderRequest, UpdateIdentityProviderRequest, GetIdentityProvidersParams, DeleteIdentityProviderParams, } from "./identity_provider.cjs";
|
|
28
28
|
export type { CreateMessageTemplateRequest, UpdateMessageTemplateRequest, GetMessageTemplatesParams, DeleteMessageTemplateParams, } from "./message_template.cjs";
|
|
29
|
-
export type { UpdateDashboardRequest } from "./dashboard.cjs";
|
|
29
|
+
export type { UpdateDashboardRequest, CheckDashboardUpdateParams, DashboardVersionMappingType, GetDashboardVersionMappingParams, } from "./dashboard.cjs";
|
|
30
30
|
export type { UploadLicenseFileRequest, GetLicenseFileParams } from "./license.cjs";
|
|
31
31
|
export type { GenerateNodeIdsRequest, GetNodeIdsParams, GetNodeCertificatesParams, RegisterNodeCertificatesRequest, GetNodeCertificateRegistrationParams, } from "./node_registration.cjs";
|
|
32
32
|
export type { ChangeSuperAdminRequest } from "./super_admin.cjs";
|
|
@@ -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";
|
|
@@ -25,7 +25,7 @@ export type { CognitoAppClientInfo, GetCognitoAppClientsResponse, } from "./cogn
|
|
|
25
25
|
export type { GetCognitoDomainResponse } from "./cognito_domain.cjs";
|
|
26
26
|
export type { GetIdentityProvidersResponse } from "./identity_provider.cjs";
|
|
27
27
|
export type { MessageTemplateInfo, GetMessageTemplatesResponse, GetVerifiedEmailsResponse, } from "./message_template.cjs";
|
|
28
|
-
export type { GetDashboardUpdateStatusResponse, GetDashboardVersionMappingResponse, } from "./dashboard.cjs";
|
|
28
|
+
export type { GetDashboardUpdateStatusResponse, GetDashboardVersionMappingResponse, CheckDashboardUpdateResponse, DashboardUpdateAvailable, } from "./dashboard.cjs";
|
|
29
29
|
export type { LicenseFileInfo, GetLicenseFileResponse, GetLicenseQuotaResponse, } from "./license.cjs";
|
|
30
30
|
export type { GenerateNodeIdsResponse, GetNodeIdsResponse, NodeCertificateInfo, GetNodeCertificatesResponse, NodeCertificateRegistrationStatusResponse, GetMQTTHostResponse, } from "./node_registration.cjs";
|
|
31
31
|
export type { GetDeploymentDetailsResponse } from "./deployment_details.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.6.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",
|