@farukada/aws-langgraph-dynamodb-ts 0.4.0 → 0.7.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.
Files changed (90) hide show
  1. package/README.md +15 -4
  2. package/dist/checkpointer/actions/put-writes.d.ts +4 -4
  3. package/dist/checkpointer/actions/put-writes.d.ts.map +1 -1
  4. package/dist/checkpointer/actions/put-writes.js +22 -25
  5. package/dist/checkpointer/actions/put-writes.js.map +1 -1
  6. package/dist/checkpointer/actions/put.d.ts.map +1 -1
  7. package/dist/checkpointer/actions/put.js +2 -0
  8. package/dist/checkpointer/actions/put.js.map +1 -1
  9. package/dist/checkpointer/internal/item-writer.d.ts +18 -9
  10. package/dist/checkpointer/internal/item-writer.d.ts.map +1 -1
  11. package/dist/checkpointer/internal/item-writer.js +28 -11
  12. package/dist/checkpointer/internal/item-writer.js.map +1 -1
  13. package/dist/checkpointer/internal/special-write-cleanup.d.ts +18 -0
  14. package/dist/checkpointer/internal/special-write-cleanup.d.ts.map +1 -0
  15. package/dist/checkpointer/internal/special-write-cleanup.js +102 -0
  16. package/dist/checkpointer/internal/special-write-cleanup.js.map +1 -0
  17. package/dist/factory/factory.d.ts +2 -0
  18. package/dist/factory/factory.d.ts.map +1 -1
  19. package/dist/factory/factory.js.map +1 -1
  20. package/dist/history/actions/clear.js +1 -1
  21. package/dist/history/actions/clear.js.map +1 -1
  22. package/dist/history/internal/append-saga.js +24 -21
  23. package/dist/history/internal/append-saga.js.map +1 -1
  24. package/dist/history/internal/keys.d.ts +1 -1
  25. package/dist/history/internal/keys.d.ts.map +1 -1
  26. package/dist/history/internal/keys.js +12 -2
  27. package/dist/history/internal/keys.js.map +1 -1
  28. package/dist/history/internal/message-transaction.d.ts +11 -6
  29. package/dist/history/internal/message-transaction.d.ts.map +1 -1
  30. package/dist/history/internal/message-transaction.js +40 -13
  31. package/dist/history/internal/message-transaction.js.map +1 -1
  32. package/dist/history/internal/query.d.ts +5 -1
  33. package/dist/history/internal/query.d.ts.map +1 -1
  34. package/dist/history/internal/query.js +5 -2
  35. package/dist/history/internal/query.js.map +1 -1
  36. package/dist/history/internal/session-count.d.ts +20 -0
  37. package/dist/history/internal/session-count.d.ts.map +1 -0
  38. package/dist/history/internal/session-count.js +58 -0
  39. package/dist/history/internal/session-count.js.map +1 -0
  40. package/dist/history/internal/session-update.d.ts +4 -1
  41. package/dist/history/internal/session-update.d.ts.map +1 -1
  42. package/dist/history/internal/session-update.js +22 -2
  43. package/dist/history/internal/session-update.js.map +1 -1
  44. package/dist/shared/codec/s3/offloader.js +1 -1
  45. package/dist/shared/codec/s3/offloader.js.map +1 -1
  46. package/dist/shared/dynamodb/batch-write.d.ts +11 -1
  47. package/dist/shared/dynamodb/batch-write.d.ts.map +1 -1
  48. package/dist/shared/dynamodb/batch-write.js +24 -3
  49. package/dist/shared/dynamodb/batch-write.js.map +1 -1
  50. package/dist/shared/dynamodb/cancellation.d.ts +7 -0
  51. package/dist/shared/dynamodb/cancellation.d.ts.map +1 -0
  52. package/dist/shared/dynamodb/cancellation.js +8 -0
  53. package/dist/shared/dynamodb/cancellation.js.map +1 -0
  54. package/dist/shared/dynamodb/drain-unprocessed.d.ts +5 -1
  55. package/dist/shared/dynamodb/drain-unprocessed.d.ts.map +1 -1
  56. package/dist/shared/dynamodb/drain-unprocessed.js +20 -11
  57. package/dist/shared/dynamodb/drain-unprocessed.js.map +1 -1
  58. package/dist/shared/dynamodb/retry-classifier.d.ts.map +1 -1
  59. package/dist/shared/dynamodb/retry-classifier.js +2 -1
  60. package/dist/shared/dynamodb/retry-classifier.js.map +1 -1
  61. package/dist/shared/errors/errors.d.ts +11 -3
  62. package/dist/shared/errors/errors.d.ts.map +1 -1
  63. package/dist/shared/errors/errors.js +14 -5
  64. package/dist/shared/errors/errors.js.map +1 -1
  65. package/dist/shared/logging/redaction.d.ts +9 -2
  66. package/dist/shared/logging/redaction.d.ts.map +1 -1
  67. package/dist/shared/logging/redaction.js +15 -3
  68. package/dist/shared/logging/redaction.js.map +1 -1
  69. package/dist/store/actions/list-namespaces.d.ts.map +1 -1
  70. package/dist/store/actions/list-namespaces.js +10 -2
  71. package/dist/store/actions/list-namespaces.js.map +1 -1
  72. package/dist/store/actions/put.d.ts +5 -7
  73. package/dist/store/actions/put.d.ts.map +1 -1
  74. package/dist/store/actions/put.js +7 -28
  75. package/dist/store/actions/put.js.map +1 -1
  76. package/dist/store/internal/filter.d.ts.map +1 -1
  77. package/dist/store/internal/filter.js +6 -2
  78. package/dist/store/internal/filter.js.map +1 -1
  79. package/dist/store/internal/index-reconcile.d.ts.map +1 -1
  80. package/dist/store/internal/index-reconcile.js +1 -0
  81. package/dist/store/internal/index-reconcile.js.map +1 -1
  82. package/dist/store/internal/persist.d.ts +11 -0
  83. package/dist/store/internal/persist.d.ts.map +1 -0
  84. package/dist/store/internal/persist.js +38 -0
  85. package/dist/store/internal/persist.js.map +1 -0
  86. package/dist/store/internal/write-verify.d.ts +12 -0
  87. package/dist/store/internal/write-verify.d.ts.map +1 -0
  88. package/dist/store/internal/write-verify.js +28 -0
  89. package/dist/store/internal/write-verify.js.map +1 -0
  90. package/package.json +2 -2
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeLandedAt = writeLandedAt;
4
+ const codec_1 = require("../../shared/codec/codec");
5
+ const retry_1 = require("../../shared/dynamodb/retry");
6
+ /**
7
+ * True when `record`'s row already holds the S3 key `expectedS3Key` — i.e. an
8
+ * ambiguous retry-exhaustion write actually landed server-side and only its
9
+ * acknowledgment was lost. A failure reading this (itself possible) is not
10
+ * treated as confirmation — fail safe, matching the pre-fix behavior.
11
+ */
12
+ async function writeLandedAt(context, record, expectedS3Key) {
13
+ try {
14
+ const result = await (0, retry_1.withDynamoDBRetry)(() => context.client.get({
15
+ TableName: context.tableName,
16
+ Key: { PK: record.PK, SK: record.SK },
17
+ ConsistentRead: true,
18
+ ProjectionExpression: '#v',
19
+ ExpressionAttributeNames: { '#v': 'value' },
20
+ }));
21
+ const value = result.Item?.value;
22
+ return value?.location === codec_1.PayloadLocation.S3 && value.s3Key === expectedS3Key;
23
+ }
24
+ catch {
25
+ return false;
26
+ }
27
+ }
28
+ //# sourceMappingURL=write-verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-verify.js","sourceRoot":"","sources":["../../../src/store/internal/write-verify.ts"],"names":[],"mappings":";;;AAAA,oDAAmF;AACnF,uDAAgE;AAGhE;;;;;GAKG;AACI,KAAK,wBACV,OAAqB,EACrB,MAAkC,EAClC,aAAqB;IAErB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAiB,EAAC,GAAG,EAAE,CAC1C,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;YACjB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,GAAG,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE;YACrC,cAAc,EAAE,IAAI;YACpB,oBAAoB,EAAE,IAAI;YAC1B,wBAAwB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC5C,CAAC,CACH,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,KAAsC,CAAC;QAClE,OAAO,KAAK,EAAE,QAAQ,KAAK,uBAAe,CAAC,EAAE,IAAI,KAAK,CAAC,KAAK,KAAK,aAAa,CAAC;IACjF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farukada/aws-langgraph-dynamodb-ts",
3
- "version": "0.4.0",
3
+ "version": "0.7.0",
4
4
  "license": "MIT",
5
5
  "description": "AWS DynamoDB implementation for LangGraph Memory Store and Checkpoint Saver in TypeScript",
6
6
  "keywords": [
@@ -48,7 +48,7 @@
48
48
  "test:aws": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.aws.config.ts",
49
49
  "test:static": "jest test/static",
50
50
  "test:package-smoke": "node --test test/package-smoke/smoke.test.mjs",
51
- "prepublishOnly": "npm run typecheck && npm run lint && npm run build && npm test",
51
+ "prepublishOnly": "npm run typecheck && npm run typecheck:all && npm run lint && npm run build && npm test",
52
52
  "docs": "typedoc",
53
53
  "docs:watch": "typedoc --watch",
54
54
  "unused": "knip",