@fctc/interface-logic 4.5.4 → 4.5.6

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.
Files changed (45) hide show
  1. package/dist/chunk-CI6PEZ77.mjs +1 -0
  2. package/dist/chunk-KPELPP6F.mjs +1 -0
  3. package/dist/chunk-LCUY2BJU.mjs +1 -0
  4. package/dist/chunk-LYD7QJQX.mjs +2 -0
  5. package/dist/chunk-Y5QM3Y5X.mjs +1 -0
  6. package/dist/chunk-Y65DQP66.mjs +5 -0
  7. package/dist/configs.mjs +1 -2544
  8. package/dist/constants.mjs +1 -293
  9. package/dist/environment.d.mts +1 -1
  10. package/dist/environment.mjs +1 -2669
  11. package/dist/hooks.d.mts +1 -7
  12. package/dist/hooks.mjs +1 -8792
  13. package/dist/{local-storage-BPvoMGYJ.d.mts → local-storage-AbiOQTLK.d.mts} +1 -1
  14. package/dist/models.mjs +1 -120
  15. package/dist/provider.d.mts +103 -52
  16. package/dist/provider.mjs +1 -9487
  17. package/dist/services.mjs +1 -6912
  18. package/dist/utils.d.mts +33 -61
  19. package/dist/utils.mjs +1 -3030
  20. package/package.json +78 -92
  21. package/dist/base-model-type-DD8uZnDP.d.ts +0 -8
  22. package/dist/configs.d.ts +0 -12
  23. package/dist/configs.js +0 -2581
  24. package/dist/constants.d.ts +0 -235
  25. package/dist/constants.js +0 -335
  26. package/dist/environment.d.ts +0 -56
  27. package/dist/environment.js +0 -2708
  28. package/dist/hooks.d.ts +0 -828
  29. package/dist/hooks.js +0 -8949
  30. package/dist/local-storage-BPvoMGYJ.d.ts +0 -10
  31. package/dist/models.d.ts +0 -14
  32. package/dist/models.js +0 -147
  33. package/dist/provider.d.ts +0 -214
  34. package/dist/provider.js +0 -9533
  35. package/dist/services.d.ts +0 -700
  36. package/dist/services.js +0 -6959
  37. package/dist/store.d.mts +0 -382
  38. package/dist/store.d.ts +0 -382
  39. package/dist/store.js +0 -823
  40. package/dist/store.mjs +0 -717
  41. package/dist/types.d.ts +0 -19
  42. package/dist/types.js +0 -18
  43. package/dist/utils.d.ts +0 -112
  44. package/dist/utils.js +0 -3099
  45. package/dist/view-type-CfcWWR0w.d.ts +0 -137
@@ -1,10 +0,0 @@
1
- declare const localStorageUtils: () => {
2
- setToken: (access_token: string) => Promise<void>;
3
- setRefreshToken: (refresh_token: string) => Promise<void>;
4
- getAccessToken: () => Promise<string | null>;
5
- getRefreshToken: () => Promise<string | null>;
6
- clearToken: () => Promise<void>;
7
- };
8
- type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
9
-
10
- export type { LocalStorageUtilsType as L };
package/dist/models.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import { B as BaseModelInit } from './base-model-type-DD8uZnDP.js';
2
-
3
- declare class BaseModel {
4
- name: string;
5
- view: Record<string, any>;
6
- fields?: any;
7
- constructor(init: BaseModelInit);
8
- private getSpecificationByFields;
9
- getTreeProps(): Record<string, any>;
10
- getTreeFields(): Record<string, any>[];
11
- getSpecification(): Record<string, any>;
12
- }
13
-
14
- export { BaseModel };
package/dist/models.js DELETED
@@ -1,147 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/models.ts
21
- var models_exports = {};
22
- __export(models_exports, {
23
- BaseModel: () => BaseModel
24
- });
25
- module.exports = __toCommonJS(models_exports);
26
-
27
- // src/constants/widget/widget-avatar-constant.ts
28
- var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
29
- WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
30
- WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
31
- return WIDGETAVATAR2;
32
- })(WIDGETAVATAR || {});
33
-
34
- // src/models/base-model/index.ts
35
- var BaseModel = class {
36
- name;
37
- view;
38
- fields;
39
- constructor(init) {
40
- this.name = init.name;
41
- this.view = init.view;
42
- this.fields = init.fields;
43
- }
44
- getSpecificationByFields({
45
- fields = [],
46
- specification = {},
47
- modelsData,
48
- model,
49
- modelRoot
50
- }) {
51
- if (Array.isArray(fields)) {
52
- let spec = { ...specification };
53
- fields.forEach((field) => {
54
- if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
55
- if (modelsData?.[model]?.[field?.name]) {
56
- if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
57
- const relation = modelsData?.[model]?.[field?.name]?.relation;
58
- const modelRelation = modelsData?.[relation];
59
- if (modelRelation) {
60
- spec[field?.name] = {
61
- fields: {}
62
- };
63
- if (modelRoot && modelRoot === relation) {
64
- spec[field?.name].fields = { id: {} };
65
- } else {
66
- spec[field?.name].fields = this.getSpecificationByFields({
67
- fields: Object.values(modelRelation),
68
- specification: { id: {}, display_name: {} },
69
- modelsData,
70
- model: relation,
71
- modelRoot: model
72
- });
73
- }
74
- } else {
75
- spec[field?.name] = {
76
- fields: {
77
- id: {},
78
- display_name: {},
79
- ...field?.widget === "many2many_binary" ? { mimetype: {} } : {},
80
- ...field?.widget === "many2many_binary" && relation === "ir.attachment" ? { datas: {} } : {}
81
- }
82
- };
83
- }
84
- } else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
85
- spec[field?.name] = {
86
- fields: {
87
- id: {},
88
- display_name: {},
89
- ...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
90
- ...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
91
- ...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
92
- }
93
- };
94
- } else {
95
- spec[field?.name] = {};
96
- }
97
- }
98
- } else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
99
- const specGroup = this.getSpecificationByFields({
100
- fields: field?.fields,
101
- specification: spec,
102
- modelsData,
103
- model
104
- });
105
- spec = { ...spec, ...specGroup };
106
- } else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
107
- const relation = modelsData?.[model]?.[field?.name]?.relation;
108
- const specTreee = this.getSpecificationByFields({
109
- fields: field?.fields,
110
- specification: {},
111
- modelsData,
112
- model: relation,
113
- modelRoot: model
114
- });
115
- spec = { ...spec, [field?.name]: { fields: specTreee } };
116
- }
117
- });
118
- return spec;
119
- } else {
120
- console.warn("fields is not array");
121
- }
122
- }
123
- getTreeProps() {
124
- const props = this.view?.views?.list || {};
125
- return props;
126
- }
127
- getTreeFields() {
128
- const fields = this.view?.views?.list?.fields || [];
129
- return fields;
130
- }
131
- getSpecification() {
132
- const specInit = {};
133
- const modelData = this.view?.models || {};
134
- const specification = this.getSpecificationByFields({
135
- fields: this.fields,
136
- specification: specInit,
137
- modelsData: modelData,
138
- model: this.name,
139
- modelRoot: ""
140
- });
141
- return specification;
142
- }
143
- };
144
- // Annotate the CommonJS export names for ESM import in node:
145
- 0 && (module.exports = {
146
- BaseModel
147
- });
@@ -1,214 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React$1, { ReactNode } from 'react';
3
- import { L as LocalStorageUtilsType } from './local-storage-BPvoMGYJ.js';
4
- import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState, useCompleteCurrentStage, useLoginSupa, useAddFloor, useAddTable, useDeleteFloor, useDeleteTable, useUpdateFloor, useUpdateTable, useCreateOrder } from './hooks.js';
5
- import { SupabaseClient } from '@supabase/supabase-js';
6
- import '@tanstack/react-query';
7
- import './view-type-CfcWWR0w.js';
8
- import '@supabase/auth-js';
9
- import './base-model-type-DD8uZnDP.js';
10
- import './models.js';
11
-
12
- declare const MainProvider: ({ children }: {
13
- children: ReactNode;
14
- }) => react_jsx_runtime.JSX.Element;
15
-
16
- declare const ReactQueryProvider: ({ children }: {
17
- children: ReactNode;
18
- }) => react_jsx_runtime.JSX.Element;
19
-
20
- declare const VersionGate: ({ children }: {
21
- children: ReactNode;
22
- }) => react_jsx_runtime.JSX.Element | null;
23
-
24
- interface EnvConfig {
25
- env?: any;
26
- baseUrl?: string;
27
- requests?: any;
28
- default_service?: string;
29
- context?: {
30
- uid?: number | null;
31
- allowed_company_ids?: number[];
32
- lang?: string;
33
- tz?: string;
34
- };
35
- defaultCompany?: {
36
- id?: number | null;
37
- logo?: string;
38
- secondary_color?: string;
39
- primary_color?: string;
40
- secondary_logo?: string;
41
- };
42
- config?: any;
43
- companies?: any[];
44
- user?: any;
45
- db?: string;
46
- refreshTokenEndpoint?: string;
47
- isSupaMode?: boolean;
48
- localStorageUtils?: LocalStorageUtilsType;
49
- sessionStorageUtils?: any;
50
- envFile?: any;
51
- xNode?: string;
52
- excludeLanguages?: string[];
53
- }
54
- declare function EnvProvider({ children, localStorageUtils: localStorageUtil, sessionStorageUtils: sessionStorageUtil, }: {
55
- children: React.ReactNode;
56
- localStorageUtils?: LocalStorageUtilsType;
57
- sessionStorageUtils?: any;
58
- }): react_jsx_runtime.JSX.Element;
59
- declare function useEnv(): {
60
- env: EnvConfig;
61
- setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
62
- setUid: (uid: number) => void;
63
- setLang: (lang: string) => void;
64
- setAllowCompanies: (allowed_company_ids: number[]) => void;
65
- setCompanies: (companies: any[]) => void;
66
- setDefaultCompany: (defaultCompany: EnvConfig["defaultCompany"]) => void;
67
- setUserInfo: (user: any) => void;
68
- setConfig: (config: any) => void;
69
- setEnvFile: (envFile: any) => void;
70
- };
71
-
72
- interface ServiceContextType {
73
- useForgotPassword: typeof useForgotPassword;
74
- useForgotPasswordSSO: typeof useForgotPasswordSSO;
75
- useGetProvider: typeof useGetProvider;
76
- useIsValidToken: typeof useIsValidToken;
77
- useLoginCredential: typeof useLoginCredential;
78
- useLoginSocial: typeof useLoginSocial;
79
- useResetPassword: typeof useResetPassword;
80
- useResetPasswordSSO: typeof useResetPasswordSSO;
81
- useUpdatePassword: typeof useUpdatePassword;
82
- useLogout: typeof useLogout;
83
- useGetAccessByCode: typeof useGetAccessByCode;
84
- useValidateActionToken: typeof useValidateActionToken;
85
- useGetCompanyInfo: typeof useGetCompanyInfo;
86
- useGetCurrentCompany: typeof useGetCurrentCompany;
87
- useGetListCompany: typeof useGetListCompany;
88
- useExecuteImport: typeof useExecuteImport;
89
- useExportExcel: typeof useExportExcel;
90
- useGetFieldExport: typeof useGetFieldExport;
91
- useGetFileExcel: typeof useGetFileExcel;
92
- useParsePreview: typeof useParsePreview;
93
- useUploadFileExcel: typeof useUploadFileExcel;
94
- useUploadIdFile: typeof useUploadIdFile;
95
- useChangeStatus: typeof useChangeStatus;
96
- useDeleteComment: typeof useDeleteComment;
97
- useGetComment: typeof useGetComment;
98
- useGetFormView: typeof useGetFormView;
99
- useGetImage: typeof useGetImage;
100
- useSendComment: typeof useSendComment;
101
- useUploadImage: typeof useUploadImage;
102
- useDelete: typeof useDelete;
103
- useGetAll: typeof useGetAll;
104
- useGetConversionRate: typeof useGetConversionRate;
105
- useGetCurrency: typeof useGetCurrency;
106
- useGetDetail: typeof useGetDetail;
107
- useGetFieldOnChange: typeof useGetFieldOnChange;
108
- useGetListMyBankAccount: typeof useGetListMyBankAccount;
109
- useModel: typeof useModel;
110
- useOdooDataTransform: typeof useOdooDataTransform;
111
- useOnChangeForm: typeof useOnChangeForm;
112
- useSave: typeof useSave;
113
- useGetProfile: typeof useGetProfile;
114
- useGetUser: typeof useGetUser;
115
- useSwitchLocale: typeof useSwitchLocale;
116
- useButton: typeof useButton;
117
- useDuplicateRecord: typeof useDuplicateRecord;
118
- useGet2FAMethods: typeof useGet2FAMethods;
119
- useGetActionDetail: typeof useGetActionDetail;
120
- useGetCalendar: typeof useGetCalendar;
121
- useGetGroups: typeof useGetGroups;
122
- useGetListData: typeof useGetListData;
123
- useGetMenu: typeof useGetMenu;
124
- useGetPrintReport: typeof useGetPrintReport;
125
- useGetProGressBar: typeof useGetProGressBar;
126
- useGetResequence: typeof useGetResequence;
127
- useGetSelection: typeof useGetSelection;
128
- useGetView: typeof useGetView;
129
- useLoadAction: typeof useLoadAction;
130
- useLoadMessage: typeof useLoadMessage;
131
- usePrint: typeof usePrint;
132
- useRemoveRow: typeof useRemoveRow;
133
- useRunAction: typeof useRunAction;
134
- useSignInSSO: typeof useSignInSSO;
135
- useVerify2FA: typeof useVerify2FA;
136
- useGrantAccess: typeof useGrantAccess;
137
- useRemoveTotpSetup: typeof useRemoveTotpSetup;
138
- useRequestSetupTotp: typeof useRequestSetupTotp;
139
- useSettingsWebRead2fa: typeof useSettingsWebRead2fa;
140
- useVerifyTotp: typeof useVerifyTotp;
141
- useUploadFile: typeof useUploadFile;
142
- useCreateEntity: typeof useCreateEntity;
143
- useGetASession: typeof useGetASession;
144
- useCreateSession: typeof useCreateSession;
145
- useDeleteEntity: typeof useDeleteEntity;
146
- useGetList: typeof useGetList;
147
- useGetPos: typeof useGetPos;
148
- useHandleClosingSession: typeof useHandleClosingSession;
149
- useManageSession: typeof useManageSession;
150
- useUpdateClosedSession: typeof useUpdateClosedSession;
151
- useUpdateEntity: typeof useUpdateEntity;
152
- useLoadDataPosSession: typeof useLoadDataPosSession;
153
- useManageOnChange: typeof useManageOnChange;
154
- useGenSerialNumber: typeof useGenSerialNumber;
155
- useGetOrderLine: typeof useGetOrderLine;
156
- useGetProductImage: typeof useGetProductImage;
157
- useAddEntity: typeof useAddEntity;
158
- useCheckPayment: typeof useCheckPayment;
159
- useHandleCloseSession: typeof useHandleCloseSession;
160
- useHandleClosingDetailSession: typeof useHandleClosingDetailSession;
161
- useCreatePosConfig: typeof useCreatePosConfig;
162
- useSearchJournal: typeof useSearchJournal;
163
- useGetTenantMapping: typeof useGetTenantMapping;
164
- useGetToken: typeof useGetToken;
165
- useGetPreparationDisplayData: typeof useGetPreparationDisplayData;
166
- useUpdateOrderStatus: typeof useUpdateOrderStatus;
167
- useGetThreadData: typeof useGetThreadData;
168
- useGetThreadMessages: typeof useGetThreadMessages;
169
- useGetExternalTabs: typeof useGetExternalTabs;
170
- useProcessOrder: typeof useProcessOrder;
171
- useGeneratePaymentQrInfo: typeof useGeneratePaymentQrInfo;
172
- useSavePinCode: typeof useSavePinCode;
173
- useGetPinCode: typeof useGetPinCode;
174
- useReadGroup: typeof useReadGroup;
175
- useGetNotifications: typeof useGetNotifications;
176
- useGetDataChart: typeof useGetDataChart;
177
- useGetVersion: typeof useGetVersion;
178
- useCreateEInvoice: typeof useCreateEInvoice;
179
- useGetCurrentUser: typeof useGetCurrentUser;
180
- useGetWard: typeof useGetWard;
181
- useGetCity: typeof useGetCity;
182
- useGetCountry: typeof useGetCountry;
183
- useGetPartnerTitle: typeof useGetPartnerTitle;
184
- useChangeOrderPreparationState: typeof useChangeOrderPreparationState;
185
- useCompleteCurrentStage: typeof useCompleteCurrentStage;
186
- useLoginSupa: typeof useLoginSupa;
187
- useAddFloor: typeof useAddFloor;
188
- useAddTable: typeof useAddTable;
189
- useDeleteFloor: typeof useDeleteFloor;
190
- useDeleteTable: typeof useDeleteTable;
191
- useUpdateFloor: typeof useUpdateFloor;
192
- useUpdateTable: typeof useUpdateTable;
193
- useCreateOrder: typeof useCreateOrder;
194
- }
195
- declare const ServiceProvider: ({ children, }: {
196
- children: React.ReactNode;
197
- }) => react_jsx_runtime.JSX.Element;
198
- declare const useService: () => ServiceContextType;
199
-
200
- type MetaProviderProps = {
201
- children: ReactNode;
202
- };
203
- declare const MetaProvider: ({ children }: MetaProviderProps) => react_jsx_runtime.JSX.Element;
204
-
205
- type SupabaseProviderProps = {
206
- supabaseUrl: string;
207
- supabaseKey: string;
208
- schema?: string;
209
- children: React$1.ReactNode;
210
- };
211
- declare const SupabaseProvider: ({ supabaseUrl, supabaseKey, schema, children, }: SupabaseProviderProps) => react_jsx_runtime.JSX.Element;
212
- declare const useSupabase: () => SupabaseClient<any, any, any, any, any>;
213
-
214
- export { EnvProvider, MainProvider, MetaProvider, ReactQueryProvider, ServiceProvider, SupabaseProvider, VersionGate, useEnv, useService, useSupabase };