@oneclick.dev/cms-core-modules 0.0.18 → 0.0.20
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.cjs.js +7 -7
- package/dist/index.mjs +2726 -2713
- package/dist/src/lib/composables.d.ts +31 -14
- package/dist/src/products/index.d.ts +19 -1
- package/dist/src/products/index.vue.d.ts +21 -1
- package/dist/src/table/config.d.ts +43 -2
- package/dist/src/table/index.d.ts +43 -3
- package/dist/src/table/routes.d.ts +2 -2
- package/dist/src/types/index.d.ts +5 -0
- package/package.json +2 -2
|
@@ -5,6 +5,21 @@ export declare const useMediaLibrary: () => any;
|
|
|
5
5
|
export declare const useProjectService: () => any;
|
|
6
6
|
export declare const useBreadcrumbs: () => any;
|
|
7
7
|
export declare const useQueryBuilder: () => any;
|
|
8
|
+
export declare const useModulePermissions: () => ReturnType<UseModulePermissions>;
|
|
9
|
+
export declare const useNavigateToModuleRoute: () => ReturnType<UseNavigateToModuleRoute>;
|
|
10
|
+
export declare const useModuleStorage: () => ReturnType<UseModuleStorage>;
|
|
11
|
+
export declare const useLogs: () => ReturnType<UseLogs>;
|
|
12
|
+
export declare const useUtilsService: () => ReturnType<UseUtilsService>;
|
|
13
|
+
export declare const useFormBuilder: () => ReturnType<UseFormBuilder>;
|
|
14
|
+
export declare const useFlowBuilder: () => ReturnType<UseFlowBuilder>;
|
|
15
|
+
export declare const useConfirmation: () => ReturnType<UseConfirmation>;
|
|
16
|
+
export declare const useFirebaseIntegration: (projectId: string) => {
|
|
17
|
+
add: (collection: string, data: Record<string, any>) => Promise<any>;
|
|
18
|
+
find: (collection: string, query?: Record<string, any>) => Promise<any>;
|
|
19
|
+
get: (collection: string, doc: string) => Promise<any>;
|
|
20
|
+
update: (collection: string, id: string, data: Record<string, any>) => Promise<any>;
|
|
21
|
+
remove: (collection: string, id: string) => Promise<any>;
|
|
22
|
+
};
|
|
8
23
|
type UseModulePermissions = () => {
|
|
9
24
|
isAdmin: () => boolean;
|
|
10
25
|
isSuperAdmin: () => boolean;
|
|
@@ -12,46 +27,48 @@ type UseModulePermissions = () => {
|
|
|
12
27
|
hasPermissionOR: (...permissions: string[]) => boolean;
|
|
13
28
|
hasPermissionAND: (...permissions: string[]) => boolean;
|
|
14
29
|
};
|
|
15
|
-
export declare const useModulePermissions: () => UseModulePermissions;
|
|
16
|
-
type UseFirebaseIntegration = (projectId: string) => {
|
|
17
|
-
add: (collection: string, data: Record<string, any>) => Promise<any>;
|
|
18
|
-
find: (collection: string, query?: Record<string, any>) => Promise<any>;
|
|
19
|
-
get: (collection: string, doc: string) => Promise<any>;
|
|
20
|
-
update: (collection: string, id: string, data: Record<string, any>) => Promise<any>;
|
|
21
|
-
remove: (collection: string, id: string) => Promise<any>;
|
|
22
|
-
};
|
|
23
|
-
export declare const useFirebaseIntegration: () => UseFirebaseIntegration;
|
|
24
30
|
type UseNavigateToModuleRoute = () => {
|
|
25
31
|
navigateTo: (path?: string | number) => void;
|
|
26
32
|
basePath: string;
|
|
27
33
|
params: Record<string, string>;
|
|
28
34
|
pageComponent: any;
|
|
29
35
|
};
|
|
30
|
-
export declare const useNavigateToModuleRoute: () => UseNavigateToModuleRoute;
|
|
31
36
|
type UseModuleStorage = () => {
|
|
32
37
|
getModuleData: (key: string) => any;
|
|
33
38
|
setModuleData: (key: string, value: any) => void;
|
|
34
39
|
removeModuleData: (key: string) => void;
|
|
35
40
|
clearModuleData: () => void;
|
|
36
41
|
};
|
|
37
|
-
export declare const useModuleStorage: () => UseModuleStorage;
|
|
38
42
|
type UseLogs = () => {
|
|
39
43
|
log: (message: string, data?: any) => void;
|
|
40
44
|
logWarning: (message: string, data?: any) => void;
|
|
41
45
|
logError: (message: string, data?: any) => void;
|
|
42
46
|
};
|
|
43
|
-
export declare const useLogs: () => UseLogs;
|
|
44
47
|
type UseUtilsService = () => {
|
|
45
48
|
urlToBase64: (url: string) => Promise<{
|
|
46
49
|
base64: string;
|
|
47
50
|
contentType: string;
|
|
48
51
|
}>;
|
|
49
52
|
};
|
|
50
|
-
export declare const useUtilsService: () => UseUtilsService;
|
|
51
53
|
type UseFormBuilder = () => {
|
|
52
54
|
formBuilderStack: any[];
|
|
53
55
|
openFormBuilder: (config?: any) => Promise<any>;
|
|
54
56
|
closeFormBuilder: (id: number, result: any) => void;
|
|
55
57
|
};
|
|
56
|
-
|
|
58
|
+
type UseFlowBuilder = () => {
|
|
59
|
+
flowBuilderStack: FlowBuilderState[];
|
|
60
|
+
openFlowBuilder: (workflow: any, config?: any) => Promise<any>;
|
|
61
|
+
closeFlowBuilder: (id: number, result: any) => void;
|
|
62
|
+
runFlow: (workflow: any, context: any) => Promise<any>;
|
|
63
|
+
};
|
|
64
|
+
type UseConfirmation = () => {
|
|
65
|
+
confirm: (message: string, title?: string, confirmText?: string) => Promise<boolean>;
|
|
66
|
+
};
|
|
67
|
+
interface FlowBuilderState {
|
|
68
|
+
id: number;
|
|
69
|
+
show: boolean;
|
|
70
|
+
config: any;
|
|
71
|
+
workflow: any;
|
|
72
|
+
resolve: ((val: any) => void) | null;
|
|
73
|
+
}
|
|
57
74
|
export {};
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
export declare const products: {
|
|
2
|
-
component: import('vue').DefineComponent<
|
|
2
|
+
component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
config: {
|
|
4
|
+
type: ObjectConstructor;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
routes: {
|
|
8
|
+
type: import('vue').PropType<ModuleRoute[]>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
12
|
+
config: {
|
|
13
|
+
type: ObjectConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
routes: {
|
|
17
|
+
type: import('vue').PropType<ModuleRoute[]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
3
21
|
metadata: ModuleMetadata;
|
|
4
22
|
config: {
|
|
5
23
|
readonly project: {
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ModuleRoute } from '~/types';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
config: {
|
|
5
|
+
type: ObjectConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
routes: {
|
|
9
|
+
type: PropType<ModuleRoute[]>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
config: {
|
|
14
|
+
type: ObjectConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
routes: {
|
|
18
|
+
type: PropType<ModuleRoute[]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
22
|
export default _default;
|
|
@@ -1,2 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const config:
|
|
1
|
+
import { ResolvedConfig } from '../types';
|
|
2
|
+
export declare const config: {
|
|
3
|
+
readonly getItems: {
|
|
4
|
+
readonly label: "Fetch items";
|
|
5
|
+
readonly type: "flow";
|
|
6
|
+
};
|
|
7
|
+
readonly viewable: {
|
|
8
|
+
readonly label: "Viewable";
|
|
9
|
+
readonly type: "checkbox";
|
|
10
|
+
readonly default: false;
|
|
11
|
+
};
|
|
12
|
+
readonly editable: {
|
|
13
|
+
readonly label: "Editable";
|
|
14
|
+
readonly type: "checkbox";
|
|
15
|
+
readonly default: false;
|
|
16
|
+
};
|
|
17
|
+
readonly deletable: {
|
|
18
|
+
readonly label: "Deletable";
|
|
19
|
+
readonly type: "checkbox";
|
|
20
|
+
readonly default: false;
|
|
21
|
+
};
|
|
22
|
+
readonly addable: {
|
|
23
|
+
readonly label: "Addable";
|
|
24
|
+
readonly type: "checkbox";
|
|
25
|
+
readonly default: false;
|
|
26
|
+
};
|
|
27
|
+
readonly searchable: {
|
|
28
|
+
readonly label: "Searchable";
|
|
29
|
+
readonly type: "checkbox";
|
|
30
|
+
readonly default: false;
|
|
31
|
+
};
|
|
32
|
+
readonly downloadable: {
|
|
33
|
+
readonly label: "Downloadable";
|
|
34
|
+
readonly type: "checkbox";
|
|
35
|
+
readonly default: false;
|
|
36
|
+
};
|
|
37
|
+
readonly allowBulkActions: {
|
|
38
|
+
readonly label: "Allow Bulk Actions";
|
|
39
|
+
readonly type: "checkbox";
|
|
40
|
+
readonly default: false;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type ConfigValues = ResolvedConfig<typeof config>;
|
|
@@ -19,17 +19,57 @@ export declare const table: {
|
|
|
19
19
|
};
|
|
20
20
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
21
21
|
metadata: import('../types').ModuleMetadata;
|
|
22
|
-
config:
|
|
22
|
+
config: {
|
|
23
|
+
readonly getItems: {
|
|
24
|
+
readonly label: "Fetch items";
|
|
25
|
+
readonly type: "flow";
|
|
26
|
+
};
|
|
27
|
+
readonly viewable: {
|
|
28
|
+
readonly label: "Viewable";
|
|
29
|
+
readonly type: "checkbox";
|
|
30
|
+
readonly default: false;
|
|
31
|
+
};
|
|
32
|
+
readonly editable: {
|
|
33
|
+
readonly label: "Editable";
|
|
34
|
+
readonly type: "checkbox";
|
|
35
|
+
readonly default: false;
|
|
36
|
+
};
|
|
37
|
+
readonly deletable: {
|
|
38
|
+
readonly label: "Deletable";
|
|
39
|
+
readonly type: "checkbox";
|
|
40
|
+
readonly default: false;
|
|
41
|
+
};
|
|
42
|
+
readonly addable: {
|
|
43
|
+
readonly label: "Addable";
|
|
44
|
+
readonly type: "checkbox";
|
|
45
|
+
readonly default: false;
|
|
46
|
+
};
|
|
47
|
+
readonly searchable: {
|
|
48
|
+
readonly label: "Searchable";
|
|
49
|
+
readonly type: "checkbox";
|
|
50
|
+
readonly default: false;
|
|
51
|
+
};
|
|
52
|
+
readonly downloadable: {
|
|
53
|
+
readonly label: "Downloadable";
|
|
54
|
+
readonly type: "checkbox";
|
|
55
|
+
readonly default: false;
|
|
56
|
+
};
|
|
57
|
+
readonly allowBulkActions: {
|
|
58
|
+
readonly label: "Allow Bulk Actions";
|
|
59
|
+
readonly type: "checkbox";
|
|
60
|
+
readonly default: false;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
23
63
|
routes: {
|
|
24
64
|
path: string;
|
|
25
65
|
component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
26
66
|
config: {
|
|
27
|
-
type: import('vue').PropType<ConfigValues>;
|
|
67
|
+
type: import('vue').PropType<import('./config').ConfigValues>;
|
|
28
68
|
required: true;
|
|
29
69
|
};
|
|
30
70
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
31
71
|
config: {
|
|
32
|
-
type: import('vue').PropType<ConfigValues>;
|
|
72
|
+
type: import('vue').PropType<import('./config').ConfigValues>;
|
|
33
73
|
required: true;
|
|
34
74
|
};
|
|
35
75
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
@@ -2,12 +2,12 @@ declare const _default: {
|
|
|
2
2
|
path: string;
|
|
3
3
|
component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
config: {
|
|
5
|
-
type: import('vue').PropType<ConfigValues>;
|
|
5
|
+
type: import('vue').PropType<import('./config').ConfigValues>;
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
9
9
|
config: {
|
|
10
|
-
type: import('vue').PropType<ConfigValues>;
|
|
10
|
+
type: import('vue').PropType<import('./config').ConfigValues>;
|
|
11
11
|
required: true;
|
|
12
12
|
};
|
|
13
13
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
@@ -58,3 +58,8 @@ export interface FlowSetting extends BaseSetting<any> {
|
|
|
58
58
|
}
|
|
59
59
|
export type ModuleSetting = SelectSetting | CheckboxSetting | InputSetting | NumberSetting | ResourceSetting | MediaSourceSetting | DataQuerySetting | FlowSetting;
|
|
60
60
|
export type ModuleSettingsSchema = Record<string, ModuleSetting>;
|
|
61
|
+
type Widen<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
|
|
62
|
+
export type ResolvedConfig<TSchema extends ModuleSettingsSchema> = {
|
|
63
|
+
[K in keyof TSchema]: Widen<TSchema[K]['default']>;
|
|
64
|
+
};
|
|
65
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneclick.dev/cms-core-modules",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@formkit/drag-and-drop": "^0.5.3",
|
|
24
|
-
"@oneclick.dev/cms-kit": "0.0.
|
|
24
|
+
"@oneclick.dev/cms-kit": "0.0.24",
|
|
25
25
|
"@internationalized/date": "^3.8.0",
|
|
26
26
|
"@tanstack/vue-table": "^8.21.3",
|
|
27
27
|
"@vee-validate/zod": "^4.15.0",
|