UNPKG

@broadcom/endevor-bridge-for-git-for-zowe-cli

Version:

Endevor Bridge for Git plug-in for Zowe CLI

105 lines (101 loc) 4 kB
'use strict'; var EBGOptions = require('../../../options/EBGOptions.js'); var EndevorOptions = require('../../../options/EndevorOptions.js'); var HelpConstants = require('../../../constants/HelpConstants.js'); var AddElementSchema = require('../../../../api/utils/schemas/AddElementSchema.js'); /* * Copyright (c) 2019 Broadcom. All Rights Reserved. The term * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This software and all information contained therein is * confidential and proprietary and shall not be duplicated, * used, disclosed, or disseminated in any way except as * authorized by the applicable license agreement, without the * express written permission of Broadcom. All authorized * reproductions must be marked with this language. * * EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO * THE EXTENT PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS * SOFTWARE WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT * LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL BROADCOM * BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR * DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE, * INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS * INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF BROADCOM IS * EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE. */ const jsonExample = [ { fullElmName: "ELMNAME", typeName: "ELMTYPE", }, ]; // Validate jsonExample fully matches the schema AddElementSchema.addElementSchema.parse(jsonExample); const addElementJsonStringExample = JSON.stringify(jsonExample, null, 2).replace(/ /g, "\xa0"); class AddElementOptions extends EBGOptions.EBGOptions { } AddElementOptions.ALL_BRANCHES = { name: "all-branches", description: "If specified, add the requested elements to all synchronized branches in your repository.", type: "boolean", defaultValue: false, }; AddElementOptions.WITH_DEPENDENCIES = { name: "withDependencies", description: "If specified, add the requested element (for example, COBOL copybooks) with dependencies.", type: "boolean", defaultValue: false, }; AddElementOptions.FORCE_GET_DEPENDENCIES = { name: "force-get-dependencies", aliases: ["force"], description: "If specified, bypass the maximum number of dependencies. This only applies to the repository administrator.", type: "boolean", defaultValue: false, }; AddElementOptions.FILE_NAME = { name: "file", aliases: ["fn"], description: `If specified, read the elements to add from file. Ensure that the file is in the format specified in the documentation and follows the example: ${addElementJsonStringExample} `, type: "existingLocalFile", }; AddElementOptions.ENDEVOR_SYSTEM = { name: "endevor-system", aliases: ["endevorsys", "system"], description: HelpConstants.helpConstants.endevorSystemDesc, type: "string", stringLengthRange: [1, EndevorOptions.EndevorOptions.INVENTORY_MAX_LEN], }; AddElementOptions.ENDEVOR_SUBSYSTEM = { name: "endevor-subsystem", aliases: ["endevorsub", "sub", "subsystem"], description: HelpConstants.helpConstants.endevorSubsystemDesc, type: "string", stringLengthRange: [1, EndevorOptions.EndevorOptions.INVENTORY_MAX_LEN], }; AddElementOptions.ELEMENT_NAME = { name: "element-name", aliases: ["name"], description: "Name of the Endevor element to add.", type: "string", required: false, }; AddElementOptions.ELEMENT_TYPE = { name: "element-type", aliases: ["type"], description: "Type of Endevor element to add.", type: "string", stringLengthRange: [1, EndevorOptions.EndevorOptions.INVENTORY_MAX_LEN], required: false, }; AddElementOptions.BRANCH_ID = { name: "branchId", description: "If specified, add the requested elements to the selected branch.", type: "string", }; exports.AddElementOptions = AddElementOptions;