Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# 📦 CHANGELOG

All notable changes to this project will be documented in this file.

---

## [2.0.0] - 2024-06-24

### Added
- Test code

### Fixed
- Miss types

---

## [1.0.27] - 2024-09-24

### Added
- Optional fields for channel/user updates:
- `PUT /group_channels/{channel_url}` and `PUT /open_channels/{channel_url}`: all fields except `channel_url` are now optional.
- `PUT /users/{user_id}`: `nickname` and `profile_url` made optional.
- `GET /group_channels/{channel_url}/messages/unread_count`: now supports multiple `user_ids`.
- `read_receipt` added to `GroupChannel` model.
- Support for multiple file messages via `files` array.
- `GET /{channel_type}/{channel_url}/messages`:
- New support for `include_reply_type`, `include_parent_message_info`, and `parent_message_info`.
- `GET /{channel_type}/{channel_url}/messages/{message_id}`: `include_parent_message_info` now supported.
- New typing indicator endpoints:
- `POST /v3/group_channels/{channel_url}/typing`
- `PUT /v3/group_channels/{channel_url}/typing`
- `POST /v3/group_channels/{channel_url}/invite`: `users`, `invitation_status`, `hidden_status` are now optional.
- `PUT /v3/users/{user_id}/push_preference`: `block_push_from_bots`, `push_blocked_bot_ids` are optional.
- `/v3/bots/{bot_userid}/send`: added support for `extended_message_payload` and `target_message_id`.

### Fixed
- OG image type was missing from metadata in `GET /{channel_type}/{channel_url}/messages`.
- Incorrect date types in API responses.
- Removed `isFrozen` property (use `freeze` instead).
- Fixed `DELETE /users/{user_id}/push/{token_type}/{token}`: `token` must now be a string, not an array.

### Changed
- `apiToken()` is no longer required in every request.

---

## [1.0.15] - 2023-10-25

### Changed
- Switched to group parameter format.

---

## [0.0.14] - 2023-10-10

### Added
- Tagged release. No additional notes.

---

## [1.0.7] - 2023-08-03

### Changed
- Internal improvements via OpenAPI generator (PR #12).

---

## [1.0.3] - 2023-06-29

### Added
- Introduced:
- Announcement API
- Metadata API

### Changed
- Restructured Moderation APIs under dedicated Moderation module.

---

> This CHANGELOG follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) principles.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
[![NPM](https://img.shields.io/npm/v/sendbird-platform-sdk.svg)](https://www.npmjs.com/package/sendbird-platform-sdk)

This is a Node.js package that makes talking to the [Sendbird Platform API](https://sendbird.com/docs/chat/v3/platform-api/getting-started/prepare-to-use-api) easier. With this library you can extend your Sendbird integration to include advanced features like channel automation and user management.

>__Note__: Platform API SDK v2 includes only the APIs that were actively used in v1. If you need help getting started with the new SDK, [contact us](https://dashboard.sendbird.com/settings/contact_us).

# Install
```npm install sendbird-platform-sdk```
```npm install @sendbird/sendbird-platform-sdk-javascript```

# 🔥 Quick start

```javascript
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
import SendbirdPlatformSdk from '@sendbird/sendbird-platform-sdk-javascript';

const userId = "1234";
const name = "bob";
Expand Down Expand Up @@ -59,10 +62,10 @@ You will need [Node.js](https://nodejs.org/en/download/) installed. This has bee
You can install the SDK directly from npm:
```
# Using npm
npm install sendbird-platform-sdk
npm install @sendbird/sendbird-platform-sdk-javascript

# Using yarn
yarn add sendbird-platform-sdk
yarn add @sendbird/sendbird-platform-sdk-javascript
```
> ⚠️ This SDK is intended for use in server-side environments only. Do not use it in browsers or frontend applications.

Expand Down
20 changes: 1 addition & 19 deletions dist/api/GroupChannelApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,6 @@ var GroupChannelApi = exports["default"] = /*#__PURE__*/function () {
* @param {String} opts.metacounterValueLt Searches for group channels with metacounter containing an item with the key specified by the metadata_key parameter, where the value of that item is lower than the value specified by this parameter. To use this parameter, the metacounter_key parameter should be specified.
* @param {String} opts.metacounterValueLte Searches for group channels with metacounter containing an item with the key specified by the metadata_key parameter, where the value of that item is lower than or equal to the value specified by this parameter. To use this parameter, the metacounter_key parameter should be specified.
* @param {Boolean} opts.includeSortedMetaarrayInLastMessage Determines whether to include the sorted_metaarray as one of the last_message’s properties in the response.
* @param {String} opts.customType (Deprecated) Returns channels whose custom_type matches the given value. If this field is not specified, all channels are returned, regardless of their custom type. The string passed here must be urlencoded.
* @param {Boolean} opts.readReceipt (Deprecated) Superseded by show_read_receipt.
* @param {Boolean} opts.member (Deprecated) Superseded by show_member.
* @param {Boolean} opts.isDistinct (Deprecated) Superseded by distinct_mode.
* @param {String} opts.membersIn (Deprecated) Superseded by members_exactly_in.
* @param {String} opts.userId (Deprecated) Restricts the search scope to only retrieve the target user's group channels. It's recommended to use the list group channels by user action instead.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GroupChatListChannelsResponse} and HTTP response
*/
}, {
Expand Down Expand Up @@ -672,13 +666,7 @@ var GroupChannelApi = exports["default"] = /*#__PURE__*/function () {
'metacounter_value_gte': opts['metacounterValueGte'],
'metacounter_value_lt': opts['metacounterValueLt'],
'metacounter_value_lte': opts['metacounterValueLte'],
'include_sorted_metaarray_in_last_message': opts['includeSortedMetaarrayInLastMessage'],
'custom_type': opts['customType'],
'read_receipt': opts['readReceipt'],
'member': opts['member'],
'is_distinct': opts['isDistinct'],
'members_in': opts['membersIn'],
'user_id': opts['userId']
'include_sorted_metaarray_in_last_message': opts['includeSortedMetaarrayInLastMessage']
};
var headerParams = {
'api-token': apiToken
Expand Down Expand Up @@ -732,12 +720,6 @@ var GroupChannelApi = exports["default"] = /*#__PURE__*/function () {
* @param {String} opts.metacounterValueLt Searches for group channels with metacounter containing an item with the key specified by the metadata_key parameter, where the value of that item is lower than the value specified by this parameter. To use this parameter, the metacounter_key parameter should be specified.
* @param {String} opts.metacounterValueLte Searches for group channels with metacounter containing an item with the key specified by the metadata_key parameter, where the value of that item is lower than or equal to the value specified by this parameter. To use this parameter, the metacounter_key parameter should be specified.
* @param {Boolean} opts.includeSortedMetaarrayInLastMessage Determines whether to include the sorted_metaarray as one of the last_message’s properties in the response.
* @param {String} opts.customType (Deprecated) Returns channels whose custom_type matches the given value. If this field is not specified, all channels are returned, regardless of their custom type. The string passed here must be urlencoded.
* @param {Boolean} opts.readReceipt (Deprecated) Superseded by show_read_receipt.
* @param {Boolean} opts.member (Deprecated) Superseded by show_member.
* @param {Boolean} opts.isDistinct (Deprecated) Superseded by distinct_mode.
* @param {String} opts.membersIn (Deprecated) Superseded by members_exactly_in.
* @param {String} opts.userId (Deprecated) Restricts the search scope to only retrieve the target user's group channels. It's recommended to use the list group channels by user action instead.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GroupChatListChannelsResponse}
*/
}, {
Expand Down
7 changes: 4 additions & 3 deletions dist/api/MessageApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var _AddExtraDataToAMessageResponse = _interopRequireDefault(require("../model/A
var _GetTotalNumberOfMessagesInAChannelResponse = _interopRequireDefault(require("../model/GetTotalNumberOfMessagesInAChannelResponse"));
var _ListMessagesResponse = _interopRequireDefault(require("../model/ListMessagesResponse"));
var _MarkChannelMessagesAsReadRequest = _interopRequireDefault(require("../model/MarkChannelMessagesAsReadRequest"));
var _MigrateMessagesRequest = _interopRequireDefault(require("../model/MigrateMessagesRequest"));
var _SendAMessageRequest = _interopRequireDefault(require("../model/SendAMessageRequest"));
var _SendbirdMessageResponse = _interopRequireDefault(require("../model/SendbirdMessageResponse"));
var _UpdateAMessageRequest = _interopRequireDefault(require("../model/UpdateAMessageRequest"));
Expand Down Expand Up @@ -490,14 +491,14 @@ var MessageApi = exports["default"] = /*#__PURE__*/function () {
* @param {String} targetChannelUrl (Required)
* @param {Object} opts Optional parameters
* @param {String} opts.apiToken
* @param {Object.<String, Object>} opts.body
* @param {module:model/MigrateMessagesRequest} opts.migrateMessagesRequest
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
*/
}, {
key: "migrateMessagesWithHttpInfo",
value: function migrateMessagesWithHttpInfo(targetChannelUrl, opts) {
opts = opts || {};
var postBody = opts['body'];
var postBody = opts['migrateMessagesRequest'];
// verify the required parameter 'targetChannelUrl' is set
if (targetChannelUrl === undefined || targetChannelUrl === null) {
throw new Error("Missing the required parameter 'targetChannelUrl' when calling migrateMessages");
Expand All @@ -523,7 +524,7 @@ var MessageApi = exports["default"] = /*#__PURE__*/function () {
* @param {String} targetChannelUrl (Required)
* @param {Object} opts Optional parameters
* @param {String} opts.apiToken
* @param {Object.<String, Object>} opts.body
* @param {module:model/MigrateMessagesRequest} opts.migrateMessagesRequest
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
*/
}, {
Expand Down
5 changes: 2 additions & 3 deletions dist/api/MetadataApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,10 @@ var MetadataApi = exports["default"] = /*#__PURE__*/function () {
}
var pathParams = {
'channel_type': channelType,
'channel_url': channelUrl
};
var queryParams = {
'channel_url': channelUrl,
'key': opts['key']
};
var queryParams = {};
var headerParams = {
'api-token': opts['apiToken']
};
Expand Down
Loading