@stackone/connect-sdk 2.61.0 → 2.62.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;
@@ -897,168 +795,108 @@ type ProviderLog = ILog & {
897
795
  duration?: number;
898
796
  };
899
797
  //#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
- };
798
+ //#region ../core/src/categories/types.d.ts
799
+ type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage' | 'internal' | 'action';
911
800
  //#endregion
912
- //#region ../core/src/settings/types.d.ts
913
- type Settings = {
914
- olap: OlapSettings;
915
- defender?: DefenderSettings;
801
+ //#region ../core/src/compositeIds/types.d.ts
802
+ type ComponentConfig = {
803
+ name: string;
804
+ alias?: string;
916
805
  };
917
- type OlapSettings = {
918
- logs?: {
919
- enabled: boolean;
920
- };
921
- advanced?: {
922
- enabled?: boolean;
923
- ttl?: number;
924
- errorsOnly?: boolean;
925
- includeBackground?: boolean;
926
- };
806
+ type ComponentFieldConfig = {
807
+ targetFieldKey: string;
808
+ remote?: string;
809
+ components: ComponentConfig[];
927
810
  };
928
- type DefenderSettings = {
811
+ type CompositeIdentifierConnectorConfig = {
929
812
  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;
813
+ version?: number;
814
+ fields?: ComponentFieldConfig[];
941
815
  };
942
816
  //#endregion
943
- //#region ../core/src/source/types.d.ts
944
- type Source = {
945
- sourceType?: string;
946
- sourceId?: string;
947
- sourceValue?: string;
948
- };
817
+ //#region ../core/src/exhaustivePagination/basePaginationConfig.d.ts
818
+ type IteratorLocation = 'query' | 'body' | 'headers';
819
+ interface BasePaginationConfig {
820
+ type: string;
821
+ response: {
822
+ dataKey: string;
823
+ };
824
+ stopCondition?: string;
825
+ }
949
826
  //#endregion
950
- //#region ../core/src/blocks/types.d.ts
951
- type Block = {
952
- inputs?: {
953
- [key: string]: unknown;
827
+ //#region ../core/src/exhaustivePagination/cursorPaginationConfig.d.ts
828
+ interface CursorPaginationConfig extends BasePaginationConfig {
829
+ type: 'cursor';
830
+ response: {
831
+ dataKey: string;
832
+ nextKey: string;
954
833
  };
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;
834
+ iterator: {
835
+ key: string;
836
+ in: IteratorLocation;
975
837
  };
976
- statistics?: BlockStatistics;
977
- defenderMetadata?: DefenderMetadata;
978
- iterator?: {
979
- item: unknown;
980
- index: number;
981
- current?: unknown;
838
+ }
839
+ //#endregion
840
+ //#region ../core/src/exhaustivePagination/offsetPaginationConfig.d.ts
841
+ interface OffsetPaginationConfig extends BasePaginationConfig {
842
+ type: 'offset';
843
+ iterator: {
844
+ offsetKey: string;
845
+ limitKey: string;
846
+ in: IteratorLocation;
847
+ defaultLimit?: number;
982
848
  };
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;
849
+ }
850
+ //#endregion
851
+ //#region ../core/src/exhaustivePagination/pagePaginationConfig.d.ts
852
+ interface PagePaginationConfig extends BasePaginationConfig {
853
+ type: 'page';
854
+ iterator: {
855
+ pageKey: string;
856
+ pageSizeKey?: string;
857
+ in: IteratorLocation;
858
+ startPage?: number;
859
+ defaultPageSize?: number;
860
+ };
861
+ }
862
+ //#endregion
863
+ //#region ../core/src/exhaustivePagination/index.d.ts
864
+ type PaginationConfig = CursorPaginationConfig | OffsetPaginationConfig | PagePaginationConfig;
865
+ //#endregion
866
+ //#region ../core/src/schema/types.d.ts
867
+ type Schema = {
868
+ name: string;
869
+ key: string;
870
+ version: string;
871
+ description?: string;
993
872
  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;
873
+ fields: {
874
+ [name: string]: SchemaField;
1013
875
  };
1014
876
  };
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;
877
+ type SchemaField = {
878
+ name: string;
1024
879
  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
- };
880
+ required: boolean;
881
+ description?: string;
1060
882
  };
1061
883
  //#endregion
884
+ //#region ../core/src/stepFunctions/stepFunctionsList.d.ts
885
+ declare enum StepFunctionName {
886
+ TYPECAST = "typecast",
887
+ MAP_FIELDS = "map_fields",
888
+ GROUP_DATA = "group_data",
889
+ REQUEST = "request",
890
+ PAGINATED_REQUEST = "paginated_request",
891
+ SOAP_REQUEST = "soap_request",
892
+ SOAP_PAGINATED_REQUEST = "soap_paginated_request",
893
+ STATIC_VALUES = "static_values",
894
+ UPLOAD_FILE = "upload_file",
895
+ UPLOAD_BINARY = "upload_binary",
896
+ DOWNLOAD_FILE = "download_file",
897
+ EMIT_EVENT = "emit_event",
898
+ }
899
+ //#endregion
1062
900
  //#region ../core/src/stepFunctions/types.d.ts
1063
901
  type StepFunction = ({
1064
902
  block,
@@ -1417,6 +1255,170 @@ type Authentication = {
1417
1255
  };
1418
1256
  };
1419
1257
  //#endregion
1258
+ //#region ../core/src/cursor/types.d.ts
1259
+ type Position = {
1260
+ pageNumber?: number | null;
1261
+ providerPageCursor?: string | null;
1262
+ position?: number | null;
1263
+ };
1264
+ type Cursor = {
1265
+ remote: Record<number, Position>;
1266
+ version: number;
1267
+ timestamp: number;
1268
+ };
1269
+ //#endregion
1270
+ //#region ../core/src/settings/types.d.ts
1271
+ type Settings = {
1272
+ olap: OlapSettings;
1273
+ defender?: DefenderSettings;
1274
+ };
1275
+ type OlapSettings = {
1276
+ logs?: {
1277
+ enabled: boolean;
1278
+ };
1279
+ advanced?: {
1280
+ enabled?: boolean;
1281
+ ttl?: number;
1282
+ errorsOnly?: boolean;
1283
+ includeBackground?: boolean;
1284
+ };
1285
+ };
1286
+ type DefenderSettings = {
1287
+ enabled: boolean;
1288
+ blockHighRisk?: boolean;
1289
+ highRiskThreshold?: number;
1290
+ mediumRiskThreshold?: number;
1291
+ useTier1Classification?: boolean;
1292
+ useTier2Classification?: boolean;
1293
+ largeResponseBehavior?: 'skip' | 'block' | 'scan_anyway';
1294
+ maxResponseSize?: number;
1295
+ maxResponseWords?: number;
1296
+ tier2Fields?: string[];
1297
+ useSfe?: boolean;
1298
+ annotateBoundary?: boolean;
1299
+ };
1300
+ //#endregion
1301
+ //#region ../core/src/source/types.d.ts
1302
+ type Source = {
1303
+ sourceType?: string;
1304
+ sourceId?: string;
1305
+ sourceValue?: string;
1306
+ };
1307
+ //#endregion
1308
+ //#region ../core/src/blocks/types.d.ts
1309
+ type Block = {
1310
+ inputs?: {
1311
+ [key: string]: unknown;
1312
+ };
1313
+ connector?: Connector;
1314
+ context: BlockContext;
1315
+ debug?: DebugParams;
1316
+ steps?: StepsSnapshots;
1317
+ intermediateSteps?: IntermediateStepsSnapshots;
1318
+ httpClient?: IHttpClient;
1319
+ olapClient?: IOlapClient;
1320
+ emitEvent?: (event: EventToEmit) => Promise<void>;
1321
+ settings?: Settings;
1322
+ logger?: ILogger;
1323
+ action?: Action;
1324
+ credentials?: Credentials;
1325
+ scopes?: string[];
1326
+ outputs?: unknown;
1327
+ streamOutput?: StreamOutputData;
1328
+ nextCursor?: Cursor | null;
1329
+ response?: {
1330
+ statusCode: number;
1331
+ successful: boolean;
1332
+ message?: string;
1333
+ };
1334
+ statistics?: BlockStatistics;
1335
+ defenderMetadata?: DefenderMetadata;
1336
+ iterator?: {
1337
+ item: unknown;
1338
+ index: number;
1339
+ current?: unknown;
1340
+ };
1341
+ fieldConfigs?: FieldConfig[];
1342
+ result?: BlockIndexedRecord[] | BlockIndexedRecord;
1343
+ };
1344
+ type FlowType = 'action' | 'refresh_authentication' | 'test_action';
1345
+ type BlockContext = {
1346
+ organizationId?: string;
1347
+ projectSecureId: string;
1348
+ accountSecureId: string;
1349
+ connectorKey: string;
1350
+ connectorVersion: string;
1351
+ connectorOwner?: string;
1352
+ category: Category;
1353
+ schema?: string;
1354
+ actionType: ActionType;
1355
+ authenticationType: string;
1356
+ environment: string;
1357
+ actionRunId?: string;
1358
+ originOwnerId?: string;
1359
+ originOwnerName?: string;
1360
+ source?: Source;
1361
+ flowType?: FlowType;
1362
+ service: string;
1363
+ resource: string;
1364
+ subResource?: string;
1365
+ childResource?: string;
1366
+ };
1367
+ type BlockIndexedRecord = {
1368
+ id: string;
1369
+ remote_id?: string;
1370
+ [key: string]: unknown;
1371
+ unified_custom_fields?: {
1372
+ [key: string]: unknown;
1373
+ };
1374
+ };
1375
+ type EnumMatcherExpression = {
1376
+ matchExpression: string;
1377
+ value: string;
1378
+ };
1379
+ type FieldConfig = {
1380
+ expression?: string;
1381
+ values?: unknown;
1382
+ targetFieldKey: string;
1383
+ alias?: string;
1384
+ type: string;
1385
+ custom: boolean;
1386
+ hidden: boolean;
1387
+ array: boolean;
1388
+ enumMapper?: {
1389
+ matcher: string | EnumMatcherExpression[];
1390
+ };
1391
+ properties?: FieldConfig[];
1392
+ requiredScopes?: string[];
1393
+ };
1394
+ type DebugParams = {
1395
+ custom_mappings?: 'disabled' | 'enabled';
1396
+ };
1397
+ type Credentials = Record<string, unknown>;
1398
+ type BlockStatistics = {
1399
+ startTime?: Date;
1400
+ endTime?: Date;
1401
+ };
1402
+ type DefenderMetadata = {
1403
+ applied: boolean;
1404
+ result?: {
1405
+ allowed: boolean;
1406
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
1407
+ fieldsSanitized: string[];
1408
+ patternsByField: Record<string, string[]>;
1409
+ detections: string[];
1410
+ tier2Score?: number;
1411
+ tier2SkipReason?: string;
1412
+ latencyMs: number;
1413
+ };
1414
+ skipped?: {
1415
+ reason: 'streaming' | 'size_limit' | 'disabled' | 'error';
1416
+ estimatedSize?: number;
1417
+ threshold?: number;
1418
+ error?: string;
1419
+ };
1420
+ };
1421
+ //#endregion
1420
1422
  //#region ../core/src/stepFunctions/factory.d.ts
1421
1423
  declare const StepFunctionsFactory: {
1422
1424
  build({
@@ -1667,7 +1669,8 @@ declare const createBlockContext: ({
1667
1669
  originOwnerName,
1668
1670
  sourceType,
1669
1671
  sourceId,
1670
- sourceValue
1672
+ sourceValue,
1673
+ flowType
1671
1674
  }: {
1672
1675
  category: Category;
1673
1676
  connectorKey: string;
@@ -1684,6 +1687,7 @@ declare const createBlockContext: ({
1684
1687
  sourceType?: string;
1685
1688
  sourceId?: string;
1686
1689
  sourceValue?: string;
1690
+ flowType?: FlowType;
1687
1691
  }) => BlockContext;
1688
1692
  //#endregion
1689
1693
  //#region src/connectors/testActions.d.ts