@joymerrevent/porters-connect 0.20.0 → 0.20.1

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,35 @@
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.20.1] - 2026-09-21
9
+
10
+ **定期レビュー(0.20.0 直後)で見つけた 1 件を塞いだ版**です。破壊的変更はありません。
11
+
12
+ ### Fixed
13
+
14
+ - **`decodeTimeOfDay` が時計の範囲にない時・分・秒を通さなくなりました**。基準日(`1970-01-01` /
15
+ `1970-01-02`)は見ていましたが、時・分・秒は 2 桁かどうかしか見ていなかったため、
16
+ `"1970-01-01T30:00:00Z"` を `"30:00"` として返し、それを `encodeTimeOfDay` に戻すと
17
+ `"1970-01-02T06:00:00Z"`=**入力と別の値**になっていました。[ADR-0086][adr86] が決めた
18
+ 「両方向とも検証する」の decode 側が欠けていた形です。
19
+
20
+ ```ts
21
+ decodeTimeOfDay("1970-01-01T30:00:00Z"); // PortersConfigError(以前は "30:00")
22
+ decodeTimeOfDay("1970-01-01T09:60:00Z"); // PortersConfigError(以前は "09:60")
23
+ decodeTimeOfDay("1970-01-02T02:00:00Z"); // "26:00"(変わらず)
24
+ ```
25
+
26
+ 時は各基準日で `00`〜`23`、分と秒は `00`〜`59`。それ以外は基準日違いと同じ `PortersConfigError`
27
+ (`category: "validation"`)で止まります。**Read で得た ISO をそのまま渡しているコードは無変更**です
28
+ (ライブラリの日時 decode がそもそも不正な時分を通さないため)。エラーになるのは、手で組み立てた
29
+ ISO を渡していた場合だけです。
30
+
31
+ ### Changed
32
+
33
+ - 内部の検査を 1 本増やしました(利用者への影響はありません)。CHANGELOG が名指しした設計 ADR に
34
+ 「世に出た版」が記入されているかをリリース時に見る検査で、0.8.0 以降の設計 ADR 21 本に版を
35
+ 記入し直しました。ADR 索引の「実装」列がふたたび事実と一致します。
36
+
8
37
  ## [0.20.0] - 2026-09-21
9
38
 
10
39
  **PORTERS ヘルプセンターを再取得して見つかった、追いついていなかった変更 2 つを埋めた版**です。
@@ -1195,7 +1224,8 @@ Attachment)あるのに、受け口の形が 3 つとも違っていました
1195
1224
  [ref]: docs/usage/reference/README.md
1196
1225
  [kac]: https://keepachangelog.com/en/1.1.0/
1197
1226
  [semver]: https://semver.org/
1198
- [unreleased]: https://github.com/Joymerrevent/porters-connect/compare/v0.20.0...HEAD
1227
+ [unreleased]: https://github.com/Joymerrevent/porters-connect/compare/v0.20.1...HEAD
1228
+ [0.20.1]: https://github.com/Joymerrevent/porters-connect/compare/v0.20.0...v0.20.1
1199
1229
  [0.20.0]: https://github.com/Joymerrevent/porters-connect/compare/v0.19.1...v0.20.0
1200
1230
  [0.19.1]: https://github.com/Joymerrevent/porters-connect/compare/v0.19.0...v0.19.1
1201
1231
  [0.19.0]: https://github.com/Joymerrevent/porters-connect/compare/v0.18.0...v0.19.0
package/dist/index.d.cts CHANGED
@@ -3049,7 +3049,8 @@ declare const base64ToBytes: (b64: string) => Uint8Array;
3049
3049
  * only, but the wire format carries seconds, and dropping them would lose data silently.
3050
3050
  *
3051
3051
  * @throws PortersConfigError (`category: "validation"`) when the value is not an ISO date-time on
3052
- * 1970-01-01 / 1970-01-02 — which usually means the field is a date-time, not a time-of-day.
3052
+ * 1970-01-01 / 1970-01-02 — which usually means the field is a date-time, not a time-of-day — or
3053
+ * its clock part is out of range (hours 00–23 on either anchor day, minutes / seconds 00–59).
3053
3054
  * @example
3054
3055
  * // doccheck: fields
3055
3056
  * const job = await t.job.get(1);
package/dist/index.d.ts CHANGED
@@ -3049,7 +3049,8 @@ declare const base64ToBytes: (b64: string) => Uint8Array;
3049
3049
  * only, but the wire format carries seconds, and dropping them would lose data silently.
3050
3050
  *
3051
3051
  * @throws PortersConfigError (`category: "validation"`) when the value is not an ISO date-time on
3052
- * 1970-01-01 / 1970-01-02 — which usually means the field is a date-time, not a time-of-day.
3052
+ * 1970-01-01 / 1970-01-02 — which usually means the field is a date-time, not a time-of-day — or
3053
+ * its clock part is out of range (hours 00–23 on either anchor day, minutes / seconds 00–59).
3053
3054
  * @example
3054
3055
  * // doccheck: fields
3055
3056
  * const job = await t.job.get(1);
package/dist/index.js CHANGED
@@ -3100,6 +3100,7 @@ var ANCHOR_MONTH = "01";
3100
3100
  var ANCHOR_DAYS = { "01": 0, "02": 24 };
3101
3101
  var HOURS_PER_ANCHOR_DAY = 24;
3102
3102
  var MAX_HOURS = 47;
3103
+ var MAX_WIRE_HOURS = 23;
3103
3104
  var MAX_MINUTES = 59;
3104
3105
  var pad2 = (n) => String(n).padStart(2, "0");
3105
3106
  var decodeTimeOfDay = (iso) => {
@@ -3117,16 +3118,16 @@ var decodeTimeOfDay = (iso) => {
3117
3118
  const wireHours = Number(m[4]);
3118
3119
  const minutes = m[5];
3119
3120
  const seconds = m[6];
3120
- const hours = wireHours + extra;
3121
- if (hours > MAX_HOURS) {
3121
+ if (wireHours > MAX_WIRE_HOURS || Number(minutes) > MAX_MINUTES || Number(seconds) > MAX_MINUTES) {
3122
3122
  throw new PortersConfigError(
3123
3123
  `${JSON.stringify(iso)} is outside the time-of-day range (00:00-47:59)`,
3124
3124
  {
3125
3125
  category: "validation",
3126
- hint: "PORTERS' time-of-day range is 00:00-47:59; the anchor days carry clock hours 00-23 each."
3126
+ hint: "PORTERS' time-of-day range is 00:00-47:59, carried as a clock time (hours 00-23, minutes and seconds 00-59) on 1970/01/01 or, for 24:00-47:59, 1970/01/02."
3127
3127
  }
3128
3128
  );
3129
3129
  }
3130
+ const hours = wireHours + extra;
3130
3131
  return seconds === "00" ? `${pad2(hours)}:${minutes}` : `${pad2(hours)}:${minutes}:${seconds}`;
3131
3132
  };
3132
3133
  var encodeTimeOfDay = (time) => {