@forge/migrations 0.2.11 → 0.3.0-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 +6 -0
- package/out/migration/index.d.ts +2 -5
- package/out/migration/index.d.ts.map +1 -1
- package/out/migration/index.js +2 -4
- package/out/migration/migration-adaptor.d.ts +1 -7
- package/out/migration/migration-adaptor.d.ts.map +1 -1
- package/out/migration/migration.d.ts +2 -3
- package/out/migration/migration.d.ts.map +1 -1
- package/out/migration/migration.js +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/out/migration/index.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { Migration } from './migration';
|
|
2
|
-
import { Progress } from './migration-adaptor';
|
|
3
2
|
import { DefaultQueryBuilder } from './query-api';
|
|
4
3
|
export declare const getMigrationInstance: (adapter: Migration) => {
|
|
5
|
-
sendProgress: (transferId: string, progress: Progress) => Promise<void>;
|
|
6
4
|
getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<import("./migration-adaptor").MappingResponse>;
|
|
7
|
-
|
|
5
|
+
messageProcessed: (transferId: string, messageId: string) => Promise<void>;
|
|
8
6
|
getAppDataList: (transferId: string) => Promise<import("./migration-adaptor").AppDataListResponse>;
|
|
9
7
|
getAppDataPayload: (s3Key: string) => Promise<import("./migration-adaptor").AppDataPayloadResponse>;
|
|
10
8
|
getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
|
|
11
9
|
getContainers: (transferId: string, containerType: string) => DefaultQueryBuilder;
|
|
12
10
|
};
|
|
13
11
|
export declare const migration: {
|
|
14
|
-
sendProgress: (transferId: string, progress: Progress) => Promise<void>;
|
|
15
12
|
getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<import("./migration-adaptor").MappingResponse>;
|
|
16
|
-
|
|
13
|
+
messageProcessed: (transferId: string, messageId: string) => Promise<void>;
|
|
17
14
|
getAppDataList: (transferId: string) => Promise<import("./migration-adaptor").AppDataListResponse>;
|
|
18
15
|
getAppDataPayload: (s3Key: string) => Promise<import("./migration-adaptor").AppDataPayloadResponse>;
|
|
19
16
|
getMappings: (transferId: string, namespace: string) => DefaultQueryBuilder;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,oBAAoB,YAAa,SAAS;iCAEtB,MAAM,aAAa,MAAM,QAAQ,MAAM,MAAM,CAAC;mCAE5C,MAAM,aAAa,MAAM;iCAC3B,MAAM;+BACR,MAAM;8BACP,MAAM,aAAa,MAAM;gCAEvB,MAAM,iBAAiB,MAAM;CAG5D,CAAC;AAEF,eAAO,MAAM,SAAS;iCACS,MAAM,aAAa,MAAM,QAAQ,MAAM,MAAM,CAAC;mCAE5C,MAAM,aAAa,MAAM;iCAE3B,MAAM;+BACR,MAAM;8BACP,MAAM,aAAa,MAAM;gCAEvB,MAAM,iBAAiB,MAAM;CAE1D,CAAC"}
|
package/out/migration/index.js
CHANGED
|
@@ -5,9 +5,8 @@ const migration_1 = require("./migration");
|
|
|
5
5
|
const query_api_1 = require("./query-api");
|
|
6
6
|
const getMigrationInstance = (adapter) => {
|
|
7
7
|
return {
|
|
8
|
-
sendProgress: (transferId, progress) => adapter.sendProgress(transferId, progress),
|
|
9
8
|
getMappingById: (transferId, namespace, keys) => adapter.getMappingById(transferId, namespace, keys),
|
|
10
|
-
|
|
9
|
+
messageProcessed: (transferId, messageId) => adapter.messageProcessed(transferId, messageId),
|
|
11
10
|
getAppDataList: (transferId) => adapter.getAppDataList(transferId),
|
|
12
11
|
getAppDataPayload: (s3Key) => adapter.getAppDataPayload(s3Key),
|
|
13
12
|
getMappings: (transferId, namespace) => new query_api_1.DefaultQueryBuilder(adapter, { transferId: transferId, namespace: namespace }),
|
|
@@ -16,9 +15,8 @@ const getMigrationInstance = (adapter) => {
|
|
|
16
15
|
};
|
|
17
16
|
exports.getMigrationInstance = getMigrationInstance;
|
|
18
17
|
exports.migration = {
|
|
19
|
-
sendProgress: (transferId, progress) => (0, exports.getMigrationInstance)(new migration_1.Migration()).sendProgress(transferId, progress),
|
|
20
18
|
getMappingById: (transferId, namespace, keys) => (0, exports.getMigrationInstance)(new migration_1.Migration()).getMappingById(transferId, namespace, keys),
|
|
21
|
-
|
|
19
|
+
messageProcessed: (transferId, messageId) => (0, exports.getMigrationInstance)(new migration_1.Migration()).messageProcessed(transferId, messageId),
|
|
22
20
|
getAppDataList: (transferId) => (0, exports.getMigrationInstance)(new migration_1.Migration()).getAppDataList(transferId),
|
|
23
21
|
getAppDataPayload: (s3Key) => (0, exports.getMigrationInstance)(new migration_1.Migration()).getAppDataPayload(s3Key),
|
|
24
22
|
getMappings: (transferId, namespace) => (0, exports.getMigrationInstance)(new migration_1.Migration()).getMappings(transferId, namespace),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export interface MigrationAdapter {
|
|
2
|
-
sendProgress(transferId: string, progress: Progress): Promise<void>;
|
|
3
2
|
getMappingById(transferId: string, namespace: string, keys: Array<string>): Promise<MappingResponse>;
|
|
4
3
|
getAppDataList(transferId: string): Promise<AppDataListResponse>;
|
|
5
4
|
getAppDataPayload(s3Key: string): Promise<AppDataPayloadResponse>;
|
|
6
|
-
|
|
5
|
+
messageProcessed(transferId: string, messageId: string): Promise<void>;
|
|
7
6
|
}
|
|
8
7
|
export interface MappingResponse {
|
|
9
8
|
result: Map<string, string>;
|
|
@@ -18,11 +17,6 @@ export interface AppDataListResponse {
|
|
|
18
17
|
export interface AppDataPayloadResponse {
|
|
19
18
|
url: string;
|
|
20
19
|
}
|
|
21
|
-
export interface Progress {
|
|
22
|
-
status: string;
|
|
23
|
-
percent: number;
|
|
24
|
-
message: string;
|
|
25
|
-
}
|
|
26
20
|
export interface PaginationMappingResponse {
|
|
27
21
|
meta: PaginationResponseMeta;
|
|
28
22
|
items: Map<string, string>;
|
|
@@ -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,
|
|
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,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAClE,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;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,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,11 +1,10 @@
|
|
|
1
|
-
import { AppDataListResponse, AppDataPayloadResponse, MappingResponse, MigrationAdapter,
|
|
1
|
+
import { AppDataListResponse, AppDataPayloadResponse, MappingResponse, MigrationAdapter, ListOptions, ListResults } from './migration-adaptor';
|
|
2
2
|
export declare class Migration implements MigrationAdapter {
|
|
3
3
|
private readonly basePath;
|
|
4
|
-
sendProgress: (transferId: string, progress: Progress) => Promise<void>;
|
|
5
4
|
getMappingById: (transferId: string, namespace: string, keys: Array<string>) => Promise<MappingResponse>;
|
|
6
5
|
getAppDataList: (transferId: string) => Promise<AppDataListResponse>;
|
|
7
6
|
getAppDataPayload: (s3Key: string) => Promise<AppDataPayloadResponse>;
|
|
8
|
-
|
|
7
|
+
messageProcessed: (transferId: string, messageId: string) => Promise<void>;
|
|
9
8
|
getMappings: (transferId: string, namespace?: string, lastEntity?: string, pageSize?: number) => Promise<ListResults>;
|
|
10
9
|
getContainers: (transferId: string, containerType?: string, lastEntity?: string, pageSize?: number) => Promise<ListResults>;
|
|
11
10
|
list: (options: ListOptions, 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,EACnB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EAIZ,MAAM,qBAAqB,CAAC;AAI7B,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,UAAiB,MAAM,KAAG,QAAQ,sBAAsB,CAAC,CAGxE;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"}
|
|
@@ -5,10 +5,6 @@ const utils_1 = require("./utils");
|
|
|
5
5
|
class Migration {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.basePath = '/app/migration/forge/v1';
|
|
8
|
-
this.sendProgress = async (transferId, progress) => {
|
|
9
|
-
const result = await (0, utils_1.invokePOSTApi)(`${this.basePath}/progress/${transferId}`, progress);
|
|
10
|
-
return (0, utils_1.getResponseBody)(result);
|
|
11
|
-
};
|
|
12
8
|
this.getMappingById = async (transferId, namespace, keys) => {
|
|
13
9
|
const result = await (0, utils_1.invokePOSTApi)(`${this.basePath}/mapping/${transferId}/find?namespace=${namespace}`, keys);
|
|
14
10
|
return (0, utils_1.getResponseBody)(result);
|
|
@@ -21,8 +17,12 @@ class Migration {
|
|
|
21
17
|
const result = await (0, utils_1.invokeGETApi)(`${this.basePath}/data/${s3Key}`);
|
|
22
18
|
return (0, utils_1.getResponseBody)(result);
|
|
23
19
|
};
|
|
24
|
-
this.
|
|
25
|
-
const
|
|
20
|
+
this.messageProcessed = async (transferId, messageId) => {
|
|
21
|
+
const request = {
|
|
22
|
+
status: 'SUCCESS',
|
|
23
|
+
messageIds: [messageId]
|
|
24
|
+
};
|
|
25
|
+
const result = await (0, utils_1.invokePOSTApi)(`${this.basePath}/message/${transferId}/status`, request);
|
|
26
26
|
return (0, utils_1.getResponseBody)(result);
|
|
27
27
|
};
|
|
28
28
|
this.getMappings = async (transferId, namespace, lastEntity, pageSize) => {
|