Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions scripts/configure-rollout.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export const SUPPORTED_PLATFORMS: readonly string[]
export const DEFAULT_BASE_URL: string
export const DEFAULT_PERCENTAGE: number

export function isValidVersion(value: unknown): boolean

export interface ConfigureRolloutOptions {
version: string
percentage?: number
token?: string
baseUrl?: string
fetchImpl?: (url: any, init?: any) => Promise<any>
notes?: string
log?: (msg: string) => void
warn?: (msg: string) => void
}

export interface RolloutResult {
platform: string
action: 'created' | 'updated' | 'updated-after-conflict'
data: Record<string, unknown>
}

export function configureRollout(options: ConfigureRolloutOptions): Promise<RolloutResult[]>
4 changes: 2 additions & 2 deletions test/configure-rollout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ describe('configureRollout', () => {

// 1 GET + 3 POSTs = 4 calls
expect(calls).toHaveLength(4)
expect(calls[0].method).toBe('GET')
expect(calls[0].headers).toMatchObject({
expect(calls[0]?.method).toBe('GET')
expect(calls[0]?.headers).toMatchObject({
Authorization: 'Bearer test-admin-token-12345678901234567890'
})

Expand Down
6 changes: 4 additions & 2 deletions test/provider-error-patch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ describe('provider error classification patches', () => {
const valid = { ...malformed, content: [] }
expect(completeTerminalMessage(valid, completed)).toBe(valid)
expect(patch).toContain(
'+\tconst message = completeTerminalMessage(event.message, completed);'
'+\t\t\tconst message = completeTerminalMessage(event.message, completed);'
)
expect(patch).toContain(
'+\t\t\t\treplayState: toPiReplayState(message, requestedModel)'
)
expect(patch).toContain('+\t\t\treplayState: toPiReplayState(message)')
})
})
Loading