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.
37 lines (30 loc) • 815 B
text/typescript
// @rewire
import {
ObjJson,
WorkspaceObjSpaceId,
cmsRestApi,
getWorkspaceId,
} 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(
workspace: WorkspaceObjSpaceId,
from?: string
): Promise<ChangesJson> {
const workspaceId = getWorkspaceId(workspace);
return cmsRestApi.get(`workspaces/${workspaceId}/changes`, {
from,
}) as Promise<ChangesJson>;
}