@prismatic-io/spectral 10.5.1 → 10.5.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.
- package/dist/types/ConfigVars.d.ts +1 -1
- package/dist/types/Inputs.d.ts +2 -1
- package/dist/types/jsonforms/JsonSchema.d.ts +231 -0
- package/dist/types/jsonforms/JsonSchema.js +2 -0
- package/dist/types/jsonforms/UISchemaElement.d.ts +64 -0
- package/dist/types/jsonforms/UISchemaElement.js +24 -0
- package/dist/types/jsonforms/ValidationMode.d.ts +1 -0
- package/dist/types/jsonforms/ValidationMode.js +2 -0
- package/package.json +2 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationMode } from "
|
|
1
|
+
import { ValidationMode } from "./jsonforms/ValidationMode";
|
|
2
2
|
import { type DataSourceDefinition, type ConnectionDefinition, type Inputs, type DataSourceType, type Connection, type JSONForm, type ObjectFieldMap, type ObjectSelection, type ConfigVarResultCollection, type Schedule, type CollectionDataSourceType, type DataSourceReference, type ConfigPage, type ConfigPages, type ConfigPageElement, type ComponentRegistryDataSource, type ComponentRegistryConnection, type UserLevelConfigPages, type OrganizationActivatedConnectionConfigVar, type ScopedConfigVarMap } from ".";
|
|
3
3
|
import type { Prettify, UnionToIntersection } from "./utils";
|
|
4
4
|
/** Supported data types for config variables. */
|
package/dist/types/Inputs.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConditionalExpression } from "./conditional-logic";
|
|
2
|
-
import { JsonSchema
|
|
2
|
+
import { JsonSchema } from "./jsonforms/JsonSchema";
|
|
3
|
+
import { UISchemaElement } from "./jsonforms/UISchemaElement";
|
|
3
4
|
/**
|
|
4
5
|
* KeyValuePair input parameter type.
|
|
5
6
|
* This allows users to input multiple keys / values as an input.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
export type JsonSchema = JsonSchema4 | JsonSchema7;
|
|
2
|
+
interface JsonSchema4 {
|
|
3
|
+
$ref?: string;
|
|
4
|
+
/**
|
|
5
|
+
* This is important because it tells refs where
|
|
6
|
+
* the root of the document is located
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* It is recommended that the meta-schema is
|
|
11
|
+
* included in the root of any JSON Schema
|
|
12
|
+
*/
|
|
13
|
+
$schema?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Title of the schema
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Schema description
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Default json for the object represented by
|
|
24
|
+
* this schema
|
|
25
|
+
*/
|
|
26
|
+
default?: any;
|
|
27
|
+
/**
|
|
28
|
+
* The value must be a multiple of the number
|
|
29
|
+
* (e.g. 10 is a multiple of 5)
|
|
30
|
+
*/
|
|
31
|
+
multipleOf?: number;
|
|
32
|
+
maximum?: number;
|
|
33
|
+
/**
|
|
34
|
+
* If true maximum must be > value, >= otherwise
|
|
35
|
+
*/
|
|
36
|
+
exclusiveMaximum?: boolean;
|
|
37
|
+
minimum?: number;
|
|
38
|
+
/**
|
|
39
|
+
* If true minimum must be < value, <= otherwise
|
|
40
|
+
*/
|
|
41
|
+
exclusiveMinimum?: boolean;
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
minLength?: number;
|
|
44
|
+
/**
|
|
45
|
+
* This is a regex string that the value must
|
|
46
|
+
* conform to
|
|
47
|
+
*/
|
|
48
|
+
pattern?: string;
|
|
49
|
+
additionalItems?: boolean | JsonSchema4;
|
|
50
|
+
items?: JsonSchema4 | JsonSchema4[];
|
|
51
|
+
maxItems?: number;
|
|
52
|
+
minItems?: number;
|
|
53
|
+
uniqueItems?: boolean;
|
|
54
|
+
maxProperties?: number;
|
|
55
|
+
minProperties?: number;
|
|
56
|
+
required?: string[];
|
|
57
|
+
additionalProperties?: boolean | JsonSchema4;
|
|
58
|
+
/**
|
|
59
|
+
* Holds simple JSON Schema definitions for
|
|
60
|
+
* referencing from elsewhere.
|
|
61
|
+
*/
|
|
62
|
+
definitions?: {
|
|
63
|
+
[key: string]: JsonSchema4;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The keys that can exist on the object with the
|
|
67
|
+
* json schema that should validate their value
|
|
68
|
+
*/
|
|
69
|
+
properties?: {
|
|
70
|
+
[property: string]: JsonSchema4;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The key of this object is a regex for which
|
|
74
|
+
* properties the schema applies to
|
|
75
|
+
*/
|
|
76
|
+
patternProperties?: {
|
|
77
|
+
[pattern: string]: JsonSchema4;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* If the key is present as a property then the
|
|
81
|
+
* string of properties must also be present.
|
|
82
|
+
* If the value is a JSON Schema then it must
|
|
83
|
+
* also be valid for the object if the key is
|
|
84
|
+
* present.
|
|
85
|
+
*/
|
|
86
|
+
dependencies?: {
|
|
87
|
+
[key: string]: JsonSchema4 | string[];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Enumerates the values that this schema can be
|
|
91
|
+
* e.g.
|
|
92
|
+
* {"type": "string",
|
|
93
|
+
* "enum": ["red", "green", "blue"]}
|
|
94
|
+
*/
|
|
95
|
+
enum?: any[];
|
|
96
|
+
/**
|
|
97
|
+
* The basic type of this schema, can be one of
|
|
98
|
+
* [string, number, object, array, boolean, null]
|
|
99
|
+
* or an array of the acceptable types
|
|
100
|
+
*/
|
|
101
|
+
type?: string | string[];
|
|
102
|
+
allOf?: JsonSchema4[];
|
|
103
|
+
anyOf?: JsonSchema4[];
|
|
104
|
+
oneOf?: JsonSchema4[];
|
|
105
|
+
/**
|
|
106
|
+
* The entity being validated must not match this schema
|
|
107
|
+
*/
|
|
108
|
+
not?: JsonSchema4;
|
|
109
|
+
format?: string;
|
|
110
|
+
const?: any;
|
|
111
|
+
}
|
|
112
|
+
interface JsonSchema7 {
|
|
113
|
+
$ref?: string;
|
|
114
|
+
/**
|
|
115
|
+
* This is important because it tells refs where
|
|
116
|
+
* the root of the document is located
|
|
117
|
+
*/
|
|
118
|
+
$id?: string;
|
|
119
|
+
/**
|
|
120
|
+
* It is recommended that the meta-schema is
|
|
121
|
+
* included in the root of any JSON Schema
|
|
122
|
+
*/
|
|
123
|
+
$schema?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Title of the schema
|
|
126
|
+
*/
|
|
127
|
+
title?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Schema description
|
|
130
|
+
*/
|
|
131
|
+
description?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Default json for the object represented by
|
|
134
|
+
* this schema
|
|
135
|
+
*/
|
|
136
|
+
default?: any;
|
|
137
|
+
/**
|
|
138
|
+
* The value must be a multiple of the number
|
|
139
|
+
* (e.g. 10 is a multiple of 5)
|
|
140
|
+
*/
|
|
141
|
+
multipleOf?: number;
|
|
142
|
+
maximum?: number;
|
|
143
|
+
/**
|
|
144
|
+
* If true maximum must be > value, >= otherwise
|
|
145
|
+
*/
|
|
146
|
+
exclusiveMaximum?: number;
|
|
147
|
+
minimum?: number;
|
|
148
|
+
/**
|
|
149
|
+
* If true minimum must be < value, <= otherwise
|
|
150
|
+
*/
|
|
151
|
+
exclusiveMinimum?: number;
|
|
152
|
+
maxLength?: number;
|
|
153
|
+
minLength?: number;
|
|
154
|
+
/**
|
|
155
|
+
* This is a regex string that the value must
|
|
156
|
+
* conform to
|
|
157
|
+
*/
|
|
158
|
+
pattern?: string;
|
|
159
|
+
additionalItems?: boolean | JsonSchema7;
|
|
160
|
+
items?: JsonSchema7 | JsonSchema7[];
|
|
161
|
+
maxItems?: number;
|
|
162
|
+
minItems?: number;
|
|
163
|
+
uniqueItems?: boolean;
|
|
164
|
+
maxProperties?: number;
|
|
165
|
+
minProperties?: number;
|
|
166
|
+
required?: string[];
|
|
167
|
+
additionalProperties?: boolean | JsonSchema7;
|
|
168
|
+
/**
|
|
169
|
+
* Holds simple JSON Schema definitions for
|
|
170
|
+
* referencing from elsewhere.
|
|
171
|
+
*/
|
|
172
|
+
definitions?: {
|
|
173
|
+
[key: string]: JsonSchema7;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* The keys that can exist on the object with the
|
|
177
|
+
* json schema that should validate their value
|
|
178
|
+
*/
|
|
179
|
+
properties?: {
|
|
180
|
+
[property: string]: JsonSchema7;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The key of this object is a regex for which
|
|
184
|
+
* properties the schema applies to
|
|
185
|
+
*/
|
|
186
|
+
patternProperties?: {
|
|
187
|
+
[pattern: string]: JsonSchema7;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* If the key is present as a property then the
|
|
191
|
+
* string of properties must also be present.
|
|
192
|
+
* If the value is a JSON Schema then it must
|
|
193
|
+
* also be valid for the object if the key is
|
|
194
|
+
* present.
|
|
195
|
+
*/
|
|
196
|
+
dependencies?: {
|
|
197
|
+
[key: string]: JsonSchema7 | string[];
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Enumerates the values that this schema can be
|
|
201
|
+
* e.g.
|
|
202
|
+
* {"type": "string",
|
|
203
|
+
* "enum": ["red", "green", "blue"]}
|
|
204
|
+
*/
|
|
205
|
+
enum?: any[];
|
|
206
|
+
/**
|
|
207
|
+
* The basic type of this schema, can be one of
|
|
208
|
+
* [string, number, object, array, boolean, null]
|
|
209
|
+
* or an array of the acceptable types
|
|
210
|
+
*/
|
|
211
|
+
type?: string | string[];
|
|
212
|
+
allOf?: JsonSchema7[];
|
|
213
|
+
anyOf?: JsonSchema7[];
|
|
214
|
+
oneOf?: JsonSchema7[];
|
|
215
|
+
/**
|
|
216
|
+
* The entity being validated must not match this schema
|
|
217
|
+
*/
|
|
218
|
+
not?: JsonSchema7;
|
|
219
|
+
format?: string;
|
|
220
|
+
readOnly?: boolean;
|
|
221
|
+
writeOnly?: boolean;
|
|
222
|
+
examples?: any[];
|
|
223
|
+
contains?: JsonSchema7;
|
|
224
|
+
propertyNames?: JsonSchema7;
|
|
225
|
+
const?: any;
|
|
226
|
+
if?: JsonSchema7;
|
|
227
|
+
then?: JsonSchema7;
|
|
228
|
+
else?: JsonSchema7;
|
|
229
|
+
errorMessage?: any;
|
|
230
|
+
}
|
|
231
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common base interface for any UI schema element.
|
|
3
|
+
*/
|
|
4
|
+
export interface UISchemaElement {
|
|
5
|
+
/**
|
|
6
|
+
* The type of this UI schema element.
|
|
7
|
+
*/
|
|
8
|
+
type: string;
|
|
9
|
+
/**
|
|
10
|
+
* An optional rule.
|
|
11
|
+
*/
|
|
12
|
+
rule?: Rule;
|
|
13
|
+
/**
|
|
14
|
+
* Any additional options.
|
|
15
|
+
*/
|
|
16
|
+
options?: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A rule that may be attached to any UI schema element.
|
|
22
|
+
*/
|
|
23
|
+
interface Rule {
|
|
24
|
+
/**
|
|
25
|
+
* The effect of the rule
|
|
26
|
+
*/
|
|
27
|
+
effect: RuleEffect;
|
|
28
|
+
/**
|
|
29
|
+
* The condition of the rule that must evaluate to true in order
|
|
30
|
+
* to trigger the effect.
|
|
31
|
+
*/
|
|
32
|
+
condition: Condition;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The different rule effects.
|
|
36
|
+
*/
|
|
37
|
+
declare enum RuleEffect {
|
|
38
|
+
/**
|
|
39
|
+
* Effect that hides the associated element.
|
|
40
|
+
*/
|
|
41
|
+
HIDE = "HIDE",
|
|
42
|
+
/**
|
|
43
|
+
* Effect that shows the associated element.
|
|
44
|
+
*/
|
|
45
|
+
SHOW = "SHOW",
|
|
46
|
+
/**
|
|
47
|
+
* Effect that enables the associated element.
|
|
48
|
+
*/
|
|
49
|
+
ENABLE = "ENABLE",
|
|
50
|
+
/**
|
|
51
|
+
* Effect that disables the associated element.
|
|
52
|
+
*/
|
|
53
|
+
DISABLE = "DISABLE"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Represents a condition to be evaluated.
|
|
57
|
+
*/
|
|
58
|
+
interface Condition {
|
|
59
|
+
/**
|
|
60
|
+
* The type of condition.
|
|
61
|
+
*/
|
|
62
|
+
readonly type?: string;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* The different rule effects.
|
|
5
|
+
*/
|
|
6
|
+
var RuleEffect;
|
|
7
|
+
(function (RuleEffect) {
|
|
8
|
+
/**
|
|
9
|
+
* Effect that hides the associated element.
|
|
10
|
+
*/
|
|
11
|
+
RuleEffect["HIDE"] = "HIDE";
|
|
12
|
+
/**
|
|
13
|
+
* Effect that shows the associated element.
|
|
14
|
+
*/
|
|
15
|
+
RuleEffect["SHOW"] = "SHOW";
|
|
16
|
+
/**
|
|
17
|
+
* Effect that enables the associated element.
|
|
18
|
+
*/
|
|
19
|
+
RuleEffect["ENABLE"] = "ENABLE";
|
|
20
|
+
/**
|
|
21
|
+
* Effect that disables the associated element.
|
|
22
|
+
*/
|
|
23
|
+
RuleEffect["DISABLE"] = "DISABLE";
|
|
24
|
+
})(RuleEffect || (RuleEffect = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ValidationMode = "ValidateAndShow" | "ValidateAndHide" | "NoValidation";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.2",
|
|
4
4
|
"description": "Utility library for building Prismatic connectors and code-native integrations",
|
|
5
5
|
"keywords": ["prismatic"],
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,12 +33,10 @@
|
|
|
33
33
|
"format": "yarn run lint-fix && biome format --write .",
|
|
34
34
|
"check-format": "biome format .",
|
|
35
35
|
"check": "yarn run check-format && yarn run lint",
|
|
36
|
-
"test": "jest"
|
|
37
|
-
"docs": "rm -f sidebars.{js,jse} && typedoc"
|
|
36
|
+
"test": "jest"
|
|
38
37
|
},
|
|
39
38
|
"files": ["dist/"],
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"@jsonforms/core": "3.0.0",
|
|
42
40
|
"axios": "1.8.3",
|
|
43
41
|
"axios-retry": "4.5.0",
|
|
44
42
|
"date-fns": "2.30.0",
|
|
@@ -71,9 +69,6 @@
|
|
|
71
69
|
"fast-check": "2.16.0",
|
|
72
70
|
"jest": "29.7.0",
|
|
73
71
|
"ts-jest": "29.1.2",
|
|
74
|
-
"typedoc": "0.17.7",
|
|
75
|
-
"typedoc-plugin-markdown": "2.4.2",
|
|
76
|
-
"typedoc-plugin-remove-references": "0.0.5",
|
|
77
72
|
"typescript": "5.5.3"
|
|
78
73
|
}
|
|
79
74
|
}
|