@stackone/connect-sdk 2.61.0 → 2.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -5,25 +5,6 @@ import { ZodType } from "@stackone/utils";
5
5
 
6
6
  //#region rolldown:runtime
7
7
  //#endregion
8
- //#region ../core/src/categories/types.d.ts
9
- type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage' | 'internal' | 'action';
10
- //#endregion
11
- //#region ../core/src/compositeIds/types.d.ts
12
- type ComponentConfig = {
13
- name: string;
14
- alias?: string;
15
- };
16
- type ComponentFieldConfig = {
17
- targetFieldKey: string;
18
- remote?: string;
19
- components: ComponentConfig[];
20
- };
21
- type CompositeIdentifierConnectorConfig = {
22
- enabled: boolean;
23
- version?: number;
24
- fields?: ComponentFieldConfig[];
25
- };
26
- //#endregion
27
8
  //#region ../logger/src/types.d.ts
28
9
  interface ILogger {
29
10
  debug({
@@ -298,89 +279,6 @@ type HmacSigningOptions = {
298
279
  };
299
280
  type SigningOptions = Aws4SigningOptions | HmacSigningOptions;
300
281
  //#endregion
301
- //#region ../core/src/exhaustivePagination/basePaginationConfig.d.ts
302
- type IteratorLocation = 'query' | 'body' | 'headers';
303
- interface BasePaginationConfig {
304
- type: string;
305
- response: {
306
- dataKey: string;
307
- };
308
- stopCondition?: string;
309
- }
310
- //#endregion
311
- //#region ../core/src/exhaustivePagination/cursorPaginationConfig.d.ts
312
- interface CursorPaginationConfig extends BasePaginationConfig {
313
- type: 'cursor';
314
- response: {
315
- dataKey: string;
316
- nextKey: string;
317
- };
318
- iterator: {
319
- key: string;
320
- in: IteratorLocation;
321
- };
322
- }
323
- //#endregion
324
- //#region ../core/src/exhaustivePagination/offsetPaginationConfig.d.ts
325
- interface OffsetPaginationConfig extends BasePaginationConfig {
326
- type: 'offset';
327
- iterator: {
328
- offsetKey: string;
329
- limitKey: string;
330
- in: IteratorLocation;
331
- defaultLimit?: number;
332
- };
333
- }
334
- //#endregion
335
- //#region ../core/src/exhaustivePagination/pagePaginationConfig.d.ts
336
- interface PagePaginationConfig extends BasePaginationConfig {
337
- type: 'page';
338
- iterator: {
339
- pageKey: string;
340
- pageSizeKey?: string;
341
- in: IteratorLocation;
342
- startPage?: number;
343
- defaultPageSize?: number;
344
- };
345
- }
346
- //#endregion
347
- //#region ../core/src/exhaustivePagination/index.d.ts
348
- type PaginationConfig = CursorPaginationConfig | OffsetPaginationConfig | PagePaginationConfig;
349
- //#endregion
350
- //#region ../core/src/schema/types.d.ts
351
- type Schema = {
352
- name: string;
353
- key: string;
354
- version: string;
355
- description?: string;
356
- category: Category;
357
- fields: {
358
- [name: string]: SchemaField;
359
- };
360
- };
361
- type SchemaField = {
362
- name: string;
363
- type: string;
364
- required: boolean;
365
- description?: string;
366
- };
367
- //#endregion
368
- //#region ../core/src/stepFunctions/stepFunctionsList.d.ts
369
- declare enum StepFunctionName {
370
- TYPECAST = "typecast",
371
- MAP_FIELDS = "map_fields",
372
- GROUP_DATA = "group_data",
373
- REQUEST = "request",
374
- PAGINATED_REQUEST = "paginated_request",
375
- SOAP_REQUEST = "soap_request",
376
- SOAP_PAGINATED_REQUEST = "soap_paginated_request",
377
- STATIC_VALUES = "static_values",
378
- UPLOAD_FILE = "upload_file",
379
- UPLOAD_BINARY = "upload_binary",
380
- DOWNLOAD_FILE = "download_file",
381
- EMIT_EVENT = "emit_event",
382
- }
383
- //#endregion
384
282
  //#region ../olap/src/olap/olapOptions.d.ts
385
283
  type OlapOptions = {
386
284
  logs?: LogsOptions;
@@ -505,6 +403,8 @@ type ActionResult = {
505
403
  actionId: string;
506
404
  connectorKey: string;
507
405
  connectorVersion: string;
406
+ connectorOwner?: string;
407
+ connectorProfileId?: string;
508
408
  actionType: string;
509
409
  category?: string;
510
410
  organizationId: string;
@@ -803,6 +703,8 @@ type ActionLog = ILog & {
803
703
  actionId: string;
804
704
  connectorKey: string;
805
705
  connectorVersion: string;
706
+ connectorOwner?: string;
707
+ connectorProfileId?: string;
806
708
  organizationId: string;
807
709
  projectSecureId: string;
808
710
  accountSecureId: string;
@@ -897,168 +799,108 @@ type ProviderLog = ILog & {
897
799
  duration?: number;
898
800
  };
899
801
  //#endregion
900
- //#region ../core/src/cursor/types.d.ts
901
- type Position = {
902
- pageNumber?: number | null;
903
- providerPageCursor?: string | null;
904
- position?: number | null;
905
- };
906
- type Cursor = {
907
- remote: Record<number, Position>;
908
- version: number;
909
- timestamp: number;
910
- };
802
+ //#region ../core/src/categories/types.d.ts
803
+ type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage' | 'internal' | 'action';
911
804
  //#endregion
912
- //#region ../core/src/settings/types.d.ts
913
- type Settings = {
914
- olap: OlapSettings;
915
- defender?: DefenderSettings;
805
+ //#region ../core/src/compositeIds/types.d.ts
806
+ type ComponentConfig = {
807
+ name: string;
808
+ alias?: string;
916
809
  };
917
- type OlapSettings = {
918
- logs?: {
919
- enabled: boolean;
920
- };
921
- advanced?: {
922
- enabled?: boolean;
923
- ttl?: number;
924
- errorsOnly?: boolean;
925
- includeBackground?: boolean;
926
- };
810
+ type ComponentFieldConfig = {
811
+ targetFieldKey: string;
812
+ remote?: string;
813
+ components: ComponentConfig[];
927
814
  };
928
- type DefenderSettings = {
815
+ type CompositeIdentifierConnectorConfig = {
929
816
  enabled: boolean;
930
- blockHighRisk?: boolean;
931
- highRiskThreshold?: number;
932
- mediumRiskThreshold?: number;
933
- useTier1Classification?: boolean;
934
- useTier2Classification?: boolean;
935
- largeResponseBehavior?: 'skip' | 'block' | 'scan_anyway';
936
- maxResponseSize?: number;
937
- maxResponseWords?: number;
938
- tier2Fields?: string[];
939
- useSfe?: boolean;
940
- annotateBoundary?: boolean;
817
+ version?: number;
818
+ fields?: ComponentFieldConfig[];
941
819
  };
942
820
  //#endregion
943
- //#region ../core/src/source/types.d.ts
944
- type Source = {
945
- sourceType?: string;
946
- sourceId?: string;
947
- sourceValue?: string;
948
- };
821
+ //#region ../core/src/exhaustivePagination/basePaginationConfig.d.ts
822
+ type IteratorLocation = 'query' | 'body' | 'headers';
823
+ interface BasePaginationConfig {
824
+ type: string;
825
+ response: {
826
+ dataKey: string;
827
+ };
828
+ stopCondition?: string;
829
+ }
949
830
  //#endregion
950
- //#region ../core/src/blocks/types.d.ts
951
- type Block = {
952
- inputs?: {
953
- [key: string]: unknown;
831
+ //#region ../core/src/exhaustivePagination/cursorPaginationConfig.d.ts
832
+ interface CursorPaginationConfig extends BasePaginationConfig {
833
+ type: 'cursor';
834
+ response: {
835
+ dataKey: string;
836
+ nextKey: string;
954
837
  };
955
- connector?: Connector;
956
- context: BlockContext;
957
- debug?: DebugParams;
958
- steps?: StepsSnapshots;
959
- intermediateSteps?: IntermediateStepsSnapshots;
960
- httpClient?: IHttpClient;
961
- olapClient?: IOlapClient;
962
- emitEvent?: (event: EventToEmit) => Promise<void>;
963
- settings?: Settings;
964
- logger?: ILogger;
965
- action?: Action;
966
- credentials?: Credentials;
967
- scopes?: string[];
968
- outputs?: unknown;
969
- streamOutput?: StreamOutputData;
970
- nextCursor?: Cursor | null;
971
- response?: {
972
- statusCode: number;
973
- successful: boolean;
974
- message?: string;
838
+ iterator: {
839
+ key: string;
840
+ in: IteratorLocation;
975
841
  };
976
- statistics?: BlockStatistics;
977
- defenderMetadata?: DefenderMetadata;
978
- iterator?: {
979
- item: unknown;
980
- index: number;
981
- current?: unknown;
842
+ }
843
+ //#endregion
844
+ //#region ../core/src/exhaustivePagination/offsetPaginationConfig.d.ts
845
+ interface OffsetPaginationConfig extends BasePaginationConfig {
846
+ type: 'offset';
847
+ iterator: {
848
+ offsetKey: string;
849
+ limitKey: string;
850
+ in: IteratorLocation;
851
+ defaultLimit?: number;
982
852
  };
983
- fieldConfigs?: FieldConfig[];
984
- result?: BlockIndexedRecord[] | BlockIndexedRecord;
985
- };
986
- type BlockContext = {
987
- organizationId?: string;
988
- projectSecureId: string;
989
- accountSecureId: string;
990
- connectorKey: string;
991
- connectorVersion: string;
992
- connectorOwner?: string;
853
+ }
854
+ //#endregion
855
+ //#region ../core/src/exhaustivePagination/pagePaginationConfig.d.ts
856
+ interface PagePaginationConfig extends BasePaginationConfig {
857
+ type: 'page';
858
+ iterator: {
859
+ pageKey: string;
860
+ pageSizeKey?: string;
861
+ in: IteratorLocation;
862
+ startPage?: number;
863
+ defaultPageSize?: number;
864
+ };
865
+ }
866
+ //#endregion
867
+ //#region ../core/src/exhaustivePagination/index.d.ts
868
+ type PaginationConfig = CursorPaginationConfig | OffsetPaginationConfig | PagePaginationConfig;
869
+ //#endregion
870
+ //#region ../core/src/schema/types.d.ts
871
+ type Schema = {
872
+ name: string;
873
+ key: string;
874
+ version: string;
875
+ description?: string;
993
876
  category: Category;
994
- schema?: string;
995
- actionType: ActionType;
996
- authenticationType: string;
997
- environment: string;
998
- actionRunId?: string;
999
- originOwnerId?: string;
1000
- originOwnerName?: string;
1001
- source?: Source;
1002
- service: string;
1003
- resource: string;
1004
- subResource?: string;
1005
- childResource?: string;
1006
- };
1007
- type BlockIndexedRecord = {
1008
- id: string;
1009
- remote_id?: string;
1010
- [key: string]: unknown;
1011
- unified_custom_fields?: {
1012
- [key: string]: unknown;
877
+ fields: {
878
+ [name: string]: SchemaField;
1013
879
  };
1014
880
  };
1015
- type EnumMatcherExpression = {
1016
- matchExpression: string;
1017
- value: string;
1018
- };
1019
- type FieldConfig = {
1020
- expression?: string;
1021
- values?: unknown;
1022
- targetFieldKey: string;
1023
- alias?: string;
881
+ type SchemaField = {
882
+ name: string;
1024
883
  type: string;
1025
- custom: boolean;
1026
- hidden: boolean;
1027
- array: boolean;
1028
- enumMapper?: {
1029
- matcher: string | EnumMatcherExpression[];
1030
- };
1031
- properties?: FieldConfig[];
1032
- requiredScopes?: string[];
1033
- };
1034
- type DebugParams = {
1035
- custom_mappings?: 'disabled' | 'enabled';
1036
- };
1037
- type Credentials = Record<string, unknown>;
1038
- type BlockStatistics = {
1039
- startTime?: Date;
1040
- endTime?: Date;
1041
- };
1042
- type DefenderMetadata = {
1043
- applied: boolean;
1044
- result?: {
1045
- allowed: boolean;
1046
- riskLevel: 'low' | 'medium' | 'high' | 'critical';
1047
- fieldsSanitized: string[];
1048
- patternsByField: Record<string, string[]>;
1049
- detections: string[];
1050
- tier2Score?: number;
1051
- tier2SkipReason?: string;
1052
- latencyMs: number;
1053
- };
1054
- skipped?: {
1055
- reason: 'streaming' | 'size_limit' | 'disabled' | 'error';
1056
- estimatedSize?: number;
1057
- threshold?: number;
1058
- error?: string;
1059
- };
884
+ required: boolean;
885
+ description?: string;
1060
886
  };
1061
887
  //#endregion
888
+ //#region ../core/src/stepFunctions/stepFunctionsList.d.ts
889
+ declare enum StepFunctionName {
890
+ TYPECAST = "typecast",
891
+ MAP_FIELDS = "map_fields",
892
+ GROUP_DATA = "group_data",
893
+ REQUEST = "request",
894
+ PAGINATED_REQUEST = "paginated_request",
895
+ SOAP_REQUEST = "soap_request",
896
+ SOAP_PAGINATED_REQUEST = "soap_paginated_request",
897
+ STATIC_VALUES = "static_values",
898
+ UPLOAD_FILE = "upload_file",
899
+ UPLOAD_BINARY = "upload_binary",
900
+ DOWNLOAD_FILE = "download_file",
901
+ EMIT_EVENT = "emit_event",
902
+ }
903
+ //#endregion
1062
904
  //#region ../core/src/stepFunctions/types.d.ts
1063
905
  type StepFunction = ({
1064
906
  block,
@@ -1417,6 +1259,171 @@ type Authentication = {
1417
1259
  };
1418
1260
  };
1419
1261
  //#endregion
1262
+ //#region ../core/src/cursor/types.d.ts
1263
+ type Position = {
1264
+ pageNumber?: number | null;
1265
+ providerPageCursor?: string | null;
1266
+ position?: number | null;
1267
+ };
1268
+ type Cursor = {
1269
+ remote: Record<number, Position>;
1270
+ version: number;
1271
+ timestamp: number;
1272
+ };
1273
+ //#endregion
1274
+ //#region ../core/src/settings/types.d.ts
1275
+ type Settings = {
1276
+ olap: OlapSettings;
1277
+ defender?: DefenderSettings;
1278
+ };
1279
+ type OlapSettings = {
1280
+ logs?: {
1281
+ enabled: boolean;
1282
+ };
1283
+ advanced?: {
1284
+ enabled?: boolean;
1285
+ ttl?: number;
1286
+ errorsOnly?: boolean;
1287
+ includeBackground?: boolean;
1288
+ };
1289
+ };
1290
+ type DefenderSettings = {
1291
+ enabled: boolean;
1292
+ blockHighRisk?: boolean;
1293
+ highRiskThreshold?: number;
1294
+ mediumRiskThreshold?: number;
1295
+ useTier1Classification?: boolean;
1296
+ useTier2Classification?: boolean;
1297
+ largeResponseBehavior?: 'skip' | 'block' | 'scan_anyway';
1298
+ maxResponseSize?: number;
1299
+ maxResponseWords?: number;
1300
+ tier2Fields?: string[];
1301
+ useSfe?: boolean;
1302
+ annotateBoundary?: boolean;
1303
+ };
1304
+ //#endregion
1305
+ //#region ../core/src/source/types.d.ts
1306
+ type Source = {
1307
+ sourceType?: string;
1308
+ sourceId?: string;
1309
+ sourceValue?: string;
1310
+ };
1311
+ //#endregion
1312
+ //#region ../core/src/blocks/types.d.ts
1313
+ type Block = {
1314
+ inputs?: {
1315
+ [key: string]: unknown;
1316
+ };
1317
+ connector?: Connector;
1318
+ context: BlockContext;
1319
+ debug?: DebugParams;
1320
+ steps?: StepsSnapshots;
1321
+ intermediateSteps?: IntermediateStepsSnapshots;
1322
+ httpClient?: IHttpClient;
1323
+ olapClient?: IOlapClient;
1324
+ emitEvent?: (event: EventToEmit) => Promise<void>;
1325
+ settings?: Settings;
1326
+ logger?: ILogger;
1327
+ action?: Action;
1328
+ credentials?: Credentials;
1329
+ scopes?: string[];
1330
+ outputs?: unknown;
1331
+ streamOutput?: StreamOutputData;
1332
+ nextCursor?: Cursor | null;
1333
+ response?: {
1334
+ statusCode: number;
1335
+ successful: boolean;
1336
+ message?: string;
1337
+ };
1338
+ statistics?: BlockStatistics;
1339
+ defenderMetadata?: DefenderMetadata;
1340
+ iterator?: {
1341
+ item: unknown;
1342
+ index: number;
1343
+ current?: unknown;
1344
+ };
1345
+ fieldConfigs?: FieldConfig[];
1346
+ result?: BlockIndexedRecord[] | BlockIndexedRecord;
1347
+ };
1348
+ type FlowType = 'action' | 'refresh_authentication' | 'test_action';
1349
+ type BlockContext = {
1350
+ organizationId?: string;
1351
+ projectSecureId: string;
1352
+ accountSecureId: string;
1353
+ connectorKey: string;
1354
+ connectorVersion: string;
1355
+ connectorOwner?: string;
1356
+ connectorProfileId?: string;
1357
+ category: Category;
1358
+ schema?: string;
1359
+ actionType: ActionType;
1360
+ authenticationType: string;
1361
+ environment: string;
1362
+ actionRunId?: string;
1363
+ originOwnerId?: string;
1364
+ originOwnerName?: string;
1365
+ source?: Source;
1366
+ flowType?: FlowType;
1367
+ service: string;
1368
+ resource: string;
1369
+ subResource?: string;
1370
+ childResource?: string;
1371
+ };
1372
+ type BlockIndexedRecord = {
1373
+ id: string;
1374
+ remote_id?: string;
1375
+ [key: string]: unknown;
1376
+ unified_custom_fields?: {
1377
+ [key: string]: unknown;
1378
+ };
1379
+ };
1380
+ type EnumMatcherExpression = {
1381
+ matchExpression: string;
1382
+ value: string;
1383
+ };
1384
+ type FieldConfig = {
1385
+ expression?: string;
1386
+ values?: unknown;
1387
+ targetFieldKey: string;
1388
+ alias?: string;
1389
+ type: string;
1390
+ custom: boolean;
1391
+ hidden: boolean;
1392
+ array: boolean;
1393
+ enumMapper?: {
1394
+ matcher: string | EnumMatcherExpression[];
1395
+ };
1396
+ properties?: FieldConfig[];
1397
+ requiredScopes?: string[];
1398
+ };
1399
+ type DebugParams = {
1400
+ custom_mappings?: 'disabled' | 'enabled';
1401
+ };
1402
+ type Credentials = Record<string, unknown>;
1403
+ type BlockStatistics = {
1404
+ startTime?: Date;
1405
+ endTime?: Date;
1406
+ };
1407
+ type DefenderMetadata = {
1408
+ applied: boolean;
1409
+ result?: {
1410
+ allowed: boolean;
1411
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
1412
+ fieldsSanitized: string[];
1413
+ patternsByField: Record<string, string[]>;
1414
+ detections: string[];
1415
+ tier2Score?: number;
1416
+ tier2SkipReason?: string;
1417
+ latencyMs: number;
1418
+ };
1419
+ skipped?: {
1420
+ reason: 'streaming' | 'size_limit' | 'disabled' | 'error';
1421
+ estimatedSize?: number;
1422
+ threshold?: number;
1423
+ error?: string;
1424
+ };
1425
+ };
1426
+ //#endregion
1420
1427
  //#region ../core/src/stepFunctions/factory.d.ts
1421
1428
  declare const StepFunctionsFactory: {
1422
1429
  build({
@@ -1437,6 +1444,7 @@ type Account = {
1437
1444
  providerKey: string;
1438
1445
  providerVersion: string;
1439
1446
  connectorOwner?: string;
1447
+ connectorProfileId?: string;
1440
1448
  authConfigKey: string;
1441
1449
  environment: string;
1442
1450
  organizationId: string;
@@ -1657,6 +1665,7 @@ declare const createBlockContext: ({
1657
1665
  connectorKey,
1658
1666
  connectorVersion,
1659
1667
  connectorOwner,
1668
+ connectorProfileId,
1660
1669
  authConfigKey,
1661
1670
  environment,
1662
1671
  action,
@@ -1667,12 +1676,14 @@ declare const createBlockContext: ({
1667
1676
  originOwnerName,
1668
1677
  sourceType,
1669
1678
  sourceId,
1670
- sourceValue
1679
+ sourceValue,
1680
+ flowType
1671
1681
  }: {
1672
1682
  category: Category;
1673
1683
  connectorKey: string;
1674
1684
  connectorVersion: string;
1675
1685
  connectorOwner?: string;
1686
+ connectorProfileId?: string;
1676
1687
  authConfigKey: string;
1677
1688
  environment?: string;
1678
1689
  action?: Action;
@@ -1684,6 +1695,7 @@ declare const createBlockContext: ({
1684
1695
  sourceType?: string;
1685
1696
  sourceId?: string;
1686
1697
  sourceValue?: string;
1698
+ flowType?: FlowType;
1687
1699
  }) => BlockContext;
1688
1700
  //#endregion
1689
1701
  //#region src/connectors/testActions.d.ts