@espressif/rainmaker-admin-sdk 1.1.1 → 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 +102 -0
- 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/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/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/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/utils/constants.d.cts +3 -0
- package/dist/types-cjs/utils/error/errorMessages.d.cts +2 -0
- package/package.json +1 -1
|
@@ -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.cjs";
|
|
11
11
|
export type { AdminGroupInfo, CreateAdminGroupResponse, GetAdminGroupsResponse, } from "./group.cjs";
|
|
12
12
|
export type { TagResourceInfo, GetAdminTagsResponse, GetTagNamesResponse, } from "./tag.cjs";
|
|
13
|
-
export type { CommandRequestInfo, GetCommandRequestsResponse, AddCommandRequestResponse, } from "./command_response.cjs";
|
|
13
|
+
export type { CommandRequestInfo, GetCommandRequestsResponse, AddCommandRequestResponse, CancelCommandRequestsResponse, CommandRequestDataError, } from "./command_response.cjs";
|
|
14
14
|
export type { EventFilterInfo, GetEventFiltersResponse } from "./event_filter.cjs";
|
|
15
15
|
export type { TimeSeriesParamData, TimeSeriesNodeData, GetTimeSeriesDataResponse, GetSimpleTimeSeriesDataResponse, } from "./time_series.cjs";
|
|
16
16
|
export type { CustomDataResponse } from "./custom_data.cjs";
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@espressif/rainmaker-admin-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.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",
|