File tree Expand file tree Collapse file tree 8 files changed +99
-0
lines changed Expand file tree Collapse file tree 8 files changed +99
-0
lines changed Original file line number Diff line number Diff line change
1
+ ``` mermaid
2
+ sequenceDiagram
3
+ participant Client2
4
+ participant Client
5
+ participant Server
6
+ Client->>Server: POST /data (Idempotency-Key=1)
7
+ activate Server
8
+ Server->>Store: Check for Idempotency-Key=1 (Not Found)
9
+ activate Store
10
+ deactivate Store
11
+ Server->>Server: Process Requesy
12
+ Server->>Store: Store Response(Idempotency-Key=1)
13
+ activate Store
14
+ deactivate Store
15
+
16
+ alt Timed Out/Server Crash/Connection Lost
17
+ Server-xClient: No Repsponse
18
+ else Client Crash
19
+ Server-xClient: 201 Created
20
+ end
21
+ deactivate Server
22
+
23
+ Client->>Server: POST /data (Retry, Idempotency-Key=1)
24
+ activate Server
25
+ Server->>Store: Check Idempotency-Key=1 (Exists)
26
+ activate Store
27
+ deactivate Store
28
+ Server->>Client: 201 OK (Duplicate Request)
29
+ deactivate Server
30
+
31
+ Client->>Server: POST /data (Idempotency-Key=2)
32
+ activate Client
33
+ activate Server
34
+ Server->>Store: Check Idempotency-Key=2 (Not Exists)
35
+ activate Store
36
+ deactivate Store
37
+
38
+
39
+ Server->>Server: Process Request
40
+ Client2->>Server: POST /data (concurrent Req, Idempotency-Key=2)
41
+ activate Client2
42
+ Server->>Store: Check Idempotency-Key=2 (In-Progress)
43
+ activate Store
44
+ deactivate Store
45
+ Server->>Client2: 409 Conflict, Retry-After=1
46
+ deactivate Client2
47
+
48
+ Server->>Client: 201 Created
49
+ deactivate Server
50
+ deactivate Client
51
+
52
+ Client2->>Server: POST /data (Retried After, Idempotency-Key=2)
53
+ activate Client2
54
+ activate Server
55
+ Server->>Store: Check Idempotency-Key (Exists)
56
+ activate Store
57
+ deactivate Store
58
+ Server->>Client2: 201 Created
59
+ deactivate Client2
60
+ deactivate Server
61
+ ```
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ and powers,
23
23
24
24
- [ ` @node-idempotency/fastify ` ] ( https://www.npmjs.com/package/@node-idempotency/fastify ) - Plug and Play ` fastify ` plugin for ` @node-idempotency/core `
25
25
26
+ ---
27
+ #### How?
28
+ [](https://mermaid.live/edit#pako:eNqlVcFO4zAQ_ZWRT0VKVYj2spFAQmVXQrB0RTn2YtlTatHYwZ4gIsS_M4mBhjS0ajglmsyM35v3Jn4RymkUmQj4WKJVeGHkvZf5wgIU0pNRppCWYLo2aCntD3ejc_RP6Oto_D4-O4uhDP7P5ncw0ZIkjC415oUjPrUaX2F1enJUl0hF5kkStrrEt7oLOY8ZTFeoHmDpPGy1gNGNI_jrSqs73erSOqJxO7Y54AOmdwpDgNt6KqHqA9E8OCEUzgbcS2bX8U3mmuDO5KhhVtIkHgZTL8NqMnXWIhc5C9cuNNP-hPMcJ5zBjWMsRQRTZ-A64Pv4Y5v-svT4hD8jw9FNldVdkO8q7FXzFslXCfxQ1B5B_zybQGGImm2SsysYXZTF2qg6N-pKR0PJdmGmX-Ft1mIw8TQ6-UDyEfoeO9OGXvoNP-WsKr2vzcM126r28k0PYndpxwzr3jOu4dqmGfw6_g28IUtWlhJoXDg-XxJ69k6nyyfMb13SWoUeW_Q0a3sl3bEZhhe7QXXILIea5-c7k-4aRwthz5BEInL0uTSab5WX5vcmaIU5LkTGr1r6h4VY2FfOkyW5eWWVyMiXmIiy4IF93EAiW0r-hyUCtWGU_-I11dxWr2-vsVPq)
29
+
26
30
---
27
31
28
32
#### @node-idempotency/core
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ and powers
23
23
24
24
if above packages dont meet your needs, you can utilise the core package directly to tweek it as per your needs.
25
25
26
+ ---
27
+ #### How?
28
+ [](https://mermaid.live/edit#pako:eNqlVcFO4zAQ_ZWRT0VKVYj2spFAQmVXQrB0RTn2YtlTatHYwZ4gIsS_M4mBhjS0ajglmsyM35v3Jn4RymkUmQj4WKJVeGHkvZf5wgIU0pNRppCWYLo2aCntD3ejc_RP6Oto_D4-O4uhDP7P5ncw0ZIkjC415oUjPrUaX2F1enJUl0hF5kkStrrEt7oLOY8ZTFeoHmDpPGy1gNGNI_jrSqs73erSOqJxO7Y54AOmdwpDgNt6KqHqA9E8OCEUzgbcS2bX8U3mmuDO5KhhVtIkHgZTL8NqMnXWIhc5C9cuNNP-hPMcJ5zBjWMsRQRTZ-A64Pv4Y5v-svT4hD8jw9FNldVdkO8q7FXzFslXCfxQ1B5B_zybQGGImm2SsysYXZTF2qg6N-pKR0PJdmGmX-Ft1mIw8TQ6-UDyEfoeO9OGXvoNP-WsKr2vzcM126r28k0PYndpxwzr3jOu4dqmGfw6_g28IUtWlhJoXDg-XxJ69k6nyyfMb13SWoUeW_Q0a3sl3bEZhhe7QXXILIea5-c7k-4aRwthz5BEInL0uTSab5WX5vcmaIU5LkTGr1r6h4VY2FfOkyW5eWWVyMiXmIiy4IF93EAiW0r-hyUCtWGU_-I11dxWr2-vsVPq)
29
+
26
30
---
27
31
28
32
##### install
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ Network requests are unpredictable; clients/proxies may send duplicate or concur
16
16
- <i >Customizable:</i > options to tweak the library as per your need.
17
17
- <i >[ RFC] ( https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/ ) compliant: </i > Adheres to standards for compatibility with other systems/clients.
18
18
19
+ ---
20
+ #### How?
21
+ [](https://mermaid.live/edit#pako:eNqlVcFO4zAQ_ZWRT0VKVYj2spFAQmVXQrB0RTn2YtlTatHYwZ4gIsS_M4mBhjS0ajglmsyM35v3Jn4RymkUmQj4WKJVeGHkvZf5wgIU0pNRppCWYLo2aCntD3ejc_RP6Oto_D4-O4uhDP7P5ncw0ZIkjC415oUjPrUaX2F1enJUl0hF5kkStrrEt7oLOY8ZTFeoHmDpPGy1gNGNI_jrSqs73erSOqJxO7Y54AOmdwpDgNt6KqHqA9E8OCEUzgbcS2bX8U3mmuDO5KhhVtIkHgZTL8NqMnXWIhc5C9cuNNP-hPMcJ5zBjWMsRQRTZ-A64Pv4Y5v-svT4hD8jw9FNldVdkO8q7FXzFslXCfxQ1B5B_zybQGGImm2SsysYXZTF2qg6N-pKR0PJdmGmX-Ft1mIw8TQ6-UDyEfoeO9OGXvoNP-WsKr2vzcM126r28k0PYndpxwzr3jOu4dqmGfw6_g28IUtWlhJoXDg-XxJ69k6nyyfMb13SWoUeW_Q0a3sl3bEZhhe7QXXILIea5-c7k-4aRwthz5BEInL0uTSab5WX5vcmaIU5LkTGr1r6h4VY2FfOkyW5eWWVyMiXmIiy4IF93EAiW0r-hyUCtWGU_-I11dxWr2-vsVPq)
22
+
19
23
---
20
24
21
25
##### instal
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ Network requests are unpredictable; clients/proxies may send duplicate or concur
18
18
19
19
---
20
20
21
+ #### How?
22
+ [](https://mermaid.live/edit#pako:eNqlVcFO4zAQ_ZWRT0VKVYj2spFAQmVXQrB0RTn2YtlTatHYwZ4gIsS_M4mBhjS0ajglmsyM35v3Jn4RymkUmQj4WKJVeGHkvZf5wgIU0pNRppCWYLo2aCntD3ejc_RP6Oto_D4-O4uhDP7P5ncw0ZIkjC415oUjPrUaX2F1enJUl0hF5kkStrrEt7oLOY8ZTFeoHmDpPGy1gNGNI_jrSqs73erSOqJxO7Y54AOmdwpDgNt6KqHqA9E8OCEUzgbcS2bX8U3mmuDO5KhhVtIkHgZTL8NqMnXWIhc5C9cuNNP-hPMcJ5zBjWMsRQRTZ-A64Pv4Y5v-svT4hD8jw9FNldVdkO8q7FXzFslXCfxQ1B5B_zybQGGImm2SsysYXZTF2qg6N-pKR0PJdmGmX-Ft1mIw8TQ6-UDyEfoeO9OGXvoNP-WsKr2vzcM126r28k0PYndpxwzr3jOu4dqmGfw6_g28IUtWlhJoXDg-XxJ69k6nyyfMb13SWoUeW_Q0a3sl3bEZhhe7QXXILIea5-c7k-4aRwthz5BEInL0uTSab5WX5vcmaIU5LkTGr1r6h4VY2FfOkyW5eWWVyMiXmIiy4IF93EAiW0r-hyUCtWGU_-I11dxWr2-vsVPq)
23
+
24
+ ---
25
+
21
26
##### instal
22
27
23
28
``` bash
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ Network requests are unpredictable; clients/proxies may send duplicate or concur
18
18
19
19
---
20
20
21
+ #### How?
22
+ [](https://mermaid.live/edit#pako:eNqlVcFO4zAQ_ZWRT0VKVYj2spFAQmVXQrB0RTn2YtlTatHYwZ4gIsS_M4mBhjS0ajglmsyM35v3Jn4RymkUmQj4WKJVeGHkvZf5wgIU0pNRppCWYLo2aCntD3ejc_RP6Oto_D4-O4uhDP7P5ncw0ZIkjC415oUjPrUaX2F1enJUl0hF5kkStrrEt7oLOY8ZTFeoHmDpPGy1gNGNI_jrSqs73erSOqJxO7Y54AOmdwpDgNt6KqHqA9E8OCEUzgbcS2bX8U3mmuDO5KhhVtIkHgZTL8NqMnXWIhc5C9cuNNP-hPMcJ5zBjWMsRQRTZ-A64Pv4Y5v-svT4hD8jw9FNldVdkO8q7FXzFslXCfxQ1B5B_zybQGGImm2SsysYXZTF2qg6N-pKR0PJdmGmX-Ft1mIw8TQ6-UDyEfoeO9OGXvoNP-WsKr2vzcM126r28k0PYndpxwzr3jOu4dqmGfw6_g28IUtWlhJoXDg-XxJ69k6nyyfMb13SWoUeW_Q0a3sl3bEZhhe7QXXILIea5-c7k-4aRwthz5BEInL0uTSab5WX5vcmaIU5LkTGr1r6h4VY2FfOkyW5eWWVyMiXmIiy4IF93EAiW0r-hyUCtWGU_-I11dxWr2-vsVPq)
23
+
24
+ ---
25
+
21
26
##### instal
22
27
23
28
``` bash
Original file line number Diff line number Diff line change 1
1
#### node-idempotency/shared
2
+
3
+ Hey there!!! Thanks for landing here, you are probably not interested in this package but these,
4
+
5
+ - [ ` @node-idempotency/nestjs ` ] ( https://www.npmjs.com/package/@node-idempotency/nestjs ) - Plug and Play ` nestjs ` wrapper for ` @node-idempotency/core `
6
+
7
+ - [ ` @node-idempotency/express ` ] ( https://www.npmjs.com/package/@node-idempotency/express ) - Plug and Play ` express ` middleware for ` @node-idempotency/core `
8
+
9
+ - [ ` @node-idempotency/fastify ` ] ( https://www.npmjs.com/package/@node-idempotency/fastify ) - Plug and Play ` fastify ` plugin for ` @node-idempotency/core `
Original file line number Diff line number Diff line change 1
1
#### @node-idempotency/storage
2
2
3
3
Storage adapter interace for [ @node-idempotency ] ( https://www.npmjs.com/package/@node-idempotency/core ) .
4
+
5
+ Checkout these,
6
+
7
+ - [ ` @node-idempotency/nestjs ` ] ( https://www.npmjs.com/package/@node-idempotency/nestjs ) - Plug and Play ` nestjs ` wrapper for ` @node-idempotency/core `
8
+
9
+ - [ ` @node-idempotency/express ` ] ( https://www.npmjs.com/package/@node-idempotency/express ) - Plug and Play ` express ` middleware for ` @node-idempotency/core `
10
+
11
+ - [ ` @node-idempotency/fastify ` ] ( https://www.npmjs.com/package/@node-idempotency/fastify ) - Plug and Play ` fastify ` plugin for ` @node-idempotency/core `
You can’t perform that action at this time.
0 commit comments