@bluecopa/react 0.1.38 → 0.1.39

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.
Files changed (66) hide show
  1. package/README.md +119 -61
  2. package/dist/{COOQDZLH-B_veh7tc.js → COOQDZLH-BJE6GxlC.js} +2 -2
  3. package/dist/{MU7WGUJF-BozjR1sa.js → MU7WGUJF-NINTUxO8.js} +2 -2
  4. package/dist/{VREWMQAW-BnM2Gcps.js → VREWMQAW-BJwDnUoP.js} +5 -5
  5. package/dist/hooks/useCheckSubscriptionStatus.d.ts.map +1 -1
  6. package/dist/hooks/useCreateAuditLog.d.ts.map +1 -1
  7. package/dist/hooks/useCreateConversation.d.ts +9 -0
  8. package/dist/hooks/useCreateConversation.d.ts.map +1 -0
  9. package/dist/hooks/useCreateStatementRun.d.ts.map +1 -1
  10. package/dist/hooks/useCreateThread.d.ts.map +1 -1
  11. package/dist/hooks/useDatasetSample.d.ts.map +1 -1
  12. package/dist/hooks/useDeleteComment.d.ts.map +1 -1
  13. package/dist/hooks/useDeleteRow.d.ts +1 -1
  14. package/dist/hooks/useDocumentPermissions.d.ts +16 -0
  15. package/dist/hooks/useDocumentPermissions.d.ts.map +1 -0
  16. package/dist/hooks/useGetAllConversations.d.ts +9 -0
  17. package/dist/hooks/useGetAllConversations.d.ts.map +1 -0
  18. package/dist/hooks/useGetAllUsers.d.ts.map +1 -1
  19. package/dist/hooks/useGetAuditLogs.d.ts.map +1 -1
  20. package/dist/hooks/useGetCommentsByThreadId.d.ts.map +1 -1
  21. package/dist/hooks/useGetConversation.d.ts +10 -0
  22. package/dist/hooks/useGetConversation.d.ts.map +1 -0
  23. package/dist/hooks/useGetFileUrlByFileId.d.ts +1 -1
  24. package/dist/hooks/useGetFileUrlByFileId.d.ts.map +1 -1
  25. package/dist/hooks/useGetFormData.d.ts.map +1 -1
  26. package/dist/hooks/useGetFormSchema.d.ts.map +1 -1
  27. package/dist/hooks/useGetPublishedWorkbookById.d.ts.map +1 -1
  28. package/dist/hooks/useGetRunResultById.d.ts.map +1 -1
  29. package/dist/hooks/useGetRunsByViewId.d.ts.map +1 -1
  30. package/dist/hooks/useGetStatementData.d.ts.map +1 -1
  31. package/dist/hooks/useGetTableById.d.ts.map +1 -1
  32. package/dist/hooks/useGetTaskDetails.d.ts.map +1 -1
  33. package/dist/hooks/useGetViewById.d.ts.map +1 -1
  34. package/dist/hooks/useGetViewsBySheetId.d.ts.map +1 -1
  35. package/dist/hooks/useGetWorkbookDetails.d.ts.map +1 -1
  36. package/dist/hooks/useGetWorkbooksByType.d.ts.map +1 -1
  37. package/dist/hooks/useGetWorkflowInstanceStatusById.d.ts.map +1 -1
  38. package/dist/hooks/useGetWorksheets.d.ts.map +1 -1
  39. package/dist/hooks/useGetWorksheetsByType.d.ts.map +1 -1
  40. package/dist/hooks/useInputTable.d.ts.map +1 -1
  41. package/dist/hooks/useMetric.d.ts.map +1 -1
  42. package/dist/hooks/usePostComment.d.ts.map +1 -1
  43. package/dist/hooks/useReplyToConversation.d.ts +9 -0
  44. package/dist/hooks/useReplyToConversation.d.ts.map +1 -0
  45. package/dist/hooks/useRows.d.ts.map +1 -1
  46. package/dist/hooks/useRunDefinition.d.ts.map +1 -1
  47. package/dist/hooks/useRunPublishedDefinition.d.ts.map +1 -1
  48. package/dist/hooks/useRunRecon.d.ts.map +1 -1
  49. package/dist/hooks/useRunSampleDefinition.d.ts +1 -1
  50. package/dist/hooks/useRunSampleDefinition.d.ts.map +1 -1
  51. package/dist/hooks/useSubscribeUser.d.ts.map +1 -1
  52. package/dist/hooks/useTriggerHttpWorkflow.d.ts.map +1 -1
  53. package/dist/hooks/useTriggerWorkflow.d.ts.map +1 -1
  54. package/dist/hooks/useUnsubscribeUser.d.ts.map +1 -1
  55. package/dist/hooks/useUpdateComment.d.ts.map +1 -1
  56. package/dist/hooks/useUser.d.ts.map +1 -1
  57. package/dist/{index-CTdgL_Gu.js → index-DE846Ued.js} +6633 -6236
  58. package/dist/index.d.ts +5 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.es.js +64 -59
  61. package/dist/types/index.d.ts +5 -2
  62. package/dist/types/index.d.ts.map +1 -1
  63. package/dist/utils/hookFactory.d.ts.map +1 -1
  64. package/dist/utils/queryUtils.d.ts +2 -2
  65. package/dist/utils/queryUtils.d.ts.map +1 -1
  66. package/package.json +2 -2
package/README.md CHANGED
@@ -6,7 +6,7 @@ A React library providing opinionated custom hooks for TanStack React Query inte
6
6
 
7
7
  ## Table of Contents
8
8
 
9
- - [@bluecopa/react ](#bluecopareact--)
9
+ - [@bluecopa/react ](#bluecopareact--)
10
10
  - [A Comprehensive React Query Integration for Bluecopa](#a-comprehensive-react-query-integration-for-bluecopa)
11
11
  - [Table of Contents](#table-of-contents)
12
12
  - [Features](#features)
@@ -83,7 +83,7 @@ npm install react@^18.0.0 react-dom@^18.0.0
83
83
  Wrap your application with the React Query provider:
84
84
 
85
85
  ```tsx
86
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
86
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
87
87
 
88
88
  const queryClient = new QueryClient({
89
89
  defaultOptions: {
@@ -115,15 +115,22 @@ import { useEffect, useState } from "react";
115
115
 
116
116
  const { QueryClient, QueryClientProvider } = reactQuery;
117
117
 
118
- export default function QueryProvider({ children }: { children: React.ReactNode }) {
119
- const [queryClient] = useState(() => new QueryClient({
120
- defaultOptions: {
121
- queries: {
122
- staleTime: 60 * 1000, // 1 minute
123
- refetchOnWindowFocus: false,
124
- },
125
- },
126
- }));
118
+ export default function QueryProvider({
119
+ children,
120
+ }: {
121
+ children: React.ReactNode;
122
+ }) {
123
+ const [queryClient] = useState(
124
+ () =>
125
+ new QueryClient({
126
+ defaultOptions: {
127
+ queries: {
128
+ staleTime: 60 * 1000, // 1 minute
129
+ refetchOnWindowFocus: false,
130
+ },
131
+ },
132
+ }),
133
+ );
127
134
 
128
135
  useEffect(() => {
129
136
  let copaUser: any = {};
@@ -131,14 +138,16 @@ export default function QueryProvider({ children }: { children: React.ReactNode
131
138
  const copaToken = import.meta.env.VITE_BLUECOPA_API_TOKEN
132
139
  ? atob(import.meta.env.VITE_BLUECOPA_API_TOKEN)
133
140
  : "{}";
134
-
141
+
135
142
  copaUser = JSON.parse(copaToken);
136
143
  } catch (error) {
137
144
  console.warn("Failed to parse VITE_BLUECOPA_API_TOKEN:", error);
138
145
  }
139
146
 
140
147
  copaSetConfig({
141
- apiBaseUrl: import.meta.env.VITE_BLUECOPA_API_URL || "https://develop.bluecopa.com/api/v1",
148
+ apiBaseUrl:
149
+ import.meta.env.VITE_BLUECOPA_API_URL ||
150
+ "https://develop.bluecopa.com/api/v1",
142
151
  workspaceId: import.meta.env.VITE_BLUECOPA_WORKSPACE_ID || "",
143
152
  accessToken: copaUser?.accessToken || "",
144
153
  });
@@ -155,13 +164,14 @@ export default function QueryProvider({ children }: { children: React.ReactNode
155
164
 
156
165
  **Required Environment Variables:**
157
166
 
158
- | Variable | Description | Example |
159
- |----------|-------------|---------|
160
- | `VITE_BLUECOPA_API_URL` | Base URL for Bluecopa API | `https://develop.bluecopa.com` |
161
- | `VITE_BLUECOPA_WORKSPACE_ID` | Your workspace identifier | `my-workspace-123` |
162
- | `VITE_BLUECOPA_API_TOKEN` | Base64-encoded JSON string containing `accessToken` | `eyJhY2Nlc3NUb2tlbiI6IjEyMzQ1In0=` |
167
+ | Variable | Description | Example |
168
+ | ---------------------------- | --------------------------------------------------- | ---------------------------------- |
169
+ | `VITE_BLUECOPA_API_URL` | Base URL for Bluecopa API | `https://develop.bluecopa.com` |
170
+ | `VITE_BLUECOPA_WORKSPACE_ID` | Your workspace identifier | `my-workspace-123` |
171
+ | `VITE_BLUECOPA_API_TOKEN` | Base64-encoded JSON string containing `accessToken` | `eyJhY2Nlc3NUb2tlbiI6IjEyMzQ1In0=` |
163
172
 
164
173
  **Example `.env` file:**
174
+
165
175
  ```
166
176
  VITE_BLUECOPA_API_URL=https://develop.bluecopa.com
167
177
  VITE_BLUECOPA_WORKSPACE_ID=your-workspace-id
@@ -171,7 +181,7 @@ VITE_BLUECOPA_API_TOKEN=base64-encoded-json-here
171
181
  Then wrap your application with this provider:
172
182
 
173
183
  ```tsx
174
- import QueryProvider from './providers/query-provider';
184
+ import QueryProvider from "./providers/query-provider";
175
185
 
176
186
  function App() {
177
187
  return (
@@ -189,17 +199,17 @@ This setup automatically configures the API client with your environment-specifi
189
199
  #### `useUser` - Fetch authenticated user
190
200
 
191
201
  ```tsx
192
- import { useUser } from '@bluecopa/react';
202
+ import { useUser } from "@bluecopa/react";
193
203
 
194
204
  function UserProfile() {
195
205
  const { data, isLoading, error } = useUser({
196
206
  staleTime: 5 * 60 * 1000, // 5 minutes
197
- retry: 2
207
+ retry: 2,
198
208
  });
199
-
209
+
200
210
  if (isLoading) return <div>Loading...</div>;
201
211
  if (error) return <div>Error: {error.message}</div>;
202
-
212
+
203
213
  return <div>Welcome, {data?.name}!</div>;
204
214
  }
205
215
  ```
@@ -207,39 +217,45 @@ function UserProfile() {
207
217
  #### `useDataset` - Fetch dataset with query controls
208
218
 
209
219
  ```tsx
210
- import { useDataset } from '@bluecopa/react';
220
+ import { useDataset } from "@bluecopa/react";
211
221
 
212
222
  function DatasetViewer({ datasetId }) {
213
223
  const { data, isLoading } = useDataset(datasetId, {
214
224
  limit: 500,
215
- staleTime: 10 * 60 * 1000 // 10 minutes
225
+ staleTime: 10 * 60 * 1000, // 10 minutes
216
226
  });
217
-
227
+
218
228
  if (isLoading) return <div>Loading dataset...</div>;
219
- return <div>{data?.name} ({data?.records?.length} records)</div>;
229
+ return (
230
+ <div>
231
+ {data?.name} ({data?.records?.length} records)
232
+ </div>
233
+ );
220
234
  }
221
235
  ```
222
236
 
223
237
  #### `useRows` - Fetch input table rows with Supabase-style filtering
224
238
 
225
239
  ```tsx
226
- import { useRows } from '@bluecopa/react';
240
+ import { useRows } from "@bluecopa/react";
227
241
 
228
242
  function TableRows({ tableId }) {
229
243
  const { data, isLoading, error } = useRows(tableId, {
230
- status: 'active',
231
- price: 'gte.100',
244
+ status: "active",
245
+ price: "gte.100",
232
246
  limit: 25,
233
- offset: 0
247
+ offset: 0,
234
248
  });
235
-
249
+
236
250
  if (isLoading) return <div>Loading rows...</div>;
237
251
  if (error) return <div>Error: {error.message}</div>;
238
-
252
+
239
253
  return (
240
254
  <div>
241
255
  <div>Total: {data?.total_count ?? 0}</div>
242
- {data?.data?.map(row => <div key={row._copa_id}>{JSON.stringify(row)}</div>)}
256
+ {data?.data?.map((row) => (
257
+ <div key={row._copa_id}>{JSON.stringify(row)}</div>
258
+ ))}
243
259
  </div>
244
260
  );
245
261
  }
@@ -253,10 +269,12 @@ function TableRows({ tableId }) {
253
269
 
254
270
  Fetches authenticated user details with query controls.
255
271
 
256
- **Parameters:**
272
+ **Parameters:**
273
+
257
274
  - `options` (optional): Query options extending TanStack React Query's `UseQueryOptions`
258
275
 
259
- **Returns:**
276
+ **Returns:**
277
+
260
278
  - `data`: User object or `undefined`
261
279
  - `isLoading`: Boolean indicating loading state
262
280
  - `error`: Error object if request failed
@@ -266,13 +284,15 @@ Fetches authenticated user details with query controls.
266
284
 
267
285
  Fetches dataset data by ID with configurable parameters.
268
286
 
269
- **Parameters:**
287
+ **Parameters:**
288
+
270
289
  - `datasetId`: ID of the dataset to fetch
271
290
  - `options` (optional): Query options with:
272
291
  - `limit`: Maximum records to fetch
273
292
  - `staleTime`: Duration (ms) before data is considered stale
274
293
 
275
- **Returns:**
294
+ **Returns:**
295
+
276
296
  - `data`: Dataset object containing name and records
277
297
  - `isLoading`: Boolean indicating loading state
278
298
  - `error`: Error object if request failed
@@ -282,11 +302,13 @@ Fetches dataset data by ID with configurable parameters.
282
302
 
283
303
  Fetches a representative sample of dataset data.
284
304
 
285
- **Parameters:**
305
+ **Parameters:**
306
+
286
307
  - `datasetId`: ID of the dataset
287
308
  - `options` (optional): Query options with `enabled` flag
288
309
 
289
- **Returns:**
310
+ **Returns:**
311
+
290
312
  - `data`: Object containing sample data
291
313
  - `isLoading`: Boolean indicating loading state
292
314
  - `refetch`: Function to manually trigger refetch
@@ -295,11 +317,13 @@ Fetches a representative sample of dataset data.
295
317
 
296
318
  Fetches metric data by ID.
297
319
 
298
- **Parameters:**
320
+ **Parameters:**
321
+
299
322
  - `metricId`: ID of the metric
300
323
  - `options` (optional): Query options
301
324
 
302
- **Returns:**
325
+ **Returns:**
326
+
303
327
  - `data`: Metric object with name and value
304
328
  - `isLoading`: Boolean indicating loading state
305
329
  - `error`: Error object if request failed
@@ -309,13 +333,15 @@ Fetches metric data by ID.
309
333
 
310
334
  Fetches input table data with limit parameters.
311
335
 
312
- **Parameters:**
336
+ **Parameters:**
337
+
313
338
  - `inputTableId`: ID of the input table
314
339
  - `options` (optional): Query options with `limitParams`:
315
340
  - `limit`: Maximum rows to fetch
316
341
  - `limitFrom`: Direction to apply limit from ('top' or 'bottom')
317
342
 
318
- **Returns:**
343
+ **Returns:**
344
+
319
345
  - `data`: Input table object with rows
320
346
  - `isLoading`: Boolean indicating loading state
321
347
  - `error`: Error object if request failed
@@ -325,7 +351,8 @@ Fetches input table data with limit parameters.
325
351
 
326
352
  Fetches rows from an input table with Supabase-style filtering, pagination, and sorting. Supports advanced filtering operators and group expressions.
327
353
 
328
- **Parameters:**
354
+ **Parameters:**
355
+
329
356
  - `tableId`: ID of the input table (string | null | undefined)
330
357
  - `options` (optional): Query options extending `GetRowsOptions` and `BaseQueryOptions`:
331
358
  - `limit`: Maximum rows to fetch (1-10000)
@@ -337,7 +364,8 @@ Fetches rows from an input table with Supabase-style filtering, pagination, and
337
364
  - `and`: Supabase/PostgREST group expression for AND conditions
338
365
  - React Query options: `enabled`, `staleTime`, `gcTime`, `retry`, `retryDelay`, `onSuccess`, `onError`
339
366
 
340
- **Returns:**
367
+ **Returns:**
368
+
341
369
  - `data`: `GetRowsResponse` object containing:
342
370
  - `data`: Array of row objects
343
371
  - `count`: Number of rows in current page
@@ -347,12 +375,13 @@ Fetches rows from an input table with Supabase-style filtering, pagination, and
347
375
  - `refetch`: Function to manually trigger refetch
348
376
 
349
377
  **Example:**
378
+
350
379
  ```tsx
351
- const { data, isLoading } = useRows('table-123', {
352
- status: 'active',
353
- price: 'gte.100',
380
+ const { data, isLoading } = useRows("table-123", {
381
+ status: "active",
382
+ price: "gte.100",
354
383
  limit: 25,
355
- offset: 0
384
+ offset: 0,
356
385
  });
357
386
  ```
358
387
 
@@ -363,10 +392,12 @@ const { data, isLoading } = useRows('table-123', {
363
392
  Fetches the URL for a file by its ID.
364
393
 
365
394
  **Parameters:**
395
+
366
396
  - `fileId`: ID of the file to fetch URL for
367
397
  - `options` (optional): Query options extending TanStack React Query's `UseQueryOptions`
368
398
 
369
399
  **Returns:**
400
+
370
401
  - `data`: Object containing file URL
371
402
  - `isLoading`: Boolean indicating loading state
372
403
  - `error`: Error object if request failed
@@ -377,10 +408,12 @@ Fetches the URL for a file by its ID.
377
408
  Fetches published workbook details by ID.
378
409
 
379
410
  **Parameters:**
411
+
380
412
  - `workbookId`: ID of the published workbook
381
413
  - `options` (optional): Query options
382
414
 
383
415
  **Returns:**
416
+
384
417
  - `data`: Published workbook object
385
418
  - `isLoading`: Boolean indicating loading state
386
419
  - `error`: Error object if request failed
@@ -391,10 +424,12 @@ Fetches published workbook details by ID.
391
424
  Fetches table metadata by ID.
392
425
 
393
426
  **Parameters:**
427
+
394
428
  - `tableId`: ID of the table
395
429
  - `options` (optional): Query options
396
430
 
397
431
  **Returns:**
432
+
398
433
  - `data`: Table metadata object
399
434
  - `isLoading`: Boolean indicating loading state
400
435
  - `error`: Error object if request failed
@@ -405,10 +440,12 @@ Fetches table metadata by ID.
405
440
  Fetches workbooks filtered by type.
406
441
 
407
442
  **Parameters:**
443
+
408
444
  - `workbookType`: Type of workbooks to fetch
409
445
  - `options` (optional): Query options
410
446
 
411
447
  **Returns:**
448
+
412
449
  - `data`: Array of workbook objects
413
450
  - `isLoading`: Boolean indicating loading state
414
451
  - `error`: Error object if request failed
@@ -419,10 +456,12 @@ Fetches workbooks filtered by type.
419
456
  Fetches workflow instance status by ID.
420
457
 
421
458
  **Parameters:**
459
+
422
460
  - `instanceId`: ID of the workflow instance
423
461
  - `options` (optional): Query options
424
462
 
425
463
  **Returns:**
464
+
426
465
  - `data`: Workflow status object
427
466
  - `isLoading`: Boolean indicating loading state
428
467
  - `error`: Error object if request failed
@@ -433,9 +472,11 @@ Fetches workflow instance status by ID.
433
472
  Fetches all available worksheets.
434
473
 
435
474
  **Parameters:**
475
+
436
476
  - `options` (optional): Query options
437
477
 
438
478
  **Returns:**
479
+
439
480
  - `data`: Array of worksheet objects
440
481
  - `isLoading`: Boolean indicating loading state
441
482
  - `error`: Error object if request failed
@@ -446,10 +487,12 @@ Fetches all available worksheets.
446
487
  Fetches worksheets filtered by type.
447
488
 
448
489
  **Parameters:**
490
+
449
491
  - `worksheetType`: Type of worksheets to fetch
450
492
  - `options` (optional): Query options
451
493
 
452
494
  **Returns:**
495
+
453
496
  - `data`: Array of worksheet objects
454
497
  - `isLoading`: Boolean indicating loading state
455
498
  - `error`: Error object if request failed
@@ -460,10 +503,12 @@ Fetches worksheets filtered by type.
460
503
  Executes a run definition.
461
504
 
462
505
  **Parameters:**
506
+
463
507
  - `definitionId`: ID of the run definition
464
508
  - `options` (optional): Query options
465
509
 
466
510
  **Returns:**
511
+
467
512
  - `data`: Execution result
468
513
  - `isLoading`: Boolean indicating loading state
469
514
  - `error`: Error object if request failed
@@ -474,10 +519,12 @@ Executes a run definition.
474
519
  Executes a published run definition.
475
520
 
476
521
  **Parameters:**
522
+
477
523
  - `publishedDefinitionId`: ID of the published definition
478
524
  - `options` (optional): Query options
479
525
 
480
526
  **Returns:**
527
+
481
528
  - `data`: Execution result
482
529
  - `isLoading`: Boolean indicating loading state
483
530
  - `error`: Error object if request failed
@@ -488,10 +535,12 @@ Executes a published run definition.
488
535
  Executes a sample run definition.
489
536
 
490
537
  **Parameters:**
538
+
491
539
  - `sampleDefinitionId`: ID of the sample definition
492
540
  - `options` (optional): Query options
493
541
 
494
542
  **Returns:**
543
+
495
544
  - `data`: Sample execution result
496
545
  - `isLoading`: Boolean indicating loading state
497
546
  - `error`: Error object if request failed
@@ -502,11 +551,13 @@ Executes a sample run definition.
502
551
  Triggers an HTTP workflow execution.
503
552
 
504
553
  **Parameters:**
554
+
505
555
  - `workflowId`: ID of the workflow
506
556
  - `payload`: Request payload
507
557
  - `options` (optional): Query options
508
558
 
509
559
  **Returns:**
560
+
510
561
  - `data`: Workflow execution response
511
562
  - `isLoading`: Boolean indicating loading state
512
563
  - `error`: Error object if request failed
@@ -517,10 +568,12 @@ Triggers an HTTP workflow execution.
517
568
  Triggers a workflow execution.
518
569
 
519
570
  **Parameters:**
571
+
520
572
  - `workflowId`: ID of the workflow
521
573
  - `options` (optional): Query options
522
574
 
523
575
  **Returns:**
576
+
524
577
  - `data`: Workflow execution response
525
578
  - `isLoading`: Boolean indicating loading state
526
579
  - `error`: Error object if request failed
@@ -531,10 +584,12 @@ Triggers a workflow execution.
531
584
  Fetches workbook details by ID.
532
585
 
533
586
  **Parameters:**
587
+
534
588
  - `workbookId`: ID of the workbook
535
589
  - `options` (optional): Query options
536
590
 
537
591
  **Returns:**
592
+
538
593
  - `data`: Workbook object
539
594
  - `isLoading`: Boolean indicating loading state
540
595
  - `error`: Error object if request failed
@@ -545,10 +600,12 @@ Fetches workbook details by ID.
545
600
  Fetches workflow configuration by ID.
546
601
 
547
602
  **Parameters:**
603
+
548
604
  - `workflowId`: ID of the workflow
549
605
  - `options` (optional): Query options
550
606
 
551
607
  **Returns:**
608
+
552
609
  - `data`: Workflow configuration object
553
610
  - `isLoading`: Boolean indicating loading state
554
611
  - `error`: Error object if request failed
@@ -559,16 +616,17 @@ Fetches workflow configuration by ID.
559
616
  Fetches worksheet details by ID.
560
617
 
561
618
  **Parameters:**
619
+
562
620
  - `worksheetId`: ID of the worksheet
563
621
  - `options` (optional): Query options
564
622
 
565
623
  **Returns:**
624
+
566
625
  - `data`: Worksheet object
567
626
  - `isLoading`: Boolean indicating loading state
568
627
  - `error`: Error object if request failed
569
628
  - `refetch`: Function to manually trigger refetch
570
629
 
571
-
572
630
  ## Configuration
573
631
 
574
632
  ### Default Query Configuration
@@ -591,9 +649,9 @@ All hooks accept standard TanStack React Query options:
591
649
 
592
650
  ```ts
593
651
  interface QueryOptions {
594
- enabled?: boolean; // Enable/disable query
595
- staleTime?: number; // Duration (ms) before data is stale
596
- gcTime?: number; // Duration (ms) to keep data in cache
652
+ enabled?: boolean; // Enable/disable query
653
+ staleTime?: number; // Duration (ms) before data is stale
654
+ gcTime?: number; // Duration (ms) to keep data in cache
597
655
  retry?: number | boolean; // Number of retries or disable retries
598
656
  onSuccess?: (data: any) => void; // Success callback
599
657
  onError?: (error: Error) => void; // Error callback
@@ -607,9 +665,9 @@ interface QueryOptions {
607
665
  ```tsx
608
666
  useUser({
609
667
  onError: (error) => {
610
- console.error('User fetch failed:', error.message);
668
+ console.error("User fetch failed:", error.message);
611
669
  // Custom error recovery logic
612
- }
670
+ },
613
671
  });
614
672
  ```
615
673
 
@@ -618,7 +676,7 @@ useUser({
618
676
  ```tsx
619
677
  function ManualRefetch() {
620
678
  const { data, refetch } = useUser();
621
-
679
+
622
680
  return (
623
681
  <div>
624
682
  <button onClick={() => refetch()}>Refresh</button>
@@ -632,13 +690,13 @@ function ManualRefetch() {
632
690
  This package re-exports core TanStack React Query utilities:
633
691
 
634
692
  ```ts
635
- import {
693
+ import {
636
694
  useQuery,
637
695
  useMutation,
638
696
  QueryClient,
639
697
  QueryClientProvider,
640
- ReactQueryDevtools
641
- } from '@bluecopa/react';
698
+ ReactQueryDevtools,
699
+ } from "@bluecopa/react";
642
700
  ```
643
701
 
644
702
  ## TypeScript Support
@@ -646,7 +704,7 @@ import {
646
704
  Fully typed with TypeScript. All hooks provide proper type inference and IntelliSense support. Extend types for custom use cases:
647
705
 
648
706
  ```ts
649
- import { User } from '@bluecopa/react';
707
+ import { User } from "@bluecopa/react";
650
708
 
651
709
  interface CustomUser extends User {
652
710
  role: string;
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./VREWMQAW-BnM2Gcps.js";
2
- import { g as d, c as f, a as e } from "./index-CTdgL_Gu.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./VREWMQAW-BJwDnUoP.js";
2
+ import { g as d, c as f, a as e } from "./index-DE846Ued.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-BnM2Gcps.js";
2
- import { g as v, c as C, a as e } from "./index-CTdgL_Gu.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-BJwDnUoP.js";
2
+ import { g as v, c as C, a as e } from "./index-DE846Ued.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-CTdgL_Gu.js";
4
+ import { b as z, d as N, c as D, a as m, e as xe, o as Ft, P as qo, S as B, 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, t as _, 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 W, H as Br, I as Ds, J as Ms, K as or, L as As, 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-DE846Ued.js";
5
5
  var _s = (e) => e != null, qs = (e) => e.filter(_s);
6
6
  function Rs(e) {
7
7
  return (...t) => {
@@ -865,7 +865,7 @@ function L() {
865
865
  function fl(e, t) {
866
866
  const n = Kt(e), { onChange: r } = t;
867
867
  let o = new Set(t.appear ? void 0 : n);
868
- const s = /* @__PURE__ */ new WeakSet(), [l, a] = z([], { equals: !1 }), [i] = Es(), c = (g) => {
868
+ const s = /* @__PURE__ */ new WeakSet(), [l, a] = z([], { equals: !1 }), [i] = As(), c = (g) => {
869
869
  a((u) => (u.push.apply(u, g), u));
870
870
  for (const u of g)
871
871
  s.delete(u);
@@ -6335,7 +6335,7 @@ function mt(e) {
6335
6335
  }
6336
6336
  }), null), k(O, m(B, {
6337
6337
  get when() {
6338
- return D(() => !!e.onEdit)() && !Ms(e.value).meta;
6338
+ return D(() => !!e.onEdit)() && !Ds(e.value).meta;
6339
6339
  },
6340
6340
  get children() {
6341
6341
  var T = od();
@@ -6401,7 +6401,7 @@ function mt(e) {
6401
6401
  },
6402
6402
  get children() {
6403
6403
  var y = Jt();
6404
- return k(y, m(As, {
6404
+ return k(y, m(Ms, {
6405
6405
  get each() {
6406
6406
  return u();
6407
6407
  },
@@ -7545,7 +7545,7 @@ var gd = /* @__PURE__ */ _('<div><div aria-hidden=true></div><button type=button
7545
7545
  var d = _d(), h = d.firstChild, y = h.nextSibling, v = a;
7546
7546
  return typeof v == "function" ? an(v, d) : a = d, d.addEventListener("mouseleave", () => {
7547
7547
  c(!1), g(!1);
7548
- }), d.addEventListener("mouseenter", () => c(!0)), d.addEventListener("blur", () => g(!1)), d.addEventListener("focus", () => g(!0)), Ds(d, W({
7548
+ }), d.addEventListener("mouseenter", () => c(!0)), d.addEventListener("blur", () => g(!1)), d.addEventListener("focus", () => g(!0)), Es(d, W({
7549
7549
  get disabled() {
7550
7550
  return u();
7551
7551
  },
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckSubscriptionStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckSubscriptionStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAMzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,OAAO,GAAE,iCAAsC,GAC9C,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAgBrE"}
1
+ {"version":3,"file":"useCheckSubscriptionStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckSubscriptionStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAMzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,OAAO,GAAE,iCAAsC,GAC9C,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAmBrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateAuditLog.d.ts","sourceRoot":"","sources":["../../src/hooks/useCreateAuditLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAW,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGhE,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,KAAK,GACX,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,EAAE,qBAAqB,CAAC,CAOzE"}
1
+ {"version":3,"file":"useCreateAuditLog.d.ts","sourceRoot":"","sources":["../../src/hooks/useCreateAuditLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAW,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,KAAK,GACX,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,EAAE,qBAAqB,CAAC,CAOzE"}
@@ -0,0 +1,9 @@
1
+ import { UseMutationResult } from '@tanstack/react-query';
2
+ import { EmailConversation, CreateConversationRequest } from '@bluecopa/core';
3
+ /**
4
+ * Custom hook for creating an email conversation
5
+ * @param options - Mutation options
6
+ * @returns useMutation for creating a conversation
7
+ */
8
+ export declare function useCreateConversation(options?: {}): UseMutationResult<EmailConversation, Error, CreateConversationRequest>;
9
+ //# sourceMappingURL=useCreateConversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCreateConversation.d.ts","sourceRoot":"","sources":["../../src/hooks/useCreateConversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,KAAK,GACX,iBAAiB,CAAC,iBAAiB,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAYxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateStatementRun.d.ts","sourceRoot":"","sources":["../../src/hooks/useCreateStatementRun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,KAAK,GACX,iBAAiB,CAAC,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAO9E"}
1
+ {"version":3,"file":"useCreateStatementRun.d.ts","sourceRoot":"","sources":["../../src/hooks/useCreateStatementRun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,KAAK,GACX,iBAAiB,CAClB,wBAAwB,EACxB,KAAK,EACL,wBAAwB,CACzB,CAOA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateThread.d.ts","sourceRoot":"","sources":["../../src/hooks/useCreateThread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,sBAA2B,GACnC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAU/F"}
1
+ {"version":3,"file":"useCreateThread.d.ts","sourceRoot":"","sources":["../../src/hooks/useCreateThread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,sBAA2B,GACnC,iBAAiB,CAClB,OAAO,CAAC,IAAI,CAAC,oBAAoB,EACjC,KAAK,EACL,OAAO,CAAC,IAAI,CAAC,mBAAmB,CACjC,CAYA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDatasetSample.d.ts","sourceRoot":"","sources":["../../src/hooks/useDatasetSample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,iBAAsB,GAC9B,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAwB5B"}
1
+ {"version":3,"file":"useDatasetSample.d.ts","sourceRoot":"","sources":["../../src/hooks/useDatasetSample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,iBAAsB,GAC9B,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAwB5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDeleteComment.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeleteComment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,uBAA4B,GACpC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,KAAK,EAAE,MAAM,CAAC,CAUtE"}
1
+ {"version":3,"file":"useDeleteComment.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeleteComment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,uBAA4B,GACpC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,KAAK,EAAE,MAAM,CAAC,CAYtE"}
@@ -3,7 +3,7 @@ import { BaseQueryOptions } from '../types';
3
3
  export interface DeleteRowRequest {
4
4
  tableId: string;
5
5
  rowId: string | string[];
6
- idField?: 'copa_id' | '_copa_id';
6
+ idField?: "copa_id" | "_copa_id";
7
7
  }
8
8
  /**
9
9
  * Custom hook for deleting one or more rows from an input table using TanStack React Query