@databricks/sdk-repos 0.1.0-dev.2 → 0.1.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v1/client.d.ts +6 -6
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +6 -6
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +1 -1
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/model.d.ts +23 -10
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +7 -10
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +2 -1
- package/dist/v1/utils.js.map +1 -1
- package/package.json +6 -6
- package/src/v1/client.ts +0 -256
- package/src/v1/index.ts +0 -19
- package/src/v1/model.ts +0 -316
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -156
package/dist/v1/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CallOptions } from '@databricks/sdk-options/call';
|
|
2
2
|
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
-
import type { CreateRepoRequest,
|
|
3
|
+
import type { CreateRepoRequest, CreateRepoResponse, DeleteProjectRequest, DeleteProjectResponse, GetRepoRequest, GetRepoResponse, ListReposRequest, ListReposResponse, RepoInfo, UpdateRepoRequest, UpdateRepoResponse } from './model';
|
|
4
4
|
export declare class ReposClient {
|
|
5
5
|
private readonly host;
|
|
6
6
|
private readonly workspaceId;
|
|
@@ -13,21 +13,21 @@ export declare class ReposClient {
|
|
|
13
13
|
* Note that repos created programmatically must be linked to a remote Git repo, unlike repos
|
|
14
14
|
* created in the browser.
|
|
15
15
|
*/
|
|
16
|
-
createRepo(req: CreateRepoRequest, options?: CallOptions): Promise<
|
|
16
|
+
createRepo(req: CreateRepoRequest, options?: CallOptions): Promise<CreateRepoResponse>;
|
|
17
17
|
/** Deletes the specified repo. */
|
|
18
|
-
deleteProject(req: DeleteProjectRequest, options?: CallOptions): Promise<
|
|
18
|
+
deleteProject(req: DeleteProjectRequest, options?: CallOptions): Promise<DeleteProjectResponse>;
|
|
19
19
|
/** Returns the repo with the given repo ID. */
|
|
20
|
-
getRepo(req: GetRepoRequest, options?: CallOptions): Promise<
|
|
20
|
+
getRepo(req: GetRepoRequest, options?: CallOptions): Promise<GetRepoResponse>;
|
|
21
21
|
/**
|
|
22
22
|
* Returns repos that the calling user has Manage permissions on.
|
|
23
23
|
* Use `next_page_token` to iterate through additional pages.
|
|
24
24
|
*/
|
|
25
|
-
listRepos(req: ListReposRequest, options?: CallOptions): Promise<
|
|
25
|
+
listRepos(req: ListReposRequest, options?: CallOptions): Promise<ListReposResponse>;
|
|
26
26
|
listReposIter(req: ListReposRequest, options?: CallOptions): AsyncGenerator<RepoInfo>;
|
|
27
27
|
/**
|
|
28
28
|
* Updates the repo to a different branch or tag, or updates the repo to the latest commit on
|
|
29
29
|
* the same branch.
|
|
30
30
|
*/
|
|
31
|
-
updateRepo(req: UpdateRepoRequest, options?: CallOptions): Promise<
|
|
31
|
+
updateRepo(req: UpdateRepoRequest, options?: CallOptions): Promise<UpdateRepoResponse>;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/v1/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAWlE,OAAO,KAAK,EACV,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,E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{ NoOpLogger } from '@databricks/sdk-core/logger';
|
|
|
5
5
|
import { newHttpClient } from './transport';
|
|
6
6
|
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
7
7
|
import pkgJson from '../../package.json' with { type: 'json' };
|
|
8
|
-
import { marshalCreateRepoRequestSchema, marshalUpdateRepoRequestSchema,
|
|
8
|
+
import { marshalCreateRepoRequestSchema, marshalUpdateRepoRequestSchema, unmarshalCreateRepoResponseSchema, unmarshalDeleteProjectResponseSchema, unmarshalGetRepoResponseSchema, unmarshalListReposResponseSchema, unmarshalUpdateRepoResponseSchema, } from './model';
|
|
9
9
|
// Package identity segment for this client to be used in the User-Agent header.
|
|
10
10
|
const PACKAGE_SEGMENT = {
|
|
11
11
|
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
@@ -58,7 +58,7 @@ export class ReposClient {
|
|
|
58
58
|
httpClient: this.httpClient,
|
|
59
59
|
logger: this.logger,
|
|
60
60
|
});
|
|
61
|
-
resp = parseResponse(respBody,
|
|
61
|
+
resp = parseResponse(respBody, unmarshalCreateRepoResponseSchema);
|
|
62
62
|
};
|
|
63
63
|
await executeCall(call, options);
|
|
64
64
|
if (resp === undefined) {
|
|
@@ -82,7 +82,7 @@ export class ReposClient {
|
|
|
82
82
|
httpClient: this.httpClient,
|
|
83
83
|
logger: this.logger,
|
|
84
84
|
});
|
|
85
|
-
resp = parseResponse(respBody,
|
|
85
|
+
resp = parseResponse(respBody, unmarshalDeleteProjectResponseSchema);
|
|
86
86
|
};
|
|
87
87
|
await executeCall(call, options);
|
|
88
88
|
if (resp === undefined) {
|
|
@@ -106,7 +106,7 @@ export class ReposClient {
|
|
|
106
106
|
httpClient: this.httpClient,
|
|
107
107
|
logger: this.logger,
|
|
108
108
|
});
|
|
109
|
-
resp = parseResponse(respBody,
|
|
109
|
+
resp = parseResponse(respBody, unmarshalGetRepoResponseSchema);
|
|
110
110
|
};
|
|
111
111
|
await executeCall(call, options);
|
|
112
112
|
if (resp === undefined) {
|
|
@@ -142,7 +142,7 @@ export class ReposClient {
|
|
|
142
142
|
httpClient: this.httpClient,
|
|
143
143
|
logger: this.logger,
|
|
144
144
|
});
|
|
145
|
-
resp = parseResponse(respBody,
|
|
145
|
+
resp = parseResponse(respBody, unmarshalListReposResponseSchema);
|
|
146
146
|
};
|
|
147
147
|
await executeCall(call, options);
|
|
148
148
|
if (resp === undefined) {
|
|
@@ -183,7 +183,7 @@ export class ReposClient {
|
|
|
183
183
|
httpClient: this.httpClient,
|
|
184
184
|
logger: this.logger,
|
|
185
185
|
});
|
|
186
|
-
resp = parseResponse(respBody,
|
|
186
|
+
resp = parseResponse(respBody, unmarshalUpdateRepoResponseSchema);
|
|
187
187
|
};
|
|
188
188
|
await executeCall(call, options);
|
|
189
189
|
if (resp === undefined) {
|
package/dist/v1/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAIvD,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,OAAO,MAAM,oBAAoB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAc7D,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM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AI,CAAC,WAAW,CAAC,CAAC;YACvD,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1C,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;YAC1E,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC;gBACrC,OAAO,EAAE,OAAO;gBAChB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,iCAAiC,CAAC,CAAC;QACpE,CAAC,CAAC;QACF,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ReposClient } from './client';
|
|
2
|
-
export type { CreateRepoRequest,
|
|
2
|
+
export type { CreateRepoRequest, CreateRepoResponse, DeleteProjectRequest, DeleteProjectResponse, GetRepoRequest, GetRepoResponse, ListReposRequest, ListReposResponse, RepoInfo, SparseCheckout, SparseCheckoutUpdate, UpdateRepoRequest, UpdateRepoResponse, } from './model';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/v1/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,YAAY,EACV,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
package/dist/v1/model.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface CreateRepoRequest {
|
|
|
21
21
|
*/
|
|
22
22
|
sparseCheckout?: SparseCheckout | undefined;
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface CreateRepoResponse {
|
|
25
25
|
/** ID of the Git folder (repo) object in the workspace. */
|
|
26
26
|
id?: bigint | undefined;
|
|
27
27
|
/** Path of the Git folder (repo) in the workspace. */
|
|
@@ -45,13 +45,13 @@ export interface DeleteProjectRequest {
|
|
|
45
45
|
/** The ID for the corresponding repo to delete. */
|
|
46
46
|
id?: bigint | undefined;
|
|
47
47
|
}
|
|
48
|
-
export interface
|
|
48
|
+
export interface DeleteProjectResponse {
|
|
49
49
|
}
|
|
50
50
|
export interface GetRepoRequest {
|
|
51
51
|
/** ID of the Git folder (repo) object in the workspace. */
|
|
52
52
|
id?: bigint | undefined;
|
|
53
53
|
}
|
|
54
|
-
export interface
|
|
54
|
+
export interface GetRepoResponse {
|
|
55
55
|
/** ID of the Git folder (repo) object in the workspace. */
|
|
56
56
|
id?: bigint | undefined;
|
|
57
57
|
/** Path of the Git folder (repo) in the workspace. */
|
|
@@ -84,7 +84,7 @@ export interface ListReposRequest {
|
|
|
84
84
|
*/
|
|
85
85
|
nextPageToken?: string | undefined;
|
|
86
86
|
}
|
|
87
|
-
export interface
|
|
87
|
+
export interface ListReposResponse {
|
|
88
88
|
/** List of Git folders (repos). */
|
|
89
89
|
repos?: RepoInfo[] | undefined;
|
|
90
90
|
/**
|
|
@@ -148,16 +148,29 @@ export interface UpdateRepoRequest {
|
|
|
148
148
|
* not enabled for the repo.
|
|
149
149
|
*/
|
|
150
150
|
sparseCheckout?: SparseCheckoutUpdate | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* WARNING: DESTRUCTIVE AND IRREVERSIBLE. If true, permanently deletes ALL uncommitted
|
|
153
|
+
* changes in the Git folder — staged, unstaged, and untracked files — before updating.
|
|
154
|
+
* Lost data CANNOT be recovered.
|
|
155
|
+
*
|
|
156
|
+
* NEVER use this on Git folders where users author or edit files. This flag is intended
|
|
157
|
+
* ONLY for automated jobs that treat the Git folder as a read-only mirror of a remote
|
|
158
|
+
* branch and need to force-sync it. If any user has uncommitted work in the Git folder,
|
|
159
|
+
* that work will be permanently destroyed without warning.
|
|
160
|
+
*
|
|
161
|
+
* Local commits that have been made but not yet pushed to the remote are preserved.
|
|
162
|
+
*/
|
|
163
|
+
dangerouslyForceDiscardAll?: boolean | undefined;
|
|
151
164
|
}
|
|
152
|
-
export interface
|
|
165
|
+
export interface UpdateRepoResponse {
|
|
153
166
|
}
|
|
154
|
-
export declare const
|
|
155
|
-
export declare const
|
|
156
|
-
export declare const
|
|
157
|
-
export declare const
|
|
167
|
+
export declare const unmarshalCreateRepoResponseSchema: z.ZodType<CreateRepoResponse>;
|
|
168
|
+
export declare const unmarshalDeleteProjectResponseSchema: z.ZodType<DeleteProjectResponse>;
|
|
169
|
+
export declare const unmarshalGetRepoResponseSchema: z.ZodType<GetRepoResponse>;
|
|
170
|
+
export declare const unmarshalListReposResponseSchema: z.ZodType<ListReposResponse>;
|
|
158
171
|
export declare const unmarshalRepoInfoSchema: z.ZodType<RepoInfo>;
|
|
159
172
|
export declare const unmarshalSparseCheckoutSchema: z.ZodType<SparseCheckout>;
|
|
160
|
-
export declare const
|
|
173
|
+
export declare const unmarshalUpdateRepoResponseSchema: z.ZodType<UpdateRepoResponse>;
|
|
161
174
|
export declare const marshalCreateRepoRequestSchema: z.ZodType;
|
|
162
175
|
export declare const marshalSparseCheckoutSchema: z.ZodType;
|
|
163
176
|
export declare const marshalSparseCheckoutUpdateSchema: z.ZodType;
|
package/dist/v1/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C;
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,M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EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CACpE,CAAC;AAEf,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAqBjE,CAAC;AAEN,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAQrE,CAAC;AAEN,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAqBnD,CAAC;AAEN,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAM/D,CAAC;AAEN,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAC9D,CAAC;AAEf,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAY1C,CAAC;AAEN,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAMvC,CAAC;AAEN,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAM7C,CAAC;AAEN,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAc1C,CAAC"}
|
package/dist/v1/model.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const unmarshalCreateRepoRequest_ResponseSchema = z
|
|
3
|
+
export const unmarshalCreateRepoResponseSchema = z
|
|
5
4
|
.object({
|
|
6
5
|
id: z
|
|
7
6
|
.union([z.number(), z.bigint()])
|
|
@@ -23,10 +22,8 @@ export const unmarshalCreateRepoRequest_ResponseSchema = z
|
|
|
23
22
|
headCommitId: d.head_commit_id,
|
|
24
23
|
sparseCheckout: d.sparse_checkout,
|
|
25
24
|
}));
|
|
26
|
-
|
|
27
|
-
export const
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
29
|
-
export const unmarshalGetRepoRequest_ResponseSchema = z
|
|
25
|
+
export const unmarshalDeleteProjectResponseSchema = z.object({});
|
|
26
|
+
export const unmarshalGetRepoResponseSchema = z
|
|
30
27
|
.object({
|
|
31
28
|
id: z
|
|
32
29
|
.union([z.number(), z.bigint()])
|
|
@@ -48,8 +45,7 @@ export const unmarshalGetRepoRequest_ResponseSchema = z
|
|
|
48
45
|
headCommitId: d.head_commit_id,
|
|
49
46
|
sparseCheckout: d.sparse_checkout,
|
|
50
47
|
}));
|
|
51
|
-
|
|
52
|
-
export const unmarshalListReposRequest_ResponseSchema = z
|
|
48
|
+
export const unmarshalListReposResponseSchema = z
|
|
53
49
|
.object({
|
|
54
50
|
repos: z.array(z.lazy(() => unmarshalRepoInfoSchema)).optional(),
|
|
55
51
|
next_page_token: z.string().optional(),
|
|
@@ -87,8 +83,7 @@ export const unmarshalSparseCheckoutSchema = z
|
|
|
87
83
|
.transform(d => ({
|
|
88
84
|
patterns: d.patterns,
|
|
89
85
|
}));
|
|
90
|
-
|
|
91
|
-
export const unmarshalUpdateRepoRequest_ResponseSchema = z.object({});
|
|
86
|
+
export const unmarshalUpdateRepoResponseSchema = z.object({});
|
|
92
87
|
export const marshalCreateRepoRequestSchema = z
|
|
93
88
|
.object({
|
|
94
89
|
url: z.string().optional(),
|
|
@@ -122,11 +117,13 @@ export const marshalUpdateRepoRequestSchema = z
|
|
|
122
117
|
branch: z.string().optional(),
|
|
123
118
|
tag: z.string().optional(),
|
|
124
119
|
sparseCheckout: z.lazy(() => marshalSparseCheckoutUpdateSchema).optional(),
|
|
120
|
+
dangerouslyForceDiscardAll: z.boolean().optional(),
|
|
125
121
|
})
|
|
126
122
|
.transform(d => ({
|
|
127
123
|
id: d.id,
|
|
128
124
|
branch: d.branch,
|
|
129
125
|
tag: d.tag,
|
|
130
126
|
sparse_checkout: d.sparseCheckout,
|
|
127
|
+
dangerously_force_discard_all: d.dangerouslyForceDiscardAll,
|
|
131
128
|
}));
|
|
132
129
|
//# sourceMappingURL=model.js.map
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAoLtB,MAAM,CAAC,MAAM,iCAAiC,GAC5C,CAAC;KACE,MAAM,CAAC;IACN,EAAE,EAAE,CAAC;SACF,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC/B,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACzB,QAAQ,EAAE;IACb,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC,CAAC,QAAQ,EAAE;CACxE,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,EAAE,EAAE,CAAC,CAAC,EAAE;IACR,IAAI,EAAE,CAAC,CAAC,IAAI;IACZ,GAAG,EAAE,CAAC,CAAC,GAAG;IACV,QAAQ,EAAE,CAAC,CAAC,QAAQ;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM;IAChB,YAAY,EAAE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,CAAC;AAO3B,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CASf;AA2BD,wBAAsB,eAAe,CACnC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,UAAU,CAAC,CA2BrB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,GACzC,WAAW,CASb;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAK1E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAEvE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,GACtB,IAAI,CAuBN"}
|
package/dist/v1/utils.js
CHANGED
|
@@ -79,7 +79,8 @@ export function buildHttpRequest(method, url, headers, signal, body) {
|
|
|
79
79
|
}
|
|
80
80
|
export function parseResponse(body, schema) {
|
|
81
81
|
const text = new TextDecoder().decode(body);
|
|
82
|
-
|
|
82
|
+
// 204 responses return an empty body; treat as `{}`.
|
|
83
|
+
const parsed = text === '' ? {} : jsonBigint.parse(text);
|
|
83
84
|
return schema.parse(parsed);
|
|
84
85
|
}
|
|
85
86
|
export function marshalRequest(data, schema) {
|
package/dist/v1/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAQvD,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,0EAA0E;AAC1E,6EAA6E;AAC7E,gEAAgE;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,EAAC,eAAe,EAAE,IAAI,EAAC,CAAC,CAAC;AAQpD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA6C,EAC7C,OAAqB;IAErB,MAAM,IAAI,GAAY;QACpB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;QACjE,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,IAAI;YACxC,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC;QACF,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;KAClE,CAAC;IACF,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,KAAK,UAAU,OAAO,CACpB,IAAuC;IAEvC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,SAAS,CAAC;QAC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KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;YAC1E,kBAAkB,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;SAAM,IACL,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-repos",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./v1": {
|
|
8
8
|
"types": "./dist/v1/index.d.ts",
|
|
9
|
-
"import": "./dist/v1/index.js"
|
|
9
|
+
"import": "./dist/v1/index.js",
|
|
10
|
+
"default": "./dist/v1/index.js"
|
|
10
11
|
}
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"dist",
|
|
14
|
-
"src",
|
|
15
15
|
"LICENSE"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"author": "Databricks",
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@databricks/sdk-auth": ">=0.1.0-dev.
|
|
32
|
-
"@databricks/sdk-core": ">=0.1.0-dev.
|
|
33
|
-
"@databricks/sdk-options": ">=0.1.0-dev.
|
|
31
|
+
"@databricks/sdk-auth": ">=0.1.0-dev.5 <1.0.0",
|
|
32
|
+
"@databricks/sdk-core": ">=0.1.0-dev.6 <1.0.0",
|
|
33
|
+
"@databricks/sdk-options": ">=0.1.0-dev.5 <1.0.0",
|
|
34
34
|
"@js-temporal/polyfill": "^0.5.0",
|
|
35
35
|
"json-bigint": "^1.0.0",
|
|
36
36
|
"zod": "^4.3.6"
|
package/src/v1/client.ts
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
|
|
4
|
-
import {createDefault} from '@databricks/sdk-core/clientinfo';
|
|
5
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
6
|
-
import {NoOpLogger} from '@databricks/sdk-core/logger';
|
|
7
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
8
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
9
|
-
import type {HttpClient} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newHttpClient} from './transport';
|
|
11
|
-
import {
|
|
12
|
-
buildHttpRequest,
|
|
13
|
-
executeCall,
|
|
14
|
-
executeHttpCall,
|
|
15
|
-
marshalRequest,
|
|
16
|
-
parseResponse,
|
|
17
|
-
} from './utils';
|
|
18
|
-
import pkgJson from '../../package.json' with {type: 'json'};
|
|
19
|
-
import type {
|
|
20
|
-
CreateRepoRequest,
|
|
21
|
-
CreateRepoRequest_Response,
|
|
22
|
-
DeleteProjectRequest,
|
|
23
|
-
DeleteProjectRequest_Response,
|
|
24
|
-
GetRepoRequest,
|
|
25
|
-
GetRepoRequest_Response,
|
|
26
|
-
ListReposRequest,
|
|
27
|
-
ListReposRequest_Response,
|
|
28
|
-
RepoInfo,
|
|
29
|
-
UpdateRepoRequest,
|
|
30
|
-
UpdateRepoRequest_Response,
|
|
31
|
-
} from './model';
|
|
32
|
-
import {
|
|
33
|
-
marshalCreateRepoRequestSchema,
|
|
34
|
-
marshalUpdateRepoRequestSchema,
|
|
35
|
-
unmarshalCreateRepoRequest_ResponseSchema,
|
|
36
|
-
unmarshalDeleteProjectRequest_ResponseSchema,
|
|
37
|
-
unmarshalGetRepoRequest_ResponseSchema,
|
|
38
|
-
unmarshalListReposRequest_ResponseSchema,
|
|
39
|
-
unmarshalUpdateRepoRequest_ResponseSchema,
|
|
40
|
-
} from './model';
|
|
41
|
-
|
|
42
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
43
|
-
const PACKAGE_SEGMENT = {
|
|
44
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
45
|
-
value: pkgJson.version,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export class ReposClient {
|
|
49
|
-
private readonly host: string;
|
|
50
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
51
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
52
|
-
// request.
|
|
53
|
-
private readonly workspaceId: string | undefined;
|
|
54
|
-
private readonly httpClient: HttpClient;
|
|
55
|
-
private readonly logger: Logger;
|
|
56
|
-
// User-Agent header value. Composed once at construction from
|
|
57
|
-
// createDefault() merged with this package's identity and the active
|
|
58
|
-
// credential's name.
|
|
59
|
-
private readonly userAgent: string;
|
|
60
|
-
|
|
61
|
-
constructor(options: ClientOptions) {
|
|
62
|
-
if (options.host === undefined) {
|
|
63
|
-
throw new Error('Host is required.');
|
|
64
|
-
}
|
|
65
|
-
this.host = options.host.replace(/\/$/, '');
|
|
66
|
-
this.workspaceId = options.workspaceId;
|
|
67
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
68
|
-
const info = createDefault()
|
|
69
|
-
.with(PACKAGE_SEGMENT)
|
|
70
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
71
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
72
|
-
this.userAgent = info.toString();
|
|
73
|
-
this.httpClient = newHttpClient(options);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Creates a repo in the workspace and links it to the remote Git repo specified.
|
|
78
|
-
* Note that repos created programmatically must be linked to a remote Git repo, unlike repos
|
|
79
|
-
* created in the browser.
|
|
80
|
-
*/
|
|
81
|
-
async createRepo(
|
|
82
|
-
req: CreateRepoRequest,
|
|
83
|
-
options?: CallOptions
|
|
84
|
-
): Promise<CreateRepoRequest_Response> {
|
|
85
|
-
const url = `${this.host}/api/2.0/repos`;
|
|
86
|
-
const body = marshalRequest(req, marshalCreateRepoRequestSchema);
|
|
87
|
-
let resp: CreateRepoRequest_Response | undefined;
|
|
88
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
89
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
90
|
-
if (this.workspaceId !== undefined) {
|
|
91
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
92
|
-
}
|
|
93
|
-
headers.set('User-Agent', this.userAgent);
|
|
94
|
-
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
95
|
-
const respBody = await executeHttpCall({
|
|
96
|
-
request: httpReq,
|
|
97
|
-
httpClient: this.httpClient,
|
|
98
|
-
logger: this.logger,
|
|
99
|
-
});
|
|
100
|
-
resp = parseResponse(respBody, unmarshalCreateRepoRequest_ResponseSchema);
|
|
101
|
-
};
|
|
102
|
-
await executeCall(call, options);
|
|
103
|
-
if (resp === undefined) {
|
|
104
|
-
throw new Error('operation completed without a result.');
|
|
105
|
-
}
|
|
106
|
-
return resp;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** Deletes the specified repo. */
|
|
110
|
-
async deleteProject(
|
|
111
|
-
req: DeleteProjectRequest,
|
|
112
|
-
options?: CallOptions
|
|
113
|
-
): Promise<DeleteProjectRequest_Response> {
|
|
114
|
-
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
115
|
-
let resp: DeleteProjectRequest_Response | undefined;
|
|
116
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
117
|
-
const headers = new Headers();
|
|
118
|
-
if (this.workspaceId !== undefined) {
|
|
119
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
120
|
-
}
|
|
121
|
-
headers.set('User-Agent', this.userAgent);
|
|
122
|
-
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
123
|
-
const respBody = await executeHttpCall({
|
|
124
|
-
request: httpReq,
|
|
125
|
-
httpClient: this.httpClient,
|
|
126
|
-
logger: this.logger,
|
|
127
|
-
});
|
|
128
|
-
resp = parseResponse(
|
|
129
|
-
respBody,
|
|
130
|
-
unmarshalDeleteProjectRequest_ResponseSchema
|
|
131
|
-
);
|
|
132
|
-
};
|
|
133
|
-
await executeCall(call, options);
|
|
134
|
-
if (resp === undefined) {
|
|
135
|
-
throw new Error('operation completed without a result.');
|
|
136
|
-
}
|
|
137
|
-
return resp;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** Returns the repo with the given repo ID. */
|
|
141
|
-
async getRepo(
|
|
142
|
-
req: GetRepoRequest,
|
|
143
|
-
options?: CallOptions
|
|
144
|
-
): Promise<GetRepoRequest_Response> {
|
|
145
|
-
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
146
|
-
let resp: GetRepoRequest_Response | undefined;
|
|
147
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
148
|
-
const headers = new Headers();
|
|
149
|
-
if (this.workspaceId !== undefined) {
|
|
150
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
151
|
-
}
|
|
152
|
-
headers.set('User-Agent', this.userAgent);
|
|
153
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
154
|
-
const respBody = await executeHttpCall({
|
|
155
|
-
request: httpReq,
|
|
156
|
-
httpClient: this.httpClient,
|
|
157
|
-
logger: this.logger,
|
|
158
|
-
});
|
|
159
|
-
resp = parseResponse(respBody, unmarshalGetRepoRequest_ResponseSchema);
|
|
160
|
-
};
|
|
161
|
-
await executeCall(call, options);
|
|
162
|
-
if (resp === undefined) {
|
|
163
|
-
throw new Error('operation completed without a result.');
|
|
164
|
-
}
|
|
165
|
-
return resp;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Returns repos that the calling user has Manage permissions on.
|
|
170
|
-
* Use `next_page_token` to iterate through additional pages.
|
|
171
|
-
*/
|
|
172
|
-
async listRepos(
|
|
173
|
-
req: ListReposRequest,
|
|
174
|
-
options?: CallOptions
|
|
175
|
-
): Promise<ListReposRequest_Response> {
|
|
176
|
-
const url = `${this.host}/api/2.0/repos`;
|
|
177
|
-
const params = new URLSearchParams();
|
|
178
|
-
if (req.pathPrefix !== undefined) {
|
|
179
|
-
params.append('path_prefix', req.pathPrefix);
|
|
180
|
-
}
|
|
181
|
-
if (req.nextPageToken !== undefined) {
|
|
182
|
-
params.append('next_page_token', req.nextPageToken);
|
|
183
|
-
}
|
|
184
|
-
const query = params.toString();
|
|
185
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
186
|
-
let resp: ListReposRequest_Response | undefined;
|
|
187
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
188
|
-
const headers = new Headers();
|
|
189
|
-
if (this.workspaceId !== undefined) {
|
|
190
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
191
|
-
}
|
|
192
|
-
headers.set('User-Agent', this.userAgent);
|
|
193
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
194
|
-
const respBody = await executeHttpCall({
|
|
195
|
-
request: httpReq,
|
|
196
|
-
httpClient: this.httpClient,
|
|
197
|
-
logger: this.logger,
|
|
198
|
-
});
|
|
199
|
-
resp = parseResponse(respBody, unmarshalListReposRequest_ResponseSchema);
|
|
200
|
-
};
|
|
201
|
-
await executeCall(call, options);
|
|
202
|
-
if (resp === undefined) {
|
|
203
|
-
throw new Error('operation completed without a result.');
|
|
204
|
-
}
|
|
205
|
-
return resp;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
async *listReposIter(
|
|
209
|
-
req: ListReposRequest,
|
|
210
|
-
options?: CallOptions
|
|
211
|
-
): AsyncGenerator<RepoInfo> {
|
|
212
|
-
const pageReq: ListReposRequest = {...req};
|
|
213
|
-
for (;;) {
|
|
214
|
-
const resp = await this.listRepos(pageReq, options);
|
|
215
|
-
for (const item of resp.repos ?? []) {
|
|
216
|
-
yield item;
|
|
217
|
-
}
|
|
218
|
-
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
pageReq.nextPageToken = resp.nextPageToken;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Updates the repo to a different branch or tag, or updates the repo to the latest commit on
|
|
227
|
-
* the same branch.
|
|
228
|
-
*/
|
|
229
|
-
async updateRepo(
|
|
230
|
-
req: UpdateRepoRequest,
|
|
231
|
-
options?: CallOptions
|
|
232
|
-
): Promise<UpdateRepoRequest_Response> {
|
|
233
|
-
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
234
|
-
const body = marshalRequest(req, marshalUpdateRepoRequestSchema);
|
|
235
|
-
let resp: UpdateRepoRequest_Response | undefined;
|
|
236
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
237
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
238
|
-
if (this.workspaceId !== undefined) {
|
|
239
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
240
|
-
}
|
|
241
|
-
headers.set('User-Agent', this.userAgent);
|
|
242
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
243
|
-
const respBody = await executeHttpCall({
|
|
244
|
-
request: httpReq,
|
|
245
|
-
httpClient: this.httpClient,
|
|
246
|
-
logger: this.logger,
|
|
247
|
-
});
|
|
248
|
-
resp = parseResponse(respBody, unmarshalUpdateRepoRequest_ResponseSchema);
|
|
249
|
-
};
|
|
250
|
-
await executeCall(call, options);
|
|
251
|
-
if (resp === undefined) {
|
|
252
|
-
throw new Error('operation completed without a result.');
|
|
253
|
-
}
|
|
254
|
-
return resp;
|
|
255
|
-
}
|
|
256
|
-
}
|
package/src/v1/index.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {ReposClient} from './client';
|
|
4
|
-
|
|
5
|
-
export type {
|
|
6
|
-
CreateRepoRequest,
|
|
7
|
-
CreateRepoRequest_Response,
|
|
8
|
-
DeleteProjectRequest,
|
|
9
|
-
DeleteProjectRequest_Response,
|
|
10
|
-
GetRepoRequest,
|
|
11
|
-
GetRepoRequest_Response,
|
|
12
|
-
ListReposRequest,
|
|
13
|
-
ListReposRequest_Response,
|
|
14
|
-
RepoInfo,
|
|
15
|
-
SparseCheckout,
|
|
16
|
-
SparseCheckoutUpdate,
|
|
17
|
-
UpdateRepoRequest,
|
|
18
|
-
UpdateRepoRequest_Response,
|
|
19
|
-
} from './model';
|
package/src/v1/model.ts
DELETED
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
|
|
5
|
-
export interface CreateRepoRequest {
|
|
6
|
-
/** URL of the Git repository to be linked. */
|
|
7
|
-
url?: string | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
|
|
10
|
-
* `bitbucketCloud`, `gitLab`, `azureDevOpsServices` (Azure DevOps Services, including
|
|
11
|
-
* Microsoft Entra ID authentication), `gitHubEnterprise`, `bitbucketServer` (Bitbucket
|
|
12
|
-
* Data Center), `gitLabEnterpriseEdition` (GitLab Self-Managed), and `awsCodeCommit`
|
|
13
|
-
* (deprecated by AWS, not accepting new customers).
|
|
14
|
-
*/
|
|
15
|
-
provider?: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Desired path for the repo in the workspace. Almost any path in the workspace can be chosen.
|
|
18
|
-
* If repo is created in `/Repos`, path must be in the format `/Repos/{folder}/{repo-name}`.
|
|
19
|
-
*/
|
|
20
|
-
path?: string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* If specified, the repo will be created with sparse checkout enabled. You cannot enable/disable
|
|
23
|
-
* sparse checkout after the repo is created.
|
|
24
|
-
*/
|
|
25
|
-
sparseCheckout?: SparseCheckout | undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
29
|
-
export interface CreateRepoRequest_Response {
|
|
30
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
31
|
-
id?: bigint | undefined;
|
|
32
|
-
/** Path of the Git folder (repo) in the workspace. */
|
|
33
|
-
path?: string | undefined;
|
|
34
|
-
/** URL of the linked Git repository. */
|
|
35
|
-
url?: string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Git provider of the linked Git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
38
|
-
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
39
|
-
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
40
|
-
*/
|
|
41
|
-
provider?: string | undefined;
|
|
42
|
-
/** Branch that the Git folder (repo) is checked out to. */
|
|
43
|
-
branch?: string | undefined;
|
|
44
|
-
/** SHA-1 hash representing the commit ID of the current HEAD of the Git folder (repo). */
|
|
45
|
-
headCommitId?: string | undefined;
|
|
46
|
-
/** Sparse checkout settings for the Git folder (repo). */
|
|
47
|
-
sparseCheckout?: SparseCheckout | undefined;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface DeleteProjectRequest {
|
|
51
|
-
/** The ID for the corresponding repo to delete. */
|
|
52
|
-
id?: bigint | undefined;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
56
|
-
export interface DeleteProjectRequest_Response {}
|
|
57
|
-
|
|
58
|
-
export interface GetRepoRequest {
|
|
59
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
60
|
-
id?: bigint | undefined;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
64
|
-
export interface GetRepoRequest_Response {
|
|
65
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
66
|
-
id?: bigint | undefined;
|
|
67
|
-
/** Path of the Git folder (repo) in the workspace. */
|
|
68
|
-
path?: string | undefined;
|
|
69
|
-
/** URL of the linked Git repository. */
|
|
70
|
-
url?: string | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Git provider of the linked Git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
73
|
-
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
74
|
-
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
75
|
-
*/
|
|
76
|
-
provider?: string | undefined;
|
|
77
|
-
/** Branch that the local version of the repo is checked out to. */
|
|
78
|
-
branch?: string | undefined;
|
|
79
|
-
/** SHA-1 hash representing the commit ID of the current HEAD of the repo. */
|
|
80
|
-
headCommitId?: string | undefined;
|
|
81
|
-
/** Sparse checkout settings for the Git folder (repo). */
|
|
82
|
-
sparseCheckout?: SparseCheckout | undefined;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface ListReposRequest {
|
|
86
|
-
/**
|
|
87
|
-
* Filters repos that have paths starting with the given path prefix.
|
|
88
|
-
* If not provided or when provided an effectively empty prefix (`/` or `/Workspace`)
|
|
89
|
-
* Git folders (repos) from `/Workspace/Repos` will be served.
|
|
90
|
-
*/
|
|
91
|
-
pathPrefix?: string | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* Token used to get the next page of results. If not specified, returns the first page of
|
|
94
|
-
* results as well as a next page token if there are more results.
|
|
95
|
-
*/
|
|
96
|
-
nextPageToken?: string | undefined;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
100
|
-
export interface ListReposRequest_Response {
|
|
101
|
-
/** List of Git folders (repos). */
|
|
102
|
-
repos?: RepoInfo[] | undefined;
|
|
103
|
-
/**
|
|
104
|
-
* Token that can be specified as a query parameter to the `GET /repos` endpoint to retrieve
|
|
105
|
-
* the next page of results.
|
|
106
|
-
*/
|
|
107
|
-
nextPageToken?: string | undefined;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** Git folder (repo) information. */
|
|
111
|
-
export interface RepoInfo {
|
|
112
|
-
/** Id of the git folder (repo) in the Workspace. */
|
|
113
|
-
id?: bigint | undefined;
|
|
114
|
-
/** Root path of the git folder (repo) in the Workspace. */
|
|
115
|
-
path?: string | undefined;
|
|
116
|
-
/** URL of the remote git repository. */
|
|
117
|
-
url?: string | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* Git provider of the remote git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
120
|
-
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
121
|
-
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
122
|
-
*/
|
|
123
|
-
provider?: string | undefined;
|
|
124
|
-
/** Name of the current git branch of the git folder (repo). */
|
|
125
|
-
branch?: string | undefined;
|
|
126
|
-
/** Current git commit id of the git folder (repo). */
|
|
127
|
-
headCommitId?: string | undefined;
|
|
128
|
-
/** Sparse checkout config for the git folder (repo). */
|
|
129
|
-
sparseCheckout?: SparseCheckout | undefined;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/** Sparse checkout configuration, it contains options like cone patterns. */
|
|
133
|
-
export interface SparseCheckout {
|
|
134
|
-
/**
|
|
135
|
-
* List of sparse checkout cone patterns, see
|
|
136
|
-
* [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling)
|
|
137
|
-
* for details.
|
|
138
|
-
*/
|
|
139
|
-
patterns?: string[] | undefined;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/** Sparse checkout configuration, it contains options like cone patterns. */
|
|
143
|
-
export interface SparseCheckoutUpdate {
|
|
144
|
-
/**
|
|
145
|
-
* List of sparse checkout cone patterns, see
|
|
146
|
-
* [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling)
|
|
147
|
-
* for details.
|
|
148
|
-
*/
|
|
149
|
-
patterns?: string[] | undefined;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface UpdateRepoRequest {
|
|
153
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
154
|
-
id?: bigint | undefined;
|
|
155
|
-
/** Branch that the local version of the repo is checked out to. */
|
|
156
|
-
branch?: string | undefined;
|
|
157
|
-
/**
|
|
158
|
-
* Tag that the local version of the repo is checked out to. Updating the repo to a tag puts
|
|
159
|
-
* the repo in a detached HEAD state. Before committing new changes, you must update the repo to
|
|
160
|
-
* a branch instead of the detached HEAD.
|
|
161
|
-
*/
|
|
162
|
-
tag?: string | undefined;
|
|
163
|
-
/**
|
|
164
|
-
* If specified, update the sparse checkout settings. The update will fail if sparse checkout is
|
|
165
|
-
* not enabled for the repo.
|
|
166
|
-
*/
|
|
167
|
-
sparseCheckout?: SparseCheckoutUpdate | undefined;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
171
|
-
export interface UpdateRepoRequest_Response {}
|
|
172
|
-
|
|
173
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
174
|
-
export const unmarshalCreateRepoRequest_ResponseSchema: z.ZodType<CreateRepoRequest_Response> =
|
|
175
|
-
z
|
|
176
|
-
.object({
|
|
177
|
-
id: z
|
|
178
|
-
.union([z.number(), z.bigint()])
|
|
179
|
-
.transform(v => BigInt(v))
|
|
180
|
-
.optional(),
|
|
181
|
-
path: z.string().optional(),
|
|
182
|
-
url: z.string().optional(),
|
|
183
|
-
provider: z.string().optional(),
|
|
184
|
-
branch: z.string().optional(),
|
|
185
|
-
head_commit_id: z.string().optional(),
|
|
186
|
-
sparse_checkout: z.lazy(() => unmarshalSparseCheckoutSchema).optional(),
|
|
187
|
-
})
|
|
188
|
-
.transform(d => ({
|
|
189
|
-
id: d.id,
|
|
190
|
-
path: d.path,
|
|
191
|
-
url: d.url,
|
|
192
|
-
provider: d.provider,
|
|
193
|
-
branch: d.branch,
|
|
194
|
-
headCommitId: d.head_commit_id,
|
|
195
|
-
sparseCheckout: d.sparse_checkout,
|
|
196
|
-
}));
|
|
197
|
-
|
|
198
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
199
|
-
export const unmarshalDeleteProjectRequest_ResponseSchema: z.ZodType<DeleteProjectRequest_Response> =
|
|
200
|
-
z.object({});
|
|
201
|
-
|
|
202
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
203
|
-
export const unmarshalGetRepoRequest_ResponseSchema: z.ZodType<GetRepoRequest_Response> =
|
|
204
|
-
z
|
|
205
|
-
.object({
|
|
206
|
-
id: z
|
|
207
|
-
.union([z.number(), z.bigint()])
|
|
208
|
-
.transform(v => BigInt(v))
|
|
209
|
-
.optional(),
|
|
210
|
-
path: z.string().optional(),
|
|
211
|
-
url: z.string().optional(),
|
|
212
|
-
provider: z.string().optional(),
|
|
213
|
-
branch: z.string().optional(),
|
|
214
|
-
head_commit_id: z.string().optional(),
|
|
215
|
-
sparse_checkout: z.lazy(() => unmarshalSparseCheckoutSchema).optional(),
|
|
216
|
-
})
|
|
217
|
-
.transform(d => ({
|
|
218
|
-
id: d.id,
|
|
219
|
-
path: d.path,
|
|
220
|
-
url: d.url,
|
|
221
|
-
provider: d.provider,
|
|
222
|
-
branch: d.branch,
|
|
223
|
-
headCommitId: d.head_commit_id,
|
|
224
|
-
sparseCheckout: d.sparse_checkout,
|
|
225
|
-
}));
|
|
226
|
-
|
|
227
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
228
|
-
export const unmarshalListReposRequest_ResponseSchema: z.ZodType<ListReposRequest_Response> =
|
|
229
|
-
z
|
|
230
|
-
.object({
|
|
231
|
-
repos: z.array(z.lazy(() => unmarshalRepoInfoSchema)).optional(),
|
|
232
|
-
next_page_token: z.string().optional(),
|
|
233
|
-
})
|
|
234
|
-
.transform(d => ({
|
|
235
|
-
repos: d.repos,
|
|
236
|
-
nextPageToken: d.next_page_token,
|
|
237
|
-
}));
|
|
238
|
-
|
|
239
|
-
export const unmarshalRepoInfoSchema: z.ZodType<RepoInfo> = z
|
|
240
|
-
.object({
|
|
241
|
-
id: z
|
|
242
|
-
.union([z.number(), z.bigint()])
|
|
243
|
-
.transform(v => BigInt(v))
|
|
244
|
-
.optional(),
|
|
245
|
-
path: z.string().optional(),
|
|
246
|
-
url: z.string().optional(),
|
|
247
|
-
provider: z.string().optional(),
|
|
248
|
-
branch: z.string().optional(),
|
|
249
|
-
head_commit_id: z.string().optional(),
|
|
250
|
-
sparse_checkout: z.lazy(() => unmarshalSparseCheckoutSchema).optional(),
|
|
251
|
-
})
|
|
252
|
-
.transform(d => ({
|
|
253
|
-
id: d.id,
|
|
254
|
-
path: d.path,
|
|
255
|
-
url: d.url,
|
|
256
|
-
provider: d.provider,
|
|
257
|
-
branch: d.branch,
|
|
258
|
-
headCommitId: d.head_commit_id,
|
|
259
|
-
sparseCheckout: d.sparse_checkout,
|
|
260
|
-
}));
|
|
261
|
-
|
|
262
|
-
export const unmarshalSparseCheckoutSchema: z.ZodType<SparseCheckout> = z
|
|
263
|
-
.object({
|
|
264
|
-
patterns: z.array(z.string()).optional(),
|
|
265
|
-
})
|
|
266
|
-
.transform(d => ({
|
|
267
|
-
patterns: d.patterns,
|
|
268
|
-
}));
|
|
269
|
-
|
|
270
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
271
|
-
export const unmarshalUpdateRepoRequest_ResponseSchema: z.ZodType<UpdateRepoRequest_Response> =
|
|
272
|
-
z.object({});
|
|
273
|
-
|
|
274
|
-
export const marshalCreateRepoRequestSchema: z.ZodType = z
|
|
275
|
-
.object({
|
|
276
|
-
url: z.string().optional(),
|
|
277
|
-
provider: z.string().optional(),
|
|
278
|
-
path: z.string().optional(),
|
|
279
|
-
sparseCheckout: z.lazy(() => marshalSparseCheckoutSchema).optional(),
|
|
280
|
-
})
|
|
281
|
-
.transform(d => ({
|
|
282
|
-
url: d.url,
|
|
283
|
-
provider: d.provider,
|
|
284
|
-
path: d.path,
|
|
285
|
-
sparse_checkout: d.sparseCheckout,
|
|
286
|
-
}));
|
|
287
|
-
|
|
288
|
-
export const marshalSparseCheckoutSchema: z.ZodType = z
|
|
289
|
-
.object({
|
|
290
|
-
patterns: z.array(z.string()).optional(),
|
|
291
|
-
})
|
|
292
|
-
.transform(d => ({
|
|
293
|
-
patterns: d.patterns,
|
|
294
|
-
}));
|
|
295
|
-
|
|
296
|
-
export const marshalSparseCheckoutUpdateSchema: z.ZodType = z
|
|
297
|
-
.object({
|
|
298
|
-
patterns: z.array(z.string()).optional(),
|
|
299
|
-
})
|
|
300
|
-
.transform(d => ({
|
|
301
|
-
patterns: d.patterns,
|
|
302
|
-
}));
|
|
303
|
-
|
|
304
|
-
export const marshalUpdateRepoRequestSchema: z.ZodType = z
|
|
305
|
-
.object({
|
|
306
|
-
id: z.bigint().optional(),
|
|
307
|
-
branch: z.string().optional(),
|
|
308
|
-
tag: z.string().optional(),
|
|
309
|
-
sparseCheckout: z.lazy(() => marshalSparseCheckoutUpdateSchema).optional(),
|
|
310
|
-
})
|
|
311
|
-
.transform(d => ({
|
|
312
|
-
id: d.id,
|
|
313
|
-
branch: d.branch,
|
|
314
|
-
tag: d.tag,
|
|
315
|
-
sparse_checkout: d.sparseCheckout,
|
|
316
|
-
}));
|
package/src/v1/transport.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Credentials} from '@databricks/sdk-auth';
|
|
4
|
-
import {defaultCredentials} from '@databricks/sdk-auth/credentials';
|
|
5
|
-
import type {
|
|
6
|
-
HttpClient,
|
|
7
|
-
HttpRequest,
|
|
8
|
-
HttpResponse,
|
|
9
|
-
} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newFetchHttpClient} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
12
|
-
|
|
13
|
-
/** Creates a new HTTP client with the given options. */
|
|
14
|
-
export function newHttpClient(options?: ClientOptions): HttpClient {
|
|
15
|
-
const opts = options ?? {};
|
|
16
|
-
|
|
17
|
-
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
18
|
-
// also set, since they would be silently ignored.
|
|
19
|
-
if (opts.httpClient !== undefined) {
|
|
20
|
-
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
'httpClient cannot be combined with credentials or timeout'
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
return opts.httpClient;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const credentials = opts.credentials ?? defaultCredentials();
|
|
29
|
-
|
|
30
|
-
const base = newFetchHttpClient();
|
|
31
|
-
let client: HttpClient = new AuthHttpClient(base, credentials);
|
|
32
|
-
|
|
33
|
-
if (opts.timeout !== undefined) {
|
|
34
|
-
client = new TimeoutHttpClient(client, opts.timeout);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return client;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
class AuthHttpClient implements HttpClient {
|
|
42
|
-
constructor(
|
|
43
|
-
private readonly base: HttpClient,
|
|
44
|
-
private readonly credentials: Credentials
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
48
|
-
const authHeaders = await this.credentials.authHeaders();
|
|
49
|
-
// Do not modify the original request.
|
|
50
|
-
const headers = new Headers(request.headers);
|
|
51
|
-
for (const h of authHeaders) {
|
|
52
|
-
headers.set(h.key, h.value);
|
|
53
|
-
}
|
|
54
|
-
return this.base.send({...request, headers});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
class TimeoutHttpClient implements HttpClient {
|
|
60
|
-
constructor(
|
|
61
|
-
private readonly base: HttpClient,
|
|
62
|
-
private readonly timeout: number
|
|
63
|
-
) {}
|
|
64
|
-
|
|
65
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
66
|
-
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
67
|
-
const signal =
|
|
68
|
-
request.signal !== undefined
|
|
69
|
-
? AbortSignal.any([request.signal, timeoutSignal])
|
|
70
|
-
: timeoutSignal;
|
|
71
|
-
return this.base.send({...request, signal});
|
|
72
|
-
}
|
|
73
|
-
}
|
package/src/v1/utils.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Options} from '@databricks/sdk-core/ops';
|
|
4
|
-
import {execute} from '@databricks/sdk-core/ops';
|
|
5
|
-
import {ApiError} from '@databricks/sdk-core/apierror';
|
|
6
|
-
import type {
|
|
7
|
-
HttpClient,
|
|
8
|
-
HttpRequest,
|
|
9
|
-
HttpResponse,
|
|
10
|
-
} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
12
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
13
|
-
import JSONBig from 'json-bigint';
|
|
14
|
-
import type {z} from 'zod';
|
|
15
|
-
|
|
16
|
-
// JSON codec that preserves int64 precision. On the way in, large integer
|
|
17
|
-
// literals come back as bigint instead of being rounded to JS Number. On the
|
|
18
|
-
// way out, bigint values are emitted as raw JSON number digits.
|
|
19
|
-
const jsonBigint = JSONBig({useNativeBigInt: true});
|
|
20
|
-
|
|
21
|
-
export interface HttpCallOptions {
|
|
22
|
-
readonly request: HttpRequest;
|
|
23
|
-
readonly httpClient: HttpClient;
|
|
24
|
-
readonly logger: Logger;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Translates public CallOptions to the internal Options shape accepted by
|
|
29
|
-
* execute(). Even though the shapes match today, this isolates the public
|
|
30
|
-
* API from the executor's internal type so they can diverge.
|
|
31
|
-
*/
|
|
32
|
-
export async function executeCall(
|
|
33
|
-
call: (signal?: AbortSignal) => Promise<void>,
|
|
34
|
-
options?: CallOptions
|
|
35
|
-
): Promise<void> {
|
|
36
|
-
const opts: Options = {
|
|
37
|
-
...(options?.retrier !== undefined && {retrier: options.retrier}),
|
|
38
|
-
...(options?.rateLimiter !== undefined && {
|
|
39
|
-
rateLimiter: options.rateLimiter,
|
|
40
|
-
}),
|
|
41
|
-
...(options?.timeout !== undefined && {timeout: options.timeout}),
|
|
42
|
-
};
|
|
43
|
-
return execute(options?.signal, call, opts);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function readAll(
|
|
47
|
-
body: ReadableStream<Uint8Array> | null
|
|
48
|
-
): Promise<Uint8Array> {
|
|
49
|
-
if (body === null) {
|
|
50
|
-
return new Uint8Array(0);
|
|
51
|
-
}
|
|
52
|
-
const reader = body.getReader();
|
|
53
|
-
const chunks: Uint8Array[] = [];
|
|
54
|
-
for (;;) {
|
|
55
|
-
const {done, value} = await reader.read();
|
|
56
|
-
if (done) {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
chunks.push(value);
|
|
60
|
-
}
|
|
61
|
-
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
62
|
-
const result = new Uint8Array(totalLength);
|
|
63
|
-
let offset = 0;
|
|
64
|
-
for (const chunk of chunks) {
|
|
65
|
-
result.set(chunk, offset);
|
|
66
|
-
offset += chunk.length;
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export async function executeHttpCall(
|
|
72
|
-
opts: HttpCallOptions
|
|
73
|
-
): Promise<Uint8Array> {
|
|
74
|
-
opts.logger.debug('HTTP request', {
|
|
75
|
-
method: opts.request.method,
|
|
76
|
-
url: opts.request.url,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
let resp: HttpResponse;
|
|
80
|
-
try {
|
|
81
|
-
resp = await opts.httpClient.send(opts.request);
|
|
82
|
-
} catch (e: unknown) {
|
|
83
|
-
opts.logger.debug('HTTP request failed');
|
|
84
|
-
throw e;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const body = await readAll(resp.body);
|
|
88
|
-
|
|
89
|
-
opts.logger.debug('HTTP response', {
|
|
90
|
-
statusCode: resp.statusCode,
|
|
91
|
-
body: new TextDecoder().decode(body),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
|
|
95
|
-
if (apiErr !== undefined) {
|
|
96
|
-
throw apiErr;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return body;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function buildHttpRequest(
|
|
103
|
-
method: string,
|
|
104
|
-
url: string,
|
|
105
|
-
headers: Headers,
|
|
106
|
-
signal?: AbortSignal,
|
|
107
|
-
body?: string | ReadableStream<Uint8Array>
|
|
108
|
-
): HttpRequest {
|
|
109
|
-
const req: HttpRequest = {url, method, headers};
|
|
110
|
-
if (body !== undefined) {
|
|
111
|
-
req.body = body;
|
|
112
|
-
}
|
|
113
|
-
if (signal !== undefined) {
|
|
114
|
-
req.signal = signal;
|
|
115
|
-
}
|
|
116
|
-
return req;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
|
|
120
|
-
const text = new TextDecoder().decode(body);
|
|
121
|
-
const parsed: unknown = jsonBigint.parse(text);
|
|
122
|
-
return schema.parse(parsed);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function marshalRequest(data: unknown, schema: z.ZodType): string {
|
|
126
|
-
return jsonBigint.stringify(schema.parse(data));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function flattenQueryParams(
|
|
130
|
-
prefix: string,
|
|
131
|
-
value: unknown,
|
|
132
|
-
params: URLSearchParams
|
|
133
|
-
): void {
|
|
134
|
-
if (value === null || value === undefined) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (Array.isArray(value)) {
|
|
138
|
-
// arrays of objects are not yet supported
|
|
139
|
-
for (const item of value) {
|
|
140
|
-
params.append(prefix, String(item));
|
|
141
|
-
}
|
|
142
|
-
} else if (typeof value === 'object') {
|
|
143
|
-
for (const [key, val] of Object.entries(value as Record<string, unknown>)) {
|
|
144
|
-
flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
145
|
-
}
|
|
146
|
-
} else if (
|
|
147
|
-
typeof value === 'string' ||
|
|
148
|
-
typeof value === 'number' ||
|
|
149
|
-
typeof value === 'boolean' ||
|
|
150
|
-
typeof value === 'bigint'
|
|
151
|
-
) {
|
|
152
|
-
params.append(prefix, String(value));
|
|
153
|
-
} else {
|
|
154
|
-
throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
155
|
-
}
|
|
156
|
-
}
|