Skip to content

Commit

Permalink
chore(deps): upgrade dependencies & update comments on API (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantam authored Aug 4, 2023
2 parents 1e4ea9b + 37b0266 commit 7e2addc
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 205 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,48 @@ By submitting an issue to this repository, you agree to the terms within the [Op

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

> v0.2.0
### Version of OpenFGA (if known)

> v1.1.0
### OpenFGA Flags/Custom Configuration Applicable

> environment:
> - OPENFGA_DATASTORE_ENGINE=postgres
> - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
> - OPENFGA_TRACE_ENABLED=true
> - OPENFGA_TRACE_SAMPLE_RATIO=1
> - OPENFGA_TRACE_OTLP_ENDPOINT=otel-collector:4317
> - OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS=true
### 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:
> 1. Initialize OpenFgaClient with openfga_sdk.ClientConfiguration parameter api_host=127.0.0.1, credentials method client_credentials
> 2. Invoke method read_authorization_models
> 3. See exception thrown
### Sample Code the Produces Issues

>
> - Code sample to reproduce the issue
> - Log files (redact/remove sensitive information)
> - Application settings (redact/remove sensitive information)
> - Screenshots
> ```
> <code snippet>
> ```
### Backtrace (if applicable)

> ```
> <backtrace>
> ```
### Environment

> Please provide the following:
### Expected behavior
> A clear and concise description of what you expected to happen.
- **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:**
### Additional context
> Add any other context about the problem here.
File renamed without changes.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build, Test and Publish

on:
merge_group:
push:
pull_request:
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.eslintrc.js
.fossa.yml
.github/CODEOWNERS
.github/ISSUE_TEMPLATES/bug_report.md
.github/ISSUE_TEMPLATES/feature_request.md
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/feature_request.md
.github/workflows/main.yaml
.github/workflows/semgrep.yaml
.gitignore
Expand Down
40 changes: 6 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Release](https://img.shields.io/github/v/release/openfga/js-sdk?sort=semver&color=green)](https://github.com/openfga/js-sdk/releases)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenfga%2Fjs-sdk.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Fjs-sdk?ref=badge_shield)
[![Discord Server](https://img.shields.io/discord/759188666072825867?color=7289da&logo=discord "Discord Server")](https://discord.com/channels/759188666072825867/930524706854031421)
[![Discord Server](https://img.shields.io/discord/759188666072825867?color=7289da&logo=discord "Discord Server")](https://discord.gg/8naAwJfWN6)
[![Twitter](https://img.shields.io/twitter/follow/openfga?color=%23179CF0&logo=twitter&style=flat-square "@openfga on Twitter")](https://twitter.com/openfga)

This is an autogenerated JavaScript SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api), and includes TS typings.
Expand Down Expand Up @@ -192,8 +192,6 @@ Get information about the current store.

[API Documentation](https://openfga.dev/api/service#/Stores/GetStore)

> Requires a client initialized with a storeId
```javascript
const store = await fgaClient.getStore();

Expand All @@ -206,8 +204,6 @@ Delete a store.

[API Documentation](https://openfga.dev/api/service#/Stores/DeleteStore)

> Requires a client initialized with a storeId
```javascript
await fgaClient.deleteStore();
```
Expand All @@ -216,7 +212,7 @@ await fgaClient.deleteStore();

##### Read Authorization Models

Read all authorization models.
Read all authorization models in the store.

[API Documentation](https://openfga.dev/api/service#/Authorization%20Models/ReadAuthorizationModels)

Expand All @@ -236,12 +232,10 @@ authorizationModels = [

##### Write Authorization Model

Create a new version of the authorization model.
Create a new authorization model.

[API Documentation](https://openfga.dev/api/service#/Authorization%20Models/WriteAuthorizationModel)

> Requires a client initialized with a storeId
> Note: To learn how to build your authorization model, check the Docs at https://openfga.dev/docs.
> Learn more about [the OpenFGA configuration language](https://openfga.dev/docs/configuration-language).
Expand Down Expand Up @@ -276,9 +270,7 @@ const { authorization_model_id: id } = await fgaClient.writeAuthorizationModel({

##### Read a Single Authorization Model

[API Documentation](https://openfga.dev/api/service#/Authorization%20Models/ReadAuthorizationModel)

> Requires a client initialized with a storeId
Read a particular authorization model.

```javascript
const options = {};
Expand All @@ -297,8 +289,6 @@ Reads the latest authorization model (note: this ignores the model id in configu

[API Documentation](https://openfga.dev/api/service#/Authorization%20Models/ReadAuthorizationModel)

> Requires a client initialized with a storeId
```javascript
const { authorization_model: authorizationModel } = await fgaClient.readLatestAuthorizationModel();

Expand All @@ -311,8 +301,6 @@ const { authorization_model: authorizationModel } = await fgaClient.readLatestAu

Reads the list of historical relationship tuple writes and deletes.

> Requires a client initialized with a storeId
[API Documentation](https://openfga.dev/api/service#/Relationship%20Tuples/ReadChanges)

```javascript
Expand All @@ -333,9 +321,9 @@ const response = await fgaClient.readChanges({ type }, options);

##### Read Relationship Tuples

[API Documentation](https://openfga.dev/api/service#/Relationship%20Tuples/Read)
Reads the relationship tuples stored in the database. It does not evaluate nor exclude invalid tuples according to the authorization model.

> Requires a client initialized with a storeId
[API Documentation](https://openfga.dev/api/service#/Relationship%20Tuples/Read)

```javascript
// Find if a relationship tuple stating that a certain user is a viewer of a certain document
Expand Down Expand Up @@ -384,8 +372,6 @@ Create and/or delete relationship tuples to update the system state.

[API Documentation](https://openfga.dev/api/service#/Relationship%20Tuples/Write)

> Requires a client initialized with a storeId
###### Transaction mode (default)

By default, write runs in a transaction mode where any invalid operation (deleting a non-existing tuple, creating an existing tuple, one of the tuples was invalid) or a server error will fail the entire operation.
Expand Down Expand Up @@ -441,8 +427,6 @@ Check if a user has a particular relation with an object.

[API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/Check)

> Requires a client initialized with a storeId
```javascript
const options = {
// if you'd like to override the authorization model id for this request
Expand All @@ -463,8 +447,6 @@ const result = await fgaClient.check({
Run a set of [checks](#check). Batch Check will return `allowed: false` if it encounters an error, and will return the error in the body.
If 429s or 5xxs are encountered, the underlying check will retry up to 15 times before giving up.

> Requires a client initialized with a storeId
```javascript
const options = {
// if you'd like to override the authorization model id for this request
Expand Down Expand Up @@ -527,8 +509,6 @@ Expands the relationships in userset tree format.

[API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/Expand)

> Requires a client initialized with a storeId
```javascript
const options = {};

Expand All @@ -547,8 +527,6 @@ const { tree } = await fgaClient.expand({

List the objects of a particular type that the user has a certain relation to.

> Requires a client initialized with a storeId
[API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/ListObjects)

```javascript
Expand Down Expand Up @@ -577,8 +555,6 @@ List the relations a user has with an object. This wraps around [BatchCheck](#ba

Note: Any error encountered when checking any relation will be treated as `allowed: false`;

> Requires a client initialized with a storeId
```javascript
const options = {};

Expand All @@ -605,8 +581,6 @@ const response = await fgaClient.listRelations({

Read assertions for a particular authorization model.

> Requires a client initialized with a storeId
[API Documentation](https://openfga.dev/api/service#/Assertions/Read%20Assertions)

```javascript
Expand All @@ -631,8 +605,6 @@ response.assertions = [{

Update the assertions for a particular authorization model.

> Requires a client initialized with a storeId
[API Documentation](https://openfga.dev/api/service#/Assertions/Write%20Assertions)

```javascript
Expand Down
Loading

0 comments on commit 7e2addc

Please sign in to comment.