feat(notifications): foundation + getAll (PR 1/7) - #512
Conversation
The NotificationMode enum describes notification delivery channels (Email, Slack, Teams, InApp). It's a Subscriptions concept — the notification inbox response doesn't reference it — and its JSDoc cross-refs Subscriptions.getSupportedChannels() which doesn't exist until PR 4. Removing the premature export here; PR 4 will (re-)define it where it's first used. Addresses review comment on PR #512. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
NotificationService uses an internal OAuth scope. Per reviewer feedback on #512: - Tag the only method (getAll) @internal in both the ServiceModel interface and the service class so TypeDoc hides it from generated SDK API docs. - Remove the Notifications section from docs/oauth-scopes.md (that file is for external scopes only). - Remove the Notifications row from docs/pagination.md and the Notifications nav entry from mkdocs.yml — these surface methods that external SDK consumers can't call. Addresses review comments on PR #512. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…opes entries NotificationService uses an internal scope. Tag markRead, markUnread, and markAllRead @internal in both the ServiceModel interface and the service class so TypeDoc hides them from generated SDK API docs. Remove their entries from docs/oauth-scopes.md (external-only). Addresses reviewer feedback on PR #512 (same treatment applied here). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… docs NotificationService scope is internal. Tag getAll, getPublishers, getSupportedChannels @internal in both the ServiceModel interface and the service class. Remove the Subscriptions section from docs/oauth-scopes.md and the Subscriptions entry from mkdocs.yml nav. Same treatment as PR #512. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
New finding from this review run: Missing import — compile error (notifications.types.ts line 5): |
bf99365 to
27cbc39
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
Pull request overview
Adds the initial Notifications SDK subpath (@uipath/uipath-typescript/notifications) and onboards the first user-facing method, Notifications.getAll, including endpoint constants, models/types, and unit + integration coverage. The implementation uses tenant GUID forwarding via X-UIPATH-Internal-TenantId and OData OFFSET pagination via PaginationHelpers.getAll.
Changes:
- Introduces
NotificationService(exported asNotifications) withgetAll(tenantId, options?)and a transform that strips internal API fields. - Adds Notification models (public types + ServiceModel) and internal types/constants for field stripping.
- Wires new notifications subpath into build/package exports and adds unit/integration tests + test fixtures/constants.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/mocks/notification.ts | Adds mock factory for raw notification entries (incl. internal fields). |
| tests/utils/mocks/index.ts | Re-exports notification mocks via test mocks barrel. |
| tests/utils/constants/notification.ts | Adds notification-specific test constants (tenant GUID, IDs, sample message, etc.). |
| tests/utils/constants/index.ts | Re-exports notification test constants via constants barrel. |
| tests/unit/services/notification/notifications.test.ts | Unit tests for getAll wiring + stripInternalNotificationFields. |
| tests/integration/shared/notification/notifications.integration.test.ts | Integration tests for getAll + internal field stripping. |
| tests/integration/config/unified-setup.ts | Registers Notifications service in v1 integration service setup. |
| tests/integration/config/test-config.ts | Adds notificationTenantId to integration config loading/validation. |
| tests/.env.integration.example | Documents NOTIFICATION_TEST_TENANT_ID env var for integration runs. |
| src/utils/constants/endpoints/notification.ts | Adds notification service endpoint constants (GET_ALL). |
| src/utils/constants/endpoints/index.ts | Re-exports notification endpoints from endpoints barrel. |
| src/utils/constants/endpoints/base.ts | Adds NOTIFICATION_BASE (../notificationservice_) with routing JSDoc. |
| src/services/notification/notifications.ts | Implements NotificationService.getAll + internal-field stripping transform. |
| src/services/notification/index.ts | Creates notifications module entry and exports Notifications + models. |
| src/models/notification/notifications.types.ts | Defines Notification enums, response shape, and getAll options. |
| src/models/notification/notifications.models.ts | Adds NotificationServiceModel interface for API docs/reference. |
| src/models/notification/notifications.internal-types.ts | Defines RawNotificationEntry + internal-field list. |
| src/models/notification/index.ts | Adds notification models barrel export. |
| rollup.config.js | Adds rollup entry for notifications build output. |
| package.json | Adds ./notifications subpath export mapping to dist/notifications/*. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please update PR description |
|
Can you add integration tests, test them locally using bearer token and once local testing is done skip them and push. So that in future if PAT token supports the required scopes we can just un-skip those tesrs |
019e3b3 to
9d136e9
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
9d136e9 to
0f2e425
Compare
|
New finding from this review run: Missing |
52822ad to
7fc5058
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
|
New finding from this review run: Missing |
b506498 to
8a4a2a0
Compare
…nternal] Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
8a4a2a0 to
5b4d11c
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
|



First in a stack of 7 PRs onboarding the user-facing Notification platform as a new modular subpath
@uipath/uipath-typescript/notifications. This PR lays the foundation and ships one method (Notifications.getAll). Each subsequent PR (stacked on top of this branch) adds a small group of related methods.Methods Added
notifications.getAll()getAll<T extends NotificationGetAllOptions>(tenantId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<NotificationGetResponse> : NonPaginatedResponse<NotificationGetResponse>>Endpoint Called
notifications.getAll()notificationservice_/notificationserviceapi/odata/v1/NotificationEntryNotificationServiceNotificationServiceextendsBaseService— UserContext auth, no folder header.getAll()supports OData pagination viaPaginationHelpers.getAll($top,$skip,$count) and OData query options (filter,orderby).$selectis not exposed (the API returns HTTP 500 when$selectis supplied — verified live).@track('Notifications.GetAll')telemetry decorator.Critical design point #1:
tenantIdas a per-call argumentThe Notification API does not include the tenant in the URL path. Instead, it identifies the acting tenant via the
X-UIPATH-Internal-TenantIdheader, which expects a tenant GUID (not the configuredtenantName). The SDK takestenantIdas the first positional argument on every NS method and forwards it into the header viacreateHeaders()on each call. This mirrors how folder-scoped Orchestrator services already requirefolderIdfrom the caller.Critical design point #2: URL traversal for tenant-less routing
The notification service routes at the organization level — its URLs do NOT include a tenant segment, unlike most UiPath services.
ApiClientalways inserts${orgName}/${tenantName}/${path}, so the endpoint constants use a../prefix to collapse the tenant segment:${orgName}/${tenantName}/../notificationservice_/...resolves vianew URL()normalization to${orgName}/notificationservice_/.... TheNOTIFICATION_BASEJSDoc documents this in detail. Verified live:alpha.uipath.com/testmanagerdev/notificationservice_/...→ HTTP 200alpha.uipath.com/testmanagerdev/TestManagerDevTenant/notificationservice_/...→ 302/portal_/unregisteredExample Usage
API Response vs SDK Response
Transform pipeline
PaginationHelpers.getAll→transformFn: stripInternalNotificationFields→ returned to consumer.The API already returns camelCase, so
pascalToCamelCaseKeys()is not applied. There are no semantic field renames. The only transform is dropping internal/transport-layer fields.Field-strip (dropped from
NotificationGetResponse)entityOrgName,entityTenantNameserviceRegistryNamemessageTemplateKey,messageVersionpublicationIdcorrelationIdpartitionKeyreadOnly: truein spec)Sample SDK Response
notifications.getAll(tenantId, { pageSize: 1 }){ "items": [ { "id": "9a3b0db5-9b8b-44a7-9b6a-08de0a17b4e2", "message": "A new model is now available for your product.", "isRead": false, "publisherName": "LlmGateway", "publisherId": "adc041d6-3098-4766-ae45-08dd3ac994aa", "topicName": "New model available for product", "topicKeyName": "New.Model.Available", "topicId": "66e76b72-5ef1-4567-6a00-08dd3ac994ba", "userId": "9ABFE2B8-F30F-4917-9F7F-A91D28F7B23C", "userEmail": null, "tenantId": null, "priority": "Low", "category": "Info", "messageParam": null, "redirectionUrl": "https://alpha.uipath.com/.../portal_/admin/ai-trust-layer/llm-configurations", "publishedOn": 1780413050 } ], "totalCount": 500, "hasNextPage": true, "supportsPageJump": true, "currentPage": 1 }Note:
publishedOnis Unix epoch seconds (not milliseconds). Internal fields (entityOrgName,partitionKey,correlationId, etc.) are stripped before the SDK consumer sees the response.Verification
npm run typechecknpm run lintnpm run test:unitnpm run builddist/notifications/index.{mjs,cjs,d.ts}producedLive API curl confirmed the endpoint works against
alpha/testmanagerdev.Files
src/utils/constants/endpoints/notification.ts(new),src/utils/constants/endpoints/base.ts(NOTIFICATION_BASE),src/utils/constants/endpoints/index.tssrc/models/notification/notifications.types.tssrc/models/notification/notifications.internal-types.tssrc/models/notification/notifications.models.ts,index.tssrc/services/notification/notifications.ts,index.tspackage.json(subpath./notifications),rollup.config.js(notificationsentry)tests/unit/services/notification/notifications.test.ts(4 tests)tests/integration/shared/notification/notifications.integration.test.ts(4 tests,v1mode only)tests/integration/config/test-config.ts(notificationTenantId),tests/integration/config/unified-setup.ts,tests/.env.integration.example(NOTIFICATION_TEST_TENANT_ID)tests/utils/constants/notification.ts,tests/utils/mocks/notification.ts(+ barrel updates)docs/oauth-scopes.md,docs/pagination.md,mkdocs.ymlPR Stack
This PR is part of a 7-PR stack that incrementally builds out the Notifications + Subscriptions services. Each subsequent PR targets the previous PR's branch.
feat/notifications-sdk(this PR)getAllfeat/notifications-mark-readmarkRead,markUnread,markAllReadfeat/notifications-deletedeleteNotifications,deleteAllfeat/subscriptions-sdkgetAll,getPublishers,getSupportedChannelsfeat/subscriptions-topic-updatesupdateTopic,updateCategoryfeat/subscriptions-publisher-updatesupdatePublisher,updateTopicGroupfeat/subscriptions-mode-resetupdateMode,resetReplaces #500.
🤖 Generated with Claude Code