@stackone/olap 1.73.0 → 1.74.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/README.md +5 -9
- package/dist/index.cjs +25 -26
- package/dist/index.d.cts +43 -51
- package/dist/index.d.mts +43 -51
- package/dist/index.mjs +14 -15
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ILogger } from "@stackone/logger";
|
|
2
|
-
import { HttpClient } from "@stackone/transport";
|
|
3
2
|
import { PiiRedaction } from "@stackone/redaction";
|
|
4
3
|
import { S3Client } from "@aws-sdk/client-s3";
|
|
5
4
|
import { Producer } from "@platformatic/kafka";
|
|
@@ -194,17 +193,17 @@ interface IOlapClient {
|
|
|
194
193
|
recordPlatform(platformInput: PlatformInput, platformResult: PlatformResult, options?: OlapOptions): Promise<void>;
|
|
195
194
|
recordPlatform(platformLog: PlatformLog, options?: OlapOptions): Promise<void>;
|
|
196
195
|
recordPlatform(platformLog: PlatformLog, advancedLog: PlatformAdvancedLog, options?: OlapOptions): Promise<void>;
|
|
197
|
-
getLogs(organizationId: string, projectSecureId: string, query: Query
|
|
196
|
+
getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
|
|
198
197
|
getLastLogs(organizationId: string, projectSecureId: string, entities: LogEntities, query?: Query): Promise<QueryResult>;
|
|
199
|
-
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery
|
|
200
|
-
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string
|
|
201
|
-
getLog(organizationId: string, projectSecureId: string, logId: string
|
|
202
|
-
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery
|
|
203
|
-
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number
|
|
204
|
-
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery
|
|
205
|
-
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string
|
|
206
|
-
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery
|
|
207
|
-
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string
|
|
198
|
+
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
|
|
199
|
+
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
|
|
200
|
+
getLog(organizationId: string, projectSecureId: string, logId: string): Promise<ActionLog | UnifiedLog | undefined>;
|
|
201
|
+
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
|
|
202
|
+
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
|
|
203
|
+
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
|
|
204
|
+
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
|
|
205
|
+
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
|
|
206
|
+
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
|
|
208
207
|
getPlatformLogs(organizationId: string | undefined, query: PlatformQuery): Promise<PlatformQueryResult>;
|
|
209
208
|
getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
|
|
210
209
|
getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
|
|
@@ -213,11 +212,19 @@ interface IOlapClient {
|
|
|
213
212
|
getPlatformAdvancedLog(organizationId: string, eventId: string): Promise<PlatformAdvancedLog | undefined>;
|
|
214
213
|
getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
|
|
215
214
|
getPolicyLog(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyLog | undefined>;
|
|
216
|
-
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery
|
|
217
|
-
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery
|
|
218
|
-
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery
|
|
215
|
+
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
|
|
216
|
+
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
|
|
217
|
+
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery): Promise<SourceResult>;
|
|
219
218
|
}
|
|
220
219
|
type PolicyResult = 'skipped' | 'allowed' | 'partial' | 'monitored' | 'denied' | 'error';
|
|
220
|
+
type PolicyResolution = {
|
|
221
|
+
level: string;
|
|
222
|
+
mode: 'enforce' | 'monitor';
|
|
223
|
+
decision: 'allow' | 'deny';
|
|
224
|
+
determining: string[];
|
|
225
|
+
setId: string;
|
|
226
|
+
faulted?: boolean;
|
|
227
|
+
};
|
|
221
228
|
type PolicyObservation = {
|
|
222
229
|
level: string;
|
|
223
230
|
decision: 'allow' | 'deny';
|
|
@@ -235,6 +242,13 @@ type PolicyContext = {
|
|
|
235
242
|
};
|
|
236
243
|
decidedAt: string;
|
|
237
244
|
policyIds: string[];
|
|
245
|
+
names?: Record<string, string>;
|
|
246
|
+
maskedFields?: Array<{
|
|
247
|
+
path: string;
|
|
248
|
+
policyIds: string[];
|
|
249
|
+
level?: string;
|
|
250
|
+
}>;
|
|
251
|
+
resolved?: PolicyResolution[];
|
|
238
252
|
level?: string;
|
|
239
253
|
versions?: Record<string, number>;
|
|
240
254
|
observed?: PolicyObservation[];
|
|
@@ -442,7 +456,6 @@ declare const LogType: {
|
|
|
442
456
|
readonly Platform: "platform";
|
|
443
457
|
};
|
|
444
458
|
type LogType = (typeof LogType)[keyof typeof LogType];
|
|
445
|
-
type OlapEngine = 'tinybird' | 'clickhouse';
|
|
446
459
|
type CombinedLogType = typeof LogType.Action | typeof LogType.Unified;
|
|
447
460
|
type Query = {
|
|
448
461
|
organizationId?: string | string[];
|
|
@@ -741,7 +754,6 @@ type SourceResult = Array<{
|
|
|
741
754
|
requestCount: number;
|
|
742
755
|
lastRequest: string;
|
|
743
756
|
}>;
|
|
744
|
-
type HttpClientBuilder = (logger?: ILogger) => HttpClient | undefined;
|
|
745
757
|
type SASLMechanism = 'PLAIN' | 'SCRAM-SHA-256' | 'SCRAM-SHA-512' | 'OAUTHBEARER';
|
|
746
758
|
interface KafkaClientConfig {
|
|
747
759
|
bootstrapBrokers: string[];
|
|
@@ -770,11 +782,6 @@ interface InternalKafkaClientConfig {
|
|
|
770
782
|
[key: string]: unknown;
|
|
771
783
|
}
|
|
772
784
|
type InternalKafkaClientBuilder = (config?: InternalKafkaClientConfig, logger?: ILogger) => Promise<Producer<string, string, string, string> | undefined>;
|
|
773
|
-
interface TinybirdConfig {
|
|
774
|
-
baseUrl: string;
|
|
775
|
-
token: string;
|
|
776
|
-
allowHttp?: boolean;
|
|
777
|
-
}
|
|
778
785
|
interface ClickHouseConfig {
|
|
779
786
|
url: string;
|
|
780
787
|
username?: string;
|
|
@@ -1004,13 +1011,10 @@ declare class ClickHouseClient implements IQueryClient {
|
|
|
1004
1011
|
}
|
|
1005
1012
|
//#endregion
|
|
1006
1013
|
//#region src/logs/clientFactory.d.ts
|
|
1007
|
-
type OlapQueryClientType = 'tinybird' | 'clickhouse';
|
|
1008
1014
|
interface OlapQueryClientConfig {
|
|
1009
|
-
type?: OlapQueryClientType;
|
|
1010
|
-
tinybird?: TinybirdConfig;
|
|
1011
1015
|
clickhouse?: ClickHouseConfig;
|
|
1012
1016
|
}
|
|
1013
|
-
declare function createOlapQueryClient(config: OlapQueryClientConfig,
|
|
1017
|
+
declare function createOlapQueryClient(config: OlapQueryClientConfig, logger?: ILogger): IQueryClient;
|
|
1014
1018
|
declare function createConfigFromEnv(): OlapQueryClientConfig;
|
|
1015
1019
|
//#endregion
|
|
1016
1020
|
//#region src/datasets/types.d.ts
|
|
@@ -1042,28 +1046,24 @@ declare class OlapClient implements IOlapClient {
|
|
|
1042
1046
|
static create({
|
|
1043
1047
|
getKafkaClient,
|
|
1044
1048
|
getInternalKafkaClient,
|
|
1045
|
-
getHttpClient,
|
|
1046
1049
|
getS3Client,
|
|
1047
1050
|
kafkaClientConfig,
|
|
1048
1051
|
externalKafkaClientConfig,
|
|
1049
1052
|
internalKafkaClientConfig,
|
|
1050
1053
|
topicClusterMap,
|
|
1051
1054
|
s3ClientConfig,
|
|
1052
|
-
tinybirdConfig,
|
|
1053
1055
|
clickhouseConfig,
|
|
1054
1056
|
sinkConfig,
|
|
1055
1057
|
logger
|
|
1056
1058
|
}: {
|
|
1057
1059
|
getKafkaClient?: KafkaClientBuilder;
|
|
1058
1060
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1059
|
-
getHttpClient?: HttpClientBuilder;
|
|
1060
1061
|
getS3Client?: S3ClientBuilder;
|
|
1061
1062
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1062
1063
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1063
1064
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1064
1065
|
topicClusterMap: TopicClusterMap;
|
|
1065
1066
|
s3ClientConfig?: S3ClientConfig;
|
|
1066
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1067
1067
|
clickhouseConfig?: ClickHouseConfig;
|
|
1068
1068
|
sinkConfig?: OlapSinkConfig;
|
|
1069
1069
|
logger?: ILogger;
|
|
@@ -1084,18 +1084,18 @@ declare class OlapClient implements IOlapClient {
|
|
|
1084
1084
|
recordPlatform(platformInput: PlatformInput, platformResult: PlatformResult, options?: OlapOptions): Promise<void>;
|
|
1085
1085
|
recordPlatform(platformLog: PlatformLog, options?: OlapOptions): Promise<void>;
|
|
1086
1086
|
recordPlatform(platformLog: PlatformLog, advancedLog: PlatformAdvancedLog, options?: OlapOptions): Promise<void>;
|
|
1087
|
-
getLogs(organizationId: string, projectSecureId: string, query: Query
|
|
1087
|
+
getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
|
|
1088
1088
|
getLastLogs(organizationId: string, projectSecureId: string, entities: LogEntities, query?: Query): Promise<QueryResult>;
|
|
1089
|
-
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery
|
|
1090
|
-
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string
|
|
1091
|
-
getLog(organizationId: string, projectSecureId: string, logId: string
|
|
1092
|
-
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery
|
|
1093
|
-
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number
|
|
1094
|
-
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery
|
|
1095
|
-
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string
|
|
1096
|
-
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery
|
|
1089
|
+
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
|
|
1090
|
+
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
|
|
1091
|
+
getLog(organizationId: string, projectSecureId: string, logId: string): Promise<ActionLog | UnifiedLog | undefined>;
|
|
1092
|
+
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
|
|
1093
|
+
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
|
|
1094
|
+
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
|
|
1095
|
+
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
|
|
1096
|
+
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
|
|
1097
1097
|
getPlatformLogs(organizationId: string | undefined, query: PlatformQuery): Promise<PlatformQueryResult>;
|
|
1098
|
-
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string
|
|
1098
|
+
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
|
|
1099
1099
|
getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
|
|
1100
1100
|
getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
|
|
1101
1101
|
getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
|
|
@@ -1103,37 +1103,33 @@ declare class OlapClient implements IOlapClient {
|
|
|
1103
1103
|
getPlatformAdvancedLog(organizationId: string, eventId: string): Promise<PlatformAdvancedLog | undefined>;
|
|
1104
1104
|
getPolicyLog(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyContext | undefined>;
|
|
1105
1105
|
getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
|
|
1106
|
-
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery
|
|
1107
|
-
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery
|
|
1108
|
-
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery
|
|
1106
|
+
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
|
|
1107
|
+
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
|
|
1108
|
+
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery): Promise<SourceResult>;
|
|
1109
1109
|
}
|
|
1110
1110
|
//#endregion
|
|
1111
1111
|
//#region src/olap/olapClientManager.d.ts
|
|
1112
1112
|
declare const buildOlapClientInstance: ({
|
|
1113
1113
|
getKafkaClient,
|
|
1114
1114
|
getInternalKafkaClient,
|
|
1115
|
-
getHttpClient,
|
|
1116
1115
|
getS3Client,
|
|
1117
1116
|
kafkaClientConfig,
|
|
1118
1117
|
externalKafkaClientConfig,
|
|
1119
1118
|
internalKafkaClientConfig,
|
|
1120
1119
|
topicClusterMap,
|
|
1121
1120
|
s3ClientConfig,
|
|
1122
|
-
tinybirdConfig,
|
|
1123
1121
|
clickhouseConfig,
|
|
1124
1122
|
sinkConfig,
|
|
1125
1123
|
logger
|
|
1126
1124
|
}: {
|
|
1127
1125
|
getKafkaClient?: KafkaClientBuilder;
|
|
1128
1126
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1129
|
-
getHttpClient?: HttpClientBuilder;
|
|
1130
1127
|
getS3Client?: S3ClientBuilder;
|
|
1131
1128
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1132
1129
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1133
1130
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1134
1131
|
topicClusterMap: TopicClusterMap;
|
|
1135
1132
|
s3ClientConfig?: S3ClientConfig;
|
|
1136
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1137
1133
|
clickhouseConfig?: ClickHouseConfig;
|
|
1138
1134
|
sinkConfig?: OlapSinkConfig;
|
|
1139
1135
|
logger?: ILogger;
|
|
@@ -1143,14 +1139,12 @@ declare class OlapClientManager {
|
|
|
1143
1139
|
static getInstance({
|
|
1144
1140
|
getKafkaClient,
|
|
1145
1141
|
getInternalKafkaClient,
|
|
1146
|
-
getHttpClient,
|
|
1147
1142
|
getS3Client,
|
|
1148
1143
|
kafkaClientConfig,
|
|
1149
1144
|
externalKafkaClientConfig,
|
|
1150
1145
|
internalKafkaClientConfig,
|
|
1151
1146
|
topicClusterMap,
|
|
1152
1147
|
s3ClientConfig,
|
|
1153
|
-
tinybirdConfig,
|
|
1154
1148
|
clickhouseConfig,
|
|
1155
1149
|
sinkConfig,
|
|
1156
1150
|
logger,
|
|
@@ -1158,14 +1152,12 @@ declare class OlapClientManager {
|
|
|
1158
1152
|
}: {
|
|
1159
1153
|
getKafkaClient?: KafkaClientBuilder;
|
|
1160
1154
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1161
|
-
getHttpClient?: HttpClientBuilder;
|
|
1162
1155
|
getS3Client?: S3ClientBuilder;
|
|
1163
1156
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1164
1157
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1165
1158
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1166
1159
|
topicClusterMap: TopicClusterMap;
|
|
1167
1160
|
s3ClientConfig?: S3ClientConfig;
|
|
1168
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1169
1161
|
clickhouseConfig?: ClickHouseConfig;
|
|
1170
1162
|
sinkConfig?: OlapSinkConfig;
|
|
1171
1163
|
logger?: ILogger;
|
|
@@ -1199,4 +1191,4 @@ declare class PolicySink implements IPolicySink {
|
|
|
1199
1191
|
//#region src/utils/stepErrors.d.ts
|
|
1200
1192
|
declare const hasErrorEntries: (errors: unknown) => boolean;
|
|
1201
1193
|
//#endregion
|
|
1202
|
-
export { type ActionAdvancedLog, type ActionInput, type ActionLog, type ActionResult, type ActionsQuery, type ActionsQueryResult, type AdvancedLogMetadata, type AdvancedOptions, type AdvancedSinkConfig, type AggregateQuery, type AggregateResult, AuthType, type AuthType as AuthTypeValue, ClickHouseClient, type ClickHouseConfig, type CombinedLogType, DEFAULT_TOPIC_CLUSTER_MAP, type DatasetsOptions, type DatasetsSinkConfig, type DefenderContext, type DefenderLog, type DefenderOptions, type DefenderSinkConfig, Dimension, type Dimension as DimensionValues, type DimensionsQuery, type DimensionsResult, type ILog, type IOlapClient, type IPolicySink, type IQueryClient, type
|
|
1194
|
+
export { type ActionAdvancedLog, type ActionInput, type ActionLog, type ActionResult, type ActionsQuery, type ActionsQueryResult, type AdvancedLogMetadata, type AdvancedOptions, type AdvancedSinkConfig, type AggregateQuery, type AggregateResult, AuthType, type AuthType as AuthTypeValue, ClickHouseClient, type ClickHouseConfig, type CombinedLogType, DEFAULT_TOPIC_CLUSTER_MAP, type DatasetsOptions, type DatasetsSinkConfig, type DefenderContext, type DefenderLog, type DefenderOptions, type DefenderSinkConfig, Dimension, type Dimension as DimensionValues, type DimensionsQuery, type DimensionsResult, type ILog, type IOlapClient, type IPolicySink, type IQueryClient, type InternalKafkaClientBuilder, type InternalKafkaClientConfig, IntervalType, type IntervalType as IntervalTypeValues, type KafkaClientBuilder, type KafkaClientConfig, type KafkaClusterName, type LogEntities, LogType, type LogType as LogTypeValues, type LogfireConfig, type LogsOptions, OlapClient, OlapClientManager, type OlapOptions, type OlapQueryClientConfig, type OlapSinkConfig, OrderBy, type OrderBy as OrderByValues, OrderDirection, type OrderDirection as OrderDirectionValues, type PlatformAdvancedLog, type PlatformInput, type PlatformLog, type PlatformQuery, type PlatformQueryResult, type PlatformResult, type PolicyContext, type PolicyLog, type PolicyObservation, type PolicyOptions, type PolicyResult, PolicySink, type PolicySinkConfig, type ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, type QueryOptions, type QueryResponse, type QueryResult, type SASLMechanism, type Source, type SourceQuery, type SourceResult, SourceType, type SourceType as SourceTypeValue, type StepAdvancedLog, type StepInput, type StepLog, type StepResult, type StepsQuery, type StepsQueryResult, StreamType, type StreamType as StreamTypeValue, type TopicClusterMap, TransportType, type TransportType as TransportTypeValue, type TruncationMode, type UnifiedAdvancedLog, type UnifiedInput, type UnifiedLog, type UnifiedQuery, type UnifiedQueryResult, type UnifiedResult, createConfigFromEnv, createOlapQueryClient, getPolicySink, hasErrorEntries };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-BhWHdk3m.mjs";
|
|
2
2
|
import { PiiRedaction } from "@stackone/redaction";
|
|
3
3
|
import { S3Client } from "@aws-sdk/client-s3";
|
|
4
|
-
import { HttpClient } from "@stackone/transport";
|
|
5
4
|
import { ILogger } from "@stackone/logger";
|
|
6
5
|
import { Producer } from "@platformatic/kafka";
|
|
7
6
|
|
|
@@ -193,17 +192,17 @@ interface IOlapClient {
|
|
|
193
192
|
recordPlatform(platformInput: PlatformInput, platformResult: PlatformResult, options?: OlapOptions): Promise<void>;
|
|
194
193
|
recordPlatform(platformLog: PlatformLog, options?: OlapOptions): Promise<void>;
|
|
195
194
|
recordPlatform(platformLog: PlatformLog, advancedLog: PlatformAdvancedLog, options?: OlapOptions): Promise<void>;
|
|
196
|
-
getLogs(organizationId: string, projectSecureId: string, query: Query
|
|
195
|
+
getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
|
|
197
196
|
getLastLogs(organizationId: string, projectSecureId: string, entities: LogEntities, query?: Query): Promise<QueryResult>;
|
|
198
|
-
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery
|
|
199
|
-
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string
|
|
200
|
-
getLog(organizationId: string, projectSecureId: string, logId: string
|
|
201
|
-
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery
|
|
202
|
-
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number
|
|
203
|
-
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery
|
|
204
|
-
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string
|
|
205
|
-
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery
|
|
206
|
-
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string
|
|
197
|
+
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
|
|
198
|
+
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
|
|
199
|
+
getLog(organizationId: string, projectSecureId: string, logId: string): Promise<ActionLog | UnifiedLog | undefined>;
|
|
200
|
+
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
|
|
201
|
+
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
|
|
202
|
+
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
|
|
203
|
+
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
|
|
204
|
+
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
|
|
205
|
+
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
|
|
207
206
|
getPlatformLogs(organizationId: string | undefined, query: PlatformQuery): Promise<PlatformQueryResult>;
|
|
208
207
|
getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
|
|
209
208
|
getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
|
|
@@ -212,11 +211,19 @@ interface IOlapClient {
|
|
|
212
211
|
getPlatformAdvancedLog(organizationId: string, eventId: string): Promise<PlatformAdvancedLog | undefined>;
|
|
213
212
|
getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
|
|
214
213
|
getPolicyLog(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyLog | undefined>;
|
|
215
|
-
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery
|
|
216
|
-
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery
|
|
217
|
-
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery
|
|
214
|
+
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
|
|
215
|
+
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
|
|
216
|
+
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery): Promise<SourceResult>;
|
|
218
217
|
}
|
|
219
218
|
type PolicyResult = 'skipped' | 'allowed' | 'partial' | 'monitored' | 'denied' | 'error';
|
|
219
|
+
type PolicyResolution = {
|
|
220
|
+
level: string;
|
|
221
|
+
mode: 'enforce' | 'monitor';
|
|
222
|
+
decision: 'allow' | 'deny';
|
|
223
|
+
determining: string[];
|
|
224
|
+
setId: string;
|
|
225
|
+
faulted?: boolean;
|
|
226
|
+
};
|
|
220
227
|
type PolicyObservation = {
|
|
221
228
|
level: string;
|
|
222
229
|
decision: 'allow' | 'deny';
|
|
@@ -234,6 +241,13 @@ type PolicyContext = {
|
|
|
234
241
|
};
|
|
235
242
|
decidedAt: string;
|
|
236
243
|
policyIds: string[];
|
|
244
|
+
names?: Record<string, string>;
|
|
245
|
+
maskedFields?: Array<{
|
|
246
|
+
path: string;
|
|
247
|
+
policyIds: string[];
|
|
248
|
+
level?: string;
|
|
249
|
+
}>;
|
|
250
|
+
resolved?: PolicyResolution[];
|
|
237
251
|
level?: string;
|
|
238
252
|
versions?: Record<string, number>;
|
|
239
253
|
observed?: PolicyObservation[];
|
|
@@ -441,7 +455,6 @@ declare const LogType: {
|
|
|
441
455
|
readonly Platform: "platform";
|
|
442
456
|
};
|
|
443
457
|
type LogType = (typeof LogType)[keyof typeof LogType];
|
|
444
|
-
type OlapEngine = 'tinybird' | 'clickhouse';
|
|
445
458
|
type CombinedLogType = typeof LogType.Action | typeof LogType.Unified;
|
|
446
459
|
type Query = {
|
|
447
460
|
organizationId?: string | string[];
|
|
@@ -740,7 +753,6 @@ type SourceResult = Array<{
|
|
|
740
753
|
requestCount: number;
|
|
741
754
|
lastRequest: string;
|
|
742
755
|
}>;
|
|
743
|
-
type HttpClientBuilder = (logger?: ILogger) => HttpClient | undefined;
|
|
744
756
|
type SASLMechanism = 'PLAIN' | 'SCRAM-SHA-256' | 'SCRAM-SHA-512' | 'OAUTHBEARER';
|
|
745
757
|
interface KafkaClientConfig {
|
|
746
758
|
bootstrapBrokers: string[];
|
|
@@ -769,11 +781,6 @@ interface InternalKafkaClientConfig {
|
|
|
769
781
|
[key: string]: unknown;
|
|
770
782
|
}
|
|
771
783
|
type InternalKafkaClientBuilder = (config?: InternalKafkaClientConfig, logger?: ILogger) => Promise<Producer<string, string, string, string> | undefined>;
|
|
772
|
-
interface TinybirdConfig {
|
|
773
|
-
baseUrl: string;
|
|
774
|
-
token: string;
|
|
775
|
-
allowHttp?: boolean;
|
|
776
|
-
}
|
|
777
784
|
interface ClickHouseConfig {
|
|
778
785
|
url: string;
|
|
779
786
|
username?: string;
|
|
@@ -1003,13 +1010,10 @@ declare class ClickHouseClient implements IQueryClient {
|
|
|
1003
1010
|
}
|
|
1004
1011
|
//#endregion
|
|
1005
1012
|
//#region src/logs/clientFactory.d.ts
|
|
1006
|
-
type OlapQueryClientType = 'tinybird' | 'clickhouse';
|
|
1007
1013
|
interface OlapQueryClientConfig {
|
|
1008
|
-
type?: OlapQueryClientType;
|
|
1009
|
-
tinybird?: TinybirdConfig;
|
|
1010
1014
|
clickhouse?: ClickHouseConfig;
|
|
1011
1015
|
}
|
|
1012
|
-
declare function createOlapQueryClient(config: OlapQueryClientConfig,
|
|
1016
|
+
declare function createOlapQueryClient(config: OlapQueryClientConfig, logger?: ILogger): IQueryClient;
|
|
1013
1017
|
declare function createConfigFromEnv(): OlapQueryClientConfig;
|
|
1014
1018
|
//#endregion
|
|
1015
1019
|
//#region src/datasets/types.d.ts
|
|
@@ -1041,28 +1045,24 @@ declare class OlapClient implements IOlapClient {
|
|
|
1041
1045
|
static create({
|
|
1042
1046
|
getKafkaClient,
|
|
1043
1047
|
getInternalKafkaClient,
|
|
1044
|
-
getHttpClient,
|
|
1045
1048
|
getS3Client,
|
|
1046
1049
|
kafkaClientConfig,
|
|
1047
1050
|
externalKafkaClientConfig,
|
|
1048
1051
|
internalKafkaClientConfig,
|
|
1049
1052
|
topicClusterMap,
|
|
1050
1053
|
s3ClientConfig,
|
|
1051
|
-
tinybirdConfig,
|
|
1052
1054
|
clickhouseConfig,
|
|
1053
1055
|
sinkConfig,
|
|
1054
1056
|
logger
|
|
1055
1057
|
}: {
|
|
1056
1058
|
getKafkaClient?: KafkaClientBuilder;
|
|
1057
1059
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1058
|
-
getHttpClient?: HttpClientBuilder;
|
|
1059
1060
|
getS3Client?: S3ClientBuilder;
|
|
1060
1061
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1061
1062
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1062
1063
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1063
1064
|
topicClusterMap: TopicClusterMap;
|
|
1064
1065
|
s3ClientConfig?: S3ClientConfig;
|
|
1065
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1066
1066
|
clickhouseConfig?: ClickHouseConfig;
|
|
1067
1067
|
sinkConfig?: OlapSinkConfig;
|
|
1068
1068
|
logger?: ILogger;
|
|
@@ -1083,18 +1083,18 @@ declare class OlapClient implements IOlapClient {
|
|
|
1083
1083
|
recordPlatform(platformInput: PlatformInput, platformResult: PlatformResult, options?: OlapOptions): Promise<void>;
|
|
1084
1084
|
recordPlatform(platformLog: PlatformLog, options?: OlapOptions): Promise<void>;
|
|
1085
1085
|
recordPlatform(platformLog: PlatformLog, advancedLog: PlatformAdvancedLog, options?: OlapOptions): Promise<void>;
|
|
1086
|
-
getLogs(organizationId: string, projectSecureId: string, query: Query
|
|
1086
|
+
getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
|
|
1087
1087
|
getLastLogs(organizationId: string, projectSecureId: string, entities: LogEntities, query?: Query): Promise<QueryResult>;
|
|
1088
|
-
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery
|
|
1089
|
-
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string
|
|
1090
|
-
getLog(organizationId: string, projectSecureId: string, logId: string
|
|
1091
|
-
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery
|
|
1092
|
-
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number
|
|
1093
|
-
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery
|
|
1094
|
-
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string
|
|
1095
|
-
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery
|
|
1088
|
+
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
|
|
1089
|
+
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
|
|
1090
|
+
getLog(organizationId: string, projectSecureId: string, logId: string): Promise<ActionLog | UnifiedLog | undefined>;
|
|
1091
|
+
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
|
|
1092
|
+
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
|
|
1093
|
+
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
|
|
1094
|
+
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
|
|
1095
|
+
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
|
|
1096
1096
|
getPlatformLogs(organizationId: string | undefined, query: PlatformQuery): Promise<PlatformQueryResult>;
|
|
1097
|
-
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string
|
|
1097
|
+
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
|
|
1098
1098
|
getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
|
|
1099
1099
|
getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
|
|
1100
1100
|
getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
|
|
@@ -1102,37 +1102,33 @@ declare class OlapClient implements IOlapClient {
|
|
|
1102
1102
|
getPlatformAdvancedLog(organizationId: string, eventId: string): Promise<PlatformAdvancedLog | undefined>;
|
|
1103
1103
|
getPolicyLog(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyContext | undefined>;
|
|
1104
1104
|
getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
|
|
1105
|
-
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery
|
|
1106
|
-
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery
|
|
1107
|
-
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery
|
|
1105
|
+
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
|
|
1106
|
+
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
|
|
1107
|
+
getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery): Promise<SourceResult>;
|
|
1108
1108
|
}
|
|
1109
1109
|
//#endregion
|
|
1110
1110
|
//#region src/olap/olapClientManager.d.ts
|
|
1111
1111
|
declare const buildOlapClientInstance: ({
|
|
1112
1112
|
getKafkaClient,
|
|
1113
1113
|
getInternalKafkaClient,
|
|
1114
|
-
getHttpClient,
|
|
1115
1114
|
getS3Client,
|
|
1116
1115
|
kafkaClientConfig,
|
|
1117
1116
|
externalKafkaClientConfig,
|
|
1118
1117
|
internalKafkaClientConfig,
|
|
1119
1118
|
topicClusterMap,
|
|
1120
1119
|
s3ClientConfig,
|
|
1121
|
-
tinybirdConfig,
|
|
1122
1120
|
clickhouseConfig,
|
|
1123
1121
|
sinkConfig,
|
|
1124
1122
|
logger
|
|
1125
1123
|
}: {
|
|
1126
1124
|
getKafkaClient?: KafkaClientBuilder;
|
|
1127
1125
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1128
|
-
getHttpClient?: HttpClientBuilder;
|
|
1129
1126
|
getS3Client?: S3ClientBuilder;
|
|
1130
1127
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1131
1128
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1132
1129
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1133
1130
|
topicClusterMap: TopicClusterMap;
|
|
1134
1131
|
s3ClientConfig?: S3ClientConfig;
|
|
1135
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1136
1132
|
clickhouseConfig?: ClickHouseConfig;
|
|
1137
1133
|
sinkConfig?: OlapSinkConfig;
|
|
1138
1134
|
logger?: ILogger;
|
|
@@ -1142,14 +1138,12 @@ declare class OlapClientManager {
|
|
|
1142
1138
|
static getInstance({
|
|
1143
1139
|
getKafkaClient,
|
|
1144
1140
|
getInternalKafkaClient,
|
|
1145
|
-
getHttpClient,
|
|
1146
1141
|
getS3Client,
|
|
1147
1142
|
kafkaClientConfig,
|
|
1148
1143
|
externalKafkaClientConfig,
|
|
1149
1144
|
internalKafkaClientConfig,
|
|
1150
1145
|
topicClusterMap,
|
|
1151
1146
|
s3ClientConfig,
|
|
1152
|
-
tinybirdConfig,
|
|
1153
1147
|
clickhouseConfig,
|
|
1154
1148
|
sinkConfig,
|
|
1155
1149
|
logger,
|
|
@@ -1157,14 +1151,12 @@ declare class OlapClientManager {
|
|
|
1157
1151
|
}: {
|
|
1158
1152
|
getKafkaClient?: KafkaClientBuilder;
|
|
1159
1153
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1160
|
-
getHttpClient?: HttpClientBuilder;
|
|
1161
1154
|
getS3Client?: S3ClientBuilder;
|
|
1162
1155
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1163
1156
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1164
1157
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1165
1158
|
topicClusterMap: TopicClusterMap;
|
|
1166
1159
|
s3ClientConfig?: S3ClientConfig;
|
|
1167
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1168
1160
|
clickhouseConfig?: ClickHouseConfig;
|
|
1169
1161
|
sinkConfig?: OlapSinkConfig;
|
|
1170
1162
|
logger?: ILogger;
|
|
@@ -1198,4 +1190,4 @@ declare class PolicySink implements IPolicySink {
|
|
|
1198
1190
|
//#region src/utils/stepErrors.d.ts
|
|
1199
1191
|
declare const hasErrorEntries: (errors: unknown) => boolean;
|
|
1200
1192
|
//#endregion
|
|
1201
|
-
export { type ActionAdvancedLog, type ActionInput, type ActionLog, type ActionResult, type ActionsQuery, type ActionsQueryResult, type AdvancedLogMetadata, type AdvancedOptions, type AdvancedSinkConfig, type AggregateQuery, type AggregateResult, AuthType, type AuthType as AuthTypeValue, ClickHouseClient, type ClickHouseConfig, type CombinedLogType, DEFAULT_TOPIC_CLUSTER_MAP, type DatasetsOptions, type DatasetsSinkConfig, type DefenderContext, type DefenderLog, type DefenderOptions, type DefenderSinkConfig, Dimension, type Dimension as DimensionValues, type DimensionsQuery, type DimensionsResult, type ILog, type IOlapClient, type IPolicySink, type IQueryClient, type
|
|
1193
|
+
export { type ActionAdvancedLog, type ActionInput, type ActionLog, type ActionResult, type ActionsQuery, type ActionsQueryResult, type AdvancedLogMetadata, type AdvancedOptions, type AdvancedSinkConfig, type AggregateQuery, type AggregateResult, AuthType, type AuthType as AuthTypeValue, ClickHouseClient, type ClickHouseConfig, type CombinedLogType, DEFAULT_TOPIC_CLUSTER_MAP, type DatasetsOptions, type DatasetsSinkConfig, type DefenderContext, type DefenderLog, type DefenderOptions, type DefenderSinkConfig, Dimension, type Dimension as DimensionValues, type DimensionsQuery, type DimensionsResult, type ILog, type IOlapClient, type IPolicySink, type IQueryClient, type InternalKafkaClientBuilder, type InternalKafkaClientConfig, IntervalType, type IntervalType as IntervalTypeValues, type KafkaClientBuilder, type KafkaClientConfig, type KafkaClusterName, type LogEntities, LogType, type LogType as LogTypeValues, type LogfireConfig, type LogsOptions, OlapClient, OlapClientManager, type OlapOptions, type OlapQueryClientConfig, type OlapSinkConfig, OrderBy, type OrderBy as OrderByValues, OrderDirection, type OrderDirection as OrderDirectionValues, type PlatformAdvancedLog, type PlatformInput, type PlatformLog, type PlatformQuery, type PlatformQueryResult, type PlatformResult, type PolicyContext, type PolicyLog, type PolicyObservation, type PolicyOptions, type PolicyResult, PolicySink, type PolicySinkConfig, type ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, type QueryOptions, type QueryResponse, type QueryResult, type SASLMechanism, type Source, type SourceQuery, type SourceResult, SourceType, type SourceType as SourceTypeValue, type StepAdvancedLog, type StepInput, type StepLog, type StepResult, type StepsQuery, type StepsQueryResult, StreamType, type StreamType as StreamTypeValue, type TopicClusterMap, TransportType, type TransportType as TransportTypeValue, type TruncationMode, type UnifiedAdvancedLog, type UnifiedInput, type UnifiedLog, type UnifiedQuery, type UnifiedQueryResult, type UnifiedResult, createConfigFromEnv, createOlapQueryClient, getPolicySink, hasErrorEntries };
|