@espressif/rainmaker-admin-sdk 1.1.0 → 1.2.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 +125 -1
- package/dist/cjs/entries/ESPRMAdminNode.cjs +1 -0
- package/dist/cjs/entries/ESPRMAdminNodeRegistration.cjs +3 -0
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/methods/ESPRMAdminNode/CancelCommandRequests.cjs +27 -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/services/ESPRMAPIManager.cjs +10 -2
- package/dist/cjs/utils/constants.cjs +3 -0
- package/dist/cjs/utils/error/errorMessages.cjs +2 -0
- package/dist/esm/entries/ESPRMAdminNode.js +1 -0
- package/dist/esm/entries/ESPRMAdminNodeRegistration.js +3 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/methods/ESPRMAdminNode/CancelCommandRequests.js +25 -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/services/ESPRMAPIManager.js +10 -2
- package/dist/esm/utils/constants.js +3 -0
- package/dist/esm/utils/error/errorMessages.js +2 -0
- package/dist/types/methods/ESPRMAdminNode/CancelCommandRequests.d.ts +22 -0
- package/dist/types/methods/ESPRMAdminNode/index.d.ts +1 -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/types/command_response.d.ts +56 -7
- package/dist/types/types/input.d.ts +1 -1
- package/dist/types/types/node_registration.d.ts +164 -12
- package/dist/types/types/output.d.ts +1 -1
- package/dist/types/types/time_series.d.ts +11 -5
- package/dist/types/utils/constants.d.ts +3 -0
- package/dist/types/utils/error/errorMessages.d.ts +2 -0
- package/dist/types-cjs/methods/ESPRMAdminNode/CancelCommandRequests.d.cts +22 -0
- package/dist/types-cjs/methods/ESPRMAdminNode/index.d.cts +1 -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/types/command_response.d.cts +56 -7
- package/dist/types-cjs/types/input.d.cts +1 -1
- package/dist/types-cjs/types/node_registration.d.cts +164 -12
- package/dist/types-cjs/types/output.d.cts +1 -1
- package/dist/types-cjs/types/time_series.d.cts +11 -5
- package/dist/types-cjs/utils/constants.d.cts +3 -0
- package/dist/types-cjs/utils/error/errorMessages.d.cts +2 -0
- package/package.json +1 -1
|
@@ -8,5 +8,8 @@ import "./GetNodeIds.js";
|
|
|
8
8
|
import "./GetNodeCertificates.js";
|
|
9
9
|
import "./GetNodeCertificateRegistrationStatus.js";
|
|
10
10
|
import "./RegisterNodeCertificates.js";
|
|
11
|
+
import "./GetNodeCertificateUploadUrl.js";
|
|
11
12
|
import "./GetMQTTHost.js";
|
|
12
13
|
import "./GetCustomMQTTHost.js";
|
|
14
|
+
import "./ListNodeRegistrationRequests.js";
|
|
15
|
+
import "./GetNodeRegistrationRequest.js";
|
|
@@ -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
|
+
}
|
|
@@ -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.js";
|
|
12
12
|
export type { CreateAdminGroupRequest, UpdateAdminGroupRequest, GetAdminGroupsParams, } from "./group.js";
|
|
13
13
|
export type { GetAdminTagsParams, AttachDetachTagsParams, GetTagNamesParams, } from "./tag.js";
|
|
14
|
-
export type { GetCommandRequestsParams, AddCommandRequestBody, } from "./command_response.js";
|
|
14
|
+
export type { GetCommandRequestsParams, AddCommandRequestBody, CancelCommandRequestsParams, CommandRequestStatus, } from "./command_response.js";
|
|
15
15
|
export type { CreateEventFilterRequest, UpdateEventFilterRequest, GetEventFiltersParams, DeleteEventFilterRequest, } from "./event_filter.js";
|
|
16
16
|
export type { GetTimeSeriesDataParams, GetSimpleTimeSeriesDataParams, } from "./time_series.js";
|
|
17
17
|
export type { GetAdminCustomDataParams, SetAdminCustomDataParams, } from "./custom_data.js";
|
|
@@ -34,13 +34,73 @@ export interface GetNodeCertificatesParams {
|
|
|
34
34
|
/** The maximum number of records to return. */
|
|
35
35
|
num_records?: number;
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
37
|
+
/** Parameters for fetching a pre-signed URL to upload a node certificates CSV. */
|
|
38
|
+
export interface GetNodeCertificateUploadUrlParams {
|
|
39
|
+
/** Name of the CSV file to upload. */
|
|
40
|
+
file_name: string;
|
|
41
|
+
}
|
|
42
|
+
/** Response containing the pre-signed upload URL for a node certificates CSV. */
|
|
43
|
+
export interface NodeCertificateUploadUrlResponse {
|
|
44
|
+
/** The API call status. */
|
|
45
|
+
status: string;
|
|
46
|
+
/** Pre-signed S3 PUT URL (valid for 1 hour). Upload without an `Authorization` header. */
|
|
47
|
+
url: string;
|
|
48
|
+
/** ID of the registration request; pass it to `registerNodeCertificates`. */
|
|
49
|
+
request_id: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Request body for registering node certificates from an uploaded CSV.
|
|
53
|
+
*
|
|
54
|
+
* Upload the CSV to the URL from `getNodeCertificateUploadUrl` first, then
|
|
55
|
+
* trigger the registration with the same `request_id`.
|
|
56
|
+
*/
|
|
38
57
|
export interface RegisterNodeCertificatesRequest {
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
/** Name of the uploaded CSV file. */
|
|
59
|
+
file_name: string;
|
|
60
|
+
/** Hex MD5 digest of the uploaded CSV file. */
|
|
61
|
+
file_md5: string;
|
|
62
|
+
/** Request ID returned by `getNodeCertificateUploadUrl`. */
|
|
63
|
+
request_id: string;
|
|
64
|
+
/**
|
|
65
|
+
* The caller's refresh token. The backend requires it and uses it to add
|
|
66
|
+
* the registered nodes to their group.
|
|
67
|
+
*/
|
|
68
|
+
refresh_token: string;
|
|
69
|
+
/** The node type. */
|
|
70
|
+
type?: string;
|
|
71
|
+
/** The node model. */
|
|
72
|
+
model?: string;
|
|
73
|
+
/** The node subtype. */
|
|
74
|
+
subtype?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Group to add the nodes to. When omitted, the backend creates a group named
|
|
77
|
+
* after the type/model and the current date.
|
|
78
|
+
*/
|
|
79
|
+
group_name?: string;
|
|
80
|
+
/** ID of the parent group when `group_name` is a subgroup. Takes precedence over `parent_group_name`. */
|
|
81
|
+
parent_group_id?: string;
|
|
82
|
+
/** Name of the parent group when `group_name` is a subgroup. */
|
|
83
|
+
parent_group_name?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Comma-separated tags. Static tags are `key:value`; CSV-column tags are
|
|
86
|
+
* `key:@column` and take each node's value from that CSV column.
|
|
87
|
+
*/
|
|
88
|
+
tags?: string;
|
|
89
|
+
/** Ignore duplicate node registrations and update existing certificates. */
|
|
90
|
+
force?: boolean;
|
|
91
|
+
/** Only update type, model, subtype and tags of existing nodes. Cannot be combined with `node_policies`. */
|
|
92
|
+
update_nodes?: boolean;
|
|
93
|
+
/** Comma-separated IoT policies to attach: `mqtt`, `videostream`. */
|
|
94
|
+
node_policies?: string;
|
|
95
|
+
/** The tenant ID, required when multi-tenancy is enabled. */
|
|
96
|
+
tenant_id?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Response returned after triggering a node certificate registration. */
|
|
99
|
+
export interface RegisterNodeCertificatesResponse {
|
|
100
|
+
/** The API call status. */
|
|
101
|
+
status: string;
|
|
102
|
+
/** ID of the registration request. */
|
|
103
|
+
request_id: string;
|
|
44
104
|
}
|
|
45
105
|
/** Parameters for checking node certificate registration status. */
|
|
46
106
|
export interface GetNodeCertificateRegistrationParams {
|
|
@@ -85,17 +145,109 @@ export interface GetNodeCertificatesResponse {
|
|
|
85
145
|
/** The total number of certificates. */
|
|
86
146
|
total?: number;
|
|
87
147
|
}
|
|
88
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Response containing node certificate registration status.
|
|
150
|
+
*
|
|
151
|
+
* Unlike `getNodeRegistrationRequest`, this call checks the batch job and
|
|
152
|
+
* reports `failure` when it has died while the request was still `requested`.
|
|
153
|
+
*/
|
|
89
154
|
export interface NodeCertificateRegistrationStatusResponse {
|
|
90
|
-
/** The registration request ID. */
|
|
91
|
-
request_id?: string;
|
|
92
155
|
/** The registration status. */
|
|
93
|
-
status
|
|
94
|
-
|
|
156
|
+
status: NodeRegistrationRequestStatus;
|
|
157
|
+
/** Number of nodes registered so far. */
|
|
158
|
+
completed_count?: number;
|
|
159
|
+
/** Total number of nodes in the request. */
|
|
160
|
+
total_count?: number;
|
|
161
|
+
/** Failure reason, when the request failed. */
|
|
162
|
+
description?: string;
|
|
163
|
+
/** Nodes that failed to register, as reported by the backend. */
|
|
164
|
+
failed_registration?: string;
|
|
165
|
+
/** Name of the group the nodes are added to. */
|
|
166
|
+
group_name?: string;
|
|
167
|
+
/** ID of the group the nodes are added to. */
|
|
168
|
+
group_id?: string;
|
|
95
169
|
}
|
|
96
|
-
/** Response containing the
|
|
170
|
+
/** Response containing the deployment's node endpoints. */
|
|
97
171
|
export interface GetMQTTHostResponse {
|
|
98
172
|
/** The MQTT broker host address. */
|
|
99
173
|
mqtt_host?: string;
|
|
174
|
+
/** The AWS IoT credential provider endpoint (written to node NVS as `mqtt_cred_host`). */
|
|
175
|
+
mqtt_cred_host?: string;
|
|
176
|
+
/** The HTTPS node endpoint, when the deployment has one configured. */
|
|
177
|
+
https_host?: string;
|
|
100
178
|
[key: string]: unknown;
|
|
101
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Status of a node certificate registration request.
|
|
182
|
+
*
|
|
183
|
+
* `failed` and `failure` both mean the request failed: the backend writes
|
|
184
|
+
* `failed` when submitting the batch job fails and `failure` when the batch
|
|
185
|
+
* job itself fails.
|
|
186
|
+
*/
|
|
187
|
+
export type NodeRegistrationRequestStatus = "requested" | "in_progress" | "success" | "failed" | "failure";
|
|
188
|
+
/** Parameters for listing node certificate registration requests. */
|
|
189
|
+
export interface ListNodeRegistrationRequestsParams {
|
|
190
|
+
/** Filter results by request status. */
|
|
191
|
+
status?: NodeRegistrationRequestStatus;
|
|
192
|
+
/** The maximum number of records to return (the backend caps this at 25). */
|
|
193
|
+
num_records?: number;
|
|
194
|
+
/** The `next_id` from the previous response, to fetch the next page. */
|
|
195
|
+
start_id?: string;
|
|
196
|
+
}
|
|
197
|
+
/** A node certificate registration request, as returned in the list. */
|
|
198
|
+
export interface NodeRegistrationRequest {
|
|
199
|
+
/** The registration request ID. */
|
|
200
|
+
request_id: string;
|
|
201
|
+
/** The request status. */
|
|
202
|
+
status: NodeRegistrationRequestStatus;
|
|
203
|
+
/** Name of the uploaded certificates CSV file. */
|
|
204
|
+
file_name?: string;
|
|
205
|
+
/** Time the request was created, in epoch seconds. */
|
|
206
|
+
request_timestamp?: number;
|
|
207
|
+
/** Number of nodes registered so far. */
|
|
208
|
+
completed_count?: number;
|
|
209
|
+
/** Total number of nodes in the request. */
|
|
210
|
+
total_count?: number;
|
|
211
|
+
}
|
|
212
|
+
/** Response containing a page of node certificate registration requests. */
|
|
213
|
+
export interface ListNodeRegistrationRequestsResponse {
|
|
214
|
+
/** The API call status. */
|
|
215
|
+
status: string;
|
|
216
|
+
/** Registration requests, newest first. */
|
|
217
|
+
requests?: NodeRegistrationRequest[];
|
|
218
|
+
/** Pagination cursor for the next page; absent on the last page. */
|
|
219
|
+
next_id?: string;
|
|
220
|
+
}
|
|
221
|
+
/** Full detail of a single node certificate registration request. */
|
|
222
|
+
export interface NodeRegistrationRequestDetail extends NodeRegistrationRequest {
|
|
223
|
+
/** Pre-signed download URL of the original CSV (valid for 1 hour). */
|
|
224
|
+
url?: string;
|
|
225
|
+
/** Additional context from the backend, e.g. a batch job failure reason. */
|
|
226
|
+
additional_comments?: string;
|
|
227
|
+
/** Number of nodes that failed to register (omitted when 0). */
|
|
228
|
+
failed_registration_count?: number;
|
|
229
|
+
/** Name of the group the nodes were added to. */
|
|
230
|
+
group_name?: string;
|
|
231
|
+
/** ID of the group the nodes were added to. */
|
|
232
|
+
group_id?: string;
|
|
233
|
+
/** The node type. */
|
|
234
|
+
type?: string;
|
|
235
|
+
/** The node model. */
|
|
236
|
+
model?: string;
|
|
237
|
+
/** The node subtype. */
|
|
238
|
+
subtype?: string;
|
|
239
|
+
/** ID of the parent group. */
|
|
240
|
+
parent_group_id?: string;
|
|
241
|
+
/** Name of the parent group. */
|
|
242
|
+
parent_group_name?: string;
|
|
243
|
+
/** Comma-separated `key:value` tags applied to the nodes. */
|
|
244
|
+
tags?: string;
|
|
245
|
+
/** Whether existing registrations were overwritten. */
|
|
246
|
+
force?: boolean;
|
|
247
|
+
/** Whether existing nodes were updated. */
|
|
248
|
+
update_nodes?: boolean;
|
|
249
|
+
/** The tenant ID. */
|
|
250
|
+
tenant_id?: string;
|
|
251
|
+
/** Policies attached to the nodes. */
|
|
252
|
+
node_policies?: string;
|
|
253
|
+
}
|
|
@@ -10,7 +10,7 @@ export type { AdminNodeInfo, AdminNodeListResponse, GetNodeTagsResponse, NodeSta
|
|
|
10
10
|
export type { OTAImageInfo, OTAImageRelatedFile, OTAImageCreateResponse, GetOTAImagesResponse, OTAImageUploadUrlResponse, ConfirmOTAImageUploadResponse, OTAPackageUploadUrlResponse, ConfirmOTAPackageUploadResponse, OTAJobInfo, OTAJobCreateResponse, OTAJobUpdateResponse, OTAJobRetriggerResponse, GetOTAJobsResponse, NodeOTAJobStatusEntry, OTAJobStatusResponse, OTAJobStatusSummaryResponse, } from "./ota.js";
|
|
11
11
|
export type { AdminGroupInfo, CreateAdminGroupResponse, GetAdminGroupsResponse, } from "./group.js";
|
|
12
12
|
export type { TagResourceInfo, GetAdminTagsResponse, GetTagNamesResponse, } from "./tag.js";
|
|
13
|
-
export type { CommandRequestInfo, GetCommandRequestsResponse, AddCommandRequestResponse, } from "./command_response.js";
|
|
13
|
+
export type { CommandRequestInfo, GetCommandRequestsResponse, AddCommandRequestResponse, CancelCommandRequestsResponse, CommandRequestDataError, } from "./command_response.js";
|
|
14
14
|
export type { EventFilterInfo, GetEventFiltersResponse } from "./event_filter.js";
|
|
15
15
|
export type { TimeSeriesParamData, TimeSeriesNodeData, GetTimeSeriesDataResponse, GetSimpleTimeSeriesDataResponse, } from "./time_series.js";
|
|
16
16
|
export type { CustomDataResponse } from "./custom_data.js";
|
|
@@ -42,10 +42,16 @@ export interface GetSimpleTimeSeriesDataParams {
|
|
|
42
42
|
node_id: string;
|
|
43
43
|
/** Parameter name to query. */
|
|
44
44
|
param_name: string;
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Start of the time range (epoch seconds). Omit to start from the oldest
|
|
47
|
+
* stored record. The backend rejects a range whose start is after its end.
|
|
48
|
+
*/
|
|
49
|
+
start_time?: number;
|
|
50
|
+
/**
|
|
51
|
+
* End of the time range (epoch seconds). Omit to include records up to
|
|
52
|
+
* the current time.
|
|
53
|
+
*/
|
|
54
|
+
end_time?: number;
|
|
49
55
|
/**
|
|
50
56
|
* Expected data type of the parameter values (GET query param `type`,
|
|
51
57
|
* e.g. `int`, `float`).
|
|
@@ -53,7 +59,7 @@ export interface GetSimpleTimeSeriesDataParams {
|
|
|
53
59
|
type: string;
|
|
54
60
|
/** ID to start pagination from. */
|
|
55
61
|
start_id?: string;
|
|
56
|
-
/** Maximum number of records to return. */
|
|
62
|
+
/** Maximum number of records to return. The backend caps this at 200. */
|
|
57
63
|
num_records?: number;
|
|
58
64
|
}
|
|
59
65
|
/** Time series data for a single parameter. */
|
|
@@ -68,6 +68,7 @@ declare const APIEndpoints: {
|
|
|
68
68
|
readonly ADMIN_NODE_IDS: "admin/node_ids";
|
|
69
69
|
readonly ADMIN_NODE_CERTIFICATES: "admin/node_certificates";
|
|
70
70
|
readonly ADMIN_NODE_CERTIFICATES_REGISTER: "admin/node_certificates/register";
|
|
71
|
+
readonly ADMIN_NODE_REGISTRATION_REQUESTS: "admin/node_registrations/requests";
|
|
71
72
|
readonly ADMIN_API_STATS: "admin/api_stats";
|
|
72
73
|
readonly ADMIN_MQTT_STATS: "admin/mqtt_stats";
|
|
73
74
|
readonly ADMIN_CHANGE_SUPER_ADMIN: "admin/change_super_admin";
|
|
@@ -148,6 +149,8 @@ declare const APICallValidationErrorCodes: {
|
|
|
148
149
|
readonly MISSING_PLATFORM_NAME: "MISSING_PLATFORM_NAME";
|
|
149
150
|
readonly MISSING_PLATFORM_APPLICATION_ARN: "MISSING_PLATFORM_APPLICATION_ARN";
|
|
150
151
|
readonly MISSING_BATCH_ID: "MISSING_BATCH_ID";
|
|
152
|
+
readonly MISSING_CANCEL_COMMAND_SCOPE: "MISSING_CANCEL_COMMAND_SCOPE";
|
|
153
|
+
readonly CMD_ID_REQUIRES_NODE_ID: "CMD_ID_REQUIRES_NODE_ID";
|
|
151
154
|
};
|
|
152
155
|
declare const TokenErrorCodes: {
|
|
153
156
|
readonly MISSING_ACCESS_TOKEN: "MISSING_ACCESS_TOKEN";
|
|
@@ -52,6 +52,8 @@ declare const apiCallValidationErrorMessages: {
|
|
|
52
52
|
MISSING_PLATFORM_NAME: string;
|
|
53
53
|
MISSING_PLATFORM_APPLICATION_ARN: string;
|
|
54
54
|
MISSING_BATCH_ID: string;
|
|
55
|
+
MISSING_CANCEL_COMMAND_SCOPE: string;
|
|
56
|
+
CMD_ID_REQUIRES_NODE_ID: string;
|
|
55
57
|
};
|
|
56
58
|
declare const tokenErrorMessages: {
|
|
57
59
|
MISSING_ACCESS_TOKEN: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CancelCommandRequestsParams, CancelCommandRequestsResponse } from "../../types/command_response.cjs";
|
|
7
|
+
declare module "../../ESPRMAdminNode.cjs" {
|
|
8
|
+
interface ESPRMAdminNode {
|
|
9
|
+
/**
|
|
10
|
+
* Cancels pending (`requested` or `in_progress`) command requests created by any user.
|
|
11
|
+
*
|
|
12
|
+
* - `request_id`: cancels that request. The backend rejects the call (131020)
|
|
13
|
+
* when the request is no longer pending.
|
|
14
|
+
* - `node_id`: cancels every pending request for the node, optionally narrowed
|
|
15
|
+
* by `cmd_id`. Returns `total_cancelled: 0` when nothing matches.
|
|
16
|
+
*
|
|
17
|
+
* @param params - The cancel scope.
|
|
18
|
+
* @returns The number of requests that were cancelled.
|
|
19
|
+
*/
|
|
20
|
+
cancelCommandRequests(params: CancelCommandRequestsParams): Promise<CancelCommandRequestsResponse>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -7,9 +7,10 @@ import { GetMQTTHostResponse } from "../../types/node_registration.cjs";
|
|
|
7
7
|
declare module "../../ESPRMAdminNodeRegistration.cjs" {
|
|
8
8
|
interface ESPRMAdminNodeRegistration {
|
|
9
9
|
/**
|
|
10
|
-
* Retrieves the default MQTT host
|
|
10
|
+
* Retrieves the deployment's default node endpoints: the MQTT host, the
|
|
11
|
+
* IoT credential provider host and, when configured, the HTTPS host.
|
|
11
12
|
*
|
|
12
|
-
* @returns The
|
|
13
|
+
* @returns The node endpoint information.
|
|
13
14
|
*/
|
|
14
15
|
getMQTTHost(): Promise<GetMQTTHostResponse>;
|
|
15
16
|
}
|
|
@@ -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 { GetNodeCertificateUploadUrlParams, NodeCertificateUploadUrlResponse } from "../../types/node_registration.cjs";
|
|
7
|
+
declare module "../../ESPRMAdminNodeRegistration.cjs" {
|
|
8
|
+
interface ESPRMAdminNodeRegistration {
|
|
9
|
+
/**
|
|
10
|
+
* Fetches a pre-signed URL to upload a node certificates CSV, along with
|
|
11
|
+
* the request ID to pass to `registerNodeCertificates`.
|
|
12
|
+
*
|
|
13
|
+
* @param params - Must include the name of the CSV file.
|
|
14
|
+
* @returns The pre-signed upload URL and the registration request ID.
|
|
15
|
+
*/
|
|
16
|
+
getNodeCertificateUploadUrl(params: GetNodeCertificateUploadUrlParams): Promise<NodeCertificateUploadUrlResponse>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { NodeRegistrationRequestDetail } from "../../types/node_registration.cjs";
|
|
7
|
+
declare module "../../ESPRMAdminNodeRegistration.cjs" {
|
|
8
|
+
interface ESPRMAdminNodeRegistration {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves the full detail of a node certificate registration request.
|
|
11
|
+
*
|
|
12
|
+
* @param requestId - The ID of the registration request.
|
|
13
|
+
* @returns The registration request detail.
|
|
14
|
+
*/
|
|
15
|
+
getNodeRegistrationRequest(requestId: string): Promise<NodeRegistrationRequestDetail>;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -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 { ListNodeRegistrationRequestsParams } from "../../types/node_registration.cjs";
|
|
7
|
+
import { ListNodeRegistrationRequestsResponse } from "../../types/node_registration.cjs";
|
|
8
|
+
declare module "../../ESPRMAdminNodeRegistration.cjs" {
|
|
9
|
+
interface ESPRMAdminNodeRegistration {
|
|
10
|
+
/**
|
|
11
|
+
* Lists the node certificate registration requests of the signed-in
|
|
12
|
+
* admin, newest first.
|
|
13
|
+
*
|
|
14
|
+
* @param params - Optional status filter and pagination.
|
|
15
|
+
* @returns A page of registration requests.
|
|
16
|
+
*/
|
|
17
|
+
listNodeRegistrationRequests(params?: ListNodeRegistrationRequestsParams): Promise<ListNodeRegistrationRequestsResponse>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -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";
|
|
@@ -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
|
+
}
|
|
@@ -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";
|