@lpextend/node-sdk 1.1.4 → 1.1.5
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 +111 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1480,6 +1480,87 @@ interface CBConsumerQueryMetricsExtendedParams {
|
|
|
1480
1480
|
/** Optional progress callback */
|
|
1481
1481
|
onProgress?: (completed: number, total: number) => void;
|
|
1482
1482
|
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Request parameters for KB search events API
|
|
1485
|
+
* Used to retrieve actual customer queries and their outcomes
|
|
1486
|
+
*/
|
|
1487
|
+
interface CBKbSearchEventsRequest {
|
|
1488
|
+
/** Start time in milliseconds since epoch */
|
|
1489
|
+
startTime: string;
|
|
1490
|
+
/** End time in milliseconds since epoch */
|
|
1491
|
+
endTime: string;
|
|
1492
|
+
/** Page number (1-based) */
|
|
1493
|
+
pageNumber?: number;
|
|
1494
|
+
/** Number of results per page */
|
|
1495
|
+
pageSize?: number;
|
|
1496
|
+
/** Event types to filter by */
|
|
1497
|
+
eventType?: CBConsumerQueryEventType[];
|
|
1498
|
+
/** Optional KB ID to filter by (omit for all KBs) */
|
|
1499
|
+
kbId?: string;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Individual KB search event record
|
|
1503
|
+
* Represents a single customer query to the knowledge base
|
|
1504
|
+
*/
|
|
1505
|
+
interface CBKbSearchEvent {
|
|
1506
|
+
/** Document/Article ID that matched (if answered) */
|
|
1507
|
+
documentId: string;
|
|
1508
|
+
/** Event index */
|
|
1509
|
+
eventIndex: number;
|
|
1510
|
+
/** Unique event ID */
|
|
1511
|
+
eventId: string;
|
|
1512
|
+
/** Conversation ID where this query occurred */
|
|
1513
|
+
conversationId: string;
|
|
1514
|
+
/** LP Account ID */
|
|
1515
|
+
accountId: string;
|
|
1516
|
+
/** Knowledge Base ID */
|
|
1517
|
+
kbId: string;
|
|
1518
|
+
/** Knowledge Base name */
|
|
1519
|
+
kbName: string;
|
|
1520
|
+
/** Message ID */
|
|
1521
|
+
messageId: string;
|
|
1522
|
+
/** The actual customer query/question */
|
|
1523
|
+
question: string;
|
|
1524
|
+
/** Search mode used */
|
|
1525
|
+
searchMode: string;
|
|
1526
|
+
/** When the event was generated (timestamp) */
|
|
1527
|
+
eventGeneratedTime: number;
|
|
1528
|
+
/** Client that made the KAI request */
|
|
1529
|
+
kbClient: string;
|
|
1530
|
+
/** Threshold used for the search */
|
|
1531
|
+
requestedThreshold: string;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Pagination info for search events response
|
|
1535
|
+
*/
|
|
1536
|
+
interface CBKbSearchEventsPagination {
|
|
1537
|
+
/** Next page number (0 if no more pages) */
|
|
1538
|
+
nextPage: number;
|
|
1539
|
+
/** Current page number */
|
|
1540
|
+
page: number;
|
|
1541
|
+
/** Total number of events */
|
|
1542
|
+
totalSize: number;
|
|
1543
|
+
/** Total number of pages */
|
|
1544
|
+
totalPages: number;
|
|
1545
|
+
/** Number of results on this page */
|
|
1546
|
+
size: number;
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* Response from KB search events API
|
|
1550
|
+
*/
|
|
1551
|
+
interface CBKbSearchEventsResponse {
|
|
1552
|
+
/** Whether the request was successful */
|
|
1553
|
+
success: boolean;
|
|
1554
|
+
/** Success result containing pagination and events */
|
|
1555
|
+
successResult?: {
|
|
1556
|
+
pagination: CBKbSearchEventsPagination;
|
|
1557
|
+
KbSearchEvents: CBKbSearchEvent[];
|
|
1558
|
+
};
|
|
1559
|
+
/** Error result if request failed */
|
|
1560
|
+
errorResult?: {
|
|
1561
|
+
message: string;
|
|
1562
|
+
};
|
|
1563
|
+
}
|
|
1483
1564
|
|
|
1484
1565
|
/**
|
|
1485
1566
|
* AI Studio Types
|
|
@@ -3627,6 +3708,36 @@ declare class KnowledgeBasesAPI {
|
|
|
3627
3708
|
* ```
|
|
3628
3709
|
*/
|
|
3629
3710
|
getConsumerQueryMetricsExtended(params: CBConsumerQueryMetricsExtendedParams): Promise<CBConsumerQueryMetric[]>;
|
|
3711
|
+
/**
|
|
3712
|
+
* Get KB search events (real customer queries)
|
|
3713
|
+
*
|
|
3714
|
+
* Retrieves actual customer queries made to knowledge bases and their outcomes.
|
|
3715
|
+
* This API returns the raw questions customers asked, whether they were answered,
|
|
3716
|
+
* and which KB/articles were involved.
|
|
3717
|
+
*
|
|
3718
|
+
* @param request - Search events request parameters
|
|
3719
|
+
* @returns Promise resolving to search events with pagination
|
|
3720
|
+
*
|
|
3721
|
+
* @example
|
|
3722
|
+
* ```typescript
|
|
3723
|
+
* // Get unanswered questions from the last 7 days
|
|
3724
|
+
* const events = await sdk.conversationBuilder.knowledgeBases.getSearchEvents({
|
|
3725
|
+
* startTime: String(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
3726
|
+
* endTime: String(Date.now()),
|
|
3727
|
+
* eventType: ['EVENT_KB_UN_ANSWERED'],
|
|
3728
|
+
* pageSize: 50,
|
|
3729
|
+
* });
|
|
3730
|
+
*
|
|
3731
|
+
* // Get all events for a specific KB
|
|
3732
|
+
* const kbEvents = await sdk.conversationBuilder.knowledgeBases.getSearchEvents({
|
|
3733
|
+
* startTime: String(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
3734
|
+
* endTime: String(Date.now()),
|
|
3735
|
+
* kbId: 'kb-123',
|
|
3736
|
+
* eventType: ['EVENT_KB_ANSWERED', 'EVENT_KB_UN_ANSWERED'],
|
|
3737
|
+
* });
|
|
3738
|
+
* ```
|
|
3739
|
+
*/
|
|
3740
|
+
getSearchEvents(request: CBKbSearchEventsRequest): Promise<CBKbSearchEventsResponse>;
|
|
3630
3741
|
}
|
|
3631
3742
|
/**
|
|
3632
3743
|
* Bot Agents API
|
package/dist/index.d.ts
CHANGED
|
@@ -1480,6 +1480,87 @@ interface CBConsumerQueryMetricsExtendedParams {
|
|
|
1480
1480
|
/** Optional progress callback */
|
|
1481
1481
|
onProgress?: (completed: number, total: number) => void;
|
|
1482
1482
|
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Request parameters for KB search events API
|
|
1485
|
+
* Used to retrieve actual customer queries and their outcomes
|
|
1486
|
+
*/
|
|
1487
|
+
interface CBKbSearchEventsRequest {
|
|
1488
|
+
/** Start time in milliseconds since epoch */
|
|
1489
|
+
startTime: string;
|
|
1490
|
+
/** End time in milliseconds since epoch */
|
|
1491
|
+
endTime: string;
|
|
1492
|
+
/** Page number (1-based) */
|
|
1493
|
+
pageNumber?: number;
|
|
1494
|
+
/** Number of results per page */
|
|
1495
|
+
pageSize?: number;
|
|
1496
|
+
/** Event types to filter by */
|
|
1497
|
+
eventType?: CBConsumerQueryEventType[];
|
|
1498
|
+
/** Optional KB ID to filter by (omit for all KBs) */
|
|
1499
|
+
kbId?: string;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Individual KB search event record
|
|
1503
|
+
* Represents a single customer query to the knowledge base
|
|
1504
|
+
*/
|
|
1505
|
+
interface CBKbSearchEvent {
|
|
1506
|
+
/** Document/Article ID that matched (if answered) */
|
|
1507
|
+
documentId: string;
|
|
1508
|
+
/** Event index */
|
|
1509
|
+
eventIndex: number;
|
|
1510
|
+
/** Unique event ID */
|
|
1511
|
+
eventId: string;
|
|
1512
|
+
/** Conversation ID where this query occurred */
|
|
1513
|
+
conversationId: string;
|
|
1514
|
+
/** LP Account ID */
|
|
1515
|
+
accountId: string;
|
|
1516
|
+
/** Knowledge Base ID */
|
|
1517
|
+
kbId: string;
|
|
1518
|
+
/** Knowledge Base name */
|
|
1519
|
+
kbName: string;
|
|
1520
|
+
/** Message ID */
|
|
1521
|
+
messageId: string;
|
|
1522
|
+
/** The actual customer query/question */
|
|
1523
|
+
question: string;
|
|
1524
|
+
/** Search mode used */
|
|
1525
|
+
searchMode: string;
|
|
1526
|
+
/** When the event was generated (timestamp) */
|
|
1527
|
+
eventGeneratedTime: number;
|
|
1528
|
+
/** Client that made the KAI request */
|
|
1529
|
+
kbClient: string;
|
|
1530
|
+
/** Threshold used for the search */
|
|
1531
|
+
requestedThreshold: string;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Pagination info for search events response
|
|
1535
|
+
*/
|
|
1536
|
+
interface CBKbSearchEventsPagination {
|
|
1537
|
+
/** Next page number (0 if no more pages) */
|
|
1538
|
+
nextPage: number;
|
|
1539
|
+
/** Current page number */
|
|
1540
|
+
page: number;
|
|
1541
|
+
/** Total number of events */
|
|
1542
|
+
totalSize: number;
|
|
1543
|
+
/** Total number of pages */
|
|
1544
|
+
totalPages: number;
|
|
1545
|
+
/** Number of results on this page */
|
|
1546
|
+
size: number;
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* Response from KB search events API
|
|
1550
|
+
*/
|
|
1551
|
+
interface CBKbSearchEventsResponse {
|
|
1552
|
+
/** Whether the request was successful */
|
|
1553
|
+
success: boolean;
|
|
1554
|
+
/** Success result containing pagination and events */
|
|
1555
|
+
successResult?: {
|
|
1556
|
+
pagination: CBKbSearchEventsPagination;
|
|
1557
|
+
KbSearchEvents: CBKbSearchEvent[];
|
|
1558
|
+
};
|
|
1559
|
+
/** Error result if request failed */
|
|
1560
|
+
errorResult?: {
|
|
1561
|
+
message: string;
|
|
1562
|
+
};
|
|
1563
|
+
}
|
|
1483
1564
|
|
|
1484
1565
|
/**
|
|
1485
1566
|
* AI Studio Types
|
|
@@ -3627,6 +3708,36 @@ declare class KnowledgeBasesAPI {
|
|
|
3627
3708
|
* ```
|
|
3628
3709
|
*/
|
|
3629
3710
|
getConsumerQueryMetricsExtended(params: CBConsumerQueryMetricsExtendedParams): Promise<CBConsumerQueryMetric[]>;
|
|
3711
|
+
/**
|
|
3712
|
+
* Get KB search events (real customer queries)
|
|
3713
|
+
*
|
|
3714
|
+
* Retrieves actual customer queries made to knowledge bases and their outcomes.
|
|
3715
|
+
* This API returns the raw questions customers asked, whether they were answered,
|
|
3716
|
+
* and which KB/articles were involved.
|
|
3717
|
+
*
|
|
3718
|
+
* @param request - Search events request parameters
|
|
3719
|
+
* @returns Promise resolving to search events with pagination
|
|
3720
|
+
*
|
|
3721
|
+
* @example
|
|
3722
|
+
* ```typescript
|
|
3723
|
+
* // Get unanswered questions from the last 7 days
|
|
3724
|
+
* const events = await sdk.conversationBuilder.knowledgeBases.getSearchEvents({
|
|
3725
|
+
* startTime: String(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
3726
|
+
* endTime: String(Date.now()),
|
|
3727
|
+
* eventType: ['EVENT_KB_UN_ANSWERED'],
|
|
3728
|
+
* pageSize: 50,
|
|
3729
|
+
* });
|
|
3730
|
+
*
|
|
3731
|
+
* // Get all events for a specific KB
|
|
3732
|
+
* const kbEvents = await sdk.conversationBuilder.knowledgeBases.getSearchEvents({
|
|
3733
|
+
* startTime: String(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
3734
|
+
* endTime: String(Date.now()),
|
|
3735
|
+
* kbId: 'kb-123',
|
|
3736
|
+
* eventType: ['EVENT_KB_ANSWERED', 'EVENT_KB_UN_ANSWERED'],
|
|
3737
|
+
* });
|
|
3738
|
+
* ```
|
|
3739
|
+
*/
|
|
3740
|
+
getSearchEvents(request: CBKbSearchEventsRequest): Promise<CBKbSearchEventsResponse>;
|
|
3630
3741
|
}
|
|
3631
3742
|
/**
|
|
3632
3743
|
* Bot Agents API
|
package/dist/index.js
CHANGED
|
@@ -2149,6 +2149,57 @@ var KnowledgeBasesAPI = class {
|
|
|
2149
2149
|
});
|
|
2150
2150
|
return uniqueMetrics;
|
|
2151
2151
|
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Get KB search events (real customer queries)
|
|
2154
|
+
*
|
|
2155
|
+
* Retrieves actual customer queries made to knowledge bases and their outcomes.
|
|
2156
|
+
* This API returns the raw questions customers asked, whether they were answered,
|
|
2157
|
+
* and which KB/articles were involved.
|
|
2158
|
+
*
|
|
2159
|
+
* @param request - Search events request parameters
|
|
2160
|
+
* @returns Promise resolving to search events with pagination
|
|
2161
|
+
*
|
|
2162
|
+
* @example
|
|
2163
|
+
* ```typescript
|
|
2164
|
+
* // Get unanswered questions from the last 7 days
|
|
2165
|
+
* const events = await sdk.conversationBuilder.knowledgeBases.getSearchEvents({
|
|
2166
|
+
* startTime: String(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
2167
|
+
* endTime: String(Date.now()),
|
|
2168
|
+
* eventType: ['EVENT_KB_UN_ANSWERED'],
|
|
2169
|
+
* pageSize: 50,
|
|
2170
|
+
* });
|
|
2171
|
+
*
|
|
2172
|
+
* // Get all events for a specific KB
|
|
2173
|
+
* const kbEvents = await sdk.conversationBuilder.knowledgeBases.getSearchEvents({
|
|
2174
|
+
* startTime: String(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
2175
|
+
* endTime: String(Date.now()),
|
|
2176
|
+
* kbId: 'kb-123',
|
|
2177
|
+
* eventType: ['EVENT_KB_ANSWERED', 'EVENT_KB_UN_ANSWERED'],
|
|
2178
|
+
* });
|
|
2179
|
+
* ```
|
|
2180
|
+
*/
|
|
2181
|
+
async getSearchEvents(request) {
|
|
2182
|
+
const body = {
|
|
2183
|
+
startTime: request.startTime,
|
|
2184
|
+
endTime: request.endTime
|
|
2185
|
+
};
|
|
2186
|
+
if (request.pageNumber !== void 0) {
|
|
2187
|
+
body.pageNumber = request.pageNumber;
|
|
2188
|
+
}
|
|
2189
|
+
if (request.pageSize !== void 0) {
|
|
2190
|
+
body.pageSize = request.pageSize;
|
|
2191
|
+
}
|
|
2192
|
+
if (request.eventType !== void 0) {
|
|
2193
|
+
body.eventType = request.eventType;
|
|
2194
|
+
}
|
|
2195
|
+
if (request.kbId !== void 0) {
|
|
2196
|
+
body.kbId = request.kbId;
|
|
2197
|
+
}
|
|
2198
|
+
return this.cb.request("cbKb", "/kb/searchEvents", {
|
|
2199
|
+
method: "POST",
|
|
2200
|
+
body
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2152
2203
|
};
|
|
2153
2204
|
var BotAgentsAPI = class {
|
|
2154
2205
|
constructor(cb) {
|