edge-sync-client
Version:
Library for accessing the Edge data-sync system
79 lines (78 loc) • 2.84 kB
TypeScript
/**
* @file The types in this file describe the sync-server's REST protocol.
*
* The type names use the following suffixes:
* - Body: The JSON request body sent with the request.
* - Params: The query params passed in the URI.
* - Response: The JSON response body the endpoint returns.
*/
declare type OmitPartially<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
export declare type ServerErrorResponse = ReturnType<typeof asServerErrorResponse>;
export declare const asServerErrorResponse: import("cleaners").ObjectCleaner<{
success: false;
message: string;
stack: string | undefined;
}>;
export declare type FileChange = ReturnType<typeof asFileChange>;
export declare const asFileChange: import("cleaners").Cleaner<{
iv_hex: string;
encryptionType: number;
data_base64: string;
} | null>;
export declare type ChangeSet = ReturnType<typeof asChangeSet>;
export declare const asChangeSet: import("cleaners").Cleaner<{
[keys: string]: {
iv_hex: string;
encryptionType: number;
data_base64: string;
} | null;
}>;
export declare type GetStoreParams = ReturnType<typeof asGetStoreParams>;
export declare const asGetStoreParams: import("cleaners").ObjectCleaner<{
syncKey: string;
hash: string | undefined;
}>;
export declare type GetStoreResponse = OmitPartially<ReturnType<typeof asGetStoreResponse>, 'hash'>;
export declare const asGetStoreResponse: import("cleaners").ObjectCleaner<{
hash: string | undefined;
changes: {
[keys: string]: {
iv_hex: any;
encryptionType: any;
data_base64: any;
} | null;
};
}>;
export declare type PostStoreParams = ReturnType<typeof asPostStoreParams>;
export declare const asPostStoreParams: import("cleaners").ObjectCleaner<{
syncKey: string;
hash: string | undefined;
}>;
export declare type PostStoreBody = ReturnType<typeof asPostStoreBody>;
export declare const asPostStoreBody: import("cleaners").ObjectCleaner<{
changes: {
[keys: string]: {
iv_hex: any;
encryptionType: any;
data_base64: any;
} | null;
};
}>;
export declare type PostStoreResponse = ReturnType<typeof asPostStoreResponse>;
export declare const asPostStoreResponse: import("cleaners").ObjectCleaner<{
hash: string;
changes: {
[keys: string]: {
iv_hex: any;
encryptionType: any;
data_base64: any;
} | null;
};
}>;
export declare type PutStoreParams = ReturnType<typeof asPutStoreParams>;
export declare const asPutStoreParams: import("cleaners").ObjectCleaner<{
syncKey: string;
}>;
export declare type PutStoreResponse = ReturnType<typeof asPutStoreResponse>;
export declare const asPutStoreResponse: import("cleaners").Cleaner<undefined>;
export {};