@decentrl/event-store 0.0.13 → 0.0.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"event-store.d.ts","sourceRoot":"","sources":["../src/event-store.ts"],"names":[],"mappings":"AAqBA,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,MAAM,SAAS,CAAC;AAQjB,qBAAa,kBAAkB;IAClB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAE5C;;OAEG;IACG,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBvE;;OAEG;IACG,WAAW,CAAC,CAAC,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IA2E7E;;OAEG;IACG,oBAAoB,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC;IAiD7C;;;OAGG;IACG,8BAA8B,CAAC,CAAC,EACrC,SAAS,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,GACnE,OAAO,CAAC,CAAC,EAAE,CAAC;IAgBf;;OAEG;IACG,eAAe,CACpB,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,GACzD,OAAO,CAAC,IAAI,CAAC;IAoBhB;;;OAGG;IACG,sBAAsB,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE;QAC5C,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EA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AGG;IACG,8BAA8B,CAAC,CAAC,EACrC,SAAS,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,GACnE,OAAO,CAAC,CAAC,EAAE,CAAC;IAgBf;;OAEG;IACG,eAAe,CACpB,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,GACzD,OAAO,CAAC,IAAI,CAAC;IAoBhB;;;OAGG;IACG,sBAAsB,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE;QAC5C,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,GAAG;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAkE/D;;OAEG;IACG,kBAAkB,CACvB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IAwCrC;;OAEG;IACG,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA4B7D;;OAEG;WACU,iBAAiB,CAC7B,OAAO,EAAE,kBAAkB,GACzB,OAAO,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;IA2D9C;;OAEG;YACW,kBAAkB;IAgFhC;;OAEG;YACW,eAAe;IAkD7B;;OAEG;YACW,YAAY;IA2C1B;;OAEG;YACW,kBAAkB;IAyChC;;OAEG;YACW,wBAAwB;CAmBtC"}
@@ -1,6 +1,7 @@
1
- import { base64Decode, decryptString, encryptString, generateEncryptedTag, multibaseDecode, signJsonObject, verifyJsonSignature, } from '@decentrl/crypto';
1
+ import { base64Decode, decryptString, encryptString, generateEncryptedTag, signJsonObject, verifyJsonSignature, } from '@decentrl/crypto';
2
2
  import { generateDirectAuthenticatedMediatorCommand, generateTwoWayPrivateMediatorCommand, } from '@decentrl/identity/communication-channels/mediator/direct-authenticated/command/command.service';
3
3
  import { generateOneWayPublicMediatorCommand } from '@decentrl/identity/communication-channels/mediator/one-way-public/command/command.service';
4
+ import { parseDecentrlDid } from '@decentrl/identity/did-decentrl/did-decentrl.parser';
4
5
  import axiosModule from 'axios';
5
6
  import { EventStoreError, } from './types';
6
7
  const DEFAULT_TIMEOUT_MS = 30_000;
@@ -423,17 +424,5 @@ export class DecentrlEventStore {
423
424
  }
424
425
  }
425
426
  const extractSigningKeyFromDid = (did) => {
426
- if (!did.startsWith('did:decentrl:')) {
427
- return null;
428
- }
429
- const parts = did.replace('did:decentrl:', '').split(':');
430
- if (parts.length !== 4) {
431
- return null;
432
- }
433
- try {
434
- return multibaseDecode(parts[1]);
435
- }
436
- catch {
437
- return null;
438
- }
427
+ return parseDecentrlDid(did)?.signingKey ?? null;
439
428
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@decentrl/event-store",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Event-driven storage and communication library for decentrl",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
8
  "axios": "^1.6.0",
9
- "@decentrl/crypto": "0.0.13",
10
- "@decentrl/identity": "0.0.13"
9
+ "@decentrl/crypto": "0.0.15",
10
+ "@decentrl/identity": "0.0.15"
11
11
  },
12
12
  "devDependencies": {
13
13
  "typescript": "^5.0.0",
@@ -18,6 +18,7 @@ import type { SaveEventsMediatorCommandResponse } from '@decentrl/identity/commu
18
18
  import type { UpdateEventTagsMediatorCommandResponse } from '@decentrl/identity/communication-channels/mediator/direct-authenticated/command/update-event-tags.schema';
19
19
  import type { PublishPublicEventResponse } from '@decentrl/identity/communication-channels/mediator/one-way-public/command/command.schema';
20
20
  import { generateOneWayPublicMediatorCommand } from '@decentrl/identity/communication-channels/mediator/one-way-public/command/command.service';
21
+ import { parseDecentrlDid } from '@decentrl/identity/did-decentrl/did-decentrl.parser';
21
22
  import axiosModule from 'axios';
22
23
  import {
23
24
  type EventStoreConfig,
@@ -704,19 +705,5 @@ export class DecentrlEventStore {
704
705
  }
705
706
 
706
707
  const extractSigningKeyFromDid = (did: string): Uint8Array | null => {
707
- if (!did.startsWith('did:decentrl:')) {
708
- return null;
709
- }
710
-
711
- const parts = did.replace('did:decentrl:', '').split(':');
712
-
713
- if (parts.length !== 4) {
714
- return null;
715
- }
716
-
717
- try {
718
- return multibaseDecode(parts[1]);
719
- } catch {
720
- return null;
721
- }
708
+ return parseDecentrlDid(did)?.signingKey ?? null;
722
709
  };