Skip to content

Commit

Permalink
removed useless comments after merging in other comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Disaro committed Apr 15, 2021
1 parent aed8983 commit ec22ef2
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 84 deletions.
3 changes: 0 additions & 3 deletions CreateMessage/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ import {
import { NonEmptyString } from "italia-ts-commons/lib/strings";
import { PromiseType } from "italia-ts-commons/lib/types";

// eslint-disable-next-line @typescript-eslint/naming-convention
const ApiNewMessageWithDefaults = t.intersection([
ApiNewMessage,
// eslint-disable-next-line @typescript-eslint/naming-convention
t.interface({ time_to_live: TimeToLiveSeconds })
]);
export type ApiNewMessageWithDefaults = t.TypeOf<
Expand All @@ -91,7 +89,6 @@ export type ApiNewMessageWithDefaults = t.TypeOf<
/**
* A request middleware that validates the Message payload.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export const MessagePayloadMiddleware: IRequestMiddleware<
"IResponseErrorValidation",
ApiNewMessageWithDefaults
Expand Down
4 changes: 0 additions & 4 deletions CreateNotificationActivity/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ async function createNotification(
};
}

// eslint-disable-next-line @typescript-eslint/naming-convention
export const CreateNotificationActivityInput = t.interface({
createdMessageEvent: CreatedMessageEvent,
storeMessageContentActivityResult: SuccessfulStoreMessageContentActivityResult
Expand All @@ -84,7 +83,6 @@ export type CreateNotificationActivityInput = t.TypeOf<
typeof CreateNotificationActivityInput
>;

// eslint-disable-next-line @typescript-eslint/naming-convention
const CreateNotificationActivitySomeResult = t.interface({
hasEmail: t.boolean,
hasWebhook: t.boolean,
Expand All @@ -96,7 +94,6 @@ type CreateNotificationActivitySomeResult = t.TypeOf<
typeof CreateNotificationActivitySomeResult
>;

// eslint-disable-next-line @typescript-eslint/naming-convention
const CreateNotificationActivityNoneResult = t.interface({
kind: t.literal("none")
});
Expand All @@ -105,7 +102,6 @@ type CreateNotificationActivityNoneResult = t.TypeOf<
typeof CreateNotificationActivityNoneResult
>;

// eslint-disable-next-line @typescript-eslint/naming-convention
export const CreateNotificationActivityResult = t.taggedUnion("kind", [
CreateNotificationActivitySomeResult,
CreateNotificationActivityNoneResult
Expand Down
9 changes: 0 additions & 9 deletions CreateService/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ const createSubscriptionTask = (
() =>
apiClient.createSubscription({
body: {
// eslint-disable-next-line @typescript-eslint/naming-convention
product_name: productName
},
email: userEmail,
// eslint-disable-next-line @typescript-eslint/naming-convention
subscription_id: subscriptionId
}),
200
Expand Down Expand Up @@ -133,14 +131,10 @@ const createServiceTask = (
apiClient.createService({
body: {
...servicePayload,
// eslint-disable-next-line @typescript-eslint/naming-convention
authorized_recipients: [sandboxFiscalCode],
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: subscriptionId,
// eslint-disable-next-line @typescript-eslint/naming-convention
service_metadata: {
...servicePayload.service_metadata,
// eslint-disable-next-line @typescript-eslint/naming-convention
token_name: adb2cTokenName
}
}
Expand Down Expand Up @@ -196,9 +190,7 @@ export function CreateServiceHandler(
});
return ResponseSuccessJson({
...service,
// eslint-disable-next-line @typescript-eslint/naming-convention
primary_key: subscription.primary_key,
// eslint-disable-next-line @typescript-eslint/naming-convention
secondary_key: subscription.secondary_key
});
})
Expand Down Expand Up @@ -236,7 +228,6 @@ export function CreateService(
);
return wrapRequestHandler(
middlewaresWrap(
// eslint-disable-next-line @typescript-eslint/naming-convention
checkSourceIpForHandler(handler, (_, __, c, u, ___) => ipTuple(c, u))
)
);
Expand Down
8 changes: 0 additions & 8 deletions CreatedMessageOrchestrator/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export type HandlerInputType<T> = T extends Function2<any, infer A, any>
? A
: never;

// eslint-disable-next-line @typescript-eslint/naming-convention
const MessageProcessingEvent = t.interface({
name: t.string,
properties: t.interface({
Expand Down Expand Up @@ -43,18 +42,11 @@ export const trackMessageProcessing = (
: null;

export enum MessageProcessingEventNames {
// eslint-disable-next-line @typescript-eslint/naming-convention
DECODE_INPUT = "api.messages.create.decodeinput",
// eslint-disable-next-line @typescript-eslint/naming-convention
STORE_MESSAGE_DECODE = "api.messages.create.storemessagedecode",
// eslint-disable-next-line @typescript-eslint/naming-convention
UPDATE_NOTIFICATION_STATUS = "api.messages.create.updatenotificationstatus",
// eslint-disable-next-line @typescript-eslint/naming-convention
NO_CHANNEL = "api.messages.create.nochannel",
// eslint-disable-next-line @typescript-eslint/naming-convention
EMAIL_SENT = "api.messages.create.emailsent",
// eslint-disable-next-line @typescript-eslint/naming-convention
WEBHOOK = "api.messages.create.webhook",
// eslint-disable-next-line @typescript-eslint/naming-convention
UPDATE_MESSAGE_STATUS = "api.messages.create.updatemessagestatus"
}
7 changes: 0 additions & 7 deletions EmailNotificationActivity/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ import { sendMail } from "@pagopa/io-functions-commons/dist/src/mailer";
import { generateDocumentHtml } from "./utils";

export interface INotificationDefaults {
// eslint-disable-next-line @typescript-eslint/naming-convention
readonly HTML_TO_TEXT_OPTIONS: HtmlToTextOptions;
// eslint-disable-next-line @typescript-eslint/naming-convention
readonly MAIL_FROM: NonEmptyString;
}

// eslint-disable-next-line @typescript-eslint/naming-convention
export const EmailNotificationActivityInput = t.interface({
notificationEvent: NotificationEvent
});
Expand All @@ -34,7 +31,6 @@ export type EmailNotificationActivityInput = t.TypeOf<
typeof EmailNotificationActivityInput
>;

// eslint-disable-next-line @typescript-eslint/naming-convention
export const EmailNotificationActivityResult = t.taggedUnion("kind", [
t.interface({
kind: t.literal("SUCCESS"),
Expand All @@ -43,7 +39,6 @@ export const EmailNotificationActivityResult = t.taggedUnion("kind", [
}),
t.interface({
kind: t.literal("FAILURE"),
// eslint-disable-next-line @typescript-eslint/naming-convention
reason: t.keyof({ DECODE_ERROR: null })
})
]);
Expand Down Expand Up @@ -159,9 +154,7 @@ export const getEmailNotificationActivityHandler = (
await sendMail(lMailerTransporter, {
from: notificationDefaultParams.MAIL_FROM,
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention
"X-Italia-Messages-MessageId": message.id,
// eslint-disable-next-line @typescript-eslint/naming-convention
"X-Italia-Messages-NotificationId": notificationId
},
html: documentHtml,
Expand Down
2 changes: 0 additions & 2 deletions EmailNotificationActivity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ const activityFunction: AzureFunction = getEmailNotificationActivityHandler(
mailerTransporter,
notificationModel,
{
// eslint-disable-next-line @typescript-eslint/naming-convention
HTML_TO_TEXT_OPTIONS,
// eslint-disable-next-line @typescript-eslint/naming-convention
MAIL_FROM
}
);
Expand Down
3 changes: 0 additions & 3 deletions GetService/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const getServiceTask = (
logger,
() =>
apiClient.getService({
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId
}),
200
Expand All @@ -88,7 +87,6 @@ const getSubscriptionKeysTask = (
logger,
() =>
apiClient.getSubscriptionKeys({
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId
}),
200
Expand Down Expand Up @@ -145,7 +143,6 @@ export function GetService(
);
return wrapRequestHandler(
middlewaresWrap(
// eslint-disable-next-line @typescript-eslint/naming-convention
checkSourceIpForHandler(handler, (_, __, c, u, ___) => ipTuple(c, u))
)
);
Expand Down
1 change: 0 additions & 1 deletion GetSubscriptionsFeed/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ export function GetSubscriptionsFeedHandler(
/**
* A string that represents a date in the format YYYY-MM-DD
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
const ShortDateString = t.refinement(
PatternString("\\d\\d\\d\\d-\\d\\d-\\d\\d"),
s => !isNaN(new Date(s).getTime()),
Expand Down
1 change: 0 additions & 1 deletion MessageStatusUpdaterActivity/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from "@pagopa/io-functions-commons/dist/src/models/message_status";
import { ReadableReporter } from "italia-ts-commons/lib/reporters";

// eslint-disable-next-line @typescript-eslint/naming-convention
export const Input = t.interface({
messageId: NonEmptyString,
status: MessageStatusValue
Expand Down
1 change: 0 additions & 1 deletion NotificationStatusUpdaterActivity/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type INotificationStatusUpdaterResult =
}
| { readonly kind: "FAILURE" };

// eslint-disable-next-line @typescript-eslint/naming-convention
export const NotificationStatusUpdaterActivityInput = t.interface({
channel: NotificationChannel,
messageId: NonEmptyString,
Expand Down
1 change: 0 additions & 1 deletion RegenerateServiceKey/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const regenerateServiceKeyTask = (
() =>
apiClient.RegenerateSubscriptionKeys({
body: subscriptionKeyTypePayload,
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId
}),
200
Expand Down
8 changes: 0 additions & 8 deletions StoreMessageContentActivity/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { isLeft } from "fp-ts/lib/Either";
import { fromNullable, isNone } from "fp-ts/lib/Option";
import { readableReport } from "italia-ts-commons/lib/reporters";

// eslint-disable-next-line @typescript-eslint/naming-convention
export const SuccessfulStoreMessageContentActivityResult = t.interface({
blockedInboxOrChannels: t.readonlyArray(BlockedInboxOrChannel),
kind: t.literal("SUCCESS"),
Expand All @@ -27,20 +26,14 @@ export type SuccessfulStoreMessageContentActivityResult = t.TypeOf<
typeof SuccessfulStoreMessageContentActivityResult
>;

// eslint-disable-next-line @typescript-eslint/naming-convention
export const FailedStoreMessageContentActivityResult = t.interface({
kind: t.literal("FAILURE"),
reason: t.keyof({
// see https://github.com/gcanti/io-ts#union-of-string-literals
// eslint-disable-next-line @typescript-eslint/naming-convention
BAD_DATA: null,
// eslint-disable-next-line @typescript-eslint/naming-convention
MASTER_INBOX_DISABLED: null,
// eslint-disable-next-line @typescript-eslint/naming-convention
PERMANENT_ERROR: null,
// eslint-disable-next-line @typescript-eslint/naming-convention
PROFILE_NOT_FOUND: null,
// eslint-disable-next-line @typescript-eslint/naming-convention
SENDER_BLOCKED: null
})
});
Expand All @@ -49,7 +42,6 @@ export type FailedStoreMessageContentActivityResult = t.TypeOf<
typeof FailedStoreMessageContentActivityResult
>;

// eslint-disable-next-line @typescript-eslint/naming-convention
export const StoreMessageContentActivityResult = t.taggedUnion("kind", [
SuccessfulStoreMessageContentActivityResult,
FailedStoreMessageContentActivityResult
Expand Down
6 changes: 0 additions & 6 deletions UpdateService/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const getSubscriptionKeysTask = (
logger,
() =>
apiClient.getSubscriptionKeys({
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId
}),
200
Expand All @@ -101,7 +100,6 @@ const getServiceTask = (
logger,
() =>
apiClient.getService({
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId
}),
200
Expand Down Expand Up @@ -137,16 +135,12 @@ const updateServiceTask = (
body: {
...retrievedService,
...servicePayload,
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId,
// eslint-disable-next-line @typescript-eslint/naming-convention
service_metadata: {
...servicePayload.service_metadata,
// eslint-disable-next-line @typescript-eslint/naming-convention
token_name: adb2cTokenName
}
},
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId
}),
200
Expand Down
1 change: 0 additions & 1 deletion UploadOrganizationLogo/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const uploadOrganizationLogoTask = (
() =>
apiClient.uploadOrganizationLogo({
body: logo,
// eslint-disable-next-line @typescript-eslint/naming-convention
organization_fiscal_code: organizationFiscalCode
}),
201
Expand Down
1 change: 0 additions & 1 deletion UploadServiceLogo/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const uploadServiceLogoTask = (
() =>
apiClient.uploadServiceLogo({
body: logo,
// eslint-disable-next-line @typescript-eslint/naming-convention
service_id: serviceId
}),
201
Expand Down
1 change: 0 additions & 1 deletion WebhookNotificationActivity/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const getNotifyClient = (
headers: ApiHeaderJson,
method: "post",
query: _ => ({}),
// eslint-disable-next-line @typescript-eslint/naming-convention
response_decoder: notifyDefaultDecoder(),
url: params => `${params.webhookEndpoint}`
} as WebhookNotifyT,
Expand Down
10 changes: 0 additions & 10 deletions WebhookNotificationActivity/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import {
import { Notification } from "../generated/notifications/Notification";
import { WebhookNotifyT } from "./client";

// eslint-disable-next-line @typescript-eslint/naming-convention
export const WebhookNotificationActivityInput = t.interface({
notificationEvent: NotificationEvent
});
Expand All @@ -54,7 +53,6 @@ export type WebhookNotificationActivityInput = t.TypeOf<
typeof WebhookNotificationActivityInput
>;

// eslint-disable-next-line @typescript-eslint/naming-convention
export const WebhookNotificationActivityResult = t.taggedUnion("kind", [
t.interface({
kind: t.literal("SUCCESS"),
Expand All @@ -63,7 +61,6 @@ export const WebhookNotificationActivityResult = t.taggedUnion("kind", [
}),
t.interface({
kind: t.literal("FAILURE"),
// eslint-disable-next-line @typescript-eslint/naming-convention
reason: t.keyof({ DECODE_ERROR: null, SEND_TO_WEBHOOK_FAILED: null })
})
]);
Expand All @@ -82,12 +79,9 @@ function newMessageToPublic(
content?: MessageContent
): Notification["message"] {
const message = {
// eslint-disable-next-line @typescript-eslint/naming-convention
created_at: newMessage.createdAt,
// eslint-disable-next-line @typescript-eslint/naming-convention
fiscal_code: newMessage.fiscalCode,
id: newMessage.id,
// eslint-disable-next-line @typescript-eslint/naming-convention
sender_service_id: newMessage.senderServiceId
};
return content ? { ...message, content } : message;
Expand All @@ -102,11 +96,8 @@ function senderMetadataToPublic(
senderMetadata: CreatedMessageEventSenderMetadata
): SenderMetadata {
return {
// eslint-disable-next-line @typescript-eslint/naming-convention
department_name: senderMetadata.departmentName,
// eslint-disable-next-line @typescript-eslint/naming-convention
organization_name: senderMetadata.organizationName,
// eslint-disable-next-line @typescript-eslint/naming-convention
service_name: senderMetadata.serviceName
};
}
Expand All @@ -131,7 +122,6 @@ export function sendToWebhook(
message: senderMetadata.requireSecureChannels
? newMessageToPublic(message)
: newMessageToPublic(message, content),
// eslint-disable-next-line @typescript-eslint/naming-convention
sender_metadata: senderMetadataToPublic(senderMetadata)
},
webhookEndpoint
Expand Down
Loading

0 comments on commit ec22ef2

Please sign in to comment.