@databricks/sdk-uc-artifactallowlists 0.1.0-dev.3 → 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/v1/model.d.ts +12 -10
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +15 -16
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +2 -1
- package/dist/v1/utils.js.map +1 -1
- package/package.json +4 -5
- package/src/v1/client.ts +0 -128
- package/src/v1/index.ts +0 -12
- package/src/v1/model.ts +0 -113
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -156
package/dist/v1/model.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/** The artifact type */
|
|
3
|
-
export declare
|
|
4
|
-
ARTIFACT_TYPE_UNSPECIFIED
|
|
5
|
-
INIT_SCRIPT
|
|
6
|
-
LIBRARY_JAR
|
|
7
|
-
LIBRARY_MAVEN
|
|
8
|
-
}
|
|
3
|
+
export declare const ArtifactType: {
|
|
4
|
+
readonly ARTIFACT_TYPE_UNSPECIFIED: "ARTIFACT_TYPE_UNSPECIFIED";
|
|
5
|
+
readonly INIT_SCRIPT: "INIT_SCRIPT";
|
|
6
|
+
readonly LIBRARY_JAR: "LIBRARY_JAR";
|
|
7
|
+
readonly LIBRARY_MAVEN: "LIBRARY_MAVEN";
|
|
8
|
+
};
|
|
9
|
+
export type ArtifactType = (typeof ArtifactType)[keyof typeof ArtifactType] | (string & {});
|
|
9
10
|
/** The artifact pattern matching type */
|
|
10
|
-
export declare
|
|
11
|
+
export declare const ArtifactMatcher_MatchType: {
|
|
11
12
|
/** In the future, we will add EXACT_MATCH, WILDCARDS, and more types */
|
|
12
|
-
MATCH_TYPE_UNSPECIFIED
|
|
13
|
-
PREFIX_MATCH
|
|
14
|
-
}
|
|
13
|
+
readonly MATCH_TYPE_UNSPECIFIED: "MATCH_TYPE_UNSPECIFIED";
|
|
14
|
+
readonly PREFIX_MATCH: "PREFIX_MATCH";
|
|
15
|
+
};
|
|
16
|
+
export type ArtifactMatcher_MatchType = (typeof ArtifactMatcher_MatchType)[keyof typeof ArtifactMatcher_MatchType] | (string & {});
|
|
15
17
|
export interface ArtifactAllowlistInfo {
|
|
16
18
|
/** A list of allowed artifact match patterns. */
|
|
17
19
|
artifactMatchers?: ArtifactMatcher[] | undefined;
|
package/dist/v1/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,wBAAwB;
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,wBAAwB;AAExB,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AACX,MAAM,MAAM,YAAY,GACpB,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,GAChD,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,yCAAyC;AAEzC,eAAO,MAAM,yBAAyB;IACpC,wEAAwE;;;CAGhE,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACjC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,GAC1E,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC;IACjD,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gDAAgD;IAChD,SAAS,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;CACnD;AAED,MAAM,WAAW,2BAA2B;IAC1C,0CAA0C;IAC1C,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,2BAA2B;IAC1C,0CAA0C;IAC1C,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC;IACjD,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAkB3E,CAAC;AAER,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAQjE,CAAC;AAEN,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,OAQxC,CAAC;AAEN,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,OAgBpD,CAAC"}
|
package/dist/v1/model.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
/** The artifact type */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
|
|
5
|
+
export const ArtifactType = {
|
|
6
|
+
ARTIFACT_TYPE_UNSPECIFIED: 'ARTIFACT_TYPE_UNSPECIFIED',
|
|
7
|
+
INIT_SCRIPT: 'INIT_SCRIPT',
|
|
8
|
+
LIBRARY_JAR: 'LIBRARY_JAR',
|
|
9
|
+
LIBRARY_MAVEN: 'LIBRARY_MAVEN',
|
|
10
|
+
};
|
|
11
11
|
/** The artifact pattern matching type */
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention --
|
|
13
|
-
export
|
|
14
|
-
(function (ArtifactMatcher_MatchType) {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
|
|
13
|
+
export const ArtifactMatcher_MatchType = {
|
|
15
14
|
/** In the future, we will add EXACT_MATCH, WILDCARDS, and more types */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
15
|
+
MATCH_TYPE_UNSPECIFIED: 'MATCH_TYPE_UNSPECIFIED',
|
|
16
|
+
PREFIX_MATCH: 'PREFIX_MATCH',
|
|
17
|
+
};
|
|
19
18
|
export const unmarshalArtifactAllowlistInfoSchema = z
|
|
20
19
|
.object({
|
|
21
20
|
artifact_matchers: z
|
|
@@ -37,7 +36,7 @@ export const unmarshalArtifactAllowlistInfoSchema = z
|
|
|
37
36
|
export const unmarshalArtifactMatcherSchema = z
|
|
38
37
|
.object({
|
|
39
38
|
artifact: z.string().optional(),
|
|
40
|
-
match_type: z.
|
|
39
|
+
match_type: z.string().optional(),
|
|
41
40
|
})
|
|
42
41
|
.transform(d => ({
|
|
43
42
|
artifact: d.artifact,
|
|
@@ -46,7 +45,7 @@ export const unmarshalArtifactMatcherSchema = z
|
|
|
46
45
|
export const marshalArtifactMatcherSchema = z
|
|
47
46
|
.object({
|
|
48
47
|
artifact: z.string().optional(),
|
|
49
|
-
matchType: z.
|
|
48
|
+
matchType: z.string().optional(),
|
|
50
49
|
})
|
|
51
50
|
.transform(d => ({
|
|
52
51
|
artifact: d.artifact,
|
|
@@ -54,7 +53,7 @@ export const marshalArtifactMatcherSchema = z
|
|
|
54
53
|
}));
|
|
55
54
|
export const marshalSetArtifactAllowlistRequestSchema = z
|
|
56
55
|
.object({
|
|
57
|
-
artifactType: z.
|
|
56
|
+
artifactType: z.string().optional(),
|
|
58
57
|
artifactMatchers: z
|
|
59
58
|
.array(z.lazy(() => marshalArtifactMatcherSchema))
|
|
60
59
|
.optional(),
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,wBAAwB;AACxB,MAAM,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,wBAAwB;AACxB,4FAA4F;AAC5F,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,yBAAyB,EAAE,2BAA2B;IACtD,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;CACtB,CAAC;AAKX,yCAAyC;AACzC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,wEAAwE;IACxE,sBAAsB,EAAE,wBAAwB;IAChD,YAAY,EAAE,cAAc;CACpB,CAAC;AA0CX,MAAM,CAAC,MAAM,oCAAoC,GAC/C,CAAC;KACE,MAAM,CAAC;IACN,iBAAiB,EAAE,CAAC;SACjB,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,8BAA8B,CAAC,CAAC;SACnD,QAAQ,EAAE;IACb,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,UAAU,EAA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,OAAO,CAAC,UAAU,CAAC,CA2BrB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,GACzC,WAAW,CASb;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAK1E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAEvE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,GACtB,IAAI,CAuBN"}
|
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
|
-
|
|
82
|
+
// 204 responses return an empty body; treat as `{}`.
|
|
83
|
+
const parsed = text === '' ? {} : jsonBigint.parse(text);
|
|
83
84
|
return schema.parse(parsed);
|
|
84
85
|
}
|
|
85
86
|
export function marshalRequest(data, schema) {
|
package/dist/v1/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAQvD,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,0EAA0E;AAC1E,6EAA6E;AAC7E,gEAAgE;AAChE,MAAM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AC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-uc-artifactallowlists",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.4",
|
|
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": {
|
|
@@ -29,9 +28,9 @@
|
|
|
29
28
|
"author": "Databricks",
|
|
30
29
|
"license": "Apache-2.0",
|
|
31
30
|
"dependencies": {
|
|
32
|
-
"@databricks/sdk-auth": ">=0.1.0-dev.
|
|
33
|
-
"@databricks/sdk-core": ">=0.1.0-dev.
|
|
34
|
-
"@databricks/sdk-options": ">=0.1.0-dev.
|
|
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",
|
|
35
34
|
"@js-temporal/polyfill": "^0.5.0",
|
|
36
35
|
"json-bigint": "^1.0.0",
|
|
37
36
|
"zod": "^4.3.6"
|
package/src/v1/client.ts
DELETED
|
@@ -1,128 +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
|
-
ArtifactAllowlistInfo,
|
|
21
|
-
GetArtifactAllowlistRequest,
|
|
22
|
-
SetArtifactAllowlistRequest,
|
|
23
|
-
} from './model';
|
|
24
|
-
import {
|
|
25
|
-
marshalSetArtifactAllowlistRequestSchema,
|
|
26
|
-
unmarshalArtifactAllowlistInfoSchema,
|
|
27
|
-
} from './model';
|
|
28
|
-
|
|
29
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
30
|
-
const PACKAGE_SEGMENT = {
|
|
31
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
32
|
-
value: pkgJson.version,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export class ArtifactAllowlistsClient {
|
|
36
|
-
private readonly host: string;
|
|
37
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
38
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
39
|
-
// request.
|
|
40
|
-
private readonly workspaceId: string | undefined;
|
|
41
|
-
private readonly httpClient: HttpClient;
|
|
42
|
-
private readonly logger: Logger;
|
|
43
|
-
// User-Agent header value. Composed once at construction from
|
|
44
|
-
// createDefault() merged with this package's identity and the active
|
|
45
|
-
// credential's name.
|
|
46
|
-
private readonly userAgent: string;
|
|
47
|
-
|
|
48
|
-
constructor(options: ClientOptions) {
|
|
49
|
-
if (options.host === undefined) {
|
|
50
|
-
throw new Error('Host is required.');
|
|
51
|
-
}
|
|
52
|
-
this.host = options.host.replace(/\/$/, '');
|
|
53
|
-
this.workspaceId = options.workspaceId;
|
|
54
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
55
|
-
const info = createDefault()
|
|
56
|
-
.with(PACKAGE_SEGMENT)
|
|
57
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
58
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
59
|
-
this.userAgent = info.toString();
|
|
60
|
-
this.httpClient = newHttpClient(options);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Get the artifact allowlist of a certain artifact type.
|
|
65
|
-
* The caller must be a metastore admin or have the **MANAGE ALLOWLIST** privilege
|
|
66
|
-
* on the metastore.
|
|
67
|
-
*/
|
|
68
|
-
async getArtifactAllowlist(
|
|
69
|
-
req: GetArtifactAllowlistRequest,
|
|
70
|
-
options?: CallOptions
|
|
71
|
-
): Promise<ArtifactAllowlistInfo> {
|
|
72
|
-
const url = `${this.host}/api/2.1/unity-catalog/artifact-allowlists/${req.artifactType ?? ''}`;
|
|
73
|
-
let resp: ArtifactAllowlistInfo | undefined;
|
|
74
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
75
|
-
const headers = new Headers();
|
|
76
|
-
if (this.workspaceId !== undefined) {
|
|
77
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
78
|
-
}
|
|
79
|
-
headers.set('User-Agent', this.userAgent);
|
|
80
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
81
|
-
const respBody = await executeHttpCall({
|
|
82
|
-
request: httpReq,
|
|
83
|
-
httpClient: this.httpClient,
|
|
84
|
-
logger: this.logger,
|
|
85
|
-
});
|
|
86
|
-
resp = parseResponse(respBody, unmarshalArtifactAllowlistInfoSchema);
|
|
87
|
-
};
|
|
88
|
-
await executeCall(call, options);
|
|
89
|
-
if (resp === undefined) {
|
|
90
|
-
throw new Error('operation completed without a result.');
|
|
91
|
-
}
|
|
92
|
-
return resp;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Set the artifact allowlist of a certain artifact type.
|
|
97
|
-
* The whole artifact allowlist is replaced with the new allowlist.
|
|
98
|
-
* The caller must be a metastore admin or have the **MANAGE ALLOWLIST** privilege
|
|
99
|
-
* on the metastore.
|
|
100
|
-
*/
|
|
101
|
-
async setArtifactAllowlist(
|
|
102
|
-
req: SetArtifactAllowlistRequest,
|
|
103
|
-
options?: CallOptions
|
|
104
|
-
): Promise<ArtifactAllowlistInfo> {
|
|
105
|
-
const url = `${this.host}/api/2.1/unity-catalog/artifact-allowlists/${req.artifactType ?? ''}`;
|
|
106
|
-
const body = marshalRequest(req, marshalSetArtifactAllowlistRequestSchema);
|
|
107
|
-
let resp: ArtifactAllowlistInfo | undefined;
|
|
108
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
109
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
110
|
-
if (this.workspaceId !== undefined) {
|
|
111
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
112
|
-
}
|
|
113
|
-
headers.set('User-Agent', this.userAgent);
|
|
114
|
-
const httpReq = buildHttpRequest('PUT', url, headers, callSignal, body);
|
|
115
|
-
const respBody = await executeHttpCall({
|
|
116
|
-
request: httpReq,
|
|
117
|
-
httpClient: this.httpClient,
|
|
118
|
-
logger: this.logger,
|
|
119
|
-
});
|
|
120
|
-
resp = parseResponse(respBody, unmarshalArtifactAllowlistInfoSchema);
|
|
121
|
-
};
|
|
122
|
-
await executeCall(call, options);
|
|
123
|
-
if (resp === undefined) {
|
|
124
|
-
throw new Error('operation completed without a result.');
|
|
125
|
-
}
|
|
126
|
-
return resp;
|
|
127
|
-
}
|
|
128
|
-
}
|
package/src/v1/index.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {ArtifactAllowlistsClient} from './client';
|
|
4
|
-
|
|
5
|
-
export {ArtifactType, ArtifactMatcher_MatchType} from './model';
|
|
6
|
-
|
|
7
|
-
export type {
|
|
8
|
-
ArtifactAllowlistInfo,
|
|
9
|
-
ArtifactMatcher,
|
|
10
|
-
GetArtifactAllowlistRequest,
|
|
11
|
-
SetArtifactAllowlistRequest,
|
|
12
|
-
} from './model';
|
package/src/v1/model.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
|
|
5
|
-
/** The artifact type */
|
|
6
|
-
export enum ArtifactType {
|
|
7
|
-
ARTIFACT_TYPE_UNSPECIFIED = 'ARTIFACT_TYPE_UNSPECIFIED',
|
|
8
|
-
INIT_SCRIPT = 'INIT_SCRIPT',
|
|
9
|
-
LIBRARY_JAR = 'LIBRARY_JAR',
|
|
10
|
-
LIBRARY_MAVEN = 'LIBRARY_MAVEN',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** The artifact pattern matching type */
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
|
|
15
|
-
export enum ArtifactMatcher_MatchType {
|
|
16
|
-
/** In the future, we will add EXACT_MATCH, WILDCARDS, and more types */
|
|
17
|
-
MATCH_TYPE_UNSPECIFIED = 'MATCH_TYPE_UNSPECIFIED',
|
|
18
|
-
PREFIX_MATCH = 'PREFIX_MATCH',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ArtifactAllowlistInfo {
|
|
22
|
-
/** A list of allowed artifact match patterns. */
|
|
23
|
-
artifactMatchers?: ArtifactMatcher[] | undefined;
|
|
24
|
-
/** Unique identifier of parent metastore. */
|
|
25
|
-
metastoreId?: string | undefined;
|
|
26
|
-
/** Username of the user who set the artifact allowlist. */
|
|
27
|
-
createdBy?: string | undefined;
|
|
28
|
-
/** Time at which this artifact allowlist was set, in epoch milliseconds. */
|
|
29
|
-
createdAt?: bigint | undefined;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ArtifactMatcher {
|
|
33
|
-
/** The artifact path or maven coordinate */
|
|
34
|
-
artifact?: string | undefined;
|
|
35
|
-
/** The pattern matching type of the artifact */
|
|
36
|
-
matchType?: ArtifactMatcher_MatchType | undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface GetArtifactAllowlistRequest {
|
|
40
|
-
/** The artifact type of the allowlist. */
|
|
41
|
-
artifactType?: ArtifactType | undefined;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface SetArtifactAllowlistRequest {
|
|
45
|
-
/** The artifact type of the allowlist. */
|
|
46
|
-
artifactType?: ArtifactType | undefined;
|
|
47
|
-
/** A list of allowed artifact match patterns. */
|
|
48
|
-
artifactMatchers?: ArtifactMatcher[] | undefined;
|
|
49
|
-
/** Unique identifier of parent metastore. */
|
|
50
|
-
metastoreId?: string | undefined;
|
|
51
|
-
/** Username of the user who set the artifact allowlist. */
|
|
52
|
-
createdBy?: string | undefined;
|
|
53
|
-
/** Time at which this artifact allowlist was set, in epoch milliseconds. */
|
|
54
|
-
createdAt?: bigint | undefined;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const unmarshalArtifactAllowlistInfoSchema: z.ZodType<ArtifactAllowlistInfo> =
|
|
58
|
-
z
|
|
59
|
-
.object({
|
|
60
|
-
artifact_matchers: z
|
|
61
|
-
.array(z.lazy(() => unmarshalArtifactMatcherSchema))
|
|
62
|
-
.optional(),
|
|
63
|
-
metastore_id: z.string().optional(),
|
|
64
|
-
created_by: z.string().optional(),
|
|
65
|
-
created_at: z
|
|
66
|
-
.union([z.number(), z.bigint()])
|
|
67
|
-
.transform(v => BigInt(v))
|
|
68
|
-
.optional(),
|
|
69
|
-
})
|
|
70
|
-
.transform(d => ({
|
|
71
|
-
artifactMatchers: d.artifact_matchers,
|
|
72
|
-
metastoreId: d.metastore_id,
|
|
73
|
-
createdBy: d.created_by,
|
|
74
|
-
createdAt: d.created_at,
|
|
75
|
-
}));
|
|
76
|
-
|
|
77
|
-
export const unmarshalArtifactMatcherSchema: z.ZodType<ArtifactMatcher> = z
|
|
78
|
-
.object({
|
|
79
|
-
artifact: z.string().optional(),
|
|
80
|
-
match_type: z.enum(ArtifactMatcher_MatchType).optional(),
|
|
81
|
-
})
|
|
82
|
-
.transform(d => ({
|
|
83
|
-
artifact: d.artifact,
|
|
84
|
-
matchType: d.match_type,
|
|
85
|
-
}));
|
|
86
|
-
|
|
87
|
-
export const marshalArtifactMatcherSchema: z.ZodType = z
|
|
88
|
-
.object({
|
|
89
|
-
artifact: z.string().optional(),
|
|
90
|
-
matchType: z.enum(ArtifactMatcher_MatchType).optional(),
|
|
91
|
-
})
|
|
92
|
-
.transform(d => ({
|
|
93
|
-
artifact: d.artifact,
|
|
94
|
-
match_type: d.matchType,
|
|
95
|
-
}));
|
|
96
|
-
|
|
97
|
-
export const marshalSetArtifactAllowlistRequestSchema: z.ZodType = z
|
|
98
|
-
.object({
|
|
99
|
-
artifactType: z.enum(ArtifactType).optional(),
|
|
100
|
-
artifactMatchers: z
|
|
101
|
-
.array(z.lazy(() => marshalArtifactMatcherSchema))
|
|
102
|
-
.optional(),
|
|
103
|
-
metastoreId: z.string().optional(),
|
|
104
|
-
createdBy: z.string().optional(),
|
|
105
|
-
createdAt: z.bigint().optional(),
|
|
106
|
-
})
|
|
107
|
-
.transform(d => ({
|
|
108
|
-
artifact_type: d.artifactType,
|
|
109
|
-
artifact_matchers: d.artifactMatchers,
|
|
110
|
-
metastore_id: d.metastoreId,
|
|
111
|
-
created_by: d.createdBy,
|
|
112
|
-
created_at: d.createdAt,
|
|
113
|
-
}));
|
package/src/v1/transport.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Credentials} from '@databricks/sdk-auth';
|
|
4
|
-
import {defaultCredentials} from '@databricks/sdk-auth/credentials';
|
|
5
|
-
import type {
|
|
6
|
-
HttpClient,
|
|
7
|
-
HttpRequest,
|
|
8
|
-
HttpResponse,
|
|
9
|
-
} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newFetchHttpClient} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
12
|
-
|
|
13
|
-
/** Creates a new HTTP client with the given options. */
|
|
14
|
-
export function newHttpClient(options?: ClientOptions): HttpClient {
|
|
15
|
-
const opts = options ?? {};
|
|
16
|
-
|
|
17
|
-
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
18
|
-
// also set, since they would be silently ignored.
|
|
19
|
-
if (opts.httpClient !== undefined) {
|
|
20
|
-
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
'httpClient cannot be combined with credentials or timeout'
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
return opts.httpClient;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const credentials = opts.credentials ?? defaultCredentials();
|
|
29
|
-
|
|
30
|
-
const base = newFetchHttpClient();
|
|
31
|
-
let client: HttpClient = new AuthHttpClient(base, credentials);
|
|
32
|
-
|
|
33
|
-
if (opts.timeout !== undefined) {
|
|
34
|
-
client = new TimeoutHttpClient(client, opts.timeout);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return client;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
class AuthHttpClient implements HttpClient {
|
|
42
|
-
constructor(
|
|
43
|
-
private readonly base: HttpClient,
|
|
44
|
-
private readonly credentials: Credentials
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
48
|
-
const authHeaders = await this.credentials.authHeaders();
|
|
49
|
-
// Do not modify the original request.
|
|
50
|
-
const headers = new Headers(request.headers);
|
|
51
|
-
for (const h of authHeaders) {
|
|
52
|
-
headers.set(h.key, h.value);
|
|
53
|
-
}
|
|
54
|
-
return this.base.send({...request, headers});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
class TimeoutHttpClient implements HttpClient {
|
|
60
|
-
constructor(
|
|
61
|
-
private readonly base: HttpClient,
|
|
62
|
-
private readonly timeout: number
|
|
63
|
-
) {}
|
|
64
|
-
|
|
65
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
66
|
-
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
67
|
-
const signal =
|
|
68
|
-
request.signal !== undefined
|
|
69
|
-
? AbortSignal.any([request.signal, timeoutSignal])
|
|
70
|
-
: timeoutSignal;
|
|
71
|
-
return this.base.send({...request, signal});
|
|
72
|
-
}
|
|
73
|
-
}
|
package/src/v1/utils.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Options} from '@databricks/sdk-core/ops';
|
|
4
|
-
import {execute} from '@databricks/sdk-core/ops';
|
|
5
|
-
import {ApiError} from '@databricks/sdk-core/apierror';
|
|
6
|
-
import type {
|
|
7
|
-
HttpClient,
|
|
8
|
-
HttpRequest,
|
|
9
|
-
HttpResponse,
|
|
10
|
-
} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
12
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
13
|
-
import JSONBig from 'json-bigint';
|
|
14
|
-
import type {z} from 'zod';
|
|
15
|
-
|
|
16
|
-
// JSON codec that preserves int64 precision. On the way in, large integer
|
|
17
|
-
// literals come back as bigint instead of being rounded to JS Number. On the
|
|
18
|
-
// way out, bigint values are emitted as raw JSON number digits.
|
|
19
|
-
const jsonBigint = JSONBig({useNativeBigInt: true});
|
|
20
|
-
|
|
21
|
-
export interface HttpCallOptions {
|
|
22
|
-
readonly request: HttpRequest;
|
|
23
|
-
readonly httpClient: HttpClient;
|
|
24
|
-
readonly logger: Logger;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Translates public CallOptions to the internal Options shape accepted by
|
|
29
|
-
* execute(). Even though the shapes match today, this isolates the public
|
|
30
|
-
* API from the executor's internal type so they can diverge.
|
|
31
|
-
*/
|
|
32
|
-
export async function executeCall(
|
|
33
|
-
call: (signal?: AbortSignal) => Promise<void>,
|
|
34
|
-
options?: CallOptions
|
|
35
|
-
): Promise<void> {
|
|
36
|
-
const opts: Options = {
|
|
37
|
-
...(options?.retrier !== undefined && {retrier: options.retrier}),
|
|
38
|
-
...(options?.rateLimiter !== undefined && {
|
|
39
|
-
rateLimiter: options.rateLimiter,
|
|
40
|
-
}),
|
|
41
|
-
...(options?.timeout !== undefined && {timeout: options.timeout}),
|
|
42
|
-
};
|
|
43
|
-
return execute(options?.signal, call, opts);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function readAll(
|
|
47
|
-
body: ReadableStream<Uint8Array> | null
|
|
48
|
-
): Promise<Uint8Array> {
|
|
49
|
-
if (body === null) {
|
|
50
|
-
return new Uint8Array(0);
|
|
51
|
-
}
|
|
52
|
-
const reader = body.getReader();
|
|
53
|
-
const chunks: Uint8Array[] = [];
|
|
54
|
-
for (;;) {
|
|
55
|
-
const {done, value} = await reader.read();
|
|
56
|
-
if (done) {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
chunks.push(value);
|
|
60
|
-
}
|
|
61
|
-
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
62
|
-
const result = new Uint8Array(totalLength);
|
|
63
|
-
let offset = 0;
|
|
64
|
-
for (const chunk of chunks) {
|
|
65
|
-
result.set(chunk, offset);
|
|
66
|
-
offset += chunk.length;
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export async function executeHttpCall(
|
|
72
|
-
opts: HttpCallOptions
|
|
73
|
-
): Promise<Uint8Array> {
|
|
74
|
-
opts.logger.debug('HTTP request', {
|
|
75
|
-
method: opts.request.method,
|
|
76
|
-
url: opts.request.url,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
let resp: HttpResponse;
|
|
80
|
-
try {
|
|
81
|
-
resp = await opts.httpClient.send(opts.request);
|
|
82
|
-
} catch (e: unknown) {
|
|
83
|
-
opts.logger.debug('HTTP request failed');
|
|
84
|
-
throw e;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const body = await readAll(resp.body);
|
|
88
|
-
|
|
89
|
-
opts.logger.debug('HTTP response', {
|
|
90
|
-
statusCode: resp.statusCode,
|
|
91
|
-
body: new TextDecoder().decode(body),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
|
|
95
|
-
if (apiErr !== undefined) {
|
|
96
|
-
throw apiErr;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return body;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function buildHttpRequest(
|
|
103
|
-
method: string,
|
|
104
|
-
url: string,
|
|
105
|
-
headers: Headers,
|
|
106
|
-
signal?: AbortSignal,
|
|
107
|
-
body?: string | ReadableStream<Uint8Array>
|
|
108
|
-
): HttpRequest {
|
|
109
|
-
const req: HttpRequest = {url, method, headers};
|
|
110
|
-
if (body !== undefined) {
|
|
111
|
-
req.body = body;
|
|
112
|
-
}
|
|
113
|
-
if (signal !== undefined) {
|
|
114
|
-
req.signal = signal;
|
|
115
|
-
}
|
|
116
|
-
return req;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
|
|
120
|
-
const text = new TextDecoder().decode(body);
|
|
121
|
-
const parsed: unknown = jsonBigint.parse(text);
|
|
122
|
-
return schema.parse(parsed);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function marshalRequest(data: unknown, schema: z.ZodType): string {
|
|
126
|
-
return jsonBigint.stringify(schema.parse(data));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export function flattenQueryParams(
|
|
130
|
-
prefix: string,
|
|
131
|
-
value: unknown,
|
|
132
|
-
params: URLSearchParams
|
|
133
|
-
): void {
|
|
134
|
-
if (value === null || value === undefined) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (Array.isArray(value)) {
|
|
138
|
-
// arrays of objects are not yet supported
|
|
139
|
-
for (const item of value) {
|
|
140
|
-
params.append(prefix, String(item));
|
|
141
|
-
}
|
|
142
|
-
} else if (typeof value === 'object') {
|
|
143
|
-
for (const [key, val] of Object.entries(value as Record<string, unknown>)) {
|
|
144
|
-
flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
145
|
-
}
|
|
146
|
-
} else if (
|
|
147
|
-
typeof value === 'string' ||
|
|
148
|
-
typeof value === 'number' ||
|
|
149
|
-
typeof value === 'boolean' ||
|
|
150
|
-
typeof value === 'bigint'
|
|
151
|
-
) {
|
|
152
|
-
params.append(prefix, String(value));
|
|
153
|
-
} else {
|
|
154
|
-
throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
155
|
-
}
|
|
156
|
-
}
|