@kontent-ai/sync-sdk
Version:
Sync API v2 for Kontent.ai
83 lines (82 loc) • 3.52 kB
TypeScript
import type { Override, Prettify } from "@kontent-ai/core-sdk";
import z from "zod/v4";
import type { PagingQuery, SyncClient, SyncClientConfig, SyncClientTypes } from "../models/core.models.js";
import type { ContentItemDeltaObject, ContentTypeDeltaObject, LanguageDeltaObject, TaxonomyDeltaObject } from "../schemas/synchronization.models.js";
type SyncQueryMetadata = {
readonly continuationToken: string;
};
export declare const syncQueryPayloadSchema: z.ZodReadonly<z.ZodObject<{
items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
data: z.ZodReadonly<z.ZodObject<{
system: z.ZodReadonly<z.ZodObject<{
id: z.ZodString;
collection: z.ZodString;
codename: z.ZodString;
name: z.ZodString;
type: z.ZodString;
language: z.ZodString;
last_modified: z.ZodString;
workflow: z.ZodOptional<z.ZodString>;
workflow_step: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
change_type: z.ZodEnum<{
changed: "changed";
deleted: "deleted";
}>;
timestamp: z.ZodISODateTime;
}, z.core.$strip>>>;
types: z.ZodArray<z.ZodReadonly<z.ZodObject<{
data: z.ZodReadonly<z.ZodObject<{
system: z.ZodReadonly<z.ZodObject<{
id: z.ZodString;
codename: z.ZodString;
name: z.ZodString;
last_modified: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
change_type: z.ZodEnum<{
changed: "changed";
deleted: "deleted";
}>;
timestamp: z.ZodISODateTime;
}, z.core.$strip>>>;
languages: z.ZodArray<z.ZodReadonly<z.ZodObject<{
data: z.ZodReadonly<z.ZodObject<{
system: z.ZodReadonly<z.ZodObject<{
id: z.ZodString;
codename: z.ZodString;
name: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
change_type: z.ZodEnum<{
changed: "changed";
deleted: "deleted";
}>;
timestamp: z.ZodISODateTime;
}, z.core.$strip>>>;
taxonomies: z.ZodArray<z.ZodReadonly<z.ZodObject<{
data: z.ZodReadonly<z.ZodObject<{
system: z.ZodReadonly<z.ZodObject<{
id: z.ZodString;
codename: z.ZodString;
name: z.ZodString;
last_modified: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>>;
change_type: z.ZodEnum<{
changed: "changed";
deleted: "deleted";
}>;
timestamp: z.ZodISODateTime;
}, z.core.$strip>>>;
}, z.core.$strip>>;
export type SyncQueryPayload<TSyncApiTypes extends SyncClientTypes> = Prettify<Override<z.infer<typeof syncQueryPayloadSchema>, {
readonly taxonomies: readonly TaxonomyDeltaObject<TSyncApiTypes>[];
readonly items: readonly ContentItemDeltaObject<TSyncApiTypes>[];
readonly types: readonly ContentTypeDeltaObject<TSyncApiTypes>[];
readonly languages: readonly LanguageDeltaObject<TSyncApiTypes>[];
}>>;
export type SyncQuery<TSyncApiTypes extends SyncClientTypes> = PagingQuery<SyncQueryPayload<TSyncApiTypes>, SyncQueryMetadata>;
export declare function getSyncQuery<TSyncApiTypes extends SyncClientTypes>(config: SyncClientConfig, continuationToken: string): ReturnType<SyncClient<TSyncApiTypes>["sync"]>;
export {};