feat(integration-service): add Connectors service#555
Conversation
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; |
There was a problem hiding this comment.
Single-type alias (type X = Y) breaks TypeDoc rendering per the project convention:
"The only place
interface extendsis required is single-type aliases (type X = Y), which break TypeDoc — useexport interface EntityUpdateRecordResponse extends EntityRecord {}instead."
| 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; |
There was a problem hiding this comment.
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); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
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); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
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);
});
Review findingsNew inline comments posted this run:
Missing file:
|
Summary
PR 2/4 of the Integration Service stack. Adds the Connectors service.
@uipath/uipath-typescript/is-connectors:getAll,getById,getDefaultConnection,getConnectionsCONNECTOR_ENDPOINTSconstants; delegates connection lookups to the Connections servicecreateMockConnectorfixture, OAuth scope docs, mkdocs navStack
feat/is-connections(PR feat(integration-service): add Connections service #554) — merge that first; GitHub will retarget this tomain.connectors.tsimportsConnectionsService).🤖 Generated with Claude Code