@prismatic-io/spectral 7.8.0-preview5 → 7.8.1

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.
@@ -44,12 +44,14 @@ const convertTrigger = (triggerKey, _a, hooks) => {
44
44
  inputCleaners,
45
45
  errorHandler: hooks === null || hooks === void 0 ? void 0 : hooks.error,
46
46
  });
47
+ result.hasOnInstanceDeploy = true;
47
48
  }
48
49
  if (onInstanceDelete) {
49
50
  result.onInstanceDelete = (0, perform_1.createPerform)(onInstanceDelete, {
50
51
  inputCleaners,
51
52
  errorHandler: hooks === null || hooks === void 0 ? void 0 : hooks.error,
52
53
  });
54
+ result.hasOnInstanceDelete = true;
53
55
  }
54
56
  return result;
55
57
  };
@@ -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;
@@ -118,7 +124,9 @@ export interface Trigger {
118
124
  dynamicBranchInput?: string;
119
125
  perform: TriggerPerformFunction;
120
126
  onInstanceDeploy?: TriggerEventFunction;
127
+ hasOnInstanceDeploy?: boolean;
121
128
  onInstanceDelete?: TriggerEventFunction;
129
+ hasOnInstanceDelete?: boolean;
122
130
  scheduleSupport: TriggerOptionChoice;
123
131
  synchronousResponseSupport: TriggerOptionChoice;
124
132
  examplePayload?: unknown;
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
  }
@@ -0,0 +1,5 @@
1
+ /** Contains attributes of the Flow that is being executed. */
2
+ export interface Flow {
3
+ id: string;
4
+ name: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /** Contains attributes of the Integration that is being executed. */
2
+ export interface Integration {
3
+ id: string;
4
+ name: string;
5
+ versionSequenceId: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  }
@@ -25,4 +25,6 @@ export * from "./DataSourceResult";
25
25
  export * from "./Instance";
26
26
  export * from "./Customer";
27
27
  export * from "./User";
28
+ export * from "./Integration";
29
+ export * from "./Flow";
28
30
  export * as serverTypes from "../serverTypes";
@@ -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"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "7.8.0-preview5",
3
+ "version": "7.8.1",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"