@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.
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +25 -21
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +147 -185
- 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 +53 -49
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +52 -78
- 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,50 +1,54 @@
|
|
|
1
|
-
import { Temporal } from
|
|
2
|
-
import { FieldMask } from
|
|
3
|
-
import { z } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
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":";;;;;UAOiB,sBAAA;EACf,SAAA,GAAY,SAAA;AAAA;AAAA,UAGG,sBAAA;EACf,MAAA;AAAA;AAAA,UAGe,mBAAA;EACf,MAAA;AAAA;AAAA,UAGe,sBAAA;EAPf;;AAGF;;;EAUE,QAAA;EATM;EAWN,SAAA;AAAA;AAAA,UAGe,uBAAA;EACf,WAAA,GAAc,SAAA;EACd,aAAA;AAAA;AAAA,UAGe,SAAA;EACf,MAAA;EACA,EAAA;EACA,WAAA;EACA,MAAA,GAAS,KAAA;EAPT;EASA,UAAA,GAAa,QAAA,CAAS,OAAA;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
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
83
|
-
|
|
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
|
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 {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"}
|
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"}
|
package/dist/v1/utils.d.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
package/dist/v1/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/v1/utils.ts"],"mappings":";;;;;;UAoBiB,eAAA;EAAA,SACN,OAAA,EAAS,WAAA;EAAA,SACT,UAAA,EAAY,UAAA;EAAA,SACZ,MAAA,EAAQ,MAAA;AAAA;;;;;;iBAQG,WAAA,CACpB,IAAA,GAAO,MAAA,GAAS,WAAA,KAAgB,OAAA,QAChC,OAAA,GAAU,WAAA,GACT,OAAA;AAAA,iBAoCmB,eAAA,CACpB,IAAA,EAAM,eAAA,GACL,OAAA,CAAQ,UAAA;AAAA,iBA6BK,gBAAA,CACd,MAAA,UACA,GAAA,UACA,OAAA,EAAS,OAAA,EACT,MAAA,GAAS,WAAA,EACT,IAAA,YAAgB,cAAA,CAAe,UAAA,IAC9B,WAAA;AAAA,iBAWa,aAAA,GAAA,CAAiB,IAAA,EAAM,UAAA,EAAY,MAAA,EAAQ,CAAA,CAAE,OAAA,CAAQ,CAAA,IAAK,CAAA;AAAA,iBAO1D,cAAA,CAAe,IAAA,WAAe,MAAA,EAAQ,CAAA,CAAE,OAAA;AAAA,iBAIxC,kBAAA,CACd,MAAA,UACA,KAAA,WACA,MAAA,EAAQ,eAAA"}
|