@deliverart/sdk-js-payment 0.0.4 → 1.1.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.
- package/package.json +11 -26
- package/.changeset/config.json +0 -11
- package/.github/workflows/workflow.yml +0 -47
- package/.prettierrc +0 -7
- package/CHANGELOG.md +0 -55
- package/README.md +0 -3
- package/dist/index.cjs +0 -1122
- package/dist/index.d.cts +0 -4422
- package/dist/index.d.ts +0 -4422
- package/dist/index.js +0 -1006
- package/eslint.config.js +0 -41
- package/src/index.ts +0 -3
- package/src/models.ts +0 -168
- package/src/requests/index.ts +0 -2
- package/src/requests/payment-configs/DeletePaymentConfig.ts +0 -27
- package/src/requests/payment-configs/GetPaymentConfigDetails.ts +0 -33
- package/src/requests/payment-configs/GetPaymentConfigs.ts +0 -50
- package/src/requests/payment-configs/bank-transfer/CreatePaymentConfigBankTransfer.ts +0 -38
- package/src/requests/payment-configs/bank-transfer/DeletePaymentConfigBankTransfer.ts +0 -27
- package/src/requests/payment-configs/bank-transfer/GetPaymentConfigBankTransferDetails.ts +0 -37
- package/src/requests/payment-configs/bank-transfer/GetPaymentConfigBankTransferList.ts +0 -54
- package/src/requests/payment-configs/bank-transfer/UpdatePaymentConfigBankTransfer.ts +0 -45
- package/src/requests/payment-configs/bank-transfer/index.ts +0 -5
- package/src/requests/payment-configs/cash/CreatePaymentConfigCash.ts +0 -36
- package/src/requests/payment-configs/cash/DeletePaymentConfigCash.ts +0 -27
- package/src/requests/payment-configs/cash/GetPaymentConfigCashDetails.ts +0 -33
- package/src/requests/payment-configs/cash/GetPaymentConfigCashList.ts +0 -52
- package/src/requests/payment-configs/cash/index.ts +0 -4
- package/src/requests/payment-configs/credit-card/CreatePaymentConfigCreditCard.ts +0 -38
- package/src/requests/payment-configs/credit-card/DeletePaymentConfigCreditCard.ts +0 -27
- package/src/requests/payment-configs/credit-card/GetPaymentConfigCreditCardDetails.ts +0 -36
- package/src/requests/payment-configs/credit-card/GetPaymentConfigCreditCardList.ts +0 -54
- package/src/requests/payment-configs/credit-card/index.ts +0 -4
- package/src/requests/payment-configs/index.ts +0 -7
- package/src/requests/payment-configs/stripe/CreatePaymentConfigStripe.ts +0 -36
- package/src/requests/payment-configs/stripe/DeletePaymentConfigStripe.ts +0 -27
- package/src/requests/payment-configs/stripe/GetPaymentConfigStripeDetails.ts +0 -33
- package/src/requests/payment-configs/stripe/GetPaymentConfigStripeList.ts +0 -53
- package/src/requests/payment-configs/stripe/UpdatePaymentConfigStripe.ts +0 -43
- package/src/requests/payment-configs/stripe/index.ts +0 -5
- package/src/requests/payments/DeletePayment.ts +0 -27
- package/src/requests/payments/GetPaymentDetails.ts +0 -30
- package/src/requests/payments/GetPayments.ts +0 -45
- package/src/requests/payments/GetPaymentsForPaymentConfig.ts +0 -53
- package/src/requests/payments/UpdatePayment.ts +0 -32
- package/src/requests/payments/index.ts +0 -5
- package/src/types.ts +0 -194
- package/tsconfig.json +0 -15
package/src/types.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const paymentMethods = ['stripe', 'bank_transfer', 'cash', 'credit_card'] as const
|
|
4
|
-
export const paymentMethodSchema = z.enum(paymentMethods)
|
|
5
|
-
export type PaymentMethod = z.infer<typeof paymentMethodSchema>
|
|
6
|
-
|
|
7
|
-
export const paymentStatuses = [
|
|
8
|
-
'pending',
|
|
9
|
-
'pending_verification',
|
|
10
|
-
'paid',
|
|
11
|
-
'canceled',
|
|
12
|
-
'refunded',
|
|
13
|
-
'failed',
|
|
14
|
-
] as const
|
|
15
|
-
export const paymentStatusSchema = z.enum(paymentStatuses)
|
|
16
|
-
export type PaymentStatus = z.infer<typeof paymentStatusSchema>
|
|
17
|
-
|
|
18
|
-
export const paymentPathSchema = z
|
|
19
|
-
.string()
|
|
20
|
-
.refine(
|
|
21
|
-
val =>
|
|
22
|
-
/^\/payments\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
23
|
-
val,
|
|
24
|
-
),
|
|
25
|
-
{
|
|
26
|
-
message: 'Invalid payment path format',
|
|
27
|
-
},
|
|
28
|
-
)
|
|
29
|
-
export type PaymentPath = z.infer<typeof paymentPathSchema>
|
|
30
|
-
|
|
31
|
-
export const paymentNullablePathSchema = z
|
|
32
|
-
.string()
|
|
33
|
-
.nullable()
|
|
34
|
-
.refine(
|
|
35
|
-
val => {
|
|
36
|
-
if (!val) return true
|
|
37
|
-
return /^\/payments\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
38
|
-
val,
|
|
39
|
-
)
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
message: 'Invalid payment path format',
|
|
43
|
-
},
|
|
44
|
-
)
|
|
45
|
-
export type PaymentNullablePath = z.infer<typeof paymentNullablePathSchema>
|
|
46
|
-
|
|
47
|
-
export const paymentConfigPathSchema = z
|
|
48
|
-
.string()
|
|
49
|
-
.refine(
|
|
50
|
-
val =>
|
|
51
|
-
/^\/payment_configs\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
52
|
-
val,
|
|
53
|
-
),
|
|
54
|
-
{
|
|
55
|
-
message: 'Invalid paymentConfig path format',
|
|
56
|
-
},
|
|
57
|
-
)
|
|
58
|
-
export type PaymentConfigPath = z.infer<typeof paymentConfigPathSchema>
|
|
59
|
-
|
|
60
|
-
export const paymentConfigNullablePathSchema = z
|
|
61
|
-
.string()
|
|
62
|
-
.nullable()
|
|
63
|
-
.refine(
|
|
64
|
-
val => {
|
|
65
|
-
if (!val) return true
|
|
66
|
-
return /^\/payment_configs\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
67
|
-
val,
|
|
68
|
-
)
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
message: 'Invalid paymentConfig path format',
|
|
72
|
-
},
|
|
73
|
-
)
|
|
74
|
-
export type PaymentConfigNullablePath = z.infer<typeof paymentConfigNullablePathSchema>
|
|
75
|
-
|
|
76
|
-
export const paymentConfigBankTransferPathSchema = z
|
|
77
|
-
.string()
|
|
78
|
-
.refine(
|
|
79
|
-
val =>
|
|
80
|
-
/^\/payment_configs\/bank_transfer\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
81
|
-
val,
|
|
82
|
-
),
|
|
83
|
-
{
|
|
84
|
-
message: 'Invalid paymentConfigBankTransfer path format',
|
|
85
|
-
},
|
|
86
|
-
)
|
|
87
|
-
export type PaymentConfigBankTransferPath = z.infer<typeof paymentConfigBankTransferPathSchema>
|
|
88
|
-
|
|
89
|
-
export const paymentConfigBankTransferNullablePathSchema = z
|
|
90
|
-
.string()
|
|
91
|
-
.nullable()
|
|
92
|
-
.refine(
|
|
93
|
-
val => {
|
|
94
|
-
if (!val) return true
|
|
95
|
-
return /^\/payment_configs\/bank_transfer\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
96
|
-
val,
|
|
97
|
-
)
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
message: 'Invalid paymentConfigBankTransfer path format',
|
|
101
|
-
},
|
|
102
|
-
)
|
|
103
|
-
export type PaymentConfigBankTransferNullablePath = z.infer<
|
|
104
|
-
typeof paymentConfigBankTransferNullablePathSchema
|
|
105
|
-
>
|
|
106
|
-
|
|
107
|
-
export const paymentConfigCashPathSchema = z
|
|
108
|
-
.string()
|
|
109
|
-
.refine(
|
|
110
|
-
val =>
|
|
111
|
-
/^\/payment_configs\/cash\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
112
|
-
val,
|
|
113
|
-
),
|
|
114
|
-
{
|
|
115
|
-
message: 'Invalid paymentConfigCash path format',
|
|
116
|
-
},
|
|
117
|
-
)
|
|
118
|
-
export type PaymentConfigCashPath = z.infer<typeof paymentConfigCashPathSchema>
|
|
119
|
-
|
|
120
|
-
export const paymentConfigCashNullablePathSchema = z
|
|
121
|
-
.string()
|
|
122
|
-
.nullable()
|
|
123
|
-
.refine(
|
|
124
|
-
val => {
|
|
125
|
-
if (!val) return true
|
|
126
|
-
return /^\/payment_configs\/cash\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
127
|
-
val,
|
|
128
|
-
)
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
message: 'Invalid paymentConfigCash path format',
|
|
132
|
-
},
|
|
133
|
-
)
|
|
134
|
-
export type PaymentConfigCashNullablePath = z.infer<typeof paymentConfigCashNullablePathSchema>
|
|
135
|
-
|
|
136
|
-
export const paymentConfigCreditCardPathSchema = z
|
|
137
|
-
.string()
|
|
138
|
-
.refine(
|
|
139
|
-
val =>
|
|
140
|
-
/^\/payment_configs\/credit_card\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
141
|
-
val,
|
|
142
|
-
),
|
|
143
|
-
{
|
|
144
|
-
message: 'Invalid paymentConfigCreditCard path format',
|
|
145
|
-
},
|
|
146
|
-
)
|
|
147
|
-
export type PaymentConfigCreditCardPath = z.infer<typeof paymentConfigCreditCardPathSchema>
|
|
148
|
-
|
|
149
|
-
export const paymentConfigCreditCardNullablePathSchema = z
|
|
150
|
-
.string()
|
|
151
|
-
.nullable()
|
|
152
|
-
.refine(
|
|
153
|
-
val => {
|
|
154
|
-
if (!val) return true
|
|
155
|
-
return /^\/payment_configs\/credit_card\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
156
|
-
val,
|
|
157
|
-
)
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
message: 'Invalid paymentConfigCreditCard path format',
|
|
161
|
-
},
|
|
162
|
-
)
|
|
163
|
-
export type PaymentConfigCreditCardNullablePath = z.infer<
|
|
164
|
-
typeof paymentConfigCreditCardNullablePathSchema
|
|
165
|
-
>
|
|
166
|
-
|
|
167
|
-
export const paymentConfigStripePathSchema = z
|
|
168
|
-
.string()
|
|
169
|
-
.refine(
|
|
170
|
-
val =>
|
|
171
|
-
/^\/payment_configs\/stripe\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
172
|
-
val,
|
|
173
|
-
),
|
|
174
|
-
{
|
|
175
|
-
message: 'Invalid paymentConfigStripe path format',
|
|
176
|
-
},
|
|
177
|
-
)
|
|
178
|
-
export type PaymentConfigStripePath = z.infer<typeof paymentConfigStripePathSchema>
|
|
179
|
-
|
|
180
|
-
export const paymentConfigStripeNullablePathSchema = z
|
|
181
|
-
.string()
|
|
182
|
-
.nullable()
|
|
183
|
-
.refine(
|
|
184
|
-
val => {
|
|
185
|
-
if (!val) return true
|
|
186
|
-
return /^\/payment_configs\/stripe\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
|
|
187
|
-
val,
|
|
188
|
-
)
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
message: 'Invalid paymentConfigStripe path format',
|
|
192
|
-
},
|
|
193
|
-
)
|
|
194
|
-
export type PaymentConfigStripeNullablePath = z.infer<typeof paymentConfigStripeNullablePathSchema>
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Node",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"forceConsistentCasingInFileNames": true,
|
|
8
|
-
"strict": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"outDir": "dist",
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationMap": true
|
|
13
|
-
},
|
|
14
|
-
"include": ["src"]
|
|
15
|
-
}
|