@djangocfg/monitor 2.1.327 → 2.1.331
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 +35 -56
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +9 -9
- package/dist/client.d.ts +9 -9
- package/dist/client.mjs +35 -56
- package/dist/client.mjs.map +1 -1
- package/dist/index.cjs +13 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.mjs +13 -55
- package/dist/index.mjs.map +1 -1
- package/dist/server.cjs +33 -54
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +33 -54
- package/dist/server.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/BaseClient.ts +1 -1
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/api.ts +7 -9
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/events.ts +3 -3
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/hooks/index.ts +1 -1
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/hooks/useCfgMonitorIngestCreate.ts +3 -3
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/index.ts +3 -3
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/EventTypeEnum.ts +2 -2
- package/src/_api/generated/_cfg_monitor/schemas/FrontendEventIngestRequest.ts +27 -0
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/IngestBatchRequest.ts +2 -2
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/LevelEnum.ts +2 -2
- package/src/_api/generated/_cfg_monitor/sdk.gen.ts +5 -0
- package/src/_api/generated/_cfg_monitor/types.gen.ts +5 -0
- package/src/_api/generated/index.ts +5 -5
- package/src/_api/index.ts +2 -2
- package/src/client/transport/ingest.ts +1 -1
- package/src/server/index.ts +1 -1
- package/src/_api/generated/cfg_monitor/schemas/FrontendEventIngestRequest.ts +0 -27
- package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/index.ts +0 -0
- package/src/_api/generated/{cfg_monitor/client → client}/client.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/client → client}/index.ts +0 -0
- package/src/_api/generated/{cfg_monitor/client → client}/types.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/client → client}/utils.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/client.gen.ts → client.gen.ts} +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/auth.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/bodySerializer.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/params.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/pathSerializer.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/queryKeySerializer.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/serverSentEvents.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/types.gen.ts +0 -0
- package/src/_api/generated/{cfg_monitor/core → core}/utils.gen.ts +0 -0
- package/src/_api/generated/{_shared → helpers}/errors.ts +0 -0
- package/src/_api/generated/{_shared → helpers}/index.ts +0 -0
- package/src/_api/generated/{_shared → helpers}/logger.ts +0 -0
- package/src/_api/generated/{_shared → helpers}/storage.ts +0 -0
- package/src/_api/generated/{_shared → helpers}/validation-events.ts +0 -0
- package/src/_api/generated/{cfg_monitor/sdk.gen.ts → sdk.gen.ts} +0 -0
- package/src/_api/generated/{cfg_monitor/types.gen.ts → types.gen.ts} +9 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/monitor",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.331",
|
|
4
4
|
"description": "Browser error and event monitoring SDK for django-cfg backends. Captures JS errors, network failures, console logs, and performance metrics.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"django",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
90
|
+
"@djangocfg/typescript-config": "^2.1.331",
|
|
91
91
|
"p-retry": "^6.2.0",
|
|
92
92
|
"@types/node": "^24.7.2",
|
|
93
93
|
"@types/react": "^19.1.0",
|
package/src/_api/BaseClient.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Uses MemoryStorageAdapter — ingest is public (no auth tokens needed).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { API, MemoryStorageAdapter } from './generated/
|
|
8
|
+
import { API, MemoryStorageAdapter } from './generated/_cfg_monitor'
|
|
9
9
|
|
|
10
10
|
export const monitorApi = new API('', { storage: new MemoryStorageAdapter() })
|
|
11
11
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// AUTO-GENERATED by django_generator / ts_extras.wrapper
|
|
2
2
|
// Self-contained API wrapper for this group. DO NOT EDIT — re-run `make gen`.
|
|
3
3
|
|
|
4
|
-
import { client } from '
|
|
5
|
-
import type { StorageAdapter } from '../
|
|
6
|
-
import { LocalStorageAdapter } from '../
|
|
7
|
-
import { APILogger, type LoggerConfig } from '../
|
|
4
|
+
import { client } from '../client.gen';
|
|
5
|
+
import type { StorageAdapter } from '../helpers/storage';
|
|
6
|
+
import { LocalStorageAdapter } from '../helpers/storage';
|
|
7
|
+
import { APILogger, type LoggerConfig } from '../helpers/logger';
|
|
8
|
+
|
|
8
9
|
|
|
9
|
-
import { Cfg } from './sdk.gen';
|
|
10
|
-
import { Monitor } from './sdk.gen';
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
const ACCESS_KEY = 'cfg.access_token';
|
|
@@ -59,8 +58,7 @@ export class API {
|
|
|
59
58
|
private apiKey: string | null;
|
|
60
59
|
readonly logger: APILogger;
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
readonly monitor = Monitor;
|
|
61
|
+
|
|
64
62
|
|
|
65
63
|
constructor(baseUrl: string, opts: APIOptions = {}) {
|
|
66
64
|
this.baseUrl = baseUrl.replace(/\/$/, '');
|
|
@@ -118,5 +116,5 @@ export class API {
|
|
|
118
116
|
setApiKey(key: string | null): void { this.apiKey = key; }
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
export {
|
|
119
|
+
export { };
|
|
122
120
|
export { client };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras.events
|
|
2
2
|
// Hooks Hey API client interceptors → typed CustomEvents on `window`.
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
//
|
|
5
5
|
// Usage:
|
|
6
6
|
// import "./generated/events" // side-effect: registers interceptors
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// console.log(e.detail.status, e.detail.method, e.detail.url);
|
|
10
10
|
// });
|
|
11
11
|
|
|
12
|
-
import { client } from "
|
|
12
|
+
import { client } from "../client.gen";
|
|
13
13
|
|
|
14
14
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
15
15
|
// Event names + detail types
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by openapi_processor / ts.hooks
|
|
2
2
|
// Ingest browser events
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
5
|
import useSWRMutation from "swr/mutation";
|
|
6
6
|
import type { SWRMutationConfiguration } from "swr/mutation";
|
|
7
|
-
import { Cfg } from "
|
|
8
|
-
import type { CfgMonitorIngestCreateData, CfgMonitorIngestCreateResponses } from "
|
|
7
|
+
import { Cfg } from "../../sdk.gen";
|
|
8
|
+
import type { CfgMonitorIngestCreateData, CfgMonitorIngestCreateResponses } from "../../types.gen";
|
|
9
9
|
|
|
10
10
|
type Args = Omit<CfgMonitorIngestCreateData, "url">;
|
|
11
11
|
type Result = CfgMonitorIngestCreateResponses[keyof CfgMonitorIngestCreateResponses];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Group barrel. DO NOT EDIT — re-run `make gen`.
|
|
3
3
|
|
|
4
4
|
// Wrapper class + per-group SDK re-exports
|
|
5
|
-
export { API, type APIOptions,
|
|
5
|
+
export { API, type APIOptions, } from './api';
|
|
6
6
|
|
|
7
7
|
// Shared utilities (storage / errors / logger / validation events)
|
|
8
8
|
export {
|
|
@@ -23,7 +23,7 @@ export {
|
|
|
23
23
|
formatZodError,
|
|
24
24
|
type ValidationErrorDetail,
|
|
25
25
|
type ValidationErrorEvent,
|
|
26
|
-
} from '../
|
|
26
|
+
} from '../helpers';
|
|
27
27
|
|
|
28
28
|
// Generated artifacts (Hey API)
|
|
29
|
-
export type * from '
|
|
29
|
+
export type * from '../types.gen';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
|
+
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { EventTypeEnumSchema } from "./EventTypeEnum";
|
|
7
|
+
import { LevelEnumSchema } from "./LevelEnum";
|
|
8
|
+
|
|
9
|
+
export const FrontendEventIngestRequestSchema = z.object({
|
|
10
|
+
build_id: z.string().max(100).default("").optional(),
|
|
11
|
+
environment: z.string().max(20).default("").optional(),
|
|
12
|
+
event_type: EventTypeEnumSchema,
|
|
13
|
+
extra: z.unknown().optional(),
|
|
14
|
+
fingerprint: z.string().max(64).default("").optional(),
|
|
15
|
+
http_method: z.string().max(10).default("").optional(),
|
|
16
|
+
http_status: z.number().int().nullable().optional(),
|
|
17
|
+
http_url: z.string().max(2000).default("").optional(),
|
|
18
|
+
level: LevelEnumSchema.optional(),
|
|
19
|
+
message: z.string().min(1).max(5000),
|
|
20
|
+
project_name: z.string().max(100).default("").optional(),
|
|
21
|
+
session_id: z.string().max(64).default("").optional(),
|
|
22
|
+
stack_trace: z.string().max(10000).default("").optional(),
|
|
23
|
+
url: z.string().max(2000).default("").optional(),
|
|
24
|
+
user_agent: z.string().max(500).default("").optional(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type FrontendEventIngestRequest = z.infer<typeof FrontendEventIngestRequestSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { FrontendEventIngestRequestSchema } from "./FrontendEventIngestRequest";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// AUTO-GENERATED by
|
|
1
|
+
// AUTO-GENERATED by cmdop_server / devtools.generator.ts_extras
|
|
2
2
|
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
3
|
+
// DO NOT EDIT — re-run `make gen-clients`.
|
|
4
4
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
// Top-level barrel — one singleton API per group, baseUrl from Next.js env.
|
|
3
3
|
// DO NOT EDIT — re-run `make gen`.
|
|
4
4
|
|
|
5
|
-
import { API as CfgMonitorAPI, LocalStorageAdapter as CfgMonitorStorage } from './
|
|
5
|
+
import { API as CfgMonitorAPI, LocalStorageAdapter as CfgMonitorStorage } from './_cfg_monitor';
|
|
6
6
|
|
|
7
7
|
const isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === 'true';
|
|
8
8
|
const baseUrl = isStaticBuild ? '' : process.env.NEXT_PUBLIC_API_URL || '';
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const CfgMonitorApi = new CfgMonitorAPI(baseUrl, { storage: new CfgMonitorStorage() });
|
|
11
11
|
|
|
12
12
|
// API wrapper classes — for users who need to construct their own
|
|
13
13
|
// instance (e.g. with MemoryStorageAdapter in SSR/tests).
|
|
14
|
-
export { API as CfgMonitorAPI } from './
|
|
14
|
+
export { API as CfgMonitorAPI } from './_cfg_monitor';
|
|
15
15
|
|
|
16
16
|
// Hey API SDK classes — one per OpenAPI tag. Lets consumers call
|
|
17
17
|
// `Centrifugo.cfgCentrifugoAuthTokenRetrieve({...})` directly without
|
|
18
18
|
// going through the wrapper singleton.
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
|
|
21
21
|
// Shared utilities (errors, storage adapters, logger).
|
|
22
|
-
export * from './
|
|
22
|
+
export * from './helpers';
|
package/src/_api/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { monitorApi, configureMonitorApi, BaseClient } from './BaseClient'
|
|
2
|
-
export type { FrontendEventIngestRequest, IngestBatchRequest } from './generated/
|
|
3
|
-
export { EventTypeEnum as EventType, LevelEnum as EventLevel } from './generated/
|
|
2
|
+
export type { FrontendEventIngestRequest, IngestBatchRequest } from './generated/_cfg_monitor/types.gen'
|
|
3
|
+
export { EventTypeEnum as EventType, LevelEnum as EventLevel } from './generated/_cfg_monitor/types.gen'
|
|
4
4
|
|
|
5
5
|
/** Ingest path — matches the generated client. Single source of truth for sendBeacon fallback. */
|
|
6
6
|
export const INGEST_PATH = '/cfg/monitor/ingest/'
|
package/src/server/index.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { configureMonitorApi, EventType, EventLevel } from '../_api'
|
|
26
|
-
import { Monitor } from '../_api/generated/
|
|
26
|
+
import { Monitor } from '../_api/generated/sdk.gen'
|
|
27
27
|
import type { FrontendEventIngestRequest } from '../_api'
|
|
28
28
|
import type { ServerMonitorConfig } from '../types'
|
|
29
29
|
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED by django-cfg / django_generator.ts_extras
|
|
2
|
-
// Source: OpenAPI 3.1 components.schemas
|
|
3
|
-
// DO NOT EDIT — re-run `make gen`.
|
|
4
|
-
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { EventTypeEnumSchema } from "./EventTypeEnum";
|
|
7
|
-
import { LevelEnumSchema } from "./LevelEnum";
|
|
8
|
-
|
|
9
|
-
export const FrontendEventIngestRequestSchema = z.object({
|
|
10
|
-
event_type: EventTypeEnumSchema,
|
|
11
|
-
message: z.string().min(1).max(5000),
|
|
12
|
-
level: LevelEnumSchema.optional(),
|
|
13
|
-
stack_trace: z.string().max(10000).optional(),
|
|
14
|
-
url: z.string().max(2000).optional(),
|
|
15
|
-
fingerprint: z.string().max(64).optional(),
|
|
16
|
-
http_status: z.number().int().nullable().optional(),
|
|
17
|
-
http_method: z.string().max(10).optional(),
|
|
18
|
-
http_url: z.string().max(2000).optional(),
|
|
19
|
-
session_id: z.string().max(64).optional(),
|
|
20
|
-
user_agent: z.string().max(500).optional(),
|
|
21
|
-
build_id: z.string().max(100).optional(),
|
|
22
|
-
environment: z.string().max(20).optional(),
|
|
23
|
-
extra: z.unknown().optional(),
|
|
24
|
-
project_name: z.string().max(100).optional(),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export type FrontendEventIngestRequest = z.infer<typeof FrontendEventIngestRequestSchema>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -27,21 +27,21 @@ export enum EventTypeEnum {
|
|
|
27
27
|
* Single browser event payload.
|
|
28
28
|
*/
|
|
29
29
|
export type FrontendEventIngestRequest = {
|
|
30
|
+
build_id?: string;
|
|
31
|
+
environment?: string;
|
|
30
32
|
event_type: EventTypeEnum;
|
|
31
|
-
|
|
32
|
-
level?: LevelEnum;
|
|
33
|
-
stack_trace?: string;
|
|
34
|
-
url?: string;
|
|
33
|
+
extra?: unknown;
|
|
35
34
|
fingerprint?: string;
|
|
36
|
-
http_status?: number | null;
|
|
37
35
|
http_method?: string;
|
|
36
|
+
http_status?: number | null;
|
|
38
37
|
http_url?: string;
|
|
38
|
+
level?: LevelEnum;
|
|
39
|
+
message: string;
|
|
40
|
+
project_name?: string;
|
|
39
41
|
session_id?: string;
|
|
42
|
+
stack_trace?: string;
|
|
43
|
+
url?: string;
|
|
40
44
|
user_agent?: string;
|
|
41
|
-
build_id?: string;
|
|
42
|
-
environment?: string;
|
|
43
|
-
extra?: unknown;
|
|
44
|
-
project_name?: string;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|