@espressif/rainmaker-admin-sdk 1.1.1 → 1.3.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 +209 -0
- package/README.md +2 -1
- package/dist/cjs/ESPRMBase.cjs +1 -0
- package/dist/cjs/ESPRMClaim.cjs +16 -0
- package/dist/cjs/entries/ESPRMAdminCommonCustomData.cjs +1 -0
- package/dist/cjs/entries/ESPRMAdminNode.cjs +2 -0
- package/dist/cjs/entries/ESPRMAdminNodeRegistration.cjs +3 -0
- package/dist/cjs/entries/ESPRMClaim.cjs +14 -0
- package/dist/cjs/index.cjs +11 -0
- package/dist/cjs/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.cjs +24 -0
- package/dist/cjs/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.cjs +7 -0
- package/dist/cjs/methods/ESPRMAdminNode/ActivateDeactivateNodes.cjs +11 -1
- package/dist/cjs/methods/ESPRMAdminNode/CancelCommandRequests.cjs +27 -0
- package/dist/cjs/methods/ESPRMAdminNode/DeleteNode.cjs +24 -0
- package/dist/cjs/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.cjs +25 -0
- package/dist/cjs/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.cjs +24 -0
- package/dist/cjs/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.cjs +21 -0
- package/dist/cjs/methods/ESPRMClaim/InitiateClaim.cjs +28 -0
- package/dist/cjs/methods/ESPRMClaim/VerifyClaim.cjs +28 -0
- package/dist/cjs/services/ESPRMAPIManager.cjs +15 -1
- package/dist/cjs/utils/constants.cjs +17 -0
- package/dist/cjs/utils/error/errorMessages.cjs +11 -0
- package/dist/cjs/utils/validator/ConfigValidator.cjs +9 -0
- package/dist/esm/ESPRMBase.js +1 -0
- package/dist/esm/ESPRMClaim.js +14 -0
- package/dist/esm/entries/ESPRMAdminCommonCustomData.js +1 -0
- package/dist/esm/entries/ESPRMAdminNode.js +2 -0
- package/dist/esm/entries/ESPRMAdminNodeRegistration.js +3 -0
- package/dist/esm/entries/ESPRMClaim.js +8 -0
- package/dist/esm/index.js +10 -1
- package/dist/esm/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.js +22 -0
- package/dist/esm/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.js +8 -1
- package/dist/esm/methods/ESPRMAdminNode/ActivateDeactivateNodes.js +12 -2
- package/dist/esm/methods/ESPRMAdminNode/CancelCommandRequests.js +25 -0
- package/dist/esm/methods/ESPRMAdminNode/DeleteNode.js +22 -0
- package/dist/esm/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.js +23 -0
- package/dist/esm/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.js +22 -0
- package/dist/esm/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.js +19 -0
- package/dist/esm/methods/ESPRMClaim/InitiateClaim.js +26 -0
- package/dist/esm/methods/ESPRMClaim/VerifyClaim.js +26 -0
- package/dist/esm/services/ESPRMAPIManager.js +15 -1
- package/dist/esm/utils/constants.js +17 -1
- package/dist/esm/utils/error/errorMessages.js +11 -0
- package/dist/esm/utils/validator/ConfigValidator.js +9 -0
- package/dist/types/ESPRMClaim.d.ts +12 -0
- package/dist/types/entries/ESPRMClaim.d.ts +7 -0
- package/dist/types/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.d.ts +22 -0
- package/dist/types/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.d.ts +6 -1
- package/dist/types/methods/ESPRMAdminCommonCustomData/index.d.ts +1 -0
- package/dist/types/methods/ESPRMAdminEventFilter/UpdateEventFilter.d.ts +5 -0
- package/dist/types/methods/ESPRMAdminNode/ActivateDeactivateNodes.d.ts +9 -6
- package/dist/types/methods/ESPRMAdminNode/CancelCommandRequests.d.ts +22 -0
- package/dist/types/methods/ESPRMAdminNode/DeleteNode.d.ts +19 -0
- package/dist/types/methods/ESPRMAdminNode/index.d.ts +2 -0
- package/dist/types/methods/ESPRMAdminNodeRegistration/GetMQTTHost.d.ts +3 -2
- package/dist/types/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.d.ts +18 -0
- package/dist/types/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.d.ts +17 -0
- package/dist/types/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.d.ts +19 -0
- package/dist/types/methods/ESPRMAdminNodeRegistration/RegisterNodeCertificates.d.ts +6 -6
- package/dist/types/methods/ESPRMAdminNodeRegistration/index.d.ts +3 -0
- package/dist/types/methods/ESPRMAdminWebhook/GetWebhookIntegrations.d.ts +2 -1
- package/dist/types/methods/ESPRMClaim/InitiateClaim.d.ts +21 -0
- package/dist/types/methods/ESPRMClaim/VerifyClaim.d.ts +21 -0
- package/dist/types/methods/ESPRMClaim/index.d.ts +7 -0
- package/dist/types/methods/export.d.ts +1 -0
- package/dist/types/services/ESPRMAPIManager.d.ts +6 -0
- package/dist/types/types/claim.d.ts +45 -0
- package/dist/types/types/command_response.d.ts +56 -7
- package/dist/types/types/common_custom_data.d.ts +32 -5
- package/dist/types/types/config.d.ts +9 -0
- package/dist/types/types/event_filter.d.ts +17 -3
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/input.d.ts +3 -2
- package/dist/types/types/mainTypes.d.ts +2 -1
- package/dist/types/types/node.d.ts +33 -3
- package/dist/types/types/node_registration.d.ts +164 -12
- package/dist/types/types/output.d.ts +3 -2
- package/dist/types/types/webhook.d.ts +5 -2
- package/dist/types/utils/constants.d.ts +17 -1
- package/dist/types/utils/error/errorMessages.d.ts +11 -0
- package/dist/types/utils/validator/ConfigValidator.d.ts +1 -0
- package/dist/types-cjs/ESPRMClaim.d.cts +12 -0
- package/dist/types-cjs/entries/ESPRMClaim.d.cts +7 -0
- package/dist/types-cjs/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.d.cts +22 -0
- package/dist/types-cjs/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.d.cts +6 -1
- package/dist/types-cjs/methods/ESPRMAdminCommonCustomData/index.d.cts +1 -0
- package/dist/types-cjs/methods/ESPRMAdminEventFilter/UpdateEventFilter.d.cts +5 -0
- package/dist/types-cjs/methods/ESPRMAdminNode/ActivateDeactivateNodes.d.cts +9 -6
- package/dist/types-cjs/methods/ESPRMAdminNode/CancelCommandRequests.d.cts +22 -0
- package/dist/types-cjs/methods/ESPRMAdminNode/DeleteNode.d.cts +19 -0
- package/dist/types-cjs/methods/ESPRMAdminNode/index.d.cts +2 -0
- package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/GetMQTTHost.d.cts +3 -2
- package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.d.cts +18 -0
- package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.d.cts +17 -0
- package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.d.cts +19 -0
- package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/RegisterNodeCertificates.d.cts +6 -6
- package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/index.d.cts +3 -0
- package/dist/types-cjs/methods/ESPRMAdminWebhook/GetWebhookIntegrations.d.cts +2 -1
- package/dist/types-cjs/methods/ESPRMClaim/InitiateClaim.d.cts +21 -0
- package/dist/types-cjs/methods/ESPRMClaim/VerifyClaim.d.cts +21 -0
- package/dist/types-cjs/methods/ESPRMClaim/index.d.cts +7 -0
- package/dist/types-cjs/methods/export.d.cts +1 -0
- package/dist/types-cjs/services/ESPRMAPIManager.d.cts +6 -0
- package/dist/types-cjs/types/claim.d.cts +45 -0
- package/dist/types-cjs/types/command_response.d.cts +56 -7
- package/dist/types-cjs/types/common_custom_data.d.cts +32 -5
- package/dist/types-cjs/types/config.d.cts +9 -0
- package/dist/types-cjs/types/event_filter.d.cts +17 -3
- package/dist/types-cjs/types/index.d.cts +1 -0
- package/dist/types-cjs/types/input.d.cts +3 -2
- package/dist/types-cjs/types/mainTypes.d.cts +2 -1
- package/dist/types-cjs/types/node.d.cts +33 -3
- package/dist/types-cjs/types/node_registration.d.cts +164 -12
- package/dist/types-cjs/types/output.d.cts +3 -2
- package/dist/types-cjs/types/webhook.d.cts +5 -2
- package/dist/types-cjs/utils/constants.d.cts +17 -1
- package/dist/types-cjs/utils/error/errorMessages.d.cts +11 -0
- package/dist/types-cjs/utils/validator/ConfigValidator.d.cts +1 -0
- package/package.json +11 -1
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { RegisterNodeCertificatesRequest } from "../../types/node_registration.cjs";
|
|
7
|
-
import { ESPAPISuccessResponse } from "../../types/api.cjs";
|
|
6
|
+
import { RegisterNodeCertificatesRequest, RegisterNodeCertificatesResponse } from "../../types/node_registration.cjs";
|
|
8
7
|
declare module "../../ESPRMAdminNodeRegistration.cjs" {
|
|
9
8
|
interface ESPRMAdminNodeRegistration {
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* Triggers registration of the node certificates in a CSV that was
|
|
11
|
+
* uploaded to the URL from `getNodeCertificateUploadUrl`.
|
|
12
12
|
*
|
|
13
|
-
* @param params - The
|
|
14
|
-
* @returns
|
|
13
|
+
* @param params - The uploaded file details and registration options.
|
|
14
|
+
* @returns The ID of the registration request.
|
|
15
15
|
*/
|
|
16
|
-
registerNodeCertificates(params: RegisterNodeCertificatesRequest): Promise<
|
|
16
|
+
registerNodeCertificates(params: RegisterNodeCertificatesRequest): Promise<RegisterNodeCertificatesResponse>;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -8,5 +8,8 @@ import "./GetNodeIds.cjs";
|
|
|
8
8
|
import "./GetNodeCertificates.cjs";
|
|
9
9
|
import "./GetNodeCertificateRegistrationStatus.cjs";
|
|
10
10
|
import "./RegisterNodeCertificates.cjs";
|
|
11
|
+
import "./GetNodeCertificateUploadUrl.cjs";
|
|
11
12
|
import "./GetMQTTHost.cjs";
|
|
12
13
|
import "./GetCustomMQTTHost.cjs";
|
|
14
|
+
import "./ListNodeRegistrationRequests.cjs";
|
|
15
|
+
import "./GetNodeRegistrationRequest.cjs";
|
|
@@ -11,7 +11,8 @@ declare module "../../ESPRMAdminWebhook.cjs" {
|
|
|
11
11
|
* Retrieves the list of configured webhook integrations.
|
|
12
12
|
*
|
|
13
13
|
* @param params - Optional filtering parameters for the webhook integrations query.
|
|
14
|
-
* @returns The response containing webhook integration details
|
|
14
|
+
* @returns The response containing webhook integration details in
|
|
15
|
+
* `integration_info_list`, which is `null` when none are configured.
|
|
15
16
|
*/
|
|
16
17
|
getWebhookIntegrations(params?: GetWebhookIntegrationsParams): Promise<GetWebhookIntegrationsResponse>;
|
|
17
18
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { InitiateClaimRequest, InitiateClaimResponse } from "../../types/claim.cjs";
|
|
7
|
+
declare module "../../ESPRMClaim.cjs" {
|
|
8
|
+
interface ESPRMClaim {
|
|
9
|
+
/**
|
|
10
|
+
* Starts authenticated claiming of a node for the signed in user.
|
|
11
|
+
* The claim expires a few minutes after it is created, so call
|
|
12
|
+
* {@link ESPRMClaim.verifyClaim} promptly.
|
|
13
|
+
*
|
|
14
|
+
* @param params - MAC address and platform of the node.
|
|
15
|
+
* @returns The node ID assigned to the node.
|
|
16
|
+
* @throws ESPConfigError `CLAIMING_NOT_CONFIGURED` without `claimingBaseUrl`.
|
|
17
|
+
* @throws ESPAPICallValidationError when `mac_addr` or `platform` is empty.
|
|
18
|
+
*/
|
|
19
|
+
initiateClaim(params: InitiateClaimRequest): Promise<InitiateClaimResponse>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { VerifyClaimOptions, VerifyClaimRequest, VerifyClaimResponse } from "../../types/claim.cjs";
|
|
7
|
+
declare module "../../ESPRMClaim.cjs" {
|
|
8
|
+
interface ESPRMClaim {
|
|
9
|
+
/**
|
|
10
|
+
* Completes a claim started with {@link ESPRMClaim.initiateClaim} by
|
|
11
|
+
* submitting the node's CSR, and returns the signed node certificate.
|
|
12
|
+
*
|
|
13
|
+
* @param params - CSR plus optional node policies and MQTT host request.
|
|
14
|
+
* @param options - Matter and Matter test CA flags.
|
|
15
|
+
* @returns The node certificate, and MQTT hosts when requested.
|
|
16
|
+
* @throws ESPConfigError `CLAIMING_NOT_CONFIGURED` without `claimingBaseUrl`.
|
|
17
|
+
* @throws ESPAPICallValidationError when `csr` is empty.
|
|
18
|
+
*/
|
|
19
|
+
verifyClaim(params: VerifyClaimRequest, options?: VerifyClaimOptions): Promise<VerifyClaimResponse>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -40,6 +40,7 @@ import "./ESPRMAdminMobilePlatform/index.cjs";
|
|
|
40
40
|
import "./ESPRMAdminPublishMessage/index.cjs";
|
|
41
41
|
import "./ESPRMAdminPassthrough/index.cjs";
|
|
42
42
|
import "./ESPRMAdminNodeCertificateCA/index.cjs";
|
|
43
|
+
import "./ESPRMClaim/index.cjs";
|
|
43
44
|
import "./ESPRMAdminWebhook/index.cjs";
|
|
44
45
|
import "./ESPRMAdminStatisticalService/index.cjs";
|
|
45
46
|
import "./ESPRMAdminMailFailure/index.cjs";
|
|
@@ -13,6 +13,12 @@ export declare class ESPRMAPIManager {
|
|
|
13
13
|
#private;
|
|
14
14
|
private constructor();
|
|
15
15
|
static initialize(config: ESPRMAPIManagerConfig): void;
|
|
16
|
+
/**
|
|
17
|
+
* Base URL of the claiming service set through `claimingBaseUrl`.
|
|
18
|
+
*
|
|
19
|
+
* @throws ESPConfigError `CLAIMING_NOT_CONFIGURED` when it was not configured.
|
|
20
|
+
*/
|
|
21
|
+
static getClaimingBaseUrl(): string;
|
|
16
22
|
/**
|
|
17
23
|
* Send a request with the current user's access token in the
|
|
18
24
|
* `Authorization` header, refreshing the token first if it has expired.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/** Request body for `POST claim/initiate` (authenticated claiming). */
|
|
7
|
+
export interface InitiateClaimRequest {
|
|
8
|
+
/** Node MAC address: 12 uppercase hex characters, no separators, e.g. `7CDFA100033B`. */
|
|
9
|
+
mac_addr: string;
|
|
10
|
+
/** Platform the node is claimed for, e.g. `ESP32` or `ESP32S3`. */
|
|
11
|
+
platform: string;
|
|
12
|
+
}
|
|
13
|
+
/** Response of `POST claim/initiate` for authenticated claiming. */
|
|
14
|
+
export interface InitiateClaimResponse {
|
|
15
|
+
/** Node ID assigned to the claimed node. */
|
|
16
|
+
node_id: string;
|
|
17
|
+
}
|
|
18
|
+
/** Request body for `POST claim/verify` (authenticated claiming). */
|
|
19
|
+
export interface VerifyClaimRequest {
|
|
20
|
+
/** PEM encoded certificate signing request for the node key, with `CN=<node_id>`. */
|
|
21
|
+
csr: string;
|
|
22
|
+
/** When true, the response also carries `mqtt_host` and `mqtt_cred_host`. */
|
|
23
|
+
send_mqtt_host?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Comma separated node policies to attach, e.g. `videostream`. The
|
|
26
|
+
* `mqtt` policy is always attached by the backend.
|
|
27
|
+
*/
|
|
28
|
+
node_policies?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Query options for `POST claim/verify`. */
|
|
31
|
+
export interface VerifyClaimOptions {
|
|
32
|
+
/** Issue a Matter compliant node certificate. Defaults to false. */
|
|
33
|
+
matter?: boolean;
|
|
34
|
+
/** Use the Matter test CA. Only sent when `matter` is true. */
|
|
35
|
+
test?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Response of `POST claim/verify`. */
|
|
38
|
+
export interface VerifyClaimResponse {
|
|
39
|
+
/** PEM encoded node certificate chain. */
|
|
40
|
+
certificate: string;
|
|
41
|
+
/** MQTT endpoint, present when `send_mqtt_host` was true. */
|
|
42
|
+
mqtt_host?: string;
|
|
43
|
+
/** MQTT credentials endpoint, present when `send_mqtt_host` was true. */
|
|
44
|
+
mqtt_cred_host?: string;
|
|
45
|
+
}
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Lifecycle status of a command request.
|
|
8
|
+
*
|
|
9
|
+
* - `requested`: created, not yet delivered to the node
|
|
10
|
+
* - `in_progress`: delivered to the node, awaiting its response
|
|
11
|
+
* - `success` / `failure`: the node reported the result
|
|
12
|
+
* - `timed_out`: the timeout elapsed before the command completed
|
|
13
|
+
* - `overridden`: replaced by a later request sent with `override: true`
|
|
14
|
+
* - `cancelled`: cancelled through the cancel API
|
|
15
|
+
*/
|
|
16
|
+
export type CommandRequestStatus = "requested" | "in_progress" | "success" | "failure" | "timed_out" | "overridden" | "cancelled";
|
|
17
|
+
/** Error marker set when stored request or response data cannot be decoded. */
|
|
18
|
+
export type CommandRequestDataError = "ERROR_DESERIALIZE_JSON";
|
|
6
19
|
/** Parameters for listing command requests. */
|
|
7
20
|
export interface GetCommandRequestsParams {
|
|
8
21
|
/** Filter by specific request ID. */
|
|
@@ -10,10 +23,13 @@ export interface GetCommandRequestsParams {
|
|
|
10
23
|
/** Filter by node ID. */
|
|
11
24
|
node_id?: string;
|
|
12
25
|
/** Filter by request status. */
|
|
13
|
-
status?:
|
|
14
|
-
/**
|
|
26
|
+
status?: CommandRequestStatus;
|
|
27
|
+
/**
|
|
28
|
+
* Start of the request time range, in epoch seconds. Must be sent with
|
|
29
|
+
* `end_time`, and requires the `cmd_resp_history` deployment setting.
|
|
30
|
+
*/
|
|
15
31
|
start_time?: number;
|
|
16
|
-
/**
|
|
32
|
+
/** End of the request time range, in epoch seconds. Must be sent with `start_time`. */
|
|
17
33
|
end_time?: number;
|
|
18
34
|
/** Filter by command ID. */
|
|
19
35
|
cmd_id?: number;
|
|
@@ -44,25 +60,37 @@ export interface CommandRequestInfo {
|
|
|
44
60
|
/** Unique identifier of the command request. */
|
|
45
61
|
request_id: string;
|
|
46
62
|
/** Current status of the request. */
|
|
47
|
-
status:
|
|
63
|
+
status: CommandRequestStatus;
|
|
48
64
|
/** Device-reported status code. */
|
|
49
65
|
device_status?: number;
|
|
50
66
|
/** Human-readable description of the status. */
|
|
51
67
|
status_description?: string;
|
|
52
68
|
/** Data sent in the request. */
|
|
53
69
|
request_data?: unknown;
|
|
70
|
+
/** Set instead of `request_data` when the stored request data cannot be decoded. */
|
|
71
|
+
request_data_error?: CommandRequestDataError;
|
|
54
72
|
/** Data received in the response. */
|
|
55
73
|
response_data?: unknown;
|
|
74
|
+
/** Set instead of `response_data` when the stored response data cannot be decoded. */
|
|
75
|
+
response_data_error?: CommandRequestDataError;
|
|
76
|
+
/** Whether the data is a base64-encoded string rather than JSON. */
|
|
77
|
+
is_base64?: boolean;
|
|
56
78
|
/** Node ID the command was sent to. */
|
|
57
79
|
node_id: string;
|
|
58
|
-
/** Timestamp when the request was created. */
|
|
80
|
+
/** Timestamp when the request was created, in epoch seconds. */
|
|
59
81
|
request_timestamp?: number;
|
|
60
|
-
/** Timestamp when the response was received. */
|
|
82
|
+
/** Timestamp when the response was received, in epoch seconds. */
|
|
61
83
|
response_timestamp?: number;
|
|
62
|
-
/** Timestamp when the request expires. */
|
|
84
|
+
/** Timestamp when the request expires, in epoch seconds. */
|
|
63
85
|
expiration_timestamp?: number;
|
|
86
|
+
/** Whether the request never expires (sent with a timeout of -1). */
|
|
87
|
+
indefinite_timeout?: boolean;
|
|
64
88
|
/** Command identifier. */
|
|
65
89
|
cmd?: number;
|
|
90
|
+
/** Name of the user who created the request. */
|
|
91
|
+
user_name?: string;
|
|
92
|
+
/** Whether the request was created through the user API rather than by a device. */
|
|
93
|
+
for_user?: boolean;
|
|
66
94
|
}
|
|
67
95
|
/** Paginated response containing a list of command requests. */
|
|
68
96
|
export interface GetCommandRequestsResponse {
|
|
@@ -80,3 +108,24 @@ export interface AddCommandRequestResponse {
|
|
|
80
108
|
/** Status of the command submission. */
|
|
81
109
|
status: string;
|
|
82
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Parameters for cancelling pending command requests.
|
|
113
|
+
*
|
|
114
|
+
* Provide `request_id` to cancel one request, or `node_id` to cancel every
|
|
115
|
+
* pending request for a node (optionally narrowed by `cmd_id`).
|
|
116
|
+
*/
|
|
117
|
+
export interface CancelCommandRequestsParams {
|
|
118
|
+
/** Cancel this specific request. */
|
|
119
|
+
request_id?: string;
|
|
120
|
+
/** Cancel all pending requests for this node. */
|
|
121
|
+
node_id?: string;
|
|
122
|
+
/** Cancel only requests with this command ID. Requires `node_id`. */
|
|
123
|
+
cmd_id?: number;
|
|
124
|
+
}
|
|
125
|
+
/** Response returned after cancelling command requests. */
|
|
126
|
+
export interface CancelCommandRequestsResponse {
|
|
127
|
+
/** Status of the cancel operation. */
|
|
128
|
+
status: string;
|
|
129
|
+
/** Number of requests that were cancelled. */
|
|
130
|
+
total_cancelled: number;
|
|
131
|
+
}
|
|
@@ -3,19 +3,46 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Request body for adding or updating a common custom data entry.
|
|
8
|
+
*
|
|
9
|
+
* `PUT admin/common_custom_data` is an upsert with merge semantics:
|
|
10
|
+
* - When the stored value and `value` are both JSON objects, they are deep
|
|
11
|
+
* merged. Keys omitted from `value` are kept, and a nested `null` deletes
|
|
12
|
+
* that key.
|
|
13
|
+
* - Arrays, strings, numbers and booleans replace the stored value.
|
|
14
|
+
* - A `null` or missing `value` deletes the whole entry, so `value` must be
|
|
15
|
+
* defined here. Use `deleteCommonCustomData` to delete.
|
|
16
|
+
*/
|
|
7
17
|
export interface SetCommonCustomDataRequest {
|
|
8
18
|
/** Name of the custom data entry. */
|
|
9
19
|
name: string;
|
|
10
|
-
/** Value to assign to the custom data entry. */
|
|
20
|
+
/** Value to assign to the custom data entry. Must not be `null` or `undefined`. */
|
|
11
21
|
value: unknown;
|
|
12
22
|
}
|
|
23
|
+
/** Request for deleting a common custom data entry. */
|
|
24
|
+
export interface DeleteCommonCustomDataRequest {
|
|
25
|
+
/** Name of the custom data entry to delete. */
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
13
28
|
/** Parameters for retrieving common custom data. */
|
|
14
29
|
export interface GetCommonCustomDataParams {
|
|
15
30
|
/** Name of the custom data entry to retrieve. */
|
|
16
31
|
name?: string;
|
|
17
32
|
}
|
|
18
|
-
/**
|
|
19
|
-
export interface
|
|
20
|
-
|
|
33
|
+
/** A single common custom data entry. */
|
|
34
|
+
export interface CommonCustomDataItem {
|
|
35
|
+
/** Name of the custom data entry. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Stored value: a JSON object, array, string, number or boolean. */
|
|
38
|
+
value: unknown;
|
|
39
|
+
/** RBAC permissions attached to the entry, when any were set. */
|
|
40
|
+
perms?: unknown[];
|
|
21
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Response of `GET admin/common_custom_data`.
|
|
44
|
+
*
|
|
45
|
+
* Always an array: every entry when `name` is omitted, or a single-element
|
|
46
|
+
* array when `name` is given.
|
|
47
|
+
*/
|
|
48
|
+
export type GetCommonCustomDataResponse = CommonCustomDataItem[];
|
|
@@ -21,12 +21,21 @@ export interface ESPRMBaseConfig {
|
|
|
21
21
|
* `errorCode` is `REQUEST_TIMEOUT`. Defaults to 30000. Set to `0` to disable.
|
|
22
22
|
*/
|
|
23
23
|
timeoutMs?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Base URL of the standalone ESP RainMaker claiming service, e.g.
|
|
26
|
+
* `https://esp-claiming.rainmaker.espressif.com`. Required only for
|
|
27
|
+
* `ESPRMClaim`; the service is available on public deployments only.
|
|
28
|
+
* The user's access token is sent to this host, so only set it to a
|
|
29
|
+
* trusted Espressif claiming endpoint.
|
|
30
|
+
*/
|
|
31
|
+
claimingBaseUrl?: string;
|
|
24
32
|
}
|
|
25
33
|
/** Configuration for the ESPRMAPIManager. */
|
|
26
34
|
export interface ESPRMAPIManagerConfig {
|
|
27
35
|
baseUrl: string;
|
|
28
36
|
version: string;
|
|
29
37
|
timeoutMs?: number;
|
|
38
|
+
claimingBaseUrl?: string;
|
|
30
39
|
}
|
|
31
40
|
/** Configuration for an API request made through ESPRMAPIManager. */
|
|
32
41
|
export interface ESPRMRequestConfig {
|
|
@@ -24,10 +24,24 @@ export interface UpdateEventFilterRequest {
|
|
|
24
24
|
entity_id: string;
|
|
25
25
|
/** Type of entity. */
|
|
26
26
|
entity_type: string;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Whether this filter is enabled. When `enabled_for_integrations` is
|
|
29
|
+
* omitted or empty, this value is stored as sent. When it is non-empty,
|
|
30
|
+
* the backend derives `enabled` itself (see `enabled_for_integrations`).
|
|
31
|
+
*/
|
|
28
32
|
enabled: boolean;
|
|
29
|
-
/**
|
|
30
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Integrations to add or remove. This is **not** a replacement list:
|
|
35
|
+
* - omitted or `[]`: the stored list is kept unchanged.
|
|
36
|
+
* - with `enabled: true`: the listed integrations are added to the stored list.
|
|
37
|
+
* - with `enabled: false`: the listed integrations are removed from the stored list.
|
|
38
|
+
*
|
|
39
|
+
* When a non-empty list is sent, the backend overrides `enabled`: it becomes
|
|
40
|
+
* `false` if the resulting list is empty, otherwise `true`, except that a
|
|
41
|
+
* filter already stored as disabled (with a non-empty list) stays disabled.
|
|
42
|
+
* To set `enabled` explicitly, send a separate update without this field.
|
|
43
|
+
*/
|
|
44
|
+
enabled_for_integrations?: string[];
|
|
31
45
|
}
|
|
32
46
|
/** Parameters for listing event filters. */
|
|
33
47
|
export interface GetEventFiltersParams {
|
|
@@ -44,6 +44,7 @@ export * from "./mobile_platform.cjs";
|
|
|
44
44
|
export * from "./publish_message.cjs";
|
|
45
45
|
export * from "./passthrough.cjs";
|
|
46
46
|
export * from "./node_certificate_ca.cjs";
|
|
47
|
+
export * from "./claim.cjs";
|
|
47
48
|
export * from "./webhook.cjs";
|
|
48
49
|
export * from "./statistical_service.cjs";
|
|
49
50
|
export * from "./mail_failure.cjs";
|
|
@@ -11,7 +11,7 @@ export type { GetAdminNodesParams, ActivateDeactivateNodesParams, GetNodeTagsPar
|
|
|
11
11
|
export type { CreateOTAImageRequest, GetOTAImagesParams, ArchiveOTAImageParams, DeleteOTAImageParams, GetOTAImageUploadUrlParams, ConfirmOTAImageUploadRequest, GetOTAPackageUploadUrlParams, ConfirmOTAPackageUploadRequest, CreateOTAJobRequest, CreateOTAJobQueryOptions, OtaJobDownloadWindow, OtaJobValidity, OtaJobMetadata, OtaSecureBoot, OtaNetworkSerialisation, GetOTAJobParams, UpdateOTAJobParams, CancelOTAJobRequest, ArchiveOTAJobRequest, GetOTAJobStatusParams, GetOTAJobStatusSummaryParams, RetriggerOTAJobRequest, } from "./ota.cjs";
|
|
12
12
|
export type { CreateAdminGroupRequest, UpdateAdminGroupRequest, GetAdminGroupsParams, } from "./group.cjs";
|
|
13
13
|
export type { GetAdminTagsParams, AttachDetachTagsParams, GetTagNamesParams, } from "./tag.cjs";
|
|
14
|
-
export type { GetCommandRequestsParams, AddCommandRequestBody, } from "./command_response.cjs";
|
|
14
|
+
export type { GetCommandRequestsParams, AddCommandRequestBody, CancelCommandRequestsParams, CommandRequestStatus, } from "./command_response.cjs";
|
|
15
15
|
export type { CreateEventFilterRequest, UpdateEventFilterRequest, GetEventFiltersParams, DeleteEventFilterRequest, } from "./event_filter.cjs";
|
|
16
16
|
export type { GetTimeSeriesDataParams, GetSimpleTimeSeriesDataParams, } from "./time_series.cjs";
|
|
17
17
|
export type { GetAdminCustomDataParams, SetAdminCustomDataParams, } from "./custom_data.cjs";
|
|
@@ -31,7 +31,7 @@ export type { UploadLicenseFileRequest, GetLicenseFileParams } from "./license.c
|
|
|
31
31
|
export type { GenerateNodeIdsRequest, GetNodeIdsParams, GetNodeCertificatesParams, RegisterNodeCertificatesRequest, GetNodeCertificateRegistrationParams, } from "./node_registration.cjs";
|
|
32
32
|
export type { ChangeSuperAdminRequest } from "./super_admin.cjs";
|
|
33
33
|
export type { ChangeSenderEmailRequest } from "./sender_email.cjs";
|
|
34
|
-
export type { SetCommonCustomDataRequest, GetCommonCustomDataParams, } from "./common_custom_data.cjs";
|
|
34
|
+
export type { SetCommonCustomDataRequest, DeleteCommonCustomDataRequest, GetCommonCustomDataParams, } from "./common_custom_data.cjs";
|
|
35
35
|
export type { GetDeploymentDetailsParams } from "./deployment_details.cjs";
|
|
36
36
|
export type { UpdateDeploymentConfigRequest } from "./deployment_setting.cjs";
|
|
37
37
|
export type { GetNotificationsParams, UpdateNotificationsRequest, } from "./configuration.cjs";
|
|
@@ -42,6 +42,7 @@ export type { CreateMobilePlatformRequest, UpdateMobilePlatformRequest, DeleteMo
|
|
|
42
42
|
export type { PublishMessageQueryParams, PublishMessageRequest, } from "./publish_message.cjs";
|
|
43
43
|
export type { CreatePassthroughConfigRequest, UpdatePassthroughConfigRequest, GetPassthroughConfigParams, } from "./passthrough.cjs";
|
|
44
44
|
export type { UpdateNodeCACertificateRequest } from "./node_certificate_ca.cjs";
|
|
45
|
+
export type { InitiateClaimRequest, VerifyClaimRequest, VerifyClaimOptions, } from "./claim.cjs";
|
|
45
46
|
export type { CreateWebhookIntegrationRequest, UpdateWebhookIntegrationRequest, GetWebhookIntegrationsParams, DeleteWebhookIntegrationParams, UpdateWebhookEventMappingRequest, GetWebhookEventMappingParams, DeleteWebhookEventMappingParams, } from "./webhook.cjs";
|
|
46
47
|
export type { GetStatsInfoParams } from "./statistical_service.cjs";
|
|
47
48
|
export type { GetMailFailuresParams } from "./mail_failure.cjs";
|
|
@@ -52,5 +52,6 @@ import { ESPRMAdminAPIStatistics } from "../ESPRMAdminAPIStatistics.cjs";
|
|
|
52
52
|
import { ESPRMAdminMQTTStatistics } from "../ESPRMAdminMQTTStatistics.cjs";
|
|
53
53
|
import { ESPRMAdminMatter } from "../ESPRMAdminMatter.cjs";
|
|
54
54
|
import { ESPRMAdminNodeParams } from "../ESPRMAdminNodeParams.cjs";
|
|
55
|
+
import { ESPRMClaim } from "../ESPRMClaim.cjs";
|
|
55
56
|
import "../methods/export.cjs";
|
|
56
|
-
export { ESPRMAuth, ESPRMUser, ESPRMAdminUser, ESPRMAdminNode, ESPRMAdminOTAImage, ESPRMAdminOTAJob, ESPRMAdminGroup, ESPRMAdminTag, ESPRMAdminEventFilter, ESPRMAdminCustomData, ESPRMAdminRole, ESPRMAdminPolicy, ESPRMAdminUserRole, ESPRMAdminKey, ESPRMAdminSecureSign, ESPRMAdminFile, ESPRMAdminAPIInfo, ESPRMAdminDeploymentDetails, ESPRMAdminCognitoAppClient, ESPRMAdminCognitoDomain, ESPRMAdminIdentityProvider, ESPRMAdminMessageTemplate, ESPRMAdminDashboard, ESPRMAdminLicense, ESPRMAdminNodeRegistration, ESPRMAdminSuperAdmin, ESPRMAdminSenderEmail, ESPRMAdminCommonCustomData, ESPRMAdminDeploymentSetting, ESPRMAdminConfiguration, ESPRMAdminIoTDeviceRateLimit, ESPRMAdminAPIRateLimit, ESPRMAdminCustomMessageTemplate, ESPRMAdminMobilePlatform, ESPRMAdminPublishMessage, ESPRMAdminPassthrough, ESPRMAdminNodeCertificateCA, ESPRMAdminWebhook, ESPRMAdminStatisticalService, ESPRMAdminMailFailure, ESPRMAdminAPIGateway, ESPRMAdminTermsPolicy, ESPRMAdminCloudwatchLog, ESPRMAdminLogConfig, ESPRMAdminDeploymentCapability, ESPRMAdminAPIStatistics, ESPRMAdminMQTTStatistics, ESPRMAdminMatter, ESPRMAdminNodeParams, };
|
|
57
|
+
export { ESPRMAuth, ESPRMUser, ESPRMAdminUser, ESPRMAdminNode, ESPRMAdminOTAImage, ESPRMAdminOTAJob, ESPRMAdminGroup, ESPRMAdminTag, ESPRMAdminEventFilter, ESPRMAdminCustomData, ESPRMAdminRole, ESPRMAdminPolicy, ESPRMAdminUserRole, ESPRMAdminKey, ESPRMAdminSecureSign, ESPRMAdminFile, ESPRMAdminAPIInfo, ESPRMAdminDeploymentDetails, ESPRMAdminCognitoAppClient, ESPRMAdminCognitoDomain, ESPRMAdminIdentityProvider, ESPRMAdminMessageTemplate, ESPRMAdminDashboard, ESPRMAdminLicense, ESPRMAdminNodeRegistration, ESPRMAdminSuperAdmin, ESPRMAdminSenderEmail, ESPRMAdminCommonCustomData, ESPRMAdminDeploymentSetting, ESPRMAdminConfiguration, ESPRMAdminIoTDeviceRateLimit, ESPRMAdminAPIRateLimit, ESPRMAdminCustomMessageTemplate, ESPRMAdminMobilePlatform, ESPRMAdminPublishMessage, ESPRMAdminPassthrough, ESPRMAdminNodeCertificateCA, ESPRMAdminWebhook, ESPRMAdminStatisticalService, ESPRMAdminMailFailure, ESPRMAdminAPIGateway, ESPRMAdminTermsPolicy, ESPRMAdminCloudwatchLog, ESPRMAdminLogConfig, ESPRMAdminDeploymentCapability, ESPRMAdminAPIStatistics, ESPRMAdminMQTTStatistics, ESPRMAdminMatter, ESPRMAdminNodeParams, ESPRMClaim, };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import type { ESPAPISuccessResponse } from "./api.cjs";
|
|
6
7
|
/** Parameters for listing admin nodes. */
|
|
7
8
|
export interface GetAdminNodesParams {
|
|
8
9
|
/** Maximum number of records to return. */
|
|
@@ -34,11 +35,40 @@ export interface GetAdminNodesParams {
|
|
|
34
35
|
}
|
|
35
36
|
/** Parameters for activating or deactivating nodes. */
|
|
36
37
|
export interface ActivateDeactivateNodesParams {
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* IDs of the nodes to activate or deactivate. At most
|
|
40
|
+
* `MAX_NODE_ACTIVATION_BATCH_SIZE` (25) per request.
|
|
41
|
+
*/
|
|
42
|
+
node_ids: string[];
|
|
43
|
+
/** Whether to activate (true) or deactivate (false) the nodes. */
|
|
40
44
|
activate: boolean;
|
|
41
45
|
}
|
|
46
|
+
/** Per-node success entry in a 207 activation response. */
|
|
47
|
+
export interface NodeActivationSuccessResult {
|
|
48
|
+
node_id: string;
|
|
49
|
+
status: "success";
|
|
50
|
+
description: string;
|
|
51
|
+
}
|
|
52
|
+
/** Per-node failure entry in a 207 activation response. */
|
|
53
|
+
export interface NodeActivationFailureResult {
|
|
54
|
+
node_id: string;
|
|
55
|
+
status: "failure";
|
|
56
|
+
error_code: number;
|
|
57
|
+
description: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 207 Multi-Status response from `PUT admin/nodes`, returned when the
|
|
61
|
+
* per-node outcomes differ.
|
|
62
|
+
*/
|
|
63
|
+
export interface NodeActivationMultiStatusResponse {
|
|
64
|
+
responses: Array<NodeActivationSuccessResult | NodeActivationFailureResult>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Response from `activateDeactivateNodes`. When every node has the same
|
|
68
|
+
* outcome the backend returns a single 200 success; otherwise 207 with
|
|
69
|
+
* per-node results. A uniform failure rejects with `ESPAPIError`.
|
|
70
|
+
*/
|
|
71
|
+
export type ActivateDeactivateNodesResponse = ESPAPISuccessResponse | NodeActivationMultiStatusResponse;
|
|
42
72
|
/** Parameters for listing node tags or tag values. */
|
|
43
73
|
export interface GetNodeTagsParams {
|
|
44
74
|
/** Filter by tag name to retrieve its associated tag values. */
|