@dxos/client-services 0.1.0

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 (199) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/dist/src/errors.d.ts +8 -0
  4. package/dist/src/errors.d.ts.map +1 -0
  5. package/dist/src/errors.js +21 -0
  6. package/dist/src/errors.js.map +1 -0
  7. package/dist/src/index.d.ts +7 -0
  8. package/dist/src/index.d.ts.map +1 -0
  9. package/dist/src/index.js +26 -0
  10. package/dist/src/index.js.map +1 -0
  11. package/dist/src/packlets/devtools/devtools-host-events.d.ts +5 -0
  12. package/dist/src/packlets/devtools/devtools-host-events.d.ts.map +1 -0
  13. package/dist/src/packlets/devtools/devtools-host-events.js +14 -0
  14. package/dist/src/packlets/devtools/devtools-host-events.js.map +1 -0
  15. package/dist/src/packlets/devtools/feeds.d.ts +11 -0
  16. package/dist/src/packlets/devtools/feeds.d.ts.map +1 -0
  17. package/dist/src/packlets/devtools/feeds.js +72 -0
  18. package/dist/src/packlets/devtools/feeds.js.map +1 -0
  19. package/dist/src/packlets/devtools/index.d.ts +5 -0
  20. package/dist/src/packlets/devtools/index.d.ts.map +1 -0
  21. package/dist/src/packlets/devtools/index.js +24 -0
  22. package/dist/src/packlets/devtools/index.js.map +1 -0
  23. package/dist/src/packlets/devtools/network.d.ts +19 -0
  24. package/dist/src/packlets/devtools/network.d.ts.map +1 -0
  25. package/dist/src/packlets/devtools/network.js +79 -0
  26. package/dist/src/packlets/devtools/network.js.map +1 -0
  27. package/dist/src/packlets/devtools/spaces.d.ts +5 -0
  28. package/dist/src/packlets/devtools/spaces.d.ts.map +1 -0
  29. package/dist/src/packlets/devtools/spaces.js +38 -0
  30. package/dist/src/packlets/devtools/spaces.js.map +1 -0
  31. package/dist/src/packlets/identity/authenticator.d.ts +7 -0
  32. package/dist/src/packlets/identity/authenticator.d.ts.map +1 -0
  33. package/dist/src/packlets/identity/authenticator.js +40 -0
  34. package/dist/src/packlets/identity/authenticator.js.map +1 -0
  35. package/dist/src/packlets/identity/authenticator.test.d.ts +2 -0
  36. package/dist/src/packlets/identity/authenticator.test.d.ts.map +1 -0
  37. package/dist/src/packlets/identity/authenticator.test.js +32 -0
  38. package/dist/src/packlets/identity/authenticator.test.js.map +1 -0
  39. package/dist/src/packlets/identity/identity-manager.d.ts +35 -0
  40. package/dist/src/packlets/identity/identity-manager.d.ts.map +1 -0
  41. package/dist/src/packlets/identity/identity-manager.js +151 -0
  42. package/dist/src/packlets/identity/identity-manager.js.map +1 -0
  43. package/dist/src/packlets/identity/identity-manager.test.d.ts +2 -0
  44. package/dist/src/packlets/identity/identity-manager.test.d.ts.map +1 -0
  45. package/dist/src/packlets/identity/identity-manager.test.js +92 -0
  46. package/dist/src/packlets/identity/identity-manager.test.js.map +1 -0
  47. package/dist/src/packlets/identity/identity.d.ts +43 -0
  48. package/dist/src/packlets/identity/identity.d.ts.map +1 -0
  49. package/dist/src/packlets/identity/identity.js +74 -0
  50. package/dist/src/packlets/identity/identity.js.map +1 -0
  51. package/dist/src/packlets/identity/identity.test.d.ts +2 -0
  52. package/dist/src/packlets/identity/identity.test.d.ts.map +1 -0
  53. package/dist/src/packlets/identity/identity.test.js +258 -0
  54. package/dist/src/packlets/identity/identity.test.js.map +1 -0
  55. package/dist/src/packlets/identity/index.d.ts +4 -0
  56. package/dist/src/packlets/identity/index.d.ts.map +1 -0
  57. package/dist/src/packlets/identity/index.js +23 -0
  58. package/dist/src/packlets/identity/index.js.map +1 -0
  59. package/dist/src/packlets/invitations/common.d.ts +35 -0
  60. package/dist/src/packlets/invitations/common.d.ts.map +1 -0
  61. package/dist/src/packlets/invitations/common.js +12 -0
  62. package/dist/src/packlets/invitations/common.js.map +1 -0
  63. package/dist/src/packlets/invitations/halo-invitations.d.ts +23 -0
  64. package/dist/src/packlets/invitations/halo-invitations.d.ts.map +1 -0
  65. package/dist/src/packlets/invitations/halo-invitations.js +150 -0
  66. package/dist/src/packlets/invitations/halo-invitations.js.map +1 -0
  67. package/dist/src/packlets/invitations/index.d.ts +5 -0
  68. package/dist/src/packlets/invitations/index.d.ts.map +1 -0
  69. package/dist/src/packlets/invitations/index.js +24 -0
  70. package/dist/src/packlets/invitations/index.js.map +1 -0
  71. package/dist/src/packlets/invitations/invitation-wrapper.d.ts +36 -0
  72. package/dist/src/packlets/invitations/invitation-wrapper.d.ts.map +1 -0
  73. package/dist/src/packlets/invitations/invitation-wrapper.js +104 -0
  74. package/dist/src/packlets/invitations/invitation-wrapper.js.map +1 -0
  75. package/dist/src/packlets/invitations/observable.test.d.ts +2 -0
  76. package/dist/src/packlets/invitations/observable.test.d.ts.map +1 -0
  77. package/dist/src/packlets/invitations/observable.test.js +43 -0
  78. package/dist/src/packlets/invitations/observable.test.js.map +1 -0
  79. package/dist/src/packlets/invitations/space-invitations.d.ts +25 -0
  80. package/dist/src/packlets/invitations/space-invitations.d.ts.map +1 -0
  81. package/dist/src/packlets/invitations/space-invitations.js +136 -0
  82. package/dist/src/packlets/invitations/space-invitations.js.map +1 -0
  83. package/dist/src/packlets/services/impl/devtools.d.ts +34 -0
  84. package/dist/src/packlets/services/impl/devtools.d.ts.map +1 -0
  85. package/dist/src/packlets/services/impl/devtools.js +77 -0
  86. package/dist/src/packlets/services/impl/devtools.js.map +1 -0
  87. package/dist/src/packlets/services/impl/halo.d.ts +20 -0
  88. package/dist/src/packlets/services/impl/halo.d.ts.map +1 -0
  89. package/dist/src/packlets/services/impl/halo.js +93 -0
  90. package/dist/src/packlets/services/impl/halo.js.map +1 -0
  91. package/dist/src/packlets/services/impl/index.d.ts +6 -0
  92. package/dist/src/packlets/services/impl/index.d.ts.map +1 -0
  93. package/dist/src/packlets/services/impl/index.js +26 -0
  94. package/dist/src/packlets/services/impl/index.js.map +1 -0
  95. package/dist/src/packlets/services/impl/party.d.ts +25 -0
  96. package/dist/src/packlets/services/impl/party.d.ts.map +1 -0
  97. package/dist/src/packlets/services/impl/party.js +265 -0
  98. package/dist/src/packlets/services/impl/party.js.map +1 -0
  99. package/dist/src/packlets/services/impl/profile.d.ts +19 -0
  100. package/dist/src/packlets/services/impl/profile.d.ts.map +1 -0
  101. package/dist/src/packlets/services/impl/profile.js +120 -0
  102. package/dist/src/packlets/services/impl/profile.js.map +1 -0
  103. package/dist/src/packlets/services/impl/system.d.ts +9 -0
  104. package/dist/src/packlets/services/impl/system.d.ts.map +1 -0
  105. package/dist/src/packlets/services/impl/system.js +20 -0
  106. package/dist/src/packlets/services/impl/system.js.map +1 -0
  107. package/dist/src/packlets/services/impl/tracing.d.ts +12 -0
  108. package/dist/src/packlets/services/impl/tracing.d.ts.map +1 -0
  109. package/dist/src/packlets/services/impl/tracing.js +22 -0
  110. package/dist/src/packlets/services/impl/tracing.js.map +1 -0
  111. package/dist/src/packlets/services/index.d.ts +6 -0
  112. package/dist/src/packlets/services/index.d.ts.map +1 -0
  113. package/dist/src/packlets/services/index.js +25 -0
  114. package/dist/src/packlets/services/index.js.map +1 -0
  115. package/dist/src/packlets/services/service-context.d.ts +36 -0
  116. package/dist/src/packlets/services/service-context.d.ts.map +1 -0
  117. package/dist/src/packlets/services/service-context.js +112 -0
  118. package/dist/src/packlets/services/service-context.js.map +1 -0
  119. package/dist/src/packlets/services/service-factory.d.ts +15 -0
  120. package/dist/src/packlets/services/service-factory.d.ts.map +1 -0
  121. package/dist/src/packlets/services/service-factory.js +25 -0
  122. package/dist/src/packlets/services/service-factory.js.map +1 -0
  123. package/dist/src/packlets/services/service-host.d.ts +27 -0
  124. package/dist/src/packlets/services/service-host.d.ts.map +1 -0
  125. package/dist/src/packlets/services/service-host.js +78 -0
  126. package/dist/src/packlets/services/service-host.js.map +1 -0
  127. package/dist/src/packlets/services/service-host.test.d.ts +2 -0
  128. package/dist/src/packlets/services/service-host.test.d.ts.map +1 -0
  129. package/dist/src/packlets/services/service-host.test.js +78 -0
  130. package/dist/src/packlets/services/service-host.test.js.map +1 -0
  131. package/dist/src/packlets/services/services.d.ts +19 -0
  132. package/dist/src/packlets/services/services.d.ts.map +1 -0
  133. package/dist/src/packlets/services/services.js +19 -0
  134. package/dist/src/packlets/services/services.js.map +1 -0
  135. package/dist/src/packlets/services/signer.d.ts +9 -0
  136. package/dist/src/packlets/services/signer.d.ts.map +1 -0
  137. package/dist/src/packlets/services/signer.js +6 -0
  138. package/dist/src/packlets/services/signer.js.map +1 -0
  139. package/dist/src/packlets/services/testing/halo.test.d.ts +2 -0
  140. package/dist/src/packlets/services/testing/halo.test.d.ts.map +1 -0
  141. package/dist/src/packlets/services/testing/halo.test.js +34 -0
  142. package/dist/src/packlets/services/testing/halo.test.js.map +1 -0
  143. package/dist/src/packlets/services/testing/spaces.test.d.ts +2 -0
  144. package/dist/src/packlets/services/testing/spaces.test.d.ts.map +1 -0
  145. package/dist/src/packlets/services/testing/spaces.test.js +68 -0
  146. package/dist/src/packlets/services/testing/spaces.test.js.map +1 -0
  147. package/dist/src/packlets/services/testing/testing.d.ts +8 -0
  148. package/dist/src/packlets/services/testing/testing.d.ts.map +1 -0
  149. package/dist/src/packlets/services/testing/testing.js +23 -0
  150. package/dist/src/packlets/services/testing/testing.js.map +1 -0
  151. package/dist/src/packlets/storage/index.d.ts +2 -0
  152. package/dist/src/packlets/storage/index.d.ts.map +1 -0
  153. package/dist/src/packlets/storage/index.js +21 -0
  154. package/dist/src/packlets/storage/index.js.map +1 -0
  155. package/dist/src/packlets/storage/storage.d.ts +7 -0
  156. package/dist/src/packlets/storage/storage.d.ts.map +1 -0
  157. package/dist/src/packlets/storage/storage.js +89 -0
  158. package/dist/src/packlets/storage/storage.js.map +1 -0
  159. package/package.json +61 -0
  160. package/src/errors.ts +19 -0
  161. package/src/index.ts +11 -0
  162. package/src/packlets/devtools/devtools-host-events.ts +8 -0
  163. package/src/packlets/devtools/feeds.ts +91 -0
  164. package/src/packlets/devtools/index.ts +8 -0
  165. package/src/packlets/devtools/network.ts +89 -0
  166. package/src/packlets/devtools/spaces.ts +50 -0
  167. package/src/packlets/identity/authenticator.test.ts +32 -0
  168. package/src/packlets/identity/authenticator.ts +49 -0
  169. package/src/packlets/identity/identity-manager.test.ts +121 -0
  170. package/src/packlets/identity/identity-manager.ts +207 -0
  171. package/src/packlets/identity/identity.test.ts +295 -0
  172. package/src/packlets/identity/identity.ts +109 -0
  173. package/src/packlets/identity/index.ts +7 -0
  174. package/src/packlets/invitations/common.ts +48 -0
  175. package/src/packlets/invitations/halo-invitations.ts +162 -0
  176. package/src/packlets/invitations/index.ts +8 -0
  177. package/src/packlets/invitations/invitation-wrapper.ts +140 -0
  178. package/src/packlets/invitations/observable.test.ts +67 -0
  179. package/src/packlets/invitations/space-invitations.ts +159 -0
  180. package/src/packlets/services/impl/devtools.ts +141 -0
  181. package/src/packlets/services/impl/halo.ts +107 -0
  182. package/src/packlets/services/impl/index.ts +11 -0
  183. package/src/packlets/services/impl/party.ts +305 -0
  184. package/src/packlets/services/impl/profile.ts +141 -0
  185. package/src/packlets/services/impl/system.ts +19 -0
  186. package/src/packlets/services/impl/tracing.ts +21 -0
  187. package/src/packlets/services/index.ts +9 -0
  188. package/src/packlets/services/service-context.ts +151 -0
  189. package/src/packlets/services/service-factory.ts +35 -0
  190. package/src/packlets/services/service-host.test.ts +88 -0
  191. package/src/packlets/services/service-host.ts +101 -0
  192. package/src/packlets/services/services.ts +39 -0
  193. package/src/packlets/services/signer.ts +13 -0
  194. package/src/packlets/services/testing/halo.test.ts +40 -0
  195. package/src/packlets/services/testing/spaces.test.ts +87 -0
  196. package/src/packlets/services/testing/testing.ts +28 -0
  197. package/src/packlets/storage/index.ts +5 -0
  198. package/src/packlets/storage/storage.ts +97 -0
  199. package/src/typings.d.ts +5 -0
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2022 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 expect_1 = __importDefault(require("expect"));
10
+ const credentials_1 = require("@dxos/credentials");
11
+ const echo_db_1 = require("@dxos/echo-db");
12
+ const feed_store_1 = require("@dxos/feed-store");
13
+ const keyring_1 = require("@dxos/keyring");
14
+ const messaging_1 = require("@dxos/messaging");
15
+ const model_factory_1 = require("@dxos/model-factory");
16
+ const network_manager_1 = require("@dxos/network-manager");
17
+ const object_model_1 = require("@dxos/object-model");
18
+ const credentials_2 = require("@dxos/protocols/proto/dxos/halo/credentials");
19
+ const random_access_storage_1 = require("@dxos/random-access-storage");
20
+ const testutils_1 = require("@dxos/testutils");
21
+ const authenticator_1 = require("./authenticator");
22
+ const identity_1 = require("./identity");
23
+ const modelFactory = new model_factory_1.ModelFactory().registerModel(object_model_1.ObjectModel);
24
+ describe('identity/identity', function () {
25
+ it('create', async function () {
26
+ const keyring = new keyring_1.Keyring();
27
+ const identityKey = await keyring.createKey();
28
+ const deviceKey = await keyring.createKey();
29
+ const spaceKey = await keyring.createKey();
30
+ const feedStore = new feed_store_1.FeedStore({
31
+ factory: new feed_store_1.FeedFactory({
32
+ root: (0, random_access_storage_1.createStorage)({ type: random_access_storage_1.StorageType.RAM }).createDirectory(),
33
+ signer: keyring,
34
+ hypercore: {
35
+ valueEncoding: echo_db_1.valueEncoding
36
+ }
37
+ })
38
+ });
39
+ const createFeed = async () => {
40
+ const feedKey = await keyring.createKey();
41
+ return feedStore.openFeed(feedKey, { writable: true });
42
+ };
43
+ const controlFeed = await createFeed();
44
+ const dataFeed = await createFeed();
45
+ const protocol = new echo_db_1.SpaceProtocol({
46
+ topic: spaceKey,
47
+ identity: {
48
+ peerKey: identityKey,
49
+ credentialProvider: (0, authenticator_1.createHaloAuthProvider)((0, credentials_1.createCredentialSignerWithKey)(keyring, deviceKey)),
50
+ credentialAuthenticator: (0, authenticator_1.createHaloAuthVerifier)(() => identity.authorizedDeviceKeys)
51
+ },
52
+ networkManager: new network_manager_1.NetworkManager({
53
+ signalManager: new messaging_1.MemorySignalManager(new messaging_1.MemorySignalManagerContext()),
54
+ transportFactory: network_manager_1.MemoryTransportFactory
55
+ })
56
+ });
57
+ const space = new echo_db_1.Space({
58
+ spaceKey,
59
+ protocol,
60
+ genesisFeed: controlFeed,
61
+ controlFeed,
62
+ dataFeed,
63
+ feedProvider: (feedKey) => feedStore.openFeed(feedKey),
64
+ databaseFactory: async ({ databaseBackend }) => new echo_db_1.Database(modelFactory, databaseBackend, deviceKey)
65
+ });
66
+ const identity = new identity_1.Identity({
67
+ signer: keyring,
68
+ identityKey,
69
+ deviceKey,
70
+ space
71
+ });
72
+ await identity.open();
73
+ (0, testutils_1.afterTest)(() => identity.close());
74
+ //
75
+ // Identity genesis
76
+ //
77
+ {
78
+ const generator = new credentials_1.CredentialGenerator(keyring, identityKey, deviceKey);
79
+ const credentials = [
80
+ ...(await generator.createSpaceGenesis(spaceKey, controlFeed.key)),
81
+ await generator.createDeviceAuthorization(deviceKey),
82
+ await generator.createFeedAdmission(spaceKey, dataFeed.key, credentials_2.AdmittedFeed.Designation.DATA)
83
+ ];
84
+ for (const credential of credentials) {
85
+ await identity.controlPipeline.writer.write({
86
+ '@type': 'dxos.echo.feed.CredentialsMessage',
87
+ credential
88
+ });
89
+ }
90
+ }
91
+ // Wait for identity to be ready.
92
+ await identity.ready();
93
+ const identitySigner = identity.getIdentityCredentialSigner();
94
+ const credential = await identitySigner.createCredential({
95
+ subject: identityKey,
96
+ assertion: {
97
+ '@type': 'dxos.halo.credentials.IdentityProfile',
98
+ profile: {
99
+ displayName: 'Alice'
100
+ }
101
+ }
102
+ });
103
+ (0, expect_1.default)(credential.issuer).toEqual(identityKey);
104
+ (0, expect_1.default)(await (0, credentials_1.verifyCredential)(credential)).toEqual({ kind: 'pass' });
105
+ });
106
+ it('two devices', async function () {
107
+ const signalContext = new messaging_1.MemorySignalManagerContext();
108
+ let spaceKey;
109
+ let genesisFeedKey;
110
+ let identity1;
111
+ let identity2;
112
+ //
113
+ // First device
114
+ //
115
+ {
116
+ const keyring = new keyring_1.Keyring();
117
+ const identityKey = await keyring.createKey();
118
+ const deviceKey = await keyring.createKey();
119
+ spaceKey = await keyring.createKey();
120
+ const feedStore = new feed_store_1.FeedStore({
121
+ factory: new feed_store_1.FeedFactory({
122
+ root: (0, random_access_storage_1.createStorage)({ type: random_access_storage_1.StorageType.RAM }).createDirectory(),
123
+ signer: keyring,
124
+ hypercore: {
125
+ valueEncoding: echo_db_1.valueEncoding
126
+ }
127
+ })
128
+ });
129
+ const createFeed = async () => {
130
+ const feedKey = await keyring.createKey();
131
+ return feedStore.openFeed(feedKey, { writable: true });
132
+ };
133
+ const controlFeed = await createFeed();
134
+ genesisFeedKey = controlFeed.key;
135
+ const dataFeed = await createFeed();
136
+ const protocol = new echo_db_1.SpaceProtocol({
137
+ topic: spaceKey,
138
+ identity: {
139
+ peerKey: deviceKey,
140
+ credentialProvider: echo_db_1.MOCK_AUTH_PROVIDER,
141
+ credentialAuthenticator: echo_db_1.MOCK_AUTH_VERIFIER // createHaloAuthVerifier(() => identity.authorizedDeviceKeys),
142
+ },
143
+ networkManager: new network_manager_1.NetworkManager({
144
+ signalManager: new messaging_1.MemorySignalManager(signalContext),
145
+ transportFactory: network_manager_1.MemoryTransportFactory
146
+ })
147
+ });
148
+ const space = new echo_db_1.Space({
149
+ spaceKey,
150
+ protocol,
151
+ genesisFeed: controlFeed,
152
+ controlFeed,
153
+ dataFeed,
154
+ feedProvider: (feedKey) => feedStore.openFeed(feedKey),
155
+ databaseFactory: async ({ databaseBackend }) => new echo_db_1.Database(modelFactory, databaseBackend, deviceKey)
156
+ });
157
+ const identity = (identity1 = new identity_1.Identity({
158
+ signer: keyring,
159
+ identityKey,
160
+ deviceKey,
161
+ space
162
+ }));
163
+ await identity.open();
164
+ (0, testutils_1.afterTest)(() => identity.close());
165
+ //
166
+ // Identity genesis
167
+ //
168
+ {
169
+ const generator = new credentials_1.CredentialGenerator(keyring, identityKey, deviceKey);
170
+ const credentials = [
171
+ ...(await generator.createSpaceGenesis(spaceKey, controlFeed.key)),
172
+ await generator.createDeviceAuthorization(deviceKey),
173
+ await generator.createFeedAdmission(spaceKey, dataFeed.key, credentials_2.AdmittedFeed.Designation.DATA)
174
+ ];
175
+ for (const credential of credentials) {
176
+ await identity.controlPipeline.writer.write({
177
+ '@type': 'dxos.echo.feed.CredentialsMessage',
178
+ credential
179
+ });
180
+ }
181
+ }
182
+ // Wait for identity to be ready.
183
+ await identity.ready();
184
+ }
185
+ //
186
+ // Second device
187
+ //
188
+ {
189
+ const keyring = new keyring_1.Keyring();
190
+ const deviceKey = await keyring.createKey();
191
+ const feedStore = new feed_store_1.FeedStore({
192
+ factory: new feed_store_1.FeedFactory({
193
+ root: (0, random_access_storage_1.createStorage)({ type: random_access_storage_1.StorageType.RAM }).createDirectory(),
194
+ signer: keyring,
195
+ hypercore: {
196
+ valueEncoding: echo_db_1.valueEncoding
197
+ }
198
+ })
199
+ });
200
+ const createFeed = async () => {
201
+ const feedKey = await keyring.createKey();
202
+ return feedStore.openFeed(feedKey, { writable: true });
203
+ };
204
+ const controlFeed = await createFeed();
205
+ const dataFeed = await createFeed();
206
+ const protocol = new echo_db_1.SpaceProtocol({
207
+ topic: spaceKey,
208
+ identity: {
209
+ peerKey: deviceKey,
210
+ credentialProvider: echo_db_1.MOCK_AUTH_PROVIDER,
211
+ credentialAuthenticator: echo_db_1.MOCK_AUTH_VERIFIER // createHaloAuthVerifier(() => identity.authorizedDeviceKeys),
212
+ },
213
+ networkManager: new network_manager_1.NetworkManager({
214
+ signalManager: new messaging_1.MemorySignalManager(signalContext),
215
+ transportFactory: network_manager_1.MemoryTransportFactory
216
+ })
217
+ });
218
+ const space = new echo_db_1.Space({
219
+ spaceKey,
220
+ protocol,
221
+ genesisFeed: await feedStore.openFeed(genesisFeedKey),
222
+ controlFeed,
223
+ dataFeed,
224
+ feedProvider: (feedKey) => feedStore.openFeed(feedKey),
225
+ databaseFactory: async ({ databaseBackend }) => new echo_db_1.Database(modelFactory, databaseBackend, deviceKey)
226
+ });
227
+ const identity = (identity2 = new identity_1.Identity({
228
+ signer: keyring,
229
+ identityKey: identity1.identityKey,
230
+ deviceKey,
231
+ space
232
+ }));
233
+ await identity.open();
234
+ (0, testutils_1.afterTest)(() => identity.close());
235
+ }
236
+ //
237
+ // Second device admission
238
+ //
239
+ {
240
+ const signer = identity1.getIdentityCredentialSigner();
241
+ void identity1.controlPipeline.writer.write({
242
+ '@type': 'dxos.echo.feed.CredentialsMessage',
243
+ credential: await signer.createCredential({
244
+ subject: identity2.deviceKey,
245
+ assertion: {
246
+ '@type': 'dxos.halo.credentials.AuthorizedDevice',
247
+ identityKey: identity1.identityKey,
248
+ deviceKey: identity2.deviceKey
249
+ }
250
+ })
251
+ });
252
+ await identity2.ready();
253
+ }
254
+ (0, expect_1.default)(Array.from(identity1.authorizedDeviceKeys.values())).toEqual([identity1.deviceKey, identity2.deviceKey]);
255
+ (0, expect_1.default)(Array.from(identity2.authorizedDeviceKeys.values())).toEqual([identity1.deviceKey, identity2.deviceKey]);
256
+ });
257
+ });
258
+ //# sourceMappingURL=identity.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.test.js","sourceRoot":"","sources":["../../../../src/packlets/identity/identity.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,oDAA4B;AAE5B,mDAAyG;AACzG,2CAAsH;AACtH,iDAA0D;AAC1D,2CAAwC;AAExC,+CAAkF;AAClF,uDAAmD;AACnD,2DAA+E;AAC/E,qDAAiD;AAEjD,6EAA2E;AAC3E,uEAAyE;AACzE,+CAA4C;AAE5C,mDAAiF;AACjF,yCAAsC;AAEtC,MAAM,YAAY,GAAG,IAAI,4BAAY,EAAE,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAC;AAEnE,QAAQ,CAAC,mBAAmB,EAAE;IAC5B,EAAE,CAAC,QAAQ,EAAE,KAAK;QAChB,MAAM,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;Q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AC,CAAC,CAAC;YAEJ,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACtB,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;SACnC;QAED,EAAE;QACF,0BAA0B;QAC1B,EAAE;QACF;YACE,MAAM,MAAM,GAAG,SAAS,CAAC,2BAA2B,EAAE,CAAC;YACvD,KAAK,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC1C,OAAO,EAAE,mCAAmC;gBAC5C,UAAU,EAAE,MAAM,MAAM,CAAC,gBAAgB,CAAC;oBACxC,OAAO,EAAE,SAAS,CAAC,SAAS;oBAC5B,SAAS,EAAE;wBACT,OAAO,EAAE,wCAAwC;wBACjD,WAAW,EAAE,SAAS,CAAC,WAAW;wBAClC,SAAS,EAAE,SAAS,CAAC,SAAS;qBAC/B;iBACF,CAAC;aACH,CAAC,CAAC;YAEH,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;SACzB;QAED,IAAA,gBAAM,EAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QAChH,IAAA,gBAAM,EAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAClH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './authenticator';
2
+ export * from './identity';
3
+ export * from './identity-manager';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/identity/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2022 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("./authenticator"), exports);
21
+ __exportStar(require("./identity"), exports);
22
+ __exportStar(require("./identity-manager"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/identity/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,kDAAgC;AAChC,6CAA2B;AAC3B,qDAAmC"}
@@ -0,0 +1,35 @@
1
+ import { SecretProvider, SecretValidator } from '@dxos/credentials';
2
+ /**
3
+ * Defines a way for peers to authenticate each other through a side channel.
4
+ */
5
+ export interface InvitationAuthenticator {
6
+ secretProvider?: SecretProvider;
7
+ secretValidator: SecretValidator;
8
+ }
9
+ export declare const defaultInvitationAuthenticator: Required<InvitationAuthenticator>;
10
+ /**
11
+ * Additional set of callbacks and options used in the invitation process.
12
+ */
13
+ export interface InvitationOptions {
14
+ /**
15
+ * A function to be called when the invitation is closed (successfully or not).
16
+ */
17
+ onFinish?: ({ expired }: {
18
+ expired?: boolean;
19
+ }) => void;
20
+ /**
21
+ * Date.now()-style timestamp of when this invitation should expire.
22
+ */
23
+ expiration?: number;
24
+ }
25
+ export declare type InviterInvitation = {
26
+ invitationCode: string;
27
+ secret: Uint8Array | undefined;
28
+ };
29
+ export declare type InviteeInvitation = {
30
+ secret?: Uint8Array | undefined;
31
+ secretTrigger?: () => void;
32
+ };
33
+ export declare type InviterInvitations = InviterInvitation[];
34
+ export declare type InviteeInvitations = Map<string, InviteeInvitation>;
35
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/packlets/invitations/common.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiD,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEnH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,uBAAuB,CAG5E,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAExD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,oBAAY,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;CAChC,CAAC;AAGF,oBAAY,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,oBAAY,kBAAkB,GAAG,iBAAiB,EAAE,CAAC;AACrD,oBAAY,kBAAkB,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2020 DXOS.org
4
+ //
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.defaultInvitationAuthenticator = void 0;
7
+ const credentials_1 = require("@dxos/credentials");
8
+ exports.defaultInvitationAuthenticator = {
9
+ secretProvider: credentials_1.defaultSecretProvider,
10
+ secretValidator: credentials_1.defaultSecretValidator
11
+ };
12
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/packlets/invitations/common.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,mDAAmH;AAUtG,QAAA,8BAA8B,GAAsC;IAC/E,cAAc,EAAE,mCAAqB;IACrC,eAAe,EAAE,oCAAsB;CACxC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { NetworkManager } from '@dxos/network-manager';
2
+ import { InvitationDescriptor } from '@dxos/protocols/proto/dxos/halo/invitations';
3
+ import { Identity, IdentityManager } from '../identity';
4
+ /**
5
+ * Creates and processes Halo invitations between devices.
6
+ */
7
+ export declare class HaloInvitations {
8
+ private readonly _identityManager;
9
+ private readonly _networkManager;
10
+ private readonly _onInitialize;
11
+ constructor(_identityManager: IdentityManager, _networkManager: NetworkManager, _onInitialize: () => Promise<void>);
12
+ /**
13
+ * Sends a HALO admission offer and waits for guest to accept.
14
+ */
15
+ createInvitation({ onFinish }?: {
16
+ onFinish?: () => void;
17
+ }): Promise<InvitationDescriptor>;
18
+ /**
19
+ * Joins an existing identity HALO by invitation.
20
+ */
21
+ acceptInvitation(invitation: InvitationDescriptor): Promise<Identity>;
22
+ }
23
+ //# sourceMappingURL=halo-invitations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"halo-invitations.d.ts","sourceRoot":"","sources":["../../../../src/packlets/invitations/halo-invitations.ts"],"names":[],"mappings":"AAQA,OAAO,EAAyB,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAG5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAGnF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAExD;;GAEG;AACH,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFb,gBAAgB,EAAE,eAAe,EACjC,eAAe,EAAE,cAAc,EAC/B,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAGrD;;OAEG;IACG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqEnG;;OAEG;IACG,gBAAgB,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC;CA4D5E"}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2022 DXOS.org
4
+ //
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.HaloInvitations = void 0;
7
+ const async_1 = require("@dxos/async");
8
+ const debug_1 = require("@dxos/debug");
9
+ const keys_1 = require("@dxos/keys");
10
+ const log_1 = require("@dxos/log");
11
+ const network_manager_1 = require("@dxos/network-manager");
12
+ const protocol_plugin_rpc_1 = require("@dxos/protocol-plugin-rpc");
13
+ const protocols_1 = require("@dxos/protocols");
14
+ const invitations_1 = require("@dxos/protocols/proto/dxos/halo/invitations");
15
+ const rpc_1 = require("@dxos/rpc");
16
+ /**
17
+ * Creates and processes Halo invitations between devices.
18
+ */
19
+ class HaloInvitations {
20
+ constructor(_identityManager, _networkManager, _onInitialize // TODO(burdon): ???
21
+ ) {
22
+ this._identityManager = _identityManager;
23
+ this._networkManager = _networkManager;
24
+ this._onInitialize = _onInitialize;
25
+ }
26
+ /**
27
+ * Sends a HALO admission offer and waits for guest to accept.
28
+ */
29
+ async createInvitation({ onFinish } = {}) {
30
+ var _a;
31
+ const identity = (_a = this._identityManager.identity) !== null && _a !== void 0 ? _a : (0, debug_1.failUndefined)();
32
+ const plugin = (0, protocol_plugin_rpc_1.createRpcPlugin)(async (port) => {
33
+ const peer = (0, rpc_1.createProtoRpcPeer)({
34
+ port,
35
+ requested: {
36
+ HaloGuestService: protocols_1.schema.getService('dxos.halo.invitations.HaloGuestService')
37
+ },
38
+ exposed: {
39
+ HaloHostService: protocols_1.schema.getService('dxos.halo.invitations.HaloHostService')
40
+ },
41
+ handlers: {
42
+ HaloHostService: {
43
+ presentAdmissionCredentials: async ({ deviceKey, controlFeedKey, dataFeedKey }) => {
44
+ (0, log_1.log)('processing admission request', { identityKey: identity.identityKey, deviceKey }, { file: "packages/sdk/client-services/src/packlets/invitations/halo-invitations.ts", line: 45 });
45
+ // TODO(burdon): Use CredentialGenerator.
46
+ const signer = identity.getIdentityCredentialSigner();
47
+ await identity.controlPipeline.writer.write({
48
+ '@type': 'dxos.echo.feed.CredentialsMessage',
49
+ credential: await signer.createCredential({
50
+ subject: deviceKey,
51
+ assertion: {
52
+ '@type': 'dxos.halo.credentials.AuthorizedDevice',
53
+ identityKey: identity.identityKey,
54
+ deviceKey
55
+ }
56
+ })
57
+ });
58
+ // TODO(dmaretskyi): Admit guest's feeds otherwise messages from them won't be processed by the pipeline.
59
+ }
60
+ }
61
+ }
62
+ });
63
+ await peer.open();
64
+ {
65
+ (0, log_1.log)('sending admission offer', { identityKey: identity.identityKey }, { file: "packages/sdk/client-services/src/packlets/invitations/halo-invitations.ts", line: 69 });
66
+ await peer.rpc.HaloGuestService.presentAdmissionOffer({
67
+ identityKey: identity.identityKey,
68
+ haloSpaceKey: identity.haloSpaceKey,
69
+ genesisFeedKey: identity.haloGenesisFeedKey
70
+ });
71
+ onFinish === null || onFinish === void 0 ? void 0 : onFinish();
72
+ }
73
+ await peer.close();
74
+ await connection.close();
75
+ });
76
+ const topic = keys_1.PublicKey.random();
77
+ const peerId = keys_1.PublicKey.random(); // TODO(burdon): Fails if using the actual peer key.
78
+ const connection = await this._networkManager.openSwarmConnection({
79
+ topic,
80
+ peerId: topic,
81
+ // peerId,
82
+ protocol: (0, network_manager_1.createProtocolFactory)(topic, peerId, [plugin]),
83
+ topology: new network_manager_1.StarTopology(topic)
84
+ });
85
+ return {
86
+ type: invitations_1.InvitationDescriptor.Type.INTERACTIVE,
87
+ swarmKey: topic.asUint8Array(),
88
+ invitation: new Uint8Array() // TODO(burdon): Remove.
89
+ };
90
+ }
91
+ /**
92
+ * Joins an existing identity HALO by invitation.
93
+ */
94
+ async acceptInvitation(invitation) {
95
+ const admitted = new async_1.Trigger(); // TODO(burdon): Must not share across multiple connections.
96
+ const plugin = (0, protocol_plugin_rpc_1.createRpcPlugin)(async (port) => {
97
+ const peer = (0, rpc_1.createProtoRpcPeer)({
98
+ port,
99
+ requested: {
100
+ // TODO(burdon): Rename in-bound.
101
+ HaloHostService: protocols_1.schema.getService('dxos.halo.invitations.HaloHostService')
102
+ },
103
+ exposed: {
104
+ // TODO(burdon): Rename out-bound?
105
+ HaloGuestService: protocols_1.schema.getService('dxos.halo.invitations.HaloGuestService')
106
+ },
107
+ handlers: {
108
+ // TODO(burdon): Factory to create handlers and open/close handlers.
109
+ HaloGuestService: {
110
+ presentAdmissionOffer: async ({ identityKey, haloSpaceKey, genesisFeedKey }) => {
111
+ (0, log_1.log)('processing admission offer', { identityKey }, { file: "packages/sdk/client-services/src/packlets/invitations/halo-invitations.ts", line: 120 });
112
+ const identity = await this._identityManager.acceptIdentity({
113
+ identityKey,
114
+ haloSpaceKey,
115
+ haloGenesisFeedKey: genesisFeedKey
116
+ });
117
+ (0, log_1.log)('sending admission request', { identityKey: invitation.identityKey }, { file: "packages/sdk/client-services/src/packlets/invitations/halo-invitations.ts", line: 127 });
118
+ await peer.rpc.HaloHostService.presentAdmissionCredentials({
119
+ deviceKey: identity.deviceKey,
120
+ controlFeedKey: keys_1.PublicKey.random(),
121
+ dataFeedKey: keys_1.PublicKey.random()
122
+ });
123
+ // TODO(burdon): Document.
124
+ await identity.ready();
125
+ admitted.wake(identity);
126
+ }
127
+ }
128
+ }
129
+ });
130
+ await peer.open();
131
+ await admitted.wait();
132
+ await peer.close();
133
+ });
134
+ const topic = keys_1.PublicKey.from(invitation.swarmKey);
135
+ const peerId = keys_1.PublicKey.random(); // TODO(burdon): Fails if using the actual peer key.
136
+ const connection = await this._networkManager.openSwarmConnection({
137
+ topic,
138
+ peerId: keys_1.PublicKey.random(),
139
+ // peerId,
140
+ protocol: (0, network_manager_1.createProtocolFactory)(topic, peerId, [plugin]),
141
+ topology: new network_manager_1.StarTopology(topic)
142
+ });
143
+ const identity = await admitted.wait();
144
+ await this._onInitialize();
145
+ await connection.close();
146
+ return identity;
147
+ }
148
+ }
149
+ exports.HaloInvitations = HaloInvitations;
150
+ //# sourceMappingURL=halo-invitations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"halo-invitations.js","sourceRoot":"","sources":["../../../../src/packlets/invitations/halo-invitations.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uCAAsC;AACtC,uCAA4C;AAC5C,qCAAuC;AACvC,mCAAgC;AAChC,2DAA4F;AAC5F,mEAA4D;AAC5D,+CAAyC;AACzC,6EAAmF;AACnF,mCAA+C;AAI/C;;GAEG;AACH,MAAa,eAAe;IAC1B,YACmB,gBAAiC,EACjC,eAA+B,EAC/B,aAAkC,CAAC,oBAAoB;;QAFvD,qBAAgB,GAAhB,gBAAgB,CAAiB;QACjC,oBAAe,GAAf,eAAe,CAAgB;QAC/B,kBAAa,GAAb,aAAa,CAAqB;IAClD,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,gBAAgB,CAAC,EAAE,QAAQ,KAAgC,E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M,GAAG,gBAAS,CAAC,MAAM,EAAE,CAAC,CAAC,oDAAoD;QACvF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC;YAChE,KAAK;YACL,MAAM,EAAE,gBAAS,CAAC,MAAM,EAAE;YAC1B,UAAU;YACV,QAAQ,EAAE,IAAA,uCAAqB,EAAC,KAAK,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;YACxD,QAAQ,EAAE,IAAI,8BAAY,CAAC,KAAK,CAAC;SAClC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC3B,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA9ID,0CA8IC"}
@@ -0,0 +1,5 @@
1
+ export * from './common';
2
+ export * from './halo-invitations';
3
+ export * from './invitation-wrapper';
4
+ export * from './space-invitations';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/invitations/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2022 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("./common"), exports);
21
+ __exportStar(require("./halo-invitations"), exports);
22
+ __exportStar(require("./invitation-wrapper"), exports);
23
+ __exportStar(require("./space-invitations"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/invitations/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,2CAAyB;AACzB,qDAAmC;AACnC,uDAAqC;AACrC,sDAAoC"}
@@ -0,0 +1,36 @@
1
+ import { PublicKey } from '@dxos/keys';
2
+ import { InvitationDescriptor } from '@dxos/protocols/proto/dxos/halo/invitations';
3
+ /**
4
+ * A serialized version of InvitationWrapper that's suitable to be encoded as an URL query string.
5
+ */
6
+ export interface InvitationQueryParameters {
7
+ hash: string;
8
+ swarmKey: string;
9
+ invitation: string;
10
+ identityKey?: string;
11
+ type: string;
12
+ }
13
+ /**
14
+ * Describes an issued invitation.
15
+ *
16
+ * Can be serialized to protobuf or JSON.
17
+ * Invitations can be interactive or offline.
18
+ *
19
+ * This descriptor might also have a bundled secret for authentication in interactive mode.
20
+ */
21
+ export declare class InvitationWrapper {
22
+ readonly type: InvitationDescriptor.Type;
23
+ readonly swarmKey: PublicKey;
24
+ readonly invitation: Uint8Array;
25
+ readonly identityKey?: PublicKey | undefined;
26
+ secret?: Uint8Array | undefined;
27
+ static decode(code: string): InvitationWrapper;
28
+ static encode(invitation: InvitationWrapper): string;
29
+ static fromQueryParameters(queryParameters: InvitationQueryParameters): InvitationWrapper;
30
+ static fromProto(invitation: InvitationDescriptor): InvitationWrapper;
31
+ constructor(type: InvitationDescriptor.Type, swarmKey: PublicKey, invitation: Uint8Array, identityKey?: PublicKey | undefined, secret?: Uint8Array | undefined);
32
+ get hash(): string;
33
+ toProto(): InvitationDescriptor;
34
+ toQueryParameters(): InvitationQueryParameters;
35
+ }
36
+ //# sourceMappingURL=invitation-wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/packlets/invitations/invitation-wrapper.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAOnF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AAEH,qBAAa,iBAAiB;aA0CV,IAAI,EAAE,oBAAoB,CAAC,IAAI;aAC/B,QAAQ,EAAE,SAAS;aACnB,UAAU,EAAE,UAAU;aACtB,WAAW,CAAC;IACrB,MAAM,CAAC;IA7ChB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;IAK9C,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,iBAAiB,GAAG,MAAM;IAKpD,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,yBAAyB,GAAG,iBAAiB;IAgBzF,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,oBAAoB,GAAG,iBAAiB;gBAenD,IAAI,EAAE,oBAAoB,CAAC,IAAI,EAC/B,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,UAAU,EACtB,WAAW,CAAC,uBAAW,EAChC,MAAM,CAAC,wBAAY;IAa5B,IAAI,IAAI,WAGP;IAED,OAAO,IAAI,oBAAoB;IAU/B,iBAAiB,IAAI,yBAAyB;CAc/C"}