@djangocfg/api 1.0.1
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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/index.cjs +28422 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +31214 -0
- package/dist/index.d.ts +31214 -0
- package/dist/index.mjs +28334 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +83 -0
- package/src/cfg/BaseClient.ts +56 -0
- package/src/cfg/contexts/AccountsContext.tsx +205 -0
- package/src/cfg/contexts/LeadsContext.tsx +145 -0
- package/src/cfg/contexts/NewsletterContext.tsx +244 -0
- package/src/cfg/contexts/SupportContext.tsx +256 -0
- package/src/cfg/contexts/index.ts +48 -0
- package/src/cfg/contexts/knowbase/ChatContext.tsx +174 -0
- package/src/cfg/contexts/knowbase/DocumentsContext.tsx +304 -0
- package/src/cfg/contexts/knowbase/SessionsContext.tsx +174 -0
- package/src/cfg/contexts/knowbase/index.ts +58 -0
- package/src/cfg/contexts/payments/ApiKeysContext.tsx +115 -0
- package/src/cfg/contexts/payments/BalancesContext.tsx +118 -0
- package/src/cfg/contexts/payments/CurrenciesContext.tsx +105 -0
- package/src/cfg/contexts/payments/OverviewContext.tsx +141 -0
- package/src/cfg/contexts/payments/PaymentsContext.tsx +131 -0
- package/src/cfg/contexts/payments/README.md +201 -0
- package/src/cfg/contexts/payments/index.ts +65 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +66 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +121 -0
- package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +49 -0
- package/src/cfg/generated/_utils/fetchers/cfg__health.ts +64 -0
- package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +122 -0
- package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +81 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +123 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +49 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +64 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +81 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +2489 -0
- package/src/cfg/generated/_utils/fetchers/cfg__payments__webhooks.ts +109 -0
- package/src/cfg/generated/_utils/fetchers/cfg__support.ts +212 -0
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +182 -0
- package/src/cfg/generated/_utils/fetchers/index.ts +45 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts.ts +61 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts__auth.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts__user_profile.ts +128 -0
- package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +36 -0
- package/src/cfg/generated/_utils/hooks/cfg__health.ts +51 -0
- package/src/cfg/generated/_utils/hooks/cfg__leads.ts +127 -0
- package/src/cfg/generated/_utils/hooks/cfg__leads__lead_submission.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter.ts +80 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__bulk_email.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__campaigns.ts +128 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__logs.ts +36 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__newsletters.ts +51 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__subscriptions.ts +76 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__testing.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__payments.ts +2716 -0
- package/src/cfg/generated/_utils/hooks/cfg__payments__webhooks.ts +100 -0
- package/src/cfg/generated/_utils/hooks/cfg__support.ts +235 -0
- package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +193 -0
- package/src/cfg/generated/_utils/hooks/index.ts +43 -0
- package/src/cfg/generated/_utils/schemas/APIKeyCreate.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyCreateRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyDetail.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/APIKeyList.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/APIKeyUpdate.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyUpdateRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyValidationRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/APIKeyValidationResponse.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/APIKeysOverview.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/APIResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/APIResponseRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentCreate.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentCreateRequest.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentDetail.schema.ts +50 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentList.schema.ts +38 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentStats.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentUpdate.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentUpdateRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/AdminUser.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/BalanceOverview.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/BulkEmailRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/BulkEmailResponse.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/ChartDataPoint.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ChartSeries.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/Currency.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/CurrencyAnalyticsItem.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/CurrencyList.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/EmailLog.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/Endpoint.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/EndpointGroup.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/EndpointsStatus.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/ErrorResponse.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/HealthCheck.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmission.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmissionError.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmissionRequest.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmissionResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/Message.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/MessageCreate.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/MessageCreateRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/MessageRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/Network.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/Newsletter.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/NewsletterCampaign.schema.ts +33 -0
- package/src/cfg/generated/_utils/schemas/NewsletterCampaignRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/NewsletterSubscription.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/OTPErrorResponse.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/OTPRequestRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/OTPRequestResponse.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/OTPVerifyRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/OTPVerifyResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAPIKeyListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentStatsList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAdminUserList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedCurrencyListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedEmailLogList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedEndpointGroupList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedLeadSubmissionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedMessageList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNetworkList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNewsletterCampaignList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNewsletterList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNewsletterSubscriptionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedPaymentListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedProviderCurrencyList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedRecentPaymentList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedRecentTransactionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedSubscriptionListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedTariffList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedTicketList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedTransactionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedUserBalanceList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedWebhookEventListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedWebhookStatsList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PatchedAPIKeyUpdateRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PatchedAdminPaymentUpdateRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/PatchedLeadSubmissionRequest.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/PatchedMessageRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/PatchedNewsletterCampaignRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PatchedPaymentRequest.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/PatchedSubscriptionRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PatchedTicketRequest.schema.ts +18 -0
- package/src/cfg/generated/_utils/schemas/PatchedUnsubscribeRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/Payment.schema.ts +48 -0
- package/src/cfg/generated/_utils/schemas/PaymentAnalyticsResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PaymentCreate.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/PaymentList.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/PaymentOverview.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/PaymentRequest.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/PaymentsChartResponse.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaymentsDashboardOverview.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PaymentsMetrics.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/ProviderAnalyticsItem.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ProviderCurrency.schema.ts +36 -0
- package/src/cfg/generated/_utils/schemas/QueueAction.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/QueueActionRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/QueueStatus.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/QuickHealth.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/RecentPayment.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/RecentTransaction.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/SendCampaignRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/SendCampaignResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/Sender.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/SubscribeRequest.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/SubscribeResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/Subscription.schema.ts +41 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionCreate.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionCreateRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionList.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionOverview.schema.ts +37 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/SuccessResponse.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/SupportedProviders.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/Tariff.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/TaskStatistics.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/TestEmailRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/Ticket.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/TicketRequest.schema.ts +18 -0
- package/src/cfg/generated/_utils/schemas/TokenRefresh.schema.ts +16 -0
- package/src/cfg/generated/_utils/schemas/TokenRefreshRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/Transaction.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/Unsubscribe.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/UnsubscribeRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/User.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/UserBalance.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/UserProfileUpdateRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/WebhookEvent.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/WebhookEventList.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/WebhookEventListRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/WebhookEventRequest.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/WebhookHealth.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/WebhookProviderStats.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/WebhookProviderStatsRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/WebhookResponse.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WebhookResponseRequest.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WebhookStats.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WebhookStatsRequest.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WorkerAction.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/WorkerActionRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/index.ts +160 -0
- package/src/cfg/generated/api-instance.ts +131 -0
- package/src/cfg/generated/cfg__accounts/client.ts +30 -0
- package/src/cfg/generated/cfg__accounts/index.ts +2 -0
- package/src/cfg/generated/cfg__accounts/models.ts +100 -0
- package/src/cfg/generated/cfg__accounts__auth/client.ts +22 -0
- package/src/cfg/generated/cfg__accounts__auth/index.ts +2 -0
- package/src/cfg/generated/cfg__accounts__auth/models.ts +17 -0
- package/src/cfg/generated/cfg__accounts__user_profile/client.ts +77 -0
- package/src/cfg/generated/cfg__accounts__user_profile/index.ts +2 -0
- package/src/cfg/generated/cfg__accounts__user_profile/models.ts +56 -0
- package/src/cfg/generated/cfg__endpoints/client.ts +22 -0
- package/src/cfg/generated/cfg__endpoints/index.ts +2 -0
- package/src/cfg/generated/cfg__endpoints/models.ts +68 -0
- package/src/cfg/generated/cfg__health/client.ts +30 -0
- package/src/cfg/generated/cfg__health/index.ts +2 -0
- package/src/cfg/generated/cfg__health/models.ts +34 -0
- package/src/cfg/generated/cfg__leads/client.ts +79 -0
- package/src/cfg/generated/cfg__leads/index.ts +2 -0
- package/src/cfg/generated/cfg__leads/models.ts +99 -0
- package/src/cfg/generated/cfg__leads__lead_submission/client.ts +25 -0
- package/src/cfg/generated/cfg__leads__lead_submission/index.ts +2 -0
- package/src/cfg/generated/cfg__leads__lead_submission/models.ts +48 -0
- package/src/cfg/generated/cfg__newsletter/client.ts +38 -0
- package/src/cfg/generated/cfg__newsletter/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter/models.ts +71 -0
- package/src/cfg/generated/cfg__newsletter__bulk_email/client.ts +24 -0
- package/src/cfg/generated/cfg__newsletter__bulk_email/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__bulk_email/models.ts +29 -0
- package/src/cfg/generated/cfg__newsletter__campaigns/client.ts +85 -0
- package/src/cfg/generated/cfg__newsletter__campaigns/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__campaigns/models.ts +100 -0
- package/src/cfg/generated/cfg__newsletter__logs/client.ts +35 -0
- package/src/cfg/generated/cfg__newsletter__logs/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__logs/models.ts +51 -0
- package/src/cfg/generated/cfg__newsletter__newsletters/client.ts +45 -0
- package/src/cfg/generated/cfg__newsletter__newsletters/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__newsletters/models.ts +42 -0
- package/src/cfg/generated/cfg__newsletter__subscriptions/client.ts +55 -0
- package/src/cfg/generated/cfg__newsletter__subscriptions/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__subscriptions/models.ts +92 -0
- package/src/cfg/generated/cfg__newsletter__testing/client.ts +24 -0
- package/src/cfg/generated/cfg__newsletter__testing/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__testing/models.ts +24 -0
- package/src/cfg/generated/cfg__payments/client.ts +1814 -0
- package/src/cfg/generated/cfg__payments/index.ts +2 -0
- package/src/cfg/generated/cfg__payments/models.ts +1855 -0
- package/src/cfg/generated/cfg__payments__webhooks/client.ts +75 -0
- package/src/cfg/generated/cfg__payments__webhooks/index.ts +2 -0
- package/src/cfg/generated/cfg__payments__webhooks/models.ts +87 -0
- package/src/cfg/generated/cfg__support/client.ts +133 -0
- package/src/cfg/generated/cfg__support/index.ts +2 -0
- package/src/cfg/generated/cfg__support/models.ts +165 -0
- package/src/cfg/generated/cfg__tasks/client.ts +94 -0
- package/src/cfg/generated/cfg__tasks/index.ts +2 -0
- package/src/cfg/generated/cfg__tasks/models.ts +140 -0
- package/src/cfg/generated/client.ts +302 -0
- package/src/cfg/generated/enums.ts +608 -0
- package/src/cfg/generated/errors.ts +116 -0
- package/src/cfg/generated/http.ts +98 -0
- package/src/cfg/generated/index.ts +299 -0
- package/src/cfg/generated/logger.ts +259 -0
- package/src/cfg/generated/package.json +39 -0
- package/src/cfg/generated/retry.ts +175 -0
- package/src/cfg/generated/schema.ts +18399 -0
- package/src/cfg/generated/storage.ts +158 -0
- package/src/cfg/generated/tsconfig.json +20 -0
- package/src/cfg/services/auth/AuthService.ts +165 -0
- package/src/cfg/services/auth/index.ts +7 -0
- package/src/cfg/services/index.ts +31 -0
- package/src/cfg/services/leads/LeadsService.ts +133 -0
- package/src/cfg/services/leads/index.ts +7 -0
- package/src/cfg/services/newsletter/BulkEmailService.ts +35 -0
- package/src/cfg/services/newsletter/CampaignsService.ts +138 -0
- package/src/cfg/services/newsletter/NewsletterService.ts +79 -0
- package/src/cfg/services/newsletter/NewslettersListService.ts +48 -0
- package/src/cfg/services/newsletter/index.ts +10 -0
- package/src/cfg/services/payments/ApiKeysService.ts +183 -0
- package/src/cfg/services/payments/DashboardService.ts +197 -0
- package/src/cfg/services/payments/PaymentsService.ts +192 -0
- package/src/cfg/services/payments/SubscriptionsService.ts +202 -0
- package/src/cfg/services/payments/index.ts +10 -0
- package/src/cfg/services/support/SupportService.ts +142 -0
- package/src/cfg/services/support/index.ts +7 -0
- package/src/cfg/services/tasks/TasksService.ts +170 -0
- package/src/cfg/services/tasks/index.ts +7 -0
- package/src/cfg/services/webhooks/WebhooksService.ts +108 -0
- package/src/cfg/services/webhooks/index.ts +7 -0
- package/src/index.ts +35 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Leads
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { LeadSubmissionSchema, type LeadSubmission } from '../schemas/LeadSubmission.schema'
|
|
33
|
+
import { LeadSubmissionRequestSchema, type LeadSubmissionRequest } from '../schemas/LeadSubmissionRequest.schema'
|
|
34
|
+
import { PaginatedLeadSubmissionListSchema, type PaginatedLeadSubmissionList } from '../schemas/PaginatedLeadSubmissionList.schema'
|
|
35
|
+
import { PatchedLeadSubmissionRequestSchema, type PatchedLeadSubmissionRequest } from '../schemas/PatchedLeadSubmissionRequest.schema'
|
|
36
|
+
import { getAPIInstance } from '../../api-instance'
|
|
37
|
+
import type { API } from '../../index'
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* API operation
|
|
41
|
+
*
|
|
42
|
+
* @method GET
|
|
43
|
+
* @path /cfg/leads/
|
|
44
|
+
*/
|
|
45
|
+
export async function getLeadsList( params?: { page?: number; page_size?: number }, client?: API
|
|
46
|
+
): Promise<PaginatedLeadSubmissionList> {
|
|
47
|
+
const api = client || getAPIInstance()
|
|
48
|
+
const response = await api.cfg_leads.list(params?.page, params?.page_size)
|
|
49
|
+
return PaginatedLeadSubmissionListSchema.parse(response)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* API operation
|
|
55
|
+
*
|
|
56
|
+
* @method POST
|
|
57
|
+
* @path /cfg/leads/
|
|
58
|
+
*/
|
|
59
|
+
export async function createLeadsCreate( data: LeadSubmissionRequest, client?: API
|
|
60
|
+
): Promise<LeadSubmission> {
|
|
61
|
+
const api = client || getAPIInstance()
|
|
62
|
+
const response = await api.cfg_leads.create(data)
|
|
63
|
+
return LeadSubmissionSchema.parse(response)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* API operation
|
|
69
|
+
*
|
|
70
|
+
* @method GET
|
|
71
|
+
* @path /cfg/leads/{id}/
|
|
72
|
+
*/
|
|
73
|
+
export async function getLeadsRetrieve( id: number, client?: API
|
|
74
|
+
): Promise<LeadSubmission> {
|
|
75
|
+
const api = client || getAPIInstance()
|
|
76
|
+
const response = await api.cfg_leads.retrieve(id)
|
|
77
|
+
return LeadSubmissionSchema.parse(response)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* API operation
|
|
83
|
+
*
|
|
84
|
+
* @method PUT
|
|
85
|
+
* @path /cfg/leads/{id}/
|
|
86
|
+
*/
|
|
87
|
+
export async function updateLeadsUpdate( id: number, data: LeadSubmissionRequest, client?: API
|
|
88
|
+
): Promise<LeadSubmission> {
|
|
89
|
+
const api = client || getAPIInstance()
|
|
90
|
+
const response = await api.cfg_leads.update(id, data)
|
|
91
|
+
return LeadSubmissionSchema.parse(response)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* API operation
|
|
97
|
+
*
|
|
98
|
+
* @method PATCH
|
|
99
|
+
* @path /cfg/leads/{id}/
|
|
100
|
+
*/
|
|
101
|
+
export async function partialUpdateLeadsPartialUpdate( id: number, data?: PatchedLeadSubmissionRequest, client?: API
|
|
102
|
+
): Promise<LeadSubmission> {
|
|
103
|
+
const api = client || getAPIInstance()
|
|
104
|
+
const response = await api.cfg_leads.partialUpdate(id, data)
|
|
105
|
+
return LeadSubmissionSchema.parse(response)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* API operation
|
|
111
|
+
*
|
|
112
|
+
* @method DELETE
|
|
113
|
+
* @path /cfg/leads/{id}/
|
|
114
|
+
*/
|
|
115
|
+
export async function deleteLeadsDestroy( id: number, client?: API
|
|
116
|
+
): Promise<void> {
|
|
117
|
+
const api = client || getAPIInstance()
|
|
118
|
+
const response = await api.cfg_leads.destroy(id)
|
|
119
|
+
return response
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Lead Submission
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { LeadSubmissionRequestSchema, type LeadSubmissionRequest } from '../schemas/LeadSubmissionRequest.schema'
|
|
33
|
+
import { LeadSubmissionResponseSchema, type LeadSubmissionResponse } from '../schemas/LeadSubmissionResponse.schema'
|
|
34
|
+
import { getAPIInstance } from '../../api-instance'
|
|
35
|
+
import type { API } from '../../index'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Submit Lead Form
|
|
39
|
+
*
|
|
40
|
+
* @method POST
|
|
41
|
+
* @path /cfg/leads/submit/
|
|
42
|
+
*/
|
|
43
|
+
export async function createLeadsSubmitCreate( data: LeadSubmissionRequest, client?: API
|
|
44
|
+
): Promise<LeadSubmissionResponse> {
|
|
45
|
+
const api = client || getAPIInstance()
|
|
46
|
+
const response = await api.cfg_lead_submission.leadsSubmitCreate(data)
|
|
47
|
+
return LeadSubmissionResponseSchema.parse(response)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Newsletter
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { NewsletterCampaignSchema, type NewsletterCampaign } from '../schemas/NewsletterCampaign.schema'
|
|
33
|
+
import { PatchedNewsletterCampaignRequestSchema, type PatchedNewsletterCampaignRequest } from '../schemas/PatchedNewsletterCampaignRequest.schema'
|
|
34
|
+
import { PatchedUnsubscribeRequestSchema, type PatchedUnsubscribeRequest } from '../schemas/PatchedUnsubscribeRequest.schema'
|
|
35
|
+
import { UnsubscribeSchema, type Unsubscribe } from '../schemas/Unsubscribe.schema'
|
|
36
|
+
import { UnsubscribeRequestSchema, type UnsubscribeRequest } from '../schemas/UnsubscribeRequest.schema'
|
|
37
|
+
import { getAPIInstance } from '../../api-instance'
|
|
38
|
+
import type { API } from '../../index'
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* API operation
|
|
42
|
+
*
|
|
43
|
+
* @method PATCH
|
|
44
|
+
* @path /cfg/newsletter/campaigns/{id}/
|
|
45
|
+
*/
|
|
46
|
+
export async function partialUpdateNewsletterCampaignsPartialUpdate( id: number, data?: PatchedNewsletterCampaignRequest, client?: API
|
|
47
|
+
): Promise<NewsletterCampaign> {
|
|
48
|
+
const api = client || getAPIInstance()
|
|
49
|
+
const response = await api.cfg_newsletter.campaignsPartialUpdate(id, data)
|
|
50
|
+
return NewsletterCampaignSchema.parse(response)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* API operation
|
|
56
|
+
*
|
|
57
|
+
* @method PUT
|
|
58
|
+
* @path /cfg/newsletter/unsubscribe/
|
|
59
|
+
*/
|
|
60
|
+
export async function updateNewsletterUnsubscribeUpdate( data: UnsubscribeRequest, client?: API
|
|
61
|
+
): Promise<Unsubscribe> {
|
|
62
|
+
const api = client || getAPIInstance()
|
|
63
|
+
const response = await api.cfg_newsletter.unsubscribeUpdate(data)
|
|
64
|
+
return UnsubscribeSchema.parse(response)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* API operation
|
|
70
|
+
*
|
|
71
|
+
* @method PATCH
|
|
72
|
+
* @path /cfg/newsletter/unsubscribe/
|
|
73
|
+
*/
|
|
74
|
+
export async function partialUpdateNewsletterUnsubscribePartialUpdate( data?: PatchedUnsubscribeRequest, client?: API
|
|
75
|
+
): Promise<Unsubscribe> {
|
|
76
|
+
const api = client || getAPIInstance()
|
|
77
|
+
const response = await api.cfg_newsletter.unsubscribePartialUpdate(data)
|
|
78
|
+
return UnsubscribeSchema.parse(response)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Bulk Email
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { BulkEmailRequestSchema, type BulkEmailRequest } from '../schemas/BulkEmailRequest.schema'
|
|
33
|
+
import { BulkEmailResponseSchema, type BulkEmailResponse } from '../schemas/BulkEmailResponse.schema'
|
|
34
|
+
import { getAPIInstance } from '../../api-instance'
|
|
35
|
+
import type { API } from '../../index'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Send Bulk Email
|
|
39
|
+
*
|
|
40
|
+
* @method POST
|
|
41
|
+
* @path /cfg/newsletter/bulk/
|
|
42
|
+
*/
|
|
43
|
+
export async function createNewsletterBulkCreate( data: BulkEmailRequest, client?: API
|
|
44
|
+
): Promise<BulkEmailResponse> {
|
|
45
|
+
const api = client || getAPIInstance()
|
|
46
|
+
const response = await api.cfg_bulk_email.newsletterBulkCreate(data)
|
|
47
|
+
return BulkEmailResponseSchema.parse(response)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Campaigns
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { NewsletterCampaignSchema, type NewsletterCampaign } from '../schemas/NewsletterCampaign.schema'
|
|
33
|
+
import { NewsletterCampaignRequestSchema, type NewsletterCampaignRequest } from '../schemas/NewsletterCampaignRequest.schema'
|
|
34
|
+
import { PaginatedNewsletterCampaignListSchema, type PaginatedNewsletterCampaignList } from '../schemas/PaginatedNewsletterCampaignList.schema'
|
|
35
|
+
import { SendCampaignRequestSchema, type SendCampaignRequest } from '../schemas/SendCampaignRequest.schema'
|
|
36
|
+
import { SendCampaignResponseSchema, type SendCampaignResponse } from '../schemas/SendCampaignResponse.schema'
|
|
37
|
+
import { getAPIInstance } from '../../api-instance'
|
|
38
|
+
import type { API } from '../../index'
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* List Newsletter Campaigns
|
|
42
|
+
*
|
|
43
|
+
* @method GET
|
|
44
|
+
* @path /cfg/newsletter/campaigns/
|
|
45
|
+
*/
|
|
46
|
+
export async function getNewsletterCampaignsList( params?: { page?: number; page_size?: number }, client?: API
|
|
47
|
+
): Promise<PaginatedNewsletterCampaignList> {
|
|
48
|
+
const api = client || getAPIInstance()
|
|
49
|
+
const response = await api.cfg_campaigns.newsletterCampaignsList(params?.page, params?.page_size)
|
|
50
|
+
return PaginatedNewsletterCampaignListSchema.parse(response)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Create Newsletter Campaign
|
|
56
|
+
*
|
|
57
|
+
* @method POST
|
|
58
|
+
* @path /cfg/newsletter/campaigns/
|
|
59
|
+
*/
|
|
60
|
+
export async function createNewsletterCampaignsCreate( data: NewsletterCampaignRequest, client?: API
|
|
61
|
+
): Promise<NewsletterCampaign> {
|
|
62
|
+
const api = client || getAPIInstance()
|
|
63
|
+
const response = await api.cfg_campaigns.newsletterCampaignsCreate(data)
|
|
64
|
+
return NewsletterCampaignSchema.parse(response)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get Campaign Details
|
|
70
|
+
*
|
|
71
|
+
* @method GET
|
|
72
|
+
* @path /cfg/newsletter/campaigns/{id}/
|
|
73
|
+
*/
|
|
74
|
+
export async function getNewsletterCampaignsRetrieve( id: number, client?: API
|
|
75
|
+
): Promise<NewsletterCampaign> {
|
|
76
|
+
const api = client || getAPIInstance()
|
|
77
|
+
const response = await api.cfg_campaigns.newsletterCampaignsRetrieve(id)
|
|
78
|
+
return NewsletterCampaignSchema.parse(response)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Update Campaign
|
|
84
|
+
*
|
|
85
|
+
* @method PUT
|
|
86
|
+
* @path /cfg/newsletter/campaigns/{id}/
|
|
87
|
+
*/
|
|
88
|
+
export async function updateNewsletterCampaignsUpdate( id: number, data: NewsletterCampaignRequest, client?: API
|
|
89
|
+
): Promise<NewsletterCampaign> {
|
|
90
|
+
const api = client || getAPIInstance()
|
|
91
|
+
const response = await api.cfg_campaigns.newsletterCampaignsUpdate(id, data)
|
|
92
|
+
return NewsletterCampaignSchema.parse(response)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Delete Campaign
|
|
98
|
+
*
|
|
99
|
+
* @method DELETE
|
|
100
|
+
* @path /cfg/newsletter/campaigns/{id}/
|
|
101
|
+
*/
|
|
102
|
+
export async function deleteNewsletterCampaignsDestroy( id: number, client?: API
|
|
103
|
+
): Promise<void> {
|
|
104
|
+
const api = client || getAPIInstance()
|
|
105
|
+
const response = await api.cfg_campaigns.newsletterCampaignsDestroy(id)
|
|
106
|
+
return response
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Send Newsletter Campaign
|
|
112
|
+
*
|
|
113
|
+
* @method POST
|
|
114
|
+
* @path /cfg/newsletter/campaigns/send/
|
|
115
|
+
*/
|
|
116
|
+
export async function createNewsletterCampaignsSendCreate( data: SendCampaignRequest, client?: API
|
|
117
|
+
): Promise<SendCampaignResponse> {
|
|
118
|
+
const api = client || getAPIInstance()
|
|
119
|
+
const response = await api.cfg_campaigns.newsletterCampaignsSendCreate(data)
|
|
120
|
+
return SendCampaignResponseSchema.parse(response)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Logs
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { PaginatedEmailLogListSchema, type PaginatedEmailLogList } from '../schemas/PaginatedEmailLogList.schema'
|
|
33
|
+
import { getAPIInstance } from '../../api-instance'
|
|
34
|
+
import type { API } from '../../index'
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List Email Logs
|
|
38
|
+
*
|
|
39
|
+
* @method GET
|
|
40
|
+
* @path /cfg/newsletter/logs/
|
|
41
|
+
*/
|
|
42
|
+
export async function getNewsletterLogsList( params?: { page?: number; page_size?: number }, client?: API
|
|
43
|
+
): Promise<PaginatedEmailLogList> {
|
|
44
|
+
const api = client || getAPIInstance()
|
|
45
|
+
const response = await api.cfg_logs.newsletterLogsList(params?.page, params?.page_size)
|
|
46
|
+
return PaginatedEmailLogListSchema.parse(response)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Newsletters
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { NewsletterSchema, type Newsletter } from '../schemas/Newsletter.schema'
|
|
33
|
+
import { PaginatedNewsletterListSchema, type PaginatedNewsletterList } from '../schemas/PaginatedNewsletterList.schema'
|
|
34
|
+
import { getAPIInstance } from '../../api-instance'
|
|
35
|
+
import type { API } from '../../index'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* List Active Newsletters
|
|
39
|
+
*
|
|
40
|
+
* @method GET
|
|
41
|
+
* @path /cfg/newsletter/newsletters/
|
|
42
|
+
*/
|
|
43
|
+
export async function getNewsletterNewslettersList( params?: { page?: number; page_size?: number }, client?: API
|
|
44
|
+
): Promise<PaginatedNewsletterList> {
|
|
45
|
+
const api = client || getAPIInstance()
|
|
46
|
+
const response = await api.cfg_newsletters.newsletterNewslettersList(params?.page, params?.page_size)
|
|
47
|
+
return PaginatedNewsletterListSchema.parse(response)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get Newsletter Details
|
|
53
|
+
*
|
|
54
|
+
* @method GET
|
|
55
|
+
* @path /cfg/newsletter/newsletters/{id}/
|
|
56
|
+
*/
|
|
57
|
+
export async function getNewsletterNewslettersRetrieve( id: number, client?: API
|
|
58
|
+
): Promise<Newsletter> {
|
|
59
|
+
const api = client || getAPIInstance()
|
|
60
|
+
const response = await api.cfg_newsletters.newsletterNewslettersRetrieve(id)
|
|
61
|
+
return NewsletterSchema.parse(response)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Subscriptions
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { PaginatedNewsletterSubscriptionListSchema, type PaginatedNewsletterSubscriptionList } from '../schemas/PaginatedNewsletterSubscriptionList.schema'
|
|
33
|
+
import { SubscribeRequestSchema, type SubscribeRequest } from '../schemas/SubscribeRequest.schema'
|
|
34
|
+
import { SubscribeResponseSchema, type SubscribeResponse } from '../schemas/SubscribeResponse.schema'
|
|
35
|
+
import { SuccessResponseSchema, type SuccessResponse } from '../schemas/SuccessResponse.schema'
|
|
36
|
+
import { UnsubscribeRequestSchema, type UnsubscribeRequest } from '../schemas/UnsubscribeRequest.schema'
|
|
37
|
+
import { getAPIInstance } from '../../api-instance'
|
|
38
|
+
import type { API } from '../../index'
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Subscribe to Newsletter
|
|
42
|
+
*
|
|
43
|
+
* @method POST
|
|
44
|
+
* @path /cfg/newsletter/subscribe/
|
|
45
|
+
*/
|
|
46
|
+
export async function createNewsletterSubscribeCreate( data: SubscribeRequest, client?: API
|
|
47
|
+
): Promise<SubscribeResponse> {
|
|
48
|
+
const api = client || getAPIInstance()
|
|
49
|
+
const response = await api.cfg_subscriptions.newsletterSubscribeCreate(data)
|
|
50
|
+
return SubscribeResponseSchema.parse(response)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* List User Subscriptions
|
|
56
|
+
*
|
|
57
|
+
* @method GET
|
|
58
|
+
* @path /cfg/newsletter/subscriptions/
|
|
59
|
+
*/
|
|
60
|
+
export async function getNewsletterSubscriptionsList( params?: { page?: number; page_size?: number }, client?: API
|
|
61
|
+
): Promise<PaginatedNewsletterSubscriptionList> {
|
|
62
|
+
const api = client || getAPIInstance()
|
|
63
|
+
const response = await api.cfg_subscriptions.newsletterSubscriptionsList(params?.page, params?.page_size)
|
|
64
|
+
return PaginatedNewsletterSubscriptionListSchema.parse(response)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Unsubscribe from Newsletter
|
|
70
|
+
*
|
|
71
|
+
* @method POST
|
|
72
|
+
* @path /cfg/newsletter/unsubscribe/
|
|
73
|
+
*/
|
|
74
|
+
export async function createNewsletterUnsubscribeCreate( data: UnsubscribeRequest, client?: API
|
|
75
|
+
): Promise<SuccessResponse> {
|
|
76
|
+
const api = client || getAPIInstance()
|
|
77
|
+
const response = await api.cfg_subscriptions.newsletterUnsubscribeCreate(data)
|
|
78
|
+
return SuccessResponseSchema.parse(response)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Testing
|
|
3
|
+
*
|
|
4
|
+
* Universal functions that work in any environment:
|
|
5
|
+
* - Next.js (App Router / Pages Router / Server Components)
|
|
6
|
+
* - React Native
|
|
7
|
+
* - Node.js backend
|
|
8
|
+
*
|
|
9
|
+
* These fetchers use Zod schemas for runtime validation.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Configure API once (in your app entry point)
|
|
14
|
+
* import { configureAPI } from '../../api-instance'
|
|
15
|
+
* configureAPI({ baseUrl: 'https://api.example.com' })
|
|
16
|
+
*
|
|
17
|
+
* // Then use fetchers anywhere
|
|
18
|
+
* const users = await getUsers({ page: 1 })
|
|
19
|
+
*
|
|
20
|
+
* // With SWR
|
|
21
|
+
* const { data } = useSWR(['users', params], () => getUsers(params))
|
|
22
|
+
*
|
|
23
|
+
* // With React Query
|
|
24
|
+
* const { data } = useQuery(['users', params], () => getUsers(params))
|
|
25
|
+
*
|
|
26
|
+
* // In Server Component or SSR (pass custom client)
|
|
27
|
+
* import { API } from '../../index'
|
|
28
|
+
* const api = new API('https://api.example.com')
|
|
29
|
+
* const users = await getUsers({ page: 1 }, api)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
import { BulkEmailResponseSchema, type BulkEmailResponse } from '../schemas/BulkEmailResponse.schema'
|
|
33
|
+
import { TestEmailRequestSchema, type TestEmailRequest } from '../schemas/TestEmailRequest.schema'
|
|
34
|
+
import { getAPIInstance } from '../../api-instance'
|
|
35
|
+
import type { API } from '../../index'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Test Email Sending
|
|
39
|
+
*
|
|
40
|
+
* @method POST
|
|
41
|
+
* @path /cfg/newsletter/test/
|
|
42
|
+
*/
|
|
43
|
+
export async function createNewsletterTestCreate( data: TestEmailRequest, client?: API
|
|
44
|
+
): Promise<BulkEmailResponse> {
|
|
45
|
+
const api = client || getAPIInstance()
|
|
46
|
+
const response = await api.cfg_testing.newsletterTestCreate(data)
|
|
47
|
+
return BulkEmailResponseSchema.parse(response)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|