@dxos/echo-protocol 2.33.8 → 2.33.9-dev.d70ac9ee

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 (88) hide show
  1. package/dist/src/feeds/feed-store-iterator.d.ts +1 -1
  2. package/dist/src/feeds/feed-store-iterator.d.ts.map +1 -1
  3. package/dist/src/feeds/feed-store-iterator.js.map +1 -1
  4. package/dist/src/feeds/feed-store-iterator.test.js +6 -7
  5. package/dist/src/feeds/feed-store-iterator.test.js.map +1 -1
  6. package/dist/src/index.d.ts +0 -1
  7. package/dist/src/index.d.ts.map +1 -1
  8. package/dist/src/index.js +0 -1
  9. package/dist/src/index.js.map +1 -1
  10. package/dist/src/proto/gen/dxos/credentials.d.ts.map +1 -1
  11. package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
  12. package/dist/src/proto/gen/dxos/echo/feed.js.map +1 -1
  13. package/dist/src/proto/gen/dxos/echo/invitation.d.ts.map +1 -1
  14. package/dist/src/proto/gen/dxos/echo/invitation.js.map +1 -1
  15. package/dist/src/proto/gen/dxos/echo/metadata.d.ts +6 -5
  16. package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  17. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  18. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
  19. package/dist/src/proto/gen/dxos/echo/testing.d.ts.map +1 -1
  20. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +1 -1
  21. package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -1
  22. package/dist/src/proto/gen/dxos/halo/keys.js.map +1 -1
  23. package/dist/src/proto/gen/dxos/test/echo.d.ts +11 -0
  24. package/dist/src/proto/gen/dxos/test/echo.d.ts.map +1 -0
  25. package/dist/src/proto/gen/dxos/test/echo.js +3 -0
  26. package/dist/src/proto/gen/dxos/test/echo.js.map +1 -0
  27. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  28. package/dist/src/proto/gen/index.d.ts +4 -0
  29. package/dist/src/proto/gen/index.d.ts.map +1 -1
  30. package/dist/src/proto/gen/index.js +1 -1
  31. package/dist/src/proto/gen/index.js.map +1 -1
  32. package/dist/src/proto/index.d.ts +3 -3
  33. package/dist/src/proto/index.d.ts.map +1 -1
  34. package/dist/src/proto/index.js +3 -3
  35. package/dist/src/proto/index.js.map +1 -1
  36. package/dist/src/proto/messages.d.ts +1 -1
  37. package/dist/src/proto/messages.d.ts.map +1 -1
  38. package/dist/src/proto/messages.js +1 -1
  39. package/dist/src/proto/messages.js.map +1 -1
  40. package/dist/src/proto/substitutions.d.ts +2 -2
  41. package/dist/src/proto/substitutions.d.ts.map +1 -1
  42. package/dist/src/proto/substitutions.js +1 -2
  43. package/dist/src/proto/substitutions.js.map +1 -1
  44. package/dist/src/types.d.ts +1 -2
  45. package/dist/src/types.d.ts.map +1 -1
  46. package/dist/src/types.js.map +1 -1
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +9 -9
  49. package/src/feeds/feed-store-iterator.test.ts +2 -3
  50. package/src/feeds/feed-store-iterator.ts +1 -2
  51. package/src/index.ts +0 -1
  52. package/src/proto/defs/import.proto +5 -3
  53. package/src/proto/gen/dxos/credentials.ts +1 -0
  54. package/src/proto/gen/dxos/echo/feed.ts +1 -0
  55. package/src/proto/gen/dxos/echo/invitation.ts +1 -0
  56. package/src/proto/gen/dxos/echo/metadata.ts +7 -5
  57. package/src/proto/gen/dxos/echo/service.ts +1 -0
  58. package/src/proto/gen/dxos/echo/snapshot.ts +1 -0
  59. package/src/proto/gen/dxos/echo/testing.ts +1 -0
  60. package/src/proto/gen/dxos/echo/timeframe.ts +1 -0
  61. package/src/proto/gen/dxos/halo/keys.ts +1 -0
  62. package/src/proto/gen/dxos/test/echo.ts +22 -0
  63. package/src/proto/gen/google/protobuf.ts +1 -0
  64. package/src/proto/gen/index.ts +5 -1
  65. package/src/proto/index.ts +4 -3
  66. package/src/proto/messages.ts +3 -2
  67. package/src/proto/substitutions.ts +1 -3
  68. package/src/types.ts +1 -2
  69. package/dist/src/spacetime/index.d.ts +0 -3
  70. package/dist/src/spacetime/index.d.ts.map +0 -1
  71. package/dist/src/spacetime/index.js +0 -22
  72. package/dist/src/spacetime/index.js.map +0 -1
  73. package/dist/src/spacetime/substitutions.d.ts +0 -13
  74. package/dist/src/spacetime/substitutions.d.ts.map +0 -1
  75. package/dist/src/spacetime/substitutions.js +0 -22
  76. package/dist/src/spacetime/substitutions.js.map +0 -1
  77. package/dist/src/spacetime/timeframe.d.ts +0 -45
  78. package/dist/src/spacetime/timeframe.d.ts.map +0 -1
  79. package/dist/src/spacetime/timeframe.js +0 -101
  80. package/dist/src/spacetime/timeframe.js.map +0 -1
  81. package/dist/src/spacetime/timeframe.test.d.ts +0 -2
  82. package/dist/src/spacetime/timeframe.test.d.ts.map +0 -1
  83. package/dist/src/spacetime/timeframe.test.js +0 -118
  84. package/dist/src/spacetime/timeframe.test.js.map +0 -1
  85. package/src/spacetime/index.ts +0 -6
  86. package/src/spacetime/substitutions.ts +0 -20
  87. package/src/spacetime/timeframe.test.ts +0 -132
  88. package/src/spacetime/timeframe.ts +0 -119
@@ -8,6 +8,7 @@ import * as dxos_echo_snapshot from "./dxos/echo/snapshot";
8
8
  import * as dxos_echo_testing from "./dxos/echo/testing";
9
9
  import * as dxos_echo_timeframe from "./dxos/echo/timeframe";
10
10
  import * as dxos_halo_keys from "./dxos/halo/keys";
11
+ import * as dxos_test_echo from "./dxos/test/echo";
11
12
  import * as google_protobuf from "./google/protobuf";
12
13
  import substitutions from "../substitutions";
13
14
  export interface TYPES {
@@ -53,11 +54,14 @@ export interface TYPES {
53
54
  "dxos.halo.keys.KeyType": dxos_halo_keys.KeyType;
54
55
  "dxos.halo.keys.PrivKey": dxos_halo_keys.PrivKey;
55
56
  "dxos.halo.keys.PubKey": dxos_halo_keys.PubKey;
57
+ "dxos.test.echo.TestItemMutation": dxos_test_echo.TestItemMutation;
58
+ "dxos.test.echo.TestItemSnapshot": dxos_test_echo.TestItemSnapshot;
59
+ "dxos.test.echo.TestListMutation": dxos_test_echo.TestListMutation;
56
60
  "google.protobuf.Any": google_protobuf.Any;
57
61
  "google.protobuf.Timestamp": google_protobuf.Timestamp;
58
62
  }
59
63
  export interface SERVICES {
60
64
  "dxos.echo.service.DataService": dxos_echo_service.DataService;
61
65
  }
62
- export const schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"credentials\":{\"nested\":{\"Message\":{\"fields\":{\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null}},\"comment\":null},\"SignedMessage\":{\"fields\":{\"signed\":{\"rule\":\"required\",\"type\":\"Signed\",\"id\":1,\"comment\":null},\"signatures\":{\"rule\":\"repeated\",\"type\":\"Signature\",\"id\":2,\"comment\":null}},\"nested\":{\"Signature\":{\"fields\":{\"key\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"signature\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"keyChain\":{\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"Signed\":{\"fields\":{\"created\":{\"rule\":\"required\",\"type\":\"string\",\"id\":1,\"comment\":null},\"nonce\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":10,\"comment\":null}},\"comment\":null}},\"comment\":\"A generic container message used whenever messages are signed (e.g. PartyCredential)\"}}},\"echo\":{\"nested\":{\"feed\":{\"nested\":{\"CredentialsMessage\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":\"A container for dxos.credentials.Message\"},\"EchoEnvelope\":{\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"genesis\":{\"type\":\"ItemGenesis\",\"id\":10,\"comment\":null},\"itemMutation\":{\"type\":\"ItemMutation\",\"id\":11,\"comment\":null},\"mutation\":{\"type\":\"bytes\",\"id\":12,\"comment\":null},\"snapshot\":{\"type\":\"ModelSnapshot\",\"id\":13,\"comment\":\"Set the model to the provided snapshot.\"}},\"comment\":\"Wrapper for all ECHO messages.\"},\"FeedMessage\":{\"oneofs\":{\"payload\":{\"oneof\":[\"halo\",\"echo\"],\"comment\":null}},\"fields\":{\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":1,\"comment\":null},\"halo\":{\"type\":\"CredentialsMessage\",\"id\":10,\"comment\":null},\"echo\":{\"type\":\"EchoEnvelope\",\"id\":11,\"comment\":null}},\"comment\":\"Outer message type decoded by Codec.\\nThis is what is written to the feeds.\"},\"ItemGenesis\":{\"fields\":{\"itemType\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":2,\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":3,\"comment\":null},\"link\":{\"type\":\"LinkData\",\"id\":4,\"comment\":null}},\"comment\":null},\"ItemMutation\":{\"fields\":{\"parentId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"action\":{\"type\":\"Action\",\"id\":2,\"comment\":null}},\"nested\":{\"Action\":{\"values\":{\"NOOP\":0,\"DELETE\":1,\"RESTORE\":2},\"comment\":null,\"comments\":{\"NOOP\":null,\"DELETE\":null,\"RESTORE\":null}}},\"comment\":\"Item mutation.\"},\"LinkData\":{\"fields\":{\"source\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"target\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"invitation\":{\"nested\":{\"InvitationDescriptor\":{\"fields\":{\"type\":{\"type\":\"Type\",\"id\":1,\"comment\":null},\"swarmKey\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"invitation\":{\"type\":\"bytes\",\"id\":3,\"comment\":null},\"identityKey\":{\"type\":\"bytes\",\"id\":4,\"comment\":\"Only present if type == OFFLINE.\"},\"secret\":{\"type\":\"bytes\",\"id\":5,\"comment\":\"Must be stripped out when passing to another peer.\"}},\"nested\":{\"Type\":{\"values\":{\"INTERACTIVE\":1,\"OFFLINE\":2},\"comment\":\"Defines an invitation type.\",\"comments\":{\"INTERACTIVE\":\"Interactive invitation is when both peers are online at the same time.\",\"OFFLINE\":\"Offline is when only a single peer needs to be online at the time.\"}}},\"comment\":null}}},\"metadata\":{\"nested\":{\"EchoMetadata\":{\"fields\":{\"version\":{\"type\":\"int32\",\"id\":1,\"comment\":\"Version number that is inceremnted every time there's a breaking change to the storage schema.\\n\\nThis is used to detect if the storage schema has changed since the last time the client was run.\\nLoading data from a different version will might result in an error.\"},\"parties\":{\"rule\":\"repeated\",\"type\":\"PartyMetadata\",\"id\":2,\"comment\":null},\"created\":{\"type\":\"google.protobuf.Timestamp\",\"id\":3,\"comment\":null},\"updated\":{\"type\":\"google.protobuf.Timestamp\",\"id\":4,\"comment\":null}},\"comment\":null},\"PartyMetadata\":{\"fields\":{\"key\":{\"type\":\"PubKey\",\"id\":1,\"comment\":\"Party key.\"},\"feedKeys\":{\"rule\":\"repeated\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"List of all feed associated with the party.\"},\"dataFeedKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":\"Key of the wriatable data feed.\"},\"controlFeedKey\":{\"type\":\"PubKey\",\"id\":4,\"comment\":\"Key of the wriatable control feed.\"},\"latestTimeframe\":{\"type\":\"TimeframeVector\",\"id\":5,\"comment\":null}},\"comment\":null}}},\"service\":{\"nested\":{\"DataService\":{\"methods\":{\"SubscribeEntitySet\":{\"requestType\":\"SubscribeEntitySetRequest\",\"responseType\":\"SubscribeEntitySetResponse\",\"responseStream\":true,\"comment\":null},\"SubscribeEntityStream\":{\"requestType\":\"SubscribeEntityStreamRequest\",\"responseType\":\"SubscribeEntityStreamResponse\",\"responseStream\":true,\"comment\":null},\"Write\":{\"requestType\":\"WriteRequest\",\"responseType\":\"MutationReceipt\",\"comment\":null}},\"comment\":null},\"MutationReceipt\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetResponse\":{\"fields\":{\"added\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"deleted\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"itemId\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamResponse\":{\"oneofs\":{\"kind\":{\"oneof\":[\"snapshot\",\"mutation\"],\"comment\":null}},\"fields\":{\"snapshot\":{\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"Mutation\",\"id\":2,\"comment\":null}},\"nested\":{\"Mutation\":{\"fields\":{\"data\":{\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"meta\":{\"type\":\"Metadata\",\"id\":2,\"comment\":null}},\"nested\":{\"Metadata\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"memberKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":4,\"comment\":null}},\"comment\":null}},\"comment\":null}},\"comment\":null},\"WriteRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"snapshot\":{\"nested\":{\"DatabaseSnapshot\":{\"fields\":{\"items\":{\"rule\":\"repeated\",\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"links\":{\"rule\":\"repeated\",\"type\":\"LinkSnapshot\",\"id\":2,\"comment\":null}},\"comment\":null},\"HaloStateSnapshot\":{\"fields\":{\"messages\":{\"rule\":\"repeated\",\"type\":\"dxos.CredentialsMessage\",\"id\":1,\"comment\":null}},\"comment\":null},\"ItemSnapshot\":{\"oneofs\":{\"_itemId\":{\"oneof\":[\"itemId\"]},\"_itemType\":{\"oneof\":[\"itemType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_parentId\":{\"oneof\":[\"parentId\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"itemType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"parentId\":{\"type\":\"string\",\"id\":5,\"options\":{\"proto3_optional\":true},\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":6,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"LinkSnapshot\":{\"oneofs\":{\"_linkId\":{\"oneof\":[\"linkId\"]},\"_linkType\":{\"oneof\":[\"linkType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"linkId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"linkType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"source\":{\"rule\":\"required\",\"type\":\"string\",\"id\":5,\"comment\":null},\"target\":{\"rule\":\"required\",\"type\":\"string\",\"id\":6,\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":7,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"ModelMutation\":{\"fields\":{\"mutation\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":1,\"comment\":null},\"meta\":{\"rule\":\"required\",\"type\":\"ModelMutationMeta\",\"id\":2,\"comment\":null}},\"comment\":null},\"ModelMutationMeta\":{\"fields\":{\"feedKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"rule\":\"required\",\"type\":\"int32\",\"id\":2,\"comment\":null},\"memberKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":3,\"comment\":null}},\"comment\":null},\"ModelSnapshot\":{\"oneofs\":{\"_snapshot\":{\"oneof\":[\"snapshot\"]}},\"fields\":{\"snapshot\":{\"type\":\"bytes\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":\"Encoded model snapshot (defined by the model's codec).\\nIf undefined the state machine will be initialized with it's default state.\"},\"mutations\":{\"rule\":\"repeated\",\"type\":\"ModelMutation\",\"id\":2,\"comment\":\"Mutations to be applied on top of the snapshot, or on top of initial state if the snapshot is undefined.\"}},\"comment\":null},\"PartySnapshot\":{\"fields\":{\"partyKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":2,\"comment\":null},\"timestamp\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"halo\":{\"type\":\"HaloStateSnapshot\",\"id\":11,\"comment\":null},\"database\":{\"type\":\"DatabaseSnapshot\",\"id\":12,\"comment\":null}},\"comment\":null}}},\"testing\":{\"nested\":{\"TestItemMutation\":{\"fields\":{\"key\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"value\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"TestItemSnapshot\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"TestItemMutation\",\"id\":1,\"comment\":null}},\"comment\":null},\"TestListMutation\":{\"fields\":{\"data\":{\"type\":\"string\",\"id\":1,\"comment\":null}},\"comment\":null}}},\"timeframe\":{\"nested\":{\"TimeframeVector\":{\"fields\":{\"frames\":{\"rule\":\"repeated\",\"type\":\"Frame\",\"id\":1,\"comment\":null}},\"nested\":{\"Frame\":{\"fields\":{\"feedKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null}},\"comment\":null}},\"comment\":\"Vector timestamp used to order messages.\"}}}}},\"halo\":{\"nested\":{\"keys\":{\"nested\":{\"KeyChain\":{\"fields\":{\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"message\":{\"rule\":\"required\",\"type\":\"SignedMessage\",\"id\":2,\"comment\":null},\"parents\":{\"rule\":\"repeated\",\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"KeyRecord\":{\"fields\":{\"type\":{\"rule\":\"required\",\"type\":\"KeyType\",\"id\":1,\"comment\":\"The `KeyType` type of the key. This is often unknown for keys from other sources.\"},\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"The public key as a Buffer (required).\"},\"secretKey\":{\"type\":\"PrivKey\",\"id\":3,\"comment\":\"The secret key as a Buffer (this will never be visible outside the Keyring).\"},\"hint\":{\"type\":\"bool\",\"id\":4,\"comment\":\"Is this key from a Greeting \\\"hint\\\"?\"},\"own\":{\"type\":\"bool\",\"id\":5,\"comment\":\"Determines if this is our key?\\nUsually true if `secretKey` is present; may be false for \\\"inception keys\\\" such as the Party key.\"},\"trusted\":{\"type\":\"bool\",\"id\":6,\"comment\":\"Is this key to be trusted?\"},\"added\":{\"type\":\"string\",\"id\":7,\"comment\":\"An RFC-3339 date/time string for when the key was added to the Keyring.\"},\"created\":{\"type\":\"string\",\"id\":8,\"comment\":\"An RFC-3339 date/time string for when the key was created.\"}},\"comment\":null},\"KeyRecordList\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"KeyRecord\",\"id\":1,\"comment\":null}},\"comment\":null},\"KeyType\":{\"values\":{\"UNKNOWN\":0,\"IDENTITY\":1,\"DEVICE\":2,\"PARTY\":3,\"FEED\":4,\"DXNS_ADDRESS\":5},\"comment\":null,\"comments\":{\"UNKNOWN\":null,\"IDENTITY\":null,\"DEVICE\":null,\"PARTY\":null,\"FEED\":null,\"DXNS_ADDRESS\":null}},\"PrivKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null},\"PubKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null}}}}}}},\"google\":{\"nested\":{\"protobuf\":{\"nested\":{\"Any\":{\"fields\":{\"type_url\":{\"type\":\"string\",\"id\":1},\"value\":{\"type\":\"bytes\",\"id\":2}},\"comment\":null},\"Timestamp\":{\"fields\":{\"seconds\":{\"type\":\"int64\",\"id\":1},\"nanos\":{\"type\":\"int32\",\"id\":2}},\"comment\":null}}}}}}}");
66
+ export const schemaJson = JSON.parse("{\"nested\":{\"dxos\":{\"nested\":{\"credentials\":{\"nested\":{\"Message\":{\"fields\":{\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":1,\"comment\":null}},\"comment\":null},\"SignedMessage\":{\"fields\":{\"signed\":{\"rule\":\"required\",\"type\":\"Signed\",\"id\":1,\"comment\":null},\"signatures\":{\"rule\":\"repeated\",\"type\":\"Signature\",\"id\":2,\"comment\":null}},\"nested\":{\"Signature\":{\"fields\":{\"key\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"signature\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"keyChain\":{\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"Signed\":{\"fields\":{\"created\":{\"rule\":\"required\",\"type\":\"string\",\"id\":1,\"comment\":null},\"nonce\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":2,\"comment\":null},\"payload\":{\"rule\":\"required\",\"type\":\"google.protobuf.Any\",\"id\":10,\"comment\":null}},\"comment\":null}},\"comment\":\"A generic container message used whenever messages are signed (e.g. PartyCredential)\"}}},\"echo\":{\"nested\":{\"feed\":{\"nested\":{\"CredentialsMessage\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":\"A container for dxos.credentials.Message\"},\"EchoEnvelope\":{\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"genesis\":{\"type\":\"ItemGenesis\",\"id\":10,\"comment\":null},\"itemMutation\":{\"type\":\"ItemMutation\",\"id\":11,\"comment\":null},\"mutation\":{\"type\":\"bytes\",\"id\":12,\"comment\":null},\"snapshot\":{\"type\":\"ModelSnapshot\",\"id\":13,\"comment\":\"Set the model to the provided snapshot.\"}},\"comment\":\"Wrapper for all ECHO messages.\"},\"FeedMessage\":{\"oneofs\":{\"payload\":{\"oneof\":[\"halo\",\"echo\"],\"comment\":null}},\"fields\":{\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":1,\"comment\":null},\"halo\":{\"type\":\"CredentialsMessage\",\"id\":10,\"comment\":null},\"echo\":{\"type\":\"EchoEnvelope\",\"id\":11,\"comment\":null}},\"comment\":\"Outer message type decoded by Codec.\\nThis is what is written to the feeds.\"},\"ItemGenesis\":{\"fields\":{\"itemType\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":2,\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":3,\"comment\":null},\"link\":{\"type\":\"LinkData\",\"id\":4,\"comment\":null}},\"comment\":null},\"ItemMutation\":{\"fields\":{\"parentId\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"action\":{\"type\":\"Action\",\"id\":2,\"comment\":null}},\"nested\":{\"Action\":{\"values\":{\"NOOP\":0,\"DELETE\":1,\"RESTORE\":2},\"comment\":null,\"comments\":{\"NOOP\":null,\"DELETE\":null,\"RESTORE\":null}}},\"comment\":\"Item mutation.\"},\"LinkData\":{\"fields\":{\"source\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"target\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"invitation\":{\"nested\":{\"InvitationDescriptor\":{\"fields\":{\"type\":{\"type\":\"Type\",\"id\":1,\"comment\":null},\"swarmKey\":{\"type\":\"bytes\",\"id\":2,\"comment\":null},\"invitation\":{\"type\":\"bytes\",\"id\":3,\"comment\":null},\"identityKey\":{\"type\":\"bytes\",\"id\":4,\"comment\":\"Only present if type == OFFLINE.\"},\"secret\":{\"type\":\"bytes\",\"id\":5,\"comment\":\"Must be stripped out when passing to another peer.\"}},\"nested\":{\"Type\":{\"values\":{\"INTERACTIVE\":1,\"OFFLINE\":2},\"comment\":\"Defines an invitation type.\",\"comments\":{\"INTERACTIVE\":\"Interactive invitation is when both peers are online at the same time.\",\"OFFLINE\":\"Offline is when only a single peer needs to be online at the time.\"}}},\"comment\":null}}},\"metadata\":{\"nested\":{\"EchoMetadata\":{\"fields\":{\"version\":{\"type\":\"int32\",\"id\":1,\"comment\":\"Version number that is inceremnted every time there's a breaking change to the storage schema.\\n\\nThis is used to detect if the storage schema has changed since the last time the client was run.\\nLoading data from a different version will might result in an error.\"},\"parties\":{\"rule\":\"repeated\",\"type\":\"PartyMetadata\",\"id\":2,\"comment\":null},\"created\":{\"type\":\"google.protobuf.Timestamp\",\"id\":3,\"comment\":null},\"updated\":{\"type\":\"google.protobuf.Timestamp\",\"id\":4,\"comment\":null}},\"comment\":null},\"PartyMetadata\":{\"fields\":{\"key\":{\"type\":\"PubKey\",\"id\":1,\"comment\":\"Party key.\"},\"genesisFeedKey\":{\"type\":\"PubKey\",\"id\":6,\"comment\":null},\"controlFeedKey\":{\"type\":\"PubKey\",\"id\":4,\"comment\":\"Key of the wriatable control feed.\"},\"dataFeedKey\":{\"type\":\"PubKey\",\"id\":3,\"comment\":\"Key of the wriatable data feed.\"},\"latestTimeframe\":{\"type\":\"TimeframeVector\",\"id\":5,\"comment\":null},\"feedKeys\":{\"rule\":\"repeated\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"List of all feed associated with the party.\"}},\"comment\":null}}},\"service\":{\"nested\":{\"DataService\":{\"methods\":{\"SubscribeEntitySet\":{\"requestType\":\"SubscribeEntitySetRequest\",\"responseType\":\"SubscribeEntitySetResponse\",\"responseStream\":true,\"comment\":null},\"SubscribeEntityStream\":{\"requestType\":\"SubscribeEntityStreamRequest\",\"responseType\":\"SubscribeEntityStreamResponse\",\"responseStream\":true,\"comment\":null},\"Write\":{\"requestType\":\"WriteRequest\",\"responseType\":\"MutationReceipt\",\"comment\":null}},\"comment\":null},\"MutationReceipt\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null}},\"comment\":null},\"SubscribeEntitySetResponse\":{\"fields\":{\"added\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"deleted\":{\"rule\":\"repeated\",\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"itemId\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"SubscribeEntityStreamResponse\":{\"oneofs\":{\"kind\":{\"oneof\":[\"snapshot\",\"mutation\"],\"comment\":null}},\"fields\":{\"snapshot\":{\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"Mutation\",\"id\":2,\"comment\":null}},\"nested\":{\"Mutation\":{\"fields\":{\"data\":{\"type\":\"EchoEnvelope\",\"id\":1,\"comment\":null},\"meta\":{\"type\":\"Metadata\",\"id\":2,\"comment\":null}},\"nested\":{\"Metadata\":{\"fields\":{\"feedKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"memberKey\":{\"type\":\"PubKey\",\"id\":2,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":4,\"comment\":null}},\"comment\":null}},\"comment\":null}},\"comment\":null},\"WriteRequest\":{\"fields\":{\"partyKey\":{\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"mutation\":{\"type\":\"EchoEnvelope\",\"id\":2,\"comment\":null}},\"comment\":null}}},\"snapshot\":{\"nested\":{\"DatabaseSnapshot\":{\"fields\":{\"items\":{\"rule\":\"repeated\",\"type\":\"ItemSnapshot\",\"id\":1,\"comment\":null},\"links\":{\"rule\":\"repeated\",\"type\":\"LinkSnapshot\",\"id\":2,\"comment\":null}},\"comment\":null},\"HaloStateSnapshot\":{\"fields\":{\"messages\":{\"rule\":\"repeated\",\"type\":\"dxos.CredentialsMessage\",\"id\":1,\"comment\":null}},\"comment\":null},\"ItemSnapshot\":{\"oneofs\":{\"_itemId\":{\"oneof\":[\"itemId\"]},\"_itemType\":{\"oneof\":[\"itemType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_parentId\":{\"oneof\":[\"parentId\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"itemId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"itemType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"parentId\":{\"type\":\"string\",\"id\":5,\"options\":{\"proto3_optional\":true},\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":6,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"LinkSnapshot\":{\"oneofs\":{\"_linkId\":{\"oneof\":[\"linkId\"]},\"_linkType\":{\"oneof\":[\"linkType\"]},\"_modelType\":{\"oneof\":[\"modelType\"]},\"_modelVersion\":{\"oneof\":[\"modelVersion\"]},\"_model\":{\"oneof\":[\"model\"]}},\"fields\":{\"linkId\":{\"type\":\"string\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":null},\"linkType\":{\"type\":\"string\",\"id\":2,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelType\":{\"type\":\"string\",\"id\":3,\"options\":{\"proto3_optional\":true},\"comment\":null},\"modelVersion\":{\"type\":\"string\",\"id\":4,\"options\":{\"proto3_optional\":true},\"comment\":null},\"source\":{\"rule\":\"required\",\"type\":\"string\",\"id\":5,\"comment\":null},\"target\":{\"rule\":\"required\",\"type\":\"string\",\"id\":6,\"comment\":null},\"model\":{\"type\":\"ModelSnapshot\",\"id\":7,\"options\":{\"proto3_optional\":true},\"comment\":null}},\"comment\":null},\"ModelMutation\":{\"fields\":{\"mutation\":{\"rule\":\"required\",\"type\":\"bytes\",\"id\":1,\"comment\":null},\"meta\":{\"rule\":\"required\",\"type\":\"ModelMutationMeta\",\"id\":2,\"comment\":null}},\"comment\":null},\"ModelMutationMeta\":{\"fields\":{\"feedKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":1,\"comment\":null},\"seq\":{\"rule\":\"required\",\"type\":\"int32\",\"id\":2,\"comment\":null},\"memberKey\":{\"rule\":\"required\",\"type\":\"dxos.halo.keys.PubKey\",\"id\":3,\"comment\":null}},\"comment\":null},\"ModelSnapshot\":{\"oneofs\":{\"_snapshot\":{\"oneof\":[\"snapshot\"]}},\"fields\":{\"snapshot\":{\"type\":\"bytes\",\"id\":1,\"options\":{\"proto3_optional\":true},\"comment\":\"Encoded model snapshot (defined by the model's codec).\\nIf undefined the state machine will be initialized with it's default state.\"},\"mutations\":{\"rule\":\"repeated\",\"type\":\"ModelMutation\",\"id\":2,\"comment\":\"Mutations to be applied on top of the snapshot, or on top of initial state if the snapshot is undefined.\"}},\"comment\":null},\"PartySnapshot\":{\"fields\":{\"partyKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"timeframe\":{\"type\":\"TimeframeVector\",\"id\":2,\"comment\":null},\"timestamp\":{\"type\":\"int32\",\"id\":3,\"comment\":null},\"halo\":{\"type\":\"HaloStateSnapshot\",\"id\":11,\"comment\":null},\"database\":{\"type\":\"DatabaseSnapshot\",\"id\":12,\"comment\":null}},\"comment\":null}}},\"testing\":{\"nested\":{\"TestItemMutation\":{\"fields\":{\"key\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"value\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"TestItemSnapshot\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"TestItemMutation\",\"id\":1,\"comment\":null}},\"comment\":null},\"TestListMutation\":{\"fields\":{\"data\":{\"type\":\"string\",\"id\":1,\"comment\":null}},\"comment\":null}}},\"timeframe\":{\"nested\":{\"TimeframeVector\":{\"fields\":{\"frames\":{\"rule\":\"repeated\",\"type\":\"Frame\",\"id\":1,\"comment\":null}},\"nested\":{\"Frame\":{\"fields\":{\"feedKey\":{\"type\":\"bytes\",\"id\":1,\"comment\":null},\"seq\":{\"type\":\"int32\",\"id\":3,\"comment\":null}},\"comment\":null}},\"comment\":\"Vector timestamp used to order messages.\"}}}}},\"halo\":{\"nested\":{\"keys\":{\"nested\":{\"KeyChain\":{\"fields\":{\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":1,\"comment\":null},\"message\":{\"rule\":\"required\",\"type\":\"SignedMessage\",\"id\":2,\"comment\":null},\"parents\":{\"rule\":\"repeated\",\"type\":\"KeyChain\",\"id\":3,\"comment\":null}},\"comment\":null},\"KeyRecord\":{\"fields\":{\"type\":{\"rule\":\"required\",\"type\":\"KeyType\",\"id\":1,\"comment\":\"The `KeyType` type of the key. This is often unknown for keys from other sources.\"},\"publicKey\":{\"rule\":\"required\",\"type\":\"PubKey\",\"id\":2,\"comment\":\"The public key as a Buffer (required).\"},\"secretKey\":{\"type\":\"PrivKey\",\"id\":3,\"comment\":\"The secret key as a Buffer (this will never be visible outside the Keyring).\"},\"hint\":{\"type\":\"bool\",\"id\":4,\"comment\":\"Is this key from a Greeting \\\"hint\\\"?\"},\"own\":{\"type\":\"bool\",\"id\":5,\"comment\":\"Determines if this is our key?\\nUsually true if `secretKey` is present; may be false for \\\"inception keys\\\" such as the Party key.\"},\"trusted\":{\"type\":\"bool\",\"id\":6,\"comment\":\"Is this key to be trusted?\"},\"added\":{\"type\":\"string\",\"id\":7,\"comment\":\"An RFC-3339 date/time string for when the key was added to the Keyring.\"},\"created\":{\"type\":\"string\",\"id\":8,\"comment\":\"An RFC-3339 date/time string for when the key was created.\"}},\"comment\":null},\"KeyRecordList\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"KeyRecord\",\"id\":1,\"comment\":null}},\"comment\":null},\"KeyType\":{\"values\":{\"UNKNOWN\":0,\"IDENTITY\":1,\"DEVICE\":2,\"PARTY\":3,\"FEED\":4,\"DXNS_ADDRESS\":5},\"comment\":null,\"comments\":{\"UNKNOWN\":null,\"IDENTITY\":null,\"DEVICE\":null,\"PARTY\":null,\"FEED\":null,\"DXNS_ADDRESS\":null}},\"PrivKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null},\"PubKey\":{\"fields\":{\"data\":{\"type\":\"bytes\",\"id\":1,\"comment\":null}},\"comment\":null}}}}},\"test\":{\"nested\":{\"echo\":{\"nested\":{\"TestItemMutation\":{\"fields\":{\"key\":{\"type\":\"string\",\"id\":1,\"comment\":null},\"value\":{\"type\":\"string\",\"id\":2,\"comment\":null}},\"comment\":null},\"TestItemSnapshot\":{\"fields\":{\"keys\":{\"rule\":\"repeated\",\"type\":\"TestItemMutation\",\"id\":1,\"comment\":null}},\"comment\":null},\"TestListMutation\":{\"fields\":{\"data\":{\"type\":\"string\",\"id\":1,\"comment\":null}},\"comment\":null}}}}}}},\"google\":{\"nested\":{\"protobuf\":{\"nested\":{\"Any\":{\"fields\":{\"type_url\":{\"type\":\"string\",\"id\":1},\"value\":{\"type\":\"bytes\",\"id\":2}},\"comment\":null},\"Timestamp\":{\"fields\":{\"seconds\":{\"type\":\"int64\",\"id\":1},\"nanos\":{\"type\":\"int32\",\"id\":2}},\"comment\":null}}}}}}}");
63
67
  export const schema = Schema.fromJson<TYPES, SERVICES>(schemaJson, substitutions);
@@ -6,11 +6,12 @@ import { schema } from './gen';
6
6
 
7
7
  export * from './gen';
8
8
  export * from './gen/dxos/echo/feed';
9
+ export * from './gen/dxos/echo/invitation';
9
10
  export * from './gen/dxos/echo/metadata';
10
- export * from './gen/dxos/echo/snapshot';
11
- export * from './gen/dxos/echo/testing';
12
11
  export * from './gen/dxos/echo/service';
13
- export * from './gen/dxos/echo/invitation';
12
+ export * from './gen/dxos/echo/snapshot';
13
+
14
+ export * from './gen/dxos/test/echo';
14
15
 
15
16
  export * from './messages';
16
17
 
@@ -2,7 +2,8 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- import { Timeframe } from '../spacetime';
5
+ import { Timeframe } from '@dxos/protocols';
6
+
6
7
  import { ItemID, ItemType } from '../types';
7
8
  import { schema } from './gen';
8
9
  import { FeedMessage } from './gen/dxos/echo/feed';
@@ -29,7 +30,7 @@ export const createTestItemMutation = (
29
30
  timeframe,
30
31
  echo: {
31
32
  itemId,
32
- mutation: schema.getCodecForType('dxos.echo.testing.TestItemMutation').encode({
33
+ mutation: schema.getCodecForType('dxos.test.echo.TestItemMutation').encode({
33
34
  key,
34
35
  value
35
36
  })
@@ -4,9 +4,7 @@
4
4
 
5
5
  import { timestampSubstitutions } from '@dxos/codec-protobuf';
6
6
  import { codec, Message } from '@dxos/credentials';
7
- import { publicKeySubstitutions } from '@dxos/protocols';
8
-
9
- import { timeframeSubstitutions } from '../spacetime';
7
+ import { publicKeySubstitutions, timeframeSubstitutions } from '@dxos/protocols';
10
8
 
11
9
  export default {
12
10
  ...timestampSubstitutions,
package/src/types.ts CHANGED
@@ -3,10 +3,9 @@
3
3
  //
4
4
 
5
5
  import { Message as HaloMessage } from '@dxos/credentials';
6
- import { PublicKey } from '@dxos/protocols';
6
+ import { PublicKey, Timeframe } from '@dxos/protocols';
7
7
 
8
8
  import { EchoEnvelope, FeedMessage } from './proto';
9
- import { Timeframe } from './spacetime/timeframe';
10
9
 
11
10
  //
12
11
  // Keys.
@@ -1,3 +0,0 @@
1
- export * from './timeframe';
2
- export * from './substitutions';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spacetime/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- __exportStar(require("./timeframe"), exports);
21
- __exportStar(require("./substitutions"), exports);
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/spacetime/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,8CAA4B;AAC5B,kDAAgC"}
@@ -1,13 +0,0 @@
1
- import { Timeframe } from './timeframe';
2
- export declare const timeframeSubstitutions: {
3
- 'dxos.echo.timeframe.TimeframeVector': {
4
- encode: (timeframe: Timeframe) => {
5
- frames: {
6
- feedKey: Uint8Array;
7
- seq: number;
8
- }[];
9
- };
10
- decode: (vector: any) => Timeframe;
11
- };
12
- };
13
- //# sourceMappingURL=substitutions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"substitutions.d.ts","sourceRoot":"","sources":["../../../src/spacetime/substitutions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,sBAAsB;;4BAEX,SAAS;;;;;;yBAGZ,GAAG;;CAMvB,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2022 DXOS.org
4
- //
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.timeframeSubstitutions = void 0;
7
- const protocols_1 = require("@dxos/protocols");
8
- const timeframe_1 = require("./timeframe");
9
- exports.timeframeSubstitutions = {
10
- 'dxos.echo.timeframe.TimeframeVector': {
11
- encode: (timeframe) => ({
12
- frames: timeframe.frames().map(([feedKey, seq]) => ({ feedKey: feedKey.asUint8Array(), seq }))
13
- }),
14
- decode: (vector) => {
15
- var _a;
16
- return new timeframe_1.Timeframe(((_a = vector.frames) !== null && _a !== void 0 ? _a : [])
17
- .filter((frame) => frame.feedKey != null && frame.seq != null)
18
- .map((frame) => [protocols_1.PublicKey.from(new Uint8Array(frame.feedKey)), frame.seq]));
19
- }
20
- }
21
- };
22
- //# sourceMappingURL=substitutions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"substitutions.js","sourceRoot":"","sources":["../../../src/spacetime/substitutions.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,+CAA4C;AAE5C,2CAAwC;AAE3B,QAAA,sBAAsB,GAAG;IACpC,qCAAqC,EAAE;QACrC,MAAM,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC;YACjC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;SAC/F,CAAC;QACF,MAAM,EAAE,CAAC,MAAW,EAAE,EAAE;;YAAC,OAAA,IAAI,qBAAS,CACpC,CAAC,MAAA,MAAM,CAAC,MAAM,mCAAI,EAAE,CAAC;iBAClB,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,IAAI,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;iBAClE,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,qBAAS,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CACnF,CAAA;SAAA;KACF;CACF,CAAC"}
@@ -1,45 +0,0 @@
1
- /// <reference types="node" />
2
- import { inspect } from 'util';
3
- import { FeedKey } from '../types';
4
- /**
5
- * A mapping of feed key to a sequence number on that feed.
6
- * Describes how many messages have been processed.
7
- */
8
- export declare class Timeframe {
9
- private readonly _frames;
10
- constructor(frames?: [FeedKey, number][]);
11
- get(key: FeedKey): number | undefined;
12
- set(key: FeedKey, value: number): void;
13
- frames(): [FeedKey, number][];
14
- size(): number;
15
- isEmpty(): boolean;
16
- /**
17
- * Returns a new timeframe with specified keys removed.
18
- * @param keys
19
- */
20
- withoutKeys(keys: FeedKey[]): Timeframe;
21
- /**
22
- * Returns a total amount of messages represented by this timeframe.
23
- */
24
- totalMessages(): number;
25
- toJSON(): Record<string, number>;
26
- toString(): string;
27
- /**
28
- * Used by NodeJS to get textual representation of this object when it's printed with a `console.log` statement.
29
- */
30
- [inspect.custom](): string;
31
- /**
32
- * Merges the values, updating the highest sequence numbers.
33
- * @param timeframes
34
- */
35
- static merge(...timeframes: Timeframe[]): Timeframe;
36
- /**
37
- * Compares two timeframes and returns an array of frames from the first timeframe where the sequence number
38
- * is greater than the associated sequence number from the second timeframe.
39
- *
40
- * @param tf1
41
- * @param tf2
42
- */
43
- static dependencies(tf1: Timeframe, tf2: Timeframe): Timeframe;
44
- }
45
- //# sourceMappingURL=timeframe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeframe.d.ts","sourceRoot":"","sources":["../../../src/spacetime/timeframe.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAI/B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyE;gBAEpF,MAAM,GAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAO;IAM7C,GAAG,CAAE,GAAG,EAAE,OAAO;IAIjB,GAAG,CAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;IAKhC,MAAM,IAAK,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;IAK9B,IAAI;IAKJ,OAAO;IAIP;;;OAGG;IACH,WAAW,CAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS;IAKxC;;OAEG;IACH,aAAa,IAAK,MAAM;IAIxB,MAAM;IAON,QAAQ;IAIR;;OAEG;IACH,CAAC,OAAO,CAAC,MAAM,CAAC;IAIhB;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAE,GAAG,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS;IAcpD;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CACjB,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,GAC7B,SAAS;CAWb"}
@@ -1,101 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Timeframe = void 0;
7
- const util_1 = require("util");
8
- const util_2 = require("@dxos/util");
9
- /**
10
- * A mapping of feed key to a sequence number on that feed.
11
- * Describes how many messages have been processed.
12
- */
13
- class Timeframe {
14
- constructor(frames = []) {
15
- this._frames = new util_2.ComplexMap(key => key.asUint8Array().toString());
16
- for (const [key, seq] of frames) {
17
- this._frames.set(key, seq);
18
- }
19
- }
20
- get(key) {
21
- return this._frames.get(key);
22
- }
23
- set(key, value) {
24
- this._frames.set(key, value);
25
- }
26
- // TODO(burdon): Change to getter.
27
- frames() {
28
- return Array.from(this._frames.entries());
29
- }
30
- // TODO(burdon): Change to getter.
31
- size() {
32
- return this._frames.size;
33
- }
34
- // TODO(burdon): Change to getter (empty).
35
- isEmpty() {
36
- return this.size() === 0;
37
- }
38
- /**
39
- * Returns a new timeframe with specified keys removed.
40
- * @param keys
41
- */
42
- withoutKeys(keys) {
43
- return new Timeframe(this.frames().filter(([frameKey]) => keys.every(key => Buffer.compare(key.asBuffer(), frameKey.asBuffer()) !== 0)));
44
- }
45
- /**
46
- * Returns a total amount of messages represented by this timeframe.
47
- */
48
- totalMessages() {
49
- return Array.from(this._frames.values()).reduce((acc, seq) => acc + seq + 1, 0);
50
- }
51
- toJSON() {
52
- return this.frames().reduce((frames, [key, seq]) => {
53
- frames[(0, util_2.humanize)(key)] = seq;
54
- return frames;
55
- }, {});
56
- }
57
- toString() {
58
- return `(${this.frames().map(([key, seq]) => `${(0, util_2.humanize)(key)} => ${seq}`).join(', ')})`;
59
- }
60
- /**
61
- * Used by NodeJS to get textual representation of this object when it's printed with a `console.log` statement.
62
- */
63
- [util_1.inspect.custom]() {
64
- return `Timeframe${this.toString()}`;
65
- }
66
- /**
67
- * Merges the values, updating the highest sequence numbers.
68
- * @param timeframes
69
- */
70
- static merge(...timeframes) {
71
- const result = new Timeframe();
72
- for (const timeframe of timeframes) {
73
- for (const [key, seq] of timeframe.frames()) {
74
- const current = result.get(key);
75
- if (current === undefined || seq > current) {
76
- result.set(key, seq);
77
- }
78
- }
79
- }
80
- return result;
81
- }
82
- /**
83
- * Compares two timeframes and returns an array of frames from the first timeframe where the sequence number
84
- * is greater than the associated sequence number from the second timeframe.
85
- *
86
- * @param tf1
87
- * @param tf2
88
- */
89
- static dependencies(tf1, tf2) {
90
- const result = new Timeframe();
91
- for (const [key, seq] of tf1.frames()) {
92
- const otherSeq = tf2.get(key);
93
- if (otherSeq === undefined || otherSeq < seq) {
94
- result.set(key, seq);
95
- }
96
- }
97
- return result;
98
- }
99
- }
100
- exports.Timeframe = Timeframe;
101
- //# sourceMappingURL=timeframe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeframe.js","sourceRoot":"","sources":["../../../src/spacetime/timeframe.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,+BAA+B;AAE/B,qCAAkD;AAIlD;;;GAGG;AACH,MAAa,SAAS;IAGpB,YAAa,SAA8B,EAAE;QAF5B,YAAO,GAAG,IAAI,iBAAU,CAAkB,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAG/F,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,EAAE;YAC/B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;SAC5B;IACH,CAAC;IAED,GAAG,CAAE,GAAY;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IAAI,QAAQ,GAAG,GAAG,EAAE;gBAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;aACtB;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxGD,8BAwGC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=timeframe.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeframe.test.d.ts","sourceRoot":"","sources":["../../../src/spacetime/timeframe.test.ts"],"names":[],"mappings":""}
@@ -1,118 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const debug_1 = __importDefault(require("debug"));
10
- const crypto_1 = require("@dxos/crypto");
11
- const protocols_1 = require("@dxos/protocols");
12
- const timeframe_1 = require("./timeframe");
13
- const log = (0, debug_1.default)('dxos:echo:spacetime:test');
14
- const createFeedKey = () => {
15
- const { publicKey } = (0, crypto_1.createKeyPair)();
16
- return protocols_1.PublicKey.from(publicKey);
17
- };
18
- describe('spacetime', () => {
19
- test('constructors', () => {
20
- const feedKey = createFeedKey();
21
- const tf1 = new timeframe_1.Timeframe([[feedKey, 1]]);
22
- log(tf1.toString());
23
- expect(tf1).toBeTruthy();
24
- });
25
- test('merge/subtract', () => {
26
- const feedKey1 = createFeedKey();
27
- const feedKey2 = createFeedKey();
28
- const feedKey3 = createFeedKey();
29
- {
30
- // Merge.
31
- const tf1 = new timeframe_1.Timeframe();
32
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 2], [feedKey2, 1]]);
33
- const tf3 = timeframe_1.Timeframe.merge(tf1, tf2);
34
- expect(tf3.frames()).toHaveLength(2);
35
- }
36
- {
37
- // Merge (no change).
38
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 1], [feedKey2, 1]]);
39
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 2], [feedKey3, 1]]);
40
- const tf3 = timeframe_1.Timeframe.merge(tf1, tf2);
41
- expect(tf3.frames()).toHaveLength(3);
42
- }
43
- {
44
- // Merge (no change).
45
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 1]]);
46
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 3]]);
47
- const tf3 = new timeframe_1.Timeframe([[feedKey1, 2]]);
48
- const tf4 = timeframe_1.Timeframe.merge(tf1, tf2, tf3);
49
- log(tf4.toString());
50
- expect(tf4.frames()).toHaveLength(1);
51
- expect(tf4.get(feedKey1)).toBe(3);
52
- }
53
- {
54
- // Remove keys.
55
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 1], [feedKey2, 2]]);
56
- const tf2 = tf1.withoutKeys([feedKey1, feedKey3]);
57
- expect(tf2.frames()).toHaveLength(1);
58
- }
59
- });
60
- test('dependencies', () => {
61
- const feedKey1 = createFeedKey();
62
- const feedKey2 = createFeedKey();
63
- const feedKey3 = createFeedKey();
64
- {
65
- const tf1 = new timeframe_1.Timeframe();
66
- const tf2 = new timeframe_1.Timeframe();
67
- const tf3 = timeframe_1.Timeframe.dependencies(tf1, tf2);
68
- log(tf3.toString());
69
- expect(tf3.frames()).toHaveLength(0);
70
- }
71
- {
72
- const tf1 = new timeframe_1.Timeframe();
73
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 10], [feedKey2, 11]]);
74
- const tf3 = timeframe_1.Timeframe.dependencies(tf1, tf2);
75
- log(tf3.toString());
76
- expect(tf3.frames()).toHaveLength(0);
77
- }
78
- {
79
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 10], [feedKey2, 10]]);
80
- const tf2 = new timeframe_1.Timeframe();
81
- const tf3 = timeframe_1.Timeframe.dependencies(tf1, tf2);
82
- log(tf3.toString());
83
- expect(tf3.frames()).toHaveLength(2);
84
- }
85
- // TODO(burdon): Test 0.
86
- {
87
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 0]]);
88
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 0]]);
89
- const tf3 = timeframe_1.Timeframe.dependencies(tf1, tf2);
90
- log(tf3.toString());
91
- expect(tf3.frames()).toHaveLength(0);
92
- }
93
- {
94
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 1]]);
95
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 1]]);
96
- const tf3 = timeframe_1.Timeframe.dependencies(tf1, tf2);
97
- log(tf1.toString());
98
- log(tf2.toString());
99
- log(tf3.toString());
100
- expect(tf3.frames()).toHaveLength(0);
101
- }
102
- {
103
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 10], [feedKey2, 10]]);
104
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 10], [feedKey2, 11]]);
105
- const tf3 = timeframe_1.Timeframe.dependencies(tf1, tf2);
106
- log(tf3.toString());
107
- expect(tf3.frames()).toHaveLength(0);
108
- }
109
- {
110
- const tf1 = new timeframe_1.Timeframe([[feedKey1, 10], [feedKey2, 10], [feedKey3, 10]]);
111
- const tf2 = new timeframe_1.Timeframe([[feedKey1, 10], [feedKey2, 9]]);
112
- const tf3 = timeframe_1.Timeframe.dependencies(tf1, tf2);
113
- log(tf3.toString());
114
- expect(tf3.frames()).toHaveLength(2);
115
- }
116
- });
117
- });
118
- //# sourceMappingURL=timeframe.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeframe.test.js","sourceRoot":"","sources":["../../../src/spacetime/timeframe.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,kDAA0B;AAE1B,yCAA6C;AAC7C,+CAA4C;AAE5C,2CAAwC;AAExC,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,0BAA0B,CAAC,CAAC;AAE9C,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,sBAAa,GAAE,CAAC;IACtC,OAAO,qBAAS,CAAC,IAAI,CAAC,S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CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;YAC5D,MAAM,GAAG,GAAG,qBAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC7C,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YACpB,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SACtC;QAED;YACE,MAAM,GAAG,GAAG,IAAI,qBAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;YAC5E,MAAM,GAAG,GAAG,IAAI,qBAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3D,MAAM,GAAG,GAAG,qBAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC7C,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YACpB,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SACtC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- export * from './timeframe';
6
- export * from './substitutions';
@@ -1,20 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
-
5
- import { PublicKey } from '@dxos/protocols';
6
-
7
- import { Timeframe } from './timeframe';
8
-
9
- export const timeframeSubstitutions = {
10
- 'dxos.echo.timeframe.TimeframeVector': {
11
- encode: (timeframe: Timeframe) => ({
12
- frames: timeframe.frames().map(([feedKey, seq]) => ({ feedKey: feedKey.asUint8Array(), seq }))
13
- }),
14
- decode: (vector: any) => new Timeframe(
15
- (vector.frames ?? [])
16
- .filter((frame: any) => frame.feedKey != null && frame.seq != null)
17
- .map((frame: any) => [PublicKey.from(new Uint8Array(frame.feedKey)), frame.seq])
18
- )
19
- }
20
- };