feat: Contentstack <-> ImageVault integration
This commit is contained in:
60
types/contentstack.ts
Normal file
60
types/contentstack.ts
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user