From b2686fe405835367c2bf72955987ecea23fabccf Mon Sep 17 00:00:00 2001 From: Raghd Hamzeh Date: Sun, 10 Dec 2023 23:33:05 -0500 Subject: [PATCH] release(v0.3.0): with conditions support --- CHANGELOG.md | 6 ++++-- README.md | 34 +++++++++++++++++----------------- configuration.ts | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 959e5fa..41dcce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ ## v0.3.0 -### [0.3.0](https://github.com/openfga/js-sdk/compare/v0.2.10...v0.3.0) (2023-11-01) +### [0.3.0](https://github.com/openfga/js-sdk/compare/v0.2.10...v0.3.0) (2023-12-11) -- feat!: support for conditions +- feat: support for conditions +- chore: use latest API interfaces +- chore: dependency updates ## v0.2.10 diff --git a/README.md b/README.md index 428aa09..652128c 100644 --- a/README.md +++ b/README.md @@ -94,10 +94,10 @@ The documentation below refers to the `OpenFgaClient`, to read the documentation const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; const fgaClient = new OpenFgaClient({ - apiScheme: OPENFGA_API_SCHEME, // optional, defaults to "https" - apiHost: OPENFGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) - storeId: OPENFGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` - authorizationModelId: OPENFGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request + apiScheme: process.env.FGA_API_SCHEME, // optional, defaults to "https" + apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) + storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` + authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request }); ``` @@ -107,14 +107,14 @@ const fgaClient = new OpenFgaClient({ const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; const fgaClient = new OpenFgaClient({ - apiScheme: OPENFGA_API_SCHEME, // optional, defaults to "https" - apiHost: OPENFGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) - storeId: OPENFGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` - authorizationModelId: OPENFGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request + apiScheme: process.env.FGA_API_SCHEME, // optional, defaults to "https" + apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) + storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` + authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request credentials: { method: CredentialsMethod.ApiToken, config: { - token: OPENFGA_API_TOKEN, // will be passed as the "Authorization: Bearer ${ApiToken}" request header + token: process.env.FGA_API_TOKEN, // will be passed as the "Authorization: Bearer ${ApiToken}" request header } } }); @@ -126,17 +126,17 @@ const fgaClient = new OpenFgaClient({ const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; const fgaClient = new OpenFgaClient({ - apiScheme: OPENFGA_API_SCHEME, // optional, defaults to "https" - apiHost: OPENFGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) - storeId: OPENFGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` - authorizationModelId: OPENFGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request + apiScheme: process.env.FGA_API_SCHEME, // optional, defaults to "https" + apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) + storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` + authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request credentials: { method: CredentialsMethod.ClientCredentials, config: { - apiTokenIssuer: OPENFGA_API_TOKEN_ISSUER, - apiAudience: OPENFGA_API_AUDIENCE, - clientId: OPENFGA_CLIENT_ID, - clientSecret: OPENFGA_CLIENT_SECRET, + apiTokenIssuer: process.env.FGA_API_TOKEN_ISSUER, + apiAudience: process.env.FGA_API_AUDIENCE, + clientId: process.env.FGA_CLIENT_ID, + clientSecret: process.env.FGA_CLIENT_SECRET, } } }); diff --git a/configuration.ts b/configuration.ts index 0dbdfd8..b31269d 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.2.10"; +const DEFAULT_USER_AGENT = "openfga-sdk js/0.3.0"; export interface RetryParams { maxRetry?: number; @@ -67,7 +67,7 @@ export class Configuration { * @type {string} * @memberof Configuration */ - private static sdkVersion = "0.2.10"; + private static sdkVersion = "0.3.0"; /** * provide scheme (e.g. `https`) diff --git a/package-lock.json b/package-lock.json index 15bdf8d..b857f70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openfga/sdk", - "version": "0.2.10", + "version": "0.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@openfga/sdk", - "version": "0.2.10", + "version": "0.3.0", "license": "Apache-2.0", "dependencies": { "axios": "^1.6.2", diff --git a/package.json b/package.json index 591282d..96f008d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openfga/sdk", - "version": "0.2.10", + "version": "0.3.0", "description": "JavaScript and Node.js SDK for OpenFGA", "author": "OpenFGA", "keywords": [