feat: add @actions/cache

This commit is contained in:
xHyroM 2022-07-12 09:00:22 +02:00
parent b15fb7d098
commit 16e8c96a41
1932 changed files with 261172 additions and 10 deletions

View file

@ -0,0 +1,9 @@
import { CommonRequestInfo, CommonRequestInit, CommonResponse, FetchHttpClient } from "./fetchHttpClient";
import { HttpOperationResponse } from "./httpOperationResponse";
import { WebResourceLike } from "./webResource";
export declare class BrowserFetchHttpClient extends FetchHttpClient {
prepareRequest(_httpRequest: WebResourceLike): Promise<Partial<RequestInit>>;
processRequest(_operationResponse: HttpOperationResponse): Promise<void>;
fetch(input: CommonRequestInfo, init?: CommonRequestInit): Promise<CommonResponse>;
}
//# sourceMappingURL=browserFetchHttpClient.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"browserFetchHttpClient.d.ts","sourceRoot":"","sources":["../../lib/browserFetchHttpClient.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,cAAc,CAAC,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAI5E,cAAc,CAAC,kBAAkB,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,KAAK,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;CAGnF"}

View file

@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __extends } from "tslib";
import { FetchHttpClient, } from "./fetchHttpClient";
var BrowserFetchHttpClient = /** @class */ (function (_super) {
__extends(BrowserFetchHttpClient, _super);
function BrowserFetchHttpClient() {
return _super !== null && _super.apply(this, arguments) || this;
}
BrowserFetchHttpClient.prototype.prepareRequest = function (_httpRequest) {
return Promise.resolve({});
};
BrowserFetchHttpClient.prototype.processRequest = function (_operationResponse) {
return Promise.resolve();
};
BrowserFetchHttpClient.prototype.fetch = function (input, init) {
return fetch(input, init);
};
return BrowserFetchHttpClient;
}(FetchHttpClient));
export { BrowserFetchHttpClient };
//# sourceMappingURL=browserFetchHttpClient.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"browserFetchHttpClient.js","sourceRoot":"","sources":["../../lib/browserFetchHttpClient.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,OAAO,EAIL,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAI3B;IAA4C,0CAAe;IAA3D;;IAYA,CAAC;IAXC,+CAAc,GAAd,UAAe,YAA6B;QAC1C,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED,+CAAc,GAAd,UAAe,kBAAyC;QACtD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,sCAAK,GAAL,UAAM,KAAwB,EAAE,IAAwB;QACtD,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC;IACH,6BAAC;AAAD,CAAC,AAZD,CAA4C,eAAe,GAY1D"}

View file

@ -0,0 +1,46 @@
import { WebResourceLike } from "../webResource";
import { ServiceClientCredentials } from "./serviceClientCredentials";
/**
* @interface ApiKeyCredentialOptions
* Describes the options to be provided while creating an instance of ApiKeyCredentials
*/
export interface ApiKeyCredentialOptions {
/**
* A key value pair of the header parameters that need to be applied to the request.
*/
inHeader?: {
[x: string]: any;
};
/**
* A key value pair of the query parameters that need to be applied to the request.
*/
inQuery?: {
[x: string]: any;
};
}
/**
* Authenticates to a service using an API key.
*/
export declare class ApiKeyCredentials implements ServiceClientCredentials {
/**
* A key value pair of the header parameters that need to be applied to the request.
*/
private readonly inHeader?;
/**
* A key value pair of the query parameters that need to be applied to the request.
*/
private readonly inQuery?;
/**
* @constructor
* @param {object} options Specifies the options to be provided for auth. Either header or query needs to be provided.
*/
constructor(options: ApiKeyCredentialOptions);
/**
* Signs a request with the values provided in the inHeader and inQuery parameter.
*
* @param {WebResource} webResource The WebResource to be signed.
* @returns {Promise<WebResource>} The signed request object.
*/
signRequest(webResource: WebResourceLike): Promise<WebResourceLike>;
}
//# sourceMappingURL=apiKeyCredentials.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"apiKeyCredentials.d.ts","sourceRoot":"","sources":["../../../lib/credentials/apiKeyCredentials.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAChC;AAED;;GAEG;AACH,qBAAa,iBAAkB,YAAW,wBAAwB;IAChE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAuB;IACjD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAuB;IAEhD;;;OAGG;gBACS,OAAO,EAAE,uBAAuB;IAU5C;;;;;OAKG;IACH,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAiCpE"}

View file

@ -0,0 +1,56 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { HttpHeaders } from "../httpHeaders";
/**
* Authenticates to a service using an API key.
*/
var ApiKeyCredentials = /** @class */ (function () {
/**
* @constructor
* @param {object} options Specifies the options to be provided for auth. Either header or query needs to be provided.
*/
function ApiKeyCredentials(options) {
if (!options || (options && !options.inHeader && !options.inQuery)) {
throw new Error("options cannot be null or undefined. Either \"inHeader\" or \"inQuery\" property of the options object needs to be provided.");
}
this.inHeader = options.inHeader;
this.inQuery = options.inQuery;
}
/**
* Signs a request with the values provided in the inHeader and inQuery parameter.
*
* @param {WebResource} webResource The WebResource to be signed.
* @returns {Promise<WebResource>} The signed request object.
*/
ApiKeyCredentials.prototype.signRequest = function (webResource) {
if (!webResource) {
return Promise.reject(new Error("webResource cannot be null or undefined and must be of type \"object\"."));
}
if (this.inHeader) {
if (!webResource.headers) {
webResource.headers = new HttpHeaders();
}
for (var headerName in this.inHeader) {
webResource.headers.set(headerName, this.inHeader[headerName]);
}
}
if (this.inQuery) {
if (!webResource.url) {
return Promise.reject(new Error("url cannot be null in the request object."));
}
if (webResource.url.indexOf("?") < 0) {
webResource.url += "?";
}
for (var key in this.inQuery) {
if (!webResource.url.endsWith("?")) {
webResource.url += "&";
}
webResource.url += key + "=" + this.inQuery[key];
}
}
return Promise.resolve(webResource);
};
return ApiKeyCredentials;
}());
export { ApiKeyCredentials };
//# sourceMappingURL=apiKeyCredentials.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"apiKeyCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/apiKeyCredentials.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAmB7C;;GAEG;AACH;IAUE;;;OAGG;IACH,2BAAY,OAAgC;QAC1C,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAClE,MAAM,IAAI,KAAK,CACb,8HAA0H,CAC3H,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,OAAO,CA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 -0,0 +1,20 @@
import { ServiceClientCredentials } from "./serviceClientCredentials";
import { WebResource } from "../webResource";
import { TokenCredential } from "@azure/core-auth";
import { TokenResponse } from "./tokenResponse";
/**
* Resource manager endpoints to match in order to specify a valid scope to the AzureIdentityCredentialAdapter.
*/
export declare const azureResourceManagerEndpoints: string[];
/**
* This class provides a simple extension to use {@link TokenCredential} from `@azure/identity` library to
* use with legacy Azure SDKs that accept {@link ServiceClientCredentials} family of credentials for authentication.
*/
export declare class AzureIdentityCredentialAdapter implements ServiceClientCredentials {
private azureTokenCredential;
private scopes;
constructor(azureTokenCredential: TokenCredential, scopes?: string | string[]);
getToken(): Promise<TokenResponse>;
signRequest(webResource: WebResource): Promise<WebResource>;
}
//# sourceMappingURL=azureIdentityTokenCredentialAdapter.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"azureIdentityTokenCredentialAdapter.d.ts","sourceRoot":"","sources":["../../../lib/credentials/azureIdentityTokenCredentialAdapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;GAEG;AACH,eAAO,MAAM,6BAA6B,UAKzC,CAAC;AAEF;;;GAGG;AACH,qBAAa,8BAA+B,YAAW,wBAAwB;IAC7E,OAAO,CAAC,oBAAoB,CAAkB;IAC9C,OAAO,CAAC,MAAM,CAAoB;gBAEhC,oBAAoB,EAAE,eAAe,EACrC,MAAM,GAAE,MAAM,GAAG,MAAM,EAA4C;IAMxD,QAAQ,IAAI,OAAO,CAAC,aAAa,CAAC;IAclC,WAAW,CAAC,WAAW,EAAE,WAAW;CAQlD"}

View file

@ -0,0 +1,66 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __awaiter, __generator } from "tslib";
import { Constants as MSRestConstants } from "../util/constants";
var DEFAULT_AUTHORIZATION_SCHEME = "Bearer";
/**
* Resource manager endpoints to match in order to specify a valid scope to the AzureIdentityCredentialAdapter.
*/
export var azureResourceManagerEndpoints = [
"https://management.windows.net",
"https://management.chinacloudapi.cn",
"https://management.usgovcloudapi.net",
"https://management.cloudapi.de",
];
/**
* This class provides a simple extension to use {@link TokenCredential} from `@azure/identity` library to
* use with legacy Azure SDKs that accept {@link ServiceClientCredentials} family of credentials for authentication.
*/
var AzureIdentityCredentialAdapter = /** @class */ (function () {
function AzureIdentityCredentialAdapter(azureTokenCredential, scopes) {
if (scopes === void 0) { scopes = "https://management.azure.com/.default"; }
this.azureTokenCredential = azureTokenCredential;
this.scopes = scopes;
}
AzureIdentityCredentialAdapter.prototype.getToken = function () {
return __awaiter(this, void 0, void 0, function () {
var accessToken, result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.azureTokenCredential.getToken(this.scopes)];
case 1:
accessToken = _a.sent();
if (accessToken !== null) {
result = {
accessToken: accessToken.token,
tokenType: DEFAULT_AUTHORIZATION_SCHEME,
expiresOn: accessToken.expiresOnTimestamp,
};
return [2 /*return*/, result];
}
else {
throw new Error("Could find token for scope");
}
return [2 /*return*/];
}
});
});
};
AzureIdentityCredentialAdapter.prototype.signRequest = function (webResource) {
return __awaiter(this, void 0, void 0, function () {
var tokenResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.getToken()];
case 1:
tokenResponse = _a.sent();
webResource.headers.set(MSRestConstants.HeaderConstants.AUTHORIZATION, tokenResponse.tokenType + " " + tokenResponse.accessToken);
return [2 /*return*/, Promise.resolve(webResource)];
}
});
});
};
return AzureIdentityCredentialAdapter;
}());
export { AzureIdentityCredentialAdapter };
//# sourceMappingURL=azureIdentityTokenCredentialAdapter.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"azureIdentityTokenCredential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AAW,CAAC,EAAC;;;;KACrC;IACH,qCAAC;AAAD,CAAC,AAjCD,IAiCC"}

View file

@ -0,0 +1,24 @@
import { WebResourceLike } from "../webResource";
import { ServiceClientCredentials } from "./serviceClientCredentials";
export declare class BasicAuthenticationCredentials implements ServiceClientCredentials {
userName: string;
password: string;
authorizationScheme: string;
/**
* Creates a new BasicAuthenticationCredentials object.
*
* @constructor
* @param {string} userName User name.
* @param {string} password Password.
* @param {string} [authorizationScheme] The authorization scheme.
*/
constructor(userName: string, password: string, authorizationScheme?: string);
/**
* Signs a request with the Authentication header.
*
* @param {WebResourceLike} webResource The WebResourceLike to be signed.
* @returns {Promise<WebResourceLike>} The signed request object.
*/
signRequest(webResource: WebResourceLike): Promise<WebResourceLike>;
}
//# sourceMappingURL=basicAuthenticationCredentials.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"basicAuthenticationCredentials.d.ts","sourceRoot":"","sources":["../../../lib/credentials/basicAuthenticationCredentials.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAItE,qBAAa,8BAA+B,YAAW,wBAAwB;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAgC;IAE3D;;;;;;;OAOG;gBAED,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,mBAAmB,GAAE,MAAqC;IAa5D;;;;;OAKG;IACH,WAAW,CAAC,WAAW,EAAE,eAAe;CAOzC"}

View file

@ -0,0 +1,47 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { HttpHeaders } from "../httpHeaders";
import * as base64 from "../util/base64";
import { Constants } from "../util/constants";
var HeaderConstants = Constants.HeaderConstants;
var DEFAULT_AUTHORIZATION_SCHEME = "Basic";
var BasicAuthenticationCredentials = /** @class */ (function () {
/**
* Creates a new BasicAuthenticationCredentials object.
*
* @constructor
* @param {string} userName User name.
* @param {string} password Password.
* @param {string} [authorizationScheme] The authorization scheme.
*/
function BasicAuthenticationCredentials(userName, password, authorizationScheme) {
if (authorizationScheme === void 0) { authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; }
this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME;
if (userName === null || userName === undefined || typeof userName.valueOf() !== "string") {
throw new Error("userName cannot be null or undefined and must be of type string.");
}
if (password === null || password === undefined || typeof password.valueOf() !== "string") {
throw new Error("password cannot be null or undefined and must be of type string.");
}
this.userName = userName;
this.password = password;
this.authorizationScheme = authorizationScheme;
}
/**
* Signs a request with the Authentication header.
*
* @param {WebResourceLike} webResource The WebResourceLike to be signed.
* @returns {Promise<WebResourceLike>} The signed request object.
*/
BasicAuthenticationCredentials.prototype.signRequest = function (webResource) {
var credentials = this.userName + ":" + this.password;
var encodedCredentials = this.authorizationScheme + " " + base64.encodeString(credentials);
if (!webResource.headers)
webResource.headers = new HttpHeaders();
webResource.headers.set(HeaderConstants.AUTHORIZATION, encodedCredentials);
return Promise.resolve(webResource);
};
return BasicAuthenticationCredentials;
}());
export { BasicAuthenticationCredentials };
//# sourceMappingURL=basicAuthenticationCredentials.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"basicAuthenticationCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/basicAuthenticationCredentials.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,IAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;AAClD,IAAM,4BAA4B,GAAG,OAAO,CAAC;AAE7C;IAKE;;;;;;;OAOG;IACH,wCACE,QAAgB,EAChB,QAAgB,EAChB,mBAA0D;QAA1D,oCAAA,EAAA,kDAA0D;QAb5D,wBAAmB,GAAW,4BAA4B,CAAC;QAezD,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,QAAQ,EAAE;YACzF,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;SACrF;QACD,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,QAAQ,EAAE;YACzF,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;SACrF;QACD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACH,oDAAW,GAAX,UAAY,WAA4B;QACtC,IAAM,WAAW,GAAM,IAAI,CAAC,QAAQ,SAAI,IAAI,CAAC,QAAU,CAAC;QACxD,IAAM,kBAAkB,GAAM,IAAI,CAAC,mBAAmB,SAAI,MAAM,CAAC,YAAY,CAAC,WAAW,CAAG,CAAC;QAC7F,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE,WAAW,CAAC,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClE,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;QAC3E,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IACH,qCAAC;AAAD,CAAC,AA1CD,IA0CC"}

View file

@ -0,0 +1,2 @@
export declare type Authenticator = (challenge: object) => Promise<string>;
//# sourceMappingURL=credentials.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../lib/credentials/credentials.ts"],"names":[],"mappings":"AAGA,oBAAY,aAAa,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC"}

View file

@ -0,0 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//# sourceMappingURL=credentials.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../lib/credentials/credentials.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}

View file

@ -0,0 +1,11 @@
import { ApiKeyCredentials } from "./apiKeyCredentials";
export declare class DomainCredentials extends ApiKeyCredentials {
/**
* Creates a new EventGrid DomainCredentials object.
*
* @constructor
* @param {string} domainKey The EventGrid domain key
*/
constructor(domainKey: string);
}
//# sourceMappingURL=domainCredentials.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"domainCredentials.d.ts","sourceRoot":"","sources":["../../../lib/credentials/domainCredentials.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAEjF,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD;;;;;OAKG;gBACS,SAAS,EAAE,MAAM;CAW9B"}

View file

@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __extends } from "tslib";
import { ApiKeyCredentials } from "./apiKeyCredentials";
var DomainCredentials = /** @class */ (function (_super) {
__extends(DomainCredentials, _super);
/**
* Creates a new EventGrid DomainCredentials object.
*
* @constructor
* @param {string} domainKey The EventGrid domain key
*/
function DomainCredentials(domainKey) {
var _this = this;
if (!domainKey || (domainKey && typeof domainKey !== "string")) {
throw new Error("domainKey cannot be null or undefined and must be of type string.");
}
var options = {
inHeader: {
"aeg-sas-key": domainKey,
},
};
_this = _super.call(this, options) || this;
return _this;
}
return DomainCredentials;
}(ApiKeyCredentials));
export { DomainCredentials };
//# sourceMappingURL=domainCredentials.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"domainCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/domainCredentials.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAEjF;IAAuC,qCAAiB;IACtD;;;;;OAKG;IACH,2BAAY,SAAiB;QAA7B,iBAUC;QATC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,CAAC,EAAE;YAC9D,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;SACtF;QACD,IAAM,OAAO,GAA4B;YACvC,QAAQ,EAAE;gBACR,aAAa,EAAE,SAAS;aACzB;SACF,CAAC;QACF,QAAA,kBAAM,OAAO,CAAC,SAAC;;IACjB,CAAC;IACH,wBAAC;AAAD,CAAC,AAlBD,CAAuC,iBAAiB,GAkBvD"}

View file

@ -0,0 +1,11 @@
import { WebResourceLike } from "../webResource";
export interface ServiceClientCredentials {
/**
* Signs a request with the Authentication header.
*
* @param {WebResourceLike} webResource The WebResourceLike/request to be signed.
* @returns {Promise<WebResourceLike>} The signed request object;
*/
signRequest(webResource: WebResourceLike): Promise<WebResourceLike>;
}
//# sourceMappingURL=serviceClientCredentials.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"serviceClientCredentials.d.ts","sourceRoot":"","sources":["../../../lib/credentials/serviceClientCredentials.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACrE"}

View file

@ -0,0 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//# sourceMappingURL=serviceClientCredentials.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"serviceClientCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/serviceClientCredentials.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}

View file

@ -0,0 +1,25 @@
import { WebResourceLike } from "../webResource";
import { ServiceClientCredentials } from "./serviceClientCredentials";
/**
* A credentials object that uses a token string and a authorzation scheme to authenticate.
*/
export declare class TokenCredentials implements ServiceClientCredentials {
token: string;
authorizationScheme: string;
/**
* Creates a new TokenCredentials object.
*
* @constructor
* @param {string} token The token.
* @param {string} [authorizationScheme] The authorization scheme.
*/
constructor(token: string, authorizationScheme?: string);
/**
* Signs a request with the Authentication header.
*
* @param {WebResourceLike} webResource The WebResourceLike to be signed.
* @return {Promise<WebResourceLike>} The signed request object.
*/
signRequest(webResource: WebResourceLike): Promise<WebResourceLike>;
}
//# sourceMappingURL=tokenCredentials.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"tokenCredentials.d.ts","sourceRoot":"","sources":["../../../lib/credentials/tokenCredentials.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAKtE;;GAEG;AACH,qBAAa,gBAAiB,YAAW,wBAAwB;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,MAAM,CAAgC;IAE3D;;;;;;OAMG;gBACS,KAAK,EAAE,MAAM,EAAE,mBAAmB,GAAE,MAAqC;IAQrF;;;;;OAKG;IACH,WAAW,CAAC,WAAW,EAAE,eAAe;CAQzC"}

View file

@ -0,0 +1,42 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { HttpHeaders } from "../httpHeaders";
import { Constants } from "../util/constants";
var HeaderConstants = Constants.HeaderConstants;
var DEFAULT_AUTHORIZATION_SCHEME = "Bearer";
/**
* A credentials object that uses a token string and a authorzation scheme to authenticate.
*/
var TokenCredentials = /** @class */ (function () {
/**
* Creates a new TokenCredentials object.
*
* @constructor
* @param {string} token The token.
* @param {string} [authorizationScheme] The authorization scheme.
*/
function TokenCredentials(token, authorizationScheme) {
if (authorizationScheme === void 0) { authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; }
this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME;
if (!token) {
throw new Error("token cannot be null or undefined.");
}
this.token = token;
this.authorizationScheme = authorizationScheme;
}
/**
* Signs a request with the Authentication header.
*
* @param {WebResourceLike} webResource The WebResourceLike to be signed.
* @return {Promise<WebResourceLike>} The signed request object.
*/
TokenCredentials.prototype.signRequest = function (webResource) {
if (!webResource.headers)
webResource.headers = new HttpHeaders();
webResource.headers.set(HeaderConstants.AUTHORIZATION, this.authorizationScheme + " " + this.token);
return Promise.resolve(webResource);
};
return TokenCredentials;
}());
export { TokenCredentials };
//# sourceMappingURL=tokenCredentials.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"tokenCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/tokenCredentials.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,IAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;AAClD,IAAM,4BAA4B,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH;IAIE;;;;;;OAMG;IACH,0BAAY,KAAa,EAAE,mBAA0D;QAA1D,oCAAA,EAAA,kDAA0D;QATrF,wBAAmB,GAAW,4BAA4B,CAAC;QAUzD,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;SACvD;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACH,sCAAW,GAAX,UAAY,WAA4B;QACtC,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE,WAAW,CAAC,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClE,WAAW,CAAC,OAAO,CAAC,GAAG,CACrB,eAAe,CAAC,aAAa,EAC1B,IAAI,CAAC,mBAAmB,SAAI,IAAI,CAAC,KAAO,CAC5C,CAAC;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IACH,uBAAC;AAAD,CAAC,AAjCD,IAiCC"}

View file

@ -0,0 +1,10 @@
/**
* TokenResponse is defined in `@azure/ms-rest-nodeauth` and is copied here to not
* add an unnecessary dependency.
*/
export interface TokenResponse {
readonly tokenType: string;
readonly accessToken: string;
readonly [x: string]: any;
}
//# sourceMappingURL=tokenResponse.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"tokenResponse.d.ts","sourceRoot":"","sources":["../../../lib/credentials/tokenResponse.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAC3B"}

View file

@ -0,0 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//# sourceMappingURL=tokenResponse.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"tokenResponse.js","sourceRoot":"","sources":["../../../lib/credentials/tokenResponse.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}

View file

@ -0,0 +1,11 @@
import { ApiKeyCredentials } from "./apiKeyCredentials";
export declare class TopicCredentials extends ApiKeyCredentials {
/**
* Creates a new EventGrid TopicCredentials object.
*
* @constructor
* @param {string} topicKey The EventGrid topic key
*/
constructor(topicKey: string);
}
//# sourceMappingURL=topicCredentials.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"topicCredentials.d.ts","sourceRoot":"","sources":["../../../lib/credentials/topicCredentials.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAEjF,qBAAa,gBAAiB,SAAQ,iBAAiB;IACrD;;;;;OAKG;gBACS,QAAQ,EAAE,MAAM;CAW7B"}

View file

@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __extends } from "tslib";
import { ApiKeyCredentials } from "./apiKeyCredentials";
var TopicCredentials = /** @class */ (function (_super) {
__extends(TopicCredentials, _super);
/**
* Creates a new EventGrid TopicCredentials object.
*
* @constructor
* @param {string} topicKey The EventGrid topic key
*/
function TopicCredentials(topicKey) {
var _this = this;
if (!topicKey || (topicKey && typeof topicKey !== "string")) {
throw new Error("topicKey cannot be null or undefined and must be of type string.");
}
var options = {
inHeader: {
"aeg-sas-key": topicKey,
},
};
_this = _super.call(this, options) || this;
return _this;
}
return TopicCredentials;
}(ApiKeyCredentials));
export { TopicCredentials };
//# sourceMappingURL=topicCredentials.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"topicCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/topicCredentials.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAEjF;IAAsC,oCAAiB;IACrD;;;;;OAKG;IACH,0BAAY,QAAgB;QAA5B,iBAUC;QATC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,EAAE;YAC3D,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;SACrF;QACD,IAAM,OAAO,GAA4B;YACvC,QAAQ,EAAE;gBACR,aAAa,EAAE,QAAQ;aACxB;SACF,CAAC;QACF,QAAA,kBAAM,OAAO,CAAC,SAAC;;IACjB,CAAC;IACH,uBAAC;AAAD,CAAC,AAlBD,CAAsC,iBAAiB,GAkBtD"}

View file

@ -0,0 +1,2 @@
export { XhrHttpClient as DefaultHttpClient } from "./xhrHttpClient";
//# sourceMappingURL=defaultHttpClient.browser.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"defaultHttpClient.browser.d.ts","sourceRoot":"","sources":["../../lib/defaultHttpClient.browser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}

View file

@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
export { XhrHttpClient as DefaultHttpClient } from "./xhrHttpClient";
//# sourceMappingURL=defaultHttpClient.browser.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"defaultHttpClient.browser.js","sourceRoot":"","sources":["../../lib/defaultHttpClient.browser.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}

View file

@ -0,0 +1,2 @@
export { NodeFetchHttpClient as DefaultHttpClient } from "./nodeFetchHttpClient";
//# sourceMappingURL=defaultHttpClient.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"defaultHttpClient.d.ts","sourceRoot":"","sources":["../../lib/defaultHttpClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}

View file

@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
export { NodeFetchHttpClient as DefaultHttpClient } from "./nodeFetchHttpClient";
//# sourceMappingURL=defaultHttpClient.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"defaultHttpClient.js","sourceRoot":"","sources":["../../lib/defaultHttpClient.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,OAAO,EAAE,mBAAmB,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}

View file

@ -0,0 +1,23 @@
import { HttpClient } from "./httpClient";
import { WebResourceLike } from "./webResource";
import { HttpOperationResponse } from "./httpOperationResponse";
import { HttpHeadersLike } from "./httpHeaders";
export declare type CommonRequestInfo = string;
export declare type CommonRequestInit = Omit<RequestInit, "body" | "headers" | "signal"> & {
body?: any;
headers?: any;
signal?: any;
};
export declare type CommonResponse = Omit<Response, "body" | "trailer" | "formData"> & {
body: any;
trailer: any;
formData: any;
};
export declare abstract class FetchHttpClient implements HttpClient {
sendRequest(httpRequest: WebResourceLike): Promise<HttpOperationResponse>;
abstract prepareRequest(httpRequest: WebResourceLike): Promise<Partial<RequestInit>>;
abstract processRequest(operationResponse: HttpOperationResponse): Promise<void>;
abstract fetch(input: CommonRequestInfo, init?: CommonRequestInit): Promise<CommonResponse>;
}
export declare function parseHeaders(headers: Headers): HttpHeadersLike;
//# sourceMappingURL=fetchHttpClient.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"fetchHttpClient.d.ts","sourceRoot":"","sources":["../../lib/fetchHttpClient.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAU7D,oBAAY,iBAAiB,GAAG,MAAM,CAAC;AAEvC,oBAAY,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG;IACjF,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,oBAAY,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,GAAG;IAC7E,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,8BAAsB,eAAgB,YAAW,UAAU;IACnD,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;aAoMhE,cAAc,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;aAC3E,cAAc,CAAC,iBAAiB,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;aACvE,KAAK,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;CAClG;AAcD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,CAQ9D"}

View file

@ -0,0 +1,214 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __assign, __awaiter, __generator } from "tslib";
import AbortController from "abort-controller";
import FormData from "form-data";
import { HttpHeaders } from "./httpHeaders";
import { RestError } from "./restError";
import { Transform } from "stream";
var FetchHttpClient = /** @class */ (function () {
function FetchHttpClient() {
}
FetchHttpClient.prototype.sendRequest = function (httpRequest) {
return __awaiter(this, void 0, void 0, function () {
var abortController, abortListener, formData, requestForm_1, appendFormValue, _i, _a, formKey, formValue, j, contentType, body, loadedBytes_1, uploadReportStream, platformSpecificRequestInit, requestInit, operationResponse, response, headers, _b, _c, onDownloadProgress_1, responseBody, loadedBytes_2, downloadReportStream, length_1, error_1, fetchError, uploadStreamDone, downloadStreamDone;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
if (!httpRequest && typeof httpRequest !== "object") {
throw new Error("'httpRequest' (WebResource) cannot be null or undefined and must be of type object.");
}
abortController = new AbortController();
if (httpRequest.abortSignal) {
if (httpRequest.abortSignal.aborted) {
throw new RestError("The request was aborted", RestError.REQUEST_ABORTED_ERROR, undefined, httpRequest);
}
abortListener = function (event) {
if (event.type === "abort") {
abortController.abort();
}
};
httpRequest.abortSignal.addEventListener("abort", abortListener);
}
if (httpRequest.timeout) {
setTimeout(function () {
abortController.abort();
}, httpRequest.timeout);
}
if (httpRequest.formData) {
formData = httpRequest.formData;
requestForm_1 = new FormData();
appendFormValue = function (key, value) {
// value function probably returns a stream so we can provide a fresh stream on each retry
if (typeof value === "function") {
value = value();
}
if (value && value.hasOwnProperty("value") && value.hasOwnProperty("options")) {
requestForm_1.append(key, value.value, value.options);
}
else {
requestForm_1.append(key, value);
}
};
for (_i = 0, _a = Object.keys(formData); _i < _a.length; _i++) {
formKey = _a[_i];
formValue = formData[formKey];
if (Array.isArray(formValue)) {
for (j = 0; j < formValue.length; j++) {
appendFormValue(formKey, formValue[j]);
}
}
else {
appendFormValue(formKey, formValue);
}
}
httpRequest.body = requestForm_1;
httpRequest.formData = undefined;
contentType = httpRequest.headers.get("Content-Type");
if (contentType && contentType.indexOf("multipart/form-data") !== -1) {
if (typeof requestForm_1.getBoundary === "function") {
httpRequest.headers.set("Content-Type", "multipart/form-data; boundary=" + requestForm_1.getBoundary());
}
else {
// browser will automatically apply a suitable content-type header
httpRequest.headers.remove("Content-Type");
}
}
}
body = httpRequest.body
? typeof httpRequest.body === "function"
? httpRequest.body()
: httpRequest.body
: undefined;
if (httpRequest.onUploadProgress && httpRequest.body) {
loadedBytes_1 = 0;
uploadReportStream = new Transform({
transform: function (chunk, _encoding, callback) {
loadedBytes_1 += chunk.length;
httpRequest.onUploadProgress({ loadedBytes: loadedBytes_1 });
callback(undefined, chunk);
},
});
if (isReadableStream(body)) {
body.pipe(uploadReportStream);
}
else {
uploadReportStream.end(body);
}
body = uploadReportStream;
}
return [4 /*yield*/, this.prepareRequest(httpRequest)];
case 1:
platformSpecificRequestInit = _d.sent();
requestInit = __assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController.signal, redirect: "manual" }, platformSpecificRequestInit);
_d.label = 2;
case 2:
_d.trys.push([2, 8, 9, 10]);
return [4 /*yield*/, this.fetch(httpRequest.url, requestInit)];
case 3:
response = _d.sent();
headers = parseHeaders(response.headers);
_b = {
headers: headers,
request: httpRequest,
status: response.status,
readableStreamBody: httpRequest.streamResponseBody
? response.body
: undefined
};
if (!!httpRequest.streamResponseBody) return [3 /*break*/, 5];
return [4 /*yield*/, response.text()];
case 4:
_c = _d.sent();
return [3 /*break*/, 6];
case 5:
_c = undefined;
_d.label = 6;
case 6:
operationResponse = (_b.bodyAsText = _c,
_b.redirected = response.redirected,
_b.url = response.url,
_b);
onDownloadProgress_1 = httpRequest.onDownloadProgress;
if (onDownloadProgress_1) {
responseBody = response.body || undefined;
if (isReadableStream(responseBody)) {
loadedBytes_2 = 0;
downloadReportStream = new Transform({
transform: function (chunk, _encoding, callback) {
loadedBytes_2 += chunk.length;
onDownloadProgress_1({ loadedBytes: loadedBytes_2 });
callback(undefined, chunk);
},
});
responseBody.pipe(downloadReportStream);
operationResponse.readableStreamBody = downloadReportStream;
}
else {
length_1 = parseInt(headers.get("Content-Length")) || undefined;
if (length_1) {
// Calling callback for non-stream response for consistency with browser
onDownloadProgress_1({ loadedBytes: length_1 });
}
}
}
return [4 /*yield*/, this.processRequest(operationResponse)];
case 7:
_d.sent();
return [2 /*return*/, operationResponse];
case 8:
error_1 = _d.sent();
fetchError = error_1;
if (fetchError.code === "ENOTFOUND") {
throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest);
}
else if (fetchError.type === "aborted") {
throw new RestError("The request was aborted", RestError.REQUEST_ABORTED_ERROR, undefined, httpRequest);
}
throw fetchError;
case 9:
// clean up event listener
if (httpRequest.abortSignal && abortListener) {
uploadStreamDone = Promise.resolve();
if (isReadableStream(body)) {
uploadStreamDone = isStreamComplete(body);
}
downloadStreamDone = Promise.resolve();
if (isReadableStream(operationResponse === null || operationResponse === void 0 ? void 0 : operationResponse.readableStreamBody)) {
downloadStreamDone = isStreamComplete(operationResponse.readableStreamBody);
}
Promise.all([uploadStreamDone, downloadStreamDone])
.then(function () {
var _a;
(_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener("abort", abortListener);
return;
})
.catch(function (_e) { });
}
return [7 /*endfinally*/];
case 10: return [2 /*return*/];
}
});
});
};
return FetchHttpClient;
}());
export { FetchHttpClient };
function isReadableStream(body) {
return body && typeof body.pipe === "function";
}
function isStreamComplete(stream) {
return new Promise(function (resolve) {
stream.on("close", resolve);
stream.on("end", resolve);
stream.on("error", resolve);
});
}
export function parseHeaders(headers) {
var httpHeaders = new HttpHeaders();
headers.forEach(function (value, key) {
httpHeaders.set(key, value);
});
return httpHeaders;
}
//# sourceMappingURL=fetchHttpClient.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
import { RequestPolicy } from "./policies/requestPolicy";
/**
* An interface that can send HttpRequests and receive promised HttpResponses.
*/
export interface HttpClient extends RequestPolicy {
}
//# sourceMappingURL=httpClient.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpClient.d.ts","sourceRoot":"","sources":["../../lib/httpClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,aAAa;CAAG"}

3
node_modules/@azure/ms-rest-js/es/lib/httpClient.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//# sourceMappingURL=httpClient.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpClient.js","sourceRoot":"","sources":["../../lib/httpClient.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}

132
node_modules/@azure/ms-rest-js/es/lib/httpHeaders.d.ts generated vendored Normal file
View file

@ -0,0 +1,132 @@
/**
* An individual header within a HttpHeaders collection.
*/
export interface HttpHeader {
/**
* The name of the header.
*/
name: string;
/**
* The value of the header.
*/
value: string;
}
/**
* A HttpHeaders collection represented as a simple JSON object.
*/
export declare type RawHttpHeaders = {
[headerName: string]: string;
};
/**
* A collection of HTTP header key/value pairs.
*/
export interface HttpHeadersLike {
/**
* Set a header in this collection with the provided name and value. The name is
* case-insensitive.
* @param headerName The name of the header to set. This value is case-insensitive.
* @param headerValue The value of the header to set.
*/
set(headerName: string, headerValue: string | number): void;
/**
* Get the header value for the provided header name, or undefined if no header exists in this
* collection with the provided name.
* @param headerName The name of the header.
*/
get(headerName: string): string | undefined;
/**
* Get whether or not this header collection contains a header entry for the provided header name.
*/
contains(headerName: string): boolean;
/**
* Remove the header with the provided headerName. Return whether or not the header existed and
* was removed.
* @param headerName The name of the header to remove.
*/
remove(headerName: string): boolean;
/**
* Get the headers that are contained this collection as an object.
*/
rawHeaders(): RawHttpHeaders;
/**
* Get the headers that are contained in this collection as an array.
*/
headersArray(): HttpHeader[];
/**
* Get the header names that are contained in this collection.
*/
headerNames(): string[];
/**
* Get the header values that are contained in this collection.
*/
headerValues(): string[];
/**
* Create a deep clone/copy of this HttpHeaders collection.
*/
clone(): HttpHeadersLike;
/**
* Get the JSON object representation of this HTTP header collection.
* The result is the same as `rawHeaders()`.
*/
toJson(): RawHttpHeaders;
}
export declare function isHttpHeadersLike(object?: any): object is HttpHeadersLike;
/**
* A collection of HTTP header key/value pairs.
*/
export declare class HttpHeaders {
private readonly _headersMap;
constructor(rawHeaders?: RawHttpHeaders);
/**
* Set a header in this collection with the provided name and value. The name is
* case-insensitive.
* @param headerName The name of the header to set. This value is case-insensitive.
* @param headerValue The value of the header to set.
*/
set(headerName: string, headerValue: string | number): void;
/**
* Get the header value for the provided header name, or undefined if no header exists in this
* collection with the provided name.
* @param headerName The name of the header.
*/
get(headerName: string): string | undefined;
/**
* Get whether or not this header collection contains a header entry for the provided header name.
*/
contains(headerName: string): boolean;
/**
* Remove the header with the provided headerName. Return whether or not the header existed and
* was removed.
* @param headerName The name of the header to remove.
*/
remove(headerName: string): boolean;
/**
* Get the headers that are contained this collection as an object.
*/
rawHeaders(): RawHttpHeaders;
/**
* Get the headers that are contained in this collection as an array.
*/
headersArray(): HttpHeader[];
/**
* Get the header names that are contained in this collection.
*/
headerNames(): string[];
/**
* Get the header names that are contained in this collection.
*/
headerValues(): string[];
/**
* Get the JSON object representation of this HTTP header collection.
*/
toJson(): RawHttpHeaders;
/**
* Get the string representation of this HTTP header collection.
*/
toString(): string;
/**
* Create a deep clone/copy of this HttpHeaders collection.
*/
clone(): HttpHeaders;
}
//# sourceMappingURL=httpHeaders.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpHeaders.d.ts","sourceRoot":"","sources":["../../lib/httpHeaders.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,oBAAY,cAAc,GAAG;IAAE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5D;;;;OAIG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,UAAU,IAAI,cAAc,CAAC;IAC7B;;OAEG;IACH,YAAY,IAAI,UAAU,EAAE,CAAC;IAC7B;;OAEG;IACH,WAAW,IAAI,MAAM,EAAE,CAAC;IACxB;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,KAAK,IAAI,eAAe,CAAC;IACzB;;;OAGG;IACH,MAAM,IAAI,cAAc,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,MAAM,IAAI,eAAe,CAoBzE;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;gBAEtD,UAAU,CAAC,EAAE,cAAc;IASvC;;;;;OAKG;IACI,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAOlE;;;;OAIG;IACI,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKlD;;OAEG;IACI,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAI5C;;;;OAIG;IACI,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAM1C;;OAEG;IACI,UAAU,IAAI,cAAc;IASnC;;OAEG;IACI,YAAY,IAAI,UAAU,EAAE;IAQnC;;OAEG;IACI,WAAW,IAAI,MAAM,EAAE;IAS9B;;OAEG;IACI,YAAY,IAAI,MAAM,EAAE;IAS/B;;OAEG;IACI,MAAM,IAAI,cAAc;IAI/B;;OAEG;IACI,QAAQ,IAAI,MAAM;IAIzB;;OAEG;IACI,KAAK,IAAI,WAAW;CAG5B"}

140
node_modules/@azure/ms-rest-js/es/lib/httpHeaders.js generated vendored Normal file
View file

@ -0,0 +1,140 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
/**
* A collection of HttpHeaders that can be sent with a HTTP request.
*/
function getHeaderKey(headerName) {
return headerName.toLowerCase();
}
export function isHttpHeadersLike(object) {
if (!object || typeof object !== "object") {
return false;
}
if (typeof object.rawHeaders === "function" &&
typeof object.clone === "function" &&
typeof object.get === "function" &&
typeof object.set === "function" &&
typeof object.contains === "function" &&
typeof object.remove === "function" &&
typeof object.headersArray === "function" &&
typeof object.headerValues === "function" &&
typeof object.headerNames === "function" &&
typeof object.toJson === "function") {
return true;
}
return false;
}
/**
* A collection of HTTP header key/value pairs.
*/
var HttpHeaders = /** @class */ (function () {
function HttpHeaders(rawHeaders) {
this._headersMap = {};
if (rawHeaders) {
for (var headerName in rawHeaders) {
this.set(headerName, rawHeaders[headerName]);
}
}
}
/**
* Set a header in this collection with the provided name and value. The name is
* case-insensitive.
* @param headerName The name of the header to set. This value is case-insensitive.
* @param headerValue The value of the header to set.
*/
HttpHeaders.prototype.set = function (headerName, headerValue) {
this._headersMap[getHeaderKey(headerName)] = {
name: headerName,
value: headerValue.toString(),
};
};
/**
* Get the header value for the provided header name, or undefined if no header exists in this
* collection with the provided name.
* @param headerName The name of the header.
*/
HttpHeaders.prototype.get = function (headerName) {
var header = this._headersMap[getHeaderKey(headerName)];
return !header ? undefined : header.value;
};
/**
* Get whether or not this header collection contains a header entry for the provided header name.
*/
HttpHeaders.prototype.contains = function (headerName) {
return !!this._headersMap[getHeaderKey(headerName)];
};
/**
* Remove the header with the provided headerName. Return whether or not the header existed and
* was removed.
* @param headerName The name of the header to remove.
*/
HttpHeaders.prototype.remove = function (headerName) {
var result = this.contains(headerName);
delete this._headersMap[getHeaderKey(headerName)];
return result;
};
/**
* Get the headers that are contained this collection as an object.
*/
HttpHeaders.prototype.rawHeaders = function () {
var result = {};
for (var headerKey in this._headersMap) {
var header = this._headersMap[headerKey];
result[header.name.toLowerCase()] = header.value;
}
return result;
};
/**
* Get the headers that are contained in this collection as an array.
*/
HttpHeaders.prototype.headersArray = function () {
var headers = [];
for (var headerKey in this._headersMap) {
headers.push(this._headersMap[headerKey]);
}
return headers;
};
/**
* Get the header names that are contained in this collection.
*/
HttpHeaders.prototype.headerNames = function () {
var headerNames = [];
var headers = this.headersArray();
for (var i = 0; i < headers.length; ++i) {
headerNames.push(headers[i].name);
}
return headerNames;
};
/**
* Get the header names that are contained in this collection.
*/
HttpHeaders.prototype.headerValues = function () {
var headerValues = [];
var headers = this.headersArray();
for (var i = 0; i < headers.length; ++i) {
headerValues.push(headers[i].value);
}
return headerValues;
};
/**
* Get the JSON object representation of this HTTP header collection.
*/
HttpHeaders.prototype.toJson = function () {
return this.rawHeaders();
};
/**
* Get the string representation of this HTTP header collection.
*/
HttpHeaders.prototype.toString = function () {
return JSON.stringify(this.toJson());
};
/**
* Create a deep clone/copy of this HttpHeaders collection.
*/
HttpHeaders.prototype.clone = function () {
return new HttpHeaders(this.rawHeaders());
};
return HttpHeaders;
}());
export { HttpHeaders };
//# sourceMappingURL=httpHeaders.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpHeaders.js","sourceRoot":"","sources":["../../lib/httpHeaders.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F;;GAEG;AACH,SAAS,YAAY,CAAC,UAAkB;IACtC,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AA4ED,MAAM,UAAU,iBAAiB,CAAC,MAAY;IAC5C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACzC,OAAO,KAAK,CAAC;KACd;IAED,IACE,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;QACvC,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU;QAClC,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU;QAChC,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU;QAChC,OAAO,MAAM,CAAC,QAAQ,KAAK,UAAU;QACrC,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU;QACnC,OAAO,MAAM,CAAC,YAAY,KAAK,UAAU;QACzC,OAAO,MAAM,CAAC,YAAY,KAAK,UAAU;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IACI,4BAAM,GAAb;QACE,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,8BAAQ,GAAf;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,2BAAK,GAAZ;QACE,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAC5C,CAAC;IACH,kBAAC;AAAD,CAAC,AAxHD,IAwHC"}

View file

@ -0,0 +1,83 @@
/// <reference types="node" />
import { WebResourceLike } from "./webResource";
import { HttpHeadersLike } from "./httpHeaders";
/**
* The properties on an HTTP response which will always be present.
*/
export interface HttpResponse {
/**
* The raw request
*/
request: WebResourceLike;
/**
* The HTTP response status (e.g. 200)
*/
status: number;
/**
* The HTTP response headers.
*/
headers: HttpHeadersLike;
}
declare global {
/**
* Stub declaration of the browser-only Blob type.
* Full type information can be obtained by including "lib": ["dom"] in tsconfig.json.
*/
interface Blob {
}
}
/**
* Wrapper object for http request and response. Deserialized object is stored in
* the `parsedBody` property when the response body is received in JSON or XML.
*/
export interface HttpOperationResponse extends HttpResponse {
/**
* The parsed HTTP response headers.
*/
parsedHeaders?: {
[key: string]: any;
};
/**
* The response body as text (string format)
*/
bodyAsText?: string | null;
/**
* The response body as parsed JSON or XML
*/
parsedBody?: any;
/**
* BROWSER ONLY
*
* The response body as a browser Blob.
* Always undefined in node.js.
*/
blobBody?: Promise<Blob>;
/**
* NODEJS ONLY
*
* The response body as a node.js Readable stream.
* Always undefined in the browser.
*/
readableStreamBody?: NodeJS.ReadableStream;
/**
* The redirected property indicates whether the response is the result of a request which was redirected.
*/
redirected?: boolean;
/**
* The url property contains the URL of the response. The value will be the final URL obtained after any redirects.
*/
url?: string;
}
/**
* The flattened response to a REST call.
* Contains the underlying HttpOperationResponse as well as
* the merged properties of the parsedBody, parsedHeaders, etc.
*/
export interface RestResponse {
/**
* The underlying HTTP response containing both raw and deserialized response data.
*/
_response: HttpOperationResponse;
[key: string]: any;
}
//# sourceMappingURL=httpOperationResponse.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpOperationResponse.d.ts","sourceRoot":"","sources":["../../lib/httpOperationResponse.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;IAEzB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,OAAO,CAAC,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,IAAI;KAAG;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD;;OAEG;IACH,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAEvC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAE3C;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,EAAE,qBAAqB,CAAC;IAEjC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}

View file

@ -0,0 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//# sourceMappingURL=httpOperationResponse.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpOperationResponse.js","sourceRoot":"","sources":["../../lib/httpOperationResponse.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}

View file

@ -0,0 +1,22 @@
/**
* The different levels of logs that can be used with the HttpPipelineLogger.
*/
export declare enum HttpPipelineLogLevel {
/**
* A log level that indicates that no logs will be logged.
*/
OFF = 0,
/**
* An error log.
*/
ERROR = 1,
/**
* A warning log.
*/
WARNING = 2,
/**
* An information log.
*/
INFO = 3
}
//# sourceMappingURL=httpPipelineLogLevel.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpPipelineLogLevel.d.ts","sourceRoot":"","sources":["../../lib/httpPipelineLogLevel.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,oBAAoB;IAC9B;;OAEG;IACH,GAAG,IAAA;IAEH;;OAEG;IACH,KAAK,IAAA;IAEL;;OAEG;IACH,OAAO,IAAA;IAEP;;OAEG;IACH,IAAI,IAAA;CACL"}

View file

@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
/**
* The different levels of logs that can be used with the HttpPipelineLogger.
*/
export var HttpPipelineLogLevel;
(function (HttpPipelineLogLevel) {
/**
* A log level that indicates that no logs will be logged.
*/
HttpPipelineLogLevel[HttpPipelineLogLevel["OFF"] = 0] = "OFF";
/**
* An error log.
*/
HttpPipelineLogLevel[HttpPipelineLogLevel["ERROR"] = 1] = "ERROR";
/**
* A warning log.
*/
HttpPipelineLogLevel[HttpPipelineLogLevel["WARNING"] = 2] = "WARNING";
/**
* An information log.
*/
HttpPipelineLogLevel[HttpPipelineLogLevel["INFO"] = 3] = "INFO";
})(HttpPipelineLogLevel || (HttpPipelineLogLevel = {}));
//# sourceMappingURL=httpPipelineLogLevel.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpPipelineLogLevel.js","sourceRoot":"","sources":["../../lib/httpPipelineLogLevel.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F;;GAEG;AACH,MAAM,CAAN,IAAY,oBAoBX;AApBD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,6DAAG,CAAA;IAEH;;OAEG;IACH,iEAAK,CAAA;IAEL;;OAEG;IACH,qEAAO,CAAA;IAEP;;OAEG;IACH,+DAAI,CAAA;AACN,CAAC,EApBW,oBAAoB,KAApB,oBAAoB,QAoB/B"}

View file

@ -0,0 +1,35 @@
import { HttpPipelineLogLevel } from "./httpPipelineLogLevel";
/**
* A Logger that can be added to a HttpPipeline. This enables each RequestPolicy to log messages
* that can be used for debugging purposes.
*/
export interface HttpPipelineLogger {
/**
* The log level threshold for what logs will be logged.
*/
minimumLogLevel: HttpPipelineLogLevel;
/**
* Log the provided message.
* @param logLevel The HttpLogDetailLevel associated with this message.
* @param message The message to log.
*/
log(logLevel: HttpPipelineLogLevel, message: string): void;
}
/**
* A HttpPipelineLogger that will send its logs to the console.
*/
export declare class ConsoleHttpPipelineLogger implements HttpPipelineLogger {
minimumLogLevel: HttpPipelineLogLevel;
/**
* Create a new ConsoleHttpPipelineLogger.
* @param minimumLogLevel The log level threshold for what logs will be logged.
*/
constructor(minimumLogLevel: HttpPipelineLogLevel);
/**
* Log the provided message.
* @param logLevel The HttpLogDetailLevel associated with this message.
* @param message The message to log.
*/
log(logLevel: HttpPipelineLogLevel, message: string): void;
}
//# sourceMappingURL=httpPipelineLogger.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpPipelineLogger.d.ts","sourceRoot":"","sources":["../../lib/httpPipelineLogger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,eAAe,EAAE,oBAAoB,CAAC;IAEtC;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5D;AAED;;GAEG;AACH,qBAAa,yBAA0B,YAAW,kBAAkB;IAK/C,eAAe,EAAE,oBAAoB;IAJxD;;;OAGG;gBACgB,eAAe,EAAE,oBAAoB;IAExD;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;CAgB3D"}

View file

@ -0,0 +1,37 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { HttpPipelineLogLevel } from "./httpPipelineLogLevel";
/**
* A HttpPipelineLogger that will send its logs to the console.
*/
var ConsoleHttpPipelineLogger = /** @class */ (function () {
/**
* Create a new ConsoleHttpPipelineLogger.
* @param minimumLogLevel The log level threshold for what logs will be logged.
*/
function ConsoleHttpPipelineLogger(minimumLogLevel) {
this.minimumLogLevel = minimumLogLevel;
}
/**
* Log the provided message.
* @param logLevel The HttpLogDetailLevel associated with this message.
* @param message The message to log.
*/
ConsoleHttpPipelineLogger.prototype.log = function (logLevel, message) {
var logMessage = HttpPipelineLogLevel[logLevel] + ": " + message;
switch (logLevel) {
case HttpPipelineLogLevel.ERROR:
console.error(logMessage);
break;
case HttpPipelineLogLevel.WARNING:
console.warn(logMessage);
break;
case HttpPipelineLogLevel.INFO:
console.log(logMessage);
break;
}
};
return ConsoleHttpPipelineLogger;
}());
export { ConsoleHttpPipelineLogger };
//# sourceMappingURL=httpPipelineLogger.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"httpPipelineLogger.js","sourceRoot":"","sources":["../../lib/httpPipelineLogger.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAoB9D;;GAEG;AACH;IACE;;;OAGG;IACH,mCAAmB,eAAqC;QAArC,oBAAe,GAAf,eAAe,CAAsB;IAAG,CAAC;IAE5D;;;;OAIG;IACH,uCAAG,GAAH,UAAI,QAA8B,EAAE,OAAe;QACjD,IAAM,UAAU,GAAM,oBAAoB,CAAC,QAAQ,CAAC,UAAK,OAAS,CAAC;QACnE,QAAQ,QAAQ,EAAE;YAChB,KAAK,oBAAoB,CAAC,KAAK;gBAC7B,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;gBAC1B,MAAM;YAER,KAAK,oBAAoB,CAAC,OAAO;gBAC/B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACzB,MAAM;YAER,KAAK,oBAAoB,CAAC,IAAI;gBAC5B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBACxB,MAAM;SACT;IACH,CAAC;IACH,gCAAC;AAAD,CAAC,AA5BD,IA4BC"}

42
node_modules/@azure/ms-rest-js/es/lib/msRest.d.ts generated vendored Normal file
View file

@ -0,0 +1,42 @@
/// <reference path="../../dom-shim.d.ts" />
export { WebResource, WebResourceLike, HttpRequestBody, RequestPrepareOptions, HttpMethods, ParameterValue, RequestOptionsBase, TransferProgressEvent, AbortSignalLike, } from "./webResource";
export { DefaultHttpClient } from "./defaultHttpClient";
export { CommonRequestInfo, CommonRequestInit, CommonResponse } from "./fetchHttpClient";
export { HttpClient } from "./httpClient";
export { HttpHeader, HttpHeaders, HttpHeadersLike, RawHttpHeaders } from "./httpHeaders";
export { HttpOperationResponse, HttpResponse, RestResponse } from "./httpOperationResponse";
export { HttpPipelineLogger } from "./httpPipelineLogger";
export { HttpPipelineLogLevel } from "./httpPipelineLogLevel";
export { RestError } from "./restError";
export { OperationArguments } from "./operationArguments";
export { OperationParameter, OperationQueryParameter, OperationURLParameter, ParameterPath, } from "./operationParameter";
export { OperationResponse } from "./operationResponse";
export { OperationSpec } from "./operationSpec";
export { AgentSettings, ProxySettings, ServiceClient, ServiceClientOptions, flattenResponse, } from "./serviceClient";
export { QueryCollectionFormat } from "./queryCollectionFormat";
export { Constants } from "./util/constants";
export { logPolicy } from "./policies/logPolicy";
export { BaseRequestPolicy, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions, RequestPolicyOptionsLike, } from "./policies/requestPolicy";
export { generateClientRequestIdPolicy } from "./policies/generateClientRequestIdPolicy";
export { exponentialRetryPolicy } from "./policies/exponentialRetryPolicy";
export { systemErrorRetryPolicy } from "./policies/systemErrorRetryPolicy";
export { throttlingRetryPolicy } from "./policies/throttlingRetryPolicy";
export { agentPolicy } from "./policies/agentPolicy";
export { getDefaultProxySettings, proxyPolicy } from "./policies/proxyPolicy";
export { RedirectOptions, redirectPolicy } from "./policies/redirectPolicy";
export { signingPolicy } from "./policies/signingPolicy";
export { TelemetryInfo, userAgentPolicy, getDefaultUserAgentValue, } from "./policies/userAgentPolicy";
export { DeserializationContentTypes, deserializationPolicy, deserializeResponseBody, } from "./policies/deserializationPolicy";
export { MapperType, SimpleMapperType, CompositeMapperType, DictionaryMapperType, SequenceMapperType, EnumMapperType, Mapper, BaseMapper, CompositeMapper, SequenceMapper, DictionaryMapper, EnumMapper, MapperConstraints, PolymorphicDiscriminator, Serializer, UrlParameterValue, serializeObject, } from "./serializer";
export { stripRequest, stripResponse, delay, executePromisesSequentially, generateUuid, encodeUri, ServiceCallback, promiseToCallback, promiseToServiceCallback, isValidUuid, applyMixins, isNode, isDuration, } from "./util/utils";
export { URLBuilder, URLQuery } from "./url";
export { TokenCredentials } from "./credentials/tokenCredentials";
export { TokenResponse } from "./credentials/tokenResponse";
export { BasicAuthenticationCredentials } from "./credentials/basicAuthenticationCredentials";
export { ApiKeyCredentials, ApiKeyCredentialOptions } from "./credentials/apiKeyCredentials";
export { ServiceClientCredentials } from "./credentials/serviceClientCredentials";
export { TopicCredentials } from "./credentials/topicCredentials";
export { DomainCredentials } from "./credentials/domainCredentials";
export { Authenticator } from "./credentials/credentials";
export { AzureIdentityCredentialAdapter } from "./credentials/azureIdentityTokenCredentialAdapter";
//# sourceMappingURL=msRest.d.ts.map

View file

@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AAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC"}

34
node_modules/@azure/ms-rest-js/es/lib/msRest.js generated vendored Normal file
View file

@ -0,0 +1,34 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
/// <reference path="../dom-shim.d.ts" />
export { WebResource, } from "./webResource";
export { DefaultHttpClient } from "./defaultHttpClient";
export { HttpHeaders } from "./httpHeaders";
export { HttpPipelineLogLevel } from "./httpPipelineLogLevel";
export { RestError } from "./restError";
export { ServiceClient, flattenResponse, } from "./serviceClient";
export { QueryCollectionFormat } from "./queryCollectionFormat";
export { Constants } from "./util/constants";
export { logPolicy } from "./policies/logPolicy";
export { BaseRequestPolicy, RequestPolicyOptions, } from "./policies/requestPolicy";
export { generateClientRequestIdPolicy } from "./policies/generateClientRequestIdPolicy";
export { exponentialRetryPolicy } from "./policies/exponentialRetryPolicy";
export { systemErrorRetryPolicy } from "./policies/systemErrorRetryPolicy";
export { throttlingRetryPolicy } from "./policies/throttlingRetryPolicy";
export { agentPolicy } from "./policies/agentPolicy";
export { getDefaultProxySettings, proxyPolicy } from "./policies/proxyPolicy";
export { redirectPolicy } from "./policies/redirectPolicy";
export { signingPolicy } from "./policies/signingPolicy";
export { userAgentPolicy, getDefaultUserAgentValue, } from "./policies/userAgentPolicy";
export { deserializationPolicy, deserializeResponseBody, } from "./policies/deserializationPolicy";
export { MapperType, Serializer, serializeObject, } from "./serializer";
export { stripRequest, stripResponse, delay, executePromisesSequentially, generateUuid, encodeUri, promiseToCallback, promiseToServiceCallback, isValidUuid, applyMixins, isNode, isDuration, } from "./util/utils";
export { URLBuilder, URLQuery } from "./url";
// Credentials
export { TokenCredentials } from "./credentials/tokenCredentials";
export { BasicAuthenticationCredentials } from "./credentials/basicAuthenticationCredentials";
export { ApiKeyCredentials } from "./credentials/apiKeyCredentials";
export { TopicCredentials } from "./credentials/topicCredentials";
export { DomainCredentials } from "./credentials/domainCredentials";
export { AzureIdentityCredentialAdapter } from "./credentials/azureIdentityTokenCredentialAdapter";
//# sourceMappingURL=msRest.js.map

1
node_modules/@azure/ms-rest-js/es/lib/msRest.js.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"msRest.js","sourceRoot":"","sources":["../../lib/msRest.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,yCAAyC;AAEzC,OAAO,EACL,WAAW,GASZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAc,WAAW,EAAmC,MAAM,eAAe,CAAC;AAGzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,OAAO,EAGL,aAAa,EAEb,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,iBAAiB,EAGjB,oBAAoB,GAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,6BAA6B,E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it, CommonResponse, FetchHttpClient } from "./fetchHttpClient";
import { HttpOperationResponse } from "./httpOperationResponse";
import { WebResourceLike } from "./webResource";
export declare class NodeFetchHttpClient extends FetchHttpClient {
private readonly cookieJar;
fetch(input: CommonRequestInfo, init?: CommonRequestInit): Promise<CommonResponse>;
prepareRequest(httpRequest: WebResourceLike): Promise<Partial<RequestInit>>;
processRequest(operationResponse: HttpOperationResponse): Promise<void>;
}
//# sourceMappingURL=nodeFetchHttpClient.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"nodeFetchHttpClient.d.ts","sourceRoot":"","sources":["../../lib/nodeFetchHttpClient.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuD;IAE3E,KAAK,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlF,cAAc,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAgD3E,cAAc,CAAC,iBAAiB,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB9E"}

View file

@ -0,0 +1,109 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __awaiter, __extends, __generator } from "tslib";
import * as tough from "tough-cookie";
import * as http from "http";
import * as https from "https";
import node_fetch from "node-fetch";
import { FetchHttpClient, } from "./fetchHttpClient";
import { createProxyAgent } from "./proxyAgent";
var NodeFetchHttpClient = /** @class */ (function (_super) {
__extends(NodeFetchHttpClient, _super);
function NodeFetchHttpClient() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.cookieJar = new tough.CookieJar(undefined, { looseMode: true });
return _this;
}
NodeFetchHttpClient.prototype.fetch = function (input, init) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, node_fetch(input, init)];
});
});
};
NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) {
return __awaiter(this, void 0, void 0, function () {
var requestInit, cookieString, _a, httpAgent, httpsAgent, tunnel, options, agent;
var _this = this;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
requestInit = {};
if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) {
if (err) {
reject(err);
}
else {
resolve(cookie);
}
});
})];
case 1:
cookieString = _b.sent();
httpRequest.headers.set("Cookie", cookieString);
_b.label = 2;
case 2:
if (httpRequest.agentSettings) {
_a = httpRequest.agentSettings, httpAgent = _a.http, httpsAgent = _a.https;
if (httpsAgent && httpRequest.url.startsWith("https")) {
requestInit.agent = httpsAgent;
}
else if (httpAgent) {
requestInit.agent = httpAgent;
}
}
else if (httpRequest.proxySettings) {
tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);
requestInit.agent = tunnel.agent;
}
if (httpRequest.keepAlive === true) {
if (requestInit.agent) {
requestInit.agent.keepAlive = true;
}
else {
options = { keepAlive: true };
agent = httpRequest.url.startsWith("https")
? new https.Agent(options)
: new http.Agent(options);
requestInit.agent = agent;
}
}
return [2 /*return*/, requestInit];
}
});
});
};
NodeFetchHttpClient.prototype.processRequest = function (operationResponse) {
return __awaiter(this, void 0, void 0, function () {
var setCookieHeader_1;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.cookieJar) return [3 /*break*/, 2];
setCookieHeader_1 = operationResponse.headers.get("Set-Cookie");
if (!(setCookieHeader_1 != undefined)) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) {
if (err) {
reject(err);
}
else {
resolve();
}
});
})];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/];
}
});
});
};
return NodeFetchHttpClient;
}(FetchHttpClient));
export { NodeFetchHttpClient };
//# sourceMappingURL=nodeFetchHttpClient.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"nodeFetchHttpClient.js","sourceRoot":"","sources":["../../lib/nodeFetchHttpClient.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAIL,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,gBAAgB,EAAc,MAAM,cAAc,CAAC;AAE5D;IAAyC,uCAAe;IAAxD;QAAA,qEA4EC;QA3EkB,eAAS,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;;IA2EnF,CAAC;IAzEO,mCAAK,GAAX,UAAY,KAAwB,EAAE,IAAwB;;;gBAC5D,sBAAQ,UAAU,CAAC,KAAK,EAAE,IAAI,CAAwC,EAAC;;;KACxE;IAEK,4CAAc,GAApB,UAAqB,WAA4B;;;;;;;wBACzC,WAAW,GAA2C,EAAE,CAAC;6BAE3D,CAAA,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA,EAApD,wBAAoD;wBACjC,qBAAM,IAAI,OAAO,CAAS,UAAC,OAAO,EAAE,MAAM;gCAC7D,KAAI,CA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B,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gCAC5B,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;6BAC3B;yBACF;wBAED,sBAAO,WAAW,EAAC;;;;KACpB;IAEK,4CAAc,GAApB,UAAqB,iBAAwC;;;;;;;6BACvD,IAAI,CAAC,SAAS,EAAd,wBAAc;wBACV,oBAAkB,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;6BAChE,CAAA,iBAAe,IAAI,SAAS,CAAA,EAA5B,wBAA4B;wBAC9B,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;gCAChC,KAAI,CAAC,SAAU,CAAC,SAAS,CACvB,iBAAe,EACf,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAC7B,EAAE,WAAW,EAAE,IAAI,EAAE,EACrB,UAAC,GAAG;oCACF,IAAI,GAAG,EAAE;wCACP,MAAM,CAAC,GAAG,CAAC,CAAC;qCACb;yCAAM;wCACL,OAAO,EAAE,CAAC;qCACX;gCACH,CAAC,CACF,CAAC;4BACJ,CAAC,CAAC,EAAA;;wBAbF,SAaE,CAAC;;;;;;KAGR;IACH,0BAAC;AAAD,CAAC,AA5ED,CAAyC,eAAe,GA4EvD"}

View file

@ -0,0 +1,15 @@
import { RequestOptionsBase } from "./webResource";
/**
* A collection of properties that apply to a single invocation of an operation.
*/
export interface OperationArguments {
/**
* The parameters that were passed to the operation method.
*/
[parameterName: string]: any;
/**
* The optional arugments that are provided to an operation.
*/
options?: RequestOptionsBase;
}
//# sourceMappingURL=operationArguments.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationArguments.d.ts","sourceRoot":"","sources":["../../lib/operationArguments.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B"}

View file

@ -0,0 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//# sourceMappingURL=operationArguments.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationArguments.js","sourceRoot":"","sources":["../../lib/operationArguments.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}

View file

@ -0,0 +1,51 @@
import { QueryCollectionFormat } from "./queryCollectionFormat";
import { Mapper } from "./serializer";
export declare type ParameterPath = string | string[] | {
[propertyName: string]: ParameterPath;
};
/**
* A common interface that all Operation parameter's extend.
*/
export interface OperationParameter {
/**
* The path to this parameter's value in OperationArguments or the object that contains paths for
* each property's value in OperationArguments.
*/
parameterPath: ParameterPath;
/**
* The mapper that defines how to validate and serialize this parameter's value.
*/
mapper: Mapper;
}
/**
* A parameter for an operation that will be substituted into the operation's request URL.
*/
export interface OperationURLParameter extends OperationParameter {
/**
* Whether or not to skip encoding the URL parameter's value before adding it to the URL.
*/
skipEncoding?: boolean;
}
/**
* A parameter for an operation that will be added as a query parameter to the operation's HTTP
* request.
*/
export interface OperationQueryParameter extends OperationParameter {
/**
* Whether or not to skip encoding the query parameter's value before adding it to the URL.
*/
skipEncoding?: boolean;
/**
* If this query parameter's value is a collection, what type of format should the value be
* converted to.
*/
collectionFormat?: QueryCollectionFormat;
}
/**
* Get the path to this parameter's value as a dotted string (a.b.c).
* @param parameter The parameter to get the path string for.
* @returns The path to this parameter's value as a dotted string.
*/
export declare function getPathStringFromParameter(parameter: OperationParameter): string;
export declare function getPathStringFromParameterPath(parameterPath: ParameterPath, mapper: Mapper): string;
//# sourceMappingURL=operationParameter.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationParameter.d.ts","sourceRoot":"","sources":["../../lib/operationParameter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,oBAAY,aAAa,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG;IAAE,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAE1F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAEhF;AAED,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,GACb,MAAM,CAUR"}

View file

@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
/**
* Get the path to this parameter's value as a dotted string (a.b.c).
* @param parameter The parameter to get the path string for.
* @returns The path to this parameter's value as a dotted string.
*/
export function getPathStringFromParameter(parameter) {
return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper);
}
export function getPathStringFromParameterPath(parameterPath, mapper) {
var result;
if (typeof parameterPath === "string") {
result = parameterPath;
}
else if (Array.isArray(parameterPath)) {
result = parameterPath.join(".");
}
else {
result = mapper.serializedName;
}
return result;
}
//# sourceMappingURL=operationParameter.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationParameter.js","sourceRoot":"","sources":["../../lib/operationParameter.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAkD/F;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,SAA6B;IACtE,OAAO,8BAA8B,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,aAA4B,EAC5B,MAAc;IAEd,IAAI,MAAc,CAAC;IACnB,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACrC,MAAM,GAAG,aAAa,CAAC;KACxB;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACvC,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAClC;SAAM;QACL,MAAM,GAAG,MAAM,CAAC,cAAe,CAAC;KACjC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}

View file

@ -0,0 +1,15 @@
import { Mapper } from "./serializer";
/**
* An OperationResponse that can be returned from an operation request for a single status code.
*/
export interface OperationResponse {
/**
* The mapper that will be used to deserialize the response headers.
*/
headersMapper?: Mapper;
/**
* The mapper that will be used to deserialize the response body.
*/
bodyMapper?: Mapper;
}
//# sourceMappingURL=operationResponse.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationResponse.d.ts","sourceRoot":"","sources":["../../lib/operationResponse.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}

View file

@ -0,0 +1,3 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//# sourceMappingURL=operationResponse.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationResponse.js","sourceRoot":"","sources":["../../lib/operationResponse.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}

View file

@ -0,0 +1,68 @@
import { OperationParameter, OperationQueryParameter, OperationURLParameter } from "./operationParameter";
import { OperationResponse } from "./operationResponse";
import { Serializer } from "./serializer";
import { HttpMethods } from "./webResource";
/**
* A specification that defines an operation.
*/
export interface OperationSpec {
/**
* The serializer to use in this operation.
*/
readonly serializer: Serializer;
/**
* The HTTP method that should be used by requests for this operation.
*/
readonly httpMethod: HttpMethods;
/**
* The URL that was provided in the service's specification. This will still have all of the URL
* template variables in it. If this is not provided when the OperationSpec is created, then it
* will be populated by a "baseUri" property on the ServiceClient.
*/
readonly baseUrl?: string;
/**
* The fixed path for this operation's URL. This will still have all of the URL template variables
* in it.
*/
readonly path?: string;
/**
* The content type of the request body. This value will be used as the "Content-Type" header if
* it is provided.
*/
readonly contentType?: string;
/**
* The parameter that will be used to construct the HTTP request's body.
*/
readonly requestBody?: OperationParameter;
/**
* Whether or not this operation uses XML request and response bodies.
*/
readonly isXML?: boolean;
/**
* The parameters to the operation method that will be substituted into the constructed URL.
*/
readonly urlParameters?: ReadonlyArray<OperationURLParameter>;
/**
* The parameters to the operation method that will be added to the constructed URL's query.
*/
readonly queryParameters?: ReadonlyArray<OperationQueryParameter>;
/**
* The parameters to the operation method that will be converted to headers on the operation's
* HTTP request.
*/
readonly headerParameters?: ReadonlyArray<OperationParameter>;
/**
* The parameters to the operation method that will be used to create a formdata body for the
* operation's HTTP request.
*/
readonly formDataParameters?: ReadonlyArray<OperationParameter>;
/**
* The different types of responses that this operation can return based on what status code is
* returned.
*/
readonly responses: {
[responseCode: string]: OperationResponse;
};
}
export declare function isStreamOperation(operationSpec: OperationSpec): boolean;
//# sourceMappingURL=operationSpec.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationSpec.d.ts","sourceRoot":"","sources":["../../lib/operationSpec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,kBAAkB,EAClB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ored Normal file
View file

@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { MapperType } from "./serializer";
export function isStreamOperation(operationSpec) {
var result = false;
for (var statusCode in operationSpec.responses) {
var operationResponse = operationSpec.responses[statusCode];
if (operationResponse.bodyMapper &&
operationResponse.bodyMapper.type.name === MapperType.Stream) {
result = true;
break;
}
}
return result;
}
//# sourceMappingURL=operationSpec.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"operationSpec.js","sourceRoot":"","sources":["../../lib/operationSpec.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAQ/F,OAAO,EAAE,UAAU,EAAc,MAAM,cAAc,CAAC;AA2EtD,MAAM,UAAU,iBAAiB,CAAC,aAA4B;IAC5D,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,IAAM,UAAU,IAAI,aAAa,CAAC,SAAS,EAAE;QAChD,IAAM,iBAAiB,GAAsB,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACjF,IACE,iBAAiB,CAAC,UAAU;YAC5B,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,EAC5D;YACA,MAAM,GAAG,IAAI,CAAC;YACd,MAAM;SACP;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}

View file

@ -0,0 +1,10 @@
import { AgentSettings } from "../serviceClient";
import { BaseRequestPolicy, RequestPolicy, RequestPolicyFactory, RequestPolicyOptionsLike } from "./requestPolicy";
import { HttpOperationResponse } from "../httpOperationResponse";
import { WebResourceLike } from "../webResource";
export declare function agentPolicy(_agentSettings?: AgentSettings): RequestPolicyFactory;
export declare class AgentPolicy extends BaseRequestPolicy {
constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptionsLike);
sendRequest(_request: WebResourceLike): Promise<HttpOperationResponse>;
}
//# sourceMappingURL=agentPolicy.browser.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"agentPolicy.browser.d.ts","sourceRoot":"","sources":["../../../lib/policies/agentPolicy.browser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIjD,wBAAgB,WAAW,CAAC,cAAc,CAAC,EAAE,aAAa,GAAG,oBAAoB,CAMhF;AAED,qBAAa,WAAY,SAAQ,iBAAiB;gBACpC,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,wBAAwB;IAKjE,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAG9E"}

View file

@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import { __extends } from "tslib";
import { BaseRequestPolicy, } from "./requestPolicy";
var agentNotSupportedInBrowser = new Error("AgentPolicy is not supported in browser environment");
export function agentPolicy(_agentSettings) {
return {
create: function (_nextPolicy, _options) {
throw agentNotSupportedInBrowser;
},
};
}
var AgentPolicy = /** @class */ (function (_super) {
__extends(AgentPolicy, _super);
function AgentPolicy(nextPolicy, options) {
var _this = _super.call(this, nextPolicy, options) || this;
throw agentNotSupportedInBrowser;
return _this;
}
AgentPolicy.prototype.sendRequest = function (_request) {
throw agentNotSupportedInBrowser;
};
return AgentPolicy;
}(BaseRequestPolicy));
export { AgentPolicy };
//# sourceMappingURL=agentPolicy.browser.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"agentPolicy.browser.js","sourceRoot":"","sources":["../../../lib/policies/agentPolicy.browser.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;;AAG/F,OAAO,EACL,iBAAiB,GAIlB,MAAM,iBAAiB,CAAC;AAIzB,IAAM,0BAA0B,GAAG,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;AAEpG,MAAM,UAAU,WAAW,CAAC,cAA8B;IACxD,OAAO;QACL,MAAM,EAAE,UAAC,WAA0B,EAAE,QAAkC;YACrE,MAAM,0BAA0B,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;IAAiC,+BAAiB;IAChD,qBAAY,UAAyB,EAAE,OAAiC;QAAxE,YACE,kBAAM,UAAU,EAAE,OAAO,CAAC,SAE3B;QADC,MAAM,0BAA0B,CAAC;;IACnC,CAAC;IAEM,iCAAW,GAAlB,UAAmB,QAAyB;QAC1C,MAAM,0BAA0B,CAAC;IACnC,CAAC;IACH,kBAAC;AAAD,CAAC,AATD,CAAiC,iBAAiB,GASjD"}

Some files were not shown because too many files have changed in this diff Show more