@uveysservetoglu/kobil-chat 2.0.0 → 3.0.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/README.md +48 -31
- package/dist/client.d.ts +28 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +137 -23
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types.d.ts +59 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @uveysservetoglu/kobil-chat
|
|
2
2
|
|
|
3
|
-
KOBIL Chat
|
|
3
|
+
KOBIL Chat client for Node.js / TypeScript — the MiniApp API's `/v1/messages` (default) or the
|
|
4
|
+
legacy mPower (Mercury) API — with automatic OAuth token management.
|
|
4
5
|
|
|
5
6
|
```bash
|
|
6
7
|
npm install @uveysservetoglu/kobil-chat
|
|
@@ -9,63 +10,79 @@ npm install @uveysservetoglu/kobil-chat
|
|
|
9
10
|
```ts
|
|
10
11
|
import { ChatClient } from "@uveysservetoglu/kobil-chat";
|
|
11
12
|
|
|
12
|
-
// Everything comes from the environment: OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET
|
|
13
|
-
// MPOWER_BASE, MPOWER_TENANT.
|
|
13
|
+
// Everything comes from the environment: OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET
|
|
14
|
+
// (+ MPOWER_BASE, MPOWER_TENANT in legacy mode).
|
|
14
15
|
const chat = new ChatClient();
|
|
15
16
|
|
|
16
17
|
// …or override anything:
|
|
17
|
-
const
|
|
18
|
+
const legacy = new ChatClient({
|
|
19
|
+
apiMode: "legacy",
|
|
18
20
|
tokenAuthMode: "basic", // some deployments' token endpoint requires Basic auth
|
|
19
21
|
chatBaseUrl: "https://idp.cloud.kobil.com/auth/realms/{TENANT}/mpower/v1/users/{USER_ID}",
|
|
20
22
|
tenantName: "acme",
|
|
21
23
|
});
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
##
|
|
26
|
+
## API mode
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
| `OIDC_ISSUER` | Realm issuer URL; the token endpoint is derived from it. |
|
|
29
|
-
| `OIDC_CLIENT_ID` / `OIDC_CLIENT_SECRET` | Client credentials. The id is also the default `serviceUuid`. |
|
|
30
|
-
| `OIDC_TOKEN_AUTH_MODE` | `post` (default) or `basic`. |
|
|
31
|
-
| `MPOWER_BASE` | mPower origin. Both the message endpoint and the media download URL are derived from it. |
|
|
32
|
-
| `MPOWER_TENANT` | Tenant/realm substituted for `{TENANT}`. |
|
|
28
|
+
Leave `apiMode` unset (or `KOBIL_API_MODE` empty) for the MiniApp API; pass `"legacy"` for mPower.
|
|
29
|
+
See `@uveysservetoglu/kobil-core` for the shared settings.
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`
|
|
31
|
+
| Operation | Miniapp (default) | Legacy |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `sendText` | `POST /v1/messages/sendText` | `POST …/users/{USER_ID}/message` (`processChatMessage`) |
|
|
34
|
+
| `sendChoice` | `POST /v1/messages/sendChoice` — 2–10 choices | `…/message` (`choiceRequest`) |
|
|
35
|
+
| `sendSmartScreen` / `sendMiniAppLink` | `POST /v1/messages/sendMiniAppLink` | `…/message` (`smartScreenService`) |
|
|
36
|
+
| `sendAttachment` | `POST /v1/messages/sendFile` (max 10 MB) | `POST …/users/{USER_ID}/media` |
|
|
37
|
+
| `sendMedia` | `POST /v1/messages/sendMedia` — images downscaled, blurhash added | same as `sendAttachment` |
|
|
38
|
+
| `getAttachmentFile` | `GET /v1/media/{id}` → presigned URL (fetched without your token) | `POST …/media/{MEDIA_ID}/download` |
|
|
39
|
+
| `sendPush` | `POST /v1/notifications/sendPush` | not available |
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
Legacy mode only — derived from `MPOWER_BASE`: `{base}/auth/realms/{TENANT}/mpower/v1/users/{USER_ID}`
|
|
42
|
+
for messages and `{base}/v1/mpower/tenants/{TENANT}/media/{MEDIA_ID}/download` for media. Pass
|
|
43
|
+
`chatBaseUrl` or `mediaDownloadUrl` to use something else. `{TENANT}` is filled from `tenantName`
|
|
44
|
+
(`MPOWER_TENANT`), `{USER_ID}` from the call. `serviceUuid`, `version` and `escapeAttachmentUnicode` only
|
|
45
|
+
apply to legacy messages.
|
|
39
46
|
|
|
40
|
-
`{TENANT}` is filled from `tenantName`, `{USER_ID}` from the call, `{MEDIA_ID}` from
|
|
41
|
-
`getAttachmentFile`. `/message` or `/media` is appended to the chat base per operation.
|
|
42
47
|
Message text supports styling: `*bold*`, `_italic_`, `~strike~`, `\n`.
|
|
43
48
|
|
|
44
|
-
##
|
|
49
|
+
## Operations
|
|
45
50
|
|
|
46
51
|
```ts
|
|
47
|
-
// 1. Plain text
|
|
48
|
-
await chat.sendText({ userId, text: "Hi, how are you?", title: "Update" });
|
|
52
|
+
// 1. Plain text (+ optional push notification, miniapp mode)
|
|
53
|
+
await chat.sendText({ userId, text: "Hi, how are you?", title: "Update", push: { title: "Update", body: "New message" } });
|
|
49
54
|
|
|
50
|
-
// 2. Multi-choice
|
|
51
|
-
await chat.sendChoice({ userId, text: "Continue?", choices: ["Yes", "No"] });
|
|
55
|
+
// 2. Multi-choice — the selection is POSTed to callbackUrl (or the MiniApp's global callback)
|
|
56
|
+
await chat.sendChoice({ userId, text: "Continue?", choices: ["Yes", "No"], callbackUrl });
|
|
57
|
+
await chat.sendChoice({ userId, text: "Delivery?", choices: [{ choiceId: "home", label: "Home" }, { choiceId: "pickup", label: "Pick-up" }] });
|
|
52
58
|
|
|
53
|
-
// 3.
|
|
54
|
-
await chat.
|
|
59
|
+
// 3. Open another MiniApp
|
|
60
|
+
await chat.sendMiniAppLink({ userId, miniappId: "appointments-app", text: "Your appointment is confirmed" });
|
|
61
|
+
await chat.sendSmartScreen({ userId, text: "Opening…", smartScreenServiceUuid: "appointments-app" }); // same, legacy name
|
|
55
62
|
|
|
56
|
-
// 4. Attachment (content type inferred from the file name)
|
|
57
|
-
await chat.sendAttachment({ userId, file: pdfBytes, fileName: "agreement.pdf", text: "Please review" });
|
|
63
|
+
// 4. Attachment (content type inferred from the file name) / image or video
|
|
64
|
+
const sent = await chat.sendAttachment({ userId, file: pdfBytes, fileName: "agreement.pdf", text: "Please review" });
|
|
65
|
+
await chat.sendMedia({ userId, file: photoBytes, fileName: "photo.jpg" });
|
|
58
66
|
|
|
59
|
-
// 5. Download media
|
|
67
|
+
// 5. Download media — one a user sent, or sent.file.mediaId
|
|
60
68
|
const bytes = await chat.getAttachmentFile(mediaId);
|
|
69
|
+
|
|
70
|
+
// 6. Standalone push notification (miniapp mode)
|
|
71
|
+
await chat.sendPush({ userId, content: { title: "Order shipped", body: "Arrives tomorrow", data: { orderId } } });
|
|
61
72
|
```
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
(
|
|
74
|
+
**Choice ids.** The MiniApp API reports the selected `choiceId` to the callback. A plain string choice
|
|
75
|
+
is its own id (so a handler can match on the text, as with legacy), unless it is longer than 64
|
|
76
|
+
characters or repeated — then it becomes `choice-<n>`. Pass `{ choiceId, label }` for full control.
|
|
77
|
+
|
|
78
|
+
Send operations return `{ messageId }` plus `createdAt` (miniapp) or `instanceId` (legacy); attachment
|
|
79
|
+
and media results also carry `file` / `media` with the stored `mediaId`. `push` is ignored in legacy
|
|
80
|
+
mode. JavaScript usage is identical (`const { ChatClient } = require("@uveysservetoglu/kobil-chat")`).
|
|
65
81
|
|
|
66
82
|
## Errors
|
|
67
83
|
|
|
68
|
-
Failures
|
|
84
|
+
Failures reject with `KobilChatError` (extends `KobilError`) with `statusCode` / `responseBody`, plus
|
|
85
|
+
`errorCode` / `subsystem` / `traceId` from the MiniApp API's error envelope.
|
|
69
86
|
|
|
70
87
|
## License
|
|
71
88
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { KobilCredentials, KobilError, KobilServiceClient, TokenProvider } from "@uveysservetoglu/kobil-core";
|
|
2
|
-
import { ChatMessageResult, SendAttachmentInput, SendChoiceInput, SendSmartScreenInput, SendTextInput } from "./types";
|
|
3
|
-
export interface ChatClientOptions extends Partial<KobilCredentials
|
|
1
|
+
import { ApiMode, KobilApiOptions, KobilCredentials, KobilError, KobilServiceClient, PushResponse, TokenProvider } from "@uveysservetoglu/kobil-core";
|
|
2
|
+
import { ChatMessageResult, SendAttachmentInput, SendChoiceInput, SendMiniAppLinkInput, SendPushInput, SendSmartScreenInput, SendTextInput } from "./types";
|
|
3
|
+
export interface ChatClientOptions extends Partial<KobilCredentials>, KobilApiOptions {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Legacy mode: message endpoint template up to the user segment, with {TENANT} and {USER_ID}.
|
|
6
6
|
* Derived from `MPOWER_BASE` when omitted.
|
|
7
7
|
*/
|
|
8
8
|
chatBaseUrl?: string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Legacy mode: media download template with {TENANT} and {MEDIA_ID}. Required for getAttachmentFile.
|
|
11
11
|
* Derived from `MPOWER_BASE` when omitted.
|
|
12
12
|
*/
|
|
13
13
|
mediaDownloadUrl?: string;
|
|
14
|
-
/**
|
|
14
|
+
/** Legacy mode: tenant/realm name substituted for {TENANT}. Falls back to `MPOWER_TENANT`. */
|
|
15
15
|
tenantName?: string;
|
|
16
|
-
/** serviceUuid sent with messages. Optional: defaults to clientId. */
|
|
16
|
+
/** Legacy mode: serviceUuid sent with messages. Optional: defaults to clientId. */
|
|
17
17
|
serviceUuid?: string;
|
|
18
|
-
/**
|
|
18
|
+
/** Legacy mode: wire protocol version. Default: 3. */
|
|
19
19
|
version?: number;
|
|
20
|
-
/**
|
|
20
|
+
/** Legacy mode: escape non-ASCII in the attachment message part (backend compatibility). Default: true. */
|
|
21
21
|
escapeAttachmentUnicode?: boolean;
|
|
22
22
|
tokenProvider?: TokenProvider;
|
|
23
23
|
}
|
|
24
|
-
/** Client for
|
|
24
|
+
/** Client for KOBIL Chat: the MiniApp API's `/v1/messages` (default) or the legacy mPower (Mercury) API. */
|
|
25
25
|
export declare class ChatClient extends KobilServiceClient {
|
|
26
|
+
readonly apiMode: ApiMode;
|
|
27
|
+
private readonly apiBase;
|
|
26
28
|
private readonly chatBaseUrl;
|
|
27
29
|
private readonly mediaDownloadUrl?;
|
|
28
30
|
private readonly tenantName?;
|
|
@@ -32,11 +34,27 @@ export declare class ChatClient extends KobilServiceClient {
|
|
|
32
34
|
private readonly escapeUnicode;
|
|
33
35
|
constructor(options?: ChatClientOptions);
|
|
34
36
|
protected makeError(message: string, statusCode?: number, responseBody?: string, cause?: unknown): KobilError;
|
|
37
|
+
/** Plain text message; `title` is prepended as a first paragraph. */
|
|
35
38
|
sendText(input: SendTextInput, signal?: AbortSignal): Promise<ChatMessageResult>;
|
|
39
|
+
/** Multiple-choice question; the selection is delivered to the callback. */
|
|
36
40
|
sendChoice(input: SendChoiceInput, signal?: AbortSignal): Promise<ChatMessageResult>;
|
|
41
|
+
/** Message with a button that opens another MiniApp (legacy name for {@link sendMiniAppLink}). */
|
|
37
42
|
sendSmartScreen(input: SendSmartScreenInput, signal?: AbortSignal): Promise<ChatMessageResult>;
|
|
43
|
+
/** Message with a button that opens another MiniApp. */
|
|
44
|
+
sendMiniAppLink(input: SendMiniAppLinkInput, signal?: AbortSignal): Promise<ChatMessageResult>;
|
|
45
|
+
/** Sends a file of any type, stored as-is. */
|
|
38
46
|
sendAttachment(input: SendAttachmentInput, signal?: AbortSignal): Promise<ChatMessageResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Sends an image or video. The MiniApp API downscales images and adds dimensions and a blurhash
|
|
49
|
+
* (returned as `media`). Legacy mode has no separate media message and sends it as an attachment.
|
|
50
|
+
*/
|
|
51
|
+
sendMedia(input: SendAttachmentInput, signal?: AbortSignal): Promise<ChatMessageResult>;
|
|
52
|
+
/** Downloads a stored file — one a user sent, or one returned as `file`/`media` — by its media id. */
|
|
39
53
|
getAttachmentFile(mediaId: string, signal?: AbortSignal): Promise<Uint8Array>;
|
|
54
|
+
/** Standalone push notification to all of the user's devices. Miniapp mode only. */
|
|
55
|
+
sendPush(input: SendPushInput, signal?: AbortSignal): Promise<PushResponse>;
|
|
56
|
+
private sendFileMessage;
|
|
57
|
+
private messagesUrl;
|
|
40
58
|
private messageUrl;
|
|
41
59
|
private mediaUrl;
|
|
42
60
|
private userBaseUrl;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,aAAa,EAMd,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,iBAAiB,EAEjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,gBAAgB,CAAC,EAAE,eAAe;IACnF;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2GAA2G;IAC3G,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,4GAA4G;AAC5G,qBAA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,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI7F,sGAAsG;IAChG,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAUnF,oFAAoF;IAC9E,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAYjF,OAAO,CAAC,eAAe;IAkCvB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,WAAW;CAGpB"}
|
package/dist/client.js
CHANGED
|
@@ -4,8 +4,10 @@ exports.ChatClient = void 0;
|
|
|
4
4
|
const kobil_core_1 = require("@uveysservetoglu/kobil-core");
|
|
5
5
|
const error_1 = require("./error");
|
|
6
6
|
const mime_1 = require("./mime");
|
|
7
|
-
/** Client for
|
|
7
|
+
/** Client for KOBIL Chat: the MiniApp API's `/v1/messages` (default) or the legacy mPower (Mercury) API. */
|
|
8
8
|
class ChatClient extends kobil_core_1.KobilServiceClient {
|
|
9
|
+
apiMode;
|
|
10
|
+
apiBase;
|
|
9
11
|
chatBaseUrl;
|
|
10
12
|
mediaDownloadUrl;
|
|
11
13
|
tenantName;
|
|
@@ -14,6 +16,7 @@ class ChatClient extends kobil_core_1.KobilServiceClient {
|
|
|
14
16
|
version;
|
|
15
17
|
escapeUnicode;
|
|
16
18
|
constructor(options = {}) {
|
|
19
|
+
const apiMode = (0, kobil_core_1.resolveApiMode)(options.apiMode);
|
|
17
20
|
const credentials = (0, kobil_core_1.credentialsFromEnv)({
|
|
18
21
|
tokenEndpoint: options.tokenEndpoint,
|
|
19
22
|
clientId: options.clientId,
|
|
@@ -21,14 +24,22 @@ class ChatClient extends kobil_core_1.KobilServiceClient {
|
|
|
21
24
|
tokenAuthMode: options.tokenAuthMode,
|
|
22
25
|
defaultTokenTtlSeconds: options.defaultTokenTtlSeconds,
|
|
23
26
|
tokenExpirySkewSeconds: options.tokenExpirySkewSeconds,
|
|
24
|
-
});
|
|
27
|
+
}, { apiMode, apiBaseUrl: options.apiBaseUrl, realm: options.realm });
|
|
25
28
|
super(options.tokenProvider ?? new kobil_core_1.DefaultTokenProvider(credentials));
|
|
26
|
-
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
this.apiMode = apiMode;
|
|
30
|
+
if (apiMode === "legacy") {
|
|
31
|
+
const chatBaseUrl = options.chatBaseUrl || (0, kobil_core_1.mpowerUserEndpoint)(process.env.MPOWER_BASE);
|
|
32
|
+
if (!chatBaseUrl)
|
|
33
|
+
throw new kobil_core_1.KobilError("No chat endpoint: set MPOWER_BASE (or pass chatBaseUrl).");
|
|
34
|
+
this.chatBaseUrl = chatBaseUrl;
|
|
35
|
+
this.mediaDownloadUrl =
|
|
36
|
+
options.mediaDownloadUrl || (0, kobil_core_1.mpowerMediaDownloadEndpoint)(process.env.MPOWER_BASE) || undefined;
|
|
37
|
+
this.apiBase = "";
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.chatBaseUrl = "";
|
|
41
|
+
this.apiBase = (0, kobil_core_1.miniappApiBase)(options.apiBaseUrl);
|
|
42
|
+
}
|
|
32
43
|
this.tenantName = options.tenantName ?? process.env.MPOWER_TENANT;
|
|
33
44
|
this.clientId = credentials.clientId;
|
|
34
45
|
this.serviceUuidOption = options.serviceUuid;
|
|
@@ -38,56 +49,141 @@ class ChatClient extends kobil_core_1.KobilServiceClient {
|
|
|
38
49
|
makeError(message, statusCode, responseBody, cause) {
|
|
39
50
|
return new error_1.KobilChatError(message, { statusCode, responseBody, cause });
|
|
40
51
|
}
|
|
41
|
-
|
|
52
|
+
/** Plain text message; `title` is prepended as a first paragraph. */
|
|
53
|
+
async sendText(input, signal) {
|
|
42
54
|
if (!input.userId)
|
|
43
55
|
throw new error_1.KobilChatError("userId cannot be empty.");
|
|
56
|
+
const text = composeText(input.title, input.text);
|
|
57
|
+
if (this.apiMode === "miniapp") {
|
|
58
|
+
return this.sendJson("POST", this.messagesUrl("sendText"), prune({
|
|
59
|
+
userId: input.userId,
|
|
60
|
+
text,
|
|
61
|
+
push: input.push,
|
|
62
|
+
}), signal);
|
|
63
|
+
}
|
|
44
64
|
return this.sendJson("POST", this.messageUrl(input.userId), {
|
|
45
65
|
serviceUuid: this.serviceUuid(),
|
|
46
66
|
messageType: "processChatMessage",
|
|
47
67
|
version: this.version,
|
|
48
|
-
messageContent: { messageText:
|
|
68
|
+
messageContent: { messageText: text },
|
|
49
69
|
}, signal);
|
|
50
70
|
}
|
|
51
|
-
|
|
71
|
+
/** Multiple-choice question; the selection is delivered to the callback. */
|
|
72
|
+
async sendChoice(input, signal) {
|
|
52
73
|
if (!input.userId)
|
|
53
74
|
throw new error_1.KobilChatError("userId cannot be empty.");
|
|
54
75
|
if (!input.choices || input.choices.length === 0)
|
|
55
76
|
throw new error_1.KobilChatError("At least one choice is required.");
|
|
77
|
+
const choices = toChoiceOptions(input.choices);
|
|
78
|
+
if (this.apiMode === "miniapp") {
|
|
79
|
+
if (choices.length < 2 || choices.length > 10) {
|
|
80
|
+
throw new error_1.KobilChatError(`The MiniApp API takes 2–10 choices, got ${choices.length}.`);
|
|
81
|
+
}
|
|
82
|
+
return this.sendJson("POST", this.messagesUrl("sendChoice"), prune({
|
|
83
|
+
userId: input.userId,
|
|
84
|
+
text: input.text ?? "",
|
|
85
|
+
choices,
|
|
86
|
+
callbackUrl: input.callbackUrl,
|
|
87
|
+
push: input.push,
|
|
88
|
+
}), signal);
|
|
89
|
+
}
|
|
56
90
|
return this.sendJson("POST", this.messageUrl(input.userId), {
|
|
57
91
|
serviceUuid: this.serviceUuid(),
|
|
58
92
|
messageType: "choiceRequest",
|
|
59
93
|
version: this.version,
|
|
60
94
|
messageContent: {
|
|
61
95
|
messageText: input.text ?? "",
|
|
62
|
-
choices:
|
|
96
|
+
choices: choices.map((c) => ({ text: c.label })),
|
|
63
97
|
},
|
|
64
98
|
}, signal);
|
|
65
99
|
}
|
|
66
|
-
|
|
100
|
+
/** Message with a button that opens another MiniApp (legacy name for {@link sendMiniAppLink}). */
|
|
101
|
+
async sendSmartScreen(input, signal) {
|
|
67
102
|
if (!input.userId)
|
|
68
103
|
throw new error_1.KobilChatError("userId cannot be empty.");
|
|
69
104
|
if (!input.smartScreenServiceUuid)
|
|
70
105
|
throw new error_1.KobilChatError("smartScreenServiceUuid cannot be empty.");
|
|
106
|
+
return this.sendMiniAppLink({ userId: input.userId, miniappId: input.smartScreenServiceUuid, text: input.text, push: input.push }, signal);
|
|
107
|
+
}
|
|
108
|
+
/** Message with a button that opens another MiniApp. */
|
|
109
|
+
async sendMiniAppLink(input, signal) {
|
|
110
|
+
if (!input.userId)
|
|
111
|
+
throw new error_1.KobilChatError("userId cannot be empty.");
|
|
112
|
+
if (!input.miniappId)
|
|
113
|
+
throw new error_1.KobilChatError("miniappId cannot be empty.");
|
|
114
|
+
if (this.apiMode === "miniapp") {
|
|
115
|
+
return this.sendJson("POST", this.messagesUrl("sendMiniAppLink"), prune({
|
|
116
|
+
userId: input.userId,
|
|
117
|
+
miniappId: input.miniappId,
|
|
118
|
+
text: input.text,
|
|
119
|
+
push: input.push,
|
|
120
|
+
}), signal);
|
|
121
|
+
}
|
|
71
122
|
return this.sendJson("POST", this.messageUrl(input.userId), {
|
|
72
123
|
serviceUuid: this.serviceUuid(),
|
|
73
124
|
messageType: "smartScreenService",
|
|
74
125
|
version: this.version,
|
|
75
126
|
messageContent: {
|
|
76
127
|
messageText: input.text ?? "",
|
|
77
|
-
smartScreenServiceUuid: input.
|
|
128
|
+
smartScreenServiceUuid: input.miniappId,
|
|
78
129
|
},
|
|
79
130
|
}, signal);
|
|
80
131
|
}
|
|
81
|
-
|
|
132
|
+
/** Sends a file of any type, stored as-is. */
|
|
133
|
+
async sendAttachment(input, signal) {
|
|
134
|
+
return this.sendFileMessage(input, "sendFile", signal);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Sends an image or video. The MiniApp API downscales images and adds dimensions and a blurhash
|
|
138
|
+
* (returned as `media`). Legacy mode has no separate media message and sends it as an attachment.
|
|
139
|
+
*/
|
|
140
|
+
async sendMedia(input, signal) {
|
|
141
|
+
return this.sendFileMessage(input, "sendMedia", signal);
|
|
142
|
+
}
|
|
143
|
+
/** Downloads a stored file — one a user sent, or one returned as `file`/`media` — by its media id. */
|
|
144
|
+
async getAttachmentFile(mediaId, signal) {
|
|
145
|
+
if (!mediaId)
|
|
146
|
+
throw new error_1.KobilChatError("mediaId cannot be empty.");
|
|
147
|
+
if (this.apiMode === "miniapp") {
|
|
148
|
+
return this.downloadViaRedirect(`${this.apiBase}/v1/media/${encodeURIComponent(mediaId)}`, signal);
|
|
149
|
+
}
|
|
150
|
+
if (!this.mediaDownloadUrl)
|
|
151
|
+
throw new kobil_core_1.KobilError("mediaDownloadUrl is required to download attachments.");
|
|
152
|
+
const url = replaceTokens(this.mediaDownloadUrl, { "{TENANT}": this.tenantName, "{MEDIA_ID}": mediaId });
|
|
153
|
+
return this.sendForBytes("POST", url, signal);
|
|
154
|
+
}
|
|
155
|
+
/** Standalone push notification to all of the user's devices. Miniapp mode only. */
|
|
156
|
+
async sendPush(input, signal) {
|
|
157
|
+
if (!input.userId)
|
|
158
|
+
throw new error_1.KobilChatError("userId cannot be empty.");
|
|
159
|
+
if (!input.content)
|
|
160
|
+
throw new error_1.KobilChatError("content cannot be empty.");
|
|
161
|
+
if (this.apiMode !== "miniapp") {
|
|
162
|
+
throw new error_1.KobilChatError("sendPush is only available in miniapp mode: the legacy API has no push endpoint.");
|
|
163
|
+
}
|
|
164
|
+
return this.sendJson("POST", `${this.apiBase}/v1/notifications/sendPush`, {
|
|
165
|
+
userId: input.userId,
|
|
166
|
+
content: input.content,
|
|
167
|
+
}, signal);
|
|
168
|
+
}
|
|
169
|
+
sendFileMessage(input, endpoint, signal) {
|
|
82
170
|
if (!input.userId)
|
|
83
171
|
throw new error_1.KobilChatError("userId cannot be empty.");
|
|
84
172
|
if (!input.file || input.file.length === 0)
|
|
85
173
|
throw new error_1.KobilChatError("file cannot be empty.");
|
|
174
|
+
const text = composeAttachmentText(input.title, input.text);
|
|
175
|
+
if (this.apiMode === "miniapp") {
|
|
176
|
+
const message = prune({ userId: input.userId, text: text || undefined, push: input.push });
|
|
177
|
+
return this.sendMultipart("POST", this.messagesUrl(endpoint), [
|
|
178
|
+
{ name: "file", value: input.file, fileName: (0, mime_1.resolveFileName)(input), contentType: (0, mime_1.resolveContentType)(input) },
|
|
179
|
+
{ name: "message", value: JSON.stringify(message), contentType: "application/json" },
|
|
180
|
+
], signal);
|
|
181
|
+
}
|
|
86
182
|
const message = {
|
|
87
183
|
serviceUuid: this.serviceUuid(),
|
|
88
184
|
messageType: "attachmentMessage",
|
|
89
185
|
version: this.version,
|
|
90
|
-
messageContent: { messageText:
|
|
186
|
+
messageContent: { messageText: text },
|
|
91
187
|
};
|
|
92
188
|
let messageJson = JSON.stringify(message);
|
|
93
189
|
if (this.escapeUnicode)
|
|
@@ -98,13 +194,8 @@ class ChatClient extends kobil_core_1.KobilServiceClient {
|
|
|
98
194
|
form.append("message", messageJson);
|
|
99
195
|
return this.send("POST", this.mediaUrl(input.userId), form, signal);
|
|
100
196
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
throw new error_1.KobilChatError("mediaId cannot be empty.");
|
|
104
|
-
if (!this.mediaDownloadUrl)
|
|
105
|
-
throw new kobil_core_1.KobilError("mediaDownloadUrl is required to download attachments.");
|
|
106
|
-
const url = replaceTokens(this.mediaDownloadUrl, { "{TENANT}": this.tenantName, "{MEDIA_ID}": mediaId });
|
|
107
|
-
return this.sendForBytes("POST", url, signal);
|
|
197
|
+
messagesUrl(operation) {
|
|
198
|
+
return `${this.apiBase}/v1/messages/${operation}`;
|
|
108
199
|
}
|
|
109
200
|
messageUrl(userId) {
|
|
110
201
|
return `${this.userBaseUrl(userId)}/message`;
|
|
@@ -120,6 +211,20 @@ class ChatClient extends kobil_core_1.KobilServiceClient {
|
|
|
120
211
|
}
|
|
121
212
|
}
|
|
122
213
|
exports.ChatClient = ChatClient;
|
|
214
|
+
/**
|
|
215
|
+
* Gives every choice an id. Strings are their own id when that fits the API (≤ 64 characters, not
|
|
216
|
+
* already taken) so a callback handler can match on the text; otherwise the id is `choice-<n>`.
|
|
217
|
+
*/
|
|
218
|
+
function toChoiceOptions(choices) {
|
|
219
|
+
const taken = new Set(choices.filter((c) => typeof c !== "string").map((c) => c.choiceId));
|
|
220
|
+
return choices.map((choice, i) => {
|
|
221
|
+
if (typeof choice !== "string")
|
|
222
|
+
return choice;
|
|
223
|
+
const choiceId = choice.length > 0 && choice.length <= 64 && !taken.has(choice) ? choice : `choice-${i + 1}`;
|
|
224
|
+
taken.add(choiceId);
|
|
225
|
+
return { choiceId, label: choice };
|
|
226
|
+
});
|
|
227
|
+
}
|
|
123
228
|
function composeText(title, text) {
|
|
124
229
|
return title ? `${title}\n\n${text}` : text ?? "";
|
|
125
230
|
}
|
|
@@ -140,4 +245,13 @@ function replaceTokens(template, tokens) {
|
|
|
140
245
|
}
|
|
141
246
|
return result;
|
|
142
247
|
}
|
|
248
|
+
/** Removes undefined/null properties so optional fields are omitted from the JSON body. */
|
|
249
|
+
function prune(obj) {
|
|
250
|
+
const out = {};
|
|
251
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
252
|
+
if (value !== undefined && value !== null)
|
|
253
|
+
out[key] = value;
|
|
254
|
+
}
|
|
255
|
+
return out;
|
|
256
|
+
}
|
|
143
257
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"client.js","s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0C;IACjF,IAAI,MAAM,GAAG,QAAQ,CAAC;IACtB,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACpD,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,2FAA2F;AAC3F,SAAS,KAAK,CAAC,GAA4B;IACzC,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ChatClient } from "./client";
|
|
2
2
|
export type { ChatClientOptions } from "./client";
|
|
3
3
|
export { KobilChatError } from "./error";
|
|
4
|
-
export type { SendTextInput, SendChoiceInput, SendSmartScreenInput, SendAttachmentInput, ChatMessageResult, } from "./types";
|
|
4
|
+
export type { SendTextInput, SendChoiceInput, ChoiceOption, SendSmartScreenInput, SendMiniAppLinkInput, SendAttachmentInput, SendPushInput, ChatMessageResult, FileMetadata, MediaMetadata, } from "./types";
|
|
5
|
+
export type { PushContent, PushResponse, PushDeviceResult } from "@uveysservetoglu/kobil-core";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,22 +1,51 @@
|
|
|
1
|
+
import type { PushContent, PushResponse } from "@uveysservetoglu/kobil-core";
|
|
1
2
|
export interface SendTextInput {
|
|
2
3
|
userId: string;
|
|
3
4
|
/** Message body. Supports styling: *bold*, _italic_, ~strike~, \n. */
|
|
4
5
|
text: string;
|
|
5
6
|
title?: string;
|
|
7
|
+
/** Miniapp mode: push notification bundled with the message. Ignored in legacy mode. */
|
|
8
|
+
push?: PushContent;
|
|
9
|
+
}
|
|
10
|
+
/** A choice with an explicit id — the id is what the callback reports back. */
|
|
11
|
+
export interface ChoiceOption {
|
|
12
|
+
/** Max 64 characters. */
|
|
13
|
+
choiceId: string;
|
|
14
|
+
/** Button text. Max 128 characters. */
|
|
15
|
+
label: string;
|
|
6
16
|
}
|
|
7
17
|
export interface SendChoiceInput {
|
|
8
18
|
userId: string;
|
|
9
19
|
text: string;
|
|
10
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The options. A plain string is both label and id (an id longer than 64 characters, or a repeated
|
|
22
|
+
* one, becomes `choice-<n>`). Miniapp mode needs 2–10 of them.
|
|
23
|
+
*/
|
|
24
|
+
choices: Array<string | ChoiceOption>;
|
|
25
|
+
/** Miniapp mode: where the user's selection is POSTed. Omit for the MiniApp's global callback. */
|
|
26
|
+
callbackUrl?: string;
|
|
27
|
+
/** Miniapp mode: push notification bundled with the message. Ignored in legacy mode. */
|
|
28
|
+
push?: PushContent;
|
|
11
29
|
}
|
|
12
30
|
export interface SendSmartScreenInput {
|
|
13
31
|
userId: string;
|
|
14
32
|
text: string;
|
|
33
|
+
/** The MiniApp to open (sent as `miniappId` in miniapp mode). */
|
|
15
34
|
smartScreenServiceUuid: string;
|
|
35
|
+
/** Miniapp mode: push notification bundled with the message. Ignored in legacy mode. */
|
|
36
|
+
push?: PushContent;
|
|
37
|
+
}
|
|
38
|
+
export interface SendMiniAppLinkInput {
|
|
39
|
+
userId: string;
|
|
40
|
+
/** The MiniApp to open (sent as `smartScreenServiceUuid` in legacy mode). */
|
|
41
|
+
miniappId: string;
|
|
42
|
+
text?: string;
|
|
43
|
+
/** Miniapp mode: push notification bundled with the message. Ignored in legacy mode. */
|
|
44
|
+
push?: PushContent;
|
|
16
45
|
}
|
|
17
46
|
export interface SendAttachmentInput {
|
|
18
47
|
userId: string;
|
|
19
|
-
/** Raw file bytes. */
|
|
48
|
+
/** Raw file bytes. Max 10 MB in miniapp mode. */
|
|
20
49
|
file: Uint8Array;
|
|
21
50
|
/** File name. If omitted, one is generated from the extension. */
|
|
22
51
|
fileName?: string;
|
|
@@ -26,10 +55,38 @@ export interface SendAttachmentInput {
|
|
|
26
55
|
fileExtension?: string;
|
|
27
56
|
title?: string;
|
|
28
57
|
text?: string;
|
|
58
|
+
/** Miniapp mode: push notification bundled with the message. Ignored in legacy mode. */
|
|
59
|
+
push?: PushContent;
|
|
60
|
+
}
|
|
61
|
+
export interface SendPushInput {
|
|
62
|
+
userId: string;
|
|
63
|
+
content: PushContent;
|
|
64
|
+
}
|
|
65
|
+
/** A stored file, as the MiniApp API describes it. Download it with `getAttachmentFile(mediaId)`. */
|
|
66
|
+
export interface FileMetadata {
|
|
67
|
+
mediaId: string;
|
|
68
|
+
fileName: string;
|
|
69
|
+
contentType: string;
|
|
70
|
+
fileSize: number;
|
|
71
|
+
}
|
|
72
|
+
/** A stored image or video: the file plus what `sendMedia` derived from it. */
|
|
73
|
+
export interface MediaMetadata extends FileMetadata {
|
|
74
|
+
width?: number;
|
|
75
|
+
height?: number;
|
|
76
|
+
blurhash?: string;
|
|
29
77
|
}
|
|
30
78
|
export interface ChatMessageResult {
|
|
31
79
|
messageId?: string;
|
|
80
|
+
/** Legacy mode. */
|
|
32
81
|
instanceId?: string;
|
|
82
|
+
/** Miniapp mode: when the message was created (ISO 8601). */
|
|
83
|
+
createdAt?: string;
|
|
84
|
+
/** Miniapp mode, `sendAttachment`: the stored file. */
|
|
85
|
+
file?: FileMetadata;
|
|
86
|
+
/** Miniapp mode, `sendMedia`: the stored image or video. */
|
|
87
|
+
media?: MediaMetadata;
|
|
88
|
+
/** Miniapp mode: outcome of the bundled push, when one was sent. */
|
|
89
|
+
push?: PushResponse;
|
|
33
90
|
[key: string]: unknown;
|
|
34
91
|
}
|
|
35
92
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,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MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,qGAAqG;AACrG,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,+EAA+E;AAC/E,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,oEAAoE;IACpE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uveysservetoglu/kobil-chat",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "KOBIL Chat (Mercury) client for Node.js: send text, multi-choice and SmartScreen messages, send attachments and download media, with automatic OAuth token management.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "https://github.com/uveysservetoglu/kobil-sdks"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@uveysservetoglu/kobil-core": "^
|
|
22
|
+
"@uveysservetoglu/kobil-core": "^3.0.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsc -b"
|