@fctc/interface-logic 1.2.8 → 1.2.10

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,15 +0,0 @@
1
- import * as _tanstack_react_query from '@tanstack/react-query';
2
-
3
- type GetSelectionType = {
4
- domain: any;
5
- context: any;
6
- model: string;
7
- specification?: any;
8
- };
9
- declare const useGetSelection: ({ data, queryKey, enabled, }: {
10
- data: GetSelectionType;
11
- queryKey: any[];
12
- enabled?: boolean;
13
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
14
-
15
- export { type GetSelectionType as G, useGetSelection as u };
package/dist/utils.d.mts DELETED
@@ -1,96 +0,0 @@
1
- import { C as Context } from './context-type-D5XefoL-.mjs';
2
- export { L as LocalStorageUtilsType, S as SessionStorageUtilsType, l as localStorageUtils, s as sessionStorageUtils } from './session-storage-CxkkEmQh.mjs';
3
-
4
- declare class WesapError extends Error {
5
- code: number;
6
- constructor(message: string, code: number);
7
- }
8
- declare function handleError(error: Error, env: {
9
- services: {
10
- notification: {
11
- error: (message: string) => void;
12
- };
13
- };
14
- }): void;
15
-
16
- declare const formatCurrency: (amount: number, currency?: string) => string;
17
- declare const formatDate: (date: string | Date, locale?: string) => string;
18
- declare const validateAndParseDate: (input: string, isDateTime?: boolean) => string | null;
19
-
20
- type AST = {
21
- type: number;
22
- value: any;
23
- };
24
- type Condition = [string | 0 | 1, string, any];
25
- type DomainListRepr = ('&' | '|' | '!' | Condition)[];
26
- type DomainRepr = DomainListRepr | string | Domain;
27
- declare class Domain {
28
- ast: AST;
29
- static TRUE: Domain;
30
- static FALSE: Domain;
31
- static combine(domains: DomainRepr[], operator: 'AND' | 'OR'): Domain;
32
- static and(domains: DomainRepr[]): Domain;
33
- static or(domains: DomainRepr[]): Domain;
34
- static not(domain: DomainRepr): Domain;
35
- static removeDomainLeaves(domain: DomainRepr, keysToRemove: string[]): Domain;
36
- constructor(descr?: DomainRepr);
37
- contains(record: any): boolean;
38
- toString(): string;
39
- toList(context: Record<string, any>): DomainListRepr;
40
- toJson(): DomainListRepr | string;
41
- }
42
-
43
- declare const evalJSONContext: (_context: any, context?: {}) => Context | null;
44
- declare const evalJSONDomain: (domain: any, context: any) => any;
45
- declare const formatSortingString: (input: string | null | undefined) => string | null;
46
- declare const domainHelper: {
47
- checkDomain: (context: any, domain: any) => boolean;
48
- matchDomains: (context: any, domains: any) => boolean;
49
- Domain: typeof Domain;
50
- };
51
- declare const toQueryString: (params: Record<string, string | number | boolean>) => string;
52
- declare const convertFloatToTime: (floatValue: number) => string;
53
- declare const convertTimeToFloat: (timeString: string) => number;
54
- declare const stringToColor: (name: string, id: number) => string;
55
- declare const getFieldsOnChange: (fields: any) => any;
56
- declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, }: {
57
- id?: any;
58
- viewData?: any;
59
- formValues?: any;
60
- dirtyFields?: any;
61
- model?: any;
62
- defaultData?: any;
63
- }) => any;
64
- type MergeableObject = {
65
- [key: string]: any;
66
- } | null | undefined;
67
- declare const mergeObjects: <T extends MergeableObject, U extends MergeableObject>(object1: T, object2: U) => (T & U) | undefined;
68
- declare const formatUrlPath: ({ viewType, aid, model, id, actionPath, }: {
69
- viewType: "list" | "form" | "kanban" | any;
70
- actionPath: string;
71
- aid: string | number;
72
- model: string;
73
- id?: string | number;
74
- }) => string;
75
- declare const removeUndefinedFields: <T extends Record<string, any>>(obj: T) => Partial<T>;
76
- declare const useTabModel: (viewData: any, onchangeData: any) => any;
77
- declare const isBase64File: (str: any) => boolean;
78
- declare const isBase64Image: (str: any) => boolean;
79
- declare const checkIsImageLink: (url: any) => boolean;
80
- declare const formatFileSize: (size: any) => string;
81
- declare const getSubdomain: (url?: string) => string | null;
82
- declare const resequence: (arr: any, start: any, end: any) => any;
83
- declare const getOffSet: (arr: any, start: any, end: any) => any;
84
- declare const copyTextToClipboard: (text: string) => Promise<void>;
85
- declare const updateTokenParamInOriginalRequest: (originalRequest: {
86
- data?: any;
87
- }, newAccessToken: string) => any;
88
- declare const isObjectEmpty: (obj: object) => boolean;
89
- declare const useField: (props: any) => {
90
- invisible: boolean;
91
- required: boolean;
92
- readonly: boolean;
93
- nameField: string | null;
94
- };
95
-
96
- export { WesapError, checkIsImageLink, convertFloatToTime, convertTimeToFloat, copyTextToClipboard, domainHelper, evalJSONContext, evalJSONDomain, filterFieldDirty, formatCurrency, formatDate, formatFileSize, formatSortingString, formatUrlPath, getFieldsOnChange, getOffSet, getSubdomain, handleError, isBase64File, isBase64Image, isObjectEmpty, mergeObjects, removeUndefinedFields, resequence, stringToColor, toQueryString, updateTokenParamInOriginalRequest, useField, useTabModel, validateAndParseDate };
package/dist/utils.d.ts DELETED
@@ -1,96 +0,0 @@
1
- import { C as Context } from './context-type-D5XefoL-.js';
2
- export { L as LocalStorageUtilsType, S as SessionStorageUtilsType, l as localStorageUtils, s as sessionStorageUtils } from './session-storage-CxkkEmQh.js';
3
-
4
- declare class WesapError extends Error {
5
- code: number;
6
- constructor(message: string, code: number);
7
- }
8
- declare function handleError(error: Error, env: {
9
- services: {
10
- notification: {
11
- error: (message: string) => void;
12
- };
13
- };
14
- }): void;
15
-
16
- declare const formatCurrency: (amount: number, currency?: string) => string;
17
- declare const formatDate: (date: string | Date, locale?: string) => string;
18
- declare const validateAndParseDate: (input: string, isDateTime?: boolean) => string | null;
19
-
20
- type AST = {
21
- type: number;
22
- value: any;
23
- };
24
- type Condition = [string | 0 | 1, string, any];
25
- type DomainListRepr = ('&' | '|' | '!' | Condition)[];
26
- type DomainRepr = DomainListRepr | string | Domain;
27
- declare class Domain {
28
- ast: AST;
29
- static TRUE: Domain;
30
- static FALSE: Domain;
31
- static combine(domains: DomainRepr[], operator: 'AND' | 'OR'): Domain;
32
- static and(domains: DomainRepr[]): Domain;
33
- static or(domains: DomainRepr[]): Domain;
34
- static not(domain: DomainRepr): Domain;
35
- static removeDomainLeaves(domain: DomainRepr, keysToRemove: string[]): Domain;
36
- constructor(descr?: DomainRepr);
37
- contains(record: any): boolean;
38
- toString(): string;
39
- toList(context: Record<string, any>): DomainListRepr;
40
- toJson(): DomainListRepr | string;
41
- }
42
-
43
- declare const evalJSONContext: (_context: any, context?: {}) => Context | null;
44
- declare const evalJSONDomain: (domain: any, context: any) => any;
45
- declare const formatSortingString: (input: string | null | undefined) => string | null;
46
- declare const domainHelper: {
47
- checkDomain: (context: any, domain: any) => boolean;
48
- matchDomains: (context: any, domains: any) => boolean;
49
- Domain: typeof Domain;
50
- };
51
- declare const toQueryString: (params: Record<string, string | number | boolean>) => string;
52
- declare const convertFloatToTime: (floatValue: number) => string;
53
- declare const convertTimeToFloat: (timeString: string) => number;
54
- declare const stringToColor: (name: string, id: number) => string;
55
- declare const getFieldsOnChange: (fields: any) => any;
56
- declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, }: {
57
- id?: any;
58
- viewData?: any;
59
- formValues?: any;
60
- dirtyFields?: any;
61
- model?: any;
62
- defaultData?: any;
63
- }) => any;
64
- type MergeableObject = {
65
- [key: string]: any;
66
- } | null | undefined;
67
- declare const mergeObjects: <T extends MergeableObject, U extends MergeableObject>(object1: T, object2: U) => (T & U) | undefined;
68
- declare const formatUrlPath: ({ viewType, aid, model, id, actionPath, }: {
69
- viewType: "list" | "form" | "kanban" | any;
70
- actionPath: string;
71
- aid: string | number;
72
- model: string;
73
- id?: string | number;
74
- }) => string;
75
- declare const removeUndefinedFields: <T extends Record<string, any>>(obj: T) => Partial<T>;
76
- declare const useTabModel: (viewData: any, onchangeData: any) => any;
77
- declare const isBase64File: (str: any) => boolean;
78
- declare const isBase64Image: (str: any) => boolean;
79
- declare const checkIsImageLink: (url: any) => boolean;
80
- declare const formatFileSize: (size: any) => string;
81
- declare const getSubdomain: (url?: string) => string | null;
82
- declare const resequence: (arr: any, start: any, end: any) => any;
83
- declare const getOffSet: (arr: any, start: any, end: any) => any;
84
- declare const copyTextToClipboard: (text: string) => Promise<void>;
85
- declare const updateTokenParamInOriginalRequest: (originalRequest: {
86
- data?: any;
87
- }, newAccessToken: string) => any;
88
- declare const isObjectEmpty: (obj: object) => boolean;
89
- declare const useField: (props: any) => {
90
- invisible: boolean;
91
- required: boolean;
92
- readonly: boolean;
93
- nameField: string | null;
94
- };
95
-
96
- export { WesapError, checkIsImageLink, convertFloatToTime, convertTimeToFloat, copyTextToClipboard, domainHelper, evalJSONContext, evalJSONDomain, filterFieldDirty, formatCurrency, formatDate, formatFileSize, formatSortingString, formatUrlPath, getFieldsOnChange, getOffSet, getSubdomain, handleError, isBase64File, isBase64Image, isObjectEmpty, mergeObjects, removeUndefinedFields, resequence, stringToColor, toQueryString, updateTokenParamInOriginalRequest, useField, useTabModel, validateAndParseDate };
@@ -1,106 +0,0 @@
1
- interface Specification {
2
- [key: string]: any;
3
- }
4
- interface ContextApi {
5
- [key: string]: any;
6
- }
7
- interface GetAllParams {
8
- model?: string;
9
- ids?: number[];
10
- specification: Specification;
11
- domain?: any[];
12
- offset?: number;
13
- sort: any;
14
- fields: any;
15
- groupby: any;
16
- context?: ContextApi;
17
- limit?: number;
18
- }
19
- interface GetListParams {
20
- model: string;
21
- ids?: number[];
22
- specification?: Specification;
23
- domain?: any[];
24
- offset?: number;
25
- order?: string;
26
- context?: ContextApi;
27
- limit?: number;
28
- }
29
- interface GetDetailParams {
30
- ids?: number[];
31
- model?: string;
32
- specification?: Specification;
33
- context?: ContextApi;
34
- }
35
- interface SaveParams {
36
- model: string;
37
- ids?: number[] | [];
38
- data?: Record<string, any>;
39
- specification?: Specification;
40
- context?: ContextApi;
41
- }
42
- interface DeleteParams {
43
- ids?: number[];
44
- model: string;
45
- }
46
- interface OnChangeParams {
47
- ids?: number[];
48
- model: string;
49
- object?: Record<string, any>;
50
- specification: Specification;
51
- context?: ContextApi;
52
- fieldChange?: string[];
53
- }
54
- interface ViewData {
55
- models?: {
56
- [key: string]: {
57
- [key: string]: {
58
- type: string;
59
- relation?: string;
60
- };
61
- };
62
- };
63
- }
64
-
65
- interface LoginCredentialBody {
66
- email: string;
67
- password: string;
68
- path?: string;
69
- }
70
- interface ResetPasswordRequest {
71
- password: string;
72
- confirmPassword: string;
73
- }
74
- interface UpdatePasswordRequest {
75
- newPassword: string;
76
- oldPassword: string;
77
- }
78
- interface ForgotPasswordBody {
79
- data: ResetPasswordRequest;
80
- token: string | null;
81
- }
82
- interface updatePasswordBody {
83
- data: UpdatePasswordRequest;
84
- token: string | null;
85
- }
86
- interface SocialTokenBody {
87
- state: object;
88
- access_token: string;
89
- db: string;
90
- }
91
-
92
- type View = [number | boolean, string];
93
- type Option = {
94
- action_id?: number;
95
- load_filters?: boolean;
96
- toolbar?: boolean;
97
- };
98
- interface GetViewParams {
99
- model?: string;
100
- views?: View[];
101
- context?: Record<string, any>;
102
- options?: Option;
103
- aid?: number | string | null | boolean;
104
- }
105
-
106
- export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetAllParams as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SaveParams as S, UpdatePasswordRequest as U, View as V, GetDetailParams as a, GetListParams as b, GetViewParams as c, SocialTokenBody as d, Specification as e, ViewData as f, updatePasswordBody as u };
@@ -1,106 +0,0 @@
1
- interface Specification {
2
- [key: string]: any;
3
- }
4
- interface ContextApi {
5
- [key: string]: any;
6
- }
7
- interface GetAllParams {
8
- model?: string;
9
- ids?: number[];
10
- specification: Specification;
11
- domain?: any[];
12
- offset?: number;
13
- sort: any;
14
- fields: any;
15
- groupby: any;
16
- context?: ContextApi;
17
- limit?: number;
18
- }
19
- interface GetListParams {
20
- model: string;
21
- ids?: number[];
22
- specification?: Specification;
23
- domain?: any[];
24
- offset?: number;
25
- order?: string;
26
- context?: ContextApi;
27
- limit?: number;
28
- }
29
- interface GetDetailParams {
30
- ids?: number[];
31
- model?: string;
32
- specification?: Specification;
33
- context?: ContextApi;
34
- }
35
- interface SaveParams {
36
- model: string;
37
- ids?: number[] | [];
38
- data?: Record<string, any>;
39
- specification?: Specification;
40
- context?: ContextApi;
41
- }
42
- interface DeleteParams {
43
- ids?: number[];
44
- model: string;
45
- }
46
- interface OnChangeParams {
47
- ids?: number[];
48
- model: string;
49
- object?: Record<string, any>;
50
- specification: Specification;
51
- context?: ContextApi;
52
- fieldChange?: string[];
53
- }
54
- interface ViewData {
55
- models?: {
56
- [key: string]: {
57
- [key: string]: {
58
- type: string;
59
- relation?: string;
60
- };
61
- };
62
- };
63
- }
64
-
65
- interface LoginCredentialBody {
66
- email: string;
67
- password: string;
68
- path?: string;
69
- }
70
- interface ResetPasswordRequest {
71
- password: string;
72
- confirmPassword: string;
73
- }
74
- interface UpdatePasswordRequest {
75
- newPassword: string;
76
- oldPassword: string;
77
- }
78
- interface ForgotPasswordBody {
79
- data: ResetPasswordRequest;
80
- token: string | null;
81
- }
82
- interface updatePasswordBody {
83
- data: UpdatePasswordRequest;
84
- token: string | null;
85
- }
86
- interface SocialTokenBody {
87
- state: object;
88
- access_token: string;
89
- db: string;
90
- }
91
-
92
- type View = [number | boolean, string];
93
- type Option = {
94
- action_id?: number;
95
- load_filters?: boolean;
96
- toolbar?: boolean;
97
- };
98
- interface GetViewParams {
99
- model?: string;
100
- views?: View[];
101
- context?: Record<string, any>;
102
- options?: Option;
103
- aid?: number | string | null | boolean;
104
- }
105
-
106
- export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetAllParams as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SaveParams as S, UpdatePasswordRequest as U, View as V, GetDetailParams as a, GetListParams as b, GetViewParams as c, SocialTokenBody as d, Specification as e, ViewData as f, updatePasswordBody as u };