@azure/core-amqp 4.4.0-alpha.20240710.2 → 4.4.0-alpha.20240715.2
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/browser/util/checkNetworkConnection-browser.d.mts.map +1 -1
- package/dist/browser/util/checkNetworkConnection-browser.mjs.map +1 -1
- package/dist/browser/util/checkNetworkConnection.common.d.ts +6 -0
- package/dist/browser/util/checkNetworkConnection.common.d.ts.map +1 -0
- package/dist/browser/util/checkNetworkConnection.common.js +10 -0
- package/dist/browser/util/checkNetworkConnection.common.js.map +1 -0
- package/dist/browser/util/checkNetworkConnection.d.ts +1 -5
- package/dist/browser/util/checkNetworkConnection.js +1 -7
- package/dist/browser/util/hmacSha256-browser.d.mts.map +1 -1
- package/dist/browser/util/hmacSha256-browser.mjs.map +1 -1
- package/dist/browser/util/hmacSha256.common.d.ts +17 -0
- package/dist/browser/util/hmacSha256.common.d.ts.map +1 -0
- package/dist/browser/util/hmacSha256.common.js +11 -0
- package/dist/browser/util/hmacSha256.common.js.map +1 -0
- package/dist/browser/util/hmacSha256.d.ts +1 -16
- package/dist/browser/util/hmacSha256.js +1 -8
- package/dist/commonjs/util/checkNetworkConnection.common.d.ts +6 -0
- package/dist/commonjs/util/checkNetworkConnection.common.d.ts.map +1 -0
- package/dist/commonjs/util/checkNetworkConnection.common.js +13 -0
- package/dist/commonjs/util/checkNetworkConnection.common.js.map +1 -0
- package/dist/commonjs/util/hmacSha256.common.d.ts +17 -0
- package/dist/commonjs/util/hmacSha256.common.d.ts.map +1 -0
- package/dist/commonjs/util/hmacSha256.common.js +14 -0
- package/dist/commonjs/util/hmacSha256.common.js.map +1 -0
- package/dist/esm/util/checkNetworkConnection.common.d.ts +6 -0
- package/dist/esm/util/checkNetworkConnection.common.d.ts.map +1 -0
- package/dist/esm/util/checkNetworkConnection.common.js +10 -0
- package/dist/esm/util/checkNetworkConnection.common.js.map +1 -0
- package/dist/esm/util/hmacSha256.common.d.ts +17 -0
- package/dist/esm/util/hmacSha256.common.d.ts.map +1 -0
- package/dist/esm/util/hmacSha256.common.js +11 -0
- package/dist/esm/util/hmacSha256.common.js.map +1 -0
- package/dist/react-native/util/checkNetworkConnection-react-native.d.mts.map +1 -0
- package/dist/react-native/util/checkNetworkConnection-react-native.mjs.map +1 -0
- package/dist/react-native/util/checkNetworkConnection.common.d.ts +6 -0
- package/dist/react-native/util/checkNetworkConnection.common.d.ts.map +1 -0
- package/dist/react-native/util/checkNetworkConnection.common.js +10 -0
- package/dist/react-native/util/checkNetworkConnection.common.js.map +1 -0
- package/dist/react-native/util/checkNetworkConnection.d.ts +2 -6
- package/dist/react-native/util/checkNetworkConnection.js +2 -26
- package/dist/react-native/util/hmacSha256-react-native.d.mts.map +1 -0
- package/dist/react-native/util/hmacSha256-react-native.mjs.map +1 -0
- package/dist/react-native/util/hmacSha256.common.d.ts +17 -0
- package/dist/react-native/util/hmacSha256.common.d.ts.map +1 -0
- package/dist/react-native/util/hmacSha256.common.js +11 -0
- package/dist/react-native/util/hmacSha256.common.js.map +1 -0
- package/dist/react-native/util/hmacSha256.d.ts +2 -2
- package/dist/react-native/util/hmacSha256.js +2 -6
- package/dist/react-native/util/runtimeInfo-react-native.mjs.map +1 -1
- package/dist/react-native/util/runtimeInfo.js +1 -1
- package/package.json +1 -1
- package/dist/react-native/util/checkNetworkConnection.d.ts.map +0 -1
- package/dist/react-native/util/checkNetworkConnection.js.map +0 -1
- package/dist/react-native/util/hmacSha256.d.ts.map +0 -1
- package/dist/react-native/util/hmacSha256.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkNetworkConnection-browser.d.mts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection-browser.mts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection-browser.d.mts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection-browser.mts"],"names":[],"mappings":"AAGA,cAAc,oCAAoC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkNetworkConnection-browser.mjs","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection-browser.mjs","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,oCAAoC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./checkNetworkConnection.common.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.d.ts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
/**
|
|
4
|
+
* Checks whether a network connection is detected.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function checkNetworkConnection() {
|
|
8
|
+
return Promise.resolve(self.navigator.onLine);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=checkNetworkConnection.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.js","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Checks whether a network connection is detected.\n * @internal\n */\nexport function checkNetworkConnection(): Promise<boolean> {\n return Promise.resolve(self.navigator.onLine);\n}\n"]}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
|
|
4
|
-
* Checks whether a network connection is detected.
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export function checkNetworkConnection() {
|
|
8
|
-
return Promise.resolve(self.navigator.onLine);
|
|
9
|
-
}
|
|
3
|
+
export * from "./checkNetworkConnection.common.js";
|
|
10
4
|
//# sourceMappingURL=checkNetworkConnection-browser.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmacSha256-browser.d.mts","sourceRoot":"","sources":["../../../src/util/hmacSha256-browser.mts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"hmacSha256-browser.d.mts","sourceRoot":"","sources":["../../../src/util/hmacSha256-browser.mts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmacSha256-browser.mjs","sourceRoot":"","sources":["../../../src/util/hmacSha256-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"hmacSha256-browser.mjs","sourceRoot":"","sources":["../../../src/util/hmacSha256-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./hmacSha256.common.js\";\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HmacImportParams {
|
|
3
|
+
name: string;
|
|
4
|
+
hash: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface CryptoKey {
|
|
9
|
+
algorithm: HmacImportParams;
|
|
10
|
+
type: string;
|
|
11
|
+
extractable: boolean;
|
|
12
|
+
usages: string[];
|
|
13
|
+
}
|
|
14
|
+
function btoa(input: string): string;
|
|
15
|
+
}
|
|
16
|
+
export declare function signString(key: string, toSign: string): Promise<string>;
|
|
17
|
+
//# sourceMappingURL=hmacSha256.common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.d.ts","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,gBAAgB;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxB;IAED,UAAU,SAAS;QACjB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB;IAED,SAAS,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAiBD,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
export async function signString(key, toSign) {
|
|
4
|
+
const enc = new TextEncoder();
|
|
5
|
+
const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
|
|
6
|
+
const extractedKey = await globalThis.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
|
|
7
|
+
const signature = await globalThis.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
|
|
8
|
+
const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
9
|
+
return encodeURIComponent(digest);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=hmacSha256.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.js","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IAEhF,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAC3D,KAAK,EACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,SAAS,EACT,KAAK,EACL,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,SAAS,EACT,YAAY,EACZ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\ndeclare global {\n interface HmacImportParams {\n name: string;\n hash: { name: string };\n }\n\n interface CryptoKey {\n algorithm: HmacImportParams;\n type: string;\n extractable: boolean;\n usages: string[];\n }\n\n function btoa(input: string): string;\n}\n\ndeclare const globalThis: {\n crypto: {\n subtle: {\n importKey(\n format: string,\n keyData: Uint8Array,\n algorithm: HmacImportParams,\n extractable: boolean,\n usages: string[],\n ): Promise<CryptoKey>;\n sign(algorithm: HmacImportParams, key: CryptoKey, data: Uint8Array): Promise<ArrayBuffer>;\n };\n };\n};\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const enc = new TextEncoder();\n const algorithm: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n\n const extractedKey = await globalThis.crypto.subtle.importKey(\n \"raw\",\n enc.encode(key),\n algorithm,\n false,\n [\"sign\", \"verify\"],\n );\n const signature = await globalThis.crypto.subtle.sign(\n algorithm,\n extractedKey,\n enc.encode(toSign),\n );\n const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));\n\n return encodeURIComponent(digest);\n}\n"]}
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
interface HmacImportParams {
|
|
3
|
-
name: string;
|
|
4
|
-
hash: {
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
interface CryptoKey {
|
|
9
|
-
algorithm: HmacImportParams;
|
|
10
|
-
type: string;
|
|
11
|
-
extractable: boolean;
|
|
12
|
-
usages: string[];
|
|
13
|
-
}
|
|
14
|
-
function btoa(input: string): string;
|
|
15
|
-
}
|
|
16
|
-
export declare function signString(key: string, toSign: string): Promise<string>;
|
|
1
|
+
export * from "./hmacSha256.common.js";
|
|
17
2
|
//# sourceMappingURL=hmacSha256-browser.d.mts.map
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
export
|
|
4
|
-
const enc = new TextEncoder();
|
|
5
|
-
const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
|
|
6
|
-
const extractedKey = await globalThis.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
|
|
7
|
-
const signature = await globalThis.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
|
|
8
|
-
const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
9
|
-
return encodeURIComponent(digest);
|
|
10
|
-
}
|
|
3
|
+
export * from "./hmacSha256.common.js";
|
|
11
4
|
//# sourceMappingURL=hmacSha256-browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.d.ts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEzD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.checkNetworkConnection = checkNetworkConnection;
|
|
6
|
+
/**
|
|
7
|
+
* Checks whether a network connection is detected.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
function checkNetworkConnection() {
|
|
11
|
+
return Promise.resolve(self.navigator.onLine);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=checkNetworkConnection.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.js","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAMlC,wDAEC;AAND;;;GAGG;AACH,SAAgB,sBAAsB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Checks whether a network connection is detected.\n * @internal\n */\nexport function checkNetworkConnection(): Promise<boolean> {\n return Promise.resolve(self.navigator.onLine);\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HmacImportParams {
|
|
3
|
+
name: string;
|
|
4
|
+
hash: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface CryptoKey {
|
|
9
|
+
algorithm: HmacImportParams;
|
|
10
|
+
type: string;
|
|
11
|
+
extractable: boolean;
|
|
12
|
+
usages: string[];
|
|
13
|
+
}
|
|
14
|
+
function btoa(input: string): string;
|
|
15
|
+
}
|
|
16
|
+
export declare function signString(key: string, toSign: string): Promise<string>;
|
|
17
|
+
//# sourceMappingURL=hmacSha256.common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.d.ts","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,gBAAgB;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxB;IAED,UAAU,SAAS;QACjB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB;IAED,SAAS,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAiBD,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.signString = signString;
|
|
6
|
+
async function signString(key, toSign) {
|
|
7
|
+
const enc = new TextEncoder();
|
|
8
|
+
const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
|
|
9
|
+
const extractedKey = await globalThis.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
|
|
10
|
+
const signature = await globalThis.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
|
|
11
|
+
const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
12
|
+
return encodeURIComponent(digest);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=hmacSha256.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.js","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAiClC,gCAmBC;AAnBM,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IAEhF,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAC3D,KAAK,EACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,SAAS,EACT,KAAK,EACL,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,SAAS,EACT,YAAY,EACZ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\ndeclare global {\n interface HmacImportParams {\n name: string;\n hash: { name: string };\n }\n\n interface CryptoKey {\n algorithm: HmacImportParams;\n type: string;\n extractable: boolean;\n usages: string[];\n }\n\n function btoa(input: string): string;\n}\n\ndeclare const globalThis: {\n crypto: {\n subtle: {\n importKey(\n format: string,\n keyData: Uint8Array,\n algorithm: HmacImportParams,\n extractable: boolean,\n usages: string[],\n ): Promise<CryptoKey>;\n sign(algorithm: HmacImportParams, key: CryptoKey, data: Uint8Array): Promise<ArrayBuffer>;\n };\n };\n};\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const enc = new TextEncoder();\n const algorithm: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n\n const extractedKey = await globalThis.crypto.subtle.importKey(\n \"raw\",\n enc.encode(key),\n algorithm,\n false,\n [\"sign\", \"verify\"],\n );\n const signature = await globalThis.crypto.subtle.sign(\n algorithm,\n extractedKey,\n enc.encode(toSign),\n );\n const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));\n\n return encodeURIComponent(digest);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.d.ts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
/**
|
|
4
|
+
* Checks whether a network connection is detected.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function checkNetworkConnection() {
|
|
8
|
+
return Promise.resolve(self.navigator.onLine);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=checkNetworkConnection.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.js","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Checks whether a network connection is detected.\n * @internal\n */\nexport function checkNetworkConnection(): Promise<boolean> {\n return Promise.resolve(self.navigator.onLine);\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HmacImportParams {
|
|
3
|
+
name: string;
|
|
4
|
+
hash: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface CryptoKey {
|
|
9
|
+
algorithm: HmacImportParams;
|
|
10
|
+
type: string;
|
|
11
|
+
extractable: boolean;
|
|
12
|
+
usages: string[];
|
|
13
|
+
}
|
|
14
|
+
function btoa(input: string): string;
|
|
15
|
+
}
|
|
16
|
+
export declare function signString(key: string, toSign: string): Promise<string>;
|
|
17
|
+
//# sourceMappingURL=hmacSha256.common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.d.ts","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,gBAAgB;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxB;IAED,UAAU,SAAS;QACjB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB;IAED,SAAS,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAiBD,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
export async function signString(key, toSign) {
|
|
4
|
+
const enc = new TextEncoder();
|
|
5
|
+
const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
|
|
6
|
+
const extractedKey = await globalThis.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
|
|
7
|
+
const signature = await globalThis.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
|
|
8
|
+
const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
9
|
+
return encodeURIComponent(digest);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=hmacSha256.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.js","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IAEhF,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAC3D,KAAK,EACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,SAAS,EACT,KAAK,EACL,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,SAAS,EACT,YAAY,EACZ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\ndeclare global {\n interface HmacImportParams {\n name: string;\n hash: { name: string };\n }\n\n interface CryptoKey {\n algorithm: HmacImportParams;\n type: string;\n extractable: boolean;\n usages: string[];\n }\n\n function btoa(input: string): string;\n}\n\ndeclare const globalThis: {\n crypto: {\n subtle: {\n importKey(\n format: string,\n keyData: Uint8Array,\n algorithm: HmacImportParams,\n extractable: boolean,\n usages: string[],\n ): Promise<CryptoKey>;\n sign(algorithm: HmacImportParams, key: CryptoKey, data: Uint8Array): Promise<ArrayBuffer>;\n };\n };\n};\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const enc = new TextEncoder();\n const algorithm: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n\n const extractedKey = await globalThis.crypto.subtle.importKey(\n \"raw\",\n enc.encode(key),\n algorithm,\n false,\n [\"sign\", \"verify\"],\n );\n const signature = await globalThis.crypto.subtle.sign(\n algorithm,\n extractedKey,\n enc.encode(toSign),\n );\n const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));\n\n return encodeURIComponent(digest);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection-react-native.d.mts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection-react-native.mts"],"names":[],"mappings":"AAGA,cAAc,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection-react-native.mjs","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,oCAAoC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./checkNetworkConnection.common.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.d.ts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
/**
|
|
4
|
+
* Checks whether a network connection is detected.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function checkNetworkConnection() {
|
|
8
|
+
return Promise.resolve(self.navigator.onLine);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=checkNetworkConnection.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkNetworkConnection.common.js","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Checks whether a network connection is detected.\n * @internal\n */\nexport function checkNetworkConnection(): Promise<boolean> {\n return Promise.resolve(self.navigator.onLine);\n}\n"]}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function checkNetworkConnection(host: string): Promise<boolean>;
|
|
6
|
-
//# sourceMappingURL=checkNetworkConnection.d.ts.map
|
|
1
|
+
export * from "./checkNetworkConnection.common.js";
|
|
2
|
+
//# sourceMappingURL=checkNetworkConnection-react-native.d.mts.map
|
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks whether a network connection is detected.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export function checkNetworkConnection(host) {
|
|
10
|
-
return new Promise((resolve) => {
|
|
11
|
-
logger.verbose("Calling dns.resolve to determine network connection status.");
|
|
12
|
-
dnsResolve(host, function (err) {
|
|
13
|
-
if (err) {
|
|
14
|
-
logger.verbose("Error thrown from dns.resolve in network connection check: '%s', %O", err.code || err.name, err);
|
|
15
|
-
// List of possible DNS error codes: https://nodejs.org/dist/latest-v12.x/docs/api/dns.html#dns_error_codes
|
|
16
|
-
// We only resolve with `false` when dnsResolve fails with an error we expect to see when the network is down.
|
|
17
|
-
if (err.code === CONNREFUSED || err.code === TIMEOUT) {
|
|
18
|
-
return resolve(false);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
logger.verbose("Successfully resolved host via dns.resolve in network connection check.");
|
|
23
|
-
}
|
|
24
|
-
return resolve(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=checkNetworkConnection.js.map
|
|
3
|
+
export * from "./checkNetworkConnection.common.js";
|
|
4
|
+
//# sourceMappingURL=checkNetworkConnection-react-native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256-react-native.d.mts","sourceRoot":"","sources":["../../../src/util/hmacSha256-react-native.mts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256-react-native.mjs","sourceRoot":"","sources":["../../../src/util/hmacSha256-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./hmacSha256.common.js\";\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HmacImportParams {
|
|
3
|
+
name: string;
|
|
4
|
+
hash: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface CryptoKey {
|
|
9
|
+
algorithm: HmacImportParams;
|
|
10
|
+
type: string;
|
|
11
|
+
extractable: boolean;
|
|
12
|
+
usages: string[];
|
|
13
|
+
}
|
|
14
|
+
function btoa(input: string): string;
|
|
15
|
+
}
|
|
16
|
+
export declare function signString(key: string, toSign: string): Promise<string>;
|
|
17
|
+
//# sourceMappingURL=hmacSha256.common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.d.ts","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,gBAAgB;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxB;IAED,UAAU,SAAS;QACjB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB;IAED,SAAS,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAiBD,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
export async function signString(key, toSign) {
|
|
4
|
+
const enc = new TextEncoder();
|
|
5
|
+
const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
|
|
6
|
+
const extractedKey = await globalThis.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
|
|
7
|
+
const signature = await globalThis.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
|
|
8
|
+
const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
9
|
+
return encodeURIComponent(digest);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=hmacSha256.common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmacSha256.common.js","sourceRoot":"","sources":["../../../src/util/hmacSha256.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiClC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IAEhF,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAC3D,KAAK,EACL,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,SAAS,EACT,KAAK,EACL,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACnD,SAAS,EACT,YAAY,EACZ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\ndeclare global {\n interface HmacImportParams {\n name: string;\n hash: { name: string };\n }\n\n interface CryptoKey {\n algorithm: HmacImportParams;\n type: string;\n extractable: boolean;\n usages: string[];\n }\n\n function btoa(input: string): string;\n}\n\ndeclare const globalThis: {\n crypto: {\n subtle: {\n importKey(\n format: string,\n keyData: Uint8Array,\n algorithm: HmacImportParams,\n extractable: boolean,\n usages: string[],\n ): Promise<CryptoKey>;\n sign(algorithm: HmacImportParams, key: CryptoKey, data: Uint8Array): Promise<ArrayBuffer>;\n };\n };\n};\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const enc = new TextEncoder();\n const algorithm: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n\n const extractedKey = await globalThis.crypto.subtle.importKey(\n \"raw\",\n enc.encode(key),\n algorithm,\n false,\n [\"sign\", \"verify\"],\n );\n const signature = await globalThis.crypto.subtle.sign(\n algorithm,\n extractedKey,\n enc.encode(toSign),\n );\n const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));\n\n return encodeURIComponent(digest);\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
//# sourceMappingURL=hmacSha256.d.
|
|
1
|
+
export * from "./hmacSha256.common.js";
|
|
2
|
+
//# sourceMappingURL=hmacSha256-react-native.d.mts.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const hmac = createHmac("sha256", key).update(toSign).digest("base64");
|
|
6
|
-
return encodeURIComponent(hmac);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=hmacSha256.js.map
|
|
3
|
+
export * from "./hmacSha256.common.js";
|
|
4
|
+
//# sourceMappingURL=hmacSha256-react-native.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeInfo-react-native.mjs","sourceRoot":"","sources":["../../../src/util/runtimeInfo-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,
|
|
1
|
+
{"version":3,"file":"runtimeInfo-react-native.mjs","sourceRoot":"","sources":["../../../src/util/runtimeInfo-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,OAAO,GAAG,CAAC;AAChD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;;IAC9B,IAAI,MAAA,QAAQ,CAAC,SAAS,0CAAE,kBAAkB,EAAE,CAAC;QAC3C,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,kBAAkB,CAAC;QACtE,OAAO,gBAAgB,KAAK,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,sBAAsB,CAAC;AAChC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Platform } from \"react-native\";\n\n/**\n * Returns information about the platform this function is being run on.\n * @internal\n */\nexport function getPlatformInfo(): string {\n return `(${Platform.OS}-${Platform.Version})`;\n}\n\n/**\n * Returns information about React-Native this function is being run on.\n * @internal\n */\nexport function getFrameworkInfo(): string {\n if (Platform.constants?.reactNativeVersion) {\n const { major, minor, patch } = Platform.constants.reactNativeVersion;\n return `react-native/${major}.${minor}.${patch}`;\n }\n return `react-native/unknown`;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/core-amqp",
|
|
3
3
|
"sdk-type": "client",
|
|
4
|
-
"version": "4.4.0-alpha.
|
|
4
|
+
"version": "4.4.0-alpha.20240715.2",
|
|
5
5
|
"description": "Common library for amqp based azure sdks like @azure/event-hubs.",
|
|
6
6
|
"author": "Microsoft Corporation",
|
|
7
7
|
"license": "MIT",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkNetworkConnection.d.ts","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAsBrE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkNetworkConnection.js","sourceRoot":"","sources":["../../../src/util/checkNetworkConnection.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,CAAC,OAAO,CAAC,6DAA6D,CAAC,CAAC;QAC9E,UAAU,CAAC,IAAI,EAAE,UAAU,GAAQ;YACjC,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,CAAC,OAAO,CACZ,qEAAqE,EACrE,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,EACpB,GAAG,CACJ,CAAC;gBACF,2GAA2G;gBAC3G,8GAA8G;gBAC9G,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;oBACrD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,OAAO,CAAC,yEAAyE,CAAC,CAAC;YAC5F,CAAC;YAED,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CONNREFUSED, TIMEOUT, resolve as dnsResolve } from \"node:dns\";\nimport { logger } from \"../log.js\";\n\n/**\n * Checks whether a network connection is detected.\n * @internal\n */\nexport function checkNetworkConnection(host: string): Promise<boolean> {\n return new Promise((resolve) => {\n logger.verbose(\"Calling dns.resolve to determine network connection status.\");\n dnsResolve(host, function (err: any): void {\n if (err) {\n logger.verbose(\n \"Error thrown from dns.resolve in network connection check: '%s', %O\",\n err.code || err.name,\n err,\n );\n // List of possible DNS error codes: https://nodejs.org/dist/latest-v12.x/docs/api/dns.html#dns_error_codes\n // We only resolve with `false` when dnsResolve fails with an error we expect to see when the network is down.\n if (err.code === CONNREFUSED || err.code === TIMEOUT) {\n return resolve(false);\n }\n } else {\n logger.verbose(\"Successfully resolved host via dns.resolve in network connection check.\");\n }\n\n return resolve(true);\n });\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmacSha256.d.ts","sourceRoot":"","sources":["../../../src/util/hmacSha256.ts"],"names":[],"mappings":"AAKA,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAG7E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hmacSha256.js","sourceRoot":"","sources":["../../../src/util/hmacSha256.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvE,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createHmac } from \"node:crypto\";\n\nexport async function signString(key: string, toSign: string): Promise<string> {\n const hmac = createHmac(\"sha256\", key).update(toSign).digest(\"base64\");\n return encodeURIComponent(hmac);\n}\n"]}
|