@fctc/interface-logic 4.9.3 → 4.9.4

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.
@@ -63,7 +63,6 @@ declare enum UriConstants {
63
63
  GRANT_ACCESS = "/grant-access",
64
64
  TOKEN_BY_CODE = "/token",
65
65
  LOGOUT = "/logout",
66
- LOGIN_PATH = "/login",
67
66
  CREATE_UPDATE = "/create_update",
68
67
  SEARCH_READ = "/search_read",
69
68
  CREATE_PATH = "/create",
@@ -63,7 +63,6 @@ declare enum UriConstants {
63
63
  GRANT_ACCESS = "/grant-access",
64
64
  TOKEN_BY_CODE = "/token",
65
65
  LOGOUT = "/logout",
66
- LOGIN_PATH = "/login",
67
66
  CREATE_UPDATE = "/create_update",
68
67
  SEARCH_READ = "/search_read",
69
68
  CREATE_PATH = "/create",
package/dist/constants.js CHANGED
@@ -109,7 +109,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
109
109
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
110
110
  UriConstants2["TOKEN_BY_CODE"] = "/token";
111
111
  UriConstants2["LOGOUT"] = "/logout";
112
- UriConstants2["LOGIN_PATH"] = "/login";
113
112
  UriConstants2["CREATE_UPDATE"] = "/create_update";
114
113
  UriConstants2["SEARCH_READ"] = "/search_read";
115
114
  UriConstants2["CREATE_PATH"] = "/create";
@@ -68,7 +68,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
68
68
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
69
69
  UriConstants2["TOKEN_BY_CODE"] = "/token";
70
70
  UriConstants2["LOGOUT"] = "/logout";
71
- UriConstants2["LOGIN_PATH"] = "/login";
72
71
  UriConstants2["CREATE_UPDATE"] = "/create_update";
73
72
  UriConstants2["SEARCH_READ"] = "/search_read";
74
73
  UriConstants2["CREATE_PATH"] = "/create";
package/dist/hooks.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { L as LoginCredentialBody, d as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, T as TThreadData, C as ContextApi, V as ViewData, c as GetSelectionType, f as GetViewParams } from './view-type-CfcWWR0w.mjs';
3
+ import * as _supabase_auth_js from '@supabase/auth-js';
3
4
  import { B as BaseModelInit } from './base-model-type-DD8uZnDP.mjs';
4
5
  import { BaseModel } from './models.mjs';
5
6
 
@@ -25,9 +26,24 @@ declare const useLoginSocial: () => _tanstack_react_query.UseMutationResult<any,
25
26
  type LoginTenantUserBody = {
26
27
  email: string;
27
28
  password: string;
28
- tenantId: string;
29
29
  };
30
- declare const useLoginTenantUser: () => _tanstack_react_query.UseMutationResult<any, Error, LoginTenantUserBody, unknown>;
30
+ declare const useLoginTenantUser: () => _tanstack_react_query.UseMutationResult<{
31
+ data: null;
32
+ error: {
33
+ message: string;
34
+ };
35
+ } | {
36
+ data: {
37
+ user: _supabase_auth_js.User;
38
+ session: _supabase_auth_js.Session;
39
+ weakPassword?: _supabase_auth_js.WeakPassword;
40
+ } | {
41
+ user: null;
42
+ session: null;
43
+ weakPassword?: null | undefined;
44
+ };
45
+ error: _supabase_auth_js.AuthError | null;
46
+ }, Error, LoginTenantUserBody, unknown>;
31
47
 
32
48
  declare const useResetPassword: () => _tanstack_react_query.UseMutationResult<any, Error, ForgotPasswordBody, unknown>;
33
49
 
package/dist/hooks.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { L as LoginCredentialBody, d as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, T as TThreadData, C as ContextApi, V as ViewData, c as GetSelectionType, f as GetViewParams } from './view-type-CfcWWR0w.js';
3
+ import * as _supabase_auth_js from '@supabase/auth-js';
3
4
  import { B as BaseModelInit } from './base-model-type-DD8uZnDP.js';
4
5
  import { BaseModel } from './models.js';
5
6
 
@@ -25,9 +26,24 @@ declare const useLoginSocial: () => _tanstack_react_query.UseMutationResult<any,
25
26
  type LoginTenantUserBody = {
26
27
  email: string;
27
28
  password: string;
28
- tenantId: string;
29
29
  };
30
- declare const useLoginTenantUser: () => _tanstack_react_query.UseMutationResult<any, Error, LoginTenantUserBody, unknown>;
30
+ declare const useLoginTenantUser: () => _tanstack_react_query.UseMutationResult<{
31
+ data: null;
32
+ error: {
33
+ message: string;
34
+ };
35
+ } | {
36
+ data: {
37
+ user: _supabase_auth_js.User;
38
+ session: _supabase_auth_js.Session;
39
+ weakPassword?: _supabase_auth_js.WeakPassword;
40
+ } | {
41
+ user: null;
42
+ session: null;
43
+ weakPassword?: null | undefined;
44
+ };
45
+ error: _supabase_auth_js.AuthError | null;
46
+ }, Error, LoginTenantUserBody, unknown>;
31
47
 
32
48
  declare const useResetPassword: () => _tanstack_react_query.UseMutationResult<any, Error, ForgotPasswordBody, unknown>;
33
49
 
package/dist/hooks.js CHANGED
@@ -208,7 +208,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
208
208
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
209
209
  UriConstants2["TOKEN_BY_CODE"] = "/token";
210
210
  UriConstants2["LOGOUT"] = "/logout";
211
- UriConstants2["LOGIN_PATH"] = "/login";
212
211
  UriConstants2["CREATE_UPDATE"] = "/create_update";
213
212
  UriConstants2["SEARCH_READ"] = "/search_read";
214
213
  UriConstants2["CREATE_PATH"] = "/create";
@@ -3329,7 +3328,7 @@ function useActionService() {
3329
3328
  [env]
3330
3329
  );
3331
3330
  const actionServerHome = (0, import_react8.useCallback)(async () => {
3332
- return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3331
+ return await env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3333
3332
  }, [env]);
3334
3333
  return {
3335
3334
  loadAction,
@@ -3376,23 +3375,19 @@ function useAuthService() {
3376
3375
  );
3377
3376
  const loginTenantUser = (0, import_react9.useCallback)(
3378
3377
  async (body) => {
3379
- const payload = {
3380
- username: body.email,
3381
- password: body.password,
3382
- tenantId: body.tenantId
3383
- };
3384
- return env?.requests?.post(
3385
- "/login" /* LOGIN_PATH */,
3386
- payload,
3387
- {
3388
- headers: {
3389
- "Content-Type": "application/json"
3390
- }
3391
- },
3392
- "id"
3393
- );
3378
+ if (!supabase) {
3379
+ return {
3380
+ data: null,
3381
+ error: { message: "Supabase client is not initialized" }
3382
+ };
3383
+ }
3384
+ const { data, error } = await supabase.auth.signInWithPassword({
3385
+ email: body.email,
3386
+ password: body.password
3387
+ });
3388
+ return { data, error };
3394
3389
  },
3395
- [env]
3390
+ [supabase]
3396
3391
  );
3397
3392
  const forgotPassword = (0, import_react9.useCallback)(
3398
3393
  async (email) => {
@@ -7415,8 +7410,7 @@ var useLoginTenantUser = () => {
7415
7410
  mutationFn: (data) => {
7416
7411
  return loginTenantUser({
7417
7412
  email: data.email,
7418
- password: data.password,
7419
- tenantId: data.tenantId
7413
+ password: data.password
7420
7414
  });
7421
7415
  }
7422
7416
  });
package/dist/hooks.mjs CHANGED
@@ -35,7 +35,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
35
35
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
36
36
  UriConstants2["TOKEN_BY_CODE"] = "/token";
37
37
  UriConstants2["LOGOUT"] = "/logout";
38
- UriConstants2["LOGIN_PATH"] = "/login";
39
38
  UriConstants2["CREATE_UPDATE"] = "/create_update";
40
39
  UriConstants2["SEARCH_READ"] = "/search_read";
41
40
  UriConstants2["CREATE_PATH"] = "/create";
@@ -3156,7 +3155,7 @@ function useActionService() {
3156
3155
  [env]
3157
3156
  );
3158
3157
  const actionServerHome = useCallback2(async () => {
3159
- return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3158
+ return await env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3160
3159
  }, [env]);
3161
3160
  return {
3162
3161
  loadAction,
@@ -3203,23 +3202,19 @@ function useAuthService() {
3203
3202
  );
3204
3203
  const loginTenantUser = useCallback3(
3205
3204
  async (body) => {
3206
- const payload = {
3207
- username: body.email,
3208
- password: body.password,
3209
- tenantId: body.tenantId
3210
- };
3211
- return env?.requests?.post(
3212
- "/login" /* LOGIN_PATH */,
3213
- payload,
3214
- {
3215
- headers: {
3216
- "Content-Type": "application/json"
3217
- }
3218
- },
3219
- "id"
3220
- );
3205
+ if (!supabase) {
3206
+ return {
3207
+ data: null,
3208
+ error: { message: "Supabase client is not initialized" }
3209
+ };
3210
+ }
3211
+ const { data, error } = await supabase.auth.signInWithPassword({
3212
+ email: body.email,
3213
+ password: body.password
3214
+ });
3215
+ return { data, error };
3221
3216
  },
3222
- [env]
3217
+ [supabase]
3223
3218
  );
3224
3219
  const forgotPassword = useCallback3(
3225
3220
  async (email) => {
@@ -7242,8 +7237,7 @@ var useLoginTenantUser = () => {
7242
7237
  mutationFn: (data) => {
7243
7238
  return loginTenantUser({
7244
7239
  email: data.email,
7245
- password: data.password,
7246
- tenantId: data.tenantId
7240
+ password: data.password
7247
7241
  });
7248
7242
  }
7249
7243
  });
package/dist/index.d.mts CHANGED
@@ -12,6 +12,7 @@ export { B as BaseModelInit } from './base-model-type-DD8uZnDP.mjs';
12
12
  export { BaseModel } from './models.mjs';
13
13
  import './local-storage-BPvoMGYJ.mjs';
14
14
  import '@tanstack/react-query';
15
+ import '@supabase/auth-js';
15
16
  import 'react/jsx-runtime';
16
17
  import 'react';
17
18
  import '@supabase/supabase-js';
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { B as BaseModelInit } from './base-model-type-DD8uZnDP.js';
12
12
  export { BaseModel } from './models.js';
13
13
  import './local-storage-BPvoMGYJ.js';
14
14
  import '@tanstack/react-query';
15
+ import '@supabase/auth-js';
15
16
  import 'react/jsx-runtime';
16
17
  import 'react';
17
18
  import '@supabase/supabase-js';
package/dist/index.js CHANGED
@@ -399,7 +399,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
399
399
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
400
400
  UriConstants2["TOKEN_BY_CODE"] = "/token";
401
401
  UriConstants2["LOGOUT"] = "/logout";
402
- UriConstants2["LOGIN_PATH"] = "/login";
403
402
  UriConstants2["CREATE_UPDATE"] = "/create_update";
404
403
  UriConstants2["SEARCH_READ"] = "/search_read";
405
404
  UriConstants2["CREATE_PATH"] = "/create";
@@ -5388,7 +5387,7 @@ function useActionService() {
5388
5387
  [env2]
5389
5388
  );
5390
5389
  const actionServerHome = (0, import_react8.useCallback)(async () => {
5391
- return env2?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5390
+ return await env2?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5392
5391
  }, [env2]);
5393
5392
  return {
5394
5393
  loadAction,
@@ -5435,23 +5434,19 @@ function useAuthService() {
5435
5434
  );
5436
5435
  const loginTenantUser = (0, import_react9.useCallback)(
5437
5436
  async (body) => {
5438
- const payload = {
5439
- username: body.email,
5440
- password: body.password,
5441
- tenantId: body.tenantId
5442
- };
5443
- return env2?.requests?.post(
5444
- "/login" /* LOGIN_PATH */,
5445
- payload,
5446
- {
5447
- headers: {
5448
- "Content-Type": "application/json"
5449
- }
5450
- },
5451
- "id"
5452
- );
5437
+ if (!supabase) {
5438
+ return {
5439
+ data: null,
5440
+ error: { message: "Supabase client is not initialized" }
5441
+ };
5442
+ }
5443
+ const { data, error } = await supabase.auth.signInWithPassword({
5444
+ email: body.email,
5445
+ password: body.password
5446
+ });
5447
+ return { data, error };
5453
5448
  },
5454
- [env2]
5449
+ [supabase]
5455
5450
  );
5456
5451
  const forgotPassword = (0, import_react9.useCallback)(
5457
5452
  async (email) => {
@@ -9474,8 +9469,7 @@ var useLoginTenantUser = () => {
9474
9469
  mutationFn: (data) => {
9475
9470
  return loginTenantUser({
9476
9471
  email: data.email,
9477
- password: data.password,
9478
- tenantId: data.tenantId
9472
+ password: data.password
9479
9473
  });
9480
9474
  }
9481
9475
  });
package/dist/index.mjs CHANGED
@@ -71,7 +71,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
71
71
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
72
72
  UriConstants2["TOKEN_BY_CODE"] = "/token";
73
73
  UriConstants2["LOGOUT"] = "/logout";
74
- UriConstants2["LOGIN_PATH"] = "/login";
75
74
  UriConstants2["CREATE_UPDATE"] = "/create_update";
76
75
  UriConstants2["SEARCH_READ"] = "/search_read";
77
76
  UriConstants2["CREATE_PATH"] = "/create";
@@ -5060,7 +5059,7 @@ function useActionService() {
5060
5059
  [env2]
5061
5060
  );
5062
5061
  const actionServerHome = useCallback2(async () => {
5063
- return env2?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5062
+ return await env2?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5064
5063
  }, [env2]);
5065
5064
  return {
5066
5065
  loadAction,
@@ -5107,23 +5106,19 @@ function useAuthService() {
5107
5106
  );
5108
5107
  const loginTenantUser = useCallback3(
5109
5108
  async (body) => {
5110
- const payload = {
5111
- username: body.email,
5112
- password: body.password,
5113
- tenantId: body.tenantId
5114
- };
5115
- return env2?.requests?.post(
5116
- "/login" /* LOGIN_PATH */,
5117
- payload,
5118
- {
5119
- headers: {
5120
- "Content-Type": "application/json"
5121
- }
5122
- },
5123
- "id"
5124
- );
5109
+ if (!supabase) {
5110
+ return {
5111
+ data: null,
5112
+ error: { message: "Supabase client is not initialized" }
5113
+ };
5114
+ }
5115
+ const { data, error } = await supabase.auth.signInWithPassword({
5116
+ email: body.email,
5117
+ password: body.password
5118
+ });
5119
+ return { data, error };
5125
5120
  },
5126
- [env2]
5121
+ [supabase]
5127
5122
  );
5128
5123
  const forgotPassword = useCallback3(
5129
5124
  async (email) => {
@@ -9146,8 +9141,7 @@ var useLoginTenantUser = () => {
9146
9141
  mutationFn: (data) => {
9147
9142
  return loginTenantUser({
9148
9143
  email: data.email,
9149
- password: data.password,
9150
- tenantId: data.tenantId
9144
+ password: data.password
9151
9145
  });
9152
9146
  }
9153
9147
  });
@@ -5,6 +5,7 @@ import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToke
5
5
  import { SupabaseClient } from '@supabase/supabase-js';
6
6
  import '@tanstack/react-query';
7
7
  import './view-type-CfcWWR0w.mjs';
8
+ import '@supabase/auth-js';
8
9
  import './base-model-type-DD8uZnDP.mjs';
9
10
  import './models.mjs';
10
11
 
@@ -5,6 +5,7 @@ import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToke
5
5
  import { SupabaseClient } from '@supabase/supabase-js';
6
6
  import '@tanstack/react-query';
7
7
  import './view-type-CfcWWR0w.js';
8
+ import '@supabase/auth-js';
8
9
  import './base-model-type-DD8uZnDP.js';
9
10
  import './models.js';
10
11
 
package/dist/provider.js CHANGED
@@ -737,7 +737,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
737
737
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
738
738
  UriConstants2["TOKEN_BY_CODE"] = "/token";
739
739
  UriConstants2["LOGOUT"] = "/logout";
740
- UriConstants2["LOGIN_PATH"] = "/login";
741
740
  UriConstants2["CREATE_UPDATE"] = "/create_update";
742
741
  UriConstants2["SEARCH_READ"] = "/search_read";
743
742
  UriConstants2["CREATE_PATH"] = "/create";
@@ -3279,7 +3278,7 @@ function useActionService() {
3279
3278
  [env]
3280
3279
  );
3281
3280
  const actionServerHome = (0, import_react3.useCallback)(async () => {
3282
- return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3281
+ return await env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3283
3282
  }, [env]);
3284
3283
  return {
3285
3284
  loadAction,
@@ -3364,23 +3363,19 @@ function useAuthService() {
3364
3363
  );
3365
3364
  const loginTenantUser = (0, import_react5.useCallback)(
3366
3365
  async (body) => {
3367
- const payload = {
3368
- username: body.email,
3369
- password: body.password,
3370
- tenantId: body.tenantId
3371
- };
3372
- return env?.requests?.post(
3373
- "/login" /* LOGIN_PATH */,
3374
- payload,
3375
- {
3376
- headers: {
3377
- "Content-Type": "application/json"
3378
- }
3379
- },
3380
- "id"
3381
- );
3366
+ if (!supabase) {
3367
+ return {
3368
+ data: null,
3369
+ error: { message: "Supabase client is not initialized" }
3370
+ };
3371
+ }
3372
+ const { data, error } = await supabase.auth.signInWithPassword({
3373
+ email: body.email,
3374
+ password: body.password
3375
+ });
3376
+ return { data, error };
3382
3377
  },
3383
- [env]
3378
+ [supabase]
3384
3379
  );
3385
3380
  const forgotPassword = (0, import_react5.useCallback)(
3386
3381
  async (email) => {
@@ -7900,8 +7895,7 @@ var useLoginTenantUser = () => {
7900
7895
  mutationFn: (data) => {
7901
7896
  return loginTenantUser({
7902
7897
  email: data.email,
7903
- password: data.password,
7904
- tenantId: data.tenantId
7898
+ password: data.password
7905
7899
  });
7906
7900
  }
7907
7901
  });
package/dist/provider.mjs CHANGED
@@ -692,7 +692,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
692
692
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
693
693
  UriConstants2["TOKEN_BY_CODE"] = "/token";
694
694
  UriConstants2["LOGOUT"] = "/logout";
695
- UriConstants2["LOGIN_PATH"] = "/login";
696
695
  UriConstants2["CREATE_UPDATE"] = "/create_update";
697
696
  UriConstants2["SEARCH_READ"] = "/search_read";
698
697
  UriConstants2["CREATE_PATH"] = "/create";
@@ -3234,7 +3233,7 @@ function useActionService() {
3234
3233
  [env]
3235
3234
  );
3236
3235
  const actionServerHome = useCallback(async () => {
3237
- return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3236
+ return await env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
3238
3237
  }, [env]);
3239
3238
  return {
3240
3239
  loadAction,
@@ -3319,23 +3318,19 @@ function useAuthService() {
3319
3318
  );
3320
3319
  const loginTenantUser = useCallback2(
3321
3320
  async (body) => {
3322
- const payload = {
3323
- username: body.email,
3324
- password: body.password,
3325
- tenantId: body.tenantId
3326
- };
3327
- return env?.requests?.post(
3328
- "/login" /* LOGIN_PATH */,
3329
- payload,
3330
- {
3331
- headers: {
3332
- "Content-Type": "application/json"
3333
- }
3334
- },
3335
- "id"
3336
- );
3321
+ if (!supabase) {
3322
+ return {
3323
+ data: null,
3324
+ error: { message: "Supabase client is not initialized" }
3325
+ };
3326
+ }
3327
+ const { data, error } = await supabase.auth.signInWithPassword({
3328
+ email: body.email,
3329
+ password: body.password
3330
+ });
3331
+ return { data, error };
3337
3332
  },
3338
- [env]
3333
+ [supabase]
3339
3334
  );
3340
3335
  const forgotPassword = useCallback2(
3341
3336
  async (email) => {
@@ -7855,8 +7850,7 @@ var useLoginTenantUser = () => {
7855
7850
  mutationFn: (data) => {
7856
7851
  return loginTenantUser({
7857
7852
  email: data.email,
7858
- password: data.password,
7859
- tenantId: data.tenantId
7853
+ password: data.password
7860
7854
  });
7861
7855
  }
7862
7856
  });
@@ -1,4 +1,5 @@
1
1
  import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, T as TThreadData, h as GetExternalTab, b as GetListParams, a as GetDetailParams, S as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, f as GetViewParams, c as GetSelectionType } from './view-type-CfcWWR0w.mjs';
2
+ import * as _supabase_auth_js from '@supabase/auth-js';
2
3
 
3
4
  declare function useActionService(): {
4
5
  loadAction: ({ idAction, context, service, xNode, searchParams, }: {
@@ -59,8 +60,23 @@ declare function useAuthService(): {
59
60
  loginTenantUser: (body: {
60
61
  email: string;
61
62
  password: string;
62
- tenantId: string;
63
- }) => Promise<any>;
63
+ }) => Promise<{
64
+ data: null;
65
+ error: {
66
+ message: string;
67
+ };
68
+ } | {
69
+ data: {
70
+ user: _supabase_auth_js.User;
71
+ session: _supabase_auth_js.Session;
72
+ weakPassword?: _supabase_auth_js.WeakPassword;
73
+ } | {
74
+ user: null;
75
+ session: null;
76
+ weakPassword?: null | undefined;
77
+ };
78
+ error: _supabase_auth_js.AuthError | null;
79
+ }>;
64
80
  forgotPassword: (email: string) => Promise<any>;
65
81
  forgotPasswordSSO: ({ email, with_context, method, }: {
66
82
  email: string;
@@ -1,4 +1,5 @@
1
1
  import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, T as TThreadData, h as GetExternalTab, b as GetListParams, a as GetDetailParams, S as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, f as GetViewParams, c as GetSelectionType } from './view-type-CfcWWR0w.js';
2
+ import * as _supabase_auth_js from '@supabase/auth-js';
2
3
 
3
4
  declare function useActionService(): {
4
5
  loadAction: ({ idAction, context, service, xNode, searchParams, }: {
@@ -59,8 +60,23 @@ declare function useAuthService(): {
59
60
  loginTenantUser: (body: {
60
61
  email: string;
61
62
  password: string;
62
- tenantId: string;
63
- }) => Promise<any>;
63
+ }) => Promise<{
64
+ data: null;
65
+ error: {
66
+ message: string;
67
+ };
68
+ } | {
69
+ data: {
70
+ user: _supabase_auth_js.User;
71
+ session: _supabase_auth_js.Session;
72
+ weakPassword?: _supabase_auth_js.WeakPassword;
73
+ } | {
74
+ user: null;
75
+ session: null;
76
+ weakPassword?: null | undefined;
77
+ };
78
+ error: _supabase_auth_js.AuthError | null;
79
+ }>;
64
80
  forgotPassword: (email: string) => Promise<any>;
65
81
  forgotPasswordSSO: ({ email, with_context, method, }: {
66
82
  email: string;
package/dist/services.js CHANGED
@@ -78,7 +78,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
78
78
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
79
79
  UriConstants2["TOKEN_BY_CODE"] = "/token";
80
80
  UriConstants2["LOGOUT"] = "/logout";
81
- UriConstants2["LOGIN_PATH"] = "/login";
82
81
  UriConstants2["CREATE_UPDATE"] = "/create_update";
83
82
  UriConstants2["SEARCH_READ"] = "/search_read";
84
83
  UriConstants2["CREATE_PATH"] = "/create";
@@ -5620,7 +5619,7 @@ function useActionService() {
5620
5619
  [env]
5621
5620
  );
5622
5621
  const actionServerHome = (0, import_react62.useCallback)(async () => {
5623
- return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5622
+ return await env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5624
5623
  }, [env]);
5625
5624
  return {
5626
5625
  loadAction,
@@ -5667,23 +5666,19 @@ function useAuthService() {
5667
5666
  );
5668
5667
  const loginTenantUser = (0, import_react63.useCallback)(
5669
5668
  async (body) => {
5670
- const payload = {
5671
- username: body.email,
5672
- password: body.password,
5673
- tenantId: body.tenantId
5674
- };
5675
- return env?.requests?.post(
5676
- "/login" /* LOGIN_PATH */,
5677
- payload,
5678
- {
5679
- headers: {
5680
- "Content-Type": "application/json"
5681
- }
5682
- },
5683
- "id"
5684
- );
5669
+ if (!supabase) {
5670
+ return {
5671
+ data: null,
5672
+ error: { message: "Supabase client is not initialized" }
5673
+ };
5674
+ }
5675
+ const { data, error } = await supabase.auth.signInWithPassword({
5676
+ email: body.email,
5677
+ password: body.password
5678
+ });
5679
+ return { data, error };
5685
5680
  },
5686
- [env]
5681
+ [supabase]
5687
5682
  );
5688
5683
  const forgotPassword = (0, import_react63.useCallback)(
5689
5684
  async (email) => {
package/dist/services.mjs CHANGED
@@ -32,7 +32,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
32
32
  UriConstants2["GRANT_ACCESS"] = "/grant-access";
33
33
  UriConstants2["TOKEN_BY_CODE"] = "/token";
34
34
  UriConstants2["LOGOUT"] = "/logout";
35
- UriConstants2["LOGIN_PATH"] = "/login";
36
35
  UriConstants2["CREATE_UPDATE"] = "/create_update";
37
36
  UriConstants2["SEARCH_READ"] = "/search_read";
38
37
  UriConstants2["CREATE_PATH"] = "/create";
@@ -5574,7 +5573,7 @@ function useActionService() {
5574
5573
  [env]
5575
5574
  );
5576
5575
  const actionServerHome = useCallback56(async () => {
5577
- return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5576
+ return await env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
5578
5577
  }, [env]);
5579
5578
  return {
5580
5579
  loadAction,
@@ -5621,23 +5620,19 @@ function useAuthService() {
5621
5620
  );
5622
5621
  const loginTenantUser = useCallback57(
5623
5622
  async (body) => {
5624
- const payload = {
5625
- username: body.email,
5626
- password: body.password,
5627
- tenantId: body.tenantId
5628
- };
5629
- return env?.requests?.post(
5630
- "/login" /* LOGIN_PATH */,
5631
- payload,
5632
- {
5633
- headers: {
5634
- "Content-Type": "application/json"
5635
- }
5636
- },
5637
- "id"
5638
- );
5623
+ if (!supabase) {
5624
+ return {
5625
+ data: null,
5626
+ error: { message: "Supabase client is not initialized" }
5627
+ };
5628
+ }
5629
+ const { data, error } = await supabase.auth.signInWithPassword({
5630
+ email: body.email,
5631
+ password: body.password
5632
+ });
5633
+ return { data, error };
5639
5634
  },
5640
- [env]
5635
+ [supabase]
5641
5636
  );
5642
5637
  const forgotPassword = useCallback57(
5643
5638
  async (email) => {
package/package.json CHANGED
@@ -1,92 +1,92 @@
1
- {
2
- "name": "@fctc/interface-logic",
3
- "version": "4.9.3",
4
- "types": "dist/index.d.ts",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.cjs"
12
- },
13
- "./configs": {
14
- "types": "./dist/configs.d.ts",
15
- "import": "./dist/configs.mjs",
16
- "require": "./dist/configs.cjs"
17
- },
18
- "./constants": {
19
- "types": "./dist/constants.d.ts",
20
- "import": "./dist/constants.mjs",
21
- "require": "./dist/constants.cjs"
22
- },
23
- "./environment": {
24
- "types": "./dist/environment.d.ts",
25
- "import": "./dist/environment.mjs",
26
- "require": "./dist/environment.cjs"
27
- },
28
- "./hooks": {
29
- "types": "./dist/hooks.d.ts",
30
- "import": "./dist/hooks.mjs",
31
- "require": "./dist/hooks.cjs"
32
- },
33
- "./provider": {
34
- "types": "./dist/provider.d.ts",
35
- "import": "./dist/provider.mjs",
36
- "require": "./dist/provider.cjs"
37
- },
38
- "./services": {
39
- "types": "./dist/services.d.ts",
40
- "import": "./dist/services.mjs",
41
- "require": "./dist/services.cjs"
42
- },
43
- "./store": {
44
- "types": "./dist/store.d.ts",
45
- "import": "./dist/store.mjs",
46
- "require": "./dist/store.cjs"
47
- },
48
- "./utils": {
49
- "types": "./dist/utils.d.ts",
50
- "import": "./dist/utils.mjs",
51
- "require": "./dist/utils.cjs"
52
- },
53
- "./types": {
54
- "types": "./dist/types.d.ts",
55
- "import": "./dist/types.mjs",
56
- "require": "./dist/types.cjs"
57
- },
58
- "./models": {
59
- "types": "./dist/models.d.ts",
60
- "import": "./dist/models.mjs",
61
- "require": "./dist/models.cjs"
62
- }
63
- },
64
- "files": [
65
- "dist"
66
- ],
67
- "scripts": {
68
- "build": "tsup",
69
- "test": "jest"
70
- },
71
- "peerDependencies": {
72
- "@tanstack/react-query": "^5.83.0",
73
- "@supabase/supabase-js": "^2.90.1",
74
- "react": "18.0.0"
75
- },
76
- "dependencies": {
77
- "@reduxjs/toolkit": "^2.8.2",
78
- "@supabase/supabase-js": "^2.90.1",
79
- "@tanstack/react-query": "^5.83.0",
80
- "axios": "^1.11.0",
81
- "moment": "^2.30.1",
82
- "react-redux": "^9.2.0"
83
- },
84
- "devDependencies": {
85
- "@types/react": "^18.3.1",
86
- "jest": "^29.7.0",
87
- "react": "18.0.0",
88
- "tsup": "^8.0.0",
89
- "typescript": "^5.8.2"
90
- },
91
- "packageManager": "yarn@1.22.0"
92
- }
1
+ {
2
+ "name": "@fctc/interface-logic",
3
+ "version": "4.9.4",
4
+ "types": "dist/index.d.ts",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.mjs",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.cjs"
12
+ },
13
+ "./configs": {
14
+ "types": "./dist/configs.d.ts",
15
+ "import": "./dist/configs.mjs",
16
+ "require": "./dist/configs.cjs"
17
+ },
18
+ "./constants": {
19
+ "types": "./dist/constants.d.ts",
20
+ "import": "./dist/constants.mjs",
21
+ "require": "./dist/constants.cjs"
22
+ },
23
+ "./environment": {
24
+ "types": "./dist/environment.d.ts",
25
+ "import": "./dist/environment.mjs",
26
+ "require": "./dist/environment.cjs"
27
+ },
28
+ "./hooks": {
29
+ "types": "./dist/hooks.d.ts",
30
+ "import": "./dist/hooks.mjs",
31
+ "require": "./dist/hooks.cjs"
32
+ },
33
+ "./provider": {
34
+ "types": "./dist/provider.d.ts",
35
+ "import": "./dist/provider.mjs",
36
+ "require": "./dist/provider.cjs"
37
+ },
38
+ "./services": {
39
+ "types": "./dist/services.d.ts",
40
+ "import": "./dist/services.mjs",
41
+ "require": "./dist/services.cjs"
42
+ },
43
+ "./store": {
44
+ "types": "./dist/store.d.ts",
45
+ "import": "./dist/store.mjs",
46
+ "require": "./dist/store.cjs"
47
+ },
48
+ "./utils": {
49
+ "types": "./dist/utils.d.ts",
50
+ "import": "./dist/utils.mjs",
51
+ "require": "./dist/utils.cjs"
52
+ },
53
+ "./types": {
54
+ "types": "./dist/types.d.ts",
55
+ "import": "./dist/types.mjs",
56
+ "require": "./dist/types.cjs"
57
+ },
58
+ "./models": {
59
+ "types": "./dist/models.d.ts",
60
+ "import": "./dist/models.mjs",
61
+ "require": "./dist/models.cjs"
62
+ }
63
+ },
64
+ "files": [
65
+ "dist"
66
+ ],
67
+ "scripts": {
68
+ "build": "tsup",
69
+ "test": "jest"
70
+ },
71
+ "peerDependencies": {
72
+ "@tanstack/react-query": "^5.83.0",
73
+ "@supabase/supabase-js": "^2.90.1",
74
+ "react": "18.0.0"
75
+ },
76
+ "dependencies": {
77
+ "@reduxjs/toolkit": "^2.8.2",
78
+ "@supabase/supabase-js": "^2.90.1",
79
+ "@tanstack/react-query": "^5.83.0",
80
+ "axios": "^1.11.0",
81
+ "moment": "^2.30.1",
82
+ "react-redux": "^9.2.0"
83
+ },
84
+ "devDependencies": {
85
+ "@types/react": "^18.3.1",
86
+ "jest": "^29.7.0",
87
+ "react": "18.0.0",
88
+ "tsup": "^8.0.0",
89
+ "typescript": "^5.8.2"
90
+ },
91
+ "packageManager": "yarn@1.22.0"
92
+ }