@crawlee/memory-storage 3.17.1-beta.6 → 3.17.1-beta.61

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.
@@ -4,7 +4,6 @@ exports.KeyValueFileSystemEntry = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const promises_1 = require("node:fs/promises");
6
6
  const node_path_1 = require("node:path");
7
- const win32_1 = require("node:path/win32");
8
7
  const async_queue_1 = require("@sapphire/async-queue");
9
8
  const fs_extra_1 = require("fs-extra");
10
9
  const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
@@ -62,7 +61,7 @@ class KeyValueFileSystemEntry {
62
61
  // Try without extension
63
62
  file = await (0, promises_1.readFile)((0, utils_1.resolveWithinDirectory)(this.storeDirectory, this.rawRecord.key));
64
63
  utils_1.memoryStorageLog.warning([
65
- `Key-value entry "${this.rawRecord.key}" for store ${(0, win32_1.basename)(this.storeDirectory)} does not have a file extension, assuming it as text.`,
64
+ `Key-value entry "${this.rawRecord.key}" for store ${(0, node_path_1.basename)(this.storeDirectory)} does not have a file extension, assuming it as text.`,
66
65
  'If you want to have correct interpretation of the file, you should add a file extension to the entry.',
67
66
  ].join('\n'));
68
67
  file = file.toString('utf-8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/memory-storage",
3
- "version": "3.17.1-beta.6",
3
+ "version": "3.17.1-beta.61",
4
4
  "description": "A simple in-memory storage implementation of the Apify API",
5
5
  "engines": {
6
6
  "node": ">= 16"
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@apify/log": "^2.4.0",
52
- "@crawlee/types": "3.17.1-beta.6",
52
+ "@crawlee/types": "3.17.1-beta.61",
53
53
  "@sapphire/async-queue": "^1.5.0",
54
54
  "@sapphire/shapeshift": "^3.0.0",
55
55
  "content-type": "^1.0.4",
@@ -67,5 +67,5 @@
67
67
  }
68
68
  }
69
69
  },
70
- "gitHead": "eda1d0870cfa01cfd7d2a4a9d0e4e6b99d18dea1"
70
+ "gitHead": "d13113f54e00408626b4f05032140b8667d85442"
71
71
  }
@@ -324,9 +324,7 @@ class KeyValueStoreClient extends base_client_1.BaseClient {
324
324
  key: shapeshift_1.s.string.lengthGreaterThan(0),
325
325
  value: shapeshift_1.s.union(shapeshift_1.s.null, shapeshift_1.s.string, shapeshift_1.s.number, shapeshift_1.s.instance(Buffer), shapeshift_1.s.instance(ArrayBuffer), shapeshift_1.s.typedArray(),
326
326
  // disabling validation will make shapeshift only check the object given is an actual object, not null, nor array
327
- shapeshift_1.s
328
- .object({})
329
- .setValidationEnabled(false)),
327
+ shapeshift_1.s.object({}).setValidationEnabled(false)),
330
328
  contentType: shapeshift_1.s.string.lengthGreaterThan(0).optional,
331
329
  }).parse(record);
332
330
  // Check by id
@@ -448,7 +448,7 @@ class RequestQueueClient extends base_client_1.BaseClient {
448
448
  if (isRequestHandledStateChanging) {
449
449
  existingQueueById.pendingRequestCount += requestWasHandledBeforeUpdate ? 1 : -1;
450
450
  }
451
- if (requestIsHandledAfterUpdate) {
451
+ if (isRequestHandledStateChanging && requestIsHandledAfterUpdate) {
452
452
  existingQueueById.handledRequestCount += 1;
453
453
  }
454
454
  existingQueueById.updateTimestamps(true);