@deallony/shared 1.2.62 → 1.2.64
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.
- package/dist/cjs/constants/routes/app.d.ts +7 -0
- package/dist/cjs/constants/routes/app.js +2 -0
- package/dist/cjs/dto/ad/Ad.dto.d.ts +3 -0
- package/dist/cjs/schema/ad/ad-views.schema.d.ts +12 -0
- package/dist/cjs/schema/ad/ad-views.schema.js +15 -0
- package/dist/cjs/schema/ad/index.d.ts +1 -0
- package/dist/cjs/schema/ad/index.js +1 -0
- package/dist/cjs/types/ad/AdDailyViews.d.ts +19 -0
- package/dist/cjs/types/ad/AdDailyViews.js +2 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.js +3 -2
- package/dist/esm/constants/routes/app.js +2 -0
- package/dist/esm/schema/ad/ad-views.schema.js +12 -0
- package/dist/esm/schema/ad/index.js +1 -0
- package/dist/esm/types/ad/AdDailyViews.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/package.json +1 -1
|
@@ -71,6 +71,13 @@ export declare const APP_ROUTES: {
|
|
|
71
71
|
ad_id: string | number;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
+
/** The owner's views report for an ad */
|
|
75
|
+
readonly viewsReport: (id: number | string) => {
|
|
76
|
+
pathname: string;
|
|
77
|
+
params: {
|
|
78
|
+
id: string | number;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
74
81
|
readonly promotionDetails: (params: {
|
|
75
82
|
id: number | string;
|
|
76
83
|
ad_id?: number | string;
|
|
@@ -36,6 +36,8 @@ exports.APP_ROUTES = {
|
|
|
36
36
|
pathname: "/ad/promotions/history/[ad_id]",
|
|
37
37
|
params: { ad_id: params.id },
|
|
38
38
|
}),
|
|
39
|
+
/** The owner's views report for an ad */
|
|
40
|
+
viewsReport: (id) => ({ pathname: "/ad/views-report/[id]", params: { id } }),
|
|
39
41
|
promotionDetails: (params) => ({
|
|
40
42
|
pathname: "/ad/promotions/details/[id]",
|
|
41
43
|
params: {
|
|
@@ -2,10 +2,13 @@ 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
4
|
import { findAdSchema } from "../../schema/ad/find-ad.schema";
|
|
5
|
+
import { adDailyViewsSchema, adViewsReportSchema } from "../../schema/ad/ad-views.schema";
|
|
5
6
|
export type CreateAdDto = z.infer<typeof createAdSchema>;
|
|
6
7
|
export type UpdateAdDto = z.infer<typeof updateAdSchema>;
|
|
7
8
|
export type SaveAdDto = z.infer<typeof saveAdSchema>;
|
|
8
9
|
export type FindAdDto = z.input<typeof findAdSchema>;
|
|
10
|
+
export type AdDailyViewsDto = z.input<typeof adDailyViewsSchema>;
|
|
11
|
+
export type AdViewsReportDto = z.input<typeof adViewsReportSchema>;
|
|
9
12
|
export declare const AdDto: (params: {
|
|
10
13
|
ad: IAd;
|
|
11
14
|
}) => IAd;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Most days of per-day views kept on the server (older merged days are deleted) */
|
|
3
|
+
export declare const AD_DAILY_VIEWS_MAX_DAYS = 180;
|
|
4
|
+
/** Body of `POST api/v1/ads/views-daily/:id`: the owner's views per day for the last `days` days */
|
|
5
|
+
export declare const adDailyViewsSchema: z.ZodObject<{
|
|
6
|
+
days: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
/** Body of `POST api/v1/ads/views-report/:id`: one page of the owner's daily view records */
|
|
9
|
+
export declare const adViewsReportSchema: z.ZodObject<{
|
|
10
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
11
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adViewsReportSchema = exports.adDailyViewsSchema = exports.AD_DAILY_VIEWS_MAX_DAYS = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/** Most days of per-day views kept on the server (older merged days are deleted) */
|
|
6
|
+
exports.AD_DAILY_VIEWS_MAX_DAYS = 180;
|
|
7
|
+
/** Body of `POST api/v1/ads/views-daily/:id`: the owner's views per day for the last `days` days */
|
|
8
|
+
exports.adDailyViewsSchema = zod_1.z.object({
|
|
9
|
+
days: zod_1.z.coerce.number().int().min(1).max(exports.AD_DAILY_VIEWS_MAX_DAYS).default(30),
|
|
10
|
+
});
|
|
11
|
+
/** Body of `POST api/v1/ads/views-report/:id`: one page of the owner's daily view records */
|
|
12
|
+
exports.adViewsReportSchema = zod_1.z.object({
|
|
13
|
+
page: zod_1.z.coerce.number().int().min(1).default(1),
|
|
14
|
+
limit: zod_1.z.coerce.number().int().min(1).max(100).default(15),
|
|
15
|
+
});
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./save-ad.schema"), exports);
|
|
18
18
|
__exportStar(require("./find-ad.schema"), exports);
|
|
19
|
+
__exportStar(require("./ad-views.schema"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Views of an ad on one day (YYYY-MM-DD, Asia/Damascus) */
|
|
2
|
+
export type IAdDailyViews = {
|
|
3
|
+
day: string;
|
|
4
|
+
views: number;
|
|
5
|
+
};
|
|
6
|
+
/** Header of the owner's views report */
|
|
7
|
+
export type IAdViewsReportSummary = {
|
|
8
|
+
/** All-time views, including today's */
|
|
9
|
+
total_views: number;
|
|
10
|
+
today: number;
|
|
11
|
+
last_7_days: number;
|
|
12
|
+
last_30_days: number;
|
|
13
|
+
/** Average views per day over the last 30 days */
|
|
14
|
+
daily_average: number;
|
|
15
|
+
/** The day with the most views among the kept daily records */
|
|
16
|
+
best_day: IAdDailyViews | null;
|
|
17
|
+
/** First day with a daily record (records are kept for 180 days) */
|
|
18
|
+
tracked_since: string | null;
|
|
19
|
+
};
|
|
@@ -7,6 +7,7 @@ export * as ModuleFetchEndpoints from "./common/ModuleFetchEndpointsLastUpdated"
|
|
|
7
7
|
export * as FilterParams from "./common/FilterParams";
|
|
8
8
|
export * as Ad from "./ad/Ad";
|
|
9
9
|
export * as AdLocation from "./ad/AdLocation";
|
|
10
|
+
export * as AdDailyViews from "./ad/AdDailyViews";
|
|
10
11
|
export * as Addresses from "./addresses/Address";
|
|
11
12
|
export * as AdPromotion from "./ad/AdPromotion";
|
|
12
13
|
export * as Motor from "./motor/Motor";
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
exports.Payment = exports.Analysis = exports.GeminiApiKey = exports.Google = exports.Kyc = exports.SocialMediaProfile = exports.SocialMediaPlatform = exports.Image = exports.Media = exports.File = exports.NotificationToken = exports.MessageTemplate = exports.Device = exports.Chat = exports.AppStartScreen = exports.MetaData = exports.Company = exports.PotentialUser = void 0;
|
|
39
|
+
exports.Favorite = exports.Wallet = exports.Permission = exports.Role = exports.User = exports.EventVenue = exports.EventWedding = exports.EventTimeline = exports.EventRsvp = exports.Event = exports.District = exports.City = exports.AdminBoundary = exports.WorkType = exports.UsedProductCondition = exports.UsedProductAge = exports.Unit = exports.Transmission = exports.RegionalSpec = exports.PublisherType = exports.PropertyStatus = exports.PriceType = exports.OfferType = exports.LicenseType = exports.FuelType = exports.Feature = exports.Facility = exports.Currency = exports.Color = exports.CategoryWorkType = exports.Category = exports.CarBody = exports.UsedProduct = exports.Service = exports.PropertySubType = exports.Property = exports.MotorTrim = exports.Motor = exports.AdPromotion = exports.Addresses = exports.AdDailyViews = exports.AdLocation = exports.Ad = exports.FilterParams = exports.ModuleFetchEndpoints = exports.Config = exports.AccessType = exports.Status = exports.Response = exports.LocalizedName = void 0;
|
|
40
|
+
exports.Payment = exports.Analysis = exports.GeminiApiKey = exports.Google = exports.Kyc = exports.SocialMediaProfile = exports.SocialMediaPlatform = exports.Image = exports.Media = exports.File = exports.NotificationToken = exports.MessageTemplate = exports.Device = exports.Chat = exports.AppStartScreen = exports.MetaData = exports.Company = exports.PotentialUser = exports.Loyalty = void 0;
|
|
41
41
|
// common
|
|
42
42
|
exports.LocalizedName = __importStar(require("./common/LocalizedName"));
|
|
43
43
|
exports.Response = __importStar(require("./common/Response"));
|
|
@@ -49,6 +49,7 @@ exports.FilterParams = __importStar(require("./common/FilterParams"));
|
|
|
49
49
|
// listings
|
|
50
50
|
exports.Ad = __importStar(require("./ad/Ad"));
|
|
51
51
|
exports.AdLocation = __importStar(require("./ad/AdLocation"));
|
|
52
|
+
exports.AdDailyViews = __importStar(require("./ad/AdDailyViews"));
|
|
52
53
|
exports.Addresses = __importStar(require("./addresses/Address"));
|
|
53
54
|
exports.AdPromotion = __importStar(require("./ad/AdPromotion"));
|
|
54
55
|
exports.Motor = __importStar(require("./motor/Motor"));
|
|
@@ -33,6 +33,8 @@ export const APP_ROUTES = {
|
|
|
33
33
|
pathname: "/ad/promotions/history/[ad_id]",
|
|
34
34
|
params: { ad_id: params.id },
|
|
35
35
|
}),
|
|
36
|
+
/** The owner's views report for an ad */
|
|
37
|
+
viewsReport: (id) => ({ pathname: "/ad/views-report/[id]", params: { id } }),
|
|
36
38
|
promotionDetails: (params) => ({
|
|
37
39
|
pathname: "/ad/promotions/details/[id]",
|
|
38
40
|
params: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Most days of per-day views kept on the server (older merged days are deleted) */
|
|
3
|
+
export const AD_DAILY_VIEWS_MAX_DAYS = 180;
|
|
4
|
+
/** Body of `POST api/v1/ads/views-daily/:id`: the owner's views per day for the last `days` days */
|
|
5
|
+
export const adDailyViewsSchema = z.object({
|
|
6
|
+
days: z.coerce.number().int().min(1).max(AD_DAILY_VIEWS_MAX_DAYS).default(30),
|
|
7
|
+
});
|
|
8
|
+
/** Body of `POST api/v1/ads/views-report/:id`: one page of the owner's daily view records */
|
|
9
|
+
export const adViewsReportSchema = z.object({
|
|
10
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
11
|
+
limit: z.coerce.number().int().min(1).max(100).default(15),
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/types/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export * as FilterParams from "./common/FilterParams.js";
|
|
|
12
12
|
// listings
|
|
13
13
|
export * as Ad from "./ad/Ad.js";
|
|
14
14
|
export * as AdLocation from "./ad/AdLocation.js";
|
|
15
|
+
export * as AdDailyViews from "./ad/AdDailyViews.js";
|
|
15
16
|
export * as Addresses from "./addresses/Address.js";
|
|
16
17
|
export * as AdPromotion from "./ad/AdPromotion.js";
|
|
17
18
|
export * as Motor from "./motor/Motor.js";
|