@contentful/app-scripts 1.26.0 → 1.28.0

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.
@@ -1,2 +1,3 @@
1
1
  import { UploadOptions, UploadSettings } from '../types';
2
2
  export declare function buildAppUploadSettings(options: UploadOptions): Promise<UploadSettings>;
3
+ export declare function hostProtocolFilter(input: string): string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildAppUploadSettings = void 0;
3
+ exports.hostProtocolFilter = exports.buildAppUploadSettings = void 0;
4
4
  const inquirer_1 = require("inquirer");
5
5
  const get_app_info_1 = require("../get-app-info");
6
6
  const utils_1 = require("../utils");
@@ -37,6 +37,7 @@ async function buildAppUploadSettings(options) {
37
37
  name: 'host',
38
38
  message: `Contentful CMA endpoint URL:`,
39
39
  default: constants_1.DEFAULT_CONTENTFUL_API_HOST,
40
+ filter: hostProtocolFilter,
40
41
  });
41
42
  }
42
43
  const { activateBundle, ...appUploadSettings } = await (0, inquirer_1.prompt)(prompts);
@@ -53,3 +54,7 @@ async function buildAppUploadSettings(options) {
53
54
  };
54
55
  }
55
56
  exports.buildAppUploadSettings = buildAppUploadSettings;
57
+ function hostProtocolFilter(input) {
58
+ return input.replace(/^https?:\/\//, '');
59
+ }
60
+ exports.hostProtocolFilter = hostProtocolFilter;
package/lib/utils.js CHANGED
@@ -14,11 +14,10 @@ const functionEvents = {
14
14
  queryEvent: 'graphql.query',
15
15
  resourceLinksSearchEvent: 'resources.search',
16
16
  resourceLinksLookupEvent: 'resources.lookup',
17
- };
18
- const appEvents = {
19
17
  appEventFilter: 'appevent.filter',
20
18
  appEventHandler: 'appevent.handler',
21
19
  appEventTransformation: 'appevent.transformation',
20
+ appActionCall: 'appaction.call',
22
21
  };
23
22
  const throwValidationException = (subject, message, details) => {
24
23
  console.log(`${chalk_1.default.red('Validation Error:')} Missing or invalid ${subject}.`);
@@ -103,7 +102,7 @@ function getEntityFromManifest(type) {
103
102
  ? item.allowNetworks.map(exports.stripProtocol)
104
103
  : [];
105
104
  const accepts = 'accepts' in item && Array.isArray(item.accepts) ? item.accepts : undefined;
106
- const hasInvalidEvent = accepts?.some((event) => ![...Object.values(functionEvents), ...Object.values(appEvents)].includes(event));
105
+ const hasInvalidEvent = accepts?.some((event) => !Object.values(functionEvents).includes(event));
107
106
  const hasInvalidNetwork = allowNetworks.find((netWork) => !(0, exports.isValidNetwork)(netWork));
108
107
  if (hasInvalidNetwork) {
109
108
  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.26.0",
3
+ "version": "1.28.0",
4
4
  "description": "A collection of scripts for building Contentful Apps",
5
5
  "author": "Contentful GmbH",
6
6
  "license": "MIT",
@@ -48,33 +48,33 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@segment/analytics-node": "^2.0.0",
51
- "adm-zip": "0.5.15",
51
+ "adm-zip": "0.5.16",
52
52
  "bottleneck": "2.19.5",
53
53
  "chalk": "4.1.2",
54
54
  "commander": "12.1.0",
55
- "contentful-management": "11.31.7",
55
+ "contentful-management": "11.35.1",
56
56
  "dotenv": "16.4.5",
57
- "ignore": "5.3.2",
57
+ "ignore": "6.0.2",
58
58
  "inquirer": "8.2.6",
59
59
  "lodash": "4.17.21",
60
60
  "open": "8.4.2",
61
61
  "ora": "5.4.1"
62
62
  },
63
- "gitHead": "346dbb95c0dc70c95d15ed22ecc57c110e2c6c51",
63
+ "gitHead": "580a3ebbe9ac4dbefaf0a7fea989ba4aab7b8dc3",
64
64
  "devDependencies": {
65
65
  "@tsconfig/node18": "18.2.4",
66
66
  "@types/adm-zip": "0.5.5",
67
67
  "@types/analytics-node": "3.1.14",
68
68
  "@types/chai": "4.3.16",
69
69
  "@types/inquirer": "8.2.1",
70
- "@types/lodash": "4.17.7",
71
- "@types/mocha": "10.0.7",
70
+ "@types/lodash": "4.17.9",
71
+ "@types/mocha": "10.0.8",
72
72
  "@types/proxyquire": "1.3.31",
73
73
  "@types/sinon": "17.0.3",
74
74
  "chai": "4.5.0",
75
75
  "mocha": "10.7.3",
76
76
  "proxyquire": "2.1.3",
77
- "sinon": "18.0.0",
77
+ "sinon": "19.0.2",
78
78
  "ts-mocha": "10.0.0",
79
79
  "ts-node": "10.9.2"
80
80
  }