import { APIResource } from "../../core/resource.js"; import * as RepositoriesAPI from "./repositories.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Syncs extends APIResource { /** * Creates a new sync operation and returns a signed upload URL for uploading code * bundle * * @example * ```ts * const sync = await client.repositories.syncs.create('id', { * type: 'incremental', * }); * ``` */ create(id: string, params: SyncCreateParams, options?: RequestOptions): APIPromise; /** * Retrieves a sync by its ID * * @example * ```ts * const sync = await client.repositories.syncs.retrieve( * 'sync_id', * { id: 'id' }, * ); * ``` */ retrieve(syncID: string, params: SyncRetrieveParams, options?: RequestOptions): APIPromise; /** * Retrieves a paginated list of syncs for a repository * * @example * ```ts * const syncs = await client.repositories.syncs.list('id'); * ``` */ list(id: string, query?: SyncListParams | null | undefined, options?: RequestOptions): APIPromise; } export interface Sync { /** * Unique identifier of the sync */ id?: string; /** * The git reference where the uploaded bundle will be applied. Only used for * incremental syncs. This reference must exist in the already synced repository. */ base_ref?: string | null; /** * Unix timestamp when the sync completed */ completed_at?: number | null; /** * Unix timestamp when the sync was created */ created_at?: number; /** * Error details if status is failed */ error?: Sync.Error | null; /** * Upload format (git bundle file, can be uploaded directly without additional * compression) */ format?: 'bundle'; object?: 'sync'; /** * Repository this sync belongs to */ repository?: string; /** * Size of uploaded file in bytes */ size_bytes?: number | null; /** * Current status of the sync */ status?: 'pending_upload' | 'processing' | 'completed' | 'failed' | 'expired'; /** * Type of sync */ type?: 'full' | 'incremental'; /** * Unix timestamp when the sync was last updated */ updated_at?: number; /** * Unix timestamp when the upload URL expires */ upload_expires_at?: number | null; /** * Signed URL for uploading the code bundle */ upload_url?: string | null; } export declare namespace Sync { /** * Error details if status is failed */ interface Error { code?: string; message?: string; } } export interface SyncListResponse extends RepositoriesAPI.PaginatedList { data?: Array; } export interface SyncCreateParams { /** * Body param: Type of sync */ type: 'full' | 'incremental'; /** * Body param: The git reference where the uploaded bundle will be applied. * Required for incremental syncs only. This reference must exist in the already * synced repository. */ base_ref?: string; /** * Header param: Idempotency key for safely retrying operations */ 'Idempotency-Key'?: string; } export interface SyncRetrieveParams { /** * Repository ID (can be internal ID or external:{external_id}) */ id: string; } export interface SyncListParams { /** * Cursor for pagination (object ID) */ after?: string; /** * Cursor for pagination (object ID) */ before?: string; /** * Number of items to return */ limit?: number; /** * Filter by sync status */ status?: 'pending_upload' | 'processing' | 'completed' | 'failed' | 'expired'; /** * Filter by sync type */ type?: 'full' | 'incremental'; } export declare namespace Syncs { export { type Sync as Sync, type SyncListResponse as SyncListResponse, type SyncCreateParams as SyncCreateParams, type SyncRetrieveParams as SyncRetrieveParams, type SyncListParams as SyncListParams, }; } //# sourceMappingURL=syncs.d.ts.map