From 791ba592f58f955670ee69637f44eb83ebcda746 Mon Sep 17 00:00:00 2001 From: "Jay (Work)" Date: Wed, 3 Apr 2024 19:17:40 -0400 Subject: [PATCH] adding timer --- package.json | 2 +- schema.json | 10 ++++++++++ src/datasource.ts | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2afd411..36c52d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "a3-oauth-powerbi-datasource", - "version": "1.0.0", + "version": "1.0.1", "description": "A datasource which handles OAuth for Power BI embed", "main": "src/index.ts", "license": "MIT", diff --git a/schema.json b/schema.json index eb5680c..bd78a1a 100644 --- a/schema.json +++ b/schema.json @@ -23,7 +23,17 @@ "query": { "read": { "type": "json" + }, + "timer": { + "type": "fields", + "fields": { + "timer": { + "type": "number", + "required": true + } + } } } + } } \ No newline at end of file diff --git a/src/datasource.ts b/src/datasource.ts index ed172f7..ad0e2df 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -72,6 +72,12 @@ class CustomIntegration implements IntegrationBase { embedToken["servicePrincipalAccessToken"]=accessToken return embedToken } + + async timer(query: { timer: number }){ + await new Promise(r => setTimeout(r, query.timer)); + return 'Complete' + + } } export default CustomIntegration