@azure/notification-hubs 1.2.4-alpha.20240904.1 → 2.0.0-alpha.20240905.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/dist/api/notification-hubs.d.ts +2 -2
- package/dist/browser/api/beginSubmitNotificationHubJob.d.ts.map +1 -1
- package/dist/browser/api/beginSubmitNotificationHubJob.js +22 -15
- package/dist/browser/api/beginSubmitNotificationHubJob.js.map +1 -1
- package/dist/browser/models/notificationHubJob.d.ts +2 -2
- package/dist/browser/models/notificationHubJob.d.ts.map +1 -1
- package/dist/browser/models/notificationHubJob.js.map +1 -1
- package/dist/commonjs/api/beginSubmitNotificationHubJob.d.ts.map +1 -1
- package/dist/commonjs/api/beginSubmitNotificationHubJob.js +22 -15
- package/dist/commonjs/api/beginSubmitNotificationHubJob.js.map +1 -1
- package/dist/commonjs/models/notificationHubJob.d.ts +2 -2
- package/dist/commonjs/models/notificationHubJob.d.ts.map +1 -1
- package/dist/commonjs/models/notificationHubJob.js.map +1 -1
- package/dist/esm/api/beginSubmitNotificationHubJob.d.ts.map +1 -1
- package/dist/esm/api/beginSubmitNotificationHubJob.js +22 -15
- package/dist/esm/api/beginSubmitNotificationHubJob.js.map +1 -1
- package/dist/esm/models/notificationHubJob.d.ts +2 -2
- package/dist/esm/models/notificationHubJob.d.ts.map +1 -1
- package/dist/esm/models/notificationHubJob.js.map +1 -1
- package/dist/models/notification-hubs.d.ts +2 -2
- package/dist/notification-hubs.d.ts +2 -2
- package/dist/react-native/api/beginSubmitNotificationHubJob.d.ts.map +1 -1
- package/dist/react-native/api/beginSubmitNotificationHubJob.js +22 -15
- package/dist/react-native/api/beginSubmitNotificationHubJob.js.map +1 -1
- package/dist/react-native/models/notificationHubJob.d.ts +2 -2
- package/dist/react-native/models/notificationHubJob.d.ts.map +1 -1
- package/dist/react-native/models/notificationHubJob.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ import { OperationState } from '@azure/core-lro';
|
|
|
5
5
|
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
6
6
|
import { PipelineRequest } from '@azure/core-rest-pipeline';
|
|
7
7
|
import { PipelineResponse } from '@azure/core-rest-pipeline';
|
|
8
|
-
import {
|
|
8
|
+
import { PollerLike } from '@azure/core-lro';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an Amazon Device Messaging (ADM) based installation.
|
|
@@ -987,7 +987,7 @@ declare interface NotificationHubJob {
|
|
|
987
987
|
/**
|
|
988
988
|
* Describes a poller for NotificationHubJob types.
|
|
989
989
|
*/
|
|
990
|
-
declare type NotificationHubJobPoller =
|
|
990
|
+
declare type NotificationHubJobPoller = PollerLike<OperationState<NotificationHubJob>, NotificationHubJob>;
|
|
991
991
|
|
|
992
992
|
/**
|
|
993
993
|
* Describes the types of notification hub job statuses.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,CA6InC"}
|
|
@@ -19,7 +19,6 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
19
19
|
const progressCallbacks = new Map();
|
|
20
20
|
const processProgressCallbacks = async () => progressCallbacks.forEach((h) => h(state));
|
|
21
21
|
let resultPromise;
|
|
22
|
-
let cancelJob;
|
|
23
22
|
const abortController = new AbortController();
|
|
24
23
|
const currentPollIntervalInMs = (_a = polledOperationOptions.updateIntervalInMs) !== null && _a !== void 0 ? _a : 2000;
|
|
25
24
|
const poller = {
|
|
@@ -43,6 +42,7 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
43
42
|
if (state.status === "failed") {
|
|
44
43
|
throw state.error;
|
|
45
44
|
}
|
|
45
|
+
return state;
|
|
46
46
|
},
|
|
47
47
|
pollUntilDone(pollOptions) {
|
|
48
48
|
return (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => {
|
|
@@ -59,9 +59,9 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
59
59
|
inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true });
|
|
60
60
|
}
|
|
61
61
|
try {
|
|
62
|
-
if (!poller.isDone
|
|
62
|
+
if (!poller.isDone) {
|
|
63
63
|
await poller.poll({ abortSignal });
|
|
64
|
-
while (!poller.isDone
|
|
64
|
+
while (!poller.isDone) {
|
|
65
65
|
await delay(currentPollIntervalInMs, { abortSignal });
|
|
66
66
|
await poller.poll({ abortSignal });
|
|
67
67
|
}
|
|
@@ -72,7 +72,7 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
72
72
|
}
|
|
73
73
|
switch (state.status) {
|
|
74
74
|
case "succeeded":
|
|
75
|
-
return poller.
|
|
75
|
+
return poller.result;
|
|
76
76
|
case "canceled":
|
|
77
77
|
throw new Error("Operation was canceled");
|
|
78
78
|
case "failed":
|
|
@@ -90,25 +90,32 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
90
90
|
progressCallbacks.set(s, callback);
|
|
91
91
|
return () => progressCallbacks.delete(s);
|
|
92
92
|
},
|
|
93
|
-
isDone() {
|
|
93
|
+
get isDone() {
|
|
94
94
|
return ["succeeded", "failed", "canceled"].includes(state.status);
|
|
95
95
|
},
|
|
96
|
-
|
|
97
|
-
abortController.abort();
|
|
98
|
-
cancelJob === null || cancelJob === void 0 ? void 0 : cancelJob();
|
|
99
|
-
},
|
|
100
|
-
isStopped() {
|
|
101
|
-
return resultPromise === undefined;
|
|
102
|
-
},
|
|
103
|
-
getOperationState() {
|
|
96
|
+
get operationState() {
|
|
104
97
|
return state;
|
|
105
98
|
},
|
|
106
|
-
|
|
99
|
+
get result() {
|
|
107
100
|
return state.result;
|
|
108
101
|
},
|
|
109
|
-
|
|
102
|
+
async serialize() {
|
|
110
103
|
return JSON.stringify({ state });
|
|
111
104
|
},
|
|
105
|
+
async submitted() {
|
|
106
|
+
// No-op
|
|
107
|
+
return;
|
|
108
|
+
},
|
|
109
|
+
then(onfulfilled, onrejected) {
|
|
110
|
+
return poller.pollUntilDone().then(onfulfilled, onrejected);
|
|
111
|
+
},
|
|
112
|
+
catch(onrejected) {
|
|
113
|
+
return poller.pollUntilDone().catch(onrejected);
|
|
114
|
+
},
|
|
115
|
+
finally(onfinally) {
|
|
116
|
+
return poller.pollUntilDone().finally(onfinally);
|
|
117
|
+
},
|
|
118
|
+
[Symbol.toStringTag]: "Poller",
|
|
112
119
|
};
|
|
113
120
|
return poller;
|
|
114
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAsC,EACtC,kBAAsC,EACtC,yBAAiD,EAAE;;IAEnD,IAAI,YAAY,GAAG,MAAM,wBAAwB,CAC/C,OAAO,EACP,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;IAIF,MAAM,KAAK,GAAuC;QAChD,MAAM,EAAE,YAAY;KACrB,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrD,MAAM,wBAAwB,GAAG,KAAK,IAAmB,EAAE,CACzD,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,IAAI,aAAsD,CAAC;IAC3D,
|
|
1
|
+
{"version":3,"file":"beginSubmitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAsC,EACtC,kBAAsC,EACtC,yBAAiD,EAAE;;IAEnD,IAAI,YAAY,GAAG,MAAM,wBAAwB,CAC/C,OAAO,EACP,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;IAI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AAC;QACD,KAAK,CACH,UAAmF;YAEnF,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,SAA2C;YACjD,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QACD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ;KAC/B,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress, OperationState, PollerLike } from \"@azure/core-lro\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PolledOperationOptions } from \"../models/options.js\";\nimport { delay } from \"@azure/core-util\";\nimport { getNotificationHubJob } from \"./getNotificationHubJob.js\";\nimport { submitNotificationHubJob } from \"./submitNotificationHubJob.js\";\n\n/**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param context - The Notification Hubs client.\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 */\nexport async function beginSubmitNotificationHubJob(\n context: NotificationHubsClientContext,\n notificationHubJob: NotificationHubJob,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<NotificationHubJobPoller> {\n let submittedJob = await submitNotificationHubJob(\n context,\n notificationHubJob,\n polledOperationOptions,\n );\n\n type Handler = (state: OperationState<NotificationHubJob>) => void;\n\n const state: OperationState<NotificationHubJob> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<NotificationHubJob> | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: PollerLike<OperationState<NotificationHubJob>, NotificationHubJob> = {\n async poll(options?: {\n abortSignal?: AbortSignalLike;\n }): Promise<OperationState<NotificationHubJob>> {\n submittedJob = await getNotificationHubJob(context, submittedJob.jobId!, options);\n if (submittedJob.status === \"Running\" || submittedJob.status === \"Started\") {\n state.status = \"running\";\n }\n\n if (submittedJob.status === \"Completed\") {\n state.status = \"succeeded\";\n state.result = submittedJob;\n }\n\n if (submittedJob.status === \"Failed\") {\n state.status = \"failed\";\n state.error = new Error(submittedJob.failure);\n }\n\n await processProgressCallbacks();\n\n if (state.status === \"canceled\") {\n throw new Error(\"Operation was canceled\");\n }\n if (state.status === \"failed\") {\n throw state.error;\n }\n\n return state;\n },\n\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<NotificationHubJob> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone) {\n await poller.poll({ abortSignal });\n while (!poller.isDone) {\n await delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n return poller.result as NotificationHubJob;\n case \"canceled\":\n throw new Error(\"Operation was canceled\");\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(callback: (state: OperationState<NotificationHubJob>) => void): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n get isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n get operationState(): OperationState<NotificationHubJob> | undefined {\n return state;\n },\n\n get result(): NotificationHubJob | undefined {\n return state.result;\n },\n\n async serialize(): Promise<string> {\n return JSON.stringify({ state });\n },\n\n async submitted() {\n // No-op\n return;\n },\n\n then<TResult1 = NotificationHubJob, TResult2 = never>(\n onfulfilled?:\n | ((value: NotificationHubJob) => TResult1 | PromiseLike<TResult1>)\n | undefined\n | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<TResult1 | TResult2> {\n return poller.pollUntilDone().then(onfulfilled, onrejected);\n },\n catch<TResult2 = never>(\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<NotificationHubJob | TResult2> {\n return poller.pollUntilDone().catch(onrejected);\n },\n finally(onfinally?: (() => void) | undefined | null): Promise<NotificationHubJob> {\n return poller.pollUntilDone().finally(onfinally);\n },\n [Symbol.toStringTag]: \"Poller\",\n };\n\n return poller;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationState,
|
|
1
|
+
import { OperationState, PollerLike } from "@azure/core-lro";
|
|
2
2
|
/**
|
|
3
3
|
* Describes the types of notification hub jobs.
|
|
4
4
|
*/
|
|
@@ -105,5 +105,5 @@ export interface NotificationHubJob {
|
|
|
105
105
|
/**
|
|
106
106
|
* Describes a poller for NotificationHubJob types.
|
|
107
107
|
*/
|
|
108
|
-
export type NotificationHubJobPoller =
|
|
108
|
+
export type NotificationHubJobPoller = PollerLike<OperationState<NotificationHubJob>, NotificationHubJob>;
|
|
109
109
|
//# sourceMappingURL=notificationHubJob.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"notificationHub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AAG,UAAU,CAC/C,cAAc,CAAC,kBAAkB,CAAC,EAClC,kBAAkB,CACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState,
|
|
1
|
+
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState, PollerLike } from \"@azure/core-lro\";\n\n/**\n * Describes the types of notification hub jobs.\n */\nexport type NotificationHubJobType =\n /**\n * Job type to bulk get registrations.\n */\n | \"ExportRegistrations\"\n\n /**\n * Job type to bulk create registrations.\n */\n | \"ImportCreateRegistrations\"\n\n /**\n * Job type to bulk update registrations.\n */\n | \"ImportUpdateRegistrations\"\n\n /**\n * Job type to bulk delete registrations.\n */\n | \"ImportDeleteRegistrations\"\n\n /**\n * Job type to bulk upsert registrations.\n */\n | \"ImportUpsertRegistrations\";\n\n/**\n * Describes the types of notification hub job statuses.\n */\nexport type NotificationHubJobStatus =\n /**\n * Indicates that the NotificationHubJob was accepted.\n */\n | \"Started\"\n\n /**\n * Indicates that the NotificationHubJob is currently running. Depending on the amount of data,\n * a job may stay in this state for several hours.\n */\n | \"Running\"\n\n /**\n * Indicates that the NotificationHubJob was completed successfully. Any output\n * will be ready where configured via the NotificationHubJob object.\n */\n | \"Completed\"\n\n /**\n * Indicates that the NotificationHubJob has failed.\n */\n | \"Failed\";\n\n/**\n * Represents a Notification Hub Job.\n */\nexport interface NotificationHubJob {\n /**\n * The unique job identifier.\n */\n jobId?: string;\n\n /**\n * The output file name.\n */\n outputFileName?: string;\n\n /**\n * The file name for the job failures.\n */\n failuresFileName?: string;\n\n /**\n * The progress for the job.\n */\n progress?: number;\n\n /**\n * The type of job.\n */\n type: NotificationHubJobType;\n\n /**\n * The status of the job.\n */\n status?: NotificationHubJobStatus;\n\n /**\n * The output container URL.\n */\n outputContainerUrl: string;\n\n /**\n * The import file URL.\n */\n importFileUrl?: string;\n\n /**\n * The input properties for the notification hub job.\n */\n inputProperties?: Record<string, string>;\n\n /**\n * Gets the notification hub job failure message.\n */\n failure?: string;\n\n /**\n * The output properties for the notification hub job.\n */\n outputProperties?: Record<string, string>;\n\n /**\n * Notification hub job created date.\n */\n createdAt?: Date;\n\n /**\n * Notification hub job last updated date.\n */\n updatedAt?: Date;\n}\n\n/**\n * Describes a poller for NotificationHubJob types.\n */\nexport type NotificationHubJobPoller = PollerLike<\n OperationState<NotificationHubJob>,\n NotificationHubJob\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,CA6InC"}
|
|
@@ -22,7 +22,6 @@ async function beginSubmitNotificationHubJob(context, notificationHubJob, polled
|
|
|
22
22
|
const progressCallbacks = new Map();
|
|
23
23
|
const processProgressCallbacks = async () => progressCallbacks.forEach((h) => h(state));
|
|
24
24
|
let resultPromise;
|
|
25
|
-
let cancelJob;
|
|
26
25
|
const abortController = new AbortController();
|
|
27
26
|
const currentPollIntervalInMs = (_a = polledOperationOptions.updateIntervalInMs) !== null && _a !== void 0 ? _a : 2000;
|
|
28
27
|
const poller = {
|
|
@@ -46,6 +45,7 @@ async function beginSubmitNotificationHubJob(context, notificationHubJob, polled
|
|
|
46
45
|
if (state.status === "failed") {
|
|
47
46
|
throw state.error;
|
|
48
47
|
}
|
|
48
|
+
return state;
|
|
49
49
|
},
|
|
50
50
|
pollUntilDone(pollOptions) {
|
|
51
51
|
return (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => {
|
|
@@ -62,9 +62,9 @@ async function beginSubmitNotificationHubJob(context, notificationHubJob, polled
|
|
|
62
62
|
inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true });
|
|
63
63
|
}
|
|
64
64
|
try {
|
|
65
|
-
if (!poller.isDone
|
|
65
|
+
if (!poller.isDone) {
|
|
66
66
|
await poller.poll({ abortSignal });
|
|
67
|
-
while (!poller.isDone
|
|
67
|
+
while (!poller.isDone) {
|
|
68
68
|
await (0, core_util_1.delay)(currentPollIntervalInMs, { abortSignal });
|
|
69
69
|
await poller.poll({ abortSignal });
|
|
70
70
|
}
|
|
@@ -75,7 +75,7 @@ async function beginSubmitNotificationHubJob(context, notificationHubJob, polled
|
|
|
75
75
|
}
|
|
76
76
|
switch (state.status) {
|
|
77
77
|
case "succeeded":
|
|
78
|
-
return poller.
|
|
78
|
+
return poller.result;
|
|
79
79
|
case "canceled":
|
|
80
80
|
throw new Error("Operation was canceled");
|
|
81
81
|
case "failed":
|
|
@@ -93,25 +93,32 @@ async function beginSubmitNotificationHubJob(context, notificationHubJob, polled
|
|
|
93
93
|
progressCallbacks.set(s, callback);
|
|
94
94
|
return () => progressCallbacks.delete(s);
|
|
95
95
|
},
|
|
96
|
-
isDone() {
|
|
96
|
+
get isDone() {
|
|
97
97
|
return ["succeeded", "failed", "canceled"].includes(state.status);
|
|
98
98
|
},
|
|
99
|
-
|
|
100
|
-
abortController.abort();
|
|
101
|
-
cancelJob === null || cancelJob === void 0 ? void 0 : cancelJob();
|
|
102
|
-
},
|
|
103
|
-
isStopped() {
|
|
104
|
-
return resultPromise === undefined;
|
|
105
|
-
},
|
|
106
|
-
getOperationState() {
|
|
99
|
+
get operationState() {
|
|
107
100
|
return state;
|
|
108
101
|
},
|
|
109
|
-
|
|
102
|
+
get result() {
|
|
110
103
|
return state.result;
|
|
111
104
|
},
|
|
112
|
-
|
|
105
|
+
async serialize() {
|
|
113
106
|
return JSON.stringify({ state });
|
|
114
107
|
},
|
|
108
|
+
async submitted() {
|
|
109
|
+
// No-op
|
|
110
|
+
return;
|
|
111
|
+
},
|
|
112
|
+
then(onfulfilled, onrejected) {
|
|
113
|
+
return poller.pollUntilDone().then(onfulfilled, onrejected);
|
|
114
|
+
},
|
|
115
|
+
catch(onrejected) {
|
|
116
|
+
return poller.pollUntilDone().catch(onrejected);
|
|
117
|
+
},
|
|
118
|
+
finally(onfinally) {
|
|
119
|
+
return poller.pollUntilDone().finally(onfinally);
|
|
120
|
+
},
|
|
121
|
+
[Symbol.toStringTag]: "Poller",
|
|
115
122
|
};
|
|
116
123
|
return poller;
|
|
117
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAkBlC,
|
|
1
|
+
{"version":3,"file":"beginSubmitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAkBlC,sEAiJC;AA5JD,gDAAyC;AACzC,yEAAmE;AACnE,+EAAyE;AAEzE;;;;;;GAMG;AACI,KAAK,UAAU,6BAA6B,CACjD,OAAsC,EACtC,kBAAsC,EACtC,yBAAiD,EAAE;;IAEnD,IAAI,YAAY,GAAG,MAAM,IAAA,sDAAwB,EAC/C,OAAO,EACP,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;IAIF,MAAM,KAAK,GAAuC;QAChD,MAAM,EAAE,YAAY;KACrB,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrD,MAAM,wBAAwB,GAAG,KAAK,IAAmB,EAAE,CACzD,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,IAAI,aAAsD,CAAC;IAC3D,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9C,MAAM,uBAAuB,GAAG,MAAA,sBAAsB,CAAC,kBAAkB,mCAAI,IAAI,CAAC;IAElF,MAAM,MAAM,GAAuE;QACjF,KAAK,CAAC,IAAI,CAAC,OAEV;YACC,YAAY,GAAG,MAAM,IAAA,gDAAqB,EAAC,OAAO,EAAE,YAAY,CAAC,KAAM,EAAE,OAAO,CAAC,CAAC;YAClF,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC3E,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;YAC3B,CAAC;YAED,IAAI,YAAY,C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ACR,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,cAAc;YAChB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,MAAM;YACR,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;QAED,KAAK,CAAC,SAAS;YACb,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACnC,CAAC;QAED,KAAK,CAAC,SAAS;YACb,QAAQ;YACR,OAAO;QACT,CAAC;QAED,IAAI,CACF,WAGQ,EACR,UAAmF;YAEnF,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CACH,UAAmF;YAEnF,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,SAA2C;YACjD,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QACD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ;KAC/B,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress, OperationState, PollerLike } from \"@azure/core-lro\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PolledOperationOptions } from \"../models/options.js\";\nimport { delay } from \"@azure/core-util\";\nimport { getNotificationHubJob } from \"./getNotificationHubJob.js\";\nimport { submitNotificationHubJob } from \"./submitNotificationHubJob.js\";\n\n/**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param context - The Notification Hubs client.\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 */\nexport async function beginSubmitNotificationHubJob(\n context: NotificationHubsClientContext,\n notificationHubJob: NotificationHubJob,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<NotificationHubJobPoller> {\n let submittedJob = await submitNotificationHubJob(\n context,\n notificationHubJob,\n polledOperationOptions,\n );\n\n type Handler = (state: OperationState<NotificationHubJob>) => void;\n\n const state: OperationState<NotificationHubJob> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<NotificationHubJob> | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: PollerLike<OperationState<NotificationHubJob>, NotificationHubJob> = {\n async poll(options?: {\n abortSignal?: AbortSignalLike;\n }): Promise<OperationState<NotificationHubJob>> {\n submittedJob = await getNotificationHubJob(context, submittedJob.jobId!, options);\n if (submittedJob.status === \"Running\" || submittedJob.status === \"Started\") {\n state.status = \"running\";\n }\n\n if (submittedJob.status === \"Completed\") {\n state.status = \"succeeded\";\n state.result = submittedJob;\n }\n\n if (submittedJob.status === \"Failed\") {\n state.status = \"failed\";\n state.error = new Error(submittedJob.failure);\n }\n\n await processProgressCallbacks();\n\n if (state.status === \"canceled\") {\n throw new Error(\"Operation was canceled\");\n }\n if (state.status === \"failed\") {\n throw state.error;\n }\n\n return state;\n },\n\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<NotificationHubJob> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone) {\n await poller.poll({ abortSignal });\n while (!poller.isDone) {\n await delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n return poller.result as NotificationHubJob;\n case \"canceled\":\n throw new Error(\"Operation was canceled\");\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(callback: (state: OperationState<NotificationHubJob>) => void): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n get isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n get operationState(): OperationState<NotificationHubJob> | undefined {\n return state;\n },\n\n get result(): NotificationHubJob | undefined {\n return state.result;\n },\n\n async serialize(): Promise<string> {\n return JSON.stringify({ state });\n },\n\n async submitted() {\n // No-op\n return;\n },\n\n then<TResult1 = NotificationHubJob, TResult2 = never>(\n onfulfilled?:\n | ((value: NotificationHubJob) => TResult1 | PromiseLike<TResult1>)\n | undefined\n | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<TResult1 | TResult2> {\n return poller.pollUntilDone().then(onfulfilled, onrejected);\n },\n catch<TResult2 = never>(\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<NotificationHubJob | TResult2> {\n return poller.pollUntilDone().catch(onrejected);\n },\n finally(onfinally?: (() => void) | undefined | null): Promise<NotificationHubJob> {\n return poller.pollUntilDone().finally(onfinally);\n },\n [Symbol.toStringTag]: \"Poller\",\n };\n\n return poller;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationState,
|
|
1
|
+
import { OperationState, PollerLike } from "@azure/core-lro";
|
|
2
2
|
/**
|
|
3
3
|
* Describes the types of notification hub jobs.
|
|
4
4
|
*/
|
|
@@ -105,5 +105,5 @@ export interface NotificationHubJob {
|
|
|
105
105
|
/**
|
|
106
106
|
* Describes a poller for NotificationHubJob types.
|
|
107
107
|
*/
|
|
108
|
-
export type NotificationHubJobPoller =
|
|
108
|
+
export type NotificationHubJobPoller = PollerLike<OperationState<NotificationHubJob>, NotificationHubJob>;
|
|
109
109
|
//# sourceMappingURL=notificationHubJob.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"notificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,sBAAsB;AAChC;;GAEG;AACD,qBAAqB;AAEvB;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,wBAAwB;AAClC;;GAEG;AACD,SAAS;AAEX;;;GAGG;GACD,SAAS;AAEX;;;GAGG;GACD,WAAW;AAEb;;GAEG;GACD,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAElC;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C,cAAc,CAAC,kBAAkB,CAAC,EAClC,kBAAkB,CACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState,
|
|
1
|
+
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState, PollerLike } from \"@azure/core-lro\";\n\n/**\n * Describes the types of notification hub jobs.\n */\nexport type NotificationHubJobType =\n /**\n * Job type to bulk get registrations.\n */\n | \"ExportRegistrations\"\n\n /**\n * Job type to bulk create registrations.\n */\n | \"ImportCreateRegistrations\"\n\n /**\n * Job type to bulk update registrations.\n */\n | \"ImportUpdateRegistrations\"\n\n /**\n * Job type to bulk delete registrations.\n */\n | \"ImportDeleteRegistrations\"\n\n /**\n * Job type to bulk upsert registrations.\n */\n | \"ImportUpsertRegistrations\";\n\n/**\n * Describes the types of notification hub job statuses.\n */\nexport type NotificationHubJobStatus =\n /**\n * Indicates that the NotificationHubJob was accepted.\n */\n | \"Started\"\n\n /**\n * Indicates that the NotificationHubJob is currently running. Depending on the amount of data,\n * a job may stay in this state for several hours.\n */\n | \"Running\"\n\n /**\n * Indicates that the NotificationHubJob was completed successfully. Any output\n * will be ready where configured via the NotificationHubJob object.\n */\n | \"Completed\"\n\n /**\n * Indicates that the NotificationHubJob has failed.\n */\n | \"Failed\";\n\n/**\n * Represents a Notification Hub Job.\n */\nexport interface NotificationHubJob {\n /**\n * The unique job identifier.\n */\n jobId?: string;\n\n /**\n * The output file name.\n */\n outputFileName?: string;\n\n /**\n * The file name for the job failures.\n */\n failuresFileName?: string;\n\n /**\n * The progress for the job.\n */\n progress?: number;\n\n /**\n * The type of job.\n */\n type: NotificationHubJobType;\n\n /**\n * The status of the job.\n */\n status?: NotificationHubJobStatus;\n\n /**\n * The output container URL.\n */\n outputContainerUrl: string;\n\n /**\n * The import file URL.\n */\n importFileUrl?: string;\n\n /**\n * The input properties for the notification hub job.\n */\n inputProperties?: Record<string, string>;\n\n /**\n * Gets the notification hub job failure message.\n */\n failure?: string;\n\n /**\n * The output properties for the notification hub job.\n */\n outputProperties?: Record<string, string>;\n\n /**\n * Notification hub job created date.\n */\n createdAt?: Date;\n\n /**\n * Notification hub job last updated date.\n */\n updatedAt?: Date;\n}\n\n/**\n * Describes a poller for NotificationHubJob types.\n */\nexport type NotificationHubJobPoller = PollerLike<\n OperationState<NotificationHubJob>,\n NotificationHubJob\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,CA6InC"}
|
|
@@ -19,7 +19,6 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
19
19
|
const progressCallbacks = new Map();
|
|
20
20
|
const processProgressCallbacks = async () => progressCallbacks.forEach((h) => h(state));
|
|
21
21
|
let resultPromise;
|
|
22
|
-
let cancelJob;
|
|
23
22
|
const abortController = new AbortController();
|
|
24
23
|
const currentPollIntervalInMs = (_a = polledOperationOptions.updateIntervalInMs) !== null && _a !== void 0 ? _a : 2000;
|
|
25
24
|
const poller = {
|
|
@@ -43,6 +42,7 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
43
42
|
if (state.status === "failed") {
|
|
44
43
|
throw state.error;
|
|
45
44
|
}
|
|
45
|
+
return state;
|
|
46
46
|
},
|
|
47
47
|
pollUntilDone(pollOptions) {
|
|
48
48
|
return (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => {
|
|
@@ -59,9 +59,9 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
59
59
|
inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true });
|
|
60
60
|
}
|
|
61
61
|
try {
|
|
62
|
-
if (!poller.isDone
|
|
62
|
+
if (!poller.isDone) {
|
|
63
63
|
await poller.poll({ abortSignal });
|
|
64
|
-
while (!poller.isDone
|
|
64
|
+
while (!poller.isDone) {
|
|
65
65
|
await delay(currentPollIntervalInMs, { abortSignal });
|
|
66
66
|
await poller.poll({ abortSignal });
|
|
67
67
|
}
|
|
@@ -72,7 +72,7 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
72
72
|
}
|
|
73
73
|
switch (state.status) {
|
|
74
74
|
case "succeeded":
|
|
75
|
-
return poller.
|
|
75
|
+
return poller.result;
|
|
76
76
|
case "canceled":
|
|
77
77
|
throw new Error("Operation was canceled");
|
|
78
78
|
case "failed":
|
|
@@ -90,25 +90,32 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
90
90
|
progressCallbacks.set(s, callback);
|
|
91
91
|
return () => progressCallbacks.delete(s);
|
|
92
92
|
},
|
|
93
|
-
isDone() {
|
|
93
|
+
get isDone() {
|
|
94
94
|
return ["succeeded", "failed", "canceled"].includes(state.status);
|
|
95
95
|
},
|
|
96
|
-
|
|
97
|
-
abortController.abort();
|
|
98
|
-
cancelJob === null || cancelJob === void 0 ? void 0 : cancelJob();
|
|
99
|
-
},
|
|
100
|
-
isStopped() {
|
|
101
|
-
return resultPromise === undefined;
|
|
102
|
-
},
|
|
103
|
-
getOperationState() {
|
|
96
|
+
get operationState() {
|
|
104
97
|
return state;
|
|
105
98
|
},
|
|
106
|
-
|
|
99
|
+
get result() {
|
|
107
100
|
return state.result;
|
|
108
101
|
},
|
|
109
|
-
|
|
102
|
+
async serialize() {
|
|
110
103
|
return JSON.stringify({ state });
|
|
111
104
|
},
|
|
105
|
+
async submitted() {
|
|
106
|
+
// No-op
|
|
107
|
+
return;
|
|
108
|
+
},
|
|
109
|
+
then(onfulfilled, onrejected) {
|
|
110
|
+
return poller.pollUntilDone().then(onfulfilled, onrejected);
|
|
111
|
+
},
|
|
112
|
+
catch(onrejected) {
|
|
113
|
+
return poller.pollUntilDone().catch(onrejected);
|
|
114
|
+
},
|
|
115
|
+
finally(onfinally) {
|
|
116
|
+
return poller.pollUntilDone().finally(onfinally);
|
|
117
|
+
},
|
|
118
|
+
[Symbol.toStringTag]: "Poller",
|
|
112
119
|
};
|
|
113
120
|
return poller;
|
|
114
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAsC,EACtC,kBAAsC,EACtC,yBAAiD,EAAE;;IAEnD,IAAI,YAAY,GAAG,MAAM,wBAAwB,CAC/C,OAAO,EACP,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;IAIF,MAAM,KAAK,GAAuC;QAChD,MAAM,EAAE,YAAY;KACrB,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrD,MAAM,wBAAwB,GAAG,KAAK,IAAmB,EAAE,CACzD,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,IAAI,aAAsD,CA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CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,cAAc;YAChB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,MAAM;YACR,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;QAED,KAAK,CAAC,SAAS;YACb,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACnC,CAAC;QAED,KAAK,CAAC,SAAS;YACb,QAAQ;YACR,OAAO;QACT,CAAC;QAED,IAAI,CACF,WAGQ,EACR,UAAmF;YAEnF,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CACH,UAAmF;YAEnF,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,SAA2C;YACjD,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QACD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ;KAC/B,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress, OperationState, PollerLike } from \"@azure/core-lro\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PolledOperationOptions } from \"../models/options.js\";\nimport { delay } from \"@azure/core-util\";\nimport { getNotificationHubJob } from \"./getNotificationHubJob.js\";\nimport { submitNotificationHubJob } from \"./submitNotificationHubJob.js\";\n\n/**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param context - The Notification Hubs client.\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 */\nexport async function beginSubmitNotificationHubJob(\n context: NotificationHubsClientContext,\n notificationHubJob: NotificationHubJob,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<NotificationHubJobPoller> {\n let submittedJob = await submitNotificationHubJob(\n context,\n notificationHubJob,\n polledOperationOptions,\n );\n\n type Handler = (state: OperationState<NotificationHubJob>) => void;\n\n const state: OperationState<NotificationHubJob> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<NotificationHubJob> | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: PollerLike<OperationState<NotificationHubJob>, NotificationHubJob> = {\n async poll(options?: {\n abortSignal?: AbortSignalLike;\n }): Promise<OperationState<NotificationHubJob>> {\n submittedJob = await getNotificationHubJob(context, submittedJob.jobId!, options);\n if (submittedJob.status === \"Running\" || submittedJob.status === \"Started\") {\n state.status = \"running\";\n }\n\n if (submittedJob.status === \"Completed\") {\n state.status = \"succeeded\";\n state.result = submittedJob;\n }\n\n if (submittedJob.status === \"Failed\") {\n state.status = \"failed\";\n state.error = new Error(submittedJob.failure);\n }\n\n await processProgressCallbacks();\n\n if (state.status === \"canceled\") {\n throw new Error(\"Operation was canceled\");\n }\n if (state.status === \"failed\") {\n throw state.error;\n }\n\n return state;\n },\n\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<NotificationHubJob> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone) {\n await poller.poll({ abortSignal });\n while (!poller.isDone) {\n await delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n return poller.result as NotificationHubJob;\n case \"canceled\":\n throw new Error(\"Operation was canceled\");\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(callback: (state: OperationState<NotificationHubJob>) => void): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n get isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n get operationState(): OperationState<NotificationHubJob> | undefined {\n return state;\n },\n\n get result(): NotificationHubJob | undefined {\n return state.result;\n },\n\n async serialize(): Promise<string> {\n return JSON.stringify({ state });\n },\n\n async submitted() {\n // No-op\n return;\n },\n\n then<TResult1 = NotificationHubJob, TResult2 = never>(\n onfulfilled?:\n | ((value: NotificationHubJob) => TResult1 | PromiseLike<TResult1>)\n | undefined\n | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<TResult1 | TResult2> {\n return poller.pollUntilDone().then(onfulfilled, onrejected);\n },\n catch<TResult2 = never>(\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<NotificationHubJob | TResult2> {\n return poller.pollUntilDone().catch(onrejected);\n },\n finally(onfinally?: (() => void) | undefined | null): Promise<NotificationHubJob> {\n return poller.pollUntilDone().finally(onfinally);\n },\n [Symbol.toStringTag]: \"Poller\",\n };\n\n return poller;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationState,
|
|
1
|
+
import { OperationState, PollerLike } from "@azure/core-lro";
|
|
2
2
|
/**
|
|
3
3
|
* Describes the types of notification hub jobs.
|
|
4
4
|
*/
|
|
@@ -105,5 +105,5 @@ export interface NotificationHubJob {
|
|
|
105
105
|
/**
|
|
106
106
|
* Describes a poller for NotificationHubJob types.
|
|
107
107
|
*/
|
|
108
|
-
export type NotificationHubJobPoller =
|
|
108
|
+
export type NotificationHubJobPoller = PollerLike<OperationState<NotificationHubJob>, NotificationHubJob>;
|
|
109
109
|
//# sourceMappingURL=notificationHubJob.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"notificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,sBAAsB;AAChC;;GAEG;AACD,qBAAqB;AAEvB;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,wBAAwB;AAClC;;GAEG;AACD,SAAS;AAEX;;;GAGG;GACD,SAAS;AAEX;;;GAGG;GACD,WAAW;AAEb;;GAEG;GACD,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAElC;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C,cAAc,CAAC,kBAAkB,CAAC,EAClC,kBAAkB,CACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState,
|
|
1
|
+
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState, PollerLike } from \"@azure/core-lro\";\n\n/**\n * Describes the types of notification hub jobs.\n */\nexport type NotificationHubJobType =\n /**\n * Job type to bulk get registrations.\n */\n | \"ExportRegistrations\"\n\n /**\n * Job type to bulk create registrations.\n */\n | \"ImportCreateRegistrations\"\n\n /**\n * Job type to bulk update registrations.\n */\n | \"ImportUpdateRegistrations\"\n\n /**\n * Job type to bulk delete registrations.\n */\n | \"ImportDeleteRegistrations\"\n\n /**\n * Job type to bulk upsert registrations.\n */\n | \"ImportUpsertRegistrations\";\n\n/**\n * Describes the types of notification hub job statuses.\n */\nexport type NotificationHubJobStatus =\n /**\n * Indicates that the NotificationHubJob was accepted.\n */\n | \"Started\"\n\n /**\n * Indicates that the NotificationHubJob is currently running. Depending on the amount of data,\n * a job may stay in this state for several hours.\n */\n | \"Running\"\n\n /**\n * Indicates that the NotificationHubJob was completed successfully. Any output\n * will be ready where configured via the NotificationHubJob object.\n */\n | \"Completed\"\n\n /**\n * Indicates that the NotificationHubJob has failed.\n */\n | \"Failed\";\n\n/**\n * Represents a Notification Hub Job.\n */\nexport interface NotificationHubJob {\n /**\n * The unique job identifier.\n */\n jobId?: string;\n\n /**\n * The output file name.\n */\n outputFileName?: string;\n\n /**\n * The file name for the job failures.\n */\n failuresFileName?: string;\n\n /**\n * The progress for the job.\n */\n progress?: number;\n\n /**\n * The type of job.\n */\n type: NotificationHubJobType;\n\n /**\n * The status of the job.\n */\n status?: NotificationHubJobStatus;\n\n /**\n * The output container URL.\n */\n outputContainerUrl: string;\n\n /**\n * The import file URL.\n */\n importFileUrl?: string;\n\n /**\n * The input properties for the notification hub job.\n */\n inputProperties?: Record<string, string>;\n\n /**\n * Gets the notification hub job failure message.\n */\n failure?: string;\n\n /**\n * The output properties for the notification hub job.\n */\n outputProperties?: Record<string, string>;\n\n /**\n * Notification hub job created date.\n */\n createdAt?: Date;\n\n /**\n * Notification hub job last updated date.\n */\n updatedAt?: Date;\n}\n\n/**\n * Describes a poller for NotificationHubJob types.\n */\nexport type NotificationHubJobPoller = PollerLike<\n OperationState<NotificationHubJob>,\n NotificationHubJob\n>;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClientOptions } from '@azure-rest/core-client';
|
|
2
2
|
import { OperationOptions } from '@azure-rest/core-client';
|
|
3
3
|
import { OperationState } from '@azure/core-lro';
|
|
4
|
-
import {
|
|
4
|
+
import { PollerLike } from '@azure/core-lro';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Represents an Amazon Device Messaging (ADM) based installation.
|
|
@@ -2151,7 +2151,7 @@ export declare interface NotificationHubJob {
|
|
|
2151
2151
|
/**
|
|
2152
2152
|
* Describes a poller for NotificationHubJob types.
|
|
2153
2153
|
*/
|
|
2154
|
-
export declare type NotificationHubJobPoller =
|
|
2154
|
+
export declare type NotificationHubJobPoller = PollerLike<OperationState<NotificationHubJob>, NotificationHubJob>;
|
|
2155
2155
|
|
|
2156
2156
|
/**
|
|
2157
2157
|
* Describes the types of notification hub job statuses.
|
|
@@ -2,7 +2,7 @@ import { ClientOptions } from '@azure-rest/core-client';
|
|
|
2
2
|
import { OperationOptions } from '@azure-rest/core-client';
|
|
3
3
|
import { OperationState } from '@azure/core-lro';
|
|
4
4
|
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
5
|
-
import {
|
|
5
|
+
import { PollerLike } from '@azure/core-lro';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Represents an Amazon Device Messaging (ADM) based installation.
|
|
@@ -2152,7 +2152,7 @@ export declare interface NotificationHubJob {
|
|
|
2152
2152
|
/**
|
|
2153
2153
|
* Describes a poller for NotificationHubJob types.
|
|
2154
2154
|
*/
|
|
2155
|
-
export declare type NotificationHubJobPoller =
|
|
2155
|
+
export declare type NotificationHubJobPoller = PollerLike<OperationState<NotificationHubJob>, NotificationHubJob>;
|
|
2156
2156
|
|
|
2157
2157
|
/**
|
|
2158
2158
|
* Describes the types of notification hub job statuses.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"beginSubmitNotificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAK9D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,6BAA6B,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,GAAE,sBAA2B,GAClD,OAAO,CAAC,wBAAwB,CAAC,CA6InC"}
|
|
@@ -19,7 +19,6 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
19
19
|
const progressCallbacks = new Map();
|
|
20
20
|
const processProgressCallbacks = async () => progressCallbacks.forEach((h) => h(state));
|
|
21
21
|
let resultPromise;
|
|
22
|
-
let cancelJob;
|
|
23
22
|
const abortController = new AbortController();
|
|
24
23
|
const currentPollIntervalInMs = (_a = polledOperationOptions.updateIntervalInMs) !== null && _a !== void 0 ? _a : 2000;
|
|
25
24
|
const poller = {
|
|
@@ -43,6 +42,7 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
43
42
|
if (state.status === "failed") {
|
|
44
43
|
throw state.error;
|
|
45
44
|
}
|
|
45
|
+
return state;
|
|
46
46
|
},
|
|
47
47
|
pollUntilDone(pollOptions) {
|
|
48
48
|
return (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => {
|
|
@@ -59,9 +59,9 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
59
59
|
inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true });
|
|
60
60
|
}
|
|
61
61
|
try {
|
|
62
|
-
if (!poller.isDone
|
|
62
|
+
if (!poller.isDone) {
|
|
63
63
|
await poller.poll({ abortSignal });
|
|
64
|
-
while (!poller.isDone
|
|
64
|
+
while (!poller.isDone) {
|
|
65
65
|
await delay(currentPollIntervalInMs, { abortSignal });
|
|
66
66
|
await poller.poll({ abortSignal });
|
|
67
67
|
}
|
|
@@ -72,7 +72,7 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
72
72
|
}
|
|
73
73
|
switch (state.status) {
|
|
74
74
|
case "succeeded":
|
|
75
|
-
return poller.
|
|
75
|
+
return poller.result;
|
|
76
76
|
case "canceled":
|
|
77
77
|
throw new Error("Operation was canceled");
|
|
78
78
|
case "failed":
|
|
@@ -90,25 +90,32 @@ export async function beginSubmitNotificationHubJob(context, notificationHubJob,
|
|
|
90
90
|
progressCallbacks.set(s, callback);
|
|
91
91
|
return () => progressCallbacks.delete(s);
|
|
92
92
|
},
|
|
93
|
-
isDone() {
|
|
93
|
+
get isDone() {
|
|
94
94
|
return ["succeeded", "failed", "canceled"].includes(state.status);
|
|
95
95
|
},
|
|
96
|
-
|
|
97
|
-
abortController.abort();
|
|
98
|
-
cancelJob === null || cancelJob === void 0 ? void 0 : cancelJob();
|
|
99
|
-
},
|
|
100
|
-
isStopped() {
|
|
101
|
-
return resultPromise === undefined;
|
|
102
|
-
},
|
|
103
|
-
getOperationState() {
|
|
96
|
+
get operationState() {
|
|
104
97
|
return state;
|
|
105
98
|
},
|
|
106
|
-
|
|
99
|
+
get result() {
|
|
107
100
|
return state.result;
|
|
108
101
|
},
|
|
109
|
-
|
|
102
|
+
async serialize() {
|
|
110
103
|
return JSON.stringify({ state });
|
|
111
104
|
},
|
|
105
|
+
async submitted() {
|
|
106
|
+
// No-op
|
|
107
|
+
return;
|
|
108
|
+
},
|
|
109
|
+
then(onfulfilled, onrejected) {
|
|
110
|
+
return poller.pollUntilDone().then(onfulfilled, onrejected);
|
|
111
|
+
},
|
|
112
|
+
catch(onrejected) {
|
|
113
|
+
return poller.pollUntilDone().catch(onrejected);
|
|
114
|
+
},
|
|
115
|
+
finally(onfinally) {
|
|
116
|
+
return poller.pollUntilDone().finally(onfinally);
|
|
117
|
+
},
|
|
118
|
+
[Symbol.toStringTag]: "Poller",
|
|
112
119
|
};
|
|
113
120
|
return poller;
|
|
114
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beginSubmitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAsC,EACtC,kBAAsC,EACtC,yBAAiD,EAAE;;IAEnD,IAAI,YAAY,GAAG,MAAM,wBAAwB,CAC/C,OAAO,EACP,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;IAIF,MAAM,KAAK,GAAuC;QAChD,MAAM,EAAE,YAAY;KACrB,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrD,MAAM,wBAAwB,GAAG,KAAK,IAAmB,EAAE,CACzD,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,IAAI,aAAsD,CAAC;IAC3D,
|
|
1
|
+
{"version":3,"file":"beginSubmitNotificationHubJob.js","sourceRoot":"","sources":["../../../src/api/beginSubmitNotificationHubJob.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CAAC;QAED,IAAI,cAAc;YAChB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,MAAM;YACR,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;QAED,KAAK,CAAC,SAAS;YACb,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACnC,CAAC;QAED,KAAK,CAAC,SAAS;YACb,QAAQ;YACR,OAAO;QACT,CAAC;QAED,IAAI,CACF,WAGQ,EACR,UAAmF;YAEnF,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CACH,UAAmF;YAEnF,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,SAA2C;YACjD,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QACD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ;KAC/B,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress, OperationState, PollerLike } from \"@azure/core-lro\";\nimport { NotificationHubJob, NotificationHubJobPoller } from \"../models/notificationHubJob.js\";\nimport { NotificationHubsClientContext } from \"./index.js\";\nimport { PolledOperationOptions } from \"../models/options.js\";\nimport { delay } from \"@azure/core-util\";\nimport { getNotificationHubJob } from \"./getNotificationHubJob.js\";\nimport { submitNotificationHubJob } from \"./submitNotificationHubJob.js\";\n\n/**\n * Submits a Notification Hub job and creates a poller to poll for results.\n * @param context - The Notification Hubs client.\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 */\nexport async function beginSubmitNotificationHubJob(\n context: NotificationHubsClientContext,\n notificationHubJob: NotificationHubJob,\n polledOperationOptions: PolledOperationOptions = {},\n): Promise<NotificationHubJobPoller> {\n let submittedJob = await submitNotificationHubJob(\n context,\n notificationHubJob,\n polledOperationOptions,\n );\n\n type Handler = (state: OperationState<NotificationHubJob>) => void;\n\n const state: OperationState<NotificationHubJob> = {\n status: \"notStarted\",\n };\n\n const progressCallbacks = new Map<symbol, Handler>();\n const processProgressCallbacks = async (): Promise<void> =>\n progressCallbacks.forEach((h) => h(state));\n let resultPromise: Promise<NotificationHubJob> | undefined;\n const abortController = new AbortController();\n const currentPollIntervalInMs = polledOperationOptions.updateIntervalInMs ?? 2000;\n\n const poller: PollerLike<OperationState<NotificationHubJob>, NotificationHubJob> = {\n async poll(options?: {\n abortSignal?: AbortSignalLike;\n }): Promise<OperationState<NotificationHubJob>> {\n submittedJob = await getNotificationHubJob(context, submittedJob.jobId!, options);\n if (submittedJob.status === \"Running\" || submittedJob.status === \"Started\") {\n state.status = \"running\";\n }\n\n if (submittedJob.status === \"Completed\") {\n state.status = \"succeeded\";\n state.result = submittedJob;\n }\n\n if (submittedJob.status === \"Failed\") {\n state.status = \"failed\";\n state.error = new Error(submittedJob.failure);\n }\n\n await processProgressCallbacks();\n\n if (state.status === \"canceled\") {\n throw new Error(\"Operation was canceled\");\n }\n if (state.status === \"failed\") {\n throw state.error;\n }\n\n return state;\n },\n\n pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<NotificationHubJob> {\n return (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n // In the future we can use AbortSignal.any() instead\n function abortListener(): void {\n abortController.abort();\n }\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, { once: true });\n }\n\n try {\n if (!poller.isDone) {\n await poller.poll({ abortSignal });\n while (!poller.isDone) {\n await delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n switch (state.status) {\n case \"succeeded\":\n return poller.result as NotificationHubJob;\n case \"canceled\":\n throw new Error(\"Operation was canceled\");\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n })().finally(() => {\n resultPromise = undefined;\n }));\n },\n\n onProgress(callback: (state: OperationState<NotificationHubJob>) => void): CancelOnProgress {\n const s = Symbol();\n progressCallbacks.set(s, callback);\n\n return () => progressCallbacks.delete(s);\n },\n\n get isDone(): boolean {\n return [\"succeeded\", \"failed\", \"canceled\"].includes(state.status);\n },\n\n get operationState(): OperationState<NotificationHubJob> | undefined {\n return state;\n },\n\n get result(): NotificationHubJob | undefined {\n return state.result;\n },\n\n async serialize(): Promise<string> {\n return JSON.stringify({ state });\n },\n\n async submitted() {\n // No-op\n return;\n },\n\n then<TResult1 = NotificationHubJob, TResult2 = never>(\n onfulfilled?:\n | ((value: NotificationHubJob) => TResult1 | PromiseLike<TResult1>)\n | undefined\n | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<TResult1 | TResult2> {\n return poller.pollUntilDone().then(onfulfilled, onrejected);\n },\n catch<TResult2 = never>(\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n ): Promise<NotificationHubJob | TResult2> {\n return poller.pollUntilDone().catch(onrejected);\n },\n finally(onfinally?: (() => void) | undefined | null): Promise<NotificationHubJob> {\n return poller.pollUntilDone().finally(onfinally);\n },\n [Symbol.toStringTag]: \"Poller\",\n };\n\n return poller;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationState,
|
|
1
|
+
import { OperationState, PollerLike } from "@azure/core-lro";
|
|
2
2
|
/**
|
|
3
3
|
* Describes the types of notification hub jobs.
|
|
4
4
|
*/
|
|
@@ -105,5 +105,5 @@ export interface NotificationHubJob {
|
|
|
105
105
|
/**
|
|
106
106
|
* Describes a poller for NotificationHubJob types.
|
|
107
107
|
*/
|
|
108
|
-
export type NotificationHubJobPoller =
|
|
108
|
+
export type NotificationHubJobPoller = PollerLike<OperationState<NotificationHubJob>, NotificationHubJob>;
|
|
109
109
|
//# sourceMappingURL=notificationHubJob.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"notificationHubJob.d.ts","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,sBAAsB;AAChC;;GAEG;AACD,qBAAqB;AAEvB;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B;AAE7B;;GAEG;GACD,2BAA2B,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,wBAAwB;AAClC;;GAEG;AACD,SAAS;AAEX;;;GAGG;GACD,SAAS;AAEX;;;GAGG;GACD,WAAW;AAEb;;GAEG;GACD,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAElC;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C,cAAc,CAAC,kBAAkB,CAAC,EAClC,kBAAkB,CACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState,
|
|
1
|
+
{"version":3,"file":"notificationHubJob.js","sourceRoot":"","sources":["../../../src/models/notificationHubJob.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationState, PollerLike } from \"@azure/core-lro\";\n\n/**\n * Describes the types of notification hub jobs.\n */\nexport type NotificationHubJobType =\n /**\n * Job type to bulk get registrations.\n */\n | \"ExportRegistrations\"\n\n /**\n * Job type to bulk create registrations.\n */\n | \"ImportCreateRegistrations\"\n\n /**\n * Job type to bulk update registrations.\n */\n | \"ImportUpdateRegistrations\"\n\n /**\n * Job type to bulk delete registrations.\n */\n | \"ImportDeleteRegistrations\"\n\n /**\n * Job type to bulk upsert registrations.\n */\n | \"ImportUpsertRegistrations\";\n\n/**\n * Describes the types of notification hub job statuses.\n */\nexport type NotificationHubJobStatus =\n /**\n * Indicates that the NotificationHubJob was accepted.\n */\n | \"Started\"\n\n /**\n * Indicates that the NotificationHubJob is currently running. Depending on the amount of data,\n * a job may stay in this state for several hours.\n */\n | \"Running\"\n\n /**\n * Indicates that the NotificationHubJob was completed successfully. Any output\n * will be ready where configured via the NotificationHubJob object.\n */\n | \"Completed\"\n\n /**\n * Indicates that the NotificationHubJob has failed.\n */\n | \"Failed\";\n\n/**\n * Represents a Notification Hub Job.\n */\nexport interface NotificationHubJob {\n /**\n * The unique job identifier.\n */\n jobId?: string;\n\n /**\n * The output file name.\n */\n outputFileName?: string;\n\n /**\n * The file name for the job failures.\n */\n failuresFileName?: string;\n\n /**\n * The progress for the job.\n */\n progress?: number;\n\n /**\n * The type of job.\n */\n type: NotificationHubJobType;\n\n /**\n * The status of the job.\n */\n status?: NotificationHubJobStatus;\n\n /**\n * The output container URL.\n */\n outputContainerUrl: string;\n\n /**\n * The import file URL.\n */\n importFileUrl?: string;\n\n /**\n * The input properties for the notification hub job.\n */\n inputProperties?: Record<string, string>;\n\n /**\n * Gets the notification hub job failure message.\n */\n failure?: string;\n\n /**\n * The output properties for the notification hub job.\n */\n outputProperties?: Record<string, string>;\n\n /**\n * Notification hub job created date.\n */\n createdAt?: Date;\n\n /**\n * Notification hub job last updated date.\n */\n updatedAt?: Date;\n}\n\n/**\n * Describes a poller for NotificationHubJob types.\n */\nexport type NotificationHubJobPoller = PollerLike<\n OperationState<NotificationHubJob>,\n NotificationHubJob\n>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/notification-hubs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.20240905.2",
|
|
4
4
|
"description": "Azure Notification Hubs SDK for JavaScript",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@azure/core-auth": "^1.7.2",
|
|
82
82
|
"@azure/abort-controller": "^2.1.2",
|
|
83
|
-
"@azure/core-lro": "^
|
|
83
|
+
"@azure/core-lro": "^3.0.0",
|
|
84
84
|
"@azure/core-paging": "^1.6.2",
|
|
85
85
|
"@azure/core-rest-pipeline": "^1.15.2",
|
|
86
86
|
"@azure/core-tracing": "^1.1.2",
|