@stackone/core 2.39.1 → 2.40.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
@@ -1102,6 +1102,42 @@ type DefenderOptions = {
1102
1102
  enabled?: boolean;
1103
1103
  };
1104
1104
  //#endregion
1105
+ //#region ../olap/src/advanced/types.d.ts
1106
+ type ActionAdvancedLog = {
1107
+ data: {
1108
+ [key: string]: unknown;
1109
+ };
1110
+ metadata?: {
1111
+ isBackgroundLog?: boolean;
1112
+ expirationTime?: number;
1113
+ };
1114
+ };
1115
+ type StepAdvancedLog = {
1116
+ data: {
1117
+ [key: string]: unknown;
1118
+ };
1119
+ metadata?: {
1120
+ expirationTime?: number;
1121
+ };
1122
+ };
1123
+ type UnifiedAdvancedLog = {
1124
+ data: {
1125
+ [key: string]: unknown;
1126
+ };
1127
+ metadata?: {
1128
+ isBackgroundLog?: boolean;
1129
+ expirationTime?: number;
1130
+ };
1131
+ };
1132
+ type ProviderAdvancedLog = {
1133
+ data: {
1134
+ [key: string]: unknown;
1135
+ };
1136
+ metadata?: {
1137
+ expirationTime?: number;
1138
+ };
1139
+ };
1140
+ //#endregion
1105
1141
  //#region ../olap/src/defender/types.d.ts
1106
1142
  type DefenderLog = {
1107
1143
  riskLevel: string;
@@ -1109,7 +1145,176 @@ type DefenderLog = {
1109
1145
  [key: string]: unknown;
1110
1146
  };
1111
1147
  //#endregion
1148
+ //#region ../olap/src/types.d.ts
1149
+ interface IOlapClient {
1150
+ recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
1151
+ recordActions(actions: Array<{
1152
+ input: ActionInput;
1153
+ result: ActionResult;
1154
+ }>, options?: OlapOptions): Promise<void>;
1155
+ recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
1156
+ recordSteps(steps: Array<{
1157
+ input: StepInput;
1158
+ result: StepResult;
1159
+ }>, options?: OlapOptions): Promise<void>;
1160
+ recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
1161
+ recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
1162
+ getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
1163
+ getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
1164
+ getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
1165
+ getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
1166
+ getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
1167
+ getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
1168
+ getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
1169
+ getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
1170
+ getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
1171
+ getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
1172
+ getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
1173
+ getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
1174
+ getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
1175
+ getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
1176
+ getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
1177
+ getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
1178
+ }
1179
+ type DefenderContext = {
1180
+ riskLevel: string;
1181
+ tier2Score: number;
1182
+ [key: string]: unknown;
1183
+ };
1184
+ type ActionInput = {
1185
+ actionId?: string;
1186
+ mode?: string;
1187
+ url?: string;
1188
+ pathParams?: unknown;
1189
+ queryParams?: unknown;
1190
+ body?: unknown;
1191
+ headers?: Record<string, string>;
1192
+ sourceId?: string;
1193
+ sourceType?: string;
1194
+ sourceValue?: string;
1195
+ isBackground?: boolean;
1196
+ startTime?: Date;
1197
+ };
1198
+ type ActionResult = {
1199
+ actionRunId: string;
1200
+ actionId: string;
1201
+ connectorKey: string;
1202
+ connectorVersion: string;
1203
+ actionType: string;
1204
+ category?: string;
1205
+ organizationId: string;
1206
+ projectSecureId: string;
1207
+ accountSecureId: string;
1208
+ originOwnerId?: string;
1209
+ originOwnerName?: string;
1210
+ httpMethod?: string;
1211
+ url?: string;
1212
+ path?: string;
1213
+ resource?: string;
1214
+ subResource?: string;
1215
+ childResource?: string;
1216
+ success?: boolean;
1217
+ statusCode?: number;
1218
+ message?: string;
1219
+ headers?: Record<string, string>;
1220
+ body?: unknown;
1221
+ defenderContext?: DefenderContext;
1222
+ endTime?: Date;
1223
+ };
1224
+ type StepInput = {
1225
+ actionRunId: string;
1226
+ stepIndex: number;
1227
+ stepId: string;
1228
+ organizationId: string;
1229
+ projectSecureId: string;
1230
+ accountSecureId: string;
1231
+ inputs?: {
1232
+ [key: string]: unknown;
1233
+ };
1234
+ };
1235
+ type StepResult = {
1236
+ success?: boolean;
1237
+ message?: string;
1238
+ outputs?: unknown;
1239
+ errors?: unknown;
1240
+ skipped?: boolean;
1241
+ startTime?: Date;
1242
+ endTime?: Date;
1243
+ };
1244
+ type UnifiedInput = {
1245
+ requestId: string;
1246
+ organizationId: string;
1247
+ projectSecureId: string;
1248
+ accountSecureId: string;
1249
+ originOwnerId?: string;
1250
+ originOwnerName?: string;
1251
+ connectorKey: string;
1252
+ action?: string;
1253
+ service?: string;
1254
+ mode?: string;
1255
+ httpMethod?: string;
1256
+ url?: string;
1257
+ path?: string;
1258
+ queryParams?: unknown;
1259
+ body?: unknown;
1260
+ headers?: Record<string, string>;
1261
+ resource?: string;
1262
+ subResource?: string;
1263
+ childResource?: string;
1264
+ sourceId?: string;
1265
+ sourceType?: string;
1266
+ sourceValue?: string;
1267
+ isBackground?: boolean;
1268
+ startTime?: Date;
1269
+ };
1270
+ type UnifiedResult = {
1271
+ success?: boolean;
1272
+ statusCode?: number;
1273
+ message?: string;
1274
+ headers?: Record<string, string>;
1275
+ body?: unknown;
1276
+ endTime?: Date;
1277
+ };
1278
+ type ProviderInput = {
1279
+ requestId: string;
1280
+ id: string;
1281
+ organizationId: string;
1282
+ projectSecureId: string;
1283
+ accountSecureId: string;
1284
+ originOwnerId?: string;
1285
+ originOwnerName?: string;
1286
+ connectorKey: string;
1287
+ action: string;
1288
+ service: string;
1289
+ mode: string;
1290
+ httpMethod: string;
1291
+ url: string;
1292
+ path?: string;
1293
+ queryParams?: unknown;
1294
+ headers?: Record<string, string>;
1295
+ body?: unknown;
1296
+ resource?: string;
1297
+ subResource?: string;
1298
+ childResource?: string;
1299
+ startTime?: Date;
1300
+ };
1301
+ type ProviderResult = {
1302
+ success?: boolean;
1303
+ statusCode?: number;
1304
+ headers?: Record<string, string>;
1305
+ body?: unknown;
1306
+ errors?: unknown;
1307
+ endTime?: Date;
1308
+ };
1309
+ //#endregion
1112
1310
  //#region ../olap/src/logs/types.d.ts
1311
+ declare const LogType: {
1312
+ readonly Action: "action";
1313
+ readonly Step: "step";
1314
+ readonly Unified: "unified";
1315
+ readonly Provider: "provider";
1316
+ };
1317
+ type LogType = (typeof LogType)[keyof typeof LogType];
1113
1318
  type Query = {
1114
1319
  organizationId?: string | string[];
1115
1320
  projectSecureId?: string | string[];
@@ -1119,7 +1324,20 @@ type Query = {
1119
1324
  connectorKey?: string | string[];
1120
1325
  mode?: string | string[];
1121
1326
  category?: string | string[];
1122
- logType?: ('action' | 'unified') | ('action' | 'unified')[];
1327
+ requestId?: string | string[];
1328
+ provider?: string | string[];
1329
+ service?: string | string[];
1330
+ resource?: string | string[];
1331
+ subResource?: string | string[];
1332
+ childResource?: string | string[];
1333
+ action?: string | string[];
1334
+ statusCode?: string | string[];
1335
+ sourceId?: string | string[];
1336
+ sourceType?: string | string[];
1337
+ sourceValue?: string | string[];
1338
+ originOwnerId?: string | string[];
1339
+ httpMethod?: string | string[];
1340
+ logType?: (typeof LogType.Action | typeof LogType.Unified) | (typeof LogType.Action | typeof LogType.Unified)[];
1123
1341
  success?: boolean;
1124
1342
  startTime?: Date;
1125
1343
  endTime?: Date;
@@ -1212,8 +1430,47 @@ type ProviderQueryResult = {
1212
1430
  pageNumber: number;
1213
1431
  pageSize: number;
1214
1432
  };
1433
+ type IntervalType = 'minute' | 'hour' | 'day' | 'week' | 'month';
1434
+ declare const Dimension: {
1435
+ readonly ConnectorKey: "connector_key";
1436
+ readonly Success: "success";
1437
+ readonly ActionType: "action_type";
1438
+ readonly Mode: "mode";
1439
+ readonly Service: "service";
1440
+ readonly Resource: "resource";
1441
+ readonly ActionId: "action_id";
1442
+ readonly HttpMethod: "http_method";
1443
+ readonly AccountSecureId: "account_secure_id";
1444
+ readonly SourceType: "source_type";
1445
+ readonly StatusCode: "status_code";
1446
+ readonly OriginOwnerId: "origin_owner_id";
1447
+ readonly SourceId: "source_id";
1448
+ };
1449
+ type Dimension = (typeof Dimension)[keyof typeof Dimension];
1450
+ type AggregateQuery = Partial<Query> & {
1451
+ dimensions?: Dimension[];
1452
+ intervalType?: IntervalType;
1453
+ intervalPeriod?: number;
1454
+ };
1455
+ type AggregateResult = {
1456
+ data: Array<{
1457
+ start_time?: string;
1458
+ count: number;
1459
+ [dimension: string]: string | number | boolean | undefined;
1460
+ }>;
1461
+ };
1462
+ type DimensionsQuery = Partial<Query> & {
1463
+ dimensions: Dimension[];
1464
+ maxValues?: number;
1465
+ };
1466
+ type DimensionsResult = {
1467
+ [dimension: string]: Array<{
1468
+ value: string;
1469
+ count: number;
1470
+ }>;
1471
+ };
1215
1472
  interface ILog {
1216
- logType: 'action' | 'step' | 'unified' | 'provider';
1473
+ logType: LogType;
1217
1474
  eventTime: Date;
1218
1475
  startTime: Date;
1219
1476
  endTime?: Date;
@@ -1223,7 +1480,7 @@ interface ILog {
1223
1480
  accountSecureId?: string;
1224
1481
  }
1225
1482
  type ActionLog = ILog & {
1226
- logType: 'action';
1483
+ logType: typeof LogType.Action;
1227
1484
  actionRunId: string;
1228
1485
  actionId: string;
1229
1486
  connectorKey: string;
@@ -1248,7 +1505,7 @@ type ActionLog = ILog & {
1248
1505
  tier2Score?: number;
1249
1506
  };
1250
1507
  type StepLog = ILog & {
1251
- logType: 'step';
1508
+ logType: typeof LogType.Step;
1252
1509
  actionRunId: string;
1253
1510
  stepIndex: number;
1254
1511
  stepId: string;
@@ -1260,7 +1517,7 @@ type StepLog = ILog & {
1260
1517
  message?: string;
1261
1518
  };
1262
1519
  type UnifiedLog = ILog & {
1263
- logType: 'unified';
1520
+ logType: typeof LogType.Unified;
1264
1521
  requestId: string;
1265
1522
  organizationId: string;
1266
1523
  projectSecureId: string;
@@ -1290,7 +1547,7 @@ type UnifiedLog = ILog & {
1290
1547
  duration?: number;
1291
1548
  };
1292
1549
  type ProviderLog = ILog & {
1293
- logType: 'provider';
1550
+ logType: typeof LogType.Provider;
1294
1551
  requestId: string;
1295
1552
  id?: string;
1296
1553
  organizationId: string;
@@ -1317,202 +1574,6 @@ type ProviderLog = ILog & {
1317
1574
  duration?: number;
1318
1575
  };
1319
1576
  //#endregion
1320
- //#region ../olap/src/types.d.ts
1321
- interface IOlapClient {
1322
- recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
1323
- recordActions(actions: Array<{
1324
- input: ActionInput;
1325
- result: ActionResult;
1326
- }>, options?: OlapOptions): Promise<void>;
1327
- recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
1328
- recordSteps(steps: Array<{
1329
- input: StepInput;
1330
- result: StepResult;
1331
- }>, options?: OlapOptions): Promise<void>;
1332
- recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
1333
- recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
1334
- getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
1335
- getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
1336
- getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
1337
- getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
1338
- getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
1339
- getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
1340
- getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
1341
- getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
1342
- getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
1343
- getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
1344
- getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
1345
- getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
1346
- getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
1347
- getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
1348
- }
1349
- type DefenderContext = {
1350
- riskLevel: string;
1351
- tier2Score: number;
1352
- [key: string]: unknown;
1353
- };
1354
- type ActionInput = {
1355
- actionId?: string;
1356
- mode?: string;
1357
- url?: string;
1358
- pathParams?: unknown;
1359
- queryParams?: unknown;
1360
- body?: unknown;
1361
- headers?: Record<string, string>;
1362
- sourceId?: string;
1363
- sourceType?: string;
1364
- sourceValue?: string;
1365
- isBackground?: boolean;
1366
- startTime?: Date;
1367
- };
1368
- type ActionResult = {
1369
- actionRunId: string;
1370
- actionId: string;
1371
- connectorKey: string;
1372
- connectorVersion: string;
1373
- actionType: string;
1374
- category?: string;
1375
- organizationId: string;
1376
- projectSecureId: string;
1377
- accountSecureId: string;
1378
- originOwnerId?: string;
1379
- originOwnerName?: string;
1380
- httpMethod?: string;
1381
- url?: string;
1382
- path?: string;
1383
- resource?: string;
1384
- subResource?: string;
1385
- childResource?: string;
1386
- success?: boolean;
1387
- statusCode?: number;
1388
- message?: string;
1389
- headers?: Record<string, string>;
1390
- body?: unknown;
1391
- defenderContext?: DefenderContext;
1392
- endTime?: Date;
1393
- };
1394
- type StepInput = {
1395
- actionRunId: string;
1396
- stepIndex: number;
1397
- stepId: string;
1398
- organizationId: string;
1399
- projectSecureId: string;
1400
- accountSecureId: string;
1401
- inputs?: {
1402
- [key: string]: unknown;
1403
- };
1404
- };
1405
- type StepResult = {
1406
- success?: boolean;
1407
- message?: string;
1408
- outputs?: unknown;
1409
- errors?: unknown;
1410
- skipped?: boolean;
1411
- startTime?: Date;
1412
- endTime?: Date;
1413
- };
1414
- type UnifiedInput = {
1415
- requestId: string;
1416
- organizationId: string;
1417
- projectSecureId: string;
1418
- accountSecureId: string;
1419
- originOwnerId?: string;
1420
- originOwnerName?: string;
1421
- connectorKey: string;
1422
- action?: string;
1423
- service?: string;
1424
- mode?: string;
1425
- httpMethod?: string;
1426
- url?: string;
1427
- path?: string;
1428
- queryParams?: unknown;
1429
- body?: unknown;
1430
- headers?: Record<string, string>;
1431
- resource?: string;
1432
- subResource?: string;
1433
- childResource?: string;
1434
- sourceId?: string;
1435
- sourceType?: string;
1436
- sourceValue?: string;
1437
- isBackground?: boolean;
1438
- startTime?: Date;
1439
- };
1440
- type UnifiedResult = {
1441
- success?: boolean;
1442
- statusCode?: number;
1443
- message?: string;
1444
- headers?: Record<string, string>;
1445
- body?: unknown;
1446
- endTime?: Date;
1447
- };
1448
- type ProviderInput = {
1449
- requestId: string;
1450
- id: string;
1451
- organizationId: string;
1452
- projectSecureId: string;
1453
- accountSecureId: string;
1454
- originOwnerId?: string;
1455
- originOwnerName?: string;
1456
- connectorKey: string;
1457
- action: string;
1458
- service: string;
1459
- mode: string;
1460
- httpMethod: string;
1461
- url: string;
1462
- path?: string;
1463
- queryParams?: unknown;
1464
- headers?: Record<string, string>;
1465
- body?: unknown;
1466
- resource?: string;
1467
- subResource?: string;
1468
- childResource?: string;
1469
- startTime?: Date;
1470
- };
1471
- type ProviderResult = {
1472
- success?: boolean;
1473
- statusCode?: number;
1474
- headers?: Record<string, string>;
1475
- body?: unknown;
1476
- errors?: unknown;
1477
- endTime?: Date;
1478
- };
1479
- //#endregion
1480
- //#region ../olap/src/advanced/types.d.ts
1481
- type ActionAdvancedLog = {
1482
- data: {
1483
- [key: string]: unknown;
1484
- };
1485
- metadata?: {
1486
- isBackgroundLog?: boolean;
1487
- expirationTime?: number;
1488
- };
1489
- };
1490
- type StepAdvancedLog = {
1491
- data: {
1492
- [key: string]: unknown;
1493
- };
1494
- metadata?: {
1495
- expirationTime?: number;
1496
- };
1497
- };
1498
- type UnifiedAdvancedLog = {
1499
- data: {
1500
- [key: string]: unknown;
1501
- };
1502
- metadata?: {
1503
- isBackgroundLog?: boolean;
1504
- expirationTime?: number;
1505
- };
1506
- };
1507
- type ProviderAdvancedLog = {
1508
- data: {
1509
- [key: string]: unknown;
1510
- };
1511
- metadata?: {
1512
- expirationTime?: number;
1513
- };
1514
- };
1515
- //#endregion
1516
1577
  //#region src/cursor/types.d.ts
1517
1578
  type Position = {
1518
1579
  pageNumber?: number | null;
package/dist/index.d.mts CHANGED
@@ -1101,6 +1101,42 @@ type DefenderOptions = {
1101
1101
  enabled?: boolean;
1102
1102
  };
1103
1103
  //#endregion
1104
+ //#region ../olap/src/advanced/types.d.ts
1105
+ type ActionAdvancedLog = {
1106
+ data: {
1107
+ [key: string]: unknown;
1108
+ };
1109
+ metadata?: {
1110
+ isBackgroundLog?: boolean;
1111
+ expirationTime?: number;
1112
+ };
1113
+ };
1114
+ type StepAdvancedLog = {
1115
+ data: {
1116
+ [key: string]: unknown;
1117
+ };
1118
+ metadata?: {
1119
+ expirationTime?: number;
1120
+ };
1121
+ };
1122
+ type UnifiedAdvancedLog = {
1123
+ data: {
1124
+ [key: string]: unknown;
1125
+ };
1126
+ metadata?: {
1127
+ isBackgroundLog?: boolean;
1128
+ expirationTime?: number;
1129
+ };
1130
+ };
1131
+ type ProviderAdvancedLog = {
1132
+ data: {
1133
+ [key: string]: unknown;
1134
+ };
1135
+ metadata?: {
1136
+ expirationTime?: number;
1137
+ };
1138
+ };
1139
+ //#endregion
1104
1140
  //#region ../olap/src/defender/types.d.ts
1105
1141
  type DefenderLog = {
1106
1142
  riskLevel: string;
@@ -1108,7 +1144,176 @@ type DefenderLog = {
1108
1144
  [key: string]: unknown;
1109
1145
  };
1110
1146
  //#endregion
1147
+ //#region ../olap/src/types.d.ts
1148
+ interface IOlapClient {
1149
+ recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
1150
+ recordActions(actions: Array<{
1151
+ input: ActionInput;
1152
+ result: ActionResult;
1153
+ }>, options?: OlapOptions): Promise<void>;
1154
+ recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
1155
+ recordSteps(steps: Array<{
1156
+ input: StepInput;
1157
+ result: StepResult;
1158
+ }>, options?: OlapOptions): Promise<void>;
1159
+ recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
1160
+ recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
1161
+ getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
1162
+ getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
1163
+ getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
1164
+ getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
1165
+ getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
1166
+ getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
1167
+ getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
1168
+ getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
1169
+ getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
1170
+ getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
1171
+ getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
1172
+ getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
1173
+ getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
1174
+ getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
1175
+ getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
1176
+ getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
1177
+ }
1178
+ type DefenderContext = {
1179
+ riskLevel: string;
1180
+ tier2Score: number;
1181
+ [key: string]: unknown;
1182
+ };
1183
+ type ActionInput = {
1184
+ actionId?: string;
1185
+ mode?: string;
1186
+ url?: string;
1187
+ pathParams?: unknown;
1188
+ queryParams?: unknown;
1189
+ body?: unknown;
1190
+ headers?: Record<string, string>;
1191
+ sourceId?: string;
1192
+ sourceType?: string;
1193
+ sourceValue?: string;
1194
+ isBackground?: boolean;
1195
+ startTime?: Date;
1196
+ };
1197
+ type ActionResult = {
1198
+ actionRunId: string;
1199
+ actionId: string;
1200
+ connectorKey: string;
1201
+ connectorVersion: string;
1202
+ actionType: string;
1203
+ category?: string;
1204
+ organizationId: string;
1205
+ projectSecureId: string;
1206
+ accountSecureId: string;
1207
+ originOwnerId?: string;
1208
+ originOwnerName?: string;
1209
+ httpMethod?: string;
1210
+ url?: string;
1211
+ path?: string;
1212
+ resource?: string;
1213
+ subResource?: string;
1214
+ childResource?: string;
1215
+ success?: boolean;
1216
+ statusCode?: number;
1217
+ message?: string;
1218
+ headers?: Record<string, string>;
1219
+ body?: unknown;
1220
+ defenderContext?: DefenderContext;
1221
+ endTime?: Date;
1222
+ };
1223
+ type StepInput = {
1224
+ actionRunId: string;
1225
+ stepIndex: number;
1226
+ stepId: string;
1227
+ organizationId: string;
1228
+ projectSecureId: string;
1229
+ accountSecureId: string;
1230
+ inputs?: {
1231
+ [key: string]: unknown;
1232
+ };
1233
+ };
1234
+ type StepResult = {
1235
+ success?: boolean;
1236
+ message?: string;
1237
+ outputs?: unknown;
1238
+ errors?: unknown;
1239
+ skipped?: boolean;
1240
+ startTime?: Date;
1241
+ endTime?: Date;
1242
+ };
1243
+ type UnifiedInput = {
1244
+ requestId: string;
1245
+ organizationId: string;
1246
+ projectSecureId: string;
1247
+ accountSecureId: string;
1248
+ originOwnerId?: string;
1249
+ originOwnerName?: string;
1250
+ connectorKey: string;
1251
+ action?: string;
1252
+ service?: string;
1253
+ mode?: string;
1254
+ httpMethod?: string;
1255
+ url?: string;
1256
+ path?: string;
1257
+ queryParams?: unknown;
1258
+ body?: unknown;
1259
+ headers?: Record<string, string>;
1260
+ resource?: string;
1261
+ subResource?: string;
1262
+ childResource?: string;
1263
+ sourceId?: string;
1264
+ sourceType?: string;
1265
+ sourceValue?: string;
1266
+ isBackground?: boolean;
1267
+ startTime?: Date;
1268
+ };
1269
+ type UnifiedResult = {
1270
+ success?: boolean;
1271
+ statusCode?: number;
1272
+ message?: string;
1273
+ headers?: Record<string, string>;
1274
+ body?: unknown;
1275
+ endTime?: Date;
1276
+ };
1277
+ type ProviderInput = {
1278
+ requestId: string;
1279
+ id: string;
1280
+ organizationId: string;
1281
+ projectSecureId: string;
1282
+ accountSecureId: string;
1283
+ originOwnerId?: string;
1284
+ originOwnerName?: string;
1285
+ connectorKey: string;
1286
+ action: string;
1287
+ service: string;
1288
+ mode: string;
1289
+ httpMethod: string;
1290
+ url: string;
1291
+ path?: string;
1292
+ queryParams?: unknown;
1293
+ headers?: Record<string, string>;
1294
+ body?: unknown;
1295
+ resource?: string;
1296
+ subResource?: string;
1297
+ childResource?: string;
1298
+ startTime?: Date;
1299
+ };
1300
+ type ProviderResult = {
1301
+ success?: boolean;
1302
+ statusCode?: number;
1303
+ headers?: Record<string, string>;
1304
+ body?: unknown;
1305
+ errors?: unknown;
1306
+ endTime?: Date;
1307
+ };
1308
+ //#endregion
1111
1309
  //#region ../olap/src/logs/types.d.ts
1310
+ declare const LogType: {
1311
+ readonly Action: "action";
1312
+ readonly Step: "step";
1313
+ readonly Unified: "unified";
1314
+ readonly Provider: "provider";
1315
+ };
1316
+ type LogType = (typeof LogType)[keyof typeof LogType];
1112
1317
  type Query = {
1113
1318
  organizationId?: string | string[];
1114
1319
  projectSecureId?: string | string[];
@@ -1118,7 +1323,20 @@ type Query = {
1118
1323
  connectorKey?: string | string[];
1119
1324
  mode?: string | string[];
1120
1325
  category?: string | string[];
1121
- logType?: ('action' | 'unified') | ('action' | 'unified')[];
1326
+ requestId?: string | string[];
1327
+ provider?: string | string[];
1328
+ service?: string | string[];
1329
+ resource?: string | string[];
1330
+ subResource?: string | string[];
1331
+ childResource?: string | string[];
1332
+ action?: string | string[];
1333
+ statusCode?: string | string[];
1334
+ sourceId?: string | string[];
1335
+ sourceType?: string | string[];
1336
+ sourceValue?: string | string[];
1337
+ originOwnerId?: string | string[];
1338
+ httpMethod?: string | string[];
1339
+ logType?: (typeof LogType.Action | typeof LogType.Unified) | (typeof LogType.Action | typeof LogType.Unified)[];
1122
1340
  success?: boolean;
1123
1341
  startTime?: Date;
1124
1342
  endTime?: Date;
@@ -1211,8 +1429,47 @@ type ProviderQueryResult = {
1211
1429
  pageNumber: number;
1212
1430
  pageSize: number;
1213
1431
  };
1432
+ type IntervalType = 'minute' | 'hour' | 'day' | 'week' | 'month';
1433
+ declare const Dimension: {
1434
+ readonly ConnectorKey: "connector_key";
1435
+ readonly Success: "success";
1436
+ readonly ActionType: "action_type";
1437
+ readonly Mode: "mode";
1438
+ readonly Service: "service";
1439
+ readonly Resource: "resource";
1440
+ readonly ActionId: "action_id";
1441
+ readonly HttpMethod: "http_method";
1442
+ readonly AccountSecureId: "account_secure_id";
1443
+ readonly SourceType: "source_type";
1444
+ readonly StatusCode: "status_code";
1445
+ readonly OriginOwnerId: "origin_owner_id";
1446
+ readonly SourceId: "source_id";
1447
+ };
1448
+ type Dimension = (typeof Dimension)[keyof typeof Dimension];
1449
+ type AggregateQuery = Partial<Query> & {
1450
+ dimensions?: Dimension[];
1451
+ intervalType?: IntervalType;
1452
+ intervalPeriod?: number;
1453
+ };
1454
+ type AggregateResult = {
1455
+ data: Array<{
1456
+ start_time?: string;
1457
+ count: number;
1458
+ [dimension: string]: string | number | boolean | undefined;
1459
+ }>;
1460
+ };
1461
+ type DimensionsQuery = Partial<Query> & {
1462
+ dimensions: Dimension[];
1463
+ maxValues?: number;
1464
+ };
1465
+ type DimensionsResult = {
1466
+ [dimension: string]: Array<{
1467
+ value: string;
1468
+ count: number;
1469
+ }>;
1470
+ };
1214
1471
  interface ILog {
1215
- logType: 'action' | 'step' | 'unified' | 'provider';
1472
+ logType: LogType;
1216
1473
  eventTime: Date;
1217
1474
  startTime: Date;
1218
1475
  endTime?: Date;
@@ -1222,7 +1479,7 @@ interface ILog {
1222
1479
  accountSecureId?: string;
1223
1480
  }
1224
1481
  type ActionLog = ILog & {
1225
- logType: 'action';
1482
+ logType: typeof LogType.Action;
1226
1483
  actionRunId: string;
1227
1484
  actionId: string;
1228
1485
  connectorKey: string;
@@ -1247,7 +1504,7 @@ type ActionLog = ILog & {
1247
1504
  tier2Score?: number;
1248
1505
  };
1249
1506
  type StepLog = ILog & {
1250
- logType: 'step';
1507
+ logType: typeof LogType.Step;
1251
1508
  actionRunId: string;
1252
1509
  stepIndex: number;
1253
1510
  stepId: string;
@@ -1259,7 +1516,7 @@ type StepLog = ILog & {
1259
1516
  message?: string;
1260
1517
  };
1261
1518
  type UnifiedLog = ILog & {
1262
- logType: 'unified';
1519
+ logType: typeof LogType.Unified;
1263
1520
  requestId: string;
1264
1521
  organizationId: string;
1265
1522
  projectSecureId: string;
@@ -1289,7 +1546,7 @@ type UnifiedLog = ILog & {
1289
1546
  duration?: number;
1290
1547
  };
1291
1548
  type ProviderLog = ILog & {
1292
- logType: 'provider';
1549
+ logType: typeof LogType.Provider;
1293
1550
  requestId: string;
1294
1551
  id?: string;
1295
1552
  organizationId: string;
@@ -1316,202 +1573,6 @@ type ProviderLog = ILog & {
1316
1573
  duration?: number;
1317
1574
  };
1318
1575
  //#endregion
1319
- //#region ../olap/src/types.d.ts
1320
- interface IOlapClient {
1321
- recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
1322
- recordActions(actions: Array<{
1323
- input: ActionInput;
1324
- result: ActionResult;
1325
- }>, options?: OlapOptions): Promise<void>;
1326
- recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
1327
- recordSteps(steps: Array<{
1328
- input: StepInput;
1329
- result: StepResult;
1330
- }>, options?: OlapOptions): Promise<void>;
1331
- recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
1332
- recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
1333
- getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
1334
- getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
1335
- getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
1336
- getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
1337
- getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
1338
- getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
1339
- getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
1340
- getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
1341
- getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
1342
- getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
1343
- getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
1344
- getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
1345
- getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
1346
- getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
1347
- }
1348
- type DefenderContext = {
1349
- riskLevel: string;
1350
- tier2Score: number;
1351
- [key: string]: unknown;
1352
- };
1353
- type ActionInput = {
1354
- actionId?: string;
1355
- mode?: string;
1356
- url?: string;
1357
- pathParams?: unknown;
1358
- queryParams?: unknown;
1359
- body?: unknown;
1360
- headers?: Record<string, string>;
1361
- sourceId?: string;
1362
- sourceType?: string;
1363
- sourceValue?: string;
1364
- isBackground?: boolean;
1365
- startTime?: Date;
1366
- };
1367
- type ActionResult = {
1368
- actionRunId: string;
1369
- actionId: string;
1370
- connectorKey: string;
1371
- connectorVersion: string;
1372
- actionType: string;
1373
- category?: string;
1374
- organizationId: string;
1375
- projectSecureId: string;
1376
- accountSecureId: string;
1377
- originOwnerId?: string;
1378
- originOwnerName?: string;
1379
- httpMethod?: string;
1380
- url?: string;
1381
- path?: string;
1382
- resource?: string;
1383
- subResource?: string;
1384
- childResource?: string;
1385
- success?: boolean;
1386
- statusCode?: number;
1387
- message?: string;
1388
- headers?: Record<string, string>;
1389
- body?: unknown;
1390
- defenderContext?: DefenderContext;
1391
- endTime?: Date;
1392
- };
1393
- type StepInput = {
1394
- actionRunId: string;
1395
- stepIndex: number;
1396
- stepId: string;
1397
- organizationId: string;
1398
- projectSecureId: string;
1399
- accountSecureId: string;
1400
- inputs?: {
1401
- [key: string]: unknown;
1402
- };
1403
- };
1404
- type StepResult = {
1405
- success?: boolean;
1406
- message?: string;
1407
- outputs?: unknown;
1408
- errors?: unknown;
1409
- skipped?: boolean;
1410
- startTime?: Date;
1411
- endTime?: Date;
1412
- };
1413
- type UnifiedInput = {
1414
- requestId: string;
1415
- organizationId: string;
1416
- projectSecureId: string;
1417
- accountSecureId: string;
1418
- originOwnerId?: string;
1419
- originOwnerName?: string;
1420
- connectorKey: string;
1421
- action?: string;
1422
- service?: string;
1423
- mode?: string;
1424
- httpMethod?: string;
1425
- url?: string;
1426
- path?: string;
1427
- queryParams?: unknown;
1428
- body?: unknown;
1429
- headers?: Record<string, string>;
1430
- resource?: string;
1431
- subResource?: string;
1432
- childResource?: string;
1433
- sourceId?: string;
1434
- sourceType?: string;
1435
- sourceValue?: string;
1436
- isBackground?: boolean;
1437
- startTime?: Date;
1438
- };
1439
- type UnifiedResult = {
1440
- success?: boolean;
1441
- statusCode?: number;
1442
- message?: string;
1443
- headers?: Record<string, string>;
1444
- body?: unknown;
1445
- endTime?: Date;
1446
- };
1447
- type ProviderInput = {
1448
- requestId: string;
1449
- id: string;
1450
- organizationId: string;
1451
- projectSecureId: string;
1452
- accountSecureId: string;
1453
- originOwnerId?: string;
1454
- originOwnerName?: string;
1455
- connectorKey: string;
1456
- action: string;
1457
- service: string;
1458
- mode: string;
1459
- httpMethod: string;
1460
- url: string;
1461
- path?: string;
1462
- queryParams?: unknown;
1463
- headers?: Record<string, string>;
1464
- body?: unknown;
1465
- resource?: string;
1466
- subResource?: string;
1467
- childResource?: string;
1468
- startTime?: Date;
1469
- };
1470
- type ProviderResult = {
1471
- success?: boolean;
1472
- statusCode?: number;
1473
- headers?: Record<string, string>;
1474
- body?: unknown;
1475
- errors?: unknown;
1476
- endTime?: Date;
1477
- };
1478
- //#endregion
1479
- //#region ../olap/src/advanced/types.d.ts
1480
- type ActionAdvancedLog = {
1481
- data: {
1482
- [key: string]: unknown;
1483
- };
1484
- metadata?: {
1485
- isBackgroundLog?: boolean;
1486
- expirationTime?: number;
1487
- };
1488
- };
1489
- type StepAdvancedLog = {
1490
- data: {
1491
- [key: string]: unknown;
1492
- };
1493
- metadata?: {
1494
- expirationTime?: number;
1495
- };
1496
- };
1497
- type UnifiedAdvancedLog = {
1498
- data: {
1499
- [key: string]: unknown;
1500
- };
1501
- metadata?: {
1502
- isBackgroundLog?: boolean;
1503
- expirationTime?: number;
1504
- };
1505
- };
1506
- type ProviderAdvancedLog = {
1507
- data: {
1508
- [key: string]: unknown;
1509
- };
1510
- metadata?: {
1511
- expirationTime?: number;
1512
- };
1513
- };
1514
- //#endregion
1515
1576
  //#region src/cursor/types.d.ts
1516
1577
  type Position = {
1517
1578
  pageNumber?: number | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/core",
3
- "version": "2.39.1",
3
+ "version": "2.40.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",