@zyacreatives/shared 2.5.7 → 2.5.8
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/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/schemas/payout-method.d.ts +2 -0
- package/dist/schemas/seller.d.ts +1 -0
- package/dist/schemas/transaction.d.ts +5 -0
- package/dist/schemas/transaction.js +8 -0
- package/package.json +1 -1
- package/src/constants.ts +2 -0
- package/src/schemas/product.ts +0 -1
- package/src/schemas/transaction.ts +9 -1
package/dist/constants.d.ts
CHANGED
|
@@ -289,6 +289,7 @@ export declare const COUNTRY_OF_OPERATION: {
|
|
|
289
289
|
export declare const GATEWAY_PROVIDER: {
|
|
290
290
|
readonly PAYSTACK: "PAYSTACK";
|
|
291
291
|
readonly STRIPE: "STRIPE";
|
|
292
|
+
readonly NONE: "NONE";
|
|
292
293
|
};
|
|
293
294
|
export declare const PRICING_MODELS: {
|
|
294
295
|
readonly FREE: "Free";
|
|
@@ -308,6 +309,7 @@ export declare const TRANSACTION_STATUSES: {
|
|
|
308
309
|
export declare const PAYMENT_PROVIDERS: {
|
|
309
310
|
readonly STRIPE: "STRIPE";
|
|
310
311
|
readonly PAYSTACK: "PAYSTACK";
|
|
312
|
+
readonly NONE: "NONE";
|
|
311
313
|
};
|
|
312
314
|
export type PaymentProvider = (typeof PAYMENT_PROVIDERS)[keyof typeof PAYMENT_PROVIDERS];
|
|
313
315
|
export type TransactionStatus = (typeof TRANSACTION_STATUSES)[keyof typeof TRANSACTION_STATUSES];
|
package/dist/constants.js
CHANGED
|
@@ -287,6 +287,7 @@ exports.COUNTRY_OF_OPERATION = {
|
|
|
287
287
|
exports.GATEWAY_PROVIDER = {
|
|
288
288
|
PAYSTACK: "PAYSTACK",
|
|
289
289
|
STRIPE: "STRIPE",
|
|
290
|
+
NONE: "NONE",
|
|
290
291
|
};
|
|
291
292
|
exports.PRICING_MODELS = {
|
|
292
293
|
FREE: "Free",
|
|
@@ -306,6 +307,7 @@ exports.TRANSACTION_STATUSES = {
|
|
|
306
307
|
exports.PAYMENT_PROVIDERS = {
|
|
307
308
|
STRIPE: "STRIPE",
|
|
308
309
|
PAYSTACK: "PAYSTACK",
|
|
310
|
+
NONE: "NONE",
|
|
309
311
|
};
|
|
310
312
|
exports.API_ROUTES = {
|
|
311
313
|
healthCheck: "/health",
|
|
@@ -5,6 +5,7 @@ export declare const PayoutMethodEntitySchema: z.ZodObject<{
|
|
|
5
5
|
provider: z.ZodEnum<{
|
|
6
6
|
readonly PAYSTACK: "PAYSTACK";
|
|
7
7
|
readonly STRIPE: "STRIPE";
|
|
8
|
+
readonly NONE: "NONE";
|
|
8
9
|
}>;
|
|
9
10
|
currency: z.ZodString;
|
|
10
11
|
bankName: z.ZodString;
|
|
@@ -25,6 +26,7 @@ export declare const CreatePayoutMethodEntitySchema: z.ZodObject<{
|
|
|
25
26
|
provider: z.ZodEnum<{
|
|
26
27
|
readonly PAYSTACK: "PAYSTACK";
|
|
27
28
|
readonly STRIPE: "STRIPE";
|
|
29
|
+
readonly NONE: "NONE";
|
|
28
30
|
}>;
|
|
29
31
|
bankName: z.ZodString;
|
|
30
32
|
accountLast4: z.ZodString;
|
package/dist/schemas/seller.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare const BaseTransactionSchema: z.ZodObject<{
|
|
|
36
36
|
paymentProvider: z.ZodEnum<{
|
|
37
37
|
readonly STRIPE: "STRIPE";
|
|
38
38
|
readonly PAYSTACK: "PAYSTACK";
|
|
39
|
+
readonly NONE: "NONE";
|
|
39
40
|
}>;
|
|
40
41
|
providerTransactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
42
|
discountApplied: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -54,8 +55,10 @@ export declare const InitTransactionInputSchema: z.ZodObject<{
|
|
|
54
55
|
paymentProvider: z.ZodEnum<{
|
|
55
56
|
readonly STRIPE: "STRIPE";
|
|
56
57
|
readonly PAYSTACK: "PAYSTACK";
|
|
58
|
+
readonly NONE: "NONE";
|
|
57
59
|
}>;
|
|
58
60
|
discountCode: z.ZodOptional<z.ZodString>;
|
|
61
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
59
62
|
}, z.core.$strip>;
|
|
60
63
|
export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
61
64
|
status: z.ZodDefault<z.ZodEnum<{
|
|
@@ -85,6 +88,7 @@ export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
|
85
88
|
paymentProvider: z.ZodEnum<{
|
|
86
89
|
readonly STRIPE: "STRIPE";
|
|
87
90
|
readonly PAYSTACK: "PAYSTACK";
|
|
91
|
+
readonly NONE: "NONE";
|
|
88
92
|
}>;
|
|
89
93
|
discountApplied: z.ZodOptional<z.ZodObject<{
|
|
90
94
|
code: z.ZodOptional<z.ZodString>;
|
|
@@ -133,6 +137,7 @@ export declare const TransactionEntitySchema: z.ZodObject<{
|
|
|
133
137
|
paymentProvider: z.ZodEnum<{
|
|
134
138
|
readonly STRIPE: "STRIPE";
|
|
135
139
|
readonly PAYSTACK: "PAYSTACK";
|
|
140
|
+
readonly NONE: "NONE";
|
|
136
141
|
}>;
|
|
137
142
|
providerTransactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
138
143
|
discountApplied: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -33,6 +33,14 @@ exports.InitTransactionInputSchema = zod_openapi_1.z.object({
|
|
|
33
33
|
.string()
|
|
34
34
|
.optional()
|
|
35
35
|
.openapi({ description: "Optional discount code applied at checkout" }),
|
|
36
|
+
amount: zod_openapi_1.z
|
|
37
|
+
.number()
|
|
38
|
+
.int("Amount must be a whole number (cents/kobo)")
|
|
39
|
+
.min(0)
|
|
40
|
+
.optional()
|
|
41
|
+
.openapi({
|
|
42
|
+
description: "Required for PWYW pricing. The amount the buyer chooses to pay in cents/kobo.",
|
|
43
|
+
}),
|
|
36
44
|
});
|
|
37
45
|
exports.CreateTransactionInputSchema = exports.BaseTransactionSchema.pick({
|
|
38
46
|
productId: true,
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -327,6 +327,7 @@ export const COUNTRY_OF_OPERATION = {
|
|
|
327
327
|
export const GATEWAY_PROVIDER = {
|
|
328
328
|
PAYSTACK: "PAYSTACK",
|
|
329
329
|
STRIPE: "STRIPE",
|
|
330
|
+
NONE: "NONE",
|
|
330
331
|
} as const;
|
|
331
332
|
|
|
332
333
|
export const PRICING_MODELS = {
|
|
@@ -350,6 +351,7 @@ export const TRANSACTION_STATUSES = {
|
|
|
350
351
|
export const PAYMENT_PROVIDERS = {
|
|
351
352
|
STRIPE: "STRIPE",
|
|
352
353
|
PAYSTACK: "PAYSTACK",
|
|
354
|
+
NONE: "NONE",
|
|
353
355
|
} as const;
|
|
354
356
|
|
|
355
357
|
export type PaymentProvider =
|
package/src/schemas/product.ts
CHANGED
|
@@ -42,9 +42,17 @@ export const InitTransactionInputSchema = z.object({
|
|
|
42
42
|
.string()
|
|
43
43
|
.optional()
|
|
44
44
|
.openapi({ description: "Optional discount code applied at checkout" }),
|
|
45
|
+
amount: z
|
|
46
|
+
.number()
|
|
47
|
+
.int("Amount must be a whole number (cents/kobo)")
|
|
48
|
+
.min(0)
|
|
49
|
+
.optional()
|
|
50
|
+
.openapi({
|
|
51
|
+
description:
|
|
52
|
+
"Required for PWYW pricing. The amount the buyer chooses to pay in cents/kobo.",
|
|
53
|
+
}),
|
|
45
54
|
});
|
|
46
55
|
|
|
47
|
-
|
|
48
56
|
export const CreateTransactionInputSchema = BaseTransactionSchema.pick({
|
|
49
57
|
productId: true,
|
|
50
58
|
buyerId: true,
|