@datawheel/bespoke 0.7.3-rc.1 → 0.8.0-rc.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/auth.js +5 -4
- package/dist/cms.js +60 -60
- package/dist/redux-store.js +7 -7
- package/dist/report.js +27 -27
- package/dist/server.js +34 -32
- package/package.json +9 -15
- package/dist/ExploreProvider-ee7762cb.d.ts +0 -64
- package/dist/auth-693a652d.d.ts +0 -54
- package/dist/auth.d.ts +0 -39
- package/dist/cms.d.ts +0 -12
- package/dist/explore.d.ts +0 -94
- package/dist/index.d.ts +0 -24
- package/dist/redux-store.d.ts +0 -190
- package/dist/report.d.ts +0 -50
- package/dist/server.d.ts +0 -98
- package/dist/store-a09ce360.d.ts +0 -915
- package/dist/types-76133c94.d.ts +0 -767
package/dist/types-76133c94.d.ts
DELETED
|
@@ -1,767 +0,0 @@
|
|
|
1
|
-
import { AutocompleteItem } from '@mantine/core';
|
|
2
|
-
import { Sequelize, Model, ForeignKey } from 'sequelize';
|
|
3
|
-
|
|
4
|
-
type BlockType = "generator" | "image" | "paragraph" | "selector" | "stat" | "subtitle" | "title" | "visualization" | "nav" | "reset_button";
|
|
5
|
-
type BlockSettings = {
|
|
6
|
-
width?: {
|
|
7
|
-
stretch: boolean;
|
|
8
|
-
unit: string;
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
display?: string;
|
|
12
|
-
align?: string;
|
|
13
|
-
access?: string[];
|
|
14
|
-
allowed?: string;
|
|
15
|
-
allowedLogic?: string;
|
|
16
|
-
};
|
|
17
|
-
type TypeGeneratorSettings = {
|
|
18
|
-
useProxy?: string;
|
|
19
|
-
};
|
|
20
|
-
type TypeImageSettings = unknown;
|
|
21
|
-
type TypeParagraphSettings = unknown;
|
|
22
|
-
type TypeSelectorSettings = unknown;
|
|
23
|
-
type TypeStatSettings = {
|
|
24
|
-
name: string;
|
|
25
|
-
description?: string;
|
|
26
|
-
};
|
|
27
|
-
type TypeSubtitleSettings = unknown;
|
|
28
|
-
type TypeTitleSettings = {
|
|
29
|
-
order?: string;
|
|
30
|
-
};
|
|
31
|
-
type TypeVizSettings = unknown;
|
|
32
|
-
type TypeResetButtonSettings = unknown;
|
|
33
|
-
type TypeNavSettings = {
|
|
34
|
-
min?: string;
|
|
35
|
-
max?: string;
|
|
36
|
-
variant?: string;
|
|
37
|
-
};
|
|
38
|
-
type EntitySettings$2 = {
|
|
39
|
-
generator: TypeGeneratorSettings;
|
|
40
|
-
image: TypeImageSettings;
|
|
41
|
-
paragraph: TypeParagraphSettings;
|
|
42
|
-
selector: TypeSelectorSettings;
|
|
43
|
-
stat: TypeStatSettings;
|
|
44
|
-
subtitle: TypeSubtitleSettings;
|
|
45
|
-
title: TypeTitleSettings;
|
|
46
|
-
visualization: TypeVizSettings;
|
|
47
|
-
nav: TypeNavSettings;
|
|
48
|
-
reset_button: TypeResetButtonSettings;
|
|
49
|
-
};
|
|
50
|
-
interface Content {
|
|
51
|
-
api?: string;
|
|
52
|
-
simple?: {
|
|
53
|
-
compare?: string;
|
|
54
|
-
limit?: number;
|
|
55
|
-
};
|
|
56
|
-
simpleEnabled?: boolean;
|
|
57
|
-
logic?: string;
|
|
58
|
-
}
|
|
59
|
-
interface LocaleContent {
|
|
60
|
-
id: number;
|
|
61
|
-
locale: string;
|
|
62
|
-
content: Content;
|
|
63
|
-
}
|
|
64
|
-
interface Block<T extends BlockType> {
|
|
65
|
-
/** Entity ID */
|
|
66
|
-
id: number;
|
|
67
|
-
/** Parent Report ID */
|
|
68
|
-
section_id: number;
|
|
69
|
-
blockcol: string;
|
|
70
|
-
blockrow: string;
|
|
71
|
-
contentByLocale: Record<string, LocaleContent>;
|
|
72
|
-
settings: Partial<EntitySettings$2[T]> & BlockSettings;
|
|
73
|
-
shared: boolean;
|
|
74
|
-
type: T;
|
|
75
|
-
}
|
|
76
|
-
interface NestedBlock<T extends BlockType> extends Block<T> {
|
|
77
|
-
inputs: AnyBlock[];
|
|
78
|
-
consumers: AnyBlock[];
|
|
79
|
-
}
|
|
80
|
-
interface NormalizedBlock<T extends BlockType> extends Block<T> {
|
|
81
|
-
inputs: number[];
|
|
82
|
-
consumers: number[];
|
|
83
|
-
}
|
|
84
|
-
type AnyBlock = Block<"image"> | Block<"paragraph"> | Block<"selector"> | Block<"stat"> | Block<"subtitle"> | Block<"title"> | Block<"generator"> | Block<"visualization"> | Block<"nav"> | Block<"reset_button">;
|
|
85
|
-
type AnyNestedBlock = NestedBlock<"image"> | NestedBlock<"paragraph"> | NestedBlock<"selector"> | NestedBlock<"stat"> | NestedBlock<"subtitle"> | NestedBlock<"title"> | NestedBlock<"generator"> | NestedBlock<"visualization"> | NestedBlock<"nav"> | NestedBlock<"reset_button">;
|
|
86
|
-
type AnyNormalizedBlock = NormalizedBlock<"image"> | NormalizedBlock<"paragraph"> | NormalizedBlock<"selector"> | NormalizedBlock<"stat"> | NormalizedBlock<"subtitle"> | NormalizedBlock<"title"> | NormalizedBlock<"generator"> | NormalizedBlock<"visualization"> | NormalizedBlock<"nav"> | NormalizedBlock<"reset_button">;
|
|
87
|
-
|
|
88
|
-
interface BlockContentCreationAttributes {
|
|
89
|
-
locale: LocaleContent["locale"];
|
|
90
|
-
}
|
|
91
|
-
declare class BlockContentModel extends Model<LocaleContent, BlockContentCreationAttributes> {
|
|
92
|
-
id: number;
|
|
93
|
-
locale: LocaleContent["locale"];
|
|
94
|
-
content: LocaleContent["content"];
|
|
95
|
-
}
|
|
96
|
-
declare function initModel$b(sequelize: Sequelize): () => typeof BlockContentModel;
|
|
97
|
-
|
|
98
|
-
interface BlockInputAttributes {
|
|
99
|
-
id: number;
|
|
100
|
-
block_id: number;
|
|
101
|
-
input_id: number;
|
|
102
|
-
}
|
|
103
|
-
interface BlockInputCreationAttributes {
|
|
104
|
-
block_id: number;
|
|
105
|
-
input_id: number;
|
|
106
|
-
}
|
|
107
|
-
declare class BlockInputModel extends Model<BlockInputAttributes, BlockInputCreationAttributes> {
|
|
108
|
-
id: number;
|
|
109
|
-
block_id: number;
|
|
110
|
-
input_id: number;
|
|
111
|
-
}
|
|
112
|
-
declare function initModel$a(sequelize: Sequelize): () => typeof BlockInputModel;
|
|
113
|
-
|
|
114
|
-
interface BlockAttributes {
|
|
115
|
-
id: number;
|
|
116
|
-
section_id: ForeignKey<number>;
|
|
117
|
-
block_input?: BlockInputAttributes;
|
|
118
|
-
blockcol: string;
|
|
119
|
-
blockrow: string;
|
|
120
|
-
settings: Record<string, unknown>;
|
|
121
|
-
shared: boolean;
|
|
122
|
-
type: string;
|
|
123
|
-
}
|
|
124
|
-
interface BlockCreationAttributes {
|
|
125
|
-
blockcol: string;
|
|
126
|
-
blockrow: string;
|
|
127
|
-
section_id: number;
|
|
128
|
-
type: BlockType;
|
|
129
|
-
contentByLocale: {
|
|
130
|
-
locale: string;
|
|
131
|
-
}[];
|
|
132
|
-
inputs?: BlockCreationAttributes[];
|
|
133
|
-
consumers?: BlockCreationAttributes[];
|
|
134
|
-
}
|
|
135
|
-
declare class BlockModel extends Model<BlockAttributes, BlockCreationAttributes> {
|
|
136
|
-
id: number;
|
|
137
|
-
section_id: number;
|
|
138
|
-
block_input?: BlockInputAttributes;
|
|
139
|
-
contentByLocale: BlockContentModel[];
|
|
140
|
-
inputs: BlockModel[];
|
|
141
|
-
consumers: BlockModel[];
|
|
142
|
-
getContent(locale: string): BlockContentModel;
|
|
143
|
-
toJSON(): AnyNestedBlock;
|
|
144
|
-
}
|
|
145
|
-
declare function initModel$9(sequelize: Sequelize): (models: ReportsDB) => typeof BlockModel;
|
|
146
|
-
|
|
147
|
-
interface FormatterContent {
|
|
148
|
-
description: string;
|
|
149
|
-
inputType: string;
|
|
150
|
-
logic: string;
|
|
151
|
-
testValue: string;
|
|
152
|
-
type: string;
|
|
153
|
-
[key: string]: string;
|
|
154
|
-
}
|
|
155
|
-
interface Formatter {
|
|
156
|
-
id: number;
|
|
157
|
-
name: string;
|
|
158
|
-
content: FormatterContent;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
interface FormatterAttributes {
|
|
162
|
-
id: number;
|
|
163
|
-
name: string;
|
|
164
|
-
content: FormatterContent;
|
|
165
|
-
}
|
|
166
|
-
interface FormatterCreationAttributes {
|
|
167
|
-
name: string;
|
|
168
|
-
content?: FormatterContent;
|
|
169
|
-
}
|
|
170
|
-
declare class FormatterModel extends Model<FormatterAttributes, FormatterCreationAttributes> {
|
|
171
|
-
id: number;
|
|
172
|
-
name: string;
|
|
173
|
-
content: FormatterContent;
|
|
174
|
-
}
|
|
175
|
-
declare function initModel$8(sequelize: Sequelize): () => typeof FormatterModel;
|
|
176
|
-
|
|
177
|
-
declare class ImageContentModel extends Model {
|
|
178
|
-
id: number;
|
|
179
|
-
locale: string;
|
|
180
|
-
meta: string;
|
|
181
|
-
}
|
|
182
|
-
declare function initModel$7(sequelize: Sequelize): () => typeof ImageContentModel;
|
|
183
|
-
|
|
184
|
-
interface ImageAttributes {
|
|
185
|
-
id: number;
|
|
186
|
-
url: string;
|
|
187
|
-
author: string;
|
|
188
|
-
license: string;
|
|
189
|
-
splash: any;
|
|
190
|
-
thumb: any;
|
|
191
|
-
}
|
|
192
|
-
interface ImageCreationAttributes {
|
|
193
|
-
url: string;
|
|
194
|
-
}
|
|
195
|
-
declare class ImageModel extends Model<ImageAttributes, ImageCreationAttributes> {
|
|
196
|
-
id: number;
|
|
197
|
-
url: string;
|
|
198
|
-
author: string;
|
|
199
|
-
license: string;
|
|
200
|
-
splash: any;
|
|
201
|
-
thumb: any;
|
|
202
|
-
contentByLocale: ImageContentModel[];
|
|
203
|
-
getContent(locale: string): ImageContentModel;
|
|
204
|
-
}
|
|
205
|
-
declare function initModel$6(sequelize: Sequelize): (models: ReportsDB) => typeof ImageModel;
|
|
206
|
-
|
|
207
|
-
interface VariantLocaleAttribute {
|
|
208
|
-
name: string;
|
|
209
|
-
type: "constant" | "variable";
|
|
210
|
-
value: string;
|
|
211
|
-
}
|
|
212
|
-
interface VariantLocaleSettings {
|
|
213
|
-
idKey: string;
|
|
214
|
-
labelKey: string;
|
|
215
|
-
accessor: string;
|
|
216
|
-
path: string;
|
|
217
|
-
properties?: Record<string, unknown>;
|
|
218
|
-
attributes: VariantLocaleAttribute[];
|
|
219
|
-
zValueKey: string;
|
|
220
|
-
[key: string]: unknown;
|
|
221
|
-
}
|
|
222
|
-
interface VariantSettings {
|
|
223
|
-
overrideNames?: boolean;
|
|
224
|
-
overrideRelevance?: boolean;
|
|
225
|
-
regenerateSlugs?: boolean;
|
|
226
|
-
keepOldMembers?: boolean;
|
|
227
|
-
doIngest?: boolean;
|
|
228
|
-
order?: number;
|
|
229
|
-
[key: string]: unknown;
|
|
230
|
-
}
|
|
231
|
-
interface Variant {
|
|
232
|
-
id: number;
|
|
233
|
-
dimension_id: number;
|
|
234
|
-
settings: VariantSettings;
|
|
235
|
-
config: Record<string, VariantLocaleSettings>;
|
|
236
|
-
name: string;
|
|
237
|
-
slug: string;
|
|
238
|
-
visible: boolean;
|
|
239
|
-
members_count?: number;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
interface Dimension {
|
|
243
|
-
/** Entity ID */
|
|
244
|
-
id: number;
|
|
245
|
-
/** Parent Report ID */
|
|
246
|
-
report_id: number;
|
|
247
|
-
name: string;
|
|
248
|
-
ordering: string;
|
|
249
|
-
settings: Record<string, unknown>;
|
|
250
|
-
visible: boolean;
|
|
251
|
-
}
|
|
252
|
-
interface NestedDimension extends Dimension {
|
|
253
|
-
variants: Variant[];
|
|
254
|
-
}
|
|
255
|
-
interface NormalizedDimension extends Dimension {
|
|
256
|
-
variants: number[];
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
type EntitySettings$1 = {
|
|
260
|
-
allowed: string;
|
|
261
|
-
allowedLogic: string;
|
|
262
|
-
icon: string;
|
|
263
|
-
position: string;
|
|
264
|
-
memberImageBg: boolean;
|
|
265
|
-
optionsMenu: boolean;
|
|
266
|
-
sectionType: string;
|
|
267
|
-
hidden: boolean;
|
|
268
|
-
margin: "0px" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
269
|
-
columnGutter: "0px" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
270
|
-
width: "full" | "center";
|
|
271
|
-
style: "none" | "card";
|
|
272
|
-
};
|
|
273
|
-
interface Section {
|
|
274
|
-
/** Entity ID */
|
|
275
|
-
id: number;
|
|
276
|
-
/** Parent Report ID */
|
|
277
|
-
report_id: number;
|
|
278
|
-
heading: number;
|
|
279
|
-
ordering: string;
|
|
280
|
-
settings: EntitySettings$1 & {
|
|
281
|
-
name: string;
|
|
282
|
-
columnSettings: Record<string, {
|
|
283
|
-
width?: number;
|
|
284
|
-
full?: boolean;
|
|
285
|
-
}>;
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
interface NestedSection extends Section {
|
|
289
|
-
blocks: AnyNestedBlock[];
|
|
290
|
-
}
|
|
291
|
-
interface NormalizedSection extends Section {
|
|
292
|
-
blocks: number[];
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
type ReportType = "report" | "story";
|
|
296
|
-
type TypeReportSettings = {
|
|
297
|
-
label: string;
|
|
298
|
-
title?: string;
|
|
299
|
-
subtitle?: string;
|
|
300
|
-
comparison?: boolean;
|
|
301
|
-
pdf?: boolean;
|
|
302
|
-
compareLevels?: boolean;
|
|
303
|
-
order?: number;
|
|
304
|
-
hide?: boolean;
|
|
305
|
-
};
|
|
306
|
-
type TypeStorySettings = {
|
|
307
|
-
label: string;
|
|
308
|
-
title?: string;
|
|
309
|
-
subtitle?: string;
|
|
310
|
-
};
|
|
311
|
-
type EntitySettings = {
|
|
312
|
-
report: TypeReportSettings;
|
|
313
|
-
story: TypeStorySettings;
|
|
314
|
-
};
|
|
315
|
-
interface Report<T extends ReportType> {
|
|
316
|
-
/** Entity ID */
|
|
317
|
-
id: number;
|
|
318
|
-
name: string;
|
|
319
|
-
visible: boolean;
|
|
320
|
-
date: string;
|
|
321
|
-
type: T;
|
|
322
|
-
settings: EntitySettings[T];
|
|
323
|
-
}
|
|
324
|
-
interface NestedReport<T extends ReportType> extends Report<T> {
|
|
325
|
-
dimensions: NestedDimension[];
|
|
326
|
-
sections: NestedSection[];
|
|
327
|
-
}
|
|
328
|
-
interface NormalizedReport<T extends ReportType> extends Report<T> {
|
|
329
|
-
dimensions: number[];
|
|
330
|
-
sections: number[];
|
|
331
|
-
}
|
|
332
|
-
type AnyReport = Report<"report"> | Report<"story">;
|
|
333
|
-
type AnyNestedReport = NestedReport<"report"> | NestedReport<"story">;
|
|
334
|
-
type AnyNormalizedReport = NormalizedReport<"report"> | NormalizedReport<"story">;
|
|
335
|
-
|
|
336
|
-
interface SearchAttributes {
|
|
337
|
-
id: string;
|
|
338
|
-
zvalue: number;
|
|
339
|
-
slug: string;
|
|
340
|
-
image_id: number;
|
|
341
|
-
content_id: number;
|
|
342
|
-
dimension_id: number;
|
|
343
|
-
variant_id: number;
|
|
344
|
-
report_id: number;
|
|
345
|
-
visible: boolean;
|
|
346
|
-
}
|
|
347
|
-
interface SearchCreationAttributes {
|
|
348
|
-
id: string;
|
|
349
|
-
slug: string;
|
|
350
|
-
zvalue: number;
|
|
351
|
-
dimension_id: number;
|
|
352
|
-
variant_id: number;
|
|
353
|
-
report_id: number;
|
|
354
|
-
}
|
|
355
|
-
declare class SearchModel extends Model<SearchAttributes, SearchCreationAttributes> {
|
|
356
|
-
id: string;
|
|
357
|
-
slug: string;
|
|
358
|
-
visible: boolean;
|
|
359
|
-
zvalue: number;
|
|
360
|
-
content_id: number;
|
|
361
|
-
dimension_id: number;
|
|
362
|
-
image_id: number;
|
|
363
|
-
report_id: number;
|
|
364
|
-
variant_id: number;
|
|
365
|
-
dimension: DimensionModel;
|
|
366
|
-
image: ImageModel;
|
|
367
|
-
report: ReportModel;
|
|
368
|
-
variant: VariantModel;
|
|
369
|
-
contentByLocale: SearchContentModel[];
|
|
370
|
-
getContent(locale: string): SearchContentModel;
|
|
371
|
-
}
|
|
372
|
-
declare function initModel$5(sequelize: Sequelize): (models: ReportsDB) => typeof SearchModel;
|
|
373
|
-
|
|
374
|
-
interface VariantAttributes {
|
|
375
|
-
id: number;
|
|
376
|
-
dimension_id: number;
|
|
377
|
-
settings: Record<string, unknown>;
|
|
378
|
-
config: Record<string, VariantLocaleSettings>;
|
|
379
|
-
name: string;
|
|
380
|
-
slug: string;
|
|
381
|
-
visible: boolean;
|
|
382
|
-
}
|
|
383
|
-
interface VariantCreationAttributes {
|
|
384
|
-
dimension_id: number;
|
|
385
|
-
slug: Variant["slug"];
|
|
386
|
-
name: Variant["name"];
|
|
387
|
-
}
|
|
388
|
-
declare class VariantModel extends Model<VariantAttributes, VariantCreationAttributes> {
|
|
389
|
-
id: number;
|
|
390
|
-
dimension_id: number;
|
|
391
|
-
config: Variant["config"];
|
|
392
|
-
name: Variant["name"];
|
|
393
|
-
settings: Variant["settings"];
|
|
394
|
-
slug: Variant["slug"];
|
|
395
|
-
visible: Variant["visible"];
|
|
396
|
-
dimension: DimensionModel;
|
|
397
|
-
members: SearchModel[];
|
|
398
|
-
get report(): ReportModel;
|
|
399
|
-
toJSON(): Variant;
|
|
400
|
-
}
|
|
401
|
-
declare function initModel$4(sequelize: Sequelize): (models: ReportsDB) => typeof VariantModel;
|
|
402
|
-
|
|
403
|
-
interface DimensionAttributes {
|
|
404
|
-
id: number;
|
|
405
|
-
report_id: number;
|
|
406
|
-
name: string;
|
|
407
|
-
ordering: NestedDimension["ordering"];
|
|
408
|
-
settings: Record<string, unknown>;
|
|
409
|
-
visible: boolean;
|
|
410
|
-
}
|
|
411
|
-
interface DimensionCreationAttributes {
|
|
412
|
-
report_id: number;
|
|
413
|
-
name: string;
|
|
414
|
-
variants?: VariantCreationAttributes[];
|
|
415
|
-
}
|
|
416
|
-
declare class DimensionModel extends Model<DimensionAttributes, DimensionCreationAttributes> {
|
|
417
|
-
id: number;
|
|
418
|
-
report_id: number;
|
|
419
|
-
name: string;
|
|
420
|
-
report: ReportModel;
|
|
421
|
-
variants: VariantModel[];
|
|
422
|
-
toJSON(): NestedDimension;
|
|
423
|
-
}
|
|
424
|
-
declare function initModel$3(sequelize: Sequelize): (models: ReportsDB) => typeof DimensionModel;
|
|
425
|
-
|
|
426
|
-
interface SectionAttributes {
|
|
427
|
-
id: number;
|
|
428
|
-
report_id: number;
|
|
429
|
-
heading: NestedSection["heading"];
|
|
430
|
-
ordering: NestedSection["ordering"];
|
|
431
|
-
settings: NestedSection["settings"];
|
|
432
|
-
}
|
|
433
|
-
interface SectionCreationAttributes {
|
|
434
|
-
report_id: SectionAttributes["report_id"];
|
|
435
|
-
ordering: SectionAttributes["ordering"];
|
|
436
|
-
blocks?: BlockCreationAttributes[];
|
|
437
|
-
}
|
|
438
|
-
declare class SectionModel extends Model<SectionAttributes, SectionCreationAttributes> {
|
|
439
|
-
id: number;
|
|
440
|
-
report_id: number;
|
|
441
|
-
blocks: BlockModel[];
|
|
442
|
-
toJSON(): NestedSection;
|
|
443
|
-
}
|
|
444
|
-
declare function initModel$2(sequelize: Sequelize): (models: ReportsDB) => typeof SectionModel;
|
|
445
|
-
|
|
446
|
-
interface ReportAttributes {
|
|
447
|
-
id: number;
|
|
448
|
-
date: string;
|
|
449
|
-
name: string;
|
|
450
|
-
settings: Record<string, unknown>;
|
|
451
|
-
type: AnyReport["type"];
|
|
452
|
-
visible: boolean;
|
|
453
|
-
}
|
|
454
|
-
interface ReportCreationAttributes {
|
|
455
|
-
name: string;
|
|
456
|
-
dimensions?: DimensionCreationAttributes[];
|
|
457
|
-
sections?: SectionCreationAttributes[];
|
|
458
|
-
}
|
|
459
|
-
declare class ReportModel extends Model<ReportAttributes, ReportCreationAttributes> {
|
|
460
|
-
id: number;
|
|
461
|
-
date: Date;
|
|
462
|
-
name: string;
|
|
463
|
-
settings: Record<string, unknown>;
|
|
464
|
-
type: AnyReport["type"];
|
|
465
|
-
visible: boolean;
|
|
466
|
-
dimensions: DimensionModel[];
|
|
467
|
-
sections: SectionModel[];
|
|
468
|
-
toJSON(): AnyNestedReport;
|
|
469
|
-
}
|
|
470
|
-
declare function initModel$1(sequelize: Sequelize): (models: ReportsDB) => typeof ReportModel;
|
|
471
|
-
|
|
472
|
-
interface SearchContentByLocale {
|
|
473
|
-
locale: string;
|
|
474
|
-
name: string;
|
|
475
|
-
}
|
|
476
|
-
interface SearchContentAttributes {
|
|
477
|
-
id: number;
|
|
478
|
-
annotations: Record<string, unknown>;
|
|
479
|
-
attributes: Record<string, unknown>;
|
|
480
|
-
contentByLocale?: SearchContentByLocale[];
|
|
481
|
-
keywords: string[];
|
|
482
|
-
locale: string;
|
|
483
|
-
name: string;
|
|
484
|
-
}
|
|
485
|
-
interface SearchContentCreationAttributes {
|
|
486
|
-
name: string;
|
|
487
|
-
}
|
|
488
|
-
declare class SearchContentModel extends Model<SearchContentAttributes, SearchContentCreationAttributes> {
|
|
489
|
-
id: number;
|
|
490
|
-
annotations: Record<string, unknown>;
|
|
491
|
-
attributes: Record<string, unknown>;
|
|
492
|
-
keywords: string[];
|
|
493
|
-
locale: string;
|
|
494
|
-
name: string;
|
|
495
|
-
}
|
|
496
|
-
declare function initModel(sequelize: Sequelize): () => typeof SearchContentModel;
|
|
497
|
-
|
|
498
|
-
declare const modelFactoryMap: {
|
|
499
|
-
block: typeof initModel$9;
|
|
500
|
-
block_content: typeof initModel$b;
|
|
501
|
-
block_input: typeof initModel$a;
|
|
502
|
-
formatter: typeof initModel$8;
|
|
503
|
-
image: typeof initModel$6;
|
|
504
|
-
image_content: typeof initModel$7;
|
|
505
|
-
report: typeof initModel$1;
|
|
506
|
-
dimension: typeof initModel$3;
|
|
507
|
-
variant: typeof initModel$4;
|
|
508
|
-
search: typeof initModel$5;
|
|
509
|
-
search_content: typeof initModel;
|
|
510
|
-
section: typeof initModel$2;
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
type AssociationFactoryMap = typeof modelFactoryMap;
|
|
514
|
-
type ModelFactoryMap = {
|
|
515
|
-
[K in keyof AssociationFactoryMap]: ReturnType<AssociationFactoryMap[K]>;
|
|
516
|
-
};
|
|
517
|
-
type ReportsDB = {
|
|
518
|
-
sequelize: Sequelize;
|
|
519
|
-
} & {
|
|
520
|
-
[K in keyof ModelFactoryMap]: ReturnType<ModelFactoryMap[K]>;
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
type SimpleEntityMap = {
|
|
524
|
-
block: AnyBlock;
|
|
525
|
-
dimension: Dimension;
|
|
526
|
-
formatter: Formatter;
|
|
527
|
-
report: AnyReport;
|
|
528
|
-
section: Section;
|
|
529
|
-
variant: Variant;
|
|
530
|
-
};
|
|
531
|
-
type NestedEntityMap = {
|
|
532
|
-
block: AnyNestedBlock;
|
|
533
|
-
dimension: NestedDimension;
|
|
534
|
-
formatter: Formatter;
|
|
535
|
-
report: AnyNestedReport;
|
|
536
|
-
section: NestedSection;
|
|
537
|
-
variant: Variant;
|
|
538
|
-
};
|
|
539
|
-
type NormalizedEntityMap = {
|
|
540
|
-
block: AnyNormalizedBlock;
|
|
541
|
-
dimension: NormalizedDimension;
|
|
542
|
-
formatter: Formatter;
|
|
543
|
-
report: AnyNormalizedReport;
|
|
544
|
-
section: NormalizedSection;
|
|
545
|
-
variant: Variant;
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
interface SuccessResult<T> {
|
|
549
|
-
ok: true;
|
|
550
|
-
status: number;
|
|
551
|
-
data: T;
|
|
552
|
-
}
|
|
553
|
-
interface FailureResult<E = string> {
|
|
554
|
-
ok: false;
|
|
555
|
-
status: number;
|
|
556
|
-
error: E;
|
|
557
|
-
}
|
|
558
|
-
type Result<T, E = string> = SuccessResult<T> | FailureResult<E>;
|
|
559
|
-
type EntityType = "block" | "dimension" | "formatter" | "report" | "section" | "variant";
|
|
560
|
-
type CreateParams = {
|
|
561
|
-
block: Pick<SimpleEntityMap["block"], "blockcol" | "blockrow" | "section_id" | "type"> & {
|
|
562
|
-
locales: Array<string>;
|
|
563
|
-
};
|
|
564
|
-
dimension: Pick<NestedEntityMap["dimension"], "name" | "report_id">;
|
|
565
|
-
formatter: Pick<SimpleEntityMap["formatter"], "name" | "content">;
|
|
566
|
-
report: Pick<SimpleEntityMap["report"], "name">;
|
|
567
|
-
section: Pick<SimpleEntityMap["section"], "ordering" | "report_id">;
|
|
568
|
-
variant: Pick<SimpleEntityMap["variant"], "name" | "slug" | "dimension_id">;
|
|
569
|
-
};
|
|
570
|
-
type CreateBulkParams = {
|
|
571
|
-
block: (Pick<SimpleEntityMap["block"], "blockcol" | "blockrow" | "section_id" | "type"> & {
|
|
572
|
-
locales: Array<string>;
|
|
573
|
-
})[];
|
|
574
|
-
section: Pick<SimpleEntityMap["section"], "ordering" | "report_id">[];
|
|
575
|
-
};
|
|
576
|
-
type ReadParams = {
|
|
577
|
-
id?: number | number[];
|
|
578
|
-
include?: boolean | string;
|
|
579
|
-
locales?: string[];
|
|
580
|
-
};
|
|
581
|
-
type UpdateParams = {
|
|
582
|
-
block: Partial<NestedEntityMap["block"]> & {
|
|
583
|
-
id: number;
|
|
584
|
-
inputAction?: {
|
|
585
|
-
operation: "create" | "delete";
|
|
586
|
-
input: {
|
|
587
|
-
input_id: number;
|
|
588
|
-
block_id: number;
|
|
589
|
-
};
|
|
590
|
-
};
|
|
591
|
-
};
|
|
592
|
-
dimension: Partial<NestedEntityMap["dimension"]> & {
|
|
593
|
-
id: number;
|
|
594
|
-
};
|
|
595
|
-
formatter: Partial<NestedEntityMap["formatter"]> & {
|
|
596
|
-
id: number;
|
|
597
|
-
};
|
|
598
|
-
report: Partial<NestedEntityMap["report"]> & {
|
|
599
|
-
id: number;
|
|
600
|
-
};
|
|
601
|
-
section: Partial<NestedEntityMap["section"]> & {
|
|
602
|
-
id: number;
|
|
603
|
-
};
|
|
604
|
-
variant: Partial<NestedEntityMap["variant"]> & {
|
|
605
|
-
id: number;
|
|
606
|
-
};
|
|
607
|
-
};
|
|
608
|
-
type UpdateBulkParams = {
|
|
609
|
-
block: Partial<NestedEntityMap["block"]> & {
|
|
610
|
-
id: number;
|
|
611
|
-
inputAction?: {
|
|
612
|
-
operation: "create" | "delete";
|
|
613
|
-
input: {
|
|
614
|
-
input_id: number;
|
|
615
|
-
block_id: number;
|
|
616
|
-
};
|
|
617
|
-
};
|
|
618
|
-
notInclude?: boolean;
|
|
619
|
-
}[];
|
|
620
|
-
section: Partial<NestedEntityMap["section"]> & {
|
|
621
|
-
id: number;
|
|
622
|
-
}[];
|
|
623
|
-
};
|
|
624
|
-
type DeleteParams = number;
|
|
625
|
-
type CreateResponse<T extends EntityType> = NestedEntityMap[T];
|
|
626
|
-
type UpdateResponse<T extends EntityType> = NestedEntityMap[T];
|
|
627
|
-
type DeleteResponse = {
|
|
628
|
-
id: number;
|
|
629
|
-
parentType?: string;
|
|
630
|
-
parentId?: number;
|
|
631
|
-
};
|
|
632
|
-
type CreateBulkResponse<T extends keyof CreateBulkParams> = NestedEntityMap[T][];
|
|
633
|
-
type UpdateBulkResponse<T extends keyof UpdateBulkParams> = NestedEntityMap[T][];
|
|
634
|
-
interface CreateMethod<T extends EntityType> {
|
|
635
|
-
(params: CreateParams[T]): Promise<Result<CreateResponse<T>>>;
|
|
636
|
-
}
|
|
637
|
-
interface CreateBulkMethod<T extends keyof CreateBulkParams> {
|
|
638
|
-
(params: CreateBulkParams[T]): Promise<Result<CreateBulkResponse<T>>>;
|
|
639
|
-
}
|
|
640
|
-
interface ReadMethod<T extends EntityType> {
|
|
641
|
-
(): Promise<Result<SimpleEntityMap[T][]>>;
|
|
642
|
-
(params: {
|
|
643
|
-
id: number | number[];
|
|
644
|
-
}): Promise<Result<SimpleEntityMap[T][]>>;
|
|
645
|
-
(params: {
|
|
646
|
-
id?: number | number[];
|
|
647
|
-
include: false;
|
|
648
|
-
}): Promise<Result<SimpleEntityMap[T][]>>;
|
|
649
|
-
(params: {
|
|
650
|
-
id?: number | number[];
|
|
651
|
-
include: true;
|
|
652
|
-
}): Promise<Result<NestedEntityMap[T][]>>;
|
|
653
|
-
(params: ReadParams): Promise<Result<SimpleEntityMap[T][] | NestedEntityMap[T][]>>;
|
|
654
|
-
}
|
|
655
|
-
interface UpdateMethod<T extends EntityType> {
|
|
656
|
-
(params: UpdateParams[T]): Promise<Result<UpdateResponse<T>>>;
|
|
657
|
-
}
|
|
658
|
-
interface UpdateBulkMethod<T extends keyof UpdateBulkParams> {
|
|
659
|
-
(params: UpdateBulkParams[T]): Promise<Result<UpdateBulkResponse<T>>>;
|
|
660
|
-
}
|
|
661
|
-
interface DeleteMethod {
|
|
662
|
-
(params: DeleteParams): Promise<Result<DeleteResponse>>;
|
|
663
|
-
}
|
|
664
|
-
interface SearchReportParams {
|
|
665
|
-
query: string;
|
|
666
|
-
locale: string;
|
|
667
|
-
limit: number;
|
|
668
|
-
offset?: number;
|
|
669
|
-
visible: boolean;
|
|
670
|
-
includes: boolean;
|
|
671
|
-
noImage: boolean;
|
|
672
|
-
format: "results" | "profiles" | "grouped";
|
|
673
|
-
variant: number[];
|
|
674
|
-
dimension: number[];
|
|
675
|
-
report: number[];
|
|
676
|
-
all?: boolean;
|
|
677
|
-
}
|
|
678
|
-
interface SearchReportItem extends AutocompleteItem {
|
|
679
|
-
name: string;
|
|
680
|
-
id: string;
|
|
681
|
-
path: string;
|
|
682
|
-
confidence: number;
|
|
683
|
-
members: Array<{
|
|
684
|
-
[key: string]: any;
|
|
685
|
-
}>;
|
|
686
|
-
}
|
|
687
|
-
interface SearchReportResponse {
|
|
688
|
-
meta: {
|
|
689
|
-
[key: string]: any;
|
|
690
|
-
};
|
|
691
|
-
results: Array<SearchReportItem>;
|
|
692
|
-
}
|
|
693
|
-
interface UpdateMemberParams {
|
|
694
|
-
content_id: number;
|
|
695
|
-
contentByLocale: Record<string, any>[];
|
|
696
|
-
image: Record<string, any> | null;
|
|
697
|
-
image_id: number;
|
|
698
|
-
}
|
|
699
|
-
interface UpdateMemberResponse extends SearchAttributes {
|
|
700
|
-
}
|
|
701
|
-
interface ReadMetadataParams {
|
|
702
|
-
}
|
|
703
|
-
interface ReadMetadataResponse {
|
|
704
|
-
data: {
|
|
705
|
-
[key: string]: any;
|
|
706
|
-
}[];
|
|
707
|
-
}
|
|
708
|
-
interface SearchUsersParams {
|
|
709
|
-
query: string;
|
|
710
|
-
role_id?: string;
|
|
711
|
-
page?: number;
|
|
712
|
-
}
|
|
713
|
-
interface UpdateUserParams {
|
|
714
|
-
user_id: string;
|
|
715
|
-
roles?: {
|
|
716
|
-
id: string;
|
|
717
|
-
name: string;
|
|
718
|
-
}[];
|
|
719
|
-
app_metadata?: {
|
|
720
|
-
[key: string]: any;
|
|
721
|
-
};
|
|
722
|
-
user_metadata?: {
|
|
723
|
-
[key: string]: any;
|
|
724
|
-
};
|
|
725
|
-
}
|
|
726
|
-
interface UpdateMyDataParams {
|
|
727
|
-
report_id?: number;
|
|
728
|
-
user_metadata?: Record<string, any>;
|
|
729
|
-
}
|
|
730
|
-
interface ReadPrivateBlocksParams {
|
|
731
|
-
report_id: number;
|
|
732
|
-
locale: string;
|
|
733
|
-
}
|
|
734
|
-
interface InternalReadPrivateBlocksParams extends ReadPrivateBlocksParams {
|
|
735
|
-
roles: string[];
|
|
736
|
-
}
|
|
737
|
-
interface ReadPrivateBlocksResponse {
|
|
738
|
-
params: {
|
|
739
|
-
[key: string]: any;
|
|
740
|
-
};
|
|
741
|
-
data: {
|
|
742
|
-
[key: string]: any;
|
|
743
|
-
}[];
|
|
744
|
-
}
|
|
745
|
-
interface RevalidateReportRequest {
|
|
746
|
-
profilePrefix: string;
|
|
747
|
-
reportId: number;
|
|
748
|
-
variantPaths?: {
|
|
749
|
-
variantId: number;
|
|
750
|
-
prefix: string;
|
|
751
|
-
variantSlug: string;
|
|
752
|
-
}[];
|
|
753
|
-
}
|
|
754
|
-
interface RevalidateReportResponse {
|
|
755
|
-
reportId: number;
|
|
756
|
-
revalidated: number;
|
|
757
|
-
samples: string[];
|
|
758
|
-
paths: string[];
|
|
759
|
-
}
|
|
760
|
-
interface RevalidateUrlRequest {
|
|
761
|
-
target: string;
|
|
762
|
-
}
|
|
763
|
-
interface RevalidateUrlResponse {
|
|
764
|
-
target: string;
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
export { AnyBlock as A, DeleteMethod as B, CreateMethod as C, Dimension as D, ReadMethod as E, Formatter as F, UpdateMethod as G, CreateBulkMethod as H, ImageModel as I, UpdateBulkMethod as J, UpdateMemberParams as K, UpdateMemberResponse as L, NormalizedEntityMap as M, NestedDimension as N, NestedEntityMap as O, SearchReportItem as P, ReportsDB as R, Section as S, UpdateUserParams as U, Variant as V, Result as a, AnyNestedBlock as b, AnyReport as c, AnyNestedReport as d, NestedSection as e, ReadParams as f, DeleteParams as g, SearchReportParams as h, SearchReportResponse as i, ReadMetadataParams as j, ReadMetadataResponse as k, SearchUsersParams as l, UpdateMyDataParams as m, ReadPrivateBlocksParams as n, ReadPrivateBlocksResponse as o, RevalidateUrlRequest as p, RevalidateUrlResponse as q, RevalidateReportRequest as r, RevalidateReportResponse as s, SearchAttributes as t, SearchContentAttributes as u, ReportAttributes as v, DimensionAttributes as w, VariantAttributes as x, SearchContentModel as y, InternalReadPrivateBlocksParams as z };
|