@gigapay-dev/contracts 1.6.7 → 1.6.9

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,13 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.OrderCreateResponseSchema = exports.OrderCreateRequestSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
+ const enums_1 = require("./enums");
8
9
  exports.OrderCreateRequestSchema = zod_1.default.object({
9
10
  email: zod_1.default.string().email(),
10
11
  steamUsername: zod_1.default.string(),
11
12
  amount: zod_1.default.coerce.number().nonnegative(),
12
13
  userId: zod_1.default.coerce.number().positive().optional(),
13
- paymentMethodId: zod_1.default.coerce.number().positive().optional(),
14
+ paymentMethodId: zod_1.default.coerce.number().positive(),
14
15
  promocodeId: zod_1.default.coerce.number().positive().optional(),
16
+ type: enums_1.OrderType.optional().default('MAIN'),
15
17
  });
16
18
  exports.OrderCreateResponseSchema = zod_1.default.object({
17
19
  redirectUrl: zod_1.default.string(),
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.OrderType = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.OrderType = zod_1.default.enum(["MAIN", "WEBAPP"]);
@@ -1,12 +1,14 @@
1
1
  import z from "zod";
2
+ import { OrderType } from "./enums";
2
3
 
3
4
  export const OrderCreateRequestSchema = z.object({
4
5
  email: z.string().email(),
5
6
  steamUsername: z.string(),
6
7
  amount: z.coerce.number().nonnegative(),
7
8
  userId: z.coerce.number().positive().optional(),
8
- paymentMethodId: z.coerce.number().positive().optional(),
9
+ paymentMethodId: z.coerce.number().positive(),
9
10
  promocodeId: z.coerce.number().positive().optional(),
11
+ type: OrderType.optional().default('MAIN'),
10
12
  });
11
13
 
12
14
  export const OrderCreateResponseSchema = z.object({
@@ -0,0 +1,7 @@
1
+ import z from "zod";
2
+
3
+ export const OrderType = z.enum(["MAIN", "WEBAPP"]);
4
+
5
+ export type OrderType = z.infer<typeof OrderType>;
6
+
7
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gigapay-dev/contracts",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
4
4
  "main": "./build/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",