@rine-network/core 0.4.1 → 0.4.3
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.js
CHANGED
|
@@ -182,6 +182,9 @@ var HttpClient = class {
|
|
|
182
182
|
delete(path, extraHeaders) {
|
|
183
183
|
return this.request("DELETE", path, void 0, void 0, extraHeaders);
|
|
184
184
|
}
|
|
185
|
+
async markDelivered(agentId, messageIds, extraHeaders) {
|
|
186
|
+
return this.post(`/agents/${agentId}/messages/mark-delivered`, { message_ids: messageIds }, extraHeaders);
|
|
187
|
+
}
|
|
185
188
|
/** Unauthenticated GET for public endpoints (e.g. /directory/*). */
|
|
186
189
|
static async publicGet(apiUrl, path, params) {
|
|
187
190
|
const qs = params?.toString();
|
|
@@ -243,7 +246,7 @@ function normalizeHandle(handle) {
|
|
|
243
246
|
const UUID_ALIAS_RE = /\/agents\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i;
|
|
244
247
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
245
248
|
/**
|
|
246
|
-
* Resolves a handle (e.g. "agent@org
|
|
249
|
+
* Resolves a handle (e.g. "agent@org") to a UUID
|
|
247
250
|
* via WebFinger (RFC 7033).
|
|
248
251
|
*
|
|
249
252
|
* Returns the UUID string on success, or the original input unchanged
|
package/dist/src/api-types.d.ts
CHANGED
|
@@ -65,9 +65,15 @@ export interface MessageRead {
|
|
|
65
65
|
sender_signing_kid?: string;
|
|
66
66
|
content_type?: string;
|
|
67
67
|
created_at: string;
|
|
68
|
+
delivered_at?: string;
|
|
69
|
+
read_at?: string;
|
|
70
|
+
status?: "new" | "delivered" | "read";
|
|
68
71
|
group_id?: string;
|
|
69
72
|
group_handle?: string;
|
|
70
73
|
}
|
|
74
|
+
export interface MarkDeliveredResponse {
|
|
75
|
+
marked: number;
|
|
76
|
+
}
|
|
71
77
|
export interface AgentKeysResponse {
|
|
72
78
|
agent_id: string;
|
|
73
79
|
signing_public_key: {
|
package/dist/src/http.d.ts
CHANGED
|
@@ -28,6 +28,9 @@ export declare class HttpClient {
|
|
|
28
28
|
put(path: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<unknown>;
|
|
29
29
|
patch(path: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<unknown>;
|
|
30
30
|
delete(path: string, extraHeaders?: Record<string, string>): Promise<unknown>;
|
|
31
|
+
markDelivered(agentId: string, messageIds: string[], extraHeaders?: Record<string, string>): Promise<{
|
|
32
|
+
marked: number;
|
|
33
|
+
}>;
|
|
31
34
|
/** Unauthenticated GET for public endpoints (e.g. /directory/*). */
|
|
32
35
|
static publicGet(apiUrl: string, path: string, params?: URLSearchParams): Promise<unknown>;
|
|
33
36
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function normalizeHandle(handle: string): string;
|
|
2
2
|
declare const UUID_RE: RegExp;
|
|
3
3
|
/**
|
|
4
|
-
* Resolves a handle (e.g. "agent@org
|
|
4
|
+
* Resolves a handle (e.g. "agent@org") to a UUID
|
|
5
5
|
* via WebFinger (RFC 7033).
|
|
6
6
|
*
|
|
7
7
|
* Returns the UUID string on success, or the original input unchanged
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|