@uipath/uipath-extensions-sdk 0.0.0-stage → 0.1.17
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/LICENSE.txt +3 -0
- package/README.md +250 -2
- package/dist/adopt.d.ts +4 -0
- package/dist/adopt.js +434 -0
- package/dist/adopt.js.map +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +21 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +342 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/build-check.d.ts +34 -0
- package/dist/commands/build-check.js +121 -0
- package/dist/commands/build-check.js.map +1 -0
- package/dist/commands/new.d.ts +19 -0
- package/dist/commands/new.js +192 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/pack.d.ts +20 -0
- package/dist/commands/pack.js +112 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/submit.d.ts +88 -0
- package/dist/commands/submit.js +540 -0
- package/dist/commands/submit.js.map +1 -0
- package/dist/commands/upload.d.ts +44 -0
- package/dist/commands/upload.js +299 -0
- package/dist/commands/upload.js.map +1 -0
- package/dist/commands/validate.d.ts +12 -0
- package/dist/commands/validate.js +16 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/exists.d.ts +1 -0
- package/dist/exists.js +11 -0
- package/dist/exists.js.map +1 -0
- package/dist/github.d.ts +64 -0
- package/dist/github.js +277 -0
- package/dist/github.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/jobScaffold.d.ts +9 -0
- package/dist/jobScaffold.js +89 -0
- package/dist/jobScaffold.js.map +1 -0
- package/dist/lib.d.ts +72 -0
- package/dist/lib.js +317 -0
- package/dist/lib.js.map +1 -0
- package/dist/manifest.d.ts +1 -0
- package/dist/manifest.js +2 -0
- package/dist/manifest.js.map +1 -0
- package/dist/sourceWalk.d.ts +6 -0
- package/dist/sourceWalk.js +46 -0
- package/dist/sourceWalk.js.map +1 -0
- package/dist/uip.d.ts +10 -0
- package/dist/uip.js +35 -0
- package/dist/uip.js.map +1 -0
- package/package.json +43 -4
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
© 2026 UiPath
|
|
2
|
+
Use of this product is subject (a) to the applicable licensing agreement available: https://www.uipath.com/legal/trust-and-security/legal-terms#content-1 and, (b) for paid products listed here https://licensing.uipath.com/: the licensing agreement agreed between you and UiPath.
|
|
3
|
+
(UiPath means UiPath SRL with headquarters at 4 Vasile Alecsandri Str. and 11 Constantin Daniel Str., Building A, floors 5 and 6, District 1, Bucharest 010639, Romania and UiPath Inc. with principal place of business: One Vanderbilt Avenue, 60th Floor, New York, NY 10017)
|
package/README.md
CHANGED
|
@@ -1,3 +1,251 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @uipath/uipath-extensions-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The author-facing SDK for community Maestro nodes. It holds the `new`, `validate`, `pack`, `upload` and `submit` commands. The template loader and the manifest builder live in `@uipath/uipath-extensions-gates`, and this package re-exports them. The `./lib` export (see Library) runs `validate`, `upload` and `submit` from code, and the `uipath-extensions` command calls it for those three. The `release` command is removed.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
The `uipath-extensions` command is a placeholder name until the final name is chosen. None of the commands logs in to UiPath.
|
|
8
|
+
- `uipath-extensions new <publisher/name> [--dir <parent dir>] [--skip-install]` runs `uip function new <name> --language ts` in the parent directory (the current one by default). It keeps the layout `uip` writes: the functions stay in `functions/`, and `tsconfig.json` and the `uipath.json` function entries are not changed. The Maestro files go in `maestro/`. It removes `method` and `path` from every `defineFunction` call, sets the `name` in `package.json` to the package id `uipath-extensions.<publisher>.<name>` and the `version` to `0.1.0`, deletes the `.env.example` that `uip` writes (`submit` refuses it, and it holds credential placeholders), adds `tests` to `packOptions.directoriesExcluded` in `uipath.json` (`submit` accepts a `tests` folder, but the package gate does not accept it inside the package), keeps `@uipath/coded-functions-js-sdk` in `devDependencies`, adds `@types/node` to `devDependencies` (the connection helper reads `process.env`, so `validate` needs the Node types), writes the script `pack: uip function pack` and no `validate` script, replaces `functions/hello.ts` with a starter function whose input and output are JSON Schema literals, and writes the template `uipath-extensions.json` at the project root and the connection helper `maestro/connection.ts`. The project does not depend on this SDK, so `pack: uip function pack` is the only script. It then runs `npm install --include=dev` in the new project, so the type packages are ready for `validate` even when `NODE_ENV=production` or `omit=dev` is set. `--skip-install` leaves that step out, and `new` then prints `npm install` as the first of the next steps. If that `npm install` fails, `new` keeps the project, prints the npm error and exits with code 1. The starter template has no `repository`, because the node folder goes to the index repo as one pull request and no author repo exists. It writes `author` with the publisher as the name, in title case, and `https://github.com/<publisher>` as the url, for the author to correct. If any step before that `npm install` fails after `uip` ran, `new` deletes the project directory it created. `uip function new` runs its own install first, before the SDK is added, and it has no option to skip that install. When that install fails, `uip` removes the project and `new` reports the `uip` error.
|
|
9
|
+
- `uipath-extensions validate [--dir <project dir>]` calls the library `validate`. It works on a temporary copy of the project folder, so it writes nothing to the folder and leaves no `.uipath` there. It applies the adopt plan (see Adopt) to that copy in memory, with schema 2 and no call to `gh` or the index. It loads `uipath-extensions.json`, packs the copy and runs all 21 gates in local mode on the completed manifest, which it builds in memory from the template and the package. When the project is not adopted it prints a note that says so. A `package.json` name that is not a package id gets the placeholder identity `local.<name>`, which is never written or sent, and `package-id` and `identity-match` print `skipped`. It prints one line per gate and exits 1 when a gate fails. A gate that needs an input a local run does not have prints `skipped`. A skipped gate has not checked anything. It needs `uip` because it packs.
|
|
10
|
+
- `uipath-extensions pack [--dir <project dir>]` runs the `pack` steps below.
|
|
11
|
+
- `uipath-extensions upload [--id <publisher>.<name>] [--yes] [--dir <project dir>] [--input <json>] [--run] [--feed-id <id>]` calls the library `upload` in its default mode and runs the `upload` steps below. On a project that is not adopted it plans the adopt first, as `submit` does (see Adopt). `--yes` applies the adopt writes and then goes on to the upload in the same run. Without it a plan with writes prints as a diff and the command exits 1 and writes none of the adopt files. `--id` names the node when the `package.json` name is not a package id and the command does not run in a terminal. It needs `uip login`. It starts a job only with `--run`.
|
|
12
|
+
- `uipath-extensions submit [--id <publisher>.<name>] [--yes] [--security-contact <email>] [--dir <project dir>] [--index <owner/repo>] [--dry-run]` calls the library `submit` and runs the `submit` steps below after the adopt step. `--id` names the node when the `package.json` name is not a package id and the command does not run in a terminal. In a terminal `submit` asks for it. `--yes` applies the adopt writes and then goes on to the checks and the pull request in the same run. Without it a plan with writes prints as a diff and exits 1. `--security-contact` is needed for a first registration and replaces the stored contact on a later version. `--index` defaults to `UiPath/uipath-extensions`, and a sandbox index repo can stand in for it. `--dry-run` prints what `submit` would do and writes nothing to GitHub.
|
|
13
|
+
- `uipath-extensions build-check --project <dir> --tag <tag> --out <dir>` packs the project, runs the 14 build gates in CI mode against the tag, and copies the nupkg and `gate-report.json` into `--out`. It exits 1 when a gate is not met and 2 on a usage error. When `GITHUB_OUTPUT` is set and every gate is met, it appends `nupkg=<path>`. The reusable build workflow runs this command in CI, so a node author normally does not call it.
|
|
14
|
+
|
|
15
|
+
Each command accepts only its own options. An option of another command exits 2 and prints the usage text.
|
|
16
|
+
|
|
17
|
+
`new`, `pack` and `upload` check for `uip` first and stop with a clear error when it is not on the PATH. `validate` and `submit` run `pack`, so they need `uip` too and stop with the same error. `pack` and `upload` also warn on stderr when `uip` is outside the tested range (see Limits). `submit` needs `gh` signed in (`gh auth login`) with a token that can push a branch to the index repo. None of the commands runs `uip login`.
|
|
18
|
+
|
|
19
|
+
## Define a node
|
|
20
|
+
|
|
21
|
+
Put the template in `uipath-extensions.json` at the project root. It is plain JSON, so no code runs to load it. `pack` and `submit` send it as it is, and the package carries this exact file. The `template-match` gate fails when the packed copy differs from the source.
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"schema": 2,
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"author": { "name": "Acme", "url": "https://github.com/acme" },
|
|
28
|
+
"display": {
|
|
29
|
+
"label": "Acme Data Cleanup",
|
|
30
|
+
"description": "Trim and validate the text fields of a record.",
|
|
31
|
+
"icon": "assets/icon.png"
|
|
32
|
+
},
|
|
33
|
+
"tags": ["data"],
|
|
34
|
+
"operations": [
|
|
35
|
+
{ "name": "cleanRecord", "description": "Trim and validate one record." }
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
With `"schema": 2` the template has no `version`. The node version is the `version` in `package.json`. A template with no `schema` is the legacy shape. It still loads, and it must hold a plain semver `version` that equals the `version` in `package.json`. `new` still writes the legacy shape. Any other `schema` value is an error, and so is a `version` in a schema 2 template. A field that still holds `TODO` fails with `<field> still holds the placeholder`.
|
|
41
|
+
|
|
42
|
+
`loadTemplate` throws a `TemplateError` that lists every problem. This release supports exactly one operation, and its name uses letters and digits and starts with a letter. `repository`, `author` and `tags` are optional (see Limits). The template holds no identity, no schema and no credential list. The identity is the `name` in `package.json` (see Identity), and `pack` derives the schemas (see Schemas). An older template that still holds `maestro` or `egress` loads without error. The SDK and the gates ignore both keys, and the manifest does not carry them.
|
|
43
|
+
|
|
44
|
+
The display fields are bounded. The SDK and the `contract` gate enforce these rules from SDK 0.1.12.
|
|
45
|
+
|
|
46
|
+
- `display.label` is 1 to 40 characters and `display.description` is 1 to 200 characters. Neither may contain `<` or `>`.
|
|
47
|
+
- `tags` holds at most 8 tags. Each tag is 1 to 24 characters of lowercase letters, digits and single hyphens.
|
|
48
|
+
- `display.iconBackground`, `display.iconBackgroundDark` and `display.iconColor` are optional, and each must be a color in the form `#RRGGBB`.
|
|
49
|
+
- `display.icon` is optional. `new` leaves it out, and Flow shows its default icon. To add your own, put a PNG at `assets/icon.png` and set `display.icon` to `"assets/icon.png"`. Any other path is a finding from SDK 0.1.9, and the package check fails a template that names an icon the package does not have. `adopt` names the icon only when the project already has `assets/icon.png`. When the package holds `assets/icon.png`, from SDK 0.1.9 the package check requires a PNG file of at most 32768 bytes. `validate` packs the project, so it runs that check too.
|
|
50
|
+
- Nothing displays these fields yet. Flow does not read `uipath-extensions.json` (flow-workbench `fb24f7e` has no reference to `uipath-extensions`).
|
|
51
|
+
|
|
52
|
+
`author` is optional and says who publishes the node, for Flow to show next to the badge. `author.name` is 1 to 80 characters with no `<` or `>`. `author.url` is optional, an `https://` URL of at most 200 characters with no credentials or backslash. No other key is allowed. The manifest carries the object as given. `security_contact` in the registration is the contact for UiPath and is not the author. The SDK and the `contract` gate enforce these rules from the release after SDK 0.1.14, and Flow does not show the field yet.
|
|
53
|
+
|
|
54
|
+
## Schemas
|
|
55
|
+
|
|
56
|
+
The template holds no schema. The function in `functions/` is the one source of the input and output schemas.
|
|
57
|
+
|
|
58
|
+
`pack` runs `uip function pack` and does not change the nupkg. The package holds the template as `uipath-extensions.json`. `validate` and `build-check` read `content/entry-points.json` from the nupkg and require exactly one entry point. They copy that entry point's `input` and `output` into `operations[0]` of the completed manifest, and they list each `Connection` input in `credential.inputs`. They build the manifest in memory with the `version` from `package.json`, so the gates read the schemas that the package holds.
|
|
59
|
+
|
|
60
|
+
Flow reads the same schemas. It takes the input and output schemas of a Function from the entry point of the release (flow-workbench `fb24f7e`, `packages/flow-core/src/manifest/shared/argument-utils.ts`). The `entry-points-match` gate still compares the shape of the schemas in the manifest with `entry-points.json` in the package.
|
|
61
|
+
|
|
62
|
+
How you write the function schema decides what reaches `entry-points.json`, and so the manifest. This was measured with `uip` 1.207.0-preview.305 and `@uipath/coded-functions-js-sdk` 0.7.0.
|
|
63
|
+
|
|
64
|
+
- `defineSchema<T>()` on a TypeScript interface keeps `type`, `enum` (from union literals), `format` and `default` (from `@default`). It drops the comment text, `@minLength`, `@title`, `@minimum` and tags such as `@x-uipath-resource-kind`. A typed schema loses every `description`, `title`, `pattern` and `x-*` key, and the packer writes `integer` as `number`.
|
|
65
|
+
- A JSON Schema literal in `defineFunction({ input })` is copied as written, including `description`, `default`, `$ref`, `definitions` and every `x-uipath-*` key.
|
|
66
|
+
|
|
67
|
+
So a node that needs a `Connection` or field descriptions declares a JSON Schema literal in `defineFunction({ input })`. The `contract` gate reports an input property that has no description as a `review` finding, which does not stop `validate` or `submit`, and names this remedy. It fails an operation with a blank description and an output object that does not set `additionalProperties: false`. The starter function that `new` writes is a schema literal with placeholder descriptions, so a fresh project passes `contract`. Replace the placeholders.
|
|
68
|
+
|
|
69
|
+
## Identity
|
|
70
|
+
|
|
71
|
+
The `name` in `package.json` names a node. It is `uipath-extensions.<publisher>.<name>`, and it is at most 100 characters. The publisher and the name each use lowercase letters, digits and single hyphens. A part never holds a dot, so `a-b/c` and `a/b-c` give two different names. `new` writes the name once, and `pack`, `submit` and the `package-id` gate read it. `pack` never rewrites it.
|
|
72
|
+
|
|
73
|
+
The node id `publisher/name` comes from the package name. The template and the manifest hold no node type, so there is no second copy of the identity to keep in step. Flow builds its own node type from the id.
|
|
74
|
+
|
|
75
|
+
A rename makes a new node. Saved flows keep pointing at the old id. To send people to the new node, set `deprecated.alternative` in the registration of the old id in the index. A new version, including a major one, keeps the id.
|
|
76
|
+
|
|
77
|
+
These rules about renames describe planned Flow behavior and are not shipped yet. Flow has no community node support on its `develop` branch (flow-workbench `fb24f7e` has no reference to `uipath-extensions`). That support is in the open pull request #6081.
|
|
78
|
+
|
|
79
|
+
## Inputs and defaults
|
|
80
|
+
|
|
81
|
+
Write a default in the function schema, because Flow reads that one. In a typed schema, put `@default` in the JSDoc of the input type. In a schema literal, write `default`. The template holds no schema, so there is no second place to repeat it.
|
|
82
|
+
|
|
83
|
+
Flow reads `default` from the entry point schema. It also drops a `required` name whose property has a `default` (flow-workbench `fb24f7e`, `argument-utils.ts`). So an input with a default is optional in Flow, even when you list it in `required`.
|
|
84
|
+
|
|
85
|
+
A default must satisfy the schema of its own property. No gate checks that.
|
|
86
|
+
|
|
87
|
+
## Report a failure
|
|
88
|
+
|
|
89
|
+
Throw an error from the function to report a failure. The connection helper does this with a `VendorError` (see Call a vendor through a connection).
|
|
90
|
+
|
|
91
|
+
Keep failure tests in `fixtures/`. A fixture whose name ends in `.fault.json` is an input that the function must reject. The `fixtures` gate fails when the runner accepts one, and it also needs at least one fixture without that suffix. `validate` skips the gate today (see Limits).
|
|
92
|
+
|
|
93
|
+
Flow adds an `error` output and turns on error handling for every Function node (flow-workbench `fb24f7e`, `packages/flow-core/src/manifest/mappers/node-manifest-builder.ts`). This README does not specify what that output holds.
|
|
94
|
+
|
|
95
|
+
## Change a published node
|
|
96
|
+
|
|
97
|
+
Choose the new version by what the change does to the schemas and to the flows that already use the node.
|
|
98
|
+
|
|
99
|
+
- A new required input without a default, a removed or renamed input, or a changed type is a major version.
|
|
100
|
+
- A change that breaks existing flows while the schemas stay the same is also a major version. An example is a new unit for an existing numeric output.
|
|
101
|
+
- A new optional input with a default, or a new output property, is a minor version.
|
|
102
|
+
- A patch version is only for a fix that keeps the behavior flows rely on and leaves the schemas as they are.
|
|
103
|
+
|
|
104
|
+
No check compares a version with the one before it today, so nothing enforces this.
|
|
105
|
+
|
|
106
|
+
Flow keeps the live definition of a node over the definition saved in the flow (flow-workbench `fb24f7e`, `packages/canvas/src/utils/conversion.ts`). Every dynamic node manifest in Flow has the fixed version `1.0.0` (`node-manifest-builder.ts`). So a changed input schema reaches saved nodes, and Flow has no step to migrate them.
|
|
107
|
+
|
|
108
|
+
Not shipped yet. The open pull request #6081 lists only the latest major of a community node. With the fixed `1.0.0`, a major release then changes the schema of every saved node. Flow does not keep an old major working next to a new one, and pinning a saved node to a major is not shipped yet either. Make a breaking change rarely, and prefer a new optional input with a default.
|
|
109
|
+
|
|
110
|
+
## Allowed schema keys
|
|
111
|
+
|
|
112
|
+
The schemas of a node may use two keys that start with `x-uipath`, `x-uipath-resource-kind` and `x-uipath-connector-key`. The gates enforce this from SDK 0.1.9.
|
|
113
|
+
|
|
114
|
+
- `validate` and the gates report any other key that starts with `x-uipath` from SDK 0.1.9. The test ignores case and does not need a trailing hyphen, so `X-UiPath-ui` and `x-uipathfoo` are both reported from SDK 0.1.9.
|
|
115
|
+
- The check looks at the key and not at its value, so `x-uipath-resource-kind` keeps every value from SDK 0.1.9.
|
|
116
|
+
- The check covers every part of a schema from SDK 0.1.9, including `definitions`, `default`, `enum` and keywords such as `contains`. A property that is named like a reported key is reported too, from SDK 0.1.9. A schema nested deeper than 64 levels is reported from SDK 0.1.9.
|
|
117
|
+
- The check also covers the whole of `entry-points.json` from SDK 0.1.9, and `input` and `output` of each entry point must be objects and not JSON strings. This reads the packed package, so `validate` runs it too.
|
|
118
|
+
|
|
119
|
+
The list keeps the key space closed until Flow reads more of it. Flow reads one value of `x-uipath-resource-kind`, `JobAttachment`, and no code in flow-workbench `fb24f7e` reads `x-uipath-connector-key`. The gates read `x-uipath-resource-kind` for connections, and no SDK or gate code reads `x-uipath-connector-key`.
|
|
120
|
+
|
|
121
|
+
## Call a vendor through a connection
|
|
122
|
+
|
|
123
|
+
`new` writes `maestro/connection.ts`. Do not edit it. The `lint-bans` gate exempts that file from the bans on `fetch`, `ctx.robot` and `process.env` only when its path and text match the copy in `@uipath/uipath-extensions-gates`, so an edited copy fails like any other source. The file imports nothing at run time, because the Functions runtime cannot install the SDK packages.
|
|
124
|
+
|
|
125
|
+
Declare the input as a connection, so the manifest lists it in `credential.inputs`:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
connection: {
|
|
129
|
+
$ref: "#/definitions/is-connection",
|
|
130
|
+
description: "Integration Service HTTP connection to the vendor.",
|
|
131
|
+
"x-uipath-connector-key": "uipath-uipath-http",
|
|
132
|
+
},
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
with `definitions: { "is-connection": { type: "string", "x-uipath-resource-kind": "Connection" } }` on the input schema.
|
|
136
|
+
|
|
137
|
+
Flow does not render a connection picker for a community node yet, and no code in flow-workbench `fb24f7e` reads the `Connection` kind. The tag reaches Flow only through a schema literal in the function file (see Schemas). Until a picker exists, a Function input with this schema is a plain text field labelled with its property name, because Flow resolves the `$ref` and maps a string type to text (flow-workbench `fb24f7e`, `argument-utils.ts`, `json-schema-resolver.ts` and `node-manifest-builder.ts`). Flow does not list community nodes at all yet, which is not shipped yet.
|
|
138
|
+
|
|
139
|
+
In the function:
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
import { connection } from "../maestro/connection.ts";
|
|
143
|
+
|
|
144
|
+
const api = connection(ctx, input.connection, {
|
|
145
|
+
baseUrl: "https://api.example.com",
|
|
146
|
+
header: "Authorization",
|
|
147
|
+
prefix: "Bearer ",
|
|
148
|
+
env: "MAESTRO_LOCAL_EXAMPLE_KEY",
|
|
149
|
+
});
|
|
150
|
+
return api.post("/search", { body: { query: input.query } });
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
In a job, `connection()` sends each request through the Integration Service `http-request` passthrough with the robot token, so the vendor key stays in Integration Service. A vendor error status throws a `VendorError` with the vendor's message. Without a robot (a local run), it calls `baseUrl` directly with the key from the named environment variable. `localEnv()` reads only `MAESTRO_LOCAL_*` variables, so a job cannot use it to read the robot's environment.
|
|
154
|
+
|
|
155
|
+
## Pack
|
|
156
|
+
|
|
157
|
+
`pack({ projectDir })` does these steps in order.
|
|
158
|
+
1. Loads `uipath-extensions.json` and checks it.
|
|
159
|
+
2. Fails unless the `name` in `package.json` is a package id `uipath-extensions.<publisher>.<name>`, which the packer turns into the nuspec id, and the `version` is a string.
|
|
160
|
+
3. Runs `uip function pack` in the project directory.
|
|
161
|
+
|
|
162
|
+
It returns the nupkg path, the version and the package id. It does not read or write the nupkg, so it injects no manifest. The package holds the template file as it is. It writes no manifest into the project and does not change `package.json`. `validate` and `build-check` read the entry point from the nupkg and fail unless it lists exactly one.
|
|
163
|
+
|
|
164
|
+
`pack({ projectDir, version })` packs under a different semver while `uip function pack` runs. It sets `version` in `package.json` for that call and puts the node version back afterwards, also when `uip` fails. The template is not changed, and a schema 2 template holds no version to differ.
|
|
165
|
+
|
|
166
|
+
## Upload
|
|
167
|
+
|
|
168
|
+
`upload({ projectDir })` tests a node in the personal workspace of the logged in tenant. It never writes to GitHub or to the index. It does these steps in order.
|
|
169
|
+
1. Checks `uip login status`, and stops with `Run: uip login` when there is no session.
|
|
170
|
+
2. Finds the process feed whose name contains "Personal Workspace". `--feed-id` skips the lookup.
|
|
171
|
+
3. Packs with the version `<node version>-dev.<UTC time as YYYYMMDDHHmmss>`, so a feed that refuses a repeated version never blocks a second run.
|
|
172
|
+
4. Runs `uip function publish --feed-id <id>` in the project directory.
|
|
173
|
+
5. Finds the folder of type `Personal`, reads the first entry point from `content/entry-points.json` in the nupkg, and creates the release `<publisher>__<name>__dev` there. When that release exists it moves it to the new version with `update-version`.
|
|
174
|
+
6. With `--run`, starts one job on the release with `--input` (`{}` by default) and waits for it. It prints the job state and its output, and exits 1 unless the state is `Successful`. Without `--run` it stops after step 5 and prints the command that starts the job, with `--input-arguments` and the `--input` text when one was given. `--no-run` is accepted and changes nothing.
|
|
175
|
+
7. Looks in the personal folder for the process that Orchestrator created for the package id (see Limits), and prints its key in the note below.
|
|
176
|
+
|
|
177
|
+
The output ends with the destination.
|
|
178
|
+
- `Destination:` is `personal workspace feed, only you can see this build`, or `feed <id> (from --feed-id)` when you passed `--feed-id`.
|
|
179
|
+
- `Release:` names the release and says `in your personal workspace`, because the release always goes to the personal folder, whatever the feed.
|
|
180
|
+
- `Run:` is the exact `uip or jobs start <release key> --folder-key <folder key>` command. With `--run` the job result lines take its place.
|
|
181
|
+
- `Note:` names the extra process and the command that removes it, `uip or processes delete <key> --folder-key <folder key> --yes`. It appears only when the lookup in step 7 finds that process. The delete removes the process binding in the personal folder and leaves the package in the feed.
|
|
182
|
+
|
|
183
|
+
## Library
|
|
184
|
+
|
|
185
|
+
The `@uipath/uipath-extensions-sdk/lib` export runs three commands from code. Each takes options and `LibDeps` (`exec`, `io`, an optional `github` client and an optional `now` clock) and returns `{ code, data, instructions? }`. `io` has `out`, `err`, `canPrompt` and `ask`. `code` is one of `Success`, `GatesFailed`, `ConfirmationRequired`, `InputRequired` and `Failed`. Only `Success` is a pass, and the `uipath-extensions` command exits 0 for `Success` and 1 for every other code.
|
|
186
|
+
|
|
187
|
+
- `validate({ dir })` copies the project to a temporary folder, plans the adopt writes there with `offline: true` and applies them to the copy. It returns `Failed` with the plan in `data` when the plan has an error. Otherwise it runs the gates in local mode on the copy and returns `Success` or `GatesFailed` with the report. When the plan had writes, `instructions` says the project is not adopted yet. The project folder is never written. A malformed template, a package that cannot be packed or read, and a missing `uip` return `Failed` with the message in `instructions`, in all three commands.
|
|
188
|
+
- `upload({ dir, id, yes, run, input, feedId })` plans the adopt writes when the project has no template or its `package.json` name is not a package id, as `submit` does. It never reads the index, so it needs no `gh` and writes schema 2. A plan with writes needs `yes` (else `ConfirmationRequired`). With `yes` it applies the writes and then runs the `upload` steps below in the same call. Any other template or `package.json` problem returns `Failed` before any write. The release input checks below run before the adopt writes. A run whose job does not end `Successful` returns `Failed` with the upload result and the job in `data`. With `release: true` it needs exactly one of `folderPath` and `folderKey` (else `InputRequired`), rejects `feedId`, packs once and runs the gates on that package (`GatesFailed` uploads nothing), needs `yes` (else `ConfirmationRequired`), then runs `uip or packages upload <nupkg>` with the folder flag on the package that passed the gates, under the `package.json` version.
|
|
189
|
+
- `submit({ dir, id, yes, securityContact, index, dryRun })` plans the adopt writes. A plan with writes needs `yes` (else `ConfirmationRequired`). With `yes` it applies the writes and then runs the `submit` steps below in the same call. `index` also picks the repository whose `policy/gate-library.yaml` sets the schema of a new template. The pull request body lists the fields that the adopt step generated in this run (the license when `package.json` declares none, the label, both descriptions, the operation name and the tags), and ends with the line `Gate library: <version>`. A project that an earlier run adopted has no such list.
|
|
190
|
+
|
|
191
|
+
The `release` command and its exports (`release`, `ReleaseError`, `ReleaseOptions`, `ReleaseResult`, `GatesFailedError`) are gone from the root export. A gates failure is the result code `GatesFailed`.
|
|
192
|
+
|
|
193
|
+
## Adopt
|
|
194
|
+
|
|
195
|
+
A project is adopted when it has a template, a package name that is a package id and the files its node needs. `planAdopt` reads the project and lists what is missing. It writes none of the adopt files, but it runs `uip function pack` in the project folder. That leaves the pack build output (`.uipath/`, `entry-points.json`, `bindings_v2.json`) and can add fields such as `projectId` to `uipath.json`. `submit` and `upload` apply a plan to the project folder. `validate` applies it to a temporary copy and leaves the folder as it was. When the plan holds the template or the package name, a write that fails halfway leaves the project looking unadopted, because `package.json` and the template are written last, so the next run plans everything again.
|
|
196
|
+
|
|
197
|
+
- It needs `uipath.json`, and it stops with `not a uip project, run uip function new or uip codedagent new first` when that file is missing.
|
|
198
|
+
- A `package.json` name that is not `uipath-extensions.<publisher>.<name>` becomes a write of the name from `id`, or the error `pass <publisher>.<name>` when there is no `id`.
|
|
199
|
+
- A missing `uipath-extensions.json` becomes a write of a template that passes the gates, from the one operation in `entry-points.json`. It sets `license` to the one `package.json` declares, or to `MIT` when `package.json` declares none, `display.label` to the node name in title case cut to 40 characters, a one-sentence `display.description` and operation description that ask the author to describe the node, and an empty `tags` list. Its shape follows `template_schema` in `policy/gate-library.yaml` of the index repo: schema 2 gets `"schema": 2` and no `version`, an absent key gets the legacy shape with the `package.json` version, and any other value is an error. The index repo is the one `--index` names, and `UiPath/uipath-extensions` by default.
|
|
200
|
+
- A missing `maestro/connection.ts` becomes a write when an input is a connection. The helper reads `process.env`, so the plan adds `@types/node` to the `devDependencies` of `package.json` whenever an input is a connection and neither dependency list holds it, also when the helper already exists, and reports that `npm install` has to run.
|
|
201
|
+
- The packed archive is read with the same limits as the gates: 2000 entries, 20 MiB for an entry and 100 MiB in all.
|
|
202
|
+
- A write is an error when its path or any folder above it in the project is a symlink, so adopt never writes outside the project. A new file is created only when nothing exists at its path.
|
|
203
|
+
- A file named `.DS_Store`, `.env.example`, `.env.local`, `Thumbs.db` or `desktop.ini`, or a folder named `.idea` or `.vscode`, at any depth, becomes one write of `uipath.json` that adds the name to `packOptions.filesExcluded` or `packOptions.directoriesExcluded`. `uip function pack` and `submit` skip an entry by its bare name, and a `uip function new` project holds `.env.example`. `.env.local` can hold secrets, and the package check rejects any env file other than `.env.example`. The write keeps every other key, the indent and the trailing newline of `uipath.json`. Adopt deletes no file. When `packOptions` is not an object or the list it needs is not a list, the plan gets the error `uipath.json packOptions.<list> is not a list` and no write.
|
|
204
|
+
- Files outside the source list and an input with no description are reports, not writes. Each report names its remedy. An input with no description does not stop `submit`, because `validate` lists it as a `review` finding. A file or folder outside the source list can be deleted or added to `packOptions.filesExcluded` or `packOptions.directoriesExcluded` in `uipath.json`, and `submit` names the same remedy when it refuses to send one. An input needs a JSON Schema literal in `defineFunction({ input })` or a `.describe()` call on the validator, because `defineSchema<T>()` drops every description. A missing `assets/icon.png` is not reported, because the icon is optional. With no icon, the new template leaves `display.icon` out.
|
|
205
|
+
|
|
206
|
+
`submit` with writes in the plan and no `--yes` prints the diff, returns `ConfirmationRequired`, exits 1 and writes none of the adopt files. With `--yes` it writes the files and goes on to the checks and the pull request in the same run, so a fresh project needs one `submit --yes` and no second run. Use `--dry-run` with `--yes` to adopt the project and see the plan without opening a pull request. Replace the default license, label and descriptions with your own before the pull request is merged. `upload` on an unadopted project does the same with its own `--yes`. It prints the diff, writes the files and goes on to the upload in the same run, and it reads no index, so it needs no `gh`. The `submit` pull request body lists each field that the adopt step generated, so a reviewer can tell tool text from author text. That list covers only the run that adopts.
|
|
207
|
+
|
|
208
|
+
## Submit
|
|
209
|
+
|
|
210
|
+
`submit({ projectDir, github, securityContact })` sends the node folder to the index repo as one pull request. It needs no author repo, no release and no App or org secret. It uses the token of the signed-in `gh` account, so the account must be allowed to create `register/**` branches in the index repo. It does every check before it writes anything, and it runs every check that does not depend on a failed one, so one run lists every failure, one per line. When a gate failed, the result code is `GatesFailed`, with the gate report as `data` and the other lines in `instructions`. When only other checks failed, the code is `Failed` and `instructions` holds every line.
|
|
211
|
+
1. Plans the adopt writes (see Adopt). It stops when the plan has an error, or has a write and no `--yes`. With `--yes` it applies the writes and goes on. When it then needs `--security-contact` and has none, it returns `InputRequired` and says the adopt files were written. Loads `uipath-extensions.json`. Takes the version and the node id from the sent `package.json`, and fails when its `name` is not a package id or its `version` is not a string.
|
|
212
|
+
2. Runs `validate` in local mode. It packs the project, so `uip` must be on the PATH. A `fail` stops `submit` before it writes anything, after the checks below have run. A `review` or `skipped` result is printed and does not stop it. The index CI runs every gate with more inputs than a local run has, so a pass here is not a pass there.
|
|
213
|
+
3. Reads the index repo and checks that the signed-in account can push to it. Without that right it stops before it writes anything, with `you cannot push branches to <index>. Ask in #feat-maestro-community-node for write access, then run submit again.`
|
|
214
|
+
4. Collects the files of the project folder. Only the allow list is sent: `uipath-extensions.json`, `package.json`, `package-lock.json`, `uipath.json`, `tsconfig.json`, `tsconfig.typecheck.json`, `README.md`, `LICENSE`, `assets/icon.png`, `functions/**/*.ts`, `maestro/**/*.ts`, `tests/**/*.ts` and `fixtures/**/*.json`. Local files that the index refuses or that a build writes are left out and listed in the output. They are `node_modules/`, `dist/`, `.git/`, `.uipath/`, `.github/`, `docs/`, `.gitignore`, `.npmrc`, `biome.json`, `commitlint.config.mjs`, `AGENTS.md`, `CHANGELOG.md`, `CLAUDE.md`, `entry-points.json`, `bindings_v2.json` and `*.nupkg`. At any depth the collector also skips an entry whose name is in `packOptions.filesExcluded` or `packOptions.directoriesExcluded` of `uipath.json`, and the names `node_modules`, `.git`, `.env`, `.deno`, `dist` and `.uipath`, as `uip function pack` does. A source folder of the allow list at the project root (`tests`, `fixtures`) is still collected when `packOptions` excludes it, because `new` excludes `tests` only to keep it out of the package, and the index keeps those files. A `uip function pack` run writes the last three, and `validate`, `pack` and `upload` all start one, so they can sit in the folder when you submit. Any other file, a symlink, a file over 5 MiB, more than 200 files with `registration.yaml`, or more than 20 MiB in all stops submit with the list of paths and the reason for each. In `package-lock.json`, every package that is not `@uipath/uipath-extensions-sdk` or `@uipath/uipath-extensions-gates` and whose `resolved` URL is on `npm.pkg.github.com` is sent with the matching `registry.npmjs.org` tarball URL, because the index gate takes everything but those two from the public registry. The `integrity` value is not changed, and the file on disk is not touched.
|
|
215
|
+
5. Refuses when the index holds both the flat file `nodes/<publisher>/<name>.yaml` and the folder for the node, or when the version is already in the registration file. It then looks for an open pull request from the branch `register/<publisher>__<name>`. When there is one, it updates that pull request (see below). When there is none, it refuses if the branch already exists in the index repo.
|
|
216
|
+
6. Reads the default branch head of the index repo, and builds one tree commit on it through the git data API. The commit holds the files under `nodes/<publisher>/<name>/` and `registration.yaml` with the new version as a `listed` entry dated today (UTC). A first registration writes `id`, `package`, `security_contact`, `deprecated` and `approved`, and `id` and `package` come from the `name` in `package.json`. A later version keeps every field of the existing file and appends the entry. It deletes files that the index folder holds and your folder no longer has. When the node is still a flat file `nodes/<publisher>/<name>.yaml`, the same commit deletes that file and writes the folder, so the pull request never holds both. The commit touches nothing outside `nodes/<publisher>/<name>/`.
|
|
217
|
+
7. Creates the branch `register/<publisher>__<name>` at that commit, so a failure before this step leaves no branch. It opens the pull request with the body of the index `.github/PULL_REQUEST_TEMPLATE.md`. It fills the `Node id` and `Version` lines and ticks "Registers a new node" or "Adds a version to an existing node". It then tries to add the `registration` label, and warns when it cannot. The pull request title and the commit message are both `Register <id> <version>`, because the index lints every commit and the title with the same rule.
|
|
218
|
+
|
|
219
|
+
The version comes from the folder.
|
|
220
|
+
|
|
221
|
+
When a pull request from that branch is already open, `submit` updates it instead of opening a second one.
|
|
222
|
+
- It updates only a pull request that the signed-in `gh` user opened. For another author it stops before any write with `<url> was opened by <author>, and gh is signed in as <you>. Run submit as <author> (gh auth switch), or ask them to update it.`
|
|
223
|
+
- It builds the tree from the default branch head exactly as for a new pull request. A file you deleted since the last submit is gone, a version bump leaves the pull request registering only the new version, and a resubmit of the same version is allowed.
|
|
224
|
+
- The new commit has the current branch head as its first parent, so the branch moves forward and keeps its history. When the default branch head is not yet in the branch, it is the second parent. Without it the file list of the pull request would show files that other registrations changed, and the index refuses a source pull request that touches anything outside the node folder.
|
|
225
|
+
- The ref moves without force. If the branch gained commits after `submit` read it, the update stops with `the branch changed since submit read it, run submit again`. A branch that someone reset to an earlier commit in that short window is not detected, because the GitHub REST ref update has no expected-SHA check.
|
|
226
|
+
- After the push it sets the title and replaces the first `Version:` line under the `## Node` heading of the body, before the next heading of any level, and leaves every other edit in the body. A body with no `Version:` line under `## Node` stays as it is, and `submit` warns. The title and the body are two calls after the push, so two overlapping `submit` runs for the same node can leave the older version in them. Run `submit` again to fix it.
|
|
227
|
+
- The files removed are the ones that the default branch holds or the pull request branch holds, and that your folder no longer has. A file that only an earlier submit added is listed too.
|
|
228
|
+
- An approval stays after an update while the index ruleset does not dismiss stale reviews. When a reviewer's latest decision is an approval, `submit` prints `Warning: <logins> approved this pull request, and the approval stays after this update. Ask for a new review.` Only `APPROVED`, `CHANGES_REQUESTED` and `DISMISSED` count as a decision.
|
|
229
|
+
|
|
230
|
+
`--dry-run` runs the pre-check, the access check, the folder collection and the lookup of an open pull request with its owner check, then stops before the first write. It prints the index, branch, title, `Action: open` or `Action: update #<number>`, the files, the files not sent, the files removed, and for an update the approvals that would stay. `validate` still packs the project in the folder, as it does on its own, so build output such as `.uipath/` can appear there.
|
|
231
|
+
|
|
232
|
+
A run that writes ends with the pull request URL, the number of files sent and removed, the local files not sent, and `Next: CI runs the gates and a reviewer approves. Watch: gh pr checks <number> --repo <index> --watch`.
|
|
233
|
+
|
|
234
|
+
All GitHub calls go through a `GitHubClient`. `ghClient()` implements it with `gh api`, and the tests use a fake.
|
|
235
|
+
|
|
236
|
+
## Limits
|
|
237
|
+
|
|
238
|
+
- `repository` is optional. A template that sets it must write `owner/repo`, not a URL, and the completed manifest then lists it as a `https://github.com/` URL. A template without it gets no `repository` in the manifest. The `release`, `attestation` and `identity-match` gates fail in `ci` mode for such a manifest when a caller gives them every input, because they look up the author repository, and `source` mode skips them. Nothing else in the gate library or the SDK reads the field.
|
|
239
|
+
- `author` is checked for shape only. The gates do not check that the name belongs to the publisher or that the url is theirs, so a reviewer reads it. The index can later refuse a name that impersonates another publisher.
|
|
240
|
+
- `pack` and `upload` do not compare a legacy template `version` with `package.json`. `validate` and `build-check` do, because they build the manifest. `template-match` compares bytes only, so it cannot tell a stale template from a new one, it only proves that the package carries the source file.
|
|
241
|
+
- `credential.inputs` lists each top-level operation input whose schema, or the local `$ref` target of its schema, has `x-uipath-resource-kind: "Connection"`, as an `ICredentialType` input. A nested property, a `$ref` chain and an asset kind are not listed.
|
|
242
|
+
- The connection helper calls Integration Service only from a UiPath cloud host (`uipath.com` or a subdomain). It does not run on Automation Suite. A node can pass a fixed connection id to `connection()` instead of its input, and the gates do not catch that. The helper only reaches connections the job's robot can already read.
|
|
243
|
+
- The manifest follows the shape in the registry design. The Flow node contract owner has not confirmed it yet, so it can still change.
|
|
244
|
+
- `pack` needs `uip` on the path, and so do `validate` and `submit`, which run `pack`. `pack` takes the output file name `<package id>.<version>.nupkg` from it. `UIP_VERSION_RANGE` pins the tested `uip` versions, `1.205.0-preview.290` to `1.206.0-preview.292`. A version outside it is a warning, not an error, because `uip` upgrades itself. `src/uip.compat.test.ts` runs `new` and `pack` with a real `uip` at each bound. It finds the binary in `UIP_LOWER_BIN` and `UIP_UPPER_BIN` (or on the PATH when its version matches). When a bound is missing the test is skipped with a `FINDING` line locally, and it fails when the `CI` variable is set. The CI workflow installs both bounds. To move a bound, change `UIP_LOWER_BOUND` or `UIP_UPPER_BOUND` in `src/uip.ts` and the versions in `.github/workflows/ci.yml` together, and a test checks that they agree.
|
|
245
|
+
- `upload` in its default mode sends a package that is not the package the build workflow produces, because the version differs. Each run leaves one more version in the personal feed, and `upload` does not delete old ones. It uses the first entry point only, which is right for a node with one function. The upload also makes Orchestrator create a second process named after the package id, with no entry point set. Use the `<publisher>__<name>__dev` release. The output names the extra process and the command that removes it. A feed that refuses a SemVer prerelease version, or a tenant with no personal workspace feed, stops `upload` with the `uip` message.
|
|
246
|
+
- The tests run `new`, `validate` and `pack` against a fake `uip` shaped like the real scaffold (`functions/hello.ts`, `uipath.json`, `include` of `**/*.ts`). A manual run with a real `uip` 1.206.0 on 2026-11-17 showed that `uip function pack` keeps the paths, so the nupkg holds `content/functions/hello.ts` and `content/maestro/connection.ts`. An earlier run had to drop the `@uipath/uipath-extensions-sdk` dependency, because the SDK is not on npm yet and `npm install` and `uip function pack` fail with a 404 on it. The compat test above is the automated run. `uip` upgrades itself on first run, so do not rely on one version.
|
|
247
|
+
- `validate` skips the seven gates that need GitHub, the npm registry, the index or a license scanner, and the `fixtures` gate, which has no fixture runner yet. It packs the project, so the gates that read the nupkg run. The index repo CI runs the skipped ones.
|
|
248
|
+
- The starter template, packed by `uip` 1.205.0-preview.290 with this repo's SDK linked in place of the unpublished package, passes `dependency-policy` (the SDK package is not allow-listed, and the starter template does not depend on it), `runtime-shape` and `package-contents`. The gates accept `@uipath/coded-functions-js-sdk` and the GUIDs that `uip` writes into `entry-points.json`, `operate.json` and `uipath.json`.
|
|
249
|
+
- `new` fails, and removes the project it created, when there is no `functions/` directory, `tsconfig.json` or `uipath.json`, when the scaffold already has a `uipath-extensions.json` or has no `functions/hello.ts`, or when it finds no `defineFunction` call, or one it cannot edit safely (not an object literal, or one that spreads another object). It removes `method` and `path` only as direct properties of the call.
|
|
250
|
+
- `submit` runs `validate`, which skips the gates that need GitHub, the npm registry, the index or a license scanner. A pass does not promise that the index CI passes, because the CI runs every gate on the pull request. `submit` reads at most 100 reviews of a pull request, so on a pull request with more than 100 an old decision can show as the latest. The allow list, the size limits and the local-only list are copies of the index rules, so a change to the index rules needs the same change in `submit`. The `registration` label may need triage rights on the index repo, so a missing label is a warning.
|
|
251
|
+
- The tests of `submit` use a fake `GitHubClient`, and the `gh` argument lists and request bodies of `ghClient` are tested with a fake exec. No test calls GitHub, so a run against a sandbox index repo is still to be done.
|
package/dist/adopt.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AdoptOptions, AdoptPlan, LibDeps } from "./lib.js";
|
|
2
|
+
export declare const NAME_PREFIX = "uipath-extensions.";
|
|
3
|
+
export declare function planAdopt(opts: AdoptOptions, deps: LibDeps): Promise<AdoptPlan>;
|
|
4
|
+
export declare function applyAdopt(plan: AdoptPlan, opts: AdoptOptions): Promise<void>;
|