Skip to content

Commit 80069d2

Browse files
author
Marco LUCARELLA
committed
Update global var
1 parent 21d1dad commit 80069d2

File tree

8 files changed

+66
-17
lines changed

8 files changed

+66
-17
lines changed

docs-gen/docs/api/api-account.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
# API Account
5+
6+
- `$ji.account.getAccountByAlias(alias: string)`
7+
- `$ji.account.getAccountByHost(host: string)`

docs-gen/docs/api/api-base.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
# API Base
5+
6+
- `$ji.base.getIssue(issueKey: string, options: { fields?: string[], account?: IJiraIssueAccountSettings } = {})`
7+
- `$ji.base.getSearchResults(query: string, options: { limit?: number, fields?: string[], account?: IJiraIssueAccountSettings } = {})`
8+
- `$ji.base.getDevStatus(issueId: string, options: { account?: IJiraIssueAccountSettings } = {})`
9+
- `$ji.base.getBoards(projectKeyOrId: string, options: { limit?: number, account?: IJiraIssueAccountSettings } = {})`
10+
- `$ji.base.getSprints(boardId: number, options: { limit?: number, state?: ESprintState[], account?: IJiraIssueAccountSettings } = {})`
11+
- `$ji.base.getLoggedUser(account: IJiraIssueAccountSettings = null)`

docs-gen/docs/api/api-defaulted.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
# API Defaulted
5+
6+
- `$ji.defaulted.getIssue(issueKey: string, options: { fields?: string[], account?: IJiraIssueAccountSettings } = {})`
7+
- `$ji.defaulted.getSearchResults(query: string, options: { limit?: number, fields?: string[], account?: IJiraIssueAccountSettings } = {})`

docs-gen/docs/api/api-examples.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
# API Examples
5+
6+

docs-gen/docs/api/api-introduction.md

+19-16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
sidebar_position: 1
3+
---
14
# API Introduction
25

36
The plugin exposes some API that can be used by other plugins that provide JavaScript access.
@@ -14,7 +17,7 @@ this.app.plugins.plugins['obsidian-jira-issue'].api
1417

1518
or the global variable:
1619
```js
17-
$JI
20+
$ji
1821
```
1922

2023

@@ -26,40 +29,40 @@ The API are divided in few categories to help the navigation.
2629
This category contains all the functions to directly access the Jira API.
2730
The response is cached in order to reduce the network load.
2831

29-
- `$JI.base.getIssue(issueKey: string, options: { fields?: string[], account?: IJiraIssueAccountSettings } = {})`
30-
- `$JI.base.getSearchResults(query: string, options: { limit?: number, fields?: string[], account?: IJiraIssueAccountSettings } = {})`
31-
- `$JI.base.getDevStatus(issueId: string, options: { account?: IJiraIssueAccountSettings } = {})`
32-
- `$JI.base.getBoards(projectKeyOrId: string, options: { limit?: number, account?: IJiraIssueAccountSettings } = {})`
33-
- `$JI.base.getSprints(boardId: number, options: { limit?: number, state?: ESprintState[], account?: IJiraIssueAccountSettings } = {})`
34-
- `$JI.base.getLoggedUser(account: IJiraIssueAccountSettings = null)`
32+
- `$ji.base.getIssue(issueKey: string, options: { fields?: string[], account?: IJiraIssueAccountSettings } = {})`
33+
- `$ji.base.getSearchResults(query: string, options: { limit?: number, fields?: string[], account?: IJiraIssueAccountSettings } = {})`
34+
- `$ji.base.getDevStatus(issueId: string, options: { account?: IJiraIssueAccountSettings } = {})`
35+
- `$ji.base.getBoards(projectKeyOrId: string, options: { limit?: number, account?: IJiraIssueAccountSettings } = {})`
36+
- `$ji.base.getSprints(boardId: number, options: { limit?: number, state?: ESprintState[], account?: IJiraIssueAccountSettings } = {})`
37+
- `$ji.base.getLoggedUser(account: IJiraIssueAccountSettings = null)`
3538

3639
### API Category - Defaulted
3740
This category contains few functions to directly access the Jira API. The difference with the [Base](#api-category---base) section is the format of the response where all the fields have been set to a default value in case the Jira API call replied with some missing data. This type of API allows you to simplify the data access because you don't need to check if the fields exists.
3841

3942

40-
- `$JI.defaulted.getIssue(issueKey: string, options: { fields?: string[], account?: IJiraIssueAccountSettings } = {})`
41-
- `$JI.defaulted.getSearchResults(query: string, options: { limit?: number, fields?: string[], account?: IJiraIssueAccountSettings } = {})`
43+
- `$ji.defaulted.getIssue(issueKey: string, options: { fields?: string[], account?: IJiraIssueAccountSettings } = {})`
44+
- `$ji.defaulted.getSearchResults(query: string, options: { limit?: number, fields?: string[], account?: IJiraIssueAccountSettings } = {})`
4245

4346
### API Category - Macro
4447

4548
This category contains functions that perform few Jira API call to get some advanced information. This category is designed to help the user access some data with few steps.
4649

4750
Please open an Issue on GitHub to request more of this functions.
4851

49-
- `$JI.macro.getActiveSprint(projectKeyOrId: string)`
50-
- `$JI.macro.getActiveSprintName(projectKeyOrId: string)`
51-
- `$JI.macro.getWorkLogBySprint(projectKeyOrId: string, sprint: IJiraSprint)`
52-
- `$JI.macro.getWorkLogByDates(projectKeyOrId: string, startDate: string, endDate: string = 'now()')`
52+
- `$ji.macro.getActiveSprint(projectKeyOrId: string)`
53+
- `$ji.macro.getActiveSprintName(projectKeyOrId: string)`
54+
- `$ji.macro.getWorkLogBySprint(projectKeyOrId: string, sprint: IJiraSprint)`
55+
- `$ji.macro.getWorkLogByDates(projectKeyOrId: string, startDate: string, endDate: string = 'now()')`
5356

5457
### API Category - Account
5558

5659
This category contains functions to access the accounts data stored in the Obsidian settings of this plugin.
5760

58-
- `$JI.account.getAccountByAlias(alias: string)`
59-
- `$JI.account.getAccountByHost(host: string)`
61+
- `$ji.account.getAccountByAlias(alias: string)`
62+
- `$ji.account.getAccountByHost(host: string)`
6063

6164
### API Category - Util
6265

6366
This category contains generic functions.
6467

65-
- `$JI.util.clearCache()`
68+
- `$ji.util.clearCache()`

docs-gen/docs/api/api-macro.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
# API Macro
5+
6+
- `$ji.macro.getActiveSprint(projectKeyOrId: string)`
7+
- `$ji.macro.getActiveSprintName(projectKeyOrId: string)`
8+
- `$ji.macro.getWorkLogBySprint(projectKeyOrId: string, sprint: IJiraSprint)`
9+
- `$ji.macro.getWorkLogByDates(projectKeyOrId: string, startDate: string, endDate: string = 'now()')`

docs-gen/docs/api/api-util.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
# API Util
5+
6+
- `$ji.util.clearCache()`

src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default class JiraIssuePlugin extends Plugin {
103103

104104
private registerAPI() {
105105
// @ts-ignore
106-
window.$JI = API
106+
window.$ji = API
107107
}
108108
}
109109

0 commit comments

Comments
 (0)