Skip to content

Commit a9aa775

Browse files
Banner-KeithKeith Banner
andauthored
Added new required functions (#827)
* Added new required functions. Return the value instead of the value or undefined. getInputRequired getPathInputRequired getEndpointUrlRequired getEndpointDataParameterRequired getEndpointAuthorizationSchemeRequired getEndpointAuthorizationParameterRequired * Fix undefined in json file * Simplify Required functions. Add tests. Co-authored-by: Keith Banner <[email protected]>
1 parent 5ebf55f commit a9aa775

File tree

6 files changed

+871
-286
lines changed

6 files changed

+871
-286
lines changed

node/docs/azure-pipelines-task-lib.json

Lines changed: 155 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@
640640
}
641641
],
642642
"members": {},
643-
"return": "string",
643+
"return": "string | undefined",
644644
"documentation": "Gets a variable value that is defined on the build/release definition or set at runtime.\n\n@returns string"
645645
}
646646
]
@@ -759,7 +759,7 @@
759759
"getInput": {
760760
"name": "getInput",
761761
"members": {},
762-
"documentation": "Gets the value of an input. The value is also trimmed.\nIf required is true and the value is not set, it will throw.\n\n@returns string",
762+
"documentation": "Gets the value of an input. The value is also trimmed.\nIf required is true and the value is not set, it will throw.\n\n@returns string | undefined",
763763
"kind": "function",
764764
"signatures": [
765765
{
@@ -778,8 +778,29 @@
778778
}
779779
],
780780
"members": {},
781+
"return": "string | undefined",
782+
"documentation": "Gets the value of an input. The value is also trimmed.\nIf required is true and the value is not set, it will throw.\n\n@returns string | undefined"
783+
}
784+
]
785+
},
786+
"getInputRequired": {
787+
"name": "getInputRequired",
788+
"members": {},
789+
"documentation": "Gets the value of an input. The value is also trimmed.\nIf the value is not set, it will throw.\n\n@returns string",
790+
"kind": "function",
791+
"signatures": [
792+
{
793+
"parameters": [
794+
{
795+
"name": "name",
796+
"type": "string",
797+
"optional": false,
798+
"documentation": "name of the input to get"
799+
}
800+
],
801+
"members": {},
781802
"return": "string",
782-
"documentation": "Gets the value of an input. The value is also trimmed.\nIf required is true and the value is not set, it will throw.\n\n@returns string"
803+
"documentation": "Gets the value of an input. The value is also trimmed.\nIf the value is not set, it will throw.\n\n@returns string"
783804
}
784805
]
785806
},
@@ -867,7 +888,7 @@
867888
"getPathInput": {
868889
"name": "getPathInput",
869890
"members": {},
870-
"documentation": "Gets the value of a path input\nIt will be quoted for you if it isn't already and contains spaces\nIf required is true and the value is not set, it will throw.\nIf check is true and the path does not exist, it will throw.\n\n@returns string",
891+
"documentation": "Gets the value of a path input\nIt will be quoted for you if it isn't already and contains spaces\nIf required is true and the value is not set, it will throw.\nIf check is true and the path does not exist, it will throw.\n\n@returns string | undefined",
871892
"kind": "function",
872893
"signatures": [
873894
{
@@ -892,15 +913,42 @@
892913
}
893914
],
894915
"members": {},
916+
"return": "string | undefined",
917+
"documentation": "Gets the value of a path input\nIt will be quoted for you if it isn't already and contains spaces\nIf required is true and the value is not set, it will throw.\nIf check is true and the path does not exist, it will throw.\n\n@returns string | undefined"
918+
}
919+
]
920+
},
921+
"getPathInputRequired": {
922+
"name": "getPathInputRequired",
923+
"members": {},
924+
"documentation": "Gets the value of a path input\nIt will be quoted for you if it isn't already and contains spaces\nIf the value is not set, it will throw.\nIf check is true and the path does not exist, it will throw.\n\n@returns string",
925+
"kind": "function",
926+
"signatures": [
927+
{
928+
"parameters": [
929+
{
930+
"name": "name",
931+
"type": "string",
932+
"optional": false,
933+
"documentation": "name of the input to get"
934+
},
935+
{
936+
"name": "check",
937+
"type": "boolean",
938+
"optional": true,
939+
"documentation": "whether path is checked. optional, defaults to false "
940+
}
941+
],
942+
"members": {},
895943
"return": "string",
896-
"documentation": "Gets the value of a path input\nIt will be quoted for you if it isn't already and contains spaces\nIf required is true and the value is not set, it will throw.\nIf check is true and the path does not exist, it will throw.\n\n@returns string"
944+
"documentation": "Gets the value of a path input\nIt will be quoted for you if it isn't already and contains spaces\nIf the value is not set, it will throw.\nIf check is true and the path does not exist, it will throw.\n\n@returns string"
897945
}
898946
]
899947
},
900948
"getEndpointUrl": {
901949
"name": "getEndpointUrl",
902950
"members": {},
903-
"documentation": "Gets the url for a service endpoint\nIf the url was not set and is not optional, it will throw.\n\n@returns string",
951+
"documentation": "Gets the url for a service endpoint\nIf the url was not set and is not optional, it will throw.\n\n@returns string | undefined",
904952
"kind": "function",
905953
"signatures": [
906954
{
@@ -919,8 +967,29 @@
919967
}
920968
],
921969
"members": {},
970+
"return": "string | undefined",
971+
"documentation": "Gets the url for a service endpoint\nIf the url was not set and is not optional, it will throw.\n\n@returns string | undefined"
972+
}
973+
]
974+
},
975+
"getEndpointUrlRequired": {
976+
"name": "getEndpointUrlRequired",
977+
"members": {},
978+
"documentation": "Gets the url for a service endpoint\nIf the url was not set, it will throw.\n\n@returns string",
979+
"kind": "function",
980+
"signatures": [
981+
{
982+
"parameters": [
983+
{
984+
"name": "id",
985+
"type": "string",
986+
"optional": false,
987+
"documentation": "name of the service endpoint"
988+
}
989+
],
990+
"members": {},
922991
"return": "string",
923-
"documentation": "Gets the url for a service endpoint\nIf the url was not set and is not optional, it will throw.\n\n@returns string"
992+
"documentation": "Gets the url for a service endpoint\nIf the url was not set, it will throw.\n\n@returns string"
924993
}
925994
]
926995
},
@@ -952,6 +1021,33 @@
9521021
}
9531022
],
9541023
"members": {},
1024+
"return": "string | undefined",
1025+
"documentation": ""
1026+
}
1027+
]
1028+
},
1029+
"getEndpointDataParameterRequired": {
1030+
"name": "getEndpointDataParameterRequired",
1031+
"members": {},
1032+
"documentation": "",
1033+
"kind": "function",
1034+
"signatures": [
1035+
{
1036+
"parameters": [
1037+
{
1038+
"name": "id",
1039+
"type": "string",
1040+
"optional": false,
1041+
"documentation": ""
1042+
},
1043+
{
1044+
"name": "key",
1045+
"type": "string",
1046+
"optional": false,
1047+
"documentation": ""
1048+
}
1049+
],
1050+
"members": {},
9551051
"return": "string",
9561052
"documentation": ""
9571053
}
@@ -960,7 +1056,7 @@
9601056
"getEndpointAuthorizationScheme": {
9611057
"name": "getEndpointAuthorizationScheme",
9621058
"members": {},
963-
"documentation": "Gets the endpoint authorization scheme for a service endpoint\nIf the endpoint authorization scheme is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization scheme",
1059+
"documentation": "Gets the endpoint authorization scheme for a service endpoint\nIf the endpoint authorization scheme is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization scheme or undefined",
9641060
"kind": "function",
9651061
"signatures": [
9661062
{
@@ -979,15 +1075,36 @@
9791075
}
9801076
],
9811077
"members": {},
1078+
"return": "string | undefined",
1079+
"documentation": "Gets the endpoint authorization scheme for a service endpoint\nIf the endpoint authorization scheme is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization scheme or undefined"
1080+
}
1081+
]
1082+
},
1083+
"getEndpointAuthorizationSchemeRequired": {
1084+
"name": "getEndpointAuthorizationSchemeRequired",
1085+
"members": {},
1086+
"documentation": "Gets the endpoint authorization scheme for a service endpoint\nIf the endpoint authorization scheme is not set, it will throw.\n\n@returns {string} value of the endpoint authorization scheme",
1087+
"kind": "function",
1088+
"signatures": [
1089+
{
1090+
"parameters": [
1091+
{
1092+
"name": "id",
1093+
"type": "string",
1094+
"optional": false,
1095+
"documentation": "name of the service endpoint"
1096+
}
1097+
],
1098+
"members": {},
9821099
"return": "string",
983-
"documentation": "Gets the endpoint authorization scheme for a service endpoint\nIf the endpoint authorization scheme is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization scheme"
1100+
"documentation": "Gets the endpoint authorization scheme for a service endpoint\nIf the endpoint authorization scheme is not set, it will throw.\n\n@returns {string} value of the endpoint authorization scheme"
9841101
}
9851102
]
9861103
},
9871104
"getEndpointAuthorizationParameter": {
9881105
"name": "getEndpointAuthorizationParameter",
9891106
"members": {},
990-
"documentation": "Gets the endpoint authorization parameter value for a service endpoint with specified key\nIf the endpoint authorization parameter is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization parameter value",
1107+
"documentation": "Gets the endpoint authorization parameter value for a service endpoint with specified key\nIf the endpoint authorization parameter is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization parameter value or undefined",
9911108
"kind": "function",
9921109
"signatures": [
9931110
{
@@ -1012,8 +1129,35 @@
10121129
}
10131130
],
10141131
"members": {},
1132+
"return": "string | undefined",
1133+
"documentation": "Gets the endpoint authorization parameter value for a service endpoint with specified key\nIf the endpoint authorization parameter is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization parameter value or undefined"
1134+
}
1135+
]
1136+
},
1137+
"getEndpointAuthorizationParameterRequired": {
1138+
"name": "getEndpointAuthorizationParameterRequired",
1139+
"members": {},
1140+
"documentation": "Gets the endpoint authorization parameter value for a service endpoint with specified key\nIf the endpoint authorization parameter is not set, it will throw.\n\n@returns {string} value of the endpoint authorization parameter value",
1141+
"kind": "function",
1142+
"signatures": [
1143+
{
1144+
"parameters": [
1145+
{
1146+
"name": "id",
1147+
"type": "string",
1148+
"optional": false,
1149+
"documentation": "name of the service endpoint"
1150+
},
1151+
{
1152+
"name": "key",
1153+
"type": "string",
1154+
"optional": false,
1155+
"documentation": "key to find the endpoint authorization parameter"
1156+
}
1157+
],
1158+
"members": {},
10151159
"return": "string",
1016-
"documentation": "Gets the endpoint authorization parameter value for a service endpoint with specified key\nIf the endpoint authorization parameter is not set and is not optional, it will throw.\n\n@returns {string} value of the endpoint authorization parameter value"
1160+
"documentation": "Gets the endpoint authorization parameter value for a service endpoint with specified key\nIf the endpoint authorization parameter is not set, it will throw.\n\n@returns {string} value of the endpoint authorization parameter value"
10171161
}
10181162
]
10191163
},

0 commit comments

Comments
 (0)