@xinhehuimeng/cli 0.2.2 → 0.2.3
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 +1 -1
- package/src/commands/report.js +8 -3
- package/src/version.js +1 -1
package/package.json
CHANGED
package/src/commands/report.js
CHANGED
|
@@ -393,13 +393,16 @@ async function ruleUpdate(runtime, id, args) {
|
|
|
393
393
|
});
|
|
394
394
|
if (version !== null) body.version = version;
|
|
395
395
|
const path = `/reports/rules/${id}`;
|
|
396
|
-
const spec = requestSpec({
|
|
396
|
+
const spec = requestSpec({
|
|
397
|
+
body: sortKeysDeep(body),
|
|
398
|
+
idempotencyKey: idempotencyKey('report-rule-update'),
|
|
399
|
+
});
|
|
397
400
|
if (runtime.dryRun) return runtime.dryRunReport('PATCH', path, spec);
|
|
398
401
|
const response = await runtime.sendAuthed('PATCH', path, spec);
|
|
399
402
|
const data = dataOf(response);
|
|
400
403
|
if (isPlainObject(data)) {
|
|
401
404
|
data.note =
|
|
402
|
-
'
|
|
405
|
+
'规则改动带版本号并写审计;已提交报告继续使用提交时冻结的规则快照';
|
|
403
406
|
}
|
|
404
407
|
runtime.finishFrom(response, data);
|
|
405
408
|
}
|
|
@@ -411,7 +414,9 @@ async function ruleArchive(runtime, id) {
|
|
|
411
414
|
`xinhe-oa-cli report rule --archive ${id}`,
|
|
412
415
|
);
|
|
413
416
|
const path = `/reports/rules/${id}/archive`;
|
|
414
|
-
const spec = requestSpec(
|
|
417
|
+
const spec = requestSpec({
|
|
418
|
+
idempotencyKey: idempotencyKey('report-rule-archive'),
|
|
419
|
+
});
|
|
415
420
|
if (runtime.dryRun) return runtime.dryRunReport('POST', path, spec);
|
|
416
421
|
const response = await runtime.sendAuthed('POST', path, spec);
|
|
417
422
|
runtime.finishFrom(response, dataOf(response));
|
package/src/version.js
CHANGED