Skip to content

Commit

Permalink
feat(application): Update REST API for advanced applications. (#168)
Browse files Browse the repository at this point in the history
* feat(application): Update REST API for advanced applications.

Relates to [BPM-94](https://bonitasoft.atlassian.net/browse/BPM-94)
  • Loading branch information
vhemery authored May 21, 2024
1 parent 21c17f2 commit 9c9c698
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 62 deletions.
53 changes: 53 additions & 0 deletions openapi/components/schemas/AbstractApplication.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
type: object
properties:
# advanced is in the children schemas to ensure it uses the correct constant value
createdBy:
description: Author user ID
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
creationDate:
description: creation date of the application
type: string
description:
description: description of the application
type: string
displayName:
description: display name of the application
type: string
id:
description: id of the application
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
lastUpdateDate:
description: last update date of the application
type: string
profileId:
description: profile authorized to access this application
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
token:
description: token of the application used to build the application URL
type: string
updatedBy:
description: Last updating user ID
type: string
version:
description: version of the application
type: string
state:
description: application state
type: string
enum: [ ACTIVATED, DEACTIVATED ]
visibility:
description: visibility of the Application. This value is purely indicative, changing it in the application object won't change the accessibility to the actual application.
enum: [ ALL, TECHNICAL_USER, RESTRICTED ]
x-enumDescriptions:
ALL: Everyone can use the application
TECHNICAL_USER: Only the technical user can use the application
RESTRICTED: Access to the application is determined by the user profile
editable:
description: Indicates whether the application can be modified
type: boolean
28 changes: 28 additions & 0 deletions openapi/components/schemas/AdvancedApplication.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
title: Advanced application
description: Contains the meta information of an advanced Bonita Living Application.
allOf:
- type: object
properties:
advanced:
description: true for an advanced application
type: boolean
enum: [ true ]
- $ref: ./AbstractApplication.yaml
- type: object
description: Contains the meta information of an advanced Bonita Living Application.
example:
id: "306"
advanced: true
creationDate: "1411548289900"
icon: ""
createdBy": "1"
profileId: "2"
description: "My advanced application description"
token: "myadvapp"
state: "ACTIVATED"
displayName: "My advanced app"
updatedBy: "1"
visibility: "ALL"
editable: true
lastUpdateDate: "1411548289900"
version: "1.0"
60 changes: 3 additions & 57 deletions openapi/components/schemas/Application.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,3 @@
type: object
properties:
createdBy:
description: Author user ID
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
creationDate:
description: creation date of the application
type: string
description:
description: description of the application
type: string
displayName:
description: display name of the application
type: string
homePageId:
description: id of the application page used as the home page
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
id:
description: id of the application
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
lastUpdateDate:
description: last update date of the application
type: string
profileId:
description: profile authorized to access this application
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
token:
description: token of the application used to build the application URL
type: string
updatedBy:
description: Last updating user ID
type: string
version:
description: version of the application
type: string
example:
id: "305"
creationDate: "1411548289900"
iconPath: ""
createdBy": "1"
profileId: "2"
description: "My application description"
token: "myapp"
state: "DEACTIVATED"
displayName: "My app"
updatedBy: "1"
lastUpdateDate: "1411548289900"
version: "1.0"
homePageId: "-1"
oneOf:
- $ref: ./AdvancedApplication.yaml
- $ref: ./LegacyApplication.yaml
47 changes: 47 additions & 0 deletions openapi/components/schemas/LegacyApplication.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
title: Legacy application
description: Contains the meta information of a legacy Bonita Living Application.
allOf:
- type: object
properties:
advanced:
description: false for a legacy application
type: boolean
enum: [ false ]
- $ref: ./AbstractApplication.yaml
- type: object
description: Contains the meta information of a legacy Bonita Living Application.
properties:
homePageId:
description: id of the application page used as the home page
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
layoutId:
description: id of the layout used by the application
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
themeId:
description: id of the theme used by the application
type: string
maxLength: 250
pattern: '^[A-Za-z0-9\_\-\.]{0,250}$'
example:
id: "305"
advanced: false
creationDate: "1411548289900"
icon: ""
createdBy": "1"
profileId: "2"
description: "My application description"
token: "myapp"
state: "DEACTIVATED"
displayName: "My app"
updatedBy: "1"
visibility: "ALL"
editable: true
lastUpdateDate: "1411548289900"
version: "1.0"
homePageId: "26"
themeId: "1"
layoutId: "3"
42 changes: 38 additions & 4 deletions openapi/paths/API@[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ get:
description: |
Finds living applications with pagination params and filters
- can order on `id`,`creationDate`, `createdBy`, `profileId`, `token`, `displayName`, `updatedBy`, `lastUpdateDate`, `version`
- can search on `token`, `displayName`, `version`
- can filter on `token`, `displayName`, `version`, `profileId`, `creationDate`, `createdBy`, `updatedBy` , `lastUpdateDate`, `userId`
- can order on `id`,`creationDate`, `createdBy`, `profileId`, `token`, `displayName`, `updatedBy`, `lastUpdateDate`, `version`, `advanced`
- can search on `token`, `displayName`, `version`, `advanced`
- can filter on `token`, `displayName`, `version`, `advanced`, `profileId`, `creationDate`, `createdBy`, `updatedBy` , `lastUpdateDate`, `userId`
operationId: searchApplications
parameters:
Expand All @@ -31,6 +31,40 @@ get:
type: array
items:
$ref: '../components/schemas/Application.yaml'
example:
- id: "306"
advanced: true
creationDate: "1411548289900"
icon: ""
createdBy": "1"
profileId: "2"
description: "My advanced application description"
token: "myadvapp"
state: "ACTIVATED"
displayName: "My advanced app"
updatedBy: "1"
visibility: "ALL"
editable: true
lastUpdateDate: "1411548289900"
version: "1.0"
- id: "305"
advanced: false
creationDate: "1411548289900"
icon: ""
createdBy": "1"
profileId: "2"
description: "My application description"
token: "myapp"
state: "DEACTIVATED"
displayName: "My app"
updatedBy: "1"
visibility: "ALL"
editable: true
lastUpdateDate: "1411548289900"
version: "1.0"
homePageId: "26"
themeId: "1"
layoutId: "3"
'401':
$ref: '../components/responses/Unauthorized.yaml'
'403':
Expand Down Expand Up @@ -61,7 +95,7 @@ post:
content:
application/json:
schema:
$ref: '../components/schemas/Application.yaml'
$ref: '../components/schemas/LegacyApplication.yaml'
description: "Success "
'401':
$ref: '../components/responses/Unauthorized.yaml'
Expand Down
2 changes: 1 addition & 1 deletion openapi/paths/API@living@application@{id}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ put:
content:
application/json:
schema:
$ref: '../components/schemas/Application.yaml'
$ref: '../components/schemas/LegacyApplication.yaml'
description: "Success "
'401':
$ref: '../components/responses/Unauthorized.yaml'
Expand Down

0 comments on commit 9c9c698

Please sign in to comment.