@djangocfg/api 2.1.36 → 2.1.37
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/auth.cjs +3007 -4015
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +3007 -4015
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +4983 -0
- package/dist/clients.cjs.map +1 -0
- package/dist/clients.d.cts +4135 -0
- package/dist/clients.d.ts +4135 -0
- package/dist/clients.mjs +4957 -0
- package/dist/clients.mjs.map +1 -0
- package/dist/hooks.cjs +1083 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +1122 -1
- package/dist/hooks.d.ts +1122 -1
- package/dist/hooks.mjs +1053 -0
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +2888 -7848
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1867 -9643
- package/dist/index.d.ts +1867 -9643
- package/dist/index.mjs +2891 -7851
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -3
- package/src/auth/hooks/useGithubAuth.ts +3 -3
- package/src/clients.ts +57 -0
- package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts.ts → accounts.ts} +10 -2
- package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts__auth.ts → accounts__auth.ts} +9 -1
- package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts__oauth.ts → accounts__oauth.ts} +13 -5
- package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts__user_profile.ts → accounts__user_profile.ts} +14 -6
- package/src/generated/cfg_accounts/_utils/fetchers/index.ts +12 -29
- package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts.ts → accounts.ts} +9 -1
- package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts__auth.ts → accounts__auth.ts} +9 -1
- package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts__oauth.ts → accounts__oauth.ts} +9 -1
- package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts__user_profile.ts → accounts__user_profile.ts} +9 -1
- package/src/generated/cfg_accounts/_utils/hooks/index.ts +12 -29
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +8 -134
- package/src/generated/cfg_accounts/{cfg_accounts__accounts → accounts}/client.ts +1 -1
- package/src/generated/cfg_accounts/accounts/index.ts +10 -0
- package/src/generated/cfg_accounts/{cfg_accounts__accounts → accounts}/models.ts +8 -0
- package/src/generated/cfg_accounts/{cfg_accounts__accounts__auth → accounts__auth}/client.ts +1 -1
- package/src/generated/cfg_accounts/accounts__auth/index.ts +10 -0
- package/src/generated/cfg_accounts/accounts__auth/models.ts +25 -0
- package/src/generated/cfg_accounts/{cfg_accounts__accounts__oauth → accounts__oauth}/client.ts +1 -1
- package/src/generated/cfg_accounts/accounts__oauth/index.ts +10 -0
- package/src/generated/cfg_accounts/{cfg_accounts__accounts__oauth → accounts__oauth}/models.ts +8 -0
- package/src/generated/cfg_accounts/{cfg_accounts__accounts__user_profile → accounts__user_profile}/client.ts +1 -1
- package/src/generated/cfg_accounts/accounts__user_profile/index.ts +10 -0
- package/src/generated/cfg_accounts/{cfg_accounts__accounts__user_profile → accounts__user_profile}/models.ts +8 -0
- package/src/generated/cfg_accounts/api-instance.ts +8 -0
- package/src/generated/cfg_accounts/client.ts +12 -87
- package/src/generated/cfg_accounts/enums.ts +8 -96
- package/src/generated/cfg_accounts/errors.ts +8 -0
- package/src/generated/cfg_accounts/http.ts +8 -0
- package/src/generated/cfg_accounts/index.ts +28 -195
- package/src/generated/cfg_accounts/logger.ts +8 -0
- package/src/generated/cfg_accounts/retry.ts +8 -0
- package/src/generated/cfg_accounts/schema.json +246 -10265
- package/src/generated/cfg_accounts/storage.ts +8 -0
- package/src/generated/cfg_accounts/validation-events.ts +8 -0
- package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_admin_api.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts} +14 -6
- package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_auth.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts} +9 -1
- package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_monitoring.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts} +13 -5
- package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_testing.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts} +11 -3
- package/src/generated/cfg_centrifugo/_utils/fetchers/index.ts +39 -0
- package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_admin_api.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_admin_api.ts} +9 -1
- package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_auth.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts} +9 -1
- package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_monitoring.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts} +9 -1
- package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_testing.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_testing.ts} +9 -1
- package/src/generated/cfg_centrifugo/_utils/hooks/index.ts +39 -0
- package/src/generated/cfg_centrifugo/_utils/schemas/index.ts +61 -0
- package/src/generated/cfg_centrifugo/api-instance.ts +139 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_admin_api → cfg_centrifugo/centrifugo__centrifugo_admin_api}/client.ts +1 -1
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/index.ts +10 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_admin_api → cfg_centrifugo/centrifugo__centrifugo_admin_api}/models.ts +8 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_auth → cfg_centrifugo/centrifugo__centrifugo_auth}/client.ts +1 -1
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/index.ts +10 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_auth → cfg_centrifugo/centrifugo__centrifugo_auth}/models.ts +8 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_monitoring → cfg_centrifugo/centrifugo__centrifugo_monitoring}/client.ts +1 -1
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/index.ts +10 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_monitoring → cfg_centrifugo/centrifugo__centrifugo_monitoring}/models.ts +8 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_testing → cfg_centrifugo/centrifugo__centrifugo_testing}/client.ts +1 -1
- package/src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/index.ts +10 -0
- package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_testing → cfg_centrifugo/centrifugo__centrifugo_testing}/models.ts +8 -0
- package/src/generated/cfg_centrifugo/client.ts +310 -0
- package/src/generated/cfg_centrifugo/errors.ts +124 -0
- package/src/generated/cfg_centrifugo/http.ts +111 -0
- package/src/generated/cfg_centrifugo/index.ts +301 -0
- package/src/generated/cfg_centrifugo/logger.ts +267 -0
- package/src/generated/cfg_centrifugo/retry.ts +183 -0
- package/src/generated/cfg_centrifugo/schema.json +2123 -0
- package/src/generated/cfg_centrifugo/storage.ts +169 -0
- package/src/generated/cfg_centrifugo/validation-events.ts +141 -0
- package/src/generated/cfg_webpush/_utils/fetchers/index.ts +36 -0
- package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_api_keys.ts → cfg_webpush/_utils/fetchers/webpush__web_push.ts} +45 -35
- package/src/generated/cfg_webpush/_utils/hooks/index.ts +36 -0
- package/src/generated/cfg_webpush/_utils/hooks/webpush__web_push.ts +86 -0
- package/src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts +22 -0
- package/src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts +20 -0
- package/src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts +20 -0
- package/src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts +21 -0
- package/src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts +19 -0
- package/src/generated/cfg_webpush/_utils/schemas/index.ts +31 -0
- package/src/generated/cfg_webpush/api-instance.ts +139 -0
- package/src/generated/cfg_webpush/client.ts +301 -0
- package/src/generated/cfg_webpush/errors.ts +124 -0
- package/src/generated/cfg_webpush/http.ts +111 -0
- package/src/generated/cfg_webpush/index.ts +280 -0
- package/src/generated/cfg_webpush/logger.ts +267 -0
- package/src/generated/cfg_webpush/retry.ts +183 -0
- package/src/generated/cfg_webpush/schema.json +302 -0
- package/src/generated/cfg_webpush/storage.ts +169 -0
- package/src/generated/cfg_webpush/validation-events.ts +141 -0
- package/src/generated/cfg_webpush/webpush__web_push/client.ts +45 -0
- package/src/generated/cfg_webpush/webpush__web_push/index.ts +10 -0
- package/src/generated/cfg_webpush/webpush__web_push/models.ts +72 -0
- package/src/hooks/accounts.ts +8 -0
- package/src/hooks/index.ts +10 -0
- package/src/hooks/webpush.ts +12 -0
- package/src/index.ts +11 -0
- package/src/server.ts +5 -8
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_activity.ts +0 -62
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_api_zones.ts +0 -106
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_charts.ts +0 -177
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_commands.ts +0 -179
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_config.ts +0 -92
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_overview.ts +0 -92
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_statistics.ts +0 -120
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_system.ts +0 -150
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__endpoints.ts +0 -164
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_configuration.ts +0 -150
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_monitoring.ts +0 -280
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_services.ts +0 -208
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__health.ts +0 -150
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_jobs.ts +0 -323
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_monitoring.ts +0 -164
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_queues.ts +0 -134
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_registries.ts +0 -436
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_schedules.ts +0 -266
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_testing.ts +0 -293
- package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_workers.ts +0 -106
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_activity.ts +0 -50
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_api_zones.ts +0 -51
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_charts.ts +0 -79
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_commands.ts +0 -86
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_config.ts +0 -37
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_overview.ts +0 -37
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_statistics.ts +0 -65
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_system.ts +0 -52
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__endpoints.ts +0 -66
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_api_keys.ts +0 -67
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_configuration.ts +0 -52
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_monitoring.ts +0 -96
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_services.ts +0 -67
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__health.ts +0 -52
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_jobs.ts +0 -110
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_monitoring.ts +0 -66
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_queues.ts +0 -84
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_registries.ts +0 -136
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_schedules.ts +0 -92
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_testing.ts +0 -126
- package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_workers.ts +0 -51
- package/src/generated/cfg_accounts/_utils/schemas/APIZone.schema.ts +0 -29
- package/src/generated/cfg_accounts/_utils/schemas/APIZonesSummary.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/ActivityEntry.schema.ts +0 -25
- package/src/generated/cfg_accounts/_utils/schemas/ActivityTrackerDay.schema.ts +0 -23
- package/src/generated/cfg_accounts/_utils/schemas/ApiKey.schema.ts +0 -30
- package/src/generated/cfg_accounts/_utils/schemas/ApiKeyStats.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/AppStatistics.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/AppStatisticsData.schema.ts +0 -23
- package/src/generated/cfg_accounts/_utils/schemas/AxesConfig.schema.ts +0 -35
- package/src/generated/cfg_accounts/_utils/schemas/CentrifugoConfig.schema.ts +0 -35
- package/src/generated/cfg_accounts/_utils/schemas/ChartData.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/ChartDataset.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/Command.schema.ts +0 -38
- package/src/generated/cfg_accounts/_utils/schemas/CommandCategory.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/CommandExecuteRequestRequest.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/CommandHelpResponse.schema.ts +0 -25
- package/src/generated/cfg_accounts/_utils/schemas/CommandsSummary.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/ConfigData.schema.ts +0 -27
- package/src/generated/cfg_accounts/_utils/schemas/ConfigMeta.schema.ts +0 -20
- package/src/generated/cfg_accounts/_utils/schemas/ConfigValidation.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/ConstanceConfig.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/DRFConfig.schema.ts +0 -20
- package/src/generated/cfg_accounts/_utils/schemas/DRFHealthCheck.schema.ts +0 -25
- package/src/generated/cfg_accounts/_utils/schemas/DashboardOverview.schema.ts +0 -35
- package/src/generated/cfg_accounts/_utils/schemas/DatabaseConfig.schema.ts +0 -31
- package/src/generated/cfg_accounts/_utils/schemas/DjangoConfig.schema.ts +0 -93
- package/src/generated/cfg_accounts/_utils/schemas/DjangoRQConfig.schema.ts +0 -27
- package/src/generated/cfg_accounts/_utils/schemas/EmailConfig.schema.ts +0 -28
- package/src/generated/cfg_accounts/_utils/schemas/Endpoint.schema.ts +0 -35
- package/src/generated/cfg_accounts/_utils/schemas/EndpointsStatus.schema.ts +0 -28
- package/src/generated/cfg_accounts/_utils/schemas/GRPCConfig.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/GRPCConfigDashboard.schema.ts +0 -33
- package/src/generated/cfg_accounts/_utils/schemas/GRPCFeatures.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/GRPCFrameworkConfig.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/GRPCHealthCheck.schema.ts +0 -23
- package/src/generated/cfg_accounts/_utils/schemas/GRPCInterceptorInfo.schema.ts +0 -20
- package/src/generated/cfg_accounts/_utils/schemas/GRPCOverviewStats.schema.ts +0 -29
- package/src/generated/cfg_accounts/_utils/schemas/GRPCRegisteredService.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/GRPCServerConfig.schema.ts +0 -23
- package/src/generated/cfg_accounts/_utils/schemas/GRPCServerInfo.schema.ts +0 -28
- package/src/generated/cfg_accounts/_utils/schemas/GRPCServerStatus.schema.ts +0 -30
- package/src/generated/cfg_accounts/_utils/schemas/GRPCServiceInfo.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/GRPCServiceRegistryMethodStats.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/GRPCStats.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/GitHubOAuthConfig.schema.ts +0 -30
- package/src/generated/cfg_accounts/_utils/schemas/JWTConfig.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/JobActionResponse.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/JobDetail.schema.ts +0 -40
- package/src/generated/cfg_accounts/_utils/schemas/JobList.schema.ts +0 -28
- package/src/generated/cfg_accounts/_utils/schemas/JobListRequest.schema.ts +0 -28
- package/src/generated/cfg_accounts/_utils/schemas/MethodInfo.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/MethodList.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/MethodSummary.schema.ts +0 -25
- package/src/generated/cfg_accounts/_utils/schemas/ModelStatistics.schema.ts +0 -23
- package/src/generated/cfg_accounts/_utils/schemas/NextJSAdminConfig.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/NgrokConfig.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/OpenAPIClientConfig.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/PaginatedApiKeyList.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/PaginatedJobListList.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/PaginatedRecentRequestList.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/PaginatedScheduledJobList.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/PaginatedServiceSummaryList.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/PaymentsConfig.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/PaymentsNowPayments.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/QueueDetail.schema.ts +0 -34
- package/src/generated/cfg_accounts/_utils/schemas/QueueStats.schema.ts +0 -31
- package/src/generated/cfg_accounts/_utils/schemas/QuickAction.schema.ts +0 -29
- package/src/generated/cfg_accounts/_utils/schemas/QuickHealth.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/RQConfig.schema.ts +0 -30
- package/src/generated/cfg_accounts/_utils/schemas/RQHealthCheck.schema.ts +0 -31
- package/src/generated/cfg_accounts/_utils/schemas/RQSchedule.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/RecentError.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/RecentRequest.schema.ts +0 -33
- package/src/generated/cfg_accounts/_utils/schemas/RecentUser.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/RedisQueueConfig.schema.ts +0 -29
- package/src/generated/cfg_accounts/_utils/schemas/RunDemoRequestRequest.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/ScheduleActionResponse.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/ScheduleCreateRequest.schema.ts +0 -39
- package/src/generated/cfg_accounts/_utils/schemas/ScheduleInfo.schema.ts +0 -27
- package/src/generated/cfg_accounts/_utils/schemas/ScheduledJob.schema.ts +0 -32
- package/src/generated/cfg_accounts/_utils/schemas/ServiceDetail.schema.ts +0 -31
- package/src/generated/cfg_accounts/_utils/schemas/ServiceMethods.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/ServiceStats.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/ServiceSummary.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/SpectacularConfig.schema.ts +0 -21
- package/src/generated/cfg_accounts/_utils/schemas/StatCard.schema.ts +0 -30
- package/src/generated/cfg_accounts/_utils/schemas/StressTestRequestRequest.schema.ts +0 -23
- package/src/generated/cfg_accounts/_utils/schemas/SystemHealth.schema.ts +0 -24
- package/src/generated/cfg_accounts/_utils/schemas/SystemHealthItem.schema.ts +0 -28
- package/src/generated/cfg_accounts/_utils/schemas/SystemMetrics.schema.ts +0 -25
- package/src/generated/cfg_accounts/_utils/schemas/TelegramConfig.schema.ts +0 -28
- package/src/generated/cfg_accounts/_utils/schemas/TestScenario.schema.ts +0 -25
- package/src/generated/cfg_accounts/_utils/schemas/TestingActionResponse.schema.ts +0 -23
- package/src/generated/cfg_accounts/_utils/schemas/URLPattern.schema.ts +0 -26
- package/src/generated/cfg_accounts/_utils/schemas/URLsList.schema.ts +0 -25
- package/src/generated/cfg_accounts/_utils/schemas/UserStatistics.schema.ts +0 -22
- package/src/generated/cfg_accounts/_utils/schemas/Worker.schema.ts +0 -31
- package/src/generated/cfg_accounts/_utils/schemas/WorkerStats.schema.ts +0 -31
- package/src/generated/cfg_accounts/_utils/schemas/ZonesSummaryStats.schema.ts +0 -21
- package/src/generated/cfg_accounts/cfg_accounts__accounts/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__accounts__auth/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__accounts__auth/models.ts +0 -17
- package/src/generated/cfg_accounts/cfg_accounts__accounts__oauth/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__accounts__user_profile/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_admin_api/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_auth/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_monitoring/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_testing/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_activity/client.ts +0 -45
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_activity/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_activity/models.ts +0 -0
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_api_zones/client.ts +0 -34
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_api_zones/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_api_zones/models.ts +0 -40
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_charts/client.ts +0 -98
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_charts/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_charts/models.ts +0 -24
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_commands/client.ts +0 -55
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_commands/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_commands/models.ts +0 -80
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_config/client.ts +0 -25
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_config/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_config/models.ts +0 -412
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_overview/client.ts +0 -25
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_overview/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_overview/models.ts +0 -228
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_statistics/client.ts +0 -44
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_statistics/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_statistics/models.ts +0 -16
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_system/client.ts +0 -34
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_system/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_system/models.ts +0 -69
- package/src/generated/cfg_accounts/cfg_accounts__endpoints/client.ts +0 -42
- package/src/generated/cfg_accounts/cfg_accounts__endpoints/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__endpoints/models.ts +0 -112
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_api_keys/client.ts +0 -56
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_api_keys/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_api_keys/models.ts +0 -73
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_configuration/client.ts +0 -35
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_configuration/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_configuration/models.ts +0 -128
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_monitoring/client.ts +0 -109
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_monitoring/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_monitoring/models.ts +0 -213
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_services/client.ts +0 -56
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_services/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_services/models.ts +0 -189
- package/src/generated/cfg_accounts/cfg_accounts__health/client.ts +0 -30
- package/src/generated/cfg_accounts/cfg_accounts__health/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__health/models.ts +0 -36
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_jobs/client.ts +0 -76
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_jobs/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_jobs/models.ts +0 -127
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_monitoring/client.ts +0 -45
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_monitoring/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_monitoring/models.ts +0 -66
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_queues/client.ts +0 -78
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_queues/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_queues/models.ts +0 -33
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_registries/client.ts +0 -164
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_registries/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_registries/models.ts +0 -82
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_schedules/client.ts +0 -91
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_schedules/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_schedules/models.ts +0 -109
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_testing/client.ts +0 -96
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_testing/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_testing/models.ts +0 -68
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_workers/client.ts +0 -46
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_workers/index.ts +0 -2
- package/src/generated/cfg_accounts/cfg_accounts__rq__rq_workers/models.ts +0 -52
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelInfo.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelsResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelsResult.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoClientInfo.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoError.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHealthCheck.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHistoryResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHistoryResult.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoInfoResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoInfoResult.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoMetrics.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoNodeInfo.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoOverviewStats.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceResult.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoProcess.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPublication.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoStreamPosition.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ChannelList.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ChannelStats.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ConnectionTokenResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ManualAckRequestRequest.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ManualAckResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/PaginatedPublishList.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/Publish.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/PublishTestRequestRequest.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/PublishTestResponse.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/TimelineItem.schema.ts +0 -0
- /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/TimelineResponse.schema.ts +0 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by DjangoCFG.
|
|
5
|
+
* Any manual changes will be lost when the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @see https://djangocfg.com/docs/features/modules/django-client/overview/
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Storage adapters for cross-platform token storage.
|
|
11
|
+
*
|
|
12
|
+
* Supports:
|
|
13
|
+
* - LocalStorage (browser)
|
|
14
|
+
* - Cookies (SSR/browser)
|
|
15
|
+
* - Memory (Node.js/Electron/testing)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { APILogger } from './logger';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Storage adapter interface for cross-platform token storage.
|
|
22
|
+
*/
|
|
23
|
+
export interface StorageAdapter {
|
|
24
|
+
getItem(key: string): string | null;
|
|
25
|
+
setItem(key: string, value: string): void;
|
|
26
|
+
removeItem(key: string): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* LocalStorage adapter with safe try-catch for browser environments.
|
|
31
|
+
* Works in modern browsers with localStorage support.
|
|
32
|
+
*
|
|
33
|
+
* Note: This adapter uses window.localStorage and should only be used in browser/client environments.
|
|
34
|
+
* For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead.
|
|
35
|
+
*/
|
|
36
|
+
export class LocalStorageAdapter implements StorageAdapter {
|
|
37
|
+
private logger?: APILogger;
|
|
38
|
+
|
|
39
|
+
constructor(logger?: APILogger) {
|
|
40
|
+
this.logger = logger;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getItem(key: string): string | null {
|
|
44
|
+
try {
|
|
45
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
46
|
+
const value = localStorage.getItem(key);
|
|
47
|
+
this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? 'found' : 'not found'}`);
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
this.logger?.warn('LocalStorage not available: window.localStorage is undefined');
|
|
51
|
+
} catch (error) {
|
|
52
|
+
this.logger?.error('LocalStorage.getItem failed:', error);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
setItem(key: string, value: string): void {
|
|
58
|
+
try {
|
|
59
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
60
|
+
localStorage.setItem(key, value);
|
|
61
|
+
this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
|
|
62
|
+
} else {
|
|
63
|
+
this.logger?.warn('LocalStorage not available: window.localStorage is undefined');
|
|
64
|
+
}
|
|
65
|
+
} catch (error) {
|
|
66
|
+
this.logger?.error('LocalStorage.setItem failed:', error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
removeItem(key: string): void {
|
|
71
|
+
try {
|
|
72
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
73
|
+
localStorage.removeItem(key);
|
|
74
|
+
this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
|
|
75
|
+
} else {
|
|
76
|
+
this.logger?.warn('LocalStorage not available: window.localStorage is undefined');
|
|
77
|
+
}
|
|
78
|
+
} catch (error) {
|
|
79
|
+
this.logger?.error('LocalStorage.removeItem failed:', error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Cookie-based storage adapter for SSR and browser environments.
|
|
86
|
+
* Useful for Next.js, Nuxt.js, and other SSR frameworks.
|
|
87
|
+
*/
|
|
88
|
+
export class CookieStorageAdapter implements StorageAdapter {
|
|
89
|
+
private logger?: APILogger;
|
|
90
|
+
|
|
91
|
+
constructor(logger?: APILogger) {
|
|
92
|
+
this.logger = logger;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
getItem(key: string): string | null {
|
|
96
|
+
try {
|
|
97
|
+
if (typeof document === 'undefined') {
|
|
98
|
+
this.logger?.warn('Cookies not available: document is undefined (SSR context?)');
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
const value = `; ${document.cookie}`;
|
|
102
|
+
const parts = value.split(`; ${key}=`);
|
|
103
|
+
if (parts.length === 2) {
|
|
104
|
+
const result = parts.pop()?.split(';').shift() || null;
|
|
105
|
+
this.logger?.debug(`CookieStorage.getItem("${key}"): ${result ? 'found' : 'not found'}`);
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
this.logger?.debug(`CookieStorage.getItem("${key}"): not found`);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
this.logger?.error('CookieStorage.getItem failed:', error);
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
setItem(key: string, value: string): void {
|
|
116
|
+
try {
|
|
117
|
+
if (typeof document !== 'undefined') {
|
|
118
|
+
document.cookie = `${key}=${value}; path=/; max-age=31536000`;
|
|
119
|
+
this.logger?.debug(`CookieStorage.setItem("${key}"): success`);
|
|
120
|
+
} else {
|
|
121
|
+
this.logger?.warn('Cookies not available: document is undefined (SSR context?)');
|
|
122
|
+
}
|
|
123
|
+
} catch (error) {
|
|
124
|
+
this.logger?.error('CookieStorage.setItem failed:', error);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
removeItem(key: string): void {
|
|
129
|
+
try {
|
|
130
|
+
if (typeof document !== 'undefined') {
|
|
131
|
+
document.cookie = `${key}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
|
|
132
|
+
this.logger?.debug(`CookieStorage.removeItem("${key}"): success`);
|
|
133
|
+
} else {
|
|
134
|
+
this.logger?.warn('Cookies not available: document is undefined (SSR context?)');
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
this.logger?.error('CookieStorage.removeItem failed:', error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* In-memory storage adapter for Node.js, Electron, and testing environments.
|
|
144
|
+
* Data is stored in RAM and cleared when process exits.
|
|
145
|
+
*/
|
|
146
|
+
export class MemoryStorageAdapter implements StorageAdapter {
|
|
147
|
+
private storage: Map<string, string> = new Map();
|
|
148
|
+
private logger?: APILogger;
|
|
149
|
+
|
|
150
|
+
constructor(logger?: APILogger) {
|
|
151
|
+
this.logger = logger;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
getItem(key: string): string | null {
|
|
155
|
+
const value = this.storage.get(key) || null;
|
|
156
|
+
this.logger?.debug(`MemoryStorage.getItem("${key}"): ${value ? 'found' : 'not found'}`);
|
|
157
|
+
return value;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
setItem(key: string, value: string): void {
|
|
161
|
+
this.storage.set(key, value);
|
|
162
|
+
this.logger?.debug(`MemoryStorage.setItem("${key}"): success`);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
removeItem(key: string): void {
|
|
166
|
+
this.storage.delete(key);
|
|
167
|
+
this.logger?.debug(`MemoryStorage.removeItem("${key}"): success`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by DjangoCFG.
|
|
5
|
+
* Any manual changes will be lost when the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @see https://djangocfg.com/docs/features/modules/django-client/overview/
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Zod Validation Events - Browser CustomEvent integration
|
|
11
|
+
*
|
|
12
|
+
* Dispatches browser CustomEvents when Zod validation fails, allowing
|
|
13
|
+
* React/frontend apps to listen and handle validation errors globally.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // In your React app
|
|
18
|
+
* window.addEventListener('zod-validation-error', (event) => {
|
|
19
|
+
* const { operation, path, method, error, response } = event.detail;
|
|
20
|
+
* console.error(`Validation failed for ${method} ${path}`, error);
|
|
21
|
+
* // Show toast notification, log to Sentry, etc.
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import type { ZodError } from 'zod'
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Validation error event detail
|
|
30
|
+
*/
|
|
31
|
+
export interface ValidationErrorDetail {
|
|
32
|
+
/** Operation/function name that failed validation */
|
|
33
|
+
operation: string
|
|
34
|
+
/** API endpoint path */
|
|
35
|
+
path: string
|
|
36
|
+
/** HTTP method */
|
|
37
|
+
method: string
|
|
38
|
+
/** Zod validation error */
|
|
39
|
+
error: ZodError
|
|
40
|
+
/** Raw response data that failed validation */
|
|
41
|
+
response: any
|
|
42
|
+
/** Timestamp of the error */
|
|
43
|
+
timestamp: Date
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Custom event type for Zod validation errors
|
|
48
|
+
*/
|
|
49
|
+
export type ValidationErrorEvent = CustomEvent<ValidationErrorDetail>
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Dispatch a Zod validation error event.
|
|
53
|
+
*
|
|
54
|
+
* Only dispatches in browser environment (when window is defined).
|
|
55
|
+
* Safe to call in Node.js/SSR - will be a no-op.
|
|
56
|
+
*
|
|
57
|
+
* @param detail - Validation error details
|
|
58
|
+
*/
|
|
59
|
+
export function dispatchValidationError(detail: ValidationErrorDetail): void {
|
|
60
|
+
// Check if running in browser
|
|
61
|
+
if (typeof window === 'undefined') {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const event = new CustomEvent<ValidationErrorDetail>('zod-validation-error', {
|
|
67
|
+
detail,
|
|
68
|
+
bubbles: true,
|
|
69
|
+
cancelable: false,
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
window.dispatchEvent(event)
|
|
73
|
+
} catch (error) {
|
|
74
|
+
// Silently fail - validation event dispatch should never crash the app
|
|
75
|
+
console.warn('Failed to dispatch validation error event:', error)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Add a global listener for Zod validation errors.
|
|
81
|
+
*
|
|
82
|
+
* @param callback - Function to call when validation error occurs
|
|
83
|
+
* @returns Cleanup function to remove the listener
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const cleanup = onValidationError(({ operation, error }) => {
|
|
88
|
+
* toast.error(`Validation failed in ${operation}`);
|
|
89
|
+
* logToSentry(error);
|
|
90
|
+
* });
|
|
91
|
+
*
|
|
92
|
+
* // Later, remove listener
|
|
93
|
+
* cleanup();
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export function onValidationError(
|
|
97
|
+
callback: (detail: ValidationErrorDetail) => void
|
|
98
|
+
): () => void {
|
|
99
|
+
if (typeof window === 'undefined') {
|
|
100
|
+
// Return no-op cleanup function for SSR
|
|
101
|
+
return () => {}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const handler = (event: Event) => {
|
|
105
|
+
if (event instanceof CustomEvent) {
|
|
106
|
+
callback(event.detail)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
window.addEventListener('zod-validation-error', handler)
|
|
111
|
+
|
|
112
|
+
// Return cleanup function
|
|
113
|
+
return () => {
|
|
114
|
+
window.removeEventListener('zod-validation-error', handler)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Format Zod error for logging/display.
|
|
120
|
+
*
|
|
121
|
+
* @param error - Zod validation error
|
|
122
|
+
* @returns Formatted error message
|
|
123
|
+
*/
|
|
124
|
+
export function formatZodError(error: ZodError): string {
|
|
125
|
+
const issues = error.issues.map((issue, index) => {
|
|
126
|
+
const path = issue.path.join('.') || 'root'
|
|
127
|
+
const parts = [`${index + 1}. ${path}: ${issue.message}`]
|
|
128
|
+
|
|
129
|
+
if ('expected' in issue && issue.expected) {
|
|
130
|
+
parts.push(` Expected: ${issue.expected}`)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if ('received' in issue && issue.received) {
|
|
134
|
+
parts.push(` Received: ${issue.received}`)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return parts.join('\n')
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
return issues.join('\n')
|
|
141
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by DjangoCFG.
|
|
5
|
+
* Any manual changes will be lost when the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @see https://djangocfg.com/docs/features/modules/django-client/overview/
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Typed Fetchers - Universal API functions
|
|
11
|
+
*
|
|
12
|
+
* Auto-generated from OpenAPI specification.
|
|
13
|
+
* These functions work in any JavaScript environment.
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Runtime validation with Zod
|
|
17
|
+
* - Type-safe parameters and responses
|
|
18
|
+
* - Works with any data-fetching library (SWR, React Query, etc)
|
|
19
|
+
* - Server Component compatible
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import * as fetchers from './fetchers'
|
|
24
|
+
*
|
|
25
|
+
* // Direct usage
|
|
26
|
+
* const user = await fetchers.getUser(1)
|
|
27
|
+
*
|
|
28
|
+
* // With SWR
|
|
29
|
+
* const { data } = useSWR('user-1', () => fetchers.getUser(1))
|
|
30
|
+
*
|
|
31
|
+
* // With React Query
|
|
32
|
+
* const { data } = useQuery(['user', 1], () => fetchers.getUser(1))
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
export * from './webpush__web_push'
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by DjangoCFG.
|
|
5
|
+
* Any manual changes will be lost when the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @see https://djangocfg.com/docs/features/modules/django-client/overview/
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Typed fetchers for Web Push
|
|
3
11
|
*
|
|
4
12
|
* Universal functions that work in any environment:
|
|
5
13
|
* - Next.js (App Router / Pages Router / Server Components)
|
|
@@ -30,27 +38,29 @@
|
|
|
30
38
|
* ```
|
|
31
39
|
*/
|
|
32
40
|
import { consola } from 'consola'
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
41
|
+
import { SendPushRequestRequestSchema, type SendPushRequestRequest } from '../schemas/SendPushRequestRequest.schema'
|
|
42
|
+
import { SendPushResponseSchema, type SendPushResponse } from '../schemas/SendPushResponse.schema'
|
|
43
|
+
import { SubscribeRequestRequestSchema, type SubscribeRequestRequest } from '../schemas/SubscribeRequestRequest.schema'
|
|
44
|
+
import { SubscribeResponseSchema, type SubscribeResponse } from '../schemas/SubscribeResponse.schema'
|
|
45
|
+
import { VapidPublicKeyResponseSchema, type VapidPublicKeyResponse } from '../schemas/VapidPublicKeyResponse.schema'
|
|
36
46
|
import { getAPIInstance } from '../../api-instance'
|
|
37
47
|
|
|
38
48
|
/**
|
|
39
|
-
*
|
|
49
|
+
* Send push notification
|
|
40
50
|
*
|
|
41
|
-
* @method
|
|
42
|
-
* @path /cfg/
|
|
51
|
+
* @method POST
|
|
52
|
+
* @path /cfg/webpush/send/
|
|
43
53
|
*/
|
|
44
|
-
export async function
|
|
45
|
-
): Promise<
|
|
54
|
+
export async function createWebpushSendCreate( data: SendPushRequestRequest, client?: any
|
|
55
|
+
): Promise<SendPushResponse> {
|
|
46
56
|
const api = client || getAPIInstance()
|
|
47
|
-
const response = await api.
|
|
57
|
+
const response = await api.web_push.webpushSendCreate(data)
|
|
48
58
|
try {
|
|
49
|
-
return
|
|
59
|
+
return SendPushResponseSchema.parse(response)
|
|
50
60
|
} catch (error) {
|
|
51
61
|
// Zod validation error - log detailed information
|
|
52
62
|
consola.error('❌ Zod Validation Failed');
|
|
53
|
-
consola.box(`
|
|
63
|
+
consola.box(`createWebpushSendCreate\nPath: /cfg/webpush/send/\nMethod: POST`);
|
|
54
64
|
|
|
55
65
|
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
56
66
|
consola.error('Validation Issues:');
|
|
@@ -69,9 +79,9 @@ export async function getGrpcApiKeysList( params?: { is_active?: boolean; page?
|
|
|
69
79
|
try {
|
|
70
80
|
const event = new CustomEvent('zod-validation-error', {
|
|
71
81
|
detail: {
|
|
72
|
-
operation: '
|
|
73
|
-
path: '/cfg/
|
|
74
|
-
method: '
|
|
82
|
+
operation: 'createWebpushSendCreate',
|
|
83
|
+
path: '/cfg/webpush/send/',
|
|
84
|
+
method: 'POST',
|
|
75
85
|
error: error,
|
|
76
86
|
response: response,
|
|
77
87
|
timestamp: new Date(),
|
|
@@ -93,21 +103,21 @@ export async function getGrpcApiKeysList( params?: { is_active?: boolean; page?
|
|
|
93
103
|
|
|
94
104
|
|
|
95
105
|
/**
|
|
96
|
-
*
|
|
106
|
+
* Subscribe to push notifications
|
|
97
107
|
*
|
|
98
|
-
* @method
|
|
99
|
-
* @path /cfg/
|
|
108
|
+
* @method POST
|
|
109
|
+
* @path /cfg/webpush/subscribe/
|
|
100
110
|
*/
|
|
101
|
-
export async function
|
|
102
|
-
): Promise<
|
|
111
|
+
export async function createWebpushSubscribeCreate( data: SubscribeRequestRequest, client?: any
|
|
112
|
+
): Promise<SubscribeResponse> {
|
|
103
113
|
const api = client || getAPIInstance()
|
|
104
|
-
const response = await api.
|
|
114
|
+
const response = await api.web_push.webpushSubscribeCreate(data)
|
|
105
115
|
try {
|
|
106
|
-
return
|
|
116
|
+
return SubscribeResponseSchema.parse(response)
|
|
107
117
|
} catch (error) {
|
|
108
118
|
// Zod validation error - log detailed information
|
|
109
119
|
consola.error('❌ Zod Validation Failed');
|
|
110
|
-
consola.box(`
|
|
120
|
+
consola.box(`createWebpushSubscribeCreate\nPath: /cfg/webpush/subscribe/\nMethod: POST`);
|
|
111
121
|
|
|
112
122
|
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
113
123
|
consola.error('Validation Issues:');
|
|
@@ -126,9 +136,9 @@ export async function getGrpcApiKeysRetrieve( id: number, client?: any
|
|
|
126
136
|
try {
|
|
127
137
|
const event = new CustomEvent('zod-validation-error', {
|
|
128
138
|
detail: {
|
|
129
|
-
operation: '
|
|
130
|
-
path: '/cfg/
|
|
131
|
-
method: '
|
|
139
|
+
operation: 'createWebpushSubscribeCreate',
|
|
140
|
+
path: '/cfg/webpush/subscribe/',
|
|
141
|
+
method: 'POST',
|
|
132
142
|
error: error,
|
|
133
143
|
response: response,
|
|
134
144
|
timestamp: new Date(),
|
|
@@ -150,21 +160,21 @@ export async function getGrpcApiKeysRetrieve( id: number, client?: any
|
|
|
150
160
|
|
|
151
161
|
|
|
152
162
|
/**
|
|
153
|
-
* Get
|
|
163
|
+
* Get VAPID public key
|
|
154
164
|
*
|
|
155
165
|
* @method GET
|
|
156
|
-
* @path /cfg/
|
|
166
|
+
* @path /cfg/webpush/vapid/
|
|
157
167
|
*/
|
|
158
|
-
export async function
|
|
159
|
-
): Promise<
|
|
168
|
+
export async function getWebpushVapidRetrieve( client?: any
|
|
169
|
+
): Promise<VapidPublicKeyResponse> {
|
|
160
170
|
const api = client || getAPIInstance()
|
|
161
|
-
const response = await api.
|
|
171
|
+
const response = await api.web_push.webpushVapidRetrieve()
|
|
162
172
|
try {
|
|
163
|
-
return
|
|
173
|
+
return VapidPublicKeyResponseSchema.parse(response)
|
|
164
174
|
} catch (error) {
|
|
165
175
|
// Zod validation error - log detailed information
|
|
166
176
|
consola.error('❌ Zod Validation Failed');
|
|
167
|
-
consola.box(`
|
|
177
|
+
consola.box(`getWebpushVapidRetrieve\nPath: /cfg/webpush/vapid/\nMethod: GET`);
|
|
168
178
|
|
|
169
179
|
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
170
180
|
consola.error('Validation Issues:');
|
|
@@ -183,8 +193,8 @@ export async function getGrpcApiKeysStatsRetrieve( client?: any
|
|
|
183
193
|
try {
|
|
184
194
|
const event = new CustomEvent('zod-validation-error', {
|
|
185
195
|
detail: {
|
|
186
|
-
operation: '
|
|
187
|
-
path: '/cfg/
|
|
196
|
+
operation: 'getWebpushVapidRetrieve',
|
|
197
|
+
path: '/cfg/webpush/vapid/',
|
|
188
198
|
method: 'GET',
|
|
189
199
|
error: error,
|
|
190
200
|
response: response,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by DjangoCFG.
|
|
5
|
+
* Any manual changes will be lost when the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @see https://djangocfg.com/docs/features/modules/django-client/overview/
|
|
8
|
+
*/
|
|
9
|
+
'use client';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* SWR Hooks - React data fetching hooks
|
|
13
|
+
*
|
|
14
|
+
* Auto-generated from OpenAPI specification.
|
|
15
|
+
* Powered by SWR for automatic caching and revalidation.
|
|
16
|
+
*
|
|
17
|
+
* Features:
|
|
18
|
+
* - Automatic caching and deduplication
|
|
19
|
+
* - Revalidation on focus/reconnect
|
|
20
|
+
* - Optimistic updates
|
|
21
|
+
* - Type-safe parameters and responses
|
|
22
|
+
*
|
|
23
|
+
* Usage:
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import * as hooks from './hooks'
|
|
26
|
+
*
|
|
27
|
+
* // Query hooks (GET)
|
|
28
|
+
* const { data, error, isLoading } = hooks.useUsers({ page: 1 })
|
|
29
|
+
*
|
|
30
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
31
|
+
* const createUser = hooks.useCreateUser()
|
|
32
|
+
* await createUser({ name: 'John' })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
export * from './webpush__web_push'
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by DjangoCFG.
|
|
5
|
+
* Any manual changes will be lost when the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @see https://djangocfg.com/docs/features/modules/django-client/overview/
|
|
8
|
+
*/
|
|
9
|
+
'use client';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* SWR Hooks for Web Push
|
|
13
|
+
*
|
|
14
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
15
|
+
* revalidation, and optimistic updates.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // Query hooks (GET)
|
|
20
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
21
|
+
*
|
|
22
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
23
|
+
* const createUser = useCreateUser()
|
|
24
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import useSWR from 'swr'
|
|
28
|
+
import { useSWRConfig } from 'swr'
|
|
29
|
+
import * as Fetchers from '../fetchers/webpush__web_push'
|
|
30
|
+
import type { API } from '../../index'
|
|
31
|
+
import type { SendPushRequestRequest } from '../schemas/SendPushRequestRequest.schema'
|
|
32
|
+
import type { SendPushResponse } from '../schemas/SendPushResponse.schema'
|
|
33
|
+
import type { SubscribeRequestRequest } from '../schemas/SubscribeRequestRequest.schema'
|
|
34
|
+
import type { SubscribeResponse } from '../schemas/SubscribeResponse.schema'
|
|
35
|
+
import type { VapidPublicKeyResponse } from '../schemas/VapidPublicKeyResponse.schema'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Send push notification
|
|
39
|
+
*
|
|
40
|
+
* @method POST
|
|
41
|
+
* @path /cfg/webpush/send/
|
|
42
|
+
*/
|
|
43
|
+
export function useCreateWebpushSendCreate() {
|
|
44
|
+
const { mutate } = useSWRConfig()
|
|
45
|
+
|
|
46
|
+
return async (data: SendPushRequestRequest, client?: API): Promise<SendPushResponse> => {
|
|
47
|
+
const result = await Fetchers.createWebpushSendCreate(data, client)
|
|
48
|
+
// Revalidate related queries
|
|
49
|
+
mutate('cfg-webpush-send')
|
|
50
|
+
return result
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Subscribe to push notifications
|
|
57
|
+
*
|
|
58
|
+
* @method POST
|
|
59
|
+
* @path /cfg/webpush/subscribe/
|
|
60
|
+
*/
|
|
61
|
+
export function useCreateWebpushSubscribeCreate() {
|
|
62
|
+
const { mutate } = useSWRConfig()
|
|
63
|
+
|
|
64
|
+
return async (data: SubscribeRequestRequest, client?: API): Promise<SubscribeResponse> => {
|
|
65
|
+
const result = await Fetchers.createWebpushSubscribeCreate(data, client)
|
|
66
|
+
// Revalidate related queries
|
|
67
|
+
mutate('cfg-webpush-subscribe')
|
|
68
|
+
return result
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get VAPID public key
|
|
75
|
+
*
|
|
76
|
+
* @method GET
|
|
77
|
+
* @path /cfg/webpush/vapid/
|
|
78
|
+
*/
|
|
79
|
+
export function useWebpushVapidRetrieve(client?: API): ReturnType<typeof useSWR<VapidPublicKeyResponse>> {
|
|
80
|
+
return useSWR<VapidPublicKeyResponse>(
|
|
81
|
+
'cfg-webpush-vapid',
|
|
82
|
+
() => Fetchers.getWebpushVapidRetrieve(client)
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for SendPushRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request serializer for sending push notifications.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request serializer for sending push notifications.
|
|
11
|
+
*/
|
|
12
|
+
export const SendPushRequestRequestSchema = z.object({
|
|
13
|
+
title: z.string().min(1).max(255),
|
|
14
|
+
body: z.string().min(1),
|
|
15
|
+
icon: z.url().nullable().optional(),
|
|
16
|
+
url: z.url().nullable().optional(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Infer TypeScript type from Zod schema
|
|
21
|
+
*/
|
|
22
|
+
export type SendPushRequestRequest = z.infer<typeof SendPushRequestRequestSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for SendPushResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Response serializer for send push endpoint.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Response serializer for send push endpoint.
|
|
11
|
+
*/
|
|
12
|
+
export const SendPushResponseSchema = z.object({
|
|
13
|
+
success: z.boolean(),
|
|
14
|
+
sent_to: z.int(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type SendPushResponse = z.infer<typeof SendPushResponseSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for SubscribeRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request serializer for subscribing to push notifications.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request serializer for subscribing to push notifications.
|
|
11
|
+
*/
|
|
12
|
+
export const SubscribeRequestRequestSchema = z.object({
|
|
13
|
+
endpoint: z.url(),
|
|
14
|
+
keys: z.record(z.string(), z.string().min(1)),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type SubscribeRequestRequest = z.infer<typeof SubscribeRequestRequestSchema>
|