@prismatic-io/spectral 10.3.13 → 10.4.1-alpha.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/index.d.ts CHANGED
@@ -54,7 +54,16 @@ export declare const connectionConfigVar: <T extends ConnectionConfigVar = Conne
54
54
  /**
55
55
  * For information on writing Code Native Integrations, see
56
56
  * https://prismatic.io/docs/code-native-integrations/#adding-config-vars.
57
- * @param definition A Customer Connection Config Var type object.
57
+ * @param definition A Customer-Activated Connection Config Var type object.
58
+ * @returns This function returns a connection config var object that has the shape the Prismatic API expects.
59
+ */
60
+ export declare const customerActivatedConnection: <T extends {
61
+ stableKey: string;
62
+ }>(definition: T) => OrganizationActivatedConnectionConfigVar;
63
+ /**
64
+ * For information on writing Code Native Integrations, see
65
+ * https://prismatic.io/docs/code-native-integrations/#adding-config-vars.
66
+ * @param definition An Organization-Activated Connection Config Var type object.
58
67
  * @returns This function returns a connection config var object that has the shape the Prismatic API expects.
59
68
  */
60
69
  export declare const organizationActivatedConnection: <T extends {
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.componentManifests = exports.oauth2Connection = exports.onPremConnection = exports.connection = exports.input = exports.dataSource = exports.pollingTrigger = exports.trigger = exports.action = exports.component = exports.componentManifest = exports.organizationActivatedConnection = exports.connectionConfigVar = exports.dataSourceConfigVar = exports.configVar = exports.configPage = exports.flow = exports.integration = void 0;
25
+ exports.testing = exports.util = exports.componentManifests = exports.oauth2Connection = exports.onPremConnection = exports.connection = exports.input = exports.dataSource = exports.pollingTrigger = exports.trigger = exports.action = exports.component = exports.componentManifest = exports.organizationActivatedConnection = exports.customerActivatedConnection = exports.connectionConfigVar = exports.dataSourceConfigVar = exports.configVar = exports.configPage = exports.flow = exports.integration = void 0;
26
26
  const convertComponent_1 = require("./serverTypes/convertComponent");
27
27
  const convertIntegration_1 = require("./serverTypes/convertIntegration");
28
28
  /**
@@ -85,7 +85,17 @@ exports.connectionConfigVar = connectionConfigVar;
85
85
  /**
86
86
  * For information on writing Code Native Integrations, see
87
87
  * https://prismatic.io/docs/code-native-integrations/#adding-config-vars.
88
- * @param definition A Customer Connection Config Var type object.
88
+ * @param definition A Customer-Activated Connection Config Var type object.
89
+ * @returns This function returns a connection config var object that has the shape the Prismatic API expects.
90
+ */
91
+ const customerActivatedConnection = (definition) => {
92
+ return Object.assign(Object.assign({}, definition), { dataType: "connection" });
93
+ };
94
+ exports.customerActivatedConnection = customerActivatedConnection;
95
+ /**
96
+ * For information on writing Code Native Integrations, see
97
+ * https://prismatic.io/docs/code-native-integrations/#adding-config-vars.
98
+ * @param definition An Organization-Activated Connection Config Var type object.
89
99
  * @returns This function returns a connection config var object that has the shape the Prismatic API expects.
90
100
  */
91
101
  const organizationActivatedConnection = (definition) => {
@@ -341,7 +341,7 @@ const convertInputValue = (value, collectionType) => {
341
341
  /** Converts a Config Var into the structure necessary for YAML generation. */
342
342
  const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
343
343
  var _a, _b, _c;
344
- if ((0, types_1.isOrganizationActivatedConnectionConfigVar)(configVar)) {
344
+ if ((0, types_1.isConnectionScopedConfigVar)(configVar)) {
345
345
  const { stableKey } = (0, pick_1.default)(configVar, ["stableKey"]);
346
346
  return {
347
347
  key,
@@ -247,4 +247,5 @@ export interface Input {
247
247
  model?: InputFieldChoice[];
248
248
  language?: string;
249
249
  onPremiseControlled?: boolean;
250
+ dataSource?: string;
250
251
  }
@@ -87,6 +87,8 @@ interface BaseInputField {
87
87
  example?: string;
88
88
  /** Indicate if this InputField is required. */
89
89
  required?: boolean;
90
+ /** Key of the data source that can be used to set the value of this input. */
91
+ dataSource?: string;
90
92
  }
91
93
  type CollectionOptions<T> = SingleValue<T> | ValueListCollection<T> | KeyValueListCollection<T>;
92
94
  interface SingleValue<T> {
@@ -1,10 +1,14 @@
1
1
  import { type ConfigVar } from ".";
2
2
  import type { UnionToIntersection } from "./utils";
3
+ export type CustomerActivatedConnectionConfigVar = {
4
+ dataType: "connection";
5
+ stableKey: string;
6
+ };
3
7
  export type OrganizationActivatedConnectionConfigVar = {
4
8
  dataType: "connection";
5
9
  stableKey: string;
6
10
  };
7
- export type ScopedConfigVar = OrganizationActivatedConnectionConfigVar;
11
+ export type ScopedConfigVar = CustomerActivatedConnectionConfigVar | OrganizationActivatedConnectionConfigVar;
8
12
  /**
9
13
  * Root ScopedConfigVars type exposed for augmentation.
10
14
  *
@@ -25,5 +29,5 @@ type CreateScopedConfigVars<TScopedConfigVarMap> = keyof TScopedConfigVarMap ext
25
29
  [Key in TScopedConfigVarName]: TScopedConfigVarMap[TScopedConfigVarName];
26
30
  } : never : never : never>;
27
31
  export type ScopedConfigVarMap = CreateScopedConfigVars<IntegrationDefinitionScopedConfigVars>;
28
- export declare const isOrganizationActivatedConnectionConfigVar: (cv: ConfigVar) => cv is OrganizationActivatedConnectionConfigVar;
32
+ export declare const isConnectionScopedConfigVar: (cv: ConfigVar) => cv is OrganizationActivatedConnectionConfigVar;
29
33
  export {};
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isOrganizationActivatedConnectionConfigVar = void 0;
3
+ exports.isConnectionScopedConfigVar = void 0;
4
4
  const _1 = require(".");
5
- const isOrganizationActivatedConnectionConfigVar = (cv) => "dataType" in cv &&
5
+ const isConnectionScopedConfigVar = (cv) => "dataType" in cv &&
6
6
  cv.dataType === "connection" &&
7
7
  !(0, _1.isConnectionDefinitionConfigVar)(cv) &&
8
8
  !(0, _1.isConnectionReferenceConfigVar)(cv);
9
- exports.isOrganizationActivatedConnectionConfigVar = isOrganizationActivatedConnectionConfigVar;
9
+ exports.isConnectionScopedConfigVar = isConnectionScopedConfigVar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "10.3.13",
3
+ "version": "10.4.1-alpha.0",
4
4
  "description": "Utility library for building Prismatic connectors and code-native integrations",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",