Skip to content

Commit 6f4cd07

Browse files
refactor(server): classify runtime exports (pingdotgg#10274)
1 parent 11601da commit 6f4cd07

32 files changed

Lines changed: 40 additions & 28 deletions

‎apps/server/scripts/t3-sqlite-state.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export const runSqliteState = Effect.fn("runSqliteState")(function* (
245245
);
246246
});
247247

248-
export const t3SqliteStateCommand = Command.make(
248+
const t3SqliteStateCommand = Command.make(
249249
"t3-sqlite-state",
250250
{
251251
operation: Argument.choice("operation", SqliteStateOperation.literals).pipe(

‎apps/server/src/attachmentStore.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const ATTACHMENT_ID_PATTERN = new RegExp(
2222
);
2323

2424
export const PENDING_ATTACHMENT_THREAD_SEGMENT = "pending";
25-
export const PENDING_ATTACHMENT_MAX_AGE_MS = 24 * 60 * 60 * 1000;
25+
const PENDING_ATTACHMENT_MAX_AGE_MS = 24 * 60 * 60 * 1000;
2626
const PARTIAL_UPLOAD_MAX_AGE_MS = 60 * 60 * 1000;
2727

2828
export function toSafeThreadAttachmentSegment(threadId: string): string | null {

‎apps/server/src/auth/EnvironmentAuth.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import * as SessionStore from "./SessionStore.ts";
3838
import { verifyRequestDpopProof } from "./dpop.ts";
3939
import { layerConfig as SqlitePersistenceLayer } from "../persistence/Layers/Sqlite.ts";
4040

41-
export const DEFAULT_SESSION_SUBJECT = "cli-issued-session";
41+
const DEFAULT_SESSION_SUBJECT = "cli-issued-session";
4242
export const INTERNAL_ADMINISTRATIVE_BOOTSTRAP_SUBJECT = "administrative-bootstrap";
4343

4444
export interface IssuedPairingLink {
@@ -591,6 +591,7 @@ export function selectRequestCredential(
591591
return undefined;
592592
}
593593

594+
/** @public Service construction is part of the canonical Effect module API. */
594595
export const make = Effect.gen(function* () {
595596
const policy = yield* EnvironmentAuthPolicy.EnvironmentAuthPolicy;
596597
const bootstrapCredentials = yield* PairingGrantStore.PairingGrantStore;
@@ -1033,7 +1034,7 @@ export const layer = Layer.effect(EnvironmentAuth, make).pipe(
10331034
Layer.provideMerge(EnvironmentAuthPolicy.layer),
10341035
);
10351036

1036-
export const storageLayer = Layer.mergeAll(ServerSecretStore.layer, SqlitePersistenceLayer);
1037+
const storageLayer = Layer.mergeAll(ServerSecretStore.layer, SqlitePersistenceLayer);
10371038

10381039
export const runtimeLayer = layer.pipe(
10391040
Layer.provideMerge(storageLayer),

‎apps/server/src/auth/EnvironmentAuthPolicy.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class EnvironmentAuthPolicy extends Context.Service<
1414
}
1515
>()("t3/auth/EnvironmentAuthPolicy") {}
1616

17+
/** @public Service construction is part of the canonical Effect module API. */
1718
export const make = Effect.gen(function* () {
1819
const config = yield* ServerConfig.ServerConfig;
1920
const serverEnvironment = yield* ServerEnvironment.ServerEnvironmentIdentity;

‎apps/server/src/auth/PairingGrantStore.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export const BootstrapCredentialInvalidError = Schema.Union([
7272
UnavailableBootstrapCredentialError,
7373
]);
7474
export type BootstrapCredentialInvalidError = typeof BootstrapCredentialInvalidError.Type;
75-
export const isBootstrapCredentialInvalidError = Schema.is(BootstrapCredentialInvalidError);
7675

7776
export class ActivePairingLinksLoadError extends Schema.TaggedError<ActivePairingLinksLoadError>()(
7877
"ActivePairingLinksLoadError",
@@ -173,7 +172,6 @@ export const BootstrapCredentialError = Schema.Union([
173172
BootstrapCredentialInternalError,
174173
]);
175174
export type BootstrapCredentialError = typeof BootstrapCredentialError.Type;
176-
export const isBootstrapCredentialError = Schema.is(BootstrapCredentialError);
177175

178176
export interface IssuedBootstrapCredential {
179177
readonly id: string;

‎apps/server/src/auth/ServerSecretStore.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export class ServerSecretStore extends Context.Service<
149149
}
150150
>()("t3/auth/ServerSecretStore") {}
151151

152+
/** @public Service construction is part of the canonical Effect module API. */
152153
export const make = Effect.gen(function* () {
153154
const crypto = yield* Crypto.Crypto;
154155
const fileSystem = yield* FileSystem.FileSystem;

‎apps/server/src/auth/SessionStore.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,12 @@ export const SessionCredentialInternalError = Schema.Union([
349349
OtherSessionsRevocationError,
350350
]);
351351
export type SessionCredentialInternalError = typeof SessionCredentialInternalError.Type;
352-
export const isSessionCredentialInternalError = Schema.is(SessionCredentialInternalError);
353352

354353
export const SessionCredentialError = Schema.Union([
355354
SessionCredentialInvalidError,
356355
SessionCredentialInternalError,
357356
]);
358357
export type SessionCredentialError = typeof SessionCredentialError.Type;
359-
export const isSessionCredentialError = Schema.is(SessionCredentialError);
360358

361359
export class SessionStore extends Context.Service<
362360
SessionStore,

‎apps/server/src/auth/http.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const appendDpopChallengeOnUnauthorized = (error: EnvironmentAuthInvalidError) =
6565
return yield* error;
6666
});
6767

68-
export const currentEnvironmentTraceId = Effect.currentParentSpan.pipe(
68+
const currentEnvironmentTraceId = Effect.currentParentSpan.pipe(
6969
Effect.map((span) => span.traceId),
7070
Effect.orElseSucceed(() => "unavailable"),
7171
);

‎apps/server/src/background/BackgroundPolicy.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function leaseKey(lease: Pick<ClientActivityLease, "sessionId" | "rpcClientId" |
8282
return JSON.stringify([lease.sessionId, lease.rpcClientId, lease.clientId]);
8383
}
8484

85-
export function upsertClientActivityLease(
85+
function upsertClientActivityLease(
8686
leases: ReadonlyMap<string, ClientActivityLease>,
8787
lease: ClientActivityLease,
8888
now: DateTime.Utc,
@@ -208,6 +208,7 @@ function computeSnapshot(input: {
208208
};
209209
}
210210

211+
/** @public Service construction is part of the canonical Effect module API. */
211212
export const make = Effect.fn("background.policy.make")(function* () {
212213
const hostPowerMonitor = yield* HostPowerMonitor.HostPowerMonitor;
213214
const serverSettings = yield* ServerSettingsService;

‎apps/server/src/background/HostPowerMonitor.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class HostPowerMonitor extends Context.Service<
1919
}
2020
>()("t3/background/HostPowerMonitor") {}
2121

22-
export const makeUnknownSnapshot = (
22+
const makeUnknownSnapshot = (
2323
source: HostPowerSnapshot["source"],
2424
updatedAt: HostPowerSnapshot["updatedAt"],
2525
): HostPowerSnapshot => ({

0 commit comments

Comments
 (0)