From 96cfd268021c1d83b6dba711cf6b9490528f278b Mon Sep 17 00:00:00 2001 From: Stefano D'Aversa Date: Mon, 9 Jan 2023 10:31:22 +0100 Subject: [PATCH] use reference to package SDK (#253) --- WebhookNotification/client.ts | 6 +++--- WebhookNotification/handler.ts | 2 +- package.json | 4 ++-- yarn.lock | 17 +++++++++++++---- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/WebhookNotification/client.ts b/WebhookNotification/client.ts index 44cc4130..0c2484b1 100644 --- a/WebhookNotification/client.ts +++ b/WebhookNotification/client.ts @@ -6,9 +6,9 @@ import { } from "@pagopa/ts-commons/lib/requests"; import * as r from "@pagopa/ts-commons/lib/requests"; import { ProblemJson } from "@pagopa/ts-commons/lib/responses"; -import { Notification } from "../generated/notifications/Notification"; -import { notifyDefaultDecoder } from "../generated/notifications/requestTypes"; -import { SuccessResponse } from "../generated/notifications/SuccessResponse"; +import { Notification } from "@pagopa/io-backend-notifications-sdk/Notification"; +import { notifyDefaultDecoder } from "@pagopa/io-backend-notifications-sdk/requestTypes"; +import { SuccessResponse } from "@pagopa/io-backend-notifications-sdk/SuccessResponse"; export type WebhookNotifyT = r.IPostApiRequestType< { readonly notification: Notification; readonly webhookEndpoint: HttpsUrl }, diff --git a/WebhookNotification/handler.ts b/WebhookNotification/handler.ts index ab4b4730..fb0efa13 100644 --- a/WebhookNotification/handler.ts +++ b/WebhookNotification/handler.ts @@ -44,7 +44,7 @@ import { flow, pipe } from "fp-ts/lib/function"; import { TaskEither } from "fp-ts/lib/TaskEither"; import { Profile } from "@pagopa/io-functions-commons/dist/src/models/profile"; import { PushNotificationsContentTypeEnum } from "@pagopa/io-functions-commons/dist/generated/definitions/PushNotificationsContentType"; -import { Notification } from "../generated/notifications/Notification"; +import { Notification } from "@pagopa/io-backend-notifications-sdk/Notification"; import { withJsonInput } from "../utils/with-json-input"; import { withDecodedInput } from "../utils/with-decoded-input"; import { diff --git a/package.json b/package.json index f86b677e..16ec2967 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "pregenerate": "npm run openapi:bundle", "generate": "npm-run-all generate:*", "generate:definitions": "rimraf ./generated/definitions && shx mkdir -p ./generated/definitions && gen-api-models --api-spec ./openapi/index.yaml --no-strict --out-dir ./generated/definitions", - "generate:api-notifications": "rimraf ./generated/notifications && shx mkdir -p ./generated/notifications && gen-api-models --api-spec https://raw.githubusercontent.com/pagopa/io-backend/master/api_notifications.yaml --out-dir ./generated/notifications --response-decoders --request-types", "generate:payment-updater": "rimraf generated/payment-updater && shx mkdir -p generated/payment-updater && gen-api-models --api-spec ./openapi/payment-updater.yaml --no-strict --out-dir ./generated/payment-updater --request-types --response-decoders --client", "openapi:bundle": "bundle-api-spec -i openapi/index.yaml.template -o openapi/index.yaml -V $npm_package_version", "openapi:validate": "oval validate -p openapi/index.yaml", @@ -62,8 +61,9 @@ "dependencies": { "@azure/cosmos": "^3.17.1", "@pagopa/express-azure-functions": "^2.0.0", + "@pagopa/io-backend-notifications-sdk": "x", + "@pagopa/io-functions-admin-sdk": "x", "@pagopa/io-functions-commons": "^26.3.0", - "@pagopa/io-functions-admin-sdk": "^0.32.1", "@pagopa/ts-commons": "^10.10.0", "applicationinsights": "^1.7.4", "azure-storage": "^2.10.4", diff --git a/yarn.lock b/yarn.lock index 3d6fcb09..b2bdefda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -760,10 +760,19 @@ resolved "https://registry.yarnpkg.com/@pagopa/express-azure-functions/-/express-azure-functions-2.0.0.tgz#eb52a0b997d931c1509372e2a9bea22a8ca85c17" integrity sha512-IFZqtk0e2sfkMZIxYqPORzxcKRkbIrVJesR6eMLNwzh1rA4bl2uh9ZHk1m55LNq4ZmaxREDu+1JcGlIaZQgKNQ== -"@pagopa/io-functions-admin-sdk@^0.32.1": - version "0.32.1" - resolved "https://registry.yarnpkg.com/@pagopa/io-functions-admin-sdk/-/io-functions-admin-sdk-0.32.1.tgz#f1877f65c3a48f1296f973456d10fbf7431a4237" - integrity sha512-aAdl6kigkHkU693qoCgVSgetSeqWIAbX3Rv3kzO3gSDK0EzuIcUuqWcR7EvGtrc3Cc+ULBnGDVdlIFY7ReCQ0g== +"@pagopa/io-backend-notifications-sdk@x": + version "9.7.0" + resolved "https://registry.yarnpkg.com/@pagopa/io-backend-notifications-sdk/-/io-backend-notifications-sdk-9.7.0.tgz#887069f3c717a01e22ccc4a1323ba3b6a4fc0560" + integrity sha512-qIepFBWeoadgvQcSjgRt5SNw1xgqOjdZyUpm62keEz9W04Q+Qn6oxMCXcm1IfgWYXWn7ajMRVlfPWa4upSfdkA== + dependencies: + "@pagopa/ts-commons" "^10.0.0" + fp-ts "^2.10.5" + io-ts "^2.2.16" + +"@pagopa/io-functions-admin-sdk@x": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@pagopa/io-functions-admin-sdk/-/io-functions-admin-sdk-0.32.4.tgz#c009e534247bf785d7a22d40c2c4e996420d4062" + integrity sha512-txkOlcdGZ7puJlxbRMg3XYNTyuN+wJfL+t1Xaw2HkbvM0xGaFvK6wjDyfJr6x5THytfZz4SQlUMD5accPnjxnw== dependencies: "@pagopa/ts-commons" "^10.0.0" fp-ts "^2.10.5"