intonear-erp-cli 0.1.0 → 0.2.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.
- package/dist/bin.js +1167 -106
- package/package.json +13 -14
package/dist/bin.js
CHANGED
|
@@ -14519,20 +14519,387 @@ function date4(params) {
|
|
|
14519
14519
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
14520
14520
|
config(en_default());
|
|
14521
14521
|
|
|
14522
|
+
// ../../packages/contracts/dist/agent-context.js
|
|
14523
|
+
var erpDomainModelVersion = "2026-09-02";
|
|
14524
|
+
var erpCompletenessRulesVersion = "2026-09-01";
|
|
14525
|
+
var erpDomainTopics = [
|
|
14526
|
+
{
|
|
14527
|
+
topic: "OVERVIEW",
|
|
14528
|
+
title: "\u9886\u57DF\u603B\u89C8",
|
|
14529
|
+
summary: "intoNear \u4EA7\u54C1\u4E3B\u6570\u636E\u3001\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u53CA\u5F53\u524D\u8BFB\u5199\u80FD\u529B\u7684\u8FB9\u754C\u3002"
|
|
14530
|
+
},
|
|
14531
|
+
{
|
|
14532
|
+
topic: "PRODUCT_MASTER_DATA",
|
|
14533
|
+
title: "\u4EA7\u54C1\u4E3B\u6570\u636E\u5173\u7CFB",
|
|
14534
|
+
summary: "Product\u3001ProductSpec\u3001Pack\u3001UserManual \u4E0E Supplier \u7684\u4E1A\u52A1\u542B\u4E49\u548C\u771F\u5B9E\u5173\u7CFB\u3002"
|
|
14535
|
+
},
|
|
14536
|
+
{
|
|
14537
|
+
topic: "BUSINESS_CODE_SYSTEM",
|
|
14538
|
+
title: "\u4E1A\u52A1\u7F16\u7801\u4F53\u7CFB",
|
|
14539
|
+
summary: "PR\u3001PS\u3001PK\u3001UM \u4E1A\u52A1\u7F16\u7801\u4E0E\u6570\u636E\u5E93\u5185\u90E8 ID \u7684\u533A\u522B\u3002"
|
|
14540
|
+
},
|
|
14541
|
+
{
|
|
14542
|
+
topic: "FILES",
|
|
14543
|
+
title: "\u6587\u4EF6\u4E0E\u4EA7\u54C1\u8D44\u6599",
|
|
14544
|
+
summary: "FileAsset\u3001\u4E0D\u53EF\u53D8 FileVersion\u3001\u4EA7\u54C1\u56FE\u7247\u5F52\u5C5E\u548C\u5F53\u524D\u4E0A\u4F20\u80FD\u529B\u3002"
|
|
14545
|
+
},
|
|
14546
|
+
{
|
|
14547
|
+
topic: "DEVELOPMENT_WORK_LIST",
|
|
14548
|
+
title: "\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355",
|
|
14549
|
+
summary: "DevBatch \u5DE5\u4F5C\u6E05\u5355\u3001\u6E05\u5355\u6210\u5458\u548C\u4EA7\u54C1\u4E3B\u6570\u636E\u4E4B\u95F4\u7684\u5173\u7CFB\u3002"
|
|
14550
|
+
},
|
|
14551
|
+
{
|
|
14552
|
+
topic: "COMPLETENESS_RULES",
|
|
14553
|
+
title: "\u8D44\u6599\u5B8C\u6574\u5EA6",
|
|
14554
|
+
summary: "\u5B9E\u65F6\u3001\u975E\u963B\u65AD\u5B8C\u6574\u5EA6\u6295\u5F71\u7684\u8303\u56F4\u3001\u89C4\u5219\u4E0E\u4F7F\u7528\u65B9\u5F0F\u3002"
|
|
14555
|
+
},
|
|
14556
|
+
{
|
|
14557
|
+
topic: "OPERATION_RECORDS",
|
|
14558
|
+
title: "\u64CD\u4F5C\u8BB0\u5F55",
|
|
14559
|
+
summary: "\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u64CD\u4F5C\u8BB0\u5F55\u7684\u542B\u4E49\u3001\u6765\u6E90\u548C\u65F6\u95F4\u987A\u5E8F\u3002"
|
|
14560
|
+
},
|
|
14561
|
+
{
|
|
14562
|
+
topic: "FIELD_SEMANTICS",
|
|
14563
|
+
title: "\u5B57\u6BB5\u8BED\u4E49",
|
|
14564
|
+
summary: "\u5355\u4F4D\u3001\u65F6\u95F4\u3001\u5185\u90E8\u6807\u8BC6\u548C\u5F53\u524D\u7A7A\u503C\u8BED\u4E49\u3002"
|
|
14565
|
+
},
|
|
14566
|
+
{
|
|
14567
|
+
topic: "CHANGELOG",
|
|
14568
|
+
title: "\u9886\u57DF\u8BF4\u660E\u53D8\u66F4\u8BB0\u5F55",
|
|
14569
|
+
summary: "\u9886\u57DF\u8BF4\u660E\u7248\u672C\u7684\u517C\u5BB9\u6027\u548C\u8BED\u4E49\u53D8\u5316\u3002"
|
|
14570
|
+
}
|
|
14571
|
+
];
|
|
14572
|
+
var erpDomainTopicNames = erpDomainTopics.map(({ topic }) => topic);
|
|
14573
|
+
var erpDomainTopicNameSchema = external_exports.enum(erpDomainTopicNames);
|
|
14574
|
+
var erpDomainContextResponseSchema = external_exports.object({
|
|
14575
|
+
domainModelVersion: external_exports.literal(erpDomainModelVersion).describe("\u9886\u57DF\u8BF4\u660E\u5185\u5BB9\u7684\u7248\u672C\u3002"),
|
|
14576
|
+
topics: external_exports.array(external_exports.object({
|
|
14577
|
+
topic: erpDomainTopicNameSchema.describe("\u9886\u57DF\u4E3B\u9898\u7684\u7A33\u5B9A\u679A\u4E3E\u540D\u3002"),
|
|
14578
|
+
title: external_exports.string().describe("\u9886\u57DF\u4E3B\u9898\u7684\u4E2D\u6587\u6807\u9898\u3002"),
|
|
14579
|
+
summary: external_exports.string().describe("\u9886\u57DF\u4E3B\u9898\u7684\u7B80\u77ED\u7528\u9014\u8BF4\u660E\u3002"),
|
|
14580
|
+
content: external_exports.record(external_exports.string(), external_exports.unknown()).describe("\u8BE5\u4E3B\u9898\u7684\u7ED3\u6784\u5316\u9886\u57DF\u89C4\u5219\u3002")
|
|
14581
|
+
}).strict())
|
|
14582
|
+
}).strict();
|
|
14583
|
+
var overviewContent = {
|
|
14584
|
+
purpose: "intoNear \u4E1A\u52A1\u7CFB\u7EDF\u7BA1\u7406\u4EA7\u54C1\u4E3B\u6570\u636E\u548C\u4EA7\u54C1\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u3002",
|
|
14585
|
+
capabilityBoundary: {
|
|
14586
|
+
access: "\u67E5\u8BE2\u8981\u6C42 erp:read\uFF1B\u5199\u5165\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u660E\u786E\u6388\u6743 erp:write\u3002",
|
|
14587
|
+
readOnly: false,
|
|
14588
|
+
available: [
|
|
14589
|
+
"\u641C\u7D22 Product\u3001ProductSpec\u3001Pack \u4E3B\u6570\u636E\u5173\u7CFB",
|
|
14590
|
+
"\u6309\u5B8C\u6574 PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u8BFB\u53D6\u4E3B\u6570\u636E\u5173\u7CFB",
|
|
14591
|
+
"\u5206\u9875\u67E5\u8BE2\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355",
|
|
14592
|
+
"\u8BFB\u53D6\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u53CA\u5B9E\u65F6\u8D44\u6599\u5B8C\u6574\u5EA6",
|
|
14593
|
+
"\u5206\u9875\u8BFB\u53D6\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u64CD\u4F5C\u8BB0\u5F55",
|
|
14594
|
+
"\u521B\u5EFA\u53CA\u66F4\u65B0 Product\u3001ProductSpec\u3001Pack",
|
|
14595
|
+
"\u7EF4\u62A4 ProductSpec\u2014Pack \u6620\u5C04",
|
|
14596
|
+
"\u521B\u5EFA\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u5E76\u6267\u884C\u539F\u5B50\u8BED\u4E49\u547D\u4EE4",
|
|
14597
|
+
"\u4E3A ProductSpec \u4E0A\u4F20\u5E76\u5173\u8054\u4EA7\u54C1\u56FE\u7247"
|
|
14598
|
+
],
|
|
14599
|
+
unavailable: ["\u91C7\u8D2D\u67E5\u8BE2", "\u7269\u6D41\u67E5\u8BE2", "\u8BA2\u5355\u67E5\u8BE2", "Agent \u7528\u6237\u8BF4\u660E\u4E66\u4E0E\u5176\u4ED6\u8D44\u6599\u9644\u4EF6\u7EF4\u62A4"]
|
|
14600
|
+
},
|
|
14601
|
+
permissionSemantics: {
|
|
14602
|
+
enforced: "\u8C03\u7528\u8EAB\u4EFD\u5FC5\u987B\u901A\u8FC7\u8BA4\u8BC1\u4E14 resource \u5339\u914D MCP\uFF1B\u6BCF\u4E2A\u5DE5\u5177\u5206\u522B\u6821\u9A8C erp:read \u6216 erp:write\u3002",
|
|
14603
|
+
objectLevel: "\u5F53\u524D\u5B9E\u73B0\u6CA1\u6709\u5BF9\u8C61\u7EA7\u5458\u5DE5\u53EF\u89C1\u6216\u53EF\u5199\u8303\u56F4\u5224\u5B9A\uFF1B\u6743\u9650\u8FB9\u754C\u662F\u5458\u5DE5\u8EAB\u4EFD\u3001resource \u4E0E scope\u3002",
|
|
14604
|
+
failures: "\u8BA4\u8BC1\u3001scope \u6216 resource \u5931\u8D25\u5728 HTTP \u5C42\u62D2\u7EDD\uFF1B\u7CBE\u786E\u67E5\u8BE2\u65E0\u7ED3\u679C\u53EA\u8FD4\u56DE\u901A\u7528 NOT_FOUND\u3002"
|
|
14605
|
+
},
|
|
14606
|
+
routing: [
|
|
14607
|
+
"\u5DF2\u77E5\u5B8C\u6574 PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u65F6\u4F7F\u7528\u7CBE\u786E\u4E3B\u6570\u636E\u67E5\u8BE2\u3002",
|
|
14608
|
+
"\u53EA\u6709\u540D\u79F0\u6216 Supplier \u65F6\u4F7F\u7528\u4EA7\u54C1\u4E3B\u6570\u636E\u641C\u7D22\uFF1B\u5F53\u524D\u641C\u7D22\u4E0D\u652F\u6301\u90E8\u5206 PR\u3001PS\u3001PK \u7F16\u7801\u3002",
|
|
14609
|
+
"\u8D44\u6599\u5B8C\u6574\u5EA6\u4EE5\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u8BE6\u60C5\u4E2D\u7684\u5B9E\u65F6\u8BA1\u7B97\u7ED3\u679C\u4E3A\u51C6\uFF0C\u4E0D\u6309\u5B57\u6BB5\u6570\u91CF\u81EA\u884C\u63A8\u7B97\u3002",
|
|
14610
|
+
"\u53EA\u9009\u62E9 MCP tools/list \u6216 CLI list \u5B9E\u9645\u5217\u51FA\u7684\u80FD\u529B\u3002",
|
|
14611
|
+
"\u66F4\u65B0\u548C\u5173\u7CFB\u7EF4\u62A4\u524D\u5148\u8BFB\u53D6\u6700\u65B0 version\uFF1B\u7248\u672C\u51B2\u7A81\u65F6\u91CD\u65B0\u8BFB\u53D6\u5E76\u8BF7\u6C42\u7528\u6237\u51B3\u5B9A\u3002",
|
|
14612
|
+
"\u540C\u4E00\u903B\u8F91\u5E42\u7B49\u547D\u4EE4\u7684\u91CD\u8BD5\u5FC5\u987B\u590D\u7528 idempotencyKey\u3002"
|
|
14613
|
+
]
|
|
14614
|
+
};
|
|
14615
|
+
var productMasterDataContent = {
|
|
14616
|
+
entities: [
|
|
14617
|
+
{
|
|
14618
|
+
entityType: "PRODUCT",
|
|
14619
|
+
name: "Product",
|
|
14620
|
+
businessIdentity: "ProductCode\uFF08PR \u4E1A\u52A1\u7F16\u7801\uFF09",
|
|
14621
|
+
definition: "\u9762\u5411\u7528\u6237\u7684\u4EA7\u54C1\u65CF\uFF0C\u4FDD\u5B58\u4EA7\u54C1\u540D\u79F0\u3002"
|
|
14622
|
+
},
|
|
14623
|
+
{
|
|
14624
|
+
entityType: "PRODUCT_SPEC",
|
|
14625
|
+
name: "ProductSpec",
|
|
14626
|
+
businessIdentity: "ProductSpecCode\uFF08PS \u4E1A\u52A1\u7F16\u7801\uFF09",
|
|
14627
|
+
definition: "Product \u7684\u5177\u4F53\u53EF\u552E\u4E0E\u5185\u90E8\u5B9E\u73B0\u89C4\u683C\u3002"
|
|
14628
|
+
},
|
|
14629
|
+
{
|
|
14630
|
+
entityType: "PACK",
|
|
14631
|
+
name: "Pack",
|
|
14632
|
+
businessIdentity: "PackCode\uFF08PK \u4E1A\u52A1\u7F16\u7801\uFF09",
|
|
14633
|
+
definition: "\u7531\u552F\u4E00 Supplier \u751F\u4EA7\u7684\u5B9E\u9645\u4EA4\u4ED8\u5305\u88F9\u3002"
|
|
14634
|
+
},
|
|
14635
|
+
{
|
|
14636
|
+
entityType: "USER_MANUAL",
|
|
14637
|
+
name: "UserManual",
|
|
14638
|
+
businessIdentity: "ManualCode\uFF08UM \u4E1A\u52A1\u7F16\u7801\uFF09",
|
|
14639
|
+
definition: "\u53EF\u88AB\u591A\u4E2A ProductSpec \u590D\u7528\u7684\u5BA2\u6237\u7EC4\u88C5\u3001\u4F7F\u7528\u6216\u5B89\u5168\u8BF4\u660E\u8D44\u6599\u3002"
|
|
14640
|
+
},
|
|
14641
|
+
{
|
|
14642
|
+
entityType: "SUPPLIER",
|
|
14643
|
+
name: "Supplier",
|
|
14644
|
+
businessIdentity: "SupplierCode",
|
|
14645
|
+
definition: "\u7CFB\u7EDF\u7EF4\u62A4\u7684\u53D7\u63A7\u751F\u4EA7\u4F9B\u5E94\u5546\u3002"
|
|
14646
|
+
}
|
|
14647
|
+
],
|
|
14648
|
+
relationships: [
|
|
14649
|
+
{
|
|
14650
|
+
from: "Product",
|
|
14651
|
+
to: "ProductSpec",
|
|
14652
|
+
cardinality: "1:1..*",
|
|
14653
|
+
meaning: "Product \u81F3\u5C11\u5305\u542B\u4E00\u4E2A ProductSpec\uFF1B\u6BCF\u4E2A ProductSpec \u53EA\u5F52\u5C5E\u4E00\u4E2A Product\u3002"
|
|
14654
|
+
},
|
|
14655
|
+
{
|
|
14656
|
+
from: "ProductSpec",
|
|
14657
|
+
to: "Pack",
|
|
14658
|
+
cardinality: "0..*:0..*",
|
|
14659
|
+
meaning: "\u901A\u8FC7\u5E26\u6B63\u6574\u6570 quantity \u7684\u6620\u5C04\u5173\u8054\uFF1B\u540C\u4E00 Pack \u53EF\u88AB\u591A\u4E2A ProductSpec \u590D\u7528\u3002"
|
|
14660
|
+
},
|
|
14661
|
+
{
|
|
14662
|
+
from: "Pack",
|
|
14663
|
+
to: "Supplier",
|
|
14664
|
+
cardinality: "*:1",
|
|
14665
|
+
meaning: "\u6BCF\u4E2A Pack \u53EA\u7531\u4E00\u4E2A Supplier \u751F\u4EA7\u3002"
|
|
14666
|
+
},
|
|
14667
|
+
{
|
|
14668
|
+
from: "ProductSpec",
|
|
14669
|
+
to: "UserManual",
|
|
14670
|
+
cardinality: "0..*:0..*",
|
|
14671
|
+
meaning: "\u4E00\u4E2A ProductSpec \u5173\u8054\u7684\u5168\u90E8 UserManual \u5747\u4E3A\u5FC5\u987B\u63D0\u4F9B\u7684 AND \u5173\u7CFB\u3002"
|
|
14672
|
+
}
|
|
14673
|
+
],
|
|
14674
|
+
rules: [
|
|
14675
|
+
"Product\u3001ProductSpec\u3001Pack \u548C UserManual \u521B\u5EFA\u540E\u7ACB\u5373\u53EF\u7528\uFF0C\u4E0D\u8BBE\u751F\u547D\u5468\u671F\u72B6\u6001\u3002",
|
|
14676
|
+
"\u8D44\u6599\u5B8C\u6574\u5EA6\u53EA\u63D0\u793A\u5F85\u8865\u8D44\u6599\uFF0C\u4E0D\u963B\u65AD\u4EA7\u54C1\u4E3B\u6570\u636E\u67E5\u8BE2\u6216\u4F7F\u7528\u3002",
|
|
14677
|
+
"\u4E1A\u52A1\u7F16\u7801\u53EA\u6807\u8BC6\u5BF9\u8C61\u7C7B\u578B\u548C\u8EAB\u4EFD\uFF0C\u4E0D\u627F\u8F7D\u54C1\u7C7B\u3001\u4F9B\u5E94\u5546\u3001\u6E20\u9053\u6216\u7248\u672C\u542B\u4E49\u3002"
|
|
14678
|
+
]
|
|
14679
|
+
};
|
|
14680
|
+
var businessCodeSystemContent = {
|
|
14681
|
+
codes: [
|
|
14682
|
+
{
|
|
14683
|
+
entity: "Product",
|
|
14684
|
+
field: "ProductCode",
|
|
14685
|
+
prefix: "PR",
|
|
14686
|
+
pattern: "^PR\\d{5,}$",
|
|
14687
|
+
example: "PR00001"
|
|
14688
|
+
},
|
|
14689
|
+
{
|
|
14690
|
+
entity: "ProductSpec",
|
|
14691
|
+
field: "ProductSpecCode",
|
|
14692
|
+
prefix: "PS",
|
|
14693
|
+
pattern: "^PS\\d{5,}$",
|
|
14694
|
+
example: "PS00001"
|
|
14695
|
+
},
|
|
14696
|
+
{
|
|
14697
|
+
entity: "Pack",
|
|
14698
|
+
field: "PackCode",
|
|
14699
|
+
prefix: "PK",
|
|
14700
|
+
pattern: "^PK\\d{6,}$",
|
|
14701
|
+
example: "PK000001"
|
|
14702
|
+
},
|
|
14703
|
+
{
|
|
14704
|
+
entity: "UserManual",
|
|
14705
|
+
field: "ManualCode",
|
|
14706
|
+
prefix: "UM",
|
|
14707
|
+
pattern: "^UM\\d{5,}$",
|
|
14708
|
+
example: "UM00001"
|
|
14709
|
+
}
|
|
14710
|
+
],
|
|
14711
|
+
rules: [
|
|
14712
|
+
"\u4E1A\u52A1\u7F16\u7801\u7531\u7CFB\u7EDF\u751F\u6210\u3001\u6C38\u4E45\u4E0D\u53D8\u3001\u5220\u9664\u540E\u4E0D\u91CD\u65B0\u5206\u914D\uFF0C\u6570\u5B57\u5E8F\u5217\u5141\u8BB8\u6709\u7A7A\u7F3A\u3002",
|
|
14713
|
+
"\u4E1A\u52A1\u7F16\u7801\u4E0D\u662F\u6570\u636E\u5E93\u5185\u90E8 ID\uFF0C\u4E5F\u4E0D\u662F\u6E20\u9053 SKU\u3002",
|
|
14714
|
+
"\u6A21\u578B\u53EA\u80FD\u901A\u8FC7\u524D\u7F00\u5224\u65AD\u5BF9\u8C61\u7C7B\u578B\uFF0C\u4E0D\u5F97\u4ECE\u6570\u5B57\u90E8\u5206\u63A8\u65AD\u54C1\u7C7B\u3001Supplier\u3001\u6E20\u9053\u6216\u7248\u672C\u3002",
|
|
14715
|
+
"\u7CBE\u786E\u7F16\u7801\u67E5\u8BE2\u63A5\u53D7\u89C4\u8303\u4E1A\u52A1\u7F16\u7801\uFF1B\u641C\u7D22\u53EF\u4EE5\u5B8C\u6574\u7F16\u7801\u7CBE\u786E\u547D\u4E2D\uFF0C\u4F46\u4E0D\u652F\u6301\u90E8\u5206\u4E1A\u52A1\u7F16\u7801\u3002"
|
|
14716
|
+
]
|
|
14717
|
+
};
|
|
14718
|
+
var developmentWorkListContent = {
|
|
14719
|
+
canonicalTerm: "DevelopmentWorkList",
|
|
14720
|
+
implementationTerm: "DevBatch",
|
|
14721
|
+
definition: "\u805A\u5408\u4EA7\u54C1\u4E3B\u6570\u636E\u5F15\u7528\u4E0E\u64CD\u4F5C\u8BB0\u5F55\u7684\u65E0\u72B6\u6001\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u3002",
|
|
14722
|
+
identity: {
|
|
14723
|
+
field: "workListId",
|
|
14724
|
+
semantics: "\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u7684\u5185\u90E8\u6B63\u6574\u6570\u6807\u8BC6\uFF0C\u7531\u5217\u8868\u67E5\u8BE2\u8FD4\u56DE\uFF1B\u4E0D\u662F\u4E1A\u52A1\u7F16\u7801\u3002"
|
|
14725
|
+
},
|
|
14726
|
+
membership: {
|
|
14727
|
+
allowedEntityTypes: ["PRODUCT", "PRODUCT_SPEC", "PACK"],
|
|
14728
|
+
referenceField: "entityCode",
|
|
14729
|
+
semantics: "\u6210\u5458\u662F\u5BF9\u4EA7\u54C1\u4E3B\u6570\u636E\u4E1A\u52A1\u7F16\u7801\u7684\u5E26\u7C7B\u578B\u5F15\u7528\uFF0C\u4E0D\u662F\u72EC\u7ACB DevelopmentWorkItem \u5B9E\u4F53\u3002"
|
|
14730
|
+
},
|
|
14731
|
+
rules: [
|
|
14732
|
+
"\u5DE5\u4F5C\u6E05\u5355\u4E0D\u62E5\u6709\u4EA7\u54C1\u4E3B\u6570\u636E\uFF0C\u4E0D\u6539\u53D8 Product\u3001ProductSpec \u6216 Pack \u7684\u53EF\u7528\u6027\u3002",
|
|
14733
|
+
"\u5DE5\u4F5C\u6E05\u5355\u6CA1\u6709\u63D0\u4EA4\u3001\u64A4\u56DE\u3001\u8BC4\u5BA1\u3001\u8FDB\u5EA6\u6216\u9501\u5B9A\u72B6\u6001\u3002",
|
|
14734
|
+
"\u5DE5\u4F5C\u6E05\u5355\u8BE6\u60C5\u8FD4\u56DE\u6210\u5458\u5BF9\u5E94\u4E3B\u6570\u636E\u7684\u5B9E\u65F6\u6295\u5F71\uFF0C\u800C\u4E0D\u662F\u5386\u53F2\u5FEB\u7167\u3002",
|
|
14735
|
+
"\u5B9E\u65F6\u5B8C\u6574\u5EA6\u53EA\u8BA1\u7B97\u5DE5\u4F5C\u6E05\u5355\u4E2D\u663E\u5F0F\u5305\u542B\u7684 ProductSpec\u3002"
|
|
14736
|
+
]
|
|
14737
|
+
};
|
|
14738
|
+
var filesContent = {
|
|
14739
|
+
entities: [
|
|
14740
|
+
{
|
|
14741
|
+
name: "FileAsset",
|
|
14742
|
+
definition: "\u4E00\u4E2A\u53EF\u6301\u7EED\u4EA7\u751F\u65B0\u7248\u672C\u7684\u6587\u4EF6\u8D44\u4EA7\u8EAB\u4EFD\uFF1B\u4E0D\u662F Product\u3001ProductSpec \u6216 Pack\u3002"
|
|
14743
|
+
},
|
|
14744
|
+
{
|
|
14745
|
+
name: "FileVersion",
|
|
14746
|
+
definition: "\u6587\u4EF6\u5728\u67D0\u4E00\u65F6\u70B9\u7684\u4E0D\u53EF\u53D8\u5185\u5BB9\u7248\u672C\uFF1B\u4EA7\u54C1\u8D44\u6599\u5173\u7CFB\u5F15\u7528\u660E\u786E\u7684 FileVersion\u3002"
|
|
14747
|
+
}
|
|
14748
|
+
],
|
|
14749
|
+
productImages: {
|
|
14750
|
+
owner: "ProductSpec",
|
|
14751
|
+
relationship: "\u4E00\u4E2A ProductSpec \u53EF\u5173\u8054\u591A\u5F20\u4EA7\u54C1\u56FE\u7247\uFF1B\u540C\u4E00 FileVersion \u4E0D\u91CD\u590D\u5173\u8054\u3002",
|
|
14752
|
+
acceptedTypes: ["JPG", "JPEG", "PNG", "WEBP"],
|
|
14753
|
+
maxSizeBytes: 50 * 1024 * 1024,
|
|
14754
|
+
effect: "\u65B0\u589E\u56FE\u7247\u4F1A\u5F71\u54CD\u5305\u542B\u8BE5 ProductSpec \u7684\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u5B9E\u65F6\u5B8C\u6574\u5EA6\u3002"
|
|
14755
|
+
},
|
|
14756
|
+
agentCapability: "\u5F53\u524D Agent \u53EA\u5F00\u653E\u65B0\u589E ProductSpec \u4EA7\u54C1\u56FE\u7247\uFF1B\u7528\u6237\u8BF4\u660E\u4E66\u3001\u4F9B\u5E94\u5546\u8D44\u6599\u3001\u5C01\u6837\u8D44\u6599\u548C Pack \u6587\u4EF6\u7B49\u5F85\u5404\u81EA\u9886\u57DF\u5DE5\u5177\u5F00\u653E\u540E\u4F7F\u7528\u3002"
|
|
14757
|
+
};
|
|
14758
|
+
var completenessRulesContent = {
|
|
14759
|
+
projectionType: "REALTIME_NON_BLOCKING",
|
|
14760
|
+
rulesVersion: erpCompletenessRulesVersion,
|
|
14761
|
+
completeMeaning: "complete=true \u4EC5\u8868\u793A\u5F53\u524D\u6CA1\u6709\u8D44\u6599\u5F85\u8865\u63D0\u793A\uFF0C\u4E0D\u8868\u793A\u5DF2\u6279\u51C6\u6216\u9501\u5B9A\u3002",
|
|
14762
|
+
evaluatedEntity: "\u5DE5\u4F5C\u6E05\u5355\u4E2D\u663E\u5F0F\u5305\u542B\u7684 ProductSpec",
|
|
14763
|
+
checks: [
|
|
14764
|
+
{ code: "MISSING_PACK_MAPPING", condition: "\u672A\u5173\u8054\u4EFB\u4F55 Pack" },
|
|
14765
|
+
{ code: "MINIMUM_PRODUCT_IMAGES_NOT_MET", condition: "\u6709\u6548\u4EA7\u54C1\u56FE\u7247\u5C11\u4E8E 3 \u5F20" },
|
|
14766
|
+
{ code: "MISSING_PRODUCT_SPEC_USER_MANUAL", condition: "\u672A\u5173\u8054\u4EFB\u4F55 UserManual" },
|
|
14767
|
+
{
|
|
14768
|
+
code: "USER_MANUAL_FILE_MISSING",
|
|
14769
|
+
condition: "\u5DF2\u5173\u8054 UserManual \u4E2D\u5B58\u5728\u7F3A\u5C11\u6709\u6548\u5F53\u524D PDF \u7684\u8BF4\u660E\u4E66"
|
|
14770
|
+
},
|
|
14771
|
+
{
|
|
14772
|
+
code: "MISSING_SUPPLIER_GROUP",
|
|
14773
|
+
condition: "Pack \u6620\u5C04\u6D89\u53CA\u7684 Supplier \u7F3A\u5C11\u4F9B\u5E94\u5546\u8D44\u6599\u7EC4"
|
|
14774
|
+
},
|
|
14775
|
+
{
|
|
14776
|
+
code: "STALE_SUPPLIER_GROUP",
|
|
14777
|
+
condition: "\u4F9B\u5E94\u5546\u8D44\u6599\u7EC4\u5DF2\u6CA1\u6709 ProductSpec\u2014Pack \u6620\u5C04\u652F\u6491"
|
|
14778
|
+
},
|
|
14779
|
+
{
|
|
14780
|
+
code: "MISSING_REQUIRED_FILE",
|
|
14781
|
+
condition: "\u7F3A\u5C11\u6709\u6548\u4E3B\u89C4\u683C\u4E66\uFF1BOEM \u8FD8\u8981\u6C42\u6709\u6548 2D \u56FE\u7EB8\u548C 3D \u6A21\u578B"
|
|
14782
|
+
},
|
|
14783
|
+
{
|
|
14784
|
+
code: "SEALED_SAMPLE_INCOMPLETE",
|
|
14785
|
+
condition: "\u5C01\u6837\u7ED3\u8BBA\u3001\u786E\u8BA4\u4EBA\u6216\u786E\u8BA4\u65E5\u671F\u4E0D\u5B8C\u6574"
|
|
14786
|
+
}
|
|
14787
|
+
],
|
|
14788
|
+
usage: "\u59CB\u7EC8\u4F7F\u7528\u7CFB\u7EDF\u8FD4\u56DE\u7684\u5B9E\u65F6\u7ED3\u679C\uFF1B\u6A21\u578B\u4E0D\u5F97\u6309\u5B57\u6BB5\u6570\u91CF\u81EA\u884C\u8BA1\u7B97\u3002"
|
|
14789
|
+
};
|
|
14790
|
+
var operationRecordsContent = {
|
|
14791
|
+
definition: "\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u76F8\u5173\u5BA1\u8BA1\u8BB0\u5F55\u7684\u7A33\u5B9A\u8BED\u4E49\u6295\u5F71\u3002",
|
|
14792
|
+
scope: "\u4EC5\u8FD4\u56DE\u6307\u5B9A DevelopmentWorkList \u7684\u521B\u5EFA\u3001\u6539\u540D\u53CA\u6E05\u5355\u6216\u4E3B\u6570\u636E\u8C03\u6574\u8BB0\u5F55\u3002",
|
|
14793
|
+
ordering: {
|
|
14794
|
+
direction: "NEWEST_FIRST",
|
|
14795
|
+
keys: ["occurredAt DESC", "id DESC"]
|
|
14796
|
+
},
|
|
14797
|
+
fields: [
|
|
14798
|
+
{ field: "id", semantics: "\u64CD\u4F5C\u8BB0\u5F55\u7684\u5185\u90E8\u6570\u5B57\u6807\u8BC6\u3002" },
|
|
14799
|
+
{ field: "type", semantics: "\u7A33\u5B9A\u64CD\u4F5C\u7C7B\u578B\uFF0C\u4F8B\u5982 TOPIC_CREATED\u3001TOPIC_RENAMED\u3002" },
|
|
14800
|
+
{ field: "occurredAt", semantics: "\u64CD\u4F5C\u53D1\u751F\u65F6\u95F4\uFF0CISO 8601 UTC \u65F6\u95F4\u6233\u3002" },
|
|
14801
|
+
{ field: "actor", semantics: "\u6267\u884C\u64CD\u4F5C\u7684\u8EAB\u4EFD\u53CA\u5F53\u524D\u53EF\u7528\u663E\u793A\u540D\u3002" },
|
|
14802
|
+
{ field: "summary", semantics: "\u9762\u5411\u7528\u6237\u7684\u64CD\u4F5C\u6458\u8981\u3002" },
|
|
14803
|
+
{ field: "details", semantics: "\u7A33\u5B9A\u7684\u8BED\u4E49\u5143\u6570\u636E\uFF0C\u4E0D\u662F\u5B8C\u6574\u6570\u636E\u5E93 before/after\u3002" }
|
|
14804
|
+
],
|
|
14805
|
+
pagination: "nextCursor \u662F\u4E0D\u900F\u660E\u6E38\u6807\uFF1B\u53EA\u5E94\u539F\u6837\u4F20\u56DE\u540C\u4E00\u67E5\u8BE2\uFF0C\u4E0D\u5F97\u89E3\u6790\u6216\u8DE8\u6E05\u5355\u590D\u7528\u3002"
|
|
14806
|
+
};
|
|
14807
|
+
var fieldSemanticsContent = {
|
|
14808
|
+
units: [
|
|
14809
|
+
{
|
|
14810
|
+
fields: "lengthCm\u3001widthCm\u3001heightCm\u3001fixedHeightCm\u3001minHeightCm\u3001maxHeightCm",
|
|
14811
|
+
unit: "cm"
|
|
14812
|
+
},
|
|
14813
|
+
{ fields: "netWeightKg\u3001grossWeightKg", unit: "kg" },
|
|
14814
|
+
{ fields: "ProductSpec\u2014Pack mapping quantity", unit: "\u5305\u88F9\u4EF6\u6570\uFF08\u6B63\u6574\u6570\uFF09" }
|
|
14815
|
+
],
|
|
14816
|
+
time: {
|
|
14817
|
+
timestamps: "createdAt\u3001updatedAt\u3001occurredAt \u4F7F\u7528 ISO 8601 UTC \u65F6\u95F4\u6233\u3002",
|
|
14818
|
+
dates: "confirmedAt \u662F ISO 8601 \u65E5\u5386\u65E5\u671F\uFF0C\u4E0D\u643A\u5E26\u65F6\u533A\u3002"
|
|
14819
|
+
},
|
|
14820
|
+
internalIds: "id\u3001productId\u3001packId\u3001workListId \u7B49\u6570\u5B57\u662F\u6570\u636E\u5E93\u5185\u90E8\u6807\u8BC6\uFF0C\u4E0D\u662F\u4E1A\u52A1\u7F16\u7801\u3002",
|
|
14821
|
+
nullSemantics: "null \u8868\u793A\u7CFB\u7EDF\u6CA1\u6709\u5DF2\u8BB0\u5F55\u503C\uFF1B\u5F53\u524D\u4E0D\u80FD\u8FDB\u4E00\u6B65\u533A\u5206 NOT_SET\u3001UNKNOWN\u3001NOT_APPLICABLE \u6216 REDACTED\u3002",
|
|
14822
|
+
money: "\u5F53\u524D MCP \u4E0E CLI \u5DF2\u5F00\u653E\u80FD\u529B\u672A\u8FD4\u56DE\u91D1\u989D\u6216\u5E01\u79CD\u5B57\u6BB5\u3002"
|
|
14823
|
+
};
|
|
14824
|
+
var changelogContent = {
|
|
14825
|
+
entries: [
|
|
14826
|
+
{
|
|
14827
|
+
version: erpDomainModelVersion,
|
|
14828
|
+
releasedAt: "2026-09-02",
|
|
14829
|
+
compatibility: "ADDITIVE",
|
|
14830
|
+
changes: [
|
|
14831
|
+
"CLI \u4E0E MCP \u5F00\u653E\u9996\u6279\u4EA7\u54C1\u4E3B\u6570\u636E\u548C\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u5199\u64CD\u4F5C\u3002",
|
|
14832
|
+
"\u589E\u52A0 erp:write\u3001\u4E50\u89C2\u5E76\u53D1\u3001\u5E42\u7B49\u952E\u548C\u7834\u574F\u6027\u64CD\u4F5C\u8BED\u4E49\u3002",
|
|
14833
|
+
"MCP \u4E0E CLI \u589E\u52A0 ProductSpec \u4EA7\u54C1\u56FE\u7247\u4E0A\u4F20\u80FD\u529B\u548C\u6587\u4EF6\u9886\u57DF\u4E3B\u9898\u3002"
|
|
14834
|
+
]
|
|
14835
|
+
},
|
|
14836
|
+
{
|
|
14837
|
+
version: "2026-09-01",
|
|
14838
|
+
releasedAt: "2026-09-01",
|
|
14839
|
+
compatibility: "ADDITIVE",
|
|
14840
|
+
changes: [
|
|
14841
|
+
"\u5EFA\u7ACB MCP \u4E0E CLI \u5171\u7528\u7684\u6E10\u8FDB\u5F0F\u9886\u57DF\u8BF4\u660E\u5165\u53E3\u3002",
|
|
14842
|
+
"\u516C\u5E03\u4EA7\u54C1\u4E3B\u6570\u636E\u3001\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u3001\u5B8C\u6574\u5EA6\u548C\u64CD\u4F5C\u8BB0\u5F55\u7684\u5F53\u524D\u8BED\u4E49\u3002",
|
|
14843
|
+
"\u516C\u5E03\u5F53\u524D\u53EA\u8BFB\u80FD\u529B\u3001\u4E1A\u52A1\u7F16\u7801\u3001\u5355\u4F4D\u3001\u65F6\u95F4\u4E0E\u7A7A\u503C\u8FB9\u754C\u3002"
|
|
14844
|
+
]
|
|
14845
|
+
}
|
|
14846
|
+
]
|
|
14847
|
+
};
|
|
14848
|
+
var erpDomainTopicContents = {
|
|
14849
|
+
OVERVIEW: overviewContent,
|
|
14850
|
+
PRODUCT_MASTER_DATA: productMasterDataContent,
|
|
14851
|
+
BUSINESS_CODE_SYSTEM: businessCodeSystemContent,
|
|
14852
|
+
FILES: filesContent,
|
|
14853
|
+
DEVELOPMENT_WORK_LIST: developmentWorkListContent,
|
|
14854
|
+
COMPLETENESS_RULES: completenessRulesContent,
|
|
14855
|
+
OPERATION_RECORDS: operationRecordsContent,
|
|
14856
|
+
FIELD_SEMANTICS: fieldSemanticsContent,
|
|
14857
|
+
CHANGELOG: changelogContent
|
|
14858
|
+
};
|
|
14859
|
+
function listErpDomainTopics() {
|
|
14860
|
+
return {
|
|
14861
|
+
domainModelVersion: erpDomainModelVersion,
|
|
14862
|
+
topics: erpDomainTopics
|
|
14863
|
+
};
|
|
14864
|
+
}
|
|
14865
|
+
function getErpDomainTopic(topic) {
|
|
14866
|
+
const metadata = erpDomainTopics.find((candidate) => candidate.topic === topic);
|
|
14867
|
+
if (!metadata)
|
|
14868
|
+
return void 0;
|
|
14869
|
+
const content = erpDomainTopicContents[metadata.topic];
|
|
14870
|
+
return {
|
|
14871
|
+
domainModelVersion: erpDomainModelVersion,
|
|
14872
|
+
...metadata,
|
|
14873
|
+
content
|
|
14874
|
+
};
|
|
14875
|
+
}
|
|
14876
|
+
|
|
14522
14877
|
// ../../packages/contracts/dist/operations.js
|
|
14878
|
+
var expectedVersionHeadersSchema = external_exports.object({
|
|
14879
|
+
expectedVersion: external_exports.coerce.number().int().positive().describe('\u4ECE\u6700\u65B0\u8BFB\u53D6\u7ED3\u679C\u53D6\u5F97\u7684 version\uFF1BCLI \u4F1A\u8F6C\u6362\u4E3A If-Match: "v{version}"\u3002')
|
|
14880
|
+
}).strict();
|
|
14881
|
+
var idempotencyKeyHeadersSchema = external_exports.object({
|
|
14882
|
+
idempotencyKey: external_exports.string().trim().min(16).max(128).regex(/^[\x21-\x7E]+$/).describe("\u672C\u6B21\u903B\u8F91\u547D\u4EE4\u7A33\u5B9A\u590D\u7528\u7684 16\uFF5E128 \u4F4D\u53EF\u6253\u5370 ASCII \u5E42\u7B49\u952E\u3002")
|
|
14883
|
+
}).strict();
|
|
14884
|
+
var commandHeadersSchema = expectedVersionHeadersSchema.extend(idempotencyKeyHeadersSchema.shape);
|
|
14523
14885
|
function defineReadOperation(definition) {
|
|
14524
14886
|
return definition;
|
|
14525
14887
|
}
|
|
14888
|
+
function defineWriteOperation(definition) {
|
|
14889
|
+
return definition;
|
|
14890
|
+
}
|
|
14526
14891
|
|
|
14527
14892
|
// ../../packages/contracts/dist/products/index.js
|
|
14528
|
-
var codeSchema = (prefix) => external_exports.string().trim().toUpperCase().regex(new RegExp(`^${prefix}\\d+$`)).max(32);
|
|
14529
|
-
var productCodeSchema = codeSchema("PR");
|
|
14530
|
-
var productSpecCodeSchema = codeSchema("PS");
|
|
14531
|
-
var packCodeSchema = codeSchema("PK");
|
|
14532
|
-
var
|
|
14533
|
-
var
|
|
14893
|
+
var codeSchema = (prefix, description) => external_exports.string().trim().toUpperCase().regex(new RegExp(`^${prefix}\\d+$`)).max(32).describe(description);
|
|
14894
|
+
var productCodeSchema = codeSchema("PR", "\u5B8C\u6574 ProductCode\uFF08PR \u4E1A\u52A1\u7F16\u7801\uFF09\uFF1APR \u5F00\u5934\uFF0C\u7528\u4E8E\u6807\u8BC6 Product\uFF1B\u4E0D\u662F\u6570\u636E\u5E93\u5185\u90E8 ID \u6216\u6E20\u9053 SKU\u3002");
|
|
14895
|
+
var productSpecCodeSchema = codeSchema("PS", "\u5B8C\u6574 ProductSpecCode\uFF08PS \u4E1A\u52A1\u7F16\u7801\uFF09\uFF1APS \u5F00\u5934\uFF0C\u7528\u4E8E\u6807\u8BC6 ProductSpec\uFF1B\u4E0D\u662F\u6570\u636E\u5E93\u5185\u90E8 ID \u6216\u6E20\u9053 SKU\u3002");
|
|
14896
|
+
var packCodeSchema = codeSchema("PK", "\u5B8C\u6574 PackCode\uFF08PK \u4E1A\u52A1\u7F16\u7801\uFF09\uFF1APK \u5F00\u5934\uFF0C\u7528\u4E8E\u6807\u8BC6 Pack\uFF1B\u4E0D\u662F\u6570\u636E\u5E93\u5185\u90E8 ID \u6216\u6E20\u9053 SKU\u3002");
|
|
14897
|
+
var internalIdSchema = external_exports.number().int().describe("\u6570\u636E\u5E93\u5185\u90E8\u6807\u8BC6\uFF0C\u4EC5\u7528\u4E8E\u5173\u8054\u5F53\u524D\u8FD4\u56DE\u7ED3\u6784\uFF1B\u4E0D\u662F PR\u3001PS\u3001PK \u7B49\u4E1A\u52A1\u7F16\u7801\u3002");
|
|
14898
|
+
var timestampSchema = external_exports.iso.datetime().describe("ISO 8601 UTC \u65F6\u95F4\u6233\u3002");
|
|
14899
|
+
var nullableCentimeterSchema = external_exports.number().finite().nullable().describe("\u5C3A\u5BF8\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u7CFB\u7EDF\u6CA1\u6709\u5DF2\u8BB0\u5F55\u503C\uFF0C\u5F53\u524D\u4E0D\u7EC6\u5206\u5177\u4F53\u7A7A\u503C\u539F\u56E0\u3002");
|
|
14900
|
+
var nullableKilogramSchema = external_exports.number().finite().nullable().describe("\u91CD\u91CF\uFF0C\u5355\u4F4D kg\uFF1Bnull \u8868\u793A\u7CFB\u7EDF\u6CA1\u6709\u5DF2\u8BB0\u5F55\u503C\uFF0C\u5F53\u524D\u4E0D\u7EC6\u5206\u5177\u4F53\u7A7A\u503C\u539F\u56E0\u3002");
|
|
14534
14901
|
var productSummarySchema = external_exports.object({
|
|
14535
|
-
id:
|
|
14902
|
+
id: internalIdSchema,
|
|
14536
14903
|
productCode: productCodeSchema,
|
|
14537
14904
|
name: external_exports.string(),
|
|
14538
14905
|
version: external_exports.number().int(),
|
|
@@ -14544,26 +14911,26 @@ var sealedSampleConclusionSchema = external_exports.object({
|
|
|
14544
14911
|
confirmedBy: external_exports.string(),
|
|
14545
14912
|
confirmedAt: external_exports.iso.date(),
|
|
14546
14913
|
references: external_exports.array(external_exports.object({
|
|
14547
|
-
id:
|
|
14914
|
+
id: internalIdSchema,
|
|
14548
14915
|
name: external_exports.string(),
|
|
14549
14916
|
version: external_exports.number().int(),
|
|
14550
14917
|
mediaType: external_exports.string().nullable()
|
|
14551
14918
|
}).strict())
|
|
14552
14919
|
}).strict().nullable();
|
|
14553
14920
|
var productSpecSummarySchema = external_exports.object({
|
|
14554
|
-
id:
|
|
14921
|
+
id: internalIdSchema,
|
|
14555
14922
|
productSpecCode: productSpecCodeSchema,
|
|
14556
|
-
productId:
|
|
14923
|
+
productId: internalIdSchema,
|
|
14557
14924
|
specName: external_exports.string(),
|
|
14558
14925
|
brand: external_exports.string().nullable(),
|
|
14559
14926
|
color: external_exports.string().nullable(),
|
|
14560
14927
|
salesMarketCodes: external_exports.array(external_exports.string()),
|
|
14561
|
-
lengthCm:
|
|
14562
|
-
widthCm:
|
|
14563
|
-
fixedHeightCm:
|
|
14564
|
-
minHeightCm:
|
|
14565
|
-
maxHeightCm:
|
|
14566
|
-
netWeightKg:
|
|
14928
|
+
lengthCm: nullableCentimeterSchema,
|
|
14929
|
+
widthCm: nullableCentimeterSchema,
|
|
14930
|
+
fixedHeightCm: nullableCentimeterSchema,
|
|
14931
|
+
minHeightCm: nullableCentimeterSchema,
|
|
14932
|
+
maxHeightCm: nullableCentimeterSchema,
|
|
14933
|
+
netWeightKg: nullableKilogramSchema,
|
|
14567
14934
|
categorySpec: external_exports.unknown().nullable(),
|
|
14568
14935
|
categorySpecSchema: external_exports.string().nullable(),
|
|
14569
14936
|
version: external_exports.number().int(),
|
|
@@ -14571,24 +14938,29 @@ var productSpecSummarySchema = external_exports.object({
|
|
|
14571
14938
|
updatedAt: timestampSchema,
|
|
14572
14939
|
sealedSampleConclusion: sealedSampleConclusionSchema,
|
|
14573
14940
|
packMappings: external_exports.array(external_exports.object({
|
|
14574
|
-
packId:
|
|
14941
|
+
packId: internalIdSchema,
|
|
14575
14942
|
packCode: packCodeSchema,
|
|
14576
14943
|
quantity: external_exports.number().int()
|
|
14577
14944
|
}).strict()),
|
|
14578
14945
|
supplierCodes: external_exports.array(external_exports.string())
|
|
14579
14946
|
}).strict();
|
|
14947
|
+
var productSpecRecordSchema = productSpecSummarySchema.omit({
|
|
14948
|
+
sealedSampleConclusion: true,
|
|
14949
|
+
packMappings: true,
|
|
14950
|
+
supplierCodes: true
|
|
14951
|
+
});
|
|
14580
14952
|
var packSummarySchema = external_exports.object({
|
|
14581
|
-
id:
|
|
14953
|
+
id: internalIdSchema,
|
|
14582
14954
|
packCode: packCodeSchema,
|
|
14583
14955
|
name: external_exports.string(),
|
|
14584
14956
|
supplierCode: external_exports.string(),
|
|
14585
14957
|
supplierName: external_exports.string(),
|
|
14586
14958
|
contents: external_exports.unknown().nullable(),
|
|
14587
|
-
lengthCm:
|
|
14588
|
-
widthCm:
|
|
14589
|
-
heightCm:
|
|
14590
|
-
grossWeightKg:
|
|
14591
|
-
netWeightKg:
|
|
14959
|
+
lengthCm: nullableCentimeterSchema,
|
|
14960
|
+
widthCm: nullableCentimeterSchema,
|
|
14961
|
+
heightCm: nullableCentimeterSchema,
|
|
14962
|
+
grossWeightKg: nullableKilogramSchema,
|
|
14963
|
+
netWeightKg: nullableKilogramSchema,
|
|
14592
14964
|
packagingPlan: external_exports.string().nullable(),
|
|
14593
14965
|
permanentCartonMark: external_exports.string().nullable(),
|
|
14594
14966
|
version: external_exports.number().int(),
|
|
@@ -14601,11 +14973,11 @@ var searchProductsResponseSchema = external_exports.object({
|
|
|
14601
14973
|
productSpecs: external_exports.array(productSpecSummarySchema),
|
|
14602
14974
|
packs: external_exports.array(packSummarySchema),
|
|
14603
14975
|
supplierGroups: external_exports.array(external_exports.object({
|
|
14604
|
-
productSpecId:
|
|
14976
|
+
productSpecId: internalIdSchema,
|
|
14605
14977
|
productSpecCode: productSpecCodeSchema,
|
|
14606
14978
|
supplierCode: external_exports.string(),
|
|
14607
14979
|
supplierName: external_exports.string(),
|
|
14608
|
-
packIds: external_exports.array(
|
|
14980
|
+
packIds: external_exports.array(internalIdSchema),
|
|
14609
14981
|
packCodes: external_exports.array(packCodeSchema)
|
|
14610
14982
|
}).strict()),
|
|
14611
14983
|
matches: external_exports.array(external_exports.object({
|
|
@@ -14620,11 +14992,11 @@ var searchProductsResponseSchema = external_exports.object({
|
|
|
14620
14992
|
total: external_exports.number().int()
|
|
14621
14993
|
}).strict();
|
|
14622
14994
|
var supplierGroupSchema = external_exports.object({
|
|
14623
|
-
productSpecId:
|
|
14995
|
+
productSpecId: internalIdSchema,
|
|
14624
14996
|
productSpecCode: productSpecCodeSchema,
|
|
14625
14997
|
supplierCode: external_exports.string(),
|
|
14626
14998
|
supplierName: external_exports.string(),
|
|
14627
|
-
packIds: external_exports.array(
|
|
14999
|
+
packIds: external_exports.array(internalIdSchema),
|
|
14628
15000
|
packCodes: external_exports.array(packCodeSchema)
|
|
14629
15001
|
}).strict();
|
|
14630
15002
|
var productPathSchema = external_exports.object({ productCode: productCodeSchema }).strict();
|
|
@@ -14652,14 +15024,16 @@ var searchProductsOperation = defineReadOperation({
|
|
|
14652
15024
|
operationId: "searchProducts",
|
|
14653
15025
|
method: "GET",
|
|
14654
15026
|
path: "/api/v1/products/search",
|
|
14655
|
-
summary: "
|
|
15027
|
+
summary: "\u641C\u7D22\u4EA7\u54C1\u4E3B\u6570\u636E\u5019\u9009\u53CA\u5173\u7CFB",
|
|
15028
|
+
description: "\u5F53\u7528\u6237\u4E0D\u77E5\u9053\u5B8C\u6574\u4E1A\u52A1\u7F16\u7801\u65F6\uFF0C\u6309 Product \u540D\u79F0\u3001ProductSpec \u89C4\u683C\u540D\u3001Pack \u540D\u79F0\u3001Supplier \u7F16\u7801\u6216\u540D\u79F0\u641C\u7D22\u5019\u9009\uFF1B\u5B8C\u6574 PR\u3001PS\u3001PK \u4E5F\u53EF\u7CBE\u786E\u547D\u4E2D\u3002\u5F53\u524D\u4E0D\u652F\u6301\u90E8\u5206\u4E1A\u52A1\u7F16\u7801\u3002\u8FD4\u56DE\u5019\u9009\u53CA\u76F8\u5173\u5B9E\u65F6\u4E3B\u6570\u636E\u5173\u7CFB\uFF0C\u591A\u4E2A\u5019\u9009\u65F6\u9700\u7531\u7528\u6237\u786E\u8BA4\uFF0C\u4E0D\u5F97\u9ED8\u8BA4\u7B2C\u4E00\u6761\u3002\u53EA\u8BFB\u5E76\u8981\u6C42 erp:read\u3002",
|
|
14656
15029
|
scope: "erp:read",
|
|
14657
15030
|
agentReadOnly: true,
|
|
15031
|
+
agent: { exposed: true, readOnly: true, destructive: false, idempotent: true },
|
|
14658
15032
|
request: {
|
|
14659
15033
|
query: external_exports.object({
|
|
14660
|
-
q: external_exports.string().trim().max(160).default(""),
|
|
14661
|
-
cursor: external_exports.string().trim().min(1).max(1024).optional(),
|
|
14662
|
-
limit: external_exports.coerce.number().int().min(1).max(50).default(20)
|
|
15034
|
+
q: external_exports.string().trim().max(160).default("").describe("\u641C\u7D22\u8BCD\u3002\u652F\u6301\u5B8C\u6574 PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u7CBE\u786E\u547D\u4E2D\uFF0C\u4EE5\u53CA Product \u540D\u79F0\u3001ProductSpec \u89C4\u683C\u540D\u3001Pack \u540D\u79F0\u3001Supplier \u7F16\u7801\u6216\u540D\u79F0\u7684\u5305\u542B\u5339\u914D\uFF1B\u4E0D\u652F\u6301\u90E8\u5206\u4E1A\u52A1\u7F16\u7801\u3002\u7A7A\u5B57\u7B26\u4E32\u8FD4\u56DE\u7B2C\u4E00\u9875\u3002"),
|
|
15035
|
+
cursor: external_exports.string().trim().min(1).max(1024).optional().describe("\u4E0A\u4E00\u9875\u8FD4\u56DE\u7684\u4E0D\u900F\u660E\u5206\u9875\u6E38\u6807\uFF1B\u53EA\u53EF\u539F\u6837\u7528\u4E8E\u540C\u4E00\u641C\u7D22\u8BCD\uFF0C\u4E0D\u5F97\u89E3\u6790\u6216\u8DE8\u67E5\u8BE2\u590D\u7528\u3002"),
|
|
15036
|
+
limit: external_exports.coerce.number().int().min(1).max(50).default(20).describe("\u672C\u9875\u6700\u591A\u8FD4\u56DE\u7684\u5019\u9009\u5BF9\u8C61\u6570\uFF0C\u8303\u56F4 1\uFF5E50\uFF0C\u9ED8\u8BA4 20\u3002")
|
|
14663
15037
|
}).strict()
|
|
14664
15038
|
},
|
|
14665
15039
|
response: { data: searchProductsResponseSchema },
|
|
@@ -14669,9 +15043,11 @@ var getProductOperation = defineReadOperation({
|
|
|
14669
15043
|
operationId: "getProduct",
|
|
14670
15044
|
method: "GET",
|
|
14671
15045
|
path: "/api/v1/products/{productCode}",
|
|
14672
|
-
summary: "
|
|
15046
|
+
summary: "\u6309 PR \u4E1A\u52A1\u7F16\u7801\u8BFB\u53D6 Product \u5173\u7CFB",
|
|
15047
|
+
description: "\u6839\u636E\u5B8C\u6574 ProductCode\uFF08PR \u4E1A\u52A1\u7F16\u7801\uFF09\u8BFB\u53D6\u4E00\u4E2A Product\u3001\u5176 ProductSpec\u3001\u76F8\u5173 Pack \u4E0E Supplier \u5206\u7EC4\u3002\u4E0D\u53EF\u7528\u4E8E\u540D\u79F0\u3001PS\u3001PK \u6216\u4E0D\u5B8C\u6574\u7F16\u7801\u641C\u7D22\u3002\u53EA\u8BFB\u5E76\u8981\u6C42 erp:read\uFF1B\u4E0D\u5B58\u5728\u65F6\u8FD4\u56DE NOT_FOUND\u3002",
|
|
14673
15048
|
scope: "erp:read",
|
|
14674
15049
|
agentReadOnly: true,
|
|
15050
|
+
agent: { exposed: true, readOnly: true, destructive: false, idempotent: true },
|
|
14675
15051
|
request: { path: productPathSchema },
|
|
14676
15052
|
response: { data: getProductResponseSchema },
|
|
14677
15053
|
cli: { path: ["products", "get"] }
|
|
@@ -14680,9 +15056,11 @@ var getProductSpecOperation = defineReadOperation({
|
|
|
14680
15056
|
operationId: "getProductSpec",
|
|
14681
15057
|
method: "GET",
|
|
14682
15058
|
path: "/api/v1/product-specs/{productSpecCode}",
|
|
14683
|
-
summary: "
|
|
15059
|
+
summary: "\u6309 PS \u4E1A\u52A1\u7F16\u7801\u8BFB\u53D6 ProductSpec \u5173\u7CFB",
|
|
15060
|
+
description: "\u6839\u636E\u5B8C\u6574 ProductSpecCode\uFF08PS \u4E1A\u52A1\u7F16\u7801\uFF09\u8BFB\u53D6\u76EE\u6807 ProductSpec\u3001\u6240\u5C5E Product\u3001\u76F8\u5173 Pack \u4E0E Supplier \u5206\u7EC4\u3002\u4E0D\u53EF\u7528\u4E8E\u540D\u79F0\u3001PR\u3001PK \u6216\u4E0D\u5B8C\u6574\u7F16\u7801\u641C\u7D22\u3002\u53EA\u8BFB\u5E76\u8981\u6C42 erp:read\uFF1B\u4E0D\u5B58\u5728\u65F6\u8FD4\u56DE NOT_FOUND\u3002",
|
|
14684
15061
|
scope: "erp:read",
|
|
14685
15062
|
agentReadOnly: true,
|
|
15063
|
+
agent: { exposed: true, readOnly: true, destructive: false, idempotent: true },
|
|
14686
15064
|
request: { path: productSpecPathSchema },
|
|
14687
15065
|
response: { data: getProductSpecResponseSchema },
|
|
14688
15066
|
cli: { path: ["product-specs", "get"] }
|
|
@@ -14691,24 +15069,261 @@ var getPackOperation = defineReadOperation({
|
|
|
14691
15069
|
operationId: "getPack",
|
|
14692
15070
|
method: "GET",
|
|
14693
15071
|
path: "/api/v1/packs/{packCode}",
|
|
14694
|
-
summary: "
|
|
15072
|
+
summary: "\u6309 PK \u4E1A\u52A1\u7F16\u7801\u8BFB\u53D6 Pack \u5F15\u7528\u5173\u7CFB",
|
|
15073
|
+
description: "\u6839\u636E\u5B8C\u6574 PackCode\uFF08PK \u4E1A\u52A1\u7F16\u7801\uFF09\u8BFB\u53D6\u76EE\u6807 Pack\uFF0C\u4EE5\u53CA\u5F15\u7528\u5B83\u7684 ProductSpec\u3001Product \u4E0E Supplier \u5206\u7EC4\u3002\u4E0D\u53EF\u7528\u4E8E\u540D\u79F0\u3001PR\u3001PS \u6216\u4E0D\u5B8C\u6574\u7F16\u7801\u641C\u7D22\u3002\u53EA\u8BFB\u5E76\u8981\u6C42 erp:read\uFF1B\u4E0D\u5B58\u5728\u65F6\u8FD4\u56DE NOT_FOUND\u3002",
|
|
14695
15074
|
scope: "erp:read",
|
|
14696
15075
|
agentReadOnly: true,
|
|
15076
|
+
agent: { exposed: true, readOnly: true, destructive: false, idempotent: true },
|
|
14697
15077
|
request: { path: packPathSchema },
|
|
14698
15078
|
response: { data: getPackResponseSchema },
|
|
14699
15079
|
cli: { path: ["packs", "get"] }
|
|
14700
15080
|
});
|
|
15081
|
+
var initialProductSpecInputSchema = external_exports.object({
|
|
15082
|
+
specName: external_exports.string().trim().min(1).max(255).optional().describe("\u9996\u4E2A ProductSpec \u7684\u663E\u793A\u540D\u79F0\uFF1B\u7701\u7565\u65F6\u4F7F\u7528 Product \u540D\u79F0\u3002"),
|
|
15083
|
+
brand: external_exports.enum(["intoNear", "intoNir"]).optional().describe("\u53D7\u63A7\u54C1\u724C\u679A\u4E3E\u3002"),
|
|
15084
|
+
color: external_exports.string().trim().min(1).max(120).optional().describe("\u989C\u8272\u63CF\u8FF0\u3002"),
|
|
15085
|
+
salesMarketCodes: external_exports.array(external_exports.enum(["\u7F8E\u56FD", "\u5370\u5EA6", "\u6B27\u76DF", "\u82F1\u56FD"])).min(1).max(4).optional().describe("\u9500\u552E\u5E02\u573A\u4E2D\u6587\u679A\u4E3E\u96C6\u5408\u3002"),
|
|
15086
|
+
lengthCm: external_exports.number().finite().positive().nullable().optional().describe("\u957F\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15087
|
+
widthCm: external_exports.number().finite().positive().nullable().optional().describe("\u5BBD\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15088
|
+
fixedHeightCm: external_exports.number().finite().positive().nullable().optional().describe("\u56FA\u5B9A\u9AD8\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15089
|
+
minHeightCm: external_exports.number().finite().positive().nullable().optional().describe("\u6700\u5C0F\u9AD8\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15090
|
+
maxHeightCm: external_exports.number().finite().positive().nullable().optional().describe("\u6700\u5927\u9AD8\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15091
|
+
netWeightKg: external_exports.number().finite().positive().nullable().optional().describe("\u51C0\u91CD\uFF0C\u5355\u4F4D kg\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002")
|
|
15092
|
+
}).strict();
|
|
15093
|
+
var createProductInputSchema = external_exports.object({
|
|
15094
|
+
name: external_exports.string().trim().min(1).max(255).describe("Product \u9762\u5411\u7528\u6237\u663E\u793A\u7684\u540D\u79F0\u3002"),
|
|
15095
|
+
initialSpec: initialProductSpecInputSchema.optional().describe("\u53EF\u9009\u7684\u9996\u4E2A ProductSpec \u5B57\u6BB5\uFF1B\u7CFB\u7EDF\u59CB\u7EC8\u4F1A\u540C\u65F6\u521B\u5EFA\u9996\u4E2A ProductSpec\u3002")
|
|
15096
|
+
}).strict();
|
|
15097
|
+
var createProductResponseSchema = external_exports.object({ product: productSummarySchema, productSpec: productSpecRecordSchema }).strict();
|
|
15098
|
+
var createProductOperation = defineWriteOperation({
|
|
15099
|
+
operationId: "createProduct",
|
|
15100
|
+
method: "POST",
|
|
15101
|
+
path: "/api/v1/products",
|
|
15102
|
+
summary: "\u521B\u5EFA Product \u53CA\u9996\u4E2A ProductSpec",
|
|
15103
|
+
description: "\u521B\u5EFA\u4E00\u4E2A Product\uFF0C\u5E76\u7531\u7CFB\u7EDF\u751F\u6210\u4E0D\u53EF\u53D8 PR \u4E1A\u52A1\u7F16\u7801\uFF1B\u540C\u4E00\u4E8B\u52A1\u5185\u59CB\u7EC8\u521B\u5EFA\u9996\u4E2A ProductSpec \u5E76\u751F\u6210 PS \u4E1A\u52A1\u7F16\u7801\u3002\u9002\u7528\u4E8E\u65B0\u5EFA\u4EA7\u54C1\u65CF\uFF0C\u4E0D\u9002\u7528\u4E8E\u7ED9\u73B0\u6709 Product \u589E\u52A0\u89C4\u683C\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15104
|
+
scope: "erp:write",
|
|
15105
|
+
agent: { exposed: true, readOnly: false, destructive: false, idempotent: false },
|
|
15106
|
+
request: { body: createProductInputSchema },
|
|
15107
|
+
response: { data: createProductResponseSchema, status: 201 },
|
|
15108
|
+
cli: { path: ["products", "create"] }
|
|
15109
|
+
});
|
|
15110
|
+
var atLeastOneField = (value) => Object.values(value).some((item) => item !== void 0);
|
|
15111
|
+
var updateProductInputSchema = external_exports.object({ name: external_exports.string().trim().min(1).max(255).optional() }).strict().refine(atLeastOneField, "\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u53EF\u7F16\u8F91\u7684 Product \u5B57\u6BB5\u3002");
|
|
15112
|
+
var updateProductSpecInputSchema = external_exports.object({
|
|
15113
|
+
brand: external_exports.enum(["intoNear", "intoNir"]).optional().describe("\u53D7\u63A7\u54C1\u724C\u679A\u4E3E\u3002"),
|
|
15114
|
+
color: external_exports.string().trim().min(1).max(120).optional().describe("\u989C\u8272\u63CF\u8FF0\u3002"),
|
|
15115
|
+
salesMarketCodes: external_exports.array(external_exports.enum(["\u7F8E\u56FD", "\u5370\u5EA6", "\u6B27\u76DF", "\u82F1\u56FD"])).min(1).max(4).optional().describe("\u9500\u552E\u5E02\u573A\u4E2D\u6587\u679A\u4E3E\u96C6\u5408\u3002"),
|
|
15116
|
+
lengthCm: external_exports.number().finite().positive().nullable().optional().describe("\u957F\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15117
|
+
widthCm: external_exports.number().finite().positive().nullable().optional().describe("\u5BBD\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15118
|
+
fixedHeightCm: external_exports.number().finite().positive().nullable().optional().describe("\u56FA\u5B9A\u9AD8\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15119
|
+
minHeightCm: external_exports.number().finite().positive().nullable().optional().describe("\u6700\u5C0F\u9AD8\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15120
|
+
maxHeightCm: external_exports.number().finite().positive().nullable().optional().describe("\u6700\u5927\u9AD8\u5EA6\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15121
|
+
netWeightKg: external_exports.number().finite().positive().nullable().optional().describe("\u51C0\u91CD\uFF0C\u5355\u4F4D kg\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15122
|
+
categorySpec: external_exports.unknown().nullable().optional().describe("\u7531 categorySpecSchema \u6807\u8BC6\u7ED3\u6784\u7684\u54C1\u7C7B\u89C4\u683C\u5BF9\u8C61\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15123
|
+
categorySpecSchema: external_exports.string().trim().min(1).max(120).nullable().optional().describe("categorySpec \u4F7F\u7528\u7684\u7ED3\u6784\u7248\u672C\u6807\u8BC6\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002")
|
|
15124
|
+
}).strict().refine(atLeastOneField, "\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u53EF\u7F16\u8F91\u7684 ProductSpec \u5B57\u6BB5\u3002");
|
|
15125
|
+
var optionalCentimeter = external_exports.number().finite().positive().nullable().optional().describe("\u5C3A\u5BF8\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002");
|
|
15126
|
+
var optionalKilogram = external_exports.number().finite().positive().nullable().optional().describe("\u91CD\u91CF\uFF0C\u5355\u4F4D kg\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002");
|
|
15127
|
+
var optionalLongText = external_exports.string().trim().min(1).max(1e4).nullable().optional();
|
|
15128
|
+
var packInputFields = {
|
|
15129
|
+
name: external_exports.string().trim().min(1).max(255).describe("Pack \u9762\u5411\u7528\u6237\u663E\u793A\u7684\u540D\u79F0\u3002"),
|
|
15130
|
+
supplierCode: external_exports.string().trim().min(1).max(32).toUpperCase().describe("\u7CFB\u7EDF\u4E2D\u5DF2\u5B58\u5728\u7684\u53D7\u63A7 SupplierCode\u3002"),
|
|
15131
|
+
contents: external_exports.unknown().nullable().optional().describe("\u5305\u88F9\u5185\u5BB9\u7ED3\u6784\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15132
|
+
lengthCm: optionalCentimeter,
|
|
15133
|
+
widthCm: optionalCentimeter,
|
|
15134
|
+
heightCm: optionalCentimeter,
|
|
15135
|
+
grossWeightKg: optionalKilogram,
|
|
15136
|
+
netWeightKg: optionalKilogram,
|
|
15137
|
+
packagingPlan: optionalLongText.describe("\u5305\u88C5\u65B9\u6848\u6587\u672C\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002"),
|
|
15138
|
+
permanentCartonMark: optionalLongText.describe("\u6C38\u4E45\u7BB1\u551B\u6587\u672C\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u3002")
|
|
15139
|
+
};
|
|
15140
|
+
var createPackInputSchema = external_exports.object(packInputFields).strict();
|
|
15141
|
+
var updatePackInputSchema = external_exports.object({
|
|
15142
|
+
name: packInputFields.name.optional(),
|
|
15143
|
+
supplierCode: packInputFields.supplierCode.optional(),
|
|
15144
|
+
contents: packInputFields.contents,
|
|
15145
|
+
lengthCm: packInputFields.lengthCm,
|
|
15146
|
+
widthCm: packInputFields.widthCm,
|
|
15147
|
+
heightCm: packInputFields.heightCm,
|
|
15148
|
+
grossWeightKg: packInputFields.grossWeightKg,
|
|
15149
|
+
netWeightKg: packInputFields.netWeightKg,
|
|
15150
|
+
packagingPlan: packInputFields.packagingPlan,
|
|
15151
|
+
permanentCartonMark: packInputFields.permanentCartonMark
|
|
15152
|
+
}).strict().refine(atLeastOneField, "\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u53EF\u7F16\u8F91\u7684 Pack \u5B57\u6BB5\u3002");
|
|
15153
|
+
var createMappingInputSchema = external_exports.object({ packCode: packCodeSchema, quantity: external_exports.number().int().positive() }).strict();
|
|
15154
|
+
var updateMappingInputSchema = external_exports.object({ quantity: external_exports.number().int().positive() }).strict();
|
|
15155
|
+
var mappingResponseSchema = external_exports.object({
|
|
15156
|
+
productSpecCode: productSpecCodeSchema,
|
|
15157
|
+
packCode: packCodeSchema,
|
|
15158
|
+
quantity: external_exports.number().int().positive()
|
|
15159
|
+
}).strict();
|
|
15160
|
+
var deleteMappingResponseSchema = external_exports.object({
|
|
15161
|
+
deleted: external_exports.literal(true),
|
|
15162
|
+
productSpecCode: productSpecCodeSchema,
|
|
15163
|
+
packCode: packCodeSchema
|
|
15164
|
+
}).strict();
|
|
15165
|
+
var productSpecImageSchema = external_exports.object({
|
|
15166
|
+
fileVersionId: internalIdSchema,
|
|
15167
|
+
fileName: external_exports.string().describe("\u9762\u5411\u7528\u6237\u663E\u793A\u7684\u539F\u59CB\u6587\u4EF6\u540D\u3002"),
|
|
15168
|
+
mediaType: external_exports.enum(["image/jpeg", "image/png", "image/webp"]).describe("\u670D\u52A1\u7AEF\u6821\u9A8C\u540E\u7684\u56FE\u7247\u5A92\u4F53\u7C7B\u578B\u3002"),
|
|
15169
|
+
sizeBytes: external_exports.number().int().nonnegative().nullable().describe("\u6587\u4EF6\u5927\u5C0F\uFF0C\u5355\u4F4D byte\uFF1Bnull \u8868\u793A\u5386\u53F2\u6587\u4EF6\u672A\u8BB0\u5F55\u5927\u5C0F\u3002"),
|
|
15170
|
+
version: external_exports.number().int().positive().describe("\u4E0D\u53EF\u53D8 FileVersion \u7684\u7248\u672C\u53F7\u3002"),
|
|
15171
|
+
createdAt: timestampSchema
|
|
15172
|
+
}).strict();
|
|
15173
|
+
var addProductSpecImageResponseSchema = external_exports.object({
|
|
15174
|
+
productSpecCode: productSpecCodeSchema,
|
|
15175
|
+
image: productSpecImageSchema,
|
|
15176
|
+
images: external_exports.array(productSpecImageSchema).describe("\u5B8C\u6210\u672C\u6B21\u64CD\u4F5C\u540E\uFF0C\u8BE5 ProductSpec \u5F53\u524D\u5173\u8054\u7684\u5168\u90E8\u4EA7\u54C1\u56FE\u7247\u3002")
|
|
15177
|
+
}).strict();
|
|
15178
|
+
var writeAgent = {
|
|
15179
|
+
exposed: true,
|
|
15180
|
+
readOnly: false,
|
|
15181
|
+
destructive: false,
|
|
15182
|
+
idempotent: false
|
|
15183
|
+
};
|
|
15184
|
+
var destructiveWriteAgent = { ...writeAgent, destructive: true };
|
|
15185
|
+
var updateProductOperation = defineWriteOperation({
|
|
15186
|
+
operationId: "updateProduct",
|
|
15187
|
+
method: "PATCH",
|
|
15188
|
+
path: "/api/v1/products/{productCode}",
|
|
15189
|
+
summary: "\u6309 PR \u66F4\u65B0 Product",
|
|
15190
|
+
description: "\u66F4\u65B0\u5DF2\u5B58\u5728 Product \u7684\u53EF\u7F16\u8F91\u5B57\u6BB5\u3002\u5148\u8BFB\u53D6\u6700\u65B0 Product \u53D6\u5F97 version\uFF1B\u7248\u672C\u51B2\u7A81\u65F6\u91CD\u65B0\u8BFB\u53D6\u5E76\u7531\u7528\u6237\u51B3\u5B9A\uFF0C\u4E0D\u5F97\u81EA\u52A8\u8986\u76D6\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15191
|
+
scope: "erp:write",
|
|
15192
|
+
agent: writeAgent,
|
|
15193
|
+
request: {
|
|
15194
|
+
path: productPathSchema,
|
|
15195
|
+
headers: expectedVersionHeadersSchema,
|
|
15196
|
+
body: updateProductInputSchema
|
|
15197
|
+
},
|
|
15198
|
+
response: { data: productSummarySchema },
|
|
15199
|
+
cli: { path: ["products", "update"] }
|
|
15200
|
+
});
|
|
15201
|
+
var updateProductSpecOperation = defineWriteOperation({
|
|
15202
|
+
operationId: "updateProductSpec",
|
|
15203
|
+
method: "PATCH",
|
|
15204
|
+
path: "/api/v1/product-specs/{productSpecCode}",
|
|
15205
|
+
summary: "\u6309 PS \u66F4\u65B0 ProductSpec",
|
|
15206
|
+
description: "\u66F4\u65B0\u5DF2\u5B58\u5728 ProductSpec \u7684\u7ED3\u6784\u5316\u5B57\u6BB5\u3002\u5148\u8BFB\u53D6\u6700\u65B0 ProductSpec \u53D6\u5F97 version\uFF1Bnull \u8868\u793A\u6E05\u7A7A\u53EF\u7A7A\u5B57\u6BB5\u3002\u7248\u672C\u51B2\u7A81\u4E0D\u5F97\u81EA\u52A8\u8986\u76D6\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15207
|
+
scope: "erp:write",
|
|
15208
|
+
agent: writeAgent,
|
|
15209
|
+
request: {
|
|
15210
|
+
path: productSpecPathSchema,
|
|
15211
|
+
headers: expectedVersionHeadersSchema,
|
|
15212
|
+
body: updateProductSpecInputSchema
|
|
15213
|
+
},
|
|
15214
|
+
response: { data: productSpecRecordSchema },
|
|
15215
|
+
cli: { path: ["product-specs", "update"] }
|
|
15216
|
+
});
|
|
15217
|
+
var createPackOperation = defineWriteOperation({
|
|
15218
|
+
operationId: "createPack",
|
|
15219
|
+
method: "POST",
|
|
15220
|
+
path: "/api/v1/packs",
|
|
15221
|
+
summary: "\u521B\u5EFA Pack",
|
|
15222
|
+
description: "\u4E3A\u7CFB\u7EDF\u4E2D\u5DF2\u5B58\u5728\u7684\u53D7\u63A7 Supplier \u521B\u5EFA Pack\uFF0C\u7CFB\u7EDF\u751F\u6210\u4E0D\u53EF\u53D8 PK \u4E1A\u52A1\u7F16\u7801\u3002Supplier \u4E0D\u5B58\u5728\u65F6\u4E0D\u4F1A\u521B\u5EFA\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15223
|
+
scope: "erp:write",
|
|
15224
|
+
agent: writeAgent,
|
|
15225
|
+
request: { body: createPackInputSchema },
|
|
15226
|
+
response: { data: packSummarySchema, status: 201 },
|
|
15227
|
+
cli: { path: ["packs", "create"] }
|
|
15228
|
+
});
|
|
15229
|
+
var updatePackOperation = defineWriteOperation({
|
|
15230
|
+
operationId: "updatePack",
|
|
15231
|
+
method: "PATCH",
|
|
15232
|
+
path: "/api/v1/packs/{packCode}",
|
|
15233
|
+
summary: "\u6309 PK \u66F4\u65B0 Pack",
|
|
15234
|
+
description: "\u66F4\u65B0 Pack \u5B57\u6BB5\u6216\u53D7\u63A7 Supplier \u5F52\u5C5E\u3002\u5148\u8BFB\u53D6\u6700\u65B0 Pack \u53D6\u5F97 version\uFF1B\u7248\u672C\u51B2\u7A81\u4E0D\u5F97\u81EA\u52A8\u8986\u76D6\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15235
|
+
scope: "erp:write",
|
|
15236
|
+
agent: writeAgent,
|
|
15237
|
+
request: {
|
|
15238
|
+
path: packPathSchema,
|
|
15239
|
+
headers: expectedVersionHeadersSchema,
|
|
15240
|
+
body: updatePackInputSchema
|
|
15241
|
+
},
|
|
15242
|
+
response: { data: packSummarySchema },
|
|
15243
|
+
cli: { path: ["packs", "update"] }
|
|
15244
|
+
});
|
|
15245
|
+
var createProductSpecPackMappingOperation = defineWriteOperation({
|
|
15246
|
+
operationId: "createProductSpecPackMapping",
|
|
15247
|
+
method: "POST",
|
|
15248
|
+
path: "/api/v1/product-specs/{productSpecCode}/mappings",
|
|
15249
|
+
summary: "\u5173\u8054 ProductSpec \u4E0E Pack",
|
|
15250
|
+
description: "\u7ED9 ProductSpec \u589E\u52A0\u4E00\u4E2A\u5E26\u6B63\u6574\u6570 quantity \u7684 Pack \u6620\u5C04\uFF1B\u540C\u4E00 Pack \u4E0D\u53EF\u91CD\u590D\u5173\u8054\u3002expectedVersion \u662F ProductSpec \u7684\u6700\u65B0 version\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15251
|
+
scope: "erp:write",
|
|
15252
|
+
agent: writeAgent,
|
|
15253
|
+
request: {
|
|
15254
|
+
path: productSpecPathSchema,
|
|
15255
|
+
headers: expectedVersionHeadersSchema,
|
|
15256
|
+
body: createMappingInputSchema
|
|
15257
|
+
},
|
|
15258
|
+
response: { data: mappingResponseSchema, status: 201 },
|
|
15259
|
+
cli: { path: ["product-specs", "add-pack"] }
|
|
15260
|
+
});
|
|
15261
|
+
var mappingPathSchema = productSpecPathSchema.extend({ packCode: packCodeSchema }).strict();
|
|
15262
|
+
var updateProductSpecPackMappingOperation = defineWriteOperation({
|
|
15263
|
+
operationId: "updateProductSpecPackMapping",
|
|
15264
|
+
method: "PATCH",
|
|
15265
|
+
path: "/api/v1/product-specs/{productSpecCode}/mappings/{packCode}",
|
|
15266
|
+
summary: "\u66F4\u65B0 ProductSpec\u2014Pack \u6570\u91CF",
|
|
15267
|
+
description: "\u4FEE\u6539\u5DF2\u5B58\u5728 ProductSpec\u2014Pack \u6620\u5C04\u7684\u6B63\u6574\u6570 quantity\u3002expectedVersion \u662F ProductSpec \u7684\u6700\u65B0 version\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15268
|
+
scope: "erp:write",
|
|
15269
|
+
agent: writeAgent,
|
|
15270
|
+
request: {
|
|
15271
|
+
path: mappingPathSchema,
|
|
15272
|
+
headers: expectedVersionHeadersSchema,
|
|
15273
|
+
body: updateMappingInputSchema
|
|
15274
|
+
},
|
|
15275
|
+
response: { data: mappingResponseSchema },
|
|
15276
|
+
cli: { path: ["product-specs", "update-pack"] }
|
|
15277
|
+
});
|
|
15278
|
+
var deleteProductSpecPackMappingOperation = defineWriteOperation({
|
|
15279
|
+
operationId: "deleteProductSpecPackMapping",
|
|
15280
|
+
method: "DELETE",
|
|
15281
|
+
path: "/api/v1/product-specs/{productSpecCode}/mappings/{packCode}",
|
|
15282
|
+
summary: "\u89E3\u7ED1 ProductSpec \u4E0E Pack",
|
|
15283
|
+
description: "\u5220\u9664 ProductSpec\u2014Pack \u6620\u5C04\uFF0C\u4E0D\u5220\u9664 ProductSpec \u6216 Pack\u3002\u4F1A\u6539\u53D8\u89C4\u683C\u7684\u5305\u88C5\u6784\u6210\u4E0E\u5B8C\u6574\u5EA6\uFF1B\u6267\u884C\u524D\u5E94\u53D6\u5F97\u7528\u6237\u660E\u786E\u610F\u56FE\u3002expectedVersion \u662F ProductSpec \u6700\u65B0 version\u3002\u7834\u574F\u6027\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15284
|
+
scope: "erp:write",
|
|
15285
|
+
agent: destructiveWriteAgent,
|
|
15286
|
+
request: { path: mappingPathSchema, headers: expectedVersionHeadersSchema },
|
|
15287
|
+
response: { data: deleteMappingResponseSchema },
|
|
15288
|
+
cli: { path: ["product-specs", "remove-pack"] }
|
|
15289
|
+
});
|
|
15290
|
+
var addProductSpecImageOperation = defineWriteOperation({
|
|
15291
|
+
operationId: "addProductSpecImage",
|
|
15292
|
+
method: "POST",
|
|
15293
|
+
path: "/api/v1/product-specs/{productSpecCode}/images/upload",
|
|
15294
|
+
summary: "\u4E3A ProductSpec \u4E0A\u4F20\u5E76\u5173\u8054\u4EA7\u54C1\u56FE\u7247",
|
|
15295
|
+
description: "\u628A\u4E00\u5F20 JPG\u3001JPEG\u3001PNG \u6216 WEBP \u56FE\u7247\u4E0A\u4F20\u4E3A\u4E0D\u53EF\u53D8 FileVersion\uFF0C\u5E76\u5173\u8054\u5230\u5B8C\u6574 PS \u4E1A\u52A1\u7F16\u7801\u6807\u8BC6\u7684 ProductSpec\u3002\u9002\u7528\u4E8E\u65B0\u589E\u4EA7\u54C1\u5C55\u793A\u56FE\u7247\uFF1B\u4E0D\u9002\u7528\u4E8E\u8BF4\u660E\u4E66\u3001\u4F9B\u5E94\u5546\u8D44\u6599\u3001\u5C01\u6837\u8D44\u6599\u6216 Pack \u6587\u4EF6\u3002\u5355\u6587\u4EF6\u6700\u5927 50 MiB\uFF0C\u540C\u4E00\u903B\u8F91\u8BF7\u6C42\u91CD\u8BD5\u5FC5\u987B\u590D\u7528 idempotencyKey\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15296
|
+
scope: "erp:write",
|
|
15297
|
+
agent: { exposed: true, readOnly: false, destructive: false, idempotent: true },
|
|
15298
|
+
request: {
|
|
15299
|
+
path: productSpecPathSchema,
|
|
15300
|
+
headers: idempotencyKeyHeadersSchema,
|
|
15301
|
+
file: {
|
|
15302
|
+
parameterName: "file",
|
|
15303
|
+
maxSizeBytes: 50 * 1024 * 1024,
|
|
15304
|
+
allowedMediaTypes: ["image/jpeg", "image/png", "image/webp"],
|
|
15305
|
+
allowedExtensions: ["jpg", "jpeg", "png", "webp"],
|
|
15306
|
+
description: "\u8981\u65B0\u589E\u7684\u4EA7\u54C1\u56FE\u7247\u6587\u4EF6\u3002CLI \u4F7F\u7528\u672C\u5730\u6587\u4EF6\u8DEF\u5F84\uFF1BMCP \u4F7F\u7528\u5BA2\u6237\u7AEF\u63D0\u4F9B\u7684\u4E34\u65F6\u6587\u4EF6\u5F15\u7528\u3002"
|
|
15307
|
+
}
|
|
15308
|
+
},
|
|
15309
|
+
response: { data: addProductSpecImageResponseSchema, status: 201 },
|
|
15310
|
+
cli: { path: ["product-specs", "add-image"] }
|
|
15311
|
+
});
|
|
14701
15312
|
|
|
14702
15313
|
// ../../packages/contracts/dist/work-lists/index.js
|
|
14703
|
-
var timestampSchema2 = external_exports.iso.datetime();
|
|
14704
|
-
var
|
|
15314
|
+
var timestampSchema2 = external_exports.iso.datetime().describe("ISO 8601 UTC \u65F6\u95F4\u6233\u3002");
|
|
15315
|
+
var workListInternalIdSchema = external_exports.number().int().describe("DevelopmentWorkList \u5DE5\u4F5C\u6E05\u5355\u5185\u90E8\u6807\u8BC6\uFF1B\u4E0D\u662F PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u3002");
|
|
15316
|
+
var productInternalIdSchema = external_exports.number().int().describe("\u6570\u636E\u5E93\u5185\u90E8\u5173\u8054\u6807\u8BC6\uFF1B\u4E0D\u662F PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u3002");
|
|
15317
|
+
var nullableCentimeterSchema2 = external_exports.number().nullable().describe("\u5C3A\u5BF8\uFF0C\u5355\u4F4D cm\uFF1Bnull \u8868\u793A\u7CFB\u7EDF\u6CA1\u6709\u5DF2\u8BB0\u5F55\u503C\uFF0C\u5F53\u524D\u4E0D\u7EC6\u5206\u5177\u4F53\u7A7A\u503C\u539F\u56E0\u3002");
|
|
15318
|
+
var nullableKilogramSchema2 = external_exports.number().nullable().describe("\u91CD\u91CF\uFF0C\u5355\u4F4D kg\uFF1Bnull \u8868\u793A\u7CFB\u7EDF\u6CA1\u6709\u5DF2\u8BB0\u5F55\u503C\uFF0C\u5F53\u524D\u4E0D\u7EC6\u5206\u5177\u4F53\u7A7A\u503C\u539F\u56E0\u3002");
|
|
15319
|
+
var workListIdSchema = external_exports.coerce.number().int().positive().describe("\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u7684\u5185\u90E8\u6B63\u6574\u6570\u6807\u8BC6\uFF0C\u7531\u5217\u8868\u67E5\u8BE2\u8FD4\u56DE\uFF1B\u4E0D\u662F PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u3002");
|
|
14705
15320
|
var batchIdPathSchema = external_exports.object({ batchId: workListIdSchema }).strict();
|
|
14706
15321
|
var workListActivityQuerySchema = external_exports.object({
|
|
14707
|
-
cursor: external_exports.string().trim().min(1).max(1024).optional(),
|
|
14708
|
-
limit: external_exports.coerce.number().int().min(1).max(100).default(20)
|
|
15322
|
+
cursor: external_exports.string().trim().min(1).max(1024).optional().describe("\u4E0A\u4E00\u9875\u8FD4\u56DE\u7684\u4E0D\u900F\u660E\u5206\u9875\u6E38\u6807\uFF1B\u53EA\u53EF\u539F\u6837\u7528\u4E8E\u540C\u4E00\u67E5\u8BE2\uFF0C\u4E0D\u5F97\u89E3\u6790\u6216\u8DE8\u6E05\u5355\u590D\u7528\u3002"),
|
|
15323
|
+
limit: external_exports.coerce.number().int().min(1).max(100).default(20).describe("\u672C\u9875\u6700\u591A\u8FD4\u56DE\u7684\u8BB0\u5F55\u6570\uFF0C\u8303\u56F4 1\uFF5E100\uFF0C\u9ED8\u8BA4 20\u3002")
|
|
14709
15324
|
}).strict();
|
|
14710
15325
|
var workListSummarySchema = external_exports.object({
|
|
14711
|
-
id:
|
|
15326
|
+
id: workListInternalIdSchema,
|
|
14712
15327
|
title: external_exports.string(),
|
|
14713
15328
|
createdBy: external_exports.string(),
|
|
14714
15329
|
version: external_exports.number().int(),
|
|
@@ -14739,28 +15354,28 @@ var completenessDetailSchema = external_exports.object({
|
|
|
14739
15354
|
]).optional()
|
|
14740
15355
|
}).strict();
|
|
14741
15356
|
var workListSpecContentSchema = external_exports.object({
|
|
14742
|
-
id:
|
|
15357
|
+
id: productInternalIdSchema,
|
|
14743
15358
|
productSpecCode: productSpecCodeSchema,
|
|
14744
|
-
productId:
|
|
15359
|
+
productId: productInternalIdSchema,
|
|
14745
15360
|
productCode: productCodeSchema,
|
|
14746
15361
|
specName: external_exports.string(),
|
|
14747
15362
|
brand: external_exports.string().nullable(),
|
|
14748
15363
|
color: external_exports.string().nullable(),
|
|
14749
15364
|
salesMarketCodes: external_exports.array(external_exports.string()),
|
|
14750
|
-
lengthCm:
|
|
14751
|
-
widthCm:
|
|
14752
|
-
fixedHeightCm:
|
|
14753
|
-
minHeightCm:
|
|
14754
|
-
maxHeightCm:
|
|
14755
|
-
netWeightKg:
|
|
15365
|
+
lengthCm: nullableCentimeterSchema2,
|
|
15366
|
+
widthCm: nullableCentimeterSchema2,
|
|
15367
|
+
fixedHeightCm: nullableCentimeterSchema2,
|
|
15368
|
+
minHeightCm: nullableCentimeterSchema2,
|
|
15369
|
+
maxHeightCm: nullableCentimeterSchema2,
|
|
15370
|
+
netWeightKg: nullableKilogramSchema2,
|
|
14756
15371
|
categorySpec: external_exports.unknown().nullable(),
|
|
14757
15372
|
categorySpecSchema: external_exports.string().nullable(),
|
|
14758
15373
|
version: external_exports.number().int(),
|
|
14759
15374
|
createdAt: timestampSchema2,
|
|
14760
15375
|
updatedAt: timestampSchema2,
|
|
14761
15376
|
mappings: external_exports.array(external_exports.object({
|
|
14762
|
-
productSpecId:
|
|
14763
|
-
packCode:
|
|
15377
|
+
productSpecId: productInternalIdSchema,
|
|
15378
|
+
packCode: packCodeSchema,
|
|
14764
15379
|
packName: external_exports.string(),
|
|
14765
15380
|
supplierCode: external_exports.string(),
|
|
14766
15381
|
supplierName: external_exports.string(),
|
|
@@ -14769,16 +15384,21 @@ var workListSpecContentSchema = external_exports.object({
|
|
|
14769
15384
|
}).strict();
|
|
14770
15385
|
var workListNodeSchema = external_exports.object({
|
|
14771
15386
|
entityType: external_exports.enum(["PRODUCT", "PRODUCT_SPEC", "PACK"]),
|
|
14772
|
-
entityCode: external_exports.string(),
|
|
15387
|
+
entityCode: external_exports.string().describe("\u6210\u5458\u5F15\u7528\u7684 PR\u3001PS \u6216 PK \u4E1A\u52A1\u7F16\u7801\uFF1B\u5177\u4F53\u7C7B\u578B\u7531 entityType \u51B3\u5B9A\u3002"),
|
|
14773
15388
|
version: external_exports.number().int(),
|
|
14774
15389
|
content: external_exports.union([productSummarySchema, workListSpecContentSchema, packSummarySchema])
|
|
14775
15390
|
}).strict();
|
|
14776
15391
|
var workListResponseSchema = external_exports.object({
|
|
14777
|
-
id:
|
|
15392
|
+
id: workListInternalIdSchema,
|
|
14778
15393
|
title: external_exports.string(),
|
|
14779
15394
|
createdBy: external_exports.object({ operatorId: external_exports.string(), displayName: external_exports.string().nullable() }).strict(),
|
|
14780
15395
|
version: external_exports.number().int(),
|
|
14781
|
-
completeness: external_exports.object({
|
|
15396
|
+
completeness: external_exports.object({
|
|
15397
|
+
complete: external_exports.boolean(),
|
|
15398
|
+
calculatedAt: timestampSchema2.describe("\u672C\u6B21\u5B8C\u6574\u5EA6\u5B9E\u65F6\u8BA1\u7B97\u5B8C\u6210\u65F6\u7684 ISO 8601 UTC \u65F6\u95F4\u6233\u3002"),
|
|
15399
|
+
rulesVersion: external_exports.literal(erpCompletenessRulesVersion).describe("\u672C\u6B21\u5B8C\u6574\u5EA6\u8BA1\u7B97\u6240\u4F7F\u7528\u7684\u9886\u57DF\u89C4\u5219\u7248\u672C\u3002"),
|
|
15400
|
+
details: external_exports.array(completenessDetailSchema)
|
|
15401
|
+
}).strict(),
|
|
14782
15402
|
counts: external_exports.object({
|
|
14783
15403
|
products: external_exports.number().int(),
|
|
14784
15404
|
productSpecs: external_exports.number().int(),
|
|
@@ -14790,9 +15410,9 @@ var workListResponseSchema = external_exports.object({
|
|
|
14790
15410
|
}).strict();
|
|
14791
15411
|
var workListActivityResponseSchema = external_exports.object({
|
|
14792
15412
|
items: external_exports.array(external_exports.object({
|
|
14793
|
-
id: external_exports.number().int(),
|
|
15413
|
+
id: external_exports.number().int().describe("\u64CD\u4F5C\u8BB0\u5F55\u7684\u6570\u636E\u5E93\u5185\u90E8\u6807\u8BC6\u3002"),
|
|
14794
15414
|
type: external_exports.string(),
|
|
14795
|
-
occurredAt: timestampSchema2,
|
|
15415
|
+
occurredAt: timestampSchema2.describe("\u64CD\u4F5C\u53D1\u751F\u65F6\u95F4\uFF0CISO 8601 UTC \u65F6\u95F4\u6233\u3002"),
|
|
14796
15416
|
actor: external_exports.object({ operatorId: external_exports.string(), displayName: external_exports.string().nullable() }).strict(),
|
|
14797
15417
|
summary: external_exports.string(),
|
|
14798
15418
|
details: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
@@ -14803,11 +15423,15 @@ var listDevelopmentWorkListsOperation = defineReadOperation({
|
|
|
14803
15423
|
operationId: "listDevelopmentWorkLists",
|
|
14804
15424
|
method: "GET",
|
|
14805
15425
|
path: "/api/v1/dev-batches",
|
|
14806
|
-
summary: "
|
|
15426
|
+
summary: "\u5206\u9875\u67E5\u8BE2\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u6458\u8981",
|
|
15427
|
+
description: "\u6309\u66F4\u65B0\u65F6\u95F4\u4ECE\u65B0\u5230\u65E7\u5206\u9875\u67E5\u8BE2 DevelopmentWorkList\uFF0C\u53EF\u6309\u6807\u9898\u5305\u542B\u5339\u914D\u3002\u53EA\u8FD4\u56DE\u6E05\u5355\u6458\u8981\u3001\u6210\u5458\u8BA1\u6570\u3001\u4E1A\u52A1\u7F16\u7801\u96C6\u5408\u548C\u6E38\u6807\uFF1B\u8BFB\u53D6\u6210\u5458\u53CA\u5B9E\u65F6\u5B8C\u6574\u5EA6\u5E94\u4F7F\u7528 getDevelopmentWorkList\u3002\u53EA\u8BFB\u5E76\u8981\u6C42 erp:read\u3002",
|
|
14807
15428
|
scope: "erp:read",
|
|
14808
15429
|
agentReadOnly: true,
|
|
15430
|
+
agent: { exposed: true, readOnly: true, destructive: false, idempotent: true },
|
|
14809
15431
|
request: {
|
|
14810
|
-
query: workListActivityQuerySchema.extend({
|
|
15432
|
+
query: workListActivityQuerySchema.extend({
|
|
15433
|
+
q: external_exports.string().trim().max(160).optional().describe("\u53EF\u9009\u7684\u5DE5\u4F5C\u6E05\u5355\u6807\u9898\u5305\u542B\u5339\u914D\u641C\u7D22\u8BCD\uFF0C\u6700\u957F 160 \u4E2A\u5B57\u7B26\u3002")
|
|
15434
|
+
}).strict()
|
|
14811
15435
|
},
|
|
14812
15436
|
response: { data: workListListResponseSchema },
|
|
14813
15437
|
cli: { path: ["work-lists", "list"] }
|
|
@@ -14816,9 +15440,11 @@ var getDevelopmentWorkListOperation = defineReadOperation({
|
|
|
14816
15440
|
operationId: "getDevelopmentWorkList",
|
|
14817
15441
|
method: "GET",
|
|
14818
15442
|
path: "/api/v1/dev-batches/{batchId}",
|
|
14819
|
-
summary: "
|
|
15443
|
+
summary: "\u8BFB\u53D6\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u53CA\u5B9E\u65F6\u5B8C\u6574\u5EA6",
|
|
15444
|
+
description: "\u6839\u636E\u5217\u8868\u8FD4\u56DE\u7684\u5DE5\u4F5C\u6E05\u5355\u5185\u90E8 ID\uFF0C\u8BFB\u53D6\u6210\u5458\u4E3B\u6570\u636E\u5B9E\u65F6\u6295\u5F71\u53CA\u5B9E\u65F6\u3001\u975E\u963B\u65AD\u8D44\u6599\u5B8C\u6574\u5EA6\u3002\u5DE5\u4F5C\u6E05\u5355\u4E0D\u62E5\u6709\u4EA7\u54C1\u4E3B\u6570\u636E\uFF1B\u5B8C\u6574\u5EA6\u53EA\u8BA1\u7B97\u663E\u5F0F\u5305\u542B\u7684 ProductSpec\uFF0C\u6A21\u578B\u4E0D\u5F97\u81EA\u884C\u63A8\u7B97\u3002\u53EA\u8BFB\u5E76\u8981\u6C42 erp:read\u3002",
|
|
14820
15445
|
scope: "erp:read",
|
|
14821
15446
|
agentReadOnly: true,
|
|
15447
|
+
agent: { exposed: true, readOnly: true, destructive: false, idempotent: true },
|
|
14822
15448
|
request: { path: batchIdPathSchema },
|
|
14823
15449
|
response: { data: workListResponseSchema },
|
|
14824
15450
|
cli: { path: ["work-lists", "get"] }
|
|
@@ -14827,13 +15453,104 @@ var listWorkListActivityOperation = defineReadOperation({
|
|
|
14827
15453
|
operationId: "listWorkListActivity",
|
|
14828
15454
|
method: "GET",
|
|
14829
15455
|
path: "/api/v1/dev-batches/{batchId}/activity",
|
|
14830
|
-
summary: "
|
|
15456
|
+
summary: "\u5206\u9875\u8BFB\u53D6\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u64CD\u4F5C\u8BB0\u5F55",
|
|
15457
|
+
description: "\u8BFB\u53D6\u6307\u5B9A DevelopmentWorkList \u7684\u7A33\u5B9A\u8BED\u4E49\u64CD\u4F5C\u8BB0\u5F55\uFF0C\u6700\u65B0\u8BB0\u5F55\u5728\u524D\u3002\u8FD4\u56DE\u64CD\u4F5C\u7C7B\u578B\u3001UTC \u53D1\u751F\u65F6\u95F4\u3001\u64CD\u4F5C\u8005\u3001\u6458\u8981\u3001\u8BED\u4E49\u5143\u6570\u636E\u548C\u4E0D\u900F\u660E\u6E38\u6807\uFF0C\u4E0D\u8FD4\u56DE\u6570\u636E\u5E93\u539F\u59CB before/after\u3002\u53EA\u8BFB\u5E76\u8981\u6C42 erp:read\u3002",
|
|
14831
15458
|
scope: "erp:read",
|
|
14832
15459
|
agentReadOnly: true,
|
|
15460
|
+
agent: { exposed: true, readOnly: true, destructive: false, idempotent: true },
|
|
14833
15461
|
request: { path: batchIdPathSchema, query: workListActivityQuerySchema },
|
|
14834
15462
|
response: { data: workListActivityResponseSchema },
|
|
14835
15463
|
cli: { path: ["work-lists", "activity"] }
|
|
14836
15464
|
});
|
|
15465
|
+
var createDevelopmentWorkListInputSchema = external_exports.object({ title: external_exports.string().trim().min(1).max(160).describe("\u5DE5\u4F5C\u6E05\u5355\u540D\u79F0\u3002") }).strict();
|
|
15466
|
+
var scopeCommandBase = (type, payload) => external_exports.object({ type: external_exports.literal(type), payload }).strict();
|
|
15467
|
+
var editableSpecFields = initialProductSpecInputSchema.omit({ specName: true });
|
|
15468
|
+
var developmentWorkListCommandSchema = external_exports.discriminatedUnion("type", [
|
|
15469
|
+
scopeCommandBase("RENAME_TOPIC", external_exports.object({ title: external_exports.string().trim().min(1).max(160) }).strict()),
|
|
15470
|
+
scopeCommandBase("CREATE_PRODUCT", external_exports.object({
|
|
15471
|
+
name: external_exports.string().trim().min(1).max(255),
|
|
15472
|
+
initialSpec: initialProductSpecInputSchema.optional()
|
|
15473
|
+
}).strict()),
|
|
15474
|
+
scopeCommandBase("UPDATE_PRODUCT", external_exports.object({
|
|
15475
|
+
productCode: productCodeSchema,
|
|
15476
|
+
expectedVersion: external_exports.number().int().positive(),
|
|
15477
|
+
name: external_exports.string().trim().min(1).max(255)
|
|
15478
|
+
}).strict()),
|
|
15479
|
+
scopeCommandBase("ADD_PRODUCT_SPEC", initialProductSpecInputSchema.extend({ productCode: productCodeSchema, specName: external_exports.string().trim().min(1).max(255) }).strict()),
|
|
15480
|
+
scopeCommandBase("UPDATE_PRODUCT_SPEC", editableSpecFields.extend({
|
|
15481
|
+
productSpecCode: productSpecCodeSchema,
|
|
15482
|
+
expectedVersion: external_exports.number().int().positive(),
|
|
15483
|
+
specName: external_exports.string().trim().min(1).max(255).optional()
|
|
15484
|
+
}).refine((value) => Object.entries(value).some(([key, item]) => !["productSpecCode", "expectedVersion"].includes(key) && item !== void 0), "\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u53EF\u7F16\u8F91\u7684 ProductSpec \u5B57\u6BB5\u3002")),
|
|
15485
|
+
scopeCommandBase("CREATE_PACK", external_exports.object({
|
|
15486
|
+
name: external_exports.string().trim().min(1).max(255),
|
|
15487
|
+
supplierCode: external_exports.enum(["HTK", "SHUPAI", "XINGCHEN"])
|
|
15488
|
+
}).strict()),
|
|
15489
|
+
scopeCommandBase("ADD_PACK_REFERENCE", external_exports.object({
|
|
15490
|
+
productSpecCode: productSpecCodeSchema,
|
|
15491
|
+
packCode: packCodeSchema,
|
|
15492
|
+
quantity: external_exports.number().int().positive()
|
|
15493
|
+
}).strict()),
|
|
15494
|
+
scopeCommandBase("CREATE_PACK_AND_MAP", external_exports.object({
|
|
15495
|
+
productSpecCode: productSpecCodeSchema,
|
|
15496
|
+
name: external_exports.string().trim().min(1).max(255),
|
|
15497
|
+
supplierCode: external_exports.string().trim().min(1).max(32).toUpperCase(),
|
|
15498
|
+
quantity: external_exports.number().int().positive()
|
|
15499
|
+
}).strict()),
|
|
15500
|
+
scopeCommandBase("CHANGE_PACK_QUANTITY", external_exports.object({
|
|
15501
|
+
productSpecCode: productSpecCodeSchema,
|
|
15502
|
+
packCode: packCodeSchema,
|
|
15503
|
+
quantity: external_exports.number().int().positive()
|
|
15504
|
+
}).strict()),
|
|
15505
|
+
scopeCommandBase("UPDATE_PACK", external_exports.object({
|
|
15506
|
+
packCode: packCodeSchema,
|
|
15507
|
+
expectedVersion: external_exports.number().int().positive(),
|
|
15508
|
+
name: external_exports.string().trim().min(1).max(255).optional(),
|
|
15509
|
+
supplierCode: external_exports.string().trim().min(1).max(32).toUpperCase().optional(),
|
|
15510
|
+
contents: external_exports.string().trim().min(1).max(1e4).nullable().optional(),
|
|
15511
|
+
lengthCm: external_exports.number().finite().positive().nullable().optional(),
|
|
15512
|
+
widthCm: external_exports.number().finite().positive().nullable().optional(),
|
|
15513
|
+
heightCm: external_exports.number().finite().positive().nullable().optional(),
|
|
15514
|
+
grossWeightKg: external_exports.number().finite().positive().nullable().optional(),
|
|
15515
|
+
netWeightKg: external_exports.number().finite().positive().nullable().optional(),
|
|
15516
|
+
packagingPlan: external_exports.string().trim().min(1).max(1e4).nullable().optional(),
|
|
15517
|
+
permanentCartonMark: external_exports.string().trim().min(1).max(1e4).nullable().optional(),
|
|
15518
|
+
packagingPlanFileVersionId: external_exports.number().int().positive().nullable().optional(),
|
|
15519
|
+
permanentCartonMarkFileVersionId: external_exports.number().int().positive().nullable().optional()
|
|
15520
|
+
}).strict().refine((value) => Object.entries(value).some(([key, item]) => !["packCode", "expectedVersion"].includes(key) && item !== void 0), "\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u53EF\u7F16\u8F91\u7684 Pack \u5B57\u6BB5\u3002")),
|
|
15521
|
+
scopeCommandBase("REMOVE_PACK_REFERENCE", external_exports.object({ productSpecCode: productSpecCodeSchema, packCode: packCodeSchema }).strict()),
|
|
15522
|
+
scopeCommandBase("REMOVE_PRODUCT", external_exports.object({ productCode: productCodeSchema }).strict()),
|
|
15523
|
+
scopeCommandBase("REMOVE_PRODUCT_SPEC", external_exports.object({ productSpecCode: productSpecCodeSchema }).strict()),
|
|
15524
|
+
scopeCommandBase("REMOVE_PACK", external_exports.object({ packCode: packCodeSchema }).strict())
|
|
15525
|
+
]);
|
|
15526
|
+
var createDevelopmentWorkListOperation = defineWriteOperation({
|
|
15527
|
+
operationId: "createDevelopmentWorkList",
|
|
15528
|
+
method: "POST",
|
|
15529
|
+
path: "/api/v1/dev-batches",
|
|
15530
|
+
summary: "\u521B\u5EFA\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355",
|
|
15531
|
+
description: "\u521B\u5EFA\u7A7A\u7684 DevelopmentWorkList\u3002\u91CD\u590D\u63D0\u4EA4\u540C\u4E00\u903B\u8F91\u8BF7\u6C42\u5FC5\u987B\u590D\u7528 idempotencyKey\uFF1B\u6E05\u5355\u4E0D\u62E5\u6709\u4EA7\u54C1\u4E3B\u6570\u636E\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15532
|
+
scope: "erp:write",
|
|
15533
|
+
agent: { exposed: true, readOnly: false, destructive: false, idempotent: true },
|
|
15534
|
+
request: { headers: idempotencyKeyHeadersSchema, body: createDevelopmentWorkListInputSchema },
|
|
15535
|
+
response: { data: workListResponseSchema, status: 201 },
|
|
15536
|
+
cli: { path: ["work-lists", "create"] }
|
|
15537
|
+
});
|
|
15538
|
+
var applyDevelopmentWorkListCommandOperation = defineWriteOperation({
|
|
15539
|
+
operationId: "applyDevelopmentWorkListCommand",
|
|
15540
|
+
method: "POST",
|
|
15541
|
+
path: "/api/v1/dev-batches/{batchId}/scope-commands",
|
|
15542
|
+
summary: "\u539F\u5B50\u6267\u884C\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u8BED\u4E49\u547D\u4EE4",
|
|
15543
|
+
description: "\u5728\u4E00\u4E2A\u4E8B\u52A1\u5185\u8C03\u6574\u5DE5\u4F5C\u6E05\u5355\u3001\u6210\u5458\u6216\u6E05\u5355\u8303\u56F4\u5185\u7684\u4EA7\u54C1\u4E3B\u6570\u636E\u3002REMOVE_* \u53EA\u79FB\u51FA\u6E05\u5355\uFF0CREMOVE_PACK_REFERENCE \u4F1A\u89E3\u7ED1\u6620\u5C04\uFF1B\u5DE5\u5177\u5305\u542B\u7834\u574F\u6027\u5206\u652F\uFF0C\u6267\u884C\u524D\u5E94\u786E\u8BA4\u7528\u6237\u610F\u56FE\u3002\u4F7F\u7528\u6700\u65B0\u6E05\u5355 version \u548C\u7A33\u5B9A idempotencyKey\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42 erp:write\u3002",
|
|
15544
|
+
scope: "erp:write",
|
|
15545
|
+
agent: { exposed: true, readOnly: false, destructive: true, idempotent: true },
|
|
15546
|
+
request: {
|
|
15547
|
+
path: external_exports.object({ batchId: workListIdSchema }).strict(),
|
|
15548
|
+
headers: commandHeadersSchema,
|
|
15549
|
+
body: developmentWorkListCommandSchema
|
|
15550
|
+
},
|
|
15551
|
+
response: { data: workListResponseSchema },
|
|
15552
|
+
cli: { path: ["work-lists", "apply"] }
|
|
15553
|
+
});
|
|
14837
15554
|
|
|
14838
15555
|
// ../../packages/contracts/dist/catalog.js
|
|
14839
15556
|
var erpReadOperations = [
|
|
@@ -14845,9 +15562,26 @@ var erpReadOperations = [
|
|
|
14845
15562
|
getDevelopmentWorkListOperation,
|
|
14846
15563
|
listWorkListActivityOperation
|
|
14847
15564
|
];
|
|
15565
|
+
var erpWriteOperations = [
|
|
15566
|
+
addProductSpecImageOperation,
|
|
15567
|
+
createProductOperation,
|
|
15568
|
+
updateProductOperation,
|
|
15569
|
+
updateProductSpecOperation,
|
|
15570
|
+
createPackOperation,
|
|
15571
|
+
updatePackOperation,
|
|
15572
|
+
createProductSpecPackMappingOperation,
|
|
15573
|
+
updateProductSpecPackMappingOperation,
|
|
15574
|
+
deleteProductSpecPackMappingOperation,
|
|
15575
|
+
createDevelopmentWorkListOperation,
|
|
15576
|
+
applyDevelopmentWorkListCommandOperation
|
|
15577
|
+
];
|
|
15578
|
+
var erpAgentOperations = [...erpReadOperations, ...erpWriteOperations];
|
|
14848
15579
|
|
|
14849
15580
|
// ../../packages/contracts/dist/http.js
|
|
14850
|
-
function
|
|
15581
|
+
function buildOperationPath(operation, input = {}) {
|
|
15582
|
+
return buildPath(operation, input);
|
|
15583
|
+
}
|
|
15584
|
+
function buildPath(operation, input) {
|
|
14851
15585
|
let path = operation.path;
|
|
14852
15586
|
if (operation.request.path) {
|
|
14853
15587
|
const values = operation.request.path.parse(input.path ?? {});
|
|
@@ -14884,48 +15618,243 @@ var readOnlyAnnotations = {
|
|
|
14884
15618
|
idempotentHint: true,
|
|
14885
15619
|
openWorldHint: false
|
|
14886
15620
|
};
|
|
14887
|
-
var
|
|
15621
|
+
var toolResultMetaSchema = (readOnly) => external_exports.object({
|
|
15622
|
+
schemaVersion: external_exports.literal("1.0").describe("\u5F53\u524D\u5DE5\u5177\u6210\u529F\u8FD4\u56DE\u7ED3\u6784\u7684\u7248\u672C\u3002"),
|
|
15623
|
+
domainModelVersion: external_exports.literal(erpDomainModelVersion).describe("\u8FD4\u56DE\u8BED\u4E49\u6240\u4F9D\u636E\u7684 intoNear \u9886\u57DF\u6A21\u578B\u7248\u672C\u3002"),
|
|
15624
|
+
resultStatus: external_exports.literal("SUCCESS").describe("\u6210\u529F\u8FD4\u56DE\u56FA\u5B9A\u4E3A SUCCESS\uFF1B\u9519\u8BEF\u5728 isError \u7ED3\u679C\u4E2D\u8FD4\u56DE\u3002"),
|
|
15625
|
+
permissionScope: external_exports.literal(readOnly ? "CURRENT_CALLER_WITH_ERP_READ" : "CURRENT_EMPLOYEE_WITH_ERP_WRITE").describe(readOnly ? "\u7ED3\u679C\u4F7F\u7528\u5F53\u524D\u8C03\u7528\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:read\uFF1B\u4E0D\u8868\u793A\u5B58\u5728\u5BF9\u8C61\u7EA7\u5458\u5DE5\u6743\u9650\u5224\u5B9A\u3002" : "\u5199\u5165\u4F7F\u7528\u5F53\u524D\u5458\u5DE5\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:write\uFF0C\u64CD\u4F5C\u8FDB\u5165\u4E1A\u52A1\u5BA1\u8BA1\u3002"),
|
|
15626
|
+
readOnly: external_exports.literal(readOnly).describe(readOnly ? "\u672C\u6B21\u8C03\u7528\u6CA1\u6709\u4FEE\u6539\u4E1A\u52A1\u6570\u636E\u3002" : "\u672C\u6B21\u8C03\u7528\u4F1A\u4FEE\u6539\u4E1A\u52A1\u6570\u636E\u3002"),
|
|
15627
|
+
calculatedAt: external_exports.iso.datetime().describe("\u8BE5\u5DE5\u5177\u54CD\u5E94\u751F\u6210\u65F6\u7684 ISO 8601 UTC \u65F6\u95F4\u6233\u3002")
|
|
15628
|
+
}).strict();
|
|
15629
|
+
var output = (schema, readOnly) => external_exports.object({ result: schema, meta: toolResultMetaSchema(readOnly) }).strict();
|
|
14888
15630
|
var searchProductMasterDataTool = {
|
|
14889
15631
|
name: "search_product_master_data",
|
|
14890
|
-
description:
|
|
15632
|
+
description: `\u641C\u7D22 Product\u3001ProductSpec\u3001Pack \u4E3B\u6570\u636E\u5019\u9009\u53CA\u5176\u5173\u7CFB\u3002
|
|
15633
|
+
|
|
15634
|
+
\u9002\u7528\uFF1A\u4E0D\u77E5\u9053\u5B8C\u6574\u4E1A\u52A1\u7F16\u7801\uFF0C\u53EA\u6709 Product \u540D\u79F0\u3001ProductSpec \u89C4\u683C\u540D\u3001Pack \u540D\u79F0\u3001Supplier \u7F16\u7801\u6216\u540D\u79F0\uFF1B\u9700\u8981\u4ECE\u591A\u4E2A\u5019\u9009\u4E2D\u786E\u8BA4\u76EE\u6807\u3002
|
|
15635
|
+
\u4E0D\u9002\u7528\uFF1A\u5DF2\u7ECF\u63D0\u4F9B\u5B8C\u6574 PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\uFF0C\u6B64\u65F6\u4F7F\u7528 get_product_master_data\u3002\u5F53\u524D\u4E0D\u652F\u6301\u90E8\u5206\u4E1A\u52A1\u7F16\u7801\u5339\u914D\u3002
|
|
15636
|
+
|
|
15637
|
+
\u8FD4\u56DE\u5019\u9009 matches\u3001\u76F8\u5173 Product/ProductSpec/Pack\u3001\u5E26 quantity \u7684 ProductSpec\u2014Pack \u6620\u5C04\u53CA\u5206\u9875\u6E38\u6807\u3002\u591A\u4E2A\u5019\u9009\u90FD\u53EF\u80FD\u6709\u6548\uFF0C\u4E0D\u8981\u9ED8\u8BA4\u7B2C\u4E00\u6761\u5C31\u662F\u76EE\u6807\uFF1B\u7A7A\u5019\u9009\u662F SUCCESS\uFF0C\u8868\u793A\u5F53\u524D\u8BFB\u53D6\u8303\u56F4\u5185\u6CA1\u6709\u5339\u914D\u7ED3\u679C\uFF1B\u975E\u6CD5\u53C2\u6570\u8FD4\u56DE INVALID_ARGUMENT\u3002
|
|
15638
|
+
\u8BE5\u5DE5\u5177\u53EA\u8BFB\uFF0C\u4F7F\u7528\u5F53\u524D\u8C03\u7528\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:read\u3002`,
|
|
14891
15639
|
scope: "erp:read",
|
|
14892
15640
|
annotations: readOnlyAnnotations,
|
|
14893
15641
|
input: searchProductsOperation.request.query,
|
|
14894
|
-
output: output(searchProductsOperation.response.data)
|
|
15642
|
+
output: output(searchProductsOperation.response.data, true)
|
|
14895
15643
|
};
|
|
14896
15644
|
var getProductMasterDataTool = {
|
|
14897
15645
|
name: "get_product_master_data",
|
|
14898
|
-
description:
|
|
15646
|
+
description: `\u6839\u636E\u5B8C\u6574\u7684 PR\u3001PS \u6216 PK \u4E1A\u52A1\u7F16\u7801\u8BFB\u53D6\u76EE\u6807\u5BF9\u8C61\u53CA\u5176\u5B9E\u65F6\u4E3B\u6570\u636E\u5173\u7CFB\u3002
|
|
15647
|
+
|
|
15648
|
+
PR \u662F ProductCode\uFF0CPS \u662F ProductSpecCode\uFF0CPK \u662F PackCode\uFF1B\u5B83\u4EEC\u662F\u4E1A\u52A1\u7F16\u7801\uFF0C\u4E0D\u662F\u6570\u636E\u5E93\u5185\u90E8 ID \u6216\u6E20\u9053 SKU\u3002
|
|
15649
|
+
\u9002\u7528\uFF1A\u7528\u6237\u5DF2\u7ECF\u63D0\u4F9B\u5B8C\u6574\u4E1A\u52A1\u7F16\u7801\u3002\u4E0D\u53EF\u7528\u4E8E\u540D\u79F0\u3001Supplier \u6216\u4E0D\u5B8C\u6574\u7F16\u7801\u641C\u7D22\uFF0C\u6B64\u65F6\u4F7F\u7528 search_product_master_data\u3002
|
|
15650
|
+
|
|
15651
|
+
PR \u8FD4\u56DE Product \u53CA\u5176 ProductSpec\u3001Pack \u5173\u7CFB\uFF1BPS \u8FD4\u56DE\u6240\u5C5E Product\u3001\u76EE\u6807 ProductSpec \u53CA Pack\uFF1BPK \u8FD4\u56DE\u76EE\u6807 Pack \u53CA\u5F15\u7528\u5B83\u7684 ProductSpec\u3001Product\u3002\u975E\u6CD5\u7F16\u7801\u8FD4\u56DE INVALID_ARGUMENT\uFF1B\u5F53\u524D\u8BFB\u53D6\u8303\u56F4\u5185\u4E0D\u5B58\u5728\u65F6\u8FD4\u56DE\u4E0D\u6CC4\u9732\u989D\u5916\u5B58\u5728\u6027\u7684 NOT_FOUND\uFF0C\u4E0D\u8FD4\u56DE\u7A7A\u5173\u7CFB\u5192\u5145\u6210\u529F\u3002
|
|
15652
|
+
\u8BE5\u5DE5\u5177\u53EA\u8BFB\uFF0C\u4F7F\u7528\u5F53\u524D\u8C03\u7528\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:read\u3002`,
|
|
14899
15653
|
scope: "erp:read",
|
|
14900
15654
|
annotations: readOnlyAnnotations,
|
|
14901
15655
|
input: external_exports.object({
|
|
14902
|
-
code: external_exports.string().trim().toUpperCase().regex(/^(PR\d{5,}|PS\d{5,}|PK\d{6,})$/)
|
|
15656
|
+
code: external_exports.string().trim().toUpperCase().regex(/^(PR\d{5,}|PS\d{5,}|PK\d{6,})$/).describe("\u5B8C\u6574\u7684 intoNear \u4E1A\u52A1\u7F16\u7801\uFF1APR \u52A0\u81F3\u5C11 5 \u4F4D\u6570\u5B57\u3001PS \u52A0\u81F3\u5C11 5 \u4F4D\u6570\u5B57\uFF0C\u6216 PK \u52A0\u81F3\u5C11 6 \u4F4D\u6570\u5B57\u3002\u4F1A\u89C4\u8303\u5316\u4E3A\u5927\u5199\uFF1B\u4E0D\u662F\u6570\u636E\u5E93\u5185\u90E8 ID\u3002")
|
|
14903
15657
|
}).strict(),
|
|
14904
|
-
output: output(external_exports.union([getProductResponseSchema, getProductSpecResponseSchema, getPackResponseSchema]))
|
|
15658
|
+
output: output(external_exports.union([getProductResponseSchema, getProductSpecResponseSchema, getPackResponseSchema]), true)
|
|
14905
15659
|
};
|
|
14906
15660
|
var listDevelopmentWorkListsTool = {
|
|
14907
15661
|
name: "list_development_work_lists",
|
|
14908
|
-
description:
|
|
15662
|
+
description: `\u6309\u66F4\u65B0\u65F6\u95F4\u4ECE\u65B0\u5230\u65E7\u5206\u9875\u67E5\u8BE2 DevelopmentWorkList\uFF08\u5B9E\u73B0\u540D DevBatch\uFF09\u3002
|
|
15663
|
+
|
|
15664
|
+
\u9002\u7528\uFF1A\u67E5\u627E\u5DE5\u4F5C\u6E05\u5355\u3001\u6309\u6807\u9898\u7B5B\u9009\uFF0C\u6216\u5148\u53D6\u5F97\u540E\u7EED\u8BE6\u60C5\u67E5\u8BE2\u6240\u9700\u7684\u5DE5\u4F5C\u6E05\u5355\u5185\u90E8 ID\u3002
|
|
15665
|
+
\u4E0D\u9002\u7528\uFF1A\u8BFB\u53D6\u67D0\u4E00\u6E05\u5355\u7684\u6210\u5458\u548C\u5B8C\u6574\u5EA6\uFF0C\u4F7F\u7528 get_development_work_list\uFF1B\u8BFB\u53D6\u64CD\u4F5C\u5386\u53F2\uFF0C\u4F7F\u7528 list_work_list_activity\u3002
|
|
15666
|
+
|
|
15667
|
+
\u53EA\u8FD4\u56DE\u5DE5\u4F5C\u6E05\u5355\u6458\u8981\u3001\u6210\u5458\u7C7B\u578B\u8BA1\u6570\u3001\u4E1A\u52A1\u7F16\u7801\u96C6\u5408\u548C\u4E0D\u900F\u660E\u5206\u9875\u6E38\u6807\uFF0C\u4E0D\u8FD4\u56DE\u6210\u5458\u8BE6\u60C5\u6216\u5B8C\u6574\u5EA6\u3002\u7A7A items \u662F SUCCESS\uFF0C\u8868\u793A\u5F53\u524D\u8BFB\u53D6\u8303\u56F4\u5185\u6CA1\u6709\u5339\u914D\u6E05\u5355\uFF1B\u975E\u6CD5\u5206\u9875\u53C2\u6570\u8FD4\u56DE INVALID_ARGUMENT\u3002
|
|
15668
|
+
\u8BE5\u5DE5\u5177\u53EA\u8BFB\uFF0C\u4F7F\u7528\u5F53\u524D\u8C03\u7528\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:read\u3002`,
|
|
14909
15669
|
scope: "erp:read",
|
|
14910
15670
|
annotations: readOnlyAnnotations,
|
|
14911
15671
|
input: listDevelopmentWorkListsOperation.request.query,
|
|
14912
|
-
output: output(workListListResponseSchema)
|
|
15672
|
+
output: output(workListListResponseSchema, true)
|
|
14913
15673
|
};
|
|
14914
15674
|
var getDevelopmentWorkListTool = {
|
|
14915
15675
|
name: "get_development_work_list",
|
|
14916
|
-
description:
|
|
15676
|
+
description: `\u6839\u636E\u5DE5\u4F5C\u6E05\u5355\u5185\u90E8 ID \u8BFB\u53D6 DevelopmentWorkList\u3001\u6210\u5458\u4E3B\u6570\u636E\u5B9E\u65F6\u6295\u5F71\u53CA\u5B9E\u65F6\u3001\u975E\u963B\u65AD\u8D44\u6599\u5B8C\u6574\u5EA6\u3002
|
|
15677
|
+
|
|
15678
|
+
\u9002\u7528\uFF1A\u67E5\u770B\u6E05\u5355\u5305\u542B\u7684 Product\u3001ProductSpec\u3001Pack\uFF0C\u6216\u56DE\u7B54\u8D44\u6599\u662F\u5426\u5B8C\u6574\u53CA\u7F3A\u5C11\u4EC0\u4E48\u3002
|
|
15679
|
+
\u4E0D\u9002\u7528\uFF1A\u6309\u6807\u9898\u67E5\u627E\u6E05\u5355\uFF0C\u4F7F\u7528 list_development_work_lists\uFF1B\u8BFB\u53D6\u64CD\u4F5C\u5386\u53F2\uFF0C\u4F7F\u7528 list_work_list_activity\u3002
|
|
15680
|
+
|
|
15681
|
+
\u5DE5\u4F5C\u6E05\u5355\u53EA\u662F\u4E1A\u52A1\u7F16\u7801\u5F15\u7528\u96C6\u5408\uFF0C\u4E0D\u62E5\u6709\u4EA7\u54C1\u4E3B\u6570\u636E\uFF1B\u5B8C\u6574\u5EA6\u53EA\u8BA1\u7B97\u6E05\u5355\u4E2D\u663E\u5F0F\u5305\u542B\u7684 ProductSpec\uFF0C\u5FC5\u987B\u4F7F\u7528\u8FD4\u56DE\u7ED3\u679C\uFF0C\u4E0D\u5F97\u81EA\u884C\u6309\u5B57\u6BB5\u6570\u91CF\u63A8\u7B97\u3002\u975E\u6CD5 ID \u8FD4\u56DE INVALID_ARGUMENT\uFF1B\u5F53\u524D\u8BFB\u53D6\u8303\u56F4\u5185\u4E0D\u5B58\u5728\u65F6\u8FD4\u56DE NOT_FOUND\u3002
|
|
15682
|
+
\u8BE5\u5DE5\u5177\u53EA\u8BFB\uFF0C\u4F7F\u7528\u5F53\u524D\u8C03\u7528\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:read\u3002`,
|
|
14917
15683
|
scope: "erp:read",
|
|
14918
15684
|
annotations: readOnlyAnnotations,
|
|
14919
|
-
input: external_exports.object({
|
|
14920
|
-
|
|
15685
|
+
input: external_exports.object({
|
|
15686
|
+
workListId: external_exports.number().int().positive().describe("\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u7684\u5185\u90E8\u6B63\u6574\u6570\u6807\u8BC6\uFF0C\u7531\u5217\u8868\u67E5\u8BE2\u8FD4\u56DE\uFF1B\u4E0D\u662F PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u3002")
|
|
15687
|
+
}).strict(),
|
|
15688
|
+
output: output(workListResponseSchema, true)
|
|
14921
15689
|
};
|
|
14922
15690
|
var listWorkListActivityTool = {
|
|
14923
15691
|
name: "list_work_list_activity",
|
|
14924
|
-
description:
|
|
15692
|
+
description: `\u5206\u9875\u8BFB\u53D6\u6307\u5B9A DevelopmentWorkList \u7684\u8BED\u4E49\u5316\u64CD\u4F5C\u8BB0\u5F55\uFF0C\u6700\u65B0\u8BB0\u5F55\u5728\u524D\u3002
|
|
15693
|
+
|
|
15694
|
+
\u9002\u7528\uFF1A\u67E5\u8BE2\u5DE5\u4F5C\u6E05\u5355\u4F55\u65F6\u521B\u5EFA\u3001\u6539\u540D\uFF0C\u6216\u4F55\u65F6\u8C03\u6574\u6E05\u5355\u53CA\u5176\u8303\u56F4\u5185\u4E3B\u6570\u636E\u3002
|
|
15695
|
+
\u4E0D\u9002\u7528\uFF1A\u8BFB\u53D6\u5F53\u524D\u6210\u5458\u6216\u5B8C\u6574\u5EA6\uFF0C\u4F7F\u7528 get_development_work_list\uFF1B\u8BE5\u7ED3\u679C\u4E5F\u4E0D\u662F\u6240\u6709\u4EA7\u54C1\u4E3B\u6570\u636E\u7684\u5B8C\u6574\u5386\u53F2\u3002
|
|
15696
|
+
|
|
15697
|
+
\u8FD4\u56DE\u64CD\u4F5C\u7C7B\u578B\u3001\u53D1\u751F\u65F6\u95F4\u3001\u64CD\u4F5C\u8005\u3001\u6458\u8981\u3001\u7A33\u5B9A\u8BED\u4E49\u5143\u6570\u636E\u548C\u4E0D\u900F\u660E\u5206\u9875\u6E38\u6807\uFF1B\u4E0D\u8FD4\u56DE\u6570\u636E\u5E93\u539F\u59CB before/after\u3002\u7A7A items \u662F SUCCESS\uFF0C\u8868\u793A\u8BE5\u6E05\u5355\u5F53\u524D\u6CA1\u6709\u53EF\u8FD4\u56DE\u8BB0\u5F55\uFF1B\u975E\u6CD5\u53C2\u6570\u8FD4\u56DE INVALID_ARGUMENT\uFF0C\u6E05\u5355\u4E0D\u5B58\u5728\u65F6\u8FD4\u56DE NOT_FOUND\u3002
|
|
15698
|
+
\u8BE5\u5DE5\u5177\u53EA\u8BFB\uFF0C\u4F7F\u7528\u5F53\u524D\u8C03\u7528\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:read\u3002`,
|
|
15699
|
+
scope: "erp:read",
|
|
15700
|
+
annotations: readOnlyAnnotations,
|
|
15701
|
+
input: workListActivityQuerySchema.extend({
|
|
15702
|
+
workListId: external_exports.number().int().positive().describe("\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u7684\u5185\u90E8\u6B63\u6574\u6570\u6807\u8BC6\uFF0C\u7531\u5217\u8868\u67E5\u8BE2\u8FD4\u56DE\uFF1B\u4E0D\u662F PR\u3001PS\u3001PK \u4E1A\u52A1\u7F16\u7801\u3002")
|
|
15703
|
+
}).strict(),
|
|
15704
|
+
output: output(workListActivityResponseSchema, true)
|
|
15705
|
+
};
|
|
15706
|
+
var getDomainContextTool = {
|
|
15707
|
+
name: "get_domain_context",
|
|
15708
|
+
description: "\u6309\u9700\u8BFB\u53D6\u8BE6\u7EC6\u9886\u57DF\u89C4\u5219\u3002\u4EC5\u5728\u9700\u8981\u786E\u8BA4\u4EA7\u54C1\u5173\u7CFB\u3001\u4E1A\u52A1\u7F16\u7801\u3001\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u3001\u5B8C\u6574\u5EA6\u3001\u64CD\u4F5C\u8BB0\u5F55\u6216\u5B57\u6BB5\u8BED\u4E49\u65F6\u8C03\u7528\uFF1B\u666E\u901A\u67E5\u8BE2\u65E0\u9700\u9884\u5148\u8C03\u7528\u3002\u8F93\u5165 1\uFF5E3 \u4E2A topics\uFF0C\u8FD4\u56DE\u5BF9\u5E94\u9886\u57DF\u4E3B\u9898\u800C\u975E\u4E1A\u52A1\u6570\u636E\uFF1B\u975E\u6CD5\u4E3B\u9898\u6216\u6570\u91CF\u8FD4\u56DE INVALID_ARGUMENT\u3002\u8BE5\u5DE5\u5177\u4F7F\u7528\u5F53\u524D\u8C03\u7528\u8EAB\u4EFD\u5E76\u8981\u6C42 erp:read\uFF0C\u662F\u53EA\u8BFB\u64CD\u4F5C\uFF0C\u4E0D\u67E5\u8BE2\u6216\u4FEE\u6539\u4E1A\u52A1\u6570\u636E\u3002",
|
|
14925
15709
|
scope: "erp:read",
|
|
14926
15710
|
annotations: readOnlyAnnotations,
|
|
14927
|
-
input:
|
|
14928
|
-
|
|
15711
|
+
input: external_exports.object({
|
|
15712
|
+
topics: external_exports.array(erpDomainTopicNameSchema).min(1).max(3).describe("\u9700\u8981\u8BFB\u53D6\u7684\u9886\u57DF\u4E3B\u9898\uFF1B\u5355\u6B21\u6700\u591A 3 \u4E2A\uFF0C\u4EE5\u4FDD\u6301\u6E10\u8FDB\u5F0F\u62AB\u9732\u3002")
|
|
15713
|
+
}).strict(),
|
|
15714
|
+
output: output(erpDomainContextResponseSchema, true)
|
|
15715
|
+
};
|
|
15716
|
+
var writeAnnotations = {
|
|
15717
|
+
readOnlyHint: false,
|
|
15718
|
+
destructiveHint: false,
|
|
15719
|
+
idempotentHint: false,
|
|
15720
|
+
openWorldHint: false
|
|
15721
|
+
};
|
|
15722
|
+
var destructiveAnnotations = { ...writeAnnotations, destructiveHint: true };
|
|
15723
|
+
var expectedVersionInputSchema = external_exports.number().int().positive().describe("\u4ECE\u5199\u5165\u524D\u6700\u65B0\u67E5\u8BE2\u7ED3\u679C\u53D6\u5F97\u7684 version\uFF0C\u7528\u4E8E\u9632\u6B62\u8986\u76D6\u5E76\u53D1\u4FEE\u6539\u3002");
|
|
15724
|
+
var idempotencyKeyInputSchema = external_exports.string().min(16).max(128).regex(/^[\x21-\x7E]+$/).describe("\u4E00\u6B21\u903B\u8F91\u547D\u4EE4\u7A33\u5B9A\u590D\u7528\u7684 16\uFF5E128 \u4F4D\u53EF\u6253\u5370 ASCII \u5E42\u7B49\u952E\uFF1B\u91CD\u8BD5\u4E0D\u5F97\u751F\u6210\u65B0\u503C\u3002");
|
|
15725
|
+
var chatGptFileInputSchema = external_exports.object({
|
|
15726
|
+
download_url: external_exports.url().describe("\u5BA2\u6237\u7AEF\u63D0\u4F9B\u7684\u4E34\u65F6 HTTPS \u4E0B\u8F7D\u5730\u5740\uFF1B\u670D\u52A1\u7AEF\u7ACB\u5373\u8BFB\u53D6\u4E14\u4E0D\u4F1A\u6301\u4E45\u5316\u3002"),
|
|
15727
|
+
file_id: external_exports.string().trim().min(1).max(255).describe("\u5BA2\u6237\u7AEF\u6587\u4EF6\u6807\u8BC6\uFF0C\u4EC5\u7528\u4E8E\u672C\u6B21\u4F20\u8F93\u8FFD\u8E2A\u3002"),
|
|
15728
|
+
mime_type: external_exports.string().trim().min(1).max(255).optional().describe("\u5BA2\u6237\u7AEF\u58F0\u660E\u7684 MIME \u7C7B\u578B\u3002"),
|
|
15729
|
+
file_name: external_exports.string().trim().min(1).max(255).optional().describe("\u7528\u6237\u4E0A\u4F20\u65F6\u7684\u539F\u59CB\u6587\u4EF6\u540D\u3002")
|
|
15730
|
+
}).strict();
|
|
15731
|
+
var addProductSpecImageTool = {
|
|
15732
|
+
name: "add_product_spec_image",
|
|
15733
|
+
description: `\u4E3A\u4E00\u4E2A ProductSpec \u4E0A\u4F20\u5E76\u5173\u8054\u4E00\u5F20\u4EA7\u54C1\u56FE\u7247\u3002
|
|
15734
|
+
|
|
15735
|
+
\u9002\u7528\uFF1A\u7528\u6237\u5DF2\u660E\u786E\u76EE\u6807 PS \u4E1A\u52A1\u7F16\u7801\uFF0C\u5E76\u5728\u5F53\u524D\u5BF9\u8BDD\u4E2D\u9644\u52A0\u4E86\u4E00\u5F20 JPG\u3001JPEG\u3001PNG \u6216 WEBP \u56FE\u7247\u3002
|
|
15736
|
+
\u4E0D\u9002\u7528\uFF1A\u7528\u6237\u8BF4\u660E\u4E66\u3001\u4F9B\u5E94\u5546\u89C4\u683C\u4E66\u6216\u56FE\u7EB8\u3001\u5C01\u6837\u8D44\u6599\u3001Pack \u6587\u4EF6\uFF1B\u8FD9\u4E9B\u8D44\u6599\u5FC5\u987B\u4F7F\u7528\u5404\u81EA\u7684\u9886\u57DF\u5DE5\u5177\u3002\u4E5F\u4E0D\u53EF\u53EA\u51ED\u540D\u79F0\u731C\u6D4B ProductSpec\uFF0C\u5E94\u5148\u641C\u7D22\u5E76\u786E\u8BA4\u5B8C\u6574 PS \u7F16\u7801\u3002
|
|
15737
|
+
|
|
15738
|
+
\u8BE5\u5DE5\u5177\u628A\u6587\u4EF6\u4E0A\u4F20\u4E3A\u4E0D\u53EF\u53D8 FileVersion\uFF0C\u5E76\u5173\u8054\u5230 ProductSpec \u4EA7\u54C1\u56FE\u7247\u96C6\u5408\u3002\u5355\u6587\u4EF6\u6700\u5927 50 MiB\uFF1B\u540C\u4E00\u903B\u8F91\u8BF7\u6C42\u91CD\u8BD5\u5FC5\u987B\u590D\u7528 idempotencyKey\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002`,
|
|
15739
|
+
scope: "erp:write",
|
|
15740
|
+
annotations: { ...writeAnnotations, idempotentHint: true },
|
|
15741
|
+
meta: { "openai/fileParams": ["file"] },
|
|
15742
|
+
input: external_exports.object({
|
|
15743
|
+
productSpecCode: productSpecCodeSchema,
|
|
15744
|
+
idempotencyKey: idempotencyKeyInputSchema,
|
|
15745
|
+
file: chatGptFileInputSchema
|
|
15746
|
+
}).strict(),
|
|
15747
|
+
output: output(addProductSpecImageResponseSchema, false)
|
|
15748
|
+
};
|
|
15749
|
+
var createProductTool = {
|
|
15750
|
+
name: "create_product",
|
|
15751
|
+
description: "\u521B\u5EFA Product \u53CA\u5176\u9996\u4E2A ProductSpec\uFF0C\u7CFB\u7EDF\u751F\u6210\u4E0D\u53EF\u53D8 PR\u3001PS \u4E1A\u52A1\u7F16\u7801\u3002\u9002\u7528\uFF1A\u7528\u6237\u660E\u786E\u8981\u521B\u5EFA\u65B0\u7684\u4EA7\u54C1\u65CF\u3002\u4E0D\u9002\u7528\uFF1A\u7ED9\u73B0\u6709 Product \u589E\u52A0\u89C4\u683C\uFF1B\u5E94\u4F7F\u7528\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u8BED\u4E49\u547D\u4EE4\u3002\u8BE5\u5DE5\u5177\u4F1A\u5199\u5165\u4E1A\u52A1\u6570\u636E\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\uFF1B\u521B\u5EFA\u524D\u5E94\u786E\u8BA4\u540D\u79F0\u548C\u9996\u4E2A\u89C4\u683C\u5B57\u6BB5\u3002",
|
|
15752
|
+
scope: "erp:write",
|
|
15753
|
+
annotations: writeAnnotations,
|
|
15754
|
+
input: createProductInputSchema,
|
|
15755
|
+
output: output(createProductResponseSchema, false)
|
|
15756
|
+
};
|
|
15757
|
+
var updateProductTool = {
|
|
15758
|
+
name: "update_product",
|
|
15759
|
+
description: "\u6309\u5B8C\u6574 PR \u4E1A\u52A1\u7F16\u7801\u66F4\u65B0 Product\u3002\u5FC5\u987B\u5148\u8BFB\u53D6\u76EE\u6807\u53D6\u5F97\u6700\u65B0 version\uFF1B\u7248\u672C\u51B2\u7A81\u65F6\u4E0D\u5F97\u81EA\u52A8\u8986\u76D6\u3002\u53EA\u66F4\u65B0 changes \u4E2D\u663E\u5F0F\u63D0\u4F9B\u7684\u5B57\u6BB5\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15760
|
+
scope: "erp:write",
|
|
15761
|
+
annotations: writeAnnotations,
|
|
15762
|
+
input: external_exports.object({
|
|
15763
|
+
productCode: productCodeSchema,
|
|
15764
|
+
expectedVersion: expectedVersionInputSchema,
|
|
15765
|
+
changes: updateProductInputSchema.describe("\u4EC5\u5305\u542B\u9700\u8981\u53D8\u66F4\u7684 Product \u5B57\u6BB5\u3002")
|
|
15766
|
+
}).strict(),
|
|
15767
|
+
output: output(productSummarySchema, false)
|
|
15768
|
+
};
|
|
15769
|
+
var updateProductSpecTool = {
|
|
15770
|
+
name: "update_product_spec",
|
|
15771
|
+
description: "\u6309\u5B8C\u6574 PS \u4E1A\u52A1\u7F16\u7801\u66F4\u65B0 ProductSpec\u3002\u5FC5\u987B\u5148\u8BFB\u53D6\u76EE\u6807\u53D6\u5F97\u6700\u65B0 version\uFF1Bnull \u4F1A\u6E05\u7A7A\u53EF\u7A7A\u5B57\u6BB5\uFF0C\u7248\u672C\u51B2\u7A81\u4E0D\u5F97\u81EA\u52A8\u8986\u76D6\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15772
|
+
scope: "erp:write",
|
|
15773
|
+
annotations: writeAnnotations,
|
|
15774
|
+
input: external_exports.object({
|
|
15775
|
+
productSpecCode: productSpecCodeSchema,
|
|
15776
|
+
expectedVersion: expectedVersionInputSchema,
|
|
15777
|
+
changes: updateProductSpecInputSchema.describe("\u4EC5\u5305\u542B\u9700\u8981\u53D8\u66F4\u7684 ProductSpec \u5B57\u6BB5\uFF1Bnull \u6E05\u7A7A\u53EF\u7A7A\u5B57\u6BB5\u3002")
|
|
15778
|
+
}).strict(),
|
|
15779
|
+
output: output(productSpecRecordSchema, false)
|
|
15780
|
+
};
|
|
15781
|
+
var createPackTool = {
|
|
15782
|
+
name: "create_pack",
|
|
15783
|
+
description: "\u4E3A\u5DF2\u5B58\u5728\u7684\u53D7\u63A7 Supplier \u521B\u5EFA Pack\uFF0C\u7CFB\u7EDF\u751F\u6210\u4E0D\u53EF\u53D8 PK \u4E1A\u52A1\u7F16\u7801\u3002\u9002\u7528\uFF1A\u7528\u6237\u660E\u786E\u8981\u65B0\u5EFA\u5B9E\u9645\u4EA4\u4ED8\u5305\u88F9\uFF1B\u4E0D\u9002\u7528\uFF1A\u53EA\u60F3\u628A\u5DF2\u6709 Pack \u5173\u8054\u5230\u89C4\u683C\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15784
|
+
scope: "erp:write",
|
|
15785
|
+
annotations: writeAnnotations,
|
|
15786
|
+
input: createPackInputSchema,
|
|
15787
|
+
output: output(packSummarySchema, false)
|
|
15788
|
+
};
|
|
15789
|
+
var updatePackTool = {
|
|
15790
|
+
name: "update_pack",
|
|
15791
|
+
description: "\u6309\u5B8C\u6574 PK \u4E1A\u52A1\u7F16\u7801\u66F4\u65B0 Pack\u3002\u5FC5\u987B\u5148\u8BFB\u53D6\u76EE\u6807\u53D6\u5F97\u6700\u65B0 version\uFF1B\u53EA\u66F4\u65B0 changes \u4E2D\u663E\u5F0F\u5B57\u6BB5\uFF0C\u7248\u672C\u51B2\u7A81\u4E0D\u5F97\u81EA\u52A8\u8986\u76D6\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15792
|
+
scope: "erp:write",
|
|
15793
|
+
annotations: writeAnnotations,
|
|
15794
|
+
input: external_exports.object({
|
|
15795
|
+
packCode: packCodeSchema,
|
|
15796
|
+
expectedVersion: expectedVersionInputSchema,
|
|
15797
|
+
changes: updatePackInputSchema.describe("\u4EC5\u5305\u542B\u9700\u8981\u53D8\u66F4\u7684 Pack \u5B57\u6BB5\uFF1Bnull \u6E05\u7A7A\u53EF\u7A7A\u5B57\u6BB5\u3002")
|
|
15798
|
+
}).strict(),
|
|
15799
|
+
output: output(packSummarySchema, false)
|
|
15800
|
+
};
|
|
15801
|
+
var addProductSpecPackMappingTool = {
|
|
15802
|
+
name: "add_product_spec_pack_mapping",
|
|
15803
|
+
description: "\u628A\u5DF2\u6709 Pack \u5173\u8054\u5230 ProductSpec\uFF0C\u5E76\u8BBE\u7F6E\u6B63\u6574\u6570 quantity\u3002\u5FC5\u987B\u5148\u8BFB\u53D6 ProductSpec \u53D6\u5F97\u6700\u65B0 version\uFF1B\u540C\u4E00 Pack \u4E0D\u53EF\u91CD\u590D\u5173\u8054\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15804
|
+
scope: "erp:write",
|
|
15805
|
+
annotations: writeAnnotations,
|
|
15806
|
+
input: external_exports.object({
|
|
15807
|
+
productSpecCode: productSpecCodeSchema,
|
|
15808
|
+
expectedVersion: expectedVersionInputSchema,
|
|
15809
|
+
mapping: createMappingInputSchema.describe("\u8981\u65B0\u589E\u7684 Pack \u4E1A\u52A1\u7F16\u7801\u4E0E\u6B63\u6574\u6570\u5305\u88F9\u6570\u91CF\u3002")
|
|
15810
|
+
}).strict(),
|
|
15811
|
+
output: output(mappingResponseSchema, false)
|
|
15812
|
+
};
|
|
15813
|
+
var updateProductSpecPackMappingTool = {
|
|
15814
|
+
name: "update_product_spec_pack_mapping",
|
|
15815
|
+
description: "\u4FEE\u6539\u5DF2\u5B58\u5728 ProductSpec\u2014Pack \u6620\u5C04\u7684 quantity\u3002\u5FC5\u987B\u5148\u8BFB\u53D6 ProductSpec \u53D6\u5F97\u6700\u65B0 version\uFF1B\u4E0D\u4F1A\u4FEE\u6539 Pack \u672C\u8EAB\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15816
|
+
scope: "erp:write",
|
|
15817
|
+
annotations: writeAnnotations,
|
|
15818
|
+
input: external_exports.object({
|
|
15819
|
+
productSpecCode: productSpecCodeSchema,
|
|
15820
|
+
packCode: packCodeSchema,
|
|
15821
|
+
expectedVersion: expectedVersionInputSchema,
|
|
15822
|
+
changes: updateMappingInputSchema.describe("\u6620\u5C04\u7684\u65B0\u6B63\u6574\u6570\u5305\u88F9\u6570\u91CF\u3002")
|
|
15823
|
+
}).strict(),
|
|
15824
|
+
output: output(mappingResponseSchema, false)
|
|
15825
|
+
};
|
|
15826
|
+
var removeProductSpecPackMappingTool = {
|
|
15827
|
+
name: "remove_product_spec_pack_mapping",
|
|
15828
|
+
description: "\u89E3\u7ED1 ProductSpec \u4E0E Pack\uFF0C\u4E0D\u5220\u9664\u4E24\u7AEF\u4E3B\u6570\u636E\u3002\u8BE5\u64CD\u4F5C\u4F1A\u6539\u53D8\u5305\u88C5\u6784\u6210\u548C\u8D44\u6599\u5B8C\u6574\u5EA6\uFF1B\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u89E3\u7ED1\u65F6\u8C03\u7528\u3002\u5FC5\u987B\u4F7F\u7528 ProductSpec \u6700\u65B0 version\u3002\u7834\u574F\u6027\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15829
|
+
scope: "erp:write",
|
|
15830
|
+
annotations: destructiveAnnotations,
|
|
15831
|
+
input: external_exports.object({
|
|
15832
|
+
productSpecCode: productSpecCodeSchema,
|
|
15833
|
+
packCode: packCodeSchema,
|
|
15834
|
+
expectedVersion: expectedVersionInputSchema
|
|
15835
|
+
}).strict(),
|
|
15836
|
+
output: output(deleteMappingResponseSchema, false)
|
|
15837
|
+
};
|
|
15838
|
+
var createDevelopmentWorkListTool = {
|
|
15839
|
+
name: "create_development_work_list",
|
|
15840
|
+
description: "\u521B\u5EFA\u7A7A\u7684 DevelopmentWorkList\u3002\u5DE5\u4F5C\u6E05\u5355\u53EA\u5F15\u7528\u4EA7\u54C1\u4E3B\u6570\u636E\uFF1B\u540C\u4E00\u903B\u8F91\u8BF7\u6C42\u91CD\u8BD5\u65F6\u5FC5\u987B\u590D\u7528 idempotencyKey\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15841
|
+
scope: "erp:write",
|
|
15842
|
+
annotations: { ...writeAnnotations, idempotentHint: true },
|
|
15843
|
+
input: createDevelopmentWorkListInputSchema.extend({ idempotencyKey: idempotencyKeyInputSchema }).strict(),
|
|
15844
|
+
output: output(workListResponseSchema, false)
|
|
15845
|
+
};
|
|
15846
|
+
var applyDevelopmentWorkListCommandTool = {
|
|
15847
|
+
name: "apply_development_work_list_command",
|
|
15848
|
+
description: "\u539F\u5B50\u6267\u884C\u4E00\u4E2A\u5F00\u53D1\u5DE5\u4F5C\u6E05\u5355\u8BED\u4E49\u547D\u4EE4\u3002REMOVE_* \u53EA\u79FB\u51FA\u6E05\u5355\uFF0CREMOVE_PACK_REFERENCE \u4F1A\u89E3\u7ED1\u6620\u5C04\uFF1B\u7531\u4E8E\u5305\u542B\u7834\u574F\u6027\u5206\u652F\uFF0C\u4EC5\u5728\u7528\u6237\u610F\u56FE\u660E\u786E\u65F6\u8C03\u7528\u3002\u5FC5\u987B\u4F7F\u7528\u6E05\u5355\u6700\u65B0 version\uFF0C\u540C\u4E00\u903B\u8F91\u8BF7\u6C42\u91CD\u8BD5\u5FC5\u987B\u590D\u7528 idempotencyKey\u3002\u5199\u64CD\u4F5C\uFF0C\u8981\u6C42\u5F53\u524D\u5458\u5DE5\u6388\u6743 erp:write\u3002",
|
|
15849
|
+
scope: "erp:write",
|
|
15850
|
+
annotations: { ...destructiveAnnotations, idempotentHint: true },
|
|
15851
|
+
input: external_exports.object({
|
|
15852
|
+
workListId: external_exports.number().int().positive().describe("\u5DE5\u4F5C\u6E05\u5355\u5185\u90E8 ID\uFF0C\u7531\u5217\u8868\u67E5\u8BE2\u8FD4\u56DE\uFF1B\u4E0D\u662F\u4E1A\u52A1\u7F16\u7801\u3002"),
|
|
15853
|
+
expectedVersion: expectedVersionInputSchema,
|
|
15854
|
+
idempotencyKey: idempotencyKeyInputSchema,
|
|
15855
|
+
command: developmentWorkListCommandSchema.describe("\u5355\u4E2A\u539F\u5B50\u5DE5\u4F5C\u6E05\u5355\u8BED\u4E49\u547D\u4EE4\u3002")
|
|
15856
|
+
}).strict(),
|
|
15857
|
+
output: output(workListResponseSchema, false)
|
|
14929
15858
|
};
|
|
14930
15859
|
|
|
14931
15860
|
// src/auth-client.ts
|
|
@@ -14956,7 +15885,7 @@ function parseErpBaseUrl(raw) {
|
|
|
14956
15885
|
|
|
14957
15886
|
// src/auth-client.ts
|
|
14958
15887
|
var CLIENT_ID = "erp-cli";
|
|
14959
|
-
var SCOPE = "openid erp:read offline_access";
|
|
15888
|
+
var SCOPE = "openid erp:read erp:write offline_access";
|
|
14960
15889
|
var DEFAULT_LOOPBACK_PORT = 53682;
|
|
14961
15890
|
var CALLBACK_TIMEOUT_MS = 18e4;
|
|
14962
15891
|
function base64Url(value) {
|
|
@@ -15135,10 +16064,10 @@ async function logoutCredential(dependencies) {
|
|
|
15135
16064
|
|
|
15136
16065
|
// src/operations.ts
|
|
15137
16066
|
var operations = Object.fromEntries(
|
|
15138
|
-
|
|
16067
|
+
erpAgentOperations.map((operation) => [operation.operationId, operationDefinitionFor(operation)])
|
|
15139
16068
|
);
|
|
15140
16069
|
var operationContracts = new Map(
|
|
15141
|
-
|
|
16070
|
+
erpAgentOperations.map((operation) => [operation.operationId, operation])
|
|
15142
16071
|
);
|
|
15143
16072
|
function operationDefinitionFor(operation) {
|
|
15144
16073
|
return {
|
|
@@ -15146,11 +16075,38 @@ function operationDefinitionFor(operation) {
|
|
|
15146
16075
|
method: operation.method,
|
|
15147
16076
|
path: operation.path,
|
|
15148
16077
|
summary: operation.summary,
|
|
15149
|
-
|
|
16078
|
+
description: operation.description,
|
|
16079
|
+
agentExposed: operation.agent.exposed,
|
|
16080
|
+
agentReadOnly: operation.agent.readOnly,
|
|
16081
|
+
destructive: operation.agent.destructive,
|
|
16082
|
+
idempotent: operation.agent.idempotent,
|
|
16083
|
+
requiredScope: operation.scope,
|
|
16084
|
+
...operation.request.body ? {
|
|
16085
|
+
bodySchema: withoutDialect(
|
|
16086
|
+
external_exports.toJSONSchema(operation.request.body, { io: "input" })
|
|
16087
|
+
)
|
|
16088
|
+
} : {},
|
|
16089
|
+
...operation.request.file ? { file: operation.request.file } : {},
|
|
15150
16090
|
command: operation.cli.path.join(" "),
|
|
15151
16091
|
parameters: [
|
|
15152
16092
|
...describeParameters(operation.request.path, "path"),
|
|
15153
|
-
...describeParameters(operation.request.query, "query")
|
|
16093
|
+
...describeParameters(operation.request.query, "query"),
|
|
16094
|
+
...describeParameters(operation.request.headers, "header"),
|
|
16095
|
+
...operation.request.file ? [
|
|
16096
|
+
{
|
|
16097
|
+
name: operation.request.file.parameterName,
|
|
16098
|
+
in: "file",
|
|
16099
|
+
required: true,
|
|
16100
|
+
description: operation.request.file.description,
|
|
16101
|
+
schema: {
|
|
16102
|
+
type: "string",
|
|
16103
|
+
format: "path",
|
|
16104
|
+
maxSizeBytes: operation.request.file.maxSizeBytes,
|
|
16105
|
+
allowedMediaTypes: operation.request.file.allowedMediaTypes,
|
|
16106
|
+
allowedExtensions: operation.request.file.allowedExtensions
|
|
16107
|
+
}
|
|
16108
|
+
}
|
|
16109
|
+
] : []
|
|
15154
16110
|
].sort((left, right) => `${left.in}:${left.name}`.localeCompare(`${right.in}:${right.name}`))
|
|
15155
16111
|
};
|
|
15156
16112
|
}
|
|
@@ -15171,26 +16127,85 @@ function withoutDialect(schema) {
|
|
|
15171
16127
|
}
|
|
15172
16128
|
|
|
15173
16129
|
// src/operation-client.ts
|
|
15174
|
-
|
|
16130
|
+
import { readFile } from "node:fs/promises";
|
|
16131
|
+
import { basename, extname } from "node:path";
|
|
16132
|
+
async function callOperation(operation, values, dependencies, contract) {
|
|
15175
16133
|
validateArguments(operation, values);
|
|
15176
16134
|
if (!dependencies.accessToken) throw new Error("ERP_ACCESS_TOKEN_REQUIRED");
|
|
15177
16135
|
const baseUrl = parseErpBaseUrl(dependencies.baseUrl);
|
|
15178
16136
|
const path = contract ? buildValidatedContractPath(contract, values) : buildLegacyPath(operation, values);
|
|
15179
16137
|
const url2 = new URL(path.replace(/^\//, ""), `${baseUrl.toString().replace(/\/$/, "")}/`);
|
|
16138
|
+
const requestBody = contract?.request.body ? parseRequestBody(values.body, contract) : void 0;
|
|
16139
|
+
const multipartBody = contract?.request.file ? await createMultipartBody(values, contract.request.file) : void 0;
|
|
16140
|
+
const contractHeaders = contract ? parseContractHeaders(values, contract) : {};
|
|
15180
16141
|
const response = await dependencies.fetch(url2.toString(), {
|
|
15181
|
-
method:
|
|
16142
|
+
method: operation.method,
|
|
15182
16143
|
headers: {
|
|
15183
16144
|
accept: "application/json",
|
|
15184
|
-
authorization: `Bearer ${dependencies.accessToken}
|
|
15185
|
-
|
|
16145
|
+
authorization: `Bearer ${dependencies.accessToken}`,
|
|
16146
|
+
...contractHeaders,
|
|
16147
|
+
...requestBody ? { "content-type": "application/json" } : {}
|
|
16148
|
+
},
|
|
16149
|
+
...requestBody ? { body: JSON.stringify(requestBody) } : multipartBody ? { body: multipartBody } : {}
|
|
15186
16150
|
});
|
|
15187
16151
|
const body = await response.json();
|
|
15188
|
-
if (!response.ok) throw new Error(`ERP_HTTP_${response.status}`);
|
|
16152
|
+
if (!response.ok) throw new Error(apiErrorCode(body) ?? `ERP_HTTP_${response.status}`);
|
|
15189
16153
|
return contract ? parseContractEnvelope(contract, body) : body;
|
|
15190
16154
|
}
|
|
16155
|
+
async function createMultipartBody(values, file2) {
|
|
16156
|
+
const filePath = values[file2.parameterName];
|
|
16157
|
+
if (!filePath) throw new Error(`MISSING_REQUIRED_ARGUMENT:${file2.parameterName}`);
|
|
16158
|
+
const extension = extname(filePath).slice(1).toLowerCase();
|
|
16159
|
+
const mediaType = mediaTypeForExtension(extension);
|
|
16160
|
+
if (!file2.allowedExtensions.includes(extension) || !file2.allowedMediaTypes.includes(mediaType)) {
|
|
16161
|
+
throw new Error("INVALID_ARGUMENT");
|
|
16162
|
+
}
|
|
16163
|
+
let contents;
|
|
16164
|
+
try {
|
|
16165
|
+
contents = await readFile(filePath);
|
|
16166
|
+
} catch {
|
|
16167
|
+
throw new Error("FILE_NOT_READABLE");
|
|
16168
|
+
}
|
|
16169
|
+
if (contents.byteLength > file2.maxSizeBytes) throw new Error("FILE_TOO_LARGE");
|
|
16170
|
+
const body = new FormData();
|
|
16171
|
+
body.append(
|
|
16172
|
+
file2.parameterName,
|
|
16173
|
+
new Blob([Uint8Array.from(contents)], { type: mediaType }),
|
|
16174
|
+
basename(filePath)
|
|
16175
|
+
);
|
|
16176
|
+
return body;
|
|
16177
|
+
}
|
|
16178
|
+
function mediaTypeForExtension(extension) {
|
|
16179
|
+
if (extension === "jpg" || extension === "jpeg") return "image/jpeg";
|
|
16180
|
+
if (extension === "png") return "image/png";
|
|
16181
|
+
if (extension === "webp") return "image/webp";
|
|
16182
|
+
return "application/octet-stream";
|
|
16183
|
+
}
|
|
16184
|
+
function apiErrorCode(body) {
|
|
16185
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) return void 0;
|
|
16186
|
+
const error51 = body.error;
|
|
16187
|
+
if (!error51 || typeof error51 !== "object" || Array.isArray(error51)) return void 0;
|
|
16188
|
+
const code = error51.code;
|
|
16189
|
+
return typeof code === "string" && /^[A-Z][A-Z0-9_]*$/.test(code) ? code : void 0;
|
|
16190
|
+
}
|
|
16191
|
+
function parseContractHeaders(values, operation) {
|
|
16192
|
+
if (!operation.request.headers) return {};
|
|
16193
|
+
try {
|
|
16194
|
+
const names = Object.keys(operation.request.headers.shape);
|
|
16195
|
+
const parsed = operation.request.headers.parse(
|
|
16196
|
+
Object.fromEntries(Object.entries(values).filter(([name]) => names.includes(name)))
|
|
16197
|
+
);
|
|
16198
|
+
return {
|
|
16199
|
+
...typeof parsed.expectedVersion === "number" ? { "if-match": `"v${parsed.expectedVersion}"` } : {},
|
|
16200
|
+
...typeof parsed.idempotencyKey === "string" ? { "idempotency-key": parsed.idempotencyKey } : {}
|
|
16201
|
+
};
|
|
16202
|
+
} catch {
|
|
16203
|
+
throw new Error("INVALID_ARGUMENT");
|
|
16204
|
+
}
|
|
16205
|
+
}
|
|
15191
16206
|
function buildValidatedContractPath(contract, values) {
|
|
15192
16207
|
try {
|
|
15193
|
-
return
|
|
16208
|
+
return buildOperationPath(contract, splitContractArguments(contract, values));
|
|
15194
16209
|
} catch {
|
|
15195
16210
|
throw new Error("INVALID_ARGUMENT");
|
|
15196
16211
|
}
|
|
@@ -15223,8 +16238,18 @@ function parseContractEnvelope(operation, body) {
|
|
|
15223
16238
|
if (!parsed.success) throw new Error("CONTRACT_RESPONSE_INVALID");
|
|
15224
16239
|
return { data: parsed.data, error: null };
|
|
15225
16240
|
}
|
|
16241
|
+
function parseRequestBody(value, operation) {
|
|
16242
|
+
if (value === void 0) throw new Error("MISSING_REQUIRED_ARGUMENT:body");
|
|
16243
|
+
try {
|
|
16244
|
+
const parsed = JSON.parse(value);
|
|
16245
|
+
return operation.request.body.parse(parsed);
|
|
16246
|
+
} catch {
|
|
16247
|
+
throw new Error("INVALID_ARGUMENT");
|
|
16248
|
+
}
|
|
16249
|
+
}
|
|
15226
16250
|
function validateArguments(operation, values) {
|
|
15227
16251
|
const parameters = new Map(operation.parameters.map((parameter) => [parameter.name, parameter]));
|
|
16252
|
+
if (operation.bodySchema) parameters.set("body", { name: "body", in: "body", required: true });
|
|
15228
16253
|
for (const name of Object.keys(values)) {
|
|
15229
16254
|
if (!parameters.has(name)) throw new Error(`UNKNOWN_ARGUMENT:${name}`);
|
|
15230
16255
|
}
|
|
@@ -15364,31 +16389,63 @@ async function runCli(args2, dependencies) {
|
|
|
15364
16389
|
return 1;
|
|
15365
16390
|
}
|
|
15366
16391
|
if (args2[0] === "list") {
|
|
15367
|
-
const operations2 = Object.values(dependencies.operations).filter(
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15372
|
-
|
|
15373
|
-
|
|
16392
|
+
const operations2 = Object.values(dependencies.operations).filter(isCallableAgentOperation).sort((left, right) => left.operationId.localeCompare(right.operationId)).map(
|
|
16393
|
+
({
|
|
16394
|
+
operationId,
|
|
16395
|
+
method,
|
|
16396
|
+
path,
|
|
16397
|
+
summary,
|
|
16398
|
+
command,
|
|
16399
|
+
requiredScope,
|
|
16400
|
+
agentReadOnly,
|
|
16401
|
+
destructive,
|
|
16402
|
+
idempotent
|
|
16403
|
+
}) => ({
|
|
16404
|
+
operationId,
|
|
16405
|
+
method,
|
|
16406
|
+
path,
|
|
16407
|
+
summary,
|
|
16408
|
+
...requiredScope ? { requiredScope } : {},
|
|
16409
|
+
readOnly: agentReadOnly,
|
|
16410
|
+
destructive: destructive ?? false,
|
|
16411
|
+
idempotent: idempotent ?? agentReadOnly,
|
|
16412
|
+
...command ? { command } : {}
|
|
16413
|
+
})
|
|
16414
|
+
);
|
|
15374
16415
|
dependencies.stdout(`${JSON.stringify(operations2)}
|
|
15375
16416
|
`);
|
|
15376
16417
|
return 0;
|
|
15377
16418
|
}
|
|
15378
16419
|
if (args2[0] === "describe") {
|
|
15379
16420
|
const operation = args2[1] ? dependencies.operations[args2[1]] : void 0;
|
|
15380
|
-
if (!operation || !
|
|
16421
|
+
if (!operation || !isCallableAgentOperation(operation)) {
|
|
15381
16422
|
dependencies.stderr(`${JSON.stringify({ error: "OPERATION_NOT_CALLABLE" })}
|
|
15382
16423
|
`);
|
|
15383
16424
|
return 1;
|
|
15384
16425
|
}
|
|
15385
16426
|
dependencies.stdout(`${JSON.stringify(operation)}
|
|
16427
|
+
`);
|
|
16428
|
+
return 0;
|
|
16429
|
+
}
|
|
16430
|
+
if (args2[0] === "domain" && args2[1] === "list" && args2.length === 2) {
|
|
16431
|
+
dependencies.stdout(`${JSON.stringify(listErpDomainTopics())}
|
|
16432
|
+
`);
|
|
16433
|
+
return 0;
|
|
16434
|
+
}
|
|
16435
|
+
if (args2[0] === "domain" && args2[1] === "get" && args2.length === 3) {
|
|
16436
|
+
const topic = getErpDomainTopic(args2[2] ?? "");
|
|
16437
|
+
if (!topic) {
|
|
16438
|
+
dependencies.stderr(`${JSON.stringify({ error: "DOMAIN_TOPIC_NOT_FOUND" })}
|
|
16439
|
+
`);
|
|
16440
|
+
return 1;
|
|
16441
|
+
}
|
|
16442
|
+
dependencies.stdout(`${JSON.stringify(topic)}
|
|
15386
16443
|
`);
|
|
15387
16444
|
return 0;
|
|
15388
16445
|
}
|
|
15389
16446
|
if (args2[0] === "call") {
|
|
15390
16447
|
const operation = args2[1] ? dependencies.operations[args2[1]] : void 0;
|
|
15391
|
-
if (!operation || !
|
|
16448
|
+
if (!operation || !isCallableAgentOperation(operation)) {
|
|
15392
16449
|
dependencies.stderr(`${JSON.stringify({ error: "OPERATION_NOT_CALLABLE" })}
|
|
15393
16450
|
`);
|
|
15394
16451
|
return 1;
|
|
@@ -15402,7 +16459,7 @@ async function runCli(args2, dependencies) {
|
|
|
15402
16459
|
fetch: dependencies.fetch,
|
|
15403
16460
|
now: dependencies.now
|
|
15404
16461
|
}) : dependencies.accessToken;
|
|
15405
|
-
const body = await
|
|
16462
|
+
const body = await callOperation(
|
|
15406
16463
|
operation,
|
|
15407
16464
|
values,
|
|
15408
16465
|
{ ...dependencies, accessToken },
|
|
@@ -15419,7 +16476,7 @@ async function runCli(args2, dependencies) {
|
|
|
15419
16476
|
return 1;
|
|
15420
16477
|
}
|
|
15421
16478
|
}
|
|
15422
|
-
const domainOperation =
|
|
16479
|
+
const domainOperation = erpAgentOperations.find(
|
|
15423
16480
|
(operation) => operation.cli.path[0] === args2[0] && operation.cli.path[1] === args2[1]
|
|
15424
16481
|
);
|
|
15425
16482
|
if (domainOperation) {
|
|
@@ -15433,7 +16490,7 @@ async function runCli(args2, dependencies) {
|
|
|
15433
16490
|
now: dependencies.now
|
|
15434
16491
|
}) : dependencies.accessToken;
|
|
15435
16492
|
const operation = operationDefinitionFor(domainOperation);
|
|
15436
|
-
const body = await
|
|
16493
|
+
const body = await callOperation(
|
|
15437
16494
|
operation,
|
|
15438
16495
|
values,
|
|
15439
16496
|
{ ...dependencies, accessToken },
|
|
@@ -15466,8 +16523,8 @@ function parseDomainArguments(operation, args2) {
|
|
|
15466
16523
|
}
|
|
15467
16524
|
return { ...values, ...parseArguments(args2.slice(positionalIndex)) };
|
|
15468
16525
|
}
|
|
15469
|
-
function
|
|
15470
|
-
return operation.agentReadOnly === true && operation.method === "GET";
|
|
16526
|
+
function isCallableAgentOperation(operation) {
|
|
16527
|
+
return operation.agentExposed === true || operation.agentReadOnly === true && operation.method === "GET";
|
|
15471
16528
|
}
|
|
15472
16529
|
function parseArguments(args2) {
|
|
15473
16530
|
const values = {};
|
|
@@ -15493,7 +16550,7 @@ import {
|
|
|
15493
16550
|
chmod,
|
|
15494
16551
|
mkdir,
|
|
15495
16552
|
open,
|
|
15496
|
-
readFile,
|
|
16553
|
+
readFile as readFile2,
|
|
15497
16554
|
rename,
|
|
15498
16555
|
stat,
|
|
15499
16556
|
unlink,
|
|
@@ -15567,7 +16624,7 @@ function createCredentialStore(path = defaultCredentialPath(), options = {}) {
|
|
|
15567
16624
|
clearInterval(heartbeat);
|
|
15568
16625
|
await handle.close().catch(() => void 0);
|
|
15569
16626
|
try {
|
|
15570
|
-
if ((await
|
|
16627
|
+
if ((await readFile2(lockPath, "utf8")).trim() === owner) await unlink(lockPath);
|
|
15571
16628
|
} catch {
|
|
15572
16629
|
}
|
|
15573
16630
|
}
|
|
@@ -15575,7 +16632,7 @@ function createCredentialStore(path = defaultCredentialPath(), options = {}) {
|
|
|
15575
16632
|
return {
|
|
15576
16633
|
async load() {
|
|
15577
16634
|
try {
|
|
15578
|
-
const value = JSON.parse(await
|
|
16635
|
+
const value = JSON.parse(await readFile2(path, "utf8"));
|
|
15579
16636
|
return isCredential(value) ? value : null;
|
|
15580
16637
|
} catch (error51) {
|
|
15581
16638
|
if (error51.code === "ENOENT") return null;
|
|
@@ -15613,8 +16670,8 @@ function createCredentialStore(path = defaultCredentialPath(), options = {}) {
|
|
|
15613
16670
|
// package.json
|
|
15614
16671
|
var package_default = {
|
|
15615
16672
|
name: "intonear-erp-cli",
|
|
15616
|
-
version: "0.
|
|
15617
|
-
description: "intoNear ERP \
|
|
16673
|
+
version: "0.2.0",
|
|
16674
|
+
description: "intoNear ERP \u6E10\u8FDB\u5F0F\u8BFB\u5199\u547D\u4EE4\u884C\u5BA2\u6237\u7AEF",
|
|
15618
16675
|
type: "module",
|
|
15619
16676
|
bin: {
|
|
15620
16677
|
"intonear-cli": "dist/bin.js"
|
|
@@ -15662,10 +16719,14 @@ var help = `intoNear ERP CLI
|
|
|
15662
16719
|
auth status \u67E5\u770B\u6388\u6743\u72B6\u6001
|
|
15663
16720
|
auth logout \u53D6\u6D88\u6388\u6743
|
|
15664
16721
|
|
|
15665
|
-
\
|
|
15666
|
-
list \u5217\u51FA\
|
|
16722
|
+
\u4E1A\u52A1\u547D\u4EE4\uFF1A
|
|
16723
|
+
list \u5217\u51FA\u5DF2\u5F00\u653E\u7684\u8BFB\u5199\u64CD\u4F5C
|
|
15667
16724
|
describe <operationId> \u67E5\u770B\u64CD\u4F5C\u53C2\u6570
|
|
15668
|
-
call <operationId> [...] \u8C03\u7528\
|
|
16725
|
+
call <operationId> [...] \u8C03\u7528\u64CD\u4F5C\uFF1BJSON \u4F7F\u7528 --body\uFF0C\u6587\u4EF6\u4F7F\u7528 --file
|
|
16726
|
+
|
|
16727
|
+
\u9886\u57DF\u4E0A\u4E0B\u6587\uFF1A
|
|
16728
|
+
domain list \u5217\u51FA\u53EF\u6309\u9700\u8BFB\u53D6\u7684\u9886\u57DF\u4E3B\u9898
|
|
16729
|
+
domain get <topic> \u8BFB\u53D6\u4E00\u4E2A\u9886\u57DF\u4E3B\u9898
|
|
15669
16730
|
|
|
15670
16731
|
\u9009\u9879\uFF1A
|
|
15671
16732
|
--help \u663E\u793A\u5E2E\u52A9
|