@datawheel/bespoke 1.0.0-beta.1 → 1.0.0-beta.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/{Search-CpmCBiYZ.d.mts → Search-BWmRyIa9.d.mts} +1 -1
- package/dist/{auth-D3PWImeZ.d.mts → auth-BwgF4GT9.d.mts} +1 -1
- package/dist/auth.d.mts +3 -3
- package/dist/cms.js +26 -26
- package/dist/explore.d.mts +3 -3
- package/dist/explore.js +2 -2
- package/dist/redux-store.d.mts +7 -8
- package/dist/redux-store.js +3 -3
- package/dist/report.d.mts +3 -3
- package/dist/report.js +9 -9
- package/dist/server.d.mts +4 -5
- package/dist/server.js +2 -2
- package/dist/store-De3Xknzr.d.mts +545 -0
- package/dist/{types-WI9fSG9b.d.mts → types-BcIo0oyw.d.mts} +1 -1
- package/package.json +8 -5
- package/dist/store-D5N14riO.d.mts +0 -888
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import * as next_app from 'next/app';
|
|
2
|
+
import * as next from 'next';
|
|
3
|
+
import * as querystring from 'querystring';
|
|
4
|
+
import * as next_redux_wrapper from 'next-redux-wrapper';
|
|
5
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
6
|
+
import { ThunkAction, Action, ThunkDispatch } from '@reduxjs/toolkit';
|
|
7
|
+
import { w as SearchContentModel, I as ImageModel, c as AnyNestedReport, x as NormalizedEntityMap, y as NestedEntityMap, z as SearchAttributes, B as SearchContentAttributes, C as ReportAttributes, E as DimensionAttributes, G as VariantAttributes, v as ReportsDB, i as SearchReportParams, R as Result, j as SearchReportResponse, k as ReadMetadataParams, l as ReadMetadataResponse, m as UpdateMyDataParams, r as RevalidateReportRequest, s as RevalidateReportResponse, p as RevalidateUrlRequest, q as RevalidateUrlResponse, H as InternalReadPrivateBlocksParams, o as ReadPrivateBlocksResponse, t as ReadEnvSecretsResponse, J as CreateMethod, K as DeleteMethod, L as ReadMethod, M as UpdateMethod, O as CreateBulkMethod, P as UpdateBulkMethod, Q as UpdateMemberParams, T as UpdateMemberResponse } from './types-BcIo0oyw.mjs';
|
|
8
|
+
import { e as BespokeAuthOptions } from './auth-BwgF4GT9.mjs';
|
|
9
|
+
|
|
10
|
+
interface ReadMembersIdsParams {
|
|
11
|
+
/** Perform the members search by original ID. */
|
|
12
|
+
mode: "ids";
|
|
13
|
+
ids: string[];
|
|
14
|
+
/** Determines if the search will retrieve Content variants for all locales, of just for the specified. */
|
|
15
|
+
all?: boolean;
|
|
16
|
+
/** Specifies the Content locale to retrieve. */
|
|
17
|
+
locale: string;
|
|
18
|
+
/** Filter by variant */
|
|
19
|
+
variant?: number[];
|
|
20
|
+
/** Output size */
|
|
21
|
+
output: "full" | "lite";
|
|
22
|
+
/** Optional. If true, avoud the difference and return anyway. */
|
|
23
|
+
allowNulls?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface ReadMembersSlugsParams {
|
|
26
|
+
/** Perform the members search by associated slugs. */
|
|
27
|
+
mode: "slugs";
|
|
28
|
+
slugs: {
|
|
29
|
+
variantSlug: string;
|
|
30
|
+
memberSlug: string;
|
|
31
|
+
}[];
|
|
32
|
+
/** Determines if the search will retrieve Content variants for all locales, of just for the specified. */
|
|
33
|
+
all?: boolean;
|
|
34
|
+
/** Specifies the Content locale to retrieve. */
|
|
35
|
+
locale: string;
|
|
36
|
+
/** Filter by variant */
|
|
37
|
+
variant?: number[];
|
|
38
|
+
/** Output size */
|
|
39
|
+
output: "full" | "lite";
|
|
40
|
+
/** Optional. If true, avoud the difference and return anyway. */
|
|
41
|
+
allowNulls?: boolean;
|
|
42
|
+
}
|
|
43
|
+
interface ReadMembersContentParams {
|
|
44
|
+
/** Perform the members search by internal content id. */
|
|
45
|
+
mode: "content_ids";
|
|
46
|
+
content_ids: number[];
|
|
47
|
+
/** Determines if the search will retrieve Content variants for all locales, of just for the specified. */
|
|
48
|
+
all?: boolean;
|
|
49
|
+
/** Specifies the Content locale to retrieve. */
|
|
50
|
+
locale: string;
|
|
51
|
+
/** Filter by variant */
|
|
52
|
+
variant?: number[];
|
|
53
|
+
/** Output size */
|
|
54
|
+
output: "full" | "lite";
|
|
55
|
+
/** Optional. If true, avoud the difference and return anyway. */
|
|
56
|
+
allowNulls?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface ReadMembersRelatedParams {
|
|
59
|
+
/** Perform the members search randomly by report, dimension or variant id */
|
|
60
|
+
mode: "related";
|
|
61
|
+
/** Optional. Defines the report_id by which to generate the random results */
|
|
62
|
+
report_ids?: number[];
|
|
63
|
+
/** Optional. Defines the dimension_id by which to generate the random results */
|
|
64
|
+
dimension_ids?: number[];
|
|
65
|
+
/** Optional. Defines the variant_id by which to generate the random results */
|
|
66
|
+
variant_ids?: number[];
|
|
67
|
+
/** Specifies the limit of results to randomly generate */
|
|
68
|
+
related?: number;
|
|
69
|
+
/** Determines if the search will retrieve Content variants for all locales, of just for the specified. */
|
|
70
|
+
all?: boolean;
|
|
71
|
+
/** Specifies the Content locale to retrieve. */
|
|
72
|
+
locale: string;
|
|
73
|
+
/** List of the current content_ids used in the report. */
|
|
74
|
+
current_ids: number[];
|
|
75
|
+
/** Optional. List of ids to be included in the return */
|
|
76
|
+
include_ids?: number[];
|
|
77
|
+
/** Filter by variant */
|
|
78
|
+
variant?: number[];
|
|
79
|
+
/** Output size */
|
|
80
|
+
output: "full" | "lite";
|
|
81
|
+
/** Optional. If true, avoud the difference and return anyway. */
|
|
82
|
+
allowNulls?: boolean;
|
|
83
|
+
}
|
|
84
|
+
interface ReadMembersWholeParams {
|
|
85
|
+
/** Retrieve all members by report, dimension or variant id */
|
|
86
|
+
mode: "whole";
|
|
87
|
+
/** Specifies the limit of results to randomly generate */
|
|
88
|
+
all?: boolean;
|
|
89
|
+
/** Specifies the Content locale to retrieve. */
|
|
90
|
+
locale: string;
|
|
91
|
+
/** Filter by variant */
|
|
92
|
+
variant?: number[];
|
|
93
|
+
/** Output size */
|
|
94
|
+
output: "full" | "lite";
|
|
95
|
+
/** Optional. If true, avoud the difference and return anyway. */
|
|
96
|
+
allowNulls?: boolean;
|
|
97
|
+
}
|
|
98
|
+
type ReadMembersParams = ReadMembersContentParams | ReadMembersIdsParams | ReadMembersSlugsParams | ReadMembersRelatedParams | ReadMembersWholeParams;
|
|
99
|
+
interface ReadMembersGeneralResult {
|
|
100
|
+
id: string;
|
|
101
|
+
slug: string;
|
|
102
|
+
visible: boolean;
|
|
103
|
+
zvalue: number;
|
|
104
|
+
content_id: number;
|
|
105
|
+
report_id: number;
|
|
106
|
+
report_name: string;
|
|
107
|
+
dimension_id: number;
|
|
108
|
+
dimension_name: string;
|
|
109
|
+
dimension_ordering: number;
|
|
110
|
+
variant_id: number;
|
|
111
|
+
variant_name: string;
|
|
112
|
+
variant_slug: string;
|
|
113
|
+
contentByLocale?: SearchContentModel[];
|
|
114
|
+
image?: ImageModel;
|
|
115
|
+
image_id?: number;
|
|
116
|
+
name?: string;
|
|
117
|
+
}
|
|
118
|
+
interface ReadMembersLocaleResult extends ReadMembersGeneralResult {
|
|
119
|
+
locale: string;
|
|
120
|
+
name: string;
|
|
121
|
+
attributes: Record<string, string>;
|
|
122
|
+
keywords: any;
|
|
123
|
+
image_id?: number;
|
|
124
|
+
image?: any;
|
|
125
|
+
}
|
|
126
|
+
type ReadMembersResult = ReadMembersGeneralResult | ReadMembersLocaleResult;
|
|
127
|
+
interface ReadMembersResponse {
|
|
128
|
+
meta: ReadMembersParams;
|
|
129
|
+
results: ReadMembersResult[];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
type ActiveEntityType = {
|
|
133
|
+
type: "report" | "section" | "block" | null;
|
|
134
|
+
id: number | null;
|
|
135
|
+
};
|
|
136
|
+
type StatusState = {
|
|
137
|
+
localeDefault: string;
|
|
138
|
+
locales: string[];
|
|
139
|
+
currentLocale: string;
|
|
140
|
+
preferredLocale: string;
|
|
141
|
+
showToolbar: boolean;
|
|
142
|
+
activeSection: number | null;
|
|
143
|
+
/**
|
|
144
|
+
* Defines the members of the current working variant to be used in
|
|
145
|
+
* calculating previews for content.
|
|
146
|
+
*/
|
|
147
|
+
previews: ReadMembersResult[];
|
|
148
|
+
/**
|
|
149
|
+
* Defines a map of parameters to hydrate internal state in blocks.
|
|
150
|
+
*/
|
|
151
|
+
query: Record<string, string>;
|
|
152
|
+
/**
|
|
153
|
+
* Defines a map between section ID and its internal state.
|
|
154
|
+
*/
|
|
155
|
+
sectionState: Record<number, Record<string, any>>;
|
|
156
|
+
/**
|
|
157
|
+
* Defines active entity in the editor
|
|
158
|
+
*/
|
|
159
|
+
activeEntity: ActiveEntityType;
|
|
160
|
+
sidebarStatus: {
|
|
161
|
+
tools: boolean;
|
|
162
|
+
settings: boolean;
|
|
163
|
+
reportEditor: boolean;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* A flag to indicate if the state was initialized in the CMS, default false which means renderer.
|
|
167
|
+
*/
|
|
168
|
+
isCMS: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* List of sections loading runConsumers is running cliend side to show a loading state
|
|
171
|
+
*/
|
|
172
|
+
isRunConsumersRunning: number[];
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
type RecordsKey = "block" | "dimension" | "report" | "section" | "variant" | "formatter" | "datasource";
|
|
176
|
+
type RecordsState = {
|
|
177
|
+
tree: AnyNestedReport[];
|
|
178
|
+
reports: number[] | null;
|
|
179
|
+
entities: {
|
|
180
|
+
[K in RecordsKey]: Record<number, NormalizedEntityMap[K]>;
|
|
181
|
+
};
|
|
182
|
+
requests: {
|
|
183
|
+
[K in RecordsKey]: Record<string, EntityRequest<K, unknown>>;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
declare enum FetchStatus {
|
|
187
|
+
UNINITIALIZED = "UNINITIALIZED",
|
|
188
|
+
LOADING = "LOADING",
|
|
189
|
+
SUCCESS = "SUCCESS",
|
|
190
|
+
FAILURE = "FAILURE",
|
|
191
|
+
FETCHING = "FETCHING"
|
|
192
|
+
}
|
|
193
|
+
type EntityRequest<T extends RecordsKey, D = NestedEntityMap[T][]> = {
|
|
194
|
+
key: string;
|
|
195
|
+
type: T;
|
|
196
|
+
operation?: string;
|
|
197
|
+
status: FetchStatus.UNINITIALIZED | FetchStatus.LOADING | FetchStatus.FETCHING;
|
|
198
|
+
} | {
|
|
199
|
+
key: string;
|
|
200
|
+
type: T;
|
|
201
|
+
operation?: string;
|
|
202
|
+
status: FetchStatus.SUCCESS;
|
|
203
|
+
data: D;
|
|
204
|
+
} | {
|
|
205
|
+
key: string;
|
|
206
|
+
type: T;
|
|
207
|
+
operation?: string;
|
|
208
|
+
status: FetchStatus.FAILURE;
|
|
209
|
+
error: {
|
|
210
|
+
code: number;
|
|
211
|
+
message: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
interface ReadMemberImageParams {
|
|
216
|
+
member: number;
|
|
217
|
+
size?: "thumb" | "splash";
|
|
218
|
+
}
|
|
219
|
+
type ReadMemberImageResponse = Buffer | Blob;
|
|
220
|
+
|
|
221
|
+
interface SearchMemberParams {
|
|
222
|
+
/**
|
|
223
|
+
* The query string to search members for.
|
|
224
|
+
* If requesting an empty string (`""`), will return the top most ranked
|
|
225
|
+
* members per profile, up to the amount defined by the `limit` parameter.
|
|
226
|
+
*/
|
|
227
|
+
query: string;
|
|
228
|
+
locale: string;
|
|
229
|
+
/**
|
|
230
|
+
* User's preferred locale, used for indexing search if its set to "all"
|
|
231
|
+
*/
|
|
232
|
+
preferredLocale?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Determines the max amount of search results to retrive.
|
|
235
|
+
*/
|
|
236
|
+
limit: number;
|
|
237
|
+
/**
|
|
238
|
+
* Determines if the search will be limited to all profiles,
|
|
239
|
+
* or only to non-hidden ones.
|
|
240
|
+
*/
|
|
241
|
+
visible: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Determines if each search result will include their parent entities as
|
|
244
|
+
* properties.
|
|
245
|
+
*/
|
|
246
|
+
includes: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Determines if returning the info for the associated image to the member.
|
|
249
|
+
*/
|
|
250
|
+
noImage: boolean;
|
|
251
|
+
format: "nested" | "plain";
|
|
252
|
+
/**
|
|
253
|
+
* Determines if the resulting set belongs to the specified set of variants.
|
|
254
|
+
* Leave empty to search across all variants in the database.
|
|
255
|
+
*/
|
|
256
|
+
variant: number[];
|
|
257
|
+
/**
|
|
258
|
+
* Determines if the resulting set belongs to the specified set of dimensions.
|
|
259
|
+
* Leave empty to search across all dimensions in the database.
|
|
260
|
+
*/
|
|
261
|
+
dimension: number[];
|
|
262
|
+
/**
|
|
263
|
+
* Determines if the resulting set belongs to the specified set of reports.
|
|
264
|
+
* Leave empty to search across all reports in the database.
|
|
265
|
+
*/
|
|
266
|
+
report: number[];
|
|
267
|
+
/**
|
|
268
|
+
* Determines if the search will be performed on all locales.
|
|
269
|
+
* TODO: fuse with `locale` parameter
|
|
270
|
+
*/
|
|
271
|
+
all?: boolean;
|
|
272
|
+
sort?: string;
|
|
273
|
+
direction?: string;
|
|
274
|
+
offset?: number;
|
|
275
|
+
origin?: "flexsearch" | "typesense";
|
|
276
|
+
}
|
|
277
|
+
interface SearchMemberResponse {
|
|
278
|
+
meta: {
|
|
279
|
+
[K in keyof SearchMemberParams]?: string;
|
|
280
|
+
} & {
|
|
281
|
+
variantCount?: Record<number, number>;
|
|
282
|
+
};
|
|
283
|
+
results: SearchMemberResult[];
|
|
284
|
+
}
|
|
285
|
+
interface SearchMemberResult extends SearchAttributes {
|
|
286
|
+
locale?: SearchContentAttributes["locale"];
|
|
287
|
+
name?: SearchContentAttributes["name"];
|
|
288
|
+
attributes?: SearchContentAttributes["attributes"];
|
|
289
|
+
keywords?: SearchContentAttributes["keywords"];
|
|
290
|
+
contentByLocale?: SearchContentAttributes["contentByLocale"];
|
|
291
|
+
score?: number;
|
|
292
|
+
contentId?: number;
|
|
293
|
+
report?: ReportAttributes;
|
|
294
|
+
dimension?: DimensionAttributes;
|
|
295
|
+
variant?: VariantAttributes;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface ValidateVariantSlugParams {
|
|
299
|
+
dimension: number;
|
|
300
|
+
slug: string;
|
|
301
|
+
}
|
|
302
|
+
interface ValidateVariantSlugResponse {
|
|
303
|
+
valid: boolean;
|
|
304
|
+
dimension_id: number;
|
|
305
|
+
candidate: string;
|
|
306
|
+
suggestion: string;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
interface ListIconsResponse {
|
|
310
|
+
meta: {
|
|
311
|
+
[key: string]: string;
|
|
312
|
+
};
|
|
313
|
+
results: string[];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
interface ReadIconParams {
|
|
317
|
+
provider: string;
|
|
318
|
+
name: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
type ProxyRequestParams = {
|
|
322
|
+
url: string;
|
|
323
|
+
method?: "GET" | "POST";
|
|
324
|
+
timeout?: number;
|
|
325
|
+
user_roles?: string[];
|
|
326
|
+
wrapper?: boolean;
|
|
327
|
+
session?: any;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
interface ImageSearchParams {
|
|
331
|
+
prompt: string;
|
|
332
|
+
page: number;
|
|
333
|
+
}
|
|
334
|
+
interface ImageSearchResponse {
|
|
335
|
+
meta: {
|
|
336
|
+
[key: string]: string;
|
|
337
|
+
};
|
|
338
|
+
results: {
|
|
339
|
+
id: number;
|
|
340
|
+
source: string;
|
|
341
|
+
}[];
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
interface ImageSaveParams {
|
|
345
|
+
content_id: number;
|
|
346
|
+
image_id: number;
|
|
347
|
+
image_source?: string;
|
|
348
|
+
files?: Record<string, any>;
|
|
349
|
+
prompt?: string;
|
|
350
|
+
}
|
|
351
|
+
interface ImageSaveResponse {
|
|
352
|
+
meta: Record<string, string | number>;
|
|
353
|
+
results: any;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
interface RegenerateSearchResponse {
|
|
357
|
+
error: boolean;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
type PublicAPI = ReturnType<typeof apiFactory>;
|
|
361
|
+
declare function useDatabaseApi(_: any, __: any, api: any): Promise<void>;
|
|
362
|
+
declare function apiFactory(dbModels: ReportsDB, authOptions?: BespokeAuthOptions): {
|
|
363
|
+
searchReport: (param: SearchReportParams) => Promise<Result<SearchReportResponse>>;
|
|
364
|
+
readMetadata: (param: ReadMetadataParams) => Promise<Result<ReadMetadataResponse>>;
|
|
365
|
+
regenerateSearch: (param: unknown) => Promise<Result<RegenerateSearchResponse>>;
|
|
366
|
+
imageFlickrSearch: (param: ImageSearchParams) => Promise<Result<ImageSearchResponse>>;
|
|
367
|
+
imageLocalSearch: (param: ImageSearchParams) => Promise<Result<ImageSearchResponse>>;
|
|
368
|
+
imageUnsplashSearch: (param: ImageSearchParams) => Promise<Result<ImageSearchResponse>>;
|
|
369
|
+
imageAdobeSearch: (param: ImageSearchParams) => Promise<Result<ImageSearchResponse>>;
|
|
370
|
+
imagePixabaySearch: (param: ImageSearchParams) => Promise<Result<ImageSearchResponse>>;
|
|
371
|
+
imageFlickrSave: (param: ImageSaveParams) => Promise<Result<ImageSaveResponse>>;
|
|
372
|
+
imageLocalSave: (param: ImageSaveParams) => Promise<Result<ImageSaveResponse>>;
|
|
373
|
+
imageUnsplashSave: (param: ImageSaveParams) => Promise<Result<ImageSaveResponse>>;
|
|
374
|
+
imageUploadSave: (param: ImageSaveParams) => Promise<Result<ImageSaveResponse>>;
|
|
375
|
+
imageAdobeSave: (param: ImageSaveParams) => Promise<Result<ImageSaveResponse>>;
|
|
376
|
+
imagePixabaySave: (param: ImageSaveParams) => Promise<Result<ImageSaveResponse>>;
|
|
377
|
+
urlProxy: (request: ProxyRequestParams) => Promise<Result<any>>;
|
|
378
|
+
searchRole: any;
|
|
379
|
+
searchUser: any;
|
|
380
|
+
readUser: any;
|
|
381
|
+
updateUser: any;
|
|
382
|
+
updateMyData: (param: UpdateMyDataParams) => Promise<Result<string>>;
|
|
383
|
+
revalidateReport: (param: RevalidateReportRequest) => Promise<Result<RevalidateReportResponse>>;
|
|
384
|
+
revalidateUrl: (param: RevalidateUrlRequest) => Promise<Result<RevalidateUrlResponse>>;
|
|
385
|
+
readPrivateBlocks: (param: InternalReadPrivateBlocksParams) => Promise<Result<ReadPrivateBlocksResponse>>;
|
|
386
|
+
listTablerIcons: (param: unknown) => Promise<Result<ListIconsResponse>>;
|
|
387
|
+
readTablerIcon: (param: ReadIconParams) => Promise<Result<string>>;
|
|
388
|
+
readEnvSecrets: (param: unknown) => Promise<Result<ReadEnvSecretsResponse>>;
|
|
389
|
+
createFormatter: CreateMethod<"formatter">;
|
|
390
|
+
deleteFormatter: DeleteMethod;
|
|
391
|
+
readFormatter: ReadMethod<"formatter">;
|
|
392
|
+
updateFormatter: UpdateMethod<"formatter">;
|
|
393
|
+
createReport: CreateMethod<"report">;
|
|
394
|
+
deleteReport: DeleteMethod;
|
|
395
|
+
readReport: ReadMethod<"report">;
|
|
396
|
+
updateReport: UpdateMethod<"report">;
|
|
397
|
+
createDimension: CreateMethod<"dimension">;
|
|
398
|
+
deleteDimension: DeleteMethod;
|
|
399
|
+
readDimension: ReadMethod<"dimension">;
|
|
400
|
+
updateDimension: UpdateMethod<"dimension">;
|
|
401
|
+
createVariant: CreateMethod<"variant">;
|
|
402
|
+
readVariant: ReadMethod<"variant">;
|
|
403
|
+
updateVariant: UpdateMethod<"variant">;
|
|
404
|
+
deleteVariant: DeleteMethod;
|
|
405
|
+
validateVariantSlug: (param: ValidateVariantSlugParams) => Promise<Result<ValidateVariantSlugResponse>>;
|
|
406
|
+
createSection: CreateMethod<"section">;
|
|
407
|
+
readSection: ReadMethod<"section">;
|
|
408
|
+
updateSection: UpdateMethod<"section">;
|
|
409
|
+
deleteSection: DeleteMethod;
|
|
410
|
+
createBlock: CreateMethod<"block">;
|
|
411
|
+
deleteBlock: DeleteMethod;
|
|
412
|
+
readBlock: ReadMethod<"block">;
|
|
413
|
+
updateBlock: UpdateMethod<"block">;
|
|
414
|
+
createBulkBlock: CreateBulkMethod<"block">;
|
|
415
|
+
updateBulkBlock: UpdateBulkMethod<"block">;
|
|
416
|
+
readMember: (param: ReadMembersParams) => Promise<Result<ReadMembersResponse>>;
|
|
417
|
+
searchMember: (param: SearchMemberParams) => Promise<Result<SearchMemberResponse>>;
|
|
418
|
+
updateMember: (param: UpdateMemberParams) => Promise<Result<UpdateMemberResponse>>;
|
|
419
|
+
readMemberImage: (param: ReadMemberImageParams) => Promise<Result<ReadMemberImageResponse>>;
|
|
420
|
+
createDatasource: CreateMethod<"datasource">;
|
|
421
|
+
deleteDatasource: DeleteMethod;
|
|
422
|
+
readDatasource: ReadMethod<"datasource">;
|
|
423
|
+
updateDatasource: UpdateMethod<"datasource">;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
declare const storeFactory: () => _reduxjs_toolkit.EnhancedStore<{
|
|
427
|
+
records: RecordsState;
|
|
428
|
+
status: StatusState;
|
|
429
|
+
variables: {
|
|
430
|
+
attributes: {
|
|
431
|
+
[x: string]: any;
|
|
432
|
+
};
|
|
433
|
+
variables: {
|
|
434
|
+
[x: string]: any;
|
|
435
|
+
};
|
|
436
|
+
status: {
|
|
437
|
+
[x: string]: any;
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
}, _reduxjs_toolkit.UnknownAction, _reduxjs_toolkit.Tuple<[_reduxjs_toolkit.StoreEnhancer<{
|
|
441
|
+
dispatch: {};
|
|
442
|
+
}>, _reduxjs_toolkit.StoreEnhancer]>>;
|
|
443
|
+
declare const storeWrapper: {
|
|
444
|
+
getServerSideProps: <P extends {} = any>(callback: next_redux_wrapper.GetServerSidePropsCallback<_reduxjs_toolkit.EnhancedStore<{
|
|
445
|
+
records: RecordsState;
|
|
446
|
+
status: StatusState;
|
|
447
|
+
variables: {
|
|
448
|
+
attributes: {
|
|
449
|
+
[x: string]: any;
|
|
450
|
+
};
|
|
451
|
+
variables: {
|
|
452
|
+
[x: string]: any;
|
|
453
|
+
};
|
|
454
|
+
status: {
|
|
455
|
+
[x: string]: any;
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
}, _reduxjs_toolkit.UnknownAction, _reduxjs_toolkit.Tuple<[_reduxjs_toolkit.StoreEnhancer<{
|
|
459
|
+
dispatch: {};
|
|
460
|
+
}>, _reduxjs_toolkit.StoreEnhancer]>>, P>) => next.GetServerSideProps<P, querystring.ParsedUrlQuery, next.PreviewData>;
|
|
461
|
+
getStaticProps: <P_1 extends {} = any>(callback: next_redux_wrapper.GetStaticPropsCallback<_reduxjs_toolkit.EnhancedStore<{
|
|
462
|
+
records: RecordsState;
|
|
463
|
+
status: StatusState;
|
|
464
|
+
variables: {
|
|
465
|
+
attributes: {
|
|
466
|
+
[x: string]: any;
|
|
467
|
+
};
|
|
468
|
+
variables: {
|
|
469
|
+
[x: string]: any;
|
|
470
|
+
};
|
|
471
|
+
status: {
|
|
472
|
+
[x: string]: any;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
}, _reduxjs_toolkit.UnknownAction, _reduxjs_toolkit.Tuple<[_reduxjs_toolkit.StoreEnhancer<{
|
|
476
|
+
dispatch: {};
|
|
477
|
+
}>, _reduxjs_toolkit.StoreEnhancer]>>, P_1>) => next.GetStaticProps<P_1, querystring.ParsedUrlQuery, next.PreviewData>;
|
|
478
|
+
getInitialAppProps: <P_2 extends {} = any>(callback: next_redux_wrapper.AppCallback<_reduxjs_toolkit.EnhancedStore<{
|
|
479
|
+
records: RecordsState;
|
|
480
|
+
status: StatusState;
|
|
481
|
+
variables: {
|
|
482
|
+
attributes: {
|
|
483
|
+
[x: string]: any;
|
|
484
|
+
};
|
|
485
|
+
variables: {
|
|
486
|
+
[x: string]: any;
|
|
487
|
+
};
|
|
488
|
+
status: {
|
|
489
|
+
[x: string]: any;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
}, _reduxjs_toolkit.UnknownAction, _reduxjs_toolkit.Tuple<[_reduxjs_toolkit.StoreEnhancer<{
|
|
493
|
+
dispatch: {};
|
|
494
|
+
}>, _reduxjs_toolkit.StoreEnhancer]>>, P_2>) => ({ Component, ctx }: next_app.AppContext) => Promise<next_app.AppInitialProps & {
|
|
495
|
+
pageProps: P_2;
|
|
496
|
+
}>;
|
|
497
|
+
getInitialPageProps: <P_3 extends {} = any>(callback: next_redux_wrapper.PageCallback<_reduxjs_toolkit.EnhancedStore<{
|
|
498
|
+
records: RecordsState;
|
|
499
|
+
status: StatusState;
|
|
500
|
+
variables: {
|
|
501
|
+
attributes: {
|
|
502
|
+
[x: string]: any;
|
|
503
|
+
};
|
|
504
|
+
variables: {
|
|
505
|
+
[x: string]: any;
|
|
506
|
+
};
|
|
507
|
+
status: {
|
|
508
|
+
[x: string]: any;
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
}, _reduxjs_toolkit.UnknownAction, _reduxjs_toolkit.Tuple<[_reduxjs_toolkit.StoreEnhancer<{
|
|
512
|
+
dispatch: {};
|
|
513
|
+
}>, _reduxjs_toolkit.StoreEnhancer]>>, P_3>) => ((context: next.NextPageContext<any>) => any) | undefined;
|
|
514
|
+
withRedux: (Component: next.NextComponentType | next_app.default | any) => {
|
|
515
|
+
(props: any): JSX.Element;
|
|
516
|
+
displayName: string;
|
|
517
|
+
getInitialProps: any;
|
|
518
|
+
};
|
|
519
|
+
useWrappedStore: ({ initialState: giapState, initialProps, ...props }: any, displayName?: string) => {
|
|
520
|
+
store: _reduxjs_toolkit.EnhancedStore<{
|
|
521
|
+
records: RecordsState;
|
|
522
|
+
status: StatusState;
|
|
523
|
+
variables: {
|
|
524
|
+
attributes: {
|
|
525
|
+
[x: string]: any;
|
|
526
|
+
};
|
|
527
|
+
variables: {
|
|
528
|
+
[x: string]: any;
|
|
529
|
+
};
|
|
530
|
+
status: {
|
|
531
|
+
[x: string]: any;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
}, _reduxjs_toolkit.UnknownAction, _reduxjs_toolkit.Tuple<[_reduxjs_toolkit.StoreEnhancer<{
|
|
535
|
+
dispatch: {};
|
|
536
|
+
}>, _reduxjs_toolkit.StoreEnhancer]>>;
|
|
537
|
+
props: any;
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
type AppStore = ReturnType<typeof storeFactory>;
|
|
541
|
+
type AppState = ReturnType<AppStore["getState"]>;
|
|
542
|
+
type AppDispatch = ThunkDispatch<AppState, PublicAPI, Action<string>>;
|
|
543
|
+
type AppThunk<ReturnType = void> = ThunkAction<ReturnType, AppState, PublicAPI, Action<string>>;
|
|
544
|
+
|
|
545
|
+
export { type AppThunk as A, type ProxyRequestParams as P, type RecordsKey as R, type SearchMemberParams as S, type ValidateVariantSlugResponse as V, type ReadMembersResult as a, type RegenerateSearchResponse as b, type ReadMembersParams as c, type ReadMembersResponse as d, type SearchMemberResponse as e, type AppDispatch as f, type AppState as g, type AppStore as h, apiFactory as i, storeWrapper as s, useDatabaseApi as u };
|
|
@@ -844,4 +844,4 @@ interface ReadEnvSecretsResponse {
|
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
846
|
|
|
847
|
-
export { type AnyBlock as A, type
|
|
847
|
+
export { type AnyBlock as A, type SearchContentAttributes as B, type ReportAttributes as C, type DataSource as D, type DimensionAttributes as E, type Formatter as F, type VariantAttributes as G, type InternalReadPrivateBlocksParams as H, ImageModel as I, type CreateMethod as J, type DeleteMethod as K, type ReadMethod as L, type UpdateMethod as M, type NestedDimension as N, type CreateBulkMethod as O, type UpdateBulkMethod as P, type UpdateMemberParams as Q, type Result as R, type SearchUsersParams as S, type UpdateMemberResponse as T, type UpdateUserParams as U, type Variant as V, type AnyNestedBlock as a, type AnyReport as b, type AnyNestedReport as c, type Section as d, type NestedSection as e, type DeleteParams as f, type ReadParams as g, type Dimension as h, type SearchReportParams as i, type SearchReportResponse as j, type ReadMetadataParams as k, type ReadMetadataResponse as l, type UpdateMyDataParams as m, type ReadPrivateBlocksParams as n, type ReadPrivateBlocksResponse as o, type RevalidateUrlRequest as p, type RevalidateUrlResponse as q, type RevalidateReportRequest as r, type RevalidateReportResponse as s, type ReadEnvSecretsResponse as t, type SearchReportItem as u, type ReportsDB as v, SearchContentModel as w, type NormalizedEntityMap as x, type NestedEntityMap as y, type SearchAttributes as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datawheel/bespoke",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "Content management system for creating automated data reports",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -43,8 +43,9 @@
|
|
|
43
43
|
],
|
|
44
44
|
"style": "./dist/index.css",
|
|
45
45
|
"scripts": {
|
|
46
|
-
"prepublishOnly": "tsup",
|
|
47
|
-
"build": "tsup",
|
|
46
|
+
"prepublishOnly": "npm run typecheck && tsup",
|
|
47
|
+
"build": "npm run typecheck && tsup",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
48
49
|
"dev": "tsup --watch",
|
|
49
50
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
50
51
|
"lint": "eslint . --ext .ts,.tsx,.js,.jsx --fix"
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"@d3plus/data": "^3.0.11",
|
|
72
73
|
"@d3plus/dom": "^3.0.11",
|
|
73
74
|
"@d3plus/export": "^3.0.11",
|
|
75
|
+
"@d3plus/math": "^3.0.14",
|
|
74
76
|
"@d3plus/react": "^3.0.11",
|
|
75
77
|
"@d3plus/text": "^3.0.11",
|
|
76
78
|
"@hello-pangea/dnd": "^16.6.0",
|
|
@@ -164,7 +166,8 @@
|
|
|
164
166
|
"react": "^18.3.1",
|
|
165
167
|
"react-dom": "^18.3.1",
|
|
166
168
|
"react-redux": "^8.1.3",
|
|
167
|
-
"tsup": "^8.5.0"
|
|
169
|
+
"tsup": "^8.5.0",
|
|
170
|
+
"typescript": "^5.9.3"
|
|
168
171
|
},
|
|
169
172
|
"peerDependencies": {
|
|
170
173
|
"@mantine/code-highlight": "^8.3.0",
|
|
@@ -190,4 +193,4 @@
|
|
|
190
193
|
"@mantine/dates": "^8.0.0"
|
|
191
194
|
}
|
|
192
195
|
}
|
|
193
|
-
}
|
|
196
|
+
}
|