@azure/notification-hubs 1.0.0 → 1.0.1
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 +8 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist-esm/src/auth/hmacSha256.browser.js +2 -2
- package/dist-esm/src/auth/hmacSha256.browser.js.map +1 -1
- package/dist-esm/src/utils/constants.js +1 -1
- package/dist-esm/src/utils/constants.js.map +1 -1
- package/dist-esm/src/utils/optionUtils.js +1 -1
- package/dist-esm/src/utils/optionUtils.js.map +1 -1
- package/package.json +1 -1
- package/types/src/auth/hmacSha256.browser.d.ts.map +1 -1
- package/types/src/utils/optionUtils.d.ts.map +1 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
export async function signString(key, toSign) {
|
|
5
5
|
const enc = new TextEncoder();
|
|
6
6
|
const algorithm = { name: "HMAC", hash: { name: "SHA-256" } };
|
|
7
|
-
const extractedKey = await
|
|
8
|
-
const signature = await
|
|
7
|
+
const extractedKey = await globalThis.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
|
|
8
|
+
const signature = await globalThis.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
|
|
9
9
|
const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
10
10
|
return encodeURIComponent(digest);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmacSha256.browser.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,2BAA2B;AAE3B,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,
|
|
1
|
+
{"version":3,"file":"hmacSha256.browser.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,2BAA2B;AAE3B,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\n/// <reference lib=\"dom\" />\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,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
export const SDK_VERSION = "1.0.
|
|
3
|
+
export const SDK_VERSION = "1.0.1";
|
|
4
4
|
export const JSON_CONTENT_TYPE = "application/json;charset=utf-8";
|
|
5
5
|
export const XML_CONTENT_TYPE = "application/xml";
|
|
6
6
|
export const STREAM_CONTENT_TYPE = "application/octet-stream";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.0.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const SDK_VERSION: string = \"1.0.1\";\n\nexport const JSON_CONTENT_TYPE = \"application/json;charset=utf-8\";\nexport const XML_CONTENT_TYPE = \"application/xml\";\nexport const STREAM_CONTENT_TYPE = \"application/octet-stream\";\n\nexport const WNS_TYPE_NAME = \"X-WNS-Type\";\nexport const WNS_RAW = \"wns/raw\";\nexport const WNS_BADGE = \"wns/badge\";\nexport const WNS_TITLE = \"wns/tile\";\nexport const WNS_TOAST = \"wns/toast\";\n"]}
|
|
@@ -7,7 +7,7 @@ import { objectHasProperty } from "@azure/core-util";
|
|
|
7
7
|
* @returns true if SendNotificationOptions otherwise false.
|
|
8
8
|
*/
|
|
9
9
|
export function isSendNotificationOptions(options) {
|
|
10
|
-
return objectHasProperty(options, "
|
|
10
|
+
return (objectHasProperty(options, "tagExpression") || objectHasProperty(options, "enableTestSend"));
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Determines whether the options are of type DirectSendNotificationOptions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionUtils.js","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO,iBAAiB,CAAC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"optionUtils.js","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO,CACL,iBAAiB,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAC5F,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAAgB;IAEhB,OAAO,iBAAiB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { objectHasProperty } from \"@azure/core-util\";\n\n/**\n * Determines whether the options are of type SendNotificationOptions.\n * @param options - The options to test if SendNotificationOptions.\n * @returns true if SendNotificationOptions otherwise false.\n */\nexport function isSendNotificationOptions(options: unknown): options is SendNotificationOptions {\n return (\n objectHasProperty(options, \"tagExpression\") || objectHasProperty(options, \"enableTestSend\")\n );\n}\n\n/**\n * Determines whether the options are of type DirectSendNotificationOptions.\n * @param options - The options to test if DirectSendNotificationOptions.\n * @returns true if DirectSendNotificationOptions otherwise false.\n */\nexport function isDirectSendNotificationOptions(\n options: unknown\n): options is DirectSendNotificationOptions {\n return objectHasProperty(options, \"deviceHandle\");\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmacSha256.browser.d.ts","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.ts"],"names":[],"mappings":";AAKA,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"hmacSha256.browser.d.ts","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.ts"],"names":[],"mappings":";AAKA,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG9F;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,uBAAuB,
|
|
1
|
+
{"version":3,"file":"optionUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG9F;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,uBAAuB,CAI9F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,6BAA6B,CAE1C"}
|