Skip to content

Commit

Permalink
fix: build fails (#4571)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <henry@dust.tt>
  • Loading branch information
2 people authored and flvndvd committed May 26, 2024
1 parent dbbfa60 commit ed45e70
Showing 1 changed file with 32 additions and 26 deletions.
58 changes: 32 additions & 26 deletions types/src/front/api_handlers/public/assistant.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import * as t from "io-ts";

export const PublicPostMessagesRequestBodySchema = t.type({
content: t.string,
mentions: t.array(t.type({ configurationId: t.string })),
context: t.type({
timezone: t.string,
username: t.string,
fullName: t.union([t.string, t.null]),
email: t.union([t.string, t.null]),
profilePictureUrl: t.union([t.string, t.null]),
export const PublicPostMessagesRequestBodySchema = t.intersection([
t.type({
content: t.string,
mentions: t.array(t.type({ configurationId: t.string })),
context: t.type({
timezone: t.string,
username: t.string,
fullName: t.union([t.string, t.null]),
email: t.union([t.string, t.null]),
profilePictureUrl: t.union([t.string, t.null]),
}),
}),
isSync: t.union([t.boolean, t.undefined]),
});
t.partial({
isSync: t.boolean,
}),
]);

export const PublicPostContentFragmentRequestBodySchema = t.type({
title: t.string,
Expand All @@ -32,18 +36,20 @@ export const PublicPostContentFragmentRequestBodySchema = t.type({
]),
});

export const PublicPostConversationsRequestBodySchema = t.type({
title: t.union([t.string, t.null]),
visibility: t.union([
t.literal("unlisted"),
t.literal("workspace"),
t.literal("deleted"),
t.literal("test"),
]),
message: t.union([PublicPostMessagesRequestBodySchema, t.undefined]),
contentFragment: t.union([
PublicPostContentFragmentRequestBodySchema,
t.undefined,
]),
isSync: t.union([t.boolean, t.undefined]),
});
export const PublicPostConversationsRequestBodySchema = t.intersection([
t.type({
title: t.union([t.string, t.null]),
visibility: t.union([
t.literal("unlisted"),
t.literal("workspace"),
t.literal("deleted"),
t.literal("test"),
]),
message: t.union([PublicPostMessagesRequestBodySchema, t.undefined]),
contentFragment: t.union([
PublicPostContentFragmentRequestBodySchema,
t.undefined,
]),
}),
t.partial({ isSync: t.union([t.boolean, t.undefined]) }),
]);

0 comments on commit ed45e70

Please sign in to comment.