added errorSchema to ReferralSystem service (#34)

Co-authored-by: kuduzow <admin@intocode.ru>
This commit is contained in:
Kuduzow Akhmad
2023-01-26 23:46:22 +03:00
committed by GitHub
parent 6c641eabaf
commit e99c3ee9cd
4 changed files with 12 additions and 1 deletions

View File

@@ -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",

View File

@@ -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,
);
}

View File

@@ -0,0 +1,8 @@
import { z } from 'zod';
const errorSchema = z.object({
status: z.string(),
message: z.string(),
});
export default errorSchema;

View File

@@ -1,2 +1,3 @@
export { default as linkSchema } from './linkSchema';
export { default as distinctAnalyticsSchema } from './distinctAnalyticsSchema';
export { default as errorSchema } from './errorSchema';