@k-msg/channel 0.19.1 → 0.21.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/README.md +42 -49
- package/dist/index.d.ts +7 -8
- package/dist/index.js +2 -41
- package/dist/index.js.map +12 -83
- package/dist/index.mjs +2 -41
- package/dist/index.mjs.map +12 -83
- package/dist/runtime/adapters/aligo.adapter.d.ts +10 -0
- package/dist/runtime/adapters/iwinv.adapter.d.ts +7 -0
- package/dist/runtime/adapters/mock.adapter.d.ts +5 -0
- package/dist/runtime/adapters/solapi.adapter.d.ts +7 -0
- package/dist/runtime/kakao-channel-binding-resolver.d.ts +10 -0
- package/dist/runtime/kakao-channel-capability.service.d.ts +4 -0
- package/dist/runtime/kakao-channel-lifecycle.service.d.ts +19 -0
- package/dist/runtime/types.d.ts +101 -0
- package/dist/toolkit/index.d.ts +8 -0
- package/dist/toolkit/index.js +43 -0
- package/dist/toolkit/index.js.map +89 -0
- package/dist/toolkit/index.mjs +43 -0
- package/dist/toolkit/index.mjs.map +89 -0
- package/dist/{kakao → toolkit/kakao}/channel.d.ts +1 -1
- package/dist/{kakao → toolkit/kakao}/sender-number.d.ts +1 -1
- package/dist/{management → toolkit/management}/crud.d.ts +1 -1
- package/dist/{services → toolkit/services}/channel.service.d.ts +2 -2
- package/dist/{verification → toolkit/verification}/business.verify.d.ts +1 -1
- package/dist/{verification → toolkit/verification}/number.verify.d.ts +3 -3
- package/package.json +9 -3
- /package/dist/{management → toolkit/management}/permissions.d.ts +0 -0
- /package/dist/{shared → toolkit/shared}/event-emitter.d.ts +0 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Canonical docs: [k-msg.and.guide](https://k-msg.and.guide)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Runtime-first Kakao channel orchestration for `k-msg`.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -12,72 +12,65 @@ npm install @k-msg/channel @k-msg/core
|
|
|
12
12
|
bun add @k-msg/channel @k-msg/core
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Runtime API (`@k-msg/channel`)
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
- **Sender Number Registration**: Automated sender number registration and verification
|
|
19
|
-
- **Business Verification**: Business information verification for AlimTalk channels
|
|
20
|
-
- **Permission Management**: Role-based access control for channels
|
|
21
|
-
- **Status Monitoring**: Real-time channel status monitoring
|
|
17
|
+
Root exports are runtime-focused:
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
- `KakaoChannelCapabilityService`
|
|
20
|
+
- `KakaoChannelBindingResolver`
|
|
21
|
+
- `KakaoChannelLifecycleService`
|
|
22
|
+
- runtime types (`KakaoChannelCapabilityMode`, `KakaoChannelBinding`, `ResolvedKakaoChannelBinding`, `KakaoChannelListItem`, ...)
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
### Capability modes
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
- `api`: provider exposes channel onboarding APIs (`list/auth/add/categories`)
|
|
27
|
+
- `manual`: provider requires manual onboarding (no channel onboarding API calls)
|
|
28
|
+
- `none`: provider does not support channel onboarding APIs
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
import { ChannelService } from '@k-msg/channel';
|
|
30
|
+
### Example: resolve config binding
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
```ts
|
|
33
|
+
import { KakaoChannelBindingResolver } from "@k-msg/channel";
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
const channel = await channelService.createChannel({
|
|
36
|
-
name: 'My Business Channel',
|
|
37
|
-
provider: 'iwinv',
|
|
38
|
-
businessInfo: {
|
|
39
|
-
name: 'My Company Ltd.',
|
|
40
|
-
registrationNumber: '123-45-67890',
|
|
41
|
-
category: 'E-COMMERCE',
|
|
42
|
-
contactEmail: 'contact@mycompany.com',
|
|
43
|
-
contactPhone: '02-1234-5678'
|
|
44
|
-
}
|
|
45
|
-
});
|
|
35
|
+
const resolver = new KakaoChannelBindingResolver(config);
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
const resolved = resolver.resolve({
|
|
38
|
+
providerId: "solapi-main",
|
|
39
|
+
channelAlias: "main",
|
|
40
|
+
senderKey: undefined,
|
|
41
|
+
plusId: undefined,
|
|
51
42
|
});
|
|
43
|
+
|
|
44
|
+
// precedence: explicit > alias > defaults > provider config
|
|
45
|
+
console.log(resolved.senderKey, resolved.plusId);
|
|
52
46
|
```
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
### Example: provider lifecycle calls
|
|
55
49
|
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{ type: 'BUSINESS_LICENSE', url: 'https://docs.example.com/license.pdf' },
|
|
61
|
-
{ type: 'REPRESENTATIVE_ID', url: 'https://docs.example.com/id.pdf' }
|
|
62
|
-
]
|
|
63
|
-
});
|
|
50
|
+
```ts
|
|
51
|
+
import { KakaoChannelLifecycleService } from "@k-msg/channel";
|
|
52
|
+
|
|
53
|
+
const service = new KakaoChannelLifecycleService(provider);
|
|
64
54
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
console.log(
|
|
55
|
+
const channels = await service.list();
|
|
56
|
+
if (channels.isSuccess) {
|
|
57
|
+
console.log(channels.value); // KakaoChannelListItem[] with source="api"
|
|
58
|
+
}
|
|
68
59
|
```
|
|
69
60
|
|
|
70
|
-
##
|
|
61
|
+
## Toolkit API (`@k-msg/channel/toolkit`)
|
|
71
62
|
|
|
72
|
-
|
|
73
|
-
// List all sender numbers for a channel
|
|
74
|
-
const senderNumbers = await channelService.getSenderNumbers(channel.id);
|
|
63
|
+
In-memory channel/sender helpers are now toolkit-only exports:
|
|
75
64
|
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
- `KakaoChannelManager`
|
|
66
|
+
- `KakaoSenderNumberManager`
|
|
67
|
+
- `ChannelCRUD`
|
|
68
|
+
- `PermissionManager`
|
|
69
|
+
- `ChannelService`
|
|
70
|
+
- verification helpers and legacy channel types
|
|
78
71
|
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
```ts
|
|
73
|
+
import { KakaoChannelManager } from "@k-msg/channel/toolkit";
|
|
81
74
|
```
|
|
82
75
|
|
|
83
76
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export
|
|
7
|
-
export {
|
|
8
|
-
export { NumberVerifier, type NumberVerifierOptions, type PhoneNumberInfo, type PhoneVerificationRequest, type PhoneVerificationStatus, type SMSProvider, type VerificationAttempt, VerificationMethod, VerificationType, type VoiceProvider, } from "./verification/number.verify";
|
|
1
|
+
/**
|
|
2
|
+
* Runtime channel APIs
|
|
3
|
+
*/
|
|
4
|
+
export { KakaoChannelBindingResolver } from "./runtime/kakao-channel-binding-resolver";
|
|
5
|
+
export { KakaoChannelCapabilityService } from "./runtime/kakao-channel-capability.service";
|
|
6
|
+
export { KakaoChannelLifecycleService } from "./runtime/kakao-channel-lifecycle.service";
|
|
7
|
+
export type { KakaoChannelAddParams, KakaoChannelAliasEntry, KakaoChannelApiAdapter, KakaoChannelApiOperation, KakaoChannelAuthParams, KakaoChannelBinding, KakaoChannelBindingSource, KakaoChannelCapability, KakaoChannelCapabilityMode, KakaoChannelListItem, KakaoChannelListParams, KakaoChannelResolveInput, KakaoChannelResolverConfig, KakaoChannelRuntimeProvider, KakaoProviderConfigEntry, ResolvedKakaoChannelBinding, } from "./runtime/types";
|