@forge/migrations 0.5.1 → 0.6.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @forge/migrations
2
2
 
3
+ ## 0.6.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - e45cec5: Removing references to S3Key
8
+
9
+ ## 0.5.2-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - ab8ce9b: Update readme for migrations library
14
+
3
15
  ## 0.5.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Forge Migrations
2
2
 
3
- API methods exposed to perform app migrations in Forge apps. These include methods to simplify calls to app migration platform.
3
+ 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.
4
4
 
5
5
  ## Requirements
6
6
 
@@ -8,15 +8,96 @@ See [Set up Forge](https://developer.atlassian.com/platform/forge/set-up-forge/)
8
8
 
9
9
  ## Usage
10
10
 
11
- In your Forge app, include the following:
11
+ To consume the migrations module, add the following dependency to `package.json`:
12
12
 
13
+ ``` json
14
+ "@forge/migrations": "0.5.0"
13
15
  ```
14
16
 
17
+ In your Forge app, include the following:
18
+
19
+ ``` javascript
15
20
  import migration from '@forge/migrations';
21
+ ```
22
+
23
+ ## Features
24
+
25
+ The migration modules contains the below APIs which include methods that assist with migration related functions:
26
+
27
+
28
+
29
+ ### Retrieve all uploaded S3 keys
16
30
 
31
+ Returns the set of all S3 keys for a particular `transferId`
32
+
33
+ ``` javascript
34
+ getAppDataList: (transferId: string) => Promise<AppDataListResponse>;
17
35
  ```
18
36
 
19
37
 
38
+ ### Retrieve uploaded file contents
39
+
40
+ Returns the contents of a S3 file, given its `s3Key`, used in conjunction with `getAppDataList` to retrieve uploaded file data
41
+
42
+ ``` javascript
43
+ getAppDataPayload: (s3Key: string) => Promise<APIResponse>;
44
+ ```
45
+
46
+
47
+ ### Retrieve Containers
48
+
49
+ Returns a set of containers with a specified `containerType`.
50
+
51
+ These are the valid values for `containerType`:
52
+ - `ConfluenceSpace`
53
+ - `JiraProject`
54
+ - `Site`
55
+
56
+ ``` javascript
57
+ getContainers: (transferId: string, containerType: string) => DefaultQueryBuilder;
58
+ ```
59
+
60
+ ### Retrieve mappings
61
+
62
+ Returns all mappings for a particular [namespace](https://developer.atlassian.com/platform/app-migration/mappings/#mappings-namespaces-and-entities) for the scope of this app only.
63
+
64
+ ``` javascript
65
+ getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<MappingResponse>;
66
+ ```
67
+
68
+ Returns a paginated set of mappings for a particular [namespace](https://developer.atlassian.com/platform/app-migration/mappings/#mappings-namespaces-and-entities)
69
+
70
+ ``` javascript
71
+ getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
72
+ ```
73
+
74
+ With a response in the following format:
75
+
76
+ ``` json
77
+ {
78
+ "results": [
79
+ {
80
+ "key": "10104",
81
+ "value": "10009"
82
+ },
83
+ {
84
+ "key": "10107",
85
+ "value": "10006"
86
+ }
87
+ ]
88
+ }
89
+ ```
90
+
91
+ ### Updating progress of migration
92
+
93
+ ``` javascript
94
+ messageProcessed: (transferId: string, messageId: string) => Promise<void>;
95
+ ```
96
+
97
+ Required to update the status of migrations. If this is not called within 15 minutes, then the migration will be deemed as `TIMED_OUT`
98
+
99
+ See [P2 to Forge Migrations](https://developer.atlassian.com/platform/app-migration/tutorials/connect-vs-forge-migrations/#p2-to-forge-migrations,-for-connect-developers) for more information
100
+
20
101
  ## Support
21
102
 
22
103
  See [Get help](https://developer.atlassian.com/platform/forge/get-help/) for how to get help and provide feedback.
@@ -9,7 +9,7 @@ export interface MappingResponse {
9
9
  result: Map<string, string>;
10
10
  }
11
11
  export interface AppData {
12
- s3Key: string;
12
+ key: string;
13
13
  label: string;
14
14
  }
15
15
  export interface AppDataListResponse {
@@ -1 +1 @@
1
- {"version":3,"file":"migration-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package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/migrations",
3
- "version": "0.5.1",
3
+ "version": "0.6.0-next.1",
4
4
  "description": "App migration methods for Forge app",
5
5
  "main": "out/index.js",
6
6
  "scripts": {