@xyo-network/diviner-jsonpatch-memory 5.3.20 → 5.3.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-jsonpatch-memory",
3
- "version": "5.3.20",
3
+ "version": "5.3.24",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,37 +30,52 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
33
  "!**/*.bench.*",
35
34
  "!**/*.spec.*",
36
- "!**/*.test.*"
35
+ "!**/*.test.*",
36
+ "README.md"
37
37
  ],
38
38
  "dependencies": {
39
- "@xyo-network/diviner-abstract": "~5.3.20",
40
- "@xyo-network/diviner-jsonpatch-model": "~5.3.20",
41
- "@xyo-network/diviner-model": "~5.3.20",
42
- "@xyo-network/module-model": "~5.3.20",
43
- "@xyo-network/payload-model": "~5.3.20",
44
- "fast-json-patch": "~3.1.1"
39
+ "fast-json-patch": "~3.1.1",
40
+ "@xyo-network/diviner-abstract": "~5.3.24",
41
+ "@xyo-network/diviner-jsonpatch-model": "~5.3.24",
42
+ "@xyo-network/diviner-model": "~5.3.24",
43
+ "@xyo-network/payload-model": "~5.3.24",
44
+ "@xyo-network/module-model": "~5.3.24"
45
45
  },
46
46
  "devDependencies": {
47
- "@xylabs/sdk-js": "^5.0.90",
48
- "@xylabs/ts-scripts-common": "~7.5.6",
49
- "@xylabs/ts-scripts-yarn3": "~7.5.6",
50
- "@xylabs/tsconfig": "~7.5.6",
51
- "@xylabs/vitest-extended": "~5.0.90",
52
- "@xyo-network/wallet": "~5.3.20",
53
- "@xyo-network/wallet-model": "~5.3.20",
47
+ "@opentelemetry/api": "^1.9.1",
48
+ "@types/node": "^25.5.0",
49
+ "@xylabs/sdk-js": "^5.0.93",
50
+ "@xylabs/ts-scripts-common": "~7.6.16",
51
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
52
+ "@xylabs/tsconfig": "~7.6.16",
53
+ "@xylabs/vitest-extended": "~5.0.93",
54
+ "acorn": "^8.16.0",
55
+ "axios": "^1.14.0",
56
+ "esbuild": "^0.28.0",
57
+ "ethers": "^6.16.0",
58
+ "fast-json-patch": "~3.1.1",
59
+ "tslib": "^2.8.1",
54
60
  "typescript": "~5.9.3",
61
+ "vite": "^8.0.3",
55
62
  "vitest": "~4.1.2",
56
- "zod": "^4.3.6"
63
+ "zod": "^4.3.6",
64
+ "@xyo-network/diviner-abstract": "~5.3.24",
65
+ "@xyo-network/diviner-jsonpatch-model": "~5.3.24",
66
+ "@xyo-network/module-model": "~5.3.24",
67
+ "@xyo-network/diviner-model": "~5.3.24",
68
+ "@xyo-network/payload-model": "~5.3.24",
69
+ "@xyo-network/wallet": "~5.3.24",
70
+ "@xyo-network/wallet-model": "~5.3.24"
57
71
  },
58
72
  "peerDependencies": {
59
73
  "@xylabs/sdk-js": "^5",
74
+ "ethers": "^6",
60
75
  "tslib": "^2.8.1",
61
76
  "zod": "^4"
62
77
  },
63
78
  "publishConfig": {
64
79
  "access": "public"
65
80
  }
66
- }
81
+ }
package/src/Diviner.ts DELETED
@@ -1,45 +0,0 @@
1
- import { assertEx, exists } from '@xylabs/sdk-js'
2
- import { AbstractDiviner } from '@xyo-network/diviner-abstract'
3
- import type { JsonPatchDivinerParams } from '@xyo-network/diviner-jsonpatch-model'
4
- import { JsonPatchDivinerConfigSchema } from '@xyo-network/diviner-jsonpatch-model'
5
- import type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'
6
- import { creatableModule } from '@xyo-network/module-model'
7
- import type { Payload, Schema } from '@xyo-network/payload-model'
8
- import type { applyPatch, Operation } from 'fast-json-patch'
9
- import fastJsonPatch from 'fast-json-patch'
10
-
11
- const FJP = fastJsonPatch as { applyPatch: typeof applyPatch }
12
-
13
- @creatableModule()
14
- export class JsonPatchDiviner<
15
- TParams extends JsonPatchDivinerParams = JsonPatchDivinerParams,
16
- TIn extends Payload = Payload,
17
- TOut extends Payload = Payload,
18
- TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<
19
- DivinerInstance<TParams, TIn, TOut>,
20
- TIn,
21
- TOut
22
- >,
23
- > extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
24
- static override readonly configSchemas: Schema[] = [...super.configSchemas, JsonPatchDivinerConfigSchema]
25
- static override readonly defaultConfigSchema: Schema = JsonPatchDivinerConfigSchema
26
-
27
- protected get operations(): readonly Operation[] {
28
- return assertEx(this.config?.operations, () => 'JsonPatchDiviner: invalid operations')
29
- }
30
-
31
- protected override async divineHandler(payloads?: TIn[]): Promise<TOut[]> {
32
- const results = payloads
33
- ?.map((payload) => {
34
- try {
35
- const result = FJP.applyPatch(payload, this.operations, false, false)
36
- return result[0].newDocument as unknown as TOut
37
- } catch (error) {
38
- this.logger?.error('JsonPatchDiviner: failed to apply patch', error)
39
- return
40
- }
41
- })
42
- .filter(exists)
43
- return await Promise.resolve(results ?? [])
44
- }
45
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './Diviner.ts'