@sillsdev/docu-notion 0.14.0-alpha.6 → 0.14.0-alpha.7

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/dist/pull.js CHANGED
@@ -217,7 +217,7 @@ function executeWithRateLimitAndRetries(label, asyncFunction) {
217
217
  (e === null || e === void 0 ? void 0 : e.code) === "notionhq_client_response_error" ||
218
218
  (e === null || e === void 0 ? void 0 : e.code) === "service_unavailable") {
219
219
  const secondsToWait = i + 1;
220
- (0, log_1.warning)(`While doing "${label}", got error "${e.message}". Will retry after ${secondsToWait}s...`);
220
+ (0, log_1.warning)(`While doing "${label}", got error "${e.message}". Will retry after ${secondsToWait}s...`);
221
221
  yield new Promise(resolve => setTimeout(resolve, 1000 * secondsToWait));
222
222
  }
223
223
  else {
package/dist/transform.js CHANGED
@@ -130,7 +130,14 @@ function doNotionToMarkdown(docunotionContext, blocks) {
130
130
  return __awaiter(this, void 0, void 0, function* () {
131
131
  let mdBlocks;
132
132
  yield (0, pull_1.executeWithRateLimitAndRetries)("notionToMarkdown.blocksToMarkdown", () => __awaiter(this, void 0, void 0, function* () {
133
- mdBlocks = yield docunotionContext.notionToMarkdown.blocksToMarkdown(blocks);
133
+ mdBlocks = yield docunotionContext.notionToMarkdown.blocksToMarkdown(
134
+ // We need to provide a copy of blocks.
135
+ // Calling blocksToMarkdown can modify the values in the blocks. If it does, and then
136
+ // we have to retry, we end up retrying with the modified values, which
137
+ // causes various issues (like using the transformed image url instead of the original one).
138
+ // Note, currently, we don't do anything else with blocks after this.
139
+ // If that changes, we'll need to figure out a more sophisticated approach.
140
+ JSON.parse(JSON.stringify(blocks)));
134
141
  }));
135
142
  const markdown = docunotionContext.notionToMarkdown.toMarkdownString(mdBlocks).parent || "";
136
143
  return markdown;
package/package.json CHANGED
@@ -90,5 +90,5 @@
90
90
  "volta": {
91
91
  "node": "18.16.0"
92
92
  },
93
- "version": "0.14.0-alpha.6"
93
+ "version": "0.14.0-alpha.7"
94
94
  }