@prismatic-io/spectral 10.11.1 → 10.11.2

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.
@@ -90,3 +90,9 @@ export type BooleanExpression = [
90
90
  ...ConditionalExpression[]
91
91
  ];
92
92
  export type ConditionalExpression = TermExpression | BooleanExpression;
93
+ export declare const OPERATOR_PHRASE_TO_EXPRESSION: {
94
+ [clause: string]: {
95
+ expression: string;
96
+ includes?: Array<string>;
97
+ };
98
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TermOperatorPhrase = exports.BinaryOperatorPhrase = exports.BinaryOperator = exports.UnaryOperatorPhrase = exports.UnaryOperator = exports.BooleanOperatorPhrase = exports.BooleanOperator = void 0;
3
+ exports.OPERATOR_PHRASE_TO_EXPRESSION = exports.TermOperatorPhrase = exports.BinaryOperatorPhrase = exports.BinaryOperator = exports.UnaryOperatorPhrase = exports.UnaryOperator = exports.BooleanOperatorPhrase = exports.BooleanOperator = void 0;
4
4
  // GraphQL-derived enums use the same name as the constant for the value,
5
5
  // but depending on how things shake out, we may be able to combine with the phrases below.
6
6
  var BooleanOperator;
@@ -66,3 +66,95 @@ exports.BinaryOperatorPhrase = {
66
66
  [BinaryOperator.dateTimeSame]: "is the same (date/time)",
67
67
  };
68
68
  exports.TermOperatorPhrase = Object.assign(Object.assign({}, exports.UnaryOperatorPhrase), exports.BinaryOperatorPhrase);
69
+ exports.OPERATOR_PHRASE_TO_EXPRESSION = {
70
+ [BinaryOperator.equal]: {
71
+ expression: "isEqual($LEFT_TERM, $RIGHT_TERM)",
72
+ includes: ["isEqual"],
73
+ },
74
+ [BinaryOperator.exactlyMatches]: {
75
+ expression: "$LEFT_TERM === $RIGHT_TERM || isDeepEqual($LEFT_TERM, $RIGHT_TERM)",
76
+ includes: ["isDeepEqual"],
77
+ },
78
+ [BinaryOperator.notEqual]: {
79
+ expression: "!(isEqual($LEFT_TERM, $RIGHT_TERM))",
80
+ includes: ["isEqual"],
81
+ },
82
+ [BinaryOperator.doesNotExactlyMatch]: {
83
+ expression: "!($LEFT_TERM === $RIGHT_TERM || isDeepEqual($LEFT_TERM, $RIGHT_TERM))",
84
+ includes: ["isDeepEqual"],
85
+ },
86
+ [BinaryOperator.greaterThan]: {
87
+ expression: "$LEFT_TERM > $RIGHT_TERM",
88
+ },
89
+ [BinaryOperator.greaterThanOrEqual]: {
90
+ expression: "$LEFT_TERM >= $RIGHT_TERM",
91
+ },
92
+ [BinaryOperator.lessThan]: {
93
+ expression: "$LEFT_TERM < $RIGHT_TERM",
94
+ },
95
+ [BinaryOperator.lessThanOrEqual]: {
96
+ expression: "$LEFT_TERM <= $RIGHT_TERM",
97
+ },
98
+ [BinaryOperator.in]: {
99
+ expression: "contains($RIGHT_TERM, $LEFT_TERM)",
100
+ includes: ["contains"],
101
+ },
102
+ [BinaryOperator.notIn]: {
103
+ expression: "!contains($RIGHT_TERM, $LEFT_TERM)",
104
+ includes: ["contains"],
105
+ },
106
+ [BinaryOperator.startsWith]: {
107
+ expression: "$RIGHT_TERM.startsWith($LEFT_TERM)",
108
+ },
109
+ [BinaryOperator.doesNotStartWith]: {
110
+ expression: "!$RIGHT_TERM.startsWith($LEFT_TERM)",
111
+ },
112
+ [BinaryOperator.endsWith]: {
113
+ expression: "$RIGHT_TERM.endsWith($LEFT_TERM)",
114
+ },
115
+ [BinaryOperator.doesNotEndWith]: {
116
+ expression: "!$RIGHT_TERM.endsWith($LEFT_TERM)",
117
+ },
118
+ [BinaryOperator.dateTimeAfter]: {
119
+ expression: "dateIsAfter($LEFT_TERM, $RIGHT_TERM)",
120
+ includes: ["dateIsAfter"],
121
+ },
122
+ [BinaryOperator.dateTimeBefore]: {
123
+ expression: "dateIsBefore($LEFT_TERM, $RIGHT_TERM)",
124
+ includes: ["dateIsBefore"],
125
+ },
126
+ [BinaryOperator.dateTimeSame]: {
127
+ expression: "dateIsEqual($LEFT_TERM, $RIGHT_TERM)",
128
+ includes: ["dateIsEqual"],
129
+ },
130
+ [BooleanOperator.and]: {
131
+ expression: "$LEFT_TERM && $RIGHT_TERM",
132
+ },
133
+ [BooleanOperator.or]: {
134
+ expression: "$LEFT_TERM || $RIGHT_TERM",
135
+ },
136
+ [UnaryOperator.isTrue]: {
137
+ expression: "evaluatesTrue($LEFT_TERM)",
138
+ includes: ["evaluatesTrue"],
139
+ },
140
+ [UnaryOperator.isFalse]: {
141
+ expression: "evaluatesFalse($LEFT_TERM)",
142
+ includes: ["evaluatesFalse"],
143
+ },
144
+ [UnaryOperator.doesNotExist]: {
145
+ expression: "evaluatesNull($LEFT_TERM)",
146
+ includes: ["evaluatesNull"],
147
+ },
148
+ [UnaryOperator.exists]: {
149
+ expression: "!evaluatesNull($LEFT_TERM)",
150
+ includes: ["evaluatesNull"],
151
+ },
152
+ [UnaryOperator.isEmpty]: {
153
+ expression: "evaluatesEmpty($LEFT_TERM)",
154
+ includes: ["evaluatesEmpty"],
155
+ },
156
+ [UnaryOperator.isNotEmpty]: {
157
+ expression: "!evaluatesNull($LEFT_TERM)",
158
+ includes: ["evaluatesNull"],
159
+ },
160
+ };
@@ -139,7 +139,6 @@ type BaseDataSourceConfigVar<TDataSourceType extends DataSourceType = DataSource
139
139
  collectionType?: CollectionType | undefined;
140
140
  } & BaseConfigVar : TDataSourceType extends Exclude<DataSourceType, CollectionDataSourceType> ? TDataSourceType extends Extract<DataSourceType, "jsonForm"> ? BaseConfigVar & {
141
141
  dataSourceType: Extract<DataSourceType, "jsonForm">;
142
- dataSource?: never;
143
142
  collectionType?: undefined;
144
143
  validationMode?: ValidationMode;
145
144
  } : BaseConfigVar & {
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "10.11.1",
3
+ "version": "10.11.2",
4
4
  "description": "Utility library for building Prismatic connectors and code-native integrations",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "homepage": "https://prismatic.io",
9
9
  "bin": {
10
- "component-manifest": "./bin/component-manifest.js",
11
- "cni-component-manifest": "./bin/cni-component-manifest.js"
10
+ "component-manifest": "bin/component-manifest.js",
11
+ "cni-component-manifest": "bin/cni-component-manifest.js"
12
12
  },
13
13
  "bugs": {
14
14
  "url": "https://github.com/prismatic-io/spectral"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "https://github.com/prismatic-io/spectral.git"
18
+ "url": "git+https://github.com/prismatic-io/spectral.git"
19
19
  },
20
20
  "publishConfig": {
21
21
  "access": "public",