@microsoft/teamsfx 0.6.3-alpha.ffd3f8bc7.0 → 0.7.0-beta.01d6a9fb3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm2017.js +76 -30
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +105 -14
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +78 -30
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +107 -13
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +3 -3
- package/types/teamsfx.d.ts +1316 -1253
package/dist/index.esm2017.js
CHANGED
|
@@ -95,6 +95,8 @@ ErrorMessage.BasicCredentialAlreadyExists = "Basic credential already exists!";
|
|
|
95
95
|
// InvalidParameter Error
|
|
96
96
|
ErrorMessage.EmptyParameter = "Parameter {0} is empty";
|
|
97
97
|
ErrorMessage.DuplicateHttpsOptionProperty = "Axios HTTPS agent already defined value for property {0}";
|
|
98
|
+
ErrorMessage.DuplicateApiKeyInHeader = "The request already defined api key in request header with name {0}.";
|
|
99
|
+
ErrorMessage.DuplicateApiKeyInQueryParam = "The request already defined api key in query parameter with name {0}.";
|
|
98
100
|
/**
|
|
99
101
|
* Error class with code and message thrown by the SDK.
|
|
100
102
|
*
|
|
@@ -1099,7 +1101,7 @@ function createApiClient(apiEndpoint, authProvider) {
|
|
|
1099
1101
|
*/
|
|
1100
1102
|
class BearerTokenAuthProvider {
|
|
1101
1103
|
/**
|
|
1102
|
-
* @param getToken Function that returns the content of bearer token used in http request
|
|
1104
|
+
* @param { () => Promise<string> } getToken - Function that returns the content of bearer token used in http request
|
|
1103
1105
|
*
|
|
1104
1106
|
* @beta
|
|
1105
1107
|
*/
|
|
@@ -1109,7 +1111,7 @@ class BearerTokenAuthProvider {
|
|
|
1109
1111
|
/**
|
|
1110
1112
|
* Adds authentication info to http requests
|
|
1111
1113
|
*
|
|
1112
|
-
* @param config - Contains all the request information and can be updated to include extra authentication info.
|
|
1114
|
+
* @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
|
|
1113
1115
|
* Refer https://axios-http.com/docs/req_config for detailed document.
|
|
1114
1116
|
*
|
|
1115
1117
|
* @returns Updated axios request config.
|
|
@@ -1140,48 +1142,90 @@ class BearerTokenAuthProvider {
|
|
|
1140
1142
|
class BasicAuthProvider {
|
|
1141
1143
|
/**
|
|
1142
1144
|
*
|
|
1143
|
-
* @param userName - Username used in basic auth
|
|
1144
|
-
* @param password - Password used in basic auth
|
|
1145
|
+
* @param { string } userName - Username used in basic auth
|
|
1146
|
+
* @param { string } password - Password used in basic auth
|
|
1147
|
+
*
|
|
1148
|
+
* @throws {@link ErrorCode|InvalidParameter} - when username or password is empty.
|
|
1149
|
+
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1145
1150
|
*
|
|
1146
1151
|
* @beta
|
|
1147
1152
|
*/
|
|
1148
1153
|
constructor(userName, password) {
|
|
1149
|
-
|
|
1150
|
-
throw new ErrorWithCode(formatString(ErrorMessage.EmptyParameter, "username"), ErrorCode.InvalidParameter);
|
|
1151
|
-
}
|
|
1152
|
-
if (!password) {
|
|
1153
|
-
throw new ErrorWithCode(formatString(ErrorMessage.EmptyParameter, "password"), ErrorCode.InvalidParameter);
|
|
1154
|
-
}
|
|
1155
|
-
this.userName = userName;
|
|
1156
|
-
this.password = password;
|
|
1154
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
|
|
1157
1155
|
}
|
|
1158
1156
|
/**
|
|
1159
1157
|
* Adds authentication info to http requests
|
|
1160
1158
|
*
|
|
1161
|
-
* @param config - Contains all the request information and can be updated to include extra authentication info.
|
|
1159
|
+
* @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
|
|
1162
1160
|
* Refer https://axios-http.com/docs/req_config for detailed document.
|
|
1163
1161
|
*
|
|
1164
1162
|
* @returns Updated axios request config.
|
|
1165
1163
|
*
|
|
1166
1164
|
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header or auth property already exists in request configuration.
|
|
1165
|
+
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1167
1166
|
*
|
|
1168
1167
|
* @beta
|
|
1169
1168
|
*/
|
|
1170
1169
|
async AddAuthenticationInfo(config) {
|
|
1171
|
-
|
|
1172
|
-
throw new ErrorWithCode(ErrorMessage.AuthorizationHeaderAlreadyExists, ErrorCode.AuthorizationInfoAlreadyExists);
|
|
1173
|
-
}
|
|
1174
|
-
if (config.auth) {
|
|
1175
|
-
throw new ErrorWithCode(ErrorMessage.BasicCredentialAlreadyExists, ErrorCode.AuthorizationInfoAlreadyExists);
|
|
1176
|
-
}
|
|
1177
|
-
config.auth = {
|
|
1178
|
-
username: this.userName,
|
|
1179
|
-
password: this.password,
|
|
1180
|
-
};
|
|
1181
|
-
return config;
|
|
1170
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
|
|
1182
1171
|
}
|
|
1183
1172
|
}
|
|
1184
1173
|
|
|
1174
|
+
// Copyright (c) Microsoft Corporation.
|
|
1175
|
+
/**
|
|
1176
|
+
* Provider that handles API Key authentication
|
|
1177
|
+
*
|
|
1178
|
+
* @beta
|
|
1179
|
+
*/
|
|
1180
|
+
class ApiKeyProvider {
|
|
1181
|
+
/**
|
|
1182
|
+
*
|
|
1183
|
+
* @param { string } keyName - The name of request header or query parameter that specifies API Key
|
|
1184
|
+
* @param { string } keyValue - The value of API Key
|
|
1185
|
+
* @param { ApiKeyLocation } keyLocation - The location of API Key: request header or query parameter.
|
|
1186
|
+
*
|
|
1187
|
+
* @throws {@link ErrorCode|InvalidParameter} - when key name or key value is empty.
|
|
1188
|
+
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1189
|
+
*
|
|
1190
|
+
* @beta
|
|
1191
|
+
*/
|
|
1192
|
+
constructor(keyName, keyValue, keyLocation) {
|
|
1193
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Adds authentication info to http requests
|
|
1197
|
+
*
|
|
1198
|
+
* @param { AxiosRequestConfig } config - Contains all the request information and can be updated to include extra authentication info.
|
|
1199
|
+
* Refer https://axios-http.com/docs/req_config for detailed document.
|
|
1200
|
+
*
|
|
1201
|
+
* @returns Updated axios request config.
|
|
1202
|
+
*
|
|
1203
|
+
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when API key already exists in request header or url query parameter.
|
|
1204
|
+
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1205
|
+
*
|
|
1206
|
+
* @beta
|
|
1207
|
+
*/
|
|
1208
|
+
async AddAuthenticationInfo(config) {
|
|
1209
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Define available location for API Key location
|
|
1214
|
+
*
|
|
1215
|
+
* @beta
|
|
1216
|
+
*/
|
|
1217
|
+
var ApiKeyLocation;
|
|
1218
|
+
(function (ApiKeyLocation) {
|
|
1219
|
+
/**
|
|
1220
|
+
* The API Key is placed in request header
|
|
1221
|
+
*/
|
|
1222
|
+
ApiKeyLocation[ApiKeyLocation["Header"] = 0] = "Header";
|
|
1223
|
+
/**
|
|
1224
|
+
* The API Key is placed in query parameter
|
|
1225
|
+
*/
|
|
1226
|
+
ApiKeyLocation[ApiKeyLocation["QueryParams"] = 1] = "QueryParams";
|
|
1227
|
+
})(ApiKeyLocation || (ApiKeyLocation = {}));
|
|
1228
|
+
|
|
1185
1229
|
// Copyright (c) Microsoft Corporation.
|
|
1186
1230
|
/**
|
|
1187
1231
|
* Provider that handles Certificate authentication
|
|
@@ -1207,6 +1251,7 @@ class CertificateAuthProvider {
|
|
|
1207
1251
|
* @returns Updated axios request config.
|
|
1208
1252
|
*
|
|
1209
1253
|
* @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
|
|
1254
|
+
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1210
1255
|
*
|
|
1211
1256
|
* @beta
|
|
1212
1257
|
*/
|
|
@@ -1219,29 +1264,30 @@ class CertificateAuthProvider {
|
|
|
1219
1264
|
*
|
|
1220
1265
|
* @param { string | Buffer } cert - The cert chain in PEM format
|
|
1221
1266
|
* @param { string | Buffer } key - The private key for the cert chain
|
|
1222
|
-
* @param { string
|
|
1223
|
-
* @param { string? | Buffer? } ca - Overrides the trusted CA certificates
|
|
1267
|
+
* @param { {passphrase?: string; ca?: string | Buffer} } options - Optional settings when create the cert options.
|
|
1224
1268
|
*
|
|
1225
1269
|
* @returns Instance of SecureContextOptions
|
|
1226
1270
|
*
|
|
1227
1271
|
* @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
|
|
1272
|
+
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1228
1273
|
*
|
|
1229
1274
|
*/
|
|
1230
|
-
function createPemCertOption(cert, key,
|
|
1275
|
+
function createPemCertOption(cert, key, options) {
|
|
1231
1276
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "createPemCertOption"), ErrorCode.RuntimeNotSupported);
|
|
1232
1277
|
}
|
|
1233
1278
|
/**
|
|
1234
1279
|
* Helper to create SecureContextOptions from PFX format cert
|
|
1235
1280
|
*
|
|
1236
1281
|
* @param { string | Buffer } pfx - The content of .pfx file
|
|
1237
|
-
* @param { string
|
|
1282
|
+
* @param { {passphrase?: string} } options - Optional settings when create the cert options.
|
|
1238
1283
|
*
|
|
1239
1284
|
* @returns Instance of SecureContextOptions
|
|
1240
1285
|
*
|
|
1241
1286
|
* @throws {@link ErrorCode|InvalidParameter} - when any parameter is empty
|
|
1287
|
+
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1242
1288
|
*
|
|
1243
1289
|
*/
|
|
1244
|
-
function createPfxCertOption(pfx,
|
|
1290
|
+
function createPfxCertOption(pfx, options) {
|
|
1245
1291
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "createPfxCertOption"), ErrorCode.RuntimeNotSupported);
|
|
1246
1292
|
}
|
|
1247
1293
|
|
|
@@ -1759,5 +1805,5 @@ class CommandBot {
|
|
|
1759
1805
|
}
|
|
1760
1806
|
}
|
|
1761
1807
|
|
|
1762
|
-
export { AppCredential, BasicAuthProvider, BearerTokenAuthProvider, CertificateAuthProvider, Channel, CommandBot, ConversationBot, ErrorCode, ErrorWithCode, IdentityType, LogLevel, Member, MsGraphAuthProvider, NotificationBot, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
|
|
1808
|
+
export { ApiKeyLocation, ApiKeyProvider, AppCredential, BasicAuthProvider, BearerTokenAuthProvider, CertificateAuthProvider, Channel, CommandBot, ConversationBot, ErrorCode, ErrorWithCode, IdentityType, LogLevel, Member, MsGraphAuthProvider, NotificationBot, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
|
|
1763
1809
|
//# sourceMappingURL=index.esm2017.js.map
|