lancer-shared 1.0.99 → 1.0.101

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.
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ export declare const bidSuccessSchema: z.ZodObject<{
3
+ status: z.ZodLiteral<"success">;
4
+ biddingAmount: z.ZodNumber;
5
+ boosted: z.ZodBoolean;
6
+ boostingAmount: z.ZodNumber;
7
+ cookies: z.ZodArray<z.ZodAny, "many">;
8
+ }, "strip", z.ZodTypeAny, {
9
+ status: "success";
10
+ cookies: any[];
11
+ biddingAmount: number;
12
+ boosted: boolean;
13
+ boostingAmount: number;
14
+ }, {
15
+ status: "success";
16
+ cookies: any[];
17
+ biddingAmount: number;
18
+ boosted: boolean;
19
+ boostingAmount: number;
20
+ }>;
21
+ export declare const bidFailedSchema: z.ZodObject<{
22
+ status: z.ZodLiteral<"failed">;
23
+ errorMessage: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ status: "failed";
26
+ errorMessage: string;
27
+ }, {
28
+ status: "failed";
29
+ errorMessage: string;
30
+ }>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bidFailedSchema = exports.bidSuccessSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.bidSuccessSchema = zod_1.z.object({
6
+ status: zod_1.z.literal('success'),
7
+ biddingAmount: zod_1.z.number(),
8
+ boosted: zod_1.z.boolean(),
9
+ boostingAmount: zod_1.z.number(),
10
+ cookies: zod_1.z.array(zod_1.z.any()),
11
+ });
12
+ exports.bidFailedSchema = zod_1.z.object({
13
+ status: zod_1.z.literal('failed'),
14
+ errorMessage: zod_1.z.string(),
15
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const bidResultSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
2
+ export declare const bidSuccessSchema: z.ZodObject<{
3
3
  status: z.ZodLiteral<"success">;
4
4
  biddingAmount: z.ZodNumber;
5
5
  boosted: z.ZodBoolean;
@@ -17,7 +17,8 @@ export declare const bidResultSchema: z.ZodDiscriminatedUnion<"status", [z.ZodOb
17
17
  biddingAmount: number;
18
18
  boosted: boolean;
19
19
  boostingAmount: number;
20
- }>, z.ZodObject<{
20
+ }>;
21
+ export declare const bidFailedSchema: z.ZodObject<{
21
22
  status: z.ZodLiteral<"failed">;
22
23
  errorMessage: z.ZodString;
23
24
  }, "strip", z.ZodTypeAny, {
@@ -26,4 +27,4 @@ export declare const bidResultSchema: z.ZodDiscriminatedUnion<"status", [z.ZodOb
26
27
  }, {
27
28
  status: "failed";
28
29
  errorMessage: string;
29
- }>]>;
30
+ }>;
@@ -1,19 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bidResultSchema = void 0;
3
+ exports.bidFailedSchema = exports.bidSuccessSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.bidResultSchema = zod_1.z.discriminatedUnion('status', [
6
- // Success case
7
- zod_1.z.object({
8
- status: zod_1.z.literal('success'),
9
- biddingAmount: zod_1.z.number(),
10
- boosted: zod_1.z.boolean(),
11
- boostingAmount: zod_1.z.number(),
12
- cookies: zod_1.z.array(zod_1.z.any()),
13
- }),
14
- // Failed case
15
- zod_1.z.object({
16
- status: zod_1.z.literal('failed'),
17
- errorMessage: zod_1.z.string(),
18
- }),
19
- ]);
5
+ exports.bidSuccessSchema = zod_1.z.object({
6
+ status: zod_1.z.literal('success'),
7
+ biddingAmount: zod_1.z.number(),
8
+ boosted: zod_1.z.boolean(),
9
+ boostingAmount: zod_1.z.number(),
10
+ cookies: zod_1.z.array(zod_1.z.any()),
11
+ });
12
+ exports.bidFailedSchema = zod_1.z.object({
13
+ status: zod_1.z.literal('failed'),
14
+ errorMessage: zod_1.z.string(),
15
+ });
@@ -1,2 +1,2 @@
1
1
  export * from './bid';
2
- export * from './bid-status';
2
+ export * from './bid-result';
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./bid"), exports);
18
- __exportStar(require("./bid-status"), exports);
18
+ __exportStar(require("./bid-result"), exports);
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ import { bidSuccessSchema, bidFailedSchema } from '../../schemas/bid/bid-result';
3
+ export type BidSuccess = z.infer<typeof bidSuccessSchema>;
4
+ export type BidFailed = z.infer<typeof bidFailedSchema>;
5
+ export type BidResult = BidSuccess | BidFailed;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { bidResultSchema } from '../../schemas/bid';
3
- export type BidResult = z.infer<typeof bidResultSchema>;
2
+ import { bidSuccessSchema, bidFailedSchema } from '../../schemas/bid/bid-status';
3
+ export type BidSuccess = z.infer<typeof bidSuccessSchema>;
4
+ export type BidFailed = z.infer<typeof bidFailedSchema>;
5
+ export type BidStatus = BidSuccess | BidFailed;
@@ -1,2 +1,2 @@
1
1
  export * from './bid';
2
- export * from './bid-status';
2
+ export * from './bid-result';
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./bid"), exports);
18
- __exportStar(require("./bid-status"), exports);
18
+ __exportStar(require("./bid-result"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "lancer-shared",
4
- "version": "1.0.99",
4
+ "version": "1.0.101",
5
5
  "description": "This package contains shared stuff.",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",