From ea25f47fcef153ed9761952f8b03b000777cf0c2 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Fri, 23 Oct 2026 11:20:51 +0900 Subject: [PATCH] =?UTF-8?q?261023=5F01=5FENH:=20LMS=C2=B7MMS=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EB=B6=84=EB=A6=AC=20=EB=B0=8F=20MMS=20=EB=B0=9C?= =?UTF-8?q?=EC=86=A1=20=EC=B7=A8=EC=86=8C=20=ED=8C=90=EB=B3=84=20=EC=A7=80?= =?UTF-8?q?=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agent/consumer.md | 10 +++++++++- AGENTS.md | 10 +++++++++- package-lock.json | 4 ++-- package.json | 2 +- src/noti-hub/noti-hub-types.ts | 5 ++++- src/noti-hub/send-cancellation.ts | 5 +++-- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.agent/consumer.md b/.agent/consumer.md index 3c327f0..81be1a0 100644 --- a/.agent/consumer.md +++ b/.agent/consumer.md @@ -17,6 +17,14 @@ Before each related task, read the current contents of every matching reference, If a task spans multiple scopes, read every matching reference. Generated files under `.agent-harness/references/` are read-only copies; edit KriFrontCommon's `.agent/consumer.md` or `.agent/consumer-references/` and recompose instead. +## Noti-hub SMS Types + +- `MessageType.SMS = 21`, `LMS = 22`, `MMS = 23`; `ChannelType.SMS = 2` is unchanged. `SMS_TYPE_ARRAY` and `SmsType` include all three. +- `LMS_MMS = 22` remains a deprecated source-compatibility alias for LMS only. It does not represent MMS. Enum reverse lookup for 22 returns LMS. Use numeric bulk-list paths; the server no longer accepts LMS_MMS in paths. Numeric 21/22/23 bulk-list requests all return the entire SMS channel, not type-filtered lists. +- Requests retain their existing URLs/body shapes. The server chooses the actual type per recipient after substitution: attachment -> MMS; otherwise title or UTF-8 body >= 90 bytes -> LMS; otherwise SMS. +- Refresh templates from the save response (`tmplatTy`); display actual delivery types from `sendTy`, not the template or result code. A bulk can contain multiple SMS types. LMS/MMS share result codes; use existing server result labels. +- SMS, LMS, MMS and KKO use cancellation code 9998. Verify with `npm run typecheck`, `npm run build`, and `node --test tests/noti-hub-sms.test.mjs`. + ## Noti-hub Reservation Cancellation - Import cancellation types, constants, and helpers from `@kri/common/noti-hub` only. They are runtime-neutral and require no optional peers. @@ -24,7 +32,7 @@ If a task spans multiple scopes, read every matching reference. Generated files - SendResultInfo, SendInfo, and BulkSendInfo expose optional cancelable. Use isSendCancelable(item), which returns true only for cancelable === true, for cancellation eligibility; missing values from older responses are treated as false. Never infer eligibility from cancelDt, result labels, or result codes. - cancelable reflects query-time state and may change before cancellation. Determine the final outcome from SendCancelResponse counts. - sendIdx is the single-cancel identifier, not cmid. It is absent from the latest abbreviated report (/api/v1/report/last/send/...). Request sendIdx must be a positive integer; bulkSendKey is required and at most 32 characters. -- EMAIL_RESERVE_CANCELED_RESULT_CODE is 108 for EMAIL. SMS_KKO_RESERVE_CANCELED_RESULT_CODE is 9998 for SMS, LMS_MMS, and KKO. Unknown message types are not recognized as canceled. +- EMAIL_RESERVE_CANCELED_RESULT_CODE is 108 for EMAIL. SMS_KKO_RESERVE_CANCELED_RESULT_CODE is 9998 for SMS, LMS, MMS, and KKO. Unknown message types are not recognized as canceled. - Display the server's resultViewLabel/resultLabel ("예약 취소"). There is no separate result-code list API. - HTTP 200 can contain notCancelableCount. parseSendCancelResponse validates nonnegative integer counts and targetCount = canceledCount + alreadyCanceledCount + notCancelableCount, throwing TypeError on invalid data. Bulk targetCount counts currently registered detail rows; response canceledCount counts only cancellations made by that request. - Existing response fields are unchanged; all added fields on existing types are optional. Verify with npm run typecheck and npm run build. diff --git a/AGENTS.md b/AGENTS.md index 187a9bc..88d6968 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -253,6 +253,14 @@ Before each related task, read the current contents of every matching reference, If a task spans multiple scopes, read every matching reference. Generated files under `.agent-harness/references/` are read-only copies; edit KriFrontCommon's `.agent/consumer.md` or `.agent/consumer-references/` and recompose instead. +## Noti-hub SMS Types + +- `MessageType.SMS = 21`, `LMS = 22`, `MMS = 23`; `ChannelType.SMS = 2` is unchanged. `SMS_TYPE_ARRAY` and `SmsType` include all three. +- `LMS_MMS = 22` remains a deprecated source-compatibility alias for LMS only. It does not represent MMS. Enum reverse lookup for 22 returns LMS. Use numeric bulk-list paths; the server no longer accepts LMS_MMS in paths. Numeric 21/22/23 bulk-list requests all return the entire SMS channel, not type-filtered lists. +- Requests retain their existing URLs/body shapes. The server chooses the actual type per recipient after substitution: attachment -> MMS; otherwise title or UTF-8 body >= 90 bytes -> LMS; otherwise SMS. +- Refresh templates from the save response (`tmplatTy`); display actual delivery types from `sendTy`, not the template or result code. A bulk can contain multiple SMS types. LMS/MMS share result codes; use existing server result labels. +- SMS, LMS, MMS and KKO use cancellation code 9998. Verify with `npm run typecheck`, `npm run build`, and `node --test tests/noti-hub-sms.test.mjs`. + ## Noti-hub Reservation Cancellation - Import cancellation types, constants, and helpers from `@kri/common/noti-hub` only. They are runtime-neutral and require no optional peers. @@ -260,7 +268,7 @@ If a task spans multiple scopes, read every matching reference. Generated files - SendResultInfo, SendInfo, and BulkSendInfo expose optional cancelable. Use isSendCancelable(item), which returns true only for cancelable === true, for cancellation eligibility; missing values from older responses are treated as false. Never infer eligibility from cancelDt, result labels, or result codes. - cancelable reflects query-time state and may change before cancellation. Determine the final outcome from SendCancelResponse counts. - sendIdx is the single-cancel identifier, not cmid. It is absent from the latest abbreviated report (/api/v1/report/last/send/...). Request sendIdx must be a positive integer; bulkSendKey is required and at most 32 characters. -- EMAIL_RESERVE_CANCELED_RESULT_CODE is 108 for EMAIL. SMS_KKO_RESERVE_CANCELED_RESULT_CODE is 9998 for SMS, LMS_MMS, and KKO. Unknown message types are not recognized as canceled. +- EMAIL_RESERVE_CANCELED_RESULT_CODE is 108 for EMAIL. SMS_KKO_RESERVE_CANCELED_RESULT_CODE is 9998 for SMS, LMS, MMS, and KKO. Unknown message types are not recognized as canceled. - Display the server's resultViewLabel/resultLabel ("예약 취소"). There is no separate result-code list API. - HTTP 200 can contain notCancelableCount. parseSendCancelResponse validates nonnegative integer counts and targetCount = canceledCount + alreadyCanceledCount + notCancelableCount, throwing TypeError on invalid data. Bulk targetCount counts currently registered detail rows; response canceledCount counts only cancellations made by that request. - Existing response fields are unchanged; all added fields on existing types are optional. Verify with npm run typecheck and npm run build. diff --git a/package-lock.json b/package-lock.json index d02bc40..5367269 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@kri/common", - "version": "0.19.4", + "version": "0.19.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@kri/common", - "version": "0.19.4", + "version": "0.19.5", "license": "UNLICENSED", "dependencies": { "clsx": "^2.1.1", diff --git a/package.json b/package.json index 332a5c3..2dcff2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kri/common", - "version": "0.19.4", + "version": "0.19.5", "description": "KRI 프런트엔드 공통 유틸리티", "type": "module", "main": "./dist/index.js", diff --git a/src/noti-hub/noti-hub-types.ts b/src/noti-hub/noti-hub-types.ts index 09d78e0..99e4054 100644 --- a/src/noti-hub/noti-hub-types.ts +++ b/src/noti-hub/noti-hub-types.ts @@ -3,7 +3,10 @@ import type { FileResponse, PageRequest, PageResponse } from "../types.js"; export enum MessageType { EMAIL = 11, SMS = 21, + /** @deprecated Use LMS (22) or MMS (23). Never use this name in URL paths. */ LMS_MMS = 22, + LMS = 22, + MMS = 23, KKO = 31 } @@ -18,7 +21,7 @@ export enum TemplatePurpose { PHONE_VERIFICATION = 1 } -export const SMS_TYPE_ARRAY = [MessageType.SMS, MessageType.LMS_MMS] as const; +export const SMS_TYPE_ARRAY = [MessageType.SMS, MessageType.LMS, MessageType.MMS] as const; export type SmsType = typeof SMS_TYPE_ARRAY[number]; export type TemplateSummary = { diff --git a/src/noti-hub/send-cancellation.ts b/src/noti-hub/send-cancellation.ts index c0cb0c9..619946b 100644 --- a/src/noti-hub/send-cancellation.ts +++ b/src/noti-hub/send-cancellation.ts @@ -4,7 +4,7 @@ import type { SendCancelResponse, SendResultInfo } from "./noti-hub-types.js"; /** 이메일 예약 취소 결과 코드. */ export const EMAIL_RESERVE_CANCELED_RESULT_CODE = 108; -/** 문자(SMS, LMS_MMS)·알림톡(KKO) 예약 취소 결과 코드. */ +/** 문자(SMS, LMS, MMS)·알림톡(KKO) 예약 취소 결과 코드. */ export const SMS_KKO_RESERVE_CANCELED_RESULT_CODE = 9998; /** @@ -28,7 +28,8 @@ export const isReserveCanceledResult = ( case MessageType.EMAIL: return result.resultCode === EMAIL_RESERVE_CANCELED_RESULT_CODE; case MessageType.SMS: - case MessageType.LMS_MMS: + case MessageType.LMS: + case MessageType.MMS: case MessageType.KKO: return result.resultCode === SMS_KKO_RESERVE_CANCELED_RESULT_CODE; default: