mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
* fix: Prevent Notion import looping on self-referencing pages * fix: Stop import tasks once the import has finished
36 lines
1013 B
TypeScript
36 lines
1013 B
TypeScript
import { z } from "zod";
|
|
import {
|
|
BaseImportInputItemSchema,
|
|
BaseImportTaskInputItemSchema,
|
|
} from "@shared/schema";
|
|
import type { IntegrationService } from "@shared/types";
|
|
import { PageType } from "./types";
|
|
|
|
export const NotionImportInputItemSchema = BaseImportInputItemSchema.extend({
|
|
type: z.enum(PageType).optional(),
|
|
externalId: z.string().optional(),
|
|
});
|
|
|
|
export type NotionImportInput = z.infer<typeof NotionImportInputItemSchema>[];
|
|
|
|
export const NotionImportTaskInputItemSchema =
|
|
BaseImportTaskInputItemSchema.extend({
|
|
type: z.enum(PageType),
|
|
/** External ids of the pages above this page, from the root down. */
|
|
ancestorExternalIds: z.array(z.string()).optional(),
|
|
});
|
|
|
|
export type NotionImportTaskInput = z.infer<
|
|
typeof NotionImportTaskInputItemSchema
|
|
>[];
|
|
|
|
declare module "@shared/schema" {
|
|
interface ImportInputMap {
|
|
[IntegrationService.Notion]: NotionImportInput;
|
|
}
|
|
|
|
interface ImportTaskInputMap {
|
|
[IntegrationService.Notion]: NotionImportTaskInput;
|
|
}
|
|
}
|