@levo-so/core 0.1.0
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/LevoClient.d.ts +23 -0
- package/dist/chunk-QJSKNLTV.js +9 -0
- package/dist/chunk-ZLLCLSGE.js +8 -0
- package/dist/constants/collection/defaultByKind.d.ts +3 -0
- package/dist/constants/collection/defaultByKind.d.ts.map +1 -0
- package/dist/constants/collection/fieldInterfaceFormat.d.ts +3 -0
- package/dist/constants/collection/fieldInterfaceFormat.d.ts.map +1 -0
- package/dist/constants/collection/fieldInterfaces.d.ts +3 -0
- package/dist/constants/collection/fieldInterfaces.d.ts.map +1 -0
- package/dist/constants/collection/fieldKind.d.ts +25 -0
- package/dist/constants/collection/fieldKind.d.ts.map +1 -0
- package/dist/constants/index.d.ts +7 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/media.d.ts +3 -0
- package/dist/constants/media.d.ts.map +1 -0
- package/dist/constants/oauthProvider.d.ts +3 -0
- package/dist/constants/oauthProvider.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +261 -0
- package/dist/plugins/LevoAudience.d.ts +21 -0
- package/dist/plugins/LevoAudience.d.ts.map +1 -0
- package/dist/plugins/LevoAudience.js +362 -0
- package/dist/plugins/LevoBlog.d.ts +8 -0
- package/dist/plugins/LevoBlog.d.ts.map +1 -0
- package/dist/plugins/LevoBlog.js +21 -0
- package/dist/plugins/LevoCollection.d.ts +24 -0
- package/dist/plugins/LevoCollection.d.ts.map +1 -0
- package/dist/plugins/LevoCollection.js +49 -0
- package/dist/plugins/LevoLogger.d.ts +8 -0
- package/dist/plugins/LevoLogger.d.ts.map +1 -0
- package/dist/plugins/LevoLogger.js +23 -0
- package/dist/plugins/LevoMedia.d.ts +9 -0
- package/dist/plugins/LevoMedia.d.ts.map +1 -0
- package/dist/plugins/LevoMedia.js +13 -0
- package/dist/plugins/LevoMembership.d.ts +40 -0
- package/dist/plugins/LevoMembership.d.ts.map +1 -0
- package/dist/plugins/LevoMembership.js +167 -0
- package/dist/plugins/LevoPlugin.d.ts +6 -0
- package/dist/plugins/LevoPlugin.d.ts.map +1 -0
- package/dist/plugins/LevoPlugin.js +1 -0
- package/dist/types/audience.d.ts +35 -0
- package/dist/types/audience.d.ts.map +1 -0
- package/dist/types/blog/author.d.ts +30 -0
- package/dist/types/blog/author.d.ts.map +1 -0
- package/dist/types/blog/blogClient.d.ts +51 -0
- package/dist/types/blog/blogClient.d.ts.map +1 -0
- package/dist/types/blog/category.d.ts +20 -0
- package/dist/types/blog/category.d.ts.map +1 -0
- package/dist/types/blog/index.d.ts +71 -0
- package/dist/types/blog/index.d.ts.map +1 -0
- package/dist/types/blog/post.d.ts +63 -0
- package/dist/types/blog/post.d.ts.map +1 -0
- package/dist/types/blog/tag.d.ts +19 -0
- package/dist/types/blog/tag.d.ts.map +1 -0
- package/dist/types/collection/collectionView.d.ts +35 -0
- package/dist/types/collection/collectionView.d.ts.map +1 -0
- package/dist/types/collection/draft.d.ts +9 -0
- package/dist/types/collection/draft.d.ts.map +1 -0
- package/dist/types/collection/index.d.ts +7 -0
- package/dist/types/collection/index.d.ts.map +1 -0
- package/dist/types/collection/lemaCollection.d.ts +33 -0
- package/dist/types/collection/lemaCollection.d.ts.map +1 -0
- package/dist/types/collection/lemaField.d.ts +35 -0
- package/dist/types/collection/lemaField.d.ts.map +1 -0
- package/dist/types/collection/lemaSection.d.ts +6 -0
- package/dist/types/collection/lemaSection.d.ts.map +1 -0
- package/dist/types/collection/relation.d.ts +11 -0
- package/dist/types/collection/relation.d.ts.map +1 -0
- package/dist/types/emoji.d.ts +21 -0
- package/dist/types/emoji.d.ts.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/levo-query.d.ts +48 -0
- package/dist/types/levo-query.d.ts.map +1 -0
- package/dist/types/media.d.ts +34 -0
- package/dist/types/media.d.ts.map +1 -0
- package/dist/types/membership/index.d.ts +193 -0
- package/dist/types/membership/index.d.ts.map +1 -0
- package/dist/types/query.d.ts +65 -0
- package/dist/types/query.d.ts.map +1 -0
- package/dist/types/schema/field.d.ts +27 -0
- package/dist/types/schema/field.d.ts.map +1 -0
- package/dist/types/schema/index.d.ts +3 -0
- package/dist/types/schema/index.d.ts.map +1 -0
- package/dist/types/schema/schema.d.ts +29 -0
- package/dist/types/schema/schema.d.ts.map +1 -0
- package/dist/types/utils.d.ts +8 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/utils/LevoMembershipError.d.ts +8 -0
- package/dist/utils/LevoMembershipError.d.ts.map +1 -0
- package/dist/utils/createSrcSet.d.ts +5 -0
- package/dist/utils/createSrcSet.d.ts.map +1 -0
- package/dist/utils/formatImagePath.d.ts +3 -0
- package/dist/utils/formatImagePath.d.ts.map +1 -0
- package/dist/utils/getUserProperties.d.ts +7 -0
- package/dist/utils/getUserProperties.d.ts.map +1 -0
- package/dist/utils/isIncognito.d.ts +9 -0
- package/dist/utils/isIncognito.d.ts.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { LevoOAuthProviderList } from '../chunk-ZLLCLSGE.js';
|
|
2
|
+
import { LevoPlugin } from '../chunk-QJSKNLTV.js';
|
|
3
|
+
|
|
4
|
+
// src/utils/LevoMembershipError.ts
|
|
5
|
+
var LevoMembershipError = class extends Error {
|
|
6
|
+
code;
|
|
7
|
+
title;
|
|
8
|
+
message;
|
|
9
|
+
constructor(data) {
|
|
10
|
+
super(data.message || data.description);
|
|
11
|
+
this.name = "LevoMembershipError";
|
|
12
|
+
this.code = data.code;
|
|
13
|
+
this.message = data.message || data.description;
|
|
14
|
+
this.title = data.title;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/plugins/LevoMembership.ts
|
|
19
|
+
var LevoMembership = class extends LevoPlugin {
|
|
20
|
+
/**
|
|
21
|
+
* The Account of the Currently Logged in Member
|
|
22
|
+
*/
|
|
23
|
+
account = null;
|
|
24
|
+
#stall = (body) => {
|
|
25
|
+
throw new LevoMembershipError(
|
|
26
|
+
body.content
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get the list of URL for OAuth providers to redirect to
|
|
31
|
+
* This can be used in the OAuth Buttons like "Continue with Google" etc.
|
|
32
|
+
* The URL contains the current page's URL and the current workspace
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* const urls = await LevoMembership.getOAuthURL();
|
|
36
|
+
* console.log(urls.google)
|
|
37
|
+
*
|
|
38
|
+
* @returns {ILevoMembership.OAuthURLList}
|
|
39
|
+
*/
|
|
40
|
+
async getOAuthURL(options = {}) {
|
|
41
|
+
try {
|
|
42
|
+
const response = await this.client.fetch.url("/v1/membership/auth/oauth/get-redirect-url").options(options).get().json().catch((err) => this.#stall(err.json));
|
|
43
|
+
const {
|
|
44
|
+
content: { data: result }
|
|
45
|
+
} = response;
|
|
46
|
+
const providers = Object.keys(result);
|
|
47
|
+
if (window) {
|
|
48
|
+
for (const provider of providers) {
|
|
49
|
+
const raw_url = result[provider];
|
|
50
|
+
if (raw_url) {
|
|
51
|
+
const url = new URL(raw_url);
|
|
52
|
+
const url_params = url.searchParams;
|
|
53
|
+
url_params.set("redirect_uri", window.location.href);
|
|
54
|
+
if (this.client.workspace) {
|
|
55
|
+
url_params.set("workspace_id", this.client.workspace);
|
|
56
|
+
}
|
|
57
|
+
result[provider] = `${url.origin}${url.pathname}?${url_params.toString()}`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error(error);
|
|
64
|
+
}
|
|
65
|
+
return LevoOAuthProviderList.reduce((acc, provider) => {
|
|
66
|
+
acc[provider] = null;
|
|
67
|
+
return acc;
|
|
68
|
+
}, {});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Sign out the current user's account
|
|
72
|
+
* @returns ILevoMembership.Account | null
|
|
73
|
+
*/
|
|
74
|
+
async signOut(options = {}) {
|
|
75
|
+
try {
|
|
76
|
+
const response = await this.client.fetch.url("/v1/membership/auth/sign-out").options(options).post("").json().catch((err) => this.#stall(err.json));
|
|
77
|
+
const {
|
|
78
|
+
content: { data: result }
|
|
79
|
+
} = response;
|
|
80
|
+
if (result) {
|
|
81
|
+
this.account = null;
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
} catch (error) {
|
|
85
|
+
console.error(error);
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get the current user's account
|
|
91
|
+
* @returns ILevoMembership.Account | null
|
|
92
|
+
*/
|
|
93
|
+
async getMe(options = {}) {
|
|
94
|
+
try {
|
|
95
|
+
const response = await this.client.fetch.url("/v1/membership/auth/get-me").options(options).get().json().catch((err) => this.#stall(err.json));
|
|
96
|
+
const {
|
|
97
|
+
content: { data: result }
|
|
98
|
+
} = response;
|
|
99
|
+
if (result) {
|
|
100
|
+
this.account = result;
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.error(error);
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
async updateMe(data, options = {}) {
|
|
109
|
+
try {
|
|
110
|
+
const response = await this.client.fetch.url("/v1/membership/auth/update-me").options(options).put(data).json().catch((err) => this.#stall(err.json));
|
|
111
|
+
const {
|
|
112
|
+
content: { data: result }
|
|
113
|
+
} = response;
|
|
114
|
+
if (result) {
|
|
115
|
+
this.account = result;
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.error(error);
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
async isLoggedIn(options = {}) {
|
|
124
|
+
const account = await this.getMe(options);
|
|
125
|
+
return !!account;
|
|
126
|
+
}
|
|
127
|
+
async requestMagicLink(data, options = {}) {
|
|
128
|
+
if (typeof window !== "undefined" && !data.redirect_uri) {
|
|
129
|
+
data.redirect_uri = window.location.href;
|
|
130
|
+
}
|
|
131
|
+
const response = await this.client.fetch.url("/v1/membership/auth/request-magic-link").options(options).post(data).json().catch((err) => this.#stall(err.json));
|
|
132
|
+
const {
|
|
133
|
+
content: { data: result }
|
|
134
|
+
} = response;
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
async requestOtp(data, options = {}) {
|
|
138
|
+
const response = await this.client.fetch.url("/v1/membership/auth/request-otp").options(options).post(data).json().catch((err) => this.#stall(err.json));
|
|
139
|
+
const {
|
|
140
|
+
content: { data: result }
|
|
141
|
+
} = response;
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
async signInWithOtp(data, options = {}) {
|
|
145
|
+
const response = await this.client.fetch.url("/v1/membership/auth/signin-with-otp").options(options).post(data).json().catch((err) => this.#stall(err.json));
|
|
146
|
+
const {
|
|
147
|
+
content: { data: result }
|
|
148
|
+
} = response;
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
async signInWithPassword(data, options = {}) {
|
|
152
|
+
const response = await this.client.fetch.url("/v1/membership/auth/signin-with-password").options(options).post(data).json().catch((err) => this.#stall(err.json));
|
|
153
|
+
const {
|
|
154
|
+
content: { data: result }
|
|
155
|
+
} = response;
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
async signUpWithPassword(data, options = {}) {
|
|
159
|
+
const response = await this.client.fetch.url("/v1/membership/auth/signup-with-password").options(options).post(data).json().catch((err) => this.#stall(err.json));
|
|
160
|
+
const {
|
|
161
|
+
content: { data: result }
|
|
162
|
+
} = response;
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export { LevoMembership };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LevoPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/LevoPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAE5C,8BAAsB,UAAU;IAC9B,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;gBAEjB,MAAM,EAAE,UAAU;CAG/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LevoPlugin } from '../chunk-QJSKNLTV.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare namespace ILevoAudience {
|
|
2
|
+
interface BaseProperties {
|
|
3
|
+
private_mode: boolean;
|
|
4
|
+
dark_mode: boolean;
|
|
5
|
+
locale: string;
|
|
6
|
+
timezone: string;
|
|
7
|
+
resource: string;
|
|
8
|
+
identifier: string;
|
|
9
|
+
referrer: {
|
|
10
|
+
type: any;
|
|
11
|
+
referrer: any;
|
|
12
|
+
data: any;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface BlockProperties {
|
|
16
|
+
id: string;
|
|
17
|
+
workspace_id: string;
|
|
18
|
+
}
|
|
19
|
+
interface ActivityProperties {
|
|
20
|
+
seconds_idle?: number;
|
|
21
|
+
seconds_active?: number;
|
|
22
|
+
}
|
|
23
|
+
interface ScrollProperties {
|
|
24
|
+
percent: number;
|
|
25
|
+
}
|
|
26
|
+
type Properties = Partial<BaseProperties & BlockProperties & ActivityProperties & ScrollProperties> & Record<string, any>;
|
|
27
|
+
type EventProperties = {
|
|
28
|
+
properties: Properties;
|
|
29
|
+
traits: Properties;
|
|
30
|
+
event: string;
|
|
31
|
+
type: "track" | "page" | "identify";
|
|
32
|
+
userId: string | null;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=audience.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../../src/types/audience.ts"],"names":[],"mappings":"AAAA,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,cAAc;QAC7B,YAAY,EAAE,OAAO,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QAEjB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE;YACR,IAAI,EAAE,GAAG,CAAC;YACV,QAAQ,EAAE,GAAG,CAAC;YACd,IAAI,EAAE,GAAG,CAAC;SACX,CAAC;KACH;IAED,UAAiB,eAAe;QAC9B,EAAE,EAAE,MAAM,CAAC;QACX,YAAY,EAAE,MAAM,CAAC;KACtB;IAED,UAAiB,kBAAkB;QACjC,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;IAED,UAAiB,gBAAgB;QAC/B,OAAO,EAAE,MAAM,CAAC;KACjB;IAED,KAAY,UAAU,GAAG,OAAO,CAC9B,cAAc,GAAG,eAAe,GAAG,kBAAkB,GAAG,gBAAgB,CACzE,GACC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEtB,KAAY,eAAe,GAAG;QAC5B,UAAU,EAAE,UAAU,CAAC;QACvB,MAAM,EAAE,UAAU,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;QACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,CAAC;CACH"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface IAuthor {
|
|
2
|
+
_id: string;
|
|
3
|
+
public_id: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
first_name: string;
|
|
6
|
+
last_name: string;
|
|
7
|
+
profile_picture: any;
|
|
8
|
+
active_at: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface IMe {
|
|
11
|
+
_id: string;
|
|
12
|
+
public_id: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
first_name: string;
|
|
15
|
+
last_name: string;
|
|
16
|
+
email: string;
|
|
17
|
+
bio: string;
|
|
18
|
+
website: string;
|
|
19
|
+
profile_picture: any;
|
|
20
|
+
og_image: any;
|
|
21
|
+
og_title: string;
|
|
22
|
+
og_description: string;
|
|
23
|
+
meta_title: string;
|
|
24
|
+
meta_description: string;
|
|
25
|
+
last_access_at: Date;
|
|
26
|
+
active_at: Date;
|
|
27
|
+
created_at: Date;
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=author.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"author.d.ts","sourceRoot":"","sources":["../../../src/types/blog/author.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,GAAG,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,GAAG,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,IAAI,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { IPost } from "./post";
|
|
2
|
+
export declare namespace BlogClient {
|
|
3
|
+
interface CoverImage {
|
|
4
|
+
_id: string;
|
|
5
|
+
location: string;
|
|
6
|
+
mimetype: string;
|
|
7
|
+
kind: string;
|
|
8
|
+
external: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface CategoriesEntity {
|
|
11
|
+
_id: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
interface AuthorsEntity {
|
|
16
|
+
posts?: string[] | null;
|
|
17
|
+
_id: string;
|
|
18
|
+
public_id: string;
|
|
19
|
+
slug: string;
|
|
20
|
+
first_name: string;
|
|
21
|
+
last_name: string;
|
|
22
|
+
email: string;
|
|
23
|
+
bio: string;
|
|
24
|
+
website: string;
|
|
25
|
+
profile_picture?: null | {
|
|
26
|
+
location: string;
|
|
27
|
+
};
|
|
28
|
+
og_image: string;
|
|
29
|
+
og_title: string;
|
|
30
|
+
og_description: string;
|
|
31
|
+
meta_title: string;
|
|
32
|
+
meta_description: string;
|
|
33
|
+
last_access_at: string;
|
|
34
|
+
active_at: string;
|
|
35
|
+
created_at: string;
|
|
36
|
+
updated_at: string;
|
|
37
|
+
}
|
|
38
|
+
interface IBlogResponse {
|
|
39
|
+
meta: {
|
|
40
|
+
pages: number;
|
|
41
|
+
filter_count: number;
|
|
42
|
+
};
|
|
43
|
+
data: IPost[];
|
|
44
|
+
}
|
|
45
|
+
type BlogData = IPost;
|
|
46
|
+
interface OptionParams {
|
|
47
|
+
workspace_id: string;
|
|
48
|
+
params?: Record<string, string>;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=blogClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blogClient.d.ts","sourceRoot":"","sources":["../../../src/types/blog/blogClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,Q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AM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IMediaObject } from "../media";
|
|
2
|
+
import type { IPost } from "./post";
|
|
3
|
+
export interface IBlogCategory {
|
|
4
|
+
posts: IPost[];
|
|
5
|
+
_id: string;
|
|
6
|
+
blog: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
og_image?: IMediaObject;
|
|
11
|
+
og_title: string;
|
|
12
|
+
og_description: string;
|
|
13
|
+
meta_title: string;
|
|
14
|
+
meta_description: string;
|
|
15
|
+
created_at: Date;
|
|
16
|
+
updated_at: Date;
|
|
17
|
+
created_by: Date;
|
|
18
|
+
updated_by: Date;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../../src/types/blog/category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { IPost } from "./post";
|
|
2
|
+
export * from "./post";
|
|
3
|
+
export * from "./author";
|
|
4
|
+
export * from "./category";
|
|
5
|
+
export * from "./tag";
|
|
6
|
+
export interface IBlog {
|
|
7
|
+
_id: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
name: string;
|
|
10
|
+
status: string;
|
|
11
|
+
description: string;
|
|
12
|
+
og_image?: string;
|
|
13
|
+
og_title?: string;
|
|
14
|
+
og_description?: string;
|
|
15
|
+
meta_title?: string;
|
|
16
|
+
meta_description?: string;
|
|
17
|
+
created_at: string;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
created_by: string;
|
|
20
|
+
updated_by: string;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace BlogClient {
|
|
23
|
+
interface CoverImage {
|
|
24
|
+
_id: string;
|
|
25
|
+
location: string;
|
|
26
|
+
mimetype: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
external: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface CategoriesEntity {
|
|
31
|
+
_id: string;
|
|
32
|
+
slug: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
interface AuthorsEntity {
|
|
36
|
+
posts?: string[] | null;
|
|
37
|
+
_id: string;
|
|
38
|
+
public_id: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
first_name: string;
|
|
41
|
+
last_name: string;
|
|
42
|
+
email: string;
|
|
43
|
+
bio: string;
|
|
44
|
+
website: string;
|
|
45
|
+
profile_picture?: null | {
|
|
46
|
+
location: string;
|
|
47
|
+
};
|
|
48
|
+
og_image: string;
|
|
49
|
+
og_title: string;
|
|
50
|
+
og_description: string;
|
|
51
|
+
meta_title: string;
|
|
52
|
+
meta_description: string;
|
|
53
|
+
last_access_at: string;
|
|
54
|
+
active_at: string;
|
|
55
|
+
created_at: string;
|
|
56
|
+
updated_at: string;
|
|
57
|
+
}
|
|
58
|
+
interface IBlogResponse {
|
|
59
|
+
meta: {
|
|
60
|
+
pages: number;
|
|
61
|
+
filter_count: number;
|
|
62
|
+
};
|
|
63
|
+
data: IPost[];
|
|
64
|
+
}
|
|
65
|
+
type BlogData = IPost;
|
|
66
|
+
interface OptionParams {
|
|
67
|
+
workspace_id: string;
|
|
68
|
+
params?: Record<string, string>;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/blog/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AAEtB,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,yBAAiB,UAAU,CAAC;IAC1B,UAAiB,UAAU;QACzB,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,Q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|
|
4
|
+
attrs?: Record<string, any>;
|
|
5
|
+
content?: JSONContent[];
|
|
6
|
+
marks?: {
|
|
7
|
+
type: string;
|
|
8
|
+
attrs?: Record<string, any>;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}[];
|
|
11
|
+
text?: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
export interface IContent {
|
|
15
|
+
json: JSONContent;
|
|
16
|
+
html: string;
|
|
17
|
+
nodes?: any[];
|
|
18
|
+
}
|
|
19
|
+
export interface IPost {
|
|
20
|
+
_id: string;
|
|
21
|
+
blog: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
title: string;
|
|
24
|
+
summary: string;
|
|
25
|
+
content: IContent;
|
|
26
|
+
status: string;
|
|
27
|
+
cover_image?: IMediaObject;
|
|
28
|
+
reading_time: number;
|
|
29
|
+
canonical_url: string;
|
|
30
|
+
og_image?: IMediaObject | null;
|
|
31
|
+
og_title: string;
|
|
32
|
+
og_description: string;
|
|
33
|
+
meta_title: string;
|
|
34
|
+
meta_description: string;
|
|
35
|
+
authors?: {
|
|
36
|
+
first_name: string;
|
|
37
|
+
last_name: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
bio: string;
|
|
40
|
+
profile_picture: {
|
|
41
|
+
location: string;
|
|
42
|
+
};
|
|
43
|
+
}[];
|
|
44
|
+
settings: Record<string, any>;
|
|
45
|
+
in_review_at?: Date;
|
|
46
|
+
approved_at?: Date;
|
|
47
|
+
published_at?: string;
|
|
48
|
+
created_at: string;
|
|
49
|
+
updated_at: Date;
|
|
50
|
+
deleted_at?: Date;
|
|
51
|
+
tags?: {
|
|
52
|
+
_id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
slug: string;
|
|
55
|
+
}[];
|
|
56
|
+
categories?: {
|
|
57
|
+
_id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
slug: string;
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMapp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BAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,eAAe,EAAE;YACf,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,EAAE,CAAC;IACJ,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,UAAU,CAAC,EAAE;QACX,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;CACL"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IPost } from "./post";
|
|
2
|
+
export interface IBlogTag {
|
|
3
|
+
posts: IPost[];
|
|
4
|
+
_id: string;
|
|
5
|
+
blog: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
og_image?: any;
|
|
10
|
+
og_title: string;
|
|
11
|
+
og_description: string;
|
|
12
|
+
meta_title: string;
|
|
13
|
+
meta_description: string;
|
|
14
|
+
created_at: Date;
|
|
15
|
+
updated_at: Date;
|
|
16
|
+
created_by: Date;
|
|
17
|
+
updated_by: Date;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/types/blog/tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ILemaField } from "./lemaField";
|
|
2
|
+
export type ICollectionsView = "table" | "kanban" | "calendar";
|
|
3
|
+
export interface IGroupBy {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
field: ILemaField;
|
|
7
|
+
}
|
|
8
|
+
export interface ICollectionLayoutOptions {
|
|
9
|
+
groupBy?: IGroupBy | null;
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
columnsOrder?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ICollectionLayout {
|
|
15
|
+
kind: ICollectionsView;
|
|
16
|
+
options: ICollectionLayoutOptions;
|
|
17
|
+
}
|
|
18
|
+
export interface ICollectionQuery {
|
|
19
|
+
where: Record<string, any>;
|
|
20
|
+
sort?: Record<string, any>;
|
|
21
|
+
}
|
|
22
|
+
export interface ICollectionView {
|
|
23
|
+
id: string;
|
|
24
|
+
workspace_id: string;
|
|
25
|
+
slug: string;
|
|
26
|
+
collection_id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
layout: ICollectionLayout;
|
|
30
|
+
query: ICollectionQuery;
|
|
31
|
+
options: Record<string, any>;
|
|
32
|
+
created_at: string;
|
|
33
|
+
updated_at: string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=collectionView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionView.d.ts","sourceRoot":"","sources":["../../../src/types/collection/collectionView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,wBAAwB,CAAC;CACnC;AACD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../../src/types/collection/draft.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,GAAG,WAAW,CAAC;IAC/B,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/collection/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IIcon } from "../emoji";
|
|
2
|
+
import type { ICollectionViews } from "../schema/schema";
|
|
3
|
+
import type { ILemaSection } from "./lemaSection";
|
|
4
|
+
export interface ILemaCollection {
|
|
5
|
+
id: string;
|
|
6
|
+
key: string;
|
|
7
|
+
sections: ILemaSection[];
|
|
8
|
+
views?: ICollectionViews[];
|
|
9
|
+
workspace_id?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string | null;
|
|
12
|
+
icon?: IIcon | null;
|
|
13
|
+
title_field?: string | null;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
readonly?: boolean;
|
|
16
|
+
settings?: Record<string, any>;
|
|
17
|
+
module_name?: string | null;
|
|
18
|
+
on_submit?: Record<string, any>;
|
|
19
|
+
on_update?: Record<string, any>;
|
|
20
|
+
created_at?: Date | string;
|
|
21
|
+
updated_at?: Date | string;
|
|
22
|
+
allow_draft?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ILemaIndex {
|
|
25
|
+
name: string;
|
|
26
|
+
columns: string[];
|
|
27
|
+
kind: "FULLTEXT" | "UNIQUE";
|
|
28
|
+
}
|
|
29
|
+
export interface ICollectionValue {
|
|
30
|
+
id: string;
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=lemaCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lemaCollection.d.ts","sourceRoot":"","sources":["../../../src/types/collection/lemaCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAGD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { FieldInterfacesList, FieldKind } from "../../constants";
|
|
2
|
+
import type { Mandatory } from "../utils";
|
|
3
|
+
import type { IMediaObject } from "../media";
|
|
4
|
+
import type { IField } from "../schema/field";
|
|
5
|
+
import type { ILemaCollectionRelationship, ILemaRelationOnDelete } from "./relation";
|
|
6
|
+
export interface ILemaFieldOptions {
|
|
7
|
+
collection_key?: string;
|
|
8
|
+
collection_id?: string;
|
|
9
|
+
reference_field_key?: string;
|
|
10
|
+
label_field_key?: string;
|
|
11
|
+
current_have_many_connected?: boolean;
|
|
12
|
+
connected_have_many_current?: boolean;
|
|
13
|
+
relationship?: ILemaCollectionRelationship | string;
|
|
14
|
+
on_delete?: ILemaRelationOnDelete;
|
|
15
|
+
/**
|
|
16
|
+
* Slug Options
|
|
17
|
+
*/
|
|
18
|
+
slug?: string;
|
|
19
|
+
currency_code?: string;
|
|
20
|
+
custom_input?: boolean;
|
|
21
|
+
disableValidation?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type ILemaField = Mandatory<Omit<IField, "fields">, "key" | "kind" | "label" | "id"> & {
|
|
24
|
+
field_interface: (typeof FieldInterfacesList)[number];
|
|
25
|
+
fields?: ILemaField[];
|
|
26
|
+
options?: ILemaFieldOptions;
|
|
27
|
+
};
|
|
28
|
+
export type ILemaInterface<T> = {
|
|
29
|
+
[K in keyof T]: T[K]["kind"] extends infer Kind ? Kind extends (typeof FieldKind)["identifier"] ? string : Kind extends (typeof FieldKind)["collection"] ? string : Kind extends (typeof FieldKind)["public-id"] ? string : Kind extends (typeof FieldKind)["string"] ? string : Kind extends (typeof FieldKind)["number"] ? number : Kind extends (typeof FieldKind)["boolean"] ? boolean : Kind extends (typeof FieldKind)["date"] ? Date | string : Kind extends (typeof FieldKind)["json"] ? Record<string, any> : Kind extends (typeof FieldKind)["array-string"] ? string[] : Kind extends (typeof FieldKind)["array-number"] ? number[] : Kind extends (typeof FieldKind)["array-date"] ? (Date | string)[] : Kind extends (typeof FieldKind)["array-boolean"] ? boolean[] : Kind extends (typeof FieldKind)["file"] ? IMediaObject : Kind extends (typeof FieldKind)["array-file"] ? IMediaObject[] : Kind extends (typeof FieldKind)["location"] ? Record<string, any> : Kind extends (typeof FieldKind)["richtext"] ? Record<string, any> : Kind extends (typeof FieldKind)["record"] ? ILemaInterface<T[K]["fields"]> : Kind extends (typeof FieldKind)["group"] ? ILemaInterface<T[K]["fields"]>[] : never : never;
|
|
30
|
+
};
|
|
31
|
+
export type ILemaInterfaceUpdate<T> = Partial<ILemaInterface<T>>;
|
|
32
|
+
export type ILemaInterfaceCreate<T> = {
|
|
33
|
+
[K in keyof T]: T[K]["required"] extends true ? ILemaInterface<T>[K] : ILemaInterface<T>[K] | undefined;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=lemaField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lemaField.d.ts","sourceRoot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