@databricks/sdk-tagpolicies 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.
@@ -1,50 +1,54 @@
1
- import { Temporal } from '@js-temporal/polyfill';
2
- import { FieldMask } from '@databricks/sdk-core/wkt';
3
- import { z } from 'zod';
4
- export interface CreateTagPolicyRequest {
5
- tagPolicy?: TagPolicy | undefined;
6
- }
7
- export interface DeleteTagPolicyRequest {
8
- tagKey?: string | undefined;
9
- }
10
- export interface GetTagPolicyRequest {
11
- tagKey?: string | undefined;
12
- }
13
- export interface ListTagPoliciesRequest {
14
- /**
15
- * The maximum number of results to return in this request. Fewer results may be returned than requested. If
16
- * unspecified or set to 0, this defaults to 1000. The maximum value is 1000; values above 1000 will be coerced down
17
- * to 1000.
18
- */
19
- pageSize?: number | undefined;
20
- /** An optional page token received from a previous list tag policies call. */
21
- pageToken?: string | undefined;
22
- }
23
- export interface ListTagPoliciesResponse {
24
- tagPolicies?: TagPolicy[] | undefined;
25
- nextPageToken?: string | undefined;
26
- }
27
- export interface TagPolicy {
28
- tagKey?: string | undefined;
29
- id?: string | undefined;
30
- description?: string | undefined;
31
- values?: Value[] | undefined;
32
- /** Timestamp when the tag policy was created */
33
- createTime?: Temporal.Instant | undefined;
34
- /** Timestamp when the tag policy was last updated */
35
- updateTime?: Temporal.Instant | undefined;
36
- }
37
- export interface UpdateTagPolicyRequest {
38
- tagPolicy?: TagPolicy | undefined;
39
- updateMask?: FieldMask<TagPolicy> | undefined;
40
- }
41
- export interface Value {
42
- name?: string | undefined;
43
- }
44
- export declare const unmarshalListTagPoliciesResponseSchema: z.ZodType<ListTagPoliciesResponse>;
45
- export declare const unmarshalTagPolicySchema: z.ZodType<TagPolicy>;
46
- export declare const unmarshalValueSchema: z.ZodType<Value>;
47
- export declare const marshalTagPolicySchema: z.ZodType;
48
- export declare const marshalValueSchema: z.ZodType;
49
- export declare function tagPolicyFieldMask(...paths: string[]): FieldMask<TagPolicy>;
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { FieldMask } from "@databricks/sdk-core/wkt";
3
+ import { z } from "zod";
4
+
5
+ //#region src/v1/model.d.ts
6
+ interface CreateTagPolicyRequest {
7
+ tagPolicy?: TagPolicy | undefined;
8
+ }
9
+ interface DeleteTagPolicyRequest {
10
+ tagKey?: string | undefined;
11
+ }
12
+ interface GetTagPolicyRequest {
13
+ tagKey?: string | undefined;
14
+ }
15
+ interface ListTagPoliciesRequest {
16
+ /**
17
+ * The maximum number of results to return in this request. Fewer results may be returned than requested. If
18
+ * unspecified or set to 0, this defaults to 1000. The maximum value is 1000; values above 1000 will be coerced down
19
+ * to 1000.
20
+ */
21
+ pageSize?: number | undefined;
22
+ /** An optional page token received from a previous list tag policies call. */
23
+ pageToken?: string | undefined;
24
+ }
25
+ interface ListTagPoliciesResponse {
26
+ tagPolicies?: TagPolicy[] | undefined;
27
+ nextPageToken?: string | undefined;
28
+ }
29
+ interface TagPolicy {
30
+ tagKey?: string | undefined;
31
+ id?: string | undefined;
32
+ description?: string | undefined;
33
+ values?: Value[] | undefined;
34
+ /** Timestamp when the tag policy was created */
35
+ createTime?: Temporal.Instant | undefined;
36
+ /** Timestamp when the tag policy was last updated */
37
+ updateTime?: Temporal.Instant | undefined;
38
+ }
39
+ interface UpdateTagPolicyRequest {
40
+ tagPolicy?: TagPolicy | undefined;
41
+ updateMask?: FieldMask<TagPolicy> | undefined;
42
+ }
43
+ interface Value {
44
+ name?: string | undefined;
45
+ }
46
+ declare const unmarshalListTagPoliciesResponseSchema: z.ZodType<ListTagPoliciesResponse>;
47
+ declare const unmarshalTagPolicySchema: z.ZodType<TagPolicy>;
48
+ declare const unmarshalValueSchema: z.ZodType<Value>;
49
+ declare const marshalTagPolicySchema: z.ZodType;
50
+ declare const marshalValueSchema: z.ZodType;
51
+ declare function tagPolicyFieldMask(...paths: string[]): FieldMask<TagPolicy>;
52
+ //#endregion
53
+ export { CreateTagPolicyRequest, DeleteTagPolicyRequest, GetTagPolicyRequest, ListTagPoliciesRequest, ListTagPoliciesResponse, TagPolicy, UpdateTagPolicyRequest, Value, marshalTagPolicySchema, marshalValueSchema, tagPolicyFieldMask, unmarshalListTagPoliciesResponseSchema, unmarshalTagPolicySchema, unmarshalValueSchema };
50
54
  //# 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,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;IAC7B,gDAAgD;IACh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;EATT;EAWb,UAAA,GAAa,QAAA,CAAS,OAAA;AAAA;AAAA,UAGP,sBAAA;EACf,SAAA,GAAY,SAAA;EACZ,UAAA,GAAa,SAAA,CAAU,SAAA;AAAA;AAAA,UAGR,KAAA;EACf,IAAA;AAAA;AAAA,cAGW,sCAAA,EAAwC,CAAA,CAAE,OAAA,CAAQ,uBAAA;AAAA,cAWlD,wBAAA,EAA0B,CAAA,CAAE,OAAA,CAAQ,SAAA;AAAA,cAwBpC,oBAAA,EAAsB,CAAA,CAAE,OAAA,CAAQ,KAAA;AAAA,cAQhC,sBAAA,EAAwB,CAAA,CAAE,OAAA;AAAA,cAwB1B,kBAAA,EAAoB,CAAA,CAAE,OAAA;AAAA,iBAiBnB,kBAAA,CAAA,GAAsB,KAAA,aAAkB,SAAA,CAAU,SAAA"}
package/dist/v1/model.js CHANGED
@@ -1,85 +1,59 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
- import { Temporal } from '@js-temporal/polyfill';
3
- import { FieldMask } from '@databricks/sdk-core/wkt';
4
- import { z } from 'zod';
5
- export const unmarshalListTagPoliciesResponseSchema = z
6
- .object({
7
- tag_policies: z.array(z.lazy(() => unmarshalTagPolicySchema)).optional(),
8
- next_page_token: z.string().optional(),
9
- })
10
- .transform(d => ({
11
- tagPolicies: d.tag_policies,
12
- nextPageToken: d.next_page_token,
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { FieldMask } from "@databricks/sdk-core/wkt";
3
+ import { z } from "zod";
4
+
5
+ //#region src/v1/model.ts
6
+ const unmarshalListTagPoliciesResponseSchema = z.object({
7
+ tag_policies: z.array(z.lazy(() => unmarshalTagPolicySchema)).optional(),
8
+ next_page_token: z.string().optional()
9
+ }).transform((d) => ({
10
+ tagPolicies: d.tag_policies,
11
+ nextPageToken: d.next_page_token
13
12
  }));
14
- export const unmarshalTagPolicySchema = z
15
- .object({
16
- tag_key: z.string().optional(),
17
- id: z.string().optional(),
18
- description: z.string().optional(),
19
- values: z.array(z.lazy(() => unmarshalValueSchema)).optional(),
20
- create_time: z
21
- .string()
22
- .transform(s => Temporal.Instant.from(s))
23
- .optional(),
24
- update_time: z
25
- .string()
26
- .transform(s => Temporal.Instant.from(s))
27
- .optional(),
28
- })
29
- .transform(d => ({
30
- tagKey: d.tag_key,
31
- id: d.id,
32
- description: d.description,
33
- values: d.values,
34
- createTime: d.create_time,
35
- updateTime: d.update_time,
13
+ const unmarshalTagPolicySchema = z.object({
14
+ tag_key: z.string().optional(),
15
+ id: z.string().optional(),
16
+ description: z.string().optional(),
17
+ values: z.array(z.lazy(() => unmarshalValueSchema)).optional(),
18
+ create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
19
+ update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional()
20
+ }).transform((d) => ({
21
+ tagKey: d.tag_key,
22
+ id: d.id,
23
+ description: d.description,
24
+ values: d.values,
25
+ createTime: d.create_time,
26
+ updateTime: d.update_time
36
27
  }));
37
- export const unmarshalValueSchema = z
38
- .object({
39
- name: z.string().optional(),
40
- })
41
- .transform(d => ({
42
- name: d.name,
43
- }));
44
- export const marshalTagPolicySchema = z
45
- .object({
46
- tagKey: z.string().optional(),
47
- id: z.string().optional(),
48
- description: z.string().optional(),
49
- values: z.array(z.lazy(() => marshalValueSchema)).optional(),
50
- createTime: z
51
- .any()
52
- .transform((d) => d.toString())
53
- .optional(),
54
- updateTime: z
55
- .any()
56
- .transform((d) => d.toString())
57
- .optional(),
58
- })
59
- .transform(d => ({
60
- tag_key: d.tagKey,
61
- id: d.id,
62
- description: d.description,
63
- values: d.values,
64
- create_time: d.createTime,
65
- update_time: d.updateTime,
66
- }));
67
- export const marshalValueSchema = z
68
- .object({
69
- name: z.string().optional(),
70
- })
71
- .transform(d => ({
72
- name: d.name,
28
+ const unmarshalValueSchema = z.object({ name: z.string().optional() }).transform((d) => ({ name: d.name }));
29
+ const marshalTagPolicySchema = z.object({
30
+ tagKey: z.string().optional(),
31
+ id: z.string().optional(),
32
+ description: z.string().optional(),
33
+ values: z.array(z.lazy(() => marshalValueSchema)).optional(),
34
+ createTime: z.any().transform((d) => d.toString()).optional(),
35
+ updateTime: z.any().transform((d) => d.toString()).optional()
36
+ }).transform((d) => ({
37
+ tag_key: d.tagKey,
38
+ id: d.id,
39
+ description: d.description,
40
+ values: d.values,
41
+ create_time: d.createTime,
42
+ update_time: d.updateTime
73
43
  }));
44
+ const marshalValueSchema = z.object({ name: z.string().optional() }).transform((d) => ({ name: d.name }));
74
45
  const tagPolicyFieldMaskSchema = {
75
- createTime: { wire: 'create_time' },
76
- description: { wire: 'description' },
77
- id: { wire: 'id' },
78
- tagKey: { wire: 'tag_key' },
79
- updateTime: { wire: 'update_time' },
80
- values: { wire: 'values' },
46
+ createTime: { wire: "create_time" },
47
+ description: { wire: "description" },
48
+ id: { wire: "id" },
49
+ tagKey: { wire: "tag_key" },
50
+ updateTime: { wire: "update_time" },
51
+ values: { wire: "values" }
81
52
  };
82
- export function tagPolicyFieldMask(...paths) {
83
- return FieldMask.build(paths, tagPolicyFieldMaskSchema);
53
+ function tagPolicyFieldMask(...paths) {
54
+ return FieldMask.build(paths, tagPolicyFieldMaskSchema);
84
55
  }
56
+
57
+ //#endregion
58
+ export { marshalTagPolicySchema, marshalValueSchema, tagPolicyFieldMask, unmarshalListTagPoliciesResponseSchema, unmarshalTagPolicySchema, unmarshalValueSchema };
85
59
  //# 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,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAkDtB,MAAM,CAAC,MAAM,sCAAsC,GACjD,CAAC;KACE,MAAM,CAAC;IACN,YAAY,EAAE,CAAC,CAAC,KA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CAAC,CAAC,CAAC;AAEN,MAAM,CAAC,MAAM,kBAAkB,GAAc,CAAC;KAC3C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,IAAI,EAAE,CAAC,CAAC,IAAI;CACb,CAAC,CAAC,CAAC;AAEN,MAAM,wBAAwB,GAAoB;IAChD,UAAU,EAAE,EAAC,IAAI,EAAE,aAAa,EAAC;IACjC,WAAW,EAAE,EAAC,IAAI,EAAE,aAAa,EAAC;IAClC,EAAE,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC;IAChB,MAAM,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;IACzB,UAAU,EAAE,EAAC,IAAI,EAAE,aAAa,EAAC;IACjC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;CACzB,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,GAAG,KAAe;IACnD,OAAO,SAAS,CAAC,KAAK,CAAY,KAAK,EAAE,wBAAwB,CAAC,CAAC;AACrE,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 {Temporal} from '@js-temporal/polyfill';\nimport {FieldMask} from '@databricks/sdk-core/wkt';\nimport type {FieldMaskSchema} from '@databricks/sdk-core/wkt';\nimport {z} from 'zod';\n\nexport interface CreateTagPolicyRequest {\n tagPolicy?: TagPolicy | undefined;\n}\n\nexport interface DeleteTagPolicyRequest {\n tagKey?: string | undefined;\n}\n\nexport interface GetTagPolicyRequest {\n tagKey?: string | undefined;\n}\n\nexport interface ListTagPoliciesRequest {\n /**\n * The maximum number of results to return in this request. Fewer results may be returned than requested. If\n * unspecified or set to 0, this defaults to 1000. The maximum value is 1000; values above 1000 will be coerced down\n * to 1000.\n */\n pageSize?: number | undefined;\n /** An optional page token received from a previous list tag policies call. */\n pageToken?: string | undefined;\n}\n\nexport interface ListTagPoliciesResponse {\n tagPolicies?: TagPolicy[] | undefined;\n nextPageToken?: string | undefined;\n}\n\nexport interface TagPolicy {\n tagKey?: string | undefined;\n id?: string | undefined;\n description?: string | undefined;\n values?: Value[] | undefined;\n /** Timestamp when the tag policy was created */\n createTime?: Temporal.Instant | undefined;\n /** Timestamp when the tag policy was last updated */\n updateTime?: Temporal.Instant | undefined;\n}\n\nexport interface UpdateTagPolicyRequest {\n tagPolicy?: TagPolicy | undefined;\n updateMask?: FieldMask<TagPolicy> | undefined;\n}\n\nexport interface Value {\n name?: string | undefined;\n}\n\nexport const unmarshalListTagPoliciesResponseSchema: z.ZodType<ListTagPoliciesResponse> =\n z\n .object({\n tag_policies: z.array(z.lazy(() => unmarshalTagPolicySchema)).optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n tagPolicies: d.tag_policies,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalTagPolicySchema: z.ZodType<TagPolicy> = z\n .object({\n tag_key: z.string().optional(),\n id: z.string().optional(),\n description: z.string().optional(),\n values: z.array(z.lazy(() => unmarshalValueSchema)).optional(),\n create_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n update_time: z\n .string()\n .transform(s => Temporal.Instant.from(s))\n .optional(),\n })\n .transform(d => ({\n tagKey: d.tag_key,\n id: d.id,\n description: d.description,\n values: d.values,\n createTime: d.create_time,\n updateTime: d.update_time,\n }));\n\nexport const unmarshalValueSchema: z.ZodType<Value> = z\n .object({\n name: z.string().optional(),\n })\n .transform(d => ({\n name: d.name,\n }));\n\nexport const marshalTagPolicySchema: z.ZodType = z\n .object({\n tagKey: z.string().optional(),\n id: z.string().optional(),\n description: z.string().optional(),\n values: z.array(z.lazy(() => marshalValueSchema)).optional(),\n createTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n updateTime: z\n .any()\n .transform((d: Temporal.Instant) => d.toString())\n .optional(),\n })\n .transform(d => ({\n tag_key: d.tagKey,\n id: d.id,\n description: d.description,\n values: d.values,\n create_time: d.createTime,\n update_time: d.updateTime,\n }));\n\nexport const marshalValueSchema: z.ZodType = z\n .object({\n name: z.string().optional(),\n })\n .transform(d => ({\n name: d.name,\n }));\n\nconst tagPolicyFieldMaskSchema: FieldMaskSchema = {\n createTime: {wire: 'create_time'},\n description: {wire: 'description'},\n id: {wire: 'id'},\n tagKey: {wire: 'tag_key'},\n updateTime: {wire: 'update_time'},\n values: {wire: 'values'},\n};\n\nexport function tagPolicyFieldMask(...paths: string[]): FieldMask<TagPolicy> {\n return FieldMask.build<TagPolicy>(paths, tagPolicyFieldMaskSchema);\n}\n"],"mappings":";;;;;AAuDA,MAAa,yCACX,EACG,OAAO;CACN,cAAc,EAAE,MAAM,EAAE,WAAW,yBAAyB,CAAC,CAAC,UAAU;CACxE,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACvC,CAAC,CACD,WAAU,OAAM;CACf,aAAa,EAAE;CACf,eAAe,EAAE;CAClB,EAAE;AAEP,MAAa,2BAAiD,EAC3D,OAAO;CACN,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,IAAI,EAAE,QAAQ,CAAC,UAAU;CACzB,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,QAAQ,EAAE,MAAM,EAAE,WAAW,qBAAqB,CAAC,CAAC,UAAU;CAC9D,aAAa,EACV,QAAQ,CACR,WAAU,MAAK,SAAS,QAAQ,KAAK,EAAE,CAAC,CACxC,UAAU;CACb,aAAa,EACV,QAAQ,CACR,WAAU,MAAK,SAAS,QAAQ,KAAK,EAAE,CAAC,CACxC,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,QAAQ,EAAE;CACV,IAAI,EAAE;CACN,aAAa,EAAE;CACf,QAAQ,EAAE;CACV,YAAY,EAAE;CACd,YAAY,EAAE;CACf,EAAE;AAEL,MAAa,uBAAyC,EACnD,OAAO,EACN,MAAM,EAAE,QAAQ,CAAC,UAAU,EAC5B,CAAC,CACD,WAAU,OAAM,EACf,MAAM,EAAE,MACT,EAAE;AAEL,MAAa,yBAAoC,EAC9C,OAAO;CACN,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,IAAI,EAAE,QAAQ,CAAC,UAAU;CACzB,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,QAAQ,EAAE,MAAM,EAAE,WAAW,mBAAmB,CAAC,CAAC,UAAU;CAC5D,YAAY,EACT,KAAK,CACL,WAAW,MAAwB,EAAE,UAAU,CAAC,CAChD,UAAU;CACb,YAAY,EACT,KAAK,CACL,WAAW,MAAwB,EAAE,UAAU,CAAC,CAChD,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,SAAS,EAAE;CACX,IAAI,EAAE;CACN,aAAa,EAAE;CACf,QAAQ,EAAE;CACV,aAAa,EAAE;CACf,aAAa,EAAE;CAChB,EAAE;AAEL,MAAa,qBAAgC,EAC1C,OAAO,EACN,MAAM,EAAE,QAAQ,CAAC,UAAU,EAC5B,CAAC,CACD,WAAU,OAAM,EACf,MAAM,EAAE,MACT,EAAE;AAEL,MAAM,2BAA4C;CAChD,YAAY,EAAC,MAAM,eAAc;CACjC,aAAa,EAAC,MAAM,eAAc;CAClC,IAAI,EAAC,MAAM,MAAK;CAChB,QAAQ,EAAC,MAAM,WAAU;CACzB,YAAY,EAAC,MAAM,eAAc;CACjC,QAAQ,EAAC,MAAM,UAAS;CACzB;AAED,SAAgB,mBAAmB,GAAG,OAAuC;AAC3E,QAAO,UAAU,MAAiB,OAAO,yBAAyB"}
@@ -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,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAC,OAAO,EAAC,MAAM,+BAA+B,CAAC;AA0BtD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAsB;IAEtB,MAAM,OAAO,GAAY,MAAM,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE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CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QACzD,sCAAsC;QACtC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,GAAG,OAAO,EAAE,OAAO,EAAC,CAAC,CAAC;IAC/C,CAAC;CACF;AAED,qEAAqE;AACrE,MAAM,iBAAiB;IAEF;IACA;IAFnB,YACmB,IAAgB,EAChB,OAAe;QADf,SAAI,GAAJ,IAAI,CAAY;QAChB,YAAO,GAAP,OAAO,CAAQ;IAC/B,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,MAAM,GACV,OAAO,CAAC,MAAM,KAAK,SAAS;YAC1B,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;YAClD,CAAC,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAC,CAAC,CAAC;IAC9C,CAAC;CACF"}
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"}
@@ -1,21 +1,25 @@
1
- import type { HttpClient, HttpRequest } from '@databricks/sdk-core/http';
2
- import type { Logger } from '@databricks/sdk-core/logger';
3
- import type { CallOptions } from '@databricks/sdk-options/call';
4
- import type { z } from 'zod';
5
- export interface HttpCallOptions {
6
- readonly request: HttpRequest;
7
- readonly httpClient: HttpClient;
8
- readonly logger: Logger;
1
+ import { Logger } from "@databricks/sdk-core/logger";
2
+ import { HttpClient, HttpRequest } from "@databricks/sdk-core/http";
3
+ import { z } from "zod";
4
+ import { CallOptions } from "@databricks/sdk-options/call";
5
+
6
+ //#region src/v1/utils.d.ts
7
+ interface HttpCallOptions {
8
+ readonly request: HttpRequest;
9
+ readonly httpClient: HttpClient;
10
+ readonly logger: Logger;
9
11
  }
10
12
  /**
11
13
  * Translates public CallOptions to the internal Options shape accepted by
12
14
  * execute(). Even though the shapes match today, this isolates the public
13
15
  * API from the executor's internal type so they can diverge.
14
16
  */
15
- export declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
16
- export declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
17
- export declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
18
- export declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
19
- export declare function marshalRequest(data: unknown, schema: z.ZodType): string;
20
- export declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
17
+ declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
18
+ declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
19
+ declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
20
+ declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
21
+ declare function marshalRequest(data: unknown, schema: z.ZodType): string;
22
+ declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
23
+ //#endregion
24
+ export { HttpCallOptions, buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
21
25
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAEZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAO3B,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CASf;AA2BD,wBAAsB,eAAe,CACnC,IAAI,EAAE,e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