@prismatic-io/spectral 9.2.0 → 9.3.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.
@@ -18,7 +18,12 @@ const lodash_1 = require("lodash");
18
18
  const convertInput = (key, _a) => {
19
19
  var { default: defaultValue, type, label, collection } = _a, rest = __rest(_a, ["default", "type", "label", "collection"]);
20
20
  const keyLabel = collection === "keyvaluelist" && typeof label === "object" ? label.key : undefined;
21
- return Object.assign(Object.assign({}, (0, lodash_1.omit)(rest, ["onPremControlled", "permissionAndVisibilityType", "visibleToOrgDeployer"])), { key,
21
+ return Object.assign(Object.assign({}, (0, lodash_1.omit)(rest, [
22
+ "onPremControlled",
23
+ "permissionAndVisibilityType",
24
+ "visibleToOrgDeployer",
25
+ "writeOnly",
26
+ ])), { key,
22
27
  type, default: defaultValue !== null && defaultValue !== void 0 ? defaultValue : types_1.InputFieldDefaultMap[type], collection, label: typeof label === "string" ? label : label.value, keyLabel, onPremiseControlled: ("onPremControlled" in rest && rest.onPremControlled) || undefined });
23
28
  };
24
29
  exports.convertInput = convertInput;
@@ -195,6 +195,10 @@ const convertComponentReference = (componentReference, componentRegistry, refere
195
195
  ? valueExpr
196
196
  : JSON.stringify(valueExpr);
197
197
  const meta = convertInputPermissionAndVisibility((0, lodash_1.pick)(value, ["permissionAndVisibilityType", "visibleToOrgDeployer"]));
198
+ const { writeOnly } = (0, lodash_1.pick)(value, ["writeOnly"]);
199
+ if (writeOnly) {
200
+ meta.writeOnly = writeOnly;
201
+ }
198
202
  return Object.assign(Object.assign({}, result), { [key]: { type: type, value: formattedValue, meta } });
199
203
  }
200
204
  if ("configVar" in value) {
@@ -358,6 +362,9 @@ const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
358
362
  return result;
359
363
  }
360
364
  const meta = convertInputPermissionAndVisibility((0, lodash_1.pick)(input, ["permissionAndVisibilityType", "visibleToOrgDeployer"]));
365
+ if (input.writeOnly) {
366
+ meta.writeOnly = input.writeOnly;
367
+ }
361
368
  const defaultValue = input.collection
362
369
  ? (input.default || []).map((defaultValue) => {
363
370
  if (typeof defaultValue === "string") {
@@ -30,7 +30,9 @@ type ComponentReferenceTypeValueMap<TValue, TMap extends Record<ComponentReferen
30
30
  actions: ValueExpression<TValue>;
31
31
  triggers: ValueExpression<TValue> | ConfigVarExpression;
32
32
  dataSources: ValueExpression<TValue> | ConfigVarExpression;
33
- connections: (ValueExpression<TValue> | ConfigVarExpression) & ConfigVarVisibility;
33
+ connections: (ValueExpression<TValue> | ConfigVarExpression) & ConfigVarVisibility & {
34
+ writeOnly?: true;
35
+ };
34
36
  }> = TMap;
35
37
  export type ComponentReference<TComponentReference extends {
36
38
  component: string;
@@ -66,6 +66,7 @@ export declare const InputFieldDefaultMap: Record<InputFieldType, string | undef
66
66
  export type Inputs = Record<string, InputFieldDefinition>;
67
67
  export type ConnectionInput = (StringInputField | DataInputField | TextInputField | PasswordInputField | BooleanInputField) & {
68
68
  shown?: boolean;
69
+ writeOnly?: true;
69
70
  };
70
71
  export type OnPremConnectionInput = {
71
72
  onPremControlled: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "9.2.0",
3
+ "version": "9.3.1",
4
4
  "description": "Utility library for building Prismatic components and code-native integrations",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",