According to the docs for 5.1 (which you linked to):
The docs for 5.0 do not include either of these so if this was supported, it was an undocumented feature.
Based on this the line should be something like
items.itemChannelLink.replaceChannelLink('itemName', 'channeluid', null);
I actually use replaceMetadata quite frequently and nothing has changed with it as far as I can tell or the docs indicate.
Maybe there’s something in the “blah blah” causing problems. It needs to be replaceMetadata(namepspace, value, { }) where the third argument is an Object defining the configuration.
Without seeing the actual line of code
If it’s the exact line you posted above, well items.metadata indeed doesn’t have a replaceItemChannelLink function.
No. It’s probably you were using an undocumented feature in openhab-js. Perhaps it was a feature that was in work and not done. This undocumented feature changed between when you started using it and when it became a documented feature on OH 5.1.
There’s nothing different about how this stuff is injected.
This determines how the openhab-js helper library is made available in your rule. It controls when the helper library is just there and available or when you need to explicitely import it using a require('openhab');
The wrap option enables the use of return, let and const in managed script conditions (i.e. UI rules). The script actions are automatically wrapped all the time.
The convert event option creates a wrapper around the event Object for managed rules users (i.e. UI users) same as .js file rules users get. See JavaScript Scripting - Automation | openHAB. Which this is disabled, the raw Java event object will continue to be injected into the script actions and script conditions.
If you’ve installed the openhab npm manually the cache option must be turned off.
If you’ve one or more libraries, enable the second option to cause your rules which use a given library to reload when that library changes.