(
projectId: string,
token = buildLocalSessionToken(),
options: { chatGroupId?: string | undefined | null | undefined } = {},
)
| 47 | } |
| 48 | |
| 49 | export function createLocalThreadDraft( |
| 50 | projectId: string, |
| 51 | token = buildLocalSessionToken(), |
| 52 | options: { chatGroupId?: string | undefined | null | undefined } = {}, |
| 53 | ) { |
| 54 | const encodedProjectId = encodeURIComponent(projectId) |
| 55 | const chatGroupSuffix = options.chatGroupId |
| 56 | ? `?chatGroupId=${encodeURIComponent(options.chatGroupId)}` |
| 57 | : '' |
| 58 | |
| 59 | return { |
| 60 | projectId, |
| 61 | threadId: `local-thread-${token}`, |
| 62 | sessionPath: `${LOCAL_SESSION_PREFIX}${encodedProjectId}/${token}${chatGroupSuffix}`, |
| 63 | } |
| 64 | } |
no test coverage detected