@classytic/arc 2.23.0 → 2.28.0
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 +2 -0
- package/dist/{BaseController-BQ8KNvWC.mjs → BaseController-B65zbz9m.mjs} +94 -23
- package/dist/QueryCache-DOMT_iq7.d.mts +72 -0
- package/dist/actionPermissions-CAphcmUG.mjs +24 -0
- package/dist/{applyPermissionResult-Tw4iXtlf.mjs → applyPermissionResult-BnyVE9eD.mjs} +10 -0
- package/dist/audit/index.d.mts +32 -3
- package/dist/audit/index.mjs +7 -4
- package/dist/auth/index.d.mts +2 -2
- package/dist/auth/index.mjs +263 -259
- package/dist/{buildHandler-D_2ULWxZ.mjs → buildHandler-Dtwd8fdz.mjs} +1 -1
- package/dist/cache/index.d.mts +41 -3
- package/dist/cache/index.mjs +33 -4
- package/dist/cleanup/index.d.mts +313 -0
- package/dist/cleanup/index.mjs +1267 -0
- package/dist/cli/commands/describe.d.mts +1 -1
- package/dist/cli/commands/docs.mjs +1 -1
- package/dist/cli/commands/generate.mjs +1 -1
- package/dist/cli/commands/init.mjs +1 -1
- package/dist/cli/index.mjs +2 -2
- package/dist/context/index.mjs +2 -64
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.mjs +5 -4
- package/dist/core-BGa8TXJR.mjs +221 -0
- package/dist/{createActionRouter-BuOv-m4Y.mjs → createActionRouter-C-N7z2EL.mjs} +3 -2
- package/dist/{createAggregationRouter-CgJv_BU_.mjs → createAggregationRouter-wzwFa_dW.mjs} +3 -3
- package/dist/{createApp-CjOeWJ9_.mjs → createApp-Du5G54TM.mjs} +187 -96
- package/dist/{core-DQ6rDTyH.mjs → defineResource-2zvVVpxg.mjs} +297 -230
- package/dist/docs/index.d.mts +1 -1
- package/dist/docs/index.mjs +2 -2
- package/dist/{elevation-COpYKt2h.mjs → elevation-CIz1GjGm.mjs} +4 -3
- package/dist/{eventPlugin-A6EbthXR.d.mts → eventPlugin-Bg3cP2_u.d.mts} +38 -3
- package/dist/{eventPlugin-DJG2D7sy.mjs → eventPlugin-DrQ_FesK.mjs} +22 -4
- package/dist/events/index.d.mts +83 -314
- package/dist/events/index.mjs +183 -95
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +24 -2
- package/dist/factory/index.d.mts +5 -5
- package/dist/factory/index.mjs +30 -8
- package/dist/{fastify-augmentation-g_f9omSc.d.mts → fastify-augmentation-OzYGIiU1.d.mts} +26 -2
- package/dist/{generate-usRSdQmP.mjs → generate-D0wZupBg.mjs} +1 -1
- package/dist/headers-BvlQSDMB.mjs +45 -0
- package/dist/health-CB_m4S32.mjs +377 -0
- package/dist/hooks/index.d.mts +1 -1
- package/dist/idempotency/index.mjs +27 -3
- package/dist/{index-wMoWBLkn.d.mts → index-BMnbzvtO.d.mts} +3 -3
- package/dist/{integrations/jobs.d.mts → index-CG4yqMDB.d.mts} +82 -2
- package/dist/index-CZY4EGga.d.mts +107 -0
- package/dist/{index-CC5ruDGh.d.mts → index-CjVg-Epg.d.mts} +37 -5
- package/dist/{index-BBsvQt7U.d.mts → index-DPRH0Cme.d.mts} +36 -106
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +7 -6
- package/dist/{init-CjO4p_q1.mjs → init-tlRSt667.mjs} +206 -208
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +1 -1
- package/dist/integrations/index.d.mts +3 -3
- package/dist/integrations/jobs/index.d.mts +2 -0
- package/dist/integrations/{jobs.mjs → jobs/index.mjs} +110 -67
- package/dist/integrations/mcp/index.d.mts +4 -4
- package/dist/integrations/mcp/index.mjs +2 -2
- package/dist/integrations/mcp/testing.d.mts +1 -1
- package/dist/integrations/mcp/testing.mjs +1 -1
- package/dist/integrations/webhooks.d.mts +37 -30
- package/dist/integrations/webhooks.mjs +51 -62
- package/dist/integrations/websocket-redis.d.mts +1 -1
- package/dist/integrations/websocket.d.mts +1 -1
- package/dist/integrations/websocket.mjs +41 -14
- package/dist/{interface-C1_WLTMK.d.mts → interface-BGZCzOGL.d.mts} +24 -31
- package/dist/{mcpPlugin-BtzIL_kM.mjs → mcpPlugin-Cs6nRGCt.mjs} +12 -10
- package/dist/{memory-CLXA2VeJ.mjs → memory-CmnzXE5Z.mjs} +29 -0
- package/dist/middleware/index.d.mts +17 -1
- package/dist/middleware/index.mjs +1 -1
- package/dist/migrations/index.d.mts +94 -44
- package/dist/migrations/index.mjs +196 -44
- package/dist/module-_-M7C5ES.mjs +29 -0
- package/dist/{multipartBody-CHEQSZ6G.mjs → multipartBody-D0eBvkeq.mjs} +17 -0
- package/dist/{openapi-jSDx-VDv.mjs → openapi-BLV4OMXb.mjs} +3 -3
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +3 -3
- package/dist/{permissions-tbxFHxjZ.mjs → permissions-BrtiBKGs.mjs} +229 -229
- package/dist/pipeline/index.d.mts +1 -1
- package/dist/{actionPermissions-lszoJle1.mjs → pipeline-BGRnV-To.mjs} +4 -27
- package/dist/plugins/index.d.mts +6 -77
- package/dist/plugins/index.mjs +11 -95
- package/dist/plugins/response-cache.mjs +1 -0
- package/dist/plugins/tracing-entry.mjs +1 -1
- package/dist/{index-Ba10fdKp.d.mts → preloadResources-CM4uUaFv.d.mts} +51 -50
- package/dist/preloadResources-DSY5HGpS.mjs +45 -0
- package/dist/presets/filesUpload.d.mts +3 -3
- package/dist/presets/filesUpload.mjs +3 -3
- package/dist/presets/index.d.mts +2 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/presets/multiTenant.d.mts +1 -1
- package/dist/presets/multiTenant.mjs +1 -1
- package/dist/presets/search.d.mts +2 -2
- package/dist/presets/search.mjs +1 -1
- package/dist/{presets-BOe4Ugkl.mjs → presets-DwFDVKP0.mjs} +2 -2
- package/dist/{queryCachePlugin-DzqLN904.mjs → queryCachePlugin-DSGuSVLW.mjs} +39 -8
- package/dist/{queryCachePlugin-CfYWq-Ak.d.mts → queryCachePlugin-br4otiqF.d.mts} +2 -2
- package/dist/{registerRoute-CWO6mdYe.mjs → rateLimit-DrED-C4v.mjs} +2 -109
- package/dist/{realtime-I8OrfnMR.mjs → realtime-DEuDu9io.mjs} +3 -3
- package/dist/{redis-stream-iVR2l7aS.d.mts → redis-stream-uIaauNpZ.d.mts} +22 -0
- package/dist/registerRoute-DTp18Ah_.mjs +108 -0
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.mjs +1 -1
- package/dist/{registry-vcOCtPij.mjs → registry-9km_w1aP.mjs} +15 -0
- package/dist/renewingLease-3cuQH7h8.mjs +44 -0
- package/dist/{requestContext-BZKOr13H.mjs → requestContext-MrlJwECf.mjs} +2 -2
- package/dist/schedules-CjOd2MG9.mjs +113 -0
- package/dist/schemas/index.d.mts +67 -67
- package/dist/schemas/index.mjs +2 -3
- package/dist/scim/index.mjs +1 -2
- package/dist/scope/index.d.mts +2 -2
- package/dist/scope/index.mjs +4 -4
- package/dist/{scope-LONQ3mfZ.mjs → scope-DfaPntpo.mjs} +4 -5
- package/dist/{sse-0u4P4-OI.mjs → sse-BQ1w0dfl.mjs} +1 -1
- package/dist/testing/cleanupStoreContract.d.mts +10 -0
- package/dist/testing/cleanupStoreContract.mjs +375 -0
- package/dist/testing/index.d.mts +5 -3
- package/dist/testing/index.mjs +4 -2
- package/dist/testing/outboxStoreContract.d.mts +13 -0
- package/dist/testing/outboxStoreContract.mjs +247 -0
- package/dist/transactionContext-PNdoyLLm.mjs +64 -0
- package/dist/types/index.d.mts +4 -4
- package/dist/{types-bHblZ9YN.mjs → types-CSyCxl2V.mjs} +38 -7
- package/dist/types-C_ZZRcD6.d.mts +450 -0
- package/dist/{module-B4u10iOJ.d.mts → types-Cu6vVJmh.d.mts} +196 -60
- package/dist/{types-DH0GupI7.d.mts → types-DjC-KUCz.d.mts} +118 -20
- package/dist/{types-Csxga7d3.d.mts → types-Dmw-6Qeo.d.mts} +96 -4
- package/dist/{types-5OuqeTDX.d.mts → types-QFGc3Cjv.d.mts} +1 -1
- package/dist/usage/index.d.mts +3 -52
- package/dist/usage/index.mjs +0 -0
- package/dist/userHelpers-Cg_y3fBz.mjs +29 -0
- package/dist/utils/index.d.mts +58 -85
- package/dist/utils/index.mjs +4 -2
- package/dist/{utils-CZyeRXTh.mjs → utils-taUVD4p3.mjs} +47 -337
- package/dist/{validate-C2mGgSXg.mjs → validate-Bk44F2yT.mjs} +1 -1
- package/dist/{versioning-D6PvCwpq.d.mts → versioning-DXgY5BUm.d.mts} +11 -29
- package/dist/{versioning-Dk-71iIz.mjs → versioning-gKWyryT3.mjs} +8 -1
- package/dist/{websocket-uuWqM6UY.d.mts → websocket-_Pd0CgR0.d.mts} +15 -1
- package/package.json +541 -513
- package/skills/arc/references/api-reference.md +3 -1
- package/skills/arc/references/integrations.md +20 -11
- package/dist/QueryCache-Z1B38koh.d.mts +0 -40
- package/dist/betterAuthOpenApi-CV1lxpRX.mjs +0 -2
- package/dist/health-ScyjIVo5.mjs +0 -202
- package/dist/requestId-5BhTVzBv.mjs +0 -113
- package/dist/types-XTApa8b6.mjs +0 -24
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { $ as OpenApiSchemas,
|
|
1
|
+
import { $ as OpenApiSchemas, S as QueryParserInterface, b as ParsedQuery } from "../index-DPRH0Cme.mjs";
|
|
2
|
+
import { F as getHeader, I as requireSingleHeaderValue, P as ArcHeaders } from "../types-DjC-KUCz.mjs";
|
|
3
|
+
import { a as getUserId, c as AnyRecord, o as getUserRoles, s as normalizeRoles } from "../types-Dmw-6Qeo.mjs";
|
|
2
4
|
import { n as ErrorMapper } from "../errorHandler-C6yv4ZTW.mjs";
|
|
3
5
|
import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorOptions, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-DHcHVAgk.mjs";
|
|
4
6
|
import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
|
|
7
|
+
import { scheduleBackground } from "@classytic/repo-core/cache";
|
|
5
8
|
import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
|
|
6
|
-
//#region src/core/validateResourceConfig.d.ts
|
|
7
|
-
interface ConfigError {
|
|
8
|
-
field: string;
|
|
9
|
-
message: string;
|
|
10
|
-
suggestion?: string;
|
|
11
|
-
}
|
|
12
|
-
interface ValidationResult {
|
|
13
|
-
valid: boolean;
|
|
14
|
-
errors: ConfigError[];
|
|
15
|
-
warnings: ConfigError[];
|
|
16
|
-
}
|
|
17
|
-
interface ValidateOptions {
|
|
18
|
-
/** Skip controller method validation (for testing) */
|
|
19
|
-
skipControllerCheck?: boolean;
|
|
20
|
-
/** Allow unknown preset names */
|
|
21
|
-
allowUnknownPresets?: boolean;
|
|
22
|
-
/** Custom valid permission keys beyond CRUD */
|
|
23
|
-
additionalPermissionKeys?: string[];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Validate a resource configuration
|
|
27
|
-
*/
|
|
28
|
-
declare function validateResourceConfig(config: ResourceConfig, options?: ValidateOptions): ValidationResult;
|
|
29
|
-
/**
|
|
30
|
-
* Format validation errors for display
|
|
31
|
-
*/
|
|
32
|
-
declare function formatValidationErrors(resourceName: string, result: ValidationResult): string;
|
|
33
|
-
/**
|
|
34
|
-
* Validate and throw if invalid
|
|
35
|
-
*/
|
|
36
|
-
declare function assertValidConfig(config: ResourceConfig, options?: ValidateOptions): void;
|
|
37
|
-
//#endregion
|
|
38
9
|
//#region src/utils/circuitBreaker.d.ts
|
|
39
10
|
/**
|
|
40
11
|
* Circuit Breaker Pattern
|
|
@@ -103,6 +74,31 @@ interface CircuitBreakerOptions {
|
|
|
103
74
|
* @default 1
|
|
104
75
|
*/
|
|
105
76
|
successThreshold?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Maximum concurrent probe calls allowed while HALF_OPEN.
|
|
79
|
+
* After `resetTimeout`, only this many callers actually test the
|
|
80
|
+
* downstream — the rest fail fast (or hit the fallback) as if the
|
|
81
|
+
* circuit were still open. Without a cap, every queued caller floods
|
|
82
|
+
* a barely-recovered dependency the instant the circuit half-opens.
|
|
83
|
+
* @default 1
|
|
84
|
+
*/
|
|
85
|
+
halfOpenMaxProbes?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Abort the underlying operation when the breaker times out.
|
|
88
|
+
* When `true`, the wrapped function receives an `AbortSignal` as an
|
|
89
|
+
* EXTRA TRAILING argument, aborted on timeout — pass it to fetch/DB
|
|
90
|
+
* calls so timed-out work stops consuming sockets and pool slots
|
|
91
|
+
* instead of running to completion behind the rejected caller.
|
|
92
|
+
* Opt-in because it changes the wrapped function's call shape.
|
|
93
|
+
* @default false
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* const breaker = new CircuitBreaker(
|
|
97
|
+
* async (url: string, signal?: AbortSignal) => fetch(url, { signal }),
|
|
98
|
+
* { timeout: 5000, propagateAbort: true },
|
|
99
|
+
* );
|
|
100
|
+
*/
|
|
101
|
+
propagateAbort?: boolean;
|
|
106
102
|
/**
|
|
107
103
|
* Fallback function when circuit is open.
|
|
108
104
|
* Receives the same arguments as the wrapped function.
|
|
@@ -142,10 +138,13 @@ declare class CircuitBreaker<T extends AnyAsyncFn> {
|
|
|
142
138
|
private nextAttempt;
|
|
143
139
|
private lastCallAt;
|
|
144
140
|
private openedAt;
|
|
141
|
+
private halfOpenInFlight;
|
|
145
142
|
private readonly failureThreshold;
|
|
146
143
|
private readonly resetTimeout;
|
|
147
144
|
private readonly timeout;
|
|
148
145
|
private readonly successThreshold;
|
|
146
|
+
private readonly halfOpenMaxProbes;
|
|
147
|
+
private readonly propagateAbort;
|
|
149
148
|
private readonly fallback?;
|
|
150
149
|
private readonly onStateChange?;
|
|
151
150
|
private readonly onError?;
|
|
@@ -157,7 +156,10 @@ declare class CircuitBreaker<T extends AnyAsyncFn> {
|
|
|
157
156
|
*/
|
|
158
157
|
call(...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
159
158
|
/**
|
|
160
|
-
* Execute function with timeout
|
|
159
|
+
* Execute function with timeout. With `propagateAbort`, the wrapped fn
|
|
160
|
+
* receives a trailing AbortSignal that fires on timeout — the breaker's
|
|
161
|
+
* timeout otherwise only rejects the CALLER while the underlying work
|
|
162
|
+
* keeps consuming sockets/pool slots to completion.
|
|
161
163
|
*/
|
|
162
164
|
private executeWithTimeout;
|
|
163
165
|
/**
|
|
@@ -301,7 +303,20 @@ interface CompensationStep<TCtx = Record<string, unknown>, TResult = unknown> {
|
|
|
301
303
|
readonly execute: (ctx: TCtx) => Promise<TResult>;
|
|
302
304
|
/** Rollback on failure — receives context and this step's own result */
|
|
303
305
|
readonly compensate?: (ctx: TCtx, stepResult: TResult) => Promise<void>;
|
|
304
|
-
/**
|
|
306
|
+
/**
|
|
307
|
+
* Fire-and-forget — don't await, don't block, skip in rollback.
|
|
308
|
+
*
|
|
309
|
+
* OUTSIDE the transactional result by design: the step is NOT listed in
|
|
310
|
+
* `completedSteps` (it hasn't completed when the result is returned — a
|
|
311
|
+
* step that later fails must never have been reported as completed), its
|
|
312
|
+
* value never appears in `results`, and it is not compensatable. Its
|
|
313
|
+
* rejection is reported through `hooks.onStepFailed` (observability
|
|
314
|
+
* only — the transaction outcome is unaffected).
|
|
315
|
+
*
|
|
316
|
+
* This is best-effort by construction — a crash loses it. Side effects
|
|
317
|
+
* that must survive failure belong in the outbox or a job queue, not in
|
|
318
|
+
* a fire-and-forget step.
|
|
319
|
+
*/
|
|
305
320
|
readonly fireAndForget?: boolean;
|
|
306
321
|
}
|
|
307
322
|
/** Lifecycle hooks for observability — wire to Arc events, metrics, or logging */
|
|
@@ -309,6 +324,13 @@ interface CompensationHooks {
|
|
|
309
324
|
readonly onStepComplete?: (stepName: string, result: unknown) => void;
|
|
310
325
|
readonly onStepFailed?: (stepName: string, error: Error) => void;
|
|
311
326
|
readonly onCompensate?: (stepName: string) => void;
|
|
327
|
+
/**
|
|
328
|
+
* Reports a hook that THREW. Hook failures never alter the transaction
|
|
329
|
+
* (contained by design), but silent containment makes a broken
|
|
330
|
+
* metrics/audit sink invisible — wire this to a logger. Must not throw;
|
|
331
|
+
* if it does, that too is contained.
|
|
332
|
+
*/
|
|
333
|
+
readonly onHookError?: (hookName: string, error: Error) => void;
|
|
312
334
|
}
|
|
313
335
|
/** Error from a compensation action that failed during rollback */
|
|
314
336
|
interface CompensationError {
|
|
@@ -437,34 +459,6 @@ declare const NEUTRAL_DIALECT: FilterDialect;
|
|
|
437
459
|
*/
|
|
438
460
|
declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
|
|
439
461
|
//#endregion
|
|
440
|
-
//#region src/utils/headers.d.ts
|
|
441
|
-
/**
|
|
442
|
-
* Canonical header typing + accessor.
|
|
443
|
-
*
|
|
444
|
-
* Node/Fastify header values are `string | string[] | undefined` — repeated
|
|
445
|
-
* headers arrive as arrays. `IRequestContext.headers` is DECLARED as
|
|
446
|
-
* `Record<string, string | undefined>` for ergonomic host code, but the HTTP
|
|
447
|
-
* adapter passes Fastify's headers object through unchanged, so `string[]`
|
|
448
|
-
* CAN appear at runtime behind the narrower type (the declared type is
|
|
449
|
-
* scheduled to widen to {@link ArcHeaders} in v3). Until then, read headers
|
|
450
|
-
* through {@link getHeader} instead of indexing — it's honest about arrays
|
|
451
|
-
* and deterministic about duplicates.
|
|
452
|
-
*/
|
|
453
|
-
/** What a headers bag actually contains at runtime — HTTP or synthetic MCP. */
|
|
454
|
-
type ArcHeaders = Readonly<Record<string, string | readonly string[] | undefined>>;
|
|
455
|
-
/**
|
|
456
|
-
* Read a single header value. Lowercases the name (Node normalizes incoming
|
|
457
|
-
* header names to lowercase) and returns the FIRST value when the header
|
|
458
|
-
* was repeated.
|
|
459
|
-
*
|
|
460
|
-
* Duplicate policy: first-value is deterministic, but for security-sensitive
|
|
461
|
-
* headers (authorization material, forwarded-for chains, content-length) a
|
|
462
|
-
* duplicate usually signals smuggling or a broken proxy — consumers that
|
|
463
|
-
* care should check `Array.isArray(headers[name])` and REJECT instead of
|
|
464
|
-
* picking a winner.
|
|
465
|
-
*/
|
|
466
|
-
declare function getHeader(headers: ArcHeaders | Record<string, string | undefined> | undefined, name: string): string | undefined;
|
|
467
|
-
//#endregion
|
|
468
462
|
//#region src/utils/queryParser.d.ts
|
|
469
463
|
interface ArcQueryParserOptions {
|
|
470
464
|
/** Maximum allowed limit value (default: 1000) */
|
|
@@ -1110,13 +1104,6 @@ declare function getListQueryParams(): AnyRecord;
|
|
|
1110
1104
|
*/
|
|
1111
1105
|
declare function getDefaultCrudSchemas(): Record<string, Record<string, unknown>>;
|
|
1112
1106
|
//#endregion
|
|
1113
|
-
//#region src/utils/runtime.d.ts
|
|
1114
|
-
/**
|
|
1115
|
-
* Portable "run on next tick" scheduler. `setImmediate` is Node-only — not
|
|
1116
|
-
* available in Bun workers, Deno, Cloudflare Workers, or edge runtimes.
|
|
1117
|
-
*/
|
|
1118
|
-
declare const scheduleBackground: (cb: () => void) => void;
|
|
1119
|
-
//#endregion
|
|
1120
1107
|
//#region src/utils/schemaConverter.d.ts
|
|
1121
1108
|
/**
|
|
1122
1109
|
* Supported JSON Schema output targets for Zod v4's `toJSONSchema()`.
|
|
@@ -1521,18 +1508,4 @@ declare function hasEvents(instance: FastifyInstance): instance is FastifyInstan
|
|
|
1521
1508
|
events: EventsDecorator;
|
|
1522
1509
|
};
|
|
1523
1510
|
//#endregion
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* Extract a user ID from a user object. Accepts `id` or `_id` — returns
|
|
1527
|
-
* `undefined` when neither is present. Used by arc's controllers to
|
|
1528
|
-
* populate `createdBy` / `updatedBy` fields and for cache scoping.
|
|
1529
|
-
*
|
|
1530
|
-
* @example
|
|
1531
|
-
* ```ts
|
|
1532
|
-
* import { getUserId } from '@classytic/arc/utils';
|
|
1533
|
-
* const uid = getUserId(request.user);
|
|
1534
|
-
* ```
|
|
1535
|
-
*/
|
|
1536
|
-
declare function getUserId(user: UserLike | null | undefined): string | undefined;
|
|
1537
|
-
//#endregion
|
|
1538
|
-
export { ArcError, type ArcHeaders, ArcQueryParser, type ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, type CircuitBreakerOptions, CircuitBreakerRegistry, type CircuitBreakerStats, CircuitState, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, type ConfigError, ConflictError, type ErrorOptions, type EventsDecorator, type FilterDialect, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, type PipeUIMessageStreamOptions, RateLimitError, ServiceUnavailableError, type SseStream, type SseStreamOptions, type StateMachine, type TransitionConfig, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, type ValidateOptions, ValidationError, type ValidationResult, aggregateListResponse, assertValidConfig, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, errorDetailSchema, formatValidationErrors, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, validateResourceConfig, withCompensation };
|
|
1511
|
+
export { ArcError, type ArcHeaders, ArcQueryParser, type ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, type CircuitBreakerOptions, CircuitBreakerRegistry, type CircuitBreakerStats, CircuitState, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorOptions, type EventsDecorator, type FilterDialect, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, type PipeUIMessageStreamOptions, RateLimitError, ServiceUnavailableError, type SseStream, type SseStreamOptions, type StateMachine, type TransitionConfig, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, errorDetailSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, requireSingleHeaderValue, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, withCompensation };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-DkO8Nk6-.mjs";
|
|
2
|
+
import { n as requireSingleHeaderValue, t as getHeader } from "../headers-BvlQSDMB.mjs";
|
|
3
|
+
import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-Cg_y3fBz.mjs";
|
|
2
4
|
import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-Cg05HPsn.mjs";
|
|
3
|
-
import { A as
|
|
5
|
+
import { A as createCircuitBreakerRegistry, C as defineCompensation, D as CircuitBreakerRegistry, E as CircuitBreakerError, O as CircuitState, S as defineErrorMapper, T as CircuitBreaker, _ as createQueryParser, a as deleteResponse, b as NEUTRAL_DIALECT, c as getDefaultCrudSchemas, d as listResponse, f as offsetListResponse, g as ArcQueryParser, h as responses, i as bareListResponse, k as createCircuitBreaker, l as getListQueryParams, m as queryParams, n as scheduleBackground, o as errorContractSchema, p as paginationSchema, r as aggregateListResponse, s as errorDetailSchema, t as createStateMachine, u as keysetListResponse, v as handleRaw, w as withCompensation, x as defineGuard, y as MONGO_DIALECT } from "../utils-taUVD4p3.mjs";
|
|
4
6
|
import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-DJvodiHj.mjs";
|
|
5
7
|
import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-BQcW6_Kq.mjs";
|
|
6
8
|
import { t as openSseStream } from "../sseStream-BQ7Qaynp.mjs";
|
|
7
9
|
import { t as hasEvents } from "../typeGuards-C9KXUly6.mjs";
|
|
8
|
-
export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse,
|
|
10
|
+
export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, errorDetailSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, requireSingleHeaderValue, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, withCompensation };
|