Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions cypress/e2e/docs-display.cy.ts

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions cypress/e2e/docs-loading.cy.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gatsby-config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { GatsbyConfig } from "gatsby";
import { meta } from "./meta";
import { seoPlugins } from "./seo-plugins";
import { CacheVersion } from "api-4markdown-contracts";
import { SiteMetadata } from "core/models";
import { type CacheVersion } from "api-4markdown";

require(`dotenv`).config({
path: `.env.${process.env.NODE_ENV}`,
Expand Down
11 changes: 7 additions & 4 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
import type {
API4MarkdownDto,
API4MarkdownPayload,
RatingCategory,
Atoms,
PermanentDocumentDto,
} from "api-4markdown-contracts";
import { readFileSync, writeFileSync } from "fs";
Expand Down Expand Up @@ -126,7 +126,7 @@ const getTopDocuments = (
documents: PermanentDocumentDto[],
amount: number,
): PermanentDocumentDto[] => {
const weights: Record<RatingCategory, number> = {
const weights: Record<Atoms["RatingCategory"], number> = {
perfect: 5,
good: 4,
decent: 3,
Expand All @@ -139,7 +139,7 @@ const getTopDocuments = (
>((acc, document) => {
acc[document.id] = Object.entries(document.rating).reduce(
(acc, [category, rate]) =>
rate * weights[category as RatingCategory] + acc,
rate * weights[category as Atoms["RatingCategory"]] + acc,
0,
);

Expand Down Expand Up @@ -247,7 +247,10 @@ export const createPages: GatsbyNode["createPages"] = async ({ actions }) => {
);

trustedMindmaps.forEach((mindmap) => {
const mindmapPath = createPathForMindmap(mindmap.id, mindmap.path);
const mindmapPath = createPathForMindmap(
mindmap.id,
mindmap.path,
) as Atoms["Path"];

actions.createPage<MindmapPageModel>({
path: mindmapPath,
Expand Down
5 changes: 3 additions & 2 deletions src/acts/get-accessible-mindmap.act.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getAPI, parseError } from "api-4markdown";
import { useMindmapPreviewState } from "store/mindmap-preview";
import { Atoms } from "api-4markdown-contracts";

const getAccessibleMindmapAct = async (): Promise<void> => {
try {
Expand Down Expand Up @@ -31,8 +32,8 @@ const getAccessibleMindmapAct = async (): Promise<void> => {
}

const data = await getAPI().call(`getAccessibleMindmap`)({
mindmapId,
authorId,
mindmapId: mindmapId as Atoms["MindmapId"],
authorId: authorId as Atoms["UserProfileId"],
});

useMindmapPreviewState.set({
Expand Down
6 changes: 3 additions & 3 deletions src/acts/save-generation-as-document.act.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const saveGenerationAsDocumentAct = async (
docManagementStoreActions.fail(
new Error(
JSON.stringify({
symbol: `client-error`,
symbol: `custom-error`,
content: `No conversation found`,
message: `No conversation found`,
}),
Expand All @@ -36,7 +36,7 @@ const saveGenerationAsDocumentAct = async (
docManagementStoreActions.fail(
new Error(
JSON.stringify({
symbol: `client-error`,
symbol: `custom-error`,
content: `No assistant reply found`,
message: `No assistant reply found`,
}),
Expand All @@ -55,7 +55,7 @@ const saveGenerationAsDocumentAct = async (
docManagementStoreActions.fail(
new Error(
JSON.stringify({
symbol: `client-error`,
symbol: `custom-error`,
content: `Cannot find payload for conversation ${conversationId}`,
message: `Cannot find payload for conversation ${conversationId}`,
}),
Expand Down
4 changes: 2 additions & 2 deletions src/acts/update-mindmap-visibility.act.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getAPI, parseError, setCache } from "api-4markdown";
import type { AccessGroupId, MindmapDto } from "api-4markdown-contracts";
import type { Atoms, MindmapDto } from "api-4markdown-contracts";
import { AsyncResult } from "development-kit/utility-types";
import { useMindmapCreatorState } from "store/mindmap-creator";
import {
Expand All @@ -9,7 +9,7 @@ import {

const updateMindmapVisibilityAct = async (
visibility: MindmapDto["visibility"],
sharedForGroups?: AccessGroupId[],
sharedForGroups?: Atoms["AccessGroupId"][],
): AsyncResult => {
try {
useMindmapCreatorState.set({ operation: { is: `busy` } });
Expand Down
3 changes: 0 additions & 3 deletions src/api-4markdown-contracts/README.md

This file was deleted.

65 changes: 0 additions & 65 deletions src/api-4markdown-contracts/atoms.ts

This file was deleted.

Loading
Loading