@bluecopa/react 0.1.37 → 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 +171 -48
  2. package/dist/{COOQDZLH-CeJPub0h.js → COOQDZLH-BJE6GxlC.js} +2 -2
  3. package/dist/{MU7WGUJF-Dejs9cZz.js → MU7WGUJF-NINTUxO8.js} +2 -2
  4. package/dist/{VREWMQAW-BK7QFq1W.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-D2jEWUAo.js → index-DE846Ued.js} +6846 -6432
  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)
@@ -24,6 +24,7 @@ A React library providing opinionated custom hooks for TanStack React Query inte
24
24
  - [`useDatasetSample(datasetId, options?)`](#usedatasetsampledatasetid-options)
25
25
  - [`useMetric(metricId, options?)`](#usemetricmetricid-options)
26
26
  - [`useInputTable(inputTableId, options?)`](#useinputtableinputtableid-options)
27
+ - [`useRows(tableId, options?)`](#userowstableid-options)
27
28
  - [`useGetFileUrlByFileId(fileId, options?)`](#usegetfileurlbyfileidfileid-options)
28
29
  - [`useGetPublishedWorkbookById(workbookId, options?)`](#usegetpublishedworkbookbyidworkbookid-options)
29
30
  - [`useGetTableById(tableId, options?)`](#usegettablebyidtableid-options)
@@ -82,7 +83,7 @@ npm install react@^18.0.0 react-dom@^18.0.0
82
83
  Wrap your application with the React Query provider:
83
84
 
84
85
  ```tsx
85
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
86
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
86
87
 
87
88
  const queryClient = new QueryClient({
88
89
  defaultOptions: {
@@ -114,15 +115,22 @@ import { useEffect, useState } from "react";
114
115
 
115
116
  const { QueryClient, QueryClientProvider } = reactQuery;
116
117
 
117
- export default function QueryProvider({ children }: { children: React.ReactNode }) {
118
- const [queryClient] = useState(() => new QueryClient({
119
- defaultOptions: {
120
- queries: {
121
- staleTime: 60 * 1000, // 1 minute
122
- refetchOnWindowFocus: false,
123
- },
124
- },
125
- }));
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
+ );
126
134
 
127
135
  useEffect(() => {
128
136
  let copaUser: any = {};
@@ -130,14 +138,16 @@ export default function QueryProvider({ children }: { children: React.ReactNode
130
138
  const copaToken = import.meta.env.VITE_BLUECOPA_API_TOKEN
131
139
  ? atob(import.meta.env.VITE_BLUECOPA_API_TOKEN)
132
140
  : "{}";
133
-
141
+
134
142
  copaUser = JSON.parse(copaToken);
135
143
  } catch (error) {
136
144
  console.warn("Failed to parse VITE_BLUECOPA_API_TOKEN:", error);
137
145
  }
138
146
 
139
147
  copaSetConfig({
140
- 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",
141
151
  workspaceId: import.meta.env.VITE_BLUECOPA_WORKSPACE_ID || "",
142
152
  accessToken: copaUser?.accessToken || "",
143
153
  });
@@ -154,13 +164,14 @@ export default function QueryProvider({ children }: { children: React.ReactNode
154
164
 
155
165
  **Required Environment Variables:**
156
166
 
157
- | Variable | Description | Example |
158
- |----------|-------------|---------|
159
- | `VITE_BLUECOPA_API_URL` | Base URL for Bluecopa API | `https://develop.bluecopa.com` |
160
- | `VITE_BLUECOPA_WORKSPACE_ID` | Your workspace identifier | `my-workspace-123` |
161
- | `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=` |
162
172
 
163
173
  **Example `.env` file:**
174
+
164
175
  ```
165
176
  VITE_BLUECOPA_API_URL=https://develop.bluecopa.com
166
177
  VITE_BLUECOPA_WORKSPACE_ID=your-workspace-id
@@ -170,7 +181,7 @@ VITE_BLUECOPA_API_TOKEN=base64-encoded-json-here
170
181
  Then wrap your application with this provider:
171
182
 
172
183
  ```tsx
173
- import QueryProvider from './providers/query-provider';
184
+ import QueryProvider from "./providers/query-provider";
174
185
 
175
186
  function App() {
176
187
  return (
@@ -188,17 +199,17 @@ This setup automatically configures the API client with your environment-specifi
188
199
  #### `useUser` - Fetch authenticated user
189
200
 
190
201
  ```tsx
191
- import { useUser } from '@bluecopa/react';
202
+ import { useUser } from "@bluecopa/react";
192
203
 
193
204
  function UserProfile() {
194
205
  const { data, isLoading, error } = useUser({
195
206
  staleTime: 5 * 60 * 1000, // 5 minutes
196
- retry: 2
207
+ retry: 2,
197
208
  });
198
-
209
+
199
210
  if (isLoading) return <div>Loading...</div>;
200
211
  if (error) return <div>Error: {error.message}</div>;
201
-
212
+
202
213
  return <div>Welcome, {data?.name}!</div>;
203
214
  }
204
215
  ```
@@ -206,29 +217,64 @@ function UserProfile() {
206
217
  #### `useDataset` - Fetch dataset with query controls
207
218
 
208
219
  ```tsx
209
- import { useDataset } from '@bluecopa/react';
220
+ import { useDataset } from "@bluecopa/react";
210
221
 
211
222
  function DatasetViewer({ datasetId }) {
212
223
  const { data, isLoading } = useDataset(datasetId, {
213
224
  limit: 500,
214
- staleTime: 10 * 60 * 1000 // 10 minutes
225
+ staleTime: 10 * 60 * 1000, // 10 minutes
215
226
  });
216
-
227
+
217
228
  if (isLoading) return <div>Loading dataset...</div>;
218
- return <div>{data?.name} ({data?.records?.length} records)</div>;
229
+ return (
230
+ <div>
231
+ {data?.name} ({data?.records?.length} records)
232
+ </div>
233
+ );
234
+ }
235
+ ```
236
+
237
+ #### `useRows` - Fetch input table rows with Supabase-style filtering
238
+
239
+ ```tsx
240
+ import { useRows } from "@bluecopa/react";
241
+
242
+ function TableRows({ tableId }) {
243
+ const { data, isLoading, error } = useRows(tableId, {
244
+ status: "active",
245
+ price: "gte.100",
246
+ limit: 25,
247
+ offset: 0,
248
+ });
249
+
250
+ if (isLoading) return <div>Loading rows...</div>;
251
+ if (error) return <div>Error: {error.message}</div>;
252
+
253
+ return (
254
+ <div>
255
+ <div>Total: {data?.total_count ?? 0}</div>
256
+ {data?.data?.map((row) => (
257
+ <div key={row._copa_id}>{JSON.stringify(row)}</div>
258
+ ))}
259
+ </div>
260
+ );
219
261
  }
220
262
  ```
221
263
 
264
+ 📖 **For detailed documentation on `useRows` including filtering, pagination, and advanced usage, see [docs/useRows.md](./docs/useRows.md)**
265
+
222
266
  ## API Documentation
223
267
 
224
268
  ### `useUser(options?)`
225
269
 
226
270
  Fetches authenticated user details with query controls.
227
271
 
228
- **Parameters:**
272
+ **Parameters:**
273
+
229
274
  - `options` (optional): Query options extending TanStack React Query's `UseQueryOptions`
230
275
 
231
- **Returns:**
276
+ **Returns:**
277
+
232
278
  - `data`: User object or `undefined`
233
279
  - `isLoading`: Boolean indicating loading state
234
280
  - `error`: Error object if request failed
@@ -238,13 +284,15 @@ Fetches authenticated user details with query controls.
238
284
 
239
285
  Fetches dataset data by ID with configurable parameters.
240
286
 
241
- **Parameters:**
287
+ **Parameters:**
288
+
242
289
  - `datasetId`: ID of the dataset to fetch
243
290
  - `options` (optional): Query options with:
244
291
  - `limit`: Maximum records to fetch
245
292
  - `staleTime`: Duration (ms) before data is considered stale
246
293
 
247
- **Returns:**
294
+ **Returns:**
295
+
248
296
  - `data`: Dataset object containing name and records
249
297
  - `isLoading`: Boolean indicating loading state
250
298
  - `error`: Error object if request failed
@@ -254,11 +302,13 @@ Fetches dataset data by ID with configurable parameters.
254
302
 
255
303
  Fetches a representative sample of dataset data.
256
304
 
257
- **Parameters:**
305
+ **Parameters:**
306
+
258
307
  - `datasetId`: ID of the dataset
259
308
  - `options` (optional): Query options with `enabled` flag
260
309
 
261
- **Returns:**
310
+ **Returns:**
311
+
262
312
  - `data`: Object containing sample data
263
313
  - `isLoading`: Boolean indicating loading state
264
314
  - `refetch`: Function to manually trigger refetch
@@ -267,11 +317,13 @@ Fetches a representative sample of dataset data.
267
317
 
268
318
  Fetches metric data by ID.
269
319
 
270
- **Parameters:**
320
+ **Parameters:**
321
+
271
322
  - `metricId`: ID of the metric
272
323
  - `options` (optional): Query options
273
324
 
274
- **Returns:**
325
+ **Returns:**
326
+
275
327
  - `data`: Metric object with name and value
276
328
  - `isLoading`: Boolean indicating loading state
277
329
  - `error`: Error object if request failed
@@ -281,27 +333,71 @@ Fetches metric data by ID.
281
333
 
282
334
  Fetches input table data with limit parameters.
283
335
 
284
- **Parameters:**
336
+ **Parameters:**
337
+
285
338
  - `inputTableId`: ID of the input table
286
339
  - `options` (optional): Query options with `limitParams`:
287
340
  - `limit`: Maximum rows to fetch
288
341
  - `limitFrom`: Direction to apply limit from ('top' or 'bottom')
289
342
 
290
- **Returns:**
343
+ **Returns:**
344
+
291
345
  - `data`: Input table object with rows
292
346
  - `isLoading`: Boolean indicating loading state
293
347
  - `error`: Error object if request failed
294
348
  - `refetch`: Function to manually trigger refetch
295
349
 
350
+ ### `useRows(tableId, options?)`
351
+
352
+ Fetches rows from an input table with Supabase-style filtering, pagination, and sorting. Supports advanced filtering operators and group expressions.
353
+
354
+ **Parameters:**
355
+
356
+ - `tableId`: ID of the input table (string | null | undefined)
357
+ - `options` (optional): Query options extending `GetRowsOptions` and `BaseQueryOptions`:
358
+ - `limit`: Maximum rows to fetch (1-10000)
359
+ - `offset`: Number of rows to skip
360
+ - `order`: Sort order ('asc' or 'desc')
361
+ - `order_by`: Column name to sort by
362
+ - Filter fields: Any column name with Supabase-style operator syntax (e.g., `status: 'active'`, `price: 'gte.100'`, `status: 'in.(active,pending)'`)
363
+ - `or`: Supabase/PostgREST group expression for OR conditions
364
+ - `and`: Supabase/PostgREST group expression for AND conditions
365
+ - React Query options: `enabled`, `staleTime`, `gcTime`, `retry`, `retryDelay`, `onSuccess`, `onError`
366
+
367
+ **Returns:**
368
+
369
+ - `data`: `GetRowsResponse` object containing:
370
+ - `data`: Array of row objects
371
+ - `count`: Number of rows in current page
372
+ - `total_count`: Total rows available
373
+ - `isLoading`: Boolean indicating loading state
374
+ - `error`: Error object if request failed
375
+ - `refetch`: Function to manually trigger refetch
376
+
377
+ **Example:**
378
+
379
+ ```tsx
380
+ const { data, isLoading } = useRows("table-123", {
381
+ status: "active",
382
+ price: "gte.100",
383
+ limit: 25,
384
+ offset: 0,
385
+ });
386
+ ```
387
+
388
+ 📖 **For comprehensive documentation including all supported operators, filtering patterns, and advanced usage, see [docs/useRows.md](./docs/useRows.md)**
389
+
296
390
  ### `useGetFileUrlByFileId(fileId, options?)`
297
391
 
298
392
  Fetches the URL for a file by its ID.
299
393
 
300
394
  **Parameters:**
395
+
301
396
  - `fileId`: ID of the file to fetch URL for
302
397
  - `options` (optional): Query options extending TanStack React Query's `UseQueryOptions`
303
398
 
304
399
  **Returns:**
400
+
305
401
  - `data`: Object containing file URL
306
402
  - `isLoading`: Boolean indicating loading state
307
403
  - `error`: Error object if request failed
@@ -312,10 +408,12 @@ Fetches the URL for a file by its ID.
312
408
  Fetches published workbook details by ID.
313
409
 
314
410
  **Parameters:**
411
+
315
412
  - `workbookId`: ID of the published workbook
316
413
  - `options` (optional): Query options
317
414
 
318
415
  **Returns:**
416
+
319
417
  - `data`: Published workbook object
320
418
  - `isLoading`: Boolean indicating loading state
321
419
  - `error`: Error object if request failed
@@ -326,10 +424,12 @@ Fetches published workbook details by ID.
326
424
  Fetches table metadata by ID.
327
425
 
328
426
  **Parameters:**
427
+
329
428
  - `tableId`: ID of the table
330
429
  - `options` (optional): Query options
331
430
 
332
431
  **Returns:**
432
+
333
433
  - `data`: Table metadata object
334
434
  - `isLoading`: Boolean indicating loading state
335
435
  - `error`: Error object if request failed
@@ -340,10 +440,12 @@ Fetches table metadata by ID.
340
440
  Fetches workbooks filtered by type.
341
441
 
342
442
  **Parameters:**
443
+
343
444
  - `workbookType`: Type of workbooks to fetch
344
445
  - `options` (optional): Query options
345
446
 
346
447
  **Returns:**
448
+
347
449
  - `data`: Array of workbook objects
348
450
  - `isLoading`: Boolean indicating loading state
349
451
  - `error`: Error object if request failed
@@ -354,10 +456,12 @@ Fetches workbooks filtered by type.
354
456
  Fetches workflow instance status by ID.
355
457
 
356
458
  **Parameters:**
459
+
357
460
  - `instanceId`: ID of the workflow instance
358
461
  - `options` (optional): Query options
359
462
 
360
463
  **Returns:**
464
+
361
465
  - `data`: Workflow status object
362
466
  - `isLoading`: Boolean indicating loading state
363
467
  - `error`: Error object if request failed
@@ -368,9 +472,11 @@ Fetches workflow instance status by ID.
368
472
  Fetches all available worksheets.
369
473
 
370
474
  **Parameters:**
475
+
371
476
  - `options` (optional): Query options
372
477
 
373
478
  **Returns:**
479
+
374
480
  - `data`: Array of worksheet objects
375
481
  - `isLoading`: Boolean indicating loading state
376
482
  - `error`: Error object if request failed
@@ -381,10 +487,12 @@ Fetches all available worksheets.
381
487
  Fetches worksheets filtered by type.
382
488
 
383
489
  **Parameters:**
490
+
384
491
  - `worksheetType`: Type of worksheets to fetch
385
492
  - `options` (optional): Query options
386
493
 
387
494
  **Returns:**
495
+
388
496
  - `data`: Array of worksheet objects
389
497
  - `isLoading`: Boolean indicating loading state
390
498
  - `error`: Error object if request failed
@@ -395,10 +503,12 @@ Fetches worksheets filtered by type.
395
503
  Executes a run definition.
396
504
 
397
505
  **Parameters:**
506
+
398
507
  - `definitionId`: ID of the run definition
399
508
  - `options` (optional): Query options
400
509
 
401
510
  **Returns:**
511
+
402
512
  - `data`: Execution result
403
513
  - `isLoading`: Boolean indicating loading state
404
514
  - `error`: Error object if request failed
@@ -409,10 +519,12 @@ Executes a run definition.
409
519
  Executes a published run definition.
410
520
 
411
521
  **Parameters:**
522
+
412
523
  - `publishedDefinitionId`: ID of the published definition
413
524
  - `options` (optional): Query options
414
525
 
415
526
  **Returns:**
527
+
416
528
  - `data`: Execution result
417
529
  - `isLoading`: Boolean indicating loading state
418
530
  - `error`: Error object if request failed
@@ -423,10 +535,12 @@ Executes a published run definition.
423
535
  Executes a sample run definition.
424
536
 
425
537
  **Parameters:**
538
+
426
539
  - `sampleDefinitionId`: ID of the sample definition
427
540
  - `options` (optional): Query options
428
541
 
429
542
  **Returns:**
543
+
430
544
  - `data`: Sample execution result
431
545
  - `isLoading`: Boolean indicating loading state
432
546
  - `error`: Error object if request failed
@@ -437,11 +551,13 @@ Executes a sample run definition.
437
551
  Triggers an HTTP workflow execution.
438
552
 
439
553
  **Parameters:**
554
+
440
555
  - `workflowId`: ID of the workflow
441
556
  - `payload`: Request payload
442
557
  - `options` (optional): Query options
443
558
 
444
559
  **Returns:**
560
+
445
561
  - `data`: Workflow execution response
446
562
  - `isLoading`: Boolean indicating loading state
447
563
  - `error`: Error object if request failed
@@ -452,10 +568,12 @@ Triggers an HTTP workflow execution.
452
568
  Triggers a workflow execution.
453
569
 
454
570
  **Parameters:**
571
+
455
572
  - `workflowId`: ID of the workflow
456
573
  - `options` (optional): Query options
457
574
 
458
575
  **Returns:**
576
+
459
577
  - `data`: Workflow execution response
460
578
  - `isLoading`: Boolean indicating loading state
461
579
  - `error`: Error object if request failed
@@ -466,10 +584,12 @@ Triggers a workflow execution.
466
584
  Fetches workbook details by ID.
467
585
 
468
586
  **Parameters:**
587
+
469
588
  - `workbookId`: ID of the workbook
470
589
  - `options` (optional): Query options
471
590
 
472
591
  **Returns:**
592
+
473
593
  - `data`: Workbook object
474
594
  - `isLoading`: Boolean indicating loading state
475
595
  - `error`: Error object if request failed
@@ -480,10 +600,12 @@ Fetches workbook details by ID.
480
600
  Fetches workflow configuration by ID.
481
601
 
482
602
  **Parameters:**
603
+
483
604
  - `workflowId`: ID of the workflow
484
605
  - `options` (optional): Query options
485
606
 
486
607
  **Returns:**
608
+
487
609
  - `data`: Workflow configuration object
488
610
  - `isLoading`: Boolean indicating loading state
489
611
  - `error`: Error object if request failed
@@ -494,16 +616,17 @@ Fetches workflow configuration by ID.
494
616
  Fetches worksheet details by ID.
495
617
 
496
618
  **Parameters:**
619
+
497
620
  - `worksheetId`: ID of the worksheet
498
621
  - `options` (optional): Query options
499
622
 
500
623
  **Returns:**
624
+
501
625
  - `data`: Worksheet object
502
626
  - `isLoading`: Boolean indicating loading state
503
627
  - `error`: Error object if request failed
504
628
  - `refetch`: Function to manually trigger refetch
505
629
 
506
-
507
630
  ## Configuration
508
631
 
509
632
  ### Default Query Configuration
@@ -526,9 +649,9 @@ All hooks accept standard TanStack React Query options:
526
649
 
527
650
  ```ts
528
651
  interface QueryOptions {
529
- enabled?: boolean; // Enable/disable query
530
- staleTime?: number; // Duration (ms) before data is stale
531
- 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
532
655
  retry?: number | boolean; // Number of retries or disable retries
533
656
  onSuccess?: (data: any) => void; // Success callback
534
657
  onError?: (error: Error) => void; // Error callback
@@ -542,9 +665,9 @@ interface QueryOptions {
542
665
  ```tsx
543
666
  useUser({
544
667
  onError: (error) => {
545
- console.error('User fetch failed:', error.message);
668
+ console.error("User fetch failed:", error.message);
546
669
  // Custom error recovery logic
547
- }
670
+ },
548
671
  });
549
672
  ```
550
673
 
@@ -553,7 +676,7 @@ useUser({
553
676
  ```tsx
554
677
  function ManualRefetch() {
555
678
  const { data, refetch } = useUser();
556
-
679
+
557
680
  return (
558
681
  <div>
559
682
  <button onClick={() => refetch()}>Refresh</button>
@@ -567,13 +690,13 @@ function ManualRefetch() {
567
690
  This package re-exports core TanStack React Query utilities:
568
691
 
569
692
  ```ts
570
- import {
693
+ import {
571
694
  useQuery,
572
695
  useMutation,
573
696
  QueryClient,
574
697
  QueryClientProvider,
575
- ReactQueryDevtools
576
- } from '@bluecopa/react';
698
+ ReactQueryDevtools,
699
+ } from "@bluecopa/react";
577
700
  ```
578
701
 
579
702
  ## TypeScript Support
@@ -581,7 +704,7 @@ import {
581
704
  Fully typed with TypeScript. All hooks provide proper type inference and IntelliSense support. Extend types for custom use cases:
582
705
 
583
706
  ```ts
584
- import { User } from '@bluecopa/react';
707
+ import { User } from "@bluecopa/react";
585
708
 
586
709
  interface CustomUser extends User {
587
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-BK7QFq1W.js";
2
- import { g as d, c as f, a as e } from "./index-D2jEWUAo.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-BK7QFq1W.js";
2
- import { g as v, c as C, a as e } from "./index-D2jEWUAo.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-D2jEWUAo.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"}