@djangocfg/api 1.0.1 → 1.0.3

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 (127) hide show
  1. package/dist/index.cjs +17641 -8457
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +14654 -5066
  4. package/dist/index.d.ts +14654 -5066
  5. package/dist/index.mjs +17885 -8728
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +17 -17
  8. package/src/cfg/contexts/payments/ApiKeysContext.tsx +2 -2
  9. package/src/cfg/contexts/payments/CurrenciesContext.tsx +0 -26
  10. package/src/cfg/contexts/payments/OverviewContext.tsx +79 -0
  11. package/src/cfg/contexts/payments/RootPaymentsContext.tsx +137 -0
  12. package/src/cfg/contexts/payments/index.ts +13 -0
  13. package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +2 -2
  14. package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +1 -1
  15. package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +6 -6
  16. package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +1 -1
  17. package/src/cfg/generated/_utils/fetchers/cfg__health.ts +2 -2
  18. package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +876 -0
  19. package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +6 -6
  20. package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +1 -1
  21. package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +3 -3
  22. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +1 -1
  23. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +6 -6
  24. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +1 -1
  25. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +2 -2
  26. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +3 -3
  27. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +1 -1
  28. package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +181 -179
  29. package/src/cfg/generated/_utils/fetchers/cfg__payments__webhooks.ts +5 -5
  30. package/src/cfg/generated/_utils/fetchers/cfg__support.ts +12 -12
  31. package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +10 -10
  32. package/src/cfg/generated/_utils/fetchers/index.ts +1 -0
  33. package/src/cfg/generated/_utils/hooks/cfg__knowbase.ts +997 -0
  34. package/src/cfg/generated/_utils/hooks/cfg__payments.ts +12 -10
  35. package/src/cfg/generated/_utils/hooks/index.ts +1 -0
  36. package/src/cfg/generated/_utils/schemas/APIKeyValidationResponse.schema.ts +1 -1
  37. package/src/cfg/generated/_utils/schemas/AdminPaymentDetail.schema.ts +1 -1
  38. package/src/cfg/generated/_utils/schemas/AdminPaymentList.schema.ts +1 -1
  39. package/src/cfg/generated/_utils/schemas/ArchiveItem.schema.ts +33 -0
  40. package/src/cfg/generated/_utils/schemas/ArchiveItemChunk.schema.ts +29 -0
  41. package/src/cfg/generated/_utils/schemas/ArchiveItemChunkDetail.schema.ts +30 -0
  42. package/src/cfg/generated/_utils/schemas/ArchiveItemChunkRequest.schema.ts +22 -0
  43. package/src/cfg/generated/_utils/schemas/ArchiveItemDetail.schema.ts +35 -0
  44. package/src/cfg/generated/_utils/schemas/ArchiveItemRequest.schema.ts +22 -0
  45. package/src/cfg/generated/_utils/schemas/ArchiveProcessingResult.schema.ts +26 -0
  46. package/src/cfg/generated/_utils/schemas/ArchiveSearchRequestRequest.schema.ts +25 -0
  47. package/src/cfg/generated/_utils/schemas/ArchiveSearchResult.schema.ts +24 -0
  48. package/src/cfg/generated/_utils/schemas/ArchiveStatistics.schema.ts +28 -0
  49. package/src/cfg/generated/_utils/schemas/ChatHistory.schema.ts +22 -0
  50. package/src/cfg/generated/_utils/schemas/ChatMessage.schema.ts +27 -0
  51. package/src/cfg/generated/_utils/schemas/ChatQueryRequest.schema.ts +22 -0
  52. package/src/cfg/generated/_utils/schemas/ChatResponse.schema.ts +26 -0
  53. package/src/cfg/generated/_utils/schemas/ChatResponseRequest.schema.ts +26 -0
  54. package/src/cfg/generated/_utils/schemas/ChatSession.schema.ts +29 -0
  55. package/src/cfg/generated/_utils/schemas/ChatSessionCreateRequest.schema.ts +22 -0
  56. package/src/cfg/generated/_utils/schemas/ChatSessionRequest.schema.ts +25 -0
  57. package/src/cfg/generated/_utils/schemas/ChatSource.schema.ts +21 -0
  58. package/src/cfg/generated/_utils/schemas/ChatSourceRequest.schema.ts +21 -0
  59. package/src/cfg/generated/_utils/schemas/ChunkRevectorizationRequestRequest.schema.ts +20 -0
  60. package/src/cfg/generated/_utils/schemas/CurrencyList.schema.ts +2 -0
  61. package/src/cfg/generated/_utils/schemas/CurrencyRates.schema.ts +26 -0
  62. package/src/cfg/generated/_utils/schemas/Document.schema.ts +32 -0
  63. package/src/cfg/generated/_utils/schemas/DocumentArchive.schema.ts +44 -0
  64. package/src/cfg/generated/_utils/schemas/DocumentArchiveDetail.schema.ts +48 -0
  65. package/src/cfg/generated/_utils/schemas/DocumentArchiveList.schema.ts +35 -0
  66. package/src/cfg/generated/_utils/schemas/DocumentArchiveRequest.schema.ts +21 -0
  67. package/src/cfg/generated/_utils/schemas/DocumentCategory.schema.ts +23 -0
  68. package/src/cfg/generated/_utils/schemas/DocumentCategoryRequest.schema.ts +21 -0
  69. package/src/cfg/generated/_utils/schemas/DocumentCreateRequest.schema.ts +22 -0
  70. package/src/cfg/generated/_utils/schemas/DocumentProcessingStatus.schema.ts +23 -0
  71. package/src/cfg/generated/_utils/schemas/DocumentRequest.schema.ts +22 -0
  72. package/src/cfg/generated/_utils/schemas/DocumentStats.schema.ts +25 -0
  73. package/src/cfg/generated/_utils/schemas/Network.schema.ts +1 -1
  74. package/src/cfg/generated/_utils/schemas/PaginatedArchiveItemChunkList.schema.ts +24 -0
  75. package/src/cfg/generated/_utils/schemas/PaginatedArchiveItemList.schema.ts +24 -0
  76. package/src/cfg/generated/_utils/schemas/PaginatedArchiveSearchResultList.schema.ts +24 -0
  77. package/src/cfg/generated/_utils/schemas/PaginatedChatResponseList.schema.ts +24 -0
  78. package/src/cfg/generated/_utils/schemas/PaginatedChatSessionList.schema.ts +24 -0
  79. package/src/cfg/generated/_utils/schemas/PaginatedDocumentArchiveListList.schema.ts +24 -0
  80. package/src/cfg/generated/_utils/schemas/PaginatedDocumentList.schema.ts +24 -0
  81. package/src/cfg/generated/_utils/schemas/PaginatedPublicCategoryList.schema.ts +24 -0
  82. package/src/cfg/generated/_utils/schemas/PaginatedPublicDocumentListList.schema.ts +24 -0
  83. package/src/cfg/generated/_utils/schemas/PatchedArchiveItemChunkRequest.schema.ts +22 -0
  84. package/src/cfg/generated/_utils/schemas/PatchedArchiveItemRequest.schema.ts +22 -0
  85. package/src/cfg/generated/_utils/schemas/PatchedChatResponseRequest.schema.ts +26 -0
  86. package/src/cfg/generated/_utils/schemas/PatchedChatSessionRequest.schema.ts +25 -0
  87. package/src/cfg/generated/_utils/schemas/PatchedDocumentArchiveRequest.schema.ts +21 -0
  88. package/src/cfg/generated/_utils/schemas/PatchedDocumentRequest.schema.ts +22 -0
  89. package/src/cfg/generated/_utils/schemas/Payment.schema.ts +1 -0
  90. package/src/cfg/generated/_utils/schemas/PaymentCreate.schema.ts +0 -1
  91. package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +0 -1
  92. package/src/cfg/generated/_utils/schemas/PaymentsMetrics.schema.ts +1 -1
  93. package/src/cfg/generated/_utils/schemas/ProviderCurrency.schema.ts +1 -1
  94. package/src/cfg/generated/_utils/schemas/PublicCategory.schema.ts +21 -0
  95. package/src/cfg/generated/_utils/schemas/PublicDocument.schema.ts +25 -0
  96. package/src/cfg/generated/_utils/schemas/PublicDocumentList.schema.ts +24 -0
  97. package/src/cfg/generated/_utils/schemas/SupportedCurrencies.schema.ts +25 -0
  98. package/src/cfg/generated/_utils/schemas/VectorizationResult.schema.ts +24 -0
  99. package/src/cfg/generated/_utils/schemas/VectorizationStatistics.schema.ts +26 -0
  100. package/src/cfg/generated/_utils/schemas/index.ts +54 -0
  101. package/src/cfg/generated/cfg__accounts/client.ts +1 -1
  102. package/src/cfg/generated/cfg__accounts__auth/client.ts +1 -1
  103. package/src/cfg/generated/cfg__accounts__user_profile/client.ts +1 -1
  104. package/src/cfg/generated/cfg__endpoints/client.ts +1 -1
  105. package/src/cfg/generated/cfg__health/client.ts +1 -1
  106. package/src/cfg/generated/cfg__knowbase/client.ts +666 -0
  107. package/src/cfg/generated/cfg__knowbase/index.ts +2 -0
  108. package/src/cfg/generated/cfg__knowbase/models.ts +1120 -0
  109. package/src/cfg/generated/cfg__leads/client.ts +1 -1
  110. package/src/cfg/generated/cfg__leads__lead_submission/client.ts +1 -1
  111. package/src/cfg/generated/cfg__newsletter/client.ts +1 -1
  112. package/src/cfg/generated/cfg__newsletter__bulk_email/client.ts +1 -1
  113. package/src/cfg/generated/cfg__newsletter__campaigns/client.ts +1 -1
  114. package/src/cfg/generated/cfg__newsletter__logs/client.ts +1 -1
  115. package/src/cfg/generated/cfg__newsletter__newsletters/client.ts +1 -1
  116. package/src/cfg/generated/cfg__newsletter__subscriptions/client.ts +1 -1
  117. package/src/cfg/generated/cfg__newsletter__testing/client.ts +1 -1
  118. package/src/cfg/generated/cfg__payments/client.ts +25 -45
  119. package/src/cfg/generated/cfg__payments/models.ts +46 -12
  120. package/src/cfg/generated/cfg__payments__webhooks/client.ts +1 -1
  121. package/src/cfg/generated/cfg__support/client.ts +1 -1
  122. package/src/cfg/generated/cfg__tasks/client.ts +1 -1
  123. package/src/cfg/generated/client.ts +57 -54
  124. package/src/cfg/generated/enums.ts +269 -16
  125. package/src/cfg/generated/index.ts +82 -29
  126. package/src/cfg/generated/schema.ts +10238 -4386
  127. package/src/index.ts +23 -1
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Leads.
6
6
  */
7
- export class CfgLeadsAPI {
7
+ export class CfgLeads {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Lead Submission.
6
6
  */
7
- export class CfgLeadSubmissionAPI {
7
+ export class CfgLeadSubmission {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Newsletter.
6
6
  */
7
- export class CfgNewsletterAPI {
7
+ export class CfgNewsletter {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Bulk Email.
6
6
  */
7
- export class CfgBulkEmailAPI {
7
+ export class CfgBulkEmail {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Campaigns.
6
6
  */
7
- export class CfgCampaignsAPI {
7
+ export class CfgCampaigns {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Logs.
6
6
  */
7
- export class CfgLogsAPI {
7
+ export class CfgLogs {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Newsletters.
6
6
  */
7
- export class CfgNewslettersAPI {
7
+ export class CfgNewsletters {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Subscriptions.
6
6
  */
7
- export class CfgSubscriptionsAPI {
7
+ export class CfgSubscriptions {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Testing.
6
6
  */
7
- export class CfgTestingAPI {
7
+ export class CfgTesting {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Payments.
6
6
  */
7
- export class CfgPaymentsAPI {
7
+ export class CfgPayments {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -290,8 +290,9 @@ export class CfgPaymentsAPI {
290
290
  async apiKeysList(params?: { is_active?: boolean; ordering?: string; page?: number; page_size?: number; search?: string; user?: number }): Promise<Models.PaginatedAPIKeyListList>;
291
291
 
292
292
  /**
293
- * Global API Key ViewSet: /api/api-keys/ Provides admin-level access to
294
- * all API keys with filtering and stats.
293
+ * API Key ViewSet: /api/api-keys/ User-specific access to API keys with
294
+ * filtering and stats. - Regular users: can only see/manage their own API
295
+ * keys - Staff/Admin: can see/manage all API keys
295
296
  */
296
297
  async apiKeysList(...args: any[]): Promise<Models.PaginatedAPIKeyListList> {
297
298
  const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
@@ -307,8 +308,9 @@ export class CfgPaymentsAPI {
307
308
  }
308
309
 
309
310
  /**
310
- * Global API Key ViewSet: /api/api-keys/ Provides admin-level access to
311
- * all API keys with filtering and stats.
311
+ * API Key ViewSet: /api/api-keys/ User-specific access to API keys with
312
+ * filtering and stats. - Regular users: can only see/manage their own API
313
+ * keys - Staff/Admin: can see/manage all API keys
312
314
  */
313
315
  async apiKeysCreate(data: Models.APIKeyCreateRequest): Promise<Models.APIKeyCreate> {
314
316
  const response = await this.client.request('POST', "/cfg/payments/api-keys/", { body: data });
@@ -316,8 +318,9 @@ export class CfgPaymentsAPI {
316
318
  }
317
319
 
318
320
  /**
319
- * Global API Key ViewSet: /api/api-keys/ Provides admin-level access to
320
- * all API keys with filtering and stats.
321
+ * API Key ViewSet: /api/api-keys/ User-specific access to API keys with
322
+ * filtering and stats. - Regular users: can only see/manage their own API
323
+ * keys - Staff/Admin: can see/manage all API keys
321
324
  */
322
325
  async apiKeysRetrieve(id: string): Promise<Models.APIKeyDetail> {
323
326
  const response = await this.client.request('GET', `/cfg/payments/api-keys/${id}/`);
@@ -325,8 +328,9 @@ export class CfgPaymentsAPI {
325
328
  }
326
329
 
327
330
  /**
328
- * Global API Key ViewSet: /api/api-keys/ Provides admin-level access to
329
- * all API keys with filtering and stats.
331
+ * API Key ViewSet: /api/api-keys/ User-specific access to API keys with
332
+ * filtering and stats. - Regular users: can only see/manage their own API
333
+ * keys - Staff/Admin: can see/manage all API keys
330
334
  */
331
335
  async apiKeysUpdate(id: string, data: Models.APIKeyUpdateRequest): Promise<Models.APIKeyUpdate> {
332
336
  const response = await this.client.request('PUT', `/cfg/payments/api-keys/${id}/`, { body: data });
@@ -334,8 +338,9 @@ export class CfgPaymentsAPI {
334
338
  }
335
339
 
336
340
  /**
337
- * Global API Key ViewSet: /api/api-keys/ Provides admin-level access to
338
- * all API keys with filtering and stats.
341
+ * API Key ViewSet: /api/api-keys/ User-specific access to API keys with
342
+ * filtering and stats. - Regular users: can only see/manage their own API
343
+ * keys - Staff/Admin: can see/manage all API keys
339
344
  */
340
345
  async apiKeysPartialUpdate(id: string, data?: Models.PatchedAPIKeyUpdateRequest): Promise<Models.APIKeyUpdate> {
341
346
  const response = await this.client.request('PATCH', `/cfg/payments/api-keys/${id}/`, { body: data });
@@ -343,8 +348,9 @@ export class CfgPaymentsAPI {
343
348
  }
344
349
 
345
350
  /**
346
- * Global API Key ViewSet: /api/api-keys/ Provides admin-level access to
347
- * all API keys with filtering and stats.
351
+ * API Key ViewSet: /api/api-keys/ User-specific access to API keys with
352
+ * filtering and stats. - Regular users: can only see/manage their own API
353
+ * keys - Staff/Admin: can see/manage all API keys
348
354
  */
349
355
  async apiKeysDestroy(id: string): Promise<void> {
350
356
  const response = await this.client.request('DELETE', `/cfg/payments/api-keys/${id}/`);
@@ -580,24 +586,11 @@ export class CfgPaymentsAPI {
580
586
  return response;
581
587
  }
582
588
 
583
- async currenciesRatesRetrieve(base_currency: string, currencies: string): Promise<Models.Currency>;
584
- async currenciesRatesRetrieve(params: { base_currency: string; currencies: string }): Promise<Models.Currency>;
585
-
586
589
  /**
587
- * Get exchange rates
588
- *
589
- * Get current exchange rates for specified currencies
590
+ * Get current exchange rates.
590
591
  */
591
- async currenciesRatesRetrieve(...args: any[]): Promise<Models.Currency> {
592
- const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
593
-
594
- let params;
595
- if (isParamsObject) {
596
- params = args[0];
597
- } else {
598
- params = { base_currency: args[0], currencies: args[1] };
599
- }
600
- const response = await this.client.request('GET', "/cfg/payments/currencies/rates/", { params });
592
+ async currenciesRatesRetrieve(): Promise<Models.CurrencyRates> {
593
+ const response = await this.client.request('GET', "/cfg/payments/currencies/rates/");
601
594
  return response;
602
595
  }
603
596
 
@@ -618,24 +611,11 @@ export class CfgPaymentsAPI {
618
611
  return response;
619
612
  }
620
613
 
621
- async currenciesSupportedRetrieve(currency_type?: string, provider?: string): Promise<Models.Currency>;
622
- async currenciesSupportedRetrieve(params?: { currency_type?: string; provider?: string }): Promise<Models.Currency>;
623
-
624
614
  /**
625
- * Get supported currencies
626
- *
627
- * Get list of supported currencies from payment providers
615
+ * Get supported currencies from providers.
628
616
  */
629
- async currenciesSupportedRetrieve(...args: any[]): Promise<Models.Currency> {
630
- const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
631
-
632
- let params;
633
- if (isParamsObject) {
634
- params = args[0];
635
- } else {
636
- params = { currency_type: args[0], provider: args[1] };
637
- }
638
- const response = await this.client.request('GET', "/cfg/payments/currencies/supported/", { params });
617
+ async currenciesSupportedRetrieve(): Promise<Models.SupportedCurrencies> {
618
+ const response = await this.client.request('GET', "/cfg/payments/currencies/supported/");
639
619
  return response;
640
620
  }
641
621
 
@@ -530,7 +530,7 @@ export interface APIKeyValidationResponse {
530
530
  success: boolean;
531
531
  /** Whether the API key is valid */
532
532
  valid: boolean;
533
- api_key: Record<string, any>;
533
+ api_key: Record<string, any> | null;
534
534
  /** Validation message */
535
535
  message: string;
536
536
  /** Error message if validation failed */
@@ -643,6 +643,42 @@ export interface Currency {
643
643
  updated_at: string;
644
644
  }
645
645
 
646
+ /**
647
+ * Currency rates serializer for getting exchange rates. Fetches current
648
+ * exchange rates through CurrencyService.
649
+ *
650
+ * Response model (includes read-only fields).
651
+ */
652
+ export interface CurrencyRates {
653
+ /** Base currency for rates (default: USD) */
654
+ base_currency?: string;
655
+ /** Specific currencies to get rates for (optional) */
656
+ currencies?: Array<string>;
657
+ /** Provider for exchange rates
658
+
659
+ * `nowpayments` - NowPayments */
660
+ provider?: Enums.CurrencyRatesProvider;
661
+ }
662
+
663
+ /**
664
+ * Supported currencies serializer for provider capabilities. Gets supported
665
+ * currencies from providers through CurrencyService.
666
+ *
667
+ * Response model (includes read-only fields).
668
+ */
669
+ export interface SupportedCurrencies {
670
+ /** Provider to get supported currencies from
671
+
672
+ * `nowpayments` - NowPayments */
673
+ provider?: Enums.SupportedCurrenciesProvider;
674
+ /** Filter by currency type
675
+
676
+ * `all` - All
677
+ * `crypto` - Cryptocurrency
678
+ * `fiat` - Fiat Currency */
679
+ currency_type?: Enums.SupportedCurrenciesCurrencyType;
680
+ }
681
+
646
682
  /**
647
683
  *
648
684
  * Response model (includes read-only fields).
@@ -698,6 +734,8 @@ export interface Payment {
698
734
  user: string;
699
735
  /** Payment amount in USD (float for performance) */
700
736
  amount_usd: number;
737
+ /** Calculate crypto amount from USD amount and currency rate. */
738
+ amount_crypto: number;
701
739
  /** Payment currency */
702
740
  currency: number;
703
741
  /** Blockchain network (for crypto payments) */
@@ -787,7 +825,7 @@ export interface PaginatedNetworkList {
787
825
  */
788
826
  export interface Network {
789
827
  id: number;
790
- currency: Record<string, any>;
828
+ currency: Record<string, any> | null;
791
829
  /** Network name (e.g., Ethereum, Bitcoin, Polygon) */
792
830
  name: string;
793
831
  /** Network code (e.g., ETH, BTC, MATIC) */
@@ -871,7 +909,7 @@ export interface PaymentsChartResponse {
871
909
  */
872
910
  export interface PaymentsMetrics {
873
911
  balance: Record<string, any>;
874
- subscription: Record<string, any>;
912
+ subscription: Record<string, any> | null;
875
913
  api_keys: Record<string, any>;
876
914
  payments: Record<string, any>;
877
915
  }
@@ -1043,10 +1081,6 @@ export interface PaymentCreateRequest {
1043
1081
  * `ADA` - Cardano
1044
1082
  * `DOT` - Polkadot */
1045
1083
  currency_code: Enums.PaymentCreateRequestCurrencyCode;
1046
- /** Payment provider
1047
-
1048
- * `nowpayments` - NowPayments */
1049
- provider?: Enums.PaymentCreateRequestProvider;
1050
1084
  /** Success callback URL */
1051
1085
  callback_url?: string;
1052
1086
  /** Cancellation URL */
@@ -1077,10 +1111,6 @@ export interface PaymentCreate {
1077
1111
  * `ADA` - Cardano
1078
1112
  * `DOT` - Polkadot */
1079
1113
  currency_code: Enums.PaymentCreateCurrencyCode;
1080
- /** Payment provider
1081
-
1082
- * `nowpayments` - NowPayments */
1083
- provider?: Enums.PaymentCreateProvider;
1084
1114
  /** Success callback URL */
1085
1115
  callback_url?: string;
1086
1116
  /** Cancellation URL */
@@ -1201,7 +1231,7 @@ export interface PaginatedProviderCurrencyList {
1201
1231
  export interface ProviderCurrency {
1202
1232
  id: number;
1203
1233
  currency: Record<string, any>;
1204
- network: Record<string, any>;
1234
+ network: Record<string, any> | null;
1205
1235
  /** Payment provider name (e.g., nowpayments) */
1206
1236
  provider: string;
1207
1237
  /** Currency code as used by the provider */
@@ -1616,6 +1646,10 @@ export interface CurrencyList {
1616
1646
  type_display: string;
1617
1647
  /** Whether this currency is available for payments */
1618
1648
  is_active: boolean;
1649
+ /** Current USD exchange rate (1 unit = X USD) */
1650
+ usd_rate: number;
1651
+ /** When USD rate was last updated */
1652
+ usd_rate_updated_at: string | null;
1619
1653
  }
1620
1654
 
1621
1655
  /**
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Webhooks.
6
6
  */
7
- export class CfgWebhooksAPI {
7
+ export class CfgWebhooks {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Support.
6
6
  */
7
- export class CfgSupportAPI {
7
+ export class CfgSupport {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -4,7 +4,7 @@ import * as Models from "./models";
4
4
  /**
5
5
  * API endpoints for Tasks.
6
6
  */
7
- export class CfgTasksAPI {
7
+ export class CfgTasks {
8
8
  private client: any;
9
9
 
10
10
  constructor(client: any) {
@@ -1,21 +1,22 @@
1
- import { CfgAuthAPI } from "./cfg__accounts__auth";
2
- import { CfgBulkEmailAPI } from "./cfg__newsletter__bulk_email";
3
- import { CfgCampaignsAPI } from "./cfg__newsletter__campaigns";
4
- import { CfgLeadSubmissionAPI } from "./cfg__leads__lead_submission";
5
- import { CfgLogsAPI } from "./cfg__newsletter__logs";
6
- import { CfgNewslettersAPI } from "./cfg__newsletter__newsletters";
7
- import { CfgSubscriptionsAPI } from "./cfg__newsletter__subscriptions";
8
- import { CfgTestingAPI } from "./cfg__newsletter__testing";
9
- import { CfgUserProfileAPI } from "./cfg__accounts__user_profile";
10
- import { CfgWebhooksAPI } from "./cfg__payments__webhooks";
11
- import { CfgAccountsAPI } from "./cfg__accounts";
12
- import { CfgEndpointsAPI } from "./cfg__endpoints";
13
- import { CfgHealthAPI } from "./cfg__health";
14
- import { CfgLeadsAPI } from "./cfg__leads";
15
- import { CfgNewsletterAPI } from "./cfg__newsletter";
16
- import { CfgPaymentsAPI } from "./cfg__payments";
17
- import { CfgSupportAPI } from "./cfg__support";
18
- import { CfgTasksAPI } from "./cfg__tasks";
1
+ import { CfgAuth } from "./cfg__accounts__auth";
2
+ import { CfgBulkEmail } from "./cfg__newsletter__bulk_email";
3
+ import { CfgCampaigns } from "./cfg__newsletter__campaigns";
4
+ import { CfgLeadSubmission } from "./cfg__leads__lead_submission";
5
+ import { CfgLogs } from "./cfg__newsletter__logs";
6
+ import { CfgNewsletters } from "./cfg__newsletter__newsletters";
7
+ import { CfgSubscriptions } from "./cfg__newsletter__subscriptions";
8
+ import { CfgTesting } from "./cfg__newsletter__testing";
9
+ import { CfgUserProfile } from "./cfg__accounts__user_profile";
10
+ import { CfgWebhooks } from "./cfg__payments__webhooks";
11
+ import { CfgAccounts } from "./cfg__accounts";
12
+ import { CfgEndpoints } from "./cfg__endpoints";
13
+ import { CfgHealth } from "./cfg__health";
14
+ import { CfgKnowbase } from "./cfg__knowbase";
15
+ import { CfgLeads } from "./cfg__leads";
16
+ import { CfgNewsletter } from "./cfg__newsletter";
17
+ import { CfgPayments } from "./cfg__payments";
18
+ import { CfgSupport } from "./cfg__support";
19
+ import { CfgTasks } from "./cfg__tasks";
19
20
  import { HttpClientAdapter, FetchAdapter } from "./http";
20
21
  import { APIError, NetworkError } from "./errors";
21
22
  import { APILogger, type LoggerConfig } from "./logger";
@@ -44,24 +45,25 @@ export class APIClient {
44
45
  private retryConfig: RetryConfig | null = null;
45
46
 
46
47
  // Sub-clients
47
- public cfg_auth: CfgAuthAPI;
48
- public cfg_bulk_email: CfgBulkEmailAPI;
49
- public cfg_campaigns: CfgCampaignsAPI;
50
- public cfg_lead_submission: CfgLeadSubmissionAPI;
51
- public cfg_logs: CfgLogsAPI;
52
- public cfg_newsletters: CfgNewslettersAPI;
53
- public cfg_subscriptions: CfgSubscriptionsAPI;
54
- public cfg_testing: CfgTestingAPI;
55
- public cfg_user_profile: CfgUserProfileAPI;
56
- public cfg_webhooks: CfgWebhooksAPI;
57
- public cfg_accounts: CfgAccountsAPI;
58
- public cfg_endpoints: CfgEndpointsAPI;
59
- public cfg_health: CfgHealthAPI;
60
- public cfg_leads: CfgLeadsAPI;
61
- public cfg_newsletter: CfgNewsletterAPI;
62
- public cfg_payments: CfgPaymentsAPI;
63
- public cfg_support: CfgSupportAPI;
64
- public cfg_tasks: CfgTasksAPI;
48
+ public cfg_auth: CfgAuth;
49
+ public cfg_bulk_email: CfgBulkEmail;
50
+ public cfg_campaigns: CfgCampaigns;
51
+ public cfg_lead_submission: CfgLeadSubmission;
52
+ public cfg_logs: CfgLogs;
53
+ public cfg_newsletters: CfgNewsletters;
54
+ public cfg_subscriptions: CfgSubscriptions;
55
+ public cfg_testing: CfgTesting;
56
+ public cfg_user_profile: CfgUserProfile;
57
+ public cfg_webhooks: CfgWebhooks;
58
+ public cfg_accounts: CfgAccounts;
59
+ public cfg_endpoints: CfgEndpoints;
60
+ public cfg_health: CfgHealth;
61
+ public cfg_knowbase: CfgKnowbase;
62
+ public cfg_leads: CfgLeads;
63
+ public cfg_newsletter: CfgNewsletter;
64
+ public cfg_payments: CfgPayments;
65
+ public cfg_support: CfgSupport;
66
+ public cfg_tasks: CfgTasks;
65
67
 
66
68
  constructor(
67
69
  baseUrl: string,
@@ -85,24 +87,25 @@ export class APIClient {
85
87
  }
86
88
 
87
89
  // Initialize sub-clients
88
- this.cfg_auth = new CfgAuthAPI(this);
89
- this.cfg_bulk_email = new CfgBulkEmailAPI(this);
90
- this.cfg_campaigns = new CfgCampaignsAPI(this);
91
- this.cfg_lead_submission = new CfgLeadSubmissionAPI(this);
92
- this.cfg_logs = new CfgLogsAPI(this);
93
- this.cfg_newsletters = new CfgNewslettersAPI(this);
94
- this.cfg_subscriptions = new CfgSubscriptionsAPI(this);
95
- this.cfg_testing = new CfgTestingAPI(this);
96
- this.cfg_user_profile = new CfgUserProfileAPI(this);
97
- this.cfg_webhooks = new CfgWebhooksAPI(this);
98
- this.cfg_accounts = new CfgAccountsAPI(this);
99
- this.cfg_endpoints = new CfgEndpointsAPI(this);
100
- this.cfg_health = new CfgHealthAPI(this);
101
- this.cfg_leads = new CfgLeadsAPI(this);
102
- this.cfg_newsletter = new CfgNewsletterAPI(this);
103
- this.cfg_payments = new CfgPaymentsAPI(this);
104
- this.cfg_support = new CfgSupportAPI(this);
105
- this.cfg_tasks = new CfgTasksAPI(this);
90
+ this.cfg_auth = new CfgAuth(this);
91
+ this.cfg_bulk_email = new CfgBulkEmail(this);
92
+ this.cfg_campaigns = new CfgCampaigns(this);
93
+ this.cfg_lead_submission = new CfgLeadSubmission(this);
94
+ this.cfg_logs = new CfgLogs(this);
95
+ this.cfg_newsletters = new CfgNewsletters(this);
96
+ this.cfg_subscriptions = new CfgSubscriptions(this);
97
+ this.cfg_testing = new CfgTesting(this);
98
+ this.cfg_user_profile = new CfgUserProfile(this);
99
+ this.cfg_webhooks = new CfgWebhooks(this);
100
+ this.cfg_accounts = new CfgAccounts(this);
101
+ this.cfg_endpoints = new CfgEndpoints(this);
102
+ this.cfg_health = new CfgHealth(this);
103
+ this.cfg_knowbase = new CfgKnowbase(this);
104
+ this.cfg_leads = new CfgLeads(this);
105
+ this.cfg_newsletter = new CfgNewsletter(this);
106
+ this.cfg_payments = new CfgPayments(this);
107
+ this.cfg_support = new CfgSupport(this);
108
+ this.cfg_tasks = new CfgTasks(this);
106
109
  }
107
110
 
108
111
  /**