@uipath/solutionpackager-tool-core 1.202.0 → 1.203.0-preview.160

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.
@@ -16,10 +16,19 @@ export interface IZipService {
16
16
  * @returns The compressed zip data
17
17
  */
18
18
  compressAsync(sourcePath: string): Promise<Uint8Array>;
19
+ /**
20
+ * Create a zip archive from entries already in memory, for contents that are not a directory on
21
+ * disk. Paths are used verbatim.
22
+ *
23
+ * @param entries Archive-relative path to file contents
24
+ * @returns The compressed zip data
25
+ */
26
+ compressEntries(entries: Record<string, Uint8Array>): Uint8Array;
19
27
  }
20
28
  export declare class ZipService implements IZipService {
21
29
  private readonly fileSystem;
22
30
  constructor(fileSystem: IFileSystem);
23
31
  extractAsync(zipData: Uint8Array, targetPath: string): Promise<string[]>;
24
32
  compressAsync(sourcePath: string): Promise<Uint8Array>;
33
+ compressEntries(entries: Record<string, Uint8Array>): Uint8Array;
25
34
  }
package/dist/index.js CHANGED
@@ -154,6 +154,9 @@ class ZipService {
154
154
  });
155
155
  return zipData;
156
156
  }
157
+ compressEntries(entries) {
158
+ return zipSync(entries, { level: 6 });
159
+ }
157
160
  }
158
161
  // src/i18n/types.ts
159
162
  function isPluralForm(value) {
@@ -1590,4 +1593,4 @@ export {
1590
1593
  writeOrBackfillOperateProjectId
1591
1594
  };
1592
1595
 
1593
- //# debugId=F1773888C0CB0BBF64756E2164756E21
1596
+ //# debugId=CF4CC11EA66D137864756E2164756E21
@@ -4,6 +4,7 @@ export type { INugetPackager, NugetPackagerResult } from "./nuget-packager.js";
4
4
  export { NugetPackager } from "./nuget-packager.js";
5
5
  export { ensureProjectId, ensureProjectIdInOperateFile, writeOrBackfillOperateProjectId, } from "./project-id.js";
6
6
  export type { ProjectOperationContext } from "./project-operation-context.js";
7
+ export type { ProjectContributionError, ProjectResourceContribution, ProjectSpecPatch, } from "./project-resource-contribution.js";
7
8
  export { ProjectTool } from "./project-tool.js";
8
9
  export type { IProjectToolFactory } from "./project-tool-factory.js";
9
10
  export { SolutionTool } from "./solution-tool.js";
@@ -0,0 +1,53 @@
1
+ /**
2
+ * What a project contributes to its solution's resources.
3
+ *
4
+ * Plain data on purpose: a contributor sees its own project directory and a
5
+ * filesystem, and returns JSON. It never sees the `.uipx`, the on-disk
6
+ * resource format, or `@uipath/resource-builder-sdk` types — solution-tool's
7
+ * driver owns all of that (AGENTS.md Hard Rule #19).
8
+ */
9
+ export interface ProjectContributionError {
10
+ /** What is wrong. Becomes the failure envelope's `Message`. */
11
+ message: string;
12
+ /** What to run or change next. Becomes `Instructions`. Never the same text. */
13
+ instructions?: string;
14
+ /**
15
+ * Failure mode, e.g. "action_schema_missing". The envelope's `ErrorCode`
16
+ * is the closed CLI set and reports every contributed error as
17
+ * `invalid_argument`; this code surfaces as `Context.errorCode` when the
18
+ * batch agrees on one.
19
+ */
20
+ code?: string;
21
+ }
22
+ export interface ProjectSpecPatch {
23
+ /** Artefact resource kind this patch targets, e.g. "app", "process". */
24
+ kind: string;
25
+ /**
26
+ * Spec keys to set on that resource. A `null` value **deletes** the key —
27
+ * that is how a contributor removes a key it wrote on an earlier run and
28
+ * no longer owns. Any other value is written as-is.
29
+ */
30
+ values: Record<string, unknown>;
31
+ }
32
+ export interface ProjectResourceContribution {
33
+ /** Blocking problems. Any entry fails `solution pack`. */
34
+ errors?: ProjectContributionError[];
35
+ /** Spec keys to persist onto this project's artefact resources. */
36
+ specPatch?: ProjectSpecPatch[];
37
+ /**
38
+ * The SDK-facing subType this project's artefact resources are generated
39
+ * from — the `${subType}` half of the resource-builder's template table's
40
+ * `${type}_${subType}` row.
41
+ *
42
+ * Only the owning tool can know it: it lives in a file format that tool
43
+ * owns, not in `project.uiproj` or the `.uipx`. The host forwards the
44
+ * string into `reconcileProjectsAsync` without interpreting it, which is
45
+ * what keeps a project type's variants out of solution-tool and
46
+ * solution-sdk (AGENTS.md Hard Rule #19).
47
+ *
48
+ * Omit it for a type whose bare `type` row already resolves a template —
49
+ * reconcile is inert for a project it gets no subType for, so a wrong
50
+ * value is worse than none.
51
+ */
52
+ projectSubType?: string;
53
+ }
@@ -1,6 +1,7 @@
1
1
  import type { IFileSystem } from "../filesystem/file-system.js";
2
2
  import type { ProjectType } from "../models/project-type.js";
3
3
  import type { ProjectOperationContext } from "./project-operation-context.js";
4
+ import type { ProjectResourceContribution } from "./project-resource-contribution.js";
4
5
  import type { ProjectTool } from "./project-tool.js";
5
6
  import type { IToolLogger } from "./tool-logger.js";
6
7
  /**
@@ -18,4 +19,15 @@ export interface IProjectToolFactory {
18
19
  * @param context - Optional operation context with id and sibling project info
19
20
  */
20
21
  createAsync(logger: IToolLogger, fileSystem: IFileSystem, context?: ProjectOperationContext): Promise<ProjectTool>;
22
+ /**
23
+ * Describe what this project contributes to its solution's resources.
24
+ * Called with the project's own directory; implementations read only files
25
+ * they own and return plain data — no `.uipx`, no resource JSON.
26
+ *
27
+ * Optional so every existing factory stays valid. A registered factory
28
+ * without it is reported by the caller, not silently skipped: tool bundles
29
+ * version independently of the host, so a missing method means "the
30
+ * installed tool is older than this host", which the user has to hear.
31
+ */
32
+ describeResourcesAsync?(projectDir: string, fileSystem: IFileSystem): Promise<ProjectResourceContribution>;
21
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/solutionpackager-tool-core",
3
- "version": "1.202.0",
3
+ "version": "1.203.0-preview.160",
4
4
  "description": "UiPath contracts for solution packager tools",
5
5
  "type": "module",
6
6
  "exports": {
@@ -13,7 +13,7 @@
13
13
  "files": [
14
14
  "dist"
15
15
  ],
16
- "author": "",
16
+ "author": "UiPath",
17
17
  "license": "SEE LICENSE IN LICENSE.txt",
18
18
  "repository": {
19
19
  "type": "git",
@@ -24,8 +24,8 @@
24
24
  "registry": "https://registry.npmjs.org/"
25
25
  },
26
26
  "dependencies": {
27
- "@uipath/filesystem": "1.202.0",
27
+ "@uipath/filesystem": "1.203.0",
28
28
  "fflate": "^0.8.2"
29
29
  },
30
- "gitHead": "23b5a7038ead7264439af18f8b807c7cc99a29d5"
30
+ "gitHead": "3a42062ba731afca4595ba9aa8a80afc9667528d"
31
31
  }