From 0ed36b2fca373c7abee368e8fae78d5f5006f735 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 13 Feb 2024 15:33:52 +0000 Subject: [PATCH 1/2] chore: dont use credentials class in example --- example/example1/example1.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/example1/example1.mjs b/example/example1/example1.mjs index 2ec5a32..808a7f8 100644 --- a/example/example1/example1.mjs +++ b/example/example1/example1.mjs @@ -1,9 +1,9 @@ -import { Credentials, CredentialsMethod, FgaApiValidationError, OpenFgaClient, TypeName } from "@openfga/sdk"; +import { CredentialsMethod, FgaApiValidationError, OpenFgaClient, TypeName } from "@openfga/sdk"; async function main () { let credentials; if (process.env.FGA_CLIENT_ID) { - credentials = new Credentials({ + credentials = { method: CredentialsMethod.ClientCredentials, config: { clientId: process.env.FGA_CLIENT_ID, @@ -11,7 +11,7 @@ async function main () { apiAudience: process.env.FGA_API_AUDIENCE, apiTokenIssuer: process.env.FGA_API_TOKEN_ISSUER } - }); + }; } const fgaClient = new OpenFgaClient({ From 41dd80d8ff0e87a11349a485fc3859a4f729e897 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 13 Feb 2024 15:34:11 +0000 Subject: [PATCH 2/2] release: v0.3.2 --- CHANGELOG.md | 9 +++++++++ configuration.ts | 4 ++-- example/README.md | 2 +- example/example1/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7724d3..b8cb7c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v0.3.2 + +### [0.3.1](https://github.com/openfga/js-sdk/compare/v0.3.1...v0.3.2) (2024-02-13) + +- feat: add example project +- feat: add support for `apiUrl` configuration option and deprecate `apiScheme` and `apiHost` +- fix: use correct content type for token request +- fix: make body in `readChanges` optional + ## v0.3.1 ### [0.3.1](https://github.com/openfga/js-sdk/compare/v0.3.0...v0.3.1) (2024-01-26) diff --git a/configuration.ts b/configuration.ts index 605f8ee..d99f842 100644 --- a/configuration.ts +++ b/configuration.ts @@ -21,7 +21,7 @@ const DEFAULT_MAX_RETRY = 15; // default minimum wait period in retry - but will backoff exponentially const DEFAULT_MIN_WAIT_MS = 100; -const DEFAULT_USER_AGENT = "openfga-sdk js/0.3.1"; +const DEFAULT_USER_AGENT = "openfga-sdk js/0.3.2"; export interface RetryParams { maxRetry?: number; @@ -74,7 +74,7 @@ export class Configuration { * @type {string} * @memberof Configuration */ - private static sdkVersion = "0.3.1"; + private static sdkVersion = "0.3.2"; /** * provide the full api URL (e.g. `https://api.fga.example`) diff --git a/example/README.md b/example/README.md index 9c6e3ab..0992237 100644 --- a/example/README.md +++ b/example/README.md @@ -28,7 +28,7 @@ Steps 2. In the Example `package.json` change the `@openfga/sdk` dependency from a semver range like below ```json "dependencies": { - "@openfga/sdk": "^0.3.1" + "@openfga/sdk": "^0.3.2" } ``` to a `file:` reference like below diff --git a/example/example1/package.json b/example/example1/package.json index 45e387a..6aa4149 100644 --- a/example/example1/package.json +++ b/example/example1/package.json @@ -9,7 +9,7 @@ "start": "node example1.mjs" }, "dependencies": { - "@openfga/sdk": "^0.3.1" + "@openfga/sdk": "^0.3.2" }, "engines": { "node": ">=16.13.0" diff --git a/package-lock.json b/package-lock.json index a701def..a33ad6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openfga/sdk", - "version": "0.3.1", + "version": "0.3.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@openfga/sdk", - "version": "0.3.1", + "version": "0.3.2", "license": "Apache-2.0", "dependencies": { "axios": "^1.6.7", diff --git a/package.json b/package.json index 6e212da..46e0b92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openfga/sdk", - "version": "0.3.1", + "version": "0.3.2", "description": "JavaScript and Node.js SDK for OpenFGA", "author": "OpenFGA", "keywords": [