@websolutespa/bom-core 0.0.1
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/CHANGELOG.md +7 -0
- package/README.md +11 -0
- package/dist/index.d.ts +474 -0
- package/dist/index.js +675 -0
- package/dist/index.mjs +604 -0
- package/package.json +57 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @websolutespa/bom-core
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/%40websolutespa%2Fbom-core)
|
|
4
|
+
|
|
5
|
+
[](https://shields.io/)
|
|
6
|
+
|
|
7
|
+
Core module of the [BOM Repository](https://github.com/websolutespa/bom) by [websolute](https://www.websolute.com/).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
##### *this library is for internal usage and not production ready*
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
2
|
+
import { ParsedUrlQuery } from 'querystring';
|
|
3
|
+
|
|
4
|
+
type ILocalizedString = {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type IEquatable = number | string;
|
|
9
|
+
type SchemaType = string;
|
|
10
|
+
type IOption = Record<string, any> & {
|
|
11
|
+
id: IEquatable;
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
type ISchema = {
|
|
15
|
+
id: IEquatable;
|
|
16
|
+
schema?: string;
|
|
17
|
+
};
|
|
18
|
+
type IEntity = Record<string, unknown> & ISchema;
|
|
19
|
+
type INamedEntity = IEntity & {
|
|
20
|
+
name: string | ILocalizedString;
|
|
21
|
+
};
|
|
22
|
+
type ITitledEntity = IEntity & {
|
|
23
|
+
title: string | ILocalizedString;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type IMediaType = 'image' | 'video' | string;
|
|
27
|
+
type IMedia = {
|
|
28
|
+
src: string;
|
|
29
|
+
type: IMediaType;
|
|
30
|
+
alt?: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
abstract?: string;
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
url?: string;
|
|
36
|
+
media?: IMedia;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type ICategory = IEntity & {
|
|
40
|
+
category?: IEquatable | ICategory;
|
|
41
|
+
id: IEquatable;
|
|
42
|
+
media?: IMedia;
|
|
43
|
+
order?: number;
|
|
44
|
+
slug?: ILocalizedString | string;
|
|
45
|
+
title?: ILocalizedString | string;
|
|
46
|
+
};
|
|
47
|
+
type ICategoryItem = ICategory & {
|
|
48
|
+
items: ICategory[];
|
|
49
|
+
};
|
|
50
|
+
type ICategorized = {
|
|
51
|
+
category: IEquatable | ICategory;
|
|
52
|
+
id: IEquatable;
|
|
53
|
+
isDefault?: boolean;
|
|
54
|
+
markets?: string[];
|
|
55
|
+
media?: IMedia;
|
|
56
|
+
order?: number;
|
|
57
|
+
schema?: string;
|
|
58
|
+
slug?: ILocalizedString | string;
|
|
59
|
+
template?: string;
|
|
60
|
+
title?: ILocalizedString | string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type IClassNameValue = string | boolean | number | null | undefined;
|
|
64
|
+
type IClassNameCollection = Record<string, IClassNameValue>;
|
|
65
|
+
type IClassName = IClassNameCollection | IClassNameValue;
|
|
66
|
+
|
|
67
|
+
type FetchRequestOptions = {
|
|
68
|
+
method?: string;
|
|
69
|
+
headers?: {
|
|
70
|
+
[key: string]: string;
|
|
71
|
+
};
|
|
72
|
+
body?: Blob | BufferSource | FormData | URLSearchParams | string | ReadableStream;
|
|
73
|
+
mode?: 'cors' | 'no-cors' | 'same-origin';
|
|
74
|
+
credentials?: 'omit' | 'same-origin' | 'include';
|
|
75
|
+
cache?: 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached';
|
|
76
|
+
redirect?: 'follow' | 'error' | 'manual';
|
|
77
|
+
referrer?: string;
|
|
78
|
+
referrerPolicy?: 'no-referrer, no-referrer-when-downgrade, same-origin, origin, strict-origin, origin-when-cross-origin, strict-origin-when-cross-origin, or unsafe-url';
|
|
79
|
+
integrity?: string;
|
|
80
|
+
keepalive?: boolean;
|
|
81
|
+
signal?: AbortSignal;
|
|
82
|
+
};
|
|
83
|
+
type FetchService<T = any> = (url: string, options?: FetchRequestOptions, serviceOptions?: any) => Promise<T>;
|
|
84
|
+
|
|
85
|
+
type ILabel = IEntity & {
|
|
86
|
+
id: IEquatable;
|
|
87
|
+
text?: string | ILocalizedString;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
type ILocale = IEntity & {
|
|
91
|
+
id: string;
|
|
92
|
+
title?: string;
|
|
93
|
+
isActive?: boolean;
|
|
94
|
+
isDefault?: boolean;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
type IMarket = IEntity & {
|
|
98
|
+
id: string;
|
|
99
|
+
title?: string;
|
|
100
|
+
isActive?: boolean;
|
|
101
|
+
isDefault?: boolean;
|
|
102
|
+
countries?: string[];
|
|
103
|
+
languages?: string[];
|
|
104
|
+
defaultLanguage?: string;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
type IMeta = {
|
|
108
|
+
title?: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
keywords?: string;
|
|
111
|
+
robots?: string;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
type IRoute = {
|
|
115
|
+
id: string;
|
|
116
|
+
market: string;
|
|
117
|
+
locale: string;
|
|
118
|
+
category: IEquatable | ICategory;
|
|
119
|
+
page: IEquatable;
|
|
120
|
+
schema: string;
|
|
121
|
+
template?: string;
|
|
122
|
+
title: string;
|
|
123
|
+
isDefault?: boolean;
|
|
124
|
+
order?: number;
|
|
125
|
+
};
|
|
126
|
+
type IRouteLink = {
|
|
127
|
+
href: string;
|
|
128
|
+
id: IEquatable;
|
|
129
|
+
items?: IRouteLink[];
|
|
130
|
+
media?: IMedia;
|
|
131
|
+
title: string;
|
|
132
|
+
};
|
|
133
|
+
type IRouteParams = Record<string, any> & {
|
|
134
|
+
id: IEquatable;
|
|
135
|
+
locale: string;
|
|
136
|
+
market: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type IPage = Record<string, any> & ICategorized & {
|
|
140
|
+
slug?: string;
|
|
141
|
+
href: string;
|
|
142
|
+
alternates: IRoute[];
|
|
143
|
+
breadcrumb: IRouteLink[];
|
|
144
|
+
parentRoute?: IRouteLink;
|
|
145
|
+
title?: string;
|
|
146
|
+
abstract?: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
content?: string;
|
|
149
|
+
createdAt?: Date;
|
|
150
|
+
updatedAt?: Date;
|
|
151
|
+
meta?: IMeta;
|
|
152
|
+
};
|
|
153
|
+
type IPageRelation = {
|
|
154
|
+
relationTo: string;
|
|
155
|
+
value: ICategorized;
|
|
156
|
+
};
|
|
157
|
+
type IPageResult<T extends ICategorized = ICategorized> = IPage & T;
|
|
158
|
+
type PageProps<T extends ICategorized = ICategorized> = {
|
|
159
|
+
layout: ILayout;
|
|
160
|
+
page: IPageResult<T>;
|
|
161
|
+
params: IRouteParams;
|
|
162
|
+
locales?: string[];
|
|
163
|
+
locale?: string;
|
|
164
|
+
defaultLocale?: string;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
type IMenuBase = {
|
|
168
|
+
id: IEquatable;
|
|
169
|
+
abstract?: string;
|
|
170
|
+
media?: IMedia;
|
|
171
|
+
items?: IMenuItem[];
|
|
172
|
+
};
|
|
173
|
+
type IMenuCategory = IMenuBase & {
|
|
174
|
+
type: 'category';
|
|
175
|
+
title: string | ILocalizedString;
|
|
176
|
+
href: string;
|
|
177
|
+
category: IEquatable;
|
|
178
|
+
};
|
|
179
|
+
type IMenuGroup = IMenuBase & {
|
|
180
|
+
type: 'group';
|
|
181
|
+
title: string | ILocalizedString;
|
|
182
|
+
};
|
|
183
|
+
type IMenuLink = IMenuBase & {
|
|
184
|
+
type: 'link';
|
|
185
|
+
title: string | ILocalizedString;
|
|
186
|
+
href: string;
|
|
187
|
+
target: string;
|
|
188
|
+
};
|
|
189
|
+
type IMenuRoute = IMenuBase & {
|
|
190
|
+
type: 'route';
|
|
191
|
+
title: string | ILocalizedString;
|
|
192
|
+
href: string;
|
|
193
|
+
page: IEquatable;
|
|
194
|
+
schema: string;
|
|
195
|
+
};
|
|
196
|
+
type IMenuPage = IMenuBase & {
|
|
197
|
+
type: 'page';
|
|
198
|
+
title: string | ILocalizedString;
|
|
199
|
+
href: string;
|
|
200
|
+
page: IEquatable;
|
|
201
|
+
schema: string;
|
|
202
|
+
};
|
|
203
|
+
type IMenuCustom = Record<string, unknown> & {
|
|
204
|
+
id: IEquatable;
|
|
205
|
+
type: string;
|
|
206
|
+
};
|
|
207
|
+
type IMenuItem = IMenuCategory | IMenuGroup | IMenuLink | IMenuPage | IMenuRoute;
|
|
208
|
+
type IMenu = {
|
|
209
|
+
id: string;
|
|
210
|
+
items: IMenuItem[];
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* this is the original menu model from cms
|
|
214
|
+
*/
|
|
215
|
+
type IUndecoratedMenuBase = {
|
|
216
|
+
abstract?: ILocalizedString | string;
|
|
217
|
+
id?: string;
|
|
218
|
+
items: IUndecoratedMenuItem[];
|
|
219
|
+
markets?: string[];
|
|
220
|
+
media?: IMedia;
|
|
221
|
+
type: string;
|
|
222
|
+
};
|
|
223
|
+
type IUndecoratedMenuCategory = Omit<IUndecoratedMenuBase, 'type'> & {
|
|
224
|
+
type: 'category';
|
|
225
|
+
category: string;
|
|
226
|
+
maxDepth?: number;
|
|
227
|
+
title?: ILocalizedString | string;
|
|
228
|
+
};
|
|
229
|
+
type IUndecoratedMenuGroup = Omit<IUndecoratedMenuBase, 'type'> & {
|
|
230
|
+
type: 'group';
|
|
231
|
+
title: ILocalizedString | string;
|
|
232
|
+
};
|
|
233
|
+
type IUndecoratedMenuLink = Omit<IUndecoratedMenuBase, 'type'> & {
|
|
234
|
+
type: 'link';
|
|
235
|
+
title: ILocalizedString | string;
|
|
236
|
+
href: string;
|
|
237
|
+
target?: string;
|
|
238
|
+
};
|
|
239
|
+
type IUndecoratedMenuPage = Omit<IUndecoratedMenuBase, 'type'> & {
|
|
240
|
+
type: 'page';
|
|
241
|
+
page: IPageRelation;
|
|
242
|
+
title?: ILocalizedString | string;
|
|
243
|
+
};
|
|
244
|
+
type IUndecoratedMenuCustom = Record<string, unknown> & {
|
|
245
|
+
id: IEquatable;
|
|
246
|
+
type: 'custom';
|
|
247
|
+
blockType: string;
|
|
248
|
+
};
|
|
249
|
+
type IUndecoratedMenuItem = IUndecoratedMenuCategory | IUndecoratedMenuGroup | IUndecoratedMenuLink | IUndecoratedMenuPage | IUndecoratedMenuCustom;
|
|
250
|
+
type IUndecoratedMenu = {
|
|
251
|
+
id: string;
|
|
252
|
+
items: IUndecoratedMenuItem[];
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
type ILayout = {
|
|
256
|
+
labels: ILabel[];
|
|
257
|
+
locale: string;
|
|
258
|
+
locales: ILocale[];
|
|
259
|
+
market: string;
|
|
260
|
+
markets: IMarket[];
|
|
261
|
+
menu: Record<string, IMenu>;
|
|
262
|
+
topLevelHrefs: Record<string, string>;
|
|
263
|
+
topLevelRoutes: Record<string, IRouteLink>;
|
|
264
|
+
tree?: IRouteLink;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
type Pagination = {
|
|
268
|
+
hasNextPage: boolean;
|
|
269
|
+
hasPrevPage: boolean;
|
|
270
|
+
limit: number;
|
|
271
|
+
nextPage: number | null;
|
|
272
|
+
page: number;
|
|
273
|
+
pagingCounter: number;
|
|
274
|
+
prevPage: number | null;
|
|
275
|
+
totalDocs: number;
|
|
276
|
+
totalPages: number;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
type Operator = 'equals' | 'contains' | 'not_equals' | 'in' | 'not_in' | 'exists' | 'greater_than' | 'greater_than_equal' | 'less_than' | 'less_than_equal' | 'like' | 'near';
|
|
280
|
+
type WhereField = {
|
|
281
|
+
[key in Operator]?: unknown;
|
|
282
|
+
};
|
|
283
|
+
type WhereBase = {
|
|
284
|
+
[key: string]: WhereField | Where[];
|
|
285
|
+
};
|
|
286
|
+
type WhereAndOr = {
|
|
287
|
+
or?: Where[];
|
|
288
|
+
and?: Where[];
|
|
289
|
+
};
|
|
290
|
+
type Where = WhereBase & WhereAndOr;
|
|
291
|
+
type QueryParams = {
|
|
292
|
+
where?: Where;
|
|
293
|
+
locale?: string;
|
|
294
|
+
market?: string;
|
|
295
|
+
sort?: string;
|
|
296
|
+
page?: number;
|
|
297
|
+
limit?: number;
|
|
298
|
+
depth?: number;
|
|
299
|
+
draft?: boolean;
|
|
300
|
+
pagination?: boolean;
|
|
301
|
+
richText?: boolean;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
type IQuerable<T extends IEntity = IEntity> = {
|
|
305
|
+
findOne<B extends T = T>(id: IEquatable, params?: QueryParams): Promise<B | undefined>;
|
|
306
|
+
findMany<B extends T = T>(params?: QueryParams): Promise<B[]>;
|
|
307
|
+
findPaged<B extends T = T>(params?: QueryParams): Promise<{
|
|
308
|
+
docs: B[];
|
|
309
|
+
} & Pagination>;
|
|
310
|
+
create<B extends T = T>(payload: Omit<B, 'id'>): Promise<B>;
|
|
311
|
+
update<B extends T = T>(payload: Partial<B>): Promise<B>;
|
|
312
|
+
delete<B extends T = T>(id: IEquatable): Promise<B | undefined>;
|
|
313
|
+
};
|
|
314
|
+
type FindParams = {
|
|
315
|
+
where?: {
|
|
316
|
+
[key: string]: unknown;
|
|
317
|
+
};
|
|
318
|
+
market?: string;
|
|
319
|
+
locale?: string;
|
|
320
|
+
};
|
|
321
|
+
type FindWhereParams = {
|
|
322
|
+
where: {
|
|
323
|
+
[key: string]: unknown;
|
|
324
|
+
};
|
|
325
|
+
market?: string;
|
|
326
|
+
locale?: string;
|
|
327
|
+
};
|
|
328
|
+
declare function toFindParams(idOrParams: IEquatable | FindWhereParams): FindWhereParams;
|
|
329
|
+
|
|
330
|
+
type IMemoryStore = Record<string, IEntity[]>;
|
|
331
|
+
type IStore = Record<string, IQuerable<IEntity>>;
|
|
332
|
+
type IConfig = {
|
|
333
|
+
collections: string[];
|
|
334
|
+
mocks: string[];
|
|
335
|
+
pages: string[];
|
|
336
|
+
};
|
|
337
|
+
type IPackages = {
|
|
338
|
+
icons: string;
|
|
339
|
+
models: string;
|
|
340
|
+
ui: string;
|
|
341
|
+
};
|
|
342
|
+
type ICollectionDescription = {
|
|
343
|
+
singularName: string;
|
|
344
|
+
pluralName: string;
|
|
345
|
+
pluralDisplayName: string;
|
|
346
|
+
displayName: string;
|
|
347
|
+
title: string;
|
|
348
|
+
};
|
|
349
|
+
type ISerializedCollection = {
|
|
350
|
+
singularName: string;
|
|
351
|
+
pluralName: string;
|
|
352
|
+
pluralDisplayName: string;
|
|
353
|
+
displayName: string;
|
|
354
|
+
items: IEntity[];
|
|
355
|
+
};
|
|
356
|
+
type ISerializedStore = Record<string, ISerializedCollection>;
|
|
357
|
+
|
|
358
|
+
type ITemplate = {
|
|
359
|
+
id: IEquatable;
|
|
360
|
+
name: ILocalizedString | string;
|
|
361
|
+
collections: string[];
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
type Json = string | number | boolean | null | Json[] | {
|
|
365
|
+
[key: string]: Json;
|
|
366
|
+
};
|
|
367
|
+
type ValueOf<T> = T[keyof T];
|
|
368
|
+
type PreviewData = string | false | object | undefined;
|
|
369
|
+
type IContextParams = {
|
|
370
|
+
id: string;
|
|
371
|
+
market: string;
|
|
372
|
+
locale: string;
|
|
373
|
+
};
|
|
374
|
+
type StaticPropsContext<Q extends ParsedUrlQuery = ParsedUrlQuery, D extends PreviewData = PreviewData> = {
|
|
375
|
+
params: Q;
|
|
376
|
+
preview?: boolean;
|
|
377
|
+
previewData?: D;
|
|
378
|
+
locale?: string;
|
|
379
|
+
locales?: string[];
|
|
380
|
+
defaultLocale?: string;
|
|
381
|
+
};
|
|
382
|
+
type IStaticContext = StaticPropsContext<IContextParams>;
|
|
383
|
+
declare type NextApiRequestCookies = Partial<{
|
|
384
|
+
[key: string]: string;
|
|
385
|
+
}>;
|
|
386
|
+
type ServerSidePropsContext<Q extends ParsedUrlQuery = ParsedUrlQuery, D extends PreviewData = PreviewData> = {
|
|
387
|
+
req: IncomingMessage & {
|
|
388
|
+
cookies: NextApiRequestCookies;
|
|
389
|
+
};
|
|
390
|
+
res: ServerResponse;
|
|
391
|
+
params: Q;
|
|
392
|
+
query: ParsedUrlQuery;
|
|
393
|
+
preview?: boolean;
|
|
394
|
+
previewData?: D;
|
|
395
|
+
resolvedUrl: string;
|
|
396
|
+
locale?: string;
|
|
397
|
+
locales?: string[];
|
|
398
|
+
defaultLocale?: string;
|
|
399
|
+
};
|
|
400
|
+
type IServerSideContext = ServerSidePropsContext<IContextParams>;
|
|
401
|
+
type StateValue = StateValue[] | {
|
|
402
|
+
[key: string]: StateValue;
|
|
403
|
+
} | number | string | boolean | null | undefined;
|
|
404
|
+
|
|
405
|
+
declare function getClassNames(...props: Array<IClassName>): string;
|
|
406
|
+
|
|
407
|
+
declare function getCollectionDescription(text: string): ICollectionDescription;
|
|
408
|
+
declare function isValidCollectionDescription(description: ICollectionDescription): boolean;
|
|
409
|
+
declare function toValidCollectionName(text: string): string;
|
|
410
|
+
declare function camelToSnakeCase(text: string): string;
|
|
411
|
+
declare function toDisplayName(text: string): string;
|
|
412
|
+
declare function toPluralName(text: string): string;
|
|
413
|
+
declare function toTitleCase(text: string): string;
|
|
414
|
+
|
|
415
|
+
declare function consoleWarn(message: string, component?: string): void;
|
|
416
|
+
|
|
417
|
+
declare function httpFetch(url: string, options?: FetchRequestOptions, serviceOptions?: any): Promise<any>;
|
|
418
|
+
declare function httpGet(url: string, options?: FetchRequestOptions): Promise<any>;
|
|
419
|
+
declare function httpPost(url: string, payload: any, options?: FetchRequestOptions): Promise<any>;
|
|
420
|
+
declare function httpPut(url: string, payload: any, options?: FetchRequestOptions): Promise<any>;
|
|
421
|
+
declare function httpPatch(url: string, payload: any, options?: FetchRequestOptions): Promise<any>;
|
|
422
|
+
declare function httpDelete(url: string, options?: FetchRequestOptions): Promise<any>;
|
|
423
|
+
|
|
424
|
+
declare class JsonService<T extends IEntity = IEntity> implements IQuerable<T> {
|
|
425
|
+
items: T[];
|
|
426
|
+
constructor(items: T[]);
|
|
427
|
+
getItems<B extends T = T>(): Promise<B[]>;
|
|
428
|
+
findOne<B extends T = T>(id: IEquatable, params?: QueryParams): Promise<B | undefined>;
|
|
429
|
+
findMany<B extends T = T>(params?: QueryParams): Promise<B[]>;
|
|
430
|
+
findPaged<B extends T = T>(params?: QueryParams): Promise<{
|
|
431
|
+
docs: B[];
|
|
432
|
+
} & Pagination>;
|
|
433
|
+
create<B extends T = T>(payload: Omit<B, 'id'>): Promise<B>;
|
|
434
|
+
update<B extends T = T>(payload: Partial<B>): Promise<B>;
|
|
435
|
+
delete<B extends T = T>(id: IEquatable): Promise<B | undefined>;
|
|
436
|
+
protected decorator_<B extends T = T>(item: B, params?: QueryParams): B;
|
|
437
|
+
protected newUUID_(): number;
|
|
438
|
+
protected evaluateValue_(value: unknown): unknown;
|
|
439
|
+
protected existsClause_(value: unknown, exists?: boolean): boolean;
|
|
440
|
+
protected equalsClause_(value: unknown, equals?: unknown): boolean;
|
|
441
|
+
protected inClause_(value: unknown, values?: unknown[]): boolean;
|
|
442
|
+
protected notInClause_(value: unknown, values?: unknown[]): boolean;
|
|
443
|
+
protected likeClause_(value: unknown, query?: string): boolean;
|
|
444
|
+
protected whereItem_<B extends T = T>(item: B, where?: Where): boolean;
|
|
445
|
+
protected whereItems_<B extends T = T>(items: B[], where?: Where): B[];
|
|
446
|
+
protected sortCollection_<B extends T = T>(items: B[], sort?: string): B[];
|
|
447
|
+
protected paginatedItems_<B extends T = T>(items: B[], page?: number, limit?: number): ({
|
|
448
|
+
docs: B[];
|
|
449
|
+
} & Pagination);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare function isLocalizedString(value: any): value is ILocalizedString;
|
|
453
|
+
declare function localizedToString(json: ILocalizedString, locale?: string, defaultLocale?: string): string;
|
|
454
|
+
declare function localizeValue(value: any, locale?: string, defaultLocale?: string): any;
|
|
455
|
+
declare function localizeItem(item: any, locale?: string, defaultLocale?: string): any;
|
|
456
|
+
|
|
457
|
+
declare function qsSerialize(queryParams?: QueryParams): string;
|
|
458
|
+
declare function asEquatable(value: string): IEquatable;
|
|
459
|
+
declare function deserializeValue(value: string): string | boolean | number;
|
|
460
|
+
declare function deserializeKey(value: string): string | number;
|
|
461
|
+
declare function qsDeserialize(query?: string, deserializedParams?: {}): QueryParams;
|
|
462
|
+
|
|
463
|
+
declare function titleToSlug(title: string): string;
|
|
464
|
+
|
|
465
|
+
declare function getIsDevelopment(): boolean;
|
|
466
|
+
declare const isDevelopment: boolean;
|
|
467
|
+
declare const isBrowser: boolean;
|
|
468
|
+
declare function withSchema<Component extends {}, Schema>(component: Component, schema: Schema): Component & Schema;
|
|
469
|
+
declare function asServerProps(props: any): any;
|
|
470
|
+
declare function awaitAll(array: any, callback: (item: any, index: number) => Promise<any>): Promise<any[]>;
|
|
471
|
+
declare function merge(target: any, source: any): any;
|
|
472
|
+
declare function deepCopy<T>(source: T): T;
|
|
473
|
+
|
|
474
|
+
export { FetchRequestOptions, FetchService, FindParams, FindWhereParams, ICategorized, ICategory, ICategoryItem, IClassName, IClassNameCollection, IClassNameValue, ICollectionDescription, IConfig, IContextParams, IEntity, IEquatable, ILabel, ILayout, ILocale, ILocalizedString, IMarket, IMedia, IMediaType, IMemoryStore, IMenu, IMenuBase, IMenuCategory, IMenuCustom, IMenuGroup, IMenuItem, IMenuLink, IMenuPage, IMenuRoute, INamedEntity, IOption, IPackages, IPage, IPageRelation, IPageResult, IQuerable, IRoute, IRouteLink, IRouteParams, ISchema, ISerializedCollection, ISerializedStore, IServerSideContext, IStaticContext, IStore, ITemplate, ITitledEntity, IUndecoratedMenu, IUndecoratedMenuBase, IUndecoratedMenuCategory, IUndecoratedMenuCustom, IUndecoratedMenuGroup, IUndecoratedMenuItem, IUndecoratedMenuLink, IUndecoratedMenuPage, Json, JsonService, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, QueryParams, SchemaType, ServerSidePropsContext, StateValue, StaticPropsContext, ValueOf, Where, WhereAndOr, WhereBase, WhereField, asEquatable, asServerProps, awaitAll, camelToSnakeCase, consoleWarn, deepCopy, deserializeKey, deserializeValue, getClassNames, getCollectionDescription, getIsDevelopment, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isBrowser, isDevelopment, isLocalizedString, isValidCollectionDescription, localizeItem, localizeValue, localizedToString, merge, qsDeserialize, qsSerialize, titleToSlug, toDisplayName, toFindParams, toPluralName, toTitleCase, toValidCollectionName, withSchema };
|