@uipath/solution-tool
Advanced tools
| import { | ||
| getStudioWebAuth, | ||
| useStudioWebAuth | ||
| } from "./packager-tool-yktm4v4r.js"; | ||
| import { | ||
| getStudioWebSolutionProjects, | ||
| listStudioWebSolutions | ||
| } from "./packager-tool-bna6wzjx.js"; | ||
| import { | ||
| DEFAULT_PAGE_SIZE, | ||
| OutputFormatter, | ||
| Pagination, | ||
| RESULTS, | ||
| catchError, | ||
| parseBoundedInt, | ||
| parseOffset, | ||
| processContext | ||
| } from "./packager-tool-bcpknnr8.js"; | ||
| import"./packager-tool-9qecd4wb.js"; | ||
| import { | ||
| getFileSystem | ||
| } from "./packager-tool-7eva0peq.js"; | ||
| import"./packager-tool-5arsyj36.js"; | ||
| import"./packager-tool-129wn232.js"; | ||
| import"./packager-tool-0v6na3yp.js"; | ||
| // src/services/solution-list-service.ts | ||
| var fail = (message, instructions) => ({ | ||
| ok: false, | ||
| message, | ||
| instructions | ||
| }); | ||
| function toStudioWebConfig(auth) { | ||
| return { | ||
| baseUrl: auth.baseUrl, | ||
| authToken: auth.accessToken, | ||
| tenantId: auth.tenantId | ||
| }; | ||
| } | ||
| var SERVER_PAGE_LIMIT = 100; | ||
| async function listCloudSolutionsAsync(options) { | ||
| const limit = options.limit ?? DEFAULT_PAGE_SIZE; | ||
| const offset = options.offset ?? 0; | ||
| const organizationName = options.auth.organizationName; | ||
| if (!organizationName) { | ||
| return fail("Organization name is not available. Re-authenticate with 'uip login'.", "Run 'uip login' to refresh the login context and try again."); | ||
| } | ||
| const config = toStudioWebConfig(options.auth); | ||
| const collected = []; | ||
| let skip = 0; | ||
| let exhausted = false; | ||
| while (!exhausted && collected.length < offset + limit) { | ||
| const [listError, page] = await catchError(listStudioWebSolutions(config, organizationName, { | ||
| limit: SERVER_PAGE_LIMIT, | ||
| skip, | ||
| name: options.name, | ||
| sortBy: options.sortBy, | ||
| sortOrder: options.sortOrder === undefined ? undefined : options.sortOrder === "Ascending" ? "asc" : "desc" | ||
| })); | ||
| if (listError) { | ||
| return fail(listError.message, "Verify your login (uip login) and tenant access, then retry."); | ||
| } | ||
| collected.push(...page.solutions); | ||
| skip += page.combinedCount; | ||
| exhausted = page.combinedCount < SERVER_PAGE_LIMIT || page.totalCount !== undefined && skip >= page.totalCount; | ||
| } | ||
| return { | ||
| ok: true, | ||
| solutions: collected.slice(offset, offset + limit), | ||
| limit, | ||
| offset, | ||
| total: exhausted ? collected.length : undefined | ||
| }; | ||
| } | ||
| var SKIPPED_DIRECTORIES = new Set(["node_modules"]); | ||
| var MAX_SCAN_DEPTH = 16; | ||
| async function scanLocalSolutionsAsync(fs, rootDir) { | ||
| const root = fs.path.resolve(rootDir); | ||
| const [statError, rootStat] = await catchError(fs.stat(root)); | ||
| if (statError) { | ||
| return fail(`Cannot access ${root}: ${statError.message}`, "Check the path and its permissions, then try again."); | ||
| } | ||
| if (!rootStat?.isDirectory()) { | ||
| return fail(`Not a directory: ${root}`, "Pass an existing directory to --local (default: current directory)."); | ||
| } | ||
| const rows = []; | ||
| const skipped = []; | ||
| await scanDirectory(fs, root, root, 0, rows, skipped); | ||
| rows.sort((a, b) => a.Path === b.Path ? a.UipxFile.localeCompare(b.UipxFile) : a.Path.localeCompare(b.Path)); | ||
| return { ok: true, rows, skipped }; | ||
| } | ||
| async function scanDirectory(fs, root, dir, depth, rows, skipped) { | ||
| const relativeDir = fs.path.relative(root, dir) || "."; | ||
| if (depth > MAX_SCAN_DEPTH) { | ||
| skipped.push(`Skipped ${relativeDir}: deeper than ${MAX_SCAN_DEPTH} levels.`); | ||
| return; | ||
| } | ||
| const [readError, entries] = await catchError(fs.readdir(dir)); | ||
| if (readError) { | ||
| skipped.push(`Skipped ${relativeDir}: ${readError.message}.`); | ||
| return; | ||
| } | ||
| const manifests = entries.filter((entry) => entry.endsWith(".uipx")); | ||
| for (const manifest of manifests) { | ||
| rows.push(await buildLocalRow(fs, root, dir, manifest, manifests.length)); | ||
| } | ||
| for (const entry of entries) { | ||
| if (entry.startsWith(".") || SKIPPED_DIRECTORIES.has(entry)) { | ||
| continue; | ||
| } | ||
| const entryPath = fs.path.join(dir, entry); | ||
| const [statError, stat] = await catchError(fs.stat(entryPath)); | ||
| if (statError || !stat?.isDirectory()) { | ||
| continue; | ||
| } | ||
| await scanDirectory(fs, root, entryPath, depth + 1, rows, skipped); | ||
| } | ||
| } | ||
| async function buildLocalRow(fs, root, dir, manifest, manifestCountInDir) { | ||
| const name = manifest.slice(0, -".uipx".length); | ||
| const relativeDir = fs.path.relative(root, dir); | ||
| const warnings = []; | ||
| if (manifestCountInDir > 1) { | ||
| warnings.push(`Directory contains ${manifestCountInDir} .uipx manifests; commands like 'uip solution pack' pick one arbitrarily — remove the stale ones.`); | ||
| } | ||
| const dirName = fs.path.basename(dir); | ||
| if (name !== dirName) { | ||
| warnings.push(`Manifest filename '${manifest}' does not match its directory name '${dirName}'.`); | ||
| } | ||
| const row = { | ||
| Path: relativeDir === "" ? "." : relativeDir, | ||
| Name: name, | ||
| UipxFile: manifest, | ||
| Warnings: warnings | ||
| }; | ||
| const manifestPath = fs.path.join(dir, manifest); | ||
| const [readError, content] = await catchError(fs.readFile(manifestPath, "utf-8")); | ||
| if (readError || !content) { | ||
| warnings.push(`Could not read ${manifest}: ${readError?.message ?? "file is empty"}.`); | ||
| return row; | ||
| } | ||
| const [parseError, parsed] = catchError(() => JSON.parse(content)); | ||
| if (parseError || typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { | ||
| warnings.push(`Could not parse ${manifest}: not a valid JSON object.`); | ||
| return row; | ||
| } | ||
| const record = parsed; | ||
| if (typeof record.SolutionId === "string" && record.SolutionId.trim()) { | ||
| row.SolutionId = record.SolutionId; | ||
| } else { | ||
| warnings.push(`${manifest} has no SolutionId.`); | ||
| } | ||
| if (Array.isArray(record.Projects)) { | ||
| row.ProjectCount = record.Projects.length; | ||
| } else { | ||
| warnings.push(`${manifest} has no Projects array.`); | ||
| } | ||
| return row; | ||
| } | ||
| var CLOUD_PROBE_CONCURRENCY = 8; | ||
| async function annotateCloudStatusAsync(rows, auth) { | ||
| const organizationName = auth.organizationName; | ||
| if (!organizationName) { | ||
| return fail("Organization name is not available. Re-authenticate with 'uip login'.", "Run 'uip login' to refresh the login context and try again."); | ||
| } | ||
| const config = toStudioWebConfig(auth); | ||
| const queue = [...rows]; | ||
| const workers = Array.from({ length: Math.min(CLOUD_PROBE_CONCURRENCY, queue.length) }, async () => { | ||
| for (let row = queue.shift();row; row = queue.shift()) { | ||
| await probeCloudStatusAsync(row, config, organizationName); | ||
| } | ||
| }); | ||
| await Promise.all(workers); | ||
| return; | ||
| } | ||
| async function probeCloudStatusAsync(row, config, organizationName) { | ||
| if (!row.SolutionId) { | ||
| row.CloudStatus = "Unknown"; | ||
| return; | ||
| } | ||
| const [probeError, projects] = await catchError(getStudioWebSolutionProjects(config, organizationName, row.SolutionId)); | ||
| if (probeError) { | ||
| row.CloudStatus = "Unknown"; | ||
| row.Warnings.push(`Cloud check failed: ${probeError.message}`); | ||
| return; | ||
| } | ||
| if (projects === undefined) { | ||
| row.CloudStatus = "NotFound"; | ||
| return; | ||
| } | ||
| row.CloudStatus = "OK"; | ||
| row.CloudProjectCount = projects.length; | ||
| } | ||
| // src/commands/list.ts | ||
| var SOLUTION_LIST_EXAMPLES = [ | ||
| { | ||
| Description: "List the Studio Web solutions you own or that are shared with you (IDs pipe into 'solution download' and 'solution delete')", | ||
| Command: "uip solution list --limit 2", | ||
| Output: { | ||
| Code: "SolutionsList", | ||
| Data: [ | ||
| { | ||
| Id: "a1b2c3d4-0000-0000-0000-000000000001", | ||
| Name: "Examples", | ||
| LastModifiedTime: "2025-04-15T10:30:00Z", | ||
| PublishStatus: "draft", | ||
| Projects: [] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| Description: "List the local solutions under a directory tree by scanning for .uipx manifests", | ||
| Command: "uip solution list --local ./workspace", | ||
| Output: { | ||
| Code: "LocalSolutionsList", | ||
| Data: [ | ||
| { | ||
| Path: "Examples", | ||
| Name: "Examples", | ||
| UipxFile: "Examples.uipx", | ||
| SolutionId: "a1b2c3d4-0000-0000-0000-000000000001", | ||
| ProjectCount: 2, | ||
| Warnings: [] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| Description: "Scan local solutions and check whether each SolutionId still exists on Studio Web", | ||
| Command: "uip solution list --local ./workspace --check-cloud", | ||
| Output: { | ||
| Code: "LocalSolutionsList", | ||
| Data: [ | ||
| { | ||
| Path: "SolutionA", | ||
| Name: "SolutionA", | ||
| UipxFile: "SolutionA.uipx", | ||
| SolutionId: "0dbafff0-0000-0000-0000-000000000368", | ||
| ProjectCount: 1, | ||
| Warnings: [], | ||
| CloudStatus: "NotFound" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ]; | ||
| var CLOUD_ONLY_OPTIONS = [ | ||
| "limit", | ||
| "offset", | ||
| "name", | ||
| "sortBy", | ||
| "sortOrder" | ||
| ]; | ||
| var STUDIO_WEB_SOLUTIONS_PAGE_LIMIT = 100; | ||
| function parseStudioWebSolutionsLimit(raw) { | ||
| return parseBoundedInt(raw, "--limit", { | ||
| min: 1, | ||
| max: STUDIO_WEB_SOLUTIONS_PAGE_LIMIT | ||
| }); | ||
| } | ||
| var registerListCommand = (program) => { | ||
| const command = program.previewCommand("list").description("List solutions. By default lists the Studio Web solutions you own or that are shared with you — the SolutionIds it returns are the ones 'solution download' and 'solution delete' take. With --local, scans a directory tree for local solutions (.uipx manifests) and flags stale or ambiguous manifests. Add --check-cloud to also resolve each local SolutionId against Studio Web and report whether it can still be reached (OK / NotFound).").option("-l, --limit <number>", "Maximum solutions to return, between 1 and 100 (cloud mode)", parseStudioWebSolutionsLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of solutions to skip (cloud mode)", parseOffset, 0).option("--name <pattern>", "Filter solutions by name (cloud mode; server-side keyword match)").option("--sort-by <column>", "Column to sort by (cloud mode; server default order when omitted)").option("--sort-order <direction>", "Sort direction: Ascending or Descending (cloud mode)").option("--local [directory]", "List local solutions by scanning this directory tree (default: current directory) instead of Studio Web").option("--check-cloud", "With --local: check each local SolutionId against Studio Web and report OK / NotFound. Implies --local.").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).examples(SOLUTION_LIST_EXAMPLES); | ||
| useStudioWebAuth(command, { | ||
| requireOrganizationName: true, | ||
| shouldResolve: (_thisCommand, actionCommand) => needsStudioWebAuth(actionCommand.opts()) | ||
| }).trackedAction(processContext, async (options, actionCommand) => { | ||
| const localMode = options.local !== undefined || options.checkCloud === true; | ||
| if (localMode) { | ||
| const misused = CLOUD_ONLY_OPTIONS.filter((key) => actionCommand.getOptionValueSource(key) === "cli"); | ||
| if (misused.length > 0) { | ||
| outputError(`The ${misused.map(optionFlag).join(", ")} option only applies to the cloud listing.`, "Drop the option, or remove --local/--check-cloud to list Studio Web solutions."); | ||
| return; | ||
| } | ||
| await runLocalList(options, actionCommand); | ||
| return; | ||
| } | ||
| await runCloudList(options, actionCommand); | ||
| }); | ||
| }; | ||
| function needsStudioWebAuth(options) { | ||
| return options.local === undefined || options.checkCloud === true; | ||
| } | ||
| async function runCloudList(options, actionCommand) { | ||
| const sortOrder = normalizeSortOrder(options.sortOrder); | ||
| if (options.sortOrder !== undefined && sortOrder === undefined) { | ||
| outputError(`Invalid --sort-order value: ${options.sortOrder}.`, "Use 'Ascending' or 'Descending'."); | ||
| return; | ||
| } | ||
| const auth = resolveAuth(actionCommand); | ||
| if (!auth) { | ||
| return; | ||
| } | ||
| const result = await listCloudSolutionsAsync({ | ||
| auth, | ||
| limit: options.limit, | ||
| offset: options.offset, | ||
| name: options.name, | ||
| sortBy: options.sortBy, | ||
| sortOrder | ||
| }); | ||
| if (!result.ok) { | ||
| outputError(result.message, result.instructions); | ||
| return; | ||
| } | ||
| OutputFormatter.success({ | ||
| Result: RESULTS.Success, | ||
| Code: "SolutionsList", | ||
| Data: result.solutions, | ||
| Pagination: new Pagination({ | ||
| returned: result.solutions.length, | ||
| limit: result.limit, | ||
| offset: result.offset, | ||
| total: result.total | ||
| }) | ||
| }); | ||
| } | ||
| async function runLocalList(options, actionCommand) { | ||
| const fs = getFileSystem(); | ||
| const rootDir = typeof options.local === "string" ? options.local : "."; | ||
| const scan = await scanLocalSolutionsAsync(fs, rootDir); | ||
| if (!scan.ok) { | ||
| outputError(scan.message, scan.instructions); | ||
| return; | ||
| } | ||
| if (options.checkCloud) { | ||
| const auth = resolveAuth(actionCommand); | ||
| if (!auth) { | ||
| return; | ||
| } | ||
| const failure = await annotateCloudStatusAsync(scan.rows, auth); | ||
| if (failure) { | ||
| outputError(failure.message, failure.instructions); | ||
| return; | ||
| } | ||
| } | ||
| OutputFormatter.success({ | ||
| Result: RESULTS.Success, | ||
| Code: "LocalSolutionsList", | ||
| Data: scan.rows, | ||
| Instructions: scan.skipped.length > 0 ? scan.skipped.join(" ") : undefined | ||
| }); | ||
| } | ||
| function resolveAuth(actionCommand) { | ||
| const [authError, auth] = catchError(() => getStudioWebAuth(actionCommand)); | ||
| if (authError) { | ||
| outputError(authError.message, "Run 'uip login' to authenticate and try again."); | ||
| return; | ||
| } | ||
| return auth; | ||
| } | ||
| function normalizeSortOrder(direction) { | ||
| switch (direction?.toLowerCase()) { | ||
| case "ascending": | ||
| return "Ascending"; | ||
| case "descending": | ||
| return "Descending"; | ||
| default: | ||
| return; | ||
| } | ||
| } | ||
| function optionFlag(key) { | ||
| return `--${key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`; | ||
| } | ||
| function outputError(message, instructions) { | ||
| OutputFormatter.error({ | ||
| Result: RESULTS.Failure, | ||
| Message: message, | ||
| Instructions: instructions | ||
| }); | ||
| processContext.exit(1); | ||
| } | ||
| export { | ||
| registerListCommand | ||
| }; | ||
| //# debugId=F86E269BD92740C164756E2164756E21 |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
| import { | ||
| getAvailablePublishLocationsV2 | ||
| } from "./packager-tool-bna6wzjx.js"; | ||
| import { | ||
| PersonalWorkspacesApi, | ||
| createOrchestratorConfig | ||
| } from "./packager-tool-fzwxq48d.js"; | ||
| import { | ||
| getLoginStatusAsync, | ||
| getSdkUserAgentToken, | ||
| installSdkUserAgentHeader | ||
| } from "./packager-tool-bcpknnr8.js"; | ||
| // ../pipelines-sdk/generated/src/runtime.ts | ||
| var BASE_PATH = "https://alpha.uipath.com/uipattycyrhx/abizon_1/automationsolutions_".replace(/\/+$/, ""); | ||
| class Configuration { | ||
| configuration; | ||
| constructor(configuration = {}) { | ||
| this.configuration = configuration; | ||
| } | ||
| set config(configuration) { | ||
| this.configuration = configuration; | ||
| } | ||
| get basePath() { | ||
| return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; | ||
| } | ||
| get fetchApi() { | ||
| return this.configuration.fetchApi; | ||
| } | ||
| get middleware() { | ||
| return this.configuration.middleware || []; | ||
| } | ||
| get queryParamsStringify() { | ||
| return this.configuration.queryParamsStringify || querystring; | ||
| } | ||
| get username() { | ||
| return this.configuration.username; | ||
| } | ||
| get password() { | ||
| return this.configuration.password; | ||
| } | ||
| get apiKey() { | ||
| const apiKey = this.configuration.apiKey; | ||
| if (apiKey) { | ||
| return typeof apiKey === "function" ? apiKey : () => apiKey; | ||
| } | ||
| return; | ||
| } | ||
| get accessToken() { | ||
| const accessToken = this.configuration.accessToken; | ||
| if (accessToken) { | ||
| return typeof accessToken === "function" ? accessToken : async () => accessToken; | ||
| } | ||
| return; | ||
| } | ||
| get headers() { | ||
| return this.configuration.headers; | ||
| } | ||
| get credentials() { | ||
| return this.configuration.credentials; | ||
| } | ||
| } | ||
| var DefaultConfig = new Configuration; | ||
| class BaseAPI { | ||
| configuration; | ||
| static jsonRegex = new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", "i"); | ||
| middleware; | ||
| constructor(configuration = DefaultConfig) { | ||
| this.configuration = configuration; | ||
| this.middleware = configuration.middleware; | ||
| } | ||
| withMiddleware(...middlewares) { | ||
| const next = this.clone(); | ||
| next.middleware = next.middleware.concat(...middlewares); | ||
| return next; | ||
| } | ||
| withPreMiddleware(...preMiddlewares) { | ||
| const middlewares = preMiddlewares.map((pre) => ({ pre })); | ||
| return this.withMiddleware(...middlewares); | ||
| } | ||
| withPostMiddleware(...postMiddlewares) { | ||
| const middlewares = postMiddlewares.map((post) => ({ post })); | ||
| return this.withMiddleware(...middlewares); | ||
| } | ||
| isJsonMime(mime) { | ||
| if (!mime) { | ||
| return false; | ||
| } | ||
| return BaseAPI.jsonRegex.test(mime); | ||
| } | ||
| async request(context, initOverrides) { | ||
| const { url, init } = await this.createFetchParams(context, initOverrides); | ||
| const response = await this.fetchApi(url, init); | ||
| if (response && (response.status >= 200 && response.status < 300)) { | ||
| return response; | ||
| } | ||
| throw new ResponseError(response, "Response returned an error code"); | ||
| } | ||
| async createFetchParams(context, initOverrides) { | ||
| let url = this.configuration.basePath + context.path; | ||
| if (context.query !== undefined && Object.keys(context.query).length !== 0) { | ||
| url += "?" + this.configuration.queryParamsStringify(context.query); | ||
| } | ||
| const headers = Object.assign({}, this.configuration.headers, context.headers); | ||
| Object.keys(headers).forEach((key) => headers[key] === undefined ? delete headers[key] : {}); | ||
| const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides; | ||
| const initParams = { | ||
| method: context.method, | ||
| headers, | ||
| body: context.body, | ||
| credentials: this.configuration.credentials | ||
| }; | ||
| const overriddenInit = { | ||
| ...initParams, | ||
| ...await initOverrideFn({ | ||
| init: initParams, | ||
| context | ||
| }) | ||
| }; | ||
| let body; | ||
| if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) { | ||
| body = overriddenInit.body; | ||
| } else if (this.isJsonMime(headers["Content-Type"])) { | ||
| body = JSON.stringify(overriddenInit.body); | ||
| } else { | ||
| body = overriddenInit.body; | ||
| } | ||
| const init = { | ||
| ...overriddenInit, | ||
| body | ||
| }; | ||
| return { url, init }; | ||
| } | ||
| fetchApi = async (url, init) => { | ||
| let fetchParams = { url, init }; | ||
| for (const middleware of this.middleware) { | ||
| if (middleware.pre) { | ||
| fetchParams = await middleware.pre({ | ||
| fetch: this.fetchApi, | ||
| ...fetchParams | ||
| }) || fetchParams; | ||
| } | ||
| } | ||
| let response = undefined; | ||
| try { | ||
| response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); | ||
| } catch (e) { | ||
| for (const middleware of this.middleware) { | ||
| if (middleware.onError) { | ||
| response = await middleware.onError({ | ||
| fetch: this.fetchApi, | ||
| url: fetchParams.url, | ||
| init: fetchParams.init, | ||
| error: e, | ||
| response: response ? response.clone() : undefined | ||
| }) || response; | ||
| } | ||
| } | ||
| if (response === undefined) { | ||
| if (e instanceof Error) { | ||
| throw new FetchError(e, "The request failed and the interceptors did not return an alternative response"); | ||
| } else { | ||
| throw e; | ||
| } | ||
| } | ||
| } | ||
| for (const middleware of this.middleware) { | ||
| if (middleware.post) { | ||
| response = await middleware.post({ | ||
| fetch: this.fetchApi, | ||
| url: fetchParams.url, | ||
| init: fetchParams.init, | ||
| response: response.clone() | ||
| }) || response; | ||
| } | ||
| } | ||
| return response; | ||
| }; | ||
| clone() { | ||
| const constructor = this.constructor; | ||
| const next = new constructor(this.configuration); | ||
| next.middleware = this.middleware.slice(); | ||
| return next; | ||
| } | ||
| } | ||
| function isBlob(value) { | ||
| return typeof Blob !== "undefined" && value instanceof Blob; | ||
| } | ||
| function isFormData(value) { | ||
| return typeof FormData !== "undefined" && value instanceof FormData; | ||
| } | ||
| class ResponseError extends Error { | ||
| response; | ||
| name = "ResponseError"; | ||
| constructor(response, msg) { | ||
| super(msg); | ||
| this.response = response; | ||
| } | ||
| } | ||
| class FetchError extends Error { | ||
| cause; | ||
| name = "FetchError"; | ||
| constructor(cause, msg) { | ||
| super(msg); | ||
| this.cause = cause; | ||
| } | ||
| } | ||
| class RequiredError extends Error { | ||
| field; | ||
| name = "RequiredError"; | ||
| constructor(field, msg) { | ||
| super(msg); | ||
| this.field = field; | ||
| } | ||
| } | ||
| function querystring(params, prefix = "") { | ||
| return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&"); | ||
| } | ||
| function querystringSingleKey(key, value, keyPrefix = "") { | ||
| const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); | ||
| if (value instanceof Array) { | ||
| const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`); | ||
| return `${encodeURIComponent(fullKey)}=${multiValue}`; | ||
| } | ||
| if (value instanceof Set) { | ||
| const valueAsArray = Array.from(value); | ||
| return querystringSingleKey(key, valueAsArray, keyPrefix); | ||
| } | ||
| if (value instanceof Date) { | ||
| return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; | ||
| } | ||
| if (value instanceof Object) { | ||
| return querystring(value, fullKey); | ||
| } | ||
| return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; | ||
| } | ||
| class JSONApiResponse { | ||
| raw; | ||
| transformer; | ||
| constructor(raw, transformer = (jsonValue) => jsonValue) { | ||
| this.raw = raw; | ||
| this.transformer = transformer; | ||
| } | ||
| async value() { | ||
| return this.transformer(await this.raw.json()); | ||
| } | ||
| } | ||
| class VoidApiResponse { | ||
| raw; | ||
| constructor(raw) { | ||
| this.raw = raw; | ||
| } | ||
| async value() { | ||
| return; | ||
| } | ||
| } | ||
| class BlobApiResponse { | ||
| raw; | ||
| constructor(raw) { | ||
| this.raw = raw; | ||
| } | ||
| async value() { | ||
| return await this.raw.blob(); | ||
| } | ||
| } | ||
| class TextApiResponse { | ||
| raw; | ||
| constructor(raw) { | ||
| this.raw = raw; | ||
| } | ||
| async value() { | ||
| return await this.raw.text(); | ||
| } | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/BaseResourceIdentifier.ts | ||
| function BaseResourceIdentifierFromJSON(json) { | ||
| return BaseResourceIdentifierFromJSONTyped(json, false); | ||
| } | ||
| function BaseResourceIdentifierFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"], | ||
| key: json["key"], | ||
| type: json["type"] == null ? undefined : json["type"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResponseDictionaryDto.ts | ||
| function ResponseDictionaryDtoFromJSON(json) { | ||
| return ResponseDictionaryDtoFromJSONTyped(json, false); | ||
| } | ||
| function ResponseDictionaryDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| keys: json["keys"] == null ? undefined : json["keys"], | ||
| values: json["values"] == null ? undefined : json["values"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/BlobFileAccessDto.ts | ||
| function BlobFileAccessDtoFromJSON(json) { | ||
| return BlobFileAccessDtoFromJSONTyped(json, false); | ||
| } | ||
| function BlobFileAccessDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| uri: json["uri"], | ||
| verb: json["verb"], | ||
| headers: json["headers"] == null ? undefined : ResponseDictionaryDtoFromJSON(json["headers"]) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentActivateResponse.ts | ||
| function DeploymentActivateResponseFromJSON(json) { | ||
| return DeploymentActivateResponseFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentActivateResponseFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| instanceId: json["instanceId"] == null ? undefined : json["instanceId"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentOperation.ts | ||
| function DeploymentOperationFromJSON(json) { | ||
| return DeploymentOperationFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentOperationFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentOperationStatus.ts | ||
| function DeploymentOperationStatusFromJSON(json) { | ||
| return DeploymentOperationStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentOperationStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentPreActivateStepDto.ts | ||
| function DeploymentPreActivateStepDtoFromJSON(json) { | ||
| return DeploymentPreActivateStepDtoFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentPreActivateStepDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| serviceName: json["serviceName"], | ||
| step: json["step"], | ||
| description: json["description"], | ||
| link: json["link"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentPreActivateStepsDto.ts | ||
| function DeploymentPreActivateStepsDtoFromJSON(json) { | ||
| return DeploymentPreActivateStepsDtoFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentPreActivateStepsDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| steps: json["steps"].map(DeploymentPreActivateStepDtoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentResourceValidationAction.ts | ||
| function DeploymentResourceValidationActionFromJSON(json) { | ||
| return DeploymentResourceValidationActionFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentResourceValidationActionFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ServiceMessage.ts | ||
| function ServiceMessageFromJSON(json) { | ||
| return ServiceMessageFromJSONTyped(json, false); | ||
| } | ||
| function ServiceMessageFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| resource: json["resource"], | ||
| text: json["text"], | ||
| parameters: json["parameters"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentRunResponse.ts | ||
| function DeploymentRunResponseFromJSON(json) { | ||
| return DeploymentRunResponseFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentRunResponseFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| instanceId: json["instanceId"] == null ? undefined : json["instanceId"], | ||
| scheduled: json["scheduled"], | ||
| errors: json["errors"].map(ServiceMessageFromJSON), | ||
| complete: json["complete"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResourceInstallError.ts | ||
| function ResourceInstallErrorFromJSON(json) { | ||
| return ResourceInstallErrorFromJSONTyped(json, false); | ||
| } | ||
| function ResourceInstallErrorFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"] == null ? undefined : json["kind"], | ||
| type: json["type"] == null ? undefined : json["type"], | ||
| key: json["key"] == null ? undefined : json["key"], | ||
| folderKey: json["folderKey"] == null ? undefined : json["folderKey"], | ||
| name: json["name"] == null ? undefined : json["name"], | ||
| text: json["text"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentStatus.ts | ||
| function DeploymentStatusFromJSON(json) { | ||
| return DeploymentStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentRunServiceStatus.ts | ||
| function DeploymentRunServiceStatusFromJSON(json) { | ||
| return DeploymentRunServiceStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentRunServiceStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| serviceName: json["serviceName"], | ||
| status: DeploymentStatusFromJSON(json["status"]), | ||
| updateDate: json["updateDate"] == null ? undefined : new Date(json["updateDate"]), | ||
| serviceErrorMessages: json["serviceErrorMessages"].map(ResourceInstallErrorFromJSON), | ||
| errorMessage: json["errorMessage"] == null ? undefined : json["errorMessage"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/WorkflowAction.ts | ||
| function WorkflowActionFromJSON(json) { | ||
| return WorkflowActionFromJSONTyped(json, false); | ||
| } | ||
| function WorkflowActionFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/WorkflowError.ts | ||
| function WorkflowErrorFromJSON(json) { | ||
| return WorkflowErrorFromJSONTyped(json, false); | ||
| } | ||
| function WorkflowErrorFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| errorMessage: json["errorMessage"], | ||
| serviceMessage: json["serviceMessage"] == null ? undefined : json["serviceMessage"], | ||
| exceptionTrace: json["exceptionTrace"] == null ? undefined : json["exceptionTrace"], | ||
| serviceName: json["serviceName"] == null ? undefined : json["serviceName"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionOrigin.ts | ||
| function PackageVersionOriginFromJSON(json) { | ||
| return PackageVersionOriginFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionOriginFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentRunStatus.ts | ||
| function DeploymentRunStatusFromJSON(json) { | ||
| return DeploymentRunStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentRunStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| deploymentKey: json["deploymentKey"], | ||
| installDeploymentKey: json["installDeploymentKey"], | ||
| deploymentName: json["deploymentName"], | ||
| configurationKey: json["configurationKey"], | ||
| installedRootFolderKey: json["installedRootFolderKey"] == null ? undefined : json["installedRootFolderKey"], | ||
| packageName: json["packageName"], | ||
| packageVersion: json["packageVersion"], | ||
| packageVersionOrigin: PackageVersionOriginFromJSON(json["packageVersionOrigin"]), | ||
| packageVersionKey: json["packageVersionKey"], | ||
| status: DeploymentStatusFromJSON(json["status"]), | ||
| authorName: json["authorName"], | ||
| startDate: new Date(json["startDate"]), | ||
| endDate: json["endDate"] == null ? undefined : new Date(json["endDate"]), | ||
| errorMessage: json["errorMessage"] == null ? undefined : json["errorMessage"].map(WorkflowErrorFromJSON), | ||
| actions: json["actions"].map(WorkflowActionFromJSON), | ||
| operation: DeploymentOperationFromJSON(json["operation"]), | ||
| services: json["services"].map(DeploymentRunServiceStatusFromJSON), | ||
| supportsAutomaticActivation: json["supportsAutomaticActivation"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentScheduleErrorDto.ts | ||
| function DeploymentScheduleErrorDtoFromJSON(json) { | ||
| return DeploymentScheduleErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentScheduleErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| errorText: json["errorText"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentValidationErrorType.ts | ||
| function DeploymentValidationErrorTypeFromJSON(json) { | ||
| return DeploymentValidationErrorTypeFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentValidationErrorTypeFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ExtendedPackageVersionState.ts | ||
| function ExtendedPackageVersionStateFromJSON(json) { | ||
| return ExtendedPackageVersionStateFromJSONTyped(json, false); | ||
| } | ||
| function ExtendedPackageVersionStateFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/FolderInfo.ts | ||
| function FolderInfoFromJSON(json) { | ||
| return FolderInfoFromJSONTyped(json, false); | ||
| } | ||
| function FolderInfoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| fullyQualifiedName: json["fullyQualifiedName"], | ||
| path: json["path"] == null ? undefined : json["path"], | ||
| folderKey: json["folderKey"] == null ? undefined : json["folderKey"], | ||
| serviceFolderKey: json["serviceFolderKey"] == null ? undefined : json["serviceFolderKey"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResourceTaskStatus.ts | ||
| function ResourceTaskStatusFromJSON(json) { | ||
| return ResourceTaskStatusFromJSONTyped(json, false); | ||
| } | ||
| function ResourceTaskStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackagePublishResult.ts | ||
| function PackagePublishResultFromJSON(json) { | ||
| return PackagePublishResultFromJSONTyped(json, false); | ||
| } | ||
| function PackagePublishResultFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| status: ResourceTaskStatusFromJSON(json["status"]), | ||
| packageName: json["packageName"], | ||
| packageVersionKey: json["packageVersionKey"] == null ? undefined : json["packageVersionKey"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResourceStats.ts | ||
| function ResourceStatsFromJSON(json) { | ||
| return ResourceStatsFromJSONTyped(json, false); | ||
| } | ||
| function ResourceStatsFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| count: json["count"], | ||
| kind: json["kind"], | ||
| serviceName: json["serviceName"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionResourceDto.ts | ||
| function PackageVersionResourceDtoFromJSON(json) { | ||
| return PackageVersionResourceDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionResourceDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| key: json["key"], | ||
| name: json["name"], | ||
| kind: json["kind"], | ||
| type: json["type"] == null ? undefined : json["type"], | ||
| apiVersion: json["apiVersion"], | ||
| folders: json["folders"].map(FolderInfoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionComponentsDto.ts | ||
| function PackageVersionComponentsDtoFromJSON(json) { | ||
| return PackageVersionComponentsDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionComponentsDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| count: json["count"], | ||
| resources: json["resources"].map(PackageVersionResourceDtoFromJSON), | ||
| stats: json["stats"].map(ResourceStatsFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionInfoDto.ts | ||
| function PackageVersionInfoDtoFromJSON(json) { | ||
| return PackageVersionInfoDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionInfoDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| key: json["key"], | ||
| packageName: json["packageName"], | ||
| packageVersion: json["packageVersion"], | ||
| publishDate: new Date(json["publishDate"]), | ||
| authorName: json["authorName"], | ||
| authorEmail: json["authorEmail"] == null ? undefined : json["authorEmail"], | ||
| description: json["description"] == null ? undefined : json["description"], | ||
| releaseNotes: json["releaseNotes"] == null ? undefined : json["releaseNotes"], | ||
| state: ExtendedPackageVersionStateFromJSON(json["state"]), | ||
| solutionRootFolderName: json["solutionRootFolderName"], | ||
| locationKey: json["locationKey"] == null ? undefined : json["locationKey"], | ||
| components: json["components"] == null ? undefined : PackageVersionComponentsDtoFromJSON(json["components"]) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionInfoExtendedDto.ts | ||
| function PackageVersionInfoExtendedDtoFromJSON(json) { | ||
| return PackageVersionInfoExtendedDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionInfoExtendedDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| key: json["key"], | ||
| packageName: json["packageName"], | ||
| packageVersion: json["packageVersion"], | ||
| publishDate: new Date(json["publishDate"]), | ||
| authorName: json["authorName"], | ||
| authorEmail: json["authorEmail"] == null ? undefined : json["authorEmail"], | ||
| description: json["description"] == null ? undefined : json["description"], | ||
| releaseNotes: json["releaseNotes"] == null ? undefined : json["releaseNotes"], | ||
| state: ExtendedPackageVersionStateFromJSON(json["state"]), | ||
| solutionRootFolderName: json["solutionRootFolderName"], | ||
| locationKey: json["locationKey"] == null ? undefined : json["locationKey"], | ||
| components: json["components"] == null ? undefined : PackageVersionComponentsDtoFromJSON(json["components"]), | ||
| lastOperation: DeploymentOperationFromJSON(json["lastOperation"]), | ||
| lastOperationStatus: DeploymentOperationStatusFromJSON(json["lastOperationStatus"]), | ||
| lastOperationInstanceId: json["lastOperationInstanceId"] == null ? undefined : json["lastOperationInstanceId"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentConflictErrorDto.ts | ||
| function PipelineDeploymentConflictErrorDtoFromJSON(json) { | ||
| return PipelineDeploymentConflictErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentConflictErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"], | ||
| name: json["name"], | ||
| resourceKey: json["resourceKey"], | ||
| errorType: json["errorType"] == null ? undefined : DeploymentValidationErrorTypeFromJSON(json["errorType"]), | ||
| errorText: json["errorText"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"], | ||
| conflictFixingActions: json["conflictFixingActions"].map(DeploymentResourceValidationActionFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentValidationErrorDto.ts | ||
| function PipelineDeploymentValidationErrorDtoFromJSON(json) { | ||
| return PipelineDeploymentValidationErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentValidationErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"], | ||
| name: json["name"], | ||
| resourceKey: json["resourceKey"], | ||
| errorType: json["errorType"] == null ? undefined : DeploymentValidationErrorTypeFromJSON(json["errorType"]), | ||
| errorText: json["errorText"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentValidationResultDto.ts | ||
| function PipelineDeploymentValidationResultDtoFromJSON(json) { | ||
| return PipelineDeploymentValidationResultDtoFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentValidationResultDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| success: json["success"] == null ? undefined : json["success"], | ||
| validationErrors: json["validationErrors"].map(PipelineDeploymentValidationErrorDtoFromJSON), | ||
| conflictErrors: json["conflictErrors"].map(PipelineDeploymentConflictErrorDtoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentStatus.ts | ||
| function PipelineDeploymentStatusFromJSON(json) { | ||
| return PipelineDeploymentStatusFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentResult.ts | ||
| function PipelineDeploymentResultFromJSON(json) { | ||
| return PipelineDeploymentResultFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentResultFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| status: PipelineDeploymentStatusFromJSON(json["status"]), | ||
| validationResult: PipelineDeploymentValidationResultDtoFromJSON(json["validationResult"]), | ||
| deploymentResult: json["deploymentResult"] == null ? undefined : DeploymentRunStatusFromJSON(json["deploymentResult"]), | ||
| deploymentKey: json["deploymentKey"], | ||
| configurationKey: json["configurationKey"], | ||
| instanceId: json["instanceId"] == null ? undefined : json["instanceId"], | ||
| conflictFixingErrors: json["conflictFixingErrors"].map(PipelineDeploymentValidationErrorDtoFromJSON), | ||
| deploymentScheduleErrors: json["deploymentScheduleErrors"].map(DeploymentScheduleErrorDtoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentResultRef.ts | ||
| function PipelineDeploymentResultRefFromJSON(json) { | ||
| return PipelineDeploymentResultRefFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentResultRefFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| pipelineDeploymentId: json["pipelineDeploymentId"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SolutionProjectSyncStatus.ts | ||
| function SolutionProjectSyncStatusFromJSON(json) { | ||
| return SolutionProjectSyncStatusFromJSONTyped(json, false); | ||
| } | ||
| function SolutionProjectSyncStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SolutionProjectSyncErrorDto.ts | ||
| function SolutionProjectSyncErrorDtoFromJSON(json) { | ||
| return SolutionProjectSyncErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function SolutionProjectSyncErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| serviceName: json["serviceName"], | ||
| resourceIdentifiers: json["resourceIdentifiers"].map(BaseResourceIdentifierFromJSON), | ||
| errorMessage: json["errorMessage"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ProjectSynchronizationDto.ts | ||
| function ProjectSynchronizationDtoFromJSON(json) { | ||
| return ProjectSynchronizationDtoFromJSONTyped(json, false); | ||
| } | ||
| function ProjectSynchronizationDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| projectName: json["projectName"], | ||
| syncErrors: json["syncErrors"].map(SolutionProjectSyncErrorDtoFromJSON), | ||
| status: SolutionProjectSyncStatusFromJSON(json["status"]) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PublishProjectRequest.ts | ||
| function PublishProjectRequestToJSON(json) { | ||
| return PublishProjectRequestToJSONTyped(json, false); | ||
| } | ||
| function PublishProjectRequestToJSONTyped(value, ignoreDiscriminator = false) { | ||
| if (value == null) { | ||
| return value; | ||
| } | ||
| return { | ||
| packageName: value["packageName"], | ||
| packageVersion: value["packageVersion"], | ||
| description: value["description"], | ||
| releaseNotes: value["releaseNotes"], | ||
| solutionRootFolderName: value["solutionRootFolderName"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SyncOption.ts | ||
| function SyncOptionToJSON(value) { | ||
| return value; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SyncProjectOptions.ts | ||
| function SyncProjectOptionsToJSON(json) { | ||
| return SyncProjectOptionsToJSONTyped(json, false); | ||
| } | ||
| function SyncProjectOptionsToJSONTyped(value, ignoreDiscriminator = false) { | ||
| if (value == null) { | ||
| return value; | ||
| } | ||
| return { | ||
| syncOption: SyncOptionToJSON(value["syncOption"]), | ||
| autoRemoveDeletedResources: value["autoRemoveDeletedResources"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/apis/PipelinesApi.ts | ||
| class PipelinesApi extends BaseAPI { | ||
| async pipelinesActivateRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesActivate().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/activate`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentActivateResponseFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesActivate(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesActivateRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetDeploymentInstanceStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["instanceId"] == null) { | ||
| throw new RequiredError("instanceId", 'Required parameter "instanceId" was null or undefined when calling pipelinesGetDeploymentInstanceStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{instanceId}/status`; | ||
| urlPath = urlPath.replace(`{${"instanceId"}}`, encodeURIComponent(String(requestParameters["instanceId"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentRunStatusFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetDeploymentInstanceStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetDeploymentInstanceStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPackagePublishStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesGetPackagePublishStatus().'); | ||
| } | ||
| if (requestParameters["packageVersion"] == null) { | ||
| throw new RequiredError("packageVersion", 'Required parameter "packageVersion" was null or undefined when calling pipelinesGetPackagePublishStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/publish-status/{packageVersion}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"packageVersion"}}`, encodeURIComponent(String(requestParameters["packageVersion"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PackagePublishResultFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPackagePublishStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPackagePublishStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPackageVersionRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesGetPackageVersion().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["packageVersion"] != null) { | ||
| queryParameters["packageVersion"] = requestParameters["packageVersion"]; | ||
| } | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PackageVersionInfoExtendedDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPackageVersion(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPackageVersionRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPipelineDeploymentStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["pipelineDeploymentId"] == null) { | ||
| throw new RequiredError("pipelineDeploymentId", 'Required parameter "pipelineDeploymentId" was null or undefined when calling pipelinesGetPipelineDeploymentStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{pipelineDeploymentId}/deployment-status`; | ||
| urlPath = urlPath.replace(`{${"pipelineDeploymentId"}}`, encodeURIComponent(String(requestParameters["pipelineDeploymentId"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PipelineDeploymentResultFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPipelineDeploymentStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPipelineDeploymentStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPreActivateStepsRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesGetPreActivateSteps().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/pre-activate-steps`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentPreActivateStepsDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPreActivateSteps(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPreActivateStepsRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetProjectSyncStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["projectName"] == null) { | ||
| throw new RequiredError("projectName", 'Required parameter "projectName" was null or undefined when calling pipelinesGetProjectSyncStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/projects/{projectName}/sync-status`; | ||
| urlPath = urlPath.replace(`{${"projectName"}}`, encodeURIComponent(String(requestParameters["projectName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => ProjectSynchronizationDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetProjectSyncStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetProjectSyncStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetSolutionPackageConfigurationRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesGetSolutionPackageConfiguration().'); | ||
| } | ||
| if (requestParameters["format"] == null) { | ||
| throw new RequiredError("format", 'Required parameter "format" was null or undefined when calling pipelinesGetSolutionPackageConfiguration().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["packageVersion"] != null) { | ||
| queryParameters["packageVersion"] = requestParameters["packageVersion"]; | ||
| } | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/config.{format}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"format"}}`, encodeURIComponent(String(requestParameters["format"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| if (this.isJsonMime(response.headers.get("content-type"))) { | ||
| return new JSONApiResponse(response); | ||
| } else { | ||
| return new TextApiResponse(response); | ||
| } | ||
| } | ||
| async pipelinesGetSolutionPackageConfiguration(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetSolutionPackageConfigurationRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesInstallRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| if (requestParameters["packageVersion"] == null) { | ||
| throw new RequiredError("packageVersion", 'Required parameter "packageVersion" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| if (requestParameters["solutionRootFolderName"] == null) { | ||
| throw new RequiredError("solutionRootFolderName", 'Required parameter "solutionRootFolderName" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["folderFullyQualifiedName"] != null) { | ||
| queryParameters["folderFullyQualifiedName"] = requestParameters["folderFullyQualifiedName"]; | ||
| } | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/json"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/deploy-from-package/{packageName}/{packageVersion}/to-folder/{solutionRootFolderName}`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"packageVersion"}}`, encodeURIComponent(String(requestParameters["packageVersion"]))); | ||
| urlPath = urlPath.replace(`{${"solutionRootFolderName"}}`, encodeURIComponent(String(requestParameters["solutionRootFolderName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: requestParameters["body"] | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PipelineDeploymentResultRefFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesInstall(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesInstallRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesPackageDeleteRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesPackageDelete().'); | ||
| } | ||
| if (requestParameters["packageVersion"] == null) { | ||
| throw new RequiredError("packageVersion", 'Required parameter "packageVersion" was null or undefined when calling pipelinesPackageDelete().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/{packageVersion}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"packageVersion"}}`, encodeURIComponent(String(requestParameters["packageVersion"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "DELETE", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new VoidApiResponse(response); | ||
| } | ||
| async pipelinesPackageDelete(requestParameters, initOverrides) { | ||
| await this.pipelinesPackageDeleteRaw(requestParameters, initOverrides); | ||
| } | ||
| async pipelinesPackageDownloadRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesPackageDownload().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["packageVersion"] != null) { | ||
| queryParameters["packageVersion"] = requestParameters["packageVersion"]; | ||
| } | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/download`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => BlobFileAccessDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesPackageDownload(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesPackageDownloadRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesPackageUploadRaw(requestParameters, initOverrides) { | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/zip"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages`; | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: requestParameters["body"] | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PackageVersionInfoDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesPackageUpload(requestParameters = {}, initOverrides) { | ||
| const response = await this.pipelinesPackageUploadRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesPublishProjectRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["projectName"] == null) { | ||
| throw new RequiredError("projectName", 'Required parameter "projectName" was null or undefined when calling pipelinesPublishProject().'); | ||
| } | ||
| if (requestParameters["publishProjectRequest"] == null) { | ||
| throw new RequiredError("publishProjectRequest", 'Required parameter "publishProjectRequest" was null or undefined when calling pipelinesPublishProject().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/json"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/projects/{projectName}/publish`; | ||
| urlPath = urlPath.replace(`{${"projectName"}}`, encodeURIComponent(String(requestParameters["projectName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: PublishProjectRequestToJSON(requestParameters["publishProjectRequest"]) | ||
| }, initOverrides); | ||
| return new BlobApiResponse(response); | ||
| } | ||
| async pipelinesPublishProject(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesPublishProjectRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesSyncProjectRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["projectName"] == null) { | ||
| throw new RequiredError("projectName", 'Required parameter "projectName" was null or undefined when calling pipelinesSyncProject().'); | ||
| } | ||
| if (requestParameters["syncProjectOptions"] == null) { | ||
| throw new RequiredError("syncProjectOptions", 'Required parameter "syncProjectOptions" was null or undefined when calling pipelinesSyncProject().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/json"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/projects/{projectName}/sync`; | ||
| urlPath = urlPath.replace(`{${"projectName"}}`, encodeURIComponent(String(requestParameters["projectName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: SyncProjectOptionsToJSON(requestParameters["syncProjectOptions"]) | ||
| }, initOverrides); | ||
| return new BlobApiResponse(response); | ||
| } | ||
| async pipelinesSyncProject(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesSyncProjectRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesUninstallRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesUninstall().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/uninstall`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentRunResponseFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesUninstall(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesUninstallRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| } | ||
| // ../pipelines-sdk/package.json | ||
| var package_default = { | ||
| name: "@uipath/pipelines-sdk", | ||
| license: "MIT", | ||
| version: "1.201.0", | ||
| description: "Generated TypeScript client for UiPath Pipelines API (CI/CD deployment lifecycle)", | ||
| repository: { | ||
| type: "git", | ||
| url: "https://github.com/UiPath/cli.git", | ||
| directory: "packages/pipelines-sdk" | ||
| }, | ||
| publishConfig: { | ||
| registry: "https://npm.pkg.github.com/@uipath" | ||
| }, | ||
| keywords: [ | ||
| "uipath", | ||
| "pipelines", | ||
| "sdk" | ||
| ], | ||
| type: "module", | ||
| main: "./dist/index.js", | ||
| types: "./dist/src/index.d.ts", | ||
| exports: { | ||
| ".": { | ||
| types: "./dist/src/index.d.ts", | ||
| default: "./dist/index.js" | ||
| } | ||
| }, | ||
| bin: { | ||
| "generate-pipelines-sdk": "./dist/scripts/generate-sdk.js" | ||
| }, | ||
| files: [ | ||
| "dist" | ||
| ], | ||
| private: true, | ||
| scripts: { | ||
| build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && bun build ./src/scripts/generate-sdk.ts --outdir dist/scripts --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck", | ||
| generate: "bun run src/scripts/generate-sdk.ts", | ||
| lint: "biome check .", | ||
| test: "vitest run", | ||
| "test:coverage": "vitest run --coverage" | ||
| }, | ||
| devDependencies: { | ||
| "@openapitools/openapi-generator-cli": "^2.31.1", | ||
| "@types/node": "^25.5.2", | ||
| "@uipath/common": "workspace:*", | ||
| typescript: "^7.0.2" | ||
| } | ||
| }; | ||
| // ../pipelines-sdk/src/user-agent.ts | ||
| var SDK_USER_AGENT = getSdkUserAgentToken(package_default); | ||
| installSdkUserAgentHeader(BaseAPI, SDK_USER_AGENT); | ||
| // src/services/personal-workspace-resolver.ts | ||
| async function resolvePersonalWorkspace(options) { | ||
| const config = await createOrchestratorConfig(options); | ||
| const api = new PersonalWorkspacesApi(config); | ||
| const pw = await api.personalWorkspacesGetPersonalWorkspace(); | ||
| if (!pw?.key || !pw.name) { | ||
| throw new Error("Personal Workspace not configured for the current user. " + "Enable Personal Workspace in Orchestrator (or sign in as a user that has one), then retry."); | ||
| } | ||
| return { key: pw.key, name: pw.name }; | ||
| } | ||
| // src/services/publish-locations-service.ts | ||
| async function resolveStudioWebTarget(options) { | ||
| const loginStatus = await getLoginStatusAsync({ | ||
| ensureTokenValidityMinutes: options?.loginValidity, | ||
| envFilePath: options?.envFilePath | ||
| }); | ||
| if (loginStatus.loginStatus !== "Logged in" || !loginStatus.accessToken || !loginStatus.baseUrl) { | ||
| throw new Error("Not logged in. Run 'uip login' first."); | ||
| } | ||
| if (!loginStatus.organizationName) { | ||
| throw new Error("Organization name is not available. Re-authenticate with 'uip login'."); | ||
| } | ||
| if (options?.tenant && loginStatus.tenantName && options.tenant.toLowerCase() !== loginStatus.tenantName.toLowerCase()) { | ||
| throw new Error(`Feeds are resolved for the logged-in tenant ('${loginStatus.tenantName}'), so --tenant '${options.tenant}' can't apply here. Switch tenants first with: uip login tenant set ${options.tenant}.`); | ||
| } | ||
| return { | ||
| config: { | ||
| baseUrl: loginStatus.baseUrl, | ||
| authToken: loginStatus.accessToken, | ||
| tenantId: loginStatus.tenantId | ||
| }, | ||
| organizationName: loginStatus.organizationName | ||
| }; | ||
| } | ||
| function isSelectableFeed(location) { | ||
| switch (location.type) { | ||
| case "Tenant": | ||
| case "Folder": | ||
| return true; | ||
| case "PersonalWorkspace": | ||
| return location.isMyPersonalWorkspace; | ||
| default: | ||
| return false; | ||
| } | ||
| } | ||
| async function listSelectablePublishLocations(options) { | ||
| const { config, organizationName } = await resolveStudioWebTarget(options); | ||
| const all = await getAvailablePublishLocationsV2(config, organizationName); | ||
| return all.filter(isSelectableFeed); | ||
| } | ||
| // src/services/feed-resolver.ts | ||
| function folderKeyInitOverride(folderKey) { | ||
| return async ({ init }) => ({ | ||
| headers: { ...init.headers, "X-UIPATH-FolderKey": folderKey } | ||
| }); | ||
| } | ||
| function feedScopeInitOverride(scope) { | ||
| const { folderKey } = scope; | ||
| if (!folderKey) { | ||
| return; | ||
| } | ||
| return folderKeyInitOverride(folderKey); | ||
| } | ||
| function feedResolutionFailureInstructions(options) { | ||
| if (options.personalWorkspace) { | ||
| return "Personal Workspace resolution needs an interactive user session and an enabled Personal Workspace. Log in as a user with a Personal Workspace, or omit --personal-workspace to use the tenant feed."; | ||
| } | ||
| if (options.feed !== undefined) { | ||
| return "List the feeds you can target with: uip solution feeds list."; | ||
| } | ||
| return "Check the selected feed and try again."; | ||
| } | ||
| async function resolveFeedScope(options) { | ||
| const { personalWorkspace, feed } = options; | ||
| if (personalWorkspace && feed !== undefined) { | ||
| throw new Error("Use either --personal-workspace or --feed, not both."); | ||
| } | ||
| if (personalWorkspace) { | ||
| const pw = await resolvePersonalWorkspace({ | ||
| tenant: options.tenant, | ||
| loginValidity: options.loginValidity, | ||
| envFilePath: options.envFilePath | ||
| }); | ||
| return { kind: "personal", folderKey: pw.key, name: pw.name }; | ||
| } | ||
| if (feed !== undefined) { | ||
| return resolveNamedFeed(feed, options); | ||
| } | ||
| return { kind: "tenant" }; | ||
| } | ||
| async function resolveNamedFeed(feed, options) { | ||
| const locations = await listSelectablePublishLocations({ | ||
| tenant: options.tenant, | ||
| envFilePath: options.envFilePath, | ||
| loginValidity: options.loginValidity | ||
| }); | ||
| const match = matchFeed(feed, locations); | ||
| const kind = match.type === "Tenant" ? "tenant" : match.type === "PersonalWorkspace" ? "personal" : "folder"; | ||
| if (kind !== "tenant" && !match.key) { | ||
| throw new Error(`Feed '${match.name || feed}' has no folder key in the publish-locations response, so it can't be targeted. Run 'uip solution feeds list' and pick a feed with a Key.`); | ||
| } | ||
| return { | ||
| kind, | ||
| folderKey: kind === "tenant" ? undefined : match.key, | ||
| name: match.name | ||
| }; | ||
| } | ||
| function matchFeed(feed, locations) { | ||
| const byKey = locations.find((location) => location.key === feed); | ||
| if (byKey) { | ||
| return byKey; | ||
| } | ||
| const target = feed.toLowerCase(); | ||
| const byName = locations.filter((location) => location.name.toLowerCase() === target); | ||
| if (byName.length === 1) { | ||
| return byName[0]; | ||
| } | ||
| if (byName.length > 1) { | ||
| throw new Error(`More than one feed is named '${feed}'. Pass its key instead — ` + "'uip solution feeds list' shows each feed's key."); | ||
| } | ||
| throw new Error(`Feed '${feed}' is not an available publish location. ` + "Run 'uip solution feeds list' to see the feeds you can publish to."); | ||
| } | ||
| export { Configuration, PipelinesApi, resolvePersonalWorkspace, listSelectablePublishLocations, folderKeyInitOverride, feedScopeInitOverride, feedResolutionFailureInstructions, resolveFeedScope }; | ||
| //# debugId=4D61A5C05C04282A64756E2164756E21 |
Sorry, the diff of this file is too big to display
| import { | ||
| Configuration, | ||
| PipelinesApi, | ||
| resolveFeedScope | ||
| } from "./packager-tool-dmms4my7.js"; | ||
| import { | ||
| Configuration as Configuration2, | ||
| PackagesApi | ||
| } from "./packager-tool-bna6wzjx.js"; | ||
| import { | ||
| getSolutionAuthContext | ||
| } from "./packager-tool-fzwxq48d.js"; | ||
| import { | ||
| PollOutcome, | ||
| catchError, | ||
| extractErrorDetails, | ||
| logger, | ||
| mapPollFailure, | ||
| pollUntil | ||
| } from "./packager-tool-bcpknnr8.js"; | ||
| import { | ||
| getFileSystem | ||
| } from "./packager-tool-7eva0peq.js"; | ||
| import { | ||
| strFromU8, | ||
| strToU8, | ||
| unzipSync, | ||
| zipSync | ||
| } from "./packager-tool-129wn232.js"; | ||
| // src/services/package-metadata-rewrite.ts | ||
| import { randomUUID } from "node:crypto"; | ||
| var SOLUTION_METADATA_ENTRY = "solutionMetadata.json"; | ||
| function isRecord(value) { | ||
| return typeof value === "object" && value !== null && !Array.isArray(value); | ||
| } | ||
| var requireValue = (value, flag) => { | ||
| const trimmed = value.trim(); | ||
| if (!trimmed) { | ||
| throw new Error(`${flag} cannot be empty.`); | ||
| } | ||
| return trimmed; | ||
| }; | ||
| function rewritePackageMetadata(archive, overrides) { | ||
| const entries = unzipSync(archive); | ||
| const metadataBytes = entries[SOLUTION_METADATA_ENTRY]; | ||
| if (!metadataBytes) { | ||
| throw new Error(`Package archive has no ${SOLUTION_METADATA_ENTRY} at its root, so its name and version cannot be rewritten. Only a .zip produced by 'uip solution pack' carries that file.`); | ||
| } | ||
| let parsed; | ||
| try { | ||
| parsed = JSON.parse(strFromU8(metadataBytes)); | ||
| } catch (err) { | ||
| throw new Error(`${SOLUTION_METADATA_ENTRY} in the package archive is not valid JSON: ${err instanceof Error ? err.message : String(err)}`); | ||
| } | ||
| if (!isRecord(parsed) || !isRecord(parsed.spec)) { | ||
| throw new Error(`${SOLUTION_METADATA_ENTRY} in the package archive has no 'spec' object, so its name and version cannot be rewritten.`); | ||
| } | ||
| const spec = parsed.spec; | ||
| const packageName = overrides.packageName === undefined ? String(spec.packageName ?? "") : requireValue(overrides.packageName, "--package-name"); | ||
| const packageVersion = overrides.packageVersion === undefined ? String(spec.packageVersion ?? "") : requireValue(overrides.packageVersion, "--package-version"); | ||
| const packageVersionKey = randomUUID(); | ||
| const rewritten = { | ||
| ...parsed, | ||
| spec: { ...spec, packageName, packageVersion, packageVersionKey } | ||
| }; | ||
| const zipInput = {}; | ||
| for (const [entryName, entryBytes] of Object.entries(entries)) { | ||
| const level = entryName.toLowerCase().endsWith(".nupkg") ? 0 : 6; | ||
| zipInput[entryName] = [entryBytes, { level }]; | ||
| } | ||
| zipInput[SOLUTION_METADATA_ENTRY] = [ | ||
| strToU8(JSON.stringify(rewritten)), | ||
| { level: 6 } | ||
| ]; | ||
| return { | ||
| archive: zipSync(zipInput), | ||
| packageName, | ||
| packageVersion, | ||
| packageVersionKey | ||
| }; | ||
| } | ||
| // src/services/publish-service.ts | ||
| var TERMINAL_STATES = new Set([ | ||
| "Ready", | ||
| "Active", | ||
| "Failed" | ||
| ]); | ||
| var VERSION_CONFLICT_PATTERNS = [ | ||
| /\balready exists\b/i, | ||
| /\bduplicate\b.*\bversion\b/i, | ||
| /\bversion\b.*\bduplicate\b/i, | ||
| /\bpackage[-\s]?version\b.*\bexists\b/i, | ||
| /\bversion[-\s]?exists\b/i, | ||
| /\bversion\b.*\balready exists\b/i | ||
| ]; | ||
| var isVersionConflictError = (message, details) => { | ||
| const errorText = `${message} ${details ?? ""}`; | ||
| return VERSION_CONFLICT_PATTERNS.some((pattern) => pattern.test(errorText)); | ||
| }; | ||
| var HTTP_STATUS_PATTERNS = [ | ||
| /^HTTP\s+(\d{3})(?::|\s|-|$)/i, | ||
| /["']httpStatus["']\s*:\s*(\d{3})\b/i, | ||
| /["']statusCode["']\s*:\s*(\d{3})\b/i, | ||
| /["']status["']\s*:\s*(\d{3})\b/i, | ||
| /\bhttpStatus\s*[:=]\s*(\d{3})\b/i, | ||
| /\bstatusCode\s*[:=]\s*(\d{3})\b/i | ||
| ]; | ||
| var ERROR_CODE_PATTERNS = [ | ||
| /["']errorCode["']\s*:\s*["']([^"']+)["']/i, | ||
| /["']errorCode["']\s*:\s*(\d+)\b/i, | ||
| /\berrorCode\s*[:=]\s*["']?([A-Za-z0-9_.-]+)["']?/i, | ||
| /["']code["']\s*:\s*["']([^"']+)["']/i, | ||
| /["']code["']\s*:\s*(\d+)\b/i | ||
| ]; | ||
| function extractFirstPatternValue(text, patterns) { | ||
| if (!text) | ||
| return; | ||
| for (const pattern of patterns) { | ||
| const match = pattern.exec(text); | ||
| if (match?.[1]) | ||
| return match[1]; | ||
| } | ||
| return; | ||
| } | ||
| function extractUploadHttpStatus(message, details) { | ||
| const rawStatus = extractFirstPatternValue(message, HTTP_STATUS_PATTERNS) ?? extractFirstPatternValue(details, HTTP_STATUS_PATTERNS); | ||
| if (!rawStatus) | ||
| return; | ||
| const status = Number(rawStatus); | ||
| return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined; | ||
| } | ||
| function extractUploadErrorCode(message, details) { | ||
| return extractFirstPatternValue(details, ERROR_CODE_PATTERNS) ?? extractFirstPatternValue(message, ERROR_CODE_PATTERNS); | ||
| } | ||
| function retryHintForUploadStatus(httpStatus) { | ||
| if (httpStatus === 400 || httpStatus === 409 || httpStatus === 422) { | ||
| return "RetryWillNotFix"; | ||
| } | ||
| if (httpStatus === 408 || httpStatus === 429 || httpStatus !== undefined && httpStatus >= 500 && httpStatus < 600) { | ||
| return "RetryLater"; | ||
| } | ||
| return; | ||
| } | ||
| function mergeUploadErrorContext(context, httpStatus, errorCode) { | ||
| if (!context && httpStatus === undefined && errorCode === undefined) { | ||
| return; | ||
| } | ||
| return { | ||
| ...context ?? {}, | ||
| ...httpStatus !== undefined ? { httpStatus } : {}, | ||
| ...errorCode !== undefined ? { errorCode } : {} | ||
| }; | ||
| } | ||
| async function publishSolutionAsync(packagePath, options = {}) { | ||
| const [authError, auth] = await catchError(getSolutionAuthContext({ | ||
| tenant: options.tenant, | ||
| loginValidity: options.loginValidity, | ||
| envFilePath: options.envFilePath | ||
| })); | ||
| if (authError) { | ||
| return { | ||
| ok: false, | ||
| reason: "auth_failed", | ||
| message: authError.message | ||
| }; | ||
| } | ||
| const fs = getFileSystem(); | ||
| const resolvedPath = fs.path.resolve(packagePath); | ||
| if (!await fs.exists(resolvedPath)) { | ||
| return { | ||
| ok: false, | ||
| reason: "file_not_found", | ||
| message: `File not found: ${resolvedPath}` | ||
| }; | ||
| } | ||
| if (!resolvedPath.endsWith(".zip")) { | ||
| const stats = await fs.stat(resolvedPath); | ||
| const isSolutionSource = stats?.isDirectory() === true || resolvedPath.endsWith(".uis") || resolvedPath.endsWith(".uipx"); | ||
| if (isSolutionSource) { | ||
| return { | ||
| ok: false, | ||
| reason: "not_packed", | ||
| message: `'${packagePath}' is a solution source, not a packed package. 'publish' uploads the .zip produced by 'solution pack'.`, | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| return { | ||
| ok: false, | ||
| reason: "not_a_zip", | ||
| message: `Invalid file type. Expected a .zip file, got: ${resolvedPath}` | ||
| }; | ||
| } | ||
| const [fileBufferError, readBuffer] = await catchError(fs.readFile(resolvedPath)); | ||
| if (fileBufferError) { | ||
| const { message } = await extractErrorDetails(fileBufferError); | ||
| return { | ||
| ok: false, | ||
| reason: "file_read_failed", | ||
| message, | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| if (!readBuffer) { | ||
| return { | ||
| ok: false, | ||
| reason: "file_read_failed", | ||
| message: `File is empty or unreadable: ${resolvedPath}`, | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| let fileBuffer = readBuffer; | ||
| if (options.packageName !== undefined || options.packageVersion !== undefined) { | ||
| const [rewriteError, rewritten] = await catchError(Promise.resolve().then(() => rewritePackageMetadata(new Uint8Array(fileBuffer), { | ||
| packageName: options.packageName, | ||
| packageVersion: options.packageVersion | ||
| }))); | ||
| if (rewriteError || !rewritten) { | ||
| return { | ||
| ok: false, | ||
| reason: "metadata_rewrite_failed", | ||
| message: rewriteError?.message ?? "Could not rewrite the package name/version.", | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| logger.info(`Publishing ${resolvedPath} as ${rewritten.packageName} ${rewritten.packageVersion} (package version key ${rewritten.packageVersionKey}); the file on disk is unchanged.`); | ||
| fileBuffer = rewritten.archive; | ||
| } | ||
| const [scopeError, scope] = await catchError(resolveFeedScope({ | ||
| personalWorkspace: options.personalWorkspace, | ||
| feed: options.feed, | ||
| tenant: options.tenant, | ||
| loginValidity: options.loginValidity, | ||
| envFilePath: options.envFilePath | ||
| })); | ||
| if (scopeError) { | ||
| return { | ||
| ok: false, | ||
| reason: options.feed !== undefined ? "feed_resolution_failed" : "personal_workspace_resolution_failed", | ||
| message: scopeError.message | ||
| }; | ||
| } | ||
| if (scope.kind !== "tenant") { | ||
| return publishToFeed(auth, fileBuffer, scope, options); | ||
| } | ||
| const configuration = new Configuration({ | ||
| basePath: auth.basePath, | ||
| accessToken: auth.accessToken | ||
| }); | ||
| const api = new PipelinesApi(configuration); | ||
| const [uploadError, uploadResult] = await catchError(api.pipelinesPackageUpload({ body: fileBuffer })); | ||
| if (uploadError) { | ||
| return mapUploadError(uploadError); | ||
| } | ||
| let packageVersionInfo = uploadResult; | ||
| if (options.wait) { | ||
| const pollResult = await pollUntil({ | ||
| fn: () => api.pipelinesGetPackageVersion({ | ||
| packageName: uploadResult.packageName, | ||
| packageVersion: uploadResult.packageVersion | ||
| }), | ||
| until: (result) => TERMINAL_STATES.has(result.state), | ||
| getStatus: (result) => result.state, | ||
| label: `publish ${uploadResult.packageName}:${uploadResult.packageVersion}`, | ||
| logPrefix: "publish", | ||
| timeoutMs: (options.timeout ?? 360) * 1000, | ||
| intervalMs: options.pollInterval ?? 5000, | ||
| signal: options.signal | ||
| }); | ||
| if (pollResult.outcome !== PollOutcome.Completed) { | ||
| const { reason, message } = mapPollFailure(pollResult, "Package publish"); | ||
| return { ok: false, reason, message }; | ||
| } | ||
| if (!pollResult.data) { | ||
| return { | ||
| ok: false, | ||
| reason: "poll_failed", | ||
| message: "Package publish did not return a final state." | ||
| }; | ||
| } | ||
| packageVersionInfo = pollResult.data; | ||
| if (packageVersionInfo.state === "Failed") { | ||
| return { | ||
| ok: false, | ||
| reason: "publish_failed", | ||
| message: `Package publish failed with state: ${packageVersionInfo.state}` | ||
| }; | ||
| } | ||
| } | ||
| return { | ||
| ok: true, | ||
| packageVersionKey: packageVersionInfo.key, | ||
| packageName: packageVersionInfo.packageName, | ||
| packageVersion: packageVersionInfo.packageVersion, | ||
| state: packageVersionInfo.state, | ||
| feedKind: "tenant" | ||
| }; | ||
| } | ||
| async function publishToFeed(auth, fileBuffer, scope, options) { | ||
| const config = new Configuration2({ | ||
| basePath: auth.basePath, | ||
| accessToken: auth.accessToken | ||
| }); | ||
| const api = new PackagesApi(config); | ||
| const [uploadError, packageVersionKey] = await catchError(api.packagesUpload({ | ||
| body: fileBuffer, | ||
| locationKey: scope.folderKey | ||
| })); | ||
| if (uploadError) { | ||
| return mapUploadError(uploadError); | ||
| } | ||
| const [getError, initialInfo] = await catchError(api.packagesGetVersion({ packageVersionKey })); | ||
| if (getError) { | ||
| logger.warn(`Package uploaded (key ${packageVersionKey}) but its metadata was not yet retrievable; PackageName/PackageVersion/State will be absent from output: ${getError.message}`); | ||
| } | ||
| let packageVersionInfo = getError ? undefined : initialInfo; | ||
| if (options.wait) { | ||
| const pollResult = await pollUntil({ | ||
| fn: () => api.packagesGetVersion({ packageVersionKey }), | ||
| until: (result) => TERMINAL_STATES.has(result.state), | ||
| getStatus: (result) => result.state, | ||
| label: `publish ${packageVersionInfo ? `${packageVersionInfo.packageName}:${packageVersionInfo.packageVersion}` : packageVersionKey}`, | ||
| logPrefix: "publish", | ||
| timeoutMs: (options.timeout ?? 360) * 1000, | ||
| intervalMs: options.pollInterval ?? 5000, | ||
| signal: options.signal | ||
| }); | ||
| if (pollResult.outcome !== PollOutcome.Completed) { | ||
| const { reason, message } = mapPollFailure(pollResult, "Package publish"); | ||
| return { ok: false, reason, message }; | ||
| } | ||
| if (!pollResult.data) { | ||
| return { | ||
| ok: false, | ||
| reason: "poll_failed", | ||
| message: "Package publish did not return a final state." | ||
| }; | ||
| } | ||
| packageVersionInfo = pollResult.data; | ||
| if (packageVersionInfo.state === "Failed") { | ||
| return { | ||
| ok: false, | ||
| reason: "publish_failed", | ||
| message: `Package publish failed with state: ${packageVersionInfo.state}` | ||
| }; | ||
| } | ||
| } | ||
| return { | ||
| ok: true, | ||
| packageVersionKey: packageVersionInfo?.key ?? packageVersionKey, | ||
| packageName: packageVersionInfo?.packageName, | ||
| packageVersion: packageVersionInfo?.packageVersion, | ||
| state: packageVersionInfo?.state, | ||
| feedKind: scope.kind | ||
| }; | ||
| } | ||
| async function mapUploadError(uploadError) { | ||
| const { message, details, context, retry } = await extractErrorDetails(uploadError); | ||
| const httpStatus = context?.httpStatus ?? extractUploadHttpStatus(message, details); | ||
| const errorCode = context?.errorCode ?? extractUploadErrorCode(message, details); | ||
| const resolvedContext = mergeUploadErrorContext(context, httpStatus, errorCode); | ||
| const resolvedRetry = context?.httpStatus === undefined ? retryHintForUploadStatus(httpStatus) ?? retry : retry; | ||
| const fetchCause = uploadError instanceof Error && uploadError.name === "FetchError" && uploadError.cause instanceof Error ? uploadError.cause : null; | ||
| const surfacedMessage = fetchCause ? `Failed to upload package: ${fetchCause.message}` : message; | ||
| let reason = "upload_failed"; | ||
| if (isVersionConflictError(message, details)) { | ||
| reason = "upload_version_conflict"; | ||
| } else if (fetchCause || httpStatus !== undefined && httpStatus >= 500) { | ||
| reason = "upload_network"; | ||
| } else if (httpStatus === 400 || httpStatus === 422) { | ||
| reason = "upload_rejected"; | ||
| } | ||
| return { | ||
| ok: false, | ||
| reason, | ||
| message: surfacedMessage, | ||
| details, | ||
| errorCode, | ||
| retry: resolvedRetry, | ||
| context: resolvedContext | ||
| }; | ||
| } | ||
| export { publishSolutionAsync }; | ||
| //# debugId=F5A8606772C19F7264756E2164756E21 |
Sorry, the diff of this file is too big to display
+3
-3
@@ -7,5 +7,5 @@ import { | ||
| uninstallDeploymentAsync | ||
| } from "./packager-tool-v33bpncw.js"; | ||
| import"./packager-tool-va301fjh.js"; | ||
| import"./packager-tool-550smwcc.js"; | ||
| } from "./packager-tool-es5j32bw.js"; | ||
| import"./packager-tool-dmms4my7.js"; | ||
| import"./packager-tool-bna6wzjx.js"; | ||
| import"./packager-tool-fzwxq48d.js"; | ||
@@ -12,0 +12,0 @@ import"./packager-tool-bcpknnr8.js"; |
+6
-6
@@ -5,11 +5,11 @@ #!/usr/bin/env bun | ||
| registerCommands | ||
| } from "./packager-tool-112c30jx.js"; | ||
| } from "./packager-tool-mkd42q0r.js"; | ||
| import"./packager-tool-yktm4v4r.js"; | ||
| import"./packager-tool-v33bpncw.js"; | ||
| import"./packager-tool-es5j32bw.js"; | ||
| import"./packager-tool-67ssxgph.js"; | ||
| import"./packager-tool-nkgvv7yh.js"; | ||
| import"./packager-tool-aqff5ehb.js"; | ||
| import"./packager-tool-9vehmnke.js"; | ||
| import"./packager-tool-95fz7yd0.js"; | ||
| import"./packager-tool-va301fjh.js"; | ||
| import"./packager-tool-550smwcc.js"; | ||
| import"./packager-tool-knvz827a.js"; | ||
| import"./packager-tool-dmms4my7.js"; | ||
| import"./packager-tool-bna6wzjx.js"; | ||
| import"./packager-tool-krd5v2r5.js"; | ||
@@ -16,0 +16,0 @@ import"./packager-tool-vpr77gre.js"; |
+1
-1
| import { | ||
| packSolutionAsync | ||
| } from "./packager-tool-nkgvv7yh.js"; | ||
| } from "./packager-tool-aqff5ehb.js"; | ||
| import"./packager-tool-9vehmnke.js"; | ||
@@ -5,0 +5,0 @@ import"./packager-tool-krd5v2r5.js"; |
+3
-3
| import { | ||
| publishSolutionAsync | ||
| } from "./packager-tool-95fz7yd0.js"; | ||
| import"./packager-tool-va301fjh.js"; | ||
| import"./packager-tool-550smwcc.js"; | ||
| } from "./packager-tool-knvz827a.js"; | ||
| import"./packager-tool-dmms4my7.js"; | ||
| import"./packager-tool-bna6wzjx.js"; | ||
| import"./packager-tool-fzwxq48d.js"; | ||
@@ -7,0 +7,0 @@ import"./packager-tool-bcpknnr8.js"; |
+6
-6
| import { | ||
| metadata, | ||
| registerCommands | ||
| } from "./packager-tool-112c30jx.js"; | ||
| } from "./packager-tool-mkd42q0r.js"; | ||
| import"./packager-tool-yktm4v4r.js"; | ||
| import"./packager-tool-v33bpncw.js"; | ||
| import"./packager-tool-es5j32bw.js"; | ||
| import"./packager-tool-67ssxgph.js"; | ||
| import"./packager-tool-nkgvv7yh.js"; | ||
| import"./packager-tool-aqff5ehb.js"; | ||
| import"./packager-tool-9vehmnke.js"; | ||
| import"./packager-tool-95fz7yd0.js"; | ||
| import"./packager-tool-va301fjh.js"; | ||
| import"./packager-tool-550smwcc.js"; | ||
| import"./packager-tool-knvz827a.js"; | ||
| import"./packager-tool-dmms4my7.js"; | ||
| import"./packager-tool-bna6wzjx.js"; | ||
| import"./packager-tool-krd5v2r5.js"; | ||
@@ -14,0 +14,0 @@ import"./packager-tool-vpr77gre.js"; |
+2
-2
| { | ||
| "name": "@uipath/solution-tool", | ||
| "license": "MIT", | ||
| "version": "1.201.0-preview.121", | ||
| "version": "1.201.0-preview.122", | ||
| "description": "Create, pack, publish, and deploy UiPath Automation Solutions.", | ||
@@ -50,3 +50,3 @@ "repository": { | ||
| "private": false, | ||
| "gitHead": "c70ccfc0b12e637441d67df1d212b71d7784b5f8" | ||
| "gitHead": "6c56f56100be96231fccbaa59e99d64d94808d58" | ||
| } |
| import { | ||
| getStudioWebAuth, | ||
| useStudioWebAuth | ||
| } from "./packager-tool-yktm4v4r.js"; | ||
| import { | ||
| getStudioWebSolutionProjects, | ||
| listStudioWebSolutions | ||
| } from "./packager-tool-550smwcc.js"; | ||
| import { | ||
| DEFAULT_PAGE_SIZE, | ||
| OutputFormatter, | ||
| Pagination, | ||
| RESULTS, | ||
| catchError, | ||
| parseBoundedInt, | ||
| parseOffset, | ||
| processContext | ||
| } from "./packager-tool-bcpknnr8.js"; | ||
| import"./packager-tool-9qecd4wb.js"; | ||
| import { | ||
| getFileSystem | ||
| } from "./packager-tool-7eva0peq.js"; | ||
| import"./packager-tool-5arsyj36.js"; | ||
| import"./packager-tool-129wn232.js"; | ||
| import"./packager-tool-0v6na3yp.js"; | ||
| // src/services/solution-list-service.ts | ||
| var fail = (message, instructions) => ({ | ||
| ok: false, | ||
| message, | ||
| instructions | ||
| }); | ||
| function toStudioWebConfig(auth) { | ||
| return { | ||
| baseUrl: auth.baseUrl, | ||
| authToken: auth.accessToken, | ||
| tenantId: auth.tenantId | ||
| }; | ||
| } | ||
| var SERVER_PAGE_LIMIT = 100; | ||
| async function listCloudSolutionsAsync(options) { | ||
| const limit = options.limit ?? DEFAULT_PAGE_SIZE; | ||
| const offset = options.offset ?? 0; | ||
| const organizationName = options.auth.organizationName; | ||
| if (!organizationName) { | ||
| return fail("Organization name is not available. Re-authenticate with 'uip login'.", "Run 'uip login' to refresh the login context and try again."); | ||
| } | ||
| const config = toStudioWebConfig(options.auth); | ||
| const collected = []; | ||
| let skip = 0; | ||
| let exhausted = false; | ||
| while (!exhausted && collected.length < offset + limit) { | ||
| const [listError, page] = await catchError(listStudioWebSolutions(config, organizationName, { | ||
| limit: SERVER_PAGE_LIMIT, | ||
| skip, | ||
| name: options.name, | ||
| sortBy: options.sortBy, | ||
| sortOrder: options.sortOrder === undefined ? undefined : options.sortOrder === "Ascending" ? "asc" : "desc" | ||
| })); | ||
| if (listError) { | ||
| return fail(listError.message, "Verify your login (uip login) and tenant access, then retry."); | ||
| } | ||
| collected.push(...page.solutions); | ||
| skip += page.combinedCount; | ||
| exhausted = page.combinedCount < SERVER_PAGE_LIMIT || page.totalCount !== undefined && skip >= page.totalCount; | ||
| } | ||
| return { | ||
| ok: true, | ||
| solutions: collected.slice(offset, offset + limit), | ||
| limit, | ||
| offset, | ||
| total: exhausted ? collected.length : undefined | ||
| }; | ||
| } | ||
| var SKIPPED_DIRECTORIES = new Set(["node_modules"]); | ||
| var MAX_SCAN_DEPTH = 16; | ||
| async function scanLocalSolutionsAsync(fs, rootDir) { | ||
| const root = fs.path.resolve(rootDir); | ||
| const [statError, rootStat] = await catchError(fs.stat(root)); | ||
| if (statError) { | ||
| return fail(`Cannot access ${root}: ${statError.message}`, "Check the path and its permissions, then try again."); | ||
| } | ||
| if (!rootStat?.isDirectory()) { | ||
| return fail(`Not a directory: ${root}`, "Pass an existing directory to --local (default: current directory)."); | ||
| } | ||
| const rows = []; | ||
| const skipped = []; | ||
| await scanDirectory(fs, root, root, 0, rows, skipped); | ||
| rows.sort((a, b) => a.Path === b.Path ? a.UipxFile.localeCompare(b.UipxFile) : a.Path.localeCompare(b.Path)); | ||
| return { ok: true, rows, skipped }; | ||
| } | ||
| async function scanDirectory(fs, root, dir, depth, rows, skipped) { | ||
| const relativeDir = fs.path.relative(root, dir) || "."; | ||
| if (depth > MAX_SCAN_DEPTH) { | ||
| skipped.push(`Skipped ${relativeDir}: deeper than ${MAX_SCAN_DEPTH} levels.`); | ||
| return; | ||
| } | ||
| const [readError, entries] = await catchError(fs.readdir(dir)); | ||
| if (readError) { | ||
| skipped.push(`Skipped ${relativeDir}: ${readError.message}.`); | ||
| return; | ||
| } | ||
| const manifests = entries.filter((entry) => entry.endsWith(".uipx")); | ||
| for (const manifest of manifests) { | ||
| rows.push(await buildLocalRow(fs, root, dir, manifest, manifests.length)); | ||
| } | ||
| for (const entry of entries) { | ||
| if (entry.startsWith(".") || SKIPPED_DIRECTORIES.has(entry)) { | ||
| continue; | ||
| } | ||
| const entryPath = fs.path.join(dir, entry); | ||
| const [statError, stat] = await catchError(fs.stat(entryPath)); | ||
| if (statError || !stat?.isDirectory()) { | ||
| continue; | ||
| } | ||
| await scanDirectory(fs, root, entryPath, depth + 1, rows, skipped); | ||
| } | ||
| } | ||
| async function buildLocalRow(fs, root, dir, manifest, manifestCountInDir) { | ||
| const name = manifest.slice(0, -".uipx".length); | ||
| const relativeDir = fs.path.relative(root, dir); | ||
| const warnings = []; | ||
| if (manifestCountInDir > 1) { | ||
| warnings.push(`Directory contains ${manifestCountInDir} .uipx manifests; commands like 'uip solution pack' pick one arbitrarily — remove the stale ones.`); | ||
| } | ||
| const dirName = fs.path.basename(dir); | ||
| if (name !== dirName) { | ||
| warnings.push(`Manifest filename '${manifest}' does not match its directory name '${dirName}'.`); | ||
| } | ||
| const row = { | ||
| Path: relativeDir === "" ? "." : relativeDir, | ||
| Name: name, | ||
| UipxFile: manifest, | ||
| Warnings: warnings | ||
| }; | ||
| const manifestPath = fs.path.join(dir, manifest); | ||
| const [readError, content] = await catchError(fs.readFile(manifestPath, "utf-8")); | ||
| if (readError || !content) { | ||
| warnings.push(`Could not read ${manifest}: ${readError?.message ?? "file is empty"}.`); | ||
| return row; | ||
| } | ||
| const [parseError, parsed] = catchError(() => JSON.parse(content)); | ||
| if (parseError || typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { | ||
| warnings.push(`Could not parse ${manifest}: not a valid JSON object.`); | ||
| return row; | ||
| } | ||
| const record = parsed; | ||
| if (typeof record.SolutionId === "string" && record.SolutionId.trim()) { | ||
| row.SolutionId = record.SolutionId; | ||
| } else { | ||
| warnings.push(`${manifest} has no SolutionId.`); | ||
| } | ||
| if (Array.isArray(record.Projects)) { | ||
| row.ProjectCount = record.Projects.length; | ||
| } else { | ||
| warnings.push(`${manifest} has no Projects array.`); | ||
| } | ||
| return row; | ||
| } | ||
| var CLOUD_PROBE_CONCURRENCY = 8; | ||
| async function annotateCloudStatusAsync(rows, auth) { | ||
| const organizationName = auth.organizationName; | ||
| if (!organizationName) { | ||
| return fail("Organization name is not available. Re-authenticate with 'uip login'.", "Run 'uip login' to refresh the login context and try again."); | ||
| } | ||
| const config = toStudioWebConfig(auth); | ||
| const queue = [...rows]; | ||
| const workers = Array.from({ length: Math.min(CLOUD_PROBE_CONCURRENCY, queue.length) }, async () => { | ||
| for (let row = queue.shift();row; row = queue.shift()) { | ||
| await probeCloudStatusAsync(row, config, organizationName); | ||
| } | ||
| }); | ||
| await Promise.all(workers); | ||
| return; | ||
| } | ||
| async function probeCloudStatusAsync(row, config, organizationName) { | ||
| if (!row.SolutionId) { | ||
| row.CloudStatus = "Unknown"; | ||
| return; | ||
| } | ||
| const [probeError, projects] = await catchError(getStudioWebSolutionProjects(config, organizationName, row.SolutionId)); | ||
| if (probeError) { | ||
| row.CloudStatus = "Unknown"; | ||
| row.Warnings.push(`Cloud check failed: ${probeError.message}`); | ||
| return; | ||
| } | ||
| if (projects === undefined) { | ||
| row.CloudStatus = "NotFound"; | ||
| return; | ||
| } | ||
| row.CloudStatus = "OK"; | ||
| row.CloudProjectCount = projects.length; | ||
| } | ||
| // src/commands/list.ts | ||
| var SOLUTION_LIST_EXAMPLES = [ | ||
| { | ||
| Description: "List the Studio Web solutions you own or that are shared with you (IDs pipe into 'solution download' and 'solution delete')", | ||
| Command: "uip solution list --limit 2", | ||
| Output: { | ||
| Code: "SolutionsList", | ||
| Data: [ | ||
| { | ||
| Id: "a1b2c3d4-0000-0000-0000-000000000001", | ||
| Name: "Examples", | ||
| LastModifiedTime: "2025-04-15T10:30:00Z", | ||
| PublishStatus: "draft", | ||
| Projects: [] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| Description: "List the local solutions under a directory tree by scanning for .uipx manifests", | ||
| Command: "uip solution list --local ./workspace", | ||
| Output: { | ||
| Code: "LocalSolutionsList", | ||
| Data: [ | ||
| { | ||
| Path: "Examples", | ||
| Name: "Examples", | ||
| UipxFile: "Examples.uipx", | ||
| SolutionId: "a1b2c3d4-0000-0000-0000-000000000001", | ||
| ProjectCount: 2, | ||
| Warnings: [] | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| Description: "Scan local solutions and check whether each SolutionId still exists on Studio Web", | ||
| Command: "uip solution list --local ./workspace --check-cloud", | ||
| Output: { | ||
| Code: "LocalSolutionsList", | ||
| Data: [ | ||
| { | ||
| Path: "SolutionA", | ||
| Name: "SolutionA", | ||
| UipxFile: "SolutionA.uipx", | ||
| SolutionId: "0dbafff0-0000-0000-0000-000000000368", | ||
| ProjectCount: 1, | ||
| Warnings: [], | ||
| CloudStatus: "NotFound" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ]; | ||
| var CLOUD_ONLY_OPTIONS = [ | ||
| "limit", | ||
| "offset", | ||
| "name", | ||
| "sortBy", | ||
| "sortOrder" | ||
| ]; | ||
| var STUDIO_WEB_SOLUTIONS_PAGE_LIMIT = 100; | ||
| function parseStudioWebSolutionsLimit(raw) { | ||
| return parseBoundedInt(raw, "--limit", { | ||
| min: 1, | ||
| max: STUDIO_WEB_SOLUTIONS_PAGE_LIMIT | ||
| }); | ||
| } | ||
| var registerListCommand = (program) => { | ||
| const command = program.previewCommand("list").description("List solutions. By default lists the Studio Web solutions you own or that are shared with you — the SolutionIds it returns are the ones 'solution download' and 'solution delete' take. With --local, scans a directory tree for local solutions (.uipx manifests) and flags stale or ambiguous manifests. Add --check-cloud to also resolve each local SolutionId against Studio Web and report whether it can still be reached (OK / NotFound).").option("-l, --limit <number>", "Maximum solutions to return, between 1 and 100 (cloud mode)", parseStudioWebSolutionsLimit, DEFAULT_PAGE_SIZE).option("--offset <number>", "Number of solutions to skip (cloud mode)", parseOffset, 0).option("--name <pattern>", "Filter solutions by name (cloud mode; server-side keyword match)").option("--sort-by <column>", "Column to sort by (cloud mode; server default order when omitted)").option("--sort-order <direction>", "Sort direction: Ascending or Descending (cloud mode)").option("--local [directory]", "List local solutions by scanning this directory tree (default: current directory) instead of Studio Web").option("--check-cloud", "With --local: check each local SolutionId against Studio Web and report OK / NotFound. Implies --local.").option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", parseInt, 10).examples(SOLUTION_LIST_EXAMPLES); | ||
| useStudioWebAuth(command, { | ||
| requireOrganizationName: true, | ||
| shouldResolve: (_thisCommand, actionCommand) => needsStudioWebAuth(actionCommand.opts()) | ||
| }).trackedAction(processContext, async (options, actionCommand) => { | ||
| const localMode = options.local !== undefined || options.checkCloud === true; | ||
| if (localMode) { | ||
| const misused = CLOUD_ONLY_OPTIONS.filter((key) => actionCommand.getOptionValueSource(key) === "cli"); | ||
| if (misused.length > 0) { | ||
| outputError(`The ${misused.map(optionFlag).join(", ")} option only applies to the cloud listing.`, "Drop the option, or remove --local/--check-cloud to list Studio Web solutions."); | ||
| return; | ||
| } | ||
| await runLocalList(options, actionCommand); | ||
| return; | ||
| } | ||
| await runCloudList(options, actionCommand); | ||
| }); | ||
| }; | ||
| function needsStudioWebAuth(options) { | ||
| return options.local === undefined || options.checkCloud === true; | ||
| } | ||
| async function runCloudList(options, actionCommand) { | ||
| const sortOrder = normalizeSortOrder(options.sortOrder); | ||
| if (options.sortOrder !== undefined && sortOrder === undefined) { | ||
| outputError(`Invalid --sort-order value: ${options.sortOrder}.`, "Use 'Ascending' or 'Descending'."); | ||
| return; | ||
| } | ||
| const auth = resolveAuth(actionCommand); | ||
| if (!auth) { | ||
| return; | ||
| } | ||
| const result = await listCloudSolutionsAsync({ | ||
| auth, | ||
| limit: options.limit, | ||
| offset: options.offset, | ||
| name: options.name, | ||
| sortBy: options.sortBy, | ||
| sortOrder | ||
| }); | ||
| if (!result.ok) { | ||
| outputError(result.message, result.instructions); | ||
| return; | ||
| } | ||
| OutputFormatter.success({ | ||
| Result: RESULTS.Success, | ||
| Code: "SolutionsList", | ||
| Data: result.solutions, | ||
| Pagination: new Pagination({ | ||
| returned: result.solutions.length, | ||
| limit: result.limit, | ||
| offset: result.offset, | ||
| total: result.total | ||
| }) | ||
| }); | ||
| } | ||
| async function runLocalList(options, actionCommand) { | ||
| const fs = getFileSystem(); | ||
| const rootDir = typeof options.local === "string" ? options.local : "."; | ||
| const scan = await scanLocalSolutionsAsync(fs, rootDir); | ||
| if (!scan.ok) { | ||
| outputError(scan.message, scan.instructions); | ||
| return; | ||
| } | ||
| if (options.checkCloud) { | ||
| const auth = resolveAuth(actionCommand); | ||
| if (!auth) { | ||
| return; | ||
| } | ||
| const failure = await annotateCloudStatusAsync(scan.rows, auth); | ||
| if (failure) { | ||
| outputError(failure.message, failure.instructions); | ||
| return; | ||
| } | ||
| } | ||
| OutputFormatter.success({ | ||
| Result: RESULTS.Success, | ||
| Code: "LocalSolutionsList", | ||
| Data: scan.rows, | ||
| Instructions: scan.skipped.length > 0 ? scan.skipped.join(" ") : undefined | ||
| }); | ||
| } | ||
| function resolveAuth(actionCommand) { | ||
| const [authError, auth] = catchError(() => getStudioWebAuth(actionCommand)); | ||
| if (authError) { | ||
| outputError(authError.message, "Run 'uip login' to authenticate and try again."); | ||
| return; | ||
| } | ||
| return auth; | ||
| } | ||
| function normalizeSortOrder(direction) { | ||
| switch (direction?.toLowerCase()) { | ||
| case "ascending": | ||
| return "Ascending"; | ||
| case "descending": | ||
| return "Descending"; | ||
| default: | ||
| return; | ||
| } | ||
| } | ||
| function optionFlag(key) { | ||
| return `--${key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`; | ||
| } | ||
| function outputError(message, instructions) { | ||
| OutputFormatter.error({ | ||
| Result: RESULTS.Failure, | ||
| Message: message, | ||
| Instructions: instructions | ||
| }); | ||
| processContext.exit(1); | ||
| } | ||
| export { | ||
| registerListCommand | ||
| }; | ||
| //# debugId=F86E269BD92740C164756E2164756E21 |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
| import { | ||
| Configuration, | ||
| PipelinesApi, | ||
| resolveFeedScope | ||
| } from "./packager-tool-va301fjh.js"; | ||
| import { | ||
| Configuration as Configuration2, | ||
| PackagesApi | ||
| } from "./packager-tool-550smwcc.js"; | ||
| import { | ||
| getSolutionAuthContext | ||
| } from "./packager-tool-fzwxq48d.js"; | ||
| import { | ||
| PollOutcome, | ||
| catchError, | ||
| extractErrorDetails, | ||
| logger, | ||
| mapPollFailure, | ||
| pollUntil | ||
| } from "./packager-tool-bcpknnr8.js"; | ||
| import { | ||
| getFileSystem | ||
| } from "./packager-tool-7eva0peq.js"; | ||
| import { | ||
| strFromU8, | ||
| strToU8, | ||
| unzipSync, | ||
| zipSync | ||
| } from "./packager-tool-129wn232.js"; | ||
| // src/services/package-metadata-rewrite.ts | ||
| import { randomUUID } from "node:crypto"; | ||
| var SOLUTION_METADATA_ENTRY = "solutionMetadata.json"; | ||
| function isRecord(value) { | ||
| return typeof value === "object" && value !== null && !Array.isArray(value); | ||
| } | ||
| var requireValue = (value, flag) => { | ||
| const trimmed = value.trim(); | ||
| if (!trimmed) { | ||
| throw new Error(`${flag} cannot be empty.`); | ||
| } | ||
| return trimmed; | ||
| }; | ||
| function rewritePackageMetadata(archive, overrides) { | ||
| const entries = unzipSync(archive); | ||
| const metadataBytes = entries[SOLUTION_METADATA_ENTRY]; | ||
| if (!metadataBytes) { | ||
| throw new Error(`Package archive has no ${SOLUTION_METADATA_ENTRY} at its root, so its name and version cannot be rewritten. Only a .zip produced by 'uip solution pack' carries that file.`); | ||
| } | ||
| let parsed; | ||
| try { | ||
| parsed = JSON.parse(strFromU8(metadataBytes)); | ||
| } catch (err) { | ||
| throw new Error(`${SOLUTION_METADATA_ENTRY} in the package archive is not valid JSON: ${err instanceof Error ? err.message : String(err)}`); | ||
| } | ||
| if (!isRecord(parsed) || !isRecord(parsed.spec)) { | ||
| throw new Error(`${SOLUTION_METADATA_ENTRY} in the package archive has no 'spec' object, so its name and version cannot be rewritten.`); | ||
| } | ||
| const spec = parsed.spec; | ||
| const packageName = overrides.packageName === undefined ? String(spec.packageName ?? "") : requireValue(overrides.packageName, "--package-name"); | ||
| const packageVersion = overrides.packageVersion === undefined ? String(spec.packageVersion ?? "") : requireValue(overrides.packageVersion, "--package-version"); | ||
| const packageVersionKey = randomUUID(); | ||
| const rewritten = { | ||
| ...parsed, | ||
| spec: { ...spec, packageName, packageVersion, packageVersionKey } | ||
| }; | ||
| const zipInput = {}; | ||
| for (const [entryName, entryBytes] of Object.entries(entries)) { | ||
| const level = entryName.toLowerCase().endsWith(".nupkg") ? 0 : 6; | ||
| zipInput[entryName] = [entryBytes, { level }]; | ||
| } | ||
| zipInput[SOLUTION_METADATA_ENTRY] = [ | ||
| strToU8(JSON.stringify(rewritten)), | ||
| { level: 6 } | ||
| ]; | ||
| return { | ||
| archive: zipSync(zipInput), | ||
| packageName, | ||
| packageVersion, | ||
| packageVersionKey | ||
| }; | ||
| } | ||
| // src/services/publish-service.ts | ||
| var TERMINAL_STATES = new Set([ | ||
| "Ready", | ||
| "Active", | ||
| "Failed" | ||
| ]); | ||
| var VERSION_CONFLICT_PATTERNS = [ | ||
| /\balready exists\b/i, | ||
| /\bduplicate\b.*\bversion\b/i, | ||
| /\bversion\b.*\bduplicate\b/i, | ||
| /\bpackage[-\s]?version\b.*\bexists\b/i, | ||
| /\bversion[-\s]?exists\b/i, | ||
| /\bversion\b.*\balready exists\b/i | ||
| ]; | ||
| var isVersionConflictError = (message, details) => { | ||
| const errorText = `${message} ${details ?? ""}`; | ||
| return VERSION_CONFLICT_PATTERNS.some((pattern) => pattern.test(errorText)); | ||
| }; | ||
| var HTTP_STATUS_PATTERNS = [ | ||
| /^HTTP\s+(\d{3})(?::|\s|-|$)/i, | ||
| /["']httpStatus["']\s*:\s*(\d{3})\b/i, | ||
| /["']statusCode["']\s*:\s*(\d{3})\b/i, | ||
| /["']status["']\s*:\s*(\d{3})\b/i, | ||
| /\bhttpStatus\s*[:=]\s*(\d{3})\b/i, | ||
| /\bstatusCode\s*[:=]\s*(\d{3})\b/i | ||
| ]; | ||
| var ERROR_CODE_PATTERNS = [ | ||
| /["']errorCode["']\s*:\s*["']([^"']+)["']/i, | ||
| /["']errorCode["']\s*:\s*(\d+)\b/i, | ||
| /\berrorCode\s*[:=]\s*["']?([A-Za-z0-9_.-]+)["']?/i, | ||
| /["']code["']\s*:\s*["']([^"']+)["']/i, | ||
| /["']code["']\s*:\s*(\d+)\b/i | ||
| ]; | ||
| function extractFirstPatternValue(text, patterns) { | ||
| if (!text) | ||
| return; | ||
| for (const pattern of patterns) { | ||
| const match = pattern.exec(text); | ||
| if (match?.[1]) | ||
| return match[1]; | ||
| } | ||
| return; | ||
| } | ||
| function extractUploadHttpStatus(message, details) { | ||
| const rawStatus = extractFirstPatternValue(message, HTTP_STATUS_PATTERNS) ?? extractFirstPatternValue(details, HTTP_STATUS_PATTERNS); | ||
| if (!rawStatus) | ||
| return; | ||
| const status = Number(rawStatus); | ||
| return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined; | ||
| } | ||
| function extractUploadErrorCode(message, details) { | ||
| return extractFirstPatternValue(details, ERROR_CODE_PATTERNS) ?? extractFirstPatternValue(message, ERROR_CODE_PATTERNS); | ||
| } | ||
| function retryHintForUploadStatus(httpStatus) { | ||
| if (httpStatus === 400 || httpStatus === 409 || httpStatus === 422) { | ||
| return "RetryWillNotFix"; | ||
| } | ||
| if (httpStatus === 408 || httpStatus === 429 || httpStatus !== undefined && httpStatus >= 500 && httpStatus < 600) { | ||
| return "RetryLater"; | ||
| } | ||
| return; | ||
| } | ||
| function mergeUploadErrorContext(context, httpStatus, errorCode) { | ||
| if (!context && httpStatus === undefined && errorCode === undefined) { | ||
| return; | ||
| } | ||
| return { | ||
| ...context ?? {}, | ||
| ...httpStatus !== undefined ? { httpStatus } : {}, | ||
| ...errorCode !== undefined ? { errorCode } : {} | ||
| }; | ||
| } | ||
| async function publishSolutionAsync(packagePath, options = {}) { | ||
| const [authError, auth] = await catchError(getSolutionAuthContext({ | ||
| tenant: options.tenant, | ||
| loginValidity: options.loginValidity, | ||
| envFilePath: options.envFilePath | ||
| })); | ||
| if (authError) { | ||
| return { | ||
| ok: false, | ||
| reason: "auth_failed", | ||
| message: authError.message | ||
| }; | ||
| } | ||
| const fs = getFileSystem(); | ||
| const resolvedPath = fs.path.resolve(packagePath); | ||
| if (!await fs.exists(resolvedPath)) { | ||
| return { | ||
| ok: false, | ||
| reason: "file_not_found", | ||
| message: `File not found: ${resolvedPath}` | ||
| }; | ||
| } | ||
| if (!resolvedPath.endsWith(".zip")) { | ||
| const stats = await fs.stat(resolvedPath); | ||
| const isSolutionSource = stats?.isDirectory() === true || resolvedPath.endsWith(".uis") || resolvedPath.endsWith(".uipx"); | ||
| if (isSolutionSource) { | ||
| return { | ||
| ok: false, | ||
| reason: "not_packed", | ||
| message: `'${packagePath}' is a solution source, not a packed package. 'publish' uploads the .zip produced by 'solution pack'.`, | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| return { | ||
| ok: false, | ||
| reason: "not_a_zip", | ||
| message: `Invalid file type. Expected a .zip file, got: ${resolvedPath}` | ||
| }; | ||
| } | ||
| const [fileBufferError, readBuffer] = await catchError(fs.readFile(resolvedPath)); | ||
| if (fileBufferError) { | ||
| const { message } = await extractErrorDetails(fileBufferError); | ||
| return { | ||
| ok: false, | ||
| reason: "file_read_failed", | ||
| message, | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| if (!readBuffer) { | ||
| return { | ||
| ok: false, | ||
| reason: "file_read_failed", | ||
| message: `File is empty or unreadable: ${resolvedPath}`, | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| let fileBuffer = readBuffer; | ||
| if (options.packageName !== undefined || options.packageVersion !== undefined) { | ||
| const [rewriteError, rewritten] = await catchError(Promise.resolve().then(() => rewritePackageMetadata(new Uint8Array(fileBuffer), { | ||
| packageName: options.packageName, | ||
| packageVersion: options.packageVersion | ||
| }))); | ||
| if (rewriteError || !rewritten) { | ||
| return { | ||
| ok: false, | ||
| reason: "metadata_rewrite_failed", | ||
| message: rewriteError?.message ?? "Could not rewrite the package name/version.", | ||
| details: resolvedPath | ||
| }; | ||
| } | ||
| logger.info(`Publishing ${resolvedPath} as ${rewritten.packageName} ${rewritten.packageVersion} (package version key ${rewritten.packageVersionKey}); the file on disk is unchanged.`); | ||
| fileBuffer = rewritten.archive; | ||
| } | ||
| const [scopeError, scope] = await catchError(resolveFeedScope({ | ||
| personalWorkspace: options.personalWorkspace, | ||
| feed: options.feed, | ||
| tenant: options.tenant, | ||
| loginValidity: options.loginValidity, | ||
| envFilePath: options.envFilePath | ||
| })); | ||
| if (scopeError) { | ||
| return { | ||
| ok: false, | ||
| reason: options.feed !== undefined ? "feed_resolution_failed" : "personal_workspace_resolution_failed", | ||
| message: scopeError.message | ||
| }; | ||
| } | ||
| if (scope.kind !== "tenant") { | ||
| return publishToFeed(auth, fileBuffer, scope, options); | ||
| } | ||
| const configuration = new Configuration({ | ||
| basePath: auth.basePath, | ||
| accessToken: auth.accessToken | ||
| }); | ||
| const api = new PipelinesApi(configuration); | ||
| const [uploadError, uploadResult] = await catchError(api.pipelinesPackageUpload({ body: fileBuffer })); | ||
| if (uploadError) { | ||
| return mapUploadError(uploadError); | ||
| } | ||
| let packageVersionInfo = uploadResult; | ||
| if (options.wait) { | ||
| const pollResult = await pollUntil({ | ||
| fn: () => api.pipelinesGetPackageVersion({ | ||
| packageName: uploadResult.packageName, | ||
| packageVersion: uploadResult.packageVersion | ||
| }), | ||
| until: (result) => TERMINAL_STATES.has(result.state), | ||
| getStatus: (result) => result.state, | ||
| label: `publish ${uploadResult.packageName}:${uploadResult.packageVersion}`, | ||
| logPrefix: "publish", | ||
| timeoutMs: (options.timeout ?? 360) * 1000, | ||
| intervalMs: options.pollInterval ?? 5000, | ||
| signal: options.signal | ||
| }); | ||
| if (pollResult.outcome !== PollOutcome.Completed) { | ||
| const { reason, message } = mapPollFailure(pollResult, "Package publish"); | ||
| return { ok: false, reason, message }; | ||
| } | ||
| if (!pollResult.data) { | ||
| return { | ||
| ok: false, | ||
| reason: "poll_failed", | ||
| message: "Package publish did not return a final state." | ||
| }; | ||
| } | ||
| packageVersionInfo = pollResult.data; | ||
| if (packageVersionInfo.state === "Failed") { | ||
| return { | ||
| ok: false, | ||
| reason: "publish_failed", | ||
| message: `Package publish failed with state: ${packageVersionInfo.state}` | ||
| }; | ||
| } | ||
| } | ||
| return { | ||
| ok: true, | ||
| packageVersionKey: packageVersionInfo.key, | ||
| packageName: packageVersionInfo.packageName, | ||
| packageVersion: packageVersionInfo.packageVersion, | ||
| state: packageVersionInfo.state, | ||
| feedKind: "tenant" | ||
| }; | ||
| } | ||
| async function publishToFeed(auth, fileBuffer, scope, options) { | ||
| const config = new Configuration2({ | ||
| basePath: auth.basePath, | ||
| accessToken: auth.accessToken | ||
| }); | ||
| const api = new PackagesApi(config); | ||
| const [uploadError, packageVersionKey] = await catchError(api.packagesUpload({ | ||
| body: fileBuffer, | ||
| locationKey: scope.folderKey | ||
| })); | ||
| if (uploadError) { | ||
| return mapUploadError(uploadError); | ||
| } | ||
| const [getError, initialInfo] = await catchError(api.packagesGetVersion({ packageVersionKey })); | ||
| if (getError) { | ||
| logger.warn(`Package uploaded (key ${packageVersionKey}) but its metadata was not yet retrievable; PackageName/PackageVersion/State will be absent from output: ${getError.message}`); | ||
| } | ||
| let packageVersionInfo = getError ? undefined : initialInfo; | ||
| if (options.wait) { | ||
| const pollResult = await pollUntil({ | ||
| fn: () => api.packagesGetVersion({ packageVersionKey }), | ||
| until: (result) => TERMINAL_STATES.has(result.state), | ||
| getStatus: (result) => result.state, | ||
| label: `publish ${packageVersionInfo ? `${packageVersionInfo.packageName}:${packageVersionInfo.packageVersion}` : packageVersionKey}`, | ||
| logPrefix: "publish", | ||
| timeoutMs: (options.timeout ?? 360) * 1000, | ||
| intervalMs: options.pollInterval ?? 5000, | ||
| signal: options.signal | ||
| }); | ||
| if (pollResult.outcome !== PollOutcome.Completed) { | ||
| const { reason, message } = mapPollFailure(pollResult, "Package publish"); | ||
| return { ok: false, reason, message }; | ||
| } | ||
| if (!pollResult.data) { | ||
| return { | ||
| ok: false, | ||
| reason: "poll_failed", | ||
| message: "Package publish did not return a final state." | ||
| }; | ||
| } | ||
| packageVersionInfo = pollResult.data; | ||
| if (packageVersionInfo.state === "Failed") { | ||
| return { | ||
| ok: false, | ||
| reason: "publish_failed", | ||
| message: `Package publish failed with state: ${packageVersionInfo.state}` | ||
| }; | ||
| } | ||
| } | ||
| return { | ||
| ok: true, | ||
| packageVersionKey: packageVersionInfo?.key ?? packageVersionKey, | ||
| packageName: packageVersionInfo?.packageName, | ||
| packageVersion: packageVersionInfo?.packageVersion, | ||
| state: packageVersionInfo?.state, | ||
| feedKind: scope.kind | ||
| }; | ||
| } | ||
| async function mapUploadError(uploadError) { | ||
| const { message, details, context, retry } = await extractErrorDetails(uploadError); | ||
| const httpStatus = context?.httpStatus ?? extractUploadHttpStatus(message, details); | ||
| const errorCode = context?.errorCode ?? extractUploadErrorCode(message, details); | ||
| const resolvedContext = mergeUploadErrorContext(context, httpStatus, errorCode); | ||
| const resolvedRetry = context?.httpStatus === undefined ? retryHintForUploadStatus(httpStatus) ?? retry : retry; | ||
| const fetchCause = uploadError instanceof Error && uploadError.name === "FetchError" && uploadError.cause instanceof Error ? uploadError.cause : null; | ||
| const surfacedMessage = fetchCause ? `Failed to upload package: ${fetchCause.message}` : message; | ||
| let reason = "upload_failed"; | ||
| if (isVersionConflictError(message, details)) { | ||
| reason = "upload_version_conflict"; | ||
| } else if (fetchCause || httpStatus !== undefined && httpStatus >= 500) { | ||
| reason = "upload_network"; | ||
| } else if (httpStatus === 400 || httpStatus === 422) { | ||
| reason = "upload_rejected"; | ||
| } | ||
| return { | ||
| ok: false, | ||
| reason, | ||
| message: surfacedMessage, | ||
| details, | ||
| errorCode, | ||
| retry: resolvedRetry, | ||
| context: resolvedContext | ||
| }; | ||
| } | ||
| export { publishSolutionAsync }; | ||
| //# debugId=F5A8606772C19F7264756E2164756E21 |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
| import { | ||
| getAvailablePublishLocationsV2 | ||
| } from "./packager-tool-550smwcc.js"; | ||
| import { | ||
| PersonalWorkspacesApi, | ||
| createOrchestratorConfig | ||
| } from "./packager-tool-fzwxq48d.js"; | ||
| import { | ||
| getLoginStatusAsync, | ||
| getSdkUserAgentToken, | ||
| installSdkUserAgentHeader | ||
| } from "./packager-tool-bcpknnr8.js"; | ||
| // ../pipelines-sdk/generated/src/runtime.ts | ||
| var BASE_PATH = "https://alpha.uipath.com/uipattycyrhx/abizon_1/automationsolutions_".replace(/\/+$/, ""); | ||
| class Configuration { | ||
| configuration; | ||
| constructor(configuration = {}) { | ||
| this.configuration = configuration; | ||
| } | ||
| set config(configuration) { | ||
| this.configuration = configuration; | ||
| } | ||
| get basePath() { | ||
| return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; | ||
| } | ||
| get fetchApi() { | ||
| return this.configuration.fetchApi; | ||
| } | ||
| get middleware() { | ||
| return this.configuration.middleware || []; | ||
| } | ||
| get queryParamsStringify() { | ||
| return this.configuration.queryParamsStringify || querystring; | ||
| } | ||
| get username() { | ||
| return this.configuration.username; | ||
| } | ||
| get password() { | ||
| return this.configuration.password; | ||
| } | ||
| get apiKey() { | ||
| const apiKey = this.configuration.apiKey; | ||
| if (apiKey) { | ||
| return typeof apiKey === "function" ? apiKey : () => apiKey; | ||
| } | ||
| return; | ||
| } | ||
| get accessToken() { | ||
| const accessToken = this.configuration.accessToken; | ||
| if (accessToken) { | ||
| return typeof accessToken === "function" ? accessToken : async () => accessToken; | ||
| } | ||
| return; | ||
| } | ||
| get headers() { | ||
| return this.configuration.headers; | ||
| } | ||
| get credentials() { | ||
| return this.configuration.credentials; | ||
| } | ||
| } | ||
| var DefaultConfig = new Configuration; | ||
| class BaseAPI { | ||
| configuration; | ||
| static jsonRegex = new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", "i"); | ||
| middleware; | ||
| constructor(configuration = DefaultConfig) { | ||
| this.configuration = configuration; | ||
| this.middleware = configuration.middleware; | ||
| } | ||
| withMiddleware(...middlewares) { | ||
| const next = this.clone(); | ||
| next.middleware = next.middleware.concat(...middlewares); | ||
| return next; | ||
| } | ||
| withPreMiddleware(...preMiddlewares) { | ||
| const middlewares = preMiddlewares.map((pre) => ({ pre })); | ||
| return this.withMiddleware(...middlewares); | ||
| } | ||
| withPostMiddleware(...postMiddlewares) { | ||
| const middlewares = postMiddlewares.map((post) => ({ post })); | ||
| return this.withMiddleware(...middlewares); | ||
| } | ||
| isJsonMime(mime) { | ||
| if (!mime) { | ||
| return false; | ||
| } | ||
| return BaseAPI.jsonRegex.test(mime); | ||
| } | ||
| async request(context, initOverrides) { | ||
| const { url, init } = await this.createFetchParams(context, initOverrides); | ||
| const response = await this.fetchApi(url, init); | ||
| if (response && (response.status >= 200 && response.status < 300)) { | ||
| return response; | ||
| } | ||
| throw new ResponseError(response, "Response returned an error code"); | ||
| } | ||
| async createFetchParams(context, initOverrides) { | ||
| let url = this.configuration.basePath + context.path; | ||
| if (context.query !== undefined && Object.keys(context.query).length !== 0) { | ||
| url += "?" + this.configuration.queryParamsStringify(context.query); | ||
| } | ||
| const headers = Object.assign({}, this.configuration.headers, context.headers); | ||
| Object.keys(headers).forEach((key) => headers[key] === undefined ? delete headers[key] : {}); | ||
| const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides; | ||
| const initParams = { | ||
| method: context.method, | ||
| headers, | ||
| body: context.body, | ||
| credentials: this.configuration.credentials | ||
| }; | ||
| const overriddenInit = { | ||
| ...initParams, | ||
| ...await initOverrideFn({ | ||
| init: initParams, | ||
| context | ||
| }) | ||
| }; | ||
| let body; | ||
| if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) { | ||
| body = overriddenInit.body; | ||
| } else if (this.isJsonMime(headers["Content-Type"])) { | ||
| body = JSON.stringify(overriddenInit.body); | ||
| } else { | ||
| body = overriddenInit.body; | ||
| } | ||
| const init = { | ||
| ...overriddenInit, | ||
| body | ||
| }; | ||
| return { url, init }; | ||
| } | ||
| fetchApi = async (url, init) => { | ||
| let fetchParams = { url, init }; | ||
| for (const middleware of this.middleware) { | ||
| if (middleware.pre) { | ||
| fetchParams = await middleware.pre({ | ||
| fetch: this.fetchApi, | ||
| ...fetchParams | ||
| }) || fetchParams; | ||
| } | ||
| } | ||
| let response = undefined; | ||
| try { | ||
| response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); | ||
| } catch (e) { | ||
| for (const middleware of this.middleware) { | ||
| if (middleware.onError) { | ||
| response = await middleware.onError({ | ||
| fetch: this.fetchApi, | ||
| url: fetchParams.url, | ||
| init: fetchParams.init, | ||
| error: e, | ||
| response: response ? response.clone() : undefined | ||
| }) || response; | ||
| } | ||
| } | ||
| if (response === undefined) { | ||
| if (e instanceof Error) { | ||
| throw new FetchError(e, "The request failed and the interceptors did not return an alternative response"); | ||
| } else { | ||
| throw e; | ||
| } | ||
| } | ||
| } | ||
| for (const middleware of this.middleware) { | ||
| if (middleware.post) { | ||
| response = await middleware.post({ | ||
| fetch: this.fetchApi, | ||
| url: fetchParams.url, | ||
| init: fetchParams.init, | ||
| response: response.clone() | ||
| }) || response; | ||
| } | ||
| } | ||
| return response; | ||
| }; | ||
| clone() { | ||
| const constructor = this.constructor; | ||
| const next = new constructor(this.configuration); | ||
| next.middleware = this.middleware.slice(); | ||
| return next; | ||
| } | ||
| } | ||
| function isBlob(value) { | ||
| return typeof Blob !== "undefined" && value instanceof Blob; | ||
| } | ||
| function isFormData(value) { | ||
| return typeof FormData !== "undefined" && value instanceof FormData; | ||
| } | ||
| class ResponseError extends Error { | ||
| response; | ||
| name = "ResponseError"; | ||
| constructor(response, msg) { | ||
| super(msg); | ||
| this.response = response; | ||
| } | ||
| } | ||
| class FetchError extends Error { | ||
| cause; | ||
| name = "FetchError"; | ||
| constructor(cause, msg) { | ||
| super(msg); | ||
| this.cause = cause; | ||
| } | ||
| } | ||
| class RequiredError extends Error { | ||
| field; | ||
| name = "RequiredError"; | ||
| constructor(field, msg) { | ||
| super(msg); | ||
| this.field = field; | ||
| } | ||
| } | ||
| function querystring(params, prefix = "") { | ||
| return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&"); | ||
| } | ||
| function querystringSingleKey(key, value, keyPrefix = "") { | ||
| const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); | ||
| if (value instanceof Array) { | ||
| const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`); | ||
| return `${encodeURIComponent(fullKey)}=${multiValue}`; | ||
| } | ||
| if (value instanceof Set) { | ||
| const valueAsArray = Array.from(value); | ||
| return querystringSingleKey(key, valueAsArray, keyPrefix); | ||
| } | ||
| if (value instanceof Date) { | ||
| return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; | ||
| } | ||
| if (value instanceof Object) { | ||
| return querystring(value, fullKey); | ||
| } | ||
| return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; | ||
| } | ||
| class JSONApiResponse { | ||
| raw; | ||
| transformer; | ||
| constructor(raw, transformer = (jsonValue) => jsonValue) { | ||
| this.raw = raw; | ||
| this.transformer = transformer; | ||
| } | ||
| async value() { | ||
| return this.transformer(await this.raw.json()); | ||
| } | ||
| } | ||
| class VoidApiResponse { | ||
| raw; | ||
| constructor(raw) { | ||
| this.raw = raw; | ||
| } | ||
| async value() { | ||
| return; | ||
| } | ||
| } | ||
| class BlobApiResponse { | ||
| raw; | ||
| constructor(raw) { | ||
| this.raw = raw; | ||
| } | ||
| async value() { | ||
| return await this.raw.blob(); | ||
| } | ||
| } | ||
| class TextApiResponse { | ||
| raw; | ||
| constructor(raw) { | ||
| this.raw = raw; | ||
| } | ||
| async value() { | ||
| return await this.raw.text(); | ||
| } | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/BaseResourceIdentifier.ts | ||
| function BaseResourceIdentifierFromJSON(json) { | ||
| return BaseResourceIdentifierFromJSONTyped(json, false); | ||
| } | ||
| function BaseResourceIdentifierFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"], | ||
| key: json["key"], | ||
| type: json["type"] == null ? undefined : json["type"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResponseDictionaryDto.ts | ||
| function ResponseDictionaryDtoFromJSON(json) { | ||
| return ResponseDictionaryDtoFromJSONTyped(json, false); | ||
| } | ||
| function ResponseDictionaryDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| keys: json["keys"] == null ? undefined : json["keys"], | ||
| values: json["values"] == null ? undefined : json["values"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/BlobFileAccessDto.ts | ||
| function BlobFileAccessDtoFromJSON(json) { | ||
| return BlobFileAccessDtoFromJSONTyped(json, false); | ||
| } | ||
| function BlobFileAccessDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| uri: json["uri"], | ||
| verb: json["verb"], | ||
| headers: json["headers"] == null ? undefined : ResponseDictionaryDtoFromJSON(json["headers"]) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentActivateResponse.ts | ||
| function DeploymentActivateResponseFromJSON(json) { | ||
| return DeploymentActivateResponseFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentActivateResponseFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| instanceId: json["instanceId"] == null ? undefined : json["instanceId"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentOperation.ts | ||
| function DeploymentOperationFromJSON(json) { | ||
| return DeploymentOperationFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentOperationFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentOperationStatus.ts | ||
| function DeploymentOperationStatusFromJSON(json) { | ||
| return DeploymentOperationStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentOperationStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentPreActivateStepDto.ts | ||
| function DeploymentPreActivateStepDtoFromJSON(json) { | ||
| return DeploymentPreActivateStepDtoFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentPreActivateStepDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| serviceName: json["serviceName"], | ||
| step: json["step"], | ||
| description: json["description"], | ||
| link: json["link"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentPreActivateStepsDto.ts | ||
| function DeploymentPreActivateStepsDtoFromJSON(json) { | ||
| return DeploymentPreActivateStepsDtoFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentPreActivateStepsDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| steps: json["steps"].map(DeploymentPreActivateStepDtoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentResourceValidationAction.ts | ||
| function DeploymentResourceValidationActionFromJSON(json) { | ||
| return DeploymentResourceValidationActionFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentResourceValidationActionFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ServiceMessage.ts | ||
| function ServiceMessageFromJSON(json) { | ||
| return ServiceMessageFromJSONTyped(json, false); | ||
| } | ||
| function ServiceMessageFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| resource: json["resource"], | ||
| text: json["text"], | ||
| parameters: json["parameters"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentRunResponse.ts | ||
| function DeploymentRunResponseFromJSON(json) { | ||
| return DeploymentRunResponseFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentRunResponseFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| instanceId: json["instanceId"] == null ? undefined : json["instanceId"], | ||
| scheduled: json["scheduled"], | ||
| errors: json["errors"].map(ServiceMessageFromJSON), | ||
| complete: json["complete"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResourceInstallError.ts | ||
| function ResourceInstallErrorFromJSON(json) { | ||
| return ResourceInstallErrorFromJSONTyped(json, false); | ||
| } | ||
| function ResourceInstallErrorFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"] == null ? undefined : json["kind"], | ||
| type: json["type"] == null ? undefined : json["type"], | ||
| key: json["key"] == null ? undefined : json["key"], | ||
| folderKey: json["folderKey"] == null ? undefined : json["folderKey"], | ||
| name: json["name"] == null ? undefined : json["name"], | ||
| text: json["text"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentStatus.ts | ||
| function DeploymentStatusFromJSON(json) { | ||
| return DeploymentStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentRunServiceStatus.ts | ||
| function DeploymentRunServiceStatusFromJSON(json) { | ||
| return DeploymentRunServiceStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentRunServiceStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| serviceName: json["serviceName"], | ||
| status: DeploymentStatusFromJSON(json["status"]), | ||
| updateDate: json["updateDate"] == null ? undefined : new Date(json["updateDate"]), | ||
| serviceErrorMessages: json["serviceErrorMessages"].map(ResourceInstallErrorFromJSON), | ||
| errorMessage: json["errorMessage"] == null ? undefined : json["errorMessage"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/WorkflowAction.ts | ||
| function WorkflowActionFromJSON(json) { | ||
| return WorkflowActionFromJSONTyped(json, false); | ||
| } | ||
| function WorkflowActionFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/WorkflowError.ts | ||
| function WorkflowErrorFromJSON(json) { | ||
| return WorkflowErrorFromJSONTyped(json, false); | ||
| } | ||
| function WorkflowErrorFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| errorMessage: json["errorMessage"], | ||
| serviceMessage: json["serviceMessage"] == null ? undefined : json["serviceMessage"], | ||
| exceptionTrace: json["exceptionTrace"] == null ? undefined : json["exceptionTrace"], | ||
| serviceName: json["serviceName"] == null ? undefined : json["serviceName"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionOrigin.ts | ||
| function PackageVersionOriginFromJSON(json) { | ||
| return PackageVersionOriginFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionOriginFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentRunStatus.ts | ||
| function DeploymentRunStatusFromJSON(json) { | ||
| return DeploymentRunStatusFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentRunStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| deploymentKey: json["deploymentKey"], | ||
| installDeploymentKey: json["installDeploymentKey"], | ||
| deploymentName: json["deploymentName"], | ||
| configurationKey: json["configurationKey"], | ||
| installedRootFolderKey: json["installedRootFolderKey"] == null ? undefined : json["installedRootFolderKey"], | ||
| packageName: json["packageName"], | ||
| packageVersion: json["packageVersion"], | ||
| packageVersionOrigin: PackageVersionOriginFromJSON(json["packageVersionOrigin"]), | ||
| packageVersionKey: json["packageVersionKey"], | ||
| status: DeploymentStatusFromJSON(json["status"]), | ||
| authorName: json["authorName"], | ||
| startDate: new Date(json["startDate"]), | ||
| endDate: json["endDate"] == null ? undefined : new Date(json["endDate"]), | ||
| errorMessage: json["errorMessage"] == null ? undefined : json["errorMessage"].map(WorkflowErrorFromJSON), | ||
| actions: json["actions"].map(WorkflowActionFromJSON), | ||
| operation: DeploymentOperationFromJSON(json["operation"]), | ||
| services: json["services"].map(DeploymentRunServiceStatusFromJSON), | ||
| supportsAutomaticActivation: json["supportsAutomaticActivation"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentScheduleErrorDto.ts | ||
| function DeploymentScheduleErrorDtoFromJSON(json) { | ||
| return DeploymentScheduleErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentScheduleErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| errorText: json["errorText"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/DeploymentValidationErrorType.ts | ||
| function DeploymentValidationErrorTypeFromJSON(json) { | ||
| return DeploymentValidationErrorTypeFromJSONTyped(json, false); | ||
| } | ||
| function DeploymentValidationErrorTypeFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ExtendedPackageVersionState.ts | ||
| function ExtendedPackageVersionStateFromJSON(json) { | ||
| return ExtendedPackageVersionStateFromJSONTyped(json, false); | ||
| } | ||
| function ExtendedPackageVersionStateFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/FolderInfo.ts | ||
| function FolderInfoFromJSON(json) { | ||
| return FolderInfoFromJSONTyped(json, false); | ||
| } | ||
| function FolderInfoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| fullyQualifiedName: json["fullyQualifiedName"], | ||
| path: json["path"] == null ? undefined : json["path"], | ||
| folderKey: json["folderKey"] == null ? undefined : json["folderKey"], | ||
| serviceFolderKey: json["serviceFolderKey"] == null ? undefined : json["serviceFolderKey"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResourceTaskStatus.ts | ||
| function ResourceTaskStatusFromJSON(json) { | ||
| return ResourceTaskStatusFromJSONTyped(json, false); | ||
| } | ||
| function ResourceTaskStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackagePublishResult.ts | ||
| function PackagePublishResultFromJSON(json) { | ||
| return PackagePublishResultFromJSONTyped(json, false); | ||
| } | ||
| function PackagePublishResultFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| status: ResourceTaskStatusFromJSON(json["status"]), | ||
| packageName: json["packageName"], | ||
| packageVersionKey: json["packageVersionKey"] == null ? undefined : json["packageVersionKey"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ResourceStats.ts | ||
| function ResourceStatsFromJSON(json) { | ||
| return ResourceStatsFromJSONTyped(json, false); | ||
| } | ||
| function ResourceStatsFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| count: json["count"], | ||
| kind: json["kind"], | ||
| serviceName: json["serviceName"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionResourceDto.ts | ||
| function PackageVersionResourceDtoFromJSON(json) { | ||
| return PackageVersionResourceDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionResourceDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| key: json["key"], | ||
| name: json["name"], | ||
| kind: json["kind"], | ||
| type: json["type"] == null ? undefined : json["type"], | ||
| apiVersion: json["apiVersion"], | ||
| folders: json["folders"].map(FolderInfoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionComponentsDto.ts | ||
| function PackageVersionComponentsDtoFromJSON(json) { | ||
| return PackageVersionComponentsDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionComponentsDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| count: json["count"], | ||
| resources: json["resources"].map(PackageVersionResourceDtoFromJSON), | ||
| stats: json["stats"].map(ResourceStatsFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionInfoDto.ts | ||
| function PackageVersionInfoDtoFromJSON(json) { | ||
| return PackageVersionInfoDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionInfoDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| key: json["key"], | ||
| packageName: json["packageName"], | ||
| packageVersion: json["packageVersion"], | ||
| publishDate: new Date(json["publishDate"]), | ||
| authorName: json["authorName"], | ||
| authorEmail: json["authorEmail"] == null ? undefined : json["authorEmail"], | ||
| description: json["description"] == null ? undefined : json["description"], | ||
| releaseNotes: json["releaseNotes"] == null ? undefined : json["releaseNotes"], | ||
| state: ExtendedPackageVersionStateFromJSON(json["state"]), | ||
| solutionRootFolderName: json["solutionRootFolderName"], | ||
| locationKey: json["locationKey"] == null ? undefined : json["locationKey"], | ||
| components: json["components"] == null ? undefined : PackageVersionComponentsDtoFromJSON(json["components"]) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PackageVersionInfoExtendedDto.ts | ||
| function PackageVersionInfoExtendedDtoFromJSON(json) { | ||
| return PackageVersionInfoExtendedDtoFromJSONTyped(json, false); | ||
| } | ||
| function PackageVersionInfoExtendedDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| key: json["key"], | ||
| packageName: json["packageName"], | ||
| packageVersion: json["packageVersion"], | ||
| publishDate: new Date(json["publishDate"]), | ||
| authorName: json["authorName"], | ||
| authorEmail: json["authorEmail"] == null ? undefined : json["authorEmail"], | ||
| description: json["description"] == null ? undefined : json["description"], | ||
| releaseNotes: json["releaseNotes"] == null ? undefined : json["releaseNotes"], | ||
| state: ExtendedPackageVersionStateFromJSON(json["state"]), | ||
| solutionRootFolderName: json["solutionRootFolderName"], | ||
| locationKey: json["locationKey"] == null ? undefined : json["locationKey"], | ||
| components: json["components"] == null ? undefined : PackageVersionComponentsDtoFromJSON(json["components"]), | ||
| lastOperation: DeploymentOperationFromJSON(json["lastOperation"]), | ||
| lastOperationStatus: DeploymentOperationStatusFromJSON(json["lastOperationStatus"]), | ||
| lastOperationInstanceId: json["lastOperationInstanceId"] == null ? undefined : json["lastOperationInstanceId"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentConflictErrorDto.ts | ||
| function PipelineDeploymentConflictErrorDtoFromJSON(json) { | ||
| return PipelineDeploymentConflictErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentConflictErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"], | ||
| name: json["name"], | ||
| resourceKey: json["resourceKey"], | ||
| errorType: json["errorType"] == null ? undefined : DeploymentValidationErrorTypeFromJSON(json["errorType"]), | ||
| errorText: json["errorText"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"], | ||
| conflictFixingActions: json["conflictFixingActions"].map(DeploymentResourceValidationActionFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentValidationErrorDto.ts | ||
| function PipelineDeploymentValidationErrorDtoFromJSON(json) { | ||
| return PipelineDeploymentValidationErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentValidationErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| kind: json["kind"], | ||
| name: json["name"], | ||
| resourceKey: json["resourceKey"], | ||
| errorType: json["errorType"] == null ? undefined : DeploymentValidationErrorTypeFromJSON(json["errorType"]), | ||
| errorText: json["errorText"], | ||
| errorCode: json["errorCode"] == null ? undefined : json["errorCode"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentValidationResultDto.ts | ||
| function PipelineDeploymentValidationResultDtoFromJSON(json) { | ||
| return PipelineDeploymentValidationResultDtoFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentValidationResultDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| success: json["success"] == null ? undefined : json["success"], | ||
| validationErrors: json["validationErrors"].map(PipelineDeploymentValidationErrorDtoFromJSON), | ||
| conflictErrors: json["conflictErrors"].map(PipelineDeploymentConflictErrorDtoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentStatus.ts | ||
| function PipelineDeploymentStatusFromJSON(json) { | ||
| return PipelineDeploymentStatusFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentResult.ts | ||
| function PipelineDeploymentResultFromJSON(json) { | ||
| return PipelineDeploymentResultFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentResultFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| status: PipelineDeploymentStatusFromJSON(json["status"]), | ||
| validationResult: PipelineDeploymentValidationResultDtoFromJSON(json["validationResult"]), | ||
| deploymentResult: json["deploymentResult"] == null ? undefined : DeploymentRunStatusFromJSON(json["deploymentResult"]), | ||
| deploymentKey: json["deploymentKey"], | ||
| configurationKey: json["configurationKey"], | ||
| instanceId: json["instanceId"] == null ? undefined : json["instanceId"], | ||
| conflictFixingErrors: json["conflictFixingErrors"].map(PipelineDeploymentValidationErrorDtoFromJSON), | ||
| deploymentScheduleErrors: json["deploymentScheduleErrors"].map(DeploymentScheduleErrorDtoFromJSON) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PipelineDeploymentResultRef.ts | ||
| function PipelineDeploymentResultRefFromJSON(json) { | ||
| return PipelineDeploymentResultRefFromJSONTyped(json, false); | ||
| } | ||
| function PipelineDeploymentResultRefFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| pipelineDeploymentId: json["pipelineDeploymentId"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SolutionProjectSyncStatus.ts | ||
| function SolutionProjectSyncStatusFromJSON(json) { | ||
| return SolutionProjectSyncStatusFromJSONTyped(json, false); | ||
| } | ||
| function SolutionProjectSyncStatusFromJSONTyped(json, ignoreDiscriminator) { | ||
| return json; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SolutionProjectSyncErrorDto.ts | ||
| function SolutionProjectSyncErrorDtoFromJSON(json) { | ||
| return SolutionProjectSyncErrorDtoFromJSONTyped(json, false); | ||
| } | ||
| function SolutionProjectSyncErrorDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| serviceName: json["serviceName"], | ||
| resourceIdentifiers: json["resourceIdentifiers"].map(BaseResourceIdentifierFromJSON), | ||
| errorMessage: json["errorMessage"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/ProjectSynchronizationDto.ts | ||
| function ProjectSynchronizationDtoFromJSON(json) { | ||
| return ProjectSynchronizationDtoFromJSONTyped(json, false); | ||
| } | ||
| function ProjectSynchronizationDtoFromJSONTyped(json, ignoreDiscriminator) { | ||
| if (json == null) { | ||
| return json; | ||
| } | ||
| return { | ||
| projectName: json["projectName"], | ||
| syncErrors: json["syncErrors"].map(SolutionProjectSyncErrorDtoFromJSON), | ||
| status: SolutionProjectSyncStatusFromJSON(json["status"]) | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/PublishProjectRequest.ts | ||
| function PublishProjectRequestToJSON(json) { | ||
| return PublishProjectRequestToJSONTyped(json, false); | ||
| } | ||
| function PublishProjectRequestToJSONTyped(value, ignoreDiscriminator = false) { | ||
| if (value == null) { | ||
| return value; | ||
| } | ||
| return { | ||
| packageName: value["packageName"], | ||
| packageVersion: value["packageVersion"], | ||
| description: value["description"], | ||
| releaseNotes: value["releaseNotes"], | ||
| solutionRootFolderName: value["solutionRootFolderName"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SyncOption.ts | ||
| function SyncOptionToJSON(value) { | ||
| return value; | ||
| } | ||
| // ../pipelines-sdk/generated/src/models/SyncProjectOptions.ts | ||
| function SyncProjectOptionsToJSON(json) { | ||
| return SyncProjectOptionsToJSONTyped(json, false); | ||
| } | ||
| function SyncProjectOptionsToJSONTyped(value, ignoreDiscriminator = false) { | ||
| if (value == null) { | ||
| return value; | ||
| } | ||
| return { | ||
| syncOption: SyncOptionToJSON(value["syncOption"]), | ||
| autoRemoveDeletedResources: value["autoRemoveDeletedResources"] | ||
| }; | ||
| } | ||
| // ../pipelines-sdk/generated/src/apis/PipelinesApi.ts | ||
| class PipelinesApi extends BaseAPI { | ||
| async pipelinesActivateRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesActivate().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/activate`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentActivateResponseFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesActivate(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesActivateRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetDeploymentInstanceStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["instanceId"] == null) { | ||
| throw new RequiredError("instanceId", 'Required parameter "instanceId" was null or undefined when calling pipelinesGetDeploymentInstanceStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{instanceId}/status`; | ||
| urlPath = urlPath.replace(`{${"instanceId"}}`, encodeURIComponent(String(requestParameters["instanceId"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentRunStatusFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetDeploymentInstanceStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetDeploymentInstanceStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPackagePublishStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesGetPackagePublishStatus().'); | ||
| } | ||
| if (requestParameters["packageVersion"] == null) { | ||
| throw new RequiredError("packageVersion", 'Required parameter "packageVersion" was null or undefined when calling pipelinesGetPackagePublishStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/publish-status/{packageVersion}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"packageVersion"}}`, encodeURIComponent(String(requestParameters["packageVersion"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PackagePublishResultFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPackagePublishStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPackagePublishStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPackageVersionRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesGetPackageVersion().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["packageVersion"] != null) { | ||
| queryParameters["packageVersion"] = requestParameters["packageVersion"]; | ||
| } | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PackageVersionInfoExtendedDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPackageVersion(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPackageVersionRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPipelineDeploymentStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["pipelineDeploymentId"] == null) { | ||
| throw new RequiredError("pipelineDeploymentId", 'Required parameter "pipelineDeploymentId" was null or undefined when calling pipelinesGetPipelineDeploymentStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{pipelineDeploymentId}/deployment-status`; | ||
| urlPath = urlPath.replace(`{${"pipelineDeploymentId"}}`, encodeURIComponent(String(requestParameters["pipelineDeploymentId"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PipelineDeploymentResultFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPipelineDeploymentStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPipelineDeploymentStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetPreActivateStepsRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesGetPreActivateSteps().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/pre-activate-steps`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentPreActivateStepsDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetPreActivateSteps(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetPreActivateStepsRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetProjectSyncStatusRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["projectName"] == null) { | ||
| throw new RequiredError("projectName", 'Required parameter "projectName" was null or undefined when calling pipelinesGetProjectSyncStatus().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/projects/{projectName}/sync-status`; | ||
| urlPath = urlPath.replace(`{${"projectName"}}`, encodeURIComponent(String(requestParameters["projectName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => ProjectSynchronizationDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesGetProjectSyncStatus(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetProjectSyncStatusRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesGetSolutionPackageConfigurationRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesGetSolutionPackageConfiguration().'); | ||
| } | ||
| if (requestParameters["format"] == null) { | ||
| throw new RequiredError("format", 'Required parameter "format" was null or undefined when calling pipelinesGetSolutionPackageConfiguration().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["packageVersion"] != null) { | ||
| queryParameters["packageVersion"] = requestParameters["packageVersion"]; | ||
| } | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/config.{format}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"format"}}`, encodeURIComponent(String(requestParameters["format"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| if (this.isJsonMime(response.headers.get("content-type"))) { | ||
| return new JSONApiResponse(response); | ||
| } else { | ||
| return new TextApiResponse(response); | ||
| } | ||
| } | ||
| async pipelinesGetSolutionPackageConfiguration(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesGetSolutionPackageConfigurationRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesInstallRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| if (requestParameters["packageVersion"] == null) { | ||
| throw new RequiredError("packageVersion", 'Required parameter "packageVersion" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| if (requestParameters["solutionRootFolderName"] == null) { | ||
| throw new RequiredError("solutionRootFolderName", 'Required parameter "solutionRootFolderName" was null or undefined when calling pipelinesInstall().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["folderFullyQualifiedName"] != null) { | ||
| queryParameters["folderFullyQualifiedName"] = requestParameters["folderFullyQualifiedName"]; | ||
| } | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/json"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/deploy-from-package/{packageName}/{packageVersion}/to-folder/{solutionRootFolderName}`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"packageVersion"}}`, encodeURIComponent(String(requestParameters["packageVersion"]))); | ||
| urlPath = urlPath.replace(`{${"solutionRootFolderName"}}`, encodeURIComponent(String(requestParameters["solutionRootFolderName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: requestParameters["body"] | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PipelineDeploymentResultRefFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesInstall(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesInstallRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesPackageDeleteRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesPackageDelete().'); | ||
| } | ||
| if (requestParameters["packageVersion"] == null) { | ||
| throw new RequiredError("packageVersion", 'Required parameter "packageVersion" was null or undefined when calling pipelinesPackageDelete().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/{packageVersion}`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| urlPath = urlPath.replace(`{${"packageVersion"}}`, encodeURIComponent(String(requestParameters["packageVersion"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "DELETE", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new VoidApiResponse(response); | ||
| } | ||
| async pipelinesPackageDelete(requestParameters, initOverrides) { | ||
| await this.pipelinesPackageDeleteRaw(requestParameters, initOverrides); | ||
| } | ||
| async pipelinesPackageDownloadRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["packageName"] == null) { | ||
| throw new RequiredError("packageName", 'Required parameter "packageName" was null or undefined when calling pipelinesPackageDownload().'); | ||
| } | ||
| const queryParameters = {}; | ||
| if (requestParameters["packageVersion"] != null) { | ||
| queryParameters["packageVersion"] = requestParameters["packageVersion"]; | ||
| } | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages/{packageName}/download`; | ||
| urlPath = urlPath.replace(`{${"packageName"}}`, encodeURIComponent(String(requestParameters["packageName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "GET", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => BlobFileAccessDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesPackageDownload(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesPackageDownloadRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesPackageUploadRaw(requestParameters, initOverrides) { | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/zip"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/packages`; | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: requestParameters["body"] | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => PackageVersionInfoDtoFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesPackageUpload(requestParameters = {}, initOverrides) { | ||
| const response = await this.pipelinesPackageUploadRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesPublishProjectRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["projectName"] == null) { | ||
| throw new RequiredError("projectName", 'Required parameter "projectName" was null or undefined when calling pipelinesPublishProject().'); | ||
| } | ||
| if (requestParameters["publishProjectRequest"] == null) { | ||
| throw new RequiredError("publishProjectRequest", 'Required parameter "publishProjectRequest" was null or undefined when calling pipelinesPublishProject().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/json"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/projects/{projectName}/publish`; | ||
| urlPath = urlPath.replace(`{${"projectName"}}`, encodeURIComponent(String(requestParameters["projectName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: PublishProjectRequestToJSON(requestParameters["publishProjectRequest"]) | ||
| }, initOverrides); | ||
| return new BlobApiResponse(response); | ||
| } | ||
| async pipelinesPublishProject(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesPublishProjectRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesSyncProjectRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["projectName"] == null) { | ||
| throw new RequiredError("projectName", 'Required parameter "projectName" was null or undefined when calling pipelinesSyncProject().'); | ||
| } | ||
| if (requestParameters["syncProjectOptions"] == null) { | ||
| throw new RequiredError("syncProjectOptions", 'Required parameter "syncProjectOptions" was null or undefined when calling pipelinesSyncProject().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| headerParameters["Content-Type"] = "application/json"; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/projects/{projectName}/sync`; | ||
| urlPath = urlPath.replace(`{${"projectName"}}`, encodeURIComponent(String(requestParameters["projectName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters, | ||
| body: SyncProjectOptionsToJSON(requestParameters["syncProjectOptions"]) | ||
| }, initOverrides); | ||
| return new BlobApiResponse(response); | ||
| } | ||
| async pipelinesSyncProject(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesSyncProjectRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| async pipelinesUninstallRaw(requestParameters, initOverrides) { | ||
| if (requestParameters["deploymentName"] == null) { | ||
| throw new RequiredError("deploymentName", 'Required parameter "deploymentName" was null or undefined when calling pipelinesUninstall().'); | ||
| } | ||
| const queryParameters = {}; | ||
| const headerParameters = {}; | ||
| if (this.configuration && this.configuration.accessToken) { | ||
| const token = this.configuration.accessToken; | ||
| const tokenString = await token("Bearer", []); | ||
| if (tokenString) { | ||
| headerParameters["Authorization"] = `Bearer ${tokenString}`; | ||
| } | ||
| } | ||
| let urlPath = `/v1/pipelines/deployments/{deploymentName}/uninstall`; | ||
| urlPath = urlPath.replace(`{${"deploymentName"}}`, encodeURIComponent(String(requestParameters["deploymentName"]))); | ||
| const response = await this.request({ | ||
| path: urlPath, | ||
| method: "POST", | ||
| headers: headerParameters, | ||
| query: queryParameters | ||
| }, initOverrides); | ||
| return new JSONApiResponse(response, (jsonValue) => DeploymentRunResponseFromJSON(jsonValue)); | ||
| } | ||
| async pipelinesUninstall(requestParameters, initOverrides) { | ||
| const response = await this.pipelinesUninstallRaw(requestParameters, initOverrides); | ||
| return await response.value(); | ||
| } | ||
| } | ||
| // ../pipelines-sdk/package.json | ||
| var package_default = { | ||
| name: "@uipath/pipelines-sdk", | ||
| license: "MIT", | ||
| version: "1.201.0", | ||
| description: "Generated TypeScript client for UiPath Pipelines API (CI/CD deployment lifecycle)", | ||
| repository: { | ||
| type: "git", | ||
| url: "https://github.com/UiPath/cli.git", | ||
| directory: "packages/pipelines-sdk" | ||
| }, | ||
| publishConfig: { | ||
| registry: "https://npm.pkg.github.com/@uipath" | ||
| }, | ||
| keywords: [ | ||
| "uipath", | ||
| "pipelines", | ||
| "sdk" | ||
| ], | ||
| type: "module", | ||
| main: "./dist/index.js", | ||
| types: "./dist/src/index.d.ts", | ||
| exports: { | ||
| ".": { | ||
| types: "./dist/src/index.d.ts", | ||
| default: "./dist/index.js" | ||
| } | ||
| }, | ||
| bin: { | ||
| "generate-pipelines-sdk": "./dist/scripts/generate-sdk.js" | ||
| }, | ||
| files: [ | ||
| "dist" | ||
| ], | ||
| private: true, | ||
| scripts: { | ||
| build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && bun build ./src/scripts/generate-sdk.ts --outdir dist/scripts --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck", | ||
| generate: "bun run src/scripts/generate-sdk.ts", | ||
| lint: "biome check .", | ||
| test: "vitest run", | ||
| "test:coverage": "vitest run --coverage" | ||
| }, | ||
| devDependencies: { | ||
| "@openapitools/openapi-generator-cli": "^2.31.1", | ||
| "@types/node": "^25.5.2", | ||
| "@uipath/common": "workspace:*", | ||
| typescript: "^7.0.2" | ||
| } | ||
| }; | ||
| // ../pipelines-sdk/src/user-agent.ts | ||
| var SDK_USER_AGENT = getSdkUserAgentToken(package_default); | ||
| installSdkUserAgentHeader(BaseAPI, SDK_USER_AGENT); | ||
| // src/services/personal-workspace-resolver.ts | ||
| async function resolvePersonalWorkspace(options) { | ||
| const config = await createOrchestratorConfig(options); | ||
| const api = new PersonalWorkspacesApi(config); | ||
| const pw = await api.personalWorkspacesGetPersonalWorkspace(); | ||
| if (!pw?.key || !pw.name) { | ||
| throw new Error("Personal Workspace not configured for the current user. " + "Enable Personal Workspace in Orchestrator (or sign in as a user that has one), then retry."); | ||
| } | ||
| return { key: pw.key, name: pw.name }; | ||
| } | ||
| // src/services/publish-locations-service.ts | ||
| async function resolveStudioWebTarget(options) { | ||
| const loginStatus = await getLoginStatusAsync({ | ||
| ensureTokenValidityMinutes: options?.loginValidity, | ||
| envFilePath: options?.envFilePath | ||
| }); | ||
| if (loginStatus.loginStatus !== "Logged in" || !loginStatus.accessToken || !loginStatus.baseUrl) { | ||
| throw new Error("Not logged in. Run 'uip login' first."); | ||
| } | ||
| if (!loginStatus.organizationName) { | ||
| throw new Error("Organization name is not available. Re-authenticate with 'uip login'."); | ||
| } | ||
| if (options?.tenant && loginStatus.tenantName && options.tenant.toLowerCase() !== loginStatus.tenantName.toLowerCase()) { | ||
| throw new Error(`Feeds are resolved for the logged-in tenant ('${loginStatus.tenantName}'), so --tenant '${options.tenant}' can't apply here. Switch tenants first with: uip login tenant set ${options.tenant}.`); | ||
| } | ||
| return { | ||
| config: { | ||
| baseUrl: loginStatus.baseUrl, | ||
| authToken: loginStatus.accessToken, | ||
| tenantId: loginStatus.tenantId | ||
| }, | ||
| organizationName: loginStatus.organizationName | ||
| }; | ||
| } | ||
| function isSelectableFeed(location) { | ||
| switch (location.type) { | ||
| case "Tenant": | ||
| case "Folder": | ||
| return true; | ||
| case "PersonalWorkspace": | ||
| return location.isMyPersonalWorkspace; | ||
| default: | ||
| return false; | ||
| } | ||
| } | ||
| async function listSelectablePublishLocations(options) { | ||
| const { config, organizationName } = await resolveStudioWebTarget(options); | ||
| const all = await getAvailablePublishLocationsV2(config, organizationName); | ||
| return all.filter(isSelectableFeed); | ||
| } | ||
| // src/services/feed-resolver.ts | ||
| function folderKeyInitOverride(folderKey) { | ||
| return async ({ init }) => ({ | ||
| headers: { ...init.headers, "X-UIPATH-FolderKey": folderKey } | ||
| }); | ||
| } | ||
| function feedScopeInitOverride(scope) { | ||
| const { folderKey } = scope; | ||
| if (!folderKey) { | ||
| return; | ||
| } | ||
| return folderKeyInitOverride(folderKey); | ||
| } | ||
| function feedResolutionFailureInstructions(options) { | ||
| if (options.personalWorkspace) { | ||
| return "Personal Workspace resolution needs an interactive user session and an enabled Personal Workspace. Log in as a user with a Personal Workspace, or omit --personal-workspace to use the tenant feed."; | ||
| } | ||
| if (options.feed !== undefined) { | ||
| return "List the feeds you can target with: uip solution feeds list."; | ||
| } | ||
| return "Check the selected feed and try again."; | ||
| } | ||
| async function resolveFeedScope(options) { | ||
| const { personalWorkspace, feed } = options; | ||
| if (personalWorkspace && feed !== undefined) { | ||
| throw new Error("Use either --personal-workspace or --feed, not both."); | ||
| } | ||
| if (personalWorkspace) { | ||
| const pw = await resolvePersonalWorkspace({ | ||
| tenant: options.tenant, | ||
| loginValidity: options.loginValidity, | ||
| envFilePath: options.envFilePath | ||
| }); | ||
| return { kind: "personal", folderKey: pw.key, name: pw.name }; | ||
| } | ||
| if (feed !== undefined) { | ||
| return resolveNamedFeed(feed, options); | ||
| } | ||
| return { kind: "tenant" }; | ||
| } | ||
| async function resolveNamedFeed(feed, options) { | ||
| const locations = await listSelectablePublishLocations({ | ||
| tenant: options.tenant, | ||
| envFilePath: options.envFilePath, | ||
| loginValidity: options.loginValidity | ||
| }); | ||
| const match = matchFeed(feed, locations); | ||
| const kind = match.type === "Tenant" ? "tenant" : match.type === "PersonalWorkspace" ? "personal" : "folder"; | ||
| if (kind !== "tenant" && !match.key) { | ||
| throw new Error(`Feed '${match.name || feed}' has no folder key in the publish-locations response, so it can't be targeted. Run 'uip solution feeds list' and pick a feed with a Key.`); | ||
| } | ||
| return { | ||
| kind, | ||
| folderKey: kind === "tenant" ? undefined : match.key, | ||
| name: match.name | ||
| }; | ||
| } | ||
| function matchFeed(feed, locations) { | ||
| const byKey = locations.find((location) => location.key === feed); | ||
| if (byKey) { | ||
| return byKey; | ||
| } | ||
| const target = feed.toLowerCase(); | ||
| const byName = locations.filter((location) => location.name.toLowerCase() === target); | ||
| if (byName.length === 1) { | ||
| return byName[0]; | ||
| } | ||
| if (byName.length > 1) { | ||
| throw new Error(`More than one feed is named '${feed}'. Pass its key instead — ` + "'uip solution feeds list' shows each feed's key."); | ||
| } | ||
| throw new Error(`Feed '${feed}' is not an available publish location. ` + "Run 'uip solution feeds list' to see the feeds you can publish to."); | ||
| } | ||
| export { Configuration, PipelinesApi, resolvePersonalWorkspace, listSelectablePublishLocations, folderKeyInitOverride, feedScopeInitOverride, feedResolutionFailureInstructions, resolveFeedScope }; | ||
| //# debugId=4D61A5C05C04282A64756E2164756E21 |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
27
-3.57%