@azure/notification-hubs 2.0.0-alpha.20240911.1 → 2.0.0-alpha.20240913.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/api/notification-hubs.d.ts +37 -13
- package/dist/browser/api/index.d.ts +2 -0
- package/dist/browser/api/index.d.ts.map +1 -1
- package/dist/browser/api/index.js +2 -0
- package/dist/browser/api/index.js.map +1 -1
- package/dist/browser/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/browser/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/browser/api/internal/_scheduleNotification.js +31 -0
- package/dist/browser/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/browser/api/internal/_sendNotification.d.ts +13 -0
- package/dist/browser/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/browser/api/internal/_sendNotification.js +62 -0
- package/dist/browser/api/internal/_sendNotification.js.map +1 -0
- package/dist/browser/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/browser/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/browser/api/scheduleBroadcastNotification.js +16 -0
- package/dist/browser/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/browser/api/scheduleNotification.d.ts +1 -1
- package/dist/browser/api/scheduleNotification.d.ts.map +1 -1
- package/dist/browser/api/scheduleNotification.js +3 -18
- package/dist/browser/api/scheduleNotification.js.map +1 -1
- package/dist/browser/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/browser/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/browser/api/sendBroadcastNotification.js +14 -0
- package/dist/browser/api/sendBroadcastNotification.js.map +1 -0
- package/dist/browser/api/sendNotification.d.ts +1 -1
- package/dist/browser/api/sendNotification.d.ts.map +1 -1
- package/dist/browser/api/sendNotification.js +3 -52
- package/dist/browser/api/sendNotification.js.map +1 -1
- package/dist/browser/models/options.d.ts +13 -10
- package/dist/browser/models/options.d.ts.map +1 -1
- package/dist/browser/models/options.js.map +1 -1
- package/dist/browser/notificationHubsClient.d.ts +19 -3
- package/dist/browser/notificationHubsClient.d.ts.map +1 -1
- package/dist/browser/notificationHubsClient.js +24 -2
- package/dist/browser/notificationHubsClient.js.map +1 -1
- package/dist/browser/utils/optionUtils.d.ts +7 -1
- package/dist/browser/utils/optionUtils.d.ts.map +1 -1
- package/dist/browser/utils/optionUtils.js +8 -0
- package/dist/browser/utils/optionUtils.js.map +1 -1
- package/dist/browser/utils/xmlUtils.js +1 -1
- package/dist/browser/utils/xmlUtils.js.map +1 -1
- package/dist/commonjs/api/index.d.ts +2 -0
- package/dist/commonjs/api/index.d.ts.map +1 -1
- package/dist/commonjs/api/index.js +2 -0
- package/dist/commonjs/api/index.js.map +1 -1
- package/dist/commonjs/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/commonjs/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/commonjs/api/internal/_scheduleNotification.js +34 -0
- package/dist/commonjs/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/commonjs/api/internal/_sendNotification.d.ts +13 -0
- package/dist/commonjs/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/commonjs/api/internal/_sendNotification.js +65 -0
- package/dist/commonjs/api/internal/_sendNotification.js.map +1 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.js +19 -0
- package/dist/commonjs/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/commonjs/api/scheduleNotification.d.ts +1 -1
- package/dist/commonjs/api/scheduleNotification.d.ts.map +1 -1
- package/dist/commonjs/api/scheduleNotification.js +3 -18
- package/dist/commonjs/api/scheduleNotification.js.map +1 -1
- package/dist/commonjs/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/commonjs/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/commonjs/api/sendBroadcastNotification.js +17 -0
- package/dist/commonjs/api/sendBroadcastNotification.js.map +1 -0
- package/dist/commonjs/api/sendNotification.d.ts +1 -1
- package/dist/commonjs/api/sendNotification.d.ts.map +1 -1
- package/dist/commonjs/api/sendNotification.js +3 -52
- package/dist/commonjs/api/sendNotification.js.map +1 -1
- package/dist/commonjs/models/options.d.ts +13 -10
- package/dist/commonjs/models/options.d.ts.map +1 -1
- package/dist/commonjs/models/options.js.map +1 -1
- package/dist/commonjs/notificationHubsClient.d.ts +19 -3
- package/dist/commonjs/notificationHubsClient.d.ts.map +1 -1
- package/dist/commonjs/notificationHubsClient.js +24 -2
- package/dist/commonjs/notificationHubsClient.js.map +1 -1
- package/dist/commonjs/utils/optionUtils.d.ts +7 -1
- package/dist/commonjs/utils/optionUtils.d.ts.map +1 -1
- package/dist/commonjs/utils/optionUtils.js +9 -0
- package/dist/commonjs/utils/optionUtils.js.map +1 -1
- package/dist/commonjs/utils/xmlUtils.js +1 -1
- package/dist/commonjs/utils/xmlUtils.js.map +1 -1
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.d.ts.map +1 -1
- package/dist/esm/api/index.js +2 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/esm/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/esm/api/internal/_scheduleNotification.js +31 -0
- package/dist/esm/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/esm/api/internal/_sendNotification.d.ts +13 -0
- package/dist/esm/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/esm/api/internal/_sendNotification.js +62 -0
- package/dist/esm/api/internal/_sendNotification.js.map +1 -0
- package/dist/esm/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/esm/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/esm/api/scheduleBroadcastNotification.js +16 -0
- package/dist/esm/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/esm/api/scheduleNotification.d.ts +1 -1
- package/dist/esm/api/scheduleNotification.d.ts.map +1 -1
- package/dist/esm/api/scheduleNotification.js +3 -18
- package/dist/esm/api/scheduleNotification.js.map +1 -1
- package/dist/esm/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/esm/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/esm/api/sendBroadcastNotification.js +14 -0
- package/dist/esm/api/sendBroadcastNotification.js.map +1 -0
- package/dist/esm/api/sendNotification.d.ts +1 -1
- package/dist/esm/api/sendNotification.d.ts.map +1 -1
- package/dist/esm/api/sendNotification.js +3 -52
- package/dist/esm/api/sendNotification.js.map +1 -1
- package/dist/esm/models/options.d.ts +13 -10
- package/dist/esm/models/options.d.ts.map +1 -1
- package/dist/esm/models/options.js.map +1 -1
- package/dist/esm/notificationHubsClient.d.ts +19 -3
- package/dist/esm/notificationHubsClient.d.ts.map +1 -1
- package/dist/esm/notificationHubsClient.js +24 -2
- package/dist/esm/notificationHubsClient.js.map +1 -1
- package/dist/esm/utils/optionUtils.d.ts +7 -1
- package/dist/esm/utils/optionUtils.d.ts.map +1 -1
- package/dist/esm/utils/optionUtils.js +8 -0
- package/dist/esm/utils/optionUtils.js.map +1 -1
- package/dist/esm/utils/xmlUtils.js +1 -1
- package/dist/esm/utils/xmlUtils.js.map +1 -1
- package/dist/models/notification-hubs.d.ts +15 -11
- package/dist/notification-hubs.d.ts +33 -13
- package/dist/react-native/api/index.d.ts +2 -0
- package/dist/react-native/api/index.d.ts.map +1 -1
- package/dist/react-native/api/index.js +2 -0
- package/dist/react-native/api/index.js.map +1 -1
- package/dist/react-native/api/internal/_scheduleNotification.d.ts +15 -0
- package/dist/react-native/api/internal/_scheduleNotification.d.ts.map +1 -0
- package/dist/react-native/api/internal/_scheduleNotification.js +31 -0
- package/dist/react-native/api/internal/_scheduleNotification.js.map +1 -0
- package/dist/react-native/api/internal/_sendNotification.d.ts +13 -0
- package/dist/react-native/api/internal/_sendNotification.d.ts.map +1 -0
- package/dist/react-native/api/internal/_sendNotification.js +62 -0
- package/dist/react-native/api/internal/_sendNotification.js.map +1 -0
- package/dist/react-native/api/scheduleBroadcastNotification.d.ts +15 -0
- package/dist/react-native/api/scheduleBroadcastNotification.d.ts.map +1 -0
- package/dist/react-native/api/scheduleBroadcastNotification.js +16 -0
- package/dist/react-native/api/scheduleBroadcastNotification.js.map +1 -0
- package/dist/react-native/api/scheduleNotification.d.ts +1 -1
- package/dist/react-native/api/scheduleNotification.d.ts.map +1 -1
- package/dist/react-native/api/scheduleNotification.js +3 -18
- package/dist/react-native/api/scheduleNotification.js.map +1 -1
- package/dist/react-native/api/sendBroadcastNotification.d.ts +13 -0
- package/dist/react-native/api/sendBroadcastNotification.d.ts.map +1 -0
- package/dist/react-native/api/sendBroadcastNotification.js +14 -0
- package/dist/react-native/api/sendBroadcastNotification.js.map +1 -0
- package/dist/react-native/api/sendNotification.d.ts +1 -1
- package/dist/react-native/api/sendNotification.d.ts.map +1 -1
- package/dist/react-native/api/sendNotification.js +3 -52
- package/dist/react-native/api/sendNotification.js.map +1 -1
- package/dist/react-native/models/options.d.ts +13 -10
- package/dist/react-native/models/options.d.ts.map +1 -1
- package/dist/react-native/models/options.js.map +1 -1
- package/dist/react-native/notificationHubsClient.d.ts +19 -3
- package/dist/react-native/notificationHubsClient.d.ts.map +1 -1
- package/dist/react-native/notificationHubsClient.js +24 -2
- package/dist/react-native/notificationHubsClient.js.map +1 -1
- package/dist/react-native/utils/optionUtils.d.ts +7 -1
- package/dist/react-native/utils/optionUtils.d.ts.map +1 -1
- package/dist/react-native/utils/optionUtils.js +8 -0
- package/dist/react-native/utils/optionUtils.js.map +1 -1
- package/dist/react-native/utils/xmlUtils.js +1 -1
- package/dist/react-native/utils/xmlUtils.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendNotification.js","sourceRoot":"","sources":["../../../src/api/sendNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"sendNotification.js","sourceRoot":"","sources":["../../../src/api/sendNotification.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAsC,EACtC,YAA0B,EAC1B,OAAgE;IAEhE,OAAO,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DirectSendNotificationOptions, SendNotificationOptions } from \"../models/options.js\";\nimport { Notification } from \"../models/notification.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { NotificationHubsMessageResponse } from \"../models/notificationDetails.js\";\nimport { sendNotificationInternal } from \"./internal/_sendNotification.js\";\n\n/**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param context - The Notification Hubs client.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function sendNotification(\n context: NotificationHubsClientContext,\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions,\n): Promise<NotificationHubsMessageResponse> {\n return sendNotificationInternal(context, notification, options);\n}\n"]}
|
|
@@ -15,29 +15,32 @@ export interface PolledOperationOptions extends OperationOptions {
|
|
|
15
15
|
updateIntervalInMs?: number;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Options for sending notifications for both tag based
|
|
18
|
+
* Options for sending notifications for both tag based scheduled send.
|
|
19
19
|
*/
|
|
20
20
|
export interface ScheduleNotificationOptions extends OperationOptions {
|
|
21
21
|
/**
|
|
22
22
|
* A tag expression used to target devices. Use the `createTagExpression` function to create a tag expression from an array of tags.
|
|
23
|
-
* If not set, this results in a broadcast notification to be scheduled.
|
|
24
23
|
*/
|
|
25
|
-
tagExpression
|
|
24
|
+
tagExpression: string;
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
|
-
* Options for sending notifications for
|
|
27
|
+
* Options for sending notifications for test send.
|
|
29
28
|
*/
|
|
30
|
-
export interface
|
|
31
|
-
/**
|
|
32
|
-
* A tag expression used to target devices. Use the `createTagExpression` function to create a tag expression from an array of tags.
|
|
33
|
-
* If not set, this results in a broadcast notification to be sent.
|
|
34
|
-
*/
|
|
35
|
-
tagExpression?: string;
|
|
29
|
+
export interface BroadcastSendNotificationOptions extends OperationOptions {
|
|
36
30
|
/**
|
|
37
31
|
* Set to true to enable test send.
|
|
38
32
|
*/
|
|
39
33
|
enableTestSend?: boolean;
|
|
40
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Options for sending notifications for tag based send.
|
|
37
|
+
*/
|
|
38
|
+
export interface SendNotificationOptions extends BroadcastSendNotificationOptions {
|
|
39
|
+
/**
|
|
40
|
+
* A tag expression used to target devices. Use the `createTagExpression` function to create a tag expression from an array of tags.
|
|
41
|
+
*/
|
|
42
|
+
tagExpression: string;
|
|
43
|
+
}
|
|
41
44
|
/**
|
|
42
45
|
* Options for sending notifications to individual devices.
|
|
43
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/models/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,aAAa;CAAG;AAEvE;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/models/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,aAAa;CAAG;AAEvE;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gCAAiC,SAAQ,gBAAgB;IACxE;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,gCAAgC;IAC/E;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACrE;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,kBAAkB,GAAG,MAAM,EAAE,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACrE;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,6BAA6B;IAC7E;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/models/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ClientOptions, OperationOptions } from \"@azure-rest/core-client\";\nimport { BrowserPushChannel } from \"./installation.js\";\n\n/**\n * Describes the options that can be provided while creating the NotificationHubsClientContext.\n */\nexport interface NotificationHubsClientOptions extends ClientOptions {}\n\n/**\n * Options for polled operations including the polling interval cycle.\n */\nexport interface PolledOperationOptions extends OperationOptions {\n /**\n * Time delay between poll requests, in milliseconds.\n */\n updateIntervalInMs?: number;\n}\n\n/**\n * Options for sending notifications for both tag based
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/models/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ClientOptions, OperationOptions } from \"@azure-rest/core-client\";\nimport { BrowserPushChannel } from \"./installation.js\";\n\n/**\n * Describes the options that can be provided while creating the NotificationHubsClientContext.\n */\nexport interface NotificationHubsClientOptions extends ClientOptions {}\n\n/**\n * Options for polled operations including the polling interval cycle.\n */\nexport interface PolledOperationOptions extends OperationOptions {\n /**\n * Time delay between poll requests, in milliseconds.\n */\n updateIntervalInMs?: number;\n}\n\n/**\n * Options for sending notifications for both tag based scheduled send.\n */\nexport interface ScheduleNotificationOptions extends OperationOptions {\n /**\n * A tag expression used to target devices. Use the `createTagExpression` function to create a tag expression from an array of tags.\n */\n tagExpression: string;\n}\n\n/**\n * Options for sending notifications for test send.\n */\nexport interface BroadcastSendNotificationOptions extends OperationOptions {\n /**\n * Set to true to enable test send.\n */\n enableTestSend?: boolean;\n}\n\n/**\n * Options for sending notifications for tag based send.\n */\nexport interface SendNotificationOptions extends BroadcastSendNotificationOptions {\n /**\n * A tag expression used to target devices. Use the `createTagExpression` function to create a tag expression from an array of tags.\n */\n tagExpression: string;\n}\n\n/**\n * Options for sending notifications to individual devices.\n */\nexport interface DirectSendNotificationOptions extends OperationOptions {\n /**\n * The device handle to send the notification. If an array is provided, this uses batch direct send which is only available in Standard SKU and above.\n */\n deviceHandle: string | BrowserPushChannel | string[];\n}\n\n/**\n * Represents entity update operation options that can be set.\n */\nexport interface EntityOperationOptions extends OperationOptions {\n /**\n * ETag as returned by creation, update, and retrieval, or ‘*’ (overwrite).\n */\n etag?: string;\n}\n\n/**\n * Represents query options to include $top support.\n */\nexport interface RegistrationQueryLimitOptions extends OperationOptions {\n /**\n * The $top query member to get a number of records.\n */\n top?: number;\n}\n\n/**\n * Represents query options to include both $top and $filter.\n */\nexport interface RegistrationQueryOptions extends RegistrationQueryLimitOptions {\n /**\n * The OData $filter operator query string.\n */\n filter?: string;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DirectSendNotificationOptions, EntityOperationOptions, NotificationHubsClientOptions, PolledOperationOptions, RegistrationQueryLimitOptions, ScheduleNotificationOptions, SendNotificationOptions } from "./models/options.js";
|
|
1
|
+
import { BroadcastSendNotificationOptions, DirectSendNotificationOptions, EntityOperationOptions, NotificationHubsClientOptions, PolledOperationOptions, RegistrationQueryLimitOptions, ScheduleNotificationOptions, SendNotificationOptions } from "./models/options.js";
|
|
2
2
|
import { Installation, JsonPatch } from "./models/installation.js";
|
|
3
3
|
import { NotificationDetails, NotificationHubsMessageResponse, NotificationHubsResponse } from "./models/notificationDetails.js";
|
|
4
4
|
import { NotificationHubJob, NotificationHubJobPoller } from "./models/notificationHubJob.js";
|
|
@@ -111,13 +111,29 @@ export declare class NotificationHubsClient {
|
|
|
111
111
|
* @returns A paged async iterable containing the matching registrations for the notification hub.
|
|
112
112
|
*/
|
|
113
113
|
listRegistrationsByTag(tag: string, options?: RegistrationQueryLimitOptions): PagedAsyncIterableIterator<RegistrationDescription>;
|
|
114
|
+
/**
|
|
115
|
+
* Sends push notifications to devices all devices.
|
|
116
|
+
* @param notification - The notification to send to all devices.
|
|
117
|
+
* @param options - Options for the notification including whether to enable test send.
|
|
118
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
119
|
+
*/
|
|
120
|
+
sendBroadcastNotification(notification: Notification, options?: BroadcastSendNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
114
121
|
/**
|
|
115
122
|
* Sends push notifications to devices that match the given tags or tag expression.
|
|
116
123
|
* @param notification - The notification to send to the matching devices.
|
|
117
124
|
* @param options - Options for the notification including tags, device handles and whether to enable test send.
|
|
118
125
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
119
126
|
*/
|
|
120
|
-
sendNotification(notification: Notification, options
|
|
127
|
+
sendNotification(notification: Notification, options: DirectSendNotificationOptions | SendNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Schedules a push notification to all devices at the specified time.
|
|
130
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
131
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
132
|
+
* @param notification - The notification to send to the matching devices.
|
|
133
|
+
* @param options - The operation options.
|
|
134
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
135
|
+
*/
|
|
136
|
+
scheduleBroadcastNotification(scheduledTime: Date, notification: Notification, options?: OperationOptions): Promise<NotificationHubsMessageResponse>;
|
|
121
137
|
/**
|
|
122
138
|
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
123
139
|
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
@@ -126,7 +142,7 @@ export declare class NotificationHubsClient {
|
|
|
126
142
|
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
127
143
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
128
144
|
*/
|
|
129
|
-
scheduleNotification(scheduledTime: Date, notification: Notification, options
|
|
145
|
+
scheduleNotification(scheduledTime: Date, notification: Notification, options: ScheduleNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
130
146
|
/**
|
|
131
147
|
* Cancels the scheduled notification with the given notification ID.
|
|
132
148
|
* @param notificationId - The notification ID from the scheduled notification.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubsClient.d.ts","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"notificationHubsClient.d.ts","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM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AIpC;;;;;OAKG;IACH,uBAAuB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxE;;;;;;OAMG;IACH,6BAA6B,CAC3B,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;;;;OAKG;IACH,qBAAqB,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,kBAAkB,CAAC;IAI9B;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,wBAAwB,CAAC;IAIpC;;;;;OAKG;IACH,wBAAwB,CACtB,GAAG,EAAE,kBAAkB,EACvB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,kBAAkB,CAAC;IAI9B;;;;OAIG;IACH,uBAAuB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAGvF"}
|
|
@@ -18,7 +18,9 @@ import { listNotificationHubJobs as listNotificationHubJobsMethod } from "./api/
|
|
|
18
18
|
import { listRegistrationsByChannel as listRegistrationsByChannelMethod } from "./api/listRegistrationsByChannel.js";
|
|
19
19
|
import { listRegistrationsByTag as listRegistrationsByTagMethod } from "./api/listRegistrationsByTag.js";
|
|
20
20
|
import { listRegistrations as listRegistrationsMethod } from "./api/listRegistrations.js";
|
|
21
|
+
import { scheduleBroadcastNotification as scheduleBroadcastNotificationMethod } from "./api/scheduleBroadcastNotification.js";
|
|
21
22
|
import { scheduleNotification as scheduleNotificationMethod } from "./api/scheduleNotification.js";
|
|
23
|
+
import { sendBroadcastNotification as sendBroadcastNotificationMethod } from "./api/sendBroadcastNotification.js";
|
|
22
24
|
import { sendNotification as sendNotificationMethod } from "./api/sendNotification.js";
|
|
23
25
|
import { submitNotificationHubJob as submitNotificationHubJobMethod } from "./api/submitNotificationHubJob.js";
|
|
24
26
|
import { updateInstallation as updateInstallationMethod } from "./api/updateInstallation.js";
|
|
@@ -155,15 +157,35 @@ export class NotificationHubsClient {
|
|
|
155
157
|
listRegistrationsByTag(tag, options = {}) {
|
|
156
158
|
return listRegistrationsByTagMethod(this._client, tag, options);
|
|
157
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Sends push notifications to devices all devices.
|
|
162
|
+
* @param notification - The notification to send to all devices.
|
|
163
|
+
* @param options - Options for the notification including whether to enable test send.
|
|
164
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
165
|
+
*/
|
|
166
|
+
sendBroadcastNotification(notification, options = {}) {
|
|
167
|
+
return sendBroadcastNotificationMethod(this._client, notification, options);
|
|
168
|
+
}
|
|
158
169
|
/**
|
|
159
170
|
* Sends push notifications to devices that match the given tags or tag expression.
|
|
160
171
|
* @param notification - The notification to send to the matching devices.
|
|
161
172
|
* @param options - Options for the notification including tags, device handles and whether to enable test send.
|
|
162
173
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
163
174
|
*/
|
|
164
|
-
sendNotification(notification, options
|
|
175
|
+
sendNotification(notification, options) {
|
|
165
176
|
return sendNotificationMethod(this._client, notification, options);
|
|
166
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Schedules a push notification to all devices at the specified time.
|
|
180
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
181
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
182
|
+
* @param notification - The notification to send to the matching devices.
|
|
183
|
+
* @param options - The operation options.
|
|
184
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
185
|
+
*/
|
|
186
|
+
scheduleBroadcastNotification(scheduledTime, notification, options = {}) {
|
|
187
|
+
return scheduleBroadcastNotificationMethod(this._client, scheduledTime, notification, options);
|
|
188
|
+
}
|
|
167
189
|
/**
|
|
168
190
|
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
169
191
|
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
@@ -172,7 +194,7 @@ export class NotificationHubsClient {
|
|
|
172
194
|
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
173
195
|
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
174
196
|
*/
|
|
175
|
-
scheduleNotification(scheduledTime, notification, options
|
|
197
|
+
scheduleNotification(scheduledTime, notification, options) {
|
|
176
198
|
return scheduleNotificationMethod(this._client, scheduledTime, notification, options);
|
|
177
199
|
}
|
|
178
200
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubsClient.js","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC,OAAO,EAAiC,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAK5F,OAAO,EAAE,6BAA6B,IAAI,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAC9H,OAAO,EAAE,2BAA2B,IAAI,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACxH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,oBAAoB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,uBAAuB,IAAI,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,qBAAqB,I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AE9B,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CACnB,KAAa,EACb,UAA4B,EAAE;QAE9B,OAAO,2BAA2B,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAsC,EACtC,UAAkC,EAAE;QAEpC,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CACtB,GAAuB,EACvB,UAA4B,EAAE;QAE9B,OAAO,8BAA8B,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport { Installation, JsonPatch } from \"./models/installation.js\";\nimport {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport { NotificationHubsClientContext, createClientContext } from \"./api/clientContext.js\";\nimport { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport { Notification } from \"./models/notification.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\n\n /**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteRegistration(\n registrationId: string,\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\n listRegistrationsByTag(\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions = { enableTestSend: false },\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\n\n /**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\n\n /**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"notificationHubsClient.js","sourceRoot":"","sources":["../../src/notificationHubsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmBlC,OAAO,EAAiC,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAK5F,OAAO,EAAE,6BAA6B,IAAI,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAC9H,OAAO,EAAE,2BAA2B,IAAI,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACxH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,oBAAoB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,uBAAuB,IAAI,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAC5G,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,qBAAqB,IAAI,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AACtG,OAAO,EAAE,6BAA6B,IAAI,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAC9H,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,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B,OAAO,iCAAiC,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;OAKG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;OAMG;IACH,6BAA6B,CAC3B,cAAsB,EACtB,UAA4B,EAAE;QAE9B,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CACnB,KAAa,EACb,UAA4B,EAAE;QAE9B,OAAO,2BAA2B,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,6BAA6B,CAC3B,kBAAsC,EACtC,UAAkC,EAAE;QAEpC,OAAO,mCAAmC,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CACtB,GAAuB,EACvB,UAA4B,EAAE;QAE9B,OAAO,8BAA8B,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,uBAAuB,CAAC,UAA4B,EAAE;QACpD,OAAO,6BAA6B,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n BroadcastSendNotificationOptions,\n DirectSendNotificationOptions,\n EntityOperationOptions,\n NotificationHubsClientOptions,\n PolledOperationOptions,\n RegistrationQueryLimitOptions,\n ScheduleNotificationOptions,\n SendNotificationOptions,\n} from \"./models/options.js\";\nimport { Installation, JsonPatch } from \"./models/installation.js\";\nimport {\n NotificationDetails,\n NotificationHubsMessageResponse,\n NotificationHubsResponse,\n} from \"./models/notificationDetails.js\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"./models/notificationHubJob.js\";\nimport { NotificationHubsClientContext, createClientContext } from \"./api/clientContext.js\";\nimport { RegistrationDescription, RegistrationChannel } from \"./models/registration.js\";\nimport { Notification } from \"./models/notification.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { beginSubmitNotificationHubJob as beginSubmitNotificationHubJobMethod } from \"./api/beginSubmitNotificationHubJob.js\";\nimport { cancelScheduledNotification as cancelScheduledNotificationMethod } from \"./api/cancelScheduledNotification.js\";\nimport { createOrUpdateInstallation as createOrUpdateInstallationMethod } from \"./api/createOrUpdateInstallation.js\";\nimport { createOrUpdateRegistration as createOrUpdateRegistrationMethod } from \"./api/createOrUpdateRegistration.js\";\nimport { createRegistrationId as createRegistrationIdMethod } from \"./api/createRegistrationId.js\";\nimport { createRegistration as createRegistrationMethod } from \"./api/createRegistration.js\";\nimport { deleteInstallation as deleteInstallationMethod } from \"./api/deleteInstallation.js\";\nimport { deleteRegistration } from \"./api/deleteRegistration.js\";\nimport { getFeedbackContainerUrl as getFeedbackContainerUrlMethod } from \"./api/getFeedbackContainerUrl.js\";\nimport { getInstallation as getInstallationMethod } from \"./api/getInstallation.js\";\nimport { getNotificationHubJob as getNotificationHubJobMethod } from \"./api/getNotificationHubJob.js\";\nimport { getNotificationOutcomeDetails as getNotificationOutcomeDetailsMethod } from \"./api/getNotificationOutcomeDetails.js\";\nimport { getRegistration as getRegistrationMethod } from \"./api/getRegistration.js\";\nimport { listNotificationHubJobs as listNotificationHubJobsMethod } from \"./api/listNotificationHubJobs.js\";\nimport { listRegistrationsByChannel as listRegistrationsByChannelMethod } from \"./api/listRegistrationsByChannel.js\";\nimport { listRegistrationsByTag as listRegistrationsByTagMethod } from \"./api/listRegistrationsByTag.js\";\nimport { listRegistrations as listRegistrationsMethod } from \"./api/listRegistrations.js\";\nimport { scheduleBroadcastNotification as scheduleBroadcastNotificationMethod } from \"./api/scheduleBroadcastNotification.js\";\nimport { scheduleNotification as scheduleNotificationMethod } from \"./api/scheduleNotification.js\";\nimport { sendBroadcastNotification as sendBroadcastNotificationMethod } from \"./api/sendBroadcastNotification.js\";\nimport { sendNotification as sendNotificationMethod } from \"./api/sendNotification.js\";\nimport { submitNotificationHubJob as submitNotificationHubJobMethod } from \"./api/submitNotificationHubJob.js\";\nimport { updateInstallation as updateInstallationMethod } from \"./api/updateInstallation.js\";\nimport { updateRegistration as updateRegistrationMethod } from \"./api/updateRegistration.js\";\n\n/**\n * This represents a client for Azure Notification Hubs to manage installations and send\n * messages to devices.\n */\nexport class NotificationHubsClient {\n private _client: NotificationHubsClientContext;\n\n /**\n * Creates a new instance of the NotificationClient with a connection string, hub name and options.\n * @param connectionString - The Notification Hub Access Policy connection string.\n * @param hubName - The name of the Azure Notification Hub.\n * @param options - Options for configuring the Azure Notification Hubs client.\n */\n constructor(\n connectionString: string,\n hubName: string,\n options: NotificationHubsClientOptions = {},\n ) {\n this._client = createClientContext(connectionString, hubName, options);\n }\n\n /**\n * Creates or overwrites an installation to a Notification Hub.\n * @param installation - The installation to create or overwrite.\n * @param options - Configuration options for the create or update installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n createOrUpdateInstallation(\n installation: Installation,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return createOrUpdateInstallationMethod(this._client, installation, options);\n }\n\n /**\n * Deletes an installation from a Notification Hub.\n * @param installationId - The installation ID of the installation to delete.\n * @param options - Configuration options for the installation delete operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteInstallation(\n installationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Gets an Azure Notification Hub installation by the installation ID.\n * @param installationId - The ID of the installation to get.\n * @param options - Configuration options for the get installation operation.\n * @returns The installation that matches the installation ID.\n */\n getInstallation(installationId: string, options: OperationOptions = {}): Promise<Installation> {\n return getInstallationMethod(this._client, installationId, options);\n }\n\n /**\n * Updates an installation using the JSON-Patch standard in RFC6902.\n * @param installationId - The ID of the installation to update.\n * @param patches - An array of patches following the JSON-Patch standard.\n * @param options - Configuration options for the patch installation operation.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n updateInstallation(\n installationId: string,\n patches: JsonPatch[],\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return updateInstallationMethod(this._client, installationId, patches, options);\n }\n\n /**\n * Creates a new registration ID.\n * @param options - The options for creating a new registration ID.\n * @returns The newly created registration ID.\n */\n createRegistrationId(options: OperationOptions = {}): Promise<string> {\n return createRegistrationIdMethod(this._client, options);\n }\n\n /**\n * Creates a new registration. This method generates a registration ID,\n * which you can subsequently use to retrieve, update, and delete this registration.\n * @param registration - The registration to create.\n * @param options - Options for creating a new registration.\n * @returns The newly created registration description.\n */\n createRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Creates or updates a registration.\n * @param registration - The registration to create or update.\n * @param options - The operation options.\n * @returns The created or updated registration description.\n */\n createOrUpdateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return createOrUpdateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Updates an existing registration.\n * @param registration - The registration to update.\n * @param options - The operation options.\n * @returns The updated registration description.\n */\n updateRegistration(\n registration: RegistrationDescription,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return updateRegistrationMethod(this._client, registration, options);\n }\n\n /**\n * Deletes a registration with the given registration ID.\n * @param context - The Notification Hubs client.\n * @param registrationId - The registration ID of the registration to delete.\n * @param options - The options for delete operations including the ETag\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n deleteRegistration(\n registrationId: string,\n options: EntityOperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return deleteRegistration(this._client, registrationId, options);\n }\n\n /**\n * Gets a registration by the given registration ID.\n * @param registrationId - The ID of the registration to get.\n * @param options - The options for getting a registration by ID.\n * @returns A RegistrationDescription that has the given registration ID.\n */\n getRegistration(\n registrationId: string,\n options: OperationOptions = {},\n ): Promise<RegistrationDescription> {\n return getRegistrationMethod(this._client, registrationId, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given query options.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrations(\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsMethod(this._client, options);\n }\n\n /**\n * Gets all registrations for the notification hub with the given device information and options.\n * @param channel - The registration channel information to query per PNS type.\n * @param options - The options for querying the registrations such as $top.\n * @returns A paged async iterable containing all of the registrations for the notification hub.\n */\n listRegistrationsByChannel(\n channel: RegistrationChannel,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByChannelMethod(this._client, channel, options);\n }\n\n /**\n * Lists all registrations with the matching tag.\n * @param tag - The tag to query for matching registrations.\n * @param options - The query options such as $top.\n * @returns A paged async iterable containing the matching registrations for the notification hub.\n */\n listRegistrationsByTag(\n tag: string,\n options: RegistrationQueryLimitOptions = {},\n ): PagedAsyncIterableIterator<RegistrationDescription> {\n return listRegistrationsByTagMethod(this._client, tag, options);\n }\n\n /**\n * Sends push notifications to devices all devices.\n * @param notification - The notification to send to all devices.\n * @param options - Options for the notification including whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendBroadcastNotification(\n notification: Notification,\n options: BroadcastSendNotificationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return sendBroadcastNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Sends push notifications to devices that match the given tags or tag expression.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options for the notification including tags, device handles and whether to enable test send.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n sendNotification(\n notification: Notification,\n options: DirectSendNotificationOptions | SendNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return sendNotificationMethod(this._client, notification, options);\n }\n\n /**\n * Schedules a push notification to all devices at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - The operation options.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleBroadcastNotification(\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions = {},\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleBroadcastNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\n scheduleNotification(\n scheduledTime: Date,\n notification: Notification,\n options: ScheduleNotificationOptions,\n ): Promise<NotificationHubsMessageResponse> {\n return scheduleNotificationMethod(this._client, scheduledTime, notification, options);\n }\n\n /**\n * Cancels the scheduled notification with the given notification ID.\n * @param notificationId - The notification ID from the scheduled notification.\n * @param options - The operation options.\n * @returns A notification hub response with correlation ID and tracking ID.\n */\n cancelScheduledNotification(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubsResponse> {\n return cancelScheduledNotificationMethod(this._client, notificationId, options);\n }\n\n /**\n * Retrieves an Azure Storage container URL. The container has feedback data for the notification hub.\n * The caller can then use the Azure Storage Services SDK to retrieve the contents of the container.\n * @param options - The options for getting the push notification feedback container URL.\n * @returns The URL of the Azure Storage Container containing the feedback data.\n */\n getFeedbackContainerUrl(options: OperationOptions = {}): Promise<string> {\n return getFeedbackContainerUrlMethod(this._client, options);\n }\n\n /**\n * Retrieves the results of a send operation. This can retrieve intermediate results if the send is being processed\n * or final results if the Send* has completed. This API can only be called for Standard SKU and above.\n * @param notificationId - The notification ID returned from the send operation.\n * @param options - The operation options.\n * @returns The results of the send operation.\n */\n getNotificationOutcomeDetails(\n notificationId: string,\n options: OperationOptions = {},\n ): Promise<NotificationDetails> {\n return getNotificationOutcomeDetailsMethod(this._client, notificationId, options);\n }\n\n /**\n * Gets a Notification Hub Job by the ID.\n * @param jobId - The Notification Hub Job ID.\n * @param options - The operation options.\n * @returns The Notification Hub Job with the matching ID.\n */\n getNotificationHubJob(\n jobId: string,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return getNotificationHubJobMethod(this._client, jobId, options);\n }\n\n /**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param notificationHubJob - The Notification Hub import/export job to start.\n * @param options - The operation options.\n * @returns A poller which can be called to poll until completion of the job.\n */\n beginSubmitNotificationHubJob(\n notificationHubJob: NotificationHubJob,\n options: PolledOperationOptions = {},\n ): Promise<NotificationHubJobPoller> {\n return beginSubmitNotificationHubJobMethod(this._client, notificationHubJob, options);\n }\n\n /**\n * Submits a Notification Hub Job. Note this is available to Standard SKU namespace and above.\n * @param job - The notification hub job to submit.\n * @param options - The operation options.\n * @returns The notification hub job details including job ID and status.\n */\n submitNotificationHubJob(\n job: NotificationHubJob,\n options: OperationOptions = {},\n ): Promise<NotificationHubJob> {\n return submitNotificationHubJobMethod(this._client, job, options);\n }\n\n /**\n * Gets all Notification Hub Jobs for this Notification Hub.\n * @param options - The operation options.\n * @returns An array of all Notification Hub Jobs for this Notification Hub.\n */\n listNotificationHubJobs(options: OperationOptions = {}): Promise<NotificationHubJob[]> {\n return listNotificationHubJobsMethod(this._client, options);\n }\n}\n"]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { DirectSendNotificationOptions, SendNotificationOptions } from "../models/options.js";
|
|
1
|
+
import { BroadcastSendNotificationOptions, DirectSendNotificationOptions, SendNotificationOptions } from "../models/options.js";
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether the options are of type BroadcastSendNotificationOptions.
|
|
4
|
+
* @param options - The options to test if BroadcastSendNotificationOptions.
|
|
5
|
+
* @returns true if BroadcastSendNotificationOptions otherwise false.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isBroadcastSendNotificationOptions(options: unknown): options is BroadcastSendNotificationOptions;
|
|
2
8
|
/**
|
|
3
9
|
* Determines whether the options are of type SendNotificationOptions.
|
|
4
10
|
* @param options - The options to test if SendNotificationOptions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"optionUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAG9B;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,gCAAgC,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,uBAAuB,CAI9F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,6BAA6B,CAE1C"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { objectHasProperty } from "@azure/core-util";
|
|
4
|
+
/**
|
|
5
|
+
* Determines whether the options are of type BroadcastSendNotificationOptions.
|
|
6
|
+
* @param options - The options to test if BroadcastSendNotificationOptions.
|
|
7
|
+
* @returns true if BroadcastSendNotificationOptions otherwise false.
|
|
8
|
+
*/
|
|
9
|
+
export function isBroadcastSendNotificationOptions(options) {
|
|
10
|
+
return objectHasProperty(options, "enableTestSend");
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
13
|
* Determines whether the options are of type SendNotificationOptions.
|
|
6
14
|
* @param options - The options to test if SendNotificationOptions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionUtils.js","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"optionUtils.js","sourceRoot":"","sources":["../../../src/utils/optionUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,kCAAkC,CAChD,OAAgB;IAEhB,OAAO,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO,CACL,iBAAiB,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAC5F,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAAgB;IAEhB,OAAO,iBAAiB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n BroadcastSendNotificationOptions,\n DirectSendNotificationOptions,\n SendNotificationOptions,\n} from \"../models/options.js\";\nimport { objectHasProperty } from \"@azure/core-util\";\n\n/**\n * Determines whether the options are of type BroadcastSendNotificationOptions.\n * @param options - The options to test if BroadcastSendNotificationOptions.\n * @returns true if BroadcastSendNotificationOptions otherwise false.\n */\nexport function isBroadcastSendNotificationOptions(\n options: unknown,\n): options is BroadcastSendNotificationOptions {\n return objectHasProperty(options, \"enableTestSend\");\n}\n\n/**\n * Determines whether the options are of type SendNotificationOptions.\n * @param options - The options to test if SendNotificationOptions.\n * @returns true if SendNotificationOptions otherwise false.\n */\nexport function isSendNotificationOptions(options: unknown): options is SendNotificationOptions {\n return (\n objectHasProperty(options, \"tagExpression\") || objectHasProperty(options, \"enableTestSend\")\n );\n}\n\n/**\n * Determines whether the options are of type DirectSendNotificationOptions.\n * @param options - The options to test if DirectSendNotificationOptions.\n * @returns true if DirectSendNotificationOptions otherwise false.\n */\nexport function isDirectSendNotificationOptions(\n options: unknown,\n): options is DirectSendNotificationOptions {\n return objectHasProperty(options, \"deviceHandle\");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xmlUtils.js","sourceRoot":"","sources":["../../../src/utils/xmlUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;GAGG;AACH,MAAM,6BAA6B,GAAG,EAAE,CAAC,WAAW,CAAC;AAErD;;;GAGG;AACH,6EAA6E;AAC7E,MAAM,UAAU,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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AAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,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,WAAM,CAAC;QACP,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 {\n // nothing to do\n }\n\n return result;\n}\n"]}
|
|
@@ -16,7 +16,9 @@ export * from "./listNotificationHubJobs.js";
|
|
|
16
16
|
export * from "./listRegistrations.js";
|
|
17
17
|
export * from "./listRegistrationsByChannel.js";
|
|
18
18
|
export * from "./listRegistrationsByTag.js";
|
|
19
|
+
export * from "./scheduleBroadcastNotification.js";
|
|
19
20
|
export * from "./scheduleNotification.js";
|
|
21
|
+
export * from "./sendBroadcastNotification.js";
|
|
20
22
|
export * from "./sendNotification.js";
|
|
21
23
|
export * from "./submitNotificationHubJob.js";
|
|
22
24
|
export * from "./updateInstallation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
@@ -21,7 +21,9 @@ tslib_1.__exportStar(require("./listNotificationHubJobs.js"), exports);
|
|
|
21
21
|
tslib_1.__exportStar(require("./listRegistrations.js"), exports);
|
|
22
22
|
tslib_1.__exportStar(require("./listRegistrationsByChannel.js"), exports);
|
|
23
23
|
tslib_1.__exportStar(require("./listRegistrationsByTag.js"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./scheduleBroadcastNotification.js"), exports);
|
|
24
25
|
tslib_1.__exportStar(require("./scheduleNotification.js"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./sendBroadcastNotification.js"), exports);
|
|
25
27
|
tslib_1.__exportStar(require("./sendNotification.js"), exports);
|
|
26
28
|
tslib_1.__exportStar(require("./submitNotificationHubJob.js"), exports);
|
|
27
29
|
tslib_1.__exportStar(require("./updateInstallation.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6DAAmC;AACnC,6EAAmD;AACnD,2EAAiD;AACjD,0EAAgD;AAChD,0EAAgD;AAChD,kEAAwC;AACxC,oEAA0C;AAC1C,kEAAwC;AACxC,kEAAwC;AACxC,uEAA6C;AAC7C,+DAAqC;AACrC,qEAA2C;AAC3C,6EAAmD;AACnD,+DAAqC;AACrC,uEAA6C;AAC7C,iEAAuC;AACvC,0EAAgD;AAChD,sEAA4C;AAC5C,oEAA0C;AAC1C,gEAAsC;AACtC,wEAA8C;AAC9C,kEAAwC;AACxC,kEAAwC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./clientContext.js\";\nexport * from \"./beginSubmitNotificationHubJob.js\";\nexport * from \"./cancelScheduledNotification.js\";\nexport * from \"./createOrUpdateInstallation.js\";\nexport * from \"./createOrUpdateRegistration.js\";\nexport * from \"./createRegistration.js\";\nexport * from \"./createRegistrationId.js\";\nexport * from \"./deleteInstallation.js\";\nexport * from \"./deleteRegistration.js\";\nexport * from \"./getFeedbackContainerUrl.js\";\nexport * from \"./getInstallation.js\";\nexport * from \"./getNotificationHubJob.js\";\nexport * from \"./getNotificationOutcomeDetails.js\";\nexport * from \"./getRegistration.js\";\nexport * from \"./listNotificationHubJobs.js\";\nexport * from \"./listRegistrations.js\";\nexport * from \"./listRegistrationsByChannel.js\";\nexport * from \"./listRegistrationsByTag.js\";\nexport * from \"./scheduleNotification.js\";\nexport * from \"./sendNotification.js\";\nexport * from \"./submitNotificationHubJob.js\";\nexport * from \"./updateInstallation.js\";\nexport * from \"./updateRegistration.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6DAAmC;AACnC,6EAAmD;AACnD,2EAAiD;AACjD,0EAAgD;AAChD,0EAAgD;AAChD,kEAAwC;AACxC,oEAA0C;AAC1C,kEAAwC;AACxC,kEAAwC;AACxC,uEAA6C;AAC7C,+DAAqC;AACrC,qEAA2C;AAC3C,6EAAmD;AACnD,+DAAqC;AACrC,uEAA6C;AAC7C,iEAAuC;AACvC,0EAAgD;AAChD,sEAA4C;AAC5C,6EAAmD;AACnD,oEAA0C;AAC1C,yEAA+C;AAC/C,gEAAsC;AACtC,wEAA8C;AAC9C,kEAAwC;AACxC,kEAAwC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./clientContext.js\";\nexport * from \"./beginSubmitNotificationHubJob.js\";\nexport * from \"./cancelScheduledNotification.js\";\nexport * from \"./createOrUpdateInstallation.js\";\nexport * from \"./createOrUpdateRegistration.js\";\nexport * from \"./createRegistration.js\";\nexport * from \"./createRegistrationId.js\";\nexport * from \"./deleteInstallation.js\";\nexport * from \"./deleteRegistration.js\";\nexport * from \"./getFeedbackContainerUrl.js\";\nexport * from \"./getInstallation.js\";\nexport * from \"./getNotificationHubJob.js\";\nexport * from \"./getNotificationOutcomeDetails.js\";\nexport * from \"./getRegistration.js\";\nexport * from \"./listNotificationHubJobs.js\";\nexport * from \"./listRegistrations.js\";\nexport * from \"./listRegistrationsByChannel.js\";\nexport * from \"./listRegistrationsByTag.js\";\nexport * from \"./scheduleBroadcastNotification.js\";\nexport * from \"./scheduleNotification.js\";\nexport * from \"./sendBroadcastNotification.js\";\nexport * from \"./sendNotification.js\";\nexport * from \"./submitNotificationHubJob.js\";\nexport * from \"./updateInstallation.js\";\nexport * from \"./updateRegistration.js\";\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Notification } from "../../models/notification.js";
|
|
2
|
+
import { NotificationHubsClientContext } from "../index.js";
|
|
3
|
+
import { NotificationHubsMessageResponse } from "../../models/notificationDetails.js";
|
|
4
|
+
import { OperationOptions } from "@azure-rest/core-client";
|
|
5
|
+
/**
|
|
6
|
+
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
7
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
8
|
+
* @param context - The Notification Hubs client.
|
|
9
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
10
|
+
* @param notification - The notification to send to the matching devices.
|
|
11
|
+
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
12
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scheduleNotificationInternal(context: NotificationHubsClientContext, scheduledTime: Date, notification: Notification, options: OperationOptions, method: string, tagExpression?: string): Promise<NotificationHubsMessageResponse>;
|
|
15
|
+
//# sourceMappingURL=_scheduleNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_scheduleNotification.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_scheduleNotification.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,+BAA+B,CAAC,CA2B1C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.scheduleNotificationInternal = scheduleNotificationInternal;
|
|
6
|
+
const _client_js_1 = require("./_client.js");
|
|
7
|
+
const tracing_js_1 = require("../../utils/tracing.js");
|
|
8
|
+
/**
|
|
9
|
+
* Schedules a push notification to devices that match the given tags or tag expression at the specified time.
|
|
10
|
+
* NOTE: This is only available in Standard SKU Azure Notification Hubs.
|
|
11
|
+
* @param context - The Notification Hubs client.
|
|
12
|
+
* @param scheduledTime - The Date to send the push notification.
|
|
13
|
+
* @param notification - The notification to send to the matching devices.
|
|
14
|
+
* @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.
|
|
15
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
16
|
+
*/
|
|
17
|
+
function scheduleNotificationInternal(context, scheduledTime, notification, options, method, tagExpression) {
|
|
18
|
+
return tracing_js_1.tracingClient.withSpan(`NotificationHubsClientContext.${method}`, options, async (updatedOptions) => {
|
|
19
|
+
const endpoint = context.requestUrl();
|
|
20
|
+
endpoint.pathname += "/schedulednotifications/";
|
|
21
|
+
const headers = await context.createHeaders("scheduleNotification", notification.headers);
|
|
22
|
+
headers.set("ServiceBusNotification-ScheduleTime", scheduledTime.toISOString());
|
|
23
|
+
headers.set("Content-Type", notification.contentType);
|
|
24
|
+
headers.set("ServiceBusNotification-Format", notification.platform);
|
|
25
|
+
if (tagExpression) {
|
|
26
|
+
headers.set("ServiceBusNotification-Tags", tagExpression);
|
|
27
|
+
}
|
|
28
|
+
const request = (0, _client_js_1.createRequest)(endpoint, "POST", headers, updatedOptions);
|
|
29
|
+
request.body = notification.body;
|
|
30
|
+
const response = await (0, _client_js_1.sendRequest)(context, request, 201);
|
|
31
|
+
return (0, _client_js_1.parseNotificationSendResponse)(response);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=_scheduleNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_scheduleNotification.js","sourceRoot":"","sources":["../../../../src/api/internal/_scheduleNotification.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAmBlC,oEAkCC;AAnDD,6CAAyF;AAKzF,uDAAuD;AAGvD;;;;;;;;GAQG;AACH,SAAgB,4BAA4B,CAC1C,OAAsC,EACtC,aAAmB,EACnB,YAA0B,EAC1B,OAAyB,EACzB,MAAc,EACd,aAAsB;IAEtB,OAAO,0BAAa,CAAC,QAAQ,CAC3B,iCAAiC,MAAM,EAAE,EACzC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACtC,QAAQ,CAAC,QAAQ,IAAI,0BAA0B,CAAC;QAEhD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CACzC,sBAAsB,EACtB,YAAY,CAAC,OAA4B,CAC1C,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QACpE,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,aAAa,CAAC,CAAC;QAC5D,CAAC;QAED,MAAM,OAAO,GAAG,IAAA,0BAAa,EAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;QAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,IAAA,0CAA6B,EAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createRequest, parseNotificationSendResponse, sendRequest } from \"./_client.js\";\nimport { NonNullableRecord } from \"../../utils/utils.js\";\nimport { Notification } from \"../../models/notification.js\";\nimport { NotificationHubsClientContext } from \"../index.js\";\nimport { NotificationHubsMessageResponse } from \"../../models/notificationDetails.js\";\nimport { tracingClient } from \"../../utils/tracing.js\";\nimport { OperationOptions } from \"@azure-rest/core-client\";\n\n/**\n * Schedules a push notification to devices that match the given tags or tag expression at the specified time.\n * NOTE: This is only available in Standard SKU Azure Notification Hubs.\n * @param context - The Notification Hubs client.\n * @param scheduledTime - The Date to send the push notification.\n * @param notification - The notification to send to the matching devices.\n * @param options - Options which include tags used to target the device for push notifications in either an array or tag expression.\n * @returns A NotificationHubResponse with the tracking ID, correlation ID and location.\n */\nexport function scheduleNotificationInternal(\n context: NotificationHubsClientContext,\n scheduledTime: Date,\n notification: Notification,\n options: OperationOptions,\n method: string,\n tagExpression?: string,\n): Promise<NotificationHubsMessageResponse> {\n return tracingClient.withSpan(\n `NotificationHubsClientContext.${method}`,\n options,\n async (updatedOptions) => {\n const endpoint = context.requestUrl();\n endpoint.pathname += \"/schedulednotifications/\";\n\n const headers = await context.createHeaders(\n \"scheduleNotification\",\n notification.headers as NonNullableRecord,\n );\n headers.set(\"ServiceBusNotification-ScheduleTime\", scheduledTime.toISOString());\n headers.set(\"Content-Type\", notification.contentType);\n headers.set(\"ServiceBusNotification-Format\", notification.platform);\n if (tagExpression) {\n headers.set(\"ServiceBusNotification-Tags\", tagExpression);\n }\n\n const request = createRequest(endpoint, \"POST\", headers, updatedOptions);\n request.body = notification.body;\n\n const response = await sendRequest(context, request, 201);\n\n return parseNotificationSendResponse(response);\n },\n );\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BroadcastSendNotificationOptions, DirectSendNotificationOptions, SendNotificationOptions } from "../../models/options.js";
|
|
2
|
+
import { Notification } from "../../models/notification.js";
|
|
3
|
+
import { NotificationHubsClientContext } from "../index.js";
|
|
4
|
+
import { NotificationHubsMessageResponse } from "../../models/notificationDetails.js";
|
|
5
|
+
/**
|
|
6
|
+
* Sends push notifications to devices that match the given tags or tag expression.
|
|
7
|
+
* @param context - The Notification Hubs client.
|
|
8
|
+
* @param notification - The notification to send to the matching devices.
|
|
9
|
+
* @param options - Options for the notification including tags, device handles and whether to enable test send.
|
|
10
|
+
* @returns A NotificationHubResponse with the tracking ID, correlation ID and location.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sendNotificationInternal(context: NotificationHubsClientContext, notification: Notification, options: DirectSendNotificationOptions | SendNotificationOptions | BroadcastSendNotificationOptions): Promise<NotificationHubsMessageResponse>;
|
|
13
|
+
//# sourceMappingURL=_sendNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_sendNotification.d.ts","sourceRoot":"","sources":["../../../../src/api/internal/_sendNotification.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAKtF;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,6BAA6B,EACtC,YAAY,EAAE,YAAY,EAC1B,OAAO,EACH,6BAA6B,GAC7B,uBAAuB,GACvB,gCAAgC,GACnC,OAAO,CAAC,+BAA+B,CAAC,CA8D1C"}
|