@contentful/app-scripts 1.13.4 → 1.14.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.
package/lib/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface FunctionAppAction {
|
|
|
10
10
|
allowNetworks?: string[];
|
|
11
11
|
entryFile?: string;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface ContentfulFunction {
|
|
14
14
|
id: string;
|
|
15
15
|
name: string;
|
|
16
16
|
description: string;
|
|
@@ -69,5 +69,5 @@ export interface UploadSettings {
|
|
|
69
69
|
userAgentApplication?: string;
|
|
70
70
|
host?: string;
|
|
71
71
|
actions?: FunctionAppAction[];
|
|
72
|
-
|
|
72
|
+
functions?: ContentfulFunction[];
|
|
73
73
|
}
|
|
@@ -7,7 +7,7 @@ const utils_1 = require("../utils");
|
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
async function buildAppUploadSettings(options) {
|
|
9
9
|
const actionsManifest = (0, utils_1.getEntityFromManifest)('actions');
|
|
10
|
-
const
|
|
10
|
+
const functionManifest = (0, utils_1.getEntityFromManifest)('functions');
|
|
11
11
|
const prompts = [];
|
|
12
12
|
const { bundleDir, comment, skipActivation, host } = options;
|
|
13
13
|
if (!bundleDir) {
|
|
@@ -47,7 +47,7 @@ async function buildAppUploadSettings(options) {
|
|
|
47
47
|
comment,
|
|
48
48
|
host,
|
|
49
49
|
actions: actionsManifest,
|
|
50
|
-
|
|
50
|
+
functions: functionManifest,
|
|
51
51
|
...appUploadSettings,
|
|
52
52
|
...appInfo,
|
|
53
53
|
};
|
|
@@ -10,7 +10,7 @@ const utils_1 = require("../utils");
|
|
|
10
10
|
const contentful_management_1 = require("contentful-management");
|
|
11
11
|
const create_app_upload_1 = require("./create-app-upload");
|
|
12
12
|
async function createAppBundleFromUpload(settings, appUploadId) {
|
|
13
|
-
const { accessToken, host, userAgentApplication, comment, actions,
|
|
13
|
+
const { accessToken, host, userAgentApplication, comment, actions, functions } = settings;
|
|
14
14
|
const clientSpinner = (0, ora_1.default)('Verifying your upload...').start();
|
|
15
15
|
const client = (0, contentful_management_1.createClient)({
|
|
16
16
|
accessToken,
|
|
@@ -27,7 +27,7 @@ async function createAppBundleFromUpload(settings, appUploadId) {
|
|
|
27
27
|
appUploadId,
|
|
28
28
|
comment: comment && comment.length > 0 ? comment : undefined,
|
|
29
29
|
actions,
|
|
30
|
-
|
|
30
|
+
functions,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
catch (err) {
|
|
@@ -18,7 +18,7 @@ const requiredOptions = {
|
|
|
18
18
|
async function getUploadSettingsArgs(options) {
|
|
19
19
|
const validateSpinner = (0, ora_1.default)('Validating your input...').start();
|
|
20
20
|
const actionsManifest = (0, utils_1.getEntityFromManifest)('actions');
|
|
21
|
-
const
|
|
21
|
+
const functionManifest = (0, utils_1.getEntityFromManifest)('functions');
|
|
22
22
|
const { bundleDir, comment, skipActivation, host, userAgentApplication } = options;
|
|
23
23
|
try {
|
|
24
24
|
(0, validate_arguments_1.validateArguments)(requiredOptions, options, 'upload');
|
|
@@ -31,7 +31,7 @@ async function getUploadSettingsArgs(options) {
|
|
|
31
31
|
host,
|
|
32
32
|
userAgentApplication,
|
|
33
33
|
actions: actionsManifest,
|
|
34
|
-
|
|
34
|
+
functions: functionManifest,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
catch (err) {
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Definition } from './definition-api';
|
|
2
2
|
import { Organization } from './organization-api';
|
|
3
|
-
import {
|
|
3
|
+
import { ContentfulFunction, FunctionAppAction } from './types';
|
|
4
4
|
export declare const throwValidationException: (subject: string, message?: string, details?: string) => never;
|
|
5
5
|
export declare const isValidNetwork: (address: string) => boolean;
|
|
6
6
|
export declare const stripProtocol: (url: string) => string;
|
|
7
7
|
export declare const showCreationError: (subject: string, message: string) => void;
|
|
8
8
|
export declare const throwError: (err: Error, message: string) => never;
|
|
9
9
|
export declare const selectFromList: <T extends Definition | Organization>(list: T[], message: string, cachedOptionEnvVar: string) => Promise<T>;
|
|
10
|
-
type Entities<Type> = Type extends 'actions' ? Omit<FunctionAppAction, 'entryFile'>[] : Omit<
|
|
11
|
-
export declare function getEntityFromManifest<Type extends 'actions' | '
|
|
10
|
+
type Entities<Type> = Type extends 'actions' ? Omit<FunctionAppAction, 'entryFile'>[] : Omit<ContentfulFunction, 'entryFile'>[];
|
|
11
|
+
export declare function getEntityFromManifest<Type extends 'actions' | 'functions'>(type: Type): Entities<Type> | undefined;
|
|
12
12
|
export {};
|
package/lib/utils.js
CHANGED
|
@@ -86,7 +86,7 @@ function getEntityFromManifest(type) {
|
|
|
86
86
|
if (!Array.isArray(manifest[type]) || manifest[type].length === 0) {
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
logProgress(`${type === 'actions' ? 'App Actions' : '
|
|
89
|
+
logProgress(`${type === 'actions' ? 'App Actions' : 'functions'} found in ${chalk_1.default.bold(DEFAULT_MANIFEST_PATH)}.`);
|
|
90
90
|
const items = manifest[type].map((item) => {
|
|
91
91
|
const allowNetworks = Array.isArray(item.allowNetworks)
|
|
92
92
|
? item.allowNetworks.map(exports.stripProtocol)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/app-scripts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "A collection of scripts for building Contentful Apps",
|
|
5
5
|
"author": "Contentful GmbH",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"bottleneck": "2.19.5",
|
|
53
53
|
"chalk": "4.1.2",
|
|
54
54
|
"commander": "11.1.0",
|
|
55
|
-
"contentful-management": "11.14.
|
|
55
|
+
"contentful-management": "11.14.3",
|
|
56
56
|
"dotenv": "16.4.1",
|
|
57
|
-
"ignore": "5.3.
|
|
57
|
+
"ignore": "5.3.1",
|
|
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": "
|
|
63
|
+
"gitHead": "70d4b4a2ed21008ed58c125652cbb4a209344eb3",
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@tsconfig/node18": "18.2.2",
|
|
66
66
|
"@types/adm-zip": "0.5.5",
|