@djangocfg/ext-newsletter 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +140 -0
  2. package/dist/chunk-LQLPNWHR.js +2075 -0
  3. package/dist/hooks.cjs +2539 -0
  4. package/dist/hooks.d.cts +267 -0
  5. package/dist/hooks.d.ts +267 -0
  6. package/dist/hooks.js +370 -0
  7. package/dist/index.cjs +2153 -0
  8. package/dist/index.d.cts +2084 -0
  9. package/dist/index.d.ts +2084 -0
  10. package/dist/index.js +1 -0
  11. package/package.json +80 -0
  12. package/src/api/generated/ext_newsletter/_utils/fetchers/ext_newsletter__newsletter.ts +210 -0
  13. package/src/api/generated/ext_newsletter/_utils/fetchers/ext_newsletter__newsletter__bulk_email.ts +93 -0
  14. package/src/api/generated/ext_newsletter/_utils/fetchers/ext_newsletter__newsletter__campaigns.ts +338 -0
  15. package/src/api/generated/ext_newsletter/_utils/fetchers/ext_newsletter__newsletter__logs.ts +92 -0
  16. package/src/api/generated/ext_newsletter/_utils/fetchers/ext_newsletter__newsletter__newsletters.ts +150 -0
  17. package/src/api/generated/ext_newsletter/_utils/fetchers/ext_newsletter__newsletter__subscriptions.ts +210 -0
  18. package/src/api/generated/ext_newsletter/_utils/fetchers/ext_newsletter__newsletter__testing.ts +93 -0
  19. package/src/api/generated/ext_newsletter/_utils/fetchers/index.ts +34 -0
  20. package/src/api/generated/ext_newsletter/_utils/hooks/ext_newsletter__newsletter.ts +81 -0
  21. package/src/api/generated/ext_newsletter/_utils/hooks/ext_newsletter__newsletter__bulk_email.ts +42 -0
  22. package/src/api/generated/ext_newsletter/_utils/hooks/ext_newsletter__newsletter__campaigns.ts +130 -0
  23. package/src/api/generated/ext_newsletter/_utils/hooks/ext_newsletter__newsletter__logs.ts +37 -0
  24. package/src/api/generated/ext_newsletter/_utils/hooks/ext_newsletter__newsletter__newsletters.ts +52 -0
  25. package/src/api/generated/ext_newsletter/_utils/hooks/ext_newsletter__newsletter__subscriptions.ts +78 -0
  26. package/src/api/generated/ext_newsletter/_utils/hooks/ext_newsletter__newsletter__testing.ts +42 -0
  27. package/src/api/generated/ext_newsletter/_utils/hooks/index.ts +34 -0
  28. package/src/api/generated/ext_newsletter/_utils/schemas/BulkEmailRequest.schema.ts +26 -0
  29. package/src/api/generated/ext_newsletter/_utils/schemas/BulkEmailResponse.schema.ts +23 -0
  30. package/src/api/generated/ext_newsletter/_utils/schemas/EmailLog.schema.ts +31 -0
  31. package/src/api/generated/ext_newsletter/_utils/schemas/ErrorResponse.schema.ts +20 -0
  32. package/src/api/generated/ext_newsletter/_utils/schemas/Newsletter.schema.ts +26 -0
  33. package/src/api/generated/ext_newsletter/_utils/schemas/NewsletterCampaign.schema.ts +33 -0
  34. package/src/api/generated/ext_newsletter/_utils/schemas/NewsletterCampaignRequest.schema.ts +26 -0
  35. package/src/api/generated/ext_newsletter/_utils/schemas/NewsletterSubscription.schema.ts +27 -0
  36. package/src/api/generated/ext_newsletter/_utils/schemas/PaginatedEmailLogList.schema.ts +24 -0
  37. package/src/api/generated/ext_newsletter/_utils/schemas/PaginatedNewsletterCampaignList.schema.ts +24 -0
  38. package/src/api/generated/ext_newsletter/_utils/schemas/PaginatedNewsletterList.schema.ts +24 -0
  39. package/src/api/generated/ext_newsletter/_utils/schemas/PaginatedNewsletterSubscriptionList.schema.ts +24 -0
  40. package/src/api/generated/ext_newsletter/_utils/schemas/PatchedNewsletterCampaignRequest.schema.ts +26 -0
  41. package/src/api/generated/ext_newsletter/_utils/schemas/PatchedUnsubscribeRequest.schema.ts +19 -0
  42. package/src/api/generated/ext_newsletter/_utils/schemas/SendCampaignRequest.schema.ts +19 -0
  43. package/src/api/generated/ext_newsletter/_utils/schemas/SendCampaignResponse.schema.ts +22 -0
  44. package/src/api/generated/ext_newsletter/_utils/schemas/SubscribeRequest.schema.ts +20 -0
  45. package/src/api/generated/ext_newsletter/_utils/schemas/SubscribeResponse.schema.ts +21 -0
  46. package/src/api/generated/ext_newsletter/_utils/schemas/SuccessResponse.schema.ts +20 -0
  47. package/src/api/generated/ext_newsletter/_utils/schemas/TestEmailRequest.schema.ts +21 -0
  48. package/src/api/generated/ext_newsletter/_utils/schemas/Unsubscribe.schema.ts +19 -0
  49. package/src/api/generated/ext_newsletter/_utils/schemas/UnsubscribeRequest.schema.ts +19 -0
  50. package/src/api/generated/ext_newsletter/_utils/schemas/index.ts +40 -0
  51. package/src/api/generated/ext_newsletter/api-instance.ts +131 -0
  52. package/src/api/generated/ext_newsletter/client.ts +319 -0
  53. package/src/api/generated/ext_newsletter/enums.ts +24 -0
  54. package/src/api/generated/ext_newsletter/errors.ts +116 -0
  55. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter/client.ts +38 -0
  56. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter/index.ts +2 -0
  57. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter/models.ts +71 -0
  58. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__bulk_email/client.ts +24 -0
  59. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__bulk_email/index.ts +2 -0
  60. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__bulk_email/models.ts +29 -0
  61. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__campaigns/client.ts +85 -0
  62. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__campaigns/index.ts +2 -0
  63. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__campaigns/models.ts +100 -0
  64. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__logs/client.ts +35 -0
  65. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__logs/index.ts +2 -0
  66. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__logs/models.ts +51 -0
  67. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__newsletters/client.ts +45 -0
  68. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__newsletters/index.ts +2 -0
  69. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__newsletters/models.ts +42 -0
  70. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__subscriptions/client.ts +55 -0
  71. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__subscriptions/index.ts +2 -0
  72. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__subscriptions/models.ts +92 -0
  73. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__testing/client.ts +24 -0
  74. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__testing/index.ts +2 -0
  75. package/src/api/generated/ext_newsletter/ext_newsletter__newsletter__testing/models.ts +24 -0
  76. package/src/api/generated/ext_newsletter/http.ts +103 -0
  77. package/src/api/generated/ext_newsletter/index.ts +315 -0
  78. package/src/api/generated/ext_newsletter/logger.ts +259 -0
  79. package/src/api/generated/ext_newsletter/retry.ts +175 -0
  80. package/src/api/generated/ext_newsletter/schema.json +1739 -0
  81. package/src/api/generated/ext_newsletter/storage.ts +161 -0
  82. package/src/api/generated/ext_newsletter/validation-events.ts +133 -0
  83. package/src/api/index.ts +9 -0
  84. package/src/components/Hero/index.tsx +160 -0
  85. package/src/components/Hero/types.ts +37 -0
  86. package/src/config.ts +20 -0
  87. package/src/contexts/newsletter/NewsletterContext.tsx +264 -0
  88. package/src/contexts/newsletter/types.ts +32 -0
  89. package/src/hooks/index.ts +21 -0
  90. package/src/index.ts +14 -0
  91. package/src/utils/logger.ts +9 -0
@@ -0,0 +1,1739 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "Django CFG API",
5
+ "version": "1.0.0",
6
+ "description": "Complete API documentation for Django CFG Demo Project",
7
+ "x-django-metadata": {
8
+ "group": "ext_newsletter",
9
+ "apps": [
10
+ "ext_newsletter"
11
+ ],
12
+ "generator": "django-client",
13
+ "generator_version": "1.0.0"
14
+ }
15
+ },
16
+ "paths": {
17
+ "/cfg/newsletter/bulk/": {
18
+ "post": {
19
+ "operationId": "cfg_newsletter_bulk_create",
20
+ "description": "Send bulk emails to multiple recipients using base email template.",
21
+ "summary": "Send Bulk Email",
22
+ "tags": [
23
+ "Bulk Email"
24
+ ],
25
+ "requestBody": {
26
+ "content": {
27
+ "application/json": {
28
+ "schema": {
29
+ "$ref": "#/components/schemas/BulkEmailRequest"
30
+ }
31
+ },
32
+ "application/x-www-form-urlencoded": {
33
+ "schema": {
34
+ "$ref": "#/components/schemas/BulkEmailRequest"
35
+ }
36
+ },
37
+ "multipart/form-data": {
38
+ "schema": {
39
+ "$ref": "#/components/schemas/BulkEmailRequest"
40
+ }
41
+ }
42
+ },
43
+ "required": true
44
+ },
45
+ "security": [
46
+ {
47
+ "jwtAuthWithLastLogin": []
48
+ }
49
+ ],
50
+ "responses": {
51
+ "200": {
52
+ "content": {
53
+ "application/json": {
54
+ "schema": {
55
+ "$ref": "#/components/schemas/BulkEmailResponse"
56
+ }
57
+ }
58
+ },
59
+ "description": ""
60
+ },
61
+ "400": {
62
+ "content": {
63
+ "application/json": {
64
+ "schema": {
65
+ "$ref": "#/components/schemas/BulkEmailResponse"
66
+ }
67
+ }
68
+ },
69
+ "description": ""
70
+ }
71
+ },
72
+ "x-async-capable": false
73
+ }
74
+ },
75
+ "/cfg/newsletter/campaigns/": {
76
+ "get": {
77
+ "operationId": "cfg_newsletter_campaigns_list",
78
+ "description": "Get a list of all newsletter campaigns.",
79
+ "summary": "List Newsletter Campaigns",
80
+ "parameters": [
81
+ {
82
+ "name": "page",
83
+ "required": false,
84
+ "in": "query",
85
+ "description": "A page number within the paginated result set.",
86
+ "schema": {
87
+ "type": "integer"
88
+ }
89
+ },
90
+ {
91
+ "name": "page_size",
92
+ "required": false,
93
+ "in": "query",
94
+ "description": "Number of results to return per page.",
95
+ "schema": {
96
+ "type": "integer"
97
+ }
98
+ }
99
+ ],
100
+ "tags": [
101
+ "Campaigns"
102
+ ],
103
+ "security": [
104
+ {
105
+ "jwtAuthWithLastLogin": []
106
+ }
107
+ ],
108
+ "responses": {
109
+ "200": {
110
+ "content": {
111
+ "application/json": {
112
+ "schema": {
113
+ "$ref": "#/components/schemas/PaginatedNewsletterCampaignList"
114
+ }
115
+ }
116
+ },
117
+ "description": ""
118
+ }
119
+ },
120
+ "x-async-capable": false
121
+ },
122
+ "post": {
123
+ "operationId": "cfg_newsletter_campaigns_create",
124
+ "description": "Create a new newsletter campaign.",
125
+ "summary": "Create Newsletter Campaign",
126
+ "tags": [
127
+ "Campaigns"
128
+ ],
129
+ "requestBody": {
130
+ "content": {
131
+ "application/json": {
132
+ "schema": {
133
+ "$ref": "#/components/schemas/NewsletterCampaignRequest"
134
+ }
135
+ },
136
+ "application/x-www-form-urlencoded": {
137
+ "schema": {
138
+ "$ref": "#/components/schemas/NewsletterCampaignRequest"
139
+ }
140
+ },
141
+ "multipart/form-data": {
142
+ "schema": {
143
+ "$ref": "#/components/schemas/NewsletterCampaignRequest"
144
+ }
145
+ }
146
+ },
147
+ "required": true
148
+ },
149
+ "security": [
150
+ {
151
+ "jwtAuthWithLastLogin": []
152
+ }
153
+ ],
154
+ "responses": {
155
+ "201": {
156
+ "content": {
157
+ "application/json": {
158
+ "schema": {
159
+ "$ref": "#/components/schemas/NewsletterCampaign"
160
+ }
161
+ }
162
+ },
163
+ "description": ""
164
+ }
165
+ },
166
+ "x-async-capable": false
167
+ }
168
+ },
169
+ "/cfg/newsletter/campaigns/{id}/": {
170
+ "get": {
171
+ "operationId": "cfg_newsletter_campaigns_retrieve",
172
+ "description": "Retrieve details of a specific newsletter campaign.",
173
+ "summary": "Get Campaign Details",
174
+ "parameters": [
175
+ {
176
+ "in": "path",
177
+ "name": "id",
178
+ "schema": {
179
+ "type": "integer"
180
+ },
181
+ "required": true
182
+ }
183
+ ],
184
+ "tags": [
185
+ "Campaigns"
186
+ ],
187
+ "security": [
188
+ {
189
+ "jwtAuthWithLastLogin": []
190
+ }
191
+ ],
192
+ "responses": {
193
+ "200": {
194
+ "content": {
195
+ "application/json": {
196
+ "schema": {
197
+ "$ref": "#/components/schemas/NewsletterCampaign"
198
+ }
199
+ }
200
+ },
201
+ "description": ""
202
+ }
203
+ },
204
+ "x-async-capable": false
205
+ },
206
+ "put": {
207
+ "operationId": "cfg_newsletter_campaigns_update",
208
+ "description": "Update a newsletter campaign.",
209
+ "summary": "Update Campaign",
210
+ "parameters": [
211
+ {
212
+ "in": "path",
213
+ "name": "id",
214
+ "schema": {
215
+ "type": "integer"
216
+ },
217
+ "required": true
218
+ }
219
+ ],
220
+ "tags": [
221
+ "Campaigns"
222
+ ],
223
+ "requestBody": {
224
+ "content": {
225
+ "application/json": {
226
+ "schema": {
227
+ "$ref": "#/components/schemas/NewsletterCampaignRequest"
228
+ }
229
+ },
230
+ "application/x-www-form-urlencoded": {
231
+ "schema": {
232
+ "$ref": "#/components/schemas/NewsletterCampaignRequest"
233
+ }
234
+ },
235
+ "multipart/form-data": {
236
+ "schema": {
237
+ "$ref": "#/components/schemas/NewsletterCampaignRequest"
238
+ }
239
+ }
240
+ },
241
+ "required": true
242
+ },
243
+ "security": [
244
+ {
245
+ "jwtAuthWithLastLogin": []
246
+ }
247
+ ],
248
+ "responses": {
249
+ "200": {
250
+ "content": {
251
+ "application/json": {
252
+ "schema": {
253
+ "$ref": "#/components/schemas/NewsletterCampaign"
254
+ }
255
+ }
256
+ },
257
+ "description": ""
258
+ }
259
+ },
260
+ "x-async-capable": false
261
+ },
262
+ "patch": {
263
+ "operationId": "cfg_newsletter_campaigns_partial_update",
264
+ "description": "Retrieve, update, or delete a newsletter campaign.",
265
+ "parameters": [
266
+ {
267
+ "in": "path",
268
+ "name": "id",
269
+ "schema": {
270
+ "type": "integer"
271
+ },
272
+ "required": true
273
+ }
274
+ ],
275
+ "tags": [
276
+ "newsletter"
277
+ ],
278
+ "requestBody": {
279
+ "content": {
280
+ "application/json": {
281
+ "schema": {
282
+ "$ref": "#/components/schemas/PatchedNewsletterCampaignRequest"
283
+ }
284
+ },
285
+ "application/x-www-form-urlencoded": {
286
+ "schema": {
287
+ "$ref": "#/components/schemas/PatchedNewsletterCampaignRequest"
288
+ }
289
+ },
290
+ "multipart/form-data": {
291
+ "schema": {
292
+ "$ref": "#/components/schemas/PatchedNewsletterCampaignRequest"
293
+ }
294
+ }
295
+ }
296
+ },
297
+ "security": [
298
+ {
299
+ "jwtAuthWithLastLogin": []
300
+ }
301
+ ],
302
+ "responses": {
303
+ "200": {
304
+ "content": {
305
+ "application/json": {
306
+ "schema": {
307
+ "$ref": "#/components/schemas/NewsletterCampaign"
308
+ }
309
+ }
310
+ },
311
+ "description": ""
312
+ }
313
+ },
314
+ "x-async-capable": false
315
+ },
316
+ "delete": {
317
+ "operationId": "cfg_newsletter_campaigns_destroy",
318
+ "description": "Delete a newsletter campaign.",
319
+ "summary": "Delete Campaign",
320
+ "parameters": [
321
+ {
322
+ "in": "path",
323
+ "name": "id",
324
+ "schema": {
325
+ "type": "integer"
326
+ },
327
+ "required": true
328
+ }
329
+ ],
330
+ "tags": [
331
+ "Campaigns"
332
+ ],
333
+ "security": [
334
+ {
335
+ "jwtAuthWithLastLogin": []
336
+ }
337
+ ],
338
+ "responses": {
339
+ "204": {
340
+ "description": "No response body"
341
+ }
342
+ },
343
+ "x-async-capable": false
344
+ }
345
+ },
346
+ "/cfg/newsletter/campaigns/send/": {
347
+ "post": {
348
+ "operationId": "cfg_newsletter_campaigns_send_create",
349
+ "description": "Send a newsletter campaign to all subscribers.",
350
+ "summary": "Send Newsletter Campaign",
351
+ "tags": [
352
+ "Campaigns"
353
+ ],
354
+ "requestBody": {
355
+ "content": {
356
+ "application/json": {
357
+ "schema": {
358
+ "$ref": "#/components/schemas/SendCampaignRequest"
359
+ }
360
+ },
361
+ "application/x-www-form-urlencoded": {
362
+ "schema": {
363
+ "$ref": "#/components/schemas/SendCampaignRequest"
364
+ }
365
+ },
366
+ "multipart/form-data": {
367
+ "schema": {
368
+ "$ref": "#/components/schemas/SendCampaignRequest"
369
+ }
370
+ }
371
+ },
372
+ "required": true
373
+ },
374
+ "security": [
375
+ {
376
+ "jwtAuthWithLastLogin": []
377
+ }
378
+ ],
379
+ "responses": {
380
+ "200": {
381
+ "content": {
382
+ "application/json": {
383
+ "schema": {
384
+ "$ref": "#/components/schemas/SendCampaignResponse"
385
+ }
386
+ }
387
+ },
388
+ "description": ""
389
+ },
390
+ "400": {
391
+ "content": {
392
+ "application/json": {
393
+ "schema": {
394
+ "$ref": "#/components/schemas/ErrorResponse"
395
+ }
396
+ }
397
+ },
398
+ "description": ""
399
+ },
400
+ "404": {
401
+ "content": {
402
+ "application/json": {
403
+ "schema": {
404
+ "$ref": "#/components/schemas/ErrorResponse"
405
+ }
406
+ }
407
+ },
408
+ "description": ""
409
+ }
410
+ },
411
+ "x-async-capable": false
412
+ }
413
+ },
414
+ "/cfg/newsletter/logs/": {
415
+ "get": {
416
+ "operationId": "cfg_newsletter_logs_list",
417
+ "description": "Get a list of email sending logs.",
418
+ "summary": "List Email Logs",
419
+ "parameters": [
420
+ {
421
+ "name": "page",
422
+ "required": false,
423
+ "in": "query",
424
+ "description": "A page number within the paginated result set.",
425
+ "schema": {
426
+ "type": "integer"
427
+ }
428
+ },
429
+ {
430
+ "name": "page_size",
431
+ "required": false,
432
+ "in": "query",
433
+ "description": "Number of results to return per page.",
434
+ "schema": {
435
+ "type": "integer"
436
+ }
437
+ }
438
+ ],
439
+ "tags": [
440
+ "Logs"
441
+ ],
442
+ "security": [
443
+ {
444
+ "jwtAuthWithLastLogin": []
445
+ }
446
+ ],
447
+ "responses": {
448
+ "200": {
449
+ "content": {
450
+ "application/json": {
451
+ "schema": {
452
+ "$ref": "#/components/schemas/PaginatedEmailLogList"
453
+ }
454
+ }
455
+ },
456
+ "description": ""
457
+ }
458
+ },
459
+ "x-async-capable": false
460
+ }
461
+ },
462
+ "/cfg/newsletter/newsletters/": {
463
+ "get": {
464
+ "operationId": "cfg_newsletter_newsletters_list",
465
+ "description": "Get a list of all active newsletters available for subscription.",
466
+ "summary": "List Active Newsletters",
467
+ "parameters": [
468
+ {
469
+ "name": "page",
470
+ "required": false,
471
+ "in": "query",
472
+ "description": "A page number within the paginated result set.",
473
+ "schema": {
474
+ "type": "integer"
475
+ }
476
+ },
477
+ {
478
+ "name": "page_size",
479
+ "required": false,
480
+ "in": "query",
481
+ "description": "Number of results to return per page.",
482
+ "schema": {
483
+ "type": "integer"
484
+ }
485
+ }
486
+ ],
487
+ "tags": [
488
+ "Newsletters"
489
+ ],
490
+ "security": [
491
+ {
492
+ "jwtAuthWithLastLogin": []
493
+ },
494
+ {}
495
+ ],
496
+ "responses": {
497
+ "200": {
498
+ "content": {
499
+ "application/json": {
500
+ "schema": {
501
+ "$ref": "#/components/schemas/PaginatedNewsletterList"
502
+ }
503
+ }
504
+ },
505
+ "description": ""
506
+ }
507
+ },
508
+ "x-async-capable": false
509
+ }
510
+ },
511
+ "/cfg/newsletter/newsletters/{id}/": {
512
+ "get": {
513
+ "operationId": "cfg_newsletter_newsletters_retrieve",
514
+ "description": "Retrieve details of a specific newsletter.",
515
+ "summary": "Get Newsletter Details",
516
+ "parameters": [
517
+ {
518
+ "in": "path",
519
+ "name": "id",
520
+ "schema": {
521
+ "type": "integer"
522
+ },
523
+ "required": true
524
+ }
525
+ ],
526
+ "tags": [
527
+ "Newsletters"
528
+ ],
529
+ "security": [
530
+ {
531
+ "jwtAuthWithLastLogin": []
532
+ },
533
+ {}
534
+ ],
535
+ "responses": {
536
+ "200": {
537
+ "content": {
538
+ "application/json": {
539
+ "schema": {
540
+ "$ref": "#/components/schemas/Newsletter"
541
+ }
542
+ }
543
+ },
544
+ "description": ""
545
+ }
546
+ },
547
+ "x-async-capable": false
548
+ }
549
+ },
550
+ "/cfg/newsletter/subscribe/": {
551
+ "post": {
552
+ "operationId": "cfg_newsletter_subscribe_create",
553
+ "description": "Subscribe an email address to a newsletter.",
554
+ "summary": "Subscribe to Newsletter",
555
+ "tags": [
556
+ "Subscriptions"
557
+ ],
558
+ "requestBody": {
559
+ "content": {
560
+ "application/json": {
561
+ "schema": {
562
+ "$ref": "#/components/schemas/SubscribeRequest"
563
+ }
564
+ },
565
+ "application/x-www-form-urlencoded": {
566
+ "schema": {
567
+ "$ref": "#/components/schemas/SubscribeRequest"
568
+ }
569
+ },
570
+ "multipart/form-data": {
571
+ "schema": {
572
+ "$ref": "#/components/schemas/SubscribeRequest"
573
+ }
574
+ }
575
+ },
576
+ "required": true
577
+ },
578
+ "security": [
579
+ {
580
+ "jwtAuthWithLastLogin": []
581
+ },
582
+ {}
583
+ ],
584
+ "responses": {
585
+ "201": {
586
+ "content": {
587
+ "application/json": {
588
+ "schema": {
589
+ "$ref": "#/components/schemas/SubscribeResponse"
590
+ }
591
+ }
592
+ },
593
+ "description": ""
594
+ },
595
+ "400": {
596
+ "content": {
597
+ "application/json": {
598
+ "schema": {
599
+ "$ref": "#/components/schemas/ErrorResponse"
600
+ }
601
+ }
602
+ },
603
+ "description": ""
604
+ },
605
+ "404": {
606
+ "content": {
607
+ "application/json": {
608
+ "schema": {
609
+ "$ref": "#/components/schemas/ErrorResponse"
610
+ }
611
+ }
612
+ },
613
+ "description": ""
614
+ }
615
+ },
616
+ "x-async-capable": false
617
+ }
618
+ },
619
+ "/cfg/newsletter/subscriptions/": {
620
+ "get": {
621
+ "operationId": "cfg_newsletter_subscriptions_list",
622
+ "description": "Get a list of current user's active newsletter subscriptions.",
623
+ "summary": "List User Subscriptions",
624
+ "parameters": [
625
+ {
626
+ "name": "page",
627
+ "required": false,
628
+ "in": "query",
629
+ "description": "A page number within the paginated result set.",
630
+ "schema": {
631
+ "type": "integer"
632
+ }
633
+ },
634
+ {
635
+ "name": "page_size",
636
+ "required": false,
637
+ "in": "query",
638
+ "description": "Number of results to return per page.",
639
+ "schema": {
640
+ "type": "integer"
641
+ }
642
+ }
643
+ ],
644
+ "tags": [
645
+ "Subscriptions"
646
+ ],
647
+ "security": [
648
+ {
649
+ "jwtAuthWithLastLogin": []
650
+ }
651
+ ],
652
+ "responses": {
653
+ "200": {
654
+ "content": {
655
+ "application/json": {
656
+ "schema": {
657
+ "$ref": "#/components/schemas/PaginatedNewsletterSubscriptionList"
658
+ }
659
+ }
660
+ },
661
+ "description": ""
662
+ }
663
+ },
664
+ "x-async-capable": false
665
+ }
666
+ },
667
+ "/cfg/newsletter/test/": {
668
+ "post": {
669
+ "operationId": "cfg_newsletter_test_create",
670
+ "description": "Send a test email to verify mailer configuration.",
671
+ "summary": "Test Email Sending",
672
+ "tags": [
673
+ "Testing"
674
+ ],
675
+ "requestBody": {
676
+ "content": {
677
+ "application/json": {
678
+ "schema": {
679
+ "$ref": "#/components/schemas/TestEmailRequest"
680
+ }
681
+ },
682
+ "application/x-www-form-urlencoded": {
683
+ "schema": {
684
+ "$ref": "#/components/schemas/TestEmailRequest"
685
+ }
686
+ },
687
+ "multipart/form-data": {
688
+ "schema": {
689
+ "$ref": "#/components/schemas/TestEmailRequest"
690
+ }
691
+ }
692
+ },
693
+ "required": true
694
+ },
695
+ "security": [
696
+ {
697
+ "jwtAuthWithLastLogin": []
698
+ },
699
+ {}
700
+ ],
701
+ "responses": {
702
+ "200": {
703
+ "content": {
704
+ "application/json": {
705
+ "schema": {
706
+ "$ref": "#/components/schemas/BulkEmailResponse"
707
+ }
708
+ }
709
+ },
710
+ "description": ""
711
+ },
712
+ "400": {
713
+ "content": {
714
+ "application/json": {
715
+ "schema": {
716
+ "$ref": "#/components/schemas/BulkEmailResponse"
717
+ }
718
+ }
719
+ },
720
+ "description": ""
721
+ }
722
+ },
723
+ "x-async-capable": false
724
+ }
725
+ },
726
+ "/cfg/newsletter/unsubscribe/": {
727
+ "post": {
728
+ "operationId": "cfg_newsletter_unsubscribe_create",
729
+ "description": "Unsubscribe from a newsletter using subscription ID.",
730
+ "summary": "Unsubscribe from Newsletter",
731
+ "tags": [
732
+ "Subscriptions"
733
+ ],
734
+ "requestBody": {
735
+ "content": {
736
+ "application/json": {
737
+ "schema": {
738
+ "$ref": "#/components/schemas/UnsubscribeRequest"
739
+ }
740
+ },
741
+ "application/x-www-form-urlencoded": {
742
+ "schema": {
743
+ "$ref": "#/components/schemas/UnsubscribeRequest"
744
+ }
745
+ },
746
+ "multipart/form-data": {
747
+ "schema": {
748
+ "$ref": "#/components/schemas/UnsubscribeRequest"
749
+ }
750
+ }
751
+ },
752
+ "required": true
753
+ },
754
+ "security": [
755
+ {
756
+ "jwtAuthWithLastLogin": []
757
+ },
758
+ {}
759
+ ],
760
+ "responses": {
761
+ "200": {
762
+ "content": {
763
+ "application/json": {
764
+ "schema": {
765
+ "$ref": "#/components/schemas/SuccessResponse"
766
+ }
767
+ }
768
+ },
769
+ "description": ""
770
+ },
771
+ "404": {
772
+ "content": {
773
+ "application/json": {
774
+ "schema": {
775
+ "$ref": "#/components/schemas/ErrorResponse"
776
+ }
777
+ }
778
+ },
779
+ "description": ""
780
+ }
781
+ },
782
+ "x-async-capable": false
783
+ },
784
+ "put": {
785
+ "operationId": "cfg_newsletter_unsubscribe_update",
786
+ "description": "Handle newsletter unsubscriptions.",
787
+ "tags": [
788
+ "newsletter"
789
+ ],
790
+ "requestBody": {
791
+ "content": {
792
+ "application/json": {
793
+ "schema": {
794
+ "$ref": "#/components/schemas/UnsubscribeRequest"
795
+ }
796
+ },
797
+ "application/x-www-form-urlencoded": {
798
+ "schema": {
799
+ "$ref": "#/components/schemas/UnsubscribeRequest"
800
+ }
801
+ },
802
+ "multipart/form-data": {
803
+ "schema": {
804
+ "$ref": "#/components/schemas/UnsubscribeRequest"
805
+ }
806
+ }
807
+ },
808
+ "required": true
809
+ },
810
+ "security": [
811
+ {
812
+ "jwtAuthWithLastLogin": []
813
+ },
814
+ {}
815
+ ],
816
+ "responses": {
817
+ "200": {
818
+ "content": {
819
+ "application/json": {
820
+ "schema": {
821
+ "$ref": "#/components/schemas/Unsubscribe"
822
+ }
823
+ }
824
+ },
825
+ "description": ""
826
+ }
827
+ },
828
+ "x-async-capable": false
829
+ },
830
+ "patch": {
831
+ "operationId": "cfg_newsletter_unsubscribe_partial_update",
832
+ "description": "Handle newsletter unsubscriptions.",
833
+ "tags": [
834
+ "newsletter"
835
+ ],
836
+ "requestBody": {
837
+ "content": {
838
+ "application/json": {
839
+ "schema": {
840
+ "$ref": "#/components/schemas/PatchedUnsubscribeRequest"
841
+ }
842
+ },
843
+ "application/x-www-form-urlencoded": {
844
+ "schema": {
845
+ "$ref": "#/components/schemas/PatchedUnsubscribeRequest"
846
+ }
847
+ },
848
+ "multipart/form-data": {
849
+ "schema": {
850
+ "$ref": "#/components/schemas/PatchedUnsubscribeRequest"
851
+ }
852
+ }
853
+ }
854
+ },
855
+ "security": [
856
+ {
857
+ "jwtAuthWithLastLogin": []
858
+ },
859
+ {}
860
+ ],
861
+ "responses": {
862
+ "200": {
863
+ "content": {
864
+ "application/json": {
865
+ "schema": {
866
+ "$ref": "#/components/schemas/Unsubscribe"
867
+ }
868
+ }
869
+ },
870
+ "description": ""
871
+ }
872
+ },
873
+ "x-async-capable": false
874
+ }
875
+ }
876
+ },
877
+ "components": {
878
+ "schemas": {
879
+ "BulkEmailRequest": {
880
+ "type": "object",
881
+ "description": "Simple serializer for bulk email.",
882
+ "properties": {
883
+ "recipients": {
884
+ "type": "array",
885
+ "items": {
886
+ "type": "string",
887
+ "format": "email",
888
+ "minLength": 1
889
+ },
890
+ "maxItems": 100,
891
+ "minItems": 1
892
+ },
893
+ "subject": {
894
+ "type": "string",
895
+ "minLength": 1,
896
+ "maxLength": 255
897
+ },
898
+ "email_title": {
899
+ "type": "string",
900
+ "minLength": 1,
901
+ "maxLength": 255
902
+ },
903
+ "main_text": {
904
+ "type": "string",
905
+ "minLength": 1
906
+ },
907
+ "main_html_content": {
908
+ "type": "string"
909
+ },
910
+ "button_text": {
911
+ "type": "string",
912
+ "maxLength": 100
913
+ },
914
+ "button_url": {
915
+ "type": "string",
916
+ "format": "uri"
917
+ },
918
+ "secondary_text": {
919
+ "type": "string"
920
+ }
921
+ },
922
+ "required": [
923
+ "email_title",
924
+ "main_text",
925
+ "recipients",
926
+ "subject"
927
+ ]
928
+ },
929
+ "BulkEmailResponse": {
930
+ "type": "object",
931
+ "description": "Response for bulk email sending.",
932
+ "properties": {
933
+ "success": {
934
+ "type": "boolean"
935
+ },
936
+ "sent_count": {
937
+ "type": "integer"
938
+ },
939
+ "failed_count": {
940
+ "type": "integer"
941
+ },
942
+ "total_recipients": {
943
+ "type": "integer"
944
+ },
945
+ "error": {
946
+ "type": "string"
947
+ }
948
+ },
949
+ "required": [
950
+ "failed_count",
951
+ "sent_count",
952
+ "success",
953
+ "total_recipients"
954
+ ]
955
+ },
956
+ "EmailLog": {
957
+ "type": "object",
958
+ "description": "Serializer for EmailLog model.",
959
+ "properties": {
960
+ "id": {
961
+ "type": "string",
962
+ "format": "uuid",
963
+ "readOnly": true
964
+ },
965
+ "user": {
966
+ "type": "integer",
967
+ "readOnly": true,
968
+ "nullable": true,
969
+ "title": "User Account"
970
+ },
971
+ "user_email": {
972
+ "type": "string",
973
+ "readOnly": true
974
+ },
975
+ "newsletter": {
976
+ "type": "integer",
977
+ "readOnly": true,
978
+ "nullable": true,
979
+ "title": "Related Newsletter"
980
+ },
981
+ "newsletter_title": {
982
+ "type": "string",
983
+ "readOnly": true
984
+ },
985
+ "recipient": {
986
+ "type": "string",
987
+ "readOnly": true,
988
+ "title": "Recipient(s)",
989
+ "description": "Comma-separated email addresses"
990
+ },
991
+ "subject": {
992
+ "type": "string",
993
+ "readOnly": true
994
+ },
995
+ "body": {
996
+ "type": "string",
997
+ "readOnly": true,
998
+ "title": "Body (HTML)"
999
+ },
1000
+ "status": {
1001
+ "enum": [
1002
+ "pending",
1003
+ "sent",
1004
+ "failed"
1005
+ ],
1006
+ "type": "string",
1007
+ "description": "* `pending` - Pending\n* `sent` - Sent\n* `failed` - Failed",
1008
+ "x-spec-enum-id": "5bbd878ebde59ad9",
1009
+ "readOnly": true
1010
+ },
1011
+ "created_at": {
1012
+ "type": "string",
1013
+ "format": "date-time",
1014
+ "readOnly": true
1015
+ },
1016
+ "sent_at": {
1017
+ "type": "string",
1018
+ "format": "date-time",
1019
+ "readOnly": true,
1020
+ "nullable": true
1021
+ },
1022
+ "error_message": {
1023
+ "type": "string",
1024
+ "readOnly": true,
1025
+ "nullable": true
1026
+ }
1027
+ },
1028
+ "required": [
1029
+ "body",
1030
+ "created_at",
1031
+ "error_message",
1032
+ "id",
1033
+ "newsletter",
1034
+ "newsletter_title",
1035
+ "recipient",
1036
+ "sent_at",
1037
+ "status",
1038
+ "subject",
1039
+ "user",
1040
+ "user_email"
1041
+ ]
1042
+ },
1043
+ "ErrorResponse": {
1044
+ "type": "object",
1045
+ "description": "Generic error response.",
1046
+ "properties": {
1047
+ "success": {
1048
+ "type": "boolean",
1049
+ "default": false
1050
+ },
1051
+ "message": {
1052
+ "type": "string"
1053
+ }
1054
+ },
1055
+ "required": [
1056
+ "message"
1057
+ ]
1058
+ },
1059
+ "Newsletter": {
1060
+ "type": "object",
1061
+ "description": "Serializer for Newsletter model.",
1062
+ "properties": {
1063
+ "id": {
1064
+ "type": "integer",
1065
+ "readOnly": true
1066
+ },
1067
+ "title": {
1068
+ "type": "string",
1069
+ "title": "Newsletter Title",
1070
+ "maxLength": 255
1071
+ },
1072
+ "description": {
1073
+ "type": "string"
1074
+ },
1075
+ "is_active": {
1076
+ "type": "boolean",
1077
+ "title": "Active"
1078
+ },
1079
+ "auto_subscribe": {
1080
+ "type": "boolean",
1081
+ "title": "Auto Subscribe New Users",
1082
+ "description": "Automatically subscribe new users to this newsletter"
1083
+ },
1084
+ "created_at": {
1085
+ "type": "string",
1086
+ "format": "date-time",
1087
+ "readOnly": true
1088
+ },
1089
+ "updated_at": {
1090
+ "type": "string",
1091
+ "format": "date-time",
1092
+ "readOnly": true
1093
+ },
1094
+ "subscribers_count": {
1095
+ "type": "integer",
1096
+ "readOnly": true
1097
+ }
1098
+ },
1099
+ "required": [
1100
+ "created_at",
1101
+ "id",
1102
+ "subscribers_count",
1103
+ "title",
1104
+ "updated_at"
1105
+ ]
1106
+ },
1107
+ "NewsletterCampaign": {
1108
+ "type": "object",
1109
+ "description": "Serializer for NewsletterCampaign model.",
1110
+ "properties": {
1111
+ "id": {
1112
+ "type": "integer",
1113
+ "readOnly": true
1114
+ },
1115
+ "newsletter": {
1116
+ "type": "integer"
1117
+ },
1118
+ "newsletter_title": {
1119
+ "type": "string",
1120
+ "readOnly": true
1121
+ },
1122
+ "subject": {
1123
+ "type": "string",
1124
+ "maxLength": 255
1125
+ },
1126
+ "email_title": {
1127
+ "type": "string",
1128
+ "maxLength": 255
1129
+ },
1130
+ "main_text": {
1131
+ "type": "string"
1132
+ },
1133
+ "main_html_content": {
1134
+ "type": "string",
1135
+ "title": "HTML Content"
1136
+ },
1137
+ "button_text": {
1138
+ "type": "string",
1139
+ "maxLength": 100
1140
+ },
1141
+ "button_url": {
1142
+ "type": "string",
1143
+ "format": "uri",
1144
+ "maxLength": 200
1145
+ },
1146
+ "secondary_text": {
1147
+ "type": "string"
1148
+ },
1149
+ "status": {
1150
+ "enum": [
1151
+ "draft",
1152
+ "sending",
1153
+ "sent",
1154
+ "failed"
1155
+ ],
1156
+ "type": "string",
1157
+ "description": "* `draft` - Draft\n* `sending` - Sending\n* `sent` - Sent\n* `failed` - Failed",
1158
+ "x-spec-enum-id": "cffe0322bdf2db32",
1159
+ "readOnly": true
1160
+ },
1161
+ "created_at": {
1162
+ "type": "string",
1163
+ "format": "date-time",
1164
+ "readOnly": true
1165
+ },
1166
+ "sent_at": {
1167
+ "type": "string",
1168
+ "format": "date-time",
1169
+ "readOnly": true,
1170
+ "nullable": true
1171
+ },
1172
+ "recipient_count": {
1173
+ "type": "integer",
1174
+ "readOnly": true
1175
+ }
1176
+ },
1177
+ "required": [
1178
+ "created_at",
1179
+ "email_title",
1180
+ "id",
1181
+ "main_text",
1182
+ "newsletter",
1183
+ "newsletter_title",
1184
+ "recipient_count",
1185
+ "sent_at",
1186
+ "status",
1187
+ "subject"
1188
+ ]
1189
+ },
1190
+ "NewsletterCampaignRequest": {
1191
+ "type": "object",
1192
+ "description": "Serializer for NewsletterCampaign model.",
1193
+ "properties": {
1194
+ "newsletter": {
1195
+ "type": "integer"
1196
+ },
1197
+ "subject": {
1198
+ "type": "string",
1199
+ "minLength": 1,
1200
+ "maxLength": 255
1201
+ },
1202
+ "email_title": {
1203
+ "type": "string",
1204
+ "minLength": 1,
1205
+ "maxLength": 255
1206
+ },
1207
+ "main_text": {
1208
+ "type": "string",
1209
+ "minLength": 1
1210
+ },
1211
+ "main_html_content": {
1212
+ "type": "string",
1213
+ "title": "HTML Content"
1214
+ },
1215
+ "button_text": {
1216
+ "type": "string",
1217
+ "maxLength": 100
1218
+ },
1219
+ "button_url": {
1220
+ "type": "string",
1221
+ "format": "uri",
1222
+ "maxLength": 200
1223
+ },
1224
+ "secondary_text": {
1225
+ "type": "string"
1226
+ }
1227
+ },
1228
+ "required": [
1229
+ "email_title",
1230
+ "main_text",
1231
+ "newsletter",
1232
+ "subject"
1233
+ ]
1234
+ },
1235
+ "NewsletterSubscription": {
1236
+ "type": "object",
1237
+ "description": "Serializer for NewsletterSubscription model.",
1238
+ "properties": {
1239
+ "id": {
1240
+ "type": "integer",
1241
+ "readOnly": true
1242
+ },
1243
+ "newsletter": {
1244
+ "type": "integer"
1245
+ },
1246
+ "newsletter_title": {
1247
+ "type": "string",
1248
+ "readOnly": true
1249
+ },
1250
+ "user": {
1251
+ "type": "integer",
1252
+ "nullable": true
1253
+ },
1254
+ "user_email": {
1255
+ "type": "string",
1256
+ "readOnly": true
1257
+ },
1258
+ "email": {
1259
+ "type": "string",
1260
+ "format": "email",
1261
+ "title": "Email Address",
1262
+ "maxLength": 254
1263
+ },
1264
+ "is_active": {
1265
+ "type": "boolean",
1266
+ "title": "Active"
1267
+ },
1268
+ "subscribed_at": {
1269
+ "type": "string",
1270
+ "format": "date-time",
1271
+ "readOnly": true
1272
+ },
1273
+ "unsubscribed_at": {
1274
+ "type": "string",
1275
+ "format": "date-time",
1276
+ "readOnly": true,
1277
+ "nullable": true
1278
+ }
1279
+ },
1280
+ "required": [
1281
+ "email",
1282
+ "id",
1283
+ "newsletter",
1284
+ "newsletter_title",
1285
+ "subscribed_at",
1286
+ "unsubscribed_at",
1287
+ "user_email"
1288
+ ]
1289
+ },
1290
+ "PaginatedEmailLogList": {
1291
+ "type": "object",
1292
+ "required": [
1293
+ "count",
1294
+ "page",
1295
+ "pages",
1296
+ "page_size",
1297
+ "has_next",
1298
+ "has_previous",
1299
+ "results"
1300
+ ],
1301
+ "properties": {
1302
+ "count": {
1303
+ "type": "integer",
1304
+ "description": "Total number of items across all pages",
1305
+ "example": 150
1306
+ },
1307
+ "page": {
1308
+ "type": "integer",
1309
+ "description": "Current page number (1-based)",
1310
+ "example": 2
1311
+ },
1312
+ "pages": {
1313
+ "type": "integer",
1314
+ "description": "Total number of pages",
1315
+ "example": 15
1316
+ },
1317
+ "page_size": {
1318
+ "type": "integer",
1319
+ "description": "Number of items per page",
1320
+ "example": 10
1321
+ },
1322
+ "has_next": {
1323
+ "type": "boolean",
1324
+ "description": "Whether there is a next page",
1325
+ "example": true
1326
+ },
1327
+ "has_previous": {
1328
+ "type": "boolean",
1329
+ "description": "Whether there is a previous page",
1330
+ "example": true
1331
+ },
1332
+ "next_page": {
1333
+ "type": "integer",
1334
+ "nullable": true,
1335
+ "description": "Next page number (null if no next page)",
1336
+ "example": 3
1337
+ },
1338
+ "previous_page": {
1339
+ "type": "integer",
1340
+ "nullable": true,
1341
+ "description": "Previous page number (null if no previous page)",
1342
+ "example": 1
1343
+ },
1344
+ "results": {
1345
+ "type": "array",
1346
+ "items": {
1347
+ "$ref": "#/components/schemas/EmailLog"
1348
+ },
1349
+ "description": "Array of items for current page"
1350
+ }
1351
+ }
1352
+ },
1353
+ "PaginatedNewsletterCampaignList": {
1354
+ "type": "object",
1355
+ "required": [
1356
+ "count",
1357
+ "page",
1358
+ "pages",
1359
+ "page_size",
1360
+ "has_next",
1361
+ "has_previous",
1362
+ "results"
1363
+ ],
1364
+ "properties": {
1365
+ "count": {
1366
+ "type": "integer",
1367
+ "description": "Total number of items across all pages",
1368
+ "example": 150
1369
+ },
1370
+ "page": {
1371
+ "type": "integer",
1372
+ "description": "Current page number (1-based)",
1373
+ "example": 2
1374
+ },
1375
+ "pages": {
1376
+ "type": "integer",
1377
+ "description": "Total number of pages",
1378
+ "example": 15
1379
+ },
1380
+ "page_size": {
1381
+ "type": "integer",
1382
+ "description": "Number of items per page",
1383
+ "example": 10
1384
+ },
1385
+ "has_next": {
1386
+ "type": "boolean",
1387
+ "description": "Whether there is a next page",
1388
+ "example": true
1389
+ },
1390
+ "has_previous": {
1391
+ "type": "boolean",
1392
+ "description": "Whether there is a previous page",
1393
+ "example": true
1394
+ },
1395
+ "next_page": {
1396
+ "type": "integer",
1397
+ "nullable": true,
1398
+ "description": "Next page number (null if no next page)",
1399
+ "example": 3
1400
+ },
1401
+ "previous_page": {
1402
+ "type": "integer",
1403
+ "nullable": true,
1404
+ "description": "Previous page number (null if no previous page)",
1405
+ "example": 1
1406
+ },
1407
+ "results": {
1408
+ "type": "array",
1409
+ "items": {
1410
+ "$ref": "#/components/schemas/NewsletterCampaign"
1411
+ },
1412
+ "description": "Array of items for current page"
1413
+ }
1414
+ }
1415
+ },
1416
+ "PaginatedNewsletterList": {
1417
+ "type": "object",
1418
+ "required": [
1419
+ "count",
1420
+ "page",
1421
+ "pages",
1422
+ "page_size",
1423
+ "has_next",
1424
+ "has_previous",
1425
+ "results"
1426
+ ],
1427
+ "properties": {
1428
+ "count": {
1429
+ "type": "integer",
1430
+ "description": "Total number of items across all pages",
1431
+ "example": 150
1432
+ },
1433
+ "page": {
1434
+ "type": "integer",
1435
+ "description": "Current page number (1-based)",
1436
+ "example": 2
1437
+ },
1438
+ "pages": {
1439
+ "type": "integer",
1440
+ "description": "Total number of pages",
1441
+ "example": 15
1442
+ },
1443
+ "page_size": {
1444
+ "type": "integer",
1445
+ "description": "Number of items per page",
1446
+ "example": 10
1447
+ },
1448
+ "has_next": {
1449
+ "type": "boolean",
1450
+ "description": "Whether there is a next page",
1451
+ "example": true
1452
+ },
1453
+ "has_previous": {
1454
+ "type": "boolean",
1455
+ "description": "Whether there is a previous page",
1456
+ "example": true
1457
+ },
1458
+ "next_page": {
1459
+ "type": "integer",
1460
+ "nullable": true,
1461
+ "description": "Next page number (null if no next page)",
1462
+ "example": 3
1463
+ },
1464
+ "previous_page": {
1465
+ "type": "integer",
1466
+ "nullable": true,
1467
+ "description": "Previous page number (null if no previous page)",
1468
+ "example": 1
1469
+ },
1470
+ "results": {
1471
+ "type": "array",
1472
+ "items": {
1473
+ "$ref": "#/components/schemas/Newsletter"
1474
+ },
1475
+ "description": "Array of items for current page"
1476
+ }
1477
+ }
1478
+ },
1479
+ "PaginatedNewsletterSubscriptionList": {
1480
+ "type": "object",
1481
+ "required": [
1482
+ "count",
1483
+ "page",
1484
+ "pages",
1485
+ "page_size",
1486
+ "has_next",
1487
+ "has_previous",
1488
+ "results"
1489
+ ],
1490
+ "properties": {
1491
+ "count": {
1492
+ "type": "integer",
1493
+ "description": "Total number of items across all pages",
1494
+ "example": 150
1495
+ },
1496
+ "page": {
1497
+ "type": "integer",
1498
+ "description": "Current page number (1-based)",
1499
+ "example": 2
1500
+ },
1501
+ "pages": {
1502
+ "type": "integer",
1503
+ "description": "Total number of pages",
1504
+ "example": 15
1505
+ },
1506
+ "page_size": {
1507
+ "type": "integer",
1508
+ "description": "Number of items per page",
1509
+ "example": 10
1510
+ },
1511
+ "has_next": {
1512
+ "type": "boolean",
1513
+ "description": "Whether there is a next page",
1514
+ "example": true
1515
+ },
1516
+ "has_previous": {
1517
+ "type": "boolean",
1518
+ "description": "Whether there is a previous page",
1519
+ "example": true
1520
+ },
1521
+ "next_page": {
1522
+ "type": "integer",
1523
+ "nullable": true,
1524
+ "description": "Next page number (null if no next page)",
1525
+ "example": 3
1526
+ },
1527
+ "previous_page": {
1528
+ "type": "integer",
1529
+ "nullable": true,
1530
+ "description": "Previous page number (null if no previous page)",
1531
+ "example": 1
1532
+ },
1533
+ "results": {
1534
+ "type": "array",
1535
+ "items": {
1536
+ "$ref": "#/components/schemas/NewsletterSubscription"
1537
+ },
1538
+ "description": "Array of items for current page"
1539
+ }
1540
+ }
1541
+ },
1542
+ "PatchedNewsletterCampaignRequest": {
1543
+ "type": "object",
1544
+ "description": "Serializer for NewsletterCampaign model.",
1545
+ "properties": {
1546
+ "newsletter": {
1547
+ "type": "integer"
1548
+ },
1549
+ "subject": {
1550
+ "type": "string",
1551
+ "minLength": 1,
1552
+ "maxLength": 255
1553
+ },
1554
+ "email_title": {
1555
+ "type": "string",
1556
+ "minLength": 1,
1557
+ "maxLength": 255
1558
+ },
1559
+ "main_text": {
1560
+ "type": "string",
1561
+ "minLength": 1
1562
+ },
1563
+ "main_html_content": {
1564
+ "type": "string",
1565
+ "title": "HTML Content"
1566
+ },
1567
+ "button_text": {
1568
+ "type": "string",
1569
+ "maxLength": 100
1570
+ },
1571
+ "button_url": {
1572
+ "type": "string",
1573
+ "format": "uri",
1574
+ "maxLength": 200
1575
+ },
1576
+ "secondary_text": {
1577
+ "type": "string"
1578
+ }
1579
+ }
1580
+ },
1581
+ "PatchedUnsubscribeRequest": {
1582
+ "type": "object",
1583
+ "description": "Simple serializer for unsubscribe.",
1584
+ "properties": {
1585
+ "subscription_id": {
1586
+ "type": "integer"
1587
+ }
1588
+ }
1589
+ },
1590
+ "SendCampaignRequest": {
1591
+ "type": "object",
1592
+ "description": "Simple serializer for sending campaign.",
1593
+ "properties": {
1594
+ "campaign_id": {
1595
+ "type": "integer"
1596
+ }
1597
+ },
1598
+ "required": [
1599
+ "campaign_id"
1600
+ ]
1601
+ },
1602
+ "SendCampaignResponse": {
1603
+ "type": "object",
1604
+ "description": "Response for sending campaign.",
1605
+ "properties": {
1606
+ "success": {
1607
+ "type": "boolean"
1608
+ },
1609
+ "message": {
1610
+ "type": "string"
1611
+ },
1612
+ "sent_count": {
1613
+ "type": "integer"
1614
+ },
1615
+ "error": {
1616
+ "type": "string"
1617
+ }
1618
+ },
1619
+ "required": [
1620
+ "success"
1621
+ ]
1622
+ },
1623
+ "SubscribeRequest": {
1624
+ "type": "object",
1625
+ "description": "Simple serializer for newsletter subscription.",
1626
+ "properties": {
1627
+ "newsletter_id": {
1628
+ "type": "integer"
1629
+ },
1630
+ "email": {
1631
+ "type": "string",
1632
+ "format": "email",
1633
+ "minLength": 1
1634
+ }
1635
+ },
1636
+ "required": [
1637
+ "email",
1638
+ "newsletter_id"
1639
+ ]
1640
+ },
1641
+ "SubscribeResponse": {
1642
+ "type": "object",
1643
+ "description": "Response for subscription.",
1644
+ "properties": {
1645
+ "success": {
1646
+ "type": "boolean"
1647
+ },
1648
+ "message": {
1649
+ "type": "string"
1650
+ },
1651
+ "subscription_id": {
1652
+ "type": "integer"
1653
+ }
1654
+ },
1655
+ "required": [
1656
+ "message",
1657
+ "success"
1658
+ ]
1659
+ },
1660
+ "SuccessResponse": {
1661
+ "type": "object",
1662
+ "description": "Generic success response.",
1663
+ "properties": {
1664
+ "success": {
1665
+ "type": "boolean"
1666
+ },
1667
+ "message": {
1668
+ "type": "string"
1669
+ }
1670
+ },
1671
+ "required": [
1672
+ "message",
1673
+ "success"
1674
+ ]
1675
+ },
1676
+ "TestEmailRequest": {
1677
+ "type": "object",
1678
+ "description": "Simple serializer for test email.",
1679
+ "properties": {
1680
+ "email": {
1681
+ "type": "string",
1682
+ "format": "email",
1683
+ "minLength": 1
1684
+ },
1685
+ "subject": {
1686
+ "type": "string",
1687
+ "minLength": 1,
1688
+ "default": "Django CFG Newsletter Test",
1689
+ "maxLength": 255
1690
+ },
1691
+ "message": {
1692
+ "type": "string",
1693
+ "minLength": 1,
1694
+ "default": "This is a test email from Django CFG Newsletter."
1695
+ }
1696
+ },
1697
+ "required": [
1698
+ "email"
1699
+ ]
1700
+ },
1701
+ "Unsubscribe": {
1702
+ "type": "object",
1703
+ "description": "Simple serializer for unsubscribe.",
1704
+ "properties": {
1705
+ "subscription_id": {
1706
+ "type": "integer"
1707
+ }
1708
+ },
1709
+ "required": [
1710
+ "subscription_id"
1711
+ ]
1712
+ },
1713
+ "UnsubscribeRequest": {
1714
+ "type": "object",
1715
+ "description": "Simple serializer for unsubscribe.",
1716
+ "properties": {
1717
+ "subscription_id": {
1718
+ "type": "integer"
1719
+ }
1720
+ },
1721
+ "required": [
1722
+ "subscription_id"
1723
+ ]
1724
+ }
1725
+ },
1726
+ "securitySchemes": {
1727
+ "jwtAuthWithLastLogin": {
1728
+ "type": "http",
1729
+ "scheme": "bearer",
1730
+ "bearerFormat": "JWT"
1731
+ }
1732
+ }
1733
+ },
1734
+ "servers": [
1735
+ {
1736
+ "url": "http://localhost:8000"
1737
+ }
1738
+ ]
1739
+ }