@forge/migrations
v1.0.4
Published
App migration methods for Forge app
Downloads
509
Keywords
Readme
Forge Migrations
API methods exposed to perform app migrations in Forge apps. These methods will aid in manipulating and retrieving data related to the app migration, to allow vendors to perform any additional migration related actions.
Requirements
See Set up Forge for details of the software required to develop Forge apps.
Usage
To consume the migrations module, add the following dependency to package.json
:
"@forge/migrations": "0.5.0"
In your Forge app, include the following:
import migration from '@forge/migrations';
Features
The migration modules contains the below APIs which include methods that assist with migration related functions:
Retrieve all uploaded S3 keys
Returns the set of all S3 keys for a particular transferId
getAppDataList: (transferId: string) => Promise<AppDataListResponse>;
Retrieve uploaded file contents
Returns the contents of a S3 file, given its s3Key
, used in conjunction with getAppDataList
to retrieve uploaded file data
getAppDataPayload: (s3Key: string) => Promise<APIResponse>;
Retrieve Containers
Returns a set of containers with a specified containerType
.
These are the valid values for containerType
:
ConfluenceSpace
JiraProject
Site
getContainers: (transferId: string, containerType: string) => DefaultQueryBuilder;
Retrieve mappings
Returns all mappings for a particular namespace for the scope of this app only.
getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<MappingResponse>;
Returns a paginated set of mappings for a particular namespace
getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
With a response in the following format:
{
"results": [
{
"key": "10104",
"value": "10009"
},
{
"key": "10107",
"value": "10006"
}
]
}
Updating progress of migration
messageProcessed: (transferId: string, messageId: string) => Promise<void>;
Required to update the status of migrations. If this is not called within 15 minutes, then the migration will be deemed as TIMED_OUT
See P2 to Forge Migrations for more information
Support
See Get help for how to get help and provide feedback.