0

Repository Syncs History

by
Published Oct 17, 2025

Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.

Script phrase Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Phrase = {
3
	token: string
4
	baseUrl: string
5
}
6
/**
7
 * Repository Syncs History
8
 * Get the history of a single Repo Sync. The history includes all imports and exports
9
performed by the Repo Sync.
10
 */
11
export async function main(auth: Phrase, account_id: string, id: string) {
12
	const url = new URL(`${auth.baseUrl}/accounts/${account_id}/repo_syncs/${id}/events`)
13

14
	const response = await fetch(url, {
15
		method: 'GET',
16
		headers: {
17
			Authorization: 'ApiToken ' + auth.token
18
		},
19
		body: undefined
20
	})
21
	if (!response.ok) {
22
		const text = await response.text()
23
		throw new Error(`${response.status} ${text}`)
24
	}
25
	return await response.json()
26
}
27