@dxos/echo-pipeline 0.1.41 → 0.1.45-next.45667d4

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 (74) hide show
  1. package/dist/lib/browser/{chunk-4YAT2XJW.mjs → chunk-2NGLSBL4.mjs} +1128 -1017
  2. package/dist/lib/browser/chunk-2NGLSBL4.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -3
  4. package/dist/lib/browser/index.mjs.map +1 -1
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +72 -48
  7. package/dist/lib/browser/testing/index.mjs.map +3 -3
  8. package/dist/lib/node/index.cjs +1048 -938
  9. package/dist/lib/node/index.cjs.map +4 -4
  10. package/dist/lib/node/meta.json +1 -1
  11. package/dist/lib/node/testing/index.cjs +735 -540
  12. package/dist/lib/node/testing/index.cjs.map +4 -4
  13. package/dist/types/src/dbhost/database-host.d.ts +2 -4
  14. package/dist/types/src/dbhost/database-host.d.ts.map +1 -1
  15. package/dist/types/src/dbhost/snapshot-store.d.ts +2 -0
  16. package/dist/types/src/dbhost/snapshot-store.d.ts.map +1 -1
  17. package/dist/types/src/metadata/metadata-store.d.ts +3 -2
  18. package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
  19. package/dist/types/src/pipeline/pipeline.d.ts +27 -11
  20. package/dist/types/src/pipeline/pipeline.d.ts.map +1 -1
  21. package/dist/types/src/pipeline/timeframe-clock.d.ts +1 -0
  22. package/dist/types/src/pipeline/timeframe-clock.d.ts.map +1 -1
  23. package/dist/types/src/space/auth.d.ts +4 -4
  24. package/dist/types/src/space/auth.d.ts.map +1 -1
  25. package/dist/types/src/space/control-pipeline.d.ts +2 -4
  26. package/dist/types/src/space/control-pipeline.d.ts.map +1 -1
  27. package/dist/types/src/space/data-pipeline.d.ts +19 -10
  28. package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
  29. package/dist/types/src/space/index.d.ts +0 -1
  30. package/dist/types/src/space/index.d.ts.map +1 -1
  31. package/dist/types/src/space/space-manager.d.ts +14 -14
  32. package/dist/types/src/space/space-manager.d.ts.map +1 -1
  33. package/dist/types/src/space/space-protocol.d.ts +2 -2
  34. package/dist/types/src/space/space-protocol.d.ts.map +1 -1
  35. package/dist/types/src/space/space.d.ts +20 -7
  36. package/dist/types/src/space/space.d.ts.map +1 -1
  37. package/dist/types/src/testing/database-test-rig.d.ts.map +1 -1
  38. package/dist/types/src/testing/test-agent-builder.d.ts +15 -5
  39. package/dist/types/src/testing/test-agent-builder.d.ts.map +1 -1
  40. package/package.json +30 -30
  41. package/src/common/feeds.ts +2 -2
  42. package/src/dbhost/data-service-host.ts +10 -10
  43. package/src/dbhost/data-service.ts +1 -1
  44. package/src/dbhost/database-host.ts +1 -9
  45. package/src/dbhost/snapshot-store.test.ts +2 -2
  46. package/src/dbhost/snapshot-store.ts +16 -1
  47. package/src/metadata/metadata-store.ts +14 -16
  48. package/src/pipeline/message-selector.ts +1 -1
  49. package/src/pipeline/pipeline.test.ts +68 -44
  50. package/src/pipeline/pipeline.ts +118 -35
  51. package/src/pipeline/timeframe-clock.ts +8 -2
  52. package/src/space/auth.ts +6 -6
  53. package/src/space/control-pipeline.test.ts +19 -20
  54. package/src/space/control-pipeline.ts +3 -5
  55. package/src/space/data-pipeline.ts +131 -69
  56. package/src/space/index.ts +0 -1
  57. package/src/space/replication.browser.test.ts +8 -8
  58. package/src/space/space-manager.browser.test.ts +3 -3
  59. package/src/space/space-manager.ts +25 -20
  60. package/src/space/space-protocol.browser.test.ts +1 -1
  61. package/src/space/space-protocol.test.ts +6 -6
  62. package/src/space/space-protocol.ts +7 -7
  63. package/src/space/space.test.ts +137 -48
  64. package/src/space/space.ts +82 -40
  65. package/src/testing/database-test-rig.ts +25 -24
  66. package/src/testing/test-agent-builder.ts +88 -49
  67. package/src/testing/test-feed-builder.ts +1 -1
  68. package/src/testing/util.ts +15 -15
  69. package/src/tests/database-unit.test.ts +4 -4
  70. package/src/tests/database.test.ts +1 -1
  71. package/dist/lib/browser/chunk-4YAT2XJW.mjs.map +0 -7
  72. package/dist/types/src/space/genesis.d.ts +0 -5
  73. package/dist/types/src/space/genesis.d.ts.map +0 -1
  74. package/src/space/genesis.ts +0 -69
@@ -1,5 +0,0 @@
1
- import { Keyring } from '@dxos/keyring';
2
- import { Space } from './space';
3
- import { SigningContext } from './space-manager';
4
- export declare const spaceGenesis: (keyring: Keyring, signingContext: SigningContext, space: Space) => Promise<import("@dxos/protocols/proto/dxos/halo/credentials").Credential[]>;
5
- //# sourceMappingURL=genesis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"genesis.d.ts","sourceRoot":"","sources":["../../../../src/space/genesis.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,eAAO,MAAM,YAAY,YAAmB,OAAO,kBAAkB,cAAc,SAAS,KAAK,gFAwDhG,CAAC"}
@@ -1,69 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
-
5
- import { createCredential } from '@dxos/credentials';
6
- import { failUndefined } from '@dxos/debug';
7
- import { Keyring } from '@dxos/keyring';
8
- import { AdmittedFeed, SpaceMember } from '@dxos/protocols/proto/dxos/halo/credentials';
9
-
10
- import { Space } from './space';
11
- import { SigningContext } from './space-manager';
12
-
13
- export const spaceGenesis = async (keyring: Keyring, signingContext: SigningContext, space: Space) => {
14
- // TODO(dmaretskyi): Find a way to reconcile with credential generator.
15
- const credentials = [
16
- await createCredential({
17
- signer: keyring,
18
- issuer: space.key,
19
- subject: space.key,
20
- assertion: {
21
- '@type': 'dxos.halo.credentials.SpaceGenesis',
22
- spaceKey: space.key
23
- }
24
- }),
25
-
26
- await createCredential({
27
- signer: keyring,
28
- issuer: space.key,
29
- subject: signingContext.identityKey,
30
- assertion: {
31
- '@type': 'dxos.halo.credentials.SpaceMember',
32
- spaceKey: space.key,
33
- role: SpaceMember.Role.ADMIN,
34
- profile: signingContext.profile,
35
- genesisFeedKey: space.controlFeedKey ?? failUndefined()
36
- }
37
- }),
38
-
39
- await signingContext.credentialSigner.createCredential({
40
- subject: space.controlFeedKey ?? failUndefined(),
41
- assertion: {
42
- '@type': 'dxos.halo.credentials.AdmittedFeed',
43
- spaceKey: space.key,
44
- identityKey: signingContext.identityKey,
45
- deviceKey: signingContext.deviceKey,
46
- designation: AdmittedFeed.Designation.CONTROL
47
- }
48
- }),
49
-
50
- await signingContext.credentialSigner.createCredential({
51
- subject: space.dataFeedKey ?? failUndefined(),
52
- assertion: {
53
- '@type': 'dxos.halo.credentials.AdmittedFeed',
54
- spaceKey: space.key,
55
- identityKey: signingContext.identityKey,
56
- deviceKey: signingContext.deviceKey,
57
- designation: AdmittedFeed.Designation.DATA
58
- }
59
- })
60
- ];
61
-
62
- for (const credential of credentials) {
63
- await space.controlPipeline.writer.write({
64
- credential: { credential }
65
- });
66
- }
67
-
68
- return credentials;
69
- };