@databricks/sdk-uc-schemas 0.0.0-dev → 0.1.0-dev.2
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/LICENSE +203 -0
- package/dist/v1/client.d.ts +46 -0
- package/dist/v1/client.d.ts.map +1 -0
- package/dist/v1/client.js +226 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +4 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +4 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/model.d.ts +211 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +192 -0
- package/dist/v1/model.js.map +1 -0
- package/dist/v1/transport.d.ts +5 -0
- package/dist/v1/transport.d.ts.map +1 -0
- package/dist/v1/transport.js +57 -0
- package/dist/v1/transport.js.map +1 -0
- package/dist/v1/utils.d.ts +21 -0
- package/dist/v1/utils.d.ts.map +1 -0
- package/dist/v1/utils.js +113 -0
- package/dist/v1/utils.js.map +1 -0
- package/package.json +38 -4
- package/src/v1/client.ts +285 -0
- package/src/v1/index.ts +23 -0
- package/src/v1/model.ts +426 -0
- package/src/v1/transport.ts +73 -0
- package/src/v1/utils.ts +156 -0
- package/README.md +0 -1
- package/index.js +0 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The type of the catalog. */
|
|
3
|
+
export declare enum CatalogType {
|
|
4
|
+
MANAGED_CATALOG = "MANAGED_CATALOG",
|
|
5
|
+
DELTASHARING_CATALOG = "DELTASHARING_CATALOG",
|
|
6
|
+
SYSTEM_CATALOG = "SYSTEM_CATALOG",
|
|
7
|
+
INTERNAL_CATALOG = "INTERNAL_CATALOG",
|
|
8
|
+
FOREIGN_CATALOG = "FOREIGN_CATALOG",
|
|
9
|
+
MANAGED_ONLINE_CATALOG = "MANAGED_ONLINE_CATALOG"
|
|
10
|
+
}
|
|
11
|
+
export interface CreateSchemaRequest {
|
|
12
|
+
/** Name of schema, relative to parent catalog. */
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
/** Name of parent catalog. */
|
|
15
|
+
catalogName?: string | undefined;
|
|
16
|
+
/** Username of current owner of schema. */
|
|
17
|
+
owner?: string | undefined;
|
|
18
|
+
/** User-provided free-form text description. */
|
|
19
|
+
comment?: string | undefined;
|
|
20
|
+
/** Storage root URL for managed tables within schema. */
|
|
21
|
+
storageRoot?: string | undefined;
|
|
22
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
23
|
+
enablePredictiveOptimization?: string | undefined;
|
|
24
|
+
/** Unique identifier of parent metastore. */
|
|
25
|
+
metastoreId?: string | undefined;
|
|
26
|
+
/** Full name of schema, in form of __catalog_name__.__schema_name__. */
|
|
27
|
+
fullName?: string | undefined;
|
|
28
|
+
/** Time at which this schema was created, in epoch milliseconds. */
|
|
29
|
+
createdAt?: bigint | undefined;
|
|
30
|
+
/** Username of schema creator. */
|
|
31
|
+
createdBy?: string | undefined;
|
|
32
|
+
/** Time at which this schema was created, in epoch milliseconds. */
|
|
33
|
+
updatedAt?: bigint | undefined;
|
|
34
|
+
/** Username of user who last modified schema. */
|
|
35
|
+
updatedBy?: string | undefined;
|
|
36
|
+
/** The type of the parent catalog. */
|
|
37
|
+
catalogType?: CatalogType | undefined;
|
|
38
|
+
/** Storage location for managed tables within schema. */
|
|
39
|
+
storageLocation?: string | undefined;
|
|
40
|
+
effectivePredictiveOptimizationFlag?: EffectivePredictiveOptimizationFlag | undefined;
|
|
41
|
+
/** The unique identifier of the schema. */
|
|
42
|
+
schemaId?: string | undefined;
|
|
43
|
+
/** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
|
|
44
|
+
browseOnly?: boolean | undefined;
|
|
45
|
+
/** A map of key-value properties attached to the securable. */
|
|
46
|
+
properties?: Record<string, string> | undefined;
|
|
47
|
+
/** A map of key-value properties attached to the securable. */
|
|
48
|
+
options?: Record<string, string> | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface CreateSchemaRequest_OptionsEntry {
|
|
51
|
+
key?: string | undefined;
|
|
52
|
+
value?: string | undefined;
|
|
53
|
+
}
|
|
54
|
+
export interface CreateSchemaRequest_PropertiesEntry {
|
|
55
|
+
key?: string | undefined;
|
|
56
|
+
value?: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
export interface DeleteSchemaRequest {
|
|
59
|
+
/** Full name of the schema. */
|
|
60
|
+
fullNameArg?: string | undefined;
|
|
61
|
+
/** Force deletion even if the schema is not empty. */
|
|
62
|
+
force?: boolean | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface DeleteSchemaRequest_Response {
|
|
65
|
+
}
|
|
66
|
+
export interface EffectivePredictiveOptimizationFlag {
|
|
67
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
68
|
+
value?: string | undefined;
|
|
69
|
+
/** The type of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */
|
|
70
|
+
inheritedFromType?: string | undefined;
|
|
71
|
+
/** The name of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */
|
|
72
|
+
inheritedFromName?: string | undefined;
|
|
73
|
+
}
|
|
74
|
+
export interface GetSchemaRequest {
|
|
75
|
+
/** Full name of the schema. */
|
|
76
|
+
fullNameArg?: string | undefined;
|
|
77
|
+
/** Whether to include schemas in the response for which the principal can only access selective metadata for */
|
|
78
|
+
includeBrowse?: boolean | undefined;
|
|
79
|
+
}
|
|
80
|
+
export interface ListSchemasRequest {
|
|
81
|
+
/** Parent catalog for schemas of interest. */
|
|
82
|
+
catalogName?: string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Maximum number of schemas to return.
|
|
85
|
+
* If not set, all the schemas are returned (not recommended).
|
|
86
|
+
* - when set to a value greater than 0, the page length is the minimum of this value and a server configured value;
|
|
87
|
+
* - when set to 0, the page length is set to a server configured value (recommended);
|
|
88
|
+
* - when set to a value less than 0, an invalid parameter error is returned;
|
|
89
|
+
*/
|
|
90
|
+
maxResults?: number | undefined;
|
|
91
|
+
/** Opaque pagination token to go to next page based on previous query. */
|
|
92
|
+
pageToken?: string | undefined;
|
|
93
|
+
/** Whether to include schemas in the response for which the principal can only access selective metadata for */
|
|
94
|
+
includeBrowse?: boolean | undefined;
|
|
95
|
+
}
|
|
96
|
+
export interface ListSchemasRequest_Response {
|
|
97
|
+
/** An array of schema information objects. */
|
|
98
|
+
schemas?: SchemaInfo[] | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
101
|
+
* __page_token__ should be set to this value for the next request (for the next page of results).
|
|
102
|
+
*/
|
|
103
|
+
nextPageToken?: string | undefined;
|
|
104
|
+
}
|
|
105
|
+
/** Next ID: 45 */
|
|
106
|
+
export interface SchemaInfo {
|
|
107
|
+
/** Name of schema, relative to parent catalog. */
|
|
108
|
+
name?: string | undefined;
|
|
109
|
+
/** Name of parent catalog. */
|
|
110
|
+
catalogName?: string | undefined;
|
|
111
|
+
/** Username of current owner of schema. */
|
|
112
|
+
owner?: string | undefined;
|
|
113
|
+
/** User-provided free-form text description. */
|
|
114
|
+
comment?: string | undefined;
|
|
115
|
+
/** Storage root URL for managed tables within schema. */
|
|
116
|
+
storageRoot?: string | undefined;
|
|
117
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
118
|
+
enablePredictiveOptimization?: string | undefined;
|
|
119
|
+
/** Unique identifier of parent metastore. */
|
|
120
|
+
metastoreId?: string | undefined;
|
|
121
|
+
/** Full name of schema, in form of __catalog_name__.__schema_name__. */
|
|
122
|
+
fullName?: string | undefined;
|
|
123
|
+
/** Time at which this schema was created, in epoch milliseconds. */
|
|
124
|
+
createdAt?: bigint | undefined;
|
|
125
|
+
/** Username of schema creator. */
|
|
126
|
+
createdBy?: string | undefined;
|
|
127
|
+
/** Time at which this schema was created, in epoch milliseconds. */
|
|
128
|
+
updatedAt?: bigint | undefined;
|
|
129
|
+
/** Username of user who last modified schema. */
|
|
130
|
+
updatedBy?: string | undefined;
|
|
131
|
+
/** The type of the parent catalog. */
|
|
132
|
+
catalogType?: CatalogType | undefined;
|
|
133
|
+
/** Storage location for managed tables within schema. */
|
|
134
|
+
storageLocation?: string | undefined;
|
|
135
|
+
effectivePredictiveOptimizationFlag?: EffectivePredictiveOptimizationFlag | undefined;
|
|
136
|
+
/** The unique identifier of the schema. */
|
|
137
|
+
schemaId?: string | undefined;
|
|
138
|
+
/** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
|
|
139
|
+
browseOnly?: boolean | undefined;
|
|
140
|
+
/** A map of key-value properties attached to the securable. */
|
|
141
|
+
properties?: Record<string, string> | undefined;
|
|
142
|
+
/** A map of key-value properties attached to the securable. */
|
|
143
|
+
options?: Record<string, string> | undefined;
|
|
144
|
+
}
|
|
145
|
+
export interface SchemaInfo_OptionsEntry {
|
|
146
|
+
key?: string | undefined;
|
|
147
|
+
value?: string | undefined;
|
|
148
|
+
}
|
|
149
|
+
export interface SchemaInfo_PropertiesEntry {
|
|
150
|
+
key?: string | undefined;
|
|
151
|
+
value?: string | undefined;
|
|
152
|
+
}
|
|
153
|
+
export interface UpdateSchemaRequest {
|
|
154
|
+
/** Full name of the schema. */
|
|
155
|
+
fullNameArg?: string | undefined;
|
|
156
|
+
/** New name for the schema. */
|
|
157
|
+
newName?: string | undefined;
|
|
158
|
+
/** Name of schema, relative to parent catalog. */
|
|
159
|
+
name?: string | undefined;
|
|
160
|
+
/** Name of parent catalog. */
|
|
161
|
+
catalogName?: string | undefined;
|
|
162
|
+
/** Username of current owner of schema. */
|
|
163
|
+
owner?: string | undefined;
|
|
164
|
+
/** User-provided free-form text description. */
|
|
165
|
+
comment?: string | undefined;
|
|
166
|
+
/** Storage root URL for managed tables within schema. */
|
|
167
|
+
storageRoot?: string | undefined;
|
|
168
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
169
|
+
enablePredictiveOptimization?: string | undefined;
|
|
170
|
+
/** Unique identifier of parent metastore. */
|
|
171
|
+
metastoreId?: string | undefined;
|
|
172
|
+
/** Full name of schema, in form of __catalog_name__.__schema_name__. */
|
|
173
|
+
fullName?: string | undefined;
|
|
174
|
+
/** Time at which this schema was created, in epoch milliseconds. */
|
|
175
|
+
createdAt?: bigint | undefined;
|
|
176
|
+
/** Username of schema creator. */
|
|
177
|
+
createdBy?: string | undefined;
|
|
178
|
+
/** Time at which this schema was created, in epoch milliseconds. */
|
|
179
|
+
updatedAt?: bigint | undefined;
|
|
180
|
+
/** Username of user who last modified schema. */
|
|
181
|
+
updatedBy?: string | undefined;
|
|
182
|
+
/** The type of the parent catalog. */
|
|
183
|
+
catalogType?: CatalogType | undefined;
|
|
184
|
+
/** Storage location for managed tables within schema. */
|
|
185
|
+
storageLocation?: string | undefined;
|
|
186
|
+
effectivePredictiveOptimizationFlag?: EffectivePredictiveOptimizationFlag | undefined;
|
|
187
|
+
/** The unique identifier of the schema. */
|
|
188
|
+
schemaId?: string | undefined;
|
|
189
|
+
/** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
|
|
190
|
+
browseOnly?: boolean | undefined;
|
|
191
|
+
/** A map of key-value properties attached to the securable. */
|
|
192
|
+
properties?: Record<string, string> | undefined;
|
|
193
|
+
/** A map of key-value properties attached to the securable. */
|
|
194
|
+
options?: Record<string, string> | undefined;
|
|
195
|
+
}
|
|
196
|
+
export interface UpdateSchemaRequest_OptionsEntry {
|
|
197
|
+
key?: string | undefined;
|
|
198
|
+
value?: string | undefined;
|
|
199
|
+
}
|
|
200
|
+
export interface UpdateSchemaRequest_PropertiesEntry {
|
|
201
|
+
key?: string | undefined;
|
|
202
|
+
value?: string | undefined;
|
|
203
|
+
}
|
|
204
|
+
export declare const unmarshalDeleteSchemaRequest_ResponseSchema: z.ZodType<DeleteSchemaRequest_Response>;
|
|
205
|
+
export declare const unmarshalEffectivePredictiveOptimizationFlagSchema: z.ZodType<EffectivePredictiveOptimizationFlag>;
|
|
206
|
+
export declare const unmarshalListSchemasRequest_ResponseSchema: z.ZodType<ListSchemasRequest_Response>;
|
|
207
|
+
export declare const unmarshalSchemaInfoSchema: z.ZodType<SchemaInfo>;
|
|
208
|
+
export declare const marshalCreateSchemaRequestSchema: z.ZodType;
|
|
209
|
+
export declare const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType;
|
|
210
|
+
export declare const marshalUpdateSchemaRequestSchema: z.ZodType;
|
|
211
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +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,+BAA+B;AAC/B,oBAAY,WAAW;IACrB,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,sBAAsB,2BAA2B;CAClD;AAED,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,8FAA8F;IAC9F,4BAA4B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,oEAAoE;IACpE,SAAS,CAAC,EAAE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O,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC9C;AAGD,MAAM,WAAW,gCAAgC;IAC/C,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAGD,MAAM,WAAW,mCAAmC;IAClD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAGD,eAAO,MAAM,2CAA2C,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAClF,CAAC;AAEf,eAAO,MAAM,kDAAkD,EAAE,CAAC,CAAC,OAAO,CAAC,mCAAmC,CAWvG,CAAC;AAGR,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CASvF,CAAC;AAER,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAmDvD,CAAC;AAEN,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OA6C5C,CAAC;AAEN,eAAO,MAAM,gDAAgD,EAAE,CAAC,CAAC,OAU5D,CAAC;AAEN,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,OAiD5C,CAAC"}
|
package/dist/v1/model.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** The type of the catalog. */
|
|
4
|
+
export var CatalogType;
|
|
5
|
+
(function (CatalogType) {
|
|
6
|
+
CatalogType["MANAGED_CATALOG"] = "MANAGED_CATALOG";
|
|
7
|
+
CatalogType["DELTASHARING_CATALOG"] = "DELTASHARING_CATALOG";
|
|
8
|
+
CatalogType["SYSTEM_CATALOG"] = "SYSTEM_CATALOG";
|
|
9
|
+
CatalogType["INTERNAL_CATALOG"] = "INTERNAL_CATALOG";
|
|
10
|
+
CatalogType["FOREIGN_CATALOG"] = "FOREIGN_CATALOG";
|
|
11
|
+
CatalogType["MANAGED_ONLINE_CATALOG"] = "MANAGED_ONLINE_CATALOG";
|
|
12
|
+
})(CatalogType || (CatalogType = {}));
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
14
|
+
export const unmarshalDeleteSchemaRequest_ResponseSchema = z.object({});
|
|
15
|
+
export const unmarshalEffectivePredictiveOptimizationFlagSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
value: z.string().optional(),
|
|
18
|
+
inherited_from_type: z.string().optional(),
|
|
19
|
+
inherited_from_name: z.string().optional(),
|
|
20
|
+
})
|
|
21
|
+
.transform(d => ({
|
|
22
|
+
value: d.value,
|
|
23
|
+
inheritedFromType: d.inherited_from_type,
|
|
24
|
+
inheritedFromName: d.inherited_from_name,
|
|
25
|
+
}));
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
27
|
+
export const unmarshalListSchemasRequest_ResponseSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
schemas: z.array(z.lazy(() => unmarshalSchemaInfoSchema)).optional(),
|
|
30
|
+
next_page_token: z.string().optional(),
|
|
31
|
+
})
|
|
32
|
+
.transform(d => ({
|
|
33
|
+
schemas: d.schemas,
|
|
34
|
+
nextPageToken: d.next_page_token,
|
|
35
|
+
}));
|
|
36
|
+
export const unmarshalSchemaInfoSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
name: z.string().optional(),
|
|
39
|
+
catalog_name: z.string().optional(),
|
|
40
|
+
owner: z.string().optional(),
|
|
41
|
+
comment: z.string().optional(),
|
|
42
|
+
storage_root: z.string().optional(),
|
|
43
|
+
enable_predictive_optimization: z.string().optional(),
|
|
44
|
+
metastore_id: z.string().optional(),
|
|
45
|
+
full_name: z.string().optional(),
|
|
46
|
+
created_at: z
|
|
47
|
+
.union([z.number(), z.bigint()])
|
|
48
|
+
.transform(v => BigInt(v))
|
|
49
|
+
.optional(),
|
|
50
|
+
created_by: z.string().optional(),
|
|
51
|
+
updated_at: z
|
|
52
|
+
.union([z.number(), z.bigint()])
|
|
53
|
+
.transform(v => BigInt(v))
|
|
54
|
+
.optional(),
|
|
55
|
+
updated_by: z.string().optional(),
|
|
56
|
+
catalog_type: z.enum(CatalogType).optional(),
|
|
57
|
+
storage_location: z.string().optional(),
|
|
58
|
+
effective_predictive_optimization_flag: z
|
|
59
|
+
.lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema)
|
|
60
|
+
.optional(),
|
|
61
|
+
schema_id: z.string().optional(),
|
|
62
|
+
browse_only: z.boolean().optional(),
|
|
63
|
+
properties: z.record(z.string(), z.string()).optional(),
|
|
64
|
+
options: z.record(z.string(), z.string()).optional(),
|
|
65
|
+
})
|
|
66
|
+
.transform(d => ({
|
|
67
|
+
name: d.name,
|
|
68
|
+
catalogName: d.catalog_name,
|
|
69
|
+
owner: d.owner,
|
|
70
|
+
comment: d.comment,
|
|
71
|
+
storageRoot: d.storage_root,
|
|
72
|
+
enablePredictiveOptimization: d.enable_predictive_optimization,
|
|
73
|
+
metastoreId: d.metastore_id,
|
|
74
|
+
fullName: d.full_name,
|
|
75
|
+
createdAt: d.created_at,
|
|
76
|
+
createdBy: d.created_by,
|
|
77
|
+
updatedAt: d.updated_at,
|
|
78
|
+
updatedBy: d.updated_by,
|
|
79
|
+
catalogType: d.catalog_type,
|
|
80
|
+
storageLocation: d.storage_location,
|
|
81
|
+
effectivePredictiveOptimizationFlag: d.effective_predictive_optimization_flag,
|
|
82
|
+
schemaId: d.schema_id,
|
|
83
|
+
browseOnly: d.browse_only,
|
|
84
|
+
properties: d.properties,
|
|
85
|
+
options: d.options,
|
|
86
|
+
}));
|
|
87
|
+
export const marshalCreateSchemaRequestSchema = z
|
|
88
|
+
.object({
|
|
89
|
+
name: z.string().optional(),
|
|
90
|
+
catalogName: z.string().optional(),
|
|
91
|
+
owner: z.string().optional(),
|
|
92
|
+
comment: z.string().optional(),
|
|
93
|
+
storageRoot: z.string().optional(),
|
|
94
|
+
enablePredictiveOptimization: z.string().optional(),
|
|
95
|
+
metastoreId: z.string().optional(),
|
|
96
|
+
fullName: z.string().optional(),
|
|
97
|
+
createdAt: z.bigint().optional(),
|
|
98
|
+
createdBy: z.string().optional(),
|
|
99
|
+
updatedAt: z.bigint().optional(),
|
|
100
|
+
updatedBy: z.string().optional(),
|
|
101
|
+
catalogType: z.enum(CatalogType).optional(),
|
|
102
|
+
storageLocation: z.string().optional(),
|
|
103
|
+
effectivePredictiveOptimizationFlag: z
|
|
104
|
+
.lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
|
|
105
|
+
.optional(),
|
|
106
|
+
schemaId: z.string().optional(),
|
|
107
|
+
browseOnly: z.boolean().optional(),
|
|
108
|
+
properties: z.record(z.string(), z.string()).optional(),
|
|
109
|
+
options: z.record(z.string(), z.string()).optional(),
|
|
110
|
+
})
|
|
111
|
+
.transform(d => ({
|
|
112
|
+
name: d.name,
|
|
113
|
+
catalog_name: d.catalogName,
|
|
114
|
+
owner: d.owner,
|
|
115
|
+
comment: d.comment,
|
|
116
|
+
storage_root: d.storageRoot,
|
|
117
|
+
enable_predictive_optimization: d.enablePredictiveOptimization,
|
|
118
|
+
metastore_id: d.metastoreId,
|
|
119
|
+
full_name: d.fullName,
|
|
120
|
+
created_at: d.createdAt,
|
|
121
|
+
created_by: d.createdBy,
|
|
122
|
+
updated_at: d.updatedAt,
|
|
123
|
+
updated_by: d.updatedBy,
|
|
124
|
+
catalog_type: d.catalogType,
|
|
125
|
+
storage_location: d.storageLocation,
|
|
126
|
+
effective_predictive_optimization_flag: d.effectivePredictiveOptimizationFlag,
|
|
127
|
+
schema_id: d.schemaId,
|
|
128
|
+
browse_only: d.browseOnly,
|
|
129
|
+
properties: d.properties,
|
|
130
|
+
options: d.options,
|
|
131
|
+
}));
|
|
132
|
+
export const marshalEffectivePredictiveOptimizationFlagSchema = z
|
|
133
|
+
.object({
|
|
134
|
+
value: z.string().optional(),
|
|
135
|
+
inheritedFromType: z.string().optional(),
|
|
136
|
+
inheritedFromName: z.string().optional(),
|
|
137
|
+
})
|
|
138
|
+
.transform(d => ({
|
|
139
|
+
value: d.value,
|
|
140
|
+
inherited_from_type: d.inheritedFromType,
|
|
141
|
+
inherited_from_name: d.inheritedFromName,
|
|
142
|
+
}));
|
|
143
|
+
export const marshalUpdateSchemaRequestSchema = z
|
|
144
|
+
.object({
|
|
145
|
+
fullNameArg: z.string().optional(),
|
|
146
|
+
newName: z.string().optional(),
|
|
147
|
+
name: z.string().optional(),
|
|
148
|
+
catalogName: z.string().optional(),
|
|
149
|
+
owner: z.string().optional(),
|
|
150
|
+
comment: z.string().optional(),
|
|
151
|
+
storageRoot: z.string().optional(),
|
|
152
|
+
enablePredictiveOptimization: z.string().optional(),
|
|
153
|
+
metastoreId: z.string().optional(),
|
|
154
|
+
fullName: z.string().optional(),
|
|
155
|
+
createdAt: z.bigint().optional(),
|
|
156
|
+
createdBy: z.string().optional(),
|
|
157
|
+
updatedAt: z.bigint().optional(),
|
|
158
|
+
updatedBy: z.string().optional(),
|
|
159
|
+
catalogType: z.enum(CatalogType).optional(),
|
|
160
|
+
storageLocation: z.string().optional(),
|
|
161
|
+
effectivePredictiveOptimizationFlag: z
|
|
162
|
+
.lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
|
|
163
|
+
.optional(),
|
|
164
|
+
schemaId: z.string().optional(),
|
|
165
|
+
browseOnly: z.boolean().optional(),
|
|
166
|
+
properties: z.record(z.string(), z.string()).optional(),
|
|
167
|
+
options: z.record(z.string(), z.string()).optional(),
|
|
168
|
+
})
|
|
169
|
+
.transform(d => ({
|
|
170
|
+
full_name_arg: d.fullNameArg,
|
|
171
|
+
new_name: d.newName,
|
|
172
|
+
name: d.name,
|
|
173
|
+
catalog_name: d.catalogName,
|
|
174
|
+
owner: d.owner,
|
|
175
|
+
comment: d.comment,
|
|
176
|
+
storage_root: d.storageRoot,
|
|
177
|
+
enable_predictive_optimization: d.enablePredictiveOptimization,
|
|
178
|
+
metastore_id: d.metastoreId,
|
|
179
|
+
full_name: d.fullName,
|
|
180
|
+
created_at: d.createdAt,
|
|
181
|
+
created_by: d.createdBy,
|
|
182
|
+
updated_at: d.updatedAt,
|
|
183
|
+
updated_by: d.updatedBy,
|
|
184
|
+
catalog_type: d.catalogType,
|
|
185
|
+
storage_location: d.storageLocation,
|
|
186
|
+
effective_predictive_optimization_flag: d.effectivePredictiveOptimizationFlag,
|
|
187
|
+
schema_id: d.schemaId,
|
|
188
|
+
browse_only: d.browseOnly,
|
|
189
|
+
properties: d.properties,
|
|
190
|
+
options: d.options,
|
|
191
|
+
}));
|
|
192
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +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,+BAA+B;AAC/B,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,kDAAmC,CAAA;IACnC,4DAA6C,CAAA;IAC7C,gDAAiC,CAAA;IACjC,oDAAqC,CAAA;IACrC,kDAAmC,CAAA;IACnC,gEAAiD,CAAA;AACnD,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AA+ND,oGAAoG;AACpG,MAAM,CAAC,MAAM,2CAA2C,GACtD,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEf,MAAM,CAAC,MAAM,kDAAkD,GAC7D,CAAC;KACE,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAA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,IAAI,EAAE,CAAC,CAAC,IAAI;IACZ,YAAY,EAAE,CAAC,CAAC,WAAW;IAC3B,KAAK,EAAE,CAAC,CAAC,KAAK;IACd,OAAO,EAAE,CAAC,CAAC,OAAO;IAClB,YAAY,EAAE,CAAC,CAAC,WAAW;IAC3B,8BAA8B,EAAE,CAAC,CAAC,4BAA4B;IAC9D,YAAY,EAAE,CAAC,CAAC,WAAW;IAC3B,SAAS,EAAE,CAAC,CAAC,QAAQ;IACrB,UAAU,EAAE,CAAC,CAAC,SAAS;IACvB,UAAU,EAAE,CAAC,CAAC,SAAS;IACvB,UAAU,EAAE,CAAC,CAAC,SAAS;IACvB,UAAU,EAAE,CAAC,CAAC,SAAS;IACvB,YAAY,EAAE,CAAC,CAAC,WAAW;IAC3B,gBAAgB,EAAE,CAAC,CAAC,eAAe;IACnC,sCAAsC,EACpC,CAAC,CAAC,mCAAmC;IACvC,SAAS,EAAE,CAAC,CAAC,QAAQ;IACrB,WAAW,EAAE,CAAC,CAAC,UAAU;IACzB,UAAU,EAAE,CAAC,CAAC,UAAU;IACxB,OAAO,EAAE,CAAC,CAAC,OAAO;CACnB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HttpClient } from '@databricks/sdk-core/http';
|
|
2
|
+
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
+
/** Creates a new HTTP client with the given options. */
|
|
4
|
+
export declare function newHttpClient(options?: ClientOptions): HttpClient;
|
|
5
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +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;AAEnC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAElE,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,UAAU,CAwBjE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
/** Creates a new HTTP client with the given options. */
|
|
5
|
+
export function newHttpClient(options) {
|
|
6
|
+
const opts = options ?? {};
|
|
7
|
+
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
8
|
+
// also set, since they would be silently ignored.
|
|
9
|
+
if (opts.httpClient !== undefined) {
|
|
10
|
+
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
11
|
+
throw new Error('httpClient cannot be combined with credentials or timeout');
|
|
12
|
+
}
|
|
13
|
+
return opts.httpClient;
|
|
14
|
+
}
|
|
15
|
+
const credentials = opts.credentials ?? defaultCredentials();
|
|
16
|
+
const base = newFetchHttpClient();
|
|
17
|
+
let client = new AuthHttpClient(base, credentials);
|
|
18
|
+
if (opts.timeout !== undefined) {
|
|
19
|
+
client = new TimeoutHttpClient(client, opts.timeout);
|
|
20
|
+
}
|
|
21
|
+
return client;
|
|
22
|
+
}
|
|
23
|
+
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
24
|
+
class AuthHttpClient {
|
|
25
|
+
base;
|
|
26
|
+
credentials;
|
|
27
|
+
constructor(base, credentials) {
|
|
28
|
+
this.base = base;
|
|
29
|
+
this.credentials = credentials;
|
|
30
|
+
}
|
|
31
|
+
async send(request) {
|
|
32
|
+
const authHeaders = await this.credentials.authHeaders();
|
|
33
|
+
// Do not modify the original request.
|
|
34
|
+
const headers = new Headers(request.headers);
|
|
35
|
+
for (const h of authHeaders) {
|
|
36
|
+
headers.set(h.key, h.value);
|
|
37
|
+
}
|
|
38
|
+
return this.base.send({ ...request, headers });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
42
|
+
class TimeoutHttpClient {
|
|
43
|
+
base;
|
|
44
|
+
timeout;
|
|
45
|
+
constructor(base, timeout) {
|
|
46
|
+
this.base = base;
|
|
47
|
+
this.timeout = timeout;
|
|
48
|
+
}
|
|
49
|
+
async send(request) {
|
|
50
|
+
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
51
|
+
const signal = request.signal !== undefined
|
|
52
|
+
? AbortSignal.any([request.signal, timeoutSignal])
|
|
53
|
+
: timeoutSignal;
|
|
54
|
+
return this.base.send({ ...request, signal });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +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;AAG7D,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAC,OAAuB;IACnD,MAAM,IAAI,GAAG,OAAO,IAAI,EAAE,CAAC;IAE3B,0EAA0E;IAC1E,kDAAkD;IAClD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACjE,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,kBAAkB,EAAE,CAAC;IAE7D,MAAM,IAAI,GAAG,kBAAkB,EAAE,CAAC;IAClC,IAAI,MAAM,GAAe,IAAI,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAE/D,IAAI,IAAI,CAAC,OAAO,KAAK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CAAC,IAAI,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAC,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Translates public CallOptions to the internal Options shape accepted by
|
|
12
|
+
* execute(). Even though the shapes match today, this isolates the public
|
|
13
|
+
* API from the executor's internal type so they can diverge.
|
|
14
|
+
*/
|
|
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;
|
|
21
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +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,eAAe,GACpB,OAAO,CAAC,UAAU,CAAC,CA2BrB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,GACzC,WAAW,CASb;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAI1E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAEvE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,GACtB,IAAI,CAuBN"}
|
package/dist/v1/utils.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
import { execute } from '@databricks/sdk-core/ops';
|
|
3
|
+
import { ApiError } from '@databricks/sdk-core/apierror';
|
|
4
|
+
import JSONBig from 'json-bigint';
|
|
5
|
+
// JSON codec that preserves int64 precision. On the way in, large integer
|
|
6
|
+
// literals come back as bigint instead of being rounded to JS Number. On the
|
|
7
|
+
// way out, bigint values are emitted as raw JSON number digits.
|
|
8
|
+
const jsonBigint = JSONBig({ useNativeBigInt: true });
|
|
9
|
+
/**
|
|
10
|
+
* Translates public CallOptions to the internal Options shape accepted by
|
|
11
|
+
* execute(). Even though the shapes match today, this isolates the public
|
|
12
|
+
* API from the executor's internal type so they can diverge.
|
|
13
|
+
*/
|
|
14
|
+
export async function executeCall(call, options) {
|
|
15
|
+
const opts = {
|
|
16
|
+
...(options?.retrier !== undefined && { retrier: options.retrier }),
|
|
17
|
+
...(options?.rateLimiter !== undefined && {
|
|
18
|
+
rateLimiter: options.rateLimiter,
|
|
19
|
+
}),
|
|
20
|
+
...(options?.timeout !== undefined && { timeout: options.timeout }),
|
|
21
|
+
};
|
|
22
|
+
return execute(options?.signal, call, opts);
|
|
23
|
+
}
|
|
24
|
+
async function readAll(body) {
|
|
25
|
+
if (body === null) {
|
|
26
|
+
return new Uint8Array(0);
|
|
27
|
+
}
|
|
28
|
+
const reader = body.getReader();
|
|
29
|
+
const chunks = [];
|
|
30
|
+
for (;;) {
|
|
31
|
+
const { done, value } = await reader.read();
|
|
32
|
+
if (done) {
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
chunks.push(value);
|
|
36
|
+
}
|
|
37
|
+
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
38
|
+
const result = new Uint8Array(totalLength);
|
|
39
|
+
let offset = 0;
|
|
40
|
+
for (const chunk of chunks) {
|
|
41
|
+
result.set(chunk, offset);
|
|
42
|
+
offset += chunk.length;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
export async function executeHttpCall(opts) {
|
|
47
|
+
opts.logger.debug('HTTP request', {
|
|
48
|
+
method: opts.request.method,
|
|
49
|
+
url: opts.request.url,
|
|
50
|
+
});
|
|
51
|
+
let resp;
|
|
52
|
+
try {
|
|
53
|
+
resp = await opts.httpClient.send(opts.request);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
opts.logger.debug('HTTP request failed');
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
const body = await readAll(resp.body);
|
|
60
|
+
opts.logger.debug('HTTP response', {
|
|
61
|
+
statusCode: resp.statusCode,
|
|
62
|
+
body: new TextDecoder().decode(body),
|
|
63
|
+
});
|
|
64
|
+
const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
|
|
65
|
+
if (apiErr !== undefined) {
|
|
66
|
+
throw apiErr;
|
|
67
|
+
}
|
|
68
|
+
return body;
|
|
69
|
+
}
|
|
70
|
+
export function buildHttpRequest(method, url, headers, signal, body) {
|
|
71
|
+
const req = { url, method, headers };
|
|
72
|
+
if (body !== undefined) {
|
|
73
|
+
req.body = body;
|
|
74
|
+
}
|
|
75
|
+
if (signal !== undefined) {
|
|
76
|
+
req.signal = signal;
|
|
77
|
+
}
|
|
78
|
+
return req;
|
|
79
|
+
}
|
|
80
|
+
export function parseResponse(body, schema) {
|
|
81
|
+
const text = new TextDecoder().decode(body);
|
|
82
|
+
const parsed = jsonBigint.parse(text);
|
|
83
|
+
return schema.parse(parsed);
|
|
84
|
+
}
|
|
85
|
+
export function marshalRequest(data, schema) {
|
|
86
|
+
return jsonBigint.stringify(schema.parse(data));
|
|
87
|
+
}
|
|
88
|
+
export function flattenQueryParams(prefix, value, params) {
|
|
89
|
+
if (value === null || value === undefined) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (Array.isArray(value)) {
|
|
93
|
+
// arrays of objects are not yet supported
|
|
94
|
+
for (const item of value) {
|
|
95
|
+
params.append(prefix, String(item));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (typeof value === 'object') {
|
|
99
|
+
for (const [key, val] of Object.entries(value)) {
|
|
100
|
+
flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (typeof value === 'string' ||
|
|
104
|
+
typeof value === 'number' ||
|
|
105
|
+
typeof value === 'boolean' ||
|
|
106
|
+
typeof value === 'bigint') {
|
|
107
|
+
params.append(prefix, String(value));
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAQvD,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,0EAA0E;AAC1E,6EAA6E;AAC7E,gEAAgE;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,EAAC,eAAe,EAAE,IAAI,EAAC,CAAC,CAAC;AAQpD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA6C,EAC7C,OAAqB;IAErB,MAAM,IAAI,GAAY;QACpB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;QACjE,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,IAAI;YACxC,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC;QACF,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;KAClE,CAAC;IACF,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,KAAK,UAAU,O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