@hachej/boring-core 0.1.80 → 0.1.82
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/{PostgresModelBudgetStore-BbqIF5TR.d.ts → PostgresModelBudgetStore-Ulw6ijJG.d.ts} +33 -2
- package/dist/app/front/index.js +2 -2
- package/dist/app/server/index.d.ts +9 -5
- package/dist/app/server/index.js +128 -38
- package/dist/{chunk-3B7LU76T.js → chunk-DGBJFPUK.js} +1 -1
- package/dist/{chunk-QZGYKLXB.js → chunk-H7EYII35.js} +2 -0
- package/dist/{chunk-H5BQOHWR.js → chunk-RVVE5WOB.js} +30 -4
- package/dist/{chunk-VB2N2DG5.js → chunk-YFCR6SAS.js} +316 -33
- package/dist/front/index.d.ts +1 -1
- package/dist/front/index.js +2 -2
- package/dist/{loadConfig-C3iHuZNw.d.ts → loadConfig-CuRGCFmt.d.ts} +3 -2
- package/dist/server/db/index.d.ts +19 -10
- package/dist/server/db/index.js +2 -2
- package/dist/server/index.d.ts +34 -7
- package/dist/server/index.js +3 -3
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/{types-Dm11Zm56.d.ts → types-CHdS89JJ.d.ts} +19 -5
- package/dist/{types-DDnayJjI.d.ts → types-Di-eoc58.d.ts} +8 -1
- package/package.json +5 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { U as UserStore, W as WorkspaceStore } from '../../types-
|
|
2
|
-
export { D as Database, c as createDatabase } from '../../types-
|
|
3
|
-
export { B as BudgetReservationAdmission, a as BudgetReservationAdmissionInput, b as BudgetReservationScope, F as FinishBudgetReservationInput,
|
|
4
|
-
import { U as User, b as Workspace, E as ERROR_CODES, M as MemberRole, W as WorkspaceMember, c as WorkspaceInvite, d as WorkspaceRuntime, e as WorkspaceRuntimeResourceSelector, f as WorkspaceRuntimeResource, g as WorkspaceRuntimeResourceInput } from '../../types-
|
|
1
|
+
import { U as UserStore, W as WorkspaceStore } from '../../types-CHdS89JJ.js';
|
|
2
|
+
export { D as Database, c as createDatabase } from '../../types-CHdS89JJ.js';
|
|
3
|
+
export { B as BudgetReservationAdmission, a as BudgetReservationAdmissionInput, b as BudgetReservationScope, c as BudgetSpendQuery, d as BudgetSpendSnapshot, F as FinishBudgetReservationInput, e as FinishReservationInput, G as GrantOnceInput, I as InsufficientCreditError, M as MeteringBalance, f as ModelBudgetExceededError, P as PostgresBudgetReservationStore, g as PostgresMeteringStore, h as PostgresModelBudgetStore, R as RecordUsageInput, i as RecordUsageResult, j as ReservationFinalStatus, k as ReserveBudgetInput, l as ReserveBudgetResult, m as ReserveInput, n as ReserveResult, o as RunMigrationsOptions, U as UserBudgetExceededError, r as runMigrations } from '../../PostgresModelBudgetStore-Ulw6ijJG.js';
|
|
4
|
+
import { U as User, b as Workspace, E as ERROR_CODES, M as MemberRole, W as WorkspaceMember, c as WorkspaceInvite, d as WorkspaceRuntime, e as WorkspaceRuntimeResourceSelector, f as WorkspaceRuntimeResource, g as WorkspaceRuntimeResourceInput } from '../../types-Di-eoc58.js';
|
|
5
5
|
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
6
6
|
import 'postgres';
|
|
7
|
+
import 'fastify';
|
|
7
8
|
|
|
8
9
|
interface UserSettings {
|
|
9
10
|
displayName: string;
|
|
@@ -60,15 +61,19 @@ declare class LocalWorkspaceStore implements WorkspaceStore {
|
|
|
60
61
|
user: Pick<User, 'id' | 'email' | 'name' | 'image'>;
|
|
61
62
|
}>>;
|
|
62
63
|
upsertMember(workspaceId: string, userId: string, role: MemberRole): Promise<WorkspaceMember>;
|
|
63
|
-
|
|
64
|
+
createMemberIfAbsent(workspaceId: string, userId: string, role: MemberRole): Promise<WorkspaceMember | null>;
|
|
65
|
+
updateMemberRole(workspaceId: string, userId: string, role: MemberRole, opts?: {
|
|
66
|
+
forbidExistingOwnerMutation?: boolean;
|
|
67
|
+
}): Promise<{
|
|
64
68
|
member?: WorkspaceMember;
|
|
65
|
-
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
69
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER | typeof ERROR_CODES.D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN;
|
|
66
70
|
}>;
|
|
67
71
|
removeMember(workspaceId: string, userId: string, opts?: {
|
|
68
72
|
allowLastOwner?: boolean;
|
|
73
|
+
forbidExistingOwnerMutation?: boolean;
|
|
69
74
|
}): Promise<{
|
|
70
75
|
removed: boolean;
|
|
71
|
-
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
76
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER | typeof ERROR_CODES.D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN;
|
|
72
77
|
}>;
|
|
73
78
|
listInvites(workspaceId: string): Promise<WorkspaceInvite[]>;
|
|
74
79
|
createInvite(workspaceId: string, email: string, role: MemberRole, invitedBy: string | null, opts?: {
|
|
@@ -140,15 +145,19 @@ declare class PostgresWorkspaceStore implements WorkspaceStore {
|
|
|
140
145
|
user: Pick<User, 'id' | 'email' | 'name' | 'image'>;
|
|
141
146
|
}>>;
|
|
142
147
|
upsertMember(workspaceId: string, userId: string, role: MemberRole): Promise<WorkspaceMember>;
|
|
143
|
-
|
|
148
|
+
createMemberIfAbsent(workspaceId: string, userId: string, role: MemberRole): Promise<WorkspaceMember | null>;
|
|
149
|
+
updateMemberRole(workspaceId: string, userId: string, role: MemberRole, opts?: {
|
|
150
|
+
forbidExistingOwnerMutation?: boolean;
|
|
151
|
+
}): Promise<{
|
|
144
152
|
member?: WorkspaceMember;
|
|
145
|
-
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
153
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER | typeof ERROR_CODES.D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN;
|
|
146
154
|
}>;
|
|
147
155
|
removeMember(workspaceId: string, userId: string, opts?: {
|
|
148
156
|
allowLastOwner?: boolean;
|
|
157
|
+
forbidExistingOwnerMutation?: boolean;
|
|
149
158
|
}): Promise<{
|
|
150
159
|
removed: boolean;
|
|
151
|
-
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
160
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER | typeof ERROR_CODES.D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN;
|
|
152
161
|
}>;
|
|
153
162
|
createInvite(workspaceId: string, email: string, role: MemberRole, invitedBy: string | null, opts?: {
|
|
154
163
|
ttlDays?: number;
|
package/dist/server/db/index.js
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
UserBudgetExceededError,
|
|
12
12
|
createDatabase,
|
|
13
13
|
runMigrations
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-RVVE5WOB.js";
|
|
15
|
+
import "../../chunk-H7EYII35.js";
|
|
16
16
|
import "../../chunk-MLKGABMK.js";
|
|
17
17
|
export {
|
|
18
18
|
InsufficientCreditError,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { L as LoadConfigOptions } from '../loadConfig-
|
|
2
|
-
export { A as AuthHookOptions, B as BetterAuthInstance, C as CreateAuthOptions, a as authHook, b as buildRuntimeConfigPayload, c as createAuth, l as loadConfig, v as validateConfig, d as validatePasswordStrength } from '../loadConfig-
|
|
1
|
+
import { L as LoadConfigOptions } from '../loadConfig-CuRGCFmt.js';
|
|
2
|
+
export { A as AuthHookOptions, B as BetterAuthInstance, C as CreateAuthOptions, a as authHook, b as buildRuntimeConfigPayload, c as createAuth, l as loadConfig, v as validateConfig, d as validatePasswordStrength } from '../loadConfig-CuRGCFmt.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { C as CoreConfig, M as MemberRole, e as WorkspaceRuntimeResourceSelector, f as WorkspaceRuntimeResource, g as WorkspaceRuntimeResourceInput } from '../types-
|
|
4
|
+
import { C as CoreConfig, M as MemberRole, e as WorkspaceRuntimeResourceSelector, f as WorkspaceRuntimeResource, g as WorkspaceRuntimeResourceInput } from '../types-Di-eoc58.js';
|
|
5
5
|
import * as fastify from 'fastify';
|
|
6
6
|
import { preHandlerHookHandler, FastifyInstance, FastifyPluginAsync, FastifyRequest, FastifyReply } from 'fastify';
|
|
7
7
|
import * as http from 'http';
|
|
8
8
|
import { IncomingMessage } from 'node:http';
|
|
9
|
-
import { W as WorkspaceStore,
|
|
10
|
-
export { A as AuthProvider,
|
|
9
|
+
import { W as WorkspaceStore, b as CreateCoreAppOptions, D as Database, U as UserStore, d as WorkspaceProvisioner } from '../types-CHdS89JJ.js';
|
|
10
|
+
export { A as AuthProvider, e as CapabilitiesContributor, a as CoreRequestScope, C as CoreRequestScopeResolver, P as ProvisionContext, f as ProvisionResult, c as createDatabase } from '../types-CHdS89JJ.js';
|
|
11
11
|
import postgres from 'postgres';
|
|
12
|
-
import {
|
|
13
|
-
export { B as BudgetReservationAdmission, a as BudgetReservationAdmissionInput, b as BudgetReservationScope, F as FinishBudgetReservationInput,
|
|
12
|
+
import { o as RunMigrationsOptions, g as PostgresMeteringStore, C as CreditLedgerEntry } from '../PostgresModelBudgetStore-Ulw6ijJG.js';
|
|
13
|
+
export { B as BudgetReservationAdmission, a as BudgetReservationAdmissionInput, b as BudgetReservationScope, c as BudgetSpendQuery, d as BudgetSpendSnapshot, F as FinishBudgetReservationInput, e as FinishReservationInput, G as GrantOnceInput, I as InsufficientCreditError, M as MeteringBalance, f as ModelBudgetExceededError, P as PostgresBudgetReservationStore, h as PostgresModelBudgetStore, R as RecordUsageInput, i as RecordUsageResult, j as ReservationFinalStatus, k as ReserveBudgetInput, l as ReserveBudgetResult, m as ReserveInput, n as ReserveResult, U as UserBudgetExceededError, r as runMigrations } from '../PostgresModelBudgetStore-Ulw6ijJG.js';
|
|
14
14
|
import { T as TelemetrySink } from '../telemetry-DR18MeI0.js';
|
|
15
15
|
import { AgentMeteringSink } from '@hachej/boring-agent/server';
|
|
16
16
|
import 'better-auth';
|
|
@@ -47,6 +47,7 @@ interface PostSignupHookDeps {
|
|
|
47
47
|
logger?: {
|
|
48
48
|
warn: (obj: Record<string, unknown>, msg: string) => void;
|
|
49
49
|
};
|
|
50
|
+
disableDefaultWorkspaceCreation?: boolean;
|
|
50
51
|
}
|
|
51
52
|
declare function createPostSignupHook(deps: PostSignupHookDeps): (user: PostSignupUser & Record<string, unknown>, rawCtx: unknown) => Promise<void>;
|
|
52
53
|
|
|
@@ -106,16 +107,34 @@ declare const coreConfigSchema: z.ZodObject<{
|
|
|
106
107
|
enabled: boolean;
|
|
107
108
|
upgradeInsecureRequests?: boolean | undefined;
|
|
108
109
|
}>;
|
|
110
|
+
trustedProxy: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
|
|
111
|
+
cidrs: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, string[], string[]>;
|
|
112
|
+
hops: z.ZodNumber;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
cidrs: string[];
|
|
115
|
+
hops: number;
|
|
116
|
+
}, {
|
|
117
|
+
cidrs: string[];
|
|
118
|
+
hops: number;
|
|
119
|
+
}>, z.ZodLiteral<"legacy-unsafe">]>>>;
|
|
109
120
|
}, "strip", z.ZodTypeAny, {
|
|
110
121
|
csp: {
|
|
111
122
|
enabled: boolean;
|
|
112
123
|
upgradeInsecureRequests?: boolean | undefined;
|
|
113
124
|
};
|
|
125
|
+
trustedProxy?: "legacy-unsafe" | {
|
|
126
|
+
cidrs: string[];
|
|
127
|
+
hops: number;
|
|
128
|
+
} | null | undefined;
|
|
114
129
|
}, {
|
|
115
130
|
csp: {
|
|
116
131
|
enabled: boolean;
|
|
117
132
|
upgradeInsecureRequests?: boolean | undefined;
|
|
118
133
|
};
|
|
134
|
+
trustedProxy?: "legacy-unsafe" | {
|
|
135
|
+
cidrs: string[];
|
|
136
|
+
hops: number;
|
|
137
|
+
} | null | undefined;
|
|
119
138
|
}>>;
|
|
120
139
|
encryption: z.ZodObject<{
|
|
121
140
|
workspaceSettingsKey: z.ZodString;
|
|
@@ -265,6 +284,10 @@ declare const coreConfigSchema: z.ZodObject<{
|
|
|
265
284
|
enabled: boolean;
|
|
266
285
|
upgradeInsecureRequests?: boolean | undefined;
|
|
267
286
|
};
|
|
287
|
+
trustedProxy?: "legacy-unsafe" | {
|
|
288
|
+
cidrs: string[];
|
|
289
|
+
hops: number;
|
|
290
|
+
} | null | undefined;
|
|
268
291
|
} | undefined;
|
|
269
292
|
}, {
|
|
270
293
|
auth: {
|
|
@@ -318,6 +341,10 @@ declare const coreConfigSchema: z.ZodObject<{
|
|
|
318
341
|
enabled: boolean;
|
|
319
342
|
upgradeInsecureRequests?: boolean | undefined;
|
|
320
343
|
};
|
|
344
|
+
trustedProxy?: "legacy-unsafe" | {
|
|
345
|
+
cidrs: string[];
|
|
346
|
+
hops: number;
|
|
347
|
+
} | null | undefined;
|
|
321
348
|
} | undefined;
|
|
322
349
|
}>;
|
|
323
350
|
|
package/dist/server/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
validateConfig,
|
|
26
26
|
validatePasswordStrength,
|
|
27
27
|
withUserSettingsWriteLock
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-YFCR6SAS.js";
|
|
29
29
|
import {
|
|
30
30
|
InsufficientCreditError,
|
|
31
31
|
ModelBudgetExceededError,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
UserBudgetExceededError,
|
|
36
36
|
createDatabase,
|
|
37
37
|
runMigrations
|
|
38
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-RVVE5WOB.js";
|
|
39
39
|
import {
|
|
40
40
|
noopTelemetry,
|
|
41
41
|
safeCapture
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
import "../chunk-I4PGL4ZD.js";
|
|
44
44
|
import {
|
|
45
45
|
ERROR_CODES
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-H7EYII35.js";
|
|
47
47
|
import "../chunk-MLKGABMK.js";
|
|
48
48
|
|
|
49
49
|
// src/server/security/safeRedirect.ts
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as User, C as CoreConfig, R as RuntimeConfig } from '../types-
|
|
2
|
-
export { a as CapabilitiesResponse, h as ConfigFetchError, i as ConfigValidationError, j as CoreCapabilities, E as ERROR_CODES, k as ErrorCode, H as HttpError, J as JsonValue, M as MemberRole, l as RateLimitEndpointOverride, m as SessionPayload, S as SessionState, b as Workspace, c as WorkspaceInvite, W as WorkspaceMember, d as WorkspaceRuntime } from '../types-
|
|
1
|
+
import { U as User, C as CoreConfig, R as RuntimeConfig } from '../types-Di-eoc58.js';
|
|
2
|
+
export { a as CapabilitiesResponse, h as ConfigFetchError, i as ConfigValidationError, j as CoreCapabilities, E as ERROR_CODES, k as ErrorCode, H as HttpError, J as JsonValue, M as MemberRole, l as RateLimitEndpointOverride, m as SessionPayload, S as SessionState, T as TrustedProxyPolicy, b as Workspace, c as WorkspaceInvite, W as WorkspaceMember, d as WorkspaceRuntime } from '../types-Di-eoc58.js';
|
|
3
3
|
export { a as TelemetryEvent, T as TelemetrySink, n as noopTelemetry, s as safeCapture } from '../telemetry-DR18MeI0.js';
|
|
4
4
|
|
|
5
5
|
declare function isCoreEmailVerificationEnabled(config: Pick<CoreConfig, 'auth'>): boolean;
|
package/dist/shared/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
2
2
|
import postgres from 'postgres';
|
|
3
|
-
import { C as CoreConfig, b as Workspace, E as ERROR_CODES, M as MemberRole, W as WorkspaceMember, U as User, c as WorkspaceInvite, d as WorkspaceRuntime, e as WorkspaceRuntimeResourceSelector, f as WorkspaceRuntimeResource, g as WorkspaceRuntimeResourceInput, a as CapabilitiesResponse } from './types-
|
|
3
|
+
import { C as CoreConfig, b as Workspace, E as ERROR_CODES, M as MemberRole, W as WorkspaceMember, U as User, c as WorkspaceInvite, d as WorkspaceRuntime, e as WorkspaceRuntimeResourceSelector, f as WorkspaceRuntimeResource, g as WorkspaceRuntimeResourceInput, a as CapabilitiesResponse } from './types-Di-eoc58.js';
|
|
4
|
+
import { FastifyRequest } from 'fastify';
|
|
4
5
|
|
|
5
6
|
type Database = ReturnType<typeof drizzle>;
|
|
6
7
|
declare function createDatabase(config: CoreConfig): {
|
|
@@ -79,15 +80,19 @@ interface WorkspaceStore {
|
|
|
79
80
|
user: Pick<User, 'id' | 'email' | 'name' | 'image'>;
|
|
80
81
|
}>>;
|
|
81
82
|
upsertMember(workspaceId: string, userId: string, role: MemberRole): Promise<WorkspaceMember>;
|
|
82
|
-
|
|
83
|
+
createMemberIfAbsent(workspaceId: string, userId: string, role: MemberRole): Promise<WorkspaceMember | null>;
|
|
84
|
+
updateMemberRole(workspaceId: string, userId: string, role: MemberRole, opts?: {
|
|
85
|
+
forbidExistingOwnerMutation?: boolean;
|
|
86
|
+
}): Promise<{
|
|
83
87
|
member?: WorkspaceMember;
|
|
84
|
-
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
88
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER | typeof ERROR_CODES.D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN;
|
|
85
89
|
}>;
|
|
86
90
|
removeMember(workspaceId: string, userId: string, opts?: {
|
|
87
91
|
allowLastOwner?: boolean;
|
|
92
|
+
forbidExistingOwnerMutation?: boolean;
|
|
88
93
|
}): Promise<{
|
|
89
94
|
removed: boolean;
|
|
90
|
-
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
95
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER | typeof ERROR_CODES.D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN;
|
|
91
96
|
}>;
|
|
92
97
|
listInvites(workspaceId: string): Promise<WorkspaceInvite[]>;
|
|
93
98
|
createInvite(workspaceId: string, email: string, role: MemberRole, invitedBy: string | null, opts?: {
|
|
@@ -135,12 +140,20 @@ interface AuthProvider {
|
|
|
135
140
|
type CapabilitiesContributor = (ctx: {
|
|
136
141
|
config: CoreConfig;
|
|
137
142
|
}) => Partial<CapabilitiesResponse> | Promise<Partial<CapabilitiesResponse>>;
|
|
143
|
+
interface CoreRequestScope {
|
|
144
|
+
readonly bindingId: string;
|
|
145
|
+
readonly workspaceId: string;
|
|
146
|
+
readonly defaultDeploymentId: string;
|
|
147
|
+
readonly activeRevision: string;
|
|
148
|
+
}
|
|
149
|
+
type CoreRequestScopeResolver = (request: FastifyRequest) => CoreRequestScope | undefined | Promise<CoreRequestScope | undefined>;
|
|
138
150
|
interface CreateCoreAppOptions {
|
|
139
151
|
authProvider?: AuthProvider;
|
|
140
152
|
userStore?: UserStore;
|
|
141
153
|
workspaceStore?: WorkspaceStore;
|
|
142
154
|
provisioner?: WorkspaceProvisioner;
|
|
143
155
|
manageShutdown?: boolean;
|
|
156
|
+
requestScopeResolver?: CoreRequestScopeResolver;
|
|
144
157
|
}
|
|
145
158
|
declare module 'fastify' {
|
|
146
159
|
interface FastifyInstance {
|
|
@@ -159,7 +172,8 @@ declare module 'fastify' {
|
|
|
159
172
|
emailVerified: boolean;
|
|
160
173
|
} | null;
|
|
161
174
|
cspNonce?: string;
|
|
175
|
+
requestScope?: CoreRequestScope;
|
|
162
176
|
}
|
|
163
177
|
}
|
|
164
178
|
|
|
165
|
-
export { type AuthProvider as A, type
|
|
179
|
+
export { type AuthProvider as A, type CoreRequestScopeResolver as C, type Database as D, type ProvisionContext as P, type UserStore as U, type WorkspaceStore as W, type CoreRequestScope as a, type CreateCoreAppOptions as b, createDatabase as c, type WorkspaceProvisioner as d, type CapabilitiesContributor as e, type ProvisionResult as f };
|
|
@@ -23,6 +23,8 @@ declare const ERROR_CODES: {
|
|
|
23
23
|
readonly MAIL_DISABLED: "mail_disabled";
|
|
24
24
|
readonly DB_UNAVAILABLE: "db_unavailable";
|
|
25
25
|
readonly INTERNAL_ERROR: "internal_error";
|
|
26
|
+
readonly D1_HOST_SCOPE_VIOLATION: "D1_HOST_SCOPE_VIOLATION";
|
|
27
|
+
readonly D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN: "D1_MANAGED_WORKSPACE_MUTATION_FORBIDDEN";
|
|
26
28
|
readonly PAYMENT_REQUIRED: "payment_required";
|
|
27
29
|
readonly INVALID_PACK: "invalid_pack";
|
|
28
30
|
readonly CHECKOUT_FAILED: "checkout_failed";
|
|
@@ -180,6 +182,10 @@ type RateLimitEndpointOverride = {
|
|
|
180
182
|
max: number;
|
|
181
183
|
window: string;
|
|
182
184
|
};
|
|
185
|
+
interface TrustedProxyPolicy {
|
|
186
|
+
cidrs: readonly string[];
|
|
187
|
+
hops: number;
|
|
188
|
+
}
|
|
183
189
|
interface CoreConfig {
|
|
184
190
|
appId: string;
|
|
185
191
|
appName: string;
|
|
@@ -201,6 +207,7 @@ interface CoreConfig {
|
|
|
201
207
|
enabled: boolean;
|
|
202
208
|
upgradeInsecureRequests?: boolean;
|
|
203
209
|
};
|
|
210
|
+
trustedProxy?: TrustedProxyPolicy | 'legacy-unsafe' | null;
|
|
204
211
|
};
|
|
205
212
|
encryption: {
|
|
206
213
|
workspaceSettingsKey: string;
|
|
@@ -277,4 +284,4 @@ type CapabilitiesResponse = {
|
|
|
277
284
|
[contributorName: string]: JsonValue | CoreCapabilities | undefined;
|
|
278
285
|
};
|
|
279
286
|
|
|
280
|
-
export { type CoreConfig as C, ERROR_CODES as E, HttpError as H, type JsonValue as J, type MemberRole as M, type RuntimeConfig as R, type SessionState as S, type User as U, type WorkspaceMember as W, type CapabilitiesResponse as a, type Workspace as b, type WorkspaceInvite as c, type WorkspaceRuntime as d, type WorkspaceRuntimeResourceSelector as e, type WorkspaceRuntimeResource as f, type WorkspaceRuntimeResourceInput as g, ConfigFetchError as h, ConfigValidationError as i, type CoreCapabilities as j, type ErrorCode as k, type RateLimitEndpointOverride as l, type SessionPayload as m };
|
|
287
|
+
export { type CoreConfig as C, ERROR_CODES as E, HttpError as H, type JsonValue as J, type MemberRole as M, type RuntimeConfig as R, type SessionState as S, type TrustedProxyPolicy as T, type User as U, type WorkspaceMember as W, type CapabilitiesResponse as a, type Workspace as b, type WorkspaceInvite as c, type WorkspaceRuntime as d, type WorkspaceRuntimeResourceSelector as e, type WorkspaceRuntimeResource as f, type WorkspaceRuntimeResourceInput as g, ConfigFetchError as h, ConfigValidationError as i, type CoreCapabilities as j, type ErrorCode as k, type RateLimitEndpointOverride as l, type SessionPayload as m };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.82",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Foundation package for boring-ui-v2 apps: DB, auth, config, HTTP app factory, and frontend app shell.",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@fastify/cors": "^11.0.0",
|
|
57
57
|
"@fastify/helmet": "^13.0.1",
|
|
58
|
+
"@fastify/proxy-addr": "^5.1.0",
|
|
58
59
|
"@fastify/rate-limit": "^11.1.0",
|
|
59
60
|
"@hookform/resolvers": "^5.4.0",
|
|
60
61
|
"@react-email/components": "^1.0.12",
|
|
@@ -79,9 +80,9 @@
|
|
|
79
80
|
"react-router-dom": "^7.18.0",
|
|
80
81
|
"smol-toml": "^1.7.0",
|
|
81
82
|
"zod": "^3.25.76",
|
|
82
|
-
"@hachej/boring-agent": "0.1.
|
|
83
|
-
"@hachej/boring-
|
|
84
|
-
"@hachej/boring-
|
|
83
|
+
"@hachej/boring-agent": "0.1.82",
|
|
84
|
+
"@hachej/boring-ui-kit": "0.1.82",
|
|
85
|
+
"@hachej/boring-workspace": "0.1.82"
|
|
85
86
|
},
|
|
86
87
|
"devDependencies": {
|
|
87
88
|
"@testing-library/jest-dom": "^6.9.1",
|