@spoosh/plugin-retry 0.3.2 → 0.4.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 +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -59,8 +59,10 @@ interface RetryWriteOptions {
|
|
|
59
59
|
shouldRetry?: ShouldRetryCallback;
|
|
60
60
|
}
|
|
61
61
|
type RetryInfiniteReadOptions = RetryReadOptions;
|
|
62
|
+
type RetryQueueOptions = RetryReadOptions;
|
|
62
63
|
type RetryReadResult = object;
|
|
63
64
|
type RetryWriteResult = object;
|
|
65
|
+
type RetryQueueResult = object;
|
|
64
66
|
|
|
65
67
|
/**
|
|
66
68
|
* Enables automatic retry for failed requests.
|
|
@@ -92,8 +94,10 @@ declare function retryPlugin(config?: RetryPluginConfig): SpooshPlugin<{
|
|
|
92
94
|
readOptions: RetryReadOptions;
|
|
93
95
|
writeOptions: RetryWriteOptions;
|
|
94
96
|
infiniteReadOptions: RetryInfiniteReadOptions;
|
|
97
|
+
queueOptions: RetryQueueOptions;
|
|
95
98
|
readResult: RetryReadResult;
|
|
96
99
|
writeResult: RetryWriteResult;
|
|
100
|
+
queueResult: RetryQueueResult;
|
|
97
101
|
}>;
|
|
98
102
|
|
|
99
|
-
export { DEFAULT_RETRY_STATUS_CODES, type RetryInfiniteReadOptions, type RetryPluginConfig, type RetryReadOptions, type RetryReadResult, type RetryWriteOptions, type RetryWriteResult, type ShouldRetryCallback, type ShouldRetryContext, retryPlugin };
|
|
103
|
+
export { DEFAULT_RETRY_STATUS_CODES, type RetryInfiniteReadOptions, type RetryPluginConfig, type RetryQueueOptions, type RetryQueueResult, type RetryReadOptions, type RetryReadResult, type RetryWriteOptions, type RetryWriteResult, type ShouldRetryCallback, type ShouldRetryContext, retryPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -59,8 +59,10 @@ interface RetryWriteOptions {
|
|
|
59
59
|
shouldRetry?: ShouldRetryCallback;
|
|
60
60
|
}
|
|
61
61
|
type RetryInfiniteReadOptions = RetryReadOptions;
|
|
62
|
+
type RetryQueueOptions = RetryReadOptions;
|
|
62
63
|
type RetryReadResult = object;
|
|
63
64
|
type RetryWriteResult = object;
|
|
65
|
+
type RetryQueueResult = object;
|
|
64
66
|
|
|
65
67
|
/**
|
|
66
68
|
* Enables automatic retry for failed requests.
|
|
@@ -92,8 +94,10 @@ declare function retryPlugin(config?: RetryPluginConfig): SpooshPlugin<{
|
|
|
92
94
|
readOptions: RetryReadOptions;
|
|
93
95
|
writeOptions: RetryWriteOptions;
|
|
94
96
|
infiniteReadOptions: RetryInfiniteReadOptions;
|
|
97
|
+
queueOptions: RetryQueueOptions;
|
|
95
98
|
readResult: RetryReadResult;
|
|
96
99
|
writeResult: RetryWriteResult;
|
|
100
|
+
queueResult: RetryQueueResult;
|
|
97
101
|
}>;
|
|
98
102
|
|
|
99
|
-
export { DEFAULT_RETRY_STATUS_CODES, type RetryInfiniteReadOptions, type RetryPluginConfig, type RetryReadOptions, type RetryReadResult, type RetryWriteOptions, type RetryWriteResult, type ShouldRetryCallback, type ShouldRetryContext, retryPlugin };
|
|
103
|
+
export { DEFAULT_RETRY_STATUS_CODES, type RetryInfiniteReadOptions, type RetryPluginConfig, type RetryQueueOptions, type RetryQueueResult, type RetryReadOptions, type RetryReadResult, type RetryWriteOptions, type RetryWriteResult, type ShouldRetryCallback, type ShouldRetryContext, retryPlugin };
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function retryPlugin(config = {}) {
|
|
|
51
51
|
} = config;
|
|
52
52
|
return {
|
|
53
53
|
name: PLUGIN_NAME,
|
|
54
|
-
operations: ["read", "write", "infiniteRead"],
|
|
54
|
+
operations: ["read", "write", "infiniteRead", "queue"],
|
|
55
55
|
priority: 200,
|
|
56
56
|
middleware: async (context, next) => {
|
|
57
57
|
const t = context.tracer?.(PLUGIN_NAME);
|
package/dist/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ function retryPlugin(config = {}) {
|
|
|
24
24
|
} = config;
|
|
25
25
|
return {
|
|
26
26
|
name: PLUGIN_NAME,
|
|
27
|
-
operations: ["read", "write", "infiniteRead"],
|
|
27
|
+
operations: ["read", "write", "infiniteRead", "queue"],
|
|
28
28
|
priority: 200,
|
|
29
29
|
middleware: async (context, next) => {
|
|
30
30
|
const t = context.tracer?.(PLUGIN_NAME);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-retry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Automatic retry plugin for Spoosh with configurable attempts and delay",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@spoosh/core": ">=0.
|
|
36
|
+
"@spoosh/core": ">=0.14.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@spoosh/core": "0.
|
|
39
|
+
"@spoosh/core": "0.14.0",
|
|
40
40
|
"@spoosh/test-utils": "0.2.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|