@grapadigital/shared-app-modules 0.0.184 → 0.0.186

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/hooks.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+
1
3
  declare interface Environments {
2
4
  readonly VITE_BACKEND_API_CAMPAIGNS_URL?: string;
3
5
  readonly VITE_BACKEND_API_INFLUENCERS_URL?: string;
@@ -7,6 +9,19 @@ declare interface Environments {
7
9
  readonly VITE_BACKEND_API_ORGANIZATION_URL?: string;
8
10
  }
9
11
 
12
+ export declare interface OrganizationUserResult {
13
+ _id: string;
14
+ organization: string;
15
+ name: string;
16
+ email: string;
17
+ username: string;
18
+ team: string;
19
+ role: string;
20
+ disabled: boolean;
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ }
24
+
10
25
  declare interface SharedAppModulesContextData {
11
26
  environments: Environments;
12
27
  }
@@ -23,6 +38,8 @@ declare interface SharedAppModulesContextData {
23
38
  */
24
39
  export declare function useDebounce<T>(value: T, delay?: number): T;
25
40
 
41
+ export declare function useOrganizationResponsibleUsers(organizationId?: string): UseQueryResult<OrganizationUserResult[], Error>;
42
+
26
43
  export declare function useSharedAppModules(): SharedAppModulesContextData;
27
44
 
28
45
  export { }
package/dist/hooks.js CHANGED
@@ -1,5 +1,21 @@
1
- import { u, a } from "./chuncks/use-shared-app-modules.hook.jCQwZaT8.js";
1
+ import { u as s } from "./chuncks/axios.lib.DebbmKD8.js";
2
+ import { a as l } from "./chuncks/axios.lib.DebbmKD8.js";
3
+ import { useQuery as o } from "@tanstack/react-query";
4
+ import { l as n } from "./chuncks/organization-users.service.I1WrInGh.js";
5
+ function a(e) {
6
+ const { environments: r } = s();
7
+ return o({
8
+ queryKey: ["organization-users", e, "responsible"],
9
+ queryFn: () => n({
10
+ organizationId: e,
11
+ active: !0,
12
+ environment: r.VITE_BACKEND_API_ORGANIZATION_URL ?? ""
13
+ }),
14
+ enabled: !!e
15
+ });
16
+ }
2
17
  export {
3
- u as useDebounce,
4
- a as useSharedAppModules
18
+ l as useDebounce,
19
+ a as useOrganizationResponsibleUsers,
20
+ s as useSharedAppModules
5
21
  };
package/dist/utils.js CHANGED
@@ -1,7 +1,7 @@
1
- import { U as t } from "./chuncks/format.util.B1F-QlvS.js";
2
- import { g as y, h as k, f as C, b as E, d as L, m as P, c as _, e as O, a as D, p as I, u as U } from "./chuncks/format.util.B1F-QlvS.js";
3
- import { e as s } from "./chuncks/youtube-icon.component.Dasmq5T5.js";
4
- import { m as j, h as N, g as q, k as x, i as F, l as T, j as A, f as G } from "./chuncks/youtube-icon.component.Dasmq5T5.js";
1
+ import { U as t } from "./chuncks/format.util.5Vf4Qxpr.js";
2
+ import { g as y, h as k, f as C, b as E, d as L, m as P, c as _, e as O, a as D, p as I, u as U } from "./chuncks/format.util.5Vf4Qxpr.js";
3
+ import { e as s } from "./chuncks/youtube-icon.component.F4cd77xu.js";
4
+ import { m as j, h as N, g as q, k as x, i as F, l as T, j as A, f as G } from "./chuncks/youtube-icon.component.F4cd77xu.js";
5
5
  const a = (e) => e ? `${e} é obrigatório.` : "Campo obrigatório.", o = (e, r) => r ? `${r} deve ter no mínimo ${e} caracteres.` : `Deve ter no mínimo ${e} caracteres.`, n = (e, r) => r ? `${r} deve ter no máximo ${e} caracteres.` : `Deve ter no máximo ${e} caracteres.`, i = (e, r) => r ? `${r} não pode ser menor que ${e}.` : `Não pode ser menor que ${e}.`, m = (e, r) => r ? `${r} não pode ser maior que ${e}.` : `Não pode ser maior que ${e}.`, u = (e) => e ? `${e} inválido.` : "Valor inválido.", c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6
6
  __proto__: null,
7
7
  invalidMessage: u,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-app-modules",
3
3
  "private": false,
4
- "version": "0.0.184",
4
+ "version": "0.0.186",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
@@ -1,25 +0,0 @@
1
- import { useState as n, useEffect as s, useContext as d } from "react";
2
- import { a } from "./shared-app-modules.provider.DRJ7n4Cj.js";
3
- function i(e, o = 500) {
4
- const [t, r] = n(e);
5
- return s(() => {
6
- const u = setTimeout(() => {
7
- r(e);
8
- }, o);
9
- return () => {
10
- clearTimeout(u);
11
- };
12
- }, [e, o]), t;
13
- }
14
- function m() {
15
- const e = d(a);
16
- if (!e)
17
- throw new Error(
18
- "useSharedAppModules deve ser usando detro de um componente SharedAppModulesProvider"
19
- );
20
- return e;
21
- }
22
- export {
23
- m as a,
24
- i as u
25
- };