@blueking/chat-helper 0.0.1-beta.1 → 0.0.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -545,6 +545,13 @@ const { agent } = useChatHelper({
545
545
  | `handleMessagesSnapshotEvent` | 消息快照 | 同步多端消息状态 |
546
546
  | `handleActivityDeltaEvent` | 活动增量更新 | 实时更新活动状态 |
547
547
  | `handleActivitySnapshotEvent` | 活动快照 | 获取完整活动状态 |
548
+ | `handleStateDeltaEvent` | 状态增量更新 | 实时更新状态 |
549
+ | `handleStateSnapshotEvent` | 状态快照 | 获取完整状态状态 |
550
+ | `handleStepFinishedEvent` | 步骤完成 | 完成步骤任务 |
551
+ | `handleStepStartedEvent` | 步骤开始 | 开始步骤任务 |
552
+ | `handleCustomEvent` | 自定义事件 | 自定义事件处理 |
553
+ | `handleRawEvent` | 原始事件 | 原始事件处理 |
554
+ | `handleReferenceDocumentCustomEvent` | 参考文档自定义事件 | 参考文档自定义事件处理 |
548
555
 
549
556
  **实际应用示例**:
550
557
 
@@ -253,12 +253,11 @@ export class FetchClient {
253
253
  const timeoutId = requestConfig.timeout && requestConfig.timeout > 0 ? setTimeout(()=>controller.abort(), requestConfig.timeout) : undefined;
254
254
  try {
255
255
  // 发送请求
256
- const request = new Request(url, {
257
- method: requestConfig.method,
256
+ const request = new Request(url, _object_spread_props(_object_spread({}, requestConfig), {
258
257
  headers,
259
258
  body,
260
259
  signal: controller.signal
261
- });
260
+ }));
262
261
  const fetchResponse = yield fetch(request);
263
262
  // 清除超时定时器
264
263
  if (timeoutId) {
@@ -364,12 +363,11 @@ export class FetchClient {
364
363
  // 准备请求(标记为流式请求)
365
364
  const { url, headers, body, requestConfig, controller } = _this.prepareRequest(config, true);
366
365
  // 发送请求
367
- const request = new Request(url, {
368
- method: requestConfig.method || 'GET',
366
+ const request = new Request(url, _object_spread_props(_object_spread({}, requestConfig), {
369
367
  headers,
370
368
  body,
371
369
  signal: controller.signal
372
- });
370
+ }));
373
371
  try {
374
372
  var // 触发 onStart 回调
375
373
  _config_onStart, _fetchResponse_body;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import type { IUseChatHelperOptions } from './type';
2
- export type * from './agent';
3
- export type * from './message';
4
- export type * from './session';
5
- export type * from './type';
2
+ export * from './agent';
3
+ export * from './event';
4
+ export * from './message';
5
+ export * from './session';
6
+ export * from './type';
6
7
  export declare const useChatHelper: (options: IUseChatHelperOptions) => {
7
8
  agent: {
8
9
  info: import("vue").Ref<{
package/dist/index.ts.js CHANGED
@@ -26,6 +26,11 @@
26
26
  import { useHttp } from './http/index.ts.js';
27
27
  import { useMessage } from './message/index.ts.js';
28
28
  import { useSession } from './session/index.ts.js';
29
+ export * from './agent/index.ts.js';
30
+ export * from './event/index.ts.js';
31
+ export * from './message/index.ts.js';
32
+ export * from './session/index.ts.js';
33
+ export * from './type.ts.js';
29
34
  export const useChatHelper = (options)=>{
30
35
  const http = useHttp(options);
31
36
  const message = useMessage(http);
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Tencent is pleased to support the open source community by making
3
+ * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
4
+ *
5
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
6
+ *
7
+ * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
8
+ *
9
+ * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
10
+ *
11
+ * ---------------------------------------------------
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
14
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
18
+ * the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
21
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24
+ * IN THE SOFTWARE.
25
+ */ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/chat-helper",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.1-beta.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.ts.js",
6
6
  "scripts": {