@forge/migrations 0.0.0 → 0.1.1-next.0

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 ADDED
@@ -0,0 +1,20 @@
1
+ # @forge/migrations
2
+
3
+ ## 0.1.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b3ee2973]
8
+ - @forge/api@2.7.0-next.0
9
+
10
+ ## 0.1.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 824eea3: Adding 2 paginated endpoints in query format to fetch mappings and container details from app migration platform
15
+
16
+ ## 0.1.0-next.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 824eea3: Adding 2 paginated endpoints in query format to fetch mappings and container details from app migration platform
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const migration_1 = require("../migration");
3
+ const errors_1 = require("../migration/errors");
4
4
  describe('APIError', () => {
5
5
  describe('forStatus', () => {
6
6
  it.each([
@@ -10,7 +10,7 @@ describe('APIError', () => {
10
10
  [404, 'Not Found'],
11
11
  [500, 'Internal server error']
12
12
  ])('should contain the correct error message for a code of %s', (status, message) => {
13
- expect(migration_1.APIError.forStatus(status, message).message).toEqual(message);
13
+ expect(errors_1.APIError.forStatus(status, message).message).toEqual(message);
14
14
  });
15
15
  });
16
16
  });
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const errors_1 = require("../migration/errors");
4
5
  const migration_1 = require("../migration");
5
6
  const jest_when_1 = require("jest-when");
6
7
  const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
@@ -63,7 +64,7 @@ describe('migration', () => {
63
64
  });
64
65
  it('should return 403 when sendProgress method called with invalid transferId', async () => {
65
66
  const returnedValue = migration_1.migration.sendProgress(invalidTransferId, progress);
66
- await expect(returnedValue).rejects.toThrow(migration_1.APIError.forStatus(403, 'Forbidden'));
67
+ await expect(returnedValue).rejects.toThrow(errors_1.APIError.forStatus(403, 'Forbidden'));
67
68
  });
68
69
  });
69
70
  describe('getMappingById', () => {
@@ -117,7 +118,7 @@ describe('migration', () => {
117
118
  });
118
119
  it('should return 403 when getMappingById method called with invalid transferId', async () => {
119
120
  const returnedValue = migration_1.migration.getMappingById(invalidTransferId, namespace, keys);
120
- await expect(returnedValue).rejects.toThrow(migration_1.APIError.forStatus(403, 'Forbidden'));
121
+ await expect(returnedValue).rejects.toThrow(errors_1.APIError.forStatus(403, 'Forbidden'));
121
122
  });
122
123
  it('should return MappingResponse except for invalid keys when getMappingById method called with valid transferId', async () => {
123
124
  const returnedValue = await migration_1.migration.getMappingById(transferId, namespace, invalidKeys);
@@ -147,7 +148,7 @@ describe('migration', () => {
147
148
  });
148
149
  it('should return 403 when getAppDataList method called with invalid transferId', async () => {
149
150
  const returnedValue = migration_1.migration.getAppDataList(invalidTransferId);
150
- await expect(returnedValue).rejects.toThrow(migration_1.APIError.forStatus(403, 'Forbidden'));
151
+ await expect(returnedValue).rejects.toThrow(errors_1.APIError.forStatus(403, 'Forbidden'));
151
152
  });
152
153
  });
153
154
  describe('getAppDataPayload', () => {
@@ -177,7 +178,7 @@ describe('migration', () => {
177
178
  });
178
179
  it('should return 403 when getAppDataPayload method called with invalid S3Key', async () => {
179
180
  const returnedValue = migration_1.migration.getAppDataPayload(invalidS3Key);
180
- await expect(returnedValue).rejects.toThrow(migration_1.APIError.forStatus(403, 'Forbidden'));
181
+ await expect(returnedValue).rejects.toThrow(errors_1.APIError.forStatus(403, 'Forbidden'));
181
182
  });
182
183
  });
183
184
  describe('updateFeedback', () => {
@@ -214,7 +215,7 @@ describe('migration', () => {
214
215
  });
215
216
  it('should return 403 when updateFeedback method called with invalid transferId', async () => {
216
217
  const returnedValue = migration_1.migration.updateFeedback(invalidTransferId, feedbackPayload);
217
- await expect(returnedValue).rejects.toThrow(migration_1.APIError.forStatus(403, 'Forbidden'));
218
+ await expect(returnedValue).rejects.toThrow(errors_1.APIError.forStatus(403, 'Forbidden'));
218
219
  });
219
220
  });
220
221
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=query-api.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-api.test.d.ts","sourceRoot":"","sources":["../../src/__test__/query-api.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jest_when_1 = require("jest-when");
4
+ const migration_1 = require("../migration");
5
+ describe('QueryApi', () => {
6
+ const transferId = '521ee36a-b673-3dc6-b60b-12460332c200';
7
+ global.api = {
8
+ asApp: jest.fn().mockReturnValue({
9
+ __requestAtlassian: jest.fn()
10
+ })
11
+ };
12
+ describe('getMappings', () => {
13
+ let expectedMappingsResultMany;
14
+ let expectedMappingsResultManyWithCursor;
15
+ let expectedMappingsResultSingle;
16
+ let lastEntityId;
17
+ beforeAll(() => {
18
+ lastEntityId = 'base64:ZW1haWwvYWRtaW5AZXhhbXBsZS5jb20vNg';
19
+ const mappingsResponse = `{"meta":{"pageSize":5000,"hasNext":false,"lastEntity":"${lastEntityId}"},"items":{"email/admin@example.com":"5a29c4ae20cfc31b0dc0eafe","confluence.userkey/2c9682714db22c7c014db22f51970002":"5a29c4ae20cfc31b0dc0eafe"}}`;
20
+ const mappingsResponseWithoutLastEntity = '{"meta":{"pageSize":5000,"hasNext":false,"lastEntity":null},"items":{"email/admin@example.com":"5a29c4ae20cfc31b0dc0eafe","confluence.userkey/2c9682714db22c7c014db22f51970002":"5a29c4ae20cfc31b0dc0eafe"}}';
21
+ const valueObject = '5a29c4ae20cfc31b0dc0eafe';
22
+ jest_when_1.when(global.api.asApp().__requestAtlassian)
23
+ .calledWith(`/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user&lastEntity=${lastEntityId}`)
24
+ .mockReturnValue({
25
+ status: 200,
26
+ text: jest.fn().mockResolvedValue(mappingsResponseWithoutLastEntity),
27
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponseWithoutLastEntity))
28
+ })
29
+ .calledWith(`/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user`)
30
+ .mockReturnValue({
31
+ status: 200,
32
+ text: jest.fn().mockResolvedValue(mappingsResponse),
33
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponse))
34
+ })
35
+ .calledWith(`/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user&pageSize=1`)
36
+ .mockReturnValue({
37
+ status: 200,
38
+ text: jest.fn().mockResolvedValue(mappingsResponse),
39
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponse))
40
+ })
41
+ .calledWith(`/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user&pageSize=1&lastEntity=${lastEntityId}`)
42
+ .mockReturnValue({
43
+ status: 200,
44
+ text: jest.fn().mockResolvedValue(mappingsResponse),
45
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponse))
46
+ });
47
+ expectedMappingsResultMany = {
48
+ results: [
49
+ {
50
+ key: 'email/admin@example.com',
51
+ value: valueObject
52
+ },
53
+ { key: 'confluence.userkey/2c9682714db22c7c014db22f51970002', value: valueObject }
54
+ ],
55
+ nextCursor: undefined
56
+ };
57
+ expectedMappingsResultManyWithCursor = {
58
+ results: [
59
+ { key: 'email/admin@example.com', value: valueObject },
60
+ { key: 'confluence.userkey/2c9682714db22c7c014db22f51970002', value: valueObject }
61
+ ],
62
+ nextCursor: lastEntityId
63
+ };
64
+ expectedMappingsResultSingle = { key: 'email/admin@example.com', value: valueObject };
65
+ });
66
+ it('should fetch multiple values for getMappings', async () => {
67
+ const results = await migration_1.migration.getMappings(transferId, 'identity:user').getMany();
68
+ expect(results).toEqual(expectedMappingsResultManyWithCursor);
69
+ });
70
+ it('should allow specifying a cursor for getMappings with getMany', async () => {
71
+ const result = await migration_1.migration.getMappings(transferId, 'identity:user').cursor(lastEntityId).getMany();
72
+ expect(result).toEqual(expectedMappingsResultMany);
73
+ });
74
+ it('get single mapping when getMappings called with getOne', async () => {
75
+ const result = await migration_1.migration.getMappings(transferId, 'identity:user').getOne();
76
+ expect(result).toEqual(expectedMappingsResultSingle);
77
+ });
78
+ it('should allow specifying a cursor for getMappings with getOne', async () => {
79
+ const result = await migration_1.migration.getMappings(transferId, 'identity:user').cursor(lastEntityId).getOne();
80
+ expect(result).toEqual(expectedMappingsResultSingle);
81
+ });
82
+ });
83
+ describe('getContainers', () => {
84
+ let expectedResultContainersManyWithCursor;
85
+ let expectedResultContainersManyWithoutCursor;
86
+ let expectedResultContainersSingle;
87
+ let lastEntityId;
88
+ beforeAll(() => {
89
+ lastEntityId = 'db11c8af-c82b-3569-9a11-f288c9cc9535';
90
+ const containersResponse = `{"meta":{"pageSize":0,"hasNext":false,"lastEntity":"${lastEntityId}"},"containers":[{ "key": "TES", "sourceId": "884737", "type": "ConfluenceSpace" }]}`;
91
+ const containersResponseWithoutLastEntity = '{"meta":{"pageSize":0,"hasNext":false,"lastEntity":null},"containers":[{ "key": "TES", "sourceId": "884737", "type": "ConfluenceSpace" }]}';
92
+ expectedResultContainersManyWithCursor = {
93
+ results: [{ key: '0', value: { key: 'TES', sourceId: '884737', type: 'ConfluenceSpace' } }],
94
+ nextCursor: lastEntityId
95
+ };
96
+ expectedResultContainersManyWithoutCursor = {
97
+ results: [{ key: '0', value: { key: 'TES', sourceId: '884737', type: 'ConfluenceSpace' } }],
98
+ nextCursor: undefined
99
+ };
100
+ expectedResultContainersSingle = { key: '0', value: { key: 'TES', sourceId: '884737', type: 'ConfluenceSpace' } };
101
+ jest_when_1.when(global.api.asApp().__requestAtlassian)
102
+ .calledWith(`/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace&lastEntity=${lastEntityId}`)
103
+ .mockReturnValue({
104
+ status: 200,
105
+ text: jest.fn().mockResolvedValue(containersResponseWithoutLastEntity),
106
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponseWithoutLastEntity))
107
+ })
108
+ .calledWith(`/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace`)
109
+ .mockReturnValue({
110
+ status: 200,
111
+ text: jest.fn().mockResolvedValue(containersResponse),
112
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponse))
113
+ })
114
+ .calledWith(`/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace&pageSize=1`)
115
+ .mockReturnValue({
116
+ status: 200,
117
+ text: jest.fn().mockResolvedValue(containersResponse),
118
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponse))
119
+ })
120
+ .calledWith(`/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace&pageSize=1&lastEntity=${lastEntityId}`)
121
+ .mockReturnValue({
122
+ status: 200,
123
+ text: jest.fn().mockResolvedValue(containersResponse),
124
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponse))
125
+ });
126
+ });
127
+ it('should allow specifying a cursor for getContainers with getMany', async () => {
128
+ const result = await migration_1.migration.getContainers(transferId, 'ConfluenceSpace').cursor(lastEntityId).getMany();
129
+ expect(result).toEqual(expectedResultContainersManyWithoutCursor);
130
+ });
131
+ it('should fetch multiple values when getContainers is called with getMany', async () => {
132
+ const result = await migration_1.migration.getContainers(transferId, 'ConfluenceSpace').getMany();
133
+ expect(result).toEqual(expectedResultContainersManyWithCursor);
134
+ });
135
+ it('should allow specifying a cursor for getContainers with getOne', async () => {
136
+ const result = await migration_1.migration.getContainers(transferId, 'ConfluenceSpace').cursor(lastEntityId).getOne();
137
+ expect(result).toEqual(expectedResultContainersSingle);
138
+ });
139
+ it('get single mapping when getContainers called with getOne', async () => {
140
+ const result = await migration_1.migration.getContainers(transferId, 'ConfluenceSpace').getOne();
141
+ expect(result).toEqual(expectedResultContainersSingle);
142
+ });
143
+ });
144
+ });
@@ -1,11 +1,14 @@
1
- import { MigrationAdapter, Progress } from './migration-adaptor';
2
- export { APIError } from './errors';
3
- export declare const getMigrationInstance: (adapter: MigrationAdapter) => {
1
+ import { Migration } from './migration';
2
+ import { Progress } from './migration-adaptor';
3
+ import { DefaultQueryBuilder } from './query-api';
4
+ export declare const getMigrationInstance: (adapter: Migration) => {
4
5
  sendProgress: (transferId: string, progress: Progress) => Promise<void>;
5
6
  getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<import("./migration-adaptor").MappingResponse>;
6
7
  updateFeedback: (transferId: string, feedback: object) => Promise<void>;
7
8
  getAppDataList: (transferId: string) => Promise<import("./migration-adaptor").AppDataListResponse>;
8
9
  getAppDataPayload: (s3Key: string) => Promise<import("node-fetch").Response>;
10
+ getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
11
+ getContainers: (transferId: string, containerType: string) => DefaultQueryBuilder;
9
12
  };
10
13
  export declare const migration: {
11
14
  sendProgress: (transferId: string, progress: Progress) => Promise<void>;
@@ -13,5 +16,7 @@ export declare const migration: {
13
16
  updateFeedback: (transferId: string, feedback: object) => Promise<void>;
14
17
  getAppDataList: (transferId: string) => Promise<import("./migration-adaptor").AppDataListResponse>;
15
18
  getAppDataPayload: (s3Key: string) => Promise<import("node-fetch").Response>;
19
+ getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
20
+ getContainers: (transferId: string, containerType: string) => DefaultQueryBuilder;
16
21
  };
17
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,oBAAoB,YAAa,gBAAgB;+BAE/B,MAAM,YAAY,QAAQ;iCACxB,MAAM,aAAa,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC;iCAE9C,MAAM,YAAY,MAAM;iCACxB,MAAM;+BACR,MAAM;CAEpC,CAAC;AAEF,eAAO,MAAM,SAAS;+BACO,MAAM,YAAY,QAAQ;iCAExB,MAAM,aAAa,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC;iCAE9C,MAAM,YAAY,MAAM;iCAExB,MAAM;+BACR,MAAM;CAClC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,oBAAoB,YAAa,SAAS;+BAExB,MAAM,YAAY,QAAQ;iCACxB,MAAM,aAAa,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC;iCAE9C,MAAM,YAAY,MAAM;iCACxB,MAAM;+BACR,MAAM;8BACP,MAAM,aAAa,MAAM;gCAEvB,MAAM,iBAAiB,MAAM;CAG5D,CAAC;AAEF,eAAO,MAAM,SAAS;+BACO,MAAM,YAAY,QAAQ;iCAExB,MAAM,aAAa,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC;iCAE9C,MAAM,YAAY,MAAM;iCAExB,MAAM;+BACR,MAAM;8BACP,MAAM,aAAa,MAAM;gCAEvB,MAAM,iBAAiB,MAAM;CAE1D,CAAC"}
@@ -2,15 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migration = exports.getMigrationInstance = void 0;
4
4
  const migration_1 = require("./migration");
5
- var errors_1 = require("./errors");
6
- Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return errors_1.APIError; } });
5
+ const query_api_1 = require("./query-api");
7
6
  exports.getMigrationInstance = (adapter) => {
8
7
  return {
9
8
  sendProgress: (transferId, progress) => adapter.sendProgress(transferId, progress),
10
9
  getMappingById: (transferId, namespace, keys) => adapter.getMappingById(transferId, namespace, keys),
11
10
  updateFeedback: (transferId, feedback) => adapter.updateFeedback(transferId, feedback),
12
11
  getAppDataList: (transferId) => adapter.getAppDataList(transferId),
13
- getAppDataPayload: (s3Key) => adapter.getAppDataPayload(s3Key)
12
+ getAppDataPayload: (s3Key) => adapter.getAppDataPayload(s3Key),
13
+ getMappings: (transferId, namespace) => new query_api_1.DefaultQueryBuilder(adapter, { transferId: transferId, namespace: namespace }),
14
+ getContainers: (transferId, containerType) => new query_api_1.DefaultQueryBuilder(adapter, { transferId: transferId, containerType: containerType })
14
15
  };
15
16
  };
16
17
  exports.migration = {
@@ -18,5 +19,7 @@ exports.migration = {
18
19
  getMappingById: (transferId, namespace, keys) => exports.getMigrationInstance(new migration_1.Migration()).getMappingById(transferId, namespace, keys),
19
20
  updateFeedback: (transferId, feedback) => exports.getMigrationInstance(new migration_1.Migration()).updateFeedback(transferId, feedback),
20
21
  getAppDataList: (transferId) => exports.getMigrationInstance(new migration_1.Migration()).getAppDataList(transferId),
21
- getAppDataPayload: (s3Key) => exports.getMigrationInstance(new migration_1.Migration()).getAppDataPayload(s3Key)
22
+ getAppDataPayload: (s3Key) => exports.getMigrationInstance(new migration_1.Migration()).getAppDataPayload(s3Key),
23
+ getMappings: (transferId, namespace) => exports.getMigrationInstance(new migration_1.Migration()).getMappings(transferId, namespace),
24
+ getContainers: (transferId, containerType) => exports.getMigrationInstance(new migration_1.Migration()).getContainers(transferId, containerType)
22
25
  };
@@ -24,4 +24,37 @@ export interface Progress {
24
24
  percent: number;
25
25
  message: string;
26
26
  }
27
+ export interface PaginationMappingResponse {
28
+ meta: PaginationResponseMeta;
29
+ items: Map<string, string>;
30
+ }
31
+ interface PaginationResponseMeta {
32
+ pageSize: number;
33
+ hasNext: boolean;
34
+ lastEntity?: string;
35
+ }
36
+ export interface PaginationContainerResponse {
37
+ containers: Array<object>;
38
+ meta: PaginationResponseMeta;
39
+ }
40
+ export interface ListOptions {
41
+ transferId: string;
42
+ namespace?: string;
43
+ containerType?: string;
44
+ cursor?: string;
45
+ }
46
+ export interface Result {
47
+ key: string;
48
+ value: object;
49
+ }
50
+ export interface ListResults {
51
+ results: Result[];
52
+ nextCursor?: string;
53
+ }
54
+ export interface QueryBuilder {
55
+ cursor(cursor: string): QueryBuilder;
56
+ getMany(): Promise<ListResults>;
57
+ getOne(): Promise<Result | undefined>;
58
+ }
59
+ export {};
27
60
  //# sourceMappingURL=migration-adaptor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-adaptor.d.ts","sourceRoot":"","sources":["../../src/migration/migration-adaptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACrG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACjE,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpD,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"migration-adaptor.d.ts","sourceRoot":"","sources":["../../src/migration/migration-adaptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACrG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACjE,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpD,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;AAED,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC;IACrC,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACvC"}
@@ -1,5 +1,5 @@
1
1
  import { Response } from 'node-fetch';
2
- import { AppDataListResponse, MappingResponse, MigrationAdapter, Progress } from './migration-adaptor';
2
+ import { AppDataListResponse, MappingResponse, MigrationAdapter, Progress, ListOptions, ListResults } from './migration-adaptor';
3
3
  export declare class Migration implements MigrationAdapter {
4
4
  private readonly basePath;
5
5
  sendProgress: (transferId: string, progress: Progress) => Promise<void>;
@@ -7,5 +7,8 @@ export declare class Migration implements MigrationAdapter {
7
7
  getAppDataList: (transferId: string) => Promise<AppDataListResponse>;
8
8
  getAppDataPayload: (s3Key: string) => Promise<Response>;
9
9
  updateFeedback: (transferId: string, feedback: object) => Promise<void>;
10
+ getMappings: (transferId: string, namespace?: string | undefined, lastEntity?: string | undefined, pageSize?: number | undefined) => Promise<ListResults>;
11
+ getContainers: (transferId: string, containerType?: string | undefined, lastEntity?: string | undefined, pageSize?: number | undefined) => Promise<ListResults>;
12
+ list: (options: ListOptions, pageSize?: number | undefined) => Promise<ListResults>;
10
13
  }
11
14
  //# sourceMappingURL=migration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EACL,mBAAmB,EAEnB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,qBAAqB,CAAC;AAI7B,qBAAa,SAAU,YAAW,gBAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD,YAAY,eAAsB,MAAM,YAAY,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CAG1E;IAEF,cAAc,eAAsB,MAAM,aAAa,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAG3G;IAEF,cAAc,eAAsB,MAAM,KAAG,OAAO,CAAC,mBAAmB,CAAC,CAGvE;IAEF,iBAAiB,UAAiB,MAAM,KAAG,OAAO,CAAC,QAAQ,CAAC,CAI1D;IAEF,cAAc,eAAsB,MAAM,YAAY,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAG1E;CACH"}
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EACL,mBAAmB,EAEnB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,WAAW,EAIZ,MAAM,qBAAqB,CAAC;AAI7B,qBAAa,SAAU,YAAW,gBAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD,YAAY,eAAsB,MAAM,YAAY,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CAG1E;IAEF,cAAc,eAAsB,MAAM,aAAa,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAG3G;IAEF,cAAc,eAAsB,MAAM,KAAG,OAAO,CAAC,mBAAmB,CAAC,CAGvE;IAEF,iBAAiB,UAAiB,MAAM,KAAG,OAAO,CAAC,QAAQ,CAAC,CAI1D;IAEF,cAAc,eAAsB,MAAM,YAAY,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAG1E;IAEF,WAAW,eACG,MAAM,qGAIjB,OAAO,CAAC,WAAW,CAAC,CAuBrB;IAEF,aAAa,eACC,MAAM,yGAIjB,OAAO,CAAC,WAAW,CAAC,CAsBrB;IAEF,IAAI,YAAmB,WAAW,oCAAsB,OAAO,CAAC,WAAW,CAAC,CAI1E;CACH"}
@@ -28,6 +28,54 @@ class Migration {
28
28
  const result = await utils_1.invokePOSTApi(`${this.basePath}/feedback/${transferId}`, feedback);
29
29
  return utils_1.getResponseBody(result);
30
30
  };
31
+ this.getMappings = async (transferId, namespace, lastEntity, pageSize) => {
32
+ let queryParams = `namespace=${namespace}`;
33
+ if (pageSize != undefined) {
34
+ queryParams = queryParams + `&pageSize=${pageSize}`;
35
+ }
36
+ if (lastEntity != undefined) {
37
+ queryParams = queryParams + `&lastEntity=${lastEntity}`;
38
+ }
39
+ const result = await utils_1.invokeGETApi(`${this.basePath}/mapping/${transferId}/page?${queryParams}`);
40
+ const mappingResponse = await utils_1.getResponseBody(result);
41
+ let results = [];
42
+ if (mappingResponse.items != null) {
43
+ results = Object.entries(mappingResponse.items).map((item) => {
44
+ return { key: item[0], value: item[1] };
45
+ });
46
+ }
47
+ return {
48
+ results: results,
49
+ nextCursor: mappingResponse.meta.lastEntity != null ? mappingResponse.meta.lastEntity : undefined
50
+ };
51
+ };
52
+ this.getContainers = async (transferId, containerType, lastEntity, pageSize) => {
53
+ let queryParams = `containerType=${containerType}`;
54
+ if (pageSize != undefined) {
55
+ queryParams = queryParams + `&pageSize=${pageSize}`;
56
+ }
57
+ if (lastEntity != undefined) {
58
+ queryParams = queryParams + `&lastEntity=${lastEntity}`;
59
+ }
60
+ const result = await utils_1.invokeGETApi(`${this.basePath}/container/${transferId}/page?${queryParams}`);
61
+ const containerResponse = await utils_1.getResponseBody(result);
62
+ let results = [];
63
+ if (containerResponse.containers != null) {
64
+ results = Object.entries(containerResponse.containers).map((item) => {
65
+ return { key: item[0], value: item[1] };
66
+ });
67
+ }
68
+ return {
69
+ results: results,
70
+ nextCursor: containerResponse.meta.lastEntity != null ? containerResponse.meta.lastEntity : undefined
71
+ };
72
+ };
73
+ this.list = async (options, pageSize) => {
74
+ if (options.namespace != undefined)
75
+ return this.getMappings(options.transferId, options.namespace, options.cursor, pageSize);
76
+ else
77
+ return this.getContainers(options.transferId, options.containerType, options.cursor, pageSize);
78
+ };
31
79
  }
32
80
  }
33
81
  exports.Migration = Migration;
@@ -0,0 +1,11 @@
1
+ import { QueryBuilder, Result, ListOptions, ListResults } from './migration-adaptor';
2
+ import { Migration } from './migration';
3
+ export declare class DefaultQueryBuilder implements QueryBuilder {
4
+ private migration;
5
+ private queryOptions;
6
+ constructor(migration: Pick<Migration, 'list'>, queryOptions: ListOptions);
7
+ cursor(cursor: string): QueryBuilder;
8
+ getOne(): Promise<Result | undefined>;
9
+ getMany(): Promise<ListResults>;
10
+ }
11
+ //# sourceMappingURL=query-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-api.d.ts","sourceRoot":"","sources":["../../src/migration/query-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,mBAAoB,YAAW,YAAY;IAC1C,OAAO,CAAC,SAAS;IAA2B,OAAO,CAAC,YAAY;gBAAxD,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAAU,YAAY,EAAE,WAAW;IAEzF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAO9B,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAOrC,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC;CAGtC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultQueryBuilder = void 0;
4
+ class DefaultQueryBuilder {
5
+ constructor(migration, queryOptions) {
6
+ this.migration = migration;
7
+ this.queryOptions = queryOptions;
8
+ }
9
+ cursor(cursor) {
10
+ return new DefaultQueryBuilder(this.migration, Object.assign(Object.assign({}, this.queryOptions), { cursor }));
11
+ }
12
+ async getOne() {
13
+ const listResults = await this.migration.list(this.queryOptions, 1);
14
+ if (listResults.results && listResults.results.length > 0) {
15
+ return listResults.results[0];
16
+ }
17
+ }
18
+ async getMany() {
19
+ return this.migration.list(this.queryOptions);
20
+ }
21
+ }
22
+ exports.DefaultQueryBuilder = DefaultQueryBuilder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/migrations",
3
- "version": "0.0.0",
3
+ "version": "0.1.1-next.0",
4
4
  "description": "App migration methods for Forge app",
5
5
  "main": "out/index.js",
6
6
  "scripts": {
@@ -16,6 +16,6 @@
16
16
  "node-fetch": "2.6.1"
17
17
  },
18
18
  "dependencies": {
19
- "@forge/api": "^2.6.1"
19
+ "@forge/api": "^2.7.0-next.0"
20
20
  }
21
21
  }
@@ -1,4 +1,4 @@
1
- import { APIError } from '../migration';
1
+ import { APIError } from '../migration/errors';
2
2
 
3
3
  describe('APIError', () => {
4
4
  describe('forStatus', () => {
@@ -1,4 +1,5 @@
1
- import { APIError, migration } from '../migration';
1
+ import { APIError } from '../migration/errors';
2
+ import { migration } from '../migration';
2
3
  import { Progress } from '../migration/migration-adaptor';
3
4
  import { when } from 'jest-when';
4
5
  import fetch, { Response } from 'node-fetch';
@@ -0,0 +1,177 @@
1
+ import { ListResults, Result } from '../migration/migration-adaptor';
2
+ import { when } from 'jest-when';
3
+ import { migration } from '../migration';
4
+
5
+ describe('QueryApi', () => {
6
+ const transferId = '521ee36a-b673-3dc6-b60b-12460332c200';
7
+
8
+ (global as any).api = {
9
+ asApp: jest.fn().mockReturnValue({
10
+ __requestAtlassian: jest.fn()
11
+ })
12
+ };
13
+
14
+ describe('getMappings', () => {
15
+ let expectedMappingsResultMany: ListResults;
16
+ let expectedMappingsResultManyWithCursor: ListResults;
17
+ let expectedMappingsResultSingle: Result;
18
+ let lastEntityId: string;
19
+
20
+ beforeAll(() => {
21
+ lastEntityId = 'base64:ZW1haWwvYWRtaW5AZXhhbXBsZS5jb20vNg';
22
+ const mappingsResponse = `{"meta":{"pageSize":5000,"hasNext":false,"lastEntity":"${lastEntityId}"},"items":{"email/admin@example.com":"5a29c4ae20cfc31b0dc0eafe","confluence.userkey/2c9682714db22c7c014db22f51970002":"5a29c4ae20cfc31b0dc0eafe"}}`;
23
+
24
+ const mappingsResponseWithoutLastEntity =
25
+ '{"meta":{"pageSize":5000,"hasNext":false,"lastEntity":null},"items":{"email/admin@example.com":"5a29c4ae20cfc31b0dc0eafe","confluence.userkey/2c9682714db22c7c014db22f51970002":"5a29c4ae20cfc31b0dc0eafe"}}';
26
+
27
+ const valueObject = '5a29c4ae20cfc31b0dc0eafe' as any;
28
+ when((global as any).api.asApp().__requestAtlassian)
29
+ .calledWith(
30
+ `/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user&lastEntity=${lastEntityId}`
31
+ )
32
+ .mockReturnValue({
33
+ status: 200,
34
+ text: jest.fn().mockResolvedValue(mappingsResponseWithoutLastEntity),
35
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponseWithoutLastEntity))
36
+ })
37
+ .calledWith(`/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user`)
38
+ .mockReturnValue({
39
+ status: 200,
40
+ text: jest.fn().mockResolvedValue(mappingsResponse),
41
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponse))
42
+ })
43
+ .calledWith(`/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user&pageSize=1`)
44
+ .mockReturnValue({
45
+ status: 200,
46
+ text: jest.fn().mockResolvedValue(mappingsResponse),
47
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponse))
48
+ })
49
+ .calledWith(
50
+ `/app/migration/forge/v1/mapping/${transferId}/page?namespace=identity:user&pageSize=1&lastEntity=${lastEntityId}`
51
+ )
52
+ .mockReturnValue({
53
+ status: 200,
54
+ text: jest.fn().mockResolvedValue(mappingsResponse),
55
+ json: jest.fn().mockResolvedValue(JSON.parse(mappingsResponse))
56
+ });
57
+
58
+ expectedMappingsResultMany = {
59
+ results: [
60
+ {
61
+ key: 'email/admin@example.com',
62
+ value: valueObject
63
+ },
64
+ { key: 'confluence.userkey/2c9682714db22c7c014db22f51970002', value: valueObject }
65
+ ],
66
+ nextCursor: undefined
67
+ };
68
+
69
+ expectedMappingsResultManyWithCursor = {
70
+ results: [
71
+ { key: 'email/admin@example.com', value: valueObject },
72
+ { key: 'confluence.userkey/2c9682714db22c7c014db22f51970002', value: valueObject }
73
+ ],
74
+ nextCursor: lastEntityId
75
+ };
76
+ expectedMappingsResultSingle = { key: 'email/admin@example.com', value: valueObject };
77
+ });
78
+
79
+ it('should fetch multiple values for getMappings', async () => {
80
+ const results = await migration.getMappings(transferId, 'identity:user').getMany();
81
+
82
+ expect(results).toEqual(expectedMappingsResultManyWithCursor);
83
+ });
84
+
85
+ it('should allow specifying a cursor for getMappings with getMany', async () => {
86
+ const result = await migration.getMappings(transferId, 'identity:user').cursor(lastEntityId).getMany();
87
+ expect(result).toEqual(expectedMappingsResultMany);
88
+ });
89
+
90
+ it('get single mapping when getMappings called with getOne', async () => {
91
+ const result = await migration.getMappings(transferId, 'identity:user').getOne();
92
+
93
+ expect(result).toEqual(expectedMappingsResultSingle);
94
+ });
95
+
96
+ it('should allow specifying a cursor for getMappings with getOne', async () => {
97
+ const result = await migration.getMappings(transferId, 'identity:user').cursor(lastEntityId).getOne();
98
+
99
+ expect(result).toEqual(expectedMappingsResultSingle);
100
+ });
101
+ });
102
+
103
+ describe('getContainers', () => {
104
+ let expectedResultContainersManyWithCursor: ListResults;
105
+ let expectedResultContainersManyWithoutCursor: ListResults;
106
+ let expectedResultContainersSingle: Result;
107
+ let lastEntityId: string;
108
+
109
+ beforeAll(() => {
110
+ lastEntityId = 'db11c8af-c82b-3569-9a11-f288c9cc9535';
111
+ const containersResponse = `{"meta":{"pageSize":0,"hasNext":false,"lastEntity":"${lastEntityId}"},"containers":[{ "key": "TES", "sourceId": "884737", "type": "ConfluenceSpace" }]}`;
112
+
113
+ const containersResponseWithoutLastEntity =
114
+ '{"meta":{"pageSize":0,"hasNext":false,"lastEntity":null},"containers":[{ "key": "TES", "sourceId": "884737", "type": "ConfluenceSpace" }]}';
115
+
116
+ expectedResultContainersManyWithCursor = {
117
+ results: [{ key: '0', value: { key: 'TES', sourceId: '884737', type: 'ConfluenceSpace' } }],
118
+ nextCursor: lastEntityId
119
+ };
120
+ expectedResultContainersManyWithoutCursor = {
121
+ results: [{ key: '0', value: { key: 'TES', sourceId: '884737', type: 'ConfluenceSpace' } }],
122
+ nextCursor: undefined
123
+ };
124
+ expectedResultContainersSingle = { key: '0', value: { key: 'TES', sourceId: '884737', type: 'ConfluenceSpace' } };
125
+
126
+ when((global as any).api.asApp().__requestAtlassian)
127
+ .calledWith(
128
+ `/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace&lastEntity=${lastEntityId}`
129
+ )
130
+ .mockReturnValue({
131
+ status: 200,
132
+ text: jest.fn().mockResolvedValue(containersResponseWithoutLastEntity),
133
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponseWithoutLastEntity))
134
+ })
135
+ .calledWith(`/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace`)
136
+ .mockReturnValue({
137
+ status: 200,
138
+ text: jest.fn().mockResolvedValue(containersResponse),
139
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponse))
140
+ })
141
+ .calledWith(`/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace&pageSize=1`)
142
+ .mockReturnValue({
143
+ status: 200,
144
+ text: jest.fn().mockResolvedValue(containersResponse),
145
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponse))
146
+ })
147
+ .calledWith(
148
+ `/app/migration/forge/v1/container/${transferId}/page?containerType=ConfluenceSpace&pageSize=1&lastEntity=${lastEntityId}`
149
+ )
150
+ .mockReturnValue({
151
+ status: 200,
152
+ text: jest.fn().mockResolvedValue(containersResponse),
153
+ json: jest.fn().mockResolvedValue(JSON.parse(containersResponse))
154
+ });
155
+ });
156
+
157
+ it('should allow specifying a cursor for getContainers with getMany', async () => {
158
+ const result = await migration.getContainers(transferId, 'ConfluenceSpace').cursor(lastEntityId).getMany();
159
+ expect(result).toEqual(expectedResultContainersManyWithoutCursor);
160
+ });
161
+
162
+ it('should fetch multiple values when getContainers is called with getMany', async () => {
163
+ const result = await migration.getContainers(transferId, 'ConfluenceSpace').getMany();
164
+ expect(result).toEqual(expectedResultContainersManyWithCursor);
165
+ });
166
+
167
+ it('should allow specifying a cursor for getContainers with getOne', async () => {
168
+ const result = await migration.getContainers(transferId, 'ConfluenceSpace').cursor(lastEntityId).getOne();
169
+ expect(result).toEqual(expectedResultContainersSingle);
170
+ });
171
+
172
+ it('get single mapping when getContainers called with getOne', async () => {
173
+ const result = await migration.getContainers(transferId, 'ConfluenceSpace').getOne();
174
+ expect(result).toEqual(expectedResultContainersSingle);
175
+ });
176
+ });
177
+ });
@@ -1,16 +1,19 @@
1
1
  import { Migration } from './migration';
2
- import { MigrationAdapter, Progress } from './migration-adaptor';
2
+ import { Progress } from './migration-adaptor';
3
+ import { DefaultQueryBuilder } from './query-api';
3
4
 
4
- export { APIError } from './errors';
5
-
6
- export const getMigrationInstance = (adapter: MigrationAdapter) => {
5
+ export const getMigrationInstance = (adapter: Migration) => {
7
6
  return {
8
7
  sendProgress: (transferId: string, progress: Progress) => adapter.sendProgress(transferId, progress),
9
8
  getMappingById: (transferId: string, namespace: string, keys: Array<string>) =>
10
9
  adapter.getMappingById(transferId, namespace, keys),
11
10
  updateFeedback: (transferId: string, feedback: object) => adapter.updateFeedback(transferId, feedback),
12
11
  getAppDataList: (transferId: string) => adapter.getAppDataList(transferId),
13
- getAppDataPayload: (s3Key: string) => adapter.getAppDataPayload(s3Key)
12
+ getAppDataPayload: (s3Key: string) => adapter.getAppDataPayload(s3Key),
13
+ getMappings: (transferId: string, namespace: string) =>
14
+ new DefaultQueryBuilder(adapter, { transferId: transferId, namespace: namespace }),
15
+ getContainers: (transferId: string, containerType: string) =>
16
+ new DefaultQueryBuilder(adapter, { transferId: transferId, containerType: containerType })
14
17
  };
15
18
  };
16
19
 
@@ -22,5 +25,9 @@ export const migration = {
22
25
  updateFeedback: (transferId: string, feedback: object) =>
23
26
  getMigrationInstance(new Migration()).updateFeedback(transferId, feedback),
24
27
  getAppDataList: (transferId: string) => getMigrationInstance(new Migration()).getAppDataList(transferId),
25
- getAppDataPayload: (s3Key: string) => getMigrationInstance(new Migration()).getAppDataPayload(s3Key)
28
+ getAppDataPayload: (s3Key: string) => getMigrationInstance(new Migration()).getAppDataPayload(s3Key),
29
+ getMappings: (transferId: string, namespace: string) =>
30
+ getMigrationInstance(new Migration()).getMappings(transferId, namespace),
31
+ getContainers: (transferId: string, containerType: string) =>
32
+ getMigrationInstance(new Migration()).getContainers(transferId, containerType)
26
33
  };
@@ -30,3 +30,42 @@ export interface Progress {
30
30
  percent: number;
31
31
  message: string;
32
32
  }
33
+
34
+ export interface PaginationMappingResponse {
35
+ meta: PaginationResponseMeta;
36
+ items: Map<string, string>;
37
+ }
38
+
39
+ interface PaginationResponseMeta {
40
+ pageSize: number;
41
+ hasNext: boolean;
42
+ lastEntity?: string;
43
+ }
44
+
45
+ export interface PaginationContainerResponse {
46
+ containers: Array<object>;
47
+ meta: PaginationResponseMeta;
48
+ }
49
+
50
+ export interface ListOptions {
51
+ transferId: string;
52
+ namespace?: string;
53
+ containerType?: string;
54
+ cursor?: string;
55
+ }
56
+
57
+ export interface Result {
58
+ key: string;
59
+ value: object;
60
+ }
61
+
62
+ export interface ListResults {
63
+ results: Result[];
64
+ nextCursor?: string;
65
+ }
66
+
67
+ export interface QueryBuilder {
68
+ cursor(cursor: string): QueryBuilder;
69
+ getMany(): Promise<ListResults>;
70
+ getOne(): Promise<Result | undefined>;
71
+ }
@@ -5,7 +5,12 @@ import {
5
5
  AppDataPayloadResponse,
6
6
  MappingResponse,
7
7
  MigrationAdapter,
8
- Progress
8
+ Progress,
9
+ ListOptions,
10
+ ListResults,
11
+ Result,
12
+ PaginationContainerResponse,
13
+ PaginationMappingResponse
9
14
  } from './migration-adaptor';
10
15
 
11
16
  import { getResponseBody, invokeGETApi, invokePOSTApi } from './utils';
@@ -38,4 +43,69 @@ export class Migration implements MigrationAdapter {
38
43
  const result = await invokePOSTApi(`${this.basePath}/feedback/${transferId}`, feedback);
39
44
  return getResponseBody(result);
40
45
  };
46
+
47
+ getMappings = async (
48
+ transferId: string,
49
+ namespace?: string,
50
+ lastEntity?: string,
51
+ pageSize?: number
52
+ ): Promise<ListResults> => {
53
+ let queryParams = `namespace=${namespace}`;
54
+ if (pageSize != undefined) {
55
+ queryParams = queryParams + `&pageSize=${pageSize}`;
56
+ }
57
+ if (lastEntity != undefined) {
58
+ queryParams = queryParams + `&lastEntity=${lastEntity}`;
59
+ }
60
+
61
+ const result = await invokeGETApi(`${this.basePath}/mapping/${transferId}/page?${queryParams}`);
62
+ const mappingResponse: PaginationMappingResponse = await getResponseBody(result);
63
+
64
+ let results: Result[] = [];
65
+ if (mappingResponse.items != null) {
66
+ results = Object.entries(mappingResponse.items).map((item) => {
67
+ return { key: item[0], value: item[1] as object };
68
+ });
69
+ }
70
+
71
+ return {
72
+ results: results,
73
+ nextCursor: mappingResponse.meta.lastEntity != null ? mappingResponse.meta.lastEntity : undefined
74
+ };
75
+ };
76
+
77
+ getContainers = async (
78
+ transferId: string,
79
+ containerType?: string,
80
+ lastEntity?: string,
81
+ pageSize?: number
82
+ ): Promise<ListResults> => {
83
+ let queryParams = `containerType=${containerType}`;
84
+ if (pageSize != undefined) {
85
+ queryParams = queryParams + `&pageSize=${pageSize}`;
86
+ }
87
+ if (lastEntity != undefined) {
88
+ queryParams = queryParams + `&lastEntity=${lastEntity}`;
89
+ }
90
+
91
+ const result = await invokeGETApi(`${this.basePath}/container/${transferId}/page?${queryParams}`);
92
+ const containerResponse: PaginationContainerResponse = await getResponseBody(result);
93
+ let results: Result[] = [];
94
+ if (containerResponse.containers != null) {
95
+ results = Object.entries(containerResponse.containers).map((item) => {
96
+ return { key: item[0], value: item[1] };
97
+ });
98
+ }
99
+
100
+ return {
101
+ results: results,
102
+ nextCursor: containerResponse.meta.lastEntity != null ? containerResponse.meta.lastEntity : undefined
103
+ };
104
+ };
105
+
106
+ list = async (options: ListOptions, pageSize?: number): Promise<ListResults> => {
107
+ if (options.namespace != undefined)
108
+ return this.getMappings(options.transferId, options.namespace, options.cursor, pageSize);
109
+ else return this.getContainers(options.transferId, options.containerType, options.cursor, pageSize);
110
+ };
41
111
  }
@@ -0,0 +1,24 @@
1
+ import { QueryBuilder, Result, ListOptions, ListResults } from './migration-adaptor';
2
+ import { Migration } from './migration';
3
+
4
+ export class DefaultQueryBuilder implements QueryBuilder {
5
+ constructor(private migration: Pick<Migration, 'list'>, private queryOptions: ListOptions) {}
6
+
7
+ cursor(cursor: string): QueryBuilder {
8
+ return new DefaultQueryBuilder(this.migration, {
9
+ ...this.queryOptions,
10
+ cursor
11
+ });
12
+ }
13
+
14
+ async getOne(): Promise<Result | undefined> {
15
+ const listResults = await this.migration.list(this.queryOptions, 1);
16
+ if (listResults.results && listResults.results.length > 0) {
17
+ return listResults.results[0];
18
+ }
19
+ }
20
+
21
+ async getMany(): Promise<ListResults> {
22
+ return this.migration.list(this.queryOptions);
23
+ }
24
+ }
@@ -377,8 +377,8 @@
377
377
  "affectsGlobalScope": false
378
378
  },
379
379
  "./src/migration/migration-adaptor.ts": {
380
- "version": "88613dcc9bb05fd5174af00c31283acc531b75920124ae046b2485210997af03",
381
- "signature": "1e4bdc70d716dc5b0af95b1da81e393781f921f2083d5068126ea83d00bc17fa",
380
+ "version": "b56b0399bb9cb4b98565d61ca5edc4f682e114c778fec1178d22829bc40f9cd0",
381
+ "signature": "e4b45919b4b2b97ac6b7f782220947a2c1ddfddc407c1c8451dddf52749f739e",
382
382
  "affectsGlobalScope": false
383
383
  },
384
384
  "../forge-storage/out/queries.d.ts": {
@@ -462,13 +462,18 @@
462
462
  "affectsGlobalScope": false
463
463
  },
464
464
  "./src/migration/migration.ts": {
465
- "version": "843e9c8d7022ead10c2a5215ae678d63321cb3d5c58277a82da500a6ed69b0da",
466
- "signature": "48b43ae92d77eb0587f4dac5f8a47577e50acbf5b99642c8504a82201244d29a",
465
+ "version": "163399d53401973c8bb67681d25cd855765231bc8c4260585459b492d592fb0b",
466
+ "signature": "3b9596b98e61b6b1ec3011b5dab5da0a3481067c08d136ad29fb5ab577adc32c",
467
+ "affectsGlobalScope": false
468
+ },
469
+ "./src/migration/query-api.ts": {
470
+ "version": "8fdd39f2eba2deeb1da161859dd92e6abe8706c950bffa660500e5ad4418a34d",
471
+ "signature": "d03085a9c7a02899410eaea4e2ed1304b1ea35a9f86474a3a2b0b3551ca6b907",
467
472
  "affectsGlobalScope": false
468
473
  },
469
474
  "./src/migration/index.ts": {
470
- "version": "e934a6242349369c2e5ae7e9508436d94c7313173a859ce0da03ef369212279c",
471
- "signature": "054b83c5bad398e0ffc0a35198dc2de75be78d7e43f72dbb0cf45839ef7b257b",
475
+ "version": "aa7afc2eaa77e085b5ea50c5c2e29721b49c5eb0ef8750b46ac701fce7f2c744",
476
+ "signature": "7459ca986a330d5da97ff9379915ec691eaaabb19e93cab8003c4b0beac1a59d",
472
477
  "affectsGlobalScope": false
473
478
  },
474
479
  "./src/index.ts": {
@@ -477,7 +482,7 @@
477
482
  "affectsGlobalScope": false
478
483
  },
479
484
  "./src/__test__/errors.test.ts": {
480
- "version": "e3e7f31ddd11686b6b4df341cfcde34ce6d4bf10f36411be3bc1bd8dfb9aa691",
485
+ "version": "d44a0989d278a27ee156a57eaa5aae11c1d21238f8026fb699c9301e5f95faa8",
481
486
  "signature": "b5d7523b42f6acd1ed17495b1dd8bf1ab3dbe63bf8e36eac4d93d7bcfda6e9cb",
482
487
  "affectsGlobalScope": false
483
488
  },
@@ -557,8 +562,8 @@
557
562
  "affectsGlobalScope": false
558
563
  },
559
564
  "../../node_modules/@types/yargs-parser/index.d.ts": {
560
- "version": "f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2",
561
- "signature": "f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2",
565
+ "version": "70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e",
566
+ "signature": "70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e",
562
567
  "affectsGlobalScope": false
563
568
  },
564
569
  "../../node_modules/@types/yargs/index.d.ts": {
@@ -596,9 +601,9 @@
596
601
  "signature": "7b80d25cee6eba0453aaeb22b9f56f61883154f93c31d7e3743cf6b262f6fb9d",
597
602
  "affectsGlobalScope": false
598
603
  },
599
- "../../node_modules/@babel/types/lib/index.d.ts": {
600
- "version": "d5d7b68f5369a210c235cd65458369888f8b839192d088c964f21cab3ac954db",
601
- "signature": "d5d7b68f5369a210c235cd65458369888f8b839192d088c964f21cab3ac954db",
604
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts": {
605
+ "version": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
606
+ "signature": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
602
607
  "affectsGlobalScope": false
603
608
  },
604
609
  "../../node_modules/@types/babel__generator/index.d.ts": {
@@ -606,9 +611,19 @@
606
611
  "signature": "cc957354aa3c94c9961ebf46282cfde1e81d107fc5785a61f62c67f1dd3ac2eb",
607
612
  "affectsGlobalScope": false
608
613
  },
614
+ "../../node_modules/@babel/types/lib/index.d.ts": {
615
+ "version": "d5d7b68f5369a210c235cd65458369888f8b839192d088c964f21cab3ac954db",
616
+ "signature": "d5d7b68f5369a210c235cd65458369888f8b839192d088c964f21cab3ac954db",
617
+ "affectsGlobalScope": false
618
+ },
609
619
  "../../node_modules/@babel/parser/typings/babel-parser.d.ts": {
610
- "version": "64b867c61effed7b5bc0cc06b3d8eac23b067a3fba581fc7d3c292fa593e6a45",
611
- "signature": "64b867c61effed7b5bc0cc06b3d8eac23b067a3fba581fc7d3c292fa593e6a45",
620
+ "version": "8670878e030b88a469db43b36ef90ffa208e74faf249416feeb8fbb6b646b4a9",
621
+ "signature": "8670878e030b88a469db43b36ef90ffa208e74faf249416feeb8fbb6b646b4a9",
622
+ "affectsGlobalScope": false
623
+ },
624
+ "../../node_modules/@types/babel__template/node_modules/@babel/types/lib/index.d.ts": {
625
+ "version": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
626
+ "signature": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
612
627
  "affectsGlobalScope": false
613
628
  },
614
629
  "../../node_modules/@types/babel__template/index.d.ts": {
@@ -616,14 +631,24 @@
616
631
  "signature": "93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9",
617
632
  "affectsGlobalScope": false
618
633
  },
634
+ "../../node_modules/@types/babel__traverse/node_modules/@babel/types/lib/index.d.ts": {
635
+ "version": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
636
+ "signature": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
637
+ "affectsGlobalScope": false
638
+ },
619
639
  "../../node_modules/@types/babel__traverse/ts4.1/index.d.ts": {
620
- "version": "5158403c4f6a1e0e86a5e43e9aaad3571ce270e02fcdd750b5b0ea8dc636dbe4",
621
- "signature": "5158403c4f6a1e0e86a5e43e9aaad3571ce270e02fcdd750b5b0ea8dc636dbe4",
640
+ "version": "7ec562d20173996ab057cd17eb0af2e5de5fee1b1024ef20373c105b18020346",
641
+ "signature": "7ec562d20173996ab057cd17eb0af2e5de5fee1b1024ef20373c105b18020346",
642
+ "affectsGlobalScope": false
643
+ },
644
+ "../../node_modules/@types/babel__core/node_modules/@babel/types/lib/index.d.ts": {
645
+ "version": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
646
+ "signature": "2ff9995137f3e5d68971388ec58af0c79721626323884513f9f5e2e996ac1fdd",
622
647
  "affectsGlobalScope": false
623
648
  },
624
649
  "../../node_modules/@types/babel__core/index.d.ts": {
625
- "version": "dd5647a9ccccb2b074dca8a02b00948ac293091ebe73fdf2e6e98f718819f669",
626
- "signature": "dd5647a9ccccb2b074dca8a02b00948ac293091ebe73fdf2e6e98f718819f669",
650
+ "version": "5426e62886b7be7806312d31a00e8f7dccd6fe63ba9bbefe99ee2eab29cc48a3",
651
+ "signature": "5426e62886b7be7806312d31a00e8f7dccd6fe63ba9bbefe99ee2eab29cc48a3",
627
652
  "affectsGlobalScope": false
628
653
  },
629
654
  "../../node_modules/ts-jest/dist/tsconfig-raw.d.ts": {
@@ -652,9 +677,14 @@
652
677
  "affectsGlobalScope": false
653
678
  },
654
679
  "./src/__test__/migration.test.ts": {
655
- "version": "ca2f36c1371a3f8b81256f366eb7d81b67f2cdd0ddf9c282defd912eb3b05a9d",
680
+ "version": "56e44bcd47479953ecf4aece6ca7557824e9ba8517d3733c1751c0f77760264d",
656
681
  "signature": "00e64039b0b16d0a311c28c5ab9e1ec67f4d1cfc8bff56ff6c14d7c149362ec7",
657
682
  "affectsGlobalScope": false
683
+ },
684
+ "./src/__test__/query-api.test.ts": {
685
+ "version": "68bb3f47e22733bf4e516931b36a4fac2e73b94fa8385ecec47fee3e4c31f97f",
686
+ "signature": "992008f9ddb7bfac9925d559482bc234bde772c083ca134ae8a1d39d08d59b50",
687
+ "affectsGlobalScope": false
658
688
  }
659
689
  },
660
690
  "options": {
@@ -714,20 +744,20 @@
714
744
  ],
715
745
  "../../node_modules/@types/babel__core/index.d.ts": [
716
746
  "../../node_modules/@babel/parser/typings/babel-parser.d.ts",
717
- "../../node_modules/@babel/types/lib/index.d.ts",
718
747
  "../../node_modules/@types/babel__generator/index.d.ts",
748
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts",
719
749
  "../../node_modules/@types/babel__template/index.d.ts",
720
750
  "../../node_modules/@types/babel__traverse/ts4.1/index.d.ts"
721
751
  ],
722
752
  "../../node_modules/@types/babel__generator/index.d.ts": [
723
- "../../node_modules/@babel/types/lib/index.d.ts"
753
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts"
724
754
  ],
725
755
  "../../node_modules/@types/babel__template/index.d.ts": [
726
756
  "../../node_modules/@babel/parser/typings/babel-parser.d.ts",
727
- "../../node_modules/@babel/types/lib/index.d.ts"
757
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts"
728
758
  ],
729
759
  "../../node_modules/@types/babel__traverse/ts4.1/index.d.ts": [
730
- "../../node_modules/@babel/types/lib/index.d.ts"
760
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts"
731
761
  ],
732
762
  "../../node_modules/@types/istanbul-lib-report/index.d.ts": [
733
763
  "../../node_modules/@types/istanbul-lib-coverage/index.d.ts"
@@ -956,12 +986,18 @@
956
986
  "../forge-auth/out/types.d.ts"
957
987
  ],
958
988
  "./src/__test__/errors.test.ts": [
959
- "./src/migration/index.ts"
989
+ "./src/migration/errors.ts"
960
990
  ],
961
991
  "./src/__test__/migration.test.ts": [
962
992
  "../../node_modules/@types/jest-when/index.d.ts",
963
993
  "../../node_modules/@types/node-fetch/index.d.ts",
964
994
  "../../node_modules/ts-jest/utils/index.d.ts",
995
+ "./src/migration/errors.ts",
996
+ "./src/migration/index.ts",
997
+ "./src/migration/migration-adaptor.ts"
998
+ ],
999
+ "./src/__test__/query-api.test.ts": [
1000
+ "../../node_modules/@types/jest-when/index.d.ts",
965
1001
  "./src/migration/index.ts",
966
1002
  "./src/migration/migration-adaptor.ts"
967
1003
  ],
@@ -969,9 +1005,9 @@
969
1005
  "./src/migration/index.ts"
970
1006
  ],
971
1007
  "./src/migration/index.ts": [
972
- "./src/migration/errors.ts",
973
1008
  "./src/migration/migration-adaptor.ts",
974
- "./src/migration/migration.ts"
1009
+ "./src/migration/migration.ts",
1010
+ "./src/migration/query-api.ts"
975
1011
  ],
976
1012
  "./src/migration/migration-adaptor.ts": [
977
1013
  "../../node_modules/@types/node-fetch/index.d.ts"
@@ -981,6 +1017,10 @@
981
1017
  "./src/migration/migration-adaptor.ts",
982
1018
  "./src/migration/utils.ts"
983
1019
  ],
1020
+ "./src/migration/query-api.ts": [
1021
+ "./src/migration/migration-adaptor.ts",
1022
+ "./src/migration/migration.ts"
1023
+ ],
984
1024
  "./src/migration/utils.ts": [
985
1025
  "../forge-api/out/index.d.ts",
986
1026
  "./src/migration/errors.ts"
@@ -1034,20 +1074,20 @@
1034
1074
  ],
1035
1075
  "../../node_modules/@types/babel__core/index.d.ts": [
1036
1076
  "../../node_modules/@babel/parser/typings/babel-parser.d.ts",
1037
- "../../node_modules/@babel/types/lib/index.d.ts",
1038
1077
  "../../node_modules/@types/babel__generator/index.d.ts",
1078
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts",
1039
1079
  "../../node_modules/@types/babel__template/index.d.ts",
1040
1080
  "../../node_modules/@types/babel__traverse/ts4.1/index.d.ts"
1041
1081
  ],
1042
1082
  "../../node_modules/@types/babel__generator/index.d.ts": [
1043
- "../../node_modules/@babel/types/lib/index.d.ts"
1083
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts"
1044
1084
  ],
1045
1085
  "../../node_modules/@types/babel__template/index.d.ts": [
1046
1086
  "../../node_modules/@babel/parser/typings/babel-parser.d.ts",
1047
- "../../node_modules/@babel/types/lib/index.d.ts"
1087
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts"
1048
1088
  ],
1049
1089
  "../../node_modules/@types/babel__traverse/ts4.1/index.d.ts": [
1050
- "../../node_modules/@babel/types/lib/index.d.ts"
1090
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts"
1051
1091
  ],
1052
1092
  "../../node_modules/@types/istanbul-lib-report/index.d.ts": [
1053
1093
  "../../node_modules/@types/istanbul-lib-coverage/index.d.ts"
@@ -1280,8 +1320,9 @@
1280
1320
  ],
1281
1321
  "./src/migration/index.ts": [
1282
1322
  "../../node_modules/@types/node-fetch/index.d.ts",
1283
- "./src/migration/errors.ts",
1284
- "./src/migration/migration-adaptor.ts"
1323
+ "./src/migration/migration-adaptor.ts",
1324
+ "./src/migration/migration.ts",
1325
+ "./src/migration/query-api.ts"
1285
1326
  ],
1286
1327
  "./src/migration/migration-adaptor.ts": [
1287
1328
  "../../node_modules/@types/node-fetch/index.d.ts"
@@ -1290,6 +1331,10 @@
1290
1331
  "../../node_modules/@types/node-fetch/index.d.ts",
1291
1332
  "./src/migration/migration-adaptor.ts"
1292
1333
  ],
1334
+ "./src/migration/query-api.ts": [
1335
+ "./src/migration/migration-adaptor.ts",
1336
+ "./src/migration/migration.ts"
1337
+ ],
1293
1338
  "./src/migration/utils.ts": [
1294
1339
  "../forge-api/out/index.d.ts"
1295
1340
  ],
@@ -1326,8 +1371,12 @@
1326
1371
  "../../node_modules/@jest/types/build/index.d.ts",
1327
1372
  "../../node_modules/@jest/types/node_modules/chalk/index.d.ts",
1328
1373
  "../../node_modules/@types/babel__core/index.d.ts",
1374
+ "../../node_modules/@types/babel__core/node_modules/@babel/types/lib/index.d.ts",
1329
1375
  "../../node_modules/@types/babel__generator/index.d.ts",
1376
+ "../../node_modules/@types/babel__generator/node_modules/@babel/types/lib/index.d.ts",
1330
1377
  "../../node_modules/@types/babel__template/index.d.ts",
1378
+ "../../node_modules/@types/babel__template/node_modules/@babel/types/lib/index.d.ts",
1379
+ "../../node_modules/@types/babel__traverse/node_modules/@babel/types/lib/index.d.ts",
1331
1380
  "../../node_modules/@types/babel__traverse/ts4.1/index.d.ts",
1332
1381
  "../../node_modules/@types/events/index.d.ts",
1333
1382
  "../../node_modules/@types/istanbul-lib-coverage/index.d.ts",
@@ -1434,11 +1483,13 @@
1434
1483
  "../forge-auth/out/types.d.ts",
1435
1484
  "./src/__test__/errors.test.ts",
1436
1485
  "./src/__test__/migration.test.ts",
1486
+ "./src/__test__/query-api.test.ts",
1437
1487
  "./src/index.ts",
1438
1488
  "./src/migration/errors.ts",
1439
1489
  "./src/migration/index.ts",
1440
1490
  "./src/migration/migration-adaptor.ts",
1441
1491
  "./src/migration/migration.ts",
1492
+ "./src/migration/query-api.ts",
1442
1493
  "./src/migration/utils.ts",
1443
1494
  "../forge-storage/out/conditions.d.ts",
1444
1495
  "../forge-storage/out/errors.d.ts",