@gooddata/sdk-model 11.62.0-alpha.3 → 11.62.0-alpha.4

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 (89) hide show
  1. package/esm/genAI/chat.d.ts +3 -2
  2. package/esm/genAI/chat.d.ts.map +1 -1
  3. package/esm/index.d.ts +21 -10
  4. package/esm/index.d.ts.map +1 -1
  5. package/esm/index.js +20 -10
  6. package/esm/publisher/aliases.d.ts +580 -0
  7. package/esm/publisher/aliases.d.ts.map +1 -0
  8. package/esm/publisher/aliases.js +304 -0
  9. package/esm/publisher/v1/builtinPageLayouts.d.ts +45 -0
  10. package/esm/publisher/v1/builtinPageLayouts.d.ts.map +1 -0
  11. package/esm/publisher/{builtinPageLayouts.js → v1/builtinPageLayouts.js} +14 -14
  12. package/esm/publisher/{content.d.ts → v1/content.d.ts} +14 -14
  13. package/esm/publisher/v1/content.d.ts.map +1 -0
  14. package/esm/publisher/{content.js → v1/content.js} +1 -1
  15. package/esm/publisher/{document.d.ts → v1/document.d.ts} +21 -21
  16. package/esm/publisher/v1/document.d.ts.map +1 -0
  17. package/esm/publisher/v1/document.js +35 -0
  18. package/esm/publisher/v1/factory.d.ts +65 -0
  19. package/esm/publisher/v1/factory.d.ts.map +1 -0
  20. package/esm/publisher/{factory.js → v1/factory.js} +12 -12
  21. package/esm/publisher/{layout.d.ts → v1/layout.d.ts} +13 -13
  22. package/esm/publisher/v1/layout.d.ts.map +1 -0
  23. package/esm/publisher/{layout.js → v1/layout.js} +4 -4
  24. package/esm/publisher/{pageFormat.d.ts → v1/pageFormat.d.ts} +6 -6
  25. package/esm/publisher/v1/pageFormat.d.ts.map +1 -0
  26. package/esm/publisher/{pageFormat.js → v1/pageFormat.js} +6 -6
  27. package/esm/publisher/{pageLayout.d.ts → v1/pageLayout.d.ts} +27 -27
  28. package/esm/publisher/v1/pageLayout.d.ts.map +1 -0
  29. package/esm/publisher/{pageLayout.js → v1/pageLayout.js} +18 -18
  30. package/esm/publisher/{slot.d.ts → v1/slot.d.ts} +41 -41
  31. package/esm/publisher/v1/slot.d.ts.map +1 -0
  32. package/esm/publisher/v1/slot.js +90 -0
  33. package/esm/publisher/{styling.d.ts → v1/styling.d.ts} +36 -36
  34. package/esm/publisher/v1/styling.d.ts.map +1 -0
  35. package/esm/publisher/{styling.js → v1/styling.js} +14 -14
  36. package/esm/publisher/{variables.d.ts → v1/variables.d.ts} +10 -10
  37. package/esm/publisher/v1/variables.d.ts.map +1 -0
  38. package/esm/publisher/{variables.js → v1/variables.js} +4 -4
  39. package/esm/publisher/v2/checks.d.ts +58 -0
  40. package/esm/publisher/v2/checks.d.ts.map +1 -0
  41. package/esm/publisher/v2/checks.js +100 -0
  42. package/esm/publisher/v2/content.d.ts +154 -0
  43. package/esm/publisher/v2/content.d.ts.map +1 -0
  44. package/esm/publisher/v2/content.js +34 -0
  45. package/esm/publisher/v2/document.d.ts +116 -0
  46. package/esm/publisher/v2/document.d.ts.map +1 -0
  47. package/esm/publisher/v2/document.js +47 -0
  48. package/esm/publisher/v2/factory.d.ts +69 -0
  49. package/esm/publisher/v2/factory.d.ts.map +1 -0
  50. package/esm/publisher/v2/factory.js +80 -0
  51. package/esm/publisher/v2/layout.d.ts +48 -0
  52. package/esm/publisher/v2/layout.d.ts.map +1 -0
  53. package/esm/publisher/v2/layout.js +20 -0
  54. package/esm/publisher/v2/page.d.ts +67 -0
  55. package/esm/publisher/v2/page.d.ts.map +1 -0
  56. package/esm/publisher/v2/page.js +34 -0
  57. package/esm/publisher/v2/sections.d.ts +34 -0
  58. package/esm/publisher/v2/sections.d.ts.map +1 -0
  59. package/esm/publisher/v2/sections.js +40 -0
  60. package/esm/publisher/v2/structure.d.ts +5 -0
  61. package/esm/publisher/v2/structure.d.ts.map +1 -0
  62. package/esm/publisher/v2/structure.js +533 -0
  63. package/esm/publisher/v2/style.d.ts +323 -0
  64. package/esm/publisher/v2/style.d.ts.map +1 -0
  65. package/esm/publisher/v2/style.js +22 -0
  66. package/esm/publisher/v2/validation.d.ts +26 -0
  67. package/esm/publisher/v2/validation.d.ts.map +1 -0
  68. package/esm/publisher/v2/validation.js +157 -0
  69. package/esm/publisher/v2/widget.d.ts +295 -0
  70. package/esm/publisher/v2/widget.d.ts.map +1 -0
  71. package/esm/publisher/v2/widget.js +79 -0
  72. package/esm/sdk-model.d.ts +2364 -462
  73. package/esm/settings/settings.d.ts +11 -1
  74. package/esm/settings/settings.d.ts.map +1 -1
  75. package/package.json +3 -3
  76. package/esm/publisher/builtinPageLayouts.d.ts +0 -45
  77. package/esm/publisher/builtinPageLayouts.d.ts.map +0 -1
  78. package/esm/publisher/content.d.ts.map +0 -1
  79. package/esm/publisher/document.d.ts.map +0 -1
  80. package/esm/publisher/document.js +0 -35
  81. package/esm/publisher/factory.d.ts +0 -65
  82. package/esm/publisher/factory.d.ts.map +0 -1
  83. package/esm/publisher/layout.d.ts.map +0 -1
  84. package/esm/publisher/pageFormat.d.ts.map +0 -1
  85. package/esm/publisher/pageLayout.d.ts.map +0 -1
  86. package/esm/publisher/slot.d.ts.map +0 -1
  87. package/esm/publisher/slot.js +0 -87
  88. package/esm/publisher/styling.d.ts.map +0 -1
  89. package/esm/publisher/variables.d.ts.map +0 -1
@@ -0,0 +1,323 @@
1
+ /**
2
+ * Length in px on the page's design canvas, zero or more.
3
+ *
4
+ * @alpha
5
+ */
6
+ export type PublisherPxV2 = number;
7
+ /**
8
+ * Number from 0 to 1.
9
+ *
10
+ * @alpha
11
+ */
12
+ export type PublisherOpacityV2 = number;
13
+ /**
14
+ * @alpha
15
+ */
16
+ export type PublisherHorizontalAlignV2 = "left" | "center" | "right";
17
+ /**
18
+ * @alpha
19
+ */
20
+ export type PublisherVerticalAlignV2 = "top" | "center" | "bottom";
21
+ /**
22
+ * Theme color reference or literal color.
23
+ *
24
+ * @remarks
25
+ * A reference is the whole value, never part of a longer string:
26
+ * `{theme.colors.<list>.<id>}`, where list is `backgrounds`, `texts` or `lines`, or
27
+ * `{theme.palette.<name>}`, where name is `primary`, `success`, `error` or `warning`.
28
+ * The ids `default`, `surface`, `inverse`, `muted` and `accent` always resolve.
29
+ *
30
+ * A literal is `#rgb`, `#rrggbb`, `#rrggbbaa`, or `rgb()` with 3 or 4 arguments. `#rgba` is invalid.
31
+ *
32
+ * @alpha
33
+ */
34
+ export type PublisherColorValueV2 = string;
35
+ /**
36
+ * @alpha
37
+ */
38
+ export type PublisherGapValueV2 = PublisherPxV2 | "{theme.spacing.gap.compact}" | "{theme.spacing.gap.normal}" | "{theme.spacing.gap.spacious}";
39
+ /**
40
+ * @alpha
41
+ */
42
+ export type PublisherPaddingValueV2 = PublisherPxV2 | "{theme.spacing.padding.compact}" | "{theme.spacing.padding.normal}" | "{theme.spacing.padding.spacious}";
43
+ /**
44
+ * @alpha
45
+ */
46
+ export type PublisherRadiusValueV2 = PublisherPxV2 | "{theme.corners.small}" | "{theme.corners.medium}" | "{theme.corners.large}" | "{theme.corners.full}";
47
+ /**
48
+ * `{theme.shadows.<name>}` or `none`.
49
+ *
50
+ * @alpha
51
+ */
52
+ export type PublisherShadowValueV2 = string;
53
+ /**
54
+ * @alpha
55
+ */
56
+ export type PublisherBorderLineStyleV2 = "solid" | "dashed" | "dotted" | "none";
57
+ /**
58
+ * Theme image reference or https URL.
59
+ *
60
+ * @remarks
61
+ * A reference is the whole value: `{theme.logo}`, `{theme.coverImage}`, `{theme.assets.logos.<id>}`
62
+ * or `{theme.assets.images.<id>}`.
63
+ *
64
+ * A URL must start with `https://` and may contain text variables; each resolved value is
65
+ * percent-encoded and the result must still start with `https://`.
66
+ *
67
+ * @alpha
68
+ */
69
+ export type PublisherImageSourceV2 = string;
70
+ /**
71
+ * @alpha
72
+ */
73
+ export declare const PublisherTextStyleNamesV2: readonly ["title", "h1", "h2", "h3", "h4", "h5", "h6", "largeText", "normalText", "smallText"];
74
+ /**
75
+ * Named text style from the theme's `documents.textStyle`.
76
+ *
77
+ * @alpha
78
+ */
79
+ export type PublisherTextStyleNameV2 = (typeof PublisherTextStyleNamesV2)[number];
80
+ /**
81
+ * @alpha
82
+ */
83
+ export declare function isPublisherTextStyleNameV2(value: unknown): value is PublisherTextStyleNameV2;
84
+ /**
85
+ * @alpha
86
+ */
87
+ export interface IPublisherBackgroundStyleV2 {
88
+ backgroundColor?: PublisherColorValueV2;
89
+ /**
90
+ * Opacity of the background color only.
91
+ */
92
+ backgroundOpacity?: PublisherOpacityV2;
93
+ backgroundImage?: PublisherImageSourceV2;
94
+ backgroundImageOpacity?: PublisherOpacityV2;
95
+ /**
96
+ * Defaults to `cover`.
97
+ */
98
+ backgroundFit?: "cover" | "contain" | "fill" | "tile";
99
+ backgroundHorizontalAlign?: PublisherHorizontalAlignV2;
100
+ backgroundVerticalAlign?: PublisherVerticalAlignV2;
101
+ backgroundOffset?: PublisherPxV2;
102
+ backgroundOffsetTop?: PublisherPxV2;
103
+ backgroundOffsetRight?: PublisherPxV2;
104
+ backgroundOffsetBottom?: PublisherPxV2;
105
+ backgroundOffsetLeft?: PublisherPxV2;
106
+ }
107
+ /**
108
+ * @remarks
109
+ * A side key wins over `padding` in any order.
110
+ *
111
+ * @alpha
112
+ */
113
+ export interface IPublisherPaddingStyleV2 {
114
+ padding?: PublisherPaddingValueV2;
115
+ paddingTop?: PublisherPaddingValueV2;
116
+ paddingRight?: PublisherPaddingValueV2;
117
+ paddingBottom?: PublisherPaddingValueV2;
118
+ paddingLeft?: PublisherPaddingValueV2;
119
+ }
120
+ /**
121
+ * @remarks
122
+ * A side key wins over the matching all-sides key in any order. `borderStyle` defaults to `solid`,
123
+ * so a width alone draws a line.
124
+ *
125
+ * @alpha
126
+ */
127
+ export interface IPublisherBorderStyleV2 {
128
+ borderWidth?: PublisherPxV2;
129
+ borderStyle?: PublisherBorderLineStyleV2;
130
+ borderColor?: PublisherColorValueV2;
131
+ borderTopWidth?: PublisherPxV2;
132
+ borderTopStyle?: PublisherBorderLineStyleV2;
133
+ borderTopColor?: PublisherColorValueV2;
134
+ borderRightWidth?: PublisherPxV2;
135
+ borderRightStyle?: PublisherBorderLineStyleV2;
136
+ borderRightColor?: PublisherColorValueV2;
137
+ borderBottomWidth?: PublisherPxV2;
138
+ borderBottomStyle?: PublisherBorderLineStyleV2;
139
+ borderBottomColor?: PublisherColorValueV2;
140
+ borderLeftWidth?: PublisherPxV2;
141
+ borderLeftStyle?: PublisherBorderLineStyleV2;
142
+ borderLeftColor?: PublisherColorValueV2;
143
+ }
144
+ /**
145
+ * @remarks
146
+ * A corner key wins over `borderRadius` in any order.
147
+ *
148
+ * @alpha
149
+ */
150
+ export interface IPublisherCornerStyleV2 {
151
+ borderRadius?: PublisherRadiusValueV2;
152
+ borderTopLeftRadius?: PublisherRadiusValueV2;
153
+ borderTopRightRadius?: PublisherRadiusValueV2;
154
+ borderBottomRightRadius?: PublisherRadiusValueV2;
155
+ borderBottomLeftRadius?: PublisherRadiusValueV2;
156
+ }
157
+ /**
158
+ * @remarks
159
+ * The part keys override the named `shadow`, or define a shadow without one.
160
+ *
161
+ * @alpha
162
+ */
163
+ export interface IPublisherShadowStyleV2 {
164
+ shadow?: PublisherShadowValueV2;
165
+ /**
166
+ * px on the design canvas; may be negative.
167
+ */
168
+ shadowX?: number;
169
+ /**
170
+ * px on the design canvas; may be negative.
171
+ */
172
+ shadowY?: number;
173
+ shadowBlur?: PublisherPxV2;
174
+ /**
175
+ * px on the design canvas; may be negative.
176
+ */
177
+ shadowSpread?: number;
178
+ shadowColor?: PublisherColorValueV2;
179
+ shadowOpacity?: PublisherOpacityV2;
180
+ }
181
+ /**
182
+ * Box keys. They apply to the node they are set on and never inherit.
183
+ *
184
+ * @alpha
185
+ */
186
+ export interface IPublisherBoxStyleV2 extends IPublisherBackgroundStyleV2, IPublisherPaddingStyleV2, IPublisherBorderStyleV2, IPublisherCornerStyleV2, IPublisherShadowStyleV2 {
187
+ /**
188
+ * Opacity of the whole node, content included.
189
+ */
190
+ opacity?: PublisherOpacityV2;
191
+ }
192
+ /**
193
+ * Text keys that a page or container passes down to the content inside, unless a widget sets its own.
194
+ *
195
+ * @alpha
196
+ */
197
+ export interface IPublisherInheritedTextStyleV2 {
198
+ textStyle?: PublisherTextStyleNameV2;
199
+ textColor?: PublisherColorValueV2;
200
+ /**
201
+ * `justify` applies to text only.
202
+ */
203
+ horizontalAlign?: PublisherHorizontalAlignV2 | "justify";
204
+ verticalAlign?: PublisherVerticalAlignV2;
205
+ }
206
+ /**
207
+ * @alpha
208
+ */
209
+ export interface IPublisherTextStyleV2 extends IPublisherInheritedTextStyleV2 {
210
+ fontSize?: PublisherPxV2;
211
+ /**
212
+ * 1 to 1000.
213
+ */
214
+ fontWeight?: number;
215
+ fontStyle?: "normal" | "italic";
216
+ /**
217
+ * Multiple of the font size.
218
+ */
219
+ lineHeight?: number;
220
+ /**
221
+ * In em.
222
+ */
223
+ letterSpacing?: number;
224
+ textTransform?: "none" | "uppercase" | "lowercase" | "capitalize";
225
+ /**
226
+ * Defaults to `shrink`.
227
+ */
228
+ textOverflow?: "shrink" | "clip" | "ellipsis";
229
+ }
230
+ /**
231
+ * @alpha
232
+ */
233
+ export interface IPublisherPageStyleV2 extends IPublisherBackgroundStyleV2, IPublisherPaddingStyleV2, IPublisherInheritedTextStyleV2 {
234
+ /**
235
+ * Default gap of every container on the page.
236
+ */
237
+ gap?: PublisherGapValueV2;
238
+ }
239
+ /**
240
+ * @alpha
241
+ */
242
+ export interface IPublisherContainerStyleV2 extends IPublisherBoxStyleV2, IPublisherInheritedTextStyleV2 {
243
+ gap?: PublisherGapValueV2;
244
+ }
245
+ /**
246
+ * @alpha
247
+ */
248
+ export interface IPublisherTextWidgetStyleV2 extends IPublisherBoxStyleV2, IPublisherTextStyleV2 {
249
+ }
250
+ /**
251
+ * @alpha
252
+ */
253
+ export interface IPublisherImageWidgetStyleV2 extends IPublisherBoxStyleV2 {
254
+ /**
255
+ * Defaults to `contain`.
256
+ */
257
+ fit?: "contain" | "cover" | "fill";
258
+ horizontalAlign?: PublisherHorizontalAlignV2;
259
+ verticalAlign?: PublisherVerticalAlignV2;
260
+ }
261
+ /**
262
+ * @remarks
263
+ * Each of `chart`, `table` and `headline` applies only while the visualization renders as that kind,
264
+ * so the style survives a switch from a chart to a table.
265
+ *
266
+ * @alpha
267
+ */
268
+ export interface IPublisherVisualizationStyleV2 extends IPublisherBoxStyleV2 {
269
+ chart?: IPublisherChartStyleV2;
270
+ table?: IPublisherTableStyleV2;
271
+ headline?: IPublisherHeadlineStyleV2;
272
+ }
273
+ /**
274
+ * @alpha
275
+ */
276
+ export interface IPublisherChartStyleV2 {
277
+ fontSize?: PublisherPxV2;
278
+ textColor?: PublisherColorValueV2;
279
+ axisLineColor?: PublisherColorValueV2;
280
+ /**
281
+ * Color of the axis title.
282
+ */
283
+ axisNameColor?: PublisherColorValueV2;
284
+ axisNameSize?: PublisherPxV2;
285
+ /**
286
+ * Color of the tick labels.
287
+ */
288
+ axisValueColor?: PublisherColorValueV2;
289
+ axisValueSize?: PublisherPxV2;
290
+ gridColor?: PublisherColorValueV2;
291
+ plotLineColor?: PublisherColorValueV2;
292
+ legendColor?: PublisherColorValueV2;
293
+ legendSize?: PublisherPxV2;
294
+ dataLabelColor?: PublisherColorValueV2;
295
+ dataLabelSize?: PublisherPxV2;
296
+ }
297
+ /**
298
+ * @alpha
299
+ */
300
+ export interface IPublisherTableStyleV2 {
301
+ fontSize?: PublisherPxV2;
302
+ rowHeight?: PublisherPxV2;
303
+ gridColor?: PublisherColorValueV2;
304
+ valueColor?: PublisherColorValueV2;
305
+ nullValueColor?: PublisherColorValueV2;
306
+ headerLabelColor?: PublisherColorValueV2;
307
+ headerBackgroundColor?: PublisherColorValueV2;
308
+ totalValueColor?: PublisherColorValueV2;
309
+ totalBackgroundColor?: PublisherColorValueV2;
310
+ subtotalBackgroundColor?: PublisherColorValueV2;
311
+ }
312
+ /**
313
+ * @alpha
314
+ */
315
+ export interface IPublisherHeadlineStyleV2 {
316
+ primaryValueColor?: PublisherColorValueV2;
317
+ primaryValueSize?: PublisherPxV2;
318
+ secondaryValueColor?: PublisherColorValueV2;
319
+ secondaryValueSize?: PublisherPxV2;
320
+ positiveColor?: PublisherColorValueV2;
321
+ negativeColor?: PublisherColorValueV2;
322
+ }
323
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/publisher/v2/style.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GACzB,aAAa,GACb,6BAA6B,GAC7B,4BAA4B,GAC5B,8BAA8B,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC7B,aAAa,GACb,iCAAiC,GACjC,gCAAgC,GAChC,kCAAkC,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC5B,aAAa,GACb,uBAAuB,GACvB,wBAAwB,GACxB,uBAAuB,GACvB,sBAAsB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,yBAAyB,YAClC,OAAO,EACP,IAAI,EACJ,IAAI,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iB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,gBAAgB,CAAC,EAAE,aAAa,CAAC;IACjC,mBAAmB,CAAC,EAAE,qBAAqB,CAAC;IAC5C,kBAAkB,CAAC,EAAE,aAAa,CAAC;IACnC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACzC"}
@@ -0,0 +1,22 @@
1
+ // (C) 2026 GoodData Corporation
2
+ /**
3
+ * @alpha
4
+ */
5
+ export const PublisherTextStyleNamesV2 = [
6
+ "title",
7
+ "h1",
8
+ "h2",
9
+ "h3",
10
+ "h4",
11
+ "h5",
12
+ "h6",
13
+ "largeText",
14
+ "normalText",
15
+ "smallText",
16
+ ];
17
+ /**
18
+ * @alpha
19
+ */
20
+ export function isPublisherTextStyleNameV2(value) {
21
+ return PublisherTextStyleNamesV2.some((name) => name === value);
22
+ }
@@ -0,0 +1,26 @@
1
+ import { type IPublisherValidationIssueV2 } from "./checks.js";
2
+ /**
3
+ * Validates a page body, such as a page template's content: every key, value and node type, at most
4
+ * one title widget, and widget ids unique in the page.
5
+ *
6
+ * @alpha
7
+ */
8
+ export declare function validatePublisherPageBodyV2(body: unknown): IPublisherValidationIssueV2[];
9
+ /**
10
+ * Validates the content of a document or a document template: every key, value and node type,
11
+ * exactly one of `pages` and `sections`, page and section ids unique in the document, a `dataSet` on
12
+ * every date filter, at most one filter per attribute display form or date dataset, and the page
13
+ * rules on every page.
14
+ *
15
+ * @alpha
16
+ */
17
+ export declare function validatePublisherDocumentContentV2(content: unknown): IPublisherValidationIssueV2[];
18
+ /**
19
+ * Validates a document, document template or page template, as a definition or as a persisted
20
+ * object: everything its content validator checks, `version` `"2"`, `defaults.period` set on document
21
+ * templates only, and the `default.` id prefix left to the backend's default page templates.
22
+ *
23
+ * @alpha
24
+ */
25
+ export declare function validatePublisherEntityV2(entity: unknown): IPublisherValidationIssueV2[];
26
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/publisher/v2/validation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAc,KAAK,2BAA2B,EAAY,MAAM,aAAa,CAAC;AAiBrF;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,OAAO,GAAG,2BAA2B,EAAE,CAKxF;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,OAAO,GAAG,2BAA2B,EAAE,CAKlG;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,2BAA2B,EAAE,CAExF"}
@@ -0,0 +1,157 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { dashboardAttributeFilterItemDisplayForm, isDashboardAttributeFilterItem, isDashboardDateFilter, } from "../../dashboard/filterContext.js";
3
+ import { areObjRefsEqual, isIdentifierRef } from "../../objRef/index.js";
4
+ import { joinPath } from "./checks.js";
5
+ import { isPublisherContainerV2 } from "./layout.js";
6
+ import { checkDocumentContent, checkEntity, checkPageBody } from "./structure.js";
7
+ import { isPublisherTitleWidgetV2 } from "./widget.js";
8
+ /**
9
+ * Validates a page body, such as a page template's content: every key, value and node type, at most
10
+ * one title widget, and widget ids unique in the page.
11
+ *
12
+ * @alpha
13
+ */
14
+ export function validatePublisherPageBodyV2(body) {
15
+ return validate(body, {
16
+ structure: checkPageBody,
17
+ rules: (value) => pageIssues(value, ""),
18
+ });
19
+ }
20
+ /**
21
+ * Validates the content of a document or a document template: every key, value and node type,
22
+ * exactly one of `pages` and `sections`, page and section ids unique in the document, a `dataSet` on
23
+ * every date filter, at most one filter per attribute display form or date dataset, and the page
24
+ * rules on every page.
25
+ *
26
+ * @alpha
27
+ */
28
+ export function validatePublisherDocumentContentV2(content) {
29
+ return validate(content, {
30
+ structure: checkDocumentContent,
31
+ rules: (value) => contentIssues(value, ""),
32
+ });
33
+ }
34
+ /**
35
+ * Validates a document, document template or page template, as a definition or as a persisted
36
+ * object: everything its content validator checks, `version` `"2"`, `defaults.period` set on document
37
+ * templates only, and the `default.` id prefix left to the backend's default page templates.
38
+ *
39
+ * @alpha
40
+ */
41
+ export function validatePublisherEntityV2(entity) {
42
+ return validate(entity, { structure: checkEntity, rules: entityIssues });
43
+ }
44
+ function validate(value, { structure, rules }) {
45
+ const issues = [];
46
+ structure(value, "", issues);
47
+ // The rules read the value through its model type, which is sound only once the structure passed.
48
+ return issues.length > 0 ? issues : rules(value);
49
+ }
50
+ function entityIssues(entity) {
51
+ const issues = [];
52
+ if (isReservedRef(entity)) {
53
+ issues.push({
54
+ path: "ref",
55
+ message: `Ids starting with "${reservedIdPrefix}" are reserved for the default page templates.`,
56
+ });
57
+ }
58
+ if (entity.type === "pageTemplate") {
59
+ return [...issues, ...pageIssues(entity.content, "content")];
60
+ }
61
+ if (entity.type === "document" && entity.content.defaults?.period !== undefined) {
62
+ issues.push({
63
+ path: "content.defaults.period",
64
+ message: "Only a document template sets a default period; a document sets its own period.",
65
+ });
66
+ }
67
+ return [...issues, ...contentIssues(entity.content, "content")];
68
+ }
69
+ const reservedIdPrefix = "default.";
70
+ function isReservedRef(entity) {
71
+ const { ref } = entity;
72
+ if (!isIdentifierRef(ref) || !ref.identifier.startsWith(reservedIdPrefix)) {
73
+ return false;
74
+ }
75
+ return !(entity.type === "pageTemplate" && "isDefault" in entity && entity.isDefault === true);
76
+ }
77
+ function contentIssues(content, path) {
78
+ const issues = [];
79
+ const { pages, sections } = content;
80
+ if (pages !== undefined && sections !== undefined) {
81
+ issues.push({ path, message: "Content holds pages or sections, never both." });
82
+ }
83
+ else if (pages === undefined && sections === undefined) {
84
+ issues.push({ path, message: "Content holds pages or sections." });
85
+ }
86
+ const pagesWithPaths = [
87
+ ...(pages ?? []).map((page, i) => [
88
+ page,
89
+ joinPath(path, `pages[${i}]`),
90
+ ]),
91
+ ...(sections ?? []).flatMap((section, s) => section.pages.map((page, i) => [
92
+ page,
93
+ joinPath(path, `sections[${s}].pages[${i}]`),
94
+ ])),
95
+ ];
96
+ issues.push(...duplicateIdIssues((sections ?? []).map((section, s) => [section.id, joinPath(path, `sections[${s}].id`)]), "section"), ...duplicateIdIssues(pagesWithPaths.map(([page, pagePath]) => [page.id, joinPath(pagePath, "id")]), "page"), ...filterIssues(content.filters ?? [], joinPath(path, "filters")), ...pagesWithPaths.flatMap(([page, pagePath]) => pageIssues(page, pagePath)));
97
+ return issues;
98
+ }
99
+ function pageIssues(body, path) {
100
+ const widgets = layoutWidgets(body.layout, joinPath(path, "layout"));
101
+ const titlePaths = widgets
102
+ .filter(([node]) => isPublisherTitleWidgetV2(node))
103
+ .map(([, nodePath]) => nodePath);
104
+ return [
105
+ ...titlePaths.slice(1).map((titlePath) => ({
106
+ path: titlePath,
107
+ message: "A page holds at most one title widget.",
108
+ })),
109
+ ...duplicateIdIssues(widgets.map(([node, nodePath]) => [node.id, joinPath(nodePath, "id")]), "widget"),
110
+ ];
111
+ }
112
+ function layoutWidgets(node, path) {
113
+ if (isPublisherContainerV2(node)) {
114
+ return node.children.flatMap((child, i) => layoutWidgets(child, joinPath(path, `children[${i}]`)));
115
+ }
116
+ return [[node, path]];
117
+ }
118
+ function duplicateIdIssues(idsWithPaths, kind) {
119
+ const seen = new Set();
120
+ return idsWithPaths.flatMap(([id, path]) => {
121
+ if (seen.has(id)) {
122
+ return [{ path, message: `Duplicate ${kind} id "${id}".` }];
123
+ }
124
+ seen.add(id);
125
+ return [];
126
+ });
127
+ }
128
+ function filterIssues(filters, path) {
129
+ const issues = [];
130
+ const displayForms = [];
131
+ const dataSets = [];
132
+ filters.forEach((filter, i) => {
133
+ const filterPath = joinPath(path, i);
134
+ if (isDashboardAttributeFilterItem(filter)) {
135
+ if (!addIfNew(dashboardAttributeFilterItemDisplayForm(filter), displayForms)) {
136
+ issues.push({ path: filterPath, message: "At most one filter per attribute display form." });
137
+ }
138
+ }
139
+ else if (isDashboardDateFilter(filter)) {
140
+ const { dataSet } = filter.dateFilter;
141
+ if (dataSet === undefined) {
142
+ issues.push({ path: filterPath, message: "A document date filter names its dataSet." });
143
+ }
144
+ else if (!addIfNew(dataSet, dataSets)) {
145
+ issues.push({ path: filterPath, message: "At most one filter per date dataset." });
146
+ }
147
+ }
148
+ });
149
+ return issues;
150
+ }
151
+ function addIfNew(target, seen) {
152
+ if (seen.some((ref) => areObjRefsEqual(ref, target))) {
153
+ return false;
154
+ }
155
+ seen.push(target);
156
+ return true;
157
+ }