@prismatic-io/spectral 8.0.2 → 8.0.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
@@ -3,7 +3,7 @@
3
3
  * authors create inputs, actions, and components that can
4
4
  * be processed by the Prismatic API.
5
5
  */
6
- import { ActionDefinition, InputFieldDefinition, ComponentDefinition, DefaultConnectionDefinition, OAuth2ConnectionDefinition, Inputs, TriggerDefinition, ActionPerformReturn, TriggerResult, DataSourceDefinition, IntegrationDefinition, Flow, ConfigPage, StandardConfigVar, ConnectionConfigVar, ConfigVarResultCollection, TriggerPayload, DataSourceConfigVar, ConfigPages } from "./types";
6
+ import { ActionDefinition, InputFieldDefinition, ComponentDefinition, DefaultConnectionDefinition, OAuth2ConnectionDefinition, Inputs, TriggerDefinition, ActionPerformReturn, TriggerResult, DataSourceDefinition, IntegrationDefinition, Flow, ConfigPage, StandardConfigVar, ConnectionConfigVar, ConfigVarResultCollection, TriggerPayload, DataSourceConfigVar, ConfigPages, OnPremiseConnectionDefinition } from "./types";
7
7
  import { convertComponent } from "./serverTypes/convert";
8
8
  import { convertIntegration } from "./serverTypes/convertIntegration";
9
9
  /**
@@ -118,6 +118,13 @@ export declare const input: <T extends InputFieldDefinition>(definition: T) => T
118
118
  * @returns This functions validates the shape of the `definition` object provided and returns the same connection object.
119
119
  */
120
120
  export declare const connection: <T extends DefaultConnectionDefinition>(definition: T) => T;
121
+ /**
122
+ * For information on writing custom component connections using on-premise resources, see
123
+ * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
124
+ * @param definition An OnPremiseConnectionDefinition 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.
125
+ * @returns This function validates the shape of the `definition` object provided and returns the same connection object.
126
+ */
127
+ export declare const onPremiseConnection: <T extends OnPremiseConnectionDefinition>(definition: T) => T;
121
128
  /**
122
129
  * For information on writing custom component connections, see
123
130
  * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.testing = exports.util = exports.oauth2Connection = exports.connection = exports.input = exports.dataSource = exports.trigger = exports.action = exports.component = exports.connectionConfigVar = exports.dataSourceConfigVar = exports.configVar = exports.configPage = exports.flow = exports.integration = void 0;
25
+ exports.testing = exports.util = exports.oauth2Connection = exports.onPremiseConnection = exports.connection = exports.input = exports.dataSource = exports.trigger = exports.action = exports.component = exports.connectionConfigVar = exports.dataSourceConfigVar = exports.configVar = exports.configPage = exports.flow = exports.integration = void 0;
26
26
  const convert_1 = require("./serverTypes/convert");
27
27
  const convertIntegration_1 = require("./serverTypes/convertIntegration");
28
28
  /**
@@ -135,6 +135,14 @@ exports.input = input;
135
135
  */
136
136
  const connection = (definition) => definition;
137
137
  exports.connection = connection;
138
+ /**
139
+ * For information on writing custom component connections using on-premise resources, see
140
+ * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
141
+ * @param definition An OnPremiseConnectionDefinition 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.
142
+ * @returns This function validates the shape of the `definition` object provided and returns the same connection object.
143
+ */
144
+ const onPremiseConnection = (definition) => definition;
145
+ exports.onPremiseConnection = onPremiseConnection;
138
146
  /**
139
147
  * For information on writing custom component connections, see
140
148
  * https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.
@@ -215,8 +215,9 @@ const codeNativeIntegrationComponent = ({ name, iconPath, description, flows = [
215
215
  if (!(0, types_1.isDataSourceConfigVar)(configVar)) {
216
216
  return result;
217
217
  }
218
+ const camelKey = (0, lodash_1.camelCase)(key);
218
219
  const dataSource = (0, lodash_1.pick)(configVar, ["perform", "dataSourceType"]);
219
- return Object.assign(Object.assign({}, result), { [key]: Object.assign(Object.assign({}, dataSource), { key: (0, lodash_1.camelCase)(key), display: {
220
+ return Object.assign(Object.assign({}, result), { [camelKey]: Object.assign(Object.assign({}, dataSource), { key: camelKey, display: {
220
221
  label: key,
221
222
  description: key,
222
223
  }, inputs: [] }) });
@@ -174,6 +174,7 @@ export interface Connection {
174
174
  iconPath?: string;
175
175
  inputs: (Input & {
176
176
  shown?: boolean;
177
+ onPremiseControlled?: boolean;
177
178
  })[];
178
179
  }
179
180
  export interface ConnectionValue {
@@ -19,6 +19,16 @@ export interface DefaultConnectionDefinition extends BaseConnectionDefinition {
19
19
  [key: string]: ConnectionInput;
20
20
  };
21
21
  }
22
+ declare type OnPremiseConnectionInput = ConnectionInput & {
23
+ onPremiseControlled: true;
24
+ };
25
+ export interface OnPremiseConnectionDefinition extends BaseConnectionDefinition {
26
+ inputs: {
27
+ host: OnPremiseConnectionInput;
28
+ port: OnPremiseConnectionInput;
29
+ [key: string]: ConnectionInput;
30
+ };
31
+ }
22
32
  interface OAuth2AuthorizationCodeConnectionDefinition extends BaseConnectionDefinition {
23
33
  oauth2Type: OAuth2Type.AuthorizationCode;
24
34
  /** The PKCE method (S256 or plain) that this OAuth 2.0 connection uses (if any) */
@@ -43,5 +53,5 @@ interface OAuth2ClientCredentialConnectionDefinition extends BaseConnectionDefin
43
53
  };
44
54
  }
45
55
  export declare type OAuth2ConnectionDefinition = OAuth2AuthorizationCodeConnectionDefinition | OAuth2ClientCredentialConnectionDefinition;
46
- export declare type ConnectionDefinition = DefaultConnectionDefinition | OAuth2AuthorizationCodeConnectionDefinition | OAuth2ClientCredentialConnectionDefinition;
56
+ export declare type ConnectionDefinition = DefaultConnectionDefinition | OnPremiseConnectionDefinition | OAuth2ConnectionDefinition;
47
57
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"