@deallony/shared 1.1.58 → 1.1.60
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/abstract/baseService.d.ts +1 -13
- package/dist/cjs/dto/events/Event.dto.d.ts +2 -0
- package/dist/cjs/dto/events/Event.dto.js +1 -0
- package/dist/cjs/dto/events/EventTimeline.dto.d.ts +59 -0
- package/dist/cjs/dto/events/EventTimeline.dto.js +30 -0
- package/dist/cjs/dto/events/index.d.ts +1 -0
- package/dist/cjs/dto/events/index.js +1 -0
- package/dist/esm/dto/events/Event.dto.js +1 -0
- package/dist/esm/dto/events/EventTimeline.dto.js +27 -0
- package/dist/esm/dto/events/index.js +1 -0
- package/package.json +1 -1
|
@@ -15,18 +15,6 @@ export declare abstract class ClassService<TItem = unknown, TId = number> {
|
|
|
15
15
|
deleteBulk?(ids: TId[]): Promise<void>;
|
|
16
16
|
}
|
|
17
17
|
export type IObjectService<TItem = unknown> = {
|
|
18
|
-
findOne
|
|
19
|
-
findById?: (id: number) => Promise<TItem | null>;
|
|
20
|
-
findAll?: (options?: any) => Promise<TItem[]>;
|
|
21
|
-
findPaginated?: () => Promise<{
|
|
22
|
-
values: TItem[];
|
|
23
|
-
total: number;
|
|
24
|
-
page: number;
|
|
25
|
-
limit: number;
|
|
26
|
-
totalPages?: number;
|
|
27
|
-
[x: string]: any;
|
|
28
|
-
}>;
|
|
29
|
-
save?: (item: TItem) => any;
|
|
30
|
-
delete?: (id: number) => any;
|
|
18
|
+
findOne: (id: number) => Promise<TItem | null>;
|
|
31
19
|
[key: string]: any;
|
|
32
20
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { IEventWedding } from './EventWedding.dto';
|
|
3
|
+
import type { IEventTimeline } from './EventTimeline.dto';
|
|
3
4
|
export declare const eventBaseSchema: z.ZodObject<{
|
|
4
5
|
lat: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
5
6
|
long: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
@@ -66,5 +67,6 @@ export type IEvent = {
|
|
|
66
67
|
event_type: string | null;
|
|
67
68
|
slug: string;
|
|
68
69
|
weddings?: IEventWedding[];
|
|
70
|
+
timeline?: IEventTimeline | null;
|
|
69
71
|
};
|
|
70
72
|
export declare const emptyEvent: IEvent;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { IEvent } from './Event.dto';
|
|
3
|
+
export declare const timelinePayloadSchema: z.ZodObject<{
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
start_time: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const eventTimelineBaseSchema: z.ZodObject<{
|
|
8
|
+
event_id: z.ZodCoercedNumber<unknown>;
|
|
9
|
+
timelines: z.ZodArray<z.ZodObject<{
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
start_time: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const createEventTimelineSchema: z.ZodObject<{
|
|
15
|
+
event_id: z.ZodCoercedNumber<unknown>;
|
|
16
|
+
timelines: z.ZodArray<z.ZodObject<{
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
start_time: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const updateEventTimelineSchema: z.ZodObject<{
|
|
22
|
+
event_id: z.ZodCoercedNumber<unknown>;
|
|
23
|
+
timelines: z.ZodArray<z.ZodObject<{
|
|
24
|
+
title: z.ZodString;
|
|
25
|
+
start_time: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export declare const saveEventTimelineSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
30
|
+
event_id: z.ZodCoercedNumber<unknown>;
|
|
31
|
+
timelines: z.ZodArray<z.ZodObject<{
|
|
32
|
+
title: z.ZodString;
|
|
33
|
+
start_time: z.ZodString;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
36
|
+
event_id: z.ZodCoercedNumber<unknown>;
|
|
37
|
+
timelines: z.ZodArray<z.ZodObject<{
|
|
38
|
+
title: z.ZodString;
|
|
39
|
+
start_time: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
42
|
+
}, z.core.$strip>]>;
|
|
43
|
+
export declare const getEventTimelineFilterSchema: z.ZodObject<{
|
|
44
|
+
event_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
45
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
46
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type TimelinePayloadDto = z.infer<typeof timelinePayloadSchema>;
|
|
49
|
+
export type CreateEventTimelineDto = z.infer<typeof createEventTimelineSchema>;
|
|
50
|
+
export type UpdateEventTimelineDto = z.infer<typeof updateEventTimelineSchema>;
|
|
51
|
+
export type SaveEventTimelineDto = z.infer<typeof saveEventTimelineSchema>;
|
|
52
|
+
export type GetEventTimelineFilterDto = z.infer<typeof getEventTimelineFilterSchema>;
|
|
53
|
+
export type IEventTimeline = {
|
|
54
|
+
id?: number;
|
|
55
|
+
event_id: number;
|
|
56
|
+
timelines: TimelinePayloadDto[];
|
|
57
|
+
event?: IEvent;
|
|
58
|
+
};
|
|
59
|
+
export declare const emptyEventTimeline: IEventTimeline;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emptyEventTimeline = exports.getEventTimelineFilterSchema = exports.saveEventTimelineSchema = exports.updateEventTimelineSchema = exports.createEventTimelineSchema = exports.eventTimelineBaseSchema = exports.timelinePayloadSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.timelinePayloadSchema = zod_1.z.object({
|
|
6
|
+
title: zod_1.z.string().trim().min(1).max(255),
|
|
7
|
+
start_time: zod_1.z.string().trim().regex(/^([01]\d|2[0-3]):([0-5]\d)$/),
|
|
8
|
+
});
|
|
9
|
+
exports.eventTimelineBaseSchema = zod_1.z.object({
|
|
10
|
+
event_id: zod_1.z.coerce.number().int().positive(),
|
|
11
|
+
timelines: zod_1.z.array(exports.timelinePayloadSchema),
|
|
12
|
+
});
|
|
13
|
+
exports.createEventTimelineSchema = exports.eventTimelineBaseSchema;
|
|
14
|
+
exports.updateEventTimelineSchema = exports.eventTimelineBaseSchema.extend({
|
|
15
|
+
id: zod_1.z.coerce.number().int().positive(),
|
|
16
|
+
});
|
|
17
|
+
exports.saveEventTimelineSchema = zod_1.z.union([
|
|
18
|
+
exports.createEventTimelineSchema,
|
|
19
|
+
exports.updateEventTimelineSchema,
|
|
20
|
+
]);
|
|
21
|
+
exports.getEventTimelineFilterSchema = zod_1.z.object({
|
|
22
|
+
event_id: zod_1.z.coerce.number().int().positive().optional(),
|
|
23
|
+
page: zod_1.z.coerce.number().int().positive().optional(),
|
|
24
|
+
limit: zod_1.z.coerce.number().int().positive().max(100).optional(),
|
|
25
|
+
});
|
|
26
|
+
exports.emptyEventTimeline = {
|
|
27
|
+
id: 0,
|
|
28
|
+
event_id: 0,
|
|
29
|
+
timelines: [],
|
|
30
|
+
};
|
|
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Event.dto"), exports);
|
|
18
|
+
__exportStar(require("./EventTimeline.dto"), exports);
|
|
18
19
|
__exportStar(require("./EventWedding.dto"), exports);
|
|
19
20
|
__exportStar(require("./EventType.dto"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const timelinePayloadSchema = z.object({
|
|
3
|
+
title: z.string().trim().min(1).max(255),
|
|
4
|
+
start_time: z.string().trim().regex(/^([01]\d|2[0-3]):([0-5]\d)$/),
|
|
5
|
+
});
|
|
6
|
+
export const eventTimelineBaseSchema = z.object({
|
|
7
|
+
event_id: z.coerce.number().int().positive(),
|
|
8
|
+
timelines: z.array(timelinePayloadSchema),
|
|
9
|
+
});
|
|
10
|
+
export const createEventTimelineSchema = eventTimelineBaseSchema;
|
|
11
|
+
export const updateEventTimelineSchema = eventTimelineBaseSchema.extend({
|
|
12
|
+
id: z.coerce.number().int().positive(),
|
|
13
|
+
});
|
|
14
|
+
export const saveEventTimelineSchema = z.union([
|
|
15
|
+
createEventTimelineSchema,
|
|
16
|
+
updateEventTimelineSchema,
|
|
17
|
+
]);
|
|
18
|
+
export const getEventTimelineFilterSchema = z.object({
|
|
19
|
+
event_id: z.coerce.number().int().positive().optional(),
|
|
20
|
+
page: z.coerce.number().int().positive().optional(),
|
|
21
|
+
limit: z.coerce.number().int().positive().max(100).optional(),
|
|
22
|
+
});
|
|
23
|
+
export const emptyEventTimeline = {
|
|
24
|
+
id: 0,
|
|
25
|
+
event_id: 0,
|
|
26
|
+
timelines: [],
|
|
27
|
+
};
|