@teamdream/sems-mcp 1.1.2 → 1.3.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.
@@ -1,470 +0,0 @@
1
- /**
2
- * P3 复合编排工具:一次调用串起多个接口。
3
- *
4
- * 三个工具的风险等级差别很大,因此策略也不同:
5
- *
6
- * | 工具 | 写库动作 | 策略 |
7
- * |---|---|---|
8
- * | `sems_shortage_to_purchase` | 无(只产出采购草稿) | 缺口与单价全部摊开给人看 |
9
- * | `sems_document_to_sale` | 仅上传附件 | 单据仍走草稿,等用户确认 |
10
- * | `sems_contract_from_template` | 上传 + 建合同 + 关联 | 三步逐条报告成功与否 |
11
- *
12
- * 🔴 多步写最怕「中途失败留半成品」。第三个工具因此把每一步的成败都放进 `steps`,
13
- * 失败就立刻停下并说明已经完成了哪些——用户能据此判断要不要去 SEMS 里清理。
14
- */
15
- import { randomBytes } from "node:crypto";
16
- import { writeFileSync, unlinkSync } from "node:fs";
17
- import { tmpdir } from "node:os";
18
- import { join } from "node:path";
19
- import { z } from "zod";
20
- import { ProxyError, localError } from "../client/errors.js";
21
- import { unwrapSems } from "./payload.js";
22
- import { wrap } from "./runner.js";
23
- import { CONTRACT_TYPE, asArray, asRecord, buildContractBody, contractAttachment, contractTypeValue, ensureSaved, findNewestContract, idText, preparePurchaseDraft, prepareSaleDraft, uploadLocalFile, } from "./writes.js";
24
- function text(value) {
25
- return typeof value === "string" ? value.trim() : "";
26
- }
27
- function numeric(value) {
28
- if (typeof value === "number" && Number.isFinite(value))
29
- return value;
30
- if (typeof value === "string" && value.trim() !== "") {
31
- const parsed = Number(value);
32
- if (Number.isFinite(parsed))
33
- return parsed;
34
- }
35
- return undefined;
36
- }
37
- /** 分页查询取一页记录出来。 */
38
- async function pageRecords(ctx, path, query) {
39
- const response = await ctx.client.call({ method: "GET", path, query });
40
- const data = asRecord(unwrapSems(response.data));
41
- return asArray(data["records"]).map(asRecord);
42
- }
43
- /**
44
- * 按名称找产品。
45
- *
46
- * SEMS 的产品搜索只有 `name` 模糊匹配,所以同名不同规格会一起返回。
47
- * 精确同名的有多个时**不替用户挑**——挑错了采购的就是另一个型号,
48
- * 这种错误在入库前完全看不出来。
49
- */
50
- async function findProduct(ctx, name) {
51
- const records = await pageRecords(ctx, "/invoicing/product/page", { name, size: 20 });
52
- const exact = records.filter((r) => text(r["name"]) === name);
53
- if (exact.length === 0) {
54
- throw localError("PARAM_INVALID", `海竣信息系统里找不到名为「${name}」的产品。请让用户提供准确的产品名称,`
55
- + "或先用 sems_query_products 搜一下。");
56
- }
57
- if (exact.length > 1) {
58
- const specs = exact.map((r) => text(r["spec"]) || "(无规格)").join("、");
59
- throw localError("PARAM_INVALID", `「${name}」有 ${exact.length} 个规格:${specs}。请让用户指明是哪一个规格,`
60
- + "不要替用户猜——猜错会采购到错误的型号。");
61
- }
62
- const hit = exact[0];
63
- return {
64
- productId: numeric(hit["id"]) ?? numeric(hit["productId"]),
65
- name,
66
- spec: text(hit["spec"]),
67
- unit: text(hit["unit"]),
68
- };
69
- }
70
- /** 某产品在全部仓库里的可用量合计。 */
71
- async function availableAmount(ctx, productId) {
72
- if (productId === undefined)
73
- return 0;
74
- const records = await pageRecords(ctx, "/invoicing/storage-manage-record/page", {
75
- productId,
76
- size: 100,
77
- });
78
- let total = 0;
79
- for (const record of records) {
80
- const remain = numeric(record["amountRemain"]);
81
- if (remain !== undefined && remain > 0)
82
- total += remain;
83
- }
84
- return total;
85
- }
86
- /** 取该产品最近一次最低报价,作为推荐采购价与供应商。 */
87
- async function bestQuote(ctx, productName) {
88
- const records = await pageRecords(ctx, "/invoicing/market-quote/page", {
89
- productName,
90
- size: 20,
91
- descs: "quoteDate",
92
- });
93
- const priced = records
94
- .map((r) => ({
95
- supplierId: numeric(r["supplierId"]),
96
- supplierName: text(r["supplierName"]),
97
- unitPrice: numeric(r["unitPrice"]),
98
- quoteDate: text(r["quoteDate"]),
99
- }))
100
- .filter((r) => r.unitPrice !== undefined && r.supplierName.length > 0);
101
- if (priced.length === 0)
102
- return null;
103
- return priced.reduce((best, item) => (item.unitPrice < best.unitPrice ? item : best));
104
- }
105
- export function registerOrchestration(server, ctx) {
106
- registerShortageToPurchase(server, ctx);
107
- registerDocumentToSale(server, ctx);
108
- registerContractFromTemplate(server, ctx);
109
- }
110
- // ── 缺口 → 采购草稿 ─────────────────────────────────────────
111
- function registerShortageToPurchase(server, ctx) {
112
- server.registerTool("sems_shortage_to_purchase", {
113
- title: "缺货分析 → 采购草稿",
114
- description: "按需求数量逐项比对库存,算出缺口,再从市场报价里取最低价作为推荐采购价与供应商,"
115
- + "最后产出一份采购单草稿(**不写入海竣信息系统**)。"
116
- + "单价全部来自 `si_market_quotes` 的最近报价,不由 AI 估算;用户可以在确认前改价。",
117
- inputSchema: {
118
- items: z
119
- .array(z.object({
120
- productName: z.string().min(1).describe("产品名称,必须与海竣信息系统里完全一致"),
121
- quantity: z.coerce.number().positive().describe("需求数量"),
122
- }))
123
- .min(1)
124
- .describe("需求清单"),
125
- orderName: z.string().min(1).describe("采购订单名称"),
126
- supplierName: z.string().optional().describe("指定供应商;不传则按报价最低的供应商"),
127
- supplierAddress: z.string().optional().describe("供应商地址;不传则从供应商档案取"),
128
- },
129
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
130
- }, wrap(ctx, "sems_shortage_to_purchase", async (args) => {
131
- const demands = asArray(args["items"]).map((raw) => {
132
- const item = asRecord(raw);
133
- const name = text(item["productName"]);
134
- if (!name)
135
- throw localError("PARAM_INVALID", "items[].productName 不能为空");
136
- const quantity = numeric(item["quantity"]);
137
- if (quantity === undefined || quantity <= 0) {
138
- throw localError("PARAM_INVALID", `「${name}」的需求数量必须大于 0`);
139
- }
140
- return { name, quantity };
141
- });
142
- if (demands.length === 0)
143
- throw localError("PARAM_INVALID", "至少需要一项需求");
144
- const analysis = [];
145
- const purchaseItems = [];
146
- const unresolved = [];
147
- const suppliers = new Set();
148
- for (const demand of demands) {
149
- const product = await findProduct(ctx, demand.name);
150
- const available = await availableAmount(ctx, product.productId);
151
- const shortage = Math.round((demand.quantity - available) * 100) / 100;
152
- const row = {
153
- productName: demand.name,
154
- spec: product.spec,
155
- unit: product.unit,
156
- required: demand.quantity,
157
- available,
158
- shortage: shortage > 0 ? shortage : 0,
159
- };
160
- if (shortage <= 0) {
161
- row["action"] = "库存充足,无需采购";
162
- analysis.push(row);
163
- continue;
164
- }
165
- const quote = await bestQuote(ctx, demand.name);
166
- if (!quote) {
167
- row["action"] = "有缺口,但市场报价里没有该产品的价格";
168
- unresolved.push(demand.name);
169
- analysis.push(row);
170
- continue;
171
- }
172
- if (!product.spec || !product.unit) {
173
- row["action"] = "有缺口,但产品档案缺规格或单位(采购单必填)";
174
- unresolved.push(demand.name);
175
- analysis.push(row);
176
- continue;
177
- }
178
- row["action"] = "需要采购";
179
- row["recommendedPrice"] = quote.unitPrice;
180
- row["recommendedSupplier"] = quote.supplierName;
181
- row["quoteDate"] = quote.quoteDate;
182
- suppliers.add(quote.supplierName);
183
- analysis.push(row);
184
- purchaseItems.push({
185
- productId: product.productId,
186
- name: product.name,
187
- spec: product.spec,
188
- unit: product.unit,
189
- quantity: shortage,
190
- unitPrice: quote.unitPrice,
191
- remark: `按 ${quote.quoteDate} 报价`,
192
- supplierName: quote.supplierName,
193
- });
194
- }
195
- if (purchaseItems.length === 0) {
196
- return {
197
- analysis,
198
- needsPurchase: false,
199
- message: unresolved.length > 0
200
- ? `没有可自动起草的采购项:${unresolved.join("、")} 缺少报价或产品档案信息。`
201
- : "所有需求的库存都够,不需要采购。",
202
- unresolved,
203
- };
204
- }
205
- const specified = text(args["supplierName"]);
206
- const supplierName = specified || (suppliers.size === 1 ? [...suppliers][0] : "");
207
- if (!supplierName) {
208
- return {
209
- analysis,
210
- needsPurchase: true,
211
- blocked: `这批缺口来自 ${suppliers.size} 个不同供应商(${[...suppliers].join("、")})。`,
212
- next: "一张采购单只能有一个供应商。请让用户指定 supplierName,按供应商拆成多次调用;"
213
- + "或调用 sems_prepare_purchase 手工起草。",
214
- suggestedItems: purchaseItems,
215
- };
216
- }
217
- // 地址是 SEMS 的硬性必填,行情里没有,只能回供应商档案取
218
- let supplierAddress = text(args["supplierAddress"]);
219
- if (!supplierAddress) {
220
- const found = await pageRecords(ctx, "/scm/supplier/page", {
221
- customerName: supplierName,
222
- size: 5,
223
- });
224
- // 供应商分页返回的地址字段是 address(不是 customerAddress),且名称普遍带尾随空格
225
- const exact = found.filter((r) => text(r["customerName"]).trim() === supplierName.trim());
226
- supplierAddress = text(exact[0]?.["address"]);
227
- }
228
- if (!supplierAddress) {
229
- return {
230
- analysis,
231
- needsPurchase: true,
232
- blocked: `没能取到供应商「${supplierName}」的地址,而采购单要求地址必填。`,
233
- next: "请让用户提供 supplierAddress 后重试(名称与报价已确定,地址只差这一步)。",
234
- suggestedItems: purchaseItems,
235
- };
236
- }
237
- const draft = await preparePurchaseDraft(ctx, {
238
- supplierName,
239
- supplierAddress,
240
- name: text(args["orderName"]),
241
- items: purchaseItems,
242
- });
243
- return {
244
- analysis,
245
- needsPurchase: true,
246
- draft: draft.draftId,
247
- digest: draft.digest,
248
- summary: draft.summary,
249
- warnings: [
250
- ...draft.warnings,
251
- "单价来自市场报价的最近一条最低价,不是系统认定的采购价。"
252
- + "如果用户对价格有说法,请重新起草并指定单价。",
253
- ],
254
- payload: draft.payload,
255
- next: draft.next,
256
- };
257
- }));
258
- }
259
- // ── 文档 → 销售草稿 + 附件 ──────────────────────────────────
260
- function registerDocumentToSale(server, ctx) {
261
- server.registerTool("sems_document_to_sale", {
262
- title: "文档信息 + 附件 → 销售单草稿",
263
- description: "把用户给的一份结构化订单信息(客户 + 明细,需带单价)整理成销售单草稿,"
264
- + "同时把本机附件上传到海竣信息系统并把 URL 记进备注。**销售单本身仍不写入**,"
265
- + "要等用户确认后调用 sems_commit_sale。",
266
- inputSchema: {
267
- customerName: z.string().min(1).describe("客户名称"),
268
- customerId: z.coerce.number().int().positive().optional(),
269
- // 这 4 项在 si_sale 里是 NOT NULL,客户档案缺了就得由调用方补齐;
270
- // 不透传的话 prepareSaleDraft 的「带同名参数重新起草」就成了指不到的补救路径
271
- customerProvince: z.string().optional().describe("客户省份(客户档案里没有时必须给)"),
272
- customerCity: z.string().optional().describe("客户城市(客户档案里没有时必须给)"),
273
- contactName: z.string().optional().describe("客户联系人姓名(客户档案里没有时必须给)"),
274
- contactTel: z.string().optional().describe("联系人电话(客户档案里没有时必须给)"),
275
- items: z
276
- .array(z.object({
277
- name: z.string().min(1).describe("产品名称"),
278
- spec: z.string().optional().describe("规格型号(海竣信息系统必填,可从库存/产品档案带出)"),
279
- specDetail: z.string().optional().describe("详细配置(海竣信息系统必填,可从库存记录带出)"),
280
- unit: z.string().optional().describe("单位(海竣信息系统必填,可从库存/产品档案带出)"),
281
- quantity: z.coerce.number().positive(),
282
- unitPrice: z.coerce.number().min(0).describe("单价(元)"),
283
- buyPrice: z.coerce
284
- .number()
285
- .min(0)
286
- .optional()
287
- .describe("成本单价(元);文档里有采购价就带上,否则成本记 0、利润虚高"),
288
- productId: z.coerce.number().int().positive().optional(),
289
- storageManageRecordId: z.coerce.number().int().positive().optional(),
290
- }))
291
- .min(1),
292
- attachmentPaths: z.array(z.string()).optional().describe("要一并上传的本机附件路径"),
293
- remark: z.string().optional(),
294
- },
295
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
296
- }, wrap(ctx, "sems_document_to_sale", async (args) => {
297
- const warnings = [];
298
- const attachments = [];
299
- for (const path of asArray(args["attachmentPaths"])) {
300
- const filePath = text(path);
301
- if (!filePath)
302
- continue;
303
- try {
304
- attachments.push(await uploadLocalFile(ctx, filePath));
305
- }
306
- catch (err) {
307
- // 附件失败不该拖垮整单:销售单草稿本身还有价值
308
- warnings.push(`附件 ${filePath} 上传失败:${err instanceof ProxyError ? err.message : String(err)}。`
309
- + "可以稍后单独用 sems_upload_file 补传。");
310
- }
311
- }
312
- const urls = attachments
313
- .map((a) => text(a["url"]))
314
- .filter(Boolean)
315
- .map((url, index) => `附件${index + 1}:${url}`);
316
- const remark = [text(args["remark"]), ...urls].filter(Boolean).join("\n");
317
- const draft = await prepareSaleDraft(ctx, {
318
- customerName: args["customerName"],
319
- customerId: args["customerId"],
320
- // 客户档案缺项时由这 4 个入参补,否则草稿会以「缺客户信息」失败
321
- customerProvince: args["customerProvince"],
322
- customerCity: args["customerCity"],
323
- contactName: args["contactName"],
324
- contactTel: args["contactTel"],
325
- items: args["items"],
326
- remark,
327
- });
328
- return {
329
- attachments,
330
- draft: draft.draftId,
331
- digest: draft.digest,
332
- summary: draft.summary,
333
- warnings: [...draft.warnings, ...warnings],
334
- payload: draft.payload,
335
- next: draft.next,
336
- };
337
- }));
338
- }
339
- // ── 合同模板 → 渲染 → 上传 → 建合同 → 关联 ──────────────────
340
- const PLACEHOLDER = /\{\{\s*([A-Za-z0-9_]+)\s*\}\}/g;
341
- function renderTemplate(template, values) {
342
- const missing = new Set();
343
- const rendered = template.replace(PLACEHOLDER, (whole, key) => {
344
- const value = values[key];
345
- if (value === undefined || value.trim() === "") {
346
- missing.add(key);
347
- return whole;
348
- }
349
- return value;
350
- });
351
- return { text: rendered, missing: [...missing] };
352
- }
353
- function registerContractFromTemplate(server, ctx) {
354
- server.registerTool("sems_contract_from_template", {
355
- title: "合同模板 → 建合同并关联单据(写库)",
356
- description: "把合同正文模板(用 {{占位符}} 标记)按给定值做**确定性替换**,渲染结果上传为附件,"
357
- + "然后新建合同记录;给了单据就一并关联。占位符缺值会直接报错,不会留下空白条款。"
358
- + "这是多步写操作,返回里的 steps 会逐条说明哪一步成功、哪一步失败。"
359
- + "调用前必须先让用户确认合同类型与客户全称;金额等条款内容写在 values 里,"
360
- + "由模板占位符决定,没有单独的金额参数。",
361
- inputSchema: {
362
- template: z.string().min(1).describe("合同正文模板,占位符写成 {{key}}"),
363
- values: z.record(z.string(), z.string()).describe("占位符取值,键不带花括号"),
364
- customerName: z.string().min(1).describe("客户全称(海竣信息系统强制必填,用于生成合同编号)"),
365
- contractType: CONTRACT_TYPE,
366
- projectName: z.string().optional().describe("合同名称(列表里的「合同名称」列)"),
367
- parentId: z.coerce.number().int().min(0).optional().describe("所属目录 ID,默认 0(根目录)"),
368
- relateToOrder: z
369
- .object({
370
- orderType: z.enum(["sale", "purchase"]),
371
- orderId: z.coerce.number().int().positive(),
372
- })
373
- .optional()
374
- .describe("建完合同后要关联的单据"),
375
- },
376
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
377
- }, wrap(ctx, "sems_contract_from_template", async (args) => {
378
- const template = String(args["template"] ?? "");
379
- const rawValues = asRecord(args["values"]);
380
- const values = {};
381
- for (const [key, value] of Object.entries(rawValues)) {
382
- if (typeof value === "string")
383
- values[key] = value;
384
- else if (typeof value === "number" || typeof value === "boolean") {
385
- values[key] = String(value);
386
- }
387
- }
388
- const rendered = renderTemplate(template, values);
389
- if (rendered.missing.length > 0) {
390
- throw localError("PARAM_INVALID", `模板里有 ${rendered.missing.length} 个占位符没有取值:${rendered.missing.join("、")}。`
391
- + "合同正文缺字段会留下空白条款,所以不会继续执行。请补齐 values 后重试。");
392
- }
393
- const steps = [];
394
- const stamp = randomBytes(4).toString("hex");
395
- // 客户名带首尾空格会让「按名回查编号」失配,先归一
396
- const customerName = text(args["customerName"]).trim();
397
- const projectName = text(args["projectName"]);
398
- const submittedAt = new Date();
399
- const filePath = join(tmpdir(), `sems-contract-${stamp}.txt`);
400
- writeFileSync(filePath, rendered.text, "utf8");
401
- steps.push({ step: "渲染合同全文", ok: true, detail: `临时文件 ${filePath}` });
402
- let uploaded;
403
- try {
404
- uploaded = await uploadLocalFile(ctx, filePath, `${projectName || "合同"}-${stamp}.txt`);
405
- }
406
- finally {
407
- // 正文已经在请求体里发出去了,本机这份临时文件必须删掉:
408
- // 合同正文含客户名与金额,留在 Temp 里既占地方又多一处泄露面。
409
- try {
410
- unlinkSync(filePath);
411
- }
412
- catch {
413
- // 删不掉不影响业务;文件在系统临时目录,会被系统自行回收
414
- }
415
- }
416
- steps.push({ step: "上传合同附件", ok: true, detail: uploaded["url"] });
417
- // 与 sems_create_contract 共用同一套字段映射:合同实体只有 project_name /
418
- // attachments 这些列,写 contractName / amount / signTime 会被 Jackson 静默丢掉
419
- const contractBody = buildContractBody({
420
- customerName,
421
- contractType: contractTypeValue(args["contractType"]),
422
- projectName,
423
- parentId: numeric(args["parentId"]),
424
- attachments: [contractAttachment(uploaded)],
425
- remark: `正文附件:${text(uploaded["url"])}`,
426
- });
427
- const created = await ctx.client.call({
428
- method: "POST",
429
- path: "/invoicing/contract",
430
- body: contractBody,
431
- });
432
- ensureSaved(unwrapSems(created.data), "新建合同");
433
- // 后端 save 只返回布尔值,编号与 ID 都只能回查
434
- const record = await findNewestContract(ctx, customerName, submittedAt);
435
- // 19 位雪花不能转 number(会静默变成另一个 ID),关联时按字符串拼路径
436
- const contractId = idText(record["id"]);
437
- steps.push({ step: "新建合同记录", ok: true, detail: record });
438
- const relate = asRecord(args["relateToOrder"]);
439
- const orderType = text(relate["orderType"]);
440
- const orderId = numeric(relate["orderId"]);
441
- if (orderType && orderId !== undefined && contractId !== "") {
442
- const related = await ctx.client.call({
443
- method: "POST",
444
- path: `/invoicing/contract/relate/${contractId}`,
445
- body: { orderType, orderId },
446
- });
447
- ensureSaved(unwrapSems(related.data), "合同关联");
448
- steps.push({
449
- step: "关联单据",
450
- ok: true,
451
- detail: `${orderType === "sale" ? "销售单" : "采购单"} ${orderId} → 合同 ${contractId}`,
452
- });
453
- }
454
- return {
455
- created: true,
456
- contractId,
457
- record,
458
- steps,
459
- renderedLength: rendered.text.length,
460
- preview: rendered.text.slice(0, 400),
461
- note: "合同正文已作为附件上传,正文长度与开头预览一并返回,便于向用户复述。"
462
- + (text(record["contractNo"]) !== ""
463
- ? "合同编号由海竣信息系统自动生成,请把编号回报给用户。"
464
- : "编号没能回查到,请让用户到海竣信息系统合同列表里查看,不要替用户编一个。")
465
- + (orderType && orderId !== undefined && contractId === ""
466
- ? "未拿到新合同的 ID,关联单据那一步没有执行。"
467
- : ""),
468
- };
469
- }));
470
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * 解读 SEMS 的响应。
3
- *
4
- * SEMS 统一响应是 `{code, msg, data}`(`CommonConstants.SUCCESS = 0`)。
5
- *
6
- * 🔴 业务失败**可能仍是 HTTP 200**:proxy 只在 HTTP 非 2xx 时报错,业务码 `code=1`
7
- * 会原样透传过来。这里必须检查,否则「保存失败」会被当成成功。
8
- *
9
- * 分页响应统一整理成 `{total, current, size, returned, records}`:保留 SEMS 的字段名
10
- * 便于用户与页面核对,同时补 `returned` 让模型不会把「本页 20 条」说成「总共 20 条」。
11
- */
12
- import { ProxyError } from "../client/errors.js";
13
- function isRecord(value) {
14
- return typeof value === "object" && value !== null && !Array.isArray(value);
15
- }
16
- /** 取出 `data`,业务失败则抛错。没有 `code` 字段的响应原样返回。 */
17
- export function unwrapSems(payload) {
18
- if (!isRecord(payload))
19
- return payload;
20
- const code = payload["code"];
21
- if (typeof code !== "number")
22
- return payload;
23
- if (code !== 0) {
24
- // 两套错误体都带数字 `code`,靠 `error` 字段区分来源:
25
- // proxy → `{code:<http>, error:"PERMISSION_DENIED", message:"…"}`
26
- // SEMS → `{code:1, msg:"报表年份不能为空"}`
27
- // 认错了会丢掉真正的文案,只剩一个数字,对用户毫无用处。
28
- const isProxyShape = typeof payload["error"] === "string";
29
- const text = isProxyShape ? payload["message"] : payload["msg"];
30
- const message = typeof text === "string" ? text.trim() : "";
31
- const label = isProxyShape ? String(payload["error"]) : `code=${code}`;
32
- throw new ProxyError("UPSTREAM_ERROR", 200, message || `上游返回错误(${label})`, false);
33
- }
34
- return payload["data"];
35
- }
36
- /** 分页响应的可读化;不是分页结构就原样返回。 */
37
- export function normalizePage(payload) {
38
- const data = unwrapSems(payload);
39
- if (!isRecord(data))
40
- return data;
41
- const records = data["records"];
42
- if (!Array.isArray(records))
43
- return data;
44
- const total = data["total"];
45
- return {
46
- total: typeof total === "number" ? total : undefined,
47
- current: data["current"],
48
- size: data["size"],
49
- returned: records.length,
50
- records,
51
- };
52
- }