@djangocfg/api 1.0.3 → 1.0.4
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 +599 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -114
- package/dist/index.d.ts +17 -114
- package/dist/index.mjs +308 -82
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/generated/_utils/schemas/PatchedPaymentRequest.schema.ts +0 -2
- package/src/cfg/generated/_utils/schemas/Payment.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/PaymentCreate.schema.ts +1 -2
- package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +1 -2
- package/src/cfg/generated/_utils/schemas/PaymentRequest.schema.ts +0 -2
- package/src/cfg/generated/cfg__payments/models.ts +6 -34
- package/src/cfg/generated/enums.ts +0 -44
- package/src/cfg/generated/index.ts +3 -2
- package/src/cfg/generated/schema.ts +13 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "DjangoCFG",
|
|
6
6
|
"url": "https://djangocfg.com"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@types/node": "^22.15.3",
|
|
69
69
|
"@types/react": "19.2.2",
|
|
70
70
|
"@types/react-dom": "19.2.1",
|
|
71
|
-
"@djangocfg/typescript-config": "^1.0.
|
|
71
|
+
"@djangocfg/typescript-config": "^1.0.4",
|
|
72
72
|
"react": "^19.1.0",
|
|
73
73
|
"react-dom": "^19.1.0",
|
|
74
74
|
"tsup": "^8.5.0",
|
|
@@ -16,8 +16,6 @@ Used for detail views and updates.
|
|
|
16
16
|
*/
|
|
17
17
|
export const PatchedPaymentRequestSchema = z.object({
|
|
18
18
|
amount_usd: z.number().min(1.0).max(50000.0).optional(),
|
|
19
|
-
currency: z.int().optional(),
|
|
20
|
-
network: z.int().nullable().optional(),
|
|
21
19
|
provider: z.nativeEnum(Enums.PatchedPaymentRequestProvider).optional(),
|
|
22
20
|
status: z.nativeEnum(Enums.PatchedPaymentRequestStatus).optional(),
|
|
23
21
|
callback_url: z.url().nullable().optional(),
|
|
@@ -19,8 +19,8 @@ export const PaymentSchema = z.object({
|
|
|
19
19
|
user: z.string(),
|
|
20
20
|
amount_usd: z.number().min(1.0).max(50000.0),
|
|
21
21
|
amount_crypto: z.number(),
|
|
22
|
-
currency: z.
|
|
23
|
-
network: z.
|
|
22
|
+
currency: z.string(),
|
|
23
|
+
network: z.string().nullable(),
|
|
24
24
|
provider: z.nativeEnum(Enums.PaymentProvider).optional(),
|
|
25
25
|
status: z.nativeEnum(Enums.PaymentStatus).optional(),
|
|
26
26
|
status_display: z.string(),
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
Validates input and delegates to PaymentService.
|
|
8
8
|
* */
|
|
9
9
|
import { z } from 'zod'
|
|
10
|
-
import * as Enums from '../../enums'
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Payment creation serializer with Pydantic integration.
|
|
@@ -16,7 +15,7 @@ Validates input and delegates to PaymentService.
|
|
|
16
15
|
*/
|
|
17
16
|
export const PaymentCreateSchema = z.object({
|
|
18
17
|
amount_usd: z.number().min(1.0).max(50000.0),
|
|
19
|
-
currency_code: z.
|
|
18
|
+
currency_code: z.string().max(10),
|
|
20
19
|
callback_url: z.url().optional(),
|
|
21
20
|
cancel_url: z.url().optional(),
|
|
22
21
|
description: z.string().max(500).optional(),
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
Validates input and delegates to PaymentService.
|
|
8
8
|
* */
|
|
9
9
|
import { z } from 'zod'
|
|
10
|
-
import * as Enums from '../../enums'
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Payment creation serializer with Pydantic integration.
|
|
@@ -16,7 +15,7 @@ Validates input and delegates to PaymentService.
|
|
|
16
15
|
*/
|
|
17
16
|
export const PaymentCreateRequestSchema = z.object({
|
|
18
17
|
amount_usd: z.number().min(1.0).max(50000.0),
|
|
19
|
-
currency_code: z.
|
|
18
|
+
currency_code: z.string().min(1).max(10),
|
|
20
19
|
callback_url: z.url().optional(),
|
|
21
20
|
cancel_url: z.url().optional(),
|
|
22
21
|
description: z.string().max(500).optional(),
|
|
@@ -16,8 +16,6 @@ Used for detail views and updates.
|
|
|
16
16
|
*/
|
|
17
17
|
export const PaymentRequestSchema = z.object({
|
|
18
18
|
amount_usd: z.number().min(1.0).max(50000.0),
|
|
19
|
-
currency: z.int(),
|
|
20
|
-
network: z.int().nullable().optional(),
|
|
21
19
|
provider: z.nativeEnum(Enums.PaymentRequestProvider).optional(),
|
|
22
20
|
status: z.nativeEnum(Enums.PaymentRequestStatus).optional(),
|
|
23
21
|
callback_url: z.url().nullable().optional(),
|
|
@@ -736,10 +736,8 @@ export interface Payment {
|
|
|
736
736
|
amount_usd: number;
|
|
737
737
|
/** Calculate crypto amount from USD amount and currency rate. */
|
|
738
738
|
amount_crypto: number;
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
/** Blockchain network (for crypto payments) */
|
|
742
|
-
network?: number | null;
|
|
739
|
+
currency: string;
|
|
740
|
+
network: string | null;
|
|
743
741
|
/** Payment provider
|
|
744
742
|
|
|
745
743
|
* `nowpayments` - NowPayments */
|
|
@@ -1070,17 +1068,8 @@ export interface PaginatedPaymentListList {
|
|
|
1070
1068
|
export interface PaymentCreateRequest {
|
|
1071
1069
|
/** Amount in USD (1.00 - 50,000.00) */
|
|
1072
1070
|
amount_usd: number;
|
|
1073
|
-
/** Cryptocurrency
|
|
1074
|
-
|
|
1075
|
-
* `BTC` - Bitcoin
|
|
1076
|
-
* `ETH` - Ethereum
|
|
1077
|
-
* `LTC` - Litecoin
|
|
1078
|
-
* `XMR` - Monero
|
|
1079
|
-
* `USDT` - Tether
|
|
1080
|
-
* `USDC` - USD Coin
|
|
1081
|
-
* `ADA` - Cardano
|
|
1082
|
-
* `DOT` - Polkadot */
|
|
1083
|
-
currency_code: Enums.PaymentCreateRequestCurrencyCode;
|
|
1071
|
+
/** Cryptocurrency code (validated against active currencies) */
|
|
1072
|
+
currency_code: string;
|
|
1084
1073
|
/** Success callback URL */
|
|
1085
1074
|
callback_url?: string;
|
|
1086
1075
|
/** Cancellation URL */
|
|
@@ -1100,17 +1089,8 @@ export interface PaymentCreateRequest {
|
|
|
1100
1089
|
export interface PaymentCreate {
|
|
1101
1090
|
/** Amount in USD (1.00 - 50,000.00) */
|
|
1102
1091
|
amount_usd: number;
|
|
1103
|
-
/** Cryptocurrency
|
|
1104
|
-
|
|
1105
|
-
* `BTC` - Bitcoin
|
|
1106
|
-
* `ETH` - Ethereum
|
|
1107
|
-
* `LTC` - Litecoin
|
|
1108
|
-
* `XMR` - Monero
|
|
1109
|
-
* `USDT` - Tether
|
|
1110
|
-
* `USDC` - USD Coin
|
|
1111
|
-
* `ADA` - Cardano
|
|
1112
|
-
* `DOT` - Polkadot */
|
|
1113
|
-
currency_code: Enums.PaymentCreateCurrencyCode;
|
|
1092
|
+
/** Cryptocurrency code (validated against active currencies) */
|
|
1093
|
+
currency_code: string;
|
|
1114
1094
|
/** Success callback URL */
|
|
1115
1095
|
callback_url?: string;
|
|
1116
1096
|
/** Cancellation URL */
|
|
@@ -1130,10 +1110,6 @@ export interface PaymentCreate {
|
|
|
1130
1110
|
export interface PaymentRequest {
|
|
1131
1111
|
/** Payment amount in USD (float for performance) */
|
|
1132
1112
|
amount_usd: number;
|
|
1133
|
-
/** Payment currency */
|
|
1134
|
-
currency: number;
|
|
1135
|
-
/** Blockchain network (for crypto payments) */
|
|
1136
|
-
network?: number | null;
|
|
1137
1113
|
/** Payment provider
|
|
1138
1114
|
|
|
1139
1115
|
* `nowpayments` - NowPayments */
|
|
@@ -1168,10 +1144,6 @@ export interface PaymentRequest {
|
|
|
1168
1144
|
export interface PatchedPaymentRequest {
|
|
1169
1145
|
/** Payment amount in USD (float for performance) */
|
|
1170
1146
|
amount_usd?: number;
|
|
1171
|
-
/** Payment currency */
|
|
1172
|
-
currency?: number;
|
|
1173
|
-
/** Blockchain network (for crypto payments) */
|
|
1174
|
-
network?: number | null;
|
|
1175
1147
|
/** Payment provider
|
|
1176
1148
|
|
|
1177
1149
|
* `nowpayments` - NowPayments */
|
|
@@ -527,50 +527,6 @@ export enum PaymentStatus {
|
|
|
527
527
|
REFUNDED = "refunded",
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
/**
|
|
531
|
-
* Cryptocurrency to receive
|
|
532
|
-
* * `BTC` - Bitcoin
|
|
533
|
-
* * `ETH` - Ethereum
|
|
534
|
-
* * `LTC` - Litecoin
|
|
535
|
-
* * `XMR` - Monero
|
|
536
|
-
* * `USDT` - Tether
|
|
537
|
-
* * `USDC` - USD Coin
|
|
538
|
-
* * `ADA` - Cardano
|
|
539
|
-
* * `DOT` - Polkadot
|
|
540
|
-
*/
|
|
541
|
-
export enum PaymentCreateCurrencyCode {
|
|
542
|
-
BTC = "BTC",
|
|
543
|
-
ETH = "ETH",
|
|
544
|
-
LTC = "LTC",
|
|
545
|
-
XMR = "XMR",
|
|
546
|
-
USDT = "USDT",
|
|
547
|
-
USDC = "USDC",
|
|
548
|
-
ADA = "ADA",
|
|
549
|
-
DOT = "DOT",
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* Cryptocurrency to receive
|
|
554
|
-
* * `BTC` - Bitcoin
|
|
555
|
-
* * `ETH` - Ethereum
|
|
556
|
-
* * `LTC` - Litecoin
|
|
557
|
-
* * `XMR` - Monero
|
|
558
|
-
* * `USDT` - Tether
|
|
559
|
-
* * `USDC` - USD Coin
|
|
560
|
-
* * `ADA` - Cardano
|
|
561
|
-
* * `DOT` - Polkadot
|
|
562
|
-
*/
|
|
563
|
-
export enum PaymentCreateRequestCurrencyCode {
|
|
564
|
-
BTC = "BTC",
|
|
565
|
-
ETH = "ETH",
|
|
566
|
-
LTC = "LTC",
|
|
567
|
-
XMR = "XMR",
|
|
568
|
-
USDT = "USDT",
|
|
569
|
-
USDC = "USDC",
|
|
570
|
-
ADA = "ADA",
|
|
571
|
-
DOT = "DOT",
|
|
572
|
-
}
|
|
573
|
-
|
|
574
530
|
/**
|
|
575
531
|
* Payment provider
|
|
576
532
|
* * `nowpayments` - NowPayments
|
|
@@ -83,11 +83,12 @@ export * as CfgSupportTypes from "./cfg__support/models";
|
|
|
83
83
|
export * as CfgTasksTypes from "./cfg__tasks/models";
|
|
84
84
|
export * as Enums from "./enums";
|
|
85
85
|
|
|
86
|
-
// Re-export Zod schemas for runtime validation
|
|
86
|
+
// Re-export Zod schemas for runtime validation
|
|
87
87
|
export * as Schemas from "./_utils/schemas";
|
|
88
88
|
|
|
89
|
-
// Re-export typed fetchers for universal usage
|
|
89
|
+
// Re-export typed fetchers for universal usage
|
|
90
90
|
export * as Fetchers from "./_utils/fetchers";
|
|
91
|
+
export * from "./_utils/fetchers";
|
|
91
92
|
|
|
92
93
|
// Re-export API instance configuration functions
|
|
93
94
|
export {
|
|
@@ -6698,10 +6698,6 @@ export const OPENAPI_SCHEMA = {
|
|
|
6698
6698
|
"nullable": true,
|
|
6699
6699
|
"type": "string"
|
|
6700
6700
|
},
|
|
6701
|
-
"currency": {
|
|
6702
|
-
"description": "Payment currency",
|
|
6703
|
-
"type": "integer"
|
|
6704
|
-
},
|
|
6705
6701
|
"description": {
|
|
6706
6702
|
"description": "Payment description",
|
|
6707
6703
|
"type": "string"
|
|
@@ -6712,11 +6708,6 @@ export const OPENAPI_SCHEMA = {
|
|
|
6712
6708
|
"nullable": true,
|
|
6713
6709
|
"type": "string"
|
|
6714
6710
|
},
|
|
6715
|
-
"network": {
|
|
6716
|
-
"description": "Blockchain network (for crypto payments)",
|
|
6717
|
-
"nullable": true,
|
|
6718
|
-
"type": "integer"
|
|
6719
|
-
},
|
|
6720
6711
|
"provider": {
|
|
6721
6712
|
"description": "Payment provider\n\n* `nowpayments` - NowPayments",
|
|
6722
6713
|
"enum": [
|
|
@@ -6891,8 +6882,8 @@ export const OPENAPI_SCHEMA = {
|
|
|
6891
6882
|
"type": "string"
|
|
6892
6883
|
},
|
|
6893
6884
|
"currency": {
|
|
6894
|
-
"
|
|
6895
|
-
"type": "
|
|
6885
|
+
"readOnly": true,
|
|
6886
|
+
"type": "string"
|
|
6896
6887
|
},
|
|
6897
6888
|
"description": {
|
|
6898
6889
|
"description": "Payment description",
|
|
@@ -6931,9 +6922,9 @@ export const OPENAPI_SCHEMA = {
|
|
|
6931
6922
|
"type": "boolean"
|
|
6932
6923
|
},
|
|
6933
6924
|
"network": {
|
|
6934
|
-
"description": "Blockchain network (for crypto payments)",
|
|
6935
6925
|
"nullable": true,
|
|
6936
|
-
"
|
|
6926
|
+
"readOnly": true,
|
|
6927
|
+
"type": "string"
|
|
6937
6928
|
},
|
|
6938
6929
|
"pay_address": {
|
|
6939
6930
|
"description": "Cryptocurrency payment address",
|
|
@@ -7011,6 +7002,7 @@ export const OPENAPI_SCHEMA = {
|
|
|
7011
7002
|
"is_expired",
|
|
7012
7003
|
"is_failed",
|
|
7013
7004
|
"is_pending",
|
|
7005
|
+
"network",
|
|
7014
7006
|
"pay_address",
|
|
7015
7007
|
"payment_url",
|
|
7016
7008
|
"provider_payment_id",
|
|
@@ -7066,19 +7058,9 @@ export const OPENAPI_SCHEMA = {
|
|
|
7066
7058
|
"type": "string"
|
|
7067
7059
|
},
|
|
7068
7060
|
"currency_code": {
|
|
7069
|
-
"description": "Cryptocurrency
|
|
7070
|
-
"
|
|
7071
|
-
|
|
7072
|
-
"ETH",
|
|
7073
|
-
"LTC",
|
|
7074
|
-
"XMR",
|
|
7075
|
-
"USDT",
|
|
7076
|
-
"USDC",
|
|
7077
|
-
"ADA",
|
|
7078
|
-
"DOT"
|
|
7079
|
-
],
|
|
7080
|
-
"type": "string",
|
|
7081
|
-
"x-spec-enum-id": "a26a773d0d4fed5c"
|
|
7061
|
+
"description": "Cryptocurrency code (validated against active currencies)",
|
|
7062
|
+
"maxLength": 10,
|
|
7063
|
+
"type": "string"
|
|
7082
7064
|
},
|
|
7083
7065
|
"description": {
|
|
7084
7066
|
"description": "Payment description",
|
|
@@ -7116,19 +7098,10 @@ export const OPENAPI_SCHEMA = {
|
|
|
7116
7098
|
"type": "string"
|
|
7117
7099
|
},
|
|
7118
7100
|
"currency_code": {
|
|
7119
|
-
"description": "Cryptocurrency
|
|
7120
|
-
"
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
"LTC",
|
|
7124
|
-
"XMR",
|
|
7125
|
-
"USDT",
|
|
7126
|
-
"USDC",
|
|
7127
|
-
"ADA",
|
|
7128
|
-
"DOT"
|
|
7129
|
-
],
|
|
7130
|
-
"type": "string",
|
|
7131
|
-
"x-spec-enum-id": "a26a773d0d4fed5c"
|
|
7101
|
+
"description": "Cryptocurrency code (validated against active currencies)",
|
|
7102
|
+
"maxLength": 10,
|
|
7103
|
+
"minLength": 1,
|
|
7104
|
+
"type": "string"
|
|
7132
7105
|
},
|
|
7133
7106
|
"description": {
|
|
7134
7107
|
"description": "Payment description",
|
|
@@ -7331,10 +7304,6 @@ export const OPENAPI_SCHEMA = {
|
|
|
7331
7304
|
"nullable": true,
|
|
7332
7305
|
"type": "string"
|
|
7333
7306
|
},
|
|
7334
|
-
"currency": {
|
|
7335
|
-
"description": "Payment currency",
|
|
7336
|
-
"type": "integer"
|
|
7337
|
-
},
|
|
7338
7307
|
"description": {
|
|
7339
7308
|
"description": "Payment description",
|
|
7340
7309
|
"type": "string"
|
|
@@ -7345,11 +7314,6 @@ export const OPENAPI_SCHEMA = {
|
|
|
7345
7314
|
"nullable": true,
|
|
7346
7315
|
"type": "string"
|
|
7347
7316
|
},
|
|
7348
|
-
"network": {
|
|
7349
|
-
"description": "Blockchain network (for crypto payments)",
|
|
7350
|
-
"nullable": true,
|
|
7351
|
-
"type": "integer"
|
|
7352
|
-
},
|
|
7353
7317
|
"provider": {
|
|
7354
7318
|
"description": "Payment provider\n\n* `nowpayments` - NowPayments",
|
|
7355
7319
|
"enum": [
|
|
@@ -7375,8 +7339,7 @@ export const OPENAPI_SCHEMA = {
|
|
|
7375
7339
|
}
|
|
7376
7340
|
},
|
|
7377
7341
|
"required": [
|
|
7378
|
-
"amount_usd"
|
|
7379
|
-
"currency"
|
|
7342
|
+
"amount_usd"
|
|
7380
7343
|
],
|
|
7381
7344
|
"type": "object"
|
|
7382
7345
|
},
|