Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/1284 explainTypes --json returns incorrect value for script.supports.changekey #1285

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

/**
Expand Down Expand Up @@ -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();
Expand Down
28 changes: 14 additions & 14 deletions lib/metadataTypes/definitions/Script.definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export default {
typeName: 'Automation: Script Activity',
fields: {
categoryId: {
isCreateable: null,
isUpdateable: null,
isCreateable: true,
isUpdateable: true,
retrieving: true,
template: true,
},
Expand All @@ -37,8 +37,8 @@ export default {
template: false,
},
description: {
isCreateable: null,
isUpdateable: null,
isCreateable: true,
isUpdateable: true,
retrieving: true,
template: true,
},
Expand All @@ -49,8 +49,8 @@ export default {
template: false,
},
key: {
isCreateable: null,
isUpdateable: null,
isCreateable: true,
isUpdateable: true,
retrieving: true,
template: true,
},
Expand All @@ -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,
},
Expand All @@ -91,8 +91,8 @@ export default {
template: false,
},
statusId: {
isCreateable: null,
isUpdateable: null,
isCreateable: false,
isUpdateable: false,
retrieving: false,
template: false,
},
Expand Down
4 changes: 3 additions & 1 deletion lib/util/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

/**
Expand Down Expand Up @@ -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);

Expand Down
15 changes: 15 additions & 0 deletions types/mcdev.d.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Loading