open-index/open-npm huggingface dataset:
npm package: @k-ivan/md-ripple
Description: Material ripple effect
Author: k-ivan
Latest version: 1.0.9

# Material-ripple
Material ripple effect

## Demo
[Codepen demo](https://codepen.io/k-ivan/pen/yXvyxq)

## Installation

```html
<link rel="stylesheet" href="dist/css/ripple.css">
```

```html
<button class="md-ripple">Example</button>
<button class="md-ripple" data-ripple-center>Center ripple</button>
<button class="md-ripple" data-ripple-color="rgba(255,255,255,.5)">Custom color</button>
```

If you are using a module bundler
```
npm i @k-ivan/md-ripple
```
```js
import Ripple from '@k-ivan/md-ripple';
Ripple.init('.md-ripple');
// if necessary later destroy
// Ripple.destroy();
```
or manually inject the minified script into your website

```html
<script src="dist/js/ripple.js"></script>
<script>
  Ripple.init('.md-ripple');
</script>
```
npm package: @k-ivan/tipster
Description: Easy and minimalistic tooltips plugin with no dependencies
Author: k-ivan
Latest version: 1.0.0

# Tipster
Easy and minimalistic tooltips plugin with no dependencies
```html
<!-- head -->
<link rel="stylesheet" href="tipster.css">
<!-- body -->
<a data-tooltip="Tooltip">link</a>

<script src="tipster.js"></script>
```
```js
var tips = new Tipster('[data-tooltip]');
```
npm package: @k-jun/mahjong
Description: 麻雀点数計算ライブラリ
Latest version: 0.4.12

# Mahjong

Mahjong は麻雀の得点計算ライブラリです。
和了時における翻数計算、符計算、及び得点計算を行います。シャンテン数の計算もサポートしています。
[天鳳](https://tenhou.net/4/) での牌譜 X 件での検証を実施しています。
このため、Mahjong は天鳳と同じ様に計算されることが保証されています。
なお、対応しているのは四麻赤アリアリルール(4人麻雀、赤ドラ有り、喰い断有り、後付け有り)のみです。

## Install

```bash
npx jsr add @k-jun/mahjong
# or
npm install @k-jun/mahjong
```

## Example

```ts
import { Pai, PaiSet, PaiSetType, Player, Tokuten } from "@k-jun/mahjong";

const tokuten = new Tokuten({
    options: {
        isOya: true,
        isTsumo: true,
    },
    paiBakaze: new Pai("z1"),
    paiJikaze: new Pai("z1"),
    paiDora: [new Pai("z2")],
    paiDoraUra: [new Pai("z2")],
    paiRest: [
        new Pai("m1"),
        new Pai("m1"),
        new Pai("m2"),
        new Pai("m2"),
        new Pai("m2"),
        new Pai("m3"),
        new Pai("m3"),
        new Pai("m3"),
        new Pai("z6"),
        new Pai("z6"),
    ],
    paiLast: new Pai("m1"),
    paiSets: [
        new PaiSet(
            {
                paiRest: [
                    new Pai("m4"),
                    new Pai("m4"),
                ],
                paiCall: [
                    new Pai("m4"),
                ],
                type: PaiSetType.MINKO,
                fromWho: Player.SHIMOCHA,
            },
        ),
    ],
});
console.log(tokuten.count());
```

```bash
{
  han: 6,
  fu: 50,
  pointSum: 18000,
  pointPrt: 0,
  pointCdn: 6000,
  yakus: [
    Yaku { str: "対々和", val: 2, yakuman: false },
    Yaku { str: "三暗刻", val: 2, yakuman: false },
    Yaku { str: "混一色", val: 2, yakuman: false },
    Yaku { str: "裏ドラ", val: 0, yakuman: false }
  ]
}
console.log(tokuten.count());
```

```bash
{
  han: 6,
  fu: 50,
  pointSum: 18000,
  pointPrt: 0,
  pointCdn: 6000,
  yakus: [
    Yaku { str: "対々和", val: 2, yakuman: false },
    Yaku { str: "三暗刻", val: 2, yakuman: false },
    Yaku { str: "混一色", val: 2, yakuman: false },
    Yaku { str: "裏ドラ", val: 0, yakuman: false }
  ]
}
```

## Test

```bash
deno test -A
```

## Release

```bash
deno publish --config jsr.json
# or
deno run -A scripts/build_npm.ts x.x.x
cd npm && npm publish
```
npm package: @k-kinzal/cconv
Description: cconv is your coding standards, made executable
Latest version: 0.1.2

# cconv

cconv is your coding standards, made executable.

[![npm version](https://badge.fury.io/js/cconv.svg)](https://badge.fury.io/js/cconv)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Prerequisites

- Node.js 18+
- Claude CLI

## Get started

```bash
npm install -g @k-kinzal/cconv
```

## Usage

```
cconv [options] [command]

Options:
  -V, --version                  output the version number
  -v, --verbose                  Enable verbose output
  --max-concurrency <number>     Maximum number of concurrent reviews (default: 5)
  --max-retries <number>         Maximum number of retries for failed requests (default: 3)
  -h, --help                     display help for command

Commands:
  add [path]                     Generate review rules from files or stdin
  list                           List all saved review rules
  show <id>                      Show details of a specific review rule
  fix <path>                     Review and fix issues in files
  help [command]                 display help for command
```

### Examples

```bash
# Add review rules from a documentation file
cconv add docs/coding-standards.md

# Review all TypeScript files in src directory
cconv src/**/*.ts

# Fix issues automatically
cconv fix src/**/*.ts

# Use custom concurrency limit for large projects
cconv --max-concurrency 10 src/**/*.ts

# Retry failed requests up to 5 times
cconv --max-retries 5 add docs/

# Review git diff (focus on changes only)
git diff | cconv
git diff HEAD~1 | cconv
git diff main...feature-branch | cconv

# Configure in .cconv.yaml
provider:
  type: claude
  command: /path/to/claude
  maxConcurrency: 10
  maxRetries: 5
  model: sonnet
  addDir: ["/additional/path"]
```
npm package: @k-kinzal/each
Description: To yield each command.
Author: k-kinzal
Latest version: 0.0.4

# each

To yield each command.

## Get started

```
npm install --save-dev @k-kinzal/each
```

## Command

```
$ $(npm bin)/each --help                        
Usage:
  @k-kinzal/each [OPTIONS] [ARGS]

Options: 
  -c, --cwd              You want to specify the path to the current working 
                         directory. 
  -y, --yield STRING     Specifies the command to yield
  -v, --version          Display the current version
  -h, --help             Display help and usage details
```

## Example

```
$ $(npm bin)/each  -y 'echo $0'
/path/to/each
```

```
$ $(npm bin)/each node_modules/* -y 'echo $1'
/path/to/each/node_modules/cli
/path/to/each/node_modules/glob
```

```
$ $(npm bin)/each node_modules/* -c -y 'pwd'    
/path/to/each/node_modules/cli
/path/to/each/node_modules/glob

```
npm package: @k-kinzal/store
Description: Simple store of npm project
Author: k-kinzal
Latest version: 1.1.2

# npm-store

Simple store of npm project.

## Get started

```
npm install -g @k-kinzal/store
```

## command

```
$ node lib/cli.js --help

  Usage: cli [options] [command]


  Commands:

    set <key> <value>  store to value
    get <key>          get value from store
    delete <key>       delete value from store
    help [cmd]         display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
```
npm package: @k-link/carousel
Description: Embla based carousel
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI carousel

[![npm](https://img.shields.io/npm/dm/@k-link/carousel)](https://www.npmjs.com/package/@k-link/carousel)

Embla based carousel

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/core @k-link/hooks @k-link/carousel

# With npm
npm install @k-link/core @k-link/hooks @k-link/carousel
```

## License

MIT
npm package: @k-link/core
Description: React components library focused on usability, accessibility and developer experience
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI core

[![npm](https://img.shields.io/npm/dm/@k-link/core)](https://www.npmjs.com/package/@k-link/core)

Klink UI core components library.

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/core @k-link/hooks

# With npm
npm install @k-link/core @k-link/hooks
```

## License

MIT
npm package: @k-link/dates
Description: Calendars, date and time pickers based on Klink UI components
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI dates

[![npm](https://img.shields.io/npm/dm/@k-link/dates)](https://www.npmjs.com/package/@k-link/dates)

Calendars, date and time pickers

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/core @k-link/hooks @k-link/dates dayjs

# With npm
npm install @k-link/core @k-link/hooks @k-link/dates dayjs
```

## License

MIT
npm package: @k-link/dropzone
Description: Dropzone component built with Klink UI theme and components
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI Dropzone

[![npm](https://img.shields.io/npm/dm/@k-link/dropzone)](https://www.npmjs.com/package/@k-link/dropzone)

Capture files from user

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/dropzone @k-link/core @k-link/hooks

# With npm
npm install @k-link/dropzone @k-link/core @k-link/hooks
```

## License

MIT
npm package: @k-link/ds
Description: Internal Klink UI components used on *.mantine.dev websites
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI DS

[![npm](https://img.shields.io/npm/dm/@k-link/ds)](https://www.npmjs.com/package/@k-link/ds)

Klink UI logo and other utility components.

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/core @k-link/hooks @k-link/prism @k-link/ds

# With npm
npm install @k-link/core @k-link/hooks @k-link/prism @k-link/ds
```

## License

MIT
npm package: @k-link/form
Description: Klink UI form management library
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI Form

[![npm](https://img.shields.io/npm/dm/@k-link/form)](https://www.npmjs.com/package/@k-link/form)

Form management library

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/form

# With npm
npm install @k-link/form
```

## License

MIT
npm package: @k-link/hooks
Description: [![npm](https://img.shields.io/npm/dm/@k-link/hooks)](https://www.npmjs.com/package/@k-link/hooks)
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI Hooks

[![npm](https://img.shields.io/npm/dm/@k-link/hooks)](https://www.npmjs.com/package/@k-link/hooks)

A set of react hooks for state and UI management

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/hooks

# With npm
npm install @k-link/hooks
```

## License

MIT
npm package: @k-link/modals
Description: Modals manager based on Klink UI components
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI modals manager

[![npm](https://img.shields.io/npm/dm/@k-link/modals)](https://www.npmjs.com/package/@k-link/modals)

Manage modals state

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/hooks @k-link/core @k-link/modals

# With npm
npm install @k-link/hooks @k-link/core @k-link/modals
```

## License

MIT
npm package: @k-link/next
Description: Klink UI integration for Next.js
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI integration for Next.js

[![npm](https://img.shields.io/npm/dm/@k-link/next)](https://www.npmjs.com/package/@k-link/next)

Utilities to setup Klink UI server side rendering with Next.js

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/hooks @k-link/core @k-link/next

# With npm
npm install @k-link/hooks @k-link/core @k-link/next
```

## License

MIT
npm package: @k-link/notifications
Description: Notification system based on Klink UI components
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI notifications system

[![npm](https://img.shields.io/npm/dm/@k-link/notifications)](https://www.npmjs.com/package/@k-link/notifications)

Notifications system

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/hooks @k-link/core @k-link/notifications

# With npm
npm install @k-link/hooks @k-link/core @k-link/notifications
```

## License

MIT
npm package: @k-link/nprogress
Description: Navigation progress bar
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI Navigation Progress

[![npm](https://img.shields.io/npm/dm/@k-link/nprogress)](https://www.npmjs.com/package/@k-link/nprogress)

A navigation progress bar

[Documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/nprogress @k-link/core @k-link/hooks

# With npm
npm install @k-link/nprogress @k-link/core @k-link/hooks
```

## License

MIT
npm package: @k-link/prism
Description: Code highlight with Klink UI theme
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI prism code highlight

[![npm](https://img.shields.io/npm/dm/@k-link/prism)](https://www.npmjs.com/package/@k-link/prism)

Code highlight built with prism and Klink UI

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/hooks @k-link/core @k-link/prism

# With npm
npm install @k-link/hooks @k-link/core @k-link/prism
```

## License

MIT
npm package: @k-link/remix
Description: Klink UI integration for Remix
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI integration for Remix

[![npm](https://img.shields.io/npm/dm/@k-link/remix)](https://www.npmjs.com/package/@k-link/remix)

Utilities to setup Klink UI server side rendering with Remix

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/hooks @k-link/core @k-link/remix

# With npm
npm install @k-link/hooks @k-link/core @k-link/remix
```

## License

MIT
npm package: @k-link/spotlight
Description: Command center for your application
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI Spotlight

[![npm](https://img.shields.io/npm/dm/@k-link/spotlight)](https://www.npmjs.com/package/@k-link/spotlight)

Overlay command center for your application

[Documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/spotlight @k-link/core @k-link/hooks

# With npm
npm install @k-link/spotlight @k-link/core @k-link/hooks
```

## License

MIT
npm package: @k-link/ssr
Description: Klink UI server side rendering utils
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI SSR

[![npm](https://img.shields.io/npm/dm/@k-link/ssr)](https://www.npmjs.com/package/@k-link/ssr)

General purpose utilities for Klink UI server side rendering

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/hooks @k-link/core @k-link/ssr

# With npm
npm install @k-link/hooks @k-link/core @k-link/ssr
```

## License

MIT
npm package: @k-link/styles
Description: Klink UI css-in-js styles engine, based on emotion
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI styles

[![npm](https://img.shields.io/npm/dm/@k-link/styles)](https://www.npmjs.com/package/@k-link/styles)

Klink UI CSS-in-JS library built on top of emotion

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/styles

# With npm
npm install @k-link/styles
```

## License

MIT
npm package: @k-link/tiptap
Description: Rich text editor based on tiptap
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI tiptap

[![npm](https://img.shields.io/npm/dm/@k-link/dates)](https://www.npmjs.com/package/@k-link/tiptap)

Rich text editor based on [tiptap](https://tiptap.dev/)

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/core @k-link/hooks @tiptap/react @tiptap/extension-link

# With npm
npm install @k-link/core @k-link/hooks @tiptap/react @tiptap/extension-link
```

## License

MIT
npm package: @k-link/utils
Description: [![npm](https://img.shields.io/npm/dm/@k-link/utils)](https://www.npmjs.com/package/@k-link/utils)
Author: Vitaly Rtishchev
Latest version: 0.1.0

# Klink UI Hooks

[![npm](https://img.shields.io/npm/dm/@k-link/utils)](https://www.npmjs.com/package/@k-link/utils)

A set of utils used in Klink UI packages

[View documentation](https://k-link.dev/)

## Installation

```bash
# With yarn
yarn add @k-link/utils

# With npm
npm install @k-link/utils
```

## License

MIT
npm package: @k-msg/analytics
Description: Analytics and reporting engine for message tracking and insights
Author: imjlk
Latest version: 0.29.4

# @k-msg/analytics

> Canonical docs: [k-msg.and.guide](https://k-msg.and.guide)

Analytics and reporting for `k-msg`, built on top of delivery-tracking records.

## Installation

```bash
npm install @k-msg/analytics k-msg @k-msg/messaging @k-msg/provider
# or
bun add @k-msg/analytics k-msg @k-msg/messaging @k-msg/provider
```

## Features

- **Query-based (recommended)**: compute KPIs by reading `DeliveryTrackingStore` records (SQLite / Bun.SQL / memory)
- **Breakdowns**: by status, provider, message type
- **(Experimental)** in-memory collectors/insights/reporting utilities (subject to change)

## Basic Usage (Query-Based)

```typescript
import { KMsg } from "k-msg";
import {
  DeliveryTrackingService,
  createDeliveryTrackingHooks,
} from "@k-msg/messaging/tracking";
import { SqliteDeliveryTrackingStore } from "@k-msg/messaging/adapters/bun";
import { DeliveryTrackingAnalyticsService } from "@k-msg/analytics";

const providers = [
  /* new SolapiProvider(...), new IWINVProvider(...), ... */
];

// 1) Tracking (writes to store)
const store = new SqliteDeliveryTrackingStore({ dbPath: "./kmsg.sqlite" });
const tracking = new DeliveryTrackingService({ providers, store });
await tracking.init();

const kmsg = new KMsg({
  providers,
  hooks: createDeliveryTrackingHooks(tracking),
});

await kmsg.send({ to: "01012345678", text: "hello" });

// 2) Analytics (reads from the same store)
const analytics = new DeliveryTrackingAnalyticsService({ store });
const summary = await analytics.getSummary(
  { requestedAt: { start: new Date(Date.now() - 24 * 60 * 60 * 1000), end: new Date() } },
  { includeByProviderId: true, includeByType: true },
);

console.log(summary);
```

## Using Bun.SQL (Postgres/MySQL/SQLite)

```typescript
import { BunSqlDeliveryTrackingStore } from "@k-msg/messaging/adapters/bun";
import { DeliveryTrackingAnalyticsService } from "@k-msg/analytics";

const store = new BunSqlDeliveryTrackingStore({
  options: {
    adapter: "postgres",
    url: process.env.DATABASE_URL!,
  },
});

const analytics = new DeliveryTrackingAnalyticsService({ store });
await analytics.init();
```

## Notes

- `@k-msg/analytics` does not create its own database. It reads from the `kmsg_delivery_tracking` table written by `DeliveryTrackingService`.
- Tracking SQL schema now disables the `raw` column by default (`storeRaw: false`); enable it in the tracking store only when needed.
- For production usage, prefer a durable store (`SqliteDeliveryTrackingStore` or `BunSqlDeliveryTrackingStore`).
- Runtime diagnostics in analytics modules use `@k-msg/core` logger (no direct `console.*` in runtime paths).

## License

MIT
npm package: @k-msg/channel
Description: AlimTalk channel and sender number management
Author: imjlk
Latest version: 0.29.4

# @k-msg/channel

> Canonical docs: [k-msg.and.guide](https://k-msg.and.guide)

Runtime-first Kakao channel orchestration for `k-msg`.

## Installation

```bash
npm install @k-msg/channel @k-msg/core
# or
bun add @k-msg/channel @k-msg/core
```

## Runtime API (`@k-msg/channel`)

Root exports are runtime-focused:

- `KakaoChannelCapabilityService`
- `KakaoChannelBindingResolver`
- `KakaoChannelLifecycleService`
- runtime types (`KakaoChannelCapabilityMode`, `KakaoChannelBinding`, `ResolvedKakaoChannelBinding`, `KakaoChannelListItem`, ...)

### Capability modes

- `api`: provider exposes channel onboarding APIs (`list/auth/add/categories`)
- `manual`: provider requires manual onboarding (no channel onboarding API calls)
- `none`: provider does not support channel onboarding APIs

### Example: resolve config binding

```ts
import { KakaoChannelBindingResolver } from "@k-msg/channel";

const resolver = new KakaoChannelBindingResolver(config);

const resolved = resolver.resolve({
  providerId: "solapi-main",
  channelAlias: "main",
  senderKey: undefined,
  plusId: undefined,
});

// precedence: explicit > alias > defaults > provider config
console.log(resolved.senderKey, resolved.plusId);
```

### Example: provider lifecycle calls

```ts
import { KakaoChannelLifecycleService } from "@k-msg/channel";

const service = new KakaoChannelLifecycleService(provider);

const channels = await service.list();
if (channels.isSuccess) {
  console.log(channels.value); // KakaoChannelListItem[] with source="api"
}
```

## Toolkit API (`@k-msg/channel/toolkit`)

In-memory channel/admin helpers are now toolkit-only exports. They are local-state utilities for tests, demos, and admin tooling. They assume the channel record is already approved by the provider and do not model provider approval/review lifecycles, sender verification, or OTP issuance:

- `KakaoChannelManager`
- `KakaoSenderNumberManager`
- `ChannelCRUD`
- `PermissionManager`
- `ChannelService`
- `BusinessVerifier`
- legacy channel types

```ts
import { KakaoChannelManager } from "@k-msg/channel/toolkit";
```

## License

MIT
npm package: @k-msg/core
Description: Core types and interfaces for K-Message platform
Author: imjlk
Latest version: 0.29.4

# @k-msg/core

> Canonical docs: [k-msg.and.guide](https://k-msg.and.guide)

Core types and utilities for the `k-msg` ecosystem.

This package intentionally stays low-level:

- Standard message model: `MessageType`, `SendInput`, `SendOptions`, `SendResult`
- Provider interfaces: `Provider`, optional capability `BalanceProvider`
- Result pattern: `Result`, `ok`, `fail`
- Errors: `KMsgError`, `KMsgErrorCode`
- Resilience helpers: retry / circuit-breaker / rate-limit / bulk operation

If you want the end-user "send" experience, use `KMsg` from `@k-msg/messaging` (or `k-msg`).

## Installation

```bash
npm install @k-msg/core
# or
bun add @k-msg/core
```

## Example: Implement a Provider

```ts
import {
  fail,
  KMsgError,
  KMsgErrorCode,
  ok,
  type MessageType,
  type Provider,
  type ProviderHealthStatus,
  type Result,
  type SendOptions,
  type SendResult,
} from "@k-msg/core";

export class MyProvider implements Provider {
  readonly id = "my-provider";
  readonly name = "My Provider";
  readonly supportedTypes: readonly MessageType[] = ["SMS"];

  async healthCheck(): Promise<ProviderHealthStatus> {
    return { healthy: true, issues: [] };
  }

  async send(options: SendOptions): Promise<Result<SendResult, KMsgError>> {
    const messageId = options.messageId || crypto.randomUUID();

    if (options.type !== "SMS") {
      return fail(
        new KMsgError(
          KMsgErrorCode.INVALID_REQUEST,
          `Unsupported type: ${options.type}`,
          { providerId: this.id, type: options.type },
        ),
      );
    }

    // ... send SMS here ...

    return ok({
      messageId,
      providerId: this.id,
      status: "SENT",
      type: options.type,
      to: options.to,
    });
  }
}
```
npm package: @k-msg/template
Description: AlimTalk template engine for parsing, building and managing templates
Author: imjlk
Latest version: 0.29.4

# @k-msg/template

> Canonical docs: [k-msg.and.guide](https://k-msg.and.guide)

Single source of truth for K-Message template runtime lifecycle, payload validation, and personalization.

## Installation

```bash
npm install @k-msg/template @k-msg/core
# or
bun add @k-msg/template @k-msg/core
```

## Runtime API (`@k-msg/template`)

Main exports focus on runtime-safe template workflows:

- `TemplateLifecycleService`
- `TemplatePersonalizer`, `defaultTemplatePersonalizer`, `TemplateVariableUtils`
- `interpolate`
- `validateTemplatePayload`, `parseTemplateButtons`
- low-level parsers (`ButtonParser`, `VariableParser`, `TemplateValidator`)

### Lifecycle Service

```typescript
import { TemplateLifecycleService } from "@k-msg/template";
import type { TemplateProvider } from "@k-msg/core";

const provider: TemplateProvider = /* your provider */;
const templates = new TemplateLifecycleService(provider);

await templates.create({
  name: "OTP Verification",
  content: "[MyApp] Code: #{code}",
});
```

### Runtime Validation

```typescript
import { parseTemplateButtons, validateTemplatePayload } from "@k-msg/template";

const buttons = parseTemplateButtons('[{"type":"WL","name":"Open","url_mobile":"https://example.com"}]');
if (buttons.isFailure) throw buttons.error;

const payload = validateTemplatePayload(
  {
    name: "Notice",
    content: "Hello #{name}",
    buttons: buttons.value,
  },
  { requireName: true, requireContent: true },
);

if (payload.isFailure) throw payload.error;
```

### Personalization

```typescript
import { TemplateVariableUtils } from "@k-msg/template";

const rendered = TemplateVariableUtils.replace("Hello #{name}", {
  name: "Jane",
});
// "Hello Jane"
```

## Toolkit API (`@k-msg/template/toolkit`)

Builder/registry/testing helpers are exposed separately:

- `TemplateBuilder`, `TemplateBuilders`
- `TemplateRegistry`
- `InMemoryTemplateStore`

```typescript
import { TemplateRegistry, TemplateBuilders } from "@k-msg/template/toolkit";

const registry = new TemplateRegistry();
const template = TemplateBuilders.authentication("OTP", "mock")
  .code("OTP_001")
  .content("Code: #{code}")
  .build();

await registry.register(template);
```

## License

MIT
npm package: @k-o/express-logger-middleware
Description: ## log example ``` {"message":{"ip":"::ffff:192.168.48.1","ips":[],"path":"/","method":"GET","protocol":"http","params":{},"query":{"test":"test","test1":"test"},"elapsed":2010,"requestId":"68f7d2a2-c9c9-42e3-bca9-3cba80b45807"},"containerId":"b7b60c1ff43
Author: otsuka-kentaro
Latest version: 1.1.5

# express-logger-middleware

## log example
```
{"message":{"ip":"::ffff:192.168.48.1","ips":[],"path":"/","method":"GET","protocol":"http","params":{},"query":{"test":"test","test1":"test"},"elapsed":2010,"requestId":"68f7d2a2-c9c9-42e3-bca9-3cba80b45807"},"containerId":"b7b60c1ff436","nodeVersion":"12.15.0","level":30,"sLevel":"INFO","@timestamp":"2020-05-27T11:12:48+09:00"}
```

## express application

First of all, add package to your project.
```bash
$ npm install @k-o/express-logger-middleware
$ yarn add @k-o/express-logger-middleware

# for update package
$ npm update @k-o/express-logger-middleware@1.1.5
$ yarn upgrade @k-o/express-logger-middleware@1.1.5
```

Register function to your express app.
```javascript
const app = express() // your app

// import middleware
const {
  ECSContextLogger,
  loggingRequest,
  requestContextHelper,
} = require('@k-o/express-logger-middleware')

// create logger
const logger = new ECSContextLogger({ timeZone: 'Asia/Tokyo' });

// register functions
app.use(requestContextHelper());
app.use(loggingRequest(logger));
```

### Use logger
```javascript
const logger = new ECSContextLogger({ timeZone: 'Asia/Tokyo' });

logger.info('message!', {
  param: 'additional parameter',
});
```

available methods: `debug` `info` `error` `warn`



## For developing
### Setup
```bash
$ cp .env.default .env
$ docker-compose build
```

### add package
```bash
$ docker run --rm -v $PWD:/app -w /app node:12.15.0-alpine npm install [package_name]
$ docker-compose run --rm express npm install [package_name]
$ docker-compose build
$ docker-compose rm -v
```

### deploy
```bash
$ npm publish
```
npm package: @k-phoen/backstage-plugin-announcements
Description: The Announcements plugin is a frontend, backend, and common plugin that manages and displays announcements within Backstage.
Latest version: 0.2.0

# Announcements plugin for Backstage

The Announcements plugin is a frontend, backend, and common plugin that manages and displays announcements within Backstage.

This plugin provides:

- a component to display the latest announcements, for example on a homepage
- a component to display the latest announcements, for example on a homepage
- pages to list, view, create, edit and delete announcements
- integration with the [`@backstage/plugin-search`](https://github.com/backstage/backstage/tree/master/plugins/search) plugin
- integration with the [`@backstage/plugin-permission-backend`](https://github.com/backstage/backstage/tree/master/plugins/permission-backend) plugin

## Setup

See [the project's README](../../README.md).
npm package: @k-phoen/backstage-plugin-announcements-backend
Description: The Announcements plugin is both a frontend and a backend plugin that manages and displays announcements within Backstage.
Latest version: 0.3.0

# Announcements plugin for Backstage

The Announcements plugin is both a frontend and a backend plugin that manages and displays announcements within Backstage.

This plugin provides:

- a component to display the latest announcement as a banner, if there is one
- a component to display the latest announcements, for example on a homepage
- pages to list, view, create, edit and delete announcements
- integration with the [`@backstage/plugin-search`](https://github.com/backstage/backstage/tree/master/plugins/search) plugin
- integration with the [`@backstage/plugin-permission-backend`](https://github.com/backstage/backstage/tree/master/plugins/permission-backend) plugin

## Setup

See [the project's README](../../README.md).
npm package: @k-phoen/backstage-plugin-announcements-common
Description: Common functionalities for the announcements plugin
Latest version: 0.1.0

# Announcements plugin for Backstage

The Announcements plugin is a frontend, backend, and common plugin that manages and displays announcements within Backstage.

This plugin provides:

- a component to display the latest announcements, for example on a homepage
- a component to display the latest announcements, for example on a homepage
- pages to list, view, create, edit and delete announcements
- integration with the [`@backstage/plugin-search`](https://github.com/backstage/backstage/tree/master/plugins/search) plugin
- integration with the [`@backstage/plugin-permission-backend`](https://github.com/backstage/backstage/tree/master/plugins/permission-backend) plugin

## Setup

See [the project's README](../../README.md).

## Permissions

This plugin provides the following permissions:

- `announcementCreatePermission`: creating new announcement
- `announcementDeletePermission`: deleting announcements
- `announcementUpdatePermission`: updating announcements

View [Backstage docs](https://backstage.io/docs/permissions/getting-started) to learn how to set up your instance of Backstage to use these permissions.
npm package: @k-phoen/backstage-plugin-confluence
Description: This plugin integrates Confluence documents to Backstage' search engine.
Latest version: 0.0.15

# Confluence search plugin [![](https://img.shields.io/npm/v/@k-phoen/backstage-plugin-confluence.svg)](https://www.npmjs.com/package/@k-phoen/backstage-plugin-confluence)

This plugin integrates Confluence documents to Backstage' search engine.

**Note:** it is used in combination with its [backend counter-part](../search-confluence-backend/).

## How does it look?

Search results:

![Search results](./docs/confluence_search_result.png)

## Installation

Add the plugin to your frontend app:

```bash
cd packages/app && yarn add @k-phoen/backstage-plugin-confluence
```

Nicely display Confluence search results:

```typescript
// packages/app/src/components/search/SearchPage.tsx

import { DocsIcon } from '@backstage/core-components';
import { ConfluenceResultListItem } from '@k-phoen/backstage-plugin-confluence';

// ...
<SearchType.Accordion
  name="Result Type"
  types={[
    // ...
    {
      value: 'confluence',
      name: 'Confluence',
      icon: <DocsIcon />,
    },
  ]}
/>

<SearchResult>
  // ...
  <ConfluenceResultListItem />
</SearchResult>
```

## License

This library is under the [MIT](../../LICENSE) license.
npm package: @k-phoen/backstage-plugin-confluence-backend
Description: This plugin integrates Confluence documents to Backstage' search engine.
Latest version: 0.0.14

# Confluence search plugin backend [![](https://img.shields.io/npm/v/@k-phoen/backstage-plugin-confluence-backend.svg)](https://www.npmjs.com/package/@k-phoen/backstage-plugin-confluence-backend)

This plugin integrates Confluence documents to Backstage' search engine.

It is used in combination with its [frontend counter-part](../search-confluence/).

## Installation

Add the plugin to your backend app:

```bash
cd packages/backend && yarn add @k-phoen/backstage-plugin-confluence-backend
```

Configure the plugin in `app-config.yaml`:

```yaml
# app-config.yaml
confluence:
  # Confluence base URL for wiki API
  # Typically: https://{org-name}.atlassian.net/wiki
  wikiUrl: https://org-name.atlassian.net/wiki

  # List of spaces to index
  # See https://confluence.atlassian.com/conf59/spaces-792498593.html
  spaces: [ENG]

  # Authentication credentials towards Confluence API
  auth:
    username: ${CONFLUENCE_USERNAME}
    # While Confluence supports BASIC authentication, using an API token is preferred.
    # See: https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/
    password: ${CONFLUENCE_PASSWORD}
```

Enable Confluence documents indexing in the search engine:

```typescript
// packages/backend/src/plugins/search.ts
import { ConfluenceCollatorFactory } from '@k-phoen/backstage-plugin-confluence-backend';

export default async function createPlugin({
  logger,
  permissions,
  discovery,
  config,
  tokenManager,
}: PluginEnvironment) {
  // Initialize a connection to a search engine.
  const searchEngine = await ElasticSearchSearchEngine.fromConfig({
    logger,
    config,
  });
  const indexBuilder = new IndexBuilder({ logger, searchEngine });

  // …

  // Confluence documents indexing
  indexBuilder.addCollator({
    defaultRefreshIntervalSeconds: 1800, // 30 min
    factory: ConfluenceCollatorFactory.fromConfig(config, { logger }),
  });

  // …

  // The scheduler controls when documents are gathered from collators and sent
  // to the search engine for indexing.
  const { scheduler } = await indexBuilder.build();

  // A 3 second delay gives the backend server a chance to initialize before
  // any collators are executed, which may attempt requests against the API.
  setTimeout(() => scheduler.start(), 3000);
  useHotCleanup(module, () => scheduler.stop());

  return await createRouter({
    engine: indexBuilder.getSearchEngine(),
    types: indexBuilder.getDocumentTypes(),
    permissions,
    config,
    logger,
  });
}

```

## License

This library is under the [MIT](../LICENSE) license.