@dxos/client-protocol 0.1.56-main.c19b7cd → 0.1.56-main.c277f68
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/index.mjs +6 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +8 -6
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/config.d.ts +2 -1
- package/dist/types/src/config.d.ts.map +1 -1
- package/dist/types/src/halo.d.ts +1 -0
- package/dist/types/src/halo.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/config.ts +2 -1
- package/src/halo.ts +1 -0
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
var DEFAULT_INTERNAL_CHANNEL = "dxos:vault";
|
|
3
3
|
var DEFAULT_CLIENT_CHANNEL = "dxos:app";
|
|
4
4
|
var DEFAULT_SHELL_CHANNEL = "dxos:shell";
|
|
5
|
-
var
|
|
5
|
+
var DEFAULT_VAULT_ORIGIN = "https://halo.dxos.org";
|
|
6
|
+
var DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + "/vault.html";
|
|
6
7
|
var EXPECTED_CONFIG_VERSION = 1;
|
|
7
8
|
var defaultConfig = {
|
|
8
9
|
version: 1
|
|
9
10
|
};
|
|
10
|
-
var
|
|
11
|
-
var HOME = typeof process !== "undefined" ? (_b = (_a = process == null ? void 0 : process.env) == null ? void 0 : _a.HOME) != null ? _b : "" : "";
|
|
11
|
+
var HOME = typeof process !== "undefined" ? process?.env?.HOME ?? "" : "";
|
|
12
12
|
var getProfilePath = (root, profile, file = void 0) => `${root}/profile/${profile}` + (file ? `/${file}` : "");
|
|
13
13
|
var DX_CONFIG = `${HOME}/.config/dx`;
|
|
14
14
|
var DX_CACHE = `${HOME}/.cache/dx`;
|
|
@@ -73,7 +73,7 @@ var AuthenticatingInvitationObservable = class extends CancellableInvitationObse
|
|
|
73
73
|
var wrapObservable = async (observable) => {
|
|
74
74
|
return new Promise((resolve, reject) => {
|
|
75
75
|
const subscription = observable.subscribe((invitation) => {
|
|
76
|
-
invariant(
|
|
76
|
+
invariant(invitation?.state === Invitation.State.SUCCESS, void 0, {
|
|
77
77
|
F: __dxlog_file,
|
|
78
78
|
L: 81,
|
|
79
79
|
S: void 0,
|
|
@@ -137,9 +137,10 @@ export {
|
|
|
137
137
|
CREATE_SPACE_TIMEOUT,
|
|
138
138
|
CancellableInvitationObservable,
|
|
139
139
|
DEFAULT_CLIENT_CHANNEL,
|
|
140
|
-
DEFAULT_CLIENT_ORIGIN,
|
|
141
140
|
DEFAULT_INTERNAL_CHANNEL,
|
|
142
141
|
DEFAULT_SHELL_CHANNEL,
|
|
142
|
+
DEFAULT_VAULT_ORIGIN,
|
|
143
|
+
DEFAULT_VAULT_URL,
|
|
143
144
|
DX_CACHE,
|
|
144
145
|
DX_CONFIG,
|
|
145
146
|
DX_DATA,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/service-definitions.ts", "../../../src/timeouts.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\n\nexport const DEFAULT_CLIENT_ORIGIN = 'https://halo.dxos.org/vault.html';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? process?.env?.HOME ?? '' : '';\n\n// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n return codec.decode(base62.decode(text));\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, Observable, Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitationObservable[]>;\n accepted: MulticastObservable<AuthenticatingInvitationObservable[]>;\n createInvitation(options?: Partial<Invitation>): CancellableInvitationObservable;\n acceptInvitation(invitation: Invitation): AuthenticatingInvitationObservable;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitationObservable extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitationObservable extends CancellableInvitationObservable {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitationObservable): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n DevicesService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { createServiceBundle, ServiceBundle } from '@dxos/rpc';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n open(ctx: Context): Promise<void>;\n close(ctx: Context): Promise<void>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 3_000;\n\n/**\n * Timeout for loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAE9B,IAAMC,
|
|
6
|
-
"names": ["DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\n\nexport const DEFAULT_VAULT_ORIGIN = 'https://halo.dxos.org';\nexport const DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + '/vault.html';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? process?.env?.HOME ?? '' : '';\n\n// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n return codec.decode(base62.decode(text));\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, Observable, Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitationObservable[]>;\n accepted: MulticastObservable<AuthenticatingInvitationObservable[]>;\n createInvitation(options?: Partial<Invitation>): CancellableInvitationObservable;\n acceptInvitation(invitation: Invitation): AuthenticatingInvitationObservable;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitationObservable extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitationObservable extends CancellableInvitationObservable {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitationObservable): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n DevicesService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { createServiceBundle, ServiceBundle } from '@dxos/rpc';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n open(ctx: Context): Promise<void>;\n close(ctx: Context): Promise<void>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 3_000;\n\n/**\n * Timeout for loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAE9B,IAAMC,uBAAuB;AAC7B,IAAMC,oBAAoBD,uBAAuB;AAEjD,IAAME,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAcA,SAASC,KAAKF,QAAQ,KAAK;AAMlE,IAAMG,iBAAiB,CAACC,MAAcC,SAAiBC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B;AAKjC,IAAMC,eAAe;AAKrB,IAAMC,iBAAiB;AAKvB,IAAMC,wBAAwB;AAM9B,IAAMC,0BAA0B;AAKhC,IAAMC,uBAAuB;AAK7B,IAAMC,6BAA6B;",
|
|
6
|
+
"names": ["DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "DEFAULT_VAULT_ORIGIN", "DEFAULT_VAULT_URL", "EXPECTED_CONFIG_VERSION", "defaultConfig", "version", "HOME", "process", "env", "getProfilePath", "root", "profile", "file", "undefined", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "ENV_DX_CONFIG", "ENV_DX_PROFILE", "ENV_DX_PROFILE_DEFAULT", "base", "schema", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "encode", "invitation", "invitationId", "type", "kind", "authMethod", "swarmKey", "state", "timeout", "MulticastObservable", "invariant", "Invitation", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitationObservable", "constructor", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "AuthenticatingInvitationObservable", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invitation", "state", "State", "SUCCESS", "unsubscribe", "err", "schema", "createServiceBundle", "clientServiceBundle", "createServiceBundle", "SystemService", "schema", "getService", "NetworkService", "LoggingService", "IdentityService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "FunctionRegistryService", "DevtoolsHost", "TracingService", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":5848,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/echo.ts":{"bytes":1591,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/halo.ts":{"bytes":1783,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytes":3446,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytes":7931,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/client-protocol/src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"packages/sdk/client-protocol/src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytes":8188,"imports":[{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/shell.ts":{"bytes":1052,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/space.ts":{"bytes":3764,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/timeouts.ts":{"bytes":3134,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/index.ts":{"bytes":1086,"imports":[{"path":"packages/sdk/client-protocol/src/config.ts","kind":"import-statement","original":"./config"},{"path":"packages/sdk/client-protocol/src/echo.ts","kind":"import-statement","original":"./echo"},{"path":"packages/sdk/client-protocol/src/halo.ts","kind":"import-statement","original":"./halo"},{"path":"packages/sdk/client-protocol/src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/sdk/client-protocol/src/service-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"packages/sdk/client-protocol/src/shell.ts","kind":"import-statement","original":"./shell"},{"path":"packages/sdk/client-protocol/src/space.ts","kind":"import-statement","original":"./space"},{"path":"packages/sdk/client-protocol/src/timeouts.ts","kind":"import-statement","original":"./timeouts"}],"format":"esm"}},"outputs":{"packages/sdk/client-protocol/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14565},"packages/sdk/client-protocol/dist/lib/browser/index.mjs":{"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"exports":["AUTHENTICATION_CODE_LENGTH","AUTH_TIMEOUT","AuthenticatingInvitationObservable","CREATE_SPACE_TIMEOUT","CancellableInvitationObservable","DEFAULT_CLIENT_CHANNEL","DEFAULT_INTERNAL_CHANNEL","DEFAULT_SHELL_CHANNEL","DEFAULT_VAULT_ORIGIN","DEFAULT_VAULT_URL","DX_CACHE","DX_CONFIG","DX_DATA","DX_RUNTIME","DX_STATE","ENV_DX_CONFIG","ENV_DX_PROFILE","ENV_DX_PROFILE_DEFAULT","EXPECTED_CONFIG_VERSION","INVITATION_TIMEOUT","InvitationEncoder","LOAD_CONTROL_FEEDS_TIMEOUT","LOAD_PROPERTIES_TIMEOUT","PROXY_CONNECTION_TIMEOUT","RESOURCE_LOCK_TIMEOUT","STATUS_TIMEOUT","appServiceBundle","clientServiceBundle","defaultConfig","getProfilePath","iframeServiceBundle","shellServiceBundle","workerServiceBundle","wrapObservable"],"entryPoint":"packages/sdk/client-protocol/src/index.ts","inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytesInOutput":797},"packages/sdk/client-protocol/src/index.ts":{"bytesInOutput":0},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytesInOutput":663},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytesInOutput":0},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytesInOutput":1525},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytesInOutput":1426},"packages/sdk/client-protocol/src/timeouts.ts":{"bytesInOutput":224}},"bytes":5712}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -36,9 +36,10 @@ __export(src_exports, {
|
|
|
36
36
|
CREATE_SPACE_TIMEOUT: () => CREATE_SPACE_TIMEOUT,
|
|
37
37
|
CancellableInvitationObservable: () => CancellableInvitationObservable,
|
|
38
38
|
DEFAULT_CLIENT_CHANNEL: () => DEFAULT_CLIENT_CHANNEL,
|
|
39
|
-
DEFAULT_CLIENT_ORIGIN: () => DEFAULT_CLIENT_ORIGIN,
|
|
40
39
|
DEFAULT_INTERNAL_CHANNEL: () => DEFAULT_INTERNAL_CHANNEL,
|
|
41
40
|
DEFAULT_SHELL_CHANNEL: () => DEFAULT_SHELL_CHANNEL,
|
|
41
|
+
DEFAULT_VAULT_ORIGIN: () => DEFAULT_VAULT_ORIGIN,
|
|
42
|
+
DEFAULT_VAULT_URL: () => DEFAULT_VAULT_URL,
|
|
42
43
|
DX_CACHE: () => DX_CACHE,
|
|
43
44
|
DX_CONFIG: () => DX_CONFIG,
|
|
44
45
|
DX_DATA: () => DX_DATA,
|
|
@@ -70,13 +71,13 @@ module.exports = __toCommonJS(src_exports);
|
|
|
70
71
|
var DEFAULT_INTERNAL_CHANNEL = "dxos:vault";
|
|
71
72
|
var DEFAULT_CLIENT_CHANNEL = "dxos:app";
|
|
72
73
|
var DEFAULT_SHELL_CHANNEL = "dxos:shell";
|
|
73
|
-
var
|
|
74
|
+
var DEFAULT_VAULT_ORIGIN = "https://halo.dxos.org";
|
|
75
|
+
var DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + "/vault.html";
|
|
74
76
|
var EXPECTED_CONFIG_VERSION = 1;
|
|
75
77
|
var defaultConfig = {
|
|
76
78
|
version: 1
|
|
77
79
|
};
|
|
78
|
-
var
|
|
79
|
-
var HOME = typeof process !== "undefined" ? (_b = (_a = process == null ? void 0 : process.env) == null ? void 0 : _a.HOME) != null ? _b : "" : "";
|
|
80
|
+
var HOME = typeof process !== "undefined" ? process?.env?.HOME ?? "" : "";
|
|
80
81
|
var getProfilePath = (root, profile, file = void 0) => `${root}/profile/${profile}` + (file ? `/${file}` : "");
|
|
81
82
|
var DX_CONFIG = `${HOME}/.config/dx`;
|
|
82
83
|
var DX_CACHE = `${HOME}/.cache/dx`;
|
|
@@ -141,7 +142,7 @@ var AuthenticatingInvitationObservable = class extends CancellableInvitationObse
|
|
|
141
142
|
var wrapObservable = async (observable) => {
|
|
142
143
|
return new Promise((resolve, reject) => {
|
|
143
144
|
const subscription = observable.subscribe((invitation) => {
|
|
144
|
-
(0, import_invariant.invariant)(
|
|
145
|
+
(0, import_invariant.invariant)(invitation?.state === import_services.Invitation.State.SUCCESS, void 0, {
|
|
145
146
|
F: __dxlog_file,
|
|
146
147
|
L: 81,
|
|
147
148
|
S: void 0,
|
|
@@ -206,9 +207,10 @@ var LOAD_CONTROL_FEEDS_TIMEOUT = 3e3;
|
|
|
206
207
|
CREATE_SPACE_TIMEOUT,
|
|
207
208
|
CancellableInvitationObservable,
|
|
208
209
|
DEFAULT_CLIENT_CHANNEL,
|
|
209
|
-
DEFAULT_CLIENT_ORIGIN,
|
|
210
210
|
DEFAULT_INTERNAL_CHANNEL,
|
|
211
211
|
DEFAULT_SHELL_CHANNEL,
|
|
212
|
+
DEFAULT_VAULT_ORIGIN,
|
|
213
|
+
DEFAULT_VAULT_URL,
|
|
212
214
|
DX_CACHE,
|
|
213
215
|
DX_CONFIG,
|
|
214
216
|
DX_DATA,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts", "../../../src/config.ts", "../../../src/invitations/encoder.ts", "../../../src/invitations/invitations.ts", "../../../src/service-definitions.ts", "../../../src/timeouts.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from './config';\nexport * from './echo';\nexport * from './halo';\nexport * from './invitations';\nexport * from './service-definitions';\nexport * from './shell';\nexport * from './space';\nexport * from './timeouts';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\n\nexport const DEFAULT_CLIENT_ORIGIN = 'https://halo.dxos.org/vault.html';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? process?.env?.HOME ?? '' : '';\n\n// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n return codec.decode(base62.decode(text));\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, Observable, Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitationObservable[]>;\n accepted: MulticastObservable<AuthenticatingInvitationObservable[]>;\n createInvitation(options?: Partial<Invitation>): CancellableInvitationObservable;\n acceptInvitation(invitation: Invitation): AuthenticatingInvitationObservable;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitationObservable extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitationObservable extends CancellableInvitationObservable {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitationObservable): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n DevicesService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { createServiceBundle, ServiceBundle } from '@dxos/rpc';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n open(ctx: Context): Promise<void>;\n close(ctx: Context): Promise<void>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 3_000;\n\n/**\n * Timeout for loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
6
|
-
"names": ["DEFAULT_INTERNAL_CHANNEL", "DEFAULT_CLIENT_CHANNEL", "DEFAULT_SHELL_CHANNEL", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from './config';\nexport * from './echo';\nexport * from './halo';\nexport * from './invitations';\nexport * from './service-definitions';\nexport * from './shell';\nexport * from './space';\nexport * from './timeouts';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { ConfigProto } from '@dxos/config';\n\nexport const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';\nexport const DEFAULT_CLIENT_CHANNEL = 'dxos:app';\nexport const DEFAULT_SHELL_CHANNEL = 'dxos:shell';\n\nexport const DEFAULT_VAULT_ORIGIN = 'https://halo.dxos.org';\nexport const DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + '/vault.html';\n\nexport const EXPECTED_CONFIG_VERSION = 1;\nexport const defaultConfig: ConfigProto = { version: 1 };\n\n// TODO(burdon): Allow override via env? Generalize since currently NodeJS only.\nconst HOME = typeof process !== 'undefined' ? process?.env?.HOME ?? '' : '';\n\n// Base directories.\n// TODO(burdon): Consider Windows, Linux, OSX.\n// https://wiki.archlinux.org/title/XDG_Base_Directory\n// Each `/dx` directory should contain `/profile/<DX_PROFILE>` subdirectories.\nexport const getProfilePath = (root: string, profile: string, file: string | undefined = undefined) =>\n `${root}/profile/${profile}` + (file ? `/${file}` : '');\n\n// XDG_CONFIG_HOME (Analogous to /etc.)\nexport const DX_CONFIG = `${HOME}/.config/dx`;\n\n// XDG_CACHE_HOME (Analogous to /var/cache).\nexport const DX_CACHE = `${HOME}/.cache/dx`;\n\n// TODO(burdon): Storage should use this by default (make path optional).\n// XDG_DATA_HOME (Analogous to /usr/share).\nexport const DX_DATA = `${HOME}/.local/share/dx`;\n\n// XDG_STATE_HOME (Analogous to /var/lib).\nexport const DX_STATE = `${HOME}/.local/state/dx`;\n\n// XDG_RUNTIME_DIR (Non-essential files, sockets, etc.)\nexport const DX_RUNTIME = '/tmp/dx/run';\n\nexport const ENV_DX_CONFIG = 'DX_CONFIG';\nexport const ENV_DX_PROFILE = 'DX_PROFILE';\nexport const ENV_DX_PROFILE_DEFAULT = 'default';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport base from 'base-x';\n\nimport { schema } from '@dxos/protocols';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\n// Encode with URL-safe alpha-numeric characters.\nconst base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\nconst codec = schema.getCodecForType('dxos.client.services.Invitation');\n\n/**\n * Encodes and decodes an invitation proto into/from alphanumeric chars.\n */\nexport class InvitationEncoder {\n static decode(text: string): Invitation {\n return codec.decode(base62.decode(text));\n }\n\n static encode(invitation: Invitation): string {\n return base62.encode(\n codec.encode({\n invitationId: invitation.invitationId,\n type: invitation.type,\n kind: invitation.kind,\n authMethod: invitation.authMethod,\n swarmKey: invitation.swarmKey,\n state: invitation.state,\n timeout: invitation.timeout,\n }),\n );\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { MulticastObservable, Observable, Subscriber } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nexport const AUTHENTICATION_CODE_LENGTH = 6;\n\nexport const INVITATION_TIMEOUT = 3 * 60_000; // 3 mins.\n\nexport interface Invitations {\n created: MulticastObservable<CancellableInvitationObservable[]>;\n accepted: MulticastObservable<AuthenticatingInvitationObservable[]>;\n createInvitation(options?: Partial<Invitation>): CancellableInvitationObservable;\n acceptInvitation(invitation: Invitation): AuthenticatingInvitationObservable;\n}\n\n/**\n * Base class for all invitation observables and providers.\n */\nexport class CancellableInvitationObservable extends MulticastObservable<Invitation> {\n private readonly _onCancel: () => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n }) {\n super(subscriber, initialInvitation);\n this._onCancel = onCancel;\n }\n\n cancel(): Promise<void> {\n return this._onCancel();\n }\n}\n\n/**\n * Cancelable observer that relays authentication requests.\n */\nexport class AuthenticatingInvitationObservable extends CancellableInvitationObservable {\n private readonly _onAuthenticate: (authCode: string) => Promise<void>;\n\n constructor({\n subscriber,\n initialInvitation,\n onCancel,\n onAuthenticate,\n }: {\n subscriber: Observable<Invitation> | Subscriber<Invitation>;\n initialInvitation: Invitation;\n onCancel: () => Promise<void>;\n onAuthenticate: (authCode: string) => Promise<void>;\n }) {\n super({ subscriber, initialInvitation, onCancel });\n this._onAuthenticate = onAuthenticate;\n }\n\n async authenticate(authCode: string): Promise<void> {\n return this._onAuthenticate(authCode);\n }\n}\n\n/**\n * Testing util to wrap non-authenticating observable with promise.\n * Don't use this in production code.\n * @deprecated\n */\n// TODO(wittjosiah): Move to testing.\nexport const wrapObservable = async (observable: CancellableInvitationObservable): Promise<Invitation> => {\n return new Promise((resolve, reject) => {\n const subscription = observable.subscribe(\n (invitation: Invitation | undefined) => {\n // TODO(burdon): Throw error if auth requested.\n invariant(invitation?.state === Invitation.State.SUCCESS);\n subscription.unsubscribe();\n resolve(invitation);\n },\n (err: Error) => {\n subscription.unsubscribe();\n reject(err);\n },\n );\n });\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { Context } from '@dxos/context';\nimport { schema } from '@dxos/protocols';\nimport { FunctionRegistryService } from '@dxos/protocols/proto/dxos/agent/functions';\nimport {\n DevicesService,\n IdentityService,\n InvitationsService,\n LoggingService,\n NetworkService,\n SpacesService,\n SystemService,\n} from '@dxos/protocols/proto/dxos/client/services';\nimport { DevtoolsHost } from '@dxos/protocols/proto/dxos/devtools/host';\nimport { DataService } from '@dxos/protocols/proto/dxos/echo/service';\nimport type { AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';\nimport type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';\nimport { TracingService } from '@dxos/protocols/proto/dxos/tracing';\nimport { createServiceBundle, ServiceBundle } from '@dxos/rpc';\n\n//\n// NOTE: Should contain client/proxy dependencies only.\n//\n\nexport type ClientServices = {\n SystemService: SystemService;\n NetworkService: NetworkService;\n LoggingService: LoggingService;\n\n IdentityService: IdentityService;\n InvitationsService: InvitationsService;\n DevicesService: DevicesService;\n SpacesService: SpacesService;\n DataService: DataService;\n\n FunctionRegistryService: FunctionRegistryService;\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: DevtoolsHost;\n\n TracingService: TracingService;\n};\n\n/**\n * Provide access to client services definitions and service handler.\n */\nexport interface ClientServicesProvider {\n descriptors: ServiceBundle<ClientServices>;\n services: Partial<ClientServices>;\n\n open(ctx: Context): Promise<void>;\n close(ctx: Context): Promise<void>;\n}\n\n/**\n * Services supported by host.\n */\nexport const clientServiceBundle = createServiceBundle<ClientServices>({\n SystemService: schema.getService('dxos.client.services.SystemService'),\n NetworkService: schema.getService('dxos.client.services.NetworkService'),\n LoggingService: schema.getService('dxos.client.services.LoggingService'),\n\n IdentityService: schema.getService('dxos.client.services.IdentityService'),\n InvitationsService: schema.getService('dxos.client.services.InvitationsService'),\n DevicesService: schema.getService('dxos.client.services.DevicesService'),\n SpacesService: schema.getService('dxos.client.services.SpacesService'),\n DataService: schema.getService('dxos.echo.service.DataService'),\n\n // Agent-only.\n FunctionRegistryService: schema.getService('dxos.agent.functions.FunctionRegistryService'),\n\n // TODO(burdon): Deprecated.\n DevtoolsHost: schema.getService('dxos.devtools.host.DevtoolsHost'),\n\n TracingService: schema.getService('dxos.tracing.TracingService'),\n});\n\nexport type IframeServiceBundle = {\n BridgeService: BridgeService;\n};\n\nexport const iframeServiceBundle: ServiceBundle<IframeServiceBundle> = {\n BridgeService: schema.getService('dxos.mesh.bridge.BridgeService'),\n};\n\nexport type WorkerServiceBundle = {\n WorkerService: WorkerService;\n};\n\nexport const workerServiceBundle: ServiceBundle<WorkerServiceBundle> = {\n WorkerService: schema.getService('dxos.iframe.WorkerService'),\n};\n\nexport type AppServiceBundle = {\n AppService: AppService;\n};\n\nexport const appServiceBundle: ServiceBundle<AppServiceBundle> = {\n AppService: schema.getService('dxos.iframe.AppService'),\n};\n\nexport type ShellServiceBundle = {\n ShellService: ShellService;\n};\n\nexport const shellServiceBundle: ServiceBundle<ShellServiceBundle> = {\n ShellService: schema.getService('dxos.iframe.ShellService'),\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Timeout for making rpc connections from remote proxies.\n */\nexport const PROXY_CONNECTION_TIMEOUT = 30_000;\n\n/**\n * Timeout for the device to be added to the trusted set during auth.\n */\nexport const AUTH_TIMEOUT = 30_000;\n\n/**\n * Timeout for how long the remote client will wait before assuming the connection is lost.\n */\nexport const STATUS_TIMEOUT = 10_000;\n\n/**\n * Timeout for waiting before stealing resource lock.\n */\nexport const RESOURCE_LOCK_TIMEOUT = 3_000;\n\n/**\n * Timeout for space properties to be loaded in the set of tracked items.\n * Accounts for latency between SpaceService reporting the space as READY and DataService streaming the item states.\n */\nexport const LOAD_PROPERTIES_TIMEOUT = 3_000;\n\n/**\n * Timeout for creating new spaces.\n */\nexport const CREATE_SPACE_TIMEOUT = 3_000;\n\n/**\n * Timeout for loading of control feeds.\n */\nexport const LOAD_CONTROL_FEEDS_TIMEOUT = 3_000;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACMO,IAAMA,2BAA2B;AACjC,IAAMC,yBAAyB;AAC/B,IAAMC,wBAAwB;AAE9B,IAAMC,uBAAuB;AAC7B,IAAMC,oBAAoBD,uBAAuB;AAEjD,IAAME,0BAA0B;AAChC,IAAMC,gBAA6B;EAAEC,SAAS;AAAE;AAGvD,IAAMC,OAAO,OAAOC,YAAY,cAAcA,SAASC,KAAKF,QAAQ,KAAK;AAMlE,IAAMG,iBAAiB,CAACC,MAAcC,SAAiBC,OAA2BC,WACvF,GAAGH,IAAAA,YAAgBC,OAAAA,MAAaC,OAAO,IAAIA,IAAAA,KAAS;AAG/C,IAAME,YAAY,GAAGR,IAAAA;AAGrB,IAAMS,WAAW,GAAGT,IAAAA;AAIpB,IAAMU,UAAU,GAAGV,IAAAA;AAGnB,IAAMW,WAAW,GAAGX,IAAAA;AAGpB,IAAMY,aAAa;AAEnB,IAAMC,gBAAgB;AACtB,IAAMC,iBAAiB;AACvB,IAAMC,yBAAyB;;;ACxCtC,oBA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ePath", "root", "profile", "file", "undefined", "DX_CONFIG", "DX_CACHE", "DX_DATA", "DX_STATE", "DX_RUNTIME", "ENV_DX_CONFIG", "ENV_DX_PROFILE", "ENV_DX_PROFILE_DEFAULT", "base62", "base", "codec", "schema", "getCodecForType", "InvitationEncoder", "decode", "text", "encode", "invitation", "invitationId", "type", "kind", "authMethod", "swarmKey", "state", "timeout", "AUTHENTICATION_CODE_LENGTH", "INVITATION_TIMEOUT", "CancellableInvitationObservable", "MulticastObservable", "constructor", "subscriber", "initialInvitation", "onCancel", "_onCancel", "cancel", "AuthenticatingInvitationObservable", "onAuthenticate", "_onAuthenticate", "authenticate", "authCode", "wrapObservable", "observable", "Promise", "resolve", "reject", "subscription", "subscribe", "invitation", "invariant", "state", "Invitation", "State", "SUCCESS", "unsubscribe", "err", "import_protocols", "clientServiceBundle", "createServiceBundle", "SystemService", "schema", "getService", "NetworkService", "LoggingService", "IdentityService", "InvitationsService", "DevicesService", "SpacesService", "DataService", "FunctionRegistryService", "DevtoolsHost", "TracingService", "iframeServiceBundle", "BridgeService", "workerServiceBundle", "WorkerService", "appServiceBundle", "AppService", "shellServiceBundle", "ShellService", "PROXY_CONNECTION_TIMEOUT", "AUTH_TIMEOUT", "STATUS_TIMEOUT", "RESOURCE_LOCK_TIMEOUT", "LOAD_PROPERTIES_TIMEOUT", "CREATE_SPACE_TIMEOUT", "LOAD_CONTROL_FEEDS_TIMEOUT"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/sdk/client-protocol/src/config.ts":{"bytes":5848,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/echo.ts":{"bytes":1591,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/halo.ts":{"bytes":1783,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytes":3446,"imports":[{"path":"base-x","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytes":7931,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/client-protocol/src/invitations/encoder.ts","kind":"import-statement","original":"./encoder"},{"path":"packages/sdk/client-protocol/src/invitations/invitations.ts","kind":"import-statement","original":"./invitations"}],"format":"esm"},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytes":8188,"imports":[{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/rpc","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/client-protocol/src/shell.ts":{"bytes":1052,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/space.ts":{"bytes":3764,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/timeouts.ts":{"bytes":3134,"imports":[],"format":"esm"},"packages/sdk/client-protocol/src/index.ts":{"bytes":1086,"imports":[{"path":"packages/sdk/client-protocol/src/config.ts","kind":"import-statement","original":"./config"},{"path":"packages/sdk/client-protocol/src/echo.ts","kind":"import-statement","original":"./echo"},{"path":"packages/sdk/client-protocol/src/halo.ts","kind":"import-statement","original":"./halo"},{"path":"packages/sdk/client-protocol/src/invitations/index.ts","kind":"import-statement","original":"./invitations"},{"path":"packages/sdk/client-protocol/src/service-definitions.ts","kind":"import-statement","original":"./service-definitions"},{"path":"packages/sdk/client-protocol/src/shell.ts","kind":"import-statement","original":"./shell"},{"path":"packages/sdk/client-protocol/src/space.ts","kind":"import-statement","original":"./space"},{"path":"packages/sdk/client-protocol/src/timeouts.ts","kind":"import-statement","original":"./timeouts"}],"format":"esm"}},"outputs":{"packages/sdk/client-protocol/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14887},"packages/sdk/client-protocol/dist/lib/node/index.cjs":{"imports":[{"path":"base-x","kind":"require-call","external":true},{"path":"@dxos/protocols","kind":"require-call","external":true},{"path":"@dxos/async","kind":"require-call","external":true},{"path":"@dxos/invariant","kind":"require-call","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"require-call","external":true},{"path":"@dxos/protocols","kind":"require-call","external":true},{"path":"@dxos/rpc","kind":"require-call","external":true}],"exports":[],"entryPoint":"packages/sdk/client-protocol/src/index.ts","inputs":{"packages/sdk/client-protocol/src/index.ts":{"bytesInOutput":1733},"packages/sdk/client-protocol/src/config.ts":{"bytesInOutput":797},"packages/sdk/client-protocol/src/invitations/encoder.ts":{"bytesInOutput":732},"packages/sdk/client-protocol/src/invitations/index.ts":{"bytesInOutput":0},"packages/sdk/client-protocol/src/invitations/invitations.ts":{"bytesInOutput":1578},"packages/sdk/client-protocol/src/service-definitions.ts":{"bytesInOutput":1686},"packages/sdk/client-protocol/src/timeouts.ts":{"bytesInOutput":224}},"bytes":9349}}}
|
|
@@ -2,7 +2,8 @@ import { ConfigProto } from '@dxos/config';
|
|
|
2
2
|
export declare const DEFAULT_INTERNAL_CHANNEL = "dxos:vault";
|
|
3
3
|
export declare const DEFAULT_CLIENT_CHANNEL = "dxos:app";
|
|
4
4
|
export declare const DEFAULT_SHELL_CHANNEL = "dxos:shell";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const DEFAULT_VAULT_ORIGIN = "https://halo.dxos.org";
|
|
6
|
+
export declare const DEFAULT_VAULT_URL: string;
|
|
6
7
|
export declare const EXPECTED_CONFIG_VERSION = 1;
|
|
7
8
|
export declare const defaultConfig: ConfigProto;
|
|
8
9
|
export declare const getProfilePath: (root: string, profile: string, file?: string | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,eAAO,MAAM,wBAAwB,eAAe,CAAC;AACrD,eAAO,MAAM,sBAAsB,aAAa,CAAC;AACjD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,eAAO,MAAM,wBAAwB,eAAe,CAAC;AACrD,eAAO,MAAM,sBAAsB,aAAa,CAAC;AACjD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,QAAuC,CAAC;AAEtE,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,aAAa,EAAE,WAA4B,CAAC;AASzD,eAAO,MAAM,cAAc,SAAU,MAAM,WAAW,MAAM,SAAQ,MAAM,GAAG,SAAS,WAC7B,CAAC;AAG1D,eAAO,MAAM,SAAS,QAAuB,CAAC;AAG9C,eAAO,MAAM,QAAQ,QAAsB,CAAC;AAI5C,eAAO,MAAM,OAAO,QAA4B,CAAC;AAGjD,eAAO,MAAM,QAAQ,QAA4B,CAAC;AAGlD,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAExC,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,sBAAsB,YAAY,CAAC"}
|
package/dist/types/src/halo.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface Halo {
|
|
|
13
13
|
get invitations(): MulticastObservable<CancellableInvitationObservable[]>;
|
|
14
14
|
createIdentity(options?: ProfileDocument): Promise<Identity>;
|
|
15
15
|
recoverIdentity(recoveryKey: Uint8Array): Promise<Identity>;
|
|
16
|
+
updateProfile(profile: ProfileDocument): Promise<Identity>;
|
|
16
17
|
createInvitation(): CancellableInvitationObservable;
|
|
17
18
|
acceptInvitation(invitation: Invitation): AuthenticatingInvitationObservable;
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"halo.d.ts","sourceRoot":"","sources":["../../../src/halo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,kCAAkC,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAEpG;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,IAAI,QAAQ,IAAI,mBAAmB,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACrD,IAAI,OAAO,IAAI,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC;IACjC,IAAI,QAAQ,IAAI,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/C,IAAI,WAAW,IAAI,mBAAmB,CAAC,+BAA+B,EAAE,CAAC,CAAC;IAE1E,cAAc,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,eAAe,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"halo.d.ts","sourceRoot":"","sources":["../../../src/halo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,kCAAkC,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAEpG;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,IAAI,QAAQ,IAAI,mBAAmB,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACrD,IAAI,OAAO,IAAI,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC;IACjC,IAAI,QAAQ,IAAI,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/C,IAAI,WAAW,IAAI,mBAAmB,CAAC,+BAA+B,EAAE,CAAC,CAAC;IAE1E,cAAc,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,eAAe,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5D,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE3D,gBAAgB,IAAI,+BAA+B,CAAC;IACpD,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,kCAAkC,CAAC;CAC9E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-protocol",
|
|
3
|
-
"version": "0.1.56-main.
|
|
3
|
+
"version": "0.1.56-main.c277f68",
|
|
4
4
|
"description": "Core DXOS Client API.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"base-x": "~3.0.9",
|
|
21
|
-
"@dxos/async": "0.1.56-main.
|
|
22
|
-
"@dxos/config": "0.1.56-main.
|
|
23
|
-
"@dxos/context": "0.1.56-main.
|
|
24
|
-
"@dxos/document-model": "0.1.56-main.
|
|
25
|
-
"@dxos/echo-db": "0.1.56-main.
|
|
26
|
-
"@dxos/echo-schema": "0.1.56-main.
|
|
27
|
-
"@dxos/invariant": "0.1.56-main.
|
|
28
|
-
"@dxos/keys": "0.1.56-main.
|
|
29
|
-
"@dxos/model-factory": "0.1.56-main.
|
|
30
|
-
"@dxos/node-std": "0.1.56-main.
|
|
31
|
-
"@dxos/protocols": "0.1.56-main.
|
|
32
|
-
"@dxos/rpc": "0.1.56-main.
|
|
33
|
-
"@dxos/text-model": "0.1.56-main.
|
|
21
|
+
"@dxos/async": "0.1.56-main.c277f68",
|
|
22
|
+
"@dxos/config": "0.1.56-main.c277f68",
|
|
23
|
+
"@dxos/context": "0.1.56-main.c277f68",
|
|
24
|
+
"@dxos/document-model": "0.1.56-main.c277f68",
|
|
25
|
+
"@dxos/echo-db": "0.1.56-main.c277f68",
|
|
26
|
+
"@dxos/echo-schema": "0.1.56-main.c277f68",
|
|
27
|
+
"@dxos/invariant": "0.1.56-main.c277f68",
|
|
28
|
+
"@dxos/keys": "0.1.56-main.c277f68",
|
|
29
|
+
"@dxos/model-factory": "0.1.56-main.c277f68",
|
|
30
|
+
"@dxos/node-std": "0.1.56-main.c277f68",
|
|
31
|
+
"@dxos/protocols": "0.1.56-main.c277f68",
|
|
32
|
+
"@dxos/rpc": "0.1.56-main.c277f68",
|
|
33
|
+
"@dxos/text-model": "0.1.56-main.c277f68"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
package/src/config.ts
CHANGED
|
@@ -8,7 +8,8 @@ export const DEFAULT_INTERNAL_CHANNEL = 'dxos:vault';
|
|
|
8
8
|
export const DEFAULT_CLIENT_CHANNEL = 'dxos:app';
|
|
9
9
|
export const DEFAULT_SHELL_CHANNEL = 'dxos:shell';
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const DEFAULT_VAULT_ORIGIN = 'https://halo.dxos.org';
|
|
12
|
+
export const DEFAULT_VAULT_URL = DEFAULT_VAULT_ORIGIN + '/vault.html';
|
|
12
13
|
|
|
13
14
|
export const EXPECTED_CONFIG_VERSION = 1;
|
|
14
15
|
export const defaultConfig: ConfigProto = { version: 1 };
|
package/src/halo.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface Halo {
|
|
|
20
20
|
|
|
21
21
|
createIdentity(options?: ProfileDocument): Promise<Identity>;
|
|
22
22
|
recoverIdentity(recoveryKey: Uint8Array): Promise<Identity>;
|
|
23
|
+
updateProfile(profile: ProfileDocument): Promise<Identity>;
|
|
23
24
|
|
|
24
25
|
createInvitation(): CancellableInvitationObservable;
|
|
25
26
|
acceptInvitation(invitation: Invitation): AuthenticatingInvitationObservable;
|