@gigapay-dev/contracts 1.1.1 → 1.1.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/build/commands/auth/endpoints.js +17 -0
- package/build/commands/orders/create.js +4 -4
- package/build/commands/orders/read.js +6 -6
- package/build/commands/orders/update.js +4 -4
- package/build/commands/promocode-activations/read.js +3 -3
- package/commands/auth/endpoints.ts +13 -0
- package/commands/orders/create.ts +4 -4
- package/commands/orders/read.ts +6 -6
- package/commands/orders/update.ts +4 -4
- package/commands/promocode-activations/read.ts +3 -3
- package/package.json +1 -1
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.AuthEndpoints = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
4
8
|
const login_1 = require("./login");
|
|
5
9
|
const register_1 = require("./register");
|
|
6
10
|
const confirm_1 = require("./confirm");
|
|
11
|
+
const reset_1 = require("./reset");
|
|
7
12
|
exports.AuthEndpoints = {
|
|
8
13
|
login: {
|
|
9
14
|
method: "POST",
|
|
@@ -17,6 +22,18 @@ exports.AuthEndpoints = {
|
|
|
17
22
|
request: register_1.UserRegisterRequestSchema,
|
|
18
23
|
response: login_1.UserLoginResponseSchema,
|
|
19
24
|
},
|
|
25
|
+
refresh: {
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: "/auth/refresh",
|
|
28
|
+
request: zod_1.default.void(),
|
|
29
|
+
response: login_1.UserLoginResponseSchema,
|
|
30
|
+
},
|
|
31
|
+
reset: {
|
|
32
|
+
method: "POST",
|
|
33
|
+
path: "/auth/reset",
|
|
34
|
+
request: reset_1.UserResetRequestSchema,
|
|
35
|
+
response: zod_1.default.void(),
|
|
36
|
+
},
|
|
20
37
|
confirm: {
|
|
21
38
|
method: "GET",
|
|
22
39
|
path: "/auth/confirm-code/:code",
|
|
@@ -8,10 +8,10 @@ const zod_1 = __importDefault(require("zod"));
|
|
|
8
8
|
exports.OrderCreateRequestSchema = zod_1.default.object({
|
|
9
9
|
email: zod_1.default.string().email(),
|
|
10
10
|
steamUsername: zod_1.default.string(),
|
|
11
|
-
amount: zod_1.default.number().positive(),
|
|
12
|
-
userId: zod_1.default.number().positive().optional(),
|
|
13
|
-
paymentMethodId: zod_1.default.number().positive().optional(),
|
|
14
|
-
promocodeId: zod_1.default.number().positive().optional(),
|
|
11
|
+
amount: zod_1.default.coerce.number().positive(),
|
|
12
|
+
userId: zod_1.default.coerce.number().positive().optional(),
|
|
13
|
+
paymentMethodId: zod_1.default.coerce.number().positive().optional(),
|
|
14
|
+
promocodeId: zod_1.default.coerce.number().positive().optional(),
|
|
15
15
|
});
|
|
16
16
|
exports.OrderCreateResponseSchema = zod_1.default.object({
|
|
17
17
|
redirectUrl: zod_1.default.string(),
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OrderReadResponseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.OrderReadResponseSchema = zod_1.z.object({
|
|
6
|
-
id: zod_1.z.number().positive(),
|
|
7
|
-
userId: zod_1.z.number().positive().optional(),
|
|
8
|
-
promocodeId: zod_1.z.number().positive().optional(),
|
|
6
|
+
id: zod_1.z.coerce.number().positive(),
|
|
7
|
+
userId: zod_1.z.coerce.number().positive().optional(),
|
|
8
|
+
promocodeId: zod_1.z.coerce.number().positive().optional(),
|
|
9
9
|
status: zod_1.z.string(),
|
|
10
10
|
steamUsername: zod_1.z.string(),
|
|
11
|
-
paymentId: zod_1.z.number().positive(),
|
|
12
|
-
paymentMethodId: zod_1.z.number().positive().optional(),
|
|
13
|
-
amount: zod_1.z.number().positive(),
|
|
11
|
+
paymentId: zod_1.z.coerce.number().positive(),
|
|
12
|
+
paymentMethodId: zod_1.z.coerce.number().positive().optional(),
|
|
13
|
+
amount: zod_1.z.coerce.number().positive(),
|
|
14
14
|
createdAt: zod_1.z.coerce.date().default(() => new Date()),
|
|
15
15
|
updatedAt: zod_1.z.coerce.date().default(() => new Date()),
|
|
16
16
|
});
|
|
@@ -4,9 +4,9 @@ exports.OrderUpdateRequestSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.OrderUpdateRequestSchema = zod_1.z.object({
|
|
6
6
|
email: zod_1.z.string().email().optional(),
|
|
7
|
-
amount: zod_1.z.number().positive().optional(),
|
|
7
|
+
amount: zod_1.z.coerce.number().positive().optional(),
|
|
8
8
|
steamUsername: zod_1.z.string().optional(),
|
|
9
|
-
userId: zod_1.z.number().positive().optional(),
|
|
10
|
-
paymentMethodId: zod_1.z.number().positive().optional(),
|
|
11
|
-
promocodeId: zod_1.z.number().positive().optional(),
|
|
9
|
+
userId: zod_1.z.coerce.number().positive().optional(),
|
|
10
|
+
paymentMethodId: zod_1.z.coerce.number().positive().optional(),
|
|
11
|
+
promocodeId: zod_1.z.coerce.number().positive().optional(),
|
|
12
12
|
});
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.PromoCodeActivationReadResponseSchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
exports.PromoCodeActivationReadResponseSchema = zod_1.default.object({
|
|
9
|
-
id: zod_1.default.number().positive(),
|
|
10
|
-
promocodeId: zod_1.default.number().positive(),
|
|
11
|
-
refferalId: zod_1.default.number().positive(),
|
|
9
|
+
id: zod_1.default.coerce.number().positive(),
|
|
10
|
+
promocodeId: zod_1.default.coerce.number().positive(),
|
|
11
|
+
refferalId: zod_1.default.coerce.number().positive(),
|
|
12
12
|
discountValue: zod_1.default.string(),
|
|
13
13
|
activatedAt: zod_1.default.coerce.date(),
|
|
14
14
|
});
|
|
@@ -3,6 +3,7 @@ import { UserLoginRequestSchema, UserLoginResponseSchema } from "./login";
|
|
|
3
3
|
import { UserRegisterRequestSchema } from "./register";
|
|
4
4
|
import { EndpointContract } from "../../types";
|
|
5
5
|
import { ConfirmCodeRequestSchema } from "./confirm";
|
|
6
|
+
import { UserResetRequestSchema } from "./reset";
|
|
6
7
|
|
|
7
8
|
export const AuthEndpoints = {
|
|
8
9
|
login: {
|
|
@@ -17,6 +18,18 @@ export const AuthEndpoints = {
|
|
|
17
18
|
request: UserRegisterRequestSchema,
|
|
18
19
|
response: UserLoginResponseSchema,
|
|
19
20
|
},
|
|
21
|
+
refresh: {
|
|
22
|
+
method: "GET",
|
|
23
|
+
path: "/auth/refresh",
|
|
24
|
+
request: z.void(),
|
|
25
|
+
response: UserLoginResponseSchema,
|
|
26
|
+
},
|
|
27
|
+
reset: {
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: "/auth/reset",
|
|
30
|
+
request: UserResetRequestSchema,
|
|
31
|
+
response: z.void(),
|
|
32
|
+
},
|
|
20
33
|
confirm: {
|
|
21
34
|
method: "GET",
|
|
22
35
|
path: "/auth/confirm-code/:code",
|
|
@@ -3,10 +3,10 @@ import z from "zod";
|
|
|
3
3
|
export const OrderCreateRequestSchema = z.object({
|
|
4
4
|
email: z.string().email(),
|
|
5
5
|
steamUsername: z.string(),
|
|
6
|
-
amount: z.number().positive(),
|
|
7
|
-
userId: z.number().positive().optional(),
|
|
8
|
-
paymentMethodId: z.number().positive().optional(),
|
|
9
|
-
promocodeId: z.number().positive().optional(),
|
|
6
|
+
amount: z.coerce.number().positive(),
|
|
7
|
+
userId: z.coerce.number().positive().optional(),
|
|
8
|
+
paymentMethodId: z.coerce.number().positive().optional(),
|
|
9
|
+
promocodeId: z.coerce.number().positive().optional(),
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export const OrderCreateResponseSchema = z.object({
|
package/commands/orders/read.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const OrderReadResponseSchema = z.object({
|
|
4
|
-
id: z.number().positive(),
|
|
5
|
-
userId: z.number().positive().optional(),
|
|
6
|
-
promocodeId: z.number().positive().optional(),
|
|
4
|
+
id: z.coerce.number().positive(),
|
|
5
|
+
userId: z.coerce.number().positive().optional(),
|
|
6
|
+
promocodeId: z.coerce.number().positive().optional(),
|
|
7
7
|
status: z.string(),
|
|
8
8
|
steamUsername: z.string(),
|
|
9
|
-
paymentId: z.number().positive(),
|
|
10
|
-
paymentMethodId: z.number().positive().optional(),
|
|
11
|
-
amount: z.number().positive(),
|
|
9
|
+
paymentId: z.coerce.number().positive(),
|
|
10
|
+
paymentMethodId: z.coerce.number().positive().optional(),
|
|
11
|
+
amount: z.coerce.number().positive(),
|
|
12
12
|
createdAt: z.coerce.date().default(() => new Date()),
|
|
13
13
|
updatedAt: z.coerce.date().default(() => new Date()),
|
|
14
14
|
});
|
|
@@ -2,11 +2,11 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
export const OrderUpdateRequestSchema = z.object({
|
|
4
4
|
email: z.string().email().optional(),
|
|
5
|
-
amount: z.number().positive().optional(),
|
|
5
|
+
amount: z.coerce.number().positive().optional(),
|
|
6
6
|
steamUsername: z.string().optional(),
|
|
7
|
-
userId: z.number().positive().optional(),
|
|
8
|
-
paymentMethodId: z.number().positive().optional(),
|
|
9
|
-
promocodeId: z.number().positive().optional(),
|
|
7
|
+
userId: z.coerce.number().positive().optional(),
|
|
8
|
+
paymentMethodId: z.coerce.number().positive().optional(),
|
|
9
|
+
promocodeId: z.coerce.number().positive().optional(),
|
|
10
10
|
})
|
|
11
11
|
|
|
12
12
|
export type OrderUpdateRequest = z.infer<typeof OrderUpdateRequestSchema>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
|
|
3
3
|
export const PromoCodeActivationReadResponseSchema = z.object({
|
|
4
|
-
id: z.number().positive(),
|
|
5
|
-
promocodeId: z.number().positive(),
|
|
6
|
-
refferalId: z.number().positive(),
|
|
4
|
+
id: z.coerce.number().positive(),
|
|
5
|
+
promocodeId: z.coerce.number().positive(),
|
|
6
|
+
refferalId: z.coerce.number().positive(),
|
|
7
7
|
discountValue: z.string(),
|
|
8
8
|
activatedAt: z.coerce.date(),
|
|
9
9
|
});
|