Skip to content

Commit

Permalink
Move authorization config from component to action (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwersal authored Aug 5, 2021
1 parent 80e270b commit 1972500
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prismatic-io/spectral",
"version": "2.1.0",
"version": "3.0.0",
"description": "Utility library for building Prismatic components",
"keywords": [
"prismatic"
Expand Down
3 changes: 3 additions & 0 deletions src/types/ActionDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
PerformReturn,
ActionDisplayDefinition,
ActionPerformFunction,
AuthorizationDefinition,
Inputs,
} from ".";

Expand All @@ -20,6 +21,8 @@ export interface ActionDefinition<
perform: ActionPerformFunction<T, AllowsBranching, ReturnData>;
/** InputFields to present in the Prismatic interface for configuration of this Action. */
inputs: T;
/** Specifies Authorization settings, if applicable */
authorization?: AuthorizationDefinition;
/** Optional attribute that specifies whether an Action will terminate execution.*/
terminateExecution?: boolean;
/** Determines whether an Action will allow Conditional Branching.*/
Expand Down
4 changes: 2 additions & 2 deletions src/types/server-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ interface ComponentBase<T extends boolean> {
display: ComponentDisplayDefinition<T>;
/** @deprecated Version of the Component. */
version?: string;
/** Specifies Authorization settings, if applicable */
authorization?: AuthorizationDefinition;
/** Specifies the supported Actions of this Component. */
actions: Record<string, Action>;
}
Expand All @@ -56,6 +54,8 @@ export interface Action {
perform: ActionPerformFunction;
/** InputFields to present in the Prismatic interface for configuration of this Action. */
inputs: InputField[];
/** Specifies Authorization settings, if applicable */
authorization?: AuthorizationDefinition;
/** Optional attribute that specifies whether an Action will terminate execution.*/
terminateExecution?: boolean;
/** Determines whether an Action will allow Conditional Branching.*/
Expand Down

0 comments on commit 1972500

Please sign in to comment.