@azure/notification-hubs 1.0.1-alpha.20230320.2 → 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.
@@ -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 self.crypto.subtle.importKey("raw", enc.encode(key), algorithm, false, ["sign", "verify"]);
8
- const signature = await self.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));
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,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CACrD,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,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7F,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 self.crypto.subtle.importKey(\n \"raw\",\n enc.encode(key),\n algorithm,\n false,\n [\"sign\", \"verify\"]\n );\n const signature = await self.crypto.subtle.sign(algorithm, extractedKey, enc.encode(toSign));\n const digest = btoa(String.fromCharCode(...new Uint8Array(signature)));\n\n return encodeURIComponent(digest);\n}\n"]}
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"]}
@@ -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, "tags") || objectHasProperty(options, "enableTestSend");
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,MAAM,CAAC,IAAI,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AAC5F,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 objectHasProperty(options, \"tags\") || objectHasProperty(options, \"enableTestSend\");\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"]}
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/notification-hubs",
3
- "version": "1.0.1-alpha.20230320.2",
3
+ "version": "1.0.1",
4
4
  "description": "Azure Notification Hubs SDK for JavaScript",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.js",
@@ -97,10 +97,10 @@
97
97
  "sideEffects": false,
98
98
  "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
99
99
  "devDependencies": {
100
- "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
101
- "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
100
+ "@azure/dev-tool": "^1.0.0",
101
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
102
102
  "@azure-tools/test-recorder": "^3.0.0",
103
- "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
103
+ "@azure/test-utils": "^1.0.0",
104
104
  "@microsoft/api-extractor": "^7.31.1",
105
105
  "@rollup/plugin-commonjs": "^24.0.0",
106
106
  "@rollup/plugin-inject": "^5.0.0",
@@ -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,CAe7E"}
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,CAE9F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,6BAA6B,CAE1C"}
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"}