@contentful/app-scripts 1.18.0 → 1.19.1

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.
@@ -26,9 +26,6 @@ async function openSettings(options) {
26
26
  ]);
27
27
  definitionId = prompts.definitionId;
28
28
  }
29
- console.log(definitionId, 'DEFID');
30
- console.log(options, 'options');
31
- console.log(process.env[constants_1.APP_DEF_ENV_KEY], 'process.env[APP_DEF_ENV_KEY]');
32
29
  if (!definitionId) {
33
30
  console.log(`
34
31
  ${chalk_1.default.red('Error:')} There was no app-definition defined.
package/lib/utils.js CHANGED
@@ -9,6 +9,15 @@ const chalk_1 = __importDefault(require("chalk"));
9
9
  const inquirer_1 = __importDefault(require("inquirer"));
10
10
  const cache_credential_1 = require("./cache-credential");
11
11
  const DEFAULT_MANIFEST_PATH = './contentful-app-manifest.json';
12
+ const graphQLEvents = {
13
+ fieldMappingEvent: 'graphql.field.mapping',
14
+ queryEvent: 'graphql.query',
15
+ };
16
+ const appEvents = {
17
+ appEventFilter: 'appevent.filter',
18
+ appEventHandler: 'appevent.handler',
19
+ appEventTransformation: 'appevent.transformation',
20
+ };
12
21
  const throwValidationException = (subject, message, details) => {
13
22
  console.log(`${chalk_1.default.red('Validation Error:')} Missing or invalid ${subject}.`);
14
23
  message && console.log(message);
@@ -87,15 +96,12 @@ function getEntityFromManifest(type) {
87
96
  return;
88
97
  }
89
98
  logProgress(`${type === 'actions' ? 'App Actions' : 'functions'} found in ${chalk_1.default.bold(DEFAULT_MANIFEST_PATH)}.`);
90
- const fieldMappingEvent = "graphql.field.mapping";
91
- const queryEvent = "graphql.query";
92
- const appEventFilter = 'appevent.filter';
93
99
  const items = manifest[type].map((item) => {
94
100
  const allowNetworks = Array.isArray(item.allowNetworks)
95
101
  ? item.allowNetworks.map(exports.stripProtocol)
96
102
  : [];
97
103
  const accepts = 'accepts' in item && Array.isArray(item.accepts) ? item.accepts : undefined;
98
- const hasInvalidEvent = accepts?.some((event) => ![fieldMappingEvent, queryEvent, appEventFilter].includes(event));
104
+ const hasInvalidEvent = accepts?.some((event) => ![...Object.values(graphQLEvents), ...Object.values(appEvents)].includes(event));
99
105
  const hasInvalidNetwork = allowNetworks.find((netWork) => !(0, exports.isValidNetwork)(netWork));
100
106
  if (hasInvalidNetwork) {
101
107
  console.log(`${chalk_1.default.red('Error:')} Invalid IP address ${hasInvalidNetwork} found in the allowNetworks array for ${type} "${item.name}".`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/app-scripts",
3
- "version": "1.18.0",
3
+ "version": "1.19.1",
4
4
  "description": "A collection of scripts for building Contentful Apps",
5
5
  "author": "Contentful GmbH",
6
6
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  "bottleneck": "2.19.5",
53
53
  "chalk": "4.1.2",
54
54
  "commander": "12.0.0",
55
- "contentful-management": "11.24.3",
55
+ "contentful-management": "11.25.2",
56
56
  "dotenv": "16.4.5",
57
57
  "ignore": "5.3.1",
58
58
  "inquirer": "8.2.6",
@@ -60,7 +60,7 @@
60
60
  "open": "8.4.2",
61
61
  "ora": "5.4.1"
62
62
  },
63
- "gitHead": "2f6ce49aba5bb8a8a781b46ea8441b33aa347404",
63
+ "gitHead": "d5287d1dc518249bd821882dc16a50a6cc93192e",
64
64
  "devDependencies": {
65
65
  "@tsconfig/node18": "18.2.4",
66
66
  "@types/adm-zip": "0.5.5",