@gigapay-dev/contracts 1.0.8 → 1.1.0

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.
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./auth"), exports);
18
18
  __exportStar(require("./orders"), exports);
19
19
  __exportStar(require("./promocodes"), exports);
20
+ __exportStar(require("./promocode-activations"), exports);
20
21
  __exportStar(require("./refresh-sessions"), exports);
21
22
  __exportStar(require("./consts"), exports);
22
23
  __exportStar(require("./pagination"), exports);
@@ -7,8 +7,8 @@ exports.PromoCodeCreateSchema = zod_1.z.object({
7
7
  value: zod_1.z.string(),
8
8
  discountValue: zod_1.z.string(),
9
9
  expiredAt: zod_1.z.coerce.date().nullable().optional(),
10
- activationLimit: zod_1.z.number().positive().nullable().optional(),
11
- activationPerUserLimit: zod_1.z.number().positive().nullable().optional(),
10
+ activationLimit: zod_1.z.coerce.number().positive().nullable().optional(),
11
+ activationPerUserLimit: zod_1.z.coerce.number().positive().nullable().optional(),
12
12
  type: enums_1.PromoCodeType,
13
13
  status: enums_1.PromoCodeStatus,
14
14
  });
@@ -7,12 +7,12 @@ exports.PromoCodeReadResponseSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
8
  const enums_1 = require("./enums");
9
9
  exports.PromoCodeReadResponseSchema = zod_1.default.object({
10
- id: zod_1.default.number().positive(),
10
+ id: zod_1.default.coerce.number().positive(),
11
11
  value: zod_1.default.string(),
12
12
  discountValue: zod_1.default.string(),
13
13
  expiredAt: zod_1.default.coerce.date().nullable().optional(),
14
- activationLimit: zod_1.default.number().positive().nullable().optional(),
15
- activationPerUserLimit: zod_1.default.number().positive().nullable().optional(),
14
+ activationLimit: zod_1.default.coerce.number().positive().nullable().optional(),
15
+ activationPerUserLimit: zod_1.default.coerce.number().positive().nullable().optional(),
16
16
  type: enums_1.PromoCodeType,
17
17
  status: enums_1.PromoCodeStatus,
18
18
  });
@@ -7,8 +7,8 @@ exports.PromoCodeUpdateSchema = zod_1.z.object({
7
7
  value: zod_1.z.string().optional(),
8
8
  discountValue: zod_1.z.string().optional(),
9
9
  expiredAt: zod_1.z.coerce.date().nullable().optional(),
10
- activationLimit: zod_1.z.number().positive().nullable().optional(),
11
- activationPerUserLimit: zod_1.z.number().positive().nullable().optional(),
10
+ activationLimit: zod_1.z.coerce.number().positive().nullable().optional(),
11
+ activationPerUserLimit: zod_1.z.coerce.number().positive().nullable().optional(),
12
12
  type: enums_1.PromoCodeType.optional(),
13
13
  status: enums_1.PromoCodeStatus.optional(),
14
14
  });
package/commands/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './auth';
2
2
  export * from './orders';
3
3
  export * from './promocodes';
4
+ export * from './promocode-activations';
4
5
  export * from './refresh-sessions';
5
6
  export * from './consts';
6
7
  export * from './pagination';
@@ -5,8 +5,8 @@ export const PromoCodeCreateSchema = z.object({
5
5
  value: z.string(),
6
6
  discountValue: z.string(),
7
7
  expiredAt: z.coerce.date().nullable().optional(),
8
- activationLimit: z.number().positive().nullable().optional(),
9
- activationPerUserLimit: z.number().positive().nullable().optional(),
8
+ activationLimit: z.coerce.number().positive().nullable().optional(),
9
+ activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
10
10
  type: PromoCodeType,
11
11
  status: PromoCodeStatus,
12
12
  });
@@ -2,12 +2,12 @@ import z from "zod";
2
2
  import { PromoCodeStatus, PromoCodeType } from "./enums";
3
3
 
4
4
  export const PromoCodeReadResponseSchema = z.object({
5
- id: z.number().positive(),
5
+ id: z.coerce.number().positive(),
6
6
  value: z.string(),
7
7
  discountValue: z.string(),
8
8
  expiredAt: z.coerce.date().nullable().optional(),
9
- activationLimit: z.number().positive().nullable().optional(),
10
- activationPerUserLimit: z.number().positive().nullable().optional(),
9
+ activationLimit: z.coerce.number().positive().nullable().optional(),
10
+ activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
11
11
  type: PromoCodeType,
12
12
  status: PromoCodeStatus,
13
13
  });
@@ -5,8 +5,8 @@ export const PromoCodeUpdateSchema = z.object({
5
5
  value: z.string().optional(),
6
6
  discountValue: z.string().optional(),
7
7
  expiredAt: z.coerce.date().nullable().optional(),
8
- activationLimit: z.number().positive().nullable().optional(),
9
- activationPerUserLimit: z.number().positive().nullable().optional(),
8
+ activationLimit: z.coerce.number().positive().nullable().optional(),
9
+ activationPerUserLimit: z.coerce.number().positive().nullable().optional(),
10
10
  type: PromoCodeType.optional(),
11
11
  status: PromoCodeStatus.optional(),
12
12
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gigapay-dev/contracts",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "main": "./build/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",