@prismatic-io/spectral 7.8.0-preview4 → 7.8.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/serverTypes/index.d.ts +9 -2
- package/dist/testing.js +18 -0
- package/dist/types/ActionPerformFunction.d.ts +5 -1
- package/dist/types/Flow.d.ts +5 -0
- package/dist/types/Flow.js +2 -0
- package/dist/types/Integration.d.ts +6 -0
- package/dist/types/Integration.js +2 -0
- package/dist/types/TriggerPayload.d.ts +5 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Instance, Customer, DataSourceType, DataSourceResultType, User, TriggerEventFunctionReturn } from "../types";
|
|
2
|
+
import { Instance, Customer, DataSourceType, DataSourceResultType, User, TriggerEventFunctionReturn, Integration, Flow } from "../types";
|
|
3
3
|
interface DisplayDefinition {
|
|
4
4
|
label: string;
|
|
5
5
|
description: string;
|
|
@@ -7,6 +7,8 @@ interface DisplayDefinition {
|
|
|
7
7
|
export { Instance } from "../types";
|
|
8
8
|
export { Customer } from "../types";
|
|
9
9
|
export { User } from "../types";
|
|
10
|
+
export { Integration } from "../types";
|
|
11
|
+
export { Flow } from "../types";
|
|
10
12
|
export interface Component {
|
|
11
13
|
key: string;
|
|
12
14
|
public?: boolean;
|
|
@@ -59,6 +61,8 @@ export interface ActionContext {
|
|
|
59
61
|
customer: Customer;
|
|
60
62
|
instance: Instance;
|
|
61
63
|
user: User;
|
|
64
|
+
integration: Integration;
|
|
65
|
+
flow: Flow;
|
|
62
66
|
}
|
|
63
67
|
declare type TriggerOptionChoice = "invalid" | "valid" | "required";
|
|
64
68
|
export interface TriggerPayload {
|
|
@@ -80,6 +84,8 @@ export interface TriggerPayload {
|
|
|
80
84
|
customer: Customer;
|
|
81
85
|
instance: Instance;
|
|
82
86
|
user: User;
|
|
87
|
+
integration: Integration;
|
|
88
|
+
flow: Flow;
|
|
83
89
|
}
|
|
84
90
|
interface HttpResponse {
|
|
85
91
|
statusCode: number;
|
|
@@ -102,7 +108,8 @@ interface TriggerBranchingResult extends TriggerBaseResult {
|
|
|
102
108
|
}
|
|
103
109
|
export declare type TriggerResult = TriggerBranchingResult | TriggerBaseResult | undefined;
|
|
104
110
|
export declare type TriggerPerformFunction = (context: ActionContext, payload: TriggerPayload, params: Record<string, unknown>) => Promise<TriggerResult>;
|
|
105
|
-
export declare type
|
|
111
|
+
export declare type TriggerEventFunctionResult = TriggerEventFunctionReturn | void;
|
|
112
|
+
export declare type TriggerEventFunction = (context: ActionContext, params: Record<string, unknown>) => Promise<TriggerEventFunctionResult>;
|
|
106
113
|
export interface Trigger {
|
|
107
114
|
key: string;
|
|
108
115
|
display: DisplayDefinition & {
|
package/dist/testing.js
CHANGED
|
@@ -68,6 +68,15 @@ const baseActionContext = {
|
|
|
68
68
|
name: "User 1",
|
|
69
69
|
externalId: "1234",
|
|
70
70
|
},
|
|
71
|
+
integration: {
|
|
72
|
+
id: "integrationId",
|
|
73
|
+
name: "Integration 1",
|
|
74
|
+
versionSequenceId: "1234",
|
|
75
|
+
},
|
|
76
|
+
flow: {
|
|
77
|
+
id: "flowId",
|
|
78
|
+
name: "Flow 1",
|
|
79
|
+
},
|
|
71
80
|
};
|
|
72
81
|
/**
|
|
73
82
|
* Invokes specified ActionDefinition perform function using supplied params
|
|
@@ -124,6 +133,15 @@ const defaultTriggerPayload = () => {
|
|
|
124
133
|
name: "User 1",
|
|
125
134
|
externalId: "1234",
|
|
126
135
|
},
|
|
136
|
+
integration: {
|
|
137
|
+
id: "integrationId",
|
|
138
|
+
name: "Integration 1",
|
|
139
|
+
versionSequenceId: "1234",
|
|
140
|
+
},
|
|
141
|
+
flow: {
|
|
142
|
+
id: "flowId",
|
|
143
|
+
name: "Flow 1",
|
|
144
|
+
},
|
|
127
145
|
};
|
|
128
146
|
};
|
|
129
147
|
exports.defaultTriggerPayload = defaultTriggerPayload;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Inputs, ActionPerformReturn, ActionInputParameters, ActionLogger, Instance, Customer, User } from ".";
|
|
1
|
+
import { Inputs, ActionPerformReturn, ActionInputParameters, ActionLogger, Instance, Customer, User, Integration, Flow } from ".";
|
|
2
2
|
/** Definition of the function to perform when an Action is invoked. */
|
|
3
3
|
export declare type ActionPerformFunction<TInputs extends Inputs, TAllowsBranching extends boolean | undefined, TReturn extends ActionPerformReturn<TAllowsBranching, unknown>> = (context: ActionContext, params: ActionInputParameters<TInputs>) => Promise<TReturn>;
|
|
4
4
|
/** Context provided to perform method containing helpers and contextual data */
|
|
@@ -29,4 +29,8 @@ export interface ActionContext {
|
|
|
29
29
|
instance: Instance;
|
|
30
30
|
/** Contains attributes of the User for whom a User Level Configuration is being used. */
|
|
31
31
|
user: User;
|
|
32
|
+
/** Contains attributes of the Integration that is being executed. */
|
|
33
|
+
integration: Integration;
|
|
34
|
+
/** Contains attributes of the Flow that is being executed. */
|
|
35
|
+
flow: Flow;
|
|
32
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Instance, Customer, User } from ".";
|
|
1
|
+
import { Instance, Customer, User, Integration, Flow } 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: {
|
|
@@ -34,4 +34,8 @@ export interface TriggerPayload {
|
|
|
34
34
|
instance: Instance;
|
|
35
35
|
/** Contains attributes of the User for whom a User Level Configuration is being used. */
|
|
36
36
|
user: User;
|
|
37
|
+
/** Contains attributes of the Integration that is being executed. */
|
|
38
|
+
integration: Integration;
|
|
39
|
+
/** Contains attributes of the Flow that is being executed. */
|
|
40
|
+
flow: Flow;
|
|
37
41
|
}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -54,4 +54,6 @@ __exportStar(require("./DataSourceResult"), exports);
|
|
|
54
54
|
__exportStar(require("./Instance"), exports);
|
|
55
55
|
__exportStar(require("./Customer"), exports);
|
|
56
56
|
__exportStar(require("./User"), exports);
|
|
57
|
+
__exportStar(require("./Integration"), exports);
|
|
58
|
+
__exportStar(require("./Flow"), exports);
|
|
57
59
|
exports.serverTypes = __importStar(require("../serverTypes"));
|