Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ffcbc56
prepare
albertxavier100 Dec 12, 2024
47f586d
Migration: Update package.json, tsconfig.json, and api-extractor.json
albertxavier100 Dec 12, 2024
33f43d4
Migration: Update test config
albertxavier100 Dec 12, 2024
f789bb9
Migration: Clean up files
albertxavier100 Dec 12, 2024
fbd624b
Migration: Apply codemod: "fixSourceFile"
albertxavier100 Dec 12, 2024
9cf5621
Migration: Apply codemod: "fixTestingImports"
albertxavier100 Dec 12, 2024
20190d4
Migration: Apply codemod: "replaceAssertIsRejected"
albertxavier100 Dec 12, 2024
500b702
Migration: Apply codemod: "replaceSinonStub"
albertxavier100 Dec 12, 2024
aada769
Migration: Apply codemod: "addViHelper"
albertxavier100 Dec 12, 2024
293f6df
Migration: Apply codemod: "replaceSupportTracing"
albertxavier100 Dec 12, 2024
9fefe1c
Migration: Apply codemod: "replaceTestUtils"
albertxavier100 Dec 12, 2024
30c6147
Migration: rushx format
albertxavier100 Dec 12, 2024
019a758
Migration: Update package.json, tsconfig.json, and api-extractor.json
albertxavier100 Dec 12, 2024
a4c9c02
Migration: Update test config
albertxavier100 Dec 12, 2024
68e39b6
Migration: Clean up files
albertxavier100 Dec 12, 2024
b09fe8c
Migration: Apply codemod: "fixSourceFile"
albertxavier100 Dec 12, 2024
798017c
Migration: Apply codemod: "fixTestingImports"
albertxavier100 Dec 12, 2024
aefc196
Migration: Apply codemod: "replaceAssertIsRejected"
albertxavier100 Dec 12, 2024
2990e16
Migration: Apply codemod: "replaceSinonStub"
albertxavier100 Dec 12, 2024
8f63c87
Migration: Apply codemod: "addViHelper"
albertxavier100 Dec 12, 2024
0f40c20
Migration: Apply codemod: "replaceSupportTracing"
albertxavier100 Dec 12, 2024
0bcd55c
Migration: Apply codemod: "replaceTestUtils"
albertxavier100 Dec 12, 2024
f8dda04
Migration: rushx format
albertxavier100 Dec 12, 2024
d7b04dd
Migration: Update package.json, tsconfig.json, and api-extractor.json
albertxavier100 Dec 13, 2024
01ab2f2
Migration: Update test config
albertxavier100 Dec 13, 2024
e0d1250
Migration: Clean up files
albertxavier100 Dec 13, 2024
0584ad7
Migration: Apply codemod: "fixSourceFile"
albertxavier100 Dec 13, 2024
def32e0
Migration: Apply codemod: "fixTestingImports"
albertxavier100 Dec 13, 2024
a5adae0
Migration: Apply codemod: "replaceAssertIsRejected"
albertxavier100 Dec 13, 2024
a01b45d
Migration: Apply codemod: "replaceSinonStub"
albertxavier100 Dec 13, 2024
efd89b3
Migration: Apply codemod: "addViHelper"
albertxavier100 Dec 13, 2024
9537529
Migration: Apply codemod: "replaceSupportTracing"
albertxavier100 Dec 13, 2024
4926f4d
Migration: Apply codemod: "replaceTestUtils"
albertxavier100 Dec 13, 2024
e0e5bd8
Migration: rushx format
albertxavier100 Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Migration: Update package.json, tsconfig.json, and api-extractor.json
  • Loading branch information
albertxavier100 committed Dec 12, 2024
commit 019a75852699275babaaf45ed0c1d70d05437951
6 changes: 3 additions & 3 deletions sdk/durabletask/arm-durabletask/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default [
"@azure/azure-sdk/ts-package-json-module": "off",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
"tsdoc/syntax": "warn",
},
},
"tsdoc/syntax": "warn"
}
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export function createDurableTask(
credential: TokenCredential,
options: DurableTaskClientOptionalParams = {},
): DurableTaskContext {
const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://management.azure.com`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `https://management.azure.com`;
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
const userAgentInfo = `azsdk-js-arm-durabletask/1.0.0-beta.1`;
const userAgentPrefix = prefixFromOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { DurableTaskContext as Client, OperationsListOptionalParams } from "../index.js";
import {
DurableTaskContext as Client,
OperationsListOptionalParams,
} from "../index.js";
import {
_OperationListResult,
_operationListResultDeserializer,
Expand Down
12 changes: 8 additions & 4 deletions sdk/durabletask/arm-durabletask/src/api/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export interface OperationsListOptionalParams extends OperationOptions {}
export interface SchedulersGetOptionalParams extends OperationOptions {}

/** Optional parameters. */
export interface SchedulersCreateOrUpdateOptionalParams extends OperationOptions {
export interface SchedulersCreateOrUpdateOptionalParams
extends OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
}
Expand All @@ -28,10 +29,12 @@ export interface SchedulersDeleteOptionalParams extends OperationOptions {
}

/** Optional parameters. */
export interface SchedulersListByResourceGroupOptionalParams extends OperationOptions {}
export interface SchedulersListByResourceGroupOptionalParams
extends OperationOptions {}

/** Optional parameters. */
export interface SchedulersListBySubscriptionOptionalParams extends OperationOptions {}
export interface SchedulersListBySubscriptionOptionalParams
extends OperationOptions {}

/** Optional parameters. */
export interface TaskHubsGetOptionalParams extends OperationOptions {}
Expand All @@ -49,4 +52,5 @@ export interface TaskHubsDeleteOptionalParams extends OperationOptions {
}

/** Optional parameters. */
export interface TaskHubsListBySchedulerOptionalParams extends OperationOptions {}
export interface TaskHubsListBySchedulerOptionalParams
extends OperationOptions {}
109 changes: 70 additions & 39 deletions sdk/durabletask/arm-durabletask/src/api/schedulers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import {
_SchedulerListResult,
_schedulerListResultDeserializer,
} from "../../models/models.js";
import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js";
import {
PagedAsyncIterableIterator,
buildPagedAsyncIterator,
} from "../../static-helpers/pagingHelpers.js";
import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js";
import {
StreamableMethod,
PathUncheckedResponse,
Expand All @@ -47,7 +47,9 @@ export function _schedulersGetSend(
.get({ ...operationOptionsToRequestParameters(options) });
}

export async function _schedulersGetDeserialize(result: PathUncheckedResponse): Promise<Scheduler> {
export async function _schedulersGetDeserialize(
result: PathUncheckedResponse,
): Promise<Scheduler> {
const expectedStatuses = ["200"];
if (!expectedStatuses.includes(result.status)) {
throw createRestError(result);
Expand Down Expand Up @@ -115,20 +117,25 @@ export function schedulersCreateOrUpdate(
resource: Scheduler,
options: SchedulersCreateOrUpdateOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<Scheduler>, Scheduler> {
return getLongRunningPoller(context, _schedulersCreateOrUpdateDeserialize, ["200", "201"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_schedulersCreateOrUpdateSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
resource,
options,
),
resourceLocationConfig: "azure-async-operation",
}) as PollerLike<OperationState<Scheduler>, Scheduler>;
return getLongRunningPoller(
context,
_schedulersCreateOrUpdateDeserialize,
["200", "201"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_schedulersCreateOrUpdateSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
resource,
options,
),
resourceLocationConfig: "azure-async-operation",
},
) as PollerLike<OperationState<Scheduler>, Scheduler>;
}

export function _schedulersUpdateSend(
Expand Down Expand Up @@ -172,20 +179,25 @@ export function schedulersUpdate(
properties: Scheduler,
options: SchedulersUpdateOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<Scheduler>, Scheduler> {
return getLongRunningPoller(context, _schedulersUpdateDeserialize, ["200", "202"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_schedulersUpdateSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
properties,
options,
),
resourceLocationConfig: "location",
}) as PollerLike<OperationState<Scheduler>, Scheduler>;
return getLongRunningPoller(
context,
_schedulersUpdateDeserialize,
["200", "202"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_schedulersUpdateSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
properties,
options,
),
resourceLocationConfig: "location",
},
) as PollerLike<OperationState<Scheduler>, Scheduler>;
}

export function _schedulersDeleteSend(
Expand All @@ -205,7 +217,9 @@ export function _schedulersDeleteSend(
.delete({ ...operationOptionsToRequestParameters(options) });
}

export async function _schedulersDeleteDeserialize(result: PathUncheckedResponse): Promise<void> {
export async function _schedulersDeleteDeserialize(
result: PathUncheckedResponse,
): Promise<void> {
const expectedStatuses = ["202", "204", "200"];
if (!expectedStatuses.includes(result.status)) {
throw createRestError(result);
Expand All @@ -222,13 +236,24 @@ export function schedulersDelete(
schedulerName: string,
options: SchedulersDeleteOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<void>, void> {
return getLongRunningPoller(context, _schedulersDeleteDeserialize, ["202", "204", "200"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_schedulersDeleteSend(context, subscriptionId, resourceGroupName, schedulerName, options),
resourceLocationConfig: "location",
}) as PollerLike<OperationState<void>, void>;
return getLongRunningPoller(
context,
_schedulersDeleteDeserialize,
["202", "204", "200"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_schedulersDeleteSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
options,
),
resourceLocationConfig: "location",
},
) as PollerLike<OperationState<void>, void>;
}

export function _schedulersListByResourceGroupSend(
Expand Down Expand Up @@ -266,7 +291,13 @@ export function schedulersListByResourceGroup(
): PagedAsyncIterableIterator<Scheduler> {
return buildPagedAsyncIterator(
context,
() => _schedulersListByResourceGroupSend(context, subscriptionId, resourceGroupName, options),
() =>
_schedulersListByResourceGroupSend(
context,
subscriptionId,
resourceGroupName,
options,
),
_schedulersListByResourceGroupDeserialize,
["200"],
{ itemName: "value", nextLinkName: "nextLink" },
Expand Down
78 changes: 46 additions & 32 deletions sdk/durabletask/arm-durabletask/src/api/taskHubs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import {
_TaskHubListResult,
_taskHubListResultDeserializer,
} from "../../models/models.js";
import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js";
import {
PagedAsyncIterableIterator,
buildPagedAsyncIterator,
} from "../../static-helpers/pagingHelpers.js";
import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js";
import {
StreamableMethod,
PathUncheckedResponse,
Expand Down Expand Up @@ -47,7 +47,9 @@ export function _taskHubsGetSend(
.get({ ...operationOptionsToRequestParameters(options) });
}

export async function _taskHubsGetDeserialize(result: PathUncheckedResponse): Promise<TaskHub> {
export async function _taskHubsGetDeserialize(
result: PathUncheckedResponse,
): Promise<TaskHub> {
const expectedStatuses = ["200"];
if (!expectedStatuses.includes(result.status)) {
throw createRestError(result);
Expand Down Expand Up @@ -120,21 +122,26 @@ export function taskHubsCreateOrUpdate(
resource: TaskHub,
options: TaskHubsCreateOrUpdateOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<TaskHub>, TaskHub> {
return getLongRunningPoller(context, _taskHubsCreateOrUpdateDeserialize, ["200", "201"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_taskHubsCreateOrUpdateSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
taskHubName,
resource,
options,
),
resourceLocationConfig: "azure-async-operation",
}) as PollerLike<OperationState<TaskHub>, TaskHub>;
return getLongRunningPoller(
context,
_taskHubsCreateOrUpdateDeserialize,
["200", "201"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_taskHubsCreateOrUpdateSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
taskHubName,
resource,
options,
),
resourceLocationConfig: "azure-async-operation",
},
) as PollerLike<OperationState<TaskHub>, TaskHub>;
}

export function _taskHubsDeleteSend(
Expand All @@ -156,7 +163,9 @@ export function _taskHubsDeleteSend(
.delete({ ...operationOptionsToRequestParameters(options) });
}

export async function _taskHubsDeleteDeserialize(result: PathUncheckedResponse): Promise<void> {
export async function _taskHubsDeleteDeserialize(
result: PathUncheckedResponse,
): Promise<void> {
const expectedStatuses = ["202", "204", "200"];
if (!expectedStatuses.includes(result.status)) {
throw createRestError(result);
Expand All @@ -174,20 +183,25 @@ export function taskHubsDelete(
taskHubName: string,
options: TaskHubsDeleteOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<void>, void> {
return getLongRunningPoller(context, _taskHubsDeleteDeserialize, ["202", "204", "200"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_taskHubsDeleteSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
taskHubName,
options,
),
resourceLocationConfig: "location",
}) as PollerLike<OperationState<void>, void>;
return getLongRunningPoller(
context,
_taskHubsDeleteDeserialize,
["202", "204", "200"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_taskHubsDeleteSend(
context,
subscriptionId,
resourceGroupName,
schedulerName,
taskHubName,
options,
),
resourceLocationConfig: "location",
},
) as PollerLike<OperationState<void>, void>;
}

export function _taskHubsListBySchedulerSend(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.j
/** Interface representing a Operations operations. */
export interface OperationsOperations {
/** List the operations for the provider */
list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator<Operation>;
list: (
options?: OperationsListOptionalParams,
) => PagedAsyncIterableIterator<Operation>;
}

export function getOperations(context: DurableTaskContext) {
return {
list: (options?: OperationsListOptionalParams) => operationsList(context, options),
list: (options?: OperationsListOptionalParams) =>
operationsList(context, options),
};
}

export function getOperationsOperations(context: DurableTaskContext): OperationsOperations {
export function getOperationsOperations(
context: DurableTaskContext,
): OperationsOperations {
return {
...getOperations(context),
};
Expand Down
Loading