create-bluecopa-react-app 1.0.28 → 1.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bluecopa-react-app",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "CLI tool to create bluecopa React applications",
5
5
  "type": "module",
6
6
  "main": "./bin/create-bluecopa-react-app.js",
@@ -31,6 +31,8 @@ import {
31
31
  useCreateOrUpdateForm,
32
32
  useMarkTaskDone,
33
33
  useReassignTask,
34
+ useGetAllUsers,
35
+ useGetAllHttpTriggers,
34
36
  } from "@bluecopa/react";
35
37
 
36
38
  // Default values for examples
@@ -1888,6 +1890,143 @@ function FormDataTestSection() {
1888
1890
  );
1889
1891
  }
1890
1892
 
1893
+ // Get All Users Test Component
1894
+ function GetAllUsersTestSection() {
1895
+ const [usersResult, setUsersResult] = useState<any>(null);
1896
+
1897
+ // Get All Users Hook - disabled by default
1898
+ const usersQuery = useGetAllUsers({
1899
+ enabled: false,
1900
+ });
1901
+
1902
+ // Handle Get All Users
1903
+ const handleGetAllUsers = async () => {
1904
+ try {
1905
+ const result = await usersQuery.refetch();
1906
+ if (result.data) {
1907
+ setUsersResult(result.data);
1908
+ console.log("Users:", result.data);
1909
+ toast.success("Users loaded! Check console for data.");
1910
+ }
1911
+ } catch (error: any) {
1912
+ toast.error(`Error: ${error.message}`);
1913
+ }
1914
+ };
1915
+
1916
+ return (
1917
+ <Card className="mb-6">
1918
+ <CardHeader>
1919
+ <CardTitle>Get All Users Test</CardTitle>
1920
+ <CardDescription>Get all users in the current workspace</CardDescription>
1921
+ </CardHeader>
1922
+ <CardContent className="space-y-4">
1923
+ <div className="flex gap-4">
1924
+ <Button
1925
+ onClick={handleGetAllUsers}
1926
+ disabled={usersQuery.isLoading}
1927
+ variant="default"
1928
+ >
1929
+ {usersQuery.isLoading ? "Loading..." : "Get All Users"}
1930
+ </Button>
1931
+ </div>
1932
+
1933
+ {/* Status Messages */}
1934
+ {usersQuery.isError && (
1935
+ <p className="text-red-500">Get Error: {usersQuery.error?.message}</p>
1936
+ )}
1937
+ {usersQuery.isSuccess && usersResult && (
1938
+ <p className="text-green-500">
1939
+ ✓ Users loaded successfully (Count: {usersResult.length || 0})
1940
+ </p>
1941
+ )}
1942
+
1943
+ {/* Users Result Preview */}
1944
+ {usersResult && (
1945
+ <div className="mt-4 p-4 bg-muted rounded-lg">
1946
+ <p className="text-sm font-semibold mb-2">Users Result:</p>
1947
+ <pre className="text-xs overflow-auto max-h-60">
1948
+ {JSON.stringify(usersResult, null, 2)}
1949
+ </pre>
1950
+ </div>
1951
+ )}
1952
+ </CardContent>
1953
+ </Card>
1954
+ );
1955
+ }
1956
+
1957
+ // Get All HTTP Triggers Test Component
1958
+ function GetAllHttpTriggersTestSection() {
1959
+ const [triggersResult, setTriggersResult] = useState<any>(null);
1960
+
1961
+ // Get All HTTP Triggers Hook - disabled by default
1962
+ const triggersQuery = useGetAllHttpTriggers({
1963
+ enabled: false,
1964
+ });
1965
+
1966
+ // Handle Get All HTTP Triggers
1967
+ const handleGetAllHttpTriggers = async () => {
1968
+ try {
1969
+ const result = await triggersQuery.refetch();
1970
+ if (result.data) {
1971
+ setTriggersResult(result.data);
1972
+ console.log("HTTP Triggers:", result.data);
1973
+ toast.success("HTTP Triggers loaded! Check console for data.");
1974
+ }
1975
+ } catch (error: any) {
1976
+ toast.error(`Error: ${error.message}`);
1977
+ }
1978
+ };
1979
+
1980
+ return (
1981
+ <Card className="mb-6">
1982
+ <CardHeader>
1983
+ <CardTitle>Get All HTTP Triggers Test</CardTitle>
1984
+ <CardDescription>
1985
+ Get all HTTP triggers (webhooks) in the current workspace
1986
+ </CardDescription>
1987
+ </CardHeader>
1988
+ <CardContent className="space-y-4">
1989
+ <div className="flex gap-4">
1990
+ <Button
1991
+ onClick={handleGetAllHttpTriggers}
1992
+ disabled={triggersQuery.isLoading}
1993
+ variant="default"
1994
+ >
1995
+ {triggersQuery.isLoading
1996
+ ? "Loading..."
1997
+ : "Get All HTTP Triggers"}
1998
+ </Button>
1999
+ </div>
2000
+
2001
+ {/* Status Messages */}
2002
+ {triggersQuery.isError && (
2003
+ <p className="text-red-500">
2004
+ Get Error: {triggersQuery.error?.message}
2005
+ </p>
2006
+ )}
2007
+ {triggersQuery.isSuccess && triggersResult && (
2008
+ <p className="text-green-500">
2009
+ ✓ HTTP Triggers loaded successfully (Count:{" "}
2010
+ {triggersResult.length || 0})
2011
+ </p>
2012
+ )}
2013
+
2014
+ {/* HTTP Triggers Result Preview */}
2015
+ {triggersResult && (
2016
+ <div className="mt-4 p-4 bg-muted rounded-lg">
2017
+ <p className="text-sm font-semibold mb-2">
2018
+ HTTP Triggers Result:
2019
+ </p>
2020
+ <pre className="text-xs overflow-auto max-h-60">
2021
+ {JSON.stringify(triggersResult, null, 2)}
2022
+ </pre>
2023
+ </div>
2024
+ )}
2025
+ </CardContent>
2026
+ </Card>
2027
+ );
2028
+ }
2029
+
1891
2030
  // Main API Test Page Component
1892
2031
  export default function ApiTestPage() {
1893
2032
  return (
@@ -1958,6 +2097,12 @@ export default function ApiTestPage() {
1958
2097
 
1959
2098
  {/* Reassign Task Test Section */}
1960
2099
  <ReassignTaskTestSection />
2100
+
2101
+ {/* Get All Users Test Section */}
2102
+ <GetAllUsersTestSection />
2103
+
2104
+ {/* Get All HTTP Triggers Test Section */}
2105
+ <GetAllHttpTriggersTestSection />
1961
2106
  </div>
1962
2107
  </div>
1963
2108
  </SidebarInset>
@@ -6,7 +6,7 @@
6
6
  "": {
7
7
  "name": "boilerplate-copa",
8
8
  "dependencies": {
9
- "@bluecopa/react": "0.1.25",
9
+ "@bluecopa/react": "0.1.26",
10
10
  "@dnd-kit/core": "^6.3.1",
11
11
  "@dnd-kit/modifiers": "^9.0.0",
12
12
  "@dnd-kit/sortable": "^10.0.0",
@@ -66,9 +66,9 @@
66
66
  }
67
67
  },
68
68
  "node_modules/@bluecopa/core": {
69
- "version": "0.1.22",
70
- "resolved": "https://registry.npmjs.org/@bluecopa/core/-/core-0.1.22.tgz",
71
- "integrity": "sha512-oYT0hUxjtzScae2mOlVELi/wVbpWPAjr/UGqkngcI8+RQltXXOFlKLz7QJ9lnEep2aNTzfFWxicjhziKPeWG9Q==",
69
+ "version": "0.1.23",
70
+ "resolved": "https://registry.npmjs.org/@bluecopa/core/-/core-0.1.23.tgz",
71
+ "integrity": "sha512-UBGo8Mc/tmZWsLACgU2m9zqxdiAyZOcg3TmdBXPxxUfGxTdpGwPpgQiBMtHNkJHmHuIIkV2KuZgg8oI+6NmhyQ==",
72
72
  "license": "MIT",
73
73
  "dependencies": {
74
74
  "axios": "1.12.0",
@@ -80,12 +80,12 @@
80
80
  }
81
81
  },
82
82
  "node_modules/@bluecopa/react": {
83
- "version": "0.1.25",
84
- "resolved": "https://registry.npmjs.org/@bluecopa/react/-/react-0.1.25.tgz",
85
- "integrity": "sha512-QRNPzb+d+jFLaqlfjHE1KS21D9009JWgdGAaBGKv8NiIw4sA5O+NGvVanJDuLhd+X7aIfGO+rBBln3Zld/z5Sg==",
83
+ "version": "0.1.26",
84
+ "resolved": "https://registry.npmjs.org/@bluecopa/react/-/react-0.1.26.tgz",
85
+ "integrity": "sha512-LEvJfNgPw5/QAZvGRVHCPPflHlRqRKhp2u3urnQh5Dmr76z/Z8FO4UHmCyGrHYVUo3kF5dVoxdvlm6mkkk+KoA==",
86
86
  "license": "MIT",
87
87
  "dependencies": {
88
- "@bluecopa/core": "0.1.22",
88
+ "@bluecopa/core": "0.1.23",
89
89
  "@tanstack/react-query": "5.59.0",
90
90
  "@tanstack/react-query-devtools": "5.59.0"
91
91
  },
@@ -10,7 +10,7 @@
10
10
  "typecheck": "tsc"
11
11
  },
12
12
  "dependencies": {
13
- "@bluecopa/react": "0.1.26",
13
+ "@bluecopa/react": "0.1.27",
14
14
  "@dnd-kit/core": "^6.3.1",
15
15
  "@dnd-kit/modifiers": "^9.0.0",
16
16
  "@dnd-kit/sortable": "^10.0.0",