From f5933ec0548fb4ac327152b6d7afe7ca2978bade Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 5 Oct 2024 07:58:08 +0800 Subject: [PATCH] feat: sdk add send feed function export --- packages/client-sdk/package.json | 2 +- packages/client-sdk/src/feed.ts | 13 +++++++++++++ packages/client-sdk/src/index.ts | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 packages/client-sdk/src/feed.ts diff --git a/packages/client-sdk/package.json b/packages/client-sdk/package.json index e6a2cd6..8e946f7 100644 --- a/packages/client-sdk/package.json +++ b/packages/client-sdk/package.json @@ -1,6 +1,6 @@ { "name": "tianji-client-sdk", - "version": "1.0.3", + "version": "1.1.0", "description": "", "main": "lib/index.js", "scripts": { diff --git a/packages/client-sdk/src/feed.ts b/packages/client-sdk/src/feed.ts new file mode 100644 index 0000000..39848b5 --- /dev/null +++ b/packages/client-sdk/src/feed.ts @@ -0,0 +1,13 @@ +import { $OpenApiTs, FeedService } from './open/client'; + +export async function sendFeed( + channelId: string, + payload: $OpenApiTs['/feed/{channelId}/send']['post']['req']['requestBody'] +) { + const res = await FeedService.feedSendEvent({ + channelId, + requestBody: payload, + }); + + return res; +} diff --git a/packages/client-sdk/src/index.ts b/packages/client-sdk/src/index.ts index 7b52310..3ab3b92 100644 --- a/packages/client-sdk/src/index.ts +++ b/packages/client-sdk/src/index.ts @@ -2,3 +2,4 @@ export { initOpenapiSDK } from './config'; export { openApiClient } from './open'; export * from './tracker'; export * from './survey'; +export * from './feed';