@azure/notification-hubs 1.2.4-alpha.20240808.1 → 1.2.4-alpha.20240813.3

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.
Files changed (42) hide show
  1. package/dist/api/notification-hubs.d.ts +8 -0
  2. package/dist/browser/auth/hmacSha256-browser.d.mts.map +1 -1
  3. package/dist/browser/auth/hmacSha256-browser.mjs.map +1 -1
  4. package/dist/browser/auth/hmacSha256.common.d.ts +17 -0
  5. package/dist/browser/auth/hmacSha256.common.d.ts.map +1 -0
  6. package/dist/browser/auth/hmacSha256.common.js +11 -0
  7. package/dist/browser/auth/hmacSha256.common.js.map +1 -0
  8. package/dist/browser/auth/hmacSha256.d.ts +1 -16
  9. package/dist/browser/auth/hmacSha256.js +1 -8
  10. package/dist/browser/models/installation.d.ts +8 -0
  11. package/dist/browser/models/installation.d.ts.map +1 -1
  12. package/dist/browser/models/installation.js.map +1 -1
  13. package/dist/commonjs/auth/hmacSha256.common.d.ts +17 -0
  14. package/dist/commonjs/auth/hmacSha256.common.d.ts.map +1 -0
  15. package/dist/commonjs/auth/hmacSha256.common.js +14 -0
  16. package/dist/commonjs/auth/hmacSha256.common.js.map +1 -0
  17. package/dist/commonjs/models/installation.d.ts +8 -0
  18. package/dist/commonjs/models/installation.d.ts.map +1 -1
  19. package/dist/commonjs/models/installation.js.map +1 -1
  20. package/dist/esm/auth/hmacSha256.common.d.ts +17 -0
  21. package/dist/esm/auth/hmacSha256.common.d.ts.map +1 -0
  22. package/dist/esm/auth/hmacSha256.common.js +11 -0
  23. package/dist/esm/auth/hmacSha256.common.js.map +1 -0
  24. package/dist/esm/models/installation.d.ts +8 -0
  25. package/dist/esm/models/installation.d.ts.map +1 -1
  26. package/dist/esm/models/installation.js.map +1 -1
  27. package/dist/models/notification-hubs.d.ts +8 -0
  28. package/dist/notification-hubs.d.ts +8 -0
  29. package/dist/react-native/auth/hmacSha256-react-native.d.mts.map +1 -0
  30. package/dist/react-native/auth/hmacSha256-react-native.mjs.map +1 -0
  31. package/dist/react-native/auth/hmacSha256.common.d.ts +17 -0
  32. package/dist/react-native/auth/hmacSha256.common.d.ts.map +1 -0
  33. package/dist/react-native/auth/hmacSha256.common.js +11 -0
  34. package/dist/react-native/auth/hmacSha256.common.js.map +1 -0
  35. package/dist/react-native/auth/hmacSha256.d.ts +2 -2
  36. package/dist/react-native/auth/hmacSha256.js +2 -6
  37. package/dist/react-native/models/installation.d.ts +8 -0
  38. package/dist/react-native/models/installation.d.ts.map +1 -1
  39. package/dist/react-native/models/installation.js.map +1 -1
  40. package/package.json +7 -17
  41. package/dist/react-native/auth/hmacSha256.d.ts.map +0 -1
  42. package/dist/react-native/auth/hmacSha256.js.map +0 -1
@@ -675,6 +675,14 @@ declare interface InstallationCommon {
675
675
  * The templates for the installation.
676
676
  */
677
677
  templates?: Record<string, InstallationTemplate>;
678
+ /**
679
+ * This parameter is true if the PNS expired the channel.
680
+ */
681
+ readonly pushChannelExpired?: boolean;
682
+ /**
683
+ * The push variables for the installation.
684
+ */
685
+ pushVariables?: Record<string, string>;
678
686
  }
679
687
 
680
688
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256-browser.d.mts","sourceRoot":"","sources":["../../../src/auth/hmacSha256-browser.mts"],"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"}
1
+ {"version":3,"file":"hmacSha256-browser.d.mts","sourceRoot":"","sources":["../../../src/auth/hmacSha256-browser.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hmacSha256-browser.mjs","sourceRoot":"","sources":["../../../src/auth/hmacSha256-browser.mts"],"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
+ {"version":3,"file":"hmacSha256-browser.mjs","sourceRoot":"","sources":["../../../src/auth/hmacSha256-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { signString } 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/auth/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/auth/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
- 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>;
1
+ export { signString } 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 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
- }
3
+ export { signString } from "./hmacSha256.common.js";
11
4
  //# sourceMappingURL=hmacSha256-browser.mjs.map
@@ -26,6 +26,14 @@ export interface InstallationCommon {
26
26
  * The templates for the installation.
27
27
  */
28
28
  templates?: Record<string, InstallationTemplate>;
29
+ /**
30
+ * This parameter is true if the PNS expired the channel.
31
+ */
32
+ readonly pushChannelExpired?: boolean;
33
+ /**
34
+ * The push variables for the installation.
35
+ */
36
+ pushVariables?: Record<string, string>;
29
37
  }
30
38
  /**
31
39
  * Represents an installation with a string based device token.
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH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kB;IACnE;;OAEG;IACH,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACpE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,yBAAyB,GACtC,mBAAmB,CAKrB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,kBAAkB,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,kBAAkB,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyDlC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
1
+ {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmElC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n\n /**\n * This parameter is true if the PNS expired the channel.\n */\n readonly pushChannelExpired?: boolean;\n\n /**\n * The push variables for the installation.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\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/auth/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/auth/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"]}
@@ -26,6 +26,14 @@ export interface InstallationCommon {
26
26
  * The templates for the installation.
27
27
  */
28
28
  templates?: Record<string, InstallationTemplate>;
29
+ /**
30
+ * This parameter is true if the PNS expired the channel.
31
+ */
32
+ readonly pushChannelExpired?: boolean;
33
+ /**
34
+ * The push variables for the installation.
35
+ */
36
+ pushVariables?: Record<string, string>;
29
37
  }
30
38
  /**
31
39
  * Represents an installation with a string based device token.
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":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@
1
- {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA8DlC,0DAKC;AAiBD,sDAKC;AAiBD,0DAKC;AAiBD,kEAOC;AAiBD,0DAKC;AAiBD,4DAOC;AAiBD,8DAOC;AA+CD,8DAOC;AA1MD;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
1
+ {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAwElC,0DAKC;AAiBD,sDAKC;AAiBD,0DAKC;AAiBD,kEAOC;AAiBD,0DAKC;AAiBD,4DAOC;AAiBD,8DAOC;AA+CD,8DAOC;AA1MD;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n\n /**\n * This parameter is true if the PNS expired the channel.\n */\n readonly pushChannelExpired?: boolean;\n\n /**\n * The push variables for the installation.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\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/auth/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/auth/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"]}
@@ -26,6 +26,14 @@ export interface InstallationCommon {
26
26
  * The templates for the installation.
27
27
  */
28
28
  templates?: Record<string, InstallationTemplate>;
29
+ /**
30
+ * This parameter is true if the PNS expired the channel.
31
+ */
32
+ readonly pushChannelExpired?: boolean;
33
+ /**
34
+ * The push variables for the installation.
35
+ */
36
+ pushVariables?: Record<string, string>;
29
37
  }
30
38
  /**
31
39
  * Represents an installation with a string based device token.
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;IAChE;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,uBAAuB,GAAG,iBAAiB,CAKhG;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,uBAAuB;IAC9D;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,uBAAuB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;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACpE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,yBAAyB,GACtC,mBAAmB,CAKrB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,kBAAkB,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,kBAAkB,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,IAAI,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,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,kBAAkB,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,kBAAkB,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyDlC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
1
+ {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmElC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n\n /**\n * This parameter is true if the PNS expired the channel.\n */\n readonly pushChannelExpired?: boolean;\n\n /**\n * The push variables for the installation.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
@@ -1859,6 +1859,14 @@ export declare interface InstallationCommon {
1859
1859
  * The templates for the installation.
1860
1860
  */
1861
1861
  templates?: Record<string, InstallationTemplate>;
1862
+ /**
1863
+ * This parameter is true if the PNS expired the channel.
1864
+ */
1865
+ readonly pushChannelExpired?: boolean;
1866
+ /**
1867
+ * The push variables for the installation.
1868
+ */
1869
+ pushVariables?: Record<string, string>;
1862
1870
  }
1863
1871
 
1864
1872
  /**
@@ -1860,6 +1860,14 @@ export declare interface InstallationCommon {
1860
1860
  * The templates for the installation.
1861
1861
  */
1862
1862
  templates?: Record<string, InstallationTemplate>;
1863
+ /**
1864
+ * This parameter is true if the PNS expired the channel.
1865
+ */
1866
+ readonly pushChannelExpired?: boolean;
1867
+ /**
1868
+ * The push variables for the installation.
1869
+ */
1870
+ pushVariables?: Record<string, string>;
1863
1871
  }
1864
1872
 
1865
1873
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmacSha256-react-native.d.mts","sourceRoot":"","sources":["../../../src/auth/hmacSha256-react-native.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmacSha256-react-native.mjs","sourceRoot":"","sources":["../../../src/auth/hmacSha256-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { signString } 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/auth/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/auth/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 declare function signString(key: string, toSign: string): Promise<string>;
2
- //# sourceMappingURL=hmacSha256.d.ts.map
1
+ export { signString } 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
- import { createHmac } from "node:crypto";
4
- export async function signString(key, toSign) {
5
- const hmac = createHmac("sha256", key).update(toSign).digest("base64");
6
- return encodeURIComponent(hmac);
7
- }
8
- //# sourceMappingURL=hmacSha256.js.map
3
+ export { signString } from "./hmacSha256.common.js";
4
+ //# sourceMappingURL=hmacSha256-react-native.mjs.map
@@ -26,6 +26,14 @@ export interface InstallationCommon {
26
26
  * The templates for the installation.
27
27
  */
28
28
  templates?: Record<string, InstallationTemplate>;
29
+ /**
30
+ * This parameter is true if the PNS expired the channel.
31
+ */
32
+ readonly pushChannelExpired?: boolean;
33
+ /**
34
+ * The push variables for the installation.
35
+ */
36
+ pushVariables?: Record<string, string>;
29
37
  }
30
38
  /**
31
39
  * Represents an installation with a string based device token.
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;I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AgB,yBAAyB,CACvC,YAAY,EAAE,yBAAyB,GACtC,mBAAmB,CAKrB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,kBAAkB,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,kBAAkB,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyDlC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
1
+ {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/models/installation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmElC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,MAAM,IAChB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqC;IACzE,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,YAAqC;IAC3E,uCACK,YAAY,KACf,QAAQ,EAAE,OAAO,IACjB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,QAAQ,IAClB;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqC;IAErC,uCACK,YAAY,KACf,QAAQ,EAAE,KAAK,IACf;AACJ,CAAC;AA0CD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAuC;IAEvC,uCACK,YAAY,KACf,QAAQ,EAAE,SAAS,IACnB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Represents an installation for a device for Notification Hubs.\n */\nexport interface InstallationCommon {\n /**\n * The ID for the installation.\n */\n installationId: string;\n\n /**\n * The User ID for the installation used for targeting.\n */\n userId?: string;\n\n /**\n * The installation expiration time.\n */\n readonly expirationTime?: string;\n\n /**\n * The last update date of the installation.\n */\n readonly lastUpdate?: string;\n\n /**\n * The tags used for targeting this installation.\n */\n tags?: string[];\n\n /**\n * The templates for the installation.\n */\n templates?: Record<string, InstallationTemplate>;\n\n /**\n * This parameter is true if the PNS expired the channel.\n */\n readonly pushChannelExpired?: boolean;\n\n /**\n * The push variables for the installation.\n */\n pushVariables?: Record<string, string>;\n}\n\n/**\n * Represents an installation with a string based device token.\n */\nexport interface DeviceTokenInstallation extends InstallationCommon {\n /**\n * The push channel for a device.\n */\n pushChannel: string;\n}\n\n/**\n * Represents an Apple APNs based installation.\n */\nexport interface AppleInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"apns\";\n}\n\n/**\n * Creates an Apple based installation.\n * @param installation - A partial installation used to create the Apple installation.\n * @returns The newly created Apple installation.\n */\nexport function createAppleInstallation(installation: DeviceTokenInstallation): AppleInstallation {\n return {\n ...installation,\n platform: \"apns\",\n };\n}\n\n/**\n * Represents an Amazon Device Messaging (ADM) based installation.\n */\nexport interface AdmInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"adm\";\n}\n\n/**\n * Creates an Amazon Device Messaging (ADM) based installation.\n * @param installation - A partial installation used to create the ADM installation.\n * @returns The newly created ADM installation.\n */\nexport function createAdmInstallation(installation: DeviceTokenInstallation): AdmInstallation {\n return {\n ...installation,\n platform: \"adm\",\n };\n}\n\n/**\n * Represents a Baidu based installation.\n */\nexport interface BaiduInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"baidu\";\n}\n\n/**\n * Creates a Baidu based installation.\n * @param installation - A partial installation used to create the Baidu installation.\n * @returns The newly created Baidu installation.\n */\nexport function createBaiduInstallation(installation: DeviceTokenInstallation): BaiduInstallation {\n return {\n ...installation,\n platform: \"baidu\",\n };\n}\n\n/**\n * Represents a Firebase Legacy HTTP installation.\n */\nexport interface FcmLegacyInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"gcm\";\n}\n\n/**\n * Creates a Firebase legacy HTTP based installation.\n * @param installation - A partial installation used to create the Firebase Legacy HTTP installation.\n * @returns The newly created Baidu installation.\n */\nexport function createFcmLegacyInstallation(\n installation: DeviceTokenInstallation,\n): FcmLegacyInstallation {\n return {\n ...installation,\n platform: \"gcm\",\n };\n}\n\n/**\n * Represents an Firebase V1 Cloud Messaging based installation.\n */\nexport interface FcmV1Installation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"fcmv1\";\n}\n\n/**\n * Creates an Firebase V1 Cloud Messaging based installation.\n * @param installation - A partial installation used to create the Firebase V1 Cloud Messaging installation.\n * @returns The newly created Firebase V1 Cloud Messaging installation.\n */\nexport function createFcmV1Installation(installation: DeviceTokenInstallation): FcmV1Installation {\n return {\n ...installation,\n platform: \"fcmv1\",\n };\n}\n\n/**\n * Represents a Xiaomi based installation.\n */\nexport interface XiaomiInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"xiaomi\";\n}\n\n/**\n * Creates a Xiaomi based installation.\n * @param installation - A partial installation used to create the Xiaomi installation.\n * @returns The newly created Xiaomi installation.\n */\nexport function createXiaomiInstallation(\n installation: DeviceTokenInstallation,\n): XiaomiInstallation {\n return {\n ...installation,\n platform: \"xiaomi\",\n };\n}\n\n/**\n * Represents a Windows Notification Services (WNS) based installation.\n */\nexport interface WindowsInstallation extends DeviceTokenInstallation {\n /**\n * The platform for the installation.\n */\n platform: \"wns\";\n}\n\n/**\n * Creates a Windows Notification Services (WNS) based installation.\n * @param installation - A partial installation used to create the WNS installation.\n * @returns The newly created WNS installation.\n */\nexport function createWindowsInstallation(\n installation: DeviceTokenInstallation,\n): WindowsInstallation {\n return {\n ...installation,\n platform: \"wns\",\n };\n}\n\n/**\n * Represents the push channel for a Browser Push installation.\n */\nexport interface BrowserPushChannel {\n /**\n * The P256DH for the browser push installation.\n */\n p256dh: string;\n\n /**\n * The auth secret for the browser push installation.\n */\n auth: string;\n\n /**\n * The endpoint URL for the browser push installation.\n */\n endpoint: string;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallationCommon extends InstallationCommon {\n /**\n * The push channel for the Web Push API.\n */\n pushChannel: BrowserPushChannel;\n}\n\n/**\n * Represents a Browser/Web Push based installation.\n */\nexport interface BrowserInstallation extends BrowserInstallationCommon {\n /**\n * The platform for the installation.\n */\n platform: \"browser\";\n}\n\n/**\n * Creates a Web Push based installation.\n * @param installation - A partial installation used to create the Web Push installation.\n * @returns The newly created Web Push installation.\n */\nexport function createBrowserInstallation(\n installation: BrowserInstallationCommon,\n): BrowserInstallation {\n return {\n ...installation,\n platform: \"browser\",\n };\n}\n\n/**\n * Represents the types of installations available in Notification Hubs.\n */\nexport type Installation =\n | AppleInstallation\n | AdmInstallation\n | BaiduInstallation\n | BrowserInstallation\n | FcmLegacyInstallation\n | FcmV1Installation\n | XiaomiInstallation\n | WindowsInstallation;\n\n/**\n * Represents an installation template.\n */\nexport interface InstallationTemplate {\n /**\n * The body for the installation template.\n */\n body: string;\n\n /**\n * Headers to include for the template send.\n */\n headers: Record<string, string>;\n\n /**\n * The tags to include for the template.\n */\n tags?: string[];\n}\n\n/**\n * Represents the JSON Patch types of add, remove and replace.\n */\nexport type JsonPatchOperation = \"add\" | \"remove\" | \"replace\";\n\n/**\n * Represents a patch operation.\n */\nexport interface JsonPatch {\n /**\n * The patch operation.\n */\n op: JsonPatchOperation;\n\n /**\n * The path for the patch operation.\n */\n path: string;\n\n /**\n * The value to add or replace for the operation.\n */\n value?: string;\n}\n\n/**\n * Represents the types of push channels available for Notification Hubs.\n */\nexport type PushHandle = BrowserPushChannel | string;\n"]}
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@azure/notification-hubs",
3
- "version": "1.2.4-alpha.20240808.1",
3
+ "version": "1.2.4-alpha.20240813.3",
4
4
  "description": "Azure Notification Hubs SDK for JavaScript",
5
5
  "sdk-type": "client",
6
6
  "main": "./dist/commonjs/index.js",
7
+ "browser": "./dist/browser/index.js",
8
+ "react-native": "./dist/react-native/index.js",
7
9
  "type": "module",
8
10
  "//metadata": {
9
11
  "constantPaths": [
@@ -65,15 +67,15 @@
65
67
  "@azure-tools/test-recorder": "^4.0.0",
66
68
  "@microsoft/api-extractor": "^7.43.7",
67
69
  "@types/node": "^18.0.0",
68
- "@vitest/browser": "^1.6.0",
69
- "@vitest/coverage-istanbul": "^1.6.0",
70
+ "@vitest/browser": "^2.0.5",
71
+ "@vitest/coverage-istanbul": "^2.0.5",
70
72
  "dotenv": "^16.4.5",
71
73
  "eslint": "^8.57.0",
72
74
  "playwright": "^1.43.0",
73
75
  "rimraf": "^5.0.5",
74
- "tshy": "^1.17.0",
76
+ "tshy": "^2.0.0",
75
77
  "typescript": "~5.5.3",
76
- "vitest": "^1.6.0"
78
+ "vitest": "^2.0.5"
77
79
  },
78
80
  "dependencies": {
79
81
  "@azure/core-auth": "^1.7.2",
@@ -109,66 +111,54 @@
109
111
  "./package.json": "./package.json",
110
112
  ".": {
111
113
  "browser": {
112
- "source": "./src/index.ts",
113
114
  "types": "./dist/browser/index.d.ts",
114
115
  "default": "./dist/browser/index.js"
115
116
  },
116
117
  "react-native": {
117
- "source": "./src/index.ts",
118
118
  "types": "./dist/react-native/index.d.ts",
119
119
  "default": "./dist/react-native/index.js"
120
120
  },
121
121
  "import": {
122
- "source": "./src/index.ts",
123
122
  "types": "./dist/esm/index.d.ts",
124
123
  "default": "./dist/esm/index.js"
125
124
  },
126
125
  "require": {
127
- "source": "./src/index.ts",
128
126
  "types": "./dist/commonjs/index.d.ts",
129
127
  "default": "./dist/commonjs/index.js"
130
128
  }
131
129
  },
132
130
  "./api": {
133
131
  "browser": {
134
- "source": "./src/api/index.ts",
135
132
  "types": "./dist/browser/api/index.d.ts",
136
133
  "default": "./dist/browser/api/index.js"
137
134
  },
138
135
  "react-native": {
139
- "source": "./src/api/index.ts",
140
136
  "types": "./dist/react-native/api/index.d.ts",
141
137
  "default": "./dist/react-native/api/index.js"
142
138
  },
143
139
  "import": {
144
- "source": "./src/api/index.ts",
145
140
  "types": "./dist/esm/api/index.d.ts",
146
141
  "default": "./dist/esm/api/index.js"
147
142
  },
148
143
  "require": {
149
- "source": "./src/api/index.ts",
150
144
  "types": "./dist/commonjs/api/index.d.ts",
151
145
  "default": "./dist/commonjs/api/index.js"
152
146
  }
153
147
  },
154
148
  "./models": {
155
149
  "browser": {
156
- "source": "./src/models/index.ts",
157
150
  "types": "./dist/browser/models/index.d.ts",
158
151
  "default": "./dist/browser/models/index.js"
159
152
  },
160
153
  "react-native": {
161
- "source": "./src/models/index.ts",
162
154
  "types": "./dist/react-native/models/index.d.ts",
163
155
  "default": "./dist/react-native/models/index.js"
164
156
  },
165
157
  "import": {
166
- "source": "./src/models/index.ts",
167
158
  "types": "./dist/esm/models/index.d.ts",
168
159
  "default": "./dist/esm/models/index.js"
169
160
  },
170
161
  "require": {
171
- "source": "./src/models/index.ts",
172
162
  "types": "./dist/commonjs/models/index.d.ts",
173
163
  "default": "./dist/commonjs/models/index.js"
174
164
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"hmacSha256.d.ts","sourceRoot":"","sources":["../../../src/auth/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/auth/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"]}