@levo-so/core 0.1.59 → 0.1.61
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/index.d.ts +1789 -8
- package/dist/index.js +262 -881
- package/package.json +3 -9
- package/dist/client.d.ts +0 -82
- package/dist/constants/collection/defaultByKind.d.ts +0 -3
- package/dist/constants/collection/fieldInterfaceFormat.d.ts +0 -3
- package/dist/constants/collection/fieldInterfaces.d.ts +0 -6
- package/dist/constants/collection/fieldKind.d.ts +0 -26
- package/dist/constants/index.d.ts +0 -8
- package/dist/constants/integration.d.ts +0 -23
- package/dist/constants/media.d.ts +0 -3
- package/dist/constants/oauthProvider.d.ts +0 -3
- package/dist/control/audience.d.ts +0 -22
- package/dist/control/index.d.ts +0 -23
- package/dist/httpClient.d.ts +0 -13
- package/dist/logger/batch.d.ts +0 -9
- package/dist/logger/index.d.ts +0 -22
- package/dist/modules/blog.d.ts +0 -10
- package/dist/modules/collection.d.ts +0 -26
- package/dist/modules/media.d.ts +0 -11
- package/dist/modules/membership.d.ts +0 -21
- package/dist/types/audience.d.ts +0 -100
- package/dist/types/blog/author.d.ts +0 -30
- package/dist/types/blog/blogClient.d.ts +0 -51
- package/dist/types/blog/category.d.ts +0 -20
- package/dist/types/blog/index.d.ts +0 -64
- package/dist/types/blog/post.d.ts +0 -63
- package/dist/types/blog/tag.d.ts +0 -19
- package/dist/types/collection/collectionView.d.ts +0 -36
- package/dist/types/collection/draft.d.ts +0 -9
- package/dist/types/collection/index.d.ts +0 -7
- package/dist/types/collection/lemaCollection.d.ts +0 -95
- package/dist/types/collection/lemaField.d.ts +0 -55
- package/dist/types/collection/lemaSection.d.ts +0 -10
- package/dist/types/collection/relation.d.ts +0 -11
- package/dist/types/emoji.d.ts +0 -22
- package/dist/types/event.d.ts +0 -225
- package/dist/types/index.d.ts +0 -14
- package/dist/types/levo-query.d.ts +0 -104
- package/dist/types/location.d.ts +0 -6
- package/dist/types/media.d.ts +0 -56
- package/dist/types/membership/index.d.ts +0 -182
- package/dist/types/query.d.ts +0 -46
- package/dist/types/schema/field.d.ts +0 -56
- package/dist/types/schema/index.d.ts +0 -3
- package/dist/types/schema/schema.d.ts +0 -58
- package/dist/types/utils.d.ts +0 -8
- package/dist/types/workspace.d.ts +0 -172
- package/dist/utils/LevoError.d.ts +0 -21
- package/dist/utils/formatImagePath.d.ts +0 -3
- package/dist/utils/getLevoError.d.ts +0 -3
- package/dist/utils/getUserProperties.d.ts +0 -8
- package/dist/utils/isIncognito.d.ts +0 -9
- package/dist/utils/listToX.d.ts +0 -3
- package/dist/utils/lock.d.ts +0 -21
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export declare const LogicalOperators: {
|
|
2
|
-
AND: "AND";
|
|
3
|
-
OR: "OR";
|
|
4
|
-
};
|
|
5
|
-
export type LogicalOperators = keyof typeof LogicalOperators;
|
|
6
|
-
export type FieldType = string | number | Date | boolean | null;
|
|
7
|
-
type ComparableFieldType = number | Date;
|
|
8
|
-
export declare const ComparableOperators: {
|
|
9
|
-
equals: "equals";
|
|
10
|
-
not: "not";
|
|
11
|
-
in: "in";
|
|
12
|
-
not_in: "not_in";
|
|
13
|
-
gt: "gt";
|
|
14
|
-
gte: "gte";
|
|
15
|
-
lt: "lt";
|
|
16
|
-
lte: "lte";
|
|
17
|
-
contains: "contains";
|
|
18
|
-
not_contains: "not_contains";
|
|
19
|
-
starts_with: "starts_with";
|
|
20
|
-
not_starts_with: "not_starts_with";
|
|
21
|
-
ends_with: "ends_with";
|
|
22
|
-
not_ends_with: "not_ends_with";
|
|
23
|
-
empty: "empty";
|
|
24
|
-
has: "has";
|
|
25
|
-
between: "between";
|
|
26
|
-
within: "within";
|
|
27
|
-
is_empty: "is_empty";
|
|
28
|
-
is_not_empty: "is_not_empty";
|
|
29
|
-
};
|
|
30
|
-
export type WithinFilterType = {
|
|
31
|
-
latitude: number;
|
|
32
|
-
longitude: number;
|
|
33
|
-
distance: number;
|
|
34
|
-
unit?: "kilometers" | "miles" | "meters" | "feet";
|
|
35
|
-
};
|
|
36
|
-
export type ComparableFilter<T extends string = string> = {
|
|
37
|
-
[ComparableOperators.equals]?: FieldType;
|
|
38
|
-
} | {
|
|
39
|
-
[ComparableOperators.not]?: FieldType;
|
|
40
|
-
} | {
|
|
41
|
-
[ComparableOperators.in]?: FieldType[];
|
|
42
|
-
} | {
|
|
43
|
-
[ComparableOperators.not_in]?: FieldType[];
|
|
44
|
-
} | {
|
|
45
|
-
[ComparableOperators.gt]?: ComparableFieldType;
|
|
46
|
-
} | {
|
|
47
|
-
[ComparableOperators.gte]?: ComparableFieldType;
|
|
48
|
-
} | {
|
|
49
|
-
[ComparableOperators.lt]?: ComparableFieldType;
|
|
50
|
-
} | {
|
|
51
|
-
[ComparableOperators.lte]?: ComparableFieldType;
|
|
52
|
-
} | {
|
|
53
|
-
[ComparableOperators.contains]?: string;
|
|
54
|
-
} | {
|
|
55
|
-
[ComparableOperators.not_contains]?: string;
|
|
56
|
-
} | {
|
|
57
|
-
[ComparableOperators.starts_with]?: string;
|
|
58
|
-
} | {
|
|
59
|
-
[ComparableOperators.not_starts_with]?: string;
|
|
60
|
-
} | {
|
|
61
|
-
[ComparableOperators.ends_with]?: string;
|
|
62
|
-
} | {
|
|
63
|
-
[ComparableOperators.not_ends_with]?: string;
|
|
64
|
-
} | {
|
|
65
|
-
[ComparableOperators.between]?: ComparableFieldType[];
|
|
66
|
-
} | {
|
|
67
|
-
[ComparableOperators.is_empty]?: boolean;
|
|
68
|
-
} | {
|
|
69
|
-
[ComparableOperators.is_not_empty]?: boolean;
|
|
70
|
-
} | {
|
|
71
|
-
[ComparableOperators.empty]?: boolean;
|
|
72
|
-
} | {
|
|
73
|
-
[ComparableOperators.has]?: Record<string, FieldType>;
|
|
74
|
-
} | {
|
|
75
|
-
[ComparableOperators.within]?: WithinFilterType;
|
|
76
|
-
};
|
|
77
|
-
export type LogicalFilter<T extends string = string> = {
|
|
78
|
-
[LogicalOperators.AND]: Filter<T>[];
|
|
79
|
-
[LogicalOperators.OR]?: never;
|
|
80
|
-
} | {
|
|
81
|
-
[LogicalOperators.OR]: Filter<T>[];
|
|
82
|
-
[LogicalOperators.AND]?: never;
|
|
83
|
-
};
|
|
84
|
-
export type FieldFilter<T extends string = string> = Partial<Record<T, ComparableFilter<T> | FieldType>>;
|
|
85
|
-
export type Filter<T extends string = string> = LogicalFilter<T> | FieldFilter<T>;
|
|
86
|
-
export declare namespace LevoQuery {
|
|
87
|
-
type Select<Fields extends string = string> = Partial<Record<Fields, boolean | {
|
|
88
|
-
select: Record<string, boolean>;
|
|
89
|
-
}>>;
|
|
90
|
-
type Sort<Fields extends string = string> = Partial<Record<Fields, "asc" | "desc">>;
|
|
91
|
-
type Include<Fields extends string = string> = Partial<Record<Fields, boolean | Pick<FindQuery<Fields>, "select" | "sort" | "include" | "limit">>>;
|
|
92
|
-
type Where<Fields extends string = string> = Filter<Fields>;
|
|
93
|
-
type FindQuery<Fields extends string = string> = Partial<{
|
|
94
|
-
page: number;
|
|
95
|
-
limit: number;
|
|
96
|
-
select: Select<Fields>;
|
|
97
|
-
where: Where<Fields>;
|
|
98
|
-
sort: Sort<Fields>;
|
|
99
|
-
include: Include<Fields>;
|
|
100
|
-
search: string;
|
|
101
|
-
}>;
|
|
102
|
-
}
|
|
103
|
-
export {};
|
|
104
|
-
//# sourceMappingURL=levo-query.d.ts.map
|
package/dist/types/location.d.ts
DELETED
package/dist/types/media.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { MediaKindList } from "../constants/media";
|
|
2
|
-
interface IFaviconSrcset {
|
|
3
|
-
"16": string;
|
|
4
|
-
"32": string;
|
|
5
|
-
"57": string;
|
|
6
|
-
"60": string;
|
|
7
|
-
"72": string;
|
|
8
|
-
"76": string;
|
|
9
|
-
"96": string;
|
|
10
|
-
"114": string;
|
|
11
|
-
"120": string;
|
|
12
|
-
"144": string;
|
|
13
|
-
"152": string;
|
|
14
|
-
"180": string;
|
|
15
|
-
"192": string;
|
|
16
|
-
}
|
|
17
|
-
export interface IMedia {
|
|
18
|
-
id: string;
|
|
19
|
-
workspace_id: string;
|
|
20
|
-
filename: string;
|
|
21
|
-
kind: (typeof MediaKindList)[number];
|
|
22
|
-
location: string;
|
|
23
|
-
path: string;
|
|
24
|
-
srcset?: {
|
|
25
|
-
"320w": string;
|
|
26
|
-
"640w": string;
|
|
27
|
-
"750w": string;
|
|
28
|
-
"828w": string;
|
|
29
|
-
"1080w": string;
|
|
30
|
-
"1200w": string;
|
|
31
|
-
"1920w": string;
|
|
32
|
-
path: string;
|
|
33
|
-
};
|
|
34
|
-
description: string;
|
|
35
|
-
metadata: {
|
|
36
|
-
encoding?: string;
|
|
37
|
-
mimetype: string;
|
|
38
|
-
size: number;
|
|
39
|
-
etag?: string;
|
|
40
|
-
};
|
|
41
|
-
created_at?: Date;
|
|
42
|
-
created_by?: string;
|
|
43
|
-
updated_at?: Date;
|
|
44
|
-
updated_by?: string;
|
|
45
|
-
}
|
|
46
|
-
export type IFaviconMedia = Omit<IMedia, "srcset"> & {
|
|
47
|
-
srcset: IFaviconSrcset;
|
|
48
|
-
};
|
|
49
|
-
export type IMediaObject = Pick<IMedia, "id" | "location" | "srcset" | "kind"> & {
|
|
50
|
-
mimetype?: IMedia["metadata"]["mimetype"];
|
|
51
|
-
};
|
|
52
|
-
export type IFaviconMediaObject = Omit<IMediaObject, "srcset"> & {
|
|
53
|
-
srcset: IFaviconSrcset;
|
|
54
|
-
};
|
|
55
|
-
export {};
|
|
56
|
-
//# sourceMappingURL=media.d.ts.map
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import type { LevoOAuthProviderList } from "../../constants/oauthProvider";
|
|
2
|
-
import type { IMediaObject } from "../media";
|
|
3
|
-
export declare namespace ILevoMembership {
|
|
4
|
-
interface sub_account_oauth_credentials {
|
|
5
|
-
provider: string;
|
|
6
|
-
oauth_id: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The account object of the member
|
|
10
|
-
*/
|
|
11
|
-
export interface Account {
|
|
12
|
-
_id: string;
|
|
13
|
-
first_name: string | null;
|
|
14
|
-
last_name: string | null;
|
|
15
|
-
slug: string;
|
|
16
|
-
username: string;
|
|
17
|
-
email: string;
|
|
18
|
-
display_email: string;
|
|
19
|
-
reducted_email: string;
|
|
20
|
-
email_verified: boolean;
|
|
21
|
-
email_verified_at: string | null;
|
|
22
|
-
verified_at: string | null;
|
|
23
|
-
mobile: string | null;
|
|
24
|
-
reducted_mobile: string | null;
|
|
25
|
-
mobile_verified: boolean;
|
|
26
|
-
mobile_verified_at: string | null;
|
|
27
|
-
profile_picture: IMediaObject | null;
|
|
28
|
-
oauth_credentials: sub_account_oauth_credentials[];
|
|
29
|
-
account_locked_at: Date | string | null;
|
|
30
|
-
credentials_expired_at: Date | string | null;
|
|
31
|
-
deactivated_at: Date | string | null;
|
|
32
|
-
last_access_at: Date | string | null;
|
|
33
|
-
flagged_at: Date | string | null;
|
|
34
|
-
created_at: Date | string;
|
|
35
|
-
updated_at: Date | string;
|
|
36
|
-
deleted_at: Date | string | null;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* the otp object with its code and content
|
|
40
|
-
*/
|
|
41
|
-
export interface Otp {
|
|
42
|
-
/**
|
|
43
|
-
* the ID of the Otp
|
|
44
|
-
*/
|
|
45
|
-
_id: string;
|
|
46
|
-
/**
|
|
47
|
-
* the email or mobile number to send the Otp to
|
|
48
|
-
*/
|
|
49
|
-
content: string;
|
|
50
|
-
/**
|
|
51
|
-
* the Otp code received in email or sms
|
|
52
|
-
*/
|
|
53
|
-
code: string;
|
|
54
|
-
}
|
|
55
|
-
export type OAuthURLProvider = (typeof LevoOAuthProviderList)[number];
|
|
56
|
-
/**
|
|
57
|
-
* The list of URLs for OAuth providers to redirect to
|
|
58
|
-
* This can be used in the OAuth Buttons like "Continue with Google" etc.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```javascript
|
|
62
|
-
* {
|
|
63
|
-
* "google": 'https://public-api.levo.so/v1/membership/auth/oauth/google?redirect_uri=https://example.com&workspace=my-workspace',
|
|
64
|
-
* "microsoft": 'https://public-api.levo.so/v1/membership/auth/oauth/microsoft?redirect_uri=https://example.com&workspace=my-workspace',
|
|
65
|
-
* "linkedin": 'https://public-api.levo.so/v1/membership/auth/oauth/linkedin?redirect_uri=https://example.com&workspace=my-workspace'
|
|
66
|
-
* }
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export type OAuthURLList = Record<OAuthURLProvider, string | null>;
|
|
70
|
-
export namespace Request {
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* `content` - the email or mobile number to send the Otp to
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```json
|
|
77
|
-
* {
|
|
78
|
-
* "content": "example@mailinator.com",
|
|
79
|
-
* "redirect_uri": "https://example.com/protected-page"
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
type RequestMagicLink = Pick<Otp, "content"> & {
|
|
84
|
-
redirect_uri?: string;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
* `content` - the email or mobile number to send the Otp to
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```json
|
|
92
|
-
* {
|
|
93
|
-
* "content": "example@mailinator.com"
|
|
94
|
-
* }
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
type RequestOtp = Pick<Otp, "content"> & {
|
|
98
|
-
medium?: "email" | "whatsapp";
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* `content` - the email or mobile number to send the Otp to
|
|
102
|
-
*
|
|
103
|
-
* `code` - the Otp code received in email or sms
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```json
|
|
107
|
-
* {
|
|
108
|
-
* "content": "example@mailinator.com",
|
|
109
|
-
* "code": "1234"
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
type SignInWithOtp = Pick<Otp, "content" | "code">;
|
|
114
|
-
/**
|
|
115
|
-
* `email` - the email of the account
|
|
116
|
-
*
|
|
117
|
-
* `password` - the password of the account
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```json
|
|
121
|
-
* {
|
|
122
|
-
* "email": "example@mailinator.com",
|
|
123
|
-
* "password": "strongpasswordhere"
|
|
124
|
-
* }
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
type SignInWithPassword = {
|
|
128
|
-
email: Account["email"];
|
|
129
|
-
password: string;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* @property {string | null} [first_name] - the first name of the account
|
|
133
|
-
* @property {string | null} [last_name] - the last name of the account
|
|
134
|
-
* @property {string} email - the email of the account
|
|
135
|
-
* @property {string} password - the password of the account
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```json
|
|
139
|
-
* {
|
|
140
|
-
* "email": "example@mailinator.com",
|
|
141
|
-
* "password": "strongpasswordhere"
|
|
142
|
-
* }
|
|
143
|
-
* ```
|
|
144
|
-
* @example
|
|
145
|
-
* ```json
|
|
146
|
-
* {
|
|
147
|
-
* "first_name": "John",
|
|
148
|
-
* "last_name": "Doe",
|
|
149
|
-
* "email": "example@mailinator.com",
|
|
150
|
-
* "password": "strongpasswordhere"
|
|
151
|
-
* }
|
|
152
|
-
* ```
|
|
153
|
-
* @example
|
|
154
|
-
* ```json
|
|
155
|
-
* {
|
|
156
|
-
* "first_name": null,
|
|
157
|
-
* "last_name": null,
|
|
158
|
-
* "email": "example@mailinator.com",
|
|
159
|
-
* "password": "strongpasswordhere"
|
|
160
|
-
* }
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
type SignUpWithPassword = Partial<Pick<Account, "first_name" | "last_name">> & Pick<Account, "email"> & {
|
|
164
|
-
password: string;
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* @property {string | null} [first_name] - the first name of the account (optional)
|
|
168
|
-
* @property {string | null} [last_name] - the last name of the account (optional)
|
|
169
|
-
* @property {string} [username] - the username of the account (optional)
|
|
170
|
-
* @property {IMediaObject} [profile_picture] - the profile picture object for the account (optional)
|
|
171
|
-
*/
|
|
172
|
-
type UpdateMe = Partial<Pick<Account, "first_name" | "last_name" | "profile_picture" | "username">>;
|
|
173
|
-
/**
|
|
174
|
-
* @property {string} [password] - the first name of the account (optional)
|
|
175
|
-
*/
|
|
176
|
-
type CreatePassword = {
|
|
177
|
-
password: string;
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
export {};
|
|
181
|
-
}
|
|
182
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/query.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export interface IMeta {
|
|
2
|
-
total: number;
|
|
3
|
-
pages: number;
|
|
4
|
-
}
|
|
5
|
-
export interface IResponseMultiple<T = Record<string, unknown>> {
|
|
6
|
-
status: boolean;
|
|
7
|
-
content: {
|
|
8
|
-
meta: IMeta;
|
|
9
|
-
data: T[];
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface IResponseSingle<T = Record<string, unknown>, Meta = any> {
|
|
13
|
-
status: boolean;
|
|
14
|
-
content: {
|
|
15
|
-
data: T;
|
|
16
|
-
meta?: Meta;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface IResponseMyCategory<T = Record<string, unknown>> {
|
|
20
|
-
status: boolean;
|
|
21
|
-
content: {
|
|
22
|
-
data: T[];
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export interface IFieldError {
|
|
26
|
-
param: string;
|
|
27
|
-
message: string;
|
|
28
|
-
}
|
|
29
|
-
export interface IErrorContent {
|
|
30
|
-
status: number;
|
|
31
|
-
code: string;
|
|
32
|
-
title: string;
|
|
33
|
-
description: string;
|
|
34
|
-
type?: string;
|
|
35
|
-
errors?: IFieldError[];
|
|
36
|
-
}
|
|
37
|
-
export interface IResponseError {
|
|
38
|
-
status: false;
|
|
39
|
-
content: IErrorContent;
|
|
40
|
-
}
|
|
41
|
-
export type IFilter = Record<string, unknown>;
|
|
42
|
-
export type IErrorParams = {
|
|
43
|
-
message: string;
|
|
44
|
-
param: string;
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { FieldInterfacesList, FieldKindList } from "../../constants";
|
|
2
|
-
/**
|
|
3
|
-
* Defines the structure for a field in a generic schema system. Levo Collection builds its own types on top of this, so this type is not used directly.
|
|
4
|
-
*/
|
|
5
|
-
export interface IField {
|
|
6
|
-
/** Unique identifier for the field. */
|
|
7
|
-
id: string;
|
|
8
|
-
/** Unique key for the field, used for referencing. */
|
|
9
|
-
key: string;
|
|
10
|
-
/** The kind/type of the field (e.g., text, number, date). */
|
|
11
|
-
kind: (typeof FieldKindList)[number];
|
|
12
|
-
/** The widget/component type used to render this field. */
|
|
13
|
-
field_interface: (typeof FieldInterfacesList)[number] | "HeadingWidget" | "ButtonWidget" | "ImageWidget" | "MultiImageWidget" | "TypographyWidget" | "LayoutWidget" | "RepeatableWidget" | "TitleWidget" | "CardWidget" | "LinkWidget" | "IframeWidget";
|
|
14
|
-
/** Label for the field, displayed in the UI. */
|
|
15
|
-
label: string;
|
|
16
|
-
/** Helper text shown below the field. */
|
|
17
|
-
helper_text?: string;
|
|
18
|
-
/** Placeholder text for the field input. */
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
/** Default value for the field. */
|
|
21
|
-
default_value?: any;
|
|
22
|
-
/** Whether the field is read-only. */
|
|
23
|
-
readonly?: boolean;
|
|
24
|
-
/** Nested fields, if this field is a group or composite. */
|
|
25
|
-
fields?: IField[];
|
|
26
|
-
/** Additional options for configuring the field. */
|
|
27
|
-
options?: Record<string, any>;
|
|
28
|
-
/** Whether the field is hidden from the UI. */
|
|
29
|
-
hidden?: boolean;
|
|
30
|
-
/** Whether the field is editable. */
|
|
31
|
-
editable?: boolean;
|
|
32
|
-
/** Whether the field is required. */
|
|
33
|
-
required?: boolean;
|
|
34
|
-
/** Whether the field value must be unique. */
|
|
35
|
-
unique?: boolean;
|
|
36
|
-
/** Minimum value or length for the field. */
|
|
37
|
-
min?: string | number | null;
|
|
38
|
-
/** Maximum value or length for the field. */
|
|
39
|
-
max?: string | number | null;
|
|
40
|
-
/** Allowed formats for the field value. */
|
|
41
|
-
formats?: string[];
|
|
42
|
-
/** Allowed values for the field (for select/dropdown fields). */
|
|
43
|
-
values?: any[];
|
|
44
|
-
/** */
|
|
45
|
-
created_at?: string;
|
|
46
|
-
/** */
|
|
47
|
-
updated_at?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Used for making partial updates to fields, especially nested fields. This type is not used directly in most Levo Collection code, but Levo Collection types are based on it.
|
|
51
|
-
*/
|
|
52
|
-
export interface IFieldUpdate extends Omit<IField, "fields"> {
|
|
53
|
-
/** Nested fields to update, provided as partials. */
|
|
54
|
-
fields: Partial<IField>[];
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=field.d.ts.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { IIcon } from "../emoji";
|
|
2
|
-
import type { IField } from "./field";
|
|
3
|
-
/**
|
|
4
|
-
* Defines the basic structure for a collection schema, including its sections, fields, and configuration. Levo Collection uses its own types built on top of this, so this type is not used directly.
|
|
5
|
-
*/
|
|
6
|
-
export interface ISchema {
|
|
7
|
-
/** Unique identifier for the schema. */
|
|
8
|
-
id: string;
|
|
9
|
-
/** Name of the schema. */
|
|
10
|
-
name: string;
|
|
11
|
-
/** Description of the schema. */
|
|
12
|
-
description: string;
|
|
13
|
-
/** Unique key for referencing the schema. */
|
|
14
|
-
key: string;
|
|
15
|
-
/** Sections that make up the schema, each containing fields. */
|
|
16
|
-
sections: ISection[];
|
|
17
|
-
/** Field key used as the title for items in the schema. */
|
|
18
|
-
title_field: string;
|
|
19
|
-
/** */
|
|
20
|
-
cover_image_field?: string;
|
|
21
|
-
/** Icon representing the schema. */
|
|
22
|
-
icon: null | IIcon;
|
|
23
|
-
/** */
|
|
24
|
-
created_at?: string;
|
|
25
|
-
/** */
|
|
26
|
-
module_name?: string;
|
|
27
|
-
/** Views for customizing how the schema is presented. */
|
|
28
|
-
views?: ICollectionViews[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Defines the structure for a view configuration in a collection schema. Levo Collection uses its own types built on top of this, so this type is not used directly in most Levo Collection code.
|
|
32
|
-
*/
|
|
33
|
-
export interface ICollectionViews {
|
|
34
|
-
/** Unique identifier for the view. */
|
|
35
|
-
id: string;
|
|
36
|
-
/** Slug for the view, used in URLs. */
|
|
37
|
-
slug: string;
|
|
38
|
-
/** Title of the view. */
|
|
39
|
-
title: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Defines the structure for a section in a schema, grouping related fields together. Levo Collection uses its own types built on top of this, so this type is not used directly in most Levo Collection code.
|
|
43
|
-
*/
|
|
44
|
-
export interface ISection {
|
|
45
|
-
/** Unique identifier for the section. */
|
|
46
|
-
id: string;
|
|
47
|
-
/** Label for the section, displayed in the UI. */
|
|
48
|
-
label: string;
|
|
49
|
-
/** Unique key for referencing the section. */
|
|
50
|
-
key: string;
|
|
51
|
-
/** Helper text for the section. */
|
|
52
|
-
helper_text: string;
|
|
53
|
-
/** Whether the section is hidden from the UI. */
|
|
54
|
-
hidden: boolean;
|
|
55
|
-
/** Fields contained within this section. */
|
|
56
|
-
fields: IField[];
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=schema.d.ts.map
|
package/dist/types/utils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type Prettify<T> = {
|
|
2
|
-
[K in keyof T]: T[K];
|
|
3
|
-
};
|
|
4
|
-
export type Mandatory<T, K extends keyof T> = Prettify<Pick<T, K> & Partial<Omit<T, K>>>;
|
|
5
|
-
export type DeepPartial<T> = {
|
|
6
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import type { ILevoIntegrationInstance, ILevoIntegrationList } from "../constants/integration";
|
|
2
|
-
import type { IMediaObject } from "./media";
|
|
3
|
-
export interface IPlanPrice {
|
|
4
|
-
id: string;
|
|
5
|
-
plan_id: string;
|
|
6
|
-
period: "month" | "year";
|
|
7
|
-
unit_amount: number;
|
|
8
|
-
currency: string;
|
|
9
|
-
reference_id: string;
|
|
10
|
-
provider: string;
|
|
11
|
-
created_at: string;
|
|
12
|
-
updated_at: string;
|
|
13
|
-
}
|
|
14
|
-
export interface IPlanGroup {
|
|
15
|
-
id: string;
|
|
16
|
-
name: string;
|
|
17
|
-
created_at: Date;
|
|
18
|
-
updated_at: Date;
|
|
19
|
-
}
|
|
20
|
-
export interface IPlanFeature {
|
|
21
|
-
title: string;
|
|
22
|
-
description: string | null;
|
|
23
|
-
sort_order: number;
|
|
24
|
-
is_active: boolean | null;
|
|
25
|
-
}
|
|
26
|
-
export type PlanKind = "addon" | "base";
|
|
27
|
-
export interface IPlan {
|
|
28
|
-
name: string;
|
|
29
|
-
id: string;
|
|
30
|
-
created_at: Date;
|
|
31
|
-
updated_at: Date;
|
|
32
|
-
plan_group_id: string;
|
|
33
|
-
description: string;
|
|
34
|
-
kind: PlanKind;
|
|
35
|
-
is_trial: boolean;
|
|
36
|
-
price: IPlanPrice[];
|
|
37
|
-
features: IPlanFeature[];
|
|
38
|
-
recommended: boolean;
|
|
39
|
-
is_enterprise: boolean;
|
|
40
|
-
plan_group: IPlanGroup;
|
|
41
|
-
}
|
|
42
|
-
export interface ISubscription {
|
|
43
|
-
object: string;
|
|
44
|
-
id: string;
|
|
45
|
-
customer_details: Record<string, unknown>;
|
|
46
|
-
payment_details: Record<string, unknown>;
|
|
47
|
-
start_date: string;
|
|
48
|
-
end_date: string;
|
|
49
|
-
plan: Partial<Pick<IPlan, "id" | "name" | "is_enterprise">>;
|
|
50
|
-
price: Partial<IPlanPrice>;
|
|
51
|
-
cancelled_at: string | null;
|
|
52
|
-
cancel_at_next_billing_date: boolean;
|
|
53
|
-
status: "active" | "cancelled" | "past_due" | "trialing" | "incomplete";
|
|
54
|
-
plan_id?: string;
|
|
55
|
-
price_id?: string;
|
|
56
|
-
}
|
|
57
|
-
export interface IDefaultPermissionsObject {
|
|
58
|
-
status?: "enabled" | "disabled" | "hidden";
|
|
59
|
-
create?: boolean;
|
|
60
|
-
modify?: boolean;
|
|
61
|
-
delete?: boolean;
|
|
62
|
-
archive?: boolean;
|
|
63
|
-
duplicate?: boolean;
|
|
64
|
-
export?: boolean;
|
|
65
|
-
upload?: boolean;
|
|
66
|
-
list_actions?: boolean;
|
|
67
|
-
}
|
|
68
|
-
export type IModuleAccessControl = {
|
|
69
|
-
dashboard_config: IDefaultPermissionsObject;
|
|
70
|
-
studio_config: IDefaultPermissionsObject & {
|
|
71
|
-
addBlocks: boolean;
|
|
72
|
-
version: string;
|
|
73
|
-
preview_url: string | null;
|
|
74
|
-
modules: {
|
|
75
|
-
my_blocks: IDefaultPermissionsObject;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
collections_config: IDefaultPermissionsObject & {
|
|
79
|
-
modules: {
|
|
80
|
-
records: IDefaultPermissionsObject;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
media_config: IDefaultPermissionsObject;
|
|
84
|
-
events_config: IDefaultPermissionsObject;
|
|
85
|
-
blogs_config: IDefaultPermissionsObject;
|
|
86
|
-
memberships_config: IDefaultPermissionsObject;
|
|
87
|
-
insights_config: IDefaultPermissionsObject;
|
|
88
|
-
settings_config: IDefaultPermissionsObject;
|
|
89
|
-
};
|
|
90
|
-
export interface IFeatureFlags extends Partial<IModuleAccessControl> {
|
|
91
|
-
branding?: boolean;
|
|
92
|
-
}
|
|
93
|
-
export interface IEmailAddress {
|
|
94
|
-
id: string;
|
|
95
|
-
email: string;
|
|
96
|
-
is_primary: boolean;
|
|
97
|
-
}
|
|
98
|
-
export interface IPhoneNumber {
|
|
99
|
-
id: string;
|
|
100
|
-
phone: string;
|
|
101
|
-
is_primary: boolean;
|
|
102
|
-
}
|
|
103
|
-
export interface IAddress {
|
|
104
|
-
id: string;
|
|
105
|
-
unit?: string;
|
|
106
|
-
street: string;
|
|
107
|
-
landmark?: string;
|
|
108
|
-
city: string;
|
|
109
|
-
state: string;
|
|
110
|
-
zip: string;
|
|
111
|
-
country: string;
|
|
112
|
-
is_primary: boolean;
|
|
113
|
-
}
|
|
114
|
-
export interface IContactInfo {
|
|
115
|
-
emails?: IEmailAddress[];
|
|
116
|
-
phones?: IPhoneNumber[];
|
|
117
|
-
addresses?: IAddress[];
|
|
118
|
-
}
|
|
119
|
-
export interface IWorkspace {
|
|
120
|
-
id: string;
|
|
121
|
-
public_id: string;
|
|
122
|
-
name: string;
|
|
123
|
-
slug: string;
|
|
124
|
-
domain: string;
|
|
125
|
-
status: string;
|
|
126
|
-
logo?: IMediaObject | null;
|
|
127
|
-
deployed_at?: null;
|
|
128
|
-
created_at: string;
|
|
129
|
-
updated_at: string;
|
|
130
|
-
deleted_at?: null;
|
|
131
|
-
integrations?: ILevoIntegrationList | ILevoIntegrationInstance[];
|
|
132
|
-
description: any;
|
|
133
|
-
icon: IMediaObject | null;
|
|
134
|
-
workspace_id: string;
|
|
135
|
-
industry: string;
|
|
136
|
-
countries: string[];
|
|
137
|
-
info: {
|
|
138
|
-
locations?: {
|
|
139
|
-
place_name: string;
|
|
140
|
-
}[];
|
|
141
|
-
ai_onboarding?: {
|
|
142
|
-
business_profile: {
|
|
143
|
-
name: string;
|
|
144
|
-
location: string;
|
|
145
|
-
description: string;
|
|
146
|
-
category: string;
|
|
147
|
-
subcategory: string;
|
|
148
|
-
category_confidence: number;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
contact_info?: IContactInfo;
|
|
152
|
-
social_media?: {
|
|
153
|
-
facebook?: string;
|
|
154
|
-
twitter?: string;
|
|
155
|
-
linkedin?: string;
|
|
156
|
-
instagram?: string;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
settings: {
|
|
160
|
-
head_code?: string;
|
|
161
|
-
[key: string]: any;
|
|
162
|
-
};
|
|
163
|
-
page_count: number;
|
|
164
|
-
domain_count: number;
|
|
165
|
-
feature_flag?: IFeatureFlags;
|
|
166
|
-
onboarded_at?: string | null;
|
|
167
|
-
theme?: any;
|
|
168
|
-
host_domain: string | null;
|
|
169
|
-
proxy_domain: string | null;
|
|
170
|
-
subscription: ISubscription | null;
|
|
171
|
-
}
|
|
172
|
-
//# sourceMappingURL=workspace.d.ts.map
|