@azure/communication-common 2.4.2-alpha.20260211.1 → 2.4.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/README.md +1 -1
- package/dist/browser/credential/communicationAccessKeyCredentialPolicy.d.ts.map +1 -1
- package/dist/browser/credential/communicationAccessKeyCredentialPolicy.js +6 -10
- package/dist/browser/credential/communicationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/browser/entraTokenCredential.d.ts.map +1 -1
- package/dist/browser/entraTokenCredential.js +12 -7
- package/dist/browser/entraTokenCredential.js.map +1 -1
- package/dist/browser/index.d.ts +3 -3
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/commonjs/autoRefreshTokenCredential.js +110 -95
- package/dist/commonjs/autoRefreshTokenCredential.js.map +7 -1
- package/dist/commonjs/azureCommunicationTokenCredential.js +64 -47
- package/dist/commonjs/azureCommunicationTokenCredential.js.map +7 -1
- package/dist/commonjs/communicationTokenCredential.js +16 -5
- package/dist/commonjs/communicationTokenCredential.js.map +7 -1
- package/dist/commonjs/credential/clientArguments.js +46 -40
- package/dist/commonjs/credential/clientArguments.js.map +7 -1
- package/dist/commonjs/credential/communicationAccessKeyCredentialPolicy.d.ts.map +1 -1
- package/dist/commonjs/credential/communicationAccessKeyCredentialPolicy.js +53 -42
- package/dist/commonjs/credential/communicationAccessKeyCredentialPolicy.js.map +7 -1
- package/dist/commonjs/credential/communicationAuthPolicy.js +39 -26
- package/dist/commonjs/credential/communicationAuthPolicy.js.map +7 -1
- package/dist/commonjs/credential/connectionString.js +39 -28
- package/dist/commonjs/credential/connectionString.js.map +7 -1
- package/dist/commonjs/credential/index.js +28 -10
- package/dist/commonjs/credential/index.js.map +7 -1
- package/dist/commonjs/entraTokenCredential.d.ts.map +1 -1
- package/dist/commonjs/entraTokenCredential.js +137 -113
- package/dist/commonjs/entraTokenCredential.js.map +7 -1
- package/dist/commonjs/identifierModelSerializer.js +172 -159
- package/dist/commonjs/identifierModelSerializer.js.map +7 -1
- package/dist/commonjs/identifierModels.js +183 -205
- package/dist/commonjs/identifierModels.js.map +7 -1
- package/dist/commonjs/index.d.ts +3 -3
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +35 -12
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/staticTokenCredential.js +36 -20
- package/dist/commonjs/staticTokenCredential.js.map +7 -1
- package/dist/commonjs/tokenParser.js +33 -13
- package/dist/commonjs/tokenParser.js.map +7 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/credential/communicationAccessKeyCredentialPolicy.d.ts.map +1 -1
- package/dist/esm/credential/communicationAccessKeyCredentialPolicy.js +6 -10
- package/dist/esm/credential/communicationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/esm/entraTokenCredential.d.ts.map +1 -1
- package/dist/esm/entraTokenCredential.js +12 -7
- package/dist/esm/entraTokenCredential.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/react-native/credential/communicationAccessKeyCredentialPolicy.d.ts.map +1 -1
- package/dist/react-native/credential/communicationAccessKeyCredentialPolicy.js +6 -10
- package/dist/react-native/credential/communicationAccessKeyCredentialPolicy.js.map +1 -1
- package/dist/react-native/entraTokenCredential.d.ts.map +1 -1
- package/dist/react-native/entraTokenCredential.js +12 -7
- package/dist/react-native/entraTokenCredential.js.map +1 -1
- package/dist/react-native/index.d.ts +3 -3
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/package.json +28 -35
- package/dist/browser/credential/cryptoUtils-browser.d.mts.map +0 -1
- package/dist/browser/credential/cryptoUtils-browser.mjs.map +0 -1
- package/dist/browser/credential/cryptoUtils.d.ts +0 -3
- package/dist/browser/credential/cryptoUtils.js +0 -19
- package/dist/browser/credential/encodeUtils-browser.d.mts +0 -4
- package/dist/browser/credential/encodeUtils-browser.d.mts.map +0 -1
- package/dist/browser/credential/encodeUtils-browser.mjs +0 -19
- package/dist/browser/credential/encodeUtils-browser.mjs.map +0 -1
- package/dist/commonjs/credential/cryptoUtils.d.ts +0 -3
- package/dist/commonjs/credential/cryptoUtils.d.ts.map +0 -1
- package/dist/commonjs/credential/cryptoUtils.js +0 -14
- package/dist/commonjs/credential/cryptoUtils.js.map +0 -1
- package/dist/esm/credential/cryptoUtils.d.ts +0 -3
- package/dist/esm/credential/cryptoUtils.d.ts.map +0 -1
- package/dist/esm/credential/cryptoUtils.js +0 -9
- package/dist/esm/credential/cryptoUtils.js.map +0 -1
- package/dist/esm/credential/encodeUtils-browser.d.mts +0 -4
- package/dist/esm/credential/encodeUtils-browser.d.mts.map +0 -1
- package/dist/esm/credential/encodeUtils-browser.mjs +0 -19
- package/dist/esm/credential/encodeUtils-browser.mjs.map +0 -1
- package/dist/react-native/credential/cryptoUtils.d.ts +0 -3
- package/dist/react-native/credential/cryptoUtils.d.ts.map +0 -1
- package/dist/react-native/credential/cryptoUtils.js +0 -9
- package/dist/react-native/credential/cryptoUtils.js.map +0 -1
- package/dist/react-native/credential/encodeUtils-browser.d.mts +0 -4
- package/dist/react-native/credential/encodeUtils-browser.d.mts.map +0 -1
- package/dist/react-native/credential/encodeUtils-browser.mjs +0 -19
- package/dist/react-native/credential/encodeUtils-browser.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/communication-common",
|
|
3
|
-
"version": "2.4.2
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Common package for Azure Communication services.",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
"README.md",
|
|
13
13
|
"LICENSE"
|
|
14
14
|
],
|
|
15
|
-
"repository":
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Azure/azure-sdk-for-js",
|
|
18
|
+
"directory": "sdk/communication/communication-common"
|
|
19
|
+
},
|
|
16
20
|
"keywords": [
|
|
17
21
|
"azure",
|
|
18
22
|
"cloud",
|
|
@@ -28,57 +32,41 @@
|
|
|
28
32
|
"engines": {
|
|
29
33
|
"node": ">=20.0.0"
|
|
30
34
|
},
|
|
31
|
-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/communication/communication-common/",
|
|
35
|
+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/communication/communication-common/README.md",
|
|
32
36
|
"sideEffects": false,
|
|
33
37
|
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
|
|
34
38
|
"dependencies": {
|
|
35
|
-
"@azure-rest/core-client": "
|
|
36
|
-
"@azure/abort-controller": "
|
|
37
|
-
"@azure/core-auth": "
|
|
38
|
-
"@azure/core-rest-pipeline": "
|
|
39
|
-
"@azure/core-tracing": "
|
|
40
|
-
"@azure/core-util": "
|
|
39
|
+
"@azure-rest/core-client": "^2.3.3",
|
|
40
|
+
"@azure/abort-controller": "^2.1.2",
|
|
41
|
+
"@azure/core-auth": "^1.9.0",
|
|
42
|
+
"@azure/core-rest-pipeline": "^1.17.0",
|
|
43
|
+
"@azure/core-tracing": "^1.2.0",
|
|
44
|
+
"@azure/core-util": "^1.11.0",
|
|
41
45
|
"events": "^3.3.0",
|
|
42
46
|
"jwt-decode": "^4.0.0",
|
|
43
47
|
"tslib": "^2.8.1"
|
|
44
48
|
},
|
|
45
49
|
"devDependencies": {
|
|
46
50
|
"@azure/identity": "4.13.0",
|
|
47
|
-
"@azure/logger": "
|
|
51
|
+
"@azure/logger": "^1.1.4",
|
|
48
52
|
"@types/node": "^20.19.25",
|
|
49
|
-
"@vitest/browser-playwright": "^4.
|
|
50
|
-
"@vitest/coverage-istanbul": "^4.
|
|
53
|
+
"@vitest/browser-playwright": "^4.1.2",
|
|
54
|
+
"@vitest/coverage-istanbul": "^4.1.2",
|
|
51
55
|
"cross-env": "^10.1.0",
|
|
52
56
|
"eslint": "^9.39.1",
|
|
53
57
|
"mockdate": "^3.0.5",
|
|
54
58
|
"nock": "^13.5.6",
|
|
55
|
-
"playwright": "^1.
|
|
59
|
+
"playwright": "^1.60.0",
|
|
56
60
|
"prettier": "^3.6.2",
|
|
61
|
+
"react-native": "^0.84.1",
|
|
57
62
|
"rimraf": "^6.1.0",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"vitest": "^4.0.8",
|
|
63
|
+
"typescript": "~6.0.2",
|
|
64
|
+
"vitest": "^4.1.2",
|
|
61
65
|
"@azure-tools/test-utils-vitest": "^2.0.1",
|
|
62
66
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
63
67
|
"@azure/dev-tool": "^1.0.0"
|
|
64
68
|
},
|
|
65
69
|
"type": "module",
|
|
66
|
-
"tshy": {
|
|
67
|
-
"exports": {
|
|
68
|
-
"./package.json": "./package.json",
|
|
69
|
-
".": "./src/index.ts"
|
|
70
|
-
},
|
|
71
|
-
"dialects": [
|
|
72
|
-
"esm",
|
|
73
|
-
"commonjs"
|
|
74
|
-
],
|
|
75
|
-
"esmDialects": [
|
|
76
|
-
"browser",
|
|
77
|
-
"react-native"
|
|
78
|
-
],
|
|
79
|
-
"selfLink": false,
|
|
80
|
-
"project": "../../../tsconfig.src.build.json"
|
|
81
|
-
},
|
|
82
70
|
"exports": {
|
|
83
71
|
"./package.json": "./package.json",
|
|
84
72
|
".": {
|
|
@@ -100,6 +88,11 @@
|
|
|
100
88
|
}
|
|
101
89
|
}
|
|
102
90
|
},
|
|
91
|
+
"imports": {
|
|
92
|
+
"#platform/*": {
|
|
93
|
+
"default": "./src/*.ts"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
103
96
|
"scripts": {
|
|
104
97
|
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
|
|
105
98
|
"build:samples": "echo Skipped.",
|
|
@@ -111,9 +104,9 @@
|
|
|
111
104
|
"lint": "eslint package.json src test",
|
|
112
105
|
"lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]",
|
|
113
106
|
"pack": "pnpm pack 2>&1",
|
|
114
|
-
"test": "npm run test:node && npm run test:browser",
|
|
115
|
-
"test:browser": "
|
|
116
|
-
"test:node": "dev-tool run
|
|
107
|
+
"test": "tsc -b --noEmit && npm run test:node && npm run test:browser",
|
|
108
|
+
"test:browser": "dev-tool run test:vitest --no-test-proxy --browser",
|
|
109
|
+
"test:node": "dev-tool run test:vitest --no-test-proxy",
|
|
117
110
|
"test:node:live": "dev-tool run test:vitest --no-test-proxy",
|
|
118
111
|
"update-snippets": "dev-tool run update-snippets"
|
|
119
112
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils-browser.d.mts","sourceRoot":"","sources":["../../../src/credential/cryptoUtils-browser.mts"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CAI7D,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CAO7E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils-browser.mjs","sourceRoot":"","sources":["../../../src/credential/cryptoUtils-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,2BAA2B;AAE3B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAE3F,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;AAE9C,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,OAAe,EAAmB,EAAE;IAChE,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACxD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAc,EAAE,OAAe,EAAmB,EAAE;IAChF,MAAM,YAAY,GAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IACnF,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,UAAU,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACjG,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;IACnF,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/// <reference lib=\"dom\" />\n\nimport { encodeBase64, encodeUTF8, encodeUTF8fromBase64 } from \"./encodeUtils-browser.mjs\";\n\nconst subtleCrypto = globalThis.crypto.subtle;\n\nexport const shaHash = async (content: string): Promise<string> => {\n const data = encodeUTF8(content);\n const hash = await subtleCrypto.digest(\"SHA-256\", data);\n return encodeBase64(hash);\n};\n\nexport const shaHMAC = async (secret: string, content: string): Promise<string> => {\n const importParams: HmacImportParams = { name: \"HMAC\", hash: { name: \"SHA-256\" } };\n const encodedMessage = encodeUTF8(content);\n const encodedKey = encodeUTF8fromBase64(secret);\n const cryptoKey = await subtleCrypto.importKey(\"raw\", encodedKey, importParams, false, [\"sign\"]);\n const signature = await subtleCrypto.sign(importParams, cryptoKey, encodedMessage);\n return encodeBase64(signature);\n};\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
/// <reference lib="dom" />
|
|
4
|
-
import { encodeBase64, encodeUTF8, encodeUTF8fromBase64 } from "./encodeUtils-browser.mjs";
|
|
5
|
-
const subtleCrypto = globalThis.crypto.subtle;
|
|
6
|
-
export const shaHash = async (content) => {
|
|
7
|
-
const data = encodeUTF8(content);
|
|
8
|
-
const hash = await subtleCrypto.digest("SHA-256", data);
|
|
9
|
-
return encodeBase64(hash);
|
|
10
|
-
};
|
|
11
|
-
export const shaHMAC = async (secret, content) => {
|
|
12
|
-
const importParams = { name: "HMAC", hash: { name: "SHA-256" } };
|
|
13
|
-
const encodedMessage = encodeUTF8(content);
|
|
14
|
-
const encodedKey = encodeUTF8fromBase64(secret);
|
|
15
|
-
const cryptoKey = await subtleCrypto.importKey("raw", encodedKey, importParams, false, ["sign"]);
|
|
16
|
-
const signature = await subtleCrypto.sign(importParams, cryptoKey, encodedMessage);
|
|
17
|
-
return encodeBase64(signature);
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=cryptoUtils-browser.mjs.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const encodeUTF8: (str: string) => Uint8Array<ArrayBuffer>;
|
|
2
|
-
export declare function encodeUTF8fromBase64(str: string): Uint8Array<ArrayBuffer>;
|
|
3
|
-
export declare function encodeBase64(value: ArrayBuffer): string;
|
|
4
|
-
//# sourceMappingURL=encodeUtils-browser.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encodeUtils-browser.d.mts","sourceRoot":"","sources":["../../../src/credential/encodeUtils-browser.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,UAAU,CAAC,WAAW,CAAkC,CAAC;AAElG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAMzE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAOvD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
export const encodeUTF8 = (str) => new TextEncoder().encode(str);
|
|
4
|
-
export function encodeUTF8fromBase64(str) {
|
|
5
|
-
if (typeof atob !== "function") {
|
|
6
|
-
throw new Error("Your browser environment is missing the global `atob` function");
|
|
7
|
-
}
|
|
8
|
-
const binary = atob(str);
|
|
9
|
-
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
10
|
-
}
|
|
11
|
-
export function encodeBase64(value) {
|
|
12
|
-
if (typeof btoa !== "function") {
|
|
13
|
-
throw new Error("Your browser environment is missing the global `btoa` function");
|
|
14
|
-
}
|
|
15
|
-
const bytes = new Uint8Array(value);
|
|
16
|
-
const binary = String.fromCharCode.apply(null, [...bytes]);
|
|
17
|
-
return btoa(binary);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=encodeUtils-browser.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encodeUtils-browser.mjs","sourceRoot":"","sources":["../../../src/credential/encodeUtils-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAA2B,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAElG,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAkB;IAC7C,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const encodeUTF8 = (str: string): Uint8Array<ArrayBuffer> => new TextEncoder().encode(str);\n\nexport function encodeUTF8fromBase64(str: string): Uint8Array<ArrayBuffer> {\n if (typeof atob !== \"function\") {\n throw new Error(\"Your browser environment is missing the global `atob` function\");\n }\n const binary = atob(str);\n return Uint8Array.from(binary, (char) => char.charCodeAt(0));\n}\n\nexport function encodeBase64(value: ArrayBuffer): string {\n if (typeof btoa !== \"function\") {\n throw new Error(\"Your browser environment is missing the global `btoa` function\");\n }\n const bytes = new Uint8Array(value);\n const binary = String.fromCharCode.apply(null, [...bytes]);\n return btoa(binary);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils.d.ts","sourceRoot":"","sources":["../../../src/credential/cryptoUtils.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CACP,CAAC;AAExD,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CAI7E,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.shaHMAC = exports.shaHash = void 0;
|
|
6
|
-
const node_crypto_1 = require("node:crypto");
|
|
7
|
-
const shaHash = async (content) => (0, node_crypto_1.createHash)("sha256").update(content).digest("base64");
|
|
8
|
-
exports.shaHash = shaHash;
|
|
9
|
-
const shaHMAC = async (secret, content) => {
|
|
10
|
-
const decodedSecret = Buffer.from(secret, "base64");
|
|
11
|
-
return (0, node_crypto_1.createHmac)("sha256", decodedSecret).update(content).digest("base64");
|
|
12
|
-
};
|
|
13
|
-
exports.shaHMAC = shaHMAC;
|
|
14
|
-
//# sourceMappingURL=cryptoUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils.js","sourceRoot":"","sources":["../../../src/credential/cryptoUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAAqD;AAE9C,MAAM,OAAO,GAAG,KAAK,EAAE,OAAe,EAAmB,EAAE,CAChE,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAD3C,QAAA,OAAO,WACoC;AAEjD,MAAM,OAAO,GAAG,KAAK,EAAE,MAAc,EAAE,OAAe,EAAmB,EAAE;IAChF,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEpD,OAAO,IAAA,wBAAU,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9E,CAAC,CAAC;AAJW,QAAA,OAAO,WAIlB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHash, createHmac } from \"node:crypto\";\n\nexport const shaHash = async (content: string): Promise<string> =>\n createHash(\"sha256\").update(content).digest(\"base64\");\n\nexport const shaHMAC = async (secret: string, content: string): Promise<string> => {\n const decodedSecret = Buffer.from(secret, \"base64\");\n\n return createHmac(\"sha256\", decodedSecret).update(content).digest(\"base64\");\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils.d.ts","sourceRoot":"","sources":["../../../src/credential/cryptoUtils.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CACP,CAAC;AAExD,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CAI7E,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { createHash, createHmac } from "node:crypto";
|
|
4
|
-
export const shaHash = async (content) => createHash("sha256").update(content).digest("base64");
|
|
5
|
-
export const shaHMAC = async (secret, content) => {
|
|
6
|
-
const decodedSecret = Buffer.from(secret, "base64");
|
|
7
|
-
return createHmac("sha256", decodedSecret).update(content).digest("base64");
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=cryptoUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils.js","sourceRoot":"","sources":["../../../src/credential/cryptoUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,OAAe,EAAmB,EAAE,CAChE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAc,EAAE,OAAe,EAAmB,EAAE;IAChF,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEpD,OAAO,UAAU,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHash, createHmac } from \"node:crypto\";\n\nexport const shaHash = async (content: string): Promise<string> =>\n createHash(\"sha256\").update(content).digest(\"base64\");\n\nexport const shaHMAC = async (secret: string, content: string): Promise<string> => {\n const decodedSecret = Buffer.from(secret, \"base64\");\n\n return createHmac(\"sha256\", decodedSecret).update(content).digest(\"base64\");\n};\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const encodeUTF8: (str: string) => Uint8Array<ArrayBuffer>;
|
|
2
|
-
export declare function encodeUTF8fromBase64(str: string): Uint8Array<ArrayBuffer>;
|
|
3
|
-
export declare function encodeBase64(value: ArrayBuffer): string;
|
|
4
|
-
//# sourceMappingURL=encodeUtils-browser.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encodeUtils-browser.d.mts","sourceRoot":"","sources":["../../../src/credential/encodeUtils-browser.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,UAAU,CAAC,WAAW,CAAkC,CAAC;AAElG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAMzE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAOvD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
export const encodeUTF8 = (str) => new TextEncoder().encode(str);
|
|
4
|
-
export function encodeUTF8fromBase64(str) {
|
|
5
|
-
if (typeof atob !== "function") {
|
|
6
|
-
throw new Error("Your browser environment is missing the global `atob` function");
|
|
7
|
-
}
|
|
8
|
-
const binary = atob(str);
|
|
9
|
-
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
10
|
-
}
|
|
11
|
-
export function encodeBase64(value) {
|
|
12
|
-
if (typeof btoa !== "function") {
|
|
13
|
-
throw new Error("Your browser environment is missing the global `btoa` function");
|
|
14
|
-
}
|
|
15
|
-
const bytes = new Uint8Array(value);
|
|
16
|
-
const binary = String.fromCharCode.apply(null, [...bytes]);
|
|
17
|
-
return btoa(binary);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=encodeUtils-browser.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encodeUtils-browser.mjs","sourceRoot":"","sources":["../../../src/credential/encodeUtils-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAA2B,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAElG,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAkB;IAC7C,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const encodeUTF8 = (str: string): Uint8Array<ArrayBuffer> => new TextEncoder().encode(str);\n\nexport function encodeUTF8fromBase64(str: string): Uint8Array<ArrayBuffer> {\n if (typeof atob !== \"function\") {\n throw new Error(\"Your browser environment is missing the global `atob` function\");\n }\n const binary = atob(str);\n return Uint8Array.from(binary, (char) => char.charCodeAt(0));\n}\n\nexport function encodeBase64(value: ArrayBuffer): string {\n if (typeof btoa !== \"function\") {\n throw new Error(\"Your browser environment is missing the global `btoa` function\");\n }\n const bytes = new Uint8Array(value);\n const binary = String.fromCharCode.apply(null, [...bytes]);\n return btoa(binary);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils.d.ts","sourceRoot":"","sources":["../../../src/credential/cryptoUtils.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CACP,CAAC;AAExD,eAAO,MAAM,OAAO,GAAU,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CAI7E,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
import { createHash, createHmac } from "node:crypto";
|
|
4
|
-
export const shaHash = async (content) => createHash("sha256").update(content).digest("base64");
|
|
5
|
-
export const shaHMAC = async (secret, content) => {
|
|
6
|
-
const decodedSecret = Buffer.from(secret, "base64");
|
|
7
|
-
return createHmac("sha256", decodedSecret).update(content).digest("base64");
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=cryptoUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoUtils.js","sourceRoot":"","sources":["../../../src/credential/cryptoUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,OAAe,EAAmB,EAAE,CAChE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAc,EAAE,OAAe,EAAmB,EAAE;IAChF,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEpD,OAAO,UAAU,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC9E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createHash, createHmac } from \"node:crypto\";\n\nexport const shaHash = async (content: string): Promise<string> =>\n createHash(\"sha256\").update(content).digest(\"base64\");\n\nexport const shaHMAC = async (secret: string, content: string): Promise<string> => {\n const decodedSecret = Buffer.from(secret, \"base64\");\n\n return createHmac(\"sha256\", decodedSecret).update(content).digest(\"base64\");\n};\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const encodeUTF8: (str: string) => Uint8Array<ArrayBuffer>;
|
|
2
|
-
export declare function encodeUTF8fromBase64(str: string): Uint8Array<ArrayBuffer>;
|
|
3
|
-
export declare function encodeBase64(value: ArrayBuffer): string;
|
|
4
|
-
//# sourceMappingURL=encodeUtils-browser.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encodeUtils-browser.d.mts","sourceRoot":"","sources":["../../../src/credential/encodeUtils-browser.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,UAAU,CAAC,WAAW,CAAkC,CAAC;AAElG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAMzE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAOvD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
export const encodeUTF8 = (str) => new TextEncoder().encode(str);
|
|
4
|
-
export function encodeUTF8fromBase64(str) {
|
|
5
|
-
if (typeof atob !== "function") {
|
|
6
|
-
throw new Error("Your browser environment is missing the global `atob` function");
|
|
7
|
-
}
|
|
8
|
-
const binary = atob(str);
|
|
9
|
-
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
10
|
-
}
|
|
11
|
-
export function encodeBase64(value) {
|
|
12
|
-
if (typeof btoa !== "function") {
|
|
13
|
-
throw new Error("Your browser environment is missing the global `btoa` function");
|
|
14
|
-
}
|
|
15
|
-
const bytes = new Uint8Array(value);
|
|
16
|
-
const binary = String.fromCharCode.apply(null, [...bytes]);
|
|
17
|
-
return btoa(binary);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=encodeUtils-browser.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encodeUtils-browser.mjs","sourceRoot":"","sources":["../../../src/credential/encodeUtils-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAA2B,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAElG,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAkB;IAC7C,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const encodeUTF8 = (str: string): Uint8Array<ArrayBuffer> => new TextEncoder().encode(str);\n\nexport function encodeUTF8fromBase64(str: string): Uint8Array<ArrayBuffer> {\n if (typeof atob !== \"function\") {\n throw new Error(\"Your browser environment is missing the global `atob` function\");\n }\n const binary = atob(str);\n return Uint8Array.from(binary, (char) => char.charCodeAt(0));\n}\n\nexport function encodeBase64(value: ArrayBuffer): string {\n if (typeof btoa !== \"function\") {\n throw new Error(\"Your browser environment is missing the global `btoa` function\");\n }\n const bytes = new Uint8Array(value);\n const binary = String.fromCharCode.apply(null, [...bytes]);\n return btoa(binary);\n}\n"]}
|