dce-reactkit 3.4.0-beta.3 → 3.4.0-beta.5
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/dist/cjs/index.js +343 -991
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +334 -982
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/initClient.tsx +12 -20
- package/src/helpers/addDBEditorEndpoints.ts +5 -2
package/package.json
CHANGED
|
@@ -56,32 +56,24 @@ let storedSendRequest: SendRequestFunction;
|
|
|
56
56
|
* @returns sendRequest function
|
|
57
57
|
*/
|
|
58
58
|
export const getSendRequest = async () => {
|
|
59
|
-
//
|
|
60
|
-
let
|
|
59
|
+
// Show timeout error if too much time passes
|
|
60
|
+
let successful = false;
|
|
61
61
|
(async () => {
|
|
62
62
|
await waitMs(5000);
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
if (!successful) {
|
|
65
|
+
showFatalError(
|
|
66
|
+
new ErrorWithCode(
|
|
67
|
+
'Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.',
|
|
68
|
+
ReactKitErrorCode.NoCACCLSendRequestFunction,
|
|
69
|
+
),
|
|
70
|
+
);
|
|
71
|
+
}
|
|
64
72
|
})(),
|
|
65
73
|
|
|
66
74
|
// Wait for initialization
|
|
67
75
|
await initialized;
|
|
68
|
-
|
|
69
|
-
// Error if no send request function
|
|
70
|
-
if (timedOut) {
|
|
71
|
-
showFatalError(
|
|
72
|
-
new ErrorWithCode(
|
|
73
|
-
'Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.',
|
|
74
|
-
ReactKitErrorCode.NoCACCLSendRequestFunction,
|
|
75
|
-
),
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
// Return dummy function that never resolves
|
|
79
|
-
return (
|
|
80
|
-
() => {
|
|
81
|
-
return new Promise(() => {});
|
|
82
|
-
}
|
|
83
|
-
) as SendRequestFunction;
|
|
84
|
-
}
|
|
76
|
+
successful = true;
|
|
85
77
|
|
|
86
78
|
// Return
|
|
87
79
|
return storedSendRequest;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
|
|
3
|
-
// Import
|
|
4
|
-
import
|
|
3
|
+
// Import shared helpers
|
|
4
|
+
import genRouteHandler from './genRouteHandler';
|
|
5
5
|
import generateEndpointPath from '../components/DBEntryManagerPanel/helpers/generateEndpointPath';
|
|
6
6
|
|
|
7
|
+
// Import shared types
|
|
8
|
+
import ParamType from '../types/ParamType';
|
|
9
|
+
|
|
7
10
|
/**
|
|
8
11
|
* Interface for a collection in the database
|
|
9
12
|
* @author Yuen Ler Chow
|