@vibeorm/schema 2.0.0-alpha.6 → 2.0.0-alpha.8
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 +1 -1
- package/dist/capabilities.d.ts +10 -3
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/errors.d.ts +99 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +697 -14
- package/dist/index.js.map +10 -8
- package/dist/ir.d.ts +54 -0
- package/dist/ir.d.ts.map +1 -1
- package/dist/m2m.d.ts +10 -1
- package/dist/m2m.d.ts.map +1 -1
- package/dist/prisma-literal.d.ts +59 -0
- package/dist/prisma-literal.d.ts.map +1 -0
- package/dist/reserved.d.ts.map +1 -1
- package/dist/validate.d.ts +26 -1
- package/dist/validate.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Most users never install this directly — it ships as a dependency of [`vibeorm
|
|
|
19
19
|
- **Dialect identity**: the `Provider` and `Dialect` types, and the `DialectCapabilities` / `FullTextEngine` shapes. The capability *tables* themselves live in [`@vibeorm/sql`](https://github.com/vibeorm/vibeorm/tree/master/packages/sql); this package only fixes their shape.
|
|
20
20
|
- **Errors**: `VibeError`, the `VibeErrorCode` union, the `VIBE_ERROR_CODES` list, and the constructors `internalError` and `unsupportedCapability`. Every error VibeORM throws is a `VibeError` with a stable `code`, so callers branch on codes and never on message text.
|
|
21
21
|
- **Reserved names**: `RESERVED_CLIENT_NAMES`, `RESERVED_DELEGATE_NAMES`, `isReservedClientName`, `isReservedDelegateName` — the collision guard between user models and the client surface.
|
|
22
|
-
- **The implicit many-to-many rule**: `implicitJoinTable` and `ImplicitJoinTable`. One shared definition of the join table an implicit m2m relation maps to, used by the parser and by migrate.
|
|
22
|
+
- **The implicit many-to-many rule**: `implicitJoinTable` and `ImplicitJoinTable`. One shared definition of the join table an implicit m2m relation maps to, used by the parser and by migrate. Self relations are refused rather than supported (`validateSchemaIR` rule `implicit-self-many-to-many`): one model name on both ends means both relation fields would own column `"A"`. The function still derives a self join table's NAME, because introspection and the migration differ must recognise one that already exists in a database.
|
|
23
23
|
- **The extension framework**: `defineExtension`, `buildExtensionRegistry`, `extensionDeclarations`, `mergeExtensionDeclarations`, `extensionManifestEntry`, `extensionOptionsHash`, `EMPTY_EXTENSION_REGISTRY`, and the `VibeExtension` / `ExtensionRegistry` types.
|
|
24
24
|
|
|
25
25
|
## The error codes
|
package/dist/capabilities.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dialect capability shape.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* @vibeorm/sql
|
|
6
|
-
*
|
|
4
|
+
* Tables live here so structural validation can refuse unsupported features
|
|
5
|
+
* without depending on SQL. @vibeorm/sql re-exports these SAME frozen objects;
|
|
6
|
+
* runtime, migrate, generator and tooling share their identity.
|
|
7
7
|
*/
|
|
8
|
+
import type { Dialect } from "./ir.ts";
|
|
8
9
|
/** Full-text engines the `search` extension can target. */
|
|
9
10
|
export type FullTextEngine = "bm25" | "tsvector" | "fts5" | "fulltext";
|
|
10
11
|
export type DialectCapabilities = {
|
|
12
|
+
/** Native database row policies; PGlite additionally needs a verified restricted role. */
|
|
13
|
+
readonly nativeRowLevelSecurity: boolean;
|
|
11
14
|
/** INSERT/UPDATE/DELETE ... RETURNING. False ⇒ insertId + re-select fallback. */
|
|
12
15
|
readonly returning: boolean;
|
|
13
16
|
/** Native scalar array columns (String[], Int[], ...). */
|
|
@@ -35,4 +38,8 @@ export type DialectCapabilities = {
|
|
|
35
38
|
/** Full-text engines available on this dialect (first = preferred). */
|
|
36
39
|
readonly fullTextEngines: readonly FullTextEngine[];
|
|
37
40
|
};
|
|
41
|
+
export declare const POSTGRES_CAPABILITIES: DialectCapabilities;
|
|
42
|
+
export declare const SQLITE_CAPABILITIES: DialectCapabilities;
|
|
43
|
+
export declare const MYSQL_CAPABILITIES: DialectCapabilities;
|
|
44
|
+
export declare const DIALECT_CAPABILITIES: Readonly<Record<Dialect, DialectCapabilities>>;
|
|
38
45
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIvC,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AAIvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,0FAA0F;IAC1F,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,mCAAmC;IACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,yEAAyE;IACzE,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;IAC3C,iEAAiE;IACjE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,kEAAkE;IAClE,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,iDAAiD;IACjD,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;CACrD,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,mBAelC,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,mBAehC,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,mBAe/B,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAI9E,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export declare const VIBE_ERROR_CODES: readonly [
|
|
|
15
15
|
"VIBE_FK_VIOLATION",
|
|
16
16
|
/** Input failed validation before reaching the database. */
|
|
17
17
|
"VIBE_VALIDATION",
|
|
18
|
+
/**
|
|
19
|
+
* A STORED value violates the schema's invariant on its way out of the
|
|
20
|
+
* database — e.g. a string-backed enum column holding a non-member written
|
|
21
|
+
* by raw SQL or another writer. Distinct from VIBE_VALIDATION (bad input):
|
|
22
|
+
* the row is what is wrong, and VibeORM refuses to return it falsely typed.
|
|
23
|
+
*/
|
|
24
|
+
"VIBE_DATA_INVALID",
|
|
18
25
|
/** Schema IR failed structural validation. */
|
|
19
26
|
"VIBE_SCHEMA_INVALID",
|
|
20
27
|
/** Feature requested on a dialect that does not support it. */
|
|
@@ -27,6 +34,12 @@ export declare const VIBE_ERROR_CODES: readonly [
|
|
|
27
34
|
"VIBE_MIGRATION",
|
|
28
35
|
/** Transaction begin/commit/rollback/serialization failure (driver-mapped). */
|
|
29
36
|
"VIBE_TRANSACTION",
|
|
37
|
+
/** A tenant-scoped handle ($scoped) refused a call it cannot make safe. */
|
|
38
|
+
"VIBE_SCOPED",
|
|
39
|
+
/** Native RLS identity is missing, invalid, expired or conflicting. */
|
|
40
|
+
"VIBE_RLS_CONTEXT",
|
|
41
|
+
/** SQLSTATE 42501: insufficient privilege, including policy WITH CHECK failure. */
|
|
42
|
+
"VIBE_PERMISSION_DENIED",
|
|
30
43
|
/** Driver/connection failure not mapped to a more specific code. */
|
|
31
44
|
"VIBE_ADAPTER",
|
|
32
45
|
/** Invariant broken inside VibeORM itself — always a bug, please report. */
|
|
@@ -57,9 +70,95 @@ export declare function unsupportedCapability(params: {
|
|
|
57
70
|
feature: string;
|
|
58
71
|
hint?: string;
|
|
59
72
|
}): VibeError;
|
|
73
|
+
/**
|
|
74
|
+
* A stored value failed the schema's invariant when a row was materialized —
|
|
75
|
+
* lane 2B throws this from the codec path for a string-backed enum column
|
|
76
|
+
* holding a non-member. Carries model/field/enum and a bounded description of
|
|
77
|
+
* the offending value ONLY; it never accepts, and so never exposes, the rest
|
|
78
|
+
* of the row.
|
|
79
|
+
*/
|
|
80
|
+
export declare function invalidStoredData(params: {
|
|
81
|
+
model: string;
|
|
82
|
+
field: string;
|
|
83
|
+
/** The enum the column is typed with, when the invariant is enum membership. */
|
|
84
|
+
enum?: string;
|
|
85
|
+
/** The offending stored value — strings truncated, non-strings reduced to their type. */
|
|
86
|
+
value: unknown;
|
|
87
|
+
}): VibeError;
|
|
60
88
|
/** Internal invariant violation — always indicates a VibeORM bug. */
|
|
61
89
|
export declare function internalError(params: {
|
|
62
90
|
message: string;
|
|
63
91
|
meta?: Record<string, unknown>;
|
|
64
92
|
}): VibeError;
|
|
93
|
+
/** Stable lifecycle categories; metadata never includes identity values. */
|
|
94
|
+
export declare const RLS_CONTEXT_REASONS: readonly ["missing", "invalid", "expired", "conflicting"];
|
|
95
|
+
export type RlsContextReason = (typeof RLS_CONTEXT_REASONS)[number];
|
|
96
|
+
/** Native RLS binding/lifecycle failure, distinct from database permissions. */
|
|
97
|
+
export declare class RlsContextError extends VibeError {
|
|
98
|
+
readonly reason: RlsContextReason;
|
|
99
|
+
constructor(params: {
|
|
100
|
+
reason: RlsContextReason;
|
|
101
|
+
key?: string;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Why a `$scoped` handle refused a call — a STABLE machine-readable set.
|
|
106
|
+
* Conformance vectors (and the sibling Prisma binding) match on these strings,
|
|
107
|
+
* never on message text.
|
|
108
|
+
*/
|
|
109
|
+
export declare const SCOPED_REFUSAL_REASONS: readonly [
|
|
110
|
+
/** The client's schema declares @@policy — the two scoping layers do not combine. */
|
|
111
|
+
"policy_conflict",
|
|
112
|
+
/** The models map misses one or more schema models (totality is required). */
|
|
113
|
+
"unclassified_model",
|
|
114
|
+
/** The models map names a model the schema does not have. */
|
|
115
|
+
"unknown_model",
|
|
116
|
+
/** A { column } entry names an unknown field. */
|
|
117
|
+
"unknown_column",
|
|
118
|
+
/** A { column } entry names a field that cannot carry a scope (list/enum/non-scalar type). */
|
|
119
|
+
"column_not_scopeable",
|
|
120
|
+
/** A { through } entry names an unknown or to-many relation. */
|
|
121
|
+
"unknown_relation",
|
|
122
|
+
/** A { through } chain cycles or ends on a "none" model instead of a { column } one. */
|
|
123
|
+
"through_chain_invalid",
|
|
124
|
+
/** A models-map entry has an unknown shape or extra properties. */
|
|
125
|
+
"invalid_entry",
|
|
126
|
+
/** The scope value's runtime type does not match a scoped column's declared type. */
|
|
127
|
+
"scope_type_mismatch",
|
|
128
|
+
/** scope: null — calls on scoped models refuse until a scope is bound. */
|
|
129
|
+
"null_scope",
|
|
130
|
+
/** Raw SQL is not available on a scoped handle — use the base client. */
|
|
131
|
+
"raw_forbidden",
|
|
132
|
+
/** $scoped on an already-scoped handle — scope once, from the base client. */
|
|
133
|
+
"rescope_forbidden",
|
|
134
|
+
/** Write data names the tenant column (or through-parent) with a conflicting value. */
|
|
135
|
+
"explicit_scope_mismatch",
|
|
136
|
+
/** A bare foreign-key write would re-tenant a through-scoped row — use the relation verbs. */
|
|
137
|
+
"through_fk_write",
|
|
138
|
+
/** A nested verb on a scoped model that cannot be made safe (or nested: "refuse"). */
|
|
139
|
+
"nested_refused",
|
|
140
|
+
/** orderBy through a relation onto a scoped model would leak cross-tenant ordering. */
|
|
141
|
+
"relation_orderby_on_scoped",
|
|
142
|
+
/** An unfiltered relation _count of a scoped model would count foreign rows. */
|
|
143
|
+
"count_on_scoped_relation"];
|
|
144
|
+
export type ScopedRefusalReason = (typeof SCOPED_REFUSAL_REASONS)[number];
|
|
145
|
+
/**
|
|
146
|
+
* A refusal from a tenant-scoped handle (`$scoped`). Carries the model, the
|
|
147
|
+
* argument path of the offending node (e.g. `"data.legs.set"` or a method like
|
|
148
|
+
* `"call.update"`), and a stable `reason`. Always `code: "VIBE_SCOPED"`.
|
|
149
|
+
*/
|
|
150
|
+
export declare class ScopedQueryError extends VibeError {
|
|
151
|
+
/** Model the refusal is about (the scoped model at the offending node). */
|
|
152
|
+
readonly model: string;
|
|
153
|
+
/** Argument path of the offending node (`"where.calls.every"`, `"data.legs.connect"`). */
|
|
154
|
+
readonly path: string;
|
|
155
|
+
readonly reason: ScopedRefusalReason;
|
|
156
|
+
constructor(params: {
|
|
157
|
+
model: string;
|
|
158
|
+
path: string;
|
|
159
|
+
reason: ScopedRefusalReason;
|
|
160
|
+
message: string;
|
|
161
|
+
meta?: Record<string, unknown>;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
65
164
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,gBAAgB;AAC3B,6EAA6E;AAC7E,gBAAgB;AAChB,mDAAmD;AACnD,uBAAuB;AACvB,wDAAwD;AACxD,mBAAmB;AACnB,4DAA4D;AAC5D,iBAAiB;AACjB,8CAA8C;AAC9C,qBAAqB;AACrB,+DAA+D;AAC/D,6BAA6B;AAC7B,6EAA6E;AAC7E,mBAAmB;AACnB,6DAA6D;AAC7D,aAAa;AAC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AC3E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAErC,YAAY,MAAM,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,mBAAmB,CAAC;QAC5B,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,EAUA;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,18 +2,24 @@
|
|
|
2
2
|
* @vibeorm/schema — canonical Schema IR, validation, dialect/capability types,
|
|
3
3
|
* and the VibeError contract for VibeORM v2.
|
|
4
4
|
*/
|
|
5
|
-
export { DIALECTS, isEnumType, providerToDialect } from "./ir.ts";
|
|
6
|
-
export type { CascadeAction, DatasourceIR, DefaultValueIR, Dialect, EnumIR, ExtensionDeclIR, FieldIR, FieldType, IndexFieldIR, CheckIR, IndexIR, IndexKind, ModelIR, Provider, RelationIR, RelationType, ScalarType, SchemaIR, } from "./ir.ts";
|
|
5
|
+
export { DIALECTS, ENUM_STORAGES, enumStorageOf, isEnumType, providerToDialect } from "./ir.ts";
|
|
6
|
+
export type { CascadeAction, DatasourceIR, DefaultValueIR, Dialect, EnumIR, EnumStorage, ExtensionDeclIR, FieldIR, FieldType, IndexFieldIR, CheckIR, IndexIR, IndexKind, ModelIR, Provider, RelationIR, RelationType, ScalarType, SchemaIR, } from "./ir.ts";
|
|
7
7
|
export type { DialectCapabilities, FullTextEngine } from "./capabilities.ts";
|
|
8
|
-
export { VIBE_ERROR_CODES, VibeError, internalError, unsupportedCapability } from "./errors.ts";
|
|
9
|
-
export type { VibeErrorCode } from "./errors.ts";
|
|
8
|
+
export { SCOPED_REFUSAL_REASONS, ScopedQueryError, VIBE_ERROR_CODES, VibeError, internalError, invalidStoredData, unsupportedCapability, } from "./errors.ts";
|
|
9
|
+
export type { ScopedRefusalReason, VibeErrorCode } from "./errors.ts";
|
|
10
|
+
export { decodePrismaString, encodePrismaString, exactIntegerLiteral } from "./prisma-literal.ts";
|
|
10
11
|
export { RESERVED_CLIENT_NAMES, RESERVED_DELEGATE_NAMES, isReservedClientName, isReservedDelegateName, } from "./reserved.ts";
|
|
11
12
|
export { EMPTY_EXTENSION_REGISTRY, buildExtensionRegistry, defineExtension, extensionDeclarations, extensionManifestEntry, extensionOptionsHash, mergeExtensionDeclarations, } from "./extension.ts";
|
|
12
13
|
export type { ExtensionArtifact, ExtensionArtifactOwner, ExtensionAttributeArgs, ExtensionAttributeValue, ExtensionClientContribution, ExtensionClientPlane, ExtensionDoctorCheck, ExtensionDoctorHook, ExtensionDoctorReport, ExtensionFieldType, ExtensionImportSpec, ExtensionManifestEntry, ExtensionMigratePlane, ExtensionModelAttribute, ExtensionModelTypeNames, ExtensionRegistry, ExtensionRuntimePlane, ExtensionSchemaContext, ExtensionSqlExecutor, ExtensionSqlPlane, ExtensionWhereOperator, SqlFragmentPart, SqlFragmentSpec, VibeExtension, } from "./extension.ts";
|
|
13
14
|
export { buildComputedManifest, validateComputedConfig } from "./computed.ts";
|
|
14
15
|
export type { ComputedConfig, ComputedFieldSpec, ComputedManifestEntry } from "./computed.ts";
|
|
15
|
-
export { assertValidSchemaIR, validateSchemaIR } from "./validate.ts";
|
|
16
|
+
export { RESERVED_ENUM_NAMES, assertValidSchemaIR, validateSchemaIR } from "./validate.ts";
|
|
16
17
|
export type { ValidationIssue } from "./validate.ts";
|
|
17
18
|
export { implicitJoinTable } from "./m2m.ts";
|
|
18
19
|
export type { ImplicitJoinTable } from "./m2m.ts";
|
|
20
|
+
export type { NativeRlsIR, RlsContextFieldIR, RlsContextIR, RlsContextRefIR, RlsContextScalar, RlsPolicyIR } from "./ir.ts";
|
|
21
|
+
export { DIALECT_CAPABILITIES, MYSQL_CAPABILITIES, POSTGRES_CAPABILITIES, SQLITE_CAPABILITIES } from "./capabilities.ts";
|
|
22
|
+
export { RLS_CONTEXT_REASONS, RlsContextError } from "./errors.ts";
|
|
23
|
+
export type { RlsContextReason } from "./errors.ts";
|
|
24
|
+
export { isImplicitManyToManyRelation, validateRlsContextIR } from "./validate.ts";
|
|
19
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAChG,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,OAAO,EACP,MAAM,EACN,WAAW,EACX,eAAe,EACf,OAAO,EACP,SAAS,EACT,YAAY,EACZ,OAAO,EACP,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,GACT,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAI7E,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAItE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAIlG,OAAO,EACL,qBAAq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