@dxos/client-protocol 0.8.4-main.ef1bc66f44 → 0.8.4-main.effb148878
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-IUPE7O26.mjs +43 -0
- package/dist/lib/browser/chunk-IUPE7O26.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +10 -15
- 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-ZDPZOIAV.mjs +45 -0
- package/dist/lib/node-esm/chunk-ZDPZOIAV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +10 -15
- 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 +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 +21 -4
- package/dist/types/src/space.d.ts.map +1 -1
- package/dist/types/src/types/SpaceProperties.d.ts +28 -6
- package/dist/types/src/types/SpaceProperties.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -22
- package/src/config.ts +5 -5
- package/src/echo.ts +6 -18
- package/src/service.ts +0 -4
- package/src/space.ts +24 -4
- package/src/types/SpaceProperties.ts +22 -9
- package/dist/lib/browser/chunk-N7EC364H.mjs +0 -36
- package/dist/lib/browser/chunk-N7EC364H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EM6VN4X6.mjs +0 -38
- package/dist/lib/node-esm/chunk-EM6VN4X6.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.effb148878",
|
|
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,26 @@
|
|
|
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
|
-
"base-x": "~3.0.
|
|
43
|
-
"effect": "3.
|
|
44
|
-
"@dxos/async": "0.8.4-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/echo": "0.8.4-main.
|
|
49
|
-
"@dxos/keys": "0.8.4-main.
|
|
50
|
-
"@dxos/invariant": "0.8.4-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
35
|
+
"base-x": "~3.0.11",
|
|
36
|
+
"effect": "3.20.0",
|
|
37
|
+
"@dxos/async": "0.8.4-main.effb148878",
|
|
38
|
+
"@dxos/context": "0.8.4-main.effb148878",
|
|
39
|
+
"@dxos/credentials": "0.8.4-main.effb148878",
|
|
40
|
+
"@dxos/echo": "0.8.4-main.effb148878",
|
|
41
|
+
"@dxos/echo-db": "0.8.4-main.effb148878",
|
|
42
|
+
"@dxos/keys": "0.8.4-main.effb148878",
|
|
43
|
+
"@dxos/invariant": "0.8.4-main.effb148878",
|
|
44
|
+
"@dxos/protocols": "0.8.4-main.effb148878",
|
|
45
|
+
"@dxos/rpc": "0.8.4-main.effb148878",
|
|
46
|
+
"@dxos/node-std": "0.8.4-main.effb148878"
|
|
54
47
|
},
|
|
55
48
|
"peerDependencies": {
|
|
56
|
-
"effect": "3.
|
|
49
|
+
"effect": "3.20.0"
|
|
57
50
|
},
|
|
58
51
|
"publishConfig": {
|
|
59
52
|
"access": "public"
|
package/src/config.ts
CHANGED
|
@@ -60,9 +60,9 @@ export namespace DXEnv {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
// https://wiki.archlinux.org/title/XDG_Base_Directory
|
|
66
|
-
// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.
|
|
67
|
-
export const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>
|
|
63
|
+
// Profile layout: profile/<name> is the profile dir; profile/<name>.yml is the config file.
|
|
64
|
+
export const getProfilePath = (root: string, profile: string, file?: string) =>
|
|
68
65
|
`${root}/profile/${profile}` + (file ? `/${file}` : '');
|
|
66
|
+
|
|
67
|
+
/** Path to the profile config file (profile/<name>.yml). */
|
|
68
|
+
export const getProfileConfigPath = (root: string, profile: string) => `${getProfilePath(root, profile)}.yml`;
|
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.
|
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.
|
|
@@ -103,7 +123,7 @@ export interface Space extends Messenger {
|
|
|
103
123
|
/**
|
|
104
124
|
* Properties object.
|
|
105
125
|
*/
|
|
106
|
-
get properties(): Obj.
|
|
126
|
+
get properties(): Obj.OfShape<SpaceProperties>;
|
|
107
127
|
|
|
108
128
|
/**
|
|
109
129
|
* Current state of space pipeline.
|
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Annotation, Type } from '@dxos/echo';
|
|
8
|
-
|
|
7
|
+
import { DXN, Annotation, 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>;
|
|
9
14
|
|
|
10
15
|
export const SpacePropertiesSchema = Schema.Struct(
|
|
11
16
|
{
|
|
@@ -17,7 +22,19 @@ export const SpacePropertiesSchema = Schema.Struct(
|
|
|
17
22
|
// TODO(burdon): Change to mode (no booleans?)
|
|
18
23
|
// TODO(wittjosiah): Make optional with default value.
|
|
19
24
|
edgeReplication: Schema.optional(Schema.Boolean),
|
|
20
|
-
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated
|
|
28
|
+
*/
|
|
29
|
+
invocationTraceFeed: Schema.optional(Ref.Ref(Feed.Feed)),
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Preference for trigger execution.
|
|
33
|
+
* *disabled* - triggers do not run locally or on EDGE.
|
|
34
|
+
* *local* - triggers are executed locally on the client, edge is not running triggers.
|
|
35
|
+
* *edge* - triggers are executed on the edge, triggers are not run locally.
|
|
36
|
+
*/
|
|
37
|
+
computeEnvironment: Schema.optional(ComputeEnvironment),
|
|
21
38
|
|
|
22
39
|
//
|
|
23
40
|
// User properties.
|
|
@@ -38,12 +55,8 @@ export type SpacePropertiesSchema = Schema.Schema.Type<typeof SpacePropertiesSch
|
|
|
38
55
|
// TODO(burdon): Pipe Schem.optional, or partial to entire struct to make everything optional?
|
|
39
56
|
// TODO(burdon): Is separate schema def required for forms? Can it be extracted from SpaceProperties?
|
|
40
57
|
export const SpaceProperties = SpacePropertiesSchema.pipe(
|
|
41
|
-
Type.object({
|
|
42
|
-
// TODO(burdon): Rename SpaceProperties.
|
|
43
|
-
typename: 'dxos.org/type/Properties',
|
|
44
|
-
version: '0.1.0',
|
|
45
|
-
}),
|
|
46
58
|
Annotation.SystemTypeAnnotation.set(true),
|
|
59
|
+
Type.makeObject(DXN.make('org.dxos.type.spaceProperties', '0.1.0')),
|
|
47
60
|
);
|
|
48
61
|
|
|
49
|
-
export
|
|
62
|
+
export type SpaceProperties = Type.InstanceType<typeof SpaceProperties>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/types/SpaceProperties.ts
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import { Annotation, 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(Type.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
|
-
// TODO(burdon): Rename SpaceProperties.
|
|
28
|
-
typename: "dxos.org/type/Properties",
|
|
29
|
-
version: "0.1.0"
|
|
30
|
-
}), Annotation.SystemTypeAnnotation.set(true));
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
SpacePropertiesSchema,
|
|
34
|
-
SpaceProperties
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=chunk-N7EC364H.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, 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(Type.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 // TODO(burdon): Rename SpaceProperties.\n typename: 'dxos.org/type/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,YAAY;AACjC,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,KAAKC,IAAIC,KAAAA,CAAAA;;;;EAM/CC,MAAaT,gBAAgBU,aAAM;EACnCC,MAAaX,gBAAgBU,aAAM;EACnCE,KAAYZ,gBAAgBU,aAAM;AACpC,GACA;EACEG,KAAYH;EACZI,OAAcC;AAChB,CAAA;AAOK,IAAMC,kBAAkBnB,sBAAsBoB,KACnDX,KAAKY,OAAO;;EAEVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,qBAAqBC,IAAI,IAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Type", "Queue", "SpacePropertiesSchema", "Struct", "archived", "optional", "Boolean", "annotations", "title", "edgeReplication", "invocationTraceQueue", "Type", "Ref", "Queue", "name", "String", "icon", "hue", "key", "value", "Any", "SpaceProperties", "pipe", "object", "typename", "version", "Annotation", "SystemTypeAnnotation", "set"]
|
|
7
|
-
}
|
|
@@ -1,38 +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, 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(Type.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
|
-
// TODO(burdon): Rename SpaceProperties.
|
|
30
|
-
typename: "dxos.org/type/Properties",
|
|
31
|
-
version: "0.1.0"
|
|
32
|
-
}), Annotation.SystemTypeAnnotation.set(true));
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
SpacePropertiesSchema,
|
|
36
|
-
SpaceProperties
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=chunk-EM6VN4X6.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, 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(Type.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 // TODO(burdon): Rename SpaceProperties.\n typename: 'dxos.org/type/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,YAAY;AACjC,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,KAAKC,IAAIC,KAAAA,CAAAA;;;;EAM/CC,MAAaT,gBAAgBU,aAAM;EACnCC,MAAaX,gBAAgBU,aAAM;EACnCE,KAAYZ,gBAAgBU,aAAM;AACpC,GACA;EACEG,KAAYH;EACZI,OAAcC;AAChB,CAAA;AAOK,IAAMC,kBAAkBnB,sBAAsBoB,KACnDX,KAAKY,OAAO;;EAEVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,qBAAqBC,IAAI,IAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Type", "Queue", "SpacePropertiesSchema", "Struct", "archived", "optional", "Boolean", "annotations", "title", "edgeReplication", "invocationTraceQueue", "Type", "Ref", "Queue", "name", "String", "icon", "hue", "key", "value", "Any", "SpaceProperties", "pipe", "object", "typename", "version", "Annotation", "SystemTypeAnnotation", "set"]
|
|
7
|
-
}
|