Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
143 changes: 143 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/abacpolicies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@databricks/sdk-core": ">=0.1.0-dev.1 <1.0.0",
"@databricks/sdk-options": ">=0.0.0 <1.0.0",
"@js-temporal/polyfill": "^0.5.0",
"json-bigint": "^1.0.0",
"zod": "^4.3.6"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/abacpolicies/src/v1/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {

// Package identity segment for this client to be used in the User-Agent header.
const PACKAGE_SEGMENT = {
key: pkgJson.name.replace(/^@[^/]+\//, ''),
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
value: pkgJson.version,
};

Expand All @@ -63,7 +63,7 @@ export class Client {
let info = createDefault().with(PACKAGE_SEGMENT);
if (options.credentials !== undefined) {
info = info
.with({key: 'sdk-auth', value: AUTH_VERSION})
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
.with({key: 'auth', value: options.credentials.name()});
}
this.userAgent = info.toString();
Expand Down
18 changes: 12 additions & 6 deletions packages/abacpolicies/src/v1/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ export interface PolicyInfo {
*/
matchColumns?: MatchColumn[] | undefined;
/** Time at which the policy was created, in epoch milliseconds. Output only. */
createdAt?: number | undefined;
createdAt?: bigint | undefined;
/** Username of the user who created the policy. Output only. */
createdBy?: string | undefined;
/** Time at which the policy was last modified, in epoch milliseconds. Output only. */
updatedAt?: number | undefined;
updatedAt?: bigint | undefined;
/** Username of the user who last modified the policy. Output only. */
updatedBy?: string | undefined;
}
Expand Down Expand Up @@ -318,9 +318,15 @@ export const unmarshalPolicyInfoSchema: z.ZodType<PolicyInfo> = z
row_filter: z.lazy(() => unmarshalRowFilterOptionsSchema).optional(),
column_mask: z.lazy(() => unmarshalColumnMaskOptionsSchema).optional(),
match_columns: z.array(z.lazy(() => unmarshalMatchColumnSchema)).optional(),
created_at: z.number().optional(),
created_at: z
.union([z.number(), z.bigint()])
.transform(v => BigInt(v))
.optional(),
created_by: z.string().optional(),
updated_at: z.number().optional(),
updated_at: z
.union([z.number(), z.bigint()])
.transform(v => BigInt(v))
.optional(),
updated_by: z.string().optional(),
})
.transform(d => ({
Expand Down Expand Up @@ -418,9 +424,9 @@ export const marshalPolicyInfoSchema: z.ZodType = z
])
.optional(),
matchColumns: z.array(z.lazy(() => marshalMatchColumnSchema)).optional(),
createdAt: z.number().optional(),
createdAt: z.bigint().optional(),
createdBy: z.string().optional(),
updatedAt: z.number().optional(),
updatedAt: z.bigint().optional(),
updatedBy: z.string().optional(),
})
.transform(d => ({
Expand Down
10 changes: 8 additions & 2 deletions packages/abacpolicies/src/v1/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import type {
} from '@databricks/sdk-core/http';
import type {Logger} from '@databricks/sdk-core/logger';
import type {CallOptions} from '@databricks/sdk-options/call';
import JSONBig from 'json-bigint';
import type {z} from 'zod';

// JSON codec that preserves int64 precision. On the way in, large integer
// literals come back as bigint instead of being rounded to JS Number. On the
// way out, bigint values are emitted as raw JSON number digits.
const jsonBigint = JSONBig({useNativeBigInt: true});

export interface HttpCallOptions {
readonly request: HttpRequest;
readonly httpClient: HttpClient;
Expand Down Expand Up @@ -112,12 +118,12 @@ export function buildHttpRequest(

export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
const text = new TextDecoder().decode(body);
const parsed: unknown = JSON.parse(text);
const parsed: unknown = jsonBigint.parse(text);
return schema.parse(parsed);
}

export function marshalRequest(data: unknown, schema: z.ZodType): string {
return JSON.stringify(schema.parse(data));
return jsonBigint.stringify(schema.parse(data));
}

export function flattenQueryParams(
Expand Down
1 change: 1 addition & 0 deletions packages/accessmanagement/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@databricks/sdk-core": ">=0.1.0-dev.1 <1.0.0",
"@databricks/sdk-options": ">=0.0.0 <1.0.0",
"@js-temporal/polyfill": "^0.5.0",
"json-bigint": "^1.0.0",
"zod": "^4.3.6"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/accessmanagement/src/v1/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import {

// Package identity segment for this client to be used in the User-Agent header.
const PACKAGE_SEGMENT = {
key: pkgJson.name.replace(/^@[^/]+\//, ''),
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
value: pkgJson.version,
};

Expand Down Expand Up @@ -93,7 +93,7 @@ export class Client {
let info = createDefault().with(PACKAGE_SEGMENT);
if (options.credentials !== undefined) {
info = info
.with({key: 'sdk-auth', value: AUTH_VERSION})
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
.with({key: 'auth', value: options.credentials.name()});
}
this.userAgent = info.toString();
Expand Down
27 changes: 15 additions & 12 deletions packages/accessmanagement/src/v1/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export interface AccessControlResponse {
* group can be a principal of a permission set assignment but an actor is always a user or a service principal
*/
export interface Actor {
kind?: {$case: 'actorId'; actorId: number} | undefined;
kind?: {$case: 'actorId'; actorId: bigint} | undefined;
}

export interface CheckPolicyRequest {
Expand Down Expand Up @@ -123,9 +123,9 @@ export interface DeleteWorkspacePermissionAssignmentRequest {
/** The account ID. */
accountId?: string | undefined;
/** The workspace ID for the account. */
workspaceId?: number | undefined;
workspaceId?: bigint | undefined;
/** The ID of the user, service principal, or group. */
principalId?: number | undefined;
principalId?: bigint | undefined;
}

// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
Expand Down Expand Up @@ -204,7 +204,7 @@ export interface GetWorkspacePermissionAssignmentsRequest {
/** The account ID. */
accountId?: string | undefined;
/** The workspace ID for the account. */
workspaceId?: number | undefined;
workspaceId?: bigint | undefined;
}

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
Expand Down Expand Up @@ -232,7 +232,7 @@ export interface ListWorkspacePermissionsRequest {
/** The account ID. */
accountId?: string | undefined;
/** The workspace ID. */
workspaceId?: number | undefined;
workspaceId?: bigint | undefined;
}

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
Expand Down Expand Up @@ -284,7 +284,7 @@ export interface PrincipalOutput {
}
| undefined;
/** The unique, opaque id of the principal. */
principalId?: number | undefined;
principalId?: bigint | undefined;
/** The display name of the principal. */
displayName?: string | undefined;
}
Expand Down Expand Up @@ -363,9 +363,9 @@ export interface UpdateWorkspacePermissionAssignmentRequest {
/** The account ID. */
accountId?: string | undefined;
/** The workspace ID. */
workspaceId?: number | undefined;
workspaceId?: bigint | undefined;
/** The ID of the user, service principal, or group. */
principalId?: number | undefined;
principalId?: bigint | undefined;
/**
* Array of permissions assignments to update on the workspace.
* Valid values are "USER" and "ADMIN" (case-sensitive).
Expand Down Expand Up @@ -549,7 +549,10 @@ export const unmarshalPrincipalOutputSchema: z.ZodType<PrincipalOutput> = z
user_name: z.string().optional(),
group_name: z.string().optional(),
service_principal_name: z.string().optional(),
principal_id: z.number().optional(),
principal_id: z
.union([z.number(), z.bigint()])
.transform(v => BigInt(v))
.optional(),
display_name: z.string().optional(),
})
.transform(d => ({
Expand Down Expand Up @@ -632,7 +635,7 @@ export const marshalActorSchema: z.ZodType = z
.object({
kind: z
.discriminatedUnion('$case', [
z.object({$case: z.literal('actorId'), actorId: z.number()}),
z.object({$case: z.literal('actorId'), actorId: z.bigint()}),
])
.optional(),
})
Expand Down Expand Up @@ -726,8 +729,8 @@ export const marshalUpdateWorkspacePermissionAssignmentRequestSchema: z.ZodType
z
.object({
accountId: z.string().optional(),
workspaceId: z.number().optional(),
principalId: z.number().optional(),
workspaceId: z.bigint().optional(),
principalId: z.bigint().optional(),
permissions: z.array(z.enum(WorkspacePermission)).optional(),
})
.transform(d => ({
Expand Down
10 changes: 8 additions & 2 deletions packages/accessmanagement/src/v1/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import type {
} from '@databricks/sdk-core/http';
import type {Logger} from '@databricks/sdk-core/logger';
import type {CallOptions} from '@databricks/sdk-options/call';
import JSONBig from 'json-bigint';
import type {z} from 'zod';

// JSON codec that preserves int64 precision. On the way in, large integer
// literals come back as bigint instead of being rounded to JS Number. On the
// way out, bigint values are emitted as raw JSON number digits.
const jsonBigint = JSONBig({useNativeBigInt: true});

export interface HttpCallOptions {
readonly request: HttpRequest;
readonly httpClient: HttpClient;
Expand Down Expand Up @@ -112,12 +118,12 @@ export function buildHttpRequest(

export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
const text = new TextDecoder().decode(body);
const parsed: unknown = JSON.parse(text);
const parsed: unknown = jsonBigint.parse(text);
return schema.parse(parsed);
}

export function marshalRequest(data: unknown, schema: z.ZodType): string {
return JSON.stringify(schema.parse(data));
return jsonBigint.stringify(schema.parse(data));
}

export function flattenQueryParams(
Expand Down
1 change: 1 addition & 0 deletions packages/alerts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@databricks/sdk-core": ">=0.1.0-dev.1 <1.0.0",
"@databricks/sdk-options": ">=0.0.0 <1.0.0",
"@js-temporal/polyfill": "^0.5.0",
"json-bigint": "^1.0.0",
"zod": "^4.3.6"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/alerts/src/v1/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {

// Package identity segment for this client to be used in the User-Agent header.
const PACKAGE_SEGMENT = {
key: pkgJson.name.replace(/^@[^/]+\//, ''),
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
value: pkgJson.version,
};

Expand All @@ -65,7 +65,7 @@ export class Client {
let info = createDefault().with(PACKAGE_SEGMENT);
if (options.credentials !== undefined) {
info = info
.with({key: 'sdk-auth', value: AUTH_VERSION})
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
.with({key: 'auth', value: options.credentials.name()});
}
this.userAgent = info.toString();
Expand Down
10 changes: 8 additions & 2 deletions packages/alerts/src/v1/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import type {
} from '@databricks/sdk-core/http';
import type {Logger} from '@databricks/sdk-core/logger';
import type {CallOptions} from '@databricks/sdk-options/call';
import JSONBig from 'json-bigint';
import type {z} from 'zod';

// JSON codec that preserves int64 precision. On the way in, large integer
// literals come back as bigint instead of being rounded to JS Number. On the
// way out, bigint values are emitted as raw JSON number digits.
const jsonBigint = JSONBig({useNativeBigInt: true});

export interface HttpCallOptions {
readonly request: HttpRequest;
readonly httpClient: HttpClient;
Expand Down Expand Up @@ -112,12 +118,12 @@ export function buildHttpRequest(

export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
const text = new TextDecoder().decode(body);
const parsed: unknown = JSON.parse(text);
const parsed: unknown = jsonBigint.parse(text);
return schema.parse(parsed);
}

export function marshalRequest(data: unknown, schema: z.ZodType): string {
return JSON.stringify(schema.parse(data));
return jsonBigint.stringify(schema.parse(data));
}

export function flattenQueryParams(
Expand Down
4 changes: 2 additions & 2 deletions packages/alerts/src/v2/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {

// Package identity segment for this client to be used in the User-Agent header.
const PACKAGE_SEGMENT = {
key: pkgJson.name.replace(/^@[^/]+\//, ''),
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
value: pkgJson.version,
};

Expand All @@ -63,7 +63,7 @@ export class Client {
let info = createDefault().with(PACKAGE_SEGMENT);
if (options.credentials !== undefined) {
info = info
.with({key: 'sdk-auth', value: AUTH_VERSION})
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
.with({key: 'auth', value: options.credentials.name()});
}
this.userAgent = info.toString();
Expand Down
10 changes: 8 additions & 2 deletions packages/alerts/src/v2/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import type {
} from '@databricks/sdk-core/http';
import type {Logger} from '@databricks/sdk-core/logger';
import type {CallOptions} from '@databricks/sdk-options/call';
import JSONBig from 'json-bigint';
import type {z} from 'zod';

// JSON codec that preserves int64 precision. On the way in, large integer
// literals come back as bigint instead of being rounded to JS Number. On the
// way out, bigint values are emitted as raw JSON number digits.
const jsonBigint = JSONBig({useNativeBigInt: true});

export interface HttpCallOptions {
readonly request: HttpRequest;
readonly httpClient: HttpClient;
Expand Down Expand Up @@ -112,12 +118,12 @@ export function buildHttpRequest(

export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
const text = new TextDecoder().decode(body);
const parsed: unknown = JSON.parse(text);
const parsed: unknown = jsonBigint.parse(text);
return schema.parse(parsed);
}

export function marshalRequest(data: unknown, schema: z.ZodType): string {
return JSON.stringify(schema.parse(data));
return jsonBigint.stringify(schema.parse(data));
}

export function flattenQueryParams(
Expand Down
1 change: 1 addition & 0 deletions packages/apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@databricks/sdk-core": ">=0.1.0-dev.1 <1.0.0",
"@databricks/sdk-options": ">=0.0.0 <1.0.0",
"@js-temporal/polyfill": "^0.5.0",
"json-bigint": "^1.0.0",
"zod": "^4.3.6"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/src/v1/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import {

// Package identity segment for this client to be used in the User-Agent header.
const PACKAGE_SEGMENT = {
key: pkgJson.name.replace(/^@[^/]+\//, ''),
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
value: pkgJson.version,
};

Expand Down Expand Up @@ -115,7 +115,7 @@ export class Client {
let info = createDefault().with(PACKAGE_SEGMENT);
if (options.credentials !== undefined) {
info = info
.with({key: 'sdk-auth', value: AUTH_VERSION})
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
.with({key: 'auth', value: options.credentials.name()});
}
this.userAgent = info.toString();
Expand Down
Loading
Loading