@djangocfg/api 2.1.212 → 2.1.213

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 (60) hide show
  1. package/dist/auth-server.cjs +50 -50
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +50 -50
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +63 -63
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.d.cts +10 -10
  8. package/dist/auth.d.ts +10 -10
  9. package/dist/auth.mjs +63 -63
  10. package/dist/auth.mjs.map +1 -1
  11. package/dist/clients.cjs +63 -63
  12. package/dist/clients.cjs.map +1 -1
  13. package/dist/clients.d.cts +106 -106
  14. package/dist/clients.d.ts +106 -106
  15. package/dist/clients.mjs +63 -63
  16. package/dist/clients.mjs.map +1 -1
  17. package/dist/hooks.cjs +12 -12
  18. package/dist/hooks.cjs.map +1 -1
  19. package/dist/hooks.d.cts +14 -14
  20. package/dist/hooks.d.ts +14 -14
  21. package/dist/hooks.mjs +12 -12
  22. package/dist/hooks.mjs.map +1 -1
  23. package/dist/index.cjs +50 -50
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +17 -17
  26. package/dist/index.d.ts +17 -17
  27. package/dist/index.mjs +50 -50
  28. package/dist/index.mjs.map +1 -1
  29. package/package.json +2 -2
  30. package/src/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts +1 -1
  31. package/src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts +2 -2
  32. package/src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts +1 -1
  33. package/src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts +1 -1
  34. package/src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts +2 -2
  35. package/src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +1 -1
  36. package/src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +1 -1
  37. package/src/generated/cfg_accounts/_utils/schemas/User.schema.ts +3 -3
  38. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts +1 -1
  39. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts +1 -1
  40. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +1 -1
  41. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts +1 -1
  42. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts +5 -5
  43. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts +5 -5
  44. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts +2 -2
  45. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts +1 -1
  46. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts +1 -1
  47. package/src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts +1 -1
  48. package/src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts +1 -1
  49. package/src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts +3 -3
  50. package/src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts +6 -6
  51. package/src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts +2 -2
  52. package/src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts +1 -1
  53. package/src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts +1 -1
  54. package/src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts +4 -4
  55. package/src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts +1 -1
  56. package/src/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts +2 -2
  57. package/src/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts +6 -6
  58. package/src/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts +1 -1
  59. package/src/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts +3 -3
  60. package/src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "2.1.212",
3
+ "version": "2.1.213",
4
4
  "description": "Auto-generated TypeScript API client with React hooks, SWR integration, and Zod validation for Django REST Framework backends",
5
5
  "keywords": [
6
6
  "django",
@@ -84,7 +84,7 @@
84
84
  "devDependencies": {
85
85
  "@types/node": "^24.7.2",
86
86
  "@types/react": "^19.0.0",
87
- "@djangocfg/typescript-config": "^2.1.212",
87
+ "@djangocfg/typescript-config": "^2.1.213",
88
88
  "next": "^16.0.0",
89
89
  "react": "^19.0.0",
90
90
  "tsup": "^8.5.0",
@@ -11,7 +11,7 @@ import { z } from 'zod'
11
11
  */
12
12
  export const CentrifugoTokenSchema = z.object({
13
13
  token: z.string(),
14
- centrifugo_url: z.union([z.url(), z.literal('')]),
14
+ centrifugo_url: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }),
15
15
  expires_at: z.string().datetime({ offset: true }),
16
16
  channels: z.array(z.string()),
17
17
  })
@@ -10,8 +10,8 @@ import { z } from 'zod'
10
10
  * Request to start OAuth flow.
11
11
  */
12
12
  export const OAuthAuthorizeRequestRequestSchema = z.object({
13
- redirect_uri: z.union([z.url(), z.literal('')]).optional(),
14
- source_url: z.union([z.url(), z.literal('')]).optional(),
13
+ redirect_uri: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }).optional(),
14
+ source_url: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }).optional(),
15
15
  })
16
16
 
17
17
  /**
@@ -10,7 +10,7 @@ import { z } from 'zod'
10
10
  * Response with OAuth authorization URL.
11
11
  */
12
12
  export const OAuthAuthorizeResponseSchema = z.object({
13
- authorization_url: z.union([z.url(), z.literal('')]),
13
+ authorization_url: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }),
14
14
  state: z.string(),
15
15
  })
16
16
 
@@ -12,7 +12,7 @@ import { z } from 'zod'
12
12
  export const OAuthCallbackRequestRequestSchema = z.object({
13
13
  code: z.string().min(10).max(500),
14
14
  state: z.string().min(20).max(100),
15
- redirect_uri: z.union([z.url(), z.literal('')]).optional(),
15
+ redirect_uri: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }).optional(),
16
16
  })
17
17
 
18
18
  /**
@@ -11,12 +11,12 @@ import * as Enums from '../../enums'
11
11
  * Serializer for OAuth connection info (user-facing).
12
12
  */
13
13
  export const OAuthConnectionSchema = z.object({
14
- id: z.int(),
14
+ id: z.number().int(),
15
15
  provider: z.nativeEnum(Enums.OAuthConnectionProvider),
16
16
  provider_display: z.string(),
17
17
  provider_username: z.string(),
18
18
  provider_email: z.email(),
19
- provider_avatar_url: z.union([z.url(), z.literal('')]),
19
+ provider_avatar_url: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }),
20
20
  connected_at: z.string().datetime({ offset: true }),
21
21
  last_login_at: z.string().datetime({ offset: true }),
22
22
  })
@@ -13,7 +13,7 @@ import * as Enums from '../../enums'
13
13
  export const OTPRequestRequestSchema = z.object({
14
14
  identifier: z.string().min(1),
15
15
  channel: z.nativeEnum(Enums.OTPRequestRequestChannel).optional(),
16
- source_url: z.union([z.url(), z.literal('')]).optional(),
16
+ source_url: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }).optional(),
17
17
  })
18
18
 
19
19
  /**
@@ -14,7 +14,7 @@ export const OTPVerifyRequestSchema = z.object({
14
14
  identifier: z.string().min(1),
15
15
  otp: z.string().min(6).max(6),
16
16
  channel: z.nativeEnum(Enums.OTPRequestRequestChannel).optional(),
17
- source_url: z.union([z.url(), z.literal('')]).optional(),
17
+ source_url: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }).optional(),
18
18
  })
19
19
 
20
20
  /**
@@ -11,7 +11,7 @@ import { CentrifugoTokenSchema } from './CentrifugoToken.schema'
11
11
  * Serializer for user details.
12
12
  */
13
13
  export const UserSchema = z.object({
14
- id: z.int(),
14
+ id: z.number().int(),
15
15
  email: z.email(),
16
16
  first_name: z.string().max(50).optional(),
17
17
  last_name: z.string().max(50).optional(),
@@ -22,12 +22,12 @@ export const UserSchema = z.object({
22
22
  phone: z.string().max(20).optional(),
23
23
  position: z.string().max(100).optional(),
24
24
  language: z.string().max(10).optional(),
25
- avatar: z.union([z.url(), z.literal('')]).nullable(),
25
+ avatar: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }).nullable(),
26
26
  is_staff: z.boolean(),
27
27
  is_superuser: z.boolean(),
28
28
  date_joined: z.string().datetime({ offset: true }),
29
29
  last_login: z.string().datetime({ offset: true }).nullable(),
30
- unanswered_messages_count: z.int(),
30
+ unanswered_messages_count: z.number().int(),
31
31
  centrifugo: CentrifugoTokenSchema.nullable(),
32
32
  })
33
33
 
@@ -10,7 +10,7 @@ import { z } from 'zod'
10
10
  * Information about a single channel.
11
11
  */
12
12
  export const CentrifugoChannelInfoSchema = z.object({
13
- num_clients: z.int(),
13
+ num_clients: z.number().int(),
14
14
  })
15
15
 
16
16
  /**
@@ -10,7 +10,7 @@ import { z } from 'zod'
10
10
  * Centrifugo API error structure.
11
11
  */
12
12
  export const CentrifugoErrorSchema = z.object({
13
- code: z.int().optional(),
13
+ code: z.number().int().optional(),
14
14
  message: z.string().optional(),
15
15
  })
16
16
 
@@ -12,7 +12,7 @@ import { CentrifugoStreamPositionSchema } from './CentrifugoStreamPosition.schem
12
12
  */
13
13
  export const CentrifugoHistoryRequestRequestSchema = z.object({
14
14
  channel: z.string(),
15
- limit: z.int().nullable().optional(),
15
+ limit: z.number().int().nullable().optional(),
16
16
  since: CentrifugoStreamPositionSchema.nullable().optional(),
17
17
  reverse: z.boolean().nullable().optional(),
18
18
  })
@@ -13,7 +13,7 @@ import { CentrifugoPublicationSchema } from './CentrifugoPublication.schema'
13
13
  export const CentrifugoHistoryResultSchema = z.object({
14
14
  publications: z.array(CentrifugoPublicationSchema),
15
15
  epoch: z.string(),
16
- offset: z.int(),
16
+ offset: z.number().int(),
17
17
  })
18
18
 
19
19
  /**
@@ -15,11 +15,11 @@ export const CentrifugoNodeInfoSchema = z.object({
15
15
  uid: z.string(),
16
16
  name: z.string(),
17
17
  version: z.string(),
18
- num_clients: z.int(),
19
- num_users: z.int(),
20
- num_channels: z.int(),
21
- uptime: z.int(),
22
- num_subs: z.int(),
18
+ num_clients: z.number().int(),
19
+ num_users: z.number().int(),
20
+ num_channels: z.number().int(),
21
+ uptime: z.number().int(),
22
+ num_subs: z.number().int(),
23
23
  metrics: CentrifugoMetricsSchema.nullable().optional(),
24
24
  process: CentrifugoProcessSchema.nullable().optional(),
25
25
  })
@@ -10,14 +10,14 @@ import { z } from 'zod'
10
10
  * Overview statistics for Centrifugo publishes.
11
11
  */
12
12
  export const CentrifugoOverviewStatsSchema = z.object({
13
- total: z.int(),
14
- successful: z.int(),
15
- failed: z.int(),
16
- timeout: z.int(),
13
+ total: z.number().int(),
14
+ successful: z.number().int(),
15
+ failed: z.number().int(),
16
+ timeout: z.number().int(),
17
17
  success_rate: z.number(),
18
18
  avg_duration_ms: z.number(),
19
19
  avg_acks_received: z.number(),
20
- period_hours: z.int(),
20
+ period_hours: z.number().int(),
21
21
  })
22
22
 
23
23
  /**
@@ -10,8 +10,8 @@ import { z } from 'zod'
10
10
  * Presence stats result.
11
11
  */
12
12
  export const CentrifugoPresenceStatsResultSchema = z.object({
13
- num_clients: z.int(),
14
- num_users: z.int(),
13
+ num_clients: z.number().int(),
14
+ num_users: z.number().int(),
15
15
  })
16
16
 
17
17
  /**
@@ -11,7 +11,7 @@ import { z } from 'zod'
11
11
  */
12
12
  export const CentrifugoProcessSchema = z.object({
13
13
  cpu: z.number(),
14
- rss: z.int(),
14
+ rss: z.number().int(),
15
15
  })
16
16
 
17
17
  /**
@@ -13,7 +13,7 @@ import { CentrifugoClientInfoSchema } from './CentrifugoClientInfo.schema'
13
13
  export const CentrifugoPublicationSchema = z.object({
14
14
  data: z.record(z.string(), z.any()),
15
15
  info: CentrifugoClientInfoSchema.nullable().optional(),
16
- offset: z.int(),
16
+ offset: z.number().int(),
17
17
  tags: z.record(z.string(), z.any()).nullable().optional(),
18
18
  })
19
19
 
@@ -10,7 +10,7 @@ import { z } from 'zod'
10
10
  * Stream position for pagination.
11
11
  */
12
12
  export const CentrifugoStreamPositionSchema = z.object({
13
- offset: z.int(),
13
+ offset: z.number().int(),
14
14
  epoch: z.string(),
15
15
  })
16
16
 
@@ -12,7 +12,7 @@ import { ChannelStatsSchema } from './ChannelStats.schema'
12
12
  */
13
13
  export const ChannelListSchema = z.object({
14
14
  channels: z.array(ChannelStatsSchema),
15
- total_channels: z.int(),
15
+ total_channels: z.number().int(),
16
16
  })
17
17
 
18
18
  /**
@@ -11,9 +11,9 @@ import { z } from 'zod'
11
11
  */
12
12
  export const ChannelStatsSchema = z.object({
13
13
  channel: z.string(),
14
- total: z.int(),
15
- successful: z.int(),
16
- failed: z.int(),
14
+ total: z.number().int(),
15
+ successful: z.number().int(),
16
+ failed: z.number().int(),
17
17
  avg_duration_ms: z.number(),
18
18
  avg_acks: z.number(),
19
19
  last_activity_at: z.string().nullable(),
@@ -7,14 +7,14 @@ import { z } from 'zod'
7
7
  import { PublishSchema } from './Publish.schema'
8
8
 
9
9
  export const PaginatedPublishListSchema = z.object({
10
- count: z.int(),
11
- page: z.int(),
12
- pages: z.int(),
13
- page_size: z.int(),
10
+ count: z.number().int(),
11
+ page: z.number().int(),
12
+ pages: z.number().int(),
13
+ page_size: z.number().int(),
14
14
  has_next: z.boolean(),
15
15
  has_previous: z.boolean(),
16
- next_page: z.int().nullable().optional(),
17
- previous_page: z.int().nullable().optional(),
16
+ next_page: z.number().int().nullable().optional(),
17
+ previous_page: z.number().int().nullable().optional(),
18
18
  results: z.array(PublishSchema),
19
19
  })
20
20
 
@@ -14,8 +14,8 @@ export const PublishSchema = z.object({
14
14
  channel: z.string(),
15
15
  status: z.string(),
16
16
  wait_for_ack: z.boolean(),
17
- acks_received: z.int(),
18
- acks_expected: z.int().nullable(),
17
+ acks_received: z.number().int(),
18
+ acks_expected: z.number().int().nullable(),
19
19
  duration_ms: z.number().nullable(),
20
20
  created_at: z.string().datetime({ offset: true }),
21
21
  completed_at: z.string().datetime({ offset: true }).nullable(),
@@ -13,7 +13,7 @@ export const PublishTestRequestRequestSchema = z.object({
13
13
  channel: z.string(),
14
14
  data: z.record(z.string(), z.any()),
15
15
  wait_for_ack: z.boolean().optional(),
16
- ack_timeout: z.int().min(1.0).max(60.0).optional(),
16
+ ack_timeout: z.number().int().min(1.0).max(60.0).optional(),
17
17
  })
18
18
 
19
19
  /**
@@ -13,7 +13,7 @@ export const PublishTestResponseSchema = z.object({
13
13
  success: z.boolean(),
14
14
  message_id: z.string(),
15
15
  channel: z.string(),
16
- acks_received: z.int().optional(),
16
+ acks_received: z.number().int().optional(),
17
17
  delivered: z.boolean().optional(),
18
18
  error: z.string().nullable().optional(),
19
19
  })
@@ -11,10 +11,10 @@ import { z } from 'zod'
11
11
  */
12
12
  export const TimelineItemSchema = z.object({
13
13
  timestamp: z.string(),
14
- count: z.int(),
15
- successful: z.int(),
16
- failed: z.int(),
17
- timeout: z.int(),
14
+ count: z.number().int(),
15
+ successful: z.number().int(),
16
+ failed: z.number().int(),
17
+ timeout: z.number().int(),
18
18
  })
19
19
 
20
20
  /**
@@ -12,7 +12,7 @@ import { TimelineItemSchema } from './TimelineItem.schema'
12
12
  */
13
13
  export const TimelineResponseSchema = z.object({
14
14
  timeline: z.array(TimelineItemSchema),
15
- period_hours: z.int(),
15
+ period_hours: z.number().int(),
16
16
  interval: z.string(),
17
17
  })
18
18
 
@@ -10,8 +10,8 @@ import { z } from 'zod'
10
10
  * Serializer for backup codes status.
11
11
  */
12
12
  export const BackupCodesStatusSchema = z.object({
13
- remaining_count: z.int(),
14
- total_generated: z.int(),
13
+ remaining_count: z.number().int(),
14
+ total_generated: z.number().int(),
15
15
  warning: z.string().nullable().optional(),
16
16
  })
17
17
 
@@ -7,14 +7,14 @@ import { z } from 'zod'
7
7
  import { DeviceListResponseSchema } from './DeviceListResponse.schema'
8
8
 
9
9
  export const PaginatedDeviceListResponseListSchema = z.object({
10
- count: z.int(),
11
- page: z.int(),
12
- pages: z.int(),
13
- page_size: z.int(),
10
+ count: z.number().int(),
11
+ page: z.number().int(),
12
+ pages: z.number().int(),
13
+ page_size: z.number().int(),
14
14
  has_next: z.boolean(),
15
15
  has_previous: z.boolean(),
16
- next_page: z.int().nullable().optional(),
17
- previous_page: z.int().nullable().optional(),
16
+ next_page: z.number().int().nullable().optional(),
17
+ previous_page: z.number().int().nullable().optional(),
18
18
  results: z.array(DeviceListResponseSchema),
19
19
  })
20
20
 
@@ -14,7 +14,7 @@ export const SetupResponseSchema = z.object({
14
14
  secret: z.string(),
15
15
  provisioning_uri: z.string(),
16
16
  qr_code_base64: z.string(),
17
- expires_in: z.int(),
17
+ expires_in: z.number().int(),
18
18
  })
19
19
 
20
20
  /**
@@ -10,7 +10,7 @@ import { z } from 'zod'
10
10
  * User data returned after 2FA verification.
11
11
  */
12
12
  export const TotpVerifyUserSchema = z.object({
13
- id: z.int(),
13
+ id: z.number().int(),
14
14
  email: z.email(),
15
15
  first_name: z.string().max(50).optional(),
16
16
  last_name: z.string().max(50).optional(),
@@ -21,12 +21,12 @@ export const TotpVerifyUserSchema = z.object({
21
21
  phone: z.string().max(20).optional(),
22
22
  position: z.string().max(100).optional(),
23
23
  language: z.string().max(10).optional(),
24
- avatar: z.union([z.url(), z.literal('')]).nullable(),
24
+ avatar: z.string().refine((v) => v === '' || v.startsWith('/') || v.startsWith('http://') || v.startsWith('https://'), { message: 'Must be a URL or relative path' }).nullable(),
25
25
  is_staff: z.boolean(),
26
26
  is_superuser: z.boolean(),
27
27
  date_joined: z.string().datetime({ offset: true }),
28
28
  last_login: z.string().datetime({ offset: true }).nullable(),
29
- unanswered_messages_count: z.int(),
29
+ unanswered_messages_count: z.number().int(),
30
30
  })
31
31
 
32
32
  /**
@@ -15,7 +15,7 @@ export const VerifyResponseSchema = z.object({
15
15
  access_token: z.string(),
16
16
  refresh_token: z.string(),
17
17
  user: TotpVerifyUserSchema,
18
- remaining_backup_codes: z.int().optional(),
18
+ remaining_backup_codes: z.number().int().optional(),
19
19
  warning: z.string().optional(),
20
20
  })
21
21