@databricks/sdk-globalinitscripts 0.1.0-dev.2 → 0.1.0-dev.4
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/v2/client.d.ts +5 -5
- package/dist/v2/client.d.ts.map +1 -1
- package/dist/v2/client.js +5 -5
- package/dist/v2/client.js.map +1 -1
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/model.d.ts +8 -8
- package/dist/v2/model.d.ts.map +1 -1
- package/dist/v2/model.js +4 -8
- package/dist/v2/model.js.map +1 -1
- package/dist/v2/utils.d.ts.map +1 -1
- package/dist/v2/utils.js +2 -1
- package/dist/v2/utils.js.map +1 -1
- package/package.json +6 -6
- package/src/v2/client.ts +0 -240
- package/src/v2/index.ts +0 -16
- package/src/v2/model.ts +0 -194
- package/src/v2/transport.ts +0 -73
- package/src/v2/utils.ts +0 -156
package/dist/v2/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CallOptions } from '@databricks/sdk-options/call';
|
|
2
2
|
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
-
import type { CreateGlobalInitScriptRequest,
|
|
3
|
+
import type { CreateGlobalInitScriptRequest, CreateGlobalInitScriptResponse, DeleteGlobalInitScriptRequest, DeleteGlobalInitScriptResponse, GetGlobalInitScriptRequest, GlobalInitScriptDetails, ListGlobalInitScriptsRequest, ListGlobalInitScriptsResponse, UpdateGlobalInitScriptRequest, UpdateGlobalInitScriptResponse } from './model';
|
|
4
4
|
export declare class GlobalInitScriptsClient {
|
|
5
5
|
private readonly host;
|
|
6
6
|
private readonly workspaceId;
|
|
@@ -9,20 +9,20 @@ export declare class GlobalInitScriptsClient {
|
|
|
9
9
|
private readonly userAgent;
|
|
10
10
|
constructor(options: ClientOptions);
|
|
11
11
|
/** Creates a new global init script in this workspace. */
|
|
12
|
-
createGlobalInitScript(req: CreateGlobalInitScriptRequest, options?: CallOptions): Promise<
|
|
12
|
+
createGlobalInitScript(req: CreateGlobalInitScriptRequest, options?: CallOptions): Promise<CreateGlobalInitScriptResponse>;
|
|
13
13
|
/** Deletes a global init script. */
|
|
14
|
-
deleteGlobalInitScript(req: DeleteGlobalInitScriptRequest, options?: CallOptions): Promise<
|
|
14
|
+
deleteGlobalInitScript(req: DeleteGlobalInitScriptRequest, options?: CallOptions): Promise<DeleteGlobalInitScriptResponse>;
|
|
15
15
|
/** Gets all the details of a script, including its Base64-encoded contents. */
|
|
16
16
|
getGlobalInitScript(req: GetGlobalInitScriptRequest, options?: CallOptions): Promise<GlobalInitScriptDetails>;
|
|
17
17
|
/**
|
|
18
18
|
* Get a list of all global init scripts for this workspace. This returns all properties for each script but **not** the script contents.
|
|
19
19
|
* To retrieve the contents of a script, use the [get a global init script](:method:globalinitscripts/get) operation.
|
|
20
20
|
*/
|
|
21
|
-
listGlobalInitScripts(_req: ListGlobalInitScriptsRequest, options?: CallOptions): Promise<
|
|
21
|
+
listGlobalInitScripts(_req: ListGlobalInitScriptsRequest, options?: CallOptions): Promise<ListGlobalInitScriptsResponse>;
|
|
22
22
|
/**
|
|
23
23
|
* Updates a global init script, specifying only the fields to change. All fields are optional.
|
|
24
24
|
* Unspecified fields retain their current value.
|
|
25
25
|
*/
|
|
26
|
-
updateGlobalInitScript(req: UpdateGlobalInitScriptRequest, options?: CallOptions): Promise<
|
|
26
|
+
updateGlobalInitScript(req: UpdateGlobalInitScriptRequest, options?: CallOptions): Promise<UpdateGlobalInitScriptResponse>;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/v2/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v2/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,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B,GAAG,EAAE,6BAA6B,EAClC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,8BAA8B,CAAC;CA8B3C"}
|
package/dist/v2/client.js
CHANGED
|
@@ -5,7 +5,7 @@ import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
|
5
5
|
import { newHttpClient } from './transport';
|
|
6
6
|
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
7
7
|
import pkgJson from '../../package.json' with { type: 'json' };
|
|
8
|
-
import { marshalCreateGlobalInitScriptRequestSchema, marshalUpdateGlobalInitScriptRequestSchema,
|
|
8
|
+
import { marshalCreateGlobalInitScriptRequestSchema, marshalUpdateGlobalInitScriptRequestSchema, unmarshalCreateGlobalInitScriptResponseSchema, unmarshalDeleteGlobalInitScriptResponseSchema, unmarshalGlobalInitScriptDetailsSchema, unmarshalListGlobalInitScriptsResponseSchema, unmarshalUpdateGlobalInitScriptResponseSchema, } from './model';
|
|
9
9
|
// Package identity segment for this client to be used in the User-Agent header.
|
|
10
10
|
const PACKAGE_SEGMENT = {
|
|
11
11
|
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
@@ -54,7 +54,7 @@ export class GlobalInitScriptsClient {
|
|
|
54
54
|
httpClient: this.httpClient,
|
|
55
55
|
logger: this.logger,
|
|
56
56
|
});
|
|
57
|
-
resp = parseResponse(respBody,
|
|
57
|
+
resp = parseResponse(respBody, unmarshalCreateGlobalInitScriptResponseSchema);
|
|
58
58
|
};
|
|
59
59
|
await executeCall(call, options);
|
|
60
60
|
if (resp === undefined) {
|
|
@@ -78,7 +78,7 @@ export class GlobalInitScriptsClient {
|
|
|
78
78
|
httpClient: this.httpClient,
|
|
79
79
|
logger: this.logger,
|
|
80
80
|
});
|
|
81
|
-
resp = parseResponse(respBody,
|
|
81
|
+
resp = parseResponse(respBody, unmarshalDeleteGlobalInitScriptResponseSchema);
|
|
82
82
|
};
|
|
83
83
|
await executeCall(call, options);
|
|
84
84
|
if (resp === undefined) {
|
|
@@ -129,7 +129,7 @@ export class GlobalInitScriptsClient {
|
|
|
129
129
|
httpClient: this.httpClient,
|
|
130
130
|
logger: this.logger,
|
|
131
131
|
});
|
|
132
|
-
resp = parseResponse(respBody,
|
|
132
|
+
resp = parseResponse(respBody, unmarshalListGlobalInitScriptsResponseSchema);
|
|
133
133
|
};
|
|
134
134
|
await executeCall(call, options);
|
|
135
135
|
if (resp === undefined) {
|
|
@@ -157,7 +157,7 @@ export class GlobalInitScriptsClient {
|
|
|
157
157
|
httpClient: this.httpClient,
|
|
158
158
|
logger: this.logger,
|
|
159
159
|
});
|
|
160
|
-
resp = parseResponse(respBody,
|
|
160
|
+
resp = parseResponse(respBody, unmarshalUpdateGlobalInitScriptResponseSchema);
|
|
161
161
|
};
|
|
162
162
|
await executeCall(call, options);
|
|
163
163
|
if (resp === undefined) {
|
package/dist/v2/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v2/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,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,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;AAa7D,OAAO,EACL,0CAA0C,EAC1C,0CAA0C,EAC1C,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v2/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,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GAAG,KAAK,EAAE,UAAwB,EAAiB,EAAE;YAC7D,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAC,cAAc,EAAE,kBAAkB,EAAC,CAAC,CAAC;YAClE,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACnC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACvD,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1C,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;YAC1E,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC;gBACrC,OAAO,EAAE,OAAO;gBAChB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,IAAI,GAAG,aAAa,CAClB,QAAQ,EACR,6CAA6C,CAC9C,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/v2/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { GlobalInitScriptsClient } from './client';
|
|
2
|
-
export type { CreateGlobalInitScriptRequest,
|
|
2
|
+
export type { CreateGlobalInitScriptRequest, CreateGlobalInitScriptResponse, DeleteGlobalInitScriptRequest, DeleteGlobalInitScriptResponse, GetGlobalInitScriptRequest, GlobalInitScriptDetails, ListGlobalInitScriptsRequest, ListGlobalInitScriptsResponse, UpdateGlobalInitScriptRequest, UpdateGlobalInitScriptResponse, } from './model';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/v2/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,uBAAuB,EAAC,MAAM,UAAU,CAAC;AAEjD,YAAY,EACV,6BAA6B,EAC7B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,uBAAuB,EAAC,MAAM,UAAU,CAAC;AAEjD,YAAY,EACV,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,SAAS,CAAC"}
|
package/dist/v2/model.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface CreateGlobalInitScriptRequest {
|
|
|
15
15
|
/** Specifies whether the script is enabled. The script runs only if enabled. */
|
|
16
16
|
enabled?: boolean | undefined;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface CreateGlobalInitScriptResponse {
|
|
19
19
|
/** The global init script ID. */
|
|
20
20
|
scriptId?: string | undefined;
|
|
21
21
|
}
|
|
@@ -23,7 +23,7 @@ export interface DeleteGlobalInitScriptRequest {
|
|
|
23
23
|
/** The ID of the global init script. */
|
|
24
24
|
scriptId?: string | undefined;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface DeleteGlobalInitScriptResponse {
|
|
27
27
|
}
|
|
28
28
|
export interface GetGlobalInitScriptRequest {
|
|
29
29
|
/** The ID of the global init script. */
|
|
@@ -49,7 +49,7 @@ export interface GlobalInitScriptDetails {
|
|
|
49
49
|
}
|
|
50
50
|
export interface ListGlobalInitScriptsRequest {
|
|
51
51
|
}
|
|
52
|
-
export interface
|
|
52
|
+
export interface ListGlobalInitScriptsResponse {
|
|
53
53
|
scripts?: GlobalInitScriptDetails[] | undefined;
|
|
54
54
|
}
|
|
55
55
|
export interface UpdateGlobalInitScriptRequest {
|
|
@@ -77,13 +77,13 @@ export interface UpdateGlobalInitScriptRequest {
|
|
|
77
77
|
/** Specifies whether the script is enabled. The script runs only if enabled. */
|
|
78
78
|
enabled?: boolean | undefined;
|
|
79
79
|
}
|
|
80
|
-
export interface
|
|
80
|
+
export interface UpdateGlobalInitScriptResponse {
|
|
81
81
|
}
|
|
82
|
-
export declare const
|
|
83
|
-
export declare const
|
|
82
|
+
export declare const unmarshalCreateGlobalInitScriptResponseSchema: z.ZodType<CreateGlobalInitScriptResponse>;
|
|
83
|
+
export declare const unmarshalDeleteGlobalInitScriptResponseSchema: z.ZodType<DeleteGlobalInitScriptResponse>;
|
|
84
84
|
export declare const unmarshalGlobalInitScriptDetailsSchema: z.ZodType<GlobalInitScriptDetails>;
|
|
85
|
-
export declare const
|
|
86
|
-
export declare const
|
|
85
|
+
export declare const unmarshalListGlobalInitScriptsResponseSchema: z.ZodType<ListGlobalInitScriptsResponse>;
|
|
86
|
+
export declare const unmarshalUpdateGlobalInitScriptResponseSchema: z.ZodType<UpdateGlobalInitScriptResponse>;
|
|
87
87
|
export declare const marshalCreateGlobalInitScriptRequestSchema: z.ZodType;
|
|
88
88
|
export declare const marshalUpdateGlobalInitScriptRequestSchema: z.ZodType;
|
|
89
89
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/v2/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v2/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,WAAW,6BAA6B;IAC5C,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EA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C,OAmBtD,CAAC"}
|
package/dist/v2/model.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const unmarshalCreateGlobalInitScriptRequest_ResponseSchema = z
|
|
3
|
+
export const unmarshalCreateGlobalInitScriptResponseSchema = z
|
|
5
4
|
.object({
|
|
6
5
|
script_id: z.string().optional(),
|
|
7
6
|
})
|
|
8
7
|
.transform(d => ({
|
|
9
8
|
scriptId: d.script_id,
|
|
10
9
|
}));
|
|
11
|
-
|
|
12
|
-
export const unmarshalDeleteGlobalInitScriptRequest_ResponseSchema = z.object({});
|
|
10
|
+
export const unmarshalDeleteGlobalInitScriptResponseSchema = z.object({});
|
|
13
11
|
export const unmarshalGlobalInitScriptDetailsSchema = z
|
|
14
12
|
.object({
|
|
15
13
|
script_id: z.string().optional(),
|
|
@@ -37,8 +35,7 @@ export const unmarshalGlobalInitScriptDetailsSchema = z
|
|
|
37
35
|
updatedBy: d.updated_by,
|
|
38
36
|
updatedAt: d.updated_at,
|
|
39
37
|
}));
|
|
40
|
-
|
|
41
|
-
export const unmarshalListGlobalInitScriptsRequest_ResponseSchema = z
|
|
38
|
+
export const unmarshalListGlobalInitScriptsResponseSchema = z
|
|
42
39
|
.object({
|
|
43
40
|
scripts: z
|
|
44
41
|
.array(z.lazy(() => unmarshalGlobalInitScriptDetailsSchema))
|
|
@@ -47,8 +44,7 @@ export const unmarshalListGlobalInitScriptsRequest_ResponseSchema = z
|
|
|
47
44
|
.transform(d => ({
|
|
48
45
|
scripts: d.scripts,
|
|
49
46
|
}));
|
|
50
|
-
|
|
51
|
-
export const unmarshalUpdateGlobalInitScriptRequest_ResponseSchema = z.object({});
|
|
47
|
+
export const unmarshalUpdateGlobalInitScriptResponseSchema = z.object({});
|
|
52
48
|
export const marshalCreateGlobalInitScriptRequestSchema = z
|
|
53
49
|
.object({
|
|
54
50
|
name: z.string().optional(),
|
package/dist/v2/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v2/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v2/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AA4FtB,MAAM,CAAC,MAAM,6CAA6C,GACxD,CAAC;KACE,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,QAAQ,EAAE,CAAC,CAAC,SAAS;CACtB,CAAC,CAAC,CAAC;AAER,MAAM,CAAC,MAAM,6CAA6C,GACxD,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEf,MAAM,CAAC,MAAM,sCAAsC,GACjD,CAAC;KACE,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC/B,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACzB,QAAQ,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EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,GACtB,IAAI,CAuBN"}
|
package/dist/v2/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
|
-
|
|
82
|
+
// 204 responses return an empty body; treat as `{}`.
|
|
83
|
+
const parsed = text === '' ? {} : jsonBigint.parse(text);
|
|
83
84
|
return schema.parse(parsed);
|
|
84
85
|
}
|
|
85
86
|
export function marshalRequest(data, schema) {
|
package/dist/v2/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/v2/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,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uB;IAEvB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO;IACT,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,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-globalinitscripts",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./v2": {
|
|
8
8
|
"types": "./dist/v2/index.d.ts",
|
|
9
|
-
"import": "./dist/v2/index.js"
|
|
9
|
+
"import": "./dist/v2/index.js",
|
|
10
|
+
"default": "./dist/v2/index.js"
|
|
10
11
|
}
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"dist",
|
|
14
|
-
"src",
|
|
15
15
|
"LICENSE"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"author": "Databricks",
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@databricks/sdk-auth": ">=0.1.0-dev.
|
|
32
|
-
"@databricks/sdk-core": ">=0.1.0-dev.
|
|
33
|
-
"@databricks/sdk-options": ">=0.1.0-dev.
|
|
31
|
+
"@databricks/sdk-auth": ">=0.1.0-dev.5 <1.0.0",
|
|
32
|
+
"@databricks/sdk-core": ">=0.1.0-dev.6 <1.0.0",
|
|
33
|
+
"@databricks/sdk-options": ">=0.1.0-dev.5 <1.0.0",
|
|
34
34
|
"@js-temporal/polyfill": "^0.5.0",
|
|
35
35
|
"json-bigint": "^1.0.0",
|
|
36
36
|
"zod": "^4.3.6"
|
package/src/v2/client.ts
DELETED
|
@@ -1,240 +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
|
-
CreateGlobalInitScriptRequest,
|
|
21
|
-
CreateGlobalInitScriptRequest_Response,
|
|
22
|
-
DeleteGlobalInitScriptRequest,
|
|
23
|
-
DeleteGlobalInitScriptRequest_Response,
|
|
24
|
-
GetGlobalInitScriptRequest,
|
|
25
|
-
GlobalInitScriptDetails,
|
|
26
|
-
ListGlobalInitScriptsRequest,
|
|
27
|
-
ListGlobalInitScriptsRequest_Response,
|
|
28
|
-
UpdateGlobalInitScriptRequest,
|
|
29
|
-
UpdateGlobalInitScriptRequest_Response,
|
|
30
|
-
} from './model';
|
|
31
|
-
import {
|
|
32
|
-
marshalCreateGlobalInitScriptRequestSchema,
|
|
33
|
-
marshalUpdateGlobalInitScriptRequestSchema,
|
|
34
|
-
unmarshalCreateGlobalInitScriptRequest_ResponseSchema,
|
|
35
|
-
unmarshalDeleteGlobalInitScriptRequest_ResponseSchema,
|
|
36
|
-
unmarshalGlobalInitScriptDetailsSchema,
|
|
37
|
-
unmarshalListGlobalInitScriptsRequest_ResponseSchema,
|
|
38
|
-
unmarshalUpdateGlobalInitScriptRequest_ResponseSchema,
|
|
39
|
-
} from './model';
|
|
40
|
-
|
|
41
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
42
|
-
const PACKAGE_SEGMENT = {
|
|
43
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
44
|
-
value: pkgJson.version,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export class GlobalInitScriptsClient {
|
|
48
|
-
private readonly host: string;
|
|
49
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
50
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
51
|
-
// request.
|
|
52
|
-
private readonly workspaceId: string | undefined;
|
|
53
|
-
private readonly httpClient: HttpClient;
|
|
54
|
-
private readonly logger: Logger;
|
|
55
|
-
// User-Agent header value. Composed once at construction from
|
|
56
|
-
// createDefault() merged with this package's identity and the active
|
|
57
|
-
// credential's name.
|
|
58
|
-
private readonly userAgent: string;
|
|
59
|
-
|
|
60
|
-
constructor(options: ClientOptions) {
|
|
61
|
-
if (options.host === undefined) {
|
|
62
|
-
throw new Error('Host is required.');
|
|
63
|
-
}
|
|
64
|
-
this.host = options.host.replace(/\/$/, '');
|
|
65
|
-
this.workspaceId = options.workspaceId;
|
|
66
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
67
|
-
const info = createDefault()
|
|
68
|
-
.with(PACKAGE_SEGMENT)
|
|
69
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
70
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
71
|
-
this.userAgent = info.toString();
|
|
72
|
-
this.httpClient = newHttpClient(options);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Creates a new global init script in this workspace. */
|
|
76
|
-
async createGlobalInitScript(
|
|
77
|
-
req: CreateGlobalInitScriptRequest,
|
|
78
|
-
options?: CallOptions
|
|
79
|
-
): Promise<CreateGlobalInitScriptRequest_Response> {
|
|
80
|
-
const url = `${this.host}/api/2.0/global-init-scripts`;
|
|
81
|
-
const body = marshalRequest(
|
|
82
|
-
req,
|
|
83
|
-
marshalCreateGlobalInitScriptRequestSchema
|
|
84
|
-
);
|
|
85
|
-
let resp: CreateGlobalInitScriptRequest_Response | undefined;
|
|
86
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
87
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
88
|
-
if (this.workspaceId !== undefined) {
|
|
89
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
90
|
-
}
|
|
91
|
-
headers.set('User-Agent', this.userAgent);
|
|
92
|
-
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
93
|
-
const respBody = await executeHttpCall({
|
|
94
|
-
request: httpReq,
|
|
95
|
-
httpClient: this.httpClient,
|
|
96
|
-
logger: this.logger,
|
|
97
|
-
});
|
|
98
|
-
resp = parseResponse(
|
|
99
|
-
respBody,
|
|
100
|
-
unmarshalCreateGlobalInitScriptRequest_ResponseSchema
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
await executeCall(call, options);
|
|
104
|
-
if (resp === undefined) {
|
|
105
|
-
throw new Error('operation completed without a result.');
|
|
106
|
-
}
|
|
107
|
-
return resp;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** Deletes a global init script. */
|
|
111
|
-
async deleteGlobalInitScript(
|
|
112
|
-
req: DeleteGlobalInitScriptRequest,
|
|
113
|
-
options?: CallOptions
|
|
114
|
-
): Promise<DeleteGlobalInitScriptRequest_Response> {
|
|
115
|
-
const url = `${this.host}/api/2.0/global-init-scripts/${req.scriptId ?? ''}`;
|
|
116
|
-
let resp: DeleteGlobalInitScriptRequest_Response | undefined;
|
|
117
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
118
|
-
const headers = new Headers();
|
|
119
|
-
if (this.workspaceId !== undefined) {
|
|
120
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
121
|
-
}
|
|
122
|
-
headers.set('User-Agent', this.userAgent);
|
|
123
|
-
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
124
|
-
const respBody = await executeHttpCall({
|
|
125
|
-
request: httpReq,
|
|
126
|
-
httpClient: this.httpClient,
|
|
127
|
-
logger: this.logger,
|
|
128
|
-
});
|
|
129
|
-
resp = parseResponse(
|
|
130
|
-
respBody,
|
|
131
|
-
unmarshalDeleteGlobalInitScriptRequest_ResponseSchema
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
await executeCall(call, options);
|
|
135
|
-
if (resp === undefined) {
|
|
136
|
-
throw new Error('operation completed without a result.');
|
|
137
|
-
}
|
|
138
|
-
return resp;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** Gets all the details of a script, including its Base64-encoded contents. */
|
|
142
|
-
async getGlobalInitScript(
|
|
143
|
-
req: GetGlobalInitScriptRequest,
|
|
144
|
-
options?: CallOptions
|
|
145
|
-
): Promise<GlobalInitScriptDetails> {
|
|
146
|
-
const url = `${this.host}/api/2.0/global-init-scripts/${req.scriptId ?? ''}`;
|
|
147
|
-
let resp: GlobalInitScriptDetails | undefined;
|
|
148
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
149
|
-
const headers = new Headers();
|
|
150
|
-
if (this.workspaceId !== undefined) {
|
|
151
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
152
|
-
}
|
|
153
|
-
headers.set('User-Agent', this.userAgent);
|
|
154
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
155
|
-
const respBody = await executeHttpCall({
|
|
156
|
-
request: httpReq,
|
|
157
|
-
httpClient: this.httpClient,
|
|
158
|
-
logger: this.logger,
|
|
159
|
-
});
|
|
160
|
-
resp = parseResponse(respBody, unmarshalGlobalInitScriptDetailsSchema);
|
|
161
|
-
};
|
|
162
|
-
await executeCall(call, options);
|
|
163
|
-
if (resp === undefined) {
|
|
164
|
-
throw new Error('operation completed without a result.');
|
|
165
|
-
}
|
|
166
|
-
return resp;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Get a list of all global init scripts for this workspace. This returns all properties for each script but **not** the script contents.
|
|
171
|
-
* To retrieve the contents of a script, use the [get a global init script](:method:globalinitscripts/get) operation.
|
|
172
|
-
*/
|
|
173
|
-
async listGlobalInitScripts(
|
|
174
|
-
_req: ListGlobalInitScriptsRequest,
|
|
175
|
-
options?: CallOptions
|
|
176
|
-
): Promise<ListGlobalInitScriptsRequest_Response> {
|
|
177
|
-
const url = `${this.host}/api/2.0/global-init-scripts`;
|
|
178
|
-
let resp: ListGlobalInitScriptsRequest_Response | undefined;
|
|
179
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
180
|
-
const headers = new Headers();
|
|
181
|
-
if (this.workspaceId !== undefined) {
|
|
182
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
183
|
-
}
|
|
184
|
-
headers.set('User-Agent', this.userAgent);
|
|
185
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
186
|
-
const respBody = await executeHttpCall({
|
|
187
|
-
request: httpReq,
|
|
188
|
-
httpClient: this.httpClient,
|
|
189
|
-
logger: this.logger,
|
|
190
|
-
});
|
|
191
|
-
resp = parseResponse(
|
|
192
|
-
respBody,
|
|
193
|
-
unmarshalListGlobalInitScriptsRequest_ResponseSchema
|
|
194
|
-
);
|
|
195
|
-
};
|
|
196
|
-
await executeCall(call, options);
|
|
197
|
-
if (resp === undefined) {
|
|
198
|
-
throw new Error('operation completed without a result.');
|
|
199
|
-
}
|
|
200
|
-
return resp;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Updates a global init script, specifying only the fields to change. All fields are optional.
|
|
205
|
-
* Unspecified fields retain their current value.
|
|
206
|
-
*/
|
|
207
|
-
async updateGlobalInitScript(
|
|
208
|
-
req: UpdateGlobalInitScriptRequest,
|
|
209
|
-
options?: CallOptions
|
|
210
|
-
): Promise<UpdateGlobalInitScriptRequest_Response> {
|
|
211
|
-
const url = `${this.host}/api/2.0/global-init-scripts/${req.scriptId ?? ''}`;
|
|
212
|
-
const body = marshalRequest(
|
|
213
|
-
req,
|
|
214
|
-
marshalUpdateGlobalInitScriptRequestSchema
|
|
215
|
-
);
|
|
216
|
-
let resp: UpdateGlobalInitScriptRequest_Response | undefined;
|
|
217
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
218
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
219
|
-
if (this.workspaceId !== undefined) {
|
|
220
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
221
|
-
}
|
|
222
|
-
headers.set('User-Agent', this.userAgent);
|
|
223
|
-
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
224
|
-
const respBody = await executeHttpCall({
|
|
225
|
-
request: httpReq,
|
|
226
|
-
httpClient: this.httpClient,
|
|
227
|
-
logger: this.logger,
|
|
228
|
-
});
|
|
229
|
-
resp = parseResponse(
|
|
230
|
-
respBody,
|
|
231
|
-
unmarshalUpdateGlobalInitScriptRequest_ResponseSchema
|
|
232
|
-
);
|
|
233
|
-
};
|
|
234
|
-
await executeCall(call, options);
|
|
235
|
-
if (resp === undefined) {
|
|
236
|
-
throw new Error('operation completed without a result.');
|
|
237
|
-
}
|
|
238
|
-
return resp;
|
|
239
|
-
}
|
|
240
|
-
}
|
package/src/v2/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {GlobalInitScriptsClient} from './client';
|
|
4
|
-
|
|
5
|
-
export type {
|
|
6
|
-
CreateGlobalInitScriptRequest,
|
|
7
|
-
CreateGlobalInitScriptRequest_Response,
|
|
8
|
-
DeleteGlobalInitScriptRequest,
|
|
9
|
-
DeleteGlobalInitScriptRequest_Response,
|
|
10
|
-
GetGlobalInitScriptRequest,
|
|
11
|
-
GlobalInitScriptDetails,
|
|
12
|
-
ListGlobalInitScriptsRequest,
|
|
13
|
-
ListGlobalInitScriptsRequest_Response,
|
|
14
|
-
UpdateGlobalInitScriptRequest,
|
|
15
|
-
UpdateGlobalInitScriptRequest_Response,
|
|
16
|
-
} from './model';
|
package/src/v2/model.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
|
|
5
|
-
export interface CreateGlobalInitScriptRequest {
|
|
6
|
-
/** The name of the script */
|
|
7
|
-
name?: string | undefined;
|
|
8
|
-
/** The Base64-encoded content of the script. */
|
|
9
|
-
script?: Uint8Array | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* The position of a global init script, where 0 represents the first script to run, 1 is the second script to run, in ascending order.
|
|
12
|
-
*
|
|
13
|
-
* If you omit the numeric position for a new global init script, it defaults to last position. It will run after all current scripts.
|
|
14
|
-
* Setting any value greater than the position of the last script is equivalent to the last position. Example: Take three existing scripts with positions 0, 1, and 2. Any position of (3) or greater puts the script in the last position.
|
|
15
|
-
* If an explicit position value conflicts with an existing script value, your request succeeds, but the original script at that position and all later scripts have their positions incremented by 1.
|
|
16
|
-
*/
|
|
17
|
-
position?: number | undefined;
|
|
18
|
-
/** Specifies whether the script is enabled. The script runs only if enabled. */
|
|
19
|
-
enabled?: boolean | undefined;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
23
|
-
export interface CreateGlobalInitScriptRequest_Response {
|
|
24
|
-
/** The global init script ID. */
|
|
25
|
-
scriptId?: string | undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface DeleteGlobalInitScriptRequest {
|
|
29
|
-
/** The ID of the global init script. */
|
|
30
|
-
scriptId?: string | undefined;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
34
|
-
export interface DeleteGlobalInitScriptRequest_Response {}
|
|
35
|
-
|
|
36
|
-
export interface GetGlobalInitScriptRequest {
|
|
37
|
-
/** The ID of the global init script. */
|
|
38
|
-
scriptId?: string | undefined;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface GlobalInitScriptDetails {
|
|
42
|
-
/** The global init script ID. */
|
|
43
|
-
scriptId?: string | undefined;
|
|
44
|
-
/** The name of the script */
|
|
45
|
-
name?: string | undefined;
|
|
46
|
-
/** The position of a script, where 0 represents the first script to run, 1 is the second script to run, in ascending order. */
|
|
47
|
-
position?: number | undefined;
|
|
48
|
-
/** Specifies whether the script is enabled. The script runs only if enabled. */
|
|
49
|
-
enabled?: boolean | undefined;
|
|
50
|
-
/** The username of the user who created the script. */
|
|
51
|
-
createdBy?: string | undefined;
|
|
52
|
-
/** Time when the script was created, represented as a Unix timestamp in milliseconds. */
|
|
53
|
-
createdAt?: bigint | undefined;
|
|
54
|
-
/** The username of the user who last updated the script */
|
|
55
|
-
updatedBy?: string | undefined;
|
|
56
|
-
/** Time when the script was updated, represented as a Unix timestamp in milliseconds. */
|
|
57
|
-
updatedAt?: bigint | undefined;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
61
|
-
export interface ListGlobalInitScriptsRequest {}
|
|
62
|
-
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
64
|
-
export interface ListGlobalInitScriptsRequest_Response {
|
|
65
|
-
scripts?: GlobalInitScriptDetails[] | undefined;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface UpdateGlobalInitScriptRequest {
|
|
69
|
-
/** The ID of the global init script. */
|
|
70
|
-
scriptId?: string | undefined;
|
|
71
|
-
/** The name of the script */
|
|
72
|
-
name?: string | undefined;
|
|
73
|
-
/** The Base64-encoded content of the script. */
|
|
74
|
-
script?: Uint8Array | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* The position of a script, where 0 represents the first script to run,
|
|
77
|
-
* 1 is the second script to run, in ascending order.
|
|
78
|
-
* To move the script to run first, set its position to 0.
|
|
79
|
-
*
|
|
80
|
-
* To move the script to the end, set its position to any value
|
|
81
|
-
* greater or equal to the position of the last script.
|
|
82
|
-
* Example, three existing scripts with positions 0, 1, and 2.
|
|
83
|
-
* Any position value of 2 or greater puts the script in the last position (2).
|
|
84
|
-
*
|
|
85
|
-
* If an explicit position value conflicts with an existing script, your request succeeds,
|
|
86
|
-
* but the original script at that position and all later scripts have their positions
|
|
87
|
-
* incremented by 1.
|
|
88
|
-
*/
|
|
89
|
-
position?: number | undefined;
|
|
90
|
-
/** Specifies whether the script is enabled. The script runs only if enabled. */
|
|
91
|
-
enabled?: boolean | undefined;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
95
|
-
export interface UpdateGlobalInitScriptRequest_Response {}
|
|
96
|
-
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
98
|
-
export const unmarshalCreateGlobalInitScriptRequest_ResponseSchema: z.ZodType<CreateGlobalInitScriptRequest_Response> =
|
|
99
|
-
z
|
|
100
|
-
.object({
|
|
101
|
-
script_id: z.string().optional(),
|
|
102
|
-
})
|
|
103
|
-
.transform(d => ({
|
|
104
|
-
scriptId: d.script_id,
|
|
105
|
-
}));
|
|
106
|
-
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
108
|
-
export const unmarshalDeleteGlobalInitScriptRequest_ResponseSchema: z.ZodType<DeleteGlobalInitScriptRequest_Response> =
|
|
109
|
-
z.object({});
|
|
110
|
-
|
|
111
|
-
export const unmarshalGlobalInitScriptDetailsSchema: z.ZodType<GlobalInitScriptDetails> =
|
|
112
|
-
z
|
|
113
|
-
.object({
|
|
114
|
-
script_id: z.string().optional(),
|
|
115
|
-
name: z.string().optional(),
|
|
116
|
-
position: z.number().optional(),
|
|
117
|
-
enabled: z.boolean().optional(),
|
|
118
|
-
created_by: z.string().optional(),
|
|
119
|
-
created_at: z
|
|
120
|
-
.union([z.number(), z.bigint()])
|
|
121
|
-
.transform(v => BigInt(v))
|
|
122
|
-
.optional(),
|
|
123
|
-
updated_by: z.string().optional(),
|
|
124
|
-
updated_at: z
|
|
125
|
-
.union([z.number(), z.bigint()])
|
|
126
|
-
.transform(v => BigInt(v))
|
|
127
|
-
.optional(),
|
|
128
|
-
})
|
|
129
|
-
.transform(d => ({
|
|
130
|
-
scriptId: d.script_id,
|
|
131
|
-
name: d.name,
|
|
132
|
-
position: d.position,
|
|
133
|
-
enabled: d.enabled,
|
|
134
|
-
createdBy: d.created_by,
|
|
135
|
-
createdAt: d.created_at,
|
|
136
|
-
updatedBy: d.updated_by,
|
|
137
|
-
updatedAt: d.updated_at,
|
|
138
|
-
}));
|
|
139
|
-
|
|
140
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
141
|
-
export const unmarshalListGlobalInitScriptsRequest_ResponseSchema: z.ZodType<ListGlobalInitScriptsRequest_Response> =
|
|
142
|
-
z
|
|
143
|
-
.object({
|
|
144
|
-
scripts: z
|
|
145
|
-
.array(z.lazy(() => unmarshalGlobalInitScriptDetailsSchema))
|
|
146
|
-
.optional(),
|
|
147
|
-
})
|
|
148
|
-
.transform(d => ({
|
|
149
|
-
scripts: d.scripts,
|
|
150
|
-
}));
|
|
151
|
-
|
|
152
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
153
|
-
export const unmarshalUpdateGlobalInitScriptRequest_ResponseSchema: z.ZodType<UpdateGlobalInitScriptRequest_Response> =
|
|
154
|
-
z.object({});
|
|
155
|
-
|
|
156
|
-
export const marshalCreateGlobalInitScriptRequestSchema: z.ZodType = z
|
|
157
|
-
.object({
|
|
158
|
-
name: z.string().optional(),
|
|
159
|
-
script: z
|
|
160
|
-
.any()
|
|
161
|
-
.transform((d: Uint8Array) =>
|
|
162
|
-
btoa(Array.from(d, b => String.fromCharCode(b)).join(''))
|
|
163
|
-
)
|
|
164
|
-
.optional(),
|
|
165
|
-
position: z.number().optional(),
|
|
166
|
-
enabled: z.boolean().optional(),
|
|
167
|
-
})
|
|
168
|
-
.transform(d => ({
|
|
169
|
-
name: d.name,
|
|
170
|
-
script: d.script,
|
|
171
|
-
position: d.position,
|
|
172
|
-
enabled: d.enabled,
|
|
173
|
-
}));
|
|
174
|
-
|
|
175
|
-
export const marshalUpdateGlobalInitScriptRequestSchema: z.ZodType = z
|
|
176
|
-
.object({
|
|
177
|
-
scriptId: z.string().optional(),
|
|
178
|
-
name: z.string().optional(),
|
|
179
|
-
script: z
|
|
180
|
-
.any()
|
|
181
|
-
.transform((d: Uint8Array) =>
|
|
182
|
-
btoa(Array.from(d, b => String.fromCharCode(b)).join(''))
|
|
183
|
-
)
|
|
184
|
-
.optional(),
|
|
185
|
-
position: z.number().optional(),
|
|
186
|
-
enabled: z.boolean().optional(),
|
|
187
|
-
})
|
|
188
|
-
.transform(d => ({
|
|
189
|
-
script_id: d.scriptId,
|
|
190
|
-
name: d.name,
|
|
191
|
-
script: d.script,
|
|
192
|
-
position: d.position,
|
|
193
|
-
enabled: d.enabled,
|
|
194
|
-
}));
|
package/src/v2/transport.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Credentials} from '@databricks/sdk-auth';
|
|
4
|
-
import {defaultCredentials} from '@databricks/sdk-auth/credentials';
|
|
5
|
-
import type {
|
|
6
|
-
HttpClient,
|
|
7
|
-
HttpRequest,
|
|
8
|
-
HttpResponse,
|
|
9
|
-
} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newFetchHttpClient} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
12
|
-
|
|
13
|
-
/** Creates a new HTTP client with the given options. */
|
|
14
|
-
export function newHttpClient(options?: ClientOptions): HttpClient {
|
|
15
|
-
const opts = options ?? {};
|
|
16
|
-
|
|
17
|
-
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
18
|
-
// also set, since they would be silently ignored.
|
|
19
|
-
if (opts.httpClient !== undefined) {
|
|
20
|
-
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
'httpClient cannot be combined with credentials or timeout'
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
return opts.httpClient;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const credentials = opts.credentials ?? defaultCredentials();
|
|
29
|
-
|
|
30
|
-
const base = newFetchHttpClient();
|
|
31
|
-
let client: HttpClient = new AuthHttpClient(base, credentials);
|
|
32
|
-
|
|
33
|
-
if (opts.timeout !== undefined) {
|
|
34
|
-
client = new TimeoutHttpClient(client, opts.timeout);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return client;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
class AuthHttpClient implements HttpClient {
|
|
42
|
-
constructor(
|
|
43
|
-
private readonly base: HttpClient,
|
|
44
|
-
private readonly credentials: Credentials
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
48
|
-
const authHeaders = await this.credentials.authHeaders();
|
|
49
|
-
// Do not modify the original request.
|
|
50
|
-
const headers = new Headers(request.headers);
|
|
51
|
-
for (const h of authHeaders) {
|
|
52
|
-
headers.set(h.key, h.value);
|
|
53
|
-
}
|
|
54
|
-
return this.base.send({...request, headers});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
class TimeoutHttpClient implements HttpClient {
|
|
60
|
-
constructor(
|
|
61
|
-
private readonly base: HttpClient,
|
|
62
|
-
private readonly timeout: number
|
|
63
|
-
) {}
|
|
64
|
-
|
|
65
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
66
|
-
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
67
|
-
const signal =
|
|
68
|
-
request.signal !== undefined
|
|
69
|
-
? AbortSignal.any([request.signal, timeoutSignal])
|
|
70
|
-
: timeoutSignal;
|
|
71
|
-
return this.base.send({...request, signal});
|
|
72
|
-
}
|
|
73
|
-
}
|
package/src/v2/utils.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Options} from '@databricks/sdk-core/ops';
|
|
4
|
-
import {execute} from '@databricks/sdk-core/ops';
|
|
5
|
-
import {ApiError} from '@databricks/sdk-core/apierror';
|
|
6
|
-
import type {
|
|
7
|
-
HttpClient,
|
|
8
|
-
HttpRequest,
|
|
9
|
-
HttpResponse,
|
|
10
|
-
} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
12
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
13
|
-
import JSONBig from 'json-bigint';
|
|
14
|
-
import type {z} from 'zod';
|
|
15
|
-
|
|
16
|
-
// JSON codec that preserves int64 precision. On the way in, large integer
|
|
17
|
-
// literals come back as bigint instead of being rounded to JS Number. On the
|
|
18
|
-
// way out, bigint values are emitted as raw JSON number digits.
|
|
19
|
-
const jsonBigint = JSONBig({useNativeBigInt: true});
|
|
20
|
-
|
|
21
|
-
export interface HttpCallOptions {
|
|
22
|
-
readonly request: HttpRequest;
|
|
23
|
-
readonly httpClient: HttpClient;
|
|
24
|
-
readonly logger: Logger;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Translates public CallOptions to the internal Options shape accepted by
|
|
29
|
-
* execute(). Even though the shapes match today, this isolates the public
|
|
30
|
-
* API from the executor's internal type so they can diverge.
|
|
31
|
-
*/
|
|
32
|
-
export async function executeCall(
|
|
33
|
-
call: (signal?: AbortSignal) => Promise<void>,
|
|
34
|
-
options?: CallOptions
|
|
35
|
-
): Promise<void> {
|
|
36
|
-
const opts: Options = {
|
|
37
|
-
...(options?.retrier !== undefined && {retrier: options.retrier}),
|
|
38
|
-
...(options?.rateLimiter !== undefined && {
|
|
39
|
-
rateLimiter: options.rateLimiter,
|
|
40
|
-
}),
|
|
41
|
-
...(options?.timeout !== undefined && {timeout: options.timeout}),
|
|
42
|
-
};
|
|
43
|
-
return execute(options?.signal, call, opts);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function readAll(
|
|
47
|
-
body: ReadableStream<Uint8Array> | null
|
|
48
|
-
): Promise<Uint8Array> {
|
|
49
|
-
if (body === null) {
|
|
50
|
-
return new Uint8Array(0);
|
|
51
|
-
}
|
|
52
|
-
const reader = body.getReader();
|
|
53
|
-
const chunks: Uint8Array[] = [];
|
|
54
|
-
for (;;) {
|
|
55
|
-
const {done, value} = await reader.read();
|
|
56
|
-
if (done) {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
chunks.push(value);
|
|
60
|
-
}
|
|
61
|
-
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
62
|
-
const result = new Uint8Array(totalLength);
|
|
63
|
-
let offset = 0;
|
|
64
|
-
for (const chunk of chunks) {
|
|
65
|
-
result.set(chunk, offset);
|
|
66
|
-
offset += chunk.length;
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export async function executeHttpCall(
|
|
72
|
-
opts: HttpCallOptions
|
|
73
|
-
): Promise<Uint8Array> {
|
|
74
|
-
opts.logger.debug('HTTP request', {
|
|
75
|
-
method: opts.request.method,
|
|
76
|
-
url: opts.request.url,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
let resp: HttpResponse;
|
|
80
|
-
try {
|
|
81
|
-
resp = await opts.httpClient.send(opts.request);
|
|
82
|
-
} catch (e: unknown) {
|
|
83
|
-
opts.logger.debug('HTTP request failed');
|
|
84
|
-
throw e;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const body = await readAll(resp.body);
|
|
88
|
-
|
|
89
|
-
opts.logger.debug('HTTP response', {
|
|
90
|
-
statusCode: resp.statusCode,
|
|
91
|
-
body: new TextDecoder().decode(body),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
|
|
95
|
-
if (apiErr !== undefined) {
|
|
96
|
-
throw apiErr;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return body;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function buildHttpRequest(
|
|
103
|
-
method: string,
|
|
104
|
-
url: string,
|
|
105
|
-
headers: Headers,
|
|
106
|
-
signal?: AbortSignal,
|
|
107
|
-
body?: string | ReadableStream<Uint8Array>
|
|
108
|
-
): HttpRequest {
|
|
109
|
-
const req: HttpRequest = {url, method, headers};
|
|
110
|
-
if (body !== undefined) {
|
|
111
|
-
req.body = body;
|
|
112
|
-
}
|
|
113
|
-
if (signal !== undefined) {
|
|
114
|
-
req.signal = signal;
|
|
115
|
-
}
|
|
116
|
-
return req;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
|
|
120
|
-
const text = new TextDecoder().decode(body);
|
|
121
|
-
const parsed: unknown = jsonBigint.parse(text);
|
|
122
|
-
return schema.parse(parsed);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function marshalRequest(data: unknown, schema: z.ZodType): string {
|
|
126
|
-
return jsonBigint.stringify(schema.parse(data));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function flattenQueryParams(
|
|
130
|
-
prefix: string,
|
|
131
|
-
value: unknown,
|
|
132
|
-
params: URLSearchParams
|
|
133
|
-
): void {
|
|
134
|
-
if (value === null || value === undefined) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (Array.isArray(value)) {
|
|
138
|
-
// arrays of objects are not yet supported
|
|
139
|
-
for (const item of value) {
|
|
140
|
-
params.append(prefix, String(item));
|
|
141
|
-
}
|
|
142
|
-
} else if (typeof value === 'object') {
|
|
143
|
-
for (const [key, val] of Object.entries(value as Record<string, unknown>)) {
|
|
144
|
-
flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
145
|
-
}
|
|
146
|
-
} else if (
|
|
147
|
-
typeof value === 'string' ||
|
|
148
|
-
typeof value === 'number' ||
|
|
149
|
-
typeof value === 'boolean' ||
|
|
150
|
-
typeof value === 'bigint'
|
|
151
|
-
) {
|
|
152
|
-
params.append(prefix, String(value));
|
|
153
|
-
} else {
|
|
154
|
-
throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
155
|
-
}
|
|
156
|
-
}
|