@databricks/sdk-logdelivery 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/dist/v1/utils.js CHANGED
@@ -79,7 +79,8 @@ export function buildHttpRequest(method, url, headers, signal, body) {
79
79
  }
80
80
  export function parseResponse(body, schema) {
81
81
  const text = new TextDecoder().decode(body);
82
- const parsed = jsonBigint.parse(text);
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) {
@@ -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,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,CAAC;IACD,IAAI,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-logdelivery",
3
- "version": "0.1.0-dev.3",
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/logdelivery"
34
+ },
31
35
  "dependencies": {
32
- "@databricks/sdk-auth": ">=0.1.0-dev.4 <1.0.0",
33
- "@databricks/sdk-core": ">=0.1.0-dev.5 <1.0.0",
34
- "@databricks/sdk-options": ">=0.1.0-dev.4 <1.0.0",
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,241 +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
- CreateLogDeliveryConfigurationRequest,
21
- CreateLogDeliveryConfigurationResponse,
22
- GetLogDeliveryConfigurationRequest,
23
- GetLogDeliveryConfigurationResponse,
24
- ListLogDeliveryConfigurationRequest,
25
- ListLogDeliveryConfigurationResponse,
26
- LogDeliveryConfiguration,
27
- UpdateLogDeliveryConfigurationRequest,
28
- UpdateLogDeliveryConfigurationResponse,
29
- } from './model';
30
- import {
31
- marshalCreateLogDeliveryConfigurationRequestSchema,
32
- marshalUpdateLogDeliveryConfigurationRequestSchema,
33
- unmarshalCreateLogDeliveryConfigurationResponseSchema,
34
- unmarshalGetLogDeliveryConfigurationResponseSchema,
35
- unmarshalListLogDeliveryConfigurationResponseSchema,
36
- unmarshalUpdateLogDeliveryConfigurationResponseSchema,
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 LogDeliveryClient {
46
- private readonly host: string;
47
- // Fallback for endpoints whose path contains {account_id}. If the request
48
- // already carries an accountId, that value wins.
49
- private readonly accountId: string | undefined;
50
- private readonly httpClient: HttpClient;
51
- private readonly logger: Logger;
52
- // User-Agent header value. Composed once at construction from
53
- // createDefault() merged with this package's identity and the active
54
- // credential's name.
55
- private readonly userAgent: string;
56
-
57
- constructor(options: ClientOptions) {
58
- if (options.host === undefined) {
59
- throw new Error('Host is required.');
60
- }
61
- this.host = options.host.replace(/\/$/, '');
62
- this.accountId = options.accountId;
63
- this.logger = options.logger ?? new NoOpLogger();
64
- const info = createDefault()
65
- .with(PACKAGE_SEGMENT)
66
- .with({key: 'sdk-js-auth', value: AUTH_VERSION})
67
- .with({key: 'auth', value: options.credentials?.name() ?? 'default'});
68
- this.userAgent = info.toString();
69
- this.httpClient = newHttpClient(options);
70
- }
71
-
72
- /**
73
- * Creates a new <Databricks> log delivery configuration to enable delivery of the specified type of logs to your storage location.
74
- * This requires that you already created a [credential object](:method:Credentials/Create) (which encapsulates a cross-account service IAM role)
75
- * and a [storage configuration object](:method:Storage/Create) (which encapsulates an S3 bucket).
76
- *
77
- * For full details, including the required IAM role policies and bucket policies,
78
- * see [Deliver and access billable usage logs](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html)
79
- * or [Configure audit logging](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html).
80
- *
81
- * **Note**: There is a limit on the number of log delivery configurations available per account (each limit applies separately to each log type including billable usage and audit logs).
82
- * You can create a maximum of two enabled account-level delivery configurations (configurations without a workspace filter) per type.
83
- * Additionally, you can create two enabled workspace-level delivery configurations per workspace for each log type, which means that the same workspace ID can occur in the workspace filter for no more than two delivery configurations per log type.
84
- *
85
- * You cannot delete a log delivery configuration, but you can disable it (see [Enable or disable log delivery configuration](:method:LogDelivery/PatchStatus)).
86
- */
87
- async createLogDeliveryConfiguration(
88
- req: CreateLogDeliveryConfigurationRequest,
89
- options?: CallOptions
90
- ): Promise<CreateLogDeliveryConfigurationResponse> {
91
- const url = `${this.host}/api/2.0/accounts/${req.logDeliveryConfiguration?.accountId ?? this.accountId ?? ''}/log-delivery`;
92
- const body = marshalRequest(
93
- req,
94
- marshalCreateLogDeliveryConfigurationRequestSchema
95
- );
96
- let resp: CreateLogDeliveryConfigurationResponse | undefined;
97
- const call = async (callSignal?: AbortSignal): Promise<void> => {
98
- const headers = new Headers({'Content-Type': 'application/json'});
99
- headers.set('User-Agent', this.userAgent);
100
- const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
101
- const respBody = await executeHttpCall({
102
- request: httpReq,
103
- httpClient: this.httpClient,
104
- logger: this.logger,
105
- });
106
- resp = parseResponse(
107
- respBody,
108
- unmarshalCreateLogDeliveryConfigurationResponseSchema
109
- );
110
- };
111
- await executeCall(call, options);
112
- if (resp === undefined) {
113
- throw new Error('operation completed without a result.');
114
- }
115
- return resp;
116
- }
117
-
118
- /** Gets a <Databricks> log delivery configuration object for an account, both specified by ID. */
119
- async getLogDeliveryConfiguration(
120
- req: GetLogDeliveryConfigurationRequest,
121
- options?: CallOptions
122
- ): Promise<GetLogDeliveryConfigurationResponse> {
123
- const url = `${this.host}/api/2.0/accounts/${req.accountId ?? this.accountId ?? ''}/log-delivery/${req.configId ?? ''}`;
124
- let resp: GetLogDeliveryConfigurationResponse | undefined;
125
- const call = async (callSignal?: AbortSignal): Promise<void> => {
126
- const headers = new Headers();
127
- headers.set('User-Agent', this.userAgent);
128
- const httpReq = buildHttpRequest('GET', url, headers, callSignal);
129
- const respBody = await executeHttpCall({
130
- request: httpReq,
131
- httpClient: this.httpClient,
132
- logger: this.logger,
133
- });
134
- resp = parseResponse(
135
- respBody,
136
- unmarshalGetLogDeliveryConfigurationResponseSchema
137
- );
138
- };
139
- await executeCall(call, options);
140
- if (resp === undefined) {
141
- throw new Error('operation completed without a result.');
142
- }
143
- return resp;
144
- }
145
-
146
- /** Gets all <Databricks> log delivery configurations associated with an account specified by ID. */
147
- async listLogDeliveryConfiguration(
148
- req: ListLogDeliveryConfigurationRequest,
149
- options?: CallOptions
150
- ): Promise<ListLogDeliveryConfigurationResponse> {
151
- const url = `${this.host}/api/2.0/accounts/${req.accountId ?? this.accountId ?? ''}/log-delivery`;
152
- const params = new URLSearchParams();
153
- if (req.credentialsId !== undefined) {
154
- params.append('credentials_id', req.credentialsId);
155
- }
156
- if (req.storageConfigurationId !== undefined) {
157
- params.append('storage_configuration_id', req.storageConfigurationId);
158
- }
159
- if (req.status !== undefined) {
160
- params.append('status', req.status);
161
- }
162
- if (req.pageToken !== undefined) {
163
- params.append('page_token', req.pageToken);
164
- }
165
- const query = params.toString();
166
- const fullUrl = query !== '' ? `${url}?${query}` : url;
167
- let resp: ListLogDeliveryConfigurationResponse | undefined;
168
- const call = async (callSignal?: AbortSignal): Promise<void> => {
169
- const headers = new Headers();
170
- headers.set('User-Agent', this.userAgent);
171
- const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
172
- const respBody = await executeHttpCall({
173
- request: httpReq,
174
- httpClient: this.httpClient,
175
- logger: this.logger,
176
- });
177
- resp = parseResponse(
178
- respBody,
179
- unmarshalListLogDeliveryConfigurationResponseSchema
180
- );
181
- };
182
- await executeCall(call, options);
183
- if (resp === undefined) {
184
- throw new Error('operation completed without a result.');
185
- }
186
- return resp;
187
- }
188
-
189
- async *listLogDeliveryConfigurationIter(
190
- req: ListLogDeliveryConfigurationRequest,
191
- options?: CallOptions
192
- ): AsyncGenerator<LogDeliveryConfiguration> {
193
- const pageReq: ListLogDeliveryConfigurationRequest = {...req};
194
- for (;;) {
195
- const resp = await this.listLogDeliveryConfiguration(pageReq, options);
196
- for (const item of resp.logDeliveryConfigurations ?? []) {
197
- yield item;
198
- }
199
- if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
200
- return;
201
- }
202
- pageReq.pageToken = resp.nextPageToken;
203
- }
204
- }
205
-
206
- /**
207
- * Enables or disables a log delivery configuration.
208
- * Deletion of delivery configurations is not supported, so disable log delivery configurations that are no longer needed.
209
- * 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).
210
- */
211
- async updateLogDeliveryConfiguration(
212
- req: UpdateLogDeliveryConfigurationRequest,
213
- options?: CallOptions
214
- ): Promise<UpdateLogDeliveryConfigurationResponse> {
215
- const url = `${this.host}/api/2.0/accounts/${req.accountId ?? this.accountId ?? ''}/log-delivery/${req.configId ?? ''}`;
216
- const body = marshalRequest(
217
- req,
218
- marshalUpdateLogDeliveryConfigurationRequestSchema
219
- );
220
- let resp: UpdateLogDeliveryConfigurationResponse | undefined;
221
- const call = async (callSignal?: AbortSignal): Promise<void> => {
222
- const headers = new Headers({'Content-Type': 'application/json'});
223
- headers.set('User-Agent', this.userAgent);
224
- const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
225
- const respBody = await executeHttpCall({
226
- request: httpReq,
227
- httpClient: this.httpClient,
228
- logger: this.logger,
229
- });
230
- resp = parseResponse(
231
- respBody,
232
- unmarshalUpdateLogDeliveryConfigurationResponseSchema
233
- );
234
- };
235
- await executeCall(call, options);
236
- if (resp === undefined) {
237
- throw new Error('operation completed without a result.');
238
- }
239
- return resp;
240
- }
241
- }
package/src/v1/index.ts DELETED
@@ -1,24 +0,0 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
-
3
- export {LogDeliveryClient} from './client';
4
-
5
- export {
6
- LogDeliveryConfigStatus,
7
- LogDeliveryOutputFormat,
8
- LogDeliveryStatusEnum,
9
- LogDeliveryType,
10
- } from './model';
11
-
12
- export type {
13
- CreateLogDeliveryConfigurationParams,
14
- CreateLogDeliveryConfigurationRequest,
15
- CreateLogDeliveryConfigurationResponse,
16
- GetLogDeliveryConfigurationRequest,
17
- GetLogDeliveryConfigurationResponse,
18
- ListLogDeliveryConfigurationRequest,
19
- ListLogDeliveryConfigurationResponse,
20
- LogDeliveryConfiguration,
21
- LogDeliveryStatus,
22
- UpdateLogDeliveryConfigurationRequest,
23
- UpdateLogDeliveryConfigurationResponse,
24
- } from './model';