@dxos/client-services 0.4.10-main.3c620fb → 0.4.10-main.3e35a2f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-H2TNTLUE.mjs → chunk-S3G2RM7S.mjs} +46 -48
- package/dist/lib/browser/chunk-S3G2RM7S.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -3
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-OSCHFTM3.cjs → chunk-3T6D6GIB.cjs} +61 -64
- package/dist/lib/node/chunk-3T6D6GIB.cjs.map +7 -0
- package/dist/lib/node/index.cjs +41 -43
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +6 -6
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +0 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +34 -34
- package/src/packlets/invitations/invitations-handler.ts +5 -12
- package/src/packlets/invitations/invitations-service.ts +5 -5
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-H2TNTLUE.mjs.map +0 -7
- package/dist/lib/node/chunk-OSCHFTM3.cjs.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-service.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,
|
|
1
|
+
{"version":3,"file":"invitations-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/invitations/invitations-service.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,s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AY,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAW9E,gBAAgB,CAAC,EAAE,YAAY,EAAE,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBjF,gBAAgB,IAAI,MAAM,CAAC,wBAAwB,CAAC;CA+ErD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.4.10-main.
|
|
1
|
+
export declare const DXOS_VERSION = "0.4.10-main.3e35a2f";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.4.10-main.
|
|
3
|
+
"version": "0.4.10-main.3e35a2f",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -24,43 +24,43 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"level": "^8.0.1",
|
|
26
26
|
"platform": "^1.3.6",
|
|
27
|
-
"@dxos/async": "0.4.10-main.
|
|
28
|
-
"@dxos/client-protocol": "0.4.10-main.
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/config": "0.4.10-main.
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/echo-
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/echo-schema": "0.4.10-main.
|
|
39
|
-
"@dxos/feed-store": "0.4.10-main.
|
|
40
|
-
"@dxos/indexing": "0.4.10-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/network-manager": "0.4.10-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/random-access-storage": "0.4.10-main.
|
|
51
|
-
"@dxos/rpc": "0.4.10-main.
|
|
52
|
-
"@dxos/teleport
|
|
53
|
-
"@dxos/teleport": "0.4.10-main.
|
|
54
|
-
"@dxos/teleport-extension-object-sync": "0.4.10-main.
|
|
55
|
-
"@dxos/timeframe": "0.4.10-main.
|
|
56
|
-
"@dxos/tracing": "0.4.10-main.
|
|
57
|
-
"@dxos/util": "0.4.10-main.
|
|
58
|
-
"@dxos/websocket-rpc": "0.4.10-main.
|
|
27
|
+
"@dxos/async": "0.4.10-main.3e35a2f",
|
|
28
|
+
"@dxos/client-protocol": "0.4.10-main.3e35a2f",
|
|
29
|
+
"@dxos/automerge": "0.4.10-main.3e35a2f",
|
|
30
|
+
"@dxos/codec-protobuf": "0.4.10-main.3e35a2f",
|
|
31
|
+
"@dxos/config": "0.4.10-main.3e35a2f",
|
|
32
|
+
"@dxos/credentials": "0.4.10-main.3e35a2f",
|
|
33
|
+
"@dxos/context": "0.4.10-main.3e35a2f",
|
|
34
|
+
"@dxos/crypto": "0.4.10-main.3e35a2f",
|
|
35
|
+
"@dxos/debug": "0.4.10-main.3e35a2f",
|
|
36
|
+
"@dxos/echo-db": "0.4.10-main.3e35a2f",
|
|
37
|
+
"@dxos/echo-pipeline": "0.4.10-main.3e35a2f",
|
|
38
|
+
"@dxos/echo-schema": "0.4.10-main.3e35a2f",
|
|
39
|
+
"@dxos/feed-store": "0.4.10-main.3e35a2f",
|
|
40
|
+
"@dxos/indexing": "0.4.10-main.3e35a2f",
|
|
41
|
+
"@dxos/keys": "0.4.10-main.3e35a2f",
|
|
42
|
+
"@dxos/invariant": "0.4.10-main.3e35a2f",
|
|
43
|
+
"@dxos/lock-file": "0.4.10-main.3e35a2f",
|
|
44
|
+
"@dxos/keyring": "0.4.10-main.3e35a2f",
|
|
45
|
+
"@dxos/log": "0.4.10-main.3e35a2f",
|
|
46
|
+
"@dxos/network-manager": "0.4.10-main.3e35a2f",
|
|
47
|
+
"@dxos/messaging": "0.4.10-main.3e35a2f",
|
|
48
|
+
"@dxos/protocols": "0.4.10-main.3e35a2f",
|
|
49
|
+
"@dxos/node-std": "0.4.10-main.3e35a2f",
|
|
50
|
+
"@dxos/random-access-storage": "0.4.10-main.3e35a2f",
|
|
51
|
+
"@dxos/rpc": "0.4.10-main.3e35a2f",
|
|
52
|
+
"@dxos/teleport": "0.4.10-main.3e35a2f",
|
|
53
|
+
"@dxos/teleport-extension-gossip": "0.4.10-main.3e35a2f",
|
|
54
|
+
"@dxos/teleport-extension-object-sync": "0.4.10-main.3e35a2f",
|
|
55
|
+
"@dxos/timeframe": "0.4.10-main.3e35a2f",
|
|
56
|
+
"@dxos/tracing": "0.4.10-main.3e35a2f",
|
|
57
|
+
"@dxos/util": "0.4.10-main.3e35a2f",
|
|
58
|
+
"@dxos/websocket-rpc": "0.4.10-main.3e35a2f"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/platform": "^1.3.4",
|
|
62
62
|
"@types/readable-stream": "^2.3.9",
|
|
63
|
-
"@dxos/signal": "0.4.10-main.
|
|
63
|
+
"@dxos/signal": "0.4.10-main.3e35a2f"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
@@ -76,7 +76,8 @@ export class InvitationsHandler {
|
|
|
76
76
|
swarmKey = PublicKey.random(),
|
|
77
77
|
persistent = true,
|
|
78
78
|
created = new Date(),
|
|
79
|
-
lifetime = 86400, // 1 day
|
|
79
|
+
lifetime = 86400, // 1 day,
|
|
80
|
+
multiUse = false,
|
|
80
81
|
} = options ?? {};
|
|
81
82
|
const authCode =
|
|
82
83
|
options?.authCode ??
|
|
@@ -91,9 +92,10 @@ export class InvitationsHandler {
|
|
|
91
92
|
swarmKey,
|
|
92
93
|
authCode,
|
|
93
94
|
timeout,
|
|
94
|
-
persistent,
|
|
95
|
+
persistent: persistent && type !== Invitation.Type.OFFLINE, // offline invitations are persisted in control feed
|
|
95
96
|
created,
|
|
96
97
|
lifetime,
|
|
98
|
+
multiUse,
|
|
97
99
|
...protocol.getInvitationContext(),
|
|
98
100
|
};
|
|
99
101
|
|
|
@@ -162,7 +164,7 @@ export class InvitationsHandler {
|
|
|
162
164
|
}
|
|
163
165
|
log.trace('dxos.sdk.invitations-handler.host.onOpen', trace.error({ id: traceId, error: err }));
|
|
164
166
|
} finally {
|
|
165
|
-
if (
|
|
167
|
+
if (!multiUse) {
|
|
166
168
|
// Wait for graceful close before disposing.
|
|
167
169
|
await swarmConnection.close();
|
|
168
170
|
await ctx.dispose();
|
|
@@ -424,12 +426,3 @@ export class InvitationsHandler {
|
|
|
424
426
|
return observable;
|
|
425
427
|
}
|
|
426
428
|
}
|
|
427
|
-
|
|
428
|
-
export const invitationExpired = (invitation: Invitation) => {
|
|
429
|
-
return (
|
|
430
|
-
invitation.created &&
|
|
431
|
-
invitation.lifetime &&
|
|
432
|
-
invitation.lifetime !== 0 &&
|
|
433
|
-
invitation.created.getTime() + invitation.lifetime * 1000 < Date.now()
|
|
434
|
-
);
|
|
435
|
-
};
|
|
@@ -6,7 +6,7 @@ import { Event, scheduleTask } from '@dxos/async';
|
|
|
6
6
|
import { type AuthenticatingInvitation, type CancellableInvitation } from '@dxos/client-protocol';
|
|
7
7
|
import { Stream } from '@dxos/codec-protobuf';
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
|
-
import { type MetadataStore } from '@dxos/echo-pipeline';
|
|
9
|
+
import { hasInvitationExpired, type MetadataStore } from '@dxos/echo-pipeline';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
import {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from '@dxos/protocols/proto/dxos/client/services';
|
|
19
19
|
|
|
20
20
|
import { type InvitationProtocol } from './invitation-protocol';
|
|
21
|
-
import {
|
|
21
|
+
import { type InvitationsHandler } from './invitations-handler';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Adapts invitation service observable to client/service stream.
|
|
@@ -91,7 +91,7 @@ export class InvitationsServiceImpl implements InvitationsService {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
this._createInvitations.delete(invitation.get().invitationId);
|
|
94
|
-
if (invitation.get().
|
|
94
|
+
if (!invitation.get().multiUse) {
|
|
95
95
|
this._removedCreated.emit(invitation.get());
|
|
96
96
|
}
|
|
97
97
|
},
|
|
@@ -103,7 +103,7 @@ export class InvitationsServiceImpl implements InvitationsService {
|
|
|
103
103
|
const persistentInvitations = this._metadataStore.getInvitations();
|
|
104
104
|
|
|
105
105
|
// get saved persistent invitations, filter and remove from storage those that have expired.
|
|
106
|
-
const freshInvitations = persistentInvitations.filter(async (invitation) => !
|
|
106
|
+
const freshInvitations = persistentInvitations.filter(async (invitation) => !hasInvitationExpired(invitation));
|
|
107
107
|
|
|
108
108
|
const cInvitations = freshInvitations.map((persistentInvitation) => {
|
|
109
109
|
invariant(!this._createInvitations.get(persistentInvitation.invitationId), 'invitation already exists');
|
|
@@ -148,7 +148,7 @@ export class InvitationsServiceImpl implements InvitationsService {
|
|
|
148
148
|
() => {
|
|
149
149
|
close();
|
|
150
150
|
this._acceptInvitations.delete(invitation.get().invitationId);
|
|
151
|
-
if (invitation.get().
|
|
151
|
+
if (!invitation.get().multiUse) {
|
|
152
152
|
this._removedAccepted.emit(invitation.get());
|
|
153
153
|
}
|
|
154
154
|
},
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.10-main.
|
|
1
|
+
export const DXOS_VERSION = "0.4.10-main.3e35a2f";
|