@youzan-cloud/zan-saas-cli 0.1.0-beta.4 → 0.1.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/bin/zan-saas-cli.js +8 -11
  2. package/internal/registry/manifest.json +25 -20
  3. package/npm-shrinkwrap.json +2 -2
  4. package/package.json +1 -1
  5. package/skills/zan-saas/SKILL.md +3 -3
  6. package/skills/zan-saas/references/host-entry.md +8 -0
  7. package/skills/zan-saas-order/SKILL.md +12 -1
  8. package/skills/zan-saas-order/references/branch-counts.md +45 -0
  9. package/skills/zan-saas-order/references/order-get.md +2 -0
  10. package/skills/zan-saas-order/references/order-list.md +2 -0
  11. package/skills/zan-saas-order/references/order-scan.md +2 -0
  12. package/skills/zan-saas-org/SKILL.md +6 -0
  13. package/skills/zan-saas-org/references/unit-list.md +2 -0
  14. package/skills/zan-saas-shared/SKILL.md +20 -5
  15. package/skills/zan-saas-shared/references/authentication.md +9 -4
  16. package/skills/zan-saas-shared/references/gateway-errors.md +29 -0
  17. package/skills/zan-saas-shared/references/shop-context.md +39 -0
  18. package/skills/zan-saas-valuecard/SKILL.md +8 -2
  19. package/skills/zan-saas-valuecard/references/transaction-list.md +25 -0
  20. package/skills/zan-saas-valuecard/references/transaction-scan.md +23 -0
  21. package/src/auth/credential-source.js +26 -0
  22. package/src/auth/credential-store.js +61 -5
  23. package/src/auth/session.js +80 -27
  24. package/src/cli/command-paths.js +3 -2
  25. package/src/cli/context-help.js +3 -1
  26. package/src/cli/program.js +20 -4
  27. package/src/commands/native/access/commands.index.json +1 -1
  28. package/src/commands/native/access/role/list/command.js +4 -32
  29. package/src/commands/native/customer/commands.index.json +1 -1
  30. package/src/commands/native/customer/customer-tag/list/command.js +2 -2
  31. package/src/commands/native/member/commands.index.json +1 -1
  32. package/src/commands/native/order/commands.index.json +3 -3
  33. package/src/commands/native/order/order/get/command.js +14 -9
  34. package/src/commands/native/order/order/get/schema.json +197 -41
  35. package/src/commands/native/order/order/list/command.js +9 -6
  36. package/src/commands/native/order/order/list/schema.json +140 -10
  37. package/src/commands/native/order/order/scan/command.js +8 -5
  38. package/src/commands/native/order/order/scan/scan.js +1 -1
  39. package/src/commands/native/order/order/scan/schema.json +135 -8
  40. package/src/commands/native/order/shared/query.js +57 -9
  41. package/src/commands/native/order/shared/search.js +1 -1
  42. package/src/commands/native/org/commands.index.json +4 -4
  43. package/src/commands/native/valuecard/commands.index.json +20 -2
  44. package/src/commands/native/valuecard/domain.json +1 -1
  45. package/src/commands/native/valuecard/transaction/list/command.js +110 -0
  46. package/src/commands/native/valuecard/transaction/list/projection.js +71 -0
  47. package/src/commands/native/valuecard/transaction/list/schema.json +888 -0
  48. package/src/commands/native/valuecard/transaction/scan/command.js +130 -0
  49. package/src/commands/native/valuecard/transaction/scan/projection.js +58 -0
  50. package/src/commands/native/valuecard/transaction/scan/scan.js +70 -0
  51. package/src/commands/native/valuecard/transaction/scan/schema.json +954 -0
  52. package/src/commands/system/api.js +1 -1
  53. package/src/commands/system/auth.js +13 -2
  54. package/src/commands/system/contracts.js +27 -19
  55. package/src/commands/system/shop-contracts.js +97 -0
  56. package/src/commands/system/shop.js +128 -27
  57. package/src/execution/error-details.js +13 -18
  58. package/src/execution/gateway-guidance.js +43 -0
  59. package/src/execution/shop-query.js +6 -3
  60. package/src/identity/context-store.js +14 -10
  61. package/src/identity/file-store.js +147 -0
  62. package/src/identity/session-store.js +261 -0
  63. package/src/identity/shop-location.js +158 -0
  64. package/src/identity/unit-membership.js +42 -0
  65. package/src/transport/api.js +78 -11
  66. package/src/transport/shop-app.js +8 -1
@@ -0,0 +1,888 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "input": {
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "kdtId",
8
+ "bizType",
9
+ "occurredAt",
10
+ "pageNo",
11
+ "pageSize",
12
+ "format",
13
+ "dryRun"
14
+ ],
15
+ "properties": {
16
+ "kdtId": {
17
+ "$ref": "#/definitions/shopId"
18
+ },
19
+ "bizType": {
20
+ "$ref": "#/definitions/requestBizType"
21
+ },
22
+ "occurredAt": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "start",
27
+ "end"
28
+ ],
29
+ "properties": {
30
+ "start": {
31
+ "$ref": "#/definitions/dateTime"
32
+ },
33
+ "end": {
34
+ "$ref": "#/definitions/dateTime"
35
+ }
36
+ },
37
+ "description": "业务发生时间范围,两端必填且开始严格早于结束;仅支持秒精度,零毫秒规范化为 .000。"
38
+ },
39
+ "pageNo": {
40
+ "$ref": "#/definitions/pageNo"
41
+ },
42
+ "pageSize": {
43
+ "$ref": "#/definitions/pageSize"
44
+ },
45
+ "format": {
46
+ "enum": [
47
+ "json",
48
+ "pretty"
49
+ ],
50
+ "description": "json 为紧凑 JSON;pretty 仅改变缩进。"
51
+ },
52
+ "dryRun": {
53
+ "type": "boolean",
54
+ "description": "仅执行相同本地校验并返回请求预览,不读凭证、不联网。"
55
+ }
56
+ },
57
+ "description": "实际 argv 解析并补全店铺后的规范化业务输入,不是调用方传入的 JSON 或内部请求体;occurredAt 通过 --occurred-at START..END 输入。"
58
+ },
59
+ "output": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": [
63
+ "data"
64
+ ],
65
+ "properties": {
66
+ "data": {
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": [
70
+ "transactions",
71
+ "pagination"
72
+ ],
73
+ "properties": {
74
+ "transactions": {
75
+ "type": "array",
76
+ "maxItems": 50,
77
+ "description": "本次查询页的储值流水,保留记录顺序和无效记录;不去重,不保证稳定排序或完整历史。",
78
+ "items": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": [
82
+ "transactionNo",
83
+ "billCardNo",
84
+ "occurredAt",
85
+ "bizType",
86
+ "validity",
87
+ "amount",
88
+ "reportedBalance"
89
+ ],
90
+ "properties": {
91
+ "transactionNo": {
92
+ "$ref": "#/definitions/requiredText",
93
+ "description": "储值业务流水号,保留前导零;不承诺全局唯一。"
94
+ },
95
+ "billCardNo": {
96
+ "$ref": "#/definitions/requiredText",
97
+ "description": "流水记载的卡号,不保证与当前资产 card.cardNo、卡面号或汇总号相同。"
98
+ },
99
+ "occurredAt": {
100
+ "$ref": "#/definitions/dateTime",
101
+ "description": "记录中的业务发生时间,北京时间固定三位毫秒文本;不是订单创建时间。"
102
+ },
103
+ "bizType": {
104
+ "$ref": "#/definitions/requiredText",
105
+ "description": "服务端业务类型原值。RECHARGE 充值,GROUP_GIVE_RECHARGE 赠送,REFUND 退款,RECHARGE_REFUND 充值退款,PAY 消费或支付,ADJUSTMENT 调账,CARD_BALANCE_IMPORT 导入,RECEDE_CARD 退卡,GIFT_CARD_ACTIVE 激活或礼品卡激活,RECHARGE_BONUS 充值赠送,REFUND_CLOSE_TRANSFER 退款销卡转出/转入,COMBINE 卡换绑转出/转入。允许上述中文文本和未来未知非空字符串,未知含义不推断;不以请求补造方向。"
106
+ },
107
+ "validity": {
108
+ "$ref": "#/definitions/requiredText",
109
+ "description": "记录有效性原字符串:\"0\" 或 \"无效\" 表示无效,\"1\" 或 \"有效\" 表示有效。未知非空字符串保留且含义未知,不将数字转换为字符串,不删除无效记录;不是支付或退款处理状态。"
110
+ },
111
+ "amount": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": [
115
+ "totalAmount",
116
+ "principalAmount",
117
+ "bonusAmount"
118
+ ],
119
+ "properties": {
120
+ "totalAmount": {
121
+ "$ref": "#/definitions/money",
122
+ "description": "本次业务总金额,不代表统一余额增量。"
123
+ },
124
+ "principalAmount": {
125
+ "$ref": "#/definitions/money",
126
+ "description": "本次业务本金金额,保留原符号。"
127
+ },
128
+ "bonusAmount": {
129
+ "$ref": "#/definitions/money",
130
+ "description": "本次业务赠送金金额,保留原符号。"
131
+ }
132
+ },
133
+ "description": "本次业务金额,不按业务类型翻转符号,不强制总金额等于本金与赠送金之和。"
134
+ },
135
+ "reportedBalance": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": [
139
+ "totalBalance",
140
+ "principalBalance",
141
+ "bonusBalance"
142
+ ],
143
+ "properties": {
144
+ "totalBalance": {
145
+ "$ref": "#/definitions/money",
146
+ "description": "记录提供的总余额,等于记录本金与赠送金余额之和。"
147
+ },
148
+ "principalBalance": {
149
+ "$ref": "#/definitions/money",
150
+ "description": "记录提供的本金余额。"
151
+ },
152
+ "bonusBalance": {
153
+ "$ref": "#/definitions/money",
154
+ "description": "记录提供的赠送金余额。"
155
+ }
156
+ },
157
+ "description": "记录余额的时点未明确,不据此推算交易前后余额或自动对账。"
158
+ },
159
+ "kdtId": {
160
+ "type": "string",
161
+ "pattern": "^[1-9]\\d*$",
162
+ "description": "记录所属店铺的正安全整数十进制文本,不代表受理店铺 ID。"
163
+ },
164
+ "mobile": {
165
+ "type": "string",
166
+ "description": "记录中的手机号文本,不保证是稳定客户身份、明文或可还原值。"
167
+ },
168
+ "tradeNo": {
169
+ "type": "string",
170
+ "description": "关联的有赞交易单号,不限定 E 前缀。"
171
+ },
172
+ "externalRequestNo": {
173
+ "type": "string",
174
+ "description": "外部储值支付请求号,不等于订单号。"
175
+ },
176
+ "remark": {
177
+ "type": "string",
178
+ "description": "业务记录备注。"
179
+ },
180
+ "externalRemark": {
181
+ "type": "string",
182
+ "description": "外部储值支付请求备注。"
183
+ },
184
+ "nickname": {
185
+ "type": "string",
186
+ "description": "记录中的用户昵称,不用于身份匹配。"
187
+ },
188
+ "acceptShopName": {
189
+ "type": "string",
190
+ "description": "受理店铺名称,不能代替店铺 ID 或推定发卡机构。"
191
+ }
192
+ },
193
+ "description": "只返回已定义字段;必需字符串非空且无控制字符。可选字段缺失省略,空字符串保留,null 或错型失败。"
194
+ }
195
+ },
196
+ "pagination": {
197
+ "type": "object",
198
+ "additionalProperties": false,
199
+ "required": [
200
+ "pageNo",
201
+ "pageSize",
202
+ "returned",
203
+ "hasMore",
204
+ "nextPageNo",
205
+ "windowLimitReached"
206
+ ],
207
+ "properties": {
208
+ "pageNo": {
209
+ "$ref": "#/definitions/pageNo"
210
+ },
211
+ "pageSize": {
212
+ "$ref": "#/definitions/pageSize"
213
+ },
214
+ "returned": {
215
+ "type": "integer",
216
+ "minimum": 0,
217
+ "maximum": 50,
218
+ "description": "本页实际返回记录数,不大于实际容量。"
219
+ },
220
+ "total": {
221
+ "type": "integer",
222
+ "minimum": 0,
223
+ "maximum": 9007199254740991,
224
+ "description": "服务端本次店铺、业务类型和时间筛选的总数;无总数时省略,不代表全历史。"
225
+ },
226
+ "hasMore": {
227
+ "type": [
228
+ "boolean",
229
+ "null"
230
+ ],
231
+ "description": "有可靠总数时按 pageNo * pageSize < total 计算,否则 null;短页和空页不单独证明结束。"
232
+ },
233
+ "nextPageNo": {
234
+ "type": [
235
+ "integer",
236
+ "null"
237
+ ],
238
+ "minimum": 2,
239
+ "maximum": 5000,
240
+ "description": "仅确认仍有后页且下一页容量乘积不超过 5000 时给出下一页,否则 null。"
241
+ },
242
+ "windowLimitReached": {
243
+ "type": "boolean",
244
+ "description": "下一页越过 5000 窗口且仍有后页或不能确认耗尽时为 true。"
245
+ }
246
+ },
247
+ "description": "页码必须与请求一致,容量缺失才使用请求容量;错型和越界失败。保持原店铺、类型、窗口和容量继续读取,不保证跨页快照。"
248
+ }
249
+ }
250
+ }
251
+ }
252
+ },
253
+ "preview": {
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "required": [
257
+ "command",
258
+ "kind",
259
+ "risk",
260
+ "target",
261
+ "requests"
262
+ ],
263
+ "properties": {
264
+ "command": {
265
+ "const": "valuecard.transaction.list"
266
+ },
267
+ "kind": {
268
+ "const": "atomic"
269
+ },
270
+ "risk": {
271
+ "const": "read"
272
+ },
273
+ "target": {
274
+ "type": "object",
275
+ "additionalProperties": false,
276
+ "required": [
277
+ "kdtId"
278
+ ],
279
+ "properties": {
280
+ "kdtId": {
281
+ "$ref": "#/definitions/shopId"
282
+ }
283
+ }
284
+ },
285
+ "requests": {
286
+ "type": "array",
287
+ "minItems": 2,
288
+ "maxItems": 2,
289
+ "description": "按执行顺序列出同店绑定和单页流水请求,不含凭证或认证来源。",
290
+ "items": {
291
+ "anyOf": [
292
+ {
293
+ "type": "object",
294
+ "additionalProperties": false,
295
+ "required": [
296
+ "method",
297
+ "path",
298
+ "body"
299
+ ],
300
+ "properties": {
301
+ "method": {
302
+ "const": "POST"
303
+ },
304
+ "path": {
305
+ "const": "youzan.shop.basic.get/3.0.0"
306
+ },
307
+ "body": {
308
+ "type": "object",
309
+ "additionalProperties": false,
310
+ "required": [],
311
+ "properties": {}
312
+ }
313
+ }
314
+ },
315
+ {
316
+ "type": "object",
317
+ "additionalProperties": false,
318
+ "required": [
319
+ "method",
320
+ "path",
321
+ "body"
322
+ ],
323
+ "properties": {
324
+ "method": {
325
+ "const": "POST"
326
+ },
327
+ "path": {
328
+ "const": "youzan.cardvoucher.giftcard.bill.query/3.0.0"
329
+ },
330
+ "body": {
331
+ "type": "object",
332
+ "additionalProperties": false,
333
+ "required": [
334
+ "biz_type",
335
+ "begin_time",
336
+ "end_time",
337
+ "page",
338
+ "page_size"
339
+ ],
340
+ "properties": {
341
+ "biz_type": {
342
+ "type": "string",
343
+ "enum": [
344
+ "RECHARGE",
345
+ "GROUP_GIVE_RECHARGE",
346
+ "REFUND",
347
+ "RECHARGE_REFUND",
348
+ "PAY",
349
+ "CARD_ACCOUNT_ADJUSTMENT_ADD",
350
+ "CARD_ACCOUNT_ADJUSTMENT_SUBTRACT",
351
+ "CARD_BALANCE_IMPORT_ADD",
352
+ "CARD_BALANCE_IMPORT_SUBTRACT",
353
+ "RECEDE_CARD",
354
+ "GIFT_CARD_ACTIVE",
355
+ "RECHARGE_BONUS",
356
+ "REFUND_CLOSE_TRANSFER_IN",
357
+ "REFUND_CLOSE_TRANSFER_OUT",
358
+ "COMBINE_IN",
359
+ "COMBINE_OUT"
360
+ ],
361
+ "description": "由单个小写业务类型映射的大写请求值。"
362
+ },
363
+ "begin_time": {
364
+ "type": "string",
365
+ "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
366
+ "description": "北京时间业务起始秒文本,不改写端点。"
367
+ },
368
+ "end_time": {
369
+ "type": "string",
370
+ "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
371
+ "description": "北京时间业务结束秒文本,不承诺端点包含性。"
372
+ },
373
+ "page": {
374
+ "$ref": "#/definitions/pageNo"
375
+ },
376
+ "page_size": {
377
+ "$ref": "#/definitions/pageSize"
378
+ }
379
+ }
380
+ }
381
+ }
382
+ }
383
+ ]
384
+ }
385
+ }
386
+ }
387
+ },
388
+ "error": {
389
+ "type": "object",
390
+ "required": [
391
+ "success",
392
+ "code",
393
+ "message",
394
+ "details"
395
+ ],
396
+ "additionalProperties": false,
397
+ "properties": {
398
+ "success": {
399
+ "const": false
400
+ },
401
+ "code": {
402
+ "const": -10001
403
+ },
404
+ "message": {
405
+ "type": "string",
406
+ "minLength": 1
407
+ },
408
+ "details": {
409
+ "type": "object",
410
+ "required": [
411
+ "category",
412
+ "stage",
413
+ "command",
414
+ "targetScope",
415
+ "requestState",
416
+ "nextStep",
417
+ "errorVersion",
418
+ "recovery",
419
+ "execution"
420
+ ],
421
+ "additionalProperties": false,
422
+ "properties": {
423
+ "category": {
424
+ "type": "string",
425
+ "enum": [
426
+ "validation",
427
+ "configuration",
428
+ "parameter",
429
+ "permission",
430
+ "authentication",
431
+ "scope_unresolved",
432
+ "transport",
433
+ "http",
434
+ "protocol",
435
+ "business_rejected",
436
+ "limit"
437
+ ]
438
+ },
439
+ "stage": {
440
+ "type": "string",
441
+ "minLength": 1
442
+ },
443
+ "command": {
444
+ "const": "valuecard.transaction.list"
445
+ },
446
+ "targetScope": {
447
+ "type": "object",
448
+ "additionalProperties": false,
449
+ "properties": {
450
+ "kdtId": {
451
+ "$ref": "#/definitions/shopId"
452
+ }
453
+ }
454
+ },
455
+ "requestState": {
456
+ "enum": [
457
+ "not_sent",
458
+ "sent",
459
+ "unknown"
460
+ ]
461
+ },
462
+ "nextStep": {
463
+ "type": "string",
464
+ "minLength": 1
465
+ },
466
+ "api": {
467
+ "type": "string",
468
+ "minLength": 1
469
+ },
470
+ "httpStatus": {
471
+ "type": "integer",
472
+ "minimum": 100,
473
+ "maximum": 599
474
+ },
475
+ "businessCode": {
476
+ "$ref": "#/definitions/code"
477
+ },
478
+ "gatewayCode": {
479
+ "$ref": "#/definitions/code"
480
+ },
481
+ "trace_id": {
482
+ "$ref": "#/definitions/trace"
483
+ },
484
+ "request_id": {
485
+ "$ref": "#/definitions/trace"
486
+ },
487
+ "errorVersion": {
488
+ "const": 2,
489
+ "description": "本命令采用错误诊断协议第二版。"
490
+ },
491
+ "issues": {
492
+ "type": "array",
493
+ "minItems": 1,
494
+ "maxItems": 16,
495
+ "items": {
496
+ "$ref": "#/definitions/diagnosticIssue"
497
+ },
498
+ "description": "最多十六个已定位问题,不包含收到的原值。"
499
+ },
500
+ "issuesTruncated": {
501
+ "const": true,
502
+ "description": "问题超过返回上限,当前列表没有穷尽全部问题。"
503
+ },
504
+ "recovery": {
505
+ "$ref": "#/definitions/diagnosticRecovery",
506
+ "description": "受限的恢复说明,不会自动执行。"
507
+ },
508
+ "execution": {
509
+ "$ref": "#/definitions/diagnosticExecution",
510
+ "description": "整次调用的请求观察,独立于失败阶段的 requestState。"
511
+ }
512
+ }
513
+ }
514
+ }
515
+ },
516
+ "definitions": {
517
+ "shopId": {
518
+ "type": "integer",
519
+ "minimum": 1,
520
+ "maximum": 9007199254740991
521
+ },
522
+ "code": {
523
+ "anyOf": [
524
+ {
525
+ "type": "integer",
526
+ "minimum": -9007199254740991,
527
+ "maximum": 9007199254740991
528
+ },
529
+ {
530
+ "type": "string",
531
+ "pattern": "^-?[0-9]{1,12}$"
532
+ }
533
+ ]
534
+ },
535
+ "trace": {
536
+ "type": "string",
537
+ "pattern": "^[a-zA-Z0-9_-]{1,128}$"
538
+ },
539
+ "diagnosticExpected": {
540
+ "type": "object",
541
+ "additionalProperties": false,
542
+ "required": [],
543
+ "properties": {
544
+ "type": {
545
+ "anyOf": [
546
+ {
547
+ "type": "string",
548
+ "description": "预期的 JSON 类型。"
549
+ },
550
+ {
551
+ "type": "array",
552
+ "items": {
553
+ "type": "string",
554
+ "description": "预期的 JSON 类型。"
555
+ }
556
+ }
557
+ ],
558
+ "description": "同版模型允许的类型。"
559
+ },
560
+ "enum": {
561
+ "type": "array",
562
+ "items": {
563
+ "anyOf": [
564
+ {
565
+ "type": "string"
566
+ },
567
+ {
568
+ "type": "number"
569
+ },
570
+ {
571
+ "type": "boolean"
572
+ },
573
+ {
574
+ "type": "null"
575
+ }
576
+ ],
577
+ "description": "契约声明的静态标量约束。"
578
+ },
579
+ "description": "同版模型允许的静态值。"
580
+ },
581
+ "const": {
582
+ "anyOf": [
583
+ {
584
+ "type": "string"
585
+ },
586
+ {
587
+ "type": "number"
588
+ },
589
+ {
590
+ "type": "boolean"
591
+ },
592
+ {
593
+ "type": "null"
594
+ }
595
+ ],
596
+ "description": "契约声明的静态标量约束。"
597
+ },
598
+ "minimum": {
599
+ "type": "number",
600
+ "description": "包含的最小值。"
601
+ },
602
+ "maximum": {
603
+ "type": "number",
604
+ "description": "包含的最大值。"
605
+ },
606
+ "exclusiveMinimum": {
607
+ "type": "number",
608
+ "description": "不包含的最小值。"
609
+ },
610
+ "exclusiveMaximum": {
611
+ "type": "number",
612
+ "description": "不包含的最大值。"
613
+ },
614
+ "minLength": {
615
+ "type": "integer",
616
+ "description": "最少字符数。"
617
+ },
618
+ "maxLength": {
619
+ "type": "integer",
620
+ "description": "最多字符数。"
621
+ },
622
+ "minItems": {
623
+ "type": "integer",
624
+ "description": "最少元素数。"
625
+ },
626
+ "maxItems": {
627
+ "type": "integer",
628
+ "description": "最多元素数。"
629
+ },
630
+ "format": {
631
+ "type": "string",
632
+ "description": "同版模型声明的格式。"
633
+ },
634
+ "pattern": {
635
+ "type": "string",
636
+ "description": "同版模型声明的字符约束。"
637
+ },
638
+ "additionalProperties": {
639
+ "const": false,
640
+ "description": "对象拒绝契约以外的属性。"
641
+ },
642
+ "contains": {
643
+ "type": "object",
644
+ "additionalProperties": false,
645
+ "required": [
646
+ "const"
647
+ ],
648
+ "properties": {
649
+ "const": {
650
+ "anyOf": [
651
+ {
652
+ "type": "string"
653
+ },
654
+ {
655
+ "type": "number"
656
+ },
657
+ {
658
+ "type": "boolean"
659
+ },
660
+ {
661
+ "type": "null"
662
+ }
663
+ ],
664
+ "description": "契约声明的静态标量约束。"
665
+ }
666
+ }
667
+ },
668
+ "items": {
669
+ "type": "object",
670
+ "additionalProperties": false,
671
+ "required": [
672
+ "enum"
673
+ ],
674
+ "properties": {
675
+ "enum": {
676
+ "type": "array",
677
+ "items": {
678
+ "anyOf": [
679
+ {
680
+ "type": "string"
681
+ },
682
+ {
683
+ "type": "number"
684
+ },
685
+ {
686
+ "type": "boolean"
687
+ },
688
+ {
689
+ "type": "null"
690
+ }
691
+ ],
692
+ "description": "契约声明的静态标量约束。"
693
+ },
694
+ "description": "元素允许的静态值。"
695
+ }
696
+ }
697
+ }
698
+ }
699
+ },
700
+ "diagnosticIssue": {
701
+ "type": "object",
702
+ "additionalProperties": false,
703
+ "required": [
704
+ "source",
705
+ "reason"
706
+ ],
707
+ "properties": {
708
+ "source": {
709
+ "enum": [
710
+ "argv",
711
+ "input",
712
+ "context",
713
+ "output",
714
+ "preview"
715
+ ],
716
+ "description": "问题所属的参数、输入、上下文、结果或预览模型。"
717
+ },
718
+ "path": {
719
+ "type": "string",
720
+ "description": "对应模型中的 JSON Pointer;不含原始输入或动态字典键。"
721
+ },
722
+ "option": {
723
+ "type": "string",
724
+ "description": "可定位时给出的已注册 CLI 选项。"
725
+ },
726
+ "reason": {
727
+ "enum": [
728
+ "required",
729
+ "invalid_type",
730
+ "invalid_choice",
731
+ "out_of_range",
732
+ "invalid_format",
733
+ "conditional_required",
734
+ "constraint",
735
+ "unexpected_property",
736
+ "unknown_option",
737
+ "unknown_command",
738
+ "excess_arguments",
739
+ "missing_value"
740
+ ],
741
+ "description": "字段违反的约束类型,原始值不回显。"
742
+ },
743
+ "expected": {
744
+ "$ref": "#/definitions/diagnosticExpected",
745
+ "description": "同版契约的静态预期。"
746
+ },
747
+ "relatedPaths": {
748
+ "type": "array",
749
+ "items": {
750
+ "type": "string",
751
+ "description": "关联字段的 JSON Pointer。"
752
+ },
753
+ "description": "触发条件约束的关联字段。"
754
+ }
755
+ }
756
+ },
757
+ "diagnosticRecovery": {
758
+ "type": "object",
759
+ "additionalProperties": false,
760
+ "required": [
761
+ "action",
762
+ "automaticBusinessRetry"
763
+ ],
764
+ "properties": {
765
+ "action": {
766
+ "enum": [
767
+ "correct_input",
768
+ "complete_authentication",
769
+ "request_access_review",
770
+ "stop_and_inspect"
771
+ ],
772
+ "description": "依次表示修正本地输入、补认证、核对权限或停止核查;仅是说明,不执行操作或授予权限。"
773
+ },
774
+ "automaticBusinessRetry": {
775
+ "const": false,
776
+ "description": "不据此自动重放业务请求。"
777
+ }
778
+ }
779
+ },
780
+ "diagnosticExecution": {
781
+ "type": "object",
782
+ "additionalProperties": false,
783
+ "required": [
784
+ "requestState",
785
+ "coverage",
786
+ "observedAttempts"
787
+ ],
788
+ "properties": {
789
+ "requestState": {
790
+ "enum": [
791
+ "not_sent",
792
+ "sent",
793
+ "unknown"
794
+ ],
795
+ "description": "整次调用尚未发送、已有发送记录或无法排除未知请求;不代表业务完成。"
796
+ },
797
+ "coverage": {
798
+ "enum": [
799
+ "complete",
800
+ "partial"
801
+ ],
802
+ "description": "请求观察覆盖全部已接入路径,或存在未观测路径;部分覆盖不能声明零请求。"
803
+ },
804
+ "observedAttempts": {
805
+ "type": "integer",
806
+ "minimum": 0,
807
+ "maximum": 9007199254740991,
808
+ "description": "本地已进入发送边界的观测次数下界,不是服务端执行次数。"
809
+ }
810
+ }
811
+ },
812
+ "requestBizType": {
813
+ "type": "string",
814
+ "enum": [
815
+ "recharge",
816
+ "group_give_recharge",
817
+ "refund",
818
+ "recharge_refund",
819
+ "pay",
820
+ "card_account_adjustment_add",
821
+ "card_account_adjustment_subtract",
822
+ "card_balance_import_add",
823
+ "card_balance_import_subtract",
824
+ "recede_card",
825
+ "gift_card_active",
826
+ "recharge_bonus",
827
+ "refund_close_transfer_in",
828
+ "refund_close_transfer_out",
829
+ "combine_in",
830
+ "combine_out"
831
+ ],
832
+ "description": "recharge 充值;group_give_recharge 赠送;refund 退款,不与充值退款合并;recharge_refund 充值退款;pay 消费;card_account_adjustment_add 调账增加;card_account_adjustment_subtract 调账减少;card_balance_import_add 导入增加;card_balance_import_subtract 导入减少;recede_card 退卡;gift_card_active 激活;recharge_bonus 充值赠送,与充值记录分别保留;refund_close_transfer_in 退款销卡转入;refund_close_transfer_out 退款销卡转出;combine_in 卡换绑转入;combine_out 卡换绑转出。只接受单个小写值,不接受 CSV、中文或 all。"
833
+ },
834
+ "pageNo": {
835
+ "type": "integer",
836
+ "minimum": 1,
837
+ "maximum": 5000,
838
+ "description": "从 1 开始的页码,须满足 pageNo * pageSize <= 5000。"
839
+ },
840
+ "pageSize": {
841
+ "type": "integer",
842
+ "minimum": 1,
843
+ "maximum": 50,
844
+ "description": "每页容量,1..50;不是当前条数。"
845
+ },
846
+ "requiredText": {
847
+ "type": "string",
848
+ "minLength": 1,
849
+ "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f-\\u009f]+$",
850
+ "description": "非空白且无控制字符的原始文本。"
851
+ },
852
+ "dateTime": {
853
+ "type": "string",
854
+ "format": "beijing-date-time-ms",
855
+ "pattern": "\\.000$",
856
+ "description": "北京时间 YYYY-MM-DD HH:mm:ss.SSS,有效日历时间;本命令仅支持零毫秒。"
857
+ },
858
+ "money": {
859
+ "type": "string",
860
+ "pattern": "^-?(?:0|[1-9]\\d{0,13})\\.\\d{2}$",
861
+ "description": "默认人民币 CNY 元,固定两位十进制字符串,范围 -90071992547409.91..90071992547409.91;保留符号,缺失或 null 不补零。",
862
+ "$comment": "upstream-money:fen"
863
+ }
864
+ },
865
+ "api": {
866
+ "method": "POST",
867
+ "path": "youzan.cardvoucher.giftcard.bill.query/3.0.0"
868
+ },
869
+ "success": {
870
+ "description": "同店绑定、请求和业务信封成功,items 与分页合法,每条记录身份、时间、有效性及六个金额完整且可无损转换,完整校验后一次性输出。只有成功读取 items: [] 才返回空集合。"
871
+ },
872
+ "errors": {
873
+ "description": "失败 stdout 为空,stderr 单条脱敏 JSON,退出非零。区分参数与上下文、配置、绑定、传输、HTTP、业务拒绝、模型及响应或输出超限;保留安全业务码及追踪号,不输出上游自由文本,不自动重试、换身份或切店。",
874
+ "diagnosticsVersion": 2
875
+ },
876
+ "notes": [
877
+ "不接受位置参数、未知选项或重复标量选项;页码仅接受正十进制整数,不接受科学计数法、小数或空值。",
878
+ "产品范围为微商城单店、零售单店、连锁 D 总部及连锁 L 总部高级版;新储值商家可查全部卡交易,老储值商家仅支持礼品卡交易;实际产品及权限由服务端判断,不证明跨店全集或全历史留存。",
879
+ "最多一次同店绑定和一次流水请求,串行、无重试、无自动翻页;每次响应最多 10 MiB,最终 UTF-8 输出含换行最多 5 MiB,超限不输出部分结果。",
880
+ "本命令不提供 --max-items、--max-requests、--include、客户、卡号或订单筛选,不保留 begin-time、end-time、sharding、timeout 或 retry 别名。",
881
+ "at: all 仅表示位置适用,不证明产品或当前身份的服务端权限。必须由当前凭证核验目标店铺,不自动切换范围。",
882
+ "时间两端必须明确且开始严格早于结束,允许输入零毫秒但拒绝非零毫秒;原窗口不加减一秒,不承诺接口端点包含性。",
883
+ "billCardNo 与 card.cardNo 不保证互认;mobile 和 nickname 不作为稳定客户身份。交易单号、外部请求号与储值流水号不能互换。",
884
+ "六个金额均为默认人民币元固定两位字符串,只接受可精确转换的安全分整数;不解释统一增减方向,不从 reportedBalance 推算交易前后余额。",
885
+ "本次页不承诺稳定降序、快照、全历史或余额重建;nextPageNo=null 不单独证明结束,窗口耗尽时缩小原店铺与业务类型下的时间范围。",
886
+ "开始时间错误 118701006、页容量错误 118701004 及过大窗口拒绝均为失败,不把失败响应的计数当成功;缩小时间或修正分页后发起新调用。"
887
+ ]
888
+ }