@databricks/sdk-repos 0.0.0-dev → 0.1.0-dev.2
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/LICENSE +203 -0
- package/dist/v1/client.d.ts +33 -0
- package/dist/v1/client.d.ts.map +1 -0
- package/dist/v1/client.js +195 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +3 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +3 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/model.d.ts +165 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +132 -0
- package/dist/v1/model.js.map +1 -0
- package/dist/v1/transport.d.ts +5 -0
- package/dist/v1/transport.d.ts.map +1 -0
- package/dist/v1/transport.js +57 -0
- package/dist/v1/transport.js.map +1 -0
- package/dist/v1/utils.d.ts +21 -0
- package/dist/v1/utils.d.ts.map +1 -0
- package/dist/v1/utils.js +113 -0
- package/dist/v1/utils.js.map +1 -0
- package/package.json +38 -4
- package/src/v1/client.ts +256 -0
- package/src/v1/index.ts +19 -0
- package/src/v1/model.ts +316 -0
- package/src/v1/transport.ts +73 -0
- package/src/v1/utils.ts +156 -0
- package/README.md +0 -1
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Copyright 2026 Databricks, Inc. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or
|
|
97
|
+
Derivative Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright [yyyy] [name of copyright owner]
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CallOptions } from '@databricks/sdk-options/call';
|
|
2
|
+
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
+
import type { CreateRepoRequest, CreateRepoRequest_Response, DeleteProjectRequest, DeleteProjectRequest_Response, GetRepoRequest, GetRepoRequest_Response, ListReposRequest, ListReposRequest_Response, RepoInfo, UpdateRepoRequest, UpdateRepoRequest_Response } from './model';
|
|
4
|
+
export declare class ReposClient {
|
|
5
|
+
private readonly host;
|
|
6
|
+
private readonly workspaceId;
|
|
7
|
+
private readonly httpClient;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly userAgent;
|
|
10
|
+
constructor(options: ClientOptions);
|
|
11
|
+
/**
|
|
12
|
+
* Creates a repo in the workspace and links it to the remote Git repo specified.
|
|
13
|
+
* Note that repos created programmatically must be linked to a remote Git repo, unlike repos
|
|
14
|
+
* created in the browser.
|
|
15
|
+
*/
|
|
16
|
+
createRepo(req: CreateRepoRequest, options?: CallOptions): Promise<CreateRepoRequest_Response>;
|
|
17
|
+
/** Deletes the specified repo. */
|
|
18
|
+
deleteProject(req: DeleteProjectRequest, options?: CallOptions): Promise<DeleteProjectRequest_Response>;
|
|
19
|
+
/** Returns the repo with the given repo ID. */
|
|
20
|
+
getRepo(req: GetRepoRequest, options?: CallOptions): Promise<GetRepoRequest_Response>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns repos that the calling user has Manage permissions on.
|
|
23
|
+
* Use `next_page_token` to iterate through additional pages.
|
|
24
|
+
*/
|
|
25
|
+
listRepos(req: ListReposRequest, options?: CallOptions): Promise<ListReposRequest_Response>;
|
|
26
|
+
listReposIter(req: ListReposRequest, options?: CallOptions): AsyncGenerator<RepoInfo>;
|
|
27
|
+
/**
|
|
28
|
+
* Updates the repo to a different branch or tag, or updates the repo to the latest commit on
|
|
29
|
+
* the same branch.
|
|
30
|
+
*/
|
|
31
|
+
updateRepo(req: UpdateRepoRequest, options?: CallOptions): Promise<UpdateRepoRequest_Response>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=client.d.ts.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AAC,QAAQ,CAAC;IAc3B;;;OAGG;IACG,UAAU,CACd,GAAG,EAAE,iBAAiB,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,0BAA0B,CAAC;CAwBvC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
|
|
3
|
+
import { createDefault } from '@databricks/sdk-core/clientinfo';
|
|
4
|
+
import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
5
|
+
import { newHttpClient } from './transport';
|
|
6
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
7
|
+
import pkgJson from '../../package.json' with { type: 'json' };
|
|
8
|
+
import { marshalCreateRepoRequestSchema, marshalUpdateRepoRequestSchema, unmarshalCreateRepoRequest_ResponseSchema, unmarshalDeleteProjectRequest_ResponseSchema, unmarshalGetRepoRequest_ResponseSchema, unmarshalListReposRequest_ResponseSchema, unmarshalUpdateRepoRequest_ResponseSchema, } from './model';
|
|
9
|
+
// Package identity segment for this client to be used in the User-Agent header.
|
|
10
|
+
const PACKAGE_SEGMENT = {
|
|
11
|
+
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
12
|
+
value: pkgJson.version,
|
|
13
|
+
};
|
|
14
|
+
export class ReposClient {
|
|
15
|
+
host;
|
|
16
|
+
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
17
|
+
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
18
|
+
// request.
|
|
19
|
+
workspaceId;
|
|
20
|
+
httpClient;
|
|
21
|
+
logger;
|
|
22
|
+
// User-Agent header value. Composed once at construction from
|
|
23
|
+
// createDefault() merged with this package's identity and the active
|
|
24
|
+
// credential's name.
|
|
25
|
+
userAgent;
|
|
26
|
+
constructor(options) {
|
|
27
|
+
if (options.host === undefined) {
|
|
28
|
+
throw new Error('Host is required.');
|
|
29
|
+
}
|
|
30
|
+
this.host = options.host.replace(/\/$/, '');
|
|
31
|
+
this.workspaceId = options.workspaceId;
|
|
32
|
+
this.logger = options.logger ?? new NoOpLogger();
|
|
33
|
+
const info = createDefault()
|
|
34
|
+
.with(PACKAGE_SEGMENT)
|
|
35
|
+
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
36
|
+
.with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
|
|
37
|
+
this.userAgent = info.toString();
|
|
38
|
+
this.httpClient = newHttpClient(options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a repo in the workspace and links it to the remote Git repo specified.
|
|
42
|
+
* Note that repos created programmatically must be linked to a remote Git repo, unlike repos
|
|
43
|
+
* created in the browser.
|
|
44
|
+
*/
|
|
45
|
+
async createRepo(req, options) {
|
|
46
|
+
const url = `${this.host}/api/2.0/repos`;
|
|
47
|
+
const body = marshalRequest(req, marshalCreateRepoRequestSchema);
|
|
48
|
+
let resp;
|
|
49
|
+
const call = async (callSignal) => {
|
|
50
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
51
|
+
if (this.workspaceId !== undefined) {
|
|
52
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
53
|
+
}
|
|
54
|
+
headers.set('User-Agent', this.userAgent);
|
|
55
|
+
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
56
|
+
const respBody = await executeHttpCall({
|
|
57
|
+
request: httpReq,
|
|
58
|
+
httpClient: this.httpClient,
|
|
59
|
+
logger: this.logger,
|
|
60
|
+
});
|
|
61
|
+
resp = parseResponse(respBody, unmarshalCreateRepoRequest_ResponseSchema);
|
|
62
|
+
};
|
|
63
|
+
await executeCall(call, options);
|
|
64
|
+
if (resp === undefined) {
|
|
65
|
+
throw new Error('operation completed without a result.');
|
|
66
|
+
}
|
|
67
|
+
return resp;
|
|
68
|
+
}
|
|
69
|
+
/** Deletes the specified repo. */
|
|
70
|
+
async deleteProject(req, options) {
|
|
71
|
+
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
72
|
+
let resp;
|
|
73
|
+
const call = async (callSignal) => {
|
|
74
|
+
const headers = new Headers();
|
|
75
|
+
if (this.workspaceId !== undefined) {
|
|
76
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
77
|
+
}
|
|
78
|
+
headers.set('User-Agent', this.userAgent);
|
|
79
|
+
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
80
|
+
const respBody = await executeHttpCall({
|
|
81
|
+
request: httpReq,
|
|
82
|
+
httpClient: this.httpClient,
|
|
83
|
+
logger: this.logger,
|
|
84
|
+
});
|
|
85
|
+
resp = parseResponse(respBody, unmarshalDeleteProjectRequest_ResponseSchema);
|
|
86
|
+
};
|
|
87
|
+
await executeCall(call, options);
|
|
88
|
+
if (resp === undefined) {
|
|
89
|
+
throw new Error('operation completed without a result.');
|
|
90
|
+
}
|
|
91
|
+
return resp;
|
|
92
|
+
}
|
|
93
|
+
/** Returns the repo with the given repo ID. */
|
|
94
|
+
async getRepo(req, options) {
|
|
95
|
+
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
96
|
+
let resp;
|
|
97
|
+
const call = async (callSignal) => {
|
|
98
|
+
const headers = new Headers();
|
|
99
|
+
if (this.workspaceId !== undefined) {
|
|
100
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
101
|
+
}
|
|
102
|
+
headers.set('User-Agent', this.userAgent);
|
|
103
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
104
|
+
const respBody = await executeHttpCall({
|
|
105
|
+
request: httpReq,
|
|
106
|
+
httpClient: this.httpClient,
|
|
107
|
+
logger: this.logger,
|
|
108
|
+
});
|
|
109
|
+
resp = parseResponse(respBody, unmarshalGetRepoRequest_ResponseSchema);
|
|
110
|
+
};
|
|
111
|
+
await executeCall(call, options);
|
|
112
|
+
if (resp === undefined) {
|
|
113
|
+
throw new Error('operation completed without a result.');
|
|
114
|
+
}
|
|
115
|
+
return resp;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Returns repos that the calling user has Manage permissions on.
|
|
119
|
+
* Use `next_page_token` to iterate through additional pages.
|
|
120
|
+
*/
|
|
121
|
+
async listRepos(req, options) {
|
|
122
|
+
const url = `${this.host}/api/2.0/repos`;
|
|
123
|
+
const params = new URLSearchParams();
|
|
124
|
+
if (req.pathPrefix !== undefined) {
|
|
125
|
+
params.append('path_prefix', req.pathPrefix);
|
|
126
|
+
}
|
|
127
|
+
if (req.nextPageToken !== undefined) {
|
|
128
|
+
params.append('next_page_token', req.nextPageToken);
|
|
129
|
+
}
|
|
130
|
+
const query = params.toString();
|
|
131
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
132
|
+
let resp;
|
|
133
|
+
const call = async (callSignal) => {
|
|
134
|
+
const headers = new Headers();
|
|
135
|
+
if (this.workspaceId !== undefined) {
|
|
136
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
137
|
+
}
|
|
138
|
+
headers.set('User-Agent', this.userAgent);
|
|
139
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
140
|
+
const respBody = await executeHttpCall({
|
|
141
|
+
request: httpReq,
|
|
142
|
+
httpClient: this.httpClient,
|
|
143
|
+
logger: this.logger,
|
|
144
|
+
});
|
|
145
|
+
resp = parseResponse(respBody, unmarshalListReposRequest_ResponseSchema);
|
|
146
|
+
};
|
|
147
|
+
await executeCall(call, options);
|
|
148
|
+
if (resp === undefined) {
|
|
149
|
+
throw new Error('operation completed without a result.');
|
|
150
|
+
}
|
|
151
|
+
return resp;
|
|
152
|
+
}
|
|
153
|
+
async *listReposIter(req, options) {
|
|
154
|
+
const pageReq = { ...req };
|
|
155
|
+
for (;;) {
|
|
156
|
+
const resp = await this.listRepos(pageReq, options);
|
|
157
|
+
for (const item of resp.repos ?? []) {
|
|
158
|
+
yield item;
|
|
159
|
+
}
|
|
160
|
+
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
pageReq.nextPageToken = resp.nextPageToken;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Updates the repo to a different branch or tag, or updates the repo to the latest commit on
|
|
168
|
+
* the same branch.
|
|
169
|
+
*/
|
|
170
|
+
async updateRepo(req, options) {
|
|
171
|
+
const url = `${this.host}/api/2.0/repos/${String(req.id ?? '')}`;
|
|
172
|
+
const body = marshalRequest(req, marshalUpdateRepoRequestSchema);
|
|
173
|
+
let resp;
|
|
174
|
+
const call = async (callSignal) => {
|
|
175
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
176
|
+
if (this.workspaceId !== undefined) {
|
|
177
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
178
|
+
}
|
|
179
|
+
headers.set('User-Agent', this.userAgent);
|
|
180
|
+
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
181
|
+
const respBody = await executeHttpCall({
|
|
182
|
+
request: httpReq,
|
|
183
|
+
httpClient: this.httpClient,
|
|
184
|
+
logger: this.logger,
|
|
185
|
+
});
|
|
186
|
+
resp = parseResponse(respBody, unmarshalUpdateRepoRequest_ResponseSchema);
|
|
187
|
+
};
|
|
188
|
+
await executeCall(call, options);
|
|
189
|
+
if (resp === undefined) {
|
|
190
|
+
throw new Error('operation completed without a result.');
|
|
191
|
+
}
|
|
192
|
+
return resp;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +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,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D,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,yCAAyC,CAAC,CAAC;QAC5E,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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ReposClient } from './client';
|
|
2
|
+
export type { CreateRepoRequest, CreateRepoRequest_Response, DeleteProjectRequest, DeleteProjectRequest_Response, GetRepoRequest, GetRepoRequest_Response, ListReposRequest, ListReposRequest_Response, RepoInfo, SparseCheckout, SparseCheckoutUpdate, UpdateRepoRequest, UpdateRepoRequest_Response, } from './model';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,0BAA0B,EAC1B,oBAAoB,EACpB,6BAA6B,EAC7B,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,SAAS,CAAC"}
|
package/dist/v1/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface CreateRepoRequest {
|
|
3
|
+
/** URL of the Git repository to be linked. */
|
|
4
|
+
url?: string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
|
|
7
|
+
* `bitbucketCloud`, `gitLab`, `azureDevOpsServices` (Azure DevOps Services, including
|
|
8
|
+
* Microsoft Entra ID authentication), `gitHubEnterprise`, `bitbucketServer` (Bitbucket
|
|
9
|
+
* Data Center), `gitLabEnterpriseEdition` (GitLab Self-Managed), and `awsCodeCommit`
|
|
10
|
+
* (deprecated by AWS, not accepting new customers).
|
|
11
|
+
*/
|
|
12
|
+
provider?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Desired path for the repo in the workspace. Almost any path in the workspace can be chosen.
|
|
15
|
+
* If repo is created in `/Repos`, path must be in the format `/Repos/{folder}/{repo-name}`.
|
|
16
|
+
*/
|
|
17
|
+
path?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* If specified, the repo will be created with sparse checkout enabled. You cannot enable/disable
|
|
20
|
+
* sparse checkout after the repo is created.
|
|
21
|
+
*/
|
|
22
|
+
sparseCheckout?: SparseCheckout | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface CreateRepoRequest_Response {
|
|
25
|
+
/** ID of the Git folder (repo) object in the workspace. */
|
|
26
|
+
id?: bigint | undefined;
|
|
27
|
+
/** Path of the Git folder (repo) in the workspace. */
|
|
28
|
+
path?: string | undefined;
|
|
29
|
+
/** URL of the linked Git repository. */
|
|
30
|
+
url?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Git provider of the linked Git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
33
|
+
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
34
|
+
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
35
|
+
*/
|
|
36
|
+
provider?: string | undefined;
|
|
37
|
+
/** Branch that the Git folder (repo) is checked out to. */
|
|
38
|
+
branch?: string | undefined;
|
|
39
|
+
/** SHA-1 hash representing the commit ID of the current HEAD of the Git folder (repo). */
|
|
40
|
+
headCommitId?: string | undefined;
|
|
41
|
+
/** Sparse checkout settings for the Git folder (repo). */
|
|
42
|
+
sparseCheckout?: SparseCheckout | undefined;
|
|
43
|
+
}
|
|
44
|
+
export interface DeleteProjectRequest {
|
|
45
|
+
/** The ID for the corresponding repo to delete. */
|
|
46
|
+
id?: bigint | undefined;
|
|
47
|
+
}
|
|
48
|
+
export interface DeleteProjectRequest_Response {
|
|
49
|
+
}
|
|
50
|
+
export interface GetRepoRequest {
|
|
51
|
+
/** ID of the Git folder (repo) object in the workspace. */
|
|
52
|
+
id?: bigint | undefined;
|
|
53
|
+
}
|
|
54
|
+
export interface GetRepoRequest_Response {
|
|
55
|
+
/** ID of the Git folder (repo) object in the workspace. */
|
|
56
|
+
id?: bigint | undefined;
|
|
57
|
+
/** Path of the Git folder (repo) in the workspace. */
|
|
58
|
+
path?: string | undefined;
|
|
59
|
+
/** URL of the linked Git repository. */
|
|
60
|
+
url?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Git provider of the linked Git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
63
|
+
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
64
|
+
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
65
|
+
*/
|
|
66
|
+
provider?: string | undefined;
|
|
67
|
+
/** Branch that the local version of the repo is checked out to. */
|
|
68
|
+
branch?: string | undefined;
|
|
69
|
+
/** SHA-1 hash representing the commit ID of the current HEAD of the repo. */
|
|
70
|
+
headCommitId?: string | undefined;
|
|
71
|
+
/** Sparse checkout settings for the Git folder (repo). */
|
|
72
|
+
sparseCheckout?: SparseCheckout | undefined;
|
|
73
|
+
}
|
|
74
|
+
export interface ListReposRequest {
|
|
75
|
+
/**
|
|
76
|
+
* Filters repos that have paths starting with the given path prefix.
|
|
77
|
+
* If not provided or when provided an effectively empty prefix (`/` or `/Workspace`)
|
|
78
|
+
* Git folders (repos) from `/Workspace/Repos` will be served.
|
|
79
|
+
*/
|
|
80
|
+
pathPrefix?: string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Token used to get the next page of results. If not specified, returns the first page of
|
|
83
|
+
* results as well as a next page token if there are more results.
|
|
84
|
+
*/
|
|
85
|
+
nextPageToken?: string | undefined;
|
|
86
|
+
}
|
|
87
|
+
export interface ListReposRequest_Response {
|
|
88
|
+
/** List of Git folders (repos). */
|
|
89
|
+
repos?: RepoInfo[] | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Token that can be specified as a query parameter to the `GET /repos` endpoint to retrieve
|
|
92
|
+
* the next page of results.
|
|
93
|
+
*/
|
|
94
|
+
nextPageToken?: string | undefined;
|
|
95
|
+
}
|
|
96
|
+
/** Git folder (repo) information. */
|
|
97
|
+
export interface RepoInfo {
|
|
98
|
+
/** Id of the git folder (repo) in the Workspace. */
|
|
99
|
+
id?: bigint | undefined;
|
|
100
|
+
/** Root path of the git folder (repo) in the Workspace. */
|
|
101
|
+
path?: string | undefined;
|
|
102
|
+
/** URL of the remote git repository. */
|
|
103
|
+
url?: string | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Git provider of the remote git repository, e.g. `gitHub`, `azureDevOpsServices`,
|
|
106
|
+
* `bitbucketServer` (Bitbucket Data Center), `gitLabEnterpriseEdition` (GitLab
|
|
107
|
+
* Self-Managed), or `awsCodeCommit` (deprecated).
|
|
108
|
+
*/
|
|
109
|
+
provider?: string | undefined;
|
|
110
|
+
/** Name of the current git branch of the git folder (repo). */
|
|
111
|
+
branch?: string | undefined;
|
|
112
|
+
/** Current git commit id of the git folder (repo). */
|
|
113
|
+
headCommitId?: string | undefined;
|
|
114
|
+
/** Sparse checkout config for the git folder (repo). */
|
|
115
|
+
sparseCheckout?: SparseCheckout | undefined;
|
|
116
|
+
}
|
|
117
|
+
/** Sparse checkout configuration, it contains options like cone patterns. */
|
|
118
|
+
export interface SparseCheckout {
|
|
119
|
+
/**
|
|
120
|
+
* List of sparse checkout cone patterns, see
|
|
121
|
+
* [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling)
|
|
122
|
+
* for details.
|
|
123
|
+
*/
|
|
124
|
+
patterns?: string[] | undefined;
|
|
125
|
+
}
|
|
126
|
+
/** Sparse checkout configuration, it contains options like cone patterns. */
|
|
127
|
+
export interface SparseCheckoutUpdate {
|
|
128
|
+
/**
|
|
129
|
+
* List of sparse checkout cone patterns, see
|
|
130
|
+
* [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling)
|
|
131
|
+
* for details.
|
|
132
|
+
*/
|
|
133
|
+
patterns?: string[] | undefined;
|
|
134
|
+
}
|
|
135
|
+
export interface UpdateRepoRequest {
|
|
136
|
+
/** ID of the Git folder (repo) object in the workspace. */
|
|
137
|
+
id?: bigint | undefined;
|
|
138
|
+
/** Branch that the local version of the repo is checked out to. */
|
|
139
|
+
branch?: string | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Tag that the local version of the repo is checked out to. Updating the repo to a tag puts
|
|
142
|
+
* the repo in a detached HEAD state. Before committing new changes, you must update the repo to
|
|
143
|
+
* a branch instead of the detached HEAD.
|
|
144
|
+
*/
|
|
145
|
+
tag?: string | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* If specified, update the sparse checkout settings. The update will fail if sparse checkout is
|
|
148
|
+
* not enabled for the repo.
|
|
149
|
+
*/
|
|
150
|
+
sparseCheckout?: SparseCheckoutUpdate | undefined;
|
|
151
|
+
}
|
|
152
|
+
export interface UpdateRepoRequest_Response {
|
|
153
|
+
}
|
|
154
|
+
export declare const unmarshalCreateRepoRequest_ResponseSchema: z.ZodType<CreateRepoRequest_Response>;
|
|
155
|
+
export declare const unmarshalDeleteProjectRequest_ResponseSchema: z.ZodType<DeleteProjectRequest_Response>;
|
|
156
|
+
export declare const unmarshalGetRepoRequest_ResponseSchema: z.ZodType<GetRepoRequest_Response>;
|
|
157
|
+
export declare const unmarshalListReposRequest_ResponseSchema: z.ZodType<ListReposRequest_Response>;
|
|
158
|
+
export declare const unmarshalRepoInfoSchema: z.ZodType<RepoInfo>;
|
|
159
|
+
export declare const unmarshalSparseCheckoutSchema: z.ZodType<SparseCheckout>;
|
|
160
|
+
export declare const unmarshalUpdateRepoRequest_ResponseSchema: z.ZodType<UpdateRepoRequest_Response>;
|
|
161
|
+
export declare const marshalCreateRepoRequestSchema: z.ZodType;
|
|
162
|
+
export declare const marshalSparseCheckoutSchema: z.ZodType;
|
|
163
|
+
export declare const marshalSparseCheckoutUpdateSchema: z.ZodType;
|
|
164
|
+
export declare const marshalUpdateRepoRequestSchema: z.ZodType;
|
|
165
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +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;AAGD,MAAM,WAAW,0BAA0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