open-index/open-npm huggingface dataset:
npm package: @langion/apira
Description: API strict type definition creator
Latest version: 1.0.13

# Apira

API strict type definition creator. This library is aimed to allow you to define API with strict types using TypeScript. 
## First you need API Builder

    import {Apira} from "@langion/apira";
    export const api = new Apira();
After that you need to define method that makes request. There is an abstract class `Resolver` from `@langion/apira` and you need to extend it and set resolver to `api`. The  `request` method is used to perform every request.

    export class ServiceRequest extends Resolver<void> {
        protected basePath = "http://localhost:8090";
    
        protected request: <Response, Query, Payload, Params>(data: RequestData<Query, Payload, Params, void>) => Promise<Response> = (data) => {
            const request = fetch(data.url, {
                method: data.method,
                body: JSON.stringify(data.request.payload),
                headers: {
                    "Accept": "application/json",
                    "Content-Type": "application/json",
                },
            });
    
            const result = request.then((v) => v.json()).catch((e) => console.log(e));
    
            return result.then((v) => {
                console.log(v);
                return v;
            });
        }
    }
And now you need to assign resolver to `api`.

    import { Apira } from  "@langion/apira";
    Apira.setResolver(new ServiceRequest(), api);

## Define API
There are two types of definitions:
Without params in path:

    export const getAllData = api.path(Url)
	    .request<ResponseType, QueryType, PayloadType>(RequestMethod)
	    .build();
For example:

    interface Data {
      state: string;
      permissions: number[];
    }
    
    interface Filter {
      search: string;
      status: string
    }
    
    export const getAllData = api.path('/api/data')
        .request<Data, Filter, void>('get')
        .build();

With params in path:  

    export const getUser = api.path((p: ParamsType) => Url)
	    .request<ResponseType, QueryType, PayloadType>(RequestMethod)
	    .build();
For example:

    interface User {
        name: string;
        lastName: string;
    }
    
    interface Params {
        id: number;
    }
    
    export const getUser = api
        .path((p: Params) => `/api/user/${p.id}`)
        .request<User, void, void>('get')
        .build();
When you defined API methods you can call this methods:

    getAllData({ payload: null, query: { search: 'last', status: 'done' } }).then(r => {
        console.log(r.permissions);
        console.log(r.state);
    });
    
    getUser({ params: { id: 23 }, query: null, payload: null }).then(r => {
        console.log(r.name);
        console.log(r.lastName);
    });
npm package: @langion/introspector
Description: Introspect Langion format
Latest version: 1.0.44

#  Introspector

This lib parses [Langion](https://github.com/Langion/langion) format in order to create smaller description about types and [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) methods.

## Config
### IntrospectorConfig\<O extends string\>

|Key|Type|Comment
|--|--|--|
|origins|Array<Origin\<O\>>|Array of services from Langion
|getOriginFromModuleName|(path:  string) =>  O|Path is a module path, i.e. `com.app.myname.appname` and the result of this function must be the origin name
|adapters|Adapter[]|Array of adapters that will be used to parse Langion
|share?|SideOrigin\<O\>|If this property is set, introspector will try to find equal types among origins and extract them in to separate origin

## Origin\<O extends string\>

|Key|Type|Comment
|--|--|--|
|name|O|Name of the origin, for example in `com.app.myname.appname` name can be `appname`
|getLangion|() =>  Promise<langion.Langion>|This function should return Promise with Langion JSON description

## SideOrigin\<O extends string\>

|Key|Type|Comment
|--|--|--|
|origin|O|Origin that will be extracted as Shared
|origin|string|Name of the origin
npm package: @langleyu/branch
Description: Terminal Branch Navigator
Author: s.yu@less3.com
Latest version: 0.2.2

# Branch

You are a busy person, constantly doing pull-reviews and helping other developers whilst also trying to do your own tasks.  You find yourself hopping between lots of branches but you don't want
to keep typing their names out all the time.

`branch` helps by providing a simply interface which:

 * Lists the all the branches you have checked out.
 * Allows you to switch between them with a single shortcut.
 * Filter search these branches and if there is only a single match, switch to it.

## Installation

`yarn global add @langleyu/branch`

or

`npm install -g @langleyu/branch`

## Usage

### `branch`

List all the branches you have checked out, for the current repository.  Ordered by `committerdate`.
Each line will display a numerical index and the name of the branch.

#### Example
```
~ branch
1       test-branch-may-apple
2       test-branch-march-banana
3       test-branch-march-carrot
```

### `branch <index>`

Checkout branch at that particular index.

#### Example
```
~ branch 1
Switching to: test-branch-may-apple
```

### `branch <filter-query>`

Given the filter-query, return a list of branches those name's contains that query.  Notice the indexes are different from that initial list.

#### Example
```
~ branch march
1       test-branch-march-banana
2       test-branch-march-carrot
```

### `branch <filter-query> <index>`

Given a filter-query, switching to that particular index.

#### Example

```
~ branch march 1
Switching to: test-branch-march-banana
```