@stackone/olap 1.78.0 → 1.80.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
@@ -234,7 +234,7 @@ type PolicyRecord = {
234
234
  version?: number;
235
235
  level: string;
236
236
  mode: 'enforce' | 'monitor';
237
- effect?: 'refused' | 'masked' | 'redacted' | 'would-have-refused' | 'permitted';
237
+ effect?: 'refused' | 'masked' | 'redacted' | 'would-have-refused' | 'would-have-masked' | 'permitted';
238
238
  };
239
239
  type PolicyObservation = {
240
240
  level: string;
@@ -259,6 +259,11 @@ type PolicyContext = {
259
259
  policyIds: string[];
260
260
  level?: string;
261
261
  }>;
262
+ observedFields?: Array<{
263
+ path: string;
264
+ policyIds: string[];
265
+ level?: string;
266
+ }>;
262
267
  redactedClasses?: Array<{
263
268
  class: string;
264
269
  policyIds: string[];
@@ -825,42 +830,6 @@ interface ClickHouseConfig {
825
830
  database: string;
826
831
  requestTimeout?: number;
827
832
  }
828
- interface QueryResponse<T> {
829
- meta: Array<{
830
- name: string;
831
- type: string;
832
- }>;
833
- data: T;
834
- rows: number;
835
- rows_before_limit_at_least?: number;
836
- statistics?: {
837
- elapsed: number;
838
- rows_read: number;
839
- bytes_read: number;
840
- };
841
- }
842
- interface QueryOptions<TParams = Record<string, unknown>, TResult = unknown> {
843
- endpoint: string;
844
- params?: TParams;
845
- schema?: {
846
- parse: (data: unknown) => TResult;
847
- };
848
- }
849
- interface IQueryClient {
850
- query<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<TResult[]>;
851
- queryWithPagination<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult> & {
852
- pageNumber?: number;
853
- pageSize?: number;
854
- }): Promise<{
855
- data: TResult[];
856
- total: number;
857
- pageNumber: number;
858
- pageSize: number;
859
- }>;
860
- queryRaw<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<QueryResponse<TResult[]>>;
861
- isReady(): boolean;
862
- close?(): Promise<void>;
863
- }
864
833
  interface ILog {
865
834
  logType: LogType;
866
835
  eventTime: Date;
@@ -1028,32 +997,6 @@ type PlatformLog = ILog & {
1028
997
  details?: Record<string, unknown>;
1029
998
  };
1030
999
  //#endregion
1031
- //#region src/logs/clickhouseClient.d.ts
1032
- declare class ClickHouseClient implements IQueryClient {
1033
- #private;
1034
- constructor(config?: ClickHouseConfig, logger?: ILogger);
1035
- query<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<TResult[]>;
1036
- queryWithPagination<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult> & {
1037
- pageNumber?: number;
1038
- pageSize?: number;
1039
- }): Promise<{
1040
- data: TResult[];
1041
- total: number;
1042
- pageNumber: number;
1043
- pageSize: number;
1044
- }>;
1045
- queryRaw<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<QueryResponse<TResult[]>>;
1046
- isReady(): boolean;
1047
- close(): Promise<void>;
1048
- }
1049
- //#endregion
1050
- //#region src/logs/clientFactory.d.ts
1051
- interface OlapQueryClientConfig {
1052
- clickhouse?: ClickHouseConfig;
1053
- }
1054
- declare function createOlapQueryClient(config: OlapQueryClientConfig, logger?: ILogger): IQueryClient;
1055
- declare function createConfigFromEnv(): OlapQueryClientConfig;
1056
- //#endregion
1057
1000
  //#region src/datasets/types.d.ts
1058
1001
  type LogfireConfig = {
1059
1002
  token?: string;
@@ -1233,4 +1176,4 @@ declare class PolicySink implements IPolicySink {
1233
1176
  //#region src/utils/stepErrors.d.ts
1234
1177
  declare const hasErrorEntries: (errors: unknown) => boolean;
1235
1178
  //#endregion
1236
- 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, PlatformDimension, type PlatformDimension as PlatformDimensionValues, type PlatformDimensionsQuery, type PlatformInput, type PlatformLog, type PlatformQuery, type PlatformQueryResult, type PlatformResult, type PolicyContext, type PolicyLog, type PolicyObservation, type PolicyOptions, type PolicyRecord, 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 };
1179
+ 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, 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 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 OlapSinkConfig, OrderBy, type OrderBy as OrderByValues, OrderDirection, type OrderDirection as OrderDirectionValues, type PlatformAdvancedLog, PlatformDimension, type PlatformDimension as PlatformDimensionValues, type PlatformDimensionsQuery, type PlatformInput, type PlatformLog, type PlatformQuery, type PlatformQueryResult, type PlatformResult, type PolicyContext, type PolicyLog, type PolicyObservation, type PolicyOptions, type PolicyRecord, type PolicyResult, PolicySink, type PolicySinkConfig, type ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, 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, getPolicySink, hasErrorEntries };
package/dist/index.d.mts CHANGED
@@ -233,7 +233,7 @@ type PolicyRecord = {
233
233
  version?: number;
234
234
  level: string;
235
235
  mode: 'enforce' | 'monitor';
236
- effect?: 'refused' | 'masked' | 'redacted' | 'would-have-refused' | 'permitted';
236
+ effect?: 'refused' | 'masked' | 'redacted' | 'would-have-refused' | 'would-have-masked' | 'permitted';
237
237
  };
238
238
  type PolicyObservation = {
239
239
  level: string;
@@ -258,6 +258,11 @@ type PolicyContext = {
258
258
  policyIds: string[];
259
259
  level?: string;
260
260
  }>;
261
+ observedFields?: Array<{
262
+ path: string;
263
+ policyIds: string[];
264
+ level?: string;
265
+ }>;
261
266
  redactedClasses?: Array<{
262
267
  class: string;
263
268
  policyIds: string[];
@@ -824,42 +829,6 @@ interface ClickHouseConfig {
824
829
  database: string;
825
830
  requestTimeout?: number;
826
831
  }
827
- interface QueryResponse<T> {
828
- meta: Array<{
829
- name: string;
830
- type: string;
831
- }>;
832
- data: T;
833
- rows: number;
834
- rows_before_limit_at_least?: number;
835
- statistics?: {
836
- elapsed: number;
837
- rows_read: number;
838
- bytes_read: number;
839
- };
840
- }
841
- interface QueryOptions<TParams = Record<string, unknown>, TResult = unknown> {
842
- endpoint: string;
843
- params?: TParams;
844
- schema?: {
845
- parse: (data: unknown) => TResult;
846
- };
847
- }
848
- interface IQueryClient {
849
- query<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<TResult[]>;
850
- queryWithPagination<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult> & {
851
- pageNumber?: number;
852
- pageSize?: number;
853
- }): Promise<{
854
- data: TResult[];
855
- total: number;
856
- pageNumber: number;
857
- pageSize: number;
858
- }>;
859
- queryRaw<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<QueryResponse<TResult[]>>;
860
- isReady(): boolean;
861
- close?(): Promise<void>;
862
- }
863
832
  interface ILog {
864
833
  logType: LogType;
865
834
  eventTime: Date;
@@ -1027,32 +996,6 @@ type PlatformLog = ILog & {
1027
996
  details?: Record<string, unknown>;
1028
997
  };
1029
998
  //#endregion
1030
- //#region src/logs/clickhouseClient.d.ts
1031
- declare class ClickHouseClient implements IQueryClient {
1032
- #private;
1033
- constructor(config?: ClickHouseConfig, logger?: ILogger);
1034
- query<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<TResult[]>;
1035
- queryWithPagination<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult> & {
1036
- pageNumber?: number;
1037
- pageSize?: number;
1038
- }): Promise<{
1039
- data: TResult[];
1040
- total: number;
1041
- pageNumber: number;
1042
- pageSize: number;
1043
- }>;
1044
- queryRaw<TParams = Record<string, unknown>, TResult = unknown>(options: QueryOptions<TParams, TResult>): Promise<QueryResponse<TResult[]>>;
1045
- isReady(): boolean;
1046
- close(): Promise<void>;
1047
- }
1048
- //#endregion
1049
- //#region src/logs/clientFactory.d.ts
1050
- interface OlapQueryClientConfig {
1051
- clickhouse?: ClickHouseConfig;
1052
- }
1053
- declare function createOlapQueryClient(config: OlapQueryClientConfig, logger?: ILogger): IQueryClient;
1054
- declare function createConfigFromEnv(): OlapQueryClientConfig;
1055
- //#endregion
1056
999
  //#region src/datasets/types.d.ts
1057
1000
  type LogfireConfig = {
1058
1001
  token?: string;
@@ -1232,4 +1175,4 @@ declare class PolicySink implements IPolicySink {
1232
1175
  //#region src/utils/stepErrors.d.ts
1233
1176
  declare const hasErrorEntries: (errors: unknown) => boolean;
1234
1177
  //#endregion
1235
- 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, PlatformDimension, type PlatformDimension as PlatformDimensionValues, type PlatformDimensionsQuery, type PlatformInput, type PlatformLog, type PlatformQuery, type PlatformQueryResult, type PlatformResult, type PolicyContext, type PolicyLog, type PolicyObservation, type PolicyOptions, type PolicyRecord, 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 };
1178
+ 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, 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 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 OlapSinkConfig, OrderBy, type OrderBy as OrderByValues, OrderDirection, type OrderDirection as OrderDirectionValues, type PlatformAdvancedLog, PlatformDimension, type PlatformDimension as PlatformDimensionValues, type PlatformDimensionsQuery, type PlatformInput, type PlatformLog, type PlatformQuery, type PlatformQueryResult, type PlatformResult, type PolicyContext, type PolicyLog, type PolicyObservation, type PolicyOptions, type PolicyRecord, type PolicyResult, PolicySink, type PolicySinkConfig, type ProviderAdvancedLog, type ProviderInput, type ProviderLog, type ProviderQuery, type ProviderQueryResult, type ProviderResult, type Query, 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, getPolicySink, hasErrorEntries };