open-index/open-npm huggingface dataset:
npm package: @kth/ug-rest-api-helper
Description: Node.js module to make JSON calls against APIs.
Author: KTH
Latest version: 1.2.1

# ug-rest-api-helper
Hold helper functions to retrive data from UG Rest Api

# Agenda UG Rest Api Helper
This project has the implementation of calling UG rest API. It will fetch users and groups data.

# Passing Connection Properties
UG rest Api requires authentication token to send back data. For that, need to pass few connection parameters first to make sure that there will be no un-authorized response issue during fetching time of UG data set.
In `ugRestApiHelper` , connection properties needs to be set using `initConnectionProperties` method and in that method following parameters need to pass.
1. `authorityURL` needs to pass to get access token. Make sure the url should be without `/oauth2/token`.
2. `clientId` needs to pass to get access token.
3. `clientSecret` needs to pass to get access token.
4. `ugURL` needs to pass. This will be used while fetching UG data.
5. `subscriptionKey` needs to pass. (Optional)

Note: Make sure `ugURL` is correct and authenticates the `subscriptionKey` that is passed.

If token is not expired then Api will use existing token to fetch the data otherwise it will generate a new token.

# Fetch UG Data
There are two data set supported so far.
1. Users
2. Groups

# Fetch UG Groups
For groups to fetch there are two methods added.

1. getUGGroups
 This method will receive `groupFilterAttributeName` which indicates property name like 'name', 'kthid' etc, `operatorToUseInFilter` like 'eq', 'contains', 'startswith' etc, `groupFilterAttributeValue` like 'sst' (this will be the filter value to filter out the data) and there is a flag `expandMembers`. If this set to true then it will fetch groups along with members.

2. getUGGroupsByGroupName
 This method will bring groups along with members if needed. There is a flag `expandMembers`. If this set to true then it will fetch groups along with members. `groupName` needs to pass because filter will preapplied to 'name' only. `operatorToUseInFilter` also needed that how data should filter.

# Fetch UG Users
For user to fetch there is one method.
1. getUGUsers
This method will receive `userFilterAttributeName` which indicates property name like 'givenName', 'kthid' etc, `operatorToUseInFilter` like 'eq', 'contains', 'startswith' etc, `userFilterAttributeValue` like 'Joakim' (this will be the filter value to filter out the data).

# Operators supported so far
There are few filter operators that are supported so far.
1. eq
2. startswith
3. contains
4. in

Use on of these operators to filter out data.

TODO: There are other operators as well that is supported by UG Rest Api. Those will be including in the future.

Check the link below to see what are the supported filter by UG.

https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752358
npm package: @kthksgy/procedure-call
Description: Procedure Call
Author: kthksgy
Latest version: 0.0.1

# @kthksgy/procedure-call

@kthksgy/procedure-call is a procedure call interface designed for communication across different contexts, such as Window, React Native WebView or Service Worker.

## Todos

- Complete `README.md` and other documents
- Translate commonly visible Japanese comments to English
  - Currently, almost all comments which can be displayed in VSCode are Japanese.

## Features

@kthksgy/procedure-call has following features.

- Simple
- High compatibility
  - This can be used when two contexts can send string each other !
- Supports `async` / `await`
- Fully typed
- Small (less than 5KB when Gzipped)
- Standalone
  - No dependencies !

## Context specific libraries

There are some context specific libraries for @kthksgy/procedure-call.

If you are planning to use @kthksgy/procedure-call with these ccontexts, try it first !

- [React Native WebView](../react-native-web-view)
- [Service Worker](../service-worker)

## Installation

Run command below.

```
# npm
$ npm install @kthksgy/procedure-call

# yarn
$ yarn add @kthksgy/procedure-call
```

## Create an interface for any context

To create an interface, you should create 2 things.

- A method to call a procedure.
- A handler to handle packets.

TODO: Write.
npm package: @kthksgy/procedure-call-react-native-web-view
Description: Procedure Call React Native WebView
Author: kthksgy
Latest version: 0.0.1

# @kthksgy/procedure-call-react-native-web-view

**This document is under construction.**

## Todos

- Add tests
- Write about how to call procedure

## Installation

Run command below.

```
# npm
$ npm install @kthksgy/procedure-call @kthksgy/procedure-call-react-native-web-view

# yarn
$ yarn add @kthksgy/procedure-call @kthksgy/procedure-call-react-native-web-view
```

## WebView guest usage

1. Call `startGuestHandler`

- This function creates entrypoint to window for communicating with WebView host.

```typescript
startWebViewGuestHandler();
```

## WebView host usage

1. Create reference for WebView and assign
2. Generate host listener and set as `onMessage`
3. Optionally, console outputs inside WebView Guest can be bypassed by installing `bypassConsole`

```tsx
const webViewReference = useRef<WebView>(null);

const listener = useMemo(function () {
  return generateWebViewHostListener(function () {
    return webViewReference.current;
  });
}, []);

return (
  <WebView
    injectedJavaScript={generateBypassConsoleInstaller() + 'true;'}
    onMessage={listener}
    ref={webViewReference}
  />
);
```
npm package: @kthksgy/procedure-call-service-worker
Description: Procedure Call Service Worker
Author: kthksgy
Latest version: 0.0.1

# @kthksgy/procedure-call-service-worker

**This document is under construction.**

## Todos

- Add tests
- Write comments
- Write documents

## Installation

Run command below.

```
# npm
$ npm install @kthksgy/procedure-call @kthksgy/procedure-call-service-worker

# yarn
$ yarn add @kthksgy/procedure-call @kthksgy/procedure-call-service-worker
```