@databricks/sdk-repos 0.1.0-dev.3 → 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/model.d.ts +13 -0
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +2 -0
- 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 +4 -5
- package/src/v1/client.ts +0 -253
- package/src/v1/index.ts +0 -19
- package/src/v1/model.ts +0 -306
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -156
package/dist/v1/model.d.ts
CHANGED
|
@@ -148,6 +148,19 @@ 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
165
|
export interface UpdateRepoResponse {
|
|
153
166
|
}
|
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":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C,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
|
@@ -117,11 +117,13 @@ export const marshalUpdateRepoRequestSchema = z
|
|
|
117
117
|
branch: z.string().optional(),
|
|
118
118
|
tag: z.string().optional(),
|
|
119
119
|
sparseCheckout: z.lazy(() => marshalSparseCheckoutUpdateSchema).optional(),
|
|
120
|
+
dangerouslyForceDiscardAll: z.boolean().optional(),
|
|
120
121
|
})
|
|
121
122
|
.transform(d => ({
|
|
122
123
|
id: d.id,
|
|
123
124
|
branch: d.branch,
|
|
124
125
|
tag: d.tag,
|
|
125
126
|
sparse_checkout: d.sparseCheckout,
|
|
127
|
+
dangerously_force_discard_all: d.dangerouslyForceDiscardAll,
|
|
126
128
|
}));
|
|
127
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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,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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AO,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,6 +1,6 @@
|
|
|
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": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
-
"src",
|
|
16
15
|
"LICENSE"
|
|
17
16
|
],
|
|
18
17
|
"scripts": {
|
|
@@ -29,9 +28,9 @@
|
|
|
29
28
|
"author": "Databricks",
|
|
30
29
|
"license": "Apache-2.0",
|
|
31
30
|
"dependencies": {
|
|
32
|
-
"@databricks/sdk-auth": ">=0.1.0-dev.
|
|
33
|
-
"@databricks/sdk-core": ">=0.1.0-dev.
|
|
34
|
-
"@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",
|
|
35
34
|
"@js-temporal/polyfill": "^0.5.0",
|
|
36
35
|
"json-bigint": "^1.0.0",
|
|
37
36
|
"zod": "^4.3.6"
|
package/src/v1/client.ts
DELETED
|
@@ -1,253 +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
|
-
CreateRepoResponse,
|
|
22
|
-
DeleteProjectRequest,
|
|
23
|
-
DeleteProjectResponse,
|
|
24
|
-
GetRepoRequest,
|
|
25
|
-
GetRepoResponse,
|
|
26
|
-
ListReposRequest,
|
|
27
|
-
ListReposResponse,
|
|
28
|
-
RepoInfo,
|
|
29
|
-
UpdateRepoRequest,
|
|
30
|
-
UpdateRepoResponse,
|
|
31
|
-
} from './model';
|
|
32
|
-
import {
|
|
33
|
-
marshalCreateRepoRequestSchema,
|
|
34
|
-
marshalUpdateRepoRequestSchema,
|
|
35
|
-
unmarshalCreateRepoResponseSchema,
|
|
36
|
-
unmarshalDeleteProjectResponseSchema,
|
|
37
|
-
unmarshalGetRepoResponseSchema,
|
|
38
|
-
unmarshalListReposResponseSchema,
|
|
39
|
-
unmarshalUpdateRepoResponseSchema,
|
|
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<CreateRepoResponse> {
|
|
85
|
-
const url = `${this.host}/api/2.0/repos`;
|
|
86
|
-
const body = marshalRequest(req, marshalCreateRepoRequestSchema);
|
|
87
|
-
let resp: CreateRepoResponse | 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, unmarshalCreateRepoResponseSchema);
|
|
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<DeleteProjectResponse> {
|
|
114
|
-
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
115
|
-
let resp: DeleteProjectResponse | 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(respBody, unmarshalDeleteProjectResponseSchema);
|
|
129
|
-
};
|
|
130
|
-
await executeCall(call, options);
|
|
131
|
-
if (resp === undefined) {
|
|
132
|
-
throw new Error('operation completed without a result.');
|
|
133
|
-
}
|
|
134
|
-
return resp;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/** Returns the repo with the given repo ID. */
|
|
138
|
-
async getRepo(
|
|
139
|
-
req: GetRepoRequest,
|
|
140
|
-
options?: CallOptions
|
|
141
|
-
): Promise<GetRepoResponse> {
|
|
142
|
-
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
143
|
-
let resp: GetRepoResponse | undefined;
|
|
144
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
145
|
-
const headers = new Headers();
|
|
146
|
-
if (this.workspaceId !== undefined) {
|
|
147
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
148
|
-
}
|
|
149
|
-
headers.set('User-Agent', this.userAgent);
|
|
150
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
151
|
-
const respBody = await executeHttpCall({
|
|
152
|
-
request: httpReq,
|
|
153
|
-
httpClient: this.httpClient,
|
|
154
|
-
logger: this.logger,
|
|
155
|
-
});
|
|
156
|
-
resp = parseResponse(respBody, unmarshalGetRepoResponseSchema);
|
|
157
|
-
};
|
|
158
|
-
await executeCall(call, options);
|
|
159
|
-
if (resp === undefined) {
|
|
160
|
-
throw new Error('operation completed without a result.');
|
|
161
|
-
}
|
|
162
|
-
return resp;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Returns repos that the calling user has Manage permissions on.
|
|
167
|
-
* Use `next_page_token` to iterate through additional pages.
|
|
168
|
-
*/
|
|
169
|
-
async listRepos(
|
|
170
|
-
req: ListReposRequest,
|
|
171
|
-
options?: CallOptions
|
|
172
|
-
): Promise<ListReposResponse> {
|
|
173
|
-
const url = `${this.host}/api/2.0/repos`;
|
|
174
|
-
const params = new URLSearchParams();
|
|
175
|
-
if (req.pathPrefix !== undefined) {
|
|
176
|
-
params.append('path_prefix', req.pathPrefix);
|
|
177
|
-
}
|
|
178
|
-
if (req.nextPageToken !== undefined) {
|
|
179
|
-
params.append('next_page_token', req.nextPageToken);
|
|
180
|
-
}
|
|
181
|
-
const query = params.toString();
|
|
182
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
183
|
-
let resp: ListReposResponse | undefined;
|
|
184
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
185
|
-
const headers = new Headers();
|
|
186
|
-
if (this.workspaceId !== undefined) {
|
|
187
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
188
|
-
}
|
|
189
|
-
headers.set('User-Agent', this.userAgent);
|
|
190
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
191
|
-
const respBody = await executeHttpCall({
|
|
192
|
-
request: httpReq,
|
|
193
|
-
httpClient: this.httpClient,
|
|
194
|
-
logger: this.logger,
|
|
195
|
-
});
|
|
196
|
-
resp = parseResponse(respBody, unmarshalListReposResponseSchema);
|
|
197
|
-
};
|
|
198
|
-
await executeCall(call, options);
|
|
199
|
-
if (resp === undefined) {
|
|
200
|
-
throw new Error('operation completed without a result.');
|
|
201
|
-
}
|
|
202
|
-
return resp;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
async *listReposIter(
|
|
206
|
-
req: ListReposRequest,
|
|
207
|
-
options?: CallOptions
|
|
208
|
-
): AsyncGenerator<RepoInfo> {
|
|
209
|
-
const pageReq: ListReposRequest = {...req};
|
|
210
|
-
for (;;) {
|
|
211
|
-
const resp = await this.listRepos(pageReq, options);
|
|
212
|
-
for (const item of resp.repos ?? []) {
|
|
213
|
-
yield item;
|
|
214
|
-
}
|
|
215
|
-
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
pageReq.nextPageToken = resp.nextPageToken;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Updates the repo to a different branch or tag, or updates the repo to the latest commit on
|
|
224
|
-
* the same branch.
|
|
225
|
-
*/
|
|
226
|
-
async updateRepo(
|
|
227
|
-
req: UpdateRepoRequest,
|
|
228
|
-
options?: CallOptions
|
|
229
|
-
): Promise<UpdateRepoResponse> {
|
|
230
|
-
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
231
|
-
const body = marshalRequest(req, marshalUpdateRepoRequestSchema);
|
|
232
|
-
let resp: UpdateRepoResponse | undefined;
|
|
233
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
234
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
235
|
-
if (this.workspaceId !== undefined) {
|
|
236
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
237
|
-
}
|
|
238
|
-
headers.set('User-Agent', this.userAgent);
|
|
239
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
240
|
-
const respBody = await executeHttpCall({
|
|
241
|
-
request: httpReq,
|
|
242
|
-
httpClient: this.httpClient,
|
|
243
|
-
logger: this.logger,
|
|
244
|
-
});
|
|
245
|
-
resp = parseResponse(respBody, unmarshalUpdateRepoResponseSchema);
|
|
246
|
-
};
|
|
247
|
-
await executeCall(call, options);
|
|
248
|
-
if (resp === undefined) {
|
|
249
|
-
throw new Error('operation completed without a result.');
|
|
250
|
-
}
|
|
251
|
-
return resp;
|
|
252
|
-
}
|
|
253
|
-
}
|
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
|
-
CreateRepoResponse,
|
|
8
|
-
DeleteProjectRequest,
|
|
9
|
-
DeleteProjectResponse,
|
|
10
|
-
GetRepoRequest,
|
|
11
|
-
GetRepoResponse,
|
|
12
|
-
ListReposRequest,
|
|
13
|
-
ListReposResponse,
|
|
14
|
-
RepoInfo,
|
|
15
|
-
SparseCheckout,
|
|
16
|
-
SparseCheckoutUpdate,
|
|
17
|
-
UpdateRepoRequest,
|
|
18
|
-
UpdateRepoResponse,
|
|
19
|
-
} from './model';
|
package/src/v1/model.ts
DELETED
|
@@ -1,306 +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
|
-
export interface CreateRepoResponse {
|
|
29
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
30
|
-
id?: bigint | undefined;
|
|
31
|
-
/** Path of the Git folder (repo) in the workspace. */
|
|
32
|
-
path?: string | undefined;
|
|
33
|
-
/** URL of the linked Git repository. */
|
|
34
|
-
url?: string | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Git provider of the linked Git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
37
|
-
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
38
|
-
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
39
|
-
*/
|
|
40
|
-
provider?: string | undefined;
|
|
41
|
-
/** Branch that the Git folder (repo) is checked out to. */
|
|
42
|
-
branch?: string | undefined;
|
|
43
|
-
/** SHA-1 hash representing the commit ID of the current HEAD of the Git folder (repo). */
|
|
44
|
-
headCommitId?: string | undefined;
|
|
45
|
-
/** Sparse checkout settings for the Git folder (repo). */
|
|
46
|
-
sparseCheckout?: SparseCheckout | undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface DeleteProjectRequest {
|
|
50
|
-
/** The ID for the corresponding repo to delete. */
|
|
51
|
-
id?: bigint | undefined;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
55
|
-
export interface DeleteProjectResponse {}
|
|
56
|
-
|
|
57
|
-
export interface GetRepoRequest {
|
|
58
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
59
|
-
id?: bigint | undefined;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface GetRepoResponse {
|
|
63
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
64
|
-
id?: bigint | undefined;
|
|
65
|
-
/** Path of the Git folder (repo) in the workspace. */
|
|
66
|
-
path?: string | undefined;
|
|
67
|
-
/** URL of the linked Git repository. */
|
|
68
|
-
url?: string | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* Git provider of the linked Git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
71
|
-
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
72
|
-
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
73
|
-
*/
|
|
74
|
-
provider?: string | undefined;
|
|
75
|
-
/** Branch that the local version of the repo is checked out to. */
|
|
76
|
-
branch?: string | undefined;
|
|
77
|
-
/** SHA-1 hash representing the commit ID of the current HEAD of the repo. */
|
|
78
|
-
headCommitId?: string | undefined;
|
|
79
|
-
/** Sparse checkout settings for the Git folder (repo). */
|
|
80
|
-
sparseCheckout?: SparseCheckout | undefined;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface ListReposRequest {
|
|
84
|
-
/**
|
|
85
|
-
* Filters repos that have paths starting with the given path prefix.
|
|
86
|
-
* If not provided or when provided an effectively empty prefix (`/` or `/Workspace`)
|
|
87
|
-
* Git folders (repos) from `/Workspace/Repos` will be served.
|
|
88
|
-
*/
|
|
89
|
-
pathPrefix?: string | undefined;
|
|
90
|
-
/**
|
|
91
|
-
* Token used to get the next page of results. If not specified, returns the first page of
|
|
92
|
-
* results as well as a next page token if there are more results.
|
|
93
|
-
*/
|
|
94
|
-
nextPageToken?: string | undefined;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface ListReposResponse {
|
|
98
|
-
/** List of Git folders (repos). */
|
|
99
|
-
repos?: RepoInfo[] | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* Token that can be specified as a query parameter to the `GET /repos` endpoint to retrieve
|
|
102
|
-
* the next page of results.
|
|
103
|
-
*/
|
|
104
|
-
nextPageToken?: string | undefined;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** Git folder (repo) information. */
|
|
108
|
-
export interface RepoInfo {
|
|
109
|
-
/** Id of the git folder (repo) in the Workspace. */
|
|
110
|
-
id?: bigint | undefined;
|
|
111
|
-
/** Root path of the git folder (repo) in the Workspace. */
|
|
112
|
-
path?: string | undefined;
|
|
113
|
-
/** URL of the remote git repository. */
|
|
114
|
-
url?: string | undefined;
|
|
115
|
-
/**
|
|
116
|
-
* Git provider of the remote git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
117
|
-
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
118
|
-
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
119
|
-
*/
|
|
120
|
-
provider?: string | undefined;
|
|
121
|
-
/** Name of the current git branch of the git folder (repo). */
|
|
122
|
-
branch?: string | undefined;
|
|
123
|
-
/** Current git commit id of the git folder (repo). */
|
|
124
|
-
headCommitId?: string | undefined;
|
|
125
|
-
/** Sparse checkout config for the git folder (repo). */
|
|
126
|
-
sparseCheckout?: SparseCheckout | undefined;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/** Sparse checkout configuration, it contains options like cone patterns. */
|
|
130
|
-
export interface SparseCheckout {
|
|
131
|
-
/**
|
|
132
|
-
* List of sparse checkout cone patterns, see
|
|
133
|
-
* [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling)
|
|
134
|
-
* for details.
|
|
135
|
-
*/
|
|
136
|
-
patterns?: string[] | undefined;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/** Sparse checkout configuration, it contains options like cone patterns. */
|
|
140
|
-
export interface SparseCheckoutUpdate {
|
|
141
|
-
/**
|
|
142
|
-
* List of sparse checkout cone patterns, see
|
|
143
|
-
* [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling)
|
|
144
|
-
* for details.
|
|
145
|
-
*/
|
|
146
|
-
patterns?: string[] | undefined;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export interface UpdateRepoRequest {
|
|
150
|
-
/** ID of the Git folder (repo) object in the workspace. */
|
|
151
|
-
id?: bigint | undefined;
|
|
152
|
-
/** Branch that the local version of the repo is checked out to. */
|
|
153
|
-
branch?: string | undefined;
|
|
154
|
-
/**
|
|
155
|
-
* Tag that the local version of the repo is checked out to. Updating the repo to a tag puts
|
|
156
|
-
* the repo in a detached HEAD state. Before committing new changes, you must update the repo to
|
|
157
|
-
* a branch instead of the detached HEAD.
|
|
158
|
-
*/
|
|
159
|
-
tag?: string | undefined;
|
|
160
|
-
/**
|
|
161
|
-
* If specified, update the sparse checkout settings. The update will fail if sparse checkout is
|
|
162
|
-
* not enabled for the repo.
|
|
163
|
-
*/
|
|
164
|
-
sparseCheckout?: SparseCheckoutUpdate | undefined;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
168
|
-
export interface UpdateRepoResponse {}
|
|
169
|
-
|
|
170
|
-
export const unmarshalCreateRepoResponseSchema: z.ZodType<CreateRepoResponse> =
|
|
171
|
-
z
|
|
172
|
-
.object({
|
|
173
|
-
id: z
|
|
174
|
-
.union([z.number(), z.bigint()])
|
|
175
|
-
.transform(v => BigInt(v))
|
|
176
|
-
.optional(),
|
|
177
|
-
path: z.string().optional(),
|
|
178
|
-
url: z.string().optional(),
|
|
179
|
-
provider: z.string().optional(),
|
|
180
|
-
branch: z.string().optional(),
|
|
181
|
-
head_commit_id: z.string().optional(),
|
|
182
|
-
sparse_checkout: z.lazy(() => unmarshalSparseCheckoutSchema).optional(),
|
|
183
|
-
})
|
|
184
|
-
.transform(d => ({
|
|
185
|
-
id: d.id,
|
|
186
|
-
path: d.path,
|
|
187
|
-
url: d.url,
|
|
188
|
-
provider: d.provider,
|
|
189
|
-
branch: d.branch,
|
|
190
|
-
headCommitId: d.head_commit_id,
|
|
191
|
-
sparseCheckout: d.sparse_checkout,
|
|
192
|
-
}));
|
|
193
|
-
|
|
194
|
-
export const unmarshalDeleteProjectResponseSchema: z.ZodType<DeleteProjectResponse> =
|
|
195
|
-
z.object({});
|
|
196
|
-
|
|
197
|
-
export const unmarshalGetRepoResponseSchema: z.ZodType<GetRepoResponse> = z
|
|
198
|
-
.object({
|
|
199
|
-
id: z
|
|
200
|
-
.union([z.number(), z.bigint()])
|
|
201
|
-
.transform(v => BigInt(v))
|
|
202
|
-
.optional(),
|
|
203
|
-
path: z.string().optional(),
|
|
204
|
-
url: z.string().optional(),
|
|
205
|
-
provider: z.string().optional(),
|
|
206
|
-
branch: z.string().optional(),
|
|
207
|
-
head_commit_id: z.string().optional(),
|
|
208
|
-
sparse_checkout: z.lazy(() => unmarshalSparseCheckoutSchema).optional(),
|
|
209
|
-
})
|
|
210
|
-
.transform(d => ({
|
|
211
|
-
id: d.id,
|
|
212
|
-
path: d.path,
|
|
213
|
-
url: d.url,
|
|
214
|
-
provider: d.provider,
|
|
215
|
-
branch: d.branch,
|
|
216
|
-
headCommitId: d.head_commit_id,
|
|
217
|
-
sparseCheckout: d.sparse_checkout,
|
|
218
|
-
}));
|
|
219
|
-
|
|
220
|
-
export const unmarshalListReposResponseSchema: z.ZodType<ListReposResponse> = z
|
|
221
|
-
.object({
|
|
222
|
-
repos: z.array(z.lazy(() => unmarshalRepoInfoSchema)).optional(),
|
|
223
|
-
next_page_token: z.string().optional(),
|
|
224
|
-
})
|
|
225
|
-
.transform(d => ({
|
|
226
|
-
repos: d.repos,
|
|
227
|
-
nextPageToken: d.next_page_token,
|
|
228
|
-
}));
|
|
229
|
-
|
|
230
|
-
export const unmarshalRepoInfoSchema: z.ZodType<RepoInfo> = z
|
|
231
|
-
.object({
|
|
232
|
-
id: z
|
|
233
|
-
.union([z.number(), z.bigint()])
|
|
234
|
-
.transform(v => BigInt(v))
|
|
235
|
-
.optional(),
|
|
236
|
-
path: z.string().optional(),
|
|
237
|
-
url: z.string().optional(),
|
|
238
|
-
provider: z.string().optional(),
|
|
239
|
-
branch: z.string().optional(),
|
|
240
|
-
head_commit_id: z.string().optional(),
|
|
241
|
-
sparse_checkout: z.lazy(() => unmarshalSparseCheckoutSchema).optional(),
|
|
242
|
-
})
|
|
243
|
-
.transform(d => ({
|
|
244
|
-
id: d.id,
|
|
245
|
-
path: d.path,
|
|
246
|
-
url: d.url,
|
|
247
|
-
provider: d.provider,
|
|
248
|
-
branch: d.branch,
|
|
249
|
-
headCommitId: d.head_commit_id,
|
|
250
|
-
sparseCheckout: d.sparse_checkout,
|
|
251
|
-
}));
|
|
252
|
-
|
|
253
|
-
export const unmarshalSparseCheckoutSchema: z.ZodType<SparseCheckout> = z
|
|
254
|
-
.object({
|
|
255
|
-
patterns: z.array(z.string()).optional(),
|
|
256
|
-
})
|
|
257
|
-
.transform(d => ({
|
|
258
|
-
patterns: d.patterns,
|
|
259
|
-
}));
|
|
260
|
-
|
|
261
|
-
export const unmarshalUpdateRepoResponseSchema: z.ZodType<UpdateRepoResponse> =
|
|
262
|
-
z.object({});
|
|
263
|
-
|
|
264
|
-
export const marshalCreateRepoRequestSchema: z.ZodType = z
|
|
265
|
-
.object({
|
|
266
|
-
url: z.string().optional(),
|
|
267
|
-
provider: z.string().optional(),
|
|
268
|
-
path: z.string().optional(),
|
|
269
|
-
sparseCheckout: z.lazy(() => marshalSparseCheckoutSchema).optional(),
|
|
270
|
-
})
|
|
271
|
-
.transform(d => ({
|
|
272
|
-
url: d.url,
|
|
273
|
-
provider: d.provider,
|
|
274
|
-
path: d.path,
|
|
275
|
-
sparse_checkout: d.sparseCheckout,
|
|
276
|
-
}));
|
|
277
|
-
|
|
278
|
-
export const marshalSparseCheckoutSchema: z.ZodType = z
|
|
279
|
-
.object({
|
|
280
|
-
patterns: z.array(z.string()).optional(),
|
|
281
|
-
})
|
|
282
|
-
.transform(d => ({
|
|
283
|
-
patterns: d.patterns,
|
|
284
|
-
}));
|
|
285
|
-
|
|
286
|
-
export const marshalSparseCheckoutUpdateSchema: z.ZodType = z
|
|
287
|
-
.object({
|
|
288
|
-
patterns: z.array(z.string()).optional(),
|
|
289
|
-
})
|
|
290
|
-
.transform(d => ({
|
|
291
|
-
patterns: d.patterns,
|
|
292
|
-
}));
|
|
293
|
-
|
|
294
|
-
export const marshalUpdateRepoRequestSchema: z.ZodType = z
|
|
295
|
-
.object({
|
|
296
|
-
id: z.bigint().optional(),
|
|
297
|
-
branch: z.string().optional(),
|
|
298
|
-
tag: z.string().optional(),
|
|
299
|
-
sparseCheckout: z.lazy(() => marshalSparseCheckoutUpdateSchema).optional(),
|
|
300
|
-
})
|
|
301
|
-
.transform(d => ({
|
|
302
|
-
id: d.id,
|
|
303
|
-
branch: d.branch,
|
|
304
|
-
tag: d.tag,
|
|
305
|
-
sparse_checkout: d.sparseCheckout,
|
|
306
|
-
}));
|
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
|
-
}
|