weaver-work-cli 0.1.60 → 0.1.62

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.
Files changed (139) hide show
  1. package/dist/chunks/{archive-4SQAVTIB.js → archive-S2VKZWQ3.js} +2 -2
  2. package/dist/chunks/{archive-oa-W2UEJ67L.js → archive-oa-HEDSIUUY.js} +2 -2
  3. package/dist/chunks/{asset-EGZEABBI.js → asset-HYH4W357.js} +2 -2
  4. package/dist/chunks/{asset-idle-EBUZBB6M.js → asset-idle-N7REBNGL.js} +2 -2
  5. package/dist/chunks/{attachment-content-I6WHKGR2.js → attachment-content-VYYA75FR.js} +3 -3
  6. package/dist/chunks/{blog-2YKMWOWI.js → blog-SLMZZICV.js} +2 -2
  7. package/dist/chunks/{caizhilian-5NM4X5HG.js → caizhilian-RV43KKBT.js} +4 -4
  8. package/dist/chunks/{calendar-H4QTJCUY.js → calendar-DMVZ4OLY.js} +2 -2
  9. package/dist/chunks/{chunk-VLL6JOB4.js → chunk-6XSSAUNW.js} +4 -4
  10. package/dist/chunks/{chunk-VQWPQTEY.js → chunk-BIA2NKUG.js} +4 -4
  11. package/dist/chunks/{chunk-VMCCRWFO.js → chunk-BQYX2UX5.js} +2 -2
  12. package/dist/chunks/{chunk-XF7S6FQW.js → chunk-DTCQFTHW.js} +1 -1
  13. package/dist/chunks/{chunk-CPG6NLN4.js → chunk-E5YD5JWR.js} +1 -1
  14. package/dist/chunks/{chunk-PH7N4UFT.js → chunk-EGANE35F.js} +1 -1
  15. package/dist/chunks/{chunk-Z4IPY5GV.js → chunk-H6YOMI3U.js} +2 -2
  16. package/dist/chunks/{chunk-HHH4K3YY.js → chunk-ILALC2N6.js} +1 -1
  17. package/dist/chunks/{chunk-WINR2Q6K.js → chunk-KXJA42EA.js} +86 -19
  18. package/dist/chunks/{chunk-CQ4OVCKG.js → chunk-KY3R42RS.js} +2 -2
  19. package/dist/chunks/{chunk-WVH5ESDA.js → chunk-NRYDJN4J.js} +1 -1
  20. package/dist/chunks/{chunk-TGM7BWEH.js → chunk-P6TXQK75.js} +2 -2
  21. package/dist/chunks/{chunk-6YWHRXEQ.js → chunk-QBDXJS2W.js} +119 -9
  22. package/dist/chunks/{chunk-2IGZUMNG.js → chunk-SHX7XBYR.js} +180 -18
  23. package/dist/chunks/{chunk-P7RXQDCA.js → chunk-T2KVJFWJ.js} +4 -4
  24. package/dist/chunks/{chunk-FMNCSYIG.js → chunk-TEZHIB6T.js} +2 -2
  25. package/dist/chunks/{chunk-HMIIVM2L.js → chunk-UBGWIXU3.js} +97 -45
  26. package/dist/chunks/{chunk-5N222HK6.js → chunk-UBRWONP4.js} +2 -2
  27. package/dist/chunks/{chunk-7U5YHCW7.js → chunk-UQFPF4EX.js} +2 -2
  28. package/dist/chunks/{chunk-4GG72JAT.js → chunk-V2LASYKO.js} +2 -2
  29. package/dist/chunks/{chunk-BDBTZVYA.js → chunk-VBFBMM7G.js} +55 -55
  30. package/dist/chunks/{chunk-YHSOCGKO.js → chunk-VNYOUAWV.js} +11 -11
  31. package/dist/chunks/{chunk-SFM3M2L3.js → chunk-WIWDVETN.js} +19 -3
  32. package/dist/chunks/{chunk-44KJ7WFA.js → chunk-XT77MP54.js} +2 -2
  33. package/dist/chunks/{chunk-JFKMPRZB.js → chunk-YI2YMW5N.js} +50 -3
  34. package/dist/chunks/{conflict-QMDLS2EW.js → conflict-GFJRS6I7.js} +2 -2
  35. package/dist/chunks/{contract-LLRKMLQQ.js → contract-U3ZGNRWB.js} +2 -2
  36. package/dist/chunks/{cowork-2RDFBZWB.js → cowork-EX7PKIDK.js} +2 -2
  37. package/dist/chunks/{create-flow-5ODJ7WJO.js → create-flow-EJZD434E.js} +6 -6
  38. package/dist/chunks/{data-LVDFIRNG.js → data-FOODGAMF.js} +278 -121
  39. package/dist/chunks/{ebuilder-form-7WA6X6ZI.js → ebuilder-form-I2EOKODG.js} +3 -3
  40. package/dist/chunks/{ehr-52GBKNJR.js → ehr-TE4RFNID.js} +2 -2
  41. package/dist/chunks/{entry-mode-73BJML22.js → entry-mode-ZOLSXEGX.js} +9 -5
  42. package/dist/chunks/{env-OHFS76HV.js → env-TID5NFR6.js} +2 -2
  43. package/dist/chunks/{esb-HJSXCEOM.js → esb-7L6MHYLB.js} +4 -4
  44. package/dist/chunks/{factory-FRTA2LP4.js → factory-OG7BPMH5.js} +1 -1
  45. package/dist/chunks/{fna-OBACRT3J.js → fna-6V2ENR3Y.js} +2 -2
  46. package/dist/chunks/{group-chat-KBFRPCR2.js → group-chat-5DKPWIHL.js} +3 -3
  47. package/dist/chunks/{host-TTSGY5NZ.js → host-3DLYA54R.js} +3 -3
  48. package/dist/chunks/{host-KJT3G5D2.js → host-GOJHHTPY.js} +3 -3
  49. package/dist/chunks/{host-KOWUMNAY.js → host-OGBHL75G.js} +3 -3
  50. package/dist/chunks/{host-MFXRA2MY.js → host-ONZC6AE7.js} +3 -3
  51. package/dist/chunks/{host-W4JCNRFS.js → host-TJ5VVHM7.js} +3 -3
  52. package/dist/chunks/{host-2BKMPWDH.js → host-VTPAWDZV.js} +3 -3
  53. package/dist/chunks/{hrm-AK3WGBMN.js → hrm-2N7NFQDZ.js} +3 -3
  54. package/dist/chunks/{im-JZSBPO4Z.js → im-XCH47ZBN.js} +3 -3
  55. package/dist/chunks/{invoice-6XDMPCWB.js → invoice-5KJ7T774.js} +198 -331
  56. package/dist/chunks/{jiuchuanhui-K4EQU6GK.js → jiuchuanhui-PL6DRPBM.js} +2 -2
  57. package/dist/chunks/{lazy-dispatch-GCA6HDOB.js → lazy-dispatch-UATEN7H7.js} +5 -5
  58. package/dist/chunks/{mail-IKVCQCVZ.js → mail-Q7Z4CQ4D.js} +2 -2
  59. package/dist/chunks/{meeting-ARHVWK7G.js → meeting-5E3BNARL.js} +13 -13
  60. package/dist/chunks/{minute-doc-547KSYKR.js → minute-doc-NXRE5C77.js} +4 -4
  61. package/dist/chunks/{okr-KV43FPPX.js → okr-3O3XNYOK.js} +2 -2
  62. package/dist/chunks/{operations-6NXJ7RTE.js → operations-EZWG72FH.js} +4 -4
  63. package/dist/chunks/performance-Y7CPNSOR.js +1295 -0
  64. package/dist/chunks/{plan-WOYR4WEG.js → plan-BLGPZF5M.js} +2 -2
  65. package/dist/chunks/{project-CQJKBUIL.js → project-6MZMLJMP.js} +2 -2
  66. package/dist/chunks/{reception-MPBU3JXC.js → reception-F2VT2X52.js} +2 -2
  67. package/dist/chunks/{recruit-stage-USTTRHOX.js → recruit-stage-4ETIBMIW.js} +2 -2
  68. package/dist/chunks/{registry-GURQG4ZV.js → registry-3FYSWV3U.js} +3 -3
  69. package/dist/chunks/{registry-SS5J2FZQ.js → registry-7RS74TCK.js} +4 -4
  70. package/dist/chunks/{registry-H5HQ5QNH.js → registry-I4DVPDMU.js} +11 -11
  71. package/dist/chunks/{room-recommend-3UBROMZE.js → room-recommend-GWCVKCXW.js} +4 -4
  72. package/dist/chunks/{schedule-FTUQML6O.js → schedule-6AN63MJQ.js} +4 -4
  73. package/dist/chunks/{smart-extract-APX2PNIN.js → smart-extract-SR4SJJKN.js} +3 -3
  74. package/dist/chunks/{workflow-WMPW3WSB.js → workflow-KF7FA2UQ.js} +7 -7
  75. package/dist/cmd/refs/index.js +124 -4
  76. package/dist/core/output.js +199 -26
  77. package/dist/core/refs.js +36 -0
  78. package/dist/index.js +38 -33
  79. package/dist/internal/e10/auth/xiaoe.js +25 -3
  80. package/dist/shortcuts/caizhilian/operations/files.js +86 -15
  81. package/dist/shortcuts/data/index.js +12 -2
  82. package/dist/shortcuts/data/manifest.js +4 -2
  83. package/dist/shortcuts/data/operations/attribution.js +229 -0
  84. package/dist/shortcuts/data/operations/ds.js +87 -90
  85. package/dist/shortcuts/data/operations/index.js +3 -1
  86. package/dist/shortcuts/index.js +5 -0
  87. package/dist/shortcuts/invoice/manifest.js +30 -62
  88. package/dist/shortcuts/invoice/operations/registry.js +2 -2
  89. package/dist/shortcuts/invoice/operations/reim-customer.js +111 -0
  90. package/dist/shortcuts/invoice/operations/shared.js +0 -204
  91. package/dist/shortcuts/meeting/operations/eb/create-flow.js +84 -16
  92. package/dist/shortcuts/meeting/operations/eb/entry-mode.js +61 -7
  93. package/dist/shortcuts/performance/continuation.js +74 -0
  94. package/dist/shortcuts/performance/errors.js +65 -0
  95. package/dist/shortcuts/performance/host.js +105 -0
  96. package/dist/shortcuts/performance/index.js +109 -0
  97. package/dist/shortcuts/performance/manifest.js +30 -0
  98. package/dist/shortcuts/performance/operations/hrm-resolve.js +114 -0
  99. package/dist/shortcuts/performance/operations/registry.js +44 -0
  100. package/dist/shortcuts/performance/operations/scheme-detail.js +70 -0
  101. package/dist/shortcuts/performance/operations/scheme-draft.js +116 -0
  102. package/dist/shortcuts/performance/operations/scheme-publish.js +158 -0
  103. package/dist/shortcuts/performance/operations/types.js +32 -0
  104. package/dist/shortcuts/performance/scheme-validate.js +307 -0
  105. package/dist/shortcuts/performance/shared.js +158 -0
  106. package/docs/agent-invoice.md +1 -1
  107. package/docs/agent-io-channel-design.md +67 -3
  108. package/docs/data.md +2 -1
  109. package/docs/invoice.md +0 -2
  110. package/package.json +1 -1
  111. package/scripts/xiaoe_env.py +6 -1
  112. package/skill-template/business-info.json +19 -0
  113. package/skill-template/domains/performance.md +18 -0
  114. package/skill-template/domains/yepiaotong.md +0 -1
  115. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  116. package/skills/weaver-e10-data/references/datasource.md +2 -1
  117. package/skills/weaver-e10-meeting/SKILL.md +5 -3
  118. package/skills/weaver-e10-performance/SKILL.md +202 -0
  119. package/skills/weaver-e10-performance/agents/openai.yaml +74 -0
  120. package/skills/weaver-e10-performance/references/default-assembly.md +108 -0
  121. package/skills/weaver-e10-performance/references/entity-resolution.md +69 -0
  122. package/skills/weaver-e10-performance/references/enums-and-normalization.md +80 -0
  123. package/skills/weaver-e10-performance/references/examples.md +146 -0
  124. package/skills/weaver-e10-performance/references/extraction-guide.md +144 -0
  125. package/skills/weaver-e10-performance/references/scheme-edit-req-fields.md +185 -0
  126. package/skills/weaver-e10-performance/references/scheme-setting-page.md +62 -0
  127. package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +483 -0
  128. package/skills/weaver-e10-shared/references/json-output-contract.md +5 -0
  129. package/skills/weaver-e10-yepiaotong/SKILL.md +16 -9
  130. package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +9 -7
  131. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +15 -11
  132. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +29 -25
  133. package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +89 -0
  134. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +35 -37
  135. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +66 -63
  136. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +50 -71
  137. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +34 -95
  138. package/dist/shortcuts/invoice/operations/browse-field.js +0 -17
  139. package/skills/weaver-e10-yepiaotong/references/invoice-browse-field-data.md +0 -204
@@ -8,7 +8,7 @@ import {
8
8
  invoicePartialError,
9
9
  invoiceValidationError,
10
10
  isInvoiceNetworkError
11
- } from "./chunk-FMNCSYIG.js";
11
+ } from "./chunk-TEZHIB6T.js";
12
12
  import {
13
13
  reportPlatformError
14
14
  } from "./chunk-6N4JPNFL.js";
@@ -16,8 +16,8 @@ import {
16
16
  CONTINUATION_TTL_MS,
17
17
  CONTINUATION_TTL_SECONDS
18
18
  } from "./chunk-7BDPM5ST.js";
19
- import "./chunk-WVH5ESDA.js";
20
- import "./chunk-SFM3M2L3.js";
19
+ import "./chunk-NRYDJN4J.js";
20
+ import "./chunk-WIWDVETN.js";
21
21
  import "./chunk-SHYQUBY3.js";
22
22
  import {
23
23
  isCliError,
@@ -120,10 +120,10 @@ function firstText(...values) {
120
120
  return "";
121
121
  }
122
122
  function invoiceRecordOf(item) {
123
- const record = asRecord(item);
124
- const inner = asRecord(record.info);
125
- const hasOwnInvoiceFields = record.comm_info !== void 0 || record.fid !== void 0 || record.number !== void 0;
126
- return !hasOwnInvoiceFields && Object.keys(inner).length ? inner : record;
123
+ const record2 = asRecord(item);
124
+ const inner = asRecord(record2.info);
125
+ const hasOwnInvoiceFields = record2.comm_info !== void 0 || record2.fid !== void 0 || record2.number !== void 0;
126
+ return !hasOwnInvoiceFields && Object.keys(inner).length ? inner : record2;
127
127
  }
128
128
  function parseInvoiceExt(value) {
129
129
  if (value && typeof value === "object") return asRecord(value);
@@ -243,11 +243,11 @@ function summarizeListData(data) {
243
243
  var DETAIL_EXTRA_FIELDS = ["issuer", "checkState", "attachments"];
244
244
  var DETAIL_ITEM_FIELDS = [...SUMMARY_ITEM_FIELDS, ...DETAIL_EXTRA_FIELDS];
245
245
  function attachmentOf(entry) {
246
- const record = asRecord2(entry);
246
+ const record2 = asRecord2(entry);
247
247
  return {
248
- id: text2(record.fileId ?? record.id),
249
- name: text2(record.name),
250
- type: text2(record.type)
248
+ id: text2(record2.fileId ?? record2.id),
249
+ name: text2(record2.name),
250
+ type: text2(record2.type)
251
251
  };
252
252
  }
253
253
  function summarizeInvoiceDetailItem(wrapper) {
@@ -584,46 +584,6 @@ var uploadSchema = objectSchema({
584
584
  ocrMap: { type: "string" },
585
585
  fail: { const: false }
586
586
  }, ["id", "ids", "fileType", "totalPages", "hasFanWei", "fail"]);
587
- var browseFieldItemSchema = objectSchema({
588
- optionId: { type: "string" },
589
- id: { type: "string" },
590
- fid: { type: "string" },
591
- type: { type: "integer" },
592
- typeName: { type: "string" },
593
- number: { type: "string" },
594
- code: { type: "string" },
595
- content: { type: "string" },
596
- name: { type: "string" },
597
- total: { type: "string" },
598
- ttax: { type: "string" },
599
- seller: { type: "string" },
600
- sellerId: { type: "string" },
601
- buyer: { type: "string" },
602
- buyerId: { type: "string" },
603
- incDate: { type: "string" },
604
- incDateTimestamp: { type: "integer" },
605
- validStatus: { type: "string" },
606
- source: { type: "string" },
607
- invoiceStatus: { type: "integer" },
608
- del: { type: "integer" },
609
- currency: { type: "string" },
610
- currencyName: { type: "string" },
611
- taxRate: { type: "string" },
612
- consumeContent: { type: "string" },
613
- fylx: { type: "string" },
614
- inputDate: { type: "string" },
615
- incTotal: { type: "number" },
616
- reimingMoney: { type: "string" },
617
- reimedMoney: { type: "string" },
618
- notReimMoney: { type: "string" },
619
- reimDate: { type: "string" },
620
- reimProcess: { type: "string" }
621
- }, ["optionId", "id", "fid", "type", "typeName", "number", "content", "name", "total"]);
622
- var browseFieldErrorSchema = objectSchema({
623
- fid: { type: "string" },
624
- ret: { type: "integer" },
625
- message: { type: "string" }
626
- }, ["ret", "message"]);
627
587
  var continuationSchema = { type: "string", minLength: 1 };
628
588
  var continuationPreviewOutput = (previewSchema, extra = {}) => objectSchema({
629
589
  preview: previewSchema,
@@ -1231,26 +1191,6 @@ var invoiceOperations = [
1231
1191
  },
1232
1192
  outputSchema: deleteApplyOutputSchema
1233
1193
  },
1234
- {
1235
- name: "invoice.browse-field.data",
1236
- risk: "read",
1237
- fixed: { source: "POST /api/inc/get", mask: 0, userFlag: "1", isDelFlag: "1" },
1238
- inputSchema: {
1239
- type: "object",
1240
- additionalProperties: false,
1241
- properties: {
1242
- fid: positiveId,
1243
- fids: positiveIdArray,
1244
- detail: { type: "object" }
1245
- },
1246
- oneOf: [{ required: ["fid"] }, { required: ["fids"] }, { required: ["detail"] }]
1247
- },
1248
- outputSchema: objectSchema({
1249
- items: arrayOf(browseFieldItemSchema),
1250
- errors: arrayOf(browseFieldErrorSchema),
1251
- workflow: workflowSchema
1252
- }, ["items", "errors", "workflow"])
1253
- },
1254
1194
  {
1255
1195
  name: "invoice.reim.file-ocr.preview",
1256
1196
  risk: "read-with-upload",
@@ -1361,6 +1301,34 @@ var invoiceOperations = [
1361
1301
  workflow: workflowSchema
1362
1302
  }, ["result", "data", "keywords", "match", "items", "workflow"])
1363
1303
  },
1304
+ {
1305
+ name: "invoice.reim.customer.search",
1306
+ risk: "read",
1307
+ fixed: {
1308
+ path: "/api/ebuilder/coms/nlist/getData",
1309
+ method: "POST",
1310
+ headers: { ebbusinessid: "1218181956452048911", langtype: "zh_CN", pragma: "no-cache", priority: "u=1, i", timezoneoffset: "-480", Accept: "*/*" },
1311
+ compId: "c39b9e14c0034336adf9e9bc39aeed75",
1312
+ pageId: "1218181956452048911",
1313
+ pageNo: "1",
1314
+ tableuid: "d26c94cc9c234d7da9bc2d399339a439",
1315
+ filter: "\u5BA2\u6237\u8868\u300C\u540D\u79F0\u300D\u5B57\u6BB5 field_1173221220888062665 \u6A21\u7CCA\u5339\u914D keywords\uFF1B\u5176\u4ED6\u7B5B\u9009\u53C2\u6570\u56FA\u5B9A"
1316
+ },
1317
+ inputSchema: objectSchema({
1318
+ keywords: { type: "string", minLength: 1, description: "\u7528\u6237\u8F93\u5165\u7684\u5BA2\u6237\u540D\u79F0\uFF0C\u652F\u6301\u6A21\u7CCA\u540D\u79F0\uFF1B\u4E0D\u9700\u8981\u62A5\u9500\u8868\u5355\u6216\u5B57\u6BB5 ID" }
1319
+ }, ["keywords"]),
1320
+ outputSchema: objectSchema({
1321
+ list: arrayOf(objectSchema({
1322
+ id: { type: "string", description: "\u76F8\u5173\u5BA2\u6237 ID" },
1323
+ "1173221220888062665": { type: "string", description: "\u76F8\u5173\u5BA2\u6237\u540D\u79F0" },
1324
+ "1173221220888062667": arrayOf(objectSchema({
1325
+ name: { type: "string", description: "\u627F\u62C5\u4E3B\u4F53\u540D\u79F0" },
1326
+ id: { type: "string", description: "\u627F\u62C5\u4E3B\u4F53 ID" },
1327
+ type: { type: "string" }
1328
+ }, ["name", "id", "type"]))
1329
+ }, ["id", "1173221220888062665", "1173221220888062667"]))
1330
+ }, ["list"])
1331
+ },
1364
1332
  {
1365
1333
  name: "invoice.reim.relation.search",
1366
1334
  risk: "read",
@@ -1582,12 +1550,12 @@ var invoiceRetiredOperations = [
1582
1550
  },
1583
1551
  {
1584
1552
  name: "invoice.reim.row-info",
1585
- replacement: "\u660E\u7EC6\u884C\u4E0D\u518D\u9884\u586B\uFF1A\u6BCF\u884C\u53EA\u5199\u300C\u76F8\u5173\u53D1\u7968\u300D\uFF08\u7528 invoice.browse-field.data \u751F\u6210\uFF09\uFF0C\u5176\u4F59\u5217\u7531\u8054\u52A8\u5E26\u51FA",
1553
+ replacement: "\u660E\u7EC6\u884C\u4E0D\u518D\u9884\u586B\uFF1A\u6BCF\u884C\u53EA\u5199\u300C\u76F8\u5173\u53D1\u7968\u300D\uFF08\u76F4\u63A5\u4F7F\u7528\u5DF2\u9009\u53D1\u7968\u7684 id/name \u5F15\u7528\u5BF9\u8C61\uFF09\uFF0C\u5176\u4F59\u5217\u7531\u8054\u52A8\u5E26\u51FA",
1586
1554
  reference: REIM_REFERENCE
1587
1555
  },
1588
1556
  {
1589
1557
  name: "invoice.reim.row-info-batch",
1590
- replacement: "\u660E\u7EC6\u884C\u4E0D\u518D\u9884\u586B\uFF1A\u6BCF\u884C\u53EA\u5199\u300C\u76F8\u5173\u53D1\u7968\u300D\uFF08\u7528 invoice.browse-field.data \u751F\u6210\uFF09\uFF0C\u5176\u4F59\u5217\u7531\u8054\u52A8\u5E26\u51FA",
1558
+ replacement: "\u660E\u7EC6\u884C\u4E0D\u518D\u9884\u586B\uFF1A\u6BCF\u884C\u53EA\u5199\u300C\u76F8\u5173\u53D1\u7968\u300D\uFF08\u76F4\u63A5\u4F7F\u7528\u5DF2\u9009\u53D1\u7968\u7684 id/name \u5F15\u7528\u5BF9\u8C61\uFF09\uFF0C\u5176\u4F59\u5217\u7531\u8054\u52A8\u5E26\u51FA",
1591
1559
  reference: REIM_REFERENCE
1592
1560
  },
1593
1561
  {
@@ -1756,58 +1724,6 @@ var UPDATE_FIELDS = /* @__PURE__ */ new Map([
1756
1724
  ["currency", "string"],
1757
1725
  ["currencyName", "string"]
1758
1726
  ]);
1759
- var BROWSE_TYPE_NAMES = /* @__PURE__ */ new Map([
1760
- [1, "\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968"],
1761
- [2, "\u589E\u503C\u7A0E\u666E\u901A\u53D1\u7968"],
1762
- [3, "\u589E\u503C\u7A0E\u7535\u5B50\u666E\u901A\u53D1\u7968"],
1763
- [4, "\u5377\u5F0F\u53D1\u7968"],
1764
- [5, "\u901A\u884C\u8D39\u589E\u503C\u7A0E\u7535\u5B50\u666E\u901A\u53D1\u7968"],
1765
- [6, "\u673A\u52A8\u8F66\u9500\u552E\u7EDF\u4E00\u53D1\u7968"],
1766
- [7, "\u5B9A\u989D\u53D1\u7968"],
1767
- [8, "\u5BA2\u8FD0\u6C7D\u8F66\u7968"],
1768
- [9, "\u822A\u7A7A\u8FD0\u8F93\u7535\u5B50\u5BA2\u7968\u884C\u7A0B\u5355"],
1769
- [10, "\u706B\u8F66\u7968"],
1770
- [11, "\u51FA\u79DF\u8F66\u7968"],
1771
- [12, "\u5176\u4ED6"],
1772
- [13, "\u6C7D\u8F66\u901A\u884C\u8D39\u53D1\u7968"],
1773
- [14, "\u8239\u7968"],
1774
- [22, "\u4E8C\u624B\u8F66\u9500\u552E\u7EDF\u4E00\u53D1\u7968"],
1775
- [28, "\u589E\u503C\u7A0E\u7535\u5B50\u4E13\u7528\u53D1\u7968"],
1776
- [32, "\u7535\u5B50\u53D1\u7968\uFF08\u589E\u503C\u7A0E\u4E13\u7528\u53D1\u7968\uFF09"],
1777
- [33, "\u7535\u5B50\u53D1\u7968\uFF08\u666E\u901A\u53D1\u7968\uFF09"],
1778
- [47, "\u533B\u7597\u6536\u8D39\u7968\u636E"],
1779
- [48, "\u8D22\u653F\u975E\u7A0E\u6536\u5165\u7EDF\u4E00\u7968\u636E"],
1780
- [49, "\u6D77\u5173\u8FDB\u53E3\u589E\u503C\u7A0E\u4E13\u7528\u7F34\u6B3E\u4E66"],
1781
- [50, "\u7535\u5B50\u53D1\u7968\u670D\u52A1\u5E73\u53F0\u7EB8\u8D28\u666E\u7968"],
1782
- [52, "\u5B8C\u7A0E\u51ED\u8BC1"],
1783
- [53, "\u56FD\u9645\u5C0F\u7968"],
1784
- [54, "\u94F6\u884C\u56DE\u5355"],
1785
- [56, "\u4EE3\u6263\u4EE3\u7F34\u7A0E\u6536\u7F34\u6B3E\u51ED\u8BC1"]
1786
- ]);
1787
- var VALID_STATUS_NAMES = /* @__PURE__ */ new Map([
1788
- [0, "\u672A\u67E5\u9A8C"],
1789
- [1, "\u6709\u6548\u5DF2\u67E5\u9A8C"],
1790
- [2, "\u6709\u6548\u672A\u67E5\u9A8C"],
1791
- [3, "\u67E5\u9A8C\u5931\u8D25"],
1792
- [4, "\u53D1\u7968\u65E0\u6548"],
1793
- [5, "\u7968\u9762\u6821\u9A8C\u4E0D\u4E00\u81F4"]
1794
- ]);
1795
- var SOURCE_NAMES = /* @__PURE__ */ new Map([
1796
- [1, "\u5FAE\u4FE1"],
1797
- [2, "\u652F\u4ED8\u5B9D"],
1798
- [4, "\u90AE\u7BB1"],
1799
- [5, "\u62CD\u7167"],
1800
- [6, "\u626B\u7801"],
1801
- [7, "\u624B\u52A8"],
1802
- [9, "\u67E5\u9A8C\u5F55\u5165"],
1803
- [10, "\u4F01\u4E1A\u5FAE\u4FE1"],
1804
- [11, "\u516C\u4F17\u53F7"],
1805
- [12, "\u4F01\u4E1A\u53F0\u8D26"],
1806
- [13, "\u6587\u4EF6"],
1807
- [14, "Excel"],
1808
- [15, "\u77ED\u4FE1"],
1809
- [16, "\u94FE\u63A5\u5F55\u5165"]
1810
- ]);
1811
1727
  function asObject(value, name = "\u4E1A\u52A1\u8F93\u5165") {
1812
1728
  if (!value || typeof value !== "object" || Array.isArray(value)) {
1813
1729
  throw invoiceValidationError("input_invalid", `${name}\u5FC5\u987B\u662F JSON \u5BF9\u8C61`);
@@ -1962,13 +1878,6 @@ async function getDetail(input, host) {
1962
1878
  body: { ...body, userFlag: "1", isDelFlag: "1", req_base: reqBase() }
1963
1879
  });
1964
1880
  }
1965
- async function getDetailsByFids(fids, host) {
1966
- return host.invoiceRequest({
1967
- path: "/api/inc/get",
1968
- method: "POST",
1969
- body: { ids: fids, mask: 0, userFlag: "1", isDelFlag: "1", req_base: reqBase() }
1970
- });
1971
- }
1972
1881
  function invoiceDetailUrl(baseUrl, fid) {
1973
1882
  return `${baseUrl.replace(/\/+$/, "")}/sp/inc/incDetail?fid=${fid}`;
1974
1883
  }
@@ -1994,142 +1903,10 @@ function preview(info, baseUrl) {
1994
1903
  function workflow(name, state) {
1995
1904
  return { workflow: name, version: 1, state };
1996
1905
  }
1997
- function stringOrEmpty(value) {
1998
- return value === void 0 || value === null ? "" : String(value);
1999
- }
2000
1906
  function numberOrZero(value) {
2001
1907
  const parsed = Number(value);
2002
1908
  return Number.isFinite(parsed) ? parsed : 0;
2003
1909
  }
2004
- function enumName(names, value) {
2005
- if (value === void 0 || value === null || value === "") return "";
2006
- return names.get(numberOrZero(value)) || "";
2007
- }
2008
- function parseExt(extRaw) {
2009
- if (typeof extRaw !== "string" || !extRaw.trim()) return {};
2010
- try {
2011
- const parsed = JSON.parse(extRaw);
2012
- return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
2013
- } catch {
2014
- return {};
2015
- }
2016
- }
2017
- function dateToTimestampMs(date) {
2018
- if (typeof date !== "string" || !/^\d{4}-\d{2}-\d{2}$/u.test(date)) return 0;
2019
- const timestamp = Date.parse(`${date}T00:00:00+08:00`);
2020
- return Number.isFinite(timestamp) ? timestamp : 0;
2021
- }
2022
- function contentFor(typeName, number) {
2023
- if (typeName && number) return `${typeName}-${number}`;
2024
- return typeName || number || "";
2025
- }
2026
- function cents(value) {
2027
- if (value === void 0 || value === null || value === "") return 0;
2028
- const text5 = String(value);
2029
- const match = /^(-?\d+)(?:\.(\d{1,2}))?$/u.exec(text5);
2030
- if (!match) return null;
2031
- const whole = Number(match[1]);
2032
- const fraction = Number((match[2] || "").padEnd(2, "0"));
2033
- return whole * 100 + (whole < 0 ? -fraction : fraction);
2034
- }
2035
- function moneyMinus(total, reiming, reimed) {
2036
- if ((reiming === void 0 || reiming === null || reiming === "") && (reimed === void 0 || reimed === null || reimed === "")) {
2037
- return stringOrEmpty(total);
2038
- }
2039
- const totalCents = cents(total);
2040
- const reimingCents = cents(reiming);
2041
- const reimedCents = cents(reimed);
2042
- if (totalCents === null || reimingCents === null || reimedCents === null) return stringOrEmpty(total);
2043
- const value = totalCents - reimingCents - reimedCents;
2044
- const sign = value < 0 ? "-" : "";
2045
- const absolute = Math.abs(value);
2046
- const whole = Math.floor(absolute / 100);
2047
- const fraction = absolute % 100;
2048
- return fraction === 0 ? `${sign}${whole}` : `${sign}${whole}.${String(fraction).padStart(2, "0")}`;
2049
- }
2050
- function extProductNames(products) {
2051
- if (!Array.isArray(products)) return "";
2052
- return products.map((item) => item && typeof item === "object" ? stringOrEmpty(item.productName || item.name) : "").filter(Boolean).join("\u3001");
2053
- }
2054
- function browseFieldItem(info) {
2055
- const comm = info.comm_info || {};
2056
- const pro = comm.pro || {};
2057
- const price = comm.price || {};
2058
- const buyer = comm.buyer || {};
2059
- const payer = comm.payer || {};
2060
- const modify = info.modify_info || {};
2061
- const ext = parseExt(info.ext);
2062
- const products = Array.isArray(ext.products) ? ext.products : [];
2063
- const fid = stringOrEmpty(info.fid || info.id);
2064
- const type = numberOrZero(pro.type);
2065
- const typeName = stringOrEmpty(pro.cname) || BROWSE_TYPE_NAMES.get(type) || "\u672A\u77E5\u7968\u79CD";
2066
- const number = stringOrEmpty(info.number);
2067
- const content = contentFor(typeName, number);
2068
- const total = stringOrEmpty(price.total);
2069
- const reimingMoney = typeof price.reimingMoney === "string" ? price.reimingMoney : "";
2070
- const reimedMoney = typeof price.reimedMoney === "string" ? price.reimedMoney : "";
2071
- const firstProduct = products.find((item) => item && typeof item === "object");
2072
- return {
2073
- optionId: fid,
2074
- id: fid,
2075
- fid,
2076
- type,
2077
- typeName,
2078
- number,
2079
- code: stringOrEmpty(info.code),
2080
- content,
2081
- name: content,
2082
- total,
2083
- ttax: stringOrEmpty(ext.ttax),
2084
- seller: stringOrEmpty(payer.company),
2085
- sellerId: stringOrEmpty(payer.tcode),
2086
- buyer: stringOrEmpty(buyer.company),
2087
- buyerId: stringOrEmpty(buyer.tcode),
2088
- incDate: stringOrEmpty(pro.date),
2089
- incDateTimestamp: dateToTimestampMs(pro.date),
2090
- validStatus: enumName(VALID_STATUS_NAMES, pro.valid),
2091
- source: enumName(SOURCE_NAMES, modify.source),
2092
- invoiceStatus: numberOrZero(pro.status),
2093
- del: numberOrZero(modify.del),
2094
- currency: stringOrEmpty(info.currency) || "CNY",
2095
- currencyName: stringOrEmpty(info.currencyName) || "\u4EBA\u6C11\u5E01",
2096
- taxRate: stringOrEmpty(ext.taxRate || ext.trate || firstProduct?.taxRate || firstProduct?.trate),
2097
- consumeContent: stringOrEmpty(ext.content) || extProductNames(products),
2098
- fylx: stringOrEmpty(info.fylx) || "0",
2099
- inputDate: stringOrEmpty(modify.createDate || modify.modifyDate),
2100
- incTotal: 0,
2101
- reimingMoney,
2102
- reimedMoney,
2103
- notReimMoney: moneyMinus(total, reimingMoney, reimedMoney),
2104
- reimDate: "",
2105
- reimProcess: ""
2106
- };
2107
- }
2108
- function browseFieldData(response) {
2109
- const ret = response.res_base?.ret;
2110
- if (ret !== void 0 && ret !== 0) {
2111
- throw new InvoiceCliError("api", "detail_failed", response.res_base?.message || "\u8BE6\u60C5\u63A5\u53E3\u6574\u4F53\u5931\u8D25", {
2112
- code: ret,
2113
- details: { res_base: response.res_base },
2114
- exitCode: 1
2115
- });
2116
- }
2117
- const items = [];
2118
- const errors = [];
2119
- for (const entry of Array.isArray(response.infos) ? response.infos : []) {
2120
- const itemRet = entry?.ret?.ret;
2121
- if (itemRet !== 0) {
2122
- errors.push({
2123
- fid: stringOrEmpty(entry?.info?.fid || entry?.info?.id),
2124
- ret: itemRet,
2125
- message: entry?.ret?.message || "\u67E5\u8BE2\u5931\u8D25"
2126
- });
2127
- continue;
2128
- }
2129
- if (entry?.info && typeof entry.info === "object") items.push(browseFieldItem(entry.info));
2130
- }
2131
- return { items, errors };
2132
- }
2133
1910
  function assertBusinessSuccess(value, subtype, fallbackMessage) {
2134
1911
  const result = value && typeof value === "object" ? value : {};
2135
1912
  const code = result.code ?? result.res_base?.ret;
@@ -2351,8 +2128,8 @@ async function previewOcr(upload, host) {
2351
2128
  }
2352
2129
  return { results, invoices };
2353
2130
  }
2354
- function isRedReversedInvoice(record) {
2355
- const raw = record?.comm_info?.pro?.status;
2131
+ function isRedReversedInvoice(record2) {
2132
+ const raw = record2?.comm_info?.pro?.status;
2356
2133
  return (typeof raw === "number" ? raw : Number(raw ?? 0)) === 8;
2357
2134
  }
2358
2135
  async function listInvoices(input, host, flag) {
@@ -2374,10 +2151,10 @@ async function listInvoices(input, host, flag) {
2374
2151
  const session = await host.getSession();
2375
2152
  const result = await host.invoiceRequest({ path: "/api/inc/sync", method: "POST", body });
2376
2153
  const items = (result.infos || []).filter((item) => !isRedReversedInvoice(invoiceRecordOf(item))).map((item) => {
2377
- const record = invoiceRecordOf(item);
2378
- const fid = record.fid ?? record.id;
2379
- if (fid) record.detailUrl = invoiceDetailUrl(session.baseUrl, String(fid));
2380
- record.extInfo = invoiceExtInfo(record);
2154
+ const record2 = invoiceRecordOf(item);
2155
+ const fid = record2.fid ?? record2.id;
2156
+ if (fid) record2.detailUrl = invoiceDetailUrl(session.baseUrl, String(fid));
2157
+ record2.extInfo = invoiceExtInfo(record2);
2381
2158
  return item;
2382
2159
  });
2383
2160
  return {
@@ -2676,22 +2453,6 @@ var InvoiceAddApplyOperation = class {
2676
2453
  }
2677
2454
  };
2678
2455
 
2679
- // src/shortcuts/invoice/operations/browse-field.ts
2680
- var InvoiceBrowseFieldDataOperation = class {
2681
- name = "invoice.browse-field.data";
2682
- async execute(input, { host }) {
2683
- const detail = input.detail === void 0 ? asObject(await getDetailsByFids(normalizeFids(input), host), "detail") : asObject(input.detail, "detail");
2684
- const data = browseFieldData(detail);
2685
- return {
2686
- status: data.errors.length ? "PARTIAL" : "COMPLETE",
2687
- data: {
2688
- ...data,
2689
- workflow: workflow("invoice.browse-field.data", data.errors.length ? "PARTIAL" : "COMPLETE")
2690
- }
2691
- };
2692
- }
2693
- };
2694
-
2695
2456
  // src/shortcuts/invoice/operations/delete.ts
2696
2457
  var InvoiceDeletePrepareOperation = class {
2697
2458
  name = "invoice.delete.prepare";
@@ -3113,8 +2874,8 @@ function amountCents(value, requestId) {
3113
2874
  }
3114
2875
  return Math.round(Number(text5) * 100);
3115
2876
  }
3116
- function formatCents(cents2) {
3117
- return (cents2 / 100).toFixed(2);
2877
+ function formatCents(cents) {
2878
+ return (cents / 100).toFixed(2);
3118
2879
  }
3119
2880
  function summarizeContractRows(requestId, rows) {
3120
2881
  if (rows.length === 0) {
@@ -3132,12 +2893,12 @@ function summarizeContractRows(requestId, rows) {
3132
2893
  let totalCents = 0;
3133
2894
  for (const row of rows) {
3134
2895
  const group = textValue2(row[FIELD.group]);
3135
- const cents2 = amountCents(row[FIELD.amount], requestId);
3136
- totalCents += cents2;
2896
+ const cents = amountCents(row[FIELD.amount], requestId);
2897
+ totalCents += cents;
3137
2898
  const key = group ?? "";
3138
2899
  const entry = groups.get(key) ?? { group, cents: 0, items: [] };
3139
- entry.cents += cents2;
3140
- entry.items.push({ name: textValue2(row[FIELD.itemName]), amount: formatCents(cents2) });
2900
+ entry.cents += cents;
2901
+ entry.items.push({ name: textValue2(row[FIELD.itemName]), amount: formatCents(cents) });
3141
2902
  groups.set(key, entry);
3142
2903
  }
3143
2904
  return {
@@ -3147,7 +2908,7 @@ function summarizeContractRows(requestId, rows) {
3147
2908
  buyerTaxNo: firstText2(rows, FIELD.buyerTaxNo),
3148
2909
  sellerName: sellerName(rows),
3149
2910
  invoiceAmount: formatCents(totalCents),
3150
- invoiceGroups: [...groups.values()].map(({ group, cents: cents2, items }) => ({ group, amount: formatCents(cents2), items }))
2911
+ invoiceGroups: [...groups.values()].map(({ group, cents, items }) => ({ group, amount: formatCents(cents), items }))
3151
2912
  };
3152
2913
  }
3153
2914
  function requestIdOf(value, location) {
@@ -3373,9 +3134,9 @@ function projectRequestListItem(item) {
3373
3134
  }
3374
3135
  function projectRequestListResult(value) {
3375
3136
  if (!value || typeof value !== "object" || Array.isArray(value)) return value;
3376
- const record = value;
3377
- if (!Array.isArray(record.data)) return value;
3378
- return { ...record, data: record.data.map(projectRequestListItem) };
3137
+ const record2 = value;
3138
+ if (!Array.isArray(record2.data)) return value;
3139
+ return { ...record2, data: record2.data.map(projectRequestListItem) };
3379
3140
  }
3380
3141
  var UNSAFE_JSON_INTEGER_ID = /("id"\s*:\s*)(-?\d{16,})(?=\s*[,}\]])/g;
3381
3142
  function quoteEmployeeIdsInJsonText(text5) {
@@ -3389,9 +3150,9 @@ function employeeIdString(value) {
3389
3150
  }
3390
3151
  function stringifyEmployeeRecordId(employee) {
3391
3152
  if (!employee || typeof employee !== "object" || Array.isArray(employee)) return employee;
3392
- const record = employee;
3393
- if (!("id" in record)) return employee;
3394
- return { ...record, id: employeeIdString(record.id) };
3153
+ const record2 = employee;
3154
+ if (!("id" in record2)) return employee;
3155
+ return { ...record2, id: employeeIdString(record2.id) };
3395
3156
  }
3396
3157
  function stringifyEmployeeSuperiorsPayload(payload) {
3397
3158
  if ("currentEmployee" in payload) {
@@ -3518,9 +3279,9 @@ function projectFieldSearchItems(value) {
3518
3279
  const items = [];
3519
3280
  const seen = /* @__PURE__ */ new Set();
3520
3281
  for (const item of raw) {
3521
- const record = item && typeof item === "object" && !Array.isArray(item) ? item : {};
3522
- const id = String(record.id ?? record.value ?? "").trim();
3523
- const name = String(record.name ?? "").trim();
3282
+ const record2 = item && typeof item === "object" && !Array.isArray(item) ? item : {};
3283
+ const id = String(record2.id ?? record2.value ?? "").trim();
3284
+ const name = String(record2.name ?? "").trim();
3524
3285
  if (!id || !name || seen.has(id)) continue;
3525
3286
  seen.add(id);
3526
3287
  items.push({ id, name, value: id });
@@ -3578,9 +3339,9 @@ function toCents(value) {
3578
3339
  const [whole, fraction = ""] = match[0].replace("-", "").split(".");
3579
3340
  return (Number(whole) * 100 + Number(fraction.padEnd(2, "0"))) * (negative ? -1 : 1);
3580
3341
  }
3581
- function centsToMoney(cents2) {
3582
- const sign = cents2 < 0 ? "-" : "";
3583
- const absolute = Math.abs(cents2);
3342
+ function centsToMoney(cents) {
3343
+ const sign = cents < 0 ? "-" : "";
3344
+ const absolute = Math.abs(cents);
3584
3345
  const whole = Math.floor(absolute / 100);
3585
3346
  const fraction = absolute % 100;
3586
3347
  return `${sign}${whole}.${String(fraction).padStart(2, "0")}`;
@@ -3589,12 +3350,12 @@ function sumMoney(values) {
3589
3350
  let sum = 0;
3590
3351
  let invalid = 0;
3591
3352
  for (const value of values) {
3592
- const cents2 = toCents(value);
3593
- if (cents2 === null) {
3353
+ const cents = toCents(value);
3354
+ if (cents === null) {
3594
3355
  invalid += 1;
3595
3356
  continue;
3596
3357
  }
3597
- sum += cents2;
3358
+ sum += cents;
3598
3359
  }
3599
3360
  return { amount: centsToMoney(sum), invalid };
3600
3361
  }
@@ -3708,6 +3469,112 @@ var InvoiceReimCandidatesListOperation = class {
3708
3469
  }
3709
3470
  };
3710
3471
 
3472
+ // src/shortcuts/invoice/operations/reim-customer.ts
3473
+ var CUSTOMER_PAGE_ID = "1218181956452048911";
3474
+ var CUSTOMER_COMP_ID = "c39b9e14c0034336adf9e9bc39aeed75";
3475
+ var CUSTOMER_OBJECT_ID = "1173221220888059964";
3476
+ var CUSTOMER_NAME_FIELD = "1173221220888062665";
3477
+ var CUSTOMER_BEARER_FIELD = "1173221220888062667";
3478
+ function customerFilter(keywords) {
3479
+ return [
3480
+ {
3481
+ conditionType: "or",
3482
+ dataType: "field",
3483
+ id: "f9bf956948e54ed58ac32988ff8a84c8",
3484
+ conditionComId: `${CUSTOMER_COMP_ID}_quick_EXCLUDECACHE`,
3485
+ filterFields: [{
3486
+ compId: CUSTOMER_COMP_ID,
3487
+ compType: "Text",
3488
+ dataset: {
3489
+ isPhysical: true,
3490
+ ebuilderDataConfig: { dataSetup: {}, type: "FORM" },
3491
+ detailTable: false,
3492
+ groupId: "weaver-ebuilder-form-service",
3493
+ usage: "all",
3494
+ appId: "980180677416657173",
3495
+ id: CUSTOMER_OBJECT_ID,
3496
+ text: "\u5BA2\u6237",
3497
+ type: "LOGIC",
3498
+ objType: "physical"
3499
+ },
3500
+ fieldName: `field_${CUSTOMER_NAME_FIELD}`,
3501
+ id: CUSTOMER_NAME_FIELD,
3502
+ objId: CUSTOMER_OBJECT_ID,
3503
+ type: "String",
3504
+ text: "\u540D\u79F0"
3505
+ }],
3506
+ value: keywords
3507
+ },
3508
+ {
3509
+ conditionComId: `${CUSTOMER_COMP_ID}_filter_EXCLUDECACHE`,
3510
+ conditionType: "and",
3511
+ dataType: "classification",
3512
+ useConfig: true
3513
+ }
3514
+ ];
3515
+ }
3516
+ function invalidResponse() {
3517
+ throw new InvoiceCliError("api", "reim_customer_search_invalid", "\u5BA2\u6237\u67E5\u8BE2\u8FD4\u56DE\u7684\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u65E0\u6CD5\u786E\u8BA4\u76F8\u5173\u5BA2\u6237\u548C\u627F\u62C5\u4E3B\u4F53", { exitCode: 1 });
3518
+ }
3519
+ function record(value) {
3520
+ if (!value || typeof value !== "object" || Array.isArray(value)) return invalidResponse();
3521
+ return value;
3522
+ }
3523
+ function responseString(value) {
3524
+ if (typeof value !== "string" || !value.trim()) return invalidResponse();
3525
+ return value;
3526
+ }
3527
+ function projectCustomer(value) {
3528
+ const row = record(value);
3529
+ const bearers = row[CUSTOMER_BEARER_FIELD] ?? [];
3530
+ if (!Array.isArray(bearers)) return invalidResponse();
3531
+ return {
3532
+ id: responseString(row.id),
3533
+ [CUSTOMER_NAME_FIELD]: responseString(row[CUSTOMER_NAME_FIELD]),
3534
+ [CUSTOMER_BEARER_FIELD]: bearers.map((value2) => {
3535
+ const bearer = record(value2);
3536
+ return {
3537
+ name: responseString(bearer.name),
3538
+ id: responseString(bearer.id),
3539
+ type: responseString(bearer.type)
3540
+ };
3541
+ })
3542
+ };
3543
+ }
3544
+ var InvoiceReimCustomerSearchOperation = class {
3545
+ name = "invoice.reim.customer.search";
3546
+ async execute(input, { host }) {
3547
+ if (Object.keys(input).some((key) => key !== "keywords")) {
3548
+ throw invoiceValidationError("input_invalid", "\u5BA2\u6237\u67E5\u8BE2\u53EA\u63A5\u53D7 keywords\uFF0C\u5176\u4ED6\u67E5\u8BE2\u53C2\u6570\u56FA\u5B9A");
3549
+ }
3550
+ const keywords = asNonEmptyString(input.keywords, "keywords");
3551
+ const result = await host.invoiceMultipartRequest({
3552
+ path: "/api/ebuilder/coms/nlist/getData",
3553
+ method: "POST",
3554
+ headers: {
3555
+ ebbusinessid: CUSTOMER_PAGE_ID,
3556
+ langtype: "zh_CN",
3557
+ pragma: "no-cache",
3558
+ priority: "u=1, i",
3559
+ timezoneoffset: "-480",
3560
+ Accept: "*/*"
3561
+ },
3562
+ fields: {
3563
+ filter: customerFilter(keywords),
3564
+ compId: CUSTOMER_COMP_ID,
3565
+ pageId: CUSTOMER_PAGE_ID,
3566
+ pageNo: "1",
3567
+ tableuid: "d26c94cc9c234d7da9bc2d399339a439"
3568
+ },
3569
+ operation: this.name
3570
+ });
3571
+ assertBusinessSuccess(result, "reim_customer_search_failed", "\u641C\u7D22\u76F8\u5173\u5BA2\u6237\u5931\u8D25");
3572
+ const list = record(record(result).data).list;
3573
+ if (!Array.isArray(list)) return invalidResponse();
3574
+ return { status: "COMPLETE", data: { list: list.map(projectCustomer) } };
3575
+ }
3576
+ };
3577
+
3711
3578
  // src/shortcuts/invoice/operations/reim-relation.ts
3712
3579
  var RELATION_SAVE_PATH = "/api/esb/server/event/triggerActionFlow";
3713
3580
  var RELATION_SAVE_FLOW_ID = "908258457763844096";
@@ -3733,7 +3600,7 @@ var CUSTOMER_SEARCH_PAGE_ID = "1218181956452048911";
3733
3600
  var CUSTOMER_SEARCH_COMP_ID = "c39b9e14c0034336adf9e9bc39aeed75";
3734
3601
  var CUSTOMER_SEARCH_WORKFLOW_ID = "100003460000000060";
3735
3602
  var CUSTOMER_OBJ_ID = "1173221220888059964";
3736
- var CUSTOMER_NAME_FIELD = "1173221220888062665";
3603
+ var CUSTOMER_NAME_FIELD2 = "1173221220888062665";
3737
3604
  var PROJECT_SEARCH_PATH = "/api/ebuilder/form/common/browser/data/ebuilder";
3738
3605
  var PROJECT_NAME_FIELD = "1020275734718578690";
3739
3606
  var PROJECT_FORM_PARAM = JSON.stringify({
@@ -3798,12 +3665,12 @@ async function mapInOrder(items, fn) {
3798
3665
  return results;
3799
3666
  }
3800
3667
  function saveOutcome(value) {
3801
- const record = asRecord3(value);
3802
- const message = text3(asRecord3(asRecord3(asRecord3(asRecord3(record.actionData).responseData).customData).mainTable).msg);
3803
- if (Number(record.resultCode) === 200 && message.includes(RELATION_SAVED_MESSAGE)) return { saved: true, message };
3668
+ const record2 = asRecord3(value);
3669
+ const message = text3(asRecord3(asRecord3(asRecord3(asRecord3(record2.actionData).responseData).customData).mainTable).msg);
3670
+ if (Number(record2.resultCode) === 200 && message.includes(RELATION_SAVED_MESSAGE)) return { saved: true, message };
3804
3671
  return {
3805
3672
  saved: false,
3806
- message: message || text3(record.resultMsg) || `\u52A8\u4F5C\u6D41\u6CA1\u6709\u8FD4\u56DE\u300C${RELATION_SAVED_MESSAGE}\u300D\uFF08resultCode=${text3(record.resultCode) || "\u65E0"}\uFF09`
3673
+ message: message || text3(record2.resultMsg) || `\u52A8\u4F5C\u6D41\u6CA1\u6709\u8FD4\u56DE\u300C${RELATION_SAVED_MESSAGE}\u300D\uFF08resultCode=${text3(record2.resultCode) || "\u65E0"}\uFF09`
3807
3674
  };
3808
3675
  }
3809
3676
  var InvoiceReimRelationSaveOperation = class {
@@ -3962,7 +3829,7 @@ function relationSearchTarget(value) {
3962
3829
  if (value === "customer" || value === "project") return value;
3963
3830
  throw invoiceValidationError("input_invalid", "target \u53EA\u80FD\u662F customer\uFF08\u76F8\u5173\u5BA2\u6237\uFF09\u6216 project\uFF08\u76F8\u5173\u9879\u76EE\uFF09");
3964
3831
  }
3965
- function customerFilter(keywords) {
3832
+ function customerFilter2(keywords) {
3966
3833
  return [
3967
3834
  {
3968
3835
  conditionType: "or",
@@ -3984,8 +3851,8 @@ function customerFilter(keywords) {
3984
3851
  type: "LOGIC",
3985
3852
  objType: "physical"
3986
3853
  },
3987
- fieldName: `field_${CUSTOMER_NAME_FIELD}`,
3988
- id: CUSTOMER_NAME_FIELD,
3854
+ fieldName: `field_${CUSTOMER_NAME_FIELD2}`,
3855
+ id: CUSTOMER_NAME_FIELD2,
3989
3856
  objId: CUSTOMER_OBJ_ID,
3990
3857
  type: "String",
3991
3858
  text: "\u540D\u79F0"
@@ -4009,7 +3876,7 @@ async function searchCustomers(host, keywords, operation) {
4009
3876
  fields: {
4010
3877
  workflowId: CUSTOMER_SEARCH_WORKFLOW_ID,
4011
3878
  isCreate: "1",
4012
- filter: customerFilter(keywords),
3879
+ filter: customerFilter2(keywords),
4013
3880
  compId: CUSTOMER_SEARCH_COMP_ID,
4014
3881
  pageId: CUSTOMER_SEARCH_PAGE_ID,
4015
3882
  pageNo: "1",
@@ -4020,8 +3887,8 @@ async function searchCustomers(host, keywords, operation) {
4020
3887
  assertBusinessSuccess(result, "reim_relation_search_failed", "\u641C\u7D22\u76F8\u5173\u5BA2\u6237\u5931\u8D25");
4021
3888
  const list = asRecord3(asRecord3(result).data).list;
4022
3889
  return (Array.isArray(list) ? list : []).map((row) => {
4023
- const record = asRecord3(row);
4024
- return { id: text3(record.id), name: text3(record[CUSTOMER_NAME_FIELD]) };
3890
+ const record2 = asRecord3(row);
3891
+ return { id: text3(record2.id), name: text3(record2[CUSTOMER_NAME_FIELD2]) };
4025
3892
  });
4026
3893
  }
4027
3894
  async function searchProjects(host, keywords, operation) {
@@ -4118,14 +3985,14 @@ function amountCents2(value, name) {
4118
3985
  if (value === void 0 || value === null || value === "") return null;
4119
3986
  const text5 = typeof value === "number" ? String(value) : value;
4120
3987
  const match = typeof text5 === "string" ? /^(\d+)(?:\.(\d{1,2}))?$/u.exec(text5.trim()) : null;
4121
- const cents2 = match ? Number(match[1]) * 100 + Number((match[2] ?? "").padEnd(2, "0")) : NaN;
4122
- if (!Number.isSafeInteger(cents2) || cents2 <= 0) {
3988
+ const cents = match ? Number(match[1]) * 100 + Number((match[2] ?? "").padEnd(2, "0")) : NaN;
3989
+ if (!Number.isSafeInteger(cents) || cents <= 0) {
4123
3990
  throw invoiceValidationError("input_invalid", `${name} \u5FC5\u987B\u662F\u5927\u4E8E 0\u3001\u6700\u591A\u4E24\u4F4D\u5C0F\u6570\u7684\u91D1\u989D`);
4124
3991
  }
4125
- return cents2;
3992
+ return cents;
4126
3993
  }
4127
- function formatCents2(cents2) {
4128
- return cents2 % 100 === 0 ? String(cents2 / 100) : (cents2 / 100).toFixed(2);
3994
+ function formatCents2(cents) {
3995
+ return cents % 100 === 0 ? String(cents / 100) : (cents / 100).toFixed(2);
4129
3996
  }
4130
3997
  function subsidyInvoiceDateRange(now = /* @__PURE__ */ new Date()) {
4131
3998
  const dateEnd = shanghaiCalendarDate(0, now);
@@ -4138,8 +4005,8 @@ function normalizeInvoices(value) {
4138
4005
  const invoices = value.map((item, index) => {
4139
4006
  if (!item || typeof item !== "object") throw invoiceValidationError("input_invalid", `invoices[${index}] \u5FC5\u987B\u662F {fid,total,date}`);
4140
4007
  const fid = asPositiveString(String(item.fid ?? ""), `invoices[${index}].fid`);
4141
- const cents2 = amountCents2(item.total, `invoices[${index}].total`);
4142
- if (cents2 === null) throw invoiceValidationError("input_invalid", `invoices[${index}].total \u5FC5\u586B\uFF1A\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1`);
4008
+ const cents = amountCents2(item.total, `invoices[${index}].total`);
4009
+ if (cents === null) throw invoiceValidationError("input_invalid", `invoices[${index}].total \u5FC5\u586B\uFF1A\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1`);
4143
4010
  const date = asNonEmptyString(item.date, `invoices[${index}].date`);
4144
4011
  const timestamp = Date.parse(`${date}T00:00:00Z`);
4145
4012
  if (!/^\d{4}-\d{2}-\d{2}$/u.test(date) || !Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== date) {
@@ -4153,7 +4020,7 @@ function normalizeInvoices(value) {
4153
4020
  dateEnd
4154
4021
  });
4155
4022
  }
4156
- return { fid, cents: cents2, date };
4023
+ return { fid, cents, date };
4157
4024
  });
4158
4025
  if (new Set(invoices.map((item) => item.fid)).size !== invoices.length) {
4159
4026
  throw invoiceValidationError("input_invalid", "invoices \u4E0D\u80FD\u5305\u542B\u91CD\u590D fid");
@@ -4165,7 +4032,7 @@ function workflowViewUrl(baseUrl, requestId) {
4165
4032
  }
4166
4033
  function subsidyReceipt(options) {
4167
4034
  const { processTitle, reason, url, details, skipped, allowanceCents, reimbursedTotalCents } = options;
4168
- const money = (cents2) => `\xA5${(cents2 / 100).toFixed(2)}`;
4035
+ const money = (cents) => `\xA5${(cents / 100).toFixed(2)}`;
4169
4036
  const includedTotalCents = details.reduce((sum, item) => sum + item.cents, 0);
4170
4037
  const partialAmountCents = includedTotalCents - reimbursedTotalCents;
4171
4038
  const dates = details.map((item) => item.date).sort();
@@ -4452,8 +4319,8 @@ function usefulExt(rawExt, cname) {
4452
4319
  return asRecord4(compact(ext));
4453
4320
  }
4454
4321
  function party(value) {
4455
- const record = asRecord4(value);
4456
- return { company: text4(record.company), tcode: text4(record.tcode) };
4322
+ const record2 = asRecord4(value);
4323
+ return { company: text4(record2.company), tcode: text4(record2.tcode) };
4457
4324
  }
4458
4325
  function invoiceResult(item, baseUrl) {
4459
4326
  const entry = asRecord4(item);
@@ -4547,13 +4414,13 @@ function buildRegistry() {
4547
4414
  new InvoiceDownloadOperation(),
4548
4415
  new InvoiceDeletePrepareOperation(),
4549
4416
  new InvoiceDeleteApplyOperation(),
4550
- new InvoiceBrowseFieldDataOperation(),
4551
4417
  new InvoiceReimFileOcrPreviewOperation(),
4552
4418
  new InvoiceReimRequestsListOperation(),
4553
4419
  new InvoiceReimWorkflowResolveOperation(),
4554
4420
  new InvoiceReimCandidatesListOperation(),
4555
4421
  new InvoiceReimEmployeeSuperiorsOperation(),
4556
4422
  new InvoiceReimFieldSearchOperation(),
4423
+ new InvoiceReimCustomerSearchOperation(),
4557
4424
  new InvoiceReimRelationSearchOperation(),
4558
4425
  new InvoiceReimRelationSaveOperation(),
4559
4426
  new InvoiceReimRelationListOperation(),