@tacoreai/web-sdk 1.15.0 → 1.18.0

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.
@@ -20,8 +20,16 @@ export class AppsPublicClient extends BaseAppsClient {
20
20
  get adapters() {
21
21
  return {
22
22
  'submitPublicData': ({ modelName, data }) => this.submitPublicData(modelName, data),
23
- 'readConfiguredPublicData': (params) => {
24
- const { modelName, ...rest } = params;
23
+ 'readConfiguredPublicData': (params = {}) => {
24
+ const { modelName, query, ...rest } = params;
25
+
26
+ // 新版约定:invoke('readConfiguredPublicData', { modelName, query })
27
+ // 其中 query 可以是 wyID 字符串,也可以是分页/过滤对象。
28
+ if (query !== undefined) {
29
+ return this.readConfiguredPublicData(modelName, query);
30
+ }
31
+
32
+ // 兼容旧版平铺参数:invoke('readConfiguredPublicData', { modelName, wyID })
25
33
  if (rest.wyID && Object.keys(rest).length === 1) {
26
34
  return this.readConfiguredPublicData(modelName, rest.wyID);
27
35
  }
@@ -104,4 +112,4 @@ export class AppsPublicClient extends BaseAppsClient {
104
112
  throw error;
105
113
  }
106
114
  }
107
- }
115
+ }
@@ -200,13 +200,13 @@ export class BaseAppsClient {
200
200
  const url = `${this.config.apiBaseUrl}${endpoint}`;
201
201
  const headers = this._getRequestHeaders(options.headers);
202
202
 
203
- if (isBackendPreviewMode()) {
204
- console.log(`[BaseAppsClient Debug][${this.appId}] endpoint="${endpoint}"`, {
205
- hasAuthorization: Boolean(headers.Authorization || headers.authorization),
206
- hasInteropHeader: Boolean(headers["x-tacore-server-interop-app-server-api-key"]),
207
- hasPreviewAppServerApiKeyHeader: Boolean(headers[PREVIEW_APPSERVER_API_KEY_HEADER]),
208
- });
209
- }
203
+ // if (isBackendPreviewMode()) {
204
+ // console.log(`[BaseAppsClient Debug][${this.appId}] endpoint="${endpoint}"`, {
205
+ // hasAuthorization: Boolean(headers.Authorization || headers.authorization),
206
+ // hasInteropHeader: Boolean(headers["x-tacore-server-interop-app-server-api-key"]),
207
+ // hasPreviewAppServerApiKeyHeader: Boolean(headers[PREVIEW_APPSERVER_API_KEY_HEADER]),
208
+ // });
209
+ // }
210
210
 
211
211
  const response = await fetch(url, {
212
212
  ...options,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tacoreai/web-sdk",
3
3
  "description": "This file is for app server package, not the real npm package",
4
- "version": "1.15.0",
4
+ "version": "1.18.0",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public",
package/utils/index.js CHANGED
@@ -47,6 +47,14 @@ export function getRouterBasename() {
47
47
  }
48
48
 
49
49
  export function getAppsApiBaseUrl() {
50
+ const isSSR = !!(
51
+ (typeof import.meta !== 'undefined' && import.meta.env?.SSR) ||
52
+ (typeof window === 'undefined')
53
+ );
54
+ // stone手动: 标准构建 ssr 环境,直接返回生产环境地址
55
+ if (isSSR) {
56
+ return `https://api.tacore.chat`;
57
+ }
50
58
  // 后端环境逻辑
51
59
  if (isBackend) {
52
60
  // stone 手动: tacore server 内网地址