@stackone/connect-sdk 1.33.0 → 1.35.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.
@@ -0,0 +1,143 @@
1
+ import { HttpMethod, IHttpClient } from "@stackone/transport";
2
+ import { Account, Block, BlockContext, Category, Connector, Cursor, Operation, Step, StepFunctionName, StepFunctionParams, StepFunctionsFactory } from "@stackone/core";
3
+ import { ILogger } from "@stackone/logger";
4
+
5
+ //#region src/blocks/createBlock.d.ts
6
+ declare const createBlock: ({
7
+ inputs,
8
+ context,
9
+ operation,
10
+ credentials,
11
+ nextCursor,
12
+ logger,
13
+ getHttpClient
14
+ }: {
15
+ inputs?: Record<string, unknown>;
16
+ context: BlockContext;
17
+ operation: Operation;
18
+ credentials?: Record<string, unknown>;
19
+ nextCursor?: Cursor;
20
+ logger?: ILogger;
21
+ getHttpClient?: () => Promise<IHttpClient>;
22
+ }) => Promise<Block>;
23
+ //#endregion
24
+ //#region src/connectors/operations.d.ts
25
+ declare const getOperationFromUrl: (connector: Connector, url: string, method: HttpMethod) => {
26
+ operation: Operation;
27
+ params: Partial<Record<string, string | string[]>>;
28
+ } | undefined;
29
+ //#endregion
30
+ //#region src/connectors/parsers.d.ts
31
+ declare function parseYamlConnector(yamlFileContents: string): Connector;
32
+ declare const parseOperationInputs: (operation: Operation, inputs: unknown) => Record<string, unknown>;
33
+ //#endregion
34
+ //#region src/errors/types.d.ts
35
+ type ErrorType = 'CONNECTOR_PARSE_ERROR' | 'MISSING_OPERATION_ERROR' | 'INVALID_OPERATION_INPUTS_ERROR' | 'INVALID_CURSOR_ERROR';
36
+ //#endregion
37
+ //#region src/errors/connectSDKErrors.d.ts
38
+ declare class ConnectSDKError extends Error {
39
+ readonly errorType: ErrorType;
40
+ readonly context: BlockContext;
41
+ constructor(errorType: ErrorType, context: BlockContext, message?: string);
42
+ toString(): string;
43
+ }
44
+ //#endregion
45
+ //#region src/runners/executeStepFunctions.d.ts
46
+ declare const executeStepFunction: ({
47
+ block,
48
+ stepFunctionName,
49
+ params,
50
+ buildStepFunction
51
+ }: {
52
+ block: Block;
53
+ stepFunctionName: StepFunctionName;
54
+ params?: StepFunctionParams;
55
+ buildStepFunction?: typeof StepFunctionsFactory.build;
56
+ }) => Promise<Block>;
57
+ //#endregion
58
+ //#region src/blocks/createBlockContext.d.ts
59
+ declare const createBlockContext: ({
60
+ category,
61
+ connectorKey,
62
+ connectorVersion,
63
+ authConfigKey,
64
+ environment,
65
+ operation,
66
+ accountSecureId,
67
+ projectSecureId
68
+ }: {
69
+ category: Category;
70
+ connectorKey: string;
71
+ connectorVersion: string;
72
+ authConfigKey: string;
73
+ environment?: string;
74
+ operation?: Operation;
75
+ accountSecureId: string;
76
+ projectSecureId: string;
77
+ }) => BlockContext;
78
+ //#endregion
79
+ //#region src/compositeIds/inputs.d.ts
80
+ declare const decodeInputCompositeIdentifiers: (block: Block) => Block;
81
+ //#endregion
82
+ //#region src/compositeIds/outputs.d.ts
83
+ declare const encodeResultCompositeIdentifiers: (block: Block) => Block;
84
+ //#endregion
85
+ //#region src/pagination/virtualPagination.d.ts
86
+ declare const virtualPaginateResult: (result: unknown, pageSize: number, steps: {
87
+ [stepId: string]: Step;
88
+ }, cursor?: Cursor | null) => {
89
+ result: unknown;
90
+ next: string | null;
91
+ };
92
+ //#endregion
93
+ //#region src/runners/runStepOperation.d.ts
94
+ declare const runStepOperation: ({
95
+ block,
96
+ buildStepFunction,
97
+ virtualPaginateResultFn,
98
+ encodeResultCompositeIds,
99
+ decodeInputCompositeIds
100
+ }: {
101
+ block: Block;
102
+ buildStepFunction?: typeof StepFunctionsFactory.build;
103
+ virtualPaginateResultFn?: typeof virtualPaginateResult;
104
+ decodeInputCompositeIds?: typeof decodeInputCompositeIdentifiers;
105
+ encodeResultCompositeIds?: typeof encodeResultCompositeIdentifiers;
106
+ }) => Promise<Block>;
107
+ //#endregion
108
+ //#region src/runners/runConnectorOperation.d.ts
109
+ declare const runConnectorOperation: ({
110
+ account,
111
+ connector,
112
+ category,
113
+ path,
114
+ method,
115
+ queryParams,
116
+ body,
117
+ headers,
118
+ logger,
119
+ parseConnector,
120
+ getOperationFromUrlFn,
121
+ parseOperationInputsFn,
122
+ createBlockContextFn,
123
+ createBlockFn,
124
+ runStepOperationFn
125
+ }: {
126
+ account: Account;
127
+ connector: Connector | string;
128
+ category: Category;
129
+ path: string;
130
+ method?: HttpMethod;
131
+ queryParams: unknown;
132
+ body?: unknown;
133
+ headers?: Record<string, string>;
134
+ logger?: ILogger;
135
+ parseConnector?: typeof parseYamlConnector;
136
+ getOperationFromUrlFn?: typeof getOperationFromUrl;
137
+ parseOperationInputsFn?: typeof parseOperationInputs;
138
+ createBlockContextFn?: typeof createBlockContext;
139
+ createBlockFn?: typeof createBlock;
140
+ runStepOperationFn?: typeof runStepOperation;
141
+ }) => Promise<Block>;
142
+ //#endregion
143
+ export { ConnectSDKError, ErrorType, createBlock, executeStepFunction, getOperationFromUrl, parseOperationInputs, parseYamlConnector, runConnectorOperation, runStepOperation };
@@ -0,0 +1,143 @@
1
+ import { Account, Block, BlockContext, Category, Connector, Cursor, Operation, Step, StepFunctionName, StepFunctionParams, StepFunctionsFactory } from "@stackone/core";
2
+ import { ILogger } from "@stackone/logger";
3
+ import { HttpMethod, IHttpClient } from "@stackone/transport";
4
+
5
+ //#region src/blocks/createBlock.d.ts
6
+ declare const createBlock: ({
7
+ inputs,
8
+ context,
9
+ operation,
10
+ credentials,
11
+ nextCursor,
12
+ logger,
13
+ getHttpClient
14
+ }: {
15
+ inputs?: Record<string, unknown>;
16
+ context: BlockContext;
17
+ operation: Operation;
18
+ credentials?: Record<string, unknown>;
19
+ nextCursor?: Cursor;
20
+ logger?: ILogger;
21
+ getHttpClient?: () => Promise<IHttpClient>;
22
+ }) => Promise<Block>;
23
+ //#endregion
24
+ //#region src/connectors/operations.d.ts
25
+ declare const getOperationFromUrl: (connector: Connector, url: string, method: HttpMethod) => {
26
+ operation: Operation;
27
+ params: Partial<Record<string, string | string[]>>;
28
+ } | undefined;
29
+ //#endregion
30
+ //#region src/connectors/parsers.d.ts
31
+ declare function parseYamlConnector(yamlFileContents: string): Connector;
32
+ declare const parseOperationInputs: (operation: Operation, inputs: unknown) => Record<string, unknown>;
33
+ //#endregion
34
+ //#region src/errors/types.d.ts
35
+ type ErrorType = 'CONNECTOR_PARSE_ERROR' | 'MISSING_OPERATION_ERROR' | 'INVALID_OPERATION_INPUTS_ERROR' | 'INVALID_CURSOR_ERROR';
36
+ //#endregion
37
+ //#region src/errors/connectSDKErrors.d.ts
38
+ declare class ConnectSDKError extends Error {
39
+ readonly errorType: ErrorType;
40
+ readonly context: BlockContext;
41
+ constructor(errorType: ErrorType, context: BlockContext, message?: string);
42
+ toString(): string;
43
+ }
44
+ //#endregion
45
+ //#region src/runners/executeStepFunctions.d.ts
46
+ declare const executeStepFunction: ({
47
+ block,
48
+ stepFunctionName,
49
+ params,
50
+ buildStepFunction
51
+ }: {
52
+ block: Block;
53
+ stepFunctionName: StepFunctionName;
54
+ params?: StepFunctionParams;
55
+ buildStepFunction?: typeof StepFunctionsFactory.build;
56
+ }) => Promise<Block>;
57
+ //#endregion
58
+ //#region src/blocks/createBlockContext.d.ts
59
+ declare const createBlockContext: ({
60
+ category,
61
+ connectorKey,
62
+ connectorVersion,
63
+ authConfigKey,
64
+ environment,
65
+ operation,
66
+ accountSecureId,
67
+ projectSecureId
68
+ }: {
69
+ category: Category;
70
+ connectorKey: string;
71
+ connectorVersion: string;
72
+ authConfigKey: string;
73
+ environment?: string;
74
+ operation?: Operation;
75
+ accountSecureId: string;
76
+ projectSecureId: string;
77
+ }) => BlockContext;
78
+ //#endregion
79
+ //#region src/compositeIds/inputs.d.ts
80
+ declare const decodeInputCompositeIdentifiers: (block: Block) => Block;
81
+ //#endregion
82
+ //#region src/compositeIds/outputs.d.ts
83
+ declare const encodeResultCompositeIdentifiers: (block: Block) => Block;
84
+ //#endregion
85
+ //#region src/pagination/virtualPagination.d.ts
86
+ declare const virtualPaginateResult: (result: unknown, pageSize: number, steps: {
87
+ [stepId: string]: Step;
88
+ }, cursor?: Cursor | null) => {
89
+ result: unknown;
90
+ next: string | null;
91
+ };
92
+ //#endregion
93
+ //#region src/runners/runStepOperation.d.ts
94
+ declare const runStepOperation: ({
95
+ block,
96
+ buildStepFunction,
97
+ virtualPaginateResultFn,
98
+ encodeResultCompositeIds,
99
+ decodeInputCompositeIds
100
+ }: {
101
+ block: Block;
102
+ buildStepFunction?: typeof StepFunctionsFactory.build;
103
+ virtualPaginateResultFn?: typeof virtualPaginateResult;
104
+ decodeInputCompositeIds?: typeof decodeInputCompositeIdentifiers;
105
+ encodeResultCompositeIds?: typeof encodeResultCompositeIdentifiers;
106
+ }) => Promise<Block>;
107
+ //#endregion
108
+ //#region src/runners/runConnectorOperation.d.ts
109
+ declare const runConnectorOperation: ({
110
+ account,
111
+ connector,
112
+ category,
113
+ path,
114
+ method,
115
+ queryParams,
116
+ body,
117
+ headers,
118
+ logger,
119
+ parseConnector,
120
+ getOperationFromUrlFn,
121
+ parseOperationInputsFn,
122
+ createBlockContextFn,
123
+ createBlockFn,
124
+ runStepOperationFn
125
+ }: {
126
+ account: Account;
127
+ connector: Connector | string;
128
+ category: Category;
129
+ path: string;
130
+ method?: HttpMethod;
131
+ queryParams: unknown;
132
+ body?: unknown;
133
+ headers?: Record<string, string>;
134
+ logger?: ILogger;
135
+ parseConnector?: typeof parseYamlConnector;
136
+ getOperationFromUrlFn?: typeof getOperationFromUrl;
137
+ parseOperationInputsFn?: typeof parseOperationInputs;
138
+ createBlockContextFn?: typeof createBlockContext;
139
+ createBlockFn?: typeof createBlock;
140
+ runStepOperationFn?: typeof runStepOperation;
141
+ }) => Promise<Block>;
142
+ //#endregion
143
+ export { ConnectSDKError, ErrorType, createBlock, executeStepFunction, getOperationFromUrl, parseOperationInputs, parseYamlConnector, runConnectorOperation, runStepOperation };