@stackone/connect-sdk 2.60.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,40 +279,6 @@ type HmacSigningOptions = {
298
279
  };
299
280
  type SigningOptions = Aws4SigningOptions | HmacSigningOptions;
300
281
  //#endregion
301
- //#region ../core/src/schema/types.d.ts
302
- type Schema = {
303
- name: string;
304
- key: string;
305
- version: string;
306
- description?: string;
307
- category: Category;
308
- fields: {
309
- [name: string]: SchemaField;
310
- };
311
- };
312
- type SchemaField = {
313
- name: string;
314
- type: string;
315
- required: boolean;
316
- description?: string;
317
- };
318
- //#endregion
319
- //#region ../core/src/stepFunctions/stepFunctionsList.d.ts
320
- declare enum StepFunctionName {
321
- TYPECAST = "typecast",
322
- MAP_FIELDS = "map_fields",
323
- GROUP_DATA = "group_data",
324
- REQUEST = "request",
325
- PAGINATED_REQUEST = "paginated_request",
326
- SOAP_REQUEST = "soap_request",
327
- SOAP_PAGINATED_REQUEST = "soap_paginated_request",
328
- STATIC_VALUES = "static_values",
329
- UPLOAD_FILE = "upload_file",
330
- UPLOAD_BINARY = "upload_binary",
331
- DOWNLOAD_FILE = "download_file",
332
- EMIT_EVENT = "emit_event",
333
- }
334
- //#endregion
335
282
  //#region ../olap/src/olap/olapOptions.d.ts
336
283
  type OlapOptions = {
337
284
  logs?: LogsOptions;
@@ -848,168 +795,108 @@ type ProviderLog = ILog & {
848
795
  duration?: number;
849
796
  };
850
797
  //#endregion
851
- //#region ../core/src/cursor/types.d.ts
852
- type Position = {
853
- pageNumber?: number | null;
854
- providerPageCursor?: string | null;
855
- position?: number | null;
856
- };
857
- type Cursor = {
858
- remote: Record<number, Position>;
859
- version: number;
860
- timestamp: number;
861
- };
798
+ //#region ../core/src/categories/types.d.ts
799
+ type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage' | 'internal' | 'action';
862
800
  //#endregion
863
- //#region ../core/src/settings/types.d.ts
864
- type Settings = {
865
- olap: OlapSettings;
866
- defender?: DefenderSettings;
801
+ //#region ../core/src/compositeIds/types.d.ts
802
+ type ComponentConfig = {
803
+ name: string;
804
+ alias?: string;
867
805
  };
868
- type OlapSettings = {
869
- logs?: {
870
- enabled: boolean;
871
- };
872
- advanced?: {
873
- enabled?: boolean;
874
- ttl?: number;
875
- errorsOnly?: boolean;
876
- includeBackground?: boolean;
877
- };
806
+ type ComponentFieldConfig = {
807
+ targetFieldKey: string;
808
+ remote?: string;
809
+ components: ComponentConfig[];
878
810
  };
879
- type DefenderSettings = {
811
+ type CompositeIdentifierConnectorConfig = {
880
812
  enabled: boolean;
881
- blockHighRisk?: boolean;
882
- highRiskThreshold?: number;
883
- mediumRiskThreshold?: number;
884
- useTier1Classification?: boolean;
885
- useTier2Classification?: boolean;
886
- largeResponseBehavior?: 'skip' | 'block' | 'scan_anyway';
887
- maxResponseSize?: number;
888
- maxResponseWords?: number;
889
- tier2Fields?: string[];
890
- useSfe?: boolean;
891
- annotateBoundary?: boolean;
813
+ version?: number;
814
+ fields?: ComponentFieldConfig[];
892
815
  };
893
816
  //#endregion
894
- //#region ../core/src/source/types.d.ts
895
- type Source = {
896
- sourceType?: string;
897
- sourceId?: string;
898
- sourceValue?: string;
899
- };
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
+ }
900
826
  //#endregion
901
- //#region ../core/src/blocks/types.d.ts
902
- type Block = {
903
- inputs?: {
904
- [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;
905
833
  };
906
- connector?: Connector;
907
- context: BlockContext;
908
- debug?: DebugParams;
909
- steps?: StepsSnapshots;
910
- intermediateSteps?: IntermediateStepsSnapshots;
911
- httpClient?: IHttpClient;
912
- olapClient?: IOlapClient;
913
- emitEvent?: (event: EventToEmit) => Promise<void>;
914
- settings?: Settings;
915
- logger?: ILogger;
916
- action?: Action;
917
- credentials?: Credentials;
918
- scopes?: string[];
919
- outputs?: unknown;
920
- streamOutput?: StreamOutputData;
921
- nextCursor?: Cursor | null;
922
- response?: {
923
- statusCode: number;
924
- successful: boolean;
925
- message?: string;
834
+ iterator: {
835
+ key: string;
836
+ in: IteratorLocation;
926
837
  };
927
- statistics?: BlockStatistics;
928
- defenderMetadata?: DefenderMetadata;
929
- iterator?: {
930
- item: unknown;
931
- index: number;
932
- 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;
933
848
  };
934
- fieldConfigs?: FieldConfig[];
935
- result?: BlockIndexedRecord[] | BlockIndexedRecord;
936
- };
937
- type BlockContext = {
938
- organizationId?: string;
939
- projectSecureId: string;
940
- accountSecureId: string;
941
- connectorKey: string;
942
- connectorVersion: string;
943
- 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;
944
872
  category: Category;
945
- schema?: string;
946
- actionType: ActionType;
947
- authenticationType: string;
948
- environment: string;
949
- actionRunId?: string;
950
- originOwnerId?: string;
951
- originOwnerName?: string;
952
- source?: Source;
953
- service: string;
954
- resource: string;
955
- subResource?: string;
956
- childResource?: string;
957
- };
958
- type BlockIndexedRecord = {
959
- id: string;
960
- remote_id?: string;
961
- [key: string]: unknown;
962
- unified_custom_fields?: {
963
- [key: string]: unknown;
873
+ fields: {
874
+ [name: string]: SchemaField;
964
875
  };
965
876
  };
966
- type EnumMatcherExpression = {
967
- matchExpression: string;
968
- value: string;
969
- };
970
- type FieldConfig = {
971
- expression?: string;
972
- values?: unknown;
973
- targetFieldKey: string;
974
- alias?: string;
877
+ type SchemaField = {
878
+ name: string;
975
879
  type: string;
976
- custom: boolean;
977
- hidden: boolean;
978
- array: boolean;
979
- enumMapper?: {
980
- matcher: string | EnumMatcherExpression[];
981
- };
982
- properties?: FieldConfig[];
983
- requiredScopes?: string[];
984
- };
985
- type DebugParams = {
986
- custom_mappings?: 'disabled' | 'enabled';
987
- };
988
- type Credentials = Record<string, unknown>;
989
- type BlockStatistics = {
990
- startTime?: Date;
991
- endTime?: Date;
992
- };
993
- type DefenderMetadata = {
994
- applied: boolean;
995
- result?: {
996
- allowed: boolean;
997
- riskLevel: 'low' | 'medium' | 'high' | 'critical';
998
- fieldsSanitized: string[];
999
- patternsByField: Record<string, string[]>;
1000
- detections: string[];
1001
- tier2Score?: number;
1002
- tier2SkipReason?: string;
1003
- latencyMs: number;
1004
- };
1005
- skipped?: {
1006
- reason: 'streaming' | 'size_limit' | 'disabled' | 'error';
1007
- estimatedSize?: number;
1008
- threshold?: number;
1009
- error?: string;
1010
- };
880
+ required: boolean;
881
+ description?: string;
1011
882
  };
1012
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
1013
900
  //#region ../core/src/stepFunctions/types.d.ts
1014
901
  type StepFunction = ({
1015
902
  block,
@@ -1268,6 +1155,7 @@ type Action = {
1268
1155
  type DataSyncConfig = {
1269
1156
  allowed: boolean;
1270
1157
  indexField: string | string[];
1158
+ pagination?: PaginationConfig;
1271
1159
  };
1272
1160
  type ActionResponse = {
1273
1161
  statusCode: number;
@@ -1367,6 +1255,170 @@ type Authentication = {
1367
1255
  };
1368
1256
  };
1369
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
1370
1422
  //#region ../core/src/stepFunctions/factory.d.ts
1371
1423
  declare const StepFunctionsFactory: {
1372
1424
  build({
@@ -1617,7 +1669,8 @@ declare const createBlockContext: ({
1617
1669
  originOwnerName,
1618
1670
  sourceType,
1619
1671
  sourceId,
1620
- sourceValue
1672
+ sourceValue,
1673
+ flowType
1621
1674
  }: {
1622
1675
  category: Category;
1623
1676
  connectorKey: string;
@@ -1634,6 +1687,7 @@ declare const createBlockContext: ({
1634
1687
  sourceType?: string;
1635
1688
  sourceId?: string;
1636
1689
  sourceValue?: string;
1690
+ flowType?: FlowType;
1637
1691
  }) => BlockContext;
1638
1692
  //#endregion
1639
1693
  //#region src/connectors/testActions.d.ts