feat(contact-center): expose collaboration flags and desktopProfileFilter (CAI-8354) - #5157
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84383fa63e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| attributes, | ||
| sortBy, | ||
| sortOrder = 'asc', | ||
| desktopProfileFilter, |
There was a problem hiding this comment.
Bypass the cache for desktop-profile filtering
When the same organization/page is requested both with and without desktopProfileFilter within the five-minute TTL, the cache checks at the start and end of getEntryPoints() ignore this new parameter and use the same orgId:page:pageSize key. An unfiltered cached page can therefore satisfy a filtered request, or a filtered response can contaminate a later unfiltered request; include this filter in cache eligibility or the cache key.
AGENTS.md reference: packages/@webex/contact-center/AGENTS.md:L73-L79
Useful? React with 👍 / 👎.
| export type EntryPointListResponse = PaginatedResponse<EntryPointRecord>; | ||
| export type EntryPointSearchParams = BaseSearchParams; | ||
| export interface EntryPointSearchParams extends BaseSearchParams { | ||
| desktopProfileFilter?: boolean; |
There was a problem hiding this comment.
Update the public contract metadata
EntryPointSearchParams is exported from the package root, so adding this option changes the public Services contract, but the commit does not update src/services/ai-docs/services-spec.md, ai-docs/CONTRACTS.md, or .sdd/manifest.json. Record the new parameter in those owning contract artifacts so the canonical SDD and exported TypeScript surface remain synchronized.
AGENTS.md reference: packages/@webex/contact-center/AGENTS.md:L66-L70
Useful? React with 👍 / 👎.
|
|
||
| await entryPointAPI.getEntryPoints({desktopProfileFilter: true}); | ||
|
|
||
| expect(mockWebex.request).toHaveBeenCalledWith({ |
There was a problem hiding this comment.
Use the required assertion helper in new tests
The newly added EntryPoint and config Util cases use Jest expect assertions instead of assert from @webex/test-helper-chai, contrary to the repository's explicit test convention. Convert the new assertions to the mandated helper, using assert.calledOnceWithExactly for the request assertion.
AGENTS.md reference: AGENTS.md:L43-L47
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78d9b379db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| */ | ||
| public async getConsultTransferQueues( | ||
| params: ConsultTransferQueueSearchParams = {} | ||
| ): Promise<ContactServiceQueuesResponse> { |
There was a problem hiding this comment.
Return projection types from specialized list methods
Both specialized methods request only id,name,dbId, but this method declares ContactServiceQueuesResponse and its entry-point counterpart declares EntryPointListResponse. Those record types promise required fields that the projection omits—for example, queues require queueType, channelType, and active, while entry points require type, isActive, and orgId—and neither includes dbId. Consumers can therefore compile accesses that produce undefined; define and return dedicated projected record/response types for these APIs.
AGENTS.md reference: packages/@webex/contact-center/AGENTS.md:L83-L86
Useful? React with 👍 / 👎.
COMPLETES CAI-8354
This pull request addresses
Epic CTI / embedded widget consumers cannot align Consult/Transfer behavior with Agent Desktop because the Contact Center SDK did not expose desktop-profile collaboration access flags on the agent
Profile, andgetEntryPoints()did not support thedesktopProfileFilterquery parameter used by CMS v2 list APIs.Without these surfaces, host apps and
@webex/cc-widgetscannot gate Queues / Entry Point / Agents tabs or scope list results to the agent's desktop profile.by making the following changes
config/Util.ts): MapaccessQueue,accessEntryPoint, andaccessBuddyTeamfrom agent profile config into the SDKProfiletype (ALL|SPECIFIC|NONE).Profile/ config types and exportdesktopProfileFilteronEntryPointSearchParams.EntryPoint.ts): Forward optionaldesktopProfileFilterongetEntryPoints()list requests (existingsortBy/sortOrderbehavior unchanged).config-spec.mdfor the new profile fields.Utilunit coverage for collaboration flag parsing; extendEntryPointtests fordesktopProfileFilterquery param.Companion change: widgets repo PR (CAI-8354) consumes these SDK fields to gate Consult/Transfer tabs and passes
desktopProfileFilter: truefrom the store for queue/entry-point fetches.Change Type
The following scenarios were tested
yarn workspace @webex/contact-center test:unit --testPathPattern="services/config/Util|services/EntryPoint"parseAgentConfigsmapsaccessQueue,accessEntryPoint, andaccessBuddyTeamfor ALL / SPECIFIC / NONE profile valuesgetEntryPoints({ desktopProfileFilter: true })appendsdesktopProfileFilter=trueto the v2 entry-point URL alongside existing pagination/sort paramsThe GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.