@dxos/client-protocol 0.8.4-main.d05673bc65 → 0.8.4-main.d9fc60f731
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/LICENSE +102 -5
- package/dist/lib/browser/chunk-46734GVM.mjs +39 -0
- package/dist/lib/browser/chunk-46734GVM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -12
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +3 -1
- package/dist/lib/node-esm/chunk-UTEDAJQA.mjs +41 -0
- package/dist/lib/node-esm/chunk-UTEDAJQA.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -12
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +3 -1
- package/dist/types/src/config.d.ts.map +1 -1
- package/dist/types/src/echo.d.ts +8 -14
- package/dist/types/src/echo.d.ts.map +1 -1
- package/dist/types/src/invitations/encoder.d.ts.map +1 -1
- package/dist/types/src/invitations/invitations.d.ts +2 -2
- package/dist/types/src/invitations/invitations.d.ts.map +1 -1
- package/dist/types/src/service.d.ts +0 -2
- package/dist/types/src/service.d.ts.map +1 -1
- package/dist/types/src/space.d.ts +26 -3
- package/dist/types/src/space.d.ts.map +1 -1
- package/dist/types/src/types/SpaceProperties.d.ts +33 -13
- package/dist/types/src/types/SpaceProperties.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -21
- package/src/echo.ts +6 -18
- package/src/invitations/encoder.test.ts +16 -0
- package/src/service.ts +0 -4
- package/src/space.ts +30 -3
- package/src/types/SpaceProperties.ts +43 -34
- package/dist/lib/browser/chunk-HQBTSFTW.mjs +0 -35
- package/dist/lib/browser/chunk-HQBTSFTW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-URWCZ2QB.mjs +0 -37
- package/dist/lib/node-esm/chunk-URWCZ2QB.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-protocol",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.d9fc60f731",
|
|
4
4
|
"description": "Core DXOS Client API.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"type": "module",
|
|
@@ -27,33 +27,25 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"types": "dist/types/src/index.d.ts",
|
|
30
|
-
"typesVersions": {
|
|
31
|
-
"*": {
|
|
32
|
-
"./types": [
|
|
33
|
-
"./dist/types/src/types/index.d.ts"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
30
|
"files": [
|
|
38
31
|
"dist",
|
|
39
32
|
"src"
|
|
40
33
|
],
|
|
41
34
|
"dependencies": {
|
|
42
35
|
"base-x": "~3.0.11",
|
|
43
|
-
"effect": "3.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/echo": "0.8.4-main.
|
|
47
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/node-std": "0.8.4-main.
|
|
51
|
-
"@dxos/protocols": "0.8.4-main.
|
|
52
|
-
"@dxos/rpc": "0.8.4-main.
|
|
53
|
-
"@dxos/async": "0.8.4-main.d05673bc65"
|
|
36
|
+
"effect": "3.21.2",
|
|
37
|
+
"@dxos/credentials": "0.8.4-main.d9fc60f731",
|
|
38
|
+
"@dxos/async": "0.8.4-main.d9fc60f731",
|
|
39
|
+
"@dxos/echo": "0.8.4-main.d9fc60f731",
|
|
40
|
+
"@dxos/echo-db": "0.8.4-main.d9fc60f731",
|
|
41
|
+
"@dxos/keys": "0.8.4-main.d9fc60f731",
|
|
42
|
+
"@dxos/invariant": "0.8.4-main.d9fc60f731",
|
|
43
|
+
"@dxos/node-std": "0.8.4-main.d9fc60f731",
|
|
44
|
+
"@dxos/protocols": "0.8.4-main.d9fc60f731",
|
|
45
|
+
"@dxos/rpc": "0.8.4-main.d9fc60f731"
|
|
54
46
|
},
|
|
55
47
|
"peerDependencies": {
|
|
56
|
-
"effect": "3.
|
|
48
|
+
"effect": "3.21.2"
|
|
57
49
|
},
|
|
58
50
|
"publishConfig": {
|
|
59
51
|
"access": "public"
|
package/src/echo.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { MulticastObservable } from '@dxos/async';
|
|
|
6
6
|
import type { Database } from '@dxos/echo';
|
|
7
7
|
import type { PublicKey, SpaceId } from '@dxos/keys';
|
|
8
8
|
import type { Invitation, SpaceArchive } from '@dxos/protocols/proto/dxos/client/services';
|
|
9
|
+
import type { MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
9
10
|
|
|
10
11
|
import type { AuthenticatingInvitation } from './invitations';
|
|
11
12
|
import type { Space } from './space';
|
|
@@ -16,12 +17,6 @@ import type { SpaceProperties } from './types';
|
|
|
16
17
|
*/
|
|
17
18
|
// TODO(wittjosiah): Rename Database (not product name).
|
|
18
19
|
export interface Echo extends MulticastObservable<Space[]>, Database.Queryable {
|
|
19
|
-
/**
|
|
20
|
-
* Observable which indicates when the default space is available.
|
|
21
|
-
*/
|
|
22
|
-
// TODO(wittjosiah): Remove. Ensure default space is always available.
|
|
23
|
-
get isReady(): MulticastObservable<boolean>;
|
|
24
|
-
|
|
25
20
|
/**
|
|
26
21
|
* Returns the list of spaces.
|
|
27
22
|
*/
|
|
@@ -38,25 +33,18 @@ export interface Echo extends MulticastObservable<Space[]>, Database.Queryable {
|
|
|
38
33
|
*/
|
|
39
34
|
get(spaceKey: PublicKey): Space | undefined;
|
|
40
35
|
|
|
41
|
-
/**
|
|
42
|
-
* Returns the default space.
|
|
43
|
-
*/
|
|
44
|
-
get default(): Space;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Resolves when the default space is available.
|
|
48
|
-
*/
|
|
49
|
-
waitUntilReady(): Promise<void>;
|
|
50
|
-
|
|
51
36
|
/**
|
|
52
37
|
* Creates a new space.
|
|
53
38
|
*/
|
|
54
|
-
create(
|
|
39
|
+
create(
|
|
40
|
+
props?: Pick<SpaceProperties, 'name' | 'hue' | 'icon' | 'invocationTraceFeed'>,
|
|
41
|
+
options?: { tags?: string[]; membershipPolicy?: MembershipPolicy },
|
|
42
|
+
): Promise<Space>;
|
|
55
43
|
|
|
56
44
|
/**
|
|
57
45
|
* Creates a space from the given archive.
|
|
58
46
|
*/
|
|
59
|
-
import(archive: SpaceArchive): Promise<Space>;
|
|
47
|
+
import(archive: SpaceArchive, options?: { tags?: string[] }): Promise<Space>;
|
|
60
48
|
|
|
61
49
|
/**
|
|
62
50
|
* Joins an existing space using the given invitation.
|
|
@@ -58,4 +58,20 @@ describe('Invitation utils', () => {
|
|
|
58
58
|
expect(decoded.identityKey).to.not.exist;
|
|
59
59
|
expect(decoded).to.deep.eq(invitation);
|
|
60
60
|
});
|
|
61
|
+
|
|
62
|
+
test('encodes and decodes a device invitation', () => {
|
|
63
|
+
const invitation: Invitation = {
|
|
64
|
+
invitationId: PublicKey.random().toHex(),
|
|
65
|
+
type: Invitation.Type.INTERACTIVE,
|
|
66
|
+
kind: Invitation.Kind.DEVICE,
|
|
67
|
+
authMethod: Invitation.AuthMethod.NONE,
|
|
68
|
+
state: Invitation.State.INIT,
|
|
69
|
+
swarmKey: PublicKey.random(),
|
|
70
|
+
created: CREATED,
|
|
71
|
+
lifetime: 86400,
|
|
72
|
+
};
|
|
73
|
+
const encoded = InvitationEncoder.encode(invitation);
|
|
74
|
+
const decoded = InvitationEncoder.decode(encoded);
|
|
75
|
+
expect(decoded).to.deep.eq(invitation);
|
|
76
|
+
});
|
|
61
77
|
});
|
package/src/service.ts
CHANGED
|
@@ -21,7 +21,6 @@ import type { QueryService } from '@dxos/protocols/proto/dxos/echo/query';
|
|
|
21
21
|
import type { DataService } from '@dxos/protocols/proto/dxos/echo/service';
|
|
22
22
|
import type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';
|
|
23
23
|
import type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';
|
|
24
|
-
import type { TracingService } from '@dxos/protocols/proto/dxos/tracing';
|
|
25
24
|
import { type ServiceBundle, createServiceBundle } from '@dxos/rpc';
|
|
26
25
|
|
|
27
26
|
export type { QueueService } from '@dxos/protocols/proto/dxos/client/services';
|
|
@@ -49,8 +48,6 @@ export type ClientServices = {
|
|
|
49
48
|
|
|
50
49
|
// TODO(burdon): Deprecated.
|
|
51
50
|
DevtoolsHost: DevtoolsHost;
|
|
52
|
-
|
|
53
|
-
TracingService: TracingService;
|
|
54
51
|
};
|
|
55
52
|
|
|
56
53
|
/**
|
|
@@ -104,7 +101,6 @@ export const clientServiceBundle = createServiceBundle<ClientServices>({
|
|
|
104
101
|
|
|
105
102
|
// TODO(burdon): Deprecated.
|
|
106
103
|
DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),
|
|
107
|
-
TracingService: schema.getService('dxos.tracing.TracingService'),
|
|
108
104
|
});
|
|
109
105
|
|
|
110
106
|
export type IframeServiceBundle = {
|
package/src/space.ts
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type Contact,
|
|
15
15
|
type CreateEpochRequest,
|
|
16
16
|
type Invitation,
|
|
17
|
-
|
|
17
|
+
SpaceArchive,
|
|
18
18
|
type Space as SpaceData,
|
|
19
19
|
type SpaceMember,
|
|
20
20
|
type SpaceState,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from '@dxos/protocols/proto/dxos/client/services';
|
|
23
23
|
import { type EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
24
24
|
import { type SpaceSnapshot } from '@dxos/protocols/proto/dxos/echo/snapshot';
|
|
25
|
-
import { type Credential, type Epoch } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
25
|
+
import { type Credential, type Epoch, type MembershipPolicy } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
26
26
|
|
|
27
27
|
import { type CancellableInvitation } from './invitations';
|
|
28
28
|
import { type SpaceProperties } from './types';
|
|
@@ -32,6 +32,14 @@ export type CreateEpochOptions = {
|
|
|
32
32
|
automergeRootUrl?: string;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
export type ExportSpaceOptions = {
|
|
36
|
+
/**
|
|
37
|
+
* Archive format.
|
|
38
|
+
* @default SpaceArchive.Format.BINARY
|
|
39
|
+
*/
|
|
40
|
+
format?: SpaceArchive.Format;
|
|
41
|
+
};
|
|
42
|
+
|
|
35
43
|
export interface SpaceInternal {
|
|
36
44
|
get db(): EchoDatabase;
|
|
37
45
|
get data(): SpaceData;
|
|
@@ -46,7 +54,7 @@ export interface SpaceInternal {
|
|
|
46
54
|
// TOOD(burdon): Start to factor out credentials.
|
|
47
55
|
removeMember(memberKey: PublicKey): Promise<void>;
|
|
48
56
|
|
|
49
|
-
export(): Promise<SpaceArchive>;
|
|
57
|
+
export(options?: ExportSpaceOptions): Promise<SpaceArchive>;
|
|
50
58
|
|
|
51
59
|
/**
|
|
52
60
|
* Migrate space data to the latest version.
|
|
@@ -93,6 +101,18 @@ export interface Space extends Messenger {
|
|
|
93
101
|
// TODO(burdon): Replace with state?
|
|
94
102
|
get isOpen(): boolean;
|
|
95
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Immutable tags assigned at space creation time.
|
|
106
|
+
* Available on closed spaces.
|
|
107
|
+
*/
|
|
108
|
+
get tags(): string[];
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Immutable membership policy assigned at space creation time.
|
|
112
|
+
* Available on closed spaces.
|
|
113
|
+
*/
|
|
114
|
+
get membershipPolicy(): MembershipPolicy;
|
|
115
|
+
|
|
96
116
|
/**
|
|
97
117
|
* Current state of the space.
|
|
98
118
|
* The database is ready to be used in `SpaceState.SPACE_READY` state.
|
|
@@ -134,6 +154,13 @@ export interface Space extends Messenger {
|
|
|
134
154
|
*/
|
|
135
155
|
close(): Promise<void>;
|
|
136
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Tombstones (soft-deletes) the space and replicates the deletion to the user's other devices.
|
|
159
|
+
* Every device stops replicating and unloads the space. Underlying data is not removed until
|
|
160
|
+
* garbage collection (future work). This is terminal: the space cannot be re-opened via {@link open}.
|
|
161
|
+
*/
|
|
162
|
+
delete(): Promise<void>;
|
|
163
|
+
|
|
137
164
|
/**
|
|
138
165
|
* Waits until the space is in the ready state, with database initialized.
|
|
139
166
|
*/
|
|
@@ -4,45 +4,54 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Annotation, Ref, Type } from '@dxos/echo';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
7
|
+
import { Annotation, DXN, Feed, Ref, Type } from '@dxos/echo';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Where do triggers get executed.
|
|
11
|
+
*/
|
|
12
|
+
export const ComputeEnvironment = Schema.Literal('disabled', 'local', 'edge');
|
|
13
|
+
export type ComputeEnvironment = Schema.Schema.Type<typeof ComputeEnvironment>;
|
|
14
|
+
|
|
15
|
+
export const SpacePropertiesSchema = Schema.Struct({
|
|
16
|
+
//
|
|
17
|
+
// System properties.
|
|
18
|
+
//
|
|
19
|
+
|
|
20
|
+
// TODO(burdon): Change to mode (no booleans?)
|
|
21
|
+
// TODO(wittjosiah): Make optional with default value.
|
|
22
|
+
edgeReplication: Schema.optional(Schema.Boolean),
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated
|
|
26
|
+
*/
|
|
27
|
+
invocationTraceFeed: Schema.optional(Ref.Ref(Feed.Feed)),
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Preference for trigger execution.
|
|
31
|
+
* *disabled* - triggers do not run locally or on EDGE.
|
|
32
|
+
* *local* - triggers are executed locally on the client, edge is not running triggers.
|
|
33
|
+
* *edge* - triggers are executed on the edge, triggers are not run locally.
|
|
34
|
+
*/
|
|
35
|
+
computeEnvironment: Schema.optional(ComputeEnvironment),
|
|
36
|
+
|
|
37
|
+
//
|
|
38
|
+
// User properties.
|
|
39
|
+
//
|
|
40
|
+
|
|
41
|
+
name: Schema.optional(Schema.String),
|
|
42
|
+
description: Schema.optional(Schema.String),
|
|
43
|
+
icon: Schema.optional(Schema.String),
|
|
44
|
+
iconHue: Schema.optional(Schema.String),
|
|
45
|
+
hue: Schema.optional(Schema.String),
|
|
46
|
+
});
|
|
35
47
|
|
|
36
48
|
export type SpacePropertiesSchema = Schema.Schema.Type<typeof SpacePropertiesSchema>;
|
|
37
49
|
|
|
38
50
|
// TODO(burdon): Pipe Schem.optional, or partial to entire struct to make everything optional?
|
|
39
51
|
// TODO(burdon): Is separate schema def required for forms? Can it be extracted from SpaceProperties?
|
|
40
52
|
export const SpaceProperties = SpacePropertiesSchema.pipe(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
version: '0.1.0',
|
|
44
|
-
}),
|
|
45
|
-
Annotation.SystemTypeAnnotation.set(true),
|
|
53
|
+
Annotation.HiddenAnnotation.set(true),
|
|
54
|
+
Type.makeObject(DXN.make('org.dxos.type.spaceProperties', '0.1.0')),
|
|
46
55
|
);
|
|
47
56
|
|
|
48
|
-
export
|
|
57
|
+
export type SpaceProperties = Type.InstanceType<typeof SpaceProperties>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// src/types/SpaceProperties.ts
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import { Annotation, Ref, Type } from "@dxos/echo";
|
|
4
|
-
import { Queue } from "@dxos/echo-db";
|
|
5
|
-
var SpacePropertiesSchema = Schema.Struct({
|
|
6
|
-
//
|
|
7
|
-
// System properties.
|
|
8
|
-
//
|
|
9
|
-
archived: Schema.optional(Schema.Boolean.annotations({
|
|
10
|
-
title: "Archive Space"
|
|
11
|
-
})),
|
|
12
|
-
// TODO(burdon): Change to mode (no booleans?)
|
|
13
|
-
// TODO(wittjosiah): Make optional with default value.
|
|
14
|
-
edgeReplication: Schema.optional(Schema.Boolean),
|
|
15
|
-
invocationTraceQueue: Schema.optional(Ref.Ref(Queue)),
|
|
16
|
-
//
|
|
17
|
-
// User properties.
|
|
18
|
-
//
|
|
19
|
-
name: Schema.optional(Schema.String),
|
|
20
|
-
icon: Schema.optional(Schema.String),
|
|
21
|
-
hue: Schema.optional(Schema.String)
|
|
22
|
-
}, {
|
|
23
|
-
key: Schema.String,
|
|
24
|
-
value: Schema.Any
|
|
25
|
-
});
|
|
26
|
-
var SpaceProperties = SpacePropertiesSchema.pipe(Type.object({
|
|
27
|
-
typename: "org.dxos.type.space-properties",
|
|
28
|
-
version: "0.1.0"
|
|
29
|
-
}), Annotation.SystemTypeAnnotation.set(true));
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
SpacePropertiesSchema,
|
|
33
|
-
SpaceProperties
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=chunk-HQBTSFTW.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/SpaceProperties.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Ref, Type } from '@dxos/echo';\nimport { Queue } from '@dxos/echo-db';\n\nexport const SpacePropertiesSchema = Schema.Struct(\n {\n //\n // System properties.\n //\n\n archived: Schema.optional(Schema.Boolean.annotations({ title: 'Archive Space' })),\n // TODO(burdon): Change to mode (no booleans?)\n // TODO(wittjosiah): Make optional with default value.\n edgeReplication: Schema.optional(Schema.Boolean),\n invocationTraceQueue: Schema.optional(Ref.Ref(Queue)),\n\n //\n // User properties.\n //\n\n name: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n hue: Schema.optional(Schema.String),\n },\n {\n key: Schema.String,\n value: Schema.Any,\n },\n);\n\nexport type SpacePropertiesSchema = Schema.Schema.Type<typeof SpacePropertiesSchema>;\n\n// TODO(burdon): Pipe Schem.optional, or partial to entire struct to make everything optional?\n// TODO(burdon): Is separate schema def required for forms? Can it be extracted from SpaceProperties?\nexport const SpaceProperties = SpacePropertiesSchema.pipe(\n Type.object({\n typename: 'org.dxos.type.space-properties',\n version: '0.1.0',\n }),\n Annotation.SystemTypeAnnotation.set(true),\n);\n\nexport interface SpaceProperties extends Schema.Schema.Type<typeof SpaceProperties> {}\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,aAAa;AAEf,IAAMC,wBAA+BC,cAC1C;;;;EAKEC,UAAiBC,gBAAgBC,eAAQC,YAAY;IAAEC,OAAO;EAAgB,CAAA,CAAA;;;EAG9EC,iBAAwBJ,gBAAgBC,cAAO;EAC/CI,sBAA6BL,gBAASM,IAAIA,IAAIC,KAAAA,CAAAA;;;;EAM9CC,MAAaR,gBAAgBS,aAAM;EACnCC,MAAaV,gBAAgBS,aAAM;EACnCE,KAAYX,gBAAgBS,aAAM;AACpC,GACA;EACEG,KAAYH;EACZI,OAAcC;AAChB,CAAA;AAOK,IAAMC,kBAAkBlB,sBAAsBmB,KACnDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,qBAAqBC,IAAI,IAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Ref", "Type", "Queue", "SpacePropertiesSchema", "Struct", "archived", "optional", "Boolean", "annotations", "title", "edgeReplication", "invocationTraceQueue", "Ref", "Queue", "name", "String", "icon", "hue", "key", "value", "Any", "SpaceProperties", "pipe", "Type", "object", "typename", "version", "Annotation", "SystemTypeAnnotation", "set"]
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/types/SpaceProperties.ts
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
|
-
import { Annotation, Ref, Type } from "@dxos/echo";
|
|
6
|
-
import { Queue } from "@dxos/echo-db";
|
|
7
|
-
var SpacePropertiesSchema = Schema.Struct({
|
|
8
|
-
//
|
|
9
|
-
// System properties.
|
|
10
|
-
//
|
|
11
|
-
archived: Schema.optional(Schema.Boolean.annotations({
|
|
12
|
-
title: "Archive Space"
|
|
13
|
-
})),
|
|
14
|
-
// TODO(burdon): Change to mode (no booleans?)
|
|
15
|
-
// TODO(wittjosiah): Make optional with default value.
|
|
16
|
-
edgeReplication: Schema.optional(Schema.Boolean),
|
|
17
|
-
invocationTraceQueue: Schema.optional(Ref.Ref(Queue)),
|
|
18
|
-
//
|
|
19
|
-
// User properties.
|
|
20
|
-
//
|
|
21
|
-
name: Schema.optional(Schema.String),
|
|
22
|
-
icon: Schema.optional(Schema.String),
|
|
23
|
-
hue: Schema.optional(Schema.String)
|
|
24
|
-
}, {
|
|
25
|
-
key: Schema.String,
|
|
26
|
-
value: Schema.Any
|
|
27
|
-
});
|
|
28
|
-
var SpaceProperties = SpacePropertiesSchema.pipe(Type.object({
|
|
29
|
-
typename: "org.dxos.type.space-properties",
|
|
30
|
-
version: "0.1.0"
|
|
31
|
-
}), Annotation.SystemTypeAnnotation.set(true));
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
SpacePropertiesSchema,
|
|
35
|
-
SpaceProperties
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=chunk-URWCZ2QB.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/SpaceProperties.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Ref, Type } from '@dxos/echo';\nimport { Queue } from '@dxos/echo-db';\n\nexport const SpacePropertiesSchema = Schema.Struct(\n {\n //\n // System properties.\n //\n\n archived: Schema.optional(Schema.Boolean.annotations({ title: 'Archive Space' })),\n // TODO(burdon): Change to mode (no booleans?)\n // TODO(wittjosiah): Make optional with default value.\n edgeReplication: Schema.optional(Schema.Boolean),\n invocationTraceQueue: Schema.optional(Ref.Ref(Queue)),\n\n //\n // User properties.\n //\n\n name: Schema.optional(Schema.String),\n icon: Schema.optional(Schema.String),\n hue: Schema.optional(Schema.String),\n },\n {\n key: Schema.String,\n value: Schema.Any,\n },\n);\n\nexport type SpacePropertiesSchema = Schema.Schema.Type<typeof SpacePropertiesSchema>;\n\n// TODO(burdon): Pipe Schem.optional, or partial to entire struct to make everything optional?\n// TODO(burdon): Is separate schema def required for forms? Can it be extracted from SpaceProperties?\nexport const SpaceProperties = SpacePropertiesSchema.pipe(\n Type.object({\n typename: 'org.dxos.type.space-properties',\n version: '0.1.0',\n }),\n Annotation.SystemTypeAnnotation.set(true),\n);\n\nexport interface SpaceProperties extends Schema.Schema.Type<typeof SpaceProperties> {}\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,KAAKC,YAAY;AACtC,SAASC,aAAa;AAEf,IAAMC,wBAA+BC,cAC1C;;;;EAKEC,UAAiBC,gBAAgBC,eAAQC,YAAY;IAAEC,OAAO;EAAgB,CAAA,CAAA;;;EAG9EC,iBAAwBJ,gBAAgBC,cAAO;EAC/CI,sBAA6BL,gBAASM,IAAIA,IAAIC,KAAAA,CAAAA;;;;EAM9CC,MAAaR,gBAAgBS,aAAM;EACnCC,MAAaV,gBAAgBS,aAAM;EACnCE,KAAYX,gBAAgBS,aAAM;AACpC,GACA;EACEG,KAAYH;EACZI,OAAcC;AAChB,CAAA;AAOK,IAAMC,kBAAkBlB,sBAAsBmB,KACnDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,qBAAqBC,IAAI,IAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Ref", "Type", "Queue", "SpacePropertiesSchema", "Struct", "archived", "optional", "Boolean", "annotations", "title", "edgeReplication", "invocationTraceQueue", "Ref", "Queue", "name", "String", "icon", "hue", "key", "value", "Any", "SpaceProperties", "pipe", "Type", "object", "typename", "version", "Annotation", "SystemTypeAnnotation", "set"]
|
|
7
|
-
}
|