Skip to content

Commit

Permalink
adding timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay (Work) authored and Jay (Work) committed Apr 3, 2024
1 parent 9a7c092 commit 791ba59
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 10 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@
"query": {
"read": {
"type": "json"
},
"timer": {
"type": "fields",
"fields": {
"timer": {
"type": "number",
"required": true
}
}
}
}

}
}
6 changes: 6 additions & 0 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 791ba59

Please sign in to comment.