acn-client 0.11.2 → 0.12.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/dist/index.d.mts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +21 -0
- package/dist/index.mjs +21 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -764,6 +764,30 @@ declare class ACNClient {
|
|
|
764
764
|
success: boolean;
|
|
765
765
|
message: string;
|
|
766
766
|
}>;
|
|
767
|
+
/**
|
|
768
|
+
* Rotate the agent's API key (H1).
|
|
769
|
+
*
|
|
770
|
+
* Returns a fresh `acn_*` plaintext key exactly once. The old key
|
|
771
|
+
* stops working immediately — including any in-process auth caches
|
|
772
|
+
* the gateway holds for it. Update the local SDK's stored key with
|
|
773
|
+
* the returned value before the next request:
|
|
774
|
+
*
|
|
775
|
+
* ```ts
|
|
776
|
+
* const { api_key } = await client.rotateApiKey(agentId);
|
|
777
|
+
* client.config.apiKey = api_key; // or rebuild the client
|
|
778
|
+
* ```
|
|
779
|
+
*
|
|
780
|
+
* Authorization is dual-track on the server: any one of the agent's
|
|
781
|
+
* current key (the common scheduled-rotation path) or the owner's
|
|
782
|
+
* Auth0 JWT (the recovery path when the agent has lost its key) is
|
|
783
|
+
* accepted.
|
|
784
|
+
*/
|
|
785
|
+
rotateApiKey(agentId: string): Promise<{
|
|
786
|
+
success: boolean;
|
|
787
|
+
agent_id: string;
|
|
788
|
+
api_key: string;
|
|
789
|
+
message: string;
|
|
790
|
+
}>;
|
|
767
791
|
/** Send agent heartbeat */
|
|
768
792
|
heartbeat(agentId: string): Promise<{
|
|
769
793
|
success: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -764,6 +764,30 @@ declare class ACNClient {
|
|
|
764
764
|
success: boolean;
|
|
765
765
|
message: string;
|
|
766
766
|
}>;
|
|
767
|
+
/**
|
|
768
|
+
* Rotate the agent's API key (H1).
|
|
769
|
+
*
|
|
770
|
+
* Returns a fresh `acn_*` plaintext key exactly once. The old key
|
|
771
|
+
* stops working immediately — including any in-process auth caches
|
|
772
|
+
* the gateway holds for it. Update the local SDK's stored key with
|
|
773
|
+
* the returned value before the next request:
|
|
774
|
+
*
|
|
775
|
+
* ```ts
|
|
776
|
+
* const { api_key } = await client.rotateApiKey(agentId);
|
|
777
|
+
* client.config.apiKey = api_key; // or rebuild the client
|
|
778
|
+
* ```
|
|
779
|
+
*
|
|
780
|
+
* Authorization is dual-track on the server: any one of the agent's
|
|
781
|
+
* current key (the common scheduled-rotation path) or the owner's
|
|
782
|
+
* Auth0 JWT (the recovery path when the agent has lost its key) is
|
|
783
|
+
* accepted.
|
|
784
|
+
*/
|
|
785
|
+
rotateApiKey(agentId: string): Promise<{
|
|
786
|
+
success: boolean;
|
|
787
|
+
agent_id: string;
|
|
788
|
+
api_key: string;
|
|
789
|
+
message: string;
|
|
790
|
+
}>;
|
|
767
791
|
/** Send agent heartbeat */
|
|
768
792
|
heartbeat(agentId: string): Promise<{
|
|
769
793
|
success: boolean;
|
package/dist/index.js
CHANGED
|
@@ -194,6 +194,27 @@ var ACNClient = class {
|
|
|
194
194
|
async unregisterAgent(agentId) {
|
|
195
195
|
return this.delete(`/api/v1/agents/${agentId}`);
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Rotate the agent's API key (H1).
|
|
199
|
+
*
|
|
200
|
+
* Returns a fresh `acn_*` plaintext key exactly once. The old key
|
|
201
|
+
* stops working immediately — including any in-process auth caches
|
|
202
|
+
* the gateway holds for it. Update the local SDK's stored key with
|
|
203
|
+
* the returned value before the next request:
|
|
204
|
+
*
|
|
205
|
+
* ```ts
|
|
206
|
+
* const { api_key } = await client.rotateApiKey(agentId);
|
|
207
|
+
* client.config.apiKey = api_key; // or rebuild the client
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* Authorization is dual-track on the server: any one of the agent's
|
|
211
|
+
* current key (the common scheduled-rotation path) or the owner's
|
|
212
|
+
* Auth0 JWT (the recovery path when the agent has lost its key) is
|
|
213
|
+
* accepted.
|
|
214
|
+
*/
|
|
215
|
+
async rotateApiKey(agentId) {
|
|
216
|
+
return this.post(`/api/v1/agents/${agentId}/rotate-key`);
|
|
217
|
+
}
|
|
197
218
|
/** Send agent heartbeat */
|
|
198
219
|
async heartbeat(agentId) {
|
|
199
220
|
return this.post(`/api/v1/agents/${agentId}/heartbeat`);
|
package/dist/index.mjs
CHANGED
|
@@ -154,6 +154,27 @@ var ACNClient = class {
|
|
|
154
154
|
async unregisterAgent(agentId) {
|
|
155
155
|
return this.delete(`/api/v1/agents/${agentId}`);
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Rotate the agent's API key (H1).
|
|
159
|
+
*
|
|
160
|
+
* Returns a fresh `acn_*` plaintext key exactly once. The old key
|
|
161
|
+
* stops working immediately — including any in-process auth caches
|
|
162
|
+
* the gateway holds for it. Update the local SDK's stored key with
|
|
163
|
+
* the returned value before the next request:
|
|
164
|
+
*
|
|
165
|
+
* ```ts
|
|
166
|
+
* const { api_key } = await client.rotateApiKey(agentId);
|
|
167
|
+
* client.config.apiKey = api_key; // or rebuild the client
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* Authorization is dual-track on the server: any one of the agent's
|
|
171
|
+
* current key (the common scheduled-rotation path) or the owner's
|
|
172
|
+
* Auth0 JWT (the recovery path when the agent has lost its key) is
|
|
173
|
+
* accepted.
|
|
174
|
+
*/
|
|
175
|
+
async rotateApiKey(agentId) {
|
|
176
|
+
return this.post(`/api/v1/agents/${agentId}/rotate-key`);
|
|
177
|
+
}
|
|
157
178
|
/** Send agent heartbeat */
|
|
158
179
|
async heartbeat(agentId) {
|
|
159
180
|
return this.post(`/api/v1/agents/${agentId}/heartbeat`);
|