Skip to content

Commit 4680f01

Browse files
Update SDK API to be23bfc970c4a0eac45760cf133614cb20c1ea31 (#179)
This PR updates the SDK to the latest API changes. NO_CHANGELOG=true Co-authored-by: databricks-ci-ghec-1[bot] <184311507+databricks-ci-ghec-1[bot]@users.noreply.github.com>
1 parent 69303c0 commit 4680f01

93 files changed

Lines changed: 697 additions & 446 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 334 additions & 361 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/accessmanagement/src/v1/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export function buildHttpRequest(
118118

119119
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
120120
const text = new TextDecoder().decode(body);
121-
const parsed: unknown = jsonBigint.parse(text);
121+
// 204 responses return an empty body; treat as `{}`.
122+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
122123
return schema.parse(parsed);
123124
}
124125

packages/alerts/src/v1/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export function buildHttpRequest(
118118

119119
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
120120
const text = new TextDecoder().decode(body);
121-
const parsed: unknown = jsonBigint.parse(text);
121+
// 204 responses return an empty body; treat as `{}`.
122+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
122123
return schema.parse(parsed);
123124
}
124125

packages/alerts/src/v2/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export function buildHttpRequest(
118118

119119
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
120120
const text = new TextDecoder().decode(body);
121-
const parsed: unknown = jsonBigint.parse(text);
121+
// 204 responses return an empty body; treat as `{}`.
122+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
122123
return schema.parse(parsed);
123124
}
124125

packages/apps/src/v1/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ export function buildHttpRequest(
142142

143143
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
144144
const text = new TextDecoder().decode(body);
145-
const parsed: unknown = jsonBigint.parse(text);
145+
// 204 responses return an empty body; treat as `{}`.
146+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
146147
return schema.parse(parsed);
147148
}
148149

packages/authentication/src/v1/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export function buildHttpRequest(
118118

119119
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
120120
const text = new TextDecoder().decode(body);
121-
const parsed: unknown = jsonBigint.parse(text);
121+
// 204 responses return an empty body; treat as `{}`.
122+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
122123
return schema.parse(parsed);
123124
}
124125

packages/budgetpolicy/src/v1/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export function buildHttpRequest(
118118

119119
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
120120
const text = new TextDecoder().decode(body);
121-
const parsed: unknown = jsonBigint.parse(text);
121+
// 204 responses return an empty body; treat as `{}`.
122+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
122123
return schema.parse(parsed);
123124
}
124125

packages/budgets/src/v1/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export function buildHttpRequest(
118118

119119
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
120120
const text = new TextDecoder().decode(body);
121-
const parsed: unknown = jsonBigint.parse(text);
121+
// 204 responses return an empty body; treat as `{}`.
122+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
122123
return schema.parse(parsed);
123124
}
124125

packages/cleanrooms/src/v1/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ export function buildHttpRequest(
142142

143143
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
144144
const text = new TextDecoder().decode(body);
145-
const parsed: unknown = jsonBigint.parse(text);
145+
// 204 responses return an empty body; treat as `{}`.
146+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
146147
return schema.parse(parsed);
147148
}
148149

packages/clusterlibraries/src/v2/utils.ts

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export function buildHttpRequest(
118118

119119
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
120120
const text = new TextDecoder().decode(body);
121-
const parsed: unknown = jsonBigint.parse(text);
121+
// 204 responses return an empty body; treat as `{}`.
122+
const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);
122123
return schema.parse(parsed);
123124
}
124125

0 commit comments

Comments
 (0)