@levo-so/core 0.1.113 → 0.3.7
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/README.md +0 -4
- package/dist/index.d.ts +113 -4
- package/dist/index.js +102 -23
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -256,8 +256,4 @@ const query: LevoQuery.FindQuery = {
|
|
|
256
256
|
|
|
257
257
|
**`getLevoError(error)`** — Normalize any thrown value into a `LevoError`. See [Error Handling](#error-handling).
|
|
258
258
|
|
|
259
|
-
**`formatImagePath(path)`** — URI-encodes the filename portion of a path. Use this when constructing image URLs that may contain spaces or special characters.
|
|
260
|
-
|
|
261
|
-
**`listToColumn(arr)`** — Converts `["name", "email"]` into `{ name: "name", email: "email" }`. Useful for building field selection objects programmatically.
|
|
262
|
-
|
|
263
259
|
**Type utilities** — `Prettify<T>`, `Mandatory<T, K>`, and `DeepPartial<T>` are exported from the package for use in consuming packages that build on top of `@levo-so/core`.
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { QueryStringAddon } from 'wretch/addons/queryString';
|
|
|
2
2
|
import { Wretch } from 'wretch';
|
|
3
3
|
import { WretchOptions } from 'wretch';
|
|
4
4
|
|
|
5
|
+
export declare const allMediaFileExtensions: string[];
|
|
6
|
+
|
|
7
|
+
export declare const allMediaMimetypes: {
|
|
8
|
+
[x: string]: string[];
|
|
9
|
+
};
|
|
10
|
+
|
|
5
11
|
export declare const AnalyticsEvents: {
|
|
6
12
|
"bevy.collection.filled": "bevy.collection.filled";
|
|
7
13
|
"bevy.collection.submitted": "bevy.collection.submitted";
|
|
@@ -34,6 +40,14 @@ export declare const AnalyticsEventsList: readonly ["bevy.collection.filled", "b
|
|
|
34
40
|
|
|
35
41
|
export declare type AnalyticsEventType = (typeof AnalyticsEventsList)[number];
|
|
36
42
|
|
|
43
|
+
export declare const audioFileExtensions: string[];
|
|
44
|
+
|
|
45
|
+
export declare const audioMimetype: {
|
|
46
|
+
"audio/mpeg": string[];
|
|
47
|
+
"audio/ogg": string[];
|
|
48
|
+
"audio/opus": string[];
|
|
49
|
+
};
|
|
50
|
+
|
|
37
51
|
export declare namespace BlogClient {
|
|
38
52
|
export interface CoverImage {
|
|
39
53
|
_id: string;
|
|
@@ -204,6 +218,10 @@ export declare const createLevoClient: (options: ILevoClientOptions) => {
|
|
|
204
218
|
submitDraftEntry: (collection_key: string, data: any) => Promise<IResponseSingle<IDraftEntry>>;
|
|
205
219
|
getFilters: (collectionId: string, options?: WretchOptions) => Promise<IResponseMultiple<ILemaCollection["sections"][number]["fields"][number]>>;
|
|
206
220
|
};
|
|
221
|
+
readonly event: {
|
|
222
|
+
getAllEvents: (series_key: string, data?: import("./types").LevoQuery.FindQuery, options?: import("./types").BlogClient.OptionParams) => Promise<IResponseMultiple<import("./types").LevoEvent.Root>>;
|
|
223
|
+
getSingleEvent: (slug: string, options?: import("./types").BlogClient.OptionParams) => Promise<IResponseSingle<import("./types").LevoEvent.Root>>;
|
|
224
|
+
};
|
|
207
225
|
readonly media: {
|
|
208
226
|
mediaBulkUpload: (formData: FormData, options?: WretchOptions, context?: IMediaUploadContext) => Promise<IResponseMultiple<IMedia>>;
|
|
209
227
|
getAllMedia: (data?: import("./types").LevoQuery.FindQuery) => Promise<IResponseMultiple<IMedia>>;
|
|
@@ -266,6 +284,19 @@ export declare const defaultByKinds: Record<(typeof FieldKindList)[number], any>
|
|
|
266
284
|
*/
|
|
267
285
|
export declare const defineLevoLoggerMiddleware: (name: string, callback: (core: ILevoControl, level: LogLevel, args: any[]) => void) => ILevoLoggerMiddleware;
|
|
268
286
|
|
|
287
|
+
export declare const documentFileExtensions: string[];
|
|
288
|
+
|
|
289
|
+
export declare const documentMimetype: {
|
|
290
|
+
"application/xml": string[];
|
|
291
|
+
"text/plain": string[];
|
|
292
|
+
"application/pdf": string[];
|
|
293
|
+
"application/msword": string[];
|
|
294
|
+
"application/vnd.ms-excel": string[];
|
|
295
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": string[];
|
|
296
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": string[];
|
|
297
|
+
"text/csv": string[];
|
|
298
|
+
};
|
|
299
|
+
|
|
269
300
|
export declare type FieldFilter<T extends string = string> = Partial<Record<T, ComparableFilter<T> | FieldType>>;
|
|
270
301
|
|
|
271
302
|
export declare const FieldInterfaces: Record<"TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget" | "CollectionWidget" | "ArrayWidget" | "RecordWidget" | "JSONWidget" | "SlugWidget", "TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget" | "CollectionWidget" | "ArrayWidget" | "RecordWidget" | "JSONWidget" | "SlugWidget">;
|
|
@@ -303,8 +334,6 @@ export declare type FieldType = string | number | Date | boolean | null;
|
|
|
303
334
|
|
|
304
335
|
export declare type Filter<T extends string = string> = LogicalFilter<T> | FieldFilter<T>;
|
|
305
336
|
|
|
306
|
-
export declare const formatImagePath: (string: string) => string;
|
|
307
|
-
|
|
308
337
|
export declare const formatsByInterface: Record<(typeof FieldInterfacesList)[number], string[]>;
|
|
309
338
|
|
|
310
339
|
export declare const FORUM_POST_KIND: {
|
|
@@ -759,6 +788,8 @@ export declare interface IField {
|
|
|
759
788
|
hidden?: boolean;
|
|
760
789
|
/** Whether the field is editable. */
|
|
761
790
|
editable?: boolean;
|
|
791
|
+
/** Rank of the field within its section. Defaults to 0 server-side when omitted. */
|
|
792
|
+
sort_order?: number;
|
|
762
793
|
/** Whether the field is required. */
|
|
763
794
|
required?: boolean;
|
|
764
795
|
/** Whether the field value must be unique. */
|
|
@@ -1412,6 +1443,19 @@ export declare interface ILogicRule {
|
|
|
1412
1443
|
when: LogicWhen;
|
|
1413
1444
|
}
|
|
1414
1445
|
|
|
1446
|
+
export declare const imageFileExtensions: string[];
|
|
1447
|
+
|
|
1448
|
+
export declare const imageMimetype: {
|
|
1449
|
+
"image/jpeg": string[];
|
|
1450
|
+
"image/jpg": string[];
|
|
1451
|
+
"image/png": string[];
|
|
1452
|
+
"image/gif": string[];
|
|
1453
|
+
"image/svg": string[];
|
|
1454
|
+
"image/svg+xml": string[];
|
|
1455
|
+
"image/webp": string[];
|
|
1456
|
+
"image/avif": string[];
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1415
1459
|
export declare interface IMe {
|
|
1416
1460
|
_id: string;
|
|
1417
1461
|
public_id: string;
|
|
@@ -1467,6 +1511,33 @@ export declare type IMediaObject = Pick<IMedia, "id" | "location" | "srcset" | "
|
|
|
1467
1511
|
mimetype?: IMedia["metadata"]["mimetype"];
|
|
1468
1512
|
};
|
|
1469
1513
|
|
|
1514
|
+
/**
|
|
1515
|
+
* Live storage-usage aggregate for a workspace, from `GET /v1/assets/media/storage`.
|
|
1516
|
+
* Computed fresh from the `media_storage` table on every call (not the cached, drifting
|
|
1517
|
+
* `assets.media_size` counter). Root figures plus a per-`kind` breakdown.
|
|
1518
|
+
*/
|
|
1519
|
+
export declare interface IMediaStorage extends IMediaStorageMetrics {
|
|
1520
|
+
workspace_id: string;
|
|
1521
|
+
/**
|
|
1522
|
+
* Per-media-type breakdown. All five keys are always present, zero-filled when empty,
|
|
1523
|
+
* and the buckets sum exactly to the root totals.
|
|
1524
|
+
*/
|
|
1525
|
+
kind: Record<IMediaStorageKind, IMediaStorageMetrics>;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
/** Media types the storage endpoint groups by. `unknown` = orphaned/blank-kind rows. */
|
|
1529
|
+
export declare type IMediaStorageKind = "image" | "video" | "audio" | "document" | "unknown";
|
|
1530
|
+
|
|
1531
|
+
/** The three storage figures, at the root and inside each `kind` bucket. Sizes are raw bytes. */
|
|
1532
|
+
export declare interface IMediaStorageMetrics {
|
|
1533
|
+
/** File count — every stored file, incl. resize variants (images only). Not a size. */
|
|
1534
|
+
total_files: number;
|
|
1535
|
+
/** `SUM(size_in_bytes)` in raw bytes. */
|
|
1536
|
+
total_size: number;
|
|
1537
|
+
/** Mean bytes per file, rounded to a whole byte. */
|
|
1538
|
+
average_size: number;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1470
1541
|
/** Source context attached to a media upload so the backend can record where the file originated. */
|
|
1471
1542
|
export declare interface IMediaUploadContext {
|
|
1472
1543
|
/** The product module the upload belongs to (e.g. "community", "blog"). */
|
|
@@ -1868,6 +1939,14 @@ export declare interface IWorkspace {
|
|
|
1868
1939
|
};
|
|
1869
1940
|
/** Whether user has an existing website or is creating new */
|
|
1870
1941
|
website_status?: "existing" | "new";
|
|
1942
|
+
/** Presence of this is what makes the API stamp `onboarded_at`. */
|
|
1943
|
+
site_type?: IWorkspaceSiteType;
|
|
1944
|
+
role?: IWorkspaceRole;
|
|
1945
|
+
org_size?: IWorkspaceOrgSize;
|
|
1946
|
+
website?: string;
|
|
1947
|
+
brand?: IWorkspaceBrandInfo;
|
|
1948
|
+
/** Extracted business-description document, attached after the workspace exists. */
|
|
1949
|
+
description_document_id?: string;
|
|
1871
1950
|
};
|
|
1872
1951
|
settings: {
|
|
1873
1952
|
head_code?: string;
|
|
@@ -1883,6 +1962,26 @@ export declare interface IWorkspace {
|
|
|
1883
1962
|
subscription: ISubscription | null;
|
|
1884
1963
|
}
|
|
1885
1964
|
|
|
1965
|
+
/** Brand identity scraped from the user's live site at signup. */
|
|
1966
|
+
export declare interface IWorkspaceBrandInfo {
|
|
1967
|
+
name?: string | null;
|
|
1968
|
+
description?: string | null;
|
|
1969
|
+
category?: string | null;
|
|
1970
|
+
logo_url?: string | null;
|
|
1971
|
+
favicon_url?: string | null;
|
|
1972
|
+
colors?: string[];
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
export declare type IWorkspaceOrgSize = "just-me" | "2-10" | "11-50" | "51-500" | "501-5000" | "5001+";
|
|
1976
|
+
|
|
1977
|
+
export declare type IWorkspaceRole = "founder" | "marketing" | "sales" | "designer" | "content" | "engineering" | "agency" | "other";
|
|
1978
|
+
|
|
1979
|
+
/**
|
|
1980
|
+
* v3 PLG onboarding (`/welcome`) segmentation. The API validates these members —
|
|
1981
|
+
* see issue #4521 — so they are unions, not free-form strings.
|
|
1982
|
+
*/
|
|
1983
|
+
export declare type IWorkspaceSiteType = "b2b-saas" | "manufacturer" | "service" | "dealer-portal" | "membership" | "other";
|
|
1984
|
+
|
|
1886
1985
|
declare type JSONContent = {
|
|
1887
1986
|
type?: string;
|
|
1888
1987
|
attrs?: Record<string, any>;
|
|
@@ -2225,8 +2324,6 @@ export declare namespace LevoQuery {
|
|
|
2225
2324
|
}>;
|
|
2226
2325
|
}
|
|
2227
2326
|
|
|
2228
|
-
export declare const listToColumn: <T extends string>(columns: readonly string[]) => Record<T, string>;
|
|
2229
|
-
|
|
2230
2327
|
export declare const listToRecord: <T extends string>(columns: readonly string[]) => { [K in T]: K; };
|
|
2231
2328
|
|
|
2232
2329
|
export declare type LogicAction = "show" | "hide";
|
|
@@ -2284,10 +2381,14 @@ export declare enum LogLevel {
|
|
|
2284
2381
|
|
|
2285
2382
|
export declare type Mandatory<T, K extends keyof T> = Prettify<Pick<T, K> & Partial<Omit<T, K>>>;
|
|
2286
2383
|
|
|
2384
|
+
export declare const mediaExtensionsByKind: Record<(typeof MediaKindList)[number], string[]>;
|
|
2385
|
+
|
|
2287
2386
|
export declare const MediaKind: Record<"image" | "video" | "audio" | "document", "image" | "video" | "audio" | "document">;
|
|
2288
2387
|
|
|
2289
2388
|
export declare const MediaKindList: readonly ["image", "video", "audio", "document"];
|
|
2290
2389
|
|
|
2390
|
+
export declare const mediaMimetypeByKind: Record<(typeof MediaKindList)[number], Record<string, string[]>>;
|
|
2391
|
+
|
|
2291
2392
|
/** Reject types assignable to Error — forces `{ exception }` wrapping at the call site. */
|
|
2292
2393
|
declare type NotError<T> = T extends Error ? never : T;
|
|
2293
2394
|
|
|
@@ -2305,6 +2406,14 @@ export declare type Prettify<T> = {
|
|
|
2305
2406
|
*/
|
|
2306
2407
|
export declare const remoteLoggerMiddleware: (options: IRemoteLoggerMiddlewareOptions) => ILevoLoggerMiddleware;
|
|
2307
2408
|
|
|
2409
|
+
export declare const videoFileExtensions: string[];
|
|
2410
|
+
|
|
2411
|
+
export declare const videoMimetype: {
|
|
2412
|
+
"video/mp4": string[];
|
|
2413
|
+
"video/mpeg": string[];
|
|
2414
|
+
"video/webm": string[];
|
|
2415
|
+
};
|
|
2416
|
+
|
|
2308
2417
|
export declare type WithinFilterType = {
|
|
2309
2418
|
latitude: number;
|
|
2310
2419
|
longitude: number;
|
package/dist/index.js
CHANGED
|
@@ -296,21 +296,28 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
296
296
|
getFilters: async (e, n = {}) => t.instance.url(`/v1/bevy/collection/${e}/get-filters`).options(n).get().json().then((e) => e).catch((e) => {
|
|
297
297
|
throw g(e);
|
|
298
298
|
})
|
|
299
|
-
}), y =
|
|
299
|
+
}), y = (e, t) => ({
|
|
300
|
+
getAllEvents: async (e, n = {}, r) => t.instance.url(`/v1/event/event/${e}/event/query`).query({ ...r?.params || {} }).options({ headers: { "Levo-Workspace": r?.workspace_id || void 0 } }).post(n).json().then((e) => e).catch((e) => {
|
|
301
|
+
throw g(e);
|
|
302
|
+
}),
|
|
303
|
+
getSingleEvent: async (e, n) => t.instance.url(`/v1/event/event/${e}/get-single-event`).query({ ...n?.params || {} }).options({ headers: { "Levo-Workspace": n?.workspace_id || void 0 } }).get().json().then((e) => e).catch((e) => {
|
|
304
|
+
throw g(e);
|
|
305
|
+
})
|
|
306
|
+
}), b = 600 * 1e3, x = (e, t) => ({
|
|
300
307
|
mediaBulkUpload: async (e, n = {}, r) => {
|
|
301
308
|
let i = { ...n };
|
|
302
|
-
return delete i.signal, t.getInstance(
|
|
309
|
+
return delete i.signal, t.getInstance(b).url("/v1/assets/media/bulk").query(r ?? {}).options(i).post(e).json().then((e) => e).catch((e) => {
|
|
303
310
|
throw g(e);
|
|
304
311
|
});
|
|
305
312
|
},
|
|
306
313
|
getAllMedia: async (e = {}) => t.instance.url("/v1/assets/media/query").post(e).json().then((e) => e).catch((e) => {
|
|
307
314
|
throw g(e);
|
|
308
315
|
})
|
|
309
|
-
}),
|
|
316
|
+
}), S = [
|
|
310
317
|
"google",
|
|
311
318
|
"linkedin",
|
|
312
319
|
"microsoft"
|
|
313
|
-
],
|
|
320
|
+
], C = (e, t) => {
|
|
314
321
|
let n = async (n = {}) => t.instance.url("/v1/membership/auth/oauth/get-redirect-url").options(n).get().json().then((n) => {
|
|
315
322
|
let r = n?.content?.data, i = Object.keys(r);
|
|
316
323
|
if (typeof window < "u") for (let n of i) {
|
|
@@ -321,7 +328,7 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
321
328
|
}
|
|
322
329
|
}
|
|
323
330
|
return r;
|
|
324
|
-
}).catch(() =>
|
|
331
|
+
}).catch(() => S.reduce((e, t) => (e[t] = null, e), {})), r = async (e = {}) => t.instance.url("/v1/membership/auth/sign-out").options(e).post("").json().then((e) => e?.content?.data).catch((e) => {
|
|
325
332
|
throw g(e);
|
|
326
333
|
}), i = async (e = {}) => t.instance.url("/v1/membership/auth/get-me").options(e).get().json().then((e) => e?.content?.data).catch((e) => {
|
|
327
334
|
throw g(e);
|
|
@@ -353,12 +360,12 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
353
360
|
throw g(e);
|
|
354
361
|
})
|
|
355
362
|
};
|
|
356
|
-
},
|
|
363
|
+
}, w = (e) => {
|
|
357
364
|
let { pageContext: t = {
|
|
358
365
|
url: typeof window < "u" ? window?.location?.href : "",
|
|
359
366
|
referrer: typeof document < "u" ? document?.referrer : "",
|
|
360
367
|
title: typeof document < "u" ? document?.title : ""
|
|
361
|
-
}, loggerOptions: n = {}, ...r } = e, a = t, s = i(r), c = o(s, a), l = _(s, c), u =
|
|
368
|
+
}, loggerOptions: n = {}, ...r } = e, a = t, s = i(r), c = o(s, a), l = _(s, c), u = C(s, c), d = v(s, c), f = y(s, c), m = x(s, c), h = p(s, n);
|
|
362
369
|
return {
|
|
363
370
|
get apiUrl() {
|
|
364
371
|
return s.apiUrl;
|
|
@@ -375,12 +382,15 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
375
382
|
get collection() {
|
|
376
383
|
return d;
|
|
377
384
|
},
|
|
378
|
-
get
|
|
385
|
+
get event() {
|
|
379
386
|
return f;
|
|
380
387
|
},
|
|
381
|
-
get
|
|
388
|
+
get media() {
|
|
382
389
|
return m;
|
|
383
390
|
},
|
|
391
|
+
get logger() {
|
|
392
|
+
return h;
|
|
393
|
+
},
|
|
384
394
|
get fetch() {
|
|
385
395
|
return c.instance;
|
|
386
396
|
},
|
|
@@ -400,7 +410,7 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
400
410
|
s.workspace = e;
|
|
401
411
|
}
|
|
402
412
|
};
|
|
403
|
-
},
|
|
413
|
+
}, ee = {
|
|
404
414
|
"public-id": "",
|
|
405
415
|
string: "",
|
|
406
416
|
number: null,
|
|
@@ -563,11 +573,87 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
563
573
|
CollectionWidget: M.collection,
|
|
564
574
|
JSONWidget: M.json
|
|
565
575
|
}, P = [
|
|
576
|
+
"pdf",
|
|
577
|
+
"txt",
|
|
578
|
+
"xml",
|
|
579
|
+
"xls",
|
|
580
|
+
"xlsx",
|
|
581
|
+
"ods",
|
|
582
|
+
"odt",
|
|
583
|
+
"doc",
|
|
584
|
+
"docx",
|
|
585
|
+
"csv",
|
|
586
|
+
"odp",
|
|
587
|
+
"ppt",
|
|
588
|
+
"pptx"
|
|
589
|
+
], F = [
|
|
590
|
+
"svg",
|
|
591
|
+
"png",
|
|
592
|
+
"jpg",
|
|
593
|
+
"jpeg",
|
|
594
|
+
"gif",
|
|
595
|
+
"webp",
|
|
596
|
+
"avif"
|
|
597
|
+
], I = [
|
|
598
|
+
"mp4",
|
|
599
|
+
"ogv",
|
|
600
|
+
"webm"
|
|
601
|
+
], L = [
|
|
602
|
+
"mp3",
|
|
603
|
+
"ogg",
|
|
604
|
+
"opus"
|
|
605
|
+
], R = {
|
|
606
|
+
"application/xml": [".xml"],
|
|
607
|
+
"text/plain": [".txt"],
|
|
608
|
+
"application/pdf": [".pdf"],
|
|
609
|
+
"application/msword": [".doc"],
|
|
610
|
+
"application/vnd.ms-excel": [".xls"],
|
|
611
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
612
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
|
|
613
|
+
"text/csv": [".csv"]
|
|
614
|
+
}, z = {
|
|
615
|
+
"image/jpeg": [".jpeg", ".jpg"],
|
|
616
|
+
"image/jpg": [".jpg"],
|
|
617
|
+
"image/png": [".png"],
|
|
618
|
+
"image/gif": [".gif"],
|
|
619
|
+
"image/svg": [".svg"],
|
|
620
|
+
"image/svg+xml": [".svg"],
|
|
621
|
+
"image/webp": [".webp"],
|
|
622
|
+
"image/avif": [".avif"]
|
|
623
|
+
}, B = {
|
|
624
|
+
"video/mp4": [".mp4"],
|
|
625
|
+
"video/mpeg": [".mpeg"],
|
|
626
|
+
"video/webm": [".webm"]
|
|
627
|
+
}, V = {
|
|
628
|
+
"audio/mpeg": [".mp3"],
|
|
629
|
+
"audio/ogg": [".oga"],
|
|
630
|
+
"audio/opus": [".opus"]
|
|
631
|
+
}, H = {
|
|
632
|
+
audio: V,
|
|
633
|
+
document: R,
|
|
634
|
+
image: z,
|
|
635
|
+
video: B
|
|
636
|
+
}, U = {
|
|
637
|
+
audio: L,
|
|
638
|
+
document: P,
|
|
639
|
+
image: F,
|
|
640
|
+
video: I
|
|
641
|
+
}, W = [
|
|
642
|
+
...U.audio,
|
|
643
|
+
...U.document,
|
|
644
|
+
...U.image,
|
|
645
|
+
...U.video
|
|
646
|
+
], G = {
|
|
647
|
+
...H.audio,
|
|
648
|
+
...H.document,
|
|
649
|
+
...H.image,
|
|
650
|
+
...H.video
|
|
651
|
+
}, K = [
|
|
566
652
|
"image",
|
|
567
653
|
"video",
|
|
568
654
|
"audio",
|
|
569
655
|
"document"
|
|
570
|
-
],
|
|
656
|
+
], q = K.reduce((e, t) => (e[t] = t, e), {}), J = (e) => e.reduce((e, t) => (e[t] = t, e), {}), Y = [
|
|
571
657
|
"bevy.collection.filled",
|
|
572
658
|
"bevy.collection.submitted",
|
|
573
659
|
"bevy.collection.view",
|
|
@@ -593,7 +679,7 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
593
679
|
"page.selection",
|
|
594
680
|
"user.active",
|
|
595
681
|
"user.idle"
|
|
596
|
-
],
|
|
682
|
+
], X = J(Y), Z = (e) => e.module_name ? "module" : e.allow_public_submit && !e.public_submit_set_by ? "form" : "collection", Q = {
|
|
597
683
|
string: [
|
|
598
684
|
"equals",
|
|
599
685
|
"not",
|
|
@@ -660,31 +746,24 @@ var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
|
660
746
|
identifier: ["equals", "not"],
|
|
661
747
|
record: [],
|
|
662
748
|
group: []
|
|
663
|
-
},
|
|
749
|
+
}, te = {
|
|
664
750
|
published: "published",
|
|
665
751
|
unpublished: "unpublished",
|
|
666
752
|
archived: "archived",
|
|
667
753
|
flagged: "flagged",
|
|
668
754
|
pending_moderation: "pending_moderation"
|
|
669
|
-
},
|
|
755
|
+
}, $ = {
|
|
670
756
|
post: "post",
|
|
671
757
|
poll: "poll",
|
|
672
758
|
gallery: "gallery",
|
|
673
759
|
link: "link"
|
|
674
|
-
},
|
|
760
|
+
}, ne = Object.keys($), re = {
|
|
675
761
|
draft: "draft",
|
|
676
762
|
published: "published",
|
|
677
763
|
unpublished: "unpublished",
|
|
678
764
|
archived: "archived",
|
|
679
765
|
flagged: "flagged",
|
|
680
766
|
pending_moderation: "pending_moderation"
|
|
681
|
-
}, K = (e) => {
|
|
682
|
-
let t = e.split("/"), n = t[t.length - 1];
|
|
683
|
-
if (n) {
|
|
684
|
-
let t = encodeURIComponent(n);
|
|
685
|
-
return e.replace(n, t);
|
|
686
|
-
}
|
|
687
|
-
return "";
|
|
688
767
|
};
|
|
689
768
|
//#endregion
|
|
690
|
-
export {
|
|
769
|
+
export { X as AnalyticsEvents, Y as AnalyticsEventsList, te as COMMENT_STATUS, k as CommonFieldIntefaces, E as CommonFieldInterfacesList, D as ComplexFieldInterfacesList, $ as FORUM_POST_KIND, re as FORUM_POST_STATUS, A as FieldInterfaces, O as FieldInterfacesList, M as FieldKind, j as FieldKindList, ne as ForumPostKindExpandedList, m as LevoError, S as LevoOAuthProviderList, d as LogLevel, q as MediaKind, K as MediaKindList, W as allMediaFileExtensions, G as allMediaMimetypes, L as audioFileExtensions, V as audioMimetype, w as createLevoClient, p as createLevoLogger, ee as defaultByKinds, f as defineLevoLoggerMiddleware, P as documentFileExtensions, R as documentMimetype, T as formatsByInterface, Z as getCollectionKind, g as getLevoError, F as imageFileExtensions, z as imageMimetype, N as interfaceKinds, J as listToRecord, U as mediaExtensionsByKind, H as mediaMimetypeByKind, Q as operatorsByKind, u as remoteLoggerMiddleware, I as videoFileExtensions, B as videoMimetype };
|
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/core",
|
|
3
3
|
"description": "Levo common utilities",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.7",
|
|
5
5
|
"author": "Levo Engineering <devs@theinternetfolks.com>",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"lodash-es": "4.18.1",
|
|
8
7
|
"wretch": "2.9.0"
|
|
9
8
|
},
|
|
10
9
|
"devDependencies": {
|
|
11
|
-
"@types/lodash-es": "4.17.12",
|
|
12
10
|
"typescript": "5.9.3",
|
|
13
11
|
"vite": "8.0.8",
|
|
14
12
|
"vite-plugin-dts": "4.5.4",
|