Skip to content

Commit

Permalink
version 3 api added
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRefactoring committed Jun 1, 2023
1 parent c9ac50e commit 6adcdfe
Show file tree
Hide file tree
Showing 50 changed files with 1,394 additions and 448 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: CI

on: [push]
name: ci
on: push

jobs:
build:
Expand All @@ -17,7 +16,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm ci --force
- name: Create .env file
run: |
touch .env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
run: npm ci --force
- name: Create .env file
run: |
touch .env
Expand Down
640 changes: 281 additions & 359 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,29 +68,29 @@
"@types/express": "^4.17.17",
"@types/node": "^10.17.60",
"@types/oauth": "^0.9.1",
"@types/sinon": "^10.0.14",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"ava": "^5.2.0",
"dotenv": "^16.0.3",
"eslint": "^8.40.0",
"@types/sinon": "^10.0.15",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"ava": "^5.3.0",
"dotenv": "^16.1.3",
"eslint": "^8.41.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"prettier": "^2.8.8",
"prettier-plugin-jsdoc": "^0.4.2",
"sinon": "^15.0.4",
"sinon": "^15.1.0",
"ts-node": "^10.9.1",
"typedoc": "^0.24.6",
"typedoc": "^0.24.7",
"typedoc-plugin-extras": "^2.3.3",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"dependencies": {
"atlassian-jwt": "^2.0.2",
"axios": "^1.4.0",
"form-data": "^4.0.0",
"oauth": "^0.10.0",
"tslib": "^2.5.0"
"tslib": "^2.5.2"
}
}
75 changes: 75 additions & 0 deletions src/version3/appProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,79 @@ export class AppProperties {

return this.client.sendRequest(config, callback);
}

/**
* Sets the value of a Forge app's property. These values can be retrieved in [Jira
* expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context
* variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables).
*
* For other use cases, use the [Storage
* API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/).
*
* The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The
* maximum length is 32768 characters.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only
* Forge apps can make this request.
*/
async putAppProperty<T = Models.OperationMessage>(
parameters: Parameters.PutAppProperty,
callback: Callback<T>,
): Promise<void>;
/**
* Sets the value of a Forge app's property. These values can be retrieved in [Jira
* expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context
* variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables).
*
* For other use cases, use the [Storage
* API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/).
*
* The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The
* maximum length is 32768 characters.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only
* Forge apps can make this request.
*/
async putAppProperty<T = Models.OperationMessage>(
parameters: Parameters.PutAppProperty,
callback?: never,
): Promise<T>;
async putAppProperty<T = Models.OperationMessage>(
parameters: Parameters.PutAppProperty,
callback?: Callback<T>,
): Promise<void | T> {
// todo
const config: RequestConfig = {
url: `/rest/forge/1/app/properties/${parameters.propertyKey}`,
method: 'PUT',
};

return this.client.sendRequest(config, callback);
}

/**
* Deletes a Forge app's property.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only
* Forge apps can make this request.
*/
async deleteAppProperty<T = void>(parameters: Parameters.DeleteAppProperty, callback: Callback<T>): Promise<void>;
/**
* Deletes a Forge app's property.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only
* Forge apps can make this request.
*/
async deleteAppProperty<T = void>(parameters: Parameters.DeleteAppProperty, callback?: never): Promise<T>;
async deleteAppProperty<T = void>(
parameters: Parameters.DeleteAppProperty,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/forge/1/app/properties/${parameters.propertyKey}`,
method: 'DELETE',
};

return this.client.sendRequest(config, callback);
}
}
2 changes: 2 additions & 0 deletions src/version3/client/version3Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
JiraExpressions,
JiraSettings,
JQL,
JqlFunctionsApps,
Labels,
LicenseMetrics,
Myself,
Expand Down Expand Up @@ -136,6 +137,7 @@ export class Version3Client extends BaseClient {
jiraExpressions = new JiraExpressions(this);
jiraSettings = new JiraSettings(this);
jql = new JQL(this);
jqlFunctionsApps = new JqlFunctionsApps(this);
labels = new Labels(this);
licenseMetrics = new LicenseMetrics(this);
myself = new Myself(this);
Expand Down
1 change: 1 addition & 0 deletions src/version3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export * from './issueWorklogs';
export * from './jiraExpressions';
export * from './jiraSettings';
export * from './jQL';
export * from './jqlFunctionsApps';
export * from './labels';
export * from './licenseMetrics';
export * from './myself';
Expand Down
Loading

0 comments on commit 6adcdfe

Please sign in to comment.