export type TableConfig = {archivingDelayMinutes?: number | undefined, archivingIntervalMinutes?: number | undefined, backfillIntervalMinutes?: number | undefined, backfillMaxBufferSize?: number | undefined, backfillStoreBatchSize?: number | undefined, backfillThresholdInBytes?: number | undefined, batchSize?: number | undefined, initPrimaryKeyNumBuckets?: number | undefined, maxRedoLogFileSize?: number | undefined, recordRetentionInDays?: number | undefined, redoLogRotationInterval?: number | undefined, snapshotIntervalMinutes?: number | undefined, snapshotThreshold?: number | undefined}; export type UpdateApiSchemaTablesTableArgs = {table: string, body: TableConfig}; export type UpdateApiSchemaTablesTableOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * update config of the specified table * * PUT /schema/tables/{table} */ export const updateApiSchemaTablesTable = async (args: UpdateApiSchemaTablesTableArgs, options: UpdateApiSchemaTablesTableOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/schema/tables/${encodeURIComponent(String(args.table))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };