@databricks/sdk-storageconfigurations 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +22 -18
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +109 -128
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +3 -6
- package/dist/v1/index.js +3 -6
- package/dist/v1/model.d.ts +53 -49
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +32 -47
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +21 -17
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +60 -69
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts +18 -14
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +76 -103
- package/dist/v1/utils.js.map +1 -1
- package/package.json +5 -5
- package/dist/v1/index.d.ts.map +0 -1
- package/dist/v1/index.js.map +0 -1
package/dist/package.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
package/dist/v1/client.d.ts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { CreateStorageConfigurationRequest, DeleteStorageConfigurationRequest, GetStorageConfigurationRequest, ListStorageConfigurationRequest, ListStorageConfigurationResponse, StorageConfiguration } from "./model.js";
|
|
2
|
+
import { CallOptions } from "@databricks/sdk-options/call";
|
|
3
|
+
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/client.d.ts
|
|
6
|
+
declare class StorageConfigurationsClient {
|
|
7
|
+
private readonly options;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly userAgent;
|
|
10
|
+
private config;
|
|
11
|
+
constructor(options: ClientOptions);
|
|
12
|
+
private resolveConfig;
|
|
13
|
+
/** Creates a <Databricks> storage configuration for an account. */
|
|
14
|
+
createStorageConfigurationPublic(req: CreateStorageConfigurationRequest, options?: CallOptions): Promise<StorageConfiguration>;
|
|
15
|
+
/** Deletes a <Databricks> storage configuration. You cannot delete a storage configuration that is associated with any workspace. */
|
|
16
|
+
deleteStorageConfigurationPublic(req: DeleteStorageConfigurationRequest, options?: CallOptions): Promise<StorageConfiguration>;
|
|
17
|
+
/** Gets a <Databricks> storage configuration for an account, both specified by ID. */
|
|
18
|
+
getStorageConfigurationPublic(req: GetStorageConfigurationRequest, options?: CallOptions): Promise<StorageConfiguration>;
|
|
19
|
+
/** Lists <Databricks> storage configurations for an account, specified by ID. */
|
|
20
|
+
listStorageConfigurationPublic(req: ListStorageConfigurationRequest, options?: CallOptions): Promise<ListStorageConfigurationResponse>;
|
|
19
21
|
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { StorageConfigurationsClient };
|
|
20
24
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/v1/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cAsCa,2BAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,SAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAUb,aAAA;EAQI;EAFN,gCAAA,CACJ,GAAA,EAAK,iCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,oBAAA;EAAR;EA2BG,gCAAA,CACJ,GAAA,EAAK,iCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,oBAAA;EADC;EAwBN,6BAAA,CACJ,GAAA,EAAK,8BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,oBAAA;EA1BR;EAiDG,8BAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,gCAAA;AAAA"}
|
package/dist/v1/client.js
CHANGED
|
@@ -1,131 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { z } from
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { resolveClientConfig } from "./transport.js";
|
|
2
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
|
|
3
|
+
import { name, version } from "../package.js";
|
|
4
|
+
import { marshalCreateStorageConfigurationRequestSchema, unmarshalStorageConfigurationSchema } from "./model.js";
|
|
5
|
+
import { VERSION } from "@databricks/sdk-auth";
|
|
6
|
+
import { createDefault } from "@databricks/sdk-core/clientinfo";
|
|
7
|
+
import { NoOpLogger } from "@databricks/sdk-core/logger";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
//#region src/v1/client.ts
|
|
11
11
|
const PACKAGE_SEGMENT = {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
key: "sdk-js-" + name.replace(/^@[^/]+\/sdk-/, ""),
|
|
13
|
+
value: version
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const headers = new Headers();
|
|
113
|
-
headers.set('User-Agent', this.userAgent);
|
|
114
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
115
|
-
const respBody = await executeHttpCall({
|
|
116
|
-
request: httpReq,
|
|
117
|
-
httpClient,
|
|
118
|
-
logger: this.logger,
|
|
119
|
-
});
|
|
120
|
-
resp = {
|
|
121
|
-
storageConfigurations: parseResponse(respBody, z.array(z.lazy(() => unmarshalStorageConfigurationSchema))),
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
await executeCall(call, options);
|
|
125
|
-
if (resp === undefined) {
|
|
126
|
-
throw new Error('operation completed without a result.');
|
|
127
|
-
}
|
|
128
|
-
return resp;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
15
|
+
var StorageConfigurationsClient = class {
|
|
16
|
+
options;
|
|
17
|
+
logger;
|
|
18
|
+
userAgent;
|
|
19
|
+
config;
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.options = options;
|
|
22
|
+
this.logger = options.logger ?? new NoOpLogger();
|
|
23
|
+
this.userAgent = createDefault().with(PACKAGE_SEGMENT).with({
|
|
24
|
+
key: "sdk-js-auth",
|
|
25
|
+
value: VERSION
|
|
26
|
+
}).with({
|
|
27
|
+
key: "auth",
|
|
28
|
+
value: options.credentials?.name() ?? "default"
|
|
29
|
+
}).toString();
|
|
30
|
+
}
|
|
31
|
+
resolveConfig() {
|
|
32
|
+
this.config ??= resolveClientConfig(this.options);
|
|
33
|
+
return this.config;
|
|
34
|
+
}
|
|
35
|
+
/** Creates a <Databricks> storage configuration for an account. */
|
|
36
|
+
async createStorageConfigurationPublic(req, options) {
|
|
37
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
38
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/storage-configurations`;
|
|
39
|
+
const body = marshalRequest(req, marshalCreateStorageConfigurationRequestSchema);
|
|
40
|
+
let resp;
|
|
41
|
+
const call = async (callSignal) => {
|
|
42
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
43
|
+
headers.set("User-Agent", this.userAgent);
|
|
44
|
+
resp = parseResponse(await executeHttpCall({
|
|
45
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
46
|
+
httpClient,
|
|
47
|
+
logger: this.logger
|
|
48
|
+
}), unmarshalStorageConfigurationSchema);
|
|
49
|
+
};
|
|
50
|
+
await executeCall(call, options);
|
|
51
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
52
|
+
return resp;
|
|
53
|
+
}
|
|
54
|
+
/** Deletes a <Databricks> storage configuration. You cannot delete a storage configuration that is associated with any workspace. */
|
|
55
|
+
async deleteStorageConfigurationPublic(req, options) {
|
|
56
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
57
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/storage-configurations/${req.storageConfigurationId ?? ""}`;
|
|
58
|
+
let resp;
|
|
59
|
+
const call = async (callSignal) => {
|
|
60
|
+
const headers = new Headers();
|
|
61
|
+
headers.set("User-Agent", this.userAgent);
|
|
62
|
+
resp = parseResponse(await executeHttpCall({
|
|
63
|
+
request: buildHttpRequest("DELETE", url, headers, callSignal),
|
|
64
|
+
httpClient,
|
|
65
|
+
logger: this.logger
|
|
66
|
+
}), unmarshalStorageConfigurationSchema);
|
|
67
|
+
};
|
|
68
|
+
await executeCall(call, options);
|
|
69
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
70
|
+
return resp;
|
|
71
|
+
}
|
|
72
|
+
/** Gets a <Databricks> storage configuration for an account, both specified by ID. */
|
|
73
|
+
async getStorageConfigurationPublic(req, options) {
|
|
74
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
75
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/storage-configurations/${req.storageConfigurationId ?? ""}`;
|
|
76
|
+
let resp;
|
|
77
|
+
const call = async (callSignal) => {
|
|
78
|
+
const headers = new Headers();
|
|
79
|
+
headers.set("User-Agent", this.userAgent);
|
|
80
|
+
resp = parseResponse(await executeHttpCall({
|
|
81
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
82
|
+
httpClient,
|
|
83
|
+
logger: this.logger
|
|
84
|
+
}), unmarshalStorageConfigurationSchema);
|
|
85
|
+
};
|
|
86
|
+
await executeCall(call, options);
|
|
87
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
88
|
+
return resp;
|
|
89
|
+
}
|
|
90
|
+
/** Lists <Databricks> storage configurations for an account, specified by ID. */
|
|
91
|
+
async listStorageConfigurationPublic(req, options) {
|
|
92
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
93
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ""}/storage-configurations`;
|
|
94
|
+
let resp;
|
|
95
|
+
const call = async (callSignal) => {
|
|
96
|
+
const headers = new Headers();
|
|
97
|
+
headers.set("User-Agent", this.userAgent);
|
|
98
|
+
resp = { storageConfigurations: parseResponse(await executeHttpCall({
|
|
99
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
100
|
+
httpClient,
|
|
101
|
+
logger: this.logger
|
|
102
|
+
}), z.array(z.lazy(() => unmarshalStorageConfigurationSchema))) };
|
|
103
|
+
};
|
|
104
|
+
await executeCall(call, options);
|
|
105
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
106
|
+
return resp;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
export { StorageConfigurationsClient };
|
|
131
112
|
//# sourceMappingURL=client.js.map
|
package/dist/v1/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","
|
|
1
|
+
{"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport {z} from 'zod';\nimport type {\n CreateStorageConfigurationRequest,\n DeleteStorageConfigurationRequest,\n GetStorageConfigurationRequest,\n ListStorageConfigurationRequest,\n ListStorageConfigurationResponse,\n StorageConfiguration,\n} from './model';\nimport {\n marshalCreateStorageConfigurationRequestSchema,\n unmarshalStorageConfigurationSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class StorageConfigurationsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /** Creates a <Databricks> storage configuration for an account. */\n async createStorageConfigurationPublic(\n req: CreateStorageConfigurationRequest,\n options?: CallOptions\n ): Promise<StorageConfiguration> {\n const {host, accountId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/storage-configurations`;\n const body = marshalRequest(\n req,\n marshalCreateStorageConfigurationRequestSchema\n );\n let resp: StorageConfiguration | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalStorageConfigurationSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Deletes a <Databricks> storage configuration. You cannot delete a storage configuration that is associated with any workspace. */\n async deleteStorageConfigurationPublic(\n req: DeleteStorageConfigurationRequest,\n options?: CallOptions\n ): Promise<StorageConfiguration> {\n const {host, accountId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/storage-configurations/${req.storageConfigurationId ?? ''}`;\n let resp: StorageConfiguration | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalStorageConfigurationSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Gets a <Databricks> storage configuration for an account, both specified by ID. */\n async getStorageConfigurationPublic(\n req: GetStorageConfigurationRequest,\n options?: CallOptions\n ): Promise<StorageConfiguration> {\n const {host, accountId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/storage-configurations/${req.storageConfigurationId ?? ''}`;\n let resp: StorageConfiguration | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalStorageConfigurationSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /** Lists <Databricks> storage configurations for an account, specified by ID. */\n async listStorageConfigurationPublic(\n req: ListStorageConfigurationRequest,\n options?: CallOptions\n ): Promise<ListStorageConfigurationResponse> {\n const {host, accountId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/storage-configurations`;\n let resp: ListStorageConfigurationResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = {\n storageConfigurations: parseResponse(\n respBody,\n z.array(z.lazy(() => unmarshalStorageConfigurationSchema))\n ),\n };\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;;AAiCA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,8BAAb,MAAyC;CACvC,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAKhD,OAAK,YAJQ,eAAe,CACzB,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC,CAC/C,KAAK;GAAC,KAAK;GAAQ,OAAO,QAAQ,aAAa,MAAM,IAAI;GAAU,CAAC,CACjD,UAAU;;CAGlC,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,QAAQ;AACjD,SAAO,KAAK;;;CAId,MAAM,iCACJ,KACA,SAC+B;EAC/B,MAAM,EAAC,MAAM,WAAW,eAAc,MAAM,KAAK,eAAe;EAChE,MAAM,MAAM,GAAG,KAAK,oBAAoB,IAAI,aAAa,aAAa,GAAG;EACzE,MAAM,OAAO,eACX,KACA,+CACD;EACD,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,QAAQ,KAAK,SAAS,YAAY,KAAK;IAGtE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,oCAAoC;;AAErE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,iCACJ,KACA,SAC+B;EAC/B,MAAM,EAAC,MAAM,WAAW,eAAc,MAAM,KAAK,eAAe;EAChE,MAAM,MAAM,GAAG,KAAK,oBAAoB,IAAI,aAAa,aAAa,GAAG,0BAA0B,IAAI,0BAA0B;EACjI,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,SAAS;AAC7B,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,UAAU,KAAK,SAAS,WAAW;IAGlE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,oCAAoC;;AAErE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,8BACJ,KACA,SAC+B;EAC/B,MAAM,EAAC,MAAM,WAAW,eAAc,MAAM,KAAK,eAAe;EAChE,MAAM,MAAM,GAAG,KAAK,oBAAoB,IAAI,aAAa,aAAa,GAAG,0BAA0B,IAAI,0BAA0B;EACjI,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,SAAS;AAC7B,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,OAAO,KAAK,SAAS,WAAW;IAG/D;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,oCAAoC;;AAErE,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,+BACJ,KACA,SAC2C;EAC3C,MAAM,EAAC,MAAM,WAAW,eAAc,MAAM,KAAK,eAAe;EAChE,MAAM,MAAM,GAAG,KAAK,oBAAoB,IAAI,aAAa,aAAa,GAAG;EACzE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,SAAS;AAC7B,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,EACL,uBAAuB,cANR,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,OAAO,KAAK,SAAS,WAAW;IAG/D;IACA,QAAQ,KAAK;IACd,CAAC,EAIE,EAAE,MAAM,EAAE,WAAW,oCAAoC,CAAC,CAC3D,EACF;;AAEH,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { StorageConfigurationsClient } from './client';
|
|
5
|
-
export type { CreateStorageConfigurationRequest, DeleteStorageConfigurationRequest, GetStorageConfigurationRequest, ListStorageConfigurationRequest, ListStorageConfigurationResponse, RootBucketInfo, StorageConfiguration, } from './model';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { CreateStorageConfigurationRequest, DeleteStorageConfigurationRequest, GetStorageConfigurationRequest, ListStorageConfigurationRequest, ListStorageConfigurationResponse, RootBucketInfo, StorageConfiguration } from "./model.js";
|
|
2
|
+
import { StorageConfigurationsClient } from "./client.js";
|
|
3
|
+
export { type CreateStorageConfigurationRequest, type DeleteStorageConfigurationRequest, type GetStorageConfigurationRequest, type ListStorageConfigurationRequest, type ListStorageConfigurationResponse, type RootBucketInfo, type StorageConfiguration, StorageConfigurationsClient };
|
package/dist/v1/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export { StorageConfigurationsClient } from './client';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { StorageConfigurationsClient } from "./client.js";
|
|
2
|
+
|
|
3
|
+
export { StorageConfigurationsClient };
|
package/dist/v1/model.d.ts
CHANGED
|
@@ -1,57 +1,61 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/v1/model.d.ts
|
|
4
|
+
interface CreateStorageConfigurationRequest {
|
|
5
|
+
accountId?: string | undefined;
|
|
6
|
+
/** The human-readable name of the storage configuration. */
|
|
7
|
+
storageConfigurationName?: string | undefined;
|
|
8
|
+
/** Root S3 bucket information. */
|
|
9
|
+
rootBucketInfo?: RootBucketInfo | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Optional IAM role that is used to access the workspace catalog which is created during workspace creation
|
|
12
|
+
* for UC by Default. If a storage configuration with this field populated is used to create a workspace,
|
|
13
|
+
* then a workspace catalog is created together with the workspace. The workspace catalog shares the root
|
|
14
|
+
* bucket with internal workspace storage (including DBFS root) but uses a dedicated bucket path prefix.
|
|
15
|
+
*/
|
|
16
|
+
roleArn?: string | undefined;
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
interface DeleteStorageConfigurationRequest {
|
|
19
|
+
storageConfigurationId?: string | undefined;
|
|
20
|
+
accountId?: string | undefined;
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
interface GetStorageConfigurationRequest {
|
|
23
|
+
storageConfigurationId?: string | undefined;
|
|
24
|
+
accountId?: string | undefined;
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
interface ListStorageConfigurationRequest {
|
|
27
|
+
accountId?: string | undefined;
|
|
26
28
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
interface ListStorageConfigurationResponse {
|
|
30
|
+
storageConfigurations?: StorageConfiguration[] | undefined;
|
|
29
31
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
interface RootBucketInfo {
|
|
33
|
+
/** Name of the S3 bucket */
|
|
34
|
+
bucketName?: string | undefined;
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
interface StorageConfiguration {
|
|
37
|
+
/** <Databricks> storage configuration ID. */
|
|
38
|
+
storageConfigurationId?: string | undefined;
|
|
39
|
+
/** The <Databricks> account ID associated with this storage configuration. */
|
|
40
|
+
accountId?: string | undefined;
|
|
41
|
+
/** The root bucket information for the storage configuration. */
|
|
42
|
+
rootBucketInfo?: RootBucketInfo | undefined;
|
|
43
|
+
/** The human-readable name of the storage configuration. */
|
|
44
|
+
storageConfigurationName?: string | undefined;
|
|
45
|
+
/** Time in epoch milliseconds when the storage configuration was created. */
|
|
46
|
+
creationTime?: bigint | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Optional IAM role that is used to access the workspace catalog which is created during workspace creation
|
|
49
|
+
* for UC by Default. If a storage configuration with this field populated is used to create a workspace,
|
|
50
|
+
* then a workspace catalog is created together with the workspace. The workspace catalog shares the root
|
|
51
|
+
* bucket with internal workspace storage (including DBFS root) but uses a dedicated bucket path prefix.
|
|
52
|
+
*/
|
|
53
|
+
roleArn?: string | undefined;
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
declare const unmarshalRootBucketInfoSchema: z.ZodType<RootBucketInfo>;
|
|
56
|
+
declare const unmarshalStorageConfigurationSchema: z.ZodType<StorageConfiguration>;
|
|
57
|
+
declare const marshalCreateStorageConfigurationRequestSchema: z.ZodType;
|
|
58
|
+
declare const marshalRootBucketInfoSchema: z.ZodType;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { CreateStorageConfigurationRequest, DeleteStorageConfigurationRequest, GetStorageConfigurationRequest, ListStorageConfigurationRequest, ListStorageConfigurationResponse, RootBucketInfo, StorageConfiguration, marshalCreateStorageConfigurationRequestSchema, marshalRootBucketInfoSchema, unmarshalRootBucketInfoSchema, unmarshalStorageConfigurationSchema };
|
|
57
61
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/v1/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","
|
|
1
|
+
{"version":3,"file":"model.d.ts","names":[],"sources":["../../src/v1/model.ts"],"mappings":";;;UAIiB,iCAAA;EACf,SAAA;EADe;EAGf,wBAAA;;EAEA,cAAA,GAAiB,cAAA;EAJjB;;;;;;EAWA,OAAA;AAAA;AAAA,UAGe,iCAAA;EACf,sBAAA;EACA,SAAA;AAAA;AAAA,UAGe,8BAAA;EACf,sBAAA;EACA,SAAA;AAAA;AAAA,UAGe,+BAAA;EACf,SAAA;AAAA;AAAA,UAGe,gCAAA;EACf,qBAAA,GAAwB,oBAAA;AAAA;AAAA,UAGT,cAAA;EAJgC;EAM/C,UAAA;AAAA;AAAA,UAGe,oBAAA;EALA;EAOf,sBAAA;;EAEA,SAAA;EAPU;EASV,cAAA,GAAiB,cAAA;EANkB;EAQnC,wBAAA;EAF+B;EAI/B,YAAA;EANA;;;;;;EAaA,OAAA;AAAA;AAAA,cAGW,6BAAA,EAA+B,CAAA,CAAE,OAAA,CAAQ,cAAA;AAAA,cAQzC,mCAAA,EAAqC,CAAA,CAAE,OAAA,CAAQ,oBAAA;AAAA,cAsB/C,8CAAA,EAAgD,CAAA,CAAE,OAAA;AAAA,cAclD,2BAAA,EAA6B,CAAA,CAAE,OAAA"}
|
package/dist/v1/model.js
CHANGED
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/v1/model.ts
|
|
4
|
+
const unmarshalRootBucketInfoSchema = z.object({ bucket_name: z.string().optional() }).transform((d) => ({ bucketName: d.bucket_name }));
|
|
5
|
+
const unmarshalStorageConfigurationSchema = z.object({
|
|
6
|
+
storage_configuration_id: z.string().optional(),
|
|
7
|
+
account_id: z.string().optional(),
|
|
8
|
+
root_bucket_info: z.lazy(() => unmarshalRootBucketInfoSchema).optional(),
|
|
9
|
+
storage_configuration_name: z.string().optional(),
|
|
10
|
+
creation_time: z.union([z.number(), z.bigint()]).transform((v) => BigInt(v)).optional(),
|
|
11
|
+
role_arn: z.string().optional()
|
|
12
|
+
}).transform((d) => ({
|
|
13
|
+
storageConfigurationId: d.storage_configuration_id,
|
|
14
|
+
accountId: d.account_id,
|
|
15
|
+
rootBucketInfo: d.root_bucket_info,
|
|
16
|
+
storageConfigurationName: d.storage_configuration_name,
|
|
17
|
+
creationTime: d.creation_time,
|
|
18
|
+
roleArn: d.role_arn
|
|
9
19
|
}));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
role_arn: z.string().optional(),
|
|
21
|
-
})
|
|
22
|
-
.transform(d => ({
|
|
23
|
-
storageConfigurationId: d.storage_configuration_id,
|
|
24
|
-
accountId: d.account_id,
|
|
25
|
-
rootBucketInfo: d.root_bucket_info,
|
|
26
|
-
storageConfigurationName: d.storage_configuration_name,
|
|
27
|
-
creationTime: d.creation_time,
|
|
28
|
-
roleArn: d.role_arn,
|
|
29
|
-
}));
|
|
30
|
-
export const marshalCreateStorageConfigurationRequestSchema = z
|
|
31
|
-
.object({
|
|
32
|
-
accountId: z.string().optional(),
|
|
33
|
-
storageConfigurationName: z.string().optional(),
|
|
34
|
-
rootBucketInfo: z.lazy(() => marshalRootBucketInfoSchema).optional(),
|
|
35
|
-
roleArn: z.string().optional(),
|
|
36
|
-
})
|
|
37
|
-
.transform(d => ({
|
|
38
|
-
account_id: d.accountId,
|
|
39
|
-
storage_configuration_name: d.storageConfigurationName,
|
|
40
|
-
root_bucket_info: d.rootBucketInfo,
|
|
41
|
-
role_arn: d.roleArn,
|
|
42
|
-
}));
|
|
43
|
-
export const marshalRootBucketInfoSchema = z
|
|
44
|
-
.object({
|
|
45
|
-
bucketName: z.string().optional(),
|
|
46
|
-
})
|
|
47
|
-
.transform(d => ({
|
|
48
|
-
bucket_name: d.bucketName,
|
|
20
|
+
const marshalCreateStorageConfigurationRequestSchema = z.object({
|
|
21
|
+
accountId: z.string().optional(),
|
|
22
|
+
storageConfigurationName: z.string().optional(),
|
|
23
|
+
rootBucketInfo: z.lazy(() => marshalRootBucketInfoSchema).optional(),
|
|
24
|
+
roleArn: z.string().optional()
|
|
25
|
+
}).transform((d) => ({
|
|
26
|
+
account_id: d.accountId,
|
|
27
|
+
storage_configuration_name: d.storageConfigurationName,
|
|
28
|
+
root_bucket_info: d.rootBucketInfo,
|
|
29
|
+
role_arn: d.roleArn
|
|
49
30
|
}));
|
|
31
|
+
const marshalRootBucketInfoSchema = z.object({ bucketName: z.string().optional() }).transform((d) => ({ bucket_name: d.bucketName }));
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { marshalCreateStorageConfigurationRequestSchema, marshalRootBucketInfoSchema, unmarshalRootBucketInfoSchema, unmarshalStorageConfigurationSchema };
|
|
50
35
|
//# sourceMappingURL=model.js.map
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {z} from 'zod';\n\nexport interface CreateStorageConfigurationRequest {\n accountId?: string | undefined;\n /** The human-readable name of the storage configuration. */\n storageConfigurationName?: string | undefined;\n /** Root S3 bucket information. */\n rootBucketInfo?: RootBucketInfo | undefined;\n /**\n * Optional IAM role that is used to access the workspace catalog which is created during workspace creation\n * for UC by Default. If a storage configuration with this field populated is used to create a workspace,\n * then a workspace catalog is created together with the workspace. The workspace catalog shares the root\n * bucket with internal workspace storage (including DBFS root) but uses a dedicated bucket path prefix.\n */\n roleArn?: string | undefined;\n}\n\nexport interface DeleteStorageConfigurationRequest {\n storageConfigurationId?: string | undefined;\n accountId?: string | undefined;\n}\n\nexport interface GetStorageConfigurationRequest {\n storageConfigurationId?: string | undefined;\n accountId?: string | undefined;\n}\n\nexport interface ListStorageConfigurationRequest {\n accountId?: string | undefined;\n}\n\nexport interface ListStorageConfigurationResponse {\n storageConfigurations?: StorageConfiguration[] | undefined;\n}\n\nexport interface RootBucketInfo {\n /** Name of the S3 bucket */\n bucketName?: string | undefined;\n}\n\nexport interface StorageConfiguration {\n /** <Databricks> storage configuration ID. */\n storageConfigurationId?: string | undefined;\n /** The <Databricks> account ID associated with this storage configuration. */\n accountId?: string | undefined;\n /** The root bucket information for the storage configuration. */\n rootBucketInfo?: RootBucketInfo | undefined;\n /** The human-readable name of the storage configuration. */\n storageConfigurationName?: string | undefined;\n /** Time in epoch milliseconds when the storage configuration was created. */\n creationTime?: bigint | undefined;\n /**\n * Optional IAM role that is used to access the workspace catalog which is created during workspace creation\n * for UC by Default. If a storage configuration with this field populated is used to create a workspace,\n * then a workspace catalog is created together with the workspace. The workspace catalog shares the root\n * bucket with internal workspace storage (including DBFS root) but uses a dedicated bucket path prefix.\n */\n roleArn?: string | undefined;\n}\n\nexport const unmarshalRootBucketInfoSchema: z.ZodType<RootBucketInfo> = z\n .object({\n bucket_name: z.string().optional(),\n })\n .transform(d => ({\n bucketName: d.bucket_name,\n }));\n\nexport const unmarshalStorageConfigurationSchema: z.ZodType<StorageConfiguration> =\n z\n .object({\n storage_configuration_id: z.string().optional(),\n account_id: z.string().optional(),\n root_bucket_info: z.lazy(() => unmarshalRootBucketInfoSchema).optional(),\n storage_configuration_name: z.string().optional(),\n creation_time: z\n .union([z.number(), z.bigint()])\n .transform(v => BigInt(v))\n .optional(),\n role_arn: z.string().optional(),\n })\n .transform(d => ({\n storageConfigurationId: d.storage_configuration_id,\n accountId: d.account_id,\n rootBucketInfo: d.root_bucket_info,\n storageConfigurationName: d.storage_configuration_name,\n creationTime: d.creation_time,\n roleArn: d.role_arn,\n }));\n\nexport const marshalCreateStorageConfigurationRequestSchema: z.ZodType = z\n .object({\n accountId: z.string().optional(),\n storageConfigurationName: z.string().optional(),\n rootBucketInfo: z.lazy(() => marshalRootBucketInfoSchema).optional(),\n roleArn: z.string().optional(),\n })\n .transform(d => ({\n account_id: d.accountId,\n storage_configuration_name: d.storageConfigurationName,\n root_bucket_info: d.rootBucketInfo,\n role_arn: d.roleArn,\n }));\n\nexport const marshalRootBucketInfoSchema: z.ZodType = z\n .object({\n bucketName: z.string().optional(),\n })\n .transform(d => ({\n bucket_name: d.bucketName,\n }));\n"],"mappings":";;;AA8DA,MAAa,gCAA2D,EACrE,OAAO,EACN,aAAa,EAAE,QAAQ,CAAC,UAAU,EACnC,CAAC,CACD,WAAU,OAAM,EACf,YAAY,EAAE,aACf,EAAE;AAEL,MAAa,sCACX,EACG,OAAO;CACN,0BAA0B,EAAE,QAAQ,CAAC,UAAU;CAC/C,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,kBAAkB,EAAE,WAAW,8BAA8B,CAAC,UAAU;CACxE,4BAA4B,EAAE,QAAQ,CAAC,UAAU;CACjD,eAAe,EACZ,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,CAC/B,WAAU,MAAK,OAAO,EAAE,CAAC,CACzB,UAAU;CACb,UAAU,EAAE,QAAQ,CAAC,UAAU;CAChC,CAAC,CACD,WAAU,OAAM;CACf,wBAAwB,EAAE;CAC1B,WAAW,EAAE;CACb,gBAAgB,EAAE;CAClB,0BAA0B,EAAE;CAC5B,cAAc,EAAE;CAChB,SAAS,EAAE;CACZ,EAAE;AAEP,MAAa,iDAA4D,EACtE,OAAO;CACN,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,0BAA0B,EAAE,QAAQ,CAAC,UAAU;CAC/C,gBAAgB,EAAE,WAAW,4BAA4B,CAAC,UAAU;CACpE,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC,CACD,WAAU,OAAM;CACf,YAAY,EAAE;CACd,4BAA4B,EAAE;CAC9B,kBAAkB,EAAE;CACpB,UAAU,EAAE;CACb,EAAE;AAEL,MAAa,8BAAyC,EACnD,OAAO,EACN,YAAY,EAAE,QAAQ,CAAC,UAAU,EAClC,CAAC,CACD,WAAU,OAAM,EACf,aAAa,EAAE,YAChB,EAAE"}
|
package/dist/v1/transport.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { HttpClient } from "@databricks/sdk-core/http";
|
|
2
|
+
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
3
|
+
|
|
4
|
+
//#region src/v1/transport.d.ts
|
|
3
5
|
/**
|
|
4
6
|
* The configuration a client needs to issue requests, resolved from
|
|
5
7
|
* {@link ClientOptions} and a configuration profile.
|
|
6
8
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
interface ResolvedClientConfig {
|
|
10
|
+
/** Host with any trailing slash removed. */
|
|
11
|
+
host: string;
|
|
12
|
+
/**
|
|
13
|
+
* Default account ID for account-level paths that contain an account_id
|
|
14
|
+
* segment. A request's own accountId still wins.
|
|
15
|
+
*/
|
|
16
|
+
accountId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
19
|
+
*/
|
|
20
|
+
workspaceId?: string;
|
|
21
|
+
/** HTTP client with authentication, and any configured timeout, applied. */
|
|
22
|
+
httpClient: HttpClient;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
@@ -29,5 +31,7 @@ export interface ResolvedClientConfig {
|
|
|
29
31
|
*
|
|
30
32
|
* @throws if host is neither provided nor present in the resolved profile.
|
|
31
33
|
*/
|
|
32
|
-
|
|
34
|
+
declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ResolvedClientConfig, resolveClientConfig };
|
|
33
37
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","
|
|
1
|
+
{"version":3,"file":"transport.d.ts","names":[],"sources":["../../src/v1/transport.ts"],"mappings":";;;;;;AAkBA;;UAAiB,oBAAA;EAgBO;EAdtB,IAAA;EAMA;;;;EAAA,SAAA;EAQsB;AAaxB;;EAhBE,WAAA;EAiBS;EAdT,UAAA,EAAY,UAAA;AAAA;;;;;;;;;;;iBAaQ,mBAAA,CACpB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,oBAAA"}
|
package/dist/v1/transport.js
CHANGED
|
@@ -1,74 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defaultCredentials } from "@databricks/sdk-auth/credentials";
|
|
2
|
+
import { newFetchHttpClient } from "@databricks/sdk-core/http";
|
|
3
|
+
import { resolve } from "@databricks/sdk-core/profiles";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/transport.ts
|
|
5
6
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
30
|
-
}
|
|
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
|
-
};
|
|
7
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
8
|
+
*
|
|
9
|
+
* A configuration profile is always resolved from the config file and
|
|
10
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
11
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
12
|
+
* explicitly. Explicit options always take precedence.
|
|
13
|
+
*
|
|
14
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
15
|
+
*/
|
|
16
|
+
async function resolveClientConfig(options) {
|
|
17
|
+
const profile = await resolve(options.profileOptions);
|
|
18
|
+
const host = options.host ?? profile.host;
|
|
19
|
+
if (host === void 0) throw new Error("Host is required.");
|
|
20
|
+
let httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile }));
|
|
21
|
+
if (options.timeout !== void 0) httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
22
|
+
const accountId = options.accountId ?? profile.accountId;
|
|
23
|
+
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
24
|
+
return {
|
|
25
|
+
host: host.replace(/\/$/, ""),
|
|
26
|
+
httpClient,
|
|
27
|
+
...accountId !== void 0 && { accountId },
|
|
28
|
+
...workspaceId !== void 0 && { workspaceId }
|
|
29
|
+
};
|
|
39
30
|
}
|
|
40
31
|
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
}
|
|
32
|
+
var AuthHttpClient = class {
|
|
33
|
+
constructor(base, credentials) {
|
|
34
|
+
this.base = base;
|
|
35
|
+
this.credentials = credentials;
|
|
36
|
+
}
|
|
37
|
+
async send(request) {
|
|
38
|
+
const authHeaders = await this.credentials.authHeaders();
|
|
39
|
+
const headers = new Headers(request.headers);
|
|
40
|
+
for (const h of authHeaders) headers.set(h.key, h.value);
|
|
41
|
+
return this.base.send({
|
|
42
|
+
...request,
|
|
43
|
+
headers
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
58
47
|
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
var TimeoutHttpClient = class {
|
|
49
|
+
constructor(base, timeout) {
|
|
50
|
+
this.base = base;
|
|
51
|
+
this.timeout = timeout;
|
|
52
|
+
}
|
|
53
|
+
async send(request) {
|
|
54
|
+
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
55
|
+
const signal = request.signal !== void 0 ? AbortSignal.any([request.signal, timeoutSignal]) : timeoutSignal;
|
|
56
|
+
return this.base.send({
|
|
57
|
+
...request,
|
|
58
|
+
signal
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { resolveClientConfig };
|
|
74
65
|
//# sourceMappingURL=transport.js.map
|
package/dist/v1/transport.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","
|
|
1
|
+
{"version":3,"file":"transport.js","names":[],"sources":["../../src/v1/transport.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Credentials} from '@databricks/sdk-auth';\nimport {defaultCredentials} from '@databricks/sdk-auth/credentials';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport {newFetchHttpClient} from '@databricks/sdk-core/http';\nimport type {Profile} from '@databricks/sdk-core/profiles';\nimport {resolve} from '@databricks/sdk-core/profiles';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\n\n/**\n * The configuration a client needs to issue requests, resolved from\n * {@link ClientOptions} and a configuration profile.\n */\nexport interface ResolvedClientConfig {\n /** Host with any trailing slash removed. */\n host: string;\n\n /**\n * Default account ID for account-level paths that contain an account_id\n * segment. A request's own accountId still wins.\n */\n accountId?: string;\n\n /**\n * Workspace ID used to route workspace-level calls on unified hosts (SPOG).\n */\n workspaceId?: string;\n\n /** HTTP client with authentication, and any configured timeout, applied. */\n httpClient: HttpClient;\n}\n\n/**\n * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.\n *\n * A configuration profile is always resolved from the config file and\n * environment variables (per options.profileOptions); it supplies host,\n * accountId, workspaceId, and credentials wherever the caller did not set them\n * explicitly. Explicit options always take precedence.\n *\n * @throws if host is neither provided nor present in the resolved profile.\n */\nexport async function resolveClientConfig(\n options: ClientOptions\n): Promise<ResolvedClientConfig> {\n const profile: Profile = await resolve(options.profileOptions);\n\n const host = options.host ?? profile.host;\n if (host === undefined) {\n throw new Error('Host is required.');\n }\n\n // The provided httpClient (or the default fetch client) is the base wire;\n // authentication and the optional timeout are layered on top of it. The\n // default credential chain reuses the profile resolved above so that the\n // same profileOptions govern host and authentication alike.\n const base = options.httpClient ?? newFetchHttpClient();\n const credentials = options.credentials ?? defaultCredentials({profile});\n let httpClient: HttpClient = new AuthHttpClient(base, credentials);\n if (options.timeout !== undefined) {\n httpClient = new TimeoutHttpClient(httpClient, options.timeout);\n }\n\n const accountId = options.accountId ?? profile.accountId;\n const workspaceId = options.workspaceId ?? profile.workspaceId;\n\n return {\n host: host.replace(/\\/$/, ''),\n httpClient,\n ...(accountId !== undefined && {accountId}),\n ...(workspaceId !== undefined && {workspaceId}),\n };\n}\n\n/** Wraps an HttpClient and adds authentication headers to requests. */\nclass AuthHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly credentials: Credentials\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const authHeaders = await this.credentials.authHeaders();\n // Do not modify the original request.\n const headers = new Headers(request.headers);\n for (const h of authHeaders) {\n headers.set(h.key, h.value);\n }\n return this.base.send({...request, headers});\n }\n}\n\n/** Wraps an HttpClient and applies a default timeout to requests. */\nclass TimeoutHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly timeout: number\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const timeoutSignal = AbortSignal.timeout(this.timeout);\n const signal =\n request.signal !== undefined\n ? AbortSignal.any([request.signal, timeoutSignal])\n : timeoutSignal;\n return this.base.send({...request, signal});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,eAAsB,oBACpB,SAC+B;CAC/B,MAAM,UAAmB,MAAM,QAAQ,QAAQ,eAAe;CAE9D,MAAM,OAAO,QAAQ,QAAQ,QAAQ;AACrC,KAAI,SAAS,OACX,OAAM,IAAI,MAAM,oBAAoB;CAStC,IAAI,aAAyB,IAAI,eAFpB,QAAQ,cAAc,oBAAoB,EACnC,QAAQ,eAAe,mBAAmB,EAAC,SAAQ,CAAC,CACN;AAClE,KAAI,QAAQ,YAAY,OACtB,cAAa,IAAI,kBAAkB,YAAY,QAAQ,QAAQ;CAGjE,MAAM,YAAY,QAAQ,aAAa,QAAQ;CAC/C,MAAM,cAAc,QAAQ,eAAe,QAAQ;AAEnD,QAAO;EACL,MAAM,KAAK,QAAQ,OAAO,GAAG;EAC7B;EACA,GAAI,cAAc,UAAa,EAAC,WAAU;EAC1C,GAAI,gBAAgB,UAAa,EAAC,aAAY;EAC/C;;;AAIH,IAAM,iBAAN,MAA2C;CACzC,YACE,AAAiB,MACjB,AAAiB,aACjB;EAFiB;EACA;;CAGnB,MAAM,KAAK,SAA6C;EACtD,MAAM,cAAc,MAAM,KAAK,YAAY,aAAa;EAExD,MAAM,UAAU,IAAI,QAAQ,QAAQ,QAAQ;AAC5C,OAAK,MAAM,KAAK,YACd,SAAQ,IAAI,EAAE,KAAK,EAAE,MAAM;AAE7B,SAAO,KAAK,KAAK,KAAK;GAAC,GAAG;GAAS;GAAQ,CAAC;;;;AAKhD,IAAM,oBAAN,MAA8C;CAC5C,YACE,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;;CAGnB,MAAM,KAAK,SAA6C;EACtD,MAAM,gBAAgB,YAAY,QAAQ,KAAK,QAAQ;EACvD,MAAM,SACJ,QAAQ,WAAW,SACf,YAAY,IAAI,CAAC,QAAQ,QAAQ,cAAc,CAAC,GAChD;AACN,SAAO,KAAK,KAAK,KAAK;GAAC,GAAG;GAAS;GAAO,CAAC"}
|
package/dist/v1/utils.d.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Logger } from "@databricks/sdk-core/logger";
|
|
2
|
+
import { HttpClient, HttpRequest } from "@databricks/sdk-core/http";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { CallOptions } from "@databricks/sdk-options/call";
|
|
5
|
+
|
|
6
|
+
//#region src/v1/utils.d.ts
|
|
7
|
+
interface HttpCallOptions {
|
|
8
|
+
readonly request: HttpRequest;
|
|
9
|
+
readonly httpClient: HttpClient;
|
|
10
|
+
readonly logger: Logger;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Translates public CallOptions to the internal Options shape accepted by
|
|
12
14
|
* execute(). Even though the shapes match today, this isolates the public
|
|
13
15
|
* API from the executor's internal type so they can diverge.
|
|
14
16
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
|
|
18
|
+
declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
|
|
19
|
+
declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
|
|
20
|
+
declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
|
|
21
|
+
declare function marshalRequest(data: unknown, schema: z.ZodType): string;
|
|
22
|
+
declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { HttpCallOptions, buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
|
|
21
25
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/v1/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/v1/utils.ts"],"mappings":";;;;;;UAoBiB,eAAA;EAAA,SACN,OAAA,EAAS,WAAA;EAAA,SACT,UAAA,EAAY,UAAA;EAAA,SACZ,MAAA,EAAQ,MAAA;AAAA;;;;;;iBAQG,WAAA,CACpB,IAAA,GAAO,MAAA,GAAS,WAAA,KAAgB,OAAA,QAChC,OAAA,GAAU,WAAA,GACT,OAAA;AAAA,iBAoCmB,eAAA,CACpB,IAAA,EAAM,eAAA,GACL,OAAA,CAAQ,UAAA;AAAA,iBA6BK,gBAAA,CACd,MAAA,UACA,GAAA,UACA,OAAA,EAAS,OAAA,EACT,MAAA,GAAS,WAAA,EACT,IAAA,YAAgB,cAAA,CAAe,UAAA,IAC9B,WAAA;AAAA,iBAWa,aAAA,GAAA,CAAiB,IAAA,EAAM,UAAA,EAAY,MAAA,EAAQ,CAAA,CAAE,OAAA,CAAQ,CAAA,IAAK,CAAA;AAAA,iBAO1D,cAAA,CAAe,IAAA,WAAe,MAAA,EAAQ,CAAA,CAAE,OAAA;AAAA,iBAIxC,kBAAA,CACd,MAAA,UACA,KAAA,WACA,MAAA,EAAQ,eAAA"}
|
package/dist/v1/utils.js
CHANGED
|
@@ -1,114 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// literals come back as bigint instead of being rounded to JS Number. On the
|
|
7
|
-
// way out, bigint values are emitted as raw JSON number digits.
|
|
1
|
+
import { execute } from "@databricks/sdk-core/ops";
|
|
2
|
+
import { ApiError } from "@databricks/sdk-core/apierror";
|
|
3
|
+
import JSONBig from "json-bigint";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/utils.ts
|
|
8
6
|
const jsonBigint = JSONBig({ useNativeBigInt: true });
|
|
9
7
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
return execute(options?.signal, call, opts);
|
|
8
|
+
* Translates public CallOptions to the internal Options shape accepted by
|
|
9
|
+
* execute(). Even though the shapes match today, this isolates the public
|
|
10
|
+
* API from the executor's internal type so they can diverge.
|
|
11
|
+
*/
|
|
12
|
+
async function executeCall(call, options) {
|
|
13
|
+
const opts = {
|
|
14
|
+
...options?.retrier !== void 0 && { retrier: options.retrier },
|
|
15
|
+
...options?.rateLimiter !== void 0 && { rateLimiter: options.rateLimiter },
|
|
16
|
+
...options?.timeout !== void 0 && { timeout: options.timeout }
|
|
17
|
+
};
|
|
18
|
+
return execute(options?.signal, call, opts);
|
|
23
19
|
}
|
|
24
20
|
async function readAll(body) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
result.set(chunk, offset);
|
|
42
|
-
offset += chunk.length;
|
|
43
|
-
}
|
|
44
|
-
return result;
|
|
21
|
+
if (body === null) return new Uint8Array(0);
|
|
22
|
+
const reader = body.getReader();
|
|
23
|
+
const chunks = [];
|
|
24
|
+
for (;;) {
|
|
25
|
+
const { done, value } = await reader.read();
|
|
26
|
+
if (done) break;
|
|
27
|
+
chunks.push(value);
|
|
28
|
+
}
|
|
29
|
+
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
30
|
+
const result = new Uint8Array(totalLength);
|
|
31
|
+
let offset = 0;
|
|
32
|
+
for (const chunk of chunks) {
|
|
33
|
+
result.set(chunk, offset);
|
|
34
|
+
offset += chunk.length;
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
45
37
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
throw apiErr;
|
|
67
|
-
}
|
|
68
|
-
return body;
|
|
38
|
+
async function executeHttpCall(opts) {
|
|
39
|
+
opts.logger.debug("HTTP request", {
|
|
40
|
+
method: opts.request.method,
|
|
41
|
+
url: opts.request.url
|
|
42
|
+
});
|
|
43
|
+
let resp;
|
|
44
|
+
try {
|
|
45
|
+
resp = await opts.httpClient.send(opts.request);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
opts.logger.debug("HTTP request failed");
|
|
48
|
+
throw e;
|
|
49
|
+
}
|
|
50
|
+
const body = await readAll(resp.body);
|
|
51
|
+
opts.logger.debug("HTTP response", {
|
|
52
|
+
statusCode: resp.statusCode,
|
|
53
|
+
body: new TextDecoder().decode(body)
|
|
54
|
+
});
|
|
55
|
+
const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
|
|
56
|
+
if (apiErr !== void 0) throw apiErr;
|
|
57
|
+
return body;
|
|
69
58
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
59
|
+
function buildHttpRequest(method, url, headers, signal, body) {
|
|
60
|
+
const req = {
|
|
61
|
+
url,
|
|
62
|
+
method,
|
|
63
|
+
headers
|
|
64
|
+
};
|
|
65
|
+
if (body !== void 0) req.body = body;
|
|
66
|
+
if (signal !== void 0) req.signal = signal;
|
|
67
|
+
return req;
|
|
79
68
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return schema.parse(parsed);
|
|
69
|
+
function parseResponse(body, schema) {
|
|
70
|
+
const text = new TextDecoder().decode(body);
|
|
71
|
+
const parsed = text === "" ? {} : jsonBigint.parse(text);
|
|
72
|
+
return schema.parse(parsed);
|
|
85
73
|
}
|
|
86
|
-
|
|
87
|
-
|
|
74
|
+
function marshalRequest(data, schema) {
|
|
75
|
+
return jsonBigint.stringify(schema.parse(data));
|
|
88
76
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
for (const item of value) {
|
|
96
|
-
params.append(prefix, String(item));
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else if (typeof value === 'object') {
|
|
100
|
-
for (const [key, val] of Object.entries(value)) {
|
|
101
|
-
flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
else if (typeof value === 'string' ||
|
|
105
|
-
typeof value === 'number' ||
|
|
106
|
-
typeof value === 'boolean' ||
|
|
107
|
-
typeof value === 'bigint') {
|
|
108
|
-
params.append(prefix, String(value));
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
112
|
-
}
|
|
77
|
+
function flattenQueryParams(prefix, value, params) {
|
|
78
|
+
if (value === null || value === void 0) return;
|
|
79
|
+
if (Array.isArray(value)) for (const item of value) params.append(prefix, String(item));
|
|
80
|
+
else if (typeof value === "object") for (const [key, val] of Object.entries(value)) flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
81
|
+
else if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") params.append(prefix, String(value));
|
|
82
|
+
else throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
113
83
|
}
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
|
|
114
87
|
//# sourceMappingURL=utils.js.map
|
package/dist/v1/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/v1/utils.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Options} from '@databricks/sdk-core/ops';\nimport {execute} from '@databricks/sdk-core/ops';\nimport {ApiError} from '@databricks/sdk-core/apierror';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport JSONBig from 'json-bigint';\nimport type {z} from 'zod';\n\n// JSON codec that preserves int64 precision. On the way in, large integer\n// literals come back as bigint instead of being rounded to JS Number. On the\n// way out, bigint values are emitted as raw JSON number digits.\nconst jsonBigint = JSONBig({useNativeBigInt: true});\n\nexport interface HttpCallOptions {\n readonly request: HttpRequest;\n readonly httpClient: HttpClient;\n readonly logger: Logger;\n}\n\n/**\n * Translates public CallOptions to the internal Options shape accepted by\n * execute(). Even though the shapes match today, this isolates the public\n * API from the executor's internal type so they can diverge.\n */\nexport async function executeCall(\n call: (signal?: AbortSignal) => Promise<void>,\n options?: CallOptions\n): Promise<void> {\n const opts: Options = {\n ...(options?.retrier !== undefined && {retrier: options.retrier}),\n ...(options?.rateLimiter !== undefined && {\n rateLimiter: options.rateLimiter,\n }),\n ...(options?.timeout !== undefined && {timeout: options.timeout}),\n };\n return execute(options?.signal, call, opts);\n}\n\nasync function readAll(\n body: ReadableStream<Uint8Array> | null\n): Promise<Uint8Array> {\n if (body === null) {\n return new Uint8Array(0);\n }\n const reader = body.getReader();\n const chunks: Uint8Array[] = [];\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n chunks.push(value);\n }\n const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n}\n\nexport async function executeHttpCall(\n opts: HttpCallOptions\n): Promise<Uint8Array> {\n opts.logger.debug('HTTP request', {\n method: opts.request.method,\n url: opts.request.url,\n });\n\n let resp: HttpResponse;\n try {\n resp = await opts.httpClient.send(opts.request);\n } catch (e: unknown) {\n opts.logger.debug('HTTP request failed');\n throw e;\n }\n\n const body = await readAll(resp.body);\n\n opts.logger.debug('HTTP response', {\n statusCode: resp.statusCode,\n body: new TextDecoder().decode(body),\n });\n\n const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);\n if (apiErr !== undefined) {\n throw apiErr;\n }\n\n return body;\n}\n\nexport function buildHttpRequest(\n method: string,\n url: string,\n headers: Headers,\n signal?: AbortSignal,\n body?: string | ReadableStream<Uint8Array>\n): HttpRequest {\n const req: HttpRequest = {url, method, headers};\n if (body !== undefined) {\n req.body = body;\n }\n if (signal !== undefined) {\n req.signal = signal;\n }\n return req;\n}\n\nexport function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {\n const text = new TextDecoder().decode(body);\n // 204 responses return an empty body; treat as `{}`.\n const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);\n return schema.parse(parsed);\n}\n\nexport function marshalRequest(data: unknown, schema: z.ZodType): string {\n return jsonBigint.stringify(schema.parse(data));\n}\n\nexport function flattenQueryParams(\n prefix: string,\n value: unknown,\n params: URLSearchParams\n): void {\n if (value === null || value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n // arrays of objects are not yet supported\n for (const item of value) {\n params.append(prefix, String(item));\n }\n } else if (typeof value === 'object') {\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n flattenQueryParams(`${prefix}.${key}`, val, params);\n }\n } else if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'bigint'\n ) {\n params.append(prefix, String(value));\n } else {\n throw new Error(`Unsupported query parameter type: ${typeof value}`);\n }\n}\n"],"mappings":";;;;;AAkBA,MAAM,aAAa,QAAQ,EAAC,iBAAiB,MAAK,CAAC;;;;;;AAanD,eAAsB,YACpB,MACA,SACe;CACf,MAAM,OAAgB;EACpB,GAAI,SAAS,YAAY,UAAa,EAAC,SAAS,QAAQ,SAAQ;EAChE,GAAI,SAAS,gBAAgB,UAAa,EACxC,aAAa,QAAQ,aACtB;EACD,GAAI,SAAS,YAAY,UAAa,EAAC,SAAS,QAAQ,SAAQ;EACjE;AACD,QAAO,QAAQ,SAAS,QAAQ,MAAM,KAAK;;AAG7C,eAAe,QACb,MACqB;AACrB,KAAI,SAAS,KACX,QAAO,IAAI,WAAW,EAAE;CAE1B,MAAM,SAAS,KAAK,WAAW;CAC/B,MAAM,SAAuB,EAAE;AAC/B,UAAS;EACP,MAAM,EAAC,MAAM,UAAS,MAAM,OAAO,MAAM;AACzC,MAAI,KACF;AAEF,SAAO,KAAK,MAAM;;CAEpB,MAAM,cAAc,OAAO,QAAQ,KAAK,UAAU,MAAM,MAAM,QAAQ,EAAE;CACxE,MAAM,SAAS,IAAI,WAAW,YAAY;CAC1C,IAAI,SAAS;AACb,MAAK,MAAM,SAAS,QAAQ;AAC1B,SAAO,IAAI,OAAO,OAAO;AACzB,YAAU,MAAM;;AAElB,QAAO;;AAGT,eAAsB,gBACpB,MACqB;AACrB,MAAK,OAAO,MAAM,gBAAgB;EAChC,QAAQ,KAAK,QAAQ;EACrB,KAAK,KAAK,QAAQ;EACnB,CAAC;CAEF,IAAI;AACJ,KAAI;AACF,SAAO,MAAM,KAAK,WAAW,KAAK,KAAK,QAAQ;UACxC,GAAY;AACnB,OAAK,OAAO,MAAM,sBAAsB;AACxC,QAAM;;CAGR,MAAM,OAAO,MAAM,QAAQ,KAAK,KAAK;AAErC,MAAK,OAAO,MAAM,iBAAiB;EACjC,YAAY,KAAK;EACjB,MAAM,IAAI,aAAa,CAAC,OAAO,KAAK;EACrC,CAAC;CAEF,MAAM,SAAS,SAAS,cAAc,KAAK,YAAY,KAAK,SAAS,KAAK;AAC1E,KAAI,WAAW,OACb,OAAM;AAGR,QAAO;;AAGT,SAAgB,iBACd,QACA,KACA,SACA,QACA,MACa;CACb,MAAM,MAAmB;EAAC;EAAK;EAAQ;EAAQ;AAC/C,KAAI,SAAS,OACX,KAAI,OAAO;AAEb,KAAI,WAAW,OACb,KAAI,SAAS;AAEf,QAAO;;AAGT,SAAgB,cAAiB,MAAkB,QAAyB;CAC1E,MAAM,OAAO,IAAI,aAAa,CAAC,OAAO,KAAK;CAE3C,MAAM,SAAkB,SAAS,KAAK,EAAE,GAAG,WAAW,MAAM,KAAK;AACjE,QAAO,OAAO,MAAM,OAAO;;AAG7B,SAAgB,eAAe,MAAe,QAA2B;AACvE,QAAO,WAAW,UAAU,OAAO,MAAM,KAAK,CAAC;;AAGjD,SAAgB,mBACd,QACA,OACA,QACM;AACN,KAAI,UAAU,QAAQ,UAAU,OAC9B;AAEF,KAAI,MAAM,QAAQ,MAAM,CAEtB,MAAK,MAAM,QAAQ,MACjB,QAAO,OAAO,QAAQ,OAAO,KAAK,CAAC;UAE5B,OAAO,UAAU,SAC1B,MAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,MAAiC,CACvE,oBAAmB,GAAG,OAAO,GAAG,OAAO,KAAK,OAAO;UAGrD,OAAO,UAAU,YACjB,OAAO,UAAU,YACjB,OAAO,UAAU,aACjB,OAAO,UAAU,SAEjB,QAAO,OAAO,QAAQ,OAAO,MAAM,CAAC;KAEpC,OAAM,IAAI,MAAM,qCAAqC,OAAO,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-storageconfigurations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"LICENSE"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "
|
|
18
|
+
"build": "tsdown",
|
|
19
19
|
"lint": "eslint src --ext .ts",
|
|
20
20
|
"lint:fix": "eslint src --ext .ts --fix",
|
|
21
21
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"directory": "packages/storageconfigurations"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@databricks/sdk-auth": ">=0.
|
|
37
|
-
"@databricks/sdk-core": ">=0.
|
|
38
|
-
"@databricks/sdk-options": ">=0.
|
|
36
|
+
"@databricks/sdk-auth": ">=0.35.0 <1.0.0",
|
|
37
|
+
"@databricks/sdk-core": ">=0.35.0 <1.0.0",
|
|
38
|
+
"@databricks/sdk-options": ">=0.35.0 <1.0.0",
|
|
39
39
|
"@js-temporal/polyfill": "^0.5.0",
|
|
40
40
|
"json-bigint": "^1.0.0",
|
|
41
41
|
"zod": "^4.3.6"
|
package/dist/v1/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAC,2BAA2B,EAAC,MAAM,UAAU,CAAC;AAErD,YAAY,EACV,iCAAiC,EACjC,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,cAAc,EACd,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
package/dist/v1/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E;;GAEG;AAEH,OAAO,EAAC,2BAA2B,EAAC,MAAM,UAAU,CAAC"}
|