open-index/open-npm huggingface dataset:
npm package: @deadcode-uk/archivum
Description: Helper functions for JavaScript and TypeScript that compliment the libSQL client
Latest version: 0.1.9

# Archivum

Helper functions for JavaScript and TypeScript that compliment the libSQL client

**Installation**

```
npm install @deadcode-uk/archivum
```

**Peer Dependencies**

Your project will need to include the following packages:

```
@libsql/client
```

## sqlite

`sqlite` is used as a template literal tag, and simplifies the creation of query statements, especially when arguments need to be passed into the statement

```ts
import { createClient } from "@libsql/client"
import { sqlite } from "@deadcode-uk/archivium"

const client = createClient(...)

export async function soSomething(): Promise<void> {
    const someValue = 100

    await client.execute(sqlite`
        SELECT * FROM my_table WHERE my_column = ${someValue} LIMIT 1
    `)
}
```

That would produce the same result as:

```ts
import { createClient } from "@libsql/client"
import { sqlite } from "@deadcode-uk/archivium"

const client = createClient(...)

export async function soSomething(): Promise<void> {
    const someValue = 100

    await client.execute({
        sql: "SELECT * FROM my_table WHERE my_column = ? LIMIT 1",
        args: [someValue]
    })
}
```

## row and rows

The `row` and `rows` functions are for use in TypeScript, they essentially handle type-casting of the result object returned from libSQL queries

```ts
import { createClient } from "@libsql/client"
import { row, rows, sqlite } from "@deadcode-uk/archivium"

const client = createClient(...)

export type Example = {
    id: number
    created_at: number
    updated_at: number
}

export async function fetchFirstExample(): Promise<Example | null> {
    const result = await client.execute(sqlite`
        SELECT * FROM examples LIMIT 1
    `)

    return row(result) // or row<Example>(result)
}

export async function fetchAllExamples(): Promise<Example[]> {
    const result = await client.execute(sqlite`
        SELECT * FROM examples
    `)

    return rows(result) // or rows<Example>(result)
}
```

## Row\<T\> and Rows\<T\>

The `Row<T>` type will add `id`, `created_at`, and `updated_at` to the type `T`

The `Rows<T>` type is an alias for `Row<T>[]`

```ts
import { createClient } from "@libsql/client"
import { Row, Rows, row, rows, sqlite } from "@deadcode-uk/archivium"

const client = createClient(...)

type Article = {
    slug: string
    title: string
    content: string
}

export async function createArticle(article: Article): Promise<void> {
    await client.execute(sqlite`
        INSERT INTO articles (
            slug, title, content
        ) VALUES (
            ${article.slug}, ${article.title}, ${article.content}
        )
    `)
}

export async function fetchArticle(slug: string): Promise<Row<Article> | null> {
    const result = await client.execute(sqlite`
        SELECT * FROM articles WHERE slug = ${slug} LIMIT 1
    `)

    return row(result)
}

export async function fetchArticles(): Promise<Rows<Article>> {
    const result = await client.execute(sqlite`
        SELECT * FROM articles
    `)

    return rows(result)
}
```
npm package: @deadlock-delegate/twitter-bot
Description: Twitter bot plugin for core
Author: deadlock
Latest version: 1.0.6

# Core Twitter BoT

Plugin used by @arkdelegates and @solardelegates Twitter account

#### ❤️ Support maintenance and development of plugins
If you find this or other plugins useful please consider voting for `deadlock` delegate on Solar or Ark networks.


## Installation

### Adding plugin to config

Before restarting your process, you need to add the plugin into the very end  `core.plugins` or `relay.plugins` section of `app.json` file:

```json
{
  "package": "@deadlock-delegate/twitter-bot",
  "options": {
    "enabled": true,
    "consumerKey": "",
    "consumerSecret": "",
    "accessToken": "",
    "accessTokenSecret": "",
  }
}
```

### For production (eg. mainnet/testnet/devnet):

1. Install plugin: `<command> plugin:install @deadlock-delegate/notifier`, eg: `ark plugin:install @deadlock-delegate/notifier` or `solar plugin:install @deadlock-delegate/notifier`2. Add plugin to `app.json`
3. Start your node as you usually start it 

### For development:

Assuming you don't run testnet locally via docker:

1. Clone this plugin into `plugins/` directory of the [core](https://github.com/ArkEcosystem/core/) project
2. Add plugin to `app.json`, for testnet the file can be found in: `core/packages/core/bin/config/testnet/app.json`
3. Go into the plugin's directory: `cd twitter-bot`
4. Build plugin: `yarn build`
5. Run `yarn full:testnet` inside `core/packages/core` directory to start testnet with notifier plugin

### Configuration explanation

```json
{
  "package": "@deadlock-delegate/twitter-bot",
  "options": {
    "enabled": true,
    "consumerKey": "",
    "consumerSecret": "",
    "accessToken": "",
    "accessTokenSecret": "",
  }
}
```

## Credits

- [roks0n](https://github.com/roks0n)
- [c0nsol3](https://github.com/c0nsol3)
- [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © deadlock