feat: Contentstack <-> ImageVault integration

This commit is contained in:
Michael Zetterberg
2024-03-25 11:38:14 +01:00
parent 920cbf241a
commit a706b9cf8a
39 changed files with 16647 additions and 0 deletions

60
types/contentstack.ts Normal file
View File

@@ -0,0 +1,60 @@
import { Lang } from './lang';
// This type is only a partial of the data available.
export type ContentstackPluginDefinition = {
type: 'field' | 'rte_plugin';
title: string;
src: string;
};
// This type is only a partial of the data available.
// Check console when editing an entry for all the data available.
// The data comes from Contentstack, we have no control.
// Extend this if needed.
export type ContentstackEmbeddedData = {
entryMetadata: {
contentTypeUid: string;
entryUid: string;
locale: Lang;
};
utilis: {
content_type: {
schema: Array<
| {
uid: string;
data_type: "text";
value: string;
}
| {
uid: string;
data_type: "json";
value: unknown;
}
>;
};
extensions: ContentstackPluginDefinition[];
};
requestProps: {
stack: {
api_key: string;
};
branch: string;
};
};
// This is our version of the required fields we need that are available in ContentstackEmbeddedData
export type ExtractedContentstackEmbeddedData = {
contentType: {
uid: string;
};
entry: {
locale: Lang;
title: string;
uid: string;
};
plugin: ContentstackPluginDefinition;
stack: {
apiKey: string;
};
branch: string;
};