From f077569c395145b0776f141e527e15b83ba1711b Mon Sep 17 00:00:00 2001 From: fabriziopapi Date: Thu, 1 Apr 2021 17:00:05 +0200 Subject: [PATCH 1/6] (^) changed strict to true --- HandleNHNotificationCallActivity/handler.ts | 9 +++++---- tsconfig.json | 2 +- utils/notification.ts | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/HandleNHNotificationCallActivity/handler.ts b/HandleNHNotificationCallActivity/handler.ts index a2b4c1d..e24525b 100644 --- a/HandleNHNotificationCallActivity/handler.ts +++ b/HandleNHNotificationCallActivity/handler.ts @@ -32,9 +32,9 @@ export const ActivityInput = t.interface({ export type ActivityInput = t.TypeOf; -const assertNever = (x: never): never => { - throw new Error(`Unexpected object: ${toString(x)}`); -}; +// tslint:disable:no-any +const createUnexpecterError = (x: any): Error => + new Error(`Unexpected object: ${toString(x)}`); const telemetryClient = initTelemetryClient(); @@ -53,6 +53,7 @@ export const getCallNHServiceActivityHandler = ( context.log.info( `${logPrefix}|${message.kind}|INSTALLATION_ID=${message.installationId}` ); + switch (message.kind) { case CreateOrUpdateKind.CreateOrUpdateInstallation: return createOrUpdateInstallation( @@ -87,7 +88,7 @@ export const getCallNHServiceActivityHandler = ( return failure(e.message); }); default: - assertNever(message); + throw createUnexpecterError(message); } }) .fold(identity, success) diff --git a/tsconfig.json b/tsconfig.json index 04d0d62..c82dff1 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "dist", "module": "commonjs", "moduleResolution": "node", - "strict": false, + "strict": true, "sourceMap": true, "resolveJsonModule": true, "skipLibCheck": true diff --git a/utils/notification.ts b/utils/notification.ts index 84cf55f..4300bb1 100644 --- a/utils/notification.ts +++ b/utils/notification.ts @@ -67,7 +67,8 @@ class ExtendedNotificationHubService extends NotificationHubService { }); }; // tslint:disable-next-line: no-string-literal no-any - return super["_buildRequestOptions"]( + // @ts-ignore /* _buildRequestOptions is not defined in the Azure type NotificationHubService: the error is caused by strict=ture tsc configuration and will be ignored */ + return super._buildRequestOptions( webResource, body, options, From 49841d93ca7c14308ff57adc04f2ca8523431282 Mon Sep 17 00:00:00 2001 From: Emanuele De Cupis Date: Mon, 12 Apr 2021 17:48:54 +0200 Subject: [PATCH 2/6] Update utils/notification.ts --- utils/notification.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/notification.ts b/utils/notification.ts index 4300bb1..da8770d 100644 --- a/utils/notification.ts +++ b/utils/notification.ts @@ -67,7 +67,7 @@ class ExtendedNotificationHubService extends NotificationHubService { }); }; // tslint:disable-next-line: no-string-literal no-any - // @ts-ignore /* _buildRequestOptions is not defined in the Azure type NotificationHubService: the error is caused by strict=ture tsc configuration and will be ignored */ + // @ts-ignore although _buildRequestOptions is not defined in the Azure type NotificationHubService, we need to hack its internals to use keepalive feature. Compiling in strict mode would fail, so we prefer TS to just ignore this line return super._buildRequestOptions( webResource, body, From 0d286798044896463ad70ee89dc980dcc495a1bc Mon Sep 17 00:00:00 2001 From: Emanuele De Cupis Date: Tue, 13 Apr 2021 11:15:54 +0200 Subject: [PATCH 3/6] enable strict on durable module --- .../index.ts | 6 +-- .../handler.ts | 4 +- .../index.ts | 2 +- .../handler.ts | 7 +-- .../index.ts | 9 +--- .../handler.ts | 4 +- .../index.ts | 4 +- HandleNHNotificationCallActivity/handler.ts | 6 --- HandleNHNotifyMessageCallActivity/handler.ts | 11 ++--- HandleNHNotifyMessageCallActivity/index.ts | 6 +-- .../handler.ts | 10 ++++- .../index.ts | 4 +- utils/durable/activities/index.ts | 44 +++++++------------ utils/durable/activities/log.ts | 20 ++++----- utils/durable/orchestrators/index.ts | 27 +++++++----- 15 files changed, 69 insertions(+), 95 deletions(-) diff --git a/HandleNHCreateOrUpdateInstallationCallActivity/index.ts b/HandleNHCreateOrUpdateInstallationCallActivity/index.ts index 5ebc45e..5abae2c 100644 --- a/HandleNHCreateOrUpdateInstallationCallActivity/index.ts +++ b/HandleNHCreateOrUpdateInstallationCallActivity/index.ts @@ -6,11 +6,7 @@ import { getActivityBody } from "./handler"; -export { - ActivityBodyImpl, - ActivityInput, - ActivityResultSuccess -} from "./handler"; +export { ActivityInput, ActivityResultSuccess } from "./handler"; export const activityName = "HandleNHCreateOrUpdateInstallationCallActivity"; const activityFunctionHandler = createActivity( diff --git a/HandleNHCreateOrUpdateInstallationCallOrchestrator/handler.ts b/HandleNHCreateOrUpdateInstallationCallOrchestrator/handler.ts index 2a52dcb..114d14e 100644 --- a/HandleNHCreateOrUpdateInstallationCallOrchestrator/handler.ts +++ b/HandleNHCreateOrUpdateInstallationCallOrchestrator/handler.ts @@ -3,7 +3,7 @@ import * as t from "io-ts"; import * as o from "../utils/durable/orchestrators"; import { CreateOrUpdateInstallationMessage } from "../generated/notifications/CreateOrUpdateInstallationMessage"; -import { ActivityBodyImpl as CreateOrUpdateActivityBodyImpl } from "../HandleNHCreateOrUpdateInstallationCallActivity"; +import { ActivityInput as CreateOrUpdateActivityInput } from "../HandleNHCreateOrUpdateInstallationCallActivity"; import { NotificationHubConfig } from "../utils/notificationhubServicePartition"; export const OrchestratorName = @@ -21,7 +21,7 @@ export type NhCreateOrUpdateInstallationOrchestratorCallInput = t.TypeOf< >; interface IHandlerParams { - createOrUpdateActivity: o.CallableActivity; + createOrUpdateActivity: o.CallableActivity; notificationHubConfig: NotificationHubConfig; } diff --git a/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts b/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts index 7cea01a..434c27b 100644 --- a/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts +++ b/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts @@ -5,7 +5,7 @@ import { getConfigOrThrow } from "../utils/config"; import { getHandler } from "./handler"; import { - ActivityBodyImpl as CreateOrUpdateActivityBodyImpl, + ActivityInput as CreateOrUpdateActivityBodyImpl, activityName as CreateOrUpdateActivityName, ActivityResultSuccess as CreateOrUpdateActivityResultSuccess } from "../HandleNHCreateOrUpdateInstallationCallActivity"; diff --git a/HandleNHDeleteInstallationCallActivity/handler.ts b/HandleNHDeleteInstallationCallActivity/handler.ts index a9ac933..9750c4f 100644 --- a/HandleNHDeleteInstallationCallActivity/handler.ts +++ b/HandleNHDeleteInstallationCallActivity/handler.ts @@ -25,15 +25,16 @@ export const ActivityInput = t.interface({ // Activity Result export { ActivityResultSuccess } from "../utils/durable/activities"; -export type ActivityBodyImpl = ActivityBody; - /** * For each Notification Hub Message of type "Delete" calls related Notification Hub service */ export const getActivityBody = ( buildNHService: (nhConfig: NotificationHubConfig) => NotificationHubService -): ActivityBodyImpl => ({ input, logger }) => { +): ActivityBody => ({ + input, + logger +}) => { logger.info(`INSTALLATION_ID=${input.installationId}`); const nhService = buildNHService(input.notificationHubConfig); diff --git a/HandleNHDeleteInstallationCallActivity/index.ts b/HandleNHDeleteInstallationCallActivity/index.ts index c00b1cf..d9fffba 100644 --- a/HandleNHDeleteInstallationCallActivity/index.ts +++ b/HandleNHDeleteInstallationCallActivity/index.ts @@ -1,20 +1,15 @@ import { createActivity } from "../utils/durable/activities"; import { buildNHService } from "../utils/notificationhubServicePartition"; import { - ActivityBodyImpl, ActivityInput, ActivityResultSuccess, getActivityBody } from "./handler"; -export { - ActivityBodyImpl, - ActivityInput, - ActivityResultSuccess -} from "./handler"; +export { ActivityInput, ActivityResultSuccess } from "./handler"; export const activityName = "HandleNHDeleteInstallationCallActivity"; -const activityFunctionHandler = createActivity( +const activityFunctionHandler = createActivity( activityName, ActivityInput, ActivityResultSuccess, diff --git a/HandleNHDeleteInstallationCallOrchestrator/handler.ts b/HandleNHDeleteInstallationCallOrchestrator/handler.ts index 53a1e32..fa10651 100644 --- a/HandleNHDeleteInstallationCallOrchestrator/handler.ts +++ b/HandleNHDeleteInstallationCallOrchestrator/handler.ts @@ -3,7 +3,7 @@ import * as t from "io-ts"; import { DeleteInstallationMessage } from "../generated/notifications/DeleteInstallationMessage"; -import { ActivityBodyImpl as DeleteInstallationActivityBodyImpl } from "../HandleNHDeleteInstallationCallActivity"; +import { ActivityInput as DeleteInstallationActivityInput } from "../HandleNHDeleteInstallationCallActivity"; import * as o from "../utils/durable/orchestrators"; import { NotificationHubConfig } from "../utils/notificationhubServicePartition"; @@ -23,7 +23,7 @@ export const OrchestratorCallInput = t.interface({ interface IHandlerParams { deleteInstallationActivity: o.CallableActivity< - DeleteInstallationActivityBodyImpl + DeleteInstallationActivityInput >; legacyNotificationHubConfig: NotificationHubConfig; } diff --git a/HandleNHDeleteInstallationCallOrchestrator/index.ts b/HandleNHDeleteInstallationCallOrchestrator/index.ts index 5e49ede..5ec4013 100644 --- a/HandleNHDeleteInstallationCallOrchestrator/index.ts +++ b/HandleNHDeleteInstallationCallOrchestrator/index.ts @@ -1,6 +1,6 @@ import * as df from "durable-functions"; import { - ActivityBodyImpl as DeleteInstallationActivityBodyImpl, + ActivityInput as DeleteInstallationActivityInput, activityName as DeleteInstallationActivityName, ActivityResultSuccess as DeleteInstallationActivityResultSuccess } from "../HandleNHDeleteInstallationCallActivity"; @@ -12,7 +12,7 @@ import { getHandler } from "./handler"; const config = getConfigOrThrow(); const deleteInstallationActivity = o.callableActivity< - DeleteInstallationActivityBodyImpl + DeleteInstallationActivityInput >(DeleteInstallationActivityName, DeleteInstallationActivityResultSuccess, { ...new df.RetryOptions(5000, config.RETRY_ATTEMPT_NUMBER), backoffCoefficient: 1.5 diff --git a/HandleNHNotificationCallActivity/handler.ts b/HandleNHNotificationCallActivity/handler.ts index 0df1d08..1a929bc 100644 --- a/HandleNHNotificationCallActivity/handler.ts +++ b/HandleNHNotificationCallActivity/handler.ts @@ -41,10 +41,6 @@ export type HandleNHNotificationCallActivityInput = t.TypeOf< typeof HandleNHNotificationCallActivityInput >; -// tslint:disable:no-any -const createUnexpecterError = (x: any): Error => - new Error(`Unexpected object: ${toString(x)}`); - /** * For each Notification Hub Message calls related Notification Hub service */ @@ -104,8 +100,6 @@ export const getCallNHServiceActivityHandler = ( return failActivity(logger)(e.message); } ); - default: - throw createUnexpecterError(message); } }) .fold(identity, success) diff --git a/HandleNHNotifyMessageCallActivity/handler.ts b/HandleNHNotifyMessageCallActivity/handler.ts index 9bef07a..528abd7 100644 --- a/HandleNHNotifyMessageCallActivity/handler.ts +++ b/HandleNHNotifyMessageCallActivity/handler.ts @@ -30,12 +30,6 @@ export type ActivityInput = t.TypeOf; // Activity Result export { ActivityResultSuccess } from "../utils/durable/activities"; -// ActivityBody -export type ActivityBodyImpl = ActivityBody< - ActivityInput, - ActivityResultSuccess ->; - /** * For each Notification Hub Message of type "Delete" calls related Notification Hub service */ @@ -43,7 +37,10 @@ export type ActivityBodyImpl = ActivityBody< export const getActivityBody = ( telemetryClient: TelemetryClient, buildNHService: (nhConfig: NotificationHubConfig) => NotificationHubService -): ActivityBodyImpl => ({ input, logger }) => { +): ActivityBody => ({ + input, + logger +}) => { logger.info(`INSTALLATION_ID=${input.message.installationId}`); const nhService = buildNHService(input.notificationHubConfig); return notify(nhService, input.message.installationId, input.message.payload) diff --git a/HandleNHNotifyMessageCallActivity/index.ts b/HandleNHNotifyMessageCallActivity/index.ts index f21f32c..43ca82c 100644 --- a/HandleNHNotifyMessageCallActivity/index.ts +++ b/HandleNHNotifyMessageCallActivity/index.ts @@ -10,11 +10,7 @@ import { getActivityBody } from "./handler"; -export { - ActivityBodyImpl, - ActivityInput, - ActivityResultSuccess -} from "./handler"; +export { ActivityInput, ActivityResultSuccess } from "./handler"; export const activityName = "HandleNHNotifyMessageCallActivity"; const config = getConfigOrThrow(); diff --git a/HandleNHNotifyMessageCallOrchestrator/handler.ts b/HandleNHNotifyMessageCallOrchestrator/handler.ts index acef91e..f1d268b 100644 --- a/HandleNHNotifyMessageCallOrchestrator/handler.ts +++ b/HandleNHNotifyMessageCallOrchestrator/handler.ts @@ -2,7 +2,10 @@ import * as t from "io-ts"; import { Task } from "durable-functions/lib/src/classes"; -import { ActivityBodyImpl as NotifyMessageActivityBodyImpl } from "../HandleNHNotifyMessageCallActivity"; +import { + ActivityInput as NotifyMessageActivityInput, + ActivityResultSuccess as NotifyMessageActivityResultSuccess +} from "../HandleNHNotifyMessageCallActivity"; import { NotifyMessage } from "../generated/notifications/NotifyMessage"; @@ -29,7 +32,10 @@ export type NhNotifyMessageOrchestratorCallInput = t.TypeOf< >; interface IHandlerParams { - notifyMessageActivity: CallableActivity; + notifyMessageActivity: CallableActivity< + NotifyMessageActivityInput, + NotifyMessageActivityResultSuccess + >; legacyNotificationHubConfig: NotificationHubConfig; } diff --git a/HandleNHNotifyMessageCallOrchestrator/index.ts b/HandleNHNotifyMessageCallOrchestrator/index.ts index 8a8bd60..b9d7d38 100644 --- a/HandleNHNotifyMessageCallOrchestrator/index.ts +++ b/HandleNHNotifyMessageCallOrchestrator/index.ts @@ -5,7 +5,7 @@ import { getNHLegacyConfig } from "../utils/notificationhubServicePartition"; import { getHandler } from "./handler"; import { - ActivityBodyImpl as NotifyMessageActivityBodyImpl, + ActivityInput as NotifyMessageActivityInput, activityName as NotifyMessageActivityName, ActivityResultSuccess as NotifyMessageActivityResultSuccess } from "../HandleNHNotifyMessageCallActivity"; @@ -13,7 +13,7 @@ import { const config = getConfigOrThrow(); const legacyNotificationHubConfig = getNHLegacyConfig(config); -const notifyMessageActivity = callableActivity( +const notifyMessageActivity = callableActivity( NotifyMessageActivityName, NotifyMessageActivityResultSuccess, { diff --git a/utils/durable/activities/index.ts b/utils/durable/activities/index.ts index 2bcf18b..b58b867 100644 --- a/utils/durable/activities/index.ts +++ b/utils/durable/activities/index.ts @@ -14,7 +14,7 @@ export { createLogger } from "./log"; export * from "./returnTypes"; export type ActivityBody< - Input, + Input = unknown, Success extends ActivityResultSuccess = ActivityResultSuccess, Failure extends ActivityResultFailure = ActivityResultFailure // Bindings extends Array = [] @@ -25,26 +25,6 @@ export type ActivityBody< // bindings?: Bindings; }) => TaskEither; -// extract the input type from an ActivityBody type -export type InputOfActivityBody> = B extends ( - p: infer P -) => TaskEither - ? P extends { context: Context; input: infer I } - ? I - : never - : never; - -// extract the success type from an ActivityBody type -export type SuccessOfActivityBody> = B extends ( - p: infer P -) => TaskEither - ? P extends { context: Context; input: infer __ } - ? S extends ActivityResultSuccess - ? S - : never - : never - : never; - /** * Wraps an activity execution so that types are enforced and errors are handled consistently. * The purpose is to reduce boilerplate in activity implementation and let developers define only what it matters in terms of business logic @@ -54,16 +34,19 @@ export type SuccessOfActivityBody> = B extends ( * @param OutputCodec an io-ts codec which maps the expected output structure * @returns */ -export const createActivity = >( +export const createActivity = < + I extends unknown = unknown, + S extends ActivityResultSuccess = ActivityResultSuccess, + F extends ActivityResultFailure = ActivityResultFailure +>( activityName: string, - InputCodec: t.Type>, - OutputCodec: t.Type>, - body: B + InputCodec: t.Type, + OutputCodec: t.Type, + body: ActivityBody ) => async ( context: Context, rawInput: unknown -): Promise> => { - // TODO: define type variable TNext so that +): Promise => { const logger = createLogger(context, activityName); return fromEither(InputCodec.decode(rawInput)) @@ -74,7 +57,10 @@ export const createActivity = >( ) ) .chain(input => body({ context, logger, input })) - .map(OutputCodec.encode) - .fold(identity, identity) + .map(e => OutputCodec.encode(e)) + .fold( + identity, + identity + ) .run(); }; diff --git a/utils/durable/activities/log.ts b/utils/durable/activities/log.ts index a61ed8c..45fbd01 100644 --- a/utils/durable/activities/log.ts +++ b/utils/durable/activities/log.ts @@ -13,15 +13,13 @@ export const createLogger = ( logPrefix: string = "" ): ActivityLogger => new Proxy(context.log, { - get: (t, key) => { - switch (key) { - case "info": - case "error": - case "warn": - case "verbose": - return (arg0: string) => t[key](`${logPrefix}|${arg0}`); - default: - return t[key]; - } - } + get: (t, key) => + // wrap logger functions + key === "info" || key === "error" || key === "info" || key === "verbose" + ? (arg0: string) => t[key](`${logPrefix}|${arg0}`) + : // for other props, just return them + key in t + ? t[key as keyof typeof t] // we need this cast in order to tell TS that key is actually part of Logger + : // else, the propo does not exists so it's just undefined + undefined }); diff --git a/utils/durable/orchestrators/index.ts b/utils/durable/orchestrators/index.ts index 4776dea..cf53089 100644 --- a/utils/durable/orchestrators/index.ts +++ b/utils/durable/orchestrators/index.ts @@ -12,8 +12,7 @@ import { ActivityBody, ActivityResult, ActivityResultFailure, - InputOfActivityBody, - SuccessOfActivityBody + ActivityResultSuccess } from "../activities"; import { createLogger, IOrchestratorLogger } from "./log"; import { @@ -77,6 +76,13 @@ export const createOrchestrator = ( } }; +export type CallableActivity< + I extends unknown = unknown, + S extends ActivityResultSuccess = ActivityResultSuccess, + // Failures aren't mapped as they are thrown + __ extends ActivityResultFailure = ActivityResultFailure +> = (context: IOrchestrationFunctionContext, input: I) => Generator; + /** * Creates a callable for an activity to be used into an orchestrator function. * Types are enforced from a ActivityBody definition so that they are bound to the actual activity implementation @@ -85,15 +91,19 @@ export const createOrchestrator = ( * @param retryOptions if provided, the activity will be retried when failing * @returns a generator function which takes an orchestrator context and an input for the activity */ -export const callableActivity = = undefined>( +export const callableActivity = < + I extends unknown = unknown, + S extends ActivityResultSuccess = ActivityResultSuccess, + __ extends ActivityResultFailure = ActivityResultFailure +>( activityName: string, - OutputCodec: t.Type>, + OutputCodec: t.Type, retryOptions?: RetryOptions ) => function*( context: IOrchestrationFunctionContext, - input: InputOfActivityBody - ): Generator> { + input: I + ): Generator { const result = yield typeof retryOptions === "undefined" ? context.df.callActivity(activityName, input) : context.df.callActivityWithRetry(activityName, retryOptions, input); @@ -132,8 +142,3 @@ export const callableActivity = = undefined>( identity ); }; - -export type CallableActivity = undefined> = ( - context: IOrchestrationFunctionContext, - input: InputOfActivityBody -) => Generator>; From 7921ca44dca5c2d9c4f1a6b477bbc4536b6ca85a Mon Sep 17 00:00:00 2001 From: Emanuele De Cupis Date: Tue, 13 Apr 2021 12:18:22 +0200 Subject: [PATCH 4/6] restore name --- HandleNHCreateOrUpdateInstallationCallActivity/handler.ts | 4 ++-- HandleNHCreateOrUpdateInstallationCallActivity/index.ts | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/HandleNHCreateOrUpdateInstallationCallActivity/handler.ts b/HandleNHCreateOrUpdateInstallationCallActivity/handler.ts index 110bbb5..569c5fb 100644 --- a/HandleNHCreateOrUpdateInstallationCallActivity/handler.ts +++ b/HandleNHCreateOrUpdateInstallationCallActivity/handler.ts @@ -14,7 +14,7 @@ import { createOrUpdateInstallation } from "../utils/notification"; import { NotificationHubConfig } from "../utils/notificationhubServicePartition"; // Activity input -export type CreateOrUpdateActivityInput = t.TypeOf; +export type ActivityInput = t.TypeOf; export const ActivityInput = t.interface({ installationId: InstallationId, notificationHubConfig: NotificationHubConfig, @@ -26,7 +26,7 @@ export const ActivityInput = t.interface({ export { ActivityResultSuccess } from "../utils/durable/activities"; export type ActivityBodyImpl = ActivityBody< - CreateOrUpdateActivityInput, + ActivityInput, ActivityResultSuccess >; diff --git a/HandleNHCreateOrUpdateInstallationCallActivity/index.ts b/HandleNHCreateOrUpdateInstallationCallActivity/index.ts index 7d61231..5abae2c 100644 --- a/HandleNHCreateOrUpdateInstallationCallActivity/index.ts +++ b/HandleNHCreateOrUpdateInstallationCallActivity/index.ts @@ -6,10 +6,7 @@ import { getActivityBody } from "./handler"; -export { - CreateOrUpdateActivityInput as ActivityInput, - ActivityResultSuccess -} from "./handler"; +export { ActivityInput, ActivityResultSuccess } from "./handler"; export const activityName = "HandleNHCreateOrUpdateInstallationCallActivity"; const activityFunctionHandler = createActivity( From 06ce2f349810280d826ed26f7e1496e5d7ff775c Mon Sep 17 00:00:00 2001 From: Emanuele De Cupis Date: Tue, 13 Apr 2021 12:51:23 +0200 Subject: [PATCH 5/6] Update yarn.lock Co-authored-by: gquadrati <75862507+gquadrati@users.noreply.github.com> --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index a6d30ac..c7612ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5063,7 +5063,7 @@ json-stable-stringify@^1.0.0: dependencies: jsonify "~0.0.0" -json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= From b2819af3ec0996e7aac7cbfbae6831ee19d6c1d5 Mon Sep 17 00:00:00 2001 From: gquadrati Date: Tue, 13 Apr 2021 14:27:24 +0200 Subject: [PATCH 6/6] renamed CreateOrUpdateActivityBodyImpl to CreateOrUpdateActivityInput --- .../index.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts b/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts index 434c27b..4fde419 100644 --- a/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts +++ b/HandleNHCreateOrUpdateInstallationCallOrchestrator/index.ts @@ -5,7 +5,7 @@ import { getConfigOrThrow } from "../utils/config"; import { getHandler } from "./handler"; import { - ActivityInput as CreateOrUpdateActivityBodyImpl, + ActivityInput as CreateOrUpdateActivityInput, activityName as CreateOrUpdateActivityName, ActivityResultSuccess as CreateOrUpdateActivityResultSuccess } from "../HandleNHCreateOrUpdateInstallationCallActivity"; @@ -13,12 +13,14 @@ import { getNHLegacyConfig } from "../utils/notificationhubServicePartition"; const config = getConfigOrThrow(); -const createOrUpdateActivity = o.callableActivity< - CreateOrUpdateActivityBodyImpl ->(CreateOrUpdateActivityName, CreateOrUpdateActivityResultSuccess, { - ...new df.RetryOptions(5000, config.RETRY_ATTEMPT_NUMBER), - backoffCoefficient: 1.5 -}); +const createOrUpdateActivity = o.callableActivity( + CreateOrUpdateActivityName, + CreateOrUpdateActivityResultSuccess, + { + ...new df.RetryOptions(5000, config.RETRY_ATTEMPT_NUMBER), + backoffCoefficient: 1.5 + } +); const notificationHubConfig = getNHLegacyConfig(config);