@stackone/olap 1.72.1 → 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 +29 -128
- package/dist/index.d.cts +133 -65
- package/dist/index.d.mts +133 -65
- package/dist/index.mjs +29 -128
- package/package.json +1 -1
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
|
|
|
@@ -13,6 +12,7 @@ type OlapOptions = {
|
|
|
13
12
|
logs?: LogsOptions;
|
|
14
13
|
advanced?: AdvancedOptions;
|
|
15
14
|
defender?: DefenderOptions;
|
|
15
|
+
policy?: PolicyOptions;
|
|
16
16
|
datasets?: DatasetsOptions;
|
|
17
17
|
};
|
|
18
18
|
type LogsOptions = {
|
|
@@ -29,6 +29,9 @@ type AdvancedOptions = {
|
|
|
29
29
|
type DefenderOptions = {
|
|
30
30
|
enabled?: boolean;
|
|
31
31
|
};
|
|
32
|
+
type PolicyOptions = {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
};
|
|
32
35
|
type DatasetsOptions = {
|
|
33
36
|
enabled?: boolean;
|
|
34
37
|
schemasDataset?: string;
|
|
@@ -36,20 +39,6 @@ type DatasetsOptions = {
|
|
|
36
39
|
includeBackground?: boolean;
|
|
37
40
|
};
|
|
38
41
|
//#endregion
|
|
39
|
-
//#region src/defender/types.d.ts
|
|
40
|
-
type DefenderSinkConfig = {
|
|
41
|
-
bucket?: string;
|
|
42
|
-
ttlDays?: number;
|
|
43
|
-
};
|
|
44
|
-
type DefenderLog = {
|
|
45
|
-
result?: {
|
|
46
|
-
riskLevel: string;
|
|
47
|
-
tier2Score?: number;
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
};
|
|
50
|
-
[key: string]: unknown;
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
42
|
//#region src/advanced/types.d.ts
|
|
54
43
|
type AdvancedSinkConfig = {
|
|
55
44
|
bucket?: string;
|
|
@@ -99,6 +88,39 @@ interface S3ClientConfig {
|
|
|
99
88
|
}
|
|
100
89
|
type S3ClientBuilder = (config?: S3ClientConfig, logger?: ILogger) => S3Client | undefined;
|
|
101
90
|
//#endregion
|
|
91
|
+
//#region src/defender/types.d.ts
|
|
92
|
+
type DefenderSinkConfig = {
|
|
93
|
+
bucket?: string;
|
|
94
|
+
ttlDays?: number;
|
|
95
|
+
};
|
|
96
|
+
type DefenderLog = {
|
|
97
|
+
result?: {
|
|
98
|
+
riskLevel: string;
|
|
99
|
+
tier2Score?: number;
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
};
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/policy/types.d.ts
|
|
106
|
+
type PolicySinkConfig = {
|
|
107
|
+
bucket?: string;
|
|
108
|
+
ttlDays?: number;
|
|
109
|
+
};
|
|
110
|
+
interface IPolicySink {
|
|
111
|
+
sendAction(input: ActionInput, result: ActionResult, options?: PolicyOptions): Promise<{
|
|
112
|
+
expiresAt: Date;
|
|
113
|
+
} | null>;
|
|
114
|
+
sendActions(actions: Array<{
|
|
115
|
+
input: ActionInput;
|
|
116
|
+
result: ActionResult;
|
|
117
|
+
}>, options?: PolicyOptions): Promise<Array<{
|
|
118
|
+
expiresAt: Date;
|
|
119
|
+
} | null>>;
|
|
120
|
+
getAction(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyLog | undefined>;
|
|
121
|
+
}
|
|
122
|
+
type PolicyLog = PolicyContext;
|
|
123
|
+
//#endregion
|
|
102
124
|
//#region src/types.d.ts
|
|
103
125
|
declare const SourceType: {
|
|
104
126
|
readonly RequestTester: "REQUEST_TESTER";
|
|
@@ -170,17 +192,17 @@ interface IOlapClient {
|
|
|
170
192
|
recordPlatform(platformInput: PlatformInput, platformResult: PlatformResult, options?: OlapOptions): Promise<void>;
|
|
171
193
|
recordPlatform(platformLog: PlatformLog, options?: OlapOptions): Promise<void>;
|
|
172
194
|
recordPlatform(platformLog: PlatformLog, advancedLog: PlatformAdvancedLog, options?: OlapOptions): Promise<void>;
|
|
173
|
-
getLogs(organizationId: string, projectSecureId: string, query: Query
|
|
195
|
+
getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
|
|
174
196
|
getLastLogs(organizationId: string, projectSecureId: string, entities: LogEntities, query?: Query): Promise<QueryResult>;
|
|
175
|
-
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery
|
|
176
|
-
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string
|
|
177
|
-
getLog(organizationId: string, projectSecureId: string, logId: string
|
|
178
|
-
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery
|
|
179
|
-
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number
|
|
180
|
-
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery
|
|
181
|
-
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string
|
|
182
|
-
getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery
|
|
183
|
-
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>;
|
|
184
206
|
getPlatformLogs(organizationId: string | undefined, query: PlatformQuery): Promise<PlatformQueryResult>;
|
|
185
207
|
getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
|
|
186
208
|
getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
|
|
@@ -188,10 +210,48 @@ interface IOlapClient {
|
|
|
188
210
|
getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
|
|
189
211
|
getPlatformAdvancedLog(organizationId: string, eventId: string): Promise<PlatformAdvancedLog | undefined>;
|
|
190
212
|
getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
213
|
+
getPolicyLog(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyLog | undefined>;
|
|
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>;
|
|
194
217
|
}
|
|
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
|
+
};
|
|
227
|
+
type PolicyObservation = {
|
|
228
|
+
level: string;
|
|
229
|
+
decision: 'allow' | 'deny';
|
|
230
|
+
policyIds: string[];
|
|
231
|
+
faulted?: boolean;
|
|
232
|
+
};
|
|
233
|
+
type PolicyContext = {
|
|
234
|
+
result: PolicyResult;
|
|
235
|
+
actionRunId: string;
|
|
236
|
+
actionId: string;
|
|
237
|
+
accountSecureId: string;
|
|
238
|
+
principal?: {
|
|
239
|
+
userId: string;
|
|
240
|
+
groups: string[];
|
|
241
|
+
};
|
|
242
|
+
decidedAt: string;
|
|
243
|
+
policyIds: string[];
|
|
244
|
+
names?: Record<string, string>;
|
|
245
|
+
maskedFields?: Array<{
|
|
246
|
+
path: string;
|
|
247
|
+
policyIds: string[];
|
|
248
|
+
level?: string;
|
|
249
|
+
}>;
|
|
250
|
+
resolved?: PolicyResolution[];
|
|
251
|
+
level?: string;
|
|
252
|
+
versions?: Record<string, number>;
|
|
253
|
+
observed?: PolicyObservation[];
|
|
254
|
+
};
|
|
195
255
|
type DefenderDecision = 'block' | 'allow' | 'count';
|
|
196
256
|
type DefenderContext = {
|
|
197
257
|
result?: {
|
|
@@ -254,6 +314,7 @@ type ActionResult = {
|
|
|
254
314
|
body?: unknown;
|
|
255
315
|
hasStepErrors?: boolean;
|
|
256
316
|
defenderContext?: DefenderContext;
|
|
317
|
+
policyContext?: PolicyContext;
|
|
257
318
|
endTime?: Date;
|
|
258
319
|
};
|
|
259
320
|
type StepInput = {
|
|
@@ -394,7 +455,6 @@ declare const LogType: {
|
|
|
394
455
|
readonly Platform: "platform";
|
|
395
456
|
};
|
|
396
457
|
type LogType = (typeof LogType)[keyof typeof LogType];
|
|
397
|
-
type OlapEngine = 'tinybird' | 'clickhouse';
|
|
398
458
|
type CombinedLogType = typeof LogType.Action | typeof LogType.Unified;
|
|
399
459
|
type Query = {
|
|
400
460
|
organizationId?: string | string[];
|
|
@@ -480,6 +540,8 @@ type ActionsQuery = {
|
|
|
480
540
|
transportType?: string | string[];
|
|
481
541
|
streamType?: string | string[];
|
|
482
542
|
statusCode?: string | string[];
|
|
543
|
+
policyResult?: string | string[];
|
|
544
|
+
riskLevel?: string | string[];
|
|
483
545
|
isBackground?: boolean;
|
|
484
546
|
success?: boolean;
|
|
485
547
|
startTime?: Date;
|
|
@@ -658,6 +720,8 @@ declare const Dimension: {
|
|
|
658
720
|
readonly AuthType: "authType";
|
|
659
721
|
readonly AuthId: "authId";
|
|
660
722
|
readonly IsBackground: "isBackground";
|
|
723
|
+
readonly PolicyResult: "policyResult";
|
|
724
|
+
readonly RiskLevel: "riskLevel";
|
|
661
725
|
};
|
|
662
726
|
type Dimension = (typeof Dimension)[keyof typeof Dimension];
|
|
663
727
|
type AggregateQuery = Partial<Query> & {
|
|
@@ -689,7 +753,6 @@ type SourceResult = Array<{
|
|
|
689
753
|
requestCount: number;
|
|
690
754
|
lastRequest: string;
|
|
691
755
|
}>;
|
|
692
|
-
type HttpClientBuilder = (logger?: ILogger) => HttpClient | undefined;
|
|
693
756
|
type SASLMechanism = 'PLAIN' | 'SCRAM-SHA-256' | 'SCRAM-SHA-512' | 'OAUTHBEARER';
|
|
694
757
|
interface KafkaClientConfig {
|
|
695
758
|
bootstrapBrokers: string[];
|
|
@@ -718,11 +781,6 @@ interface InternalKafkaClientConfig {
|
|
|
718
781
|
[key: string]: unknown;
|
|
719
782
|
}
|
|
720
783
|
type InternalKafkaClientBuilder = (config?: InternalKafkaClientConfig, logger?: ILogger) => Promise<Producer<string, string, string, string> | undefined>;
|
|
721
|
-
interface TinybirdConfig {
|
|
722
|
-
baseUrl: string;
|
|
723
|
-
token: string;
|
|
724
|
-
allowHttp?: boolean;
|
|
725
|
-
}
|
|
726
784
|
interface ClickHouseConfig {
|
|
727
785
|
url: string;
|
|
728
786
|
username?: string;
|
|
@@ -806,6 +864,7 @@ type ActionLog = ILog & {
|
|
|
806
864
|
isBackground?: boolean;
|
|
807
865
|
success?: boolean;
|
|
808
866
|
statusCode?: number;
|
|
867
|
+
policyResult?: string;
|
|
809
868
|
riskLevel?: string;
|
|
810
869
|
allowed?: boolean;
|
|
811
870
|
tier2Decision?: string;
|
|
@@ -951,13 +1010,10 @@ declare class ClickHouseClient implements IQueryClient {
|
|
|
951
1010
|
}
|
|
952
1011
|
//#endregion
|
|
953
1012
|
//#region src/logs/clientFactory.d.ts
|
|
954
|
-
type OlapQueryClientType = 'tinybird' | 'clickhouse';
|
|
955
1013
|
interface OlapQueryClientConfig {
|
|
956
|
-
type?: OlapQueryClientType;
|
|
957
|
-
tinybird?: TinybirdConfig;
|
|
958
1014
|
clickhouse?: ClickHouseConfig;
|
|
959
1015
|
}
|
|
960
|
-
declare function createOlapQueryClient(config: OlapQueryClientConfig,
|
|
1016
|
+
declare function createOlapQueryClient(config: OlapQueryClientConfig, logger?: ILogger): IQueryClient;
|
|
961
1017
|
declare function createConfigFromEnv(): OlapQueryClientConfig;
|
|
962
1018
|
//#endregion
|
|
963
1019
|
//#region src/datasets/types.d.ts
|
|
@@ -977,6 +1033,7 @@ type DatasetsSinkConfig = {
|
|
|
977
1033
|
type OlapSinkConfig = {
|
|
978
1034
|
advanced?: AdvancedSinkConfig;
|
|
979
1035
|
defender?: DefenderSinkConfig;
|
|
1036
|
+
policy?: PolicySinkConfig;
|
|
980
1037
|
datasets?: DatasetsSinkConfig;
|
|
981
1038
|
};
|
|
982
1039
|
//#endregion
|
|
@@ -988,28 +1045,24 @@ declare class OlapClient implements IOlapClient {
|
|
|
988
1045
|
static create({
|
|
989
1046
|
getKafkaClient,
|
|
990
1047
|
getInternalKafkaClient,
|
|
991
|
-
getHttpClient,
|
|
992
1048
|
getS3Client,
|
|
993
1049
|
kafkaClientConfig,
|
|
994
1050
|
externalKafkaClientConfig,
|
|
995
1051
|
internalKafkaClientConfig,
|
|
996
1052
|
topicClusterMap,
|
|
997
1053
|
s3ClientConfig,
|
|
998
|
-
tinybirdConfig,
|
|
999
1054
|
clickhouseConfig,
|
|
1000
1055
|
sinkConfig,
|
|
1001
1056
|
logger
|
|
1002
1057
|
}: {
|
|
1003
1058
|
getKafkaClient?: KafkaClientBuilder;
|
|
1004
1059
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1005
|
-
getHttpClient?: HttpClientBuilder;
|
|
1006
1060
|
getS3Client?: S3ClientBuilder;
|
|
1007
1061
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1008
1062
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1009
1063
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1010
1064
|
topicClusterMap: TopicClusterMap;
|
|
1011
1065
|
s3ClientConfig?: S3ClientConfig;
|
|
1012
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1013
1066
|
clickhouseConfig?: ClickHouseConfig;
|
|
1014
1067
|
sinkConfig?: OlapSinkConfig;
|
|
1015
1068
|
logger?: ILogger;
|
|
@@ -1030,55 +1083,52 @@ declare class OlapClient implements IOlapClient {
|
|
|
1030
1083
|
recordPlatform(platformInput: PlatformInput, platformResult: PlatformResult, options?: OlapOptions): Promise<void>;
|
|
1031
1084
|
recordPlatform(platformLog: PlatformLog, options?: OlapOptions): Promise<void>;
|
|
1032
1085
|
recordPlatform(platformLog: PlatformLog, advancedLog: PlatformAdvancedLog, options?: OlapOptions): Promise<void>;
|
|
1033
|
-
getLogs(organizationId: string, projectSecureId: string, query: Query
|
|
1086
|
+
getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
|
|
1034
1087
|
getLastLogs(organizationId: string, projectSecureId: string, entities: LogEntities, query?: Query): Promise<QueryResult>;
|
|
1035
|
-
getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery
|
|
1036
|
-
getActionLog(organizationId: string, projectSecureId: string, actionRunId: string
|
|
1037
|
-
getLog(organizationId: string, projectSecureId: string, logId: string
|
|
1038
|
-
getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery
|
|
1039
|
-
getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number
|
|
1040
|
-
getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery
|
|
1041
|
-
getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string
|
|
1042
|
-
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>;
|
|
1043
1096
|
getPlatformLogs(organizationId: string | undefined, query: PlatformQuery): Promise<PlatformQueryResult>;
|
|
1044
|
-
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string
|
|
1097
|
+
getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
|
|
1045
1098
|
getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
|
|
1046
1099
|
getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
|
|
1047
1100
|
getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
|
|
1048
1101
|
getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
|
|
1049
1102
|
getPlatformAdvancedLog(organizationId: string, eventId: string): Promise<PlatformAdvancedLog | undefined>;
|
|
1103
|
+
getPolicyLog(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyContext | undefined>;
|
|
1050
1104
|
getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
|
|
1051
|
-
getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery
|
|
1052
|
-
getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery
|
|
1053
|
-
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>;
|
|
1054
1108
|
}
|
|
1055
1109
|
//#endregion
|
|
1056
1110
|
//#region src/olap/olapClientManager.d.ts
|
|
1057
1111
|
declare const buildOlapClientInstance: ({
|
|
1058
1112
|
getKafkaClient,
|
|
1059
1113
|
getInternalKafkaClient,
|
|
1060
|
-
getHttpClient,
|
|
1061
1114
|
getS3Client,
|
|
1062
1115
|
kafkaClientConfig,
|
|
1063
1116
|
externalKafkaClientConfig,
|
|
1064
1117
|
internalKafkaClientConfig,
|
|
1065
1118
|
topicClusterMap,
|
|
1066
1119
|
s3ClientConfig,
|
|
1067
|
-
tinybirdConfig,
|
|
1068
1120
|
clickhouseConfig,
|
|
1069
1121
|
sinkConfig,
|
|
1070
1122
|
logger
|
|
1071
1123
|
}: {
|
|
1072
1124
|
getKafkaClient?: KafkaClientBuilder;
|
|
1073
1125
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1074
|
-
getHttpClient?: HttpClientBuilder;
|
|
1075
1126
|
getS3Client?: S3ClientBuilder;
|
|
1076
1127
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1077
1128
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1078
1129
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1079
1130
|
topicClusterMap: TopicClusterMap;
|
|
1080
1131
|
s3ClientConfig?: S3ClientConfig;
|
|
1081
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1082
1132
|
clickhouseConfig?: ClickHouseConfig;
|
|
1083
1133
|
sinkConfig?: OlapSinkConfig;
|
|
1084
1134
|
logger?: ILogger;
|
|
@@ -1088,14 +1138,12 @@ declare class OlapClientManager {
|
|
|
1088
1138
|
static getInstance({
|
|
1089
1139
|
getKafkaClient,
|
|
1090
1140
|
getInternalKafkaClient,
|
|
1091
|
-
getHttpClient,
|
|
1092
1141
|
getS3Client,
|
|
1093
1142
|
kafkaClientConfig,
|
|
1094
1143
|
externalKafkaClientConfig,
|
|
1095
1144
|
internalKafkaClientConfig,
|
|
1096
1145
|
topicClusterMap,
|
|
1097
1146
|
s3ClientConfig,
|
|
1098
|
-
tinybirdConfig,
|
|
1099
1147
|
clickhouseConfig,
|
|
1100
1148
|
sinkConfig,
|
|
1101
1149
|
logger,
|
|
@@ -1103,14 +1151,12 @@ declare class OlapClientManager {
|
|
|
1103
1151
|
}: {
|
|
1104
1152
|
getKafkaClient?: KafkaClientBuilder;
|
|
1105
1153
|
getInternalKafkaClient?: InternalKafkaClientBuilder;
|
|
1106
|
-
getHttpClient?: HttpClientBuilder;
|
|
1107
1154
|
getS3Client?: S3ClientBuilder;
|
|
1108
1155
|
kafkaClientConfig?: KafkaClientConfig;
|
|
1109
1156
|
externalKafkaClientConfig?: KafkaClientConfig;
|
|
1110
1157
|
internalKafkaClientConfig?: InternalKafkaClientConfig;
|
|
1111
1158
|
topicClusterMap: TopicClusterMap;
|
|
1112
1159
|
s3ClientConfig?: S3ClientConfig;
|
|
1113
|
-
tinybirdConfig?: TinybirdConfig;
|
|
1114
1160
|
clickhouseConfig?: ClickHouseConfig;
|
|
1115
1161
|
sinkConfig?: OlapSinkConfig;
|
|
1116
1162
|
logger?: ILogger;
|
|
@@ -1119,7 +1165,29 @@ declare class OlapClientManager {
|
|
|
1119
1165
|
static resetInstance(): void;
|
|
1120
1166
|
}
|
|
1121
1167
|
//#endregion
|
|
1168
|
+
//#region src/policy/policySink.d.ts
|
|
1169
|
+
declare function getPolicySink(s3Client?: S3Client, config?: PolicySinkConfig, logger?: ILogger): IPolicySink;
|
|
1170
|
+
declare class PolicySink implements IPolicySink {
|
|
1171
|
+
#private;
|
|
1172
|
+
constructor(s3Client?: S3Client, config?: PolicySinkConfig, logger?: ILogger);
|
|
1173
|
+
private requireBucket;
|
|
1174
|
+
initialize(): Promise<void>;
|
|
1175
|
+
sendAction(input: ActionInput, result: ActionResult, options?: PolicyOptions): Promise<{
|
|
1176
|
+
expiresAt: Date;
|
|
1177
|
+
} | null>;
|
|
1178
|
+
sendActions(actions: Array<{
|
|
1179
|
+
input: ActionInput;
|
|
1180
|
+
result: ActionResult;
|
|
1181
|
+
}>, options?: PolicyOptions): Promise<Array<{
|
|
1182
|
+
expiresAt: Date;
|
|
1183
|
+
} | null>>;
|
|
1184
|
+
getAction(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyLog | undefined>;
|
|
1185
|
+
private send;
|
|
1186
|
+
private generateS3Key;
|
|
1187
|
+
private createPolicyS3;
|
|
1188
|
+
}
|
|
1189
|
+
//#endregion
|
|
1122
1190
|
//#region src/utils/stepErrors.d.ts
|
|
1123
1191
|
declare const hasErrorEntries: (errors: unknown) => boolean;
|
|
1124
1192
|
//#endregion
|
|
1125
|
-
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
|
|
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 };
|