@azure/notification-hubs 1.0.3-alpha.20231002.1 → 1.0.3-alpha.20231011.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.
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256.browser.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqClC,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 class TextEncoder {\n encode(input?: string): Uint8Array;\n }\n\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
+ {"version":3,"file":"hmacSha256.browser.js","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/notification-hubs",
3
- "version": "1.0.3-alpha.20231002.1",
3
+ "version": "1.0.3-alpha.20231011.2",
4
4
  "description": "Azure Notification Hubs SDK for JavaScript",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.cjs",
@@ -45,10 +45,11 @@
45
45
  },
46
46
  "scripts": {
47
47
  "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
48
+ "bundle": "tsc -p . && dev-tool run bundle",
48
49
  "build:samples": "echo Obsolete",
49
- "build:test:browser": "tsc -p . && rollup --bundleConfigAsCjs -c rollup.test.config.cjs 2>&1",
50
- "build:test:node": "tsc -p . && dev-tool run bundle",
51
- "build:test": "tsc -p . && rollup --bundleConfigAsCjs -c rollup.test.config.cjs 2>&1",
50
+ "build:test:browser": "npm run bundle",
51
+ "build:test:node": "npm run bundle",
52
+ "build:test": "npm run bundle",
52
53
  "build:types": "downlevel-dts types/latest/ types/3.1/",
53
54
  "build": "npm run build:test && api-extractor run --local && npm run build:types",
54
55
  "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
@@ -64,7 +65,7 @@
64
65
  "pack": "npm pack 2>&1",
65
66
  "test:browser": "npm run clean && npm run build:test && npm run integration-test:browser",
66
67
  "test:node": "npm run clean && tsc -p . && npm run integration-test:node",
67
- "test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
68
+ "test": "npm run clean && tsc -p . && npm run unit-test:node && npm run bundle && npm run unit-test:browser && npm run integration-test",
68
69
  "unit-test:browser": "karma start karma.conf.cjs --single-run",
69
70
  "unit-test:node": "mocha --exclude \"test/**/browser/*.spec.ts\" \"test/internal/unit/{,!(browser)/**/}*.spec.ts\" \"test/public/unit/{,!(browser)/**/}*.spec.ts\"",
70
71
  "unit-test": "npm run unit-test:node && npm run unit-test:browser"
@@ -80,7 +81,7 @@
80
81
  ],
81
82
  "repository": "github:Azure/azure-sdk-for-js",
82
83
  "engines": {
83
- "node": ">=14.0.0"
84
+ "node": ">=16.0.0"
84
85
  },
85
86
  "keywords": [
86
87
  "azure",
@@ -101,16 +102,9 @@
101
102
  "@azure-tools/test-recorder": "^3.0.0",
102
103
  "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
103
104
  "@microsoft/api-extractor": "^7.31.1",
104
- "@rollup/plugin-commonjs": "^25.0.2",
105
- "@rollup/plugin-inject": "^5.0.3",
106
- "@rollup/plugin-json": "^6.0.0",
107
- "@rollup/plugin-multi-entry": "^6.0.0",
108
- "@rollup/plugin-node-resolve": "^15.1.0",
109
- "@rollup/plugin-replace": "^5.0.2",
110
- "@rollup/plugin-typescript": "^11.1.1",
111
105
  "@types/chai": "^4.3.1",
112
106
  "@types/mocha": "^10.0.0",
113
- "@types/node": "^14.0.0",
107
+ "@types/node": "^16.0.0",
114
108
  "chai": "^4.3.6",
115
109
  "dotenv": "^16.0.0",
116
110
  "downlevel-dts": "^0.10.0",
@@ -133,8 +127,6 @@
133
127
  "prettier": "^2.5.1",
134
128
  "puppeteer": "^19.2.2",
135
129
  "rimraf": "^3.0.2",
136
- "rollup": "^3.25.3",
137
- "rollup-plugin-shim": "^1.0.0",
138
130
  "ts-node": "^10.9.1",
139
131
  "typescript": "~5.0.0",
140
132
  "util": "^0.12.4"
@@ -1,7 +1,4 @@
1
1
  declare global {
2
- class TextEncoder {
3
- encode(input?: string): Uint8Array;
4
- }
5
2
  interface HmacImportParams {
6
3
  name: string;
7
4
  hash: {
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256.browser.d.ts","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,WAAW;QACf,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU;KACnC;IAED,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"}
1
+ {"version":3,"file":"hmacSha256.browser.d.ts","sourceRoot":"","sources":["../../../src/auth/hmacSha256.browser.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"}