@levo-so/core 0.1.34 → 0.1.36
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/client.d.ts +72 -0
- package/dist/constants/media.d.ts +1 -1
- package/dist/control/audience.d.ts +13 -0
- package/dist/control/audience.d.ts.map +1 -0
- package/dist/control/index.d.ts +23 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/httpClient.d.ts +13 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1124 -70
- package/dist/logger/batch.d.ts +3 -10
- package/dist/logger/batch.d.ts.map +1 -1
- package/dist/logger/index.d.ts +22 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/modules/blog.d.ts +10 -0
- package/dist/modules/blog.d.ts.map +1 -0
- package/dist/modules/collection.d.ts +25 -0
- package/dist/modules/collection.d.ts.map +1 -0
- package/dist/{plugins/LevoMedia.d.ts → modules/media.d.ts} +6 -4
- package/dist/modules/media.d.ts.map +1 -0
- package/dist/modules/membership.d.ts +21 -0
- package/dist/modules/membership.d.ts.map +1 -0
- package/package.json +3 -1
- package/dist/LevoClient.d.ts +0 -38
- package/dist/chunk-QJSKNLTV.js +0 -9
- package/dist/chunk-VQMSBMEM.js +0 -40
- package/dist/chunk-ZLLCLSGE.js +0 -8
- package/dist/plugins/LevoAudience.d.ts +0 -32
- package/dist/plugins/LevoAudience.d.ts.map +0 -1
- package/dist/plugins/LevoAudience.js +0 -589
- package/dist/plugins/LevoBlog.d.ts +0 -8
- package/dist/plugins/LevoBlog.d.ts.map +0 -1
- package/dist/plugins/LevoBlog.js +0 -21
- package/dist/plugins/LevoCollection.d.ts +0 -23
- package/dist/plugins/LevoCollection.d.ts.map +0 -1
- package/dist/plugins/LevoCollection.js +0 -47
- package/dist/plugins/LevoLogger.d.ts +0 -32
- package/dist/plugins/LevoLogger.d.ts.map +0 -1
- package/dist/plugins/LevoLogger.js +0 -193
- package/dist/plugins/LevoMedia.d.ts.map +0 -1
- package/dist/plugins/LevoMedia.js +0 -13
- package/dist/plugins/LevoMembership.d.ts +0 -38
- package/dist/plugins/LevoMembership.d.ts.map +0 -1
- package/dist/plugins/LevoMembership.js +0 -104
- package/dist/plugins/LevoPlugin.d.ts +0 -6
- package/dist/plugins/LevoPlugin.d.ts.map +0 -1
- package/dist/plugins/LevoPlugin.js +0 -1
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ICoreOptions } from "./control";
|
|
2
|
+
import { IPageContext } from "./httpClient";
|
|
3
|
+
import { ILoggerOptions } from "./logger";
|
|
4
|
+
export interface ILevoClientOptions extends ICoreOptions {
|
|
5
|
+
pageContext?: IPageContext | null;
|
|
6
|
+
loggerOptions?: ILoggerOptions;
|
|
7
|
+
}
|
|
8
|
+
export declare const createLevoClient: (options: ILevoClientOptions) => {
|
|
9
|
+
readonly apiUrl: string;
|
|
10
|
+
readonly insightsUrl: string;
|
|
11
|
+
readonly workspace: `W${string}` | null;
|
|
12
|
+
readonly audience: {
|
|
13
|
+
readonly instance: import("analytics").AnalyticsInstance | null;
|
|
14
|
+
initiate: (properties: import("./types").ILevoAudience.Properties) => Promise<any>;
|
|
15
|
+
identify: () => Promise<void>;
|
|
16
|
+
track: <T extends import("./types").ILevoAudience.Properties>(event: string, properties: T & import("./types").ILevoAudience.Properties) => Promise<any>;
|
|
17
|
+
bounce: (properties: import("./types").ILevoAudience.Properties) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
readonly blog: {
|
|
20
|
+
getAllBlogs: (blog_key: string, data?: import("./types").LevoQuery.FindQuery, options?: import("./types").BlogClient.OptionParams) => Promise<import("./types").IResponseMultiple<import("./types").IPost>>;
|
|
21
|
+
getSingleBlog: (blog_key: string, slug: string, options?: import("./types").BlogClient.OptionParams) => Promise<import("./types").IResponseSingle<import("./types").IPost, any>>;
|
|
22
|
+
};
|
|
23
|
+
readonly membership: {
|
|
24
|
+
getOAuthURL: (options?: import("wretch").WretchOptions) => Promise<import("./types").ILevoMembership.OAuthURLList>;
|
|
25
|
+
signOut: <T = {
|
|
26
|
+
status: boolean;
|
|
27
|
+
}>(options?: import("wretch").WretchOptions) => Promise<T>;
|
|
28
|
+
getMe: <T = import("./types").ILevoMembership.Account>(options?: import("wretch").WretchOptions) => Promise<T>;
|
|
29
|
+
updateMe: <T = import("./types").ILevoMembership.Account, D = Partial<Pick<import("./types").ILevoMembership.Account, "first_name" | "last_name" | "username" | "profile_picture">>>(data: D, options?: import("wretch").WretchOptions) => Promise<T>;
|
|
30
|
+
createPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.CreatePassword, options?: import("wretch").WretchOptions) => Promise<T>;
|
|
31
|
+
isLoggedIn: <T = import("./types").ILevoMembership.Account>(options?: import("wretch").WretchOptions) => Promise<T | null>;
|
|
32
|
+
requestMagicLink: (data: import("./types").ILevoMembership.Request.RequestMagicLink, options?: import("wretch").WretchOptions) => Promise<Pick<import("./types").ILevoMembership.Otp, "_id" | "content">>;
|
|
33
|
+
requestOtp: (data: import("./types").ILevoMembership.Request.RequestOtp, options?: import("wretch").WretchOptions) => Promise<Pick<import("./types").ILevoMembership.Otp, "_id" | "content">>;
|
|
34
|
+
signInWithOtp: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignInWithOtp, options?: import("wretch").WretchOptions) => Promise<T | null>;
|
|
35
|
+
signInWithPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignInWithPassword, options?: import("wretch").WretchOptions) => Promise<T | null>;
|
|
36
|
+
signUpWithPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignUpWithPassword, options?: import("wretch").WretchOptions) => Promise<T | null>;
|
|
37
|
+
};
|
|
38
|
+
readonly collection: {
|
|
39
|
+
getAllCollections: (data?: import("./types").LevoQuery.FindQuery<"id" | "workspace_id" | "description" | "created_at" | "updated_at" | "key" | "readonly" | "hidden" | "icon" | "name" | "sections" | "views" | "title_field" | "settings" | "module_name" | "on_submit" | "on_update" | "allow_draft">, options?: import("wretch").WretchOptions) => Promise<import("./types").IResponseMultiple<import("./types").ILemaCollection>>;
|
|
40
|
+
getCollectionByIDExpanded: <T = import("./types").ILemaCollection>(id: string, options?: import("wretch").WretchOptions) => Promise<import("./types").IResponseSingle<T, any>>;
|
|
41
|
+
createCollection: (data: import("./types").ILemaCollection) => Promise<import("./types").IResponseSingle<import("./types").ILemaCollection, any>>;
|
|
42
|
+
saveCollectionData: ({ collection_id, data, options, }: {
|
|
43
|
+
collection_id: string;
|
|
44
|
+
data: any;
|
|
45
|
+
options?: import("wretch").WretchOptions;
|
|
46
|
+
}) => Promise<import("./types").IResponseSingle<any, any>>;
|
|
47
|
+
getCollectionContentList: ({ collection_key, page, search, limit, where, }: {
|
|
48
|
+
collection_key: string;
|
|
49
|
+
} & import("./types").LevoQuery.FindQuery) => Promise<import("./types").IResponseMultiple<Record<string, unknown>>>;
|
|
50
|
+
saveDraftEntry: (collection_key: string, data: any) => Promise<import("./types").IResponseSingle<import("./types").IDraftEntry, any>>;
|
|
51
|
+
getDraftEntry: (collection_key: string) => Promise<import("./types").IResponseSingle<import("./types").IDraftEntry, any>>;
|
|
52
|
+
submitDraftEntry: (collection_key: string, data: any) => Promise<import("./types").IResponseSingle<import("./types").IDraftEntry, any>>;
|
|
53
|
+
};
|
|
54
|
+
readonly media: {
|
|
55
|
+
mediaBulkUpload: (formData: FormData, options?: import("wretch").WretchOptions) => Promise<import("./types").IResponseMultiple<import("./types").IMedia>>;
|
|
56
|
+
getAllMedia: (data?: import("./types").LevoQuery.FindQuery) => Promise<import("./types").IResponseMultiple<import("./types").IMedia>>;
|
|
57
|
+
};
|
|
58
|
+
readonly logger: {
|
|
59
|
+
debug: (...args: any[]) => void;
|
|
60
|
+
info: (...args: any[]) => void;
|
|
61
|
+
warn: (...args: any[]) => void;
|
|
62
|
+
error: (...args: any[]) => void;
|
|
63
|
+
};
|
|
64
|
+
readonly fetch: import("wretch/addons/queryString").QueryStringAddon & import("wretch").Wretch<import("wretch/addons/queryString").QueryStringAddon, unknown, undefined>;
|
|
65
|
+
readonly APP_MODE: string;
|
|
66
|
+
readonly pageContext: IPageContext | null;
|
|
67
|
+
updatePageContext: (newContext: IPageContext | null) => void;
|
|
68
|
+
updateWorkspace: (workspace: string | null) => void;
|
|
69
|
+
};
|
|
70
|
+
export type ILevoClient = ReturnType<typeof createLevoClient>;
|
|
71
|
+
export { type WorkspaceID } from "./control";
|
|
72
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const MediaKindList: readonly ["image", "video", "audio", "document"];
|
|
2
|
-
export declare const MediaKind: Record<"
|
|
2
|
+
export declare const MediaKind: Record<"audio" | "video" | "image" | "document", "audio" | "video" | "image" | "document">;
|
|
3
3
|
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AnalyticsInstance } from "analytics";
|
|
2
|
+
import type { ILevoAudience } from "../types/audience";
|
|
3
|
+
import { IHttpClient } from "../httpClient";
|
|
4
|
+
import { ILevoControl } from ".";
|
|
5
|
+
export declare const createLevoAudienceModule: (core: ILevoControl, httpClient: IHttpClient) => {
|
|
6
|
+
readonly instance: AnalyticsInstance | null;
|
|
7
|
+
initiate: (properties: ILevoAudience.Properties) => Promise<any>;
|
|
8
|
+
identify: () => Promise<void>;
|
|
9
|
+
track: <T extends ILevoAudience.Properties>(event: string, properties: T & ILevoAudience.Properties) => Promise<any>;
|
|
10
|
+
bounce: (properties: ILevoAudience.Properties) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export type ILevoAudienceModule = ReturnType<typeof createLevoAudienceModule>;
|
|
13
|
+
//# sourceMappingURL=audience.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../../src/control/audience.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAM9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEjC,eAAO,MAAM,wBAAwB,SAC7B,YAAY,cACN,WAAW;;2BA4Ka,aAAa,CAAC,UAAU;;YAwLvC,CAAC,SAAS,aAAa,CAAC,UAAU,SAC9C,MAAM,cACD,CAAC,GAAG,aAAa,CAAC,UAAU;yBAhBR,aAAa,CAAC,UAAU;CA8D3D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ICoreOptions {
|
|
2
|
+
appName?: string;
|
|
3
|
+
workspace: WorkspaceID | null;
|
|
4
|
+
apiUrl: string;
|
|
5
|
+
insightsUrl?: string;
|
|
6
|
+
NODE_ENV: string;
|
|
7
|
+
APP_MODE: string;
|
|
8
|
+
}
|
|
9
|
+
export type WorkspaceID = `W${string}`;
|
|
10
|
+
export declare const workspaceIdRegex: RegExp;
|
|
11
|
+
/**
|
|
12
|
+
* @description base factory that includes levo workspace details, analytics tools & fetch client
|
|
13
|
+
*/
|
|
14
|
+
export declare const createLevoControl: (options: ICoreOptions) => {
|
|
15
|
+
workspace: `W${string}` | null;
|
|
16
|
+
readonly appName: string | undefined;
|
|
17
|
+
readonly apiUrl: string;
|
|
18
|
+
readonly insightsUrl: string;
|
|
19
|
+
readonly NODE_ENV: string;
|
|
20
|
+
readonly APP_MODE: string;
|
|
21
|
+
};
|
|
22
|
+
export type ILevoControl = ReturnType<typeof createLevoControl>;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,MAAM,EAAE,CAAC;AAEvC,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,iBAAiB,YAAa,YAAY;;;;;;;CAmDtD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ILevoControl } from "./control";
|
|
2
|
+
export interface IPageContext {
|
|
3
|
+
url: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
referrer?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const createHttpClient: (core: ILevoControl, pageContext?: IPageContext | null) => {
|
|
9
|
+
readonly instance: import("wretch/addons/queryString").QueryStringAddon & import("wretch").Wretch<import("wretch/addons/queryString").QueryStringAddon, unknown, undefined>;
|
|
10
|
+
pageContext: IPageContext | null | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type IHttpClient = ReturnType<typeof createHttpClient>;
|
|
13
|
+
//# sourceMappingURL=httpClient.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./plugins/LevoPlugin";
|
|
1
|
+
export * from "./client";
|
|
3
2
|
export * from "./types";
|
|
4
3
|
export * from "./constants";
|
|
5
4
|
export * from "./utils/formatImagePath";
|
|
6
5
|
export * from "./utils/getLevoError";
|
|
7
6
|
export * from "./utils/LevoError";
|
|
7
|
+
export * from "./utils/lock";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|