open-index/open-npm huggingface dataset:
npm package: @kongkow/sdk
Description: Official SDK for building Kongkow Bots and Mini Apps
Author: Kongkow
Latest version: 1.0.0

# @kongkow/sdk

Official SDK for building **Bots** and **Mini Apps** on the [Kongkow](https://kongkow.xyz) platform.

## Installation

```bash
npm install @kongkow/sdk
```

---

## Bot SDK (Server-side)

Build bots that respond to messages, create posts, send invoices, and manage wallets.

### Quick Start

```typescript
import express from "express";
import { KongkowBot } from "@kongkow/sdk";

const bot = new KongkowBot(process.env.BOT_TOKEN!, {
    webhookSecret: process.env.WEBHOOK_SECRET,
});

// Handle /start command
bot.onCommand("start", async (update) => {
    await bot.sendMessage(update.message!.chat.id, "Hello! 👋");
});

// Handle all other messages
bot.onMessage(async (update) => {
    const text = update.message!.text;
    await bot.sendMessage(update.message!.chat.id, `You said: ${text}`);
});

// Express webhook server
const app = express();
app.use(express.json());

app.post("/webhook", async (req, res) => {
    const secret = req.headers["x-kongkow-bot-api-secret-token"] as string;
    await bot.handleUpdate(req.body, secret);
    res.json({ ok: true });
});

app.listen(3000, () => console.log("Bot running on port 3000"));
```

### Bot API Methods

| Method | Description |
|--------|-------------|
| `sendMessage(chatId, text, options?)` | Send a text message |
| `createPost(params)` | Create a feed post (supports PPV) |
| `sendInvoice(params)` | Send a payment request |
| `setWebhook(url, secretToken?)` | Set webhook URL |
| `getMe()` | Get bot info |
| `withdraw(amount?)` | Withdraw SOL to owner wallet |

### Event Handlers

```typescript
bot.onCommand("help", handler)     // Handle /help command
bot.onMessage(handler)             // Handle non-command messages
bot.onCallback(handler)            // Handle inline keyboard callbacks
```

---

## Mini App SDK (Client-side)

Build interactive UI components that run inside Kongkow chat.

### Usage

```html
<script src="https://unpkg.com/@kongkow/sdk/src/miniapp.js"></script>
```

Or import in a bundler:

```javascript
import "@kongkow/sdk/miniapp";
```

### API

| Method | Description |
|--------|-------------|
| `Kongkow.ready()` | Signal the app is loaded (auto-called on DOMContentLoaded) |
| `Kongkow.sendData(data)` | Send data back to the bot |
| `Kongkow.close()` | Close the Mini App modal |

### Example

```html
<button onclick="Kongkow.sendData({ action: 'purchase', id: '123' })">
    Buy Now
</button>
<button onclick="Kongkow.close()">Close</button>
```

---

## Links

- [Getting Started](https://github.com/kongkowapps/kongkow/blob/main/docs/getting-started.md)
- [API Reference](https://github.com/kongkowapps/kongkow/blob/main/docs/api-reference.md)
- [Webhooks](https://github.com/kongkowapps/kongkow/blob/main/docs/webhooks.md)
- [Examples](https://github.com/kongkowapps/kongkow-examples)

## License

MIT
npm package: @kongliu/hexo-theme-vivia
Description: A theme for Hexo
Author: saicaca
Latest version: 0.5.0

<br>
<div align="center">
<img alt="Vivia Logo" src="https://raw.githubusercontent.com/saicaca/resource/main/vivia-img/logo.png" width="280px">
<br>
<br>
<strong>
<a href="https://saicaca.github.io/vivia-preview/">💻在线预览</a>
|
<a href="https://github.com/saicaca/hexo-theme-vivia/blob/main/README.zh-CN.md">🌏English</a>
|
<a href="https://github.com/saicaca/fuwari">✨Astro 版本 (NEW)</a>
</strong>
<br>
<br>
一款 <a href="https://hexo.io/">Hexo</a> 博客主题，基于 <a href="https://github.com/hexojs/hexo-theme-landscape">Landscape</a> 修改（开发中）
<br>
<br>
<a href="https://www.npmjs.com/package/hexo-theme-vivia">
   <img src="https://img.shields.io/npm/v/hexo-theme-vivia"/>
</a>
<a href="https://github.com/saicaca/hexo-theme-vivia/blob/main/LICENSE">
   <img src="https://img.shields.io/github/license/saicaca/hexo-theme-vivia"/>
</a>
</div>

## 预览

**[💻在线预览](https://saicaca.github.io/vivia-preview/)**

![home](https://raw.githubusercontent.com/saicaca/resource/main/vivia-img/home.png)

![home_dark](https://raw.githubusercontent.com/saicaca/resource/main/vivia-img/home-dark.png)

# 安装说明

> [!NOTE]
> 下列指令均在 Hexo 博客根目录下执行

### 1. 安装主题

通过 npm 安装（推荐）

```bash
npm install hexo-theme-vivia
```

通过 Git 安装

```bash
# 将主题下载至 /themes/vivia 目录
git clone https://github.com/saicaca/hexo-theme-vivia.git themes/vivia
  
# 安装主题的依赖
npm install colorjs.io stylus hexo-symbols-count-time
```

### 2. 创建主题配置文件

将主题的示例配置文件复制至 Hexo 根目录:

- 若通过 npm 安装，文件位于 `node_modules/hexo-theme-vivia/example_zh_CN_config.vivia.yml`
- 若通过 Git 安装，文件位于 `themes/vivia/example_zh_CN_config.vivia.yml`

复制后，将文件重命名为 `_config.vivia.yml`。

### 3. 自定义主题

修改 `_config.vivia.yml` 填写自定义配置。

### 4. 将 `vivia` 设置为主题

```bash
hexo config theme vivia
```

### 5. 创建 `about` 页面

```bash
hexo new page about
```

### 6. 禁用归档页面的分页

修改 `_config.yml` 填写下列配置：

```yaml
archive_generator:
  per_page: 0
```

若不添加此配置归档页最多只能显示 10 篇文章。

# To-do

- [x] 亮 / 暗模式
- [x] 自定义主题色
- [x] 自定义头图
- [x] 响应式设计
- [x] 评论
  - [x] Valine
  - [x] Twikoo
  - [ ] 其他
- [ ] 搜索
- [ ] 文内目录插件

# 致谢

<a href="https://jb.gg/OpenSourceSupport">
   <img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" alt="JetBrains Logo (Main) logo." width="200px" height="200px">
</a>

- [Hexo](https://hexo.io/zh-cn/index.html)
- [Landscape](https://github.com/hexojs/hexo-theme-landscape)
- [Color.js](https://colorjs.io/)
- [Font Awesome](https://github.com/FortAwesome/Font-Awesome)
- [Material Icons / Material Symbols](https://github.com/google/material-design-icons)
npm package: @konglx/data-validate
Description: easy data validate
Author: konglx
Latest version: 1.0.9

### Data validate

### Validate rules

A brief data validation library.

#### Import

```js
// ES6
import validate from '@konglx/data-validate';
// ES5
const validate = require('@konglx/data-validate');
```

#### String rules

The type check is based on `Object.prototype.toString.call(o).slice(8, -1).toLocaleLowerCase()`

```js
//  Basic data types
validate('string', 'i am a string') // => true
validate('number', 1) // => true
validate('null', null) // => true
validate('undefined', undefined) // => true

// Object Array
validate('object', {}) // => true
validate('array', []) // => true

// instanceOf
function Dog() {}
const dog = new Dog();
validate(Dog, dog); // => true

// optional
validate('?:string', undefined) // => true
validate('?:string', 'ok') // => true

```

#### Compose validate rules

```js
// object
validate({ a: 'string', b: 'number'}, {
  a: 'i am a string',
  b: 1,
}) // => true

// array
validate(['string'], ['a', 'b']) // => true
validate(['string'], ['a', 1]) // => false

// if you want two type in a Array
validate(['string|number'], ['a', 1])

// deep
validate([{
    name: 'string',
    girlFrends: [
        {
            name: 'string',
            friends: [
                {
                    name: 'string',
                    classmates: [
                        {
                            name: 'string',
                            hobbies: []
                        }
                    ]
                }
            ]
        }
    ]
}], [{
  name: 'xiaoming',
  girlFrends: [{
    name: 'zhang',
    friends: [{
      name: 'mao',
      classmates: [
        {
          name: 'li',
          hobbies: [],
        }
      ]
    }]
  }],
}]) // => true

```

#### Error

```js
// If you want get the error path
validate({ ok: 'number' }, { ok: '9999' }, falseThrowError = true); // This will throw a Error with error path
```

[More examples](./test/base.test.js)

#### Other Tips

1. Empty Array

```js
// can pass validate
validate(
    {
        friends: [{
            name: 'string'
        }],
    },
    {
        names: [],
    }
) // => true

// can't pass validate
validate(
    {
        friends: [{
            name: 'string',
        }],
    },
    {
        names: [{

        }],
    }
) // => true
```

### publish

`npm publish --access=public`

### Dev

Test Cover [Istanbul](https://github.com/gotwarlost/istanbul#features)
```sh
npm run cover
```