@fctc/interface-logic 1.5.1 → 1.5.2

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.
@@ -0,0 +1,131 @@
1
+ declare enum KeyConstants {
2
+ PROFILE = "userinfo",
3
+ CURRENT_COMPANY = "current_company",
4
+ LIST_COMPANY = "list_company",
5
+ COMPANY_INFO = "company_info",
6
+ MENU = "menus",
7
+ GET_VIEW_BY_ACTION = "get_view_by_action",
8
+ ACTION_DETAIL = "action_detail",
9
+ GET_DATA_SELECTION = "get_data_select",
10
+ WEB_SAVE = "web_save",
11
+ WEB_READ = "web_read",
12
+ GET_PROVIDER = "get_provider"
13
+ }
14
+
15
+ declare enum MethodConstants {
16
+ WEB_SEARCH_READ = "web_search_read",
17
+ WEB_READ_GROUP = "web_read_group",
18
+ WEB_READ = "web_read",
19
+ WEB_SAVE = "web_save",
20
+ UNLINK = "unlink",
21
+ ONCHANGE = "onchange",
22
+ GET_ONCHANGE_FIELDS = "get_fields_onchange",
23
+ GET_FIELD_VIEW = "get_fields_view_v2"
24
+ }
25
+
26
+ declare enum UriConstants {
27
+ AUTH_TOKEN_PATH = "/authentication/oauth2/token",
28
+ GENTOKEN_SOCIAL = "/token/generate",
29
+ CALL_PATH = "/call",
30
+ COMPANY_PATH = "/company",
31
+ PROFILE_PATH = "/userinfo",
32
+ RESET_PASSWORD_PATH = "/reset_password",
33
+ CHANGE_PASSWORD_PATH = "/change_password",
34
+ UPDATE_PASSWORD_PATH = "/change_password_parent",
35
+ LOAD_ACTION = "/load_action",
36
+ REPORT_PATH = "/report",
37
+ RUN_ACTION_PATH = "/run_action",
38
+ UPLOAD_FILE_PATH = "/upload/file",
39
+ GET_MESSAGE = "/chatter/thread/messages",
40
+ SENT_MESSAGE = "/chatter/message/post",
41
+ UPLOAD_IMAGE = "/mail/attachment/upload",
42
+ DELETE_MESSAGE = "/chatter/message/update_content",
43
+ IMAGE_PATH = "/web/image",
44
+ LOAD_MESSAGE = "/load_message_failures",
45
+ TOKEN = "/check_token",
46
+ CREATE_UPDATE_PATH = "/create_update",
47
+ TWOFA_METHOD_PATH = "/id/api/v2/call",
48
+ SIGNIN_SSO = "/signin-sso/oauth",
49
+ GRANT_ACCESS = "/grant-access",
50
+ TOKEN_BY_CODE = "/token",
51
+ LOGOUT = "/logout"
52
+ }
53
+
54
+ declare enum FieldTypeConstants {
55
+ CHAR = "char",
56
+ TEXT = "text",
57
+ INTEGER = "integer",
58
+ FLOAT = "float",
59
+ BOOLEAN = "boolean",
60
+ DATE = "date",
61
+ DATETIME = "datetime",
62
+ BINARY = "binary",
63
+ SELECTION = "selection",
64
+ HTML = "html",
65
+ MANY2ONE = "many2one",
66
+ ONE2MANY = "one2many",
67
+ MANY2MANY = "many2many",
68
+ MONETARY = "monetary",
69
+ REFERENCE = "reference",
70
+ FUNCTION = "function",
71
+ PROPERTY = "property"
72
+ }
73
+
74
+ declare enum MethodType {
75
+ CREATE = 0,
76
+ UPDATE = 1,
77
+ DELETE = 2,
78
+ UNLINK = 3,
79
+ NO_CHANGE = 4
80
+ }
81
+
82
+ declare enum ModelConstants {
83
+ MENU = "ir.ui.menu",
84
+ USER = "res.users",
85
+ COMPANY = "res.company",
86
+ WINDOW_ACTION = "ir.actions.act_window",
87
+ BASE_IMPORT = "base_import.import",
88
+ GET_IMPORT = "get_import_templates"
89
+ }
90
+
91
+ declare enum ComponentType {
92
+ GROUP = "group",
93
+ FIELD = "field",
94
+ TREE = "tree",
95
+ DIV = "div",
96
+ LIST = "list",
97
+ FORM = "form",
98
+ SETTINGS = "setting",
99
+ SPAN = "span",
100
+ KANBAN = "kanban",
101
+ CALENDAR = "calendar",
102
+ TYPE = "view-type"
103
+ }
104
+ declare const SearchType: {
105
+ FILTER: string;
106
+ SEARCH: string;
107
+ GROUP: string;
108
+ };
109
+
110
+ declare enum WIDGETAVATAR {
111
+ many2one_avatar_user = "many2one_avatar_user",
112
+ many2many_avatar_user = "many2many_avatar_user"
113
+ }
114
+ declare enum WIDGETCURRENCY {
115
+ many2one_avatar_user = "many2one_avatar_user",
116
+ many2many_avatar_user = "many2many_avatar_user"
117
+ }
118
+
119
+ declare enum WIDGETCOLOR {
120
+ many2many_tags = "many2many_tags",
121
+ helpdesk_sla_many2many_tags = "helpdesk_sla_many2many_tags"
122
+ }
123
+
124
+ declare enum WIDGETSTATUS {
125
+ sla_status_ids = "sla_status_ids"
126
+ }
127
+ declare enum WIDGETNOSTRING {
128
+ sla_status_ids = "sla_status_ids"
129
+ }
130
+
131
+ export { ComponentType, FieldTypeConstants, KeyConstants, MethodConstants, MethodType, ModelConstants, SearchType, UriConstants, WIDGETAVATAR, WIDGETCOLOR, WIDGETCURRENCY, WIDGETNOSTRING, WIDGETSTATUS };
@@ -0,0 +1,166 @@
1
+ // src/constants/api/key-constant.ts
2
+ var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
3
+ KeyConstants2["PROFILE"] = "userinfo";
4
+ KeyConstants2["CURRENT_COMPANY"] = "current_company";
5
+ KeyConstants2["LIST_COMPANY"] = "list_company";
6
+ KeyConstants2["COMPANY_INFO"] = "company_info";
7
+ KeyConstants2["MENU"] = "menus";
8
+ KeyConstants2["GET_VIEW_BY_ACTION"] = "get_view_by_action";
9
+ KeyConstants2["ACTION_DETAIL"] = "action_detail";
10
+ KeyConstants2["GET_DATA_SELECTION"] = "get_data_select";
11
+ KeyConstants2["WEB_SAVE"] = "web_save";
12
+ KeyConstants2["WEB_READ"] = "web_read";
13
+ KeyConstants2["GET_PROVIDER"] = "get_provider";
14
+ return KeyConstants2;
15
+ })(KeyConstants || {});
16
+
17
+ // src/constants/api/method-constant.ts
18
+ var MethodConstants = /* @__PURE__ */ ((MethodConstants2) => {
19
+ MethodConstants2["WEB_SEARCH_READ"] = "web_search_read";
20
+ MethodConstants2["WEB_READ_GROUP"] = "web_read_group";
21
+ MethodConstants2["WEB_READ"] = "web_read";
22
+ MethodConstants2["WEB_SAVE"] = "web_save";
23
+ MethodConstants2["UNLINK"] = "unlink";
24
+ MethodConstants2["ONCHANGE"] = "onchange";
25
+ MethodConstants2["GET_ONCHANGE_FIELDS"] = "get_fields_onchange";
26
+ MethodConstants2["GET_FIELD_VIEW"] = "get_fields_view_v2";
27
+ return MethodConstants2;
28
+ })(MethodConstants || {});
29
+
30
+ // src/constants/api/uri-constant.ts
31
+ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
32
+ UriConstants2["AUTH_TOKEN_PATH"] = "/authentication/oauth2/token";
33
+ UriConstants2["GENTOKEN_SOCIAL"] = "/token/generate";
34
+ UriConstants2["CALL_PATH"] = "/call";
35
+ UriConstants2["COMPANY_PATH"] = "/company";
36
+ UriConstants2["PROFILE_PATH"] = "/userinfo";
37
+ UriConstants2["RESET_PASSWORD_PATH"] = "/reset_password";
38
+ UriConstants2["CHANGE_PASSWORD_PATH"] = "/change_password";
39
+ UriConstants2["UPDATE_PASSWORD_PATH"] = "/change_password_parent";
40
+ UriConstants2["LOAD_ACTION"] = `/load_action`;
41
+ UriConstants2["REPORT_PATH"] = `/report`;
42
+ UriConstants2["RUN_ACTION_PATH"] = `/run_action`;
43
+ UriConstants2["UPLOAD_FILE_PATH"] = `/upload/file`;
44
+ UriConstants2["GET_MESSAGE"] = `/chatter/thread/messages`;
45
+ UriConstants2["SENT_MESSAGE"] = `/chatter/message/post`;
46
+ UriConstants2["UPLOAD_IMAGE"] = `/mail/attachment/upload`;
47
+ UriConstants2["DELETE_MESSAGE"] = `/chatter/message/update_content`;
48
+ UriConstants2["IMAGE_PATH"] = `/web/image`;
49
+ UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
50
+ UriConstants2["TOKEN"] = `/check_token`;
51
+ UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
52
+ UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
53
+ UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
54
+ UriConstants2["GRANT_ACCESS"] = "/grant-access";
55
+ UriConstants2["TOKEN_BY_CODE"] = "/token";
56
+ UriConstants2["LOGOUT"] = "/logout";
57
+ return UriConstants2;
58
+ })(UriConstants || {});
59
+
60
+ // src/constants/field/field-type-constant.ts
61
+ var FieldTypeConstants = /* @__PURE__ */ ((FieldTypeConstants2) => {
62
+ FieldTypeConstants2["CHAR"] = "char";
63
+ FieldTypeConstants2["TEXT"] = "text";
64
+ FieldTypeConstants2["INTEGER"] = "integer";
65
+ FieldTypeConstants2["FLOAT"] = "float";
66
+ FieldTypeConstants2["BOOLEAN"] = "boolean";
67
+ FieldTypeConstants2["DATE"] = "date";
68
+ FieldTypeConstants2["DATETIME"] = "datetime";
69
+ FieldTypeConstants2["BINARY"] = "binary";
70
+ FieldTypeConstants2["SELECTION"] = "selection";
71
+ FieldTypeConstants2["HTML"] = "html";
72
+ FieldTypeConstants2["MANY2ONE"] = "many2one";
73
+ FieldTypeConstants2["ONE2MANY"] = "one2many";
74
+ FieldTypeConstants2["MANY2MANY"] = "many2many";
75
+ FieldTypeConstants2["MONETARY"] = "monetary";
76
+ FieldTypeConstants2["REFERENCE"] = "reference";
77
+ FieldTypeConstants2["FUNCTION"] = "function";
78
+ FieldTypeConstants2["PROPERTY"] = "property";
79
+ return FieldTypeConstants2;
80
+ })(FieldTypeConstants || {});
81
+
82
+ // src/constants/method/method-type-constant.ts
83
+ var MethodType = /* @__PURE__ */ ((MethodType2) => {
84
+ MethodType2[MethodType2["CREATE"] = 0] = "CREATE";
85
+ MethodType2[MethodType2["UPDATE"] = 1] = "UPDATE";
86
+ MethodType2[MethodType2["DELETE"] = 2] = "DELETE";
87
+ MethodType2[MethodType2["UNLINK"] = 3] = "UNLINK";
88
+ MethodType2[MethodType2["NO_CHANGE"] = 4] = "NO_CHANGE";
89
+ return MethodType2;
90
+ })(MethodType || {});
91
+
92
+ // src/constants/model/model-constant.ts
93
+ var ModelConstants = /* @__PURE__ */ ((ModelConstants2) => {
94
+ ModelConstants2["MENU"] = "ir.ui.menu";
95
+ ModelConstants2["USER"] = "res.users";
96
+ ModelConstants2["COMPANY"] = "res.company";
97
+ ModelConstants2["WINDOW_ACTION"] = "ir.actions.act_window";
98
+ ModelConstants2["BASE_IMPORT"] = "base_import.import";
99
+ ModelConstants2["GET_IMPORT"] = "get_import_templates";
100
+ return ModelConstants2;
101
+ })(ModelConstants || {});
102
+
103
+ // src/constants/type/index.ts
104
+ var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
105
+ ComponentType2["GROUP"] = "group";
106
+ ComponentType2["FIELD"] = "field";
107
+ ComponentType2["TREE"] = "tree";
108
+ ComponentType2["DIV"] = "div";
109
+ ComponentType2["LIST"] = "list";
110
+ ComponentType2["FORM"] = "form";
111
+ ComponentType2["SETTINGS"] = "setting";
112
+ ComponentType2["SPAN"] = "span";
113
+ ComponentType2["KANBAN"] = "kanban";
114
+ ComponentType2["CALENDAR"] = "calendar";
115
+ ComponentType2["TYPE"] = "view-type";
116
+ return ComponentType2;
117
+ })(ComponentType || {});
118
+ var SearchType = {
119
+ FILTER: "filter_by",
120
+ SEARCH: "search_by",
121
+ GROUP: "group_by"
122
+ };
123
+
124
+ // src/constants/widget/widget-avatar-constant.ts
125
+ var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
126
+ WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
127
+ WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
128
+ return WIDGETAVATAR2;
129
+ })(WIDGETAVATAR || {});
130
+ var WIDGETCURRENCY = /* @__PURE__ */ ((WIDGETCURRENCY2) => {
131
+ WIDGETCURRENCY2["many2one_avatar_user"] = "many2one_avatar_user";
132
+ WIDGETCURRENCY2["many2many_avatar_user"] = "many2many_avatar_user";
133
+ return WIDGETCURRENCY2;
134
+ })(WIDGETCURRENCY || {});
135
+
136
+ // src/constants/widget/widget-color-constant.ts
137
+ var WIDGETCOLOR = /* @__PURE__ */ ((WIDGETCOLOR2) => {
138
+ WIDGETCOLOR2["many2many_tags"] = "many2many_tags";
139
+ WIDGETCOLOR2["helpdesk_sla_many2many_tags"] = "helpdesk_sla_many2many_tags";
140
+ return WIDGETCOLOR2;
141
+ })(WIDGETCOLOR || {});
142
+
143
+ // src/constants/widget/widget-status-constant.ts
144
+ var WIDGETSTATUS = /* @__PURE__ */ ((WIDGETSTATUS2) => {
145
+ WIDGETSTATUS2["sla_status_ids"] = "sla_status_ids";
146
+ return WIDGETSTATUS2;
147
+ })(WIDGETSTATUS || {});
148
+ var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
149
+ WIDGETNOSTRING2["sla_status_ids"] = "sla_status_ids";
150
+ return WIDGETNOSTRING2;
151
+ })(WIDGETNOSTRING || {});
152
+ export {
153
+ ComponentType,
154
+ FieldTypeConstants,
155
+ KeyConstants,
156
+ MethodConstants,
157
+ MethodType,
158
+ ModelConstants,
159
+ SearchType,
160
+ UriConstants,
161
+ WIDGETAVATAR,
162
+ WIDGETCOLOR,
163
+ WIDGETCURRENCY,
164
+ WIDGETNOSTRING,
165
+ WIDGETSTATUS
166
+ };
@@ -0,0 +1,55 @@
1
+ import { EnhancedStore } from '@reduxjs/toolkit';
2
+
3
+ declare const localStorageUtils: () => {
4
+ setToken: (access_token: string) => Promise<void>;
5
+ setRefreshToken: (refresh_token: string) => Promise<void>;
6
+ getAccessToken: () => Promise<string | null>;
7
+ getRefreshToken: () => Promise<string | null>;
8
+ clearToken: () => Promise<void>;
9
+ };
10
+ type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
11
+
12
+ declare const sessionStorageUtils: () => {
13
+ getBrowserSession: () => Promise<string | null>;
14
+ };
15
+ type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
16
+
17
+ declare global {
18
+ interface Global {
19
+ envStore?: EnvStore;
20
+ }
21
+ interface Window {
22
+ envStore?: EnvStore;
23
+ }
24
+ }
25
+ declare class EnvStore {
26
+ envStore: EnhancedStore | any;
27
+ baseUrl?: string;
28
+ requests?: any;
29
+ context?: any;
30
+ defaultCompany?: any;
31
+ config?: any;
32
+ companies?: any[];
33
+ user?: any;
34
+ db?: string;
35
+ localStorageUtils?: any;
36
+ sessionStorageUtils?: any;
37
+ refreshTokenEndpoint?: string;
38
+ constructor(envStore: EnhancedStore, localStorageUtils?: any, sessionStorageUtils?: any);
39
+ setup(): void;
40
+ setupEnv(envConfig: EnvStore): void;
41
+ setUid(uid: number): void;
42
+ setLang(lang: string): void;
43
+ setAllowCompanies(allowCompanies: number[]): void;
44
+ setCompanies(companies: any[]): void;
45
+ setDefaultCompany(company: any): void;
46
+ setUserInfo(userInfo: any): void;
47
+ }
48
+ declare let env: EnvStore | null;
49
+ declare function initEnv({ localStorageUtils, sessionStorageUtils, }: {
50
+ localStorageUtils?: LocalStorageUtilsType;
51
+ sessionStorageUtils?: SessionStorageUtilsType;
52
+ }): EnvStore;
53
+ declare function getEnv(): EnvStore;
54
+
55
+ export { EnvStore, env, getEnv, initEnv };