@prisma/orm-family-mongo 8.0.0-rc.8-dev.18 → 8.0.0-rc.8-dev.20
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/{authoring-entity-types-BGtkMyoN-D32kzx28.mjs → authoring-entity-types-Do4eLmih-DIruXcuT.mjs} +9 -3
- package/dist/authoring-entity-types-Do4eLmih-DIruXcuT.mjs.map +1 -0
- package/dist/contract-psl.d.mts +88 -2
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +2 -2
- package/dist/contract-psl__provider.mjs +2 -1
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/{control-BbZQqmxo.mjs → control-BNRwpUCl.mjs} +6 -3
- package/dist/control-BNRwpUCl.mjs.map +1 -0
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +2 -2
- package/dist/family__control.mjs +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +4 -2
- package/dist/family__pack.mjs.map +1 -1
- package/dist/{interpreter-O09WlHk7-BiV9gBae.mjs → interpreter-BAcUM6H7-DNUcUApV.mjs} +148 -55
- package/dist/interpreter-BAcUM6H7-DNUcUApV.mjs.map +1 -0
- package/dist/{pack-D9aLY50F.d.mts → pack-ByR2mQ_8.d.mts} +13 -2
- package/dist/pack-ByR2mQ_8.d.mts.map +1 -0
- package/package.json +19 -19
- package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs.map +0 -1
- package/dist/control-BbZQqmxo.mjs.map +0 -1
- package/dist/interpreter-O09WlHk7-BiV9gBae.mjs.map +0 -1
- package/dist/pack-D9aLY50F.d.mts.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
2
2
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
3
|
import { resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
|
|
4
|
-
|
|
4
|
+
import { blockAttribute, str } from "@prisma/orm-framework/psl-parser";
|
|
5
|
+
//#region ../../../2-mongo-family/9-family/dist/authoring-entity-types-Do4eLmih.mjs
|
|
5
6
|
function contractError(code, message, options) {
|
|
6
7
|
return structuredError(code, message, options);
|
|
7
8
|
}
|
|
@@ -162,15 +163,20 @@ const mongoFamilyEntityTypes = { enum: {
|
|
|
162
163
|
})));
|
|
163
164
|
} }
|
|
164
165
|
} };
|
|
166
|
+
const enumTypeBlockAttribute = blockAttribute("type", { positional: [{
|
|
167
|
+
key: "codecId",
|
|
168
|
+
type: str()
|
|
169
|
+
}] });
|
|
165
170
|
const mongoFamilyPslBlockDescriptors = { enum: {
|
|
166
171
|
kind: "pslBlock",
|
|
167
172
|
keyword: "enum",
|
|
168
173
|
discriminator: "enum",
|
|
169
174
|
name: { required: true },
|
|
170
175
|
parameters: {},
|
|
171
|
-
variadicParameters: true
|
|
176
|
+
variadicParameters: true,
|
|
177
|
+
attributes: { type: () => enumTypeBlockAttribute }
|
|
172
178
|
} };
|
|
173
179
|
//#endregion
|
|
174
180
|
export { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };
|
|
175
181
|
|
|
176
|
-
//# sourceMappingURL=authoring-entity-types-
|
|
182
|
+
//# sourceMappingURL=authoring-entity-types-Do4eLmih-DIruXcuT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-entity-types-Do4eLmih-DIruXcuT.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/authoring-entity-types-Do4eLmih.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { blockAttribute, str } from \"@internal/psl-parser\";\n//#region ../../1-framework/2-authoring/contract/dist/index.mjs\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\nconst ENUM_TYPE_HANDLE_BRAND = \"__prismaNextEnumTypeHandle__\";\nfunction enumType(name, codec, ...members) {\n\tif (members.length === 0) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${name}\"): must have at least one member.`, { meta: {\n\t\tenumName: name,\n\t\treason: \"no-members\"\n\t} });\n\tconst seenNames = /* @__PURE__ */ new Set();\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tfor (const m of members) {\n\t\tif (seenNames.has(m.name)) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${name}\"): duplicate member name \"${m.name}\". Member names must be unique.`, { meta: {\n\t\t\tenumName: name,\n\t\t\tmember: m.name,\n\t\t\treason: \"duplicate-member-name\"\n\t\t} });\n\t\tseenNames.add(m.name);\n\t\tconst loweredValue = String(m.value);\n\t\tif (seenValues.has(loweredValue)) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${name}\"): duplicate member value \"${loweredValue}\". Member values must be unique.`, { meta: {\n\t\t\tenumName: name,\n\t\t\tmember: loweredValue,\n\t\t\treason: \"duplicate-member-value\"\n\t\t} });\n\t\tseenValues.add(loweredValue);\n\t}\n\tconst values = Object.freeze(members.map((m) => m.value));\n\tconst names = Object.freeze(members.map((m) => m.name));\n\tconst enumMembers = Object.freeze(members.map((m) => ({\n\t\tname: m.name,\n\t\tvalue: m.value\n\t})));\n\tconst membersAccessor = Object.freeze(Object.fromEntries(members.map((m) => [m.name, m.value])));\n\tconst valueSet = new Set(values);\n\tconst valueToName = new Map(members.map((m) => [m.value, m.name]));\n\tconst valueToOrdinal = new Map(values.map((v, i) => [v, i]));\n\treturn {\n\t\t[ENUM_TYPE_HANDLE_BRAND]: true,\n\t\tenumName: name,\n\t\tcodecId: codec.codecId,\n\t\tnativeType: codec.nativeType,\n\t\tenumMembers,\n\t\tvalues,\n\t\tnames,\n\t\tmembers: membersAccessor,\n\t\thas: (v) => valueSet.has(v),\n\t\tnameOf: (v) => valueToName.get(v),\n\t\tordinalOf: (v) => valueToOrdinal.get(v) ?? -1\n\t};\n}\nconst mongoFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\t\tlet value;\n\t\t\tif (paramValue.kind === \"bare\") try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (paramValue.kind === \"value\") {\n\t\t\t\tlet jsonValue;\n\t\t\t\ttry {\n\t\t\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t\t\t} catch {\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tvalue = codec.decodeJson(blindCast(jsonValue));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\t\tdiagnostics?.push({\n\t\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\t\tsourceId,\n\t\t\t\t\t\tspan: paramValue.span\n\t\t\t\t\t});\n\t\t\t\t\tmemberError = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else continue;\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan: paramValue.span\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", { positional: [{\n\tkey: \"codecId\",\n\ttype: str()\n}] });\nconst mongoFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tparameters: {},\n\tvariadicParameters: true,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\nexport { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };\n\n//# sourceMappingURL=authoring-entity-types-Do4eLmih.mjs.map"],"mappings":";;;;;AAKA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AACA,MAAM,yBAAyB;AAC/B,SAAS,SAAS,MAAM,OAAO,GAAG,SAAS;CAC1C,IAAI,QAAQ,WAAW,GAAG,MAAM,cAAc,yBAAyB,aAAa,KAAK,qCAAqC,EAAE,MAAM;EACrI,UAAU;EACV,QAAQ;CACT,EAAE,CAAC;CACH,MAAM,4BAA4B,IAAI,IAAI;CAC1C,MAAM,6BAA6B,IAAI,IAAI;CAC3C,KAAK,MAAM,KAAK,SAAS;EACxB,IAAI,UAAU,IAAI,EAAE,IAAI,GAAG,MAAM,cAAc,yBAAyB,aAAa,KAAK,6BAA6B,EAAE,KAAK,kCAAkC,EAAE,MAAM;GACvK,UAAU;GACV,QAAQ,EAAE;GACV,QAAQ;EACT,EAAE,CAAC;EACH,UAAU,IAAI,E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AAY,WAAW,2BAA2B,QAAQ,KAAK;MAC5F;MACA,MAAM,WAAW;KAClB,CAAC;KACD,cAAc;KACd;IACD;GACD,OAAO;GACP,MAAM,WAAW,OAAO,KAAK;GAC7B,IAAI,WAAW,IAAI,QAAQ,GAAG;IAC7B,aAAa,KAAK;KACjB,MAAM;KACN,SAAS,SAAS,MAAM,KAAK,6BAA6B,SAAS;KACnE;KACA,MAAM,WAAW;IAClB,CAAC;IACD,cAAc;IACd;GACD;GACA,WAAW,IAAI,QAAQ;GACvB,QAAQ,KAAK;IACZ,MAAM;IACN;GACD,CAAC;EACF;EACA,IAAI,aAAa,OAAO,KAAK;EAC7B,IAAI,QAAQ,WAAW,GAAG;GACzB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK;IAC7B;IACA,MAAM,MAAM;GACb,CAAC;GACD;EACD;EACA,OAAO,SAAS,MAAM,MAAM;GAC3B;GACA;EACD,GAAG,GAAG,QAAQ,KAAK,OAAO;GACzB,MAAM,EAAE;GACR,OAAO,EAAE;EACV,EAAE,CAAC;CACJ,EAAE;AACH,EAAE;AACF,MAAM,yBAAyB,eAAe,QAAQ,EAAE,YAAY,CAAC;CACpE,KAAK;CACL,MAAM,IAAI;AACX,CAAC,EAAE,CAAC;AACJ,MAAM,iCAAiC,EAAE,MAAM;CAC9C,MAAM;CACN,SAAS;CACT,eAAe;CACf,MAAM,EAAE,UAAU,KAAK;CACvB,YAAY,CAAC;CACb,oBAAoB;CACpB,YAAY,EAAE,YAAY,uBAAuB;AAClD,EAAE"}
|
package/dist/contract-psl.d.mts
CHANGED
|
@@ -2,9 +2,10 @@ import { Q as MongoValidator } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
|
|
|
2
2
|
import "./index-Cd2zLiU6.mjs";
|
|
3
3
|
import { Contract, ContractField, ContractValueObject, JsonValue } from "@prisma/orm-framework/contract/types";
|
|
4
4
|
import { AuthoringContributions } from "@prisma/orm-framework/components/authoring";
|
|
5
|
-
import { SymbolTable } from "@prisma/orm-framework/psl-parser";
|
|
5
|
+
import { AttributeSpec, AttributeSpecContext, FieldAttributeCtx, FieldAttributeSpecContext, ModelAttributeCtx, SymbolTable, TypedFuncCall } from "@prisma/orm-framework/psl-parser";
|
|
6
6
|
import { Result } from "@prisma/orm-framework/utils/result";
|
|
7
7
|
import { SourceFile } from "@prisma/orm-framework/psl-parser/syntax";
|
|
8
|
+
import { ControlMutationDefaultRegistry } from "@prisma/orm-framework/components/control";
|
|
8
9
|
import { CodecLookup } from "@prisma/orm-framework/components/codec";
|
|
9
10
|
import { ContractSourceDiagnostic, ContractSourceDiagnostics } from "@prisma/orm-framework/config/config-types";
|
|
10
11
|
//#region ../../../2-mongo-family/2-authoring/contract-psl/dist/index.d.mts
|
|
@@ -30,6 +31,7 @@ interface InterpretPslDocumentToMongoContractInput {
|
|
|
30
31
|
readonly sourceFile: SourceFile;
|
|
31
32
|
readonly sourceId: string;
|
|
32
33
|
readonly scalarTypeCodecIds: ReadonlyMap<string, string>;
|
|
34
|
+
readonly controlMutationDefaults: ControlMutationDefaultRegistry;
|
|
33
35
|
readonly codecLookup?: CodecLookup;
|
|
34
36
|
readonly seedDiagnostics?: readonly ContractSourceDiagnostic[];
|
|
35
37
|
readonly authoringContributions?: AuthoringContributions;
|
|
@@ -41,5 +43,89 @@ interface InterpretPslDocumentToMongoContractInput {
|
|
|
41
43
|
}
|
|
42
44
|
declare function interpretPslDocumentToMongoContract(input: InterpretPslDocumentToMongoContractInput): Result<Contract, ContractSourceDiagnostics>;
|
|
43
45
|
//#endregion
|
|
44
|
-
|
|
46
|
+
//#region src/mongo-attribute-specs.d.ts
|
|
47
|
+
declare const mongoAttributeSpecs: {
|
|
48
|
+
readonly model: {
|
|
49
|
+
readonly map: (ctx: AttributeSpecContext) => AttributeSpec<{
|
|
50
|
+
name: string;
|
|
51
|
+
}, ModelAttributeCtx>;
|
|
52
|
+
readonly discriminator: (ctx: AttributeSpecContext) => AttributeSpec<{
|
|
53
|
+
field: string;
|
|
54
|
+
}, ModelAttributeCtx>;
|
|
55
|
+
readonly base: (ctx: AttributeSpecContext) => AttributeSpec<{
|
|
56
|
+
base: string;
|
|
57
|
+
value: string;
|
|
58
|
+
}, ModelAttributeCtx>;
|
|
59
|
+
readonly index: (ctx: AttributeSpecContext) => AttributeSpec<{
|
|
60
|
+
fields: (string | TypedFuncCall)[];
|
|
61
|
+
readonly collationLocale?: string;
|
|
62
|
+
readonly collationStrength?: 1 | 2 | 3 | 4 | 5;
|
|
63
|
+
readonly collationCaseLevel?: boolean;
|
|
64
|
+
readonly collationCaseFirst?: "upper" | "lower" | "off";
|
|
65
|
+
readonly collationNumericOrdering?: boolean;
|
|
66
|
+
readonly collationAlternate?: "non-ignorable" | "shifted";
|
|
67
|
+
readonly collationMaxVariable?: "punct" | "space";
|
|
68
|
+
readonly collationBackwards?: boolean;
|
|
69
|
+
readonly collationNormalization?: boolean;
|
|
70
|
+
readonly type?: 1 | -1 | "text" | "2dsphere" | "2d" | "hashed";
|
|
71
|
+
readonly sparse?: boolean;
|
|
72
|
+
readonly expireAfterSeconds?: number;
|
|
73
|
+
readonly filter?: Record<string, unknown>;
|
|
74
|
+
readonly include?: string[];
|
|
75
|
+
readonly exclude?: string[];
|
|
76
|
+
readonly default_language?: string;
|
|
77
|
+
readonly languageOverride?: string;
|
|
78
|
+
}, ModelAttributeCtx>;
|
|
79
|
+
readonly unique: (ctx: AttributeSpecContext) => AttributeSpec<{
|
|
80
|
+
fields: (string | TypedFuncCall)[];
|
|
81
|
+
readonly collationLocale?: string;
|
|
82
|
+
readonly collationStrength?: 1 | 2 | 3 | 4 | 5;
|
|
83
|
+
readonly collationCaseLevel?: boolean;
|
|
84
|
+
readonly collationCaseFirst?: "upper" | "lower" | "off";
|
|
85
|
+
readonly collationNumericOrdering?: boolean;
|
|
86
|
+
readonly collationAlternate?: "non-ignorable" | "shifted";
|
|
87
|
+
readonly collationMaxVariable?: "punct" | "space";
|
|
88
|
+
readonly collationBackwards?: boolean;
|
|
89
|
+
readonly collationNormalization?: boolean;
|
|
90
|
+
readonly type?: 1 | -1 | "text" | "2dsphere" | "2d" | "hashed";
|
|
91
|
+
readonly sparse?: boolean;
|
|
92
|
+
readonly expireAfterSeconds?: number;
|
|
93
|
+
readonly filter?: Record<string, unknown>;
|
|
94
|
+
readonly include?: string[];
|
|
95
|
+
readonly exclude?: string[];
|
|
96
|
+
readonly default_language?: string;
|
|
97
|
+
readonly languageOverride?: string;
|
|
98
|
+
}, ModelAttributeCtx>;
|
|
99
|
+
readonly textIndex: (ctx: AttributeSpecContext) => AttributeSpec<{
|
|
100
|
+
fields: (string | TypedFuncCall)[];
|
|
101
|
+
readonly collationLocale?: string;
|
|
102
|
+
readonly collationStrength?: 1 | 2 | 3 | 4 | 5;
|
|
103
|
+
readonly collationCaseLevel?: boolean;
|
|
104
|
+
readonly collationCaseFirst?: "upper" | "lower" | "off";
|
|
105
|
+
readonly collationNumericOrdering?: boolean;
|
|
106
|
+
readonly collationAlternate?: "non-ignorable" | "shifted";
|
|
107
|
+
readonly collationMaxVariable?: "punct" | "space";
|
|
108
|
+
readonly collationBackwards?: boolean;
|
|
109
|
+
readonly collationNormalization?: boolean;
|
|
110
|
+
readonly filter?: Record<string, unknown>;
|
|
111
|
+
readonly weights?: Record<string, number>;
|
|
112
|
+
readonly language?: string;
|
|
113
|
+
readonly languageOverride?: string;
|
|
114
|
+
}, ModelAttributeCtx>;
|
|
115
|
+
};
|
|
116
|
+
readonly field: {
|
|
117
|
+
readonly id: (ctx: FieldAttributeSpecContext) => AttributeSpec<{}, FieldAttributeCtx>;
|
|
118
|
+
readonly unique: (ctx: FieldAttributeSpecContext) => AttributeSpec<{}, FieldAttributeCtx>;
|
|
119
|
+
readonly map: (ctx: FieldAttributeSpecContext) => AttributeSpec<{
|
|
120
|
+
name: string;
|
|
121
|
+
}, FieldAttributeCtx>;
|
|
122
|
+
readonly relation: (ctx: FieldAttributeSpecContext) => AttributeSpec<{
|
|
123
|
+
name?: string;
|
|
124
|
+
readonly fields?: string[];
|
|
125
|
+
readonly references?: string[];
|
|
126
|
+
}, FieldAttributeCtx>;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
//#endregion
|
|
130
|
+
export { type FieldValueSets, type InterpretPslDocumentToMongoContractInput, deriveJsonSchema, derivePolymorphicJsonSchema, interpretPslDocumentToMongoContract, mongoAttributeSpecs };
|
|
45
131
|
//# sourceMappingURL=contract-psl.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/index.d.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;KAeK,iBAAiB;WACX,iBAAiB;;iBAEX,iBAAiB,QAAQ,eAAe,gBAAgB,eAAe,eAAe,sBAAsB,cAAc,aAAa,YAAY,iBAAiB;UAC3K;WACC;WACA,QAAQ,eAAe;;iBAEjB,4BAA4B,YAAY,eAAe,gBAAgB,4BAA4B,mBAAmB,sBAAsB,eAAe,eAAe,sBAAsB,cAAc,aAAa,YAAY,iBAAiB;;;UAG/P;WACC,aAAa;WACb,YAAY;WACZ;WACA,oBAAoB;WACpB,yBAAyB;WACzB,cAAc;WACd,2BAA2B;WAC3B,yBAAyB;;WAEzB;aACE;aACA;;;iBAGI,oCAAoC,OAAO,2CAA2C,OAAO,UAAU;;;cAG1G;WACH;aACE,MAAM,KAAK,yBAAyB;MAC3C;OACC;aACM,gBAAgB,KAAK,yBAAyB;MACrD;OACC;aACM,OAAO,KAAK,yBAAyB;MAC5C;MACA;OACC;aACM,QAAQ,KAAK,yBAAyB;MAC7C,kBAAkB;eACT;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT;eACA;eACA;eACA;OACR;aACM,SAAS,KAAK,yBAAyB;MAC9C,kBAAkB;eACT;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT;eACA;eACA;eACA;OACR;aACM,YAAY,KAAK,yBAAyB;MACjD,kBAAkB;eACT;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA,SAAS;eACT,UAAU;eACV;eACA;OACR;;WAEI;aACE,KAAK,KAAK,8BAA8B,kBAAkB;aAC1D,SAAS,KAAK,8BAA8B,kBAAkB;aAC9D,MAAM,KAAK,8BAA8B;MAChD;OACC;aACM,WAAW,KAAK,8BAA8B;MACrD;eACS;eACA;OACR"}
|
package/dist/contract-psl.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-
|
|
2
|
-
export { deriveJsonSchema, derivePolymorphicJsonSchema, interpretPslDocumentToMongoContract };
|
|
1
|
+
import { i as mongoAttributeSpecs, n as derivePolymorphicJsonSchema, r as interpretPslDocumentToMongoContract, t as deriveJsonSchema } from "./interpreter-BAcUM6H7-DNUcUApV.mjs";
|
|
2
|
+
export { deriveJsonSchema, derivePolymorphicJsonSchema, interpretPslDocumentToMongoContract, mongoAttributeSpecs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as interpretPslDocumentToMongoContract } from "./interpreter-
|
|
1
|
+
import { r as interpretPslDocumentToMongoContract } from "./interpreter-BAcUM6H7-DNUcUApV.mjs";
|
|
2
2
|
import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
|
|
3
3
|
import { buildSymbolTable, rangeToPslSpan } from "@prisma/orm-framework/psl-parser";
|
|
4
4
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -31,6 +31,7 @@ function mongoContract(schemaPath, options) {
|
|
|
31
31
|
sourceId: input.sourceId,
|
|
32
32
|
seedDiagnostics: [],
|
|
33
33
|
scalarTypeCodecIds: collectScalarTypeCodecIds(context.authoringContributions.type),
|
|
34
|
+
controlMutationDefaults: context.controlMutationDefaults.defaultFunctionRegistry,
|
|
34
35
|
codecLookup: context.codecLookup,
|
|
35
36
|
authoringContributions: context.authoringContributions,
|
|
36
37
|
...ifDefined("enumInferenceCodecs", options?.enumInferenceCodecs)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/exports/provider.mjs"],"sourcesContent":["import { t as interpretPslDocumentToMongoContract } from \"../interpreter-
|
|
1
|
+
{"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-psl/dist/exports/provider.mjs"],"sourcesContent":["import { t as interpretPslDocumentToMongoContract } from \"../interpreter-BAcUM6H7.mjs\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, rangeToPslSpan } from \"@internal/psl-parser\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/provider.ts\nfunction collectScalarTypeCodecIds(namespace) {\n\treturn new Map([...collectScalarTypeConstructors(namespace)].map(([name, output]) => [name, output.codecId]));\n}\nfunction mapParseDiagnostics(diagnostics, sourceFile, sourceId) {\n\treturn diagnostics.map((diagnostic) => ({\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\tsourceId,\n\t\tspan: rangeToPslSpan(diagnostic.range, sourceFile)\n\t}));\n}\nfunction mongoContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\treturn interpretPslDocumentToMongoContract({\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsourceFile: input.sourceFile,\n\t\t\t\t\tsourceId: input.sourceId,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\tscalarTypeCodecIds: collectScalarTypeCodecIds(context.authoringContributions.type),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults.defaultFunctionRegistry,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options?.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst [absoluteSchemaPath] = context.resolvedInputs;\n\t\t\t\tif (absoluteSchemaPath === void 0) throw new InternalError(\"mongoContract: context.resolvedInputs is empty. The CLI config loader should populate it positional-matched with source.inputs.\");\n\t\t\t\tlet schema;\n\t\t\t\ttry {\n\t\t\t\t\tschema = await readFile(absoluteSchemaPath, \"utf-8\");\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message = String(error);\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: `Failed to read Prisma schema at \"${schemaPath}\"`,\n\t\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tschemaPath,\n\t\t\t\t\t\t\tabsoluteSchemaPath,\n\t\t\t\t\t\t\tcause: message\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst { document, sourceFile, diagnostics: parseDiagnostics } = parse(schema);\n\t\t\t\tconst { table: symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tpslBlockDescriptors: context.authoringContributions.pslBlockDescriptors\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...mapParseDiagnostics(parseDiagnostics, sourceFile, schemaPath), ...mapParseDiagnostics(symbolTableDiagnostics, sourceFile, schemaPath)];\n\t\t\t\treturn withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocument,\n\t\t\t\t\tsourceFile,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t}, context), seedDiagnostics);\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options?.output)\n\t};\n}\n//#endregion\nexport { mongoContract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,0BAA0B,WAAW;CAC7C,OAAO,IAAI,IAAI,CAAC,GAAG,8BAA8B,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,YAAY,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAC7G;AACA,SAAS,oBAAoB,aAAa,YAAY,UAAU;CAC/D,OAAO,YAAY,KAAK,gBAAgB;EACvC,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB;EACA,MAAM,eAAe,WAAW,OAAO,UAAU;CAClD,EAAE;AACH;AACA,SAAS,cAAc,YAAY,SAAS;CAC3C,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,UAAU;GACnB,UAAU,OAAO,SAAS;IACzB,OAAO,oCAAoC;KAC1C,aAAa,MAAM;KACnB,YAAY,MAAM;KAClB,UAAU,MAAM;KAChB,iBAAiB,CAAC;KAClB,oBAAoB,0BAA0B,QAAQ,uBAAuB,IAAI;KACjF,yBAAyB,QAAQ,wBAAwB;KACzD,aAAa,QAAQ;KACrB,wBAAwB,QAAQ;KAChC,GAAG,UAAU,uBAAuB,SAAS,mBAAmB;IACjE,CAAC;GACF;GACA,MAAM,KAAK,SAAS;IACnB,MAAM,CAAC,sBAAsB,QAAQ;IACrC,IAAI,uBAAuB,KAAK,GAAG,MAAM,IAAI,cAAc,iIAAiI;IAC5L,IAAI;IACJ,IAAI;KACH,SAAS,MAAM,SAAS,oBAAoB,OAAO;IACpD,SAAS,OAAO;KACf,MAAM,UAAU,OAAO,KAAK;KAC5B,OAAO,MAAM;MACZ,SAAS,oCAAoC,WAAW;MACxD,aAAa,CAAC;OACb,MAAM;OACN;OACA,UAAU;MACX,CAAC;MACD,MAAM;OACL;OACA;OACA,OAAO;MACR;KACD,CAAC;IACF;IACA,MAAM,EAAE,UAAU,YAAY,aAAa,qBAAqB,MAAM,MAAM;IAC5E,MAAM,EAAE,OAAO,aAAa,aAAa,2BAA2B,iBAAiB;KACpF;KACA;KACA,qBAAqB,QAAQ,uBAAuB;IACrD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,oBAAoB,kBAAkB,YAAY,UAAU,GAAG,GAAG,oBAAoB,wBAAwB,YAAY,UAAU,CAAC;IACjK,OAAO,oBAAoB,KAAK,UAAU;KACzC;KACA;KACA;KACA,UAAU;IACX,GAAG,OAAO,GAAG,eAAe;GAC7B;EACD;EACA,GAAG,UAAU,UAAU,SAAS,MAAM;CACvC;AACD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as mongoContractCanonicalizationHooks } from "./canonicalization-hooks-DF3Z6sjO.mjs";
|
|
2
|
+
import { i as mongoAttributeSpecs } from "./interpreter-BAcUM6H7-DNUcUApV.mjs";
|
|
2
3
|
import { t as mongoEmission } from "./exports-C4RGBGzZ.mjs";
|
|
3
4
|
import { i as verifyMongoSchema } from "./verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs";
|
|
4
|
-
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-
|
|
5
|
+
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-Do4eLmih-DIruXcuT.mjs";
|
|
5
6
|
import { t as MongoContractSerializer } from "./mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs";
|
|
6
7
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
7
8
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -377,6 +378,7 @@ function createMongoFamilyInstance(controlStack) {
|
|
|
377
378
|
}
|
|
378
379
|
};
|
|
379
380
|
}
|
|
381
|
+
const mongoFamilyAttributeSpecs = mongoAttributeSpecs;
|
|
380
382
|
var MongoFamilyDescriptor = class {
|
|
381
383
|
kind = "family";
|
|
382
384
|
id = "mongo";
|
|
@@ -385,7 +387,8 @@ var MongoFamilyDescriptor = class {
|
|
|
385
387
|
emission = mongoEmission;
|
|
386
388
|
authoring = {
|
|
387
389
|
entityTypes: mongoFamilyEntityTypes,
|
|
388
|
-
pslBlockDescriptors: mongoFamilyPslBlockDescriptors
|
|
390
|
+
pslBlockDescriptors: mongoFamilyPslBlockDescriptors,
|
|
391
|
+
attributeSpecs: mongoFamilyAttributeSpecs
|
|
389
392
|
};
|
|
390
393
|
create(stack) {
|
|
391
394
|
return createMongoFamilyInstance(stack);
|
|
@@ -395,4 +398,4 @@ const mongoFamilyDescriptor = new MongoFamilyDescriptor();
|
|
|
395
398
|
//#endregion
|
|
396
399
|
export { mongoOperationsToPreview as i, formatMongoOperations as n, mongoFamilyDescriptor as r, createMongoFamilyInstance as t };
|
|
397
400
|
|
|
398
|
-
//# sourceMappingURL=control-
|
|
401
|
+
//# sourceMappingURL=control-BNRwpUCl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-BNRwpUCl.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/control.mjs"],"sourcesContent":["import { i as contractToMongoSchemaIR, n as canonicalizeSchemasForVerification, r as diffMongoSchemas, t as verifyMongoSchema } from \"./verify-mongo-schema-De0FG2Rm.mjs\";\nimport { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from \"./authoring-entity-types-Do4eLmih.mjs\";\nimport { t as MongoContractSerializer } from \"./mongo-contract-serializer-Cx7Fae8e.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { mongoAttributeSpecs } from \"@internal/mongo-contract-psl\";\nimport { mongoEmission } from \"@internal/mongo-emitter\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH } from \"@internal/framework-components/control\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { assertDescriptorSelfConsistency } from \"@internal/migration-tools/spaces\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/core/operation-preview.ts\nfunction formatKeySpec(keys) {\n\treturn `{ ${keys.map((k) => `${JSON.stringify(k.field)}: ${JSON.stringify(k.direction)}`).join(\", \")} }`;\n}\nconst COMMAND_META_KEYS = /* @__PURE__ */ new Set([\n\t\"kind\",\n\t\"collection\",\n\t\"keys\"\n]);\nfunction formatOptionEntries(cmd) {\n\tconst parts = Object.entries(cmd).filter(([key, value]) => !COMMAND_META_KEYS.has(key) && value !== void 0).map(([key, value]) => `${key}: ${JSON.stringify(value)}`);\n\tif (parts.length === 0) return void 0;\n\treturn `{ ${parts.join(\", \")} }`;\n}\nfunction formatOptions(cmd) {\n\treturn formatOptionEntries(cmd);\n}\nfunction formatCreateCollectionOptions(cmd) {\n\treturn formatOptionEntries(cmd);\n}\nvar MongoDdlCommandFormatter = class {\n\tcreateIndex(cmd) {\n\t\tconst keySpec = formatKeySpec(cmd.keys);\n\t\tconst opts = formatOptions(cmd);\n\t\treturn opts ? `db.${cmd.collection}.createIndex(${keySpec}, ${opts})` : `db.${cmd.collection}.createIndex(${keySpec})`;\n\t}\n\tdropIndex(cmd) {\n\t\treturn `db.${cmd.collection}.dropIndex(${JSON.stringify(cmd.name)})`;\n\t}\n\tcreateCollection(cmd) {\n\t\tconst opts = formatCreateCollectionOptions(cmd);\n\t\treturn opts ? `db.createCollection(${JSON.stringify(cmd.collection)}, ${opts})` : `db.createCollection(${JSON.stringify(cmd.collection)})`;\n\t}\n\tdropCollection(cmd) {\n\t\treturn `db.${cmd.collection}.drop()`;\n\t}\n\tcollMod(cmd) {\n\t\tconst parts = [`collMod: ${JSON.stringify(cmd.collection)}`];\n\t\tfor (const [key, value] of Object.entries(cmd)) if (!COMMAND_META_KEYS.has(key) && value !== void 0) parts.push(`${key}: ${JSON.stringify(value)}`);\n\t\treturn `db.runCommand({ ${parts.join(\", \")} })`;\n\t}\n};\nconst formatter = new MongoDdlCommandFormatter();\nfunction formatMongoOperations(operations) {\n\tconst statements = [];\n\tfor (const operation of operations) {\n\t\tconst candidate = operation;\n\t\tif (!(\"execute\" in candidate) || !Array.isArray(candidate[\"execute\"])) continue;\n\t\tfor (const step of candidate[\"execute\"]) if (step.command && typeof step.command.accept === \"function\") statements.push(step.command.accept(formatter));\n\t}\n\treturn statements;\n}\n/**\n* Wraps `formatMongoOperations` into the family-agnostic\n* `OperationPreview` shape. Each statement carries\n* `language: 'mongodb-shell'`. Mirrors `sqlOperationsToPreview`.\n*/\nfunction mongoOperationsToPreview(operations) {\n\treturn { statements: formatMongoOperations(operations).map((text) => ({\n\t\ttext,\n\t\tlanguage: \"mongodb-shell\"\n\t})) };\n}\n//#endregion\n//#region src/core/schema-to-view.ts\nfunction mongoSchemaToView(schema) {\n\tconst collectionNodes = schema.collections.map((collection) => collectionToSchemaNode(collection.name, collection));\n\treturn { root: new SchemaTreeNode({\n\t\tkind: \"root\",\n\t\tid: \"mongo-schema\",\n\t\tlabel: \"database\",\n\t\t...ifDefined(\"children\", collectionNodes.length > 0 ? collectionNodes : void 0)\n\t}) };\n}\nfunction collectionToSchemaNode(name, collection) {\n\tconst children = [];\n\tfor (const index of collection.indexes) {\n\t\tconst keysSummary = index.keys.map((k) => {\n\t\t\tif (k.direction === 1) return k.field;\n\t\t\tif (k.direction === -1) return `${k.field} desc`;\n\t\t\treturn `${k.field} ${k.direction}`;\n\t\t}).join(\", \");\n\t\tconst prefix = index.unique ? \"unique index\" : \"index\";\n\t\tconst options = [];\n\t\tif (index.sparse) options.push(\"sparse\");\n\t\tif (index.expireAfterSeconds != null) options.push(`ttl: ${index.expireAfterSeconds}s`);\n\t\tif (index.partialFilterExpression) options.push(\"partial\");\n\t\tconst optsSuffix = options.length > 0 ? ` (${options.join(\", \")})` : \"\";\n\t\tchildren.push(new SchemaTreeNode({\n\t\t\tkind: \"index\",\n\t\t\tid: `index-${name}-${index.keys.map((k) => `${k.field}_${k.direction}`).join(\"_\")}`,\n\t\t\tlabel: `${prefix} (${keysSummary})${optsSuffix}`,\n\t\t\tmeta: {\n\t\t\t\tkeys: index.keys,\n\t\t\t\tunique: index.unique,\n\t\t\t\t...ifDefined(\"sparse\", index.sparse || void 0),\n\t\t\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds ?? void 0),\n\t\t\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression ?? void 0)\n\t\t\t}\n\t\t}));\n\t}\n\tif (collection.validator) {\n\t\tconst validatorChildren = [];\n\t\tconst jsonSchema = collection.validator.jsonSchema;\n\t\tconst properties = jsonSchema[\"properties\"];\n\t\tconst required = new Set(jsonSchema[\"required\"] ?? []);\n\t\tif (properties) for (const [propName, propDef] of Object.entries(properties)) {\n\t\t\tconst bsonType = propDef[\"bsonType\"] ?? \"unknown\";\n\t\t\tconst suffix = required.has(propName) ? \" (required)\" : \"\";\n\t\t\tvalidatorChildren.push(new SchemaTreeNode({\n\t\t\t\tkind: \"field\",\n\t\t\t\tid: `field-${name}-${propName}`,\n\t\t\t\tlabel: `${propName}: ${bsonType}${suffix}`\n\t\t\t}));\n\t\t}\n\t\tchildren.push(new SchemaTreeNode({\n\t\t\tkind: \"field\",\n\t\t\tid: `validator-${name}`,\n\t\t\tlabel: `validator (level: ${collection.validator.validationLevel}, action: ${collection.validator.validationAction})`,\n\t\t\tmeta: {\n\t\t\t\tvalidationLevel: collection.validator.validationLevel,\n\t\t\t\tvalidationAction: collection.validator.validationAction,\n\t\t\t\tjsonSchema: collection.validator.jsonSchema\n\t\t\t},\n\t\t\t...ifDefined(\"children\", validatorChildren.length > 0 ? validatorChildren : void 0)\n\t\t}));\n\t}\n\tif (collection.options) {\n\t\tconst opts = collection.options;\n\t\tconst optLabels = [];\n\t\tif (opts.capped) optLabels.push(\"capped\");\n\t\tif (opts.timeseries) optLabels.push(\"timeseries\");\n\t\tif (opts.collation) optLabels.push(\"collation\");\n\t\tif (opts.changeStreamPreAndPostImages) optLabels.push(\"changeStreamPreAndPostImages\");\n\t\tif (opts.clusteredIndex) optLabels.push(\"clusteredIndex\");\n\t\tif (optLabels.length > 0) children.push(new SchemaTreeNode({\n\t\t\tkind: \"field\",\n\t\t\tid: `options-${name}`,\n\t\t\tlabel: `options (${optLabels.join(\", \")})`,\n\t\t\tmeta: {\n\t\t\t\t...ifDefined(\"capped\", opts.capped ?? void 0),\n\t\t\t\t...ifDefined(\"timeseries\", opts.timeseries ?? void 0),\n\t\t\t\t...ifDefined(\"collation\", opts.collation ?? void 0),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts.changeStreamPreAndPostImages ?? void 0),\n\t\t\t\t...ifDefined(\"clusteredIndex\", opts.clusteredIndex ?? void 0)\n\t\t\t}\n\t\t}));\n\t}\n\treturn new SchemaTreeNode({\n\t\tkind: \"collection\",\n\t\tid: `collection-${name}`,\n\t\tlabel: `collection ${name}`,\n\t\t...ifDefined(\"children\", children.length > 0 ? children : void 0)\n\t});\n}\n//#endregion\n//#region src/core/control-instance.ts\nfunction deserializeMongoContract(contractJson) {\n\treturn new MongoContractSerializer().deserializeContract(contractJson);\n}\n/**\n* Family-method contract input. By the time control-plane methods\n* (`verify`, `verifySchema`, `sign`, …) are invoked through the CLI\n* control client (`client.ts`), the input has already been threaded\n* through `familyInstance.deserializeContract`. The value is therefore a\n* class-form `MongoTargetContract` (or a structurally-equivalent\n* envelope post-deserialization) and must NOT be re-fed through\n* structural validation (arktype rejects extra keys like `namespaces`).\n*\n* The parameter type on the framework SPI is `unknown` for variance\n* reasons (so the family can express its own contract type without\n* leaking it to the framework). This helper recovers the validated\n* shape with a single narrow cast.\n*/\nfunction asValidatedMongoContract(contract) {\n\treturn contract;\n}\nfunction buildVerifyResult(opts) {\n\treturn {\n\t\tok: opts.ok,\n\t\t...ifDefined(\"code\", opts.code),\n\t\tsummary: opts.summary,\n\t\tcontract: {\n\t\t\tstorageHash: opts.contractStorageHash,\n\t\t\t...ifDefined(\"profileHash\", opts.contractProfileHash)\n\t\t},\n\t\t...ifDefined(\"marker\", opts.marker ? {\n\t\t\tstorageHash: opts.marker.storageHash,\n\t\t\tprofileHash: opts.marker.profileHash\n\t\t} : void 0),\n\t\ttarget: {\n\t\t\texpected: opts.expectedTargetId,\n\t\t\t...ifDefined(\"actual\", opts.actualTargetId)\n\t\t},\n\t\tmeta: {\n\t\t\tcontractPath: opts.contractPath,\n\t\t\t...ifDefined(\"configPath\", opts.configPath)\n\t\t},\n\t\ttimings: { total: opts.totalTime }\n\t};\n}\nfunction createMongoFamilyInstance(controlStack) {\n\tconst extensions = controlStack.extensions ?? [];\n\tfor (const extension of extensions) if (extension.contractSpace) {\n\t\tconst { contractJson, headRef } = extension.contractSpace;\n\t\tassertDescriptorSelfConsistency({\n\t\t\textensionId: extension.id,\n\t\t\ttarget: contractJson.target,\n\t\t\ttargetFamily: contractJson.targetFamily,\n\t\t\tstorage: contractJson.storage,\n\t\t\theadRefHash: headRef.hash,\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t});\n\t}\n\tconst adapter = controlStack.adapter;\n\tconst getControlAdapter = () => {\n\t\tif (!adapter) throw new InternalError(\"Mongo family requires an adapter descriptor in ControlStack\");\n\t\treturn adapter.create(controlStack);\n\t};\n\tfunction isMongoTargetDriver(driver) {\n\t\treturn driver.targetId === \"mongo\";\n\t}\n\tfunction asMongoDriver(driver) {\n\t\tif (!isMongoTargetDriver(driver)) throw structuredError(\"CONTRACT.TARGET_MISMATCH\", `Expected Mongo control driver with targetId 'mongo', got '${driver.targetId}'`);\n\t\treturn driver;\n\t}\n\treturn {\n\t\tfamilyId: \"mongo\",\n\t\tdeserializeContract(contractJson) {\n\t\t\treturn deserializeMongoContract(contractJson);\n\t\t},\n\t\tasync verify(options) {\n\t\t\tconst { driver, contract: rawContract, expectedTargetId, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = asValidatedMongoContract(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst baseOpts = {\n\t\t\t\tcontractStorageHash,\n\t\t\t\tcontractProfileHash,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\t...ifDefined(\"configPath\", configPath)\n\t\t\t};\n\t\t\tif (contractTarget !== expectedTargetId) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_TARGET_MISMATCH,\n\t\t\t\tsummary: \"Target mismatch\",\n\t\t\t\tactualTargetId: contractTarget,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tconst marker = await getControlAdapter().readMarker(asMongoDriver(driver), APP_SPACE_ID);\n\t\t\tif (!marker) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_MARKER_MISSING,\n\t\t\t\tsummary: \"Marker missing\",\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tif (marker.storageHash !== contractStorageHash) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\tif (contractProfileHash && marker.profileHash !== contractProfileHash) return buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t\treturn buildVerifyResult({\n\t\t\t\t...baseOpts,\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Database matches contract\",\n\t\t\t\tmarker,\n\t\t\t\ttotalTime: Date.now() - startTime\n\t\t\t});\n\t\t},\n\t\tverifySchema(options) {\n\t\t\treturn verifyMongoSchema({\n\t\t\t\tcontract: asValidatedMongoContract(options.contract),\n\t\t\t\tschema: options.schema,\n\t\t\t\tstrict: options.strict,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t},\n\t\tasync sign(options) {\n\t\t\tconst { driver, contract: rawContract, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = asValidatedMongoContract(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst controlAdapter = getControlAdapter();\n\t\t\tconst mongoDriver = asMongoDriver(driver);\n\t\t\tconst existingMarker = await controlAdapter.readMarker(mongoDriver, APP_SPACE_ID);\n\t\t\tlet markerCreated = false;\n\t\t\tlet markerUpdated = false;\n\t\t\tlet previousHashes;\n\t\t\tif (!existingMarker) {\n\t\t\t\tawait controlAdapter.initMarker(mongoDriver, APP_SPACE_ID, {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t});\n\t\t\t\tmarkerCreated = true;\n\t\t\t} else {\n\t\t\t\tconst storageHashMatches = existingMarker.storageHash === contractStorageHash;\n\t\t\t\tconst profileHashMatches = existingMarker.profileHash === contractProfileHash;\n\t\t\t\tif (!storageHashMatches || !profileHashMatches) {\n\t\t\t\t\tpreviousHashes = {\n\t\t\t\t\t\tstorageHash: existingMarker.storageHash,\n\t\t\t\t\t\tprofileHash: existingMarker.profileHash\n\t\t\t\t\t};\n\t\t\t\t\tif (!await controlAdapter.updateMarker(mongoDriver, APP_SPACE_ID, existingMarker.storageHash, {\n\t\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t\t})) throw structuredError(\"MIGRATION.MARKER_CAS_FAILURE\", \"CAS conflict: marker was modified by another process during sign\");\n\t\t\t\t\tmarkerUpdated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet summary;\n\t\t\tif (markerCreated) summary = \"Database signed (marker created)\";\n\t\t\telse if (markerUpdated) summary = `Database signed (marker updated from ${previousHashes?.storageHash ?? \"unknown\"})`;\n\t\t\telse summary = \"Database already signed with this contract\";\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tsummary,\n\t\t\t\tcontract: {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\texpected: contract.target,\n\t\t\t\t\tactual: contract.target\n\t\t\t\t},\n\t\t\t\tmarker: {\n\t\t\t\t\tcreated: markerCreated,\n\t\t\t\t\tupdated: markerUpdated,\n\t\t\t\t\t...ifDefined(\"previous\", previousHashes)\n\t\t\t\t},\n\t\t\t\tmeta: {\n\t\t\t\t\tcontractPath,\n\t\t\t\t\t...ifDefined(\"configPath\", configPath)\n\t\t\t\t},\n\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t};\n\t\t},\n\t\tasync readMarker(options) {\n\t\t\treturn getControlAdapter().readMarker(asMongoDriver(options.driver), options.space);\n\t\t},\n\t\tasync readAllMarkers(options) {\n\t\t\treturn getControlAdapter().readAllMarkers(asMongoDriver(options.driver));\n\t\t},\n\t\tasync readLedger(options) {\n\t\t\treturn getControlAdapter().readLedger(asMongoDriver(options.driver), options.space);\n\t\t},\n\t\tasync introspect(options) {\n\t\t\treturn getControlAdapter().introspectSchema(asMongoDriver(options.driver));\n\t\t},\n\t\ttoSchemaView(schema) {\n\t\t\treturn mongoSchemaToView(schema);\n\t\t},\n\t\ttoOperationPreview(operations) {\n\t\t\treturn mongoOperationsToPreview(operations);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/control-descriptor.ts\nconst mongoFamilyAttributeSpecs = mongoAttributeSpecs;\nvar MongoFamilyDescriptor = class {\n\tkind = \"family\";\n\tid = \"mongo\";\n\tfamilyId = \"mongo\";\n\tversion = \"0.0.1\";\n\temission = mongoEmission;\n\tauthoring = {\n\t\tentityTypes: mongoFamilyEntityTypes,\n\t\tpslBlockDescriptors: mongoFamilyPslBlockDescriptors,\n\t\tattributeSpecs: mongoFamilyAttributeSpecs\n\t};\n\tcreate(stack) {\n\t\treturn createMongoFamilyInstance(stack);\n\t}\n};\nconst mongoFamilyDescriptor = new MongoFamilyDescriptor();\n//#endregion\nexport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, createMongoFamilyInstance, diffMongoSchemas, formatMongoOperations, mongoFamilyDescriptor, mongoOperationsToPreview };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,cAAc,MAAM;CAC5B,OAAO,KAAK,KAAK,KAAK,MAAM,GAAG,KAAK,UAAU,EAAE,KAAK,EAAE,IAAI,KAAK,UAAU,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;AACtG;AACA,MAAM,oCAAoC,IAAI,IAAI;CACjD;CACA;CACA;AACD,CAAC;AACD,SAAS,oBAAoB,KAAK;CACjC,MAAM,QAAQ,OAAO,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,WAAW,CAAC,kBAAkB,IAAI,GAAG,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,GAAG,IAAI,IAAI,KAAK,UAAU,KAAK,GAAG;CACpK,IAAI,MAAM,WAAW,GAAG,OAA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B,UAAU;EAC3C;CACD;AACD;AAGA,MAAM,4BAA4B;AAClC,IAAI,wBAAwB,MAAM;CACjC,OAAO;CACP,KAAK;CACL,WAAW;CACX,UAAU;CACV,WAAW;CACX,YAAY;EACX,aAAa;EACb,qBAAqB;EACrB,gBAAgB;CACjB;CACA,OAAO,OAAO;EACb,OAAO,0BAA0B,KAAK;CACvC;AACD;AACA,MAAM,wBAAwB,IAAI,sBAAsB"}
|
package/dist/family.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { n as MongoControlAdapterDescriptor, t as MongoControlAdapter } from "./
|
|
|
4
4
|
import { t as MongoContractView$1 } from "./mongo-contract-view-AnejqfrQ-BaCFT0xm.mjs";
|
|
5
5
|
import { n as MongoContractSerializerBase, r as MongoSchemaVerifierBase, t as MongoContractSerializer } from "./ir-CQrenTYt.mjs";
|
|
6
6
|
import { t as MongoMigration } from "./migration-CNDQv5yB.mjs";
|
|
7
|
-
import { r as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./pack-
|
|
7
|
+
import { r as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./pack-ByR2mQ_8.mjs";
|
|
8
8
|
import "./runtime-DPkRW4iu.mjs";
|
|
9
9
|
import { n as verifyMongoSchema, t as VerifyMongoSchemaOptions } from "./schema-verify-DJGr28XW.mjs";
|
|
10
10
|
export { MongoMigration as Migration, MongoContractSerializer, MongoContractSerializerBase, MongoContractView$1 as MongoContractView, type MongoControlAdapter, type MongoControlAdapterDescriptor, type MongoControlExtensionDescriptor, type MongoControlFamilyInstance, type MongoControlTargetDescriptor, MongoSchemaVerifierBase, type VerifyMongoSchemaOptions, canonicalizeSchemasForVerification, contractToMongoSchemaIR, createMongoFamilyInstance, defaultMongoDomainNamespaceId, defaultMongoStorageNamespaceId, diffMongoSchemas, formatMongoOperations, mongoFamilyDescriptor, mongoFamilyEntityTypes, mongoFamilyPslBlockDescriptors, mongoOperationsToPreview, verifyMongoSchema };
|
package/dist/family.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as defaultMongoDomainNamespaceId, l as defaultMongoStorageNamespaceId } from "./dist-DHrEJnhK.mjs";
|
|
2
2
|
import { i as verifyMongoSchema, n as contractToMongoSchemaIR, r as diffMongoSchemas, t as canonicalizeSchemasForVerification } from "./verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs";
|
|
3
|
-
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-
|
|
3
|
+
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-Do4eLmih-DIruXcuT.mjs";
|
|
4
4
|
import { n as MongoContractSerializerBase, t as MongoContractSerializer } from "./mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs";
|
|
5
|
-
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-
|
|
5
|
+
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-BNRwpUCl.mjs";
|
|
6
6
|
import { t as MongoContractView$1 } from "./mongo-contract-view-rcWzby6f-wRBCUnBt.mjs";
|
|
7
7
|
import { t as MongoSchemaVerifierBase } from "./ir-Ch2aPr7a.mjs";
|
|
8
8
|
import { t as MongoMigration } from "./migration-dcM7u4HG.mjs";
|
package/dist/family__control.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as contractToMongoSchemaIR, r as diffMongoSchemas, t as canonicalizeSchemasForVerification } from "./verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs";
|
|
2
|
-
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-
|
|
2
|
+
import { i as mongoOperationsToPreview, n as formatMongoOperations, r as mongoFamilyDescriptor, t as createMongoFamilyInstance } from "./control-BNRwpUCl.mjs";
|
|
3
3
|
export { canonicalizeSchemasForVerification, contractToMongoSchemaIR, createMongoFamilyInstance, diffMongoSchemas, formatMongoOperations, mongoFamilyDescriptor, mongoOperationsToPreview };
|
package/dist/family__pack.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mongoFamilyPack, r as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./pack-
|
|
1
|
+
import { n as mongoFamilyPack, r as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./pack-ByR2mQ_8.mjs";
|
|
2
2
|
export { mongoFamilyPack as default, mongoFamilyEntityTypes, mongoFamilyPslBlockDescriptors };
|
package/dist/family__pack.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as mongoAttributeSpecs } from "./interpreter-BAcUM6H7-DNUcUApV.mjs";
|
|
2
|
+
import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from "./authoring-entity-types-Do4eLmih-DIruXcuT.mjs";
|
|
2
3
|
//#region ../../../2-mongo-family/9-family/dist/pack.mjs
|
|
3
4
|
const mongoFamilyPack = {
|
|
4
5
|
kind: "family",
|
|
@@ -7,7 +8,8 @@ const mongoFamilyPack = {
|
|
|
7
8
|
version: "0.0.1",
|
|
8
9
|
authoring: {
|
|
9
10
|
entityTypes: mongoFamilyEntityTypes,
|
|
10
|
-
pslBlockDescriptors: mongoFamilyPslBlockDescriptors
|
|
11
|
+
pslBlockDescriptors: mongoFamilyPslBlockDescriptors,
|
|
12
|
+
attributeSpecs: mongoAttributeSpecs
|
|
11
13
|
}
|
|
12
14
|
};
|
|
13
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"family__pack.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/pack.mjs"],"sourcesContent":["import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from \"./authoring-entity-types-
|
|
1
|
+
{"version":3,"file":"family__pack.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/pack.mjs"],"sourcesContent":["import { n as mongoFamilyPslBlockDescriptors, t as mongoFamilyEntityTypes } from \"./authoring-entity-types-Do4eLmih.mjs\";\nimport { mongoAttributeSpecs } from \"@internal/mongo-contract-psl\";\n//#region src/exports/pack.ts\nconst mongoFamilyPack = {\n\tkind: \"family\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\tversion: \"0.0.1\",\n\tauthoring: {\n\t\tentityTypes: mongoFamilyEntityTypes,\n\t\tpslBlockDescriptors: mongoFamilyPslBlockDescriptors,\n\t\tattributeSpecs: mongoAttributeSpecs\n\t}\n};\n//#endregion\nexport { mongoFamilyPack as default, mongoFamilyEntityTypes, mongoFamilyPslBlockDescriptors };\n\n//# sourceMappingURL=pack.mjs.map"],"mappings":";;;AAGA,MAAM,kBAAkB;CACvB,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,WAAW;EACV,aAAa;EACb,qBAAqB;EACrB,gBAAgB;CACjB;AACD"}
|