@azure/notification-hubs 1.2.4-alpha.20240628.1 → 1.2.4-alpha.20240704.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/api/notification-hubs.d.ts +0 -2
  2. package/dist/browser/api/clientContext.d.ts +0 -1
  3. package/dist/browser/api/clientContext.d.ts.map +1 -1
  4. package/dist/browser/api/internal/_client.d.ts +0 -1
  5. package/dist/browser/api/internal/_client.d.ts.map +1 -1
  6. package/dist/commonjs/api/beginSubmitNotificationHubJob.js +1 -2
  7. package/dist/commonjs/api/beginSubmitNotificationHubJob.js.map +1 -1
  8. package/dist/commonjs/api/cancelScheduledNotification.js +1 -2
  9. package/dist/commonjs/api/cancelScheduledNotification.js.map +1 -1
  10. package/dist/commonjs/api/clientContext.d.ts +0 -1
  11. package/dist/commonjs/api/clientContext.d.ts.map +1 -1
  12. package/dist/commonjs/api/clientContext.js +1 -2
  13. package/dist/commonjs/api/clientContext.js.map +1 -1
  14. package/dist/commonjs/api/createOrUpdateInstallation.js +1 -2
  15. package/dist/commonjs/api/createOrUpdateInstallation.js.map +1 -1
  16. package/dist/commonjs/api/createOrUpdateRegistration.js +1 -2
  17. package/dist/commonjs/api/createOrUpdateRegistration.js.map +1 -1
  18. package/dist/commonjs/api/createRegistration.js +1 -2
  19. package/dist/commonjs/api/createRegistration.js.map +1 -1
  20. package/dist/commonjs/api/createRegistrationId.js +1 -2
  21. package/dist/commonjs/api/createRegistrationId.js.map +1 -1
  22. package/dist/commonjs/api/deleteInstallation.js +1 -2
  23. package/dist/commonjs/api/deleteInstallation.js.map +1 -1
  24. package/dist/commonjs/api/deleteRegistration.js +1 -2
  25. package/dist/commonjs/api/deleteRegistration.js.map +1 -1
  26. package/dist/commonjs/api/getFeedbackContainerUrl.js +1 -2
  27. package/dist/commonjs/api/getFeedbackContainerUrl.js.map +1 -1
  28. package/dist/commonjs/api/getInstallation.js +1 -2
  29. package/dist/commonjs/api/getInstallation.js.map +1 -1
  30. package/dist/commonjs/api/getNotificationHubJob.js +1 -2
  31. package/dist/commonjs/api/getNotificationHubJob.js.map +1 -1
  32. package/dist/commonjs/api/getNotificationOutcomeDetails.js +1 -2
  33. package/dist/commonjs/api/getNotificationOutcomeDetails.js.map +1 -1
  34. package/dist/commonjs/api/getRegistration.js +1 -2
  35. package/dist/commonjs/api/getRegistration.js.map +1 -1
  36. package/dist/commonjs/api/internal/_client.d.ts +0 -1
  37. package/dist/commonjs/api/internal/_client.d.ts.map +1 -1
  38. package/dist/commonjs/api/internal/_client.js +4 -5
  39. package/dist/commonjs/api/internal/_client.js.map +1 -1
  40. package/dist/commonjs/api/internal/_createOrUpdateRegistrationDescription.js +1 -2
  41. package/dist/commonjs/api/internal/_createOrUpdateRegistrationDescription.js.map +1 -1
  42. package/dist/commonjs/api/internal/_listRegistrations.js +2 -3
  43. package/dist/commonjs/api/internal/_listRegistrations.js.map +1 -1
  44. package/dist/commonjs/api/listNotificationHubJobs.js +1 -2
  45. package/dist/commonjs/api/listNotificationHubJobs.js.map +1 -1
  46. package/dist/commonjs/api/listRegistrations.js +1 -2
  47. package/dist/commonjs/api/listRegistrations.js.map +1 -1
  48. package/dist/commonjs/api/listRegistrationsByChannel.js +1 -2
  49. package/dist/commonjs/api/listRegistrationsByChannel.js.map +1 -1
  50. package/dist/commonjs/api/listRegistrationsByTag.js +1 -2
  51. package/dist/commonjs/api/listRegistrationsByTag.js.map +1 -1
  52. package/dist/commonjs/api/scheduleNotification.js +1 -2
  53. package/dist/commonjs/api/scheduleNotification.js.map +1 -1
  54. package/dist/commonjs/api/sendNotification.js +1 -2
  55. package/dist/commonjs/api/sendNotification.js.map +1 -1
  56. package/dist/commonjs/api/submitNotificationHubJob.js +1 -2
  57. package/dist/commonjs/api/submitNotificationHubJob.js.map +1 -1
  58. package/dist/commonjs/api/updateInstallation.js +1 -2
  59. package/dist/commonjs/api/updateInstallation.js.map +1 -1
  60. package/dist/commonjs/api/updateRegistration.js +1 -2
  61. package/dist/commonjs/api/updateRegistration.js.map +1 -1
  62. package/dist/commonjs/auth/connectionStringUtils.js +2 -3
  63. package/dist/commonjs/auth/connectionStringUtils.js.map +1 -1
  64. package/dist/commonjs/auth/hmacSha256.js +1 -2
  65. package/dist/commonjs/auth/hmacSha256.js.map +1 -1
  66. package/dist/commonjs/models/installation.js +8 -9
  67. package/dist/commonjs/models/installation.js.map +1 -1
  68. package/dist/commonjs/models/notification.js +13 -14
  69. package/dist/commonjs/models/notification.js.map +1 -1
  70. package/dist/commonjs/models/notificationBodyBuilder.js +6 -7
  71. package/dist/commonjs/models/notificationBodyBuilder.js.map +1 -1
  72. package/dist/commonjs/models/registration.js +16 -17
  73. package/dist/commonjs/models/registration.js.map +1 -1
  74. package/dist/commonjs/models/tagExpressionBuilder.js +1 -2
  75. package/dist/commonjs/models/tagExpressionBuilder.js.map +1 -1
  76. package/dist/commonjs/serializers/notificationDetailsSerializer.js +1 -2
  77. package/dist/commonjs/serializers/notificationDetailsSerializer.js.map +1 -1
  78. package/dist/commonjs/serializers/notificationHubJobSerializer.js +3 -4
  79. package/dist/commonjs/serializers/notificationHubJobSerializer.js.map +1 -1
  80. package/dist/commonjs/serializers/notificationOutcomeSerializer.js +1 -2
  81. package/dist/commonjs/serializers/notificationOutcomeSerializer.js.map +1 -1
  82. package/dist/commonjs/utils/notificationUtils.js +1 -2
  83. package/dist/commonjs/utils/notificationUtils.js.map +1 -1
  84. package/dist/commonjs/utils/optionUtils.js +2 -3
  85. package/dist/commonjs/utils/optionUtils.js.map +1 -1
  86. package/dist/commonjs/utils/registrationUtils.js +1 -2
  87. package/dist/commonjs/utils/registrationUtils.js.map +1 -1
  88. package/dist/commonjs/utils/utils.js +11 -12
  89. package/dist/commonjs/utils/utils.js.map +1 -1
  90. package/dist/commonjs/utils/xmlUtils.js +5 -5
  91. package/dist/commonjs/utils/xmlUtils.js.map +1 -1
  92. package/dist/esm/api/clientContext.d.ts +0 -1
  93. package/dist/esm/api/clientContext.d.ts.map +1 -1
  94. package/dist/esm/api/internal/_client.d.ts +0 -1
  95. package/dist/esm/api/internal/_client.d.ts.map +1 -1
  96. package/dist/react-native/api/clientContext.d.ts +0 -1
  97. package/dist/react-native/api/clientContext.d.ts.map +1 -1
  98. package/dist/react-native/api/internal/_client.d.ts +0 -1
  99. package/dist/react-native/api/internal/_client.d.ts.map +1 -1
  100. package/package.json +5 -4
@@ -2,7 +2,17 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getTagsOrUndefined = exports.getDateOrUndefined = exports.getDate = exports.getFloatOrUndefined = exports.getFloat = exports.getIntegerOrUndefined = exports.getInteger = exports.getStringOrUndefined = exports.getString = exports.isString = exports.isDefined = void 0;
5
+ exports.isDefined = isDefined;
6
+ exports.isString = isString;
7
+ exports.getString = getString;
8
+ exports.getStringOrUndefined = getStringOrUndefined;
9
+ exports.getInteger = getInteger;
10
+ exports.getIntegerOrUndefined = getIntegerOrUndefined;
11
+ exports.getFloat = getFloat;
12
+ exports.getFloatOrUndefined = getFloatOrUndefined;
13
+ exports.getDate = getDate;
14
+ exports.getDateOrUndefined = getDateOrUndefined;
15
+ exports.getTagsOrUndefined = getTagsOrUndefined;
6
16
  /**
7
17
  * Helper TypeGuard that checks if something is defined or not.
8
18
  * @param thing - Anything
@@ -11,7 +21,6 @@ exports.getTagsOrUndefined = exports.getDateOrUndefined = exports.getDate = expo
11
21
  function isDefined(thing) {
12
22
  return typeof thing !== "undefined" && thing !== null;
13
23
  }
14
- exports.isDefined = isDefined;
15
24
  /**
16
25
  * Helper TypeGuard that checks if something is a string or not.
17
26
  * @param thing - Anything
@@ -20,7 +29,6 @@ exports.isDefined = isDefined;
20
29
  function isString(thing) {
21
30
  return typeof thing === "string" || thing instanceof String;
22
31
  }
23
- exports.isString = isString;
24
32
  /**
25
33
  * @internal
26
34
  * Helper utility to retrieve `string` value from given string,
@@ -33,7 +41,6 @@ function getString(value, nameOfProperty) {
33
41
  }
34
42
  return result;
35
43
  }
36
- exports.getString = getString;
37
44
  /**
38
45
  * @internal
39
46
  * Helper utility to retrieve `string` value from given input,
@@ -46,7 +53,6 @@ function getStringOrUndefined(value) {
46
53
  }
47
54
  return value.toString();
48
55
  }
49
- exports.getStringOrUndefined = getStringOrUndefined;
50
56
  /**
51
57
  * @internal
52
58
  * Helper utility to retrieve `integer` value from given string,
@@ -59,7 +65,6 @@ function getInteger(value, nameOfProperty) {
59
65
  }
60
66
  return result;
61
67
  }
62
- exports.getInteger = getInteger;
63
68
  /**
64
69
  * @internal
65
70
  * Helper utility to retrieve `integer` value from given string,
@@ -73,7 +78,6 @@ function getIntegerOrUndefined(value) {
73
78
  const result = parseInt(value.toString());
74
79
  return isNaN(result) ? undefined : result;
75
80
  }
76
- exports.getIntegerOrUndefined = getIntegerOrUndefined;
77
81
  /**
78
82
  * @internal
79
83
  * Helper utility to retrieve `float` value from given string,
@@ -86,7 +90,6 @@ function getFloat(value, nameOfProperty) {
86
90
  }
87
91
  return result;
88
92
  }
89
- exports.getFloat = getFloat;
90
93
  /**
91
94
  * @internal
92
95
  * Helper utility to retrieve `float` value from given string,
@@ -100,7 +103,6 @@ function getFloatOrUndefined(value) {
100
103
  const result = parseFloat(value.toString());
101
104
  return Number.isNaN(result) ? undefined : result;
102
105
  }
103
- exports.getFloatOrUndefined = getFloatOrUndefined;
104
106
  /**
105
107
  * @internal
106
108
  * Helper utility to convert ISO-8601 time into Date type.
@@ -112,7 +114,6 @@ function getDate(value, nameOfProperty) {
112
114
  }
113
115
  return result;
114
116
  }
115
- exports.getDate = getDate;
116
117
  /**
117
118
  * @internal
118
119
  * Helper utility to convert ISO-8601 time into Date type,
@@ -127,7 +128,6 @@ function getDateOrUndefined(value) {
127
128
  const result = new Date(stringValue.toString());
128
129
  return Number.isNaN(+result) ? undefined : result;
129
130
  }
130
- exports.getDateOrUndefined = getDateOrUndefined;
131
131
  /**
132
132
  * @internal
133
133
  * Helper utility to parse tags from a comma separated string.
@@ -140,5 +140,4 @@ function getTagsOrUndefined(value) {
140
140
  }
141
141
  return result.split(",");
142
142
  }
143
- exports.getTagsOrUndefined = getTagsOrUndefined;
144
143
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;GAIG;AACH,SAAgB,SAAS,CAAI,KAA2B;IACtD,OAAO,OAAO,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,IAAI,CAAC;AACxD,CAAC;AAFD,8BAEC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC;AAFD,4BAEC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAc,EAAE,cAAsB;IAC9D,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,IAAI,cAAc,0EAA0E,CAC7F,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,8BAQC;AAED;;;;GAIG;AACH,6EAA6E;AAC7E,SAAgB,oBAAoB,CAAC,KAAU;IAC7C,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AALD,oDAKC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CAAC,KAAc,EAAE,cAAsB;IAC/D,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC5C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC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AAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,IAAI,cAAc,wEAAwE,CAC3F,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,0BAQC;AAED;;;;GAIG;AACH,6EAA6E;AAC7E,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAPD,gDAOC;AAED;;;GAGG;AACH,6EAA6E;AAC7E,SAAgB,kBAAkB,CAAC,KAAW;IAC5C,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAND,gDAMC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n * @internal\n */\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n\nexport type NullableRecord = Record<string, string | undefined>;\nexport type NonNullableRecord = Record<string, NonNullable<NullableRecord[string]>>;\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAOlC,8BAEC;AAOD,4BAEC;AAOD,8BAQC;AAQD,oDAKC;AAOD,gCAQC;AAQD,sDAMC;AAOD,4BAQC;AAQD,kDAMC;AAMD,0BAQC;AAQD,gDAOC;AAOD,gDAMC;AAhJD;;;;GAIG;AACH,SAAgB,SAAS,CAAI,KAA2B;IACtD,OAAO,OAAO,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,IAAI,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAc,EAAE,cAAsB;IAC9D,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,IAAI,cAAc,0EAA0E,CAC7F,CAAC;IACJ,CAAC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;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,KAAa,EAAE,cAAsB;IAC3D,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,IAAI,cAAc,wEAAwE,CAC3F,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,6EAA6E;AAC7E,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,6EAA6E;AAC7E,SAAgB,kBAAkB,CAAC,KAAW;IAC5C,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n * @internal\n */\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n\n/**\n * Helper TypeGuard that checks if something is a string or not.\n * @param thing - Anything\n * @internal\n */\nexport function isString(thing: unknown): thing is string {\n return typeof thing === \"string\" || thing instanceof String;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given string,\n * or throws error if undefined.\n */\nexport function getString(value: unknown, nameOfProperty: string): string {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a string value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `string` value from given input,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getStringOrUndefined(value: any): string | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n return value.toString();\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or throws error if undefined.\n */\nexport function getInteger(value: unknown, nameOfProperty: string): number {\n const result = getIntegerOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `integer` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getIntegerOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseInt(value.toString());\n return isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or throws error if undefined.\n */\nexport function getFloat(value: unknown, nameOfProperty: string): number {\n const result = getFloatOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a number value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to retrieve `float` value from given string,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getFloatOrUndefined(value: any): number | undefined {\n if (!isDefined(value)) {\n return undefined;\n }\n const result = parseFloat(value.toString());\n return Number.isNaN(result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type.\n */\nexport function getDate(value: string, nameOfProperty: string): Date {\n const result = getDateOrUndefined(value);\n if (result === undefined) {\n throw new Error(\n `\"${nameOfProperty}\" received from service expected to be a Date value and not undefined.`,\n );\n }\n return result;\n}\n\n/**\n * @internal\n * Helper utility to convert ISO-8601 time into Date type,\n * or undefined if not passed in.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getDateOrUndefined(value: any): Date | undefined {\n const stringValue = getStringOrUndefined(value);\n if (stringValue === undefined) {\n return undefined;\n }\n const result = new Date(stringValue.toString());\n return Number.isNaN(+result) ? undefined : result;\n}\n\n/**\n * @internal\n * Helper utility to parse tags from a comma separated string.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTagsOrUndefined(value?: any): string[] | undefined {\n const result = getStringOrUndefined(value);\n if (result === undefined) {\n return undefined;\n }\n return result.split(\",\");\n}\n\nexport type NullableRecord = Record<string, string | undefined>;\nexport type NonNullableRecord = Record<string, NonNullable<NullableRecord[string]>>;\n"]}
@@ -2,7 +2,11 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.parseXMLError = exports.serializeToAtomXmlRequest = exports.sanitizeSerializableObject = exports.isJSONLikeObject = exports.XML_VALUE_MARKER = exports.XML_METADATA_MARKER = void 0;
5
+ exports.XML_VALUE_MARKER = exports.XML_METADATA_MARKER = void 0;
6
+ exports.isJSONLikeObject = isJSONLikeObject;
7
+ exports.sanitizeSerializableObject = sanitizeSerializableObject;
8
+ exports.serializeToAtomXmlRequest = serializeToAtomXmlRequest;
9
+ exports.parseXMLError = parseXMLError;
6
10
  const utils_js_1 = require("./utils.js");
7
11
  const core_xml_1 = require("@azure/core-xml");
8
12
  /**
@@ -41,7 +45,6 @@ function isJSONLikeObject(value) {
41
45
  // -------------------------------------------------------------------------------
42
46
  return typeof value === "object" && value.constructor === EMPTY_JSON_OBJECT_CONSTRUCTOR;
43
47
  }
44
- exports.isJSONLikeObject = isJSONLikeObject;
45
48
  /**
46
49
  * @internal
47
50
  * The key-value pairs having undefined/null as the values would lead to the empty tags in the serialized XML request.
@@ -62,7 +65,6 @@ function sanitizeSerializableObject(resource) {
62
65
  }
63
66
  });
64
67
  }
65
- exports.sanitizeSerializableObject = sanitizeSerializableObject;
66
68
  /**
67
69
  * @internal
68
70
  * Serializes input information to construct the Atom XML request
@@ -88,7 +90,6 @@ function serializeToAtomXmlRequest(resourceName, resource) {
88
90
  };
89
91
  return requestDetails;
90
92
  }
91
- exports.serializeToAtomXmlRequest = serializeToAtomXmlRequest;
92
93
  /**
93
94
  * @internal
94
95
  * Parses the XML message from a Notification Hubs response
@@ -112,5 +113,4 @@ async function parseXMLError(bodyText) {
112
113
  }
113
114
  return result;
114
115
  }
115
- exports.parseXMLError = parseXMLError;
116
116
  //# sourceMappingURL=xmlUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"xmlUtils.js","sourceRoot":"","sources":["../../../src/utils/xmlUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,yCAAuC;AACvC,8CAA2C;AAE3C;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;GAGG;AACH,MAAM,6BAA6B,GAAG,EAAE,CAAC,WAAW,CAAC;AAErD;;;GAGG;AACH,6EAA6E;AAC7E,SAAgB,gBAAgB,CAAC,KAAU;IACzC,6EAA6E;IAC7E,uFAAuF;IAEvF,kFAAkF;IAClF,kFAAkF;IAClF,kFAAkF;IAClF,qDAAqD;I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AC,GAAG;QACpC,KAAK,EAAE,6BAA6B;KACrC,CAAC;IACF,OAAO,cAAc,CAAC;AACxB,CAAC;AAvBD,8DAuBC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO;IACT,CAAC;IAED,IAAI,MAA0B,CAAC;IAC/B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,IACE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC7C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,EACvD,CAAC;YACD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAgB;IAClB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAnBD,sCAmBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { isDefined } from \"./utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * Marker for atom metadata.\n *\n * @internal\n */\nexport const XML_METADATA_MARKER = \"$\";\n\n/**\n * Marker for atom value.\n *\n * @internal\n */\nexport const XML_VALUE_MARKER = \"_\";\n\n/**\n * @internal\n * Helps in differentiating JSON like objects from other kinds of objects.\n */\nconst EMPTY_JSON_OBJECT_CONSTRUCTOR = {}.constructor;\n\n/**\n * @internal\n * Returns `true` if given input is a JSON like object.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isJSONLikeObject(value: any): boolean {\n // `value.constructor === {}.constructor` differentiates among the \"object\"s,\n // would filter the JSON objects and won't match any array or other kinds of objects\n\n // -------------------------------------------------------------------------------\n // Few examples | typeof obj ===\"object\" | obj.constructor==={}.constructor\n // -------------------------------------------------------------------------------\n // {abc:1} | true | true\n // [\"a\",\"b\"] | true | false\n // [{\"a\":1},{\"b\":2}] | true | false\n // new Date() | true | false\n // 123 | false | false\n // -------------------------------------------------------------------------------\n return typeof value === \"object\" && value.constructor === EMPTY_JSON_OBJECT_CONSTRUCTOR;\n}\n\n/**\n * @internal\n * The key-value pairs having undefined/null as the values would lead to the empty tags in the serialized XML request.\n * Empty tags in the request body is problematic because of the following reasons.\n * - ATOM based management operations throw a \"Bad Request\" error if empty tags are included in the XML request body at top level.\n * - At the inner levels, Service assigns the empty strings as values to the empty tags instead of throwing an error.\n *\n * This method recursively removes the key-value pairs with undefined/null as the values from the request object that is to be serialized.\n *\n */\nexport function sanitizeSerializableObject(resource: { [key: string]: any }): void {\n Object.keys(resource).forEach(function (property) {\n if (!isDefined(resource[property])) {\n delete resource[property];\n } else if (isJSONLikeObject(resource[property])) {\n sanitizeSerializableObject(resource[property]);\n }\n });\n}\n\n/**\n * @internal\n * Serializes input information to construct the Atom XML request\n * @param resourceName - Name of the resource to be serialized like `QueueDescription`\n * @param resource - The entity details\n * @returns An object to be serialized into a string.\n */\nexport function serializeToAtomXmlRequest(\n resourceName: string,\n resource: unknown,\n): Record<string, unknown> {\n const content: any = {};\n\n content[resourceName] = Object.assign({}, resource);\n sanitizeSerializableObject(content[resourceName]);\n\n content[resourceName][XML_METADATA_MARKER] = {\n xmlns: \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\",\n \"xmlns:i\": \"http://www.w3.org/2001/XMLSchema-instance\",\n };\n\n content[XML_METADATA_MARKER] = { type: \"application/xml\" };\n const requestDetails: Record<string, unknown> = {\n updated: new Date().toISOString(),\n content: content,\n };\n requestDetails[XML_METADATA_MARKER] = {\n xmlns: \"http://www.w3.org/2005/Atom\",\n };\n return requestDetails;\n}\n\n/**\n * @internal\n * Parses the XML message from a Notification Hubs response\n * @param bodyText - The HTTP response body.\n * @returns The notification details if any from the XML.\n */\nexport async function parseXMLError(bodyText: string): Promise<string | undefined> {\n if (!bodyText) {\n return;\n }\n\n let result: string | undefined;\n try {\n const xmlError = await parseXML(bodyText, { includeRoot: true });\n if (\n Object.hasOwnProperty.call(xmlError, \"Error\") &&\n Object.hasOwnProperty.call(xmlError[\"Error\"], \"Detail\")\n ) {\n return xmlError[\"Error\"][\"Detail\"];\n }\n } catch (err) {\n // nothing to do\n }\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"xmlUtils.js","sourceRoot":"","sources":["../../../src/utils/xmlUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA8BlC,4CAcC;AAYD,gEAQC;AASD,8DAuBC;AAQD,sCAmBC;AAzHD,yCAAuC;AACvC,8CAA2C;AAE3C;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;GAGG;AACH,MAAM,6BAA6B,GAAG,EAAE,CAAC,WAAW,CAAC;AAErD;;;GAGG;AACH,6EAA6E;AAC7E,SAAgB,gBAAgB,CAAC,KAAU;IACzC,6EAA6E;IAC7E,uFAAuF;IAEvF,kFAAkF;IAClF,kFAAkF;IAClF,kFAAkF;IAClF,qDAAqD;IACrD,sDAAsD;IACtD,sDAAsD;IACtD,sDAAsD;IACtD,sDAAsD;IACtD,kFAAkF;IAClF,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,KAAK,6BAA6B,CAAC;AAC1F,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,0BAA0B,CAAC,QAAgC;IACzE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAU,QAAQ;QAC9C,IAAI,CAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YACnC,OAAO,QAAQ,CAAC,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,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,EACvD,CAAC;YACD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAgB;IAClB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { isDefined } from \"./utils.js\";\nimport { parseXML } from \"@azure/core-xml\";\n\n/**\n * Marker for atom metadata.\n *\n * @internal\n */\nexport const XML_METADATA_MARKER = \"$\";\n\n/**\n * Marker for atom value.\n *\n * @internal\n */\nexport const XML_VALUE_MARKER = \"_\";\n\n/**\n * @internal\n * Helps in differentiating JSON like objects from other kinds of objects.\n */\nconst EMPTY_JSON_OBJECT_CONSTRUCTOR = {}.constructor;\n\n/**\n * @internal\n * Returns `true` if given input is a JSON like object.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isJSONLikeObject(value: any): boolean {\n // `value.constructor === {}.constructor` differentiates among the \"object\"s,\n // would filter the JSON objects and won't match any array or other kinds of objects\n\n // -------------------------------------------------------------------------------\n // Few examples | typeof obj ===\"object\" | obj.constructor==={}.constructor\n // -------------------------------------------------------------------------------\n // {abc:1} | true | true\n // [\"a\",\"b\"] | true | false\n // [{\"a\":1},{\"b\":2}] | true | false\n // new Date() | true | false\n // 123 | false | false\n // -------------------------------------------------------------------------------\n return typeof value === \"object\" && value.constructor === EMPTY_JSON_OBJECT_CONSTRUCTOR;\n}\n\n/**\n * @internal\n * The key-value pairs having undefined/null as the values would lead to the empty tags in the serialized XML request.\n * Empty tags in the request body is problematic because of the following reasons.\n * - ATOM based management operations throw a \"Bad Request\" error if empty tags are included in the XML request body at top level.\n * - At the inner levels, Service assigns the empty strings as values to the empty tags instead of throwing an error.\n *\n * This method recursively removes the key-value pairs with undefined/null as the values from the request object that is to be serialized.\n *\n */\nexport function sanitizeSerializableObject(resource: { [key: string]: any }): void {\n Object.keys(resource).forEach(function (property) {\n if (!isDefined(resource[property])) {\n delete resource[property];\n } else if (isJSONLikeObject(resource[property])) {\n sanitizeSerializableObject(resource[property]);\n }\n });\n}\n\n/**\n * @internal\n * Serializes input information to construct the Atom XML request\n * @param resourceName - Name of the resource to be serialized like `QueueDescription`\n * @param resource - The entity details\n * @returns An object to be serialized into a string.\n */\nexport function serializeToAtomXmlRequest(\n resourceName: string,\n resource: unknown,\n): Record<string, unknown> {\n const content: any = {};\n\n content[resourceName] = Object.assign({}, resource);\n sanitizeSerializableObject(content[resourceName]);\n\n content[resourceName][XML_METADATA_MARKER] = {\n xmlns: \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\",\n \"xmlns:i\": \"http://www.w3.org/2001/XMLSchema-instance\",\n };\n\n content[XML_METADATA_MARKER] = { type: \"application/xml\" };\n const requestDetails: Record<string, unknown> = {\n updated: new Date().toISOString(),\n content: content,\n };\n requestDetails[XML_METADATA_MARKER] = {\n xmlns: \"http://www.w3.org/2005/Atom\",\n };\n return requestDetails;\n}\n\n/**\n * @internal\n * Parses the XML message from a Notification Hubs response\n * @param bodyText - The HTTP response body.\n * @returns The notification details if any from the XML.\n */\nexport async function parseXMLError(bodyText: string): Promise<string | undefined> {\n if (!bodyText) {\n return;\n }\n\n let result: string | undefined;\n try {\n const xmlError = await parseXML(bodyText, { includeRoot: true });\n if (\n Object.hasOwnProperty.call(xmlError, \"Error\") &&\n Object.hasOwnProperty.call(xmlError[\"Error\"], \"Detail\")\n ) {\n return xmlError[\"Error\"][\"Detail\"];\n }\n } catch (err) {\n // nothing to do\n }\n\n return result;\n}\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { HttpHeaders, PipelineRequest, PipelineResponse } from "@azure/core-rest-pipeline";
3
2
  import { NotificationHubsClientOptions } from "../models/options.js";
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"clientContext.d.ts","sourceRoot":"","sources":["../../../src/api/clientContext.ts"],"names":[],"mappings":";AAIA,OAAO,EAEL,WAAW,EACX,eAAe,EACf,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEjE;;OAEG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhG;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC1C,6BAA6B,CAE/B"}
1
+ {"version":3,"file":"clientContext.d.ts","sourceRoot":"","sources":["../../../src/api/clientContext.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,WAAW,EACX,eAAe,EACf,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEjE;;OAEG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhG;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC1C,6BAA6B,CAE/B"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { HttpHeaders, HttpMethods, PipelineRequest, PipelineResponse } from "@azure/core-rest-pipeline";
3
2
  import { NotificationHubsMessageResponse, NotificationHubsResponse } from "../../models/notificationDetails.js";
4
3
  import { NotificationHubsClientContext } from "../index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"_client.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_client.ts"],"names":[],"mappings":";AAGA,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,gBAAgB,EAGjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,GAAG,EACb,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,GACxB,eAAe,CASjB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,CAU9F;AAED;;;;GAIG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,+BAA+B,CAAC,CAwB1C;AAgBD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,6BAA6B,EACtC,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,GAAG,MAAM,EAAE,GACnC,OAAO,CAAC,gBAAgB,CAAC,CA4B3B"}
1
+ {"version":3,"file":"_client.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,gBAAgB,EAGjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,GAAG,EACb,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,GACxB,eAAe,CASjB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,CAU9F;AAED;;;;GAIG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,+BAA+B,CAAC,CAwB1C;AAgBD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,6BAA6B,EACtC,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,GAAG,MAAM,EAAE,GACnC,OAAO,CAAC,gBAAgB,CAAC,CA4B3B"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { HttpHeaders, PipelineRequest, PipelineResponse } from "@azure/core-rest-pipeline";
3
2
  import { NotificationHubsClientOptions } from "../models/options.js";
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"clientContext.d.ts","sourceRoot":"","sources":["../../../src/api/clientContext.ts"],"names":[],"mappings":";AAIA,OAAO,EAEL,WAAW,EACX,eAAe,EACf,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEjE;;OAEG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhG;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC1C,6BAA6B,CAE/B"}
1
+ {"version":3,"file":"clientContext.d.ts","sourceRoot":"","sources":["../../../src/api/clientContext.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,WAAW,EACX,eAAe,EACf,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEjE;;OAEG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhG;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC1C,6BAA6B,CAE/B"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { HttpHeaders, HttpMethods, PipelineRequest, PipelineResponse } from "@azure/core-rest-pipeline";
3
2
  import { NotificationHubsMessageResponse, NotificationHubsResponse } from "../../models/notificationDetails.js";
4
3
  import { NotificationHubsClientContext } from "../index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"_client.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_client.ts"],"names":[],"mappings":";AAGA,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,gBAAgB,EAGjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,GAAG,EACb,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,GACxB,eAAe,CASjB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,CAU9F;AAED;;;;GAIG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,+BAA+B,CAAC,CAwB1C;AAgBD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,6BAA6B,EACtC,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,GAAG,MAAM,EAAE,GACnC,OAAO,CAAC,gBAAgB,CAAC,CA4B3B"}
1
+ {"version":3,"file":"_client.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,gBAAgB,EAGjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK3D,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,GAAG,EACb,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,GACxB,eAAe,CASjB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,CAU9F;AAED;;;;GAIG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,+BAA+B,CAAC,CAwB1C;AAgBD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,6BAA6B,EACtC,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,GAAG,MAAM,EAAE,GACnC,OAAO,CAAC,gBAAgB,CAAC,CA4B3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/notification-hubs",
3
- "version": "1.2.4-alpha.20240628.1",
3
+ "version": "1.2.4-alpha.20240704.1",
4
4
  "description": "Azure Notification Hubs SDK for JavaScript",
5
5
  "sdk-type": "client",
6
6
  "main": "./dist/commonjs/index.js",
@@ -71,8 +71,8 @@
71
71
  "eslint": "^8.57.0",
72
72
  "playwright": "^1.43.0",
73
73
  "rimraf": "^5.0.5",
74
- "tshy": "^1.13.1",
75
- "typescript": "~5.4.5",
74
+ "tshy": "^1.17.0",
75
+ "typescript": "~5.5.3",
76
76
  "vitest": "^1.6.0"
77
77
  },
78
78
  "dependencies": {
@@ -173,5 +173,6 @@
173
173
  "default": "./dist/commonjs/models/index.js"
174
174
  }
175
175
  }
176
- }
176
+ },
177
+ "module": "./dist/esm/index.js"
177
178
  }