@squidcloud/client 1.0.278 → 1.0.280
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/cjs/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +1 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +5 -0
- package/dist/internal-common/src/public-types/metric.public-types.d.ts +118 -4
- package/dist/internal-common/src/utils/metric-utils.d.ts +3 -3
- package/dist/typescript-client/src/ai-agent-client.d.ts +10 -7
- package/dist/typescript-client/src/extraction-client.d.ts +2 -2
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export type DocumentFileDataType = 'image';
|
|
2
|
+
export interface ExtractDataFromDocumentFileOptions {
|
|
3
|
+
password?: string;
|
|
4
|
+
}
|
|
2
5
|
export interface DocumentFileData {
|
|
3
6
|
type: DocumentFileDataType;
|
|
4
7
|
pathInBucket: string;
|
|
5
8
|
}
|
|
6
9
|
export interface DocumentPageData {
|
|
10
|
+
title?: string;
|
|
7
11
|
text: string;
|
|
8
12
|
fileDataList: DocumentFileData[];
|
|
9
13
|
}
|
|
@@ -13,6 +17,7 @@ export interface ExtractDataFromDocumentResponse {
|
|
|
13
17
|
}
|
|
14
18
|
export interface TextOnlyPageData {
|
|
15
19
|
text: string;
|
|
20
|
+
title?: string;
|
|
16
21
|
}
|
|
17
22
|
export interface DocumentTextDataResponse {
|
|
18
23
|
pages: TextOnlyPageData[];
|
|
@@ -1,10 +1,124 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Name of metrics publicly provided by the system.
|
|
3
|
+
* - Metrics suffixed by '_time' are 'gauge' metrics.
|
|
4
|
+
* - Metrics suffixed by '_count' are 'count' metrics.
|
|
5
|
+
* All Squid metrics starts with `squid_` prefix.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time"];
|
|
8
|
+
export type SquidMetricName = (typeof SQUID_METRIC_NAMES)[number];
|
|
9
|
+
export declare const METRIC_FUNCTIONS: readonly ["sum", "max", "min", "average", "median", "p95", "p99", "count"];
|
|
10
|
+
export type MetricFunction = (typeof METRIC_FUNCTIONS)[number];
|
|
11
|
+
/** Defines source of the metric: reported by user or automatically collected by the system (Squid). */
|
|
12
|
+
export declare const METRIC_DOMAIN: readonly ["user", "squid"];
|
|
13
|
+
export type MetricDomain = (typeof METRIC_DOMAIN)[number];
|
|
14
|
+
export declare const METRIC_INTERVAL_ALIGNMENT: readonly ["align-by-start-time", "align-by-end-time"];
|
|
15
|
+
/** Indicates how to align per-point periods in metric queries. */
|
|
16
|
+
export type MetricIntervalAlignment = (typeof METRIC_INTERVAL_ALIGNMENT)[number];
|
|
17
|
+
export interface QueryMetricsRequestCommon {
|
|
18
|
+
/** Kind of the metrics (domain) to query. */
|
|
19
|
+
domain: MetricDomain;
|
|
20
|
+
/** Start of the queried interval. Must be an integer value. */
|
|
21
|
+
periodStartSeconds: number;
|
|
22
|
+
/** End of the queried interval. Must be an integer value. */
|
|
23
|
+
periodEndSeconds: number;
|
|
24
|
+
/**
|
|
25
|
+
* Time interval per point. Must be less than periodEndSeconds - periodStartSeconds.
|
|
26
|
+
* Set to 0 or keep undefined to have only 1 value in the result.
|
|
27
|
+
*/
|
|
28
|
+
pointIntervalSeconds?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies the alignment of the per-point interval.
|
|
31
|
+
* Default: 'align-by-start-time'
|
|
32
|
+
*/
|
|
33
|
+
pointIntervalAlignment?: MetricIntervalAlignment;
|
|
34
|
+
/** Aggregation functions that maps multiple points per point region to a single point value. */
|
|
35
|
+
fn: MetricFunction | Array<MetricFunction>;
|
|
36
|
+
/**
|
|
37
|
+
* If there is no data in the specified region this value will be used to fill the gap.
|
|
38
|
+
* Default: null.
|
|
39
|
+
*/
|
|
40
|
+
fillValue?: number | null;
|
|
41
|
+
/**
|
|
42
|
+
* Tag filters.
|
|
43
|
+
* TODO: add operations to exclude tags: !=, !contains...
|
|
44
|
+
*/
|
|
45
|
+
tagFilter?: Record<string, string>;
|
|
46
|
+
/**
|
|
47
|
+
* A mapping of known tag values that must be present in the response groups.
|
|
48
|
+
*
|
|
49
|
+
* This ensures that the result will include groups for all specified tag values,
|
|
50
|
+
* even if there is no data for some values in the database.
|
|
51
|
+
*
|
|
52
|
+
* Example: Consider a tag 'isError' with two possible values: '0' and '1'.
|
|
53
|
+
* When 'tagDomains' contains {'isError': ['0', '1']}, the result will include
|
|
54
|
+
* groups for both 'isError: 0' and 'isError: 1'. If the database lacks data for
|
|
55
|
+
* 'isError: 1', the points in this group will be set to 'fillValue' (default is 'null').
|
|
56
|
+
*
|
|
57
|
+
* The tags in the new groups will be copied from the existing resultGroups,
|
|
58
|
+
* along with one of the tag domain values.
|
|
59
|
+
*
|
|
60
|
+
* @property {Record<string, string[]>} tagDomains - A record where each key is a tag name and
|
|
61
|
+
* each value is an array of possible values for that tag. Should only contain tags listed in 'groupByTags' field.
|
|
62
|
+
*/
|
|
63
|
+
tagDomains?: Record<string, string[]>;
|
|
64
|
+
/** List of ordered tag names for a 'GROUP BY'. */
|
|
65
|
+
groupByTags?: string[];
|
|
66
|
+
/** The results will be ordered by the specified tags (ORDER BY). */
|
|
67
|
+
orderByTags?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Specifies what result will be returned if there were no records found in the database.
|
|
70
|
+
* In this case the 'resultGroups' array will be empty (default), or can be filled with a default
|
|
71
|
+
* values if 'return-result-group-with-default-values' is specified.
|
|
72
|
+
* The generated result group will have 'tagValues' set to empty strings.
|
|
73
|
+
*
|
|
74
|
+
* May be useful to get a ready-to-render array with no additional post-processing required.
|
|
75
|
+
*
|
|
76
|
+
* Note: 'tagDomains' can provide similar functionality when set of tag values is defined: multiple result groups
|
|
77
|
+
* will be filled with default values. There is no need to use this option if 'tagDomains' is used.
|
|
78
|
+
*
|
|
79
|
+
* Default: 'return-no-result-groups'
|
|
80
|
+
*/
|
|
81
|
+
noDataBehavior?: 'return-no-result-groups' | 'return-result-group-with-default-values';
|
|
82
|
+
}
|
|
83
|
+
export interface QueryUserMetricsRequest<NameType extends string = string> extends QueryMetricsRequestCommon {
|
|
84
|
+
domain: 'user';
|
|
85
|
+
/** Squid metric name. */
|
|
86
|
+
name: NameType;
|
|
87
|
+
}
|
|
88
|
+
export interface QuerySquidMetricsRequest<NameType extends SquidMetricName = SquidMetricName> extends QueryMetricsRequestCommon {
|
|
89
|
+
domain: 'squid';
|
|
90
|
+
/** User metric name. */
|
|
91
|
+
name: NameType;
|
|
92
|
+
}
|
|
93
|
+
export type QueryMetricsRequest<NameType extends string = string> = QuerySquidMetricsRequest<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsRequest<NameType>;
|
|
94
|
+
/**
|
|
95
|
+
* Every result point is a list of [timestamp, values...],
|
|
96
|
+
* where list of values are defined by the list of functions in the request.
|
|
97
|
+
* If there is no data for the point 'null' is used as a 'value'.
|
|
3
98
|
* The timestamp is always equal to the point period start date and is measured in Unix epoch seconds.
|
|
4
99
|
*/
|
|
5
|
-
export type
|
|
6
|
-
export interface
|
|
100
|
+
export type QueryMetricsResultPoint = [number, ...(number | null)[]];
|
|
101
|
+
export interface QueryMetricsResultGroup {
|
|
7
102
|
/** Values of the tags in the group. The tags are ordered the same way as in request.groupByTags collection. */
|
|
8
103
|
tagValues: string[];
|
|
9
|
-
points: Array<
|
|
104
|
+
points: Array<QueryMetricsResultPoint>;
|
|
105
|
+
}
|
|
106
|
+
export interface QueryMetricsResponseCommon {
|
|
107
|
+
/**
|
|
108
|
+
* Result of the metrics query.
|
|
109
|
+
* Contains only 1 element if `groupByTags` are empty, otherwise contains multiple results grouped by tags.
|
|
110
|
+
*/
|
|
111
|
+
resultGroups: Array<QueryMetricsResultGroup>;
|
|
112
|
+
}
|
|
113
|
+
export interface QueryUserMetricsResponse<NameType extends string = string> extends QueryMetricsResponseCommon {
|
|
114
|
+
domain: 'user';
|
|
115
|
+
metricName: NameType;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A single metric response for 'SquidMetricsRequest'.
|
|
119
|
+
*/
|
|
120
|
+
export interface QuerySquidMetricsResponse<NameType extends SquidMetricName> extends QueryMetricsResponseCommon {
|
|
121
|
+
domain: 'squid';
|
|
122
|
+
metricName: NameType;
|
|
10
123
|
}
|
|
124
|
+
export type QueryMetricsResponse<NameType extends string = string> = Required<QuerySquidMetricsResponse<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsResponse<NameType>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
1
|
+
import { QueryMetricsRequestCommon, QueryMetricsResultGroup } from '../public-types/metric.public-types';
|
|
2
|
+
export type QueryMetricsRequestIntervals = Required<Pick<QueryMetricsRequestCommon, 'fillValue' | 'fn' | 'groupByTags' | 'periodEndSeconds' | 'periodStartSeconds' | 'pointIntervalAlignment' | 'pointIntervalSeconds' | 'tagDomains' | 'noDataBehavior'>>;
|
|
3
3
|
/** Adds missed known tag domain groups and fills all missed points with a request.fillValue. */
|
|
4
|
-
export declare function fillMissedPoints(request:
|
|
4
|
+
export declare function fillMissedPoints(request: QueryMetricsRequestIntervals, resultGroups: Array<QueryMetricsResultGroup>): void;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { AiChatbotChatOptions, AiChatbotContext, AiChatModelName, AiSearchOptions, AiSearchResponse, AiTranscribeAndAskResponse } from './public-types';
|
|
1
|
+
import { AiChatbotChatOptions, AiChatbotContext, AiChatModelName, AiSearchOptions, AiSearchResponse, AiTranscribeAndAskResponse, AiTranscribeAndChatResponse } from './public-types';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
interface TranscribeAndChatResponse {
|
|
3
|
+
export interface TranscribeAndChatResponse {
|
|
4
4
|
transcribedPrompt: string;
|
|
5
5
|
responseStream: Observable<string>;
|
|
6
6
|
}
|
|
7
|
-
interface TranscribeAndAskWithVoiceResponse {
|
|
7
|
+
export interface TranscribeAndAskWithVoiceResponse {
|
|
8
8
|
transcribedPrompt: string;
|
|
9
9
|
responseString: string;
|
|
10
10
|
voiceResponseFile: File;
|
|
11
11
|
}
|
|
12
|
-
interface AskWithVoiceResponse {
|
|
12
|
+
export interface AskWithVoiceResponse {
|
|
13
13
|
responseString: string;
|
|
14
14
|
voiceResponseFile: File;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
export interface ChatInternalResponse {
|
|
17
|
+
responseStream: Observable<string>;
|
|
18
|
+
serverResponse?: Promise<AiTranscribeAndChatResponse>;
|
|
19
|
+
}
|
|
20
|
+
export type ChatOptionsWithoutVoice = Omit<AiChatbotChatOptions, 'voiceOptions'>;
|
|
21
|
+
export type AskOptionsWithoutVoice = Omit<AiChatbotChatOptions, 'voiceOptions' | 'smoothTyping'>;
|
|
18
22
|
export declare class AiAgentClient {
|
|
19
23
|
private readonly rpcManager;
|
|
20
24
|
private readonly socketManager;
|
|
@@ -221,4 +225,3 @@ export declare class AiChatbotContextReference extends AiAgentContextReference {
|
|
|
221
225
|
}
|
|
222
226
|
export declare class AiChatbotInstructionReference extends AiAgentInstructionReference {
|
|
223
227
|
}
|
|
224
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlobAndFilename } from './types';
|
|
2
|
-
import { DocumentTextDataResponse } from '../../internal-common/src/public-types/extraction.public-types';
|
|
2
|
+
import { DocumentTextDataResponse, ExtractDataFromDocumentFileOptions } from '../../internal-common/src/public-types/extraction.public-types';
|
|
3
3
|
export declare class ExtractionClient {
|
|
4
4
|
private readonly rpcManager;
|
|
5
|
-
extractDataFromDocumentFile(file: File | BlobAndFilename): Promise<DocumentTextDataResponse>;
|
|
5
|
+
extractDataFromDocumentFile(file: File | BlobAndFilename, options?: ExtractDataFromDocumentFileOptions): Promise<DocumentTextDataResponse>;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.
|
|
1
|
+
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.280";
|