@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.
Files changed (57) hide show
  1. package/dist/client.cjs +35 -56
  2. package/dist/client.cjs.map +1 -1
  3. package/dist/client.d.cts +9 -9
  4. package/dist/client.d.ts +9 -9
  5. package/dist/client.mjs +35 -56
  6. package/dist/client.mjs.map +1 -1
  7. package/dist/index.cjs +13 -55
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +9 -9
  10. package/dist/index.d.ts +9 -9
  11. package/dist/index.mjs +13 -55
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/server.cjs +33 -54
  14. package/dist/server.cjs.map +1 -1
  15. package/dist/server.d.cts +9 -9
  16. package/dist/server.d.ts +9 -9
  17. package/dist/server.mjs +33 -54
  18. package/dist/server.mjs.map +1 -1
  19. package/package.json +2 -2
  20. package/src/_api/BaseClient.ts +1 -1
  21. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/api.ts +7 -9
  22. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/events.ts +3 -3
  23. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/hooks/index.ts +1 -1
  24. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/hooks/useCfgMonitorIngestCreate.ts +3 -3
  25. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/index.ts +3 -3
  26. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/EventTypeEnum.ts +2 -2
  27. package/src/_api/generated/_cfg_monitor/schemas/FrontendEventIngestRequest.ts +27 -0
  28. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/IngestBatchRequest.ts +2 -2
  29. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/LevelEnum.ts +2 -2
  30. package/src/_api/generated/_cfg_monitor/sdk.gen.ts +5 -0
  31. package/src/_api/generated/_cfg_monitor/types.gen.ts +5 -0
  32. package/src/_api/generated/index.ts +5 -5
  33. package/src/_api/index.ts +2 -2
  34. package/src/client/transport/ingest.ts +1 -1
  35. package/src/server/index.ts +1 -1
  36. package/src/_api/generated/cfg_monitor/schemas/FrontendEventIngestRequest.ts +0 -27
  37. package/src/_api/generated/{cfg_monitor → _cfg_monitor}/schemas/index.ts +0 -0
  38. package/src/_api/generated/{cfg_monitor/client → client}/client.gen.ts +0 -0
  39. package/src/_api/generated/{cfg_monitor/client → client}/index.ts +0 -0
  40. package/src/_api/generated/{cfg_monitor/client → client}/types.gen.ts +0 -0
  41. package/src/_api/generated/{cfg_monitor/client → client}/utils.gen.ts +0 -0
  42. package/src/_api/generated/{cfg_monitor/client.gen.ts → client.gen.ts} +0 -0
  43. package/src/_api/generated/{cfg_monitor/core → core}/auth.gen.ts +0 -0
  44. package/src/_api/generated/{cfg_monitor/core → core}/bodySerializer.gen.ts +0 -0
  45. package/src/_api/generated/{cfg_monitor/core → core}/params.gen.ts +0 -0
  46. package/src/_api/generated/{cfg_monitor/core → core}/pathSerializer.gen.ts +0 -0
  47. package/src/_api/generated/{cfg_monitor/core → core}/queryKeySerializer.gen.ts +0 -0
  48. package/src/_api/generated/{cfg_monitor/core → core}/serverSentEvents.gen.ts +0 -0
  49. package/src/_api/generated/{cfg_monitor/core → core}/types.gen.ts +0 -0
  50. package/src/_api/generated/{cfg_monitor/core → core}/utils.gen.ts +0 -0
  51. package/src/_api/generated/{_shared → helpers}/errors.ts +0 -0
  52. package/src/_api/generated/{_shared → helpers}/index.ts +0 -0
  53. package/src/_api/generated/{_shared → helpers}/logger.ts +0 -0
  54. package/src/_api/generated/{_shared → helpers}/storage.ts +0 -0
  55. package/src/_api/generated/{_shared → helpers}/validation-events.ts +0 -0
  56. package/src/_api/generated/{cfg_monitor/sdk.gen.ts → sdk.gen.ts} +0 -0
  57. 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.327",
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.327",
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",
@@ -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/cfg_monitor'
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 './client.gen';
5
- import type { StorageAdapter } from '../_shared/storage';
6
- import { LocalStorageAdapter } from '../_shared/storage';
7
- import { APILogger, type LoggerConfig } from '../_shared/logger';
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
- readonly cfg = Cfg;
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 { Cfg, Monitor };
119
+ export { };
122
120
  export { client };
@@ -1,6 +1,6 @@
1
- // AUTO-GENERATED by django-cfg / django_generator.ts_extras.events
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 "./client.gen";
12
+ import { client } from "../client.gen";
13
13
 
14
14
  // ─────────────────────────────────────────────────────────────────────────────
15
15
  // Event names + detail types
@@ -1,4 +1,4 @@
1
- // AUTO-GENERATED — barrel for hooks.
1
+ // AUTO-GENERATED — barrel for all hooks.
2
2
  // DO NOT EDIT.
3
3
 
4
4
  export { useCfgMonitorIngestCreate } from "./useCfgMonitorIngestCreate";
@@ -1,11 +1,11 @@
1
- // AUTO-GENERATED by django-cfg / django_generator.ts_extras
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 "../sdk.gen";
8
- import type { CfgMonitorIngestCreateData, CfgMonitorIngestCreateResponses } from "../types.gen";
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, Cfg, Monitor } from './api';
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 '../_shared';
26
+ } from '../helpers';
27
27
 
28
28
  // Generated artifacts (Hey API)
29
- export type * from './types.gen';
29
+ export type * from '../types.gen';
@@ -1,6 +1,6 @@
1
- // AUTO-GENERATED by django-cfg / django_generator.ts_extras
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 django-cfg / django_generator.ts_extras
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 django-cfg / django_generator.ts_extras
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,5 @@
1
+ // AUTO-GENERATED by openapi_processor / ts.tool
2
+ // Re-exports the top-level Hey API SDK so group-scoped imports work:
3
+ // import { Foo } from "@api/generated/_<group>/sdk.gen";
4
+ // DO NOT EDIT — re-run `make gen`.
5
+ export * from "../sdk.gen";
@@ -0,0 +1,5 @@
1
+ // AUTO-GENERATED by openapi_processor / ts.tool
2
+ // Re-exports the top-level Hey API types so group-scoped imports work:
3
+ // import type { Foo } from "@api/generated/_<group>/types.gen";
4
+ // DO NOT EDIT — re-run `make gen`.
5
+ export * from "../types.gen";
@@ -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 './cfg_monitor';
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 cfgMonitorApi = new CfgMonitorAPI(baseUrl, { storage: new CfgMonitorStorage() });
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 './cfg_monitor';
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
- export { Monitor } from './cfg_monitor';
19
+
20
20
 
21
21
  // Shared utilities (errors, storage adapters, logger).
22
- export * from './_shared';
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/cfg_monitor/types.gen'
3
- export { EventTypeEnum as EventType, LevelEnum as EventLevel } from './generated/cfg_monitor/types.gen'
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/'
@@ -1,5 +1,5 @@
1
1
  import { monitorApi, INGEST_PATH } from '../../_api'
2
- import { Monitor } from '../../_api/generated/cfg_monitor'
2
+ import { Monitor } from '../../_api/generated/sdk.gen'
3
3
  import type { IngestBatchRequest } from '../../_api'
4
4
 
5
5
  /**
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  import { configureMonitorApi, EventType, EventLevel } from '../_api'
26
- import { Monitor } from '../_api/generated/cfg_monitor'
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
@@ -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
- message: string;
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
  /**