From acd53b9762ee21d02d77ffb9e275d4f8b1c4b1af Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 19 Mar 2024 12:46:15 +0000 Subject: [PATCH 1/2] feat: add support for modular models metadata --- api.ts | 2 ++ apiModel.ts | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/api.ts b/api.ts index f6f280f..6e5e7ef 100644 --- a/api.ts +++ b/api.ts @@ -38,6 +38,7 @@ import { CheckResponse, Computed, Condition, + ConditionMetadata, ConditionParamTypeRef, ContextualTupleKeys, CreateStoreRequest, @@ -71,6 +72,7 @@ import { RelationMetadata, RelationReference, RelationshipCondition, + SourceInfo, Status, Store, Tuple, diff --git a/apiModel.ts b/apiModel.ts index e40185a..eb19b5d 100644 --- a/apiModel.ts +++ b/apiModel.ts @@ -240,6 +240,31 @@ export interface Condition { * @memberof Condition */ parameters?: { [key: string]: ConditionParamTypeRef; }; + /** + * + * @type {ConditionMetadata} + * @memberof Condition + */ + metadata?: ConditionMetadata; +} +/** + * + * @export + * @interface ConditionMetadata + */ +export interface ConditionMetadata { + /** + * + * @type {string} + * @memberof ConditionMetadata + */ + module?: string; + /** + * + * @type {SourceInfo} + * @memberof ConditionMetadata + */ + source_info?: SourceInfo; } /** * @@ -636,6 +661,18 @@ export interface Metadata { * @memberof Metadata */ relations?: { [key: string]: RelationMetadata; }; + /** + * + * @type {string} + * @memberof Metadata + */ + module?: string; + /** + * + * @type {SourceInfo} + * @memberof Metadata + */ + source_info?: SourceInfo; } /** * @@ -901,6 +938,18 @@ export interface RelationMetadata { * @memberof RelationMetadata */ directly_related_user_types?: Array; + /** + * + * @type {string} + * @memberof RelationMetadata + */ + module?: string; + /** + * + * @type {SourceInfo} + * @memberof RelationMetadata + */ + source_info?: SourceInfo; } /** * RelationReference represents a relation of a particular object type (e.g. \'document#viewer\'). @@ -952,6 +1001,19 @@ export interface RelationshipCondition { */ context?: object; } +/** + * + * @export + * @interface SourceInfo + */ +export interface SourceInfo { + /** + * + * @type {string} + * @memberof SourceInfo + */ + file?: string; +} /** * * @export From e07b288ac2c61f86248fedad7489f9779f5a3751 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 19 Mar 2024 12:55:19 +0000 Subject: [PATCH 2/2] release: v0.3.5 --- CHANGELOG.md | 6 ++++++ configuration.ts | 4 ++-- example/README.md | 2 +- example/example1/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a781886..2000866 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.3.5 + +### [0.3.5](https://github.com/openfga/js-sdk/compare/v0.3.4...v0.3.5) (2024-03-19) + +- feat: add support for modular models metadata + ## v0.3.4 ### [0.3.4](https://github.com/openfga/js-sdk/compare/v0.3.3...v0.3.4) (2024-03-15) diff --git a/configuration.ts b/configuration.ts index 3799667..85408ff 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.4"; +const DEFAULT_USER_AGENT = "openfga-sdk js/0.3.5"; export interface RetryParams { maxRetry?: number; @@ -74,7 +74,7 @@ export class Configuration { * @type {string} * @memberof Configuration */ - private static sdkVersion = "0.3.4"; + private static sdkVersion = "0.3.5"; /** * provide the full api URL (e.g. `https://api.fga.example`) diff --git a/example/README.md b/example/README.md index e81f82d..924be45 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.4" + "@openfga/sdk": "^0.3.5" } ``` to a `file:` reference like below diff --git a/example/example1/package.json b/example/example1/package.json index 6830e23..1f36dd5 100644 --- a/example/example1/package.json +++ b/example/example1/package.json @@ -9,7 +9,7 @@ "start": "node example1.mjs" }, "dependencies": { - "@openfga/sdk": "^0.3.4" + "@openfga/sdk": "^0.3.5" }, "engines": { "node": ">=16.13.0" diff --git a/package-lock.json b/package-lock.json index 81b1570..a2cde83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openfga/sdk", - "version": "0.3.4", + "version": "0.3.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@openfga/sdk", - "version": "0.3.4", + "version": "0.3.5", "license": "Apache-2.0", "dependencies": { "axios": "^1.6.7", diff --git a/package.json b/package.json index ff88c25..5763601 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openfga/sdk", - "version": "0.3.4", + "version": "0.3.5", "description": "JavaScript and Node.js SDK for OpenFGA", "author": "OpenFGA", "keywords": [