@oneclick.dev/cms-core-modules 0.0.19 → 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.
@@ -11,7 +11,15 @@ export declare const useModuleStorage: () => ReturnType<UseModuleStorage>;
11
11
  export declare const useLogs: () => ReturnType<UseLogs>;
12
12
  export declare const useUtilsService: () => ReturnType<UseUtilsService>;
13
13
  export declare const useFormBuilder: () => ReturnType<UseFormBuilder>;
14
- export declare const useFirebaseIntegration: UseFirebaseIntegration;
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
+ };
15
23
  type UseModulePermissions = () => {
16
24
  isAdmin: () => boolean;
17
25
  isSuperAdmin: () => boolean;
@@ -19,13 +27,6 @@ type UseModulePermissions = () => {
19
27
  hasPermissionOR: (...permissions: string[]) => boolean;
20
28
  hasPermissionAND: (...permissions: string[]) => boolean;
21
29
  };
22
- type UseFirebaseIntegration = (projectId: string) => {
23
- add: (collection: string, data: Record<string, any>) => Promise<any>;
24
- find: (collection: string, query?: Record<string, any>) => Promise<any>;
25
- get: (collection: string, doc: string) => Promise<any>;
26
- update: (collection: string, id: string, data: Record<string, any>) => Promise<any>;
27
- remove: (collection: string, id: string) => Promise<any>;
28
- };
29
30
  type UseNavigateToModuleRoute = () => {
30
31
  navigateTo: (path?: string | number) => void;
31
32
  basePath: string;
@@ -54,4 +55,20 @@ type UseFormBuilder = () => {
54
55
  openFormBuilder: (config?: any) => Promise<any>;
55
56
  closeFormBuilder: (id: number, result: any) => void;
56
57
  };
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,2 +1,43 @@
1
- import { ModuleSettingsSchema } from '../types';
2
- export declare const config: ModuleSettingsSchema;
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: import('../types').ModuleSettingsSchema;
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.19",
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",