@fctc/interface-logic 4.9.1 → 4.9.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.
@@ -5,7 +5,6 @@ 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';
9
8
  import './base-model-type-DD8uZnDP.mjs';
10
9
  import './models.mjs';
11
10
 
@@ -5,7 +5,6 @@ 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';
9
8
  import './base-model-type-DD8uZnDP.js';
10
9
  import './models.js';
11
10
 
package/dist/provider.js CHANGED
@@ -737,6 +737,7 @@ 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";
740
741
  UriConstants2["CREATE_UPDATE"] = "/create_update";
741
742
  UriConstants2["SEARCH_READ"] = "/search_read";
742
743
  UriConstants2["CREATE_PATH"] = "/create";
@@ -3363,19 +3364,23 @@ function useAuthService() {
3363
3364
  );
3364
3365
  const loginTenantUser = (0, import_react5.useCallback)(
3365
3366
  async (body) => {
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 };
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
+ );
3377
3382
  },
3378
- [supabase]
3383
+ [env]
3379
3384
  );
3380
3385
  const forgotPassword = (0, import_react5.useCallback)(
3381
3386
  async (email) => {
@@ -7895,7 +7900,8 @@ var useLoginTenantUser = () => {
7895
7900
  mutationFn: (data) => {
7896
7901
  return loginTenantUser({
7897
7902
  email: data.email,
7898
- password: data.password
7903
+ password: data.password,
7904
+ tenantId: data.tenantId
7899
7905
  });
7900
7906
  }
7901
7907
  });
package/dist/provider.mjs CHANGED
@@ -692,6 +692,7 @@ 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";
695
696
  UriConstants2["CREATE_UPDATE"] = "/create_update";
696
697
  UriConstants2["SEARCH_READ"] = "/search_read";
697
698
  UriConstants2["CREATE_PATH"] = "/create";
@@ -3318,19 +3319,23 @@ function useAuthService() {
3318
3319
  );
3319
3320
  const loginTenantUser = useCallback2(
3320
3321
  async (body) => {
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 };
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
+ );
3332
3337
  },
3333
- [supabase]
3338
+ [env]
3334
3339
  );
3335
3340
  const forgotPassword = useCallback2(
3336
3341
  async (email) => {
@@ -7850,7 +7855,8 @@ var useLoginTenantUser = () => {
7850
7855
  mutationFn: (data) => {
7851
7856
  return loginTenantUser({
7852
7857
  email: data.email,
7853
- password: data.password
7858
+ password: data.password,
7859
+ tenantId: data.tenantId
7854
7860
  });
7855
7861
  }
7856
7862
  });
@@ -1,5 +1,4 @@
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';
3
2
 
4
3
  declare function useActionService(): {
5
4
  loadAction: ({ idAction, context, service, xNode, searchParams, }: {
@@ -60,23 +59,8 @@ declare function useAuthService(): {
60
59
  loginTenantUser: (body: {
61
60
  email: string;
62
61
  password: string;
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
- }>;
62
+ tenantId: string;
63
+ }) => Promise<any>;
80
64
  forgotPassword: (email: string) => Promise<any>;
81
65
  forgotPasswordSSO: ({ email, with_context, method, }: {
82
66
  email: string;
@@ -1,5 +1,4 @@
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';
3
2
 
4
3
  declare function useActionService(): {
5
4
  loadAction: ({ idAction, context, service, xNode, searchParams, }: {
@@ -60,23 +59,8 @@ declare function useAuthService(): {
60
59
  loginTenantUser: (body: {
61
60
  email: string;
62
61
  password: string;
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
- }>;
62
+ tenantId: string;
63
+ }) => Promise<any>;
80
64
  forgotPassword: (email: string) => Promise<any>;
81
65
  forgotPasswordSSO: ({ email, with_context, method, }: {
82
66
  email: string;
package/dist/services.js CHANGED
@@ -78,6 +78,7 @@ 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";
81
82
  UriConstants2["CREATE_UPDATE"] = "/create_update";
82
83
  UriConstants2["SEARCH_READ"] = "/search_read";
83
84
  UriConstants2["CREATE_PATH"] = "/create";
@@ -5666,19 +5667,23 @@ function useAuthService() {
5666
5667
  );
5667
5668
  const loginTenantUser = (0, import_react63.useCallback)(
5668
5669
  async (body) => {
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 };
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
+ );
5680
5685
  },
5681
- [supabase]
5686
+ [env]
5682
5687
  );
5683
5688
  const forgotPassword = (0, import_react63.useCallback)(
5684
5689
  async (email) => {
package/dist/services.mjs CHANGED
@@ -32,6 +32,7 @@ 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";
35
36
  UriConstants2["CREATE_UPDATE"] = "/create_update";
36
37
  UriConstants2["SEARCH_READ"] = "/search_read";
37
38
  UriConstants2["CREATE_PATH"] = "/create";
@@ -5620,19 +5621,23 @@ function useAuthService() {
5620
5621
  );
5621
5622
  const loginTenantUser = useCallback57(
5622
5623
  async (body) => {
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 };
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
+ );
5634
5639
  },
5635
- [supabase]
5640
+ [env]
5636
5641
  );
5637
5642
  const forgotPassword = useCallback57(
5638
5643
  async (email) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/interface-logic",
3
- "version": "4.9.1",
3
+ "version": "4.9.3",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",