@wport/cli 0.6.0 → 0.7.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/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@
5
5
 
6
6
  ---
7
7
 
8
+ ## [0.7.0] — 2026-07-15
9
+
10
+ ### Removed
11
+
12
+ - **`enterprise jobs close` 全面撤銷**(產品決議:職缺狀態只有上下架,無「關閉」態)。
13
+ 「已關閉(status=10)」是 GUI 完全不存在的第三狀態——被 CLI 關閉的職缺會在企業後台
14
+ 顯示成無法再上架、無法操作的殭屍列,卡住整個管理流程。命令改為隱藏 stub:
15
+ 打到時印出遷移訊息(改用 `jobs unpublish` 下架、或 `jobs delete --confirm` 刪除)
16
+ 並 exit 2、不發任何請求。
17
+ - 後端 `PATCH /api/v1/enterprise/jobs/:enc_id/close` 端點同步移除(同一 backend PR)。
18
+ 舊版 CLI(0.5.x–0.6.x)呼叫 `jobs close` 將收到 404——請升級至 0.7.0。
19
+
20
+ ### Notes
21
+
22
+ - 已被關閉的存量職缺由後端資料復原 DML 統一改回「未刊登」(可重新上架),
23
+ 詳見 backend repo `docs/ddl/V20260715*__tsh-pm_41-jobs-close-revoke-restore.sql`。
24
+
25
+ ---
26
+
8
27
  ## [0.6.0] — 2026-07-08
9
28
 
10
29
  issue #106 實測回饋:讓 agent 更容易讀懂錯誤與能力邊界,不必踩裸 40x 才知道。
package/README.md CHANGED
@@ -69,7 +69,6 @@ wport enterprise jobs view <enc_id>
69
69
  wport enterprise jobs create --file new-job.json
70
70
  wport enterprise jobs publish <enc_id>
71
71
  wport enterprise jobs copy <enc_id>
72
- wport enterprise jobs close <enc_id> --confirm
73
72
 
74
73
  # View / update your company profile
75
74
  wport enterprise company view
package/dist/index.js CHANGED
@@ -179,7 +179,7 @@ function isTimeoutAbort(err) {
179
179
  return false;
180
180
  }
181
181
  function buildUserAgent() {
182
- return `wport-cli/${"0.6.0"} (node ${process.version}; ${process.platform})`;
182
+ return `wport-cli/${"0.7.0"} (node ${process.version}; ${process.platform})`;
183
183
  }
184
184
  function unwrapDataResponse(body) {
185
185
  if (body && typeof body === "object" && "success" in body && "data" in body) {
@@ -985,7 +985,7 @@ function registerDoctorCommand(program2) {
985
985
  ).action(async (_opts, command) => {
986
986
  const ctx = resolveContext(command);
987
987
  const line = (s = "") => process.stdout.write(s + "\n");
988
- line(`wport-cli ${"0.6.0"}`);
988
+ line(`wport-cli ${"0.7.0"}`);
989
989
  line(` bundled schema fingerprint: ${"839e8a891dfb"}`);
990
990
  line("");
991
991
  line("Resolved configuration:");
@@ -1569,33 +1569,10 @@ function registerEnterpriseJobsCopy(parent) {
1569
1569
  await runJobsCopy(ctx, key, encId, flags.idempotencyKey ?? (0, import_node_crypto3.randomUUID)());
1570
1570
  });
1571
1571
  }
1572
- async function runJobsClose(ctx, apiKey, encId, confirm, idempotencyKey) {
1573
- if (!confirm) {
1574
- throw new CliError(
1575
- "Refusing to close without --confirm (irreversible; a closed job cannot be reopened \u2014 copy it to relist)",
1576
- ExitCode.InvalidArgument
1577
- );
1578
- }
1579
- const trimmed = requireEncId(encId);
1580
- const { body } = await enterprisePatch(
1581
- { baseUrl: ctx.baseUrl, locale: ctx.locale, timeoutMs: ctx.timeoutMs, apiKey },
1582
- `/jobs/${encodeURIComponent(trimmed)}/close`,
1583
- {},
1584
- { idempotencyKey }
1585
- );
1586
- const result = unwrapDataResponse(body);
1587
- if (ctx.format === "json") {
1588
- printJson(result);
1589
- return;
1590
- }
1591
- process.stdout.write(`Closed job: ${result.enc_id ?? trimmed}
1592
- `);
1593
- }
1572
+ var JOBS_CLOSE_REMOVED_MESSAGE = '`jobs close` was removed in @wport/cli 0.7.0 \u2014 the "closed" job state has been revoked product-wide (jobs are only published/unpublished). Use `jobs unpublish <enc_id>` to take a job off the board, or `jobs delete <enc_id> --confirm` to remove it.';
1594
1573
  function registerEnterpriseJobsClose(parent) {
1595
- parent.command("close <enc_id>").description("Close (finalize) a job posting (destructive, irreversible; requires --confirm)").option("--confirm", "confirm this irreversible close (a closed job cannot be reopened)").option("--idempotency-key <key>", "reuse across retries (default: a fresh UUID)").action(async (encId, flags, command) => {
1596
- const ctx = resolveContext(command);
1597
- const { key } = resolveApiKey(command.optsWithGlobals().apiKey);
1598
- await runJobsClose(ctx, key, encId, flags.confirm === true, flags.idempotencyKey ?? (0, import_node_crypto3.randomUUID)());
1574
+ parent.command("close [enc_id]", { hidden: true }).description("(removed in 0.7.0)").allowUnknownOption(true).action(async () => {
1575
+ throw new CliError(JOBS_CLOSE_REMOVED_MESSAGE, ExitCode.InvalidArgument);
1599
1576
  });
1600
1577
  }
1601
1578
  function registerEnterpriseJobsPublish(parent) {
@@ -2518,7 +2495,7 @@ function registerEnterpriseCommand(program2) {
2518
2495
 
2519
2496
  // src/index.ts
2520
2497
  var program = new import_commander.Command();
2521
- program.name("wport").description("wport CLI \u2014 terminal interface to the W101 Talent Search Hub public API").version("0.6.0", "-v, --version", "output the CLI version").option("--lang <locale>", "Accept-Language locale: zh-TW | en-US | vi-VN | th-TH | id-ID").option("--api <url>", "override API base URL").option("--output <fmt>", "output format: table | json").option("--no-color", "disable color output").option("--timeout <ms>", "HTTP timeout in milliseconds", (v) => Number(v));
2498
+ program.name("wport").description("wport CLI \u2014 terminal interface to the W101 Talent Search Hub public API").version("0.7.0", "-v, --version", "output the CLI version").option("--lang <locale>", "Accept-Language locale: zh-TW | en-US | vi-VN | th-TH | id-ID").option("--api <url>", "override API base URL").option("--output <fmt>", "output format: table | json").option("--no-color", "disable color output").option("--timeout <ms>", "HTTP timeout in milliseconds", (v) => Number(v));
2522
2499
  registerJobsCommand(program);
2523
2500
  registerConfigCommand(program);
2524
2501
  registerDoctorCommand(program);