@stackone/connect-sdk 3.1.1 → 3.3.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.cjs +6 -6
- package/dist/index.d.cts +33 -11
- package/dist/index.d.mts +33 -11
- package/dist/index.mjs +6 -6
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import { ILogger } from "@stackone/logger";
|
|
|
3
3
|
import { IOlapClient } from "@stackone/olap";
|
|
4
4
|
import { HttpMethod, IHttpClient, IMcpClient, McpClientConfig, McpServerProber, McpToolDefinition } from "@stackone/transport";
|
|
5
5
|
import { z } from "@stackone/utils";
|
|
6
|
-
import { ArgumentValue, CedarEvaluator,
|
|
6
|
+
import { ArgumentValue, CedarEvaluator, FieldDecisions, LevelPolicies, PrincipalRef, ToolDecision } from "@stackone/policy";
|
|
7
7
|
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
9
9
|
//#endregion
|
|
@@ -106,7 +106,7 @@ declare const isConnectorReleased: (connector: Connector, allowedStages?: string
|
|
|
106
106
|
declare const applyReleaseStageToConnector: (connector: Connector, allowedStages?: string[]) => Connector | undefined;
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/errors/types.d.ts
|
|
109
|
-
type ErrorType = 'CONNECTOR_PARSE_ERROR' | 'MISSING_ACTION_ERROR' | 'INCOMPATIBLE_AUTH_TYPE_ERROR' | 'INVALID_ACTION_INPUTS_ERROR' | 'INVALID_CURSOR_ERROR' | 'INVALID_EVENT_OUTPUT_ERROR' | 'POLICY_DENIED_ERROR';
|
|
109
|
+
type ErrorType = 'CONNECTOR_PARSE_ERROR' | 'MISSING_ACTION_ERROR' | 'INCOMPATIBLE_AUTH_TYPE_ERROR' | 'INVALID_ACTION_INPUTS_ERROR' | 'INVALID_CURSOR_ERROR' | 'INVALID_EVENT_OUTPUT_ERROR' | 'POLICY_DENIED_ERROR' | 'POLICY_EVALUATION_ERROR' | 'POLICY_PREPARSE_ERROR';
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/errors/connectSDKErrors.d.ts
|
|
112
112
|
type InputValidationError = {
|
|
@@ -140,6 +140,15 @@ declare class PolicyDeniedError extends ConnectSDKError {
|
|
|
140
140
|
policyIds: string[];
|
|
141
141
|
}, message?: string);
|
|
142
142
|
}
|
|
143
|
+
declare class PolicyEvaluationError extends ConnectSDKError {
|
|
144
|
+
readonly level: string;
|
|
145
|
+
constructor(context: BlockContext, details: {
|
|
146
|
+
level: string;
|
|
147
|
+
}, message?: string);
|
|
148
|
+
}
|
|
149
|
+
declare class PolicyPreparseError extends ConnectSDKError {
|
|
150
|
+
constructor(context: BlockContext, message?: string);
|
|
151
|
+
}
|
|
143
152
|
//#endregion
|
|
144
153
|
//#region src/connectors/responses.d.ts
|
|
145
154
|
type ValidationErrorResponse = {
|
|
@@ -5089,6 +5098,15 @@ declare const validateYamlConnector: (yamlFileContents: string) => {
|
|
|
5089
5098
|
connector?: Connector;
|
|
5090
5099
|
};
|
|
5091
5100
|
//#endregion
|
|
5101
|
+
//#region src/errors/policyStatus.d.ts
|
|
5102
|
+
declare const POLICY_ERROR_STATUS: {
|
|
5103
|
+
readonly POLICY_DENIED_ERROR: 403;
|
|
5104
|
+
readonly POLICY_EVALUATION_ERROR: 503;
|
|
5105
|
+
readonly POLICY_PREPARSE_ERROR: 500;
|
|
5106
|
+
};
|
|
5107
|
+
type PolicyErrorType = keyof typeof POLICY_ERROR_STATUS;
|
|
5108
|
+
declare const isPolicyErrorType: (errorType: ErrorType) => errorType is PolicyErrorType;
|
|
5109
|
+
//#endregion
|
|
5092
5110
|
//#region src/exhaustivePagination/types.d.ts
|
|
5093
5111
|
type CallAction = (inputs: Record<string, unknown>) => Promise<Block>;
|
|
5094
5112
|
interface Paginator {
|
|
@@ -5351,13 +5369,16 @@ type ActionPolicy = {
|
|
|
5351
5369
|
client?: string;
|
|
5352
5370
|
toolName?: string;
|
|
5353
5371
|
};
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5372
|
+
declare const decideReadFields: (input: {
|
|
5373
|
+
policy: ActionPolicy;
|
|
5374
|
+
account: Account;
|
|
5375
|
+
action: Pick<Action, "id" | "categories">;
|
|
5376
|
+
paths: string[];
|
|
5377
|
+
authType?: AuthType;
|
|
5378
|
+
sessionId?: string;
|
|
5379
|
+
logger?: ILogger;
|
|
5380
|
+
evaluator?: CedarEvaluator;
|
|
5381
|
+
}) => Promise<FieldDecisions>;
|
|
5361
5382
|
declare const decideInvokeTool: (input: {
|
|
5362
5383
|
policy: ActionPolicy;
|
|
5363
5384
|
account: Account;
|
|
@@ -5367,7 +5388,7 @@ declare const decideInvokeTool: (input: {
|
|
|
5367
5388
|
args?: Record<string, ArgumentValue>;
|
|
5368
5389
|
logger?: ILogger;
|
|
5369
5390
|
evaluator?: CedarEvaluator;
|
|
5370
|
-
}) => Promise<
|
|
5391
|
+
}) => Promise<ToolDecision>;
|
|
5371
5392
|
//#endregion
|
|
5372
5393
|
//#region src/runners/evaluateEventExtractionAction.d.ts
|
|
5373
5394
|
declare const evaluateExternalAccountIdExtractorByConnector: (connector: Connector, context: {
|
|
@@ -5494,6 +5515,7 @@ type BaseRunActionParams = {
|
|
|
5494
5515
|
policy?: ActionPolicy;
|
|
5495
5516
|
logger?: ILogger;
|
|
5496
5517
|
decideInvokeToolFn?: typeof decideInvokeTool;
|
|
5518
|
+
decideReadFieldsFn?: typeof decideReadFields;
|
|
5497
5519
|
parseConnector?: typeof parseYamlConnector;
|
|
5498
5520
|
parseActionInputsFn?: typeof parseActionInputs;
|
|
5499
5521
|
createBlockContextFn?: typeof createBlockContext;
|
|
@@ -5754,4 +5776,4 @@ declare const runWebhookSetupPhase: ({
|
|
|
5754
5776
|
runStepActionFn?: typeof runStepAction;
|
|
5755
5777
|
}) => Promise<WebhookSetupPhaseResult>;
|
|
5756
5778
|
//#endregion
|
|
5757
|
-
export { ACTION_SCHEMA, type ActionMetaAuthenticationConfig, type ActionPolicy, CATEGORY_ACRONYMS, CONNECTOR_YAML_SCHEMA, type CallAction, type CompleteMcpConnectorOptions, type CompletedMcpConnector, ConnectSDKError, type ConnectorMeta, type ConnectorMetaEvent, type ConnectorMetaSummary, type CreatePaginatorOptions, DEFAULT_TIME_FILTER_SAFETY_BUFFER_SECONDS, DELTA_TOKEN_INCREMENTAL_SCHEMA, type EnabledActionsConfig, type ErrorType, type GenerateMcpConnectorInput, type GeneratedMcpConnector, INCREMENTAL_SCHEMA, IncompatibleAuthTypeError, type IncrementalStrategy, type InputValidationError, InvalidActionInputsError, InvalidEventOutputError, type PaginateOptions, type PaginateResult, type PaginationProgress, type Paginator, PolicyDeniedError, type
|
|
5779
|
+
export { ACTION_SCHEMA, type ActionMetaAuthenticationConfig, type ActionPolicy, CATEGORY_ACRONYMS, CONNECTOR_YAML_SCHEMA, type CallAction, type CompleteMcpConnectorOptions, type CompletedMcpConnector, ConnectSDKError, type ConnectorMeta, type ConnectorMetaEvent, type ConnectorMetaSummary, type CreatePaginatorOptions, DEFAULT_TIME_FILTER_SAFETY_BUFFER_SECONDS, DELTA_TOKEN_INCREMENTAL_SCHEMA, type EnabledActionsConfig, type ErrorType, type GenerateMcpConnectorInput, type GeneratedMcpConnector, INCREMENTAL_SCHEMA, IncompatibleAuthTypeError, type IncrementalStrategy, type InputValidationError, InvalidActionInputsError, InvalidEventOutputError, POLICY_ERROR_STATUS, type PaginateOptions, type PaginateResult, type PaginationProgress, type Paginator, PolicyDeniedError, type PolicyErrorType, PolicyEvaluationError, PolicyPreparseError, TIME_FILTER_INCREMENTAL_SCHEMA, type ValidationError, type ValidationErrorResponse, type WebhookSetupPhaseResult, addMcpToolActions, applyReleaseStageToConnector, completeMcpConnector, computeCredentialsVerifiedByAuth, createBlock, createCursorPaginator, createDeltaTokenStrategy, createIncrementalStrategy, createOffsetPaginator, createPagePaginator, createPaginator, createTimeFilterStrategy, decideInvokeTool, evaluateExternalAccountIdExtractorByConnector, executeStepFunction, extractItems, filterActionsByAuthType, formatValidationErrorResponse, generateMcpConnector, getActionAuthenticationMethods, getActionFromUrl, getActionMeta, getActionsMeta, getActionsMetaFromConnectors, getActionsMetaSummary, getActionsMetaSummaryFromConnectors, getRefreshTokenExpiresIn, getTokenExpiresIn, hasCatastrophicBacktrackingRisk, isConnectorReleased, isMcpConnector, isPolicyErrorType, loadConnector, paginate, parseActionInputs, parseYamlConnector, runAction, runConnectorActionById, runConnectorActionByPath, runEventActionById, runStepAction, runTestActions, runWebhookSetupPhase, supportsRefreshAuthentication, validateYamlConnector };
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { t as __name } from "./chunk-BhWHdk3m.mjs";
|
|
|
2
2
|
import { z } from "@stackone/utils";
|
|
3
3
|
import { HttpMethod, IHttpClient, IMcpClient, McpClientConfig, McpServerProber, McpToolDefinition } from "@stackone/transport";
|
|
4
4
|
import { Account, Action, ActionAnnotations, AuthType, AuthenticationConfig, AuthenticationField, AuthenticationNotice, Block, BlockContext, Category, Checkpoint, Connector, ConnectorDocumentation, Cursor, CursorPaginationConfig, DataSyncConfig, DeltaTokenIncrementalConfig, Effect, EventToEmit, FlowType, IncrementalConfig, Input, InputLocation, OffsetPaginationConfig, PagePaginationConfig, PaginationConfig, ReleaseStage, Settings, Source, SourceType, Step, StepFunctionName, StepFunctionParams, StepFunctionsFactory, StreamType, SupportConfig, TestActionConfig, TimeFilterIncrementalConfig, TransportType, WebhookSetupPhase, WebhookSetupPhaseKind } from "@stackone/core";
|
|
5
|
-
import { ArgumentValue, CedarEvaluator,
|
|
5
|
+
import { ArgumentValue, CedarEvaluator, FieldDecisions, LevelPolicies, PrincipalRef, ToolDecision } from "@stackone/policy";
|
|
6
6
|
import { IOlapClient } from "@stackone/olap";
|
|
7
7
|
import { ILogger } from "@stackone/logger";
|
|
8
8
|
|
|
@@ -105,7 +105,7 @@ declare const isConnectorReleased: (connector: Connector, allowedStages?: string
|
|
|
105
105
|
declare const applyReleaseStageToConnector: (connector: Connector, allowedStages?: string[]) => Connector | undefined;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/errors/types.d.ts
|
|
108
|
-
type ErrorType = 'CONNECTOR_PARSE_ERROR' | 'MISSING_ACTION_ERROR' | 'INCOMPATIBLE_AUTH_TYPE_ERROR' | 'INVALID_ACTION_INPUTS_ERROR' | 'INVALID_CURSOR_ERROR' | 'INVALID_EVENT_OUTPUT_ERROR' | 'POLICY_DENIED_ERROR';
|
|
108
|
+
type ErrorType = 'CONNECTOR_PARSE_ERROR' | 'MISSING_ACTION_ERROR' | 'INCOMPATIBLE_AUTH_TYPE_ERROR' | 'INVALID_ACTION_INPUTS_ERROR' | 'INVALID_CURSOR_ERROR' | 'INVALID_EVENT_OUTPUT_ERROR' | 'POLICY_DENIED_ERROR' | 'POLICY_EVALUATION_ERROR' | 'POLICY_PREPARSE_ERROR';
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/errors/connectSDKErrors.d.ts
|
|
111
111
|
type InputValidationError = {
|
|
@@ -139,6 +139,15 @@ declare class PolicyDeniedError extends ConnectSDKError {
|
|
|
139
139
|
policyIds: string[];
|
|
140
140
|
}, message?: string);
|
|
141
141
|
}
|
|
142
|
+
declare class PolicyEvaluationError extends ConnectSDKError {
|
|
143
|
+
readonly level: string;
|
|
144
|
+
constructor(context: BlockContext, details: {
|
|
145
|
+
level: string;
|
|
146
|
+
}, message?: string);
|
|
147
|
+
}
|
|
148
|
+
declare class PolicyPreparseError extends ConnectSDKError {
|
|
149
|
+
constructor(context: BlockContext, message?: string);
|
|
150
|
+
}
|
|
142
151
|
//#endregion
|
|
143
152
|
//#region src/connectors/responses.d.ts
|
|
144
153
|
type ValidationErrorResponse = {
|
|
@@ -5088,6 +5097,15 @@ declare const validateYamlConnector: (yamlFileContents: string) => {
|
|
|
5088
5097
|
connector?: Connector;
|
|
5089
5098
|
};
|
|
5090
5099
|
//#endregion
|
|
5100
|
+
//#region src/errors/policyStatus.d.ts
|
|
5101
|
+
declare const POLICY_ERROR_STATUS: {
|
|
5102
|
+
readonly POLICY_DENIED_ERROR: 403;
|
|
5103
|
+
readonly POLICY_EVALUATION_ERROR: 503;
|
|
5104
|
+
readonly POLICY_PREPARSE_ERROR: 500;
|
|
5105
|
+
};
|
|
5106
|
+
type PolicyErrorType = keyof typeof POLICY_ERROR_STATUS;
|
|
5107
|
+
declare const isPolicyErrorType: (errorType: ErrorType) => errorType is PolicyErrorType;
|
|
5108
|
+
//#endregion
|
|
5091
5109
|
//#region src/exhaustivePagination/types.d.ts
|
|
5092
5110
|
type CallAction = (inputs: Record<string, unknown>) => Promise<Block>;
|
|
5093
5111
|
interface Paginator {
|
|
@@ -5350,13 +5368,16 @@ type ActionPolicy = {
|
|
|
5350
5368
|
client?: string;
|
|
5351
5369
|
toolName?: string;
|
|
5352
5370
|
};
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5371
|
+
declare const decideReadFields: (input: {
|
|
5372
|
+
policy: ActionPolicy;
|
|
5373
|
+
account: Account;
|
|
5374
|
+
action: Pick<Action, "id" | "categories">;
|
|
5375
|
+
paths: string[];
|
|
5376
|
+
authType?: AuthType;
|
|
5377
|
+
sessionId?: string;
|
|
5378
|
+
logger?: ILogger;
|
|
5379
|
+
evaluator?: CedarEvaluator;
|
|
5380
|
+
}) => Promise<FieldDecisions>;
|
|
5360
5381
|
declare const decideInvokeTool: (input: {
|
|
5361
5382
|
policy: ActionPolicy;
|
|
5362
5383
|
account: Account;
|
|
@@ -5366,7 +5387,7 @@ declare const decideInvokeTool: (input: {
|
|
|
5366
5387
|
args?: Record<string, ArgumentValue>;
|
|
5367
5388
|
logger?: ILogger;
|
|
5368
5389
|
evaluator?: CedarEvaluator;
|
|
5369
|
-
}) => Promise<
|
|
5390
|
+
}) => Promise<ToolDecision>;
|
|
5370
5391
|
//#endregion
|
|
5371
5392
|
//#region src/runners/evaluateEventExtractionAction.d.ts
|
|
5372
5393
|
declare const evaluateExternalAccountIdExtractorByConnector: (connector: Connector, context: {
|
|
@@ -5493,6 +5514,7 @@ type BaseRunActionParams = {
|
|
|
5493
5514
|
policy?: ActionPolicy;
|
|
5494
5515
|
logger?: ILogger;
|
|
5495
5516
|
decideInvokeToolFn?: typeof decideInvokeTool;
|
|
5517
|
+
decideReadFieldsFn?: typeof decideReadFields;
|
|
5496
5518
|
parseConnector?: typeof parseYamlConnector;
|
|
5497
5519
|
parseActionInputsFn?: typeof parseActionInputs;
|
|
5498
5520
|
createBlockContextFn?: typeof createBlockContext;
|
|
@@ -5753,4 +5775,4 @@ declare const runWebhookSetupPhase: ({
|
|
|
5753
5775
|
runStepActionFn?: typeof runStepAction;
|
|
5754
5776
|
}) => Promise<WebhookSetupPhaseResult>;
|
|
5755
5777
|
//#endregion
|
|
5756
|
-
export { ACTION_SCHEMA, type ActionMetaAuthenticationConfig, type ActionPolicy, CATEGORY_ACRONYMS, CONNECTOR_YAML_SCHEMA, type CallAction, type CompleteMcpConnectorOptions, type CompletedMcpConnector, ConnectSDKError, type ConnectorMeta, type ConnectorMetaEvent, type ConnectorMetaSummary, type CreatePaginatorOptions, DEFAULT_TIME_FILTER_SAFETY_BUFFER_SECONDS, DELTA_TOKEN_INCREMENTAL_SCHEMA, type EnabledActionsConfig, type ErrorType, type GenerateMcpConnectorInput, type GeneratedMcpConnector, INCREMENTAL_SCHEMA, IncompatibleAuthTypeError, type IncrementalStrategy, type InputValidationError, InvalidActionInputsError, InvalidEventOutputError, type PaginateOptions, type PaginateResult, type PaginationProgress, type Paginator, PolicyDeniedError, type
|
|
5778
|
+
export { ACTION_SCHEMA, type ActionMetaAuthenticationConfig, type ActionPolicy, CATEGORY_ACRONYMS, CONNECTOR_YAML_SCHEMA, type CallAction, type CompleteMcpConnectorOptions, type CompletedMcpConnector, ConnectSDKError, type ConnectorMeta, type ConnectorMetaEvent, type ConnectorMetaSummary, type CreatePaginatorOptions, DEFAULT_TIME_FILTER_SAFETY_BUFFER_SECONDS, DELTA_TOKEN_INCREMENTAL_SCHEMA, type EnabledActionsConfig, type ErrorType, type GenerateMcpConnectorInput, type GeneratedMcpConnector, INCREMENTAL_SCHEMA, IncompatibleAuthTypeError, type IncrementalStrategy, type InputValidationError, InvalidActionInputsError, InvalidEventOutputError, POLICY_ERROR_STATUS, type PaginateOptions, type PaginateResult, type PaginationProgress, type Paginator, PolicyDeniedError, type PolicyErrorType, PolicyEvaluationError, PolicyPreparseError, TIME_FILTER_INCREMENTAL_SCHEMA, type ValidationError, type ValidationErrorResponse, type WebhookSetupPhaseResult, addMcpToolActions, applyReleaseStageToConnector, completeMcpConnector, computeCredentialsVerifiedByAuth, createBlock, createCursorPaginator, createDeltaTokenStrategy, createIncrementalStrategy, createOffsetPaginator, createPagePaginator, createPaginator, createTimeFilterStrategy, decideInvokeTool, evaluateExternalAccountIdExtractorByConnector, executeStepFunction, extractItems, filterActionsByAuthType, formatValidationErrorResponse, generateMcpConnector, getActionAuthenticationMethods, getActionFromUrl, getActionMeta, getActionsMeta, getActionsMetaFromConnectors, getActionsMetaSummary, getActionsMetaSummaryFromConnectors, getRefreshTokenExpiresIn, getTokenExpiresIn, hasCatastrophicBacktrackingRisk, isConnectorReleased, isMcpConnector, isPolicyErrorType, loadConnector, paginate, parseActionInputs, parseYamlConnector, runAction, runConnectorActionById, runConnectorActionByPath, runEventActionById, runStepAction, runTestActions, runWebhookSetupPhase, supportsRefreshAuthentication, validateYamlConnector };
|