@forge/migrations 0.3.4-next.0 → 0.4.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 +17 -0
- package/out/migration/index.d.ts +2 -2
- package/out/migration/migration-adaptor.d.ts +2 -1
- package/out/migration/migration-adaptor.d.ts.map +1 -1
- package/out/migration/migration.d.ts +3 -2
- package/out/migration/migration.d.ts.map +1 -1
- package/out/migration/migration.js +6 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @forge/migrations
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4238b5a: Abstracting app data retrieval for Forge migrations
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [1588c76]
|
|
12
|
+
- @forge/api@3.6.0
|
|
13
|
+
|
|
14
|
+
## 0.4.0-next.1
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 4238b5a: Abstracting app data retrieval for Forge migrations
|
|
19
|
+
|
|
3
20
|
## 0.3.4-next.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/out/migration/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const getMigrationInstance: (adapter: Migration) => {
|
|
|
4
4
|
getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<import("./migration-adaptor").MappingResponse>;
|
|
5
5
|
messageProcessed: (transferId: string, messageId: string) => Promise<void>;
|
|
6
6
|
getAppDataList: (transferId: string) => Promise<import("./migration-adaptor").AppDataListResponse>;
|
|
7
|
-
getAppDataPayload: (s3Key: string) => Promise<import("
|
|
7
|
+
getAppDataPayload: (s3Key: string) => Promise<import("@forge/api").APIResponse>;
|
|
8
8
|
getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
|
|
9
9
|
getContainers: (transferId: string, containerType: string) => DefaultQueryBuilder;
|
|
10
10
|
};
|
|
@@ -12,7 +12,7 @@ export declare const migration: {
|
|
|
12
12
|
getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<import("./migration-adaptor").MappingResponse>;
|
|
13
13
|
messageProcessed: (transferId: string, messageId: string) => Promise<void>;
|
|
14
14
|
getAppDataList: (transferId: string) => Promise<import("./migration-adaptor").AppDataListResponse>;
|
|
15
|
-
getAppDataPayload: (s3Key: string) => Promise<import("
|
|
15
|
+
getAppDataPayload: (s3Key: string) => Promise<import("@forge/api").APIResponse>;
|
|
16
16
|
getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
|
|
17
17
|
getContainers: (transferId: string, containerType: string) => DefaultQueryBuilder;
|
|
18
18
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { APIResponse } from '@forge/api';
|
|
1
2
|
export interface MigrationAdapter {
|
|
2
3
|
getMappingById(transferId: string, namespace: string, keys: Array<string>): Promise<MappingResponse>;
|
|
3
4
|
getAppDataList(transferId: string): Promise<AppDataListResponse>;
|
|
4
|
-
getAppDataPayload(s3Key: string): Promise<
|
|
5
|
+
getAppDataPayload(s3Key: string): Promise<APIResponse>;
|
|
5
6
|
messageProcessed(transferId: string, messageId: string): Promise<void>;
|
|
6
7
|
}
|
|
7
8
|
export interface MappingResponse {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-adaptor.d.ts","sourceRoot":"","sources":["../../src/migration/migration-adaptor.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,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,KA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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,9 +1,10 @@
|
|
|
1
|
-
import { AppDataListResponse,
|
|
1
|
+
import { AppDataListResponse, MappingResponse, MigrationAdapter, ListOptions, ListResults } from './migration-adaptor';
|
|
2
|
+
import { APIResponse } from '@forge/api';
|
|
2
3
|
export declare class Migration implements MigrationAdapter {
|
|
3
4
|
private readonly basePath;
|
|
4
5
|
getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<MappingResponse>;
|
|
5
6
|
getAppDataList: (transferId: string) => Promise<AppDataListResponse>;
|
|
6
|
-
getAppDataPayload: (
|
|
7
|
+
getAppDataPayload: (key: string) => Promise<APIResponse>;
|
|
7
8
|
messageProcessed: (transferId: string, messageId: string) => Promise<void>;
|
|
8
9
|
getMappings: (transferId: string, namespace?: string, lastEntity?: string, pageSize?: number) => Promise<ListResults>;
|
|
9
10
|
getContainers: (transferId: string, containerType?: string, lastEntity?: string, pageSize?: number) => Promise<ListResults>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEnB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EAIZ,MAAM,qBAAqB,CAAC;AAE7B,OAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,qBAAa,SAAU,YAAW,gBAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD,cAAc,eAAsB,MAAM,aAAa,MAAM,QAAQ,MAAM,MAAM,CAAC,KAAG,QAAQ,eAAe,CAAC,CAG3G;IAEF,cAAc,eAAsB,MAAM,KAAG,QAAQ,mBAAmB,CAAC,CAGvE;IAEF,iBAAiB,QAAe,MAAM,KAAG,QAAQ,WAAW,CAAC,CAK3D;IAEF,gBAAgB,eAAsB,MAAM,aAAa,MAAM,KAAG,QAAQ,IAAI,CAAC,CAO7E;IAEF,WAAW,eACG,MAAM,cACN,MAAM,eACL,MAAM,aACR,MAAM,KAChB,QAAQ,WAAW,CAAC,CAuBrB;IAEF,aAAa,eACC,MAAM,kBACF,MAAM,eACT,MAAM,aACR,MAAM,KAChB,QAAQ,WAAW,CAAC,CAsBrB;IAEF,IAAI,YAAmB,WAAW,aAAa,MAAM,KAAG,QAAQ,WAAW,CAAC,CAI1E;CACH"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Migration = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const api_1 = tslib_1.__importDefault(require("@forge/api"));
|
|
4
6
|
const utils_1 = require("./utils");
|
|
5
7
|
class Migration {
|
|
6
8
|
constructor() {
|
|
@@ -13,9 +15,10 @@ class Migration {
|
|
|
13
15
|
const result = await (0, utils_1.invokeGETApi)(`${this.basePath}/data/${transferId}/all`);
|
|
14
16
|
return (0, utils_1.getResponseBody)(result);
|
|
15
17
|
};
|
|
16
|
-
this.getAppDataPayload = async (
|
|
17
|
-
const result = await (0, utils_1.invokeGETApi)(`${this.basePath}/data/${
|
|
18
|
-
|
|
18
|
+
this.getAppDataPayload = async (key) => {
|
|
19
|
+
const result = await (0, utils_1.invokeGETApi)(`${this.basePath}/data/${key}`);
|
|
20
|
+
const appDataPayload = await (0, utils_1.getResponseBody)(result);
|
|
21
|
+
return api_1.default.fetch(appDataPayload.url);
|
|
19
22
|
};
|
|
20
23
|
this.messageProcessed = async (transferId, messageId) => {
|
|
21
24
|
const request = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/migrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "App migration methods for Forge app",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"node-fetch": "2.7.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@forge/api": "3.6.0
|
|
21
|
+
"@forge/api": "3.6.0"
|
|
22
22
|
}
|
|
23
23
|
}
|