apaas-oapi-client 0.1.9 → 0.1.10

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/dist/index.d.ts CHANGED
@@ -3,20 +3,20 @@ import { LoggerLevel } from './logger';
3
3
  * Client 初始化配置
4
4
  */
5
5
  interface ClientOptions {
6
- /** 命名空间,例如 app_xxx */
6
+ /** 命名空间, 例如 app_xxx */
7
7
  namespace: string;
8
8
  /** 应用 clientId */
9
9
  clientId: string;
10
10
  /** 应用 clientSecret */
11
11
  clientSecret: string;
12
- /** 是否禁用 token 缓存,每次调用强制刷新 token,默认 false */
12
+ /** 是否禁用 token 缓存, 每次调用强制刷新 token, 默认 false */
13
13
  disableTokenCache?: boolean;
14
14
  }
15
15
  /**
16
16
  * records_query 接口请求参数
17
17
  */
18
18
  interface RecordsQueryParams {
19
- /** 对象名称,例如 object_store */
19
+ /** 对象名称, 例如 object_store */
20
20
  object_name: string;
21
21
  /** 请求体数据 */
22
22
  data: any;
@@ -50,7 +50,7 @@ declare class Client {
50
50
  */
51
51
  private log;
52
52
  /**
53
- * 初始化 client,自动获取 token
53
+ * 初始化 client, 自动获取 token
54
54
  */
55
55
  init(): Promise<void>;
56
56
  /**
@@ -58,7 +58,7 @@ declare class Client {
58
58
  */
59
59
  private getAccessToken;
60
60
  /**
61
- * 确保 token 有效,若过期则刷新
61
+ * 确保 token 有效, 若过期则刷新
62
62
  */
63
63
  private ensureTokenValid;
64
64
  /**
package/dist/index.js CHANGED
@@ -69,12 +69,12 @@ class Client {
69
69
  const { object_name, field_name } = params;
70
70
  await this.ensureTokenValid();
71
71
  const url = `/api/data/v1/namespaces/${this.namespace}/meta/objects/${object_name}/fields/${field_name}`;
72
- this.log(LoggerLevel.debug, `[对象字段查询] 📄 开始获取字段元数据 object_name=${object_name}, field_name=${field_name}`);
72
+ this.log(LoggerLevel.debug, `[对象字段查询] 📄 开始获取字段元数据, object_name=${object_name}, field_name=${field_name}`);
73
73
  const res = await this.axiosInstance.get(url, {
74
74
  headers: { Authorization: `${this.accessToken}` }
75
75
  });
76
- this.log(LoggerLevel.debug, `[对象字段查询] 📄 调用完成,返回状态=${res.data.code}`);
77
- this.log(LoggerLevel.trace, `[对象字段查询] 📄 调用完成,返回信息=${JSON.stringify(res.data)}`);
76
+ this.log(LoggerLevel.debug, `[对象字段查询] 📄 object_name=${object_name}, field_name=${field_name}, 调用完成, 返回状态=${res.data.code}`);
77
+ this.log(LoggerLevel.trace, `[对象字段查询] 📄 object_name=${object_name}, field_name=${field_name}, 返回信息=${JSON.stringify(res.data)}`);
78
78
  return res.data;
79
79
  },
80
80
  /**
@@ -90,8 +90,8 @@ class Client {
90
90
  const res = await this.axiosInstance.get(url, {
91
91
  headers: { Authorization: `${this.accessToken}` }
92
92
  });
93
- this.log(LoggerLevel.debug, `[对象字段查询] 📄 调用完成,返回状态=${res.data.code}`);
94
- this.log(LoggerLevel.trace, `[对象字段查询] 📄 调用完成,返回信息=${JSON.stringify(res.data)}`);
93
+ this.log(LoggerLevel.debug, `[对象字段查询] 📄 object_name=${object_name}, 调用完成, 返回状态=${res.data.code}`);
94
+ this.log(LoggerLevel.trace, `[对象字段查询] 📄 object_name=${object_name}, 调用完成, 返回信息=${JSON.stringify(res.data)}`);
95
95
  return res.data;
96
96
  }
97
97
  },
@@ -108,8 +108,8 @@ class Client {
108
108
  const res = await functionLimiter(async () => {
109
109
  await this.ensureTokenValid();
110
110
  const response = await this.axiosInstance.post(url, { select }, { headers: { Authorization: `${this.accessToken}` } });
111
- this.log(LoggerLevel.debug, `[单条查询记录] 🔍 查询 record_id: ${record_id} 调用完成,返回状态: ${response.data.code}`);
112
- this.log(LoggerLevel.trace, `[单条查询记录] 🔍 查询 record_id: ${record_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
111
+ this.log(LoggerLevel.debug, `[单条查询记录] 🔍 查询 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回状态: ${response.data.code}`);
112
+ this.log(LoggerLevel.trace, `[单条查询记录] 🔍 查询 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
113
113
  return response.data;
114
114
  });
115
115
  return res;
@@ -128,8 +128,8 @@ class Client {
128
128
  headers: { Authorization: `${this.accessToken}` }
129
129
  });
130
130
  this.log(LoggerLevel.info, `[批量查询记录] 🔍 接口调用完成`);
131
- this.log(LoggerLevel.debug, `[批量查询记录] 🔍 调用完成,返回状态: ${res.data.code},返回数据总数${((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.total) || 'unknown'}`);
132
- this.log(LoggerLevel.trace, `[批量查询记录] 🔍 调用完成,返回信息: ${JSON.stringify(res.data)}`);
131
+ this.log(LoggerLevel.debug, `[批量查询记录] 🔍 查询 object_name=${object_name}, 调用完成, 返回状态: ${res.data.code}, 返回数据总数${((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.total) || 'unknown'}`);
132
+ this.log(LoggerLevel.trace, `[批量查询记录] 🔍 查询 object_name=${object_name}, 调用完成, 返回信息: ${JSON.stringify(res.data)}`);
133
133
  return res.data;
134
134
  },
135
135
  /**
@@ -156,11 +156,11 @@ class Client {
156
156
  }
157
157
  if (page === 1) {
158
158
  total = res.data.total || 0;
159
- this.log(LoggerLevel.info, '[批量查询记录] 🔍 接口返回 total:', total);
159
+ this.log(LoggerLevel.info, '[批量查询记录] 🔍 查询object_name=${object_name}, 接口返回 total:', total);
160
160
  }
161
161
  nextPageToken = res.data.next_page_token;
162
- this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询,nextPageToken: ${nextPageToken || ''}`);
163
- this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询完成,items.length: ${res.data.items.length}`);
162
+ this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询, nextPageToken: ${nextPageToken || ''}`);
163
+ this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询完成, items.length: ${res.data.items.length}`);
164
164
  this.log(LoggerLevel.trace, `[批量查询记录] 🔍 第 ${page} 页查询结果: ${JSON.stringify(res.data.items)}`);
165
165
  return res;
166
166
  });
@@ -183,9 +183,9 @@ class Client {
183
183
  const response = await this.axiosInstance.post(url, { record }, {
184
184
  headers: { Authorization: `${this.accessToken}` }
185
185
  });
186
- this.log(LoggerLevel.info, `[单条创建记录] ➕ 向对象 ${object_name} 内创建记录,调用完成`);
187
- this.log(LoggerLevel.debug, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据,调用完成,返回状态: ${response.data.code}`);
188
- this.log(LoggerLevel.trace, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据,调用完成,返回信息: ${JSON.stringify(response.data)}`);
186
+ this.log(LoggerLevel.info, `[单条创建记录] ➕ 向对象 ${object_name} 内创建记录, 调用完成`);
187
+ this.log(LoggerLevel.debug, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据, 调用完成, 返回状态: ${response.data.code}`);
188
+ this.log(LoggerLevel.trace, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据, 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
189
189
  return response.data;
190
190
  });
191
191
  return res;
@@ -203,8 +203,8 @@ class Client {
203
203
  headers: { Authorization: `${this.accessToken}` }
204
204
  });
205
205
  this.log(LoggerLevel.info, `[批量创建记录] ➕ 开始向对象 ${object_name} 批量创建记录`);
206
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录,调用完成,返回状态: ${res.data.code}`);
207
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录,调用完成,返回信息: ${JSON.stringify(res.data)}`);
206
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录, 调用完成, 返回状态: ${res.data.code}`);
207
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录, 调用完成, 返回信息: ${JSON.stringify(res.data)}`);
208
208
  return res.data;
209
209
  },
210
210
  /**
@@ -222,12 +222,12 @@ class Client {
222
222
  for (let i = 0; i < records.length; i += chunkSize) {
223
223
  chunks.push(records.slice(i, i + chunkSize));
224
224
  }
225
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
226
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
225
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
226
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
227
227
  for (const [index, chunk] of chunks.entries()) {
228
228
  page += 1;
229
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组,共 ${chunk.length} 条`);
230
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组,共 ${chunk.length} 条`);
229
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组, ${chunk.length} 条`);
230
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组, ${chunk.length} 条`);
231
231
  await functionLimiter(async () => {
232
232
  const res = await this.object.create.records({
233
233
  object_name,
@@ -236,9 +236,9 @@ class Client {
236
236
  if (res.data && Array.isArray(res.data.items)) {
237
237
  results = results.concat(res.data.items);
238
238
  }
239
- this.log(LoggerLevel.info, `[批量创建记录] ➕ 创建第 ${page} 页数据,调用完成,创建数量: ${res.data.items.length}`);
240
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 创建第 ${page} 页页数据,调用完成,返回状态: ${res.data.code}`);
241
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 创建第 ${page} 页页数据,调用结果: ${JSON.stringify(res.data.items)}`);
239
+ this.log(LoggerLevel.info, `[批量创建记录] ➕ 创建 object_name=${object_name}, 第 ${page} 页数据, 调用完成, 创建数量: ${res.data.items.length}`);
240
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 创建 object_name=${object_name}, 第 ${page} 页页数据, 调用完成, 返回状态: ${res.data.code}`);
241
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 创建 object_name=${object_name}, 第 ${page} 页页数据, 调用结果: ${JSON.stringify(res.data.items)}`);
242
242
  return res;
243
243
  });
244
244
  }
@@ -258,9 +258,9 @@ class Client {
258
258
  const res = await functionLimiter(async () => {
259
259
  await this.ensureTokenValid();
260
260
  const response = await this.axiosInstance.patch(url, { record }, { headers: { Authorization: `${this.accessToken}` } });
261
- this.log(LoggerLevel.info, `[单条更新记录] 💾 更新 record_id: ${record_id} 调用完成`);
262
- this.log(LoggerLevel.debug, `[单条更新记录] 💾 更新 record_id: ${record_id} 调用完成,返回状态: ${response.data.code}`);
263
- this.log(LoggerLevel.trace, `[单条更新记录] 💾 更新 record_id: ${record_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
261
+ this.log(LoggerLevel.info, `[单条更新记录] 💾 更新 object_name=${object_name}, record_id: ${record_id} 调用完成`);
262
+ this.log(LoggerLevel.debug, `[单条更新记录] 💾 更新 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回状态: ${response.data.code}`);
263
+ this.log(LoggerLevel.trace, `[单条更新记录] 💾 更新 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
264
264
  return response.data;
265
265
  });
266
266
  return res;
@@ -278,17 +278,17 @@ class Client {
278
278
  for (let i = 0; i < records.length; i += chunkSize) {
279
279
  chunks.push(records.slice(i, i + chunkSize));
280
280
  }
281
- this.log(LoggerLevel.debug, `[批量更新记录] 💾 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
282
- this.log(LoggerLevel.trace, `[批量更新记录] 💾 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
281
+ this.log(LoggerLevel.debug, `[批量更新记录] 💾 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
282
+ this.log(LoggerLevel.trace, `[批量更新记录] 💾 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
283
283
  const results = [];
284
284
  for (const [index, chunk] of chunks.entries()) {
285
- this.log(LoggerLevel.debug, `[批量更新记录] 💾 开始更新第 ${index + 1} 组,共 ${chunk.length} 条`);
286
- this.log(LoggerLevel.trace, `[批量更新记录] 💾 开始更新第 ${index + 1} 组,共 ${chunk.length} 条`);
285
+ this.log(LoggerLevel.debug, `[批量更新记录] 💾 开始更新第 ${index + 1} 组, ${chunk.length} 条`);
286
+ this.log(LoggerLevel.trace, `[批量更新记录] 💾 开始更新第 ${index + 1} 组, ${chunk.length} 条`);
287
287
  const res = await functionLimiter(async () => {
288
288
  await this.ensureTokenValid();
289
289
  const response = await this.axiosInstance.patch(url, { records: chunk }, { headers: { Authorization: `${this.accessToken}` } });
290
- this.log(LoggerLevel.debug, `[批量更新记录] 💾 更新第 ${index + 1} 组调用完成,返回状态: ${JSON.stringify(response.data)}`);
291
- this.log(LoggerLevel.trace, `[批量更新记录] 💾 更新第 ${index + 1} 组调用完成,返回信息: ${response.data}`);
290
+ this.log(LoggerLevel.debug, `[批量更新记录] 💾 更新 object_name=${object_name}, 第 ${index + 1} 组调用完成, 返回状态: ${JSON.stringify(response.data)}`);
291
+ this.log(LoggerLevel.trace, `[批量更新记录] 💾 更新 object_name=${object_name}, 第 ${index + 1} 组调用完成, 返回信息: ${response.data}`);
292
292
  return response.data;
293
293
  });
294
294
  results.push(res);
@@ -305,13 +305,13 @@ class Client {
305
305
  record: async (params) => {
306
306
  const { object_name, record_id } = params;
307
307
  const url = `/v1/data/namespaces/${this.namespace}/objects/${object_name}/records/${record_id}`;
308
- this.log(LoggerLevel.trace, `[单条删除记录] 🗑️ 开始删除 record_id: ${record_id}`);
308
+ this.log(LoggerLevel.trace, `[单条删除记录] 🗑️ object_name=${object_name}, 开始删除 record_id: ${record_id}`);
309
309
  const res = await functionLimiter(async () => {
310
310
  await this.ensureTokenValid();
311
311
  const response = await this.axiosInstance.delete(url, {
312
312
  headers: { Authorization: `${this.accessToken}` }
313
313
  });
314
- this.log(LoggerLevel.info, `[单条删除记录] 🗑️ 删除 record_id: ${record_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
314
+ this.log(LoggerLevel.info, `[单条删除记录] 🗑️ 删除 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
315
315
  return response.data;
316
316
  });
317
317
  return res;
@@ -329,18 +329,18 @@ class Client {
329
329
  for (let i = 0; i < ids.length; i += chunkSize) {
330
330
  chunks.push(ids.slice(i, i + chunkSize));
331
331
  }
332
- this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 总共 ${ids.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
332
+ this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 总共 ${ids.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
333
333
  const results = [];
334
334
  for (const [index, chunk] of chunks.entries()) {
335
- this.log(LoggerLevel.info, `[批量删除记录] 🗑️ 开始删除第 ${index + 1} 组,共 ${chunk.length} 条`);
335
+ this.log(LoggerLevel.info, `[批量删除记录] 🗑️ 开始删除第 ${index + 1} 组, ${chunk.length} 条`);
336
336
  const res = await functionLimiter(async () => {
337
337
  await this.ensureTokenValid();
338
338
  const response = await this.axiosInstance.delete(url, {
339
339
  headers: { Authorization: `${this.accessToken}` },
340
340
  data: { ids: chunk }
341
341
  });
342
- this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成,返回状态: ${response.data.code}`);
343
- this.log(LoggerLevel.trace, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成,返回信息: ${JSON.stringify(response.data)}`);
342
+ this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成, 返回状态: ${response.data.code}`);
343
+ this.log(LoggerLevel.trace, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成, 返回信息: ${JSON.stringify(response.data)}`);
344
344
  return response.data;
345
345
  });
346
346
  results.push(res);
@@ -362,7 +362,7 @@ class Client {
362
362
  const { department_id_type, department_id } = params;
363
363
  // department_id_type 可选值:
364
364
  // - 'department_id' (如 "1758534140403815")
365
- // - 'external_department_id' (外部平台 department_id,无固定格式)
365
+ // - 'external_department_id' (外部平台 department_id, 无固定格式)
366
366
  // - 'external_open_department_id' (以 'oc_' 开头的 open_department_id)
367
367
  const url = '/api/integration/v2/feishu/getDepartments';
368
368
  this.log(LoggerLevel.info, `[部门ID交换] 🔄 开始交换单个部门 ID: ${department_id}`);
@@ -374,8 +374,8 @@ class Client {
374
374
  }, {
375
375
  headers: { Authorization: `${this.accessToken}` }
376
376
  });
377
- this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成,返回状态: ${response.data.code}`);
378
- this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
377
+ this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成, 返回状态: ${response.data.code}`);
378
+ this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
379
379
  return response.data.data[0]; // 返回第一个元素
380
380
  });
381
381
  return res;
@@ -389,7 +389,7 @@ class Client {
389
389
  const { department_id_type, department_ids } = params;
390
390
  // department_id_type 可选值:
391
391
  // - 'department_id' (如 "1758534140403815")
392
- // - 'external_department_id' (外部平台 department_id,无固定格式)
392
+ // - 'external_department_id' (外部平台 department_id, 无固定格式)
393
393
  // - 'external_open_department_id' (以 'oc_' 开头的 open_department_id)
394
394
  const url = '/api/integration/v2/feishu/getDepartments';
395
395
  const chunkSize = 100;
@@ -397,10 +397,10 @@ class Client {
397
397
  for (let i = 0; i < department_ids.length; i += chunkSize) {
398
398
  chunks.push(department_ids.slice(i, i + chunkSize));
399
399
  }
400
- this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 总共 ${department_ids.length} 个部门 ID,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 个`);
400
+ this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 总共 ${department_ids.length} 个部门 ID, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 个`);
401
401
  const results = [];
402
402
  for (const [index, chunk] of chunks.entries()) {
403
- this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 开始交换第 ${index + 1} 组,共 ${chunk.length} 个`);
403
+ this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 开始交换第 ${index + 1} 组, ${chunk.length} 个`);
404
404
  const res = await functionLimiter(async () => {
405
405
  await this.ensureTokenValid();
406
406
  const response = await this.axiosInstance.post(url, {
@@ -409,8 +409,8 @@ class Client {
409
409
  }, {
410
410
  headers: { Authorization: `${this.accessToken}` }
411
411
  });
412
- this.log(LoggerLevel.debug, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成,返回状态: ${response.data.code}`);
413
- this.log(LoggerLevel.trace, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成,返回信息: ${JSON.stringify(response.data)}`);
412
+ this.log(LoggerLevel.debug, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成, 返回状态: ${response.data.code}`);
413
+ this.log(LoggerLevel.trace, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成, 返回信息: ${JSON.stringify(response.data)}`);
414
414
  return response.data.data;
415
415
  });
416
416
  results.push(...res);
@@ -438,8 +438,8 @@ class Client {
438
438
  'Content-Type': 'application/json'
439
439
  }
440
440
  });
441
- this.log(LoggerLevel.debug, `[调用云函数] ☁️ 云函数 ${name} 调用完成,返回状态: code=${res.data.code}`);
442
- this.log(LoggerLevel.trace, `[调用云函数] ☁️ 云函数 ${name} 调用完成,返回信息: code=${JSON.stringify(res.data)}`);
441
+ this.log(LoggerLevel.debug, `[调用云函数] ☁️ 云函数 ${name} 调用完成, 返回状态: code=${res.data.code}`);
442
+ this.log(LoggerLevel.trace, `[调用云函数] ☁️ 云函数 ${name} 调用完成, 返回信息: code=${JSON.stringify(res.data)}`);
443
443
  return res.data;
444
444
  }
445
445
  };
@@ -474,7 +474,7 @@ class Client {
474
474
  }
475
475
  }
476
476
  /**
477
- * 初始化 client,自动获取 token
477
+ * 初始化 client, 自动获取 token
478
478
  */
479
479
  async init() {
480
480
  await this.ensureTokenValid();
@@ -498,7 +498,7 @@ class Client {
498
498
  this.log(LoggerLevel.info, '[client] token refreshed');
499
499
  }
500
500
  /**
501
- * 确保 token 有效,若过期则刷新
501
+ * 确保 token 有效, 若过期则刷新
502
502
  */
503
503
  async ensureTokenValid() {
504
504
  if (this.disableTokenCache) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apaas-oapi-client",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
package/src/index.ts CHANGED
@@ -7,13 +7,13 @@ import { functionLimiter } from './limiter';
7
7
  * Client 初始化配置
8
8
  */
9
9
  interface ClientOptions {
10
- /** 命名空间,例如 app_xxx */
10
+ /** 命名空间, 例如 app_xxx */
11
11
  namespace: string;
12
12
  /** 应用 clientId */
13
13
  clientId: string;
14
14
  /** 应用 clientSecret */
15
15
  clientSecret: string;
16
- /** 是否禁用 token 缓存,每次调用强制刷新 token,默认 false */
16
+ /** 是否禁用 token 缓存, 每次调用强制刷新 token, 默认 false */
17
17
  disableTokenCache?: boolean;
18
18
  }
19
19
 
@@ -33,7 +33,7 @@ interface TokenResponse {
33
33
  * records_query 接口请求参数
34
34
  */
35
35
  interface RecordsQueryParams {
36
- /** 对象名称,例如 object_store */
36
+ /** 对象名称, 例如 object_store */
37
37
  object_name: string;
38
38
  /** 请求体数据 */
39
39
  data: any;
@@ -92,7 +92,7 @@ class Client {
92
92
  }
93
93
  }
94
94
  /**
95
- * 初始化 client,自动获取 token
95
+ * 初始化 client, 自动获取 token
96
96
  */
97
97
  async init() {
98
98
  await this.ensureTokenValid();
@@ -120,7 +120,7 @@ class Client {
120
120
  }
121
121
 
122
122
  /**
123
- * 确保 token 有效,若过期则刷新
123
+ * 确保 token 有效, 若过期则刷新
124
124
  */
125
125
  private async ensureTokenValid() {
126
126
  if (this.disableTokenCache) {
@@ -172,14 +172,14 @@ class Client {
172
172
  await this.ensureTokenValid();
173
173
  const url = `/api/data/v1/namespaces/${this.namespace}/meta/objects/${object_name}/fields/${field_name}`;
174
174
 
175
- this.log(LoggerLevel.debug, `[对象字段查询] 📄 开始获取字段元数据 object_name=${object_name}, field_name=${field_name}`);
175
+ this.log(LoggerLevel.debug, `[对象字段查询] 📄 开始获取字段元数据, object_name=${object_name}, field_name=${field_name}`);
176
176
 
177
177
  const res = await this.axiosInstance.get(url, {
178
178
  headers: { Authorization: `${this.accessToken}` }
179
179
  });
180
180
 
181
- this.log(LoggerLevel.debug, `[对象字段查询] 📄 调用完成,返回状态=${res.data.code}`);
182
- this.log(LoggerLevel.trace, `[对象字段查询] 📄 调用完成,返回信息=${JSON.stringify(res.data)}`);
181
+ this.log(LoggerLevel.debug, `[对象字段查询] 📄 object_name=${object_name}, field_name=${field_name}, 调用完成, 返回状态=${res.data.code}`);
182
+ this.log(LoggerLevel.trace, `[对象字段查询] 📄 object_name=${object_name}, field_name=${field_name}, 返回信息=${JSON.stringify(res.data)}`);
183
183
  return res.data;
184
184
  },
185
185
 
@@ -199,8 +199,8 @@ class Client {
199
199
  headers: { Authorization: `${this.accessToken}` }
200
200
  });
201
201
 
202
- this.log(LoggerLevel.debug, `[对象字段查询] 📄 调用完成,返回状态=${res.data.code}`);
203
- this.log(LoggerLevel.trace, `[对象字段查询] 📄 调用完成,返回信息=${JSON.stringify(res.data)}`);
202
+ this.log(LoggerLevel.debug, `[对象字段查询] 📄 object_name=${object_name}, 调用完成, 返回状态=${res.data.code}`);
203
+ this.log(LoggerLevel.trace, `[对象字段查询] 📄 object_name=${object_name}, 调用完成, 返回信息=${JSON.stringify(res.data)}`);
204
204
  return res.data;
205
205
  }
206
206
  },
@@ -222,8 +222,8 @@ class Client {
222
222
 
223
223
  const response = await this.axiosInstance.post(url, { select }, { headers: { Authorization: `${this.accessToken}` } });
224
224
 
225
- this.log(LoggerLevel.debug, `[单条查询记录] 🔍 查询 record_id: ${record_id} 调用完成,返回状态: ${response.data.code}`);
226
- this.log(LoggerLevel.trace, `[单条查询记录] 🔍 查询 record_id: ${record_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
225
+ this.log(LoggerLevel.debug, `[单条查询记录] 🔍 查询 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回状态: ${response.data.code}`);
226
+ this.log(LoggerLevel.trace, `[单条查询记录] 🔍 查询 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
227
227
 
228
228
  return response.data;
229
229
  });
@@ -247,8 +247,8 @@ class Client {
247
247
  });
248
248
 
249
249
  this.log(LoggerLevel.info, `[批量查询记录] 🔍 接口调用完成`);
250
- this.log(LoggerLevel.debug, `[批量查询记录] 🔍 调用完成,返回状态: ${res.data.code},返回数据总数${res.data?.data?.total || 'unknown'}`);
251
- this.log(LoggerLevel.trace, `[批量查询记录] 🔍 调用完成,返回信息: ${JSON.stringify(res.data)}`);
250
+ this.log(LoggerLevel.debug, `[批量查询记录] 🔍 查询 object_name=${object_name}, 调用完成, 返回状态: ${res.data.code}, 返回数据总数${res.data?.data?.total || 'unknown'}`);
251
+ this.log(LoggerLevel.trace, `[批量查询记录] 🔍 查询 object_name=${object_name}, 调用完成, 返回信息: ${JSON.stringify(res.data)}`);
252
252
  return res.data;
253
253
  },
254
254
 
@@ -282,13 +282,13 @@ class Client {
282
282
 
283
283
  if (page === 1) {
284
284
  total = res.data.total || 0;
285
- this.log(LoggerLevel.info, '[批量查询记录] 🔍 接口返回 total:', total);
285
+ this.log(LoggerLevel.info, '[批量查询记录] 🔍 查询object_name=${object_name}, 接口返回 total:', total);
286
286
  }
287
287
 
288
288
  nextPageToken = res.data.next_page_token;
289
289
 
290
- this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询,nextPageToken: ${nextPageToken || ''}`);
291
- this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询完成,items.length: ${res.data.items.length}`);
290
+ this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询, nextPageToken: ${nextPageToken || ''}`);
291
+ this.log(LoggerLevel.debug, `[批量查询记录] 🔍 第 ${page} 页查询完成, items.length: ${res.data.items.length}`);
292
292
  this.log(LoggerLevel.trace, `[批量查询记录] 🔍 第 ${page} 页查询结果: ${JSON.stringify(res.data.items)}`);
293
293
  return res;
294
294
  });
@@ -321,9 +321,9 @@ class Client {
321
321
  }
322
322
  );
323
323
 
324
- this.log(LoggerLevel.info, `[单条创建记录] ➕ 向对象 ${object_name} 内创建记录,调用完成`);
325
- this.log(LoggerLevel.debug, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据,调用完成,返回状态: ${response.data.code}`);
326
- this.log(LoggerLevel.trace, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据,调用完成,返回信息: ${JSON.stringify(response.data)}`);
324
+ this.log(LoggerLevel.info, `[单条创建记录] ➕ 向对象 ${object_name} 内创建记录, 调用完成`);
325
+ this.log(LoggerLevel.debug, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据, 调用完成, 返回状态: ${response.data.code}`);
326
+ this.log(LoggerLevel.trace, `[单条创建记录] ➕ 向对象 ${object_name} 内创建数据, 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
327
327
 
328
328
  return response.data;
329
329
  });
@@ -351,8 +351,8 @@ class Client {
351
351
  );
352
352
 
353
353
  this.log(LoggerLevel.info, `[批量创建记录] ➕ 开始向对象 ${object_name} 批量创建记录`);
354
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录,调用完成,返回状态: ${res.data.code}`);
355
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录,调用完成,返回信息: ${JSON.stringify(res.data)}`);
354
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录, 调用完成, 返回状态: ${res.data.code}`);
355
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 向对象 ${object_name} 批量创建记录, 调用完成, 返回信息: ${JSON.stringify(res.data)}`);
356
356
  return res.data;
357
357
  },
358
358
 
@@ -374,14 +374,14 @@ class Client {
374
374
  chunks.push(records.slice(i, i + chunkSize));
375
375
  }
376
376
 
377
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
378
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
377
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
378
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
379
379
 
380
380
  for (const [index, chunk] of chunks.entries()) {
381
381
  page += 1;
382
382
 
383
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组,共 ${chunk.length} 条`);
384
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组,共 ${chunk.length} 条`);
383
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组, ${chunk.length} 条`);
384
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 开始创建第 ${index + 1} 组, ${chunk.length} 条`);
385
385
 
386
386
  const pageRes = await functionLimiter(async () => {
387
387
  const res = await this.object.create.records({
@@ -393,9 +393,9 @@ class Client {
393
393
  results = results.concat(res.data.items);
394
394
  }
395
395
 
396
- this.log(LoggerLevel.info, `[批量创建记录] ➕ 创建第 ${page} 页数据,调用完成,创建数量: ${res.data.items.length}`);
397
- this.log(LoggerLevel.debug, `[批量创建记录] ➕ 创建第 ${page} 页页数据,调用完成,返回状态: ${res.data.code}`);
398
- this.log(LoggerLevel.trace, `[批量创建记录] ➕ 创建第 ${page} 页页数据,调用结果: ${JSON.stringify(res.data.items)}`);
396
+ this.log(LoggerLevel.info, `[批量创建记录] ➕ 创建 object_name=${object_name}, 第 ${page} 页数据, 调用完成, 创建数量: ${res.data.items.length}`);
397
+ this.log(LoggerLevel.debug, `[批量创建记录] ➕ 创建 object_name=${object_name}, 第 ${page} 页页数据, 调用完成, 返回状态: ${res.data.code}`);
398
+ this.log(LoggerLevel.trace, `[批量创建记录] ➕ 创建 object_name=${object_name}, 第 ${page} 页页数据, 调用结果: ${JSON.stringify(res.data.items)}`);
399
399
 
400
400
  return res;
401
401
  });
@@ -422,9 +422,9 @@ class Client {
422
422
 
423
423
  const response = await this.axiosInstance.patch(url, { record }, { headers: { Authorization: `${this.accessToken}` } });
424
424
 
425
- this.log(LoggerLevel.info, `[单条更新记录] 💾 更新 record_id: ${record_id} 调用完成`);
426
- this.log(LoggerLevel.debug, `[单条更新记录] 💾 更新 record_id: ${record_id} 调用完成,返回状态: ${response.data.code}`);
427
- this.log(LoggerLevel.trace, `[单条更新记录] 💾 更新 record_id: ${record_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
425
+ this.log(LoggerLevel.info, `[单条更新记录] 💾 更新 object_name=${object_name}, record_id: ${record_id} 调用完成`);
426
+ this.log(LoggerLevel.debug, `[单条更新记录] 💾 更新 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回状态: ${response.data.code}`);
427
+ this.log(LoggerLevel.trace, `[单条更新记录] 💾 更新 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
428
428
  return response.data;
429
429
  });
430
430
 
@@ -446,21 +446,21 @@ class Client {
446
446
  chunks.push(records.slice(i, i + chunkSize));
447
447
  }
448
448
 
449
- this.log(LoggerLevel.debug, `[批量更新记录] 💾 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
450
- this.log(LoggerLevel.trace, `[批量更新记录] 💾 总共 ${records.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
449
+ this.log(LoggerLevel.debug, `[批量更新记录] 💾 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
450
+ this.log(LoggerLevel.trace, `[批量更新记录] 💾 总共 ${records.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
451
451
 
452
452
  const results: any[] = [];
453
453
  for (const [index, chunk] of chunks.entries()) {
454
- this.log(LoggerLevel.debug, `[批量更新记录] 💾 开始更新第 ${index + 1} 组,共 ${chunk.length} 条`);
455
- this.log(LoggerLevel.trace, `[批量更新记录] 💾 开始更新第 ${index + 1} 组,共 ${chunk.length} 条`);
454
+ this.log(LoggerLevel.debug, `[批量更新记录] 💾 开始更新第 ${index + 1} 组, ${chunk.length} 条`);
455
+ this.log(LoggerLevel.trace, `[批量更新记录] 💾 开始更新第 ${index + 1} 组, ${chunk.length} 条`);
456
456
 
457
457
  const res = await functionLimiter(async () => {
458
458
  await this.ensureTokenValid();
459
459
 
460
460
  const response = await this.axiosInstance.patch(url, { records: chunk }, { headers: { Authorization: `${this.accessToken}` } });
461
461
 
462
- this.log(LoggerLevel.debug, `[批量更新记录] 💾 更新第 ${index + 1} 组调用完成,返回状态: ${JSON.stringify(response.data)}`);
463
- this.log(LoggerLevel.trace, `[批量更新记录] 💾 更新第 ${index + 1} 组调用完成,返回信息: ${response.data}`);
462
+ this.log(LoggerLevel.debug, `[批量更新记录] 💾 更新 object_name=${object_name}, 第 ${index + 1} 组调用完成, 返回状态: ${JSON.stringify(response.data)}`);
463
+ this.log(LoggerLevel.trace, `[批量更新记录] 💾 更新 object_name=${object_name}, 第 ${index + 1} 组调用完成, 返回信息: ${response.data}`);
464
464
  return response.data;
465
465
  });
466
466
 
@@ -481,7 +481,7 @@ class Client {
481
481
  const { object_name, record_id } = params;
482
482
  const url = `/v1/data/namespaces/${this.namespace}/objects/${object_name}/records/${record_id}`;
483
483
 
484
- this.log(LoggerLevel.trace, `[单条删除记录] 🗑️ 开始删除 record_id: ${record_id}`);
484
+ this.log(LoggerLevel.trace, `[单条删除记录] 🗑️ object_name=${object_name}, 开始删除 record_id: ${record_id}`);
485
485
 
486
486
  const res = await functionLimiter(async () => {
487
487
  await this.ensureTokenValid();
@@ -490,7 +490,7 @@ class Client {
490
490
  headers: { Authorization: `${this.accessToken}` }
491
491
  });
492
492
 
493
- this.log(LoggerLevel.info, `[单条删除记录] 🗑️ 删除 record_id: ${record_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
493
+ this.log(LoggerLevel.info, `[单条删除记录] 🗑️ 删除 object_name=${object_name}, record_id: ${record_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
494
494
  return response.data;
495
495
  });
496
496
 
@@ -512,11 +512,11 @@ class Client {
512
512
  chunks.push(ids.slice(i, i + chunkSize));
513
513
  }
514
514
 
515
- this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 总共 ${ids.length} 条记录,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 条`);
515
+ this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 总共 ${ids.length} 条记录, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 条`);
516
516
 
517
517
  const results: any[] = [];
518
518
  for (const [index, chunk] of chunks.entries()) {
519
- this.log(LoggerLevel.info, `[批量删除记录] 🗑️ 开始删除第 ${index + 1} 组,共 ${chunk.length} 条`);
519
+ this.log(LoggerLevel.info, `[批量删除记录] 🗑️ 开始删除第 ${index + 1} 组, ${chunk.length} 条`);
520
520
 
521
521
  const res = await functionLimiter(async () => {
522
522
  await this.ensureTokenValid();
@@ -526,8 +526,8 @@ class Client {
526
526
  data: { ids: chunk }
527
527
  });
528
528
 
529
- this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成,返回状态: ${response.data.code}`);
530
- this.log(LoggerLevel.trace, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成,返回信息: ${JSON.stringify(response.data)}`);
529
+ this.log(LoggerLevel.debug, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成, 返回状态: ${response.data.code}`);
530
+ this.log(LoggerLevel.trace, `[批量删除记录] 🗑️ 第 ${index + 1} 组删除完成, 返回信息: ${JSON.stringify(response.data)}`);
531
531
  return response.data;
532
532
  });
533
533
 
@@ -552,7 +552,7 @@ class Client {
552
552
  const { department_id_type, department_id } = params;
553
553
  // department_id_type 可选值:
554
554
  // - 'department_id' (如 "1758534140403815")
555
- // - 'external_department_id' (外部平台 department_id,无固定格式)
555
+ // - 'external_department_id' (外部平台 department_id, 无固定格式)
556
556
  // - 'external_open_department_id' (以 'oc_' 开头的 open_department_id)
557
557
 
558
558
  const url = '/api/integration/v2/feishu/getDepartments';
@@ -573,8 +573,8 @@ class Client {
573
573
  }
574
574
  );
575
575
 
576
- this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成,返回状态: ${response.data.code}`);
577
- this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成,返回信息: ${JSON.stringify(response.data)}`);
576
+ this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成, 返回状态: ${response.data.code}`);
577
+ this.log(LoggerLevel.debug, `[部门ID交换] 🔄 交换部门 ID: ${department_id} 调用完成, 返回信息: ${JSON.stringify(response.data)}`);
578
578
  return response.data.data[0]; // 返回第一个元素
579
579
  });
580
580
 
@@ -590,7 +590,7 @@ class Client {
590
590
  const { department_id_type, department_ids } = params;
591
591
  // department_id_type 可选值:
592
592
  // - 'department_id' (如 "1758534140403815")
593
- // - 'external_department_id' (外部平台 department_id,无固定格式)
593
+ // - 'external_department_id' (外部平台 department_id, 无固定格式)
594
594
  // - 'external_open_department_id' (以 'oc_' 开头的 open_department_id)
595
595
 
596
596
  const url = '/api/integration/v2/feishu/getDepartments';
@@ -601,11 +601,11 @@ class Client {
601
601
  chunks.push(department_ids.slice(i, i + chunkSize));
602
602
  }
603
603
 
604
- this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 总共 ${department_ids.length} 个部门 ID,拆分为 ${chunks.length} 组,每组最多 ${chunkSize} 个`);
604
+ this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 总共 ${department_ids.length} 个部门 ID, 拆分为 ${chunks.length} 组, 每组最多 ${chunkSize} 个`);
605
605
 
606
606
  const results: any[] = [];
607
607
  for (const [index, chunk] of chunks.entries()) {
608
- this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 开始交换第 ${index + 1} 组,共 ${chunk.length} 个`);
608
+ this.log(LoggerLevel.info, `[批量部门ID交换] 🔄 开始交换第 ${index + 1} 组, ${chunk.length} 个`);
609
609
 
610
610
  const res = await functionLimiter(async () => {
611
611
  await this.ensureTokenValid();
@@ -621,8 +621,8 @@ class Client {
621
621
  }
622
622
  );
623
623
 
624
- this.log(LoggerLevel.debug, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成,返回状态: ${response.data.code}`);
625
- this.log(LoggerLevel.trace, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成,返回信息: ${JSON.stringify(response.data)}`);
624
+ this.log(LoggerLevel.debug, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成, 返回状态: ${response.data.code}`);
625
+ this.log(LoggerLevel.trace, `[批量部门ID交换] 🔄 交换第 ${index + 1} 组调用完成, 返回信息: ${JSON.stringify(response.data)}`);
626
626
  return response.data.data;
627
627
  });
628
628
 
@@ -661,8 +661,8 @@ class Client {
661
661
  }
662
662
  );
663
663
 
664
- this.log(LoggerLevel.debug, `[调用云函数] ☁️ 云函数 ${name} 调用完成,返回状态: code=${res.data.code}`);
665
- this.log(LoggerLevel.trace, `[调用云函数] ☁️ 云函数 ${name} 调用完成,返回信息: code=${JSON.stringify(res.data)}`);
664
+ this.log(LoggerLevel.debug, `[调用云函数] ☁️ 云函数 ${name} 调用完成, 返回状态: code=${res.data.code}`);
665
+ this.log(LoggerLevel.trace, `[调用云函数] ☁️ 云函数 ${name} 调用完成, 返回信息: code=${JSON.stringify(res.data)}`);
666
666
 
667
667
  return res.data;
668
668
  }