Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh committed Jun 8, 2022
0 parents commit 60a1ee2
Show file tree
Hide file tree
Showing 34 changed files with 14,673 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
37 changes: 37 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
};
9 changes: 9 additions & 0 deletions .fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 3

server: https://app.fossa.com

project:
id: github.com/openfga/js-sdk
name: github.com/openfga/js-sdk
link: fga.dev
url: github.com/openfga/js-sdk
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @openfga/core
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATES/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Report an issue
about: Create a bug report about an existing issue.
title: ''
labels: 'bug'
assignees: ''

---

**Please do not report security vulnerabilities here**. See the [Responsible Disclosure Program](https://github.com/openfga/js-sdk/blob/main/.github/SECURITY.md).

**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible.

By submitting an issue to this repository, you agree to the terms within the [OpenFGA Code of Conduct](https://github.com/openfga/rfcs/blob/main/CODE-OF-CONDUCT.md).

### Description

> Provide a clear and concise description of the issue, including what you expected to happen.
### Reproduction

> Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.
>
> Where applicable, please include:
>
> - Code sample to reproduce the issue
> - Log files (redact/remove sensitive information)
> - Application settings (redact/remove sensitive information)
> - Screenshots
### Environment

> Please provide the following:
- **Version of this library used:**
- **Version of the platform or framework used, if applicable:**
- **Other relevant versions (language, server software, OS, browser):**
- **Other modules/plugins/libraries that might be involved:**
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATES/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Feature request
about: Suggest new functionality for this project.
title: ''
labels: 'feature'
assignees: ''

---

**Please do not report security vulnerabilities here**. See the [Responsible Disclosure Program](https://github.com/openfga/js-sdk/blob/main/.github/SECURITY.md).

**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible.

By submitting an issue to this repository, you agree to the terms within the [OpenFGA Code of Conduct](https://github.com/openfga/rfcs/blob/main/CODE-OF-CONDUCT.md).

### Describe the problem you'd like to have solved

> A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the ideal solution

> A clear and concise description of what you want to happen.
## Alternatives and current workarounds

> A clear and concise description of any alternatives you've considered or any workarounds that are currently in place.
### Additional context

> Add any other context or screenshots about the feature request here.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We are not accepting new Pull Requests for the time being. Please raise an issue or contact us in the [support community](https://discord.gg/8naAwJfWN6) instead.
8 changes: 8 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Security Policy

This document outlines the Responsible Disclosure Program for OpenFGA.

## Responsible Disclosure Policy


## Reporting a vulnerability
129 changes: 129 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Build, Test and Publish

on:
push:
pull_request:
workflow_dispatch:

jobs:
fossa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
scope: '@openfga'
always-auth: false
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run FOSSA scan and upload build data
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
branch: ${{ github.ref_name }}
- name: Run FOSSA tests
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true

snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
scope: '@openfga'
always-auth: false
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Audit dependencies
run: npm audit

- name: Check for circular dependencies
run: npx madge --circular . --extensions ts,js

- name: Run tests
run: npm test

publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, test, fossa, snyk]

steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
scope: '@openfga'
always-auth: false
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

create-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: publish

steps:
- uses: actions/checkout@v2

- uses: Roang-zero1/github-create-release-action@5cf058ddffa6fa04e5cda07c98570c757dc4a0e1
with:
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/semgrep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Semgrep
on:
push:
branches:
- main
jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot')
steps:
- uses: actions/checkout@v3
- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
wwwroot/*.js
node_modules
typings
dist
git_push.sh
.DS_Store
VERSION.txt
tests/coverage
.idea/
.vscode/

.env
credentials.json
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmjs.org/
sign-git-tag=true
1 change: 1 addition & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.npmignore
33 changes: 33 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.eslintignore
.eslintrc.js
.fossa.yml
.github/CODEOWNERS
.github/ISSUE_TEMPLATES/bug_report.md
.github/ISSUE_TEMPLATES/feature_request.md
.github/PULL_REQUEST_TEMPLATE.md
.github/SECURITY.md
.github/workflows/main.yaml
.github/workflows/semgrep.yaml
.gitignore
.npmrc
CHANGELOG.md
CONTRIBUTING.md
LICENSE
NOTICE.txt
README.md
VERSION.txt
api.ts
apiModel.ts
base.ts
common.ts
configuration.ts
errors.ts
git_push.sh
index.ts
package-lock.json
package.json
tests/index.test.ts
tests/jest.config.js
tests/tsconfig.spec.json
tsconfig.json
validation.ts
1 change: 1 addition & 0 deletions .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.0.0
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## v0.0.1

### [0.0.1](https://github.com/openfga/js-sdk/releases/tag/v0.0.1) (2022-06-09)

Initial Release
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing to OpenFGA projects

A big welcome and thank you for considering contributing to the OpenFGA open source projects. It’s people like you that make it a reality for users in our community.

Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing these open source projects. In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull requests.

### Quicklinks

* [Code of Conduct](#code-of-conduct)
* [Getting Started](#getting-started)
* [Making Changes](#making-changes)
* [Opening Issues](#opening-issues)
* [Submitting Pull Requests](#submitting-pull-requests) [Note: We are not accepting Pull Requests at this time!]
* [Getting in Touch](#getting-in-touch)
* [Have a question or problem?](#have-a-question-or-problem)
* [Vulnerability Reporting](#vulnerability-reporting)

## Code of Conduct

By participating and contributing to this project, you are expected to uphold our [Code of Conduct](https://github.com/openfga/rfcs/blob/main/CODE-OF-CONDUCT.md).

## Getting Started

### Making Changes

When contributing to a repository, the first step is to open an issue in that repository to discuss the change you wish to make before making them.

### Opening Issues

Before you submit a new issue please make sure to search all open and closed issues. It is possible your feature request/issue has already been answered.

This repo includes an issue template that will walk through all the places to check before submitting your issue here. Please follow the instructions there to make sure this is not a duplicate issue and that we have everything we need to research and reproduce this problem.

### Submitting Pull Requests

Pull Requests are not currently open, please [raise an issue](https://github.com/openfga/js-sdk/issues) or contact a team member on https://discord.gg/8naAwJfWN6 if there is a feature you'd like us to implement.

## Getting in touch

### Have a question or problem?

Please do not open issues for general support or usage questions. Instead, join us over in the [support community](https://discord.gg/8naAwJfWN6).

### Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://github.com/openfga/js-sdk/blob/main/.github/SECURITY.md) details the procedure for disclosing security issues.
Loading

0 comments on commit 60a1ee2

Please sign in to comment.