Skip to content

feat(integration-service): add Connections service#554

Open
maninder-uipath wants to merge 5 commits into
mainfrom
feat/is-connections
Open

feat(integration-service): add Connections service#554
maninder-uipath wants to merge 5 commits into
mainfrom
feat/is-connections

Conversation

@maninder-uipath

Copy link
Copy Markdown
Contributor

Summary

First of a 4-PR stack onboarding the Integration Service to the SDK. Adds the Connections service.

  • New service exposed via the @uipath/uipath-typescript/is-connections subpath: getAll, getById, ping, reauthenticate
  • CONNECTION_ENDPOINTS + CONNECTIONS_BASE endpoint constants
  • Unit + model tests, shared IS test fixtures (IS_TEST_CONSTANTS, createMockConnection)
  • OAuth scope docs + mkdocs nav

Stack (merge in order)

  1. ➡️ Connections (this PR)main
  2. Connectors → base feat/is-connections
  3. Elements → base feat/is-connectors
  4. Execution → base feat/is-elements
  5. Integration tests (draft) → main

Version bump (1.5.0-beta.1) intentionally excluded per the repo's separate-PR release rule.

🤖 Generated with Claude Code

Adds the Integration Service Connections service (getAll, getById, ping,
reauthenticate) exposed via the @uipath/uipath-typescript/is-connections
subpath, with unit + model tests, endpoint constants, OAuth scope docs,
and mkdocs nav.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maninder-uipath
maninder-uipath requested a review from a team June 29, 2026 08:55
@sonarqubecloud

Copy link
Copy Markdown


it('should throw when the underlying connection has no id', async () => {
const connection = createConnectionWithMethods(
createMockConnection({ id: '' as unknown as string }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The as unknown as string cast is unnecessary — '' is already a string. This violates the "NEVER use as unknown as" convention.

Suggested change
createMockConnection({ id: '' as unknown as string }),
createMockConnection({ id: '' }),

* const connections = new Connections(sdk);
*
* const status = await connections.ping('<connectionId>');
* if (status.status !== 'Enabled') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSDoc examples should use the enum rather than a raw string literal — per convention "Use enums for fixed value sets — NEVER leave raw strings/numbers" and "JSDoc @example blocks that reference named types must include the import statement." Update the import and comparison:

Suggested change
* if (status.status !== 'Enabled') {
* if (status.status !== ConnectionState.Enabled) {

Also update the import line at the top of this example block (line 122) to add ConnectionState:

 * import { Connections, ConnectionState } from '@uipath/uipath-typescript/is-connections';

The same fix is needed in the identical example in src/services/integration-service/connections/connections.ts.

@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review summary

Two issues found this run:

1. Unnecessary as unknown as cast in model test (line 56)
'' is already a string; the cast is redundant and violates the "NEVER use as unknown as" rule. Fix: createMockConnection({ id: '' }).

2. Raw string literal in ping JSDoc example (line 128)
status.status !== 'Enabled' should use the enum (ConnectionState.Enabled) and the example import should be updated to include ConnectionState. The identical example in connections.ts (around line 142) needs the same fix.

Note — integration tests: Conventions require an integration test per method in tests/integration/shared/{domain}/. The PR description intentionally defers this to a 5th stack PR — flagging so the draft PR isn't overlooked before merge.

maninder-uipath and others added 4 commits July 22, 2026 14:38
Adds the Integration Service Connectors service (getAll, getById,
getDefaultConnection, getConnections) exposed via the
@uipath/uipath-typescript/is-connectors subpath. Connectors delegates
connection lookups to the Connections service. Includes unit tests,
endpoint constants, OAuth scope docs, and mkdocs nav.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(integration-service): add Elements service [JAR-IS-3]

Adds the Integration Service Elements service (objects, activities,
object metadata, and event-object reads at both connector and connection-
instance scope) exposed via the @uipath/uipath-typescript/is-elements
subpath. Includes ELEMENT_ENDPOINTS constants, unit tests, OAuth scope
docs, and mkdocs nav.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(integration-service): add Execution passthrough [JAR-IS-4] (#557)

Adds the Integration Service Execution passthrough (execute) exposed via
the @uipath/uipath-typescript/is-execution subpath. Executes arbitrary HTTP
operations against a connection instance and returns the full response
envelope without throwing on non-2xx. Includes unit tests and OAuth scope
docs. Reuses ELEMENT_ENDPOINTS.INSTANCE.EXECUTE.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
execute() built the passthrough URL with encodeURIComponent() over the
whole objectName, turning the '/' in a multi-segment path (e.g.
curated_get_issue/APPS-34728) into %2F, which the connector runtime
could not route (404). Encode each segment independently so reserved
characters within a segment are still escaped while the '/' separators
are preserved. Adds regression tests for both behaviors.
Execution service (#557):
- Extend BaseService; acquire token via getValidAuthToken() instead of
  reaching into SDKInternalsRegistry for the token manager (config-only
  registry access retained in the constructor).
- Send W3C tracing headers (traceparent / x-uipath-traceparent-id) on
the
  raw passthrough fetch.
- Extract ['POST','PUT','PATCH'] into a module-level BODY_METHODS
constant.
- Drop the `as unknown as` cast in tests; shared mock TokenManager now
  exposes getValidToken.

Connectors + Elements (#555):
- ConnectorGetResponse: single-type alias -> `interface extends` for
TypeDoc.
- Add LifeCycleStage enum (PREVIEW, GA, DEPRECATED, CUSTOM) and type
  Connector.lifeCycleStage / ElementActivity.lifecycleStage with it.
- Add error-propagation tests for getDefaultConnection and
getConnections.
- Add error-propagation tests for the 8 remaining Elements read methods.

OAuth scopes (#556):
- Update docs to the new IS.* scope names (per-service): Connectors ->
  IS.Connectors.Read, Connections -> IS.Connections.Read, Elements ->
  IS.Connector.Export, Execution -> IS.Connections.Read.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants