@keboola/api-client 0.1.0 → 1.0.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/README.md +18 -1
- package/dist/ai/index.cjs +7 -1
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.js +7 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/assets/index.cjs +7 -1
- package/dist/assets/index.cjs.map +1 -1
- package/dist/assets/index.js +7 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/chat/index.cjs +3 -1
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.js +3 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/constants/index.cjs +145 -0
- package/dist/constants/index.cjs.map +1 -0
- package/dist/constants/index.d.cts +28 -0
- package/dist/constants/index.d.ts +28 -0
- package/dist/constants/index.js +142 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/dataScience/index.cjs +7 -2
- package/dist/dataScience/index.cjs.map +1 -1
- package/dist/dataScience/index.js +7 -2
- package/dist/dataScience/index.js.map +1 -1
- package/dist/domain/permissions/index.cjs +13 -0
- package/dist/domain/permissions/index.cjs.map +1 -0
- package/dist/domain/permissions/index.d.cts +5 -0
- package/dist/domain/permissions/index.d.ts +5 -0
- package/dist/domain/permissions/index.js +11 -0
- package/dist/domain/permissions/index.js.map +1 -0
- package/dist/editor/index.cjs +7 -10
- package/dist/editor/index.cjs.map +1 -1
- package/dist/editor/index.d.cts +11 -19
- package/dist/editor/index.d.ts +11 -19
- package/dist/editor/index.js +7 -10
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/types.d.cts +1 -1
- package/dist/editor/types.d.ts +1 -1
- package/dist/encryption/index.cjs +7 -1
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.js +7 -1
- package/dist/encryption/index.js.map +1 -1
- package/dist/import/index.cjs +7 -1
- package/dist/import/index.cjs.map +1 -1
- package/dist/import/index.js +7 -1
- package/dist/import/index.js.map +1 -1
- package/dist/index.cjs +143 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +976 -204
- package/dist/index.d.ts +976 -204
- package/dist/index.js +143 -40
- package/dist/index.js.map +1 -1
- package/dist/management/index.cjs +40 -23
- package/dist/management/index.cjs.map +1 -1
- package/dist/management/index.d.cts +59 -23
- package/dist/management/index.d.ts +59 -23
- package/dist/management/index.js +40 -23
- package/dist/management/index.js.map +1 -1
- package/dist/management/types.d.cts +2 -2
- package/dist/management/types.d.ts +2 -2
- package/dist/metastore/index.cjs +7 -1
- package/dist/metastore/index.cjs.map +1 -1
- package/dist/metastore/index.js +7 -1
- package/dist/metastore/index.js.map +1 -1
- package/dist/oauth/index.cjs +234 -0
- package/dist/oauth/index.cjs.map +1 -0
- package/dist/oauth/index.d.cts +12 -0
- package/dist/oauth/index.d.ts +12 -0
- package/dist/oauth/index.js +228 -0
- package/dist/oauth/index.js.map +1 -0
- package/dist/oauth/types.cjs +4 -0
- package/dist/oauth/types.cjs.map +1 -0
- package/dist/oauth/types.d.cts +34 -0
- package/dist/oauth/types.d.ts +34 -0
- package/dist/oauth/types.js +3 -0
- package/dist/oauth/types.js.map +1 -0
- package/dist/queryService/index.cjs +7 -1
- package/dist/queryService/index.cjs.map +1 -1
- package/dist/queryService/index.js +7 -1
- package/dist/queryService/index.js.map +1 -1
- package/dist/queue/index.cjs +7 -1
- package/dist/queue/index.cjs.map +1 -1
- package/dist/queue/index.js +7 -1
- package/dist/queue/index.js.map +1 -1
- package/dist/sdk/configurations/index.cjs +14 -0
- package/dist/sdk/configurations/index.cjs.map +1 -0
- package/dist/sdk/configurations/index.d.cts +24 -0
- package/dist/sdk/configurations/index.d.ts +24 -0
- package/dist/sdk/configurations/index.js +11 -0
- package/dist/sdk/configurations/index.js.map +1 -0
- package/dist/sdk/storage/index.cjs +159 -0
- package/dist/sdk/storage/index.cjs.map +1 -1
- package/dist/sdk/storage/index.d.cts +118 -13
- package/dist/sdk/storage/index.d.ts +118 -13
- package/dist/sdk/storage/index.js +149 -1
- package/dist/sdk/storage/index.js.map +1 -1
- package/dist/status/index.cjs +7 -1
- package/dist/status/index.cjs.map +1 -1
- package/dist/status/index.js +7 -1
- package/dist/status/index.js.map +1 -1
- package/dist/storage/index.cjs +19 -8
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.cts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +19 -8
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/types.d.cts +2921 -1309
- package/dist/storage/types.d.ts +2921 -1309
- package/dist/{storageClient-YVWer22Y.d.ts → storageClient-C8LDO4gr.d.ts} +14 -0
- package/dist/{storageClient-DPLh_p0V.d.cts → storageClient-D05fdGHW.d.cts} +14 -0
- package/dist/storageSdk-CX03lGn-.d.ts +18 -0
- package/dist/storageSdk-DZV4nB3o.d.cts +18 -0
- package/dist/syncActions/index.cjs +7 -1
- package/dist/syncActions/index.cjs.map +1 -1
- package/dist/syncActions/index.js +7 -1
- package/dist/syncActions/index.js.map +1 -1
- package/dist/telemetry/index.cjs +7 -1
- package/dist/telemetry/index.cjs.map +1 -1
- package/dist/telemetry/index.js +7 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/{types-B7k8S4ki.d.ts → types-B--u7l2H.d.ts} +33 -118
- package/dist/{types-BeShtGlc.d.cts → types-BTcT8Q0T.d.cts} +15 -1
- package/dist/{types-BeShtGlc.d.ts → types-BTcT8Q0T.d.ts} +15 -1
- package/dist/{types-BNQK_jR_.d.cts → types-C0Owx2P7.d.cts} +33 -118
- package/dist/vault/index.cjs +3 -1
- package/dist/vault/index.cjs.map +1 -1
- package/dist/vault/index.js +3 -1
- package/dist/vault/index.js.map +1 -1
- package/dist/verify/index.cjs +3 -1
- package/dist/verify/index.cjs.map +1 -1
- package/dist/verify/index.js +3 -1
- package/dist/verify/index.js.map +1 -1
- package/package.json +71 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors/ApiError.ts","../../src/fetchClient/createFetchClient/utils.ts","../../src/fetchClient/createFetchClient/createFetchClient.ts","../../src/fetchClient/createGenericFetchClient.ts","../../src/clients/telemetry/provisioning/provisioning.ts","../../src/clients/telemetry/telemetryClient.ts"],"names":[],"mappings":";;;AAEO,IAAM,QAAA,GAAN,cAAuB,KAAA,CAAM;AAAA,EAClC,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EAEA,WAAA,CAAY,EAAE,QAAA,EAAU,OAAA,EAAS,MAAK,EAAgB;AACpD,IAAA,KAAA,CAAM,SAAS,UAAU,CAAA;AACzB,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AACf,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AACF,CAAA;ACRO,IAAM,UAAA,GAAa;AAAA,EACxB,YAAA,EAAc,cAEhB,CAAA;AAEO,IAAM,eAAA,GAAkB;AAAA,EAC7B,IAAA,EAAM,kBAIR,CAAA;AAEO,IAAM,qBAAA,GAA0C,CAAC,EAAE,QAAA,OACxD,QAAA,CAAS,MAAA,IAAU,GAAA,IAAO,QAAA,CAAS,MAAA,IAAU,GAAA;AAE/C,SAAS,gBAAgB,GAAA,EAA6B;AACpD,EAAA,MAAM,OAAA,GAAU,EAAE,GAAG,GAAA,EAAI;AACzB,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,OAAO,CAAA,EAAG;AAClD,IAAA,IAAI,KAAA,IAAS,IAAA,EAAM,OAAO,OAAA,CAAQ,GAAG,CAAA;AAAA,EACvC;AACA,EAAA,OAAO,OAAA;AACT;AAEO,IAAM,SAAA,GAAY,OAAO,QAAA,KAAuB;AAErD,EAAA,IAAI,QAAA,CAAS,MAAA,KAAW,GAAA,EAAK,OAAO,IAAA;AAGpC,EAAA,MAAM,WAAA,GAAc,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,WA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,GAAoB,OAAO,IAAA,EAA6B,MAAA,KAAyB;AACrF,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,MAAA,CAAO,IAAA;AAAA,MAC5B,yBAAA;AAAA,MACA,EAAE,IAAA,EAAK;AAAA,MACP,EAAE,MAAA;AAAO,KACX;AAEA,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAEA,EAAA,OAAO;AAAA,IACL;AAAA,GACF;AACF,CAAA;;;ACXO,IAAM,qBAAA,GAAwB,CAAC,EAAE,OAAA,EAAS,aAAY,KAAyB;AACpF,EAAA,MAAM,SAAS,wBAAA,CAAyB;AAAA,IACtC,OAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,mBAAmB,MAAM;AAAA,GACzC;AACF","file":"index.js","sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nexport class ApiError extends Error {\n response: Response;\n request: Request;\n data: unknown;\n\n constructor({ response, request, data }: ApiResponse) {\n super(response.statusText);\n this.response = response;\n this.request = request;\n this.data = data;\n }\n}\n","import type { IStringifyOptions } from 'qs';\nimport qs from 'qs';\n\nimport type { BodyParam, CreateFetchRequestFn, PathParam, ValidateStatusFn } from './types';\n\nexport const HttpHeader = {\n CONTENT_TYPE: 'content-type',\n CONTENT_DISPOSITION: 'content-disposition',\n};\n\nexport const HttpContentType = {\n JSON: 'application/json',\n TEXT_PLAIN: 'text/plain',\n FORM_DATA: 'multipart/form-data',\n TEXT_HTML: 'text/html',\n};\n\nexport const defaultValidateStatus: ValidateStatusFn = ({ response }) =>\n response.status >= 200 && response.status <= 299;\n\nfunction removeUndefined(obj: Record<string, string>) {\n const objCopy = { ...obj };\n for (const [key, value] of Object.entries(objCopy)) {\n if (value == null) delete objCopy[key];\n }\n return objCopy;\n}\n\nexport const parseData = async (response: Response) => {\n // HTTP 204 - no content\n if (response.status === 204) return null;\n\n // headers indicates that the content is JSON, so parse it.\n const contentType = response.headers.get(HttpHeader.CONTENT_TYPE);\n if (contentType && contentType == HttpContentType.JSON) {\n return response.json();\n }\n\n // try JSON parsing on the text\n // If it fails, return the string. The headers does not have a content type.\n const text = await response.text();\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n};\n\n// Header instance serialize undefined value as `undefined`, we do not want that\nconst cleanHeadersInit = (headersInit: HeadersInit | undefined) => {\n if (Array.isArray(headersInit)) return headersInit;\n if (headersInit instanceof Headers) return headersInit;\n if (headersInit == null) return headersInit;\n\n return removeUndefined(headersInit);\n};\n\nconst createHeaders = (\n headersInitA: HeadersInit | undefined,\n headersInitB: HeadersInit | undefined,\n) => {\n const headersA = new Headers(cleanHeadersInit(headersInitA));\n const headersB = new Headers(cleanHeadersInit(headersInitB));\n\n headersB.forEach((value, key) => {\n headersA.set(key, value);\n });\n\n return headersA;\n};\n\nexport const createPath = (path: string, pathParam: PathParam = {}) =>\n path.replace(/\\{([^}]+)}/g, (_, key) => {\n if (!(key in pathParam))\n throw new Error(`Path parameter \"${key}\" is missing in the path \"${path}\"`);\n\n return encodeURIComponent(pathParam[key]!);\n });\n\nexport const createSearch = (\n query: Record<string, unknown>,\n options: Pick<IStringifyOptions, 'arrayFormat'> = {},\n) => {\n return qs.stringify(query, {\n encodeValuesOnly: true,\n skipNulls: true,\n ...options,\n });\n};\n\nexport const createBody = (body: BodyParam, headers: Headers) => {\n if (body == null) return null;\n if (body instanceof FormData) return body; // fetch automatically sets content-type header\n if (typeof body === 'string') return body; // fetch automatically sets content-type header\n\n const stringifyBody = JSON.stringify(body);\n const stringBody = stringifyBody === '{}' ? null : stringifyBody;\n if (stringBody) headers.set(HttpHeader.CONTENT_TYPE, HttpContentType.JSON);\n\n return stringBody;\n};\n\nexport const parseContentDispositionHeader = (contentDisposition?: string | null) => {\n // extract the type ('inline' or 'attachment'), default the type to 'unknown'\n const type = (() => {\n const typeMatch = contentDisposition?.match(/^\\s*(inline|attachment)\\s*;/i);\n return (typeMatch?.[1]?.toLowerCase() ?? 'unknown') as 'inline' | 'attachment' | 'unknown';\n })();\n\n // extract the filename, default the type to null\n const filename = (() => {\n const filenameMatch = contentDisposition?.match(/filename=\"([^\"]+)\"/i);\n if (filenameMatch) return filenameMatch[1];\n\n // If no filename=\"...\", check for encoded filename*=UTF-8''\n const encodedFilenameMatch = contentDisposition?.match(/filename\\*=(?:UTF-8'')?([^;]+)/i);\n if (encodedFilenameMatch?.[1]) return decodeURIComponent(encodedFilenameMatch[1]);\n\n // Check for unquoted filenames (rare but possible)\n const unquotedFilenameMatch = contentDisposition?.match(/filename=([^;]+)/i);\n return unquotedFilenameMatch?.[1] ?? null;\n })();\n\n // Return the parsed result\n return { type, filename };\n};\n\nexport const createFetchRequest: CreateFetchRequestFn = ({\n url,\n method,\n params,\n options = {},\n defaultOptions,\n}) => {\n const {\n baseUrl,\n validateStatus: defValidateStatus = defaultValidateStatus,\n headers: defaultHeaders,\n ...restDefaultOptions\n } = defaultOptions;\n const { validateStatus, queryArrayFormat, headers: endpointHeaders, ...restOptions } = options;\n\n const headers = createHeaders(defaultHeaders, endpointHeaders);\n const path = createPath(url, params.path);\n const search = createSearch(params.query ?? {}, { arrayFormat: queryArrayFormat });\n const body = createBody(params.body, headers);\n\n const urlInstance = new URL(baseUrl + path);\n urlInstance.search = search;\n\n const request = new Request(urlInstance, {\n ...restDefaultOptions,\n ...restOptions,\n headers,\n method: method.toUpperCase(),\n body,\n });\n\n return { request, validateStatus: validateStatus ?? defValidateStatus };\n};\n","import { ApiError } from '../../errors';\n\nimport type {\n BaseFetchParams,\n CoreFetchFn,\n CreateFetchClientOptions,\n FetchClientOptions,\n FetchFn,\n HttpMethod,\n} from './types';\nimport { createFetchRequest, parseData } from './utils';\n\nexport type FetchClientError = TypeError | ApiError | SyntaxError | DOMException;\n\nexport const isApiError = (error: unknown): error is ApiError => error instanceof ApiError;\n\nexport const isAbortError = (error: unknown): error is DOMException =>\n error instanceof DOMException && error.name === 'AbortError';\n\nexport const isFetchClientError = (error: unknown): error is FetchClientError =>\n error instanceof TypeError || error instanceof SyntaxError || isApiError(error);\n\nconst createCoreFetch =\n (fetchFn: FetchFn): CoreFetchFn =>\n async ({ request, validateStatus }) => {\n const response = await fetchFn(request);\n const data = await parseData(response);\n\n const apiResponse = {\n request,\n response,\n data,\n };\n\n const boolOrError = validateStatus(apiResponse);\n if (isApiError(boolOrError)) throw boolOrError;\n if (!boolOrError) throw new ApiError(apiResponse);\n\n return apiResponse;\n };\n\nexport const createFetchClient = ({\n middlewares = [],\n ...defaultOptions\n}: CreateFetchClientOptions) => {\n const coreFetch = createCoreFetch(defaultOptions.fetchFn ?? fetch);\n const fetchWithMiddlewares = middlewares.reduceRight(\n (next, middleware) => middleware(next),\n coreFetch,\n );\n\n const createFetchMethod =\n (method: HttpMethod) =>\n async (url: string, params: BaseFetchParams, options: FetchClientOptions = {}) => {\n const request = createFetchRequest({\n url,\n method,\n params,\n defaultOptions,\n options,\n });\n\n const methodMiddlewares = options?.middlewares ?? [];\n\n return methodMiddlewares.reduceRight(\n (next, middleware) => middleware(next),\n fetchWithMiddlewares,\n )(request);\n };\n\n return {\n get: createFetchMethod('get'),\n post: createFetchMethod('post'),\n put: createFetchMethod('put'),\n patch: createFetchMethod('patch'),\n delete: createFetchMethod('delete'),\n };\n};\n","import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n","import type { GenericFetchClient } from '../telemetryClient';\n\nimport type { CreateCredentialsBody, WorkspaceData } from './types';\n\nexport const createProvisioning = (client: GenericFetchClient) => {\n const createCredentials = async (body: CreateCredentialsBody, signal?: AbortSignal) => {\n const { data } = await client.post<WorkspaceData, void, void, CreateCredentialsBody>(\n '/provisioning/workspace',\n { body },\n { signal },\n );\n\n return data;\n };\n\n return {\n createCredentials,\n };\n};\n","import { createGenericFetchClient } from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport { createProvisioning } from './provisioning/provisioning';\n\nexport type GenericFetchClient = ReturnType<typeof createGenericFetchClient>;\n\nexport const createTelemetryClient = ({ baseUrl, middlewares }: ClientInitOptions) => {\n const client = createGenericFetchClient({\n baseUrl,\n middlewares,\n });\n\n return {\n provisioning: createProvisioning(client),\n };\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/errors/ApiError.ts","../../src/constants.ts","../../src/fetchClient/createFetchClient/utils.ts","../../src/fetchClient/createFetchClient/createFetchClient.ts","../../src/fetchClient/createGenericFetchClient.ts","../../src/clients/telemetry/provisioning/provisioning.ts","../../src/clients/telemetry/telemetryClient.ts"],"names":[],"mappings":";;;AAEO,IAAM,QAAA,GAAN,cAAuB,KAAA,CAAM;AAAA,EAClC,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EAEA,WAAA,CAAY,EAAE,QAAA,EAAU,OAAA,EAAS,MAAK,EAAgB;AACpD,IAAA,KAAA,CAAM,SAAS,UAAU,CAAA;AACzB,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AACf,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AACF,CAAA;;;ACPO,IAAM,UAAA,GAAa;AAAA,EACxB,UAAA,EAAY,GAOd,CAAA;;;ACPO,IAAM,UAAA,GAAa;AAAA,EACxB,YAAA,EAA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FetchClient/types';\n\nexport class ApiError extends Error {\n response: Response;\n request: Request;\n data: unknown;\n\n constructor({ response, request, data }: ApiResponse) {\n super(response.statusText);\n this.response = response;\n this.request = request;\n this.data = data;\n }\n}\n","export const KeboolaHttpHeader = {\n STORAGE_API_TOKEN: 'X-StorageApi-Token',\n MANAGEMENT_API_TOKEN: 'X-Kbc-Manageapitoken',\n STORAGE_API_URL: 'x-storageapi-url',\n};\n\nexport const HttpStatus = {\n NO_CONTENT: 204,\n BAD_REQUEST: 400,\n UNPROCESSABLE_ENTITY: 422,\n INTERNAL_SERVER_ERROR: 500,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n} as const;\n\nexport const ENCRYPTED_VALUE_PREFIX = 'KBC::';\n","import type { IStringifyOptions } from 'qs';\nimport qs from 'qs';\n\nimport { HttpStatus } from '../../constants';\n\nimport type { BodyParam, CreateFetchRequestFn, PathParam, ValidateStatusFn } from './types';\n\nexport const HttpHeader = {\n CONTENT_TYPE: 'content-type',\n CONTENT_DISPOSITION: 'content-disposition',\n};\n\nexport const HttpContentType = {\n JSON: 'application/json',\n TEXT_PLAIN: 'text/plain',\n FORM_DATA: 'multipart/form-data',\n TEXT_HTML: 'text/html',\n};\n\nexport const defaultValidateStatus: ValidateStatusFn = ({ response }) =>\n response.status >= 200 && response.status <= 299;\n\nfunction removeUndefined(obj: Record<string, string>) {\n const objCopy = { ...obj };\n for (const [key, value] of Object.entries(objCopy)) {\n if (value == null) delete objCopy[key];\n }\n return objCopy;\n}\n\nexport const parseData = async (response: Response) => {\n if (response.status === HttpStatus.NO_CONTENT) return null;\n\n // headers indicates that the content is JSON, so parse it.\n const contentType = response.headers.get(HttpHeader.CONTENT_TYPE);\n if (contentType && contentType == HttpContentType.JSON) {\n return response.json();\n }\n\n // try JSON parsing on the text\n // If it fails, return the string. The headers does not have a content type.\n const text = await response.text();\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n};\n\n// Header instance serialize undefined value as `undefined`, we do not want that\nconst cleanHeadersInit = (headersInit: HeadersInit | undefined) => {\n if (Array.isArray(headersInit)) return headersInit;\n if (headersInit instanceof Headers) return headersInit;\n if (headersInit == null) return headersInit;\n\n return removeUndefined(headersInit);\n};\n\nconst createHeaders = (\n headersInitA: HeadersInit | undefined,\n headersInitB: HeadersInit | undefined,\n) => {\n const headersA = new Headers(cleanHeadersInit(headersInitA));\n const headersB = new Headers(cleanHeadersInit(headersInitB));\n\n headersB.forEach((value, key) => {\n headersA.set(key, value);\n });\n\n return headersA;\n};\n\nexport const createPath = (path: string, pathParam: PathParam = {}) =>\n path.replace(/\\{([^}]+)}/g, (_, key) => {\n if (!(key in pathParam))\n throw new Error(`Path parameter \"${key}\" is missing in the path \"${path}\"`);\n\n return encodeURIComponent(pathParam[key]!);\n });\n\nexport const createSearch = (\n query: Record<string, unknown>,\n options: Pick<IStringifyOptions, 'arrayFormat'> = {},\n) => {\n return qs.stringify(query, {\n encodeValuesOnly: true,\n skipNulls: true,\n ...options,\n });\n};\n\nexport const createBody = (body: BodyParam, headers: Headers) => {\n if (body == null) return null;\n if (body instanceof FormData) return body; // fetch automatically sets content-type header\n if (typeof body === 'string') return body; // fetch automatically sets content-type header\n\n const stringifyBody = JSON.stringify(body);\n const stringBody = stringifyBody === '{}' ? null : stringifyBody;\n if (stringBody) headers.set(HttpHeader.CONTENT_TYPE, HttpContentType.JSON);\n\n return stringBody;\n};\n\nexport const parseContentDispositionHeader = (contentDisposition?: string | null) => {\n // extract the type ('inline' or 'attachment'), default the type to 'unknown'\n const type = (() => {\n const typeMatch = contentDisposition?.match(/^\\s*(inline|attachment)\\s*;/i);\n return (typeMatch?.[1]?.toLowerCase() ?? 'unknown') as 'inline' | 'attachment' | 'unknown';\n })();\n\n // extract the filename, default the type to null\n const filename = (() => {\n const filenameMatch = contentDisposition?.match(/filename=\"([^\"]+)\"/i);\n if (filenameMatch) return filenameMatch[1];\n\n // If no filename=\"...\", check for encoded filename*=UTF-8''\n const encodedFilenameMatch = contentDisposition?.match(/filename\\*=(?:UTF-8'')?([^;]+)/i);\n if (encodedFilenameMatch?.[1]) return decodeURIComponent(encodedFilenameMatch[1]);\n\n // Check for unquoted filenames (rare but possible)\n const unquotedFilenameMatch = contentDisposition?.match(/filename=([^;]+)/i);\n return unquotedFilenameMatch?.[1] ?? null;\n })();\n\n // Return the parsed result\n return { type, filename };\n};\n\nexport const createFetchRequest: CreateFetchRequestFn = ({\n url,\n method,\n params,\n options = {},\n defaultOptions,\n}) => {\n const {\n baseUrl,\n validateStatus: defValidateStatus = defaultValidateStatus,\n headers: defaultHeaders,\n ...restDefaultOptions\n } = defaultOptions;\n const { validateStatus, queryArrayFormat, headers: endpointHeaders, ...restOptions } = options;\n\n const headers = createHeaders(defaultHeaders, endpointHeaders);\n const path = createPath(url, params.path);\n const search = createSearch(params.query ?? {}, { arrayFormat: queryArrayFormat });\n const body = createBody(params.body, headers);\n\n const urlInstance = new URL(baseUrl + path);\n urlInstance.search = search;\n\n const request = new Request(urlInstance, {\n ...restDefaultOptions,\n ...restOptions,\n headers,\n method: method.toUpperCase(),\n body,\n });\n\n return { request, validateStatus: validateStatus ?? defValidateStatus };\n};\n","import { ApiError } from '../../errors';\n\nimport type {\n BaseFetchParams,\n CoreFetchFn,\n CreateFetchClientOptions,\n FetchClientOptions,\n FetchFn,\n HttpMethod,\n} from './types';\nimport { createFetchRequest, parseData } from './utils';\n\nexport type FetchClientError = TypeError | ApiError | SyntaxError | DOMException;\n\nexport const isApiError = (error: unknown): error is ApiError => error instanceof ApiError;\n\nexport const isAbortError = (error: unknown): error is DOMException =>\n error instanceof DOMException && error.name === 'AbortError';\n\nexport const isFetchClientError = (error: unknown): error is FetchClientError =>\n error instanceof TypeError || error instanceof SyntaxError || isApiError(error);\n\nconst createCoreFetch =\n (fetchFn: FetchFn): CoreFetchFn =>\n async ({ request, validateStatus }) => {\n const response = await fetchFn(request);\n const data = await parseData(response);\n\n const apiResponse = {\n request,\n response,\n data,\n };\n\n const boolOrError = validateStatus(apiResponse);\n if (isApiError(boolOrError)) throw boolOrError;\n if (!boolOrError) throw new ApiError(apiResponse);\n\n return apiResponse;\n };\n\nexport const createFetchClient = ({\n middlewares = [],\n ...defaultOptions\n}: CreateFetchClientOptions) => {\n const coreFetch = createCoreFetch(defaultOptions.fetchFn ?? fetch);\n const fetchWithMiddlewares = middlewares.reduceRight(\n (next, middleware) => middleware(next),\n coreFetch,\n );\n\n const createFetchMethod =\n (method: HttpMethod) =>\n async (url: string, params: BaseFetchParams, options: FetchClientOptions = {}) => {\n const request = createFetchRequest({\n url,\n method,\n params,\n defaultOptions,\n options,\n });\n\n const methodMiddlewares = options?.middlewares ?? [];\n\n return methodMiddlewares.reduceRight(\n (next, middleware) => middleware(next),\n fetchWithMiddlewares,\n )(request);\n };\n\n return {\n get: createFetchMethod('get'),\n post: createFetchMethod('post'),\n put: createFetchMethod('put'),\n patch: createFetchMethod('patch'),\n delete: createFetchMethod('delete'),\n };\n};\n","import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n","import type { GenericFetchClient } from '../telemetryClient';\n\nimport type { CreateCredentialsBody, WorkspaceData } from './types';\n\nexport const createProvisioning = (client: GenericFetchClient) => {\n const createCredentials = async (body: CreateCredentialsBody, signal?: AbortSignal) => {\n const { data } = await client.post<WorkspaceData, void, void, CreateCredentialsBody>(\n '/provisioning/workspace',\n { body },\n { signal },\n );\n\n return data;\n };\n\n return {\n createCredentials,\n };\n};\n","import { createGenericFetchClient } from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport { createProvisioning } from './provisioning/provisioning';\n\nexport type GenericFetchClient = ReturnType<typeof createGenericFetchClient>;\n\nexport const createTelemetryClient = ({ baseUrl, middlewares }: ClientInitOptions) => {\n const client = createGenericFetchClient({\n baseUrl,\n middlewares,\n });\n\n return {\n provisioning: createProvisioning(client),\n };\n};\n"]}
|
|
@@ -116,31 +116,6 @@ type paths = {
|
|
|
116
116
|
patch?: never;
|
|
117
117
|
trace?: never;
|
|
118
118
|
};
|
|
119
|
-
'/sql/sessions/{id}/workspace-password': {
|
|
120
|
-
parameters: {
|
|
121
|
-
query?: never;
|
|
122
|
-
header?: never;
|
|
123
|
-
path?: never;
|
|
124
|
-
cookie?: never;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Get workspace password for a SQL Editor session (deprecated)
|
|
128
|
-
* @description Retrieves the workspace username and password for a SQL Editor session from the sandboxes API.
|
|
129
|
-
* This endpoint is only available for Snowflake workspaces. For non-Snowflake workspaces,
|
|
130
|
-
* a 400 Bad Request error will be returned.
|
|
131
|
-
*
|
|
132
|
-
* **Important:** This operation is provided only for backward compatibility with legacy password-based workspaces
|
|
133
|
-
* until the support for password authentication is completely removed.
|
|
134
|
-
*/
|
|
135
|
-
get: operations['getSqlEditorSessionWorkspacePassword'];
|
|
136
|
-
put?: never;
|
|
137
|
-
post?: never;
|
|
138
|
-
delete?: never;
|
|
139
|
-
options?: never;
|
|
140
|
-
head?: never;
|
|
141
|
-
patch?: never;
|
|
142
|
-
trace?: never;
|
|
143
|
-
};
|
|
144
119
|
'/sql/sessions/{id}/load': {
|
|
145
120
|
parameters: {
|
|
146
121
|
query?: never;
|
|
@@ -200,7 +175,7 @@ type paths = {
|
|
|
200
175
|
* and updates the public key in the workspace. Returns both the private and public keys.
|
|
201
176
|
* The private key is generated in-memory only and is never stored.
|
|
202
177
|
*
|
|
203
|
-
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready' or '
|
|
178
|
+
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready', 'loading' or 'unloading' status.
|
|
204
179
|
*
|
|
205
180
|
* **Security Note:** The private key returned in the response must be securely stored by the client.
|
|
206
181
|
* It will not be available again after this request completes.
|
|
@@ -226,7 +201,7 @@ type paths = {
|
|
|
226
201
|
* @description Resets the password for a workspace session. For Snowflake workspaces, generates a new password
|
|
227
202
|
* via the Storage API and returns the username and password.
|
|
228
203
|
*
|
|
229
|
-
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready' or '
|
|
204
|
+
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready', 'loading' or 'unloading' status.
|
|
230
205
|
* **Important:** This operation is provided only for backward compatibility with legacy password-based workspaces
|
|
231
206
|
* until the support for password authentication is completely removed.
|
|
232
207
|
*/
|
|
@@ -386,7 +361,6 @@ type components = {
|
|
|
386
361
|
* @description Specifies the loading mode for the session:
|
|
387
362
|
* * `clean` - Creates a clean session (default)
|
|
388
363
|
* * `input` - Loads with input data (not yet implemented)
|
|
389
|
-
* @default clean
|
|
390
364
|
* @enum {string}
|
|
391
365
|
*/
|
|
392
366
|
loadMode: 'input' | 'clean';
|
|
@@ -422,8 +396,9 @@ type components = {
|
|
|
422
396
|
/**
|
|
423
397
|
* @description Current status of the session
|
|
424
398
|
* @example initializing
|
|
399
|
+
* @enum {string}
|
|
425
400
|
*/
|
|
426
|
-
status:
|
|
401
|
+
status: 'initializing' | 'ready' | 'loading' | 'unloading' | 'failed' | 'deleted';
|
|
427
402
|
/** @description ID of the user who created the session */
|
|
428
403
|
userId: string;
|
|
429
404
|
/** @description The ID of the branch this session belongs to */
|
|
@@ -434,8 +409,12 @@ type components = {
|
|
|
434
409
|
configurationId: string;
|
|
435
410
|
/** @description Schema name in the workspace */
|
|
436
411
|
workspaceSchema: string;
|
|
437
|
-
/**
|
|
438
|
-
|
|
412
|
+
/**
|
|
413
|
+
* @description Database name in the workspace. Null on BigQuery — BQ workspaces
|
|
414
|
+
* have no database tier (the GCP project id lives in workspace
|
|
415
|
+
* credentials, not as a database name).
|
|
416
|
+
*/
|
|
417
|
+
workspaceDatabase?: string | null;
|
|
439
418
|
/** @description ID of the associated workspace */
|
|
440
419
|
workspaceId: string;
|
|
441
420
|
/** @description ID of the job that is creating the workspace */
|
|
@@ -565,38 +544,6 @@ type components = {
|
|
|
565
544
|
*/
|
|
566
545
|
warehouse: string;
|
|
567
546
|
};
|
|
568
|
-
WorkspacePasswordResponse: {
|
|
569
|
-
/**
|
|
570
|
-
* @description Username for the Snowflake workspace from sandboxes API
|
|
571
|
-
* @example KEBOOLA_WORKSPACE_123456
|
|
572
|
-
*/
|
|
573
|
-
username: string;
|
|
574
|
-
/**
|
|
575
|
-
* @description Password for the Snowflake workspace from sandboxes API
|
|
576
|
-
* @example a1b2c3d4e5f6g7h8i9j0
|
|
577
|
-
*/
|
|
578
|
-
password: string;
|
|
579
|
-
/**
|
|
580
|
-
* @description Snowflake host/account identifier
|
|
581
|
-
* @example keboola.snowflakecomputing.com
|
|
582
|
-
*/
|
|
583
|
-
host: string;
|
|
584
|
-
/**
|
|
585
|
-
* @description Database name in Snowflake
|
|
586
|
-
* @example KEBOOLA_1234
|
|
587
|
-
*/
|
|
588
|
-
database: string;
|
|
589
|
-
/**
|
|
590
|
-
* @description Schema name in the workspace
|
|
591
|
-
* @example WORKSPACE_123456
|
|
592
|
-
*/
|
|
593
|
-
schema: string;
|
|
594
|
-
/**
|
|
595
|
-
* @description Snowflake warehouse name
|
|
596
|
-
* @example KEBOOLA_PROD
|
|
597
|
-
*/
|
|
598
|
-
warehouse: string;
|
|
599
|
-
};
|
|
600
547
|
ReloadSessionRequest: {
|
|
601
548
|
/**
|
|
602
549
|
* @description The mode to reload the session in. 'input' reloads input tables, 'clean' cleans the workspace.
|
|
@@ -634,7 +581,9 @@ type components = {
|
|
|
634
581
|
*/
|
|
635
582
|
tableName: string;
|
|
636
583
|
/**
|
|
637
|
-
* @description Name of the database containing the table (optional)
|
|
584
|
+
* @description Name of the database containing the table (optional). Ignored on
|
|
585
|
+
* BigQuery workspaces — a BQ session is bound to a single GCP project,
|
|
586
|
+
* so `dataset.table` is the only valid form.
|
|
638
587
|
* @example KEBOOLA_123
|
|
639
588
|
*/
|
|
640
589
|
databaseName?: string | null;
|
|
@@ -685,8 +634,14 @@ type components = {
|
|
|
685
634
|
databases: components['schemas']['Catalog'][];
|
|
686
635
|
};
|
|
687
636
|
Catalog: {
|
|
688
|
-
/**
|
|
689
|
-
|
|
637
|
+
/**
|
|
638
|
+
* @description Database identifier. On Snowflake this is the actual database name
|
|
639
|
+
* (own buckets land under the workspace's database; linked buckets
|
|
640
|
+
* surface under the source project's database). Null on BigQuery —
|
|
641
|
+
* BQ workspaces are bound to a single GCP project so there is no
|
|
642
|
+
* cross-project database tier to surface.
|
|
643
|
+
*/
|
|
644
|
+
name: string | null;
|
|
690
645
|
/** @description User-friendly name for the database (typically project name) */
|
|
691
646
|
displayName?: string | null;
|
|
692
647
|
/** @description List of schemas in the database */
|
|
@@ -695,6 +650,12 @@ type components = {
|
|
|
695
650
|
Schema: {
|
|
696
651
|
/** @description Schema name */
|
|
697
652
|
name: string;
|
|
653
|
+
/**
|
|
654
|
+
* @description True when this schema/bucket comes from the current development branch's storage rather than production.
|
|
655
|
+
* When projects have `protected-default-branch` or `storage-branches` features, the same logical bucket can
|
|
656
|
+
* appear twice.
|
|
657
|
+
*/
|
|
658
|
+
isBranched: boolean;
|
|
698
659
|
/** @description User-friendly name for the schema (typically bucket display name) */
|
|
699
660
|
displayName?: string | null;
|
|
700
661
|
/** @description List of tables in the schema */
|
|
@@ -804,6 +765,8 @@ type operations = {
|
|
|
804
765
|
query?: {
|
|
805
766
|
/** @description If set to "1", returns all sessions in the project. If omitted or set to "0", returns only sessions for the current user. */
|
|
806
767
|
listAll?: '0' | '1';
|
|
768
|
+
/** @description If provided, only sessions belonging to the given branch are returned. If omitted, sessions across all branches are returned. */
|
|
769
|
+
branchId?: string;
|
|
807
770
|
};
|
|
808
771
|
header?: never;
|
|
809
772
|
path?: never;
|
|
@@ -978,56 +941,6 @@ type operations = {
|
|
|
978
941
|
};
|
|
979
942
|
};
|
|
980
943
|
};
|
|
981
|
-
getSqlEditorSessionWorkspacePassword: {
|
|
982
|
-
parameters: {
|
|
983
|
-
query?: never;
|
|
984
|
-
header?: never;
|
|
985
|
-
path: {
|
|
986
|
-
/** @description SQL Editor session ID (UUID) */
|
|
987
|
-
id: string;
|
|
988
|
-
};
|
|
989
|
-
cookie?: never;
|
|
990
|
-
};
|
|
991
|
-
requestBody?: never;
|
|
992
|
-
responses: {
|
|
993
|
-
/** @description Workspace password retrieved successfully */
|
|
994
|
-
200: {
|
|
995
|
-
headers: {
|
|
996
|
-
[name: string]: unknown;
|
|
997
|
-
};
|
|
998
|
-
content: {
|
|
999
|
-
'application/json': components['schemas']['WorkspacePasswordResponse'];
|
|
1000
|
-
};
|
|
1001
|
-
};
|
|
1002
|
-
/** @description Bad request (non-Snowflake workspace) */
|
|
1003
|
-
400: {
|
|
1004
|
-
headers: {
|
|
1005
|
-
[name: string]: unknown;
|
|
1006
|
-
};
|
|
1007
|
-
content: {
|
|
1008
|
-
'application/json': components['schemas']['Error'];
|
|
1009
|
-
};
|
|
1010
|
-
};
|
|
1011
|
-
/** @description Session not found */
|
|
1012
|
-
404: {
|
|
1013
|
-
headers: {
|
|
1014
|
-
[name: string]: unknown;
|
|
1015
|
-
};
|
|
1016
|
-
content: {
|
|
1017
|
-
'application/json': components['schemas']['Error'];
|
|
1018
|
-
};
|
|
1019
|
-
};
|
|
1020
|
-
/** @description Error response */
|
|
1021
|
-
default: {
|
|
1022
|
-
headers: {
|
|
1023
|
-
[name: string]: unknown;
|
|
1024
|
-
};
|
|
1025
|
-
content: {
|
|
1026
|
-
'application/json': components['schemas']['Error'];
|
|
1027
|
-
};
|
|
1028
|
-
};
|
|
1029
|
-
};
|
|
1030
|
-
};
|
|
1031
944
|
loadSqlEditorSession: {
|
|
1032
945
|
parameters: {
|
|
1033
946
|
query?: never;
|
|
@@ -1453,10 +1366,12 @@ type operations = {
|
|
|
1453
1366
|
*/
|
|
1454
1367
|
schemaName: string;
|
|
1455
1368
|
/**
|
|
1456
|
-
* @description Name of the database containing the table
|
|
1369
|
+
* @description Name of the database containing the table. Ignored on BigQuery workspaces
|
|
1370
|
+
* (a BigQuery session is bound to a single GCP project, so `dataset.table`
|
|
1371
|
+
* is the only valid form).
|
|
1457
1372
|
* @example KEBOOLA_123
|
|
1458
1373
|
*/
|
|
1459
|
-
databaseName
|
|
1374
|
+
databaseName?: string | null;
|
|
1460
1375
|
};
|
|
1461
1376
|
header?: never;
|
|
1462
1377
|
path: {
|
|
@@ -2600,6 +2600,13 @@ type components = {
|
|
|
2600
2600
|
defaultFileStorageId?: number | null;
|
|
2601
2601
|
/** @description Zendesk URL for this maintainer. */
|
|
2602
2602
|
zendeskUrl?: string | null;
|
|
2603
|
+
/** @description Simplified list of organizations belonging to this maintainer. */
|
|
2604
|
+
organizations: {
|
|
2605
|
+
/** @description Organization identifier. */
|
|
2606
|
+
id: number;
|
|
2607
|
+
/** @description Organization name. */
|
|
2608
|
+
name: string;
|
|
2609
|
+
}[];
|
|
2603
2610
|
};
|
|
2604
2611
|
MaintainerInvitationDetailResponse: {
|
|
2605
2612
|
/** @description Invitation identifier. */
|
|
@@ -2640,6 +2647,8 @@ type components = {
|
|
|
2640
2647
|
activityCenterProjectId?: number | null;
|
|
2641
2648
|
/** @description Whether MFA is required. */
|
|
2642
2649
|
mfaRequired: boolean;
|
|
2650
|
+
/** @description Number of projects in this organization. */
|
|
2651
|
+
projectsCount: number;
|
|
2643
2652
|
};
|
|
2644
2653
|
MaintainerDetailResponse: components['schemas']['MaintainerResponse'] & {
|
|
2645
2654
|
/** @description List of organizations belonging to this maintainer. */
|
|
@@ -8399,6 +8408,10 @@ type MaintainerUser = {
|
|
|
8399
8408
|
id: number;
|
|
8400
8409
|
name: string;
|
|
8401
8410
|
email: string;
|
|
8411
|
+
mfaEnabled: boolean;
|
|
8412
|
+
features: string[];
|
|
8413
|
+
canAccessLogs: boolean;
|
|
8414
|
+
isSuperAdmin: boolean;
|
|
8402
8415
|
};
|
|
8403
8416
|
type MetadataItem = {
|
|
8404
8417
|
id: number;
|
|
@@ -8445,6 +8458,7 @@ type OrganizationProject = {
|
|
|
8445
8458
|
rowsCount: number;
|
|
8446
8459
|
defaultBackend: string;
|
|
8447
8460
|
isDisabled: boolean;
|
|
8461
|
+
usersCount: number;
|
|
8448
8462
|
};
|
|
8449
8463
|
type AdminUser = components['schemas']['UserResponse'];
|
|
8450
8464
|
|
|
@@ -8588,4 +8602,4 @@ type User = {
|
|
|
8588
8602
|
canApproveMergeRequests: boolean;
|
|
8589
8603
|
};
|
|
8590
8604
|
|
|
8591
|
-
export type { AddMaintainerUserBody as A, Maintainer as B, CreateMaintainerBody as C, MaintainerDetail as D, MaintainerInvitationDetail as E, Feature as F, GetAllFeaturesQuery as G,
|
|
8605
|
+
export type { AddMaintainerUserBody as A, Maintainer as B, CreateMaintainerBody as C, MaintainerDetail as D, MaintainerInvitationDetail as E, Feature as F, GetAllFeaturesQuery as G, Organization as H, OrganizationInvitationDetail as I, OrganizationListItem as J, OrganizationMaintainer as K, ListProjectUsersPath as L, MaintainerUser as M, OrganizationProject as N, OrganizationDetail as O, Project as P, ProjectMetadataInput as Q, RemoveProjectFeaturePath as R, SetMaintainerMetadataBody as S, UpdateMaintainerBody as U, CreateMaintainerInvitationBody as a, CreateMaintainerOrganizationBody as b, components as c, MetadataItem as d, UpdateOrganizationBody as e, AddOrganizationUserBody as f, CreateOrganizationInvitationBody as g, CreateOrganizationProjectBody as h, SetOrganizationMetadataBody as i, GetProjectPath as j, CreateProjectFeaturePath as k, CreateProjectFeatureBody as l, User as m, GetProjectMetadataPath as n, ProjectMetadataItem as o, SetProjectMetadataPath as p, SetProjectMetadataBody as q, GetProjectReviewersPath as r, Reviewer as s, SetProjectReviewersPath as t, SetProjectReviewersBody as u, AddUserFeatureBody as v, AddUserFeaturePath as w, RemoveUserFeaturePath as x, AdminUser as y, FeatureType as z };
|
|
@@ -2600,6 +2600,13 @@ type components = {
|
|
|
2600
2600
|
defaultFileStorageId?: number | null;
|
|
2601
2601
|
/** @description Zendesk URL for this maintainer. */
|
|
2602
2602
|
zendeskUrl?: string | null;
|
|
2603
|
+
/** @description Simplified list of organizations belonging to this maintainer. */
|
|
2604
|
+
organizations: {
|
|
2605
|
+
/** @description Organization identifier. */
|
|
2606
|
+
id: number;
|
|
2607
|
+
/** @description Organization name. */
|
|
2608
|
+
name: string;
|
|
2609
|
+
}[];
|
|
2603
2610
|
};
|
|
2604
2611
|
MaintainerInvitationDetailResponse: {
|
|
2605
2612
|
/** @description Invitation identifier. */
|
|
@@ -2640,6 +2647,8 @@ type components = {
|
|
|
2640
2647
|
activityCenterProjectId?: number | null;
|
|
2641
2648
|
/** @description Whether MFA is required. */
|
|
2642
2649
|
mfaRequired: boolean;
|
|
2650
|
+
/** @description Number of projects in this organization. */
|
|
2651
|
+
projectsCount: number;
|
|
2643
2652
|
};
|
|
2644
2653
|
MaintainerDetailResponse: components['schemas']['MaintainerResponse'] & {
|
|
2645
2654
|
/** @description List of organizations belonging to this maintainer. */
|
|
@@ -8399,6 +8408,10 @@ type MaintainerUser = {
|
|
|
8399
8408
|
id: number;
|
|
8400
8409
|
name: string;
|
|
8401
8410
|
email: string;
|
|
8411
|
+
mfaEnabled: boolean;
|
|
8412
|
+
features: string[];
|
|
8413
|
+
canAccessLogs: boolean;
|
|
8414
|
+
isSuperAdmin: boolean;
|
|
8402
8415
|
};
|
|
8403
8416
|
type MetadataItem = {
|
|
8404
8417
|
id: number;
|
|
@@ -8445,6 +8458,7 @@ type OrganizationProject = {
|
|
|
8445
8458
|
rowsCount: number;
|
|
8446
8459
|
defaultBackend: string;
|
|
8447
8460
|
isDisabled: boolean;
|
|
8461
|
+
usersCount: number;
|
|
8448
8462
|
};
|
|
8449
8463
|
type AdminUser = components['schemas']['UserResponse'];
|
|
8450
8464
|
|
|
@@ -8588,4 +8602,4 @@ type User = {
|
|
|
8588
8602
|
canApproveMergeRequests: boolean;
|
|
8589
8603
|
};
|
|
8590
8604
|
|
|
8591
|
-
export type { AddMaintainerUserBody as A, Maintainer as B, CreateMaintainerBody as C, MaintainerDetail as D, MaintainerInvitationDetail as E, Feature as F, GetAllFeaturesQuery as G,
|
|
8605
|
+
export type { AddMaintainerUserBody as A, Maintainer as B, CreateMaintainerBody as C, MaintainerDetail as D, MaintainerInvitationDetail as E, Feature as F, GetAllFeaturesQuery as G, Organization as H, OrganizationInvitationDetail as I, OrganizationListItem as J, OrganizationMaintainer as K, ListProjectUsersPath as L, MaintainerUser as M, OrganizationProject as N, OrganizationDetail as O, Project as P, ProjectMetadataInput as Q, RemoveProjectFeaturePath as R, SetMaintainerMetadataBody as S, UpdateMaintainerBody as U, CreateMaintainerInvitationBody as a, CreateMaintainerOrganizationBody as b, components as c, MetadataItem as d, UpdateOrganizationBody as e, AddOrganizationUserBody as f, CreateOrganizationInvitationBody as g, CreateOrganizationProjectBody as h, SetOrganizationMetadataBody as i, GetProjectPath as j, CreateProjectFeaturePath as k, CreateProjectFeatureBody as l, User as m, GetProjectMetadataPath as n, ProjectMetadataItem as o, SetProjectMetadataPath as p, SetProjectMetadataBody as q, GetProjectReviewersPath as r, Reviewer as s, SetProjectReviewersPath as t, SetProjectReviewersBody as u, AddUserFeatureBody as v, AddUserFeaturePath as w, RemoveUserFeaturePath as x, AdminUser as y, FeatureType as z };
|
|
@@ -116,31 +116,6 @@ type paths = {
|
|
|
116
116
|
patch?: never;
|
|
117
117
|
trace?: never;
|
|
118
118
|
};
|
|
119
|
-
'/sql/sessions/{id}/workspace-password': {
|
|
120
|
-
parameters: {
|
|
121
|
-
query?: never;
|
|
122
|
-
header?: never;
|
|
123
|
-
path?: never;
|
|
124
|
-
cookie?: never;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Get workspace password for a SQL Editor session (deprecated)
|
|
128
|
-
* @description Retrieves the workspace username and password for a SQL Editor session from the sandboxes API.
|
|
129
|
-
* This endpoint is only available for Snowflake workspaces. For non-Snowflake workspaces,
|
|
130
|
-
* a 400 Bad Request error will be returned.
|
|
131
|
-
*
|
|
132
|
-
* **Important:** This operation is provided only for backward compatibility with legacy password-based workspaces
|
|
133
|
-
* until the support for password authentication is completely removed.
|
|
134
|
-
*/
|
|
135
|
-
get: operations['getSqlEditorSessionWorkspacePassword'];
|
|
136
|
-
put?: never;
|
|
137
|
-
post?: never;
|
|
138
|
-
delete?: never;
|
|
139
|
-
options?: never;
|
|
140
|
-
head?: never;
|
|
141
|
-
patch?: never;
|
|
142
|
-
trace?: never;
|
|
143
|
-
};
|
|
144
119
|
'/sql/sessions/{id}/load': {
|
|
145
120
|
parameters: {
|
|
146
121
|
query?: never;
|
|
@@ -200,7 +175,7 @@ type paths = {
|
|
|
200
175
|
* and updates the public key in the workspace. Returns both the private and public keys.
|
|
201
176
|
* The private key is generated in-memory only and is never stored.
|
|
202
177
|
*
|
|
203
|
-
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready' or '
|
|
178
|
+
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready', 'loading' or 'unloading' status.
|
|
204
179
|
*
|
|
205
180
|
* **Security Note:** The private key returned in the response must be securely stored by the client.
|
|
206
181
|
* It will not be available again after this request completes.
|
|
@@ -226,7 +201,7 @@ type paths = {
|
|
|
226
201
|
* @description Resets the password for a workspace session. For Snowflake workspaces, generates a new password
|
|
227
202
|
* via the Storage API and returns the username and password.
|
|
228
203
|
*
|
|
229
|
-
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready' or '
|
|
204
|
+
* **Important:** This operation is only supported for Snowflake backend sessions in 'ready', 'loading' or 'unloading' status.
|
|
230
205
|
* **Important:** This operation is provided only for backward compatibility with legacy password-based workspaces
|
|
231
206
|
* until the support for password authentication is completely removed.
|
|
232
207
|
*/
|
|
@@ -386,7 +361,6 @@ type components = {
|
|
|
386
361
|
* @description Specifies the loading mode for the session:
|
|
387
362
|
* * `clean` - Creates a clean session (default)
|
|
388
363
|
* * `input` - Loads with input data (not yet implemented)
|
|
389
|
-
* @default clean
|
|
390
364
|
* @enum {string}
|
|
391
365
|
*/
|
|
392
366
|
loadMode: 'input' | 'clean';
|
|
@@ -422,8 +396,9 @@ type components = {
|
|
|
422
396
|
/**
|
|
423
397
|
* @description Current status of the session
|
|
424
398
|
* @example initializing
|
|
399
|
+
* @enum {string}
|
|
425
400
|
*/
|
|
426
|
-
status:
|
|
401
|
+
status: 'initializing' | 'ready' | 'loading' | 'unloading' | 'failed' | 'deleted';
|
|
427
402
|
/** @description ID of the user who created the session */
|
|
428
403
|
userId: string;
|
|
429
404
|
/** @description The ID of the branch this session belongs to */
|
|
@@ -434,8 +409,12 @@ type components = {
|
|
|
434
409
|
configurationId: string;
|
|
435
410
|
/** @description Schema name in the workspace */
|
|
436
411
|
workspaceSchema: string;
|
|
437
|
-
/**
|
|
438
|
-
|
|
412
|
+
/**
|
|
413
|
+
* @description Database name in the workspace. Null on BigQuery — BQ workspaces
|
|
414
|
+
* have no database tier (the GCP project id lives in workspace
|
|
415
|
+
* credentials, not as a database name).
|
|
416
|
+
*/
|
|
417
|
+
workspaceDatabase?: string | null;
|
|
439
418
|
/** @description ID of the associated workspace */
|
|
440
419
|
workspaceId: string;
|
|
441
420
|
/** @description ID of the job that is creating the workspace */
|
|
@@ -565,38 +544,6 @@ type components = {
|
|
|
565
544
|
*/
|
|
566
545
|
warehouse: string;
|
|
567
546
|
};
|
|
568
|
-
WorkspacePasswordResponse: {
|
|
569
|
-
/**
|
|
570
|
-
* @description Username for the Snowflake workspace from sandboxes API
|
|
571
|
-
* @example KEBOOLA_WORKSPACE_123456
|
|
572
|
-
*/
|
|
573
|
-
username: string;
|
|
574
|
-
/**
|
|
575
|
-
* @description Password for the Snowflake workspace from sandboxes API
|
|
576
|
-
* @example a1b2c3d4e5f6g7h8i9j0
|
|
577
|
-
*/
|
|
578
|
-
password: string;
|
|
579
|
-
/**
|
|
580
|
-
* @description Snowflake host/account identifier
|
|
581
|
-
* @example keboola.snowflakecomputing.com
|
|
582
|
-
*/
|
|
583
|
-
host: string;
|
|
584
|
-
/**
|
|
585
|
-
* @description Database name in Snowflake
|
|
586
|
-
* @example KEBOOLA_1234
|
|
587
|
-
*/
|
|
588
|
-
database: string;
|
|
589
|
-
/**
|
|
590
|
-
* @description Schema name in the workspace
|
|
591
|
-
* @example WORKSPACE_123456
|
|
592
|
-
*/
|
|
593
|
-
schema: string;
|
|
594
|
-
/**
|
|
595
|
-
* @description Snowflake warehouse name
|
|
596
|
-
* @example KEBOOLA_PROD
|
|
597
|
-
*/
|
|
598
|
-
warehouse: string;
|
|
599
|
-
};
|
|
600
547
|
ReloadSessionRequest: {
|
|
601
548
|
/**
|
|
602
549
|
* @description The mode to reload the session in. 'input' reloads input tables, 'clean' cleans the workspace.
|
|
@@ -634,7 +581,9 @@ type components = {
|
|
|
634
581
|
*/
|
|
635
582
|
tableName: string;
|
|
636
583
|
/**
|
|
637
|
-
* @description Name of the database containing the table (optional)
|
|
584
|
+
* @description Name of the database containing the table (optional). Ignored on
|
|
585
|
+
* BigQuery workspaces — a BQ session is bound to a single GCP project,
|
|
586
|
+
* so `dataset.table` is the only valid form.
|
|
638
587
|
* @example KEBOOLA_123
|
|
639
588
|
*/
|
|
640
589
|
databaseName?: string | null;
|
|
@@ -685,8 +634,14 @@ type components = {
|
|
|
685
634
|
databases: components['schemas']['Catalog'][];
|
|
686
635
|
};
|
|
687
636
|
Catalog: {
|
|
688
|
-
/**
|
|
689
|
-
|
|
637
|
+
/**
|
|
638
|
+
* @description Database identifier. On Snowflake this is the actual database name
|
|
639
|
+
* (own buckets land under the workspace's database; linked buckets
|
|
640
|
+
* surface under the source project's database). Null on BigQuery —
|
|
641
|
+
* BQ workspaces are bound to a single GCP project so there is no
|
|
642
|
+
* cross-project database tier to surface.
|
|
643
|
+
*/
|
|
644
|
+
name: string | null;
|
|
690
645
|
/** @description User-friendly name for the database (typically project name) */
|
|
691
646
|
displayName?: string | null;
|
|
692
647
|
/** @description List of schemas in the database */
|
|
@@ -695,6 +650,12 @@ type components = {
|
|
|
695
650
|
Schema: {
|
|
696
651
|
/** @description Schema name */
|
|
697
652
|
name: string;
|
|
653
|
+
/**
|
|
654
|
+
* @description True when this schema/bucket comes from the current development branch's storage rather than production.
|
|
655
|
+
* When projects have `protected-default-branch` or `storage-branches` features, the same logical bucket can
|
|
656
|
+
* appear twice.
|
|
657
|
+
*/
|
|
658
|
+
isBranched: boolean;
|
|
698
659
|
/** @description User-friendly name for the schema (typically bucket display name) */
|
|
699
660
|
displayName?: string | null;
|
|
700
661
|
/** @description List of tables in the schema */
|
|
@@ -804,6 +765,8 @@ type operations = {
|
|
|
804
765
|
query?: {
|
|
805
766
|
/** @description If set to "1", returns all sessions in the project. If omitted or set to "0", returns only sessions for the current user. */
|
|
806
767
|
listAll?: '0' | '1';
|
|
768
|
+
/** @description If provided, only sessions belonging to the given branch are returned. If omitted, sessions across all branches are returned. */
|
|
769
|
+
branchId?: string;
|
|
807
770
|
};
|
|
808
771
|
header?: never;
|
|
809
772
|
path?: never;
|
|
@@ -978,56 +941,6 @@ type operations = {
|
|
|
978
941
|
};
|
|
979
942
|
};
|
|
980
943
|
};
|
|
981
|
-
getSqlEditorSessionWorkspacePassword: {
|
|
982
|
-
parameters: {
|
|
983
|
-
query?: never;
|
|
984
|
-
header?: never;
|
|
985
|
-
path: {
|
|
986
|
-
/** @description SQL Editor session ID (UUID) */
|
|
987
|
-
id: string;
|
|
988
|
-
};
|
|
989
|
-
cookie?: never;
|
|
990
|
-
};
|
|
991
|
-
requestBody?: never;
|
|
992
|
-
responses: {
|
|
993
|
-
/** @description Workspace password retrieved successfully */
|
|
994
|
-
200: {
|
|
995
|
-
headers: {
|
|
996
|
-
[name: string]: unknown;
|
|
997
|
-
};
|
|
998
|
-
content: {
|
|
999
|
-
'application/json': components['schemas']['WorkspacePasswordResponse'];
|
|
1000
|
-
};
|
|
1001
|
-
};
|
|
1002
|
-
/** @description Bad request (non-Snowflake workspace) */
|
|
1003
|
-
400: {
|
|
1004
|
-
headers: {
|
|
1005
|
-
[name: string]: unknown;
|
|
1006
|
-
};
|
|
1007
|
-
content: {
|
|
1008
|
-
'application/json': components['schemas']['Error'];
|
|
1009
|
-
};
|
|
1010
|
-
};
|
|
1011
|
-
/** @description Session not found */
|
|
1012
|
-
404: {
|
|
1013
|
-
headers: {
|
|
1014
|
-
[name: string]: unknown;
|
|
1015
|
-
};
|
|
1016
|
-
content: {
|
|
1017
|
-
'application/json': components['schemas']['Error'];
|
|
1018
|
-
};
|
|
1019
|
-
};
|
|
1020
|
-
/** @description Error response */
|
|
1021
|
-
default: {
|
|
1022
|
-
headers: {
|
|
1023
|
-
[name: string]: unknown;
|
|
1024
|
-
};
|
|
1025
|
-
content: {
|
|
1026
|
-
'application/json': components['schemas']['Error'];
|
|
1027
|
-
};
|
|
1028
|
-
};
|
|
1029
|
-
};
|
|
1030
|
-
};
|
|
1031
944
|
loadSqlEditorSession: {
|
|
1032
945
|
parameters: {
|
|
1033
946
|
query?: never;
|
|
@@ -1453,10 +1366,12 @@ type operations = {
|
|
|
1453
1366
|
*/
|
|
1454
1367
|
schemaName: string;
|
|
1455
1368
|
/**
|
|
1456
|
-
* @description Name of the database containing the table
|
|
1369
|
+
* @description Name of the database containing the table. Ignored on BigQuery workspaces
|
|
1370
|
+
* (a BigQuery session is bound to a single GCP project, so `dataset.table`
|
|
1371
|
+
* is the only valid form).
|
|
1457
1372
|
* @example KEBOOLA_123
|
|
1458
1373
|
*/
|
|
1459
|
-
databaseName
|
|
1374
|
+
databaseName?: string | null;
|
|
1460
1375
|
};
|
|
1461
1376
|
header?: never;
|
|
1462
1377
|
path: {
|