@deallony/shared 1.2.61 → 1.2.62

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.
@@ -1,9 +1,11 @@
1
1
  import { z } from "zod";
2
2
  import type { IAd } from "../../types/ad/Ad";
3
3
  import { createAdSchema, saveAdSchema, updateAdSchema } from "../../schema/ad/save-ad.schema";
4
+ import { findAdSchema } from "../../schema/ad/find-ad.schema";
4
5
  export type CreateAdDto = z.infer<typeof createAdSchema>;
5
6
  export type UpdateAdDto = z.infer<typeof updateAdSchema>;
6
7
  export type SaveAdDto = z.infer<typeof saveAdSchema>;
8
+ export type FindAdDto = z.input<typeof findAdSchema>;
7
9
  export declare const AdDto: (params: {
8
10
  ad: IAd;
9
11
  }) => IAd;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Body of `POST api/v1/ads/find-one/:id`. Loading an ad counts a view unless `track_view` is false:
4
+ * only the ad details page should count, not the chat preview, the edit form or promotion screens.
5
+ * The viewer comes from the auth token, never from the body.
6
+ */
7
+ export declare const findAdSchema: z.ZodObject<{
8
+ track_view: z.ZodDefault<z.ZodBoolean>;
9
+ }, z.core.$strip>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findAdSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Body of `POST api/v1/ads/find-one/:id`. Loading an ad counts a view unless `track_view` is false:
7
+ * only the ad details page should count, not the chat preview, the edit form or promotion screens.
8
+ * The viewer comes from the auth token, never from the body.
9
+ */
10
+ exports.findAdSchema = zod_1.z.object({
11
+ track_view: zod_1.z.boolean().default(true),
12
+ });
@@ -1 +1,2 @@
1
1
  export * from './save-ad.schema';
2
+ export * from './find-ad.schema';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./save-ad.schema"), exports);
18
+ __exportStar(require("./find-ad.schema"), exports);
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Body of `POST api/v1/ads/find-one/:id`. Loading an ad counts a view unless `track_view` is false:
4
+ * only the ad details page should count, not the chat preview, the edit form or promotion screens.
5
+ * The viewer comes from the auth token, never from the body.
6
+ */
7
+ export const findAdSchema = z.object({
8
+ track_view: z.boolean().default(true),
9
+ });
@@ -1 +1,2 @@
1
1
  export * from './save-ad.schema.js';
2
+ export * from './find-ad.schema.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deallony/shared",
3
- "version": "1.2.61",
3
+ "version": "1.2.62",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",