@bluecopa/react 0.1.25 → 0.1.27

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.
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./VREWMQAW-D426MVqt.js";
2
- import { g as d, c as f, a as e } from "./index-B7NS9D-_.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./VREWMQAW-BBkcgTur.js";
2
+ import { g as d, c as f, a as e } from "./index-BFV5kp8Q.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./VREWMQAW-D426MVqt.js";
2
- import { g as v, c as C, a as e } from "./index-B7NS9D-_.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./VREWMQAW-BBkcgTur.js";
2
+ import { g as v, c as C, a as e } from "./index-BFV5kp8Q.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,7 +1,7 @@
1
1
  var bs = Object.defineProperty;
2
2
  var ps = (e, t, n) => t in e ? bs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var _e = (e, t, n) => ps(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { b as xe, d as z, o as Ft, e as N, c as D, a as m, P as qo, S as B, t as _, i as k, f as V, h as F, j as ws, k as rr, u as $e, l as j, s as Vn, m as Gn, n as ut, p as A, q as xs, r as an, v as Ne, w as $s, x as _t, y as zt, z as Cs, A as Ss, B as xn, F as ks, C as Kr, D as Kt, $ as Ro, E as Es, G as Ds, H as W, I as Br, J as Ms, K as As, L as or, M as Fs, N as Ts, O as Rn, Q as Is, R as Ps, T as oe, U as Ls, V as Os } from "./index-B7NS9D-_.js";
4
+ import { b as xe, d as z, o as Ft, e as N, c as D, a as m, P as qo, S as B, t as _, i as k, f as V, h as F, j as ws, k as rr, u as $e, l as j, s as Vn, m as Gn, n as ut, p as A, q as xs, r as an, v as Ne, w as $s, x as _t, y as zt, z as Cs, A as Ss, B as xn, F as ks, C as Kr, D as Kt, $ as Ro, E as Es, G as Ds, H as W, I as Br, J as Ms, K as As, L as or, M as Fs, N as Ts, O as Rn, Q as Is, R as Ps, T as oe, U as Ls, V as Os } from "./index-BFV5kp8Q.js";
5
5
  var _s = (e) => e != null, qs = (e) => e.filter(_s);
6
6
  function Rs(e) {
7
7
  return (...t) => {
@@ -0,0 +1,34 @@
1
+ import { UseMutationResult } from '@tanstack/react-query';
2
+ import { BaseQueryOptions } from '../types';
3
+ export interface DeleteRowRequest {
4
+ tableId: string;
5
+ rowId: string | string[];
6
+ idField?: 'copa_id' | '_copa_id';
7
+ }
8
+ /**
9
+ * Custom hook for deleting one or more rows from an input table using TanStack React Query
10
+ *
11
+ * @param options - Mutation options including onSuccess, onError callbacks
12
+ * @returns useMutation for deleting row(s)
13
+ *
14
+ * @example
15
+ * const deleteRow = useDeleteRow({
16
+ * onSuccess: () => {
17
+ * queryClient.invalidateQueries({ queryKey: ['inputTableRows', tableId] });
18
+ * }
19
+ * });
20
+ *
21
+ * // Delete single row
22
+ * deleteRow.mutate({
23
+ * tableId: 'table-123',
24
+ * rowId: 'row-123'
25
+ * });
26
+ *
27
+ * // Delete multiple rows
28
+ * deleteRow.mutate({
29
+ * tableId: 'table-123',
30
+ * rowId: ['row-123', 'row-456']
31
+ * });
32
+ */
33
+ export declare function useDeleteRow(options?: BaseQueryOptions): UseMutationResult<any, Error, DeleteRowRequest>;
34
+ //# sourceMappingURL=useDeleteRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDeleteRow.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeleteRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE,gBAAqB,GAC7B,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAwBjD"}
@@ -0,0 +1,9 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { HttpTrigger } from '@bluecopa/core';
3
+ /**
4
+ * Custom hook for fetching all HTTP triggers (webhooks) in the current workspace using TanStack React Query
5
+ * @param options - Query options including enabled state and cache settings
6
+ * @returns UseQueryResult with HTTP triggers array
7
+ */
8
+ export declare function useGetAllHttpTriggers(options?: {}): UseQueryResult<HttpTrigger[], Error>;
9
+ //# sourceMappingURL=useGetAllHttpTriggers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGetAllHttpTriggers.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetAllHttpTriggers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,KAAK,GACX,cAAc,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAQtC"}
@@ -0,0 +1,9 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { User } from '@bluecopa/core';
3
+ /**
4
+ * Custom hook for fetching all users in the current workspace using TanStack React Query
5
+ * @param options - Query options including enabled state and cache settings
6
+ * @returns UseQueryResult with users array
7
+ */
8
+ export declare function useGetAllUsers(options?: {}): UseQueryResult<User[], Error>;
9
+ //# sourceMappingURL=useGetAllUsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGetAllUsers.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetAllUsers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,KAAK,GACX,cAAc,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAQ/B"}
@@ -0,0 +1,27 @@
1
+ import { UseMutationResult } from '@tanstack/react-query';
2
+ import { BaseQueryOptions } from '../types';
3
+ export interface InsertRowRequest {
4
+ tableId: string;
5
+ rowData: Record<string, any>;
6
+ }
7
+ /**
8
+ * Custom hook for inserting a new row into an input table using TanStack React Query
9
+ *
10
+ * @param options - Mutation options including onSuccess, onError callbacks
11
+ * @returns useMutation for inserting a row
12
+ *
13
+ * @example
14
+ * const insertRow = useInsertRow({
15
+ * onSuccess: () => {
16
+ * queryClient.invalidateQueries({ queryKey: ['inputTableRows', tableId] });
17
+ * }
18
+ * });
19
+ *
20
+ * // Usage
21
+ * insertRow.mutate({
22
+ * tableId: 'table-123',
23
+ * rowData: { name: 'Item 1', status: 'active' }
24
+ * });
25
+ */
26
+ export declare function useInsertRow(options?: BaseQueryOptions): UseMutationResult<any, Error, InsertRowRequest>;
27
+ //# sourceMappingURL=useInsertRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInsertRow.d.ts","sourceRoot":"","sources":["../../src/hooks/useInsertRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE,gBAAqB,GAC7B,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAoBjD"}
@@ -0,0 +1,30 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { GetRowsOptions, GetRowsResponse } from '@bluecopa/core';
3
+ import { BaseQueryOptions } from '../types';
4
+ /**
5
+ * Custom hook for fetching rows from an input table using TanStack React Query
6
+ * Supports Supabase-style filtering, pagination, and sorting
7
+ *
8
+ * @param tableId - The ID of the input table
9
+ * @param options - Query options including filters, pagination, and React Query options
10
+ * @returns UseQueryResult with rows data
11
+ *
12
+ * @example
13
+ * // Get all rows
14
+ * const { data, isLoading } = useRows('table-123');
15
+ *
16
+ * @example
17
+ * // Filter by equality
18
+ * const { data } = useRows('table-123', { status: 'active' });
19
+ *
20
+ * @example
21
+ * // Filter with operators and pagination
22
+ * const { data } = useRows('table-123', {
23
+ * price: 'gte.100',
24
+ * status: 'in.(active,pending)',
25
+ * limit: 10,
26
+ * offset: 0
27
+ * });
28
+ */
29
+ export declare function useRows(tableId: string | null | undefined, options?: GetRowsOptions & BaseQueryOptions): UseQueryResult<GetRowsResponse, Error>;
30
+ //# sourceMappingURL=useRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRows.d.ts","sourceRoot":"","sources":["../../src/hooks/useRows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAW,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAClC,OAAO,GAAE,cAAc,GAAG,gBAAqB,GAC9C,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,CA2CxC"}
@@ -0,0 +1,36 @@
1
+ import { UseMutationResult } from '@tanstack/react-query';
2
+ import { UpdateRowOptions } from '@bluecopa/core';
3
+ import { BaseQueryOptions } from '../types';
4
+ export interface UpdateRowRequest {
5
+ tableId: string;
6
+ updateData: UpdateRowOptions;
7
+ rowId?: string;
8
+ }
9
+ /**
10
+ * Custom hook for updating a row in an input table using TanStack React Query
11
+ *
12
+ * @param options - Mutation options including onSuccess, onError callbacks
13
+ * @returns useMutation for updating a row
14
+ *
15
+ * @example
16
+ * const updateRow = useUpdateRow({
17
+ * onSuccess: () => {
18
+ * queryClient.invalidateQueries({ queryKey: ['inputTableRows', tableId] });
19
+ * }
20
+ * });
21
+ *
22
+ * // Usage with rowId parameter
23
+ * updateRow.mutate({
24
+ * tableId: 'table-123',
25
+ * updateData: { status: 'completed' },
26
+ * rowId: 'row-123'
27
+ * });
28
+ *
29
+ * // Usage with copa_id in updateData
30
+ * updateRow.mutate({
31
+ * tableId: 'table-123',
32
+ * updateData: { _copa_id: 'row-123', status: 'completed' }
33
+ * });
34
+ */
35
+ export declare function useUpdateRow(options?: BaseQueryOptions): UseMutationResult<any, Error, UpdateRowRequest>;
36
+ //# sourceMappingURL=useUpdateRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateRow.d.ts","sourceRoot":"","sources":["../../src/hooks/useUpdateRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE,gBAAqB,GAC7B,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAwBjD"}