@stackone/olap 3.5.0 → 3.6.1

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
@@ -1,18 +1,11 @@
1
+ import { t as __name } from "./rolldown-runtime-DDTgaCGG.cjs";
1
2
  import { HeaderValue } from "@stackone/utils";
2
3
  import { ILogger } from "@stackone/logger";
3
4
  import { Producer } from "@platformatic/kafka";
4
5
  import { z } from "zod";
5
6
  import { Storage } from "@stackone/storage";
6
-
7
- //#region \0rolldown/runtime.js
8
- //#endregion
9
- //#region src/advanced/callerHeaders.d.ts
10
- declare const callerHeadersOf: (headers: Record<string, HeaderValue> | undefined) => Record<string, string> | undefined;
11
- //#endregion
12
- //#region src/advanced/truncation.d.ts
7
+ export declare const callerHeadersOf: (headers: Record<string, HeaderValue> | undefined) => Record<string, string> | undefined;
13
8
  type TruncationMode = 'drop' | 'truncate' | 'complete';
14
- //#endregion
15
- //#region src/olap/olapOptions.d.ts
16
9
  type OlapOptions = {
17
10
  logs?: LogsOptions;
18
11
  advanced?: AdvancedOptions;
@@ -43,8 +36,6 @@ type DatasetsOptions = {
43
36
  otelDataset?: string;
44
37
  includeBackground?: boolean;
45
38
  };
46
- //#endregion
47
- //#region src/advanced/types.d.ts
48
39
  type AdvancedSinkConfig = {
49
40
  bucket?: string;
50
41
  maxItemSizeBytes?: number;
@@ -92,8 +83,6 @@ type PlatformAdvancedLog = {
92
83
  };
93
84
  metadata?: AdvancedLogMetadata;
94
85
  };
95
- //#endregion
96
- //#region src/defender/types.d.ts
97
86
  type DefenderSinkConfig = {
98
87
  bucket?: string;
99
88
  ttlDays?: number;
@@ -106,8 +95,6 @@ type DefenderLog = {
106
95
  };
107
96
  [key: string]: unknown;
108
97
  };
109
- //#endregion
110
- //#region src/policy/types.d.ts
111
98
  type PolicySinkConfig = {
112
99
  bucket?: string;
113
100
  ttlDays?: number;
@@ -125,9 +112,7 @@ interface IPolicySink {
125
112
  getAction(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyLog | undefined>;
126
113
  }
127
114
  type PolicyLog = PolicyContext;
128
- //#endregion
129
- //#region src/types.d.ts
130
- declare const SourceType: {
115
+ export declare const SourceType: {
131
116
  readonly RequestTester: 'REQUEST_TESTER';
132
117
  readonly ActionTester: 'ACTION_TESTER';
133
118
  readonly Discode: 'DISCODE';
@@ -145,21 +130,21 @@ declare const SourceType: {
145
130
  readonly Internal: 'INTERNAL';
146
131
  readonly ConnectionTest: 'CONNECTION_TEST';
147
132
  };
148
- type SourceType = (typeof SourceType)[keyof typeof SourceType];
149
- declare const TransportType: {
133
+ export type SourceType = (typeof SourceType)[keyof typeof SourceType];
134
+ export declare const TransportType: {
150
135
  readonly HTTP: 'HTTP';
151
136
  readonly MCP: 'MCP';
152
137
  readonly ActionRPC: 'ACTION_RPC';
153
138
  readonly WebSocket: 'WEBSOCKET';
154
139
  };
155
- type TransportType = (typeof TransportType)[keyof typeof TransportType];
156
- declare const StreamType: {
140
+ export type TransportType = (typeof TransportType)[keyof typeof TransportType];
141
+ export declare const StreamType: {
157
142
  readonly HTTP: 'HTTP';
158
143
  readonly WebSocket: 'WEBSOCKET';
159
144
  readonly SSE: 'SSE';
160
145
  };
161
- type StreamType = (typeof StreamType)[keyof typeof StreamType];
162
- declare const AuthType: {
146
+ export type StreamType = (typeof StreamType)[keyof typeof StreamType];
147
+ export declare const AuthType: {
163
148
  readonly APIKey: 'API_KEY';
164
149
  readonly SessionToken: 'SESSION_TOKEN';
165
150
  readonly UserSession: 'USER_SESSION';
@@ -167,7 +152,7 @@ declare const AuthType: {
167
152
  readonly Webhook: 'WEBHOOK';
168
153
  readonly Signature: 'SIGNATURE';
169
154
  };
170
- type AuthType = (typeof AuthType)[keyof typeof AuthType];
155
+ export type AuthType = (typeof AuthType)[keyof typeof AuthType];
171
156
  type Source = {
172
157
  sourceType?: SourceType;
173
158
  sourceId?: string;
@@ -257,7 +242,9 @@ type WithheldReason = 'rule' | 'no-permit' | 'fault' | 'unchecked';
257
242
  type UnenforcedRedaction = {
258
243
  reason: 'no-engine' | 'streamed' | 'engine-skipped' | 'engine-failed';
259
244
  classes?: string[];
245
+ cause?: UnenforcedCause;
260
246
  };
247
+ type UnenforcedCause = 'oversized' | 'too_large' | 'model_unavailable' | 'unreadable' | 'faulted' | 'service_unavailable' | 'timeout' | 'busy' | 'invalid_response' | 'serialise_failed';
261
248
  type FaultedPolicySet = {
262
249
  level: string;
263
250
  mode: 'enforce' | 'monitor';
@@ -498,8 +485,6 @@ type PlatformResult = {
498
485
  success?: boolean;
499
486
  endTime?: Date;
500
487
  };
501
- //#endregion
502
- //#region src/logs/queryConditions.d.ts
503
488
  declare const LOG_QUERY_COLUMNS: {
504
489
  readonly account_secure_id: 'accountSecureId';
505
490
  readonly connector_key: 'connectorKey';
@@ -536,8 +521,8 @@ declare const LOG_QUERY_COLUMNS: {
536
521
  readonly session_auth_id: "if(authType = 'SESSION_TOKEN', authId, NULL)";
537
522
  };
538
523
  type LogQueryField = keyof typeof LOG_QUERY_COLUMNS;
539
- declare const LOG_QUERY_FIELDS: LogQueryField[];
540
- declare const LOG_QUERY_OPERATORS: readonly ['eq', 'ne', 'gt', 'gte', 'lt', 'lte'];
524
+ export declare const LOG_QUERY_FIELDS: LogQueryField[];
525
+ export declare const LOG_QUERY_OPERATORS: readonly ['eq', 'ne', 'gt', 'gte', 'lt', 'lte'];
541
526
  type LogQueryOperator = (typeof LOG_QUERY_OPERATORS)[number];
542
527
  declare const CONDITION_SCHEMA: z.ZodObject<{
543
528
  field: z.ZodEnum<{
@@ -586,7 +571,7 @@ declare const CONDITION_SCHEMA: z.ZodObject<{
586
571
  values: z.ZodArray<z.ZodString>;
587
572
  }, z.core.$strip>;
588
573
  type LogQueryCondition = z.infer<typeof CONDITION_SCHEMA>;
589
- declare class InvalidLogQueryConditionsError extends Error {
574
+ export declare class InvalidLogQueryConditionsError extends Error {
590
575
  readonly issues: {
591
576
  path: (string | number)[];
592
577
  message: string;
@@ -594,17 +579,15 @@ declare class InvalidLogQueryConditionsError extends Error {
594
579
  readonly cause: z.ZodError;
595
580
  constructor(error: z.ZodError);
596
581
  }
597
- declare const parseLogQueryConditions: (conditions?: unknown) => LogQueryCondition[];
598
- //#endregion
599
- //#region src/logs/types.d.ts
600
- declare const LogType: {
582
+ export declare const parseLogQueryConditions: (conditions?: unknown) => LogQueryCondition[];
583
+ export declare const LogType: {
601
584
  readonly Action: 'action';
602
585
  readonly Step: 'step';
603
586
  readonly Unified: 'unified';
604
587
  readonly Provider: 'provider';
605
588
  readonly Platform: 'platform';
606
589
  };
607
- type LogType = (typeof LogType)[keyof typeof LogType];
590
+ export type LogType = (typeof LogType)[keyof typeof LogType];
608
591
  type CombinedLogType = typeof LogType.Action | typeof LogType.Unified;
609
592
  type AuthPair = {
610
593
  authType: AuthType;
@@ -840,19 +823,19 @@ type PlatformQueryResult = {
840
823
  pageNumber: number;
841
824
  pageSize: number;
842
825
  };
843
- declare const OrderBy: {
826
+ export declare const OrderBy: {
844
827
  readonly StartTime: 'startTime';
845
828
  readonly EndTime: 'endTime';
846
829
  readonly EventTime: 'eventTime';
847
830
  readonly DurationMs: 'durationMs';
848
831
  };
849
- type OrderBy = (typeof OrderBy)[keyof typeof OrderBy];
850
- declare const OrderDirection: {
832
+ export type OrderBy = (typeof OrderBy)[keyof typeof OrderBy];
833
+ export declare const OrderDirection: {
851
834
  readonly Asc: 'asc';
852
835
  readonly Desc: 'desc';
853
836
  };
854
- type OrderDirection = (typeof OrderDirection)[keyof typeof OrderDirection];
855
- declare const IntervalType: {
837
+ export type OrderDirection = (typeof OrderDirection)[keyof typeof OrderDirection];
838
+ export declare const IntervalType: {
856
839
  readonly Minute: 'minute';
857
840
  readonly Hour: 'hour';
858
841
  readonly Day: 'day';
@@ -860,8 +843,8 @@ declare const IntervalType: {
860
843
  readonly Month: 'month';
861
844
  readonly None: 'none';
862
845
  };
863
- type IntervalType = (typeof IntervalType)[keyof typeof IntervalType];
864
- declare const Dimension: {
846
+ export type IntervalType = (typeof IntervalType)[keyof typeof IntervalType];
847
+ export declare const Dimension: {
865
848
  readonly ConnectorKey: 'connectorKey';
866
849
  readonly Success: 'success';
867
850
  readonly ActionType: 'actionType';
@@ -881,7 +864,7 @@ declare const Dimension: {
881
864
  readonly PolicyResult: 'policyResult';
882
865
  readonly RiskLevel: 'riskLevel';
883
866
  };
884
- type Dimension = (typeof Dimension)[keyof typeof Dimension];
867
+ export type Dimension = (typeof Dimension)[keyof typeof Dimension];
885
868
  type AggregateQuery = Partial<Query> & {
886
869
  dimensions?: Dimension[];
887
870
  intervalType?: IntervalType;
@@ -904,7 +887,7 @@ type DimensionsResult = {
904
887
  count: number;
905
888
  }>;
906
889
  };
907
- declare const PlatformDimension: {
890
+ export declare const PlatformDimension: {
908
891
  readonly EventType: 'eventType';
909
892
  readonly Action: 'action';
910
893
  readonly Resource: 'resource';
@@ -920,7 +903,7 @@ declare const PlatformDimension: {
920
903
  readonly TransportType: 'transportType';
921
904
  readonly StreamType: 'streamType';
922
905
  };
923
- type PlatformDimension = (typeof PlatformDimension)[keyof typeof PlatformDimension];
906
+ export type PlatformDimension = (typeof PlatformDimension)[keyof typeof PlatformDimension];
924
907
  type PlatformDimensionsQuery = Partial<PlatformQuery> & {
925
908
  dimensions: PlatformDimension[];
926
909
  maxValues?: number;
@@ -956,7 +939,7 @@ interface KafkaClientConfig {
956
939
  }
957
940
  type KafkaClusterName = 'external' | 'internal';
958
941
  type TopicClusterMap = Record<string, KafkaClusterName[]>;
959
- declare const DEFAULT_TOPIC_CLUSTER_MAP: TopicClusterMap;
942
+ export declare const DEFAULT_TOPIC_CLUSTER_MAP: TopicClusterMap;
960
943
  type KafkaClientBuilder = (config?: KafkaClientConfig, logger?: ILogger) => Promise<Producer<string, string, string, string> | undefined>;
961
944
  interface InternalKafkaClientConfig {
962
945
  bootstrapBrokers: string[];
@@ -1140,18 +1123,12 @@ type PlatformLog = ILog & {
1140
1123
  statusCode?: number;
1141
1124
  details?: Record<string, unknown>;
1142
1125
  };
1143
- //#endregion
1144
- //#region src/logs/clickhouse/parameterHelpers.d.ts
1145
- declare class InvalidAuthPairError extends Error {
1126
+ export declare class InvalidAuthPairError extends Error {
1146
1127
  constructor(message: string);
1147
1128
  }
1148
- //#endregion
1149
- //#region src/logs/logsSink.d.ts
1150
- declare class QueryClientNotConfiguredError extends Error {
1129
+ export declare class QueryClientNotConfiguredError extends Error {
1151
1130
  constructor();
1152
1131
  }
1153
- //#endregion
1154
- //#region src/datasets/types.d.ts
1155
1132
  type LogfireConfig = {
1156
1133
  token?: string;
1157
1134
  baseUrl?: string;
@@ -1163,32 +1140,17 @@ type DatasetsSinkConfig = {
1163
1140
  logfire?: LogfireConfig;
1164
1141
  maxItemSizeBytes?: number;
1165
1142
  };
1166
- //#endregion
1167
- //#region src/olap/sinkConfig.d.ts
1168
1143
  type OlapSinkConfig = {
1169
1144
  advanced?: AdvancedSinkConfig;
1170
1145
  defender?: DefenderSinkConfig;
1171
1146
  policy?: PolicySinkConfig;
1172
1147
  datasets?: DatasetsSinkConfig;
1173
1148
  };
1174
- //#endregion
1175
- //#region src/olap/olapClient.d.ts
1176
- declare class OlapClient implements IOlapClient {
1149
+ export declare class OlapClient implements IOlapClient {
1177
1150
  #private;
1178
1151
  name: string;
1179
1152
  private constructor();
1180
- static create({
1181
- getKafkaClient,
1182
- getInternalKafkaClient,
1183
- storage,
1184
- kafkaClientConfig,
1185
- externalKafkaClientConfig,
1186
- internalKafkaClientConfig,
1187
- topicClusterMap,
1188
- clickhouseConfig,
1189
- sinkConfig,
1190
- logger
1191
- }: {
1153
+ static create({ getKafkaClient, getInternalKafkaClient, storage, kafkaClientConfig, externalKafkaClientConfig, internalKafkaClientConfig, topicClusterMap, clickhouseConfig, sinkConfig, logger }: {
1192
1154
  getKafkaClient?: KafkaClientBuilder;
1193
1155
  getInternalKafkaClient?: InternalKafkaClientBuilder;
1194
1156
  storage?: Storage;
@@ -1242,20 +1204,7 @@ declare class OlapClient implements IOlapClient {
1242
1204
  getSourceUsage(organizationId: string, projectSecureId: string, query: SourceQuery): Promise<SourceResult>;
1243
1205
  getActionsCount(query: ActionsCountQuery): Promise<number>;
1244
1206
  }
1245
- //#endregion
1246
- //#region src/olap/olapClientManager.d.ts
1247
- declare const buildOlapClientInstance: ({
1248
- getKafkaClient,
1249
- getInternalKafkaClient,
1250
- storage,
1251
- kafkaClientConfig,
1252
- externalKafkaClientConfig,
1253
- internalKafkaClientConfig,
1254
- topicClusterMap,
1255
- clickhouseConfig,
1256
- sinkConfig,
1257
- logger
1258
- }: {
1207
+ declare const buildOlapClientInstance: ({ getKafkaClient, getInternalKafkaClient, storage, kafkaClientConfig, externalKafkaClientConfig, internalKafkaClientConfig, topicClusterMap, clickhouseConfig, sinkConfig, logger }: {
1259
1208
  getKafkaClient?: KafkaClientBuilder;
1260
1209
  getInternalKafkaClient?: InternalKafkaClientBuilder;
1261
1210
  storage?: Storage;
@@ -1267,22 +1216,10 @@ declare const buildOlapClientInstance: ({
1267
1216
  sinkConfig?: OlapSinkConfig;
1268
1217
  logger?: ILogger;
1269
1218
  }) => Promise<IOlapClient>;
1270
- declare class OlapClientManager {
1219
+ export declare class OlapClientManager {
1271
1220
  private static olapClientPromise;
1272
1221
  private static closingPromise;
1273
- static getInstance({
1274
- getKafkaClient,
1275
- getInternalKafkaClient,
1276
- storage,
1277
- kafkaClientConfig,
1278
- externalKafkaClientConfig,
1279
- internalKafkaClientConfig,
1280
- topicClusterMap,
1281
- clickhouseConfig,
1282
- sinkConfig,
1283
- logger,
1284
- getOlapClient
1285
- }: {
1222
+ static getInstance({ getKafkaClient, getInternalKafkaClient, storage, kafkaClientConfig, externalKafkaClientConfig, internalKafkaClientConfig, topicClusterMap, clickhouseConfig, sinkConfig, logger, getOlapClient }: {
1286
1223
  getKafkaClient?: KafkaClientBuilder;
1287
1224
  getInternalKafkaClient?: InternalKafkaClientBuilder;
1288
1225
  storage?: Storage;
@@ -1299,10 +1236,8 @@ declare class OlapClientManager {
1299
1236
  static close(timeoutMs?: number): Promise<void>;
1300
1237
  private static drain;
1301
1238
  }
1302
- //#endregion
1303
- //#region src/policy/policySink.d.ts
1304
- declare function getPolicySink(storage?: Storage, config?: PolicySinkConfig, logger?: ILogger): IPolicySink;
1305
- declare class PolicySink implements IPolicySink {
1239
+ export declare function getPolicySink(storage?: Storage, config?: PolicySinkConfig, logger?: ILogger): IPolicySink;
1240
+ export declare class PolicySink implements IPolicySink {
1306
1241
  #private;
1307
1242
  constructor(storage?: Storage, config?: PolicySinkConfig, logger?: ILogger);
1308
1243
  initialize(): Promise<void>;
@@ -1318,8 +1253,5 @@ declare class PolicySink implements IPolicySink {
1318
1253
  getAction(organizationId: string, projectSecureId: string, accountSecureId: string, actionRunId: string): Promise<PolicyLog | undefined>;
1319
1254
  private send;
1320
1255
  }
1321
- //#endregion
1322
- //#region src/utils/stepErrors.d.ts
1323
- declare const hasErrorEntries: (errors: unknown) => boolean;
1324
- //#endregion
1325
- export { type ActionAdvancedLog, type ActionInput, type ActionLog, type ActionResult, type ActionsCountQuery, type ActionsQuery, type ActionsQueryResult, type AdvancedLogMetadata, type AdvancedOptions, type AdvancedPiiScrubber, type AdvancedSinkConfig, type AggregateQuery, type AggregateResult, type AuthPair, 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 FaultedPolicySet, type FieldLabelProvenance, type ILog, type IOlapClient, type IPolicySink, type InternalKafkaClientBuilder, type InternalKafkaClientConfig, IntervalType, type IntervalType as IntervalTypeValues, InvalidAuthPairError, InvalidLogQueryConditionsError, type KafkaClientBuilder, type KafkaClientConfig, type KafkaClusterName, LOG_QUERY_FIELDS, LOG_QUERY_OPERATORS, type LogEntities, type LogQueryCondition, type LogQueryField, type LogQueryOperator, 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, QueryClientNotConfiguredError, 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 UnenforcedRedaction, type UnifiedAdvancedLog, type UnifiedInput, type UnifiedLog, type UnifiedQuery, type UnifiedQueryResult, type UnifiedResult, type WithheldReason, callerHeadersOf, getPolicySink, hasErrorEntries, parseLogQueryConditions };
1256
+ export declare const hasErrorEntries: (errors: unknown) => boolean;
1257
+ export type { ActionAdvancedLog, ActionInput, ActionLog, ActionResult, ActionsCountQuery, ActionsQuery, ActionsQueryResult, AdvancedLogMetadata, AdvancedOptions, AdvancedPiiScrubber, AdvancedSinkConfig, AggregateQuery, AggregateResult, AuthPair, AuthType as AuthTypeValue, ClickHouseConfig, CombinedLogType, DatasetsOptions, DatasetsSinkConfig, DefenderContext, DefenderLog, DefenderOptions, DefenderSinkConfig, Dimension as DimensionValues, DimensionsQuery, DimensionsResult, FaultedPolicySet, FieldLabelProvenance, ILog, IOlapClient, IPolicySink, InternalKafkaClientBuilder, InternalKafkaClientConfig, IntervalType as IntervalTypeValues, KafkaClientBuilder, KafkaClientConfig, KafkaClusterName, LogEntities, LogQueryCondition, LogQueryField, LogQueryOperator, LogType as LogTypeValues, LogfireConfig, LogsOptions, OlapOptions, OlapSinkConfig, OrderBy as OrderByValues, OrderDirection as OrderDirectionValues, PlatformAdvancedLog, PlatformDimension as PlatformDimensionValues, PlatformDimensionsQuery, PlatformInput, PlatformLog, PlatformQuery, PlatformQueryResult, PlatformResult, PolicyContext, PolicyLog, PolicyObservation, PolicyOptions, PolicyRecord, PolicyResult, PolicySinkConfig, ProviderAdvancedLog, ProviderInput, ProviderLog, ProviderQuery, ProviderQueryResult, ProviderResult, Query, QueryResult, SASLMechanism, Source, SourceQuery, SourceResult, SourceType as SourceTypeValue, StepAdvancedLog, StepInput, StepLog, StepResult, StepsQuery, StepsQueryResult, StreamType as StreamTypeValue, TopicClusterMap, TransportType as TransportTypeValue, TruncationMode, UnenforcedCause, UnenforcedRedaction, UnifiedAdvancedLog, UnifiedInput, UnifiedLog, UnifiedQuery, UnifiedQueryResult, UnifiedResult, WithheldReason };