Skip to content

feat(assets): add updateValueById for PUT /odata/Assets({key})#453

Merged
maninder-uipath merged 1 commit into
mainfrom
feat/assets-missing-APIs
Jun 4, 2026
Merged

feat(assets): add updateValueById for PUT /odata/Assets({key})#453
maninder-uipath merged 1 commit into
mainfrom
feat/assets-missing-APIs

Conversation

@maninder-uipath

@maninder-uipath maninder-uipath commented May 20, 2026

Copy link
Copy Markdown
Contributor

https://uipath.atlassian.net/browse/PLT-103905

Adds Assets.updateValueById(id, folderId, newValue) that fetches the asset to determine its valueType, validates the newValue runtime type matches (Text/Integer/Bool only), and PUTs the update while preserving the asset's name, scope, and description. Unsupported valueTypes (Credential, Secret) throw ValidationError.

Swagger for reference

@maninder-uipath maninder-uipath requested a review from a team May 20, 2026 12:36
Comment thread tests/integration/shared/orchestrator/assets.integration.test.ts Outdated
Comment thread src/utils/constants/endpoints/orchestrator.ts Outdated
Comment thread tests/unit/services/orchestrator/assets.test.ts
@claude

claude Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Three issues found this run — see inline comments for details and suggestions.

@maninder-uipath maninder-uipath force-pushed the feat/assets-missing-APIs branch from 388de25 to ce9f80d Compare May 21, 2026 07:21
Comment thread tests/integration/shared/orchestrator/assets.integration.test.ts Outdated
@claude

claude Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

One new finding this run — see inline comment for details and the fix.

@ninja-shreyash

Copy link
Copy Markdown
Contributor

pls address claude comments

@maninder-uipath maninder-uipath force-pushed the feat/assets-missing-APIs branch from ce9f80d to 18d6653 Compare May 25, 2026 05:32
Comment thread src/models/orchestrator/assets.models.ts
@claude

claude Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

One new finding this run — see inline comment for details.

Comment thread src/models/orchestrator/assets.models.ts
Comment thread src/models/orchestrator/assets.models.ts Outdated
Comment thread src/models/orchestrator/assets.models.ts Outdated
Comment thread src/models/orchestrator/assets.types.ts
@maninder-uipath maninder-uipath force-pushed the feat/assets-missing-APIs branch from 18d6653 to 37bd6c4 Compare May 27, 2026 11:07
Comment thread src/models/orchestrator/assets.types.ts
@claude

claude Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

One new finding this run — see inline comment for details and the fix.

@maninder-uipath maninder-uipath force-pushed the feat/assets-missing-APIs branch from 37bd6c4 to 7ba2858 Compare June 3, 2026 10:50
@claude

claude Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread src/models/orchestrator/assets.models.ts Outdated

@vnaren23 vnaren23 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Have we whitelisted this endpoint on gateway?
  2. Please check the PR gate failure.

@maninder-uipath maninder-uipath force-pushed the feat/assets-missing-APIs branch from 7ba2858 to a4ea364 Compare June 3, 2026 12:41
const folderId = Number(config.folderId);

// Find an existing Text-type asset in the folder so we can update it safely
const allAssets = await assets.getAll({

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.

OData filter values should use the camelCase field names shown in the SDK response, not PascalCase API field names. Per the conventions: "filter, select, expand, orderby values use the field case shown in the SDK response (camelCase for services that transform, else as-is) — not the raw API. Applies within JSDoc examples, tests, and internal calls."

Suggested change
const allAssets = await assets.getAll({
filter: "valueType eq 'Text'",

@claude

claude Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

One new finding this run — see inline comment for details.

@maninder-uipath maninder-uipath force-pushed the feat/assets-missing-APIs branch from a4ea364 to dde1563 Compare June 3, 2026 13:45

describe('updateValueById', () => {
const mockExistingAsset = (overrides: Record<string, unknown> = {}) =>
createMockRawAsset({

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.

The new mockExistingAsset wrapper correctly overrides ValueType here, but the underlying createMockRawAsset factory in tests/utils/mocks/assets.ts still uses AssetValueType.DBConnectionString as its default (ValueType: AssetValueType.DBConnectionString at line 24, and valueType: AssetValueType.DBConnectionString in createBasicAsset at line 61). DBConnectionString was removed from the AssetValueType enum in this PR, so npm run typecheck will fail with:

Property 'DBConnectionString' does not exist on type 'typeof AssetValueType'

The same issue affects the two existing getById test assertions:

  • Line 79: expect(result.valueType).toBe(AssetValueType.DBConnectionString,);
  • Line 248: expect(result.valueType).toBe(AssetValueType.DBConnectionString);

All four references need to be updated to a value that still exists in the trimmed enum (e.g. AssetValueType.Text).

@claude

claude Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

One new finding this run — see inline comment for details.

Adds Assets.updateValueById(id, folderId, newValue) that fetches the
asset to determine its valueType, validates the newValue runtime type
matches (Text/Integer/Bool only), and PUTs the update while preserving
the asset's name, scope, and description. Unsupported valueTypes
(Credential, Secret) throw ValidationError.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@maninder-uipath maninder-uipath force-pushed the feat/assets-missing-APIs branch from dde1563 to a7c32b7 Compare June 3, 2026 15:11
@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@maninder-uipath maninder-uipath merged commit b3a00c4 into main Jun 4, 2026
23 of 25 checks passed
@maninder-uipath maninder-uipath deleted the feat/assets-missing-APIs branch June 4, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants