@prismatic-io/spectral 5.0.0-rc.0 → 5.0.0-rc.4

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.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * Both component author-facing types and server types that
8
8
  * the Prismatic API expects are imported here.
9
9
  */
10
- import { ActionDefinition, InputFieldDefinition, ActionPerformReturn, ComponentDefinition, ConnectionFieldDefinition, Inputs, TriggerDefinition, TriggerResult } from "./types";
10
+ import { ActionDefinition, InputFieldDefinition, ActionPerformReturn, ComponentDefinition, DefaultConnectionDefinition, OAuth2ConnectionDefinition, Inputs, TriggerDefinition, TriggerResult } from "./types";
11
11
  import { Component } from "./types/server-types";
12
12
  /**
13
13
  * This function creates a component object that can be
@@ -49,12 +49,17 @@ export declare const input: <T extends InputFieldDefinition>(definition: T) => T
49
49
  /**
50
50
  * For information on writing custom component connections, see
51
51
  * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
52
- * @param definition A ConnectionfieldDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.
52
+ * @param definition A DefaultConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.
53
53
  * @returns This functions validates the shape of the `definition` object provided and returns the same connection object.
54
54
  */
55
- export declare const connection: <T extends Omit<ConnectionFieldDefinition, "type">>(definition: T) => T & {
56
- type: "connection";
57
- };
55
+ export declare const connection: <T extends DefaultConnectionDefinition>(definition: T) => T;
56
+ /**
57
+ * For information on writing custom component connections, see
58
+ * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
59
+ * @param definition An OAuth2ConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.
60
+ * @returns This functions validates the shape of the `definition` object provided and returns the same connection object.
61
+ */
62
+ export declare const oauth2Connection: <T extends OAuth2ConnectionDefinition>(definition: T) => T;
58
63
  export { default as util } from "./util";
59
64
  export * from "./types";
60
65
  export { default as testing } from "./testing";
package/dist/index.js CHANGED
@@ -18,14 +18,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
18
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.testing = exports.util = exports.connection = exports.input = exports.trigger = exports.action = exports.component = void 0;
22
- const convertInput = (key, input) => {
23
- var _a;
24
- if ("inputs" in input) {
25
- return Object.assign(Object.assign({}, input), { key, inputs: Object.entries((_a = input.inputs) !== null && _a !== void 0 ? _a : {}).map(([key, value]) => convertInput(key, value)) });
26
- }
27
- return Object.assign(Object.assign({}, input), { key });
28
- };
21
+ exports.testing = exports.util = exports.oauth2Connection = exports.connection = exports.input = exports.trigger = exports.action = exports.component = void 0;
22
+ const convertInput = (key, input) => (Object.assign(Object.assign({}, input), { key }));
29
23
  /**
30
24
  * This is a helper function for component() to convert an
31
25
  * action defined in TypeScript into an action object that
@@ -50,9 +44,9 @@ const convertTrigger = (triggerKey, trigger) => {
50
44
  var _a;
51
45
  return (Object.assign(Object.assign({}, trigger), { key: triggerKey, inputs: Object.entries((_a = trigger.inputs) !== null && _a !== void 0 ? _a : {}).map(([key, value]) => convertInput(key, value)), perform: trigger.perform, examplePayload: trigger.examplePayload || undefined }));
52
46
  };
53
- const convertConnection = (connectionKey, connection) => {
47
+ const convertConnection = (connection) => {
54
48
  var _a;
55
- return (Object.assign(Object.assign({}, connection), { key: connectionKey, inputs: Object.entries((_a = connection.inputs) !== null && _a !== void 0 ? _a : {}).map(([key, value]) => convertInput(key, value)) }));
49
+ return (Object.assign(Object.assign({}, connection), { inputs: Object.entries((_a = connection.inputs) !== null && _a !== void 0 ? _a : {}).map(([key, value]) => convertInput(key, value)) }));
56
50
  };
57
51
  /**
58
52
  * This function creates a component object that can be
@@ -68,10 +62,7 @@ const component = (definition) => (Object.assign(Object.assign({}, definition),
68
62
  ])), triggers: Object.fromEntries(Object.entries(definition.triggers || {}).map(([triggerKey, trigger]) => [
69
63
  triggerKey,
70
64
  convertTrigger(triggerKey, trigger),
71
- ])), connections: Object.fromEntries(Object.entries(definition.connections || {}).map(([connectionKey, connection]) => [
72
- connectionKey,
73
- convertConnection(connectionKey, connection),
74
- ])) }));
65
+ ])), connections: (definition.connections || []).map(convertConnection) }));
75
66
  exports.component = component;
76
67
  /**
77
68
  * This function creates an action object that can be referenced
@@ -107,11 +98,19 @@ exports.input = input;
107
98
  /**
108
99
  * For information on writing custom component connections, see
109
100
  * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
110
- * @param definition A ConnectionfieldDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.
101
+ * @param definition A DefaultConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.
111
102
  * @returns This functions validates the shape of the `definition` object provided and returns the same connection object.
112
103
  */
113
- const connection = (definition) => (Object.assign(Object.assign({}, definition), { type: "connection" }));
104
+ const connection = (definition) => definition;
114
105
  exports.connection = connection;
106
+ /**
107
+ * For information on writing custom component connections, see
108
+ * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
109
+ * @param definition An OAuth2ConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.
110
+ * @returns This functions validates the shape of the `definition` object provided and returns the same connection object.
111
+ */
112
+ const oauth2Connection = (definition) => definition;
113
+ exports.oauth2Connection = oauth2Connection;
115
114
  var util_1 = require("./util");
116
115
  Object.defineProperty(exports, "util", { enumerable: true, get: function () { return __importDefault(util_1).default; } });
117
116
  __exportStar(require("./types"), exports);
package/dist/testing.d.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * https://prismatic.io/docs/custom-components/writing-custom-components/#testing-a-component
6
6
  */
7
7
  /** */
8
- import { ActionContext, ActionLogger, ActionDefinition, ActionInputParameters, ConnectionFieldDefinition, Connection, ActionPerformReturn, Inputs, TriggerDefinition, TriggerResult, TriggerPayload } from "./types";
9
- export declare const createConnection: <T extends ConnectionFieldDefinition>({ connectionKey }: T, values: { [Property in keyof T["inputs"]]: unknown; }) => Connection<T>;
8
+ import { ActionContext, ActionLogger, ActionDefinition, ActionInputParameters, ConnectionDefinition, Connection, ActionPerformReturn, Inputs, TriggerDefinition, TriggerResult, TriggerPayload } from "./types";
9
+ export declare const createConnection: <T extends ConnectionDefinition>({ key }: T, values: Record<string, unknown>) => Connection;
10
10
  /**
11
11
  * Pre-built mock of ActionLogger. Suitable for asserting logs are created as expected.
12
12
  * See https://prismatic.io/docs/custom-components/writing-custom-components/#verifying-correct-logging-in-action-tests for information on testing correct logging behavior in your custom component.
package/dist/testing.js CHANGED
@@ -17,9 +17,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.invokeTrigger = exports.defaultTriggerPayload = exports.invoke = exports.loggerMock = exports.createConnection = void 0;
19
19
  const jest_mock_1 = require("jest-mock");
20
- const createConnection = ({ connectionKey }, values) => ({
21
- instanceConfigVarId: "",
22
- key: connectionKey,
20
+ const createConnection = ({ key }, values) => ({
21
+ configVarKey: "",
22
+ key,
23
23
  fields: values,
24
24
  });
25
25
  exports.createConnection = createConnection;
@@ -28,6 +28,8 @@ exports.createConnection = createConnection;
28
28
  * See https://prismatic.io/docs/custom-components/writing-custom-components/#verifying-correct-logging-in-action-tests for information on testing correct logging behavior in your custom component.
29
29
  */
30
30
  const loggerMock = () => ({
31
+ metric: console.log,
32
+ trace: jest_mock_1.spyOn(console, "trace"),
31
33
  debug: jest_mock_1.spyOn(console, "debug"),
32
34
  info: jest_mock_1.spyOn(console, "info"),
33
35
  log: jest_mock_1.spyOn(console, "log"),
@@ -43,7 +45,7 @@ exports.loggerMock = loggerMock;
43
45
  */
44
46
  const invoke = (actionBase, params, context) => __awaiter(void 0, void 0, void 0, function* () {
45
47
  const action = (actionBase.perform ? actionBase : Object.values(actionBase)[0]);
46
- const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
48
+ const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, executionState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
47
49
  const result = yield action.perform(realizedContext, params);
48
50
  return {
49
51
  result,
@@ -88,7 +90,7 @@ exports.defaultTriggerPayload = defaultTriggerPayload;
88
90
  */
89
91
  const invokeTrigger = (triggerBase, context, payload, params) => __awaiter(void 0, void 0, void 0, function* () {
90
92
  const trigger = (triggerBase.perform ? triggerBase : Object.values(triggerBase)[0]);
91
- const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
93
+ const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, executionState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
92
94
  const realizedPayload = Object.assign(Object.assign({}, exports.defaultTriggerPayload()), payload);
93
95
  const realizedParams = params || {};
94
96
  const result = yield trigger.perform(realizedContext, realizedPayload, realizedParams);
@@ -12,6 +12,8 @@ export interface ActionDefinition<T extends Inputs, AllowsBranching extends bool
12
12
  inputs: T;
13
13
  /** Optional attribute that specifies whether an Action will terminate execution.*/
14
14
  terminateExecution?: boolean;
15
+ /** Specifies whether an Action will break out of a loop. */
16
+ breakLoop?: boolean;
15
17
  /** Determines whether an Action will allow Conditional Branching.*/
16
18
  allowsBranching?: AllowsBranching;
17
19
  /** Static Branch names associated with an Action. */
@@ -1,12 +1,12 @@
1
- import { InputFieldDefinition, Inputs, InputFieldTypeMap, Connection, ConnectionFieldDefinition } from ".";
1
+ import { InputFieldDefinition, Inputs, InputFieldTypeMap } from ".";
2
2
  /**
3
3
  * Collection of input parameters.
4
4
  * Inputs can be static values, references to config variables, or
5
5
  * references to previous steps' outputs.
6
6
  */
7
- export declare type ActionInputParameters<TInputs extends Inputs> = {
8
- [Property in keyof TInputs]: TInputs[Property] extends ConnectionFieldDefinition ? Connection<TInputs[Property]> : ExtractValue<TInputs[Property]>;
9
- };
7
+ export declare type ActionInputParameters<TInputs extends Inputs> = TInputs extends Record<string, InputFieldDefinition> ? {
8
+ [Property in keyof TInputs]: ExtractValue<TInputs[Property]>;
9
+ } : never;
10
10
  export declare type ExtractValue<TValue extends InputFieldDefinition> = MapCollectionValues<InputFieldTypeMap[TValue["type"]], TValue["collection"]>;
11
11
  export declare type MapCollectionValues<TType, TCollection extends InputFieldDefinition["collection"] | undefined> = TCollection extends "keyvaluelist" ? KeyValuePair<TType>[] | undefined : TCollection extends "valuelist" ? TType[] | undefined : TType;
12
12
  /**
@@ -12,6 +12,8 @@ export declare type ActionLoggerFunction = (...args: unknown[]) => void;
12
12
  * An object containing logger functions.
13
13
  */
14
14
  export interface ActionLogger {
15
+ metric: ActionLoggerFunction;
16
+ trace: ActionLoggerFunction;
15
17
  debug: ActionLoggerFunction;
16
18
  info: ActionLoggerFunction;
17
19
  log: ActionLoggerFunction;
@@ -7,6 +7,8 @@ export interface ActionContext {
7
7
  logger: ActionLogger;
8
8
  /** A key/value store that may be used to store small amounts of data that is persisted between Instance executions */
9
9
  instanceState: Record<string, unknown>;
10
+ /** A key/value store that may be used to store small amounts of data for use later during the execution */
11
+ executionState: Record<string, unknown>;
10
12
  /** A unique id that corresponds to the step on the Integration */
11
13
  stepId: string;
12
14
  /** A unique id that corresponds to the specific execution of the Integration */
@@ -7,7 +7,9 @@ export interface ActionPerformDataReturn<ReturnData> {
7
7
  /** The HTTP Status code that will be used if this terminates a synchronous invocation */
8
8
  statusCode?: number;
9
9
  /** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
10
- state?: Record<string, unknown>;
10
+ instanceState?: Record<string, unknown>;
11
+ /** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
12
+ executionState?: Record<string, unknown>;
11
13
  }
12
14
  /** Used to represent a branching return of conventional data and does not require content type to be specified */
13
15
  /** Used to represent a binary or serialized data branching return as content type must be specified */
@@ -1,7 +1,7 @@
1
1
  import { Component } from "./server-types";
2
- import { ActionPerformReturn, ActionDefinition, TriggerDefinition, TriggerResult, ConnectionFieldDefinition } from ".";
2
+ import { ActionPerformReturn, ActionDefinition, ConnectionDefinition, TriggerDefinition, TriggerResult } from ".";
3
3
  export declare type ComponentDefinition<T extends boolean> = Omit<Component<T>, "actions" | "triggers" | "connections"> & {
4
4
  actions?: Record<string, ActionDefinition<any, boolean, ActionPerformReturn<boolean, any>>>;
5
5
  triggers?: Record<string, TriggerDefinition<any, boolean, TriggerResult<boolean>>>;
6
- connections?: Record<string, ConnectionFieldDefinition>;
6
+ connections?: ConnectionDefinition[];
7
7
  };
@@ -0,0 +1,41 @@
1
+ import { ConnectionInput } from ".";
2
+ export declare enum OAuth2Type {
3
+ ClientCredentials = "client_credentials",
4
+ AuthorizationCode = "authorization_code"
5
+ }
6
+ interface BaseConnectionDefinition {
7
+ key: string;
8
+ label: string;
9
+ comments?: string;
10
+ iconPath?: string;
11
+ oauth2Type?: OAuth2Type;
12
+ }
13
+ export interface DefaultConnectionDefinition extends BaseConnectionDefinition {
14
+ inputs: {
15
+ [key: string]: ConnectionInput;
16
+ };
17
+ }
18
+ interface OAuth2AuthorizationCodeConnectionDefinition extends BaseConnectionDefinition {
19
+ oauth2Type: OAuth2Type.AuthorizationCode;
20
+ inputs: {
21
+ authorizeUrl: ConnectionInput;
22
+ tokenUrl: ConnectionInput;
23
+ scopes: ConnectionInput;
24
+ clientId: ConnectionInput;
25
+ clientSecret: ConnectionInput;
26
+ [key: string]: ConnectionInput;
27
+ };
28
+ }
29
+ interface OAuth2ClientCredentialConnectionDefinition extends BaseConnectionDefinition {
30
+ oauth2Type: OAuth2Type.ClientCredentials;
31
+ inputs: {
32
+ tokenUrl: ConnectionInput;
33
+ scopes: ConnectionInput;
34
+ clientId: ConnectionInput;
35
+ clientSecret: ConnectionInput;
36
+ [key: string]: ConnectionInput;
37
+ };
38
+ }
39
+ export declare type OAuth2ConnectionDefinition = OAuth2AuthorizationCodeConnectionDefinition | OAuth2ClientCredentialConnectionDefinition;
40
+ export declare type ConnectionDefinition = DefaultConnectionDefinition | OAuth2AuthorizationCodeConnectionDefinition | OAuth2ClientCredentialConnectionDefinition;
41
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OAuth2Type = void 0;
4
+ var OAuth2Type;
5
+ (function (OAuth2Type) {
6
+ OAuth2Type["ClientCredentials"] = "client_credentials";
7
+ OAuth2Type["AuthorizationCode"] = "authorization_code";
8
+ })(OAuth2Type = exports.OAuth2Type || (exports.OAuth2Type = {}));
@@ -1,3 +1,4 @@
1
+ import { Connection } from ".";
1
2
  import { ConditionalExpression } from "./conditional-logic";
2
3
  /** InputField type enumeration. */
3
4
  export declare type InputFieldType = keyof InputFieldTypeMap;
@@ -9,5 +10,5 @@ export declare type InputFieldTypeMap = {
9
10
  boolean: unknown;
10
11
  code: unknown;
11
12
  conditional: ConditionalExpression;
12
- connection: never;
13
+ connection: Connection;
13
14
  };
@@ -1,9 +1,9 @@
1
1
  import { InputFieldType } from ".";
2
2
  export declare type Inputs = Record<string, InputFieldDefinition>;
3
- export declare type ConnectionInputs = Record<string, DefaultInputFieldDefinition & {
3
+ export declare type ConnectionInput = DefaultInputFieldDefinition & {
4
4
  shown?: boolean;
5
- }>;
6
- export declare type InputFieldDefinition = DefaultInputFieldDefinition | CodeInputFieldDefinition | ConnectionFieldDefinition;
5
+ };
6
+ export declare type InputFieldDefinition = DefaultInputFieldDefinition | CodeInputFieldDefinition;
7
7
  interface BaseInputFieldDefinition {
8
8
  /** Interface label of the InputField. */
9
9
  label: string;
@@ -24,33 +24,21 @@ interface BaseInputFieldDefinition {
24
24
  }
25
25
  /** Defines attributes of a InputField. */
26
26
  export interface DefaultInputFieldDefinition extends BaseInputFieldDefinition {
27
- type: Exclude<InputFieldType, "code" | "connection">;
27
+ type: Exclude<InputFieldType, "code">;
28
28
  }
29
29
  /** Defines attributes of a CodeInputField. */
30
30
  export interface CodeInputFieldDefinition extends BaseInputFieldDefinition {
31
31
  type: Extract<InputFieldType, "code">;
32
32
  language?: string;
33
33
  }
34
- export declare enum OAuth2Type {
35
- ClientCredentials = "client_credentials",
36
- AuthorizationCode = "authorization_code"
37
- }
38
- /** Defines attributes of a ConnectionField. */
39
- export interface ConnectionFieldDefinition extends BaseInputFieldDefinition {
40
- type: Extract<InputFieldType, "connection">;
41
- connectionKey: string;
42
- oauth2Type?: OAuth2Type;
43
- iconPath?: string;
44
- inputs: ConnectionInputs;
45
- }
46
- export interface Connection<TField extends ConnectionFieldDefinition = ConnectionFieldDefinition> {
34
+ export interface Connection {
47
35
  /** Key of the Connection type. */
48
- key: TField["connectionKey"];
49
- /** Identifier for the Config Variable hosting this Connection. */
50
- instanceConfigVarId: string;
36
+ key: string;
37
+ /** Key for the Config Variable hosting this Connection. */
38
+ configVarKey: string;
51
39
  /** Field values supplied to this Connection. */
52
40
  fields: {
53
- [Property in keyof TField["inputs"]]: unknown;
41
+ [key: string]: unknown;
54
42
  };
55
43
  token?: Record<string, unknown>;
56
44
  context?: Record<string, unknown>;
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OAuth2Type = void 0;
4
- var OAuth2Type;
5
- (function (OAuth2Type) {
6
- OAuth2Type["ClientCredentials"] = "client_credentials";
7
- OAuth2Type["AuthorizationCode"] = "authorization_code";
8
- })(OAuth2Type = exports.OAuth2Type || (exports.OAuth2Type = {}));
@@ -19,6 +19,8 @@ export interface TriggerDefinition<T extends Inputs, AllowsBranching extends boo
19
19
  synchronousResponseSupport: TriggerOptionChoice;
20
20
  /** Optional attribute that specifies whether this Trigger will terminate execution. */
21
21
  terminateExecution?: boolean;
22
+ /** Specifies whether an Action will break out of a loop. */
23
+ breakLoop?: boolean;
22
24
  /** Determines whether this Trigger allows Conditional Branching. */
23
25
  allowsBranching?: AllowsBranching;
24
26
  /** Static Branch names associated with this Trigger. */
@@ -7,7 +7,9 @@ export interface TriggerBaseResult {
7
7
  /** Optional HTTP response to the request that invoked the integration. */
8
8
  response?: HttpResponse;
9
9
  /** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
10
- state?: Record<string, unknown>;
10
+ instanceState?: Record<string, unknown>;
11
+ /** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
12
+ executionState?: Record<string, unknown>;
11
13
  }
12
14
  /** Represents the result of a Trigger action that uses branching. */
13
15
  export interface TriggerBranchingResult extends TriggerBaseResult {
@@ -4,6 +4,7 @@
4
4
  */
5
5
  export * from "./ActionDefinition";
6
6
  export * from "./ComponentDefinition";
7
+ export * from "./ConnectionDefinition";
7
8
  export * from "./Inputs";
8
9
  export * from "./ActionPerformReturn";
9
10
  export * from "./DisplayDefinition";
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.serverTypes = void 0;
30
30
  __exportStar(require("./ActionDefinition"), exports);
31
31
  __exportStar(require("./ComponentDefinition"), exports);
32
+ __exportStar(require("./ConnectionDefinition"), exports);
32
33
  __exportStar(require("./Inputs"), exports);
33
34
  __exportStar(require("./ActionPerformReturn"), exports);
34
35
  __exportStar(require("./DisplayDefinition"), exports);
@@ -26,7 +26,7 @@ interface ComponentBase<TPublic extends boolean> {
26
26
  /** Specifies the supported Triggers of this Component. */
27
27
  triggers?: Record<string, Trigger>;
28
28
  /** Specifies the supported Connections of this Component. */
29
- connections?: Record<string, ConnectionField>;
29
+ connections?: Connection[];
30
30
  }
31
31
  export declare type Component<TPublic extends boolean> = ComponentBase<TPublic> & (TPublic extends true ? {
32
32
  /** Specified the URL for the Component Documentation. */
@@ -45,6 +45,8 @@ interface BaseAction {
45
45
  inputs: InputField[];
46
46
  /** Optional attribute that specifies whether an Action will terminate execution. */
47
47
  terminateExecution?: boolean;
48
+ /** Specifies whether an Action will break out of a loop. */
49
+ breakLoop?: boolean;
48
50
  /** Determines whether an Action will allow Conditional Branching. */
49
51
  allowsBranching?: boolean;
50
52
  /** Static Branch names associated with an Action. */
@@ -72,6 +74,16 @@ export interface Trigger extends BaseAction {
72
74
  /** Specifies if this Trigger appears in the list of 'common' Triggers. Only configurable by Prismatic. @default false */
73
75
  isCommonTrigger?: boolean;
74
76
  }
77
+ export interface Connection {
78
+ key: string;
79
+ label: string;
80
+ comments?: string;
81
+ oauth2Type?: OAuth2Type;
82
+ iconPath?: string;
83
+ inputs: (InputField & {
84
+ shown?: boolean;
85
+ })[];
86
+ }
75
87
  /** Collection of input parameters provided by the user or previous steps' outputs */
76
88
  interface ActionInputParameters {
77
89
  [key: string]: unknown;
@@ -85,7 +97,9 @@ export interface ServerPerformDataStructureReturn {
85
97
  /** The HTTP Status code that will be used if this terminates a synchronous invocation */
86
98
  statusCode?: number;
87
99
  /** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
88
- state?: Record<string, unknown>;
100
+ instanceState?: Record<string, unknown>;
101
+ /** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
102
+ executionState?: Record<string, unknown>;
89
103
  }
90
104
  /** Used to represent a binary or serialized data return as content type must be specified */
91
105
  interface ServerPerformDataReturn {
@@ -96,7 +110,9 @@ interface ServerPerformDataReturn {
96
110
  /** The HTTP Status code that will be used if this terminates a synchronous invocation */
97
111
  statusCode?: number;
98
112
  /** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
99
- state?: Record<string, unknown>;
113
+ instanceState?: Record<string, unknown>;
114
+ /** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
115
+ executionState?: Record<string, unknown>;
100
116
  }
101
117
  /** Used to represent a branching return of conventional data and does not require content type to be specified */
102
118
  export interface ServerPerformBranchingDataStructureReturn extends ServerPerformDataStructureReturn {
@@ -116,7 +132,7 @@ export declare type TriggerResult = TriggerBranchingResult | TriggerBaseResult |
116
132
  /** Definition of the function to perform when a Trigger is invoked. */
117
133
  export declare type TriggerPerformFunction = (context: ActionContext, payload: TriggerPayload, params: ActionInputParameters) => Promise<TriggerResult>;
118
134
  export declare type TriggerPayload = _TriggerPayload;
119
- export declare type InputField = DefaultInputField | CodeInputField | ConnectionField;
135
+ export declare type InputField = DefaultInputField | CodeInputField;
120
136
  /** Defines attributes of a InputField. */
121
137
  interface DefaultInputField {
122
138
  /** Unique identifier of the InputField. Must be unique within an Action. */
@@ -144,15 +160,6 @@ interface CodeInputField extends DefaultInputField {
144
160
  type: "code";
145
161
  language?: string;
146
162
  }
147
- export interface ConnectionField extends DefaultInputField {
148
- type: "connection";
149
- key: string;
150
- oauth2Type?: OAuth2Type;
151
- iconPath?: string;
152
- inputs: (Exclude<InputField, ConnectionField> & {
153
- shown?: boolean;
154
- })[];
155
- }
156
163
  /** InputField type enumeration. */
157
164
  export declare type InputFieldType = "string" | "text" | "password" | "boolean" | "code" | "data" | "conditional" | "connection";
158
165
  /** Binary data payload */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "5.0.0-rc.0",
3
+ "version": "5.0.0-rc.4",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"