@stackone/connect-sdk 2.50.0 → 2.51.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
@@ -337,6 +337,42 @@ type DefenderOptions = {
337
337
  enabled?: boolean;
338
338
  };
339
339
  //#endregion
340
+ //#region ../olap/src/advanced/types.d.ts
341
+ type ActionAdvancedLog = {
342
+ data: {
343
+ [key: string]: unknown;
344
+ };
345
+ metadata?: {
346
+ isBackgroundLog?: boolean;
347
+ expirationTime?: number;
348
+ };
349
+ };
350
+ type StepAdvancedLog = {
351
+ data: {
352
+ [key: string]: unknown;
353
+ };
354
+ metadata?: {
355
+ expirationTime?: number;
356
+ };
357
+ };
358
+ type UnifiedAdvancedLog = {
359
+ data: {
360
+ [key: string]: unknown;
361
+ };
362
+ metadata?: {
363
+ isBackgroundLog?: boolean;
364
+ expirationTime?: number;
365
+ };
366
+ };
367
+ type ProviderAdvancedLog = {
368
+ data: {
369
+ [key: string]: unknown;
370
+ };
371
+ metadata?: {
372
+ expirationTime?: number;
373
+ };
374
+ };
375
+ //#endregion
340
376
  //#region ../olap/src/defender/types.d.ts
341
377
  type DefenderLog = {
342
378
  riskLevel: string;
@@ -344,7 +380,176 @@ type DefenderLog = {
344
380
  [key: string]: unknown;
345
381
  };
346
382
  //#endregion
383
+ //#region ../olap/src/types.d.ts
384
+ interface IOlapClient {
385
+ recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
386
+ recordActions(actions: Array<{
387
+ input: ActionInput;
388
+ result: ActionResult;
389
+ }>, options?: OlapOptions): Promise<void>;
390
+ recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
391
+ recordSteps(steps: Array<{
392
+ input: StepInput;
393
+ result: StepResult;
394
+ }>, options?: OlapOptions): Promise<void>;
395
+ recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
396
+ recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
397
+ getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
398
+ getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
399
+ getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
400
+ getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
401
+ getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
402
+ getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
403
+ getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
404
+ getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
405
+ getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
406
+ getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
407
+ getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
408
+ getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
409
+ getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
410
+ getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
411
+ getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
412
+ getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
413
+ }
414
+ type DefenderContext = {
415
+ riskLevel: string;
416
+ tier2Score: number;
417
+ [key: string]: unknown;
418
+ };
419
+ type ActionInput = {
420
+ actionId?: string;
421
+ mode?: string;
422
+ url?: string;
423
+ pathParams?: unknown;
424
+ queryParams?: unknown;
425
+ body?: unknown;
426
+ headers?: Record<string, string>;
427
+ sourceId?: string;
428
+ sourceType?: string;
429
+ sourceValue?: string;
430
+ isBackground?: boolean;
431
+ startTime?: Date;
432
+ };
433
+ type ActionResult = {
434
+ actionRunId: string;
435
+ actionId: string;
436
+ connectorKey: string;
437
+ connectorVersion: string;
438
+ actionType: string;
439
+ category?: string;
440
+ organizationId: string;
441
+ projectSecureId: string;
442
+ accountSecureId: string;
443
+ originOwnerId?: string;
444
+ originOwnerName?: string;
445
+ httpMethod?: string;
446
+ url?: string;
447
+ path?: string;
448
+ resource?: string;
449
+ subResource?: string;
450
+ childResource?: string;
451
+ success?: boolean;
452
+ statusCode?: number;
453
+ message?: string;
454
+ headers?: Record<string, string>;
455
+ body?: unknown;
456
+ defenderContext?: DefenderContext;
457
+ endTime?: Date;
458
+ };
459
+ type StepInput = {
460
+ actionRunId: string;
461
+ stepIndex: number;
462
+ stepId: string;
463
+ organizationId: string;
464
+ projectSecureId: string;
465
+ accountSecureId: string;
466
+ inputs?: {
467
+ [key: string]: unknown;
468
+ };
469
+ };
470
+ type StepResult = {
471
+ success?: boolean;
472
+ message?: string;
473
+ outputs?: unknown;
474
+ errors?: unknown;
475
+ skipped?: boolean;
476
+ startTime?: Date;
477
+ endTime?: Date;
478
+ };
479
+ type UnifiedInput = {
480
+ requestId: string;
481
+ organizationId: string;
482
+ projectSecureId: string;
483
+ accountSecureId: string;
484
+ originOwnerId?: string;
485
+ originOwnerName?: string;
486
+ connectorKey: string;
487
+ action?: string;
488
+ service?: string;
489
+ mode?: string;
490
+ httpMethod?: string;
491
+ url?: string;
492
+ path?: string;
493
+ queryParams?: unknown;
494
+ body?: unknown;
495
+ headers?: Record<string, string>;
496
+ resource?: string;
497
+ subResource?: string;
498
+ childResource?: string;
499
+ sourceId?: string;
500
+ sourceType?: string;
501
+ sourceValue?: string;
502
+ isBackground?: boolean;
503
+ startTime?: Date;
504
+ };
505
+ type UnifiedResult = {
506
+ success?: boolean;
507
+ statusCode?: number;
508
+ message?: string;
509
+ headers?: Record<string, string>;
510
+ body?: unknown;
511
+ endTime?: Date;
512
+ };
513
+ type ProviderInput = {
514
+ requestId: string;
515
+ id: string;
516
+ organizationId: string;
517
+ projectSecureId: string;
518
+ accountSecureId: string;
519
+ originOwnerId?: string;
520
+ originOwnerName?: string;
521
+ connectorKey: string;
522
+ action: string;
523
+ service: string;
524
+ mode: string;
525
+ httpMethod: string;
526
+ url: string;
527
+ path?: string;
528
+ queryParams?: unknown;
529
+ headers?: Record<string, string>;
530
+ body?: unknown;
531
+ resource?: string;
532
+ subResource?: string;
533
+ childResource?: string;
534
+ startTime?: Date;
535
+ };
536
+ type ProviderResult = {
537
+ success?: boolean;
538
+ statusCode?: number;
539
+ headers?: Record<string, string>;
540
+ body?: unknown;
541
+ errors?: unknown;
542
+ endTime?: Date;
543
+ };
544
+ //#endregion
347
545
  //#region ../olap/src/logs/types.d.ts
546
+ declare const LogType: {
547
+ readonly Action: "action";
548
+ readonly Step: "step";
549
+ readonly Unified: "unified";
550
+ readonly Provider: "provider";
551
+ };
552
+ type LogType = (typeof LogType)[keyof typeof LogType];
348
553
  type Query = {
349
554
  organizationId?: string | string[];
350
555
  projectSecureId?: string | string[];
@@ -354,7 +559,20 @@ type Query = {
354
559
  connectorKey?: string | string[];
355
560
  mode?: string | string[];
356
561
  category?: string | string[];
357
- logType?: ('action' | 'unified') | ('action' | 'unified')[];
562
+ requestId?: string | string[];
563
+ provider?: string | string[];
564
+ service?: string | string[];
565
+ resource?: string | string[];
566
+ subResource?: string | string[];
567
+ childResource?: string | string[];
568
+ action?: string | string[];
569
+ statusCode?: string | string[];
570
+ sourceId?: string | string[];
571
+ sourceType?: string | string[];
572
+ sourceValue?: string | string[];
573
+ originOwnerId?: string | string[];
574
+ httpMethod?: string | string[];
575
+ logType?: (typeof LogType.Action | typeof LogType.Unified) | (typeof LogType.Action | typeof LogType.Unified)[];
358
576
  success?: boolean;
359
577
  startTime?: Date;
360
578
  endTime?: Date;
@@ -447,8 +665,47 @@ type ProviderQueryResult = {
447
665
  pageNumber: number;
448
666
  pageSize: number;
449
667
  };
668
+ type IntervalType = 'minute' | 'hour' | 'day' | 'week' | 'month';
669
+ declare const Dimension: {
670
+ readonly ConnectorKey: "connector_key";
671
+ readonly Success: "success";
672
+ readonly ActionType: "action_type";
673
+ readonly Mode: "mode";
674
+ readonly Service: "service";
675
+ readonly Resource: "resource";
676
+ readonly ActionId: "action_id";
677
+ readonly HttpMethod: "http_method";
678
+ readonly AccountSecureId: "account_secure_id";
679
+ readonly SourceType: "source_type";
680
+ readonly StatusCode: "status_code";
681
+ readonly OriginOwnerId: "origin_owner_id";
682
+ readonly SourceId: "source_id";
683
+ };
684
+ type Dimension = (typeof Dimension)[keyof typeof Dimension];
685
+ type AggregateQuery = Partial<Query> & {
686
+ dimensions?: Dimension[];
687
+ intervalType?: IntervalType;
688
+ intervalPeriod?: number;
689
+ };
690
+ type AggregateResult = {
691
+ data: Array<{
692
+ start_time?: string;
693
+ count: number;
694
+ [dimension: string]: string | number | boolean | undefined;
695
+ }>;
696
+ };
697
+ type DimensionsQuery = Partial<Query> & {
698
+ dimensions: Dimension[];
699
+ maxValues?: number;
700
+ };
701
+ type DimensionsResult = {
702
+ [dimension: string]: Array<{
703
+ value: string;
704
+ count: number;
705
+ }>;
706
+ };
450
707
  interface ILog {
451
- logType: 'action' | 'step' | 'unified' | 'provider';
708
+ logType: LogType;
452
709
  eventTime: Date;
453
710
  startTime: Date;
454
711
  endTime?: Date;
@@ -458,7 +715,7 @@ interface ILog {
458
715
  accountSecureId?: string;
459
716
  }
460
717
  type ActionLog = ILog & {
461
- logType: 'action';
718
+ logType: typeof LogType.Action;
462
719
  actionRunId: string;
463
720
  actionId: string;
464
721
  connectorKey: string;
@@ -483,7 +740,7 @@ type ActionLog = ILog & {
483
740
  tier2Score?: number;
484
741
  };
485
742
  type StepLog = ILog & {
486
- logType: 'step';
743
+ logType: typeof LogType.Step;
487
744
  actionRunId: string;
488
745
  stepIndex: number;
489
746
  stepId: string;
@@ -495,7 +752,7 @@ type StepLog = ILog & {
495
752
  message?: string;
496
753
  };
497
754
  type UnifiedLog = ILog & {
498
- logType: 'unified';
755
+ logType: typeof LogType.Unified;
499
756
  requestId: string;
500
757
  organizationId: string;
501
758
  projectSecureId: string;
@@ -525,7 +782,7 @@ type UnifiedLog = ILog & {
525
782
  duration?: number;
526
783
  };
527
784
  type ProviderLog = ILog & {
528
- logType: 'provider';
785
+ logType: typeof LogType.Provider;
529
786
  requestId: string;
530
787
  id?: string;
531
788
  organizationId: string;
@@ -552,202 +809,6 @@ type ProviderLog = ILog & {
552
809
  duration?: number;
553
810
  };
554
811
  //#endregion
555
- //#region ../olap/src/types.d.ts
556
- interface IOlapClient {
557
- recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
558
- recordActions(actions: Array<{
559
- input: ActionInput;
560
- result: ActionResult;
561
- }>, options?: OlapOptions): Promise<void>;
562
- recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
563
- recordSteps(steps: Array<{
564
- input: StepInput;
565
- result: StepResult;
566
- }>, options?: OlapOptions): Promise<void>;
567
- recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
568
- recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
569
- getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
570
- getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
571
- getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
572
- getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
573
- getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
574
- getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
575
- getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
576
- getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
577
- getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
578
- getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
579
- getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
580
- getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
581
- getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
582
- getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
583
- }
584
- type DefenderContext = {
585
- riskLevel: string;
586
- tier2Score: number;
587
- [key: string]: unknown;
588
- };
589
- type ActionInput = {
590
- actionId?: string;
591
- mode?: string;
592
- url?: string;
593
- pathParams?: unknown;
594
- queryParams?: unknown;
595
- body?: unknown;
596
- headers?: Record<string, string>;
597
- sourceId?: string;
598
- sourceType?: string;
599
- sourceValue?: string;
600
- isBackground?: boolean;
601
- startTime?: Date;
602
- };
603
- type ActionResult = {
604
- actionRunId: string;
605
- actionId: string;
606
- connectorKey: string;
607
- connectorVersion: string;
608
- actionType: string;
609
- category?: string;
610
- organizationId: string;
611
- projectSecureId: string;
612
- accountSecureId: string;
613
- originOwnerId?: string;
614
- originOwnerName?: string;
615
- httpMethod?: string;
616
- url?: string;
617
- path?: string;
618
- resource?: string;
619
- subResource?: string;
620
- childResource?: string;
621
- success?: boolean;
622
- statusCode?: number;
623
- message?: string;
624
- headers?: Record<string, string>;
625
- body?: unknown;
626
- defenderContext?: DefenderContext;
627
- endTime?: Date;
628
- };
629
- type StepInput = {
630
- actionRunId: string;
631
- stepIndex: number;
632
- stepId: string;
633
- organizationId: string;
634
- projectSecureId: string;
635
- accountSecureId: string;
636
- inputs?: {
637
- [key: string]: unknown;
638
- };
639
- };
640
- type StepResult = {
641
- success?: boolean;
642
- message?: string;
643
- outputs?: unknown;
644
- errors?: unknown;
645
- skipped?: boolean;
646
- startTime?: Date;
647
- endTime?: Date;
648
- };
649
- type UnifiedInput = {
650
- requestId: string;
651
- organizationId: string;
652
- projectSecureId: string;
653
- accountSecureId: string;
654
- originOwnerId?: string;
655
- originOwnerName?: string;
656
- connectorKey: string;
657
- action?: string;
658
- service?: string;
659
- mode?: string;
660
- httpMethod?: string;
661
- url?: string;
662
- path?: string;
663
- queryParams?: unknown;
664
- body?: unknown;
665
- headers?: Record<string, string>;
666
- resource?: string;
667
- subResource?: string;
668
- childResource?: string;
669
- sourceId?: string;
670
- sourceType?: string;
671
- sourceValue?: string;
672
- isBackground?: boolean;
673
- startTime?: Date;
674
- };
675
- type UnifiedResult = {
676
- success?: boolean;
677
- statusCode?: number;
678
- message?: string;
679
- headers?: Record<string, string>;
680
- body?: unknown;
681
- endTime?: Date;
682
- };
683
- type ProviderInput = {
684
- requestId: string;
685
- id: string;
686
- organizationId: string;
687
- projectSecureId: string;
688
- accountSecureId: string;
689
- originOwnerId?: string;
690
- originOwnerName?: string;
691
- connectorKey: string;
692
- action: string;
693
- service: string;
694
- mode: string;
695
- httpMethod: string;
696
- url: string;
697
- path?: string;
698
- queryParams?: unknown;
699
- headers?: Record<string, string>;
700
- body?: unknown;
701
- resource?: string;
702
- subResource?: string;
703
- childResource?: string;
704
- startTime?: Date;
705
- };
706
- type ProviderResult = {
707
- success?: boolean;
708
- statusCode?: number;
709
- headers?: Record<string, string>;
710
- body?: unknown;
711
- errors?: unknown;
712
- endTime?: Date;
713
- };
714
- //#endregion
715
- //#region ../olap/src/advanced/types.d.ts
716
- type ActionAdvancedLog = {
717
- data: {
718
- [key: string]: unknown;
719
- };
720
- metadata?: {
721
- isBackgroundLog?: boolean;
722
- expirationTime?: number;
723
- };
724
- };
725
- type StepAdvancedLog = {
726
- data: {
727
- [key: string]: unknown;
728
- };
729
- metadata?: {
730
- expirationTime?: number;
731
- };
732
- };
733
- type UnifiedAdvancedLog = {
734
- data: {
735
- [key: string]: unknown;
736
- };
737
- metadata?: {
738
- isBackgroundLog?: boolean;
739
- expirationTime?: number;
740
- };
741
- };
742
- type ProviderAdvancedLog = {
743
- data: {
744
- [key: string]: unknown;
745
- };
746
- metadata?: {
747
- expirationTime?: number;
748
- };
749
- };
750
- //#endregion
751
812
  //#region ../core/src/cursor/types.d.ts
752
813
  type Position = {
753
814
  pageNumber?: number | null;
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as __name } from "./chunk-Cfxk5zVN.mjs";
2
2
  import { ZodType, z } from "@stackone/utils";
3
+ import https from "node:https";
3
4
  import { Readable } from "node:stream";
4
5
  import http from "node:http";
5
- import https from "node:https";
6
6
 
7
7
  //#region ../core/src/categories/types.d.ts
8
8
  type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage' | 'internal' | 'action';
@@ -337,6 +337,42 @@ type DefenderOptions = {
337
337
  enabled?: boolean;
338
338
  };
339
339
  //#endregion
340
+ //#region ../olap/src/advanced/types.d.ts
341
+ type ActionAdvancedLog = {
342
+ data: {
343
+ [key: string]: unknown;
344
+ };
345
+ metadata?: {
346
+ isBackgroundLog?: boolean;
347
+ expirationTime?: number;
348
+ };
349
+ };
350
+ type StepAdvancedLog = {
351
+ data: {
352
+ [key: string]: unknown;
353
+ };
354
+ metadata?: {
355
+ expirationTime?: number;
356
+ };
357
+ };
358
+ type UnifiedAdvancedLog = {
359
+ data: {
360
+ [key: string]: unknown;
361
+ };
362
+ metadata?: {
363
+ isBackgroundLog?: boolean;
364
+ expirationTime?: number;
365
+ };
366
+ };
367
+ type ProviderAdvancedLog = {
368
+ data: {
369
+ [key: string]: unknown;
370
+ };
371
+ metadata?: {
372
+ expirationTime?: number;
373
+ };
374
+ };
375
+ //#endregion
340
376
  //#region ../olap/src/defender/types.d.ts
341
377
  type DefenderLog = {
342
378
  riskLevel: string;
@@ -344,7 +380,176 @@ type DefenderLog = {
344
380
  [key: string]: unknown;
345
381
  };
346
382
  //#endregion
383
+ //#region ../olap/src/types.d.ts
384
+ interface IOlapClient {
385
+ recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
386
+ recordActions(actions: Array<{
387
+ input: ActionInput;
388
+ result: ActionResult;
389
+ }>, options?: OlapOptions): Promise<void>;
390
+ recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
391
+ recordSteps(steps: Array<{
392
+ input: StepInput;
393
+ result: StepResult;
394
+ }>, options?: OlapOptions): Promise<void>;
395
+ recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
396
+ recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
397
+ getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
398
+ getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
399
+ getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
400
+ getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
401
+ getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
402
+ getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
403
+ getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
404
+ getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
405
+ getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
406
+ getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
407
+ getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
408
+ getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
409
+ getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
410
+ getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
411
+ getLogsStatsAggregate(organizationId: string, projectSecureId: string, query: AggregateQuery): Promise<AggregateResult>;
412
+ getLogsStatsDimensions(organizationId: string, projectSecureId: string, query: DimensionsQuery): Promise<DimensionsResult>;
413
+ }
414
+ type DefenderContext = {
415
+ riskLevel: string;
416
+ tier2Score: number;
417
+ [key: string]: unknown;
418
+ };
419
+ type ActionInput = {
420
+ actionId?: string;
421
+ mode?: string;
422
+ url?: string;
423
+ pathParams?: unknown;
424
+ queryParams?: unknown;
425
+ body?: unknown;
426
+ headers?: Record<string, string>;
427
+ sourceId?: string;
428
+ sourceType?: string;
429
+ sourceValue?: string;
430
+ isBackground?: boolean;
431
+ startTime?: Date;
432
+ };
433
+ type ActionResult = {
434
+ actionRunId: string;
435
+ actionId: string;
436
+ connectorKey: string;
437
+ connectorVersion: string;
438
+ actionType: string;
439
+ category?: string;
440
+ organizationId: string;
441
+ projectSecureId: string;
442
+ accountSecureId: string;
443
+ originOwnerId?: string;
444
+ originOwnerName?: string;
445
+ httpMethod?: string;
446
+ url?: string;
447
+ path?: string;
448
+ resource?: string;
449
+ subResource?: string;
450
+ childResource?: string;
451
+ success?: boolean;
452
+ statusCode?: number;
453
+ message?: string;
454
+ headers?: Record<string, string>;
455
+ body?: unknown;
456
+ defenderContext?: DefenderContext;
457
+ endTime?: Date;
458
+ };
459
+ type StepInput = {
460
+ actionRunId: string;
461
+ stepIndex: number;
462
+ stepId: string;
463
+ organizationId: string;
464
+ projectSecureId: string;
465
+ accountSecureId: string;
466
+ inputs?: {
467
+ [key: string]: unknown;
468
+ };
469
+ };
470
+ type StepResult = {
471
+ success?: boolean;
472
+ message?: string;
473
+ outputs?: unknown;
474
+ errors?: unknown;
475
+ skipped?: boolean;
476
+ startTime?: Date;
477
+ endTime?: Date;
478
+ };
479
+ type UnifiedInput = {
480
+ requestId: string;
481
+ organizationId: string;
482
+ projectSecureId: string;
483
+ accountSecureId: string;
484
+ originOwnerId?: string;
485
+ originOwnerName?: string;
486
+ connectorKey: string;
487
+ action?: string;
488
+ service?: string;
489
+ mode?: string;
490
+ httpMethod?: string;
491
+ url?: string;
492
+ path?: string;
493
+ queryParams?: unknown;
494
+ body?: unknown;
495
+ headers?: Record<string, string>;
496
+ resource?: string;
497
+ subResource?: string;
498
+ childResource?: string;
499
+ sourceId?: string;
500
+ sourceType?: string;
501
+ sourceValue?: string;
502
+ isBackground?: boolean;
503
+ startTime?: Date;
504
+ };
505
+ type UnifiedResult = {
506
+ success?: boolean;
507
+ statusCode?: number;
508
+ message?: string;
509
+ headers?: Record<string, string>;
510
+ body?: unknown;
511
+ endTime?: Date;
512
+ };
513
+ type ProviderInput = {
514
+ requestId: string;
515
+ id: string;
516
+ organizationId: string;
517
+ projectSecureId: string;
518
+ accountSecureId: string;
519
+ originOwnerId?: string;
520
+ originOwnerName?: string;
521
+ connectorKey: string;
522
+ action: string;
523
+ service: string;
524
+ mode: string;
525
+ httpMethod: string;
526
+ url: string;
527
+ path?: string;
528
+ queryParams?: unknown;
529
+ headers?: Record<string, string>;
530
+ body?: unknown;
531
+ resource?: string;
532
+ subResource?: string;
533
+ childResource?: string;
534
+ startTime?: Date;
535
+ };
536
+ type ProviderResult = {
537
+ success?: boolean;
538
+ statusCode?: number;
539
+ headers?: Record<string, string>;
540
+ body?: unknown;
541
+ errors?: unknown;
542
+ endTime?: Date;
543
+ };
544
+ //#endregion
347
545
  //#region ../olap/src/logs/types.d.ts
546
+ declare const LogType: {
547
+ readonly Action: "action";
548
+ readonly Step: "step";
549
+ readonly Unified: "unified";
550
+ readonly Provider: "provider";
551
+ };
552
+ type LogType = (typeof LogType)[keyof typeof LogType];
348
553
  type Query = {
349
554
  organizationId?: string | string[];
350
555
  projectSecureId?: string | string[];
@@ -354,7 +559,20 @@ type Query = {
354
559
  connectorKey?: string | string[];
355
560
  mode?: string | string[];
356
561
  category?: string | string[];
357
- logType?: ('action' | 'unified') | ('action' | 'unified')[];
562
+ requestId?: string | string[];
563
+ provider?: string | string[];
564
+ service?: string | string[];
565
+ resource?: string | string[];
566
+ subResource?: string | string[];
567
+ childResource?: string | string[];
568
+ action?: string | string[];
569
+ statusCode?: string | string[];
570
+ sourceId?: string | string[];
571
+ sourceType?: string | string[];
572
+ sourceValue?: string | string[];
573
+ originOwnerId?: string | string[];
574
+ httpMethod?: string | string[];
575
+ logType?: (typeof LogType.Action | typeof LogType.Unified) | (typeof LogType.Action | typeof LogType.Unified)[];
358
576
  success?: boolean;
359
577
  startTime?: Date;
360
578
  endTime?: Date;
@@ -447,8 +665,47 @@ type ProviderQueryResult = {
447
665
  pageNumber: number;
448
666
  pageSize: number;
449
667
  };
668
+ type IntervalType = 'minute' | 'hour' | 'day' | 'week' | 'month';
669
+ declare const Dimension: {
670
+ readonly ConnectorKey: "connector_key";
671
+ readonly Success: "success";
672
+ readonly ActionType: "action_type";
673
+ readonly Mode: "mode";
674
+ readonly Service: "service";
675
+ readonly Resource: "resource";
676
+ readonly ActionId: "action_id";
677
+ readonly HttpMethod: "http_method";
678
+ readonly AccountSecureId: "account_secure_id";
679
+ readonly SourceType: "source_type";
680
+ readonly StatusCode: "status_code";
681
+ readonly OriginOwnerId: "origin_owner_id";
682
+ readonly SourceId: "source_id";
683
+ };
684
+ type Dimension = (typeof Dimension)[keyof typeof Dimension];
685
+ type AggregateQuery = Partial<Query> & {
686
+ dimensions?: Dimension[];
687
+ intervalType?: IntervalType;
688
+ intervalPeriod?: number;
689
+ };
690
+ type AggregateResult = {
691
+ data: Array<{
692
+ start_time?: string;
693
+ count: number;
694
+ [dimension: string]: string | number | boolean | undefined;
695
+ }>;
696
+ };
697
+ type DimensionsQuery = Partial<Query> & {
698
+ dimensions: Dimension[];
699
+ maxValues?: number;
700
+ };
701
+ type DimensionsResult = {
702
+ [dimension: string]: Array<{
703
+ value: string;
704
+ count: number;
705
+ }>;
706
+ };
450
707
  interface ILog {
451
- logType: 'action' | 'step' | 'unified' | 'provider';
708
+ logType: LogType;
452
709
  eventTime: Date;
453
710
  startTime: Date;
454
711
  endTime?: Date;
@@ -458,7 +715,7 @@ interface ILog {
458
715
  accountSecureId?: string;
459
716
  }
460
717
  type ActionLog = ILog & {
461
- logType: 'action';
718
+ logType: typeof LogType.Action;
462
719
  actionRunId: string;
463
720
  actionId: string;
464
721
  connectorKey: string;
@@ -483,7 +740,7 @@ type ActionLog = ILog & {
483
740
  tier2Score?: number;
484
741
  };
485
742
  type StepLog = ILog & {
486
- logType: 'step';
743
+ logType: typeof LogType.Step;
487
744
  actionRunId: string;
488
745
  stepIndex: number;
489
746
  stepId: string;
@@ -495,7 +752,7 @@ type StepLog = ILog & {
495
752
  message?: string;
496
753
  };
497
754
  type UnifiedLog = ILog & {
498
- logType: 'unified';
755
+ logType: typeof LogType.Unified;
499
756
  requestId: string;
500
757
  organizationId: string;
501
758
  projectSecureId: string;
@@ -525,7 +782,7 @@ type UnifiedLog = ILog & {
525
782
  duration?: number;
526
783
  };
527
784
  type ProviderLog = ILog & {
528
- logType: 'provider';
785
+ logType: typeof LogType.Provider;
529
786
  requestId: string;
530
787
  id?: string;
531
788
  organizationId: string;
@@ -552,202 +809,6 @@ type ProviderLog = ILog & {
552
809
  duration?: number;
553
810
  };
554
811
  //#endregion
555
- //#region ../olap/src/types.d.ts
556
- interface IOlapClient {
557
- recordAction(actionInput: ActionInput, actionResult: ActionResult, options?: OlapOptions): Promise<void>;
558
- recordActions(actions: Array<{
559
- input: ActionInput;
560
- result: ActionResult;
561
- }>, options?: OlapOptions): Promise<void>;
562
- recordStep(stepInput: StepInput, stepResult: StepResult, options?: OlapOptions): Promise<void>;
563
- recordSteps(steps: Array<{
564
- input: StepInput;
565
- result: StepResult;
566
- }>, options?: OlapOptions): Promise<void>;
567
- recordUnified(unifiedInput: UnifiedInput, unifiedResult: UnifiedResult, options?: OlapOptions): Promise<void>;
568
- recordProvider(providerInput: ProviderInput, providerResult: ProviderResult, options?: OlapOptions): Promise<void>;
569
- getLogs(organizationId: string, projectSecureId: string, query: Query): Promise<QueryResult>;
570
- getActionLogs(organizationId: string, projectSecureId: string, query: ActionsQuery): Promise<ActionsQueryResult>;
571
- getActionLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionLog | undefined>;
572
- getStepLogs(organizationId: string, projectSecureId: string, query: StepsQuery): Promise<StepsQueryResult>;
573
- getStepLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepLog | undefined>;
574
- getUnifiedLogs(organizationId: string, projectSecureId: string, query: UnifiedQuery): Promise<UnifiedQueryResult>;
575
- getUnifiedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedLog | undefined>;
576
- getProviderLogs(organizationId: string, projectSecureId: string, query: ProviderQuery): Promise<ProviderQueryResult>;
577
- getProviderLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderLog | undefined>;
578
- getActionAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<ActionAdvancedLog | undefined>;
579
- getStepAdvancedLog(organizationId: string, projectSecureId: string, actionRunId: string, stepIndex: number): Promise<StepAdvancedLog | undefined>;
580
- getUnifiedAdvancedLog(organizationId: string, projectSecureId: string, requestId: string): Promise<UnifiedAdvancedLog | undefined>;
581
- getProviderAdvancedLog(organizationId: string, projectSecureId: string, requestId: string, id: string): Promise<ProviderAdvancedLog | undefined>;
582
- getDefenderLog(organizationId: string, projectSecureId: string, actionRunId: string): Promise<DefenderLog | undefined>;
583
- }
584
- type DefenderContext = {
585
- riskLevel: string;
586
- tier2Score: number;
587
- [key: string]: unknown;
588
- };
589
- type ActionInput = {
590
- actionId?: string;
591
- mode?: string;
592
- url?: string;
593
- pathParams?: unknown;
594
- queryParams?: unknown;
595
- body?: unknown;
596
- headers?: Record<string, string>;
597
- sourceId?: string;
598
- sourceType?: string;
599
- sourceValue?: string;
600
- isBackground?: boolean;
601
- startTime?: Date;
602
- };
603
- type ActionResult = {
604
- actionRunId: string;
605
- actionId: string;
606
- connectorKey: string;
607
- connectorVersion: string;
608
- actionType: string;
609
- category?: string;
610
- organizationId: string;
611
- projectSecureId: string;
612
- accountSecureId: string;
613
- originOwnerId?: string;
614
- originOwnerName?: string;
615
- httpMethod?: string;
616
- url?: string;
617
- path?: string;
618
- resource?: string;
619
- subResource?: string;
620
- childResource?: string;
621
- success?: boolean;
622
- statusCode?: number;
623
- message?: string;
624
- headers?: Record<string, string>;
625
- body?: unknown;
626
- defenderContext?: DefenderContext;
627
- endTime?: Date;
628
- };
629
- type StepInput = {
630
- actionRunId: string;
631
- stepIndex: number;
632
- stepId: string;
633
- organizationId: string;
634
- projectSecureId: string;
635
- accountSecureId: string;
636
- inputs?: {
637
- [key: string]: unknown;
638
- };
639
- };
640
- type StepResult = {
641
- success?: boolean;
642
- message?: string;
643
- outputs?: unknown;
644
- errors?: unknown;
645
- skipped?: boolean;
646
- startTime?: Date;
647
- endTime?: Date;
648
- };
649
- type UnifiedInput = {
650
- requestId: string;
651
- organizationId: string;
652
- projectSecureId: string;
653
- accountSecureId: string;
654
- originOwnerId?: string;
655
- originOwnerName?: string;
656
- connectorKey: string;
657
- action?: string;
658
- service?: string;
659
- mode?: string;
660
- httpMethod?: string;
661
- url?: string;
662
- path?: string;
663
- queryParams?: unknown;
664
- body?: unknown;
665
- headers?: Record<string, string>;
666
- resource?: string;
667
- subResource?: string;
668
- childResource?: string;
669
- sourceId?: string;
670
- sourceType?: string;
671
- sourceValue?: string;
672
- isBackground?: boolean;
673
- startTime?: Date;
674
- };
675
- type UnifiedResult = {
676
- success?: boolean;
677
- statusCode?: number;
678
- message?: string;
679
- headers?: Record<string, string>;
680
- body?: unknown;
681
- endTime?: Date;
682
- };
683
- type ProviderInput = {
684
- requestId: string;
685
- id: string;
686
- organizationId: string;
687
- projectSecureId: string;
688
- accountSecureId: string;
689
- originOwnerId?: string;
690
- originOwnerName?: string;
691
- connectorKey: string;
692
- action: string;
693
- service: string;
694
- mode: string;
695
- httpMethod: string;
696
- url: string;
697
- path?: string;
698
- queryParams?: unknown;
699
- headers?: Record<string, string>;
700
- body?: unknown;
701
- resource?: string;
702
- subResource?: string;
703
- childResource?: string;
704
- startTime?: Date;
705
- };
706
- type ProviderResult = {
707
- success?: boolean;
708
- statusCode?: number;
709
- headers?: Record<string, string>;
710
- body?: unknown;
711
- errors?: unknown;
712
- endTime?: Date;
713
- };
714
- //#endregion
715
- //#region ../olap/src/advanced/types.d.ts
716
- type ActionAdvancedLog = {
717
- data: {
718
- [key: string]: unknown;
719
- };
720
- metadata?: {
721
- isBackgroundLog?: boolean;
722
- expirationTime?: number;
723
- };
724
- };
725
- type StepAdvancedLog = {
726
- data: {
727
- [key: string]: unknown;
728
- };
729
- metadata?: {
730
- expirationTime?: number;
731
- };
732
- };
733
- type UnifiedAdvancedLog = {
734
- data: {
735
- [key: string]: unknown;
736
- };
737
- metadata?: {
738
- isBackgroundLog?: boolean;
739
- expirationTime?: number;
740
- };
741
- };
742
- type ProviderAdvancedLog = {
743
- data: {
744
- [key: string]: unknown;
745
- };
746
- metadata?: {
747
- expirationTime?: number;
748
- };
749
- };
750
- //#endregion
751
812
  //#region ../core/src/cursor/types.d.ts
752
813
  type Position = {
753
814
  pageNumber?: number | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/connect-sdk",
3
- "version": "2.50.0",
3
+ "version": "2.51.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -48,7 +48,7 @@
48
48
  "@stackone/olap": "*",
49
49
  "@stackone/transport": "*",
50
50
  "@stackone/utils": "*",
51
- "path-to-regexp": "8.2.0",
52
- "yaml": "2.7.1"
51
+ "path-to-regexp": "8.4.2",
52
+ "yaml": "2.8.3"
53
53
  }
54
54
  }