From 31801caec6bea0e8b295ea6a9ec54ca1d8e08d16 Mon Sep 17 00:00:00 2001 From: Kevin <72702438+kevinshahfws@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:23:53 -0400 Subject: [PATCH] feat: Added optional parameter 'force' in usergrants.request (#186) * feat: Added optional parameter 'force' in usergrants.request * Addressed review comments --- package-lock.json | 4 +-- src/openrpc/user_grants.json | 59 +++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d93459789..3972dae37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16855,7 +16855,7 @@ }, "src/sdks/core": { "name": "@firebolt-js/sdk", - "version": "0.17.0", + "version": "0.17.1", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", @@ -16865,7 +16865,7 @@ }, "src/sdks/manage": { "name": "@firebolt-js/manage-sdk", - "version": "0.17.0", + "version": "0.17.1", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", diff --git a/src/openrpc/user_grants.json b/src/openrpc/user_grants.json index 789fe4461..fcfe8b1c0 100644 --- a/src/openrpc/user_grants.json +++ b/src/openrpc/user_grants.json @@ -391,6 +391,14 @@ "minItems": 1 }, "required": true + }, + { + "name": "options", + "summary": "Request options", + "schema": { + "$ref": "#/components/schemas/RequestOptions" + }, + "required": false } ], "result": { @@ -405,7 +413,7 @@ }, "examples": [ { - "name": "Default result", + "name": "Default result #1", "params": [ { "name": "appId", @@ -436,6 +444,45 @@ } ] } + }, + { + "name": "Default result #2", + "params": [ + { + "name": "appId", + "value": "certapp" + }, + { + "name": "permissions", + "value": [ + { + "role": "use", + "capability": "xrn:firebolt:capability:localization:postal-code" + } + ] + }, + { + "name": "options", + "value": { + "force": true + } + } + ], + "result": { + "name": "defaultResult", + "value": [ + { + "app": { + "id": "certapp", + "title": "Certification App" + }, + "state": "granted", + "capability": "xrn:firebolt:capability:localization:postal-code", + "role": "use", + "lifespan": "powerActive" + } + ] + } } ] } @@ -528,6 +575,16 @@ }, "additionalProperties": false, "required": [] + }, + "RequestOptions": { + "title": "RequestOptions", + "type": "object", + "properties": { + "force": { + "type": "boolean", + "description": "Whether to force for user grant even if the previous decision stored" + } + } } } }