open-index/open-npm huggingface dataset:
npm package: @sacms/sdk
Description: TypeScript SDK for SaCMS headless CMS
Latest version: 1.0.0

# @sacms/sdk

TypeScript SDK for the SaCMS headless CMS.

## Installation

```bash
npm install @sacms/sdk
```

## Usage

```typescript
import { SaCMS } from "@sacms/sdk";

const cf = new SaCMS({
  baseUrl: "https://your-domain.com",
  tenant: "my-workspace",
  token: "cf_xxxxx",
  locale: "en", // optional default locale
});

// Query a collection
const articles = await cf.collection("articles").findMany({
  filters: { category: { $eq: "tutorial" } },
  fields: ["title", "slug", "author"],
  populate: ["author", "tags"],
  sort: "createdAt:desc",
  pagination: { page: 1, pageSize: 25 },
});

// Get single entry
const article = await cf.collection("articles").findOne("entry-id");

// Create entry (requires full-access token)
const created = await cf.collection("articles").create({
  data: { title: "New Article", body: "..." },
  locale: "en",
});

// Update entry
await cf.collection("articles").update("entry-id", {
  data: { title: "Updated Title" },
});

// Delete entry
await cf.collection("articles").delete("entry-id");

// Single types
const homepage = await cf.single("homepage").find({ locale: "id" });

// GraphQL
const result = await cf.graphql(`
  query {
    articles(locale: "en") {
      data { id title }
      meta { pagination { total } }
    }
  }
`);
```

## Error Handling

```typescript
import { SaCMSError } from "@sacms/sdk";

try {
  await cf.collection("articles").findMany();
} catch (err) {
  if (err instanceof SaCMSError) {
    console.error(`HTTP ${err.status}: ${err.message}`);
  }
}
```
npm package: @saco/axios
Description: ```javascript npm install @saco/axios ```
Author: seawavew
Latest version: 0.21.5

# 依赖安装
```javascript
npm install @saco/axios
```

# 初始化
```javascript
import sacoAxios from '@saco/axios'
const request = new sacoAxios({ 
    /** 网络与拦截配置 */

    successStatus: 200, // 数字类型 或 数字数组，若设置了则会判断http响应的status字段

    successCodeKey: 'code', // 响应对象的标志字段，需要与successCode搭配使用
    successCode: 200, // 数字类型 或 数字数组，若设置了则会判断http响应体的[successCodeKey]字段

    interceptorsRequest: (config) => {}, // 请求拦截
    interceptorsRequestError: (error) => {}, // 请求失败拦截
    interceptorsResponse: (config) => {}, // 响应拦截
    interceptorsResponseError: (error) => {}, // 响应失败拦截

    /** axios配置项 */
    // baseURL、timeout、dataType ......
})
```

# 请求方法
`GET/POST/PUT/DELETE` <br />
若需更改参数所放位置，可防在config配置项里（即也可不使用第二个参数，直接使用config配置项）
```javascript
request.get(url, params, config)
request.post(url, data, config)
request.put(url, data, config)
request.delete(url, params, config)
```

# 配置项说明
`文件上传`
```javascript
const config = {
    // 需要注意的是，当该项为true时，参数自动转为formData格式
    upload: true,
    // 上传进度监听：仅当upload为true时生效
    uploadProgress: (e) => {}
}
```
`文件下载`
```javascript
const config = {
    // 需要注意的是，当该项为true时responseType会自动设置为 blob，若想修改，请使用 interceptorsRequest 中间回调函数
    download: true,
    // 下载进度监听：仅当download为true时生效
    downloadProgress: (e) => {},
    // 设置文件名：仅当download为true时生效(参数为响应头的 content-disposition 字段)
    setDownloadFileName: (cd) => { return '文件名' }
}
```
`取消请求`
```javascript
const config = {
    // c 为取消函数
    cancel: (c) => {
        
    }
}
```
npm package: @saco/electron
Description: ```javascript npm install @saco/electron ```
Author: seawavew
Latest version: 3.6.5121

# 依赖安装

```javascript
npm install @saco/electron
```

# 初始化

`主进程`

```javascript
import SacoElectron from '@saco/electron'
new SacoElectron({
  curId: '', // 主窗口ID，若无则使用内部自带
  url: 'http://127.0.0.1:7777', // 入口地址，也可以是静态html地址
  path: '/login', // 网页路径(如为hash模式，则会拼接#) => http://127.0.0.1:7777/login
  query: {}, // 即网页跟后的search参数
  // 窗口相关：可选
  BrowserWindow: {
    // 事件回调：可选
    events: {
      // 支持 on off once addListener removeListener
      on: {
        // 示例：每个回调第一个参数都为窗口对象，后续参数与原生相同
        close: win => {},
      },
    },
  },
  // .... 原生配置
})
```

`渲染进程`

```javascript
import '@saco/electron/preload'
```

`网页进程`

```javascript
import '@saco/electron/web'
```

# 配置

`tsconfig.json`

```javascript
{
  "compilerOptions": {
    "types": [
      // ...
      "@saco/electron/types"
    ]
  }
}
```
npm package: @sacochee/google-doc-types
Description: Types TypeScript pour l'API Google Docs
Author: Duprat Sacha
Latest version: 1.0.1

# 🧾 TypeScript Types pour Google Docs JSON

Ce projet fournit une définition **TypeScript** presque complète du **schéma JSON** renvoyé par l’API Google Docs. Il est basé entièrement sur la [documentation officielle de Google Docs](https://developers.google.com/docs/api/reference/rest/v1/documents).

## 🧪 Installation

Pour installer la bibliothèque, exécute la commande suivante dans ton terminal :

```bash
npm install @saccoche/google-doc-types
```

## 🧪 Utilisation

Simplement des types.

```ts
import { Document, ParagraphElement, TextRun } from "@saccoche/google-doc-types";
```

## 📦 Contenu

- Représentation typée du document Google Docs en TypeScript
- Structure hiérarchique : `Document`, `Body`, `Paragraph`, `Element`, `TextRun`, etc.
- Typage partiellement complet (voir section [Limitations](#%EF%B8%8F-limitations))

## 🚧 État du projet

Ce projet est **partiellement terminé** :

- La majorité des types sont définis
- Les types liés aux suggestions ne sont pas encore définis
- Certains champs ne sont pas explicitement marqués comme `undefined` ou non, car la documentation de Google est parfois ambiguë à ce sujet
- Plusieurs commentaires `// TODO` marquent les zones à compléter
- Tous les types ne sont pas encore exportés depuis `type.d.ts`

> Ce projet est un **work in progress**. Toute contribution est la bienvenue !

## 🎯 Objectif

Fournir une base solide de typage pour la structure JSON retournée par l’API Google Docs, afin de faciliter son utilisation dans des projets TypeScript.

## 🤝 Contribuer

Tu veux participer ? Voici comment aider :

- Ajoute les types manquants (signalés avec `// TODO`)
- Corrige ou améliore les types existants
- Ouvre une *issue* pour signaler une erreur ou demander une clarification

Je serais ravi de recevoir vos retours ou contributions ! ✨
npm package: @sacoding/databus.js
Description: redux-saga based databus
Latest version: 1.0.0

# databus.js

[![NPM Version](https://img.shields.io/npm/v/@sacoding/databus.js.svg?style=flat)](https://www.npmjs.com/package/@sacoding/databus.js)
[![Build Status](https://img.shields.io/travis/sacoding/databus.js.svg?style=flat)](https://travis-ci.org/sacoding/databus.js)

`databus.js` is a library providing databus for frontend applications.

## Installation

```sh
npm install --save @sacoding/databus.js
```

## Usage

To use `databus.js` only import of `databus` object is required.

```js
import databus from '@sacoding/databus.js';
```

`databus` object is singleton so it does not matter where it is imported.

### Examples

#### Dispatching an event

```js
import databus from '@sacoding/databus.js';

databus.dispatchEvent('foo', { a: 1 });
```

#### Subscribing an event

```js
import databus from '@sacoding/databus.js';

databus.subscribeEvent('foo', payload => console.log(payload));
databus.dispatchEvent('foo', { a: 1 });
```

#### Adding new state reducer

```js
import databus from '@sacoding/databus.js';

databus.addStateReducer('foo', (state = {}, { type, payload }) => {
    if ('foo' !== type) {
        return state;
    }

    return { ...state, ...payload };
});
```

#### Getting state

```js
import databus from '@sacoding/databus.js';

databus.addStateReducer('foo', (state = {}, { type, payload }) => {
    if ('foo' !== type) {
        return state;
    }

    return { ...state, ...payload };
});

databus.dispatchEvent('foo', { a: 1 });

console.log(databus.getState());
```
npm package: @sacoding/logging.js
Description: Simple logger for frontend applications
Latest version: 1.1.1

# logging.js

[![NPM Version](https://img.shields.io/npm/v/@sacoding/logging.js.svg?style=flat)](https://www.npmjs.com/package/@sacoding/logging.js)
[![Build Status](https://img.shields.io/travis/sacoding/logging.js.svg?style=flat)](https://travis-ci.org/sacoding/databus.js)

`logging.js` is a library providing logging for frontend applications

## Installation

```sh
npm install --save @sacoding/logging.js
```

## Usage

To use `logging.js` import it in javascript file and get default logger by calling `getLogger` method.

```js
import Logging from '@sacoding/logging.js';

const loggger = Logging.getLogger();
logger.debug('foo', { bar: 1 });
```

### Defining new loggers

`Logging` class has static method `setLogger` which can be used to define new loggers.

Each logger has to have following static methods:
- `debug`,
- `info`,
- `notice`,
- `warning`,
- `error`,
- `critical`,
- `alert`,
- `emergency`.

Convention used in predefined loggers is to handle two parameters for each method:
- first for `message` which is string,
- second for `context` which is object.

```js
import Logging from '@sacoding/logging.js';

class FooLogger {
    static emergency = () => {};
    static alert = () => {};
    static critical = () => {};
    static error = () => {};
    static warning = () => {};
    static notice = () => {};
    static info = () => {};
    static debug = () => {};
}

Logging.setLogger('foo', FooLogger, false);
```

Third parameter of `Logging::setLogger` method is used to set new logger as default one if it is `true`.

To log with new logger call:
```js
const fooLogger = Logging.getLogger('foo');
fooLogger.debug('bar');
```