@k-msg/core 0.8.0 → 0.10.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.
@@ -1,6 +1,6 @@
1
1
  import type { KMsgError } from "./errors";
2
2
  import type { Result } from "./result";
3
- import type { DeliveryStatusQuery, DeliveryStatusResult, KakaoChannel, KakaoChannelCategories, MessageType, SendOptions, SendResult } from "./types/index";
3
+ import type { DeliveryStatusQuery, DeliveryStatusResult, KakaoChannel, KakaoChannelCategories, MessageType, ProviderOnboardingSpec, SendOptions, SendResult } from "./types/index";
4
4
  export interface Template {
5
5
  id: string;
6
6
  code: string;
@@ -71,4 +71,5 @@ export interface Provider {
71
71
  healthCheck(): Promise<ProviderHealthStatus>;
72
72
  send(params: SendOptions): Promise<Result<SendResult, KMsgError>>;
73
73
  getDeliveryStatus?(query: DeliveryStatusQuery): Promise<Result<DeliveryStatusResult | null, KMsgError>>;
74
+ getOnboardingSpec?(): ProviderOnboardingSpec;
74
75
  }
@@ -3,3 +3,4 @@ export * from "./delivery-status";
3
3
  export * from "./history";
4
4
  export * from "./kakao-channel";
5
5
  export * from "./message";
6
+ export * from "./onboarding";
@@ -66,6 +66,7 @@ export interface CommonSendOptions {
66
66
  }
67
67
  export interface KakaoSendOptions {
68
68
  profileId?: string;
69
+ plusId?: string;
69
70
  disableSms?: boolean;
70
71
  adFlag?: boolean;
71
72
  buttons?: unknown[];
@@ -76,6 +77,18 @@ export interface KakaoSendOptions {
76
77
  imageLink?: string;
77
78
  [key: string]: any;
78
79
  }
80
+ export interface AlimTalkFailoverOptions {
81
+ enabled?: boolean;
82
+ fallbackChannel?: "sms" | "lms";
83
+ fallbackContent?: string;
84
+ fallbackTitle?: string;
85
+ }
86
+ export type SendWarningCode = "FAILOVER_UNSUPPORTED_PROVIDER" | "FAILOVER_PARTIAL_PROVIDER" | "FALLBACK_CONTENT_MISSING" | (string & {});
87
+ export interface SendWarning {
88
+ code: SendWarningCode;
89
+ message: string;
90
+ details?: Record<string, unknown>;
91
+ }
79
92
  export interface NaverSendOptions {
80
93
  talkId?: string;
81
94
  /**
@@ -144,6 +157,7 @@ export interface AlimTalkSendOptions extends CommonSendOptions {
144
157
  templateCode: string;
145
158
  variables: MessageVariables;
146
159
  kakao?: KakaoSendOptions;
160
+ failover?: AlimTalkFailoverOptions;
147
161
  }
148
162
  export interface FriendTalkSendOptions extends CommonSendOptions {
149
163
  type: "FRIENDTALK";
@@ -213,5 +227,6 @@ export interface SendResult {
213
227
  status: MessageStatus;
214
228
  type: MessageType;
215
229
  to: string;
230
+ warnings?: SendWarning[];
216
231
  raw?: unknown;
217
232
  }
@@ -0,0 +1,42 @@
1
+ export type ProviderOnboardingCheckKind = "manual" | "config" | "capability" | "api_probe" | "inference";
2
+ export type ProviderOnboardingSeverity = "blocker" | "warning" | "info";
3
+ export type ProviderOnboardingScope = "doctor" | "preflight" | "send";
4
+ export type ProviderPlusIdPolicy = "optional" | "required" | "required_if_no_inference";
5
+ export type ProviderPlusIdInferenceSupport = "supported" | "unsupported";
6
+ export type ProviderChannelOnboardingMode = "manual" | "api" | "none";
7
+ export type ProviderTemplateLifecycleAvailability = "available" | "unavailable";
8
+ export type ProviderLiveTestSupport = "supported" | "partial" | "none";
9
+ export type ProviderOnboardingProbeOperation = "list_templates" | "list_kakao_channels";
10
+ export interface ProviderOnboardingCheckSpec {
11
+ id: string;
12
+ title: string;
13
+ description?: string;
14
+ kind: ProviderOnboardingCheckKind;
15
+ severity: ProviderOnboardingSeverity;
16
+ scopes: ProviderOnboardingScope[];
17
+ /**
18
+ * Relative key paths under provider config (e.g. "apiKey", "nested.token").
19
+ * Used when kind === "config".
20
+ */
21
+ configKeys?: string[];
22
+ /**
23
+ * Method names that must exist on provider instances.
24
+ * Used when kind === "capability".
25
+ */
26
+ capabilityMethods?: string[];
27
+ /**
28
+ * Well-known probe operation used when kind === "api_probe".
29
+ */
30
+ probeOperation?: ProviderOnboardingProbeOperation;
31
+ }
32
+ export interface ProviderOnboardingSpec {
33
+ providerId: string;
34
+ providerName?: string;
35
+ channelOnboarding: ProviderChannelOnboardingMode;
36
+ templateLifecycleApi: ProviderTemplateLifecycleAvailability;
37
+ plusIdPolicy: ProviderPlusIdPolicy;
38
+ plusIdInference: ProviderPlusIdInferenceSupport;
39
+ liveTestSupport?: ProviderLiveTestSupport;
40
+ checks: ProviderOnboardingCheckSpec[];
41
+ notes?: string[];
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-msg/core",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "packageManager": "bun@1.3.8",
5
5
  "description": "Core types and interfaces for K-Message platform",
6
6
  "type": "module",