From e99c3ee9cd3f1255475f866b7b42caf21984c586 Mon Sep 17 00:00:00 2001 From: Kuduzow Akhmad Date: Thu, 26 Jan 2023 23:46:22 +0300 Subject: [PATCH] added errorSchema to ReferralSystem service (#34) Co-authored-by: kuduzow --- package.json | 2 +- src/services/ReferralSystem/index.ts | 2 ++ src/services/ReferralSystem/schemas/errorSchema.ts | 8 ++++++++ src/services/ReferralSystem/schemas/index.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/services/ReferralSystem/schemas/errorSchema.ts diff --git a/package.json b/package.json index 6c4e609..22960b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.15.30", + "version": "0.15.31-rc.0", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", diff --git a/src/services/ReferralSystem/index.ts b/src/services/ReferralSystem/index.ts index 81c698a..7473634 100644 --- a/src/services/ReferralSystem/index.ts +++ b/src/services/ReferralSystem/index.ts @@ -1,4 +1,5 @@ import fetchWithValidation from '../../fetchWithValidation'; +import { errorSchema } from './schemas'; import distinctAnalyticsSchema from './schemas/distinctAnalyticsSchema'; import linkSchema from './schemas/linkSchema'; @@ -90,6 +91,7 @@ class ReferralSystem { method: 'POST', body: JSON.stringify({ payload, signature }), }, + errorSchema, ); } diff --git a/src/services/ReferralSystem/schemas/errorSchema.ts b/src/services/ReferralSystem/schemas/errorSchema.ts new file mode 100644 index 0000000..a128b0d --- /dev/null +++ b/src/services/ReferralSystem/schemas/errorSchema.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +const errorSchema = z.object({ + status: z.string(), + message: z.string(), +}); + +export default errorSchema; diff --git a/src/services/ReferralSystem/schemas/index.ts b/src/services/ReferralSystem/schemas/index.ts index 93c9a19..8ea348a 100644 --- a/src/services/ReferralSystem/schemas/index.ts +++ b/src/services/ReferralSystem/schemas/index.ts @@ -1,2 +1,3 @@ export { default as linkSchema } from './linkSchema'; export { default as distinctAnalyticsSchema } from './distinctAnalyticsSchema'; +export { default as errorSchema } from './errorSchema';