@databricks/sdk-logdelivery 0.1.0-dev.4 → 0.2.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/README.md +23 -0
- package/dist/v1/client.d.ts +3 -3
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +23 -20
- package/dist/v1/client.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/package.json +9 -4
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @databricks/sdk-logdelivery
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
>
|
|
5
|
+
> ## Beta
|
|
6
|
+
>
|
|
7
|
+
> **This SDK is in Beta and is supported for production use cases.** Interfaces might still change slightly before GA (e.g. name standardization and minor ergonomic tweaks). We are keen to hear feedback from early adopters — please [file issues](https://github.com/databricks/sdk-js/issues), and we will address them.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @databricks/sdk-logdelivery
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import {LogDeliveryClient} from '@databricks/sdk-logdelivery/v1';
|
|
19
|
+
|
|
20
|
+
const client = new LogDeliveryClient({});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
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 { CreateLogDeliveryConfigurationRequest, CreateLogDeliveryConfigurationResponse, GetLogDeliveryConfigurationRequest, GetLogDeliveryConfigurationResponse, ListLogDeliveryConfigurationRequest, ListLogDeliveryConfigurationResponse, LogDeliveryConfiguration, UpdateLogDeliveryConfigurationRequest, UpdateLogDeliveryConfigurationResponse } from './model';
|
|
4
4
|
export declare class LogDeliveryClient {
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly accountId;
|
|
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
|
* Creates a new <Databricks> log delivery configuration to enable delivery of the specified type of logs to your storage location.
|
|
13
13
|
* This requires that you already created a [credential object](:method:Credentials/Create) (which encapsulates a cross-account service IAM role)
|
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,qCAAqC,EACrC,sCAAsC,EACtC,kCAAkC,EAClC,mCAAmC,EACnC,mCAAmC,EACnC,oCAAoC,EACpC,wBAAwB,EACxB,qCAAqC,EACrC,sCAAsC,EACvC,MAAM,SAAS,CAAC;AAgBjB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,
|
|
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,qCAAqC,EACrC,sCAAsC,EACtC,kCAAkC,EAClC,mCAAmC,EACnC,mCAAmC,EACnC,oCAAoC,EACpC,wBAAwB,EACxB,qCAAqC,EACrC,sCAAsC,EACvC,MAAM,SAAS,CAAC;AAgBjB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAIhC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAInC,OAAO,CAAC,MAAM,CAA4C;gBAE9C,OAAO,EAAE,aAAa;IAUlC,OAAO,CAAC,aAAa;IAKrB;;;;;;;;;;;;;;OAcG;IACG,8BAA8B,CAClC,GAAG,EAAE,qCAAqC,EAC1C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,sCAAsC,CAAC;IA6BlD,kGAAkG;IAC5F,2BAA2B,CAC/B,GAAG,EAAE,kCAAkC,EACvC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,mCAAmC,CAAC;IAyB/C,oGAAoG;IAC9F,4BAA4B,CAChC,GAAG,EAAE,mCAAmC,EACxC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,oCAAoC,CAAC;IAwCzC,gCAAgC,CACrC,GAAG,EAAE,mCAAmC,EACxC,OAAO,CAAC,EAAE,WAAW,GACpB,cAAc,CAAC,wBAAwB,CAAC;IAc3C;;;;OAIG;IACG,8BAA8B,CAClC,GAAG,EAAE,qCAAqC,EAC1C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,sCAAsC,CAAC;CA4BnD"}
|
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 { marshalCreateLogDeliveryConfigurationRequestSchema, marshalUpdateLogDeliveryConfigurationRequestSchema, unmarshalCreateLogDeliveryConfigurationResponseSchema, unmarshalGetLogDeliveryConfigurationResponseSchema, unmarshalListLogDeliveryConfigurationResponseSchema, unmarshalUpdateLogDeliveryConfigurationResponseSchema, } from './model';
|
|
@@ -12,29 +12,28 @@ const PACKAGE_SEGMENT = {
|
|
|
12
12
|
value: pkgJson.version,
|
|
13
13
|
};
|
|
14
14
|
export class LogDeliveryClient {
|
|
15
|
-
|
|
16
|
-
// Fallback for endpoints whose path contains {account_id}. If the request
|
|
17
|
-
// already carries an accountId, that value wins.
|
|
18
|
-
accountId;
|
|
19
|
-
httpClient;
|
|
15
|
+
options;
|
|
20
16
|
logger;
|
|
21
17
|
// User-Agent header value. Composed once at construction from
|
|
22
18
|
// createDefault() merged with this package's identity and the active
|
|
23
19
|
// credential's name.
|
|
24
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;
|
|
25
25
|
constructor(options) {
|
|
26
|
-
|
|
27
|
-
throw new Error('Host is required.');
|
|
28
|
-
}
|
|
29
|
-
this.host = options.host.replace(/\/$/, '');
|
|
30
|
-
this.accountId = options.accountId;
|
|
26
|
+
this.options = options;
|
|
31
27
|
this.logger = options.logger ?? new NoOpLogger();
|
|
32
28
|
const info = createDefault()
|
|
33
29
|
.with(PACKAGE_SEGMENT)
|
|
34
30
|
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
35
31
|
.with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
|
|
36
32
|
this.userAgent = info.toString();
|
|
37
|
-
|
|
33
|
+
}
|
|
34
|
+
resolveConfig() {
|
|
35
|
+
this.config ??= resolveClientConfig(this.options);
|
|
36
|
+
return this.config;
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
40
39
|
* Creates a new <Databricks> log delivery configuration to enable delivery of the specified type of logs to your storage location.
|
|
@@ -52,7 +51,8 @@ export class LogDeliveryClient {
|
|
|
52
51
|
* You cannot delete a log delivery configuration, but you can disable it (see [Enable or disable log delivery configuration](:method:LogDelivery/PatchStatus)).
|
|
53
52
|
*/
|
|
54
53
|
async createLogDeliveryConfiguration(req, options) {
|
|
55
|
-
const
|
|
54
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
55
|
+
const url = `${host}/api/2.0/accounts/${req.logDeliveryConfiguration?.accountId ?? accountId ?? ''}/log-delivery`;
|
|
56
56
|
const body = marshalRequest(req, marshalCreateLogDeliveryConfigurationRequestSchema);
|
|
57
57
|
let resp;
|
|
58
58
|
const call = async (callSignal) => {
|
|
@@ -61,7 +61,7 @@ export class LogDeliveryClient {
|
|
|
61
61
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
62
62
|
const respBody = await executeHttpCall({
|
|
63
63
|
request: httpReq,
|
|
64
|
-
httpClient
|
|
64
|
+
httpClient,
|
|
65
65
|
logger: this.logger,
|
|
66
66
|
});
|
|
67
67
|
resp = parseResponse(respBody, unmarshalCreateLogDeliveryConfigurationResponseSchema);
|
|
@@ -74,7 +74,8 @@ export class LogDeliveryClient {
|
|
|
74
74
|
}
|
|
75
75
|
/** Gets a <Databricks> log delivery configuration object for an account, both specified by ID. */
|
|
76
76
|
async getLogDeliveryConfiguration(req, options) {
|
|
77
|
-
const
|
|
77
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
78
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/log-delivery/${req.configId ?? ''}`;
|
|
78
79
|
let resp;
|
|
79
80
|
const call = async (callSignal) => {
|
|
80
81
|
const headers = new Headers();
|
|
@@ -82,7 +83,7 @@ export class LogDeliveryClient {
|
|
|
82
83
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
83
84
|
const respBody = await executeHttpCall({
|
|
84
85
|
request: httpReq,
|
|
85
|
-
httpClient
|
|
86
|
+
httpClient,
|
|
86
87
|
logger: this.logger,
|
|
87
88
|
});
|
|
88
89
|
resp = parseResponse(respBody, unmarshalGetLogDeliveryConfigurationResponseSchema);
|
|
@@ -95,7 +96,8 @@ export class LogDeliveryClient {
|
|
|
95
96
|
}
|
|
96
97
|
/** Gets all <Databricks> log delivery configurations associated with an account specified by ID. */
|
|
97
98
|
async listLogDeliveryConfiguration(req, options) {
|
|
98
|
-
const
|
|
99
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
100
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/log-delivery`;
|
|
99
101
|
const params = new URLSearchParams();
|
|
100
102
|
if (req.credentialsId !== undefined) {
|
|
101
103
|
params.append('credentials_id', req.credentialsId);
|
|
@@ -118,7 +120,7 @@ export class LogDeliveryClient {
|
|
|
118
120
|
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
119
121
|
const respBody = await executeHttpCall({
|
|
120
122
|
request: httpReq,
|
|
121
|
-
httpClient
|
|
123
|
+
httpClient,
|
|
122
124
|
logger: this.logger,
|
|
123
125
|
});
|
|
124
126
|
resp = parseResponse(respBody, unmarshalListLogDeliveryConfigurationResponseSchema);
|
|
@@ -148,7 +150,8 @@ export class LogDeliveryClient {
|
|
|
148
150
|
* Note that you can't re-enable a delivery configuration if this would violate the delivery configuration limits described under [Create log delivery](:method:LogDelivery/Create).
|
|
149
151
|
*/
|
|
150
152
|
async updateLogDeliveryConfiguration(req, options) {
|
|
151
|
-
const
|
|
153
|
+
const { host, accountId, httpClient } = await this.resolveConfig();
|
|
154
|
+
const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/log-delivery/${req.configId ?? ''}`;
|
|
152
155
|
const body = marshalRequest(req, marshalUpdateLogDeliveryConfigurationRequestSchema);
|
|
153
156
|
let resp;
|
|
154
157
|
const call = async (callSignal) => {
|
|
@@ -157,7 +160,7 @@ export class LogDeliveryClient {
|
|
|
157
160
|
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
158
161
|
const respBody = await executeHttpCall({
|
|
159
162
|
request: httpReq,
|
|
160
|
-
httpClient
|
|
163
|
+
httpClient,
|
|
161
164
|
logger: this.logger,
|
|
162
165
|
});
|
|
163
166
|
resp = parseResponse(respBody, unmarshalUpdateLogDeliveryConfigurationResponseSchema);
|
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,kDAAkD,EAClD,qDAAqD,EACrD,kDAAkD,EAClD,mDAAmD,EACnD,qDAAqD,GACtD,MAAM,SAAS,CAAC;AAEjB,gFAAgF;AAChF,MAA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gBACV,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,IAAI,GAAG,aAAa,CAClB,QAAQ,EACR,qDAAqD,CACtD,CAAC;QACJ,CAAC,CAAC;QACF,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/v1/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":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAC,OAAO,EAAC,MAAM,+BAA+B,CAAC;AA0BtD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAsB;IAEtB,MAAM,OAAO,GAAY,MAAM,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IAED,0EAA0E;IAC1E,wEAAwE;IACxE,yEAAyE;IACzE,4DAA4D;IAC5D,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,IAAI,kBAAkB,EAAE,CAAC;IACxD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,kBAAkB,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;IACzE,IAAI,UAAU,GAAe,IAAI,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACnE,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAClC,UAAU,GAAG,IAAI,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,SAAS,G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C,OAAO,CAAC,CAAC;QACxD,MAAM,MAAM,GACV,OAAO,CAAC,MAAM,KAAK,SAAS;YAC1B,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;YAClD,CAAC,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAC,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-logdelivery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -27,10 +27,15 @@
|
|
|
27
27
|
},
|
|
28
28
|
"author": "Databricks",
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/databricks/sdk-js.git",
|
|
33
|
+
"directory": "packages/logdelivery"
|
|
34
|
+
},
|
|
30
35
|
"dependencies": {
|
|
31
|
-
"@databricks/sdk-auth": ">=0.
|
|
32
|
-
"@databricks/sdk-core": ">=0.
|
|
33
|
-
"@databricks/sdk-options": ">=0.
|
|
36
|
+
"@databricks/sdk-auth": ">=0.2.0 <1.0.0",
|
|
37
|
+
"@databricks/sdk-core": ">=0.2.0 <1.0.0",
|
|
38
|
+
"@databricks/sdk-options": ">=0.2.0 <1.0.0",
|
|
34
39
|
"@js-temporal/polyfill": "^0.5.0",
|
|
35
40
|
"json-bigint": "^1.0.0",
|
|
36
41
|
"zod": "^4.3.6"
|