@databricks/sdk-uc-workspacebindings 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +40 -36
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +144 -177
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +3 -7
- package/dist/v1/index.js +4 -7
- package/dist/v1/model.d.ts +78 -74
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +54 -90
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +21 -17
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +60 -69
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts +18 -14
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +76 -103
- package/dist/v1/utils.js.map +1 -1
- package/package.json +5 -5
- package/dist/v1/index.d.ts.map +0 -1
- package/dist/v1/index.js.map +0 -1
package/dist/v1/model.d.ts
CHANGED
|
@@ -1,87 +1,91 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/v1/model.d.ts
|
|
2
4
|
/** Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` enum in `credentials_common.proto`. */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
declare const BindingType: {
|
|
6
|
+
readonly BINDING_TYPE_UNSPECIFIED: "BINDING_TYPE_UNSPECIFIED";
|
|
7
|
+
readonly BINDING_TYPE_READ_WRITE: "BINDING_TYPE_READ_WRITE";
|
|
8
|
+
readonly BINDING_TYPE_READ_ONLY: "BINDING_TYPE_READ_ONLY";
|
|
7
9
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type BindingType = (typeof BindingType)[keyof typeof BindingType] | (string & {});
|
|
11
|
+
interface GetCatalogWorkspaceBindingsRequest {
|
|
12
|
+
/** The name of the catalog. */
|
|
13
|
+
catalogName?: string | undefined;
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
interface GetCatalogWorkspaceBindingsResponse {
|
|
16
|
+
/** A list of workspace IDs */
|
|
17
|
+
workspaces?: bigint[] | undefined;
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
interface GetWorkspaceBindingsRequest {
|
|
20
|
+
/** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */
|
|
21
|
+
securableType?: string | undefined;
|
|
22
|
+
/** The name of the securable. */
|
|
23
|
+
securableFullName?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum number of workspace bindings to return.
|
|
26
|
+
* - When set to 0, the page length is set to a server configured value (recommended);
|
|
27
|
+
* - When set to a value greater than 0, the page length is the minimum of this value and a server configured value;
|
|
28
|
+
* - When set to a value less than 0, an invalid parameter error is returned;
|
|
29
|
+
* - If not set, all the workspace bindings are returned (not recommended).
|
|
30
|
+
*/
|
|
31
|
+
maxResults?: number | undefined;
|
|
32
|
+
/** Opaque pagination token to go to next page based on previous query. */
|
|
33
|
+
pageToken?: string | undefined;
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
interface GetWorkspaceBindingsResponse {
|
|
36
|
+
/** List of workspace bindings */
|
|
37
|
+
bindings?: WorkspaceBindingInfo[] | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
40
|
+
* __page_token__ should be set to this value for the next request (for the next page of results).
|
|
41
|
+
*/
|
|
42
|
+
nextPageToken?: string | undefined;
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
interface UpdateCatalogWorkspaceBindingsRequest {
|
|
45
|
+
/** The name of the catalog. */
|
|
46
|
+
catalogName?: string | undefined;
|
|
47
|
+
/** A list of workspace IDs. */
|
|
48
|
+
assignWorkspaces?: bigint[] | undefined;
|
|
49
|
+
/** A list of workspace IDs. */
|
|
50
|
+
unassignWorkspaces?: bigint[] | undefined;
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
interface UpdateCatalogWorkspaceBindingsResponse {
|
|
53
|
+
/** A list of workspace IDs */
|
|
54
|
+
workspaces?: bigint[] | undefined;
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
interface UpdateWorkspaceBindingsRequest {
|
|
57
|
+
/** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */
|
|
58
|
+
securableType?: string | undefined;
|
|
59
|
+
/** The name of the securable. */
|
|
60
|
+
securableFullName?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* List of workspace bindings to add. If a binding for the workspace already exists with a
|
|
63
|
+
* different binding_type, adding it again with a new binding_type will update the existing
|
|
64
|
+
* binding (e.g., from READ_WRITE to READ_ONLY).
|
|
65
|
+
*/
|
|
66
|
+
add?: WorkspaceBindingInfo[] | undefined;
|
|
67
|
+
/** List of workspace bindings to remove. */
|
|
68
|
+
remove?: WorkspaceBindingInfo[] | undefined;
|
|
67
69
|
}
|
|
68
70
|
/** A list of workspace IDs that are bound to the securable */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
interface UpdateWorkspaceBindingsResponse {
|
|
72
|
+
/** List of workspace bindings. */
|
|
73
|
+
bindings?: WorkspaceBindingInfo[] | undefined;
|
|
72
74
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
interface WorkspaceBindingInfo {
|
|
76
|
+
/** Required */
|
|
77
|
+
workspaceId?: bigint | undefined;
|
|
78
|
+
/** One of READ_WRITE/READ_ONLY. Default is READ_WRITE. */
|
|
79
|
+
bindingType?: BindingType | undefined;
|
|
78
80
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
declare const unmarshalGetCatalogWorkspaceBindingsResponseSchema: z.ZodType<GetCatalogWorkspaceBindingsResponse>;
|
|
82
|
+
declare const unmarshalGetWorkspaceBindingsResponseSchema: z.ZodType<GetWorkspaceBindingsResponse>;
|
|
83
|
+
declare const unmarshalUpdateCatalogWorkspaceBindingsResponseSchema: z.ZodType<UpdateCatalogWorkspaceBindingsResponse>;
|
|
84
|
+
declare const unmarshalUpdateWorkspaceBindingsResponseSchema: z.ZodType<UpdateWorkspaceBindingsResponse>;
|
|
85
|
+
declare const unmarshalWorkspaceBindingInfoSchema: z.ZodType<WorkspaceBindingInfo>;
|
|
86
|
+
declare const marshalUpdateCatalogWorkspaceBindingsRequestSchema: z.ZodType;
|
|
87
|
+
declare const marshalUpdateWorkspaceBindingsRequestSchema: z.ZodType;
|
|
88
|
+
declare const marshalWorkspaceBindingInfoSchema: z.ZodType;
|
|
89
|
+
//#endregion
|
|
90
|
+
export { BindingType, GetCatalogWorkspaceBindingsRequest, GetCatalogWorkspaceBindingsResponse, GetWorkspaceBindingsRequest, GetWorkspaceBindingsResponse, UpdateCatalogWorkspaceBindingsRequest, UpdateCatalogWorkspaceBindingsResponse, UpdateWorkspaceBindingsRequest, UpdateWorkspaceBindingsResponse, WorkspaceBindingInfo, marshalUpdateCatalogWorkspaceBindingsRequestSchema, marshalUpdateWorkspaceBindingsRequestSchema, marshalWorkspaceBindingInfoSchema, unmarshalGetCatalogWorkspaceBindingsResponseSchema, unmarshalGetWorkspaceBindingsResponseSchema, unmarshalUpdateCatalogWorkspaceBindingsResponseSchema, unmarshalUpdateWorkspaceBindingsResponseSchema, unmarshalWorkspaceBindingInfoSchema };
|
|
87
91
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/v1/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","
|
|
1
|
+
{"version":3,"file":"model.d.ts","names":[],"sources":["../../src/v1/model.ts"],"mappings":";;;;cAMa,WAAA;EAAA;;;;KAKD,WAAA,WACA,WAAA,eAA0B,WAAA;AAAA,UAGrB,kCAAA;;EAEf,WAAA;AAAA;AAAA,UAGe,mCAAA;EATM;EAWrB,UAAA;AAAA;AAAA,UAGe,2BAAA;EAVA;EAYf,aAAA;;EAEA,iBAAA;EAZW;AAGb;;;;;AAKA;EAYE,UAAA;;EAEA,SAAA;AAAA;AAAA,UAGe,4BAAA;EALf;EAOA,QAAA,GAAW,oBAAA;EALF;;AAGX;;EAOE,aAAA;AAAA;AAAA,UAGe,qCAAA;EARJ;EAUX,WAAA;EALa;EAOb,gBAAA;EAJe;EAMf,kBAAA;AAAA;AAAA,UAGe,sCAAA;EAPf;EASA,UAAA;AAAA;AAAA,UAGe,8BAAA;EARG;EAUlB,aAAA;EAPqD;EASrD,iBAAA;EAPA;;AAGF;;;EAUE,GAAA,GAAM,oBAAA;EARN;EAUA,MAAA,GAAS,oBAAA;AAAA;;UAIM,+BAAA;EAJN;EAMT,QAAA,GAAW,oBAAA;AAAA;AAAA,UAGI,oBAAA;EAL+B;EAO9C,WAAA;EALA;EAOA,WAAA,GAAc,WAAA;AAAA;AAAA,cAGH,kDAAA,EAAoD,CAAA,CAAE,OAAA,CAAQ,mCAAA;AAAA,cAW9D,2CAAA,EAA6C,CAAA,CAAE,OAAA,CAAQ,4BAAA;AAAA,cAavD,qDAAA,EAAuD,CAAA,CAAE,OAAA,CAAQ,sCAAA;AAAA,cAWjE,8CAAA,EAAgD,CAAA,CAAE,OAAA,CAAQ,+BAAA;AAAA,cAW1D,mCAAA,EAAqC,CAAA,CAAE,OAAA,CAAQ,oBAAA;AAAA,cAc/C,kDAAA,EAAoD,CAAA,CAAE,OAAA;AAAA,cAYtD,2CAAA,EAA6C,CAAA,CAAE,OAAA;AAAA,cAc/C,iCAAA,EAAmC,CAAA,CAAE,OAAA"}
|
package/dist/v1/model.js
CHANGED
|
@@ -1,93 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/v1/model.ts
|
|
3
4
|
/** Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` enum in `credentials_common.proto`. */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
BINDING_TYPE_READ_ONLY: 'BINDING_TYPE_READ_ONLY',
|
|
5
|
+
const BindingType = {
|
|
6
|
+
BINDING_TYPE_UNSPECIFIED: "BINDING_TYPE_UNSPECIFIED",
|
|
7
|
+
BINDING_TYPE_READ_WRITE: "BINDING_TYPE_READ_WRITE",
|
|
8
|
+
BINDING_TYPE_READ_ONLY: "BINDING_TYPE_READ_ONLY"
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
workspaceId: d.workspace_id,
|
|
58
|
-
bindingType: d.binding_type,
|
|
59
|
-
}));
|
|
60
|
-
export const marshalUpdateCatalogWorkspaceBindingsRequestSchema = z
|
|
61
|
-
.object({
|
|
62
|
-
catalogName: z.string().optional(),
|
|
63
|
-
assignWorkspaces: z.array(z.bigint()).optional(),
|
|
64
|
-
unassignWorkspaces: z.array(z.bigint()).optional(),
|
|
65
|
-
})
|
|
66
|
-
.transform(d => ({
|
|
67
|
-
catalog_name: d.catalogName,
|
|
68
|
-
assign_workspaces: d.assignWorkspaces,
|
|
69
|
-
unassign_workspaces: d.unassignWorkspaces,
|
|
70
|
-
}));
|
|
71
|
-
export const marshalUpdateWorkspaceBindingsRequestSchema = z
|
|
72
|
-
.object({
|
|
73
|
-
securableType: z.string().optional(),
|
|
74
|
-
securableFullName: z.string().optional(),
|
|
75
|
-
add: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(),
|
|
76
|
-
remove: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(),
|
|
77
|
-
})
|
|
78
|
-
.transform(d => ({
|
|
79
|
-
securable_type: d.securableType,
|
|
80
|
-
securable_full_name: d.securableFullName,
|
|
81
|
-
add: d.add,
|
|
82
|
-
remove: d.remove,
|
|
83
|
-
}));
|
|
84
|
-
export const marshalWorkspaceBindingInfoSchema = z
|
|
85
|
-
.object({
|
|
86
|
-
workspaceId: z.bigint().optional(),
|
|
87
|
-
bindingType: z.string().optional(),
|
|
88
|
-
})
|
|
89
|
-
.transform(d => ({
|
|
90
|
-
workspace_id: d.workspaceId,
|
|
91
|
-
binding_type: d.bindingType,
|
|
92
|
-
}));
|
|
10
|
+
const unmarshalGetCatalogWorkspaceBindingsResponseSchema = z.object({ workspaces: z.array(z.union([z.number(), z.bigint()]).transform((v) => BigInt(v))).optional() }).transform((d) => ({ workspaces: d.workspaces }));
|
|
11
|
+
const unmarshalGetWorkspaceBindingsResponseSchema = z.object({
|
|
12
|
+
bindings: z.array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema)).optional(),
|
|
13
|
+
next_page_token: z.string().optional()
|
|
14
|
+
}).transform((d) => ({
|
|
15
|
+
bindings: d.bindings,
|
|
16
|
+
nextPageToken: d.next_page_token
|
|
17
|
+
}));
|
|
18
|
+
const unmarshalUpdateCatalogWorkspaceBindingsResponseSchema = z.object({ workspaces: z.array(z.union([z.number(), z.bigint()]).transform((v) => BigInt(v))).optional() }).transform((d) => ({ workspaces: d.workspaces }));
|
|
19
|
+
const unmarshalUpdateWorkspaceBindingsResponseSchema = z.object({ bindings: z.array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema)).optional() }).transform((d) => ({ bindings: d.bindings }));
|
|
20
|
+
const unmarshalWorkspaceBindingInfoSchema = z.object({
|
|
21
|
+
workspace_id: z.union([z.number(), z.bigint()]).transform((v) => BigInt(v)).optional(),
|
|
22
|
+
binding_type: z.string().optional()
|
|
23
|
+
}).transform((d) => ({
|
|
24
|
+
workspaceId: d.workspace_id,
|
|
25
|
+
bindingType: d.binding_type
|
|
26
|
+
}));
|
|
27
|
+
const marshalUpdateCatalogWorkspaceBindingsRequestSchema = z.object({
|
|
28
|
+
catalogName: z.string().optional(),
|
|
29
|
+
assignWorkspaces: z.array(z.bigint()).optional(),
|
|
30
|
+
unassignWorkspaces: z.array(z.bigint()).optional()
|
|
31
|
+
}).transform((d) => ({
|
|
32
|
+
catalog_name: d.catalogName,
|
|
33
|
+
assign_workspaces: d.assignWorkspaces,
|
|
34
|
+
unassign_workspaces: d.unassignWorkspaces
|
|
35
|
+
}));
|
|
36
|
+
const marshalUpdateWorkspaceBindingsRequestSchema = z.object({
|
|
37
|
+
securableType: z.string().optional(),
|
|
38
|
+
securableFullName: z.string().optional(),
|
|
39
|
+
add: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(),
|
|
40
|
+
remove: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional()
|
|
41
|
+
}).transform((d) => ({
|
|
42
|
+
securable_type: d.securableType,
|
|
43
|
+
securable_full_name: d.securableFullName,
|
|
44
|
+
add: d.add,
|
|
45
|
+
remove: d.remove
|
|
46
|
+
}));
|
|
47
|
+
const marshalWorkspaceBindingInfoSchema = z.object({
|
|
48
|
+
workspaceId: z.bigint().optional(),
|
|
49
|
+
bindingType: z.string().optional()
|
|
50
|
+
}).transform((d) => ({
|
|
51
|
+
workspace_id: d.workspaceId,
|
|
52
|
+
binding_type: d.bindingType
|
|
53
|
+
}));
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { BindingType, marshalUpdateCatalogWorkspaceBindingsRequestSchema, marshalUpdateWorkspaceBindingsRequestSchema, marshalWorkspaceBindingInfoSchema, unmarshalGetCatalogWorkspaceBindingsResponseSchema, unmarshalGetWorkspaceBindingsResponseSchema, unmarshalUpdateCatalogWorkspaceBindingsResponseSchema, unmarshalUpdateWorkspaceBindingsResponseSchema, unmarshalWorkspaceBindingInfoSchema };
|
|
93
57
|
//# sourceMappingURL=model.js.map
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {z} from 'zod';\n\n/** Using `BINDING_TYPE_` prefix here to avoid conflict with `TableOperation` enum in `credentials_common.proto`. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const BindingType = {\n BINDING_TYPE_UNSPECIFIED: 'BINDING_TYPE_UNSPECIFIED',\n BINDING_TYPE_READ_WRITE: 'BINDING_TYPE_READ_WRITE',\n BINDING_TYPE_READ_ONLY: 'BINDING_TYPE_READ_ONLY',\n} as const;\nexport type BindingType =\n | (typeof BindingType)[keyof typeof BindingType]\n | (string & {});\n\nexport interface GetCatalogWorkspaceBindingsRequest {\n /** The name of the catalog. */\n catalogName?: string | undefined;\n}\n\nexport interface GetCatalogWorkspaceBindingsResponse {\n /** A list of workspace IDs */\n workspaces?: bigint[] | undefined;\n}\n\nexport interface GetWorkspaceBindingsRequest {\n /** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */\n securableType?: string | undefined;\n /** The name of the securable. */\n securableFullName?: string | undefined;\n /**\n * Maximum number of workspace bindings to return.\n * - When set to 0, the page length is set to a server configured value (recommended);\n * - When set to a value greater than 0, the page length is the minimum of this value and a server configured value;\n * - When set to a value less than 0, an invalid parameter error is returned;\n * - If not set, all the workspace bindings are returned (not recommended).\n */\n maxResults?: number | undefined;\n /** Opaque pagination token to go to next page based on previous query. */\n pageToken?: string | undefined;\n}\n\nexport interface GetWorkspaceBindingsResponse {\n /** List of workspace bindings */\n bindings?: WorkspaceBindingInfo[] | undefined;\n /**\n * Opaque token to retrieve the next page of results. Absent if there are no more pages.\n * __page_token__ should be set to this value for the next request (for the next page of results).\n */\n nextPageToken?: string | undefined;\n}\n\nexport interface UpdateCatalogWorkspaceBindingsRequest {\n /** The name of the catalog. */\n catalogName?: string | undefined;\n /** A list of workspace IDs. */\n assignWorkspaces?: bigint[] | undefined;\n /** A list of workspace IDs. */\n unassignWorkspaces?: bigint[] | undefined;\n}\n\nexport interface UpdateCatalogWorkspaceBindingsResponse {\n /** A list of workspace IDs */\n workspaces?: bigint[] | undefined;\n}\n\nexport interface UpdateWorkspaceBindingsRequest {\n /** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */\n securableType?: string | undefined;\n /** The name of the securable. */\n securableFullName?: string | undefined;\n /**\n * List of workspace bindings to add. If a binding for the workspace already exists with a\n * different binding_type, adding it again with a new binding_type will update the existing\n * binding (e.g., from READ_WRITE to READ_ONLY).\n */\n add?: WorkspaceBindingInfo[] | undefined;\n /** List of workspace bindings to remove. */\n remove?: WorkspaceBindingInfo[] | undefined;\n}\n\n/** A list of workspace IDs that are bound to the securable */\nexport interface UpdateWorkspaceBindingsResponse {\n /** List of workspace bindings. */\n bindings?: WorkspaceBindingInfo[] | undefined;\n}\n\nexport interface WorkspaceBindingInfo {\n /** Required */\n workspaceId?: bigint | undefined;\n /** One of READ_WRITE/READ_ONLY. Default is READ_WRITE. */\n bindingType?: BindingType | undefined;\n}\n\nexport const unmarshalGetCatalogWorkspaceBindingsResponseSchema: z.ZodType<GetCatalogWorkspaceBindingsResponse> =\n z\n .object({\n workspaces: z\n .array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))\n .optional(),\n })\n .transform(d => ({\n workspaces: d.workspaces,\n }));\n\nexport const unmarshalGetWorkspaceBindingsResponseSchema: z.ZodType<GetWorkspaceBindingsResponse> =\n z\n .object({\n bindings: z\n .array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n bindings: d.bindings,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalUpdateCatalogWorkspaceBindingsResponseSchema: z.ZodType<UpdateCatalogWorkspaceBindingsResponse> =\n z\n .object({\n workspaces: z\n .array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))\n .optional(),\n })\n .transform(d => ({\n workspaces: d.workspaces,\n }));\n\nexport const unmarshalUpdateWorkspaceBindingsResponseSchema: z.ZodType<UpdateWorkspaceBindingsResponse> =\n z\n .object({\n bindings: z\n .array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema))\n .optional(),\n })\n .transform(d => ({\n bindings: d.bindings,\n }));\n\nexport const unmarshalWorkspaceBindingInfoSchema: z.ZodType<WorkspaceBindingInfo> =\n z\n .object({\n workspace_id: z\n .union([z.number(), z.bigint()])\n .transform(v => BigInt(v))\n .optional(),\n binding_type: z.string().optional(),\n })\n .transform(d => ({\n workspaceId: d.workspace_id,\n bindingType: d.binding_type,\n }));\n\nexport const marshalUpdateCatalogWorkspaceBindingsRequestSchema: z.ZodType = z\n .object({\n catalogName: z.string().optional(),\n assignWorkspaces: z.array(z.bigint()).optional(),\n unassignWorkspaces: z.array(z.bigint()).optional(),\n })\n .transform(d => ({\n catalog_name: d.catalogName,\n assign_workspaces: d.assignWorkspaces,\n unassign_workspaces: d.unassignWorkspaces,\n }));\n\nexport const marshalUpdateWorkspaceBindingsRequestSchema: z.ZodType = z\n .object({\n securableType: z.string().optional(),\n securableFullName: z.string().optional(),\n add: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(),\n remove: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(),\n })\n .transform(d => ({\n securable_type: d.securableType,\n securable_full_name: d.securableFullName,\n add: d.add,\n remove: d.remove,\n }));\n\nexport const marshalWorkspaceBindingInfoSchema: z.ZodType = z\n .object({\n workspaceId: z.bigint().optional(),\n bindingType: z.string().optional(),\n })\n .transform(d => ({\n workspace_id: d.workspaceId,\n binding_type: d.bindingType,\n }));\n"],"mappings":";;;;AAMA,MAAa,cAAc;CACzB,0BAA0B;CAC1B,yBAAyB;CACzB,wBAAwB;CACzB;AAoFD,MAAa,qDACX,EACG,OAAO,EACN,YAAY,EACT,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAU,MAAK,OAAO,EAAE,CAAC,CAAC,CAClE,UAAU,EACd,CAAC,CACD,WAAU,OAAM,EACf,YAAY,EAAE,YACf,EAAE;AAEP,MAAa,8CACX,EACG,OAAO;CACN,UAAU,EACP,MAAM,EAAE,WAAW,oCAAoC,CAAC,CACxD,UAAU;CACb,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACvC,CAAC,CACD,WAAU,OAAM;CACf,UAAU,EAAE;CACZ,eAAe,EAAE;CAClB,EAAE;AAEP,MAAa,wDACX,EACG,OAAO,EACN,YAAY,EACT,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAU,MAAK,OAAO,EAAE,CAAC,CAAC,CAClE,UAAU,EACd,CAAC,CACD,WAAU,OAAM,EACf,YAAY,EAAE,YACf,EAAE;AAEP,MAAa,iDACX,EACG,OAAO,EACN,UAAU,EACP,MAAM,EAAE,WAAW,oCAAoC,CAAC,CACxD,UAAU,EACd,CAAC,CACD,WAAU,OAAM,EACf,UAAU,EAAE,UACb,EAAE;AAEP,MAAa,sCACX,EACG,OAAO;CACN,cAAc,EACX,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,CAC/B,WAAU,MAAK,OAAO,EAAE,CAAC,CACzB,UAAU;CACb,cAAc,EAAE,QAAQ,CAAC,UAAU;CACpC,CAAC,CACD,WAAU,OAAM;CACf,aAAa,EAAE;CACf,aAAa,EAAE;CAChB,EAAE;AAEP,MAAa,qDAAgE,EAC1E,OAAO;CACN,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,kBAAkB,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CAChD,oBAAoB,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACnD,CAAC,CACD,WAAU,OAAM;CACf,cAAc,EAAE;CAChB,mBAAmB,EAAE;CACrB,qBAAqB,EAAE;CACxB,EAAE;AAEL,MAAa,8CAAyD,EACnE,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,mBAAmB,EAAE,QAAQ,CAAC,UAAU;CACxC,KAAK,EAAE,MAAM,EAAE,WAAW,kCAAkC,CAAC,CAAC,UAAU;CACxE,QAAQ,EAAE,MAAM,EAAE,WAAW,kCAAkC,CAAC,CAAC,UAAU;CAC5E,CAAC,CACD,WAAU,OAAM;CACf,gBAAgB,EAAE;CAClB,qBAAqB,EAAE;CACvB,KAAK,EAAE;CACP,QAAQ,EAAE;CACX,EAAE;AAEL,MAAa,oCAA+C,EACzD,OAAO;CACN,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,aAAa,EAAE,QAAQ,CAAC,UAAU;CACnC,CAAC,CACD,WAAU,OAAM;CACf,cAAc,EAAE;CAChB,cAAc,EAAE;CACjB,EAAE"}
|
package/dist/v1/transport.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { HttpClient } from "@databricks/sdk-core/http";
|
|
2
|
+
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
3
|
+
|
|
4
|
+
//#region src/v1/transport.d.ts
|
|
3
5
|
/**
|
|
4
6
|
* The configuration a client needs to issue requests, resolved from
|
|
5
7
|
* {@link ClientOptions} and a configuration profile.
|
|
6
8
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
interface ResolvedClientConfig {
|
|
10
|
+
/** Host with any trailing slash removed. */
|
|
11
|
+
host: string;
|
|
12
|
+
/**
|
|
13
|
+
* Default account ID for account-level paths that contain an account_id
|
|
14
|
+
* segment. A request's own accountId still wins.
|
|
15
|
+
*/
|
|
16
|
+
accountId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
19
|
+
*/
|
|
20
|
+
workspaceId?: string;
|
|
21
|
+
/** HTTP client with authentication, and any configured timeout, applied. */
|
|
22
|
+
httpClient: HttpClient;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
@@ -29,5 +31,7 @@ export interface ResolvedClientConfig {
|
|
|
29
31
|
*
|
|
30
32
|
* @throws if host is neither provided nor present in the resolved profile.
|
|
31
33
|
*/
|
|
32
|
-
|
|
34
|
+
declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ResolvedClientConfig, resolveClientConfig };
|
|
33
37
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","
|
|
1
|
+
{"version":3,"file":"transport.d.ts","names":[],"sources":["../../src/v1/transport.ts"],"mappings":";;;;;;AAkBA;;UAAiB,oBAAA;EAgBO;EAdtB,IAAA;EAMA;;;;EAAA,SAAA;EAQsB;AAaxB;;EAhBE,WAAA;EAiBS;EAdT,UAAA,EAAY,UAAA;AAAA;;;;;;;;;;;iBAaQ,mBAAA,CACpB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,oBAAA"}
|
package/dist/v1/transport.js
CHANGED
|
@@ -1,74 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defaultCredentials } from "@databricks/sdk-auth/credentials";
|
|
2
|
+
import { newFetchHttpClient } from "@databricks/sdk-core/http";
|
|
3
|
+
import { resolve } from "@databricks/sdk-core/profiles";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/transport.ts
|
|
5
6
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
30
|
-
}
|
|
31
|
-
const accountId = options.accountId ?? profile.accountId;
|
|
32
|
-
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
33
|
-
return {
|
|
34
|
-
host: host.replace(/\/$/, ''),
|
|
35
|
-
httpClient,
|
|
36
|
-
...(accountId !== undefined && { accountId }),
|
|
37
|
-
...(workspaceId !== undefined && { workspaceId }),
|
|
38
|
-
};
|
|
7
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
8
|
+
*
|
|
9
|
+
* A configuration profile is always resolved from the config file and
|
|
10
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
11
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
12
|
+
* explicitly. Explicit options always take precedence.
|
|
13
|
+
*
|
|
14
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
15
|
+
*/
|
|
16
|
+
async function resolveClientConfig(options) {
|
|
17
|
+
const profile = await resolve(options.profileOptions);
|
|
18
|
+
const host = options.host ?? profile.host;
|
|
19
|
+
if (host === void 0) throw new Error("Host is required.");
|
|
20
|
+
let httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile }));
|
|
21
|
+
if (options.timeout !== void 0) httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
22
|
+
const accountId = options.accountId ?? profile.accountId;
|
|
23
|
+
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
24
|
+
return {
|
|
25
|
+
host: host.replace(/\/$/, ""),
|
|
26
|
+
httpClient,
|
|
27
|
+
...accountId !== void 0 && { accountId },
|
|
28
|
+
...workspaceId !== void 0 && { workspaceId }
|
|
29
|
+
};
|
|
39
30
|
}
|
|
40
31
|
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
}
|
|
32
|
+
var AuthHttpClient = class {
|
|
33
|
+
constructor(base, credentials) {
|
|
34
|
+
this.base = base;
|
|
35
|
+
this.credentials = credentials;
|
|
36
|
+
}
|
|
37
|
+
async send(request) {
|
|
38
|
+
const authHeaders = await this.credentials.authHeaders();
|
|
39
|
+
const headers = new Headers(request.headers);
|
|
40
|
+
for (const h of authHeaders) headers.set(h.key, h.value);
|
|
41
|
+
return this.base.send({
|
|
42
|
+
...request,
|
|
43
|
+
headers
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
58
47
|
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
var TimeoutHttpClient = class {
|
|
49
|
+
constructor(base, timeout) {
|
|
50
|
+
this.base = base;
|
|
51
|
+
this.timeout = timeout;
|
|
52
|
+
}
|
|
53
|
+
async send(request) {
|
|
54
|
+
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
55
|
+
const signal = request.signal !== void 0 ? AbortSignal.any([request.signal, timeoutSignal]) : timeoutSignal;
|
|
56
|
+
return this.base.send({
|
|
57
|
+
...request,
|
|
58
|
+
signal
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { resolveClientConfig };
|
|
74
65
|
//# sourceMappingURL=transport.js.map
|
package/dist/v1/transport.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","
|
|
1
|
+
{"version":3,"file":"transport.js","names":[],"sources":["../../src/v1/transport.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Credentials} from '@databricks/sdk-auth';\nimport {defaultCredentials} from '@databricks/sdk-auth/credentials';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport {newFetchHttpClient} from '@databricks/sdk-core/http';\nimport type {Profile} from '@databricks/sdk-core/profiles';\nimport {resolve} from '@databricks/sdk-core/profiles';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\n\n/**\n * The configuration a client needs to issue requests, resolved from\n * {@link ClientOptions} and a configuration profile.\n */\nexport interface ResolvedClientConfig {\n /** Host with any trailing slash removed. */\n host: string;\n\n /**\n * Default account ID for account-level paths that contain an account_id\n * segment. A request's own accountId still wins.\n */\n accountId?: string;\n\n /**\n * Workspace ID used to route workspace-level calls on unified hosts (SPOG).\n */\n workspaceId?: string;\n\n /** HTTP client with authentication, and any configured timeout, applied. */\n httpClient: HttpClient;\n}\n\n/**\n * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.\n *\n * A configuration profile is always resolved from the config file and\n * environment variables (per options.profileOptions); it supplies host,\n * accountId, workspaceId, and credentials wherever the caller did not set them\n * explicitly. Explicit options always take precedence.\n *\n * @throws if host is neither provided nor present in the resolved profile.\n */\nexport async function resolveClientConfig(\n options: ClientOptions\n): Promise<ResolvedClientConfig> {\n const profile: Profile = await resolve(options.profileOptions);\n\n const host = options.host ?? profile.host;\n if (host === undefined) {\n throw new Error('Host is required.');\n }\n\n // The provided httpClient (or the default fetch client) is the base wire;\n // authentication and the optional timeout are layered on top of it. The\n // default credential chain reuses the profile resolved above so that the\n // same profileOptions govern host and authentication alike.\n const base = options.httpClient ?? newFetchHttpClient();\n const credentials = options.credentials ?? defaultCredentials({profile});\n let httpClient: HttpClient = new AuthHttpClient(base, credentials);\n if (options.timeout !== undefined) {\n httpClient = new TimeoutHttpClient(httpClient, options.timeout);\n }\n\n const accountId = options.accountId ?? profile.accountId;\n const workspaceId = options.workspaceId ?? profile.workspaceId;\n\n return {\n host: host.replace(/\\/$/, ''),\n httpClient,\n ...(accountId !== undefined && {accountId}),\n ...(workspaceId !== undefined && {workspaceId}),\n };\n}\n\n/** Wraps an HttpClient and adds authentication headers to requests. */\nclass AuthHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly credentials: Credentials\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const authHeaders = await this.credentials.authHeaders();\n // Do not modify the original request.\n const headers = new Headers(request.headers);\n for (const h of authHeaders) {\n headers.set(h.key, h.value);\n }\n return this.base.send({...request, headers});\n }\n}\n\n/** Wraps an HttpClient and applies a default timeout to requests. */\nclass TimeoutHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly timeout: number\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const timeoutSignal = AbortSignal.timeout(this.timeout);\n const signal =\n request.signal !== undefined\n ? AbortSignal.any([request.signal, timeoutSignal])\n : timeoutSignal;\n return this.base.send({...request, signal});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,eAAsB,oBACpB,SAC+B;CAC/B,MAAM,UAAmB,MAAM,QAAQ,QAAQ,eAAe;CAE9D,MAAM,OAAO,QAAQ,QAAQ,QAAQ;AACrC,KAAI,SAAS,OACX,OAAM,IAAI,MAAM,oBAAoB;CAStC,IAAI,aAAyB,IAAI,eAFpB,QAAQ,cAAc,oBAAoB,EACnC,QAAQ,eAAe,mBAAmB,EAAC,SAAQ,CAAC,CACN;AAClE,KAAI,QAAQ,YAAY,OACtB,cAAa,IAAI,kBAAkB,YAAY,QAAQ,QAAQ;CAGjE,MAAM,YAAY,QAAQ,aAAa,QAAQ;CAC/C,MAAM,cAAc,QAAQ,eAAe,QAAQ;AAEnD,QAAO;EACL,MAAM,KAAK,QAAQ,OAAO,GAAG;EAC7B;EACA,GAAI,cAAc,UAAa,EAAC,WAAU;EAC1C,GAAI,gBAAgB,UAAa,EAAC,aAAY;EAC/C;;;AAIH,IAAM,iBAAN,MAA2C;CACzC,YACE,AAAiB,MACjB,AAAiB,aACjB;EAFiB;EACA;;CAGnB,MAAM,KAAK,SAA6C;EACtD,MAAM,cAAc,MAAM,KAAK,YAAY,aAAa;EAExD,MAAM,UAAU,IAAI,QAAQ,QAAQ,QAAQ;AAC5C,OAAK,MAAM,KAAK,YACd,SAAQ,IAAI,EAAE,KAAK,EAAE,MAAM;AAE7B,SAAO,KAAK,KAAK,KAAK;GAAC,GAAG;GAAS;GAAQ,CAAC;;;;AAKhD,IAAM,oBAAN,MAA8C;CAC5C,YACE,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;;CAGnB,MAAM,KAAK,SAA6C;EACtD,MAAM,gBAAgB,YAAY,QAAQ,KAAK,QAAQ;EACvD,MAAM,SACJ,QAAQ,WAAW,SACf,YAAY,IAAI,CAAC,QAAQ,QAAQ,cAAc,CAAC,GAChD;AACN,SAAO,KAAK,KAAK,KAAK;GAAC,GAAG;GAAS;GAAO,CAAC"}
|