@forge/migrations
3.1.1-next.1-experimental-e03cc853.2.0-next.2
out/migration/migration.js~
out/migration/migration.jsModified+10
Index: package/out/migration/migration.js
===================================================================
--- package/out/migration/migration.js
+++ package/out/migration/migration.js
@@ -1,7 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Migration = void 0;
+const errors_1 = require("./errors");
+const ndjson_reader_1 = require("./ndjson-reader");
const utils_1 = require("./utils");
class Migration {
basePath = '/app/migration/forge/v1';
getMappingById = async (transferId, namespace, keys) => {
@@ -41,8 +43,16 @@
getConfluenceMacroIndexUrl = async (transferId) => {
const result = await (0, utils_1.invokePOSTApi)(`${this.basePath}/confluenceMacroIndex/${transferId}`, null);
return (0, utils_1.getResponseBody)(result);
};
+ async *getConfluenceMacroIndexIterator(transferId, { rowIndex = 0 } = {}) {
+ (0, ndjson_reader_1.assertValidStartRow)(rowIndex);
+ const response = await (0, utils_1.invokeGETApi)(`${this.basePath}/confluenceMacroIndex/download/${transferId}`);
+ if (response.status !== 200) {
+ throw errors_1.APIError.forStatus(response.status, response.statusText);
+ }
+ yield* (0, ndjson_reader_1.readNdjson)(await response.text(), { startRow: rowIndex });
+ }
messageProcessed = async (transferId, messageId) => {
const request = {
status: 'SUCCESS',
messageIds: [messageId]