@splunk/visualization-schemas 27.2.1 → 27.4.0

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.
Files changed (37) hide show
  1. package/dist/cjs/index.js +98 -2
  2. package/dist/cjs/index.js.map +2 -2
  3. package/dist/esm/index.js +98 -2
  4. package/dist/esm/index.js.map +2 -2
  5. package/dist/types/index.d.ts +4 -0
  6. package/dist/types/optionsSchemas/area.d.ts +1 -0
  7. package/dist/types/optionsSchemas/bar.d.ts +1 -0
  8. package/dist/types/optionsSchemas/bubble.d.ts +1 -0
  9. package/dist/types/optionsSchemas/choroplethSvg.d.ts +1 -0
  10. package/dist/types/optionsSchemas/column.d.ts +1 -0
  11. package/dist/types/optionsSchemas/ellipse.d.ts +1 -0
  12. package/dist/types/optionsSchemas/events.d.ts +1 -0
  13. package/dist/types/optionsSchemas/fillerGauge.d.ts +1 -0
  14. package/dist/types/optionsSchemas/image.d.ts +1 -0
  15. package/dist/types/optionsSchemas/index.d.ts +25 -0
  16. package/dist/types/optionsSchemas/line.d.ts +1 -0
  17. package/dist/types/optionsSchemas/linkGraph.d.ts +1 -0
  18. package/dist/types/optionsSchemas/map.d.ts +1 -0
  19. package/dist/types/optionsSchemas/markdown.d.ts +1 -0
  20. package/dist/types/optionsSchemas/markerGauge.d.ts +1 -0
  21. package/dist/types/optionsSchemas/parallelCoordinates.d.ts +1 -0
  22. package/dist/types/optionsSchemas/pie.d.ts +1 -0
  23. package/dist/types/optionsSchemas/punchcard.d.ts +1 -0
  24. package/dist/types/optionsSchemas/rectangle.d.ts +1 -0
  25. package/dist/types/optionsSchemas/sankey.d.ts +1 -0
  26. package/dist/types/optionsSchemas/scatter.d.ts +1 -0
  27. package/dist/types/optionsSchemas/singleValue.d.ts +1 -0
  28. package/dist/types/optionsSchemas/singleValueIcon.d.ts +1 -0
  29. package/dist/types/optionsSchemas/singleValueRadial.d.ts +1 -0
  30. package/dist/types/optionsSchemas/table.d.ts +1 -0
  31. package/dist/types/optionsSchemas/timeline.d.ts +1 -0
  32. package/dist/types/types/index.d.ts +4 -0
  33. package/dist/types/utils/constants.d.ts +24 -0
  34. package/dist/types/utils/enhanceSchemaWithDynamicOptions.d.ts +8 -0
  35. package/dist/types/utils/index.d.ts +3 -0
  36. package/dist/types/utils/schemaUtils.d.ts +244 -0
  37. package/package.json +8 -9
@@ -0,0 +1,4 @@
1
+ export * from './optionsSchemas';
2
+ export * from './utils';
3
+ export * as SchemaUtils from './utils/schemaUtils';
4
+ export type { OptionsSchema } from './types';
@@ -0,0 +1 @@
1
+ export declare const areaOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const barOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const bubbleOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const choroplethSvgOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const columnOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const ellipseOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const eventsOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const fillerGaugeOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const imageOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1,25 @@
1
+ export * from './area';
2
+ export * from './bar';
3
+ export * from './bubble';
4
+ export * from './choroplethSvg';
5
+ export * from './column';
6
+ export * from './ellipse';
7
+ export * from './events';
8
+ export * from './fillerGauge';
9
+ export * from './image';
10
+ export * from './line';
11
+ export * from './linkGraph';
12
+ export * from './map';
13
+ export * from './markdown';
14
+ export * from './markerGauge';
15
+ export * from './parallelCoordinates';
16
+ export * from './pie';
17
+ export * from './punchcard';
18
+ export * from './rectangle';
19
+ export * from './sankey';
20
+ export * from './scatter';
21
+ export * from './singleValue';
22
+ export * from './singleValueIcon';
23
+ export * from './singleValueRadial';
24
+ export * from './table';
25
+ export * from './timeline';
@@ -0,0 +1 @@
1
+ export declare const lineOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const linkGraphOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const mapOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const markdownOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const markerGaugeOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const parallelCoordinatesOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const pieOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const punchcardOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const rectangleOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const sankeyOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const scatterOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const singleValueOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const singleValueIconOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const singleValueRadialOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const tableOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1 @@
1
+ export declare const timelineOptionsSchema: import("..").OptionsSchema;
@@ -0,0 +1,4 @@
1
+ import type { JSONSchema7 } from 'json-schema';
2
+ export interface OptionsSchema {
3
+ [key: string]: JSONSchema7;
4
+ }
@@ -0,0 +1,24 @@
1
+ export declare const validSegmentationModes: readonly ["none", "inner"];
2
+ export declare enum LAYER_TYPE {
3
+ Marker = "marker",
4
+ Bubble = "bubble",
5
+ Choropleth = "choropleth"
6
+ }
7
+ export declare enum LAYOUT_TYPE {
8
+ Off = "off",
9
+ Trellis = "trellis"
10
+ }
11
+ export declare const validCellRenderers: readonly ["TextCell", "ArrayCell", "SparklineCell"];
12
+ export type CellRenderers = typeof validCellRenderers[number];
13
+ export declare const validSparklineTypes: readonly ["line", "area"];
14
+ export type SparklineType = typeof validSparklineTypes[number];
15
+ export declare const validHeaderVisibilities: readonly ["none", "fixed", "inline"];
16
+ export type TableHeaderVisibility = typeof validHeaderVisibilities[number];
17
+ export declare const validAlignments: readonly ["left", "center", "right"];
18
+ export type TableAlignment = typeof validAlignments[number];
19
+ export declare const validColumnAlignments: readonly ["left", "center", "right", "auto"];
20
+ export type ColumnAlignment = typeof validColumnAlignments[number];
21
+ export declare const validTextOverflows: readonly ["anywhere", "break-word", "ellipsis"];
22
+ export type TextOverflow = typeof validTextOverflows[number];
23
+ export declare const validFontSizes: readonly ["extraSmall", "small", "default", "large"];
24
+ export type FontSize = typeof validFontSizes[number];
@@ -0,0 +1,8 @@
1
+ import type { JSONSchema7Definition } from 'json-schema';
2
+ import type { OptionsSchema } from '../types';
3
+ /**
4
+ * Helper function to extend an options schema with dynamic options DSL
5
+ * @param optionsSchema a visualization's options schema
6
+ * @returns an updated options schema that additionally allows strings starting with > for each option
7
+ */
8
+ export declare const enhanceOptionsSchemaWithDynamicOptions: (optionsSchema: OptionsSchema | JSONSchema7Definition) => OptionsSchema;
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './enhanceSchemaWithDynamicOptions';
3
+ export * from './schemaUtils';
@@ -0,0 +1,244 @@
1
+ import { OptionsSchema } from '../types';
2
+ export declare const schemaDraft07: {
3
+ $schema: string;
4
+ $id: string;
5
+ title: string;
6
+ definitions: {
7
+ schemaArray: {
8
+ type: string;
9
+ minItems: number;
10
+ items: {
11
+ $ref: string;
12
+ };
13
+ };
14
+ nonNegativeInteger: {
15
+ type: string;
16
+ minimum: number;
17
+ };
18
+ nonNegativeIntegerDefault0: {
19
+ allOf: ({
20
+ $ref: string;
21
+ default?: undefined;
22
+ } | {
23
+ default: number;
24
+ $ref?: undefined;
25
+ })[];
26
+ };
27
+ simpleTypes: {
28
+ enum: string[];
29
+ };
30
+ stringArray: {
31
+ type: string;
32
+ items: {
33
+ type: string;
34
+ };
35
+ uniqueItems: boolean;
36
+ default: any[];
37
+ };
38
+ };
39
+ type: string[];
40
+ properties: {
41
+ $id: {
42
+ type: string;
43
+ format: string;
44
+ };
45
+ $schema: {
46
+ type: string;
47
+ format: string;
48
+ };
49
+ $ref: {
50
+ type: string;
51
+ format: string;
52
+ };
53
+ $comment: {
54
+ type: string;
55
+ };
56
+ title: {
57
+ type: string;
58
+ };
59
+ description: {
60
+ type: string;
61
+ };
62
+ default: boolean;
63
+ readOnly: {
64
+ type: string;
65
+ default: boolean;
66
+ };
67
+ examples: {
68
+ type: string;
69
+ items: boolean;
70
+ };
71
+ multipleOf: {
72
+ type: string;
73
+ exclusiveMinimum: number;
74
+ };
75
+ maximum: {
76
+ type: string;
77
+ };
78
+ exclusiveMaximum: {
79
+ type: string;
80
+ };
81
+ minimum: {
82
+ type: string;
83
+ };
84
+ exclusiveMinimum: {
85
+ type: string;
86
+ };
87
+ maxLength: {
88
+ $ref: string;
89
+ };
90
+ minLength: {
91
+ $ref: string;
92
+ };
93
+ pattern: {
94
+ type: string;
95
+ format: string;
96
+ };
97
+ additionalItems: {
98
+ $ref: string;
99
+ };
100
+ items: {
101
+ anyOf: {
102
+ $ref: string;
103
+ }[];
104
+ default: boolean;
105
+ };
106
+ maxItems: {
107
+ $ref: string;
108
+ };
109
+ minItems: {
110
+ $ref: string;
111
+ };
112
+ uniqueItems: {
113
+ type: string;
114
+ default: boolean;
115
+ };
116
+ contains: {
117
+ $ref: string;
118
+ };
119
+ maxProperties: {
120
+ $ref: string;
121
+ };
122
+ minProperties: {
123
+ $ref: string;
124
+ };
125
+ required: {
126
+ $ref: string;
127
+ };
128
+ additionalProperties: {
129
+ $ref: string;
130
+ };
131
+ definitions: {
132
+ type: string;
133
+ additionalProperties: {
134
+ $ref: string;
135
+ };
136
+ default: {};
137
+ };
138
+ properties: {
139
+ type: string;
140
+ additionalProperties: {
141
+ $ref: string;
142
+ };
143
+ default: {};
144
+ };
145
+ patternProperties: {
146
+ type: string;
147
+ additionalProperties: {
148
+ $ref: string;
149
+ };
150
+ propertyNames: {
151
+ format: string;
152
+ };
153
+ default: {};
154
+ };
155
+ dependencies: {
156
+ type: string;
157
+ additionalProperties: {
158
+ anyOf: {
159
+ $ref: string;
160
+ }[];
161
+ };
162
+ };
163
+ propertyNames: {
164
+ $ref: string;
165
+ };
166
+ const: boolean;
167
+ enum: {
168
+ type: string;
169
+ items: boolean;
170
+ minItems: number;
171
+ uniqueItems: boolean;
172
+ };
173
+ type: {
174
+ anyOf: ({
175
+ $ref: string;
176
+ type?: undefined;
177
+ items?: undefined;
178
+ minItems?: undefined;
179
+ uniqueItems?: undefined;
180
+ } | {
181
+ type: string;
182
+ items: {
183
+ $ref: string;
184
+ };
185
+ minItems: number;
186
+ uniqueItems: boolean;
187
+ $ref?: undefined;
188
+ })[];
189
+ };
190
+ format: {
191
+ type: string;
192
+ };
193
+ contentMediaType: {
194
+ type: string;
195
+ };
196
+ contentEncoding: {
197
+ type: string;
198
+ };
199
+ if: {
200
+ $ref: string;
201
+ };
202
+ then: {
203
+ $ref: string;
204
+ };
205
+ else: {
206
+ $ref: string;
207
+ };
208
+ allOf: {
209
+ $ref: string;
210
+ };
211
+ anyOf: {
212
+ $ref: string;
213
+ };
214
+ oneOf: {
215
+ $ref: string;
216
+ };
217
+ not: {
218
+ $ref: string;
219
+ };
220
+ };
221
+ default: boolean;
222
+ };
223
+ export declare const createTestSchema: (optionsSchema: OptionsSchema) => {
224
+ $schema: string;
225
+ $id: string;
226
+ title: string;
227
+ description: string;
228
+ type: string;
229
+ properties: OptionsSchema;
230
+ };
231
+ export declare const TOKEN_PATTERN: string;
232
+ export declare const rgbColorPattern: RegExp;
233
+ export declare const rgbaColorPattern: RegExp;
234
+ export declare const colorPattern = "^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$|^transparent$";
235
+ export declare const colorPatternWithRGBA: string;
236
+ export declare const COLOR_OR_TOKEN_PATTERN: string;
237
+ export declare const COLOR_OR_TOKEN_PATTERN_WITH_RGBA: string;
238
+ export declare const DYNAMIC_OPTIONS_DSL_PATTERN: string;
239
+ /**
240
+ * Returns the regex string that matches each passed in value as well as tokens.
241
+ * @param {Array.<string>} values
242
+ * @returns {string}
243
+ */
244
+ export declare const getPattern: (values: string[]) => string;
package/package.json CHANGED
@@ -2,14 +2,14 @@
2
2
  "name": "@splunk/visualization-schemas",
3
3
  "license": "SEE LICENSE IN LICENSE.md",
4
4
  "author": "Splunk",
5
- "version": "27.2.1",
5
+ "version": "27.4.0",
6
6
  "scripts": {
7
- "build": "viz-build --no-types",
7
+ "build": "viz-build",
8
8
  "build:ci": "yarn build && yarn docs",
9
9
  "clean": "yarn clean:esbuild && yarn clean:test-reports",
10
10
  "clean:esbuild": "rm -rf ./dist ./types",
11
11
  "clean:test-reports": "rm -rf ./test-reports",
12
- "dev": "viz-build --no-types --watch",
12
+ "dev": "viz-build --watch",
13
13
  "dev:yalc": "yarn dev --env.useYalc='true'",
14
14
  "test": "yarn run test:unit && yarn run test:visual",
15
15
  "test:ci": "yarn run test:unit:ci && yarn run test:visual:ci",
@@ -19,14 +19,13 @@
19
19
  "version": "yarn build"
20
20
  },
21
21
  "dependencies": {
22
- "@splunk/visualization-color-palettes": "^27.2.1"
22
+ "@splunk/visualization-color-palettes": "^27.4.0",
23
+ "@types/json-schema": "^7.0.15"
23
24
  },
24
25
  "devDependencies": {
25
- "@splunk/visualization-build-tools": "^27.2.1",
26
- "@types/json-schema": "^7.0.15",
27
- "ajv": "^6.12.6",
28
- "schema-utils": "^3.0.0"
26
+ "@splunk/visualization-build-tools": "^27.4.0",
27
+ "ajv": "^8.17.1"
29
28
  },
30
29
  "main": "./dist/cjs/index.js",
31
- "types": "./types/index.d.ts"
30
+ "types": "./dist/types/index.d.ts"
32
31
  }