scrivito
Version:
Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.
31 lines (24 loc) • 709 B
text/typescript
// @rewire
import { ObjJson, cmsRestApi } from 'scrivito_sdk/client';
import { WorkspaceJson } from 'scrivito_sdk/client/workspace_json';
interface ChangesJsonBase {
current: string;
workspace?: WorkspaceJson;
}
interface ChangesJsonWithoutChanges extends ChangesJsonBase {
to?: undefined;
objs?: undefined;
}
interface ChangesJsonWithChanges extends ChangesJsonBase {
to: string;
objs: '*' | ObjJson[];
}
export type ChangesJson = ChangesJsonWithChanges | ChangesJsonWithoutChanges;
export function getWorkspaceChanges(
workspaceId: string,
from?: string
): Promise<ChangesJson> {
return cmsRestApi.get(`workspaces/${workspaceId}/changes`, {
from,
}) as Promise<ChangesJson>;
}