open-index/open-npm huggingface dataset:
npm package: @sam-1994/ngx-drag-and-drop-grid
Description: A simple component for using the @angular/cdk drag and drop sort functions with a mixed orientation grid list
Author: Samuel Schober
Latest version: 1.0.0

# @sam-1994/ngx-drag-and-drop-grid [![Build Status](https://travis-ci.com/sam-1994/ngx-drag-and-drop-grid.svg?branch=master)](https://travis-ci.com/sam-1994/ngx-drag-and-drop-grid)

A simple component for using the @angular/cdk drag and drop sort functions with a mixed orientation grid list

Currently the package is only tested in combination with Angular 8.x

## Table of Contents
* [Demo](#demo)
* [Installation](#installation)
* [Usage](#usage)
* [API](#api)


## Demo
https://sam-1994.github.io/ngx-drag-and-drop-grid/

## Installation

First you need to install the npm module:

```sh
npm install @sam-1994/ngx-drag-and-drop-grid --save
```

## Usage

#### 1. Import the `SamDragAndDropGridModule`:

Finally, you can use ngx-translate in your Angular project. You have to import `SamDragAndDropGridModule` in the NgModule.

```ts
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {SamDragAndDropGridModule} from '@sam-1994/ngx-drag-and-drop-grid';

@NgModule({
    imports: [
        BrowserModule,
        SamDragAndDropGridModule
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }
```

#### 2. Use the component:

```ts
import {Component, OnInit} from '@angular/core';
import {SamDragAndDropGridComponent} from 'drag-and-drop-grid-module';

@Component({
  selector: 'app-drag-and-drop-grid-example',
  templateUrl: './drag-and-drop-grid.component.html',
  styleUrls: ['./drag-and-drop-grid.component.sass']
})
export class SamDragAndDropGridExampleComponent implements OnInit {

  public list = [1, 2, 3, 4, 5, 6, 7, 8, 9];

  ngOnInit() {
  }
}
```

```html
<sam-drag-and-drop-grid [items]="list" [columnNumber]="5">
  <div *samDragAndDropListData="let listItem; let i=index">
    Item {{listItem}}; Index {{i}}
  </div>
</sam-drag-and-drop-grid>
```

## API

You can use the `samDragAndDropListData` directive to inject your custom template as grid items.
npm package: @sam-ael/medusa-plugin-mailer
Description: Send UI-managed email notifications on Medusa store events via SMTP.
Author: SAM-AEL
Latest version: 0.1.3

<p align="center">
  <img src="https://img.shields.io/npm/v/@sam-ael/medusa-plugin-mailer?style=flat-square&color=2563EB" alt="npm version" />
  <img src="https://img.shields.io/badge/medusa-v2-0F172A?style=flat-square" alt="Medusa v2" />
  <img src="https://img.shields.io/badge/category-notification-0F766E?style=flat-square" alt="notification plugin" />
  <img src="https://img.shields.io/npm/l/@sam-ael/medusa-plugin-mailer?style=flat-square" alt="license" />
</p>

# @sam-ael/medusa-plugin-mailer

Production-focused email notification plugin for Medusa v2 with event mapping, template rendering, and admin-managed delivery flows.

## Highlights

- Admin-managed event -> template mappings
- Template variable mapping with safe path resolution
- SMTP-based delivery with sender profile support
- Workflow-driven event delivery for worker deployments
- Hardened API responses and stricter payload validation
- `POST /admin/mailer/mappings/:id` as the primary update endpoint
- Temporary deprecated `PUT` compatibility with deprecation headers

## Install

```bash
yarn add @sam-ael/medusa-plugin-mailer nodemailer
```

## Medusa Configuration

```ts
plugins: [
  {
    resolve: "@sam-ael/medusa-plugin-mailer",
    options: {},
  },
]
```

## Environment Variables

```env
MAILER_SMTP_HOST=smtp.gmail.com
MAILER_SMTP_PORT=587
MAILER_SMTP_USER=your-email@example.com
MAILER_SMTP_PASS=your-app-password
MAILER_SMTP_SECURE=false

MAILER_FROM_NAME_1=My Store
MAILER_FROM_ADDRESS_1=no-reply@mystore.com

MAILER_TEMPLATES_DIR=src/email_templates
MAILER_SEND_CONCURRENCY=2
```

## Admin API

| Method | Endpoint | Description |
|---|---|---|
| `GET` | `/admin/mailer/config` | SMTP and sender profile hints |
| `GET` | `/admin/mailer/templates` | List templates and extracted variables |
| `GET` | `/admin/mailer/mappings` | List mappings (paginated) |
| `POST` | `/admin/mailer/mappings` | Create mapping |
| `POST` | `/admin/mailer/mappings/:id` | Update mapping (primary) |
| `PUT` | `/admin/mailer/mappings/:id` | Deprecated compatibility endpoint |
| `DELETE` | `/admin/mailer/mappings/:id` | Delete mapping |
| `POST` | `/admin/mailer/send` | Manual/test email send |

## Security and Reliability Notes

- Unified error contract: `{ success: false, code, message, details? }`
- Recipient and payload validation at route level
- Mapping updates use direct update flow (no delete/recreate pattern)
- Event-send workflow uses bounded concurrency and per-item failure isolation
- Indexes added for high-frequency lookup fields

## Quality Gates

```bash
yarn typecheck
yarn lint
yarn test
yarn build
```

Smoke tests are available under `src/tests`.

## License

MIT
npm package: @sam-ael/medusa-plugin-payu
Description: PayU India payment gateway integration for Medusa v2 with redirect flow.
Author: SAM-AEL
Latest version: 0.1.3

<p align="center">
  <img src="https://img.shields.io/npm/v/@sam-ael/medusa-plugin-payu?style=flat-square&color=7C3AED" alt="npm version" />
  <img src="https://img.shields.io/badge/medusa-v2-0F172A?style=flat-square" alt="Medusa v2" />
  <img src="https://img.shields.io/badge/category-payment-5B21B6?style=flat-square" alt="payment plugin" />
  <img src="https://img.shields.io/npm/l/@sam-ael/medusa-plugin-payu?style=flat-square" alt="license" />
</p>

# @sam-ael/medusa-plugin-payu

Production-focused PayU India payment provider for Medusa v2 with redirect checkout flow, callback handling, and fraud-aware verification.

## Highlights

- Redirect-based PayU checkout integration for Medusa payment sessions
- Hash generation and reverse-hash verification flow
- Webhook/callback handling for asynchronous payment status
- Hardened callback processing with replay protection
- Constant-time hash comparison and amount discrepancy guards
- Timeout configuration and retry-classification utilities

## Install

```bash
yarn add @sam-ael/medusa-plugin-payu
```

## Medusa Configuration

```ts
modules: [
  {
    resolve: "@medusajs/medusa/payment",
    options: {
      providers: [
        {
          resolve: "@sam-ael/medusa-plugin-payu/providers/payu",
          id: "payu",
          options: {
            merchantKey: process.env.PAYU_MERCHANT_KEY,
            merchantSalt: process.env.PAYU_MERCHANT_SALT,
            environment: process.env.PAYU_ENVIRONMENT || "test",
          },
        },
      ],
    },
  },
]
```

## Environment Variables

```env
PAYU_MERCHANT_KEY=your_merchant_key
PAYU_MERCHANT_SALT=your_merchant_salt
PAYU_ENVIRONMENT=test

STOREFRONT_URL=http://localhost:8000
PAYU_REDIRECT_URL=/order/confirmed
PAYU_REDIRECT_FAILURE_URL=/checkout
PAYU_API_TIMEOUT_MS=30000
```

## Callback Endpoint

| Method | Endpoint | Description |
|---|---|---|
| `POST` | `/hooks/payment/payu_payu` | PayU callback/webhook handling via Medusa payment provider |

## Security and Reliability Notes

- Replay guard for repeated callback payloads
- Constant-time hash comparison for webhook verification
- Normalized callback parsing for structured and URL-encoded payload variants
- Amount discrepancy path for underpaid callback reports
- Timeout defaults centralized in provider config helpers

## Quality Gates

```bash
yarn typecheck
yarn lint
yarn test
yarn build
```

Smoke tests are available under `src/tests`.

## License

MIT
npm package: @sam-ael/medusa-plugin-shiprocket
Description: Shiprocket India fulfillment and live rates provider for Medusa v2.
Author: SAM-AEL
Latest version: 0.1.2

<p align="center">
  <img src="https://img.shields.io/npm/v/@sam-ael/medusa-plugin-shiprocket?style=flat-square&color=EA580C" alt="npm version" />
  <img src="https://img.shields.io/badge/medusa-v2-0F172A?style=flat-square" alt="Medusa v2" />
  <img src="https://img.shields.io/badge/category-shipping-7C2D12?style=flat-square" alt="shipping plugin" />
  <img src="https://img.shields.io/npm/l/@sam-ael/medusa-plugin-shiprocket?style=flat-square" alt="license" />
</p>

# @sam-ael/medusa-plugin-shiprocket

Production-focused Shiprocket integration for Medusa v2 with fulfillment automation, delivery estimate APIs, and tracking synchronization.

## Highlights

- Shiprocket fulfillment provider integration
- Delivery estimate endpoint for storefront experiences
- Tracking sync endpoints for admin and storefront views
- Webhook ingestion for status updates
- Hardened API responses and stricter payload validation
- Webhook idempotency guard and explicit public webhook handling
- Tracking ownership hardening and AWB validation

## Install

```bash
yarn add @sam-ael/medusa-plugin-shiprocket
```

## Medusa Configuration

```ts
modules: [
  {
    resolve: "@medusajs/medusa/fulfillment",
    options: {
      providers: [
        {
          resolve: "@sam-ael/medusa-plugin-shiprocket",
          id: "shiprocket",
          options: {
            email: process.env.SHIPROCKET_EMAIL,
            password: process.env.SHIPROCKET_PASSWORD,
            pickup_location: process.env.SHIPROCKET_PICKUP_LOCATION,
          },
        },
      ],
    },
  },
],
plugins: [
  {
    resolve: "@sam-ael/medusa-plugin-shiprocket",
    options: {},
  },
]
```

## Environment Variables

```env
SHIPROCKET_EMAIL=your_email@example.com
SHIPROCKET_PASSWORD=your_password
SHIPROCKET_PICKUP_LOCATION=Primary
SHIPROCKET_WEBHOOK_TOKEN=your_webhook_token
SHIPROCKET_DELIVERY_PREFERENCE=FAST

SHIPROCKET_API_TIMEOUT_MS=15000
SHIPROCKET_WEBHOOK_PAYLOAD_RETENTION_DAYS=30
```

## API

| Method | Endpoint | Description |
|---|---|---|
| `GET` | `/store/shiprocket/delivery-estimate` | Delivery estimate lookup |
| `GET` | `/store/shiprocket/tracking/:awb` | Store tracking lookup |
| `POST` | `/hooks/fulfillment/shiprocket` | Shiprocket webhook receiver |
| `GET` | `/admin/shiprocket/tracking/:awb` | Admin tracking details |
| `POST` | `/admin/shiprocket/tracking/:awb/sync` | Force tracking/document sync |

## Security and Reliability Notes

- Unified error contract: `{ success: false, code, message, details? }`
- AWB and query validation added for tracking and estimate APIs
- Webhook token validation with constant-time compare
- Webhook replay/idempotency keying on AWB + status/timestamp
- Public route boundaries are explicit
- Retention cleanup job for webhook raw payload minimization
- Indexes added for high-frequency lookup fields

## Quality Gates

```bash
yarn typecheck
yarn lint
yarn test
yarn build
```

Smoke tests are available under `src/tests`.

## License

MIT
npm package: @sam-ael/medusa-plugin-whatsapp
Description: Send WhatsApp Business template messages on Medusa store events.
Author: SAM-AEL
Latest version: 0.2.4

<p align="center">
  <img src="https://img.shields.io/npm/v/@sam-ael/medusa-plugin-whatsapp?style=flat-square&color=16A34A" alt="npm version" />
  <img src="https://img.shields.io/badge/medusa-v2-0F172A?style=flat-square" alt="Medusa v2" />
  <img src="https://img.shields.io/badge/category-notification-0F766E?style=flat-square" alt="notification plugin" />
  <img src="https://img.shields.io/npm/l/@sam-ael/medusa-plugin-whatsapp?style=flat-square" alt="license" />
</p>

# @sam-ael/medusa-plugin-whatsapp

Production-focused WhatsApp notification plugin for Medusa v2 with event mapping, template dispatch, and admin-managed operational controls.

## Highlights

- Event -> template mapping from Medusa Admin
- WhatsApp Cloud API template sending
- Delivery logs with redacted sensitive fields
- Workflow-driven delivery for worker deployments
- Hardened API responses and stricter payload validation
- `POST /admin/whatsapp/mappings/:id` as the primary update endpoint
- Temporary deprecated `PUT` compatibility with deprecation headers
- Secret model hardening: access token is env-only

## Install

```bash
yarn add @sam-ael/medusa-plugin-whatsapp
```

## Medusa Configuration

```ts
plugins: [
  {
    resolve: "@sam-ael/medusa-plugin-whatsapp",
    options: {},
  },
]
```

## Environment Variables

```env
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_ACCESS_TOKEN=your_access_token
WHATSAPP_API_VERSION=v25.0
WHATSAPP_BUSINESS_ACCOUNT_ID=your_waba_id

WHATSAPP_SEND_CONCURRENCY=2
WHATSAPP_API_TIMEOUT_MS=15000
WHATSAPP_LOG_RETENTION_DAYS=30
```

## Admin API

| Method | Endpoint | Description |
|---|---|---|
| `GET` | `/admin/whatsapp/config` | Read non-secret config |
| `POST` | `/admin/whatsapp/config` | Create/update non-secret config |
| `GET` | `/admin/whatsapp/templates` | Fetch approved WhatsApp templates |
| `GET` | `/admin/whatsapp/mappings` | List mappings (paginated) |
| `POST` | `/admin/whatsapp/mappings` | Create mapping |
| `POST` | `/admin/whatsapp/mappings/:id` | Update mapping (primary) |
| `PUT` | `/admin/whatsapp/mappings/:id` | Deprecated compatibility endpoint |
| `DELETE` | `/admin/whatsapp/mappings/:id` | Delete mapping |
| `GET` | `/admin/whatsapp/logs` | List message logs (redacted payloads) |
| `POST` | `/admin/whatsapp/manual` | Manual/test message send |

## Security and Reliability Notes

- Unified error contract: `{ success: false, code, message, details? }`
- `WHATSAPP_ACCESS_TOKEN` is not accepted in API payloads and is not persisted in DB
- Redaction policy applied to sensitive request/response payload fields
- Event-send workflow uses bounded concurrency and per-item failure isolation
- Timeout controls and retention cleanup job included
- Indexes added for high-frequency lookup fields

## Quality Gates

```bash
yarn typecheck
yarn lint
yarn test
yarn build
```

Smoke tests are available under `src/tests`.

## License

MIT
npm package: @sam-nya/wecom-sidebar-jssdk
Description: 更高抽象的企业微信 JS-SDK 封装
Author: Haixiang Yan
Latest version: 0.0.22-SNAPSHOT

# wecom-sidebar-jssdk

更高抽象的企业微信 JS-SDK 封装。

## 为什么

原始的侧边栏 JS-SDK 无论在调用体验、开发体验、TS 支持等都非常不好，所以希望再做一层抽象与封装来提升开发体验。

提供以下功能：

![](https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/666903d9236a4e93899a11ab9b3111d1~tplv-k3u1fbpfcp-watermark.image?)

## 安装

```shell
npm i wecom-sidebar-jssdk
```

## 简单上手

[文档在此](https://wecom-sidebar.github.io/)

注意：此库只封装了 `wx` 的调用方法，JS-SDk 还是需要大家自己在 `index.html` 中引入：

```html
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
```

上手代码需要用到后端调用 [企业微信服务端 API](https://work.weixin.qq.com/api/doc/90001/90143/91201) 的能力，
如果你还没有做好的后端，可以直接使用 [我做好的 Express Demo](https://github.com/wecom-sidebar/wecom-sidebar-express-tpl) 来提供接口。

```ts
import Cookies from 'js-cookie'
import {checkRedirect, initSdk, invoke, asyncCall, call, SignRes} from 'wecom-sidebar-jssdk';

// 侧边栏配置
const config = {
  // 在 https://work.weixin.qq.com/wework_admin/frame#profile 这里可以找到
  corpId: 'xxx',
  // 在 https://work.weixin.qq.com/wework_admin/frame#apps 里的自建应用里可以找到
  agentId: 'yyy'
}

// 获取签名接口（需要后端生成）
export const fetchSignatures = async (): Promise<SignRes> => {
  const response = await axios.request<SignRes>({
    method: 'GET',
    url: '/api/qywx-utils/signatures',
    params: {
      url: window.location.href
    }
  })

  return response.data;
}

// code 换取用户身份（需要后端调用企微服务端 API）
const fetchUserId = async (code: string): Promise<string> => {
  const response = await axios.request({
    method: 'GET',
    url: '/api/qywx-proxy/user/getuserinfo',
    params: {code}
  });
  return response.data.userId;
}

const testApi = async () => {
  try {
    // 获取外部联系人 external_user_id
    const res1 = await invoke('getCurExternalContact');
    console.log(res1.userId);

    // 拍照或从手机相册中选图接口
    const res2 = await asyncCall('chooseImage');
    console.log(res2.localIds);

    // 设置监听
    call('onNetworkStatusChange', (res) => {
      console.log(res.isConnected)
      console.log(res.networkType)
    })
  } catch (e) {
    console.log(e.message);
  }

  // 支持原始调用方式
  wx.invoke('getCurExternalContact', {}, function (res) {
    if (res.err_msg == "getCurExternalContact:ok") {
      userId = res.userId; //返回当前外部联系人userId
    } else {
      //错误处理
    }
  });
}

const render = () => {
  // 渲染 App
}

checkRedirect(config, fetchUserId)
  .then(() => initSdk(config, fetchSignatures))
  .then(() => testApi())
  .then(() => console.log(Cookies.get('userId')))
  .catch(() => console.error('JS-SDK 初始化失败'))
  .finally(() => render());
```

## 应用示例

这在 `./example` 这个文件夹里，还有一个 example 供大家使用，里面列举了大部分的 API 调用，方便大家尝试这些 API。

![](https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9f3dc28b48fd4a04870b9210d9d5278e~tplv-k3u1fbpfcp-watermark.image?)

```shell
cd example

npm i wecom-sidebar-jssdk

npm run start
```

具体怎么在浏览器以及侧边栏上调试，可以看 README.md