@prismatic-io/spectral 9.0.3 → 9.0.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.
@@ -57,7 +57,11 @@ exports.INPUT_TYPE_MAP = {
57
57
  };
58
58
  const getInputValueType = (input) => {
59
59
  const valueType = input.model
60
- ? input.model.map((choice) => `"${choice.value}"`).join(" | ")
60
+ ? input.model
61
+ .map((choice) => {
62
+ return `\`${choice.value.replaceAll("\r", "\\r").replaceAll("\n", "\\n")}\``;
63
+ })
64
+ .join(" | ")
61
65
  : exports.INPUT_TYPE_MAP[input.type] || "never";
62
66
  if (input.collection === "keyvaluelist") {
63
67
  return `Record<string, ${valueType}> | Array<{key: string, value: ${valueType}}>`;
@@ -334,8 +334,8 @@ const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
334
334
  description,
335
335
  key,
336
336
  dataType: "connection",
337
- connection: Object.assign(Object.assign({}, ref), { template,
338
- onPremiseConnectionConfig }),
337
+ onPremiseConnectionConfig,
338
+ connection: Object.assign(Object.assign({}, ref), { template }),
339
339
  inputs,
340
340
  orgOnly,
341
341
  meta,
@@ -7,7 +7,6 @@ export type ComponentReference = {
7
7
  };
8
8
  key: string;
9
9
  template?: string;
10
- onPremiseConnectionConfig?: string;
11
10
  } | {
12
11
  component: {
13
12
  key: string;
@@ -16,7 +15,6 @@ export type ComponentReference = {
16
15
  };
17
16
  key: string;
18
17
  template?: string;
19
- onPremiseConnectionConfig?: string;
20
18
  };
21
19
  export type Input = {
22
20
  name?: string | Input;
@@ -35,6 +33,7 @@ export interface ConnectionRequiredConfigVariable {
35
33
  description?: string;
36
34
  orgOnly?: boolean;
37
35
  dataType: "connection";
36
+ onPremiseConnectionConfig?: string;
38
37
  connection: ComponentReference;
39
38
  inputs?: Record<string, Input>;
40
39
  meta?: Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { DataSourceDefinition, ConnectionDefinition, Inputs, DataSourceType, Connection, JSONForm, ObjectFieldMap, ObjectSelection, ConfigVarResultCollection, Schedule, CollectionDataSourceType, DataSourceReference, ConfigPage, ConfigPages, ConfigPageElement, ComponentRegistryDataSource, ComponentRegistryConnection } from ".";
1
+ import { DataSourceDefinition, ConnectionDefinition, Inputs, DataSourceType, Connection, JSONForm, ObjectFieldMap, ObjectSelection, ConfigVarResultCollection, Schedule, CollectionDataSourceType, DataSourceReference, ConfigPage, ConfigPages, ConfigPageElement, ComponentRegistryDataSource, ComponentRegistryConnection, UserLevelConfigPages } from ".";
2
2
  import { Prettify, UnionToIntersection } from "./utils";
3
3
  /** Supported data types for Config Vars. */
4
4
  export type ConfigVarDataType = "string" | "date" | "timestamp" | "picklist" | "code" | "boolean" | "number" | "schedule" | "objectSelection" | "objectFieldMap" | "jsonForm";
@@ -144,7 +144,7 @@ type ExtractConfigVars<TConfigPages extends {
144
144
  }> = keyof TConfigPages extends infer TPageName ? TPageName extends keyof TConfigPages ? TConfigPages[TPageName] extends infer TConfigPage ? TConfigPage extends ConfigPage ? {
145
145
  [Key in keyof TConfigPage["elements"] as Key extends string ? TConfigPage["elements"][Key] extends ConfigVar ? Key : never : never]: ElementToRuntimeType<TConfigPage["elements"][Key]>;
146
146
  } : never : never : never : never;
147
- export type ConfigVars = Prettify<UnionToIntersection<ExtractConfigVars<ConfigPages>>>;
147
+ export type ConfigVars = Prettify<UnionToIntersection<ExtractConfigVars<ConfigPages>>> & Prettify<UnionToIntersection<ExtractConfigVars<UserLevelConfigPages>>>;
148
148
  export declare const isCodeConfigVar: (cv: ConfigVar) => cv is CodeConfigVar;
149
149
  export declare const isScheduleConfigVar: (cv: ConfigVar) => cv is ScheduleConfigVar;
150
150
  export declare const isDataSourceDefinitionConfigVar: (cv: ConfigVar) => cv is DataSourceDefinitionConfigVar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "9.0.3",
3
+ "version": "9.0.5",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",