@gigapay-dev/contracts 1.0.4 → 1.0.6

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.
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConfirmCodeRequestSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
+ const consts_1 = require("../consts");
8
9
  exports.ConfirmCodeRequestSchema = zod_1.default.object({
9
- code: zod_1.default.string().min(4),
10
+ code: zod_1.default.string().min(consts_1.CONFIRMATION_CODE_LENGTH),
10
11
  });
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UserResetRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const consts_1 = require("../consts");
5
6
  exports.UserResetRequestSchema = zod_1.z.object({
6
- email: zod_1.z.string().email(),
7
+ code: zod_1.z.string().min(consts_1.CONFIRMATION_CODE_LENGTH),
7
8
  password: zod_1.z.string().min(6),
8
9
  });
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONFIRMATION_CODE_LENGTH = void 0;
4
+ exports.CONFIRMATION_CODE_LENGTH = 4;
@@ -18,3 +18,4 @@ __exportStar(require("./auth"), exports);
18
18
  __exportStar(require("./orders"), exports);
19
19
  __exportStar(require("./promocodes"), exports);
20
20
  __exportStar(require("./refresh-sessions"), exports);
21
+ __exportStar(require("./consts"), exports);
@@ -1,8 +1,9 @@
1
1
  import z from "zod";
2
2
  import { UserLoginResponseSchema } from "./login";
3
+ import { CONFIRMATION_CODE_LENGTH } from "../consts";
3
4
 
4
5
  export const ConfirmCodeRequestSchema = z.object({
5
- code: z.string().min(4),
6
+ code: z.string().min(CONFIRMATION_CODE_LENGTH),
6
7
  });
7
8
 
8
9
  export type ConfirmCodeRequest = z.infer<typeof ConfirmCodeRequestSchema>;
@@ -1,7 +1,8 @@
1
1
  import { z } from "zod";
2
+ import { CONFIRMATION_CODE_LENGTH } from "../consts";
2
3
 
3
4
  export const UserResetRequestSchema = z.object({
4
- email: z.string().email(),
5
+ code: z.string().min(CONFIRMATION_CODE_LENGTH),
5
6
  password: z.string().min(6),
6
7
  });
7
8
 
@@ -0,0 +1 @@
1
+ export const CONFIRMATION_CODE_LENGTH = 4;
package/commands/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './auth';
2
2
  export * from './orders';
3
3
  export * from './promocodes';
4
- export * from './refresh-sessions';
4
+ export * from './refresh-sessions';
5
+ export * from './consts';
@@ -2,6 +2,7 @@ import z from "zod";
2
2
 
3
3
  export const OrderCreateRequestSchema = z.object({
4
4
  email: z.string().email(),
5
+ steamUsername: z.string(),
5
6
  amount: z.number().positive(),
6
7
  userId: z.number().positive().optional(),
7
8
  paymentMethodId: z.number().positive().optional(),
@@ -5,6 +5,7 @@ export const OrderReadResponseSchema = z.object({
5
5
  userId: z.number().positive().optional(),
6
6
  promocodeId: z.number().positive().optional(),
7
7
  status: z.string(),
8
+ steamUsername: z.string(),
8
9
  paymentId: z.number().positive(),
9
10
  paymentMethodId: z.number().positive().optional(),
10
11
  amount: z.number().positive(),
@@ -3,6 +3,7 @@ import { z } from "zod";
3
3
  export const OrderUpdateRequestSchema = z.object({
4
4
  email: z.string().email().optional(),
5
5
  amount: z.number().positive().optional(),
6
+ steamUsername: z.string().optional(),
6
7
  userId: z.number().positive().optional(),
7
8
  paymentMethodId: z.number().positive().optional(),
8
9
  promocodeId: z.number().positive().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gigapay-dev/contracts",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "main": "./build/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",