Workflows
Version Assignment
Offer an interface for users to modify their application version.
Allowing accounts to select versions
The app schema contains versions relevant to the accounts domain. The domains.[session.account.domain_id]
is an array of version IDs and their values contain the version information.
// app schema object
{
...
"dom_1234567890": {
"ver_1234567890": {
"title": "Basic",
"description": "Everything needed to get started."
},
...
},
...
}
The following will provide values for a group of radios for allowing selection of the application version.
// extracting app schema values for account versioning options
Object.keys(domains[session.account.domain_id].versions).map((id) => {
console.log({
"active": session.account.version_id === id,
"title": domains[session.account.domain_id].versions[id].title,
"description": domains[session.account.domain_id].versions[id].description
});
});
Request
Submit the selected version ID to the API for processing.
POST /v1/account/versions/:version_id
Response
The selected Version object.
// version object
{
"id": "ver_1234567890",
"title": "App",
"description": "Version for the main application.",
"tag": "v1",
"is_default": 1,
"status": "active",
"features": [
{
"id": "fea_1234567890",
"title": "Account",
"human_id": "account"
},
...
]
}
Property | Type | Description |
---|---|---|
id | String | The version ID. |
title | String | The title of the version. |
description | String | The description iof the version. |
tag | String | The sort tag associated with the version. |
is_default | Boolean | Whether the version is the default when signing up. |
status | String | The status of the version (active or inactive ). An inactive version haa no accounts subscribed. |
fearures | Array | An array of features included in the version. |
features.id | String | The feature ID. |
features.title | String | The title of the feature. |
features.human_id | String | The human-readable ID. |