@uipath/solution-sdk 1.196.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/generated/src/apis/ConfigurationsApi.d.ts +28 -0
- package/dist/generated/src/apis/DeploymentsApi.d.ts +49 -0
- package/dist/generated/src/apis/PackagesApi.d.ts +88 -0
- package/dist/generated/src/apis/ProjectsApi.d.ts +37 -0
- package/dist/generated/src/apis/SearchApi.d.ts +38 -0
- package/dist/generated/src/apis/SettingsApi.d.ts +32 -0
- package/dist/generated/src/apis/index.d.ts +6 -0
- package/dist/generated/src/index.d.ts +3 -0
- package/dist/generated/src/models/BlobFileAccessDto.d.ts +45 -0
- package/dist/generated/src/models/CreateConfigurationCommand.d.ts +38 -0
- package/dist/generated/src/models/DeploymentActivationStatus.d.ts +30 -0
- package/dist/generated/src/models/DeploymentAutoRequest.d.ts +52 -0
- package/dist/generated/src/models/DeploymentDto.d.ts +38 -0
- package/dist/generated/src/models/DeploymentItemDto.d.ts +215 -0
- package/dist/generated/src/models/DeploymentOperation.d.ts +29 -0
- package/dist/generated/src/models/DeploymentOperationStatus.d.ts +28 -0
- package/dist/generated/src/models/DeploymentRequest.d.ts +69 -0
- package/dist/generated/src/models/DeploymentSearchItemDto2.d.ts +206 -0
- package/dist/generated/src/models/DeploymentStatus.d.ts +33 -0
- package/dist/generated/src/models/DeploymentType.d.ts +25 -0
- package/dist/generated/src/models/DeploymentUpgradeType.d.ts +27 -0
- package/dist/generated/src/models/DeploymentsSearchRequest2.d.ts +114 -0
- package/dist/generated/src/models/ExtendedPackageVersionState.d.ts +27 -0
- package/dist/generated/src/models/FolderInfo.d.ts +44 -0
- package/dist/generated/src/models/LocationDto.d.ts +44 -0
- package/dist/generated/src/models/OrderByDirection.d.ts +25 -0
- package/dist/generated/src/models/Overwrite.d.ts +63 -0
- package/dist/generated/src/models/OverwriteType.d.ts +25 -0
- package/dist/generated/src/models/PackageInfo.d.ts +99 -0
- package/dist/generated/src/models/PackageVersionComponentsDto.d.ts +46 -0
- package/dist/generated/src/models/PackageVersionInfoDto.d.ts +100 -0
- package/dist/generated/src/models/PackageVersionOrigin.d.ts +27 -0
- package/dist/generated/src/models/PackageVersionResourceDto.d.ts +63 -0
- package/dist/generated/src/models/PageInfoDtoOfDeploymentSearchItemDto2.d.ts +39 -0
- package/dist/generated/src/models/PageInfoDtoOfPackageInfo.d.ts +39 -0
- package/dist/generated/src/models/ProblemDetails.d.ts +57 -0
- package/dist/generated/src/models/ProjectCreateRequest.d.ts +38 -0
- package/dist/generated/src/models/ProjectDto.d.ts +75 -0
- package/dist/generated/src/models/ProjectImportStatus.d.ts +27 -0
- package/dist/generated/src/models/ResourceOverwrite.d.ts +45 -0
- package/dist/generated/src/models/ResourceStats.d.ts +44 -0
- package/dist/generated/src/models/ResponseDictionaryDto.d.ts +38 -0
- package/dist/generated/src/models/RuntimeSetup.d.ts +32 -0
- package/dist/generated/src/models/SearchFilter.d.ts +57 -0
- package/dist/generated/src/models/WorkflowAction.d.ts +29 -0
- package/dist/generated/src/models/index.d.ts +37 -0
- package/dist/generated/src/runtime.d.ts +184 -0
- package/dist/index.js +15612 -0
- package/dist/index.js.map +159 -0
- package/dist/scripts/generate-sdk.js +176 -0
- package/dist/scripts/generate-sdk.js.map +10 -0
- package/dist/src/bundle-service.d.ts +25 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/solution-file.d.ts +133 -0
- package/dist/src/types.d.ts +42 -0
- package/dist/src/upload-service.d.ts +34 -0
- package/dist/src/user-agent.d.ts +1 -0
- package/dist/src/zip-utils.d.ts +63 -0
- package/package.json +44 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
|
|
4
|
+
// src/scripts/generate-sdk.ts
|
|
5
|
+
import { execSync } from "child_process";
|
|
6
|
+
import { mkdir, rm, writeFile } from "fs/promises";
|
|
7
|
+
import { dirname, join } from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
var SWAGGER_URL = "https://alpha.uipath.com/uipattycyrhx/abizon_1/automationsolutions_/swagger/v1.0/swagger.json";
|
|
10
|
+
var __dirname2 = import.meta.dir ?? dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
var PKG_ROOT = join(__dirname2, "../..");
|
|
12
|
+
var OUTPUT_DIR = join(PKG_ROOT, "generated");
|
|
13
|
+
var TEMP_DIR = join(PKG_ROOT, "temp");
|
|
14
|
+
var GENERATE_DIR = join(PKG_ROOT, "swagger");
|
|
15
|
+
var IGNORED_GENERATOR_OUTPUTS = [
|
|
16
|
+
"package.json",
|
|
17
|
+
"tsconfig.json",
|
|
18
|
+
"tsconfig.esm.json",
|
|
19
|
+
".npmignore",
|
|
20
|
+
".gitignore"
|
|
21
|
+
];
|
|
22
|
+
async function downloadSwagger() {
|
|
23
|
+
console.log("Downloading swagger.json...");
|
|
24
|
+
const response = await fetch(SWAGGER_URL);
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
throw new Error(`Failed to download swagger: ${response.statusText}`);
|
|
27
|
+
}
|
|
28
|
+
return await response.json();
|
|
29
|
+
}
|
|
30
|
+
function filterSwaggerPaths(swagger) {
|
|
31
|
+
const filteredPaths = {};
|
|
32
|
+
const excludedPathPrefixes = [
|
|
33
|
+
"/api/blobfileaccess",
|
|
34
|
+
"/api/configurations/",
|
|
35
|
+
"/api/deployments/",
|
|
36
|
+
"/api/lookups/",
|
|
37
|
+
"/api/messagebus",
|
|
38
|
+
"/api/metadata",
|
|
39
|
+
"/api/projects/",
|
|
40
|
+
"/api/resourcecatalog/",
|
|
41
|
+
"/api/search/",
|
|
42
|
+
"/api/settings/",
|
|
43
|
+
"/api/translations",
|
|
44
|
+
"/api/users/",
|
|
45
|
+
"/api/v1/projects/",
|
|
46
|
+
"/api/v1/solutions/",
|
|
47
|
+
"/api/v2/search/",
|
|
48
|
+
"/api/v3/search/"
|
|
49
|
+
];
|
|
50
|
+
const explicitlyIncludedPaths = [
|
|
51
|
+
"/api/deployments/{deploymentKey}",
|
|
52
|
+
"/api/deployments/deploy",
|
|
53
|
+
"/api/search/packages",
|
|
54
|
+
"/api/v3/search/deployments"
|
|
55
|
+
];
|
|
56
|
+
for (const [path, methods] of Object.entries(swagger.paths)) {
|
|
57
|
+
const isExplicitlyIncluded = explicitlyIncludedPaths.includes(path);
|
|
58
|
+
const shouldExclude = !isExplicitlyIncluded && excludedPathPrefixes.some((prefix) => path.startsWith(prefix));
|
|
59
|
+
if (shouldExclude) {
|
|
60
|
+
console.log(` Skipping path: ${path} (problematic headers)`);
|
|
61
|
+
} else {
|
|
62
|
+
if (path === "/api/deployments/{deploymentKey}") {
|
|
63
|
+
const pathMethods = methods;
|
|
64
|
+
filteredPaths[path] = { get: pathMethods.get };
|
|
65
|
+
console.log(`Including path: GET ${path} (explicitly included)`);
|
|
66
|
+
} else {
|
|
67
|
+
filteredPaths[path] = methods;
|
|
68
|
+
console.log(`Including path: ${path}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
...swagger,
|
|
74
|
+
paths: filteredPaths
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function collectReferencedSchemas(swagger, paths) {
|
|
78
|
+
const referenced = new Set;
|
|
79
|
+
const toProcess = [];
|
|
80
|
+
for (const methods of Object.values(paths)) {
|
|
81
|
+
for (const operation of Object.values(methods)) {
|
|
82
|
+
if (typeof operation === "object" && operation !== null) {
|
|
83
|
+
toProcess.push(operation);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const findRefs = (obj) => {
|
|
88
|
+
if (!obj || typeof obj !== "object")
|
|
89
|
+
return;
|
|
90
|
+
if (obj.$ref && typeof obj.$ref === "string") {
|
|
91
|
+
const match = obj.$ref.match(/#\/components\/schemas\/(.+)/);
|
|
92
|
+
if (match?.[1]) {
|
|
93
|
+
const schemaName = match[1];
|
|
94
|
+
if (!referenced.has(schemaName)) {
|
|
95
|
+
referenced.add(schemaName);
|
|
96
|
+
if (swagger.components?.schemas?.[schemaName]) {
|
|
97
|
+
findRefs(swagger.components.schemas[schemaName]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (Array.isArray(obj)) {
|
|
103
|
+
obj.forEach(findRefs);
|
|
104
|
+
} else if (typeof obj === "object") {
|
|
105
|
+
Object.values(obj).forEach(findRefs);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
toProcess.forEach(findRefs);
|
|
109
|
+
return referenced;
|
|
110
|
+
}
|
|
111
|
+
function filterUnusedSchemas(swagger) {
|
|
112
|
+
const referencedSchemas = collectReferencedSchemas(swagger, swagger.paths);
|
|
113
|
+
const filteredSchemas = {};
|
|
114
|
+
const totalSchemas = Object.keys(swagger.components?.schemas || {}).length;
|
|
115
|
+
console.log(`
|
|
116
|
+
Found ${referencedSchemas.size} referenced schemas out of ${totalSchemas} total`);
|
|
117
|
+
for (const schemaName of referencedSchemas) {
|
|
118
|
+
if (swagger.components?.schemas?.[schemaName]) {
|
|
119
|
+
filteredSchemas[schemaName] = swagger.components.schemas[schemaName];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
...swagger,
|
|
124
|
+
components: {
|
|
125
|
+
...swagger.components,
|
|
126
|
+
schemas: filteredSchemas
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
async function generateClient(filteredSwagger) {
|
|
131
|
+
console.log(`
|
|
132
|
+
Generating TypeScript client...`);
|
|
133
|
+
await rm(TEMP_DIR, { recursive: true, force: true });
|
|
134
|
+
await rm(OUTPUT_DIR, { recursive: true, force: true });
|
|
135
|
+
await mkdir(TEMP_DIR, { recursive: true });
|
|
136
|
+
await mkdir(OUTPUT_DIR, { recursive: true });
|
|
137
|
+
const swaggerPath = join(TEMP_DIR, "filtered-swagger.json");
|
|
138
|
+
await writeFile(swaggerPath, JSON.stringify(filteredSwagger, null, 2));
|
|
139
|
+
await writeFile(join(OUTPUT_DIR, ".openapi-generator-ignore"), `${IGNORED_GENERATOR_OUTPUTS.join(`
|
|
140
|
+
`)}
|
|
141
|
+
`);
|
|
142
|
+
const command = [
|
|
143
|
+
"npx @openapitools/openapi-generator-cli generate",
|
|
144
|
+
`-i ${swaggerPath}`,
|
|
145
|
+
`-g typescript-fetch`,
|
|
146
|
+
`-o ${OUTPUT_DIR}`,
|
|
147
|
+
"--skip-validate-spec",
|
|
148
|
+
"--additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=@uipath/solution-sdk"
|
|
149
|
+
].join(" ");
|
|
150
|
+
execSync(command, { stdio: "inherit" });
|
|
151
|
+
console.log("Client generated successfully!");
|
|
152
|
+
}
|
|
153
|
+
async function main() {
|
|
154
|
+
try {
|
|
155
|
+
const swagger = await downloadSwagger();
|
|
156
|
+
const filteredPaths = filterSwaggerPaths(swagger);
|
|
157
|
+
const filtered = filterUnusedSchemas(filteredPaths);
|
|
158
|
+
await mkdir(GENERATE_DIR, { recursive: true });
|
|
159
|
+
await writeFile(join(GENERATE_DIR, "swagger.json"), JSON.stringify(swagger, null, 2));
|
|
160
|
+
await writeFile(join(GENERATE_DIR, "filtered-swagger.json"), JSON.stringify(filtered, null, 2));
|
|
161
|
+
await generateClient(filtered);
|
|
162
|
+
await rm(TEMP_DIR, { recursive: true, force: true });
|
|
163
|
+
console.log(`
|
|
164
|
+
\u2705 Generated SDK available in: ${OUTPUT_DIR}`);
|
|
165
|
+
console.log(`\uD83D\uDCC1 Reference files saved in: ${GENERATE_DIR}`);
|
|
166
|
+
} catch (error) {
|
|
167
|
+
console.error("Error generating SDK:", error);
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (__require.main == __require.module) {
|
|
172
|
+
main();
|
|
173
|
+
}
|
|
174
|
+
export {
|
|
175
|
+
main as generateSdk
|
|
176
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/scripts/generate-sdk.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"#!/usr/bin/env bun\nimport { execSync } from \"node:child_process\";\nimport { mkdir, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst SWAGGER_URL =\n \"https://alpha.uipath.com/uipattycyrhx/abizon_1/automationsolutions_/swagger/v1.0/swagger.json\";\nconst __dirname = import.meta.dir ?? dirname(fileURLToPath(import.meta.url));\nconst PKG_ROOT = join(__dirname, \"../..\");\nconst OUTPUT_DIR = join(PKG_ROOT, \"generated\");\nconst TEMP_DIR = join(PKG_ROOT, \"temp\");\nconst GENERATE_DIR = join(PKG_ROOT, \"swagger\");\n\n// Files the openapi-generator would emit that we don't consume.\n// Only `src/**` is referenced by the outer package;\n// README.md and docs/ are kept as generated reference material.\nconst IGNORED_GENERATOR_OUTPUTS = [\n \"package.json\",\n \"tsconfig.json\",\n \"tsconfig.esm.json\",\n \".npmignore\",\n \".gitignore\",\n];\n\nasync function downloadSwagger(): Promise<any> {\n console.log(\"Downloading swagger.json...\");\n const response = await fetch(SWAGGER_URL);\n if (!response.ok) {\n throw new Error(`Failed to download swagger: ${response.statusText}`);\n }\n return await response.json();\n}\n\nfunction filterSwaggerPaths(swagger: any): any {\n const filteredPaths: any = {};\n\n // Exclude all endpoints except /api/packages/\n const excludedPathPrefixes = [\n \"/api/blobfileaccess\",\n \"/api/configurations/\",\n \"/api/deployments/\",\n \"/api/lookups/\",\n \"/api/messagebus\",\n \"/api/metadata\",\n \"/api/projects/\",\n \"/api/resourcecatalog/\",\n \"/api/search/\",\n \"/api/settings/\",\n \"/api/translations\",\n \"/api/users/\",\n \"/api/v1/projects/\",\n \"/api/v1/solutions/\",\n \"/api/v2/search/\",\n \"/api/v3/search/\",\n ];\n\n // Explicitly included paths that would otherwise be excluded by prefix rules\n const explicitlyIncludedPaths = [\n \"/api/deployments/{deploymentKey}\",\n \"/api/deployments/deploy\",\n \"/api/search/packages\",\n \"/api/v3/search/deployments\",\n ];\n\n for (const [path, methods] of Object.entries(swagger.paths)) {\n const isExplicitlyIncluded = explicitlyIncludedPaths.includes(path);\n const shouldExclude =\n !isExplicitlyIncluded &&\n excludedPathPrefixes.some((prefix) => path.startsWith(prefix));\n\n if (shouldExclude) {\n console.log(` Skipping path: ${path} (problematic headers)`);\n } else {\n // For explicitly included paths that have multiple methods,\n // only include the methods we need\n if (path === \"/api/deployments/{deploymentKey}\") {\n const pathMethods = methods as Record<string, any>;\n filteredPaths[path] = { get: pathMethods.get };\n console.log(\n `Including path: GET ${path} (explicitly included)`,\n );\n } else {\n filteredPaths[path] = methods;\n console.log(`Including path: ${path}`);\n }\n }\n }\n\n return {\n ...swagger,\n paths: filteredPaths,\n };\n}\n\nfunction collectReferencedSchemas(swagger: any, paths: any): Set<string> {\n const referenced = new Set<string>();\n const toProcess: any[] = [];\n\n // Start by collecting all schemas from paths\n for (const methods of Object.values(paths)) {\n for (const operation of Object.values(methods as any)) {\n if (typeof operation === \"object\" && operation !== null) {\n toProcess.push(operation);\n }\n }\n }\n\n // Recursively find all $ref references\n const findRefs = (obj: any) => {\n if (!obj || typeof obj !== \"object\") return;\n\n if (obj.$ref && typeof obj.$ref === \"string\") {\n // Extract schema name from \"#/components/schemas/MyDto\"\n const match = obj.$ref.match(/#\\/components\\/schemas\\/(.+)/);\n if (match?.[1]) {\n const schemaName = match[1];\n if (!referenced.has(schemaName)) {\n referenced.add(schemaName);\n // Recursively process this schema\n if (swagger.components?.schemas?.[schemaName]) {\n findRefs(swagger.components.schemas[schemaName]);\n }\n }\n }\n }\n\n // Traverse arrays and objects\n if (Array.isArray(obj)) {\n obj.forEach(findRefs);\n } else if (typeof obj === \"object\") {\n Object.values(obj).forEach(findRefs);\n }\n };\n\n toProcess.forEach(findRefs);\n return referenced;\n}\n\nfunction filterUnusedSchemas(swagger: any): any {\n const referencedSchemas = collectReferencedSchemas(swagger, swagger.paths);\n const filteredSchemas: any = {};\n\n const totalSchemas = Object.keys(swagger.components?.schemas || {}).length;\n console.log(\n `\\nFound ${referencedSchemas.size} referenced schemas out of ${totalSchemas} total`,\n );\n\n for (const schemaName of referencedSchemas) {\n if (swagger.components?.schemas?.[schemaName]) {\n filteredSchemas[schemaName] =\n swagger.components.schemas[schemaName];\n }\n }\n\n return {\n ...swagger,\n components: {\n ...swagger.components,\n schemas: filteredSchemas,\n },\n };\n}\n\nasync function generateClient(filteredSwagger: any): Promise<void> {\n console.log(\"\\nGenerating TypeScript client...\");\n\n await rm(TEMP_DIR, { recursive: true, force: true });\n await rm(OUTPUT_DIR, { recursive: true, force: true });\n\n await mkdir(TEMP_DIR, { recursive: true });\n await mkdir(OUTPUT_DIR, { recursive: true });\n\n const swaggerPath = join(TEMP_DIR, \"filtered-swagger.json\");\n await writeFile(swaggerPath, JSON.stringify(filteredSwagger, null, 2));\n\n // Seed .openapi-generator-ignore so the generator never writes unused\n // support files. It must exist in OUTPUT_DIR before the generator runs.\n await writeFile(\n join(OUTPUT_DIR, \".openapi-generator-ignore\"),\n `${IGNORED_GENERATOR_OUTPUTS.join(\"\\n\")}\\n`,\n );\n\n const command = [\n \"npx @openapitools/openapi-generator-cli generate\",\n `-i ${swaggerPath}`,\n `-g typescript-fetch`,\n `-o ${OUTPUT_DIR}`,\n \"--skip-validate-spec\",\n \"--additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=@uipath/solution-sdk\",\n ].join(\" \");\n\n execSync(command, { stdio: \"inherit\" });\n console.log(\"Client generated successfully!\");\n}\n\nasync function main(): Promise<void> {\n try {\n const swagger = await downloadSwagger();\n const filteredPaths = filterSwaggerPaths(swagger);\n const filtered = filterUnusedSchemas(filteredPaths);\n\n // Create generate directory and save files\n await mkdir(GENERATE_DIR, { recursive: true });\n await writeFile(\n join(GENERATE_DIR, \"swagger.json\"),\n JSON.stringify(swagger, null, 2),\n );\n await writeFile(\n join(GENERATE_DIR, \"filtered-swagger.json\"),\n JSON.stringify(filtered, null, 2),\n );\n\n await generateClient(filtered);\n\n // Clean up temp files\n await rm(TEMP_DIR, { recursive: true, force: true });\n\n console.log(`\\n✅ Generated SDK available in: ${OUTPUT_DIR}`);\n console.log(`📁 Reference files saved in: ${GENERATE_DIR}`);\n } catch (error) {\n console.error(\"Error generating SDK:\", error);\n process.exit(1);\n }\n}\n\nif (import.meta.main) {\n main();\n}\n\nexport { main as generateSdk };\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;AACA;AACA;AACA;AACA;AAEA,IAAM,cACF;AACJ,IAAM,aAAY,YAAY,OAAO,QAAQ,cAAc,YAAY,GAAG,CAAC;AAC3E,IAAM,WAAW,KAAK,YAAW,OAAO;AACxC,IAAM,aAAa,KAAK,UAAU,WAAW;AAC7C,IAAM,WAAW,KAAK,UAAU,MAAM;AACtC,IAAM,eAAe,KAAK,UAAU,SAAS;AAK7C,IAAM,4BAA4B;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAEA,eAAe,eAAe,GAAiB;AAAA,EAC3C,QAAQ,IAAI,6BAA6B;AAAA,EACzC,MAAM,WAAW,MAAM,MAAM,WAAW;AAAA,EACxC,IAAI,CAAC,SAAS,IAAI;AAAA,IACd,MAAM,IAAI,MAAM,+BAA+B,SAAS,YAAY;AAAA,EACxE;AAAA,EACA,OAAO,MAAM,SAAS,KAAK;AAAA;AAG/B,SAAS,kBAAkB,CAAC,SAAmB;AAAA,EAC3C,MAAM,gBAAqB,CAAC;AAAA,EAG5B,MAAM,uBAAuB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ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;AAAA,EAClB,KAAK;AACT;",
|
|
8
|
+
"debugId": "03A1AC393696691964756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle a solution directory into a .uis file.
|
|
3
|
+
* Also provides buildSolutionPackageFromDir for building .uis from
|
|
4
|
+
* a pre-assembled solution directory (used by debug services).
|
|
5
|
+
*/
|
|
6
|
+
import type { IFileSystem } from "@uipath/filesystem";
|
|
7
|
+
import type { BundleResult } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Bundle a solution directory into a .uis file.
|
|
10
|
+
* Validates the .uipx file, flattens project directories, and zips everything.
|
|
11
|
+
*
|
|
12
|
+
* Returns the path to the .uis file and metadata.
|
|
13
|
+
* The caller is responsible for cleaning up the .uis file if it was created in a temp location.
|
|
14
|
+
*/
|
|
15
|
+
export declare function bundleSolution(fs: IFileSystem, solutionDir: string, outputDir: string, outputName?: string): Promise<BundleResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Build a .uis solution package from a pre-assembled solution directory.
|
|
18
|
+
* The directory should already contain project subdirectories and optionally a .uipx file.
|
|
19
|
+
* If a .uipx exists, SolutionStorage.json is generated from it.
|
|
20
|
+
*
|
|
21
|
+
* Used by debug services that prepare their own staging directory.
|
|
22
|
+
* Uses fflate for in-process zip creation (no external zip CLI dependency).
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildSolutionPackageFromDir(fs: IFileSystem, solutionDir: string): Promise<string>;
|
|
25
|
+
export { resolveSolutionDir } from "./solution-file";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./user-agent.js";
|
|
2
|
+
export * from "../generated/src/index.js";
|
|
3
|
+
export { buildSolutionPackageFromDir, bundleSolution, resolveSolutionDir, } from "./bundle-service";
|
|
4
|
+
export type { ParentSolutionDiscovery, ProjectSolutionRegistration, RegisterProjectOptions, } from "./solution-file";
|
|
5
|
+
export { findNearestParentUipxFile, findSolutionFile, isProjectRegisteredInSolution, normalizeProjectType, readSolutionManifest, readUipxFile, toPortableRelativePath, tryRegisterProjectInParentSolution, updateSolutionFile, updateUipxSolutionId, } from "./solution-file";
|
|
6
|
+
export type { BundleResult, SolutionImportResponse, StudioWebConfig, UipxFile, UipxProject, } from "./types";
|
|
7
|
+
export { importSolution, overwriteSolution, solutionExistsOnStudioWeb, uploadOrOverwriteSolution, } from "./upload-service";
|
|
8
|
+
export { SDK_USER_AGENT } from "./user-agent.js";
|
|
9
|
+
export { collectFiles, createZipFromDir } from "./zip-utils";
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for reading, finding, and updating .uipx solution files.
|
|
3
|
+
*/
|
|
4
|
+
import type { IFileSystem } from "@uipath/filesystem";
|
|
5
|
+
import type { UipxFile, UipxProject } from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* Outcome of attempting to register a project in its parent `.uipx` solution.
|
|
8
|
+
*
|
|
9
|
+
* Status meanings:
|
|
10
|
+
* - `Registered` — Project was added to `<solution>.uipx` Projects[] in this call.
|
|
11
|
+
* - `AlreadyRegistered` — Project was already in Projects[]; no write performed.
|
|
12
|
+
* - `Skipped` — A candidate solution was found but registration was deliberately
|
|
13
|
+
* not attempted (ambiguous: multiple `.uipx` in same dir, or the
|
|
14
|
+
* project dir sits outside the discovered solution dir).
|
|
15
|
+
* - `Failed` — Registration was attempted and an error occurred (read/write/parse).
|
|
16
|
+
* - `NotInSolution` — No `.uipx` file was found by walking ancestor directories. The
|
|
17
|
+
* project was created in standalone mode. This is the explicit
|
|
18
|
+
* contract value for "no parent solution discovered" so that
|
|
19
|
+
* downstream consumers (agents, the skill doc, CI scripts) can
|
|
20
|
+
* distinguish "missing field due to old CLI" from "field
|
|
21
|
+
* intentionally indicates no enclosing solution" (MST-10004).
|
|
22
|
+
* - `OptedOut` — The caller passed `skipRegistration` (the `--skip-solution-registration`
|
|
23
|
+
* CLI flag): discovery and registration were intentionally not
|
|
24
|
+
* attempted. Distinct from `Skipped` (structural ambiguity the
|
|
25
|
+
* tool could not resolve) and `NotInSolution` (no solution exists):
|
|
26
|
+
* the user explicitly declined registration.
|
|
27
|
+
*/
|
|
28
|
+
export interface ProjectSolutionRegistration {
|
|
29
|
+
Status: "Registered" | "AlreadyRegistered" | "Skipped" | "Failed" | "NotInSolution" | "OptedOut";
|
|
30
|
+
Message: string;
|
|
31
|
+
Solution?: string;
|
|
32
|
+
Project?: string;
|
|
33
|
+
ProjectId?: string;
|
|
34
|
+
Instructions?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Options for {@link tryRegisterProjectInParentSolution}.
|
|
38
|
+
*/
|
|
39
|
+
export interface RegisterProjectOptions {
|
|
40
|
+
/**
|
|
41
|
+
* When true, skip solution discovery and registration entirely and return an
|
|
42
|
+
* `OptedOut` envelope. Set by the `--skip-solution-registration` CLI flag. The `OptedOut`
|
|
43
|
+
* envelope is still returned (the field is never absent) so downstream consumers
|
|
44
|
+
* keep a uniform `Data.SolutionRegistration` contract.
|
|
45
|
+
*/
|
|
46
|
+
skipRegistration?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare const STUDIO_WEB_PROJECT_TYPE_OVERRIDES: Record<string, string>;
|
|
49
|
+
export declare function normalizeProjectType(projectType: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Converts a relative path to forward slashes. ProjectRelativePath values in
|
|
52
|
+
* the .uipx manifest must always use forward slashes — Studio Web rejects
|
|
53
|
+
* backslash separators, which `fs.path.relative`/`join` produce on Windows.
|
|
54
|
+
*/
|
|
55
|
+
export declare function toPortableRelativePath(relativePath: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Find and parse the .uipx file in a solution directory.
|
|
58
|
+
* Validates the required fields (SolutionId, Projects).
|
|
59
|
+
*/
|
|
60
|
+
export declare function readUipxFile(fs: IFileSystem, solutionDir: string): Promise<{
|
|
61
|
+
uipx: UipxFile;
|
|
62
|
+
uipxFileName: string;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Resolve input to a solution directory path.
|
|
66
|
+
* Accepts a directory path or a .uipx file path.
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveSolutionDir(fs: IFileSystem, inputPath: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Update the SolutionId in a .uipx file at a known path.
|
|
71
|
+
* Called after successful upload to ensure subsequent uploads use overwrite.
|
|
72
|
+
*/
|
|
73
|
+
export declare function updateUipxSolutionId(fs: IFileSystem, uipxPath: string, newSolutionId: string): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Find the .uipx solution file in the parent directory of a project path.
|
|
76
|
+
* Returns the solutionId and projectId, or undefined if not found.
|
|
77
|
+
*/
|
|
78
|
+
export declare function findSolutionFile(fs: IFileSystem, projectPath: string): Promise<{
|
|
79
|
+
solutionId: string;
|
|
80
|
+
projectId: string;
|
|
81
|
+
} | undefined>;
|
|
82
|
+
/**
|
|
83
|
+
* Update the .uipx solution file in the parent directory of a project path.
|
|
84
|
+
* Scans the parent dir for a .uipx file and updates its SolutionId.
|
|
85
|
+
*/
|
|
86
|
+
export declare function updateSolutionFile(fs: IFileSystem, projectPath: string, newSolutionId: string): Promise<void>;
|
|
87
|
+
export declare function tryRegisterProjectInParentSolution(fs: IFileSystem, projectDir: string, options?: RegisterProjectOptions): Promise<ProjectSolutionRegistration>;
|
|
88
|
+
export type ParentSolutionDiscovery = {
|
|
89
|
+
status: "found";
|
|
90
|
+
solutionFile: string;
|
|
91
|
+
} | {
|
|
92
|
+
status: "notFound";
|
|
93
|
+
} | {
|
|
94
|
+
status: "skipped";
|
|
95
|
+
registration: ProjectSolutionRegistration;
|
|
96
|
+
};
|
|
97
|
+
export declare function findNearestParentUipxFile(fs: IFileSystem, projectDir: string): Promise<ParentSolutionDiscovery>;
|
|
98
|
+
export declare function readSolutionManifest(fs: IFileSystem, solutionFile: string): Promise<[Error, null] | [
|
|
99
|
+
null,
|
|
100
|
+
{
|
|
101
|
+
content: Record<string, unknown>;
|
|
102
|
+
projects: UipxProject[];
|
|
103
|
+
}
|
|
104
|
+
]>;
|
|
105
|
+
/**
|
|
106
|
+
* Read the .uipx solution manifest at `solutionFile` and report whether the
|
|
107
|
+
* project at `projectDir` is registered in its `Projects[]` array.
|
|
108
|
+
*
|
|
109
|
+
* Matching is path-based: each `Projects[].ProjectRelativePath` is resolved
|
|
110
|
+
* to an absolute project directory and compared to `projectDir` after
|
|
111
|
+
* canonicalization via `realpath()`. Canonicalization makes the comparison
|
|
112
|
+
* tolerant of:
|
|
113
|
+
* - case-folding differences on macOS / Windows filesystems
|
|
114
|
+
* - symlinks that resolve `projectDir` and the manifest entry to the same
|
|
115
|
+
* underlying inode through different surface forms
|
|
116
|
+
* If `realpath()` fails (e.g. the path does not exist), the literal path is
|
|
117
|
+
* used — the surrounding pre-flight will already surface the missing-dir
|
|
118
|
+
* error separately, so we should not double-fail here.
|
|
119
|
+
*
|
|
120
|
+
* Throws when the manifest cannot be read or parsed (invalid JSON, missing
|
|
121
|
+
* `Projects` array, malformed entry). The boolean return is reserved for
|
|
122
|
+
* the answerable question "is this project listed?" — a corrupt manifest
|
|
123
|
+
* is a separate failure mode that callers must not silently translate
|
|
124
|
+
* into "not registered", since the repair (`uip solution project add`)
|
|
125
|
+
* won't fix a manifest that fails to parse.
|
|
126
|
+
*
|
|
127
|
+
* Used by `flow debug` to catch the empty-solution-archive case BEFORE
|
|
128
|
+
* uploading to Studio Web (MST-10004). Studio Web's import endpoint rejects
|
|
129
|
+
* archives whose `Projects[]` is empty (or whose listed projects don't match
|
|
130
|
+
* the staged contents) with an opaque HTTP 400 — failing locally with the
|
|
131
|
+
* project path and the manifest path is far more actionable.
|
|
132
|
+
*/
|
|
133
|
+
export declare function isProjectRegisteredInSolution(fs: IFileSystem, projectDir: string, solutionFile: string): Promise<boolean>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type definitions for solution packaging and Studio Web upload.
|
|
3
|
+
*/
|
|
4
|
+
/** Minimal config needed for Studio Web API calls. */
|
|
5
|
+
export interface StudioWebConfig {
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
authToken: string;
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Response from Studio Web Import/Overwrite API. */
|
|
11
|
+
export interface SolutionImportResponse {
|
|
12
|
+
id: string;
|
|
13
|
+
solutionId?: string;
|
|
14
|
+
projects: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
/** A project entry inside a .uipx file. */
|
|
20
|
+
export interface UipxProject {
|
|
21
|
+
Type: string;
|
|
22
|
+
ProjectRelativePath: string;
|
|
23
|
+
Id: string;
|
|
24
|
+
}
|
|
25
|
+
/** Parsed contents of a .uipx file. */
|
|
26
|
+
export interface UipxFile {
|
|
27
|
+
DocVersion?: string;
|
|
28
|
+
StudioMinVersion?: string;
|
|
29
|
+
SolutionId: string;
|
|
30
|
+
Projects: UipxProject[];
|
|
31
|
+
}
|
|
32
|
+
/** Result of bundling a solution directory into a .uis file. */
|
|
33
|
+
export interface BundleResult {
|
|
34
|
+
uisPath: string;
|
|
35
|
+
solutionName: string;
|
|
36
|
+
solutionId: string;
|
|
37
|
+
uipxPath: string;
|
|
38
|
+
projects: Array<{
|
|
39
|
+
Name: string;
|
|
40
|
+
Type: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload/overwrite solutions to UiPath Studio Web.
|
|
3
|
+
* Consolidates the upload logic previously duplicated in solution-tool and maestro-sdk.
|
|
4
|
+
*/
|
|
5
|
+
import type { IFileSystem } from "@uipath/filesystem";
|
|
6
|
+
import type { SolutionImportResponse, StudioWebConfig } from "./types";
|
|
7
|
+
/**
|
|
8
|
+
* Probe Studio Web for the existence of a solution by id.
|
|
9
|
+
* Returns true on 2xx, false on 404. Throws on any other status so callers
|
|
10
|
+
* don't silently treat transient errors (auth, 5xx) as "missing".
|
|
11
|
+
*
|
|
12
|
+
* Routes through `@uipath/studioweb-sdk`'s generated `SolutionApi`
|
|
13
|
+
* (`Solution_GetSolution` → `GET /api/Solution/{solutionId}`) so the URL,
|
|
14
|
+
* auth header composition, and tenant routing come from the Studio Web
|
|
15
|
+
* swagger instead of being hand-typed here. The `Raw` variant is used so we
|
|
16
|
+
* can branch on response status (404 = missing) without forcing the body
|
|
17
|
+
* parse.
|
|
18
|
+
*/
|
|
19
|
+
export declare function solutionExistsOnStudioWeb(config: StudioWebConfig, organizationName: string, solutionId: string): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Upload a .uis file to Studio Web Import endpoint (new solution).
|
|
22
|
+
*/
|
|
23
|
+
export declare function importSolution(config: StudioWebConfig, organizationName: string, fileBuffer: Uint8Array, fileName: string): Promise<SolutionImportResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Overwrite an existing solution on Studio Web.
|
|
26
|
+
*/
|
|
27
|
+
export declare function overwriteSolution(config: StudioWebConfig, organizationName: string, fileBuffer: Uint8Array, fileName: string, solutionId: string): Promise<SolutionImportResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Upload or overwrite a solution on Studio Web.
|
|
30
|
+
* If solutionId is provided, tries overwrite first with 404 fallback to import.
|
|
31
|
+
*
|
|
32
|
+
* Accepts either a file buffer or a file path (reads the file using fs).
|
|
33
|
+
*/
|
|
34
|
+
export declare function uploadOrOverwriteSolution(config: StudioWebConfig, organizationName: string, fileBufferOrPath: Uint8Array | string, solutionId: string | undefined, fs?: IFileSystem): Promise<SolutionImportResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_USER_AGENT: string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared zip utilities for solution packaging.
|
|
3
|
+
* Uses fflate for in-process zip creation (no external zip CLI dependency).
|
|
4
|
+
*/
|
|
5
|
+
import type { IFileSystem } from "@uipath/filesystem";
|
|
6
|
+
/**
|
|
7
|
+
* Directory names that are never part of a solution bundle. Skipped at walk
|
|
8
|
+
* time so the bundle stays small and Studio Web doesn't receive
|
|
9
|
+
* developer-local artifacts.
|
|
10
|
+
*
|
|
11
|
+
* .venv Python virtualenvs (per-agent under solution/<agent>/.venv).
|
|
12
|
+
* Each is hundreds of MB and contains binaries that won't
|
|
13
|
+
* execute on the Studio Web side anyway.
|
|
14
|
+
* node_modules Node dependency cache; same reasoning as .venv.
|
|
15
|
+
* __pycache__ Python bytecode; regenerated on import.
|
|
16
|
+
* .git VCS metadata; never belongs in an upload.
|
|
17
|
+
*
|
|
18
|
+
* Callers can extend this set per-walk via the `additionalExcludeDirs` option
|
|
19
|
+
* (sourced from a `.uipignore` file at the solution root by bundle-service).
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEFAULT_EXCLUDED_DIR_NAMES: ReadonlySet<string>;
|
|
22
|
+
/** File name read by bundle-service to extend the default exclude set. */
|
|
23
|
+
export declare const UIPIGNORE_FILENAME = ".uipignore";
|
|
24
|
+
/**
|
|
25
|
+
* Parse a `.uipignore` file body: one directory name per line, `#` for line
|
|
26
|
+
* comments, blank lines ignored. Returns the names as a Set. The parser is
|
|
27
|
+
* deliberately minimal — no globs, no negation, no path separators. Each
|
|
28
|
+
* entry matches by exact directory name at any depth (same semantics as the
|
|
29
|
+
* built-in defaults).
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseUipignore(body: string): Set<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Recursively walk `dir`, returning every file path and every empty directory
|
|
34
|
+
* path beneath it. An empty directory is a directory whose `readdir` returns
|
|
35
|
+
* no entries; deeper empty chains are represented by their leaves only, since
|
|
36
|
+
* fflate creates parent directory records implicitly when it sees `a/b/c/`.
|
|
37
|
+
*
|
|
38
|
+
* Skips DEFAULT_EXCLUDED_DIR_NAMES plus any `additionalExcludeDirs` the
|
|
39
|
+
* caller provides. Exclusion is by exact directory name at any depth.
|
|
40
|
+
*/
|
|
41
|
+
export declare function collectTree(fs: IFileSystem, dir: string, options?: {
|
|
42
|
+
additionalExcludeDirs?: Iterable<string>;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
files: string[];
|
|
45
|
+
emptyDirs: string[];
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Recursively collect all file paths under a directory.
|
|
49
|
+
*/
|
|
50
|
+
export declare function collectFiles(fs: IFileSystem, dir: string, options?: {
|
|
51
|
+
additionalExcludeDirs?: Iterable<string>;
|
|
52
|
+
}): Promise<string[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Collect all files (and empty directories) under `dir` and zip them using
|
|
55
|
+
* fflate. Empty directories are written as standard zip directory records
|
|
56
|
+
* (path keys ending with `/` mapped to a zero-length buffer) so they survive
|
|
57
|
+
* the round-trip to Studio Web.
|
|
58
|
+
*
|
|
59
|
+
* Returns the zip as a Uint8Array.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createZipFromDir(fs: IFileSystem, dir: string, options?: {
|
|
62
|
+
additionalExcludeDirs?: Iterable<string>;
|
|
63
|
+
}): Promise<Uint8Array>;
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uipath/solution-sdk",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "1.196.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/UiPath/cli.git",
|
|
8
|
+
"directory": "packages/solution-sdk"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"registry": "https://registry.npmjs.org/"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"uipath",
|
|
15
|
+
"solution",
|
|
16
|
+
"sdk"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/src/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/src/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"bin": {
|
|
28
|
+
"generate-sdk": "./dist/scripts/generate-sdk.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"private": false,
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@openapitools/openapi-generator-cli": "^2.31.1",
|
|
36
|
+
"@uipath/common": "1.196.0",
|
|
37
|
+
"@uipath/filesystem": "1.196.0",
|
|
38
|
+
"@uipath/studioweb-sdk": "1.196.0",
|
|
39
|
+
"@types/node": "^25.5.2",
|
|
40
|
+
"fflate": "^0.8.2",
|
|
41
|
+
"typescript": "^6.0.2"
|
|
42
|
+
},
|
|
43
|
+
"gitHead": "bed2b46f1ec33a47a7dcae2e6d4b7ab99bd06981"
|
|
44
|
+
}
|