From 5384295fd761e45f875f6eb8e54cc852726f35ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 19:15:10 +0200 Subject: [PATCH 1/2] #1284: fix script.definition file --- .../definitions/Script.definition.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/metadataTypes/definitions/Script.definition.js b/lib/metadataTypes/definitions/Script.definition.js index b88b68ebc..8200150ec 100644 --- a/lib/metadataTypes/definitions/Script.definition.js +++ b/lib/metadataTypes/definitions/Script.definition.js @@ -19,8 +19,8 @@ export default { typeName: 'Automation: Script Activity', fields: { categoryId: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, @@ -37,8 +37,8 @@ export default { template: false, }, description: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, @@ -49,8 +49,8 @@ export default { template: false, }, key: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, @@ -67,20 +67,20 @@ export default { template: false, }, name: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, script: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, ssjsActivityId: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, @@ -91,8 +91,8 @@ export default { template: false, }, statusId: { - isCreateable: null, - isUpdateable: null, + isCreateable: false, + isUpdateable: false, retrieving: false, template: false, }, From cca38a16728b13bd3eb68742f957a364da8f7a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 19:20:42 +0200 Subject: [PATCH 2/2] #1284: add proper typing for explainTypes --- lib/index.js | 3 ++- lib/util/cli.js | 4 +++- types/mcdev.d.js | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 33185d5b7..87171109c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -33,6 +33,7 @@ import cache from './util/cache.js'; * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../types/mcdev.d.js').ExplainType} ExplainType */ /** @@ -154,7 +155,7 @@ class Mcdev { await Cli.selectTypes(properties); } /** - * @returns {object[]} list of supported types with their apiNames + * @returns {ExplainType[]} list of supported types with their apiNames */ static explainTypes() { return Cli.explainTypes(); diff --git a/lib/util/cli.js b/lib/util/cli.js index 0626fe022..e69c33745 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -29,6 +29,7 @@ import TransactionalMessage from './../metadataTypes/TransactionalMessage.js'; * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../../types/mcdev.d.js').ExplainType} ExplainType */ /** @@ -603,9 +604,10 @@ const Cli = { /** * shows metadata type descriptions * - * @returns {object[]} list of supported types with their apiNames + * @returns {ExplainType[]} list of supported types with their apiNames */ explainTypes() { + /** @type {ExplainType[]} */ const json = []; const apiNameArr = Object.keys(MetadataDefinitions); diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 1197a87b7..15a4e934b 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -444,5 +444,20 @@ complex * @property {Function} errorStack (ex, msg) print error with trace message * @typedef {import('winston').Logger & McdevLogger} Logger */ +/** + * @typedef {object} ExplainType + * @property {string} name readable name of type + * @property {string} apiName api parameter name for type + * @property {string} description more info on what this type is about + * @property {boolean | string[]} retrieveByDefault is it retrieved by default OR list of subtypes that are retrieved by default + * @property {object} supports supported features + * @property {boolean} supports.retrieve can you download this type + * @property {boolean} supports.create can you create new records of this type + * @property {boolean} supports.update can you update records of this type + * @property {boolean} supports.delete can you delete records of this type + * @property {boolean} supports.changeKey can you change the key of existing records of this type + * @property {boolean} supports.buildTemplate can you apply templating on downloaded records of this type + * @property {boolean} supports.retrieveAsTemplate can you retrieve & template in one step + */ export default {};