feat(integration-service): add Connections service#554
Conversation
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>
|
|
|
||
| it('should throw when the underlying connection has no id', async () => { | ||
| const connection = createConnectionWithMethods( | ||
| createMockConnection({ id: '' as unknown as string }), |
There was a problem hiding this comment.
The as unknown as string cast is unnecessary — '' is already a string. This violates the "NEVER use as unknown as" convention.
| createMockConnection({ id: '' as unknown as string }), | |
| createMockConnection({ id: '' }), |
| * const connections = new Connections(sdk); | ||
| * | ||
| * const status = await connections.ping('<connectionId>'); | ||
| * if (status.status !== 'Enabled') { |
There was a problem hiding this comment.
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:
| * 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.
Review summaryTwo issues found this run: 1. Unnecessary 2. Raw string literal in Note — integration tests: Conventions require an integration test per method in |
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>



Summary
First of a 4-PR stack onboarding the Integration Service to the SDK. Adds the Connections service.
@uipath/uipath-typescript/is-connectionssubpath:getAll,getById,ping,reauthenticateCONNECTION_ENDPOINTS+CONNECTIONS_BASEendpoint constantsIS_TEST_CONSTANTS,createMockConnection)Stack (merge in order)
mainfeat/is-connectionsfeat/is-connectorsfeat/is-elementsmain🤖 Generated with Claude Code