@prismatic-io/spectral 7.8.4 → 8.0.0-preview10
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/clients/http/index.d.ts +1 -1
- package/dist/index.d.ts +41 -12
- package/dist/index.js +43 -1
- package/dist/serverTypes/convert.d.ts +2 -1
- package/dist/serverTypes/convert.js +247 -1
- package/dist/serverTypes/index.d.ts +27 -24
- package/dist/testing.d.ts +14 -9
- package/dist/testing.js +57 -49
- package/dist/types/ActionDefinition.d.ts +3 -3
- package/dist/types/ActionPerformFunction.d.ts +12 -9
- package/dist/types/ComponentDefinition.d.ts +2 -2
- package/dist/types/{Customer.d.ts → CustomerAttributes.d.ts} +1 -1
- package/dist/types/DataSourcePerformFunction.d.ts +4 -4
- package/dist/types/{Flow.d.ts → FlowAttributes.d.ts} +1 -1
- package/dist/types/Inputs.d.ts +2 -0
- package/dist/types/{Instance.d.ts → InstanceAttributes.d.ts} +1 -1
- package/dist/types/{Integration.d.ts → IntegrationAttributes.d.ts} +2 -1
- package/dist/types/IntegrationDefinition.d.ts +269 -0
- package/dist/types/IntegrationDefinition.js +78 -0
- package/dist/types/TriggerDefinition.d.ts +5 -5
- package/dist/types/TriggerEventFunction.d.ts +2 -2
- package/dist/types/TriggerPayload.d.ts +6 -6
- package/dist/types/TriggerPerformFunction.d.ts +2 -2
- package/dist/types/TriggerResult.d.ts +4 -4
- package/dist/types/{User.d.ts → UserAttributes.d.ts} +1 -1
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.js +6 -5
- package/package.json +3 -2
- /package/dist/types/{Customer.js → CustomerAttributes.js} +0 -0
- /package/dist/types/{Flow.js → FlowAttributes.js} +0 -0
- /package/dist/types/{Instance.js → InstanceAttributes.js} +0 -0
- /package/dist/types/{Integration.js → IntegrationAttributes.js} +0 -0
- /package/dist/types/{User.js → UserAttributes.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionDisplayDefinition, TriggerPerformFunction, TriggerEventFunction, Inputs, TriggerResult } from ".";
|
|
1
|
+
import { ActionDisplayDefinition, TriggerPerformFunction, TriggerEventFunction, Inputs, TriggerResult, ConfigVarResultCollection, TriggerPayload } from ".";
|
|
2
2
|
declare const optionChoices: readonly ["invalid", "valid", "required"];
|
|
3
3
|
export declare type TriggerOptionChoice = typeof optionChoices[number];
|
|
4
4
|
export declare const TriggerOptionChoices: TriggerOptionChoice[];
|
|
@@ -6,15 +6,15 @@ export declare const TriggerOptionChoices: TriggerOptionChoice[];
|
|
|
6
6
|
* TriggerDefinition is the type of the object that is passed in to `trigger` function to
|
|
7
7
|
* define a component trigger.
|
|
8
8
|
*/
|
|
9
|
-
export interface TriggerDefinition<TInputs extends Inputs, TAllowsBranching extends boolean, TResult extends TriggerResult<TAllowsBranching>> {
|
|
9
|
+
export interface TriggerDefinition<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, TAllowsBranching extends boolean, TResult extends TriggerResult<TAllowsBranching, TriggerPayload>> {
|
|
10
10
|
/** Defines how the Trigger is displayed in the Prismatic interface. */
|
|
11
11
|
display: ActionDisplayDefinition;
|
|
12
12
|
/** Function to perform when this Trigger is invoked. */
|
|
13
|
-
perform: TriggerPerformFunction<TInputs, TAllowsBranching, TResult>;
|
|
13
|
+
perform: TriggerPerformFunction<TInputs, TConfigVars, false, TAllowsBranching, TResult>;
|
|
14
14
|
/** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deployed. */
|
|
15
|
-
onInstanceDeploy?: TriggerEventFunction<TInputs>;
|
|
15
|
+
onInstanceDeploy?: TriggerEventFunction<TInputs, TConfigVars, false>;
|
|
16
16
|
/** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deleted. */
|
|
17
|
-
onInstanceDelete?: TriggerEventFunction<TInputs>;
|
|
17
|
+
onInstanceDelete?: TriggerEventFunction<TInputs, TConfigVars, false>;
|
|
18
18
|
/** InputFields to present in the Prismatic interface for configuration of this Trigger. */
|
|
19
19
|
inputs: TInputs;
|
|
20
20
|
/** Specifies whether this Trigger supports executing the Integration on a recurring schedule. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Inputs, ActionContext, ActionInputParameters } from ".";
|
|
1
|
+
import { Inputs, ActionContext, ActionInputParameters, ConfigVarResultCollection } from ".";
|
|
2
2
|
export declare type TriggerEventFunctionReturn = {
|
|
3
3
|
/** An optional object, the keys and values of which will be persisted in the flow-specific instanceState and available for subsequent actions and executions */
|
|
4
4
|
instanceState?: Record<string, unknown>;
|
|
@@ -10,4 +10,4 @@ export declare type TriggerEventFunctionReturn = {
|
|
|
10
10
|
integrationState?: Record<string, unknown>;
|
|
11
11
|
};
|
|
12
12
|
/** Definition of the function to execute when a Trigger Event occurs. */
|
|
13
|
-
export declare type TriggerEventFunction<TInputs extends Inputs> = (context: ActionContext, params: ActionInputParameters<TInputs>) => Promise<void | TriggerEventFunctionReturn>;
|
|
13
|
+
export declare type TriggerEventFunction<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, THasConfigVars extends boolean> = (context: ActionContext<TConfigVars, THasConfigVars>, params: ActionInputParameters<TInputs>) => Promise<void | TriggerEventFunctionReturn>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InstanceAttributes, CustomerAttributes, UserAttributes, IntegrationAttributes, FlowAttributes } from ".";
|
|
2
2
|
/** Represents a Trigger Payload, which is data passed into a Trigger to invoke an Integration execution. */
|
|
3
3
|
export interface TriggerPayload {
|
|
4
4
|
headers: {
|
|
@@ -29,15 +29,15 @@ export interface TriggerPayload {
|
|
|
29
29
|
invokeUrl: string;
|
|
30
30
|
executionId: string;
|
|
31
31
|
/** Contains attributes of the Customer for whom an Instance is being executed. */
|
|
32
|
-
customer:
|
|
32
|
+
customer: CustomerAttributes;
|
|
33
33
|
/** Contains attributes of the Instance that is being executed. */
|
|
34
|
-
instance:
|
|
34
|
+
instance: InstanceAttributes;
|
|
35
35
|
/** Contains attributes of the User for whom a User Level Configuration is being used. */
|
|
36
|
-
user:
|
|
36
|
+
user: UserAttributes;
|
|
37
37
|
/** Contains attributes of the Integration that is being executed. */
|
|
38
|
-
integration:
|
|
38
|
+
integration: IntegrationAttributes;
|
|
39
39
|
/** Contains attributes of the Flow that is being executed. */
|
|
40
|
-
flow:
|
|
40
|
+
flow: FlowAttributes;
|
|
41
41
|
/** The time in UTC that execution started. */
|
|
42
42
|
startedAt: string;
|
|
43
43
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Inputs, TriggerResult, ActionInputParameters, ActionContext, TriggerPayload } from ".";
|
|
1
|
+
import { Inputs, TriggerResult, ActionInputParameters, ActionContext, TriggerPayload, ConfigVarResultCollection } from ".";
|
|
2
2
|
/** Definition of the function to perform when a Trigger is invoked. */
|
|
3
|
-
export declare type TriggerPerformFunction<
|
|
3
|
+
export declare type TriggerPerformFunction<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, THasConfigVars extends boolean, TAllowsBranching extends boolean | undefined, TResult extends TriggerResult<TAllowsBranching, TriggerPayload>> = (context: ActionContext<TConfigVars, THasConfigVars>, payload: TriggerPayload, params: ActionInputParameters<TInputs>) => Promise<TResult>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TriggerPayload } from "./TriggerPayload";
|
|
2
2
|
import { HttpResponse } from "./HttpResponse";
|
|
3
3
|
/** Represents the result of a Trigger action. */
|
|
4
|
-
export interface TriggerBaseResult {
|
|
4
|
+
export interface TriggerBaseResult<TPayload extends TriggerPayload> {
|
|
5
5
|
/** The payload in the request that invoked the Integration, which is returned as a result for later use. */
|
|
6
|
-
payload:
|
|
6
|
+
payload: TPayload;
|
|
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 flow-specific instanceState and available for subsequent actions and executions */
|
|
@@ -20,9 +20,9 @@ export interface TriggerBaseResult {
|
|
|
20
20
|
error?: Record<string, unknown>;
|
|
21
21
|
}
|
|
22
22
|
/** Represents the result of a Trigger action that uses branching. */
|
|
23
|
-
export interface TriggerBranchingResult extends TriggerBaseResult {
|
|
23
|
+
export interface TriggerBranchingResult<TPayload extends TriggerPayload> extends TriggerBaseResult<TPayload> {
|
|
24
24
|
/** Name of the Branch to take. */
|
|
25
25
|
branch: string;
|
|
26
26
|
}
|
|
27
27
|
/** Required return type of all trigger perform functions */
|
|
28
|
-
export declare type TriggerResult<AllowsBranching extends boolean | undefined> = (AllowsBranching extends true ? TriggerBranchingResult : TriggerBaseResult) | undefined;
|
|
28
|
+
export declare type TriggerResult<AllowsBranching extends boolean | undefined, TPayload extends TriggerPayload> = (AllowsBranching extends true ? TriggerBranchingResult<TPayload> : TriggerBaseResult<TPayload>) | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,9 +22,10 @@ export * from "./TriggerPayload";
|
|
|
22
22
|
export * from "./DataSourceDefinition";
|
|
23
23
|
export * from "./DataSourcePerformFunction";
|
|
24
24
|
export * from "./DataSourceResult";
|
|
25
|
-
export * from "./
|
|
26
|
-
export * from "./
|
|
27
|
-
export * from "./
|
|
28
|
-
export * from "./
|
|
29
|
-
export * from "./
|
|
25
|
+
export * from "./InstanceAttributes";
|
|
26
|
+
export * from "./CustomerAttributes";
|
|
27
|
+
export * from "./UserAttributes";
|
|
28
|
+
export * from "./IntegrationAttributes";
|
|
29
|
+
export * from "./FlowAttributes";
|
|
30
|
+
export * from "./IntegrationDefinition";
|
|
30
31
|
export * as serverTypes from "../serverTypes";
|
package/dist/types/index.js
CHANGED
|
@@ -51,9 +51,10 @@ __exportStar(require("./TriggerPayload"), exports);
|
|
|
51
51
|
__exportStar(require("./DataSourceDefinition"), exports);
|
|
52
52
|
__exportStar(require("./DataSourcePerformFunction"), exports);
|
|
53
53
|
__exportStar(require("./DataSourceResult"), exports);
|
|
54
|
-
__exportStar(require("./
|
|
55
|
-
__exportStar(require("./
|
|
56
|
-
__exportStar(require("./
|
|
57
|
-
__exportStar(require("./
|
|
58
|
-
__exportStar(require("./
|
|
54
|
+
__exportStar(require("./InstanceAttributes"), exports);
|
|
55
|
+
__exportStar(require("./CustomerAttributes"), exports);
|
|
56
|
+
__exportStar(require("./UserAttributes"), exports);
|
|
57
|
+
__exportStar(require("./IntegrationAttributes"), exports);
|
|
58
|
+
__exportStar(require("./FlowAttributes"), exports);
|
|
59
|
+
__exportStar(require("./IntegrationDefinition"), exports);
|
|
59
60
|
exports.serverTypes = __importStar(require("../serverTypes"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-preview10",
|
|
4
4
|
"description": "Utility library for building Prismatic components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismatic"
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"soap": "1.0.0",
|
|
49
49
|
"url-join": "5.0.0",
|
|
50
50
|
"uuid": "8.3.2",
|
|
51
|
-
"valid-url": "1.0.9"
|
|
51
|
+
"valid-url": "1.0.9",
|
|
52
|
+
"yaml": "2.3.4"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"@types/jest": "27.4.1",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|