@carbonorm/carbonreact 3.4.1 → 3.4.4

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 (111) hide show
  1. package/dist/CarbonReact.d.ts +0 -3
  2. package/dist/api/hoc/getStatefulObjectWithWhere.d.ts +11 -0
  3. package/dist/api/hoc/watchInputElementChangeEvent.d.ts +2 -0
  4. package/dist/api/rest/C6.d.ts +579 -0
  5. package/dist/api/rest/Carbons.d.ts +88 -0
  6. package/dist/api/rest/Carbons.test.d.ts +14 -0
  7. package/dist/api/rest/Chat_Messages.d.ts +88 -0
  8. package/dist/api/rest/Chat_Messages.test.d.ts +20 -0
  9. package/dist/api/rest/Documentation.d.ts +88 -0
  10. package/dist/api/rest/Documentation.test.d.ts +11 -0
  11. package/dist/api/rest/Feature_Group_References.d.ts +88 -0
  12. package/dist/api/rest/Feature_Group_References.test.d.ts +13 -0
  13. package/dist/api/rest/Features.d.ts +88 -0
  14. package/dist/api/rest/Features.test.d.ts +14 -0
  15. package/dist/api/rest/Group_References.d.ts +88 -0
  16. package/dist/api/rest/Group_References.test.d.ts +13 -0
  17. package/dist/api/rest/Groups.d.ts +88 -0
  18. package/dist/api/rest/Groups.test.d.ts +15 -0
  19. package/dist/api/rest/History_Logs.d.ts +88 -0
  20. package/dist/api/rest/History_Logs.test.d.ts +13 -0
  21. package/dist/api/rest/Likes.d.ts +88 -0
  22. package/dist/api/rest/Likes.test.d.ts +13 -0
  23. package/dist/api/rest/Location_References.d.ts +88 -0
  24. package/dist/api/rest/Location_References.test.d.ts +14 -0
  25. package/dist/api/rest/Locations.d.ts +88 -0
  26. package/dist/api/rest/Locations.test.d.ts +18 -0
  27. package/dist/api/rest/Photos.d.ts +88 -0
  28. package/dist/api/rest/Photos.test.d.ts +20 -0
  29. package/dist/api/rest/Posts.d.ts +88 -0
  30. package/dist/api/rest/Posts.test.d.ts +22 -0
  31. package/dist/api/rest/Projects.d.ts +88 -0
  32. package/dist/api/rest/Projects.test.d.ts +21 -0
  33. package/dist/api/rest/Reports.d.ts +88 -0
  34. package/dist/api/rest/Reports.test.d.ts +11 -0
  35. package/dist/api/rest/Sessions.d.ts +88 -0
  36. package/dist/api/rest/Sessions.test.d.ts +14 -0
  37. package/dist/api/rest/Subscription.d.ts +88 -0
  38. package/dist/api/rest/Subscription.test.d.ts +20 -0
  39. package/dist/api/rest/User_Followers.d.ts +88 -0
  40. package/dist/api/rest/User_Followers.test.d.ts +16 -0
  41. package/dist/api/rest/User_Groups.d.ts +88 -0
  42. package/dist/api/rest/User_Groups.test.d.ts +13 -0
  43. package/dist/api/rest/User_Messages.d.ts +88 -0
  44. package/dist/api/rest/User_Messages.test.d.ts +20 -0
  45. package/dist/api/rest/User_Sessions.d.ts +88 -0
  46. package/dist/api/rest/User_Sessions.test.d.ts +14 -0
  47. package/dist/api/rest/User_Tasks.d.ts +88 -0
  48. package/dist/api/rest/User_Tasks.test.d.ts +22 -0
  49. package/dist/api/rest/Users.d.ts +88 -0
  50. package/dist/api/rest/Users.test.d.ts +44 -0
  51. package/dist/api/rest/WsLiveUpdates.d.ts +3 -0
  52. package/dist/components/WebSocket/CarbonWebSocket.d.ts +8 -4
  53. package/dist/index.cjs.js +5056 -2124
  54. package/dist/index.cjs.js.map +1 -1
  55. package/dist/index.d.ts +53 -0
  56. package/dist/index.esm.js +4957 -2105
  57. package/dist/index.esm.js.map +1 -1
  58. package/package.json +2 -2
  59. package/src/CarbonReact.tsx +0 -3
  60. package/src/api/hoc/getStatefulObjectWithWhere.tsx +17 -0
  61. package/src/api/hoc/watchInputElementChangeEvent.tsx +24 -0
  62. package/src/api/rest/C6.tsx +2687 -0
  63. package/src/api/rest/Carbons.test.tsx +128 -0
  64. package/src/api/rest/Carbons.tsx +145 -0
  65. package/src/api/rest/Chat_Messages.test.tsx +138 -0
  66. package/src/api/rest/Chat_Messages.tsx +151 -0
  67. package/src/api/rest/Documentation.test.tsx +128 -0
  68. package/src/api/rest/Documentation.tsx +142 -0
  69. package/src/api/rest/Feature_Group_References.test.tsx +126 -0
  70. package/src/api/rest/Feature_Group_References.tsx +144 -0
  71. package/src/api/rest/Features.test.tsx +128 -0
  72. package/src/api/rest/Features.tsx +145 -0
  73. package/src/api/rest/Group_References.test.tsx +126 -0
  74. package/src/api/rest/Group_References.tsx +144 -0
  75. package/src/api/rest/Groups.test.tsx +130 -0
  76. package/src/api/rest/Groups.tsx +146 -0
  77. package/src/api/rest/History_Logs.test.tsx +130 -0
  78. package/src/api/rest/History_Logs.tsx +144 -0
  79. package/src/api/rest/Likes.test.tsx +126 -0
  80. package/src/api/rest/Likes.tsx +144 -0
  81. package/src/api/rest/Location_References.test.tsx +128 -0
  82. package/src/api/rest/Location_References.tsx +145 -0
  83. package/src/api/rest/Locations.test.tsx +137 -0
  84. package/src/api/rest/Locations.tsx +149 -0
  85. package/src/api/rest/Photos.test.tsx +139 -0
  86. package/src/api/rest/Photos.tsx +151 -0
  87. package/src/api/rest/Posts.test.tsx +142 -0
  88. package/src/api/rest/Posts.tsx +153 -0
  89. package/src/api/rest/Projects.test.tsx +144 -0
  90. package/src/api/rest/Projects.tsx +152 -0
  91. package/src/api/rest/Reports.test.tsx +128 -0
  92. package/src/api/rest/Reports.tsx +142 -0
  93. package/src/api/rest/Sessions.test.tsx +133 -0
  94. package/src/api/rest/Sessions.tsx +145 -0
  95. package/src/api/rest/Subscription.test.tsx +138 -0
  96. package/src/api/rest/Subscription.tsx +151 -0
  97. package/src/api/rest/User_Followers.test.tsx +130 -0
  98. package/src/api/rest/User_Followers.tsx +147 -0
  99. package/src/api/rest/User_Groups.test.tsx +126 -0
  100. package/src/api/rest/User_Groups.tsx +144 -0
  101. package/src/api/rest/User_Messages.test.tsx +137 -0
  102. package/src/api/rest/User_Messages.tsx +151 -0
  103. package/src/api/rest/User_Sessions.test.tsx +133 -0
  104. package/src/api/rest/User_Sessions.tsx +145 -0
  105. package/src/api/rest/User_Tasks.test.tsx +141 -0
  106. package/src/api/rest/User_Tasks.tsx +153 -0
  107. package/src/api/rest/Users.test.tsx +193 -0
  108. package/src/api/rest/Users.tsx +175 -0
  109. package/src/api/rest/WsLiveUpdates.tsx +150 -0
  110. package/src/components/WebSocket/CarbonWebSocket.tsx +22 -11
  111. package/src/index.ts +53 -0
@@ -0,0 +1,175 @@
1
+ import {
2
+ iPostC6RestResponse,
3
+ restRequest,
4
+ GET,
5
+ POST,
6
+ PUT,
7
+ DELETE,
8
+ iDeleteC6RestResponse,
9
+ iGetC6RestResponse,
10
+ iPutC6RestResponse,
11
+ removeInvalidKeys
12
+ } from "@carbonorm/carbonnode";
13
+ import {AxiosResponse} from "axios";
14
+ import {iAPI, Modify} from "restRequest";
15
+ import {deleteRestfulObjectArrays, updateRestfulObjectArrays} from "@carbonorm/carbonreact";
16
+ import {C6, iUsers, users, RestTableNames} from "./C6";
17
+
18
+ /**
19
+ CREATE TABLE `carbon_users` (
20
+ `user_username` varchar(100) NOT NULL,
21
+ `user_password` varchar(225) NOT NULL,
22
+ `user_id` binary(16) NOT NULL,
23
+ `user_type` varchar(20) NOT NULL DEFAULT 'Athlete',
24
+ `user_sport` varchar(20) DEFAULT 'GOLF',
25
+ `user_session_id` varchar(225) DEFAULT NULL,
26
+ `user_facebook_id` varchar(225) DEFAULT NULL,
27
+ `user_first_name` varchar(25) NOT NULL,
28
+ `user_last_name` varchar(25) NOT NULL,
29
+ `user_profile_pic` longblob,
30
+ `user_profile_uri` varchar(225) DEFAULT NULL,
31
+ `user_cover_photo` longblob,
32
+ `user_birthday` varchar(9) DEFAULT NULL,
33
+ `user_gender` varchar(25) DEFAULT NULL,
34
+ `user_about_me` varchar(225) DEFAULT NULL,
35
+ `user_rank` int DEFAULT '0',
36
+ `user_email` varchar(50) NOT NULL,
37
+ `user_email_code` varchar(225) DEFAULT NULL,
38
+ `user_email_confirmed` tinyint DEFAULT '0' COMMENT 'need to change to enums, but no support in rest yet',
39
+ `user_generated_string` varchar(200) DEFAULT NULL,
40
+ `user_membership` int DEFAULT '0',
41
+ `user_deactivated` tinyint DEFAULT '0',
42
+ `user_last_login` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
43
+ `user_ip` varchar(20) NOT NULL,
44
+ `user_education_history` varchar(200) DEFAULT NULL,
45
+ `user_creation_date` datetime DEFAULT CURRENT_TIMESTAMP,
46
+ `user_education` varchar(255) DEFAULT NULL,
47
+ `user_notes` text,
48
+ `user_skills` varchar(255) DEFAULT NULL,
49
+ `user_is_moderator` tinyint(1) NOT NULL DEFAULT '0',
50
+ `user_is_administrator` tinyint(1) NOT NULL DEFAULT '0',
51
+ `user_is_caller` tinyint(1) NOT NULL DEFAULT '0',
52
+ PRIMARY KEY (`user_id`),
53
+ UNIQUE KEY `carbon_users_user_username_uindex` (`user_username`),
54
+ UNIQUE KEY `user_user_profile_uri_uindex` (`user_profile_uri`),
55
+ UNIQUE KEY `carbon_users_user_facebook_id_uindex` (`user_facebook_id`),
56
+ CONSTRAINT `user_entity_entity_pk_fk` FOREIGN KEY (`user_id`) REFERENCES `carbon_carbons` (`entity_pk`) ON DELETE CASCADE ON UPDATE CASCADE
57
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
58
+ **/
59
+
60
+ type GetCustomAndRequiredFields = {}
61
+
62
+ type GetRequestTableOverrides = {}
63
+
64
+ // required parameters, optional parameters, parameter type overrides, response, and table names
65
+ export const Get = restRequest<GetCustomAndRequiredFields, iUsers, GetRequestTableOverrides, iGetC6RestResponse<iUsers>, RestTableNames>({
66
+ C6: C6,
67
+ tableName: users.TABLE_NAME,
68
+ requestMethod: GET,
69
+ queryCallback: (request) => {
70
+ request.success ??= 'Successfully received users!'
71
+ request.error ??= 'An unknown issue occurred creating the users!'
72
+ return request
73
+ },
74
+ responseCallback: (response, _request) => {
75
+ updateRestfulObjectArrays<iUsers>(response?.data?.rest, "users", C6.users.PRIMARY_SHORT as (keyof iUsers)[])
76
+ }
77
+ });
78
+
79
+ type PutCustomAndRequiredFields = {}
80
+
81
+ type PutRequestTableOverrides = {}
82
+
83
+ export function putStateUsers(response : AxiosResponse<iPutC6RestResponse<iUsers>>, request : iAPI<Modify<iUsers, PutRequestTableOverrides>> & PutCustomAndRequiredFields) {
84
+ updateRestfulObjectArrays<iUsers>([
85
+ removeInvalidKeys<iUsers>({
86
+ ...request,
87
+ ...response?.data?.rest,
88
+ }, C6.TABLES)
89
+ ], "users", users.PRIMARY_SHORT as (keyof iUsers)[])
90
+ }
91
+
92
+ export const Put = restRequest<PutCustomAndRequiredFields, iUsers, PutRequestTableOverrides, iPutC6RestResponse<iUsers>, RestTableNames>({
93
+ C6: C6,
94
+ tableName: users.TABLE_NAME,
95
+ requestMethod: PUT,
96
+ queryCallback: (request) => {
97
+ request.success ??= 'Successfully updated users data!'
98
+ request.error ??= 'An unknown issue occurred updating the users data!'
99
+ return request
100
+ },
101
+ responseCallback: putStateUsers
102
+ });
103
+
104
+ type PostCustomAndRequiredFields = {}
105
+
106
+ type PostRequestTableOverrides = {}
107
+
108
+ export function postStateUsers(response : AxiosResponse<iPostC6RestResponse<iUsers>>, request : iAPI<Modify<iUsers, PostRequestTableOverrides>> & PostCustomAndRequiredFields, id: string | number | boolean) {
109
+ if ('number' === typeof id || 'string' === typeof id) {
110
+ if (1 !== users.PRIMARY_SHORT.length) {
111
+ console.error("C6 received unexpected result's given the primary key length");
112
+ } else {
113
+ request[users.PRIMARY_SHORT[0]] = id
114
+ }
115
+ }
116
+ updateRestfulObjectArrays<iUsers>(
117
+ undefined !== request.dataInsertMultipleRows
118
+ ? request.dataInsertMultipleRows.map((request, index) => {
119
+ return removeInvalidKeys<iUsers>({
120
+ ...request,
121
+ ...(index === 0 ? response?.data?.rest : {}),
122
+ }, C6.TABLES)
123
+ })
124
+ : [
125
+ removeInvalidKeys<iUsers>({
126
+ ...request,
127
+ ...response?.data?.rest,
128
+ }, C6.TABLES)
129
+ ],
130
+ "users",
131
+ users.PRIMARY_SHORT as (keyof iUsers)[]
132
+ )
133
+ }
134
+
135
+ export const Post = restRequest<PostCustomAndRequiredFields, iUsers, PostRequestTableOverrides, iPostC6RestResponse<iUsers>, RestTableNames>({
136
+ C6: C6,
137
+ tableName: users.TABLE_NAME,
138
+ requestMethod: POST,
139
+ queryCallback: (request) => {
140
+ request.success ??= 'Successfully created the users data!'
141
+ request.error ??= 'An unknown issue occurred creating the users data!'
142
+ return request
143
+ },
144
+ responseCallback: postStateUsers
145
+ });
146
+
147
+ type DeleteCustomAndRequiredFields = {}
148
+
149
+ type DeleteRequestTableOverrides = {}
150
+
151
+ export function deleteStateUsers(_response : AxiosResponse<iDeleteC6RestResponse<iUsers>>, request : iAPI<Modify<iUsers, DeleteRequestTableOverrides>> & DeleteCustomAndRequiredFields) {
152
+ deleteRestfulObjectArrays<iUsers>([
153
+ request
154
+ ], "users", users.PRIMARY_SHORT as (keyof iUsers)[])
155
+ }
156
+
157
+ export const Delete = restRequest<DeleteCustomAndRequiredFields, iUsers, DeleteRequestTableOverrides, iDeleteC6RestResponse<iUsers>, RestTableNames>({
158
+ C6: C6,
159
+ tableName: users.TABLE_NAME,
160
+ requestMethod: DELETE,
161
+ queryCallback: (request) => {
162
+ request.success ??= 'Successfully removed the users data!'
163
+ request.error ??= 'An unknown issue occurred removing the users data!'
164
+ return request
165
+ },
166
+ responseCallback: deleteStateUsers
167
+ });
168
+
169
+ export default {
170
+ // Export all GET, POST, PUT, DELETE functions for each table
171
+ Get,
172
+ Post,
173
+ Put,
174
+ Delete,
175
+ }
@@ -0,0 +1,150 @@
1
+ import {
2
+ tWsLiveUpdate
3
+ } from "@carbonorm/carbonnode";
4
+
5
+ import { putStateCarbons, postStateCarbons, deleteStateCarbons } from "./Carbons";
6
+ import { putStateChat_Messages, postStateChat_Messages, deleteStateChat_Messages } from "./Chat_Messages";
7
+ import { putStateDocumentation, postStateDocumentation, deleteStateDocumentation } from "./Documentation";
8
+ import { putStateFeature_Group_References, postStateFeature_Group_References, deleteStateFeature_Group_References } from "./Feature_Group_References";
9
+ import { putStateFeatures, postStateFeatures, deleteStateFeatures } from "./Features";
10
+ import { putStateGroup_References, postStateGroup_References, deleteStateGroup_References } from "./Group_References";
11
+ import { putStateGroups, postStateGroups, deleteStateGroups } from "./Groups";
12
+ import { putStateHistory_Logs, postStateHistory_Logs, deleteStateHistory_Logs } from "./History_Logs";
13
+ import { putStateLikes, postStateLikes, deleteStateLikes } from "./Likes";
14
+ import { putStateLocation_References, postStateLocation_References, deleteStateLocation_References } from "./Location_References";
15
+ import { putStateLocations, postStateLocations, deleteStateLocations } from "./Locations";
16
+ import { putStatePhotos, postStatePhotos, deleteStatePhotos } from "./Photos";
17
+ import { putStatePosts, postStatePosts, deleteStatePosts } from "./Posts";
18
+ import { putStateProjects, postStateProjects, deleteStateProjects } from "./Projects";
19
+ import { putStateReports, postStateReports, deleteStateReports } from "./Reports";
20
+ import { putStateSessions, postStateSessions, deleteStateSessions } from "./Sessions";
21
+ import { putStateSubscription, postStateSubscription, deleteStateSubscription } from "./Subscription";
22
+ import { putStateUser_Followers, postStateUser_Followers, deleteStateUser_Followers } from "./User_Followers";
23
+ import { putStateUser_Groups, postStateUser_Groups, deleteStateUser_Groups } from "./User_Groups";
24
+ import { putStateUser_Messages, postStateUser_Messages, deleteStateUser_Messages } from "./User_Messages";
25
+ import { putStateUser_Sessions, postStateUser_Sessions, deleteStateUser_Sessions } from "./User_Sessions";
26
+ import { putStateUser_Tasks, postStateUser_Tasks, deleteStateUser_Tasks } from "./User_Tasks";
27
+ import { putStateUsers, postStateUsers, deleteStateUsers } from "./Users";
28
+
29
+ const wsLiveUpdates: tWsLiveUpdate = {
30
+ carbons: {
31
+ PUT: putStateCarbons,
32
+ POST: postStateCarbons,
33
+ DELETE: deleteStateCarbons,
34
+ },
35
+ chat_messages: {
36
+ PUT: putStateChat_Messages,
37
+ POST: postStateChat_Messages,
38
+ DELETE: deleteStateChat_Messages,
39
+ },
40
+ documentation: {
41
+ PUT: putStateDocumentation,
42
+ POST: postStateDocumentation,
43
+ DELETE: deleteStateDocumentation,
44
+ },
45
+ feature_group_references: {
46
+ PUT: putStateFeature_Group_References,
47
+ POST: postStateFeature_Group_References,
48
+ DELETE: deleteStateFeature_Group_References,
49
+ },
50
+ features: {
51
+ PUT: putStateFeatures,
52
+ POST: postStateFeatures,
53
+ DELETE: deleteStateFeatures,
54
+ },
55
+ group_references: {
56
+ PUT: putStateGroup_References,
57
+ POST: postStateGroup_References,
58
+ DELETE: deleteStateGroup_References,
59
+ },
60
+ groups: {
61
+ PUT: putStateGroups,
62
+ POST: postStateGroups,
63
+ DELETE: deleteStateGroups,
64
+ },
65
+ history_logs: {
66
+ PUT: putStateHistory_Logs,
67
+ POST: postStateHistory_Logs,
68
+ DELETE: deleteStateHistory_Logs,
69
+ },
70
+ likes: {
71
+ PUT: putStateLikes,
72
+ POST: postStateLikes,
73
+ DELETE: deleteStateLikes,
74
+ },
75
+ location_references: {
76
+ PUT: putStateLocation_References,
77
+ POST: postStateLocation_References,
78
+ DELETE: deleteStateLocation_References,
79
+ },
80
+ locations: {
81
+ PUT: putStateLocations,
82
+ POST: postStateLocations,
83
+ DELETE: deleteStateLocations,
84
+ },
85
+ photos: {
86
+ PUT: putStatePhotos,
87
+ POST: postStatePhotos,
88
+ DELETE: deleteStatePhotos,
89
+ },
90
+ posts: {
91
+ PUT: putStatePosts,
92
+ POST: postStatePosts,
93
+ DELETE: deleteStatePosts,
94
+ },
95
+ projects: {
96
+ PUT: putStateProjects,
97
+ POST: postStateProjects,
98
+ DELETE: deleteStateProjects,
99
+ },
100
+ reports: {
101
+ PUT: putStateReports,
102
+ POST: postStateReports,
103
+ DELETE: deleteStateReports,
104
+ },
105
+ sessions: {
106
+ PUT: putStateSessions,
107
+ POST: postStateSessions,
108
+ DELETE: deleteStateSessions,
109
+ },
110
+ subscription: {
111
+ PUT: putStateSubscription,
112
+ POST: postStateSubscription,
113
+ DELETE: deleteStateSubscription,
114
+ },
115
+ user_followers: {
116
+ PUT: putStateUser_Followers,
117
+ POST: postStateUser_Followers,
118
+ DELETE: deleteStateUser_Followers,
119
+ },
120
+ user_groups: {
121
+ PUT: putStateUser_Groups,
122
+ POST: postStateUser_Groups,
123
+ DELETE: deleteStateUser_Groups,
124
+ },
125
+ user_messages: {
126
+ PUT: putStateUser_Messages,
127
+ POST: postStateUser_Messages,
128
+ DELETE: deleteStateUser_Messages,
129
+ },
130
+ user_sessions: {
131
+ PUT: putStateUser_Sessions,
132
+ POST: postStateUser_Sessions,
133
+ DELETE: deleteStateUser_Sessions,
134
+ },
135
+ user_tasks: {
136
+ PUT: putStateUser_Tasks,
137
+ POST: postStateUser_Tasks,
138
+ DELETE: deleteStateUser_Tasks,
139
+ },
140
+ users: {
141
+ PUT: putStateUsers,
142
+ POST: postStateUsers,
143
+ DELETE: deleteStateUsers,
144
+ },
145
+ };
146
+
147
+
148
+ export default wsLiveUpdates;
149
+
150
+
@@ -4,11 +4,22 @@ import {useEffectOnce} from "../../api/hoc/useEffectOnce";
4
4
  import {tC6Tables} from "@carbonorm/carbonnode";
5
5
 
6
6
 
7
+ export interface iCarbonWebSocketProps {
8
+ url?: string,
9
+ timeoutSeconds?: number,
10
+ heartbeatSeconds?: number,
11
+ TABLES?: tC6Tables
12
+ }
13
+
7
14
  /**
8
15
  * @function connect
9
16
  * This function establishes a connection with the websocket and also ensures constant reconnection if connection closes
10
17
  **/
11
- export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {}) {
18
+ export function initiateWebsocket({TABLES = undefined,
19
+ url = 'ws://localhost:8080/ws',
20
+ timeoutSeconds = 250,
21
+ heartbeatSeconds = 60
22
+ }: iCarbonWebSocketProps = {}) {
12
23
 
13
24
  const {websocket} = CarbonReact.instance.state;
14
25
 
@@ -32,9 +43,9 @@ export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {
32
43
 
33
44
  let connectInterval;
34
45
 
35
- const connection = new WebSocket(CarbonReact.websocketUrl);
46
+ const connection = new WebSocket(url);
36
47
 
37
- console.log("Connecting websocket url", CarbonReact.websocketUrl);
48
+ console.log("Connecting websocket url", url);
38
49
 
39
50
  CarbonReact.instance.setState({
40
51
  websocket: connection
@@ -42,7 +53,7 @@ export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {
42
53
 
43
54
  connection.onopen = () => {
44
55
 
45
- console.log('WebSocket Client Connected To :: ' + CarbonReact.websocketUrl);
56
+ console.log('WebSocket Client Connected To :: ' + url);
46
57
 
47
58
  clearTimeout(connectInterval); // clear Interval on open of websocket connection
48
59
 
@@ -56,7 +67,7 @@ export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {
56
67
 
57
68
  websocket.send("ping");
58
69
 
59
- setTimeout(heartbeat, CarbonReact.websocketHeartbeatSeconds * 1000);
70
+ setTimeout(heartbeat, heartbeatSeconds * 1000);
60
71
 
61
72
  }
62
73
 
@@ -64,7 +75,7 @@ export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {
64
75
 
65
76
  };
66
77
 
67
- connection.onmessage = (message: MessageEvent<string> ) => {
78
+ connection.onmessage = (message: MessageEvent<string>) => {
68
79
 
69
80
  const parsedData = isJsonString(message?.data) ? JSON.parse(message?.data) : message?.data;
70
81
 
@@ -73,7 +84,7 @@ export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {
73
84
  websocketData: prevState.websocketData.concat(parsedData), // JSON.parse no good - base64?
74
85
  }));
75
86
 
76
- console.log('going to impl TABLES', TABLES)
87
+ console.info('todo - going to impl TABLES', TABLES)
77
88
 
78
89
  /*if (undefined !== TABLES) {
79
90
 
@@ -97,9 +108,9 @@ export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {
97
108
 
98
109
  const retry = () => {
99
110
 
100
- const retrySeconds = Math.min(5000, (CarbonReact.websocketTimeoutSeconds + CarbonReact.websocketTimeoutSeconds) * 1000)
111
+ const retrySeconds = Math.min(5000, (timeoutSeconds + timeoutSeconds) * 1000)
101
112
 
102
- CarbonReact.websocketTimeoutSeconds = retrySeconds;
113
+ timeoutSeconds = retrySeconds;
103
114
 
104
115
  console.log(`WebSocket reconnect will be attempted in ${retrySeconds} second(s).`)
105
116
 
@@ -168,11 +179,11 @@ export function initiateWebsocket({TABLES = undefined}: {TABLES?: tC6Tables} = {
168
179
 
169
180
  }
170
181
 
171
- export default function () {
182
+ export default function (props: iCarbonWebSocketProps) {
172
183
 
173
184
  useEffectOnce(() => {
174
185
 
175
- initiateWebsocket()
186
+ initiateWebsocket(props)
176
187
 
177
188
  })
178
189
 
package/src/index.ts CHANGED
@@ -4,7 +4,60 @@
4
4
 
5
5
  export { default as CarbonReact } from "./CarbonReact";
6
6
  export * from "./CarbonReact";
7
+ export { default as getStatefulObjectWithWhere } from "./api/hoc/getStatefulObjectWithWhere";
8
+ export * from "./api/hoc/getStatefulObjectWithWhere";
7
9
  export * from "./api/hoc/useEffectOnce";
10
+ export { default as watchInputElementChangeEvent } from "./api/hoc/watchInputElementChangeEvent";
11
+ export * from "./api/hoc/watchInputElementChangeEvent";
12
+ export * from "./api/rest/C6";
13
+ export { default as Carbons } from "./api/rest/Carbons";
14
+ export * from "./api/rest/Carbons";
15
+ export { default as Chat_Messages } from "./api/rest/Chat_Messages";
16
+ export * from "./api/rest/Chat_Messages";
17
+ export { default as Documentation } from "./api/rest/Documentation";
18
+ export * from "./api/rest/Documentation";
19
+ export { default as Feature_Group_References } from "./api/rest/Feature_Group_References";
20
+ export * from "./api/rest/Feature_Group_References";
21
+ export { default as Features } from "./api/rest/Features";
22
+ export * from "./api/rest/Features";
23
+ export { default as Group_References } from "./api/rest/Group_References";
24
+ export * from "./api/rest/Group_References";
25
+ export { default as Groups } from "./api/rest/Groups";
26
+ export * from "./api/rest/Groups";
27
+ export { default as History_Logs } from "./api/rest/History_Logs";
28
+ export * from "./api/rest/History_Logs";
29
+ export { default as Likes } from "./api/rest/Likes";
30
+ export * from "./api/rest/Likes";
31
+ export { default as Location_References } from "./api/rest/Location_References";
32
+ export * from "./api/rest/Location_References";
33
+ export { default as Locations } from "./api/rest/Locations";
34
+ export * from "./api/rest/Locations";
35
+ export { default as Photos } from "./api/rest/Photos";
36
+ export * from "./api/rest/Photos";
37
+ export { default as Posts } from "./api/rest/Posts";
38
+ export * from "./api/rest/Posts";
39
+ export { default as Projects } from "./api/rest/Projects";
40
+ export * from "./api/rest/Projects";
41
+ export { default as Reports } from "./api/rest/Reports";
42
+ export * from "./api/rest/Reports";
43
+ export { default as Sessions } from "./api/rest/Sessions";
44
+ export * from "./api/rest/Sessions";
45
+ export { default as Subscription } from "./api/rest/Subscription";
46
+ export * from "./api/rest/Subscription";
47
+ export { default as User_Followers } from "./api/rest/User_Followers";
48
+ export * from "./api/rest/User_Followers";
49
+ export { default as User_Groups } from "./api/rest/User_Groups";
50
+ export * from "./api/rest/User_Groups";
51
+ export { default as User_Messages } from "./api/rest/User_Messages";
52
+ export * from "./api/rest/User_Messages";
53
+ export { default as User_Sessions } from "./api/rest/User_Sessions";
54
+ export * from "./api/rest/User_Sessions";
55
+ export { default as User_Tasks } from "./api/rest/User_Tasks";
56
+ export * from "./api/rest/User_Tasks";
57
+ export { default as Users } from "./api/rest/Users";
58
+ export * from "./api/rest/Users";
59
+ export { default as WsLiveUpdates } from "./api/rest/WsLiveUpdates";
60
+ export * from "./api/rest/WsLiveUpdates";
8
61
  export { default as Alert } from "./components/Alert/Alert";
9
62
  export * from "./components/Alert/Alert";
10
63
  export { default as AccessDenied } from "./components/Errors/AccessDenied";