@spoosh/plugin-deduplication 0.2.0 → 0.3.0
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -15,7 +15,7 @@ type DeduplicationWriteOptions = {
|
|
|
15
15
|
/** Override deduplication for this request. */
|
|
16
16
|
dedupe?: DedupeMode;
|
|
17
17
|
};
|
|
18
|
-
type
|
|
18
|
+
type DeduplicationPagesOptions = {
|
|
19
19
|
/** Override deduplication for this request. */
|
|
20
20
|
dedupe?: DedupeMode;
|
|
21
21
|
};
|
|
@@ -64,9 +64,9 @@ declare module "@spoosh/core" {
|
|
|
64
64
|
declare function deduplicationPlugin(config?: DeduplicationConfig): SpooshPlugin<{
|
|
65
65
|
readOptions: DeduplicationReadOptions;
|
|
66
66
|
writeOptions: DeduplicationWriteOptions;
|
|
67
|
-
|
|
67
|
+
pagesOptions: DeduplicationPagesOptions;
|
|
68
68
|
readResult: DeduplicationReadResult;
|
|
69
69
|
writeResult: DeduplicationWriteResult;
|
|
70
70
|
}>;
|
|
71
71
|
|
|
72
|
-
export { type DedupeMode, type DeduplicationConfig, type
|
|
72
|
+
export { type DedupeMode, type DeduplicationConfig, type DeduplicationPagesOptions, type DeduplicationReadOptions, type DeduplicationReadResult, type DeduplicationWriteOptions, type DeduplicationWriteResult, deduplicationPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type DeduplicationWriteOptions = {
|
|
|
15
15
|
/** Override deduplication for this request. */
|
|
16
16
|
dedupe?: DedupeMode;
|
|
17
17
|
};
|
|
18
|
-
type
|
|
18
|
+
type DeduplicationPagesOptions = {
|
|
19
19
|
/** Override deduplication for this request. */
|
|
20
20
|
dedupe?: DedupeMode;
|
|
21
21
|
};
|
|
@@ -64,9 +64,9 @@ declare module "@spoosh/core" {
|
|
|
64
64
|
declare function deduplicationPlugin(config?: DeduplicationConfig): SpooshPlugin<{
|
|
65
65
|
readOptions: DeduplicationReadOptions;
|
|
66
66
|
writeOptions: DeduplicationWriteOptions;
|
|
67
|
-
|
|
67
|
+
pagesOptions: DeduplicationPagesOptions;
|
|
68
68
|
readResult: DeduplicationReadResult;
|
|
69
69
|
writeResult: DeduplicationWriteResult;
|
|
70
70
|
}>;
|
|
71
71
|
|
|
72
|
-
export { type DedupeMode, type DeduplicationConfig, type
|
|
72
|
+
export { type DedupeMode, type DeduplicationConfig, type DeduplicationPagesOptions, type DeduplicationReadOptions, type DeduplicationReadResult, type DeduplicationWriteOptions, type DeduplicationWriteResult, deduplicationPlugin };
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ function deduplicationPlugin(config) {
|
|
|
33
33
|
};
|
|
34
34
|
return {
|
|
35
35
|
name: PLUGIN_NAME,
|
|
36
|
-
operations: ["read", "
|
|
36
|
+
operations: ["read", "pages", "write"],
|
|
37
37
|
middleware: async (context, next) => {
|
|
38
38
|
const et = context.eventTracer?.(PLUGIN_NAME);
|
|
39
39
|
const defaultMode = context.operationType === "write" ? resolvedConfig.write : resolvedConfig.read;
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ function deduplicationPlugin(config) {
|
|
|
7
7
|
};
|
|
8
8
|
return {
|
|
9
9
|
name: PLUGIN_NAME,
|
|
10
|
-
operations: ["read", "
|
|
10
|
+
operations: ["read", "pages", "write"],
|
|
11
11
|
middleware: async (context, next) => {
|
|
12
12
|
const et = context.eventTracer?.(PLUGIN_NAME);
|
|
13
13
|
const defaultMode = context.operationType === "write" ? resolvedConfig.write : resolvedConfig.read;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-deduplication",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Request deduplication plugin for Spoosh - prevents duplicate in-flight requests",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@spoosh/core": ">=0.
|
|
36
|
+
"@spoosh/core": ">=0.15.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@spoosh/
|
|
40
|
-
"@spoosh/
|
|
39
|
+
"@spoosh/test-utils": "0.3.0",
|
|
40
|
+
"@spoosh/core": "0.15.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "tsup --watch",
|