You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want users to have an easy flow when using this SDK. For items, we want them to be able to provide either the ID or the title of an item as a parameter.
Tasks to be done
Adjust get function in src/lib/resources.ts so that now it checks whether the input is a valid Item ID or not (i.e. it matches the following regex: "^[a-z0-9]{26}$")
Adjust getItem by changing the parameter name to suggest that either the name or ID is accepted (e.g. itemQuery).
Create a new function getItemById in src/lib/op-connect.ts
/** * Get details about a specific vault with a matching ID value. * * @param {string} vaultId * @param {string} itemId * @returns {Promise<FullItem>} */publicasyncgetItemById(vaultId: string,itemId: string): Promise<FullItem>{returnawaitthis.items.getById(vaultId,itemId);}
Add and adjust tests for the new functions in __test__/op-connect.test.ts
The text was updated successfully, but these errors were encountered:
Sumary
We want users to have an easy flow when using this SDK. For items, we want them to be able to provide either the ID or the title of an item as a parameter.
Tasks to be done
get
function insrc/lib/resources.ts
so that now it checks whether the input is a valid Item ID or not (i.e. it matches the following regex:"^[a-z0-9]{26}$"
)getItem
by changing the parameter name to suggest that either the name or ID is accepted (e.g.itemQuery
).getItemById
insrc/lib/op-connect.ts
__test__/op-connect.test.ts
The text was updated successfully, but these errors were encountered: