@prismatic-io/spectral 8.1.3 → 8.1.5

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.
@@ -67,7 +67,8 @@ const contains = (container, containee) => {
67
67
  if (typeof container === "object" && container !== null) {
68
68
  if (Array.isArray(container)) {
69
69
  // Array member check.
70
- return container.includes(containee);
70
+ return (container.includes(containee) ||
71
+ container.includes((0, exports.parseValue)(containee)));
71
72
  }
72
73
  // Object attribute check (set membership).
73
74
  return Object.prototype.hasOwnProperty.call(container, `${containee}`);
@@ -226,9 +227,9 @@ const evaluate = (expression) => {
226
227
  case types_1.BinaryOperator.lessThanOrEqual:
227
228
  return left <= right;
228
229
  case types_1.BinaryOperator.in:
229
- return (0, exports.contains)(right, left);
230
+ return (0, exports.contains)(right, leftTerm);
230
231
  case types_1.BinaryOperator.notIn:
231
- return !(0, exports.contains)(right, left);
232
+ return !(0, exports.contains)(right, leftTerm);
232
233
  case types_1.BinaryOperator.exactlyMatches:
233
234
  return left === right || lodash_1.default.isEqual(left, right);
234
235
  case types_1.BinaryOperator.doesNotExactlyMatch:
@@ -195,7 +195,7 @@ const convertConfigVar = (key, configVar, referenceKey) => {
195
195
  }
196
196
  if ((0, types_1.isConnectionReferenceConfigVar)(configVar)) {
197
197
  const { ref, inputs } = convertComponentReference(configVar.connection);
198
- return Object.assign(Object.assign({}, (0, lodash_1.pick)(configVar, ["stableKey", "description", "orgOnly"])), { key, dataType: "connection", connection: ref, inputs });
198
+ return Object.assign(Object.assign({}, (0, lodash_1.pick)(configVar, ["stableKey", "description", "orgOnly"])), { key, dataType: "connection", connection: Object.assign(Object.assign({}, ref), { template: configVar.connection.template }), inputs });
199
199
  }
200
200
  const result = (0, lodash_1.assign)({ meta, key }, (0, lodash_1.pick)(configVar, [
201
201
  "stableKey",
@@ -6,6 +6,7 @@ export interface ComponentReference {
6
6
  isPublic: boolean;
7
7
  };
8
8
  key: string;
9
+ template?: string;
9
10
  }
10
11
  export declare type Input = {
11
12
  name?: string;
@@ -56,7 +56,7 @@ export declare type JSONForm = {
56
56
  /**
57
57
  * Optional default data to use in the inputs of your form
58
58
  */
59
- data?: Record<string, unknown>;
59
+ data?: Record<string, unknown> | unknown[];
60
60
  };
61
61
  export declare type DynamicObjectSelection = string;
62
62
  export declare type DynamicFieldSelection = string;
@@ -118,7 +118,9 @@ declare type DataSourceReferenceConfigVar<TComponents extends ComponentSelector<
118
118
  export declare type DataSourceConfigVar<TComponents extends ComponentSelector<any>> = DataSourceDefinitionConfigVar | DataSourceReferenceConfigVar<TComponents>;
119
119
  declare type ConnectionDefinitionConfigVar = BaseConfigVar & Omit<ConnectionDefinition, "label" | "comments" | "key">;
120
120
  declare type ConnectionReferenceConfigVar<TComponents extends ComponentSelector<any>> = BaseConfigVar & {
121
- connection: ToComponentReferences<"connection", TComponents>;
121
+ connection: ToComponentReferences<"connection", TComponents> & {
122
+ template?: string;
123
+ };
122
124
  };
123
125
  /** Defines attributes of a Config Var that represents a Connection. */
124
126
  export declare type ConnectionConfigVar<TComponents extends ComponentSelector<any>> = ConnectionDefinitionConfigVar | ConnectionReferenceConfigVar<TComponents>;
@@ -216,6 +218,7 @@ export interface ComponentReference<TValueType, TConfigPages extends ConfigPages
216
218
  values?: {
217
219
  [key: string]: ValueReference<TValueType, TConfigPages>;
218
220
  };
221
+ template?: string;
219
222
  }
220
223
  export declare const isComponentReference: (ref: unknown) => ref is ComponentReference<any, ConfigPages<any>>;
221
224
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "8.1.3",
3
+ "version": "8.1.5",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"