npm package diff
Package: @forge/manifest
Versions: 8.9.0-next.11 - 8.9.0-next.12
File: package/out/validators/permissions-validator.js
Index: package/out/validators/permissions-validator.js
===================================================================
--- package/out/validators/permissions-validator.js
+++ package/out/validators/permissions-validator.js
@@ -108,41 +108,55 @@
}
const mapping = [
{
element: 'external.fetch.backend',
- perms: manifest.typedContent.permissions.external?.fetch?.backend?.filter((key) => typeof key === 'string')
+ perms: manifest.typedContent.permissions.external?.fetch?.backend
+ ?.map((key) => {
+ if (typeof key === 'object' && 'address' in key) {
+ return key.address;
+ }
+ return key;
+ })
+ .filter((key) => typeof key === 'string')
},
{
element: 'external.fetch.client',
- perms: manifest.typedContent.permissions.external?.fetch?.client?.filter((key) => typeof key === 'string')
+ perms: manifest.typedContent.permissions.external?.fetch?.client
+ ?.map((key) => {
+ if (typeof key === 'object' && 'address' in key) {
+ return key.address;
+ }
+ return key;
+ })
+ .filter((key) => typeof key === 'string')
},
{
element: 'external.navigation',
- perms: manifest.typedContent.permissions.external?.navigation
+ perms: manifest.typedContent.permissions.external?.navigation?.map((key) => typeof key === 'object' ? key.address : key)
},
{
element: 'external.styles',
- perms: manifest.typedContent.permissions.external?.styles
+ perms: manifest.typedContent.permissions.external?.styles?.map((key) => typeof key === 'object' ? key.address : key)
},
{
element: 'external.frames',
- perms: manifest.typedContent.permissions.external?.frames
+ perms: manifest.typedContent.permissions.external?.frames?.map((key) => typeof key === 'object' ? key.address : key)
},
{
element: 'external.fonts',
- perms: manifest.typedContent.permissions.external?.fonts
+ perms: manifest.typedContent.permissions.external?.fonts?.map((key) => typeof key === 'object' ? key.address : key)
},
{
element: 'external.images',
- perms: manifest.typedContent.permissions.external?.images
+ perms: manifest.typedContent.permissions.external?.images?.map((key) => typeof key === 'object' ? key.address : key)
},
{
element: 'external.media',
- perms: manifest.typedContent.permissions.external?.media
+ perms: manifest.typedContent.permissions.external?.media?.map((key) => typeof key === 'object' ? key.address : key)
},
{
element: 'external.scripts',
- perms: manifest.typedContent.permissions.external?.scripts
+ perms: manifest.typedContent.permissions.external?.scripts?.map((key) => typeof key === 'object' ? key.address : key)
}
];
mapping.forEach((item) => this.validateExternalPermissionURLs(errors, item.element, item.perms, manifest));
const remoteMap = manifest.typedContent.remotes?.reduce((prev, item) => {
@@ -150,15 +164,17 @@
return prev.set(item.key, baseUrl);
}, new Map());
const invalidBackendRemotes = manifest.typedContent.permissions.external?.fetch?.backend
?.filter((item) => typeof item === 'object' &&
+ 'remote' in item &&
(!remoteMap || !remoteMap.has(item.remote) || !this.isValidURL(remoteMap.get(item.remote))))
.map((item) => item.remote);
if (invalidBackendRemotes?.length) {
this.addValidationErrors(errors, 'external.fetch.backend', invalidBackendRemotes, manifest);
}
const invalidClientRemotes = manifest.typedContent.permissions.external?.fetch?.client
?.filter((item) => typeof item === 'object' &&
+ 'remote' in item &&
(!remoteMap || !remoteMap.has(item.remote) || !this.isValidURL(remoteMap.get(item.remote))))
.map((item) => item.remote);
if (invalidClientRemotes?.length) {
this.addValidationErrors(errors, 'external.fetch.client', invalidClientRemotes, manifest);