@cntrl-site/sdk 1.16.1 → 1.17.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.
|
@@ -8,8 +8,13 @@ const TriggerSchema = zod_1.z.object({
|
|
|
8
8
|
from: zod_1.z.string(),
|
|
9
9
|
to: zod_1.z.string()
|
|
10
10
|
});
|
|
11
|
+
const VideoInteractionActionSchema = zod_1.z.object({
|
|
12
|
+
type: zod_1.z.enum(['play', 'pause']),
|
|
13
|
+
itemId: zod_1.z.string()
|
|
14
|
+
});
|
|
11
15
|
const StateSchema = zod_1.z.object({
|
|
12
|
-
id: zod_1.z.string()
|
|
16
|
+
id: zod_1.z.string(),
|
|
17
|
+
actions: zod_1.z.array(VideoInteractionActionSchema).optional()
|
|
13
18
|
});
|
|
14
19
|
exports.InteractionSchema = zod_1.z.object({
|
|
15
20
|
id: zod_1.z.string(),
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z, ZodType } from 'zod';
|
|
2
|
-
import { Interaction, InteractionTrigger } from '../../types/article/Interaction';
|
|
2
|
+
import { Interaction, InteractionTrigger, VideoInteractionAction } from '../../types/article/Interaction';
|
|
3
3
|
|
|
4
4
|
const TriggerSchema = z.object({
|
|
5
5
|
itemId: z.string(),
|
|
@@ -8,8 +8,14 @@ const TriggerSchema = z.object({
|
|
|
8
8
|
to: z.string()
|
|
9
9
|
}) satisfies ZodType<InteractionTrigger>;
|
|
10
10
|
|
|
11
|
+
const VideoInteractionActionSchema = z.object({
|
|
12
|
+
type: z.enum(['play', 'pause']),
|
|
13
|
+
itemId: z.string()
|
|
14
|
+
}) satisfies ZodType<VideoInteractionAction>;
|
|
15
|
+
|
|
11
16
|
const StateSchema = z.object({
|
|
12
|
-
id: z.string()
|
|
17
|
+
id: z.string(),
|
|
18
|
+
actions: z.array(VideoInteractionActionSchema).optional()
|
|
13
19
|
});
|
|
14
20
|
|
|
15
21
|
export const InteractionSchema = z.object({
|
|
@@ -12,8 +12,14 @@ export interface InteractionTrigger {
|
|
|
12
12
|
to: StateId;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export type VideoInteractionAction = {
|
|
16
|
+
type: 'play' | 'pause';
|
|
17
|
+
itemId: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
export interface InteractionState {
|
|
16
21
|
id: StateId;
|
|
22
|
+
actions?: VideoInteractionAction[];
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
type StateId = string;
|