@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.
- package/dist/lib/browser/{chunk-4YAT2XJW.mjs → chunk-2NGLSBL4.mjs} +1128 -1017
- package/dist/lib/browser/chunk-2NGLSBL4.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -3
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +72 -48
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +1048 -938
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +735 -540
- package/dist/lib/node/testing/index.cjs.map +4 -4
- package/dist/types/src/dbhost/database-host.d.ts +2 -4
- package/dist/types/src/dbhost/database-host.d.ts.map +1 -1
- package/dist/types/src/dbhost/snapshot-store.d.ts +2 -0
- package/dist/types/src/dbhost/snapshot-store.d.ts.map +1 -1
- package/dist/types/src/metadata/metadata-store.d.ts +3 -2
- package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
- package/dist/types/src/pipeline/pipeline.d.ts +27 -11
- package/dist/types/src/pipeline/pipeline.d.ts.map +1 -1
- package/dist/types/src/pipeline/timeframe-clock.d.ts +1 -0
- package/dist/types/src/pipeline/timeframe-clock.d.ts.map +1 -1
- package/dist/types/src/space/auth.d.ts +4 -4
- package/dist/types/src/space/auth.d.ts.map +1 -1
- package/dist/types/src/space/control-pipeline.d.ts +2 -4
- package/dist/types/src/space/control-pipeline.d.ts.map +1 -1
- package/dist/types/src/space/data-pipeline.d.ts +19 -10
- package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
- package/dist/types/src/space/index.d.ts +0 -1
- package/dist/types/src/space/index.d.ts.map +1 -1
- package/dist/types/src/space/space-manager.d.ts +14 -14
- package/dist/types/src/space/space-manager.d.ts.map +1 -1
- package/dist/types/src/space/space-protocol.d.ts +2 -2
- package/dist/types/src/space/space-protocol.d.ts.map +1 -1
- package/dist/types/src/space/space.d.ts +20 -7
- package/dist/types/src/space/space.d.ts.map +1 -1
- package/dist/types/src/testing/database-test-rig.d.ts.map +1 -1
- package/dist/types/src/testing/test-agent-builder.d.ts +15 -5
- package/dist/types/src/testing/test-agent-builder.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/common/feeds.ts +2 -2
- package/src/dbhost/data-service-host.ts +10 -10
- package/src/dbhost/data-service.ts +1 -1
- package/src/dbhost/database-host.ts +1 -9
- package/src/dbhost/snapshot-store.test.ts +2 -2
- package/src/dbhost/snapshot-store.ts +16 -1
- package/src/metadata/metadata-store.ts +14 -16
- package/src/pipeline/message-selector.ts +1 -1
- package/src/pipeline/pipeline.test.ts +68 -44
- package/src/pipeline/pipeline.ts +118 -35
- package/src/pipeline/timeframe-clock.ts +8 -2
- package/src/space/auth.ts +6 -6
- package/src/space/control-pipeline.test.ts +19 -20
- package/src/space/control-pipeline.ts +3 -5
- package/src/space/data-pipeline.ts +131 -69
- package/src/space/index.ts +0 -1
- package/src/space/replication.browser.test.ts +8 -8
- package/src/space/space-manager.browser.test.ts +3 -3
- package/src/space/space-manager.ts +25 -20
- package/src/space/space-protocol.browser.test.ts +1 -1
- package/src/space/space-protocol.test.ts +6 -6
- package/src/space/space-protocol.ts +7 -7
- package/src/space/space.test.ts +137 -48
- package/src/space/space.ts +82 -40
- package/src/testing/database-test-rig.ts +25 -24
- package/src/testing/test-agent-builder.ts +88 -49
- package/src/testing/test-feed-builder.ts +1 -1
- package/src/testing/util.ts +15 -15
- package/src/tests/database-unit.test.ts +4 -4
- package/src/tests/database.test.ts +1 -1
- package/dist/lib/browser/chunk-4YAT2XJW.mjs.map +0 -7
- package/dist/types/src/space/genesis.d.ts +0 -5
- package/dist/types/src/space/genesis.d.ts.map +0 -1
- 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"}
|
package/src/space/genesis.ts
DELETED
|
@@ -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
|
-
};
|