@sillsdev/docu-notion 0.16.2-alpha.1 → 0.16.2
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/images.js +9 -5
- package/package.json +1 -2
package/dist/images.js
CHANGED
|
@@ -38,7 +38,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
exports.cleanupOldImages = exports.parseImageBlock = exports.markdownToMDImageTransformer = exports.standardImageTransformer = exports.initImageHandling = void 0;
|
|
39
39
|
const fs = __importStar(require("fs-extra"));
|
|
40
40
|
const file_type_1 = __importDefault(require("file-type"));
|
|
41
|
-
const axios_1 = __importDefault(require("axios"));
|
|
42
41
|
const MakeImagePersistencePlan_1 = require("./MakeImagePersistencePlan");
|
|
43
42
|
const log_1 = require("./log");
|
|
44
43
|
const assets_1 = require("./assets");
|
|
@@ -133,10 +132,15 @@ function readPrimaryImage(imageSet) {
|
|
|
133
132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
133
|
// In Mar 2024, we started having a problem getting a particular gif from imgur using
|
|
135
134
|
// node-fetch. Switching to axios resolved it. I don't know why.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
// Then, in Apr 2025, we started getting 429 responses from imgur through axios,
|
|
136
|
+
// so we switched to node's built-in fetch (different than the node-fetch package).
|
|
137
|
+
// Just a guess, but probably imgur keeps locking down what it suspects as code running
|
|
138
|
+
// to scrape images.
|
|
139
|
+
// Apparently, imgur is getting to be more and more of a liability,
|
|
140
|
+
// so we should probably stop using it.
|
|
141
|
+
const response = yield fetch(imageSet.primaryUrl);
|
|
142
|
+
const arrayBuffer = yield response.arrayBuffer();
|
|
143
|
+
imageSet.primaryBuffer = Buffer.from(arrayBuffer);
|
|
140
144
|
imageSet.fileType = yield file_type_1.default.fromBuffer(imageSet.primaryBuffer);
|
|
141
145
|
});
|
|
142
146
|
}
|
package/package.json
CHANGED
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"//note: ts-node": "really is a runtime dependency",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@notionhq/client": "2.2.3",
|
|
29
|
-
"axios": "^1.6.8",
|
|
30
29
|
"chalk": "^4.1.2",
|
|
31
30
|
"commander": "^9.2.0",
|
|
32
31
|
"cosmiconfig": "^8.0.0",
|
|
@@ -91,5 +90,5 @@
|
|
|
91
90
|
"volta": {
|
|
92
91
|
"node": "18.16.0"
|
|
93
92
|
},
|
|
94
|
-
"version": "0.16.2
|
|
93
|
+
"version": "0.16.2"
|
|
95
94
|
}
|