@devtable/settings-form 6.46.0 → 7.0.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.
@@ -1,7 +1,7 @@
1
- import { DataSourceType, IDataSource, IDataSourceConfig } from './datasource.typed';
1
+ import { DataSourceType, IDataSource, TDataSourceConfig } from './datasource.typed';
2
2
  import { PaginationResponse } from './types';
3
3
  export declare const datasource: {
4
4
  list: () => Promise<PaginationResponse<IDataSource>>;
5
- create: (type: DataSourceType, key: string, config: IDataSourceConfig) => Promise<PaginationResponse<IDataSource> | false>;
5
+ create: (type: DataSourceType, key: string, config: TDataSourceConfig) => Promise<PaginationResponse<IDataSource> | false>;
6
6
  delete: (id: string) => Promise<void>;
7
7
  };
@@ -5,10 +5,18 @@ export interface IDataSource {
5
5
  key: string;
6
6
  is_preset?: boolean;
7
7
  }
8
- export interface IDataSourceConfig {
8
+ export declare type TDataSourceConfig_DB = {
9
9
  host: string;
10
10
  port: number;
11
11
  username: string;
12
12
  password: string;
13
13
  database: string;
14
- }
14
+ };
15
+ export declare type TDataSourceConfig_HTTP = {
16
+ host: string;
17
+ processing: {
18
+ pre: TFunctionString;
19
+ post: TFunctionString;
20
+ };
21
+ };
22
+ export declare type TDataSourceConfig = TDataSourceConfig_DB | TDataSourceConfig_HTTP;
@@ -1,7 +1,7 @@
1
1
  export declare const APICaller: {
2
2
  datasource: {
3
3
  list: () => Promise<import("./types").PaginationResponse<import("./datasource.typed").IDataSource>>;
4
- create: (type: import("./datasource.typed").DataSourceType, key: string, config: import("./datasource.typed").IDataSourceConfig) => Promise<false | import("./types").PaginationResponse<import("./datasource.typed").IDataSource>>;
4
+ create: (type: import("./datasource.typed").DataSourceType, key: string, config: import("./datasource.typed").TDataSourceConfig) => Promise<false | import("./types").PaginationResponse<import("./datasource.typed").IDataSource>>;
5
5
  delete: (id: string) => Promise<void>;
6
6
  };
7
7
  account: {
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface IFunctionStringEditor {
3
+ value: string;
4
+ onChange: (v: string) => void;
5
+ }
6
+ export declare const FunctionStringEditor: ({ value, onChange }: IFunctionStringEditor) => JSX.Element;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { IStyles } from '../../../styles';
3
+ interface IFunctionStringField {
4
+ value: TFunctionString;
5
+ onChange: (v: TFunctionString) => void;
6
+ defaultValue: TFunctionString;
7
+ label: string;
8
+ modalTitle: string;
9
+ styles: IStyles;
10
+ }
11
+ export declare const FunctionStringField: import("react").ForwardRefExoticComponent<IFunctionStringField & import("react").RefAttributes<unknown>>;
12
+ export {};
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { DataSourceType, TDataSourceConfig } from '../../../api-caller/datasource.typed';
3
+ import { IStyles } from '../../styles';
4
+ interface IFormValues {
5
+ type: DataSourceType;
6
+ key: string;
7
+ config: TDataSourceConfig;
8
+ }
9
+ interface IAddDataSourceForm {
10
+ submit: (values: IFormValues) => void;
11
+ styles?: IStyles;
12
+ type: 'postgresql' | 'mysql';
13
+ }
14
+ export declare function AddDataSourceForm_DB({ submit, styles, type }: IAddDataSourceForm): JSX.Element;
15
+ export {};
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { DataSourceType, TDataSourceConfig_HTTP } from '../../../api-caller/datasource.typed';
3
+ import { IStyles } from '../../styles';
4
+ export declare const DEFAULT_HTTP_PROCESSING: {
5
+ pre: string;
6
+ post: string;
7
+ };
8
+ interface IFormValues {
9
+ type: DataSourceType;
10
+ key: string;
11
+ config: TDataSourceConfig_HTTP;
12
+ }
13
+ interface IAddDataSourceForm {
14
+ submit: (values: IFormValues) => void;
15
+ styles?: IStyles;
16
+ }
17
+ export declare function AddDataSourceForm_HTTP({ submit, styles }: IAddDataSourceForm): JSX.Element;
18
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { IStyles } from './styles';
2
+ import { IStyles } from '../styles';
3
3
  interface IAddDataSource {
4
4
  styles?: IStyles;
5
5
  onSuccess: () => void;
@@ -0,0 +1,6 @@
1
+ import { DataSourceType, TDataSourceConfig } from '../../api-caller/datasource.typed';
2
+ export interface IFormValues {
3
+ type: DataSourceType;
4
+ key: string;
5
+ config: TDataSourceConfig;
6
+ }
package/dist/global.d.ts CHANGED
@@ -6,3 +6,5 @@ interface ISettingsFormConfig {
6
6
  app_id?: string;
7
7
  app_secret?: string;
8
8
  }
9
+
10
+ type TFunctionString = string;
@@ -1,4 +1,4 @@
1
- const e = "@devtable/settings-form", s = "6.45.0", t = "Apache-2.0", i = {
1
+ const e = "@devtable/settings-form", s = "7.0.0", t = "Apache-2.0", i = {
2
2
  access: "public",
3
3
  registry: "https://registry.npmjs.org/"
4
4
  }, n = [