@databricks/sdk-uc-workspacebindings 0.27.0 → 0.35.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.
@@ -1,87 +1,91 @@
1
- import { z } from 'zod';
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
- export declare const BindingType: {
4
- readonly BINDING_TYPE_UNSPECIFIED: "";
5
- readonly BINDING_TYPE_READ_WRITE: "BINDING_TYPE_READ_WRITE";
6
- readonly BINDING_TYPE_READ_ONLY: "BINDING_TYPE_READ_ONLY";
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
- export type BindingType = (typeof BindingType)[keyof typeof BindingType] | (string & {});
9
- export interface GetCatalogWorkspaceBindingsRequest {
10
- /** The name of the catalog. */
11
- catalogName?: string | undefined;
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
- export interface GetCatalogWorkspaceBindingsResponse {
14
- /** A list of workspace IDs */
15
- workspaces?: bigint[] | undefined;
15
+ interface GetCatalogWorkspaceBindingsResponse {
16
+ /** A list of workspace IDs */
17
+ workspaces?: bigint[] | undefined;
16
18
  }
17
- export interface GetWorkspaceBindingsRequest {
18
- /** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */
19
- securableType?: string | undefined;
20
- /** The name of the securable. */
21
- securableFullName?: string | undefined;
22
- /**
23
- * Maximum number of workspace bindings to return.
24
- * - When set to 0, the page length is set to a server configured value (recommended);
25
- * - When set to a value greater than 0, the page length is the minimum of this value and a server configured value;
26
- * - When set to a value less than 0, an invalid parameter error is returned;
27
- * - If not set, all the workspace bindings are returned (not recommended).
28
- */
29
- maxResults?: number | undefined;
30
- /** Opaque pagination token to go to next page based on previous query. */
31
- pageToken?: string | undefined;
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
- export interface GetWorkspaceBindingsResponse {
34
- /** List of workspace bindings */
35
- bindings?: WorkspaceBindingInfo[] | undefined;
36
- /**
37
- * Opaque token to retrieve the next page of results. Absent if there are no more pages.
38
- * __page_token__ should be set to this value for the next request (for the next page of results).
39
- */
40
- nextPageToken?: string | undefined;
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
- export interface UpdateCatalogWorkspaceBindingsRequest {
43
- /** The name of the catalog. */
44
- catalogName?: string | undefined;
45
- /** A list of workspace IDs. */
46
- assignWorkspaces?: bigint[] | undefined;
47
- /** A list of workspace IDs. */
48
- unassignWorkspaces?: bigint[] | undefined;
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
- export interface UpdateCatalogWorkspaceBindingsResponse {
51
- /** A list of workspace IDs */
52
- workspaces?: bigint[] | undefined;
52
+ interface UpdateCatalogWorkspaceBindingsResponse {
53
+ /** A list of workspace IDs */
54
+ workspaces?: bigint[] | undefined;
53
55
  }
54
- export interface UpdateWorkspaceBindingsRequest {
55
- /** The type of the securable to bind to a workspace (catalog, storage_credential, credential, or external_location). */
56
- securableType?: string | undefined;
57
- /** The name of the securable. */
58
- securableFullName?: string | undefined;
59
- /**
60
- * List of workspace bindings to add. If a binding for the workspace already exists with a
61
- * different binding_type, adding it again with a new binding_type will update the existing
62
- * binding (e.g., from READ_WRITE to READ_ONLY).
63
- */
64
- add?: WorkspaceBindingInfo[] | undefined;
65
- /** List of workspace bindings to remove. */
66
- remove?: WorkspaceBindingInfo[] | undefined;
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
- export interface UpdateWorkspaceBindingsResponse {
70
- /** List of workspace bindings. */
71
- bindings?: WorkspaceBindingInfo[] | undefined;
71
+ interface UpdateWorkspaceBindingsResponse {
72
+ /** List of workspace bindings. */
73
+ bindings?: WorkspaceBindingInfo[] | undefined;
72
74
  }
73
- export interface WorkspaceBindingInfo {
74
- /** Required */
75
- workspaceId?: bigint | undefined;
76
- /** One of READ_WRITE/READ_ONLY. Default is READ_WRITE. */
77
- bindingType?: BindingType | undefined;
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
- export declare const unmarshalGetCatalogWorkspaceBindingsResponseSchema: z.ZodType<GetCatalogWorkspaceBindingsResponse>;
80
- export declare const unmarshalGetWorkspaceBindingsResponseSchema: z.ZodType<GetWorkspaceBindingsResponse>;
81
- export declare const unmarshalUpdateCatalogWorkspaceBindingsResponseSchema: z.ZodType<UpdateCatalogWorkspaceBindingsResponse>;
82
- export declare const unmarshalUpdateWorkspaceBindingsResponseSchema: z.ZodType<UpdateWorkspaceBindingsResponse>;
83
- export declare const unmarshalWorkspaceBindingInfoSchema: z.ZodType<WorkspaceBindingInfo>;
84
- export declare const marshalUpdateCatalogWorkspaceBindingsRequestSchema: z.ZodType;
85
- export declare const marshalUpdateWorkspaceBindingsRequestSchema: z.ZodType;
86
- export declare const marshalWorkspaceBindingInfoSchema: z.ZodType;
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
@@ -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,oHAAoH;AAEpH,eAAO,MAAM,WAAW;;;;CAId,CAAC;AACX,MAAM,MAAM,WAAW,GACnB,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,GAC9C,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,WAAW,kCAAkC;IACjD,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,mCAAmC;IAClD,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,2BAA2B;IAC1C,wHAAwH;IACxH,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAA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AA,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
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { z } from 'zod';
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
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
5
- export const BindingType = {
6
- BINDING_TYPE_UNSPECIFIED: '',
7
- BINDING_TYPE_READ_WRITE: 'BINDING_TYPE_READ_WRITE',
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
- export const unmarshalGetCatalogWorkspaceBindingsResponseSchema = z
11
- .object({
12
- workspaces: z
13
- .array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))
14
- .optional(),
15
- })
16
- .transform(d => ({
17
- workspaces: d.workspaces,
18
- }));
19
- export const unmarshalGetWorkspaceBindingsResponseSchema = z
20
- .object({
21
- bindings: z
22
- .array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema))
23
- .optional(),
24
- next_page_token: z.string().optional(),
25
- })
26
- .transform(d => ({
27
- bindings: d.bindings,
28
- nextPageToken: d.next_page_token,
29
- }));
30
- export const unmarshalUpdateCatalogWorkspaceBindingsResponseSchema = z
31
- .object({
32
- workspaces: z
33
- .array(z.union([z.number(), z.bigint()]).transform(v => BigInt(v)))
34
- .optional(),
35
- })
36
- .transform(d => ({
37
- workspaces: d.workspaces,
38
- }));
39
- export const unmarshalUpdateWorkspaceBindingsResponseSchema = z
40
- .object({
41
- bindings: z
42
- .array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema))
43
- .optional(),
44
- })
45
- .transform(d => ({
46
- bindings: d.bindings,
47
- }));
48
- export const unmarshalWorkspaceBindingInfoSchema = z
49
- .object({
50
- workspace_id: z
51
- .union([z.number(), z.bigint()])
52
- .transform(v => BigInt(v))
53
- .optional(),
54
- binding_type: z.string().optional(),
55
- })
56
- .transform(d => ({
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
@@ -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,oHAAoH;AACpH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,wBAAwB,EAAE,EAAE;IAC5B,uBAAuB,EAAE,yBAAyB;IAClD,sBAAsB,EAAE,wBAAwB;CACxC,CAAC;AAoFX,MAAM,CAAC,MAAM,kDAAkD,GAC7D,CAAC;KACE,MAAM,CAAC;IACN,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SAClE,QAAQ,EAAE;CACd,CAAC;KACD,SAAS,CAAC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AAC,iCAAiC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,iCAAiC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC5E,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,cAAc,EAAE,CAAC,CAAC,aAAa;IAC/B,mBAAmB,EAAE,CAAC,CAAC,iBAAiB;IACxC,GAAG,EAAE,CAAC,CAAC,GAAG;IACV,MAAM,EAAE,CAAC,CAAC,MAAM;CACjB,CAAC,CAAC,CAAC;AAEN,MAAM,CAAC,MAAM,iCAAiC,GAAc,CAAC;KAC1D,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,YAAY,EAAE,CAAC,CAAC,WAAW;IAC3B,YAAY,EAAE,CAAC,CAAC,WAAW;CAC5B,CAAC,CAAC,CAAC"}
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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;CAChB,cAAc,EAAE;CACjB,EAAE"}
@@ -1,23 +1,25 @@
1
- import type { HttpClient } from '@databricks/sdk-core/http';
2
- import type { ClientOptions } from '@databricks/sdk-options/client';
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
- export interface ResolvedClientConfig {
8
- /** Host with any trailing slash removed. */
9
- host: string;
10
- /**
11
- * Default account ID for account-level paths that contain an account_id
12
- * segment. A request's own accountId still wins.
13
- */
14
- accountId?: string;
15
- /**
16
- * Workspace ID used to route workspace-level calls on unified hosts (SPOG).
17
- */
18
- workspaceId?: string;
19
- /** HTTP client with authentication, and any configured timeout, applied. */
20
- httpClient: HttpClient;
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
- export declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
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","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4EAA4E;IAC5E,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,oBAAoB,CAAC,CA4B/B"}
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"}
@@ -1,74 +1,65 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { defaultCredentials } from '@databricks/sdk-auth/credentials';
3
- import { newFetchHttpClient } from '@databricks/sdk-core/http';
4
- import { resolve } from '@databricks/sdk-core/profiles';
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
- * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
7
- *
8
- * A configuration profile is always resolved from the config file and
9
- * environment variables (per options.profileOptions); it supplies host,
10
- * accountId, workspaceId, and credentials wherever the caller did not set them
11
- * explicitly. Explicit options always take precedence.
12
- *
13
- * @throws if host is neither provided nor present in the resolved profile.
14
- */
15
- export async function resolveClientConfig(options) {
16
- const profile = await resolve(options.profileOptions);
17
- const host = options.host ?? profile.host;
18
- if (host === undefined) {
19
- throw new Error('Host is required.');
20
- }
21
- // The provided httpClient (or the default fetch client) is the base wire;
22
- // authentication and the optional timeout are layered on top of it. The
23
- // default credential chain reuses the profile resolved above so that the
24
- // same profileOptions govern host and authentication alike.
25
- const base = options.httpClient ?? newFetchHttpClient();
26
- const credentials = options.credentials ?? defaultCredentials({ profile });
27
- let httpClient = new AuthHttpClient(base, credentials);
28
- if (options.timeout !== undefined) {
29
- httpClient = new TimeoutHttpClient(httpClient, options.timeout);
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
- class AuthHttpClient {
42
- base;
43
- credentials;
44
- constructor(base, credentials) {
45
- this.base = base;
46
- this.credentials = credentials;
47
- }
48
- async send(request) {
49
- const authHeaders = await this.credentials.authHeaders();
50
- // Do not modify the original request.
51
- const headers = new Headers(request.headers);
52
- for (const h of authHeaders) {
53
- headers.set(h.key, h.value);
54
- }
55
- return this.base.send({ ...request, headers });
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
- class TimeoutHttpClient {
60
- base;
61
- timeout;
62
- constructor(base, timeout) {
63
- this.base = base;
64
- this.timeout = timeout;
65
- }
66
- async send(request) {
67
- const timeoutSignal = AbortSignal.timeout(this.timeout);
68
- const signal = request.signal !== undefined
69
- ? AbortSignal.any([request.signal, timeoutSignal])
70
- : timeoutSignal;
71
- return this.base.send({ ...request, signal });
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
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,kBAAkB,EAAC,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,"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,WA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