resolvePackage method
Resolve an MVR package name (@org/app) to its package ID. Returns the
input unchanged if it is not an MVR name.
Implementation
Future<String> resolvePackage(String package) async {
if (!_hasMvrName(package)) return package;
final resolution = await _bulk('/v1/resolution/bulk', 'names', [package]);
final id = (resolution[package] as Map?)?['package_id'] as String?;
if (id == null) {
throw StateError('MVR could not resolve package "$package"');
}
return id;
}