Skip to content

feat(integration-service): add Connectors service#555

Open
maninder-uipath wants to merge 1 commit into
feat/is-connectionsfrom
feat/is-connectors
Open

feat(integration-service): add Connectors service#555
maninder-uipath wants to merge 1 commit into
feat/is-connectionsfrom
feat/is-connectors

Conversation

@maninder-uipath

Copy link
Copy Markdown
Contributor

Summary

PR 2/4 of the Integration Service stack. Adds the Connectors service.

  • New service via @uipath/uipath-typescript/is-connectors: getAll, getById, getDefaultConnection, getConnections
  • CONNECTOR_ENDPOINTS constants; delegates connection lookups to the Connections service
  • Unit tests, createMockConnector fixture, OAuth scope docs, mkdocs nav

Stack

🤖 Generated with Claude Code

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>
/**
* A connector catalog entry from the Integration Service.
*/
export type ConnectorGetResponse = RawConnectorGetResponse;

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.

Single-type alias (type X = Y) breaks TypeDoc rendering per the project convention:

"The only place interface extends is required is single-type aliases (type X = Y), which break TypeDoc — use export interface EntityUpdateRecordResponse extends EntityRecord {} instead."

Suggested change
export type ConnectorGetResponse = RawConnectorGetResponse;
export interface ConnectorGetResponse extends RawConnectorGetResponse {}

/** Event types the connector emits. */
eventTypes?: string[];
/** Lifecycle stage (e.g. `GA`, `BETA`, `CUSTOM`). */
lifeCycleStage?: 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.

Convention: "Use enums for fixed value sets — NEVER leave raw strings/numbers."

The JSDoc lists GA, BETA, CUSTOM — these look like a closed API enum, not open-ended strings. If the API documents a fixed set, declare a ConnectorLifecycleStage enum and type this field with it.

If the API can return arbitrary strings (e.g. vendor-specific stages on custom connectors), add a comment explaining that and the string type is fine.

it('should throw ValidationError when keyOrId is empty', async () => {
await expect(service.getDefaultConnection('')).rejects.toThrow(ValidationError);
});
});

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.

Missing error propagation test for getDefaultConnection. Convention: "Test both success and error scenarios for every public method."

getAll and getById both have a 'should propagate API errors' test — getDefaultConnection needs one too:

it('should propagate API errors', async () => {
  mockApiClient.get.mockRejectedValue(createMockError(IS_TEST_CONSTANTS.ERROR_CONNECTION_NOT_FOUND));
  await expect(
    service.getDefaultConnection(IS_TEST_CONSTANTS.CONNECTOR_KEY),
  ).rejects.toThrow(IS_TEST_CONSTANTS.ERROR_CONNECTION_NOT_FOUND);
});

it('should throw ValidationError when keyOrId is empty', async () => {
await expect(service.getConnections('')).rejects.toThrow(ValidationError);
});
});

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.

Same gap: getConnections is missing an error propagation test. Convention: "Test both success and error scenarios for every public method."

it('should propagate API errors', async () => {
  mockApiClient.get.mockRejectedValue(createMockError(TEST_CONSTANTS.ERROR_MESSAGE));
  await expect(
    service.getConnections(IS_TEST_CONSTANTS.CONNECTOR_KEY),
  ).rejects.toThrow(TEST_CONSTANTS.ERROR_MESSAGE);
});

@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review findings

New inline comments posted this run:

  1. connectors.models.ts line 19 — single-type alias breaks TypeDoc; use interface extends.
  2. connectors.types.ts line 48 — lifeCycleStage should be an enum if GA/BETA/CUSTOM is a closed set.
  3. connectors.test.ts line 144 — getDefaultConnection is missing an error-propagation test.
  4. connectors.test.ts line 182 — getConnections is missing an error-propagation test.

Missing file:

  1. No integration test file — convention requires tests/integration/shared/integration-service/connectors.test.ts covering getAll, getById, getDefaultConnection, and getConnections.

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.

1 participant