feat(assets): add updateValueById for PUT /odata/Assets({key})#453
Conversation
|
Three issues found this run — see inline comments for details and suggestions. |
388de25 to
ce9f80d
Compare
|
One new finding this run — see inline comment for details and the fix. |
|
pls address claude comments |
ce9f80d to
18d6653
Compare
|
One new finding this run — see inline comment for details. |
18d6653 to
37bd6c4
Compare
|
One new finding this run — see inline comment for details and the fix. |
37bd6c4 to
7ba2858
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
vnaren23
left a comment
There was a problem hiding this comment.
- Have we whitelisted this endpoint on gateway?
- Please check the PR gate failure.
7ba2858 to
a4ea364
Compare
| 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({ |
There was a problem hiding this comment.
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."
| const allAssets = await assets.getAll({ | |
| filter: "valueType eq 'Text'", |
|
One new finding this run — see inline comment for details. |
a4ea364 to
dde1563
Compare
|
|
||
| describe('updateValueById', () => { | ||
| const mockExistingAsset = (overrides: Record<string, unknown> = {}) => | ||
| createMockRawAsset({ |
There was a problem hiding this comment.
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).
|
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>
dde1563 to
a7c32b7
Compare
|



https://uipath.atlassian.net/browse/PLT-103905
Adds
Assets.updateValueById(id, folderId, newValue)that fetches the asset to determine itsvalueType, 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