@stackone/connect-sdk 3.6.0 → 3.7.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 +3 -3
- package/dist/index.d.cts +36 -1
- package/dist/index.d.mts +36 -1
- package/dist/index.mjs +3 -3
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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";
|
|
2
2
|
import { ILogger } from "@stackone/logger";
|
|
3
|
-
import { IOlapClient } from "@stackone/olap";
|
|
3
|
+
import { IOlapClient, PolicyContext } from "@stackone/olap";
|
|
4
4
|
import { HttpMethod, IHttpClient, IMcpClient, McpClientConfig, McpServerProber, McpToolDefinition } from "@stackone/transport";
|
|
5
5
|
import { z } from "@stackone/utils";
|
|
6
6
|
import { ArgumentValue, CedarEvaluator, FieldDecisions, LevelPolicies, PrincipalRef, ToolDecision } from "@stackone/policy";
|
|
@@ -5369,6 +5369,13 @@ type ActionPolicy = {
|
|
|
5369
5369
|
client?: string;
|
|
5370
5370
|
toolName?: string;
|
|
5371
5371
|
};
|
|
5372
|
+
type PolicyCall = {
|
|
5373
|
+
actionRunId: string;
|
|
5374
|
+
actionId: string;
|
|
5375
|
+
accountSecureId: string;
|
|
5376
|
+
principal?: PrincipalRef;
|
|
5377
|
+
levels?: LevelPolicies[];
|
|
5378
|
+
};
|
|
5372
5379
|
declare const decideReadFields: (input: {
|
|
5373
5380
|
policy: ActionPolicy;
|
|
5374
5381
|
account: Account;
|
|
@@ -5525,6 +5532,7 @@ type BaseRunActionParams = {
|
|
|
5525
5532
|
getActionForRefreshAuthenticationFn?: typeof getActionForRefreshAuthentication;
|
|
5526
5533
|
getTestActionsFn?: typeof getTestActions;
|
|
5527
5534
|
applyDefenderFn?: typeof applyDefender;
|
|
5535
|
+
applyRedactionFn?: typeof applyRedactionToBlock;
|
|
5528
5536
|
getHttpClient: () => Promise<IHttpClient>;
|
|
5529
5537
|
getOlapClient?: () => Promise<IOlapClient>;
|
|
5530
5538
|
};
|
|
@@ -5559,17 +5567,44 @@ type RefreshAuthenticationMode = BaseRunActionParams & {
|
|
|
5559
5567
|
redirectUri?: string;
|
|
5560
5568
|
};
|
|
5561
5569
|
type RunActionParams = ActionIdMode | PathMode | TestActionsMode | RefreshAuthenticationMode;
|
|
5570
|
+
declare const applyRedactionToBlock: (block: Block, ask: Extract<ExecutedAction, {
|
|
5571
|
+
outcome: "ran";
|
|
5572
|
+
}>["readFields"], logger: ILogger | undefined) => Promise<{
|
|
5573
|
+
block: Block;
|
|
5574
|
+
redactedClasses: NonNullable<NonNullable<Block["policyMetadata"]>["redactedClasses"]>;
|
|
5575
|
+
}>;
|
|
5562
5576
|
declare const runAction: (params: RunActionParams) => Promise<Block>;
|
|
5577
|
+
type ExecutedAction = {
|
|
5578
|
+
outcome: 'ran';
|
|
5579
|
+
block: Block;
|
|
5580
|
+
policy?: PolicyContext;
|
|
5581
|
+
readFields?: {
|
|
5582
|
+
decision: ToolDecision;
|
|
5583
|
+
call: PolicyCall;
|
|
5584
|
+
policy: ActionPolicy;
|
|
5585
|
+
account: Account;
|
|
5586
|
+
action: Pick<Action, 'id' | 'categories'>;
|
|
5587
|
+
authType?: AuthType;
|
|
5588
|
+
sessionId?: string;
|
|
5589
|
+
decideReadFieldsFn?: typeof decideReadFields;
|
|
5590
|
+
};
|
|
5591
|
+
} | {
|
|
5592
|
+
outcome: 'refused';
|
|
5593
|
+
policy: PolicyContext;
|
|
5594
|
+
error: ConnectSDKError;
|
|
5595
|
+
};
|
|
5563
5596
|
declare const applyDefender: ({
|
|
5564
5597
|
outputs,
|
|
5565
5598
|
streamOutput,
|
|
5566
5599
|
toolName,
|
|
5600
|
+
sourceType,
|
|
5567
5601
|
settings,
|
|
5568
5602
|
logger
|
|
5569
5603
|
}: {
|
|
5570
5604
|
outputs: unknown;
|
|
5571
5605
|
streamOutput?: Block["streamOutput"];
|
|
5572
5606
|
toolName: string;
|
|
5607
|
+
sourceType?: SourceType;
|
|
5573
5608
|
settings?: Settings;
|
|
5574
5609
|
logger?: ILogger;
|
|
5575
5610
|
}) => Promise<{
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ 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
5
|
import { ArgumentValue, CedarEvaluator, FieldDecisions, LevelPolicies, PrincipalRef, ToolDecision } from "@stackone/policy";
|
|
6
|
-
import { IOlapClient } from "@stackone/olap";
|
|
6
|
+
import { IOlapClient, PolicyContext } from "@stackone/olap";
|
|
7
7
|
import { ILogger } from "@stackone/logger";
|
|
8
8
|
|
|
9
9
|
//#region src/blocks/createBlock.d.ts
|
|
@@ -5368,6 +5368,13 @@ type ActionPolicy = {
|
|
|
5368
5368
|
client?: string;
|
|
5369
5369
|
toolName?: string;
|
|
5370
5370
|
};
|
|
5371
|
+
type PolicyCall = {
|
|
5372
|
+
actionRunId: string;
|
|
5373
|
+
actionId: string;
|
|
5374
|
+
accountSecureId: string;
|
|
5375
|
+
principal?: PrincipalRef;
|
|
5376
|
+
levels?: LevelPolicies[];
|
|
5377
|
+
};
|
|
5371
5378
|
declare const decideReadFields: (input: {
|
|
5372
5379
|
policy: ActionPolicy;
|
|
5373
5380
|
account: Account;
|
|
@@ -5524,6 +5531,7 @@ type BaseRunActionParams = {
|
|
|
5524
5531
|
getActionForRefreshAuthenticationFn?: typeof getActionForRefreshAuthentication;
|
|
5525
5532
|
getTestActionsFn?: typeof getTestActions;
|
|
5526
5533
|
applyDefenderFn?: typeof applyDefender;
|
|
5534
|
+
applyRedactionFn?: typeof applyRedactionToBlock;
|
|
5527
5535
|
getHttpClient: () => Promise<IHttpClient>;
|
|
5528
5536
|
getOlapClient?: () => Promise<IOlapClient>;
|
|
5529
5537
|
};
|
|
@@ -5558,17 +5566,44 @@ type RefreshAuthenticationMode = BaseRunActionParams & {
|
|
|
5558
5566
|
redirectUri?: string;
|
|
5559
5567
|
};
|
|
5560
5568
|
type RunActionParams = ActionIdMode | PathMode | TestActionsMode | RefreshAuthenticationMode;
|
|
5569
|
+
declare const applyRedactionToBlock: (block: Block, ask: Extract<ExecutedAction, {
|
|
5570
|
+
outcome: "ran";
|
|
5571
|
+
}>["readFields"], logger: ILogger | undefined) => Promise<{
|
|
5572
|
+
block: Block;
|
|
5573
|
+
redactedClasses: NonNullable<NonNullable<Block["policyMetadata"]>["redactedClasses"]>;
|
|
5574
|
+
}>;
|
|
5561
5575
|
declare const runAction: (params: RunActionParams) => Promise<Block>;
|
|
5576
|
+
type ExecutedAction = {
|
|
5577
|
+
outcome: 'ran';
|
|
5578
|
+
block: Block;
|
|
5579
|
+
policy?: PolicyContext;
|
|
5580
|
+
readFields?: {
|
|
5581
|
+
decision: ToolDecision;
|
|
5582
|
+
call: PolicyCall;
|
|
5583
|
+
policy: ActionPolicy;
|
|
5584
|
+
account: Account;
|
|
5585
|
+
action: Pick<Action, 'id' | 'categories'>;
|
|
5586
|
+
authType?: AuthType;
|
|
5587
|
+
sessionId?: string;
|
|
5588
|
+
decideReadFieldsFn?: typeof decideReadFields;
|
|
5589
|
+
};
|
|
5590
|
+
} | {
|
|
5591
|
+
outcome: 'refused';
|
|
5592
|
+
policy: PolicyContext;
|
|
5593
|
+
error: ConnectSDKError;
|
|
5594
|
+
};
|
|
5562
5595
|
declare const applyDefender: ({
|
|
5563
5596
|
outputs,
|
|
5564
5597
|
streamOutput,
|
|
5565
5598
|
toolName,
|
|
5599
|
+
sourceType,
|
|
5566
5600
|
settings,
|
|
5567
5601
|
logger
|
|
5568
5602
|
}: {
|
|
5569
5603
|
outputs: unknown;
|
|
5570
5604
|
streamOutput?: Block["streamOutput"];
|
|
5571
5605
|
toolName: string;
|
|
5606
|
+
sourceType?: SourceType;
|
|
5572
5607
|
settings?: Settings;
|
|
5573
5608
|
logger?: ILogger;
|
|
5574
5609
|
}) => Promise<{
|