@graphprotocol/graph-cli 0.43.0-alpha-20230319232006-7033248 → 0.43.0-alpha-20230320101423-3c6b0a4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -26,9 +26,10 @@ exports.allowedStudioNetworks = [
|
|
|
26
26
|
];
|
|
27
27
|
const validateStudioNetwork = ({ studio, product, network, }) => {
|
|
28
28
|
const isStudio = studio || product === 'subgraph-studio';
|
|
29
|
-
const isAllowedNetwork = !network ||
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const isAllowedNetwork = !network ||
|
|
30
|
+
exports.allowedStudioNetworks.includes(
|
|
31
|
+
// @ts-expect-error we're checking if the network is allowed
|
|
32
|
+
network);
|
|
32
33
|
if (isStudio && !isAllowedNetwork) {
|
|
33
34
|
throw new Error(`The Subgraph Studio only allows subgraphs for these networks: ${exports.allowedStudioNetworks.join(', ')}`);
|
|
34
35
|
}
|
|
@@ -16,6 +16,12 @@ describe('Version Command Helpers', () => {
|
|
|
16
16
|
network: 'gnosis',
|
|
17
17
|
})).not.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${studio_1.allowedStudioNetworks.join(', ')}`));
|
|
18
18
|
});
|
|
19
|
+
test('And no network is passed', () => {
|
|
20
|
+
expect(() => (0, studio_1.validateStudioNetwork)({
|
|
21
|
+
studio: true,
|
|
22
|
+
network: undefined,
|
|
23
|
+
})).not.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${studio_1.allowedStudioNetworks.join(', ')}`));
|
|
24
|
+
});
|
|
19
25
|
test("And it's NOT an allowed network", () => {
|
|
20
26
|
expect(() => (0, studio_1.validateStudioNetwork)({
|
|
21
27
|
product: 'subgraph-studio',
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED