@brickkit/core 0.3.0-beta.2 → 0.3.0-beta.3

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/index.d.ts CHANGED
@@ -1,7 +1,234 @@
1
1
  import { $ as ToolOptions, A as InferTableInsert, At as integer, B as ResourceConfig, Bt as PluginRoutes, C as ArchitectureSchema, Ct as BrickSQLiteDatabase, D as CompiledRoutePlan, Dt as createSQLiteDatabase, E as CacheOptions, Et as blob, F as PreparationContribution, Ft as uniqueIndex, G as ServiceOptions, Gt as ServicePlugin, H as ResourceTypeOptions, Ht as ResourcePluginAPI, I as ProxyOptions, It as PluginEndpointContext, J as TelemetryOptions, Jt as defineServicePlugin, K as ServiceSchema, Kt as ServicePluginContext, L as RateLimitOptions, Lt as PluginRouteMethod, M as LifecycleOptions, Mt as real, N as Logger, Nt as sqliteTable, O as DefaultServiceContext, Ot as foreignKey, P as NarrowAuthorizedContext, Pt as text, Q as ToolConfigWithoutAuthorize, R as ResilienceOptions, Rt as PluginRouteRegistrar, S as ActionSchema, St as secret, T as BaseContext, Tt as SQLiteDatabaseConfig, U as Service, Ut as ResourcePluginContext, V as ResourceIdentity, Vt as ResourcePlugin, W as ServiceAuthOptions, Wt as ResourcePluginTypes, X as ToolAnnotations, Xt as getPluginEndpoints, Y as Tool, Yt as getPluginActionRoute, Z as ToolConfigWithAuthorize, _ as ActionConfigWithAuthorize, _t as listSecrets, a as BrickClientOptions, at as PostgresDefinition, b as ActionErrorDefinition, bt as resetSecrets, c as InferActionErrorCodes, ct as isDatabaseHandle, d as InferActionOutput, dt as PostgresDatabaseConfig, et as ValidationError, f as createBrickClient, ft as createPostgresDatabase, g as ActionConfig, gt as envSource, h as Action, ht as SecretSource, i as BrickClientAction, it as EnvInput, j as InferTableRow, jt as primaryKey, k as ErrorBuilder, kt as index, l as InferActionFailure, lt as DatabaseAdapter, m as isBrickTransportError, mt as SecretRef, n as BrickCallOptions, nt as DatabaseDefinition, o as BrickServerError, ot as SQLiteDefinition, p as isBrickServerError, pt as SecretOptions, q as StandardErrorMap, qt as defineResourcePlugin, r as BrickClient, rt as DatabaseHandle, s as BrickTransportError, st as defineDatabase, t as BrickActionCaller, tt as ValidationErrorItem, u as InferActionInput, ut as PostgresDatabase, v as ActionConfigWithoutAuthorize, vt as overrideSecret, w as BaseActionConfig, wt as BunSQLiteDatabase, x as ActionExecutionError, xt as resolveSecrets, y as ActionContext, yt as overrideSecrets, z as Resource, zt as PluginRouteScope } from "./chunks/client.js";
2
2
  import { Static, TSchema, TSchema as TSchema$1, Type } from "@sinclair/typebox";
3
3
  import { TypeCheck } from "@sinclair/typebox/compiler";
4
+ import { Elysia } from "elysia";
4
5
  import { Table, and, asc, desc, eq, getTableColumns, getTableName, gt, gte, ilike, inArray, is, isNotNull, isNull, like, lt, lte, ne, not, notInArray, or, relations, sql } from "drizzle-orm";
6
+ //#region src/endpoints.d.ts
7
+ type EndpointMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
8
+ /** Logger subset handed to endpoint handlers (mirrors action context loggers). */
9
+ interface EndpointLogger {
10
+ info: (...args: any[]) => void;
11
+ warn: (...args: any[]) => void;
12
+ error: (...args: any[]) => void;
13
+ debug: (...args: any[]) => void;
14
+ }
15
+ /** Context for raw endpoint handlers: Elysia route fields + Brick extras. */
16
+ interface EndpointContext {
17
+ params: Record<string, string>;
18
+ query: Record<string, string | undefined>;
19
+ body: unknown;
20
+ headers: Record<string, string>;
21
+ request: Request;
22
+ /** Elysia response setter (status/headers). Mutate like in `app.get`. */
23
+ set: {
24
+ status?: number;
25
+ headers: Record<string, string>;
26
+ };
27
+ /** Drizzle db from `service` (or first service with one); `undefined` when none. */
28
+ db: any;
29
+ logger: EndpointLogger;
30
+ traceId: string;
31
+ requestId: string;
32
+ }
33
+ interface EndpointDefinition {
34
+ method: EndpointMethod;
35
+ /** Elysia-style path, e.g. `/p/:slug`. */
36
+ path: string;
37
+ handler: (ctx: EndpointContext) => unknown | Promise<unknown>;
38
+ /** Db source: instance or registered service name. Defaults to first service with a db. */
39
+ service?: Service<any, any> | string;
40
+ /** Explicit database handle, independent of a service. */
41
+ database?: DatabaseHandle<unknown>;
42
+ summary?: string;
43
+ description?: string;
44
+ tags?: string[];
45
+ }
46
+ /** Resolve the db for an endpoint: explicit service first, else first service holding one. */
47
+ export declare function resolveEndpointDb(service: Service<any, any> | string | undefined, services: Service<any, any>[]): any;
48
+ /** Wrap a raw handler with trace ids, logger, db, and mesh-consistent error mapping. */
49
+ export declare function createEndpointHandler(def: EndpointDefinition, services: Service<any, any>[]): (elysiaCtx: any) => Promise<unknown>;
50
+ /** `/p/:slug` → `/p/{slug}` for OpenAPI. */
51
+ export declare function toOpenApiPath(elysiaPath: string): string;
52
+ /** OpenAPI `paths` fragment for declared endpoints (raw HTML included). */
53
+ export declare function endpointPaths(defs: EndpointDefinition[]): Record<string, any>;
54
+ /** The app object returned by `brick`: Elysia plus `endpoint()`. */
55
+ type BrickApp = Elysia<any, any, any, any, any, any, any> & {
56
+ /** Service definitions and prefix selected when this app was constructed. */
57
+ readonly definition: {
58
+ readonly services: readonly Service<any, any>[];
59
+ readonly prefix: string;
60
+ };
61
+ /** Register a raw endpoint (outside the JSON action mesh). */
62
+ endpoint(def: EndpointDefinition): void;
63
+ /** All endpoints registered via `endpoint()` (declaration order). */
64
+ listEndpoints(): EndpointDefinition[];
65
+ };
66
+ //#endregion
67
+ //#region src/compiler/ir.d.ts
68
+ type RouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
69
+ interface RouteIR {
70
+ readonly method: RouteMethod;
71
+ readonly path: string;
72
+ readonly service: string;
73
+ readonly action: string;
74
+ readonly kind: "action";
75
+ readonly input: boolean;
76
+ readonly output: boolean;
77
+ readonly context: boolean;
78
+ readonly authorize: boolean;
79
+ readonly inputPrecedence: readonly ("query" | "params" | "body")[];
80
+ readonly coercions: readonly {
81
+ readonly key: string;
82
+ readonly type: "number" | "boolean";
83
+ }[];
84
+ /** JSON projection for inspection and stale-artifact detection, not runtime validation. */
85
+ readonly inputSchema?: unknown;
86
+ readonly outputSchema?: unknown;
87
+ }
88
+ interface BrickIR {
89
+ readonly version: 1;
90
+ readonly target: "bun-elysia";
91
+ readonly prefix: string;
92
+ readonly services: readonly string[];
93
+ readonly routes: readonly RouteIR[];
94
+ readonly preparations: readonly {
95
+ service: string;
96
+ name: string;
97
+ metadata: unknown;
98
+ }[];
99
+ readonly diagnostics: readonly string[];
100
+ }
101
+ //#endregion
102
+ //#region src/compiler/runtime.d.ts
103
+ type CompiledHandler = (context: any) => unknown | Promise<unknown>;
104
+ type HandlerFactory = (binding: CompiledRoutePlan, runtime: typeof compilerRuntime) => CompiledHandler;
105
+ /** Retains Brick's existing source precedence and treatment of empty bodies. */
106
+ declare function mergeInput(first: any, second: any, third: any): any;
107
+ declare function validate(check: NonNullable<CompiledRoutePlan["inputChecker"]>, value: unknown, action: string, stage: "input" | "output"): void;
108
+ declare function mapError(err: any, set: any): {
109
+ name: string;
110
+ code: string;
111
+ message: string;
112
+ status: number;
113
+ details: unknown;
114
+ } | {
115
+ name: string;
116
+ message: string;
117
+ status: number;
118
+ errors: ValidationErrorItem[];
119
+ } | {
120
+ name: string;
121
+ message: any;
122
+ status: number;
123
+ };
124
+ export declare const compilerRuntime: Readonly<{
125
+ emptyServices: Readonly<{}>;
126
+ defaultRequest: Request;
127
+ nextSequence: () => string;
128
+ mergeInput: typeof mergeInput;
129
+ validate: typeof validate;
130
+ mapError: typeof mapError;
131
+ isThenable: (value: any) => boolean;
132
+ deny: (action: string) => never;
133
+ }>;
134
+ //#endregion
135
+ //#region src/compiler.d.ts
136
+ type ApplicationBinder = (services: Service<any, any>[]) => CompiledApplication;
137
+ /** Build artifact bootstrap: bind generated handlers while evaluating the original app. */
138
+ export declare function loadCompiledBrickApp(load: () => Promise<{
139
+ default: unknown;
140
+ }>, ir: BrickIR, bind: ApplicationBinder): Promise<BrickApp>;
141
+ interface CompiledRoute {
142
+ readonly ir: RouteIR;
143
+ readonly handler: CompiledHandler;
144
+ }
145
+ interface CompiledApplication {
146
+ readonly ir: BrickIR;
147
+ readonly routes: readonly CompiledRoute[];
148
+ }
149
+ /** Startup compiler: analyzes once, generates JS once, then binds live callbacks. */
150
+ export declare function compileBrickApplication(options: {
151
+ services: Service<any, any>[];
152
+ prefix?: string;
153
+ mode?: "specialized" | "generic";
154
+ }): CompiledApplication;
155
+ /** Build artifact binder: consumes emitted functions, with no runtime handler code generation. */
156
+ export declare function bindCompiledApplication(ir: BrickIR, services: Service<any, any>[], factories: readonly HandlerFactory[]): CompiledApplication;
157
+ //#endregion
158
+ //#region src/request-logger.d.ts
159
+ interface RequestLoggingOptions {
160
+ enabled?: boolean;
161
+ logger?: (msg: string) => void;
162
+ }
163
+ /**
164
+ * Elysia plugin that logs each request as `METHOD path → status (elapsedms)`.
165
+ * Timing is tracked per-Request via a WeakMap. The onError hook only logs and
166
+ * returns undefined so existing error mapping is preserved. Logging only —
167
+ * no CORS headers are set here.
168
+ *
169
+ * Hooks are registered with the "global" scope so they propagate to the
170
+ * parent app when mounted via `app.use(...)` — Elysia scopes plain instance
171
+ * hooks to the plugin's own routes. Timing is captured in beforeHandle
172
+ * because request hooks are not propagated from a
173
+ * used instance. Unmatched routes (no beforeHandle) fall back to Date.now().
174
+ */
175
+ export declare function requestLoggingPlugin(opts?: RequestLoggingOptions): Elysia;
176
+ //#endregion
177
+ //#region src/docs.d.ts
178
+ interface ReferenceOptions {
179
+ path?: string;
180
+ title?: string;
181
+ specUrl?: string;
182
+ }
183
+ /** Renders the Scalar API reference page for the given OpenAPI URL. */
184
+ export declare function scalarDocsHTML(specUrl: string, title: string): string;
185
+ /** Standalone Elysia plugin serving GET <path> with the Scalar HTML page. */
186
+ export declare function referencePlugin(opts?: ReferenceOptions): Elysia;
187
+ /** Mounts the Scalar reference route onto an existing app. */
188
+ export declare function registerReferenceRoute(app: Elysia, opts?: ReferenceOptions): Elysia;
189
+ /** Renders the Swagger UI page. */
190
+ export declare function swaggerDocsHTML(specUrl: string, title: string): string;
191
+ //#endregion
192
+ //#region src/action-handler.d.ts
193
+ export declare function compileRoutePlan(service: Service, action: Action, routePath: string, method?: string): CompiledRoutePlan;
194
+ export declare function executeCompiledRoute(plan: CompiledRoutePlan, elysiaCtx: any): Promise<any>;
195
+ export declare function createActionHandler(service: Service, action: Action, routePath: string, method?: string): (elysiaCtx: any) => Promise<any>;
196
+ //#endregion
197
+ //#region src/server.d.ts
198
+ interface CreateServerOptions {
199
+ port?: number;
200
+ /** Generate specialized handlers once at startup (default true). */
201
+ compiler?: boolean;
202
+ /** Ahead-of-time handlers already bound to the supplied services. */
203
+ compilation?: CompiledApplication;
204
+ services?: Service<any, any>[];
205
+ prefix?: string;
206
+ title?: string;
207
+ version?: string;
208
+ description?: string;
209
+ docs?: boolean;
210
+ openApiPath?: string;
211
+ docsPath?: string;
212
+ swaggerPath?: string;
213
+ requestLogging?: boolean | RequestLoggingOptions;
214
+ reference?: boolean | ReferenceOptions;
215
+ secrets?: {
216
+ source?: SecretSource;
217
+ validate?: boolean;
218
+ };
219
+ /** Raw endpoints (outside the JSON action mesh), mounted at startup. */
220
+ endpoints?: EndpointDefinition[];
221
+ }
222
+ export declare function brick(options?: CreateServerOptions): BrickApp;
223
+ //#endregion
224
+ //#region src/app-entry.d.ts
225
+ export declare function isBrickApp(app: unknown): app is BrickApp;
226
+ export declare function requireBrickApp(app: unknown): BrickApp;
227
+ //#endregion
228
+ //#region src/compiler/emit.d.ts
229
+ /** Emits framework code only. User callbacks remain closures bound separately. */
230
+ export declare function emitHandlerFactory(route: RouteIR): string;
231
+ //#endregion
5
232
  //#region src/db/index.d.ts
6
233
  export interface DatabaseConfig<TSchema extends Record<string, unknown> = Record<string, unknown>> extends Omit<SQLiteDatabaseConfig<TSchema>, "client">, Omit<PostgresDatabaseConfig<TSchema>, "client"> {
7
234
  client?: SQLiteDatabaseConfig<TSchema>["client"] | PostgresDatabaseConfig<TSchema>["client"];
@@ -201,5 +428,5 @@ interface McpHandlerOptions {
201
428
  /** Stateless MCP JSON-RPC POST handler. Wrap with the app's authentication. */
202
429
  export declare function createMcpHandler(options: McpHandlerOptions): (request: Request, ctx?: Partial<ActionContext>) => Promise<Response>;
203
430
  //#endregion
204
- export { Action, ActionConfig, ActionConfigWithAuthorize, ActionConfigWithoutAuthorize, ActionContext, ActionErrorDefinition, ActionExecutionError, ActionSchema, ArchitectureSchema, BaseActionConfig, BaseContext, type BrickActionCaller, type BrickCallOptions, type BrickClient, type BrickClientAction, type BrickClientOptions, BrickSQLiteDatabase, BrickServerError, BrickTransportError, type BunSQLiteDatabase, CacheOptions, CompiledRoutePlan, DatabaseAdapter, DatabaseDefinition, DatabaseHandle, DefaultServiceContext, EnvInput, ErrorBuilder, type InferActionErrorCodes, type InferActionFailure, type InferActionInput, type InferActionOutput, InferTableInsert, InferTableRow, LifecycleOptions, Logger, type McpHandlerOptions, type McpRegistry, type McpRegistryOptions, type McpToolDefinition, NarrowAuthorizedContext, type OpenApiGeneratorOptions, type PluginEndpointContext, type PluginRouteMethod, type PluginRouteRegistrar, type PluginRouteScope, type PluginRoutes, PostgresDatabase, PostgresDatabaseConfig, PostgresDefinition, PreparationContribution, ProxyOptions, RateLimitOptions, ResilienceOptions, Resource, ResourceConfig, ResourceIdentity, type ResourcePlugin, type ResourcePluginAPI, type ResourcePluginContext, type ResourcePluginTypes, ResourceTypeOptions, SQLiteDatabaseConfig, SQLiteDefinition, type SecretOptions, SecretRef, type SecretSource, Service, ServiceAuthOptions, ServiceOptions, type ServicePlugin, type ServicePluginContext, ServiceSchema, StandardErrorMap, type Static, type TSchema, Table, TelemetryOptions, Tool, ToolAnnotations, ToolConfigWithAuthorize, ToolConfigWithoutAuthorize, ToolOptions, Type, Type as t, ValidationError, ValidationErrorItem, and, asc, blob, createBrickClient, createPostgresDatabase, createSQLiteDatabase, defineDatabase, defineResourcePlugin, defineServicePlugin, desc, envSource, eq, foreignKey, getPluginActionRoute, getPluginEndpoints, getTableColumns, getTableName, gt, gte, ilike, inArray, index, integer, is, isBrickServerError, isBrickTransportError, isDatabaseHandle, isNotNull, isNull, like, listSecrets, lt, lte, ne, not, notInArray, or, overrideSecret, overrideSecrets, primaryKey, real, relations, resetSecrets, resolveSecrets, secret, sql, sqliteTable, text, uniqueIndex };
431
+ export { Action, ActionConfig, ActionConfigWithAuthorize, ActionConfigWithoutAuthorize, ActionContext, ActionErrorDefinition, ActionExecutionError, ActionSchema, ArchitectureSchema, BaseActionConfig, BaseContext, type BrickActionCaller, type BrickApp, type BrickCallOptions, type BrickClient, type BrickClientAction, type BrickClientOptions, type BrickIR, BrickSQLiteDatabase, BrickServerError, BrickTransportError, type BunSQLiteDatabase, CacheOptions, type CompiledApplication, type CompiledHandler, type CompiledRoute, CompiledRoutePlan, type CreateServerOptions, DatabaseAdapter, DatabaseDefinition, DatabaseHandle, DefaultServiceContext, type EndpointContext, type EndpointDefinition, type EndpointLogger, type EndpointMethod, EnvInput, ErrorBuilder, type HandlerFactory, type InferActionErrorCodes, type InferActionFailure, type InferActionInput, type InferActionOutput, InferTableInsert, InferTableRow, LifecycleOptions, Logger, type McpHandlerOptions, type McpRegistry, type McpRegistryOptions, type McpToolDefinition, NarrowAuthorizedContext, type OpenApiGeneratorOptions, type PluginEndpointContext, type PluginRouteMethod, type PluginRouteRegistrar, type PluginRouteScope, type PluginRoutes, PostgresDatabase, PostgresDatabaseConfig, PostgresDefinition, PreparationContribution, ProxyOptions, RateLimitOptions, type ReferenceOptions, type RequestLoggingOptions, ResilienceOptions, Resource, ResourceConfig, ResourceIdentity, type ResourcePlugin, type ResourcePluginAPI, type ResourcePluginContext, type ResourcePluginTypes, ResourceTypeOptions, type RouteIR, type RouteMethod, SQLiteDatabaseConfig, SQLiteDefinition, type SecretOptions, SecretRef, type SecretSource, Service, ServiceAuthOptions, ServiceOptions, type ServicePlugin, type ServicePluginContext, ServiceSchema, StandardErrorMap, type Static, type TSchema, Table, TelemetryOptions, Tool, ToolAnnotations, ToolConfigWithAuthorize, ToolConfigWithoutAuthorize, ToolOptions, Type, Type as t, ValidationError, ValidationErrorItem, and, asc, blob, createBrickClient, createPostgresDatabase, createSQLiteDatabase, defineDatabase, defineResourcePlugin, defineServicePlugin, desc, envSource, eq, foreignKey, getPluginActionRoute, getPluginEndpoints, getTableColumns, getTableName, gt, gte, ilike, inArray, index, integer, is, isBrickServerError, isBrickTransportError, isDatabaseHandle, isNotNull, isNull, like, listSecrets, lt, lte, ne, not, notInArray, or, overrideSecret, overrideSecrets, primaryKey, real, relations, resetSecrets, resolveSecrets, secret, sql, sqliteTable, text, uniqueIndex };
205
432
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["TSchema","TSchema","TSchema"],"sources":["../src/db/index.ts","../src/service.ts","../src/action.ts","../src/resource.ts","../src/rpc.ts","../src/registry.ts","../src/typebox.ts","../src/openapi.ts","../src/tool.ts","../src/mcp.ts"],"mappings":";;;;;iBA6CiB,eACf,gBAAgB,0BAA0B,iCAGxC,KAAK,qBAAqB,qBAC1B,KAAK,uBAAuB;EAC9B,SACI,qBAAqB,qBACrB,uBAAuB;;EAE3B;;EAEA;;YAGU,cACV,gBAAgB,0BAA0B,2BACxC,kBAAkB,WAAW,iBAAiB;;;;;;wBAOlC,eACd,gBAAgB,0BAA0B,yBAE1C,SAAQ,eAAe,WACtB,kBAAkB,WAAW,iBAAiB;;wBAmBjC,eAAe,KAC7B,SAAS,QAAQ,WACjB,UAAU,eAAe,OACxB;;;;;wBASa,uBAAuB;;;;;;;wBAiCvB,uBACd,YACA;EAAQ;EAAqB;;;;;;;;wBAgEf,sBACd,SACA,YACA;EACE;EACA;EACA;;;;;;;wBAoEY,gBACd,SACA,YACA;;;;;;wBA6Dc,mBAAmB;;;;;;wBAuBnB,WACd,iBAAiB,2BAA2B,sBAAsB,SAClE,mBACC;;;qBCrUU,YACX,MAAM,kBAAkB,0BACxB,wBAAwB,sBAAsB,gCACnC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EACA;EACA;EACA,WAAW;EACX,WAAW;;wBAGG,oBACd,UAAS,0BACR;;;wBCNa,WACd,qBAAqBC,mCACrB,sBAAsBA,mCACtB,gBAAgB,eAAe,yBAAyB,eAEtD,wBAEF,iBAAiB,gBAAgB,eAEjC,QAAQ,wBACN,cACA,eACA,SACA,YAED,KAAK,cAAc,eAAe,SAAS;wBAE9B,WACd,qBAAqBA,mCACrB,sBAAsBA,mCACtB,gBAAgB,eAAe,yBAAyB,eAEtD,wBAEF,iBAAiB,gBAAgB,eAEjC,QAAQ,2BACN,cACA,eACA,SACA,YAED,KAAK,cAAc,eAAe,SAAS;wBAW9B,OAAO,iBAAiB,SAAS;;;UCnDhC;EACf;EACA;EACA;EACA;EACA,aAAa;;UAGE;EACf,oBAAoB,KAAK;EACzB,iBAAiB;;UAGF;EACf,aAAa;EACb,SACE,cACA,OAAO,yBACP,MAAM,QAAQ,iBACb;;qBAGQ,yBAAyB;EACxB,YAAA;;;wBAOE,kBAAkB,SAAS,qBAAqB;UAsC/C;EACf,UAAU;EACV;IAAc;IAAc;IAAiB;;;EAE7C;;;wBAcc,iBAAiB,SAAS,qBAKtC,SAAS,SACT,MAAM,QAAQ,mBACb,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":["_$__0.ValidationErrorItem","_$__endpoints0.BrickApp","TSchema","TSchema","TSchema"],"sources":["../src/endpoints.ts","../src/compiler/ir.ts","../src/compiler/runtime.ts","../src/compiler.ts","../src/request-logger.ts","../src/docs.ts","../src/action-handler.ts","../src/server.ts","../src/app-entry.ts","../src/compiler/emit.ts","../src/db/index.ts","../src/service.ts","../src/action.ts","../src/resource.ts","../src/rpc.ts","../src/registry.ts","../src/typebox.ts","../src/openapi.ts","../src/tool.ts","../src/mcp.ts"],"mappings":";;;;;;KAKY;;UAGK;EACf,UAAU;EACV,UAAU;EACV,WAAW;EACX,WAAW;;;UAII;EACf,QAAQ;EACR,OAAO;EACP;EACA,SAAS;EACT,SAAS;;EAET;IAAO;IAAiB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