@collective-intelligence/external-apps-client-sdk 0.1.36 → 0.1.37

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/README.md CHANGED
@@ -419,24 +419,109 @@ try {
419
419
 
420
420
  `.` and `./effect` export the same classes, so `instanceof` gives the same
421
421
  result for both entries. `./effect` also exports the wire Schemas `CiErrorCode`
422
- and `FederatedAuthErrorCode`.
423
-
424
- The `error` of a failed `CiResult` has no `_tag`, so the `CiError` Schema does
425
- not decode it. Give it to the constructor, which adds the tag. Decode a wire
426
- code with its code Schema:
422
+ and `FederatedAuthErrorCode`, and the envelope Schemas `CiErrorEnvelope`,
423
+ `CiResult(value)` and `CiStreamPage`, whose Types are the `.` types `CiError`,
424
+ `CiResult` and `CiStreamPage`.
425
+
426
+ ### What each operation gives
427
+
428
+ Every capability runs on one Effect Core. The `.` entry is a Vanilla Facade
429
+ over it: each client holds one Effect runtime and keeps its Promise
430
+ signatures. `close()` disposes that runtime: it cancels the calls in flight,
431
+ and a later call rejects. The clients of `createClient`,
432
+ `createDirectTransport`, `createProxyTransport`, `createFederatedAuth`,
433
+ `createServerSessionAuth`, `createFixedWorkflowClient`,
434
+ `createDelegatedApplicationRuntime` (also for its `client` and `auth`),
435
+ `createEntityHttpTransport` and `createResourceClient` have `close()`.
436
+ `followRun` is a function, not a client: it runs on the default Effect
437
+ runtime. A failure gives one of these outcomes:
438
+
439
+ | Failure | `.` operation that returns `CiResult` | `.` operation that rejects | `./effect` |
440
+ | ----------------------------------- | ------------------------------------------------------- | --------------------------------------------------------- | ----------------------------- |
441
+ | CI returns an error | resolves `{ ok: false, error }`; `error` is a `CiError` | rejects with `CiError` (`FederatedAuthError` for sign-in) | fails with the same class |
442
+ | The request does not reach CI | rejects with `CiTransportError` | rejects with `CiTransportError` | fails with `CiTransportError` |
443
+ | The caller aborts its `AbortSignal` | rejects with `signal.reason` | rejects with `signal.reason` | interruption |
444
+ | Bad SDK input | throws `TypeError` | throws `TypeError` | dies with `TypeError` |
445
+
446
+ - The operations that return `CiResult` are the domain methods of
447
+ `createClient`, `client.execute` and the `execute` of
448
+ `createDirectTransport` and `createProxyTransport`.
449
+ - An operation outside the client registry, or a call without an
450
+ `organizationId`, still resolves `CiResult` `invalid_request`;
451
+ `forOrganization("")` throws `TypeError`.
452
+ - `followRun` and `client.runs.follow` reject with the `CiError` of the failed
453
+ read. A run that does not finish before `deadlineMs` rejects with `CiError`
454
+ `unavailable` (`retryable: true`, message "Run did not finish").
455
+ - `createFixedWorkflowClient().invoke` rejects with `CiError`: the code that
456
+ the route names, else the code of its HTTP status.
457
+ - `createFederatedAuth` and `createServerSessionAuth` reject with
458
+ `FederatedAuthError`. A bad option throws `FederatedAuthError`
459
+ `configuration_error` when you create the client.
460
+ - `createDelegatedApplicationRuntime().followRun` without a session rejects
461
+ with `FederatedAuthError` `reauthorization_required`.
462
+ - `createResourceClient` and `createEntityHttpTransport` keep the
463
+ `ResourceResult` envelope: a transport failure or an abort in flight resolves
464
+ `transport_error`, with `outcome` `rejected` for a read and `uncertain` for a
465
+ write.
466
+
467
+ The `error` of a failed `CiResult` is a `CiError` instance, so it has
468
+ `_tag: "CiError"` and its JSON form includes `_tag`. Decode a wire code with
469
+ its code Schema:
427
470
 
428
471
  ```ts
429
472
  import { CiError } from "@collective-intelligence/external-apps-client-sdk"
430
473
  import { CiErrorCode } from "@collective-intelligence/external-apps-client-sdk/effect"
431
474
  import * as Schema from "effect/Schema"
432
475
 
433
- if (!result.ok) {
434
- throw new CiError(result.error)
476
+ if (!result.ok && result.error instanceof CiError) {
477
+ throw result.error
435
478
  }
436
479
 
437
480
  const code = Schema.decodeUnknownSync(CiErrorCode)(value)
438
481
  ```
439
482
 
483
+ ### `./effect` services
484
+
485
+ `./effect` exports one `Context.Service` per client, a layer constructor and
486
+ a layer that reads Effect `Config`:
487
+
488
+ | Service | Layers | Same capability at `.` |
489
+ | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
490
+ | `CiClient` (`execute`, `executeResult`) | `layerCiClientDirect`, `layerCiClientProxy`, `layerCiClientFromExecutor`, `layerCiClientDirectConfig`, `layerCiClientProxyConfig` | `createClient`, `createDirectTransport`, `createProxyTransport` |
491
+ | `Runs` (`follow`) | `layerRuns` (needs `CiClient`) | `followRun`, `client.runs.follow` |
492
+ | `FederatedAuth` | `layerFederatedAuth`, `layerServerSessionAuth`, and their `…Config` forms | `createFederatedAuth`, `createServerSessionAuth` |
493
+ | `FixedWorkflows` (`invoke`) | `layerFixedWorkflows`, `layerFixedWorkflowsConfig` | `createFixedWorkflowClient` |
494
+ | `DelegatedRuntime` | `layerDelegatedRuntime`, `layerDelegatedRuntimeConfig` | `createDelegatedApplicationRuntime` |
495
+ | `Resources` (`bind(definition)`) | `layerResources`, `layerResourcesConfig`, `layerResourcesFromEntityTransport` | `createResourceClient` with `protocol: "entity"`, `createEntityHttpTransport` |
496
+ | `LegacyResources` (`bind(definition)`) | `layerLegacyResources`, `layerLegacyResourcesConfig` | `createResourceClient` over a `ResourceTransport` |
497
+ | `RealtimeClient` | `layerRealtimeClient`, `layerRealtimeClientConfig` | `createRealtimeClient` |
498
+
499
+ `CiClient.execute` puts the `CiError` of CI in the typed error channel;
500
+ `executeResult` keeps the `CiResult` envelope with the correlation id of CI. A
501
+ `Resources` or `LegacyResources` client fails with `CiError`, whose `details`
502
+ hold the resource `resourceCode` and `outcome`, or with `CiTransportError`
503
+ when the answer was not readable or the transport rejected.
504
+ `layerResourcesFromEntityTransport({ transport })` binds an `EntityTransport`
505
+ of the app, and `layerLegacyResources({ transport })` a `ResourceTransport`
506
+ with its lifecycle operations (`softDelete`, `restore`, `hardDelete`). A `…Config` layer takes `Config.Wrap` of the layer options: give
507
+ each field as a `Config`, for example `Config.String("CI_TENANT_URL")`, and a
508
+ function field as `Config.succeed(fn)`.
509
+
510
+ ```ts
511
+ import * as Effect from "effect/Effect"
512
+ import {
513
+ CiClient,
514
+ layerCiClientDirect
515
+ } from "@collective-intelligence/external-apps-client-sdk/effect"
516
+
517
+ const program = CiClient.use((ci) =>
518
+ ci.execute("context_get", {}, { organizationId })
519
+ ).pipe(
520
+ Effect.catchTag("CiError", (error) => Effect.succeed(error.code)),
521
+ Effect.provide(layerCiClientDirect({ auth, tenantUrl }))
522
+ )
523
+ ```
524
+
440
525
  At `.`, the `CiError` type stays the envelope shape that `CiResult` carries,
441
526
  and every `CiError` instance has that shape. `new FederatedAuthError(code,
442
527
  message)` still works beside `new FederatedAuthError({ code, message })`.
package/dist/effect.d.ts CHANGED
@@ -1,10 +1,39 @@
1
- import { c as CiErrorCode, d as FederatedAuthErrorCode, l as CiTransportError, s as CiError, u as FederatedAuthError } from "./federated-auth-lotz7RGT.js";
2
- import { d as RealtimeTopicFilter, l as RealtimeChange, u as RealtimeTopic } from "./event-stream-Djqhj56G.js";
1
+ import { $t as layerFederatedConfig, Qt as layerFederated, Wt as ClientFetch, Xt as FederatedAuth, Zt as FederatedAuthValue, _ as layerLegacyConfig, a as LegacyResources, an as CiErrorCode, c as ResourceEntityClient, cn as FederatedAuthErrorCode, d as ResourcesLayerOptions, en as layerServerSession, f as ResourcesValue, g as layerLegacy, h as layerFromEntityTransport, i as LegacyResourceClient, in as CiError, l as Resources, m as layerConfig$3, o as LegacyResourcesLayerOptions, on as CiTransportError, p as layer$3, s as LegacyResourcesValue, sn as FederatedAuthError, tn as layerServerSessionConfig, u as ResourcesFromEntityTransportOptions } from "./resources-tBGn1Exi.js";
2
+ import { $ as RealtimeTopicFilter, B as layerProxyConfig, D as RunsValue, E as Runs, F as ExecuteResult, I as layerDirect, L as layerDirectConfig, N as CiClient, O as layer$4, P as CiClientValue, Q as RealtimeTopic, R as layerFromExecutor, T as RunFollowOptions, Z as RealtimeChange, f as DelegatedApplicationRuntimeOptions, j as CiStreamPage$1, p as DelegatedRuntimeState, w as DEFAULT_FOLLOW_RUN_DEADLINE_MS, z as layerProxy } from "./index-BqdhzpcZ.js";
3
+ import * as Schema from "effect/Schema";
4
+ import * as Config from "effect/Config";
3
5
  import * as Context from "effect/Context";
4
- import "effect/Effect";
6
+ import * as Effect from "effect/Effect";
5
7
  import "effect/http/HttpClient";
6
8
  import * as Layer from "effect/Layer";
7
9
  import * as Stream from "effect/Stream";
10
+ /** An Expected Error as the `CiResult` envelope carries it: the fields of `CiError`, without `_tag`. */
11
+ declare const CiErrorEnvelope: Schema.Struct<{
12
+ readonly code: Schema.Literals<readonly ["unauthenticated", "forbidden", "not_found", "conflict", "invalid_request", "rate_limited", "unavailable", "internal"]>;
13
+ readonly details: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
14
+ readonly message: Schema.String;
15
+ readonly retryable: Schema.Boolean;
16
+ }>;
17
+ /** The `CiResult` envelope of one CI operation; `value` is the Schema of its success value. */
18
+ declare const CiResult: <Value extends Schema.Top>(value: Value) => Schema.Union<readonly [Schema.Struct<{
19
+ readonly correlationId: Schema.String;
20
+ readonly ok: Schema.Literal<true>;
21
+ readonly value: Value;
22
+ }>, Schema.Struct<{
23
+ readonly correlationId: Schema.String;
24
+ readonly error: Schema.Struct<{
25
+ readonly code: Schema.Literals<readonly ["unauthenticated", "forbidden", "not_found", "conflict", "invalid_request", "rate_limited", "unavailable", "internal"]>;
26
+ readonly details: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
27
+ readonly message: Schema.String;
28
+ readonly retryable: Schema.Boolean;
29
+ }>;
30
+ readonly ok: Schema.Literal<false>;
31
+ }>]>;
32
+ /** One page of the events of a run: the output of `runs_stream`. */
33
+ declare const CiStreamPage: Schema.Struct<{
34
+ readonly events: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>>;
35
+ readonly nextCursor: Schema.mutableKey<Schema.NullOr<Schema.String>>;
36
+ }>;
8
37
  /** Refetch every subscribed topic: the changes of a delivery could not be named. */
9
38
  type RealtimeResync = Readonly<{
10
39
  op: "resync";
@@ -27,7 +56,77 @@ type RealtimeClientLayerOptions = Readonly<{
27
56
  ticketUrl: string;
28
57
  }>;
29
58
  /** `RealtimeClient` with the `fetch` of `FetchHttpClient.Fetch` and the page of this runtime. */
30
- declare const layer: (options: RealtimeClientLayerOptions) => Layer.Layer<RealtimeClient, never, never>;
59
+ declare const layer$2: (options: RealtimeClientLayerOptions) => Layer.Layer<RealtimeClient, never, never>;
60
+ /** `layer` with options that Effect `Config` reads. */
61
+ declare const layerConfig$2: (config: Config.Wrap<RealtimeClientLayerOptions>) => Layer.Layer<RealtimeClient, Config.ConfigError, never>;
31
62
  /** The changes and Resyncs of `topic` from the `RealtimeClient` of the context. */
32
63
  declare const subscribe: (topic: RealtimeTopic) => Stream.Stream<RealtimeUpdate, never, RealtimeClient>;
33
- export { CiError, CiErrorCode, CiTransportError, FederatedAuthError, FederatedAuthErrorCode, type RealtimeChange, RealtimeClient, type RealtimeClientLayerOptions, type RealtimeResync, type RealtimeTopic, type RealtimeTopicFilter, type RealtimeUpdate, layer as layerRealtimeClient, subscribe };
64
+ type FixedWorkflowRequest = Readonly<{
65
+ /** The body of the route; `JSON.stringify` writes it. */
66
+ body: unknown;
67
+ /** The Fixed workflow route, e.g. `/api/leads/lead-1/convert`. */
68
+ url: string;
69
+ }>;
70
+ type FixedWorkflowsValue = Readonly<{
71
+ /** Posts `request` once, with a new idempotency key, and succeeds with the admitted run id. */
72
+ invoke: (request: FixedWorkflowRequest) => Effect.Effect<Readonly<{
73
+ runId: string;
74
+ }>, CiError | CiTransportError>;
75
+ }>;
76
+ declare const FixedWorkflows_base: Context.ServiceClass<FixedWorkflows, "@collective-intelligence/external-apps-client-sdk/FixedWorkflows", Readonly<{
77
+ /** Posts `request` once, with a new idempotency key, and succeeds with the admitted run id. */
78
+ invoke: (request: FixedWorkflowRequest) => Effect.Effect<Readonly<{
79
+ runId: string;
80
+ }>, CiError | CiTransportError>;
81
+ }>>;
82
+ declare class FixedWorkflows extends FixedWorkflows_base {}
83
+ type FixedWorkflowsLayerOptions = Readonly<{
84
+ fetch?: ClientFetch;
85
+ }>;
86
+ /** `FixedWorkflows` over the `fetch` of `options`. */
87
+ declare const layer$1: (options?: FixedWorkflowsLayerOptions) => Layer.Layer<FixedWorkflows, never, never>;
88
+ /** `layer` with options that Effect `Config` reads. */
89
+ declare const layerConfig$1: (config: Config.Wrap<FixedWorkflowsLayerOptions>) => Layer.Layer<FixedWorkflows, Config.ConfigError, never>;
90
+ type FollowError = CiError | CiTransportError | FederatedAuthError;
91
+ type DelegatedRuntimeValue = Readonly<{
92
+ applicationId: string;
93
+ getSnapshot: () => DelegatedRuntimeState;
94
+ /** Calls `notify` at each state change, in the call that changes it. */
95
+ subscribe: (notify: () => void) => () => void;
96
+ /** Each state, from the subscription on. */
97
+ changes: Stream.Stream<DelegatedRuntimeState>;
98
+ /** Reads the session again; a read that fails makes the state `unavailable`. */
99
+ refresh: Effect.Effect<void>;
100
+ /** Refreshes, then starts a login when the session is anonymous or expired. */
101
+ initialize: (url: string) => Effect.Effect<void, FederatedAuthError>;
102
+ login: (returnTo: string) => Effect.Effect<void, FederatedAuthError>;
103
+ logout: Effect.Effect<void>;
104
+ /** Follows a run of the session's organization; without a session, `reauthorization_required`. */
105
+ followRun: (runId: string) => Effect.Effect<CiStreamPage$1, FollowError>;
106
+ }>;
107
+ declare const DelegatedRuntime_base: Context.ServiceClass<DelegatedRuntime, "@collective-intelligence/external-apps-client-sdk/DelegatedRuntime", Readonly<{
108
+ applicationId: string;
109
+ getSnapshot: () => DelegatedRuntimeState;
110
+ /** Calls `notify` at each state change, in the call that changes it. */
111
+ subscribe: (notify: () => void) => () => void;
112
+ /** Each state, from the subscription on. */
113
+ changes: Stream.Stream<DelegatedRuntimeState>;
114
+ /** Reads the session again; a read that fails makes the state `unavailable`. */
115
+ refresh: Effect.Effect<void>;
116
+ /** Refreshes, then starts a login when the session is anonymous or expired. */
117
+ initialize: (url: string) => Effect.Effect<void, FederatedAuthError>;
118
+ login: (returnTo: string) => Effect.Effect<void, FederatedAuthError>;
119
+ logout: Effect.Effect<void>;
120
+ /** Follows a run of the session's organization; without a session, `reauthorization_required`. */
121
+ followRun: (runId: string) => Effect.Effect<CiStreamPage$1, FollowError>;
122
+ }>>;
123
+ declare class DelegatedRuntime extends DelegatedRuntime_base {}
124
+ /**
125
+ * `DelegatedRuntime` for a sealed-cookie BFF, merged with its own
126
+ * `FederatedAuth`, `CiClient` and `Runs`. A bad `authBasePath` fails with
127
+ * `configuration_error`; a bad `origin` or `proxyPath` dies with `TypeError`.
128
+ */
129
+ declare const layer: (options: DelegatedApplicationRuntimeOptions) => Layer.Layer<FederatedAuth | CiClient | Runs | DelegatedRuntime, FederatedAuthError, never>;
130
+ /** `layer` with options that Effect `Config` reads. */
131
+ declare const layerConfig: (config: Config.Wrap<DelegatedApplicationRuntimeOptions>) => Layer.Layer<FederatedAuth | CiClient | Runs | DelegatedRuntime, FederatedAuthError | Config.ConfigError, never>;
132
+ export { CiClient, type CiClientValue, CiError, CiErrorCode, CiErrorEnvelope, CiResult, CiStreamPage, CiTransportError, DEFAULT_FOLLOW_RUN_DEADLINE_MS, DelegatedRuntime, type DelegatedRuntimeValue, type ExecuteResult, FederatedAuth, FederatedAuthError, FederatedAuthErrorCode, type FederatedAuthValue, type FixedWorkflowRequest, FixedWorkflows, type FixedWorkflowsLayerOptions, type FixedWorkflowsValue, type LegacyResourceClient, LegacyResources, type LegacyResourcesLayerOptions, type LegacyResourcesValue, type RealtimeChange, RealtimeClient, type RealtimeClientLayerOptions, type RealtimeResync, type RealtimeTopic, type RealtimeTopicFilter, type RealtimeUpdate, type ResourceEntityClient, Resources, type ResourcesFromEntityTransportOptions, type ResourcesLayerOptions, type ResourcesValue, type RunFollowOptions, Runs, type RunsValue, layerDirect as layerCiClientDirect, layerDirectConfig as layerCiClientDirectConfig, layerFromExecutor as layerCiClientFromExecutor, layerProxy as layerCiClientProxy, layerProxyConfig as layerCiClientProxyConfig, layer as layerDelegatedRuntime, layerConfig as layerDelegatedRuntimeConfig, layerFederated as layerFederatedAuth, layerFederatedConfig as layerFederatedAuthConfig, layer$1 as layerFixedWorkflows, layerConfig$1 as layerFixedWorkflowsConfig, layerLegacy as layerLegacyResources, layerLegacyConfig as layerLegacyResourcesConfig, layer$2 as layerRealtimeClient, layerConfig$2 as layerRealtimeClientConfig, layer$3 as layerResources, layerConfig$3 as layerResourcesConfig, layerFromEntityTransport as layerResourcesFromEntityTransport, layer$4 as layerRuns, layerServerSession as layerServerSessionAuth, layerServerSessionConfig as layerServerSessionAuthConfig, subscribe };
package/dist/effect.js CHANGED
@@ -1,2 +1,32 @@
1
- import { d as CiError, f as CiErrorCode, h as FederatedAuthErrorCode, i as subscribe, m as FederatedAuthError, n as layer, p as CiTransportError, t as RealtimeClient } from "./service-4l3X16iR.js";
2
- export { CiError, CiErrorCode, CiTransportError, FederatedAuthError, FederatedAuthErrorCode, RealtimeClient, layer as layerRealtimeClient, subscribe };
1
+ import { C as CiError, D as FederatedAuthErrorCode, E as FederatedAuthError, T as CiTransportError, a as layerConfig$3, c as layerLegacyConfig, i as layer$3, n as Resources, o as layerFromEntityTransport, s as layerLegacy, t as LegacyResources, w as CiErrorCode } from "./service-C7kswu6e.js";
2
+ import { C as RealtimeClient, D as subscribe, T as layerConfig$2, _ as layerDirect, a as layer$1, b as layerProxy, c as layerFederated, d as layerServerSessionConfig, f as DEFAULT_FOLLOW_RUN_DEADLINE_MS, g as CiClient, h as layer$4, i as FixedWorkflows, l as layerFederatedConfig, n as layer, o as layerConfig$1, p as Runs, r as layerConfig, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layerDirectConfig, w as layer$2, x as layerProxyConfig, y as layerFromExecutor } from "./service-CxUyG8yF.js";
3
+ import * as Schema from "effect/Schema";
4
+ /**
5
+ * The wire Schemas of the CI envelopes that `./effect` exports. The Type of
6
+ * each Schema is the type of `.` that the code uses (`./envelopes`,
7
+ * `./streaming`), with the same `readonly` and optional keys; the type test
8
+ * `type-tests/wire-schemas.ts` holds them equal.
9
+ */
10
+ /** An Expected Error as the `CiResult` envelope carries it: the fields of `CiError`, without `_tag`. */
11
+ const CiErrorEnvelope = Schema.Struct({
12
+ code: CiError.fields.code,
13
+ details: CiError.fields.details,
14
+ message: CiError.fields.message,
15
+ retryable: CiError.fields.retryable
16
+ });
17
+ /** The `CiResult` envelope of one CI operation; `value` is the Schema of its success value. */
18
+ const CiResult = (value) => Schema.Union([Schema.Struct({
19
+ correlationId: Schema.String,
20
+ ok: Schema.Literal(true),
21
+ value
22
+ }), Schema.Struct({
23
+ correlationId: Schema.String,
24
+ error: CiErrorEnvelope,
25
+ ok: Schema.Literal(false)
26
+ })]);
27
+ /** One page of the events of a run: the output of `runs_stream`. */
28
+ const CiStreamPage = Schema.Struct({
29
+ events: Schema.mutableKey(Schema.mutable(Schema.Array(Schema.JsonObject))),
30
+ nextCursor: Schema.mutableKey(Schema.NullOr(Schema.String))
31
+ });
32
+ export { CiClient, CiError, CiErrorCode, CiErrorEnvelope, CiResult, CiStreamPage, CiTransportError, DEFAULT_FOLLOW_RUN_DEADLINE_MS, DelegatedRuntime, FederatedAuth, FederatedAuthError, FederatedAuthErrorCode, FixedWorkflows, LegacyResources, RealtimeClient, Resources, Runs, layerDirect as layerCiClientDirect, layerDirectConfig as layerCiClientDirectConfig, layerFromExecutor as layerCiClientFromExecutor, layerProxy as layerCiClientProxy, layerProxyConfig as layerCiClientProxyConfig, layer as layerDelegatedRuntime, layerConfig as layerDelegatedRuntimeConfig, layerFederated as layerFederatedAuth, layerFederatedConfig as layerFederatedAuthConfig, layer$1 as layerFixedWorkflows, layerConfig$1 as layerFixedWorkflowsConfig, layerLegacy as layerLegacyResources, layerLegacyConfig as layerLegacyResourcesConfig, layer$2 as layerRealtimeClient, layerConfig$2 as layerRealtimeClientConfig, layer$3 as layerResources, layerConfig$3 as layerResourcesConfig, layerFromEntityTransport as layerResourcesFromEntityTransport, layer$4 as layerRuns, layerServerSession as layerServerSessionAuth, layerServerSessionConfig as layerServerSessionAuthConfig, subscribe };