open-index/open-npm huggingface dataset:
npm package: @heduapp/book-api
Description: ``` npm start ```
Author: H-Edu s.r.o
Latest version: 4.5.4

# Book API

## Usage
```
npm start
```

### GraphQL schema Typescript types
- The server has to run on port `3001`
  - Alternatively, you can tinker with [`graphql-codegen.yml`](./graphql-codegen.yml)
```bash
npm start
```
```bash
npm run generate-graphql-typings
```

### Configuration

`.env` doesn't have to exist, as long as the configuration is in the environment

Files:
- `.env` ([.env config example](.env.example))
  - DB Config (`DB_HOST`, `DB_NAME`, `DB_USER`, `DB_PASSWORD`)
  - Back office location (`BACK_OFFICE_URL`)
  - AWS Config
    - Credentials (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`)
    - Region (`AWS_REGION`)
    - S3 bucket (`AWS_S3_BUCKET_NAME`)

#### AWS

_.env_:
```bash
AWS_ACCESS_KEY_ID=AKKAJFLK2039FALKSJF
AWS_SECRET_ACCESS_KEY=ffasd903fkljasdfLKFJASFOA909
AWS_REGION=eu-west-2
AWS_S3_BUCKET_NAME=bucket-name
```

#### DB

_.env_:
```bash
DB_HOST=127.0.0.1
DB_NAME=bo-dev
DB_USER=bo
DB_PASSWORD=bo
```

To access the production or testing DB, create an SSH tunnel to the content service server:

```bash
ssh -L 5433:store4.rosti.cz:5432 -p 14364 app@node-14.rosti.cz
```

#### Back office

_.env_:
```bash
BACK_OFFICE_URL=http://localhost:9433
```

#### Discussions

_.env_:
```bash
DISCUSSION_MASTER_TOKEN=token
```

## Contributing

### Logging
Use [winston](https://github.com/winstonjs/winston/tree/2.4.0) instance from [src/logger.ts](src/logger.ts).
npm package: @heduapp/book-objects
Description: ## Gist Business objects, basically, copy the structure of XML.   Specific elements will have its own implementation which calculates values from data.   Hence, there should be zero redundancy of the data.   There are codecs for different purposes (parsin
Author: H-Edu s.r.o.
Latest version: 0.23.0

# Book Objects

## Gist
Business objects, basically, copy the structure of XML.  
Specific elements will have its own implementation which calculates values from data.  
Hence, there should be zero redundancy of the data.  
There are codecs for different purposes (parsing XML, saving business objects to DB or rendering using JSX).  
If there is an error in a source (i.e. typo in the XML) it should be fixed by the codec.

## Usage
### Install
- Configure [SSH Config](http://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/) to access GitHub ([SSH config sample](ssh-config.sample)).
- Pick your version, from [releases](https://github.com/HeduApp/book-objects/releases).
```
npm install git+ssh://ssh-config-name:HeduApp/book-objects.git#dist
```

### Decode book XML into business objects
```typescript
import * as BO from 'book-objects/business-object';
import XMLCodec from 'book-objects/codec/xml-codec';
const xmlCodec = new Codec.XMLCodec();
const book = (await xmlCodec.decode(bookXML)) as BO.Book;
```

### Encode business objects into XML
```typescript
import XMLCodec from 'book-objects/codec/xml-codec';
const xmlCodec = new XMLCodec();
const bookXML = await xmlCodec.encode(book);
```

### Override component when encoding to JSX
```typescript
import JSXCodec from 'book-objects/codec/jsx-codec';
import { BusinessObjectType } from 'book-objects/business-object';
import { ComponentOverrides } from 'book-objects/jsx';
import { CustomBook } from './CustomBook';
import { CDNImage } from './CDNImage';
const overrides: ComponentOverrides = {
    [BusinessObjectType.Book]: (book) => <CustomBook {...{book}} />,
    img: ({attributes: {src}}) => {
        const imageID = src as string;
        return (
            <CDNImage {...{imageID}} />
        );
    },
};
const jsxCodec = new JSXCodec(overrides);
const EncodedComponent = await jsxCodec.encode(bookObject);
```

### Synchronous JSX encoding
```typescript
import JSXCodec from 'book-objects/codec/jsx-codec';
const jsxCodec = new JSXCodec(overrides);
const EncodedComponent = jsxCodec.encodeSync(bookObject);
```

## Contributing

### Tests
[Alsatian](https://github.com/alsatian-test/alsatian) is used as a testing framework and test runner, [Enzyme](https://github.com/airbnb/enzyme) is used to test JSX.  
To run tests:

```
npm run test
npm run test-watch
```

### Code style
Code style is enforced by [prettier](https://prettier.io/)  
To prettify code:
```
npm run prettier
npm run prettier-watch
```

### Before pushing to master
 - [ ] Are all tests passing?
 - [ ] Have you ran prettier?

### Release new version
```
npm version major|minor|patch # Should be same as the version in the commit message
npm run release
```
- Create a [new release](https://github.com/HeduApp/book-objects/releases/new) from the generated tag
npm package: @heduapp/playground
Description: Interactive SVG images for H-Edu Books.
Author: H-Edu s.r.o.
Latest version: 0.15.8

# Playground 

## Usage

### Install
- Configure SSH Config to access GitHub.
- Pick your version, from [releases](https://github.com/HeduApp/playground/releases).
```
npm install git+ssh://git@github.com:HeduApp/playground.git#PICKED_VERSION
```

### Code

```typescript
```


## Contributing

### Run development server
```bash
npm develop
```


### Tests
[Alsatian](https://github.com/alsatian-test/alsatian) is used as a testing framework and test runner, [Enzyme](https://github.com/airbnb/enzyme) is used to test JSX.  
To run tests:

```bash
npm run test
npm run test-watch
```

### Code style
Code style is enforced by [prettier](https://prettier.io/)  
To prettify code:
```bash
npm run prettier
npm run prettier-watch
```

### Before pushing to master
 - [ ] Are all tests passing?
 - [ ] Have you ran prettier?

### Release new version
```bash
npm version major|minor|patch # Should be same as the version in the commit message
npm run release
```
- Create a [new release](https://github.com/HeduApp/book-objects/releases/new) from the generated tag