@djangocfg/monitor 2.1.355 → 2.1.357
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/client.cjs +102 -100
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +38 -31
- package/dist/client.d.ts +38 -31
- package/dist/client.mjs +103 -101
- package/dist/client.mjs.map +1 -1
- package/dist/index.cjs +932 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -30
- package/dist/index.d.ts +30 -30
- package/dist/index.mjs +932 -19
- package/dist/index.mjs.map +1 -1
- package/dist/server.cjs +74 -73
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +30 -30
- package/dist/server.d.ts +30 -30
- package/dist/server.mjs +74 -73
- package/dist/server.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/_cfg_monitor/api.ts +3 -3
- package/src/_api/generated/_cfg_monitor/hooks/useCfgMonitorIngestCreate.ts +7 -3
- package/src/_api/generated/_cfg_monitor/index.ts +1 -1
- package/src/_api/generated/_cfg_monitor/schemas/FrontendEventIngestRequest.ts +12 -12
- package/src/_api/generated/_cfg_monitor/schemas/{LevelEnum.ts → FrontendEventLevelEnum.ts} +2 -2
- package/src/_api/generated/_cfg_monitor/schemas/FrontendEventTypeEnum.ts +9 -0
- package/src/_api/generated/_cfg_monitor/schemas/index.ts +2 -2
- package/src/_api/generated/index.ts +1 -1
- package/src/_api/generated/sdk.gen.ts +1 -19
- package/src/_api/generated/types.gen.ts +35 -35
- package/src/_api/index.ts +1 -1
- package/src/client/MonitorProvider.tsx +10 -2
- package/src/client/transport/ingest.ts +2 -2
- package/src/server/index.ts +2 -2
- package/src/_api/generated/_cfg_monitor/schemas/EventTypeEnum.ts +0 -9
package/dist/client.d.cts
CHANGED
|
@@ -1,43 +1,25 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* * `JS_ERROR` - Js Error
|
|
6
|
-
* * `NETWORK_ERROR` - Network Error
|
|
7
|
-
* * `ERROR` - Error
|
|
8
|
-
* * `WARNING` - Warning
|
|
9
|
-
* * `PAGE_VIEW` - Page View
|
|
10
|
-
* * `PERFORMANCE` - Performance
|
|
11
|
-
* * `CONSOLE` - Console
|
|
12
|
-
*/
|
|
13
|
-
declare enum EventTypeEnum {
|
|
14
|
-
JS_ERROR = "JS_ERROR",
|
|
15
|
-
NETWORK_ERROR = "NETWORK_ERROR",
|
|
16
|
-
ERROR = "ERROR",
|
|
17
|
-
WARNING = "WARNING",
|
|
18
|
-
PAGE_VIEW = "PAGE_VIEW",
|
|
19
|
-
PERFORMANCE = "PERFORMANCE",
|
|
20
|
-
CONSOLE = "CONSOLE"
|
|
21
|
-
}
|
|
22
4
|
/**
|
|
23
5
|
* Single browser event payload.
|
|
24
6
|
*/
|
|
25
7
|
type FrontendEventIngestRequest = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
event_type: FrontendEventTypeEnum;
|
|
9
|
+
message: string;
|
|
10
|
+
level?: FrontendEventLevelEnum;
|
|
11
|
+
stack_trace?: string;
|
|
12
|
+
url?: string;
|
|
30
13
|
fingerprint?: string;
|
|
31
|
-
http_method?: string;
|
|
32
14
|
http_status?: number | null;
|
|
15
|
+
http_method?: string;
|
|
33
16
|
http_url?: string;
|
|
34
|
-
level?: LevelEnum;
|
|
35
|
-
message: string;
|
|
36
|
-
project_name?: string;
|
|
37
17
|
session_id?: string;
|
|
38
|
-
stack_trace?: string;
|
|
39
|
-
url?: string;
|
|
40
18
|
user_agent?: string;
|
|
19
|
+
build_id?: string;
|
|
20
|
+
environment?: string;
|
|
21
|
+
extra?: unknown;
|
|
22
|
+
project_name?: string;
|
|
41
23
|
};
|
|
42
24
|
/**
|
|
43
25
|
* * `error` - Error
|
|
@@ -45,12 +27,30 @@ type FrontendEventIngestRequest = {
|
|
|
45
27
|
* * `info` - Info
|
|
46
28
|
* * `debug` - Debug
|
|
47
29
|
*/
|
|
48
|
-
declare enum
|
|
30
|
+
declare enum FrontendEventLevelEnum {
|
|
49
31
|
ERROR = "error",
|
|
50
32
|
WARNING = "warning",
|
|
51
33
|
INFO = "info",
|
|
52
34
|
DEBUG = "debug"
|
|
53
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* * `JS_ERROR` - Js Error
|
|
38
|
+
* * `NETWORK_ERROR` - Network Error
|
|
39
|
+
* * `ERROR` - Error
|
|
40
|
+
* * `WARNING` - Warning
|
|
41
|
+
* * `PAGE_VIEW` - Page View
|
|
42
|
+
* * `PERFORMANCE` - Performance
|
|
43
|
+
* * `CONSOLE` - Console
|
|
44
|
+
*/
|
|
45
|
+
declare enum FrontendEventTypeEnum {
|
|
46
|
+
JS_ERROR = "JS_ERROR",
|
|
47
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
48
|
+
ERROR = "ERROR",
|
|
49
|
+
WARNING = "WARNING",
|
|
50
|
+
PAGE_VIEW = "PAGE_VIEW",
|
|
51
|
+
PERFORMANCE = "PERFORMANCE",
|
|
52
|
+
CONSOLE = "CONSOLE"
|
|
53
|
+
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Configuration types for client and server monitor instances.
|
|
@@ -88,7 +88,14 @@ interface MonitorProviderProps extends MonitorConfig {
|
|
|
88
88
|
/** Optional: render children inside the provider (or use as a standalone leaf) */
|
|
89
89
|
children?: React.ReactNode;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
/**
|
|
92
|
+
* MonitorProvider — initialises FrontendMonitor on mount.
|
|
93
|
+
*
|
|
94
|
+
* Memoised: re-renders only when `children` or config props change.
|
|
95
|
+
* The init effect runs once on mount (config is captured in closure).
|
|
96
|
+
*/
|
|
97
|
+
declare function MonitorProviderRaw({ children, ...config }: MonitorProviderProps): react.ReactNode;
|
|
98
|
+
declare const MonitorProvider: react.MemoExoticComponent<typeof MonitorProviderRaw>;
|
|
92
99
|
|
|
93
100
|
/**
|
|
94
101
|
* window.monitor — global debug API for browser console testing.
|
|
@@ -180,4 +187,4 @@ declare const FrontendMonitor: {
|
|
|
180
187
|
destroy(): void;
|
|
181
188
|
};
|
|
182
189
|
|
|
183
|
-
export {
|
|
190
|
+
export { FrontendEventLevelEnum as EventLevel, FrontendEventTypeEnum as EventType, FrontendMonitor, MONITOR_VERSION, type MonitorConfig, type FrontendEventIngestRequest as MonitorEvent, MonitorProvider, type MonitorProviderProps, type WindowMonitorAPI, getSessionId, initWindowMonitor, isDevelopment, isProduction, monitorStore, monitoredFetch, useDebugMode };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,43 +1,25 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* * `JS_ERROR` - Js Error
|
|
6
|
-
* * `NETWORK_ERROR` - Network Error
|
|
7
|
-
* * `ERROR` - Error
|
|
8
|
-
* * `WARNING` - Warning
|
|
9
|
-
* * `PAGE_VIEW` - Page View
|
|
10
|
-
* * `PERFORMANCE` - Performance
|
|
11
|
-
* * `CONSOLE` - Console
|
|
12
|
-
*/
|
|
13
|
-
declare enum EventTypeEnum {
|
|
14
|
-
JS_ERROR = "JS_ERROR",
|
|
15
|
-
NETWORK_ERROR = "NETWORK_ERROR",
|
|
16
|
-
ERROR = "ERROR",
|
|
17
|
-
WARNING = "WARNING",
|
|
18
|
-
PAGE_VIEW = "PAGE_VIEW",
|
|
19
|
-
PERFORMANCE = "PERFORMANCE",
|
|
20
|
-
CONSOLE = "CONSOLE"
|
|
21
|
-
}
|
|
22
4
|
/**
|
|
23
5
|
* Single browser event payload.
|
|
24
6
|
*/
|
|
25
7
|
type FrontendEventIngestRequest = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
event_type: FrontendEventTypeEnum;
|
|
9
|
+
message: string;
|
|
10
|
+
level?: FrontendEventLevelEnum;
|
|
11
|
+
stack_trace?: string;
|
|
12
|
+
url?: string;
|
|
30
13
|
fingerprint?: string;
|
|
31
|
-
http_method?: string;
|
|
32
14
|
http_status?: number | null;
|
|
15
|
+
http_method?: string;
|
|
33
16
|
http_url?: string;
|
|
34
|
-
level?: LevelEnum;
|
|
35
|
-
message: string;
|
|
36
|
-
project_name?: string;
|
|
37
17
|
session_id?: string;
|
|
38
|
-
stack_trace?: string;
|
|
39
|
-
url?: string;
|
|
40
18
|
user_agent?: string;
|
|
19
|
+
build_id?: string;
|
|
20
|
+
environment?: string;
|
|
21
|
+
extra?: unknown;
|
|
22
|
+
project_name?: string;
|
|
41
23
|
};
|
|
42
24
|
/**
|
|
43
25
|
* * `error` - Error
|
|
@@ -45,12 +27,30 @@ type FrontendEventIngestRequest = {
|
|
|
45
27
|
* * `info` - Info
|
|
46
28
|
* * `debug` - Debug
|
|
47
29
|
*/
|
|
48
|
-
declare enum
|
|
30
|
+
declare enum FrontendEventLevelEnum {
|
|
49
31
|
ERROR = "error",
|
|
50
32
|
WARNING = "warning",
|
|
51
33
|
INFO = "info",
|
|
52
34
|
DEBUG = "debug"
|
|
53
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* * `JS_ERROR` - Js Error
|
|
38
|
+
* * `NETWORK_ERROR` - Network Error
|
|
39
|
+
* * `ERROR` - Error
|
|
40
|
+
* * `WARNING` - Warning
|
|
41
|
+
* * `PAGE_VIEW` - Page View
|
|
42
|
+
* * `PERFORMANCE` - Performance
|
|
43
|
+
* * `CONSOLE` - Console
|
|
44
|
+
*/
|
|
45
|
+
declare enum FrontendEventTypeEnum {
|
|
46
|
+
JS_ERROR = "JS_ERROR",
|
|
47
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
48
|
+
ERROR = "ERROR",
|
|
49
|
+
WARNING = "WARNING",
|
|
50
|
+
PAGE_VIEW = "PAGE_VIEW",
|
|
51
|
+
PERFORMANCE = "PERFORMANCE",
|
|
52
|
+
CONSOLE = "CONSOLE"
|
|
53
|
+
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Configuration types for client and server monitor instances.
|
|
@@ -88,7 +88,14 @@ interface MonitorProviderProps extends MonitorConfig {
|
|
|
88
88
|
/** Optional: render children inside the provider (or use as a standalone leaf) */
|
|
89
89
|
children?: React.ReactNode;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
/**
|
|
92
|
+
* MonitorProvider — initialises FrontendMonitor on mount.
|
|
93
|
+
*
|
|
94
|
+
* Memoised: re-renders only when `children` or config props change.
|
|
95
|
+
* The init effect runs once on mount (config is captured in closure).
|
|
96
|
+
*/
|
|
97
|
+
declare function MonitorProviderRaw({ children, ...config }: MonitorProviderProps): react.ReactNode;
|
|
98
|
+
declare const MonitorProvider: react.MemoExoticComponent<typeof MonitorProviderRaw>;
|
|
92
99
|
|
|
93
100
|
/**
|
|
94
101
|
* window.monitor — global debug API for browser console testing.
|
|
@@ -180,4 +187,4 @@ declare const FrontendMonitor: {
|
|
|
180
187
|
destroy(): void;
|
|
181
188
|
};
|
|
182
189
|
|
|
183
|
-
export {
|
|
190
|
+
export { FrontendEventLevelEnum as EventLevel, FrontendEventTypeEnum as EventType, FrontendMonitor, MONITOR_VERSION, type MonitorConfig, type FrontendEventIngestRequest as MonitorEvent, MonitorProvider, type MonitorProviderProps, type WindowMonitorAPI, getSessionId, initWindowMonitor, isDevelopment, isProduction, monitorStore, monitoredFetch, useDebugMode };
|
package/dist/client.mjs
CHANGED
|
@@ -447,97 +447,6 @@ __name(_APILogger, "APILogger");
|
|
|
447
447
|
var APILogger = _APILogger;
|
|
448
448
|
var defaultLogger = new APILogger();
|
|
449
449
|
|
|
450
|
-
// src/_api/generated/_cfg_monitor/api.ts
|
|
451
|
-
var _API = class _API {
|
|
452
|
-
constructor(_baseUrl, opts = {}) {
|
|
453
|
-
__publicField(this, "logger");
|
|
454
|
-
this.logger = new APILogger(opts.logger);
|
|
455
|
-
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
456
|
-
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
457
|
-
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
458
|
-
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
459
|
-
}
|
|
460
|
-
// ── Base URL ────────────────────────────────────────────────────────────
|
|
461
|
-
getBaseUrl() {
|
|
462
|
-
return auth.getBaseUrl();
|
|
463
|
-
}
|
|
464
|
-
setBaseUrl(url) {
|
|
465
|
-
auth.setBaseUrl(url);
|
|
466
|
-
}
|
|
467
|
-
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
468
|
-
getToken() {
|
|
469
|
-
return auth.getToken();
|
|
470
|
-
}
|
|
471
|
-
setToken(token) {
|
|
472
|
-
auth.setToken(token);
|
|
473
|
-
}
|
|
474
|
-
getRefreshToken() {
|
|
475
|
-
return auth.getRefreshToken();
|
|
476
|
-
}
|
|
477
|
-
setRefreshToken(token) {
|
|
478
|
-
auth.setRefreshToken(token);
|
|
479
|
-
}
|
|
480
|
-
clearToken() {
|
|
481
|
-
auth.clearTokens();
|
|
482
|
-
}
|
|
483
|
-
isAuthenticated() {
|
|
484
|
-
return auth.isAuthenticated();
|
|
485
|
-
}
|
|
486
|
-
// ── Locale / API key ────────────────────────────────────────────────────
|
|
487
|
-
getLocale() {
|
|
488
|
-
return auth.getLocale();
|
|
489
|
-
}
|
|
490
|
-
setLocale(locale) {
|
|
491
|
-
auth.setLocale(locale);
|
|
492
|
-
}
|
|
493
|
-
getApiKey() {
|
|
494
|
-
return auth.getApiKey();
|
|
495
|
-
}
|
|
496
|
-
setApiKey(key) {
|
|
497
|
-
auth.setApiKey(key);
|
|
498
|
-
}
|
|
499
|
-
// ── 401 handling ────────────────────────────────────────────────────────
|
|
500
|
-
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
501
|
-
onUnauthorized(cb) {
|
|
502
|
-
auth.onUnauthorized(cb);
|
|
503
|
-
}
|
|
504
|
-
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
505
|
-
setRefreshHandler(fn) {
|
|
506
|
-
auth.setRefreshHandler(fn);
|
|
507
|
-
}
|
|
508
|
-
};
|
|
509
|
-
__name(_API, "API");
|
|
510
|
-
var API = _API;
|
|
511
|
-
|
|
512
|
-
// src/_api/BaseClient.ts
|
|
513
|
-
var monitorApi = new API("");
|
|
514
|
-
function configureMonitorApi(baseUrl) {
|
|
515
|
-
monitorApi.setBaseUrl(baseUrl);
|
|
516
|
-
}
|
|
517
|
-
__name(configureMonitorApi, "configureMonitorApi");
|
|
518
|
-
|
|
519
|
-
// src/_api/generated/types.gen.ts
|
|
520
|
-
var EventTypeEnum = /* @__PURE__ */ ((EventTypeEnum2) => {
|
|
521
|
-
EventTypeEnum2["JS_ERROR"] = "JS_ERROR";
|
|
522
|
-
EventTypeEnum2["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
523
|
-
EventTypeEnum2["ERROR"] = "ERROR";
|
|
524
|
-
EventTypeEnum2["WARNING"] = "WARNING";
|
|
525
|
-
EventTypeEnum2["PAGE_VIEW"] = "PAGE_VIEW";
|
|
526
|
-
EventTypeEnum2["PERFORMANCE"] = "PERFORMANCE";
|
|
527
|
-
EventTypeEnum2["CONSOLE"] = "CONSOLE";
|
|
528
|
-
return EventTypeEnum2;
|
|
529
|
-
})(EventTypeEnum || {});
|
|
530
|
-
var LevelEnum = /* @__PURE__ */ ((LevelEnum2) => {
|
|
531
|
-
LevelEnum2["ERROR"] = "error";
|
|
532
|
-
LevelEnum2["WARNING"] = "warning";
|
|
533
|
-
LevelEnum2["INFO"] = "info";
|
|
534
|
-
LevelEnum2["DEBUG"] = "debug";
|
|
535
|
-
return LevelEnum2;
|
|
536
|
-
})(LevelEnum || {});
|
|
537
|
-
|
|
538
|
-
// src/_api/index.ts
|
|
539
|
-
var INGEST_PATH = "/cfg/monitor/ingest/";
|
|
540
|
-
|
|
541
450
|
// src/_api/generated/core/bodySerializer.gen.ts
|
|
542
451
|
var jsonBodySerializer = {
|
|
543
452
|
bodySerializer: /* @__PURE__ */ __name((body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value), "bodySerializer")
|
|
@@ -1340,7 +1249,7 @@ var client = createClient(createConfig({ baseUrl: "http://localhost:8000" }));
|
|
|
1340
1249
|
installAuthOnClient(client);
|
|
1341
1250
|
|
|
1342
1251
|
// src/_api/generated/sdk.gen.ts
|
|
1343
|
-
var
|
|
1252
|
+
var _CfgMonitor = class _CfgMonitor {
|
|
1344
1253
|
/**
|
|
1345
1254
|
* Ingest browser events
|
|
1346
1255
|
*
|
|
@@ -1357,8 +1266,100 @@ var _Monitor = class _Monitor {
|
|
|
1357
1266
|
});
|
|
1358
1267
|
}
|
|
1359
1268
|
};
|
|
1360
|
-
__name(
|
|
1361
|
-
var
|
|
1269
|
+
__name(_CfgMonitor, "CfgMonitor");
|
|
1270
|
+
var CfgMonitor = _CfgMonitor;
|
|
1271
|
+
|
|
1272
|
+
// src/_api/generated/_cfg_monitor/api.ts
|
|
1273
|
+
var _API = class _API {
|
|
1274
|
+
constructor(_baseUrl, opts = {}) {
|
|
1275
|
+
__publicField(this, "logger");
|
|
1276
|
+
__publicField(this, "cfgMonitor", CfgMonitor);
|
|
1277
|
+
this.logger = new APILogger(opts.logger);
|
|
1278
|
+
if (_baseUrl) auth.setBaseUrl(_baseUrl);
|
|
1279
|
+
if (opts.locale !== void 0) auth.setLocale(opts.locale);
|
|
1280
|
+
if (opts.apiKey !== void 0) auth.setApiKey(opts.apiKey);
|
|
1281
|
+
if (opts.withCredentials !== void 0) auth.setWithCredentials(opts.withCredentials);
|
|
1282
|
+
}
|
|
1283
|
+
// ── Base URL ────────────────────────────────────────────────────────────
|
|
1284
|
+
getBaseUrl() {
|
|
1285
|
+
return auth.getBaseUrl();
|
|
1286
|
+
}
|
|
1287
|
+
setBaseUrl(url) {
|
|
1288
|
+
auth.setBaseUrl(url);
|
|
1289
|
+
}
|
|
1290
|
+
// ── Tokens ──────────────────────────────────────────────────────────────
|
|
1291
|
+
getToken() {
|
|
1292
|
+
return auth.getToken();
|
|
1293
|
+
}
|
|
1294
|
+
setToken(token) {
|
|
1295
|
+
auth.setToken(token);
|
|
1296
|
+
}
|
|
1297
|
+
getRefreshToken() {
|
|
1298
|
+
return auth.getRefreshToken();
|
|
1299
|
+
}
|
|
1300
|
+
setRefreshToken(token) {
|
|
1301
|
+
auth.setRefreshToken(token);
|
|
1302
|
+
}
|
|
1303
|
+
clearToken() {
|
|
1304
|
+
auth.clearTokens();
|
|
1305
|
+
}
|
|
1306
|
+
isAuthenticated() {
|
|
1307
|
+
return auth.isAuthenticated();
|
|
1308
|
+
}
|
|
1309
|
+
// ── Locale / API key ────────────────────────────────────────────────────
|
|
1310
|
+
getLocale() {
|
|
1311
|
+
return auth.getLocale();
|
|
1312
|
+
}
|
|
1313
|
+
setLocale(locale) {
|
|
1314
|
+
auth.setLocale(locale);
|
|
1315
|
+
}
|
|
1316
|
+
getApiKey() {
|
|
1317
|
+
return auth.getApiKey();
|
|
1318
|
+
}
|
|
1319
|
+
setApiKey(key) {
|
|
1320
|
+
auth.setApiKey(key);
|
|
1321
|
+
}
|
|
1322
|
+
// ── 401 handling ────────────────────────────────────────────────────────
|
|
1323
|
+
/** Fired only on terminal 401 (after refresh+retry path is exhausted). */
|
|
1324
|
+
onUnauthorized(cb) {
|
|
1325
|
+
auth.onUnauthorized(cb);
|
|
1326
|
+
}
|
|
1327
|
+
/** Provide a refresh strategy. See `auth.setRefreshHandler` for the contract. */
|
|
1328
|
+
setRefreshHandler(fn) {
|
|
1329
|
+
auth.setRefreshHandler(fn);
|
|
1330
|
+
}
|
|
1331
|
+
};
|
|
1332
|
+
__name(_API, "API");
|
|
1333
|
+
var API = _API;
|
|
1334
|
+
|
|
1335
|
+
// src/_api/BaseClient.ts
|
|
1336
|
+
var monitorApi = new API("");
|
|
1337
|
+
function configureMonitorApi(baseUrl) {
|
|
1338
|
+
monitorApi.setBaseUrl(baseUrl);
|
|
1339
|
+
}
|
|
1340
|
+
__name(configureMonitorApi, "configureMonitorApi");
|
|
1341
|
+
|
|
1342
|
+
// src/_api/generated/types.gen.ts
|
|
1343
|
+
var FrontendEventLevelEnum = /* @__PURE__ */ ((FrontendEventLevelEnum2) => {
|
|
1344
|
+
FrontendEventLevelEnum2["ERROR"] = "error";
|
|
1345
|
+
FrontendEventLevelEnum2["WARNING"] = "warning";
|
|
1346
|
+
FrontendEventLevelEnum2["INFO"] = "info";
|
|
1347
|
+
FrontendEventLevelEnum2["DEBUG"] = "debug";
|
|
1348
|
+
return FrontendEventLevelEnum2;
|
|
1349
|
+
})(FrontendEventLevelEnum || {});
|
|
1350
|
+
var FrontendEventTypeEnum = /* @__PURE__ */ ((FrontendEventTypeEnum2) => {
|
|
1351
|
+
FrontendEventTypeEnum2["JS_ERROR"] = "JS_ERROR";
|
|
1352
|
+
FrontendEventTypeEnum2["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
1353
|
+
FrontendEventTypeEnum2["ERROR"] = "ERROR";
|
|
1354
|
+
FrontendEventTypeEnum2["WARNING"] = "WARNING";
|
|
1355
|
+
FrontendEventTypeEnum2["PAGE_VIEW"] = "PAGE_VIEW";
|
|
1356
|
+
FrontendEventTypeEnum2["PERFORMANCE"] = "PERFORMANCE";
|
|
1357
|
+
FrontendEventTypeEnum2["CONSOLE"] = "CONSOLE";
|
|
1358
|
+
return FrontendEventTypeEnum2;
|
|
1359
|
+
})(FrontendEventTypeEnum || {});
|
|
1360
|
+
|
|
1361
|
+
// src/_api/index.ts
|
|
1362
|
+
var INGEST_PATH = "/cfg/monitor/ingest/";
|
|
1362
1363
|
|
|
1363
1364
|
// src/client/transport/ingest.ts
|
|
1364
1365
|
async function sendBatch(batch, useBeacon = false) {
|
|
@@ -1374,14 +1375,14 @@ async function sendBatch(batch, useBeacon = false) {
|
|
|
1374
1375
|
});
|
|
1375
1376
|
return;
|
|
1376
1377
|
}
|
|
1377
|
-
await
|
|
1378
|
+
await CfgMonitor.cfgMonitorIngestCreate({ body: batch, throwOnError: true });
|
|
1378
1379
|
}
|
|
1379
1380
|
__name(sendBatch, "sendBatch");
|
|
1380
1381
|
|
|
1381
1382
|
// src/client/utils/env.ts
|
|
1382
1383
|
var isDevelopment = process.env.NODE_ENV === "development";
|
|
1383
1384
|
var isProduction = !isDevelopment;
|
|
1384
|
-
var MONITOR_VERSION = "2.1.
|
|
1385
|
+
var MONITOR_VERSION = "2.1.357";
|
|
1385
1386
|
|
|
1386
1387
|
// src/client/constants.ts
|
|
1387
1388
|
var MONITOR_INGEST_PATTERN = /cfg\/monitor\/ingest/;
|
|
@@ -1781,7 +1782,7 @@ async function monitoredFetch(input, init) {
|
|
|
1781
1782
|
__name(monitoredFetch, "monitoredFetch");
|
|
1782
1783
|
|
|
1783
1784
|
// src/client/MonitorProvider.tsx
|
|
1784
|
-
import { useEffect } from "react";
|
|
1785
|
+
import { memo, useEffect } from "react";
|
|
1785
1786
|
|
|
1786
1787
|
// src/client/window.ts
|
|
1787
1788
|
function makeEvent(type, level, message, extra) {
|
|
@@ -1850,7 +1851,7 @@ function initWindowMonitor() {
|
|
|
1850
1851
|
__name(initWindowMonitor, "initWindowMonitor");
|
|
1851
1852
|
|
|
1852
1853
|
// src/client/MonitorProvider.tsx
|
|
1853
|
-
function
|
|
1854
|
+
function MonitorProviderRaw({ children, ...config }) {
|
|
1854
1855
|
useEffect(() => {
|
|
1855
1856
|
FrontendMonitor.init(config);
|
|
1856
1857
|
initWindowMonitor();
|
|
@@ -1858,7 +1859,8 @@ function MonitorProvider({ children, ...config }) {
|
|
|
1858
1859
|
}, []);
|
|
1859
1860
|
return children ?? null;
|
|
1860
1861
|
}
|
|
1861
|
-
__name(
|
|
1862
|
+
__name(MonitorProviderRaw, "MonitorProviderRaw");
|
|
1863
|
+
var MonitorProvider = memo(MonitorProviderRaw);
|
|
1862
1864
|
|
|
1863
1865
|
// src/client/hooks/useDebugMode.ts
|
|
1864
1866
|
import { useEffect as useEffect2, useState } from "react";
|
|
@@ -1954,8 +1956,8 @@ var FrontendMonitor = {
|
|
|
1954
1956
|
}
|
|
1955
1957
|
};
|
|
1956
1958
|
export {
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
+
FrontendEventLevelEnum as EventLevel,
|
|
1960
|
+
FrontendEventTypeEnum as EventType,
|
|
1959
1961
|
FrontendMonitor,
|
|
1960
1962
|
MONITOR_VERSION,
|
|
1961
1963
|
MonitorProvider,
|