@stackone/connect-sdk 3.1.1 → 3.2.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 +2 -2
- package/dist/index.d.cts +22 -11
- package/dist/index.d.mts +22 -11
- package/dist/index.mjs +3 -3
- 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, LevelPolicies,
|
|
6
|
+
import { ArgumentValue, CedarEvaluator, 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,6 @@ type ActionPolicy = {
|
|
|
5351
5369
|
client?: string;
|
|
5352
5370
|
toolName?: string;
|
|
5353
5371
|
};
|
|
5354
|
-
type PolicyOutcome = {
|
|
5355
|
-
decision: 'allow';
|
|
5356
|
-
} | {
|
|
5357
|
-
decision: 'deny';
|
|
5358
|
-
level: PolicyLevel;
|
|
5359
|
-
policyIds: string[];
|
|
5360
|
-
};
|
|
5361
5372
|
declare const decideInvokeTool: (input: {
|
|
5362
5373
|
policy: ActionPolicy;
|
|
5363
5374
|
account: Account;
|
|
@@ -5367,7 +5378,7 @@ declare const decideInvokeTool: (input: {
|
|
|
5367
5378
|
args?: Record<string, ArgumentValue>;
|
|
5368
5379
|
logger?: ILogger;
|
|
5369
5380
|
evaluator?: CedarEvaluator;
|
|
5370
|
-
}) => Promise<
|
|
5381
|
+
}) => Promise<ToolDecision>;
|
|
5371
5382
|
//#endregion
|
|
5372
5383
|
//#region src/runners/evaluateEventExtractionAction.d.ts
|
|
5373
5384
|
declare const evaluateExternalAccountIdExtractorByConnector: (connector: Connector, context: {
|
|
@@ -5754,4 +5765,4 @@ declare const runWebhookSetupPhase: ({
|
|
|
5754
5765
|
runStepActionFn?: typeof runStepAction;
|
|
5755
5766
|
}) => Promise<WebhookSetupPhaseResult>;
|
|
5756
5767
|
//#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
|
|
5768
|
+
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, LevelPolicies,
|
|
5
|
+
import { ArgumentValue, CedarEvaluator, 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,6 @@ type ActionPolicy = {
|
|
|
5350
5368
|
client?: string;
|
|
5351
5369
|
toolName?: string;
|
|
5352
5370
|
};
|
|
5353
|
-
type PolicyOutcome = {
|
|
5354
|
-
decision: 'allow';
|
|
5355
|
-
} | {
|
|
5356
|
-
decision: 'deny';
|
|
5357
|
-
level: PolicyLevel;
|
|
5358
|
-
policyIds: string[];
|
|
5359
|
-
};
|
|
5360
5371
|
declare const decideInvokeTool: (input: {
|
|
5361
5372
|
policy: ActionPolicy;
|
|
5362
5373
|
account: Account;
|
|
@@ -5366,7 +5377,7 @@ declare const decideInvokeTool: (input: {
|
|
|
5366
5377
|
args?: Record<string, ArgumentValue>;
|
|
5367
5378
|
logger?: ILogger;
|
|
5368
5379
|
evaluator?: CedarEvaluator;
|
|
5369
|
-
}) => Promise<
|
|
5380
|
+
}) => Promise<ToolDecision>;
|
|
5370
5381
|
//#endregion
|
|
5371
5382
|
//#region src/runners/evaluateEventExtractionAction.d.ts
|
|
5372
5383
|
declare const evaluateExternalAccountIdExtractorByConnector: (connector: Connector, context: {
|
|
@@ -5753,4 +5764,4 @@ declare const runWebhookSetupPhase: ({
|
|
|
5753
5764
|
runStepActionFn?: typeof runStepAction;
|
|
5754
5765
|
}) => Promise<WebhookSetupPhaseResult>;
|
|
5755
5766
|
//#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
|
|
5767
|
+
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 };
|