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