@fctc/interface-logic 1.3.2 → 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.
@@ -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,4 +96,4 @@ type GetSelectionType = {
83
96
  specification?: any;
84
97
  };
85
98
 
86
- 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, GetSelectionType as b, SocialTokenBody as c, 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,4 +96,4 @@ type GetSelectionType = {
83
96
  specification?: any;
84
97
  };
85
98
 
86
- 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, GetSelectionType as b, SocialTokenBody as c, 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,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { L as LoginCredentialBody, c as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, b as GetSelectionType } from './api-type-cZ3zwGsZ.mjs';
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
+ import { a as BaseModelInit, B as BaseModel } from './index-C_nK1Mii.mjs';
3
4
 
4
5
  declare const useForgotPassword: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
5
6
 
@@ -160,24 +161,6 @@ declare const useGetListMyBankAccount: ({ domain, spectification, model, }: {
160
161
  model: string;
161
162
  }) => _tanstack_react_query.UseQueryResult<any, Error>;
162
163
 
163
- interface BaseModelInit {
164
- name: string;
165
- view: Record<string, any>;
166
- actContext?: Record<string, any>;
167
- fields?: any;
168
- }
169
- declare class BaseModel {
170
- name: string;
171
- view: Record<string, any>;
172
- actContext?: Record<string, any>;
173
- fields?: any;
174
- constructor(init: BaseModelInit);
175
- private getSpecificationByFields;
176
- getTreeProps(): Record<string, any>;
177
- getTreeFields(): Record<string, any>[];
178
- getSpecification(): Record<string, any>;
179
- }
180
-
181
164
  declare const useModel: () => {
182
165
  initModel: (modelData: BaseModelInit) => BaseModel;
183
166
  };
@@ -202,9 +185,10 @@ declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error,
202
185
  data: any;
203
186
  specification?: any;
204
187
  context: any;
188
+ path?: string;
205
189
  }, unknown>;
206
190
 
207
- 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>;
208
192
 
209
193
  declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
210
194
  id: any;
package/dist/hooks.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { L as LoginCredentialBody, c as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, b as GetSelectionType } from './api-type-cZ3zwGsZ.js';
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
+ import { a as BaseModelInit, B as BaseModel } from './index-C_nK1Mii.js';
3
4
 
4
5
  declare const useForgotPassword: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
5
6
 
@@ -160,24 +161,6 @@ declare const useGetListMyBankAccount: ({ domain, spectification, model, }: {
160
161
  model: string;
161
162
  }) => _tanstack_react_query.UseQueryResult<any, Error>;
162
163
 
163
- interface BaseModelInit {
164
- name: string;
165
- view: Record<string, any>;
166
- actContext?: Record<string, any>;
167
- fields?: any;
168
- }
169
- declare class BaseModel {
170
- name: string;
171
- view: Record<string, any>;
172
- actContext?: Record<string, any>;
173
- fields?: any;
174
- constructor(init: BaseModelInit);
175
- private getSpecificationByFields;
176
- getTreeProps(): Record<string, any>;
177
- getTreeFields(): Record<string, any>[];
178
- getSpecification(): Record<string, any>;
179
- }
180
-
181
164
  declare const useModel: () => {
182
165
  initModel: (modelData: BaseModelInit) => BaseModel;
183
166
  };
@@ -202,9 +185,10 @@ declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error,
202
185
  data: any;
203
186
  specification?: any;
204
187
  context: any;
188
+ path?: string;
205
189
  }, unknown>;
206
190
 
207
- 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>;
208
192
 
209
193
  declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
210
194
  id: any;
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
- }) => model_service_default.save({ ids, model, data, specification, context })
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
- }) => model_service_default.save({ ids, model, data, specification, context })
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;
@@ -0,0 +1,19 @@
1
+ interface BaseModelInit {
2
+ name: string;
3
+ view: Record<string, any>;
4
+ actContext?: Record<string, any>;
5
+ fields?: any;
6
+ }
7
+ declare class BaseModel {
8
+ name: string;
9
+ view: Record<string, any>;
10
+ actContext?: Record<string, any>;
11
+ fields?: any;
12
+ constructor(init: BaseModelInit);
13
+ private getSpecificationByFields;
14
+ getTreeProps(): Record<string, any>;
15
+ getTreeFields(): Record<string, any>[];
16
+ getSpecification(): Record<string, any>;
17
+ }
18
+
19
+ export { BaseModel as B, type BaseModelInit as a };
@@ -0,0 +1,19 @@
1
+ interface BaseModelInit {
2
+ name: string;
3
+ view: Record<string, any>;
4
+ actContext?: Record<string, any>;
5
+ fields?: any;
6
+ }
7
+ declare class BaseModel {
8
+ name: string;
9
+ view: Record<string, any>;
10
+ actContext?: Record<string, any>;
11
+ fields?: any;
12
+ constructor(init: BaseModelInit);
13
+ private getSpecificationByFields;
14
+ getTreeProps(): Record<string, any>;
15
+ getTreeFields(): Record<string, any>[];
16
+ getSpecification(): Record<string, any>;
17
+ }
18
+
19
+ export { BaseModel as B, type BaseModelInit as a };
@@ -0,0 +1,34 @@
1
+ import { B as BaseModel, a as BaseModelInit } from './index-C_nK1Mii.mjs';
2
+
3
+ interface CompanyData {
4
+ id?: number;
5
+ name?: string;
6
+ [key: string]: any;
7
+ }
8
+ interface CompanyResponse {
9
+ data: CompanyData;
10
+ status: number;
11
+ [key: string]: any;
12
+ }
13
+ declare class CompanyModel extends BaseModel {
14
+ constructor(init: BaseModelInit);
15
+ getCurrentCompany(): Promise<CompanyResponse>;
16
+ getUserCompany(id: number): Promise<CompanyResponse>;
17
+ }
18
+
19
+ interface UserData {
20
+ id?: number;
21
+ name?: string;
22
+ [key: string]: any;
23
+ }
24
+ interface UserResponse {
25
+ data: UserData;
26
+ status: number;
27
+ [key: string]: any;
28
+ }
29
+ declare class UserModel extends BaseModel {
30
+ constructor(init: BaseModelInit);
31
+ getProfile(): Promise<UserResponse>;
32
+ }
33
+
34
+ export { BaseModel, BaseModelInit, CompanyModel, UserModel };
@@ -0,0 +1,34 @@
1
+ import { B as BaseModel, a as BaseModelInit } from './index-C_nK1Mii.js';
2
+
3
+ interface CompanyData {
4
+ id?: number;
5
+ name?: string;
6
+ [key: string]: any;
7
+ }
8
+ interface CompanyResponse {
9
+ data: CompanyData;
10
+ status: number;
11
+ [key: string]: any;
12
+ }
13
+ declare class CompanyModel extends BaseModel {
14
+ constructor(init: BaseModelInit);
15
+ getCurrentCompany(): Promise<CompanyResponse>;
16
+ getUserCompany(id: number): Promise<CompanyResponse>;
17
+ }
18
+
19
+ interface UserData {
20
+ id?: number;
21
+ name?: string;
22
+ [key: string]: any;
23
+ }
24
+ interface UserResponse {
25
+ data: UserData;
26
+ status: number;
27
+ [key: string]: any;
28
+ }
29
+ declare class UserModel extends BaseModel {
30
+ constructor(init: BaseModelInit);
31
+ getProfile(): Promise<UserResponse>;
32
+ }
33
+
34
+ export { BaseModel, BaseModelInit, CompanyModel, UserModel };