open-index/open-npm huggingface dataset:
npm package: @himadric/xedge-cli
Description: Sitecore Experience Edge for Content Hub Cli.
Author: Himadri Chakrabarti
Latest version: 1.0.2

# Sitecore Experience Edge for Content Hub Cli
The Sitecore Experience Edge for Content Hub Cli is a command line interface for adminisitering Experience Edge from command prompt. To know more about Sitecore Experience Edge for Content Hub architecture read my blog https://himadritechblog.wordpress.com/2021/10/09/sitecore-experience-edge-api-architecture-and-a-postman-collection/

## Installation
The Cli is an npm package that can be installed globally in your machine using below cpmmand.

npm install -g @himadric/xedge-cli

## Usage
To see command help you can always run the command with --help option.

### Setup
To set up your local with Sitecore Experience Edge URLs, run the below command. This needs to run only once unless your Experience Edge environment is modified.

xedge-setup-env --tkn_url <Token URL\> --aud_url \<Audience Url\> --adm_url \<Admin URL\> --key_url \<Preview URL\>

### Get JWT token
To get the JWT token

xedge-get-admin-token --ci \<Client ID\> --cs \<Client Secret\>

### Admin Commands
xedge-delete-cache --id \<Collection Id\>\
xedge-delete-content\
xedge-get-webhooks --id \<Webhook Id\>\
xedge-create-webhook -f \<json request file\>\
xedge-delete-webhook --id \<Webhook Id\>\
xedge-update-webhook -f \<json request file\>\
xedge-get-settings\
xedge-update-settings --contentCacheAutoClear \<true or false\> --mediaCacheAutoClear \<true or false\> --tenantCacheAutoClear \<true or false\> --contentCacheTtl \<duration\> --mediaCacheTtl \<duration\>

### Key Management Commands
xedge-create-api-key -f \<json request file\>\
xedge-get-api-key-by-hash -h \<hash value\>\
xedge-get-api-key-by-token -t \<token value\>\
xedge-get-api-keys\
xedge-rename-api-key-by-hash -h \<hash\> -n \<new name\>\
xedge-rename-api-key-by-token -t \<token\>\
xedge-revoke-api-key-by-hash -h \<hash\>\
xedge-revoke-api-key-by-token -t \<token\>

## Dependencies
This package borrowed code from https://github.com/treygriffith/netrc-rw
npm package: @himalaya-quant/ctrader-layer
Description: A Node.js communication layer for the cTrader Open API.
Author: Caius Citiriga
Latest version: 2.3.0

# HimalayaQuant cTrader Layer

A Node.js communication layer for the cTrader [Open API](https://connect.spotware.com).<br><br>
**This implementation is created by Reiryoku Technologies and maintained by HimalayaQuant, Caius Citiriga and contributors.**

## Installation

```console
npm install @himalaya-quant/ctrader-layer
```

## Usage

For the cTrader Open API usage refer to the [Open API Documentation](https://spotware.github.io/open-api-docs/).

### How to establish a connection

```javascript
const { CTraderConnection } = require('@himalaya-quant/ctrader-layer');

const connection = new CTraderConnection({
  host: 'demo.ctraderapi.com',
  port: 5035,
});

await connection.open();
```

### How to send commands

You can use the `sendCommand` method to send a command with payload to the server.
The method returns a `Promise` resolved only when a response from the server is received.
If the response to the command contains an error code then the returned `Promise` is rejected.

```javascript
await connection.sendCommand('PayloadName', {
  foo: 'bar',
});
```

### How to authenticate an application

```javascript
await connection.sendCommand('ProtoOAApplicationAuthReq', {
  clientId: 'foo',
  clientSecret: 'bar',
});
```

### How to keep connection alive

You can send a heartbeat message every 25 seconds to keep the connection alive.

```javascript
setInterval(() => connection.sendHeartbeat(), 25000);
```

### How to listen events from server

```javascript
connection.on('EventName', (event) => {
  console.log(event);
});
```

### How to get the access token profile information

Through HTTP request.

```javascript
console.log(await CTraderConnection.getAccessTokenProfile('access-token'));
```

### How to get the access token accounts

Through HTTP request.

```javascript
console.log(await CTraderConnection.getAccessTokenAccounts('access-token'));
```

## Contribution

You can create a PR or open an issue for bug reports or ideas.
npm package: @himanoa/dependencies-based-clone
Description: Clone TypeScript file recursively dependencies based 
Author: himanoa
Latest version: 1.0.16

## dependencies-based-clone

A tool to clone TypeScript source files into a separate directory based on dependency relationships and rules.

### How to use

1. Initialize the configuration:

```bash
npx @himanoa/dependencies-based-clone init-config
```
2. Open dbc.config.json with your editor.
3. Define your copy rules:
  - from: A regular expression that matches the source files you want to clone.
  - to: The destination file name. You can use placeholders like $1 which will expand groups defined in the from regex.

Example:

```json
{
  "rules": [{
    "from": "path/to/source/(.*)\.ts",
    "to": "path/to/destination/$1.js"
  }]
}
```

4. Execute the clone:

```bash
npx @himanoa/dependencies-based-clone clone src/index.ts
```


This will start from src/index.ts, resolve its imports, and recursively clone files based on your rules.
npm package: @himanoa/ntd
Description: New type pattern definition support library
Latest version: 0.0.4

# @himanoa/ntd

ntd is TypeScript library that helps implement the new type pattern.

whici is used to treat two types with same structure as different types in
TypeScript.

## Installation

For npm users:

```bash
npm install @himanoa/ntd
```

## Usages

```typescript
// Type definition(user.ts)

import {
  makeValidator,
  makeValidationSmartConstructor,
  Ok,
  Err
} from "@himanoa/ntd";

declare const UrlStringSym: unique symbol;

const urlVaidator: Validator<string, { kind: "invalidFormat" }> = makeVaidator<string, { kind: 'invalidFormat' }>((ok, err) => (value) => {
  try {
    new URL(value)
    return ok(value)
  } catch {
    return err({kind: 'invalidFormat'})
  }
})

export const makeUrlString = makeValidationSmartConstructor<
  string,
  typeof UserNameSym
>()(urlValidator);

export type UrlString = FromValidationSmartConstructor<
  typeof makeUrlString
>;

// Use defined types

const validUrlStringResult = makeUrlString("https://example.com/");
const invalidUrlStringResult = makeUrlString("example!!!"); // 

if (validUrlStringResult.ok) {
  validUrlStringResult.v // https://example.com/
}

if (!invalidUrlStringResult.ok) {
  invalidUrlStringResult.e // { kind: 'invalidFormat' }
}
```

## Contributing

Contributions are welcome! Please feel free to open an issue or pull request.

## License

This library is licensed under the MIT license. See the [LICENSE](./LICENSE)
file for more information.
npm package: @himanoa/parser-combinator
Description: parser combinator
Author: himanoa
Latest version: 0.0.8

# @himanoa/parser-combinator

parser-combinator library for typescript

## Install

### npm

`npm i @himanoa/parser-combinator`

## Example

```typescript
import { choice, createParser, map, str } from "@himanoa/parser-combinator";

const booleanSymbol = choice([
  map(str("true"), () => true),
  map(str("false"), () => false),
]);

const parser = createParser(booleanSymbol);

const trueResult = parser("true");

console.log(trueResult.kind === "success" ? trueResult.value : "failed parse");
console.log(trueResult.kind === "success" ? trueResult.value : "failed parse");

const falseResult = parser("false");

console.log(
  falseResult.kind === "success" ? falseResult.value : "failed parse",
);
console.log(
  falseResult.kind === "success" ? falseResult.value : "failed parse",
);

const failedResult = parser("asdfasdf");

console.log(
  failedResult.kind === "success" ? failedResult.value : "failed parse",
);
console.log(
  failedResult.kind === "success" ? failedResult.value : "failed parse",
);
```

## API

- anyChar: Parse any token
- eof: Parse eof token
- char: Parse `c` token
- choice: Parse any one matching token from multiple parsers
- count: Parse parser from zero up to count times
- and: Parse all parsers
- many: Parse parser from zero or more tiems returning a Array with the values
  from p
- many1: Parse parser from one or more tiems returning a Array with the values
  from p
- str: Parse many char token
- countMinMax: Parse parser from min to max times
- map: convert `value` when parse success
- mapErr: convert `expected` when parse failed
- surround: Parse open followed by parser followed by close
- not: Reverse parser result
- skip: Crush parse results with never
- satisfy: Parses a token and succeeds depending on the result of predicate
- optional: Parse a token and return a or null. Return null when failed parse.
npm package: @himanoa/schemaless-validator
Description: A library for quickly and freedom creating validation
Author: himanoa
Latest version: 1.0.4

# schemaless-validator

A library for quickly and freedom creating validation 

```typescript
import { validate } from '@himanoa/schemaless-validator'

const input = 12

validate((assert) => {
  assert(input > 13, "input must be more than 13")
  assert(input.toString().length > 13, "input must be at least 13 characters")
}).catch(errors => {
  console.dir(errors)
  /*
   * console.dir
   *  [
   *    'input must be more than 13',
   *    'input must be at least 13 characters'
   *  ]
   *
   */
})
```

## Install

```
npm install @himanoa/schemaless-validator
```

or

```
yarn add @himanoa/schemaless-validator
```

## API

### `validate(validator: (assert: (cond: boolean, exceptMessage: string)) => void): Promise<void>`

Execute validator function.

Return the `Promise.resolve<void>` if error array is empty when after execute `validator` and return the `Promise.resolve(exceptMessageArray)` when error is not empty

See. [test case](https://github.com/himanoa/schemaless-validator/blob/master/src/lib.test.ts#L17-L22)

## LICENSE 

MIT
npm package: @himanshu.kumar394/tiny
Description: Removes all spaces from a string
Latest version: 3.0.0

# hkd-tiny
[![npm bundle size (minified)](https://img.shields.io/npm/v/@himanshu.kumar394/tiny.svg)](https://github.com/hi-manshu-kumar/hkd-tiny)
[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/min/@himanshu.kumar394/tiny.svg)](https://github.com/hi-manshu-kumar/hkd-tiny)

Removes all spaces from a string.

## Install

```
$ npm install @himanshu.kumar394/tiny
```

## Usage

```js
const tiny = require("@himanshu.kumar394/tiny");

tiny("So much space!");
//=> "Somuchspace!"

tiny(1337);
//=> Uncaught TypeError: Tiny wants a string!
//    at tiny (<anonymous>:2:41)
//    at <anonymous>:1:1
```