@stackone/olap 1.66.1 → 1.68.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/dist/index.d.cts CHANGED
@@ -5,6 +5,9 @@ import { Producer } from "@platformatic/kafka";
5
5
 
6
6
  //#region \0rolldown/runtime.js
7
7
  //#endregion
8
+ //#region src/advanced/truncation.d.ts
9
+ type TruncationMode = 'drop' | 'truncate' | 'complete';
10
+ //#endregion
8
11
  //#region src/olap/olapOptions.d.ts
9
12
  type OlapOptions = {
10
13
  logs?: LogsOptions;
@@ -20,6 +23,7 @@ type AdvancedOptions = {
20
23
  ttl?: number;
21
24
  errorsOnly?: boolean;
22
25
  includeBackground?: boolean;
26
+ truncation?: TruncationMode;
23
27
  };
24
28
  type DefenderOptions = {
25
29
  enabled?: boolean;
@@ -49,48 +53,44 @@ type DefenderLog = {
49
53
  type AdvancedSinkConfig = {
50
54
  bucket?: string;
51
55
  maxItemSizeBytes?: number;
56
+ errorSizeMultiplier?: number;
57
+ };
58
+ type AdvancedLogMetadata = {
59
+ isBackgroundLog?: boolean;
60
+ expirationTime?: number;
61
+ sizeBytes?: number;
62
+ maxSizeBytes?: number;
63
+ truncated?: true;
52
64
  };
53
65
  type ActionAdvancedLog = {
54
66
  data: {
55
67
  [key: string]: unknown;
56
68
  };
57
- metadata?: {
58
- isBackgroundLog?: boolean;
59
- expirationTime?: number;
60
- };
69
+ metadata?: AdvancedLogMetadata;
61
70
  };
62
71
  type StepAdvancedLog = {
63
72
  data: {
64
73
  [key: string]: unknown;
65
74
  };
66
- metadata?: {
67
- expirationTime?: number;
68
- };
75
+ metadata?: AdvancedLogMetadata;
69
76
  };
70
77
  type UnifiedAdvancedLog = {
71
78
  data: {
72
79
  [key: string]: unknown;
73
80
  };
74
- metadata?: {
75
- isBackgroundLog?: boolean;
76
- expirationTime?: number;
77
- };
81
+ metadata?: AdvancedLogMetadata;
78
82
  };
79
83
  type ProviderAdvancedLog = {
80
84
  data: {
81
85
  [key: string]: unknown;
82
86
  };
83
- metadata?: {
84
- expirationTime?: number;
85
- };
87
+ metadata?: AdvancedLogMetadata;
86
88
  };
87
89
  type PlatformAdvancedLog = {
88
90
  data: {
89
91
  [key: string]: unknown;
90
92
  };
91
- metadata?: {
92
- expirationTime?: number;
93
- };
93
+ metadata?: AdvancedLogMetadata;
94
94
  };
95
95
  interface S3ClientConfig {
96
96
  region?: string;
@@ -179,7 +179,7 @@ interface IOlapClient {
179
179
  getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string, engine?: OlapEngine): Promise<UnifiedLog | undefined>;
180
180
  getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery, engine?: OlapEngine): Promise<ProviderQueryResult>;
181
181
  getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string, engine?: OlapEngine): Promise<ProviderLog | undefined>;
182
- getPlatformLogs(organizationId: string, query: PlatformQuery, engine?: OlapEngine): Promise<PlatformQueryResult>;
182
+ getPlatformLogs(organizationId: string, query: PlatformQuery): Promise<PlatformQueryResult>;
183
183
  getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
184
184
  getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
185
185
  getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
@@ -372,6 +372,7 @@ type PlatformInput = {
372
372
  agentId?: string;
373
373
  transportType?: TransportType;
374
374
  streamType?: StreamType;
375
+ isRead?: boolean;
375
376
  details?: Record<string, unknown>;
376
377
  startTime?: Date;
377
378
  };
@@ -390,6 +391,7 @@ declare const LogType: {
390
391
  };
391
392
  type LogType = (typeof LogType)[keyof typeof LogType];
392
393
  type OlapEngine = 'tinybird' | 'clickhouse';
394
+ type CombinedLogType = typeof LogType.Action | typeof LogType.Unified;
393
395
  type Query = {
394
396
  organizationId?: string | string[];
395
397
  projectSecureId?: string | string[];
@@ -427,7 +429,7 @@ type Query = {
427
429
  streamType?: string | string[];
428
430
  isBackground?: boolean;
429
431
  logId?: string | string[];
430
- logType?: (typeof LogType.Action | typeof LogType.Unified) | (typeof LogType.Action | typeof LogType.Unified)[];
432
+ logType?: CombinedLogType | CombinedLogType[];
431
433
  success?: boolean;
432
434
  startTime?: Date;
433
435
  endTime?: Date;
@@ -597,6 +599,7 @@ type PlatformQuery = {
597
599
  agentId?: string | string[];
598
600
  transportType?: string | string[];
599
601
  streamType?: string | string[];
602
+ isRead?: boolean;
600
603
  success?: boolean;
601
604
  startTime?: Date;
602
605
  endTime?: Date;
@@ -912,6 +915,7 @@ type PlatformLog = ILog & {
912
915
  agentId?: string;
913
916
  transportType?: TransportType;
914
917
  streamType?: StreamType;
918
+ isRead?: boolean;
915
919
  success?: boolean;
916
920
  details?: string;
917
921
  };
@@ -1025,7 +1029,7 @@ declare class OlapClient implements IOlapClient {
1025
1029
  getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery, engine?: OlapEngine): Promise<UnifiedQueryResult>;
1026
1030
  getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string, engine?: OlapEngine): Promise<UnifiedLog | undefined>;
1027
1031
  getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery, engine?: OlapEngine): Promise<ProviderQueryResult>;
1028
- getPlatformLogs(organizationId: string, query: PlatformQuery, engine?: OlapEngine): Promise<PlatformQueryResult>;
1032
+ getPlatformLogs(organizationId: string, query: PlatformQuery): Promise<PlatformQueryResult>;
1029
1033
  getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string, engine?: OlapEngine): Promise<ProviderLog | undefined>;
1030
1034
  getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
1031
1035
  getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
@@ -1107,4 +1111,4 @@ declare class OlapClientManager {
1107
1111
  //#region src/utils/stepErrors.d.ts
1108
1112
  declare const hasErrorEntries: (errors: unknown) => boolean;
1109
1113
  //#endregion
1110
- export { type ActionAdvancedLog, type ActionInput, type ActionLog, type ActionResult, type ActionsQuery, type ActionsQueryResult, type AdvancedOptions, type AdvancedSinkConfig, type AggregateQuery, type AggregateResult, AuthType, type AuthType as AuthTypeValue, ClickHouseClient, type ClickHouseConfig, 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 IQueryClient, type IQueryClient as ITinybirdClient, 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 OlapEngine, type OlapOptions, type OlapQueryClientConfig, type OlapQueryClientType, 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 ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, type QueryOptions, type QueryOptions as TinybirdQueryOptions, type QueryResponse, type QueryResponse as TinybirdResponse, 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 TinybirdConfig, type TopicClusterMap, TransportType, type TransportType as TransportTypeValue, type UnifiedAdvancedLog, type UnifiedInput, type UnifiedLog, type UnifiedQuery, type UnifiedQueryResult, type UnifiedResult, createConfigFromEnv, createOlapQueryClient, hasErrorEntries };
1114
+ 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 IQueryClient, type IQueryClient as ITinybirdClient, 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 OlapEngine, type OlapOptions, type OlapQueryClientConfig, type OlapQueryClientType, 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 ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, type QueryOptions, type QueryOptions as TinybirdQueryOptions, type QueryResponse, type QueryResponse as TinybirdResponse, 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 TinybirdConfig, type TopicClusterMap, TransportType, type TransportType as TransportTypeValue, type TruncationMode, type UnifiedAdvancedLog, type UnifiedInput, type UnifiedLog, type UnifiedQuery, type UnifiedQueryResult, type UnifiedResult, createConfigFromEnv, createOlapQueryClient, hasErrorEntries };
package/dist/index.d.mts CHANGED
@@ -4,6 +4,9 @@ import { HttpClient } from "@stackone/transport";
4
4
  import { ILogger } from "@stackone/logger";
5
5
  import { Producer } from "@platformatic/kafka";
6
6
 
7
+ //#region src/advanced/truncation.d.ts
8
+ type TruncationMode = 'drop' | 'truncate' | 'complete';
9
+ //#endregion
7
10
  //#region src/olap/olapOptions.d.ts
8
11
  type OlapOptions = {
9
12
  logs?: LogsOptions;
@@ -19,6 +22,7 @@ type AdvancedOptions = {
19
22
  ttl?: number;
20
23
  errorsOnly?: boolean;
21
24
  includeBackground?: boolean;
25
+ truncation?: TruncationMode;
22
26
  };
23
27
  type DefenderOptions = {
24
28
  enabled?: boolean;
@@ -48,48 +52,44 @@ type DefenderLog = {
48
52
  type AdvancedSinkConfig = {
49
53
  bucket?: string;
50
54
  maxItemSizeBytes?: number;
55
+ errorSizeMultiplier?: number;
56
+ };
57
+ type AdvancedLogMetadata = {
58
+ isBackgroundLog?: boolean;
59
+ expirationTime?: number;
60
+ sizeBytes?: number;
61
+ maxSizeBytes?: number;
62
+ truncated?: true;
51
63
  };
52
64
  type ActionAdvancedLog = {
53
65
  data: {
54
66
  [key: string]: unknown;
55
67
  };
56
- metadata?: {
57
- isBackgroundLog?: boolean;
58
- expirationTime?: number;
59
- };
68
+ metadata?: AdvancedLogMetadata;
60
69
  };
61
70
  type StepAdvancedLog = {
62
71
  data: {
63
72
  [key: string]: unknown;
64
73
  };
65
- metadata?: {
66
- expirationTime?: number;
67
- };
74
+ metadata?: AdvancedLogMetadata;
68
75
  };
69
76
  type UnifiedAdvancedLog = {
70
77
  data: {
71
78
  [key: string]: unknown;
72
79
  };
73
- metadata?: {
74
- isBackgroundLog?: boolean;
75
- expirationTime?: number;
76
- };
80
+ metadata?: AdvancedLogMetadata;
77
81
  };
78
82
  type ProviderAdvancedLog = {
79
83
  data: {
80
84
  [key: string]: unknown;
81
85
  };
82
- metadata?: {
83
- expirationTime?: number;
84
- };
86
+ metadata?: AdvancedLogMetadata;
85
87
  };
86
88
  type PlatformAdvancedLog = {
87
89
  data: {
88
90
  [key: string]: unknown;
89
91
  };
90
- metadata?: {
91
- expirationTime?: number;
92
- };
92
+ metadata?: AdvancedLogMetadata;
93
93
  };
94
94
  interface S3ClientConfig {
95
95
  region?: string;
@@ -178,7 +178,7 @@ interface IOlapClient {
178
178
  getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string, engine?: OlapEngine): Promise<UnifiedLog | undefined>;
179
179
  getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery, engine?: OlapEngine): Promise<ProviderQueryResult>;
180
180
  getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string, engine?: OlapEngine): Promise<ProviderLog | undefined>;
181
- getPlatformLogs(organizationId: string, query: PlatformQuery, engine?: OlapEngine): Promise<PlatformQueryResult>;
181
+ getPlatformLogs(organizationId: string, query: PlatformQuery): Promise<PlatformQueryResult>;
182
182
  getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
183
183
  getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
184
184
  getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
@@ -371,6 +371,7 @@ type PlatformInput = {
371
371
  agentId?: string;
372
372
  transportType?: TransportType;
373
373
  streamType?: StreamType;
374
+ isRead?: boolean;
374
375
  details?: Record<string, unknown>;
375
376
  startTime?: Date;
376
377
  };
@@ -389,6 +390,7 @@ declare const LogType: {
389
390
  };
390
391
  type LogType = (typeof LogType)[keyof typeof LogType];
391
392
  type OlapEngine = 'tinybird' | 'clickhouse';
393
+ type CombinedLogType = typeof LogType.Action | typeof LogType.Unified;
392
394
  type Query = {
393
395
  organizationId?: string | string[];
394
396
  projectSecureId?: string | string[];
@@ -426,7 +428,7 @@ type Query = {
426
428
  streamType?: string | string[];
427
429
  isBackground?: boolean;
428
430
  logId?: string | string[];
429
- logType?: (typeof LogType.Action | typeof LogType.Unified) | (typeof LogType.Action | typeof LogType.Unified)[];
431
+ logType?: CombinedLogType | CombinedLogType[];
430
432
  success?: boolean;
431
433
  startTime?: Date;
432
434
  endTime?: Date;
@@ -596,6 +598,7 @@ type PlatformQuery = {
596
598
  agentId?: string | string[];
597
599
  transportType?: string | string[];
598
600
  streamType?: string | string[];
601
+ isRead?: boolean;
599
602
  success?: boolean;
600
603
  startTime?: Date;
601
604
  endTime?: Date;
@@ -911,6 +914,7 @@ type PlatformLog = ILog & {
911
914
  agentId?: string;
912
915
  transportType?: TransportType;
913
916
  streamType?: StreamType;
917
+ isRead?: boolean;
914
918
  success?: boolean;
915
919
  details?: string;
916
920
  };
@@ -1024,7 +1028,7 @@ declare class OlapClient implements IOlapClient {
1024
1028
  getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery, engine?: OlapEngine): Promise<UnifiedQueryResult>;
1025
1029
  getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string, engine?: OlapEngine): Promise<UnifiedLog | undefined>;
1026
1030
  getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery, engine?: OlapEngine): Promise<ProviderQueryResult>;
1027
- getPlatformLogs(organizationId: string, query: PlatformQuery, engine?: OlapEngine): Promise<PlatformQueryResult>;
1031
+ getPlatformLogs(organizationId: string, query: PlatformQuery): Promise<PlatformQueryResult>;
1028
1032
  getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string, engine?: OlapEngine): Promise<ProviderLog | undefined>;
1029
1033
  getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
1030
1034
  getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
@@ -1106,4 +1110,4 @@ declare class OlapClientManager {
1106
1110
  //#region src/utils/stepErrors.d.ts
1107
1111
  declare const hasErrorEntries: (errors: unknown) => boolean;
1108
1112
  //#endregion
1109
- export { type ActionAdvancedLog, type ActionInput, type ActionLog, type ActionResult, type ActionsQuery, type ActionsQueryResult, type AdvancedOptions, type AdvancedSinkConfig, type AggregateQuery, type AggregateResult, AuthType, type AuthType as AuthTypeValue, ClickHouseClient, type ClickHouseConfig, 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 IQueryClient, type IQueryClient as ITinybirdClient, 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 OlapEngine, type OlapOptions, type OlapQueryClientConfig, type OlapQueryClientType, 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 ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, type QueryOptions, type QueryOptions as TinybirdQueryOptions, type QueryResponse, type QueryResponse as TinybirdResponse, 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 TinybirdConfig, type TopicClusterMap, TransportType, type TransportType as TransportTypeValue, type UnifiedAdvancedLog, type UnifiedInput, type UnifiedLog, type UnifiedQuery, type UnifiedQueryResult, type UnifiedResult, createConfigFromEnv, createOlapQueryClient, hasErrorEntries };
1113
+ 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 IQueryClient, type IQueryClient as ITinybirdClient, 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 OlapEngine, type OlapOptions, type OlapQueryClientConfig, type OlapQueryClientType, 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 ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, type QueryOptions, type QueryOptions as TinybirdQueryOptions, type QueryResponse, type QueryResponse as TinybirdResponse, 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 TinybirdConfig, type TopicClusterMap, TransportType, type TransportType as TransportTypeValue, type TruncationMode, type UnifiedAdvancedLog, type UnifiedInput, type UnifiedLog, type UnifiedQuery, type UnifiedQueryResult, type UnifiedResult, createConfigFromEnv, createOlapQueryClient, hasErrorEntries };