@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.
Files changed (119) hide show
  1. package/CHANGELOG.md +209 -0
  2. package/README.md +2 -1
  3. package/dist/cjs/ESPRMBase.cjs +1 -0
  4. package/dist/cjs/ESPRMClaim.cjs +16 -0
  5. package/dist/cjs/entries/ESPRMAdminCommonCustomData.cjs +1 -0
  6. package/dist/cjs/entries/ESPRMAdminNode.cjs +2 -0
  7. package/dist/cjs/entries/ESPRMAdminNodeRegistration.cjs +3 -0
  8. package/dist/cjs/entries/ESPRMClaim.cjs +14 -0
  9. package/dist/cjs/index.cjs +11 -0
  10. package/dist/cjs/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.cjs +24 -0
  11. package/dist/cjs/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.cjs +7 -0
  12. package/dist/cjs/methods/ESPRMAdminNode/ActivateDeactivateNodes.cjs +11 -1
  13. package/dist/cjs/methods/ESPRMAdminNode/CancelCommandRequests.cjs +27 -0
  14. package/dist/cjs/methods/ESPRMAdminNode/DeleteNode.cjs +24 -0
  15. package/dist/cjs/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.cjs +25 -0
  16. package/dist/cjs/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.cjs +24 -0
  17. package/dist/cjs/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.cjs +21 -0
  18. package/dist/cjs/methods/ESPRMClaim/InitiateClaim.cjs +28 -0
  19. package/dist/cjs/methods/ESPRMClaim/VerifyClaim.cjs +28 -0
  20. package/dist/cjs/services/ESPRMAPIManager.cjs +15 -1
  21. package/dist/cjs/utils/constants.cjs +17 -0
  22. package/dist/cjs/utils/error/errorMessages.cjs +11 -0
  23. package/dist/cjs/utils/validator/ConfigValidator.cjs +9 -0
  24. package/dist/esm/ESPRMBase.js +1 -0
  25. package/dist/esm/ESPRMClaim.js +14 -0
  26. package/dist/esm/entries/ESPRMAdminCommonCustomData.js +1 -0
  27. package/dist/esm/entries/ESPRMAdminNode.js +2 -0
  28. package/dist/esm/entries/ESPRMAdminNodeRegistration.js +3 -0
  29. package/dist/esm/entries/ESPRMClaim.js +8 -0
  30. package/dist/esm/index.js +10 -1
  31. package/dist/esm/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.js +22 -0
  32. package/dist/esm/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.js +8 -1
  33. package/dist/esm/methods/ESPRMAdminNode/ActivateDeactivateNodes.js +12 -2
  34. package/dist/esm/methods/ESPRMAdminNode/CancelCommandRequests.js +25 -0
  35. package/dist/esm/methods/ESPRMAdminNode/DeleteNode.js +22 -0
  36. package/dist/esm/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.js +23 -0
  37. package/dist/esm/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.js +22 -0
  38. package/dist/esm/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.js +19 -0
  39. package/dist/esm/methods/ESPRMClaim/InitiateClaim.js +26 -0
  40. package/dist/esm/methods/ESPRMClaim/VerifyClaim.js +26 -0
  41. package/dist/esm/services/ESPRMAPIManager.js +15 -1
  42. package/dist/esm/utils/constants.js +17 -1
  43. package/dist/esm/utils/error/errorMessages.js +11 -0
  44. package/dist/esm/utils/validator/ConfigValidator.js +9 -0
  45. package/dist/types/ESPRMClaim.d.ts +12 -0
  46. package/dist/types/entries/ESPRMClaim.d.ts +7 -0
  47. package/dist/types/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.d.ts +22 -0
  48. package/dist/types/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.d.ts +6 -1
  49. package/dist/types/methods/ESPRMAdminCommonCustomData/index.d.ts +1 -0
  50. package/dist/types/methods/ESPRMAdminEventFilter/UpdateEventFilter.d.ts +5 -0
  51. package/dist/types/methods/ESPRMAdminNode/ActivateDeactivateNodes.d.ts +9 -6
  52. package/dist/types/methods/ESPRMAdminNode/CancelCommandRequests.d.ts +22 -0
  53. package/dist/types/methods/ESPRMAdminNode/DeleteNode.d.ts +19 -0
  54. package/dist/types/methods/ESPRMAdminNode/index.d.ts +2 -0
  55. package/dist/types/methods/ESPRMAdminNodeRegistration/GetMQTTHost.d.ts +3 -2
  56. package/dist/types/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.d.ts +18 -0
  57. package/dist/types/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.d.ts +17 -0
  58. package/dist/types/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.d.ts +19 -0
  59. package/dist/types/methods/ESPRMAdminNodeRegistration/RegisterNodeCertificates.d.ts +6 -6
  60. package/dist/types/methods/ESPRMAdminNodeRegistration/index.d.ts +3 -0
  61. package/dist/types/methods/ESPRMAdminWebhook/GetWebhookIntegrations.d.ts +2 -1
  62. package/dist/types/methods/ESPRMClaim/InitiateClaim.d.ts +21 -0
  63. package/dist/types/methods/ESPRMClaim/VerifyClaim.d.ts +21 -0
  64. package/dist/types/methods/ESPRMClaim/index.d.ts +7 -0
  65. package/dist/types/methods/export.d.ts +1 -0
  66. package/dist/types/services/ESPRMAPIManager.d.ts +6 -0
  67. package/dist/types/types/claim.d.ts +45 -0
  68. package/dist/types/types/command_response.d.ts +56 -7
  69. package/dist/types/types/common_custom_data.d.ts +32 -5
  70. package/dist/types/types/config.d.ts +9 -0
  71. package/dist/types/types/event_filter.d.ts +17 -3
  72. package/dist/types/types/index.d.ts +1 -0
  73. package/dist/types/types/input.d.ts +3 -2
  74. package/dist/types/types/mainTypes.d.ts +2 -1
  75. package/dist/types/types/node.d.ts +33 -3
  76. package/dist/types/types/node_registration.d.ts +164 -12
  77. package/dist/types/types/output.d.ts +3 -2
  78. package/dist/types/types/webhook.d.ts +5 -2
  79. package/dist/types/utils/constants.d.ts +17 -1
  80. package/dist/types/utils/error/errorMessages.d.ts +11 -0
  81. package/dist/types/utils/validator/ConfigValidator.d.ts +1 -0
  82. package/dist/types-cjs/ESPRMClaim.d.cts +12 -0
  83. package/dist/types-cjs/entries/ESPRMClaim.d.cts +7 -0
  84. package/dist/types-cjs/methods/ESPRMAdminCommonCustomData/DeleteCommonCustomData.d.cts +22 -0
  85. package/dist/types-cjs/methods/ESPRMAdminCommonCustomData/SetCommonCustomData.d.cts +6 -1
  86. package/dist/types-cjs/methods/ESPRMAdminCommonCustomData/index.d.cts +1 -0
  87. package/dist/types-cjs/methods/ESPRMAdminEventFilter/UpdateEventFilter.d.cts +5 -0
  88. package/dist/types-cjs/methods/ESPRMAdminNode/ActivateDeactivateNodes.d.cts +9 -6
  89. package/dist/types-cjs/methods/ESPRMAdminNode/CancelCommandRequests.d.cts +22 -0
  90. package/dist/types-cjs/methods/ESPRMAdminNode/DeleteNode.d.cts +19 -0
  91. package/dist/types-cjs/methods/ESPRMAdminNode/index.d.cts +2 -0
  92. package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/GetMQTTHost.d.cts +3 -2
  93. package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/GetNodeCertificateUploadUrl.d.cts +18 -0
  94. package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/GetNodeRegistrationRequest.d.cts +17 -0
  95. package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/ListNodeRegistrationRequests.d.cts +19 -0
  96. package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/RegisterNodeCertificates.d.cts +6 -6
  97. package/dist/types-cjs/methods/ESPRMAdminNodeRegistration/index.d.cts +3 -0
  98. package/dist/types-cjs/methods/ESPRMAdminWebhook/GetWebhookIntegrations.d.cts +2 -1
  99. package/dist/types-cjs/methods/ESPRMClaim/InitiateClaim.d.cts +21 -0
  100. package/dist/types-cjs/methods/ESPRMClaim/VerifyClaim.d.cts +21 -0
  101. package/dist/types-cjs/methods/ESPRMClaim/index.d.cts +7 -0
  102. package/dist/types-cjs/methods/export.d.cts +1 -0
  103. package/dist/types-cjs/services/ESPRMAPIManager.d.cts +6 -0
  104. package/dist/types-cjs/types/claim.d.cts +45 -0
  105. package/dist/types-cjs/types/command_response.d.cts +56 -7
  106. package/dist/types-cjs/types/common_custom_data.d.cts +32 -5
  107. package/dist/types-cjs/types/config.d.cts +9 -0
  108. package/dist/types-cjs/types/event_filter.d.cts +17 -3
  109. package/dist/types-cjs/types/index.d.cts +1 -0
  110. package/dist/types-cjs/types/input.d.cts +3 -2
  111. package/dist/types-cjs/types/mainTypes.d.cts +2 -1
  112. package/dist/types-cjs/types/node.d.cts +33 -3
  113. package/dist/types-cjs/types/node_registration.d.cts +164 -12
  114. package/dist/types-cjs/types/output.d.cts +3 -2
  115. package/dist/types-cjs/types/webhook.d.cts +5 -2
  116. package/dist/types-cjs/utils/constants.d.cts +17 -1
  117. package/dist/types-cjs/utils/error/errorMessages.d.cts +11 -0
  118. package/dist/types-cjs/utils/validator/ConfigValidator.d.cts +1 -0
  119. package/package.json +11 -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
- /** Request body for registering node certificates. */
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
- /** List of node IDs to register certificates for. */
40
- node_ids: string[];
41
- /** List of certificates corresponding to the node IDs. */
42
- certs: string[];
43
- [key: string]: unknown;
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
- /** Response containing node certificate registration status. */
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?: string;
94
- [key: string]: unknown;
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 MQTT host endpoint. */
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";
@@ -29,7 +29,7 @@ export type { GetDashboardUpdateStatusResponse, GetDashboardVersionMappingRespon
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";
32
- export type { GetCommonCustomDataResponse } from "./common_custom_data.cjs";
32
+ export type { CommonCustomDataItem, GetCommonCustomDataResponse, } from "./common_custom_data.cjs";
33
33
  export type { GetDeploymentSettingsResponse, GetRbacDeploymentSettingResponse, RbacConfigurationValue, } from "./deployment_setting.cjs";
34
34
  export type { GetNotificationsResponse } from "./configuration.cjs";
35
35
  export type { GetIoTDeviceRateRuleResponse } from "./iot_device_rate_limit.cjs";
@@ -38,6 +38,7 @@ export type { CustomMessageTemplateInfo, GetCustomMessageTemplatesResponse, } fr
38
38
  export type { MobilePlatformInfo, CreateMobilePlatformResponse, GetMobilePlatformsResponse, } from "./mobile_platform.cjs";
39
39
  export type { PassthroughConfigInfo, CreatePassthroughConfigResponse, GetPassthroughConfigResponse, } from "./passthrough.cjs";
40
40
  export type { GetNodeCACertificateResponse } from "./node_certificate_ca.cjs";
41
+ export type { InitiateClaimResponse, VerifyClaimResponse } from "./claim.cjs";
41
42
  export type { WebhookIntegrationInfo, GetWebhookIntegrationsResponse, WebhookEventMappingInfo, GetWebhookEventMappingResponse, } from "./webhook.cjs";
42
43
  export type { StatsCount, StatsObject, GetStatsInfoResponse, } from "./statistical_service.cjs";
43
44
  export type { MailFailureInfo, GetMailFailuresResponse } from "./mail_failure.cjs";
@@ -63,8 +63,11 @@ export interface WebhookIntegrationInfo {
63
63
  }
64
64
  /** Response containing a list of webhook integrations. */
65
65
  export interface GetWebhookIntegrationsResponse {
66
- /** Array of webhook integration details. */
67
- webhooks_endpoints?: WebhookIntegrationInfo[];
66
+ /**
67
+ * Array of webhook integration details.
68
+ * The backend returns `null` when no integrations are configured.
69
+ */
70
+ integration_info_list?: WebhookIntegrationInfo[] | null;
68
71
  }
69
72
  /** Details of a webhook event mapping. */
70
73
  export interface WebhookEventMappingInfo {
@@ -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";
@@ -93,6 +94,8 @@ declare const APIEndpoints: {
93
94
  readonly ADMIN_MATTER_BATCH: "admin/matter/batch";
94
95
  readonly ADMIN_MATTER_BATCH_NODES: "admin/matter/batch/nodes";
95
96
  readonly ADMIN_MAIL_FAILURES: "admin/mail_failures";
97
+ readonly CLAIM_INITIATE: "claim/initiate";
98
+ readonly CLAIM_VERIFY: "claim/verify";
96
99
  };
97
100
  declare const StorageKeys: {
98
101
  readonly ACCESSTOKEN: "com.esprmbase.accessToken";
@@ -103,6 +106,8 @@ declare const ConfigErrorCodes: {
103
106
  readonly SDK_NOT_CONFIGURED: "SDK_NOT_CONFIGURED";
104
107
  readonly INVALID_CONFIG_OBJECT: "INVALID_CONFIG_OBJECT";
105
108
  readonly INVALID_BASE_URL: "INVALID_BASE_URL";
109
+ readonly INVALID_CLAIMING_BASE_URL: "INVALID_CLAIMING_BASE_URL";
110
+ readonly CLAIMING_NOT_CONFIGURED: "CLAIMING_NOT_CONFIGURED";
106
111
  };
107
112
  declare const ValidationErrorCodes: {
108
113
  readonly MISSING_LOGIN_PASSWORD: "MISSING_LOGIN_PASSWORD";
@@ -148,6 +153,15 @@ declare const APICallValidationErrorCodes: {
148
153
  readonly MISSING_PLATFORM_NAME: "MISSING_PLATFORM_NAME";
149
154
  readonly MISSING_PLATFORM_APPLICATION_ARN: "MISSING_PLATFORM_APPLICATION_ARN";
150
155
  readonly MISSING_BATCH_ID: "MISSING_BATCH_ID";
156
+ readonly MISSING_CANCEL_COMMAND_SCOPE: "MISSING_CANCEL_COMMAND_SCOPE";
157
+ readonly CMD_ID_REQUIRES_NODE_ID: "CMD_ID_REQUIRES_NODE_ID";
158
+ readonly MISSING_COMMON_CUSTOM_DATA_NAME: "MISSING_COMMON_CUSTOM_DATA_NAME";
159
+ readonly MISSING_COMMON_CUSTOM_DATA_VALUE: "MISSING_COMMON_CUSTOM_DATA_VALUE";
160
+ readonly MISSING_MAC_ADDRESS: "MISSING_MAC_ADDRESS";
161
+ readonly MISSING_CLAIM_PLATFORM: "MISSING_CLAIM_PLATFORM";
162
+ readonly MISSING_CSR: "MISSING_CSR";
163
+ readonly MISSING_NODE_IDS: "MISSING_NODE_IDS";
164
+ readonly TOO_MANY_NODE_IDS: "TOO_MANY_NODE_IDS";
151
165
  };
152
166
  declare const TokenErrorCodes: {
153
167
  readonly MISSING_ACCESS_TOKEN: "MISSING_ACCESS_TOKEN";
@@ -173,9 +187,11 @@ declare const DEFAULT_REST_API_VERSION = "v1";
173
187
  declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000;
174
188
  /** Tokens expiring within this many seconds are refreshed proactively. */
175
189
  declare const TOKEN_EXPIRY_MARGIN_SECONDS = 30;
190
+ /** Backend limit on node IDs per `PUT admin/nodes` activation request. */
191
+ declare const MAX_NODE_ACTIVATION_BATCH_SIZE = 25;
176
192
  /** errorCode values the SDK itself sets on ESPAPIError for non-HTTP failures. */
177
193
  declare const APIErrorCodes: {
178
194
  readonly REQUEST_TIMEOUT: "REQUEST_TIMEOUT";
179
195
  readonly NETWORK_ERROR: "NETWORK_ERROR";
180
196
  };
181
- export { HTTPMethods, APIEndpoints, StorageKeys, ConfigErrorCodes, ValidationErrorCodes, StorageAdapterErrorCodes, APICallValidationErrorCodes, TokenErrorCodes, ErrorLabels, HTTPStatusCodes, AdditionalInfo, DEFAULT_REST_API_VERSION, DEFAULT_REQUEST_TIMEOUT_MS, TOKEN_EXPIRY_MARGIN_SECONDS, APIErrorCodes, };
197
+ export { HTTPMethods, APIEndpoints, StorageKeys, ConfigErrorCodes, ValidationErrorCodes, StorageAdapterErrorCodes, APICallValidationErrorCodes, TokenErrorCodes, ErrorLabels, HTTPStatusCodes, AdditionalInfo, DEFAULT_REST_API_VERSION, DEFAULT_REQUEST_TIMEOUT_MS, TOKEN_EXPIRY_MARGIN_SECONDS, APIErrorCodes, MAX_NODE_ACTIVATION_BATCH_SIZE, };
@@ -7,6 +7,8 @@ declare const configErrorMessages: {
7
7
  SDK_NOT_CONFIGURED: string;
8
8
  INVALID_CONFIG_OBJECT: string;
9
9
  INVALID_BASE_URL: string;
10
+ INVALID_CLAIMING_BASE_URL: string;
11
+ CLAIMING_NOT_CONFIGURED: string;
10
12
  };
11
13
  declare const validationErrorMessages: {
12
14
  MISSING_LOGIN_PASSWORD: string;
@@ -18,6 +20,8 @@ declare const storageAdapterErrorMessages: {
18
20
  };
19
21
  declare const apiCallValidationErrorMessages: {
20
22
  MISSING_NODE_ID: string;
23
+ MISSING_NODE_IDS: string;
24
+ TOO_MANY_NODE_IDS: string;
21
25
  MISSING_OTA_IMAGE_ID: string;
22
26
  MISSING_ARCHIVE_FLAG: string;
23
27
  MISSING_OTA_JOB_ID: string;
@@ -52,6 +56,13 @@ declare const apiCallValidationErrorMessages: {
52
56
  MISSING_PLATFORM_NAME: string;
53
57
  MISSING_PLATFORM_APPLICATION_ARN: string;
54
58
  MISSING_BATCH_ID: string;
59
+ MISSING_CANCEL_COMMAND_SCOPE: string;
60
+ CMD_ID_REQUIRES_NODE_ID: string;
61
+ MISSING_COMMON_CUSTOM_DATA_NAME: string;
62
+ MISSING_COMMON_CUSTOM_DATA_VALUE: string;
63
+ MISSING_MAC_ADDRESS: string;
64
+ MISSING_CLAIM_PLATFORM: string;
65
+ MISSING_CSR: string;
55
66
  };
56
67
  declare const tokenErrorMessages: {
57
68
  MISSING_ACCESS_TOKEN: string;
@@ -7,5 +7,6 @@ import { ESPRMBaseConfig } from "../../types/config.cjs";
7
7
  export declare class ConfigValidator {
8
8
  static validateConfig(config: ESPRMBaseConfig): void;
9
9
  private static validateConfigObject;
10
+ private static validateClaimingBaseUrl;
10
11
  private static validateBaseUrl;
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@espressif/rainmaker-admin-sdk",
3
- "version": "1.1.1",
3
+ "version": "1.3.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",
@@ -527,6 +527,16 @@
527
527
  "default": "./dist/cjs/entries/ESPRMBase.cjs"
528
528
  }
529
529
  },
530
+ "./ESPRMClaim": {
531
+ "import": {
532
+ "types": "./dist/types/entries/ESPRMClaim.d.ts",
533
+ "default": "./dist/esm/entries/ESPRMClaim.js"
534
+ },
535
+ "require": {
536
+ "types": "./dist/types-cjs/entries/ESPRMClaim.d.cts",
537
+ "default": "./dist/cjs/entries/ESPRMClaim.cjs"
538
+ }
539
+ },
530
540
  "./ESPRMUser": {
531
541
  "import": {
532
542
  "types": "./dist/types/entries/ESPRMUser.d.ts",