@databricks/sdk-uc-functions 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 +63 -59
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +195 -244
- 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 +361 -358
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +344 -471
- 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/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAIvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,OAAO,MAAM,oBAAoB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAW7D,OAAO,EACL,kCAAkC,EAClC,kCAAkC,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,CAAC;QAC9D,CAAC,CAAC;QACF,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n CreateFunctionRequest,\n DeleteFunctionRequest,\n DeleteFunctionResponse,\n FunctionInfo,\n GetFunctionRequest,\n ListFunctionsRequest,\n ListFunctionsResponse,\n UpdateFunctionRequest,\n} from './model';\nimport {\n marshalCreateFunctionRequestSchema,\n marshalUpdateFunctionRequestSchema,\n unmarshalDeleteFunctionResponseSchema,\n unmarshalFunctionInfoSchema,\n unmarshalListFunctionsResponseSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class FunctionsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /**\n * **WARNING: This API is experimental and will change in future versions**\n *\n * Creates a new function\n *\n * The user must have the following permissions in order for the function to be created:\n * - **USE_CATALOG** on the function's parent catalog\n * - **USE_SCHEMA** and **CREATE_FUNCTION** on the function's parent schema\n */\n async createFunction(\n req: CreateFunctionRequest,\n options?: CallOptions\n ): Promise<FunctionInfo> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/functions`;\n const body = marshalRequest(req, marshalCreateFunctionRequestSchema);\n let resp: FunctionInfo | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalFunctionInfoSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Deletes the function that matches the supplied name.\n * For the deletion to succeed, the user must satisfy one of the following conditions:\n * - Is the owner of the function's parent catalog\n * - Is the owner of the function's parent schema and have the **USE_CATALOG** privilege on its parent catalog\n * - Is the owner of the function itself and have both the **USE_CATALOG** privilege on its parent catalog and the **USE_SCHEMA** privilege on its parent schema\n */\n async deleteFunction(\n req: DeleteFunctionRequest,\n options?: CallOptions\n ): Promise<DeleteFunctionResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/functions/${req.fullNameArg ?? ''}`;\n const params = new URLSearchParams();\n if (req.force !== undefined) {\n params.append('force', String(req.force));\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: DeleteFunctionResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('DELETE', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDeleteFunctionResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Gets a function from within a parent catalog and schema.\n * For the fetch to succeed, the user must satisfy one of the following requirements:\n * - Is a metastore admin\n * - Is an owner of the function's parent catalog\n * - Have the **USE_CATALOG** privilege on the function's parent catalog and be the owner of the function\n * - Have the **USE_CATALOG** privilege on the function's parent catalog, the **USE_SCHEMA** privilege on the function's parent schema, and the **EXECUTE** privilege on the function itself\n */\n async getFunction(\n req: GetFunctionRequest,\n options?: CallOptions\n ): Promise<FunctionInfo> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/functions/${req.fullNameArg ?? ''}`;\n const params = new URLSearchParams();\n if (req.includeBrowse !== undefined) {\n params.append('include_browse', String(req.includeBrowse));\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: FunctionInfo | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalFunctionInfoSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * List functions within the specified parent catalog and schema.\n * If the user is a metastore admin, all functions are returned in the output list.\n * Otherwise, the user must have the **USE_CATALOG** privilege on the catalog and the **USE_SCHEMA** privilege on the schema, and the output list contains only functions for which either the user has the **EXECUTE** privilege or the user is the owner.\n * There is no guarantee of a specific ordering of the elements in the array.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async listFunctions(\n req: ListFunctionsRequest,\n options?: CallOptions\n ): Promise<ListFunctionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/functions`;\n const params = new URLSearchParams();\n if (req.catalogName !== undefined) {\n params.append('catalog_name', req.catalogName);\n }\n if (req.schemaName !== undefined) {\n params.append('schema_name', req.schemaName);\n }\n if (req.includeBrowse !== undefined) {\n params.append('include_browse', String(req.includeBrowse));\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListFunctionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalListFunctionsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listFunctionsIter(\n req: ListFunctionsRequest,\n options?: CallOptions\n ): AsyncGenerator<FunctionInfo> {\n const pageReq: ListFunctionsRequest = {...req};\n for (;;) {\n const resp = await this.listFunctions(pageReq, options);\n for (const item of resp.functions ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /**\n * Updates the function that matches the supplied name.\n * Only the owner of the function can be updated. If the user is not a metastore admin, the user must be a member of the group that is the new function owner.\n * - Is a metastore admin\n * - Is the owner of the function's parent catalog\n * - Is the owner of the function's parent schema and has the **USE_CATALOG** privilege on its parent catalog\n * - Is the owner of the function itself and has the **USE_CATALOG** privilege on its parent catalog as well as the **USE_SCHEMA** privilege on the function's parent schema.\n */\n async updateFunction(\n req: UpdateFunctionRequest,\n options?: CallOptions\n ): Promise<FunctionInfo> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/functions/${req.fullNameArg ?? ''}`;\n const body = marshalRequest(req, marshalUpdateFunctionRequestSchema);\n let resp: FunctionInfo | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalFunctionInfoSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp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,SAAS,QAAQ;AACvD,QAAK,MAAM,QAAQ,KAAK,aAAa,EAAE,CACrC,OAAM;AAER,OAAI,KAAK,kBAAkB,UAAa,KAAK,kBAAkB,GAC7D;AAEF,WAAQ,YAAY,KAAK;;;;;;;;;;;CAY7B,MAAM,eACJ,KACA,SACuB;EACvB,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK,mCAAmC,IAAI,eAAe;EAC1E,MAAM,OAAO,eAAe,KAAK,mCAAmC;EACpE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,SAAS,KAAK,SAAS,YAAY,KAAK;IAGvE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,4BAA4B;;AAE7D,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { FunctionsClient } from './client';
|
|
5
|
-
export { ColumnTypeName, FunctionParameterMode, FunctionParameterType, FunctionInfo_ParameterStyle, FunctionInfo_RoutineBody, FunctionInfo_SecurityType, FunctionInfo_SqlDataAccess, } from './model';
|
|
6
|
-
export type { ConnectionDependency, CreateFunction, CreateFunctionRequest, CredentialDependency, DeleteFunctionRequest, DeleteFunctionResponse, Dependency, DependencyList, FunctionDependency, FunctionInfo, FunctionParameterInfo, FunctionParameterInfos, GetFunctionRequest, ListFunctionsRequest, ListFunctionsResponse, TableDependency, UpdateFunctionRequest, } from './model';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { ColumnTypeName, ConnectionDependency, CreateFunction, CreateFunctionRequest, CredentialDependency, DeleteFunctionRequest, DeleteFunctionResponse, Dependency, DependencyList, FunctionDependency, FunctionInfo, FunctionInfo_ParameterStyle, FunctionInfo_RoutineBody, FunctionInfo_SecurityType, FunctionInfo_SqlDataAccess, FunctionParameterInfo, FunctionParameterInfos, FunctionParameterMode, FunctionParameterType, GetFunctionRequest, ListFunctionsRequest, ListFunctionsResponse, TableDependency, UpdateFunctionRequest } from "./model.js";
|
|
2
|
+
import { FunctionsClient } from "./client.js";
|
|
3
|
+
export { ColumnTypeName, type ConnectionDependency, type CreateFunction, type CreateFunctionRequest, type CredentialDependency, type DeleteFunctionRequest, type DeleteFunctionResponse, type Dependency, type DependencyList, type FunctionDependency, type FunctionInfo, FunctionInfo_ParameterStyle, FunctionInfo_RoutineBody, FunctionInfo_SecurityType, FunctionInfo_SqlDataAccess, type FunctionParameterInfo, type FunctionParameterInfos, FunctionParameterMode, FunctionParameterType, FunctionsClient, type GetFunctionRequest, type ListFunctionsRequest, type ListFunctionsResponse, type TableDependency, type UpdateFunctionRequest };
|
package/dist/v1/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { FunctionsClient } from './client';
|
|
6
|
-
export { ColumnTypeName, FunctionParameterMode, FunctionParameterType, FunctionInfo_ParameterStyle, FunctionInfo_RoutineBody, FunctionInfo_SecurityType, FunctionInfo_SqlDataAccess, } from './model';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { ColumnTypeName, FunctionInfo_ParameterStyle, FunctionInfo_RoutineBody, FunctionInfo_SecurityType, FunctionInfo_SqlDataAccess, FunctionParameterMode, FunctionParameterType } from "./model.js";
|
|
2
|
+
import { FunctionsClient } from "./client.js";
|
|
3
|
+
|
|
4
|
+
export { ColumnTypeName, FunctionInfo_ParameterStyle, FunctionInfo_RoutineBody, FunctionInfo_SecurityType, FunctionInfo_SqlDataAccess, FunctionParameterMode, FunctionParameterType, FunctionsClient };
|