@prisma-next/target-mongo 0.7.0 → 0.8.0-dev.10

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.
Files changed (31) hide show
  1. package/dist/control.d.mts +168 -101
  2. package/dist/control.d.mts.map +1 -1
  3. package/dist/control.mjs +1194 -1138
  4. package/dist/control.mjs.map +1 -1
  5. package/dist/{migration-factories-ZBsWqXt-.mjs → migration-factories-BRBKKZia.mjs} +1 -1
  6. package/dist/{migration-factories-ZBsWqXt-.mjs.map → migration-factories-BRBKKZia.mjs.map} +1 -1
  7. package/dist/migration.d.mts +2 -2
  8. package/dist/migration.mjs +1 -1
  9. package/dist/{op-factory-call-9z5D19cP.d.mts → op-factory-call-BC-llGKt.d.mts} +2 -2
  10. package/dist/{op-factory-call-9z5D19cP.d.mts.map → op-factory-call-BC-llGKt.d.mts.map} +1 -1
  11. package/package.json +23 -21
  12. package/src/core/control-target.ts +186 -0
  13. package/src/core/mongo-planner.ts +1 -1
  14. package/src/core/mongo-runner.ts +3 -45
  15. package/src/core/mongo-target-contract-serializer.ts +73 -0
  16. package/src/core/mongo-target-contract.ts +15 -0
  17. package/src/core/mongo-target-database.ts +82 -0
  18. package/src/core/mongo-target-schema-verifier.ts +54 -0
  19. package/src/exports/control.ts +8 -9
  20. package/dist/schema-verify.d.mts +0 -22
  21. package/dist/schema-verify.d.mts.map +0 -1
  22. package/dist/schema-verify.mjs +0 -2
  23. package/dist/verify-mongo-schema-DlPXaotB.mjs +0 -578
  24. package/dist/verify-mongo-schema-DlPXaotB.mjs.map +0 -1
  25. package/src/core/contract-to-schema.ts +0 -63
  26. package/src/core/ddl-formatter.ts +0 -112
  27. package/src/core/marker-ledger.ts +0 -232
  28. package/src/core/schema-diff.ts +0 -402
  29. package/src/core/schema-verify/canonicalize-introspection.ts +0 -389
  30. package/src/core/schema-verify/verify-mongo-schema.ts +0 -60
  31. package/src/exports/schema-verify.ts +0 -2
@@ -1,20 +1,45 @@
1
- import { a as DropCollectionCall, c as schemaCollectionToCreateCollectionOptions, i as CreateIndexCall, l as schemaIndexToCreateIndexOptions, n as CollModMeta, o as DropIndexCall, r as CreateCollectionCall, s as OpFactoryCall, t as CollModCall } from "./op-factory-call-9z5D19cP.mjs";
1
+ import { a as DropCollectionCall, c as schemaCollectionToCreateCollectionOptions, i as CreateIndexCall, l as schemaIndexToCreateIndexOptions, n as CollModMeta, o as DropIndexCall, r as CreateCollectionCall, s as OpFactoryCall, t as CollModCall } from "./op-factory-call-BC-llGKt.mjs";
2
+ import { MarkerOperations, MongoRunnerDependencies } from "@prisma-next/adapter-mongo/control";
3
+ import { MongoControlTargetDescriptor } from "@prisma-next/family-mongo/control";
2
4
  import { MongoSchemaIR } from "@prisma-next/mongo-schema-ir";
3
- import { MongoQueryPlan } from "@prisma-next/mongo-query-ast/execution";
4
- import { AnyMongoMigrationOperation, MongoAndExpr, MongoDdlCommandVisitor, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, MongoFilterExpr, MongoFilterVisitor, MongoInspectionCommandVisitor, MongoMigrationPlanOperation, MongoNotExpr, MongoOrExpr } from "@prisma-next/mongo-query-ast/control";
5
+ import { AnyMongoMigrationOperation, MongoAndExpr, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, MongoFilterExpr, MongoFilterVisitor, MongoMigrationPlanOperation, MongoNotExpr, MongoOrExpr } from "@prisma-next/mongo-query-ast/control";
5
6
  import { Migration, MigrationMeta } from "@prisma-next/migration-tools/migration";
6
- import { MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlanWithAuthoringSurface, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerResult, MigrationRunnerExecutionChecks, MigrationRunnerResult, MigrationScaffoldContext, OperationContext } from "@prisma-next/framework-components/control";
7
- import { MongoContract } from "@prisma-next/mongo-contract";
8
- import { Contract, ContractMarkerRecord } from "@prisma-next/contract/types";
9
- import { Db } from "mongodb";
7
+ import { MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlanWithAuthoringSurface, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerResult, MigrationRunnerExecutionChecks, MigrationRunnerResult, MigrationScaffoldContext, OperationContext, SchemaIssue, SchemaVerifyOptions } from "@prisma-next/framework-components/control";
8
+ import { MongoQueryPlan } from "@prisma-next/mongo-query-ast/execution";
9
+ import { MongoContractSerializerBase, MongoSchemaVerifierBase } from "@prisma-next/family-mongo/ir";
10
+ import { Namespace, NamespaceBase } from "@prisma-next/framework-components/ir";
11
+ import { MongoContract, MongoStorage } from "@prisma-next/mongo-contract";
12
+ import { Contract } from "@prisma-next/contract/types";
10
13
  import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
11
- import { MongoAdapter, MongoDriver } from "@prisma-next/mongo-lowering";
14
+ import { JsonObject } from "@prisma-next/utils/json";
12
15
 
13
- //#region src/core/contract-to-schema.d.ts
14
- declare function contractToMongoSchemaIR(contract: MongoContract | null): MongoSchemaIR;
16
+ //#region src/core/mongo-target-contract.d.ts
17
+ /**
18
+ * Mongo target contract envelope: the result of
19
+ * `descriptor.contractSerializer.deserializeContract(json)`.
20
+ *
21
+ * Structurally `MongoContract` with the storage envelope promoted to
22
+ * the family-layer `MongoStorage` class instance — the class carries
23
+ * `namespaces` and gives the rest of the framework a stable surface to
24
+ * reach for. The leaf collection / index shapes inside
25
+ * `storage.collections` are family-layer `MongoCollection` instances.
26
+ */
27
+ type MongoTargetContract = Omit<MongoContract, 'storage'> & {
28
+ readonly storage: MongoStorage;
29
+ };
15
30
  //#endregion
16
- //#region src/core/ddl-formatter.d.ts
17
- declare function formatMongoOperations(operations: readonly MigrationPlanOperation[]): string[];
31
+ //#region src/core/control-target.d.ts
32
+ /**
33
+ * `migration.ts` default-exports a `Migration` subclass whose `operations`
34
+ * getter returns the ordered list of operations and whose `describe()`
35
+ * returns the manifest identity metadata. `MongoMigrationPlanner.plan()`
36
+ * returns a `MigrationPlanWithAuthoringSurface` that knows how to render
37
+ * itself back to such a file; `MongoMigrationPlanner.emptyMigration()`
38
+ * returns the same shape for `migration new`. Users run the scaffolded
39
+ * `migration.ts` directly (via `node migration.ts`) to self-emit
40
+ * `ops.json` and attest the `migrationHash`.
41
+ */
42
+ declare const mongoTargetDescriptor: MongoControlTargetDescriptor<MongoTargetContract>;
18
43
  //#endregion
19
44
  //#region src/core/filter-evaluator.d.ts
20
45
  declare class FilterEvaluator implements MongoFilterVisitor<boolean> {
@@ -28,62 +53,6 @@ declare class FilterEvaluator implements MongoFilterVisitor<boolean> {
28
53
  expr(_expr: MongoExprFilter): boolean;
29
54
  }
30
55
  //#endregion
31
- //#region src/core/marker-ledger.d.ts
32
- /**
33
- * Reads the marker document for the given contract space, or returns
34
- * `null` if no marker has been written for that space yet. Each space
35
- * owns one row keyed by `_id: <space>` — see ADR 212 for the per-space
36
- * mechanism this enables.
37
- */
38
- declare function readMarker(db: Db, space: string): Promise<ContractMarkerRecord | null>;
39
- /**
40
- * Reads every marker doc in the collection (one per contract space)
41
- * and returns them keyed by `space`. Used by the per-space verifier
42
- * to detect marker-vs-on-disk drift and orphan marker rows. Returns
43
- * an empty map when no marker docs have been written yet.
44
- *
45
- * Marker docs are keyed by `_id: <space>` (string); ledger entries
46
- * live in the same collection but use a driver-generated `ObjectId`
47
- * `_id` plus `type: 'ledger'`. The filter selects string-keyed docs
48
- * with a `space` field, which excludes ledger entries by construction.
49
- */
50
- declare function readAllMarkers(db: Db): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
51
- declare function initMarker(db: Db, space: string, destination: {
52
- readonly storageHash: string;
53
- readonly profileHash: string;
54
- readonly invariants?: readonly string[];
55
- }): Promise<void>;
56
- /**
57
- * Updates the marker doc for the given space atomically (CAS on
58
- * `expectedFrom`).
59
- *
60
- * `destination.invariants`:
61
- * - `undefined` → existing field left untouched.
62
- * - explicit value → merged into the existing field server-side via an
63
- * aggregation pipeline (`$setUnion + $sortArray`), atomic at the
64
- * document level. `[]` is a no-op merge.
65
- */
66
- declare function updateMarker(db: Db, space: string, expectedFrom: string, destination: {
67
- readonly storageHash: string;
68
- readonly profileHash: string;
69
- readonly invariants?: readonly string[];
70
- }): Promise<boolean>;
71
- /**
72
- * Appends a ledger entry for the given space. Ledger entries co-exist
73
- * with marker docs in the same collection; marker docs use `_id: <space>`
74
- * (string), ledger entries use `type: 'ledger'` plus a driver-generated
75
- * ObjectId. Reads partition the two by filter shape.
76
- *
77
- * The same `edgeId` may legitimately recur across different spaces (e.g.
78
- * a synthetic ∅→head edge on first apply), so the ledger key is
79
- * `(space, edgeId)` — the doc carries `space` for partitioned reads.
80
- */
81
- declare function writeLedgerEntry(db: Db, space: string, entry: {
82
- readonly edgeId: string;
83
- readonly from: string;
84
- readonly to: string;
85
- }): Promise<void>;
86
- //#endregion
87
56
  //#region src/core/mongo-ops-serializer.d.ts
88
57
  declare function deserializeMongoOp(json: unknown): AnyMongoMigrationOperation;
89
58
  declare function deserializeMongoOps(json: readonly unknown[]): AnyMongoMigrationOperation[];
@@ -129,38 +98,6 @@ declare class MongoMigrationPlanner implements MigrationPlanner<'mongo', 'mongo'
129
98
  }
130
99
  //#endregion
131
100
  //#region src/core/mongo-runner.d.ts
132
- /**
133
- * Marker / ledger operations the Mongo runner depends on. Every method
134
- * takes a `space` parameter so each loaded contract space addresses its
135
- * own marker row independently — see ADR 212 for the per-space
136
- * mechanism.
137
- */
138
- interface MarkerOperations {
139
- readMarker(space: string): Promise<ContractMarkerRecord | null>;
140
- initMarker(space: string, destination: {
141
- readonly storageHash: string;
142
- readonly profileHash: string;
143
- readonly invariants?: readonly string[];
144
- }): Promise<void>;
145
- updateMarker(space: string, expectedFrom: string, destination: {
146
- readonly storageHash: string;
147
- readonly profileHash: string;
148
- readonly invariants?: readonly string[];
149
- }): Promise<boolean>;
150
- writeLedgerEntry(space: string, entry: {
151
- readonly edgeId: string;
152
- readonly from: string;
153
- readonly to: string;
154
- }): Promise<void>;
155
- }
156
- interface MongoRunnerDependencies {
157
- readonly commandExecutor: MongoDdlCommandVisitor<Promise<void>>;
158
- readonly inspectionExecutor: MongoInspectionCommandVisitor<Promise<Record<string, unknown>[]>>;
159
- readonly adapter: MongoAdapter;
160
- readonly driver: MongoDriver;
161
- readonly markerOps: MarkerOperations;
162
- readonly introspectSchema: () => Promise<MongoSchemaIR>;
163
- }
164
101
  interface MongoMigrationRunnerExecuteOptions {
165
102
  readonly plan: MigrationPlan;
166
103
  readonly destinationContract: MongoContract;
@@ -198,6 +135,136 @@ declare class MongoMigrationRunner {
198
135
  private ensureMarkerCompatibility;
199
136
  }
200
137
  //#endregion
138
+ //#region src/core/mongo-target-contract-serializer.d.ts
139
+ /**
140
+ * Mongo target `ContractSerializer` concretion. Plugs into the
141
+ * family-shared deserialization pipeline at `constructTargetContract`,
142
+ * wrapping the validated flat-data shape in a `MongoStorage` class
143
+ * instance and providing the target's default namespace map.
144
+ *
145
+ * Default namespaces is
146
+ * `{ [UNSPECIFIED_NAMESPACE_ID]: MongoTargetUnspecifiedDatabase.instance }`
147
+ * — supplied at this target-layer call site because the family-layer
148
+ * `MongoStorage` class is target-agnostic (it cannot import the
149
+ * Mongo-target's namespace concretion). Contracts authored before
150
+ * multi-namespace support bind to the unspecified singleton without the
151
+ * call site declaring anything.
152
+ *
153
+ * `validated.storage.collections` already carries `MongoCollection` IR
154
+ * class instances by the time this method runs — the family-base
155
+ * `hydrateMongoContract` walks the arktype-validated tree and
156
+ * constructs class instances before validation. The target serializer
157
+ * just wraps the envelope.
158
+ */
159
+ declare class MongoTargetContractSerializer extends MongoContractSerializerBase<MongoTargetContract> {
160
+ protected constructTargetContract(validated: MongoContract): MongoTargetContract;
161
+ /**
162
+ * Produce the canonical on-disk JSON shape from an in-memory Mongo
163
+ * contract. Strips runtime-only fields the storage class carries
164
+ * for its live-instance API but that don't belong in the persisted
165
+ * envelope: `MongoStorage.namespaces` is a Namespace-class map the
166
+ * verifier and runtime walk; the persisted shape omits it (today's
167
+ * contracts have a single implicit unspecified namespace; future
168
+ * explicit per-collection assignment will surface in JSON via a
169
+ * different field).
170
+ *
171
+ * Constructing the JsonObject here — rather than relying on
172
+ * non-enumerable property tricks at the storage class — keeps the
173
+ * "what's on disk" decision in the SPI implementer, where it
174
+ * belongs.
175
+ */
176
+ serializeContract(contract: MongoTargetContract): JsonObject;
177
+ }
178
+ //#endregion
179
+ //#region src/core/mongo-target-database.d.ts
180
+ /**
181
+ * Mongo target `Namespace` concretion. In Mongo the "namespace" concept
182
+ * binds to the connection's `db` field — a `MongoTargetDatabase` instance
183
+ * names the database the collections live under.
184
+ *
185
+ * Qualifier emission is the rendering seam: query / DDL emission asks the
186
+ * namespace for its qualifier (e.g. `"<db>.<collection>"`) and consumes
187
+ * the result polymorphically. The unspecified singleton overrides these
188
+ * methods to elide the prefix entirely — call sites stay polymorphic and
189
+ * never branch on `id === UNSPECIFIED_NAMESPACE_ID`.
190
+ *
191
+ * **Freeze-trap warning.** The constructor calls `freezeNode(this)` at
192
+ * the end. Direct subclasses MUST NOT add instance fields — the freeze
193
+ * runs in this base constructor and any subclass field assignment will
194
+ * silently fail in non-strict mode or throw in strict mode. The
195
+ * `MongoTargetUnspecifiedDatabase` singleton below is intentionally
196
+ * field-free for this reason; if a future subclass needs to carry
197
+ * additional fields, lift this `freezeNode` to the leaf-class
198
+ * constructors (or to a `seal()` hook each leaf calls explicitly).
199
+ */
200
+ declare class MongoTargetDatabase extends NamespaceBase {
201
+ readonly kind: "database";
202
+ readonly id: string;
203
+ constructor(id: string);
204
+ /**
205
+ * The bare qualifier as it would appear in a rendered string. The
206
+ * unspecified-database singleton overrides this to return `''`.
207
+ */
208
+ qualifier(): string;
209
+ /**
210
+ * Qualify a collection name with the database prefix. The
211
+ * unspecified-database singleton overrides this to emit just the
212
+ * collection name. Used by emission/introspection paths that need a
213
+ * fully-qualified reference.
214
+ */
215
+ qualifyCollection(collectionName: string): string;
216
+ }
217
+ /**
218
+ * Singleton subclass for the reserved sentinel namespace id
219
+ * (`UNSPECIFIED_NAMESPACE_ID`). Overrides qualifier emission to elide
220
+ * the database prefix — call sites that consume `qualifier()` /
221
+ * `qualifyCollection()` get unqualified output without branching on the
222
+ * namespace id.
223
+ *
224
+ * This is the target-side materialization of "the framework provides
225
+ * affordances; targets implement specifics": the framework names the
226
+ * sentinel; Mongo decides what no-database-bound means here (the
227
+ * collection name, naked).
228
+ */
229
+ declare class MongoTargetUnspecifiedDatabase extends MongoTargetDatabase {
230
+ static readonly instance: MongoTargetUnspecifiedDatabase;
231
+ private constructor();
232
+ qualifier(): string;
233
+ qualifyCollection(collectionName: string): string;
234
+ }
235
+ //#endregion
236
+ //#region src/core/mongo-target-schema-verifier.d.ts
237
+ /**
238
+ * Mongo target `SchemaVerifier` concretion. Extends the family base's
239
+ * namespace-walk scaffolding and contributes the per-namespace diff via
240
+ * `verifyNamespace`; the diff body reuses the existing target-side
241
+ * helpers (`contractToMongoSchemaIR`, `canonicalizeSchemasForVerification`,
242
+ * `diffMongoSchemas`) so production verification behaviour is unchanged.
243
+ *
244
+ * Today's invariant: every Mongo contract carries exactly one
245
+ * namespace (the unspecified singleton, materialised as
246
+ * `MongoTargetUnspecifiedDatabase`), so the family-base namespace walk
247
+ * dispatches exactly once and the per-namespace body runs the existing
248
+ * whole-schema diff. Future per-collection namespace assignment will
249
+ * have this hook project the diff to the namespace's owned collections.
250
+ *
251
+ * `verifyTargetExtensions` returns the empty list — Mongo has no
252
+ * target-only kinds today.
253
+ *
254
+ * Strict diff mode is `false` for SPI-routed calls; production
255
+ * verification today still goes through `verifyMongoSchema` which
256
+ * receives strict from the CLI.
257
+ */
258
+ declare class MongoTargetSchemaVerifier extends MongoSchemaVerifierBase<MongoTargetContract, MongoSchemaIR> {
259
+ protected verifyNamespace(options: {
260
+ readonly contract: MongoTargetContract;
261
+ readonly schema: MongoSchemaIR;
262
+ readonly namespaceId: string;
263
+ readonly namespace: Namespace;
264
+ }): readonly SchemaIssue[];
265
+ protected verifyTargetExtensions(_options: SchemaVerifyOptions<MongoTargetContract, MongoSchemaIR>): readonly SchemaIssue[];
266
+ }
267
+ //#endregion
201
268
  //#region src/core/planner-produced-migration.d.ts
202
269
  /**
203
270
  * Planner-produced Mongo migration, returned by `MongoMigrationPlanner.plan(...)`
@@ -253,5 +320,5 @@ interface RenderMigrationMeta {
253
320
  */
254
321
  declare function renderCallsToTypeScript(calls: ReadonlyArray<OpFactoryCall>, meta: RenderMigrationMeta): string;
255
322
  //#endregion
256
- export { CollModCall, type CollModMeta, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, type MarkerOperations, MongoMigrationPlanner, MongoMigrationRunner, type MongoMigrationRunnerExecuteOptions, type MongoRunnerDependencies, type OpFactoryCall, type PlanCallsResult, PlannerProducedMongoMigration, type RenderMigrationMeta, contractToMongoSchemaIR, deserializeMongoOp, deserializeMongoOps, formatMongoOperations, initMarker, readAllMarkers, readMarker, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps, updateMarker, writeLedgerEntry };
323
+ export { CollModCall, type CollModMeta, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, type MarkerOperations, MongoMigrationPlanner, MongoMigrationRunner, type MongoMigrationRunnerExecuteOptions, type MongoRunnerDependencies, type MongoTargetContract, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnspecifiedDatabase, type OpFactoryCall, type PlanCallsResult, PlannerProducedMongoMigration, type RenderMigrationMeta, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };
257
324
  //# sourceMappingURL=control.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/contract-to-schema.ts","../src/core/ddl-formatter.ts","../src/core/filter-evaluator.ts","../src/core/marker-ledger.ts","../src/core/mongo-ops-serializer.ts","../src/core/mongo-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;;;;;;;;;;iBSJgB,uBAAA,CACd,KAAA,EAAO,aAAA,CAAc,aAAA,GACrB,IAAA,EAAM,mBAAA"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/mongo-target-contract.ts","../src/core/control-target.ts","../src/core/filter-evaluator.ts","../src/core/mongo-ops-serializer.ts","../src/core/mongo-planner.ts","../src/core/mongo-runner.ts","../src/core/mongo-target-contract-serializer.ts","../src/core/mongo-target-database.ts","../src/core/mongo-target-schema-verifier.ts","../src/core/planner-produced-migration.ts","../src/core/render-ops.ts","../src/core/render-typescript.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;KAYY,mBAAA,GAAsB,IAAA,CAAK,aAAA;EAAA,SAC5B,OAAA,EAAS,YAAA;AAAA;;;;;;;;;;;;;cCmCP,qBAAA,EAAuB,4BAAA,CAA6B,mBAAA;;;cCEpD,eAAA,YAA2B,kBAAA;EAAA,QAC9B,GAAA;EAER,QAAA,CAAS,MAAA,EAAQ,eAAA,EAAiB,GAAA,EAAK,MAAA;EAKvC,KAAA,CAAM,IAAA,EAAM,gBAAA;EAKZ,GAAA,CAAI,IAAA,EAAM,YAAA;EAIV,EAAA,CAAG,IAAA,EAAM,WAAA;EAIT,GAAA,CAAI,IAAA,EAAM,YAAA;EAIV,MAAA,CAAO,IAAA,EAAM,eAAA;EAKb,IAAA,CAAK,KAAA,EAAO,eAAA;AAAA;;;iBC8hBE,kBAAA,CAAmB,IAAA,YAAgB,0BAAA;AAAA,iBAOnC,mBAAA,CAAoB,IAAA,uBAA2B,0BAAA;AAAA,iBAI/C,iBAAA,CAAkB,GAAA,WAAc,0BAAA;;;KCphBpC,eAAA;EAAA,SACG,IAAA;EAAA,SAA0B,KAAA,EAAO,aAAA;AAAA;EAAA,SACjC,IAAA;EAAA,SAA0B,SAAA,EAAW,wBAAA;AAAA;AAAA,cAEvC,qBAAA,YAAiC,gBAAA;EAC5C,SAAA,CAAU,OAAA;IAAA,SACC,QAAA;IAAA,SACA,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