@fctc/interface-logic 1.3.1 → 1.3.3
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.
- package/dist/{view-type-mROO2TFx.d.mts → api-type-DOC6jjy_.d.mts} +14 -15
- package/dist/{view-type-mROO2TFx.d.ts → api-type-DOC6jjy_.d.ts} +14 -15
- package/dist/hooks.d.mts +16 -2
- package/dist/hooks.d.ts +16 -2
- package/dist/hooks.js +12 -10
- package/dist/hooks.mjs +12 -10
- package/dist/models.d.mts +1 -1
- package/dist/models.d.ts +1 -1
- package/dist/models.js +122 -120
- package/dist/models.mjs +121 -120
- package/dist/provider.js +2 -2
- package/dist/provider.mjs +2 -2
- package/dist/services.d.mts +16 -3
- package/dist/services.d.ts +16 -3
- package/dist/services.js +7 -6
- package/dist/services.mjs +7 -6
- package/dist/types.d.mts +9 -1
- package/dist/types.d.ts +9 -1
- package/package.json +10 -10
|
@@ -31,6 +31,18 @@ interface Specification {
|
|
|
31
31
|
interface ContextApi {
|
|
32
32
|
[key: string]: any;
|
|
33
33
|
}
|
|
34
|
+
interface GetAllParams {
|
|
35
|
+
model?: string;
|
|
36
|
+
ids?: number[];
|
|
37
|
+
specification: Specification;
|
|
38
|
+
domain?: any[];
|
|
39
|
+
offset?: number;
|
|
40
|
+
sort: any;
|
|
41
|
+
fields: any;
|
|
42
|
+
groupby: any;
|
|
43
|
+
context?: ContextApi;
|
|
44
|
+
limit?: number;
|
|
45
|
+
}
|
|
34
46
|
interface GetListParams {
|
|
35
47
|
model: string;
|
|
36
48
|
ids?: number[];
|
|
@@ -53,6 +65,7 @@ interface SaveParams {
|
|
|
53
65
|
data?: Record<string, any>;
|
|
54
66
|
specification?: Specification;
|
|
55
67
|
context?: ContextApi;
|
|
68
|
+
path?: string;
|
|
56
69
|
}
|
|
57
70
|
interface DeleteParams {
|
|
58
71
|
ids?: number[];
|
|
@@ -83,18 +96,4 @@ type GetSelectionType = {
|
|
|
83
96
|
specification?: any;
|
|
84
97
|
};
|
|
85
98
|
|
|
86
|
-
type
|
|
87
|
-
type Option = {
|
|
88
|
-
action_id?: number;
|
|
89
|
-
load_filters?: boolean;
|
|
90
|
-
toolbar?: boolean;
|
|
91
|
-
};
|
|
92
|
-
interface GetViewParams {
|
|
93
|
-
model?: string;
|
|
94
|
-
views?: View[];
|
|
95
|
-
context?: Record<string, any>;
|
|
96
|
-
options?: Option;
|
|
97
|
-
aid?: number | string | null | boolean;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetListParams as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SaveParams as S, UpdatePasswordRequest as U, ViewData as V, GetDetailParams as a, GetViewParams as b, GetSelectionType as c, SocialTokenBody as d, updatePasswordBody as u };
|
|
99
|
+
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, ViewData as V, GetDetailParams as a, GetListParams as b, GetSelectionType as c, SocialTokenBody as d, Specification as e, updatePasswordBody as u };
|
|
@@ -31,6 +31,18 @@ interface Specification {
|
|
|
31
31
|
interface ContextApi {
|
|
32
32
|
[key: string]: any;
|
|
33
33
|
}
|
|
34
|
+
interface GetAllParams {
|
|
35
|
+
model?: string;
|
|
36
|
+
ids?: number[];
|
|
37
|
+
specification: Specification;
|
|
38
|
+
domain?: any[];
|
|
39
|
+
offset?: number;
|
|
40
|
+
sort: any;
|
|
41
|
+
fields: any;
|
|
42
|
+
groupby: any;
|
|
43
|
+
context?: ContextApi;
|
|
44
|
+
limit?: number;
|
|
45
|
+
}
|
|
34
46
|
interface GetListParams {
|
|
35
47
|
model: string;
|
|
36
48
|
ids?: number[];
|
|
@@ -53,6 +65,7 @@ interface SaveParams {
|
|
|
53
65
|
data?: Record<string, any>;
|
|
54
66
|
specification?: Specification;
|
|
55
67
|
context?: ContextApi;
|
|
68
|
+
path?: string;
|
|
56
69
|
}
|
|
57
70
|
interface DeleteParams {
|
|
58
71
|
ids?: number[];
|
|
@@ -83,18 +96,4 @@ type GetSelectionType = {
|
|
|
83
96
|
specification?: any;
|
|
84
97
|
};
|
|
85
98
|
|
|
86
|
-
type
|
|
87
|
-
type Option = {
|
|
88
|
-
action_id?: number;
|
|
89
|
-
load_filters?: boolean;
|
|
90
|
-
toolbar?: boolean;
|
|
91
|
-
};
|
|
92
|
-
interface GetViewParams {
|
|
93
|
-
model?: string;
|
|
94
|
-
views?: View[];
|
|
95
|
-
context?: Record<string, any>;
|
|
96
|
-
options?: Option;
|
|
97
|
-
aid?: number | string | null | boolean;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetListParams as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SaveParams as S, UpdatePasswordRequest as U, ViewData as V, GetDetailParams as a, GetViewParams as b, GetSelectionType as c, SocialTokenBody as d, updatePasswordBody as u };
|
|
99
|
+
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, ViewData as V, GetDetailParams as a, GetListParams as b, GetSelectionType as c, SocialTokenBody as d, Specification as e, updatePasswordBody as u };
|
package/dist/hooks.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { L as LoginCredentialBody, d as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, c as GetSelectionType
|
|
2
|
+
import { L as LoginCredentialBody, d as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, c as GetSelectionType } from './api-type-DOC6jjy_.mjs';
|
|
3
3
|
import { a as BaseModelInit, B as BaseModel } from './index-C_nK1Mii.mjs';
|
|
4
4
|
|
|
5
5
|
declare const useForgotPassword: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
|
|
@@ -185,9 +185,10 @@ declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error,
|
|
|
185
185
|
data: any;
|
|
186
186
|
specification?: any;
|
|
187
187
|
context: any;
|
|
188
|
+
path?: string;
|
|
188
189
|
}, unknown>;
|
|
189
190
|
|
|
190
|
-
declare const useGetProfile: () => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
191
|
+
declare const useGetProfile: (path?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
191
192
|
|
|
192
193
|
declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
193
194
|
id: any;
|
|
@@ -252,6 +253,19 @@ declare const useGetSelection: ({ data, queryKey, enabled, }: {
|
|
|
252
253
|
enabled?: boolean;
|
|
253
254
|
}) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
254
255
|
|
|
256
|
+
type View = [number | boolean, string];
|
|
257
|
+
type Option = {
|
|
258
|
+
action_id?: number;
|
|
259
|
+
load_filters?: boolean;
|
|
260
|
+
toolbar?: boolean;
|
|
261
|
+
};
|
|
262
|
+
interface GetViewParams {
|
|
263
|
+
model?: string;
|
|
264
|
+
views?: View[];
|
|
265
|
+
context?: Record<string, any>;
|
|
266
|
+
options?: Option;
|
|
267
|
+
aid?: number | string | null | boolean;
|
|
268
|
+
}
|
|
255
269
|
declare const useGetView: (viewParams: GetViewParams, actData?: any) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
256
270
|
|
|
257
271
|
declare const useLoadAction: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { L as LoginCredentialBody, d as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, c as GetSelectionType
|
|
2
|
+
import { L as LoginCredentialBody, d as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, c as GetSelectionType } from './api-type-DOC6jjy_.js';
|
|
3
3
|
import { a as BaseModelInit, B as BaseModel } from './index-C_nK1Mii.js';
|
|
4
4
|
|
|
5
5
|
declare const useForgotPassword: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
|
|
@@ -185,9 +185,10 @@ declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error,
|
|
|
185
185
|
data: any;
|
|
186
186
|
specification?: any;
|
|
187
187
|
context: any;
|
|
188
|
+
path?: string;
|
|
188
189
|
}, unknown>;
|
|
189
190
|
|
|
190
|
-
declare const useGetProfile: () => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
191
|
+
declare const useGetProfile: (path?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
191
192
|
|
|
192
193
|
declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
193
194
|
id: any;
|
|
@@ -252,6 +253,19 @@ declare const useGetSelection: ({ data, queryKey, enabled, }: {
|
|
|
252
253
|
enabled?: boolean;
|
|
253
254
|
}) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
254
255
|
|
|
256
|
+
type View = [number | boolean, string];
|
|
257
|
+
type Option = {
|
|
258
|
+
action_id?: number;
|
|
259
|
+
load_filters?: boolean;
|
|
260
|
+
toolbar?: boolean;
|
|
261
|
+
};
|
|
262
|
+
interface GetViewParams {
|
|
263
|
+
model?: string;
|
|
264
|
+
views?: View[];
|
|
265
|
+
context?: Record<string, any>;
|
|
266
|
+
options?: Option;
|
|
267
|
+
aid?: number | string | null | boolean;
|
|
268
|
+
}
|
|
255
269
|
declare const useGetView: (viewParams: GetViewParams, actData?: any) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
256
270
|
|
|
257
271
|
declare const useLoadAction: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
package/dist/hooks.js
CHANGED
|
@@ -4095,7 +4095,8 @@ var ModelService = {
|
|
|
4095
4095
|
ids = [],
|
|
4096
4096
|
data = {},
|
|
4097
4097
|
specification = {},
|
|
4098
|
-
context = {}
|
|
4098
|
+
context = {},
|
|
4099
|
+
path
|
|
4099
4100
|
}) {
|
|
4100
4101
|
const env2 = getEnv();
|
|
4101
4102
|
const jsonData = {
|
|
@@ -4108,7 +4109,7 @@ var ModelService = {
|
|
|
4108
4109
|
specification
|
|
4109
4110
|
}
|
|
4110
4111
|
};
|
|
4111
|
-
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4112
|
+
return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
4112
4113
|
headers: {
|
|
4113
4114
|
"Content-Type": "application/json"
|
|
4114
4115
|
}
|
|
@@ -4226,9 +4227,9 @@ var model_service_default = ModelService;
|
|
|
4226
4227
|
|
|
4227
4228
|
// src/services/user-service/index.ts
|
|
4228
4229
|
var UserService = {
|
|
4229
|
-
async getProfile() {
|
|
4230
|
+
async getProfile(path) {
|
|
4230
4231
|
const env2 = getEnv();
|
|
4231
|
-
return env2.requests.get("/userinfo" /* PROFILE_PATH */, {
|
|
4232
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4232
4233
|
headers: {
|
|
4233
4234
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
4234
4235
|
}
|
|
@@ -4610,10 +4611,10 @@ var ViewService = {
|
|
|
4610
4611
|
});
|
|
4611
4612
|
const url = `${path}?${params.toString()}`;
|
|
4612
4613
|
return env2?.requests.get(url, {
|
|
4613
|
-
credentials: "include",
|
|
4614
4614
|
headers: {
|
|
4615
4615
|
"Content-Type": "application/json"
|
|
4616
|
-
}
|
|
4616
|
+
},
|
|
4617
|
+
withCredentials: true
|
|
4617
4618
|
});
|
|
4618
4619
|
},
|
|
4619
4620
|
async grantAccess({
|
|
@@ -5427,17 +5428,18 @@ var useSave = () => {
|
|
|
5427
5428
|
model,
|
|
5428
5429
|
data,
|
|
5429
5430
|
specification,
|
|
5430
|
-
context
|
|
5431
|
-
|
|
5431
|
+
context,
|
|
5432
|
+
path
|
|
5433
|
+
}) => model_service_default.save({ ids, model, data, specification, context, path })
|
|
5432
5434
|
});
|
|
5433
5435
|
};
|
|
5434
5436
|
var use_save_default = useSave;
|
|
5435
5437
|
|
|
5436
5438
|
// src/hooks/user/use-get-profile.ts
|
|
5437
5439
|
var import_react_query38 = require("@tanstack/react-query");
|
|
5438
|
-
var useGetProfile = () => {
|
|
5440
|
+
var useGetProfile = (path) => {
|
|
5439
5441
|
return (0, import_react_query38.useMutation)({
|
|
5440
|
-
mutationFn: () => user_service_default.getProfile()
|
|
5442
|
+
mutationFn: () => user_service_default.getProfile(path)
|
|
5441
5443
|
});
|
|
5442
5444
|
};
|
|
5443
5445
|
var use_get_profile_default = useGetProfile;
|
package/dist/hooks.mjs
CHANGED
|
@@ -3992,7 +3992,8 @@ var ModelService = {
|
|
|
3992
3992
|
ids = [],
|
|
3993
3993
|
data = {},
|
|
3994
3994
|
specification = {},
|
|
3995
|
-
context = {}
|
|
3995
|
+
context = {},
|
|
3996
|
+
path
|
|
3996
3997
|
}) {
|
|
3997
3998
|
const env2 = getEnv();
|
|
3998
3999
|
const jsonData = {
|
|
@@ -4005,7 +4006,7 @@ var ModelService = {
|
|
|
4005
4006
|
specification
|
|
4006
4007
|
}
|
|
4007
4008
|
};
|
|
4008
|
-
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4009
|
+
return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
4009
4010
|
headers: {
|
|
4010
4011
|
"Content-Type": "application/json"
|
|
4011
4012
|
}
|
|
@@ -4123,9 +4124,9 @@ var model_service_default = ModelService;
|
|
|
4123
4124
|
|
|
4124
4125
|
// src/services/user-service/index.ts
|
|
4125
4126
|
var UserService = {
|
|
4126
|
-
async getProfile() {
|
|
4127
|
+
async getProfile(path) {
|
|
4127
4128
|
const env2 = getEnv();
|
|
4128
|
-
return env2.requests.get("/userinfo" /* PROFILE_PATH */, {
|
|
4129
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4129
4130
|
headers: {
|
|
4130
4131
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
4131
4132
|
}
|
|
@@ -4507,10 +4508,10 @@ var ViewService = {
|
|
|
4507
4508
|
});
|
|
4508
4509
|
const url = `${path}?${params.toString()}`;
|
|
4509
4510
|
return env2?.requests.get(url, {
|
|
4510
|
-
credentials: "include",
|
|
4511
4511
|
headers: {
|
|
4512
4512
|
"Content-Type": "application/json"
|
|
4513
|
-
}
|
|
4513
|
+
},
|
|
4514
|
+
withCredentials: true
|
|
4514
4515
|
});
|
|
4515
4516
|
},
|
|
4516
4517
|
async grantAccess({
|
|
@@ -5324,17 +5325,18 @@ var useSave = () => {
|
|
|
5324
5325
|
model,
|
|
5325
5326
|
data,
|
|
5326
5327
|
specification,
|
|
5327
|
-
context
|
|
5328
|
-
|
|
5328
|
+
context,
|
|
5329
|
+
path
|
|
5330
|
+
}) => model_service_default.save({ ids, model, data, specification, context, path })
|
|
5329
5331
|
});
|
|
5330
5332
|
};
|
|
5331
5333
|
var use_save_default = useSave;
|
|
5332
5334
|
|
|
5333
5335
|
// src/hooks/user/use-get-profile.ts
|
|
5334
5336
|
import { useMutation as useMutation28 } from "@tanstack/react-query";
|
|
5335
|
-
var useGetProfile = () => {
|
|
5337
|
+
var useGetProfile = (path) => {
|
|
5336
5338
|
return useMutation28({
|
|
5337
|
-
mutationFn: () => user_service_default.getProfile()
|
|
5339
|
+
mutationFn: () => user_service_default.getProfile(path)
|
|
5338
5340
|
});
|
|
5339
5341
|
};
|
|
5340
5342
|
var use_get_profile_default = useGetProfile;
|
package/dist/models.d.mts
CHANGED
package/dist/models.d.ts
CHANGED
package/dist/models.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/models.ts
|
|
31
31
|
var models_exports = {};
|
|
32
32
|
__export(models_exports, {
|
|
33
|
+
BaseModel: () => BaseModel,
|
|
33
34
|
CompanyModel: () => CompanyModel,
|
|
34
35
|
UserModel: () => UserModel
|
|
35
36
|
});
|
|
@@ -65,12 +66,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
65
66
|
return UriConstants2;
|
|
66
67
|
})(UriConstants || {});
|
|
67
68
|
|
|
68
|
-
// src/configs/axios-client.ts
|
|
69
|
-
var import_axios = __toESM(require("axios"));
|
|
70
|
-
|
|
71
|
-
// src/utils/format.ts
|
|
72
|
-
var import_moment = __toESM(require("moment"));
|
|
73
|
-
|
|
74
69
|
// src/constants/widget/widget-avatar-constant.ts
|
|
75
70
|
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
76
71
|
WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
|
|
@@ -78,6 +73,124 @@ var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
|
78
73
|
return WIDGETAVATAR2;
|
|
79
74
|
})(WIDGETAVATAR || {});
|
|
80
75
|
|
|
76
|
+
// src/models/base-model/index.ts
|
|
77
|
+
var BaseModel = class {
|
|
78
|
+
name;
|
|
79
|
+
view;
|
|
80
|
+
actContext;
|
|
81
|
+
fields;
|
|
82
|
+
constructor(init) {
|
|
83
|
+
this.name = init.name;
|
|
84
|
+
this.view = init.view;
|
|
85
|
+
this.actContext = init.actContext;
|
|
86
|
+
this.fields = init.fields;
|
|
87
|
+
}
|
|
88
|
+
getSpecificationByFields({
|
|
89
|
+
fields = [],
|
|
90
|
+
specification = {},
|
|
91
|
+
modelsData,
|
|
92
|
+
model,
|
|
93
|
+
modelRoot
|
|
94
|
+
}) {
|
|
95
|
+
if (Array.isArray(fields)) {
|
|
96
|
+
let spec = { ...specification };
|
|
97
|
+
fields.forEach((field) => {
|
|
98
|
+
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
99
|
+
if (modelsData?.[model]?.[field?.name]) {
|
|
100
|
+
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
101
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
102
|
+
const modelRelation = modelsData?.[relation];
|
|
103
|
+
if (modelRelation) {
|
|
104
|
+
spec[field?.name] = {
|
|
105
|
+
fields: {}
|
|
106
|
+
};
|
|
107
|
+
if (modelRoot && modelRoot === relation) {
|
|
108
|
+
spec[field?.name].fields = { id: {} };
|
|
109
|
+
} else {
|
|
110
|
+
spec[field?.name].fields = this.getSpecificationByFields({
|
|
111
|
+
fields: Object.values(modelRelation),
|
|
112
|
+
specification: {},
|
|
113
|
+
modelsData,
|
|
114
|
+
model: relation,
|
|
115
|
+
modelRoot: model
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
spec[field?.name] = {
|
|
120
|
+
fields: {
|
|
121
|
+
id: {},
|
|
122
|
+
display_name: {}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
127
|
+
spec[field?.name] = {
|
|
128
|
+
fields: {
|
|
129
|
+
id: {},
|
|
130
|
+
display_name: {},
|
|
131
|
+
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
132
|
+
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
133
|
+
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
} else {
|
|
137
|
+
spec[field?.name] = {};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
141
|
+
const specGroup = this.getSpecificationByFields({
|
|
142
|
+
fields: field?.fields,
|
|
143
|
+
specification: spec,
|
|
144
|
+
modelsData,
|
|
145
|
+
model
|
|
146
|
+
});
|
|
147
|
+
spec = { ...spec, ...specGroup };
|
|
148
|
+
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
149
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
150
|
+
const specTreee = this.getSpecificationByFields({
|
|
151
|
+
fields: field?.fields,
|
|
152
|
+
specification: {},
|
|
153
|
+
modelsData,
|
|
154
|
+
model: relation,
|
|
155
|
+
modelRoot: model
|
|
156
|
+
});
|
|
157
|
+
spec = { ...spec, [field?.name]: { fields: specTreee } };
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
return spec;
|
|
161
|
+
} else {
|
|
162
|
+
console.warn("fields is not array");
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
getTreeProps() {
|
|
166
|
+
const props = this.view?.views?.list || {};
|
|
167
|
+
return props;
|
|
168
|
+
}
|
|
169
|
+
getTreeFields() {
|
|
170
|
+
const fields = this.view?.views?.list?.fields || [];
|
|
171
|
+
return fields;
|
|
172
|
+
}
|
|
173
|
+
getSpecification() {
|
|
174
|
+
const specInit = {};
|
|
175
|
+
const modelData = this.view?.models || {};
|
|
176
|
+
const specification = this.getSpecificationByFields({
|
|
177
|
+
fields: this.fields,
|
|
178
|
+
specification: specInit,
|
|
179
|
+
modelsData: modelData,
|
|
180
|
+
model: this.name,
|
|
181
|
+
modelRoot: ""
|
|
182
|
+
});
|
|
183
|
+
return specification;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
var base_model_default = BaseModel;
|
|
187
|
+
|
|
188
|
+
// src/configs/axios-client.ts
|
|
189
|
+
var import_axios = __toESM(require("axios"));
|
|
190
|
+
|
|
191
|
+
// src/utils/format.ts
|
|
192
|
+
var import_moment = __toESM(require("moment"));
|
|
193
|
+
|
|
81
194
|
// src/utils/domain/py_tokenizer.ts
|
|
82
195
|
var TokenizerError = class extends Error {
|
|
83
196
|
};
|
|
@@ -3151,9 +3264,9 @@ var company_service_default = CompanyService;
|
|
|
3151
3264
|
|
|
3152
3265
|
// src/services/user-service/index.ts
|
|
3153
3266
|
var UserService = {
|
|
3154
|
-
async getProfile() {
|
|
3267
|
+
async getProfile(path) {
|
|
3155
3268
|
const env2 = getEnv();
|
|
3156
|
-
return env2.requests.get("/userinfo" /* PROFILE_PATH */, {
|
|
3269
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
3157
3270
|
headers: {
|
|
3158
3271
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
3159
3272
|
}
|
|
@@ -3211,118 +3324,6 @@ var UserService = {
|
|
|
3211
3324
|
};
|
|
3212
3325
|
var user_service_default = UserService;
|
|
3213
3326
|
|
|
3214
|
-
// src/models/base-model/index.ts
|
|
3215
|
-
var BaseModel = class {
|
|
3216
|
-
name;
|
|
3217
|
-
view;
|
|
3218
|
-
actContext;
|
|
3219
|
-
fields;
|
|
3220
|
-
constructor(init) {
|
|
3221
|
-
this.name = init.name;
|
|
3222
|
-
this.view = init.view;
|
|
3223
|
-
this.actContext = init.actContext;
|
|
3224
|
-
this.fields = init.fields;
|
|
3225
|
-
}
|
|
3226
|
-
getSpecificationByFields({
|
|
3227
|
-
fields = [],
|
|
3228
|
-
specification = {},
|
|
3229
|
-
modelsData,
|
|
3230
|
-
model,
|
|
3231
|
-
modelRoot
|
|
3232
|
-
}) {
|
|
3233
|
-
if (Array.isArray(fields)) {
|
|
3234
|
-
let spec = { ...specification };
|
|
3235
|
-
fields.forEach((field) => {
|
|
3236
|
-
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
3237
|
-
if (modelsData?.[model]?.[field?.name]) {
|
|
3238
|
-
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
3239
|
-
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
3240
|
-
const modelRelation = modelsData?.[relation];
|
|
3241
|
-
if (modelRelation) {
|
|
3242
|
-
spec[field?.name] = {
|
|
3243
|
-
fields: {}
|
|
3244
|
-
};
|
|
3245
|
-
if (modelRoot && modelRoot === relation) {
|
|
3246
|
-
spec[field?.name].fields = { id: {} };
|
|
3247
|
-
} else {
|
|
3248
|
-
spec[field?.name].fields = this.getSpecificationByFields({
|
|
3249
|
-
fields: Object.values(modelRelation),
|
|
3250
|
-
specification: {},
|
|
3251
|
-
modelsData,
|
|
3252
|
-
model: relation,
|
|
3253
|
-
modelRoot: model
|
|
3254
|
-
});
|
|
3255
|
-
}
|
|
3256
|
-
} else {
|
|
3257
|
-
spec[field?.name] = {
|
|
3258
|
-
fields: {
|
|
3259
|
-
id: {},
|
|
3260
|
-
display_name: {}
|
|
3261
|
-
}
|
|
3262
|
-
};
|
|
3263
|
-
}
|
|
3264
|
-
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
3265
|
-
spec[field?.name] = {
|
|
3266
|
-
fields: {
|
|
3267
|
-
id: {},
|
|
3268
|
-
display_name: {},
|
|
3269
|
-
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
3270
|
-
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
3271
|
-
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
3272
|
-
}
|
|
3273
|
-
};
|
|
3274
|
-
} else {
|
|
3275
|
-
spec[field?.name] = {};
|
|
3276
|
-
}
|
|
3277
|
-
}
|
|
3278
|
-
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
3279
|
-
const specGroup = this.getSpecificationByFields({
|
|
3280
|
-
fields: field?.fields,
|
|
3281
|
-
specification: spec,
|
|
3282
|
-
modelsData,
|
|
3283
|
-
model
|
|
3284
|
-
});
|
|
3285
|
-
spec = { ...spec, ...specGroup };
|
|
3286
|
-
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
3287
|
-
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
3288
|
-
const specTreee = this.getSpecificationByFields({
|
|
3289
|
-
fields: field?.fields,
|
|
3290
|
-
specification: {},
|
|
3291
|
-
modelsData,
|
|
3292
|
-
model: relation,
|
|
3293
|
-
modelRoot: model
|
|
3294
|
-
});
|
|
3295
|
-
spec = { ...spec, [field?.name]: { fields: specTreee } };
|
|
3296
|
-
}
|
|
3297
|
-
});
|
|
3298
|
-
return spec;
|
|
3299
|
-
} else {
|
|
3300
|
-
console.warn("fields is not array");
|
|
3301
|
-
}
|
|
3302
|
-
}
|
|
3303
|
-
getTreeProps() {
|
|
3304
|
-
const props = this.view?.views?.list || {};
|
|
3305
|
-
return props;
|
|
3306
|
-
}
|
|
3307
|
-
getTreeFields() {
|
|
3308
|
-
const fields = this.view?.views?.list?.fields || [];
|
|
3309
|
-
return fields;
|
|
3310
|
-
}
|
|
3311
|
-
getSpecification() {
|
|
3312
|
-
const specInit = {};
|
|
3313
|
-
const modelData = this.view?.models || {};
|
|
3314
|
-
const specification = this.getSpecificationByFields({
|
|
3315
|
-
fields: this.fields,
|
|
3316
|
-
specification: specInit,
|
|
3317
|
-
modelsData: modelData,
|
|
3318
|
-
model: this.name,
|
|
3319
|
-
modelRoot: ""
|
|
3320
|
-
});
|
|
3321
|
-
return specification;
|
|
3322
|
-
}
|
|
3323
|
-
};
|
|
3324
|
-
var base_model_default = BaseModel;
|
|
3325
|
-
|
|
3326
3327
|
// src/models/company-model/index.ts
|
|
3327
3328
|
var CompanyModel = class extends base_model_default {
|
|
3328
3329
|
constructor(init) {
|
|
@@ -3347,6 +3348,7 @@ var UserModel = class extends base_model_default {
|
|
|
3347
3348
|
};
|
|
3348
3349
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3349
3350
|
0 && (module.exports = {
|
|
3351
|
+
BaseModel,
|
|
3350
3352
|
CompanyModel,
|
|
3351
3353
|
UserModel
|
|
3352
3354
|
});
|
package/dist/models.mjs
CHANGED
|
@@ -28,12 +28,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
28
28
|
return UriConstants2;
|
|
29
29
|
})(UriConstants || {});
|
|
30
30
|
|
|
31
|
-
// src/configs/axios-client.ts
|
|
32
|
-
import axios from "axios";
|
|
33
|
-
|
|
34
|
-
// src/utils/format.ts
|
|
35
|
-
import moment from "moment";
|
|
36
|
-
|
|
37
31
|
// src/constants/widget/widget-avatar-constant.ts
|
|
38
32
|
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
39
33
|
WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
|
|
@@ -41,6 +35,124 @@ var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
|
41
35
|
return WIDGETAVATAR2;
|
|
42
36
|
})(WIDGETAVATAR || {});
|
|
43
37
|
|
|
38
|
+
// src/models/base-model/index.ts
|
|
39
|
+
var BaseModel = class {
|
|
40
|
+
name;
|
|
41
|
+
view;
|
|
42
|
+
actContext;
|
|
43
|
+
fields;
|
|
44
|
+
constructor(init) {
|
|
45
|
+
this.name = init.name;
|
|
46
|
+
this.view = init.view;
|
|
47
|
+
this.actContext = init.actContext;
|
|
48
|
+
this.fields = init.fields;
|
|
49
|
+
}
|
|
50
|
+
getSpecificationByFields({
|
|
51
|
+
fields = [],
|
|
52
|
+
specification = {},
|
|
53
|
+
modelsData,
|
|
54
|
+
model,
|
|
55
|
+
modelRoot
|
|
56
|
+
}) {
|
|
57
|
+
if (Array.isArray(fields)) {
|
|
58
|
+
let spec = { ...specification };
|
|
59
|
+
fields.forEach((field) => {
|
|
60
|
+
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
61
|
+
if (modelsData?.[model]?.[field?.name]) {
|
|
62
|
+
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
63
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
64
|
+
const modelRelation = modelsData?.[relation];
|
|
65
|
+
if (modelRelation) {
|
|
66
|
+
spec[field?.name] = {
|
|
67
|
+
fields: {}
|
|
68
|
+
};
|
|
69
|
+
if (modelRoot && modelRoot === relation) {
|
|
70
|
+
spec[field?.name].fields = { id: {} };
|
|
71
|
+
} else {
|
|
72
|
+
spec[field?.name].fields = this.getSpecificationByFields({
|
|
73
|
+
fields: Object.values(modelRelation),
|
|
74
|
+
specification: {},
|
|
75
|
+
modelsData,
|
|
76
|
+
model: relation,
|
|
77
|
+
modelRoot: model
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
spec[field?.name] = {
|
|
82
|
+
fields: {
|
|
83
|
+
id: {},
|
|
84
|
+
display_name: {}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
89
|
+
spec[field?.name] = {
|
|
90
|
+
fields: {
|
|
91
|
+
id: {},
|
|
92
|
+
display_name: {},
|
|
93
|
+
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
94
|
+
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
95
|
+
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
} else {
|
|
99
|
+
spec[field?.name] = {};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
103
|
+
const specGroup = this.getSpecificationByFields({
|
|
104
|
+
fields: field?.fields,
|
|
105
|
+
specification: spec,
|
|
106
|
+
modelsData,
|
|
107
|
+
model
|
|
108
|
+
});
|
|
109
|
+
spec = { ...spec, ...specGroup };
|
|
110
|
+
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
111
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
112
|
+
const specTreee = this.getSpecificationByFields({
|
|
113
|
+
fields: field?.fields,
|
|
114
|
+
specification: {},
|
|
115
|
+
modelsData,
|
|
116
|
+
model: relation,
|
|
117
|
+
modelRoot: model
|
|
118
|
+
});
|
|
119
|
+
spec = { ...spec, [field?.name]: { fields: specTreee } };
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return spec;
|
|
123
|
+
} else {
|
|
124
|
+
console.warn("fields is not array");
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
getTreeProps() {
|
|
128
|
+
const props = this.view?.views?.list || {};
|
|
129
|
+
return props;
|
|
130
|
+
}
|
|
131
|
+
getTreeFields() {
|
|
132
|
+
const fields = this.view?.views?.list?.fields || [];
|
|
133
|
+
return fields;
|
|
134
|
+
}
|
|
135
|
+
getSpecification() {
|
|
136
|
+
const specInit = {};
|
|
137
|
+
const modelData = this.view?.models || {};
|
|
138
|
+
const specification = this.getSpecificationByFields({
|
|
139
|
+
fields: this.fields,
|
|
140
|
+
specification: specInit,
|
|
141
|
+
modelsData: modelData,
|
|
142
|
+
model: this.name,
|
|
143
|
+
modelRoot: ""
|
|
144
|
+
});
|
|
145
|
+
return specification;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
var base_model_default = BaseModel;
|
|
149
|
+
|
|
150
|
+
// src/configs/axios-client.ts
|
|
151
|
+
import axios from "axios";
|
|
152
|
+
|
|
153
|
+
// src/utils/format.ts
|
|
154
|
+
import moment from "moment";
|
|
155
|
+
|
|
44
156
|
// src/utils/domain/py_tokenizer.ts
|
|
45
157
|
var TokenizerError = class extends Error {
|
|
46
158
|
};
|
|
@@ -3114,9 +3226,9 @@ var company_service_default = CompanyService;
|
|
|
3114
3226
|
|
|
3115
3227
|
// src/services/user-service/index.ts
|
|
3116
3228
|
var UserService = {
|
|
3117
|
-
async getProfile() {
|
|
3229
|
+
async getProfile(path) {
|
|
3118
3230
|
const env2 = getEnv();
|
|
3119
|
-
return env2.requests.get("/userinfo" /* PROFILE_PATH */, {
|
|
3231
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
3120
3232
|
headers: {
|
|
3121
3233
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
3122
3234
|
}
|
|
@@ -3174,118 +3286,6 @@ var UserService = {
|
|
|
3174
3286
|
};
|
|
3175
3287
|
var user_service_default = UserService;
|
|
3176
3288
|
|
|
3177
|
-
// src/models/base-model/index.ts
|
|
3178
|
-
var BaseModel = class {
|
|
3179
|
-
name;
|
|
3180
|
-
view;
|
|
3181
|
-
actContext;
|
|
3182
|
-
fields;
|
|
3183
|
-
constructor(init) {
|
|
3184
|
-
this.name = init.name;
|
|
3185
|
-
this.view = init.view;
|
|
3186
|
-
this.actContext = init.actContext;
|
|
3187
|
-
this.fields = init.fields;
|
|
3188
|
-
}
|
|
3189
|
-
getSpecificationByFields({
|
|
3190
|
-
fields = [],
|
|
3191
|
-
specification = {},
|
|
3192
|
-
modelsData,
|
|
3193
|
-
model,
|
|
3194
|
-
modelRoot
|
|
3195
|
-
}) {
|
|
3196
|
-
if (Array.isArray(fields)) {
|
|
3197
|
-
let spec = { ...specification };
|
|
3198
|
-
fields.forEach((field) => {
|
|
3199
|
-
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
3200
|
-
if (modelsData?.[model]?.[field?.name]) {
|
|
3201
|
-
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
3202
|
-
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
3203
|
-
const modelRelation = modelsData?.[relation];
|
|
3204
|
-
if (modelRelation) {
|
|
3205
|
-
spec[field?.name] = {
|
|
3206
|
-
fields: {}
|
|
3207
|
-
};
|
|
3208
|
-
if (modelRoot && modelRoot === relation) {
|
|
3209
|
-
spec[field?.name].fields = { id: {} };
|
|
3210
|
-
} else {
|
|
3211
|
-
spec[field?.name].fields = this.getSpecificationByFields({
|
|
3212
|
-
fields: Object.values(modelRelation),
|
|
3213
|
-
specification: {},
|
|
3214
|
-
modelsData,
|
|
3215
|
-
model: relation,
|
|
3216
|
-
modelRoot: model
|
|
3217
|
-
});
|
|
3218
|
-
}
|
|
3219
|
-
} else {
|
|
3220
|
-
spec[field?.name] = {
|
|
3221
|
-
fields: {
|
|
3222
|
-
id: {},
|
|
3223
|
-
display_name: {}
|
|
3224
|
-
}
|
|
3225
|
-
};
|
|
3226
|
-
}
|
|
3227
|
-
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
3228
|
-
spec[field?.name] = {
|
|
3229
|
-
fields: {
|
|
3230
|
-
id: {},
|
|
3231
|
-
display_name: {},
|
|
3232
|
-
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
3233
|
-
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
3234
|
-
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
3235
|
-
}
|
|
3236
|
-
};
|
|
3237
|
-
} else {
|
|
3238
|
-
spec[field?.name] = {};
|
|
3239
|
-
}
|
|
3240
|
-
}
|
|
3241
|
-
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
3242
|
-
const specGroup = this.getSpecificationByFields({
|
|
3243
|
-
fields: field?.fields,
|
|
3244
|
-
specification: spec,
|
|
3245
|
-
modelsData,
|
|
3246
|
-
model
|
|
3247
|
-
});
|
|
3248
|
-
spec = { ...spec, ...specGroup };
|
|
3249
|
-
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
3250
|
-
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
3251
|
-
const specTreee = this.getSpecificationByFields({
|
|
3252
|
-
fields: field?.fields,
|
|
3253
|
-
specification: {},
|
|
3254
|
-
modelsData,
|
|
3255
|
-
model: relation,
|
|
3256
|
-
modelRoot: model
|
|
3257
|
-
});
|
|
3258
|
-
spec = { ...spec, [field?.name]: { fields: specTreee } };
|
|
3259
|
-
}
|
|
3260
|
-
});
|
|
3261
|
-
return spec;
|
|
3262
|
-
} else {
|
|
3263
|
-
console.warn("fields is not array");
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
getTreeProps() {
|
|
3267
|
-
const props = this.view?.views?.list || {};
|
|
3268
|
-
return props;
|
|
3269
|
-
}
|
|
3270
|
-
getTreeFields() {
|
|
3271
|
-
const fields = this.view?.views?.list?.fields || [];
|
|
3272
|
-
return fields;
|
|
3273
|
-
}
|
|
3274
|
-
getSpecification() {
|
|
3275
|
-
const specInit = {};
|
|
3276
|
-
const modelData = this.view?.models || {};
|
|
3277
|
-
const specification = this.getSpecificationByFields({
|
|
3278
|
-
fields: this.fields,
|
|
3279
|
-
specification: specInit,
|
|
3280
|
-
modelsData: modelData,
|
|
3281
|
-
model: this.name,
|
|
3282
|
-
modelRoot: ""
|
|
3283
|
-
});
|
|
3284
|
-
return specification;
|
|
3285
|
-
}
|
|
3286
|
-
};
|
|
3287
|
-
var base_model_default = BaseModel;
|
|
3288
|
-
|
|
3289
3289
|
// src/models/company-model/index.ts
|
|
3290
3290
|
var CompanyModel = class extends base_model_default {
|
|
3291
3291
|
constructor(init) {
|
|
@@ -3309,6 +3309,7 @@ var UserModel = class extends base_model_default {
|
|
|
3309
3309
|
}
|
|
3310
3310
|
};
|
|
3311
3311
|
export {
|
|
3312
|
+
BaseModel,
|
|
3312
3313
|
CompanyModel,
|
|
3313
3314
|
UserModel
|
|
3314
3315
|
};
|
package/dist/provider.js
CHANGED
|
@@ -3439,10 +3439,10 @@ var ViewService = {
|
|
|
3439
3439
|
});
|
|
3440
3440
|
const url = `${path}?${params.toString()}`;
|
|
3441
3441
|
return env2?.requests.get(url, {
|
|
3442
|
-
credentials: "include",
|
|
3443
3442
|
headers: {
|
|
3444
3443
|
"Content-Type": "application/json"
|
|
3445
|
-
}
|
|
3444
|
+
},
|
|
3445
|
+
withCredentials: true
|
|
3446
3446
|
});
|
|
3447
3447
|
},
|
|
3448
3448
|
async grantAccess({
|
package/dist/provider.mjs
CHANGED
|
@@ -3401,10 +3401,10 @@ var ViewService = {
|
|
|
3401
3401
|
});
|
|
3402
3402
|
const url = `${path}?${params.toString()}`;
|
|
3403
3403
|
return env2?.requests.get(url, {
|
|
3404
|
-
credentials: "include",
|
|
3405
3404
|
headers: {
|
|
3406
3405
|
"Content-Type": "application/json"
|
|
3407
|
-
}
|
|
3406
|
+
},
|
|
3407
|
+
withCredentials: true
|
|
3408
3408
|
});
|
|
3409
3409
|
},
|
|
3410
3410
|
async grantAccess({
|
package/dist/services.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest,
|
|
1
|
+
import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, a as GetDetailParams, S as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, c as GetSelectionType } from './api-type-DOC6jjy_.mjs';
|
|
2
2
|
|
|
3
3
|
declare const ActionService: {
|
|
4
4
|
loadAction({ idAction, context, }: {
|
|
@@ -168,7 +168,7 @@ declare const ModelService: {
|
|
|
168
168
|
}): Promise<any>;
|
|
169
169
|
getList({ model, ids, specification, domain, offset, order, context, limit, }: GetListParams): Promise<any>;
|
|
170
170
|
getDetail({ ids, model, specification, context, }: GetDetailParams): Promise<any>;
|
|
171
|
-
save({ model, ids, data, specification, context, }: SaveParams): Promise<any>;
|
|
171
|
+
save({ model, ids, data, specification, context, path, }: SaveParams): Promise<any>;
|
|
172
172
|
delete({ ids, model }: DeleteParams): Promise<any>;
|
|
173
173
|
onChange({ ids, model, object, specification, context, fieldChange, }: OnChangeParams): Promise<any>;
|
|
174
174
|
getListFieldsOnchange({ model }: {
|
|
@@ -179,7 +179,7 @@ declare const ModelService: {
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
declare const UserService: {
|
|
182
|
-
getProfile(): Promise<any>;
|
|
182
|
+
getProfile(path?: string): Promise<any>;
|
|
183
183
|
getUser({ context, id }: {
|
|
184
184
|
context: any;
|
|
185
185
|
id: any;
|
|
@@ -187,6 +187,19 @@ declare const UserService: {
|
|
|
187
187
|
switchUserLocale: ({ id, values }: any) => Promise<any>;
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
+
type View = [number | boolean, string];
|
|
191
|
+
type Option = {
|
|
192
|
+
action_id?: number;
|
|
193
|
+
load_filters?: boolean;
|
|
194
|
+
toolbar?: boolean;
|
|
195
|
+
};
|
|
196
|
+
interface GetViewParams {
|
|
197
|
+
model?: string;
|
|
198
|
+
views?: View[];
|
|
199
|
+
context?: Record<string, any>;
|
|
200
|
+
options?: Option;
|
|
201
|
+
aid?: number | string | null | boolean;
|
|
202
|
+
}
|
|
190
203
|
declare const ViewService: {
|
|
191
204
|
getView({ model, views, context, options, aid, }: GetViewParams): Promise<any>;
|
|
192
205
|
getMenu(context: any): Promise<any>;
|
package/dist/services.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest,
|
|
1
|
+
import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, a as GetDetailParams, S as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, c as GetSelectionType } from './api-type-DOC6jjy_.js';
|
|
2
2
|
|
|
3
3
|
declare const ActionService: {
|
|
4
4
|
loadAction({ idAction, context, }: {
|
|
@@ -168,7 +168,7 @@ declare const ModelService: {
|
|
|
168
168
|
}): Promise<any>;
|
|
169
169
|
getList({ model, ids, specification, domain, offset, order, context, limit, }: GetListParams): Promise<any>;
|
|
170
170
|
getDetail({ ids, model, specification, context, }: GetDetailParams): Promise<any>;
|
|
171
|
-
save({ model, ids, data, specification, context, }: SaveParams): Promise<any>;
|
|
171
|
+
save({ model, ids, data, specification, context, path, }: SaveParams): Promise<any>;
|
|
172
172
|
delete({ ids, model }: DeleteParams): Promise<any>;
|
|
173
173
|
onChange({ ids, model, object, specification, context, fieldChange, }: OnChangeParams): Promise<any>;
|
|
174
174
|
getListFieldsOnchange({ model }: {
|
|
@@ -179,7 +179,7 @@ declare const ModelService: {
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
declare const UserService: {
|
|
182
|
-
getProfile(): Promise<any>;
|
|
182
|
+
getProfile(path?: string): Promise<any>;
|
|
183
183
|
getUser({ context, id }: {
|
|
184
184
|
context: any;
|
|
185
185
|
id: any;
|
|
@@ -187,6 +187,19 @@ declare const UserService: {
|
|
|
187
187
|
switchUserLocale: ({ id, values }: any) => Promise<any>;
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
+
type View = [number | boolean, string];
|
|
191
|
+
type Option = {
|
|
192
|
+
action_id?: number;
|
|
193
|
+
load_filters?: boolean;
|
|
194
|
+
toolbar?: boolean;
|
|
195
|
+
};
|
|
196
|
+
interface GetViewParams {
|
|
197
|
+
model?: string;
|
|
198
|
+
views?: View[];
|
|
199
|
+
context?: Record<string, any>;
|
|
200
|
+
options?: Option;
|
|
201
|
+
aid?: number | string | null | boolean;
|
|
202
|
+
}
|
|
190
203
|
declare const ViewService: {
|
|
191
204
|
getView({ model, views, context, options, aid, }: GetViewParams): Promise<any>;
|
|
192
205
|
getMenu(context: any): Promise<any>;
|
package/dist/services.js
CHANGED
|
@@ -4011,7 +4011,8 @@ var ModelService = {
|
|
|
4011
4011
|
ids = [],
|
|
4012
4012
|
data = {},
|
|
4013
4013
|
specification = {},
|
|
4014
|
-
context = {}
|
|
4014
|
+
context = {},
|
|
4015
|
+
path
|
|
4015
4016
|
}) {
|
|
4016
4017
|
const env2 = getEnv();
|
|
4017
4018
|
const jsonData = {
|
|
@@ -4024,7 +4025,7 @@ var ModelService = {
|
|
|
4024
4025
|
specification
|
|
4025
4026
|
}
|
|
4026
4027
|
};
|
|
4027
|
-
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4028
|
+
return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
4028
4029
|
headers: {
|
|
4029
4030
|
"Content-Type": "application/json"
|
|
4030
4031
|
}
|
|
@@ -4142,9 +4143,9 @@ var model_service_default = ModelService;
|
|
|
4142
4143
|
|
|
4143
4144
|
// src/services/user-service/index.ts
|
|
4144
4145
|
var UserService = {
|
|
4145
|
-
async getProfile() {
|
|
4146
|
+
async getProfile(path) {
|
|
4146
4147
|
const env2 = getEnv();
|
|
4147
|
-
return env2.requests.get("/userinfo" /* PROFILE_PATH */, {
|
|
4148
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4148
4149
|
headers: {
|
|
4149
4150
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
4150
4151
|
}
|
|
@@ -4526,10 +4527,10 @@ var ViewService = {
|
|
|
4526
4527
|
});
|
|
4527
4528
|
const url = `${path}?${params.toString()}`;
|
|
4528
4529
|
return env2?.requests.get(url, {
|
|
4529
|
-
credentials: "include",
|
|
4530
4530
|
headers: {
|
|
4531
4531
|
"Content-Type": "application/json"
|
|
4532
|
-
}
|
|
4532
|
+
},
|
|
4533
|
+
withCredentials: true
|
|
4533
4534
|
});
|
|
4534
4535
|
},
|
|
4535
4536
|
async grantAccess({
|
package/dist/services.mjs
CHANGED
|
@@ -3967,7 +3967,8 @@ var ModelService = {
|
|
|
3967
3967
|
ids = [],
|
|
3968
3968
|
data = {},
|
|
3969
3969
|
specification = {},
|
|
3970
|
-
context = {}
|
|
3970
|
+
context = {},
|
|
3971
|
+
path
|
|
3971
3972
|
}) {
|
|
3972
3973
|
const env2 = getEnv();
|
|
3973
3974
|
const jsonData = {
|
|
@@ -3980,7 +3981,7 @@ var ModelService = {
|
|
|
3980
3981
|
specification
|
|
3981
3982
|
}
|
|
3982
3983
|
};
|
|
3983
|
-
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3984
|
+
return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
3984
3985
|
headers: {
|
|
3985
3986
|
"Content-Type": "application/json"
|
|
3986
3987
|
}
|
|
@@ -4098,9 +4099,9 @@ var model_service_default = ModelService;
|
|
|
4098
4099
|
|
|
4099
4100
|
// src/services/user-service/index.ts
|
|
4100
4101
|
var UserService = {
|
|
4101
|
-
async getProfile() {
|
|
4102
|
+
async getProfile(path) {
|
|
4102
4103
|
const env2 = getEnv();
|
|
4103
|
-
return env2.requests.get("/userinfo" /* PROFILE_PATH */, {
|
|
4104
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4104
4105
|
headers: {
|
|
4105
4106
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
4106
4107
|
}
|
|
@@ -4482,10 +4483,10 @@ var ViewService = {
|
|
|
4482
4483
|
});
|
|
4483
4484
|
const url = `${path}?${params.toString()}`;
|
|
4484
4485
|
return env2?.requests.get(url, {
|
|
4485
|
-
credentials: "include",
|
|
4486
4486
|
headers: {
|
|
4487
4487
|
"Content-Type": "application/json"
|
|
4488
|
-
}
|
|
4488
|
+
},
|
|
4489
|
+
withCredentials: true
|
|
4489
4490
|
});
|
|
4490
4491
|
},
|
|
4491
4492
|
async grantAccess({
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, V as ViewData, u as updatePasswordBody } from './api-type-DOC6jjy_.mjs';
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
interface Config {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
grantType: string;
|
|
6
|
+
clientId: string;
|
|
7
|
+
clientSecret: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type { Config };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, V as ViewData, u as updatePasswordBody } from './api-type-DOC6jjy_.js';
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
interface Config {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
grantType: string;
|
|
6
|
+
clientId: string;
|
|
7
|
+
clientSecret: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type { Config };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fctc/interface-logic",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -30,11 +30,6 @@
|
|
|
30
30
|
"import": "./dist/hooks.mjs",
|
|
31
31
|
"require": "./dist/hooks.cjs"
|
|
32
32
|
},
|
|
33
|
-
"./models": {
|
|
34
|
-
"types": "./dist/models.d.ts",
|
|
35
|
-
"import": "./dist/models.mjs",
|
|
36
|
-
"require": "./dist/models.cjs"
|
|
37
|
-
},
|
|
38
33
|
"./provider": {
|
|
39
34
|
"types": "./dist/provider.d.ts",
|
|
40
35
|
"import": "./dist/provider.mjs",
|
|
@@ -50,15 +45,20 @@
|
|
|
50
45
|
"import": "./dist/store.mjs",
|
|
51
46
|
"require": "./dist/store.cjs"
|
|
52
47
|
},
|
|
48
|
+
"./utils": {
|
|
49
|
+
"types": "./dist/utils.d.ts",
|
|
50
|
+
"import": "./dist/utils.mjs",
|
|
51
|
+
"require": "./dist/utils.cjs"
|
|
52
|
+
},
|
|
53
53
|
"./types": {
|
|
54
54
|
"types": "./dist/types.d.ts",
|
|
55
55
|
"import": "./dist/types.mjs",
|
|
56
56
|
"require": "./dist/types.cjs"
|
|
57
57
|
},
|
|
58
|
-
"./
|
|
59
|
-
"types": "./dist/
|
|
60
|
-
"import": "./dist/
|
|
61
|
-
"require": "./dist/
|
|
58
|
+
"./models": {
|
|
59
|
+
"types": "./dist/models.d.ts",
|
|
60
|
+
"import": "./dist/models.mjs",
|
|
61
|
+
"require": "./dist/models.cjs"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"files": [
|