@databricks/sdk-uc-workspacebindings 0.1.0-dev.3 → 0.1.0-dev.5
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/README.md +28 -0
- package/dist/v1/client.d.ts +3 -3
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +31 -29
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/model.d.ts +6 -5
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +8 -8
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +30 -2
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +33 -16
- package/dist/v1/transport.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 +9 -5
- package/src/v1/client.ts +0 -247
- package/src/v1/index.ts +0 -17
- package/src/v1/model.ts +0 -185
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -156
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @databricks/sdk-uc-workspacebindings
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
>
|
|
5
|
+
> ## PREVIEW - NOT FOR PRODUCTION USE
|
|
6
|
+
>
|
|
7
|
+
> **This SDK is in preview and is subject to change without notice.**
|
|
8
|
+
>
|
|
9
|
+
> - **Do NOT use in production environments**
|
|
10
|
+
> - **Breaking changes may occur at any time**
|
|
11
|
+
> - **APIs are experimental and unstable**
|
|
12
|
+
> - **Use for development and testing only**
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @databricks/sdk-uc-workspacebindings
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import {WorkspaceBindingsClient} from '@databricks/sdk-uc-workspacebindings/v1';
|
|
24
|
+
|
|
25
|
+
const client = new WorkspaceBindingsClient({});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For a full getting-started guide, see the [root README](../../../README.md).
|
package/dist/v1/client.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { CallOptions } from '@databricks/sdk-options/call';
|
|
|
2
2
|
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
3
|
import type { GetCatalogWorkspaceBindingsRequest, GetCatalogWorkspaceBindingsResponse, GetWorkspaceBindingsRequest, GetWorkspaceBindingsResponse, UpdateCatalogWorkspaceBindingsRequest, UpdateCatalogWorkspaceBindingsResponse, UpdateWorkspaceBindingsRequest, UpdateWorkspaceBindingsResponse, WorkspaceBindingInfo } from './model';
|
|
4
4
|
export declare class WorkspaceBindingsClient {
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly workspaceId;
|
|
7
|
-
private readonly httpClient;
|
|
5
|
+
private readonly options;
|
|
8
6
|
private readonly logger;
|
|
9
7
|
private readonly userAgent;
|
|
8
|
+
private config;
|
|
10
9
|
constructor(options: ClientOptions);
|
|
10
|
+
private resolveConfig;
|
|
11
11
|
/**
|
|
12
12
|
* Gets workspace bindings of the catalog.
|
|
13
13
|
* The caller must be a metastore admin or an owner of the catalog.
|
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,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,EAC3B,4BAA4B,EAC5B,qCAAqC,EACrC,sCAAsC,EACtC,8BAA8B,EAC9B,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAgBjB,qBAAa,uBAAuB;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+B5C"}
|
package/dist/v1/client.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
|
|
3
3
|
import { createDefault } from '@databricks/sdk-core/clientinfo';
|
|
4
4
|
import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
5
|
-
import {
|
|
5
|
+
import { resolveClientConfig } from './transport';
|
|
6
6
|
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
7
7
|
import pkgJson from '../../package.json' with { type: 'json' };
|
|
8
8
|
import { marshalUpdateCatalogWorkspaceBindingsRequestSchema, marshalUpdateWorkspaceBindingsRequestSchema, unmarshalGetCatalogWorkspaceBindingsResponseSchema, unmarshalGetWorkspaceBindingsResponseSchema, unmarshalUpdateCatalogWorkspaceBindingsResponseSchema, unmarshalUpdateWorkspaceBindingsResponseSchema, } from './model';
|
|
@@ -12,48 +12,47 @@ const PACKAGE_SEGMENT = {
|
|
|
12
12
|
value: pkgJson.version,
|
|
13
13
|
};
|
|
14
14
|
export class WorkspaceBindingsClient {
|
|
15
|
-
|
|
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;
|
|
15
|
+
options;
|
|
21
16
|
logger;
|
|
22
17
|
// User-Agent header value. Composed once at construction from
|
|
23
18
|
// createDefault() merged with this package's identity and the active
|
|
24
19
|
// credential's name.
|
|
25
20
|
userAgent;
|
|
21
|
+
// Memoized configuration. The profile is resolved once, lazily, on the first
|
|
22
|
+
// request, then reused; host, workspaceId/accountId, and credentials are
|
|
23
|
+
// filled from it when not set explicitly on the options.
|
|
24
|
+
config;
|
|
26
25
|
constructor(options) {
|
|
27
|
-
|
|
28
|
-
throw new Error('Host is required.');
|
|
29
|
-
}
|
|
30
|
-
this.host = options.host.replace(/\/$/, '');
|
|
31
|
-
this.workspaceId = options.workspaceId;
|
|
26
|
+
this.options = options;
|
|
32
27
|
this.logger = options.logger ?? new NoOpLogger();
|
|
33
28
|
const info = createDefault()
|
|
34
29
|
.with(PACKAGE_SEGMENT)
|
|
35
30
|
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
36
31
|
.with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
|
|
37
32
|
this.userAgent = info.toString();
|
|
38
|
-
|
|
33
|
+
}
|
|
34
|
+
resolveConfig() {
|
|
35
|
+
this.config ??= resolveClientConfig(this.options);
|
|
36
|
+
return this.config;
|
|
39
37
|
}
|
|
40
38
|
/**
|
|
41
39
|
* Gets workspace bindings of the catalog.
|
|
42
40
|
* The caller must be a metastore admin or an owner of the catalog.
|
|
43
41
|
*/
|
|
44
42
|
async getCatalogWorkspaceBindings(req, options) {
|
|
45
|
-
const
|
|
43
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
44
|
+
const url = `${host}/api/2.1/unity-catalog/workspace-bindings/catalogs/${req.catalogName ?? ''}`;
|
|
46
45
|
let resp;
|
|
47
46
|
const call = async (callSignal) => {
|
|
48
47
|
const headers = new Headers();
|
|
49
|
-
if (
|
|
50
|
-
headers.set('X-Databricks-Org-Id',
|
|
48
|
+
if (workspaceId !== undefined) {
|
|
49
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
51
50
|
}
|
|
52
51
|
headers.set('User-Agent', this.userAgent);
|
|
53
52
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
54
53
|
const respBody = await executeHttpCall({
|
|
55
54
|
request: httpReq,
|
|
56
|
-
httpClient
|
|
55
|
+
httpClient,
|
|
57
56
|
logger: this.logger,
|
|
58
57
|
});
|
|
59
58
|
resp = parseResponse(respBody, unmarshalGetCatalogWorkspaceBindingsResponseSchema);
|
|
@@ -74,7 +73,8 @@ export class WorkspaceBindingsClient {
|
|
|
74
73
|
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
75
74
|
*/
|
|
76
75
|
async getWorkspaceBindings(req, options) {
|
|
77
|
-
const
|
|
76
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
77
|
+
const url = `${host}/api/2.1/unity-catalog/bindings/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;
|
|
78
78
|
const params = new URLSearchParams();
|
|
79
79
|
if (req.maxResults !== undefined) {
|
|
80
80
|
params.append('max_results', String(req.maxResults));
|
|
@@ -87,14 +87,14 @@ export class WorkspaceBindingsClient {
|
|
|
87
87
|
let resp;
|
|
88
88
|
const call = async (callSignal) => {
|
|
89
89
|
const headers = new Headers();
|
|
90
|
-
if (
|
|
91
|
-
headers.set('X-Databricks-Org-Id',
|
|
90
|
+
if (workspaceId !== undefined) {
|
|
91
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
92
92
|
}
|
|
93
93
|
headers.set('User-Agent', this.userAgent);
|
|
94
94
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
95
95
|
const respBody = await executeHttpCall({
|
|
96
96
|
request: httpReq,
|
|
97
|
-
httpClient
|
|
97
|
+
httpClient,
|
|
98
98
|
logger: this.logger,
|
|
99
99
|
});
|
|
100
100
|
resp = parseResponse(respBody, unmarshalGetWorkspaceBindingsResponseSchema);
|
|
@@ -123,19 +123,20 @@ export class WorkspaceBindingsClient {
|
|
|
123
123
|
* The caller must be a metastore admin or an owner of the catalog.
|
|
124
124
|
*/
|
|
125
125
|
async updateCatalogWorkspaceBindings(req, options) {
|
|
126
|
-
const
|
|
126
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
127
|
+
const url = `${host}/api/2.1/unity-catalog/workspace-bindings/catalogs/${req.catalogName ?? ''}`;
|
|
127
128
|
const body = marshalRequest(req, marshalUpdateCatalogWorkspaceBindingsRequestSchema);
|
|
128
129
|
let resp;
|
|
129
130
|
const call = async (callSignal) => {
|
|
130
131
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
131
|
-
if (
|
|
132
|
-
headers.set('X-Databricks-Org-Id',
|
|
132
|
+
if (workspaceId !== undefined) {
|
|
133
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
133
134
|
}
|
|
134
135
|
headers.set('User-Agent', this.userAgent);
|
|
135
136
|
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
136
137
|
const respBody = await executeHttpCall({
|
|
137
138
|
request: httpReq,
|
|
138
|
-
httpClient
|
|
139
|
+
httpClient,
|
|
139
140
|
logger: this.logger,
|
|
140
141
|
});
|
|
141
142
|
resp = parseResponse(respBody, unmarshalUpdateCatalogWorkspaceBindingsResponseSchema);
|
|
@@ -151,19 +152,20 @@ export class WorkspaceBindingsClient {
|
|
|
151
152
|
* The caller must be a metastore admin or an owner of the securable.
|
|
152
153
|
*/
|
|
153
154
|
async updateWorkspaceBindings(req, options) {
|
|
154
|
-
const
|
|
155
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
156
|
+
const url = `${host}/api/2.1/unity-catalog/bindings/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;
|
|
155
157
|
const body = marshalRequest(req, marshalUpdateWorkspaceBindingsRequestSchema);
|
|
156
158
|
let resp;
|
|
157
159
|
const call = async (callSignal) => {
|
|
158
160
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
159
|
-
if (
|
|
160
|
-
headers.set('X-Databricks-Org-Id',
|
|
161
|
+
if (workspaceId !== undefined) {
|
|
162
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
161
163
|
}
|
|
162
164
|
headers.set('User-Agent', this.userAgent);
|
|
163
165
|
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
164
166
|
const respBody = await executeHttpCall({
|
|
165
167
|
request: httpReq,
|
|
166
|
-
httpClient
|
|
168
|
+
httpClient,
|
|
167
169
|
logger: this.logger,
|
|
168
170
|
});
|
|
169
171
|
resp = parseResponse(respBody, unmarshalUpdateWorkspaceBindingsResponseSchema);
|
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,
|
|
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,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,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;AAY7D,OAAO,EACL,kDAAkD,EAClD,2CAA2C,EAC3C,kDAAkD,EAClD,2CAA2C,EAC3C,qDAAqD,EACrD,8CAA8C,GAC/C,MAAM,SAAS,CAAC;AAEjB,gFAAgF;AAChF,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;IAC1D,KAAK,EAAE,OAAO,CAAC,OAAO;CACvB,CAAC;AAEF,MAAM,OAAO,uBAAuB;IACjB,OAAO,CAAgB;IACvB,MAAM,CAAS;IAChC,8DAA8D;IAC9D,qEAAqE;IACrE,qBAAqB;IACJ,SA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AM,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/model.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/** Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` enum in `credentials_common.proto`. */
|
|
3
|
-
export declare
|
|
4
|
-
BINDING_TYPE_UNSPECIFIED
|
|
5
|
-
BINDING_TYPE_READ_WRITE
|
|
6
|
-
BINDING_TYPE_READ_ONLY
|
|
7
|
-
}
|
|
3
|
+
export declare const BindingType: {
|
|
4
|
+
readonly BINDING_TYPE_UNSPECIFIED: "BINDING_TYPE_UNSPECIFIED";
|
|
5
|
+
readonly BINDING_TYPE_READ_WRITE: "BINDING_TYPE_READ_WRITE";
|
|
6
|
+
readonly BINDING_TYPE_READ_ONLY: "BINDING_TYPE_READ_ONLY";
|
|
7
|
+
};
|
|
8
|
+
export type BindingType = (typeof BindingType)[keyof typeof BindingType] | (string & {});
|
|
8
9
|
export interface GetCatalogWorkspaceBindingsRequest {
|
|
9
10
|
/** The name of the catalog. */
|
|
10
11
|
catalogName?: string | undefined;
|
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,oHAAoH;
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,oHAAoH;AAEpH,eAAO,MAAM,WAAW;;;;CAId,CAAC;AACX,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B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC;;;;OAIG;IACH,GAAG,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAC;IACzC,4CAA4C;IAC5C,MAAM,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAC;CAC7C;AAED,8DAA8D;AAC9D,MAAM,WAAW,+BAA+B;IAC9C,kCAAkC;IAClC,QAAQ,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACvC;AAED,eAAO,MAAM,kDAAkD,EAAE,CAAC,CAAC,OAAO,CAAC,mCAAmC,CASvG,CAAC;AAER,eAAO,MAAM,2CAA2C,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAWzF,CAAC;AAER,eAAO,MAAM,qDAAqD,EAAE,CAAC,CAAC,OAAO,CAAC,sCAAsC,CAS7G,CAAC;AAER,eAAO,MAAM,8CAA8C,EAAE,CAAC,CAAC,OAAO,CAAC,+BAA+B,CAS/F,CAAC;AAER,eAAO,MAAM,mCAAmC,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAYzE,CAAC;AAER,eAAO,MAAM,kDAAkD,EAAE,CAAC,CAAC,OAU9D,CAAC;AAEN,eAAO,MAAM,2CAA2C,EAAE,CAAC,CAAC,OAYvD,CAAC;AAEN,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,OAQ7C,CAAC"}
|
package/dist/v1/model.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
/** Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` enum in `credentials_common.proto`. */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
|
|
5
|
+
export const BindingType = {
|
|
6
|
+
BINDING_TYPE_UNSPECIFIED: 'BINDING_TYPE_UNSPECIFIED',
|
|
7
|
+
BINDING_TYPE_READ_WRITE: 'BINDING_TYPE_READ_WRITE',
|
|
8
|
+
BINDING_TYPE_READ_ONLY: 'BINDING_TYPE_READ_ONLY',
|
|
9
|
+
};
|
|
10
10
|
export const unmarshalGetCatalogWorkspaceBindingsResponseSchema = z
|
|
11
11
|
.object({
|
|
12
12
|
workspaces: z
|
|
@@ -51,7 +51,7 @@ export const unmarshalWorkspaceBindingInfoSchema = z
|
|
|
51
51
|
.union([z.number(), z.bigint()])
|
|
52
52
|
.transform(v => BigInt(v))
|
|
53
53
|
.optional(),
|
|
54
|
-
binding_type: z.
|
|
54
|
+
binding_type: z.string().optional(),
|
|
55
55
|
})
|
|
56
56
|
.transform(d => ({
|
|
57
57
|
workspaceId: d.workspace_id,
|
|
@@ -84,7 +84,7 @@ export const marshalUpdateWorkspaceBindingsRequestSchema = z
|
|
|
84
84
|
export const marshalWorkspaceBindingInfoSchema = z
|
|
85
85
|
.object({
|
|
86
86
|
workspaceId: z.bigint().optional(),
|
|
87
|
-
bindingType: z.
|
|
87
|
+
bindingType: z.string().optional(),
|
|
88
88
|
})
|
|
89
89
|
.transform(d => ({
|
|
90
90
|
workspace_id: d.workspaceId,
|
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;AAEtB,oHAAoH;AACpH,MAAM,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"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;IAC3B,YAAY,EAAE,CAAC,CAAC,WAAW;CAC5B,CAAC,CAAC,CAAC"}
|
package/dist/v1/transport.d.ts
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import type { HttpClient } from '@databricks/sdk-core/http';
|
|
2
2
|
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The configuration a client needs to issue requests, resolved from
|
|
5
|
+
* {@link ClientOptions} and a configuration profile.
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedClientConfig {
|
|
8
|
+
/** Host with any trailing slash removed. */
|
|
9
|
+
host: string;
|
|
10
|
+
/**
|
|
11
|
+
* Default account ID for account-level paths that contain an account_id
|
|
12
|
+
* segment. A request's own accountId still wins.
|
|
13
|
+
*/
|
|
14
|
+
accountId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
17
|
+
*/
|
|
18
|
+
workspaceId?: string;
|
|
19
|
+
/** HTTP client with authentication, and any configured timeout, applied. */
|
|
20
|
+
httpClient: HttpClient;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
24
|
+
*
|
|
25
|
+
* A configuration profile is always resolved from the config file and
|
|
26
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
27
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
28
|
+
* explicitly. Explicit options always take precedence.
|
|
29
|
+
*
|
|
30
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
|
|
5
33
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4EAA4E;IAC5E,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,oBAAoB,CAAC,CA4B/B"}
|
package/dist/v1/transport.js
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { defaultCredentials } from '@databricks/sdk-auth/credentials';
|
|
3
3
|
import { newFetchHttpClient } from '@databricks/sdk-core/http';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { resolve } from '@databricks/sdk-core/profiles';
|
|
5
|
+
/**
|
|
6
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
7
|
+
*
|
|
8
|
+
* A configuration profile is always resolved from the config file and
|
|
9
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
10
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
11
|
+
* explicitly. Explicit options always take precedence.
|
|
12
|
+
*
|
|
13
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
14
|
+
*/
|
|
15
|
+
export async function resolveClientConfig(options) {
|
|
16
|
+
const profile = await resolve(options.profileOptions);
|
|
17
|
+
const host = options.host ?? profile.host;
|
|
18
|
+
if (host === undefined) {
|
|
19
|
+
throw new Error('Host is required.');
|
|
14
20
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
// The provided httpClient (or the default fetch client) is the base wire;
|
|
22
|
+
// authentication and the optional timeout are layered on top of it. The
|
|
23
|
+
// default credential chain reuses the profile resolved above so that the
|
|
24
|
+
// same profileOptions govern host and authentication alike.
|
|
25
|
+
const base = options.httpClient ?? newFetchHttpClient();
|
|
26
|
+
const credentials = options.credentials ?? defaultCredentials({ profile });
|
|
27
|
+
let httpClient = new AuthHttpClient(base, credentials);
|
|
28
|
+
if (options.timeout !== undefined) {
|
|
29
|
+
httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
20
30
|
}
|
|
21
|
-
|
|
31
|
+
const accountId = options.accountId ?? profile.accountId;
|
|
32
|
+
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
33
|
+
return {
|
|
34
|
+
host: host.replace(/\/$/, ''),
|
|
35
|
+
httpClient,
|
|
36
|
+
...(accountId !== undefined && { accountId }),
|
|
37
|
+
...(workspaceId !== undefined && { workspaceId }),
|
|
38
|
+
};
|
|
22
39
|
}
|
|
23
40
|
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
24
41
|
class AuthHttpClient {
|
package/dist/v1/transport.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],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MAAM,EAAC,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
package/dist/v1/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAEZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,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,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],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GED
|
@@ -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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AAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,0CAA0C;QAC1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-uc-workspacebindings",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.5",
|
|
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": {
|
|
@@ -28,10 +27,15 @@
|
|
|
28
27
|
},
|
|
29
28
|
"author": "Databricks",
|
|
30
29
|
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/databricks/sdk-js.git",
|
|
33
|
+
"directory": "packages/uc/workspacebindings"
|
|
34
|
+
},
|
|
31
35
|
"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.
|
|
36
|
+
"@databricks/sdk-auth": ">=0.1.0-dev.6 <1.0.0",
|
|
37
|
+
"@databricks/sdk-core": ">=0.1.0-dev.7 <1.0.0",
|
|
38
|
+
"@databricks/sdk-options": ">=0.1.0-dev.6 <1.0.0",
|
|
35
39
|
"@js-temporal/polyfill": "^0.5.0",
|
|
36
40
|
"json-bigint": "^1.0.0",
|
|
37
41
|
"zod": "^4.3.6"
|
package/src/v1/client.ts
DELETED
|
@@ -1,247 +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
|
-
GetCatalogWorkspaceBindingsRequest,
|
|
21
|
-
GetCatalogWorkspaceBindingsResponse,
|
|
22
|
-
GetWorkspaceBindingsRequest,
|
|
23
|
-
GetWorkspaceBindingsResponse,
|
|
24
|
-
UpdateCatalogWorkspaceBindingsRequest,
|
|
25
|
-
UpdateCatalogWorkspaceBindingsResponse,
|
|
26
|
-
UpdateWorkspaceBindingsRequest,
|
|
27
|
-
UpdateWorkspaceBindingsResponse,
|
|
28
|
-
WorkspaceBindingInfo,
|
|
29
|
-
} from './model';
|
|
30
|
-
import {
|
|
31
|
-
marshalUpdateCatalogWorkspaceBindingsRequestSchema,
|
|
32
|
-
marshalUpdateWorkspaceBindingsRequestSchema,
|
|
33
|
-
unmarshalGetCatalogWorkspaceBindingsResponseSchema,
|
|
34
|
-
unmarshalGetWorkspaceBindingsResponseSchema,
|
|
35
|
-
unmarshalUpdateCatalogWorkspaceBindingsResponseSchema,
|
|
36
|
-
unmarshalUpdateWorkspaceBindingsResponseSchema,
|
|
37
|
-
} from './model';
|
|
38
|
-
|
|
39
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
40
|
-
const PACKAGE_SEGMENT = {
|
|
41
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
42
|
-
value: pkgJson.version,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export class WorkspaceBindingsClient {
|
|
46
|
-
private readonly host: string;
|
|
47
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
48
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
49
|
-
// request.
|
|
50
|
-
private readonly workspaceId: string | undefined;
|
|
51
|
-
private readonly httpClient: HttpClient;
|
|
52
|
-
private readonly logger: Logger;
|
|
53
|
-
// User-Agent header value. Composed once at construction from
|
|
54
|
-
// createDefault() merged with this package's identity and the active
|
|
55
|
-
// credential's name.
|
|
56
|
-
private readonly userAgent: string;
|
|
57
|
-
|
|
58
|
-
constructor(options: ClientOptions) {
|
|
59
|
-
if (options.host === undefined) {
|
|
60
|
-
throw new Error('Host is required.');
|
|
61
|
-
}
|
|
62
|
-
this.host = options.host.replace(/\/$/, '');
|
|
63
|
-
this.workspaceId = options.workspaceId;
|
|
64
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
65
|
-
const info = createDefault()
|
|
66
|
-
.with(PACKAGE_SEGMENT)
|
|
67
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
68
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
69
|
-
this.userAgent = info.toString();
|
|
70
|
-
this.httpClient = newHttpClient(options);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Gets workspace bindings of the catalog.
|
|
75
|
-
* The caller must be a metastore admin or an owner of the catalog.
|
|
76
|
-
*/
|
|
77
|
-
async getCatalogWorkspaceBindings(
|
|
78
|
-
req: GetCatalogWorkspaceBindingsRequest,
|
|
79
|
-
options?: CallOptions
|
|
80
|
-
): Promise<GetCatalogWorkspaceBindingsResponse> {
|
|
81
|
-
const url = `${this.host}/api/2.1/unity-catalog/workspace-bindings/catalogs/${req.catalogName ?? ''}`;
|
|
82
|
-
let resp: GetCatalogWorkspaceBindingsResponse | undefined;
|
|
83
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
84
|
-
const headers = new Headers();
|
|
85
|
-
if (this.workspaceId !== undefined) {
|
|
86
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
87
|
-
}
|
|
88
|
-
headers.set('User-Agent', this.userAgent);
|
|
89
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
90
|
-
const respBody = await executeHttpCall({
|
|
91
|
-
request: httpReq,
|
|
92
|
-
httpClient: this.httpClient,
|
|
93
|
-
logger: this.logger,
|
|
94
|
-
});
|
|
95
|
-
resp = parseResponse(
|
|
96
|
-
respBody,
|
|
97
|
-
unmarshalGetCatalogWorkspaceBindingsResponseSchema
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
await executeCall(call, options);
|
|
101
|
-
if (resp === undefined) {
|
|
102
|
-
throw new Error('operation completed without a result.');
|
|
103
|
-
}
|
|
104
|
-
return resp;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Gets workspace bindings of the securable.
|
|
109
|
-
* The caller must be a metastore admin or an owner of the securable.
|
|
110
|
-
*
|
|
111
|
-
* NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.
|
|
112
|
-
*
|
|
113
|
-
* PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.
|
|
114
|
-
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
115
|
-
*/
|
|
116
|
-
async getWorkspaceBindings(
|
|
117
|
-
req: GetWorkspaceBindingsRequest,
|
|
118
|
-
options?: CallOptions
|
|
119
|
-
): Promise<GetWorkspaceBindingsResponse> {
|
|
120
|
-
const url = `${this.host}/api/2.1/unity-catalog/bindings/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;
|
|
121
|
-
const params = new URLSearchParams();
|
|
122
|
-
if (req.maxResults !== undefined) {
|
|
123
|
-
params.append('max_results', String(req.maxResults));
|
|
124
|
-
}
|
|
125
|
-
if (req.pageToken !== undefined) {
|
|
126
|
-
params.append('page_token', req.pageToken);
|
|
127
|
-
}
|
|
128
|
-
const query = params.toString();
|
|
129
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
130
|
-
let resp: GetWorkspaceBindingsResponse | undefined;
|
|
131
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
132
|
-
const headers = new Headers();
|
|
133
|
-
if (this.workspaceId !== undefined) {
|
|
134
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
135
|
-
}
|
|
136
|
-
headers.set('User-Agent', this.userAgent);
|
|
137
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
138
|
-
const respBody = await executeHttpCall({
|
|
139
|
-
request: httpReq,
|
|
140
|
-
httpClient: this.httpClient,
|
|
141
|
-
logger: this.logger,
|
|
142
|
-
});
|
|
143
|
-
resp = parseResponse(
|
|
144
|
-
respBody,
|
|
145
|
-
unmarshalGetWorkspaceBindingsResponseSchema
|
|
146
|
-
);
|
|
147
|
-
};
|
|
148
|
-
await executeCall(call, options);
|
|
149
|
-
if (resp === undefined) {
|
|
150
|
-
throw new Error('operation completed without a result.');
|
|
151
|
-
}
|
|
152
|
-
return resp;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
async *getWorkspaceBindingsIter(
|
|
156
|
-
req: GetWorkspaceBindingsRequest,
|
|
157
|
-
options?: CallOptions
|
|
158
|
-
): AsyncGenerator<WorkspaceBindingInfo> {
|
|
159
|
-
const pageReq: GetWorkspaceBindingsRequest = {...req};
|
|
160
|
-
for (;;) {
|
|
161
|
-
const resp = await this.getWorkspaceBindings(pageReq, options);
|
|
162
|
-
for (const item of resp.bindings ?? []) {
|
|
163
|
-
yield item;
|
|
164
|
-
}
|
|
165
|
-
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
pageReq.pageToken = resp.nextPageToken;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Updates workspace bindings of the catalog.
|
|
174
|
-
* The caller must be a metastore admin or an owner of the catalog.
|
|
175
|
-
*/
|
|
176
|
-
async updateCatalogWorkspaceBindings(
|
|
177
|
-
req: UpdateCatalogWorkspaceBindingsRequest,
|
|
178
|
-
options?: CallOptions
|
|
179
|
-
): Promise<UpdateCatalogWorkspaceBindingsResponse> {
|
|
180
|
-
const url = `${this.host}/api/2.1/unity-catalog/workspace-bindings/catalogs/${req.catalogName ?? ''}`;
|
|
181
|
-
const body = marshalRequest(
|
|
182
|
-
req,
|
|
183
|
-
marshalUpdateCatalogWorkspaceBindingsRequestSchema
|
|
184
|
-
);
|
|
185
|
-
let resp: UpdateCatalogWorkspaceBindingsResponse | undefined;
|
|
186
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
187
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
188
|
-
if (this.workspaceId !== undefined) {
|
|
189
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
190
|
-
}
|
|
191
|
-
headers.set('User-Agent', this.userAgent);
|
|
192
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
193
|
-
const respBody = await executeHttpCall({
|
|
194
|
-
request: httpReq,
|
|
195
|
-
httpClient: this.httpClient,
|
|
196
|
-
logger: this.logger,
|
|
197
|
-
});
|
|
198
|
-
resp = parseResponse(
|
|
199
|
-
respBody,
|
|
200
|
-
unmarshalUpdateCatalogWorkspaceBindingsResponseSchema
|
|
201
|
-
);
|
|
202
|
-
};
|
|
203
|
-
await executeCall(call, options);
|
|
204
|
-
if (resp === undefined) {
|
|
205
|
-
throw new Error('operation completed without a result.');
|
|
206
|
-
}
|
|
207
|
-
return resp;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Updates workspace bindings of the securable.
|
|
212
|
-
* The caller must be a metastore admin or an owner of the securable.
|
|
213
|
-
*/
|
|
214
|
-
async updateWorkspaceBindings(
|
|
215
|
-
req: UpdateWorkspaceBindingsRequest,
|
|
216
|
-
options?: CallOptions
|
|
217
|
-
): Promise<UpdateWorkspaceBindingsResponse> {
|
|
218
|
-
const url = `${this.host}/api/2.1/unity-catalog/bindings/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;
|
|
219
|
-
const body = marshalRequest(
|
|
220
|
-
req,
|
|
221
|
-
marshalUpdateWorkspaceBindingsRequestSchema
|
|
222
|
-
);
|
|
223
|
-
let resp: UpdateWorkspaceBindingsResponse | undefined;
|
|
224
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
225
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
226
|
-
if (this.workspaceId !== undefined) {
|
|
227
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
228
|
-
}
|
|
229
|
-
headers.set('User-Agent', this.userAgent);
|
|
230
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
231
|
-
const respBody = await executeHttpCall({
|
|
232
|
-
request: httpReq,
|
|
233
|
-
httpClient: this.httpClient,
|
|
234
|
-
logger: this.logger,
|
|
235
|
-
});
|
|
236
|
-
resp = parseResponse(
|
|
237
|
-
respBody,
|
|
238
|
-
unmarshalUpdateWorkspaceBindingsResponseSchema
|
|
239
|
-
);
|
|
240
|
-
};
|
|
241
|
-
await executeCall(call, options);
|
|
242
|
-
if (resp === undefined) {
|
|
243
|
-
throw new Error('operation completed without a result.');
|
|
244
|
-
}
|
|
245
|
-
return resp;
|
|
246
|
-
}
|
|
247
|
-
}
|
package/src/v1/index.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {WorkspaceBindingsClient} from './client';
|
|
4
|
-
|
|
5
|
-
export {BindingType} from './model';
|
|
6
|
-
|
|
7
|
-
export type {
|
|
8
|
-
GetCatalogWorkspaceBindingsRequest,
|
|
9
|
-
GetCatalogWorkspaceBindingsResponse,
|
|
10
|
-
GetWorkspaceBindingsRequest,
|
|
11
|
-
GetWorkspaceBindingsResponse,
|
|
12
|
-
UpdateCatalogWorkspaceBindingsRequest,
|
|
13
|
-
UpdateCatalogWorkspaceBindingsResponse,
|
|
14
|
-
UpdateWorkspaceBindingsRequest,
|
|
15
|
-
UpdateWorkspaceBindingsResponse,
|
|
16
|
-
WorkspaceBindingInfo,
|
|
17
|
-
} from './model';
|
package/src/v1/model.ts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
|
|
5
|
-
/** Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` enum in `credentials_common.proto`. */
|
|
6
|
-
export enum BindingType {
|
|
7
|
-
BINDING_TYPE_UNSPECIFIED = 'BINDING_TYPE_UNSPECIFIED',
|
|
8
|
-
BINDING_TYPE_READ_WRITE = 'BINDING_TYPE_READ_WRITE',
|
|
9
|
-
BINDING_TYPE_READ_ONLY = 'BINDING_TYPE_READ_ONLY',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface GetCatalogWorkspaceBindingsRequest {
|
|
13
|
-
/** The name of the catalog. */
|
|
14
|
-
catalogName?: string | undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface GetCatalogWorkspaceBindingsResponse {
|
|
18
|
-
/** A list of workspace IDs */
|
|
19
|
-
workspaces?: bigint[] | undefined;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface GetWorkspaceBindingsRequest {
|
|
23
|
-
/** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */
|
|
24
|
-
securableType?: string | undefined;
|
|
25
|
-
/** The name of the securable. */
|
|
26
|
-
securableFullName?: string | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Maximum number of workspace bindings to return.
|
|
29
|
-
* - When set to 0, the page length is set to a server configured value (recommended);
|
|
30
|
-
* - When set to a value greater than 0, the page length is the minimum of this value and a server configured value;
|
|
31
|
-
* - When set to a value less than 0, an invalid parameter error is returned;
|
|
32
|
-
* - If not set, all the workspace bindings are returned (not recommended).
|
|
33
|
-
*/
|
|
34
|
-
maxResults?: number | undefined;
|
|
35
|
-
/** Opaque pagination token to go to next page based on previous query. */
|
|
36
|
-
pageToken?: string | undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface GetWorkspaceBindingsResponse {
|
|
40
|
-
/** List of workspace bindings */
|
|
41
|
-
bindings?: WorkspaceBindingInfo[] | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
44
|
-
* __page_token__ should be set to this value for the next request (for the next page of results).
|
|
45
|
-
*/
|
|
46
|
-
nextPageToken?: string | undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface UpdateCatalogWorkspaceBindingsRequest {
|
|
50
|
-
/** The name of the catalog. */
|
|
51
|
-
catalogName?: string | undefined;
|
|
52
|
-
/** A list of workspace IDs. */
|
|
53
|
-
assignWorkspaces?: bigint[] | undefined;
|
|
54
|
-
/** A list of workspace IDs. */
|
|
55
|
-
unassignWorkspaces?: bigint[] | undefined;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface UpdateCatalogWorkspaceBindingsResponse {
|
|
59
|
-
/** A list of workspace IDs */
|
|
60
|
-
workspaces?: bigint[] | undefined;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface UpdateWorkspaceBindingsRequest {
|
|
64
|
-
/** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */
|
|
65
|
-
securableType?: string | undefined;
|
|
66
|
-
/** The name of the securable. */
|
|
67
|
-
securableFullName?: string | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* List of workspace bindings to add. If a binding for the workspace already exists with a
|
|
70
|
-
* different binding_type, adding it again with a new binding_type will update the existing
|
|
71
|
-
* binding (e.g., from READ_WRITE to READ_ONLY).
|
|
72
|
-
*/
|
|
73
|
-
add?: WorkspaceBindingInfo[] | undefined;
|
|
74
|
-
/** List of workspace bindings to remove. */
|
|
75
|
-
remove?: WorkspaceBindingInfo[] | undefined;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** A list of workspace IDs that are bound to the securable */
|
|
79
|
-
export interface UpdateWorkspaceBindingsResponse {
|
|
80
|
-
/** List of workspace bindings. */
|
|
81
|
-
bindings?: WorkspaceBindingInfo[] | undefined;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface WorkspaceBindingInfo {
|
|
85
|
-
/** Required */
|
|
86
|
-
workspaceId?: bigint | undefined;
|
|
87
|
-
/** One of READ_WRITE/READ_ONLY. Default is READ_WRITE. */
|
|
88
|
-
bindingType?: BindingType | undefined;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const unmarshalGetCatalogWorkspaceBindingsResponseSchema: z.ZodType<GetCatalogWorkspaceBindingsResponse> =
|
|
92
|
-
z
|
|
93
|
-
.object({
|
|
94
|
-
workspaces: z
|
|
95
|
-
.array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))
|
|
96
|
-
.optional(),
|
|
97
|
-
})
|
|
98
|
-
.transform(d => ({
|
|
99
|
-
workspaces: d.workspaces,
|
|
100
|
-
}));
|
|
101
|
-
|
|
102
|
-
export const unmarshalGetWorkspaceBindingsResponseSchema: z.ZodType<GetWorkspaceBindingsResponse> =
|
|
103
|
-
z
|
|
104
|
-
.object({
|
|
105
|
-
bindings: z
|
|
106
|
-
.array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema))
|
|
107
|
-
.optional(),
|
|
108
|
-
next_page_token: z.string().optional(),
|
|
109
|
-
})
|
|
110
|
-
.transform(d => ({
|
|
111
|
-
bindings: d.bindings,
|
|
112
|
-
nextPageToken: d.next_page_token,
|
|
113
|
-
}));
|
|
114
|
-
|
|
115
|
-
export const unmarshalUpdateCatalogWorkspaceBindingsResponseSchema: z.ZodType<UpdateCatalogWorkspaceBindingsResponse> =
|
|
116
|
-
z
|
|
117
|
-
.object({
|
|
118
|
-
workspaces: z
|
|
119
|
-
.array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))
|
|
120
|
-
.optional(),
|
|
121
|
-
})
|
|
122
|
-
.transform(d => ({
|
|
123
|
-
workspaces: d.workspaces,
|
|
124
|
-
}));
|
|
125
|
-
|
|
126
|
-
export const unmarshalUpdateWorkspaceBindingsResponseSchema: z.ZodType<UpdateWorkspaceBindingsResponse> =
|
|
127
|
-
z
|
|
128
|
-
.object({
|
|
129
|
-
bindings: z
|
|
130
|
-
.array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema))
|
|
131
|
-
.optional(),
|
|
132
|
-
})
|
|
133
|
-
.transform(d => ({
|
|
134
|
-
bindings: d.bindings,
|
|
135
|
-
}));
|
|
136
|
-
|
|
137
|
-
export const unmarshalWorkspaceBindingInfoSchema: z.ZodType<WorkspaceBindingInfo> =
|
|
138
|
-
z
|
|
139
|
-
.object({
|
|
140
|
-
workspace_id: z
|
|
141
|
-
.union([z.number(), z.bigint()])
|
|
142
|
-
.transform(v => BigInt(v))
|
|
143
|
-
.optional(),
|
|
144
|
-
binding_type: z.enum(BindingType).optional(),
|
|
145
|
-
})
|
|
146
|
-
.transform(d => ({
|
|
147
|
-
workspaceId: d.workspace_id,
|
|
148
|
-
bindingType: d.binding_type,
|
|
149
|
-
}));
|
|
150
|
-
|
|
151
|
-
export const marshalUpdateCatalogWorkspaceBindingsRequestSchema: z.ZodType = z
|
|
152
|
-
.object({
|
|
153
|
-
catalogName: z.string().optional(),
|
|
154
|
-
assignWorkspaces: z.array(z.bigint()).optional(),
|
|
155
|
-
unassignWorkspaces: z.array(z.bigint()).optional(),
|
|
156
|
-
})
|
|
157
|
-
.transform(d => ({
|
|
158
|
-
catalog_name: d.catalogName,
|
|
159
|
-
assign_workspaces: d.assignWorkspaces,
|
|
160
|
-
unassign_workspaces: d.unassignWorkspaces,
|
|
161
|
-
}));
|
|
162
|
-
|
|
163
|
-
export const marshalUpdateWorkspaceBindingsRequestSchema: z.ZodType = z
|
|
164
|
-
.object({
|
|
165
|
-
securableType: z.string().optional(),
|
|
166
|
-
securableFullName: z.string().optional(),
|
|
167
|
-
add: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(),
|
|
168
|
-
remove: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(),
|
|
169
|
-
})
|
|
170
|
-
.transform(d => ({
|
|
171
|
-
securable_type: d.securableType,
|
|
172
|
-
securable_full_name: d.securableFullName,
|
|
173
|
-
add: d.add,
|
|
174
|
-
remove: d.remove,
|
|
175
|
-
}));
|
|
176
|
-
|
|
177
|
-
export const marshalWorkspaceBindingInfoSchema: z.ZodType = z
|
|
178
|
-
.object({
|
|
179
|
-
workspaceId: z.bigint().optional(),
|
|
180
|
-
bindingType: z.enum(BindingType).optional(),
|
|
181
|
-
})
|
|
182
|
-
.transform(d => ({
|
|
183
|
-
workspace_id: d.workspaceId,
|
|
184
|
-
binding_type: d.bindingType,
|
|
185
|
-
}));
|
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
|
-
}
|