@copilotz/admin 0.3.7 → 0.3.8
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.cjs +1224 -337
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +1150 -269
- package/dist/index.js.map +1 -1
- package/dist/styles.css +67 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,10 +3,11 @@ import React, { ReactNode } from 'react';
|
|
|
3
3
|
type RequestHeadersProvider = () => Record<string, string> | Promise<Record<string, string>>;
|
|
4
4
|
type AdminDatePreset = "24h" | "7d" | "30d";
|
|
5
5
|
type AdminActivityInterval = "hour" | "day";
|
|
6
|
-
type AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "agents" | "events";
|
|
6
|
+
type AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "participant-detail" | "agents" | "agent-detail" | "collection-items" | "collection-item-detail" | "events";
|
|
7
7
|
interface AdminRoute {
|
|
8
8
|
page: AdminPage;
|
|
9
9
|
resourceId?: string;
|
|
10
|
+
collection?: string;
|
|
10
11
|
}
|
|
11
12
|
interface AdminOverview {
|
|
12
13
|
threadTotals: {
|
|
@@ -126,6 +127,24 @@ interface AdminMessagePage {
|
|
|
126
127
|
data: AdminMessage[];
|
|
127
128
|
pageInfo: AdminMessagePageInfo;
|
|
128
129
|
}
|
|
130
|
+
type AdminParticipantDetail = Record<string, unknown>;
|
|
131
|
+
type AdminCollectionItem = Record<string, unknown> & {
|
|
132
|
+
id?: string;
|
|
133
|
+
};
|
|
134
|
+
interface AdminQueueEvent {
|
|
135
|
+
id: string;
|
|
136
|
+
threadId: string;
|
|
137
|
+
eventType: string;
|
|
138
|
+
payload: unknown;
|
|
139
|
+
parentEventId: string | null;
|
|
140
|
+
traceId: string | null;
|
|
141
|
+
priority: number | null;
|
|
142
|
+
status: "pending" | "processing" | "completed" | "failed" | "expired" | "overwritten";
|
|
143
|
+
namespace: string | null;
|
|
144
|
+
metadata: Record<string, unknown> | null;
|
|
145
|
+
createdAt: string | null;
|
|
146
|
+
updatedAt: string | null;
|
|
147
|
+
}
|
|
129
148
|
interface AdminFilters {
|
|
130
149
|
namespace?: string;
|
|
131
150
|
range?: AdminDatePreset;
|
|
@@ -174,6 +193,8 @@ interface AdminConfig {
|
|
|
174
193
|
noResults?: string;
|
|
175
194
|
eventsTitle?: string;
|
|
176
195
|
dashboardTitle?: string;
|
|
196
|
+
collectionsTitle?: string;
|
|
197
|
+
collectionsEndpoint?: string;
|
|
177
198
|
};
|
|
178
199
|
features?: {
|
|
179
200
|
showOverview?: boolean;
|
|
@@ -182,6 +203,7 @@ interface AdminConfig {
|
|
|
182
203
|
showParticipants?: boolean;
|
|
183
204
|
showAgents?: boolean;
|
|
184
205
|
showEvents?: boolean;
|
|
206
|
+
showCollections?: boolean;
|
|
185
207
|
};
|
|
186
208
|
ui?: {
|
|
187
209
|
compact?: boolean;
|
|
@@ -250,8 +272,22 @@ declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActiv
|
|
|
250
272
|
declare function fetchAdminThreads(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminThreadSummary[]>;
|
|
251
273
|
declare function fetchAdminParticipants(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminParticipantSummary[]>;
|
|
252
274
|
declare function fetchAdminAgents(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminAgentSummary[]>;
|
|
275
|
+
declare function fetchParticipantDetail(participantId: string, options?: FetchOptions): Promise<AdminParticipantDetail | null>;
|
|
276
|
+
declare function updateParticipant(participantId: string, data: Record<string, unknown>, options?: FetchOptions): Promise<AdminParticipantDetail>;
|
|
277
|
+
declare function fetchCollectionNames(options?: FetchOptions): Promise<string[]>;
|
|
278
|
+
declare function fetchCollectionItems(collection: string, queryOptions?: {
|
|
279
|
+
search?: string;
|
|
280
|
+
namespace?: string;
|
|
281
|
+
limit?: number;
|
|
282
|
+
offset?: number;
|
|
283
|
+
}, options?: FetchOptions): Promise<AdminCollectionItem[]>;
|
|
284
|
+
declare function fetchCollectionItem(collection: string, itemId: string, namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
285
|
+
declare function createCollectionItem(collection: string, data: Record<string, unknown>, namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
286
|
+
declare function updateCollectionItem(collection: string, itemId: string, data: Record<string, unknown>, namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
287
|
+
declare function deleteCollectionItem(collection: string, itemId: string, namespace?: string, options?: FetchOptions): Promise<void>;
|
|
288
|
+
declare function fetchThreadEvents(threadId: string, options?: FetchOptions): Promise<AdminQueueEvent | undefined>;
|
|
253
289
|
|
|
254
290
|
declare const defaultAdminConfig: ResolvedAdminConfig;
|
|
255
291
|
declare function mergeAdminConfig(_baseConfig: ResolvedAdminConfig, userConfig?: Partial<AdminConfig>): ResolvedAdminConfig;
|
|
256
292
|
|
|
257
|
-
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantSummary, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, defaultAdminConfig, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, mergeAdminConfig, useCopilotzAdmin };
|
|
293
|
+
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantDetail, type AdminParticipantSummary, type AdminQueueEvent, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, createCollectionItem, defaultAdminConfig, deleteCollectionItem, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, fetchCollectionItem, fetchCollectionItems, fetchCollectionNames, fetchParticipantDetail, fetchThreadEvents, mergeAdminConfig, updateCollectionItem, updateParticipant, useCopilotzAdmin };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import React, { ReactNode } from 'react';
|
|
|
3
3
|
type RequestHeadersProvider = () => Record<string, string> | Promise<Record<string, string>>;
|
|
4
4
|
type AdminDatePreset = "24h" | "7d" | "30d";
|
|
5
5
|
type AdminActivityInterval = "hour" | "day";
|
|
6
|
-
type AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "agents" | "events";
|
|
6
|
+
type AdminPage = "dashboard" | "threads" | "thread-detail" | "participants" | "participant-detail" | "agents" | "agent-detail" | "collection-items" | "collection-item-detail" | "events";
|
|
7
7
|
interface AdminRoute {
|
|
8
8
|
page: AdminPage;
|
|
9
9
|
resourceId?: string;
|
|
10
|
+
collection?: string;
|
|
10
11
|
}
|
|
11
12
|
interface AdminOverview {
|
|
12
13
|
threadTotals: {
|
|
@@ -126,6 +127,24 @@ interface AdminMessagePage {
|
|
|
126
127
|
data: AdminMessage[];
|
|
127
128
|
pageInfo: AdminMessagePageInfo;
|
|
128
129
|
}
|
|
130
|
+
type AdminParticipantDetail = Record<string, unknown>;
|
|
131
|
+
type AdminCollectionItem = Record<string, unknown> & {
|
|
132
|
+
id?: string;
|
|
133
|
+
};
|
|
134
|
+
interface AdminQueueEvent {
|
|
135
|
+
id: string;
|
|
136
|
+
threadId: string;
|
|
137
|
+
eventType: string;
|
|
138
|
+
payload: unknown;
|
|
139
|
+
parentEventId: string | null;
|
|
140
|
+
traceId: string | null;
|
|
141
|
+
priority: number | null;
|
|
142
|
+
status: "pending" | "processing" | "completed" | "failed" | "expired" | "overwritten";
|
|
143
|
+
namespace: string | null;
|
|
144
|
+
metadata: Record<string, unknown> | null;
|
|
145
|
+
createdAt: string | null;
|
|
146
|
+
updatedAt: string | null;
|
|
147
|
+
}
|
|
129
148
|
interface AdminFilters {
|
|
130
149
|
namespace?: string;
|
|
131
150
|
range?: AdminDatePreset;
|
|
@@ -174,6 +193,8 @@ interface AdminConfig {
|
|
|
174
193
|
noResults?: string;
|
|
175
194
|
eventsTitle?: string;
|
|
176
195
|
dashboardTitle?: string;
|
|
196
|
+
collectionsTitle?: string;
|
|
197
|
+
collectionsEndpoint?: string;
|
|
177
198
|
};
|
|
178
199
|
features?: {
|
|
179
200
|
showOverview?: boolean;
|
|
@@ -182,6 +203,7 @@ interface AdminConfig {
|
|
|
182
203
|
showParticipants?: boolean;
|
|
183
204
|
showAgents?: boolean;
|
|
184
205
|
showEvents?: boolean;
|
|
206
|
+
showCollections?: boolean;
|
|
185
207
|
};
|
|
186
208
|
ui?: {
|
|
187
209
|
compact?: boolean;
|
|
@@ -250,8 +272,22 @@ declare function fetchAdminActivity(range: AdminDatePreset, interval: AdminActiv
|
|
|
250
272
|
declare function fetchAdminThreads(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminThreadSummary[]>;
|
|
251
273
|
declare function fetchAdminParticipants(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminParticipantSummary[]>;
|
|
252
274
|
declare function fetchAdminAgents(search?: string, namespace?: string, options?: FetchOptions): Promise<AdminAgentSummary[]>;
|
|
275
|
+
declare function fetchParticipantDetail(participantId: string, options?: FetchOptions): Promise<AdminParticipantDetail | null>;
|
|
276
|
+
declare function updateParticipant(participantId: string, data: Record<string, unknown>, options?: FetchOptions): Promise<AdminParticipantDetail>;
|
|
277
|
+
declare function fetchCollectionNames(options?: FetchOptions): Promise<string[]>;
|
|
278
|
+
declare function fetchCollectionItems(collection: string, queryOptions?: {
|
|
279
|
+
search?: string;
|
|
280
|
+
namespace?: string;
|
|
281
|
+
limit?: number;
|
|
282
|
+
offset?: number;
|
|
283
|
+
}, options?: FetchOptions): Promise<AdminCollectionItem[]>;
|
|
284
|
+
declare function fetchCollectionItem(collection: string, itemId: string, namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
285
|
+
declare function createCollectionItem(collection: string, data: Record<string, unknown>, namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
286
|
+
declare function updateCollectionItem(collection: string, itemId: string, data: Record<string, unknown>, namespace?: string, options?: FetchOptions): Promise<AdminCollectionItem>;
|
|
287
|
+
declare function deleteCollectionItem(collection: string, itemId: string, namespace?: string, options?: FetchOptions): Promise<void>;
|
|
288
|
+
declare function fetchThreadEvents(threadId: string, options?: FetchOptions): Promise<AdminQueueEvent | undefined>;
|
|
253
289
|
|
|
254
290
|
declare const defaultAdminConfig: ResolvedAdminConfig;
|
|
255
291
|
declare function mergeAdminConfig(_baseConfig: ResolvedAdminConfig, userConfig?: Partial<AdminConfig>): ResolvedAdminConfig;
|
|
256
292
|
|
|
257
|
-
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantSummary, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, defaultAdminConfig, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, mergeAdminConfig, useCopilotzAdmin };
|
|
293
|
+
export { type AdminActivityInterval, type AdminActivityPoint, type AdminAgentSummary, type AdminCollectionItem, type AdminConfig, type AdminDatePreset, type AdminFilters, type AdminMessage, type AdminMessagePage, type AdminMessagePageInfo, type AdminOverview, type AdminPage, type AdminParticipantDetail, type AdminParticipantSummary, type AdminQueueEvent, type AdminRoute, type AdminSectionState, type AdminThreadDetail, type AdminThreadSummary, CopilotzAdmin, type RequestHeadersProvider, type UseCopilotzAdminOptions, type UseCopilotzAdminResult, createCollectionItem, defaultAdminConfig, deleteCollectionItem, fetchAdminActivity, fetchAdminAgents, fetchAdminOverview, fetchAdminParticipants, fetchAdminThreads, fetchCollectionItem, fetchCollectionItems, fetchCollectionNames, fetchParticipantDetail, fetchThreadEvents, mergeAdminConfig, updateCollectionItem, updateParticipant, useCopilotzAdmin };
|