This repository has been archived by the owner on Nov 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
ICommandProfileTypeConfiguration.ts
89 lines (84 loc) · 3.74 KB
/
ICommandProfileTypeConfiguration.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
import { ICommandProfileSchema } from "./ICommandProfileSchema";
import { IProfileTypeConfiguration } from "../../../../..";
import { ICommandExampleDefinition } from "../../ICommandExampleDefinition";
import { ICommandProfileAuthConfig } from "./ICommandProfileAuthConfig";
/**
* Cmd packages additions to the profile manager type configuration document. Used by the CliProfileManager. Allows
* profiles to be built from command arguments. See the "CliProfileManager" for more information.
* @export
* @interface ICommandProfileTypeConfiguration
* @extends {IProfileTypeConfiguration}
*/
export interface ICommandProfileTypeConfiguration extends IProfileTypeConfiguration {
/**
* A handler module which Imperative will require().
* The module's default export should be a handler that calls
* appendResponseObject on the provided commandParameters.response
* You do NOT have to implement writing the profile to disk -- you only have to produce
* the final profile object that you would like to be written.
*
*
* This is only required if finished profile can't be created directly from the arguments, e.g.
* if you have --user and --password and need to always transform it into a basic auth
*
*
* If omitted, Imperative will just write all fields present from the schema into the profile
* without requiring a module
*
* @type {string}
* @memberof IProfileTypeConfiguration
*/
createProfileFromArgumentsHandler?: string;
/**
* The module's default export should be a handler that calls appendResponseObject on the provided
* commandParameters.response You do NOT have to implement writing the profile to disk -- you only have to produce
* the final profile object that you would like to be written.
*
* This is only required if finished updated profile can't be created directly from the arguments, e.g.
* if certain fields that the user might specify mean that other fields should be deleted or updated.
*
* If omitted, Imperative will load the old profile, overwrite any fields specified by the user,
* and write the updated profile to disk.
*
* @type {string}
* @memberof IProfileTypeConfiguration
*/
updateProfileFromArgumentsHandler?: string;
/**
* Examples to be displayed in the help text for the auto generated create profile command.
*
* @type {ICommandExampleDefinition[]}
* @memberof IProfileTypeConfiguration
*/
createProfileExamples?: ICommandExampleDefinition[];
/**
* Examples to be displayed in the help text for the auto generated update profile command.
*
* @type {ICommandExampleDefinition[]}
* @memberof IProfileTypeConfiguration
*/
updateProfileExamples?: ICommandExampleDefinition[];
/**
* The JSON schema document. The schema document provides a way to enforce the contents of a profile. The schema
* conforms exactly to the JSON schema specification. You must supply all properties you would like validated
* for correctness on the schema, except for "dependencies". Dependency schema checking is generated automatically
* if you populate the dependencies property of this document.
*
* @type {ICommandProfileSchema}
*/
schema: ICommandProfileSchema;
/**
* Configuration for authentication services to associate with this profile type.
*/
authConfig?: ICommandProfileAuthConfig[];
}