@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.
- package/dist/index.cjs +17641 -8457
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14654 -5066
- package/dist/index.d.ts +14654 -5066
- package/dist/index.mjs +17885 -8728
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -17
- package/src/cfg/contexts/payments/ApiKeysContext.tsx +2 -2
- package/src/cfg/contexts/payments/CurrenciesContext.tsx +0 -26
- package/src/cfg/contexts/payments/OverviewContext.tsx +79 -0
- package/src/cfg/contexts/payments/RootPaymentsContext.tsx +137 -0
- package/src/cfg/contexts/payments/index.ts +13 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +6 -6
- package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__health.ts +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +876 -0
- package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +6 -6
- package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +3 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +6 -6
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +3 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +181 -179
- package/src/cfg/generated/_utils/fetchers/cfg__payments__webhooks.ts +5 -5
- package/src/cfg/generated/_utils/fetchers/cfg__support.ts +12 -12
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +10 -10
- package/src/cfg/generated/_utils/fetchers/index.ts +1 -0
- package/src/cfg/generated/_utils/hooks/cfg__knowbase.ts +997 -0
- package/src/cfg/generated/_utils/hooks/cfg__payments.ts +12 -10
- package/src/cfg/generated/_utils/hooks/index.ts +1 -0
- package/src/cfg/generated/_utils/schemas/APIKeyValidationResponse.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/AdminPaymentDetail.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/AdminPaymentList.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItem.schema.ts +33 -0
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunk.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunkDetail.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunkRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ArchiveItemDetail.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/ArchiveItemRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ArchiveProcessingResult.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/ArchiveSearchRequestRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ArchiveSearchResult.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ArchiveStatistics.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/ChatHistory.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ChatMessage.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/ChatQueryRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ChatResponse.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/ChatResponseRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/ChatSession.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/ChatSessionCreateRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ChatSessionRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ChatSource.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ChatSourceRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ChunkRevectorizationRequestRequest.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CurrencyList.schema.ts +2 -0
- package/src/cfg/generated/_utils/schemas/CurrencyRates.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/Document.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/DocumentArchive.schema.ts +44 -0
- package/src/cfg/generated/_utils/schemas/DocumentArchiveDetail.schema.ts +48 -0
- package/src/cfg/generated/_utils/schemas/DocumentArchiveList.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/DocumentArchiveRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/DocumentCategory.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/DocumentCategoryRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/DocumentCreateRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/DocumentProcessingStatus.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/DocumentRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/DocumentStats.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/Network.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PaginatedArchiveItemChunkList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedArchiveItemList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedArchiveSearchResultList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedChatResponseList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedChatSessionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedDocumentArchiveListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedDocumentList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedPublicCategoryList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedPublicDocumentListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PatchedArchiveItemChunkRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PatchedArchiveItemRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PatchedChatResponseRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PatchedChatSessionRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/PatchedDocumentArchiveRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/PatchedDocumentRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/Payment.schema.ts +1 -0
- package/src/cfg/generated/_utils/schemas/PaymentCreate.schema.ts +0 -1
- package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +0 -1
- package/src/cfg/generated/_utils/schemas/PaymentsMetrics.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ProviderCurrency.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PublicCategory.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/PublicDocument.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/PublicDocumentList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/SupportedCurrencies.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/VectorizationResult.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/VectorizationStatistics.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/index.ts +54 -0
- package/src/cfg/generated/cfg__accounts/client.ts +1 -1
- package/src/cfg/generated/cfg__accounts__auth/client.ts +1 -1
- package/src/cfg/generated/cfg__accounts__user_profile/client.ts +1 -1
- package/src/cfg/generated/cfg__endpoints/client.ts +1 -1
- package/src/cfg/generated/cfg__health/client.ts +1 -1
- package/src/cfg/generated/cfg__knowbase/client.ts +666 -0
- package/src/cfg/generated/cfg__knowbase/index.ts +2 -0
- package/src/cfg/generated/cfg__knowbase/models.ts +1120 -0
- package/src/cfg/generated/cfg__leads/client.ts +1 -1
- package/src/cfg/generated/cfg__leads__lead_submission/client.ts +1 -1
- package/src/cfg/generated/cfg__newsletter/client.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__bulk_email/client.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__campaigns/client.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__logs/client.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__newsletters/client.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__subscriptions/client.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__testing/client.ts +1 -1
- package/src/cfg/generated/cfg__payments/client.ts +25 -45
- package/src/cfg/generated/cfg__payments/models.ts +46 -12
- package/src/cfg/generated/cfg__payments__webhooks/client.ts +1 -1
- package/src/cfg/generated/cfg__support/client.ts +1 -1
- package/src/cfg/generated/cfg__tasks/client.ts +1 -1
- package/src/cfg/generated/client.ts +57 -54
- package/src/cfg/generated/enums.ts +269 -16
- package/src/cfg/generated/index.ts +82 -29
- package/src/cfg/generated/schema.ts +10238 -4386
- package/src/index.ts +23 -1
|
@@ -4,7 +4,7 @@ import * as Models from "./models";
|
|
|
4
4
|
/**
|
|
5
5
|
* API endpoints for Payments.
|
|
6
6
|
*/
|
|
7
|
-
export class
|
|
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
|
-
*
|
|
294
|
-
*
|
|
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
|
-
*
|
|
311
|
-
*
|
|
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
|
-
*
|
|
320
|
-
*
|
|
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
|
-
*
|
|
329
|
-
*
|
|
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
|
-
*
|
|
338
|
-
*
|
|
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
|
-
*
|
|
347
|
-
*
|
|
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(
|
|
592
|
-
const
|
|
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(
|
|
630
|
-
const
|
|
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
|
/**
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
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:
|
|
48
|
-
public cfg_bulk_email:
|
|
49
|
-
public cfg_campaigns:
|
|
50
|
-
public cfg_lead_submission:
|
|
51
|
-
public cfg_logs:
|
|
52
|
-
public cfg_newsletters:
|
|
53
|
-
public cfg_subscriptions:
|
|
54
|
-
public cfg_testing:
|
|
55
|
-
public cfg_user_profile:
|
|
56
|
-
public cfg_webhooks:
|
|
57
|
-
public cfg_accounts:
|
|
58
|
-
public cfg_endpoints:
|
|
59
|
-
public cfg_health:
|
|
60
|
-
public
|
|
61
|
-
public
|
|
62
|
-
public
|
|
63
|
-
public
|
|
64
|
-
public
|
|
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
|
|
89
|
-
this.cfg_bulk_email = new
|
|
90
|
-
this.cfg_campaigns = new
|
|
91
|
-
this.cfg_lead_submission = new
|
|
92
|
-
this.cfg_logs = new
|
|
93
|
-
this.cfg_newsletters = new
|
|
94
|
-
this.cfg_subscriptions = new
|
|
95
|
-
this.cfg_testing = new
|
|
96
|
-
this.cfg_user_profile = new
|
|
97
|
-
this.cfg_webhooks = new
|
|
98
|
-
this.cfg_accounts = new
|
|
99
|
-
this.cfg_endpoints = new
|
|
100
|
-
this.cfg_health = new
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
105
|
-
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
|
/**
|