@alipay/alipay-aipay 1.5.9-beta → 1.5.9
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/package.json
CHANGED
package/skill/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.5.9
|
|
1
|
+
1.5.9
|
|
@@ -51,7 +51,7 @@ const categoryNames = {
|
|
|
51
51
|
const materialFieldsByCategory = Object.freeze({
|
|
52
52
|
signing: ['APP名称', '首页截图', '商品页截图', '支付页截图'],
|
|
53
53
|
service: ['服务名称', '服务描述', '服务地址', '服务单价', '请求示例JSON'],
|
|
54
|
-
application: ['iOS Bundle ID(bundleId)', 'Android 应用包名(appPackage)', 'Android 应用签名摘要(appSign)', '应用公钥']
|
|
54
|
+
application: ['应用平台和对应资料', 'iOS Bundle ID(bundleId)', 'Android 应用包名(appPackage)', 'Android 应用签名摘要(appSign)', '应用公钥']
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
const materialStates = {
|
|
@@ -531,6 +531,12 @@ async function runMaterialCollect(args) {
|
|
|
531
531
|
|
|
532
532
|
if (state === 'APP_WEB_INITIAL' || state === 'APP_MOBILE_INITIAL') {
|
|
533
533
|
if (category !== 'application') throw new Error(`${state} 只适用于 application 类别`);
|
|
534
|
+
if (state === 'APP_WEB_INITIAL' && productType === 'apppay') {
|
|
535
|
+
throw new Error('APP_WEB_INITIAL 只适用于 aipay、webpay');
|
|
536
|
+
}
|
|
537
|
+
if (state === 'APP_MOBILE_INITIAL' && productType !== 'apppay') {
|
|
538
|
+
throw new Error('APP_MOBILE_INITIAL 只适用于 apppay');
|
|
539
|
+
}
|
|
534
540
|
return renderMessage('materials.category.collect', stateRule.variant, {
|
|
535
541
|
categoryName: '应用资料',
|
|
536
542
|
currentStatus: stateRule.currentStatus,
|
|
@@ -544,10 +550,17 @@ async function runMaterialCollect(args) {
|
|
|
544
550
|
const variant = state === 'INITIAL' && category === 'service'
|
|
545
551
|
? 'SERVICE_INITIAL'
|
|
546
552
|
: stateRule.variant;
|
|
553
|
+
const missingFields = normalizeMissingFields(category, input.missingFields);
|
|
554
|
+
if (category === 'application' && productType !== 'apppay') {
|
|
555
|
+
const incompatibleFields = missingFields.split('、').filter((field) => field !== '应用公钥');
|
|
556
|
+
if (incompatibleFields.length > 0) {
|
|
557
|
+
throw new Error(`${productType} 的应用资料只允许应用公钥`);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
547
560
|
return renderMessage('materials.category.collect', variant, {
|
|
548
561
|
categoryName,
|
|
549
562
|
currentStatus: stateRule.currentStatus,
|
|
550
|
-
missingFields
|
|
563
|
+
missingFields
|
|
551
564
|
}, { productType });
|
|
552
565
|
}
|
|
553
566
|
|
|
@@ -621,8 +634,14 @@ async function runApplicationRecheck(args) {
|
|
|
621
634
|
}
|
|
622
635
|
: await readStdin();
|
|
623
636
|
if (!input || typeof input !== 'object' || Array.isArray(input)) throw new Error('应用候选重查输入必须是 JSON 对象');
|
|
624
|
-
if (canonicalCandidates(input.previousCandidates) === canonicalCandidates(input.currentCandidates))
|
|
625
|
-
|
|
637
|
+
if (canonicalCandidates(input.previousCandidates) === canonicalCandidates(input.currentCandidates)) {
|
|
638
|
+
process.stderr.write(`${internalPrefix}APPLICATION_RECHECK_RESULT=UNCHANGED\n`);
|
|
639
|
+
return '';
|
|
640
|
+
}
|
|
641
|
+
const output = renderApplicationCandidates(applicationType, input.currentCandidates);
|
|
642
|
+
const result = input.currentCandidates.length === 0 ? 'CHANGED_EMPTY' : 'CHANGED_NONEMPTY';
|
|
643
|
+
process.stderr.write(`${internalPrefix}APPLICATION_RECHECK_RESULT=${result}\n`);
|
|
644
|
+
return output;
|
|
626
645
|
}
|
|
627
646
|
|
|
628
647
|
function closeoutInputFromArgs(args) {
|
|
@@ -396,11 +396,11 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" service save --service-
|
|
|
396
396
|
|
|
397
397
|
**应用分支**:按量付费/网站支付使用 `WEBAPP`,APP 支付使用 `MOBILEAPP`。仅 Step 3.1 查询成功、类型合法且候选为数组时继续;失败、缺失或非法时阻断。上下文、移动字段、`appSign`、MCP 参数和返回由 `app.sh` 托管。
|
|
398
398
|
|
|
399
|
-
|
|
399
|
+
候选为空:送达事实后收集材料,无需回复 `新建`,禁用默认/占位/猜测值。本会话未收到用户公钥时依次送达 `key-tool` 和材料消息;已收到则不下载,材料未齐由材料消息提示工具,已齐先送达 `key-tool-guide` 再重查。只有本会话用户输入可证明公钥已提供。
|
|
400
400
|
|
|
401
|
-
候选非空:有 `ON_LINE` 时接受当前完整 `appId`
|
|
401
|
+
候选非空:有 `ON_LINE` 时接受当前完整 `appId` 或 `新建+材料`;仅非上线时另接受 `暂不新建`。候选消息展示示例和工具链接但不自动下载。只回复 `新建` 或材料缺失/错误时保留意图并补对应项;其他输入走 Step 4 `invalid`,不写入。明确要求下载时送达 `key-tool` 后返回原等待态。
|
|
402
402
|
|
|
403
|
-
|
|
403
|
+
`WEBAPP` 新建需公钥;`MOBILEAPP` 需 `IOS+bundleId`、`ANDROID+appPackage+appSign` 或 `ALL+三项`,并提供公钥。接口无名称/描述。`APP_WEB_INITIAL` 仅限 `aipay|webpay`,`APP_MOBILE_INITIAL` 仅限 `apppay`,错配即拒绝。`PARTIAL|INVALID` 只补中文字段;平台未定时用“应用平台和对应资料”:
|
|
404
404
|
|
|
405
405
|
```bash
|
|
406
406
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" key-tool
|
|
@@ -409,7 +409,7 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message mate
|
|
|
409
409
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message material-collect --category application --state APP_MOBILE_INITIAL --product-type "$PRODUCT_TYPE"
|
|
410
410
|
```
|
|
411
411
|
|
|
412
|
-
|
|
412
|
+
缺公钥禁止创建或调用 `createKeyConfirmPage`。材料完整且重查允许后创建,以实际 `appId` 和同一公钥生成确认页;页面确认后执行 `verify-key-and-audit`,复用安全响应 guard 提审。工具只下载,不安装、启动或生成密钥;禁用 OpenSSL。
|
|
413
413
|
|
|
414
414
|
<!-- ALIPAY_AIPAY_PRODUCT:apppay:START -->
|
|
415
415
|
APP 支付通过 Skill 创建只支持 `IOS`、`ANDROID` 和 `ALL`,其中 `ALL` 只表示 iOS + Android。HarmonyOS 移动应用不得调用 `app.sh create`;执行固定 runner 命令输出 `application.harmony.manual_create`,用户在开放平台完成创建及平台要求的后续配置后明确表示操作完成,只重新执行下方同一条轻量 `app list` 查询,不得重新运行 Step 3.1 全量 discovery。只有实际查询到 `ON_LINE` 候选后才能按既有复用路径继续,否则应用分支保持人工待办。
|
|
@@ -457,7 +457,7 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" app audit --product-typ
|
|
|
457
457
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" app list --product-type "$PRODUCT_TYPE" --sales-code "$SALES_CODE"
|
|
458
458
|
```
|
|
459
459
|
|
|
460
|
-
`CREATE`
|
|
460
|
+
`CREATE` 以本次快照为 `RECHECK_APP_CANDIDATES_JSON` 运行比较器,只接受唯一内部事实 `APPLICATION_RECHECK_RESULT=UNCHANGED|CHANGED_EMPTY|CHANGED_NONEMPTY`。`UNCHANGED` stdout 为空并创建;`CHANGED_EMPTY` 只送达最新空事实,再沿用新建意图和材料创建;`CHANGED_NONEMPTY` 送达最新候选/提示后重选。marker、正文、候选矛盾或比较失败只阻断应用分支。非 `ON_LINE` 不可复用;HarmonyOS 不比较。
|
|
461
461
|
|
|
462
462
|
```bash
|
|
463
463
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message application-recheck --application-type "$APPLICATION_TYPE" --previous-candidates-json "$APP_CANDIDATES_JSON" --current-candidates-json "$RECHECK_APP_CANDIDATES_JSON"
|
|
@@ -40,21 +40,21 @@ node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message appl
|
|
|
40
40
|
|
|
41
41
|
HarmonyOS 用户完成平台操作后只重查下方列表,不跑全量 discovery;仅实际 `ON_LINE` 可复用,用户表达不证明创建、配置或上线。
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
`ON_LINE` 才可复用。空候选收材料;非空接受当前 appId 或 `新建+材料`;仅未上线时可 `暂不新建`;无效选择不写。创建前重查:`UNCHANGED` 直创,`CHANGED_EMPTY` 送达新事实后沿用意图创建,`CHANGED_NONEMPTY` 重选:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" app list --product-type "$PRODUCT_TYPE" --sales-code "$SALES_CODE"
|
|
47
47
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message application-recheck --application-type "$APPLICATION_TYPE" --previous-candidates-json "$APP_CANDIDATES_JSON" --current-candidates-json "$RECHECK_APP_CANDIDATES_JSON"
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
材料齐或非空明确新建即确认创建;之后只补缺项。`WEBAPP` 需公钥;`MOBILEAPP` 需平台资料和公钥,平台未定时补“应用平台和对应资料”,`mobilePlatform` 由 runner 归一化。`APP_WEB_INITIAL` 仅限 `aipay|webpay`,`APP_MOBILE_INITIAL` 仅限 `apppay`:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message material-collect --category application --state APP_WEB_INITIAL --product-type "$PRODUCT_TYPE"
|
|
54
54
|
node "<SKILL_DIR>/references/normal/scripts/runtime.mjs" onboarding-message material-collect --category application --state APP_MOBILE_INITIAL --product-type "$PRODUCT_TYPE"
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
空候选且未收到公钥时执行 `runtime.mjs key-tool`;非空提示,明确要求下载。只下载,不安装/启动/生成密钥。材料齐且重查允许才创建,以 appId 和同一公钥进入确认页、校验和提审。
|
|
58
58
|
|
|
59
59
|
## 公钥边界
|
|
60
60
|
|