Permalink
Cannot retrieve contributors at this time
1 lines (1 sloc)
81.2 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/@azure/core-lro/dist/index.js.map
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version":3,"file":"index.js","sources":["../src/logger.ts","../src/poller/constants.ts","../src/poller/operation.ts","../src/http/operation.ts","../src/poller/poller.ts","../src/http/poller.ts","../src/legacy/lroEngine/operation.ts","../src/legacy/poller.ts","../src/legacy/lroEngine/lroEngine.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The `@azure/logger` configuration for this package.\n * @internal\n */\nexport const logger = createClientLogger(\"core-lro\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * The default time interval to wait before sending the next polling request.\n */\nexport const POLL_INTERVAL_IN_MS = 2000;\n/**\n * The closed set of terminal states.\n */\nexport const terminalStates = [\"succeeded\", \"canceled\", \"failed\"];\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n LroError,\n InnerError,\n Operation,\n OperationStatus,\n RestorableOperationState,\n StateProxy,\n} from \"./models\";\nimport { logger } from \"../logger\";\nimport { terminalStates } from \"./constants\";\n\n/**\n * Deserializes the state\n */\nexport function deserializeState<TState>(\n serializedState: string\n): RestorableOperationState<TState> {\n try {\n return JSON.parse(serializedState).state;\n } catch (e) {\n throw new Error(`Unable to deserialize input state: ${serializedState}`);\n }\n}\n\nfunction setStateError<TState, TResult>(inputs: {\n state: TState;\n stateProxy: StateProxy<TState, TResult>;\n isOperationError: (error: Error) => boolean;\n}): (error: Error) => never {\n const { state, stateProxy, isOperationError } = inputs;\n return (error: Error) => {\n if (isOperationError(error)) {\n stateProxy.setError(state, error);\n stateProxy.setFailed(state);\n }\n throw error;\n };\n}\n\nfunction appendReadableErrorMessage(currentMessage: string, innerMessage: string): string {\n let message = currentMessage;\n if (message.slice(-1) !== \".\") {\n message = message + \".\";\n }\n return message + \" \" + innerMessage;\n}\n\nfunction simplifyError(err: LroError): {\n code: string;\n message: string;\n} {\n let message = err.message;\n let code = err.code;\n let curErr = err as InnerError;\n while (curErr.innererror) {\n curErr = curErr.innererror;\n code = curErr.code;\n message = appendReadableErrorMessage(message, curErr.message);\n }\n return {\n code,\n message,\n };\n}\n\nfunction processOperationStatus<TState, TResult, TResponse>(result: {\n status: OperationStatus;\n response: TResponse;\n state: RestorableOperationState<TState>;\n stateProxy: StateProxy<TState, TResult>;\n processResult?: (result: TResponse, state: TState) => TResult;\n getError?: (response: TResponse) => LroError | undefined;\n isDone?: (lastResponse: TResponse, state: TState) => boolean;\n setErrorAsResult: boolean;\n}): void {\n const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } =\n result;\n switch (status) {\n case \"succeeded\": {\n stateProxy.setSucceeded(state);\n break;\n }\n case \"failed\": {\n const err = getError?.(response);\n let postfix = \"\";\n if (err) {\n const { code, message } = simplifyError(err);\n postfix = `. ${code}. ${message}`;\n }\n const errStr = `The long-running operation has failed${postfix}`;\n stateProxy.setError(state, new Error(errStr));\n stateProxy.setFailed(state);\n logger.warning(errStr);\n break;\n }\n case \"canceled\": {\n stateProxy.setCanceled(state);\n break;\n }\n }\n if (\n isDone?.(response, state) ||\n (isDone === undefined &&\n [\"succeeded\", \"canceled\"].concat(setErrorAsResult ? [] : [\"failed\"]).includes(status))\n ) {\n stateProxy.setResult(\n state,\n buildResult({\n response,\n state,\n processResult,\n })\n );\n }\n}\n\nfunction buildResult<TResponse, TResult, TState>(inputs: {\n response: TResponse;\n state: TState;\n processResult?: (result: TResponse, state: TState) => TResult;\n}): TResult {\n const { processResult, response, state } = inputs;\n return processResult ? processResult(response, state) : (response as unknown as TResult);\n}\n\n/**\n * Initiates the long-running operation.\n */\nexport async function initOperation<TResponse, TResult, TState>(inputs: {\n init: Operation<TResponse, unknown>[\"init\"];\n stateProxy: StateProxy<TState, TResult>;\n getOperationStatus: (inputs: {\n response: TResponse;\n state: RestorableOperationState<TState>;\n operationLocation?: string;\n }) => OperationStatus;\n processResult?: (result: TResponse, state: TState) => TResult;\n withOperationLocation?: (operationLocation: string, isUpdated: boolean) => void;\n setErrorAsResult: boolean;\n}): Promise<RestorableOperationState<TState>> {\n const {\n init,\n stateProxy,\n processResult,\n getOperationStatus,\n withOperationLocation,\n setErrorAsResult,\n } = inputs;\n const { operationLocation, resourceLocation, metadata, response } = await init();\n if (operationLocation) withOperationLocation?.(operationLocation, false);\n const config = {\n metadata,\n operationLocation,\n resourceLocation,\n };\n logger.verbose(`LRO: Operation description:`, config);\n const state = stateProxy.initState(config);\n const status = getOperationStatus({ response, state, operationLocation });\n processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult });\n return state;\n}\n\nasync function pollOperationHelper<TResponse, TState, TResult, TOptions>(inputs: {\n poll: Operation<TResponse, TOptions>[\"poll\"];\n stateProxy: StateProxy<TState, TResult>;\n state: RestorableOperationState<TState>;\n operationLocation: string;\n getOperationStatus: (\n response: TResponse,\n state: RestorableOperationState<TState>\n ) => OperationStatus;\n getResourceLocation: (\n response: TResponse,\n state: RestorableOperationState<TState>\n ) => string | undefined;\n isOperationError: (error: Error) => boolean;\n options?: TOptions;\n}): Promise<{\n status: OperationStatus;\n response: TResponse;\n}> {\n const {\n poll,\n state,\n stateProxy,\n operationLocation,\n getOperationStatus,\n getResourceLocation,\n isOperationError,\n options,\n } = inputs;\n const response = await poll(operationLocation, options).catch(\n setStateError({\n state,\n stateProxy,\n isOperationError,\n })\n );\n const status = getOperationStatus(response, state);\n logger.verbose(\n `LRO: Status:\\n\\tPolling from: ${\n state.config.operationLocation\n }\\n\\tOperation status: ${status}\\n\\tPolling status: ${\n terminalStates.includes(status) ? \"Stopped\" : \"Running\"\n }`\n );\n if (status === \"succeeded\") {\n const resourceLocation = getResourceLocation(response, state);\n if (resourceLocation !== undefined) {\n return {\n response: await poll(resourceLocation).catch(\n setStateError({ state, stateProxy, isOperationError })\n ),\n status,\n };\n }\n }\n return { response, status };\n}\n\n/** Polls the long-running operation. */\nexport async function pollOperation<TResponse, TState, TResult, TOptions>(inputs: {\n poll: Operation<TResponse, TOptions>[\"poll\"];\n stateProxy: StateProxy<TState, TResult>;\n state: RestorableOperationState<TState>;\n getOperationStatus: (\n response: TResponse,\n state: RestorableOperationState<TState>\n ) => OperationStatus;\n getResourceLocation: (\n response: TResponse,\n state: RestorableOperationState<TState>\n ) => string | undefined;\n isOperationError: (error: Error) => boolean;\n getPollingInterval?: (response: TResponse) => number | undefined;\n setDelay: (intervalInMs: number) => void;\n getOperationLocation?: (\n response: TResponse,\n state: RestorableOperationState<TState>\n ) => string | undefined;\n withOperationLocation?: (operationLocation: string, isUpdated: boolean) => void;\n processResult?: (result: TResponse, state: TState) => TResult;\n getError?: (response: TResponse) => LroError | undefined;\n updateState?: (state: TState, lastResponse: TResponse) => void;\n isDone?: (lastResponse: TResponse, state: TState) => boolean;\n setErrorAsResult: boolean;\n options?: TOptions;\n}): Promise<void> {\n const {\n poll,\n state,\n stateProxy,\n options,\n getOperationStatus,\n getResourceLocation,\n getOperationLocation,\n isOperationError,\n withOperationLocation,\n getPollingInterval,\n processResult,\n getError,\n updateState,\n setDelay,\n isDone,\n setErrorAsResult,\n } = inputs;\n const { operationLocation } = state.config;\n if (operationLocation !== undefined) {\n const { response, status } = await pollOperationHelper({\n poll,\n getOperationStatus,\n state,\n stateProxy,\n operationLocation,\n getResourceLocation,\n isOperationError,\n options,\n });\n processOperationStatus({\n status,\n response,\n state,\n stateProxy,\n isDone,\n processResult,\n getError,\n setErrorAsResult,\n });\n\n if (!terminalStates.includes(status)) {\n const intervalInMs = getPollingInterval?.(response);\n if (intervalInMs) setDelay(intervalInMs);\n const location = getOperationLocation?.(response, state);\n if (location !== undefined) {\n const isUpdated = operationLocation !== location;\n state.config.operationLocation = location;\n withOperationLocation?.(location, isUpdated);\n } else withOperationLocation?.(operationLocation, false);\n }\n updateState?.(state, response);\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n HttpOperationMode,\n LongRunningOperation,\n LroResourceLocationConfig,\n LroResponse,\n RawResponse,\n ResponseBody,\n} from \"./models\";\nimport {\n LroError,\n OperationConfig,\n OperationStatus,\n RestorableOperationState,\n StateProxy,\n} from \"../poller/models\";\nimport { initOperation, pollOperation } from \"../poller/operation\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { logger } from \"../logger\";\n\nfunction getOperationLocationPollingUrl(inputs: {\n operationLocation?: string;\n azureAsyncOperation?: string;\n}): string | undefined {\n const { azureAsyncOperation, operationLocation } = inputs;\n return operationLocation ?? azureAsyncOperation;\n}\n\nfunction getLocationHeader(rawResponse: RawResponse): string | undefined {\n return rawResponse.headers[\"location\"];\n}\n\nfunction getOperationLocationHeader(rawResponse: RawResponse): string | undefined {\n return rawResponse.headers[\"operation-location\"];\n}\n\nfunction getAzureAsyncOperationHeader(rawResponse: RawResponse): string | undefined {\n return rawResponse.headers[\"azure-asyncoperation\"];\n}\n\nfunction findResourceLocation(inputs: {\n requestMethod?: string;\n location?: string;\n requestPath?: string;\n resourceLocationConfig?: LroResourceLocationConfig;\n}): string | undefined {\n const { location, requestMethod, requestPath, resourceLocationConfig } = inputs;\n switch (requestMethod) {\n case \"PUT\": {\n return requestPath;\n }\n case \"DELETE\": {\n return undefined;\n }\n default: {\n switch (resourceLocationConfig) {\n case \"azure-async-operation\": {\n return undefined;\n }\n case \"original-uri\": {\n return requestPath;\n }\n case \"location\":\n default: {\n return location;\n }\n }\n }\n }\n}\n\nexport function inferLroMode(inputs: {\n rawResponse: RawResponse;\n requestPath?: string;\n requestMethod?: string;\n resourceLocationConfig?: LroResourceLocationConfig;\n}): (OperationConfig & { mode: HttpOperationMode }) | undefined {\n const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs;\n const operationLocation = getOperationLocationHeader(rawResponse);\n const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse);\n const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation });\n const location = getLocationHeader(rawResponse);\n const normalizedRequestMethod = requestMethod?.toLocaleUpperCase();\n if (pollingUrl !== undefined) {\n return {\n mode: \"OperationLocation\",\n operationLocation: pollingUrl,\n resourceLocation: findResourceLocation({\n requestMethod: normalizedRequestMethod,\n location,\n requestPath,\n resourceLocationConfig,\n }),\n };\n } else if (location !== undefined) {\n return {\n mode: \"ResourceLocation\",\n operationLocation: location,\n };\n } else if (normalizedRequestMethod === \"PUT\" && requestPath) {\n return {\n mode: \"Body\",\n operationLocation: requestPath,\n };\n } else {\n return undefined;\n }\n}\n\nfunction transformStatus(inputs: { status: unknown; statusCode: number }): OperationStatus {\n const { status, statusCode } = inputs;\n if (typeof status !== \"string\" && status !== undefined) {\n throw new Error(\n `Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`\n );\n }\n switch (status?.toLocaleLowerCase()) {\n case undefined:\n return toOperationStatus(statusCode);\n case \"succeeded\":\n return \"succeeded\";\n case \"failed\":\n return \"failed\";\n case \"running\":\n case \"accepted\":\n case \"started\":\n case \"canceling\":\n case \"cancelling\":\n return \"running\";\n case \"canceled\":\n case \"cancelled\":\n return \"canceled\";\n default: {\n logger.verbose(`LRO: unrecognized operation status: ${status}`);\n return status as OperationStatus;\n }\n }\n}\n\nfunction getStatus(rawResponse: RawResponse): OperationStatus {\n const { status } = (rawResponse.body as ResponseBody) ?? {};\n return transformStatus({ status, statusCode: rawResponse.statusCode });\n}\n\nfunction getProvisioningState(rawResponse: RawResponse): OperationStatus {\n const { properties, provisioningState } = (rawResponse.body as ResponseBody) ?? {};\n const status = properties?.provisioningState ?? provisioningState;\n return transformStatus({ status, statusCode: rawResponse.statusCode });\n}\n\nfunction toOperationStatus(statusCode: number): OperationStatus {\n if (statusCode === 202) {\n return \"running\";\n } else if (statusCode < 300) {\n return \"succeeded\";\n } else {\n return \"failed\";\n }\n}\n\nexport function parseRetryAfter<T>({ rawResponse }: LroResponse<T>): number | undefined {\n const retryAfter: string | undefined = rawResponse.headers[\"retry-after\"];\n if (retryAfter !== undefined) {\n // Retry-After header value is either in HTTP date format, or in seconds\n const retryAfterInSeconds = parseInt(retryAfter);\n return isNaN(retryAfterInSeconds)\n ? calculatePollingIntervalFromDate(new Date(retryAfter))\n : retryAfterInSeconds * 1000;\n }\n return undefined;\n}\n\nexport function getErrorFromResponse<T>(response: LroResponse<T>): LroError | undefined {\n const error = (response.flatResponse as ResponseBody).error;\n if (!error) {\n logger.warning(\n `The long-running operation failed but there is no error property in the response's body`\n );\n return;\n }\n if (!error.code || !error.message) {\n logger.warning(\n `The long-running operation failed but the error property in the response's body doesn't contain code or message`\n );\n return;\n }\n return error as LroError;\n}\n\nfunction calculatePollingIntervalFromDate(retryAfterDate: Date): number | undefined {\n const timeNow = Math.floor(new Date().getTime());\n const retryAfterTime = retryAfterDate.getTime();\n if (timeNow < retryAfterTime) {\n return retryAfterTime - timeNow;\n }\n return undefined;\n}\n\nexport function getStatusFromInitialResponse<TState>(inputs: {\n response: LroResponse<unknown>;\n state: RestorableOperationState<TState>;\n operationLocation?: string;\n}): OperationStatus {\n const { response, state, operationLocation } = inputs;\n function helper(): OperationStatus {\n const mode = state.config.metadata?.[\"mode\"];\n switch (mode) {\n case undefined:\n return toOperationStatus(response.rawResponse.statusCode);\n case \"Body\":\n return getOperationStatus(response, state);\n default:\n return \"running\";\n }\n }\n const status = helper();\n return status === \"running\" && operationLocation === undefined ? \"succeeded\" : status;\n}\n\n/**\n * Initiates the long-running operation.\n */\nexport async function initHttpOperation<TResult, TState>(inputs: {\n stateProxy: StateProxy<TState, TResult>;\n resourceLocationConfig?: LroResourceLocationConfig;\n processResult?: (result: unknown, state: TState) => TResult;\n setErrorAsResult: boolean;\n lro: LongRunningOperation;\n}): Promise<RestorableOperationState<TState>> {\n const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs;\n return initOperation({\n init: async () => {\n const response = await lro.sendInitialRequest();\n const config = inferLroMode({\n rawResponse: response.rawResponse,\n requestPath: lro.requestPath,\n requestMethod: lro.requestMethod,\n resourceLocationConfig,\n });\n return {\n response,\n operationLocation: config?.operationLocation,\n resourceLocation: config?.resourceLocation,\n ...(config?.mode ? { metadata: { mode: config.mode } } : {}),\n };\n },\n stateProxy,\n processResult: processResult\n ? ({ flatResponse }, state) => processResult(flatResponse, state)\n : ({ flatResponse }) => flatResponse as TResult,\n getOperationStatus: getStatusFromInitialResponse,\n setErrorAsResult,\n });\n}\n\nexport function getOperationLocation<TState>(\n { rawResponse }: LroResponse,\n state: RestorableOperationState<TState>\n): string | undefined {\n const mode = state.config.metadata?.[\"mode\"];\n switch (mode) {\n case \"OperationLocation\": {\n return getOperationLocationPollingUrl({\n operationLocation: getOperationLocationHeader(rawResponse),\n azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse),\n });\n }\n case \"ResourceLocation\": {\n return getLocationHeader(rawResponse);\n }\n case \"Body\":\n default: {\n return undefined;\n }\n }\n}\n\nexport function getOperationStatus<TState>(\n { rawResponse }: LroResponse,\n state: RestorableOperationState<TState>\n): OperationStatus {\n const mode = state.config.metadata?.[\"mode\"];\n switch (mode) {\n case \"OperationLocation\": {\n return getStatus(rawResponse);\n }\n case \"ResourceLocation\": {\n return toOperationStatus(rawResponse.statusCode);\n }\n case \"Body\": {\n return getProvisioningState(rawResponse);\n }\n default:\n throw new Error(`Internal error: Unexpected operation mode: ${mode}`);\n }\n}\n\nexport function getResourceLocation<TState>(\n { flatResponse }: LroResponse,\n state: RestorableOperationState<TState>\n): string | undefined {\n if (typeof flatResponse === \"object\") {\n const resourceLocation = (flatResponse as { resourceLocation?: string }).resourceLocation;\n if (resourceLocation !== undefined) {\n state.config.resourceLocation = resourceLocation;\n }\n }\n return state.config.resourceLocation;\n}\n\nexport function isOperationError(e: Error): boolean {\n return e.name === \"RestError\";\n}\n\n/** Polls the long-running operation. */\nexport async function pollHttpOperation<TState, TResult>(inputs: {\n lro: LongRunningOperation;\n stateProxy: StateProxy<TState, TResult>;\n processResult?: (result: unknown, state: TState) => TResult;\n updateState?: (state: TState, lastResponse: LroResponse) => void;\n isDone?: (lastResponse: LroResponse, state: TState) => boolean;\n setDelay: (intervalInMs: number) => void;\n options?: { abortSignal?: AbortSignalLike };\n state: RestorableOperationState<TState>;\n setErrorAsResult: boolean;\n}): Promise<void> {\n const {\n lro,\n stateProxy,\n options,\n processResult,\n updateState,\n setDelay,\n state,\n setErrorAsResult,\n } = inputs;\n return pollOperation({\n state,\n stateProxy,\n setDelay,\n processResult: processResult\n ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState)\n : ({ flatResponse }) => flatResponse as TResult,\n getError: getErrorFromResponse,\n updateState,\n getPollingInterval: parseRetryAfter,\n getOperationLocation,\n getOperationStatus,\n isOperationError,\n getResourceLocation,\n options,\n /**\n * The expansion here is intentional because `lro` could be an object that\n * references an inner this, so we need to preserve a reference to it.\n */\n poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions),\n setErrorAsResult,\n });\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortController, AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n BuildCreatePollerOptions,\n CreatePollerOptions,\n Operation,\n OperationState,\n RestorableOperationState,\n SimplePollerLike,\n StateProxy,\n} from \"./models\";\nimport { deserializeState, initOperation, pollOperation } from \"./operation\";\nimport { POLL_INTERVAL_IN_MS } from \"./constants\";\nimport { delay } from \"@azure/core-util\";\n\nconst createStateProxy: <TResult, TState extends OperationState<TResult>>() => StateProxy<\n TState,\n TResult\n> = () => ({\n /**\n * The state at this point is created to be of type OperationState<TResult>.\n * It will be updated later to be of type TState when the\n * customer-provided callback, `updateState`, is called during polling.\n */\n initState: (config) => ({ status: \"running\", config } as any),\n setCanceled: (state) => (state.status = \"canceled\"),\n setError: (state, error) => (state.error = error),\n setResult: (state, result) => (state.result = result),\n setRunning: (state) => (state.status = \"running\"),\n setSucceeded: (state) => (state.status = \"succeeded\"),\n setFailed: (state) => (state.status = \"failed\"),\n\n getError: (state) => state.error,\n getResult: (state) => state.result,\n isCanceled: (state) => state.status === \"canceled\",\n isFailed: (state) => state.status === \"failed\",\n isRunning: (state) => state.status === \"running\",\n isSucceeded: (state) => state.status === \"succeeded\",\n});\n\n/**\n * Returns a poller factory.\n */\nexport function buildCreatePoller<TResponse, TResult, TState extends OperationState<TResult>>(\n inputs: BuildCreatePollerOptions<TResponse, TState>\n): (\n lro: Operation<TResponse, { abortSignal?: AbortSignalLike }>,\n options?: CreatePollerOptions<TResponse, TResult, TState>\n) => Promise<SimplePollerLike<TState, TResult>> {\n const {\n getOperationLocation,\n getStatusFromInitialResponse,\n getStatusFromPollResponse,\n isOperationError,\n getResourceLocation,\n getPollingInterval,\n getError,\n resolveOnUnsuccessful,\n } = inputs;\n return async (\n { init, poll }: Operation<TResponse, { abortSignal?: AbortSignalLike }>,\n options?: CreatePollerOptions<TResponse, TResult, TState>\n ) => {\n const {\n processResult,\n updateState,\n withOperationLocation: withOperationLocationCallback,\n intervalInMs = POLL_INTERVAL_IN_MS,\n restoreFrom,\n } = options || {};\n const stateProxy = createStateProxy<TResult, TState>();\n const withOperationLocation = withOperationLocationCallback\n ? (() => {\n let called = false;\n return (operationLocation: string, isUpdated: boolean) => {\n if (isUpdated) withOperationLocationCallback(operationLocation);\n else if (!called) withOperationLocationCallback(operationLocation);\n called = true;\n };\n })()\n : undefined;\n const state: RestorableOperationState<TState> = restoreFrom\n ? deserializeState(restoreFrom)\n : await initOperation({\n init,\n stateProxy,\n processResult,\n getOperationStatus: getStatusFromInitialResponse,\n withOperationLocation,\n setErrorAsResult: !resolveOnUnsuccessful,\n });\n let resultPromise: Promise<TResult> | undefined;\n const abortController = new AbortController();\n // Progress handlers\n type Handler = (state: TState) => void;\n const handlers = new Map<symbol, Handler>();\n const handleProgressEvents = async (): Promise<void> => handlers.forEach((h) => h(state));\n const cancelErrMsg = \"Operation was canceled\";\n let currentPollIntervalInMs = intervalInMs;\n\n const poller: SimplePollerLike<TState, TResult> = {\n getOperationState: () => state,\n getResult: () => state.result,\n isDone: () => [\"succeeded\", \"failed\", \"canceled\"].includes(state.status),\n isStopped: () => resultPromise === undefined,\n stopPolling: () => {\n abortController.abort();\n },\n toString: () =>\n JSON.stringify({\n state,\n }),\n onProgress: (callback: (state: TState) => void) => {\n const s = Symbol();\n handlers.set(s, callback);\n return () => handlers.delete(s);\n },\n pollUntilDone: (pollOptions?: { abortSignal?: AbortSignalLike }) =>\n (resultPromise ??= (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n const { signal: abortSignal } = inputAbortSignal\n ? new AbortController([inputAbortSignal, abortController.signal])\n : abortController;\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 if (resolveOnUnsuccessful) {\n return poller.getResult() as TResult;\n } else {\n switch (state.status) {\n case \"succeeded\":\n return poller.getResult() as TResult;\n case \"canceled\":\n throw new Error(cancelErrMsg);\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 }\n })().finally(() => {\n resultPromise = undefined;\n })),\n async poll(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<void> {\n if (resolveOnUnsuccessful) {\n if (poller.isDone()) return;\n } else {\n switch (state.status) {\n case \"succeeded\":\n return;\n case \"canceled\":\n throw new Error(cancelErrMsg);\n case \"failed\":\n throw state.error;\n }\n }\n await pollOperation({\n poll,\n state,\n stateProxy,\n getOperationLocation,\n isOperationError,\n withOperationLocation,\n getPollingInterval,\n getOperationStatus: getStatusFromPollResponse,\n getResourceLocation,\n processResult,\n getError,\n updateState,\n options: pollOptions,\n setDelay: (pollIntervalInMs) => {\n currentPollIntervalInMs = pollIntervalInMs;\n },\n setErrorAsResult: !resolveOnUnsuccessful,\n });\n await handleProgressEvents();\n if (!resolveOnUnsuccessful) {\n switch (state.status) {\n case \"canceled\":\n throw new Error(cancelErrMsg);\n case \"failed\":\n throw state.error;\n }\n }\n },\n };\n return poller;\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LongRunningOperation, LroResponse } from \"./models\";\nimport { OperationState, SimplePollerLike } from \"../poller/models\";\nimport {\n getErrorFromResponse,\n getOperationLocation,\n getOperationStatus,\n getResourceLocation,\n getStatusFromInitialResponse,\n inferLroMode,\n isOperationError,\n parseRetryAfter,\n} from \"./operation\";\nimport { CreateHttpPollerOptions } from \"./models\";\nimport { buildCreatePoller } from \"../poller/poller\";\n\n/**\n * Creates a poller that can be used to poll a long-running operation.\n * @param lro - Description of the long-running operation\n * @param options - options to configure the poller\n * @returns an initialized poller\n */\nexport async function createHttpPoller<TResult, TState extends OperationState<TResult>>(\n lro: LongRunningOperation,\n options?: CreateHttpPollerOptions<TResult, TState>\n): Promise<SimplePollerLike<TState, TResult>> {\n const {\n resourceLocationConfig,\n intervalInMs,\n processResult,\n restoreFrom,\n updateState,\n withOperationLocation,\n resolveOnUnsuccessful = false,\n } = options || {};\n return buildCreatePoller<LroResponse, TResult, TState>({\n getStatusFromInitialResponse,\n getStatusFromPollResponse: getOperationStatus,\n isOperationError,\n getOperationLocation,\n getResourceLocation,\n getPollingInterval: parseRetryAfter,\n getError: getErrorFromResponse,\n resolveOnUnsuccessful,\n })(\n {\n init: async () => {\n const response = await lro.sendInitialRequest();\n const config = inferLroMode({\n rawResponse: response.rawResponse,\n requestPath: lro.requestPath,\n requestMethod: lro.requestMethod,\n resourceLocationConfig,\n });\n return {\n response,\n operationLocation: config?.operationLocation,\n resourceLocation: config?.resourceLocation,\n ...(config?.mode ? { metadata: { mode: config.mode } } : {}),\n };\n },\n poll: lro.sendPollRequest,\n },\n {\n intervalInMs,\n withOperationLocation,\n restoreFrom,\n updateState,\n processResult: processResult\n ? ({ flatResponse }, state) => processResult(flatResponse, state)\n : ({ flatResponse }) => flatResponse as TResult,\n }\n );\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LongRunningOperation, LroResourceLocationConfig, RawResponse } from \"../../http/models\";\nimport { PollOperation, PollOperationState } from \"../pollOperation\";\nimport { RestorableOperationState, StateProxy } from \"../../poller/models\";\nimport { initHttpOperation, pollHttpOperation } from \"../../http/operation\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { PollerConfig } from \"./models\";\nimport { logger } from \"../../logger\";\n\nconst createStateProxy: <TResult, TState extends PollOperationState<TResult>>() => StateProxy<\n TState,\n TResult\n> = () => ({\n initState: (config) => ({ config, isStarted: true } as any),\n setCanceled: (state) => (state.isCancelled = true),\n setError: (state, error) => (state.error = error),\n setResult: (state, result) => (state.result = result),\n setRunning: (state) => (state.isStarted = true),\n setSucceeded: (state) => (state.isCompleted = true),\n setFailed: () => {\n /** empty body */\n },\n\n getError: (state) => state.error,\n getResult: (state) => state.result,\n isCanceled: (state) => !!state.isCancelled,\n isFailed: (state) => !!state.error,\n isRunning: (state) => !!state.isStarted,\n isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error),\n});\n\nexport class GenericPollOperation<TResult, TState extends PollOperationState<TResult>>\n implements PollOperation<TState, TResult>\n{\n private pollerConfig?: PollerConfig;\n\n constructor(\n public state: RestorableOperationState<TState>,\n private lro: LongRunningOperation,\n private setErrorAsResult: boolean,\n private lroResourceLocationConfig?: LroResourceLocationConfig,\n private processResult?: (result: unknown, state: TState) => TResult,\n private updateState?: (state: TState, lastResponse: RawResponse) => void,\n private isDone?: (lastResponse: TResult, state: TState) => boolean\n ) {}\n\n public setPollerConfig(pollerConfig: PollerConfig): void {\n this.pollerConfig = pollerConfig;\n }\n\n async update(options?: {\n abortSignal?: AbortSignalLike;\n fireProgress?: (state: TState) => void;\n }): Promise<PollOperation<TState, TResult>> {\n const stateProxy = createStateProxy<TResult, TState>();\n if (!this.state.isStarted) {\n this.state = {\n ...this.state,\n ...(await initHttpOperation({\n lro: this.lro,\n stateProxy,\n resourceLocationConfig: this.lroResourceLocationConfig,\n processResult: this.processResult,\n setErrorAsResult: this.setErrorAsResult,\n })),\n };\n }\n const updateState = this.updateState;\n const isDone = this.isDone;\n\n if (!this.state.isCompleted && this.state.error === undefined) {\n await pollHttpOperation({\n lro: this.lro,\n state: this.state,\n stateProxy,\n processResult: this.processResult,\n updateState: updateState\n ? (state, { rawResponse }) => updateState(state, rawResponse)\n : undefined,\n isDone: isDone\n ? ({ flatResponse }, state) => isDone(flatResponse as TResult, state)\n : undefined,\n options,\n setDelay: (intervalInMs) => {\n this.pollerConfig!.intervalInMs = intervalInMs;\n },\n setErrorAsResult: this.setErrorAsResult,\n });\n }\n options?.fireProgress?.(this.state);\n return this;\n }\n\n async cancel(): Promise<PollOperation<TState, TResult>> {\n logger.error(\"`cancelOperation` is deprecated because it wasn't implemented\");\n return this;\n }\n\n /**\n * Serializes the Poller operation.\n */\n public toString(): string {\n return JSON.stringify({\n state: this.state,\n });\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { PollOperation, PollOperationState } from \"./pollOperation\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { CancelOnProgress } from \"../poller/models\";\nimport { PollerLike } from \"./models\";\n\n/**\n * PollProgressCallback<TState> is the type of the callback functions sent to onProgress.\n * These functions will receive a TState that is defined by your implementation of\n * the Poller class.\n */\nexport type PollProgressCallback<TState> = (state: TState) => void;\n\n/**\n * When a poller is manually stopped through the `stopPolling` method,\n * the poller will be rejected with an instance of the PollerStoppedError.\n */\nexport class PollerStoppedError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"PollerStoppedError\";\n Object.setPrototypeOf(this, PollerStoppedError.prototype);\n }\n}\n\n/**\n * When the operation is cancelled, the poller will be rejected with an instance\n * of the PollerCancelledError.\n */\nexport class PollerCancelledError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"PollerCancelledError\";\n Object.setPrototypeOf(this, PollerCancelledError.prototype);\n }\n}\n\n/**\n * A class that represents the definition of a program that polls through consecutive requests\n * until it reaches a state of completion.\n *\n * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed.\n * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes.\n * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation.\n *\n * ```ts\n * const poller = new MyPoller();\n *\n * // Polling just once:\n * await poller.poll();\n *\n * // We can try to cancel the request here, by calling:\n * //\n * // await poller.cancelOperation();\n * //\n *\n * // Getting the final result:\n * const result = await poller.pollUntilDone();\n * ```\n *\n * The Poller is defined by two types, a type representing the state of the poller, which\n * must include a basic set of properties from `PollOperationState<TResult>`,\n * and a return type defined by `TResult`, which can be anything.\n *\n * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having\n * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type.\n *\n * ```ts\n * class Client {\n * public async makePoller: PollerLike<MyOperationState, MyResult> {\n * const poller = new MyPoller({});\n * // It might be preferred to return the poller after the first request is made,\n * // so that some information can be obtained right away.\n * await poller.poll();\n * return poller;\n * }\n * }\n *\n * const poller: PollerLike<MyOperationState, MyResult> = myClient.makePoller();\n * ```\n *\n * A poller can be created through its constructor, then it can be polled until it's completed.\n * At any point in time, the state of the poller can be obtained without delay through the getOperationState method.\n * At any point in time, the intermediate forms of the result type can be requested without delay.\n * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned.\n *\n * ```ts\n * const poller = myClient.makePoller();\n * const state: MyOperationState = poller.getOperationState();\n *\n * // The intermediate result can be obtained at any time.\n * const result: MyResult | undefined = poller.getResult();\n *\n * // The final result can only be obtained after the poller finishes.\n * const result: MyResult = await poller.pollUntilDone();\n * ```\n *\n */\n// eslint-disable-next-line no-use-before-define\nexport abstract class Poller<TState extends PollOperationState<TResult>, TResult>\n implements PollerLike<TState, TResult>\n{\n /** controls whether to throw an error if the operation failed or was canceled. */\n protected resolveOnUnsuccessful: boolean = false;\n private stopped: boolean = true;\n private resolve?: (value: TResult) => void;\n private reject?: (error: PollerStoppedError | PollerCancelledError | Error) => void;\n private pollOncePromise?: Promise<void>;\n private cancelPromise?: Promise<void>;\n private promise: Promise<TResult>;\n private pollProgressCallbacks: PollProgressCallback<TState>[] = [];\n\n /**\n * The poller's operation is available in full to any of the methods of the Poller class\n * and any class extending the Poller class.\n */\n protected operation: PollOperation<TState, TResult>;\n\n /**\n * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation<TState, TResult>`.\n *\n * When writing an implementation of a Poller, this implementation needs to deal with the initialization\n * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's\n * operation has already been defined, at least its basic properties. The code below shows how to approach\n * the definition of the constructor of a new custom poller.\n *\n * ```ts\n * export class MyPoller extends Poller<MyOperationState, string> {\n * constructor({\n * // Anything you might need outside of the basics\n * }) {\n * let state: MyOperationState = {\n * privateProperty: private,\n * publicProperty: public,\n * };\n *\n * const operation = {\n * state,\n * update,\n * cancel,\n * toString\n * }\n *\n * // Sending the operation to the parent's constructor.\n * super(operation);\n *\n * // You can assign more local properties here.\n * }\n * }\n * ```\n *\n * Inside of this constructor, a new promise is created. This will be used to\n * tell the user when the poller finishes (see `pollUntilDone()`). The promise's\n * resolve and reject methods are also used internally to control when to resolve\n * or reject anyone waiting for the poller to finish.\n *\n * The constructor of a custom implementation of a poller is where any serialized version of\n * a previous poller's operation should be deserialized into the operation sent to the\n * base constructor. For example:\n *\n * ```ts\n * export class MyPoller extends Poller<MyOperationState, string> {\n * constructor(\n * baseOperation: string | undefined\n * ) {\n * let state: MyOperationState = {};\n * if (baseOperation) {\n * state = {\n * ...JSON.parse(baseOperation).state,\n * ...state\n * };\n * }\n * const operation = {\n * state,\n * // ...\n * }\n * super(operation);\n * }\n * }\n * ```\n *\n * @param operation - Must contain the basic properties of `PollOperation<State, TResult>`.\n */\n constructor(operation: PollOperation<TState, TResult>) {\n this.operation = operation;\n this.promise = new Promise<TResult>(\n (\n resolve: (result: TResult) => void,\n reject: (error: PollerStoppedError | PollerCancelledError | Error) => void\n ) => {\n this.resolve = resolve;\n this.reject = reject;\n }\n );\n // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown.\n // The above warning would get thrown if `poller.poll` is called, it returns an error,\n // and pullUntilDone did not have a .catch or await try/catch on it's return value.\n this.promise.catch(() => {\n /* intentionally blank */\n });\n }\n\n /**\n * Defines how much to wait between each poll request.\n * This has to be implemented by your custom poller.\n *\n * \\@azure/core-util has a simple implementation of a delay function that waits as many milliseconds as specified.\n * This can be used as follows:\n *\n * ```ts\n * import { delay } from \"@azure/core-util\";\n *\n * export class MyPoller extends Poller<MyOperationState, string> {\n * // The other necessary definitions.\n *\n * async delay(): Promise<void> {\n * const milliseconds = 1000;\n * return delay(milliseconds);\n * }\n * }\n * ```\n *\n */\n protected abstract delay(): Promise<void>;\n\n /**\n * Starts a loop that will break only if the poller is done\n * or if the poller is stopped.\n */\n private async startPolling(pollOptions: { abortSignal?: AbortSignalLike } = {}): Promise<void> {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll(pollOptions);\n await this.delay();\n }\n }\n\n /**\n * pollOnce does one polling, by calling to the update method of the underlying\n * poll operation to make any relevant change effective.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n private async pollOnce(options: { abortSignal?: AbortSignalLike } = {}): Promise<void> {\n if (!this.isDone()) {\n this.operation = await this.operation.update({\n abortSignal: options.abortSignal,\n fireProgress: this.fireProgress.bind(this),\n });\n }\n this.processUpdatedState();\n }\n\n /**\n * fireProgress calls the functions passed in via onProgress the method of the poller.\n *\n * It loops over all of the callbacks received from onProgress, and executes them, sending them\n * the current operation state.\n *\n * @param state - The current operation state.\n */\n private fireProgress(state: TState): void {\n for (const callback of this.pollProgressCallbacks) {\n callback(state);\n }\n }\n\n /**\n * Invokes the underlying operation's cancel method.\n */\n private async cancelOnce(options: { abortSignal?: AbortSignalLike } = {}): Promise<void> {\n this.operation = await this.operation.cancel(options);\n }\n\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n public poll(options: { abortSignal?: AbortSignalLike } = {}): Promise<void> {\n if (!this.pollOncePromise) {\n this.pollOncePromise = this.pollOnce(options);\n const clearPollOncePromise = (): void => {\n this.pollOncePromise = undefined;\n };\n this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject);\n }\n return this.pollOncePromise;\n }\n\n private processUpdatedState(): void {\n if (this.operation.state.error) {\n this.stopped = true;\n if (!this.resolveOnUnsuccessful) {\n this.reject!(this.operation.state.error);\n throw this.operation.state.error;\n }\n }\n if (this.operation.state.isCancelled) {\n this.stopped = true;\n if (!this.resolveOnUnsuccessful) {\n const error = new PollerCancelledError(\"Operation was canceled\");\n this.reject!(error);\n throw error;\n }\n }\n if (this.isDone() && this.resolve) {\n // If the poller has finished polling, this means we now have a result.\n // However, it can be the case that TResult is instantiated to void, so\n // we are not expecting a result anyway. To assert that we might not\n // have a result eventually after finishing polling, we cast the result\n // to TResult.\n this.resolve(this.getResult() as TResult);\n }\n }\n\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n public async pollUntilDone(\n pollOptions: { abortSignal?: AbortSignalLike } = {}\n ): Promise<TResult> {\n if (this.stopped) {\n this.startPolling(pollOptions).catch(this.reject);\n }\n // This is needed because the state could have been updated by\n // `cancelOperation`, e.g. the operation is canceled or an error occurred.\n this.processUpdatedState();\n return this.promise;\n }\n\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n public onProgress(callback: (state: TState) => void): CancelOnProgress {\n this.pollProgressCallbacks.push(callback);\n return (): void => {\n this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback);\n };\n }\n\n /**\n * Returns true if the poller has finished polling.\n */\n public isDone(): boolean {\n const state: PollOperationState<TResult> = this.operation.state;\n return Boolean(state.isCompleted || state.isCancelled || state.error);\n }\n\n /**\n * Stops the poller from continuing to poll.\n */\n public stopPolling(): void {\n if (!this.stopped) {\n this.stopped = true;\n if (this.reject) {\n this.reject(new PollerStoppedError(\"This poller is already stopped\"));\n }\n }\n }\n\n /**\n * Returns true if the poller is stopped.\n */\n public isStopped(): boolean {\n return this.stopped;\n }\n\n /**\n * Attempts to cancel the underlying operation.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * If it's called again before it finishes, it will throw an error.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n public cancelOperation(options: { abortSignal?: AbortSignalLike } = {}): Promise<void> {\n if (!this.cancelPromise) {\n this.cancelPromise = this.cancelOnce(options);\n } else if (options.abortSignal) {\n throw new Error(\"A cancel request is currently pending\");\n }\n return this.cancelPromise;\n }\n\n /**\n * Returns the state of the operation.\n *\n * Even though TState will be the same type inside any of the methods of any extension of the Poller class,\n * implementations of the pollers can customize what's shared with the public by writing their own\n * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller\n * and a public type representing a safe to share subset of the properties of the internal state.\n * Their definition of getOperationState can then return their public type.\n *\n * Example:\n *\n * ```ts\n * // Let's say we have our poller's operation state defined as:\n * interface MyOperationState extends PollOperationState<ResultType> {\n * privateProperty?: string;\n * publicProperty?: string;\n * }\n *\n * // To allow us to have a true separation of public and private state, we have to define another interface:\n * interface PublicState extends PollOperationState<ResultType> {\n * publicProperty?: string;\n * }\n *\n * // Then, we define our Poller as follows:\n * export class MyPoller extends Poller<MyOperationState, ResultType> {\n * // ... More content is needed here ...\n *\n * public getOperationState(): PublicState {\n * const state: PublicState = this.operation.state;\n * return {\n * // Properties from PollOperationState<TResult>\n * isStarted: state.isStarted,\n * isCompleted: state.isCompleted,\n * isCancelled: state.isCancelled,\n * error: state.error,\n * result: state.result,\n *\n * // The only other property needed by PublicState.\n * publicProperty: state.publicProperty\n * }\n * }\n * }\n * ```\n *\n * You can see this in the tests of this repository, go to the file:\n * `../test/utils/testPoller.ts`\n * and look for the getOperationState implementation.\n */\n public getOperationState(): TState {\n return this.operation.state;\n }\n\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n public getResult(): TResult | undefined {\n const state: PollOperationState<TResult> = this.operation.state;\n return state.result;\n }\n\n /**\n * Returns a serialized version of the poller's operation\n * by invoking the operation's toString method.\n */\n public toString(): string {\n return this.operation.toString();\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LroEngineOptions, PollerConfig } from \"./models\";\nimport { GenericPollOperation } from \"./operation\";\nimport { LongRunningOperation } from \"../../http/models\";\nimport { POLL_INTERVAL_IN_MS } from \"../../poller/constants\";\nimport { PollOperationState } from \"../pollOperation\";\nimport { Poller } from \"../poller\";\nimport { RestorableOperationState } from \"../../poller/models\";\nimport { deserializeState } from \"../../poller/operation\";\n\n/**\n * The LRO Engine, a class that performs polling.\n */\nexport class LroEngine<TResult, TState extends PollOperationState<TResult>> extends Poller<\n TState,\n TResult\n> {\n private config: PollerConfig;\n\n constructor(lro: LongRunningOperation<TResult>, options?: LroEngineOptions<TResult, TState>) {\n const {\n intervalInMs = POLL_INTERVAL_IN_MS,\n resumeFrom,\n resolveOnUnsuccessful = false,\n isDone,\n lroResourceLocationConfig,\n processResult,\n updateState,\n } = options || {};\n const state: RestorableOperationState<TState> = resumeFrom\n ? deserializeState(resumeFrom)\n : ({} as RestorableOperationState<TState>);\n const operation = new GenericPollOperation(\n state,\n lro,\n !resolveOnUnsuccessful,\n lroResourceLocationConfig,\n processResult,\n updateState,\n isDone\n );\n super(operation);\n this.resolveOnUnsuccessful = resolveOnUnsuccessful;\n\n this.config = { intervalInMs: intervalInMs };\n operation.setPollerConfig(this.config);\n }\n\n /**\n * The method used by the poller to wait before attempting to update its operation.\n */\n delay(): Promise<void> {\n return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs));\n }\n}\n"],"names":["createClientLogger","createStateProxy","abortController","AbortController","delay"],"mappings":";;;;;;;;AAAA;AAKA;;;AAGG;AACI,MAAM,MAAM,GAAGA,2BAAkB,CAAC,UAAU,CAAC;;ACTpD;AACA;AAEA;;AAEG;AACI,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC;;AAEG;AACI,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC;;ACVjE;AAcA;;AAEG;AACG,SAAU,gBAAgB,CAC9B,eAAuB,EAAA;IAEvB,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC;AAC1C,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE;AACV,QAAA,MAAM,IAAI,KAAK,CAAC,sCAAsC,eAAe,CAAA,CAAE,CAAC,CAAC;AAC1E,KAAA;AACH,CAAC;AAED,SAAS,aAAa,CAAkB,MAIvC,EAAA;IACC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;IACvD,OAAO,CAAC,KAAY,KAAI;AACtB,QAAA,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;AAC3B,YAAA,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAClC,YAAA,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC7B,SAAA;AACD,QAAA,MAAM,KAAK,CAAC;AACd,KAAC,CA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