# @huzapi/types-cms

> Definition types for entity, enumeration and endpoints etc

Latest version **1.0.28** (published 2021-02-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @huzapi/types-cms
pnpm add @huzapi/types-cms
yarn add @huzapi/types-cms
bun add @huzapi/types-cms
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.28 |
| Published | 2021-02-05 |
| First published | 2021-02-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 200.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mustafa Yelmer |
| Maintainers | mustafayelmer |

## Links

- npm: https://www.npmjs.com/package/@huzapi/types-cms
- Repository: git@gitlab.azerdev.com:huz.byorbit/be/types/cms
- npm.io page: https://npm.io/package/@huzapi/types-cms

## Recent versions

- 1.0.28 (latest) — 2021-02-05
- 1.0.27 — 2021-02-05
- 1.0.26 — 2021-02-05
- 1.0.25 — 2021-02-05
- 1.0.24 — 2021-02-05
- 1.0.23 — 2021-02-04
- 1.0.22 — 2021-02-04
- 1.0.21 — 2021-02-04
- 1.0.20 — 2021-02-04
- 1.0.19 — 2021-02-04
- 1.0.18 — 2021-02-04
- 1.0.17 — 2021-02-04
- 1.0.16 — 2021-02-04
- 1.0.15 — 2021-02-03
- 1.0.14 — 2021-02-03
- … 8 more at https://npm.io/package/@huzapi/types-cms/versions

## README

# Huz Api / @Types for CMS

Definition types for entity, enumeration and endpoints etc

- TypeScript
- Eslint
- Prettier

## Install
``npm i @huzapi/types-cms``

## Sample Files
- [brand](src/brandEntity.ts)
- [profile >> role](src/profileEntity.ts)

## Sample TypeScript
````typescript
import {brand, profile} from "@huzapi/types-cms";

export class SampleClass  {
    getBrand(id: brand.Id): brand.Doc {
    } 
    checkEnum(role: profile.role.Id): void {
    } 
}

const sample = new SampleClass();
const givenBrandId = 'bla bla';
/*
IDE checks "givenBrandId" is string, because brand.Id is string
*/
const brandDoc = sample.getBrand(givenBrandId);
/*
IDE auto-completes brandDoc properties as
        id: string;
        createdAt: Date;
        createdBy: string;
        updatedAt: Date;
        updatedBy: string;
        _revision: number;
        name: {[lang: string]: string}; also checks lang is valid lang by enum
        code: string;
        description: {[lang: string]: string}; also checks lang is valid lang by enum
        activated: boolean;
        weight: number;
        publishedAt: Date;
        metatag: {
            title: {[lang: string]: string}; also checks lang is valid lang by enum
            keywords: {[lang: string]: string}; also checks lang is valid lang by enum
            description: {[lang: string]: string}; also checks lang is valid lang by enum
        };
        logo: {id: string};
        subject: {id: string};
        topSlider: {id: string};
        forAllProjects: boolean;
        projects: Array<{id: string}>;
*/

const givenRole = 'bla bla';
/*
IDE checks "givenRole" is string and it is in Enum[owner,kid,adult]
*/
sample.checkEnum(givenRole);
````

## Sample JavaScript
````javascript
const {brand, profile} = require("@huzapi/types-cms");

/**
 * @param {brand.Id} id
 * @returns {brand.Doc}
*/
const getBrand = (id) => {} 

/**
 * @param {profile.role.Id} role
 * @returns {void}
*/
const checkEnum = (role) => {} 

const givenBrandId = 'bla bla';
/*
IDE checks "givenBrandId" is string, because brand.Id is string
*/
const brandDoc = getBrand(givenBrandId);
/*
IDE auto-completes brandDoc properties likes type-script sample
*/

const givenRole = 'bla bla';
/*
IDE checks "givenRole" is string and it is in Enum[owner,kid,adult]
*/
checkEnum(givenRole);
````

---
_Source: https://npm.io/package/@huzapi/types-cms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
