@spoosh/plugin-deduplication 0.3.0 → 0.3.1

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/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { SpooshPlugin } from '@spoosh/core';
1
+ import * as _spoosh_core from '@spoosh/core';
2
2
 
3
3
  type DedupeMode = "in-flight" | false;
4
4
  type DeduplicationConfig = {
@@ -61,7 +61,7 @@ declare module "@spoosh/core" {
61
61
  * });
62
62
  * ```
63
63
  */
64
- declare function deduplicationPlugin(config?: DeduplicationConfig): SpooshPlugin<{
64
+ declare function deduplicationPlugin(config?: DeduplicationConfig): _spoosh_core.SpooshPlugin<{
65
65
  readOptions: DeduplicationReadOptions;
66
66
  writeOptions: DeduplicationWriteOptions;
67
67
  pagesOptions: DeduplicationPagesOptions;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SpooshPlugin } from '@spoosh/core';
1
+ import * as _spoosh_core from '@spoosh/core';
2
2
 
3
3
  type DedupeMode = "in-flight" | false;
4
4
  type DeduplicationConfig = {
@@ -61,7 +61,7 @@ declare module "@spoosh/core" {
61
61
  * });
62
62
  * ```
63
63
  */
64
- declare function deduplicationPlugin(config?: DeduplicationConfig): SpooshPlugin<{
64
+ declare function deduplicationPlugin(config?: DeduplicationConfig): _spoosh_core.SpooshPlugin<{
65
65
  readOptions: DeduplicationReadOptions;
66
66
  writeOptions: DeduplicationWriteOptions;
67
67
  pagesOptions: DeduplicationPagesOptions;
package/dist/index.js CHANGED
@@ -25,13 +25,14 @@ __export(src_exports, {
25
25
  module.exports = __toCommonJS(src_exports);
26
26
 
27
27
  // src/plugin.ts
28
+ var import_core = require("@spoosh/core");
28
29
  var PLUGIN_NAME = "spoosh:deduplication";
29
30
  function deduplicationPlugin(config) {
30
31
  const resolvedConfig = {
31
32
  read: config?.read ?? "in-flight",
32
33
  write: config?.write ?? false
33
34
  };
34
- return {
35
+ return (0, import_core.createSpooshPlugin)({
35
36
  name: PLUGIN_NAME,
36
37
  operations: ["read", "pages", "write"],
37
38
  middleware: async (context, next) => {
@@ -61,5 +62,5 @@ function deduplicationPlugin(config) {
61
62
  return dedupeMode === "in-flight";
62
63
  }
63
64
  })
64
- };
65
+ });
65
66
  }
package/dist/index.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  // src/plugin.ts
2
+ import { createSpooshPlugin } from "@spoosh/core";
2
3
  var PLUGIN_NAME = "spoosh:deduplication";
3
4
  function deduplicationPlugin(config) {
4
5
  const resolvedConfig = {
5
6
  read: config?.read ?? "in-flight",
6
7
  write: config?.write ?? false
7
8
  };
8
- return {
9
+ return createSpooshPlugin({
9
10
  name: PLUGIN_NAME,
10
11
  operations: ["read", "pages", "write"],
11
12
  middleware: async (context, next) => {
@@ -35,7 +36,7 @@ function deduplicationPlugin(config) {
35
36
  return dedupeMode === "in-flight";
36
37
  }
37
38
  })
38
- };
39
+ });
39
40
  }
40
41
  export {
41
42
  deduplicationPlugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-deduplication",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Request deduplication plugin for Spoosh - prevents duplicate in-flight requests",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "@spoosh/core": ">=0.15.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@spoosh/test-utils": "0.3.0",
40
- "@spoosh/core": "0.15.0"
39
+ "@spoosh/core": "0.15.1",
40
+ "@spoosh/test-utils": "0.3.0"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "tsup --watch",