@deepintel-ltd/farmpro-contracts 1.5.16 → 1.5.18
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/routes/auth.routes.d.ts +7 -0
- package/dist/routes/auth.routes.d.ts.map +1 -1
- package/dist/routes/payments.routes.d.ts +4 -4
- package/dist/routes/payments.routes.js +8 -8
- package/dist/routes/subscriptions.routes.d.ts +1387 -514
- package/dist/routes/subscriptions.routes.d.ts.map +1 -1
- package/dist/routes/subscriptions.routes.js +44 -2
- package/dist/schemas/auth.schemas.d.ts +8 -0
- package/dist/schemas/auth.schemas.d.ts.map +1 -1
- package/dist/schemas/auth.schemas.js +1 -0
- package/dist/schemas/payments.schemas.d.ts +65 -48
- package/dist/schemas/payments.schemas.d.ts.map +1 -1
- package/dist/schemas/payments.schemas.js +18 -15
- package/dist/schemas/subscriptions.schemas.d.ts +77 -29
- package/dist/schemas/subscriptions.schemas.d.ts.map +1 -1
- package/dist/schemas/subscriptions.schemas.js +20 -1
- package/package.json +1 -1
|
@@ -1029,25 +1029,30 @@ export declare const authRouter: {
|
|
|
1029
1029
|
type: z.ZodLiteral<"auth">;
|
|
1030
1030
|
attributes: z.ZodObject<{
|
|
1031
1031
|
redirectUri: z.ZodOptional<z.ZodString>;
|
|
1032
|
+
frontendCallbackUrl: z.ZodOptional<z.ZodString>;
|
|
1032
1033
|
source: z.ZodOptional<z.ZodString>;
|
|
1033
1034
|
}, "strip", z.ZodTypeAny, {
|
|
1034
1035
|
source?: string | undefined;
|
|
1035
1036
|
redirectUri?: string | undefined;
|
|
1037
|
+
frontendCallbackUrl?: string | undefined;
|
|
1036
1038
|
}, {
|
|
1037
1039
|
source?: string | undefined;
|
|
1038
1040
|
redirectUri?: string | undefined;
|
|
1041
|
+
frontendCallbackUrl?: string | undefined;
|
|
1039
1042
|
}>;
|
|
1040
1043
|
}, "strip", z.ZodTypeAny, {
|
|
1041
1044
|
type: "auth";
|
|
1042
1045
|
attributes: {
|
|
1043
1046
|
source?: string | undefined;
|
|
1044
1047
|
redirectUri?: string | undefined;
|
|
1048
|
+
frontendCallbackUrl?: string | undefined;
|
|
1045
1049
|
};
|
|
1046
1050
|
}, {
|
|
1047
1051
|
type: "auth";
|
|
1048
1052
|
attributes: {
|
|
1049
1053
|
source?: string | undefined;
|
|
1050
1054
|
redirectUri?: string | undefined;
|
|
1055
|
+
frontendCallbackUrl?: string | undefined;
|
|
1051
1056
|
};
|
|
1052
1057
|
}>;
|
|
1053
1058
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1056,6 +1061,7 @@ export declare const authRouter: {
|
|
|
1056
1061
|
attributes: {
|
|
1057
1062
|
source?: string | undefined;
|
|
1058
1063
|
redirectUri?: string | undefined;
|
|
1064
|
+
frontendCallbackUrl?: string | undefined;
|
|
1059
1065
|
};
|
|
1060
1066
|
};
|
|
1061
1067
|
}, {
|
|
@@ -1064,6 +1070,7 @@ export declare const authRouter: {
|
|
|
1064
1070
|
attributes: {
|
|
1065
1071
|
source?: string | undefined;
|
|
1066
1072
|
redirectUri?: string | undefined;
|
|
1073
|
+
frontendCallbackUrl?: string | undefined;
|
|
1067
1074
|
};
|
|
1068
1075
|
};
|
|
1069
1076
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.routes.d.ts","sourceRoot":"","sources":["../../src/routes/auth.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"auth.routes.d.ts","sourceRoot":"","sources":["../../src/routes/auth.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyLrB,CAAC"}
|
|
@@ -811,7 +811,7 @@ export declare const paymentsRouter: {
|
|
|
811
811
|
farmId: string;
|
|
812
812
|
}>;
|
|
813
813
|
summary: "Initialize payment";
|
|
814
|
-
description: "Create a payment intent and get
|
|
814
|
+
description: "Create a payment intent and get payment gateway link";
|
|
815
815
|
method: "POST";
|
|
816
816
|
body: z.ZodObject<{
|
|
817
817
|
data: z.ZodObject<{
|
|
@@ -1269,7 +1269,7 @@ export declare const paymentsRouter: {
|
|
|
1269
1269
|
farmId: string;
|
|
1270
1270
|
}>;
|
|
1271
1271
|
summary: "Verify payment";
|
|
1272
|
-
description: "Verify payment status with
|
|
1272
|
+
description: "Verify payment status with payment gateway";
|
|
1273
1273
|
method: "POST";
|
|
1274
1274
|
body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
1275
1275
|
path: "/farms/:farmId/payments/:id/verify";
|
|
@@ -1732,8 +1732,8 @@ export declare const paymentsRouter: {
|
|
|
1732
1732
|
};
|
|
1733
1733
|
};
|
|
1734
1734
|
webhook: {
|
|
1735
|
-
summary: "
|
|
1736
|
-
description: "Webhook endpoint for
|
|
1735
|
+
summary: "Payment webhook";
|
|
1736
|
+
description: "Webhook endpoint for payment gateway callbacks";
|
|
1737
1737
|
method: "POST";
|
|
1738
1738
|
body: z.ZodAny;
|
|
1739
1739
|
path: "/payments/webhook";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { paymentResponseSchema, paymentListResponseSchema,
|
|
3
|
+
import { paymentResponseSchema, paymentListResponseSchema, initPaymentSchema, initPaymentResponseSchema, } from '../schemas/payments.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, jsonApiSuccessResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, jsonApiIncludeQuerySchema, jsonApiFilterQuerySchema } from '../schemas/common.schemas';
|
|
5
5
|
const c = initContract();
|
|
6
6
|
export const paymentsRouter = c.router({
|
|
@@ -47,16 +47,16 @@ export const paymentsRouter = c.router({
|
|
|
47
47
|
method: 'POST',
|
|
48
48
|
path: '/farms/:farmId/payments/initialize',
|
|
49
49
|
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
50
|
-
body: z.object({ data:
|
|
50
|
+
body: z.object({ data: initPaymentSchema }),
|
|
51
51
|
responses: {
|
|
52
|
-
201:
|
|
52
|
+
201: initPaymentResponseSchema,
|
|
53
53
|
400: jsonApiErrorResponseSchema,
|
|
54
54
|
404: jsonApiErrorResponseSchema,
|
|
55
55
|
401: jsonApiErrorResponseSchema,
|
|
56
56
|
422: jsonApiErrorResponseSchema,
|
|
57
57
|
},
|
|
58
58
|
summary: 'Initialize payment',
|
|
59
|
-
description: 'Create a payment intent and get
|
|
59
|
+
description: 'Create a payment intent and get payment gateway link',
|
|
60
60
|
},
|
|
61
61
|
// Verify payment
|
|
62
62
|
verifyPayment: {
|
|
@@ -74,18 +74,18 @@ export const paymentsRouter = c.router({
|
|
|
74
74
|
400: jsonApiErrorResponseSchema,
|
|
75
75
|
},
|
|
76
76
|
summary: 'Verify payment',
|
|
77
|
-
description: 'Verify payment status with
|
|
77
|
+
description: 'Verify payment status with payment gateway',
|
|
78
78
|
},
|
|
79
79
|
// Webhook endpoint (public, no auth required)
|
|
80
80
|
webhook: {
|
|
81
81
|
method: 'POST',
|
|
82
82
|
path: '/payments/webhook',
|
|
83
|
-
body: z.any(), //
|
|
83
|
+
body: z.any(), // Payment gateway webhook payload
|
|
84
84
|
responses: {
|
|
85
85
|
200: jsonApiSuccessResponseSchema,
|
|
86
86
|
400: jsonApiErrorResponseSchema,
|
|
87
87
|
},
|
|
88
|
-
summary: '
|
|
89
|
-
description: 'Webhook endpoint for
|
|
88
|
+
summary: 'Payment webhook',
|
|
89
|
+
description: 'Webhook endpoint for payment gateway callbacks',
|
|
90
90
|
},
|
|
91
91
|
});
|